diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4b83fbd --- /dev/null +++ b/.gitignore @@ -0,0 +1,76 @@ +# For Java +*.lck +target/ +*.json +log/ +logback-test.xml + + +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# Image snapshot diff +__diff_output__/ +/jest-stare + +*.iml +.idea/ +.ipr +.iws +*~ +~* +*.diff +*.patch +*.bak +.DS_Store +Thumbs.db +.project +.*proj +.svn/ +*.swp +*.swo +*.log +*.log.* +*.json.gzip +node_modules/ +.buildpath +.settings +dist +npm-debug.log +nohup.out +_site +_data +report.html +/lib +/es +elasticsearch-* +config/base.yaml +/.vscode/ +/coverage +/.history +*.tmp +!**/nacos/target +**/nacos/data/* +**/nacos/logs/* +**/seata/bin/* diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a53e5e2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +# 基础镜像 +FROM bellsoft/liberica-openjre-rocky:21 +# FROM bellsoft/liberica-openjre-rocky:17 +# FROM bellsoft/liberica-openjre-rocky:11 +# FROM bellsoft/liberica-openjre-rocky:8 +LABEL maintainer=yunzhupaas-team + +# 设置时区 +ENV TZ=Asia/Shanghai +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +# 解决连接SQLServer安全错误 +# 如您使用SQLServer数据库,把以下注释取消 +# COPY security/java.security /opt/java/openjdk/lib/security + +# 指定运行时的工作目录 +WORKDIR /data/yunzhupaassoft/javaApi + +# 将构建产物jar包拷贝到运行时目录中 +COPY yunzhupaas-admin/target/*.jar ./yunzhupaas-admin.jar + +# 指定容器内运行端口 +EXPOSE 30000 + +# 指定容器启动时要运行的命令 +ENTRYPOINT ["/bin/sh","-c","java -Dfile.encoding=utf8 -Djava.security.egd=file:/dev/./urandom -jar yunzhupaas-admin.jar"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..395fa93 --- /dev/null +++ b/README.md @@ -0,0 +1,481 @@ +> 特别说明:源码、JDK、数据库、Redis等安装或存放路径禁止包含中文、空格、特殊字符等 + +## 一 技术栈 + +- 编辑语言:`Java8/11`、`Java17/21` +- 主框架:`Spring Boot 2.7/3.2` + `Spring Framework` +- 持久层框架:`MyBatis-Plus` +- 数据库连接池:`Alibaba Druid` +- 多数据源:`Dynamic-Datasource` +- 数据库兼容: `MySQL`(默认)、`SQLServer`、`Oracle`、`PostgreSQL`、`达数据库`、`人大金仓数据库` +- 分库分表解决方案:`Apache ShardingSphere` +- 权限认证框架:`Sa-Token`+`JWT` +- 代码生成器:`MyBatis-Plus-Generator` +- 流程引擎:`Flowable 6.7` +- 模板引擎:`Velocity` +- 任务调度:`XXL-JOB` +- 分布式锁:`Lock4j` +- JSON序列化: `Jackson`&`Fastjson` +- 缓存数据库:`Redis` +- 校验框架:`Validation` +- 分布式文件存储:兼容`MinIO`及多个云对象存储,如阿里云 OSS、华为云 OBS、七牛云 Kodo、腾讯云 COS等 +- 工具类框架:`Hutool`、`Lombok` +- 接口文档:`Knife4j` +- 项目构建:`Maven` + +## 二 环境要求 + +### 2.1 开发环境 + +| 类目 | 版本说明或建议 | +| --- |------------------| +| 硬件 | 开发电脑建议使用I3及以上CPU,16G及以上内存 | +| 操作系统 | Windows 10/11,MacOS | +| JDK | 默认使用JDK 21,如需要切换JDK 8/11/17版本请参考文档调整代码,推荐使用 `OpenJDK`,如 `Liberica JDK`、`Eclipse Temurin`、`Alibaba Dragonwell`、`BiSheng` 等发行版; | +| Maven | 依赖管理工具,推荐使用 `3.6.3` 及以上版本 | +| Redis | 数据缓存,推荐使用 `5.0` 及以上版本 | +| 数据库 | 兼容 `MySQL 5.7.x/8.x`、`SQLServer 2012+`、`Oracle 11g`、`PostgreSQL 12+`、`达梦数据库(DM8)`、`人大金仓数据库(KingbaseES_V8R6)` | +| IDE | 代码集成开发环境,推荐使用 `IDEA2024` 及以上版本,兼容 `Eclipse`、 `Spring Tool Suite` 等IDE工具 | +| 文件存储 | 默认使用本地存储,兼容 `MinIO` 及多个云对象存储,如 `阿里云 OSS`、`华为云 OBS`、`七牛云 Kodo`、`腾讯云 COS` 等; | + +### 2.2 运行环境 + +> 适用于测试或生产环境 + +| 类目 | 版本说明或建议 | +| --- |--------------| +| 服务器配置 | 建议至少在 `4C/16G/50G` 的机器配置下运行; | +| 操作系统 | 建议使用 `Windows Server 2019` 及以上版本或主流 `Linux` 发行版本,推荐使用 `Linux` 环境;兼容 `统信UOS`,`OpenEuler`,`麒麟服务器版` 等信创环境; | +| JRE | 默认使用JRE 21,如需要切换JRE 8/11/17版本请参考文档调整代码;推荐使用 `OpenJDK`,如 `Liberica JDK`、`Eclipse Temurin`、`Alibaba Dragonwell`、`BiSheng` 等发行版; | +| Redis | 数据缓存,推荐使用 `5.0` 及以上版本 | +| 数据库 | 兼容 `MySQL 5.7.x/8.x`、`SQLServer 2012+`、`Oracle 11g`、`PostgreSQL 12+`、`达梦数据库(DM8)`、`人大金仓数据库(KingbaseES_V8R6)` | +| 中间件(兼容)) | 东方通 `Tong-web`、金蝶天燕-应用服务器`AAS` v10; | +| 文件存储 | 默认使用本地存储,兼容 `MinIO` 及多个云对象存储,如 `阿里云 OSS`、`华为云 OBS`、`七牛云 Kodo`、`腾讯云 COS` 等; | + +## 三 IDEA插件 + +- `Lombok`(必须) +- `Alibaba Java Coding Guidelines` +- `MybatisX` + +## 四 Maven私服配置 + +> 建议使用 Apache Maven 3.6.3 及以上版本
以解决依赖无法从公共Maven仓库下载的问题
通过官方私服下载依赖完成后,由于IDEA的缓存可能会出现部分报红,重启IDEA即可 + +打开Maven安装目录中的 `conf/settings.xml` 文件,
+在 `` 中添加如下内容 + +```xml + + maven-releases + admin + admin123 + +``` + +在 `` 中添加 + +```xml + + maven-releases + * + maven-releases + http://127.0.0.1:7777/repository/maven-public/ + +``` + +## 五 配套项目 + +| 项目 | 分支 | 说明 | +| --- |---------------|-------------------| +| **后端** | | | +| yunzhupaas-common | v5.2.x-stable | java基础依赖项目源码 | +| yunzhupaas-datareport | v5.2.x-stable | 报表后端项目源码 | +| yunzhupaas-file-core-starter | v5.2.x-stable | 文件基础依赖项目源码 | +| yunzhupaas-file-preview | v5.1.xstable | 本地文档预览项目源码 | +| yunzhupaas-java-datareport-univer | v5.2.x-stable | Java Univer报表源码 | +| yunzhupaas-java-datareport-univer-core | v5.2.x-stable | Java Univer报表核心依赖源码,不同销售版本交付有所差异,具体实际交付为准 | +| yunzhupaas-java-tenant | v5.2.x-stable | 多租户后端源码,不同销售版本交付有所差异,具体实际交付为准 | +| yunzhupaas-scheduletask | v5.2.x-stable | 任务调度客户端依赖及服务端项目源码 | +| yunzhupaas-workflow | v1.0.0-stable | 流程引擎后端项目 | +| yunzhupaas-workflow-core | v1.0.0-stable | Flowable流程引擎基础依赖,不同销售版本交付有所差异,具体实际交付为准 | +| **前端** | | | +| yunzhupaas-web-datareport | v5.2.x-stable | 报表前端项目源码 | +| yunzhupaas-web-datascreen-vue3 | v5.2.x-stable | 前端大屏项目源码(Vue3) | +| yunzhupaas-web-tenant-vue3 | v5.2.x-stable | 多租户前端项目源码(Vue3),不同销售版本交付有所差异,具体实际交付为准 | +| yunzhupaas-web-vue3 | v5.2.x-stable | 前端主项目源码(Vue3) | +| **移动端** | | | | +| yunzhupaas-app-vue3 | v5.2.x-stable | 移动端项目源码(Vue3) | +| **静态资源** | | | | +| yunzhupaas-resources | v5.2.x-stable | 静态资源 | +| **数据库** | | | +| yunzhupaas-database | v5.2.x-stable | 数据库脚本或文件 | + +## 六 开发环境 + +### 6.1 导入数据库脚本 + +> 以 MySQL数据库为例
字符集:`utf8mb4`
排序规则:`utf8mb4_general_ci` + +#### 6.1.1 创建平台数据库 + +在MySQL中创建 `yunzhupaas_init` 数据库,并将 `yunzhupaas-database/MySQL/yunzhupaas_db_init.sql` 方式导入。
+若需要使用纯净数据库(不含Demo示例),则以【新建查询】方式导入 `yunzhupaas_dbnull_init.sql` 。 +若有更新脚本(Update目录下),按日期顺序执行更新 + +#### 6.1.2 创建系统调度数据库 + +在MySQL创建 `yunzhupaas_xxjob` 数据库,并将 `yunzhupaas-database/MySQL/yunzhupaas_xxjob_init.sql` 导入; + +#### 6.1.3 创建流程数据库 + +在MySQL创建 `yunzhupaas_flow` 数据库,并将 `yunzhupaas-database/MySQL/yunzhupaas_flow_init.sql` 导入; + +### 6.2 导入依赖 + +#### 6.2.1 基础依赖 + +详见 `yunzhupaas-common` 项目中的 `README.md` 文档说明 + +#### 6.2.2 文件基础依赖 + +详见 `yunzhupaas-file-starter` 项目中的 `README.md` 文档说明 + +#### 6.2.3 导入系统调度服务端 + +详见 `yunzhupaas-scheduletask` 项目中的 `README.md` 文档说明 + +### 6.3 配套项目 + +#### 6.3.1 yunzhupaas-datareport 报表后端项目 + +详见 `yunzhupaas-datareport` 项目中的 `README.md` 文档说明 + +#### 6.3.2 yunzhupaas-java-datareport-univer Java Univer报表后端项目 + +详见 `yunzhupaas-java-datareport-univer` 项目中的 `README.md` 文档说明 + +#### 6.3.3 yunzhupaas-workflow 工作流引擎后端项目 + +详见 `yunzhupaas-workflow` 项目中的 `README.md` 文档说明 + +### 6.4 项目配置 + +打开编辑 `yunzhupaas-admin/src/main/resources/application.yml` + +#### 6.4.1 指定环境配置 + +环境说明: + +- `application-dev.yml` 开发环境(默认) +- `application-test.yml` 测试环境 +- `application-preview.yml` 预发布环境 +- `application-prod.yml` 生产环境 + +> 以开发环境为例,根据实际需求修改 + +```yaml +# application.yml第6行,可选值:dev(开发环境-默认)、test(测试环境)、preview(预生产)、prod(生产环境) +active: dev +``` + +#### 6.4.2 配置域名 + +打开编辑 `yunzhupaas-admin/src/main/resources/application.yml` ,修改以下配置 + +```yaml + PreviewType: kkfile #文件预览方式 (1.yozo 2.kkfile)默认使用kkfile + kkFileUrl: http://127.0.0.1:30090/FileServer/ #kkfile文件预览服务地址 + ApiDomain: http://127.0.0.1:30000 #后端域名(文档预览中使用) + FrontDomain: http://127.0.0.1:3000 #前端域名(文档预览中使用) + AppDomain: http://127.0.0.1:8080 #app/h5端域名配置(文档预览中使用) + FlowDomain: http://127.0.0.1:31000 #流程引擎接口地址 +``` + +#### 6.4.3 数据源配置 + +配置参数说明: + +- `db-type`:数据库类型(可选值:`MySQL`、`SQLServer`、`Oracle`、`PostgreSQL`、`DM`、`KingbaseES`) +- `host`:数据库主机地址 +- `port`:数据库端口 +- `dbname`:平台初始库 +- `username`:数据库用户名 +- `password`:数据库密码 +- `db-schema`:数据库模式 +- `prepare-url`:自定义JDBC连接配置 + +打开编辑 `yunzhupaas-admin/src/main/resources/application-dev.yml`,修改以下配置 + +##### 6.4.3.1 MySQL数据库 + +```yaml + datasource: + db-type: MySQL + host: 127.0.0.1 + port: 3306 + db-name: yunzhupaas_init + username: dbuser + password: dbpasswd + db-schema: + prepare-url: +``` + +##### 6.4.3.2 SQLServer数据库 + +```yaml + datasource: + db-type: SQLServer + host: 127.0.0.1 + port: 1433 + db-name: yunzhupaas_init + username: dbuser + password: dbpasswd + db-schema: + prepare-url: +``` + +##### 6.4.3.3 Oracle数据库 + +```yaml + datasource: + db-type: Oracle + host: 127.0.0.1 + port: 1521 + db-name: + username: YUNZHUPAAS_INIT + password: dbpasswd + db-schema: + prepare-url: jdbc:oracle:thin:@127.0.0.1:1521:ORCL +``` + +##### 6.4.3.4 PostgreSQL数据库配置 + +```yaml + datasource: + db-type: PostgreSQL + host: 127.0.0.1 + port: 5432 + db-name: yunzhupaas_init + username: dbuser + password: dbpasswd + db-schema: public + prepare-url: +``` + +##### 6.4.3.5 达梦(DM8)数据库 + +```yaml + datasource: + db-type: DM + host: 127.0.0.1 + port: 5236 + db-name: YUNZHUPAAS_INIT + username: DBUSER + password: dbpasswd + db-schema: + prepare-url: + tablespace: MAIN +``` + +##### 6.4.3.6 人大金仓(KingbaseES_V8R6)数据库 + +```yaml + datasource: + db-type: KingbaseES + host: 127.0.0.1 + port: 54321 + db-name: yunzhupaas_init + username: dbuser + password: dbpasswd + db-schema: + prepare-url: +``` + +#### 6.4.4 Redis配置 + +打开编辑 `yunzhupaas-admin/src/main/resources/application-dev.yml`,修改以下配置 +> 支持单机模式和集群模式,配置默认为单机模式 + +**若使用Redis单机模式** + +```yaml + redis: + database: 1 #缓存库编号 + host: 127.0.0.1 + port: 6379 + password: 123456 # 密码为空时,请将本行注释 + timeout: 3000 #超时时间(单位:秒) + lettuce: #Lettuce为Redis的Java驱动包 + pool: + max-active: 8 # 连接池最大连接数 + max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) + min-idle: 0 # 连接池中的最小空闲连接 + max-idle: 8 # 连接池中的最大空闲连接 +``` + +**若使用Redis集群模式** + +```yaml + redis: + cluster: + nodes: + - 192.168.0.225:6380 + - 192.168.0.225:6381 + - 192.168.0.225:6382 + - 192.168.0.225:6383 + - 192.168.0.225:6384 + - 192.168.0.225:6385 + password: 123456 # 密码为空时,请将本行注释 + timeout: 3000 # 超时时间(单位:秒) + lettuce: #Lettuce为Redis的Java驱动包 + pool: + max-active: 8 # 连接池最大连接数 + max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) + min-idle: 0 # 连接池中的最小空闲连接 + max-idle: 8 # 连接池中的最大空闲连接 +``` + +#### 6.4.5 静态资源配置 + +打开编辑 `yunzhupaas-admin/src/main/resources/application-dev.yml` ,修改以下配置 +> 默认使用本地存储,兼容 `MinIO` 及多个云对象存储,如阿里云 OSS、华为云 OBS、七牛云 Kodo、腾讯云 COS等 + +```yaml + # ===================== 文件存储配置 ===================== + file-storage: #文件存储配置,不使用的情况下可以不写 + default-platform: local-plus-1 #默认使用的存储平台 + thumbnail-suffix: ".min.jpg" #缩略图后缀,例如【.min.jpg】【.png】 + local-plus: # 本地存储升级版 + - platform: local-plus-1 # 存储平台标识 + enable-storage: true #启用存储 + enable-access: true #启用访问(线上请使用 Nginx 配置,效率更高) + domain: "" # 访问域名,例如:“http://127.0.0.1:8030/”,注意后面要和 path-patterns 保持一致,“/”结尾,本地存储建议使用相对路径,方便后期更换域名 + base-path: D:/project/yunzhupaas-resources/ # 基础路径 + path-patterns: /** # 访问路径 + storage-path: # 存储路径 + aliyun-oss: # 阿里云 OSS ,不使用的情况下可以不写 + - platform: aliyun-oss-1 # 存储平台标识 + enable-storage: false # 启用存储 + access-key: ?? + secret-key: ?? + end-point: ?? + bucket-name: ?? + domain: ?? # 访问域名,注意“/”结尾,例如:https://abc.oss-cn-shanghai.aliyuncs.com/ + base-path: hy/ # 基础路径 + qiniu-kodo: # 七牛云 kodo ,不使用的情况下可以不写 + - platform: qiniu-kodo-1 # 存储平台标识 + enable-storage: false # 启用存储 + access-key: ?? + secret-key: ?? + bucket-name: ?? + domain: ?? # 访问域名,注意“/”结尾,例如:http://abc.hn-bkt.clouddn.com/ + base-path: base/ # 基础路径 + tencent-cos: # 腾讯云 COS + - platform: tencent-cos-1 # 存储平台标识 + enable-storage: false # 启用存储 + secret-id: ?? + secret-key: ?? + region: ?? #存仓库所在地域 + bucket-name: ?? + domain: ?? # 访问域名,注意“/”结尾,例如:https://abc.cos.ap-nanjing.myqcloud.com/ + base-path: hy/ # 基础路径 + minio: # MinIO,由于 MinIO SDK 支持 AWS S3,其它兼容 AWS S3 协议的存储平台也都可配置在这里 + - platform: minio-1 # 存储平台标识 + enable-storage: true # 启用存储 + access-key: Q9jJs2b6Tv + secret-key: Thj2WkpLu9DhmJyJ + end-point: http://192.168.0.207:9000/ + bucket-name: yunzhupaassoftoss + domain: # 访问域名,注意“/”结尾,例如:http://minio.abc.com/abc/ + base-path: # 基础路径 +``` + +#### 6.4.6 第三方登录配置 + +打开编辑 `yunzhupaas-admin/src/main/resources/application-dev.yml` ,修改以下配置 +> 配置默认关闭 + +```yaml +socials: + # 第三方登录功能开关(false-关闭,true-开启) + socials-enabled: false + config: + - # 微信 + provider: wechat_open + client-id: your-client-id + client-secret: your-client-secret + - # qq + provider: qq + client-id: your-client-id + client-secret: your-client-secret + - # 企业微信 + provider: wechat_enterprise + client-id: your-client-id + client-secret: your-client-secret + agentId: your-agentId + - # 钉钉 + provider: dingtalk + client-id: your-client-id + client-secret: your-client-secret + agentId: your-agentId + - # 飞书 + provider: feishu + client-id: your-client-id + client-secret: your-client-secret + - # 小程序 + provider: wechat_applets + client-id: your-client-id + client-secret: your-client-secret +``` +#### 6.4.7 任务调度配置 + +打开编辑 `yunzhupaas-admin/src/main/resources/application-dev.yml` ,修改以下配置,调整 xxl.job.admin.addresses 地址 + +```yaml +xxl: + job: + accessToken: '432e62f3b488bc861d91b0e274e850cc' + i18n: zh_CN + logretentiondays: 30 + triggerpool: + fast: + max: 200 + slow: + max: 100 + # xxl-job服务端地址 + admin: + addresses: http://127.0.0.1:30020/xxl-job-admin/ + executor: + address: '' + appname: xxl-job-executor-sample1 + ip: '' + logpath: /data/applogs/xxl-job/jobhandler + logretentiondays: 30 + port: 9999 + # rest调用xxl-job接口地址 + admin: + register: + handle-query-address: ${xxl.job.admin.addresses}api/handler/queryList + job-info-address: ${xxl.job.admin.addresses}api/jobinfo + log-query-address: ${xxl.job.admin.addresses}api/log + task-list-address: ${xxl.job.admin.addresses}api/ScheduleTask/List + task-info-address: ${xxl.job.admin.addresses}api/ScheduleTask/getInfo + task-save-address: ${xxl.job.admin.addresses}api/ScheduleTask + task-update-address: ${xxl.job.admin.addresses}api/ScheduleTask + task-remove-address: ${xxl.job.admin.addresses}api/ScheduleTask/remove + task-start-or-remove-address: ${xxl.job.admin.addresses}api/ScheduleTask/updateTask +``` +## 七 启动项目 + +找到`yunzhupaas-admin/src/main/java/YunzhupaasAdminApplication.java`,右击运行即可。 + +## 八 项目发布 + +- 在IDEA中,双击右侧Maven中 `yunzhupaas-java-boot` > `Lifecycle` > `clean` 清理项目 +- 在IDEA中,双击右侧Maven中 `yunzhupaas-java-boot` > `Lifecycle` > `package` 打包项目 +- 打开 `yunzhupaas-java-boot\yunzhupaas-admin\target`,将 `yunzhupaas-admin-5.2.0-RELEASE.jar` 上传至服务器 + +## 九 接口文档 + +- `http://localhost:30000/doc.html` diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..cd9e41e --- /dev/null +++ b/pom.xml @@ -0,0 +1,55 @@ + + + + com.yunzhupaas + yunzhupaas-common + 5.2.0-RELEASE + + 4.0.0 + + com.yunzhupaas + yunzhupaas-java-boot + pom + 5.2.0-RELEASE + + + yunzhupaas-admin + yunzhupaas-oauth + yunzhupaas-system + yunzhupaas-public/yunzhupaas-common-all + yunzhupaas-example + yunzhupaas-extend + yunzhupaas-visualdev + + yunzhupaas-file + yunzhupaas-exception + yunzhupaas-visualdata + yunzhupaas-app + yunzhupaas-permission + yunzhupaas-scheduletask + yunzhupaas-message + yunzhupaas-public/yunzhupaas-provider + yunzhupaas-public/yunzhupaas-generater-base + yunzhupaas-flowable + yunzhupaas-train + yunzhupaas-mdm + yunzhupaas-crm + yunzhupaas-pcm + + + + + + + + + + + + + + + + diff --git a/security/java.security b/security/java.security new file mode 100644 index 0000000..5c1d5ce --- /dev/null +++ b/security/java.security @@ -0,0 +1,1304 @@ +# +# This is the "master security properties file". +# +# An alternate java.security properties file may be specified +# from the command line via the system property +# +# -Djava.security.properties= +# +# This properties file appends to the master security properties file. +# If both properties files specify values for the same key, the value +# from the command-line properties file is selected, as it is the last +# one loaded. +# +# Also, if you specify +# +# -Djava.security.properties== (2 equals), +# +# then that properties file completely overrides the master security +# properties file. +# +# To disable the ability to specify an additional properties file from +# the command line, set the key security.overridePropertiesFile +# to false in the master security properties file. It is set to true +# by default. + +# In this file, various security properties are set for use by +# java.security classes. This is where users can statically register +# Cryptography Package Providers ("providers" for short). The term +# "provider" refers to a package or set of packages that supply a +# concrete implementation of a subset of the cryptography aspects of +# the Java Security API. A provider may, for example, implement one or +# more digital signature algorithms or message digest algorithms. +# +# Each provider must implement a subclass of the Provider class. +# To register a provider in this master security properties file, +# specify the Provider subclass name and priority in the format +# +# security.provider.= +# +# This declares a provider, and specifies its preference +# order n. The preference order is the order in which providers are +# searched for requested algorithms (when no specific provider is +# requested). The order is 1-based; 1 is the most preferred, followed +# by 2, and so on. +# +# must specify the subclass of the Provider class whose +# constructor sets the values of various properties that are required +# for the Java Security API to look up the algorithms or other +# facilities implemented by the provider. +# +# There must be at least one provider specification in java.security. +# There is a default provider that comes standard with the JDK. It +# is called the "SUN" provider, and its Provider subclass +# named Sun appears in the sun.security.provider package. Thus, the +# "SUN" provider is registered via the following: +# +# security.provider.1=sun.security.provider.Sun +# +# (The number 1 is used for the default provider.) +# +# Note: Providers can be dynamically registered instead by calls to +# either the addProvider or insertProviderAt method in the Security +# class. + +# +# List of providers and their preference orders (see above): +# +security.provider.1=sun.security.provider.Sun +security.provider.2=sun.security.rsa.SunRsaSign +security.provider.3=sun.security.ec.SunEC +security.provider.4=com.sun.net.ssl.internal.ssl.Provider +security.provider.5=com.sun.crypto.provider.SunJCE +security.provider.6=sun.security.jgss.SunProvider +security.provider.7=com.sun.security.sasl.Provider +security.provider.8=org.jcp.xml.dsig.internal.dom.XMLDSigRI +security.provider.9=sun.security.smartcardio.SunPCSC + +# +# Sun Provider SecureRandom seed source. +# +# Select the primary source of seed data for the "SHA1PRNG" and +# "NativePRNG" SecureRandom implementations in the "Sun" provider. +# (Other SecureRandom implementations might also use this property.) +# +# On Unix-like systems (for example, Solaris/Linux/MacOS), the +# "NativePRNG" and "SHA1PRNG" implementations obtains seed data from +# special device files such as file:/dev/random. +# +# On Windows systems, specifying the URLs "file:/dev/random" or +# "file:/dev/urandom" will enable the native Microsoft CryptoAPI seeding +# mechanism for SHA1PRNG. +# +# By default, an attempt is made to use the entropy gathering device +# specified by the "securerandom.source" Security property. If an +# exception occurs while accessing the specified URL: +# +# SHA1PRNG: +# the traditional system/thread activity algorithm will be used. +# +# NativePRNG: +# a default value of /dev/random will be used. If neither +# are available, the implementation will be disabled. +# "file" is the only currently supported protocol type. +# +# The entropy gathering device can also be specified with the System +# property "java.security.egd". For example: +# +# % java -Djava.security.egd=file:/dev/random MainClass +# +# Specifying this System property will override the +# "securerandom.source" Security property. +# +# In addition, if "file:/dev/random" or "file:/dev/urandom" is +# specified, the "NativePRNG" implementation will be more preferred than +# SHA1PRNG in the Sun provider. +# +securerandom.source=file:/dev/random + +# +# A list of known strong SecureRandom implementations. +# +# To help guide applications in selecting a suitable strong +# java.security.SecureRandom implementation, Java distributions should +# indicate a list of known strong implementations using the property. +# +# This is a comma-separated list of algorithm and/or algorithm:provider +# entries. +# +securerandom.strongAlgorithms=NativePRNGBlocking:SUN + +# +# Class to instantiate as the javax.security.auth.login.Configuration +# provider. +# +login.configuration.provider=sun.security.provider.ConfigFile + +# +# Default login configuration file +# +#login.config.url.1=file:${user.home}/.java.login.config + +# +# Class to instantiate as the system Policy. This is the name of the class +# that will be used as the Policy object. +# +policy.provider=sun.security.provider.PolicyFile + +# The default is to have a single system-wide policy file, +# and a policy file in the user's home directory. +policy.url.1=file:${java.home}/lib/security/java.policy +policy.url.2=file:${user.home}/.java.policy + +# whether or not we expand properties in the policy file +# if this is set to false, properties (${...}) will not be expanded in policy +# files. +policy.expandProperties=true + +# whether or not we allow an extra policy to be passed on the command line +# with -Djava.security.policy=somefile. Comment out this line to disable +# this feature. +policy.allowSystemProperty=true + +# whether or not we look into the IdentityScope for trusted Identities +# when encountering a 1.1 signed JAR file. If the identity is found +# and is trusted, we grant it AllPermission. +policy.ignoreIdentityScope=false + +# +# Default keystore type. +# +keystore.type=jks + +# +# Controls compatibility mode for the JKS keystore type. +# +# When set to 'true', the JKS keystore type supports loading +# keystore files in either JKS or PKCS12 format. When set to 'false' +# it supports loading only JKS keystore files. +# +keystore.type.compat=true + +# +# List of comma-separated packages that start with or equal this string +# will cause a security exception to be thrown when +# passed to checkPackageAccess unless the +# corresponding RuntimePermission ("accessClassInPackage."+package) has +# been granted. +package.access=sun.,\ + com.sun.xml.internal.,\ + com.sun.imageio.,\ + com.sun.istack.internal.,\ + com.sun.jmx.,\ + com.sun.media.sound.,\ + com.sun.naming.internal.,\ + com.sun.proxy.,\ + com.sun.corba.se.,\ + com.sun.org.apache.bcel.internal.,\ + com.sun.org.apache.regexp.internal.,\ + com.sun.org.apache.xerces.internal.,\ + com.sun.org.apache.xpath.internal.,\ + com.sun.org.apache.xalan.internal.extensions.,\ + com.sun.org.apache.xalan.internal.lib.,\ + com.sun.org.apache.xalan.internal.res.,\ + com.sun.org.apache.xalan.internal.templates.,\ + com.sun.org.apache.xalan.internal.utils.,\ + com.sun.org.apache.xalan.internal.xslt.,\ + com.sun.org.apache.xalan.internal.xsltc.cmdline.,\ + com.sun.org.apache.xalan.internal.xsltc.compiler.,\ + com.sun.org.apache.xalan.internal.xsltc.trax.,\ + com.sun.org.apache.xalan.internal.xsltc.util.,\ + com.sun.org.apache.xml.internal.res.,\ + com.sun.org.apache.xml.internal.resolver.helpers.,\ + com.sun.org.apache.xml.internal.resolver.readers.,\ + com.sun.org.apache.xml.internal.security.,\ + com.sun.org.apache.xml.internal.serializer.utils.,\ + com.sun.org.apache.xml.internal.utils.,\ + com.sun.org.glassfish.,\ + com.oracle.xmlns.internal.,\ + com.oracle.webservices.internal.,\ + oracle.jrockit.jfr.,\ + org.jcp.xml.dsig.internal.,\ + jdk.internal.,\ + jdk.nashorn.internal.,\ + jdk.nashorn.tools.,\ + jdk.xml.internal.,\ + com.sun.activation.registries.,\ + jdk.jfr.events.,\ + jdk.jfr.internal.,\ + jdk.management.jfr.internal. + +# +# List of comma-separated packages that start with or equal this string +# will cause a security exception to be thrown when +# passed to checkPackageDefinition unless the +# corresponding RuntimePermission ("defineClassInPackage."+package) has +# been granted. +# +# by default, none of the class loaders supplied with the JDK call +# checkPackageDefinition. +# +package.definition=sun.,\ + com.sun.xml.internal.,\ + com.sun.imageio.,\ + com.sun.istack.internal.,\ + com.sun.jmx.,\ + com.sun.media.sound.,\ + com.sun.naming.internal.,\ + com.sun.proxy.,\ + com.sun.corba.se.,\ + com.sun.org.apache.bcel.internal.,\ + com.sun.org.apache.regexp.internal.,\ + com.sun.org.apache.xerces.internal.,\ + com.sun.org.apache.xpath.internal.,\ + com.sun.org.apache.xalan.internal.extensions.,\ + com.sun.org.apache.xalan.internal.lib.,\ + com.sun.org.apache.xalan.internal.res.,\ + com.sun.org.apache.xalan.internal.templates.,\ + com.sun.org.apache.xalan.internal.utils.,\ + com.sun.org.apache.xalan.internal.xslt.,\ + com.sun.org.apache.xalan.internal.xsltc.cmdline.,\ + com.sun.org.apache.xalan.internal.xsltc.compiler.,\ + com.sun.org.apache.xalan.internal.xsltc.trax.,\ + com.sun.org.apache.xalan.internal.xsltc.util.,\ + com.sun.org.apache.xml.internal.res.,\ + com.sun.org.apache.xml.internal.resolver.helpers.,\ + com.sun.org.apache.xml.internal.resolver.readers.,\ + com.sun.org.apache.xml.internal.security.,\ + com.sun.org.apache.xml.internal.serializer.utils.,\ + com.sun.org.apache.xml.internal.utils.,\ + com.sun.org.glassfish.,\ + com.oracle.xmlns.internal.,\ + com.oracle.webservices.internal.,\ + oracle.jrockit.jfr.,\ + org.jcp.xml.dsig.internal.,\ + jdk.internal.,\ + jdk.nashorn.internal.,\ + jdk.nashorn.tools.,\ + jdk.xml.internal.,\ + com.sun.activation.registries.,\ + jdk.jfr.events.,\ + jdk.jfr.internal.,\ + jdk.management.jfr.internal. + +# +# Determines whether this properties file can be appended to +# or overridden on the command line via -Djava.security.properties +# +security.overridePropertiesFile=true + +# +# Determines the default key and trust manager factory algorithms for +# the javax.net.ssl package. +# +ssl.KeyManagerFactory.algorithm=SunX509 +ssl.TrustManagerFactory.algorithm=PKIX + +# +# The Java-level namelookup cache policy for successful lookups: +# +# any negative value: caching forever +# any positive value: the number of seconds to cache an address for +# yunzhupaas: do not cache +# +# default value is forever (FOREVER). For security reasons, this +# caching is made forever when a security manager is set. When a security +# manager is not set, the default behavior in this implementation +# is to cache for 30 seconds. +# +# NOTE: setting this to anything other than the default value can have +# serious security implications. Do not set it unless +# you are sure you are not exposed to DNS spoofing attack. +# +#networkaddress.cache.ttl=-1 + +# The Java-level namelookup cache policy for failed lookups: +# +# any negative value: cache forever +# any positive value: the number of seconds to cache negative lookup results +# yunzhupaas: do not cache +# +# In some Microsoft Windows networking environments that employ +# the WINS name service in addition to DNS, name service lookups +# that fail may take a noticeably long time to return (approx. 5 seconds). +# For this reason the default caching policy is to maintain these +# results for 10 seconds. +# +# +networkaddress.cache.negative.ttl=10 + +# +# Properties to configure OCSP for certificate revocation checking +# + +# Enable OCSP +# +# By default, OCSP is not used for certificate revocation checking. +# This property enables the use of OCSP when set to the value "true". +# +# NOTE: SocketPermission is required to connect to an OCSP responder. +# +# Example, +# ocsp.enable=true + +# +# Location of the OCSP responder +# +# By default, the location of the OCSP responder is determined implicitly +# from the certificate being validated. This property explicitly specifies +# the location of the OCSP responder. The property is used when the +# Authority Information Access extension (defined in RFC 5280) is absent +# from the certificate or when it requires overriding. +# +# Example, +# ocsp.responderURL=http://ocsp.example.net:80 + +# +# Subject name of the OCSP responder's certificate +# +# By default, the certificate of the OCSP responder is that of the issuer +# of the certificate being validated. This property identifies the certificate +# of the OCSP responder when the default does not apply. Its value is a string +# distinguished name (defined in RFC 2253) which identifies a certificate in +# the set of certificates supplied during cert path validation. In cases where +# the subject name alone is not sufficient to uniquely identify the certificate +# then both the "ocsp.responderCertIssuerName" and +# "ocsp.responderCertSerialNumber" properties must be used instead. When this +# property is set then those two properties are ignored. +# +# Example, +# ocsp.responderCertSubjectName="CN=OCSP Responder, O=XYZ Corp" + +# +# Issuer name of the OCSP responder's certificate +# +# By default, the certificate of the OCSP responder is that of the issuer +# of the certificate being validated. This property identifies the certificate +# of the OCSP responder when the default does not apply. Its value is a string +# distinguished name (defined in RFC 2253) which identifies a certificate in +# the set of certificates supplied during cert path validation. When this +# property is set then the "ocsp.responderCertSerialNumber" property must also +# be set. When the "ocsp.responderCertSubjectName" property is set then this +# property is ignored. +# +# Example, +# ocsp.responderCertIssuerName="CN=Enterprise CA, O=XYZ Corp" + +# +# Serial number of the OCSP responder's certificate +# +# By default, the certificate of the OCSP responder is that of the issuer +# of the certificate being validated. This property identifies the certificate +# of the OCSP responder when the default does not apply. Its value is a string +# of hexadecimal digits (colon or space separators may be present) which +# identifies a certificate in the set of certificates supplied during cert path +# validation. When this property is set then the "ocsp.responderCertIssuerName" +# property must also be set. When the "ocsp.responderCertSubjectName" property +# is set then this property is ignored. +# +# Example, +# ocsp.responderCertSerialNumber=2A:FF:00 + +# +# Policy for failed Kerberos KDC lookups: +# +# When a KDC is unavailable (network error, service failure, etc), it is +# put inside a blacklist and accessed less often for future requests. The +# value (case-insensitive) for this policy can be: +# +# tryLast +# KDCs in the blacklist are always tried after those not on the list. +# +# tryLess[:max_retries,timeout] +# KDCs in the blacklist are still tried by their order in the configuration, +# but with smaller max_retries and timeout values. max_retries and timeout +# are optional numerical parameters (default 1 and 5000, which means once +# and 5 seconds). Please notes that if any of the values defined here is +# more than what is defined in krb5.conf, it will be ignored. +# +# Whenever a KDC is detected as available, it is removed from the blacklist. +# The blacklist is reset when krb5.conf is reloaded. You can add +# refreshKrb5Config=true to a JAAS configuration file so that krb5.conf is +# reloaded whenever a JAAS authentication is attempted. +# +# Example, +# krb5.kdc.bad.policy = tryLast +# krb5.kdc.bad.policy = tryLess:2,2000 +krb5.kdc.bad.policy = tryLast + +# +# Kerberos cross-realm referrals (RFC 6806) +# +# OpenJDK's Kerberos client supports cross-realm referrals as defined in +# RFC 6806. This allows to setup more dynamic environments in which clients +# do not need to know in advance how to reach the realm of a target principal +# (either a user or service). +# +# When a client issues an AS or a TGS request, the "canonicalize" option +# is set to announce support of this feature. A KDC server may fulfill the +# request or reply referring the client to a different one. If referred, +# the client will issue a new request and the cycle repeats. +# +# In addition to referrals, the "canonicalize" option allows the KDC server +# to change the client name in response to an AS request. For security reasons, +# RFC 6806 (section 11) FAST scheme is enforced. +# +# Disable Kerberos cross-realm referrals. Value may be overwritten with a +# System property (-Dsun.security.krb5.disableReferrals). +sun.security.krb5.disableReferrals=false + +# Maximum number of AS or TGS referrals to avoid infinite loops. Value may +# be overwritten with a System property (-Dsun.security.krb5.maxReferrals). +sun.security.krb5.maxReferrals=5 + +# +# This property contains a list of disabled EC Named Curves that can be included +# in the jdk.[tls|certpath|jar].disabledAlgorithms properties. To include this +# list in any of the disabledAlgorithms properties, add the property name as +# an entry. +jdk.disabled.namedCurves = secp112r1, secp112r2, secp128r1, secp128r2, \ + secp160k1, secp160r1, secp160r2, secp192k1, secp192r1, secp224k1, \ + secp224r1, secp256k1, sect113r1, sect113r2, sect131r1, sect131r2, \ + sect163k1, sect163r1, sect163r2, sect193r1, sect193r2, sect233k1, \ + sect233r1, sect239k1, sect283k1, sect283r1, sect409k1, sect409r1, \ + sect571k1, sect571r1, X9.62 c2tnb191v1, X9.62 c2tnb191v2, \ + X9.62 c2tnb191v3, X9.62 c2tnb239v1, X9.62 c2tnb239v2, X9.62 c2tnb239v3, \ + X9.62 c2tnb359v1, X9.62 c2tnb431r1, X9.62 prime192v2, X9.62 prime192v3, \ + X9.62 prime239v1, X9.62 prime239v2, X9.62 prime239v3, brainpoolP256r1, \ + brainpoolP320r1, brainpoolP384r1, brainpoolP512r1 + +# +# Algorithm restrictions for certification path (CertPath) processing +# +# In some environments, certain algorithms or key lengths may be undesirable +# for certification path building and validation. For example, "MD2" is +# generally no longer considered to be a secure hash algorithm. This section +# describes the mechanism for disabling algorithms based on algorithm name +# and/or key length. This includes algorithms used in certificates, as well +# as revocation information such as CRLs and signed OCSP Responses. +# The syntax of the disabled algorithm string is described as follows: +# DisabledAlgorithms: +# " DisabledAlgorithm { , DisabledAlgorithm } " +# +# DisabledAlgorithm: +# AlgorithmName [Constraint] { '&' Constraint } | IncludeProperty +# +# AlgorithmName: +# (see below) +# +# Constraint: +# KeySizeConstraint | CAConstraint | DenyAfterConstraint | +# UsageConstraint +# +# KeySizeConstraint: +# keySize Operator KeyLength +# +# Operator: +# <= | < | == | != | >= | > +# +# KeyLength: +# Integer value of the algorithm's key length in bits +# +# CAConstraint: +# jdkCA +# +# DenyAfterConstraint: +# denyAfter YYYY-MM-DD +# +# UsageConstraint: +# usage [TLSServer] [TLSClient] [SignedJAR] +# +# IncludeProperty: +# include +# +# The "AlgorithmName" is the standard algorithm name of the disabled +# algorithm. See "Java Cryptography Architecture Standard Algorithm Name +# Documentation" for information about Standard Algorithm Names. Matching +# is performed using a case-insensitive sub-element matching rule. (For +# example, in "SHA1withECDSA" the sub-elements are "SHA1" for hashing and +# "ECDSA" for signatures.) If the assertion "AlgorithmName" is a +# sub-element of the certificate algorithm name, the algorithm will be +# rejected during certification path building and validation. For example, +# the assertion algorithm name "DSA" will disable all certificate algorithms +# that rely on DSA, such as NONEwithDSA, SHA1withDSA. However, the assertion +# will not disable algorithms related to "ECDSA". +# +# The "IncludeProperty" allows a implementation-defined security property that +# can be included in the disabledAlgorithms properties. These properties are +# to help manage common actions easier across multiple disabledAlgorithm +# properties. +# There is one defined security property: jdk.disabled.namedCurves +# See the property for more specific details. +# +# +# A "Constraint" defines restrictions on the keys and/or certificates for +# a specified AlgorithmName: +# +# KeySizeConstraint: +# keySize Operator KeyLength +# The constraint requires a key of a valid size range if the +# "AlgorithmName" is of a key algorithm. The "KeyLength" indicates +# the key size specified in number of bits. For example, +# "RSA keySize <= 1024" indicates that any RSA key with key size less +# than or equal to 1024 bits should be disabled, and +# "RSA keySize < 1024, RSA keySize > 2048" indicates that any RSA key +# with key size less than 1024 or greater than 2048 should be disabled. +# This constraint is only used on algorithms that have a key size. +# +# CAConstraint: +# jdkCA +# This constraint prohibits the specified algorithm only if the +# algorithm is used in a certificate chain that terminates at a marked +# trust anchor in the lib/security/cacerts keystore. If the jdkCA +# constraint is not set, then all chains using the specified algorithm +# are restricted. jdkCA may only be used once in a DisabledAlgorithm +# expression. +# Example: To apply this constraint to SHA-1 certificates, include +# the following: "SHA1 jdkCA" +# +# DenyAfterConstraint: +# denyAfter YYYY-MM-DD +# This constraint prohibits a certificate with the specified algorithm +# from being used after the date regardless of the certificate's +# validity. JAR files that are signed and timestamped before the +# constraint date with certificates containing the disabled algorithm +# will not be restricted. The date is processed in the UTC timezone. +# This constraint can only be used once in a DisabledAlgorithm +# expression. +# Example: To deny usage of RSA 2048 bit certificates after Feb 3 2020, +# use the following: "RSA keySize == 2048 & denyAfter 2020-02-03" +# +# UsageConstraint: +# usage [TLSServer] [TLSClient] [SignedJAR] +# This constraint prohibits the specified algorithm for +# a specified usage. This should be used when disabling an algorithm +# for all usages is not practical. 'TLSServer' restricts the algorithm +# in TLS server certificate chains when server authentication is +# performed. 'TLSClient' restricts the algorithm in TLS client +# certificate chains when client authentication is performed. +# 'SignedJAR' constrains use of certificates in signed jar files. +# The usage type follows the keyword and more than one usage type can +# be specified with a whitespace delimiter. +# Example: "SHA1 usage TLSServer TLSClient" +# +# When an algorithm must satisfy more than one constraint, it must be +# delimited by an ampersand '&'. For example, to restrict certificates in a +# chain that terminate at a distribution provided trust anchor and contain +# RSA keys that are less than or equal to 1024 bits, add the following +# constraint: "RSA keySize <= 1024 & jdkCA". +# +# All DisabledAlgorithms expressions are processed in the order defined in the +# property. This requires lower keysize constraints to be specified +# before larger keysize constraints of the same algorithm. For example: +# "RSA keySize < 1024 & jdkCA, RSA keySize < 2048". +# +# Note: The algorithm restrictions do not apply to trust anchors or +# self-signed certificates. +# +# Note: This property is currently used by Oracle's PKIX implementation. It +# is not guaranteed to be examined and used by other implementations. +# +# Example: +# jdk.certpath.disabledAlgorithms=MD2, DSA, RSA keySize < 2048 +# +# +jdk.certpath.disabledAlgorithms=MD2, MD5, SHA1 jdkCA & usage TLSServer, \ + RSA keySize < 1024, DSA keySize < 1024, EC keySize < 224, \ + SHA1 usage SignedJAR & denyAfter 2019-01-01, \ + include jdk.disabled.namedCurves + +# +# Legacy algorithms for certification path (CertPath) processing and +# signed JAR files. +# +# In some environments, a certain algorithm or key length may be undesirable +# but is not yet disabled. +# +# Tools such as keytool and jarsigner may emit warnings when these legacy +# algorithms are used. See the man pages for those tools for more information. +# +# The syntax is the same as the "jdk.certpath.disabledAlgorithms" and +# "jdk.jar.disabledAlgorithms" security properties. +# +# Note: This property is currently used by the JDK Reference +# implementation. It is not guaranteed to be examined and used by other +# implementations. + +jdk.security.legacyAlgorithms=SHA1, \ + RSA keySize < 2048, DSA keySize < 2048 + +# +# Algorithm restrictions for signed JAR files +# +# In some environments, certain algorithms or key lengths may be undesirable +# for signed JAR validation. For example, "MD2" is generally no longer +# considered to be a secure hash algorithm. This section describes the +# mechanism for disabling algorithms based on algorithm name and/or key length. +# JARs signed with any of the disabled algorithms or key sizes will be treated +# as unsigned. +# +# The syntax of the disabled algorithm string is described as follows: +# DisabledAlgorithms: +# " DisabledAlgorithm { , DisabledAlgorithm } " +# +# DisabledAlgorithm: +# AlgorithmName [Constraint] { '&' Constraint } +# +# AlgorithmName: +# (see below) +# +# Constraint: +# KeySizeConstraint | DenyAfterConstraint +# +# KeySizeConstraint: +# keySize Operator KeyLength +# +# DenyAfterConstraint: +# denyAfter YYYY-MM-DD +# +# Operator: +# <= | < | == | != | >= | > +# +# KeyLength: +# Integer value of the algorithm's key length in bits +# +# Note: This property is currently used by the JDK Reference +# implementation. It is not guaranteed to be examined and used by other +# implementations. +# +# See "jdk.certpath.disabledAlgorithms" for syntax descriptions. +# +jdk.jar.disabledAlgorithms=MD2, MD5, RSA keySize < 1024, \ + DSA keySize < 1024, SHA1 denyAfter 2019-01-01, \ + include jdk.disabled.namedCurves + +# +# Algorithm restrictions for Secure Socket Layer/Transport Layer Security +# (SSL/TLS) processing +# +# In some environments, certain algorithms or key lengths may be undesirable +# when using SSL/TLS. This section describes the mechanism for disabling +# algorithms during SSL/TLS security parameters negotiation, including +# protocol version negotiation, cipher suites selection, peer authentication +# and key exchange mechanisms. +# +# Disabled algorithms will not be negotiated for SSL/TLS connections, even +# if they are enabled explicitly in an application. +# +# For PKI-based peer authentication and key exchange mechanisms, this list +# of disabled algorithms will also be checked during certification path +# building and validation, including algorithms used in certificates, as +# well as revocation information such as CRLs and signed OCSP Responses. +# This is in addition to the jdk.certpath.disabledAlgorithms property above. +# +# See the specification of "jdk.certpath.disabledAlgorithms" for the +# syntax of the disabled algorithm string. +# +# Note: The algorithm restrictions do not apply to trust anchors or +# self-signed certificates. +# +# Note: This property is currently used by the JDK Reference implementation. +# It is not guaranteed to be examined and used by other implementations. +# +# Example: +# jdk.tls.disabledAlgorithms=MD5, SSLv3, DSA, RSA keySize < 2048 +jdk.tls.disabledAlgorithms=RC4, DES, MD5withRSA, \ + DH keySize < 1024, EC keySize < 224, anon, NULL, \ + include jdk.disabled.namedCurves + +# Legacy algorithms for Secure Socket Layer/Transport Layer Security (SSL/TLS) +# processing in JSSE implementation. +# +# In some environments, a certain algorithm may be undesirable but it +# cannot be disabled because of its use in legacy applications. Legacy +# algorithms may still be supported, but applications should not use them +# as the security strength of legacy algorithms are usually not strong enough +# in practice. +# +# During SSL/TLS security parameters negotiation, legacy algorithms will +# not be negotiated unless there are no other candidates. +# +# The syntax of the legacy algorithms string is described as this Java +# BNF-style: +# LegacyAlgorithms: +# " LegacyAlgorithm { , LegacyAlgorithm } " +# +# LegacyAlgorithm: +# AlgorithmName (standard JSSE algorithm name) +# +# See the specification of security property "jdk.certpath.disabledAlgorithms" +# for the syntax and description of the "AlgorithmName" notation. +# +# Per SSL/TLS specifications, cipher suites have the form: +# SSL_KeyExchangeAlg_WITH_CipherAlg_MacAlg +# or +# TLS_KeyExchangeAlg_WITH_CipherAlg_MacAlg +# +# For example, the cipher suite TLS_RSA_WITH_AES_128_CBC_SHA uses RSA as the +# key exchange algorithm, AES_128_CBC (128 bits AES cipher algorithm in CBC +# mode) as the cipher (encryption) algorithm, and SHA-1 as the message digest +# algorithm for HMAC. +# +# The LegacyAlgorithm can be one of the following standard algorithm names: +# 1. JSSE cipher suite name, e.g., TLS_RSA_WITH_AES_128_CBC_SHA +# 2. JSSE key exchange algorithm name, e.g., RSA +# 3. JSSE cipher (encryption) algorithm name, e.g., AES_128_CBC +# 4. JSSE message digest algorithm name, e.g., SHA +# +# See SSL/TLS specifications and "Java Cryptography Architecture Standard +# Algorithm Name Documentation" for information about the algorithm names. +# +# Note: This property is currently used by the JDK Reference implementation. +# It is not guaranteed to be examined and used by other implementations. +# There is no guarantee the property will continue to exist or be of the +# same syntax in future releases. +# +# Example: +# jdk.tls.legacyAlgorithms=DH_anon, DES_CBC, SSL_RSA_WITH_RC4_128_MD5 +# +jdk.tls.legacyAlgorithms= \ + K_NULL, C_NULL, M_NULL, \ + DH_anon, ECDH_anon, \ + RC4_128, RC4_40 + +# The pre-defined default finite field Diffie-Hellman ephemeral (DHE) +# parameters for Transport Layer Security (SSL/TLS/DTLS) processing. +# +# In traditional SSL/TLS/DTLS connections where finite field DHE parameters +# negotiation mechanism is not used, the server offers the client group +# parameters, base generator g and prime modulus p, for DHE key exchange. +# It is recommended to use dynamic group parameters. This property defines +# a mechanism that allows you to specify custom group parameters. +# +# The syntax of this property string is described as this Java BNF-style: +# DefaultDHEParameters: +# DefinedDHEParameters { , DefinedDHEParameters } +# +# DefinedDHEParameters: +# "{" DHEPrimeModulus , DHEBaseGenerator "}" +# +# DHEPrimeModulus: +# HexadecimalDigits +# +# DHEBaseGenerator: +# HexadecimalDigits +# +# HexadecimalDigits: +# HexadecimalDigit { HexadecimalDigit } +# +# HexadecimalDigit: one of +# 0 1 2 3 4 5 6 7 8 9 A B C D E F a b c d e f +# +# Whitespace characters are ignored. +# +# The "DefinedDHEParameters" defines the custom group parameters, prime +# modulus p and base generator g, for a particular size of prime modulus p. +# The "DHEPrimeModulus" defines the hexadecimal prime modulus p, and the +# "DHEBaseGenerator" defines the hexadecimal base generator g of a group +# parameter. It is recommended to use safe primes for the custom group +# parameters. +# +# If this property is not defined or the value is empty, the underlying JSSE +# provider's default group parameter is used for each connection. +# +# If the property value does not follow the grammar, or a particular group +# parameter is not valid, the connection will fall back and use the +# underlying JSSE provider's default group parameter. +# +# Note: This property is currently used by OpenJDK's JSSE implementation. It +# is not guaranteed to be examined and used by other implementations. +# +# Example: +# jdk.tls.server.defaultDHEParameters= +# { \ +# FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1 \ +# 29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD \ +# EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245 \ +# E485B576 625E7EC6 F44C42E9 A637ED6B 0BFF5CB6 F406B7ED \ +# EE386BFB 5A899FA5 AE9F2411 7C4B1FE6 49286651 ECE65381 \ +# FFFFFFFF FFFFFFFF, 2} + +# +# TLS key limits on symmetric cryptographic algorithms +# +# This security property sets limits on algorithms key usage in TLS 1.3. +# When the amount of data encrypted exceeds the algorithm value listed below, +# a KeyUpdate message will trigger a key change. This is for symmetric ciphers +# with TLS 1.3 only. +# +# The syntax for the property is described below: +# KeyLimits: +# " KeyLimit { , KeyLimit } " +# +# WeakKeyLimit: +# AlgorithmName Action Length +# +# AlgorithmName: +# A full algorithm transformation. +# +# Action: +# KeyUpdate +# +# Length: +# The amount of encrypted data in a session before the Action occurs +# This value may be an integer value in bytes, or as a power of two, 2^29. +# +# KeyUpdate: +# The TLS 1.3 KeyUpdate handshake process begins when the Length amount +# is fulfilled. +# +# Note: This property is currently used by OpenJDK's JSSE implementation. It +# is not guaranteed to be examined and used by other implementations. +# +jdk.tls.keyLimits=AES/GCM/NoPadding KeyUpdate 2^37 + +# Cryptographic Jurisdiction Policy defaults +# +# Import and export control rules on cryptographic software vary from +# country to country. By default, the JDK provides two different sets of +# cryptographic policy files: +# +# unlimited: These policy files contain no restrictions on cryptographic +# strengths or algorithms. +# +# limited: These policy files contain more restricted cryptographic +# strengths, and are still available if your country or +# usage requires the traditional restrictive policy. +# +# The JDK JCE framework uses the unlimited policy files by default. +# However the user may explicitly choose a set either by defining the +# "crypto.policy" Security property or by installing valid JCE policy +# jar files into the traditional JDK installation location. To better +# support older JDK Update releases, the "crypto.policy" property is not +# defined by default. See below for more information. +# +# The following logic determines which policy files are used: +# +# refers to the directory where the JRE was +# installed and may be determined using the "java.home" +# System property. +# +# 1. If the Security property "crypto.policy" has been defined, +# then the following mechanism is used: +# +# The policy files are stored as jar files in subdirectories of +# /lib/security/policy. Each directory contains a complete +# set of policy files. +# +# The "crypto.policy" Security property controls the directory +# selection, and thus the effective cryptographic policy. +# +# The default set of directories is: +# +# limited | unlimited +# +# 2. If the "crypto.policy" property is not set and the traditional +# US_export_policy.jar and local_policy.jar files +# (e.g. limited/unlimited) are found in the legacy +# /lib/security directory, then the rules embedded within +# those jar files will be used. This helps preserve compatibility +# for users upgrading from an older installation. +# +# 3. If the jar files are not present in the legacy location +# and the "crypto.policy" Security property is not defined, +# then the JDK will use the unlimited settings (equivalent to +# crypto.policy=unlimited) +# +# Please see the JCA documentation for additional information on these +# files and formats. +# +# YOU ARE ADVISED TO CONSULT YOUR EXPORT/IMPORT CONTROL COUNSEL OR ATTORNEY +# TO DETERMINE THE EXACT REQUIREMENTS. +# +# Please note that the JCE for Java SE, including the JCE framework, +# cryptographic policy files, and standard JCE providers provided with +# the Java SE, have been reviewed and approved for export as mass market +# encryption item by the US Bureau of Industry and Security. +# +# Note: This property is currently used by the JDK Reference implementation. +# It is not guaranteed to be examined and used by other implementations. +# +#crypto.policy=unlimited + +# +# The policy for the XML Signature secure validation mode. The mode is +# enabled by setting the property "org.jcp.xml.dsig.secureValidation" to +# true with the javax.xml.crypto.XMLCryptoContext.setProperty() method, +# or by running the code with a SecurityManager. +# +# Policy: +# Constraint {"," Constraint } +# Constraint: +# AlgConstraint | MaxTransformsConstraint | MaxReferencesConstraint | +# ReferenceUriSchemeConstraint | KeySizeConstraint | OtherConstraint +# AlgConstraint +# "disallowAlg" Uri +# MaxTransformsConstraint: +# "maxTransforms" Integer +# MaxReferencesConstraint: +# "maxReferences" Integer +# ReferenceUriSchemeConstraint: +# "disallowReferenceUriSchemes" String { String } +# KeySizeConstraint: +# "minKeySize" KeyAlg Integer +# OtherConstraint: +# "noDuplicateIds" | "noRetrievalMethodLoops" +# +# For AlgConstraint, Uri is the algorithm URI String that is not allowed. +# See the XML Signature Recommendation for more information on algorithm +# URI Identifiers. For KeySizeConstraint, KeyAlg is the standard algorithm +# name of the key type (ex: "RSA"). If the MaxTransformsConstraint, +# MaxReferencesConstraint or KeySizeConstraint (for the same key type) is +# specified more than once, only the last entry is enforced. +# +# Note: This property is currently used by the JDK Reference implementation. It +# is not guaranteed to be examined and used by other implementations. +# +jdk.xml.dsig.secureValidationPolicy=\ + disallowAlg http://www.w3.org/TR/1999/REC-xslt-19991116,\ + disallowAlg http://www.w3.org/2001/04/xmldsig-more#rsa-md5,\ + disallowAlg http://www.w3.org/2001/04/xmldsig-more#hmac-md5,\ + disallowAlg http://www.w3.org/2001/04/xmldsig-more#md5,\ + maxTransforms 5,\ + maxReferences 30,\ + disallowReferenceUriSchemes file http https,\ + minKeySize RSA 1024,\ + minKeySize DSA 1024,\ + minKeySize EC 224,\ + noDuplicateIds,\ + noRetrievalMethodLoops + +# +# Serialization process-wide filter +# +# A filter, if configured, is used by java.io.ObjectInputStream during +# deserialization to check the contents of the stream. +# A filter is configured as a sequence of patterns, each pattern is either +# matched against the name of a class in the stream or defines a limit. +# Patterns are separated by ";" (semicolon). +# Whitespace is significant and is considered part of the pattern. +# +# If the system property jdk.serialFilter is also specified on the command +# line, it supersedes the security property value defined here. +# +# If a pattern includes a "=", it sets a limit. +# If a limit appears more than once the last value is used. +# Limits are checked before classes regardless of the order in the sequence of patterns. +# If any of the limits are exceeded, the filter status is REJECTED. +# +# maxdepth=value - the maximum depth of a graph +# maxrefs=value - the maximum number of internal references +# maxbytes=value - the maximum number of bytes in the input stream +# maxarray=value - the maximum array length allowed +# +# Other patterns, from left to right, match the class or package name as +# returned from Class.getName. +# If the class is an array type, the class or package to be matched is the element type. +# Arrays of any number of dimensions are treated the same as the element type. +# For example, a pattern of "!example.Foo", rejects creation of any instance or +# array of example.Foo. +# +# If the pattern starts with "!", the status is REJECTED if the remaining pattern +# is matched; otherwise the status is ALLOWED if the pattern matches. +# If the pattern ends with ".**" it matches any class in the package and all subpackages. +# If the pattern ends with ".*" it matches any class in the package. +# If the pattern ends with "*", it matches any class with the pattern as a prefix. +# If the pattern is equal to the class name, it matches. +# Otherwise, the status is UNDECIDED. +# +# Primitive types are not configurable with this filter. +# +#jdk.serialFilter=pattern;pattern + +# +# RMI Registry Serial Filter +# +# The filter pattern uses the same format as jdk.serialFilter. +# This filter can override the builtin filter if additional types need to be +# allowed or rejected from the RMI Registry or to decrease limits but not +# to increase limits. +# If the limits (maxdepth, maxrefs, or maxbytes) are exceeded, the object is rejected. +# +# The maxdepth of any array passed to the RMI Registry is set to +# 10000. The maximum depth of the graph is set to 20. +# These limits can be reduced via the maxarray, maxdepth limits. +# +#sun.rmi.registry.registryFilter=pattern;pattern + +# +# Array construction of any component type, including subarrays and arrays of +# primitives, are allowed unless the length is greater than the maxarray limit. +# The filter is applied to each array element. +# +# The built-in filter allows subclasses of allowed classes and +# can approximately be represented as the pattern: +# +#sun.rmi.registry.registryFilter=\ +# maxarray=1000000;\ +# maxdepth=20;\ +# java.lang.String;\ +# java.lang.Number;\ +# java.lang.reflect.Proxy;\ +# java.rmi.Remote;\ +# sun.rmi.server.UnicastRef;\ +# sun.rmi.server.RMIClientSocketFactory;\ +# sun.rmi.server.RMIServerSocketFactory;\ +# java.rmi.activation.ActivationID;\ +# java.rmi.server.UID +# +# RMI Distributed Garbage Collector (DGC) Serial Filter +# +# The filter pattern uses the same format as jdk.serialFilter. +# This filter can override the builtin filter if additional types need to be +# allowed or rejected from the RMI DGC. +# +# The builtin DGC filter can approximately be represented as the filter pattern: +# +#sun.rmi.transport.dgcFilter=\ +# java.rmi.server.ObjID;\ +# java.rmi.server.UID;\ +# java.rmi.dgc.VMID;\ +# java.rmi.dgc.Lease;\ +# maxdepth=5;maxarray=10000 + +# CORBA ORBIorTypeCheckRegistryFilter +# Type check enhancement for ORB::string_to_object processing +# +# An IOR type check filter, if configured, is used by an ORB during +# an ORB::string_to_object invocation to check the veracity of the type encoded +# in the ior string. +# +# The filter pattern consists of a semi-colon separated list of class names. +# The configured list contains the binary class names of the IDL interface types +# corresponding to the IDL stub class to be instantiated. +# As such, a filter specifies a list of IDL stub classes that will be +# allowed by an ORB when an ORB::string_to_object is invoked. +# It is used to specify a white list configuration of acceptable +# IDL stub types which may be contained in a stringified IOR +# parameter passed as input to an ORB::string_to_object method. +# +# Note: This property is currently used by the JDK Reference implementation. +# It is not guaranteed to be examined and used by other implementations. +# +#com.sun.CORBA.ORBIorTypeCheckRegistryFilter=binary_class_name;binary_class_name + +# +# JCEKS Encrypted Key Serial Filter +# +# This filter, if configured, is used by the JCEKS KeyStore during the +# deserialization of the encrypted Key object stored inside a key entry. +# If not configured or the filter result is UNDECIDED (i.e. none of the patterns +# matches), the filter configured by jdk.serialFilter will be consulted. +# +# If the system property jceks.key.serialFilter is also specified, it supersedes +# the security property value defined here. +# +# The filter pattern uses the same format as jdk.serialFilter. The default +# pattern allows java.lang.Enum, java.security.KeyRep, java.security.KeyRep$Type, +# and javax.crypto.spec.SecretKeySpec and rejects all the others. +jceks.key.serialFilter = java.lang.Enum;java.security.KeyRep;\ + java.security.KeyRep$Type;javax.crypto.spec.SecretKeySpec;!* + +# +# PKCS12 KeyStore properties +# +# The following properties, if configured, are used by the PKCS12 KeyStore +# implementation during the creation of a new keystore. Several of the +# properties may also be used when modifying an existing keystore. The +# properties can be overridden by a KeyStore API that specifies its own +# algorithms and parameters. +# +# If an existing PKCS12 keystore is loaded and then stored, the algorithm and +# parameter used to generate the existing Mac will be reused. If the existing +# keystore does not have a Mac, no Mac will be created while storing. If there +# is at least one certificate in the existing keystore, the algorithm and +# parameters used to encrypt the last certificate in the existing keystore will +# be reused to encrypt all certificates while storing. If the last certificate +# in the existing keystore is not encrypted, all certificates will be stored +# unencrypted. If there is no certificate in the existing keystore, any newly +# added certificate will be encrypted (or stored unencrypted if algorithm +# value is "NONE") using the "keystore.pkcs12.certProtectionAlgorithm" and +# "keystore.pkcs12.certPbeIterationCount" values defined here. Existing private +# and secret key(s) are not changed. Newly set private and secret key(s) will +# be encrypted using the "keystore.pkcs12.keyProtectionAlgorithm" and +# "keystore.pkcs12.keyPbeIterationCount" values defined here. +# +# In order to apply new algorithms and parameters to all entries in an +# existing keystore, one can create a new keystore and add entries in the +# existing keystore into the new keystore. This can be achieved by calling the +# "keytool -importkeystore" command. +# +# If a system property of the same name is also specified, it supersedes the +# security property value defined here. +# +# If the property is set to an illegal value, +# an iteration count that is not a positive integer, or an unknown algorithm +# name, an exception will be thrown when the property is used. +# If the property is not set or empty, a default value will be used. +# +# Note: These properties are currently used by the JDK Reference implementation. +# They are not guaranteed to be examined and used by other implementations. + +# The algorithm used to encrypt a certificate. This can be any non-Hmac PBE +# algorithm defined in the Cipher section of the Java Security Standard +# Algorithm Names Specification. When set to "NONE", the certificate +# is not encrypted. The default value is "PBEWithSHA1AndRC2_40". +#keystore.pkcs12.certProtectionAlgorithm = PBEWithSHA1AndRC2_40 + +# The iteration count used by the PBE algorithm when encrypting a certificate. +# This value must be a positive integer. The default value is 50000. +#keystore.pkcs12.certPbeIterationCount = 50000 + +# The algorithm used to encrypt a private key or secret key. This can be +# any non-Hmac PBE algorithm defined in the Cipher section of the Java +# Security Standard Algorithm Names Specification. The value must not be "NONE". +# The default value is "PBEWithSHA1AndDESede". +#keystore.pkcs12.keyProtectionAlgorithm = PBEWithSHA1AndDESede + +# The iteration count used by the PBE algorithm when encrypting a private key +# or a secret key. This value must be a positive integer. The default value +# is 50000. +#keystore.pkcs12.keyPbeIterationCount = 50000 + +# The algorithm used to calculate the optional MacData at the end of a PKCS12 +# file. This can be any HmacPBE algorithm defined in the Mac section of the +# Java Security Standard Algorithm Names Specification. When set to "NONE", +# no Mac is generated. The default value is "HmacPBESHA1". +#keystore.pkcs12.macAlgorithm = HmacPBESHA1 + +# The iteration count used by the MacData algorithm. This value must be a +# positive integer. The default value is 100000. +#keystore.pkcs12.macIterationCount = 100000 + +# The iteration count used for password-based encryption (PBE) in JCEKS +# keystores. Values in the range 10000 to 5000000 are considered valid. +# If the value is out of this range, or is not a number, or is unspecified; +# a default of 200000 is used. +# +# If the system property jdk.jceks.iterationCount is also specified, it +# supersedes the security property value defined here. +# +#jdk.jceks.iterationCount = 200000 + +# +# Disabled mechanisms for the Simple Authentication and Security Layer (SASL) +# +# Disabled mechanisms will not be negotiated by both SASL clients and servers. +# These mechanisms will be ignored if they are specified in the "mechanisms" +# argument of "Sasl.createSaslClient" or the "mechanism" argument of +# "Sasl.createSaslServer". +# +# The value of this property is a comma-separated list of SASL mechanisms. +# The mechanisms are case-sensitive. Whitespaces around the commas are ignored. +# +# Note: This property is currently used by the JDK Reference implementation. +# It is not guaranteed to be examined and used by other implementations. +# +# Example: +# jdk.sasl.disabledMechanisms=PLAIN, CRAM-MD5, DIGEST-MD5 +jdk.sasl.disabledMechanisms= + +# +# Policies for distrusting Certificate Authorities (CAs). +# +# This is a comma separated value of one or more case-sensitive strings, each +# of which represents a policy for determining if a CA should be distrusted. +# The supported values are: +# +# +# SYMANTEC_TLS : Distrust TLS Server certificates anchored by a Symantec +# root CA and issued after April 16, 2019 unless issued by one of the +# following subordinate CAs which have a later distrust date: +# 1. Apple IST CA 2 - G1, SHA-256 fingerprint: +# AC2B922ECFD5E01711772FEA8ED372DE9D1E2245FCE3F57A9CDBEC77296A424B +# Distrust after December 31, 2019. +# 2. Apple IST CA 8 - G1, SHA-256 fingerprint: +# A4FE7C7F15155F3F0AEF7AAA83CF6E06DEB97CA3F909DF920AC1490882D488ED +# Distrust after December 31, 2019. +# Leading and trailing whitespace surrounding each value are ignored. +# Unknown values are ignored. If the property is commented out or set to the +# empty String, no policies are enforced. +# +# Note: This property is currently used by the JDK Reference implementation. +# It is not guaranteed to be supported by other SE implementations. Also, this +# property does not override other security properties which can restrict +# certificates such as jdk.tls.disabledAlgorithms or +# jdk.certpath.disabledAlgorithms; those restrictions are still enforced even +# if this property is not enabled. +# +jdk.security.caDistrustPolicies=SYMANTEC_TLS + +# +# Policies for the proxy_impersonator Kerberos ccache configuration entry +# +# The proxy_impersonator ccache configuration entry indicates that the ccache +# is a synthetic delegated credential for use with S4U2Proxy by an intermediate +# server. The ccache file should also contain the TGT of this server and +# an evidence ticket from the default principal of the ccache to this server. +# +# This security property determines how Java uses this configuration entry. +# There are 3 possible values: +# +# no-impersonate - Ignore this configuration entry, and always act as +# the owner of the TGT (if it exists). +# +# try-impersonate - Try impersonation when this configuration entry exists. +# If no matching TGT or evidence ticket is found, +# fallback to no-impersonate. +# +# always-impersonate - Always impersonate when this configuration entry exists. +# If no matching TGT or evidence ticket is found, +# no initial credential is read from the ccache. +# +# The default value is "always-impersonate". +# +# If a system property of the same name is also specified, it supersedes the +# security property value defined here. +# +#jdk.security.krb5.default.initiate.credential=always-impersonate + +# +# Trust Anchor Certificates - CA Basic Constraint check +# +# X.509 v3 certificates used as Trust Anchors (to validate signed code or TLS +# connections) must have the cA Basic Constraint field set to 'true'. Also, if +# they include a Key Usage extension, the keyCertSign bit must be set. These +# checks, enabled by default, can be disabled for backward-compatibility +# purposes with the jdk.security.allowNonCaAnchor System and Security +# properties. In the case that both properties are simultaneously set, the +# System value prevails. The default value of the property is "false". +# +#jdk.security.allowNonCaAnchor=true + +# +# The default Character set name (java.nio.charset.Charset.forName()) +# for converting TLS ALPN values between byte arrays and Strings. +# Prior versions of the JDK may use UTF-8 as the default charset. If +# you experience interoperability issues, setting this property to UTF-8 +# may help. +# +# jdk.tls.alpnCharset=UTF-8 +jdk.tls.alpnCharset=ISO_8859_1 + +# +# JNDI Object Factories Filter +# +# This filter is used by the JNDI runtime to control the set of object factory classes +# which will be allowed to instantiate objects from object references returned by +# naming/directory systems. The factory class named by the reference instance will be +# matched against this filter. The filter property supports pattern-based filter syntax +# with the same format as jdk.serialFilter. +# +# Each pattern is matched against the factory class name to allow or disallow it's +# instantiation. The access to a factory class is allowed unless the filter returns +# REJECTED. +# +# Note: This property is currently used by the JDK Reference implementation. +# It is not guaranteed to be examined and used by other implementations. +# +# If the system property jdk.jndi.object.factoriesFilter is also specified, it supersedes +# the security property value defined here. The default value of the property is "*". +# +# The default pattern value allows any object factory class specified by the reference +# instance to recreate the referenced object. +#jdk.jndi.object.factoriesFilter=* diff --git a/yunzhupaas-admin/pom.xml b/yunzhupaas-admin/pom.xml new file mode 100644 index 0000000..3e87752 --- /dev/null +++ b/yunzhupaas-admin/pom.xml @@ -0,0 +1,205 @@ + + + + yunzhupaas-java-boot + com.yunzhupaas + 5.2.0-RELEASE + + + 4.0.0 + yunzhupaas-admin + jar + + + + + + org.projectlombok + lombok + + + com.yunzhupaas + yunzhupaas-file-controller + ${project.version} + + + + com.yunzhupaas + yunzhupaas-extend-controller + ${project.version} + + + com.yunzhupaas + yunzhupaas-system-controller + ${project.version} + + + com.yunzhupaas + yunzhupaas-scheduletask-controller + ${project.version} + + + com.yunzhupaas + yunzhupaas-message-controller + ${project.version} + + + com.yunzhupaas + yunzhupaas-permission-controller + ${project.version} + + + com.yunzhupaas + yunzhupaas-visualdev-base-controller + ${project.version} + + + com.yunzhupaas + yunzhupaas-visualdev-onlinedev-controller + ${project.version} + + + com.yunzhupaas + yunzhupaas-visualdev-generater-controller + ${project.version} + + + com.yunzhupaas + yunzhupaas-visualdev-portal-controller + ${project.version} + + + com.yunzhupaas + yunzhupaas-visualdata-controller + ${project.version} + + + com.yunzhupaas + yunzhupaas-exception + ${project.version} + + + com.yunzhupaas + yunzhupaas-oauth-controller + ${project.version} + + + com.yunzhupaas + yunzhupaas-example-controller + ${project.version} + + + com.yunzhupaas + yunzhupaas-app-controller + ${project.version} + + + + + com.yunzhupaas + yunzhupaas-mdm-controller + ${project.version} + + + + + + + + + + + + + + + com.yunzhupaas + yunzhupaas-visualdev-integrate-controller + ${project.version} + + + com.yunzhupaas + yunzhupaas-flowable-controller + ${project.version} + + + + com.yunzhupaas + yunzhupaas-train-controller + ${project.version} + + + com.yunzhupaas + yunzhupaas-common-i18n + + + + + + + + + + + + + + + + + + + + + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-tomcat + provided + + + + + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + com.yunzhupaas.AdminApplication + ZIP + + + + + repackage + + + + + + + + + + diff --git a/yunzhupaas-admin/src/main/java/com/yunzhupaas/AdminApplication.java b/yunzhupaas-admin/src/main/java/com/yunzhupaas/AdminApplication.java new file mode 100644 index 0000000..b2c54e4 --- /dev/null +++ b/yunzhupaas-admin/src/main/java/com/yunzhupaas/AdminApplication.java @@ -0,0 +1,28 @@ +package com.yunzhupaas; + +import cn.xuyanwu.spring.file.storage.EnableFileStorage; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 17:12 + */ +@SpringBootApplication(scanBasePackages = { "com.yunzhupaas" }, exclude = { DataSourceAutoConfiguration.class }) +@EnableFileStorage +public class AdminApplication extends SpringBootServletInitializer { + + public static void main(String[] args) { + SpringApplication springApplication = new SpringApplication(AdminApplication.class); + // 添加监听器 + // springApplication.addListeners(new YunzhupaasListener()); + springApplication.run(args); + System.out.println("YunzhuPaasAdmin启动完成"); + } + +} diff --git a/yunzhupaas-admin/src/main/java/com/yunzhupaas/aop/DataSourceBindAspect.java b/yunzhupaas-admin/src/main/java/com/yunzhupaas/aop/DataSourceBindAspect.java new file mode 100644 index 0000000..5d1d559 --- /dev/null +++ b/yunzhupaas-admin/src/main/java/com/yunzhupaas/aop/DataSourceBindAspect.java @@ -0,0 +1,88 @@ +package com.yunzhupaas.aop; + +import cn.dev33.satoken.context.SaHolder; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.database.util.NotTenantPluginHolder; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.util.TenantHolder; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import com.yunzhupaas.util.data.DataSourceContextHolder; +import lombok.extern.slf4j.Slf4j; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 17:12 + */ +@Slf4j +@Aspect +@Component +@Order(1) +public class DataSourceBindAspect { + + @Autowired + private ConfigValueUtil configValueUtil; + + @Pointcut("within(com.yunzhupaas.*.controller.* || com.yunzhupaas.controller.*)") + public void bindDataSource() { + + } + + /** + * NoDataSourceBind 不需要绑定数据库的注解 + * + * @param pjp + * @return + * @throws Throwable + */ + @Around("bindDataSource() && !@annotation(com.yunzhupaas.util.NoDataSourceBind)") + public Object doAroundService(ProceedingJoinPoint pjp) throws Throwable { +// System.out.println(SaHolder.getRequest().getRequestPath()); + if (configValueUtil.isMultiTenancy()) { + if(StringUtil.isEmpty(TenantHolder.getDatasourceId())){ + UserInfo userInfo = UserProvider.getUser(); + String url = null; + try{ + url = SaHolder.getRequest().getRequestPath(); + }catch (Exception ee){ } + log.error("租户" + userInfo.getTenantId() + "数据库不存在, URL: {}, TOKEN: {}", url, userInfo.getToken()); + return null; + } + return pjp.proceed(); + } + Object obj = pjp.proceed(); + return obj; + } + + + /** + * NoDataSourceBind 不需要绑定数据库的注解 加入不切租户库标记 + * + * @param pjp + * @return + * @throws Throwable + */ + @Around("bindDataSource() && @annotation(com.yunzhupaas.util.NoDataSourceBind)") + public Object doAroundService2(ProceedingJoinPoint pjp) throws Throwable { + try{ + NotTenantPluginHolder.setNotSwitchAlwaysFlag(); + //Filter中提前设置租户信息, 不需要切库的方法进行清除切库 + TenantDataSourceUtil.clearLocalTenantInfo(); + return pjp.proceed(); + }finally { + NotTenantPluginHolder.clearNotSwitchAlwaysFlag(); + } + } +} + diff --git a/yunzhupaas-admin/src/main/java/com/yunzhupaas/aop/MyFileAspect.java b/yunzhupaas-admin/src/main/java/com/yunzhupaas/aop/MyFileAspect.java new file mode 100644 index 0000000..966c959 --- /dev/null +++ b/yunzhupaas-admin/src/main/java/com/yunzhupaas/aop/MyFileAspect.java @@ -0,0 +1,77 @@ +package com.yunzhupaas.aop; + +import cn.xuyanwu.spring.file.storage.FileInfo; +import cn.xuyanwu.spring.file.storage.UploadPretreatment; +import cn.xuyanwu.spring.file.storage.aspect.*; +import cn.xuyanwu.spring.file.storage.platform.FileStorage; +import cn.xuyanwu.spring.file.storage.recorder.FileRecorder; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.util.PdfUtil; +import com.yunzhupaas.util.XSSEscape; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.io.IOException; +import java.io.InputStream; +import java.util.function.Consumer; + +@Slf4j +@Component +public class MyFileAspect implements FileStorageAspect { + + @Autowired + private ConfigValueUtil configValueUtil; + + @Override + public FileInfo uploadAround(UploadAspectChain chain, FileInfo fileInfo, UploadPretreatment pre, FileStorage fileStorage, FileRecorder fileRecorder) { + checkFilePath(fileInfo); + if(configValueUtil.isCheckFilePdf()) { + try { + String ext = fileInfo.getExt(); + if("pdf".equalsIgnoreCase(ext)) { + log.error("检测PDF文件"); + if (PdfUtil.containsJavaScript(pre.getFileWrapper().getBytes())) { + throw new DataException(MsgCode.FA053.get()); + } + } + } catch (IOException e) { + log.error("PDF文档解析失败: {}", e.getMessage()); + } + } + return FileStorageAspect.super.uploadAround(chain, fileInfo, pre, fileStorage, fileRecorder); + } + + @Override + public boolean deleteAround(DeleteAspectChain chain, FileInfo fileInfo, FileStorage fileStorage, FileRecorder fileRecorder) { + checkFilePath(fileInfo); + return FileStorageAspect.super.deleteAround(chain, fileInfo, fileStorage, fileRecorder); + } + + @Override + public boolean existsAround(ExistsAspectChain chain, FileInfo fileInfo, FileStorage fileStorage) { + checkFilePath(fileInfo); + return FileStorageAspect.super.existsAround(chain, fileInfo, fileStorage); + } + + @Override + public void downloadAround(DownloadAspectChain chain, FileInfo fileInfo, FileStorage fileStorage, Consumer consumer) { + checkFilePath(fileInfo); + FileStorageAspect.super.downloadAround(chain, fileInfo, fileStorage, consumer); + } + + @Override + public void downloadThAround(DownloadThAspectChain chain, FileInfo fileInfo, FileStorage fileStorage, Consumer consumer) { + checkFilePath(fileInfo); + FileStorageAspect.super.downloadThAround(chain, fileInfo, fileStorage, consumer); + } + + private void checkFilePath(FileInfo fileInfo){ + //处理特殊文件名 + fileInfo.setPath(XSSEscape.escapePath(fileInfo.getPath())); + fileInfo.setFilename(XSSEscape.escapePath(fileInfo.getFilename())); + } +} + diff --git a/yunzhupaas-admin/src/main/java/com/yunzhupaas/aop/PermissionAdminAspect.java b/yunzhupaas-admin/src/main/java/com/yunzhupaas/aop/PermissionAdminAspect.java new file mode 100644 index 0000000..6577da5 --- /dev/null +++ b/yunzhupaas-admin/src/main/java/com/yunzhupaas/aop/PermissionAdminAspect.java @@ -0,0 +1,69 @@ +package com.yunzhupaas.aop; + +import com.yunzhupaas.constant.PermissionConstant; +import com.yunzhupaas.permission.entity.OrganizeRelationEntity; +import com.yunzhupaas.permission.model.authorize.SaveBatchForm; +import com.yunzhupaas.permission.service.OrganizeRelationService; +import com.yunzhupaas.util.PermissionAspectUtil; +import com.yunzhupaas.util.UserProvider; +import lombok.extern.slf4j.Slf4j; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 17:12 + */ +@Slf4j +@Aspect +@Component +public class PermissionAdminAspect implements PermissionAdminBase{ + + + /** + * 分级管理切点 + */ + @Pointcut("within(com.yunzhupaas.*.controller.*) && @annotation(com.yunzhupaas.annotation.OrganizeAdminIsTrator)") + public void pointcut() { + } + + /** + * 分级管理切点 + * + * @param pjp + * @return + * @throws Throwable + */ + @Around("pointcut()") + public Object around(ProceedingJoinPoint pjp) throws Throwable { + return PermissionAdminBase.permissionCommon(pjp, this); + } + + @Override + public Boolean detailPermission(ProceedingJoinPoint pjp, String operatorUserId, String methodName){ + switch (methodName) { + case PermissionConstant.METHOD_SAVE: + case PermissionConstant.METHOD_SAVE_BATCH: + return true; + case PermissionConstant.METHOD_UPDATE: + //判断是否有当前组织的修改权限 + String organizeId = String.valueOf(pjp.getArgs()[0]); + return PermissionAspectUtil.containPermission(organizeId, operatorUserId, methodName); + default: + return false; + } + } + +} + diff --git a/yunzhupaas-admin/src/main/java/com/yunzhupaas/aop/PermissionAdminBase.java b/yunzhupaas-admin/src/main/java/com/yunzhupaas/aop/PermissionAdminBase.java new file mode 100644 index 0000000..cf067ba --- /dev/null +++ b/yunzhupaas-admin/src/main/java/com/yunzhupaas/aop/PermissionAdminBase.java @@ -0,0 +1,40 @@ +package com.yunzhupaas.aop; + +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.util.UserProvider; +import org.aspectj.lang.ProceedingJoinPoint; + +public interface PermissionAdminBase{ + + /** + * 详细的权限判断 + * @param pjp AOP切点参数 + * @param operatorUserId 操作者对象 + */ + Boolean detailPermission(ProceedingJoinPoint pjp, String operatorUserId, String methodName); + + /** + * 管理者权限判断 + * + */ + static Object permissionCommon(ProceedingJoinPoint pjp, PermissionAdminBase permissionAdminBase) throws Throwable { + // 获取用户信息 + UserInfo operatorUser = UserProvider.getUser(); + // 是否是管理员 + if(operatorUser.getIsAdministrator()){ + return pjp.proceed(); + }else { + // 获取方法名 + String methodName = pjp.getSignature().getName(); + // 具体方法权限 + if(permissionAdminBase.detailPermission(pjp, operatorUser.getUserId(),methodName)){ + return pjp.proceed(); + } + } + return ActionResult.fail(MsgCode.FA021.get()); + } + +} + diff --git a/yunzhupaas-admin/src/main/java/com/yunzhupaas/aop/PermissionOrgAspect.java b/yunzhupaas-admin/src/main/java/com/yunzhupaas/aop/PermissionOrgAspect.java new file mode 100644 index 0000000..d6f12e1 --- /dev/null +++ b/yunzhupaas-admin/src/main/java/com/yunzhupaas/aop/PermissionOrgAspect.java @@ -0,0 +1,120 @@ +package com.yunzhupaas.aop; + +import com.yunzhupaas.constant.PermissionConstant; +import com.yunzhupaas.permission.entity.OrganizeEntity; +import com.yunzhupaas.permission.model.organize.OrganizeCrForm; +import com.yunzhupaas.permission.model.organize.OrganizeDepartCrForm; +import com.yunzhupaas.permission.model.organize.OrganizeDepartUpForm; +import com.yunzhupaas.permission.model.organize.OrganizeUpForm; +import com.yunzhupaas.permission.service.OrganizeService; +import com.yunzhupaas.util.PermissionAspectUtil; +import com.yunzhupaas.util.UserProvider; +import lombok.extern.slf4j.Slf4j; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.StringJoiner; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 17:12 + */ +@Slf4j +@Aspect +@Component +public class PermissionOrgAspect implements PermissionAdminBase { + + @Autowired + private OrganizeService organizeService; + + /** + * 分级管理切点 + */ + @Pointcut("within(com.yunzhupaas.*.controller.*) && @annotation(com.yunzhupaas.annotation.OrganizePermission)") + public void pointcut() { + } + + /** + * 分级管理切点 + * + * @param pjp + * @return + * @throws Throwable + */ + @Around("pointcut()") + public Object around(ProceedingJoinPoint pjp) throws Throwable { + return PermissionAdminBase.permissionCommon(pjp, this); + } + + @Override + public Boolean detailPermission(ProceedingJoinPoint pjp, String operatorUserId, String methodName) { + switch (methodName) { + case PermissionConstant.METHOD_CREATE: + return PermissionAspectUtil.getPermitByOrgIds( + // 操作目标对象表单对象 + ((OrganizeCrForm) pjp.getArgs()[0]).getParentId(), + operatorUserId, + PermissionConstant.METHOD_CREATE); + case PermissionConstant.METHOD_CREATE_DEPARTMENT: + return PermissionAspectUtil.getPermitByOrgIds( + // 操作目标对象表单对象 + ((OrganizeDepartCrForm) pjp.getArgs()[0]).getParentId(), + operatorUserId, + PermissionConstant.METHOD_CREATE); + case PermissionConstant.METHOD_UPDATE: + // 当前组织id + String orgId = (String) pjp.getArgs()[0]; + // 当前组织父级id + OrganizeEntity info = organizeService.getInfo(orgId); + // 修改后的id + OrganizeUpForm organizeUpForm = (OrganizeUpForm) pjp.getArgs()[1]; + StringJoiner stringJoiner = new StringJoiner(","); + stringJoiner.add(orgId); + if (!organizeUpForm.getParentId().equals(info.getParentId()) && !"-1".equals(info.getParentId())) { + stringJoiner.add(info.getParentId()); + } + if (!organizeUpForm.getParentId().equals(info.getParentId()) && !"-1".equals(organizeUpForm.getParentId())) { + stringJoiner.add(organizeUpForm.getParentId()); + } + return PermissionAspectUtil.getPermitByOrgIds( + // 操作目标对象ID + stringJoiner.toString(), + operatorUserId, + PermissionConstant.METHOD_UPDATE); + case PermissionConstant.METHOD_UPDATE_DEPARTMENT: + // 当前组织id + String orgIds = (String) pjp.getArgs()[0]; + // 当前组织父级id + OrganizeEntity infos = organizeService.getInfo(orgIds); + // 修改后的id + OrganizeDepartUpForm organizeDepartUpForm = (OrganizeDepartUpForm) pjp.getArgs()[1]; + StringJoiner stringJoiners = new StringJoiner(","); + stringJoiners.add(orgIds); + if (!organizeDepartUpForm.getParentId().equals(infos.getParentId())) { + stringJoiners.add(infos.getParentId()); + stringJoiners.add(organizeDepartUpForm.getParentId()); + } + return PermissionAspectUtil.getPermitByOrgIds( + // 操作目标对象ID + stringJoiners.toString(), + operatorUserId, + PermissionConstant.METHOD_UPDATE); + case PermissionConstant.METHOD_DELETE: + case PermissionConstant.METHOD_DELETE_DEPARTMENT: + return PermissionAspectUtil.getPermitByOrgIds( + // 操作目标对象ID + pjp.getArgs()[0].toString(), + operatorUserId, + PermissionConstant.METHOD_DELETE); + default: + return false; + } + } +} + diff --git a/yunzhupaas-admin/src/main/java/com/yunzhupaas/aop/PermissionPositionAspect.java b/yunzhupaas-admin/src/main/java/com/yunzhupaas/aop/PermissionPositionAspect.java new file mode 100644 index 0000000..5675f07 --- /dev/null +++ b/yunzhupaas-admin/src/main/java/com/yunzhupaas/aop/PermissionPositionAspect.java @@ -0,0 +1,92 @@ +package com.yunzhupaas.aop; + +import com.yunzhupaas.constant.PermissionConstant; +import com.yunzhupaas.permission.entity.PositionEntity; +import com.yunzhupaas.permission.model.position.PositionCrForm; +import com.yunzhupaas.permission.model.position.PositionUpForm; +import com.yunzhupaas.permission.service.OrganizeService; +import com.yunzhupaas.permission.service.PositionService; +import com.yunzhupaas.util.PermissionAspectUtil; +import com.yunzhupaas.util.UserProvider; +import lombok.extern.slf4j.Slf4j; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 17:12 + */ +@Slf4j +@Aspect +@Component +public class PermissionPositionAspect implements PermissionAdminBase{ + + @Autowired + private PositionService positionService; + @Autowired + private OrganizeService organizeService; + + /** + * 分级管理切点 + */ + @Pointcut("within(com.yunzhupaas.*.controller.*) && @annotation(com.yunzhupaas.annotation.PositionPermission)") + public void pointcut() { + } + + /** + * 分级管理切点 + * + * @param pjp + * @return + * @throws Throwable + */ + @Around("pointcut()") + public Object around(ProceedingJoinPoint pjp) throws Throwable { + return PermissionAdminBase.permissionCommon(pjp, this); + } + + @Override + public Boolean detailPermission(ProceedingJoinPoint pjp, String operatorUserId, String methodName) { + switch (methodName){ + case PermissionConstant.METHOD_CREATE: + return PermissionAspectUtil.getPermitByOrgId( + // 操作目标对象组织ID集合 + ((PositionCrForm) pjp.getArgs()[0]).getOrganizeId(), + operatorUserId, + methodName); + case PermissionConstant.METHOD_UPDATE: + // 得到岗位信息后,判断是否有修改前的权限 + PositionEntity info = positionService.getInfo(((String) pjp.getArgs()[0])); + if (PermissionAspectUtil.getPermitByOrgId( + // 操作目标对象组织ID集合 + info.getOrganizeId(), + operatorUserId, + methodName)) { + return PermissionAspectUtil.getPermitByOrgId( + // 操作目标对象组织ID集合 + ((PositionUpForm) pjp.getArgs()[1]).getOrganizeId(), + operatorUserId, + methodName); + } + return false; + case PermissionConstant.METHOD_DELETE: + // 获取岗位所关联的组织ID字符串 + String positionId = String.valueOf(pjp.getArgs()[0]); + String orgIds = organizeService.getInfo(positionService.getInfo(positionId).getOrganizeId()).getId(); + return PermissionAspectUtil.getPermitByOrgId( + // 操作目标对象组织ID集合 + orgIds, + operatorUserId, + PermissionConstant.METHOD_DELETE); + default: + return false; + } + } +} + diff --git a/yunzhupaas-admin/src/main/java/com/yunzhupaas/aop/PermissionRoleAspect.java b/yunzhupaas-admin/src/main/java/com/yunzhupaas/aop/PermissionRoleAspect.java new file mode 100644 index 0000000..1562e0a --- /dev/null +++ b/yunzhupaas-admin/src/main/java/com/yunzhupaas/aop/PermissionRoleAspect.java @@ -0,0 +1,153 @@ +package com.yunzhupaas.aop; + +import com.yunzhupaas.constant.PermissionConstant; +import com.yunzhupaas.permission.entity.OrganizeRelationEntity; +import com.yunzhupaas.permission.entity.RoleEntity; +import com.yunzhupaas.permission.model.role.RoleCrForm; +import com.yunzhupaas.permission.model.role.RoleUpForm; +import com.yunzhupaas.permission.service.OrganizeRelationService; +import com.yunzhupaas.permission.service.PositionService; +import com.yunzhupaas.permission.service.RoleService; +import com.yunzhupaas.util.PermissionAspectUtil; +import com.yunzhupaas.util.UserProvider; +import lombok.extern.slf4j.Slf4j; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.List; +import java.util.StringJoiner; +import java.util.stream.Collectors; + +/** + * 角色操作权限 + * + * @author 云筑产品开发平台组 + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/2/10 + */ +@Slf4j +@Aspect +@Component +public class PermissionRoleAspect implements PermissionAdminBase { + + @Autowired + private RoleService roleService; + @Autowired + private OrganizeRelationService organizeRelationService; + + /** + * 分级管理切点 + */ + @Pointcut("within(com.yunzhupaas.*.controller.*) && @annotation(com.yunzhupaas.annotation.RolePermission)") + public void pointcut() { + } + + /** + * 分级管理切点 + * + * @param pjp + * @return + * @throws Throwable + */ + @Around("pointcut()") + public Object around(ProceedingJoinPoint pjp) throws Throwable { + return PermissionAdminBase.permissionCommon(pjp, this); + } + + @Override + public Boolean detailPermission(ProceedingJoinPoint pjp, String operatorUserId, String methodName) { + boolean flag = false; + switch (methodName) { + case PermissionConstant.METHOD_CREATE: + RoleCrForm roleCrForm = (RoleCrForm) pjp.getArgs()[0]; + if (!checkAdminGlobal(roleCrForm.getGlobalMark())) { + return PermissionAspectUtil.getPermitByOrgId( + // 操作目标对象组织ID集合 + getOrganize(roleCrForm.getOrganizeIdsTree()), + operatorUserId, + PermissionConstant.METHOD_CREATE); + } + return true; + case PermissionConstant.METHOD_UPDATE: + RoleUpForm roleUpForm = (RoleUpForm) pjp.getArgs()[0]; + // 非管理员情况下 + if (!checkAdminGlobal(roleUpForm.getGlobalMark())) { + // 得到以前的组织id + String roleId = (String) pjp.getArgs()[1]; + List relationListByRoleId = organizeRelationService.getRelationListByRoleId(roleId).stream().map(OrganizeRelationEntity::getOrganizeId).collect(Collectors.toList()); + StringJoiner stringJoiners = new StringJoiner(","); + relationListByRoleId.forEach(t -> { + stringJoiners.add(t); + }); + if (PermissionAspectUtil.getPermitByOrgId( + // 操作目标对象组织ID集合 + stringJoiners.toString(), + operatorUserId, + PermissionConstant.METHOD_UPDATE)) { + return PermissionAspectUtil.getPermitByOrgId( + // 操作目标对象组织ID集合 + getOrganize(roleUpForm.getOrganizeIdsTree()), + operatorUserId, + PermissionConstant.METHOD_UPDATE); + } + return false; + } + return true; + case PermissionConstant.METHOD_DELETE: + String roleId = pjp.getArgs()[0].toString(); + RoleEntity roleEntity = roleService.getInfo(roleId); + // 获取角色关联的组织信息 + List relationListByRoleId = organizeRelationService.getRelationListByRoleId(roleId); + StringBuilder orgId = new StringBuilder(); + relationListByRoleId.stream().forEach(t->{ + orgId.append(t.getOrganizeId() + ","); + }); + if (roleEntity != null && !checkAdminGlobal(roleEntity.getGlobalMark())) { + return PermissionAspectUtil.getPermitByOrgId( + // 操作目标对象组织ID集合 + orgId.toString(), + operatorUserId, + PermissionConstant.METHOD_DELETE); + } + return true; + default: + break; + } + return true; + } + + /** + * 转成组织id字符串 + * @param orgIdsTree + * @return + */ + private String getOrganize(List> orgIdsTree) { + StringBuilder orgIds = new StringBuilder(); + for (List list : orgIdsTree) { + if (list.size() > 0) { + String orgId = list.get(list.size() - 1); + orgIds.append(orgId + ","); + } + } + return orgIds.toString(); + } + + /** + * 全局角色只能超管来操作 + * + * @param globalMark 全局标识 1:全局 0: 非全局 + */ + private Boolean checkAdminGlobal(Integer globalMark) { + if (globalMark != null && globalMark == 1) { + return UserProvider.getUser().getIsAdministrator(); + } + return false; + } + +} + diff --git a/yunzhupaas-admin/src/main/java/com/yunzhupaas/aop/PermissionUserAspect.java b/yunzhupaas-admin/src/main/java/com/yunzhupaas/aop/PermissionUserAspect.java new file mode 100644 index 0000000..64ff963 --- /dev/null +++ b/yunzhupaas-admin/src/main/java/com/yunzhupaas/aop/PermissionUserAspect.java @@ -0,0 +1,150 @@ +package com.yunzhupaas.aop; + +import com.yunzhupaas.constant.PermissionConst; +import com.yunzhupaas.constant.PermissionConstant; +import com.yunzhupaas.permission.entity.OrganizeRelationEntity; +import com.yunzhupaas.permission.entity.UserRelationEntity; +import com.yunzhupaas.permission.model.user.form.UserCrForm; +import com.yunzhupaas.permission.model.user.form.UserUpForm; +import com.yunzhupaas.permission.model.userrelation.UserRelationForm; +import com.yunzhupaas.permission.service.*; +import com.yunzhupaas.util.PermissionAspectUtil; +import com.yunzhupaas.util.UserProvider; +import lombok.extern.slf4j.Slf4j; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.List; +import java.util.StringJoiner; +import java.util.stream.Collectors; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 17:12 + */ +@Slf4j +@Aspect +@Component +public class PermissionUserAspect implements PermissionAdminBase{ + + @Autowired + private OrganizeRelationService organizeRelationService; + @Autowired + private PositionService positionService; + @Autowired + private UserRelationService userRelationService; + + /** + * 分级管理切点 + */ + @Pointcut("within(com.yunzhupaas.*.controller.*) && @annotation(com.yunzhupaas.annotation.UserPermission)") + public void pointcut() { + } + + /** + * 分级管理切点 + * + * @param pjp + * @return + * @throws Throwable + */ + @Around("pointcut()") + public Object around(ProceedingJoinPoint pjp) throws Throwable { + return PermissionAdminBase.permissionCommon(pjp, this); + } + + @Override + public Boolean detailPermission(ProceedingJoinPoint pjp, String operatorUserId, String methodName) { + switch (methodName){ + case PermissionConstant.METHOD_CREATE: + UserCrForm userCrForm = (UserCrForm) pjp.getArgs()[0]; + return PermissionAspectUtil.getPermitByOrgId( + // 操作目标对象组织ID集合 + userCrForm.getOrganizeId(), + operatorUserId, + PermissionConstant.METHOD_CREATE); + case PermissionConstant.METHOD_UPDATE: + // 得到修改的用户以前的信息 + String userId = (String) pjp.getArgs()[0]; + List collect = userRelationService.getListByUserId(userId, PermissionConst.ORGANIZE).stream().map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + StringJoiner stringJoiner = new StringJoiner(","); + collect.forEach(t -> { + stringJoiner.add(t); + }); + if (PermissionAspectUtil.getPermitByOrgId( + // 操作目标对象组织ID集合 + stringJoiner.toString(), + operatorUserId, + PermissionConstant.METHOD_UPDATE)) { + return PermissionAspectUtil.getPermitByOrgId( + // 操作目标对象组织ID集合 + ((UserUpForm) pjp.getArgs()[1]).getOrganizeId(), + operatorUserId, + PermissionConstant.METHOD_UPDATE); + } + return false; + case PermissionConstant.METHOD_MODIFY_PW: + return PermissionAspectUtil.getPermitByUserId( + // 操作目标对象的ID + String.valueOf(pjp.getArgs()[0]), + operatorUserId, + PermissionConstant.METHOD_UPDATE); + case PermissionConstant.METHOD_DELETE: + return PermissionAspectUtil.getPermitByUserId( + // 操作目标对象的ID + pjp.getArgs()[0].toString(), + operatorUserId, + PermissionConstant.METHOD_DELETE); + case PermissionConstant.METHOD_SAVE: + String objId = pjp.getArgs()[0].toString(); + UserRelationForm userRelationForm = (UserRelationForm)pjp.getArgs()[1]; + + List orgIds = new ArrayList<>(); + if(userRelationForm.getObjectType().equals(PermissionConst.ROLE)){ + // 角色目前修改为只有超管才能够修改 + if(UserProvider.getUser().getIsAdministrator()){ + return true; + } + orgIds.addAll(organizeRelationService.getRelationListByRoleId(objId).stream().map(OrganizeRelationEntity::getOrganizeId).collect(Collectors.toList())); + return PermissionAspectUtil.getPermitByOrgId( + // 操作目标对象组织ID集合 + String.join(",", orgIds), + operatorUserId, + PermissionConstant.METHOD_UPDATE); + }else { + if(userRelationForm.getObjectType().equals(PermissionConst.GROUP)) { + return true; + } + if(userRelationForm.getObjectType().equals(PermissionConst.POSITION)) { + orgIds.add(positionService.getInfo(objId).getOrganizeId()); + } + return PermissionAspectUtil.getPermitByOrgId( + String.join(",", orgIds), + operatorUserId, + PermissionConstant.METHOD_UPDATE); + } + case PermissionConstant.METHOD_DELETE_SOCIALS: + if(pjp.getArgs()[0].toString().equals(operatorUserId)){return true;} + return PermissionAspectUtil.getPermitByUserId( + // 操作目标对象的ID + pjp.getArgs()[0].toString(), + operatorUserId, + PermissionConstant.METHOD_UPDATE); + default: + return false; + } + } + + + + + +} + diff --git a/yunzhupaas-admin/src/main/java/com/yunzhupaas/aop/RequestLogAspect.java b/yunzhupaas-admin/src/main/java/com/yunzhupaas/aop/RequestLogAspect.java new file mode 100644 index 0000000..6751797 --- /dev/null +++ b/yunzhupaas-admin/src/main/java/com/yunzhupaas/aop/RequestLogAspect.java @@ -0,0 +1,239 @@ +package com.yunzhupaas.aop; + +import cn.hutool.http.useragent.UserAgent; +import cn.hutool.http.useragent.UserAgentUtil; +import com.yunzhupaas.base.LogSortEnum; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.entity.LogEntity; +import com.yunzhupaas.service.LogService; +import com.yunzhupaas.util.*; +import lombok.extern.slf4j.Slf4j; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.Signature; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.aspectj.lang.reflect.MethodSignature; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; +import com.yunzhupaas.annotation.HandleLog; +import org.springframework.web.multipart.MultipartFile; + +import java.lang.reflect.Method; +import java.util.Date; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 17:12 + */ +@Slf4j +@Aspect +@Component +@Order(2) +public class RequestLogAspect { + + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private LogService logService; + + @Pointcut("within(com.yunzhupaas.*.controller.* || com.yunzhupaas.controller.*)")// && !within(com.yunzhupaas.controller.UtilsController) + public void requestLog() { + + } + + @Around("requestLog()") + public Object doAroundService(ProceedingJoinPoint pjp) throws Throwable { + long startTime = System.currentTimeMillis(); + Object obj = pjp.proceed(); + if(ServletUtil.getRequest() == null){ + return obj; + } + long costTime = System.currentTimeMillis() - startTime; + UserInfo userInfo = UserProvider.getUser(); + if(userInfo.getUserId() != null && (!configValueUtil.isMultiTenancy() || TenantHolder.getLocalTenantCache() != null)) { + // 得到请求参数 + Object[] args = pjp.getArgs(); + Signature signature = pjp.getSignature(); + printLog(userInfo, costTime, obj, args, signature); + try { + // 判断是否需要操作日志 + MethodSignature methodSignature = (MethodSignature) pjp.getSignature(); + // 得到请求方法 + Method method = methodSignature.getMethod(); + HandleLog methodAnnotation = method.getAnnotation(HandleLog.class); + if (methodAnnotation != null) { + String moduleName = methodAnnotation.moduleName(); + String requestMethod = methodAnnotation.requestMethod(); + handleLog(userInfo, costTime, obj, moduleName, requestMethod, args, signature); + } + } catch (Exception e) { + log.error("记录操作日志发生错误:" + e.getMessage()); + } + } + return obj; + } + + /** + * 请求日志 + * + * @param userInfo + * @param costTime + */ + private void printLog(UserInfo userInfo, long costTime, Object obj, Object[] args, Signature signature) { + LogEntity entity = new LogEntity(); + entity.setId(RandomUtil.uuId()); + entity.setType(LogSortEnum.Request.getCode()); + entity.setUserId(userInfo.getUserId()); + entity.setUserName(userInfo.getUserName() + "/" + userInfo.getUserAccount()); + //请求耗时 + entity.setRequestDuration((int) costTime); + entity.setRequestUrl(ServletUtil.getRequest().getServletPath()); + entity.setRequestMethod(ServletUtil.getRequest().getMethod()); + String ipAddr = IpUtil.getIpAddr(); + entity.setIpAddress(ipAddr); + entity.setIpAddressName(IpUtil.getIpCity(ipAddr)); + entity.setCreatorTime(new Date()); + UserAgent userAgent = UserAgentUtil.parse(ServletUtil.getUserAgent()); + if (userAgent != null) { + entity.setPlatForm(userAgent.getPlatform().getName() + " " + userAgent.getOsVersion()); + entity.setBrowser(userAgent.getBrowser().getName() + " " + userAgent.getVersion()); + } + String declaringTypeName = signature.getDeclaringTypeName(); + String name = signature.getName(); + entity.setRequestTarget(declaringTypeName + "." + name); + entity.setJsons(obj + ""); + StringBuilder stringBuilder = new StringBuilder(); + for (Object o : args) { + // 如果是MultipartFile则为导入 + if (o instanceof MultipartFile) { + stringBuilder.append("{\"originalFilename\":\"" + ((MultipartFile) o).getOriginalFilename() + "\","); + stringBuilder.append("\"contentType\":\"" + ((MultipartFile) o).getContentType() + "\","); + stringBuilder.append("\"name\":\"" + ((MultipartFile) o).getName() + "\","); + stringBuilder.append("\"resource\":\"" + ((MultipartFile) o).getResource() + "\","); + stringBuilder.append("\"size\":\"" + ((MultipartFile) o).getSize() + "\"}"); + } + } + if (stringBuilder.length() > 0) { + entity.setRequestParam(stringBuilder.toString()); + } else { + entity.setRequestParam(JsonUtil.getObjectToString(args)); + } + ThreadPoolExecutorUtil.getExecutor().execute(()->{ + logService.save(entity); + }); + } + + /** + * 添加操作日志 + * + * @param userInfo 用户信息 + * @param costTime 操作耗时 + * @param obj 请求结果 + * @param moduleName 模块名称 + * @param requestMethod 请求方法 + * @param args 请求参数 + */ + private void handleLog(UserInfo userInfo, long costTime, Object obj, String moduleName, String requestMethod, Object[] args, Signature signature) { + LogEntity entity = new LogEntity(); + entity.setId(RandomUtil.uuId()); + entity.setType(LogSortEnum.Operate.getCode()); + entity.setUserId(userInfo.getUserId()); + entity.setUserName(userInfo.getUserName() + "/" + userInfo.getUserAccount()); + //请求耗时 + entity.setRequestDuration((int) costTime); + entity.setRequestMethod(ServletUtil.getRequest().getMethod()); + entity.setRequestUrl(ServletUtil.getRequest().getServletPath()); + String ipAddr = IpUtil.getIpAddr(); + entity.setIpAddress(ipAddr); + entity.setIpAddressName(IpUtil.getIpCity(ipAddr)); + entity.setCreatorTime(new Date()); + // 请求设备 + UserAgent userAgent = UserAgentUtil.parse(ServletUtil.getUserAgent()); + if (userAgent != null) { + entity.setPlatForm(userAgent.getPlatform().getName() + " " + userAgent.getOsVersion()); + entity.setBrowser(userAgent.getBrowser().getName() + " " + userAgent.getVersion()); + } + // 操作模块 + entity.setModuleName(moduleName); + String declaringTypeName = signature.getDeclaringTypeName(); + String name = signature.getName(); + entity.setRequestTarget(declaringTypeName + "." + name); + // 操作记录 + StringBuilder stringBuilder = new StringBuilder(); + for (Object o : args) { + // 如果是MultipartFile则为导入 + if (o instanceof MultipartFile) { + stringBuilder.append("{\"originalFilename\":\"" + ((MultipartFile) o).getOriginalFilename() + "\","); + stringBuilder.append("\"contentType\":\"" + ((MultipartFile) o).getContentType() + "\","); + stringBuilder.append("\"name\":\"" + ((MultipartFile) o).getName() + "\","); + stringBuilder.append("\"resource\":\"" + ((MultipartFile) o).getResource() + "\","); + stringBuilder.append("\"size\":\"" + ((MultipartFile) o).getSize() + "\"}"); + } + } + if (stringBuilder.length() > 0) { + entity.setRequestParam(stringBuilder.toString()); + } else { + entity.setRequestParam(JsonUtil.getObjectToString(args)); + } + entity.setJsons(obj + ""); + ThreadPoolExecutorUtil.getExecutor().execute(()->{ + logService.save(entity); + }); + } + +/// 后面可能会用 +// /** +// * 判断是否为导入导出 +// * +// * @return +// */ +// private String getRequestMethod() { +// //得到请求方式 +// String methodType = ServletUtil.getRequest().getMethod(); +// // 得到当前请求的尾缀 +// String endWith = null; +// String servletPath = ServletUtil.getServletPath(); +// if (StringUtil.isNotEmpty(servletPath)) { +// String[] path = servletPath.split("/"); +// int length = path.length; +// if (length > 5) { +// endWith = path[length - 2] + "/" + path[length - 1]; +// } +// } +// // 如果是GET请求且请求后缀是'/Action/Export'则判定为导出 +// if (HandleMethodEnum.GET.getRequestType().equals(methodType)) { +// methodType = "Action/Export".equals(endWith) ? "EXPORT" : "GET"; +// } else if (HandleMethodEnum.POST.getRequestType().equals(methodType)) { +// methodType = "Action/Import".equals(endWith) ? "IMPORT" : "GET"; +// } +// return methodType; +// } +// /** +// * 判断是否为导入导出 +// * +// * @return +// */ +// private String getRequestModuleName() { +// //得到Url +// String requestURI = ServletUtil.getRequest().getRequestURI(); +// // 取模块名 +// if (StringUtil.isNotEmpty(requestURI)) { +// String[] split = requestURI.split("/"); +// if (split.length > 2) { +// String url = split[1]; +// // 得到所在模块 +// String moduleName = HandleModuleEnum.getModuleByURL(url); +// return moduleName; +// } +// } +// return ""; +// } +/// + +} + diff --git a/yunzhupaas-admin/src/main/java/com/yunzhupaas/aop/VisiualOpaAspect.java b/yunzhupaas-admin/src/main/java/com/yunzhupaas/aop/VisiualOpaAspect.java new file mode 100644 index 0000000..6890e0a --- /dev/null +++ b/yunzhupaas-admin/src/main/java/com/yunzhupaas/aop/VisiualOpaAspect.java @@ -0,0 +1,47 @@ +package com.yunzhupaas.aop; + +import com.yunzhupaas.util.RedisUtil; +import com.yunzhupaas.util.ServletUtil; +import lombok.extern.slf4j.Slf4j; +import org.aspectj.lang.annotation.After; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.HashSet; +import java.util.Set; + +/** + * 可视化开发缓存数据处理 + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 17:12 + */ +@Slf4j +//@Aspect +//@Component +public class VisiualOpaAspect { + + @Autowired + private RedisUtil redisUtil; + @Pointcut("(execution(* com.yunzhupaas.onlinedev.controller.VisualdevModelDataController.*(..))) || execution(* com.yunzhupaas.onlinedev.controller.VisualdevModelAppController.*(..)))" + + "|| execution(* com.yunzhupaas.generater.controller.VisualdevGenController.*(..)))") + public void visiualOpa() { + + } + + @After("visiualOpa()") + public void doAroundService(){ + String method=ServletUtil.getRequest().getMethod().toLowerCase(); + if("put".equals(method)||"delete".equals(method)||"post".equals(method)){ + Set allKey=new HashSet<>(16); + allKey.addAll(redisUtil.getAllVisiualKeys()); + for(String key:allKey){ + redisUtil.remove(key); + } + } + } + } + diff --git a/yunzhupaas-admin/src/main/java/com/yunzhupaas/constant/PermissionConstant.java b/yunzhupaas-admin/src/main/java/com/yunzhupaas/constant/PermissionConstant.java new file mode 100644 index 0000000..c28131a --- /dev/null +++ b/yunzhupaas-admin/src/main/java/com/yunzhupaas/constant/PermissionConstant.java @@ -0,0 +1,74 @@ +package com.yunzhupaas.constant; + +/** + * 分级管理常量 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-11-01 + */ +public class PermissionConstant { + + /** + * 创建方法 + */ + public static final String METHOD_CREATE = "create"; + + /** + * 编辑方法 + */ + public static final String METHOD_UPDATE = "update"; + + /** + * 删除方法 + */ + public static final String METHOD_DELETE = "delete"; + + /** + * 更新状态 + */ + public static final String METHOD_DISABLE = "disable"; + + /** + * 创建方法 + */ + public static final String METHOD_CREATE_DEPARTMENT = "createDepartment"; + + /** + * 编辑方法 + */ + public static final String METHOD_UPDATE_DEPARTMENT = "updateDepartment"; + + /** + * 删除方法 + */ + public static final String METHOD_DELETE_DEPARTMENT = "deleteDepartment"; + + /** + * 保存方法 + */ + public static final String METHOD_SAVE = "save"; + public static final String METHOD_SAVE_BATCH = "saveBatch"; + /** + * 修改用户密码 + */ + public static final String METHOD_MODIFY_PW = "modifyPassword"; + + /** + * 拼接方法名 + */ + public static final String GET_METHOD_CREATE = "Add"; + public static final String GET_METHOD_UPDATE = "Edit"; + public static final String GET_METHOD_DELETE = "Delete"; + public static final String GET_METHOD_SELECT = "Select"; + public static final String GET_METHOD_THIS = "getThisLayer"; + public static final String GET_METHOD_SUB = "getSubLayer"; + + /** + * 解除绑定方法 + */ + public static final String METHOD_DELETE_SOCIALS = "deleteSocials"; + +} + diff --git a/yunzhupaas-admin/src/main/java/com/yunzhupaas/filter/AuthFilter.java b/yunzhupaas-admin/src/main/java/com/yunzhupaas/filter/AuthFilter.java new file mode 100644 index 0000000..595763d --- /dev/null +++ b/yunzhupaas-admin/src/main/java/com/yunzhupaas/filter/AuthFilter.java @@ -0,0 +1,102 @@ +package com.yunzhupaas.filter; + +import cn.dev33.satoken.context.SaHolder; +import cn.dev33.satoken.exception.NotLoginException; +import cn.dev33.satoken.filter.SaFilterAuthStrategy; +import cn.dev33.satoken.filter.SaServletFilter; +import cn.dev33.satoken.router.SaRouter; +import cn.dev33.satoken.stp.StpUtil; +import cn.dev33.satoken.util.SaResult; +import com.yunzhupaas.base.ActionResultCode; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.consts.AuthConsts; +import com.yunzhupaas.properties.GatewayWhite; +import com.yunzhupaas.util.IpUtil; +import com.yunzhupaas.util.UserProvider; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + + +/** + * 网关验证token + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-03-24 + */ +@Slf4j +@Configuration +public class AuthFilter { + + + @Autowired + private GatewayWhite gatewayWhite; + + @Autowired + private SaFilterAuthStrategy defaultBeforeAuthStrategy; + + // 注册 Sa-Token全局过滤器 + @Bean + public SaServletFilter getSaReactorFilter() { + return new SaServletFilter() + // 拦截地址 + .addInclude("/**") + .setExcludeList(gatewayWhite.excludeUrl) + // 鉴权方法:每次访问进入 + .setAuth(obj -> { + if(log.isInfoEnabled()){ + log.info("请求路径: {}", SaHolder.getRequest().getRequestPath()); + } + //拦截路径 + SaRouter.match(gatewayWhite.blockUrl).match(o -> { + //禁止访问URL 排除白名单 + String ip = getIpAddr(); + for (String o1 : gatewayWhite.whiteIp) { + if(ip.startsWith(o1)){ + return false; + } + } + log.info("非白名单IP访问限制接口:{}, {}", SaHolder.getRequest().getRequestPath(), ip); + return true; + }).back(MsgCode.AD101.get()); + //测试不验证 鉴权服务重启测试模式不清除Token就够了 + //SaRouter.match((r)->"true".equals(configValueUtil.getTestVersion())).stop(); + //白名单不拦截 + SaRouter.match(gatewayWhite.whiteUrl).stop(); + //内部请求不拦截 + SaRouter.match(t->{ + String innerToken = SaHolder.getRequest().getHeader(AuthConsts.INNER_TOKEN_KEY); + return UserProvider.isValidInnerToken(innerToken); + }).stop(); + // 登录校验 -- 校验多租户管理模块TOKEN + //SaRouter.match("/api/tenant/**", r -> { + // SaManager.getStpLogic(AuthConsts.ACCOUNT_TYPE_TENANT).checkLogin(); + //}).stop(); + // 登录校验 -- 拦截所有路由 + SaRouter.match("/**", r -> { + StpUtil.checkLogin(); + }).stop(); + }).setError(e -> { + SaHolder.getResponse().addHeader("Content-Type","application/json; charset=utf-8"); + if(e instanceof NotLoginException){ + return SaResult.error(ActionResultCode.SessionOverdue.getMessage()).setCode(ActionResultCode.SessionOverdue.getCode()); + } + log.error(e.getMessage(), e); + return SaResult.error(MsgCode.AD102.get()).setCode(ActionResultCode.Exception.getCode()); + }) + // 前置函数:在每次认证函数之前执行 + .setBeforeAuth(defaultBeforeAuthStrategy); + } + + + + public static String getIpAddr() { + return IpUtil.getIpAddr(); + } + + +} + diff --git a/yunzhupaas-admin/src/main/java/com/yunzhupaas/filter/MvcSecurityConfig.java b/yunzhupaas-admin/src/main/java/com/yunzhupaas/filter/MvcSecurityConfig.java new file mode 100644 index 0000000..52f1a72 --- /dev/null +++ b/yunzhupaas-admin/src/main/java/com/yunzhupaas/filter/MvcSecurityConfig.java @@ -0,0 +1,114 @@ +package com.yunzhupaas.filter; + +import cn.dev33.satoken.context.SaHolder; +import cn.dev33.satoken.context.model.SaRequest; +import cn.dev33.satoken.context.model.SaResponse; +import cn.dev33.satoken.filter.SaFilterAuthStrategy; +import cn.dev33.satoken.router.SaRouter; +import com.yunzhupaas.properties.MvcSecurityProperties; +import com.yunzhupaas.util.Constants; +import com.yunzhupaas.util.IpUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.annotation.Order; +import org.springframework.http.HttpStatus; +import org.springframework.util.ObjectUtils; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.CorsConfigurationSource; +import org.springframework.web.cors.UrlBasedCorsConfigurationSource; +import org.springframework.web.filter.CorsFilter; + +import java.net.URI; + +/** + * mvc配置 + * + * @author 云筑产品开发平台组 + * @version V5.2.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2025-01-21 + */ +@Slf4j +@Configuration(proxyBeanMethods = false) +public class MvcSecurityConfig { + + private static final String DOMAIN_FORMAT = "%s://%s"; + + @Autowired + private MvcSecurityProperties mvcSecurityProperties; + + + @Bean + public CorsFilter corsFilter() { + UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); + CorsConfiguration config = new CorsConfiguration(); + // 允许发送凭据 + config.setAllowCredentials(true); + //允许任意域名跨域访问接口 + config.setAllowedOrigins(mvcSecurityProperties.getCors().getAllowedOrigins()); + config.setAllowedOriginPatterns(mvcSecurityProperties.getCors().getAllowedOriginPatterns()); + // 允许所有头部信息 + config.setAllowedHeaders(mvcSecurityProperties.getCors().getAllowedHeaders()); + // 允许所有请求方法 + config.setAllowedMethods(mvcSecurityProperties.getCors().getAllowedMethods()); + // 应用于所有路径 + source.registerCorsConfiguration("/**", config); + return new MyCorsFilter(source); + } + + @Bean + @ConditionalOnMissingBean + public SaFilterAuthStrategy defaultBeforeAuthStrategy() { + CorsConfiguration csrfConfiguration; + if(!mvcSecurityProperties.getCsrfOrigins().isEmpty() || !mvcSecurityProperties.getCsrfOriginsPatterns().isEmpty()) { + csrfConfiguration = new CorsConfiguration(); + csrfConfiguration.setAllowedOrigins(mvcSecurityProperties.getCsrfOrigins()); + csrfConfiguration.setAllowedOriginPatterns(mvcSecurityProperties.getCsrfOriginsPatterns()); + } else { + csrfConfiguration = null; + } + return obj -> { + SaRequest request = SaHolder.getRequest(); + // ---------- 设置跨域响应头 ---------- + SaResponse response = SaHolder.getResponse(); + if(!ObjectUtils.isEmpty(mvcSecurityProperties.getHeaders().getServerName())){ + response.setServer(mvcSecurityProperties.getHeaders().getServerName()); + } + if(!ObjectUtils.isEmpty(mvcSecurityProperties.getHeaders().getXFrameOptions()) && !MvcSecurityProperties.XFrameOptionsMode.DISABLED.equals(mvcSecurityProperties.getHeaders().getXFrameOptions())){ + response.setHeader(MvcSecurityProperties.HEADER_XFRAME_OPTIONS, mvcSecurityProperties.getHeaders().getXFrameOptions().getMode()); + } + if(!ObjectUtils.isEmpty(mvcSecurityProperties.getHeaders().getXXssProtection()) && !MvcSecurityProperties.XXssProtectionMode.DISABLED.equals(mvcSecurityProperties.getHeaders().getXXssProtection())){ + response.setHeader(MvcSecurityProperties.HEADER_XSS_PROTECTION, mvcSecurityProperties.getHeaders().getXXssProtection().getMode()); + } + if(!ObjectUtils.isEmpty(mvcSecurityProperties.getHeaders().getXContentTypeOptions()) && !MvcSecurityProperties.XContentTypeOptions.DISABLED.equals(mvcSecurityProperties.getHeaders().getXContentTypeOptions())){ + response.setHeader(MvcSecurityProperties.HEADER_Content_Type_Options, mvcSecurityProperties.getHeaders().getXContentTypeOptions().getMode()); + } + + if(csrfConfiguration != null){ + String referer = request.getHeader("referer"); + if(!ObjectUtils.isEmpty(referer)) { + URI uri = URI.create(referer); + String refererDomain = String.format(DOMAIN_FORMAT, uri.getScheme(), uri.getAuthority()); + String allowOrign = csrfConfiguration.checkOrigin(refererDomain); + if(ObjectUtils.isEmpty(allowOrign)){ + log.error("Reject CSRF Request: {}, {}, {}, {}", request.getRequestPath(), referer, IpUtil.getIpAddr(), request.getHeader(Constants.AUTHORIZATION)); + response.setStatus(HttpStatus.FORBIDDEN.value()); + SaRouter.back("Invalid CSRF Request"); + } + } + } + }; + } + + + @Order(-110) + public static class MyCorsFilter extends CorsFilter { + public MyCorsFilter(CorsConfigurationSource configSource) { + super(configSource); + } + } +} + diff --git a/yunzhupaas-admin/src/main/java/com/yunzhupaas/util/PermissionAspectUtil.java b/yunzhupaas-admin/src/main/java/com/yunzhupaas/util/PermissionAspectUtil.java new file mode 100644 index 0000000..0e4e290 --- /dev/null +++ b/yunzhupaas-admin/src/main/java/com/yunzhupaas/util/PermissionAspectUtil.java @@ -0,0 +1,166 @@ +package com.yunzhupaas.util; + +import com.yunzhupaas.constant.PermissionConstant; +import com.yunzhupaas.permission.entity.OrganizeAdministratorEntity; +import com.yunzhupaas.permission.entity.OrganizeEntity; +import com.yunzhupaas.permission.service.OrganizeAdministratorService; +import com.yunzhupaas.permission.service.OrganizeService; +import com.yunzhupaas.util.context.SpringContext; + +/** + * 分级管理工具类 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-11-01 + */ +public class PermissionAspectUtil { + + private static final OrganizeService organizeService; + private static final OrganizeAdministratorService organizeAdministratorService; + + static { + organizeService = SpringContext.getBean(OrganizeService.class); + organizeAdministratorService = SpringContext.getBean(OrganizeAdministratorService.class); + } + + /** + * 判断是否存在修改前所在的组织的操作 + * + * @param targetUserId 被操作目标对象ID + * @param operatorUsrId 操作者ID + * @param methodName 操作方法 + */ + public static Boolean getPermitByUserId(String targetUserId, String operatorUsrId, String methodName) { + for(OrganizeEntity organizeEntity : organizeService.getAllOrgByUserId(targetUserId)){ + if (PermissionAspectUtil.containPermission(organizeEntity.getId(), operatorUsrId, methodName)) { + return true; + } + } + return false; + } + + /** + * 判断 操作者是否含有该组织的操作权限 + * + * @param organizeId 被操作者所在组织ID + * @param operatorUserId 当前操作者用户对象ID + * @param methodName 操作类型:创建、编辑、删除 + */ + public static boolean containPermission(String organizeId, String operatorUserId, String methodName) { + OrganizeEntity organizeEntity = organizeService.getInfo(organizeId); + if (organizeEntity != null) { + // 当前用户的所有分级权限 + OrganizeAdministratorEntity adminEntity = organizeAdministratorService.getOne(operatorUserId, organizeId); + if(permissionFlag(adminEntity, methodName, true)){ + return true; + } + // 查看父级的组织权限是否含有子集权限 + return parentPermission(organizeEntity.getParentId(), methodName, operatorUserId); + } + return false; + } + + /** + * 判断是否存在修改前所在的组织的操作(拥有所有的组织权限才能操作) + * + * @param organizeIds 组织ID集合字符串 + * @param operatorUsrId 操作者ID + * @param methodName 操作方法 + */ + public static Boolean getPermitByOrgIds(String organizeIds, String operatorUsrId, String methodName) { + boolean flag = true; + for (String organizeId : organizeIds.split(",")) { + flag = true; + flag = PermissionAspectUtil.containPermission(organizeId, operatorUsrId, methodName); + if (!flag) { + break; + } + } + return flag; + } + + /** + * 判断是否可修改所在的组织的操作(只要有一个权限即可操作) + * + * @param organizeIds 组织ID集合字符串 + * @param operatorUsrId 操作者ID + * @param methodName 操作方法 + */ + public static Boolean getPermitByOrgId(String organizeIds, String operatorUsrId, String methodName) { + for (String organizeId : organizeIds.split(",")) { + if (PermissionAspectUtil.containPermission(organizeId,operatorUsrId, methodName)) { + return true; + } + } + return false; + } + + /** + * 判断组织新建权限(从父级给的子集新建操作权限) + * + * @param organizeParentId + * @param methodName + * @param userId + * @return + */ + private static boolean parentPermission(String organizeParentId, String methodName, String userId) { + // 得到父级组织 + OrganizeEntity parentOrganizeEntity = organizeService.getInfo(organizeParentId); + + if (parentOrganizeEntity != null) { + // 得到父级的权限 + if(permissionFlag(organizeAdministratorService.getOne(userId, parentOrganizeEntity.getId()), methodName, false)){ + return true; + } + // 当前正在判断的组织已经是顶级则无需递归 + if (!"-1".equals(parentOrganizeEntity.getParentId())) { + return parentPermission(parentOrganizeEntity.getParentId(), methodName, userId); + } + } + return false; + } + + /** + * 判断是否具有权限 + * @param adminEntity 分级管理对象 + * @param methodName 操作类型:创建、编辑、删除 + * @param thisFlag true:当前组织 false:子组织 + */ + private static boolean permissionFlag(OrganizeAdministratorEntity adminEntity, String methodName, Boolean thisFlag) { + if (adminEntity != null) { + String methodType = ""; + // 存在则验证是否有当前组织分级管理 + try { + switch (methodName) { + case PermissionConstant.METHOD_CREATE: + // 创建权限 + methodType = PermissionConstant.GET_METHOD_CREATE; + break; + case PermissionConstant.METHOD_UPDATE: + // 编辑权限 + methodType = PermissionConstant.GET_METHOD_UPDATE; + break; + case PermissionConstant.METHOD_DELETE: + // 删除权限 + methodType = PermissionConstant.GET_METHOD_DELETE; + break; + default: + break; + } + // 拼接方法名 + String method = (thisFlag ? PermissionConstant.GET_METHOD_THIS : PermissionConstant.GET_METHOD_SUB) + methodType; + String selectMethod = (thisFlag ? PermissionConstant.GET_METHOD_THIS : PermissionConstant.GET_METHOD_SUB) + PermissionConstant.GET_METHOD_SELECT; + if ((int)OrganizeAdministratorEntity.class.getMethod(method).invoke(adminEntity) == 1 && (int)OrganizeAdministratorEntity.class.getMethod(selectMethod).invoke(adminEntity) == 1) { + return true; + } + } catch (Exception e) { + e.printStackTrace(); + } + } + return false; + } + +} + diff --git a/yunzhupaas-admin/src/main/resources/AntiSamy_zh_CN.properties b/yunzhupaas-admin/src/main/resources/AntiSamy_zh_CN.properties new file mode 100644 index 0000000..fb19076 --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/AntiSamy_zh_CN.properties @@ -0,0 +1,34 @@ +# General +error.size.toolarge=\u8F93\u5165\u592A\u5927\u3002\u5B9E\u9645\u7684\u8F93\u5165\u4E3A{0}\u5B57\u8282\u3002\u5141\u8BB8\u7684\u6700\u5927\u8F93\u5165\u4E3A{1}\u5B57\u8282\u3002 +error.comment.removed=\u51FA\u4E8E\u5B89\u5168\u7684\u539F\u56E0\uFF0C\u6CE8\u91CA\u57DF\u5DF2\u88AB\u8FC7\u6EE4\u3002\u6CE8\u91CA\u57DF\u7684\u503C\u4E3A{0} +# Tag related +error.tag.notfound=\u51FA\u4E8E\u5B89\u5168\u7684\u539F\u56E0\uFF0C\u6807\u8BB0{0}\u5DF2\u88AB\u8FC7\u6EE4\u3002\u6807\u8BB0\u7684\u5185\u5BB9\u4FDD\u5B58\u4E0D\u53D8\u3002 +error.tag.removed=\u51FA\u4E8E\u5B89\u5168\u7684\u539F\u56E0\uFF0C\u6807\u8BB0{0}\u4E0D\u88AB\u5141\u8BB8\u3002\u6B64\u6807\u8BB0\u4E0D\u5E94\u8BE5\u5F71\u54CD\u8F93\u5165\u7684\u663E\u793A\u3002 +error.tag.filtered=\u51FA\u4E8E\u5B89\u5168\u7684\u539F\u56E0\uFF0C\u6807\u8BB0{0}\u5DF2\u88AB\u8FC7\u6EE4\u3002\u6807\u8BB0\u7684\u5185\u5BB9\u4FDD\u5B58\u4E0D\u53D8\u3002 +error.tag.encoded=The {0} tag has been encoded for security reasons. The contents of the tag will remain in place. +error.tag.empty=\u5728{0}\u7684\u6807\u7B7E\u662F\u7A7A\u7684\uFF0C\u56E0\u6B64\u6211\u4EEC\u65E0\u6CD5\u5904\u7406\u5B83\u3002\u8BE5\u90AE\u4EF6\u7684\u5176\u4F59\u90E8\u5206\u662F\u5B8C\u6574\u7684\uFF0C\u5176\u642C\u8FC1\u5E94\u8BE5\u6CA1\u6709\u4EFB\u4F55\u526F\u4F5C\u7528\u3002 +error.cdata.found=\u4E00\u4E2ACDATA\u90E8\u5206\u88AB\u53D1\u73B0\uFF0C\u8FD9\u662F\u4E0D\u5141\u8BB8\u7684\u3002\u8BE5\u90AE\u4EF6\u7684\u5176\u4F59\u90E8\u5206\u662F\u5B8C\u6574\u7684\uFF0C\u5176\u642C\u8FC1\u4E0D\u5E94\u8BE5\u6709\u4EFB\u4F55\u526F\u4F5C\u7528\u3002\u5728CDATA\u7684\u5185\u5BB9\u662F \"{0}\"\u3002 +error.pi.found=XML\u5904\u7406\u6307\u4EE4\u88AB\u53D1\u73B0\uFF0C\u8FD9\u662F\u4E0D\u5141\u8BB8\u7684\u3002\u6D88\u606F\u7684\u5176\u4F59\u90E8\u5206\u662F\u5B8C\u6574\u7684\uFF0C\u5176\u642C\u8FC1\u5E94\u8BE5\u4E0D\u4F1A\u6709\u4EFB\u4F55\u526F\u4F5C\u7528\u3002\u8BE5\u6307\u4EE4\u7684\u5185\u5BB9\u4E3A \"{0}\"\u3002 +# Attribute related +error.attribute.notfound=\u6807\u8BB0{0}\u5305\u542B\u4E00\u4E2A\u6CA1\u6CD5\u5904\u7406\u7684\u5C5E\u6027\u3002\u5C5E\u6027{1}\u5DF2\u88AB\u8FC7\u6EE4\uFF0C\u4F46\u6807\u8BB0\u4FDD\u5B58\u4E0D\u53D8\u3002 +error.attribute.invalid=\u6807\u8BB0{0}\u5305\u542B\u4E00\u4E2A\u6CA1\u6CD5\u5904\u7406\u7684\u5C5E\u6027\u3002\u5C5E\u6027{1}\u5305\u542B\u4E00\u4E2A\u503C\"{2}\"\u3002\u51FA\u4E8E\u5B89\u5168\u7684\u539F\u56E0\uFF0C\u8FD9\u4E2A\u503C\u6CA1\u6CD5\u88AB\u63A5\u53D7\u3002\u4E3A\u4E86\u5904\u7406\u8FD9\u4E2A\u8F93\u5165\uFF0C\u8FD9\u4E2A\u5C5E\u6027\u5DF2\u88AB\u4ECE\u8FD9\u4E2A\u6807\u8BB0\u4E2D\u53BB\u6389\uFF0C\u6807\u8BB0\u5176\u4ED6\u90E8\u5206\u4FDD\u6301\u4E0D\u53D8\u3002 +error.attribute.invalid.filtered=\u6807\u8BB0{0}\u5305\u542B\u4E00\u4E2A\u6CA1\u6CD5\u5904\u7406\u7684\u5C5E\u3002\u5C5E\u6027{1}\u5305\u542B\u4E00\u4E2A\u503C\"{2}\"\u3002\u51FA\u4E8E\u5B89\u5168\u7684\u539F\u56E0\uFF0C\u8FD9\u4E2A\u503C\u6CA1\u6CD5\u88AB\u63A5\u53D7\u3002\u4E3A\u4E86\u8FDB\u4E00\u6B65\u5904\u7406\u8FD9\u4E2A\u8F93\u5165\uFF0C\u6807\u8BB0{0}\u5DF2\u88AB\u8FC7\u6EE4\u3002 +error.attribute.invalid.encoded=The {0} tag contained an attribute that we could not process. The {1} attribute had a value of \"{2}\". This value could not be accepted for security reasons. We have chosen to encode the {0} tag in order to continue processing the input. +error.attribute.invalid.removed=\u6807\u8BB0{0}\u5305\u542B\u4E00\u4E2A\u6CA1\u6CD5\u5904\u7406\u7684\u5C5E\u6027\u3002\u5C5E\u6027{1}\u5305\u542B\u4E00\u4E2A\u503C\"{2}\"\u3002\u51FA\u4E8E\u5B89\u5168\u7684\u539F\u56E0\uFF0C\u8FD9\u4E2A\u503C\u6CA1\u6CD5\u88AB\u63A5\u53D7\u3002\u4E3A\u4E86\u8FDB\u4E00\u6B65\u5904\u7406\u8FD9\u4E2A\u8F93\u5165\uFF0C\u6574\u4E2A\u6807\u8BB0{0}\u5DF2\u88AB\u53BB\u6389\u3002 +# CSS related +error.css.tag.malformed=The stylesheet code \"{0}\" could not be parsed. +error.css.import.disabled=\u6837\u5F0F\u8868\u7684\u5BFC\u5165\u8FD8\u6CA1\u6709\u88AB\u6FC0\u6D3B\u3002 +error.css.import.exceeded=\u4F4D\u4E8E{0}\u7684\u6837\u5F0F\u8868\u8D85\u8FC7\u5141\u8BB8\u5BFC\u5165\u7684\u6837\u5F0F\u8868\u7684\u603B\u6570\uFF0C\u56E0\u6B64\u8BE5\u6837\u5F0F\u8868\u6CA1\u6709\u88AB\u8BFB\u53D6\u3002\u5141\u8BB8\u5BFC\u5165\u7684\u6837\u5F0F\u8868\u7684\u6700\u5927\u6570\u76EE\u4E3A{1}\u3002 +error.css.import.failure=\u8F93\u5165\u4E2D\u542B\u6709\u7684\u8FDC\u7A0B\u6837\u5F0F\u8868\u4F4D\u4E8E{0}\uFF0C\u6B64\u6837\u5F0F\u8868\u6CA1\u6CD5\u88AB\u8BFB\u53D6\u3002\u7F51\u7AD9\u53EF\u80FD\u5173\u95ED\u6216\u8005\u4E3B\u673A\u6CA1\u6CD5\u88AB\u8BBF\u95EE\u3002\u8FD9\u4E0D\u5E94\u8BE5\u5F71\u54CD\u8F93\u5165\u7684\u683C\u5F0F\u3002 +error.css.import.toolarge=\u4F4D\u4E8E{0}\u7684\u6837\u5F0F\u8868\u4F7F\u5F97\u603B\u8F93\u5165\u592A\u5927\uFF0C\u56E0\u6B64\u6CA1\u6709\u88AB\u5BFC\u5165\u3002\u5141\u8BB8\u7684\u6700\u5927\u8F93\u5165\u4E3A{1}\u5B57\u8282\u3002 +error.css.import.url.invalid=\u51FA\u4E8E\u5B89\u5168\u7684\u539F\u56E0\uFF0C\u7528\u4E8E\u5BFC\u5165\u6837\u5F0F\u8868\u7684url\u6CA1\u6CD5\u88AB\u63A5\u53D7\u3002\u6B64url\u662F{1}\u3002 +error.css.stylesheet.relative=\u6837\u5F0F\u8868\u5F15\u7528\u4E86\u4E00\u4E2A\u6CA1\u6CD5\u8BFB\u53D6\u7684\u76F8\u5BF9\u6837\u5F0F\u8868\"{0}\"\u3002 +error.css.tag.relative=\u6807\u8BB0{0}\u4E2D\u7684\u4E00\u4E2A\u6837\u5F0F\u5C5E\u6027\u6307\u5B9A\u4E86\u4E00\u4E2A\u6CA1\u6CD5\u8BFB\u53D6\u7684\u76F8\u5BF9\u6837\u5F0F\u8868\u5E94\u7528\"{0}\"\u3002 +error.css.stylesheet.rule.notfound=\u6837\u5F0F\u8868\u4F7F\u7528\u4E86\u4E00\u4E2A\u4E0D\u88AB\u652F\u6301\u7684\u89C4\u5219\"{0}\"\u3002\u51FA\u4E8E\u5B89\u5168\u7684\u539F\u56E0\uFF0C\u6B64\u89C4\u5219\u5DF2\u88AB\u53BB\u6389\u3002 +error.css.tag.rule.notfound=\u6807\u8BB0{0}\u4E2D\u7684\u4E00\u4E2A\u6837\u5F0F\u5C5E\u6027\u4F7F\u7528\u4E86\u4E00\u4E2A\u4E0D\u88AB\u652F\u6301\u7684\u89C4\u5219\"{0}\"\u3002\u51FA\u4E8E\u5B89\u5168\u7684\u539F\u56E0\uFF0C\u6B64\u89C4\u5219\u5DF2\u88AB\u53BB\u6389\u3002 +error.css.stylesheet.selector.notfound=\u6837\u5F0F\u8868\u4F7F\u7528\u4E86\u4E00\u4E2A\u6CA1\u6CD5\u5904\u7406\u7684\u9009\u62E9\u5668\"{0}\"\u3002\u51FA\u4E8E\u5B89\u5168\u7684\u539F\u56E0\uFF0C\u6B64\u9009\u62E9\u5668\u5DF2\u88AB\u53BB\u6389\u3002 +error.css.tag.selector.notfound=\u6807\u8BB0{0}\u4E2D\u7684\u4E00\u4E2A\u6837\u5F0F\u5C5E\u6027\u4F7F\u7528\u4E86\u4E00\u4E2A\u6CA1\u6CD5\u5904\u7406\u7684\u9009\u62E9\u5668\"{0}\"\u3002\u51FA\u4E8E\u5B89\u5168\u7684\u539F\u56E0\uFF0C\u6B64\u89C4\u5219\u5DF2\u88AB\u53BB\u6389\u3002 +error.css.stylesheet.selector.disallowed=\u6837\u5F0F\u8868\u4F7F\u7528\u4E86\u4E00\u4E2A\u9009\u62E9\u5668\"{0}\"\u3002\u51FA\u4E8E\u5B89\u5168\u7684\u539F\u56E0\uFF0C\u6B64\u9009\u62E9\u5668\u4E0D\u88AB\u5141\u8BB8\u3002 +error.css.tag.selector.disallowed=\u6807\u8BB0{0}\u4E2D\u7684\u4E00\u4E2A\u6837\u5F0F\u5C5E\u6027\u4F7F\u7528\u4E86\u4E00\u4E2A\u9009\u62E9\u5668\"{1}\"\u3002\u51FA\u4E8E\u5B89\u5168\u7684\u539F\u56E0\uFF0C\u6B64\u9009\u62E9\u5668\u4E0D\u88AB\u5141\u8BB8\u3002 +error.css.stylesheet.property.invalid=\u6837\u5F0F\u8868\u542B\u6709\u4E00\u4E2A\u5C5E\uFF08property)\"{0}\"\u3002\u51FA\u4E8E\u5B89\u5168\u7684\u539F\u56E0\uFF0C\u6B64\u5C5E\u6027\u4E0D\u88AB\u5141\u8BB8\u3002 +error.css.tag.property.invalid=\u6807\u8BB0{0}\u4E2D\u542B\u6709\u4E00\u4E2A\u6837\u5F0F\u5C5E\u6027\"{1}\"\u3002\u51FA\u4E8E\u5B89\u5168\u7684\u539F\u56E0\uFF0C\u6B64\u5C5E\u6027\u4E0D\u88AB\u5141\u8BB8\u3002 diff --git a/yunzhupaas-admin/src/main/resources/antisamy-ebay-imgonlybase64.xml b/yunzhupaas-admin/src/main/resources/antisamy-ebay-imgonlybase64.xml new file mode 100644 index 0000000..50ba288 --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/antisamy-ebay-imgonlybase64.xml @@ -0,0 +1,2453 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + g + grin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/yunzhupaas-admin/src/main/resources/antisamy-ebay.xml b/yunzhupaas-admin/src/main/resources/antisamy-ebay.xml new file mode 100644 index 0000000..6df3a7a --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/antisamy-ebay.xml @@ -0,0 +1,2455 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + g + grin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/yunzhupaas-admin/src/main/resources/antisamy-empty.xml b/yunzhupaas-admin/src/main/resources/antisamy-empty.xml new file mode 100644 index 0000000..24f851c --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/antisamy-empty.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/yunzhupaas-admin/src/main/resources/application-dev.yml b/yunzhupaas-admin/src/main/resources/application-dev.yml new file mode 100644 index 0000000..c4dd5e2 --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/application-dev.yml @@ -0,0 +1,370 @@ +# 应用服务器 +server: + tomcat: + uri-encoding: UTF-8 #tomcat编码 + port: 40000 #tomcat端口 + +spring: + messages: + basename: i18n/message + # 一天刷新一次 + cache-duration: 24H + devtools: #spring开发者工具模块 + restart: + enabled: true #热部署开关 + freemarker: + cache: false #spring内置freemarker缓存 + thymeleaf: + cache: false #spring内置thymeleaf缓存 + + # ===================== 数据源配置 ===================== + exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure #排除自动配置,手动配置druid + datasource: + db-type: MySQL #数据库类型(可选值 MySQL、SQLServer、Oracle、DM8、KingbaseES、PostgreSQL,请严格按可选值填写) + # host: aliyun.szlecheng.cn + host: mysql.szlecheng.cn + port: 13306 + username: jnpfsoft + password: ZtRmzjij4CiaXpSE + db-name: jnpfsoft_dev + db-schema: #金仓达梦选填 + prepare-url: #自定义url + + # ===================== 动态多数据源 ===================== + dynamic: + primary: master #设置默认的数据源或者数据源组,默认值即为master + strict: true #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源 + druid: + # 空闲时执行连接测试 + test-while-idle: true + # 连接测试最小间隔 + time-between-eviction-runs-millis: 60000 + # 获取连接等待3秒 根据网络情况设定 + max-wait: 3000 + # 初始化4个连接 + initial-size: 4 + # 最大20个连接 + max-active: 20 + # 最少保持4个空闲连接 + min-idle: 4 + # 空闲连接保活, 超过配置的空闲时间会进行连接检查完成保活操作(数据库自身会断开达到空闲时间的连接, 程序使用断开的连接会报错) + keep-alive: true + # 连接超时 + connect-timeout: 10000 + # 连接超时 + socket-timeout: 10000 + # 查询超时 + query-timeout: 90000 + # 事务查询超时 + transaction-query-timeout: 90000 + # 解除注释后Druid连接池打印SQL语句 忽略日志等级配置 + # filters: slf4j + slf4j: + statementLogEnabled: true + resultSetLogEnabled: false + connectionLogEnabled: false + dataSourceLogEnabled: false + statementCreateAfterLogEnabled: false + statementCloseAfterLogEnabled: false + statementExecuteAfterLogEnabled: false + #打印SQL替换参数 + statementExecutableSqlLogEnable: true + statementPrepareAfterLogEnabled: false + statementPrepareCallAfterLogEnabled: false + statementParameterSetLogEnabled: false + # datasource: + # master: + # url: jdbc:mysql://${spring.datasource.host}:${spring.datasource.port}/${spring.datasource.dbname}?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowMultiQueries=true&serverTimezone=UTC + # username: ${spring.datasource.username} + # password: ${spring.datasource.password} + # driver-class-name: com.mysql.cj.jdbc.Driver + + # ===================== Redis配置 ===================== + # redis单机模式 + data: + redis: + database: 10 + host: 127.0.0.1 + port: 6379 + # password: redis_JtjYRD # 密码为空时,请将本行注释 + timeout: 3000 #超时时间(单位:秒) + lettuce: #Lettuce为Redis的Java驱动包 + pool: + max-active: 8 # 连接池最大连接数 + max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) + min-idle: 0 # 连接池中的最小空闲连接 + max-idle: 8 # 连接池中的最大空闲连接 + + # redis集群模式 + # redis: + # cluster: + # nodes: + # - 192.168.0.225:6380 + # - 192.168.0.225:6381 + # - 192.168.0.225:6382 + # - 192.168.0.225:6383 + # - 192.168.0.225:6384 + # - 192.168.0.225:6385 + # password: 123456 # 密码为空时,请将本行注释 + # timeout: 3000 # 超时时间(单位:秒) + # lettuce: #Lettuce为Redis的Java驱动包 + # pool: + # max-active: 8 # 连接池最大连接数 + # max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) + # min-idle: 0 # 连接池中的最小空闲连接 + # max-idle: 8 # 连接池中的最大空闲连接 + # ===================== Redis配置-End ===================== + # ===================== 单点登录(用户信息同步)配置-Start ===================== + cloud: + stream: + # 若使用RocketMQ-Start + rocketmq: + binder: + name-server: 192.168.10.6:30094 + group: maxkey_identity + # 若使用RocketMQ-End + # 若使用RabbitMQ-Start + # binders: + # defaultRabbit: # 表示定义的名称,用于binding整合 + # type: rabbit # 消息组件类型 + # environment: # 设置rabbitmq的相关环境配置 + # spring: + # rabbitmq: + # host: 192.168.10.6 + # port: 5672 + # username: rabbitmq + # password: rabbitmq + # 若使用RabbitMQ-End + # 若使用Kafka-Start + # kafka: + # # KafkaBinderConfigurationProperties + # binder: + # brokers: 192.168.10.6:9092 + # 若使用Kafka-End + bindings: + ssoEventReceiver-in-0: + content-type: text/json + destination: MXK_IDENTITY_MAIN_TOPIC + group: maxkey_identity + # ===================== 单点登录(用户信息同步)配置-End ===================== + # ===================== AI配置-Start ===================== + ai: + openai: + enabled: true + # 超时时间, 秒, 根据AI平台性能调整超时时间 + timeout: 300 + + # 阿里百联平台 + api-host: https://dashscope.aliyuncs.com/compatible-mode/ + api-key: sk-def0e6d9d0f8497cb5bcfff8c0c19935 + chat: + mode: qwen-max + + # GPT转发平台 + # api-host: https://api.chatanywhere.tech/ + # api-key: + # chat: + # mode: gpt-3.5-turbo + + # DeepSeek + # api-host: https://api.deepseek.com/v1/ + # api-key: + # chat: + # mode: deepseek-chat + + # ===================== AI配置-End ===================== +# SpringDoc接口文档 访问地址:http://127.0.0.1:30000/doc.html +springdoc: + default-flat-param-object: true + api-docs: + enabled: true +#SpringDoc增强 +#knife4j: +# enable: true +# basic: #接口文档访问鉴权 +# enable: true +# username: yunzhupaas +# password: 123456 + +lock4j: + aop: + # Lock4j注解是否启用 + enabled: false + +config: + # ===================== 是否开启测试环境 ===================== + TestVersion: false + # ===================== ApacheShardingSphere 配置开关 ===================== + sharding-sphere-enabled: false + # ===================== 文件存储配置-Start ===================== + file-storage: #文件存储配置,不使用的情况下可以不写 + default-platform: local-plus-1 #默认使用的存储平台 + thumbnail-suffix: ".thumb.jpg" #缩略图后缀,例如【.min.jpg】【.png】 + local-plus: # 本地存储升级版 + - platform: local-plus-1 # 存储平台标识 + enable-storage: true #启用存储 + enable-access: true #启用访问(线上请使用 Nginx 配置,效率更高) + domain: "" # 访问域名,例如:“http://127.0.0.1:8030/”,注意后面要和 path-patterns 保持一致,“/”结尾,本地存储建议使用相对路径,方便后期更换域名 + # base-path: /data/work-data/upload/jnpfsoft/yunzhupaas-resources/ # 基础路径 + base-path: E:/XiangMu/yunzhu/zero-resources/ # 基础路径 + path-patterns: /** # 访问路径 + storage-path: # 存储路径 + aliyun-oss: # 阿里云 OSS ,不使用的情况下可以不写 + - platform: aliyun-oss-1 # 存储平台标识 + enable-storage: false # 启用存储 + access-key: ?? + secret-key: ?? + end-point: ?? + bucket-name: ?? + domain: ?? # 访问域名,注意“/”结尾,例如:https://abc.oss-cn-shanghai.aliyuncs.com/ + base-path: hy/ # 基础路径 + qiniu-kodo: # 七牛云 kodo ,不使用的情况下可以不写 + - platform: qiniu-kodo-1 # 存储平台标识 + enable-storage: false # 启用存储 + access-key: ?? + secret-key: ?? + bucket-name: ?? + domain: ?? # 访问域名,注意“/”结尾,例如:http://abc.hn-bkt.clouddn.com/ + base-path: base/ # 基础路径 + tencent-cos: # 腾讯云 COS + - platform: tencent-cos-1 # 存储平台标识 + enable-storage: false # 启用存储 + secret-id: ?? + secret-key: ?? + region: ?? #存仓库所在地域 + bucket-name: ?? + domain: ?? # 访问域名,注意“/”结尾,例如:https://abc.cos.ap-nanjing.myqcloud.com/ + base-path: hy/ # 基础路径 + minio: # MinIO,由于 MinIO SDK 支持 AWS S3,其它兼容 AWS S3 协议的存储平台也都可配置在这里 + - platform: minio-1 # 存储平台标识 + enable-storage: true # 启用存储 + access-key: 9Y3sjaDWgbxKjXjm + secret-key: Bs2GyJwmOLpqNsQwbDjdinyUJQHtM0rc + end-point: http://192.168.0.207:9000/ + bucket-name: v350 + domain: ${config.file-storage.minio[0].end-point} # 访问域名,注意“/”结尾,例如:http://minio.abc.com/abc/ + base-path: # 基础路径 + # ===================== 文件存储配置-End ===================== +# ===================== 第三方登录配置-Start ===================== +socials: + # 第三方登录功能开关(false-关闭,true-开启) + socials-enabled: false + config: + - # 微信 + provider: wechat_open + client-id: your-client-id + client-secret: your-client-secret + - # qq + provider: qq + client-id: your-client-id + client-secret: your-client-secret + - # 企业微信 + provider: wechat_enterprise + client-id: your-client-id + client-secret: your-client-secret + agentId: your-agentId + - # 钉钉 + provider: dingtalk + client-id: your-client-id + client-secret: your-client-secret + agentId: your-agentId + - # 飞书 + provider: feishu + client-id: your-client-id + client-secret: your-client-secret + - # 小程序 + provider: wechat_applets + client-id: your-client-id + client-secret: your-client-secret +# ===================== 第三方登录配置-End ===================== +# ===================== 任务调度配置-Start ===================== +xxl: + job: + accessToken: '432e62f3b488bc861d91b0e274e850cc' + i18n: zh_CN + logretentiondays: 30 + triggerpool: + fast: + max: 200 + slow: + max: 100 + # xxl-job服务端地址 + admin: + addresses: http://127.0.0.1:30020/xxl-job-admin/ + executor: + address: '' + appname: xxl-job-executor-sample1 + ip: '' + logpath: /data/applogs/xxl-job/jobhandler + logretentiondays: 30 + port: 39999 + # rest调用xxl-job接口地址 + admin: + register: + handle-query-address: ${xxl.job.admin.addresses}api/handler/queryList + job-info-address: ${xxl.job.admin.addresses}api/jobinfo + log-query-address: ${xxl.job.admin.addresses}api/log + task-list-address: ${xxl.job.admin.addresses}api/ScheduleTask/List + task-info-address: ${xxl.job.admin.addresses}api/ScheduleTask/getInfo + task-save-address: ${xxl.job.admin.addresses}api/ScheduleTask + task-update-address: ${xxl.job.admin.addresses}api/ScheduleTask + task-remove-address: ${xxl.job.admin.addresses}api/ScheduleTask/remove + task-start-or-remove-address: ${xxl.job.admin.addresses}api/ScheduleTask/updateTask +# ===================== 任务调度配置-End ===================== +# ===================== 单点登录(SSO)配置-Start ===================== +yunzhupaas: + sso: + # ===================== 单点登录(用户信息拉取)配置-Start ===================== + connector: + # 是否开启用户信息拉取 + enabled: false + # ===================== 单点登录(用户信息拉取)配置-End ===================== + # ===================== 单点登录(用户信息推送)配置-Start ===================== + pull: + # 是否开启用户信息推送 + enabled: false + create-rest-address: http://localhost:9526/sso-mgt-api/api/idm/Account + replace-rest-address: http://localhost:9526/sso-mgt-api/api/idm/Account + change-password-rest-address: http://localhost:9526/sso-mgt-api/api/idm/Account/changePassword + delete-rest-address: http://localhost:9526/sso-mgt-api/api/idm/Account + credential-type: Basic + user-name: 747887288041603072 + password: MYgMMjIwNzIwMjIxNTU4MTAxNzQlKQ + # ===================== 单点登录(用户信息推送)配置-End ===================== +oauth: + #启用单点登录, 普通登录不可用 + ssoEnabled: false + #轮询票据有效期 + ticketTimeout: 120 + #默认单点登录协议 + defaultSSO: cas + #后端登录接口地址 + loginPath: http://127.0.0.1:30000/api/oauth/Login + #login: + #JWT生成秘钥 不填写为默认值 + #jwtSecretKey: WviMjFNC72VKwGqm5LPoheQo5XN9iN4d + sso: + #单点登录系统地址 + baseUrl: http://127.0.0.1:8527 + #登录成功后跳转到前端的页面 + sucessFrontUrl: http://127.0.0.1:3100/sso + #错误信息是否输出到页面 + ticketOutMessage: false + #logoutFrontUrl: http://sso.maxkey.top:8527/maxkey + #单点注销后端接口地址, 配置启用后YUNZHUPAAS退出会请求单点系统退出, 触发单点注销退出全部应用 + #ssoLogoutApiUrl: ${oauth.sso.baseUrl}/sign/logout + auth2: + enabled: true + clientId: 747887288041603072 + clientSecret: MYgMMjIwNzIwMjIxNTU4MTAxNzQlKQ + baseUrl: ${oauth.sso.baseUrl} + authorizeUrl: ${oauth.sso.auth2.baseUrl}/sign/authz/oauth/v20/authorize + accessTokenUrl: ${oauth.sso.auth2.baseUrl}/sign/authz/oauth/v20/token + userInfoUrl: ${oauth.sso.auth2.baseUrl}/sign/api/oauth/v20/me + cas: + enabled: true + baseUrl: ${oauth.sso.baseUrl} + serverLoginUrl: ${oauth.sso.cas.baseUrl}/sign/authz/cas/login + serverValidateUrl: ${oauth.sso.cas.baseUrl}/sign/authz/cas +# ===================== 单点登录(SSO)配置-End ===================== +userUrl: http://192.168.3.31:8000/api-web/sys/user/save \ No newline at end of file diff --git a/yunzhupaas-admin/src/main/resources/application-preview.yml b/yunzhupaas-admin/src/main/resources/application-preview.yml new file mode 100644 index 0000000..67c211f --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/application-preview.yml @@ -0,0 +1,336 @@ +# 应用服务器 +server: + tomcat: + uri-encoding: UTF-8 #tomcat编码 + port: 30000 #tomcat端口 + +spring: + messages: + basename: i18n/message + # 一天刷新一次 + cache-duration: 24H + devtools: #spring开发者工具模块 + restart: + enabled: true #热部署开关 + freemarker: + cache: false #spring内置freemarker缓存 + thymeleaf: + cache: false #spring内置thymeleaf缓存 + + # ===================== 数据源配置 ===================== + exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure #排除自动配置,手动配置druid + datasource: + db-type: MySQL #数据库类型(可选值 MySQL、SQLServer、Oracle、DM、KingbaseES、PostgreSQL,请严格按可选值填写) + host: 127.0.0.1 + port: 3306 + username: root + password: 123456 + db-name: yunzhupaas_init + db-schema: #金仓达梦选填 + prepare-url: #自定义url + + # ===================== 动态多数据源 ===================== + dynamic: + primary: master #设置默认的数据源或者数据源组,默认值即为master + strict: true #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源 + druid: + # 空闲时执行连接测试 + test-while-idle: true + # 连接测试最小间隔 + time-between-eviction-runs-millis: 60000 + # 获取连接等待3秒 根据网络情况设定 + max-wait: 3000 + # 初始化4个连接 + initial-size: 4 + # 最大20个连接 + max-active: 20 + # 最少保持4个空闲连接 + min-idle: 4 + # 空闲连接保活, 超过配置的空闲时间会进行连接检查完成保活操作(数据库自身会断开达到空闲时间的连接, 程序使用断开的连接会报错) + keep-alive: true + # 连接超时 + connect-timeout: 10000 + # 连接超时 + socket-timeout: 10000 + # 查询超时 + query-timeout: 90000 + # 事务查询超时 + transaction-query-timeout: 90000 + # 解除注释后Druid连接池打印SQL语句 忽略日志等级配置 + # filters: slf4j + slf4j: + statementLogEnabled: true + resultSetLogEnabled: false + connectionLogEnabled: false + dataSourceLogEnabled: false + statementCreateAfterLogEnabled: false + statementCloseAfterLogEnabled: false + statementExecuteAfterLogEnabled: false + #打印SQL替换参数 + statementExecutableSqlLogEnable: true + statementPrepareAfterLogEnabled: false + statementPrepareCallAfterLogEnabled: false + statementParameterSetLogEnabled: false + # datasource: + # master: + # url: jdbc:mysql://${spring.datasource.host}:${spring.datasource.port}/${spring.datasource.dbname}?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowMultiQueries=true&serverTimezone=UTC + # username: ${spring.datasource.username} + # password: ${spring.datasource.password} + # driver-class-name: com.mysql.cj.jdbc.Driver + + # ===================== Redis配置-Start ===================== + # redis单机模式 + redis: + database: 1 #缓存库编号 + host: 127.0.0.1 + port: 6379 + password: 123456 # 密码为空时,请将本行注释 + timeout: 3000 #超时时间(单位:秒) + lettuce: #Lettuce为Redis的Java驱动包 + pool: + max-active: 8 # 连接池最大连接数 + max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) + min-idle: 0 # 连接池中的最小空闲连接 + max-idle: 8 # 连接池中的最大空闲连接 + + # redis集群模式 + # redis: + # cluster: + # nodes: + # - 192.168.0.225:6380 + # - 192.168.0.225:6381 + # - 192.168.0.225:6382 + # - 192.168.0.225:6383 + # - 192.168.0.225:6384 + # - 192.168.0.225:6385 + # password: 123456 # 密码为空时,请将本行注释 + # timeout: 3000 # 超时时间(单位:秒) + # lettuce: #Lettuce为Redis的Java驱动包 + # pool: + # max-active: 8 # 连接池最大连接数 + # max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) + # min-idle: 0 # 连接池中的最小空闲连接 + # max-idle: 8 # 连接池中的最大空闲连接 + # ===================== Redis配置-End ===================== + # ===================== 单点登录(用户信息同步)配置-Start ===================== + cloud: + stream: + # 若使用RocketMQ-Start + rocketmq: + binder: + name-server: 192.168.10.6:30094 + group: maxkey_identity + # 若使用RocketMQ-End + # 若使用RabbitMQ-Start + # binders: + # defaultRabbit: # 表示定义的名称,用于binding整合 + # type: rabbit # 消息组件类型 + # environment: # 设置rabbitmq的相关环境配置 + # spring: + # rabbitmq: + # host: 192.168.10.6 + # port: 5672 + # username: rabbitmq + # password: rabbitmq + # 若使用RabbitMQ-End + # 若使用Kafka-Start + # kafka: + # # KafkaBinderConfigurationProperties + # binder: + # brokers: 192.168.10.6:9092 + # 若使用Kafka-End + bindings: + ssoEventReceiver-in-0: + content-type: text/json + destination: MXK_IDENTITY_MAIN_TOPIC + group: maxkey_identity + # ===================== 单点登录(用户信息同步)配置-End ===================== +# SpringDoc接口文档 访问地址:http://127.0.0.1:30000/doc.html +springdoc: + default-flat-param-object: true + api-docs: + enabled: true +#SpringDoc增强 +#knife4j: +# enable: true +# basic: #接口文档访问鉴权 +# enable: true +# username: yunzhupaas +# password: 123456 + +lock4j: + aop: + # Lock4j注解是否启用 + enabled: false + +config: + # ===================== 是否开启测试环境 ===================== + TestVersion: false + # ===================== ApacheShardingSphere 配置开关 ===================== + sharding-sphere-enabled: false + # ===================== 文件存储配置-Start ===================== + file-storage: #文件存储配置,不使用的情况下可以不写 + default-platform: local-plus-1 #默认使用的存储平台 + thumbnail-suffix: ".thumb.jpg" #缩略图后缀,例如【.min.jpg】【.png】 + local-plus: # 本地存储升级版 + - platform: local-plus-1 # 存储平台标识 + enable-storage: true #启用存储 + enable-access: true #启用访问(线上请使用 Nginx 配置,效率更高) + domain: "" # 访问域名,例如:“http://127.0.0.1:8030/”,注意后面要和 path-patterns 保持一致,“/”结尾,本地存储建议使用相对路径,方便后期更换域名 + base-path: D:/project/yunzhupaas-resources/ # 基础路径 + path-patterns: /** # 访问路径 + storage-path: # 存储路径 + aliyun-oss: # 阿里云 OSS ,不使用的情况下可以不写 + - platform: aliyun-oss-1 # 存储平台标识 + enable-storage: false # 启用存储 + access-key: ?? + secret-key: ?? + end-point: ?? + bucket-name: ?? + domain: ?? # 访问域名,注意“/”结尾,例如:https://abc.oss-cn-shanghai.aliyuncs.com/ + base-path: hy/ # 基础路径 + qiniu-kodo: # 七牛云 kodo ,不使用的情况下可以不写 + - platform: qiniu-kodo-1 # 存储平台标识 + enable-storage: false # 启用存储 + access-key: ?? + secret-key: ?? + bucket-name: ?? + domain: ?? # 访问域名,注意“/”结尾,例如:http://abc.hn-bkt.clouddn.com/ + base-path: base/ # 基础路径 + tencent-cos: # 腾讯云 COS + - platform: tencent-cos-1 # 存储平台标识 + enable-storage: false # 启用存储 + secret-id: ?? + secret-key: ?? + region: ?? #存仓库所在地域 + bucket-name: ?? + domain: ?? # 访问域名,注意“/”结尾,例如:https://abc.cos.ap-nanjing.myqcloud.com/ + base-path: hy/ # 基础路径 + minio: # MinIO,由于 MinIO SDK 支持 AWS S3,其它兼容 AWS S3 协议的存储平台也都可配置在这里 + - platform: minio-1 # 存储平台标识 + enable-storage: true # 启用存储 + access-key: 9Y3sjaDWgbxKjXjm + secret-key: Bs2GyJwmOLpqNsQwbDjdinyUJQHtM0rc + end-point: http://192.168.0.207:9000/ + bucket-name: v350 + domain: ${config.file-storage.minio[0].end-point} # 访问域名,注意“/”结尾,例如:http://minio.abc.com/abc/ + base-path: # 基础路径 + # ===================== 文件存储配置-End ===================== +# ===================== 第三方登录配置-Start ===================== +socials: + # 第三方登录功能开关(false-关闭,true-开启) + socials-enabled: false + config: + - # 微信 + provider: wechat_open + client-id: your-client-id + client-secret: your-client-secret + - # qq + provider: qq + client-id: your-client-id + client-secret: your-client-secret + - # 企业微信 + provider: wechat_enterprise + client-id: your-client-id + client-secret: your-client-secret + agentId: your-agentId + - # 钉钉 + provider: dingtalk + client-id: your-client-id + client-secret: your-client-secret + agentId: your-agentId + - # 飞书 + provider: feishu + client-id: your-client-id + client-secret: your-client-secret + - # 小程序 + provider: wechat_applets + client-id: your-client-id + client-secret: your-client-secret +# ===================== 第三方登录配置-End ===================== +# ===================== 任务调度配置-Start ===================== +xxl: + job: + accessToken: '432e62f3b488bc861d91b0e274e850cc' + i18n: zh_CN + logretentiondays: 30 + triggerpool: + fast: + max: 200 + slow: + max: 100 + # xxl-job服务端地址 + admin: + addresses: http://127.0.0.1:30020/xxl-job-admin/ + executor: + address: '' + appname: xxl-job-executor-sample1 + ip: '' + logpath: /data/applogs/xxl-job/jobhandler + logretentiondays: 30 + port: 39999 + # rest调用xxl-job接口地址 + admin: + register: + handle-query-address: ${xxl.job.admin.addresses}api/handler/queryList + job-info-address: ${xxl.job.admin.addresses}api/jobinfo + log-query-address: ${xxl.job.admin.addresses}api/log + task-list-address: ${xxl.job.admin.addresses}api/ScheduleTask/List + task-info-address: ${xxl.job.admin.addresses}api/ScheduleTask/getInfo + task-save-address: ${xxl.job.admin.addresses}api/ScheduleTask + task-update-address: ${xxl.job.admin.addresses}api/ScheduleTask + task-remove-address: ${xxl.job.admin.addresses}api/ScheduleTask/remove + task-start-or-remove-address: ${xxl.job.admin.addresses}api/ScheduleTask/updateTask +# ===================== 任务调度配置-End ===================== +# ===================== 单点登录(SSO)配置-Start ===================== +yunzhupaas: + sso: + # ===================== 单点登录(用户信息拉取)配置-Start ===================== + connector: + # 是否开启用户信息拉取 + enabled: false + # ===================== 单点登录(用户信息拉取)配置-End ===================== + # ===================== 单点登录(用户信息推送)配置-Start ===================== + pull: + # 是否开启用户信息推送 + enabled: false + create-rest-address: http://localhost:9526/sso-mgt-api/api/idm/Account + replace-rest-address: http://localhost:9526/sso-mgt-api/api/idm/Account + change-password-rest-address: http://localhost:9526/sso-mgt-api/api/idm/Account/changePassword + delete-rest-address: http://localhost:9526/sso-mgt-api/api/idm/Account + credential-type: Basic + user-name: 747887288041603072 + password: MYgMMjIwNzIwMjIxNTU4MTAxNzQlKQ + # ===================== 单点登录(用户信息推送)配置-End ===================== +oauth: + #启用单点登录, 普通登录不可用 + ssoEnabled: false + #轮询票据有效期 + ticketTimeout: 120 + #默认单点登录协议 + defaultSSO: cas + #后端登录接口地址 + loginPath: http://127.0.0.1:30000/api/oauth/Login + #轮询登录模式是否输出结果 + ticketOutMessage: false + login: + #JWT生成秘钥 不填写为默认值 + #jwtSecretKey: WviMjFNC72VKwGqm5LPoheQo5XN9iN4d + sso: + #登录成功后跳转到前端的页面 + sucessFrontUrl: http://127.0.0.1:3000/sso + #logoutFrontUrl: http://sso.maxkey.top:8527/maxkey + auth2: + enabled: true + clientId: 747887288041603072 + clientSecret: MYgMMjIwNzIwMjIxNTU4MTAxNzQlKQ + baseUrl: http://127.0.0.1:8527 + authorizeUrl: ${oauth.sso.auth2.baseUrl}/sign/authz/oauth/v20/authorize + accessTokenUrl: ${oauth.sso.auth2.baseUrl}/sign/authz/oauth/v20/token + userInfoUrl: ${oauth.sso.auth2.baseUrl}/sign/api/oauth/v20/me + cas: + enabled: true + baseUrl: ${oauth.sso.auth2.baseUrl} + serverLoginUrl: ${oauth.sso.cas.baseUrl}/sign/authz/cas/login + serverValidateUrl: ${oauth.sso.cas.baseUrl}/sign/authz/cas +# ===================== 单点登录(SSO)配置-End ===================== diff --git a/yunzhupaas-admin/src/main/resources/application-prod.yml b/yunzhupaas-admin/src/main/resources/application-prod.yml new file mode 100644 index 0000000..8bc68ed --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/application-prod.yml @@ -0,0 +1,370 @@ +# 应用服务器 +server: + tomcat: + uri-encoding: UTF-8 #tomcat编码 + port: 40001 #tomcat端口 + +spring: + messages: + basename: i18n/message + # 一天刷新一次 + cache-duration: 24H + devtools: #spring开发者工具模块 + restart: + enabled: true #热部署开关 + freemarker: + cache: false #spring内置freemarker缓存 + thymeleaf: + cache: false #spring内置thymeleaf缓存 + + # ===================== 数据源配置 ===================== + exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure #排除自动配置,手动配置druid + datasource: + db-type: MySQL #数据库类型(可选值 MySQL、SQLServer、Oracle、DM8、KingbaseES、PostgreSQL,请严格按可选值填写) + # host: aliyun.szlecheng.cn + host: mysql.szlecheng.cn + port: 13306 + username: yunzhupass + password: '@yunzhupass' + db-name: pord_yunzhupass + db-schema: #金仓达梦选填 + prepare-url: #自定义url + + # ===================== 动态多数据源 ===================== + dynamic: + primary: master #设置默认的数据源或者数据源组,默认值即为master + strict: true #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源 + druid: + # 空闲时执行连接测试 + test-while-idle: true + # 连接测试最小间隔 + time-between-eviction-runs-millis: 60000 + # 获取连接等待3秒 根据网络情况设定 + max-wait: 3000 + # 初始化4个连接 + initial-size: 4 + # 最大20个连接 + max-active: 20 + # 最少保持4个空闲连接 + min-idle: 4 + # 空闲连接保活, 超过配置的空闲时间会进行连接检查完成保活操作(数据库自身会断开达到空闲时间的连接, 程序使用断开的连接会报错) + keep-alive: true + # 连接超时 + connect-timeout: 10000 + # 连接超时 + socket-timeout: 10000 + # 查询超时 + query-timeout: 90000 + # 事务查询超时 + transaction-query-timeout: 90000 + # 解除注释后Druid连接池打印SQL语句 忽略日志等级配置 + # filters: slf4j + slf4j: + statementLogEnabled: true + resultSetLogEnabled: false + connectionLogEnabled: false + dataSourceLogEnabled: false + statementCreateAfterLogEnabled: false + statementCloseAfterLogEnabled: false + statementExecuteAfterLogEnabled: false + #打印SQL替换参数 + statementExecutableSqlLogEnable: true + statementPrepareAfterLogEnabled: false + statementPrepareCallAfterLogEnabled: false + statementParameterSetLogEnabled: false + # datasource: + # master: + # url: jdbc:mysql://${spring.datasource.host}:${spring.datasource.port}/${spring.datasource.dbname}?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowMultiQueries=true&serverTimezone=UTC + # username: ${spring.datasource.username} + # password: ${spring.datasource.password} + # driver-class-name: com.mysql.cj.jdbc.Driver + + # ===================== Redis配置 ===================== + # redis单机模式 + data: + redis: + database: 10 + host: 127.0.0.1 + port: 6379 + # password: redis_JtjYRD # 密码为空时,请将本行注释 + timeout: 3000 #超时时间(单位:秒) + lettuce: #Lettuce为Redis的Java驱动包 + pool: + max-active: 8 # 连接池最大连接数 + max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) + min-idle: 0 # 连接池中的最小空闲连接 + max-idle: 8 # 连接池中的最大空闲连接 + + # redis集群模式 + # redis: + # cluster: + # nodes: + # - 192.168.0.225:6380 + # - 192.168.0.225:6381 + # - 192.168.0.225:6382 + # - 192.168.0.225:6383 + # - 192.168.0.225:6384 + # - 192.168.0.225:6385 + # password: 123456 # 密码为空时,请将本行注释 + # timeout: 3000 # 超时时间(单位:秒) + # lettuce: #Lettuce为Redis的Java驱动包 + # pool: + # max-active: 8 # 连接池最大连接数 + # max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) + # min-idle: 0 # 连接池中的最小空闲连接 + # max-idle: 8 # 连接池中的最大空闲连接 + # ===================== Redis配置-End ===================== + # ===================== 单点登录(用户信息同步)配置-Start ===================== + cloud: + stream: + # 若使用RocketMQ-Start + rocketmq: + binder: + name-server: 192.168.10.6:30094 + group: maxkey_identity + # 若使用RocketMQ-End + # 若使用RabbitMQ-Start + # binders: + # defaultRabbit: # 表示定义的名称,用于binding整合 + # type: rabbit # 消息组件类型 + # environment: # 设置rabbitmq的相关环境配置 + # spring: + # rabbitmq: + # host: 192.168.10.6 + # port: 5672 + # username: rabbitmq + # password: rabbitmq + # 若使用RabbitMQ-End + # 若使用Kafka-Start + # kafka: + # # KafkaBinderConfigurationProperties + # binder: + # brokers: 192.168.10.6:9092 + # 若使用Kafka-End + bindings: + ssoEventReceiver-in-0: + content-type: text/json + destination: MXK_IDENTITY_MAIN_TOPIC + group: maxkey_identity + # ===================== 单点登录(用户信息同步)配置-End ===================== + # ===================== AI配置-Start ===================== + ai: + openai: + enabled: true + # 超时时间, 秒, 根据AI平台性能调整超时时间 + timeout: 300 + + # 阿里百联平台 + api-host: https://dashscope.aliyuncs.com/compatible-mode/ + api-key: sk-def0e6d9d0f8497cb5bcfff8c0c19935 + chat: + mode: qwen-max + + # GPT转发平台 + # api-host: https://api.chatanywhere.tech/ + # api-key: + # chat: + # mode: gpt-3.5-turbo + + # DeepSeek + # api-host: https://api.deepseek.com/v1/ + # api-key: + # chat: + # mode: deepseek-chat + + # ===================== AI配置-End ===================== +# SpringDoc接口文档 访问地址:http://127.0.0.1:30000/doc.html +springdoc: + default-flat-param-object: true + api-docs: + enabled: true +#SpringDoc增强 +#knife4j: +# enable: true +# basic: #接口文档访问鉴权 +# enable: true +# username: yunzhupaas +# password: 123456 + +lock4j: + aop: + # Lock4j注解是否启用 + enabled: false + +config: + # ===================== 是否开启测试环境 ===================== + TestVersion: false + # ===================== ApacheShardingSphere 配置开关 ===================== + sharding-sphere-enabled: false + # ===================== 文件存储配置-Start ===================== + file-storage: #文件存储配置,不使用的情况下可以不写 + default-platform: local-plus-1 #默认使用的存储平台 + thumbnail-suffix: ".thumb.jpg" #缩略图后缀,例如【.min.jpg】【.png】 + local-plus: # 本地存储升级版 + - platform: local-plus-1 # 存储平台标识 + enable-storage: true #启用存储 + enable-access: true #启用访问(线上请使用 Nginx 配置,效率更高) + domain: "" # 访问域名,例如:“http://127.0.0.1:8030/”,注意后面要和 path-patterns 保持一致,“/”结尾,本地存储建议使用相对路径,方便后期更换域名 + # base-path: /data/work-data/upload/jnpfsoft/yunzhupaas-resources/ # 基础路径 + base-path: E:/XiangMu/yunzhu/zero-resources/ # 基础路径 + path-patterns: /** # 访问路径 + storage-path: # 存储路径 + aliyun-oss: # 阿里云 OSS ,不使用的情况下可以不写 + - platform: aliyun-oss-1 # 存储平台标识 + enable-storage: false # 启用存储 + access-key: ?? + secret-key: ?? + end-point: ?? + bucket-name: ?? + domain: ?? # 访问域名,注意“/”结尾,例如:https://abc.oss-cn-shanghai.aliyuncs.com/ + base-path: hy/ # 基础路径 + qiniu-kodo: # 七牛云 kodo ,不使用的情况下可以不写 + - platform: qiniu-kodo-1 # 存储平台标识 + enable-storage: false # 启用存储 + access-key: ?? + secret-key: ?? + bucket-name: ?? + domain: ?? # 访问域名,注意“/”结尾,例如:http://abc.hn-bkt.clouddn.com/ + base-path: base/ # 基础路径 + tencent-cos: # 腾讯云 COS + - platform: tencent-cos-1 # 存储平台标识 + enable-storage: false # 启用存储 + secret-id: ?? + secret-key: ?? + region: ?? #存仓库所在地域 + bucket-name: ?? + domain: ?? # 访问域名,注意“/”结尾,例如:https://abc.cos.ap-nanjing.myqcloud.com/ + base-path: hy/ # 基础路径 + minio: # MinIO,由于 MinIO SDK 支持 AWS S3,其它兼容 AWS S3 协议的存储平台也都可配置在这里 + - platform: minio-1 # 存储平台标识 + enable-storage: true # 启用存储 + access-key: 9Y3sjaDWgbxKjXjm + secret-key: Bs2GyJwmOLpqNsQwbDjdinyUJQHtM0rc + end-point: http://192.168.0.207:9000/ + bucket-name: v350 + domain: ${config.file-storage.minio[0].end-point} # 访问域名,注意“/”结尾,例如:http://minio.abc.com/abc/ + base-path: # 基础路径 + # ===================== 文件存储配置-End ===================== +# ===================== 第三方登录配置-Start ===================== +socials: + # 第三方登录功能开关(false-关闭,true-开启) + socials-enabled: false + config: + - # 微信 + provider: wechat_open + client-id: your-client-id + client-secret: your-client-secret + - # qq + provider: qq + client-id: your-client-id + client-secret: your-client-secret + - # 企业微信 + provider: wechat_enterprise + client-id: your-client-id + client-secret: your-client-secret + agentId: your-agentId + - # 钉钉 + provider: dingtalk + client-id: your-client-id + client-secret: your-client-secret + agentId: your-agentId + - # 飞书 + provider: feishu + client-id: your-client-id + client-secret: your-client-secret + - # 小程序 + provider: wechat_applets + client-id: your-client-id + client-secret: your-client-secret +# ===================== 第三方登录配置-End ===================== +# ===================== 任务调度配置-Start ===================== +xxl: + job: + accessToken: '432e62f3b488bc861d91b0e274e850cc' + i18n: zh_CN + logretentiondays: 30 + triggerpool: + fast: + max: 200 + slow: + max: 100 + # xxl-job服务端地址 + admin: + addresses: http://127.0.0.1:30020/xxl-job-admin/ + executor: + address: '' + appname: xxl-job-executor-sample1 + ip: '' + logpath: /data/applogs/xxl-job/jobhandler + logretentiondays: 30 + port: 39999 + # rest调用xxl-job接口地址 + admin: + register: + handle-query-address: ${xxl.job.admin.addresses}api/handler/queryList + job-info-address: ${xxl.job.admin.addresses}api/jobinfo + log-query-address: ${xxl.job.admin.addresses}api/log + task-list-address: ${xxl.job.admin.addresses}api/ScheduleTask/List + task-info-address: ${xxl.job.admin.addresses}api/ScheduleTask/getInfo + task-save-address: ${xxl.job.admin.addresses}api/ScheduleTask + task-update-address: ${xxl.job.admin.addresses}api/ScheduleTask + task-remove-address: ${xxl.job.admin.addresses}api/ScheduleTask/remove + task-start-or-remove-address: ${xxl.job.admin.addresses}api/ScheduleTask/updateTask +# ===================== 任务调度配置-End ===================== +# ===================== 单点登录(SSO)配置-Start ===================== +yunzhupaas: + sso: + # ===================== 单点登录(用户信息拉取)配置-Start ===================== + connector: + # 是否开启用户信息拉取 + enabled: false + # ===================== 单点登录(用户信息拉取)配置-End ===================== + # ===================== 单点登录(用户信息推送)配置-Start ===================== + pull: + # 是否开启用户信息推送 + enabled: false + create-rest-address: http://localhost:9526/sso-mgt-api/api/idm/Account + replace-rest-address: http://localhost:9526/sso-mgt-api/api/idm/Account + change-password-rest-address: http://localhost:9526/sso-mgt-api/api/idm/Account/changePassword + delete-rest-address: http://localhost:9526/sso-mgt-api/api/idm/Account + credential-type: Basic + user-name: 747887288041603072 + password: MYgMMjIwNzIwMjIxNTU4MTAxNzQlKQ + # ===================== 单点登录(用户信息推送)配置-End ===================== +oauth: + #启用单点登录, 普通登录不可用 + ssoEnabled: false + #轮询票据有效期 + ticketTimeout: 120 + #默认单点登录协议 + defaultSSO: cas + #后端登录接口地址 + loginPath: http://127.0.0.1:30000/api/oauth/Login + #login: + #JWT生成秘钥 不填写为默认值 + #jwtSecretKey: WviMjFNC72VKwGqm5LPoheQo5XN9iN4d + sso: + #单点登录系统地址 + baseUrl: http://127.0.0.1:8527 + #登录成功后跳转到前端的页面 + sucessFrontUrl: http://127.0.0.1:3100/sso + #错误信息是否输出到页面 + ticketOutMessage: false + #logoutFrontUrl: http://sso.maxkey.top:8527/maxkey + #单点注销后端接口地址, 配置启用后YUNZHUPAAS退出会请求单点系统退出, 触发单点注销退出全部应用 + #ssoLogoutApiUrl: ${oauth.sso.baseUrl}/sign/logout + auth2: + enabled: true + clientId: 747887288041603072 + clientSecret: MYgMMjIwNzIwMjIxNTU4MTAxNzQlKQ + baseUrl: ${oauth.sso.baseUrl} + authorizeUrl: ${oauth.sso.auth2.baseUrl}/sign/authz/oauth/v20/authorize + accessTokenUrl: ${oauth.sso.auth2.baseUrl}/sign/authz/oauth/v20/token + userInfoUrl: ${oauth.sso.auth2.baseUrl}/sign/api/oauth/v20/me + cas: + enabled: true + baseUrl: ${oauth.sso.baseUrl} + serverLoginUrl: ${oauth.sso.cas.baseUrl}/sign/authz/cas/login + serverValidateUrl: ${oauth.sso.cas.baseUrl}/sign/authz/cas +# ===================== 单点登录(SSO)配置-End ===================== +userUrl: http://192.168.3.31:8000/api-web/sys/user/save \ No newline at end of file diff --git a/yunzhupaas-admin/src/main/resources/application-test.yml b/yunzhupaas-admin/src/main/resources/application-test.yml new file mode 100644 index 0000000..c068f11 --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/application-test.yml @@ -0,0 +1,370 @@ +# 应用服务器 +server: + tomcat: + uri-encoding: UTF-8 #tomcat编码 + port: 40001 #tomcat端口 + +spring: + messages: + basename: i18n/message + # 一天刷新一次 + cache-duration: 24H + devtools: #spring开发者工具模块 + restart: + enabled: true #热部署开关 + freemarker: + cache: false #spring内置freemarker缓存 + thymeleaf: + cache: false #spring内置thymeleaf缓存 + + # ===================== 数据源配置 ===================== + exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure #排除自动配置,手动配置druid + datasource: + db-type: MySQL #数据库类型(可选值 MySQL、SQLServer、Oracle、DM8、KingbaseES、PostgreSQL,请严格按可选值填写) + # host: aliyun.szlecheng.cn + host: mysql.szlecheng.cn + port: 13306 + username: oa_yunzhupaas + password: OAYUNZHUPAAS + db-name: oa_yunzhupass + db-schema: #金仓达梦选填 + prepare-url: #自定义url + + # ===================== 动态多数据源 ===================== + dynamic: + primary: master #设置默认的数据源或者数据源组,默认值即为master + strict: true #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源 + druid: + # 空闲时执行连接测试 + test-while-idle: true + # 连接测试最小间隔 + time-between-eviction-runs-millis: 60000 + # 获取连接等待3秒 根据网络情况设定 + max-wait: 3000 + # 初始化4个连接 + initial-size: 4 + # 最大20个连接 + max-active: 20 + # 最少保持4个空闲连接 + min-idle: 4 + # 空闲连接保活, 超过配置的空闲时间会进行连接检查完成保活操作(数据库自身会断开达到空闲时间的连接, 程序使用断开的连接会报错) + keep-alive: true + # 连接超时 + connect-timeout: 10000 + # 连接超时 + socket-timeout: 10000 + # 查询超时 + query-timeout: 90000 + # 事务查询超时 + transaction-query-timeout: 90000 + # 解除注释后Druid连接池打印SQL语句 忽略日志等级配置 + # filters: slf4j + slf4j: + statementLogEnabled: true + resultSetLogEnabled: false + connectionLogEnabled: false + dataSourceLogEnabled: false + statementCreateAfterLogEnabled: false + statementCloseAfterLogEnabled: false + statementExecuteAfterLogEnabled: false + #打印SQL替换参数 + statementExecutableSqlLogEnable: true + statementPrepareAfterLogEnabled: false + statementPrepareCallAfterLogEnabled: false + statementParameterSetLogEnabled: false + # datasource: + # master: + # url: jdbc:mysql://${spring.datasource.host}:${spring.datasource.port}/${spring.datasource.dbname}?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowMultiQueries=true&serverTimezone=UTC + # username: ${spring.datasource.username} + # password: ${spring.datasource.password} + # driver-class-name: com.mysql.cj.jdbc.Driver + + # ===================== Redis配置 ===================== + # redis单机模式 + data: + redis: + database: 10 + host: 127.0.0.1 + port: 6379 + # password: redis_JtjYRD # 密码为空时,请将本行注释 + timeout: 3000 #超时时间(单位:秒) + lettuce: #Lettuce为Redis的Java驱动包 + pool: + max-active: 8 # 连接池最大连接数 + max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) + min-idle: 0 # 连接池中的最小空闲连接 + max-idle: 8 # 连接池中的最大空闲连接 + + # redis集群模式 + # redis: + # cluster: + # nodes: + # - 192.168.0.225:6380 + # - 192.168.0.225:6381 + # - 192.168.0.225:6382 + # - 192.168.0.225:6383 + # - 192.168.0.225:6384 + # - 192.168.0.225:6385 + # password: 123456 # 密码为空时,请将本行注释 + # timeout: 3000 # 超时时间(单位:秒) + # lettuce: #Lettuce为Redis的Java驱动包 + # pool: + # max-active: 8 # 连接池最大连接数 + # max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) + # min-idle: 0 # 连接池中的最小空闲连接 + # max-idle: 8 # 连接池中的最大空闲连接 + # ===================== Redis配置-End ===================== + # ===================== 单点登录(用户信息同步)配置-Start ===================== + cloud: + stream: + # 若使用RocketMQ-Start + rocketmq: + binder: + name-server: 192.168.10.6:30094 + group: maxkey_identity + # 若使用RocketMQ-End + # 若使用RabbitMQ-Start + # binders: + # defaultRabbit: # 表示定义的名称,用于binding整合 + # type: rabbit # 消息组件类型 + # environment: # 设置rabbitmq的相关环境配置 + # spring: + # rabbitmq: + # host: 192.168.10.6 + # port: 5672 + # username: rabbitmq + # password: rabbitmq + # 若使用RabbitMQ-End + # 若使用Kafka-Start + # kafka: + # # KafkaBinderConfigurationProperties + # binder: + # brokers: 192.168.10.6:9092 + # 若使用Kafka-End + bindings: + ssoEventReceiver-in-0: + content-type: text/json + destination: MXK_IDENTITY_MAIN_TOPIC + group: maxkey_identity + # ===================== 单点登录(用户信息同步)配置-End ===================== + # ===================== AI配置-Start ===================== + ai: + openai: + enabled: true + # 超时时间, 秒, 根据AI平台性能调整超时时间 + timeout: 300 + + # 阿里百联平台 + api-host: https://dashscope.aliyuncs.com/compatible-mode/ + api-key: sk-def0e6d9d0f8497cb5bcfff8c0c19935 + chat: + mode: qwen-max + + # GPT转发平台 + # api-host: https://api.chatanywhere.tech/ + # api-key: + # chat: + # mode: gpt-3.5-turbo + + # DeepSeek + # api-host: https://api.deepseek.com/v1/ + # api-key: + # chat: + # mode: deepseek-chat + + # ===================== AI配置-End ===================== +# SpringDoc接口文档 访问地址:http://127.0.0.1:30000/doc.html +springdoc: + default-flat-param-object: true + api-docs: + enabled: true +#SpringDoc增强 +#knife4j: +# enable: true +# basic: #接口文档访问鉴权 +# enable: true +# username: yunzhupaas +# password: 123456 + +lock4j: + aop: + # Lock4j注解是否启用 + enabled: false + +config: + # ===================== 是否开启测试环境 ===================== + TestVersion: false + # ===================== ApacheShardingSphere 配置开关 ===================== + sharding-sphere-enabled: false + # ===================== 文件存储配置-Start ===================== + file-storage: #文件存储配置,不使用的情况下可以不写 + default-platform: local-plus-1 #默认使用的存储平台 + thumbnail-suffix: ".thumb.jpg" #缩略图后缀,例如【.min.jpg】【.png】 + local-plus: # 本地存储升级版 + - platform: local-plus-1 # 存储平台标识 + enable-storage: true #启用存储 + enable-access: true #启用访问(线上请使用 Nginx 配置,效率更高) + domain: "" # 访问域名,例如:“http://127.0.0.1:8030/”,注意后面要和 path-patterns 保持一致,“/”结尾,本地存储建议使用相对路径,方便后期更换域名 + # base-path: /data/work-data/upload/jnpfsoft/yunzhupaas-resources/ # 基础路径 + base-path: E:/XiangMu/yunzhu/zero-resources/ # 基础路径 + path-patterns: /** # 访问路径 + storage-path: # 存储路径 + aliyun-oss: # 阿里云 OSS ,不使用的情况下可以不写 + - platform: aliyun-oss-1 # 存储平台标识 + enable-storage: false # 启用存储 + access-key: ?? + secret-key: ?? + end-point: ?? + bucket-name: ?? + domain: ?? # 访问域名,注意“/”结尾,例如:https://abc.oss-cn-shanghai.aliyuncs.com/ + base-path: hy/ # 基础路径 + qiniu-kodo: # 七牛云 kodo ,不使用的情况下可以不写 + - platform: qiniu-kodo-1 # 存储平台标识 + enable-storage: false # 启用存储 + access-key: ?? + secret-key: ?? + bucket-name: ?? + domain: ?? # 访问域名,注意“/”结尾,例如:http://abc.hn-bkt.clouddn.com/ + base-path: base/ # 基础路径 + tencent-cos: # 腾讯云 COS + - platform: tencent-cos-1 # 存储平台标识 + enable-storage: false # 启用存储 + secret-id: ?? + secret-key: ?? + region: ?? #存仓库所在地域 + bucket-name: ?? + domain: ?? # 访问域名,注意“/”结尾,例如:https://abc.cos.ap-nanjing.myqcloud.com/ + base-path: hy/ # 基础路径 + minio: # MinIO,由于 MinIO SDK 支持 AWS S3,其它兼容 AWS S3 协议的存储平台也都可配置在这里 + - platform: minio-1 # 存储平台标识 + enable-storage: true # 启用存储 + access-key: 9Y3sjaDWgbxKjXjm + secret-key: Bs2GyJwmOLpqNsQwbDjdinyUJQHtM0rc + end-point: http://192.168.0.207:9000/ + bucket-name: v350 + domain: ${config.file-storage.minio[0].end-point} # 访问域名,注意“/”结尾,例如:http://minio.abc.com/abc/ + base-path: # 基础路径 + # ===================== 文件存储配置-End ===================== +# ===================== 第三方登录配置-Start ===================== +socials: + # 第三方登录功能开关(false-关闭,true-开启) + socials-enabled: false + config: + - # 微信 + provider: wechat_open + client-id: your-client-id + client-secret: your-client-secret + - # qq + provider: qq + client-id: your-client-id + client-secret: your-client-secret + - # 企业微信 + provider: wechat_enterprise + client-id: your-client-id + client-secret: your-client-secret + agentId: your-agentId + - # 钉钉 + provider: dingtalk + client-id: your-client-id + client-secret: your-client-secret + agentId: your-agentId + - # 飞书 + provider: feishu + client-id: your-client-id + client-secret: your-client-secret + - # 小程序 + provider: wechat_applets + client-id: your-client-id + client-secret: your-client-secret +# ===================== 第三方登录配置-End ===================== +# ===================== 任务调度配置-Start ===================== +xxl: + job: + accessToken: '432e62f3b488bc861d91b0e274e850cc' + i18n: zh_CN + logretentiondays: 30 + triggerpool: + fast: + max: 200 + slow: + max: 100 + # xxl-job服务端地址 + admin: + addresses: http://127.0.0.1:30020/xxl-job-admin/ + executor: + address: '' + appname: xxl-job-executor-sample1 + ip: '' + logpath: /data/applogs/xxl-job/jobhandler + logretentiondays: 30 + port: 39999 + # rest调用xxl-job接口地址 + admin: + register: + handle-query-address: ${xxl.job.admin.addresses}api/handler/queryList + job-info-address: ${xxl.job.admin.addresses}api/jobinfo + log-query-address: ${xxl.job.admin.addresses}api/log + task-list-address: ${xxl.job.admin.addresses}api/ScheduleTask/List + task-info-address: ${xxl.job.admin.addresses}api/ScheduleTask/getInfo + task-save-address: ${xxl.job.admin.addresses}api/ScheduleTask + task-update-address: ${xxl.job.admin.addresses}api/ScheduleTask + task-remove-address: ${xxl.job.admin.addresses}api/ScheduleTask/remove + task-start-or-remove-address: ${xxl.job.admin.addresses}api/ScheduleTask/updateTask +# ===================== 任务调度配置-End ===================== +# ===================== 单点登录(SSO)配置-Start ===================== +yunzhupaas: + sso: + # ===================== 单点登录(用户信息拉取)配置-Start ===================== + connector: + # 是否开启用户信息拉取 + enabled: false + # ===================== 单点登录(用户信息拉取)配置-End ===================== + # ===================== 单点登录(用户信息推送)配置-Start ===================== + pull: + # 是否开启用户信息推送 + enabled: false + create-rest-address: http://localhost:9526/sso-mgt-api/api/idm/Account + replace-rest-address: http://localhost:9526/sso-mgt-api/api/idm/Account + change-password-rest-address: http://localhost:9526/sso-mgt-api/api/idm/Account/changePassword + delete-rest-address: http://localhost:9526/sso-mgt-api/api/idm/Account + credential-type: Basic + user-name: 747887288041603072 + password: MYgMMjIwNzIwMjIxNTU4MTAxNzQlKQ + # ===================== 单点登录(用户信息推送)配置-End ===================== +oauth: + #启用单点登录, 普通登录不可用 + ssoEnabled: false + #轮询票据有效期 + ticketTimeout: 120 + #默认单点登录协议 + defaultSSO: cas + #后端登录接口地址 + loginPath: http://127.0.0.1:30000/api/oauth/Login + #login: + #JWT生成秘钥 不填写为默认值 + #jwtSecretKey: WviMjFNC72VKwGqm5LPoheQo5XN9iN4d + sso: + #单点登录系统地址 + baseUrl: http://127.0.0.1:8527 + #登录成功后跳转到前端的页面 + sucessFrontUrl: http://127.0.0.1:3100/sso + #错误信息是否输出到页面 + ticketOutMessage: false + #logoutFrontUrl: http://sso.maxkey.top:8527/maxkey + #单点注销后端接口地址, 配置启用后YUNZHUPAAS退出会请求单点系统退出, 触发单点注销退出全部应用 + #ssoLogoutApiUrl: ${oauth.sso.baseUrl}/sign/logout + auth2: + enabled: true + clientId: 747887288041603072 + clientSecret: MYgMMjIwNzIwMjIxNTU4MTAxNzQlKQ + baseUrl: ${oauth.sso.baseUrl} + authorizeUrl: ${oauth.sso.auth2.baseUrl}/sign/authz/oauth/v20/authorize + accessTokenUrl: ${oauth.sso.auth2.baseUrl}/sign/authz/oauth/v20/token + userInfoUrl: ${oauth.sso.auth2.baseUrl}/sign/api/oauth/v20/me + cas: + enabled: true + baseUrl: ${oauth.sso.baseUrl} + serverLoginUrl: ${oauth.sso.cas.baseUrl}/sign/authz/cas/login + serverValidateUrl: ${oauth.sso.cas.baseUrl}/sign/authz/cas +# ===================== 单点登录(SSO)配置-End ===================== +userUrl: http://192.168.3.31:8000/api-web/sys/user/save \ No newline at end of file diff --git a/yunzhupaas-admin/src/main/resources/application.yml b/yunzhupaas-admin/src/main/resources/application.yml new file mode 100644 index 0000000..ede0f11 --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/application.yml @@ -0,0 +1,163 @@ +spring: + application: + name: yunzhupaas-boot + profiles: + # 指定环境配置 dev(开发环境-默认)、test(测试环境)、preview(预生产)、prod(生产环境) + active: test + servlet: + multipart: #文件传输配置 + max-file-size: 100MB #单个数据大小限制 + max-request-size: 100MB #请求总数据大小限制 + enabled: true #是否启用分段上传支持 + mvc: + #csrf-origins: ${config.FrontDomain} + cors: + # 允许跨域的域名 + #allowed-origins: ${config.FrontDomain} + # 允许跨域的域名正则匹配 如需全部匹配设置为 '**', 因为包含凭据的请求不允许直接写* 这个写法可以直接返回当前请求域名 + allowed-origin-patterns: '**' + # 允许跨域的请求方法 GET, POST, PUT, DELETE + allowed-methods: "*" + # 允许跨域的头部信息 Content-Type, Authorization + allowed-headers: "*" + options-max-age: 18000 + headers: + server-name: '' + x-frame-options: sameorigin + x-content-type-options: disabled + x-xss-protection: enabled_mode_block + hiddenmethod: #隐式方法过滤器 + filter: + enabled: true #默认开启。开启以支持:PUT,DELETE表单提交方法 + jackson: #序列化和反序列化json框架 + serialization: + write-dates-as-timestamps: true #是否写入日期时间时间戳格式 + time-zone: GMT+8 #指定日期格式化时区 + main: + allow-bean-definition-overriding: true #允许同名bean后者覆盖,默认:true + allow-circular-references: true #允许Bean相互引用,默认:false +config: + # ===============静态资源目录映射================== + WebAnnexFilePath: WebAnnexFile + DataBackupFilePath: DataBackupFile + TemporaryFilePath: TemporaryFile + SystemFilePath: SystemFile + TemplateFilePath: TemplateFile + EmailFilePath: EmailFile + DocumentFilePath: DocumentFile + DocumentPreviewPath: DocumentPreview + UserAvatarFilePath: UserAvatar + IMContentFilePath: IMContentFile + MPMaterialFilePath: MPMaterial + TemplateCodePath: TemplateCode + BiVisualPath: BiVisualPath + # ===============功能格式限制================== + MPUploadFileType: bmp,png,jpeg,jpg,gif,mp3,wma,wav,amr,mp4 + WeChatUploadFileType: jpg,png,doc,docx,ppt,pptx,xls,xlsx,pdf,txt,rar,zip,csv,amr,mp4 + + AllowUploadImageType: jpg,gif,png,bmp,jpeg,tiff,psd,swf,svg,pcx,dxf,wmf,emf,lic,eps,tga #允许上传图片类型 + AllowUploadFileType: jpg,gif,png,bmp,jpeg,doc,docx,ppt,pptx,xls,xlsx,pdf,txt,rar,zip,csv,mp3,aac #允许上传文件类型 + AllowPreviewFileType: doc,docx,xls,xlsx,ppt,pptx,pdf,jpg,gif,png,bmp,jpeg #允许预览文件类型 + PreviewType: kkfile #文件预览方式 (1.yozo 2.kkfile)默认使用kkfile + kkFileUrl: http://127.0.0.1:30090/FileServer/ #kkfile文件预览服务地址 + ApiDomain: http://127.0.0.1:30000 #后端域名(文档预览中使用) + FrontDomain: http://127.0.0.1:3100 #前端域名(文档预览中使用) + AppDomain: http://127.0.0.1:8080 #app/h5端域名配置(文档预览中使用) + FlowDomain: http://127.0.0.1:31000 #流程引擎接口地址 + + CodeAreasName: example #代码生成器模块命名 + + #===================== unipush ===================== + AppPushUrl: https://8e84eea8-6922-4033-8e86-67ad7442e692.bspapp.com/unipush + + #===================== 多租户配置 ===================== + MultiTenancy: false #是否开启 + MultiTenancyUrl: http://127.0.0.1:30006/api/tenant/DbName/ #多租户项目地址 + + #===================== 系统及错误报告反馈相关 ===================== + SoftName: yunzhupaas-java-boot #项目名 + SoftFullName: 集团信息化平台 #项目全名 + SoftVersion: v5.2.0 #版本号 + + RecordLog: true #系统日志启用 + ErrorReport: false #软件错误报告 + ErrorReportTo: surrpot@yunzhupaas.com #软件错误报告接收者 + IgexinEnabled: true #推送启动 + + #===================== APP ===================== + AppVersion: v5.2.0 #APP版本号 + IgexinAppid: HLFY9T2d1z7MySY8hwGwh4 #APPID:应用的唯一标识 + IgexinAppkey: 6Uiduugq648YDChhCjAt59 #APPKEY:公匙(相当于账号) + IgexinMastersecret: pEyQm156SJ9iS7PbyjLCZ6 #Mastersecret:私匙(相当于密码) + AppUpdateContent: ; #APP更新内容 + + #===================== 永中office在线预览配置 ===================== + YozoDomain: //dcsapi.com/ #永中api域名 + YozoDomainKey: 57462250284462899305150 #域名key + YozoCloudDomain: //dmc.yozocloud.cn #云预览 + YozoAppId: yozoAgR41jgC0062 #appid + YozoAppKey: fc3134a9ba8bc6f4c69d635f9adf #app秘钥 + YozoEditDomain: //eic.yozocloud.cn #云编辑 + + #===================== 系统功能配置 ===================== + EnableLogicDelete: false #是否开启逻辑删除 + CodeCertificateTimeout: 180 # 秒 + check-file-pdf: false #检查上传的PDF文件安全 + +security: + # AES加密秘钥 + security-key: EY8WePvjM5GGwQzn + # 是否开启接口鉴权 + enable-pre-auth: true + # 接口加密 + enable-rest-encrypt: true + +# 事件配置 +event: + # 默认时间发布、监听渠道: redis, mq + event-publish-type: redis + # Redis监听模式:current, all + redis-publish-type: current + +# 接口放行地址 与GatewayWhite中的默认URL合并 +gateway: + # 禁止访问接口 + block-url: + ## 配置示例 + #- /api/message/Notice + #- /api/permission/Users/* + # 不验证Token, 放行接口(默认记录日志) + white-url: + # # 配置示例 + #- /api/message/Notice + #- /api/permission/Users/* + # 放行接口(不记录日志) + exclude-url: + # # 配置示例 + #- /api/message/Notice + #- /api/permission/Users/* + # 入站IP(禁止配置以外的IP访问block-url配置的接口) + white-ip: + #- 192.168.0.10 + #- 192.168.0.20 + +# 日志配置 +logging: + config: classpath:logback-spring.xml + level: + #自定义第三方包名日志等级 + # 解除注释后Druid连接池打印SQL语句 + druid.sql.Statement: debug +# druid.sql.DataSource: debug +# druid.sql.Connection: debug +# druid.sql.ResultSet: debug +log: + level: + # 等级 TRACE,DEBUG,INFO,WARN,ERROR(不区分大小写) + root: info + path: log/${spring.application.name} +mybatis: + mapper-locations: classpath*:com/**/mapper/**/*.xml + configuration: + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + diff --git a/yunzhupaas-admin/src/main/resources/i18n/message.properties b/yunzhupaas-admin/src/main/resources/i18n/message.properties new file mode 100644 index 0000000..4e52c82 --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/i18n/message.properties @@ -0,0 +1,1236 @@ +AD101=接口无法访问 +AD102=系统异常 +AD103=操作过于频繁 +AD104=没有访问权限,请联系管理员授权 +AD105=认证失败,无法访问系统资源 +AD106=无效内部认证,无法访问系统资源 +COD001=集合条件过滤获得目标为空 +COPY001=复制名称长度超过了限制长度 +DB001=数据类型编码不符合标准(请注意大小写)。MySQL , SQLServer , Oracle , DM , KingbaseES , PostgreSQL +DB002=请检查 1、连接信息 2、网络通信 3、数据库服务启动状态。 详情:{0} +DB003=通过url找不到对应数据库 +DB004=查询结果集为空。 +DB005=未找到对应数据库类型:{0}({1}) +DB006=未找到对应数据类型转换 +DB007=导入表名存在重复 +DB008=建表数据与当前操作数据库不匹配: {0} -> {1} +DB009=未找到表信息: {0} +DB010=数据库{0},未找到此表:{1} +DB011=联合主键类缺少“{0}”字段值 +DB012=表示对应获取数值失败 +DB013=目前还未支持{0}数据类型:{1} +DB014=表 "{0}"中字段 "{1}" 为主键,不允许数据类型 "{2}" +DB015=未找到字段SQL语句 +DB016=没有初始字段 +DB017=sql异常:{0} +DB018=请在数据库中添加对应的数据表 +DB019=添加失败 +DB101=系统自带表,不允许被删除 +DB102=系统自带表,不允许被编辑 +DB201=表已经被使用,不允许被删除 +DB202=表已经被使用,不允许被编辑 +DB301=数据库连接成功 +DB302=数据库连接失败 +ETD101=操作失败,原文件不存在 +ETD102=找不到父级 +ETD103=不能移动到自己的文件夹 +ETD104=未能找到此订单 +ETD105=新建成功10000条数据 +ETD106=获取失败 +ETD107=账户认证错误 +ETD108=你还没有设置邮件的帐户 +ETD109=文件导出失败 +ETD110=文件格式不正确 +ETD111=文件找不到 +ETD112=此记录被关联引用,不允许被删除 +ETD113=防止恶意创建过多数据 +ETD114=保存失败,请重新登陆 +ETD115=请输入预览的url +ETD116=请选择正确的预览方式 +ETD117=数据超过1000条 +EXIST001=名称不能重复 +EXIST002=编码不能重复 +EXIST003=模板名已存在 +EXIST004=文件夹名称不能重复 +EXIST005=模板名称超过了限制长度 +EXIST101=名称重复,请重新输入 +EXIST102=编码重复,请重新输入 +EXIST103=不能重复 +FA001=数据不存在 +FA002=更新失败,数据不存在 +FA003=删除失败,数据不存在 +FA004=复制失败,数据不存在 +FA005=发送失败,数据不存在 +FA006=下载失败,数据不存在 +FA007=操作失败,数据不存在 +FA008=停止失败,数据不存在 +FA009=终止失败,数据不存在 +FA010=还原失败,数据不存在 +FA011=发布失败,数据不存在 +FA012=获取失败,数据不存在 +FA013=接口修改失败,数据不存在 +FA014=更新接口状态失败,数据不存在 +FA015=预览失败,数据不存在 +FA016=删除失败,该文件夹存在数据 +FA017=文件格式不正确 +FA018=文件不存在 +FA019=已失效 +FA020=未查到信息 +FA021=操作失败!您没有权限操作 +FA022=更新失败!您没有权限操作 (角色只有超级管理员才能够操作) +FA023=更新失败!已绑定用户,无法切换组织 +FA024=删除失败!已绑定用户 +FA025=该组织内权限为空,组织切换失败! +FA026=更新失败,关联组织不存在,请重新登录,或者刷新页面 +FA027=该系统下菜单为空,系统切换失败 +FA028=新增数据失败 +FA029=修改数据失败 +FA030=更新失败!已绑定用户,无法修改状态 +FA031=该组织无本应用权限,切换失败 +FA032=上传文件不能为空 +FA033=文件上传失败! +FA034=非法请求, 缺少认证信息 +FA035=未获取到租户指定数据源信息 +FA036=常用数据已存在 +FA037=接口请求失败 +FA038=文件存储路径错误 +FA039=链接已失效 +FA040=预览失败,请检查文件类型是否规范 +FA041=预览失败,请重新上传文件 +FA042=请输入正确的文件格式 +FA043=存在同名文件! +FA044=不存在该文件 +FA045=删除文件:{0}失败 +FA046=文件读取失败 +FA047=未发现文件 +FA048=微信公众号原始id不能重复 +FA049=此记录与“消息发送配置”关联引用,不允许被禁用 +FA050=此记录与“消息发送配置”关联引用,不允许被删除 +FA051=接口已配置加密, 数据解密失败. +FA052=该身份未分配权限 +FA101=保存失败 +FA102=更新失败 +FA103=删除失败 +FA104=获取失败 +FA105=预览失败,请先保存在预览数据 +FA106=预览失败,单元格配置出现死循环 +FM001=未找到接口 +FM002=表单信息不存在 +FM003=子表重复 +FM004=已到达该模板复制上限,请复制源模板! +FM005=该表单已被流程引用,无法删除! +FM006=该表单未发布,无法回滚表单内容 +FM007=该模板内表单内容为空,无法发布 +FM008=该功能未导入流程表单 +FM009=流程未设计,请先设计流程! +FM010=该功能流程处于停用状态! +FM011=表[{0}]无主键! +FM012=主键策略:{0},与表[{1}]主键策略不一致! +FM013=表新增错误:{0} +GT101=成功 +GT102=失败 +GT103=验证错误 +GT104=异常 +GT105=登录过期,请重新登录 +GT106=您的帐号在其他地方已登录,被强制踢出 +GT107=Token验证失败 +GT108=请求超过最大数 +IMP001=导入成功 +IMP002=导入失败,文件格式错误 +IMP003=导入失败,数据已存在 +IMP004=导入失败,数据有误 +IMP005=导出失败 +IMP006=导入数据格式不正确 +IMP007=重复 +IMP008=名称 +IMP009=编码 +IMP010=导入失败,查询不到上级分类 +IMP011=请选择导出字段 +LOG001=账户异常 +LOG002=注销成功 +LOG004=账号异常,请联系管理员修改所属组织信息 +LOG005=账号未被激活 +LOG006=账号已被禁用 +LOG007=账号已被删除 +LOG010=此IP未在白名单中 +LOG011=登录失败,用户暂未绑定角色 +LOG012=账号已被锁定,请联系管理员解除锁定 +LOG101=账号或密码错误 +LOG102=账号有误,请重新输入 +LOG103=请输入验证码 +LOG104=验证码错误 +LOG105=连接租户服务失败,请稍后再试 +LOG106=短信验证码错误 +LOG107=验证码已失效 +LOG108=请等待{0}分钟后再进行登录,或联系管理员解除锁定 +LOG109=租户登录失败,请用手机验证码登录 +LOG110=数据库异常,请联系管理员处理 +LOG111=已开启单点登录, 不支持此登录方式 +LOG112=不支持此登录方式 +LOG113=未设置租户信息 +LOG114=租户编码不允许为空 +LOG115=租户信息获取失败 +LOG116=不支持此验证 +LOG117=短信验证码验证失败:{0} +LOG118=租户库名为空 +LOG201=旧密码错误 +LOG202=修改成功,请牢记新密码 +LOG203=修改失败,账号不存在 +LOG204=修改失败,新建密码不能与旧密码一样 +LOG205=重置密码成功 +LOG206=重置密码失败 +MSERR101=发送失败,失败原因:SMTP服务为空 +MSERR102=发送失败,失败原因:发件人邮箱为空 +MSERR103=发送失败,失败原因:发件人密码为空 +MSERR104=发送失败,失败原因:接收人为空 +MSERR105=发送失败。失败原因:{0}的邮箱账号格式有误! +MSERR106=发送失败。失败原因:{0}的邮箱账号为空! +MSERR107=发送失败。失败原因:接收人对应的邮箱全部为空 +MSERR108=发送失败。失败原因:{0} +MSERR109=连接成功 +MSERR110=连接失败。失败原因:{0} +MSERR111=已发送 +MSERR112=内容不能包含<符号 +MSERR113=暂无未读消息 +MSERR114=自定义模板编码不能使用系统模板编码规则 +MSERR115=创建失败,存在多个标题参数 +MSERR116=创建失败,不存在标题参数 +MSERR117=更新失败,存在多个标题参数 +MSERR118=更新失败,不存在标题参数 +MSERR119=请先前往系统同步设置,配置钉钉账号 +MSERR120=请先前往系统同步设置,配置企业微信账号 +MSERR121=配置模板无数据,无法测试 +OA001=用户登录 +OA002=设备 +OA003=TOKEN +OA004=用户退出 +OA005=用户踢出 +OA006=用户顶替 +OA007=登录异常 +OA008=登录获取系统配置失败 +OA009=该用户未分配权限 +OA010=仅支持pc端访问,APP端不支持 +OA011=应用不存在 +OA012=当前应用已被禁用 +OA013=登录密码解密失败 +OA014=注销成功 +OA015=登录成功 +OA016=登录票据已失效 +OA017=第三方未绑定账号 +OA018=不允许访问此登录接口 +OA019=账号不存在 +OA020=账户或密码错误,请重新输入 +OA021=验证成功 +OA022=限制会话, 不允许访问系统 +OA023=管理员不能注销 +OA024=登录失败 +OA025=超级管理员 +OA026=普通管理员 +OA027=普通用户 +OA028=未知来源 +PRI001=打印模板不存在 +PRI002=数字字典不存在printDev的字典分类 +PRI003=第1条SQL语句:查询出多条表头信息 +PRI004=第1条SQL语句:未查出表头信息 +PRI005=第{index}条SQL语句: +PRI006=已到达该模板复制上限,请复制源模板 +PRI007=Sql语法错误 +PRI008=该报表已删除 +PS001=此记录与"{0}"关联引用,不允许被删除 +PS003=组织 +PS004=岗位 +PS005=用户 +PS006=角色 +PS007=账号不能为空 +PS008=姓名不能为空 +PS009=用户额度已达到上限 +PS010=权限已变更,请重新登录 +PS011=密码已变更,请重新登录 +PS012=类型不能为空 +PS013=当前机构Id不能与父机构Id相同 +PS014=该应用已禁用 +PS015=无法设置当前用户为分级管理员 +PS016=无法设置超管为分级管理员 +PS017=无法设置当前用户操作权限 +PS018=解绑失败 +PS019=第三方登录未配置 +PS020=性别不能为空 +PS021=无法禁用管理员用户 +PS022=管理员只能修改自己,不能修改其他管理员 +PS023=无法修改管理员账户 +PS024=直属主管不能是自己 +PS025=直属主管不能是我的下属用户 +PS026=无法删除管理员账户 +PS027=此用户为某部门主管,无法删除 +PS028=此用户有下属,无法删除 +PS029=无法修改管理员账户状态 +PS030=用户信息已变更,请重新登录 +PS031=该应用已删除 +PS032=该组织无本应用权限,切换失败 +PS033=工作交接成功! +PS034=工作交接无法转移给管理员 +PS035=工作交接无法转移给本人 +SC001=操作失败,任务不存在 +SU000=Success +SU001=新建成功 +SU002=保存成功 +SU003=删除成功 +SU004=更新成功 +SU005=操作成功 +SU006=提交成功,请耐心等待 +SU007=复制成功 +SU008=停止成功 +SU009=终止成功 +SU010=还原成功 +SU011=发布成功 +SU012=发送成功 +SU013=接口修改成功 +SU014=更新接口状态成功 +SU015=上传成功 +SU016=设置成功 +SU017=验证成功 +SU018=添加成功 +SU019=获取成功 +SU020=回滚成功 +SU021=移除成功 +SU022=查询成功 +SYS001=区域编码不能重复 +SYS002=删除失败,当前有子节点数据 +SYS003=单据已经被使用,不允许被删除 +SYS004=清理成功 +SYS005=接口创建成功 +SYS006=当前SQL含有敏感字:{0} +SYS007=接口请求成功 +SYS008=接口不符合规范 +SYS009=变量名不能包含敏感字符 +SYS010=变量名已存在 +SYS011=数据库连接不能相同 +SYS012=请检查,同一数据库下无法同步数据 +SYS013=同步失败:{0} +SYS014=字典类型下面有字典值禁止删除 +SYS015=模板不存在 +SYS016=当前目录存在数据,不能修改类型 +SYS017=删除失败,请先删除子菜单 +SYS018=当前导入菜单为{0}端菜单,请在对应模块下导入! +SYS019=请在顶级节点下创建目录后再进行菜单导入 +SYS020=该字段在方案{0}中已被使用 +SYS021=修改失败,该方案不允许编辑 +SYS022=编码错误 +SYS023=请求发生错误! +SYS024=获取不到数据! +SYS025=获取企业微信access_token失败 +SYS026=正在进行同步,请稍后再试 +SYS027=请先从企业微信同步部门到本地 +SYS028=请先从钉钉同步部门到本地 +SYS029=验证码位数不能大于6 +SYS030=验证码位数不能小于3 +SYS031=测试发送消息的连接失败:{0} +SYS032=测试发送消息连接成功 +SYS033=测试组织同步的连接失败:{0} +SYS034=测试组织同步连接成功 +SYS035=测试连接类型错误 +SYS036=测试钉钉连接失败: +SYS037=测试连接成功 +SYS038=表信息抽取异常 +SYS039=删除失败,请先删除该应用下的菜单和门户 +SYS040=删除失败,请先删除该应用下的菜单 +SYS041=删除失败,请先删除该应用下的门户 +SYS042=该日程已被删除 +SYS043=最后一条数据不能删除 +SYS044=启用版本不能删除 +SYS045=归档版本不能删除 +SYS046=数据集不能重名 +SYS047=SQL语句仅支持查询语句 +SYS048=SQL语句需带上@formId条件 +SYS049=正在进行同步,请稍等 +SYS050=只能输入字母、数字、点、横线和下划线,且以字母开头 +SYS051=翻译标记不能重复 +SYS052=翻译语言至少填写一项 +SYS053=获取钉钉access_token失败 +SYS101=更新失败,主系统不允许禁用 +SYS102=主系统不允许删除 +SYS103=系统在审批常用语中被使用,不允许删除 +SYS104=更新失败,主系统不允许修改编码 +SYS105=常用语已存在 +SYS121=接口暂只支持HTTP和HTTPS方式 +SYS122=接口请求失败 +SYS123=接口请求失败, JS调用失败,错误:{0} +SYS124=验证请求超时 +SYS125=appSecret错误 +SYS126=appId使用期限已到期 +SYS127=appId参数错误 +SYS128={0}不能使用系统、开发语言及数据库关键字命名 +SYS129=当前数据源不支持全连接 +SYS130=标题不能为空 +SYS131=结束时间必须晚于开始时间 +SYS132=结束重复必须晚于开始时间 +VS001=同步到流程时,{0} +VS002=发布失败,流程未设计! +VS003=无表生成有表失败 +VS004=发布 +VS005=预览 +VS006=下载 +VS007=同步成功 +VS008=回滚失败,暂无线上版本 +VS009=参数解析错误! +VS010=无效链接 +VS011=密码错误 +VS012=未找到该功能表单 +VS013=未开启表单外链! +VS014=下载链接已失效 +VS015=字段不能为空 +VS016=路径错误 +VS017=集成助手被禁用 +VS018=表规范名称不能重复 +VS019=规范名称不能使用系统关键字或JAVA关键字 +VS020=字段规范名称不能重复 +VS021=“{0}”命名不符合规范 +VS022=主键策略:[雪花ID],表[ {0} ]主键设置不支持! +VS023=主键策略:[自增ID],表[ {0} ]主键设置不支持! +VS024=表单不存在或者未发布! +VS025=未获取到流程发起人 +VS026=规范名称前两字母必须小写 +VS027=自动生成的【{0}】超出长度,提交失败! +VS028=视图最多新建5个 +VS401=该模板内表单内容为空,无法 +VS402=该模板内列表内容为空,无法 +VS403=该功能未配置流程不可用 +VS404=单行输入不能重复 +VS405=当前表单原数据已被调整,请重新进入该页面编辑并提交数据 +VS406=该功能配置的流程处于停用 +VS407=表头名称不可更改,表头行不能删除 +VS408=请至少选择一个数据表 +VS409=未找到主表信息 +VS410=请导入对应功能的json文件 +VS411=已存在相同功能 +VS412=该表单已删除 +VS413=应用不能为空 +VS414=门户数据信息存在重复 +VS415=该门户已删除 +WF001=审核成功 +WF002=退回成功 +WF003=转办成功 +WF004=加签成功 +WF005=当前流程被退回,无法撤回流程 +WF006=流程已撤回,不能重复操作 +WF007=撤回失败,转向数据无法撤回 +WF008=撤回成功 +WF009=功能流程不能终止 +WF010=指派成功 +WF011=批量操作完成 +WF012=该流程不能操作 +WF013=复活成功 +WF014=变更成功 +WF015=挂起成功 +WF016=恢复成功 +WF017=委托人和被委托人相同,委托失败 +WF018=操作失败,同一时间内有相同流程的委托 +WF019=操作失败,同一时间内有相同流程,不能相互委托 +WF020=功能流程不能删除 +WF021=不能删除 +WF022=催办成功 +WF023=未找到催办人 +WF024=该功能已被流程引用,请重新选择关联功能 +WF025=启用失败,流程未设计 +WF026=启用成功 +WF027=禁用成功 +WF028=该版本内有工单任务流转,无法删除 +WF029=您没有发起该流程的权限 +WF030=表单未找到 +WF031=已审核完成 +WF032=冻结不能操作 +WF033=转向节点不存在或配置错误 +WF034=转向失败,转向节点未审批 +WF035=退回至您的审批,不能再发起退回 +WF036=流程已处理,无法撤回 +WF037=当前流程包含子流程,无法撤回 +WF038=子流程无法撤回 +WF039=下一节点为选择分支无法批量审批 +WF040=条件流程包含候选人无法批量通过 +WF041=该流程工单已终止 +WF042=该流程工单已撤回 +WF043=该节点没有数据,无法复活 +WF044=此流程不支持变更 +WF045=当前节点有子流程无法变更 +WF046=退回节点包含子流程,退回失败 +WF047=当前节点未审批,不能退回 +WF048=流程处于挂起状态,不可操作 +WF049=当前流程正在运行不能删除 +WF050=已被挂起不能删除 +WF051=没有删除权限 +WF052=主版本没有内容 +WF053=流程没有启用 +WF054=流程编码不能重复 +WF055=流程表单不一致,请重新选择 +WF056=该流程由在线开发生成的,无法直接删除,请在功能设计中删除相关功能 +WF057=该流程内工单任务流转未结束,无法删除 +WF058=当前流程正在运行不能重复提交 +WF059=流程自动发起审批失败 +WF060=驳回节点不能是子流程 +WF061=下一节点无审批人员请联系管理员 +WF062=表单已被引用,请重新选择 +WF063=流程已发起,无法删除 +WF064=任务不存在,或者已处理 +WF065=拒绝成功 +WF066=同意成功 +WF067=协办成功 +WF068=协办保存成功 +WF069=减签成功 +WF070=撤销成功 +WF071=最后一条数据不能删除 +WF072=启用版本不能删除 +WF073=归档版本不能删除 +WF074=暂停成功 +WF075=条件不满足无法流转 +WF076=节点不存在 +WF077=流程无法撤回 +WF078=流程未同意,无法撤销 +WF079=归档异常 +WF080=选择的数据不能退签 +WF081=无法加签 +WF082=无法减签 +WF083=无法退回 +WF084=无法转审 +WF085=无法协办 +WF086=无法批量审批 +WF087=经办未签收 +WF088=经办未开始办理 +WF089=流程发布失败 +WF090=流程发布失败 +WF091=流程提交失败 +WF092=获取引擎当前任务失败 +WF093=流程删除失败 +WF094=获取出线集合失败 +WF095=获取线之后的任务节点失败 +WF096=获取下一级任务节点集合失败 +WF097=获取上一级任务节点集合失败 +WF098=任务完成失败 +WF099=获取流程实例失败 +WF100=获取未经过的节点失败 +WF101=获取节点的后续节点失败 +WF102=获取可回退的节点失败 +WF103=退回失败 +WF104=节点跳转失败 +WF105=补偿失败 +WF106=不能加签给自己 +WF107=不能转审给自己 +WF108=不能协办给自己 +WF109=必须保留一名加签人员 +WF110=审批异常无法撤销 +WF111=所选流程包含条件候选人 +WF112=选择的数据对应流程已暂停 +WF113=已被暂停不能删除 +WF114=流程处于暂停状态,不可操作 +WF115=流程已受理,无法删除 +WF116=不能加签给委托人 +WF117=不能转审给委托人 +WF118=不能协办给委托人 +WF119=设置了流转条件,无法批量审批 +WF120=下一节点审批异常,无法批量审批 +WF121=子流程自动发起审批失败 +WF122=流程不存在 +WF123=流程处于终止状态,不可操作 +WF124=该流程已发起数据,无法删除! +WF125=您没有发起委托流程 +WF126=撤销流程不能转审 +WF127=撤销流程不能退回 +WF128=该用户已审批,请重新打开界面 +WF129=委托人已无该流程权限 +WF130=管理员不能新建委托/代理 +WF131=不能选择admin +WF132=已有人接受,不可编辑 +WF133=流转条件不满足,无法自动发起审批 +WF134=第一个审批节点设置候选人,无法自动发起审批 +WF135=第一个审批节点异常,无法自动发起审批 +WF136=找不到发起人,发起失败 +WF137=代理人和被代理人相同,代理失败 +WF138=存在未签收的数据,无法关闭 +WF139=该流程已触发了任务,无法删除 +WF144=操作失败,同一时间内有相同流程的代理 +WF145=操作失败,同一时间内有相同流程,不能相互代理 +app.apply.expandData=展开数据 +app.apply.location.location=添加定位 +app.apply.location.modalTitle=选择位置 +app.apply.location.relocation=重新定位 +app.apply.noMoreData=没有更多数据 +app.apply.pleaseKeyword=请输入关键字搜索 +app.apply.screen=筛选 +app.apply.sort=排序 +app.my.accountSecurity=账号安全 +app.my.agencyMe=代理给我 +app.my.allFlow=全部流程 +app.my.entrustedAgency=委托代理 +app.my.entrustMe=委托给我 +app.my.flowSelect=流程选择 +app.my.logOut=退出登录 +app.my.myAgency=我的代理 +app.my.myEntrust=我的委托 +app.my.organization=我的组织 +app.my.position=我的岗位 +app.my.scanCode=扫一扫 +app.my.setting=设置 +app.my.settings.About=关于平台 +app.my.settings.changePassword=修改密码 +app.my.settings.contact=联系我们 +app.my.settings.language=多语言 +app.my.settings.privacyPolicy=隐私政策 +app.my.settings.userAgreement=用户协议 +app.my.sto=终止 +app.my.subordinates=我的下属 +app.my.switchIdentity=切换身份 +common.add1Text=添加 +common.add2Text=新增 +common.addText=新建 +common.back=返回 +common.batchDelText=批量删除 +common.batchDelTip=您确定要删除这些数据吗, 是否继续? +common.batchPrintText=批量打印 +common.cancelText=取消 +common.chooseText=请选择 +common.chooseTextPrefix=请选择 +common.cleanText=清空 +common.closeList=关闭列表 +common.closeText=关闭 +common.collapseAll=折叠 +common.continueAndAddText=确定并新增 +common.continueText=确定并继续 +common.copyText=复制 +common.dark=黑暗主题 +common.delText=删除 +common.delTip=此操作将永久删除该数据, 是否继续? +common.detailText=详情 +common.drawerSearchText=请输入关键词 +common.editText=编辑 +common.enterKeyword=请输入关键词 +common.expandAll=展开 +common.exportText=导出 +common.importText=导入 +common.inputPlaceholder=请输入 +common.inputText=请输入 +common.inputTextPrefix=请输入 +common.keyword=关键词 +common.leftTreeSearchText=请输入关键词 +common.light=亮色主题 +common.loadingText=加载中... +common.moreText=更多 +common.next=下一步 +common.nextRecord=下一条 +common.noData=暂无数据 +common.okText=确定 +common.prev=上一步 +common.previewText=预览 +common.prevRecord=上一条 +common.printText=打印 +common.queryText=查询 +common.redo=刷新 +common.redoText=重做 +common.resetText=重置 +common.saveText=保存 +common.searchText=搜索 +common.selectDataTip=请选择一条数据 +common.selectI18nCode=选择翻译标记 +common.selectPlaceholder=请选择 +common.submitText=提交 +common.superQuery=高级查询 +common.syncText=第三方同步 +common.tipTitle=提示 +common.undoText=撤销 +component.app.searchNotData=暂无搜索结果 +component.app.toNavigate=切换 +component.app.toSearch=确认 +component.countdown.normalText=获取验证码 +component.countdown.sendText={0}秒后重新获取 +component.cropper.btn_reset=重置 +component.cropper.btn_rotate_left=逆时针旋转 +component.cropper.btn_rotate_right=顺时针旋转 +component.cropper.btn_scale_x=水平翻转 +component.cropper.btn_scale_y=垂直翻转 +component.cropper.btn_zoom_in=放大 +component.cropper.btn_zoom_out=缩小 +component.cropper.modalTitle=头像上传 +component.cropper.okText=确认并上传 +component.cropper.preview=预览 +component.cropper.selectImage=选择图片 +component.cropper.uploadSuccess=上传成功 +component.drawer.cancelText=关闭 +component.drawer.loadingText=加载中... +component.drawer.okText=确认 +component.excel.exportModalTitle=导出数据 +component.excel.fileName=文件名 +component.excel.fileType=文件类型 +component.form.apiSelectNotFound=请等待数据加载完成... +component.form.fold=收起 +component.form.maxTip=字符数应小于{0}位 +component.form.unfold=展开 +component.icon.copy=复制图标成功! +component.icon.placeholder=点击选择图标 +component.icon.search=搜索图标 +component.com.yunzhupaas.areaSelect.modalTitle=省市区 +component.com.yunzhupaas.calculate.storage=用于展示计算结果,且数据同时会保存入库 +component.com.yunzhupaas.calculate.unStorage=用于展示计算结果,且数据不会保存 +component.com.yunzhupaas.common.allData=全部数据 +component.com.yunzhupaas.common.autoGenerate=系统自动生成 +component.com.yunzhupaas.common.clearAll=清空列表 +component.com.yunzhupaas.common.selected=已选 +component.com.yunzhupaas.dateRange.endPlaceholder=结束日期 +component.com.yunzhupaas.dateRange.startPlaceholder=开始日期 +component.com.yunzhupaas.depSelect.modalTitle=选择部门 +component.com.yunzhupaas.groupSelect.modalTitle=选择分组 +component.com.yunzhupaas.iconPicker.modalTitle=图标选择 +component.com.yunzhupaas.iconPicker.searchPlaceholder=请输入关键词 +component.com.yunzhupaas.iconPicker.select=选择 +component.com.yunzhupaas.iconPicker.ymCustom=ymCustom图标 +component.com.yunzhupaas.iconPicker.ymIcon=ymIcon图标 +component.com.yunzhupaas.location.location=添加定位 +component.com.yunzhupaas.location.modalTitle=选择位置 +component.com.yunzhupaas.location.relocation=重新定位 +component.com.yunzhupaas.location.searchPlaceholder=搜索或直接在地图上点选 +component.com.yunzhupaas.numberRange.max=最大值 +component.com.yunzhupaas.numberRange.min=最小值 +component.com.yunzhupaas.organizeSelect.modalTitle=选择组织 +component.com.yunzhupaas.popupAttr.storage=用于展示关联弹窗的属性,且数据同时会保存入库 +component.com.yunzhupaas.popupAttr.unStorage=用于展示关联弹窗的属性,且数据不会保存 +component.com.yunzhupaas.popupSelect.modalTitle=选择数据 +component.com.yunzhupaas.posSelect.modalTitle=选择岗位 +component.com.yunzhupaas.relationFormAttr.storage=用于展示关联表单的属性,且数据同时会保存入库 +component.com.yunzhupaas.relationFormAttr.unStorage=用于展示关联表单的属性,且数据不会保存 +component.com.yunzhupaas.roleSelect.modalTitle=选择角色 +component.com.yunzhupaas.sign.operateTip=请在此区域使用鼠标手写签名 +component.com.yunzhupaas.sign.signPlaceholder=请签名 +component.com.yunzhupaas.sign.signTip=手写签名 +component.com.yunzhupaas.timeRange.endPlaceholder=结束时间 +component.com.yunzhupaas.timeRange.startPlaceholder=开始时间 +component.com.yunzhupaas.userSelect.modalTitle=选择用户 +component.menu.search=菜单搜索 +component.modal.cancelText=关闭 +component.modal.close=关闭 +component.modal.maximize=最大化 +component.modal.okText=确认 +component.modal.restore=还原 +component.table.action=操作 +component.table.index=序号 +component.table.settingColumn=列设置 +component.table.settingColumnShow=列展示 +component.table.settingDens=密度 +component.table.settingDensDefault=默认 +component.table.settingDensMiddle=中等 +component.table.settingDensSmall=紧凑 +component.table.settingFixedLeft=固定到左侧 +component.table.settingFixedRight=固定到右侧 +component.table.settingFullScreen=全屏 +component.table.settingIndexColumnShow=序号列 +component.table.settingSelectColumnShow=勾选列 +component.table.status=状态 +component.table.summary=合计 +component.table.total=共 {total} 条数据 +component.time.after=后 +component.time.before=前 +component.time.days=天 +component.time.hours=小时 +component.time.just=刚刚 +component.time.minutes=分钟 +component.time.seconds=秒 +component.tree.checkStrictly=层级关联 +component.tree.checkUnStrictly=层级独立 +component.tree.expandAll=展开全部 +component.tree.reload=刷新数据 +component.tree.selectAll=选择全部 +component.tree.unExpandAll=折叠全部 +component.tree.unSelectAll=取消选择 +component.upload.accept=支持{0}格式 +component.upload.acceptUpload=只能上传{0}格式文件 +component.upload.audio=音频 +component.upload.buttonText=点击上传 +component.upload.checking=文件校验中 +component.upload.choose=选择文件 +component.upload.del=删除 +component.upload.download=下载 +component.upload.downloadAll=全部下载 +component.upload.fileMaxNumber=最多可以上传{0}个文件 +component.upload.fileMaxSize=文件大小超过{size}{unit} +component.upload.fileName=文件名 +component.upload.fileReadError=文件{0}读取出错,请检查该文件 +component.upload.fileSize=文件大小 +component.upload.fileStatue=状态 +component.upload.fileTypeCheck=请选择{0}类型的文件 +component.upload.image=图片 +component.upload.imageMaxNumber=最多可以上传{0}张图片 +component.upload.imageMaxSize=图片大小超过{size}{unit} +component.upload.imgUpload=图片上传 +component.upload.legend=略缩图 +component.upload.maxNumber=最多只能上传{0}个文件 +component.upload.maxSize=单个文件不超过{0}MB +component.upload.maxSizeMultiple=只能上传不超过{0}MB的文件! +component.upload.operating=操作 +component.upload.paused=暂停中 +component.upload.preview=预览 +component.upload.reUploadFailed=重新上传失败文件 +component.upload.save=保存 +component.upload.saveError=没有上传成功的文件,无法保存! +component.upload.saveWarn=请等待文件上传后,保存! +component.upload.startUpload=开始上传 +component.upload.upload=上传 +component.upload.uploaded=已上传 +component.upload.uploadError=上传失败 +component.upload.uploadImg=请上传图片 +component.upload.uploading=上传中 +component.upload.uploadSuccess=上传成功 +component.upload.uploadWait=请等待文件上传结束后操作 +component.upload.video=视频 +component.upload.videoNoPreview=音视频文件不能预览 +component.upload.view=查看 +component.upload.viewImage=查看图片 +component.upload.waiting=等待中 +component.upload.zipNoPreview=压缩包不能预览 +component.verify.dragText=请按住滑块拖动 +component.verify.error=验证失败! +component.verify.redoTip=点击图片可刷新 +component.verify.successText=验证通过 +component.verify.time=验证校验成功,耗时{time}秒! +formGenerator.cleanComponentTip=确定要清空所有组件吗? +formGenerator.component.alert=提示 +formGenerator.component.areaSelect=省市区域 +formGenerator.component.autoComplete=下拉补全 +formGenerator.component.barcode=条形码 +formGenerator.component.billRule=单据组件 +formGenerator.component.button=按钮 +formGenerator.component.calculate=计算公式 +formGenerator.component.card=卡片容器 +formGenerator.component.cascader=级联选择 +formGenerator.component.checkbox=多选框组 +formGenerator.component.collapse=折叠面板 +formGenerator.component.colorPicker=颜色选择 +formGenerator.component.createTime=创建时间 +formGenerator.component.createUser=创建人员 +formGenerator.component.currOrganize=所属组织 +formGenerator.component.currPosition=所属岗位 +formGenerator.component.datePicker=日期选择 +formGenerator.component.depSelect=部门选择 +formGenerator.component.divider=分割线 +formGenerator.component.editor=富文本 +formGenerator.component.groupSelect=分组选择 +formGenerator.component.groupTitle=分组标题 +formGenerator.component.iframe=Iframe +formGenerator.component.input=单行输入 +formGenerator.component.inputNumber=数字输入 +formGenerator.component.link=链接 +formGenerator.component.location=定位 +formGenerator.component.modifyTime=修改时间 +formGenerator.component.modifyUser=修改人员 +formGenerator.component.organizeSelect=组织选择 +formGenerator.component.popupAttr=弹窗选择属性 +formGenerator.component.popupSelect=弹窗选择 +formGenerator.component.popupTableSelect=下拉表格 +formGenerator.component.posSelect=岗位选择 +formGenerator.component.qrcode=二维码 +formGenerator.component.radio=单选框组 +formGenerator.component.rate=评分 +formGenerator.component.relationForm=关联表单 +formGenerator.component.relationFormAttr=关联表单属性 +formGenerator.component.roleSelect=角色选择 +formGenerator.component.row=栅格容器 +formGenerator.component.select=下拉选择 +formGenerator.component.sign=手写签名 +formGenerator.component.slider=滑块 +formGenerator.component.switch=开关 +formGenerator.component.tab=标签面板 +formGenerator.component.table=设计子表 +formGenerator.component.tableGrid=表格容器 +formGenerator.component.text=文本 +formGenerator.component.textarea=多行输入 +formGenerator.component.timePicker=时间选择 +formGenerator.component.treeSelect=下拉树形 +formGenerator.component.uploadFile=文件上传 +formGenerator.component.uploadImg=图片上传 +formGenerator.component.userSelect=用户选择 +formGenerator.component.usersSelect=用户组件 +formGenerator.copyComponentTip=确定复制该组件? +formGenerator.delComponentTip=确定删除该组件? +layout.footer.onlineDocument=在线文档 +layout.footer.onlinePreview=在线预览 +layout.header.about=关于平台 +layout.header.commonMenus=常用菜单 +layout.header.dropdownItemDoc=文档 +layout.header.dropdownItemLoginOut=退出系统 +layout.header.feedback=反馈问题 +layout.header.home=首页 +layout.header.lockScreen=锁定屏幕 +layout.header.lockScreenBtn=锁定 +layout.header.lockScreenPassword=锁屏密码 +layout.header.profile=个人信息 +layout.header.setting=设置 +layout.header.standingChange=切换身份 +layout.header.statement=官方声明 +layout.header.systemChange=应用切换 +layout.header.tooltipChat=聊天 +layout.header.tooltipEntryFull=全屏 +layout.header.tooltipErrorLog=错误日志 +layout.header.tooltipExitFull=退出全屏 +layout.header.tooltipLock=锁定屏幕 +layout.header.tooltipNotify=消息 +layout.multipleTab.close=关闭标签页 +layout.multipleTab.closeAll=关闭全部标签页 +layout.multipleTab.closeLeft=关闭左侧标签页 +layout.multipleTab.closeOther=关闭其它标签页 +layout.multipleTab.closeRight=关闭右侧标签页 +layout.multipleTab.reload=重新加载 +layout.multipleTab.setCommon=设为常用菜单 +layout.setting.animation=动画 +layout.setting.animationType=动画类型 +layout.setting.autoScreenLock=自动锁屏 +layout.setting.blueBg=蔚蓝星辰 +layout.setting.breadcrumb=面包屑 +layout.setting.breadcrumbIcon=面包屑图标 +layout.setting.cachePage=缓存页面 +layout.setting.clearBtn=清空缓存并返回登录页 +layout.setting.closeMixSidebarOnChange=切换页面关闭菜单 +layout.setting.collapseMenuDisplayName=折叠菜单显示名称 +layout.setting.colorWeak=色弱模式 +layout.setting.contentMode=内容区域宽度 +layout.setting.contentModeFixed=定宽 +layout.setting.contentModeFull=流式 +layout.setting.copyBtn=拷贝 +layout.setting.darkMode=主题 +layout.setting.defaultBg=经典主题 +layout.setting.drawerTitle=配置 +layout.setting.expandedMenuWidth=菜单展开宽度 +layout.setting.fixedHeader=固定header +layout.setting.fixedSideBar=固定Sidebar +layout.setting.footer=页脚 +layout.setting.fullContent=全屏内容 +layout.setting.grayMode=灰色模式 +layout.setting.greenBg=碧绿翠风 +layout.setting.header=顶栏 +layout.setting.headerTheme=顶栏主题 +layout.setting.interfaceDisplay=界面显示 +layout.setting.interfaceFunction=界面功能 +layout.setting.menuAccordion=侧边菜单手风琴模式 +layout.setting.menuCollapse=折叠菜单 +layout.setting.menuCollapseButton=菜单折叠按钮 +layout.setting.menuDrag=侧边菜单拖拽 +layout.setting.menuSearch=菜单搜索 +layout.setting.menuTriggerBottom=底部 +layout.setting.menuTriggerNone=不显示 +layout.setting.menuTriggerTop=顶部 +layout.setting.menuTypeMix=顶部混合模式 +layout.setting.menuTypeMixSidebar=左侧混合模式 +layout.setting.menuTypeSidebar=左侧菜单模式 +layout.setting.menuTypeTopMenu=顶部菜单模式 +layout.setting.minute=分钟 +layout.setting.mixSidebarFixed=固定展开菜单 +layout.setting.mixSidebarTrigger=混合菜单触发方式 +layout.setting.navMode=导航栏模式 +layout.setting.notAutoScreenLock=不自动锁屏 +layout.setting.off=关 +layout.setting.on=开 +layout.setting.operatingContent=复制成功,请到 src/settings/projectSetting.ts 中修改配置! +layout.setting.operatingTitle=操作成功 +layout.setting.progress=顶部进度条 +layout.setting.purpleBg=紫藤萝兰 +layout.setting.resetSuccess=重置成功! +layout.setting.sidebar=左侧菜单 +layout.setting.sidebarTheme=菜单主题 +layout.setting.splitMenu=分割菜单 +layout.setting.switchAnimation=切换动画 +layout.setting.switchLoading=切换loading +layout.setting.systemBackground=系统背景 +layout.setting.sysTheme=系统主题 +layout.setting.tabDetail=标签详情页 +layout.setting.tabs=标签页 +layout.setting.tabsFoldBtn=标签页折叠按钮 +layout.setting.tabsIcon=标签图标 +layout.setting.tabsQuickBtn=标签页快捷按钮 +layout.setting.tabsRedoBtn=标签页刷新按钮 +layout.setting.toggleLocale=语言切换 +layout.setting.topMenuAlignCenter=居右 +layout.setting.topMenuAlignLeft=居左 +layout.setting.topMenuAlignRight=居中 +layout.setting.topMenuLayout=顶部菜单布局 +layout.setting.triggerClick=点击 +layout.setting.triggerHover=悬停 +routes.basic.emailDetail=查看邮件 +routes.basic.errorLogList=错误日志列表 +routes.basic.externalLink=链接 +routes.basic.home=首页 +routes.basic.login=登录 +routes.basic.previewModel=功能预览 +routes.basic.workFlowDetail=流程详情 +routes.commonWords=审批常用语 +routes.dataReport=报表示例(原) +routes.extend=开发示例 +routes.extend-barCode=条码示例 +routes.extend-bigData=百万数据 +routes.extend-documentPreview=文档示例 +routes.extend-email=邮件收发 +routes.extend-formDemo=表单示例 +routes.extend-formDemo-fieldForm1=表单字段1 +routes.extend-formDemo-fieldForm2=表单字段2 +routes.extend-formDemo-fieldForm3=表单字段3 +routes.extend-formDemo-fieldForm4=表单字段4 +routes.extend-formDemo-fieldForm5=表单字段5 +routes.extend-formDemo-fieldForm6=表单字段6 +routes.extend-formDemo-verifyForm=表单验证 +routes.extend-formDemo-verifyForm1=表单验证1 +routes.extend-functionDemo=功能示例 +routes.extend-graphDemo=图表示例 +routes.extend-graphDemo-echartsBar=E-柱状图 +routes.extend-graphDemo-echartsBarAcross=E-横状条形图 +routes.extend-graphDemo-echartsCandlestick=E-K线图 +routes.extend-graphDemo-echartsFunnel=E-漏斗图 +routes.extend-graphDemo-echartsGauge=E-仪表图 +routes.extend-graphDemo-echartsLineArea=E-线形图 +routes.extend-graphDemo-echartsLineBar=E-折柱混合图 +routes.extend-graphDemo-echartsPie=E-饼状图 +routes.extend-graphDemo-echartsScatter=E-散点图 +routes.extend-graphDemo-echartsTree=E-树形图 +routes.extend-graphDemo-highchartsArea=H-面积图 +routes.extend-graphDemo-highchartsBellcurve=H-贝尔曲线 +routes.extend-graphDemo-highchartsBullet=H-子弹图 +routes.extend-graphDemo-highchartsColumn=H-柱状图 +routes.extend-graphDemo-highchartsFunnel=H-漏斗图 +routes.extend-graphDemo-highchartsGauge=H-仪表图 +routes.extend-graphDemo-highchartsLine=H-线性图 +routes.extend-graphDemo-highchartsPie=H-饼状图 +routes.extend-graphDemo-highchartsScatter=H-散点图 +routes.extend-graphDemo-highchartsWordcloud=H-词云图 +routes.extend-importAndExport=导入导出 +routes.extend-map=地图示例 +routes.extend-order=订单管理 +routes.extend-orderDemo=订单示例 +routes.extend-portalDemo=门户示例 +routes.extend-printData=打印示例 +routes.extend-projectGantt=项目管理 +routes.extend-schedule=日程安排 +routes.extend-signature=电子签名 +routes.extend-signet=电子签章 +routes.extend-tableDemo=表格示例 +routes.extend-tableDemo-commonTable=普通表格 +routes.extend-tableDemo-complexHeader=复杂表头 +routes.extend-tableDemo-extension=延伸扩展 +routes.extend-tableDemo-groupingTable=表格分组 +routes.extend-tableDemo-lockTable=表格锁定 +routes.extend-tableDemo-mergeTable=表格合并 +routes.extend-tableDemo-postilTable=表格批注 +routes.extend-tableDemo-printTable=表格打印 +routes.extend-tableDemo-redactTable=表格编辑 +routes.extend-tableDemo-signTable=表格标记 +routes.extend-tableDemo-statisticsTable=表格统计 +routes.extend-tableDemo-tableTree=表格树形 +routes.extend-tableDemo-treeTable=树形表格 +routes.flowEngine=流程引擎 +routes.formDesign=系统表单 +routes.generator=代码生成 +routes.generator-appForm=移动表单 +routes.generator-flowForm=发起表单 +routes.generator-webForm=功能表单 +routes.lioui=流程示例 +routes.mainSystem=开发平台 +routes.moreMenu=更多... +routes.msgCenter=消息中心 +routes.msgCenter-accountConfig=账号配置 +routes.msgCenter-accountConfig-ding=钉钉配置 +routes.msgCenter-accountConfig-mail=邮箱配置 +routes.msgCenter-accountConfig-mp=微信公众号配置 +routes.msgCenter-accountConfig-shortMsg=短信配置 +routes.msgCenter-accountConfig-webhook=webhook配置 +routes.msgCenter-accountConfig-weCom=企业微信配置 +routes.msgCenter-msgMonitor=消息监控 +routes.msgCenter-msgTemplate=消息模板 +routes.msgCenter-sendConfig=发送配置 +routes.onlineDev=在线开发 +routes.onlineDev-appDesign=移动设计 +routes.onlineDev-dataReport=报表设计(原) +routes.onlineDev-dataScreen=大屏设计 +routes.onlineDev-integration=集成助手 +routes.onlineDev-printDev=打印设计 +routes.onlineDev-report=报表设计 +routes.onlineDev-visualPortal=门户设计 +routes.onlineDev-webDesign=表单设计 +routes.permission=组织权限 +routes.permission-auth=权限管理 +routes.permission-authorize=权限组 +routes.permission-department=部门管理 +routes.permission-grade=管理员 +routes.permission-group=分组管理 +routes.permission-organize=组织管理 +routes.permission-position=岗位管理 +routes.permission-role=角色管理 +routes.permission-user=用户管理 +routes.permission-userOnline=在线用户 +routes.printDemo=打印示例 +routes.report=报表示例 +routes.reportBI=大屏示例 +routes.system=系统管理 +routes.system-area=行政区划 +routes.system-billRule=单据模板 +routes.system-cache=系统缓存 +routes.system-icons=系统图标 +routes.system-kit=表单模板 +routes.system-language=翻译管理 +routes.system-log=系统日志 +routes.system-menu=应用菜单 +routes.system-messageTemplate=消息模板 +routes.system-monitor=系统监控 +routes.system-notice=系统公告 +routes.system-signature=签章管理 +routes.system-smsTemplate=短信模板 +routes.system-sysConfig=系统配置 +routes.system-systemTemplate=系统模板 +routes.system-task=系统调度 +routes.systemData=数据应用 +routes.systemData-dataBackup=数据备份 +routes.systemData-dataInterface=数据接口 +routes.systemData-dataModel=数据建模 +routes.systemData-dataSource=数据连接 +routes.systemData-dataSync=数据同步 +routes.systemData-dictionary=数据字典 +routes.systemData-interfaceAuth=接口认证 +routes.systemData-map=数据地图 +routes.weChat=微信配置 +routes.weChat-mpConfig=公众号配置 +routes.weChat-mpMaterial=公众号素材 +routes.weChat-mpMenu=公众号菜单 +routes.weChat-mpMessage=公众号消息 +routes.weChat-mpUser=公众号用户 +routes.weChat-qyDepartment=企业号组织 +routes.weChat-qyhConfig=企业号配置 +routes.weChat-qyMessage=企业号消息 +routes.weChat-qyUser=企业号用户 +routes.workFlow=协同办公 +routes.workFlow-addFlow=发起流程 +routes.workFlow-document=文档中心 +routes.workFlow-entrust=流程委托 +routes.workFlow-flowCirculate=抄送我的 +routes.workFlow-flowDoing=我的在办 +routes.workFlow-flowDone=我的已办 +routes.workFlow-flowEngine=流程设计 +routes.workFlow-flowLaunch=我发起的 +routes.workFlow-flowMonitor=流程监控 +routes.workFlow-flowTodo=我的待办 +routes.workFlow-flowToSign=我的待签 +routes.workFlow-form=表单设计 +routes.workFlow-printTemplate=打印模板 +routes.workFlow-schedule=日程安排 +routes.workSystem=业务平台 +sys.api.apiRequestFailed=请求出错,请稍候重试 +sys.api.apiTimeoutMessage=接口请求超时,请刷新页面重试! +sys.api.errMsg401=用户没有权限(令牌、用户名、密码错误)! +sys.api.errMsg403=用户得到授权,但是访问是被禁止的。! +sys.api.errMsg404=网络请求错误,未找到该资源! +sys.api.errMsg405=网络请求错误,请求方法未允许! +sys.api.errMsg408=网络请求超时! +sys.api.errMsg500=服务器错误,请联系管理员! +sys.api.errMsg501=网络未实现! +sys.api.errMsg502=网络错误! +sys.api.errMsg503=服务不可用,服务器暂时过载或维护! +sys.api.errMsg504=网络超时! +sys.api.errMsg505=http版本不支持该请求! +sys.api.errorMessage=操作失败,系统异常! +sys.api.errorTip=错误提示 +sys.api.networkException=网络异常 +sys.api.networkExceptionMsg=网络异常,请检查您的网络连接是否正常! +sys.api.operationFailed=操作失败 +sys.api.timeoutMessage=登录超时,请重新登录! +sys.app.logoutMessage=是否确认退出系统? +sys.app.logoutTip=温馨提醒 +sys.app.menuLoading=菜单加载中... +sys.errorLog.enableMessage=只在`/src/settings/projectSetting.ts` 内的useErrorHandle=true时生效. +sys.errorLog.fireAjaxError=点击触发ajax错误 +sys.errorLog.fireResourceError=点击触发资源加载错误 +sys.errorLog.fireVueError=点击触发vue错误 +sys.errorLog.modalTitle=错误详情 +sys.errorLog.tableActionDesc=详情 +sys.errorLog.tableColumnDate=时间 +sys.errorLog.tableColumnFile=文件 +sys.errorLog.tableColumnMsg=错误信息 +sys.errorLog.tableColumnStackMsg=stack信息 +sys.errorLog.tableColumnType=类型 +sys.errorLog.tableTitle=错误日志列表 +sys.exception.backHome=返回首页 +sys.exception.backLogin=返回登录 +sys.exception.networkErrorSubTitle=抱歉,您的网络连接已断开,请检查您的网络! +sys.exception.networkErrorTitle=网络错误 +sys.exception.noDataTitle=当前页无数据 +sys.exception.subTitle403=抱歉,您无权访问此页面。 +sys.exception.subTitle404=抱歉,您访问的页面不存在。 +sys.exception.subTitle500=抱歉,服务器报告错误。 +sys.lock.alert=锁屏密码错误 +sys.lock.backToLogin=返回登录 +sys.lock.entry=进入系统 +sys.lock.placeholder=请输入登录密码 +sys.lock.unlock=点击解锁 +sys.login.accountPlaceholder=请输入账号 +sys.login.accountTip=请输入账号 +sys.login.backSignIn=返回 +sys.login.changeCode=点击切换验证码 +sys.login.codeTip=请输入验证码 +sys.login.codeTitle=手机验证登录 +sys.login.company=请输入公司名 +sys.login.confirmLogin=请在手机端确认登录 +sys.login.confirmPassword=确认密码 +sys.login.contacts=请输入联系人 +sys.login.diffPwd=两次输入密码不一致 +sys.login.email=邮箱 +sys.login.expired=二维码已失效 +sys.login.forgetFormTitle=重置密码 +sys.login.forgetPassword=忘记密码? +sys.login.getCode=获取验证码 +sys.login.lastLoginInfo=上次登录信息 +sys.login.logIn=登录 +sys.login.loginButton=登录 +sys.login.mobile=请输入手机号 +sys.login.mobilePlaceholder=请输入手机号码 +sys.login.mobileSignInFormTitle=手机验证码登录 +sys.login.otherLogin=其他登录方式 +sys.login.otherSignIn=其他登录方式 +sys.login.password=请输入密码 +sys.login.passwordPlaceholder=请输入密码 +sys.login.passwordTip=请输入密码 +sys.login.policy=我同意xxx隐私政策 +sys.login.policyPlaceholder=勾选后才能注册 +sys.login.qrCodeTip=请使用APP扫描二维码登录,180秒后二维码失效 +sys.login.qrSignInFormTitle=扫码登录 +sys.login.recoverCode=取消登录 +sys.login.refreshCode=点击刷新 +sys.login.registerButton=注册 +sys.login.rememberMe=记住我 +sys.login.reSend=重新发送 +sys.login.rightMobile=请输入正确的手机号 +sys.login.rule=租户子账户规则:租户号{'@'}账户 例:18577778888{'@'}101001 +sys.login.scanSign=扫码后点击"确认",即可完成登录 +sys.login.scanSuccessful=扫码成功 +sys.login.scanTip=扫码登录 +sys.login.scanTitle=扫码登录 +sys.login.signInDesc=输入您的个人详细信息开始使用! +sys.login.signInFormTitle=账号密码登录 +sys.login.signInTitle=开箱即用的中后台管理系统 +sys.login.signUpFormTitle=注册 +sys.login.smsCode=请输入验证码 +sys.login.smsPlaceholder=请输入验证码 +sys.login.subTitle=通过账号密码登录 +sys.login.subTitle1=通过手机验证码登录,或者切换为 +sys.login.subTitle2=通过账号密码登录,或者切换为 +sys.login.subTitle3=通过扫码登录,或者切换为 +sys.login.title=账户密码登录 +sys.login.upper=大写已锁定 +sys.login.username=请输入账号 +sys.login.version=版本 +sys.login.welcome=欢迎使用 +sys.validate.arrayRequiredPrefix=请至少选择一个 +sys.validate.date=请输入正确的日期 +sys.validate.email=请输入正确的邮箱 +sys.validate.idCard=请输入正确的身份证号码 +sys.validate.mobilePhone=请输入正确的手机号码 +sys.validate.money=请输入正确的金额 +sys.validate.number=请输入正确的数字 +sys.validate.phone=请输入正确的联系方式 +sys.validate.telephone=请输入正确的电话号码 +sys.validate.textRequiredSuffix=不能为空 +sys.validate.url=请输入正确的网址 +views.dynamicModel.hideSome=隐藏部分 +views.dynamicModel.passwordPlaceholder=请输入密码 +views.dynamicModel.scanAndShare=扫描二维码,分享此链接 +views.dynamicModel.showMore=加载更多 +views.http404.goBackBtn=返回首页 +views.http404.subTips=请检查您输入的URL是否正确,或单击按钮返回首页。 +views.http404.tips=抱歉,你访问的页面不存在或无权访问! diff --git a/yunzhupaas-admin/src/main/resources/i18n/message_en.properties b/yunzhupaas-admin/src/main/resources/i18n/message_en.properties new file mode 100644 index 0000000..c35db30 --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/i18n/message_en.properties @@ -0,0 +1,1236 @@ +AD101=Interface cannot be accessed +AD102=System exception +AD103=Frequent operations +AD104=No access permission, please contact the administrator for authorization +AD105=Authentication failed, unable to access system resources +AD106=Invalid internal authentication, unable to access system resources +COD001=Set condition filtering to obtain an empty target +COPY001=The length of the copied name exceeds the limit length +DB001=The data type encoding does not comply with the standard (please pay attention to capitalization). MySQL , SQLServer , Oracle , DM , KingbaseES , PostgreSQL +DB002=Please check 1. Connection information 2. Network communication 3. Database service startup status. Details: {0} +DB003=Unable to find the corresponding database through URL +DB004=The query result set is empty. +DB005=Corresponding database type not found: {0} ({1}) +DB006=No corresponding data type conversion found +DB007=There are duplicate import table names +DB008=The table data does not match the current operation database: {0} ->{1} +DB009=Table information not found: {0} +DB010=Database {0}, table not found: {1} +DB011=The joint primary key class is missing the '{0}' field value +DB012=Indicates that obtaining the corresponding numerical value has failed +DB013=Currently, the {0} data type: {1} is not supported +DB014=Field '{1}' in table '{0}' is the primary key and does not allow data type '{2}' +DB015=Field SQL statement not found +DB016=No initial fields +DB017=SQL exception: {0} +DB018=Please add the corresponding data table to the database +DB019=Add failed +DB101=The system comes with a table that cannot be deleted +DB102=The system comes with a table that cannot be edited +DB201=The table has already been used and cannot be deleted +DB202=The table has been used and cannot be edited +DB301=Database connection successful +DB302=Database connection failed +ETD101=Operation failed, original file does not exist +ETD102=Cannot find parent level +ETD103=Cannot move to one's own folder +ETD104=Unable to find this order +ETD105=Successfully created 10000 pieces of data +ETD106=Acquisition failed +ETD107=Account authentication error +ETD108=You haven't set up an email account yet +ETD109=File export failed +ETD110=The file format is incorrect +ETD111=File not found +ETD112=This record is associated with a reference and cannot be deleted +ETD113=Prevent malicious creation of excessive data +ETD114=Save failed, please log in again +ETD115=Please enter the preview URL +ETD116=Please choose the correct preview method +ETD117=More than 1000 pieces of data +EXIST001=The name cannot be repeated +EXIST002=Encoding cannot be repeated +EXIST003=The original name already exists +EXIST004=Folder names cannot be duplicated +EXIST005=Template name exceeds the limit length +EXIST101=Duplicate name, please re-enter +EXIST102=Duplicate code, please re-enter +EXIST103=Cannot be repeated +FA001=Data does not exist +FA002=Update failed, data does not exist +FA003=Delete failed, data does not exist +FA004=Copy failed, data does not exist +FA005=Sending failed, data does not exist +FA006=Download failed, data does not exist +FA007=Operation failed, data does not exist +FA008=Stop failed, data does not exist +FA009=Termination failed, data does not exist +FA010=Restoration failed, data does not exist +FA011=Publication failed, data does not exist +FA012=Acquisition failed, data does not exist +FA013=Interface modification failed, data does not exist +FA014=Failed to update interface status, data does not exist +FA015=Preview failed, data does not exist +FA016=Delete failed, the folder contains data +FA017=The file format is incorrect +FA018=file does not exist +FA019=Invalid +FA020=No information found +FA021=Operation failed! You do not have permission to operate +FA022=Update failed! You do not have permission to operate (roles can only be operated by super administrators) +FA023=Update failed! User already bound, unable to switch organizations +FA024=Delete failed! User bound +FA025=The permission within the organization is empty, and the organization switch has failed! +FA026=Update failed, associated organization does not exist, please log in again or refresh the page +FA027=The menu under this system is empty, and the system switch has failed +FA028=Failed to add data +FA029=Data modification failed +FA030=Update failed! User bound, unable to modify status +FA031=The organization does not have permission for this application, and the switch has failed +FA032=The uploaded file cannot be empty +FA033=File upload failed! +FA034=Illegal request, lack of authentication information +FA035=Failed to obtain tenant specified data source information +FA036=Common data already exists +FA037=Interface request failed +FA038=File storage path error +FA039=The link has expired +FA040=Preview failed, please check if the file type is standardized +FA041=Preview failed, please upload the file again +FA042=Please enter the correct file format +FA043=There is a file with the same name! +FA044=The file does not exist +FA045=Deleting file: {0} failed +FA046=File read failed +FA047=No files found +FA048=The original ID of WeChat official account cannot be duplicated +FA049=This record is associated with the 'Message Sending Configuration' reference and cannot be disabled +FA050=This record is associated with the 'Message Sending Configuration' reference and cannot be deleted +FA051=The interface has been configured with encryption, but data decryption has failed +FA052=This identity has not been assigned permissions +FA101=Save failed +FA102=Update failed +FA103=Delete failed +FA104=Acquisition failed +FA105=Preview failed, please save in preview data first +FA106=Preview failed, dead loop in cell configuration +FM001=Interface not found +FM002=The form information does not exist +FM003=Duplicate sub table +FM004=The maximum limit for copying this template has been reached. Please copy the source template! +FM005=This form has been referenced by the process and cannot be deleted! +FM006=This form has not been published, and the form content cannot be rolled back +FM007=The form content in this template is empty and cannot be published +FM008=This feature has not imported the process form +FM009=Process not designed, please design the process first! +FM010=This function process is in a disabled state! +FM011=Table [{0}] has no primary key! +FM012=Primary key policy: {0}, inconsistent with the primary key policy of table [{1}]! +FM013=Table addition error: {0} +GT101=success +GT102=fail +GT103=Verification error +GT104=abnormal +GT105=Login expired, please log in again +GT106=Your account has been logged in elsewhere and has been forcibly kicked out +GT107=Token verification failed +GT108=Request exceeds the maximum number +IMP001=Import successful +IMP002=Import failed, file format error +IMP003=Import failed, data already exists +IMP004=Import failed, data error +IMP005=Export failed +IMP006=The imported data format is incorrect +IMP007=Repeat +IMP008=Name +IMP009=Encoding +IMP010=Import failed, unable to query superior classification +IMP011=Please select the export field +LOG001=Account abnormality +LOG002=Cancellation successful +LOG004=Account exception, please contact the administrator to modify the organization information +LOG005=Account not activated +LOG006=Account has been disabled +LOG007=The account has been deleted +LOG010=This IP is not on the whitelist +LOG011=Login failed, user has not yet bound role +LOG012=The account has been locked. Please contact the administrator to unlock it +LOG101=Account or password error +LOG102=Account error, please re-enter +LOG103=Please enter the verification code +LOG104=Verification code error +LOG105=Failed to connect to tenant service, please try again later +LOG106=SMS verification code error +LOG107=The verification code has expired +LOG108=Please wait {0} minutes before logging in, or contact the administrator to unlock +LOG109=Tenant login failed, please use mobile verification code to log in +LOG110=Database exception, please contact the administrator for handling +LOG111=Single sign on has been enabled, this login method is not supported +LOG112=This login method is not supported +LOG113=Tenant information not set +LOG114=Tenant code cannot be empty +LOG115=Tenant information acquisition failed +LOG116=This verification is not supported +LOG117=SMS verification code verification failed: {0} +LOG118=Tenant library name is empty +LOG201=Old password incorrect +LOG202=Modified successfully, please remember the new password +LOG203=Modification failed, account does not exist +LOG204=Modification failed, new password cannot be the same as old password +LOG205=Password reset successful +LOG206=Password reset failed +MSERR101=Sending failed, reason for failure: SMTP service is empty +MSERR102=Sending failed, reason for failure: sender email is empty +MSERR103=Sending failed, reason for failure: sender password is empty +MSERR104=Sending failed, reason for failure: recipient is empty +MSERR105=Sending failed. Reason for failure: The format of the email account for {0} is incorrect! +MSERR106=Sending failed. Reason for failure: The email account for {0} is empty! +MSERR107=Sending failed. Reason for failure: All email addresses corresponding to the recipient are empty +MSERR108=Sending failed. Reason for failure: {0} +MSERR109=Connection successful +MSERR110=Connection failed. Reason for failure: {0} +MSERR111=has been sent +MSERR112=The content cannot contain {1} +DB009=未找到表信息: {0} +DB010=数据库{0},未找到此表:{1} +DB011=联合主键类缺少“{0}”字段值 +DB012=表示对应获取数值失败 +DB013=目前还未支持{0}数据类型:{1} +DB014=表 "{0}"中字段 "{1}" 为主键,不允许数据类型 "{2}" +DB015=未找到字段SQL语句 +DB016=没有初始字段 +DB017=sql异常:{0} +DB018=请在数据库中添加对应的数据表 +DB019=添加失败 +DB101=系统自带表,不允许被删除 +DB102=系统自带表,不允许被编辑 +DB201=表已经被使用,不允许被删除 +DB202=表已经被使用,不允许被编辑 +DB301=数据库连接成功 +DB302=数据库连接失败 +ETD101=操作失败,原文件不存在 +ETD102=找不到父级 +ETD103=不能移动到自己的文件夹 +ETD104=未能找到此订单 +ETD105=新建成功10000条数据 +ETD106=获取失败 +ETD107=账户认证错误 +ETD108=你还没有设置邮件的帐户 +ETD109=文件导出失败 +ETD110=文件格式不正确 +ETD111=文件找不到 +ETD112=此记录被关联引用,不允许被删除 +ETD113=防止恶意创建过多数据 +ETD114=保存失败,请重新登陆 +ETD115=请输入预览的url +ETD116=请选择正确的预览方式 +ETD117=数据超过1000条 +EXIST001=名称不能重复 +EXIST002=编码不能重复 +EXIST003=模板名已存在 +EXIST004=文件夹名称不能重复 +EXIST005=模板名称超过了限制长度 +EXIST101=名称重复,请重新输入 +EXIST102=编码重复,请重新输入 +EXIST103=不能重复 +FA001=数据不存在 +FA002=更新失败,数据不存在 +FA003=删除失败,数据不存在 +FA004=复制失败,数据不存在 +FA005=发送失败,数据不存在 +FA006=下载失败,数据不存在 +FA007=操作失败,数据不存在 +FA008=停止失败,数据不存在 +FA009=终止失败,数据不存在 +FA010=还原失败,数据不存在 +FA011=发布失败,数据不存在 +FA012=获取失败,数据不存在 +FA013=接口修改失败,数据不存在 +FA014=更新接口状态失败,数据不存在 +FA015=预览失败,数据不存在 +FA016=删除失败,该文件夹存在数据 +FA017=文件格式不正确 +FA018=文件不存在 +FA019=已失效 +FA020=未查到信息 +FA021=操作失败!您没有权限操作 +FA022=更新失败!您没有权限操作 (角色只有超级管理员才能够操作) +FA023=更新失败!已绑定用户,无法切换组织 +FA024=删除失败!已绑定用户 +FA025=该组织内权限为空,组织切换失败! +FA026=更新失败,关联组织不存在,请重新登录,或者刷新页面 +FA027=该系统下菜单为空,系统切换失败 +FA028=新增数据失败 +FA029=修改数据失败 +FA030=更新失败!已绑定用户,无法修改状态 +FA031=该组织无本应用权限,切换失败 +FA032=上传文件不能为空 +FA033=文件上传失败! +FA034=非法请求, 缺少认证信息 +FA035=未获取到租户指定数据源信息 +FA036=常用数据已存在 +FA037=接口请求失败 +FA038=文件存储路径错误 +FA039=链接已失效 +FA040=预览失败,请检查文件类型是否规范 +FA041=预览失败,请重新上传文件 +FA042=请输入正确的文件格式 +FA043=存在同名文件! +FA044=不存在该文件 +FA045=删除文件:{0}失败 +FA046=文件读取失败 +FA047=未发现文件 +FA048=微信公众号原始id不能重复 +FA049=此记录与“消息发送配置”关联引用,不允许被禁用 +FA050=此记录与“消息发送配置”关联引用,不允许被删除 +FA051=接口已配置加密, 数据解密失败. +FA052=该身份未分配权限 +FA101=保存失败 +FA102=更新失败 +FA103=删除失败 +FA104=获取失败 +FA105=预览失败,请先保存在预览数据 +FA106=预览失败,单元格配置出现死循环 +FM001=未找到接口 +FM002=表单信息不存在 +FM003=子表重复 +FM004=已到达该模板复制上限,请复制源模板! +FM005=该表单已被流程引用,无法删除! +FM006=该表单未发布,无法回滚表单内容 +FM007=该模板内表单内容为空,无法发布 +FM008=该功能未导入流程表单 +FM009=流程未设计,请先设计流程! +FM010=该功能流程处于停用状态! +FM011=表[{0}]无主键! +FM012=主键策略:{0},与表[{1}]主键策略不一致! +FM013=表新增错误:{0} +GT101=成功 +GT102=失败 +GT103=验证错误 +GT104=异常 +GT105=登录过期,请重新登录 +GT106=您的帐号在其他地方已登录,被强制踢出 +GT107=Token验证失败 +GT108=请求超过最大数 +IMP001=导入成功 +IMP002=导入失败,文件格式错误 +IMP003=导入失败,数据已存在 +IMP004=导入失败,数据有误 +IMP005=导出失败 +IMP006=导入数据格式不正确 +IMP007=重复 +IMP008=名称 +IMP009=编码 +IMP010=导入失败,查询不到上级分类 +IMP011=请选择导出字段 +LOG001=账户异常 +LOG002=注销成功 +LOG004=账号异常,请联系管理员修改所属组织信息 +LOG005=账号未被激活 +LOG006=账号已被禁用 +LOG007=账号已被删除 +LOG010=此IP未在白名单中 +LOG011=登录失败,用户暂未绑定角色 +LOG012=账号已被锁定,请联系管理员解除锁定 +LOG101=账号或密码错误 +LOG102=账号有误,请重新输入 +LOG103=请输入验证码 +LOG104=验证码错误 +LOG105=连接租户服务失败,请稍后再试 +LOG106=短信验证码错误 +LOG107=验证码已失效 +LOG108=请等待{0}分钟后再进行登录,或联系管理员解除锁定 +LOG109=租户登录失败,请用手机验证码登录 +LOG110=数据库异常,请联系管理员处理 +LOG111=已开启单点登录, 不支持此登录方式 +LOG112=不支持此登录方式 +LOG113=未设置租户信息 +LOG114=租户编码不允许为空 +LOG115=租户信息获取失败 +LOG116=不支持此验证 +LOG117=短信验证码验证失败:{0} +LOG118=租户库名为空 +LOG201=旧密码错误 +LOG202=修改成功,请牢记新密码 +LOG203=修改失败,账号不存在 +LOG204=修改失败,新建密码不能与旧密码一样 +LOG205=重置密码成功 +LOG206=重置密码失败 +MSERR101=发送失败,失败原因:SMTP服务为空 +MSERR102=发送失败,失败原因:发件人邮箱为空 +MSERR103=发送失败,失败原因:发件人密码为空 +MSERR104=发送失败,失败原因:接收人为空 +MSERR105=发送失败。失败原因:{0}的邮箱账号格式有误! +MSERR106=发送失败。失败原因:{0}的邮箱账号为空! +MSERR107=发送失败。失败原因:接收人对应的邮箱全部为空 +MSERR108=发送失败。失败原因:{0} +MSERR109=连接成功 +MSERR110=连接失败。失败原因:{0} +MSERR111=已发送 +MSERR112=内容不能包含<符号 +MSERR113=暂无未读消息 +MSERR114=自定义模板编码不能使用系统模板编码规则 +MSERR115=创建失败,存在多个标题参数 +MSERR116=创建失败,不存在标题参数 +MSERR117=更新失败,存在多个标题参数 +MSERR118=更新失败,不存在标题参数 +MSERR119=请先前往系统同步设置,配置钉钉账号 +MSERR120=请先前往系统同步设置,配置企业微信账号 +MSERR121=配置模板无数据,无法测试 +OA001=用户登录 +OA002=设备 +OA003=TOKEN +OA004=用户退出 +OA005=用户踢出 +OA006=用户顶替 +OA007=登录异常 +OA008=登录获取系统配置失败 +OA009=该用户未分配权限 +OA010=仅支持pc端访问,APP端不支持 +OA011=应用不存在 +OA012=当前应用已被禁用 +OA013=登录密码解密失败 +OA014=注销成功 +OA015=登录成功 +OA016=登录票据已失效 +OA017=第三方未绑定账号 +OA018=不允许访问此登录接口 +OA019=账号不存在 +OA020=账户或密码错误,请重新输入 +OA021=验证成功 +OA022=限制会话, 不允许访问系统 +OA023=管理员不能注销 +OA024=登录失败 +OA025=超级管理员 +OA026=普通管理员 +OA027=普通用户 +OA028=未知来源 +PRI001=打印模板不存在 +PRI002=数字字典不存在printDev的字典分类 +PRI003=第1条SQL语句:查询出多条表头信息 +PRI004=第1条SQL语句:未查出表头信息 +PRI005=第{index}条SQL语句: +PRI006=已到达该模板复制上限,请复制源模板 +PRI007=Sql语法错误 +PRI008=该报表已删除 +PS001=此记录与"{0}"关联引用,不允许被删除 +PS003=组织 +PS004=岗位 +PS005=用户 +PS006=角色 +PS007=账号不能为空 +PS008=姓名不能为空 +PS009=用户额度已达到上限 +PS010=权限已变更,请重新登录 +PS011=密码已变更,请重新登录 +PS012=类型不能为空 +PS013=当前机构Id不能与父机构Id相同 +PS014=该应用已禁用 +PS015=无法设置当前用户为分级管理员 +PS016=无法设置超管为分级管理员 +PS017=无法设置当前用户操作权限 +PS018=解绑失败 +PS019=第三方登录未配置 +PS020=性别不能为空 +PS021=无法禁用管理员用户 +PS022=管理员只能修改自己,不能修改其他管理员 +PS023=无法修改管理员账户 +PS024=直属主管不能是自己 +PS025=直属主管不能是我的下属用户 +PS026=无法删除管理员账户 +PS027=此用户为某部门主管,无法删除 +PS028=此用户有下属,无法删除 +PS029=无法修改管理员账户状态 +PS030=用户信息已变更,请重新登录 +PS031=该应用已删除 +PS032=该组织无本应用权限,切换失败 +PS033=工作交接成功! +PS034=工作交接无法转移给管理员 +PS035=工作交接无法转移给本人 +SC001=操作失败,任务不存在 +SU000=Success +SU001=新建成功 +SU002=保存成功 +SU003=删除成功 +SU004=更新成功 +SU005=操作成功 +SU006=提交成功,请耐心等待 +SU007=复制成功 +SU008=停止成功 +SU009=终止成功 +SU010=还原成功 +SU011=发布成功 +SU012=发送成功 +SU013=接口修改成功 +SU014=更新接口状态成功 +SU015=上传成功 +SU016=设置成功 +SU017=验证成功 +SU018=添加成功 +SU019=获取成功 +SU020=回滚成功 +SU021=移除成功 +SU022=查询成功 +SYS001=区域编码不能重复 +SYS002=删除失败,当前有子节点数据 +SYS003=单据已经被使用,不允许被删除 +SYS004=清理成功 +SYS005=接口创建成功 +SYS006=当前SQL含有敏感字:{0} +SYS007=接口请求成功 +SYS008=接口不符合规范 +SYS009=变量名不能包含敏感字符 +SYS010=变量名已存在 +SYS011=数据库连接不能相同 +SYS012=请检查,同一数据库下无法同步数据 +SYS013=同步失败:{0} +SYS014=字典类型下面有字典值禁止删除 +SYS015=模板不存在 +SYS016=当前目录存在数据,不能修改类型 +SYS017=删除失败,请先删除子菜单 +SYS018=当前导入菜单为{0}端菜单,请在对应模块下导入! +SYS019=请在顶级节点下创建目录后再进行菜单导入 +SYS020=该字段在方案{0}中已被使用 +SYS021=修改失败,该方案不允许编辑 +SYS022=编码错误 +SYS023=请求发生错误! +SYS024=获取不到数据! +SYS025=获取企业微信access_token失败 +SYS026=正在进行同步,请稍后再试 +SYS027=请先从企业微信同步部门到本地 +SYS028=请先从钉钉同步部门到本地 +SYS029=验证码位数不能大于6 +SYS030=验证码位数不能小于3 +SYS031=测试发送消息的连接失败:{0} +SYS032=测试发送消息连接成功 +SYS033=测试组织同步的连接失败:{0} +SYS034=测试组织同步连接成功 +SYS035=测试连接类型错误 +SYS036=测试钉钉连接失败: +SYS037=测试连接成功 +SYS038=表信息抽取异常 +SYS039=删除失败,请先删除该应用下的菜单和门户 +SYS040=删除失败,请先删除该应用下的菜单 +SYS041=删除失败,请先删除该应用下的门户 +SYS042=该日程已被删除 +SYS043=最后一条数据不能删除 +SYS044=启用版本不能删除 +SYS045=归档版本不能删除 +SYS046=数据集不能重名 +SYS047=SQL语句仅支持查询语句 +SYS048=SQL语句需带上@formId条件 +SYS049=正在进行同步,请稍等 +SYS050=只能输入字母、数字、点、横线和下划线,且以字母开头 +SYS051=翻译标记不能重复 +SYS052=翻译语言至少填写一项 +SYS053=获取钉钉access_token失败 +SYS101=更新失败,主系统不允许禁用 +SYS102=主系统不允许删除 +SYS103=系统在审批常用语中被使用,不允许删除 +SYS104=更新失败,主系统不允许修改编码 +SYS105=常用语已存在 +SYS121=接口暂只支持HTTP和HTTPS方式 +SYS122=接口请求失败 +SYS123=接口请求失败, JS调用失败,错误:{0} +SYS124=验证请求超时 +SYS125=appSecret错误 +SYS126=appId使用期限已到期 +SYS127=appId参数错误 +SYS128={0}不能使用系统、开发语言及数据库关键字命名 +SYS129=当前数据源不支持全连接 +SYS130=标题不能为空 +SYS131=结束时间必须晚于开始时间 +SYS132=结束重复必须晚于开始时间 +VS001=同步到流程时,{0} +VS002=发布失败,流程未设计! +VS003=无表生成有表失败 +VS004=发布 +VS005=预览 +VS006=下载 +VS007=同步成功 +VS008=回滚失败,暂无线上版本 +VS009=参数解析错误! +VS010=无效链接 +VS011=密码错误 +VS012=未找到该功能表单 +VS013=未开启表单外链! +VS014=下载链接已失效 +VS015=字段不能为空 +VS016=路径错误 +VS017=集成助手被禁用 +VS018=表规范名称不能重复 +VS019=规范名称不能使用系统关键字或JAVA关键字 +VS020=字段规范名称不能重复 +VS021=“{0}”命名不符合规范 +VS022=主键策略:[雪花ID],表[ {0} ]主键设置不支持! +VS023=主键策略:[自增ID],表[ {0} ]主键设置不支持! +VS024=表单不存在或者未发布! +VS025=未获取到流程发起人 +VS026=规范名称前两字母必须小写 +VS027=自动生成的【{0}】超出长度,提交失败! +VS028=视图最多新建5个 +VS401=该模板内表单内容为空,无法 +VS402=该模板内列表内容为空,无法 +VS403=该功能未配置流程不可用 +VS404=单行输入不能重复 +VS405=当前表单原数据已被调整,请重新进入该页面编辑并提交数据 +VS406=该功能配置的流程处于停用 +VS407=表头名称不可更改,表头行不能删除 +VS408=请至少选择一个数据表 +VS409=未找到主表信息 +VS410=请导入对应功能的json文件 +VS411=已存在相同功能 +VS412=该表单已删除 +VS413=应用不能为空 +VS414=门户数据信息存在重复 +VS415=该门户已删除 +WF001=审核成功 +WF002=退回成功 +WF003=转办成功 +WF004=加签成功 +WF005=当前流程被退回,无法撤回流程 +WF006=流程已撤回,不能重复操作 +WF007=撤回失败,转向数据无法撤回 +WF008=撤回成功 +WF009=功能流程不能终止 +WF010=指派成功 +WF011=批量操作完成 +WF012=该流程不能操作 +WF013=复活成功 +WF014=变更成功 +WF015=挂起成功 +WF016=恢复成功 +WF017=委托人和被委托人相同,委托失败 +WF018=操作失败,同一时间内有相同流程的委托 +WF019=操作失败,同一时间内有相同流程,不能相互委托 +WF020=功能流程不能删除 +WF021=不能删除 +WF022=催办成功 +WF023=未找到催办人 +WF024=该功能已被流程引用,请重新选择关联功能 +WF025=启用失败,流程未设计 +WF026=启用成功 +WF027=禁用成功 +WF028=该版本内有工单任务流转,无法删除 +WF029=您没有发起该流程的权限 +WF030=表单未找到 +WF031=已审核完成 +WF032=冻结不能操作 +WF033=转向节点不存在或配置错误 +WF034=转向失败,转向节点未审批 +WF035=退回至您的审批,不能再发起退回 +WF036=流程已处理,无法撤回 +WF037=当前流程包含子流程,无法撤回 +WF038=子流程无法撤回 +WF039=下一节点为选择分支无法批量审批 +WF040=条件流程包含候选人无法批量通过 +WF041=该流程工单已终止 +WF042=该流程工单已撤回 +WF043=该节点没有数据,无法复活 +WF044=此流程不支持变更 +WF045=当前节点有子流程无法变更 +WF046=退回节点包含子流程,退回失败 +WF047=当前节点未审批,不能退回 +WF048=流程处于挂起状态,不可操作 +WF049=当前流程正在运行不能删除 +WF050=已被挂起不能删除 +WF051=没有删除权限 +WF052=主版本没有内容 +WF053=流程没有启用 +WF054=流程编码不能重复 +WF055=流程表单不一致,请重新选择 +WF056=该流程由在线开发生成的,无法直接删除,请在功能设计中删除相关功能 +WF057=该流程内工单任务流转未结束,无法删除 +WF058=当前流程正在运行不能重复提交 +WF059=流程自动发起审批失败 +WF060=驳回节点不能是子流程 +WF061=下一节点无审批人员请联系管理员 +WF062=表单已被引用,请重新选择 +WF063=流程已发起,无法删除 +WF064=任务不存在,或者已处理 +WF065=拒绝成功 +WF066=同意成功 +WF067=协办成功 +WF068=协办保存成功 +WF069=减签成功 +WF070=撤销成功 +WF071=最后一条数据不能删除 +WF072=启用版本不能删除 +WF073=归档版本不能删除 +WF074=暂停成功 +WF075=条件不满足无法流转 +WF076=节点不存在 +WF077=流程无法撤回 +WF078=流程未同意,无法撤销 +WF079=归档异常 +WF080=选择的数据不能退签 +WF081=无法加签 +WF082=无法减签 +WF083=无法退回 +WF084=无法转审 +WF085=无法协办 +WF086=无法批量审批 +WF087=经办未签收 +WF088=经办未开始办理 +WF089=流程发布失败 +WF090=流程发布失败 +WF091=流程提交失败 +WF092=获取引擎当前任务失败 +WF093=流程删除失败 +WF094=获取出线集合失败 +WF095=获取线之后的任务节点失败 +WF096=获取下一级任务节点集合失败 +WF097=获取上一级任务节点集合失败 +WF098=任务完成失败 +WF099=获取流程实例失败 +WF100=获取未经过的节点失败 +WF101=获取节点的后续节点失败 +WF102=获取可回退的节点失败 +WF103=退回失败 +WF104=节点跳转失败 +WF105=补偿失败 +WF106=不能加签给自己 +WF107=不能转审给自己 +WF108=不能协办给自己 +WF109=必须保留一名加签人员 +WF110=审批异常无法撤销 +WF111=所选流程包含条件候选人 +WF112=选择的数据对应流程已暂停 +WF113=已被暂停不能删除 +WF114=流程处于暂停状态,不可操作 +WF115=流程已受理,无法删除 +WF116=不能加签给委托人 +WF117=不能转审给委托人 +WF118=不能协办给委托人 +WF119=设置了流转条件,无法批量审批 +WF120=下一节点审批异常,无法批量审批 +WF121=子流程自动发起审批失败 +WF122=流程不存在 +WF123=流程处于终止状态,不可操作 +WF124=该流程已发起数据,无法删除! +WF125=您没有发起委托流程 +WF126=撤销流程不能转审 +WF127=撤销流程不能退回 +WF128=该用户已审批,请重新打开界面 +WF129=委托人已无该流程权限 +WF130=管理员不能新建委托/代理 +WF131=不能选择admin +WF132=已有人接受,不可编辑 +WF133=流转条件不满足,无法自动发起审批 +WF134=第一个审批节点设置候选人,无法自动发起审批 +WF135=第一个审批节点异常,无法自动发起审批 +WF136=找不到发起人,发起失败 +WF137=代理人和被代理人相同,代理失败 +WF138=存在未签收的数据,无法关闭 +WF139=该流程已触发了任务,无法删除 +WF144=操作失败,同一时间内有相同流程的代理 +WF145=操作失败,同一时间内有相同流程,不能相互代理 +app.apply.expandData=展开数据 +app.apply.location.location=添加定位 +app.apply.location.modalTitle=选择位置 +app.apply.location.relocation=重新定位 +app.apply.noMoreData=没有更多数据 +app.apply.pleaseKeyword=请输入关键字搜索 +app.apply.screen=筛选 +app.apply.sort=排序 +app.my.accountSecurity=账号安全 +app.my.agencyMe=代理给我 +app.my.allFlow=全部流程 +app.my.entrustedAgency=委托代理 +app.my.entrustMe=委托给我 +app.my.flowSelect=流程选择 +app.my.logOut=退出登录 +app.my.myAgency=我的代理 +app.my.myEntrust=我的委托 +app.my.organization=我的组织 +app.my.position=我的岗位 +app.my.scanCode=扫一扫 +app.my.setting=设置 +app.my.settings.About=关于平台 +app.my.settings.changePassword=修改密码 +app.my.settings.contact=联系我们 +app.my.settings.language=多语言 +app.my.settings.privacyPolicy=隐私政策 +app.my.settings.userAgreement=用户协议 +app.my.sto=终止 +app.my.subordinates=我的下属 +app.my.switchIdentity=切换身份 +common.add1Text=添加 +common.add2Text=新增 +common.addText=新建 +common.back=返回 +common.batchDelText=批量删除 +common.batchDelTip=您确定要删除这些数据吗, 是否继续? +common.batchPrintText=批量打印 +common.cancelText=取消 +common.chooseText=请选择 +common.chooseTextPrefix=请选择 +common.cleanText=清空 +common.closeList=关闭列表 +common.closeText=关闭 +common.collapseAll=折叠 +common.continueAndAddText=确定并新增 +common.continueText=确定并继续 +common.copyText=复制 +common.dark=黑暗主题 +common.delText=删除 +common.delTip=此操作将永久删除该数据, 是否继续? +common.detailText=详情 +common.drawerSearchText=请输入关键词 +common.editText=编辑 +common.enterKeyword=请输入关键词 +common.expandAll=展开 +common.exportText=导出 +common.importText=导入 +common.inputPlaceholder=请输入 +common.inputText=请输入 +common.inputTextPrefix=请输入 +common.keyword=关键词 +common.leftTreeSearchText=请输入关键词 +common.light=亮色主题 +common.loadingText=加载中... +common.moreText=更多 +common.next=下一步 +common.nextRecord=下一条 +common.noData=暂无数据 +common.okText=确定 +common.prev=上一步 +common.previewText=预览 +common.prevRecord=上一条 +common.printText=打印 +common.queryText=查询 +common.redo=刷新 +common.redoText=重做 +common.resetText=重置 +common.saveText=保存 +common.searchText=搜索 +common.selectDataTip=请选择一条数据 +common.selectI18nCode=选择翻译标记 +common.selectPlaceholder=请选择 +common.submitText=提交 +common.superQuery=高级查询 +common.syncText=第三方同步 +common.tipTitle=提示 +common.undoText=撤销 +component.app.searchNotData=暂无搜索结果 +component.app.toNavigate=切换 +component.app.toSearch=确认 +component.countdown.normalText=获取验证码 +component.countdown.sendText={0}秒后重新获取 +component.cropper.btn_reset=重置 +component.cropper.btn_rotate_left=逆时针旋转 +component.cropper.btn_rotate_right=顺时针旋转 +component.cropper.btn_scale_x=水平翻转 +component.cropper.btn_scale_y=垂直翻转 +component.cropper.btn_zoom_in=放大 +component.cropper.btn_zoom_out=缩小 +component.cropper.modalTitle=头像上传 +component.cropper.okText=确认并上传 +component.cropper.preview=预览 +component.cropper.selectImage=选择图片 +component.cropper.uploadSuccess=上传成功 +component.drawer.cancelText=关闭 +component.drawer.loadingText=加载中... +component.drawer.okText=确认 +component.excel.exportModalTitle=导出数据 +component.excel.fileName=文件名 +component.excel.fileType=文件类型 +component.form.apiSelectNotFound=请等待数据加载完成... +component.form.fold=收起 +component.form.maxTip=字符数应小于{0}位 +component.form.unfold=展开 +component.icon.copy=复制图标成功! +component.icon.placeholder=点击选择图标 +component.icon.search=搜索图标 +component.com.yunzhupaas.areaSelect.modalTitle=省市区 +component.com.yunzhupaas.calculate.storage=用于展示计算结果,且数据同时会保存入库 +component.com.yunzhupaas.calculate.unStorage=用于展示计算结果,且数据不会保存 +component.com.yunzhupaas.common.allData=全部数据 +component.com.yunzhupaas.common.autoGenerate=系统自动生成 +component.com.yunzhupaas.common.clearAll=清空列表 +component.com.yunzhupaas.common.selected=已选 +component.com.yunzhupaas.dateRange.endPlaceholder=结束日期 +component.com.yunzhupaas.dateRange.startPlaceholder=开始日期 +component.com.yunzhupaas.depSelect.modalTitle=选择部门 +component.com.yunzhupaas.groupSelect.modalTitle=选择分组 +component.com.yunzhupaas.iconPicker.modalTitle=图标选择 +component.com.yunzhupaas.iconPicker.searchPlaceholder=请输入关键词 +component.com.yunzhupaas.iconPicker.select=选择 +component.com.yunzhupaas.iconPicker.ymCustom=ymCustom图标 +component.com.yunzhupaas.iconPicker.ymIcon=ymIcon图标 +component.com.yunzhupaas.location.location=添加定位 +component.com.yunzhupaas.location.modalTitle=选择位置 +component.com.yunzhupaas.location.relocation=重新定位 +component.com.yunzhupaas.location.searchPlaceholder=搜索或直接在地图上点选 +component.com.yunzhupaas.numberRange.max=最大值 +component.com.yunzhupaas.numberRange.min=最小值 +component.com.yunzhupaas.organizeSelect.modalTitle=选择组织 +component.com.yunzhupaas.popupAttr.storage=用于展示关联弹窗的属性,且数据同时会保存入库 +component.com.yunzhupaas.popupAttr.unStorage=用于展示关联弹窗的属性,且数据不会保存 +component.com.yunzhupaas.popupSelect.modalTitle=选择数据 +component.com.yunzhupaas.posSelect.modalTitle=选择岗位 +component.com.yunzhupaas.relationFormAttr.storage=用于展示关联表单的属性,且数据同时会保存入库 +component.com.yunzhupaas.relationFormAttr.unStorage=用于展示关联表单的属性,且数据不会保存 +component.com.yunzhupaas.roleSelect.modalTitle=选择角色 +component.com.yunzhupaas.sign.operateTip=请在此区域使用鼠标手写签名 +component.com.yunzhupaas.sign.signPlaceholder=请签名 +component.com.yunzhupaas.sign.signTip=手写签名 +component.com.yunzhupaas.timeRange.endPlaceholder=结束时间 +component.com.yunzhupaas.timeRange.startPlaceholder=开始时间 +component.com.yunzhupaas.userSelect.modalTitle=选择用户 +component.menu.search=菜单搜索 +component.modal.cancelText=关闭 +component.modal.close=关闭 +component.modal.maximize=最大化 +component.modal.okText=确认 +component.modal.restore=还原 +component.table.action=操作 +component.table.index=序号 +component.table.settingColumn=列设置 +component.table.settingColumnShow=列展示 +component.table.settingDens=密度 +component.table.settingDensDefault=默认 +component.table.settingDensMiddle=中等 +component.table.settingDensSmall=紧凑 +component.table.settingFixedLeft=固定到左侧 +component.table.settingFixedRight=固定到右侧 +component.table.settingFullScreen=全屏 +component.table.settingIndexColumnShow=序号列 +component.table.settingSelectColumnShow=勾选列 +component.table.status=状态 +component.table.summary=合计 +component.table.total=共 {total} 条数据 +component.time.after=后 +component.time.before=前 +component.time.days=天 +component.time.hours=小时 +component.time.just=刚刚 +component.time.minutes=分钟 +component.time.seconds=秒 +component.tree.checkStrictly=层级关联 +component.tree.checkUnStrictly=层级独立 +component.tree.expandAll=展开全部 +component.tree.reload=刷新数据 +component.tree.selectAll=选择全部 +component.tree.unExpandAll=折叠全部 +component.tree.unSelectAll=取消选择 +component.upload.accept=支持{0}格式 +component.upload.acceptUpload=只能上传{0}格式文件 +component.upload.audio=音频 +component.upload.buttonText=点击上传 +component.upload.checking=文件校验中 +component.upload.choose=选择文件 +component.upload.del=删除 +component.upload.download=下载 +component.upload.downloadAll=全部下载 +component.upload.fileMaxNumber=最多可以上传{0}个文件 +component.upload.fileMaxSize=文件大小超过{size}{unit} +component.upload.fileName=文件名 +component.upload.fileReadError=文件{0}读取出错,请检查该文件 +component.upload.fileSize=文件大小 +component.upload.fileStatue=状态 +component.upload.fileTypeCheck=请选择{0}类型的文件 +component.upload.image=图片 +component.upload.imageMaxNumber=最多可以上传{0}张图片 +component.upload.imageMaxSize=图片大小超过{size}{unit} +component.upload.imgUpload=图片上传 +component.upload.legend=略缩图 +component.upload.maxNumber=最多只能上传{0}个文件 +component.upload.maxSize=单个文件不超过{0}MB +component.upload.maxSizeMultiple=只能上传不超过{0}MB的文件! +component.upload.operating=操作 +component.upload.paused=暂停中 +component.upload.preview=预览 +component.upload.reUploadFailed=重新上传失败文件 +component.upload.save=保存 +component.upload.saveError=没有上传成功的文件,无法保存! +component.upload.saveWarn=请等待文件上传后,保存! +component.upload.startUpload=开始上传 +component.upload.upload=上传 +component.upload.uploaded=已上传 +component.upload.uploadError=上传失败 +component.upload.uploadImg=请上传图片 +component.upload.uploading=上传中 +component.upload.uploadSuccess=上传成功 +component.upload.uploadWait=请等待文件上传结束后操作 +component.upload.video=视频 +component.upload.videoNoPreview=音视频文件不能预览 +component.upload.view=查看 +component.upload.viewImage=查看图片 +component.upload.waiting=等待中 +component.upload.zipNoPreview=压缩包不能预览 +component.verify.dragText=请按住滑块拖动 +component.verify.error=验证失败! +component.verify.redoTip=点击图片可刷新 +component.verify.successText=验证通过 +component.verify.time=验证校验成功,耗时{time}秒! +formGenerator.cleanComponentTip=确定要清空所有组件吗? +formGenerator.component.alert=提示 +formGenerator.component.areaSelect=省市区域 +formGenerator.component.autoComplete=下拉补全 +formGenerator.component.barcode=条形码 +formGenerator.component.billRule=单据组件 +formGenerator.component.button=按钮 +formGenerator.component.calculate=计算公式 +formGenerator.component.card=卡片容器 +formGenerator.component.cascader=级联选择 +formGenerator.component.checkbox=多选框组 +formGenerator.component.collapse=折叠面板 +formGenerator.component.colorPicker=颜色选择 +formGenerator.component.createTime=创建时间 +formGenerator.component.createUser=创建人员 +formGenerator.component.currOrganize=所属组织 +formGenerator.component.currPosition=所属岗位 +formGenerator.component.datePicker=日期选择 +formGenerator.component.depSelect=部门选择 +formGenerator.component.divider=分割线 +formGenerator.component.editor=富文本 +formGenerator.component.groupSelect=分组选择 +formGenerator.component.groupTitle=分组标题 +formGenerator.component.iframe=Iframe +formGenerator.component.input=单行输入 +formGenerator.component.inputNumber=数字输入 +formGenerator.component.link=链接 +formGenerator.component.location=定位 +formGenerator.component.modifyTime=修改时间 +formGenerator.component.modifyUser=修改人员 +formGenerator.component.organizeSelect=组织选择 +formGenerator.component.popupAttr=弹窗选择属性 +formGenerator.component.popupSelect=弹窗选择 +formGenerator.component.popupTableSelect=下拉表格 +formGenerator.component.posSelect=岗位选择 +formGenerator.component.qrcode=二维码 +formGenerator.component.radio=单选框组 +formGenerator.component.rate=评分 +formGenerator.component.relationForm=关联表单 +formGenerator.component.relationFormAttr=关联表单属性 +formGenerator.component.roleSelect=角色选择 +formGenerator.component.row=栅格容器 +formGenerator.component.select=下拉选择 +formGenerator.component.sign=手写签名 +formGenerator.component.slider=滑块 +formGenerator.component.switch=开关 +formGenerator.component.tab=标签面板 +formGenerator.component.table=设计子表 +formGenerator.component.tableGrid=表格容器 +formGenerator.component.text=文本 +formGenerator.component.textarea=多行输入 +formGenerator.component.timePicker=时间选择 +formGenerator.component.treeSelect=下拉树形 +formGenerator.component.uploadFile=文件上传 +formGenerator.component.uploadImg=图片上传 +formGenerator.component.userSelect=用户选择 +formGenerator.component.usersSelect=用户组件 +formGenerator.copyComponentTip=确定复制该组件? +formGenerator.delComponentTip=确定删除该组件? +layout.footer.onlineDocument=在线文档 +layout.footer.onlinePreview=在线预览 +layout.header.about=关于平台 +layout.header.commonMenus=常用菜单 +layout.header.dropdownItemDoc=文档 +layout.header.dropdownItemLoginOut=退出系统 +layout.header.feedback=反馈问题 +layout.header.home=首页 +layout.header.lockScreen=锁定屏幕 +layout.header.lockScreenBtn=锁定 +layout.header.lockScreenPassword=锁屏密码 +layout.header.profile=个人信息 +layout.header.setting=设置 +layout.header.standingChange=切换身份 +layout.header.statement=官方声明 +layout.header.systemChange=应用切换 +layout.header.tooltipChat=聊天 +layout.header.tooltipEntryFull=全屏 +layout.header.tooltipErrorLog=错误日志 +layout.header.tooltipExitFull=退出全屏 +layout.header.tooltipLock=锁定屏幕 +layout.header.tooltipNotify=消息 +layout.multipleTab.close=关闭标签页 +layout.multipleTab.closeAll=关闭全部标签页 +layout.multipleTab.closeLeft=关闭左侧标签页 +layout.multipleTab.closeOther=关闭其它标签页 +layout.multipleTab.closeRight=关闭右侧标签页 +layout.multipleTab.reload=重新加载 +layout.multipleTab.setCommon=设为常用菜单 +layout.setting.animation=动画 +layout.setting.animationType=动画类型 +layout.setting.autoScreenLock=自动锁屏 +layout.setting.blueBg=蔚蓝星辰 +layout.setting.breadcrumb=面包屑 +layout.setting.breadcrumbIcon=面包屑图标 +layout.setting.cachePage=缓存页面 +layout.setting.clearBtn=清空缓存并返回登录页 +layout.setting.closeMixSidebarOnChange=切换页面关闭菜单 +layout.setting.collapseMenuDisplayName=折叠菜单显示名称 +layout.setting.colorWeak=色弱模式 +layout.setting.contentMode=内容区域宽度 +layout.setting.contentModeFixed=定宽 +layout.setting.contentModeFull=流式 +layout.setting.copyBtn=拷贝 +layout.setting.darkMode=主题 +layout.setting.defaultBg=经典主题 +layout.setting.drawerTitle=配置 +layout.setting.expandedMenuWidth=菜单展开宽度 +layout.setting.fixedHeader=固定header +layout.setting.fixedSideBar=固定Sidebar +layout.setting.footer=页脚 +layout.setting.fullContent=全屏内容 +layout.setting.grayMode=灰色模式 +layout.setting.greenBg=碧绿翠风 +layout.setting.header=顶栏 +layout.setting.headerTheme=顶栏主题 +layout.setting.interfaceDisplay=界面显示 +layout.setting.interfaceFunction=界面功能 +layout.setting.menuAccordion=侧边菜单手风琴模式 +layout.setting.menuCollapse=折叠菜单 +layout.setting.menuCollapseButton=菜单折叠按钮 +layout.setting.menuDrag=侧边菜单拖拽 +layout.setting.menuSearch=菜单搜索 +layout.setting.menuTriggerBottom=底部 +layout.setting.menuTriggerNone=不显示 +layout.setting.menuTriggerTop=顶部 +layout.setting.menuTypeMix=顶部混合模式 +layout.setting.menuTypeMixSidebar=左侧混合模式 +layout.setting.menuTypeSidebar=左侧菜单模式 +layout.setting.menuTypeTopMenu=顶部菜单模式 +layout.setting.minute=分钟 +layout.setting.mixSidebarFixed=固定展开菜单 +layout.setting.mixSidebarTrigger=混合菜单触发方式 +layout.setting.navMode=导航栏模式 +layout.setting.notAutoScreenLock=不自动锁屏 +layout.setting.off=关 +layout.setting.on=开 +layout.setting.operatingContent=复制成功,请到 src/settings/projectSetting.ts 中修改配置! +layout.setting.operatingTitle=操作成功 +layout.setting.progress=顶部进度条 +layout.setting.purpleBg=紫藤萝兰 +layout.setting.resetSuccess=重置成功! +layout.setting.sidebar=左侧菜单 +layout.setting.sidebarTheme=菜单主题 +layout.setting.splitMenu=分割菜单 +layout.setting.switchAnimation=切换动画 +layout.setting.switchLoading=切换loading +layout.setting.systemBackground=系统背景 +layout.setting.sysTheme=系统主题 +layout.setting.tabDetail=标签详情页 +layout.setting.tabs=标签页 +layout.setting.tabsFoldBtn=标签页折叠按钮 +layout.setting.tabsIcon=标签图标 +layout.setting.tabsQuickBtn=标签页快捷按钮 +layout.setting.tabsRedoBtn=标签页刷新按钮 +layout.setting.toggleLocale=语言切换 +layout.setting.topMenuAlignCenter=居右 +layout.setting.topMenuAlignLeft=居左 +layout.setting.topMenuAlignRight=居中 +layout.setting.topMenuLayout=顶部菜单布局 +layout.setting.triggerClick=点击 +layout.setting.triggerHover=悬停 +routes.basic.emailDetail=查看邮件 +routes.basic.errorLogList=错误日志列表 +routes.basic.externalLink=链接 +routes.basic.home=首页 +routes.basic.login=登录 +routes.basic.previewModel=功能预览 +routes.basic.workFlowDetail=流程详情 +routes.commonWords=审批常用语 +routes.dataReport=报表示例(原) +routes.extend=开发示例 +routes.extend-barCode=条码示例 +routes.extend-bigData=百万数据 +routes.extend-documentPreview=文档示例 +routes.extend-email=邮件收发 +routes.extend-formDemo=表单示例 +routes.extend-formDemo-fieldForm1=表单字段1 +routes.extend-formDemo-fieldForm2=表单字段2 +routes.extend-formDemo-fieldForm3=表单字段3 +routes.extend-formDemo-fieldForm4=表单字段4 +routes.extend-formDemo-fieldForm5=表单字段5 +routes.extend-formDemo-fieldForm6=表单字段6 +routes.extend-formDemo-verifyForm=表单验证 +routes.extend-formDemo-verifyForm1=表单验证1 +routes.extend-functionDemo=功能示例 +routes.extend-graphDemo=图表示例 +routes.extend-graphDemo-echartsBar=E-柱状图 +routes.extend-graphDemo-echartsBarAcross=E-横状条形图 +routes.extend-graphDemo-echartsCandlestick=E-K线图 +routes.extend-graphDemo-echartsFunnel=E-漏斗图 +routes.extend-graphDemo-echartsGauge=E-仪表图 +routes.extend-graphDemo-echartsLineArea=E-线形图 +routes.extend-graphDemo-echartsLineBar=E-折柱混合图 +routes.extend-graphDemo-echartsPie=E-饼状图 +routes.extend-graphDemo-echartsScatter=E-散点图 +routes.extend-graphDemo-echartsTree=E-树形图 +routes.extend-graphDemo-highchartsArea=H-面积图 +routes.extend-graphDemo-highchartsBellcurve=H-贝尔曲线 +routes.extend-graphDemo-highchartsBullet=H-子弹图 +routes.extend-graphDemo-highchartsColumn=H-柱状图 +routes.extend-graphDemo-highchartsFunnel=H-漏斗图 +routes.extend-graphDemo-highchartsGauge=H-仪表图 +routes.extend-graphDemo-highchartsLine=H-线性图 +routes.extend-graphDemo-highchartsPie=H-饼状图 +routes.extend-graphDemo-highchartsScatter=H-散点图 +routes.extend-graphDemo-highchartsWordcloud=H-词云图 +routes.extend-importAndExport=导入导出 +routes.extend-map=地图示例 +routes.extend-order=订单管理 +routes.extend-orderDemo=订单示例 +routes.extend-portalDemo=门户示例 +routes.extend-printData=打印示例 +routes.extend-projectGantt=项目管理 +routes.extend-schedule=日程安排 +routes.extend-signature=电子签名 +routes.extend-signet=电子签章 +routes.extend-tableDemo=表格示例 +routes.extend-tableDemo-commonTable=普通表格 +routes.extend-tableDemo-complexHeader=复杂表头 +routes.extend-tableDemo-extension=延伸扩展 +routes.extend-tableDemo-groupingTable=表格分组 +routes.extend-tableDemo-lockTable=表格锁定 +routes.extend-tableDemo-mergeTable=表格合并 +routes.extend-tableDemo-postilTable=表格批注 +routes.extend-tableDemo-printTable=表格打印 +routes.extend-tableDemo-redactTable=表格编辑 +routes.extend-tableDemo-signTable=表格标记 +routes.extend-tableDemo-statisticsTable=表格统计 +routes.extend-tableDemo-tableTree=表格树形 +routes.extend-tableDemo-treeTable=树形表格 +routes.flowEngine=流程引擎 +routes.formDesign=系统表单 +routes.generator=代码生成 +routes.generator-appForm=移动表单 +routes.generator-flowForm=发起表单 +routes.generator-webForm=功能表单 +routes.lioui=流程示例 +routes.mainSystem=开发平台 +routes.moreMenu=更多... +routes.msgCenter=消息中心 +routes.msgCenter-accountConfig=账号配置 +routes.msgCenter-accountConfig-ding=钉钉配置 +routes.msgCenter-accountConfig-mail=邮箱配置 +routes.msgCenter-accountConfig-mp=微信公众号配置 +routes.msgCenter-accountConfig-shortMsg=短信配置 +routes.msgCenter-accountConfig-webhook=webhook配置 +routes.msgCenter-accountConfig-weCom=企业微信配置 +routes.msgCenter-msgMonitor=消息监控 +routes.msgCenter-msgTemplate=消息模板 +routes.msgCenter-sendConfig=发送配置 +routes.onlineDev=在线开发 +routes.onlineDev-appDesign=移动设计 +routes.onlineDev-dataReport=报表设计(原) +routes.onlineDev-dataScreen=大屏设计 +routes.onlineDev-integration=集成助手 +routes.onlineDev-printDev=打印设计 +routes.onlineDev-report=报表设计 +routes.onlineDev-visualPortal=门户设计 +routes.onlineDev-webDesign=表单设计 +routes.permission=组织权限 +routes.permission-auth=权限管理 +routes.permission-authorize=权限组 +routes.permission-department=部门管理 +routes.permission-grade=管理员 +routes.permission-group=分组管理 +routes.permission-organize=组织管理 +routes.permission-position=岗位管理 +routes.permission-role=角色管理 +routes.permission-user=用户管理 +routes.permission-userOnline=在线用户 +routes.printDemo=打印示例 +routes.report=报表示例 +routes.reportBI=大屏示例 +routes.system=系统管理 +routes.system-area=行政区划 +routes.system-billRule=单据模板 +routes.system-cache=系统缓存 +routes.system-icons=系统图标 +routes.system-kit=表单模板 +routes.system-language=翻译管理 +routes.system-log=系统日志 +routes.system-menu=应用菜单 +routes.system-messageTemplate=消息模板 +routes.system-monitor=系统监控 +routes.system-notice=系统公告 +routes.system-signature=签章管理 +routes.system-smsTemplate=短信模板 +routes.system-sysConfig=系统配置 +routes.system-systemTemplate=系统模板 +routes.system-task=系统调度 +routes.systemData=数据应用 +routes.systemData-dataBackup=数据备份 +routes.systemData-dataInterface=数据接口 +routes.systemData-dataModel=数据建模 +routes.systemData-dataSource=数据连接 +routes.systemData-dataSync=数据同步 +routes.systemData-dictionary=数据字典 +routes.systemData-interfaceAuth=接口认证 +routes.systemData-map=数据地图 +routes.weChat=微信配置 +routes.weChat-mpConfig=公众号配置 +routes.weChat-mpMaterial=公众号素材 +routes.weChat-mpMenu=公众号菜单 +routes.weChat-mpMessage=公众号消息 +routes.weChat-mpUser=公众号用户 +routes.weChat-qyDepartment=企业号组织 +routes.weChat-qyhConfig=企业号配置 +routes.weChat-qyMessage=企业号消息 +routes.weChat-qyUser=企业号用户 +routes.workFlow=协同办公 +routes.workFlow-addFlow=发起流程 +routes.workFlow-document=文档中心 +routes.workFlow-entrust=流程委托 +routes.workFlow-flowCirculate=抄送我的 +routes.workFlow-flowDoing=我的在办 +routes.workFlow-flowDone=我的已办 +routes.workFlow-flowEngine=流程设计 +routes.workFlow-flowLaunch=我发起的 +routes.workFlow-flowMonitor=流程监控 +routes.workFlow-flowTodo=我的待办 +routes.workFlow-flowToSign=我的待签 +routes.workFlow-form=表单设计 +routes.workFlow-printTemplate=打印模板 +routes.workFlow-schedule=日程安排 +routes.workSystem=业务平台 +sys.api.apiRequestFailed=请求出错,请稍候重试 +sys.api.apiTimeoutMessage=接口请求超时,请刷新页面重试! +sys.api.errMsg401=用户没有权限(令牌、用户名、密码错误)! +sys.api.errMsg403=用户得到授权,但是访问是被禁止的。! +sys.api.errMsg404=网络请求错误,未找到该资源! +sys.api.errMsg405=网络请求错误,请求方法未允许! +sys.api.errMsg408=网络请求超时! +sys.api.errMsg500=服务器错误,请联系管理员! +sys.api.errMsg501=网络未实现! +sys.api.errMsg502=网络错误! +sys.api.errMsg503=服务不可用,服务器暂时过载或维护! +sys.api.errMsg504=网络超时! +sys.api.errMsg505=http版本不支持该请求! +sys.api.errorMessage=操作失败,系统异常! +sys.api.errorTip=错误提示 +sys.api.networkException=网络异常 +sys.api.networkExceptionMsg=网络异常,请检查您的网络连接是否正常! +sys.api.operationFailed=操作失败 +sys.api.timeoutMessage=登录超时,请重新登录! +sys.app.logoutMessage=是否确认退出系统? +sys.app.logoutTip=温馨提醒 +sys.app.menuLoading=菜单加载中... +sys.errorLog.enableMessage=只在`/src/settings/projectSetting.ts` 内的useErrorHandle=true时生效. +sys.errorLog.fireAjaxError=点击触发ajax错误 +sys.errorLog.fireResourceError=点击触发资源加载错误 +sys.errorLog.fireVueError=点击触发vue错误 +sys.errorLog.modalTitle=错误详情 +sys.errorLog.tableActionDesc=详情 +sys.errorLog.tableColumnDate=时间 +sys.errorLog.tableColumnFile=文件 +sys.errorLog.tableColumnMsg=错误信息 +sys.errorLog.tableColumnStackMsg=stack信息 +sys.errorLog.tableColumnType=类型 +sys.errorLog.tableTitle=错误日志列表 +sys.exception.backHome=返回首页 +sys.exception.backLogin=返回登录 +sys.exception.networkErrorSubTitle=抱歉,您的网络连接已断开,请检查您的网络! +sys.exception.networkErrorTitle=网络错误 +sys.exception.noDataTitle=当前页无数据 +sys.exception.subTitle403=抱歉,您无权访问此页面。 +sys.exception.subTitle404=抱歉,您访问的页面不存在。 +sys.exception.subTitle500=抱歉,服务器报告错误。 +sys.lock.alert=锁屏密码错误 +sys.lock.backToLogin=返回登录 +sys.lock.entry=进入系统 +sys.lock.placeholder=请输入登录密码 +sys.lock.unlock=点击解锁 +sys.login.accountPlaceholder=请输入账号 +sys.login.accountTip=请输入账号 +sys.login.backSignIn=返回 +sys.login.changeCode=点击切换验证码 +sys.login.codeTip=请输入验证码 +sys.login.codeTitle=手机验证登录 +sys.login.company=请输入公司名 +sys.login.confirmLogin=请在手机端确认登录 +sys.login.confirmPassword=确认密码 +sys.login.contacts=请输入联系人 +sys.login.diffPwd=两次输入密码不一致 +sys.login.email=邮箱 +sys.login.expired=二维码已失效 +sys.login.forgetFormTitle=重置密码 +sys.login.forgetPassword=忘记密码? +sys.login.getCode=获取验证码 +sys.login.lastLoginInfo=上次登录信息 +sys.login.logIn=登录 +sys.login.loginButton=登录 +sys.login.mobile=请输入手机号 +sys.login.mobilePlaceholder=请输入手机号码 +sys.login.mobileSignInFormTitle=手机验证码登录 +sys.login.otherLogin=其他登录方式 +sys.login.otherSignIn=其他登录方式 +sys.login.password=请输入密码 +sys.login.passwordPlaceholder=请输入密码 +sys.login.passwordTip=请输入密码 +sys.login.policy=我同意xxx隐私政策 +sys.login.policyPlaceholder=勾选后才能注册 +sys.login.qrCodeTip=请使用APP扫描二维码登录,180秒后二维码失效 +sys.login.qrSignInFormTitle=扫码登录 +sys.login.recoverCode=取消登录 +sys.login.refreshCode=点击刷新 +sys.login.registerButton=注册 +sys.login.rememberMe=记住我 +sys.login.reSend=重新发送 +sys.login.rightMobile=请输入正确的手机号 +sys.login.rule=租户子账户规则:租户号{'@'}账户 例:18577778888{'@'}101001 +sys.login.scanSign=扫码后点击"确认",即可完成登录 +sys.login.scanSuccessful=扫码成功 +sys.login.scanTip=扫码登录 +sys.login.scanTitle=扫码登录 +sys.login.signInDesc=输入您的个人详细信息开始使用! +sys.login.signInFormTitle=账号密码登录 +sys.login.signInTitle=开箱即用的中后台管理系统 +sys.login.signUpFormTitle=注册 +sys.login.smsCode=请输入验证码 +sys.login.smsPlaceholder=请输入验证码 +sys.login.subTitle=通过账号密码登录 +sys.login.subTitle1=通过手机验证码登录,或者切换为 +sys.login.subTitle2=通过账号密码登录,或者切换为 +sys.login.subTitle3=通过扫码登录,或者切换为 +sys.login.title=账户密码登录 +sys.login.upper=大写已锁定 +sys.login.username=请输入账号 +sys.login.version=版本 +sys.login.welcome=欢迎使用 +sys.validate.arrayRequiredPrefix=请至少选择一个 +sys.validate.date=请输入正确的日期 +sys.validate.email=请输入正确的邮箱 +sys.validate.idCard=请输入正确的身份证号码 +sys.validate.mobilePhone=请输入正确的手机号码 +sys.validate.money=请输入正确的金额 +sys.validate.number=请输入正确的数字 +sys.validate.phone=请输入正确的联系方式 +sys.validate.telephone=请输入正确的电话号码 +sys.validate.textRequiredSuffix=不能为空 +sys.validate.url=请输入正确的网址 +views.dynamicModel.hideSome=隐藏部分 +views.dynamicModel.passwordPlaceholder=请输入密码 +views.dynamicModel.scanAndShare=扫描二维码,分享此链接 +views.dynamicModel.showMore=加载更多 +views.http404.goBackBtn=返回首页 +views.http404.subTips=请检查您输入的URL是否正确,或单击按钮返回首页。 +views.http404.tips=抱歉,你访问的页面不存在或无权访问! diff --git a/yunzhupaas-admin/src/main/resources/i18n/message_zh_TW.properties b/yunzhupaas-admin/src/main/resources/i18n/message_zh_TW.properties new file mode 100644 index 0000000..f1d75e8 --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/i18n/message_zh_TW.properties @@ -0,0 +1,1236 @@ +AD101=介面無法訪問 +AD102=系統異常 +AD103=操作過於頻繁 +AD104=沒有訪問許可權,請聯繫管理員授權 +AD105=認證失敗,無法訪問系統資源 +AD106=無效內部認證,無法訪問系統資源 +COD001=集合條件過濾獲得目標為空 +COPY001=複製名稱長度超過了限制長度 +DB001=數據類型編碼不符合標準(請注意大小寫)。MySQL , SQLServer , Oracle , DM , KingbaseES , PostgreSQL +DB002=請檢查 1、連接資訊 2、網路通信 3、資料庫服務啟動狀態。 詳情:{0} +DB003=通過url找不到對應資料庫 +DB004=查詢結果集為空。 +DB005=未找到對應資料庫類型:{0}({1}) +DB006=未找到對應數據類型轉換 +DB007=導入表名存在重複 +DB008=建表數據與當前運算元據庫不匹配: {0} -> {1} +DB009=未找到表資訊: {0} +DB010=資料庫{0},未找到此表:{1} +DB011=聯合主鍵類缺少“{0}”字段值 +DB012=表示對應獲取數值失敗 +DB013=目前還未支持{0}數據類型:{1} +DB014=表 "{0}"中字段 "{1}" 為主鍵,不允許數據類型 "{2}" +DB015=未找到字段SQL語句 +DB016=沒有初始字段 +DB017=sql異常:{0} +DB018=請在資料庫中添加對應的數據表 +DB019=添加失敗 +DB101=系統自帶表,不允許被刪除 +DB102=系統自帶表,不允許被編輯 +DB201=表已經被使用,不允許被刪除 +DB202=表已經被使用,不允許被編輯 +DB301=資料庫連接成功 +DB302=資料庫連接失敗 +ETD101=操作失敗,原文件不存在 +ETD102=找不到父級 +ETD103=不能移動到自己的文件夾 +ETD104=未能找到此訂單 +ETD105=新建成功10000條數據 +ETD106=獲取失敗 +ETD107=帳戶認證錯誤 +ETD108=你還沒有設置郵件的帳戶 +ETD109=文件導出失敗 +ETD110=文件格式不正確 +ETD111=文件找不到 +ETD112=此記錄被關聯引用,不允許被刪除 +ETD113=防止惡意創建過多數據 +ETD114=保存失敗,請重新登陸 +ETD115=請輸入預覽的url +ETD116=請選擇正確的預覽方式 +ETD117=數據超過1000條 +EXIST001=名稱不能重複 +EXIST002=編碼不能重複 +EXIST003=範本名已存在 +EXIST004=文件夾名稱不能重複 +EXIST005=範本名稱超過了限制長度 +EXIST101=名稱重複,請重新輸入 +EXIST102=編碼重複,請重新輸入 +EXIST103=不能重複 +FA001=數據不存在 +FA002=更新失敗,數據不存在 +FA003=刪除失敗,數據不存在 +FA004=複製失敗,數據不存在 +FA005=發送失敗,數據不存在 +FA006=下載失敗,數據不存在 +FA007=操作失敗,數據不存在 +FA008=停止失敗,數據不存在 +FA009=終止失敗,數據不存在 +FA010=還原失敗,數據不存在 +FA011=發佈失敗,數據不存在 +FA012=獲取失敗,數據不存在 +FA013=介面修改失敗,數據不存在 +FA014=更新介面狀態失敗,數據不存在 +FA015=預覽失敗,數據不存在 +FA016=刪除失敗,該文件夾存在數據 +FA017=文件格式不正確 +FA018=文件不存在 +FA019=已失效 +FA020=未查到資訊 +FA021=操作失敗!您沒有許可權操作 +FA022=更新失敗!您沒有許可權操作 (角色只有超級管理員才能夠操作) +FA023=更新失敗!已綁定用戶,無法切換組織 +FA024=刪除失敗!已綁定用戶 +FA025=該組織內許可權為空,組織切換失敗! +FA026=更新失敗,關聯組織不存在,請重新登錄,或者刷新頁面 +FA027=該系統下菜單為空,系統切換失敗 +FA028=新增數據失敗 +FA029=修改數據失敗 +FA030=更新失敗!已綁定用戶,無法修改狀態 +FA031=該組織無本應用許可權,切換失敗 +FA032=上傳文件不能為空 +FA033=文件上傳失敗! +FA034=非法請求, 缺少認證資訊 +FA035=未獲取到租戶指定數據源資訊 +FA036=常用數據已存在 +FA037=介面請求失敗 +FA038=文件存儲路徑錯誤 +FA039=鏈接已失效 +FA040=預覽失敗,請檢查文件類型是否規範 +FA041=預覽失敗,請重新上傳文件 +FA042=請輸入正確的文件格式 +FA043=存在同名文件! +FA044=不存在該文件 +FA045=刪除文件:{0}失敗 +FA046=文件讀取失敗 +FA047=未發現文件 +FA048=微信公眾號原始id不能重複 +FA049=此記錄與“消息發送配置”關聯引用,不允許被禁用 +FA050=此記錄與“消息發送配置”關聯引用,不允許被刪除 +FA051=介面已配置加密, 數據解密失敗. +FA052=該身份未分配權限 +FA101=保存失敗 +FA102=更新失敗 +FA103=刪除失敗 +FA104=獲取失敗 +FA105=預覽失敗,請先保存在預覽數據 +FA106=預覽失敗,單元格配置出現死迴圈 +FM001=未找到介面 +FM002=表單資訊不存在 +FM003=子表重複 +FM004=已到達該範本複製上限,請複製源範本! +FM005=該表單已被流程引用,無法刪除! +FM006=該表單未發佈,無法回滾表單內容 +FM007=該範本內表單內容為空,無法發佈 +FM008=該功能未導入流程表單 +FM009=流程未設計,請先設計流程! +FM010=該功能流程處於停用狀態! +FM011=表[{0}]無主鍵! +FM012=主鍵策略:{0},與表[{1}]主鍵策略不一致! +FM013=表新增錯誤:{0} +GT101=成功 +GT102=失敗 +GT103=驗證錯誤 +GT104=異常 +GT105=登錄過期,請重新登錄 +GT106=您的帳號在其他地方已登錄,被強制踢出 +GT107=Token驗證失敗 +GT108=請求超過最大數 +IMP001=導入成功 +IMP002=導入失敗,文件格式錯誤 +IMP003=導入失敗,數據已存在 +IMP004=導入失敗,數據有誤 +IMP005=導出失敗 +IMP006=導入數據格式不正確 +IMP007=重複 +IMP008=名稱 +IMP009=編碼 +IMP010=導入失敗,查詢不到上級分類 +IMP011=請選擇導出字段 +LOG001=帳戶異常 +LOG002=註銷成功 +LOG004=帳號異常,請聯繫管理員修改所屬組織資訊 +LOG005=帳號未被啟動 +LOG006=帳號已被禁用 +LOG007=帳號已被刪除 +LOG010=此IP未在白名單中 +LOG011=登錄失敗,用戶暫未綁定角色 +LOG012=帳號已被鎖定,請聯繫管理員解除鎖定 +LOG101=帳號或密碼錯誤 +LOG102=帳號有誤,請重新輸入 +LOG103=請輸入驗證碼 +LOG104=驗證碼錯誤 +LOG105=連接租戶服務失敗,請稍後再試 +LOG106=短信驗證碼錯誤 +LOG107=驗證碼已失效 +LOG108=請等待{0}分鐘後再進行登錄,或聯繫管理員解除鎖定 +LOG109=租戶登錄失敗,請用手機驗證碼登錄 +LOG110=資料庫異常,請聯繫管理員處理 +LOG111=已開啟單點登錄, 不支持此登錄方式 +LOG112=不支持此登錄方式 +LOG113=未設置租戶資訊 +LOG114=租戶編碼不允許為空 +LOG115=租戶資訊獲取失敗 +LOG116=不支持此驗證 +LOG117=短信驗證碼驗證失敗:{0} +LOG118=租戶庫名為空 +LOG201=舊密碼錯誤 +LOG202=修改成功,請牢記新密碼 +LOG203=修改失敗,帳號不存在 +LOG204=修改失敗,新建密碼不能與舊密碼一樣 +LOG205=重置密碼成功 +LOG206=重置密碼失敗 +MSERR101=發送失敗,失敗原因:SMTP服務為空 +MSERR102=發送失敗,失敗原因:發件人郵箱為空 +MSERR103=發送失敗,失敗原因:發件人密碼為空 +MSERR104=發送失敗,失敗原因:接收人為空 +MSERR105=發送失敗。失敗原因:{0}的郵箱帳號格式有誤! +MSERR106=發送失敗。失敗原因:{0}的郵箱帳號為空! +MSERR107=發送失敗。失敗原因:接收人對應的郵箱全部為空 +MSERR108=發送失敗。失敗原因:{0} +MSERR109=連接成功 +MSERR110=連接失敗。失敗原因:{0} +MSERR111=已發送 +MSERR112=內容不能包含<符號 +MSERR113=暫無未讀消息 +MSERR114=自定義範本編碼不能使用系統範本編碼規則 +MSERR115=創建失敗,存在多個標題參數 +MSERR116=創建失敗,不存在標題參數 +MSERR117=更新失敗,存在多個標題參數 +MSERR118=更新失敗,不存在標題參數 +MSERR119=請先前往系統同步設置,配置釘釘帳號 +MSERR120=請先前往系統同步設置,配置企業微信帳號 +MSERR121=配置範本無數據,無法測試 +OA001=用戶登錄 +OA002=設備 +OA003=TOKEN +OA004=用戶退出 +OA005=用戶踢出 +OA006=用戶頂替 +OA007=登錄異常 +OA008=登錄獲取系統配置失敗 +OA009=該用戶未分配權限 +OA010=僅支持pc端訪問,APP端不支持 +OA011=應用不存在 +OA012=當前應用已被禁用 +OA013=登錄密碼解密失敗 +OA014=注销成功 +OA015=登錄成功 +OA016=登錄票據已失效 +OA017=第三方未綁定帳號 +OA018=不允許訪問此登錄介面 +OA019=帳號不存在 +OA020=帳戶或密碼錯誤,請重新輸入 +OA021=驗證成功 +OA022=限制會話, 不允許訪問系統 +OA023=管理員不能註銷 +OA024=登錄失敗 +OA025=超級管理員 +OA026=普通管理員 +OA027=普通用戶 +OA028=未知來源 +PRI001=列印範本不存在 +PRI002=數字字典不存在printDev的字典分類 +PRI003=第1條SQL語句:查詢出多條表頭資訊 +PRI004=第1條SQL語句:未查出表頭資訊 +PRI005=第{index}條SQL語句: +PRI006=已到達該範本複製上限,請複製源範本 +PRI007=Sql語法錯誤 +PRI008=該報表已刪除 +PS001=此記錄與"{0}"關聯引用,不允許被刪除 +PS003=組織 +PS004=崗位 +PS005=用戶 +PS006=角色 +PS007=帳號不能為空 +PS008=姓名不能為空 +PS009=用戶額度已達到上限 +PS010=許可權已變更,請重新登錄 +PS011=密碼已變更,請重新登錄 +PS012=類型不能為空 +PS013=當前機構Id不能與父機構Id相同 +PS014=該應用已禁用 +PS015=無法設置當前用戶為分級管理員 +PS016=無法設置超管為分級管理員 +PS017=無法設置當前用戶操作許可權 +PS018=解綁失敗 +PS019=第三方登錄未配置 +PS020=性別不能為空 +PS021=無法禁用管理員用戶 +PS022=管理員只能修改自己,不能修改其他管理員 +PS023=無法修改管理員帳戶 +PS024=直屬主管不能是自己 +PS025=直屬主管不能是我的下屬用戶 +PS026=無法刪除管理員帳戶 +PS027=此用戶為某部門主管,無法刪除 +PS028=此用戶有下屬,無法刪除 +PS029=無法修改管理員帳戶狀態 +PS030=用戶資訊已變更,請重新登錄 +PS031=該應用已刪除 +PS032=該組織無本應用許可權,切換失敗 +PS033=工作交接成功! +PS034=工作交接無法轉移給管理員 +PS035=工作交接無法轉移給本人 +SC001=操作失敗,任務不存在 +SU000=Success +SU001=新建成功 +SU002=保存成功 +SU003=刪除成功 +SU004=更新成功 +SU005=操作成功 +SU006=提交成功,請耐心等待 +SU007=複製成功 +SU008=停止成功 +SU009=終止成功 +SU010=還原成功 +SU011=發佈成功 +SU012=發送成功 +SU013=介面修改成功 +SU014=更新介面狀態成功 +SU015=上傳成功 +SU016=設置成功 +SU017=驗證成功 +SU018=添加成功 +SU019=獲取成功 +SU020=回滾成功 +SU021=移除成功 +SU022=查詢成功 +SYS001=區域編碼不能重複 +SYS002=刪除失敗,當前有子節點數據 +SYS003=單據已經被使用,不允許被刪除 +SYS004=清理成功 +SYS005=介面創建成功 +SYS006=當前SQL含有敏感字:{0} +SYS007=介面請求成功 +SYS008=介面不符合規範 +SYS009=變數名不能包含敏感字元 +SYS010=變數名已存在 +SYS011=資料庫連接不能相同 +SYS012=請檢查,同一資料庫下無法同步數據 +SYS013=同步失敗:{0} +SYS014=字典類型下麵有字典值禁止刪除 +SYS015=範本不存在 +SYS016=當前目錄存在數據,不能修改類型 +SYS017=刪除失敗,請先刪除子菜單 +SYS018=當前導入菜單為{0}端菜單,請在對應模組下導入! +SYS019=請在頂級節點下創建目錄後再進行菜單導入 +SYS020=該字段在方案{0}中已被使用 +SYS021=修改失敗,該方案不允許編輯 +SYS022=編碼錯誤 +SYS023=請求發生錯誤! +SYS024=獲取不到數據! +SYS025=獲取企業微信access_token失敗 +SYS026=正在進行同步,請稍後再試 +SYS027=請先從企業微信同步部門到本地 +SYS028=請先從釘釘同步部門到本地 +SYS029=驗證碼位數不能大於6 +SYS030=驗證碼位數不能小於3 +SYS031=測試發送消息的連接失敗:{0} +SYS032=測試發送消息連接成功 +SYS033=測試組織同步的連接失敗:{0} +SYS034=測試組織同步連接成功 +SYS035=測試連接類型錯誤 +SYS036=測試釘釘連接失敗: +SYS037=測試連接成功 +SYS038=表資訊抽取異常 +SYS039=刪除失敗,請先刪除該應用下的菜單和門戶 +SYS040=刪除失敗,請先刪除該應用下的菜單 +SYS041=刪除失敗,請先刪除該應用下的門戶 +SYS042=該日程已被刪除 +SYS043=最後一條數據不能刪除 +SYS044=啟用版本不能刪除 +SYS045=歸檔版本不能刪除 +SYS046=數據集不能重名 +SYS047=SQL語句僅支持查詢語句 +SYS048=SQL語句需帶上@formId條件 +SYS049=正在進行同步,請稍等 +SYS050=只能輸入字母、數字、點、橫線和下劃線,且以字母開頭 +SYS051=翻譯標記不能重複 +SYS052=翻譯語言至少填寫一項 +SYS053=獲取釘釘access_token失敗 +SYS101=更新失敗,主系統不允許禁用 +SYS102=主系統不允許刪除 +SYS103=系統在審批常用語中被使用,不允許刪除 +SYS104=更新失敗,主系統不允許修改編碼 +SYS105=常用語已存在 +SYS121=介面暫只支持HTTP和HTTPS方式 +SYS122=介面請求失敗 +SYS123=介面請求失敗, JS調用失敗,錯誤:{0} +SYS124=驗證請求超時 +SYS125=appSecret錯誤 +SYS126=appId使用期限已到期 +SYS127=appId參數錯誤 +SYS128={0}不能使用系統、開發語言及資料庫關鍵字命名 +SYS129=當前數據源不支持全連接 +SYS130=標題不能為空 +SYS131=結束時間必須晚於開始時間 +SYS132=結束重複必須晚於開始時間 +VS001=同步到流程時,{0} +VS002=發佈失敗,流程未設計! +VS003=無表生成有表失敗 +VS004=發佈 +VS005=預覽 +VS006=下載 +VS007=同步成功 +VS008=回滾失敗,暫無線上版本 +VS009=參數解析錯誤! +VS010=無效鏈接 +VS011=密碼錯誤 +VS012=未找到該功能表單 +VS013=未開啟表單外鏈! +VS014=下載鏈接已失效 +VS015=字段不能為空 +VS016=路徑錯誤 +VS017=集成助手被禁用 +VS018=表規範名稱不能重複 +VS019=規範名稱不能使用系統關鍵字或JAVA關鍵字 +VS020=字段規範名稱不能重複 +VS021=“{0}”命名不符合規範 +VS022=主鍵策略:[雪花ID],表[ {0} ]主鍵設置不支持! +VS023=主鍵策略:[自增ID],表[ {0} ]主鍵設置不支持! +VS024=表單不存在或者未發佈! +VS025=未獲取到流程發起人 +VS026=規範名稱前兩字母必須小寫 +VS027=自動生成的【{0}】超出長度,提交失敗! +VS028=視圖最多新建5個 +VS401=該範本內表單內容為空,無法 +VS402=該範本內列表內容為空,無法 +VS403=該功能未配置流程不可用 +VS404=單行輸入不能重複 +VS405=當前表單原數據已被調整,請重新進入該頁面編輯並提交數據 +VS406=該功能配置的流程處於停用 +VS407=表頭名稱不可更改,表頭行不能刪除 +VS408=請至少選擇一個數據表 +VS409=未找到主表資訊 +VS410=請導入對應功能的json文件 +VS411=已存在相同功能 +VS412=該表單已刪除 +VS413=應用不能為空 +VS414=門戶數據資訊存在重複 +VS415=該門戶已刪除 +WF001=審核成功 +WF002=退回成功 +WF003=轉辦成功 +WF004=加簽成功 +WF005=當前流程被退回,無法撤回流程 +WF006=流程已撤回,不能重複操作 +WF007=撤回失敗,轉向數據無法撤回 +WF008=撤回成功 +WF009=功能流程不能終止 +WF010=指派成功 +WF011=批量操作完成 +WF012=該流程不能操作 +WF013=復活成功 +WF014=變更成功 +WF015=掛起成功 +WF016=恢復成功 +WF017=委託人和被委託人相同,委託失敗 +WF018=操作失敗,同一時間內有相同流程的委託 +WF019=操作失敗,同一時間內有相同流程,不能相互委託 +WF020=功能流程不能刪除 +WF021=不能刪除 +WF022=催辦成功 +WF023=未找到催辦人 +WF024=該功能已被流程引用,請重新選擇關聯功能 +WF025=啟用失敗,流程未設計 +WF026=啟用成功 +WF027=禁用成功 +WF028=該版本內有工單任務流轉,無法刪除 +WF029=您沒有發起該流程的許可權 +WF030=表單未找到 +WF031=已審核完成 +WF032=凍結不能操作 +WF033=轉向節點不存在或配置錯誤 +WF034=轉向失敗,轉向節點未審批 +WF035=退回至您的審批,不能再發起退回 +WF036=流程已處理,無法撤回 +WF037=當前流程包含子流程,無法撤回 +WF038=子流程無法撤回 +WF039=下一節點為選擇分支無法批量審批 +WF040=條件流程包含候選人無法批量通過 +WF041=該流程工單已終止 +WF042=該流程工單已撤回 +WF043=該節點沒有數據,無法復活 +WF044=此流程不支持變更 +WF045=當前節點有子流程無法變更 +WF046=退回節點包含子流程,退回失敗 +WF047=當前節點未審批,不能退回 +WF048=流程處於掛起狀態,不可操作 +WF049=當前流程正在運行不能刪除 +WF050=已被掛起不能刪除 +WF051=沒有刪除許可權 +WF052=主版本沒有內容 +WF053=流程沒有啟用 +WF054=流程編碼不能重複 +WF055=流程表單不一致,請重新選擇 +WF056=該流程由線上開發生成的,無法直接刪除,請在功能設計中刪除相關功能 +WF057=該流程內工單任務流轉未結束,無法刪除 +WF058=當前流程正在運行不能重複提交 +WF059=流程自動發起審批失敗 +WF060=駁回節點不能是子流程 +WF061=下一節點無審批人員請聯繫管理員 +WF062=表單已被引用,請重新選擇 +WF063=流程已發起,無法刪除 +WF064=任務不存在,或者已處理 +WF065=拒絕成功 +WF066=同意成功 +WF067=協辦成功 +WF068=協辦保存成功 +WF069=減簽成功 +WF070=撤銷成功 +WF071=最後一條數據不能刪除 +WF072=啟用版本不能刪除 +WF073=歸檔版本不能刪除 +WF074=暫停成功 +WF075=條件不滿足無法流轉 +WF076=節點不存在 +WF077=流程無法撤回 +WF078=流程未同意,無法撤銷 +WF079=歸檔異常 +WF080=選擇的數據不能退簽 +WF081=無法加簽 +WF082=無法減簽 +WF083=無法退回 +WF084=無法轉審 +WF085=無法協辦 +WF086=無法批量審批 +WF087=經辦未簽收 +WF088=經辦未開始辦理 +WF089=流程發佈失敗 +WF090=流程發佈失敗 +WF091=流程提交失敗 +WF092=獲取引擎當前任務失敗 +WF093=流程刪除失敗 +WF094=獲取出線集合失敗 +WF095=獲取線之後的任務節點失敗 +WF096=獲取下一級任務節點集合失敗 +WF097=獲取上一級任務節點集合失敗 +WF098=任務完成失敗 +WF099=獲取流程實例失敗 +WF100=獲取未經過的節點失敗 +WF101=獲取節點的後續節點失敗 +WF102=獲取可回退的節點失敗 +WF103=退回失敗 +WF104=節點跳轉失敗 +WF105=補償失敗 +WF106=不能加簽給自己 +WF107=不能轉審給自己 +WF108=不能協辦給自己 +WF109=必須保留一名加簽人員 +WF110=審批異常無法撤銷 +WF111=所選流程包含條件候選人 +WF112=選擇的數據對應流程已暫停 +WF113=已被暫停不能刪除 +WF114=流程處於暫停狀態,不可操作 +WF115=流程已受理,無法刪除 +WF116=不能加簽給委託人 +WF117=不能轉審給委託人 +WF118=不能協辦給委託人 +WF119=設置了流轉條件,無法批量審批 +WF120=下一節點審批異常,無法批量審批 +WF121=子流程自動發起審批失敗 +WF122=流程不存在 +WF123=流程處於終止狀態,不可操作 +WF124=該流程已發起數據,無法刪除! +WF125=您沒有發起委託流程 +WF126=撤銷流程不能轉審 +WF127=撤銷流程不能退回 +WF128=該用戶已審批,請重新打開介面 +WF129=委託人已無該流程許可權 +WF130=管理員不能新建委託/代理 +WF131=不能選擇admin +WF132=已有人接受,不可編輯 +WF133=流轉條件不滿足,無法自動發起審批 +WF134=第一個審批節點設定候選人,無法自動發起審批 +WF135=第一個審批節點异常,無法自動發起審批 +WF136=找不到發起人,發起失敗 +WF137=代理人和被代理人相同,代理失敗 +WF138=存在未簽收的數據,無法關閉 +WF139=該流程已觸發了任務,無法删除 +WF144=操作失敗,同一時間內有相同流程的代理 +WF145=操作失敗,同一時間內有相同流程,不能相互代理 +app.apply.expandData=展開數據 +app.apply.location.location=添加定位 +app.apply.location.modalTitle=選擇位置 +app.apply.location.relocation=重新定位 +app.apply.noMoreData=沒有更多數據 +app.apply.pleaseKeyword=請輸入關鍵詞搜索 +app.apply.screen=篩選 +app.apply.sort=排序 +app.my.accountSecurity=帳號安全 +app.my.agencyMe=代理給我 +app.my.allFlow=全部流程 +app.my.entrustedAgency=委託代理 +app.my.entrustMe=委託給我 +app.my.flowSelect=流程選擇 +app.my.logOut=登出 +app.my.myAgency=我的代理 +app.my.myEntrust=我的委託 +app.my.organization=我的組織 +app.my.position=我的崗位 +app.my.scanCode=掃一掃 +app.my.setting=設定 +app.my.settings.About=關於平臺 +app.my.settings.changePassword=修改密碼 +app.my.settings.contact=聯繫我們 +app.my.settings.language=多語言 +app.my.settings.privacyPolicy=隱私政策 +app.my.settings.userAgreement=使用者協定 +app.my.sto=終止 +app.my.subordinates=我的下屬 +app.my.switchIdentity=切換身份 +common.add1Text=添加 +common.add2Text=新增 +common.addText=新建 +common.back=返回 +common.batchDelText=批量刪除 +common.batchDelTip=您確定要删除這些數據嗎,是否繼續? +common.batchPrintText=批量打印 +common.cancelText=取消 +common.chooseText=請選擇 +common.chooseTextPrefix=請選擇 +common.cleanText=清空 +common.closeList=關閉列表 +common.closeText=關閉 +common.collapseAll=折疊 +common.continueAndAddText=確定並新增 +common.continueText=確定並繼續 +common.copyText=復製 +common.dark=黑暗主題 +common.delText=刪除 +common.delTip=此操作將永久刪除該數據, 是否繼續? +common.detailText=詳情 +common.drawerSearchText=請輸入關鍵詞 +common.editText=編輯 +common.enterKeyword=請輸入關鍵詞 +common.expandAll=展開 +common.exportText=導出 +common.importText=導入 +common.inputPlaceholder=請輸入 +common.inputText=請輸入 +common.inputTextPrefix=請輸入 +common.keyword=關鍵詞 +common.leftTreeSearchText=請輸入關鍵詞 +common.light=亮色主題 +common.loadingText=加載中... +common.moreText=更多 +common.next=下一步 +common.nextRecord=下一條 +common.noData=暫無數據 +common.okText=確定 +common.prev=上一步 +common.previewText=預覽 +common.prevRecord=上一條 +common.printText=打印 +common.queryText=查詢 +common.redo=刷新 +common.redoText=重做 +common.resetText=重置 +common.saveText=保存 +common.searchText=搜索 +common.selectDataTip=請選擇一條數據 +common.selectI18nCode=選擇翻譯標記 +common.selectPlaceholder=請選擇 +common.submitText=提交 +common.superQuery=高級查詢 +common.syncText=第三方同步 +common.tipTitle=提示 +common.undoText=撤銷 +component.app.searchNotData=暫無搜索結果 +component.app.toNavigate=切換 +component.app.toSearch=確認 +component.countdown.normalText=獲取驗證碼 +component.countdown.sendText={0}秒後重新獲取 +component.cropper.btn_reset=重置 +component.cropper.btn_rotate_left=逆時針旋轉 +component.cropper.btn_rotate_right=順時針旋轉 +component.cropper.btn_scale_x=水平翻轉 +component.cropper.btn_scale_y=垂直翻轉 +component.cropper.btn_zoom_in=放大 +component.cropper.btn_zoom_out=縮小 +component.cropper.modalTitle=頭像上傳 +component.cropper.okText=確認並上傳 +component.cropper.preview=預覽 +component.cropper.selectImage=選擇圖片 +component.cropper.uploadSuccess=上傳成功 +component.drawer.cancelText=關閉 +component.drawer.loadingText=加載中... +component.drawer.okText=確認 +component.excel.exportModalTitle=導出數據 +component.excel.fileName=文件名 +component.excel.fileType=文件類型 +component.form.apiSelectNotFound=請等待數據加載完成... +component.form.fold=收起 +component.form.maxTip=字符數應小於{0}位 +component.form.unfold=展開 +component.icon.copy=復製圖標成功! +component.icon.placeholder=點擊選擇圖標 +component.icon.search=搜索圖標 +component.com.yunzhupaas.areaSelect.modalTitle=省市區 +component.com.yunzhupaas.calculate.storage=用於展示計算結果,且數據同時會保存入庫 +component.com.yunzhupaas.calculate.unStorage=用於展示計算結果,且數據不會保存 +component.com.yunzhupaas.common.allData=全部數據 +component.com.yunzhupaas.common.autoGenerate=系統自動生成 +component.com.yunzhupaas.common.clearAll=清空列表 +component.com.yunzhupaas.common.selected=已選 +component.com.yunzhupaas.dateRange.endPlaceholder=結束日期 +component.com.yunzhupaas.dateRange.startPlaceholder=開始日期 +component.com.yunzhupaas.depSelect.modalTitle=選擇部門 +component.com.yunzhupaas.groupSelect.modalTitle=選擇分組 +component.com.yunzhupaas.iconPicker.modalTitle=圖標選擇 +component.com.yunzhupaas.iconPicker.searchPlaceholder=請輸入關鍵詞 +component.com.yunzhupaas.iconPicker.select=選擇 +component.com.yunzhupaas.iconPicker.ymCustom=ymCustom圖標 +component.com.yunzhupaas.iconPicker.ymIcon=ymIcon圖標 +component.com.yunzhupaas.location.location=添加定位 +component.com.yunzhupaas.location.modalTitle=選擇位置 +component.com.yunzhupaas.location.relocation=重新定位 +component.com.yunzhupaas.location.searchPlaceholder=搜索或直接在地圖上點選 +component.com.yunzhupaas.numberRange.max=最大值 +component.com.yunzhupaas.numberRange.min=最小值 +component.com.yunzhupaas.organizeSelect.modalTitle=選擇組織 +component.com.yunzhupaas.popupAttr.storage=用於展示關聯彈窗的屬性,且數據同時會保存入庫 +component.com.yunzhupaas.popupAttr.unStorage=用於展示關聯彈窗的屬性,且數據不會保存 +component.com.yunzhupaas.popupSelect.modalTitle=選擇數據 +component.com.yunzhupaas.posSelect.modalTitle=選擇崗位 +component.com.yunzhupaas.relationFormAttr.storage=用於展示關聯表單的屬性,且數據同時會保存入庫 +component.com.yunzhupaas.relationFormAttr.unStorage=用於展示關聯表單的屬性,且數據不會保存 +component.com.yunzhupaas.roleSelect.modalTitle=選擇角色 +component.com.yunzhupaas.sign.operateTip=請在此區域使用鼠標手寫簽名 +component.com.yunzhupaas.sign.signPlaceholder=請簽名 +component.com.yunzhupaas.sign.signTip=手寫簽名 +component.com.yunzhupaas.timeRange.endPlaceholder=結束時間 +component.com.yunzhupaas.timeRange.startPlaceholder=開始時間 +component.com.yunzhupaas.userSelect.modalTitle=選擇用戶 +component.menu.search=菜單搜索 +component.modal.cancelText=關閉 +component.modal.close=關閉 +component.modal.maximize=最大化 +component.modal.okText=確認 +component.modal.restore=還原 +component.table.action=操作 +component.table.index=序號 +component.table.settingColumn=列設置 +component.table.settingColumnShow=列展示 +component.table.settingDens=密度 +component.table.settingDensDefault=默認 +component.table.settingDensMiddle=中等 +component.table.settingDensSmall=緊湊 +component.table.settingFixedLeft=固定到左側 +component.table.settingFixedRight=固定到右側 +component.table.settingFullScreen=全屏 +component.table.settingIndexColumnShow=序號列 +component.table.settingSelectColumnShow=勾選列 +component.table.status=狀態 +component.table.summary=合計 +component.table.total=共 {total} 條數據 +component.time.after=後 +component.time.before=前 +component.time.days=天 +component.time.hours=小時 +component.time.just=剛剛 +component.time.minutes=分鐘 +component.time.seconds=秒 +component.tree.checkStrictly=層級關聯 +component.tree.checkUnStrictly=層級獨立 +component.tree.expandAll=展開全部 +component.tree.reload=刷新數據 +component.tree.selectAll=選擇全部 +component.tree.unExpandAll=折疊全部 +component.tree.unSelectAll=取消選擇 +component.upload.accept=支持{0}格式 +component.upload.acceptUpload=只能上傳{0}格式文件 +component.upload.audio=音頻 +component.upload.buttonText=點擊上傳 +component.upload.checking=文件校驗中 +component.upload.choose=選擇文件 +component.upload.del=刪除 +component.upload.download=下載 +component.upload.downloadAll=全部下載 +component.upload.fileMaxNumber=最多可以上傳{0}個文件 +component.upload.fileMaxSize=文件大小超過{size}{unit} +component.upload.fileName=文件名 +component.upload.fileReadError=文件{0}讀取出錯,請檢查該文件 +component.upload.fileSize=文件大小 +component.upload.fileStatue=狀態 +component.upload.fileTypeCheck=請選擇{0}類型的文件 +component.upload.image=圖片 +component.upload.imageMaxNumber=最多可以上傳{0}張圖片 +component.upload.imageMaxSize=圖片大小超過{size}{unit} +component.upload.imgUpload=圖片上傳 +component.upload.legend=略縮圖 +component.upload.maxNumber=最多只能上傳{0}個文件 +component.upload.maxSize=單個文件不超過{0}MB +component.upload.maxSizeMultiple=只能上傳不超過{0}MB的文件! +component.upload.operating=操作 +component.upload.paused=暫停中 +component.upload.preview=預覽 +component.upload.reUploadFailed=重新上傳失敗文件 +component.upload.save=保存 +component.upload.saveError=沒有上傳成功的文件,無法保存! +component.upload.saveWarn=請等待文件上傳後,保存! +component.upload.startUpload=開始上傳 +component.upload.upload=上傳 +component.upload.uploaded=已上傳 +component.upload.uploadError=上傳失敗 +component.upload.uploadImg=請上傳圖片 +component.upload.uploading=上傳中 +component.upload.uploadSuccess=上傳成功 +component.upload.uploadWait=請等待文件上傳結束後操作 +component.upload.video=視頻 +component.upload.videoNoPreview=音視頻文件不能預覽 +component.upload.view=查看 +component.upload.viewImage=查看圖片 +component.upload.waiting=等待中 +component.upload.zipNoPreview=壓縮包不能預覽 +component.verify.dragText=請按住滑塊拖動 +component.verify.error=驗證失敗! +component.verify.redoTip=點擊圖片可刷新 +component.verify.successText=驗證通過 +component.verify.time=驗證校驗成功,耗時{time}秒! +formGenerator.cleanComponentTip=確定要清空所有組件嗎? +formGenerator.component.alert=提示 +formGenerator.component.areaSelect=省市區域 +formGenerator.component.autoComplete=下拉補全 +formGenerator.component.barcode=條形碼 +formGenerator.component.billRule=單據組件 +formGenerator.component.button=按鈕 +formGenerator.component.calculate=計算公式 +formGenerator.component.card=卡片容器 +formGenerator.component.cascader=級聯選擇 +formGenerator.component.checkbox=多選框組 +formGenerator.component.collapse=折疊面板 +formGenerator.component.colorPicker=顏色選擇 +formGenerator.component.createTime=創建時間 +formGenerator.component.createUser=創建人員 +formGenerator.component.currOrganize=所屬組織 +formGenerator.component.currPosition=所屬崗位 +formGenerator.component.datePicker=日期選擇 +formGenerator.component.depSelect=部門選擇 +formGenerator.component.divider=分割線 +formGenerator.component.editor=富文本 +formGenerator.component.groupSelect=分組選擇 +formGenerator.component.groupTitle=分組標題 +formGenerator.component.iframe=Iframe +formGenerator.component.input=單行輸入 +formGenerator.component.inputNumber=數字輸入 +formGenerator.component.link=鏈接 +formGenerator.component.location=定位 +formGenerator.component.modifyTime=修改時間 +formGenerator.component.modifyUser=修改人員 +formGenerator.component.organizeSelect=組織選擇 +formGenerator.component.popupAttr=彈窗選擇屬性 +formGenerator.component.popupSelect=彈窗選擇 +formGenerator.component.popupTableSelect=下拉表格 +formGenerator.component.posSelect=崗位選擇 +formGenerator.component.qrcode=二維碼 +formGenerator.component.radio=單選框組 +formGenerator.component.rate=評分 +formGenerator.component.relationForm=關聯表單 +formGenerator.component.relationFormAttr=關聯表單屬性 +formGenerator.component.roleSelect=角色選擇 +formGenerator.component.row=柵格容器 +formGenerator.component.select=下拉選擇 +formGenerator.component.sign=手寫簽名 +formGenerator.component.slider=滑塊 +formGenerator.component.switch=開關 +formGenerator.component.tab=標簽面板 +formGenerator.component.table=設計子表 +formGenerator.component.tableGrid=表格容器 +formGenerator.component.text=文本 +formGenerator.component.textarea=多行輸入 +formGenerator.component.timePicker=時間選擇 +formGenerator.component.treeSelect=下拉樹形 +formGenerator.component.uploadFile=文件上傳 +formGenerator.component.uploadImg=圖片上傳 +formGenerator.component.userSelect=用戶選擇 +formGenerator.component.usersSelect=用戶組件 +formGenerator.copyComponentTip=確定復製該組件? +formGenerator.delComponentTip=確定刪除該組件? +layout.footer.onlineDocument=在線文檔 +layout.footer.onlinePreview=在線預覽 +layout.header.about=關於平臺 +layout.header.commonMenus=常用菜單 +layout.header.dropdownItemDoc=文檔 +layout.header.dropdownItemLoginOut=退出系統 +layout.header.feedback=反饋問題 +layout.header.home=首頁 +layout.header.lockScreen=鎖定屏幕 +layout.header.lockScreenBtn=鎖定 +layout.header.lockScreenPassword=鎖屏密碼 +layout.header.profile=個人信息 +layout.header.setting=設置 +layout.header.standingChange=切換身份 +layout.header.statement=官方聲明 +layout.header.systemChange=應用切換 +layout.header.tooltipChat=聊天 +layout.header.tooltipEntryFull=全屏 +layout.header.tooltipErrorLog=錯誤日誌 +layout.header.tooltipExitFull=退出全屏 +layout.header.tooltipLock=鎖定屏幕 +layout.header.tooltipNotify=消息 +layout.multipleTab.close=關閉標簽頁 +layout.multipleTab.closeAll=關閉全部標簽頁 +layout.multipleTab.closeLeft=關閉左側標簽頁 +layout.multipleTab.closeOther=關閉其它標簽頁 +layout.multipleTab.closeRight=關閉右側標簽頁 +layout.multipleTab.reload=重新加載 +layout.multipleTab.setCommon=設為常用菜單 +layout.setting.animation=動畫 +layout.setting.animationType=動畫類型 +layout.setting.autoScreenLock=自動鎖屏 +layout.setting.blueBg=蔚藍星辰 +layout.setting.breadcrumb=面包屑 +layout.setting.breadcrumbIcon=面包屑圖標 +layout.setting.cachePage=緩存頁面 +layout.setting.clearBtn=清空緩存並返回登錄頁 +layout.setting.closeMixSidebarOnChange=切換頁面關閉菜單 +layout.setting.collapseMenuDisplayName=折疊菜單顯示名稱 +layout.setting.colorWeak=色弱模式 +layout.setting.contentMode=內容區域寬度 +layout.setting.contentModeFixed=定寬 +layout.setting.contentModeFull=流式 +layout.setting.copyBtn=拷貝 +layout.setting.darkMode=主題 +layout.setting.defaultBg=經典主題 +layout.setting.drawerTitle=配置 +layout.setting.expandedMenuWidth=菜單展開寬度 +layout.setting.fixedHeader=固定header +layout.setting.fixedSideBar=固定Sidebar +layout.setting.footer=頁腳 +layout.setting.fullContent=全屏內容 +layout.setting.grayMode=灰色模式 +layout.setting.greenBg=碧綠翠風 +layout.setting.header=頂欄 +layout.setting.headerTheme=頂欄主題 +layout.setting.interfaceDisplay=界面顯示 +layout.setting.interfaceFunction=界面功能 +layout.setting.menuAccordion=側邊菜單手風琴模式 +layout.setting.menuCollapse=折疊菜單 +layout.setting.menuCollapseButton=菜單折疊按鈕 +layout.setting.menuDrag=側邊菜單拖拽 +layout.setting.menuSearch=菜單搜索 +layout.setting.menuTriggerBottom=底部 +layout.setting.menuTriggerNone=不顯示 +layout.setting.menuTriggerTop=頂部 +layout.setting.menuTypeMix=頂部混合模式 +layout.setting.menuTypeMixSidebar=左側混合模式 +layout.setting.menuTypeSidebar=左側菜單模式 +layout.setting.menuTypeTopMenu=頂部菜單模式 +layout.setting.minute=分鐘 +layout.setting.mixSidebarFixed=固定展開菜單 +layout.setting.mixSidebarTrigger=混合菜單觸發方式 +layout.setting.navMode=導航欄模式 +layout.setting.notAutoScreenLock=不自動鎖屏 +layout.setting.off=關 +layout.setting.on=開 +layout.setting.operatingContent=復製成功,請到 src/settings/projectSetting.ts 中修改配置! +layout.setting.operatingTitle=操作成功 +layout.setting.progress=頂部進度條 +layout.setting.purpleBg=紫藤蘿蘭 +layout.setting.resetSuccess=重置成功! +layout.setting.sidebar=左側菜單 +layout.setting.sidebarTheme=菜單主題 +layout.setting.splitMenu=分割菜單 +layout.setting.switchAnimation=切換動畫 +layout.setting.switchLoading=切換loading +layout.setting.systemBackground=系統背景 +layout.setting.sysTheme=系統主題 +layout.setting.tabDetail=標簽詳情頁 +layout.setting.tabs=標簽頁 +layout.setting.tabsFoldBtn=標簽頁折疊按鈕 +layout.setting.tabsIcon=標簽圖標 +layout.setting.tabsQuickBtn=標簽頁快捷按鈕 +layout.setting.tabsRedoBtn=標簽頁刷新按鈕 +layout.setting.toggleLocale=語言切換 +layout.setting.topMenuAlignCenter=居右 +layout.setting.topMenuAlignLeft=居左 +layout.setting.topMenuAlignRight=居中 +layout.setting.topMenuLayout=頂部菜單布局 +layout.setting.triggerClick=點擊 +layout.setting.triggerHover=懸停 +routes.basic.emailDetail=查看郵件 +routes.basic.errorLogList=錯誤日誌列表 +routes.basic.externalLink=鏈接 +routes.basic.home=首頁 +routes.basic.login=登錄 +routes.basic.previewModel=功能預覽 +routes.basic.workFlowDetail=流程詳情 +routes.commonWords=審批常用語 +routes.dataReport=報表示例(原) +routes.extend=開發示例 +routes.extend-barCode=條碼示例 +routes.extend-bigData=百萬數據 +routes.extend-documentPreview=文檔示例 +routes.extend-email=郵件收發 +routes.extend-formDemo=表單示例 +routes.extend-formDemo-fieldForm1=表單字段1 +routes.extend-formDemo-fieldForm2=表單字段2 +routes.extend-formDemo-fieldForm3=表單字段3 +routes.extend-formDemo-fieldForm4=表單字段4 +routes.extend-formDemo-fieldForm5=表單字段5 +routes.extend-formDemo-fieldForm6=表單字段6 +routes.extend-formDemo-verifyForm=表單驗證 +routes.extend-formDemo-verifyForm1=表單驗證1 +routes.extend-functionDemo=功能示例 +routes.extend-graphDemo=圖表示例 +routes.extend-graphDemo-echartsBar=E-柱狀圖 +routes.extend-graphDemo-echartsBarAcross=E-橫狀條形圖 +routes.extend-graphDemo-echartsCandlestick=E-K線圖 +routes.extend-graphDemo-echartsFunnel=E-漏鬥圖 +routes.extend-graphDemo-echartsGauge=E-儀表圖 +routes.extend-graphDemo-echartsLineArea=E-線形圖 +routes.extend-graphDemo-echartsLineBar=E-折柱混合圖 +routes.extend-graphDemo-echartsPie=E-餅狀圖 +routes.extend-graphDemo-echartsScatter=E-散點圖 +routes.extend-graphDemo-echartsTree=E-樹形圖 +routes.extend-graphDemo-highchartsArea=H-面積圖 +routes.extend-graphDemo-highchartsBellcurve=H-貝爾曲線 +routes.extend-graphDemo-highchartsBullet=H-子彈圖 +routes.extend-graphDemo-highchartsColumn=H-柱狀圖 +routes.extend-graphDemo-highchartsFunnel=H-漏鬥圖 +routes.extend-graphDemo-highchartsGauge=H-儀表圖 +routes.extend-graphDemo-highchartsLine=H-線性圖 +routes.extend-graphDemo-highchartsPie=H-餅狀圖 +routes.extend-graphDemo-highchartsScatter=H-散點圖 +routes.extend-graphDemo-highchartsWordcloud=H-詞雲圖 +routes.extend-importAndExport=導入導出 +routes.extend-map=地圖示例 +routes.extend-order=訂單管理 +routes.extend-orderDemo=訂單示例 +routes.extend-portalDemo=門戶示例 +routes.extend-printData=打印示例 +routes.extend-projectGantt=項目管理 +routes.extend-schedule=日程安排 +routes.extend-signature=電子簽名 +routes.extend-signet=電子簽章 +routes.extend-tableDemo=表格示例 +routes.extend-tableDemo-commonTable=普通表格 +routes.extend-tableDemo-complexHeader=復雜表頭 +routes.extend-tableDemo-extension=延伸擴展 +routes.extend-tableDemo-groupingTable=表格分組 +routes.extend-tableDemo-lockTable=表格鎖定 +routes.extend-tableDemo-mergeTable=表格合並 +routes.extend-tableDemo-postilTable=表格批註 +routes.extend-tableDemo-printTable=表格打印 +routes.extend-tableDemo-redactTable=表格編輯 +routes.extend-tableDemo-signTable=表格標記 +routes.extend-tableDemo-statisticsTable=表格統計 +routes.extend-tableDemo-tableTree=表格樹形 +routes.extend-tableDemo-treeTable=樹形表格 +routes.flowEngine=流程引擎 +routes.formDesign=系統表單 +routes.generator=代碼生成 +routes.generator-appForm=移動表單 +routes.generator-flowForm=發起表單 +routes.generator-webForm=功能表單 +routes.lioui=流程示例 +routes.mainSystem=開發平臺 +routes.moreMenu=更多... +routes.msgCenter=消息中心 +routes.msgCenter-accountConfig=賬號配置 +routes.msgCenter-accountConfig-ding=釘釘配置 +routes.msgCenter-accountConfig-mail=郵箱配置 +routes.msgCenter-accountConfig-mp=微信公眾號配置 +routes.msgCenter-accountConfig-shortMsg=短信配置 +routes.msgCenter-accountConfig-webhook=webhook配置 +routes.msgCenter-accountConfig-weCom=企業微信配置 +routes.msgCenter-msgMonitor=消息監控 +routes.msgCenter-msgTemplate=消息模板 +routes.msgCenter-sendConfig=發送配置 +routes.onlineDev=在線開發 +routes.onlineDev-appDesign=移動設計 +routes.onlineDev-dataReport=報表設計(原) +routes.onlineDev-dataScreen=大屏設計 +routes.onlineDev-integration=集成助手 +routes.onlineDev-printDev=打印設計 +routes.onlineDev-report=報表設計 +routes.onlineDev-visualPortal=門戶設計 +routes.onlineDev-webDesign=表單設計 +routes.permission=組織權限 +routes.permission-auth=權限管理 +routes.permission-authorize=權限組 +routes.permission-department=部門管理 +routes.permission-grade=管理員 +routes.permission-group=分組管理 +routes.permission-organize=組織管理 +routes.permission-position=崗位管理 +routes.permission-role=角色管理 +routes.permission-user=用戶管理 +routes.permission-userOnline=在線用戶 +routes.printDemo=打印示例 +routes.report=報表示例 +routes.reportBI=大屏示例 +routes.system=系統管理 +routes.system-area=行政區劃 +routes.system-billRule=單據模板 +routes.system-cache=系統緩存 +routes.system-icons=系統圖標 +routes.system-kit=表單範本 +routes.system-language=翻譯管理 +routes.system-log=系統日誌 +routes.system-menu=應用菜單 +routes.system-messageTemplate=消息模板 +routes.system-monitor=系統監控 +routes.system-notice=系統公告 +routes.system-signature=簽章管理 +routes.system-smsTemplate=短信模板 +routes.system-sysConfig=系統配置 +routes.system-systemTemplate=系統模板 +routes.system-task=系統調度 +routes.systemData=數據應用 +routes.systemData-dataBackup=數據備份 +routes.systemData-dataInterface=數據接口 +routes.systemData-dataModel=數據建模 +routes.systemData-dataSource=數據連接 +routes.systemData-dataSync=數據同步 +routes.systemData-dictionary=數據字典 +routes.systemData-interfaceAuth=接口認證 +routes.systemData-map=數據地圖 +routes.weChat=微信配置 +routes.weChat-mpConfig=公眾號配置 +routes.weChat-mpMaterial=公眾號素材 +routes.weChat-mpMenu=公眾號菜單 +routes.weChat-mpMessage=公眾號消息 +routes.weChat-mpUser=公眾號用戶 +routes.weChat-qyDepartment=企業號組織 +routes.weChat-qyhConfig=企業號配置 +routes.weChat-qyMessage=企業號消息 +routes.weChat-qyUser=企業號用戶 +routes.workFlow=協同辦公 +routes.workFlow-addFlow=發起流程 +routes.workFlow-document=文檔中心 +routes.workFlow-entrust=流程委托 +routes.workFlow-flowCirculate=抄送我的 +routes.workFlow-flowDoing=我的在辦 +routes.workFlow-flowDone=我的已辦 +routes.workFlow-flowEngine=流程設計 +routes.workFlow-flowLaunch=我發起的 +routes.workFlow-flowMonitor=流程監控 +routes.workFlow-flowTodo=我的待辦 +routes.workFlow-flowToSign=我的待簽 +routes.workFlow-form=表單設計 +routes.workFlow-printTemplate=打印模板 +routes.workFlow-schedule=日程安排 +routes.workSystem=業務平臺 +sys.api.apiRequestFailed=請求出錯,請稍候重試 +sys.api.apiTimeoutMessage=接口請求超時,請刷新頁面重試! +sys.api.errMsg401=用戶沒有權限(令牌、用戶名、密碼錯誤)! +sys.api.errMsg403=用戶得到授權,但是訪問是被禁止的。! +sys.api.errMsg404=網絡請求錯誤,未找到該資源! +sys.api.errMsg405=網絡請求錯誤,請求方法未允許! +sys.api.errMsg408=網絡請求超時! +sys.api.errMsg500=服務器錯誤,請聯系管理員! +sys.api.errMsg501=網絡未實現! +sys.api.errMsg502=網絡錯誤! +sys.api.errMsg503=服務不可用,服務器暫時過載或維護! +sys.api.errMsg504=網絡超時! +sys.api.errMsg505=http版本不支持該請求! +sys.api.errorMessage=操作失敗,系統異常! +sys.api.errorTip=錯誤提示 +sys.api.networkException=網絡異常 +sys.api.networkExceptionMsg=網絡異常,請檢查您的網絡連接是否正常! +sys.api.operationFailed=操作失敗 +sys.api.timeoutMessage=登錄超時,請重新登錄! +sys.app.logoutMessage=是否確認退出系統? +sys.app.logoutTip=溫馨提醒 +sys.app.menuLoading=菜單加載中... +sys.errorLog.enableMessage=只在`/src/settings/projectSetting.ts` 內的useErrorHandle=true時生效. +sys.errorLog.fireAjaxError=點擊觸發ajax錯誤 +sys.errorLog.fireResourceError=點擊觸發資源加載錯誤 +sys.errorLog.fireVueError=點擊觸發vue錯誤 +sys.errorLog.modalTitle=錯誤詳情 +sys.errorLog.tableActionDesc=詳情 +sys.errorLog.tableColumnDate=時間 +sys.errorLog.tableColumnFile=文件 +sys.errorLog.tableColumnMsg=錯誤信息 +sys.errorLog.tableColumnStackMsg=stack信息 +sys.errorLog.tableColumnType=類型 +sys.errorLog.tableTitle=錯誤日誌列表 +sys.exception.backHome=返回首頁 +sys.exception.backLogin=返回登錄 +sys.exception.networkErrorSubTitle=抱歉,您的網絡連接已斷開,請檢查您的網絡! +sys.exception.networkErrorTitle=網絡錯誤 +sys.exception.noDataTitle=當前頁無數據 +sys.exception.subTitle403=抱歉,您無權訪問此頁面。 +sys.exception.subTitle404=抱歉,您訪問的頁面不存在。 +sys.exception.subTitle500=抱歉,服務器報告錯誤。 +sys.lock.alert=鎖屏密碼錯誤 +sys.lock.backToLogin=返回登錄 +sys.lock.entry=進入系統 +sys.lock.placeholder=請輸入登錄密碼 +sys.lock.unlock=點擊解鎖 +sys.login.accountPlaceholder=請輸入賬號 +sys.login.accountTip=請輸入賬號 +sys.login.backSignIn=返回 +sys.login.changeCode=點擊切換驗證碼 +sys.login.codeTip=請輸入驗證碼 +sys.login.codeTitle=手機驗證登錄 +sys.login.company=請輸入公司名 +sys.login.confirmLogin=請在手機端確認登錄 +sys.login.confirmPassword=確認密碼 +sys.login.contacts=請輸入聯系人 +sys.login.diffPwd=兩次輸入密碼不一致 +sys.login.email=郵箱 +sys.login.expired=二維碼已失效 +sys.login.forgetFormTitle=重置密碼 +sys.login.forgetPassword=忘記密碼? +sys.login.getCode=獲取驗證碼 +sys.login.lastLoginInfo=上次登錄信息 +sys.login.logIn=登錄 +sys.login.loginButton=登錄 +sys.login.mobile=請輸入手機號 +sys.login.mobilePlaceholder=請輸入手機號碼 +sys.login.mobileSignInFormTitle=手機驗證碼登錄 +sys.login.otherLogin=其他登錄方式 +sys.login.otherSignIn=其他登錄方式 +sys.login.password=請輸入密碼 +sys.login.passwordPlaceholder=請輸入密碼 +sys.login.passwordTip=請輸入密碼 +sys.login.policy=我同意xxx隱私政策 +sys.login.policyPlaceholder=勾選後才能註冊 +sys.login.qrCodeTip=請使用APP掃描二維碼登錄,180秒後二維碼失效 +sys.login.qrSignInFormTitle=掃碼登錄 +sys.login.recoverCode=取消登錄 +sys.login.refreshCode=點擊刷新 +sys.login.registerButton=註冊 +sys.login.rememberMe=記住我 +sys.login.reSend=重新發送 +sys.login.rightMobile=請輸入正確的手機號 +sys.login.rule=租戶子賬戶規則:租戶號{'@'}賬戶 例:18577778888{'@'}101001 +sys.login.scanSign=掃碼後點擊"確認",即可完成登錄 +sys.login.scanSuccessful=掃碼成功 +sys.login.scanTip=掃碼登錄 +sys.login.scanTitle=掃碼登錄 +sys.login.signInDesc=輸入您的個人詳細信息開始使用! +sys.login.signInFormTitle=賬號密碼登錄 +sys.login.signInTitle=開箱即用的中後臺管理系統 +sys.login.signUpFormTitle=註冊 +sys.login.smsCode=請輸入驗證碼 +sys.login.smsPlaceholder=請輸入驗證碼 +sys.login.subTitle=通過帳號密碼登錄 +sys.login.subTitle1=通過手機驗證碼登錄,或者切換為 +sys.login.subTitle2=通過帳號密碼登錄,或者切換為 +sys.login.subTitle3=通過掃碼登錄,或者切換為 +sys.login.title=賬戶密碼登錄 +sys.login.upper=大寫已鎖定 +sys.login.username=請輸入賬號 +sys.login.version=版本 +sys.login.welcome=歡迎使用 +sys.validate.arrayRequiredPrefix=請至少選擇一個 +sys.validate.date=請輸入正確的日期 +sys.validate.email=請輸入正確的郵箱 +sys.validate.idCard=請輸入正確的身份證號碼 +sys.validate.mobilePhone=請輸入正確的手機號碼 +sys.validate.money=請輸入正確的金額 +sys.validate.number=請輸入正確的數字 +sys.validate.phone=請輸入正確的聯系方式 +sys.validate.telephone=請輸入正確的電話號碼 +sys.validate.textRequiredSuffix=不能為空 +sys.validate.url=請輸入正確的網址 +views.dynamicModel.hideSome=隱藏部分 +views.dynamicModel.passwordPlaceholder=請輸入密碼 +views.dynamicModel.scanAndShare=掃描二維碼,分享此鏈接 +views.dynamicModel.showMore=加載更多 +views.http404.goBackBtn=返回首頁 +views.http404.subTips=請檢查您輸入的URL是否正確,或單擊按鈕返回首頁。 +views.http404.tips=抱歉,你訪問的頁面不存在或無權訪問! diff --git a/yunzhupaas-admin/src/main/resources/ip2region/ip2region.xdb b/yunzhupaas-admin/src/main/resources/ip2region/ip2region.xdb new file mode 100644 index 0000000..e31b685 Binary files /dev/null and b/yunzhupaas-admin/src/main/resources/ip2region/ip2region.xdb differ diff --git a/yunzhupaas-admin/src/main/resources/logback-spring.xml b/yunzhupaas-admin/src/main/resources/logback-spring.xml new file mode 100644 index 0000000..6da9c9b --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/logback-spring.xml @@ -0,0 +1,335 @@ + + + + + + + + + + + + + + + + + + + + ${LOG_PATH}/log_error.log + + + + + + ${LOG_PATH}/error/%d{yyyy-MM-dd,aux}/log-error-%d{yyyy-MM-dd}.%i.log + + 7 + + + 10MB + + + + true + + + + ${FILE_LOG_PATTERN} + utf-8 + + + + + error + ACCEPT + DENY + + + + + + + + + ${LOG_PATH}/log_info.log + + + + + + ${LOG_PATH}/info/%d{yyyy-MM-dd,aux}/log-info-%d{yyyy-MM-dd}.%i.log + + 7 + + + 10MB + + + + true + + + + ${FILE_LOG_PATTERN} + utf-8 + + + + + info + ACCEPT + DENY + + + + + + + + + ${LOG_PATH}/log_warn.log + + + + + + ${LOG_PATH}/warn/%d{yyyy-MM-dd,aux}/log-warn-%d{yyyy-MM-dd}.%i.log + + 7 + + + 10MB + + + + true + + + + ${FILE_LOG_PATTERN} + utf-8 + + + + + warn + ACCEPT + DENY + + + + + + + + ${LOG_PATH}/log_debug.log + + + + + + ${LOG_PATH}/debug/%d{yyyy-MM-dd,aux}/log-debug-%d{yyyy-MM-dd}.%i.log + + 7 + + + 10MB + + + + true + + + + ${FILE_LOG_PATTERN} + utf-8 + + + + + debug + ACCEPT + DENY + + + + + + + + + ${LOG_PATH}/log_total.log + + + + + + ${LOG_PATH}/total/%d{yyyy-MM-dd,aux}/log-total-%d{yyyy-MM-dd}.%i.log + + 7 + + + 10MB + + + + true + + + + ${FILE_LOG_PATTERN} + utf-8 + + + + + + + + + ${LOG_PATH}/log_release.log + + + + + + ${LOG_PATH}/release/%d{yyyy-MM-dd,aux}/log-warn-%d{yyyy-MM-dd}.%i.log + + 7 + + + 10MB + + + + true + + + + ${FILE_LOG_PATTERN} + utf-8 + + + + + ${LOG_LEVEL} + ACCEPT + DENY + + + + + 0 + 256 + + + + + 0 + 256 + + + + + 0 + 256 + + + + + 0 + 256 + + + + + 0 + 256 + + + + + + + ${CONSOLE_LOG_PATTERN} + utf-8 + + + + + + + 0 + 256 + + + + + + + + + + + + + + + + + + + + + diff --git a/yunzhupaas-admin/src/main/resources/mapper/extend/BigDataMapper.xml b/yunzhupaas-admin/src/main/resources/mapper/extend/BigDataMapper.xml new file mode 100644 index 0000000..fb8c894 --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/mapper/extend/BigDataMapper.xml @@ -0,0 +1,9 @@ + + + + + + + diff --git a/yunzhupaas-admin/src/main/resources/mapper/form/FormMapper.xml b/yunzhupaas-admin/src/main/resources/mapper/form/FormMapper.xml new file mode 100644 index 0000000..a9f2f12 --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/mapper/form/FormMapper.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + diff --git a/yunzhupaas-admin/src/main/resources/mapper/mdm/CompanyBankMapper.xml b/yunzhupaas-admin/src/main/resources/mapper/mdm/CompanyBankMapper.xml new file mode 100644 index 0000000..dec6879 --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/mapper/mdm/CompanyBankMapper.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/yunzhupaas-admin/src/main/resources/mapper/mdm/CompanyInvoiceMapper.xml b/yunzhupaas-admin/src/main/resources/mapper/mdm/CompanyInvoiceMapper.xml new file mode 100644 index 0000000..4c4badd --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/mapper/mdm/CompanyInvoiceMapper.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/yunzhupaas-admin/src/main/resources/mapper/mdm/CompanyMapper.xml b/yunzhupaas-admin/src/main/resources/mapper/mdm/CompanyMapper.xml new file mode 100644 index 0000000..b5a1158 --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/mapper/mdm/CompanyMapper.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/yunzhupaas-admin/src/main/resources/mapper/mdm/CorporationMapper.xml b/yunzhupaas-admin/src/main/resources/mapper/mdm/CorporationMapper.xml new file mode 100644 index 0000000..8e60f3a --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/mapper/mdm/CorporationMapper.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/yunzhupaas-admin/src/main/resources/mapper/mdm/CustomersMapper.xml b/yunzhupaas-admin/src/main/resources/mapper/mdm/CustomersMapper.xml new file mode 100644 index 0000000..6b8a13e --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/mapper/mdm/CustomersMapper.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/yunzhupaas-admin/src/main/resources/mapper/mdm/MaterialMapper.xml b/yunzhupaas-admin/src/main/resources/mapper/mdm/MaterialMapper.xml new file mode 100644 index 0000000..6e5cd98 --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/mapper/mdm/MaterialMapper.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/yunzhupaas-admin/src/main/resources/mapper/mdm/PanyInvoiceMapper.xml b/yunzhupaas-admin/src/main/resources/mapper/mdm/PanyInvoiceMapper.xml new file mode 100644 index 0000000..ec4488b --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/mapper/mdm/PanyInvoiceMapper.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/yunzhupaas-admin/src/main/resources/mapper/mdm/ProductsMapper.xml b/yunzhupaas-admin/src/main/resources/mapper/mdm/ProductsMapper.xml new file mode 100644 index 0000000..9842846 --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/mapper/mdm/ProductsMapper.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/yunzhupaas-admin/src/main/resources/mapper/mdm/SupplierMapper.xml b/yunzhupaas-admin/src/main/resources/mapper/mdm/SupplierMapper.xml new file mode 100644 index 0000000..7e210bc --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/mapper/mdm/SupplierMapper.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/yunzhupaas-admin/src/main/resources/mapper/system/AuthorizeMapper.xml b/yunzhupaas-admin/src/main/resources/mapper/system/AuthorizeMapper.xml new file mode 100644 index 0000000..2a88cd1 --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/mapper/system/AuthorizeMapper.xml @@ -0,0 +1,243 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/yunzhupaas-admin/src/main/resources/mapper/system/ImContentMapper.xml b/yunzhupaas-admin/src/main/resources/mapper/system/ImContentMapper.xml new file mode 100644 index 0000000..bf51c94 --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/mapper/system/ImContentMapper.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + UPDATE base_im_content SET f_enabled_mark = 1, f_receive_time = #{map.receiveTime} WHERE 1 = 1 AND f_enabled_mark = 0 AND f_send_user_id = #{map.sendUserId} AND f_receive_user_id = #{map.receiveUserId} + + + diff --git a/yunzhupaas-admin/src/main/resources/mapper/system/ImReplyMapper.xml b/yunzhupaas-admin/src/main/resources/mapper/system/ImReplyMapper.xml new file mode 100644 index 0000000..59226bb --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/mapper/system/ImReplyMapper.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + diff --git a/yunzhupaas-admin/src/main/resources/mapper/system/MessageMapper.xml b/yunzhupaas-admin/src/main/resources/mapper/system/MessageMapper.xml new file mode 100644 index 0000000..06c235d --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/mapper/system/MessageMapper.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/yunzhupaas-admin/src/main/resources/mapper/system/PortalManageMapper.xml b/yunzhupaas-admin/src/main/resources/mapper/system/PortalManageMapper.xml new file mode 100644 index 0000000..8fe1455 --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/mapper/system/PortalManageMapper.xml @@ -0,0 +1,124 @@ + + + + + + SELECT + + bpm.f_id id, + bpm.f_enabled_mark enabledMark, + bpm.f_platform platform, + bpm.f_description description, + bpm.F_Tenant_Id tenantId, + bpm.f_sort_code sortCode, + bpm.f_system_id systemId, + bpm.f_portal_id portalId, + bpm.f_creator_time creatorTime, + bpm.f_last_modify_time lastModifyTime, + + bp.f_category categoryId, + bp.f_full_name portalName, + bd.f_full_name categoryName, + + us.F_Real_Name createUserName, + us.F_Account createUserAccount, + us2.F_Real_Name modifyUserName, + us2.F_Account modifyUserAccount + FROM + base_portal_manage bpm + LEFT JOIN + base_portal bp + ON + bpm.f_portal_id = bp.f_id + LEFT JOIN + base_user us + ON + bpm.F_Creator_User_Id = us.f_id + LEFT JOIN + base_user us2 + ON + bpm.F_Last_Modify_User_Id = us2.f_id + LEFT JOIN + base_dictionary_data bd + ON bp.f_category = bd.f_id + WHERE 1 = 1 + + AND (bp.f_full_name LIKE #{pmPage.keyword} OR bpm.f_description LIKE #{pmPage.keyword}) + + + AND + bp.f_category = #{pmPage.category} + + + AND + bpm.f_enabled_mark = #{pmPage.enabledMark} + + + + AND + bpm.f_platform LIKE #{pmPage.platform} + + + AND + bpm.f_system_id = #{pmPage.systemId} + + + AND + bp.F_state != #{pmPage.state} + + + + + + + + + diff --git a/yunzhupaas-admin/src/main/resources/mapper/system/PositionMapper.xml b/yunzhupaas-admin/src/main/resources/mapper/system/PositionMapper.xml new file mode 100644 index 0000000..0a7fec2 --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/mapper/system/PositionMapper.xml @@ -0,0 +1,9 @@ + + + + + + + diff --git a/yunzhupaas-admin/src/main/resources/mapper/system/RoleMapper.xml b/yunzhupaas-admin/src/main/resources/mapper/system/RoleMapper.xml new file mode 100644 index 0000000..48e623e --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/mapper/system/RoleMapper.xml @@ -0,0 +1,106 @@ + + + + + + + + + + + diff --git a/yunzhupaas-admin/src/main/resources/mapper/system/SysconfigMapper.xml b/yunzhupaas-admin/src/main/resources/mapper/system/SysconfigMapper.xml new file mode 100644 index 0000000..d953017 --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/mapper/system/SysconfigMapper.xml @@ -0,0 +1,15 @@ + + + + + + delete from base_sys_config where F_Category ='SysConfig' + + + delete from base_sys_config where F_Category='MPConfig' + + + delete from base_sys_config where F_Category='QYHConfig' + + + diff --git a/yunzhupaas-admin/src/main/resources/mapper/system/UserMapper.xml b/yunzhupaas-admin/src/main/resources/mapper/system/UserMapper.xml new file mode 100644 index 0000000..46ee468 --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/mapper/system/UserMapper.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + diff --git a/yunzhupaas-admin/src/main/resources/mapper/train/TrainExamRecordsMapper.xml b/yunzhupaas-admin/src/main/resources/mapper/train/TrainExamRecordsMapper.xml new file mode 100644 index 0000000..b46667c --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/mapper/train/TrainExamRecordsMapper.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/yunzhupaas-admin/src/main/resources/mapper/train/TrainLibraryEssayQuestionMapper.xml b/yunzhupaas-admin/src/main/resources/mapper/train/TrainLibraryEssayQuestionMapper.xml new file mode 100644 index 0000000..3c5b6fc --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/mapper/train/TrainLibraryEssayQuestionMapper.xml @@ -0,0 +1,21 @@ + + + + + + + + update make_train_library_essay_question + set f_result = #{item.result} + where f_id = #{item.id} + + + diff --git a/yunzhupaas-admin/src/main/resources/mapper/train/TrainLibraryJudgmentMapper.xml b/yunzhupaas-admin/src/main/resources/mapper/train/TrainLibraryJudgmentMapper.xml new file mode 100644 index 0000000..f6054b7 --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/mapper/train/TrainLibraryJudgmentMapper.xml @@ -0,0 +1,13 @@ + + + + + + diff --git a/yunzhupaas-admin/src/main/resources/mapper/train/TrainLibraryMoreMapper.xml b/yunzhupaas-admin/src/main/resources/mapper/train/TrainLibraryMoreMapper.xml new file mode 100644 index 0000000..b7ca342 --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/mapper/train/TrainLibraryMoreMapper.xml @@ -0,0 +1,17 @@ + + + + + + diff --git a/yunzhupaas-admin/src/main/resources/mapper/train/TrainLibrarySingleMapper.xml b/yunzhupaas-admin/src/main/resources/mapper/train/TrainLibrarySingleMapper.xml new file mode 100644 index 0000000..780ab97 --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/mapper/train/TrainLibrarySingleMapper.xml @@ -0,0 +1,16 @@ + + + + + diff --git a/yunzhupaas-admin/src/main/resources/mapper/train/TrainTestPaperLibraryMapper.xml b/yunzhupaas-admin/src/main/resources/mapper/train/TrainTestPaperLibraryMapper.xml new file mode 100644 index 0000000..32acd95 --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/mapper/train/TrainTestPaperLibraryMapper.xml @@ -0,0 +1,14 @@ + + + + + INSERT INTO make_train_exam_records + (f_id, f_number,f_library_id, f_examiners, f_full_name, f_sort, f_mark, f_result_score, f_basic_score, f_question_flag, + f_question_status, f_question_score, f_enabled_mark, f_sort_code, f_organize_id, f_creator_time, + f_creator_user_id,f_question_num,f_per_question) + VALUE (#{id}, #{fnumber},#{flibraryId} ,#{fexaminers}, #{ffullName}, #{fsort}, #{fmark}, #{fresultScore}, #{fbasicScore}, + #{fquestionFlag}, + #{fquestionStatus}, #{fquestionScore}, #{fenabledMark}, #{fsortCode}, #{forganizeId}, #{fcreatorTime}, + #{fcreatorUserId},#{fquestionNum},#{fperQuestion}) + + diff --git a/yunzhupaas-admin/src/main/resources/sharding-sphere.yml b/yunzhupaas-admin/src/main/resources/sharding-sphere.yml new file mode 100644 index 0000000..014bb20 --- /dev/null +++ b/yunzhupaas-admin/src/main/resources/sharding-sphere.yml @@ -0,0 +1,52 @@ +databaseName: myshardingsphere +dataSources: # 数据源配置 ============= + # <数据源_0>: # 自定义数据源名称 + # dataSourceClassName: com.zaxxer.hikari.HikariDataSource # 连接池提供方完整类名(Spring默认Hikari) + # driverClassName: com.mysql.jdbc.Driver # JDBC驱动 + # jdbcUrl: jdbc:mysql://{host}:{port}/{dbName}?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8 # 数据库连接URL + # username: {username} # 用户 + # password: {password} # 密码 + ds0: # 自定义数据源名称 + dataSourceClassName: com.alibaba.druid.pool.DruidDataSource # 连接池提供方完整类名(Spring默认Hikari) + driverClassName: com.mysql.jdbc.Driver # JDBC驱动 + url: jdbc:mysql://127.0.0.1:3306/sharding1?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8 # 数据库连接URL + username: root # 用户 + password: 123456 # 密码 + ds1: # 自定义数据源名称 + dataSourceClassName: com.alibaba.druid.pool.DruidDataSource # 连接池提供方完整类名(Spring默认Hikari) + driverClassName: com.mysql.jdbc.Driver # JDBC驱动 + url: jdbc:mysql://127.0.0.1:3306/sharding2?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8 # 数据库连接URL + username: root # 用户 + password: 123456 # 密码 +rules: # 规则 ============= + - !SHARDING # 注意类似“- !SHARDING”标识不能省略 + tables: + ext_bigdata: # 自定义逻辑表名 + actualDataNodes: ds${0..1}.ext_bigdata_$->{0..1} # 由数据源名 + 表名组成(参考 Inline 语法规则) + databaseStrategy: + standard: + shardingColumn: F_Id # 分表依据字段 + shardingAlgorithmName: myDataSourceAlgorithm + tableStrategy: # 表策略 ------- + standard: + shardingColumn: F_Id # 分表依据字段 + shardingAlgorithmName: myTableAlgorithm + + # defaultDatabaseStrategy: # 库策略 ------- + # standard: + # shardingColumn: F_Id + # shardingAlgorithmName: myDataSourceAlgorithm + shardingAlgorithms: # 分片算法 ------- + myDataSourceAlgorithm: # 自定义算法名 + type: INLINE + props: + algorithm-expression: ds${(long)(Long.parseLong(F_Id)/10) % 2} + myTableAlgorithm: # 自定义算法名 + type: INLINE + props: + algorithm-expression: ext_bigdata_${(long)(Long.parseLong(F_Id)/10 / 2) % 2} +# keyGenerators: +# dsKey: # 自定义主键策略名 +# type: SNOWFLAKE +props: + sql-show: true diff --git a/yunzhupaas-app/pom.xml b/yunzhupaas-app/pom.xml new file mode 100644 index 0000000..229d3ed --- /dev/null +++ b/yunzhupaas-app/pom.xml @@ -0,0 +1,20 @@ + + + + yunzhupaas-java-boot + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-app + pom + + yunzhupaas-app-entity + yunzhupaas-app-biz + yunzhupaas-app-controller + + + diff --git a/yunzhupaas-app/yunzhupaas-app-biz/pom.xml b/yunzhupaas-app/yunzhupaas-app-biz/pom.xml new file mode 100644 index 0000000..50235c2 --- /dev/null +++ b/yunzhupaas-app/yunzhupaas-app-biz/pom.xml @@ -0,0 +1,35 @@ + + + + yunzhupaas-app + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-app-biz + + + + com.yunzhupaas + yunzhupaas-app-entity + ${project.version} + compile + + + com.yunzhupaas + yunzhupaas-permission-biz + ${project.version} + compile + + + com.yunzhupaas + yunzhupaas-system-biz + ${project.version} + compile + + + + diff --git a/yunzhupaas-app/yunzhupaas-app-biz/src/main/java/com/yunzhupaas/mapper/AppDataMapper.java b/yunzhupaas-app/yunzhupaas-app-biz/src/main/java/com/yunzhupaas/mapper/AppDataMapper.java new file mode 100644 index 0000000..97de131 --- /dev/null +++ b/yunzhupaas-app/yunzhupaas-app-biz/src/main/java/com/yunzhupaas/mapper/AppDataMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.entity.AppDataEntity; + +/** + * app常用数据 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-07-08 + */ +public interface AppDataMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-app/yunzhupaas-app-biz/src/main/java/com/yunzhupaas/service/AppDataService.java b/yunzhupaas-app/yunzhupaas-app-biz/src/main/java/com/yunzhupaas/service/AppDataService.java new file mode 100644 index 0000000..5538466 --- /dev/null +++ b/yunzhupaas-app/yunzhupaas-app-biz/src/main/java/com/yunzhupaas/service/AppDataService.java @@ -0,0 +1,57 @@ +package com.yunzhupaas.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.entity.AppDataEntity; + +import java.util.List; + +/** + * app常用数据 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-08-08 + */ +public interface AppDataService extends SuperService { + + + /** + * 列表 + * + * @return + */ + List getList(); + + /** + * 信息 + * + * @param objectId 对象主键 + * @return + */ + AppDataEntity getInfo(String objectId); + + /** + * 验证名称 + * + * @param objectId 对象主键 + * @return + */ + boolean isExistByObjectId(String objectId, String systemId); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(AppDataEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(AppDataEntity entity); + +} + diff --git a/yunzhupaas-app/yunzhupaas-app-biz/src/main/java/com/yunzhupaas/service/AppService.java b/yunzhupaas-app/yunzhupaas-app-biz/src/main/java/com/yunzhupaas/service/AppService.java new file mode 100644 index 0000000..ccc3635 --- /dev/null +++ b/yunzhupaas-app/yunzhupaas-app-biz/src/main/java/com/yunzhupaas/service/AppService.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.service; + +import com.yunzhupaas.model.AppUserInfoVO; +import com.yunzhupaas.model.AppUsersVO; + +/** + * app用户信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-08-08 + */ +public interface AppService { + + /** + * app用户信息 + * @return + */ + AppUsersVO userInfo(); + + /** + * 通讯录 + * @return + */ + AppUserInfoVO getInfo(String id); + +} + diff --git a/yunzhupaas-app/yunzhupaas-app-biz/src/main/java/com/yunzhupaas/service/impl/AppDataServiceImpl.java b/yunzhupaas-app/yunzhupaas-app-biz/src/main/java/com/yunzhupaas/service/impl/AppDataServiceImpl.java new file mode 100644 index 0000000..6ca80bf --- /dev/null +++ b/yunzhupaas-app/yunzhupaas-app-biz/src/main/java/com/yunzhupaas/service/impl/AppDataServiceImpl.java @@ -0,0 +1,72 @@ +package com.yunzhupaas.service.impl; + + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.entity.AppDataEntity; +import com.yunzhupaas.mapper.AppDataMapper; +import com.yunzhupaas.service.AppDataService; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; + +/** + * app常用数据 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-08-08 + */ +@Service +public class AppDataServiceImpl extends SuperServiceImpl implements AppDataService { + + + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + return this.list(queryWrapper); + } + + @Override + public AppDataEntity getInfo(String objectId) { + UserInfo userInfo = UserProvider.getUser(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AppDataEntity::getObjectId, objectId).eq(AppDataEntity::getCreatorUserId, userInfo.getUserId()); + return this.getOne(queryWrapper); + } + + @Override + public boolean isExistByObjectId(String objectId, String systemId) { + UserInfo userInfo = UserProvider.getUser(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AppDataEntity::getObjectId, objectId) + .eq(AppDataEntity::getCreatorUserId, userInfo.getUserId()) + .eq(AppDataEntity::getSystemId, systemId); + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public void create(AppDataEntity entity) { + UserInfo userInfo = UserProvider.getUser(); + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(userInfo.getUserId()); + entity.setCreatorTime(new Date()); + entity.setEnabledMark(1); + entity.setSystemId(userInfo.getAppSystemId()); + this.save(entity); + } + + @Override + public void delete(AppDataEntity entity) { + this.removeById(entity.getId()); + } + + +} + diff --git a/yunzhupaas-app/yunzhupaas-app-biz/src/main/java/com/yunzhupaas/service/impl/AppServiceImpl.java b/yunzhupaas-app/yunzhupaas-app-biz/src/main/java/com/yunzhupaas/service/impl/AppServiceImpl.java new file mode 100644 index 0000000..e8db75e --- /dev/null +++ b/yunzhupaas-app/yunzhupaas-app-biz/src/main/java/com/yunzhupaas/service/impl/AppServiceImpl.java @@ -0,0 +1,163 @@ +package com.yunzhupaas.service.impl; + +import cn.hutool.core.collection.ListUtil; +import cn.hutool.core.util.ObjectUtil; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.service.DictionaryDataService; +import com.yunzhupaas.model.AppPositionVO; +import com.yunzhupaas.model.AppUserInfoVO; +import com.yunzhupaas.model.AppUsersVO; +import com.yunzhupaas.permission.entity.*; +import com.yunzhupaas.permission.service.*; +import com.yunzhupaas.service.AppService; +import com.yunzhupaas.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * app用户信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-08-08 + */ +@Service +public class AppServiceImpl implements AppService { + + @Autowired + private UserService userService; + @Autowired + private PositionService positionService; + @Autowired + private OrganizeService organizeService; + @Autowired + private RoleService roleService; + @Autowired + private RedisUtil redisUtil; + @Autowired + private UserRelationService userRelationService; + @Autowired + private DictionaryDataService dictionaryDataService; + + @Override + public AppUsersVO userInfo() { + UserInfo userInfo = UserProvider.getUser(); + UserEntity userEntity = userService.getInfo(userInfo.getUserId()); + AppUsersVO usersVO = new AppUsersVO(); + usersVO.setBirthday(userEntity.getBirthday() != null ? userEntity.getBirthday().getTime() : null); + usersVO.setEmail(userEntity.getEmail()); + List dataServiceList4 = dictionaryDataService.getListByTypeDataCode("sex"); + Map dataServiceMap4 = dataServiceList4.stream().filter(t -> ObjectUtil.equal(t.getEnabledMark(), 1)).collect(Collectors.toMap(DictionaryDataEntity::getEnCode, DictionaryDataEntity::getFullName)); + usersVO.setGender(dataServiceMap4.get(userEntity.getGender())); + usersVO.setMobilePhone(userEntity.getMobilePhone()); + this.data(usersVO, userEntity, userInfo); + this.userInfo(usersVO, userInfo); + //岗位 + PositionEntity position = positionService.getInfo(userEntity.getPositionId()); + AppPositionVO positionVO = new AppPositionVO(); + if(position != null){ + positionVO.setId(position.getId()); + positionVO.setName(position.getFullName()); + usersVO.setPositionIds(ListUtil.toList(positionVO)); + } + //直属主管 + if(StringUtil.isNotEmpty(userEntity.getManagerId())){ + UserEntity menager = userService.getInfo(userEntity.getManagerId()); + usersVO.setManager(menager != null ? menager.getRealName() + "/" + menager.getAccount() : ""); + } + //角色 + List roles = roleService.getAllRoleIdsByUserIdAndOrgId(userInfo.getUserId(), usersVO.getOrganizeId()); + List roleList = roleService.getListByIds(roles, null, false); + usersVO.setRoleName(String.join(",", roleList.stream().map(RoleEntity::getFullName).collect(Collectors.toList()))); + usersVO.setRoleId(String.join(".", roleList.stream().map(RoleEntity::getId).collect(Collectors.toList()))); + return usersVO; + } + + @Override + public AppUserInfoVO getInfo(String id) { + AppUserInfoVO userInfoVO = new AppUserInfoVO(); + UserEntity entity = userService.getInfo(id); + if (entity != null) { + userInfoVO = JsonUtil.getJsonToBean(entity, AppUserInfoVO.class); + List positionIds = StringUtil.isNotEmpty(entity.getPositionId()) ? Arrays.asList(entity.getPositionId().split(",")) : new ArrayList<>(); + List positionName = positionService.getPositionName(positionIds, false).stream().map(t -> t.getFullName()).collect(Collectors.toList()); + userInfoVO.setPositionName(String.join(",", positionName)); + OrganizeEntity info = organizeService.getInfo(entity.getOrganizeId()); + userInfoVO.setOrganizeName(info != null ? info.getFullName() : ""); + userInfoVO.setHeadIcon(UploaderUtil.uploaderImg(userInfoVO.getHeadIcon())); + } + return userInfoVO; + } + /** + * 赋值 + * + * @param userInfo + * @param userId + * @param isAdmin + */ + private void userInfo(UserInfo userInfo, String userId, boolean isAdmin, UserEntity userEntity) { + List userIdList = new ArrayList(){{add(userId);}}; + List data = userRelationService.getListByUserIdAll(userIdList); + //获取一个字段的值 + List positionList = data.stream().filter(m -> "Position".equals(m.getObjectType())).map(t -> t.getObjectId()).collect(Collectors.toList()); + Set id = new LinkedHashSet<>(); + String[] position = StringUtil.isNotEmpty(userEntity.getPositionId()) ? userEntity.getPositionId().split(",") : new String[]{}; + List positions = positionList.stream().filter(t->Arrays.asList(position).contains(t)).collect(Collectors.toList()); + id.addAll(positions); + id.addAll(positionList); + userInfo.setPositionIds(id.toArray(new String[id.size()])); + if (!isAdmin) { + data = data.stream().filter(m -> "Role".equals(m.getObjectType())).collect(Collectors.toList()); + } + List roleList = data.stream().map(t -> t.getObjectId()).collect(Collectors.toList()); + userInfo.setRoleIds(roleList); + } + + private void data(AppUsersVO usersVO, UserEntity userEntity, UserInfo userInfo) { + //组织 + usersVO.setOrganizeId(userEntity.getOrganizeId()); + List organizeIdList = new ArrayList<>(); + organizeService.getOrganizeId(userEntity.getOrganizeId(),organizeIdList); + Collections.reverse(organizeIdList); + usersVO.setOrganizeName(organizeIdList.stream().map(OrganizeEntity::getFullName).collect(Collectors.joining("/"))); + OrganizeEntity organizeEntity = organizeIdList.stream().filter(t->t.getId().equals(userEntity.getOrganizeId())).findFirst().orElse(null); + if (organizeEntity != null) { + String[] organizeId = StringUtil.isNotEmpty(organizeEntity.getOrganizeIdTree()) ? organizeEntity.getOrganizeIdTree().split(",") : new String[]{}; + if (organizeId.length > 0) { + userInfo.setOrganizeId(organizeId[0]); + userInfo.setDepartmentId(organizeId[organizeId.length - 1]); + } + } + userInfo.setManagerId(userInfo.getManagerId()); + boolean b = userInfo.getIsAdministrator(); + List subordinateIdsList = userService.getListByManagerId(userInfo.getUserId(),null).stream().map(UserEntity::getId).collect(Collectors.toList()); + userInfo.setSubordinateIds(subordinateIdsList); + this.userInfo(userInfo, userInfo.getUserId(), b,userEntity); +// userInfo.setSubOrganizeIds(new String[]{}); + //redisUtil.insert(userInfo.getId(), userInfo, DateUtil.getTime(userInfo.getOverdueTime()) - DateUtil.getTime(new Date())); + UserProvider.setLoginUser(userInfo); + UserProvider.setLocalLoginUser(userInfo); + } + + /** + * 登录信息 + * + * @param appUsersVO 返回对象 + * @param userInfo 回话信息 + * @return + */ + private void userInfo(AppUsersVO appUsersVO, UserInfo userInfo) { + appUsersVO.setUserId(userInfo.getUserId()); + appUsersVO.setHeadIcon(UploaderUtil.uploaderImg(userInfo.getUserIcon())); + appUsersVO.setUserName(userInfo.getUserName()); + appUsersVO.setUserAccount(userInfo.getUserAccount()); + } + + +} + diff --git a/yunzhupaas-app/yunzhupaas-app-controller/pom.xml b/yunzhupaas-app/yunzhupaas-app-controller/pom.xml new file mode 100644 index 0000000..38414de --- /dev/null +++ b/yunzhupaas-app/yunzhupaas-app-controller/pom.xml @@ -0,0 +1,23 @@ + + + + yunzhupaas-app + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-app-controller + + + + com.yunzhupaas + yunzhupaas-app-biz + ${project.version} + compile + + + + diff --git a/yunzhupaas-app/yunzhupaas-app-controller/src/main/java/com/yunzhupaas/controller/AppDataController.java b/yunzhupaas-app/yunzhupaas-app-controller/src/main/java/com/yunzhupaas/controller/AppDataController.java new file mode 100644 index 0000000..c18a0e1 --- /dev/null +++ b/yunzhupaas-app/yunzhupaas-app-controller/src/main/java/com/yunzhupaas/controller/AppDataController.java @@ -0,0 +1,76 @@ +package com.yunzhupaas.controller; + +import com.yunzhupaas.base.controller.SuperController; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.entity.AppDataEntity; +import com.yunzhupaas.model.AppDataCrForm; +import com.yunzhupaas.service.AppDataService; +import com.yunzhupaas.util.JsonUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; + +/** + * app常用数据 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-07-08 + */ +@Tag(name = "app常用数据", description = "data") +@RestController +@RequestMapping("/api/app/Data") +public class AppDataController extends SuperController { + + @Autowired + private AppDataService appDataService; + + /** + * 新建 + * + * @param appDataCrForm 新建模型 + * @return + */ + @PostMapping + @Operation(summary = "新建") + @Parameters({ + @Parameter(name = "appDataCrForm", description = "常用模型",required = true), + }) + public ActionResult create(@RequestBody @Valid AppDataCrForm appDataCrForm) { + AppDataEntity entity = JsonUtil.getJsonToBean(appDataCrForm, AppDataEntity.class); + if (appDataService.isExistByObjectId(entity.getObjectId(),appDataCrForm.getSystemId())) { + return ActionResult.fail(MsgCode.FA036.get()); + } + appDataService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 删除 + * + * @param objectId 主键 + * @return + */ + @Operation(summary = "删除") + @DeleteMapping("/{objectId}") + @Parameters({ + @Parameter(name = "objectId", description = "主键", required = true), + }) + public ActionResult create(@PathVariable("objectId") String objectId) { + AppDataEntity entity = appDataService.getInfo(objectId); + if (entity != null) { + appDataService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + +} + diff --git a/yunzhupaas-app/yunzhupaas-app-controller/src/main/java/com/yunzhupaas/controller/AppMenuController.java b/yunzhupaas-app/yunzhupaas-app-controller/src/main/java/com/yunzhupaas/controller/AppMenuController.java new file mode 100644 index 0000000..fe3bbc0 --- /dev/null +++ b/yunzhupaas-app/yunzhupaas-app-controller/src/main/java/com/yunzhupaas/controller/AppMenuController.java @@ -0,0 +1,96 @@ +package com.yunzhupaas.controller; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.Page; +import com.yunzhupaas.base.model.module.ModuleModel; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.model.AppMenuListVO; +import com.yunzhupaas.model.UserMenuModel; +import com.yunzhupaas.permission.model.authorize.AuthorizeVO; +import com.yunzhupaas.permission.service.AuthorizeService; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import com.yunzhupaas.util.treeutil.ListToTreeUtil; +import com.yunzhupaas.util.treeutil.SumTree; +import com.yunzhupaas.util.treeutil.newtreeutil.TreeDotUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * app应用 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-07-08 + */ +@Tag(name = "app应用", description = "Menu") +@RestController +@RequestMapping("/api/app/Menu") +public class AppMenuController { + @Autowired + private AuthorizeService authorizeService; + + /** + * 获取菜单列表 + * + * @param page 分页模型 + * @return + */ + @Operation(summary = "获取菜单列表") + @GetMapping + public ActionResult> list(Page page) { + AuthorizeVO authorizeModel = authorizeService.getAuthorize(false, false); + List buttonListAll = authorizeModel.getModuleList().stream().filter(t -> "App".equals(t.getCategory())).collect(Collectors.toList()); + // 通过系统id捞取相应的菜单 + buttonListAll = buttonListAll.stream().filter(t -> UserProvider.getUser().getAppSystemId() != null && UserProvider.getUser().getAppSystemId().equals(t.getSystemId())).collect(Collectors.toList()); + List buttonList = buttonListAll; + if (StringUtil.isNotEmpty(page.getKeyword())) { + buttonList = buttonListAll.stream().filter(t -> t.getFullName().contains(page.getKeyword())).collect(Collectors.toList()); + } + List list = JsonUtil.getJsonToList(ListToTreeUtil.treeWhere(buttonList, buttonListAll), UserMenuModel.class); + List> menuAll = TreeDotUtils.convertListToTreeDot(list, "-1"); + List data = JsonUtil.getJsonToList(menuAll, AppMenuListVO.class); + ListVO listVO = new ListVO(); + listVO.setList(data); + return ActionResult.success(listVO); + } + + /** + * 获取子集菜单 + * + * @return + */ + @Operation(summary = "获取子集菜单") + @GetMapping("/getChildList/{id}") + public ActionResult> getChildList(@PathVariable("id") String id) { + AuthorizeVO authorizeModel = authorizeService.getAuthorize(false, false); + List buttonListAll = authorizeModel.getModuleList().stream().filter(t -> "App".equals(t.getCategory())).collect(Collectors.toList()); + // 通过系统id捞取相应的菜单 + buttonListAll = buttonListAll.stream().filter(t -> UserProvider.getUser().getAppSystemId() != null && UserProvider.getUser().getAppSystemId().equals(t.getSystemId())).collect(Collectors.toList()); + Set models = new HashSet<>(); + next(buttonListAll,id,models); + List list = JsonUtil.getJsonToList(models, UserMenuModel.class); + List> menuAll = TreeDotUtils.convertListToTreeDot(list); + List data = JsonUtil.getJsonToList(menuAll, AppMenuListVO.class); + return ActionResult.success(data); + } + + private void next(List buttonListAll,String parentId,Set list){ + List menuList = buttonListAll.stream().filter(t -> t.getId().equals(parentId) || t.getParentId().equals(parentId)).collect(Collectors.toList()); + for (ModuleModel model : menuList) { + if(!list.contains(model)){ + list.add(model); + next(buttonListAll,model.getId(),list); + } + } + } + +} + diff --git a/yunzhupaas-app/yunzhupaas-app-controller/src/main/java/com/yunzhupaas/controller/AppUserController.java b/yunzhupaas-app/yunzhupaas-app-controller/src/main/java/com/yunzhupaas/controller/AppUserController.java new file mode 100644 index 0000000..8837035 --- /dev/null +++ b/yunzhupaas-app/yunzhupaas-app-controller/src/main/java/com/yunzhupaas/controller/AppUserController.java @@ -0,0 +1,62 @@ +package com.yunzhupaas.controller; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.model.AppUserInfoVO; +import com.yunzhupaas.model.AppUsersVO; +import com.yunzhupaas.service.AppService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 用户信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-07-08 + */ +@Tag(name = "app用户信息", description = "User") +@RestController +@RequestMapping("/api/app/User") +public class AppUserController { + + @Autowired + private AppService appService; + + /** + * 用户信息 + * + * @return + */ + @Operation(summary = "用户信息") + @GetMapping + public ActionResult getInfo() { + AppUsersVO userAllVO = appService.userInfo(); + return ActionResult.success(userAllVO); + } + + /** + * 通讯录详情 + * + * @param id 主键 + * @return + */ + @Operation(summary = "通讯录详情") + @GetMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult userInfo(@PathVariable("id") String id) { + AppUserInfoVO userInfoVO = appService.getInfo(id); + return ActionResult.success(userInfoVO); + } + +} + diff --git a/yunzhupaas-app/yunzhupaas-app-controller/src/main/java/com/yunzhupaas/controller/AppVersionController.java b/yunzhupaas-app/yunzhupaas-app-controller/src/main/java/com/yunzhupaas/controller/AppVersionController.java new file mode 100644 index 0000000..cd3a385 --- /dev/null +++ b/yunzhupaas-app/yunzhupaas-app-controller/src/main/java/com/yunzhupaas/controller/AppVersionController.java @@ -0,0 +1,45 @@ +package com.yunzhupaas.controller; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.util.NoDataSourceBind; +import org.apache.commons.collections4.map.HashedMap; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Map; + +/** + * 获取AppVersion + * + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/3/31 11:26 + */ +@Tag(name = "获取APP版本号", description = "AppVersion") +@RestController +@RequestMapping("/api/app") +public class AppVersionController { + @Autowired + private ConfigValueUtil configValueUtil; + + /** + * 判断是否需要验证码 + * + * @return + */ + @NoDataSourceBind() + @Operation(summary = "判断是否需要验证码") + @GetMapping("/Version") + public ActionResult getAppVersion() { + Map map = new HashedMap<>(); + map.put("sysVersion", configValueUtil.getAppVersion()); + return ActionResult.success(map); + } +} + diff --git a/yunzhupaas-app/yunzhupaas-app-entity/pom.xml b/yunzhupaas-app/yunzhupaas-app-entity/pom.xml new file mode 100644 index 0000000..c79dd3a --- /dev/null +++ b/yunzhupaas-app/yunzhupaas-app-entity/pom.xml @@ -0,0 +1,22 @@ + + + + yunzhupaas-app + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-app-entity + + + + com.yunzhupaas + yunzhupaas-common-all + ${project.version} + + + + diff --git a/yunzhupaas-app/yunzhupaas-app-entity/src/main/java/com/yunzhupaas/entity/AppDataEntity.java b/yunzhupaas-app/yunzhupaas-app-entity/src/main/java/com/yunzhupaas/entity/AppDataEntity.java new file mode 100644 index 0000000..100127c --- /dev/null +++ b/yunzhupaas-app/yunzhupaas-app-entity/src/main/java/com/yunzhupaas/entity/AppDataEntity.java @@ -0,0 +1,47 @@ +package com.yunzhupaas.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * app常用数据 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-08-08 + */ +@Data +@TableName("base_app_data") +public class AppDataEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 对象类型 + */ + @TableField("f_object_type") + private String objectType; + + /** + * 对象主键 + */ + @TableField("f_object_id") + private String objectId; + + /** + * 数据 + */ + @TableField("f_object_data") + private String objectData; + + /** + * 关联系统id + */ + @TableField("f_system_id") + private String systemId; + +} + diff --git a/yunzhupaas-app/yunzhupaas-app-entity/src/main/java/com/yunzhupaas/model/AppDataCrForm.java b/yunzhupaas-app/yunzhupaas-app-entity/src/main/java/com/yunzhupaas/model/AppDataCrForm.java new file mode 100644 index 0000000..f1bc8ca --- /dev/null +++ b/yunzhupaas-app/yunzhupaas-app-entity/src/main/java/com/yunzhupaas/model/AppDataCrForm.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import jakarta.validation.constraints.NotBlank; + +/** + * app常用数据 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-07-08 + */ +@Data +@Schema(description = "常用模型") +public class AppDataCrForm { + @NotBlank(message = "必填") + @Schema(description = "应用类型") + private String objectType; + @NotBlank(message = "必填") + @Schema(description = "应用主键") + private String objectId; + @Schema(description = "数据") + private String objectData; + @Schema(description = "系统主键") + private String systemId; +} + diff --git a/yunzhupaas-app/yunzhupaas-app-entity/src/main/java/com/yunzhupaas/model/AppDataListAllVO.java b/yunzhupaas-app/yunzhupaas-app-entity/src/main/java/com/yunzhupaas/model/AppDataListAllVO.java new file mode 100644 index 0000000..5409f92 --- /dev/null +++ b/yunzhupaas-app/yunzhupaas-app-entity/src/main/java/com/yunzhupaas/model/AppDataListAllVO.java @@ -0,0 +1,47 @@ +package com.yunzhupaas.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * app常用数据 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-07-08 + */ +@Data +@Schema(description = "常用模型") +public class AppDataListAllVO { + @Schema(description = "主键") + private String id; + @Schema(description = "是否有下级菜单") + private Boolean hasChildren; + @Schema(description = "菜单名称") + private String fullName; + @Schema(description = " 图标") + private String icon; + @Schema(description = "链接地址") + private String urlAddress; + @Schema(description = "父级id") + private String parentId; + @Schema(description = "菜单类型",example = "1") + private Integer type; + @Schema(description = "扩展字段") + private String propertyJson; + @Schema(description = "图标背景色") + private String iconBackground; + @Schema(description = "是否常用") + private Boolean isData; + @Schema(description = "排序") + private Long sortCode; + @Schema(description = "分类") + private String category; + @Schema(description = "下级菜单列表") + private List children; +} + diff --git a/yunzhupaas-app/yunzhupaas-app-entity/src/main/java/com/yunzhupaas/model/AppDataListVO.java b/yunzhupaas-app/yunzhupaas-app-entity/src/main/java/com/yunzhupaas/model/AppDataListVO.java new file mode 100644 index 0000000..ffed200 --- /dev/null +++ b/yunzhupaas-app/yunzhupaas-app-entity/src/main/java/com/yunzhupaas/model/AppDataListVO.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * app常用数据 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-07-08 + */ +@Data +@Schema(description = "常用模型") +public class AppDataListVO { + @Schema(description = "主键") + private String id; + @Schema(description = "应用主键") + private String objectId; + @Schema(description = "数据") + private String objectData; +} + diff --git a/yunzhupaas-app/yunzhupaas-app-entity/src/main/java/com/yunzhupaas/model/AppFlowListAllVO.java b/yunzhupaas-app/yunzhupaas-app-entity/src/main/java/com/yunzhupaas/model/AppFlowListAllVO.java new file mode 100644 index 0000000..eb59927 --- /dev/null +++ b/yunzhupaas-app/yunzhupaas-app-entity/src/main/java/com/yunzhupaas/model/AppFlowListAllVO.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * app常用数据 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-07-08 + */ +@Data +@Schema(description = "常用模型") +public class AppFlowListAllVO { + @Schema(description = "主键") + private String id; + @Schema(description = "名称") + private String fullName; + @Schema(description = "图标") + private String icon; + @Schema(description = "图标背景色") + private String iconBackground; + @Schema(description = "编码") + private String enCode; + @Schema(description = "是否常用") + private Boolean isData; +} + diff --git a/yunzhupaas-app/yunzhupaas-app-entity/src/main/java/com/yunzhupaas/model/AppMenuListVO.java b/yunzhupaas-app/yunzhupaas-app-entity/src/main/java/com/yunzhupaas/model/AppMenuListVO.java new file mode 100644 index 0000000..a3876ae --- /dev/null +++ b/yunzhupaas-app/yunzhupaas-app-entity/src/main/java/com/yunzhupaas/model/AppMenuListVO.java @@ -0,0 +1,43 @@ +package com.yunzhupaas.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * app应用 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-07-08 + */ +@Data +@Schema(description = "常用模型") +public class AppMenuListVO { + @Schema(description = "主键") + private String id; + @Schema(description = "是否有下级菜单") + private Boolean hasChildren; + @Schema(description = "父级id") + private String parentId; + @Schema(description = "菜单编码") + private String enCode; + @Schema(description = "菜单名称") + private String fullName; + @Schema(description = " 图标") + private String icon; + @Schema(description = "是否常用") + private Boolean isData; + @Schema(description = "链接地址") + private String urlAddress; + @Schema(description = "菜单类型",example = "1") + private Integer type; + @Schema(description = "扩展字段") + private String propertyJson; + @Schema(description = "下级菜单列表") + private List children; +} + diff --git a/yunzhupaas-app/yunzhupaas-app-entity/src/main/java/com/yunzhupaas/model/AppPositionVO.java b/yunzhupaas-app/yunzhupaas-app-entity/src/main/java/com/yunzhupaas/model/AppPositionVO.java new file mode 100644 index 0000000..77bf482 --- /dev/null +++ b/yunzhupaas-app/yunzhupaas-app-entity/src/main/java/com/yunzhupaas/model/AppPositionVO.java @@ -0,0 +1,23 @@ +package com.yunzhupaas.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * app应用 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-08-08 + */ +@Data +@Schema(description = "常用模型") +public class AppPositionVO { + @Schema(description = "岗位id") + private String id; + @Schema(description = "岗位名称") + private String name; +} + diff --git a/yunzhupaas-app/yunzhupaas-app-entity/src/main/java/com/yunzhupaas/model/AppUserInfoVO.java b/yunzhupaas-app/yunzhupaas-app-entity/src/main/java/com/yunzhupaas/model/AppUserInfoVO.java new file mode 100644 index 0000000..02e7f20 --- /dev/null +++ b/yunzhupaas-app/yunzhupaas-app-entity/src/main/java/com/yunzhupaas/model/AppUserInfoVO.java @@ -0,0 +1,38 @@ +package com.yunzhupaas.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +@Schema(description = "常用模型") +public class AppUserInfoVO { + @Schema(description = "主键") + private String id; + @Schema(description = "户名") + private String realName; + @Schema(description = "部门名称") + private String organizeName; + @Schema(description = "账号") + private String account; + @Schema(description = "岗位名称") + private String positionName; + @Schema(description = "办公电话") + private String telePhone; + @Schema(description = "办公座机") + private String landline; + @Schema(description = "手机号码") + private String mobilePhone; + @Schema(description = "用户头像") + private String headIcon; + @Schema(description = "邮箱") + private String email; +} + diff --git a/yunzhupaas-app/yunzhupaas-app-entity/src/main/java/com/yunzhupaas/model/AppUsersVO.java b/yunzhupaas-app/yunzhupaas-app-entity/src/main/java/com/yunzhupaas/model/AppUsersVO.java new file mode 100644 index 0000000..f1462df --- /dev/null +++ b/yunzhupaas-app/yunzhupaas-app-entity/src/main/java/com/yunzhupaas/model/AppUsersVO.java @@ -0,0 +1,51 @@ +package com.yunzhupaas.model; + + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * 用户 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-07-08 + */ +@Data +@Schema(description = "常用模型") +public class AppUsersVO { + @Schema(description = "用户id") + private String userId; + @Schema(description = "用户账号") + private String userAccount; + @Schema(description = "用户姓名") + private String userName; + @Schema(description = "用户头像") + private String headIcon; + @Schema(description = "组织主键") + private String organizeId; + @Schema(description = "组织名称") + private String organizeName; + @Schema(description = "角色主键") + private String roleId; + @Schema(description = "角色名称") + private String roleName; + @Schema(description = "性别") + private String gender; + @Schema(description = "岗位") + private List positionIds; + @Schema(description = "生日") + private Long birthday; + @Schema(description = "手机") + private String mobilePhone; + @Schema(description = "邮箱") + private String email; + @Schema(description = "直属主管") + private String manager; + +} + diff --git a/yunzhupaas-crm/pom.xml b/yunzhupaas-crm/pom.xml new file mode 100644 index 0000000..ebe6241 --- /dev/null +++ b/yunzhupaas-crm/pom.xml @@ -0,0 +1,50 @@ + + + + yunzhupaas-java-boot + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-crm + pom + + yunzhupaas-crm-entity + yunzhupaas-crm-biz + yunzhupaas-crm-controller + + + + + org.apache.poi + poi + 4.1.2 + + + org.apache.xmlbeans + xmlbeans + 3.1.0 + + + + org.apache.poi + poi-ooxml + 4.1.2 + + + org.apache.poi + poi-ooxml-schemas + 4.1.2 + + + + org.apache.poi + poi-scratchpad + 4.1.2 + + + + diff --git a/yunzhupaas-crm/yunzhupaas-crm-biz/pom.xml b/yunzhupaas-crm/yunzhupaas-crm-biz/pom.xml new file mode 100644 index 0000000..7fa6361 --- /dev/null +++ b/yunzhupaas-crm/yunzhupaas-crm-biz/pom.xml @@ -0,0 +1,31 @@ + + + + yunzhupaas-crm + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-crm-biz + + + + com.yunzhupaas + yunzhupaas-crm-entity + ${project.version} + + + + + com.yunzhupaas + yunzhupaas-generater-base + 5.2.0-RELEASE + + + + + + diff --git a/yunzhupaas-crm/yunzhupaas-crm-controller/pom.xml b/yunzhupaas-crm/yunzhupaas-crm-controller/pom.xml new file mode 100644 index 0000000..c75610c --- /dev/null +++ b/yunzhupaas-crm/yunzhupaas-crm-controller/pom.xml @@ -0,0 +1,23 @@ + + + + yunzhupaas-crm + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-crm-controller + + + + com.yunzhupaas + yunzhupaas-crm-biz + ${project.version} + + + + + diff --git a/yunzhupaas-crm/yunzhupaas-crm-entity/pom.xml b/yunzhupaas-crm/yunzhupaas-crm-entity/pom.xml new file mode 100644 index 0000000..aba2bbe --- /dev/null +++ b/yunzhupaas-crm/yunzhupaas-crm-entity/pom.xml @@ -0,0 +1,22 @@ + + + + yunzhupaas-crm + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-crm-entity + + + + com.yunzhupaas + yunzhupaas-common-all + ${project.version} + + + + diff --git a/yunzhupaas-example/pom.xml b/yunzhupaas-example/pom.xml new file mode 100644 index 0000000..a9e41bb --- /dev/null +++ b/yunzhupaas-example/pom.xml @@ -0,0 +1,20 @@ + + + + yunzhupaas-java-boot + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-example + pom + + yunzhupaas-example-entity + yunzhupaas-example-biz + yunzhupaas-example-controller + + + diff --git a/yunzhupaas-example/yunzhupaas-example-biz/pom.xml b/yunzhupaas-example/yunzhupaas-example-biz/pom.xml new file mode 100644 index 0000000..42f1d92 --- /dev/null +++ b/yunzhupaas-example/yunzhupaas-example-biz/pom.xml @@ -0,0 +1,27 @@ + + + + yunzhupaas-example + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-example-biz + + + + com.yunzhupaas + yunzhupaas-example-entity + ${project.version} + + + com.yunzhupaas + yunzhupaas-generater-base + ${project.version} + + + + diff --git a/yunzhupaas-example/yunzhupaas-example-biz/src/main/java/com/yunzhupaas/mapper/ContractMapper.java b/yunzhupaas-example/yunzhupaas-example-biz/src/main/java/com/yunzhupaas/mapper/ContractMapper.java new file mode 100644 index 0000000..dbb0a4d --- /dev/null +++ b/yunzhupaas-example/yunzhupaas-example-biz/src/main/java/com/yunzhupaas/mapper/ContractMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.entity.ContractEntity; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/16 9:47 + */ +public interface ContractMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-example/yunzhupaas-example-biz/src/main/java/com/yunzhupaas/service/ContractService.java b/yunzhupaas-example/yunzhupaas-example-biz/src/main/java/com/yunzhupaas/service/ContractService.java new file mode 100644 index 0000000..50aa447 --- /dev/null +++ b/yunzhupaas-example/yunzhupaas-example-biz/src/main/java/com/yunzhupaas/service/ContractService.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.service; + +import com.yunzhupaas.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.entity.ContractEntity; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/16 9:47 + */ +public interface ContractService extends SuperService { + + List getlist(Pagination pagination); + + ContractEntity getInfo(String id); + + void create(ContractEntity entity); + + void update(String id, ContractEntity entity); + + void delete(ContractEntity entity); +} + diff --git a/yunzhupaas-example/yunzhupaas-example-biz/src/main/java/com/yunzhupaas/service/impl/ContractServiceImpl.java b/yunzhupaas-example/yunzhupaas-example-biz/src/main/java/com/yunzhupaas/service/impl/ContractServiceImpl.java new file mode 100644 index 0000000..af9767e --- /dev/null +++ b/yunzhupaas-example/yunzhupaas-example-biz/src/main/java/com/yunzhupaas/service/impl/ContractServiceImpl.java @@ -0,0 +1,81 @@ +package com.yunzhupaas.service.impl; + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.mapper.ContractMapper; +import com.yunzhupaas.service.ContractService; +import com.yunzhupaas.entity.ContractEntity; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/16 9:47 + */ +@Service +public class ContractServiceImpl extends SuperServiceImpl implements ContractService { + + + @Override + public List getlist(Pagination pagination){ + //通过UserProvider获取用户信息 + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (!StringUtil.isEmpty(pagination.getKeyword())) { + queryWrapper.lambda().and( + t -> t.like(ContractEntity::getContractName, pagination.getKeyword()) + .or().like(ContractEntity::getMytelePhone, pagination.getKeyword()) + ); + } + //排序 + if (StringUtil.isEmpty(pagination.getSidx())) { + } else { + queryWrapper = "asc".equals(pagination.getSort().toLowerCase()) ? queryWrapper.orderByAsc(pagination.getSidx()) : queryWrapper.orderByDesc(pagination.getSidx()); + } + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage userPage = this.page(page, queryWrapper); + return pagination.setData(userPage.getRecords(), page.getTotal()); + } + + @Override + public ContractEntity getInfo(String id){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ContractEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + @DSTransactional + public void create(ContractEntity entity){ + entity.setId(RandomUtil.uuId()); + this.save(entity); + } + + @Override + @DSTransactional + public void update(String id, ContractEntity entity){ + entity.setId(id); + this.updateById(entity); + } + + @Override + public void delete(ContractEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } +} + diff --git a/yunzhupaas-example/yunzhupaas-example-controller/pom.xml b/yunzhupaas-example/yunzhupaas-example-controller/pom.xml new file mode 100644 index 0000000..c193185 --- /dev/null +++ b/yunzhupaas-example/yunzhupaas-example-controller/pom.xml @@ -0,0 +1,22 @@ + + + + yunzhupaas-example + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-example-controller + + + + com.yunzhupaas + yunzhupaas-example-biz + ${project.version} + + + + diff --git a/yunzhupaas-example/yunzhupaas-example-controller/src/main/java/com/yunzhupaas/controller/ContractController.java b/yunzhupaas-example/yunzhupaas-example-controller/src/main/java/com/yunzhupaas/controller/ContractController.java new file mode 100644 index 0000000..3640f41 --- /dev/null +++ b/yunzhupaas-example/yunzhupaas-example-controller/src/main/java/com/yunzhupaas/controller/ContractController.java @@ -0,0 +1,125 @@ +package com.yunzhupaas.controller; + + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.entity.ContractEntity; +import com.yunzhupaas.model.ContractForm; +import com.yunzhupaas.model.ContractInfoVO; +import com.yunzhupaas.model.ContractListVO; +import com.yunzhupaas.service.ContractService; +import com.yunzhupaas.util.JsonUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; +import java.util.List; + +/** + * Contract + * 版本: V3.0.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2020-12-31 + */ +@RestController +@Tag(name = "示例接口", description = "Contract") +@RequestMapping("/Contract") +public class ContractController extends SuperController { + + @Autowired + private ContractService contractService; + + /** + * 获取列表 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "获取列表") + @GetMapping("/List") + public ActionResult> list(Pagination pagination) { + List entity = contractService.getlist(pagination); + List listVo = JsonUtil.getJsonToList(JsonUtil.getObjectToStringDateFormat(entity, "yyyy-MM-dd HH:mm:ss"), ContractListVO.class); + PaginationVO vo = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(listVo, vo); + } + + /** + * 获取详情 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取详情") + @GetMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult info(@PathVariable("id") String id) { + ContractEntity entity = contractService.getInfo(id); + ContractInfoVO vo = JsonUtil.getJsonToBean(entity, ContractInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 新建 + * + * @param contractForm 新建模型 + * @return + */ + @Operation(summary = "新建") + @PostMapping + @Parameters({ + @Parameter(name = "contractForm", description = "示例模型",required = true), + }) + public ActionResult create(@RequestBody @Valid ContractForm contractForm) { + ContractEntity entity = JsonUtil.getJsonToBean(contractForm, ContractEntity.class); + contractService.create(entity); + return ActionResult.success(MsgCode.SU002.get()); + } + + /** + * @param id 主键 + * @param contractForm 修改模型 + * @return + */ + @Operation(summary = "修改") + @PutMapping("/{id}") + @Parameters({ + @Parameter(name = "contractForm", description = "示例模型",required = true), + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid ContractForm contractForm) { + ContractEntity entity = JsonUtil.getJsonToBean(contractForm, ContractEntity.class); + contractService.update(id, entity); + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除") + @DeleteMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult delete(@PathVariable("id") String id) { + ContractEntity entity = contractService.getInfo(id); + contractService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + +} + diff --git a/yunzhupaas-example/yunzhupaas-example-entity/pom.xml b/yunzhupaas-example/yunzhupaas-example-entity/pom.xml new file mode 100644 index 0000000..e9e92ea --- /dev/null +++ b/yunzhupaas-example/yunzhupaas-example-entity/pom.xml @@ -0,0 +1,22 @@ + + + + yunzhupaas-example + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-example-entity + + + + com.yunzhupaas + yunzhupaas-common-all + ${project.version} + + + + diff --git a/yunzhupaas-example/yunzhupaas-example-entity/src/main/java/com/yunzhupaas/entity/ContractEntity.java b/yunzhupaas-example/yunzhupaas-example-entity/src/main/java/com/yunzhupaas/entity/ContractEntity.java new file mode 100644 index 0000000..8a6e6ec --- /dev/null +++ b/yunzhupaas-example/yunzhupaas-example-entity/src/main/java/com/yunzhupaas/entity/ContractEntity.java @@ -0,0 +1,34 @@ +package com.yunzhupaas.entity; + +import com.yunzhupaas.base.entity.SuperBaseEntity; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * + * Contract + * 版本: V3.0.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2020-12-31 + */ +@Data +@TableName("test_contract") +public class ContractEntity extends SuperBaseEntity.SuperTBaseEntity implements Serializable { + + @TableField("F_CONTRACTNAME") + private String contractName; + + @TableField("F_MYTELEPHONE") + private String mytelePhone; + + @TableField("F_FILEJSON") + private String fileJson; + +} + diff --git a/yunzhupaas-example/yunzhupaas-example-entity/src/main/java/com/yunzhupaas/model/ContractForm.java b/yunzhupaas-example/yunzhupaas-example-entity/src/main/java/com/yunzhupaas/model/ContractForm.java new file mode 100644 index 0000000..b795c93 --- /dev/null +++ b/yunzhupaas-example/yunzhupaas-example-entity/src/main/java/com/yunzhupaas/model/ContractForm.java @@ -0,0 +1,27 @@ +package com.yunzhupaas.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * 版本: V3.0.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2020-12-31 + */ +@Data +public class ContractForm { + + @Schema(description = "姓名") + private String contractName; + + @Schema(description = "手机号") + private String mytelePhone; + + @Schema(description = "文件") + private String fileJson; + +} + diff --git a/yunzhupaas-example/yunzhupaas-example-entity/src/main/java/com/yunzhupaas/model/ContractInfoVO.java b/yunzhupaas-example/yunzhupaas-example-entity/src/main/java/com/yunzhupaas/model/ContractInfoVO.java new file mode 100644 index 0000000..0b86df0 --- /dev/null +++ b/yunzhupaas-example/yunzhupaas-example-entity/src/main/java/com/yunzhupaas/model/ContractInfoVO.java @@ -0,0 +1,28 @@ +package com.yunzhupaas.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * 版本: V3.0.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2020-12-31 + */ +@Data +public class ContractInfoVO { + @Schema(description = "主键") + private String id; + + @Schema(description = "姓名") + private String contractName; + + @Schema(description = "手机号") + private String mytelePhone; + + @Schema(description = "文件") + private String fileJson; +} + diff --git a/yunzhupaas-example/yunzhupaas-example-entity/src/main/java/com/yunzhupaas/model/ContractListVO.java b/yunzhupaas-example/yunzhupaas-example-entity/src/main/java/com/yunzhupaas/model/ContractListVO.java new file mode 100644 index 0000000..2cc5c89 --- /dev/null +++ b/yunzhupaas-example/yunzhupaas-example-entity/src/main/java/com/yunzhupaas/model/ContractListVO.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.model; + +import lombok.Data; + +/** + * + * + * 版本: V3.0.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2020-12-31 + */ +@Data +public class ContractListVO extends ContractInfoVO { + +} + diff --git a/yunzhupaas-exception/pom.xml b/yunzhupaas-exception/pom.xml new file mode 100644 index 0000000..7476ad3 --- /dev/null +++ b/yunzhupaas-exception/pom.xml @@ -0,0 +1,31 @@ + + + + yunzhupaas-java-boot + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-exception + + + com.yunzhupaas + yunzhupaas-common-auth + + + com.yunzhupaas + yunzhupaas-common-all + ${project.version} + + + com.yunzhupaas + yunzhupaas-oauth-entity + ${project.version} + + + + + diff --git a/yunzhupaas-exception/src/main/java/com/yunzhupaas/controller/LogController.java b/yunzhupaas-exception/src/main/java/com/yunzhupaas/controller/LogController.java new file mode 100644 index 0000000..6050e16 --- /dev/null +++ b/yunzhupaas-exception/src/main/java/com/yunzhupaas/controller/LogController.java @@ -0,0 +1,169 @@ +package com.yunzhupaas.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import com.yunzhupaas.base.controller.SuperController; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.entity.LogEntity; +import com.yunzhupaas.model.*; +import com.yunzhupaas.service.LogService; +import com.yunzhupaas.util.JsonUtil; +import org.apache.commons.collections4.map.HashedMap; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * 系统日志 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Tag(name = "系统日志", description = "Log") +@RestController +@RequestMapping("/api/system/Log") +public class LogController extends SuperController { + + @Autowired + private LogService logService; + + + /** + * 获取系统日志信息 + * + * @param pagination category 主键值分类 1:登录日志,2.访问日志,3.操作日志,4.异常日志,5.请求日志 + * @return + */ + @Operation(summary = "获取系统日志列表") + @Parameters({ + @Parameter(name = "category", description = "分类", required = true) + }) + @SaCheckPermission("system.log") + @GetMapping + public ActionResult getInfoList(PaginationLogModel pagination) { + List list = logService.getList(pagination.getCategory(), pagination); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + switch (pagination.getCategory()) { + case 1: + List loginLogVOList = JsonUtil.getJsonToList(list, LoginLogVO.class); + for (int i = 0; i < loginLogVOList.size(); i++) { + loginLogVOList.get(i).setAbstracts(list.get(i).getDescription()); + } + return ActionResult.page(loginLogVOList, paginationVO); + case 3: + List handleLogVOList = JsonUtil.getJsonToList(list, HandleLogVO.class); + return ActionResult.page(handleLogVOList, paginationVO); + case 4: + List errorLogVOList = JsonUtil.getJsonToList(list, ErrorLogVO.class); + return ActionResult.page(errorLogVOList, paginationVO); + case 5: + List requestLogVOList = JsonUtil.getJsonToList(list, RequestLogVO.class); + return ActionResult.page(requestLogVOList, paginationVO); + default: + return ActionResult.fail(MsgCode.FA012.get()); + } + } + + /** + * 获取系统日志信息 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "获取系统日志信息") + @Parameters({ + @Parameter(name = "category", description = "分类", required = true) + }) + @SaCheckPermission("system.log") + @GetMapping("/{id}") + public ActionResult getInfoList(@PathVariable("id") String id) { + LogEntity entity = logService.getInfo(id); + if (entity == null) { + return ActionResult.fail(MsgCode.FA001.get()); + } + LogInfoVO vo = JsonUtil.getJsonToBean(entity, LogInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 批量删除系统日志 + * + * @param logDelForm 批量删除日志模型 + * @return + */ + @Operation(summary = "批量删除系统日志") + @Parameters({ + @Parameter(name = "logDelForm", description = "批量删除日志模型", required = true) + }) + @SaCheckPermission("system.log") + @DeleteMapping + public ActionResult delete(@RequestBody LogDelForm logDelForm) { + boolean flag = logService.delete(logDelForm.getIds()); + if (!flag) { + return ActionResult.fail(MsgCode.FA003.get()); + } + return ActionResult.success(MsgCode.SU003.get()); + } + + /** + * 一键清空操作日志 + * + * @param type 分类 + * @return + */ + @Operation(summary = "一键清空操作日志") + @Parameters({ + @Parameter(name = "type", description = "分类", required = true) + }) + @SaCheckPermission("system.log") + @DeleteMapping("/{type}") + public ActionResult deleteHandelLog(@PathVariable("type") String type) { + logService.deleteHandleLog(type, null); + return ActionResult.success(MsgCode.SU005.get()); + } + + /** + * 一键清空登陆日志 + * + * @return + */ + @Operation(summary = "一键清空登陆日志") + @SaCheckPermission("system.log") + @DeleteMapping("/deleteLoginLog") + public ActionResult deleteLoginLog() { + logService.deleteHandleLog("1", 1); + return ActionResult.success(MsgCode.SU005.get()); + } + + /** + * 获取菜单名 + * + * @return + */ + @Operation(summary = "获取菜单名") + @SaCheckPermission("system.log") + @GetMapping("/ModuleName") + public ActionResult>> moduleName() { + List> list = new ArrayList<> (16); + Set set = logService.queryList(); + for (String moduleName : set) { + Map map = new HashedMap<>(1); + map.put("moduleName", moduleName); + list.add(map); + } + return ActionResult.success(list); + } + +} + diff --git a/yunzhupaas-exception/src/main/java/com/yunzhupaas/entity/LogEntity.java b/yunzhupaas-exception/src/main/java/com/yunzhupaas/entity/LogEntity.java new file mode 100644 index 0000000..5663a30 --- /dev/null +++ b/yunzhupaas-exception/src/main/java/com/yunzhupaas/entity/LogEntity.java @@ -0,0 +1,138 @@ +package com.yunzhupaas.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 系统日志 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Data +@TableName("base_sys_log") +public class LogEntity extends SuperExtendEntity.SuperExtendDescriptionEntity implements Serializable { + /** + * 用户主键 + */ + @TableField("F_USER_ID") + private String userId; + + /** + * 用户主键 + */ + @TableField("F_USER_NAME") + private String userName; + + /** + * 日志类型 + */ + @TableField("F_TYPE") + private Integer type; + + /** + * 日志级别 + */ + @TableField("F_LEVEL") + private Integer levels; + + /** + * IP地址 + */ + @TableField("F_IP_ADDRESS") + private String ipAddress; + + /** + * IP所在城市 + */ + @TableField("F_IP_ADDRESS_NAME") + private String ipAddressName; + + /** + * 请求地址 + */ + @TableField("F_REQUEST_URL") + private String requestUrl; + + /** + * 请求方法 + */ + @TableField("F_REQUEST_METHOD") + private String requestMethod; + + /** + * 请求耗时 + */ + @TableField("F_REQUEST_DURATION") + private Integer requestDuration; + + /** + * 日志内容 + */ + @TableField("F_JSON") + private String jsons; + + /** + * 平台设备 + */ + @TableField("F_PLAT_FORM") + private String platForm; + + /** + * 功能主键 + */ + @TableField("F_MODULE_ID") + private String moduleId; + + /** + * 功能名称 + */ + @TableField("F_MODULE_NAME") + private String moduleName; + + /** + * 对象Id + */ + @TableField("F_OBJECT_ID") + private String objectId; + + /** + * 浏览器 + */ + @TableField("f_browser") + private String browser; + + /** + * 请求参数 + */ + @TableField("f_request_param") + private String requestParam; + + /** + * 请求方法 + */ + @TableField("f_request_target") + private String requestTarget; + + /** + * 是否登录成功标志 + */ + @TableField("f_login_mark") + private Integer loginMark; + + /** + * 登录类型 + */ + @TableField("f_login_type") + private Integer loginType; + +} + diff --git a/yunzhupaas-exception/src/main/java/com/yunzhupaas/enums/LogLevelEnum.java b/yunzhupaas-exception/src/main/java/com/yunzhupaas/enums/LogLevelEnum.java new file mode 100644 index 0000000..c5bff02 --- /dev/null +++ b/yunzhupaas-exception/src/main/java/com/yunzhupaas/enums/LogLevelEnum.java @@ -0,0 +1,77 @@ +package com.yunzhupaas.enums; + + +/** + * 日志等级 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public enum LogLevelEnum { + + /** + * 错误 + */ + Error(0,"错误"), + /** + * 成功 + */ + Success(1,"成功"), + /** + * 警告 + */ + Warning(2,"警告"); + + private int code; + private String message; + + LogLevelEnum(int code, String message){ + this.code = code; + this.message = message; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + /** + * 根据状态code获取枚举名称 + * @return + */ + public static String getMessageByCode(Integer code) { + for (LogLevelEnum status : LogLevelEnum.values()) { + if (status.getCode().equals(code)) { + return status.message; + } + } + return null; + } + + /** + * 根据状态code获取枚举值 + * @return + */ + public static LogLevelEnum getByCode(Integer code) { + for (LogLevelEnum status : LogLevelEnum.values()) { + if (status.getCode().equals(code)) { + return status; + } + } + return null; + } +} + diff --git a/yunzhupaas-exception/src/main/java/com/yunzhupaas/enums/LogSortEnum.java b/yunzhupaas-exception/src/main/java/com/yunzhupaas/enums/LogSortEnum.java new file mode 100644 index 0000000..55c460b --- /dev/null +++ b/yunzhupaas-exception/src/main/java/com/yunzhupaas/enums/LogSortEnum.java @@ -0,0 +1,85 @@ +package com.yunzhupaas.enums; + +/** + * 日志分类 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public enum LogSortEnum { + /** + * 登录 + */ + Login(1, "登录"), + /** + * 访问 + */ + Visit(2, "访问"), + /** + * 操作 + */ + Operate(3, "操作"), + /** + * 异常 + */ + Exception(4, "异常"), + /** + * 请求 + */ + Request(5, "请求"); + + private int code; + private String message; + + LogSortEnum(int code, String message) { + this.code = code; + this.message = message; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + /** + * 根据状态code获取枚举名称 + * + * @return + */ + public static String getMessageByCode(Integer code) { + for (LogSortEnum status : LogSortEnum.values()) { + if (status.getCode().equals(code)) { + return status.message; + } + } + return null; + } + + /** + * 根据状态code获取枚举值 + * + * @return + */ + public static LogSortEnum getByCode(Integer code) { + for (LogSortEnum status : LogSortEnum.values()) { + if (status.getCode().equals(code)) { + return status; + } + } + return null; + } +} + diff --git a/yunzhupaas-exception/src/main/java/com/yunzhupaas/exception/ResultException.java b/yunzhupaas-exception/src/main/java/com/yunzhupaas/exception/ResultException.java new file mode 100644 index 0000000..64bf33e --- /dev/null +++ b/yunzhupaas-exception/src/main/java/com/yunzhupaas/exception/ResultException.java @@ -0,0 +1,321 @@ +package com.yunzhupaas.exception; + +import cn.dev33.satoken.exception.SameTokenInvalidException; +import cn.dev33.satoken.exception.NotLoginException; +import cn.dev33.satoken.exception.NotPermissionException; +import cn.dev33.satoken.exception.NotRoleException; +import cn.hutool.http.useragent.UserAgent; +import cn.hutool.http.useragent.UserAgentUtil; +import com.alibaba.fastjson.JSON; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.ActionResultCode; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.database.util.NotTenantPluginHolder; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.entity.LogEntity; +import com.yunzhupaas.service.LogService; +import com.yunzhupaas.util.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.web.ErrorProperties; +import org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController; +import org.springframework.boot.web.servlet.error.DefaultErrorAttributes; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.validation.ObjectError; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/16 10:10 + */ +@Slf4j +@Controller +@ControllerAdvice +public class ResultException extends BasicErrorController { + + @Autowired + private LogService logService; + @Autowired + private ConfigValueUtil configValueUtil; + + public ResultException(){ + super(new DefaultErrorAttributes(), new ErrorProperties()); + } + + @ResponseBody + @ExceptionHandler(value = LoginException.class) + public ActionResult loginException(LoginException e) { + ActionResult result = ActionResult.fail(ActionResultCode.Fail.getCode(), e.getMessage()); + result.setData(e.getData()); + return result; + } + + /** + * 简单异常处理 + */ + @ResponseBody + @ExceptionHandler(value = {ImportException.class, DataException.class, EncryptFailException.class}) + public ActionResult simpleException(Exception e) { + ActionResult result = ActionResult.fail(ActionResultCode.Fail.getCode(), e.getMessage()); + return result; + } + +// @ResponseBody +// @ExceptionHandler(value = FileNotException.class) +// public ActionResult loginException(FileNotException e) { +// ActionResult result = ActionResult.fail(ActionResultCode.Fail.getCode(), "文件不存在"); +// return result; +// } + + /** + * 租户数据库异常 + * + * @param e + * @return + */ + @ResponseBody + @ExceptionHandler(value = {TenantDatabaseException.class, TenantInvalidException.class}) + public ActionResult tenantDatabaseException(TenantInvalidException e) { + String msg; + if(e.getMessage() == null){ + if (configValueUtil.getMultiTenancyUrl().contains("https")) { + // https 官网提示 + msg = MsgCode.LOG109.get(); + } else { + msg = MsgCode.LOG110.get(); + } + }else{ + msg = e.getMessage(); + } + if(e.getLogMsg() != null){ + log.error(e.getLogMsg()); + } + return ActionResult.fail(ActionResultCode.Fail.getCode(), msg); + } + + + +/// +// @ResponseBody +// @ExceptionHandler(value = SQLSyntaxErrorException.class) +// public ActionResult sqlException(SQLSyntaxErrorException e) { +// ActionResult result; +// log.error(e.getMessage()); +// e.printStackTrace(); +// if (e.getMessage().contains("Unknown database")) { +// printLog(e, "请求失败"); +// result = ActionResult.fail(ActionResultCode.Fail.getCode(), "请求失败"); +// } else { +// printLog(e, "数据库异常"); +// result = ActionResult.fail(ActionResultCode.Fail.getCode(), "数据库异常"); +// } +// return result; +// } +// +// @ResponseBody +// @ExceptionHandler(value = SQLServerException.class) +// public ActionResult sqlServerException(SQLServerException e) { +// ActionResult result; +// printLog(e, "系统异常"); +// if (e.getMessage().contains("将截断字符串")) { +// printLog(e, "某个字段字符长度超过限制,请检查。"); +// result = ActionResult.fail(ActionResultCode.Fail.getCode(), "某个字段字符长度超过限制,请检查。"); +// } else { +// log.error(e.getMessage()); +// printLog(e, "数据库异常,请检查。"); +// result = ActionResult.fail(ActionResultCode.Fail.getCode(), "数据库异常,请检查。"); +// } +// return result; +// } + + @ResponseBody + @ExceptionHandler(value = MethodArgumentNotValidException.class) + public ActionResult methodArgumentNotValidException(MethodArgumentNotValidException e) { + Map map = new HashMap<>(16); + List allErrors = e.getBindingResult().getAllErrors(); + for (int i = 0; i < allErrors.size(); i++) { + String s = allErrors.get(i).getCodes()[0]; + //用分割的方法得到字段名 + String[] parts = s.split("\\."); + String part1 = parts[parts.length - 1]; + map.put(part1, allErrors.get(i).getDefaultMessage()); + } + String json = JSON.toJSONString(map); + ActionResult result = ActionResult.fail(ActionResultCode.ValidateError.getCode(), json); + printLog(e, "字段验证异常", 4); + return result; + } + + @ResponseBody + @ExceptionHandler(value = WorkFlowException.class) + public ActionResult workFlowException(WorkFlowException e) { + if (e.getCode() == 200) { + Map map = JsonUtil.stringToMap(e.getMessage()); + return ActionResult.success(map); + } else { + if(e.getSuppressed()!=null) { + printLog(e, "系统异常", 4); + } + return ActionResult.fail(e.getMessage()); + } + } + + @ResponseBody + @ExceptionHandler(value = WxErrorException.class) + public ActionResult wxErrorException(WxErrorException e) { + return ActionResult.fail(e.getError().getErrorCode(), MsgCode.AD103.get()); + } + + @ResponseBody + @ExceptionHandler(value = ServletException.class) + public void exception(ServletException e) throws Exception { + log.error("系统异常:" + e.getMessage(), e); + printLog(e, "系统异常", 4); + throw new Exception(); + } + + @ResponseBody + @ExceptionHandler(value = Exception.class) + public ActionResult exception(Exception e) { + log.error("系统异常:" + e.getMessage(), e); + printLog(e, "系统异常", 4); + if(e instanceof ConnectDatabaseException || e.getCause() instanceof ConnectDatabaseException){ + Throwable t = e; + if(e.getCause() instanceof ConnectDatabaseException){ + t = e.getCause(); + } + return ActionResult.fail(ActionResultCode.Fail.getCode(), t.getMessage()); + } + return ActionResult.fail(ActionResultCode.Fail.getCode(), MsgCode.AD102.get()); + } + + /** + * 权限码异常 + */ + @ResponseBody + @ExceptionHandler(NotPermissionException.class) + public ActionResult handleNotPermissionException(NotPermissionException e) { + return ActionResult.fail(ActionResultCode.Fail.getCode(), MsgCode.AD104.get()); + } + + /** + * 角色权限异常 + */ + @ResponseBody + @ExceptionHandler(NotRoleException.class) + public ActionResult handleNotRoleException(NotRoleException e) { + return ActionResult.fail(ActionResultCode.ValidateError.getCode(), MsgCode.AD104.get()); + } + + /** + * 认证失败 + */ + @ResponseBody + @ExceptionHandler(NotLoginException.class) + public ActionResult handleNotLoginException(NotLoginException e) { + return ActionResult.fail(ActionResultCode.SessionOverdue.getCode(), MsgCode.AD105.get()); + } + + /** + * 无效认证 + */ + @ResponseBody + @ExceptionHandler(SameTokenInvalidException.class) + public ActionResult handleIdTokenInvalidException(SameTokenInvalidException e) { + return ActionResult.fail(ActionResultCode.SessionOverdue.getCode(), MsgCode.AD106.get()); + } + + private void printLog(Exception e, String msg, int type) { + try { + UserInfo userInfo = UserProvider.getUser(); + if (userInfo.getId() == null) { + e.printStackTrace(); + return; + } + //接口错误将不会进入数据库切源拦截器需要手动设置 + if (configValueUtil.isMultiTenancy() && TenantHolder.getDatasourceId() == null) { + try { + TenantDataSourceUtil.switchTenant(userInfo.getTenantId()); + } catch (Exception ee){ + e.printStackTrace(); + return; + } + } + LogEntity entity = new LogEntity(); + entity.setId(RandomUtil.uuId()); + entity.setUserId(userInfo.getUserId()); + entity.setUserName(userInfo.getUserName() + "/" + userInfo.getUserAccount()); +// if (!ServletUtil.getIsMobileDevice()) { + entity.setDescription(msg); +// } + StringBuilder sb = new StringBuilder(); + sb.append(e.toString() + "\n"); + StackTraceElement[] stackArray = e.getStackTrace(); + for (int i = 0; i < stackArray.length; i++) { + StackTraceElement element = stackArray[i]; + sb.append(element.toString() + "\n"); + } + entity.setJsons(sb.toString()); + entity.setRequestUrl(ServletUtil.getRequest().getServletPath()); + entity.setRequestMethod(ServletUtil.getRequest().getMethod()); + entity.setType(type); + entity.setUserId(userInfo.getUserId()); + // ip + String ipAddr = IpUtil.getIpAddr(); + entity.setIpAddress(ipAddr); + entity.setIpAddressName(IpUtil.getIpCity(ipAddr)); + entity.setCreatorTime(new Date()); + UserAgent userAgent = UserAgentUtil.parse(ServletUtil.getUserAgent()); + if (userAgent != null) { + entity.setPlatForm(userAgent.getPlatform().getName() + " " + userAgent.getOsVersion()); + entity.setBrowser(userAgent.getBrowser().getName() + " " + userAgent.getVersion()); + } + if (configValueUtil.isMultiTenancy() && StringUtil.isEmpty(TenantHolder.getDatasourceId())) { + log.error("请求异常, 无登陆租户:" + ReflectionUtil.toString(entity), e); + } else { + logService.save(entity); + } + }catch (Exception g){ + log.error(g.getMessage()); + }finally { + UserProvider.clearLocalUser(); + TenantProvider.clearBaseSystemIfo(); + TenantDataSourceUtil.clearLocalTenantInfo(); + NotTenantPluginHolder.clearNotSwitchFlag(); + } + } + + + /** + * 覆盖默认的JSON响应 + */ + @Override + @RequestMapping + public ResponseEntity> error(HttpServletRequest request) { + HttpStatus status = getStatus(request); + + if (status == HttpStatus.NOT_FOUND) { + return new ResponseEntity<>(status); + } + return super.error(request); + } + +} + diff --git a/yunzhupaas-exception/src/main/java/com/yunzhupaas/mapper/LogMapper.java b/yunzhupaas-exception/src/main/java/com/yunzhupaas/mapper/LogMapper.java new file mode 100644 index 0000000..d6d123b --- /dev/null +++ b/yunzhupaas-exception/src/main/java/com/yunzhupaas/mapper/LogMapper.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.entity.LogEntity; + + +/** + * 系统日志 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface LogMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-exception/src/main/java/com/yunzhupaas/model/ErrorLogVO.java b/yunzhupaas-exception/src/main/java/com/yunzhupaas/model/ErrorLogVO.java new file mode 100644 index 0000000..fbddd74 --- /dev/null +++ b/yunzhupaas-exception/src/main/java/com/yunzhupaas/model/ErrorLogVO.java @@ -0,0 +1,35 @@ +package com.yunzhupaas.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/16 10:10 + */ +@Data +public class ErrorLogVO { + @Schema(description = "创建用户") + private String userName; + @Schema(description = "创建时间",example = "1") + private Long creatorTime; + @Schema(description = "IP") + private String ipAddress; + private Long requestDuration; + @Schema(description = "地点") + private String ipAddressName; + @Schema(description = "id") + private String id; + @Schema(description = "请求设备") + private String platForm; + @Schema(description = "浏览器") + private String browser; + @Schema(description = "请求类型") + private String requestMethod; + @Schema(description = "请求地址") + private String requestUrl; +} + diff --git a/yunzhupaas-exception/src/main/java/com/yunzhupaas/model/HandleLogVO.java b/yunzhupaas-exception/src/main/java/com/yunzhupaas/model/HandleLogVO.java new file mode 100644 index 0000000..d095779 --- /dev/null +++ b/yunzhupaas-exception/src/main/java/com/yunzhupaas/model/HandleLogVO.java @@ -0,0 +1,66 @@ +package com.yunzhupaas.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * 操作日志模型 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/16 10:10 + */ +@Data +public class HandleLogVO implements Serializable { + + /** + * id + */ + public String id; + + /** + * 请求时间 + */ + public Long creatorTime; + + /** + * 请求用户名 + */ + public String userName; + + /** + * 请求IP + */ + public String ipAddress; + + /** + * 请求设备 + */ + public String platForm; + + /** + * 操作模块 + */ + public String moduleName; + + /** + * 操作类型 + */ + public String requestMethod; + + /** + * 请求耗时 + */ + public int requestDuration; + @Schema(description = "地点") + private String ipAddressName; + @Schema(description = "浏览器") + private String browser; + @Schema(description = "请求地址") + private String requestUrl; + +} + diff --git a/yunzhupaas-exception/src/main/java/com/yunzhupaas/model/LogDelForm.java b/yunzhupaas-exception/src/main/java/com/yunzhupaas/model/LogDelForm.java new file mode 100644 index 0000000..b7b19c7 --- /dev/null +++ b/yunzhupaas-exception/src/main/java/com/yunzhupaas/model/LogDelForm.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/16 10:10 + */ +@Data +public class LogDelForm { + @Schema(description = "id集合") + private String[] ids; +} + + diff --git a/yunzhupaas-exception/src/main/java/com/yunzhupaas/model/LogInfoVO.java b/yunzhupaas-exception/src/main/java/com/yunzhupaas/model/LogInfoVO.java new file mode 100644 index 0000000..9f4a640 --- /dev/null +++ b/yunzhupaas-exception/src/main/java/com/yunzhupaas/model/LogInfoVO.java @@ -0,0 +1,55 @@ +package com.yunzhupaas.model; + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/16 10:10 + */ +@Data +public class LogInfoVO { + @Schema(description = "主键") + private String id; + @Schema(description = "用户主键") + private String userId; + @Schema(description = "用户名称") + private String userName; + @Schema(description = "日志类型") + private Integer type; + @Schema(description = "日志级别") + private Integer levels; + @Schema(description = "IP地址") + private String ipAddress; + @Schema(description = "IP所在城市") + private String ipAddressName; + @Schema(description = "请求地址") + private String requestUrl; + @Schema(description = "请求方法") + private String requestMethod; + @Schema(description = "请求耗时") + private Integer requestDuration; + @Schema(description = "日志内容") + private String jsons; + @Schema(description = "平台设备") + private String platForm; + @Schema(description = "功能主键") + private String moduleId; + @Schema(description = "功能名称") + private String moduleName; + @Schema(description = "浏览器") + private String browser; + @Schema(description = "请求参数") + private String requestParam; + @Schema(description = "请求方法") + private String requestTarget; + + @Schema(description = "请求时间") + public Long creatorTime; +} + + diff --git a/yunzhupaas-exception/src/main/java/com/yunzhupaas/model/LoginLogVO.java b/yunzhupaas-exception/src/main/java/com/yunzhupaas/model/LoginLogVO.java new file mode 100644 index 0000000..76b6cd5 --- /dev/null +++ b/yunzhupaas-exception/src/main/java/com/yunzhupaas/model/LoginLogVO.java @@ -0,0 +1,41 @@ +package com.yunzhupaas.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/16 10:10 + */ +@Data +public class LoginLogVO { + @Schema(description = "id") + private String id; + @Schema(description = "创建时间",example = "1") + private Long creatorTime; + @Schema(description = "登陆用户") + private String userName; + @Schema(description = "登陆IP") + private String ipAddress; + @Schema(description = "登陆平台") + private String platForm; + @Schema(description = "登陆日志摘要") + private String abstracts; + @Schema(description = "地点") + private String ipAddressName; + @Schema(description = "浏览器") + private String browser; + @Schema(description = "是否登录成功标志") + private Integer loginMark; + @Schema(description = "登录类型") + private Integer loginType; + + /** + * 请求耗时 + */ + public int requestDuration; +} + diff --git a/yunzhupaas-exception/src/main/java/com/yunzhupaas/model/PaginationLogModel.java b/yunzhupaas-exception/src/main/java/com/yunzhupaas/model/PaginationLogModel.java new file mode 100644 index 0000000..6deffdc --- /dev/null +++ b/yunzhupaas-exception/src/main/java/com/yunzhupaas/model/PaginationLogModel.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.PaginationTime; +import lombok.Data; + +/** + * 日志分页参数 + * + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/3/18 9:50 + */ +@Data +public class PaginationLogModel extends PaginationTime { + /** + * 操作类型 + */ + private String requestMethod; + /** + * 类型 + */ + private int category; + @Schema(description = "是否登录成功标志") + private Integer loginMark; + @Schema(description = "登录类型") + private Integer loginType; + +} + diff --git a/yunzhupaas-exception/src/main/java/com/yunzhupaas/model/RequestLogVO.java b/yunzhupaas-exception/src/main/java/com/yunzhupaas/model/RequestLogVO.java new file mode 100644 index 0000000..dcd9c37 --- /dev/null +++ b/yunzhupaas-exception/src/main/java/com/yunzhupaas/model/RequestLogVO.java @@ -0,0 +1,36 @@ +package com.yunzhupaas.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/16 10:10 + */ +@Data +public class RequestLogVO { + @Schema(description = "id") + private String id; + @Schema(description = "请求时间",example = "1") + private Long creatorTime; + @Schema(description = "请求用户名") + private String userName; + @Schema(description = "请求IP") + private String ipAddress; + @Schema(description = "请求设备") + private String platForm; + @Schema(description = "请求地址") + private String requestUrl; + @Schema(description = "请求类型") + private String requestMethod; + @Schema(description = "请求耗时",example = "1") + private Long requestDuration; + @Schema(description = "地点") + private String ipAddressName; + @Schema(description = "浏览器") + private String browser; +} + diff --git a/yunzhupaas-exception/src/main/java/com/yunzhupaas/model/UserLogVO.java b/yunzhupaas-exception/src/main/java/com/yunzhupaas/model/UserLogVO.java new file mode 100644 index 0000000..a39adb7 --- /dev/null +++ b/yunzhupaas-exception/src/main/java/com/yunzhupaas/model/UserLogVO.java @@ -0,0 +1,39 @@ +package com.yunzhupaas.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class UserLogVO { + @Schema(description = "登录类型") + private Integer loginType; + @Schema(description = "登录时间") + private Long creatorTime; + @Schema(description = "登录用户") + private String userName; + @Schema(description = "登录IP") + private String ipAddress; + @Schema(description = "IP所在城市") + private String ipAddressName; + @Schema(description = "浏览器") + private String browser; + @Schema(description = "平台设备") + private String platForm; + @Schema(description = "请求耗时") + private Integer requestDuration; + @Schema(description = "是否登录成功标志") + private Integer loginMark; + @Schema(description = "说明") + private String abstracts; + @Schema(description = "主键") + private String id; +} + diff --git a/yunzhupaas-exception/src/main/java/com/yunzhupaas/service/LogService.java b/yunzhupaas-exception/src/main/java/com/yunzhupaas/service/LogService.java new file mode 100644 index 0000000..1db17f6 --- /dev/null +++ b/yunzhupaas-exception/src/main/java/com/yunzhupaas/service/LogService.java @@ -0,0 +1,83 @@ +package com.yunzhupaas.service; + +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.entity.LogEntity; +import com.yunzhupaas.model.PaginationLogModel; + +import java.util.List; +import java.util.Set; + +/** + * 系统日志 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface LogService extends SuperService { + + /** + * 列表 + * + * @param category 日志分类 + * @param paginationTime 分页条件 + * @return + */ + List getList(int category, PaginationLogModel paginationTime); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + LogEntity getInfo(String id); + + + /** + * 删除 + * @param ids + * @return + */ + boolean delete(String[] ids); + + /** + * 写入日志 + * + * @param userId 用户Id + * @param userName 用户名称 + * @param abstracts 摘要 + */ + void writeLogAsync(String userId, String userName, String abstracts, long requestDuration); + + /** + * 写入日志 + * + * @param userId 用户Id + * @param userName 用户名称 + * @param abstracts 摘要 + */ + void writeLogAsync(String userId, String userName, String abstracts, UserInfo userInfo, int loginMark, Integer loginType, long requestDuration); + + /** + * 请求日志 + * + * @param logEntity 实体对象 + */ + void writeLogAsync(LogEntity logEntity); + + /** + * 请求日志 + */ + void deleteHandleLog(String type, Integer userOnline); + + /** + * 获取操作模块名 + * + * @return + */ + Set queryList(); +} + diff --git a/yunzhupaas-exception/src/main/java/com/yunzhupaas/service/impl/LogServiceImpl.java b/yunzhupaas-exception/src/main/java/com/yunzhupaas/service/impl/LogServiceImpl.java new file mode 100644 index 0000000..7d9cc64 --- /dev/null +++ b/yunzhupaas-exception/src/main/java/com/yunzhupaas/service/impl/LogServiceImpl.java @@ -0,0 +1,194 @@ +package com.yunzhupaas.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.http.useragent.UserAgent; +import cn.hutool.http.useragent.UserAgentUtil; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.google.common.collect.Lists; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.entity.LogEntity; +import com.yunzhupaas.enums.LogSortEnum; +import com.yunzhupaas.exception.LoginException; +import com.yunzhupaas.mapper.LogMapper; +import com.yunzhupaas.model.PaginationLogModel; +import com.yunzhupaas.service.LogService; +import com.yunzhupaas.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 系统日志 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Service +public class LogServiceImpl extends SuperServiceImpl implements LogService { + + @Autowired + private ConfigValueUtil configValueUtil; + + @Override + public List getList(int category, PaginationLogModel paginationTime) { + UserInfo userInfo = UserProvider.getUser(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(LogEntity::getType, category); + //用户Id + String userId = userInfo.getUserId(); + String userAccount = userInfo.getUserAccount(); + if (!StringUtil.isEmpty(userId) && !StringUtil.isEmpty(userAccount)) { + if (!userInfo.getIsAdministrator()){ + queryWrapper.lambda().and( + t -> t.eq(LogEntity::getUserId, userId) + .or().eq(LogEntity::getUserId, userAccount) + ); + } + } + //日期范围(近7天、近1月、近3月、自定义) + if (!ObjectUtil.isEmpty(paginationTime.getStartTime()) && !ObjectUtil.isEmpty(paginationTime.getEndTime())) { + queryWrapper.lambda().between(LogEntity::getCreatorTime, new Date(paginationTime.getStartTime()), new Date(paginationTime.getEndTime())); + } + //关键字(用户、IP地址、功能名称) + String keyWord = paginationTime.getKeyword(); + if (!StringUtil.isEmpty(keyWord)) { + if (category == 1) { + queryWrapper.lambda().and( + t -> t.like(LogEntity::getUserName, keyWord) + .or().like(LogEntity::getIpAddress, keyWord) + ); + } else if (category == 5 || category == 4){ + queryWrapper.lambda().and( + t -> t.like(LogEntity::getUserName, keyWord) + .or().like(LogEntity::getIpAddress, keyWord) + .or().like(LogEntity::getRequestUrl, keyWord) + ); + } else if (category == 3){ + queryWrapper.lambda().and( + t -> t.like(LogEntity::getUserName, keyWord) + .or().like(LogEntity::getIpAddress, keyWord) + .or().like(LogEntity::getRequestUrl, keyWord) + .or().like(LogEntity::getModuleName, keyWord) + ); + } + } + // 请求方式 + if (StringUtil.isNotEmpty(paginationTime.getRequestMethod())) { + queryWrapper.lambda().eq(LogEntity::getRequestMethod, paginationTime.getRequestMethod()); + } + // 类型 + if (paginationTime.getLoginType() != null) { + queryWrapper.lambda().eq(LogEntity::getLoginType, paginationTime.getLoginType()); + } + // 状态 + if (paginationTime.getLoginMark() != null) { + queryWrapper.lambda().eq(LogEntity::getLoginMark, paginationTime.getLoginMark()); + } + //排序 + queryWrapper.lambda().orderByDesc(LogEntity::getCreatorTime); + Page page = new Page<>(paginationTime.getCurrentPage(), paginationTime.getPageSize()); + IPage userPage = this.page(page, queryWrapper); + return paginationTime.setData(userPage.getRecords(), page.getTotal()); + } + + @Override + public LogEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(LogEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + @DSTransactional + public boolean delete(String[] ids) { + if (ids.length > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(LogEntity::getId, ids); + return this.remove(queryWrapper); + } + return false; + } + + @Override + public void writeLogAsync(String userId, String userName, String abstracts, long requestDuration) { + writeLogAsync(userId, userName, abstracts, null, 1, null, requestDuration); + } + + @Override + public void writeLogAsync(String userId, String userName, String abstracts, UserInfo userInfo, int loginMark, Integer loginType, long requestDuration) { + LogEntity entity = new LogEntity(); + if (configValueUtil.isMultiTenancy() && userInfo != null) { + try { + TenantDataSourceUtil.switchTenant(userInfo.getTenantId()); + } catch (Exception e) { + return; + } + } + String ipAddr = IpUtil.getIpAddr(); + entity.setIpAddress(ipAddr); + entity.setIpAddressName(IpUtil.getIpCity(ipAddr)); + // 请求设备 + UserAgent userAgent = UserAgentUtil.parse(ServletUtil.getUserAgent()); + if (userAgent != null) { + entity.setPlatForm(userAgent.getPlatform().getName() + " " + userAgent.getOsVersion()); + entity.setBrowser(userAgent.getBrowser().getName() + " " + userAgent.getVersion()); + } + if (loginType != null) { + entity.setLoginType(1); + } else { + entity.setLoginType(0); + } + entity.setLoginMark(loginMark); + entity.setRequestDuration(Integer.parseInt(String.valueOf(requestDuration))); + entity.setId(RandomUtil.uuId()); + entity.setUserId(userId); + entity.setUserName(userName); + entity.setDescription(abstracts); + entity.setRequestUrl(ServletUtil.getServletPath()); + entity.setRequestMethod(ServletUtil.getRequest().getMethod()); + entity.setType(LogSortEnum.Login.getCode()); + this.save(entity); + } + + @Override + public void writeLogAsync(LogEntity entity) { + entity.setId(RandomUtil.uuId()); + this.save(entity); + } + + @Override + public void deleteHandleLog(String type, Integer userOnline) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(LogEntity::getType, Integer.valueOf(type)); + if (ObjectUtil.equals(userOnline, 1)) { + queryWrapper.lambda().eq(LogEntity::getCreatorUserId, UserProvider.getLoginUserId()); + } + queryWrapper.lambda().select(LogEntity::getId); + List ids = this.list(queryWrapper).stream().map(LogEntity::getId).collect(Collectors.toList()); + List> lists = Lists.partition(ids, 1000); + for (List list : lists) { + QueryWrapper deleteWrapper = new QueryWrapper<>(); + deleteWrapper.lambda().in(LogEntity::getId,list); + this.remove(deleteWrapper); + } + } + + @Override + public Set queryList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(LogEntity::getType, 3); + return this.list(queryWrapper).size() > 0 ? this.list(queryWrapper).stream().map(t -> t.getModuleName()).collect(Collectors.toSet()) : new HashSet<>(16); + } +} + diff --git a/yunzhupaas-exception/src/main/java/com/yunzhupaas/util/JsonUtilEx.java b/yunzhupaas-exception/src/main/java/com/yunzhupaas/util/JsonUtilEx.java new file mode 100644 index 0000000..2d22e6d --- /dev/null +++ b/yunzhupaas-exception/src/main/java/com/yunzhupaas/util/JsonUtilEx.java @@ -0,0 +1,79 @@ +package com.yunzhupaas.util; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.serializer.SerializerFeature; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.DataException; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/16 10:10 + */ +public class JsonUtilEx { + + + /** + * 功能描述:把java对象转换成JSON数据,时间格式化 + * @param object java对象 + * @return JSON数据 + */ + public static String getObjectToStringDateFormat(Object object,String dateFormat) { + return JSON.toJSONStringWithDateFormat(object, dateFormat,SerializerFeature.WriteMapNullValue); + } + +// /** +// * 功能描述:把JSON数据转换成指定的java对象列表 +// * @param jsonData JSON数据 +// * @param clazz 指定的java对象 +// * @return List +// */ +// public static List getJsonToListStringDateFormat(String jsonData, Class clazz,String dateFormat) { +// JSONArray jsonArray=JSONUtil.getJsonToJsonArray(jsonData); +// JSONArray newJsonArray=JSONUtil.getJsonToJsonArray(jsonData); +// for (int i = 0; i < jsonArray.size(); i++) { +// JSONObject jsonObject = jsonArray.getJSONObject(i); +// newJsonArray.add(JSON.toJSONStringWithDateFormat(jsonObject, dateFormat,SerializerFeature.WriteMapNullValue)); +// } +// jsonData=JSONUtil.getObjectToString(newJsonArray); +// return JSON.parseArray(jsonData, clazz); +// } +// +// public static void main(String[] args) { +// Date date=new Date(); +// String obk="[" + +// "{\"date\":\""+date+"\"},{\"date\":\"1603165505\"}" + +// "]"; +// List list1= getJsonToList(obk,String.class); +// List list11= getJsonToListStringDateFormat(obk,String.class,"yyyy-MM-dd"); +// System.out.println("aaa"); +// } + + + /** + * 功能描述:把java对象转换成JSON数据 + * @param object java对象 + * @return JSON数据 + */ + public static String getObjectToString(Object object) { + return JSON.toJSONString(object, SerializerFeature.WriteMapNullValue); + } + + /** + * 功能描述:把JSON数据转换成指定的java对象 + * @param dto dto对象 + * @param clazz 指定的java对象 + * @return 指定的java对象 + */ + public static T getJsonToBeanEx(Object dto, Class clazz) throws DataException { + if(dto==null){ + throw new DataException(MsgCode.FA001.get()); + } + return JSON.parseObject(getObjectToString(dto), clazz); + } + + +} + diff --git a/yunzhupaas-extend/pom.xml b/yunzhupaas-extend/pom.xml new file mode 100644 index 0000000..362f43b --- /dev/null +++ b/yunzhupaas-extend/pom.xml @@ -0,0 +1,20 @@ + + + + yunzhupaas-java-boot + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-extend + pom + + yunzhupaas-extend-entity + yunzhupaas-extend-biz + yunzhupaas-extend-controller + + + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/pom.xml b/yunzhupaas-extend/yunzhupaas-extend-biz/pom.xml new file mode 100644 index 0000000..8679184 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/pom.xml @@ -0,0 +1,45 @@ + + + + yunzhupaas-extend + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-extend-biz + + + + com.yunzhupaas + yunzhupaas-extend-entity + ${project.version} + + + + com.yunzhupaas + yunzhupaas-system-biz + ${project.version} + + + + com.github.librepdf + openpdf + + + com.github.librepdf + openpdf-fonts-extra + + + com.yunzhupaas + yunzhupaas-generater-base + ${project.version} + + + + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/BigDataMapper.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/BigDataMapper.java new file mode 100644 index 0000000..8831e56 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/BigDataMapper.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.entity.BigDataEntity; + +/** + * 大数据测试 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public interface BigDataMapper extends SuperMapper { + + Integer maxCode(); + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/CustomerMapper.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/CustomerMapper.java new file mode 100644 index 0000000..6606e1d --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/CustomerMapper.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.entity.CustomerEntity; + +/** + * + * 客户信息 + * 版本: V3.1.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2021-07-10 14:09:05 + */ +public interface CustomerMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/DocumentLogMapper.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/DocumentLogMapper.java new file mode 100644 index 0000000..35d0f2c --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/DocumentLogMapper.java @@ -0,0 +1,8 @@ +package com.yunzhupaas.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.entity.DocumentLogEntity; + +public interface DocumentLogMapper extends SuperMapper { +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/DocumentMapper.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/DocumentMapper.java new file mode 100644 index 0000000..233a686 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/DocumentMapper.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.mapper; + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.entity.DocumentEntity; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 知识文档 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public interface DocumentMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/DocumentShareMapper.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/DocumentShareMapper.java new file mode 100644 index 0000000..d223a6c --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/DocumentShareMapper.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.mapper; + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.entity.DocumentShareEntity; + +/** + * 知识文档 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public interface DocumentShareMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/EmailConfigMapper.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/EmailConfigMapper.java new file mode 100644 index 0000000..0179ad5 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/EmailConfigMapper.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.mapper; + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.entity.EmailConfigEntity; + +/** + * 邮件配置 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public interface EmailConfigMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/EmailReceiveMapper.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/EmailReceiveMapper.java new file mode 100644 index 0000000..7ebb521 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/EmailReceiveMapper.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.mapper; + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.base.entity.EmailReceiveEntity; + +/** + * 邮件接收 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public interface EmailReceiveMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/EmailSendMapper.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/EmailSendMapper.java new file mode 100644 index 0000000..177c5a0 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/EmailSendMapper.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.mapper; + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.entity.EmailSendEntity; + +/** + * 邮件发送 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public interface EmailSendMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/EmployeeMapper.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/EmployeeMapper.java new file mode 100644 index 0000000..56cacf7 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/EmployeeMapper.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.mapper; + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.entity.EmployeeEntity; + +/** + * 职员信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public interface EmployeeMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/LeaveApplyMapper.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/LeaveApplyMapper.java new file mode 100644 index 0000000..45e672a --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/LeaveApplyMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.entity.LeaveApplyEntity; + +/** + * 流程表单【请假申请】 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-29 上午9:18 + */ +public interface LeaveApplyMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/OrderEntryMapper.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/OrderEntryMapper.java new file mode 100644 index 0000000..e5e1aff --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/OrderEntryMapper.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.entity.OrderEntryEntity; + +/** + * 订单明细 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public interface OrderEntryMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/OrderMapper.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/OrderMapper.java new file mode 100644 index 0000000..ac0aa35 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/OrderMapper.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.entity.OrderEntity; + +/** + * 订单信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public interface OrderMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/OrderReceivableMapper.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/OrderReceivableMapper.java new file mode 100644 index 0000000..6f4ebd0 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/OrderReceivableMapper.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.entity.OrderReceivableEntity; + +/** + * 订单收款 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public interface OrderReceivableMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/ProductEntryMapper.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/ProductEntryMapper.java new file mode 100644 index 0000000..fc2b1a2 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/ProductEntryMapper.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.mapper; + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.entity.ProductEntryEntity; + +/** + * + * base_productentry + * 版本: V3.1.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2021-07-10 10:40:59 + */ +public interface ProductEntryMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/ProductGoodsMapper.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/ProductGoodsMapper.java new file mode 100644 index 0000000..4820c18 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/ProductGoodsMapper.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.mapper; + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.entity.ProductGoodsEntity; + +/** + * + * 产品商品 + * 版本: V3.1.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2021-07-10 15:57:50 + */ +public interface ProductGoodsMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/ProductMapper.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/ProductMapper.java new file mode 100644 index 0000000..20f29d1 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/ProductMapper.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.mapper; + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.entity.ProductEntity; + +/** + * + * 销售订单 + * 版本: V3.1.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2021-07-10 10:40:59 + */ +public interface ProductMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/ProductclassifyMapper.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/ProductclassifyMapper.java new file mode 100644 index 0000000..0b8d15d --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/ProductclassifyMapper.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.entity.ProductclassifyEntity; + +/** + * + * 产品分类 + * 版本: V3.1.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2021-07-10 14:34:04 + */ +public interface ProductclassifyMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/ProjectGanttMapper.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/ProjectGanttMapper.java new file mode 100644 index 0000000..43ae653 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/ProjectGanttMapper.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.mapper; + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.entity.ProjectGanttEntity; + +/** + * 订单收款 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public interface ProjectGanttMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/SalesOrderEntryMapper.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/SalesOrderEntryMapper.java new file mode 100644 index 0000000..6be60e1 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/SalesOrderEntryMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.entity.SalesOrderEntryEntity; + +/** + * 销售订单明细 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-29 上午9:18 + */ +public interface SalesOrderEntryMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/SalesOrderMapper.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/SalesOrderMapper.java new file mode 100644 index 0000000..d3a14bd --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/SalesOrderMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.entity.SalesOrderEntity; + +/** + * 销售订单 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-29 上午9:18 + */ +public interface SalesOrderMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/TableExampleMapper.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/TableExampleMapper.java new file mode 100644 index 0000000..bfd0fa0 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/TableExampleMapper.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.mapper; + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.entity.TableExampleEntity; + +/** + * 表格示例数据 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public interface TableExampleMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/WorkLogMapper.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/WorkLogMapper.java new file mode 100644 index 0000000..97f9ac7 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/WorkLogMapper.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.mapper; + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.entity.WorkLogEntity; + +/** + * 工作日志 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public interface WorkLogMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/WorkLogShareMapper.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/WorkLogShareMapper.java new file mode 100644 index 0000000..19605ae --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/mapper/WorkLogShareMapper.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.mapper; + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.entity.WorkLogShareEntity; + +/** + * 工作日志分享 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public interface WorkLogShareMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/BigDataService.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/BigDataService.java new file mode 100644 index 0000000..d93a3d5 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/BigDataService.java @@ -0,0 +1,35 @@ +package com.yunzhupaas.service; + +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.entity.BigDataEntity; +import com.yunzhupaas.exception.WorkFlowException; + +import java.util.List; + +/** + * 大数据测试 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +public interface BigDataService extends SuperService { + + /** + * 列表 + * + * @param pagination 分页参数 + * @return + */ + List getList(Pagination pagination); + + /** + * 创建 + * @param insertCount 添加数量 + * @throws WorkFlowException + */ + void create(int insertCount) throws WorkFlowException; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/CustomerService.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/CustomerService.java new file mode 100644 index 0000000..e327b05 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/CustomerService.java @@ -0,0 +1,30 @@ +package com.yunzhupaas.service; + +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.entity.CustomerEntity; + +import java.util.List; + +/** + * + * 客户信息 + * 版本: V3.1.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2021-07-10 14:09:05 + */ +public interface CustomerService extends SuperService { + + List getList(Pagination pagination); + + CustomerEntity getInfo(String id); + + void delete(CustomerEntity entity); + + void create(CustomerEntity entity); + + boolean update( String id, CustomerEntity entity); + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/DocumentLogService.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/DocumentLogService.java new file mode 100644 index 0000000..471fb62 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/DocumentLogService.java @@ -0,0 +1,8 @@ +package com.yunzhupaas.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.entity.DocumentLogEntity; + +public interface DocumentLogService extends SuperService { +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/DocumentService.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/DocumentService.java new file mode 100644 index 0000000..2ef3d24 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/DocumentService.java @@ -0,0 +1,201 @@ +package com.yunzhupaas.service; + + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.entity.DocumentEntity; +import com.yunzhupaas.entity.DocumentShareEntity; +import com.yunzhupaas.model.document.DocumentShareForm; +import com.yunzhupaas.model.document.DocumentTrashListVO; +import com.yunzhupaas.model.document.FlowFileModel; + +import java.util.List; +import java.util.Map; + +/** + * 知识文档 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +public interface DocumentService extends SuperService { + + /** + * 列表(全部文档) + * + * @return + */ + List getFolderList(); + + /** + * 列表(全部文档) + * + * @param parentId 文档父级 + * @return + */ + List getAllList(String parentId); + + /** + * 列表(全部文档) + * + * @param parentId 文档父级 + * @return + */ + List getChildList(String parentId,boolean isShare); + + /** + * 列表(全部文档) + * + * @param parentId 文档父级 + * @param userId 用户主键 + */ + List getAllList(String parentId, String userId); + + /** + * 列表查询(全部文档) + * + * @param keyword 文档父级 + * @return + */ + List getSearchAllList(String keyword); + + /** + * 列表(回收站) + * + * @return + */ + List getTrashList(String keyword); + + /** + * 列表(我的共享) + * + * @return + */ + List getShareOutList(); + + /** + * 列表(共享给我) + * + * @return + */ + List getShareTomeList(); + + /** + * 获取文件信息 + * + */ + List getInfoByIds(List ids); + /** + * 列表(共享人员) + * + * @param documentId 文档主键 + * @return + */ + List getShareUserList(String documentId); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + DocumentEntity getInfo(String id); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(DocumentEntity entity); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(DocumentEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return + */ + boolean update(String id, DocumentEntity entity); + + /** + * 共享文件(创建) + * + * @return + */ + void sharecreate(DocumentShareForm documentShareForm); + + /** + * 共享文件(取消) + * + * @return + */ + void shareCancel(List documentIds); + + /** + * 共享用户调整 + */ + void shareAdjustment(String id, List userIds); + + /** + * 回收站(删除) + * + * @param folderId 文件夹主键值 + * @return + */ + void trashdelete(List folderId); + + /** + * 回收站(还原,包含文件夹及内部数据还原) + * + * @param ids 主键值数组 + * @return + */ + void trashRecoveryConstainSrc(List ids); + + /** + * 回收站(还原) + * + * @param id 主键值 + * @return + */ + boolean trashRecovery(String id, boolean initParent); + + /** + * 文件/夹移动到 + * + * @param id 主键值 + * @param toId 将要移动到Id + * @return + */ + boolean moveTo(String id, String toId); + + /** + * 验证文件名是否重复 + * + * @param id 主键值 + * @param fullName 文件夹名称 + * @return + */ + boolean isExistByFullName(String fullName, String id, String parentId); + + /** + * 递归获取下级所有文件及文件夹 + * + * @return + */ + void getChildSrcList(String pId, List list, Integer enabledMark); + + + DocumentShareEntity getShareByParentId(String parentId); + + List> getFlowFile(FlowFileModel model); +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/DocumentShareService.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/DocumentShareService.java new file mode 100644 index 0000000..49ef0c0 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/DocumentShareService.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.entity.DocumentShareEntity; + + +/** + * 大数据测试 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +public interface DocumentShareService extends SuperService { + + /** + * 查询共享给我的文件 + * + * @param docId + * @param shareUserId + * @return + */ + DocumentShareEntity getByDocIdAndShareUserId(String docId, String shareUserId); +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/EmailConfigService.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/EmailConfigService.java new file mode 100644 index 0000000..f44734b --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/EmailConfigService.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.service; + +import com.yunzhupaas.base.entity.EmailConfigEntity; +import com.yunzhupaas.base.service.SuperService; + + +/** + * 邮件配置 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +public interface EmailConfigService extends SuperService { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/EmailReceiveService.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/EmailReceiveService.java new file mode 100644 index 0000000..f408c27 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/EmailReceiveService.java @@ -0,0 +1,150 @@ +package com.yunzhupaas.service; + +import com.yunzhupaas.base.PaginationTime; +import com.yunzhupaas.base.entity.EmailConfigEntity; +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.base.entity.EmailReceiveEntity; +import com.yunzhupaas.entity.EmailSendEntity; +import com.yunzhupaas.exception.DataException; + +import java.util.List; + +/** + * 邮件接收 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +public interface EmailReceiveService extends SuperService { + + /** + * 列表(收件箱) + * + * @param paginationTime 分页条件 + * @return + */ + List getReceiveList(PaginationTime paginationTime); + + /** + * 列表(收件箱) + * + * @return + */ + List getReceiveList(); + + /** + * 列表(收件箱) + * 门户专用 + * + * @return + */ + List getDashboardReceiveList(); + + /** + * 列表(星标件) + * + * @param paginationTime 分页条件 + * @return + */ + List getStarredList(PaginationTime paginationTime); + + /** + * 列表(草稿箱) + * + * @param paginationTime 分页条件 + * @return + */ + List getDraftList(PaginationTime paginationTime); + + /** + * 列表(已发送) + * + * @param paginationTime 分页条件 + * @return + */ + List getSentList(PaginationTime paginationTime); + + /** + * 信息(配置) + * + * @return + */ + EmailConfigEntity getConfigInfo(); + + /** + * 信息(配置) + * @param userId + * @return + */ + EmailConfigEntity getConfigInfo(String userId); + + /** + * 信息(收件/发件) + * + * @param id 主键值 + * @return + */ + Object getInfo(String id); + + /** + * 删除邮件(发、收) + * + * @param id 主键值 + * @return + */ + boolean delete(String id); + + /** + * 存草稿 + * + * @param entity 实体对象 + */ + void saveDraft(EmailSendEntity entity); + + /** + * 收邮件设置 已读/未读 + * + * @param id + * @param isRead + * @return + */ + boolean receiveRead(String id, int isRead); + + /** + * 收邮件 星标邮件/取消星标 + * + * @param id + * @param isStarred + * @return + */ + boolean receiveStarred(String id, int isStarred); + + /** + * 保存邮箱配置 + * + * @param configEntity + * @throws DataException + * @return + */ + void saveConfig(EmailConfigEntity configEntity) throws DataException; + + /** + * 发邮件 + * + * @param entity 实体对象 + * @param mailConfig 邮件配置 + * @return + */ + int saveSent(EmailSendEntity entity, EmailConfigEntity mailConfig) ; + + /** + * 收邮件 + * + * @param mailConfig 邮件配置 + * @return + */ + int receive(EmailConfigEntity mailConfig); +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/EmailSendService.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/EmailSendService.java new file mode 100644 index 0000000..daefda7 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/EmailSendService.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.entity.EmailSendEntity; + + +/** + * 邮件发送 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +public interface EmailSendService extends SuperService { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/EmployeeService.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/EmployeeService.java new file mode 100644 index 0000000..b5ea549 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/EmployeeService.java @@ -0,0 +1,91 @@ +package com.yunzhupaas.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.entity.EmployeeEntity; +import com.yunzhupaas.model.EmployeeModel; +import com.yunzhupaas.model.employee.EmployeeImportVO; +import com.yunzhupaas.model.employee.PaginationEmployee; + +import java.util.List; +import java.util.Map; + +/** + * 职员信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +public interface EmployeeService extends SuperService { + + /** + * 列表 + * + * @return + */ + List getList(); + + /** + * 列表 + * + * @param paginationEmployee + * @return + */ + List getList(PaginationEmployee paginationEmployee); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + EmployeeEntity getInfo(String id); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(EmployeeEntity entity); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(EmployeeEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + */ + void update(String id, EmployeeEntity entity); + + /** + * 导入预览 + * + * @param personList 实体对象 + * @return + */ + Map importPreview(List personList); + + /** + * 导入数据 + * + * @param dt 数据源 + * @return + */ + EmployeeImportVO importData(List dt); + + /** + * 导出pdf + * + * @param list 集合数据 + * @param outputUrl 保存路径 + * @return + */ + void exportPdf(List list, String outputUrl); +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/LeaveApplyService.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/LeaveApplyService.java new file mode 100644 index 0000000..813ea0e --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/LeaveApplyService.java @@ -0,0 +1,59 @@ +package com.yunzhupaas.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.entity.LeaveApplyEntity; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.model.leaveapply.LeaveApplyForm; + +/** + * 流程表单【请假申请】 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-29 上午9:18 + */ +public interface LeaveApplyService extends SuperService { + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + LeaveApplyEntity getInfo(String id); + + /** + * 保存 + * + * @param id 主键值 + * @param entity 实体对象 + * @throws WorkFlowException 异常 + */ + void save(String id, LeaveApplyEntity entity, LeaveApplyForm form); + + /** + * 提交 + * + * @param id 主键值 + * @param entity 实体对象 + * @throws WorkFlowException 异常 + */ + void submit(String id, LeaveApplyEntity entity, LeaveApplyForm form); + + /** + * 更改数据 + * + * @param id 主键值 + * @param data 实体对象 + */ + void data(String id, String data); + + /** + * 删除 + * + * @param entity 实体 + */ + void delete(LeaveApplyEntity entity); +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/OrderEntryService.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/OrderEntryService.java new file mode 100644 index 0000000..16cfeb7 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/OrderEntryService.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.entity.OrderEntryEntity; + +/** + * 订单明细 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +public interface OrderEntryService extends SuperService { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/OrderReceivableService.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/OrderReceivableService.java new file mode 100644 index 0000000..9fd8b39 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/OrderReceivableService.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.entity.OrderReceivableEntity; + +/** + * 订单收款 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +public interface OrderReceivableService extends SuperService { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/OrderService.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/OrderService.java new file mode 100644 index 0000000..d43145f --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/OrderService.java @@ -0,0 +1,113 @@ +package com.yunzhupaas.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.entity.OrderEntity; +import com.yunzhupaas.entity.OrderEntryEntity; +import com.yunzhupaas.entity.OrderReceivableEntity; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.model.order.OrderInfoVO; +import com.yunzhupaas.model.order.PaginationOrder; + +import java.util.List; + +/** + * 订单信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public interface OrderService extends SuperService { + + /** + * 列表 + * + * @param paginationOrder 分页 + * @return + */ + List getList(PaginationOrder paginationOrder); + + /** + * 子列表(订单明细) + * + * @param id 主表Id + * @return + */ + List getOrderEntryList(String id); + + /** + * 子列表(订单收款) + * + * @param id 主表Id + * @return + */ + List getOrderReceivableList(String id); + + /** + * 信息(前单、后单) + * + * @param id 主键值 + * @param method 方法:prev、next + * @return + */ + OrderEntity getPrevOrNextInfo(String id, String method); + + /** + * 信息(前单、后单) + * + * @param id 主键值 + * @param method 方法:prev、next + * @return + * @throws DataException 异常 + */ + OrderInfoVO getInfoVo(String id, String method) throws DataException; + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + OrderEntity getInfo(String id); + + /** + * 删除 + * + * @param entity 订单信息 + */ + void delete(OrderEntity entity); + + /** + * 新增 + * + * @param entity 订单信息 + * @param orderEntryList 订单明细 + * @param orderReceivableList 订单收款 + * @throws WorkFlowException 异常 + */ + void create(OrderEntity entity, List orderEntryList, List orderReceivableList); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 订单信息 + * @param orderEntryList 订单明细 + * @param orderReceivableList 订单收款 + * @return + * @throws WorkFlowException 异常 + */ + boolean update(String id, OrderEntity entity, List orderEntryList, List orderReceivableList); + + /** + * 更改数据 + * + * @param id 主键值 + * @param data 实体对象 + */ + void data(String id, String data); + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/ProductEntryService.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/ProductEntryService.java new file mode 100644 index 0000000..f181ea1 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/ProductEntryService.java @@ -0,0 +1,23 @@ +package com.yunzhupaas.service; + +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.entity.ProductEntryEntity; + +import java.util.List; + +/** + * + * 销售订单明细 + * 版本: V3.1.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2021-07-10 10:40:59 + */ +public interface ProductEntryService extends SuperService { + + List getProductentryEntityList(String id); + + List getProductentryEntityList(Pagination pagination); +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/ProductGoodsService.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/ProductGoodsService.java new file mode 100644 index 0000000..d61d3ab --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/ProductGoodsService.java @@ -0,0 +1,32 @@ +package com.yunzhupaas.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.entity.ProductGoodsEntity; +import com.yunzhupaas.model.productgoods.ProductGoodsPagination; + +import java.util.List; + +/** + * + * 产品商品 + * 版本: V3.1.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2021-07-10 15:57:50 + */ +public interface ProductGoodsService extends SuperService { + + List getGoodList(String type); + + List getList(ProductGoodsPagination productgoodsPagination); + + ProductGoodsEntity getInfo(String id); + + void delete(ProductGoodsEntity entity); + + void create(ProductGoodsEntity entity); + + boolean update( String id, ProductGoodsEntity entity); + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/ProductService.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/ProductService.java new file mode 100644 index 0000000..2c5a265 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/ProductService.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.entity.ProductEntity; +import com.yunzhupaas.entity.ProductEntryEntity; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.model.product.ProductPagination; + +import java.util.List; + +/** + * 销售订单 + * 版本: V3.1.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2021-07-10 10:40:59 + */ +public interface ProductService extends SuperService { + + List getList(ProductPagination productPagination); + + ProductEntity getInfo(String id); + + void delete(ProductEntity entity); + + void create(ProductEntity entity, List productEntryList ) throws DataException; + + boolean update(String id, ProductEntity entity, List productEntryList ); + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/ProductclassifyService.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/ProductclassifyService.java new file mode 100644 index 0000000..508a83c --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/ProductclassifyService.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.entity.ProductclassifyEntity; + +import java.util.List; + +/** + * + * 产品分类 + * 版本: V3.1.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2021-07-10 14:34:04 + */ +public interface ProductclassifyService extends SuperService { + + List getList(); + + ProductclassifyEntity getInfo(String id); + + void delete(ProductclassifyEntity entity); + + void create(ProductclassifyEntity entity); + + boolean update( String id, ProductclassifyEntity entity); + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/ProjectGanttService.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/ProjectGanttService.java new file mode 100644 index 0000000..abc268c --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/ProjectGanttService.java @@ -0,0 +1,110 @@ +package com.yunzhupaas.service; + +import com.yunzhupaas.base.Page; +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.entity.ProjectGanttEntity; + +import java.util.List; + +/** + * 项目计划 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +public interface ProjectGanttService extends SuperService { + + /** + * 项目列表 + * @param page + * @return + */ + List getList(Page page); + + /** + * 任务列表 + * + * @param projectId 项目Id + * @return + */ + List getTaskList(String projectId); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + ProjectGanttEntity getInfo(String id); + + /** + * 判断是否允许删除 + * + * @param id 主键值 + * @return + */ + boolean allowDelete(String id); + + /** + * 删除 + * + * @param entity 实体对象 + * @return + */ + void delete(ProjectGanttEntity entity); + + /** + * 创建 + * + * @param entity 实体对象 + * @return + */ + void create(ProjectGanttEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return + */ + boolean update(String id, ProjectGanttEntity entity); + + /** + * 验证名称 + * + * @param fullName 名称 + * @param id 主键值 + * @return + */ + boolean isExistByFullName(String fullName, String id); + + /** + * 验证编码 + * + * @param enCode 编码 + * @param id 主键值 + * @return + */ + boolean isExistByEnCode(String enCode, String id); + + + /** + * 上移 + * + * @param id 主键值 + * @return + */ + boolean first(String id); + + /** + * 下移 + * + * @param id 主键值 + * @return + */ + boolean next(String id); +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/SalesOrderEntryService.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/SalesOrderEntryService.java new file mode 100644 index 0000000..2da6a04 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/SalesOrderEntryService.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.entity.SalesOrderEntryEntity; + +/** + * 销售订单明细 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-29 上午9:18 + */ +public interface SalesOrderEntryService extends SuperService { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/SalesOrderService.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/SalesOrderService.java new file mode 100644 index 0000000..8fe9dd3 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/SalesOrderService.java @@ -0,0 +1,72 @@ +package com.yunzhupaas.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.entity.SalesOrderEntity; +import com.yunzhupaas.entity.SalesOrderEntryEntity; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.model.salesorder.SalesOrderForm; + +import java.util.List; + +/** + * 销售订单 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-29 上午9:18 + */ +public interface SalesOrderService extends SuperService { + + /** + * 列表 + * + * @param id 主键值 + * @return + */ + List getSalesEntryList(String id); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + SalesOrderEntity getInfo(String id); + + /** + * 保存 + * + * @param id 主键值 + * @param entity 实体对象 + * @param salesOrderEntryEntityList 子表 + * @throws WorkFlowException 异常 + */ + void save(String id, SalesOrderEntity entity, List salesOrderEntryEntityList, SalesOrderForm form); + + /** + * 提交 + * + * @param id 主键值 + * @param entity 实体对象 + * @param salesOrderEntryEntityList 子表 + * @throws WorkFlowException 异常 + */ + void submit(String id, SalesOrderEntity entity, List salesOrderEntryEntityList, SalesOrderForm form); + + /** + * 更改数据 + * + * @param id 主键值 + * @param data 实体对象 + */ + void data(String id, String data); + + /** + * 删除 + * + * @param entity 实体 + */ + void delete(SalesOrderEntity entity); +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/TableExampleService.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/TableExampleService.java new file mode 100644 index 0000000..345a2bb --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/TableExampleService.java @@ -0,0 +1,91 @@ +package com.yunzhupaas.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.entity.TableExampleEntity; +import com.yunzhupaas.model.tableexample.PaginationTableExample; + +import java.util.List; + +/** + * 表格示例数据 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +public interface TableExampleService extends SuperService { + + /** + * 列表 + * + * @return + */ + List getList(); + + /** + * 列表(带关键字) + * + * @param keyword 关键字 + * @return + */ + List getList(String keyword); + + /** + * 列表 + * + * @param typeId 类别主键 + * @param paginationTableExample + * @return + */ + List getList(String typeId, PaginationTableExample paginationTableExample); + + /** + * 列表 + * + * @param paginationTableExample + * @return + */ + List getList(PaginationTableExample paginationTableExample); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + TableExampleEntity getInfo(String id); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(TableExampleEntity entity); + + /** + * 创建 + * + * @param entity 实体对象 + * @return + */ + void create(TableExampleEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return + */ + boolean update(String id, TableExampleEntity entity); + + /** + * 行编辑 + * + * @param entity 实体对象 + * @return + */ + boolean rowEditing(TableExampleEntity entity); +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/WorkLogService.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/WorkLogService.java new file mode 100644 index 0000000..6adb392 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/WorkLogService.java @@ -0,0 +1,65 @@ +package com.yunzhupaas.service; + +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.entity.WorkLogEntity; + +import java.util.List; + +/** + * 工作日志 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +public interface WorkLogService extends SuperService { + + /** + * 列表(我发出的) + * @param pageModel 请求参数 + * @return + */ + List getSendList(Pagination pageModel); + + /** + * 列表(我收出的) + * @param pageModel 请求参数 + * @return + */ + List getReceiveList(Pagination pageModel); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + WorkLogEntity getInfo(String id); + + /** + * 创建 + * + * @param entity 实体对象 + * @return + */ + void create(WorkLogEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return + */ + boolean update(String id, WorkLogEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(WorkLogEntity entity); +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/WorkLogShareService.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/WorkLogShareService.java new file mode 100644 index 0000000..42f12a8 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/WorkLogShareService.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.entity.WorkLogShareEntity; + + +/** + * 工作日志分享 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +public interface WorkLogShareService extends SuperService { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/BigDataServiceImpl.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/BigDataServiceImpl.java new file mode 100644 index 0000000..91bb4d0 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/BigDataServiceImpl.java @@ -0,0 +1,135 @@ +package com.yunzhupaas.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.entity.SuperBaseEntity; +import com.yunzhupaas.base.service.DbLinkService; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.GlobalConst; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.database.model.entity.DbLinkEntity; +import com.yunzhupaas.database.util.ConnUtil; +import com.yunzhupaas.database.util.DataSourceUtil; +import com.yunzhupaas.database.util.DbTypeUtil; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.entity.BigDataEntity; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.mapper.BigDataMapper; +import com.yunzhupaas.service.BigDataService; +import com.yunzhupaas.util.DateUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import lombok.Cleanup; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.Timestamp; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +/** + * 大数据测试 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +@Slf4j +@Service +public class BigDataServiceImpl extends SuperServiceImpl implements BigDataService { + + @Autowired + private DataSourceUtil dataSourceUtils; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private DbLinkService dbLinkService; + + + @Override + public List getList(Pagination pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + queryWrapper.lambda().and( + t -> t.like(BigDataEntity::getFullName, pagination.getKeyword()) + .or().like(BigDataEntity::getEnCode, pagination.getKeyword()) + ); + } + //排序 + queryWrapper.lambda().orderByDesc(SuperBaseEntity.SuperCBaseEntity::getCreatorTime, SuperBaseEntity.SuperIBaseEntity::getId); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage iPage = this.page(page, queryWrapper); + return pagination.setData(iPage.getRecords(), page.getTotal()); + } + + @Override + public void create(int insertCount) throws WorkFlowException { + Integer code = this.baseMapper.maxCode(); + if (code == null) { + code = 0; + } + int index = code == 0 ? 10000001 : code; + if (index > 11500001) { + throw new WorkFlowException(MsgCode.ETD113.get()); + } + try { + @Cleanup Connection conn = ConnUtil.getConnOrDefault(dataSourceUtils); + @Cleanup PreparedStatement pstm = null; + String sql = ""; + String tenantColumn = TenantDataSourceUtil.getTenantColumn(); + DbLinkEntity dbLinkEntity = dbLinkService.getResource("0"); + if (DbTypeUtil.checkOracle(dbLinkEntity)||DbTypeUtil.checkDM(dbLinkEntity)) { + sql = "INSERT INTO ext_big_data(F_ID,F_EN_CODE,F_FULL_NAME,F_CREATOR_TIME{column}) VALUES (?,?,?,to_date(?,'yyyy-mm-dd hh24:mi:ss'){value})"; + } else { + sql = "INSERT INTO ext_big_data(F_ID,F_EN_CODE,F_FULL_NAME,F_CREATOR_TIME{column}) VALUES (?,?,?,?{value})"; + } + sql = sql.replaceAll("\\{column}", "," + configValueUtil.getMultiTenantColumn()); + sql = sql.replaceAll("\\{value}", ",?"); + pstm = conn.prepareStatement(sql); + conn.setAutoCommit(false); + if (DbTypeUtil.checkPostgre(dbLinkEntity)) { + for (int i = 0; i < insertCount; i++) { + pstm.setString(1, RandomUtil.uuId()); + pstm.setInt(2, index); + pstm.setString(3, "测试大数据" + index); + pstm.setTimestamp(4, new Timestamp(System.currentTimeMillis())); + if (StringUtil.isNotEmpty(tenantColumn)) { + pstm.setString(5, tenantColumn); + } + pstm.addBatch(); + index++; + } + } else { + for (int i = 0; i < insertCount; i++) { + pstm.setString(1, RandomUtil.uuId()); + pstm.setInt(2, index); + pstm.setString(3, "测试大数据" + index); + pstm.setString(4, DateUtil.getNow()); +// pstm.setString(4, DateUtil.daFormatHHMMSSAddEight(System.currentTimeMillis())); + if (StringUtil.isNotEmpty(tenantColumn)) { + pstm.setString(5, tenantColumn); + } + pstm.addBatch(); + index++; + } + } + pstm.executeBatch(); + conn.commit(); + pstm.close(); + conn.close(); + } catch (Exception e) { + log.error(e.getMessage()); + } + } +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/CustomerServiceImpl.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/CustomerServiceImpl.java new file mode 100644 index 0000000..201fb42 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/CustomerServiceImpl.java @@ -0,0 +1,79 @@ +package com.yunzhupaas.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.entity.CustomerEntity; +import com.yunzhupaas.mapper.CustomerMapper; +import com.yunzhupaas.service.CustomerService; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * 客户信息 + * 版本: V3.1.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2021-07-10 14:09:05 + */ +@Service + +public class CustomerServiceImpl extends SuperServiceImpl implements CustomerService { + + + + @Override + public List getList(Pagination pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + queryWrapper.lambda().and( + t->t.like(CustomerEntity::getAddress, pagination.getKeyword()) + .or().like(CustomerEntity::getName, pagination.getKeyword()) + .or().like(CustomerEntity::getCode, pagination.getKeyword()) + ); + } + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage userIPage = this.page(page, queryWrapper); + return pagination.setData(userIPage.getRecords(), userIPage.getTotal()); + } + + @Override + public CustomerEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(CustomerEntity::getId, id); + return this.getOne(queryWrapper); + + } + + @Override + public void create(CustomerEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + entity.setCreatorTime(new Date()); + this.save(entity); + } + + @Override + public boolean update(String id, CustomerEntity entity) { + entity.setId(id); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + entity.setLastModifyTime(new Date()); + return this.updateById(entity); + } + + @Override + public void delete(CustomerEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/DocumentLogServiceImpl.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/DocumentLogServiceImpl.java new file mode 100644 index 0000000..e7c39b7 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/DocumentLogServiceImpl.java @@ -0,0 +1,12 @@ +package com.yunzhupaas.service.impl; + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.entity.DocumentLogEntity; +import com.yunzhupaas.mapper.DocumentLogMapper; +import com.yunzhupaas.service.DocumentLogService; +import org.springframework.stereotype.Service; + +@Service +public class DocumentLogServiceImpl extends SuperServiceImpl implements DocumentLogService { +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/DocumentServiceImpl.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/DocumentServiceImpl.java new file mode 100644 index 0000000..591c1a3 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/DocumentServiceImpl.java @@ -0,0 +1,443 @@ +package com.yunzhupaas.service.impl; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.date.DateTime; +import cn.hutool.core.date.DateUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.entity.DocumentEntity; +import com.yunzhupaas.entity.DocumentLogEntity; +import com.yunzhupaas.entity.DocumentShareEntity; +import com.yunzhupaas.mapper.DocumentMapper; +import com.yunzhupaas.model.document.DocumentShareForm; +import com.yunzhupaas.model.document.DocumentTrashListVO; +import com.yunzhupaas.model.document.FlowFileModel; +import com.yunzhupaas.service.DocumentLogService; +import com.yunzhupaas.service.DocumentService; +import com.yunzhupaas.service.DocumentShareService; +import com.yunzhupaas.util.FileUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 知识文档 + * + * @author 云筑产品开发平台组 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +@Service +public class DocumentServiceImpl extends SuperServiceImpl implements DocumentService { + + + @Autowired + private DocumentShareService documentShareService; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private DocumentLogService documentLogService; + + @Override + public List getFolderList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .eq(DocumentEntity::getCreatorUserId, UserProvider.getUser().getUserId()) + .eq(DocumentEntity::getType, 0) + .eq(DocumentEntity::getEnabledMark, 1) + .orderByDesc(DocumentEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getAllList(String parentId) { + return this.getChildList(parentId, false); + } + + @Override + public List getChildList(String parentId, boolean isShare) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (!isShare) { + queryWrapper.lambda().eq(DocumentEntity::getCreatorUserId, UserProvider.getUser().getUserId()); + } + queryWrapper.lambda() + .eq(DocumentEntity::getEnabledMark, 1) + .eq(DocumentEntity::getParentId, parentId) + .orderByAsc(DocumentEntity::getType) + .orderByDesc(DocumentEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getAllList(String parentId, String userId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .eq(DocumentEntity::getEnabledMark, 1) + .eq(DocumentEntity::getParentId, parentId) + .eq(DocumentEntity::getCreatorUserId, userId) + .orderByAsc(DocumentEntity::getType) + .orderByDesc(DocumentEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getSearchAllList(String keyword) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(keyword)) { + queryWrapper.lambda().like(DocumentEntity::getFullName, keyword); + queryWrapper.lambda().eq(DocumentEntity::getType, 1); + } + queryWrapper.lambda() + .eq(DocumentEntity::getCreatorUserId, UserProvider.getUser().getUserId()) + .eq(DocumentEntity::getEnabledMark, 1) + .orderByAsc(DocumentEntity::getType) + .orderByDesc(DocumentEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getTrashList(String keyword) { + MPJLambdaWrapper wrapper = new MPJLambdaWrapper<>(DocumentLogEntity.class) + .leftJoin(DocumentEntity.class, DocumentEntity::getId, DocumentLogEntity::getDocumentId) + .select(DocumentLogEntity::getId, DocumentLogEntity::getDocumentId) + .select(DocumentEntity::getFullName, DocumentEntity::getDeleteTime, DocumentEntity::getFileSize, + DocumentEntity::getType, DocumentEntity::getFileExtension); + if (StringUtil.isNotEmpty(keyword)) { + wrapper.like(DocumentEntity::getFullName, keyword); +// wrapper.eq(DocumentEntity::getType, 1); + } + wrapper.eq(DocumentLogEntity::getCreatorUserId, UserProvider.getUser().getUserId()); + wrapper.orderByAsc(DocumentEntity::getType).orderByDesc(DocumentLogEntity::getCreatorTime); + List list = documentLogService.selectJoinList(DocumentTrashListVO.class, wrapper); + return list; + } + + @Override + public List getShareOutList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .eq(DocumentEntity::getCreatorUserId, UserProvider.getUser().getUserId()) + .eq(DocumentEntity::getEnabledMark, 1) + .gt(DocumentEntity::getIsShare, 0) + .orderByAsc(DocumentEntity::getType) + .orderByDesc(DocumentEntity::getShareTime); + return this.list(queryWrapper); + } + + @Override + public List getShareTomeList() { + String userId = UserProvider.getUser().getUserId(); + QueryWrapper shareWrapper = new QueryWrapper<>(); + shareWrapper.lambda().eq(DocumentShareEntity::getShareUserId, userId); + return documentShareService.list(shareWrapper); + } + + @Override + public List getInfoByIds(List ids) { + if (CollectionUtils.isNotEmpty(ids)) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(DocumentEntity::getId, ids); + queryWrapper.lambda().eq(DocumentEntity::getEnabledMark, 1); + queryWrapper.lambda().orderByAsc(DocumentEntity::getType) + .orderByDesc(DocumentEntity::getCreatorTime); + return this.list(queryWrapper); + } + return new ArrayList<>(); + } + + @Override + public List getShareUserList(String documentId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DocumentShareEntity::getDocumentId, documentId); + return documentShareService.list(queryWrapper); + } + + @Override + public DocumentEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DocumentEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void delete(DocumentEntity entity) { + entity.setDeleteTime(new Date()); + entity.setDeleteUserId(UserProvider.getUser().getUserId()); + entity.setEnabledMark(0); + this.updateById(entity); + + } + + @Override + public void create(DocumentEntity entity) { + entity.setId(RandomUtil.uuId()); + if (StringUtil.isBlank(entity.getCreatorUserId())) { + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + } + entity.setEnabledMark(1); + this.save(entity); + } + + @Override + public boolean update(String id, DocumentEntity entity) { + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + return this.updateById(entity); + } + + @Override + @Transactional + public void sharecreate(DocumentShareForm documentShareForm) { + List ids = documentShareForm.getIds(); + List userIds = documentShareForm.getUserIds(); + String creatorUserId = documentShareForm.getCreatorUserId(); + if (CollectionUtils.isEmpty(ids) || CollectionUtils.isEmpty(userIds)) { + return; + } + for (String docId : ids) { + DocumentEntity entity = this.getInfo(docId); + if (entity != null) { + //共享当前文件或者文件夹(文件夹内部文件可以直接查询) + int n = (entity.getIsShare() == null ? 0 : entity.getIsShare()) + userIds.size(); + entity.setIsShare(n); + entity.setShareTime(new Date()); + this.updateById(entity); + for (String userId : userIds) { + DocumentShareEntity one = documentShareService.getByDocIdAndShareUserId(docId, userId); + if (one != null) { + one.setShareTime(new Date()); + documentShareService.updateById(one); + continue; + } + DocumentShareEntity documentShare = new DocumentShareEntity(); + documentShare.setId(RandomUtil.uuId()); + documentShare.setDocumentId(docId); + documentShare.setShareUserId(userId); + documentShare.setShareTime(new Date()); + documentShare.setCreatorUserId(creatorUserId); + documentShareService.save(documentShare); + } + } + } + } + + @Override + @Transactional + public void shareCancel(List documentIds) { + for (String documentId : documentIds) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DocumentEntity::getId, documentId); + DocumentEntity entity = this.getOne(queryWrapper); + if (entity != null) { + entity.setIsShare(0); + entity.setShareTime(new Date()); + this.updateById(entity); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(DocumentShareEntity::getDocumentId, documentId); + documentShareService.remove(wrapper); + } + } + } + + @Override + @Transactional + public void shareAdjustment(String id, List userIds) { + DocumentEntity entity = this.getInfo(id); + if (entity != null) { + entity.setIsShare(userIds.size()); + entity.setShareTime(new Date()); + this.updateById(entity); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(DocumentShareEntity::getDocumentId, entity.getId()); + documentShareService.remove(wrapper); + for (String userId : userIds) { + DocumentShareEntity documentShare = new DocumentShareEntity(); + documentShare.setId(RandomUtil.uuId()); + documentShare.setDocumentId(id); + documentShare.setShareUserId(userId); + documentShare.setShareTime(new Date()); + documentShareService.save(documentShare); + } + } + } + + @Override + @Transactional + public void trashdelete(List folderIds) { + List pathList = new ArrayList<>(); + for (String logId : folderIds) { + DocumentLogEntity logEntity = documentLogService.getById(logId); + DocumentEntity entity = this.getInfo(logEntity.getDocumentId()); + if (entity != null) { + if (Objects.equals(entity.getType(), 0)) { + String childDocument = logEntity.getChildDocument(); + String[] allFile = childDocument.split(","); + for (String item : allFile) { + this.removeById(item); + } + } else { + this.removeById(logEntity.getDocumentId()); + } + pathList.add(configValueUtil.getDocumentFilePath() + entity.getFilePath()); + } + documentLogService.removeById(logEntity); + } + //先移除数据再移除文件,以便回滚(移除文件夹里面的文件也会删除所以不用递归) + for (String path : pathList) { + FileUtil.deleteFile(path); + } + } + + @Override + @Transactional + public void trashRecoveryConstainSrc(List ids) { + for (String logId : ids) { + DocumentLogEntity logEntity = documentLogService.getById(logId); + if (logEntity == null) { + continue; + } + DocumentEntity entity = this.getInfo(logEntity.getDocumentId()); + if (entity != null) { + if (!"0".equals(entity.getParentId())) { + //查询父级菜单是否存在,如果存在还原到原菜单里,如果不存在则放在最外层 + DocumentEntity parentInfo = this.getInfo(entity.getParentId()); + if (parentInfo == null || Objects.equals(parentInfo.getEnabledMark(), 0)) { + this.trashRecovery(entity.getId(), true); + } else { + this.trashRecovery(entity.getId(), false); + } + } else { + this.trashRecovery(entity.getId(), false); + } + String childDocument = logEntity.getChildDocument(); + List childList = Arrays.asList(childDocument.split(",")).stream().filter(t -> !t.equals(entity.getId())).collect(Collectors.toList()); + //还原文件夹内的所有文件。 + for (String item : childList) { + this.trashRecovery(item, false); + } + } + documentLogService.removeById(logEntity); + } + } + + @Override + public boolean trashRecovery(String id, boolean initParent) { + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + if (initParent) { + updateWrapper.lambda().set(DocumentEntity::getParentId, "0"); + } + updateWrapper.lambda().set(DocumentEntity::getEnabledMark, 1); + updateWrapper.lambda().set(DocumentEntity::getDeleteTime, null); + updateWrapper.lambda().set(DocumentEntity::getDeleteUserId, null); + updateWrapper.lambda().eq(DocumentEntity::getId, id); + return this.update(updateWrapper); + } + + @Override + public boolean moveTo(String id, String toId) { + DocumentEntity entity = this.getInfo(id); + if (entity != null) { + entity.setParentId(toId); + this.updateById(entity); + return true; + } + return false; + } + + @Override + public boolean isExistByFullName(String fullName, String id, String parentId) { + String userId = UserProvider.getUser().getUserId(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DocumentEntity::getFullName, fullName).eq(DocumentEntity::getEnabledMark, 1).eq(DocumentEntity::getCreatorUserId, userId); + queryWrapper.lambda().eq(DocumentEntity::getParentId, parentId); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(DocumentEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public void getChildSrcList(String pId, List list, Integer enabledMark) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (enabledMark != null) { + queryWrapper.lambda().eq(DocumentEntity::getEnabledMark, enabledMark); + } + queryWrapper.lambda() + .eq(DocumentEntity::getParentId, pId) + .orderByAsc(DocumentEntity::getType) + .orderByDesc(DocumentEntity::getCreatorTime); + List allList = this.list(queryWrapper); + if (CollectionUtils.isNotEmpty(allList)) { + list.addAll(allList); + for (DocumentEntity doc : allList) { + this.getChildSrcList(doc.getId(), list, enabledMark); + } + } + } + + @Override + public DocumentShareEntity getShareByParentId(String parentId) { + DocumentShareEntity one = documentShareService.getByDocIdAndShareUserId(parentId, UserProvider.getUser().getUserId()); + if (one != null) { + return one; + } else { + DocumentEntity entity = this.getById(parentId); + if (entity != null && StringUtil.isNotEmpty(entity.getParentId())) { + return this.getShareByParentId(entity.getParentId()); + } + } + return null; + } + + @Override + public List> getFlowFile(FlowFileModel model) { + String userId = model.getUserId(); + String templateId = model.getTemplateId(); + + QueryWrapper shareWrapper = new QueryWrapper<>(); + shareWrapper.lambda().eq(DocumentShareEntity::getShareUserId, userId); + List shareList = documentShareService.list(shareWrapper); + List docIds = new ArrayList<>(); + if (CollectionUtil.isNotEmpty(shareList)) { + docIds = shareList.stream().map(DocumentShareEntity::getDocumentId).collect(Collectors.toList()); + } + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(DocumentEntity::getEnabledMark, 1).like(DocumentEntity::getDescription, templateId); + List finalDocIds = docIds; + wrapper.lambda().and(t -> { + t.eq(DocumentEntity::getCreatorUserId, userId); + if (!finalDocIds.isEmpty()) { + t.or(e -> e.in(DocumentEntity::getId, finalDocIds)); + } + }); + + wrapper.lambda().orderByDesc(DocumentEntity::getCreatorTime); + Page page = this.page(new Page<>(1,5), wrapper); + List documentList = page.getRecords(); + List> list = new ArrayList<>(); + if (!documentList.isEmpty()) { + for (DocumentEntity document : documentList) { + Map map = new HashMap<>(); + map.put("id", document.getId()); + map.put("fileName", document.getFullName()); + map.put("fileDate", document.getCreatorTime()); + map.put("uploaderUrl", document.getUploaderUrl()); + list.add(map); + } + } + return list; + } +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/DocumentShareServiceImpl.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/DocumentShareServiceImpl.java new file mode 100644 index 0000000..e26cd10 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/DocumentShareServiceImpl.java @@ -0,0 +1,34 @@ +package com.yunzhupaas.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.entity.DocumentShareEntity; +import com.yunzhupaas.mapper.DocumentShareMapper; +import com.yunzhupaas.service.DocumentShareService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 邮件配置 + * + * @author 云筑产品开发平台组 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +@Service +public class DocumentShareServiceImpl extends SuperServiceImpl implements DocumentShareService { + + @Override + public DocumentShareEntity getByDocIdAndShareUserId(String docId, String shareUserId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DocumentShareEntity::getDocumentId, docId); + queryWrapper.lambda().eq(DocumentShareEntity::getShareUserId, shareUserId); + List list = list(queryWrapper); + if (list != null && list.size() > 0) { + return list.get(0); + } + return null; + } +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/EmailConfigServiceImpl.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/EmailConfigServiceImpl.java new file mode 100644 index 0000000..9659681 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/EmailConfigServiceImpl.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.service.impl; + +import com.yunzhupaas.base.entity.EmailConfigEntity; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.mapper.EmailConfigMapper; +import com.yunzhupaas.service.EmailConfigService; +import org.springframework.stereotype.Service; + + +/** + * 邮件配置 + * + * @copyright 深圳市乐程软件有限公司 + * @author 云筑产品开发平台组 + * @date 2024-09-26 上午9:18 + */ +@Service +public class EmailConfigServiceImpl extends SuperServiceImpl implements EmailConfigService { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/EmailReceiveServiceImpl.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/EmailReceiveServiceImpl.java new file mode 100644 index 0000000..e20fb56 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/EmailReceiveServiceImpl.java @@ -0,0 +1,413 @@ +package com.yunzhupaas.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yunzhupaas.base.PaginationTime; +import com.yunzhupaas.base.entity.EmailConfigEntity; +import com.yunzhupaas.base.model.MailAccount; +import com.yunzhupaas.base.model.MailFile; +import com.yunzhupaas.base.model.MailModel; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.base.util.Pop3Util; +import com.yunzhupaas.base.util.SmtpUtil; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.FileTypeConstant; +import com.yunzhupaas.base.entity.EmailReceiveEntity; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.entity.EmailSendEntity; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.mapper.EmailReceiveMapper; +import com.yunzhupaas.service.EmailConfigService; +import com.yunzhupaas.service.EmailReceiveService; +import com.yunzhupaas.service.EmailSendService; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.type.StringNumber; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 邮件接收 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +@Slf4j +@Service +public class EmailReceiveServiceImpl extends SuperServiceImpl implements EmailReceiveService { + + + @Autowired + private EmailSendService emailSendService; + @Autowired + private EmailConfigService emailConfigService; + @Autowired + private Pop3Util pop3Util; + @Autowired + private ConfigValueUtil configValueUtil; + + @Override + public List getReceiveList(PaginationTime paginationTime) { + String userId = UserProvider.getUser().getUserId(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(EmailReceiveEntity::getCreatorUserId, userId); + //日期范围(近7天、近1月、近3月、自定义) + if (ObjectUtil.isNotEmpty(paginationTime.getStartTime()) && ObjectUtil.isNotEmpty(paginationTime.getEndTime())) { + queryWrapper.lambda().between(EmailReceiveEntity::getFdate, new Date(paginationTime.getStartTime()), new Date(paginationTime.getEndTime())); + } + //关键字(用户、IP地址、功能名称) + String keyWord = paginationTime.getKeyword() != null ? paginationTime.getKeyword() : null; + //关键字(发件人、主题) + if (!StringUtils.isEmpty(keyWord)) { + String word = keyWord; + queryWrapper.lambda().and( + t -> t.like(EmailReceiveEntity::getSender, word) + .or().like(EmailReceiveEntity::getSubject, word) + ); + } + //排序 + if (StringUtils.isEmpty(paginationTime.getSidx())) { + queryWrapper.lambda().orderByDesc(EmailReceiveEntity::getFdate); + } else { + queryWrapper = "asc".equals(paginationTime.getSort().toLowerCase()) ? queryWrapper.orderByAsc(paginationTime.getSidx()) : queryWrapper.orderByDesc(paginationTime.getSidx()); + } + Page page = new Page<>(paginationTime.getCurrentPage(), paginationTime.getPageSize()); + IPage userIPage = this.page(page, queryWrapper); + return paginationTime.setData(userIPage.getRecords(), page.getTotal()); + } + + @Override + public List getReceiveList() { + String userId = UserProvider.getUser().getUserId(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(EmailReceiveEntity::getCreatorUserId, userId).eq(EmailReceiveEntity::getIsRead,0).orderByDesc(EmailReceiveEntity::getCreatorTime); + return this.baseMapper.selectList(queryWrapper); + } + + @Override + public List getDashboardReceiveList() { + String userId = UserProvider.getUser().getUserId(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(EmailReceiveEntity::getCreatorUserId, userId).eq(EmailReceiveEntity::getIsRead,0).orderByDesc(EmailReceiveEntity::getCreatorTime); + Page page = new Page<>(1, 20); + IPage iPage = this.page(page, queryWrapper); + return iPage.getRecords(); + } + + @Override + public List getStarredList(PaginationTime paginationTime) { + String userId = UserProvider.getUser().getUserId(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(EmailReceiveEntity::getCreatorUserId, userId).eq(EmailReceiveEntity::getStarred, 1); + //日期范围(近7天、近1月、近3月、自定义) + if (ObjectUtil.isNotEmpty(paginationTime.getStartTime()) && ObjectUtil.isNotEmpty(paginationTime.getEndTime())) { + queryWrapper.lambda().between(EmailReceiveEntity::getCreatorTime, new Date(paginationTime.getStartTime()), new Date(paginationTime.getEndTime())); + } + //关键字(用户、IP地址、功能名称) + String keyWord = paginationTime.getKeyword() != null ? paginationTime.getKeyword() : null; + //关键字(发件人、主题) + if (!StringUtils.isEmpty(keyWord)) { + String word = keyWord; + queryWrapper.lambda().and( + t -> t.like(EmailReceiveEntity::getSender, word) + .or().like(EmailReceiveEntity::getSubject, word) + ); + } + //排序 + if (StringUtils.isEmpty(paginationTime.getSidx())) { + queryWrapper.lambda().orderByDesc(EmailReceiveEntity::getCreatorTime); + } else { + queryWrapper = "asc".equals(paginationTime.getSort().toLowerCase()) ? queryWrapper.orderByAsc(paginationTime.getSidx()) : queryWrapper.orderByDesc(paginationTime.getSidx()); + } + Page page = new Page<>(paginationTime.getCurrentPage(), paginationTime.getPageSize()); + IPage userIPage = this.page(page, queryWrapper); + return paginationTime.setData(userIPage.getRecords(), page.getTotal()); + } + + @Override + public List getDraftList(PaginationTime paginationTime) { + String userId = UserProvider.getUser().getUserId(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(EmailSendEntity::getCreatorUserId, userId).eq(EmailSendEntity::getState, -1); + //日期范围(近7天、近1月、近3月、自定义) + if (!ObjectUtil.isEmpty(paginationTime.getStartTime()) && !ObjectUtil.isEmpty(paginationTime.getEndTime())) { + queryWrapper.lambda().between(EmailSendEntity::getCreatorTime, new Date(paginationTime.getStartTime()), new Date(paginationTime.getEndTime())); + } + //关键字(用户、IP地址、功能名称) + String keyWord = paginationTime.getKeyword() != null ? paginationTime.getKeyword() : null; + //关键字(发件人、主题) + if (!StringUtils.isEmpty(keyWord)) { + String word = keyWord; + queryWrapper.lambda().and( + t -> t.like(EmailSendEntity::getSender, word) + .or().like(EmailSendEntity::getSubject, word) + ); + } + //排序 + if (StringUtils.isEmpty(paginationTime.getSidx())) { + queryWrapper.lambda().orderByDesc(EmailSendEntity::getCreatorTime); + } else { + queryWrapper = "asc".equals(paginationTime.getSort().toLowerCase()) ? queryWrapper.orderByAsc(paginationTime.getSidx()) : queryWrapper.orderByDesc(paginationTime.getSidx()); + } + Page page = new Page<>(paginationTime.getCurrentPage(), paginationTime.getPageSize()); + IPage userIPage = emailSendService.page(page, queryWrapper); + return paginationTime.setData(userIPage.getRecords(), page.getTotal()); + } + + @Override + public List getSentList(PaginationTime paginationTime) { + String userId = UserProvider.getUser().getUserId(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(EmailSendEntity::getCreatorUserId, userId).ne(EmailSendEntity::getState, -1); + //日期范围(近7天、近1月、近3月、自定义) + if (ObjectUtil.isNotEmpty(paginationTime.getStartTime()) && ObjectUtil.isNotEmpty(paginationTime.getEndTime())) { + queryWrapper.lambda().between(EmailSendEntity::getCreatorTime, new Date(paginationTime.getStartTime()), new Date(paginationTime.getEndTime())); + } + //关键字(用户、IP地址、功能名称) + String keyWord = paginationTime.getKeyword() != null ? String.valueOf(paginationTime.getKeyword()) : null; + //关键字(发件人、主题) + if (!StringUtils.isEmpty(keyWord)) { + String word = keyWord; + queryWrapper.lambda().and( + t -> t.like(EmailSendEntity::getSender, word) + .or().like(EmailSendEntity::getSubject, word) + ); + } + //排序 + String sort = paginationTime.getSort() != null ? paginationTime.getSort() : null; + if (!StringUtils.isEmpty(sort)) { + queryWrapper.lambda().orderByDesc(EmailSendEntity::getCreatorTime); + } + Page page = new Page<>(paginationTime.getCurrentPage(), paginationTime.getPageSize()); + IPage userIPage = emailSendService.page(page, queryWrapper); + return paginationTime.setData(userIPage.getRecords(), page.getTotal()); + } + + @Override + public EmailConfigEntity getConfigInfo() { + String userId = UserProvider.getUser().getUserId(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(EmailConfigEntity::getCreatorUserId, userId); + return emailConfigService.getOne(queryWrapper); + } + + @Override + public EmailConfigEntity getConfigInfo(String userId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(EmailConfigEntity::getCreatorUserId, userId); + return emailConfigService.getOne(queryWrapper); + } + + @Override + public Object getInfo(String id) { + EmailReceiveEntity receiveInfo = this.getById(id); + Object object; + if (receiveInfo != null) { + //解析内容 + receiveInfo.setBodyText(receiveInfo.getBodyText()); + //更新已读 + receiveInfo.setIsRead(1); + receiveInfo.setLastModifyTime(new Date()); + receiveInfo.setLastModifyUserId(UserProvider.getUser().getUserId()); + this.updateById(receiveInfo); + object = receiveInfo; + } else { + EmailSendEntity sendInfo = emailSendService.getById(id); + object = sendInfo; + } + return object; + } + + @Override + public boolean delete(String id) { + Object object = getInfo(id); + if (object != null && object instanceof EmailReceiveEntity) { + //删除邮件 + EmailConfigEntity mailConfig = getConfigInfo(); + EmailReceiveEntity mailReceiveEntity = (EmailReceiveEntity) object; + MailAccount mailAccount = new MailAccount(); + mailAccount.setAccount(mailConfig.getAccount()); + mailAccount.setPassword(mailConfig.getPassword()); + mailAccount.setPop3Port(mailConfig.getPop3Port()); + mailAccount.setPop3Host(mailConfig.getPop3Host()); + pop3Util.deleteMessage(mailAccount, mailReceiveEntity.getMID()); + this.removeById(mailReceiveEntity.getId()); + return true; + } else if (object != null) { + //删除数据 + EmailSendEntity entity = (EmailSendEntity) object; + emailSendService.removeById(entity.getId()); + return true; + } + return false; + } + + @Override + @Transactional + public void saveDraft(EmailSendEntity entity) { + entity.setState(-1); + if (StringUtil.isNotEmpty(entity.getId())) { + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + emailSendService.updateById(entity); + } else { + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + emailSendService.save(entity); + } + } + + @Override + public boolean receiveRead(String id, int isRead) { + EmailReceiveEntity entity = (EmailReceiveEntity) getInfo(id); + if (entity != null) { + entity.setIsRead(isRead); + return this.updateById(entity); + } + return false; + } + + @Override + public boolean receiveStarred(String id, int isStarred) { + EmailReceiveEntity entity = (EmailReceiveEntity) getInfo(id); + if (entity != null) { + entity.setStarred(isStarred); + return this.updateById(entity); + } + return false; + } + + @Override + public void saveConfig(EmailConfigEntity configEntity) throws DataException { + EmailConfigEntity emailConfigEntity=getConfigInfo(UserProvider.getUser().getUserId()); + if (emailConfigEntity == null && UserProvider.getUser().getUserId() != null) { + configEntity.setId(RandomUtil.uuId()); + configEntity.setCreatorTime(new Date()); + configEntity.setCreatorUserId(UserProvider.getUser().getUserId()); + emailConfigService.save(configEntity); + } else if (UserProvider.getUser().getUserId() != null) { + configEntity.setId(emailConfigEntity.getId()); + emailConfigService.updateById(configEntity); + } else { + throw new DataException(MsgCode.ETD114.get()); + } + } + + @Override + @Transactional + public int saveSent(EmailSendEntity entity, EmailConfigEntity mailConfig) { + int flag = 1; + //拷贝文件,注意:从临时文件夹拷贝到邮件文件夹 + List attachmentList = JsonUtil.getJsonToList(entity.getAttachment(), MailFile.class); + //邮件路径 + String mailFilePath = configValueUtil.getEmailFilePath(); + try { + //写入数据 + //发送邮件 + //邮件发送信息 + MailModel mailModel = new MailModel(); + mailModel.setFrom(entity.getSender()); + mailModel.setRecipient(entity.getRecipient()); + mailModel.setCc(entity.getCc()); + mailModel.setBcc(entity.getBcc()); + mailModel.setSubject(entity.getSubject()); + mailModel.setBodyText(entity.getBodyText()); + mailModel.setAttachment(attachmentList); + mailModel.setFromName(mailConfig.getSenderName()); + //账号验证信息 + MailAccount mailAccount = new MailAccount(); + mailAccount.setAccount(mailConfig.getAccount()); + mailAccount.setPassword(mailConfig.getPassword()); + mailAccount.setPop3Host(mailConfig.getPop3Host()); + mailAccount.setPop3Port(mailConfig.getPop3Port()); + mailAccount.setSmtpHost(mailConfig.getSmtpHost()); + mailAccount.setSmtpPort(mailConfig.getSmtpPort()); + mailAccount.setSsl(mailConfig.getEmailSsl() == 1 ? true : false); + mailAccount.setAccountName(mailConfig.getSenderName()); + SmtpUtil smtpUtil = new SmtpUtil(mailAccount); + smtpUtil.sendMail(null, mailFilePath, mailModel); + flag = 0; + //插入数据库 + if (entity.getId() != null) { + entity.setState(1); + emailSendService.updateById(entity); + } else { + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + if (mailConfig.getAccount() != null) { + entity.setSender(mailConfig.getAccount()); + } + entity.setState(1); + emailSendService.save(entity); + } + } catch (Exception e) { + for (MailFile mailFile : attachmentList) { + FileUtil.deleteFile(mailFilePath + mailFile.getFileId()); + } + log.error(e.getMessage()); + } + return flag; + } + + @Override + @Transactional + public int receive(EmailConfigEntity mailConfig) { + //账号验证信息 + MailAccount mailAccount = new MailAccount(); + mailAccount.setAccount(mailConfig.getAccount()); + mailAccount.setPassword(mailConfig.getPassword()); + mailAccount.setPop3Host(mailConfig.getPop3Host()); + mailAccount.setPop3Port(mailConfig.getPop3Port()); + mailAccount.setSmtpHost(mailConfig.getSmtpHost()); + mailAccount.setSmtpPort(mailConfig.getSmtpPort()); + if (StringNumber.ONE.equals(mailConfig.getEmailSsl().toString())) { + mailAccount.setSsl(true); + } else { + mailAccount.setSsl(false); + } + Map map = pop3Util.popMail(mailAccount); + int receiveCount = 0; + if (map.get("receiveCount") != null) { + receiveCount = (int) map.get("receiveCount"); + } + List mailList = new ArrayList<>(); + if (map.get("mailList") != null) { + mailList = (List) map.get("mailList"); + } + if (mailList.size() > 0) { + List mids = mailList.stream().map(u -> u.getMID()).collect(Collectors.toList()); + //查询数据库状态 + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().in(EmailReceiveEntity::getMID, mids); + List emails = this.list(wrapper); + this.remove(wrapper); + //邮件赋值状态 + for (int i = 0; i < mailList.size(); i++) { + EmailReceiveEntity entity = mailList.get(i); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + //通过数据库进行赋值,没有就默认0 + int stat = emails.stream().filter(m -> m.getMID().equals(entity.getMID())).findFirst().isPresent() ? emails.stream().filter(m -> m.getMID().equals(entity.getMID())).findFirst().get().getIsRead() : 0; + long count = emails.stream().filter(m -> m.getMID().equals(entity.getMID())).count(); + entity.setIsRead(stat); + if (count != 0) { + receiveCount--; + } + this.save(entity); + } + } + return receiveCount; + } +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/EmailSendServiceImpl.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/EmailSendServiceImpl.java new file mode 100644 index 0000000..32fe23c --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/EmailSendServiceImpl.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.service.impl; + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.entity.EmailSendEntity; +import com.yunzhupaas.mapper.EmailSendMapper; +import com.yunzhupaas.service.EmailSendService; +import org.springframework.stereotype.Service; + + +/** + * 邮件发送 + * + * @copyright 深圳市乐程软件有限公司 + * @author 云筑产品开发平台组 + * @date 2024-09-26 上午9:18 + */ +@Service +public class EmailSendServiceImpl extends SuperServiceImpl implements EmailSendService { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/EmployeeServiceImpl.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/EmployeeServiceImpl.java new file mode 100644 index 0000000..7d2b126 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/EmployeeServiceImpl.java @@ -0,0 +1,305 @@ +package com.yunzhupaas.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.lowagie.text.Document; +import com.lowagie.text.Element; +import com.lowagie.text.Font; +import com.lowagie.text.Phrase; +import com.lowagie.text.pdf.BaseFont; +import com.lowagie.text.pdf.PdfPCell; +import com.lowagie.text.pdf.PdfPTable; +import com.lowagie.text.pdf.PdfWriter; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.entity.EmployeeEntity; +import com.yunzhupaas.mapper.EmployeeMapper; +import com.yunzhupaas.model.EmployeeModel; +import com.yunzhupaas.model.employee.EmployeeImportVO; +import com.yunzhupaas.model.employee.PaginationEmployee; +import com.yunzhupaas.service.EmployeeService; +import com.yunzhupaas.util.*; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import java.io.FileOutputStream; +import java.util.*; + +/** + * 职员信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Slf4j +@Service +public class EmployeeServiceImpl extends SuperServiceImpl implements EmployeeService { + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().orderByDesc(EmployeeEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getList(PaginationEmployee paginationEmployee) { +// Map queryParam = OptimizeUtil.queryParam(pagination); + QueryWrapper queryWrapper = new QueryWrapper<>(); + //查询条件 + String propertyName = paginationEmployee.getCondition() != null ? paginationEmployee.getCondition() : null; + + String propertyValue = paginationEmployee.getKeyword() != null ? paginationEmployee.getKeyword() : null; + if (!StringUtils.isEmpty(propertyName) && !StringUtils.isEmpty(propertyValue)) { + switch (propertyName) { + //工号 + case "EnCode": + queryWrapper.lambda().like(EmployeeEntity::getEnCode, propertyValue); + break; + //姓名 + case "FullName": + queryWrapper.lambda().like(EmployeeEntity::getFullName, propertyValue); + break; + //电话 + case "Telephone": + queryWrapper.lambda().like(EmployeeEntity::getTelephone, propertyValue); + break; + //部门 + case "DepartmentName": + queryWrapper.lambda().like(EmployeeEntity::getDepartmentName, propertyValue); + break; + //岗位 + case "PositionName": + queryWrapper.lambda().like(EmployeeEntity::getPositionName, propertyValue); + break; + default: + break; + } + } + //排序 + if (StringUtils.isEmpty(paginationEmployee.getSidx())) { + queryWrapper.lambda().orderByDesc(EmployeeEntity::getCreatorTime); + } else { + queryWrapper = "asc".equals(paginationEmployee.getSort().toLowerCase()) ? queryWrapper.orderByAsc(paginationEmployee.getSidx()) : queryWrapper.orderByDesc(paginationEmployee.getSidx()); + } + Page page = new Page(paginationEmployee.getCurrentPage(), paginationEmployee.getPageSize()); + IPage userIPage = this.page(page, queryWrapper); + return paginationEmployee.setData(userIPage.getRecords(), page.getTotal()); + } + + @Override + public EmployeeEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(EmployeeEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void delete(EmployeeEntity entity) { + this.removeById(entity.getId()); + } + + @Override + public void create(EmployeeEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setSortCode(RandomUtil.parses()); + entity.setCreatorUserId(UserProvider.getLoginUserId()); + this.save(entity); + } + + @Override + public void update(String id, EmployeeEntity entity) { + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(UserProvider.getLoginUserId()); + this.updateById(entity); + } + + @Override + public Map importPreview(List personList) { + List> dataRow = new ArrayList<>(); + List> columns = new ArrayList<>(); + for (int i = 0; i < personList.size(); i++) { + Map dataRowMap = new HashMap<>(); + EmployeeModel model = personList.get(i); + dataRowMap.put("enCode", model.getEnCode()); + dataRowMap.put("fullName", model.getFullName()); + dataRowMap.put("gender", model.getGender()); + dataRowMap.put("departmentName", model.getDepartmentName()); + dataRowMap.put("positionName", model.getPositionName()); + dataRowMap.put("workingNature", model.getWorkingNature()); + dataRowMap.put("idNumber", model.getIdNumber()); + dataRowMap.put("telephone", model.getTelephone()); + dataRowMap.put("attendWorkTime", model.getAttendWorkTime()); + dataRowMap.put("birthday", model.getBirthday()); + dataRowMap.put("education", model.getEducation()); + dataRowMap.put("major", model.getMajor()); + dataRowMap.put("graduationAcademy", model.getGraduationAcademy()); + dataRowMap.put("graduationTime", model.getGraduationTime()); + dataRow.add(dataRowMap); + } + for (int i = 1; i < 15; i++) { + Map columnsMap = new HashMap<>(); + columnsMap.put("AllowDBNull", true); + columnsMap.put("AutoIncrement", false); + columnsMap.put("AutoIncrementSeed", 0); + columnsMap.put("AutoIncrementStep", 1); + columnsMap.put("Caption", this.getColumns(i)); + columnsMap.put("ColumnMapping", 1); + columnsMap.put("ColumnName", this.getColumns(i)); + columnsMap.put("Container", null); + columnsMap.put("DataType", "System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"); + columnsMap.put("DateTimeMode", 3); + columnsMap.put("DefaultValue", null); + columnsMap.put("DesignMode", false); + columnsMap.put("Expression", ""); + columnsMap.put("ExtendedProperties", ""); + columnsMap.put("MaxLength", -1); + columnsMap.put("Namespace", ""); + columnsMap.put("Ordinal", 0); + columnsMap.put("Prefix", ""); + columnsMap.put("ReadOnly", false); + columnsMap.put("Site", null); + columnsMap.put("Table", personList); + columnsMap.put("Unique", false); + columns.add(columnsMap); + } + Map map = new HashMap<>(); + map.put("dataRow", dataRow); + map.put("columns", columns); + return map; + } + + @Override + public EmployeeImportVO importData(List dt) { + + for(EmployeeModel model :dt){ + model.setAttendWorkTime(DateUtil.cstFormat(model.getAttendWorkTime())); + model.setBirthday(DateUtil.cstFormat(model.getBirthday())); + model.setGraduationTime(DateUtil.cstFormat(model.getGraduationTime())); + } + List entitys = JsonUtil.getJsonToList(dt, EmployeeEntity.class); + //记录成功了几条 + int sum=0; + //记录第几条失败 + int num=0; + List errList = new ArrayList<>(); + for (EmployeeEntity entity : entitys) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(UserProvider.getLoginUserId()); + entity.setCreatorTime(new Date()); + try { + this.baseMapper.insert(entity); + sum++; + }catch (Exception e){ + errList.add(entity); + num++; + log.error("导入第"+(num+1)+"条数据失败"); + } + + } + EmployeeImportVO vo=new EmployeeImportVO(); + vo.setSnum(sum); + vo.setFnum(num); + if(vo.getFnum()>0){ + vo.setResultType(1); + vo.setFailResult(JsonUtil.getJsonToList(errList, EmployeeModel.class)); + return vo; + }else{ + vo.setResultType(0); + return vo; + } + } + + @Override + public void exportPdf(List list, String outputUrl) { + try { + Document document = new Document(); + BaseFont bfChinese = BaseFont.createFont("STSongStd-Light", "UniGB-UCS2-H", false); + Font font = new Font(bfChinese, 11, Font.NORMAL); + PdfWriter.getInstance(document, new FileOutputStream(outputUrl)); + document.open(); + PdfPTable row; + row = new PdfPTable(13); + //表占页面100%宽度 + row.setWidthPercentage(100f); + //标题 + String[] titles = {"姓名", "性别", "部门", "职位", "用工性质", "身份证号", "联系电话", "出生年月", "参加工作", "最高学历", "所学专业", "毕业院校", "毕业时间"}; + for (String title : titles) { + row.addCell(createCell(title, font)); + } + document.add(row); + //内容 + for (EmployeeEntity entity : list) { + row = new PdfPTable(13); + //表占页面100%宽度 + row.setWidthPercentage(100f); + row.addCell(createCell(entity.getFullName(), font)); + row.addCell(createCell(entity.getGender(), font)); + row.addCell(createCell(entity.getDepartmentName(), font)); + row.addCell(createCell(entity.getPositionName(), font)); + row.addCell(createCell(entity.getWorkingNature(), font)); + row.addCell(createCell(entity.getIdNumber(), font)); + row.addCell(createCell(entity.getTelephone(), font)); + row.addCell(createCell(entity.getAttendWorkTime() != null ? DateUtil.daFormat(entity.getAttendWorkTime()) : "", font)); + row.addCell(createCell(entity.getBirthday() != null ? DateUtil.daFormat(entity.getBirthday()) : "", font)); + row.addCell(createCell(entity.getEducation(), font)); + row.addCell(createCell(entity.getMajor(), font)); + row.addCell(createCell(entity.getGraduationAcademy(), font)); + row.addCell(createCell(entity.getGraduationTime() != null ? DateUtil.daFormat(entity.getGraduationTime()) : "", font)); + document.add(row); + } + document.close(); + } catch (Exception e) { + log.error(e.getMessage()); + } + } + + private PdfPCell createCell(String value, Font font) { + PdfPCell cell = new PdfPCell(); + cell.setVerticalAlignment(Element.ALIGN_CENTER); + cell.setPhrase(new Phrase(value, font)); + return cell; + } + + private String getKey(String key) { + Map map = new HashMap<>(); + map.put("工号", "F_EnCode"); + map.put("姓名", "F_FullName"); + map.put("性别", "F_Gender"); + map.put("部门", "F_DepartmentName"); + map.put("职务", "F_PositionName"); + map.put("用工性质", "F_WorkingNature"); + map.put("身份证号", "F_IDNumber"); + map.put("联系电话", "F_Telephone"); + map.put("出生年月", "F_Birthday"); + map.put("参加工作", "F_AttendWorkTime"); + map.put("最高学历", "F_Education"); + map.put("所学专业", "F_Major"); + map.put("毕业院校", "F_GraduationAcademy"); + map.put("毕业时间", "F_GraduationTime"); + return map.get(key); + } + + private String getColumns(Integer key) { + Map map = new HashMap<>(); + map.put(1, "工号"); + map.put(2, "姓名"); + map.put(3, "性别"); + map.put(4, "部门"); + map.put(5, "职务"); + map.put(6, "用工性质"); + map.put(7, "身份证号"); + map.put(8, "联系电话"); + map.put(9, "出生年月"); + map.put(10, "参加工作"); + map.put(11, "最高学历"); + map.put(12, "所学专业"); + map.put(13, "毕业院校"); + map.put(14, "毕业时间"); + return map.get(key); + } +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/LeaveApplyServiceImpl.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/LeaveApplyServiceImpl.java new file mode 100644 index 0000000..ee7aeac --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/LeaveApplyServiceImpl.java @@ -0,0 +1,79 @@ +package com.yunzhupaas.service.impl; + +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.service.BillRuleService; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.entity.LeaveApplyEntity; +import com.yunzhupaas.mapper.LeaveApplyMapper; +import com.yunzhupaas.model.leaveapply.LeaveApplyForm; +import com.yunzhupaas.service.LeaveApplyService; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 流程表单【请假申请】 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-29 上午9:18 + */ +@Service +public class LeaveApplyServiceImpl extends SuperServiceImpl implements LeaveApplyService { + + @Autowired + private BillRuleService billRuleService; + + @Override + public LeaveApplyEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(LeaveApplyEntity::getId, id); + return getOne(queryWrapper); + } + + @Override + @DSTransactional + public void save(String id, LeaveApplyEntity entity, LeaveApplyForm form) { + //表单信息 + if (StringUtil.isEmpty(entity.getId())) { + entity.setId(id); + save(entity); + billRuleService.useBillNumber("WF_LeaveApplyNo"); + } else { + entity.setId(id); + updateById(entity); + } + } + + @Override + @DSTransactional + public void submit(String id, LeaveApplyEntity entity, LeaveApplyForm form) { + //表单信息 + if (StringUtil.isEmpty(entity.getId())) { + entity.setId(id); + save(entity); + billRuleService.useBillNumber("WF_LeaveApplyNo"); + } else { + entity.setId(id); + updateById(entity); + } + } + + @Override + public void data(String id, String data) { + LeaveApplyForm leaveApplyForm = JsonUtil.getJsonToBean(data, LeaveApplyForm.class); + LeaveApplyEntity entity = JsonUtil.getJsonToBean(leaveApplyForm, LeaveApplyEntity.class); + entity.setId(id); + saveOrUpdate(entity); + } + + @Override + public void delete(LeaveApplyEntity entity) { + this.removeById(entity); + } + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/OrderEntryServiceImpl.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/OrderEntryServiceImpl.java new file mode 100644 index 0000000..322bbeb --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/OrderEntryServiceImpl.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.service.impl; + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.entity.OrderEntryEntity; +import com.yunzhupaas.mapper.OrderEntryMapper; +import com.yunzhupaas.service.OrderEntryService; +import org.springframework.stereotype.Service; + +/** + * 订单明细 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +@Service +public class OrderEntryServiceImpl extends SuperServiceImpl implements OrderEntryService { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/OrderReceivableServiceImpl.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/OrderReceivableServiceImpl.java new file mode 100644 index 0000000..94d07d5 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/OrderReceivableServiceImpl.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.service.impl; + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.entity.OrderReceivableEntity; +import com.yunzhupaas.mapper.OrderReceivableMapper; +import com.yunzhupaas.service.OrderReceivableService; +import org.springframework.stereotype.Service; + +/** + * 订单收款 + * + * @copyright 深圳市乐程软件有限公司 + * @author 云筑产品开发平台组 + * @date 2024-09-26 上午9:18 + */ +@Service +public class OrderReceivableServiceImpl extends SuperServiceImpl implements OrderReceivableService { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/OrderServiceImpl.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/OrderServiceImpl.java new file mode 100644 index 0000000..32f8335 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/OrderServiceImpl.java @@ -0,0 +1,271 @@ +package com.yunzhupaas.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.service.BillRuleService; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.entity.OrderEntity; +import com.yunzhupaas.entity.OrderEntryEntity; +import com.yunzhupaas.entity.OrderReceivableEntity; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.mapper.OrderMapper; +import com.yunzhupaas.model.order.*; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.service.OrderEntryService; +import com.yunzhupaas.service.OrderReceivableService; +import com.yunzhupaas.service.OrderService; +import com.yunzhupaas.util.*; +import com.yunzhupaas.workflow.service.TaskApi; +import com.yunzhupaas.workflow.service.TemplateApi; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * 订单信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:19 + */ +@Service +public class OrderServiceImpl extends SuperServiceImpl implements OrderService { + + + @Autowired + private OrderReceivableService orderReceivableService; + @Autowired + private OrderEntryService orderEntryService; + @Autowired + private BillRuleService billRuleService; + @Autowired + private UserService userService; + @Autowired + private TemplateApi templateApi; + + /** + * 前单 + **/ + private static String PREV = "prev"; + /** + * 后单 + **/ + private static String NEXT = "next"; + + @Override + public List getList(PaginationOrder paginationOrder) { + UserInfo userInfo = UserProvider.getUser(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + //关键字(订单编码、客户名称、业务人员) + String keyWord = paginationOrder.getKeyword() != null ? paginationOrder.getKeyword() : null; + if (!StringUtils.isEmpty(keyWord)) { + String word = keyWord; + queryWrapper.lambda().and( + t -> t.like(OrderEntity::getOrderCode, word) + .or().like(OrderEntity::getCustomerName, word) + .or().like(OrderEntity::getSalesmanName, word) + ); + } + //起始日期-结束日期 + if (ObjectUtil.isNotEmpty(paginationOrder.getStartTime()) && ObjectUtil.isNotEmpty(paginationOrder.getEndTime())) { + queryWrapper.lambda().between(OrderEntity::getOrderDate, new Date(paginationOrder.getStartTime()), new Date(paginationOrder.getEndTime())); + } + //订单状态 + String mark = paginationOrder.getEnabledMark(); + if (ObjectUtil.isNotEmpty(mark)) { + queryWrapper.lambda().eq(OrderEntity::getEnabledMark, mark); + } + + //流程数据查询 + if (ObjectUtil.isNotEmpty(paginationOrder.getTemplateId())) { + List flowIdsByTemplateId = templateApi.getFlowIdsByTemplateId(paginationOrder.getTemplateId()); + queryWrapper.lambda().in(OrderEntity::getFlowId, flowIdsByTemplateId); + } + //排序 + if (StringUtils.isEmpty(paginationOrder.getSidx())) { + queryWrapper.lambda().orderByDesc(OrderEntity::getCreatorTime); + } else { + queryWrapper = "asc".equals(paginationOrder.getSort().toLowerCase()) ? queryWrapper.orderByAsc(paginationOrder.getSidx()) : queryWrapper.orderByDesc(paginationOrder.getSidx()); + } + Page page = new Page<>(paginationOrder.getCurrentPage(), paginationOrder.getPageSize()); + IPage orderEntityPage = this.page(page, queryWrapper); + List data = orderEntityPage.getRecords(); + return paginationOrder.setData(data, page.getTotal()); + } + + @Override + public List getOrderEntryList(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrderEntryEntity::getOrderId, id).orderByDesc(OrderEntryEntity::getSortCode); + return orderEntryService.list(queryWrapper); + } + + @Override + public List getOrderReceivableList(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrderReceivableEntity::getOrderId, id).orderByDesc(OrderReceivableEntity::getSortCode); + return orderReceivableService.list(queryWrapper); + } + + @Override + public OrderEntity getPrevOrNextInfo(String id, String method) { + QueryWrapper result = new QueryWrapper<>(); + OrderEntity orderEntity = getInfo(id); + String orderBy = "desc"; + if (PREV.equals(method)) { + result.lambda().gt(OrderEntity::getCreatorTime, orderEntity.getCreatorTime()); + orderBy = ""; + } else if (NEXT.equals(method)) { + result.lambda().lt(OrderEntity::getCreatorTime, orderEntity.getCreatorTime()); + } + result.lambda().notIn(OrderEntity::getId, orderEntity.getId()); + if (StringUtil.isNotEmpty(orderBy)) { + result.lambda().orderByDesc(OrderEntity::getCreatorTime); + } + List data = this.list(result); + if (data.size() > 0) { + return data.get(0); + } + return null; + } + + @Override + public OrderInfoVO getInfoVo(String id, String method) throws DataException { + OrderInfoVO infoModel = null; + OrderEntity orderEntity = this.getPrevOrNextInfo(id, method); + if (orderEntity != null) { + List orderEntryList = this.getOrderEntryList(orderEntity.getId()); + List orderReceivableList = this.getOrderReceivableList(orderEntity.getId()); + infoModel = JsonUtilEx.getJsonToBeanEx(orderEntity, OrderInfoVO.class); + UserEntity createUser = null; + if (StringUtil.isNotEmpty(infoModel.getCreatorUserId())) { + createUser = userService.getInfo(infoModel.getCreatorUserId()); + } + infoModel.setCreatorUserId(createUser != null ? createUser.getRealName() + "/" + createUser.getAccount() : ""); + UserEntity lastUser = null; + if (StringUtil.isNotEmpty(infoModel.getLastModifyUserId())) { + lastUser = userService.getInfo(infoModel.getLastModifyUserId()); + } + infoModel.setLastModifyUserId(lastUser != null ? lastUser.getRealName() + "/" + lastUser.getAccount() : ""); + List orderEntryModels = JsonUtil.getJsonToList(orderEntryList, OrderInfoOrderEntryModel.class); + infoModel.setGoodsList(orderEntryModels); + List orderReceivableModels = JsonUtil.getJsonToList(orderReceivableList, OrderInfoOrderReceivableModel.class); + infoModel.setCollectionPlanList(orderReceivableModels); + } + return infoModel; + } + + @Override + public OrderEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrderEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void delete(OrderEntity entity) { + QueryWrapper orderWrapper = new QueryWrapper<>(); + orderWrapper.lambda().eq(OrderEntity::getId, entity.getId()); + this.remove(orderWrapper); + QueryWrapper entryWrapper = new QueryWrapper<>(); + entryWrapper.lambda().eq(OrderEntryEntity::getOrderId, entity.getId()); + orderEntryService.remove(entryWrapper); + QueryWrapper receivableWrapper = new QueryWrapper<>(); + receivableWrapper.lambda().eq(OrderReceivableEntity::getOrderId, entity.getId()); + orderReceivableService.remove(receivableWrapper); + } + + @Override + @DSTransactional + public void create(OrderEntity entity, List orderEntryList, List orderReceivableList) { + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + entity.setEnabledMark(1); + for (int i = 0; i < orderEntryList.size(); i++) { + orderEntryList.get(i).setId(RandomUtil.uuId()); + orderEntryList.get(i).setOrderId(entity.getId()); + orderEntryList.get(i).setSortCode(Long.parseLong(i + "")); + orderEntryService.save(orderEntryList.get(i)); + } + for (int i = 0; i < orderReceivableList.size(); i++) { + orderReceivableList.get(i).setId(RandomUtil.uuId()); + orderReceivableList.get(i).setOrderId(entity.getId()); + orderReceivableList.get(i).setSortCode(Long.parseLong(i + "")); + orderReceivableService.save(orderReceivableList.get(i)); + } + billRuleService.useBillNumber("OrderNumber"); + this.save(entity); + } + + @Override + @DSTransactional + public boolean update(String id, OrderEntity entity, List orderEntryList, List orderReceivableList) { + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + QueryWrapper entryWrapper = new QueryWrapper<>(); + entryWrapper.lambda().eq(OrderEntryEntity::getOrderId, entity.getId()); + orderEntryService.remove(entryWrapper); + QueryWrapper receivableWrapper = new QueryWrapper<>(); + receivableWrapper.lambda().eq(OrderReceivableEntity::getOrderId, entity.getId()); + orderReceivableService.remove(receivableWrapper); + for (int i = 0; i < orderEntryList.size(); i++) { + orderEntryList.get(i).setId(RandomUtil.uuId()); + orderEntryList.get(i).setOrderId(entity.getId()); + orderEntryList.get(i).setSortCode(Long.parseLong(i + "")); + orderEntryService.save(orderEntryList.get(i)); + } + for (int i = 0; i < orderReceivableList.size(); i++) { + orderReceivableList.get(i).setId(RandomUtil.uuId()); + orderReceivableList.get(i).setOrderId(entity.getId()); + orderReceivableList.get(i).setSortCode(Long.parseLong(i + "")); + orderReceivableService.save(orderReceivableList.get(i)); + } + boolean flag = this.updateById(entity); + return flag; + } + + @Override + public void data(String id, String data) { + OrderForm orderForm = JsonUtil.getJsonToBean(data, OrderForm.class); + OrderEntity entity = JsonUtil.getJsonToBean(orderForm, OrderEntity.class); + List goodsList = orderForm.getGoodsList() != null ? orderForm.getGoodsList() : new ArrayList<>(); + List orderEntryList = JsonUtil.getJsonToList(goodsList, OrderEntryEntity.class); + List collectionPlanList = orderForm.getCollectionPlanList() != null ? orderForm.getCollectionPlanList() : new ArrayList<>(); + List orderReceivableList = JsonUtil.getJsonToList(collectionPlanList, OrderReceivableEntity.class); + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + QueryWrapper entryWrapper = new QueryWrapper<>(); + entryWrapper.lambda().eq(OrderEntryEntity::getOrderId, entity.getId()); + orderEntryService.remove(entryWrapper); + QueryWrapper receivableWrapper = new QueryWrapper<>(); + receivableWrapper.lambda().eq(OrderReceivableEntity::getOrderId, entity.getId()); + orderReceivableService.remove(receivableWrapper); + for (int i = 0; i < orderEntryList.size(); i++) { + orderEntryList.get(i).setId(RandomUtil.uuId()); + orderEntryList.get(i).setOrderId(entity.getId()); + orderEntryList.get(i).setSortCode(Long.parseLong(i + "")); + orderEntryService.save(orderEntryList.get(i)); + } + for (int i = 0; i < orderReceivableList.size(); i++) { + orderReceivableList.get(i).setId(RandomUtil.uuId()); + orderReceivableList.get(i).setOrderId(entity.getId()); + orderReceivableList.get(i).setSortCode(Long.parseLong(i + "")); + orderReceivableService.save(orderReceivableList.get(i)); + } + this.saveOrUpdate(entity); + } + + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/ProductEntryServiceImpl.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/ProductEntryServiceImpl.java new file mode 100644 index 0000000..ff50b77 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/ProductEntryServiceImpl.java @@ -0,0 +1,49 @@ +package com.yunzhupaas.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.entity.ProductEntryEntity; +import com.yunzhupaas.mapper.ProductEntryMapper; +import com.yunzhupaas.service.ProductEntryService; +import com.yunzhupaas.util.StringUtil; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 销售订单明细 + * 版本: V3.1.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2021-07-10 10:40:59 + */ +@Service +public class ProductEntryServiceImpl extends SuperServiceImpl implements ProductEntryService { + + @Override + public List getProductentryEntityList(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ProductEntryEntity::getProductId, id); + return this.list(queryWrapper); + } + + @Override + public List getProductentryEntityList(Pagination pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if(StringUtil.isNotEmpty(pagination.getKeyword())){ + queryWrapper.lambda().and( + t->t.like(ProductEntryEntity::getProductName, pagination.getKeyword()) + .or().like(ProductEntryEntity::getProductCode, pagination.getKeyword()) + .or().like(ProductEntryEntity::getProductSpecification, pagination.getKeyword()) + ); + } + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage userIPage = this.page(page, queryWrapper); + return pagination.setData(userIPage.getRecords(), userIPage.getTotal()); + } + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/ProductGoodsServiceImpl.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/ProductGoodsServiceImpl.java new file mode 100644 index 0000000..7800055 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/ProductGoodsServiceImpl.java @@ -0,0 +1,102 @@ +package com.yunzhupaas.service.impl; + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yunzhupaas.entity.ProductGoodsEntity; +import com.yunzhupaas.mapper.ProductGoodsMapper; +import com.yunzhupaas.model.productgoods.ProductGoodsPagination; +import com.yunzhupaas.service.ProductGoodsService; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * 产品商品 + * 版本: V3.1.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2021-07-10 15:57:50 + */ +@Service +public class ProductGoodsServiceImpl extends SuperServiceImpl implements ProductGoodsService { + + + + @Override + public List getGoodList(String type) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(type)) { + queryWrapper.lambda().eq(ProductGoodsEntity::getType, type); + } + return this.list(queryWrapper); + } + + @Override + public List getList(ProductGoodsPagination goodsPagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(goodsPagination.getCode())) { + queryWrapper.lambda().like(ProductGoodsEntity::getEnCode, goodsPagination.getCode()); + } + if (StringUtil.isNotEmpty(goodsPagination.getFullName())) { + queryWrapper.lambda().like(ProductGoodsEntity::getFullName, goodsPagination.getFullName()); + } + if (StringUtil.isNotEmpty(goodsPagination.getClassifyId())) { + queryWrapper.lambda().like(ProductGoodsEntity::getClassifyId, goodsPagination.getClassifyId()); + } + if (StringUtil.isNotEmpty(goodsPagination.getKeyword())) { + queryWrapper.lambda().and( + t -> t.like(ProductGoodsEntity::getFullName, goodsPagination.getKeyword()) + .or().like(ProductGoodsEntity::getEnCode, goodsPagination.getKeyword()) + .or().like(ProductGoodsEntity::getProductSpecification, goodsPagination.getKeyword()) + ); + } + //排序 + if (StringUtil.isEmpty(goodsPagination.getSidx())) { + queryWrapper.lambda().orderByDesc(ProductGoodsEntity::getId); + } else { + queryWrapper = "asc".equals(goodsPagination.getSort().toLowerCase()) ? queryWrapper.orderByAsc(goodsPagination.getSidx()) : queryWrapper.orderByDesc(goodsPagination.getSidx()); + } + Page page = new Page<>(goodsPagination.getCurrentPage(), goodsPagination.getPageSize()); + IPage userIPage = this.page(page, queryWrapper); + return goodsPagination.setData(userIPage.getRecords(), userIPage.getTotal()); + } + + @Override + public ProductGoodsEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ProductGoodsEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(ProductGoodsEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + entity.setCreatorTime(new Date()); + this.save(entity); + } + + @Override + public boolean update(String id, ProductGoodsEntity entity) { + entity.setId(id); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + entity.setLastModifyTime(new Date()); + return this.updateById(entity); + } + + @Override + public void delete(ProductGoodsEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/ProductServiceImpl.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/ProductServiceImpl.java new file mode 100644 index 0000000..0ff46ea --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/ProductServiceImpl.java @@ -0,0 +1,130 @@ +package com.yunzhupaas.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.service.BillRuleService; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.entity.ProductEntity; +import com.yunzhupaas.entity.ProductEntryEntity; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.mapper.ProductMapper; +import com.yunzhupaas.model.product.ProductPagination; +import com.yunzhupaas.service.ProductEntryService; +import com.yunzhupaas.service.ProductService; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; +import java.util.List; + +/** + * 销售订单 + * 版本: V3.1.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2021-07-10 10:40:59 + */ +@Service + +public class ProductServiceImpl extends SuperServiceImpl implements ProductService { + + + @Autowired + private BillRuleService billRuleService; + @Autowired + private ProductEntryService productEntryService; + + @Override + public List getList(ProductPagination productPagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(productPagination.getCode())) { + queryWrapper.lambda().and(t -> t.like(ProductEntity::getEnCode, productPagination.getCode())); + } + if (StringUtil.isNotEmpty(productPagination.getCustomerName())) { + queryWrapper.lambda().and(t -> t.like(ProductEntity::getCustomerName, productPagination.getCustomerName())); + } + if (StringUtil.isNotEmpty(productPagination.getContactTel())) { + queryWrapper.lambda().and(t -> t.like(ProductEntity::getContactTel, productPagination.getContactTel())); + } + //排序 + queryWrapper.lambda().orderByDesc(ProductEntity::getCreatorTime); + Page page = new Page<>(productPagination.getCurrentPage(), productPagination.getPageSize()); + IPage userIPage = this.page(page, queryWrapper); + return productPagination.setData(userIPage.getRecords(), userIPage.getTotal()); + } + + @Override + public ProductEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ProductEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void create(ProductEntity entity, List productEntryList) throws DataException { + UserInfo userInfo = UserProvider.getUser(); + String code = billRuleService.getBillNumber("OrderNumber",false); + entity.setEnCode(code); + //类型 + entity.setType("市场活动"); + //制单 + entity.setSalesmanId(userInfo.getUserId()); + entity.setSalesmanName(userInfo.getUserName()); + entity.setSalesmanDate(new Date()); + //状态 + entity.setAuditState(1); + entity.setGoodsState(1); + entity.setCloseState(1); + entity.setCreatorUserId(userInfo.getUserId()); + entity.setCreatorTime(new Date()); + entity.setId(RandomUtil.uuId()); + this.save(entity); + for (ProductEntryEntity product : productEntryList) { + product.setId(RandomUtil.uuId()); + product.setActivity("市场部全国香风健康奢护"); + product.setType("市场活动"); + product.setUtil("支"); + product.setCommandType("唯一码"); + product.setProductId(entity.getId()); + productEntryService.save(product); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean update(String id, ProductEntity entity, List productEntryList) { + entity.setId(id); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + entity.setLastModifyTime(new Date()); + QueryWrapper entryWrapper = new QueryWrapper<>(); + entryWrapper.lambda().eq(ProductEntryEntity::getProductId, entity.getId()); + productEntryService.remove(entryWrapper); + for (ProductEntryEntity product : productEntryList) { + product.setId(RandomUtil.uuId()); + product.setProductId(entity.getId()); + productEntryService.save(product); + } + return this.updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(ProductEntity entity) { + if (entity != null) { + QueryWrapper entryWrapper = new QueryWrapper<>(); + entryWrapper.lambda().eq(ProductEntryEntity::getProductId, entity.getId()); + productEntryService.remove(entryWrapper); + this.removeById(entity.getId()); + } + } + + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/ProductclassifyServiceImpl.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/ProductclassifyServiceImpl.java new file mode 100644 index 0000000..c144adf --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/ProductclassifyServiceImpl.java @@ -0,0 +1,65 @@ +package com.yunzhupaas.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.entity.ProductclassifyEntity; +import com.yunzhupaas.mapper.ProductclassifyMapper; +import com.yunzhupaas.service.ProductclassifyService; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * + * 产品分类 + * 版本: V3.1.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2021-07-10 14:34:04 + */ +@Service +public class ProductclassifyServiceImpl extends SuperServiceImpl implements ProductclassifyService { + + + + @Override + public List getList(){ + QueryWrapper queryWrapper=new QueryWrapper<>(); + return list(queryWrapper); + } + + @Override + public ProductclassifyEntity getInfo(String id){ + QueryWrapper queryWrapper=new QueryWrapper<>(); + queryWrapper.lambda().eq(ProductclassifyEntity::getId,id); + return this.getOne(queryWrapper); + } + + @Override + public void create(ProductclassifyEntity entity){ + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + entity.setCreatorTime(new Date()); + this.save(entity); + } + + @Override + public boolean update(String id, ProductclassifyEntity entity){ + entity.setId(id); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + entity.setLastModifyTime(new Date()); + return this.updateById(entity); + } + @Override + public void delete(ProductclassifyEntity entity){ + if(entity!=null){ + this.removeById(entity.getId()); + } + } + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/ProjectGanttServiceImpl.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/ProjectGanttServiceImpl.java new file mode 100644 index 0000000..75a3167 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/ProjectGanttServiceImpl.java @@ -0,0 +1,167 @@ +package com.yunzhupaas.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.Page; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.entity.ProjectGanttEntity; +import com.yunzhupaas.mapper.ProjectGanttMapper; +import com.yunzhupaas.service.ProjectGanttService; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.UserProvider; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; +import java.util.List; + +/** + * 订单明细 + * + * @author 云筑产品开发平台组 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +@Service +public class ProjectGanttServiceImpl extends SuperServiceImpl implements ProjectGanttService { + + + + @Override + public List getList(Page page) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ProjectGanttEntity::getType, 1).orderByAsc(ProjectGanttEntity::getSortCode) + .orderByDesc(ProjectGanttEntity::getCreatorTime); + if (!StringUtils.isEmpty(page.getKeyword())) { + queryWrapper.lambda().and( + t -> t.like(ProjectGanttEntity::getEnCode, page.getKeyword()) + .or().like(ProjectGanttEntity::getFullName, page.getKeyword()) + ); + } + return this.list(queryWrapper); + } + + @Override + public List getTaskList(String projectId) { + ProjectGanttEntity entity = this.getInfo(projectId); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ProjectGanttEntity::getType, 2).eq(ProjectGanttEntity::getProjectId, projectId).orderByAsc(ProjectGanttEntity::getSortCode); + List list = this.list(queryWrapper); + list.add(entity); + return list; + } + + @Override + public ProjectGanttEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ProjectGanttEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public boolean allowDelete(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().and(t -> + t.eq(ProjectGanttEntity::getParentId, id).or().eq(ProjectGanttEntity::getProjectId, id) + ); + return this.list(queryWrapper).size() < 1; + } + + @Override + public void delete(ProjectGanttEntity entity) { + this.removeById(entity.getId()); + } + + @Override + public void create(ProjectGanttEntity entity) { + entity.setId(RandomUtil.uuId()); + if (entity.getEnabledMark() == null) { + entity.setEnabledMark(1); + } + entity.setSortCode(RandomUtil.parses()); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + this.save(entity); + } + + @Override + public boolean update(String id, ProjectGanttEntity entity) { + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + return this.updateById(entity); + } + + @Override + public boolean isExistByFullName(String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ProjectGanttEntity::getFullName, fullName); + if (!StringUtils.isEmpty(id)) { + queryWrapper.lambda().ne(ProjectGanttEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public boolean isExistByEnCode(String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ProjectGanttEntity::getEnCode, enCode); + if (!StringUtils.isEmpty(id)) { + queryWrapper.lambda().ne(ProjectGanttEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + @Transactional + public boolean first(String id) { + boolean isOk = false; + //获取要上移的那条数据的信息 + ProjectGanttEntity upEntity = this.getById(id); + Long upSortCode = upEntity.getSortCode() == null ? 0 : upEntity.getSortCode(); + //查询上几条记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .lt(ProjectGanttEntity::getSortCode, upSortCode) + .eq(ProjectGanttEntity::getParentId, upEntity.getParentId()) + .orderByDesc(ProjectGanttEntity::getSortCode); + List downEntity = this.list(queryWrapper); + if (downEntity.size() > 0) { + //交换两条记录的sort值 + Long temp = upEntity.getSortCode(); + upEntity.setSortCode(downEntity.get(0).getSortCode()); + downEntity.get(0).setSortCode(temp); + this.updateById(downEntity.get(0)); + this.updateById(upEntity); + isOk = true; + } + return isOk; + } + + @Override + @Transactional + public boolean next(String id) { + boolean isOk = false; + //获取要下移的那条数据的信息 + ProjectGanttEntity downEntity = this.getById(id); + Long upSortCode = downEntity.getSortCode() == null ? 0 : downEntity.getSortCode(); + //查询下几条记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .gt(ProjectGanttEntity::getSortCode, upSortCode) + .eq(ProjectGanttEntity::getParentId,downEntity.getParentId()) + .orderByAsc(ProjectGanttEntity::getSortCode); + List upEntity = this.list(queryWrapper); + if (upEntity.size() > 0) { + //交换两条记录的sort值 + Long temp = downEntity.getSortCode(); + downEntity.setSortCode(upEntity.get(0).getSortCode()); + upEntity.get(0).setSortCode(temp); + this.updateById(upEntity.get(0)); + this.updateById(downEntity); + isOk = true; + } + return isOk; + } +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/SalesOrderEntryServiceImpl.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/SalesOrderEntryServiceImpl.java new file mode 100644 index 0000000..260b39b --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/SalesOrderEntryServiceImpl.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.service.impl; + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.entity.SalesOrderEntryEntity; +import com.yunzhupaas.mapper.SalesOrderEntryMapper; +import com.yunzhupaas.service.SalesOrderEntryService; +import org.springframework.stereotype.Service; + +/** + * 销售订单明细 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-29 上午9:18 + */ +@Service +public class SalesOrderEntryServiceImpl extends SuperServiceImpl implements SalesOrderEntryService { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/SalesOrderServiceImpl.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/SalesOrderServiceImpl.java new file mode 100644 index 0000000..503c377 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/SalesOrderServiceImpl.java @@ -0,0 +1,141 @@ +package com.yunzhupaas.service.impl; + +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.service.BillRuleService; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.entity.SalesOrderEntity; +import com.yunzhupaas.entity.SalesOrderEntryEntity; +import com.yunzhupaas.mapper.SalesOrderMapper; +import com.yunzhupaas.model.salesorder.SalesOrderEntryEntityInfoModel; +import com.yunzhupaas.model.salesorder.SalesOrderForm; +import com.yunzhupaas.service.SalesOrderEntryService; +import com.yunzhupaas.service.SalesOrderService; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 销售订单 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-29 上午9:18 + */ +@Service +public class SalesOrderServiceImpl extends SuperServiceImpl implements SalesOrderService { + + @Autowired + private BillRuleService billRuleService; + @Autowired + private SalesOrderEntryService salesOrderEntryService; + + @Override + public List getSalesEntryList(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SalesOrderEntryEntity::getSalesOrderId, id).orderByDesc(SalesOrderEntryEntity::getSortCode); + return salesOrderEntryService.list(queryWrapper); + } + + @Override + public SalesOrderEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SalesOrderEntity::getId, id); + return getOne(queryWrapper); + } + + @Override + @DSTransactional + public void save(String id, SalesOrderEntity entity, List salesOrderEntryEntityList, SalesOrderForm form) { + //表单信息 + if (StringUtil.isEmpty(entity.getId())) { + entity.setId(id); + for (int i = 0; i < salesOrderEntryEntityList.size(); i++) { + salesOrderEntryEntityList.get(i).setId(RandomUtil.uuId()); + salesOrderEntryEntityList.get(i).setSalesOrderId(entity.getId()); + salesOrderEntryEntityList.get(i).setSortCode(Long.parseLong(i + "")); + salesOrderEntryService.save(salesOrderEntryEntityList.get(i)); + } + //创建 + save(entity); + billRuleService.useBillNumber("WF_SalesOrderNo"); + } else { + entity.setId(id); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SalesOrderEntryEntity::getSalesOrderId, entity.getId()); + salesOrderEntryService.remove(queryWrapper); + for (int i = 0; i < salesOrderEntryEntityList.size(); i++) { + salesOrderEntryEntityList.get(i).setId(RandomUtil.uuId()); + salesOrderEntryEntityList.get(i).setSalesOrderId(entity.getId()); + salesOrderEntryEntityList.get(i).setSortCode(Long.parseLong(i + "")); + salesOrderEntryService.save(salesOrderEntryEntityList.get(i)); + } + //编辑 + updateById(entity); + } + } + + @Override + @DSTransactional + public void submit(String id, SalesOrderEntity entity, List salesOrderEntryEntityList, SalesOrderForm form) { + //表单信息 + if (StringUtil.isEmpty(entity.getId())) { + entity.setId(id); + for (int i = 0; i < salesOrderEntryEntityList.size(); i++) { + salesOrderEntryEntityList.get(i).setId(RandomUtil.uuId()); + salesOrderEntryEntityList.get(i).setSalesOrderId(entity.getId()); + salesOrderEntryEntityList.get(i).setSortCode(Long.parseLong(i + "")); + salesOrderEntryService.save(salesOrderEntryEntityList.get(i)); + } + //创建 + save(entity); + billRuleService.useBillNumber("WF_SalesOrderNo"); + } else { + entity.setId(id); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SalesOrderEntryEntity::getSalesOrderId, entity.getId()); + salesOrderEntryService.remove(queryWrapper); + for (int i = 0; i < salesOrderEntryEntityList.size(); i++) { + salesOrderEntryEntityList.get(i).setId(RandomUtil.uuId()); + salesOrderEntryEntityList.get(i).setSalesOrderId(entity.getId()); + salesOrderEntryEntityList.get(i).setSortCode(Long.parseLong(i + "")); + salesOrderEntryService.save(salesOrderEntryEntityList.get(i)); + } + //编辑 + updateById(entity); + } + } + + @Override + public void data(String id, String data) { + SalesOrderForm salesOrderForm = JsonUtil.getJsonToBean(data, SalesOrderForm.class); + SalesOrderEntity entity = JsonUtil.getJsonToBean(salesOrderForm, SalesOrderEntity.class); + List entryList = salesOrderForm.getEntryList() != null ? salesOrderForm.getEntryList() : new ArrayList<>(); + List salesOrderEntryEntityList = JsonUtil.getJsonToList(entryList, SalesOrderEntryEntity.class); + entity.setId(id); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SalesOrderEntryEntity::getSalesOrderId, entity.getId()); + salesOrderEntryService.remove(queryWrapper); + for (int i = 0; i < salesOrderEntryEntityList.size(); i++) { + salesOrderEntryEntityList.get(i).setId(RandomUtil.uuId()); + salesOrderEntryEntityList.get(i).setSalesOrderId(entity.getId()); + salesOrderEntryEntityList.get(i).setSortCode(Long.parseLong(i + "")); + salesOrderEntryService.save(salesOrderEntryEntityList.get(i)); + } + //编辑 + saveOrUpdate(entity); + } + + @Override + public void delete(SalesOrderEntity entity) { + this.removeById(entity); + } + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/TableExampleServiceImpl.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/TableExampleServiceImpl.java new file mode 100644 index 0000000..f73e53c --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/TableExampleServiceImpl.java @@ -0,0 +1,161 @@ +package com.yunzhupaas.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.entity.TableExampleEntity; +import com.yunzhupaas.mapper.TableExampleMapper; +import com.yunzhupaas.model.tableexample.PaginationTableExample; +import com.yunzhupaas.service.TableExampleService; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.UserProvider; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * 表格示例数据 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +@Service +public class TableExampleServiceImpl extends SuperServiceImpl implements TableExampleService { + + + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().orderByAsc(TableExampleEntity::getProjectType).orderByAsc(TableExampleEntity::getSortCode); + return this.list(queryWrapper); + } + + @Override + public List getList(String keyword) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + //关键字查询 + if (!StringUtils.isEmpty(keyword)){ + queryWrapper.lambda().and(t->t.like(TableExampleEntity::getCustomerName,keyword) + .or().like(TableExampleEntity::getProjectName,keyword)); + } + queryWrapper.lambda().orderByAsc(TableExampleEntity::getProjectType).orderByAsc(TableExampleEntity::getSortCode); + return this.list(queryWrapper); + } + + @Override + public List getList(String typeId, PaginationTableExample paginationTableExample) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TableExampleEntity::getProjectType, typeId); + //关键字(项目编码、项目名称、客户名称) + String keyWord = paginationTableExample.getKeyword() != null ? paginationTableExample.getKeyword() : null; + if (!StringUtils.isEmpty(keyWord)) { + queryWrapper.lambda().and( + t -> t.like(TableExampleEntity::getProjectCode, keyWord) + .or().like(TableExampleEntity::getProjectName, keyWord) + .or().like(TableExampleEntity::getCustomerName, keyWord) + ); + } + //标签查询 + String sign = paginationTableExample.getF_Sign() != null ? paginationTableExample.getF_Sign() : null; + if (!StringUtils.isEmpty(sign)) { + String[] arraySign = sign.split(","); + for (int i = 0; i < arraySign.length; i++) { + String item = arraySign[i]; + if (i == 0) { + queryWrapper.lambda().like(TableExampleEntity::getProjectCode, item); + } else { + queryWrapper.lambda().or(t -> t.like(TableExampleEntity::getProjectCode, item)); + } + } + } + //排序 + if (StringUtils.isEmpty(paginationTableExample.getSidx())) { + queryWrapper.lambda().orderByDesc(TableExampleEntity::getRegisterDate); + } else { + queryWrapper = "asc".equals(paginationTableExample.getSort().toLowerCase()) ? queryWrapper.orderByAsc(paginationTableExample.getSidx()) : queryWrapper.orderByDesc(paginationTableExample.getSidx()); + } + return this.list(queryWrapper); + } + + @Override + public List getList(PaginationTableExample paginationTableExample) { + QueryWrapper queryWrapper = new QueryWrapper<>(); +// Map queryParam = OptimizeUtil.queryParam(pagination); + //关键字(项目编码、项目名称、客户名称) + String keyWord = paginationTableExample.getKeyword() != null ? paginationTableExample.getKeyword() : null; + if (!StringUtils.isEmpty(keyWord)) { + queryWrapper.lambda().and( + t -> t.like(TableExampleEntity::getProjectCode, keyWord) + .or().like(TableExampleEntity::getProjectName, keyWord) + .or().like(TableExampleEntity::getCustomerName, keyWord) + ); + } + //标签查询 + String sign = paginationTableExample.getF_Sign() != null ? paginationTableExample.getF_Sign() : null; + if (!StringUtils.isEmpty(sign)) { + String[] arraySign = sign.split(","); + for (int i = 0; i < arraySign.length; i++) { + String item = arraySign[i]; + if (i == 0) { + queryWrapper.lambda().like(TableExampleEntity::getProjectCode, item); + } else { + queryWrapper.lambda().or(t -> t.like(TableExampleEntity::getProjectCode, item)); + } + } + } + //排序 + if (StringUtils.isEmpty(paginationTableExample.getSidx())) { + queryWrapper.lambda().orderByDesc(TableExampleEntity::getRegisterDate); + } else { + queryWrapper = "asc".equalsIgnoreCase(paginationTableExample.getSort()) ? queryWrapper.orderByAsc(paginationTableExample.getSidx()) : queryWrapper.orderByDesc(paginationTableExample.getSidx()); + } + Page page=new Page(paginationTableExample.getCurrentPage(),paginationTableExample.getPageSize()); + IPage exampleEntityIPage=this.page(page,queryWrapper); + return paginationTableExample.setData(exampleEntityIPage.getRecords(),page.getTotal()); + } + + @Override + public TableExampleEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TableExampleEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void delete(TableExampleEntity entity) { + this.removeById(entity.getId()); + } + + @Override + public void create(TableExampleEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setSortCode(RandomUtil.parses()); + entity.setRegisterDate(new Date()); + entity.setRegistrant(UserProvider.getUser().getUserId()); + this.save(entity); + } + + @Override + public boolean update(String id, TableExampleEntity entity) { + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + return this.updateById(entity); + } + + @Override + public boolean rowEditing(TableExampleEntity entity) { + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + return this.updateById(entity); + } + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/WorkLogServiceImpl.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/WorkLogServiceImpl.java new file mode 100644 index 0000000..c58c0e6 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/WorkLogServiceImpl.java @@ -0,0 +1,138 @@ +package com.yunzhupaas.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.entity.WorkLogEntity; +import com.yunzhupaas.entity.WorkLogShareEntity; +import com.yunzhupaas.mapper.WorkLogMapper; +import com.yunzhupaas.service.WorkLogService; +import com.yunzhupaas.service.WorkLogShareService; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; +import java.util.List; + +/** + * 工作日志 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +@Service +public class WorkLogServiceImpl extends SuperServiceImpl implements WorkLogService { + + + @Autowired + private WorkLogShareService workLogShareService; + + @Override + public List getSendList(Pagination pageModel) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(WorkLogEntity::getCreatorUserId, UserProvider.getUser().getUserId()); + //app搜索 + if(StringUtil.isNotEmpty(pageModel.getKeyword())){ + queryWrapper.lambda().like(WorkLogEntity::getTitle,pageModel.getKeyword()); + } + //排序 + if (StringUtils.isEmpty(pageModel.getSidx())) { + queryWrapper.lambda().orderByDesc(WorkLogEntity::getCreatorTime); + } else { + queryWrapper = "asc".equals(pageModel.getSort().toLowerCase()) ? queryWrapper.orderByAsc(pageModel.getSidx()) : queryWrapper.orderByDesc(pageModel.getSidx()); + } + Page page = new Page(pageModel.getCurrentPage(), pageModel.getPageSize()); + IPage IPages = this.page(page, queryWrapper); + return pageModel.setData(IPages.getRecords(), page.getTotal()); + } + + @Override + public List getReceiveList(Pagination pageModel) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().like(WorkLogEntity::getToUserId, UserProvider.getUser().getUserId()); + //app搜索 + if(StringUtil.isNotEmpty(pageModel.getKeyword())){ + queryWrapper.lambda().like(WorkLogEntity::getTitle,pageModel.getKeyword()); + } + //排序 + if (StringUtils.isEmpty(pageModel.getSidx())) { + queryWrapper.lambda().orderByDesc(WorkLogEntity::getCreatorTime); + } else { + queryWrapper = "asc".equals(pageModel.getSort().toLowerCase()) ? queryWrapper.orderByAsc(pageModel.getSidx()) : queryWrapper.orderByDesc(pageModel.getSidx()); + } + Page page = new Page(pageModel.getCurrentPage(), pageModel.getPageSize()); + IPage IPages = this.page(page, queryWrapper); + return pageModel.setData(IPages.getRecords(), page.getTotal()); + } + + @Override + public WorkLogEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(WorkLogEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + @Transactional + public void create(WorkLogEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setSortCode(RandomUtil.parses()); + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + this.save(entity); + String[] toUserIds = entity.getToUserId().split(","); + for (String userIds : toUserIds) { + WorkLogShareEntity workLogShare = new WorkLogShareEntity(); + workLogShare.setId(RandomUtil.uuId()); + workLogShare.setShareTime(new Date()); + workLogShare.setWorkLogId(entity.getId()); + workLogShare.setShareUserId(userIds); + workLogShareService.save(workLogShare); + } + } + + @Override + @Transactional + public boolean update(String id, WorkLogEntity entity) { + boolean flag = false; + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + flag = this.updateById(entity); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(WorkLogShareEntity::getWorkLogId,entity.getId()); + workLogShareService.remove(queryWrapper); + String[] toUserIds = entity.getToUserId().split(","); + for (String userIds : toUserIds) { + WorkLogShareEntity workLogShare = new WorkLogShareEntity(); + workLogShare.setId(RandomUtil.uuId()); + workLogShare.setShareTime(new Date()); + workLogShare.setWorkLogId(entity.getId()); + workLogShare.setShareUserId(userIds); + workLogShareService.save(workLogShare); + } + return flag; + } + + @Override + @Transactional + public void delete(WorkLogEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(WorkLogShareEntity::getWorkLogId,entity.getId()); + workLogShareService.remove(queryWrapper); + } + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/WorkLogShareServiceImpl.java b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/WorkLogShareServiceImpl.java new file mode 100644 index 0000000..c0fdccf --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-biz/src/main/java/com/yunzhupaas/service/impl/WorkLogShareServiceImpl.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.service.impl; + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.entity.WorkLogShareEntity; +import com.yunzhupaas.mapper.WorkLogShareMapper; +import com.yunzhupaas.service.WorkLogShareService; +import org.springframework.stereotype.Service; + + +/** + * 工作日志分享 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +@Service +public class WorkLogShareServiceImpl extends SuperServiceImpl implements WorkLogShareService { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-controller/pom.xml b/yunzhupaas-extend/yunzhupaas-extend-controller/pom.xml new file mode 100644 index 0000000..514d224 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-controller/pom.xml @@ -0,0 +1,32 @@ + + + + yunzhupaas-extend + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-extend-controller + + + + com.yunzhupaas + yunzhupaas-extend-biz + ${project.version} + + + com.yunzhupaas + yunzhupaas-file-entity + ${project.version} + + + com.yunzhupaas + yunzhupaas-provider + ${project.version} + + + + diff --git a/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/BarCodeController.java b/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/BarCodeController.java new file mode 100644 index 0000000..2854961 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/BarCodeController.java @@ -0,0 +1,51 @@ +package com.yunzhupaas.controller; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.util.DownUtil; +import com.yunzhupaas.util.ServletUtil; +import com.yunzhupaas.util.ZxingCodeUtil; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.awt.image.BufferedImage; + +/** + * 生成条码 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +@RestController +@Tag(name = "(待定)生成条码", description = "BarCode") +@RequestMapping("/api/extend/BarCode") +public class BarCodeController { + + /** + * 生成二维码 + * + * @return + */ + @Operation(summary = "生成二维码") + @GetMapping("/BuildQRCode") + public void buildQrCode() { + BufferedImage image = ZxingCodeUtil.createCode(ServletUtil.getHeader("F_QRCodeContent"), 400, 400); + DownUtil.write(image); + } + + /** + * 生成条形码 + * + * @return + */ + @Operation(summary = "生成条形码") + @GetMapping("/BuildBarCode") + public void buildBarCode() { + BufferedImage image = ZxingCodeUtil.getBarcode(ServletUtil.getHeader("F_BarCodeContent"), 265, 50); + DownUtil.write(image); + } +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/BigDataController.java b/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/BigDataController.java new file mode 100644 index 0000000..5be2aab --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/BigDataController.java @@ -0,0 +1,70 @@ +package com.yunzhupaas.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.entity.BigDataEntity; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.model.bidata.BigBigDataListVO; +import com.yunzhupaas.service.BigDataService; +import com.yunzhupaas.util.JsonUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * 大数据测试 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +@Tag(name = "大数据测试", description = "BigData") +@RestController +@RequestMapping("/api/extend/BigData") +public class BigDataController extends SuperController { + + @Autowired + private BigDataService bigDataService; + + /** + * 列表 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "列表") + @GetMapping + @SaCheckPermission("extend.bigData") + public ActionResult> list(Pagination pagination) { + List data = bigDataService.getList(pagination); + List list= JsonUtil.getJsonToList(data, BigBigDataListVO.class); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination,PaginationVO.class); + return ActionResult.page(list,paginationVO); + } + + /** + * 新建 + * + * @return + */ + @Operation(summary = "添加大数据测试") + @PostMapping + @SaCheckPermission("extend.bigData") + public ActionResult create() throws WorkFlowException { + bigDataService.create(10000); + return ActionResult.success(MsgCode.ETD105.get()); + } +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/CustomerController.java b/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/CustomerController.java new file mode 100644 index 0000000..b232741 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/CustomerController.java @@ -0,0 +1,137 @@ +package com.yunzhupaas.controller; + +import com.yunzhupaas.base.controller.SuperController; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.entity.CustomerEntity; +import com.yunzhupaas.model.customer.CustomerCrForm; +import com.yunzhupaas.model.customer.CustomerInfoVO; +import com.yunzhupaas.model.customer.CustomerListVO; +import com.yunzhupaas.model.customer.CustomerUpForm; +import com.yunzhupaas.service.CustomerService; +import com.yunzhupaas.util.JsonUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; +import java.util.List; + +/** + * 客户信息 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021-07-10 14:09:05 + */ +@Slf4j +@RestController +@Tag(name = "客户信息", description = "Customer") +@RequestMapping("/api/extend/saleOrder/Customer") +public class CustomerController extends SuperController { + + @Autowired + private CustomerService customerService; + + /** + * 列表 + * + * @param pagination 分页模型 + * @return + */ + @GetMapping + @Operation(summary = "列表") + public ActionResult> list(Pagination pagination) { + pagination.setPageSize(50); + pagination.setCurrentPage(1); + List list = customerService.getList(pagination); + List listVO = JsonUtil.getJsonToList(list, CustomerListVO.class); + PageListVO vo = new PageListVO<>(); + vo.setList(listVO); + return ActionResult.success(vo); + } + + /** + * 创建 + * + * @param customerCrForm 新建模型 + * @return + */ + @PostMapping + @Operation(summary = "创建") + @Parameters({ + @Parameter(name = "customerCrForm", description = "客户模型", required = true), + }) + public ActionResult create(@RequestBody @Valid CustomerCrForm customerCrForm) { + CustomerEntity entity = JsonUtil.getJsonToBean(customerCrForm, CustomerEntity.class); + customerService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 信息 + * + * @param id 主键 + * @return + */ + @GetMapping("/{id}") + @Operation(summary = "信息") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult info(@PathVariable("id") String id) { + CustomerEntity entity = customerService.getInfo(id); + CustomerInfoVO vo = JsonUtil.getJsonToBean(entity, CustomerInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 更新 + * + * @param id 主键 + * @param customerUpForm 修改模型 + * @return + */ + @PutMapping("/{id}") + @Operation(summary = "更新") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "customerUpForm", description = "客户模型", required = true), + }) + public ActionResult update(@PathVariable("id") String id, + @RequestBody @Valid CustomerUpForm customerUpForm) { + CustomerEntity entity = JsonUtil.getJsonToBean(customerUpForm, CustomerEntity.class); + boolean ok = customerService.update(id, entity); + if (ok) { + return ActionResult.success(MsgCode.SU004.get()); + } + return ActionResult.fail(MsgCode.FA002.get()); + } + + /** + * 删除 + * + * @param id 主键 + * @return + */ + @DeleteMapping("/{id}") + @Operation(summary = "删除") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult delete(@PathVariable("id") String id) { + CustomerEntity entity = customerService.getInfo(id); + if (entity != null) { + customerService.delete(entity); + } + return ActionResult.success(MsgCode.SU003.get()); + } + +} diff --git a/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/DocumentController.java b/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/DocumentController.java new file mode 100644 index 0000000..45a240b --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/DocumentController.java @@ -0,0 +1,788 @@ +package com.yunzhupaas.controller; + +import cn.hutool.core.bean.BeanUtil; +import cn.xuyanwu.spring.file.storage.FileInfo; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.Page; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.base.util.OptimizeUtil; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.FileTypeConstant; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.entity.DocumentEntity; +import com.yunzhupaas.entity.DocumentLogEntity; +import com.yunzhupaas.entity.DocumentShareEntity; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.extend.service.DocumentApi; +import com.yunzhupaas.flowable.entity.TaskEntity; +import com.yunzhupaas.flowable.model.task.FileModel; +import com.yunzhupaas.model.MergeChunkDto; +import com.yunzhupaas.model.document.*; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.service.DocumentLogService; +import com.yunzhupaas.service.DocumentService; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.treeutil.SumTree; +import com.yunzhupaas.util.treeutil.newtreeutil.TreeDotUtils; +import com.yunzhupaas.workflow.service.TaskApi; +import lombok.Cleanup; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.io.FileUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 文档管理 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +@Slf4j +@Tag(name = "知识管理", description = "Document") +@RestController +@RequestMapping("/api/extend/Document") +public class DocumentController extends SuperController implements DocumentApi { + + @Autowired + private DocumentService documentService; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private UserService userService; + + @Autowired + private DocumentLogService documentLogService; + @Autowired + private TaskApi taskApi; + + /** + * 列表 + * + * @param id 主键 + * @return + */ + @Operation(summary = "列表") + @GetMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult info(@PathVariable("id") String id) throws DataException { + DocumentEntity entity = documentService.getInfo(id); + DocumentInfoVO vo = JsonUtil.getJsonToBean(entity, DocumentInfoVO.class); + //截取后缀 + String[] fullName = vo.getFullName().split("\\."); + if (fullName.length > 1) { + String fullNames = ""; + for (int i = 0; i < fullName.length - 1; i++) { + if (i > 0) { + fullNames += "." + fullName[i]; + } else { + fullNames += fullName[i]; + } + } + vo.setFullName(fullNames); + } + return ActionResult.success(vo); + } + + /** + * 新建 + * + * @param documentCrForm 新建模型 + * @return + */ + @Operation(summary = "新建") + @PostMapping + @Parameters({ + @Parameter(name = "documentCrForm", description = "知识模型", required = true), + }) + public ActionResult create(@RequestBody @Valid DocumentCrForm documentCrForm) { + DocumentEntity entity = JsonUtil.getJsonToBean(documentCrForm, DocumentEntity.class); + if (documentService.isExistByFullName(documentCrForm.getFullName(), entity.getId(), documentCrForm.getParentId())) { + return ActionResult.fail(MsgCode.EXIST004.get()); + } + entity.setEnabledMark(1); + documentService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 修改 + * + * @param id 主键 + * @param documentUpForm 修改模型 + * @return + */ + @Operation(summary = "修改") + @PutMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "documentUpForm", description = "知识模型", required = true), + }) + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid DocumentUpForm documentUpForm) { + DocumentEntity entity = JsonUtil.getJsonToBean(documentUpForm, DocumentEntity.class); + if (documentService.isExistByFullName(documentUpForm.getFullName(), id, documentUpForm.getParentId())) { + return ActionResult.fail(MsgCode.EXIST004.get()); + } + DocumentEntity info = documentService.getInfo(id); + //获取后缀名 + String[] fullName = info.getFullName().split("\\."); + if (fullName.length > 1) { + entity.setFullName(entity.getFullName() + "." + fullName[fullName.length - 1]); + } + boolean flag = documentService.update(id, entity); + if (flag == false) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除") + @DeleteMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult delete(@PathVariable("id") String id) { + DocumentEntity entity = documentService.getInfo(id); + if (entity != null) { + List allList = documentService.getAllList(entity.getId()); + if (allList.size() > 0) { + return ActionResult.fail(MsgCode.FA016.get()); + } + documentService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + /** + * 列表 + * + * @return + */ + @Operation(summary = "获取知识管理列表(文件夹树)") + @PostMapping("/FolderTree") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult> folderTree(@RequestBody DocumentShareForm form) { + List data = documentService.getFolderList(); + if (StringUtil.isNotEmpty(form.getIds())) { + form.getIds().forEach(t -> data.remove(documentService.getInfo(t))); + } + List treeList = new ArrayList<>(); + DocumentFolderTreeModel model = new DocumentFolderTreeModel(); + model.setId("-1"); + model.setFullName("全部文档"); + model.setParentId("0"); + model.setIcon("0"); + treeList.add(model); + for (DocumentEntity entity : data) { + DocumentFolderTreeModel treeModel = new DocumentFolderTreeModel(); + treeModel.setId(entity.getId()); + treeModel.setFullName(entity.getFullName()); + treeModel.setParentId(entity.getParentId()); + treeModel.setIcon("fa fa-folder"); + treeList.add(treeModel); + } + List> trees = TreeDotUtils.convertListToTreeDotFilter(treeList); + List listVO = JsonUtil.getJsonToList(trees, DocumentFolderTreeVO.class); + ListVO vo = new ListVO(); + vo.setList(listVO); + return ActionResult.success(vo); + } + + /** + * 列表(全部文档) + * + * @param page 分页模型 + * @return + */ + @Operation(summary = "获取知识管理列表(全部文档)") + @GetMapping + public ActionResult> allList(PageDocument page) { + List data = documentService.getAllList(page.getParentId()); + if (StringUtil.isNotEmpty(page.getKeyword())) { + data = documentService.getSearchAllList(page.getKeyword()); + } + List list = JsonUtil.getJsonToList(data, DocumentListVO.class); + //读取允许文件预览类型 + String allowPreviewType = configValueUtil.getAllowPreviewFileType(); + String[] fileType = allowPreviewType.split(","); + for (DocumentListVO documentListVO : list) { + //文件预览类型检验 + String s = Arrays.asList(fileType).stream().filter(type -> type.equals(documentListVO.getFileExtension())).findFirst().orElse(null); + documentListVO.setIsPreview(s); + } + + ListVO vo = new ListVO(); + vo.setList(list); + return ActionResult.success(vo); + } + + /** + * 列表(我的分享) + * + * @param page 分页模型 + * @return + */ + @Operation(summary = "知识管理(我的共享列表)") + @GetMapping("/Share") + public ActionResult> shareOutList(PageDocument page) { + List data = documentService.getShareOutList(); + if (StringUtil.isNotEmpty(page.getKeyword())) { + List dataSearch = new ArrayList<>(); + for (DocumentEntity datum : data) { + if (Objects.equals(datum.getType(), 0)) { + List childList = new ArrayList<>(); + documentService.getChildSrcList(datum.getId(), childList, 1); + List collect = childList.stream().filter(t -> !Objects.equals(t.getType(), 0)).collect(Collectors.toList()); + dataSearch.addAll(collect); + } else { + dataSearch.add(datum); + } + + } + data = dataSearch.stream().distinct().filter(t -> t.getFullName().contains(page.getKeyword())).collect(Collectors.toList()); + } else if (StringUtil.isNotEmpty(page.getParentId()) && !"0".equals(page.getParentId())) { + data = documentService.getAllList(page.getParentId()); + } + List list = JsonUtil.getJsonToList(data, DocumentListVO.class); + ListVO vo = new ListVO(); + vo.setList(list); + return ActionResult.success(vo); + } + + /** + * 列表(共享给我) + * + * @param page 分页模型 + * @return + */ + @Operation(summary = "获取知识管理列表(共享给我)") + @GetMapping("/ShareTome") + public ActionResult> shareTomeList(PageDocument page) { + List shareTomeList = documentService.getShareTomeList(); + List ids = shareTomeList.stream().map(DocumentShareEntity::getDocumentId).collect(Collectors.toList()); + List list = documentService.getInfoByIds(ids); + + List userIds = list.stream().map(t -> t.getCreatorUserId()).collect(Collectors.toList()); + List userNames = userService.getUserName(userIds); + List dataRes = new ArrayList<>(); + if (StringUtil.isNotEmpty(page.getParentId()) && !"0".equals(page.getParentId())) { + list = documentService.getChildList(page.getParentId(), true); + DocumentShareEntity documentShareEntity = documentService.getShareByParentId(page.getParentId()); + for (DocumentEntity item : list) { + DocumentListVO documentListVO = BeanUtil.copyProperties(item, DocumentListVO.class); + if (documentShareEntity != null) { + documentListVO.setShareTime(documentShareEntity.getShareTime()); + UserEntity userEntity = userNames.stream().filter(t -> t.getId().equals(documentShareEntity.getCreatorUserId())).findFirst().orElse(null); + documentListVO.setCreatorUserId(userEntity != null ? userEntity.getRealName() + "/" + userEntity.getAccount() : ""); + } + dataRes.add(documentListVO); + } + } else { + for (DocumentEntity datum : list) { + if (StringUtil.isNotEmpty(page.getKeyword())) { + DocumentShareEntity documentShareEntity = shareTomeList.stream().filter(t -> t.getDocumentId().equals(datum.getId())).findFirst().orElse(null); + if (documentShareEntity != null) { + if (Objects.equals(datum.getType(), 0)) { + List childList = new ArrayList<>(); + documentService.getChildSrcList(datum.getId(), childList, 1); + for (DocumentEntity item : childList) { + DocumentListVO documentListVO = BeanUtil.copyProperties(item, DocumentListVO.class); + if (item.getFullName().contains(page.getKeyword()) && Objects.equals(item.getEnabledMark(), 1) && !Objects.equals(item.getType(), 0)) { + documentListVO.setShareTime(documentShareEntity.getShareTime()); + UserEntity userEntity = userNames.stream().filter(t -> t.getId().equals(documentShareEntity.getCreatorUserId())).findFirst().orElse(null); + documentListVO.setCreatorUserId(userEntity != null ? userEntity.getRealName() + "/" + userEntity.getAccount() : ""); + dataRes.add(documentListVO); + } + } + } + } + } else { + DocumentShareEntity documentShareEntity = shareTomeList.stream().filter(t -> t.getDocumentId().equals(datum.getId())).findFirst().orElse(null); + if (documentShareEntity != null) { + DocumentListVO documentListVO = BeanUtil.copyProperties(datum, DocumentListVO.class); + documentListVO.setShareTime(documentShareEntity.getShareTime()); + UserEntity userEntity = userNames.stream().filter(t -> t.getId().equals(documentShareEntity.getCreatorUserId())).findFirst().orElse(null); + documentListVO.setCreatorUserId(userEntity != null ? userEntity.getRealName() + "/" + userEntity.getAccount() : ""); + dataRes.add(documentListVO); + } + } + } + } + + ListVO vo = new ListVO(); + vo.setList(dataRes); + return ActionResult.success(vo); + } + + /** + * 列表(回收站) + * + * @param page 分页模型 + * @return + */ + @Operation(summary = "获取知识管理列表(回收站)") + @GetMapping("/Trash") + public ActionResult> trashList(Page page) { + List data = documentService.getTrashList(page.getKeyword()); + ListVO vo = new ListVO(); + vo.setList(data); + return ActionResult.success(vo); + } + + /** + * 列表(共享人员) + * + * @param documentId 文档主键 + * @return + */ + @Operation(summary = "获取知识管理列表(共享人员)") + @GetMapping("/ShareUser/{documentId}") + @Parameters({ + @Parameter(name = "documentId", description = "文档主键", required = true), + }) + public ActionResult> shareUserList(@PathVariable("documentId") String documentId) { + List data = documentService.getShareUserList(documentId); + List list = JsonUtil.getJsonToList(data, DocumentSuserListVO.class); + ListVO vo = new ListVO(); + vo.setList(list); + return ActionResult.success(vo); + } + + /** + * app上传文件 + * + * @param documentUploader 上传模型 + * @return + */ + @Operation(summary = "知识管理上传文件") + @PostMapping("/Uploader") + public ActionResult uploader(DocumentUploader documentUploader) throws DataException { + String fileType = UpUtil.getFileType(documentUploader.getFile()); + //验证类型 + if (!OptimizeUtil.fileType(configValueUtil.getAllowUploadFileType(), fileType)) { + return ActionResult.fail(MsgCode.FA017.get()); + } + + //上传 + uploaderVO(documentUploader); + return ActionResult.success(MsgCode.SU015.get()); + } + + /** + * 分片组装 + * + * @param mergeChunkDto 合并模型 + * @return + */ + @Operation(summary = "分片组装") + @PostMapping("/merge") + public ActionResult merge(MergeChunkDto mergeChunkDto) { + String identifier = XSSEscape.escapePath(mergeChunkDto.getIdentifier()); + String path = FileUploadUtils.getLocalBasePath() + configValueUtil.getTemporaryFilePath(); + String filePath = XSSEscape.escapePath(path + identifier); + String partFile = XSSEscape.escapePath(path + mergeChunkDto.getFileName()); + try { + List mergeFileList = FileUtil.getFile(new File(filePath)); + @Cleanup FileOutputStream destTempfos = new FileOutputStream(partFile, true); + for (int i = 0; i < mergeFileList.size(); i++) { + String chunkName = identifier.concat("-") + (i + 1); + File files = new File(filePath, chunkName); + if (files.exists()) { + FileUtils.copyFile(files, destTempfos); + } + } + File partFiles = new File(partFile); + if (partFiles.exists()) { + MultipartFile multipartFile = FileUtil.createFileItem(partFiles); + uploaderVO(new DocumentUploader(multipartFile, mergeChunkDto.getParentId())); + FileUtil.deleteTmp(multipartFile); + } + } catch (Exception e) { + log.error("合并分片失败: {}", e.getMessage()); + throw new DataException(MsgCode.FA033.get()); + } finally { + FileUtils.deleteQuietly(new File(filePath)); + FileUtils.deleteQuietly(new File(partFile)); + } + return ActionResult.success(MsgCode.SU015.get()); + } + + @Operation(summary = "流程归档文件上传接口") + @PostMapping("/UploadBlob") + public ActionResult UploadBlob(DocumentUploader dub) throws DataException { + uploaderVO(dub); + taskApi.updateIsFile(dub.getTaskId()); + return ActionResult.success(MsgCode.SU015.get()); + } + + /** + * 获取下载文件链接 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取下载文件链接") + @PostMapping("/Download/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult download(@PathVariable("id") String id) { + UserInfo userInfo = UserProvider.getUser(); + DocumentEntity entity = documentService.getInfo(id); + if (entity != null) { + String name = entity.getFilePath(); + String fileName = name + "#" + "document#" + entity.getFullName() + "." + entity.getFileExtension(); + DownloadVO vo = DownloadVO.builder().name(entity.getFullName()).url(UploaderUtil.uploaderFile(fileName)).build(); + return ActionResult.success(vo); + } + return ActionResult.fail(MsgCode.FA018.get()); + } + + /** + * 获取全部下载文件链接(打包下载) + * + * @return + */ + @Operation(summary = "打包下载") + @PostMapping("/PackDownload") + public ActionResult packDownloadUrl(@RequestBody DocumentShareForm obj) { + //单个文件直接下载 + if (obj.getIds().size() == 1) { + DocumentEntity entity = documentService.getInfo(obj.getIds().get(0)); + if (entity != null && !Objects.equals(entity.getType(), 0)) { + String name = entity.getFilePath(); + String fileName = name + "#" + "document#" + entity.getFullName() + "." + entity.getFileExtension(); + DownloadVO vo = DownloadVO.builder().name(entity.getFullName()).url(UploaderUtil.uploaderFile(fileName)).build(); + return ActionResult.success(vo); + } + } + String tempFilePath = FileUploadUtils.getLocalBasePath() + FilePathUtil.getFilePath(FileTypeConstant.FILEZIPDOWNTEMPPATH); + String zipFileSrc = "我的文档" + RandomUtil.uuId(); + String zipFileName = zipFileSrc + ".zip"; + String mainPath = tempFilePath + zipFileSrc; + new File(mainPath).mkdirs(); + //递归生成文件夹下的文件 + createdFiles(obj.getIds(), mainPath); + + String filePath = tempFilePath + zipFileName; + //打包 + FileUtil.toZip(filePath, true, tempFilePath + zipFileSrc); + //删除源文件 + FileUtil.deleteFileAll(new File(tempFilePath + zipFileSrc)); + + //上传压缩包到服务器 + MultipartFile multipartFile = FileUtil.createFileItem(new File(XSSEscape.escapePath(filePath))); + FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, FilePathUtil.getFilePath(FileTypeConstant.FILEZIPDOWNTEMPPATH), zipFileName); + // 删除压缩包 + FileUtil.deleteFileAll(new File(tempFilePath + zipFileName)); + + //获取服务器下载路径 + DownloadVO vo = DownloadVO.builder() + .name(zipFileName) + .url(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + FileTypeConstant.FILEZIPDOWNTEMPPATH)) + .build(); + return ActionResult.success(vo); + } + + /** + * 递归获取文件夹下的文件 + * + * @param fileIdList + * @param mainPath + */ + private void createdFiles(List fileIdList, String mainPath) { + for (String id : fileIdList) { + DocumentEntity info = documentService.getInfo(id); + if (info != null) { + String fileId = StringUtil.isNotEmpty(info.getFilePath()) ? XSSEscape.escape(info.getFilePath()).trim() : ""; + String fileName = XSSEscape.escapePath(info.getFullName()).trim(); + if (Objects.equals(info.getType(), 0)) { + //文件夹 + File file = new File(mainPath + "/" + fileName); + if (!file.exists()) { + file.mkdir(); + } + List allList = documentService.getChildList(id, true); + List collect = allList.stream().map(DocumentEntity::getId).collect(Collectors.toList()); + createdFiles(collect, mainPath + "/" + fileName); + } else { + try { + //文件 + byte[] bytes = FileUploadUtils.downloadFileByte(FilePathUtil.getFilePath(FileTypeConstant.DOCUMENT), fileId, false); + FileUtils.writeByteArrayToFile(new File(mainPath + "/" + fileName), bytes); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + } + } + + + /** + * 批量删除 + */ + @Operation(summary = "批量删除") + @PostMapping("/BatchDelete") + @Parameters({ + @Parameter(name = "ids", description = "主键", required = true), + }) + public ActionResult BatchDelete(@RequestBody DocumentShareForm obj) { + for (String id : obj.getIds()) { + DocumentEntity entity = documentService.getInfo(id); + if (entity != null) { + List allList = new ArrayList<>(); + documentService.getChildSrcList(entity.getId(), allList, 1); + allList.add(entity); + //添加删除记录 + DocumentLogEntity logent = new DocumentLogEntity(); + logent.setDocumentId(id); + List collect = allList.stream().map(DocumentEntity::getId).collect(Collectors.toList()); + logent.setChildDocument(collect.stream().collect(Collectors.joining(","))); + documentLogService.save(logent); + for (DocumentEntity item : allList) { + documentService.delete(item); + } + } + } + return ActionResult.success(MsgCode.SU003.get()); + } + + /** + * 回收站(彻底删除) + * + * @return + */ + @Operation(summary = "回收站(彻底删除)") + @PostMapping("/Trash") + @Parameters({ + @Parameter(name = "ids", description = "主键数组", required = true), + }) + public ActionResult trashdelete(@RequestBody DocumentShareForm obj) { + documentService.trashdelete(obj.getIds()); + return ActionResult.success(MsgCode.SU003.get()); + } + + /** + * 回收站(还原文件) + * + * @return + */ + @Operation(summary = "回收站(还原文件)") + @PostMapping("/Trash/Actions/Recovery") + @Parameters({ + @Parameter(name = "ids", description = "主键数组", required = true), + }) + @Transactional + public ActionResult trashRecovery(@RequestBody DocumentShareForm obj) { + documentService.trashRecoveryConstainSrc(obj.getIds()); + return ActionResult.success(MsgCode.SU010.get()); + } + + /** + * 共享文件(创建) + * + * @param documentShareForm 分享模型 + * @return + */ + @Operation(summary = "分享文件/文件夹") + @PostMapping("/Actions/Share") + @Parameters({ + @Parameter(name = "documentShareForm", description = "分享模型", required = true), + }) + public ActionResult shareCreate(@RequestBody DocumentShareForm documentShareForm) { + documentService.sharecreate(documentShareForm); + return ActionResult.success(MsgCode.SU005.get()); + } + + /** + * 取消共享 + * + * @param obj 主键值 + * @return + */ + @Operation(summary = "取消分享文件/文件夹") + @PostMapping("/Actions/CancelShare") + @Parameters({ + @Parameter(name = "ids", description = "主键", required = true), + }) + public ActionResult shareCancel(@RequestBody DocumentShareForm obj) { + documentService.shareCancel(obj.getIds()); + return ActionResult.success(MsgCode.SU005.get()); + } + + + @Operation(summary = "共享用户调整") + @PostMapping("/Actions/ShareAdjustment/{id}") + @Parameters({ + @Parameter(name = "id", description = "文档主键", required = true), + @Parameter(name = "userIds", description = "共享用户组", required = true), + }) + public ActionResult shareAdjustment(@PathVariable("id") String id, @RequestBody DocumentShareForm obj) { + if (obj.getUserIds().size() > 0) { + documentService.shareAdjustment(id, obj.getUserIds()); + } + return ActionResult.success(MsgCode.SU005.get()); + } + + @Operation(summary = "移动文件/文件夹") + @PutMapping("/Actions/MoveTo/{toId}") + @Parameters({ + @Parameter(name = "ids", description = "主键", required = true), + @Parameter(name = "toId", description = "将要移动到Id", required = true), + }) + @Transactional + public ActionResult moveTo(@RequestBody DocumentShareForm obj, @PathVariable("toId") String toId) { + List allIds = new ArrayList<>(); + allIds.addAll(obj.getIds()); + List childList = new ArrayList<>(); + for (String oneId : obj.getIds()) { + documentService.getChildSrcList(oneId, childList, 1); + } + allIds.addAll(childList.stream().map(DocumentEntity::getId).collect(Collectors.toList())); + if (allIds.contains(toId)) { + return ActionResult.fail(MsgCode.ETD103.get()); + } + + for (String id : obj.getIds()) { + boolean flag = documentService.moveTo(id, toId); + if (flag == false) { + return ActionResult.fail(MsgCode.FA002.get()); + } + } + + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 封装上传附件 + * 流程归档-文件上传 + * + * @return + */ + private void uploaderVO(DocumentUploader documentUploader) { + MultipartFile file = documentUploader.getFile(); + String parentId = documentUploader.getParentId(); + String taskId = documentUploader.getTaskId(); + String fileName = StringUtil.isNotEmpty(documentUploader.getTaskId()) ? documentUploader.getTaskId() : + StringUtil.isNotEmpty(documentUploader.getFileName()) ? documentUploader.getFileName() : file.getOriginalFilename(); + String fileType = UpUtil.getFileType(file); + String creatorUserId = ""; + List userList = new ArrayList<>(); + if (StringUtil.isNotEmpty(taskId)) { + try { //获取流程信息 + FileModel fileModel = taskApi.getFileModel(taskId); + fileName = fileModel.getFilename(); + creatorUserId = fileModel.getUserId(); + userList.addAll(fileModel.getUserList()); + fileType = "pdf"; + + List allList = documentService.getAllList("0", creatorUserId); + DocumentEntity documentEntity = allList.stream().filter(t -> Objects.equals(t.getType(), 0) && FileModel.FOLDER_NAME.equals(t.getFullName())).findFirst().orElse(null); + if (Objects.isNull(documentEntity)) { + documentEntity = new DocumentEntity(); + documentEntity.setFullName(FileModel.FOLDER_NAME); + documentEntity.setType(0); + documentEntity.setParentId("0"); + documentEntity.setCreatorUserId(creatorUserId); + documentService.create(documentEntity); + } + parentId = documentEntity.getId(); + } catch (Exception e) { + throw new DataException(MsgCode.FA001.get()); + } + } + + String filePath = configValueUtil.getDocumentFilePath(); + List data = documentService.getAllList(parentId); + String finalFileName = fileName; + data = data.stream().filter(t -> finalFileName.equals(t.getFullName())).collect(Collectors.toList()); + if (data.size() > 0) { + fileName = fileName.substring(0, fileName.lastIndexOf(".")) + "副本" + UUID.randomUUID().toString().substring(0, 5) + fileName.substring(fileName.lastIndexOf(".")); + } + //上传 + FileInfo fileInfo = null; + try { + fileInfo = FileUploadUtils.uploadFile(file.getBytes(), filePath, fileName); + } catch (IOException e) { + throw new DataException(MsgCode.FA033.get()); + } + DocumentEntity entity = new DocumentEntity(); + entity.setType(1); + entity.setFullName(fileName); + entity.setParentId(parentId); + entity.setFileExtension(fileType); + entity.setFilePath(fileInfo.getFilename()); + entity.setFileSize(String.valueOf(file.getSize())); + entity.setCreatorUserId(creatorUserId); + entity.setEnabledMark(1); + String desc = null; + TaskEntity taskEntity = taskApi.getInfoSubmit(taskId, TaskEntity::getId, TaskEntity::getTemplateId); + if (null != taskEntity) { + desc = taskId + "-" + taskEntity.getTemplateId(); + } + entity.setDescription(desc); + entity.setUploaderUrl(UploaderUtil.uploaderImg("/api/file/Image/document/", fileInfo.getFilename())); + documentService.create(entity); + if (StringUtil.isNotEmpty(taskId)) { + DocumentShareForm documentShareForm = new DocumentShareForm(); + documentShareForm.setUserIds(userList); + documentShareForm.setIds(new ArrayList() {{ + add(entity.getId()); + }}); + documentShareForm.setCreatorUserId(creatorUserId); + documentService.sharecreate(documentShareForm); + } + } + + /** + * 判断是否存在归档文件 + * + * @param taskId 流程任务主键 + */ + public Boolean checkFlowFile(String taskId) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().like(DocumentEntity::getDescription, taskId); + return documentService.count(wrapper) < 1; + } + + /** + * 获取归档文件 + * + * @param model 参数 + */ + public List> getFlowFile(FlowFileModel model) { + return documentService.getFlowFile(model); + } +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/DocumentPreviewController.java b/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/DocumentPreviewController.java new file mode 100644 index 0000000..539b402 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/DocumentPreviewController.java @@ -0,0 +1,128 @@ +package com.yunzhupaas.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; + +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.util.NoDataSourceBind; +import com.yunzhupaas.base.Page; +import com.yunzhupaas.config.ConfigValueUtil; + +import com.yunzhupaas.enums.FilePreviewTypeEnum; +import com.yunzhupaas.exception.DataException; + +import com.yunzhupaas.model.YozoFileParams; +import com.yunzhupaas.model.YozoParams; +import com.yunzhupaas.model.FileListVO; +import com.yunzhupaas.util.*; +import com.yunzhupaas.utils.SplicingUrlUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * 文档在线预览 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +@NoDataSourceBind() +@Tag(name = "文档在线预览", description = "DocumentPreview") +@RestController +@RequestMapping("/api/extend/DocumentPreview") +public class DocumentPreviewController { + + @Autowired + private ConfigValueUtil configValueUtil; + + /** + * 永中文件预览 + * + * @param fileId 文件主键 + * @param params 永中模型 + * @param previewType 类型 + * @return + */ + @Operation(summary = "文件预览") + @GetMapping("/{fileId}/Preview") + @Parameters({ + @Parameter(name = "fileId", description = "文件主键", required = true), + @Parameter(name = "previewType", description = "类型"), + }) + @SaCheckPermission("extend.documentPreview") + public ActionResult filePreview(@PathVariable("fileId") String fileId, YozoFileParams params, + @RequestParam("previewType") String previewType) { + FileListVO fileListVO = FileUploadUtils.getFileDetail(configValueUtil.getDocumentPreviewPath(), fileId); + if (fileListVO == null) { + return ActionResult.fail(MsgCode.ETD111.get()); + } + if (fileListVO.getFileName() != null) { + String[] split = fileListVO.getFileName().split("/"); + if (split.length > 0) { + fileListVO.setFileName(split[split.length - 1]); + } + } + String url = YozoParams.YUNZHUPAAS_DOMAINS + "/api/extend/DocumentPreview/down/" + fileListVO.getFileName(); + String urlPath; + if (previewType.equals(FilePreviewTypeEnum.YOZO_ONLINE_PREVIEW.getType())) { + params.setUrl(url); + urlPath = SplicingUrlUtil.getPreviewUrl(params); + return ActionResult.success("success", XSSEscape.escape(urlPath)); + } + return ActionResult.success("success", url); + } + + /** + * 列表 + * + * @param page 分页模型 + * @return + */ + @Operation(summary = "获取文档列表") + @GetMapping + @SaCheckPermission("extend.documentPreview") + public ActionResult> list(Page page) { + List fileList = FileUploadUtils.getFileList(configValueUtil.getDocumentPreviewPath()); + fileList.stream().forEach(t -> { + if (t.getFileName() != null) { + String[] split = t.getFileName().split("/"); + if (split.length > 0) { + t.setFileName(split[split.length - 1]); + } + } + }); + if (StringUtil.isNotEmpty(page.getKeyword())) { + fileList = fileList.stream().filter(t -> t.getFileName().contains(page.getKeyword())) + .collect(Collectors.toList()); + } + return ActionResult.success(fileList); + } + + /** + * 文件下载url + * + * @param fileName 名称 + */ + @NoDataSourceBind() + @GetMapping("/down/{fileName}") + @Parameters({ + @Parameter(name = "fileName", description = "名称", required = true), + }) + public void pointDown(@PathVariable("fileName") String fileName) throws DataException { + boolean exists = FileUploadUtils.exists(configValueUtil.getDocumentPreviewPath(), fileName); + if (!exists) { + throw new DataException(MsgCode.FA006.get()); + } + byte[] bytes = FileUploadUtils.downloadFileByte(configValueUtil.getDocumentPreviewPath(), fileName, false); + FileDownloadUtil.downloadFile(bytes, fileName, null); + } + +} diff --git a/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/EmailController.java b/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/EmailController.java new file mode 100644 index 0000000..00d7938 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/EmailController.java @@ -0,0 +1,353 @@ +package com.yunzhupaas.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.model.MailAccount; +import com.yunzhupaas.base.util.Pop3Util; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.base.service.SysconfigService; +import com.yunzhupaas.base.entity.EmailConfigEntity; +import com.yunzhupaas.base.entity.EmailReceiveEntity; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.entity.EmailSendEntity; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.model.email.*; +import com.yunzhupaas.service.EmailReceiveService; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.JsonUtilEx; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; +import java.util.List; + +/** + * 邮件配置 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +@Tag(name = "邮件收发", description = "Email") +@RestController +@RequestMapping("/api/extend/Email") +public class EmailController { + + @Autowired + private EmailReceiveService emailReceiveService; + @Autowired + private Pop3Util pop3Util; + @Autowired + private SysconfigService sysconfigService; + + /** + * 获取邮件列表(收件箱、标星件、草稿箱、已发送) + * + * @param paginationEmail 分页模型 + * @return + */ + @Operation(summary = "获取邮件列表(收件箱、标星件、草稿箱、已发送)") + @GetMapping + @SaCheckPermission("extend.email") + public ActionResult receiveList(PaginationEmail paginationEmail) { + String type = paginationEmail.getType() != null ? paginationEmail.getType() : "inBox"; + switch (type) { + case "inBox": + List entity = emailReceiveService.getReceiveList(paginationEmail); + PaginationVO paginationVO = JsonUtil.getJsonToBean(paginationEmail, PaginationVO.class); + List listVO = JsonUtil.getJsonToList(entity, EmailReceiveListVO.class); + return ActionResult.page(listVO,paginationVO); + case "star": + List entity1 = emailReceiveService.getStarredList(paginationEmail); + PaginationVO paginationVo1 = JsonUtil.getJsonToBean(paginationEmail, PaginationVO.class); + List listVo1 = JsonUtil.getJsonToList(entity1, EmailStarredListVO.class); + return ActionResult.page(listVo1,paginationVo1); + case "draft": + List entity2 = emailReceiveService.getDraftList(paginationEmail); + PaginationVO paginationVo2 = JsonUtil.getJsonToBean(paginationEmail, PaginationVO.class); + List listVo2 = JsonUtil.getJsonToList(entity2, EmailDraftListVO.class); + return ActionResult.page(listVo2,paginationVo2); + case "sent": + List entity3 = emailReceiveService.getSentList(paginationEmail); + PaginationVO paginationVo3 = JsonUtil.getJsonToBean(paginationEmail, PaginationVO.class); + List listVo3 = JsonUtil.getJsonToList(entity3, EmailSentListVO.class); + return ActionResult.page(listVo3,paginationVo3); + default: + return ActionResult.fail(MsgCode.ETD106.get()); + } + } + + /** + * 获取邮箱配置 + * + * @return + */ + @Operation(summary = "获取邮箱配置") + @GetMapping("/Config") + @SaCheckPermission("extend.email") + public ActionResult configInfo() { + EmailConfigEntity entity = emailReceiveService.getConfigInfo(); + EmailCofigInfoVO vo = JsonUtil.getJsonToBean(entity, EmailCofigInfoVO.class); + if(vo==null){ + vo=new EmailCofigInfoVO(); + } + return ActionResult.success(vo); + } + + /** + * 获取邮件信息 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取邮件信息") + @GetMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键",required = true), + }) + @SaCheckPermission("extend.email") + public ActionResult info(@PathVariable("id") String id) throws DataException { + Object entity = emailReceiveService.getInfo(id); + EmailInfoVO vo = JsonUtil.getJsonToBeanEx(entity, EmailInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 删除 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除邮件") + @DeleteMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键",required = true), + }) + @SaCheckPermission("extend.email") + public ActionResult delete(@PathVariable("id") String id) { + boolean flag= emailReceiveService.delete(id); + if(flag==false){ + return ActionResult.fail(MsgCode.FA003.get()); + } + return ActionResult.success(MsgCode.SU003.get()); + } + + /** + * 设置已读邮件 + * + * @param id 主键 + * @return + */ + @Operation(summary = "设置已读邮件") + @PutMapping("/{id}/Actions/Read") + @Parameters({ + @Parameter(name = "id", description = "主键",required = true), + }) + @SaCheckPermission("extend.email") + public ActionResult receiveRead(@PathVariable("id") String id) { + boolean flag= emailReceiveService.receiveRead(id, 1); + if(flag==false){ + return ActionResult.fail(MsgCode.FA007.get()); + } + return ActionResult.success(MsgCode.SU005.get()); + } + + /** + * 设置未读邮件 + * + * @param id 主键 + * @return + */ + @Operation(summary = "设置未读邮件") + @PutMapping("/{id}/Actions/Unread") + @Parameters({ + @Parameter(name = "id", description = "主键",required = true), + }) + @SaCheckPermission("extend.email") + public ActionResult receiveUnread(@PathVariable("id") String id) { + boolean flag= emailReceiveService.receiveRead(id, 0); + if(flag==false){ + return ActionResult.fail(MsgCode.FA007.get()); + } + return ActionResult.success(MsgCode.SU005.get()); + } + + /** + * 设置星标邮件 + * + * @param id 主键 + * @return + */ + @Operation(summary = "设置星标邮件") + @PutMapping("/{id}/Actions/Star") + @Parameters({ + @Parameter(name = "id", description = "主键",required = true), + }) + @SaCheckPermission("extend.email") + public ActionResult receiveYesStarred(@PathVariable("id") String id) { + boolean flag= emailReceiveService.receiveStarred(id, 1); + if(flag==false){ + return ActionResult.fail(MsgCode.FA007.get()); + } + return ActionResult.success(MsgCode.SU005.get()); + } + + /** + * 设置取消星标 + * + * @param id 主键 + * @return + */ + @Operation(summary = "设置取消星标") + @PutMapping("/{id}/Actions/Unstar") + @Parameters({ + @Parameter(name = "id", description = "主键",required = true), + }) + @SaCheckPermission("extend.email") + public ActionResult receiveNoStarred(@PathVariable("id") String id) { + boolean flag= emailReceiveService.receiveStarred(id, 0); + if(flag==false){ + return ActionResult.fail(MsgCode.FA007.get()); + } + return ActionResult.success(MsgCode.SU005.get()); + } + + /** + * 收邮件 + * + * @return + */ + @Operation(summary = "收邮件") + @PostMapping("/Receive") + @SaCheckPermission("extend.email") + public ActionResult receive() { + EmailConfigEntity configEntity = emailReceiveService.getConfigInfo(); + if (configEntity != null) { + MailAccount mailAccount = new MailAccount(); + mailAccount.setAccount(configEntity.getAccount()); + mailAccount.setPassword(configEntity.getPassword()); + mailAccount.setPop3Host(configEntity.getPop3Host()); + mailAccount.setPop3Port(configEntity.getPop3Port()); + mailAccount.setSmtpHost(configEntity.getSmtpHost()); + mailAccount.setSmtpPort(configEntity.getSmtpPort()); + if ("1".equals(String.valueOf(configEntity.getEmailSsl()))) { + mailAccount.setSsl(true); + } else { + mailAccount.setSsl(false); + } + String checkResult=pop3Util.checkConnected(mailAccount); + if ("true".equals(checkResult)) { + int mailCount = emailReceiveService.receive(configEntity); + return ActionResult.success(MsgCode.SU005.get(), mailCount); + } else { + return ActionResult.fail(MsgCode.ETD107.get()); + } + } else { + return ActionResult.fail(MsgCode.ETD108.get()); + } + } + + /** + * 存草稿 + * + * @param emailSendCrForm 邮件模型 + * @return + */ + @Operation(summary = "存草稿") + @PostMapping("/Actions/SaveDraft") + @Parameters({ + @Parameter(name = "emailSendCrForm", description = "邮件模型",required = true), + }) + @SaCheckPermission("extend.email") + public ActionResult saveDraft(@RequestBody @Valid EmailSendCrForm emailSendCrForm) { + EmailSendEntity entity = JsonUtil.getJsonToBean(emailSendCrForm, EmailSendEntity.class); + emailReceiveService.saveDraft(entity); + return ActionResult.success(MsgCode.SU002.get()); + } + + /** + * 发邮件 + * + * @param emailCrForm 发送邮件模型 + * @return + */ + @Operation(summary = "发邮件") + @PostMapping + @Parameters({ + @Parameter(name = "emailCrForm", description = "发送邮件模型",required = true), + }) + @SaCheckPermission("extend.email") + public ActionResult saveSent(@RequestBody @Valid EmailCrForm emailCrForm) { + EmailSendEntity entity = JsonUtil.getJsonToBean(emailCrForm, EmailSendEntity.class); + EmailConfigEntity configEntity = emailReceiveService.getConfigInfo(); + if (configEntity != null) { + MailAccount mailAccount = new MailAccount(); + mailAccount.setAccount(configEntity.getAccount()); + mailAccount.setPassword(configEntity.getPassword()); + mailAccount.setPop3Host(configEntity.getPop3Host()); + mailAccount.setPop3Port(configEntity.getPop3Port()); + mailAccount.setSmtpHost(configEntity.getSmtpHost()); + mailAccount.setSmtpPort(configEntity.getSmtpPort()); + if ("1".equals(String.valueOf(configEntity.getEmailSsl()))) { + mailAccount.setSsl(true); + } else { + mailAccount.setSsl(false); + } + int flag = emailReceiveService.saveSent(entity, configEntity); + if (flag == 0) { + return ActionResult.success(MsgCode.SU012.get()); + } else { + return ActionResult.fail(MsgCode.ETD107.get()); + } + } else { + return ActionResult.fail(MsgCode.ETD108.get()); + } + } + + /** + * 更新邮件配置 + * + * @param emailCheckForm 邮件配置模型 + * @return + */ + @Operation(summary = "更新邮件配置") + @PutMapping("/Config") + @Parameters({ + @Parameter(name = "emailCheckForm", description = "邮件配置模型",required = true), + }) + @SaCheckPermission("extend.email") + public ActionResult saveConfig(@RequestBody @Valid EmailCheckForm emailCheckForm) throws DataException { + EmailConfigEntity entity = JsonUtil.getJsonToBean(emailCheckForm, EmailConfigEntity.class); + emailReceiveService.saveConfig(entity); + return ActionResult.success(MsgCode.SU002.get()); + } + + /** + * 邮箱配置-测试连接 + * + * @param emailCheckForm 邮件配置模型 + * @return + */ + @Operation(summary = "邮箱配置-测试连接") + @PostMapping("/Config/Actions/CheckMail") + @Parameters({ + @Parameter(name = "emailCheckForm", description = "邮件配置模型",required = true), + }) + @SaCheckPermission("extend.email") + public ActionResult checkLogin(@RequestBody @Valid EmailCheckForm emailCheckForm) { + EmailConfigEntity entity = JsonUtil.getJsonToBean(emailCheckForm, EmailConfigEntity.class); + String result = sysconfigService.checkLogin(entity); + if ("true".equals(result)) { + return ActionResult.success(MsgCode.SU017.get()); + } else { + return ActionResult.fail(MsgCode.ETD107.get()); + } + } + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/EmployeeController.java b/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/EmployeeController.java new file mode 100644 index 0000000..a1f9600 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/EmployeeController.java @@ -0,0 +1,519 @@ +package com.yunzhupaas.controller; + +import cn.afterturn.easypoi.excel.ExcelExportUtil; +import cn.afterturn.easypoi.excel.entity.ExportParams; +import cn.afterturn.easypoi.excel.entity.TemplateExportParams; +import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; +import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; +import cn.xuyanwu.spring.file.storage.FileInfo; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.entity.EmployeeEntity; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.exception.ImportException; +import com.yunzhupaas.model.EmployeeModel; +import com.yunzhupaas.model.employee.*; +import com.yunzhupaas.service.EmployeeService; +import com.yunzhupaas.util.*; +import lombok.Cleanup; +import lombok.extern.slf4j.Slf4j; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.JsonUtilEx; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.Workbook; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import jakarta.validation.Valid; +import java.io.ByteArrayInputStream; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 职员信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Slf4j +@Tag(name = "职员信息", description = "Employee") +@RestController +@RequestMapping("/api/extend/Employee") +public class EmployeeController extends SuperController { + + @Autowired + private EmployeeService employeeService; + @Autowired + private ConfigValueUtil configValueUtil; + + /** + * 列表(忽略验证Token) + * + * @param paginationEmployee 分页模型 + * @return + */ + @Operation(summary = "获取职员列表") + @GetMapping + public ActionResult> getList(PaginationEmployee paginationEmployee) { + List data = employeeService.getList(paginationEmployee); + List list = JsonUtil.getJsonToList(data, EmployeeListVO.class); + PaginationVO paginationVO = JsonUtil.getJsonToBean(paginationEmployee, PaginationVO.class); + return ActionResult.page(list, paginationVO); + } + + /** + * 信息 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取职员信息") + @GetMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult info(@PathVariable("id") String id) throws DataException { + EmployeeEntity entity = employeeService.getInfo(id); + EmployeeInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, EmployeeInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 新建 + * + * @param employeeCrForm 职工模型 + * @return + */ + @Operation(summary = "app添加职员信息") + @PostMapping + @Parameters({ + @Parameter(name = "employeeCrForm", description = "职工模型", required = true), + }) + public ActionResult create(@RequestBody @Valid EmployeeCrForm employeeCrForm) { + EmployeeEntity entity = JsonUtil.getJsonToBean(employeeCrForm, EmployeeEntity.class); + employeeService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 更新 + * + * @param id 主键 + * @param employeeUpForm 职工模型 + * @return + */ + @Operation(summary = "app修改职员信息") + @PutMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "employeeUpForm", description = "职工模型", required = true), + }) + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid EmployeeUpForm employeeUpForm) { + EmployeeEntity entity = JsonUtil.getJsonToBean(employeeUpForm, EmployeeEntity.class); + employeeService.update(id, entity); + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除职员信息") + @DeleteMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult delete(@PathVariable("id") String id) { + EmployeeEntity entity = employeeService.getInfo(id); + if (entity != null) { + employeeService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + /** + * 模板下载 + * + * @return + */ + @Operation(summary = "模板下载") + @GetMapping("/TemplateDownload") + public ActionResult templateDownload() { + DownloadVO vo = DownloadVO.builder().build(); + try { + vo.setName("职员信息.xlsx"); + vo.setUrl(UploaderUtil.uploaderFile("/api/file/DownloadModel?encryption=", "职员信息" + + ".xlsx" + "#" + "Temporary")); + } catch (Exception e) { + log.error("信息导出Excel错误:{}", e.getMessage()); + } + return ActionResult.success(vo); + } + + /** + * 导出Excel + * + * @return + */ + @Operation(summary = "导出 Excel") + @GetMapping("/ExportExcel") + @SuppressWarnings("unchecked") + public ActionResult exportExcel() { + List entityList = employeeService.getList(); + String jsonString = JsonUtilEx.getObjectToStringDateFormat(entityList, "yyyy-MM-dd"); + List list = (List) (List) JsonUtil + .listToJsonField(JsonUtil.getJsonToList(jsonString, EmployeeExportVO.class)); + List entitys = new ArrayList<>(); + entitys.add(new ExcelExportEntity("工号", "enCode")); + entitys.add(new ExcelExportEntity("姓名", "fullName")); + entitys.add(new ExcelExportEntity("性别", "gender")); + entitys.add(new ExcelExportEntity("部门", "departmentName")); + entitys.add(new ExcelExportEntity("职务", "positionName", 25)); + entitys.add(new ExcelExportEntity("用工性质", "workingNature")); + entitys.add(new ExcelExportEntity("身份证号", "idNumber", 25)); + entitys.add(new ExcelExportEntity("联系电话", "telephone", 20)); + entitys.add(new ExcelExportEntity("出生年月", "birthday", 20)); + entitys.add(new ExcelExportEntity("参加工作", "attendWorkTime", 20)); + entitys.add(new ExcelExportEntity("最高学历", "education")); + entitys.add(new ExcelExportEntity("所学专业", "major")); + entitys.add(new ExcelExportEntity("毕业院校", "graduationAcademy")); + entitys.add(new ExcelExportEntity("毕业时间", "graduationTime", 20)); + ExportParams exportParams = new ExportParams(null, "职员信息"); + exportParams.setType(ExcelType.XSSF); + DownloadVO vo = DownloadVO.builder().build(); + try { + @Cleanup + Workbook workbook = new HSSFWorkbook(); + if (entitys.size() > 0) { + workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list); + } + String name = "职员信息" + DateUtil.dateNow("yyyyMMdd") + "_" + RandomUtil.uuId() + ".xlsx"; + String fileName = configValueUtil.getTemporaryFilePath() + name; + @Cleanup + FileOutputStream output = new FileOutputStream(XSSEscape.escapePath(fileName)); + workbook.write(output); + vo.setName(name); + vo.setUrl(UploaderUtil.uploaderFile(name + "#" + "Temporary")); + } catch (Exception e) { + log.error("信息导出Excel错误:{}", e.getMessage()); + } + return ActionResult.success(vo); + } + + /** + * 导出Word + * + * @return + */ + @Operation(summary = "导出Word") + @GetMapping("/ExportWord") + public ActionResult exportWord() { + List list = employeeService.getList(); + // 模板文件地址 + String inputUrl = configValueUtil.getTemplateFilePath() + "employee_export_template.docx"; + // 新生产的模板文件 + String name = "职员信息" + DateUtil.dateNow("yyyyMMdd") + "_" + RandomUtil.uuId() + ".docx"; + String outputUrl = configValueUtil.getTemporaryFilePath() + name; + List testList = new ArrayList<>(); + Map testMap = new HashMap<>(); + for (int i = 0; i < list.size(); i++) { + String[] employee = new String[13]; + EmployeeEntity entity = list.get(i); + employee[0] = entity.getFullName(); + employee[1] = entity.getGender(); + employee[2] = entity.getDepartmentName(); + employee[3] = entity.getPositionName(); + employee[4] = entity.getWorkingNature(); + employee[5] = entity.getIdNumber(); + employee[6] = entity.getTelephone(); + employee[7] = entity.getBirthday() != null ? DateUtil.daFormat(entity.getBirthday()) : ""; + employee[8] = entity.getAttendWorkTime() != null ? DateUtil.daFormat(entity.getAttendWorkTime()) : ""; + employee[9] = entity.getEducation(); + employee[10] = entity.getMajor(); + employee[11] = entity.getGraduationAcademy(); + employee[12] = entity.getGraduationTime() != null ? DateUtil.daFormat(entity.getGraduationTime()) : ""; + testList.add(employee); + } + WordUtil.changWord(inputUrl, outputUrl, testMap, testList); + if (FileUtil.fileIsFile(outputUrl)) { + DownloadVO vo = DownloadVO.builder().name(name).url(UploaderUtil.uploaderFile(name + "#" + "Temporary")) + .build(); + return ActionResult.success(vo); + } + return ActionResult.success(MsgCode.ETD109.get()); + } + + /** + * 导出pdf + * + * @return + */ + @Operation(summary = "导出pdf") + @GetMapping("/ExportPdf") + public ActionResult exportPdf() { + String name = "职员信息" + DateUtil.dateNow("yyyyMMdd") + "_" + RandomUtil.uuId() + ".pdf"; + String outputUrl = FileUploadUtils.getLocalBasePath() + configValueUtil.getTemporaryFilePath() + name; + employeeService.exportPdf(employeeService.getList(), outputUrl); + if (FileUtil.fileIsFile(outputUrl)) { + DownloadVO vo = DownloadVO.builder().name(name).url(UploaderUtil.uploaderFile(name + "#" + "Temporary")) + .build(); + return ActionResult.success(vo); + } + return ActionResult.success(MsgCode.ETD109.get()); + } + + /** + * 导出Excel + * + * @return + */ + @Operation(summary = "导出Excel(备用)") + @GetMapping("/Excel") + public void excel() { + Map map = new HashMap<>(); + List list = employeeService.getList(); + TemplateExportParams param = new TemplateExportParams( + configValueUtil.getTemplateFilePath() + "employee_import_template.xlsx", true); + map.put("Employee", JSON.parse(JSONObject.toJSONStringWithDateFormat(list, "yyyy-MM-dd"))); + Workbook workbook = ExcelExportUtil.exportExcel(param, map); + ExcelUtil.dowloadExcel(workbook, "职员信息.xlsx"); + } + + /** + * 上传文件(excel) + * + * @return + */ + @Operation(summary = "上传文件") + @PostMapping("/Uploader") + public ActionResult uploader() { + List list = UpUtil.getFileAll(); + MultipartFile file = list.get(0); + if (file.getOriginalFilename().endsWith(".xlsx") || file.getOriginalFilename().endsWith(".xls")) { + String filePath = configValueUtil.getTemporaryFilePath(); + String fileName = RandomUtil.uuId() + "." + UpUtil.getFileType(file); + fileName = XSSEscape.escape(fileName); + // 上传文件 + FileInfo fileInfo = FileUploadUtils.uploadFile(file, filePath, fileName); + // FileUtil.upFile(file, filePath, fileName); + DownloadVO vo = DownloadVO.builder().build(); + vo.setName(fileInfo.getFilename()); + return ActionResult.success(vo); + } else { + return ActionResult.fail(MsgCode.ETD110.get()); + } + + } + + /** + * 导入预览 + * + * @param fileName 文件名称 + * @return + */ + @Operation(summary = "导入预览") + @GetMapping("/ImportPreview") + @Parameters({ + @Parameter(name = "fileName", description = "文件名称"), + }) + public ActionResult importPreview(@RequestParam("fileName") String fileName) throws ImportException { + Map map = new HashMap<>(); + try { + String filePath = configValueUtil.getTemporaryFilePath(); + @Cleanup + InputStream inputStream = new ByteArrayInputStream( + FileUploadUtils.downloadFileByte(filePath, fileName, false)); + // 得到数据 + List personList = ExcelUtil.importExcelByInputStream(inputStream, 0, 1, EmployeeModel.class); + // 预览数据 + map = employeeService.importPreview(personList); + } catch (Exception e) { + log.error(e.getMessage()); + throw new ImportException(e.getMessage()); + } + return ActionResult.success(map); + } + + /** + * 导入数据 + * + * @param data 职工模型 + * @return + */ + @Operation(summary = "导入数据") + @PostMapping("/ImportData") + @Parameters({ + @Parameter(name = "data", description = "职工模型"), + }) + public ActionResult importData(@RequestBody EmployeeModel data) throws Exception { + List dataList = new ArrayList<>(); + if (data.isType()) { + ActionResult result = importPreview(data.getFileName()); + if (result == null) { + throw new Exception(MsgCode.FA018.get()); + } + if (result.getCode() != 200) { + throw new Exception(result.getMsg()); + } + if (result.getData() instanceof Map) { + Map dataMap = (Map) result.getData(); + dataList = JsonUtil.getJsonToList(dataMap.get("dataRow"), EmployeeModel.class); + } + } else { + dataList = data.getList(); + } + // 导入数据 + EmployeeImportVO result = employeeService.importData(dataList); + return ActionResult.success(result); + } + + /** + * 导出 Excel(可选字段) + * + * @param paginationEmployee 分页模型 + * @return + */ + @Operation(summary = "导出 Excel(可选字段)") + @GetMapping("/ExportData") + @SuppressWarnings("unchecked") + public ActionResult exportExcelData(PaginationEmployee paginationEmployee) { + String dataType = paginationEmployee.getDataType(); + String selectKey = paginationEmployee.getSelectKey(); + List entityList = new ArrayList<>(); + if ("0".equals(dataType)) { + entityList = employeeService.getList(paginationEmployee); + } else if ("1".equals(dataType)) { + entityList = employeeService.getList(); + } + List modeList = new ArrayList<>(); + for (EmployeeEntity employeeEntity : entityList) { + EmployeeModel mode = new EmployeeModel(); + mode.setEnCode(employeeEntity.getEnCode()); + mode.setFullName(employeeEntity.getFullName()); + mode.setGender(employeeEntity.getGender()); + mode.setDepartmentName(employeeEntity.getDepartmentName()); + mode.setPositionName(employeeEntity.getPositionName()); + mode.setWorkingNature(employeeEntity.getWorkingNature()); + mode.setIdNumber(employeeEntity.getIdNumber()); + mode.setTelephone(employeeEntity.getTelephone()); + SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd"); + if (employeeEntity.getBirthday() != null) { + String birthday = sf.format(employeeEntity.getBirthday()); + mode.setBirthday(birthday); + } + if (employeeEntity.getAttendWorkTime() != null) { + String attendWorkTime = sf.format(employeeEntity.getAttendWorkTime()); + mode.setAttendWorkTime(attendWorkTime); + } + mode.setEducation(employeeEntity.getEducation()); + mode.setMajor(employeeEntity.getMajor()); + mode.setGraduationAcademy(employeeEntity.getGraduationAcademy()); + if (employeeEntity.getGraduationTime() != null) { + String graduationTime = sf.format(employeeEntity.getGraduationTime()); + mode.setGraduationTime(graduationTime); + } + SimpleDateFormat sf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm"); + if (employeeEntity.getCreatorTime() != null) { + String creatorTime = sf1.format(employeeEntity.getCreatorTime()); + mode.setCreatorTime(creatorTime); + } + modeList.add(mode); + } + String jsonString = JsonUtilEx.getObjectToStringDateFormat(modeList, "yyyy-MM-dd"); + List list = (List) (List) JsonUtil + .listToJsonField(JsonUtil.getJsonToList(jsonString, EmployeeExportVO.class)); + List entitys = new ArrayList<>(); + String[] splitData = selectKey.split(","); + if (splitData != null && splitData.length > 0) { + for (int i = 0; i < splitData.length; i++) { + if ("enCode".equals(splitData[i])) { + entitys.add(new ExcelExportEntity("工号", "enCode")); + } + if ("fullName".equals(splitData[i])) { + entitys.add(new ExcelExportEntity("姓名", "fullName")); + } + if ("gender".equals(splitData[i])) { + entitys.add(new ExcelExportEntity("性别", "gender")); + } + if ("departmentName".equals(splitData[i])) { + entitys.add(new ExcelExportEntity("部门", "departmentName")); + } + if ("positionName".equals(splitData[i])) { + entitys.add(new ExcelExportEntity("职务", "positionName", 25)); + } + if ("workingNature".equals(splitData[i])) { + entitys.add(new ExcelExportEntity("用工性质", "workingNature")); + } + if ("idNumber".equals(splitData[i])) { + entitys.add(new ExcelExportEntity("身份证号", "idNumber", 25)); + } + if ("telephone".equals(splitData[i])) { + entitys.add(new ExcelExportEntity("联系电话", "telephone", 20)); + } + if ("birthday".equals(splitData[i])) { + entitys.add(new ExcelExportEntity("出生年月", "birthday", 20)); + } + if ("attendWorkTime".equals(splitData[i])) { + entitys.add(new ExcelExportEntity("参加工作", "attendWorkTime", 20)); + } + if ("education".equals(splitData[i])) { + entitys.add(new ExcelExportEntity("最高学历", "education")); + } + if ("major".equals(splitData[i])) { + entitys.add(new ExcelExportEntity("所学专业", "major")); + } + if ("graduationAcademy".equals(splitData[i])) { + entitys.add(new ExcelExportEntity("毕业院校", "graduationAcademy")); + } + if ("graduationTime".equals(splitData[i])) { + entitys.add(new ExcelExportEntity("毕业时间", "graduationTime", 20)); + } + if ("creatorTime".equals(splitData[i])) { + entitys.add(new ExcelExportEntity("创建时间", "creatorTime")); + } + } + } + ExportParams exportParams = new ExportParams(null, "职员信息"); + exportParams.setType(ExcelType.XSSF); + DownloadVO vo = DownloadVO.builder().build(); + try { + @Cleanup + Workbook workbook = new HSSFWorkbook(); + if (entitys.size() > 0) { + workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list); + } + String name = "职员信息" + DateUtil.dateNow("yyyyMMdd") + "_" + RandomUtil.uuId() + ".xlsx"; + // 上传文件 + MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, name); + String temporaryFilePath = configValueUtil.getTemporaryFilePath(); + FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, name); + vo.setName(fileInfo.getFilename()); + vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + name); + } catch (Exception e) { + log.error("信息导出Excel错误:{}", e.getMessage()); + } + return ActionResult.success(vo); + } + +} diff --git a/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/LeaveApplyController.java b/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/LeaveApplyController.java new file mode 100644 index 0000000..7ea2cfe --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/LeaveApplyController.java @@ -0,0 +1,118 @@ +package com.yunzhupaas.controller; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.entity.LeaveApplyEntity; +import com.yunzhupaas.model.leaveapply.LeaveApplyForm; +import com.yunzhupaas.model.leaveapply.LeaveApplyInfoVO; +import com.yunzhupaas.service.LeaveApplyService; +import com.yunzhupaas.util.GeneraterSwapUtil; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * 请假申请 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Tag(name = "请假申请", description = "LeaveApply") +@RestController +@RequestMapping("/api/extend/Form/LeaveApply") +public class LeaveApplyController extends SuperController { + + @Autowired + private LeaveApplyService leaveApplyService; + @Autowired + private GeneraterSwapUtil generaterSwapUtil; + + /** + * 获取请假申请信息 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "获取请假申请信息") + @GetMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult info(@PathVariable("id") String id) { + LeaveApplyEntity entity = leaveApplyService.getInfo(id); + LeaveApplyInfoVO vo = JsonUtil.getJsonToBean(entity, LeaveApplyInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 新建请假申请 + * + * @param leaveApplyForm 表单对象 + * @return + */ + @Operation(summary = "新建请假申请") + @PostMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "leaveApplyForm", description = "请假模型", required = true), + }) + public ActionResult create(@RequestBody LeaveApplyForm leaveApplyForm, @PathVariable("id") String id) { + LeaveApplyEntity entity = JsonUtil.getJsonToBean(leaveApplyForm, LeaveApplyEntity.class); + leaveApplyService.submit(id, entity, leaveApplyForm); + return ActionResult.success(MsgCode.SU006.get()); + } + + /** + * 修改请假申请 + * + * @param leaveApplyForm 表单对象 + * @param id 主键 + * @return + */ + @Operation(summary = "修改请假申请") + @PutMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "leaveApplyForm", description = "请假模型", required = true), + }) + public ActionResult update(@RequestBody LeaveApplyForm leaveApplyForm, @PathVariable("id") String id) { + LeaveApplyEntity entity = JsonUtil.getJsonToBean(leaveApplyForm, LeaveApplyEntity.class); + entity.setId(id); + leaveApplyService.submit(id, entity, leaveApplyForm); + return ActionResult.success(MsgCode.SU006.get()); + } + + /** + * 删除请假申请信息 + * + * @param id 主键 + */ + @Operation(summary = "删除请假申请信息") + @DeleteMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult delete(@PathVariable("id") String id, @RequestParam(name = "forceDel", defaultValue = "false") Boolean forceDel) { + LeaveApplyEntity entity = leaveApplyService.getInfo(id); + if (null != entity) { + if (!forceDel) { + String errMsg = generaterSwapUtil.deleteFlowTask(entity.getId()); + if (StringUtil.isNotBlank(errMsg)) { + throw new RuntimeException(errMsg); + } + } + leaveApplyService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/OrderController.java b/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/OrderController.java new file mode 100644 index 0000000..2681b51 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/OrderController.java @@ -0,0 +1,407 @@ +package com.yunzhupaas.controller; + +import cn.afterturn.easypoi.excel.ExcelExportUtil; +import cn.afterturn.easypoi.excel.entity.TemplateExportParams; +import cn.dev33.satoken.annotation.SaCheckPermission; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.Page; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.entity.OrderEntity; +import com.yunzhupaas.entity.OrderEntryEntity; +import com.yunzhupaas.entity.OrderReceivableEntity; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.TaskEntity; +import com.yunzhupaas.model.order.*; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.service.OrderService; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UploaderUtil; +import com.yunzhupaas.util.UserProvider; +import com.yunzhupaas.workflow.service.TaskApi; +import lombok.Cleanup; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.ss.usermodel.Workbook; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.io.FileOutputStream; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 订单信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ + +@Slf4j +@Tag(name = "订单信息", description = "Order") +@RestController +@RequestMapping("/api/extend/CrmOrder") +public class OrderController extends SuperController { + + @Autowired + private OrderService orderService; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private UserService userService; + + @Autowired + private TaskApi taskApi; + + /** + * 获取订单信息列表(带分页) + * + * @param paginationOrder 分页模型 + * @return + */ + @Operation(summary = "获取订单信息列表") + @GetMapping + @SaCheckPermission("extend.order") + public ActionResult> list(PaginationOrder paginationOrder) { + List data = orderService.getList(paginationOrder); + List listVO = JsonUtil.getJsonToList(data, OrderListVO.class); + List id = data.stream().map(t -> t.getId()).collect(Collectors.toList()); + List orderStaList = taskApi.getInfosSubmit(id.toArray(new String[]{}), TaskEntity::getStatus, TaskEntity::getId, TaskEntity::getFlowId); + List userId = listVO.stream().map(t -> t.getCreatorUserId()).collect(Collectors.toList()); + List userList = userService.getUserName(userId); + for (OrderListVO order : listVO) { + UserEntity user = userList.stream().filter(t -> t.getId().equals(order.getCreatorUserId())).findFirst().orElse(null); + order.setCreatorUser(user != null ? user.getRealName() + "/" + user.getAccount() : ""); + TaskEntity task = orderStaList.stream().filter(t -> t.getId().equals(order.getId())).findFirst().orElse(null); + order.setCurrentState(task != null ? task.getStatus() : 0); + order.setFlowId(task != null ? task.getFlowId() : order.getFlowId()); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(paginationOrder, PaginationVO.class); + return ActionResult.page(listVO, paginationVO); + } + + /** + * 获取订单信息子列表(订单明细) + * + * @param id 主表 + * @return + */ + @Operation(summary = "获取订单信息子列表(订单明细)") + @GetMapping("/OrderEntry/{id}/Items") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("extend.order") + public ActionResult> orderEntryList(@PathVariable("id") String id) { + List data = orderService.getOrderEntryList(id); + List result = JsonUtil.getJsonToList(data, OrderEntryListVO.class); + ListVO vo = new ListVO(); + vo.setList(result); + return ActionResult.success(vo); + } + + /** + * 获取订单信息子列表(订单收款) + * + * @param id 主表 + * @return + */ + @Operation(summary = "获取订单列表-收款计划") + @GetMapping("/{id}/CollectionPlan") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("extend.order") + public ActionResult> orderReceivableList(@PathVariable("id") String id) { + List data = orderService.getOrderReceivableList(id); + List result = JsonUtil.getJsonToList(data, OrderReceivableListVO.class); + ListVO vo = new ListVO(); + vo.setList(result); + return ActionResult.success(vo); + } + + /** + * 获取订单信息 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取订单信息") + @GetMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("extend.order") + public ActionResult info(@PathVariable("id") String id) { + OrderEntity orderEntity = orderService.getInfo(id); + List orderEntryList = orderService.getOrderEntryList(id); + List orderReceivableList = orderService.getOrderReceivableList(id); + OrderInfoVO infoVo = JsonUtil.getJsonToBean(orderEntity, OrderInfoVO.class); + if (infoVo != null) { + List orderEntryModels = JsonUtil.getJsonToList(orderEntryList, OrderInfoOrderEntryModel.class); + infoVo.setGoodsList(orderEntryModels); + List orderReceivableModels = JsonUtil.getJsonToList(orderReceivableList, OrderInfoOrderReceivableModel.class); + infoVo.setCollectionPlanList(orderReceivableModels); + if (StringUtil.isNotEmpty(infoVo.getCreatorUserId())) { + UserEntity creator = userService.getInfo(infoVo.getCreatorUserId()); + infoVo.setCreatorUserId(creator != null ? creator.getRealName() + "/" + creator.getAccount() : ""); + } + if (StringUtil.isNotEmpty(infoVo.getLastModifyUserId())) { + UserEntity lastModify = userService.getInfo(infoVo.getLastModifyUserId()); + infoVo.setLastModifyUserId(lastModify != null ? lastModify.getRealName() + "/" + lastModify.getAccount() : ""); + } + } + return ActionResult.success(infoVo); + } + + /** + * 获取订单信息(前单) + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取订单信息(前单)") + @GetMapping("/{id}/Actions/Prev") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("extend.order") + public ActionResult prevInfo(@PathVariable("id") String id) throws DataException { + OrderInfoVO vo = orderService.getInfoVo(id, "prev"); + return ActionResult.success(vo); + } + + /** + * 获取订单信息(后单) + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取订单信息(后单)") + @GetMapping("/{id}/Actions/Next") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("extend.order") + public ActionResult nextInfo(@PathVariable("id") String id) throws DataException { + OrderInfoVO vo = orderService.getInfoVo(id, "next"); + return ActionResult.success(vo); + } + + /** + * 信息导出Excel + * + * @param id 主键 + * @return + */ + @Operation(summary = "信息导出Excel") + @GetMapping("/{id}/Export") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("extend.order") + public ActionResult exportExcel(@PathVariable("id") String id) { + OrderEntity orderEntity = orderService.getInfo(id); + if (orderEntity != null) { + if (StringUtil.isNotEmpty(orderEntity.getCreatorUserId())) { + UserEntity user = userService.getInfo(orderEntity.getCreatorUserId()); + orderEntity.setCreatorUserId(user != null ? user.getRealName() + "/" + user.getAccount() : ""); + } + if (StringUtil.isNotEmpty(orderEntity.getLastModifyUserId())) { + UserEntity user = userService.getInfo(orderEntity.getLastModifyUserId()); + orderEntity.setLastModifyUserId(user != null ? user.getRealName() + "/" + user.getAccount() : ""); + } + OrderExportModel exportModel = JsonUtil.getJsonToBean(orderEntity, OrderExportModel.class); + //保存数据 + Map map = new HashMap<>(16); + map.put("order", JSON.parse(JSONObject.toJSONStringWithDateFormat(exportModel, "yyyy-MM-dd HH:mm:ss"))); + List orderEntryList = orderService.getOrderEntryList(id); + String num = "0" ; + BigDecimal qtyNum = new BigDecimal(num); + BigDecimal amountNum = new BigDecimal(num); + BigDecimal actualAmountNum = new BigDecimal(num); + for (OrderEntryEntity entity : orderEntryList) { + BigDecimal qty = null; + if (entity.getQty() == null) { + qty = new BigDecimal(num); + } else { + qty = entity.getQty(); + } + qtyNum = qtyNum.add(qty); + BigDecimal amount = null; + if (entity.getAmount() == null) { + amount = new BigDecimal(num); + } else { + amount = entity.getAmount(); + } + amountNum = amountNum.add(amount); + BigDecimal actualAmount; + if (entity.getActualAmount() == null) { + actualAmount = new BigDecimal(num); + } else { + actualAmount = entity.getActualAmount(); + } + actualAmountNum = actualAmountNum.add(actualAmount); + } + OrderEntryEntity entity = new OrderEntryEntity(); + //最后一行合计 + entity.setGoodsName("合计"); + entity.setQty(qtyNum); + entity.setAmount(amountNum); + entity.setActualAmount(actualAmountNum); + orderEntryList.add(entity); + map.put("orderEntry", orderEntryList); + DownloadVO vo = DownloadVO.builder().build(); + try { + //模板 + TemplateExportParams param = new TemplateExportParams(configValueUtil.getTemplateFilePath() + "orderInfo_export_template.xlsx", true); + @Cleanup Workbook workbook = ExcelExportUtil.exportExcel(param, map); + String name = "订单信息-" + orderEntity.getOrderCode() + ".xlsx" ; + String fileName = configValueUtil.getTemporaryFilePath() + name; + @Cleanup FileOutputStream output = new FileOutputStream(fileName); + workbook.write(output); + vo.setName(name); + vo.setUrl(UploaderUtil.uploaderFile(name)); + } catch (Exception e) { + log.error("信息导出Excel错误:{}", e.getMessage()); + } + return ActionResult.success(vo); + } + return ActionResult.fail(MsgCode.ETD104.get()); + } + + /** + * 新建订单信息 + * + * @param id 主键 + * @param orderForm 订单模型 + * @return + */ + @Operation(summary = "新建订单信息") + @PostMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "orderForm", description = "订单模型", required = true), + }) + @SaCheckPermission("extend.order") + public ActionResult create(@PathVariable("id") String id, @RequestBody @Valid OrderForm orderForm) throws WorkFlowException { + OrderEntity orderEntity = JsonUtil.getJsonToBean(orderForm, OrderEntity.class); + orderEntity.setId(id); + List orderEntryList = JsonUtil.getJsonToList(orderForm.getGoodsList(), OrderEntryEntity.class); + List orderReceivableList = JsonUtil.getJsonToList(orderForm.getCollectionPlanList(), OrderReceivableEntity.class); + orderService.create(orderEntity, orderEntryList, orderReceivableList); + return ActionResult.success(MsgCode.SU002.get()); + } + + /** + * 更新订单信息 + * + * @param id 主键 + * @param orderForm 订单模型 + * @return + */ + @Operation(summary = "更新订单信息") + @PutMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "orderForm", description = "订单模型", required = true), + }) + @SaCheckPermission("extend.order") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid OrderForm orderForm) throws WorkFlowException { + OrderEntity orderEntity = JsonUtil.getJsonToBean(orderForm, OrderEntity.class); + List orderEntryList = JsonUtil.getJsonToList(orderForm.getGoodsList(), OrderEntryEntity.class); + List orderReceivableList = JsonUtil.getJsonToList(orderForm.getCollectionPlanList(), OrderReceivableEntity.class); + OrderEntity entity = orderService.getInfo(id); + orderEntity.setId(id); + if (entity != null) { + orderService.update(id, orderEntity, orderEntryList, orderReceivableList); + return ActionResult.success(MsgCode.SU004.get()); + } + return ActionResult.success(MsgCode.FA002.get()); + } + + /** + * 删除订单信息 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除订单信息") + @DeleteMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("extend.order") + public ActionResult delete(@PathVariable("id") String id) { + OrderEntity entity = orderService.getInfo(id); + if (entity != null) { + orderService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + /** + * 获取客户列表 + * + * @param page 分页模型 + * @return + */ + @Operation(summary = "获取客户列表") + @GetMapping("/Customer") + @SaCheckPermission("extend.order") + public ActionResult> customerList(Page page) { + String json = "[{\"id\":\"8094826d-dfe0-4a05-9023-4d441c304c61\",\"text\":\"广东雪莱特光电科技股份有限公司\",\"code\":\"100000\",\"keyword\":\"GDXLTGDKJGFYXGS,ADXLTGDKJGFYXGS\"},{\"id\":\"b20e965b-9f18-4228-9532-e506caf751e3\",\"text\":\"广州旭之日电子科技有限公司\",\"code\":\"100001\",\"keyword\":\"GZXZRDZKJYXGS,AZXZRDZKJYXGS\"},{\"id\":\"563326c0-ad5f-4221-9ff7-dbf687c4b802\",\"text\":\"东莞市博力威汽车配件有限公司\",\"code\":\"100002\",\"keyword\":\"DWSBLWQJPJYXGS,DWSBLWQCPJYXGS,DGSBLWQJPJYXGS,DGSBLWQCPJYXGS\"},{\"id\":\"b28691a9-acdc-4fdd-9e5f-c2fd04e5a795\",\"text\":\"佛山市恒威汽车动力转向器公司\",\"code\":\"100003\",\"keyword\":\"BSSHWQJDLZXQGS,BSSHWQCDLZXQGS\"},{\"id\":\"37143c66-93a0-4ec2-8625-5dc3f0059e5c\",\"text\":\"广州三锦照明电器公司\",\"code\":\"100004\",\"keyword\":\"GZSJZMDQGS,AZSJZMDQGS\"},{\"id\":\"712a390f-deb7-4d6d-b1bf-cb93b2221306\",\"text\":\"广州鑫正源汽配有限公司\",\"code\":\"100005\",\"keyword\":\"GZXZYQPYXGS,AZXZYQPYXGS\"},{\"id\":\"a10fa05a-7954-4500-a3e9-2b42837a6ee9\",\"text\":\"广州市德霸照明电器有限公司\",\"code\":\"100006\",\"keyword\":\"GZSDBZMDQYXGS,AZSDBZMDQYXGS\"},{\"id\":\"cb715ab8-8940-480a-b1f2-cc61b73ae44b\",\"text\":\"深圳星际服饰有限公司\",\"code\":\"100007\",\"keyword\":\"SZXJFSYXGS\"},{\"id\":\"6c265977-5480-4e3e-82a3-0f71f750f109\",\"text\":\"深圳市博锐纵横科技有限公司\",\"code\":\"100008\",\"keyword\":\"SZSBRZHKJYXGS\"},{\"id\":\"2bbc5699-1968-42d0-b950-39df42b6718f\",\"text\":\"广州融星商贸有限公司\",\"code\":\"100009\",\"keyword\":\"GZRXSMYXGS,AZRXSMYXGS\"},{\"id\":\"64e597d4-0a8e-4bf7-b8d7-64ca8a2e6c20\",\"text\":\"广州顶诚科技电子有限公司\",\"code\":\"100010\",\"keyword\":\"GZDCKJDZYXGS,AZDCKJDZYXGS\"},{\"id\":\"15337f7e-3fff-4403-96b9-eaebbef85534\",\"text\":\"烟台孚瑞克森汽车部件有限公司\",\"code\":\"100011\",\"keyword\":\"YTFRKSQJBJYXGS,YTFRKSQCBJYXGS\"},{\"id\":\"46746ff8-c48b-43c7-a9e9-51a19d1d2499\",\"text\":\"茌平信发铝电集团有限公司\",\"code\":\"100012\",\"keyword\":\"CPXFLDJTYXGS\"},{\"id\":\"6f752d0c-b416-4552-8ef9-5f2136e77689\",\"text\":\"济南澳商贸易有限公司\",\"code\":\"100013\",\"keyword\":\"JNASMYYXGS\"},{\"id\":\"8ab80843-e007-4dd4-8d39-d28f05ba1643\",\"text\":\"济南澳润商贸有限公司\",\"code\":\"100014\",\"keyword\":\"JNARSMYXGS\"},{\"id\":\"2d10551d-6f72-4c00-abd4-8c9856a2aeba\",\"text\":\"山东凯诺汽车配件有限公司\",\"code\":\"100015\",\"keyword\":\"SDKNQJPJYXGS,SDKNQCPJYXGS\"},{\"id\":\"30d89988-00f5-4abc-88ea-592f058c8d89\",\"text\":\"烟台瑞福汽车部件有限公司\",\"code\":\"100016\",\"keyword\":\"YTRFQJBJYXGS,YTRFQCBJYXGS\"},{\"id\":\"812ccd19-f7d5-4c24-9e11-b31bfee50d41\",\"text\":\"茌平日兴达汽车部件有限公司\",\"code\":\"100017\",\"keyword\":\"CPRXDQJBJYXGS,CPRXDQCBJYXGS\"},{\"id\":\"89f05f5f-5ca2-4f59-a41a-abc3a444a77c\",\"text\":\"永正汽车配件有限责任公司\",\"code\":\"100018\",\"keyword\":\"YZQJPJYXZRGS,YZQCPJYXZRGS\"},{\"id\":\"5be62e54-c3cf-4927-a8fc-61e6d6534e24\",\"text\":\"青岛华安正信国际贸易有限公司\",\"code\":\"100019\",\"keyword\":\"QDHAZXGJMYYXGS\"},{\"id\":\"45e990c7-ffc2-4df8-8b83-2af4d4b07fbb\",\"text\":\"广饶中策橡胶有限公司\",\"code\":\"100020\",\"keyword\":\"GRZCXJYXGS,ARZCXJYXGS\"},{\"id\":\"c865c9fb-135e-40b8-bb38-9a909f5c3a8b\",\"text\":\"山东张驰橡胶有限公司\",\"code\":\"100021\",\"keyword\":\"SDZCXJYXGS\"},{\"id\":\"802c13c6-a89c-4351-98a6-956f48fd3c72\",\"text\":\"济南易久自动化有限公司\",\"code\":\"100022\",\"keyword\":\"JNYJZDHYXGS\"},{\"id\":\"49ddaa6c-ba14-48af-9782-4c780914cd30\",\"text\":\"山东汇丰汽车配件有限公司\",\"code\":\"100023\",\"keyword\":\"SDHFQJPJYXGS,SDHFQCPJYXGS\"},{\"id\":\"179ac5c2-6ea3-4b7e-994f-0e6d846394d6\",\"text\":\"烟台浩阳机械制造有限公司\",\"code\":\"100024\",\"keyword\":\"YTHYJXZZYXGS\"},{\"id\":\"2a8d22e0-97a5-49e4-8929-f850d4e207c4\",\"text\":\"山东跃恒轮胎化工有限公司\",\"code\":\"100025\",\"keyword\":\"SDYHLTHGYXGS\"},{\"id\":\"8ade7cd2-59f0-435d-a5ed-6e5c47566dab\",\"text\":\"东营博瑞制动系统有限公司\",\"code\":\"100026\",\"keyword\":\"DYBRZDXTYXGS,DYBRZDJTYXGS\"},{\"id\":\"37b52c55-85c1-4a8a-acb7-217231d21404\",\"text\":\"泰安玥欣工贸有限公司\",\"code\":\"100027\",\"keyword\":\"TAYXGMYXGS\"},{\"id\":\"145b9423-bcda-45c9-ab9c-ecda841a5f97\",\"text\":\"山东世途轮胎有限公司\",\"code\":\"100028\",\"keyword\":\"SDSTLTYXGS\"},{\"id\":\"53e40ffa-b566-4280-bac0-70839df36ae9\",\"text\":\"山东世通轮胎有限公司\",\"code\":\"100029\",\"keyword\":\"SDSTLTYXGS\"},{\"id\":\"aabc07b9-a067-4a6d-8979-8bacf09b6601\",\"text\":\"龙口海盟机械有限公司\",\"code\":\"100030\",\"keyword\":\"LKHMJXYXGS\"},{\"id\":\"b01061f5-fc4b-4a6c-8c9d-e74bbc6d65f0\",\"text\":\"枣庄市正邦新型建材有限公司\",\"code\":\"100031\",\"keyword\":\"ZZSZBXXJCYXGS\"},{\"id\":\"0f6dc939-632f-4318-9887-831aadf2f016\",\"text\":\"济南宏岺汽车配件公司\",\"code\":\"100032\",\"keyword\":\"JNHLQJPJGS,JNHLQCPJGS\"},{\"id\":\"44134ad0-84ca-47e5-bdb2-a90701d3b526\",\"text\":\"山东富华汽车配件公司\",\"code\":\"100033\",\"keyword\":\"SDFHQJPJGS,SDFHQCPJGS\"},{\"id\":\"123b6bac-7638-457b-a920-83cc0fa0c2dc\",\"text\":\"聊城贝尔汽车散热器有限公司\",\"code\":\"100034\",\"keyword\":\"LCBEQJSRQYXGS,LCBEQCSRQYXGS\"},{\"id\":\"7b3ee427-6785-4a55-a6e2-8b92c3c756ec\",\"text\":\"枣庄市正邦新型建材有限公司\",\"code\":\"100035\",\"keyword\":\"ZZSZBXXJCYXGS\"},{\"id\":\"abef7a36-c1aa-4324-893e-5ee0cf12ba06\",\"text\":\"山东军泰化工有限公司\",\"code\":\"100036\",\"keyword\":\"SDJTHGYXGS\"},{\"id\":\"579f7530-c82d-4eea-b98d-7ac27db0d92c\",\"text\":\"山东鑫月昶汽车配件有限公司\",\"code\":\"100037\",\"keyword\":\"SDXYCQJPJYXGS,SDXYCQCPJYXGS\"},{\"id\":\"12e0e23d-170d-4924-8088-915796555737\",\"text\":\"山东宏马工程机械有限公司\",\"code\":\"100038\",\"keyword\":\"SDHMGCJXYXGS\"},{\"id\":\"047a68cb-2a57-47f0-ab04-5781147a8888\",\"text\":\"青岛祥荣轮胎有限公司\",\"code\":\"100039\",\"keyword\":\"QDXRLTYXGS\"},{\"id\":\"61129e0d-1b4c-4947-b78b-6ac80de557ca\",\"text\":\"斯伯塔克轮胎集团有限公司\",\"code\":\"100040\",\"keyword\":\"SBTKLTJTYXGS,SBDKLTJTYXGS\"},{\"id\":\"87676528-a2c6-46fc-922f-3854ac7b1e3b\",\"text\":\"东营信义汇丰汽车配件有限公司\",\"code\":\"100041\",\"keyword\":\"DYXYHFQJPJYXGS,DYXYHFQCPJYXGS\"},{\"id\":\"63105380-d09b-4506-baa3-6212d8ac95f2\",\"text\":\"青岛征和工业有限公司\",\"code\":\"100042\",\"keyword\":\"QDZHGYYXGS\"},{\"id\":\"1aecaf71-6623-4992-9f7e-fee68efe61a0\",\"text\":\"上海卓美实业有限公司\",\"code\":\"100043\",\"keyword\":\"SHZMSYYXGS\"},{\"id\":\"61fd0246-fd9c-4fe2-a648-7fe745d2b013\",\"text\":\"上海塞蓝帝国际贸易有限公司\",\"code\":\"100044\",\"keyword\":\"SHSLDGJMYYXGS\"},{\"id\":\"8e26ceca-41d6-42d0-bcc9-500768437d4a\",\"text\":\"上海繁颐国际贸易有限公司\",\"code\":\"100045\",\"keyword\":\"SHPYGJMYYXGS,SHFYGJMYYXGS\"},{\"id\":\"9dd3ed1e-ff4b-4317-b1da-b64fd07e6157\",\"text\":\"六安龙啸工艺品有限公司\",\"code\":\"100046\",\"keyword\":\"LALXGYPYXGS\"},{\"id\":\"f1890c89-fb6c-4736-897d-7dc9c905d7f3\",\"text\":\"六安江澎电器商行\",\"code\":\"100047\",\"keyword\":\"LAJPDQSX,LAJPDQSH\"},{\"id\":\"ffbbe328-488b-4873-bfe3-fbe597716a9b\",\"text\":\"安徽法西欧汽车部件有限公司\",\"code\":\"100048\",\"keyword\":\"AHFXOQJBJYXGS,AHFXOQCBJYXGS\"},{\"id\":\"ff620a66-c80b-4b63-b4bd-ef54d488d67d\",\"text\":\"安徽奥丰汽车配件有限公司\",\"code\":\"100049\",\"keyword\":\"AHAFQJPJYXGS,AHAFQCPJYXGS\"},{\"id\":\"13855122-d6b9-40b1-8415-803ea06ff294\",\"text\":\"瑞安市给力汽车配件有限公司\",\"code\":\"100050\",\"keyword\":\"RASGLQJPJYXGS,RASGLQCPJYXGS,RASJLQJPJYXGS,RASJLQCPJYXGS\"},{\"id\":\"5e9f61c4-f95e-4b12-a462-13310a64fef4\",\"text\":\"温州名邦汽车用品有限公司\",\"code\":\"100051\",\"keyword\":\"WZMBQJYPYXGS,WZMBQCYPYXGS\"},{\"id\":\"34d4627c-5e0b-4e67-936a-da8740743430\",\"text\":\"温州拉凡宝汽车泵业有限公司\",\"code\":\"100052\",\"keyword\":\"WZLFBQJBYYXGS,WZLFBQCBYYXGS\"},{\"id\":\"5c496717-738f-45bc-a613-7a6d6086da9c\",\"text\":\"瑞安科普进出口贸易有限公司\",\"code\":\"100053\",\"keyword\":\"RAKPJCKMYYXGS\"},{\"id\":\"3552401c-90f7-4197-91b6-b8735732884e\",\"text\":\"瑞安中申电器有限公司\",\"code\":\"100054\",\"keyword\":\"RAZSDQYXGS\"},{\"id\":\"2656a62a-52b9-4749-8fa9-ffbf8dc5c940\",\"text\":\"温州金品汽车用品有限公司\",\"code\":\"100055\",\"keyword\":\"WZJPQJYPYXGS,WZJPQCYPYXGS\"},{\"id\":\"a7cd833f-e49e-4496-a29c-215c4ef623be\",\"text\":\"瑞安市力邦科众制动器有限公司\",\"code\":\"100056\",\"keyword\":\"RASLBKZZDQYXGS\"},{\"id\":\"133b902b-12c4-4a00-b238-73a71ae24540\",\"text\":\"宁波广良电器有限公司\",\"code\":\"100057\",\"keyword\":\"NBGLDQYXGS,NBALDQYXGS\"},{\"id\":\"13a19f6b-3d0f-4f17-92f6-8bd3df4ac3d5\",\"text\":\"温州杰峰进出口有限公司\",\"code\":\"100058\",\"keyword\":\"WZJFJCKYXGS\"},{\"id\":\"4a88166a-8b55-40d7-bb22-04dbb1883d34\",\"text\":\"温州科达汽车轴瓦有限公司\",\"code\":\"100059\",\"keyword\":\"WZKDQJZWYXGS,WZKDQCZWYXGS\"},{\"id\":\"22c92533-57af-427c-9b3b-7644dc0a86ef\",\"text\":\"宁波钧乔行汽车配件有限公司\",\"code\":\"100060\",\"keyword\":\"NBJQXQJPJYXGS,NBJQXQCPJYXGS,NBJQHQJPJYXGS,NBJQHQCPJYXGS\"},{\"id\":\"45715bdd-1740-4a30-82c8-d9ef3d05cc5a\",\"text\":\"浙江平柴泵业有限公司\",\"code\":\"100061\",\"keyword\":\"ZJPCBYYXGS\"},{\"id\":\"6a5d46f3-20e4-4a27-b097-3ba6beef7981\",\"text\":\"宁波鑫海爱多雨刷制造有限公司\",\"code\":\"100062\",\"keyword\":\"NBXHADYSZZYXGS\"},{\"id\":\"faadbe66-142b-4d52-8229-0b5239ff0d76\",\"text\":\"浙江亚之星汽车部件有限公司\",\"code\":\"100063\",\"keyword\":\"ZJYZXQJBJYXGS,ZJYZXQCBJYXGS\"},{\"id\":\"f8ed65af-ad33-435d-9f99-d63f04c4a6d0\",\"text\":\"浙江立群汽车配件制造有限公司\",\"code\":\"100064\",\"keyword\":\"ZJLQQJPJZZYXGS,ZJLQQCPJZZYXGS\"},{\"id\":\"46a50622-a4a5-46aa-b307-ca530e77b918\",\"text\":\"浙江林氏汽车零部件有限公司\",\"code\":\"100065\",\"keyword\":\"ZJLZQJLBJYXGS,ZJLZQCLBJYXGS,ZJLSQJLBJYXGS,ZJLSQCLBJYXGS\"},{\"id\":\"6dd6c16c-7a50-4a9b-8e3f-4d5e87091046\",\"text\":\"浙江瑞峰汽车零部件有限公司\",\"code\":\"100066\",\"keyword\":\"ZJRFQJLBJYXGS,ZJRFQCLBJYXGS\"},{\"id\":\"9bfbc91f-2e12-4fca-a6f5-55bf0b21f453\",\"text\":\"温州万豪汽配有限公司\",\"code\":\"100067\",\"keyword\":\"WZWHQPYXGS,WZMHQPYXGS\"},{\"id\":\"c86726b0-345d-479b-99d0-f26ab525b690\",\"text\":\"浙江兰德马克汽车配件有限公司\",\"code\":\"100068\",\"keyword\":\"ZJLDMKQJPJYXGS,ZJLDMKQCPJYXGS\"},{\"id\":\"a7af2dc9-4e11-4452-a897-33b696131de4\",\"text\":\"浙江乐鼎波纹管有限公司\",\"code\":\"100069\",\"keyword\":\"ZJYDBWGYXGS,ZJLDBWGYXGS\"},{\"id\":\"46f82e53-ef5b-4b59-bc0e-7a98d4951784\",\"text\":\"浙江奥凯利汽配有限公司\",\"code\":\"100070\",\"keyword\":\"ZJAKLQPYXGS\"},{\"id\":\"03b372b7-adc9-41c1-8db2-db6da049f0b4\",\"text\":\"宁波昂博电器科技有限公司\",\"code\":\"100071\",\"keyword\":\"NBABDQKJYXGS\"},{\"id\":\"069bb158-2719-40e8-9f3e-ea8d14774a98\",\"text\":\"浙江吉尚汽车部件有限公司\",\"code\":\"100072\",\"keyword\":\"ZJJSQJBJYXGS,ZJJSQCBJYXGS\"},{\"id\":\"4caaf81a-925f-471d-b4a6-a330b5e5835b\",\"text\":\"诸暨市国立机械有限公司\",\"code\":\"100073\",\"keyword\":\"ZJSGLJXYXGS\"},{\"id\":\"a24b6a50-1b17-413e-828b-4107410b2a2e\",\"text\":\"玉环冠丰汽车零部件有限公司\",\"code\":\"100074\",\"keyword\":\"YHGFQJLBJYXGS,YHGFQCLBJYXGS\"},{\"id\":\"cabfe7d7-c164-4444-bff0-b547d5a3b9db\",\"text\":\"武义万龙机械制造有限公司\",\"code\":\"100075\",\"keyword\":\"WYWLJXZZYXGS,WYMLJXZZYXGS\"},{\"id\":\"67142c93-f97c-401c-8079-7ebb8159e838\",\"text\":\"浙江安泰汽车部件有限公司\",\"code\":\"100076\",\"keyword\":\"ZJATQJBJYXGS,ZJATQCBJYXGS\"},{\"id\":\"05b20523-ca83-4072-8ea0-84ea3623e436\",\"text\":\"余姚斯威克电器有限公司\",\"code\":\"100077\",\"keyword\":\"YYSWKDQYXGS\"},{\"id\":\"7baa025e-56b7-48a1-bcd2-0f3c1128016e\",\"text\":\"温州鼎程电子科技有限公司\",\"code\":\"100078\",\"keyword\":\"WZDCDZKJYXGS\"},{\"id\":\"f57b707c-f7fe-4c29-b6e3-a4cc607e11f0\",\"text\":\"临海裕隆汽配有限公司\",\"code\":\"100079\",\"keyword\":\"LHYLQPYXGS\"},{\"id\":\"d07308e7-9139-43f2-8e07-bcd69e74a0e1\",\"text\":\"宁波路卡帝电器有限公司\",\"code\":\"100080\",\"keyword\":\"NBLQDDQYXGS,NBLKDDQYXGS\"},{\"id\":\"512eb341-29e5-49fb-8d61-ba4dcc63245e\",\"text\":\"宁波雷自达电器有限公司\",\"code\":\"100081\",\"keyword\":\"NBLZDDQYXGS\"},{\"id\":\"781c1504-487c-4a7c-bf14-cb47d14a646e\",\"text\":\"温州凯特汽车用品制造厂\",\"code\":\"100082\",\"keyword\":\"WZKTQJYPZZC,WZKTQJYPZZA,WZKTQCYPZZC,WZKTQCYPZZA\"},{\"id\":\"01d7eaa2-0d4e-4e16-985b-45afac5d0538\",\"text\":\"宁波博盛汽车电子有限公司\",\"code\":\"100083\",\"keyword\":\"NBBSQJDZYXGS,NBBSQCDZYXGS,NBBCQJDZYXGS,NBBCQCDZYXGS\"},{\"id\":\"41a31860-be6b-4014-a936-72a221779de6\",\"text\":\"温州欧泰汽车用品制造有限公司\",\"code\":\"100084\",\"keyword\":\"WZOTQJYPZZYXGS,WZOTQCYPZZYXGS\"},{\"id\":\"06ccc046-131b-4691-9341-359f7ae5063e\",\"text\":\"永康市蓝特工贸有限公司\",\"code\":\"100085\",\"keyword\":\"YKSLTGMYXGS\"},{\"id\":\"e46a07e6-0936-4e7a-81cc-9c4ddbd03184\",\"text\":\"宁波行泰商贸有限公司\",\"code\":\"100086\",\"keyword\":\"NBXTSMYXGS,NBHTSMYXGS\"},{\"id\":\"48a9c7ce-d6df-4a44-8d0e-3c88ad3cc54d\",\"text\":\"瑞安市路泰汽摩零部件有限公司\",\"code\":\"100087\",\"keyword\":\"RASLTQMLBJYXGS\"},{\"id\":\"19aaab61-5281-4ac7-b5f4-edc520c89653\",\"text\":\"瑞安宏盛汽配厂\",\"code\":\"100088\",\"keyword\":\"RAHSQPC,RAHSQPA,RAHCQPC,RAHCQPA\"},{\"id\":\"04d60fed-56ec-4418-abe4-1a25929fb7b0\",\"text\":\"诸暨市维琪弹簧有限公司\",\"code\":\"100089\",\"keyword\":\"ZJSWQTHYXGS,ZJSWQDHYXGS\"},{\"id\":\"d6f5eec0-aa1a-4017-ac41-05470d3924a4\",\"text\":\"杭州康功轴承有限公司\",\"code\":\"100090\",\"keyword\":\"HZKGZCYXGS\"},{\"id\":\"4c33ee68-a64a-4454-ae3a-e62a2fe74d25\",\"text\":\"余姚航亿电器有限公司\",\"code\":\"100091\",\"keyword\":\"YYHYDQYXGS\"},{\"id\":\"a039923a-bb38-43f7-9d07-f252b139d9ef\",\"text\":\"浙江天元机电有限公司\",\"code\":\"100092\",\"keyword\":\"ZJTYJDYXGS\"},{\"id\":\"0617174b-b904-496a-a179-027504ef3699\",\"text\":\"瑞安市剑达汽车配件有限公司\",\"code\":\"100093\",\"keyword\":\"RASJDQJPJYXGS,RASJDQCPJYXGS\"},{\"id\":\"82364f9a-f9d8-4451-896b-85a2bcbe6902\",\"text\":\"台州华帅汽配有限公司\",\"code\":\"100094\",\"keyword\":\"TZHSQPYXGS\"},{\"id\":\"568872cb-66b8-43fc-a64d-3554186f0c4b\",\"text\":\"浙江铭泰汽车零部件有限公司\",\"code\":\"100095\",\"keyword\":\"ZJMTQJLBJYXGS,ZJMTQCLBJYXGS\"},{\"id\":\"8111675d-7449-4445-b0a1-14602f14ab77\",\"text\":\"浙江戈尔德汽车部件有限公司\",\"code\":\"100096\",\"keyword\":\"ZJGEDQJBJYXGS,ZJGEDQCBJYXGS\"},{\"id\":\"3a6a3be8-4b72-42eb-a872-f3395c81ca1d\",\"text\":\"常州国华电器有限公司\",\"code\":\"100097\",\"keyword\":\"CZGHDQYXGS\"},{\"id\":\"73f61385-1674-4dda-ac8e-950a886c5410\",\"text\":\"瑞安兴润贸易有限公司\",\"code\":\"100098\",\"keyword\":\"RAXRMYYXGS\"},{\"id\":\"1ee6531c-725f-4f44-b37d-8ad787c4922c\",\"text\":\"绍兴明博汽车配件有限公司\",\"code\":\"100099\",\"keyword\":\"SXMBQJPJYXGS,SXMBQCPJYXGS\"},{\"id\":\"6ff18edc-b10e-4349-8f3f-ca68f1eceee8\",\"text\":\"温州良子贸易有限公司\",\"code\":\"100100\",\"keyword\":\"WZLZMYYXGS\"},{\"id\":\"f87234e3-7199-4262-be6a-1a8f77524efc\",\"text\":\"宁波力富特牵引机制造有限公司\",\"code\":\"100101\",\"keyword\":\"NBLFTQYJZZYXGS\"},{\"id\":\"799826d9-6f8b-42a0-a713-37b9739b68df\",\"text\":\"宁波市江北名正电机有限公司\",\"code\":\"100102\",\"keyword\":\"NBSJBMZDJYXGS\"},{\"id\":\"84a17072-2047-477a-9b24-67e98f5d2220\",\"text\":\"宁波茂佳国际贸易有限公司\",\"code\":\"100103\",\"keyword\":\"NBMJGJMYYXGS\"},{\"id\":\"224ba569-fdc5-4705-b4e8-d30bcd36b854\",\"text\":\"瑞安市墉下文峰汽摩配厂\",\"code\":\"100104\",\"keyword\":\"RASYXWFQMPC,RASYXWFQMPA\"},{\"id\":\"e8bd46cd-db81-4c5e-b083-d1c05a0034a6\",\"text\":\"诸暨宇诺汽车配件有限公司\",\"code\":\"100105\",\"keyword\":\"ZJYNQJPJYXGS,ZJYNQCPJYXGS\"},{\"id\":\"781dd8cf-711a-4afa-9e22-f5a0a333637e\",\"text\":\"宁波泰和轴承有限公司\",\"code\":\"100106\",\"keyword\":\"NBTHZCYXGS\"},{\"id\":\"9bbc9c86-290b-4687-8a98-449a1a415266\",\"text\":\"东海县兰天汽车车轮厂\",\"code\":\"100107\",\"keyword\":\"DHXLTQJJLC,DHXLTQJJLA,DHXLTQJCLC,DHXLTQJCLA,DHXLTQCJLC,DHXLTQCJLA,DHXLTQCCLC,DHXLTQCCLA\"},{\"id\":\"679c136c-21c9-4ac3-ad7a-db0a613ca24d\",\"text\":\"扬州阿波罗蓄电池有限公司\",\"code\":\"100108\",\"keyword\":\"YZABLXDCYXGS,YZEBLXDCYXGS\"},{\"id\":\"3dd2eb0f-0097-4b52-9165-78e2a8d474e1\",\"text\":\"常州中隆车辆配件有限公司\",\"code\":\"100109\",\"keyword\":\"CZZLJLPJYXGS,CZZLCLPJYXGS\"},{\"id\":\"760becc2-0253-4f81-879f-970f432620d9\",\"text\":\"无锡吉瑞特机械制造有限公司\",\"code\":\"100110\",\"keyword\":\"WXJRTJXZZYXGS,MXJRTJXZZYXGS\"},{\"id\":\"b8bd4d12-2f85-43e8-b891-94866a18e90f\",\"text\":\"金坛市平江电气设备有限公司\",\"code\":\"100111\",\"keyword\":\"JTSPJDQSBYXGS\"},{\"id\":\"df0c341e-03ca-4900-95ae-fbad4e11cf9b\",\"text\":\"江苏精诚动力工程有限公司\",\"code\":\"100112\",\"keyword\":\"JSJCDLGCYXGS\"},{\"id\":\"348a509b-5f69-457e-9e9c-d28a03b2f13e\",\"text\":\"南京卡安汽车配件有限公司\",\"code\":\"100113\",\"keyword\":\"NJQAQJPJYXGS,NJQAQCPJYXGS,NJKAQJPJYXGS,NJKAQCPJYXGS\"},{\"id\":\"e69574d5-b276-4828-b2c0-c1fa7ae5b4b0\",\"text\":\"丹阳市帅达车业有限公司\",\"code\":\"100114\",\"keyword\":\"DYSSDJYYXGS,DYSSDCYYXGS\"},{\"id\":\"0fbec45d-4064-4a89-9c1e-34476d0f9e1d\",\"text\":\"江苏丹阳市超强汽配有限公司\",\"code\":\"100115\",\"keyword\":\"JSDYSCQQPYXGS,JSDYSCJQPYXGS\"},{\"id\":\"f1e15fa6-d4df-45db-9143-89e5bfd89f72\",\"text\":\"常州云昊汽车用品有限公司\",\"code\":\"100116\",\"keyword\":\"CZYHQJYPYXGS,CZYHQCYPYXGS\"},{\"id\":\"85c9d273-68ef-4dc4-8760-a2c303ab7953\",\"text\":\"常州南舜汽车附件厂\",\"code\":\"100117\",\"keyword\":\"CZNSQJFJC,CZNSQJFJA,CZNSQCFJC,CZNSQCFJA\"},{\"id\":\"7f7a474b-8327-40be-9ef2-711ebd53defc\",\"text\":\"常州顺德车业有限公司\",\"code\":\"100118\",\"keyword\":\"CZSDJYYXGS,CZSDCYYXGS\"},{\"id\":\"90fbf581-6eb9-421a-8105-73a396ac1003\",\"text\":\"常州昊翔车辆饰件有限公司\",\"code\":\"100119\",\"keyword\":\"CZHXJLSJYXGS,CZHXCLSJYXGS\"},{\"id\":\"723358eb-6b04-4fb3-876e-65f374666aa3\",\"text\":\"常州乐丰汽车饰件厂\",\"code\":\"100120\",\"keyword\":\"CZYFQJSJC,CZYFQJSJA,CZYFQCSJC,CZYFQCSJA,CZLFQJSJC,CZLFQJSJA,CZLFQCSJC,CZLFQCSJA\"},{\"id\":\"26823b21-030a-44c1-9d6a-84da4d288057\",\"text\":\"丹阳文明塑业有限公司\",\"code\":\"100121\",\"keyword\":\"DYWMSYYXGS\"},{\"id\":\"8f3c1330-d743-43d7-8f13-6b8b78f03f68\",\"text\":\"南京润特科技有限公司\",\"code\":\"100122\",\"keyword\":\"NJRTKJYXGS\"},{\"id\":\"89693dd1-50d8-4bc6-98c6-773e8220df26\",\"text\":\"重庆子堃进出口贸易有限公司\",\"code\":\"100123\",\"keyword\":\"ZQZKJCKMYYXGS,CQZKJCKMYYXGS\"},{\"id\":\"ac55602f-4526-4c09-b36b-3b0b5e5af107\",\"text\":\"石家庄旺正国际贸易有限公司\",\"code\":\"100124\",\"keyword\":\"SJZWZGJMYYXGS,DJZWZGJMYYXGS\"},{\"id\":\"930e0f13-cdf9-4149-8e79-8a9f18282f65\",\"text\":\"河间津华金属缺口有限公司\",\"code\":\"100125\",\"keyword\":\"HJJHJZQKYXGS,HJJHJSQKYXGS\"},{\"id\":\"0b4d11ab-b31a-4883-af56-037a54566ce4\",\"text\":\"河北蓝博汽车部件制造有限公司\",\"code\":\"100126\",\"keyword\":\"HBLBQJBJZZYXGS,HBLBQCBJZZYXGS\"},{\"id\":\"abe09ea0-ea41-4063-91b3-ae231f0b6724\",\"text\":\"献县亚特汽车附件厂\",\"code\":\"100127\",\"keyword\":\"XXYTQJFJC,XXYTQJFJA,XXYTQCFJC,XXYTQCFJA\"},{\"id\":\"ae0a1cc0-6ddf-45b8-82d0-51d6b34ad630\",\"text\":\"河北兴浦汽车制动器有限公司\",\"code\":\"100128\",\"keyword\":\"HBXPQJZDQYXGS,HBXPQCZDQYXGS\"},{\"id\":\"aa9ddf53-e4b8-4e36-8063-6f215e9b9407\",\"text\":\"邢台市龙洋机械制造有限公司\",\"code\":\"100129\",\"keyword\":\"XTSLYJXZZYXGS\"},{\"id\":\"3de2ed7f-8155-40b5-9bb3-b30313712040\",\"text\":\"湖北楚欣汽车销售公司\",\"code\":\"100130\",\"keyword\":\"HBCXQJXSGS,HBCXQCXSGS\"},{\"id\":\"a9ae4dfa-330f-4d1c-b420-d3ba0ee0b6b6\",\"text\":\"湘潭迅东机电科技有限公司\",\"code\":\"100131\",\"keyword\":\"XTXDJDKJYXGS\"},{\"id\":\"e0c48427-33e0-443e-9b03-3c2042d9e249\",\"text\":\"福州瑞利贸易有限公司\",\"code\":\"100132\",\"keyword\":\"FZRLMYYXGS\"},{\"id\":\"25386c99-9abc-432d-b632-efa796796827\",\"text\":\"厦门市鑫美汽车配件有限公司\",\"code\":\"100133\",\"keyword\":\"XMSXMQJPJYXGS,XMSXMQCPJYXGS,SMSXMQJPJYXGS,SMSXMQCPJYXGS\"},{\"id\":\"f94add9c-2910-439a-af5f-0d0174f75ce8\",\"text\":\"北京纳天科技有限公司\",\"code\":\"100134\",\"keyword\":\"BJNTKJYXGS\"},{\"id\":\"8a89e1bf-9389-40ba-8da1-e09376e2a046\",\"text\":\"北京瑞博汽车零部件有限公司\",\"code\":\"100135\",\"keyword\":\"BJRBQJLBJYXGS,BJRBQCLBJYXGS\"},{\"id\":\"75837bc2-6959-46f3-b1bb-5a66022b21ca\",\"text\":\"天津鑫正拓达轴承贸易有限公司\",\"code\":\"100136\",\"keyword\":\"TJXZTDZCMYYXGS\"},{\"id\":\"8e442488-2c8b-4e03-88ce-13ed5845889f\",\"text\":\"中铝国际工程公司\",\"code\":\"100137\",\"keyword\":\"ZLGJGCGS\"},{\"id\":\"be2a1881-89f4-48be-9c26-25fe0359924d\",\"text\":\"中国瑞林工程技术有限公司\",\"code\":\"100138\",\"keyword\":\"ZGRLGCJZYXGS,ZGRLGCJSYXGS\"},{\"id\":\"36fa9f7e-3281-4725-b284-ddf0a2e65bde\",\"text\":\"山东省冶金设计院\",\"code\":\"100139\",\"keyword\":\"SDSYJSJY,SDXYJSJY\"},{\"id\":\"53fed6f4-b67c-451a-a1a0-b0ed986ce519\",\"text\":\"中国核电工程有限公司\",\"code\":\"100140\",\"keyword\":\"ZGHDGCYXGS\"},{\"id\":\"b40ba0e8-dfe9-431d-9da3-73629037f385\",\"text\":\"中国水电顾问集团华东勘测设计院\",\"code\":\"100141\",\"keyword\":\"ZGSDGWJTHDKCSJY\"},{\"id\":\"8fe4d0e0-9b2a-46c8-9a6b-1a1b01d48c4c\",\"text\":\"中国电力顾问集团西北电力设计院\",\"code\":\"100142\",\"keyword\":\"ZGDLGWJTXBDLSJY\"},{\"id\":\"7f8cc56b-47c0-4afe-98a2-2a7956a8ca4f\",\"text\":\"中国电力顾问集团东北电力设计院\",\"code\":\"100143\",\"keyword\":\"ZGDLGWJTDBDLSJY\"},{\"id\":\"a0cac21c-2f3e-4ae0-9895-b03bc196fe3a\",\"text\":\"中国电力顾问集团西南电力设计院\",\"code\":\"100144\",\"keyword\":\"ZGDLGWJTXNDLSJY\"},{\"id\":\"c4a5b6de-caf8-47b9-98fb-ca2f914d59fe\",\"text\":\"中国电力顾问集团华东电力设计院\",\"code\":\"100145\",\"keyword\":\"ZGDLGWJTHDDLSJY\"},{\"id\":\"b617604d-7dc6-48c6-b982-e0601bf0f720\",\"text\":\"现代设计集团上海建筑设计院\",\"code\":\"100146\",\"keyword\":\"XDSJJTSHJZSJY\"},{\"id\":\"d4ec8f1b-099b-46a9-8e55-961ab8c308db\",\"text\":\"现代设计集团上海都市设计院\",\"code\":\"100147\",\"keyword\":\"XDSJJTSHDSSJY\"},{\"id\":\"c3d8769e-ccaf-4675-8e1f-349199a3ac33\",\"text\":\"山东同圆设计集团\",\"code\":\"100148\",\"keyword\":\"SDTYSJJT\"},{\"id\":\"028e4fbf-5b08-4554-8fa0-9c555db9ed9e\",\"text\":\"广西华蓝设计集团\",\"code\":\"100149\",\"keyword\":\"GXHLSJJT,AXHLSJJT\"},{\"id\":\"b42b46a3-26fa-47b7-94e2-12909f6c7bf0\",\"text\":\"济南人防建筑设计院\",\"code\":\"100150\",\"keyword\":\"JNRFJZSJY\"},{\"id\":\"36815670-af42-4756-ae30-b1b1b29e2036\",\"text\":\"北京市园林古建设计院\",\"code\":\"100151\",\"keyword\":\"BJSYLGJSJY\"},{\"id\":\"c029e27a-9741-4a10-a630-459be9b3ed90\",\"text\":\"中铁城市规划设计院\",\"code\":\"100152\",\"keyword\":\"ZTCSGHSJY\"},{\"id\":\"e137e6a7-5a80-4a85-8505-f5dac87902d3\",\"text\":\"四川国恒建筑设计有限公司\",\"code\":\"100153\",\"keyword\":\"SCGHJZSJYXGS\"},{\"id\":\"e03bc67b-5caf-4b2d-9b76-7a2c092d3e5d\",\"text\":\"北京三磊建筑设计有限公司\",\"code\":\"100154\",\"keyword\":\"BJSLJZSJYXGS\"},{\"id\":\"78162e75-475f-4540-a87f-4af3e9ac62c0\",\"text\":\"大连市建筑设计研究院有限公司\",\"code\":\"100155\",\"keyword\":\"DLSJZSJYJYYXGS\"},{\"id\":\"d4b3e726-9f8a-42f2-a4e2-8a2ec73ea065\",\"text\":\"安徽省电力设计院\",\"code\":\"100156\",\"keyword\":\"AHSDLSJY,AHXDLSJY\"},{\"id\":\"3c6e4d26-d665-4466-b315-3f7aceda7cf1\",\"text\":\"贵州省交通规划勘察设计研究院股份有限公司\",\"code\":\"100157\",\"keyword\":\"GZSJTGHKCSJYJYGFYXGS,GZXJTGHKCSJYJYGFYXGS\"},{\"id\":\"39778e60-e443-4787-b6c1-e07763725def\",\"text\":\"中交路桥技术有限公司\",\"code\":\"100158\",\"keyword\":\"ZJLQJZYXGS,ZJLQJSYXGS\"},{\"id\":\"5b238085-2c0a-48dc-b82e-09fe1f808575\",\"text\":\"河海大学设计院\",\"code\":\"100159\",\"keyword\":\"HHDXSJY\"},{\"id\":\"6b2e3047-3127-4620-94f2-0c887fc37831\",\"text\":\"重庆市水利电力建筑勘测设计研究院\",\"code\":\"100160\",\"keyword\":\"ZQSSLDLJZKCSJYJY,CQSSLDLJZKCSJYJY\"},{\"id\":\"014065ac-2ebb-465c-ad6e-415ff534d47f\",\"text\":\"神华宁煤能源工程公司\",\"code\":\"100161\",\"keyword\":\"SHNMNYGCGS\"},{\"id\":\"027123ad-94d5-4788-9fbf-138e9472bb0b\",\"text\":\"江西省天驰高速科技发展有限公司\",\"code\":\"100162\",\"keyword\":\"JXSTCGSKJFZYXGS,JXXTCGSKJFZYXGS\"},{\"id\":\"2571e2b5-1c4e-44e4-a700-18828fdc3f50\",\"text\":\"陕西省公路勘察设计研究院\",\"code\":\"100163\",\"keyword\":\"SXSGLKCSJYJY,SXXGLKCSJYJY\"},{\"id\":\"0dcfdd5b-2c0a-4272-93e6-e5d2b4989da6\",\"text\":\"大连市市政设计研究院有限公司\",\"code\":\"100164\",\"keyword\":\"DLSSZSJYJYYXGS\"},{\"id\":\"cd112ba0-abe0-46b6-b8e3-b2bdde2b028d\",\"text\":\"济南市政设计院集团有限公司\",\"code\":\"100165\",\"keyword\":\"JNSZSJYJTYXGS\"},{\"id\":\"5b734763-2085-4fd0-ba4e-16c08c3db4f9\",\"text\":\"天津华淼工程设计有限公司\",\"code\":\"100166\",\"keyword\":\"TJHMGCSJYXGS\"},{\"id\":\"5f3dd251-3df4-4b15-8be6-7171d99589a9\",\"text\":\"福州城建设计院\",\"code\":\"100167\",\"keyword\":\"FZCJSJY\"},{\"id\":\"070d83fa-65fd-4bde-a58a-1abff0dc3fd1\",\"text\":\"上海浦东新区规划设计院\",\"code\":\"100168\",\"keyword\":\"SHPDXQGHSJY,SHPDXOGHSJY\"},{\"id\":\"ea0ce956-24b3-4286-83be-f3cf9d12927b\",\"text\":\"厦门市政设计院有限公司\",\"code\":\"100169\",\"keyword\":\"XMSZSJYYXGS,SMSZSJYYXGS\"},{\"id\":\"7811d748-fa8e-4624-aa42-089c479872ea\",\"text\":\"长春城乡规划设计研究院\",\"code\":\"100170\",\"keyword\":\"ZCCXGHSJYJY,CCCXGHSJYJY\"},{\"id\":\"3a33c63f-4cda-4a78-b2a0-f5f64c9c2e6b\",\"text\":\"太原理工大学建筑设计研究院\",\"code\":\"100171\",\"keyword\":\"TYLGDXJZSJYJY\"},{\"id\":\"b25a5046-f6eb-4d6c-9cf4-28f8b15efa50\",\"text\":\"云南省交通规划设计院\",\"code\":\"100172\",\"keyword\":\"YNSJTGHSJY,YNXJTGHSJY\"},{\"id\":\"3999746f-8a66-4878-ab60-56ebdc7b7e4d\",\"text\":\"新疆石油勘察设计研究院(有限公司)\",\"code\":\"100173\",\"keyword\":\"XJSYKCSJYJYYXGS,XJDYKCSJYJYYXGS\"},{\"id\":\"910efec6-d547-43e8-8ed3-432893dba5a9\",\"text\":\"天津电力设计院\",\"code\":\"100174\",\"keyword\":\"TJDLSJY\"},{\"id\":\"193b480f-2e20-4af4-96d4-42368f3ad500\",\"text\":\"中国联合工程公司\",\"code\":\"100175\",\"keyword\":\"ZGLHGCGS,ZGLGGCGS\"},{\"id\":\"01f2cf7c-8eeb-4373-9c1d-f4755262ea00\",\"text\":\"机械第一设计研究院\",\"code\":\"100176\",\"keyword\":\"JXDYSJYJY\"},{\"id\":\"dde2ceae-8f99-4a15-92af-15b83dff4d6c\",\"text\":\"中交公路规划设计院\",\"code\":\"100177\",\"keyword\":\"ZJGLGHSJY\"},{\"id\":\"6ce05827-8237-4ede-9d1f-b2bd997e5f4e\",\"text\":\"中交第一公路设计院\",\"code\":\"100178\",\"keyword\":\"ZJDYGLSJY\"},{\"id\":\"05dcec72-d731-4c32-87f8-077783c9e5c9\",\"text\":\"中交水运规划设计院\",\"code\":\"100179\",\"keyword\":\"ZJSYGHSJY\"},{\"id\":\"0eb8ed9f-33e3-499c-b1af-88770a394733\",\"text\":\"中交第一航务工程勘察设计院\",\"code\":\"100180\",\"keyword\":\"ZJDYHWGCKCSJY\"},{\"id\":\"de9eb0f8-4bf3-4e83-b34f-58d280f82a54\",\"text\":\"江苏省交通规划设计院\",\"code\":\"100181\",\"keyword\":\"JSSJTGHSJY,JSXJTGHSJY\"},{\"id\":\"42976dad-b069-415e-9b82-eb82687a0337\",\"text\":\"中铁第四勘察设计院\",\"code\":\"100182\",\"keyword\":\"ZTDSKCSJY\"},{\"id\":\"f69a0aa8-eacd-4c0e-80e9-2a86b810c2e7\",\"text\":\"中煤西安设计工程公司\",\"code\":\"100183\",\"keyword\":\"ZMXASJGCGS\"},{\"id\":\"c86e5f6e-e520-479b-aeab-9d8ccf6df582\",\"text\":\"煤炭工业济南设计院\",\"code\":\"100184\",\"keyword\":\"MTGYJNSJY\"},{\"id\":\"389f6b7c-d9e6-40cf-bcde-441a59d4e39f\",\"text\":\"长江勘测规划设计研究院\",\"code\":\"100185\",\"keyword\":\"ZJKCGHSJYJY,CJKCGHSJYJY\"},{\"id\":\"347c8975-6572-48af-9853-93f13b719e0c\",\"text\":\"浙江省水利电力勘测设计院\",\"code\":\"100186\",\"keyword\":\"ZJSSLDLKCSJY,ZJXSLDLKCSJY\"},{\"id\":\"e1e1d8f9-230c-4eaf-86fd-34f044182147\",\"text\":\"中石化胜利油田设计院\",\"code\":\"100187\",\"keyword\":\"ZSHSLYTSJY,ZDHSLYTSJY\"},{\"id\":\"565f7b52-5b3c-423d-ba27-2b8db5bb1bc0\",\"text\":\"浙江天正工程设计公司\",\"code\":\"100188\",\"keyword\":\"ZJTZGCSJGS\"},{\"id\":\"6328e535-035f-4b86-ad1e-975d2c7bd71d\",\"text\":\"中国市政西北设计院\",\"code\":\"100189\",\"keyword\":\"ZGSZXBSJY\"},{\"id\":\"c5ea1162-19df-496b-b5a5-f7b793e6236c\",\"text\":\"中国医药联合工程公司\",\"code\":\"100190\",\"keyword\":\"ZGYYLHGCGS,ZGYYLGGCGS\"},{\"id\":\"fdc00925-0259-4b52-9580-14d9f7a974a6\",\"text\":\"上海杰作设计有限公司(方案公司)\",\"code\":\"100191\",\"keyword\":\"SHJZSJYXGSFAGS\"},{\"id\":\"9e73316c-6d78-4fa6-a468-9718b102aee2\",\"text\":\"哈尔滨市城市规划设计院\",\"code\":\"100192\",\"keyword\":\"HEBSCSGHSJY\"},{\"id\":\"77085a8a-7ed6-4838-9669-9c2f925f8c1d\",\"text\":\"北京玉龙石化工程有限公司\",\"code\":\"100193\",\"keyword\":\"BJYLSHGCYXGS,BJYLDHGCYXGS\"},{\"id\":\"8c3c4f29-b6b3-4381-acf3-5dfe82e4d626\",\"text\":\"长岭炼化岳阳工程设计有限公司\",\"code\":\"100194\",\"keyword\":\"ZLLHYYGCSJYXGS,CLLHYYGCSJYXGS\"},{\"id\":\"f16b42f9-62c7-4c0c-bde6-70ae9f40ca34\",\"text\":\"沈阳测绘勘测设计研究院\",\"code\":\"100195\",\"keyword\":\"SYCHKCSJYJY,CYCHKCSJYJY\"},{\"id\":\"bb615453-1bc4-44e0-afa0-6e93b28f7c82\",\"text\":\"合肥勘察测绘设计院\",\"code\":\"100196\",\"keyword\":\"HFKCCHSJY,GFKCCHSJY\"},{\"id\":\"39ff5412-5966-4a6e-9e87-433ee28dd4bb\",\"text\":\"贵阳铝镁设计院\",\"code\":\"100197\",\"keyword\":\"GYLMSJY\"},{\"id\":\"0dd735fe-2839-4363-a17d-f3282f1895c4\",\"text\":\"中国船舶及海洋工程设计研究院\",\"code\":\"100198\",\"keyword\":\"ZGCBJHYGCSJYJY\"},{\"id\":\"14808a17-cb67-4443-be92-2ece27501797\",\"text\":\"青岛市人防建筑设计研究院\",\"code\":\"100199\",\"keyword\":\"QDSRFJZSJYJY\"},{\"id\":\"41dd4bee-cd7d-413b-bbe4-55cba9e88aa6\",\"text\":\"中国舰船研究设计中心701研究所\",\"code\":\"100200\",\"keyword\":\"ZGJCYJSJZXYJS\"},{\"id\":\"14935fff-d00f-4dfb-97c6-bda5e6a38a9d\",\"text\":\"中国有色金属长沙勘察设计研究院\",\"code\":\"100201\",\"keyword\":\"ZGYSJZZSKCSJYJY,ZGYSJZCSKCSJYJY,ZGYSJSZSKCSJYJY,ZGYSJSCSKCSJYJY\"},{\"id\":\"39d07d25-3d56-4029-b0e6-32ce913e51a7\",\"text\":\"昆明诚信勘察设计院\",\"code\":\"100202\",\"keyword\":\"KMCXKCSJY\"},{\"id\":\"96e6e579-fb95-4b36-9345-28e6e8ff9821\",\"text\":\"中冶建研设计院环保事业部\",\"code\":\"100203\",\"keyword\":\"ZYJYSJYHBSYB\"},{\"id\":\"e89d7d36-985f-4cba-9e19-d0976b15be95\",\"text\":\"福建省建筑设计研究院\",\"code\":\"100204\",\"keyword\":\"FJSJZSJYJY,FJXJZSJYJY\"},{\"id\":\"452efea8-13b8-43c2-8ef4-7a263184f766\",\"text\":\"四川海辰工程设计院有限公司\",\"code\":\"100205\",\"keyword\":\"SCHCGCSJYYXGS\"},{\"id\":\"0e27510e-e430-4f75-a058-cd0dfa15672c\",\"text\":\"中冶建筑设计研究总院\",\"code\":\"100206\",\"keyword\":\"ZYJZSJYJZY\"},{\"id\":\"1fb79091-4f4d-44ee-9cfa-3bf5d9945407\",\"text\":\"中南建筑设计院股份有限公司 \",\"code\":\"100207\",\"keyword\":\"ZNJZSJYGFYXGS\"},{\"id\":\"af2fb3c8-c51f-4cb2-b2d0-367d52308e11\",\"text\":\"云南怡成建筑设计公司\",\"code\":\"100208\",\"keyword\":\"YNYCJZSJGS\"},{\"id\":\"7962e095-0e8b-4c2d-9df2-6998d53d9337\",\"text\":\"浙江华坤建筑设计院有限公司\",\"code\":\"100209\",\"keyword\":\"ZJHKJZSJYYXGS\"},{\"id\":\"c61406ed-0fd5-4df5-bf3b-8d0fca20e726\",\"text\":\"唐山铭嘉建筑设计咨询有限公司\",\"code\":\"100210\",\"keyword\":\"TSMJJZSJZXYXGS\"},{\"id\":\"aa207db4-6530-4ede-9599-61464967888b\",\"text\":\"河南省电力勘测设计院\",\"code\":\"100211\",\"keyword\":\"HNSDLKCSJY,HNXDLKCSJY\"},{\"id\":\"1209412d-95bb-4c40-845d-28ba5634ffdd\",\"text\":\"河北省电力勘测设计院\",\"code\":\"100212\",\"keyword\":\"HBSDLKCSJY,HBXDLKCSJY\"}]" ; + List> data = JsonUtil.getJsonToListMap(json); + if (!StringUtils.isEmpty(page.getKeyword())) { + data = data.stream().filter(t -> String.valueOf(t.get("code")).contains(page.getKeyword()) || String.valueOf(t.get("keyword")).contains(page.getKeyword()) || String.valueOf(t.get("text")).contains(page.getKeyword())).collect(Collectors.toList()); + } + data = data.stream().limit(10).collect(Collectors.toList()); + List list = JsonUtil.getJsonToList(data, OrderCustomerVO.class); + ListVO vo = new ListVO(); + vo.setList(list); + return ActionResult.success(vo); + } + + /** + * 获取商品列表 + * + * @param page 分页模型 + * @return + */ + @Operation(summary = "获取商品列表") + @GetMapping("/Goods") + @SaCheckPermission("extend.order") + public ActionResult> goodsList(Page page) { + String json = "[{\"id\":\"692110120107\",\"code\":\"106423\",\"text\":\"蜡笔小新棒棒冰\",\"specifications\":\"85g\",\"unit\":\"支\",\"price\":\"0.81\",\"keyword\":\"ZBXXBBB,LBXXBBB\"},{\"id\":\"692364427858\",\"code\":\"974498\",\"text\":\"蒙牛纯甄酸牛奶原味\",\"specifications\":\"200g\",\"unit\":\"盒\",\"price\":\"4.46\",\"keyword\":\"MNCZSNNYW\"},{\"id\":\"690799251257\",\"code\":\"416821\",\"text\":\"伊利安慕希希腊酸奶\",\"specifications\":\"205g\",\"unit\":\"包\",\"price\":\"4.46\",\"keyword\":\"YLAMXXXSN,YLAMXXLSN\"},{\"id\":\"690102819104\",\"code\":\"524868\",\"text\":\"白沙精品香烟\",\"specifications\":\"\",\"unit\":\"包\",\"price\":\"7.29\",\"keyword\":\"BSJPXY\"},{\"id\":\"690040452111\",\"code\":\"828691\",\"text\":\"天友新鲜杯大红枣酸奶\",\"specifications\":\"160g\",\"unit\":\"杯\",\"price\":\"2.43\",\"keyword\":\"TYXXBDHZSN,TYXXBDGZSN\"},{\"id\":\"692364422345\",\"code\":\"107961\",\"text\":\"蒙牛纯牛奶\",\"specifications\":\"250ml\",\"unit\":\"盒\",\"price\":\"2.27\",\"keyword\":\"MNCNN\"},{\"id\":\"690102819349\",\"code\":\"532214\",\"text\":\"芙蓉王翻盖香烟\",\"specifications\":\"\",\"unit\":\"包\",\"price\":\"19.44\",\"keyword\":\"FRWFGXY\"},{\"id\":\"690799210027\",\"code\":\"111311\",\"text\":\"伊利纯牛奶\",\"specifications\":\"250ml\",\"unit\":\"盒\",\"price\":\"2.35\",\"keyword\":\"YLCNN\"},{\"id\":\"692586153106\",\"code\":\"111594\",\"text\":\"旺旺碎冰冰草莓味\",\"specifications\":\"78g\",\"unit\":\"支\",\"price\":\"0.81\",\"keyword\":\"WWSBBCMW\"},{\"id\":\"690103561369\",\"code\":\"469391\",\"text\":\"青岛清醇啤酒8度\",\"specifications\":\"330ml\",\"unit\":\"厅\",\"price\":\"2.03\",\"keyword\":\"QDQCPJD\"},{\"id\":\"694935220140\",\"code\":\"898237\",\"text\":\"雪花清爽8度听装啤酒\",\"specifications\":\"330ml\",\"unit\":\"厅\",\"price\":\"2.35\",\"keyword\":\"XHQSDTZPJ\"},{\"id\":\"693262090005\",\"code\":\"869640\",\"text\":\"徐七二白凉粉\",\"specifications\":\"50g\",\"unit\":\"盒\",\"price\":\"1.62\",\"keyword\":\"XQEBLF\"},{\"id\":\"693139200639\",\"code\":\"449683\",\"text\":\"蓝舰果味啤酒饮料\",\"specifications\":\"320ml\",\"unit\":\"厅\",\"price\":\"1.62\",\"keyword\":\"LJGWPJYL\"},{\"id\":\"692416071401\",\"code\":\"448472\",\"text\":\"无穷农场盐焗鸡蛋\",\"specifications\":\"30g\",\"unit\":\"盒\",\"price\":\"1.62\",\"keyword\":\"WQNCYJJD,MQNCYJJD\"},{\"id\":\"692586153183\",\"code\":\"111593\",\"text\":\"旺旺碎冰冰乳酸原味\",\"specifications\":\"78g\",\"unit\":\"支\",\"price\":\"0.81\",\"keyword\":\"WWSBBRSYW\"},{\"id\":\"692586153114\",\"code\":\"111595\",\"text\":\"旺旺碎冰冰葡萄味\",\"specifications\":\"78g\",\"unit\":\"支\",\"price\":\"0.81\",\"keyword\":\"WWSBBPTW\"},{\"id\":\"693273131006\",\"code\":\"473563\",\"text\":\"北京蓝氏经典菠萝啤\",\"specifications\":\"320ml\",\"unit\":\"厅\",\"price\":\"1.62\",\"keyword\":\"BJLZJDBLP,BJLSJDBLP\"},{\"id\":\"690103520063\",\"code\":\"493758\",\"text\":\"青岛崂山啤酒8度\",\"specifications\":\"330ml\",\"unit\":\"厅\",\"price\":\"1.62\",\"keyword\":\"QDLSPJD\"},{\"id\":\"692116850925\",\"code\":\"111576\",\"text\":\"农夫山泉\",\"specifications\":\"550ml\",\"unit\":\"瓶\",\"price\":\"1.46\",\"keyword\":\"NFSQ\"},{\"id\":\"692586153117\",\"code\":\"111598\",\"text\":\"旺旺碎冰冰菠萝\",\"specifications\":\"78g\",\"unit\":\"支\",\"price\":\"0.81\",\"keyword\":\"WWSBBBL\"},{\"id\":\"692250782275\",\"code\":\"466655\",\"text\":\"陈克明鸡蛋精制挂面\",\"specifications\":\"750g\",\"unit\":\"包\",\"price\":\"5.27\",\"keyword\":\"CKMJDJZGM\"},{\"id\":\"690102819101\",\"code\":\"107319\",\"text\":\"白沙软包香烟\",\"specifications\":\"\",\"unit\":\"包\",\"price\":\"4.05\",\"keyword\":\"BSRBXY\"},{\"id\":\"693686921537\",\"code\":\"465668\",\"text\":\"味芝元卤鸭掌\",\"specifications\":\"32g\",\"unit\":\"包\",\"price\":\"1.62\",\"keyword\":\"WZYLYZ\"},{\"id\":\"692293923162\",\"code\":\"570758\",\"text\":\"旺旺碎碎冰可乐味\",\"specifications\":\"78g\",\"unit\":\"支\",\"price\":\"0.81\",\"keyword\":\"WWSSBKYW,WWSSBKLW\"},{\"id\":\"690799251205\",\"code\":\"896808\",\"text\":\"伊利果粒优酸乳草莓味\",\"specifications\":\"245ml\",\"unit\":\"盒\",\"price\":\"2.43\",\"keyword\":\"YLGLYSRCMW\"},{\"id\":\"692364426850\",\"code\":\"781761\",\"text\":\"蒙牛真果粒草莓味\",\"specifications\":\"250g\",\"unit\":\"盒\",\"price\":\"2.84\",\"keyword\":\"MNZGLCMW\"},{\"id\":\"690289023413\",\"code\":\"860522\",\"text\":\"双汇香辣热狗肠\",\"specifications\":\"35g\",\"unit\":\"支\",\"price\":\"0.81\",\"keyword\":\"SHXLRGC\"},{\"id\":\"690289023416\",\"code\":\"860521\",\"text\":\"双汇玉米热狗肠\",\"specifications\":\"40g\",\"unit\":\"支\",\"price\":\"0.81\",\"keyword\":\"SHYMRGC\"},{\"id\":\"692586153116\",\"code\":\"111597\",\"text\":\"旺旺碎冰冰柑桔味\",\"specifications\":\"78g\",\"unit\":\"支\",\"price\":\"0.81\",\"keyword\":\"WWSBBGJW\"},{\"id\":\"694896010156\",\"code\":\"866442\",\"text\":\"哈尔滨冰爽啤酒\",\"specifications\":\"330ml\",\"unit\":\"瓶\",\"price\":\"2.27\",\"keyword\":\"HEBBSPJ\"},{\"id\":\"692586153182\",\"code\":\"111592\",\"text\":\"旺旺碎冰冰桃子味\",\"specifications\":\"78g\",\"unit\":\"支\",\"price\":\"0.81\",\"keyword\":\"WWSBBTZW\"},{\"id\":\"695476743038\",\"code\":\"898085\",\"text\":\"可口可乐雪碧\",\"specifications\":\"330ml\",\"unit\":\"厅\",\"price\":\"2.03\",\"keyword\":\"KKKYXB,KKKLXB\"},{\"id\":\"690102822742\",\"code\":\"464956\",\"text\":\"龙凤呈祥(新朝天门)\",\"specifications\":\"\",\"unit\":\"包\",\"price\":\"8.10\",\"keyword\":\"LFCXXZTM,LFCXXCTM\"},{\"id\":\"695056110013\",\"code\":\"465775\",\"text\":\"迪怩司脆脆冰水蜜桃味\",\"specifications\":\"82ml\",\"unit\":\"支\",\"price\":\"0.81\",\"keyword\":\"DNSCCBSMTW\"},{\"id\":\"690799251355\",\"code\":\"468959\",\"text\":\"伊利安慕希希腊酸奶香草味\",\"specifications\":\"205g\",\"unit\":\"盒\",\"price\":\"4.46\",\"keyword\":\"YLAMXXXSNXCW,YLAMXXLSNXCW\"},{\"id\":\"690128599121\",\"code\":\"807160\",\"text\":\"怡宝饮用纯净水\",\"specifications\":\"555ml\",\"unit\":\"瓶\",\"price\":\"1.46\",\"keyword\":\"YBYYCJS\"},{\"id\":\"690442290629\",\"code\":\"490952\",\"text\":\"科迪原生牛奶\",\"specifications\":\"180ml\",\"unit\":\"包\",\"price\":\"2.43\",\"keyword\":\"KDYSNN\"},{\"id\":\"695476741038\",\"code\":\"898083\",\"text\":\"可口可乐\",\"specifications\":\"330ml\",\"unit\":\"厅\",\"price\":\"2.03\",\"keyword\":\"KKKY,KKKL\"},{\"id\":\"694443701605\",\"code\":\"418138\",\"text\":\"小样乳酸菌乳原味\",\"specifications\":\"4*100ml\",\"unit\":\"板\",\"price\":\"6.48\",\"keyword\":\"XYRSJRYW\"},{\"id\":\"692481080131\",\"code\":\"827499\",\"text\":\"卡士调味鲜酪乳原味\",\"specifications\":\"120g\",\"unit\":\"杯\",\"price\":\"2.84\",\"keyword\":\"QSTWXLRYW,QSDWXLRYW,KSTWXLRYW,KSDWXLRYW\"},{\"id\":\"690152428238\",\"code\":\"532431\",\"text\":\"津威强化锌酸奶\",\"specifications\":\"95ml\",\"unit\":\"板\",\"price\":\"3.65\",\"keyword\":\"JWQHXSN,JWJHXSN\"},{\"id\":\"690799251285\",\"code\":\"438652\",\"text\":\"伊利安慕希蓝莓味金属包\",\"specifications\":\"205g\",\"unit\":\"盒\",\"price\":\"4.70\",\"keyword\":\"YLAMXLMWJZB,YLAMXLMWJSB\"},{\"id\":\"692364428269\",\"code\":\"480106\",\"text\":\"蒙牛纯甄风味酸奶牛奶芝士味\",\"specifications\":\"200g\",\"unit\":\"盒\",\"price\":\"4.86\",\"keyword\":\"MNCZFWSNNNZSW\"},{\"id\":\"690208389864\",\"code\":\"469458\",\"text\":\"娃哈哈桂圆莲子八宝粥\",\"specifications\":\"280g\",\"unit\":\"瓶\",\"price\":\"3.24\",\"keyword\":\"WHHGYLZBBZ,WHHGYLZBBY\"},{\"id\":\"690102807576\",\"code\":\"524873\",\"text\":\"中华翻盖香烟\",\"specifications\":\"\",\"unit\":\"包\",\"price\":\"36.45\",\"keyword\":\"ZHFGXY\"},{\"id\":\"692364428357\",\"code\":\"485055\",\"text\":\"蒙牛真果粒蓝莓\",\"specifications\":\"\",\"unit\":\"盒\",\"price\":\"2.84\",\"keyword\":\"MNZGLLM\"},{\"id\":\"692777090182\",\"code\":\"868462\",\"text\":\"山花草莓杯酸\",\"specifications\":\"100g\",\"unit\":\"杯\",\"price\":\"1.62\",\"keyword\":\"SHCMBS\"},{\"id\":\"695606400042\",\"code\":\"458194\",\"text\":\"雪天绿色加碘精制深井矿盐\",\"specifications\":\"400g\",\"unit\":\"盒\",\"price\":\"1.62\",\"keyword\":\"XTLSJDJZSJKY\"},{\"id\":\"692777090069\",\"code\":\"532429\",\"text\":\"山花纯牛奶\",\"specifications\":\"220ml\",\"unit\":\"包\",\"price\":\"2.03\",\"keyword\":\"SHCNN\"},{\"id\":\"690208388108\",\"code\":\"106964\",\"text\":\"娃哈哈AD钙\",\"specifications\":\"220g\",\"unit\":\"排\",\"price\":\"5.67\",\"keyword\":\"WHHG\"},{\"id\":\"692777090181\",\"code\":\"868460\",\"text\":\"山花原味杯酸\",\"specifications\":\"100g\",\"unit\":\"杯\",\"price\":\"1.62\",\"keyword\":\"SHYWBS\"},{\"id\":\"695636733868\",\"code\":\"916213\",\"text\":\"王老吉凉茶\",\"specifications\":\"310ml\",\"unit\":\"灌\",\"price\":\"3.24\",\"keyword\":\"WLJLC\"},{\"id\":\"690152413833\",\"code\":\"871920\",\"text\":\"津威彩装乳酸菌饮品\",\"specifications\":\"100ml\",\"unit\":\"排\",\"price\":\"6.89\",\"keyword\":\"JWCZRSJYP\"},{\"id\":\"692356788010\",\"code\":\"917231\",\"text\":\"咪咪是味条\",\"specifications\":\"20g\",\"unit\":\"包\",\"price\":\"0.41\",\"keyword\":\"MMSWT\"},{\"id\":\"692586153122\",\"code\":\"845220\",\"text\":\"旺旺碎碎冰家庭号\",\"specifications\":\"85ml*8\",\"unit\":\"袋\",\"price\":\"6.48\",\"keyword\":\"WWSSBJTH\"},{\"id\":\"690799251139\",\"code\":\"862009\",\"text\":\"伊利红谷礼盒苗条装\",\"specifications\":\"250ml\",\"unit\":\"盒\",\"price\":\"2.43\",\"keyword\":\"YLHYLHMTZ,YLHGLHMTZ,YLGYLHMTZ,YLGGLHMTZ\"},{\"id\":\"697046974031\",\"code\":\"491631\",\"text\":\"盐小厨加碘食盐绿袋\",\"specifications\":\"400g\",\"unit\":\"包\",\"price\":\"1.62\",\"keyword\":\"YXCJDSYLD\"},{\"id\":\"694791590801\",\"code\":\"825860\",\"text\":\"小号购物袋\",\"specifications\":\"24*40\",\"unit\":\"个\",\"price\":\"0.16\",\"keyword\":\"XHGWD\"},{\"id\":\"693359561616\",\"code\":\"906227\",\"text\":\"恭兵合装豆干\",\"specifications\":\"25g\",\"unit\":\"包\",\"price\":\"0.81\",\"keyword\":\"GBHZDG,GBGZDG\"},{\"id\":\"692364426851\",\"code\":\"781762\",\"text\":\"蒙牛真果粒黄桃味\",\"specifications\":\"250g\",\"unit\":\"盒\",\"price\":\"2.84\",\"keyword\":\"MNZGLHTW\"},{\"id\":\"695606400043\",\"code\":\"460279\",\"text\":\"雪天海藻碘盐\",\"specifications\":\"320g\",\"unit\":\"包\",\"price\":\"2.03\",\"keyword\":\"XTHZDY\"},{\"id\":\"693686770007\",\"code\":\"446585\",\"text\":\"土豆粉\",\"specifications\":\"\",\"unit\":\"袋\",\"price\":\"2.03\",\"keyword\":\"TDF\"},{\"id\":\"693466508765\",\"code\":\"856955\",\"text\":\"蒙牛优益C活性乳酸菌原味\",\"specifications\":\"340ml\",\"unit\":\"瓶\",\"price\":\"5.27\",\"keyword\":\"MNYYHXRSJYW\"},{\"id\":\"690799210001\",\"code\":\"106924\",\"text\":\"伊利优酸乳草莓味\",\"specifications\":\"250ml\",\"unit\":\"盒\",\"price\":\"1.62\",\"keyword\":\"YLYSRCMW\"},{\"id\":\"692364424293\",\"code\":\"106906\",\"text\":\"蒙牛酸酸乳草莓味\",\"specifications\":\"250ml\",\"unit\":\"盒\",\"price\":\"1.46\",\"keyword\":\"MNSSRCMW\"},{\"id\":\"690102819102\",\"code\":\"107278\",\"text\":\"白沙翻盖白沙\",\"specifications\":\"\",\"unit\":\"包\",\"price\":\"4.46\",\"keyword\":\"BSFGBS\"},{\"id\":\"694791590802\",\"code\":\"825861\",\"text\":\"中号购物袋\",\"specifications\":\"30*50\",\"unit\":\"个\",\"price\":\"0.16\",\"keyword\":\"ZHGWD\"},{\"id\":\"690102803974\",\"code\":\"860194\",\"text\":\"贵烟(硬黄精品)\",\"specifications\":\"\",\"unit\":\"包\",\"price\":\"10.13\",\"keyword\":\"GYYHJP\"},{\"id\":\"693472810060\",\"code\":\"862349\",\"text\":\"福太子石锅剁椒鱼条\",\"specifications\":\"15g\",\"unit\":\"包\",\"price\":\"0.81\",\"keyword\":\"FTZSGDJYT,FTZDGDJYT\"},{\"id\":\"695010380149\",\"code\":\"947876\",\"text\":\"丝美乐青花系列3层软抽\",\"specifications\":\"402张\",\"unit\":\"包\",\"price\":\"3.24\",\"keyword\":\"SMYQHXLCRC,SMYQHJLCRC,SMLQHXLCRC,SMLQHJLCRC\"},{\"id\":\"690799251195\",\"code\":\"896814\",\"text\":\"伊利QQ星营养果汁酸奶草莓味\",\"specifications\":\"200ml\",\"unit\":\"瓶\",\"price\":\"2.43\",\"keyword\":\"YLXYYGZSNCMW\"},{\"id\":\"693472810059\",\"code\":\"862351\",\"text\":\"福太子老坛山椒鱼条\",\"specifications\":\"15g\",\"unit\":\"包\",\"price\":\"0.81\",\"keyword\":\"FTZLTSJYT\"},{\"id\":\"693472810066\",\"code\":\"862353\",\"text\":\"福太子爽辣鱼条\",\"specifications\":\"15g\",\"unit\":\"包\",\"price\":\"0.81\",\"keyword\":\"FTZSLYT\"},{\"id\":\"694021188960\",\"code\":\"927737\",\"text\":\"养乐多\",\"specifications\":\"5*100ml\",\"unit\":\"排\",\"price\":\"10.37\",\"keyword\":\"YYD,YLD\"},{\"id\":\"693466508645\",\"code\":\"864162\",\"text\":\"蒙牛红枣酸牛奶\",\"specifications\":\"8*100g\",\"unit\":\"条\",\"price\":\"13.61\",\"keyword\":\"MNHZSNN,MNGZSNN\"},{\"id\":\"690799250013\",\"code\":\"107205\",\"text\":\"伊利高钙低脂奶\",\"specifications\":\"250ml\",\"unit\":\"盒\",\"price\":\"2.51\",\"keyword\":\"YLGGDZN\"},{\"id\":\"692364424292\",\"code\":\"106798\",\"text\":\"蒙牛酸酸乳原味\",\"specifications\":\"250ml\",\"unit\":\"盒\",\"price\":\"1.46\",\"keyword\":\"MNSSRYW\"},{\"id\":\"690102819385\",\"code\":\"524879\",\"text\":\"芙蓉王极品香烟\",\"specifications\":\"\",\"unit\":\"包\",\"price\":\"27.54\",\"keyword\":\"FRWJPXY\"},{\"id\":\"693686921522\",\"code\":\"465670\",\"text\":\"味芝元香辣鱼尾\",\"specifications\":\"32g\",\"unit\":\"包\",\"price\":\"1.62\",\"keyword\":\"WZYXLYY,WZYXLYW\"},{\"id\":\"690799250001\",\"code\":\"106870\",\"text\":\"伊利原味优酸乳饮料\",\"specifications\":\"250ml\",\"unit\":\"盒\",\"price\":\"1.62\",\"keyword\":\"YLYWYSRYL\"},{\"id\":\"693468857834\",\"code\":\"488594\",\"text\":\"家佳食加碘盐\",\"specifications\":\"350g\",\"unit\":\"袋\",\"price\":\"0.81\",\"keyword\":\"JJSJDY\"},{\"id\":\"690799251258\",\"code\":\"970744\",\"text\":\"伊利味可滋香蕉牛奶\",\"specifications\":\"240ml\",\"unit\":\"盒\",\"price\":\"4.05\",\"keyword\":\"YLWKZXQNN,YLWKZXJNN\"},{\"id\":\"692364425048\",\"code\":\"105698\",\"text\":\"蒙牛草莓果粒酸牛奶\",\"specifications\":\"100g\",\"unit\":\"杯\",\"price\":\"1.81\",\"keyword\":\"MNCMGLSNN\"},{\"id\":\"690799251336\",\"code\":\"469128\",\"text\":\"伊利100%畅意乳酸菌饮品原味\",\"specifications\":\"100ml\",\"unit\":\"排\",\"price\":\"6.48\",\"keyword\":\"YLCYRSJYPYW\"},{\"id\":\"692364426411\",\"code\":\"106702\",\"text\":\"蒙牛早餐核桃味牛奶\",\"specifications\":\"250ml\",\"unit\":\"盒\",\"price\":\"2.27\",\"keyword\":\"MNZCHTWNN\"},{\"id\":\"693686921523\",\"code\":\"465669\",\"text\":\"味芝元香辣鱼排\",\"specifications\":\"32g\",\"unit\":\"包\",\"price\":\"1.62\",\"keyword\":\"WZYXLYP\"},{\"id\":\"690040452354\",\"code\":\"466499\",\"text\":\"天友纸杯经典原味酸牛奶\",\"specifications\":\"160ml\",\"unit\":\"杯\",\"price\":\"3.24\",\"keyword\":\"TYZBJDYWSNN\"},{\"id\":\"692364426595\",\"code\":\"5454\",\"text\":\"蒙牛利乐砖优智成长奶\",\"specifications\":\"125ml\",\"unit\":\"瓶\",\"price\":\"2.03\",\"keyword\":\"MNLYZYZCZN,MNLYZYZCCN,MNLLZYZCZN,MNLLZYZCCN\"},{\"id\":\"694593067884\",\"code\":\"916757\",\"text\":\"泰香米\",\"specifications\":\"10kg\",\"unit\":\"袋\",\"price\":\"40.42\",\"keyword\":\"TXM\"},{\"id\":\"692245680503\",\"code\":\"659499\",\"text\":\"康师傅矿物质水\",\"specifications\":\"550ml\",\"unit\":\"瓶\",\"price\":\"0.81\",\"keyword\":\"KSFKWZS\"},{\"id\":\"692481080221\",\"code\":\"988651\",\"text\":\"卡士原味鲜酪乳\",\"specifications\":\"100g\",\"unit\":\"杯\",\"price\":\"3.56\",\"keyword\":\"QSYWXLR,KSYWXLR\"},{\"id\":\"692648763781\",\"code\":\"411382\",\"text\":\"属我棒山楂卷\",\"specifications\":\"\",\"unit\":\"个\",\"price\":\"1.22\",\"keyword\":\"ZWBSZJ,ZWBSCJ,SWBSZJ,SWBSCJ\"},{\"id\":\"695476747057\",\"code\":\"898096\",\"text\":\"可口可乐冰露饮用水\",\"specifications\":\"550ml\",\"unit\":\"瓶\",\"price\":\"0.41\",\"keyword\":\"KKKYBLYYS,KKKLBLYYS\"},{\"id\":\"690799251217\",\"code\":\"896809\",\"text\":\"伊利优酸乳果粒酸奶芒果味\",\"specifications\":\"245g\",\"unit\":\"盒\",\"price\":\"2.43\",\"keyword\":\"YLYSRGLSNWGW,YLYSRGLSNMGW\"},{\"id\":\"692777090043\",\"code\":\"557926\",\"text\":\"山花利乐砖纯牛奶\",\"specifications\":\"243ml\",\"unit\":\"盒\",\"price\":\"2.35\",\"keyword\":\"SHLYZCNN,SHLLZCNN\"},{\"id\":\"690799210355\",\"code\":\"480157\",\"text\":\"伊利红枣16连杯\",\"specifications\":\"100g*16\",\"unit\":\"条\",\"price\":\"24.14\",\"keyword\":\"YLHZLB,YLGZLB\"},{\"id\":\"690799251045\",\"code\":\"821001\",\"text\":\"伊利儿童全聪型成长奶\",\"specifications\":\"190ml\",\"unit\":\"盒\",\"price\":\"2.92\",\"keyword\":\"YLETQCXCZN,YLETQCXCCN\"},{\"id\":\"690799251321\",\"code\":\"467896\",\"text\":\"伊利QQ儿童风味酸奶\",\"specifications\":\"205g\",\"unit\":\"盒\",\"price\":\"4.46\",\"keyword\":\"YLETFWSN\"},{\"id\":\"690102819692\",\"code\":\"740635\",\"text\":\"白沙和天下烟\",\"specifications\":\"\",\"unit\":\"包\",\"price\":\"81.00\",\"keyword\":\"BSHTXY\"},{\"id\":\"692180470079\",\"code\":\"761202\",\"text\":\"陶华碧老干妈风味辣子鸡\",\"specifications\":\"280g\",\"unit\":\"瓶\",\"price\":\"7.21\",\"keyword\":\"YHBLGMFWLZJ,THBLGMFWLZJ\"},{\"id\":\"692364426849\",\"code\":\"781760\",\"text\":\"蒙牛真果粒芦荟味\",\"specifications\":\"250g\",\"unit\":\"盒\",\"price\":\"2.84\",\"keyword\":\"MNZGLLHW\"},{\"id\":\"692777090184\",\"code\":\"868464\",\"text\":\"山花菠萝杯酸\",\"specifications\":\"100g\",\"unit\":\"杯\",\"price\":\"1.62\",\"keyword\":\"SHBLBS\"},{\"id\":\"693466509111\",\"code\":\"471536\",\"text\":\"蒙牛风味酸牛奶原味\",\"specifications\":\"1*8*100g\",\"unit\":\"条\",\"price\":\"10.45\",\"keyword\":\"MNFWSNNYW\"},{\"id\":\"692180470064\",\"code\":\"526219\",\"text\":\"陶华碧老干妈香辣菜\",\"specifications\":\"80g\",\"unit\":\"包\",\"price\":\"1.54\",\"keyword\":\"YHBLGMXLC,THBLGMXLC\"},{\"id\":\"690799251293\",\"code\":\"439194\",\"text\":\"伊利谷粒多颗粒燕麦牛奶\",\"specifications\":\"200ml\",\"unit\":\"瓶\",\"price\":\"3.24\",\"keyword\":\"YLYLDKLYMNN,YLGLDKLYMNN\"},{\"id\":\"489159933839\",\"code\":\"840384\",\"text\":\"加多宝凉茶\",\"specifications\":\"310ml\",\"unit\":\"厅\",\"price\":\"2.84\",\"keyword\":\"JDBLC\"},{\"id\":\"695084919153\",\"code\":\"496658\",\"text\":\"竹纯量贩家庭装10包装\",\"specifications\":\"10包装\",\"unit\":\"提\",\"price\":\"7.21\",\"keyword\":\"ZCLFJTZBZ\"},{\"id\":\"692020288888\",\"code\":\"107087\",\"text\":\"红牛\",\"specifications\":\"250ml\",\"unit\":\"厅\",\"price\":\"4.78\",\"keyword\":\"HN,GN\"},{\"id\":\"692364426848\",\"code\":\"781758\",\"text\":\"蒙牛真果粒椰果味\",\"specifications\":\"250g\",\"unit\":\"盒\",\"price\":\"2.84\",\"keyword\":\"MNZGLYGW\"},{\"id\":\"692226644473\",\"code\":\"871631\",\"text\":\"清风无芯长卷纸\",\"specifications\":\"160g\",\"unit\":\"提\",\"price\":\"16.93\",\"keyword\":\"QFWXZJZ,QFWXCJZ,QFMXZJZ,QFMXCJZ\"},{\"id\":\"690128599124\",\"code\":\"819864\",\"text\":\"怡宝纯净水\",\"specifications\":\"350ml\",\"unit\":\"瓶\",\"price\":\"1.22\",\"keyword\":\"YBCJS\"},{\"id\":\"692364424074\",\"code\":\"105679\",\"text\":\"蒙牛黄桃杯酸奶\",\"specifications\":\"100g\",\"unit\":\"杯\",\"price\":\"1.81\",\"keyword\":\"MNHTBSN\"},{\"id\":\"695476744148\",\"code\":\"898084\",\"text\":\"可口可乐芬达\",\"specifications\":\"330ml\",\"unit\":\"厅\",\"price\":\"2.03\",\"keyword\":\"KKKYFD,KKKLFD\"},{\"id\":\"692257770418\",\"code\":\"868833\",\"text\":\"君乐宝老酸奶\",\"specifications\":\"139g\",\"unit\":\"杯\",\"price\":\"3.97\",\"keyword\":\"JYBLSN,JLBLSN\"},{\"id\":\"693686921560\",\"code\":\"484363\",\"text\":\"味芝元香辣鸭腿\",\"specifications\":\"38g\",\"unit\":\"袋\",\"price\":\"1.62\",\"keyword\":\"WZYXLYT\"},{\"id\":\"692180470075\",\"code\":\"702596\",\"text\":\"陶华碧老干妈风味豆豉\",\"specifications\":\"280g\",\"unit\":\"瓶\",\"price\":\"6.40\",\"keyword\":\"YHBLGMFWDC,THBLGMFWDC\"},{\"id\":\"692250780650\",\"code\":\"836475\",\"text\":\"陈克明鸡蛋面\",\"specifications\":\"150g\",\"unit\":\"包\",\"price\":\"1.22\",\"keyword\":\"CKMJDM\"},{\"id\":\"694898891870\",\"code\":\"492632\",\"text\":\"喜步佳男式凉拖鞋\",\"specifications\":\"1870\",\"unit\":\"双\",\"price\":\"6.40\",\"keyword\":\"XBJNSLTX\"},{\"id\":\"690102804688\",\"code\":\"532395\",\"text\":\"云烟紫红云烟\",\"specifications\":\"\",\"unit\":\"包\",\"price\":\"8.10\",\"keyword\":\"YYZHYY,YYZGYY\"},{\"id\":\"693153490038\",\"code\":\"482836\",\"text\":\"深井盐\",\"specifications\":\"500g\",\"unit\":\"袋\",\"price\":\"1.22\",\"keyword\":\"SJY\"},{\"id\":\"694898891869\",\"code\":\"492631\",\"text\":\"喜步佳女式凉拖鞋\",\"specifications\":\"1869\",\"unit\":\"双\",\"price\":\"6.40\",\"keyword\":\"XBJNSLTX\"},{\"id\":\"690324437095\",\"code\":\"105155\",\"text\":\"七度空间少女装超薄日用\",\"specifications\":\"10片\",\"unit\":\"包\",\"price\":\"6.89\",\"keyword\":\"QDKJSNZCBRY\"},{\"id\":\"690847100470\",\"code\":\"930487\",\"text\":\"养元精研型六个核桃\",\"specifications\":\"240ml\",\"unit\":\"瓶\",\"price\":\"3.24\",\"keyword\":\"YYJYXLGHT\"},{\"id\":\"694791590803\",\"code\":\"825862\",\"text\":\"大号购物袋\",\"specifications\":\"38*60\",\"unit\":\"个\",\"price\":\"0.41\",\"keyword\":\"DHGWD\"},{\"id\":\"692777090183\",\"code\":\"868465\",\"text\":\"山花芦荟杯酸\",\"specifications\":\"100g\",\"unit\":\"杯\",\"price\":\"1.62\",\"keyword\":\"SHLHBS\"},{\"id\":\"695311906083\",\"code\":\"471893\",\"text\":\"雪花金威优选易拉罐\",\"specifications\":\"330ml\",\"unit\":\"罐\",\"price\":\"2.35\",\"keyword\":\"XHJWYXYLG\"},{\"id\":\"691198802529\",\"code\":\"494075\",\"text\":\"达利园豆本豆利乐包原味豆奶\",\"specifications\":\"250ml\",\"unit\":\"袋\",\"price\":\"2.84\",\"keyword\":\"DLYDBDLYBYWDN,DLYDBDLLBYWDN\"},{\"id\":\"695606400059\",\"code\":\"484289\",\"text\":\"雪天精制加碘深井矿盐\",\"specifications\":\"500g\",\"unit\":\"包\",\"price\":\"1.62\",\"keyword\":\"XTJZJDSJKY\"},{\"id\":\"690102807577\",\"code\":\"524934\",\"text\":\"中华软包香烟\",\"specifications\":\"\",\"unit\":\"包\",\"price\":\"52.65\",\"keyword\":\"ZHRBXY\"},{\"id\":\"692647520207\",\"code\":\"111617\",\"text\":\"喜之郎原味辣味美好时光海苔\",\"specifications\":\"4.5g\",\"unit\":\"袋\",\"price\":\"3.97\",\"keyword\":\"XZLYWLWMHSGHT\"},{\"id\":\"692231840011\",\"code\":\"806347\",\"text\":\"华辉白凉粉\",\"specifications\":\"50g\",\"unit\":\"盒\",\"price\":\"1.62\",\"keyword\":\"HHBLF\"},{\"id\":\"690040452163\",\"code\":\"860710\",\"text\":\"天友经典老酸奶\",\"specifications\":\"160g\",\"unit\":\"袋\",\"price\":\"4.05\",\"keyword\":\"TYJDLSN\"},{\"id\":\"690324498125\",\"code\":\"118302\",\"text\":\"心相印双层压花餐巾纸\",\"specifications\":\"50张\",\"unit\":\"包\",\"price\":\"1.62\",\"keyword\":\"XXYSCYHCJZ\"},{\"id\":\"695515040031\",\"code\":\"434146\",\"text\":\"圣牧全程有机酸奶\",\"specifications\":\"205g\",\"unit\":\"瓶\",\"price\":\"5.35\",\"keyword\":\"SMQCYJSN\"},{\"id\":\"690799250037\",\"code\":\"107986\",\"text\":\"伊利高钙奶\",\"specifications\":\"250ml\",\"unit\":\"盒\",\"price\":\"2.51\",\"keyword\":\"YLGGN\"},{\"id\":\"690799251196\",\"code\":\"896815\",\"text\":\"伊利QQ星营养果汁酸奶香蕉味\",\"specifications\":\"200ml\",\"unit\":\"瓶\",\"price\":\"2.43\",\"keyword\":\"YLXYYGZSNXQW,YLXYYGZSNXJW\"},{\"id\":\"692213010110\",\"code\":\"106608\",\"text\":\"太太乐鸡精\",\"specifications\":\"40g\",\"unit\":\"袋\",\"price\":\"1.78\",\"keyword\":\"TTYJJ,TTLJJ\"},{\"id\":\"693427299207\",\"code\":\"469726\",\"text\":\"维邦竹琨卷纸\",\"specifications\":\"1800g\",\"unit\":\"提\",\"price\":\"25.84\",\"keyword\":\"WBZKJZ\"},{\"id\":\"692364424031\",\"code\":\"1072\",\"text\":\"蒙牛高钙低脂奶\",\"specifications\":\"250ml\",\"unit\":\"盒\",\"price\":\"2.59\",\"keyword\":\"MNGGDZN\"},{\"id\":\"690799251043\",\"code\":\"821003\",\"text\":\"伊利儿童健固型成长奶\",\"specifications\":\"190ml\",\"unit\":\"盒\",\"price\":\"2.92\",\"keyword\":\"YLETJGXCZN,YLETJGXCCN\"},{\"id\":\"694673506009\",\"code\":\"448873\",\"text\":\"华雄荔枝爽\",\"specifications\":\"240g\",\"unit\":\"厅\",\"price\":\"1.62\",\"keyword\":\"HXLZS\"},{\"id\":\"690799210391\",\"code\":\"480147\",\"text\":\"伊利原味发酵乳8连杯特惠装\",\"specifications\":\"8*100g\",\"unit\":\"条\",\"price\":\"10.37\",\"keyword\":\"YLYWFJRLBTHZ\"},{\"id\":\"690289023418\",\"code\":\"862032\",\"text\":\"双汇台式烤肠\",\"specifications\":\"48g\",\"unit\":\"支\",\"price\":\"1.62\",\"keyword\":\"SHTSKC\"},{\"id\":\"692364427215\",\"code\":\"825088\",\"text\":\"蒙牛早餐奶红枣味\",\"specifications\":\"250ml\",\"unit\":\"盒\",\"price\":\"2.27\",\"keyword\":\"MNZCNHZW,MNZCNGZW\"},{\"id\":\"690040452283\",\"code\":\"934348\",\"text\":\"天友低乳糖酸牛奶\",\"specifications\":\"160g\",\"unit\":\"杯\",\"price\":\"3.24\",\"keyword\":\"TYDRTSNN\"},{\"id\":\"692530758886\",\"code\":\"495342\",\"text\":\"网袋白蒜\",\"specifications\":\"\",\"unit\":\"袋\",\"price\":\"2.43\",\"keyword\":\"WDBS\"},{\"id\":\"691001901115\",\"code\":\"873329\",\"text\":\"雕牌洗衣皂\",\"specifications\":\"2*202g\",\"unit\":\"组\",\"price\":\"5.27\",\"keyword\":\"DPXYZ\"},{\"id\":\"692224181017\",\"code\":\"489962\",\"text\":\"一起旺冰冰家庭号\",\"specifications\":\"78ml*8\",\"unit\":\"包\",\"price\":\"5.59\",\"keyword\":\"YQWBBJTH\"},{\"id\":\"691896200584\",\"code\":\"901215\",\"text\":\"裕湘绿豆面\",\"specifications\":\"900g\",\"unit\":\"包\",\"price\":\"5.59\",\"keyword\":\"YXLDM\"},{\"id\":\"690799251154\",\"code\":\"863552\",\"text\":\"伊利QQ星儿童成长奶营养均膳型\",\"specifications\":\"190ml\",\"unit\":\"盒\",\"price\":\"3.24\",\"keyword\":\"YLXETCZNYYYSX,YLXETCZNYYJSX,YLXETCCNYYYSX,YLXETCCNYYJSX\"},{\"id\":\"692777090198\",\"code\":\"890737\",\"text\":\"山花红枣杯酸奶\",\"specifications\":\"100g\",\"unit\":\"杯\",\"price\":\"1.62\",\"keyword\":\"SHHZBSN,SHGZBSN\"},{\"id\":\"506047840047\",\"code\":\"488292\",\"text\":\"牛轰轰阙宇豪小弟弟吸吸棒\",\"specifications\":\"\",\"unit\":\"包\",\"price\":\"1.22\",\"keyword\":\"NHHQYHXDDXXB\"},{\"id\":\"692840952176\",\"code\":\"440493\",\"text\":\"佳益新蓝风8连包\",\"specifications\":\"2880抽\",\"unit\":\"提\",\"price\":\"16.93\",\"keyword\":\"JYXLFLB\"},{\"id\":\"690799251318\",\"code\":\"458554\",\"text\":\"伊利畅意100乳酸菌\",\"specifications\":\"330ml\",\"unit\":\"瓶\",\"price\":\"4.05\",\"keyword\":\"YLCYRSJ\"},{\"id\":\"690107060057\",\"code\":\"826686\",\"text\":\"云南白药牙膏留兰香型\",\"specifications\":\"180g\",\"unit\":\"支\",\"price\":\"27.38\",\"keyword\":\"YNBYYGLLXX\"},{\"id\":\"692225545142\",\"code\":\"870998\",\"text\":\"百岁山矿泉水\",\"specifications\":\"570ml\",\"unit\":\"瓶\",\"price\":\"2.43\",\"keyword\":\"BSSKQS\"},{\"id\":\"692416071354\",\"code\":\"422905\",\"text\":\"无穷香辣烤小腿\",\"specifications\":\"13g\",\"unit\":\"包\",\"price\":\"2.03\",\"keyword\":\"WQXLKXT,MQXLKXT\"},{\"id\":\"692481080080\",\"code\":\"827494\",\"text\":\"卡士鲜酪乳原味\",\"specifications\":\"100g\",\"unit\":\"杯\",\"price\":\"4.05\",\"keyword\":\"QSXLRYW,KSXLRYW\"},{\"id\":\"692530377310\",\"code\":\"756872\",\"text\":\"统一来一桶老坛酸菜牛肉面\",\"specifications\":\"127g\",\"unit\":\"桶\",\"price\":\"3.24\",\"keyword\":\"TYLYTLTSCNRM\"},{\"id\":\"692737000340\",\"code\":\"482398\",\"text\":\"咪咪虾条Q包\",\"specifications\":\"240g\",\"unit\":\"袋\",\"price\":\"8.02\",\"keyword\":\"MMXTB,MMHTB\"},{\"id\":\"692364427188\",\"code\":\"824226\",\"text\":\"蒙牛妙妙乳饮料草莓味\",\"specifications\":\"125ml\",\"unit\":\"盒\",\"price\":\"1.22\",\"keyword\":\"MNMMRYLCMW\"},{\"id\":\"690799210004\",\"code\":\"520760\",\"text\":\"伊利AD钙奶\",\"specifications\":\"250ml\",\"unit\":\"盒\",\"price\":\"1.62\",\"keyword\":\"YLGN\"},{\"id\":\"690102803691\",\"code\":\"532259\",\"text\":\"黄果树佳品84全硬烤\",\"specifications\":\"\",\"unit\":\"包\",\"price\":\"5.27\",\"keyword\":\"HGSJPQYK\"},{\"id\":\"690799210358\",\"code\":\"480148\",\"text\":\"伊利U型杯红枣\",\"specifications\":\"160g\",\"unit\":\"杯\",\"price\":\"2.43\",\"keyword\":\"YLXBHZ,YLXBGZ\"},{\"id\":\"693686921566\",\"code\":\"484358\",\"text\":\"味芝元酱鸭脖\",\"specifications\":\"30g\",\"unit\":\"袋\",\"price\":\"1.62\",\"keyword\":\"WZYJYB\"},{\"id\":\"692689252205\",\"code\":\"5710\",\"text\":\"银鹭花生牛奶\",\"specifications\":\"250ml\",\"unit\":\"盒\",\"price\":\"1.62\",\"keyword\":\"YLHSNN\"},{\"id\":\"693816692032\",\"code\":\"807070\",\"text\":\"和丝露苹果醋(无糖)\",\"specifications\":\"488ml\",\"unit\":\"瓶\",\"price\":\"4.05\",\"keyword\":\"HSLPGCWT,HSLPGCMT\"},{\"id\":\"692347610944\",\"code\":\"104624\",\"text\":\"倍加洁超柔弹力护齿牙刷\",\"specifications\":\"\",\"unit\":\"支\",\"price\":\"4.21\",\"keyword\":\"BJJCRTLHCYS,BJJCRDLHCYS\"},{\"id\":\"690324437097\",\"code\":\"118364\",\"text\":\"七度空间纯棉夜用卫生巾\",\"specifications\":\"10片\",\"unit\":\"包\",\"price\":\"8.02\",\"keyword\":\"QDKJCMYYWSJ\"},{\"id\":\"692461580128\",\"code\":\"420954\",\"text\":\"湘盐绿色加碘精制盐\",\"specifications\":\"400g\",\"unit\":\"包\",\"price\":\"0.81\",\"keyword\":\"XYLSJDJZY\"},{\"id\":\"693483413044\",\"code\":\"855270\",\"text\":\"南山老酸奶\",\"specifications\":\"180g\",\"unit\":\"杯\",\"price\":\"4.46\",\"keyword\":\"NSLSN\"},{\"id\":\"694015941002\",\"code\":\"733810\",\"text\":\"百事可乐\",\"specifications\":\"600ml\",\"unit\":\"瓶\",\"price\":\"2.43\",\"keyword\":\"BSKY,BSKL\"},{\"id\":\"489102816445\",\"code\":\"968165\",\"text\":\"维他柠檬茶\",\"specifications\":\"250ml\",\"unit\":\"瓶\",\"price\":\"2.27\",\"keyword\":\"WTNMC\"},{\"id\":\"690799251316\",\"code\":\"438459\",\"text\":\"伊利铁罐金装核桃乳\",\"specifications\":\"240ml\",\"unit\":\"瓶\",\"price\":\"3.65\",\"keyword\":\"YLTGJZHTR\"},{\"id\":\"692364424135\",\"code\":\"106707\",\"text\":\"蒙牛早餐麦香味牛奶\",\"specifications\":\"250ml\",\"unit\":\"盒\",\"price\":\"2.27\",\"keyword\":\"MNZCMXWNN\"},{\"id\":\"691643220001\",\"code\":\"117213\",\"text\":\"长康白醋\",\"specifications\":\"500ml\",\"unit\":\"瓶\",\"price\":\"3.24\",\"keyword\":\"ZKBC,CKBC\"}]" ; + List> data = JsonUtil.getJsonToListMap(json); + if (!StringUtils.isEmpty(page.getKeyword())) { + data = data.stream().filter(t -> String.valueOf(t.get("code")).contains(page.getKeyword()) || String.valueOf(t.get("keyword")).contains(page.getKeyword()) || String.valueOf(t.get("text")).contains(page.getKeyword())).collect(Collectors.toList()); + } + List list = JsonUtil.getJsonToList(data, OrderGoodsVO.class); + ListVO vo = new ListVO(); + vo.setList(list); + return ActionResult.success(vo); + } +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/ProductController.java b/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/ProductController.java new file mode 100644 index 0000000..e96e217 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/ProductController.java @@ -0,0 +1,188 @@ +package com.yunzhupaas.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.entity.ProductEntity; +import com.yunzhupaas.entity.ProductEntryEntity; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.model.product.*; +import com.yunzhupaas.model.productEntry.ProductEntryInfoVO; +import com.yunzhupaas.model.productEntry.ProductEntryListVO; +import com.yunzhupaas.model.productEntry.ProductEntryMdoel; +import com.yunzhupaas.service.ProductEntryService; +import com.yunzhupaas.service.ProductService; +import com.yunzhupaas.util.JsonUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +/** + * 销售订单 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021-07-10 10:40:59 + */ +@Slf4j +@RestController +@Tag(name = "销售订单", description = "Product") +@RequestMapping("/api/extend/saleOrder/Product") +public class ProductController extends SuperController { + + @Autowired + private ProductService productService; + @Autowired + private ProductEntryService productEntryService; + + /** + * 列表 + * + * @param productPagination 分页模型 + * @return + */ + @Operation(summary = "列表") + @GetMapping + @SaCheckPermission("saleOrder") + public ActionResult> list(ProductPagination productPagination) { + List list = productService.getList(productPagination); + List listVO = JsonUtil.getJsonToList(list, ProductListVO.class); + PageListVO vo = new PageListVO(); + vo.setList(listVO); + PaginationVO page = JsonUtil.getJsonToBean(productPagination, PaginationVO.class); + vo.setPagination(page); + return ActionResult.success(vo); + } + + /** + * 创建 + * + * @param productCrForm 销售模型 + * @return + */ + @Operation(summary = "创建") + @PostMapping + @Parameters({ + @Parameter(name = "productCrForm", description = "销售模型",required = true), + }) + @SaCheckPermission("saleOrder") + public ActionResult create(@RequestBody @Valid ProductCrForm productCrForm) throws DataException { + ProductEntity entity = JsonUtil.getJsonToBean(productCrForm, ProductEntity.class); + List productEntryList = JsonUtil.getJsonToList(productCrForm.getProductEntryList(), ProductEntryEntity.class); + productService.create(entity, productEntryList); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 信息 + * + * @param id 主键 + * @return + */ + @Operation(summary = "信息") + @GetMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键",required = true), + }) + @SaCheckPermission("saleOrder") + public ActionResult info(@PathVariable("id") String id) { + ProductEntity entity = productService.getInfo(id); + ProductInfoVO vo = JsonUtil.getJsonToBean(entity, ProductInfoVO.class); + List productEntryList = productEntryService.getProductentryEntityList(id); + List productList = JsonUtil.getJsonToList(productEntryList, ProductEntryInfoVO.class); + vo.setProductEntryList(productList); + return ActionResult.success(vo); + } + + /** + * 更新 + * + * @param productUpForm 销售模型 + * @param id 主键 + * @return + */ + @Operation(summary = "更新") + @PutMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键",required = true), + @Parameter(name = "productUpForm", description = "销售模型",required = true), + }) + @SaCheckPermission("saleOrder") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid ProductUpForm productUpForm) { + ProductEntity entity = productService.getInfo(id); + if (entity != null) { + List productEntryList = JsonUtil.getJsonToList(productUpForm.getProductEntryList(), ProductEntryEntity.class); + productService.update(id, entity, productEntryList); + return ActionResult.success(MsgCode.SU004.get()); + } else { + return ActionResult.fail(MsgCode.FA002.get()); + } + } + + /** + * 删除 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除") + @DeleteMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键",required = true), + }) + @SaCheckPermission("saleOrder") + public ActionResult delete(@PathVariable("id") String id) { + ProductEntity entity = productService.getInfo(id); + if (entity != null) { + productService.delete(entity); + } + return ActionResult.success(MsgCode.SU003.get()); + } + + /** + * 获取销售产品明细 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取销售明细") + @GetMapping("/ProductEntry/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键",required = true), + }) + @SaCheckPermission("saleOrder") + public ActionResult> ProductEntryList(@PathVariable("id") String id) { + String data = "[{\"id\":\"37c995b4044541009fb7e285bcf9845d\",\"productSpecification\":\"120ml\",\"qty\":16,\"money\":510,\"price\":120,\"commandType\":\"唯一码\",\"util\":\"盒\"},{\"id\":\"2dbb11d3cde04c299985ac944d130ba0\",\"productSpecification\":\"150ml\",\"qty\":15,\"money\":520,\"price\":310,\"commandType\":\"唯一码\",\"util\":\"盒\"},{\"id\":\"f8ec261ccdf045e5a2e1f0e5485cda76\",\"productSpecification\":\"40ml\",\"qty\":13,\"money\":530,\"price\":140,\"commandType\":\"唯一码\",\"util\":\"盒\"},{\"id\":\"6c110b57ae56445faa8ce9be501c8997\",\"productSpecification\":\"103ml\",\"qty\":2,\"money\":504,\"price\":150,\"commandType\":\"唯一码\",\"util\":\"盒\"},{\"id\":\"f2ee981aaf934147a4d090a0eed2203f\",\"productSpecification\":\"120ml\",\"qty\":21,\"money\":550,\"price\":160,\"commandType\":\"唯一码\",\"util\":\"盒\"}]"; + List dataAll = JsonUtil.getJsonToList(data, ProductEntryMdoel.class); + List productEntryList = productEntryService.getProductentryEntityList(id); + List productList = JsonUtil.getJsonToList(productEntryList, ProductEntryListVO.class); + for (ProductEntryListVO entry : productList) { + List dataList = new ArrayList<>(); + Random random = new Random(); + int num = random.nextInt(dataAll.size()); + for (int i = 0; i < num; i++) { + dataList.add(dataAll.get(num)); + } + entry.setDataList(dataList); + } + ListVO vo = new ListVO(); + vo.setList(productList); + return ActionResult.success(vo); + } + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/ProductGoodsController.java b/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/ProductGoodsController.java new file mode 100644 index 0000000..79d89e0 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/ProductGoodsController.java @@ -0,0 +1,180 @@ +package com.yunzhupaas.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.entity.ProductGoodsEntity; +import com.yunzhupaas.model.productgoods.*; +import com.yunzhupaas.service.ProductGoodsService; +import com.yunzhupaas.util.JsonUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; +import java.util.List; + +/** + * 产品商品 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021-07-10 15:57:50 + */ +@Slf4j +@RestController +@Tag(name = "产品商品", description = "Goods") +@RequestMapping("/api/extend/saleOrder/Goods") +public class ProductGoodsController extends SuperController { + + @Autowired + private ProductGoodsService productgoodsService; + + /** + * 列表 + * + * @param type 类型 + * @return + */ + @GetMapping("/getGoodList") + @Operation(summary = "列表") + @Parameters({ + @Parameter(name = "type", description = "类型"), + }) + @SaCheckPermission("saleOrder") + public ActionResult> list(@RequestParam("type")String type) { + List list = productgoodsService.getGoodList(type); + List listVO = JsonUtil.getJsonToList(list, ProductGoodsListVO.class); + ListVO vo = new ListVO(); + vo.setList(listVO); + return ActionResult.success(vo); + } + + /** + * 列表 + * + * @param goodsPagination 分页模型 + * @return + */ + @GetMapping + @Operation(summary = "列表") + @SaCheckPermission("saleOrder") + public ActionResult> list(ProductGoodsPagination goodsPagination) { + List list = productgoodsService.getList(goodsPagination); + List listVO = JsonUtil.getJsonToList(list, ProductGoodsListVO.class); + PageListVO vo = new PageListVO(); + vo.setList(listVO); + PaginationVO page = JsonUtil.getJsonToBean(goodsPagination, PaginationVO.class); + vo.setPagination(page); + return ActionResult.success(vo); + } + + /** + * 创建 + * + * @param goodsCrForm 商品模型 + * @return + */ + @PostMapping + @Operation(summary = "创建") + @Parameters({ + @Parameter(name = "goodsCrForm", description = "商品模型",required = true), + }) + @SaCheckPermission("saleOrder") + public ActionResult create(@RequestBody @Valid ProductGoodsCrForm goodsCrForm) { + ProductGoodsEntity entity = JsonUtil.getJsonToBean(goodsCrForm, ProductGoodsEntity.class); + productgoodsService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 信息 + * + * @param id 主键 + * @return + */ + @Operation(summary = "信息") + @GetMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("saleOrder") + public ActionResult info(@PathVariable("id") String id) { + ProductGoodsEntity entity = productgoodsService.getInfo(id); + ProductGoodsInfoVO vo = JsonUtil.getJsonToBean(entity, ProductGoodsInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 更新 + * + * @param id 主键 + * @param goodsCrFormUpForm 商品模型 + * @return + */ + @PutMapping("/{id}") + @Operation(summary = "更新") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "goodsCrFormUpForm", description = "商品模型",required = true), + }) + @SaCheckPermission("saleOrder") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid ProductGoodsUpForm goodsCrFormUpForm) { + ProductGoodsEntity entity = JsonUtil.getJsonToBean(goodsCrFormUpForm, ProductGoodsEntity.class); + boolean ok = productgoodsService.update(id, entity); + if (ok) { + return ActionResult.success(MsgCode.SU004.get()); + } + return ActionResult.fail(MsgCode.FA002.get()); + } + + /** + * 删除 + * + * @param id 主键 + * @return + */ + @DeleteMapping("/{id}") + @Operation(summary = "删除") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("saleOrder") + public ActionResult delete(@PathVariable("id") String id) { + ProductGoodsEntity entity = productgoodsService.getInfo(id); + if (entity != null) { + productgoodsService.delete(entity); + } + return ActionResult.success(MsgCode.SU003.get()); + } + + /** + * 下拉 + * + * @param goodsPagination 下拉模型 + * @return + */ + @GetMapping("/Selector") + @Operation(summary = "下拉") + @SaCheckPermission("saleOrder") + public ActionResult> listSelect(ProductGoodsPagination goodsPagination) { + goodsPagination.setCurrentPage(1); + goodsPagination.setPageSize(50); + List list = productgoodsService.getList(goodsPagination); + List listVO = JsonUtil.getJsonToList(list, ProductGoodsListVO.class); + ListVO vo = new ListVO(); + vo.setList(listVO); + return ActionResult.success(vo); + } + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/ProductclassifyController.java b/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/ProductclassifyController.java new file mode 100644 index 0000000..e695b4e --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/ProductclassifyController.java @@ -0,0 +1,140 @@ +package com.yunzhupaas.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.entity.ProductclassifyEntity; +import com.yunzhupaas.model.productclassify.*; +import com.yunzhupaas.service.ProductclassifyService; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.treeutil.SumTree; +import com.yunzhupaas.util.treeutil.TreeDotUtils; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; +import java.util.List; + +/** + * 产品分类 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021-07-10 14:34:04 + */ +@Slf4j +@RestController +@Tag(name = "产品分类", description = "Classify") +@RequestMapping("/api/extend/saleOrder/Classify") +public class ProductclassifyController extends SuperController { + + @Autowired + private ProductclassifyService productclassifyService; + + /** + * 列表 + * + * @return + */ + @GetMapping + @Operation(summary = "列表") + @SaCheckPermission("saleOrder") + public ActionResult> list() { + List data = productclassifyService.getList(); + List modelList = JsonUtil.getJsonToList(data, ProductclassifyModel.class); + List> sumTrees = TreeDotUtils.convertListToTreeDot(modelList); + List list = JsonUtil.getJsonToList(sumTrees, ProductclassifyListVO.class); + ListVO vo = new ListVO(); + vo.setList(list); + return ActionResult.success(vo); + } + + /** + * 创建 + * + * @param classifyCrForm 分类模型 + * @return + */ + @PostMapping + @Operation(summary = "创建") + @Parameters({ + @Parameter(name = "classifyCrForm", description = "分类模型", required = true), + }) + @SaCheckPermission("saleOrder") + public ActionResult create(@RequestBody @Valid ProductclassifyCrForm classifyCrForm) { + ProductclassifyEntity entity = JsonUtil.getJsonToBean(classifyCrForm, ProductclassifyEntity.class); + productclassifyService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 信息 + * + * @param id 主键 + * @return + */ + @GetMapping("/{id}") + @Operation(summary = "信息") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("saleOrder") + public ActionResult info(@PathVariable("id") String id) { + ProductclassifyEntity entity = productclassifyService.getInfo(id); + ProductclassifyInfoVO vo = JsonUtil.getJsonToBean(entity, ProductclassifyInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 更新 + * + * @param id 主键 + * @param classifyUpForm 分类模型 + * @return + */ + @PutMapping("/{id}") + @Operation(summary = "更新") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "classifyUpForm", description = "分类模型", required = true), + }) + @SaCheckPermission("saleOrder") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid ProductclassifyUpForm classifyUpForm) { + ProductclassifyEntity entity = JsonUtil.getJsonToBean(classifyUpForm, ProductclassifyEntity.class); + boolean ok = productclassifyService.update(id, entity); + if (ok) { + return ActionResult.success(MsgCode.SU004.get()); + } + return ActionResult.fail(MsgCode.FA002.get()); + } + + /** + * 删除 + * + * @param id 主键 + * @return + */ + @DeleteMapping("/{id}") + @Operation(summary = "删除") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("saleOrder") + public ActionResult delete(@PathVariable("id") String id) { + ProductclassifyEntity entity = productclassifyService.getInfo(id); + if (entity != null) { + productclassifyService.delete(entity); + } + return ActionResult.success(MsgCode.SU003.get()); + } + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/ProjectGanttController.java b/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/ProjectGanttController.java new file mode 100644 index 0000000..daddb63 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/ProjectGanttController.java @@ -0,0 +1,323 @@ +package com.yunzhupaas.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.annotation.EncryptApi; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.Page; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.entity.ProjectGanttEntity; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.model.projectgantt.*; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.service.ProjectGanttService; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.JsonUtilEx; +import com.yunzhupaas.util.UploaderUtil; +import com.yunzhupaas.util.treeutil.ListToTreeUtil; +import com.yunzhupaas.util.treeutil.SumTree; +import com.yunzhupaas.util.treeutil.TreeDotUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 项目计划 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +@Tag(name = "项目计划", description = "ProjectGantt") +@RestController +@RequestMapping("/api/extend/ProjectGantt") +public class ProjectGanttController extends SuperController { + + @Autowired + private ProjectGanttService projectGanttService; + @Autowired + private UserService userService; + + + /** + * 项目列表 + * + * @param page 分页模型 + * @return + */ + @Operation(summary = "获取项目管理列表") + @GetMapping + @SaCheckPermission("extend.projectGantt") + public ActionResult> list(Page page) { + List data = projectGanttService.getList(page); + List list = JsonUtil.getJsonToList(data, ProjectGanttListVO.class); + //获取用户给项目参与人员列表赋值 + List userId = new ArrayList<>(); + list.forEach(t -> { + String[] ids = t.getManagerIds().split(","); + Collections.addAll(userId, ids); + }); + List userList = userService.getUserName(userId); + for (ProjectGanttListVO vo : list) { + List managerList = new ArrayList<>(); + Collections.addAll(managerList, vo.getManagerIds().split(",")); + List user = userList.stream().filter(t -> managerList.contains(t.getId())).collect(Collectors.toList()); + List list1 = new ArrayList<>(); + user.forEach(t -> { + ProjectGanttManagerIModel model1 = new ProjectGanttManagerIModel(); + model1.setAccount(t.getRealName() + "/" + t.getAccount()); + model1.setHeadIcon(UploaderUtil.uploaderImg(t.getHeadIcon())); + list1.add(model1); + }); + vo.setManagersInfo(list1); + } + ListVO listVO = new ListVO<>(); + listVO.setList(list); + return ActionResult.success(listVO); + } + + /** + * 任务列表 + * + * @param page 分页模型 + * @param projectId 主键 + * @return + */ + @Operation(summary = "获取项目任务列表") + @GetMapping("/{projectId}/Task") + @Parameters({ + @Parameter(name = "projectId", description = "主键",required = true), + }) + @SaCheckPermission("extend.projectGantt") + public ActionResult> taskList(Page page, @PathVariable("projectId") String projectId) { + List data = projectGanttService.getTaskList(projectId); + List dataAll = data; + if (!StringUtils.isEmpty(page.getKeyword())) { + data = data.stream().filter(t -> String.valueOf(t.getFullName()).contains(page.getKeyword()) || String.valueOf(t.getEnCode()).contains(page.getKeyword())).collect(Collectors.toList()); + } + List list = JsonUtil.getJsonToList(ListToTreeUtil.treeWhere(data, dataAll), ProjectGanttEntity.class); + List treeList = JsonUtil.getJsonToList(list, ProjectGanttTreeModel.class); + List> trees = TreeDotUtils.convertListToTreeDot(treeList); + List listVO = JsonUtil.getJsonToList(trees, ProjectGanttTaskTreeVO.class); + ListVO vo = new ListVO(); + vo.setList(listVO); + return ActionResult.success(vo); + } + + /** + * 任务树形 + * + * @param projectId 主键 + * @param id 主键 + * @return + */ + @Operation(summary = "获取项目计划任务树形(新建任务)") + @GetMapping("/{projectId}/Task/Selector/{id}") + @Parameters({ + @Parameter(name = "projectId", description = "主键",required = true), + @Parameter(name = "id", description = "主键",required = true), + }) + @SaCheckPermission("extend.projectGantt") + public ActionResult> taskTreeView(@PathVariable("projectId") String projectId, @PathVariable("id") String id) { + List treeList = new ArrayList<>(); + List data = projectGanttService.getTaskList(projectId); + if (!"0".equals(id)) { + //上级不能选择自己 + data.remove(projectGanttService.getInfo(id)); + } + for (ProjectGanttEntity entity : data) { + ProjectGanttTaskTreeModel treeModel = new ProjectGanttTaskTreeModel(); + treeModel.setId(entity.getId()); + treeModel.setFullName(entity.getFullName()); + treeModel.setParentId(entity.getParentId()); + treeList.add(treeModel); + } + List> trees = TreeDotUtils.convertListToTreeDotFilter(treeList); + List listVO = JsonUtil.getJsonToList(trees, ProjectGanttTaskTreeVO.class); + ListVO vo = new ListVO(); + vo.setList(listVO); + return ActionResult.success(vo); + } + + /** + * 信息 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取项目计划信息") + @GetMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键",required = true), + }) + @SaCheckPermission("extend.projectGantt") + public ActionResult info(@PathVariable("id") String id) throws DataException { + ProjectGanttEntity entity = projectGanttService.getInfo(id); + ProjectGanttInfoVO vo = JsonUtil.getJsonToBeanEx(entity, ProjectGanttInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 信息 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取项目计划信息") + @GetMapping("Task/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键",required = true), + }) + @SaCheckPermission("extend.projectGantt") + public ActionResult taskInfo(@PathVariable("id") String id) throws DataException { + ProjectGanttEntity entity = projectGanttService.getInfo(id); + ProjectGanttTaskInfoVO vo = JsonUtil.getJsonToBeanEx(entity, ProjectGanttTaskInfoVO.class); + return ActionResult.success(vo); + } + + + /** + * 删除 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除项目计划/任务") + @DeleteMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键",required = true), + }) + @SaCheckPermission("extend.projectGantt") + public ActionResult delete(@PathVariable("id") String id) { + if (projectGanttService.allowDelete(id)) { + ProjectGanttEntity entity = projectGanttService.getInfo(id); + if (entity != null) { + projectGanttService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } else { + return ActionResult.fail(MsgCode.ETD112.get()); + } + } + + /** + * 创建 + * + * @param projectGanttCrForm 项目模型 + * @return + */ + @EncryptApi + @Operation(summary = "添加项目计划") + @PostMapping + @Parameters({ + @Parameter(name = "projectGanttCrForm", description = "项目模型",required = true), + }) + @SaCheckPermission("extend.projectGantt") + public ActionResult create(@RequestBody @Valid ProjectGanttCrForm projectGanttCrForm) { + ProjectGanttEntity entity = JsonUtil.getJsonToBean(projectGanttCrForm, ProjectGanttEntity.class); + entity.setType(1); + entity.setParentId("0"); + if (projectGanttService.isExistByFullName(projectGanttCrForm.getFullName(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (projectGanttService.isExistByEnCode(projectGanttCrForm.getEnCode(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + projectGanttService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 编辑 + * + * @param id 主键 + * @param projectGanttUpForm 项目模型 + * @return + */ + @Operation(summary = "修改项目计划") + @PutMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键",required = true), + @Parameter(name = "projectGanttUpForm", description = "项目模型",required = true), + }) + @SaCheckPermission("extend.projectGantt") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid ProjectGanttUpForm projectGanttUpForm) { + ProjectGanttEntity entity = JsonUtil.getJsonToBean(projectGanttUpForm, ProjectGanttEntity.class); + if (projectGanttService.isExistByFullName(projectGanttUpForm.getFullName(), id)) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (projectGanttService.isExistByEnCode(projectGanttUpForm.getEnCode(), id)) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + boolean flag = projectGanttService.update(id, entity); + if (flag == false) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + + /** + * 创建 + * + * @param projectGanttTsakCrForm 项目模型 + * @return + */ + @Operation(summary = "添加项目任务") + @PostMapping("/Task") + @Parameters({ + @Parameter(name = "projectGanttTsakCrForm", description = "项目模型",required = true), + }) + @SaCheckPermission("extend.projectGantt") + public ActionResult createTask(@RequestBody @Valid ProjectGanttTsakCrForm projectGanttTsakCrForm) { + ProjectGanttEntity entity = JsonUtil.getJsonToBean(projectGanttTsakCrForm, ProjectGanttEntity.class); + entity.setType(2); + if (projectGanttService.isExistByFullName(projectGanttTsakCrForm.getFullName(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + projectGanttService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 编辑 + * + * @param id 主键 + * @param projectGanttTsakCrForm 项目模型 + * @return + */ + @Operation(summary = "修改项目任务") + @PutMapping("/Task/{id}") + @Parameters({ + @Parameter(name = "projectGanttTsakCrForm", description = "项目模型",required = true), + @Parameter(name = "id", description = "主键",required = true), + }) + @SaCheckPermission("extend.projectGantt") + public ActionResult updateTask(@PathVariable("id") String id, @RequestBody @Valid ProjectGanttTsakUpForm projectGanttTsakCrForm) { + ProjectGanttEntity entity = JsonUtil.getJsonToBean(projectGanttTsakCrForm, ProjectGanttEntity.class); + if (projectGanttService.isExistByFullName(projectGanttTsakCrForm.getFullName(), id)) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + boolean flag = projectGanttService.update(id, entity); + if (flag == false) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/ReportManageController.java b/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/ReportManageController.java new file mode 100644 index 0000000..ea1e012 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/ReportManageController.java @@ -0,0 +1,78 @@ +package com.yunzhupaas.controller; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.model.ReportManageModel; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.PinYinUtil; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.ArrayList; +import java.util.List; + +/** + * 专业报表 + * + * @author 云筑产品开发平台组 + * @version 版 本:V3.0.0 + * @copyright 深圳市乐程软件有限公司 + * @date 日 期:2020.01.30 + */ +@Tag(name = "专业报表", description = "获取专业报表列表") +@RestController +@RequestMapping("/api/extend/ReportManage") +public class ReportManageController { + + /** + * 列表 + * + * @return + */ + @Operation(summary = "获取专业报表列表") + @GetMapping + public ActionResult list() { + List data = new ArrayList<>(); + int num = 1000000000; + for (int i = 0; i < fullNameList().length; i++) { + ReportManageModel model = new ReportManageModel(); + model.setId(String.valueOf(num+i+1)); + model.setFullName(fullNameList()[i]); + model.setUrlAddress(PinYinUtil.getFullSpell(fullNameList()[i])); + if (i < 8) { + model.setCategory(categoryList()[0]); + }else if(i>=8 && i<=12){ + model.setCategory(categoryList()[1]); + }else if(i>=13 && i<=14){ + model.setCategory(categoryList()[2]); + }else if(i>=15 && i<=17){ + model.setCategory(categoryList()[3]); + }else if(i>=18 && i<=20){ + model.setCategory(categoryList()[4]); + }else if(i>=21 && i<=23){ + model.setCategory(categoryList()[5]); + }else if(i>23){ + model.setCategory(categoryList()[6]); + } + data.add(model); + } + return ActionResult.success(JsonUtil.listToJsonField(data)); + } + + private String[] categoryList() { + String[] category = {"报表示例", "Excel表格类", "Word文档类", "分栏与分组", "报表套打", "图表类", "其他示例"}; + return category; + } + + private String[] fullNameList() { + String[] fullName = {"房地产驾驶舱", "数字化营销", "市场营销", "SMT车间看板", "学校综合业绩表", "热线机器人数据分析", "渠道零售", + "承包方调查表", "多维透视表", "复杂交叉表", "煤矿三量基础表", "土地资源", "小学课程表", "销售合同模板", "干部任免审批表", + "单级分组", "多级分组", "分栏报表", "国航机票", "客户订单套打", "快递单套打", "常规图表", "人员离职分析", "销售分析趋势", + "标签打印", "报表水印", "文档目录"}; + return fullName; + } + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/ReportTemplateController.java b/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/ReportTemplateController.java new file mode 100644 index 0000000..eb619c4 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/ReportTemplateController.java @@ -0,0 +1,141 @@ +package com.yunzhupaas.controller; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.util.JsonUtil; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +import java.util.List; +import java.util.Map; + +/** + * 订单收款 + * + * @author 云筑产品开发平台组 + * @version v5.2.7 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +@Tag(name = "报表应用", description = "ReportTemplate") +@RestController +@RequestMapping("/api/extend/ReportTemplate") +public class ReportTemplateController { + + /** + * 商品采购报表 + * + * @return + */ + @Operation(summary = "获取商品采购报表") + @GetMapping("/Purchase") + public ActionResult purchaseList() { + String json = "[{\"f_date\":\"2015-11-30\",\"f_billNo\":\"CG20151130001\",\"f_buName\":\"长林电子材料厂\",\"f_invNo\":\"110013\",\"f_invName\":\"PVC包装纸\",\"f_unit\":\"箱\",\"f_location\":\"徐泾\",\"f_qty\":\"1000\",\"f_unitPrice\":\"12\",\"f_amount\":\"12000\",\"f_description\":null},{\"f_date\":\"2015-12-07\",\"f_billNo\":\"CG20151207001\",\"f_buName\":\"长林电子材料厂\",\"f_invNo\":\"110011\",\"f_invName\":\"泡棉\",\"f_unit\":\"箱\",\"f_location\":\"徐泾\",\"f_qty\":\"100\",\"f_unitPrice\":\"20\",\"f_amount\":\"2000\",\"f_description\":null},{\"f_date\":\"2015-12-08\",\"f_billNo\":\"CG20151208001\",\"f_buName\":\"长林电子材料厂\",\"f_invNo\":\"1001\",\"f_invName\":\"无纺布\",\"f_unit\":\"箱\",\"f_location\":\"徐泾\",\"f_qty\":\"900\",\"f_unitPrice\":\"30\",\"f_amount\":\"27000\",\"f_description\":null},{\"f_date\":\"2015-12-30\",\"f_billNo\":\"CG20151230001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"110013\",\"f_invName\":\"LED灯套\",\"f_unit\":\"箱\",\"f_location\":\"徐泾\",\"f_qty\":\"5\",\"f_unitPrice\":\"100\",\"f_amount\":\"500\",\"f_description\":null},{\"f_date\":\"2016-01-03\",\"f_billNo\":\"CG20160103001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"1002\",\"f_invName\":\"防尘罩\",\"f_unit\":\"箱\",\"f_location\":\"张江\",\"f_qty\":\"2\",\"f_unitPrice\":\"100\",\"f_amount\":\"200\",\"f_description\":null},{\"f_date\":\"2016-01-03\",\"f_billNo\":\"CG20160103001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"110011\",\"f_invName\":\"1号连接线\",\"f_unit\":\"箱\",\"f_location\":\"张江\",\"f_qty\":\"1\",\"f_unitPrice\":\"100\",\"f_amount\":\"100\",\"f_description\":null},{\"f_date\":\"2016-01-03\",\"f_billNo\":\"CG20160103001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"2001\",\"f_invName\":\"12#线路板\",\"f_unit\":\"吨\",\"f_location\":\"张江\",\"f_qty\":\"1\",\"f_unitPrice\":\"9000\",\"f_amount\":\"9000\",\"f_description\":null},{\"f_date\":\"2016-01-23\",\"f_billNo\":\"CG20160123001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"C00002\",\"f_invName\":\"防尘罩\",\"f_unit\":\"吨\",\"f_location\":\"张江\",\"f_qty\":\"3\",\"f_unitPrice\":\"9000\",\"f_amount\":\"27000\",\"f_description\":null},{\"f_date\":\"2016-02-10\",\"f_billNo\":\"CG20160210001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"1001\",\"f_invName\":\"1号连接线\",\"f_unit\":\"吨\",\"f_location\":\"张江\",\"f_qty\":\"4\",\"f_unitPrice\":\"8000\",\"f_amount\":\"32000\",\"f_description\":null},{\"f_date\":\"2016-02-22\",\"f_billNo\":\"CG20160222001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"A0001\",\"f_invName\":\"12#线路板\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"8\",\"f_unitPrice\":\"800\",\"f_amount\":\"6400\",\"f_description\":null},{\"f_date\":\"2016-03-02\",\"f_billNo\":\"CG20160302001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"1001\",\"f_invName\":\"12#线路板\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"1\",\"f_unitPrice\":\"800\",\"f_amount\":\"800\",\"f_description\":null},{\"f_date\":\"2016-03-24\",\"f_billNo\":\"CG20160324001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"A0001\",\"f_invName\":\"防尘罩\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"1\",\"f_unitPrice\":\"500\",\"f_amount\":\"500\",\"f_description\":null},{\"f_date\":\"2016-03-25\",\"f_billNo\":\"CG20160325001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"C00004\",\"f_invName\":\"LED灯套\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"1\",\"f_unitPrice\":\"900\",\"f_amount\":\"900\",\"f_description\":null},{\"f_date\":\"2016-03-25\",\"f_billNo\":\"CG20160325001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"1002\",\"f_invName\":\"12#线路板\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"2\",\"f_unitPrice\":\"400\",\"f_amount\":\"800\",\"f_description\":null},{\"f_date\":\"2016-03-25\",\"f_billNo\":\"CG20160325002\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"110011\",\"f_invName\":\"LED灯套\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"6\",\"f_unitPrice\":\"700\",\"f_amount\":\"42000\",\"f_description\":null},{\"f_date\":\"2016-03-25\",\"f_billNo\":\"CG20160325002\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"2001\",\"f_invName\":\"1号连接线\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"5\",\"f_unitPrice\":\"400\",\"f_amount\":\"2000\",\"f_description\":null},{\"f_date\":\"2016-04-13\",\"f_billNo\":\"CG20160413001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"110011\",\"f_invName\":\"LED灯套\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"6\",\"f_unitPrice\":\"500\",\"f_amount\":\"3000\",\"f_description\":null},{\"f_date\":\"2016-04-13\",\"f_billNo\":\"CG20160402001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"1001\",\"f_invName\":\"12#线路板\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"1\",\"f_unitPrice\":\"800\",\"f_amount\":\"800\",\"f_description\":null},{\"f_date\":\"2016-04-13\",\"f_billNo\":\"CG20160424001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"A0001\",\"f_invName\":\"防尘罩\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"1\",\"f_unitPrice\":\"500\",\"f_amount\":\"500\",\"f_description\":null},{\"f_date\":\"2016-04-13\",\"f_billNo\":\"CG20160425001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"C00004\",\"f_invName\":\"LED灯套\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"1\",\"f_unitPrice\":\"900\",\"f_amount\":\"900\",\"f_description\":null},{\"f_date\":\"2016-04-13\",\"f_billNo\":\"CG20160425001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"1002\",\"f_invName\":\"12#线路板\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"2\",\"f_unitPrice\":\"400\",\"f_amount\":\"800\",\"f_description\":null},{\"f_date\":\"2016-04-13\",\"f_billNo\":\"CG20160425002\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"110011\",\"f_invName\":\"LED灯套\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"6\",\"f_unitPrice\":\"700\",\"f_amount\":\"42000\",\"f_description\":null},{\"f_date\":\"2016-04-13\",\"f_billNo\":\"CG20160425002\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"2001\",\"f_invName\":\"1号连接线\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"5\",\"f_unitPrice\":\"400\",\"f_amount\":\"2000\",\"f_description\":null}]"; + List> data = JsonUtil.getJsonToListMap(json); + return ActionResult.success(data); + } + + /** + * 商品采购报表 - 导出Excel + * + * @return + */ + @Operation(summary = "(待定)商品采购报表 - 导出Excel") + @GetMapping("/PurchaseToExcel") + public void purchaseToExcel() { + String json = "[{\"f_date\":\"2015-11-30\",\"f_billNo\":\"CG20151130001\",\"f_buName\":\"长林电子材料厂\",\"f_invNo\":\"110013\",\"f_invName\":\"PVC包装纸\",\"f_unit\":\"箱\",\"f_location\":\"徐泾\",\"f_qty\":\"1000\",\"f_unitPrice\":\"12\",\"f_amount\":\"12000\",\"f_description\":null},{\"f_date\":\"2015-12-07\",\"f_billNo\":\"CG20151207001\",\"f_buName\":\"长林电子材料厂\",\"f_invNo\":\"110011\",\"f_invName\":\"泡棉\",\"f_unit\":\"箱\",\"f_location\":\"徐泾\",\"f_qty\":\"100\",\"f_unitPrice\":\"20\",\"f_amount\":\"2000\",\"f_description\":null},{\"f_date\":\"2015-12-08\",\"f_billNo\":\"CG20151208001\",\"f_buName\":\"长林电子材料厂\",\"f_invNo\":\"1001\",\"f_invName\":\"无纺布\",\"f_unit\":\"箱\",\"f_location\":\"徐泾\",\"f_qty\":\"900\",\"f_unitPrice\":\"30\",\"f_amount\":\"27000\",\"f_description\":null},{\"f_date\":\"2015-12-30\",\"f_billNo\":\"CG20151230001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"110013\",\"f_invName\":\"LED灯套\",\"f_unit\":\"箱\",\"f_location\":\"徐泾\",\"f_qty\":\"5\",\"f_unitPrice\":\"100\",\"f_amount\":\"500\",\"f_description\":null},{\"f_date\":\"2016-01-03\",\"f_billNo\":\"CG20160103001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"1002\",\"f_invName\":\"防尘罩\",\"f_unit\":\"箱\",\"f_location\":\"张江\",\"f_qty\":\"2\",\"f_unitPrice\":\"100\",\"f_amount\":\"200\",\"f_description\":null},{\"f_date\":\"2016-01-03\",\"f_billNo\":\"CG20160103001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"110011\",\"f_invName\":\"1号连接线\",\"f_unit\":\"箱\",\"f_location\":\"张江\",\"f_qty\":\"1\",\"f_unitPrice\":\"100\",\"f_amount\":\"100\",\"f_description\":null},{\"f_date\":\"2016-01-03\",\"f_billNo\":\"CG20160103001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"2001\",\"f_invName\":\"12#线路板\",\"f_unit\":\"吨\",\"f_location\":\"张江\",\"f_qty\":\"1\",\"f_unitPrice\":\"9000\",\"f_amount\":\"9000\",\"f_description\":null},{\"f_date\":\"2016-01-23\",\"f_billNo\":\"CG20160123001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"C00002\",\"f_invName\":\"防尘罩\",\"f_unit\":\"吨\",\"f_location\":\"张江\",\"f_qty\":\"3\",\"f_unitPrice\":\"9000\",\"f_amount\":\"27000\",\"f_description\":null},{\"f_date\":\"2016-02-10\",\"f_billNo\":\"CG20160210001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"1001\",\"f_invName\":\"1号连接线\",\"f_unit\":\"吨\",\"f_location\":\"张江\",\"f_qty\":\"4\",\"f_unitPrice\":\"8000\",\"f_amount\":\"32000\",\"f_description\":null},{\"f_date\":\"2016-02-22\",\"f_billNo\":\"CG20160222001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"A0001\",\"f_invName\":\"12#线路板\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"8\",\"f_unitPrice\":\"800\",\"f_amount\":\"6400\",\"f_description\":null},{\"f_date\":\"2016-03-02\",\"f_billNo\":\"CG20160302001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"1001\",\"f_invName\":\"12#线路板\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"1\",\"f_unitPrice\":\"800\",\"f_amount\":\"800\",\"f_description\":null},{\"f_date\":\"2016-03-24\",\"f_billNo\":\"CG20160324001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"A0001\",\"f_invName\":\"防尘罩\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"1\",\"f_unitPrice\":\"500\",\"f_amount\":\"500\",\"f_description\":null},{\"f_date\":\"2016-03-25\",\"f_billNo\":\"CG20160325001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"C00004\",\"f_invName\":\"LED灯套\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"1\",\"f_unitPrice\":\"900\",\"f_amount\":\"900\",\"f_description\":null},{\"f_date\":\"2016-03-25\",\"f_billNo\":\"CG20160325001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"1002\",\"f_invName\":\"12#线路板\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"2\",\"f_unitPrice\":\"400\",\"f_amount\":\"800\",\"f_description\":null},{\"f_date\":\"2016-03-25\",\"f_billNo\":\"CG20160325002\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"110011\",\"f_invName\":\"LED灯套\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"6\",\"f_unitPrice\":\"700\",\"f_amount\":\"42000\",\"f_description\":null},{\"f_date\":\"2016-03-25\",\"f_billNo\":\"CG20160325002\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"2001\",\"f_invName\":\"1号连接线\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"5\",\"f_unitPrice\":\"400\",\"f_amount\":\"2000\",\"f_description\":null},{\"f_date\":\"2016-04-13\",\"f_billNo\":\"CG20160413001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"110011\",\"f_invName\":\"LED灯套\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"6\",\"f_unitPrice\":\"500\",\"f_amount\":\"3000\",\"f_description\":null},{\"f_date\":\"2016-04-13\",\"f_billNo\":\"CG20160402001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"1001\",\"f_invName\":\"12#线路板\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"1\",\"f_unitPrice\":\"800\",\"f_amount\":\"800\",\"f_description\":null},{\"f_date\":\"2016-04-13\",\"f_billNo\":\"CG20160424001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"A0001\",\"f_invName\":\"防尘罩\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"1\",\"f_unitPrice\":\"500\",\"f_amount\":\"500\",\"f_description\":null},{\"f_date\":\"2016-04-13\",\"f_billNo\":\"CG20160425001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"C00004\",\"f_invName\":\"LED灯套\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"1\",\"f_unitPrice\":\"900\",\"f_amount\":\"900\",\"f_description\":null},{\"f_date\":\"2016-04-13\",\"f_billNo\":\"CG20160425001\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"1002\",\"f_invName\":\"12#线路板\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"2\",\"f_unitPrice\":\"400\",\"f_amount\":\"800\",\"f_description\":null},{\"f_date\":\"2016-04-13\",\"f_billNo\":\"CG20160425002\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"110011\",\"f_invName\":\"LED灯套\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"6\",\"f_unitPrice\":\"700\",\"f_amount\":\"42000\",\"f_description\":null},{\"f_date\":\"2016-04-13\",\"f_billNo\":\"CG20160425002\",\"f_buName\":\"金鑫五金厂\",\"f_invNo\":\"2001\",\"f_invName\":\"1号连接线\",\"f_unit\":\"箱\",\"f_location\":\"陆家嘴\",\"f_qty\":\"5\",\"f_unitPrice\":\"400\",\"f_amount\":\"2000\",\"f_description\":null}]"; + List> data = JsonUtil.getJsonToListMap(json); + } + + /** + * 演示分组报表 + * + * @return + */ + @Operation(summary = "(待定)演示分组报表 - 导出Excel") + @GetMapping("/GroupList") + public ActionResult groupList() { + String json = "[{\"F_DepartmentName\":\"综合部\",\"F_UserId\":\"1\",\"F_UserName\":\"申志强\",\"F_Salary\":\"15,000.00\",\"F_Position\":\"人力资源\",\"F_EntryDate\":\"20141024\",\"F_Telephone\":\"13403555190\",\"F_Address\":\"辽宁\",\"F_ZipCode\":\"047300\"},{\"F_DepartmentName\":\"综合部\",\"F_UserId\":\"111\",\"F_UserName\":\"王建国\",\"F_Salary\":\"16,000.00\",\"F_Position\":\"人力资源\",\"F_EntryDate\":\"20141113\",\"F_Telephone\":\"15364758000\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"综合部\",\"F_UserId\":\"112\",\"F_UserName\":\"张义芳\",\"F_Salary\":\"20,000.00\",\"F_Position\":\"人力资源\",\"F_EntryDate\":\"20141117\",\"F_Telephone\":\"15935538888\",\"F_Address\":\"河南\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"综合部\",\"F_UserId\":\"113\",\"F_UserName\":\"原琼\",\"F_Salary\":\"20,000.50元\",\"F_Position\":\"人力资源\",\"F_EntryDate\":\"20141208\",\"F_Telephone\":\"13333550900\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"财务部\",\"F_UserId\":\"114\",\"F_UserName\":\"马惠军\",\"F_Salary\":\"12,000.00\",\"F_Position\":\"财务经理\",\"F_EntryDate\":\"20141015\",\"F_Telephone\":\"13383458811\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"财务部\",\"F_UserId\":\"115\",\"F_UserName\":\"武继宏\",\"F_Salary\":\"13,500.00\",\"F_Position\":\"财务经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13834776068\",\"F_Address\":\"山西\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"风险部\",\"F_UserId\":\"116\",\"F_UserName\":\"宋利敏\",\"F_Salary\":\"8,000.00\",\"F_Position\":\"风控经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"15234556806\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"风险部\",\"F_UserId\":\"117\",\"F_UserName\":\"王冀玲\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"风控经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13333554333\",\"F_Address\":\"山东\",\"F_ZipCode\":\"047300\"},{\"F_DepartmentName\":\"资金部\",\"F_UserId\":\"118\",\"F_UserName\":\"李燕红\",\"F_Salary\":\"50,000.00\",\"F_Position\":\"资金经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13333550900\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"资金部\",\"F_UserId\":\"119\",\"F_UserName\":\"郑 强\",\"F_Salary\":\"16,000.00\",\"F_Position\":\"资金经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13383458811\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"121\",\"F_UserName\":\"冯 莅\",\"F_Salary\":\"20,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13834776068\",\"F_Address\":\"天津\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"122\",\"F_UserName\":\"李静\",\"F_Salary\":\"20,000.50元\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"15234556806\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"总裁办\",\"F_UserId\":\"123\",\"F_UserName\":\"卫晓勤\",\"F_Salary\":\"12,000.00\",\"F_Position\":\"总助\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13333554333\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"风险部\",\"F_UserId\":\"124\",\"F_UserName\":\"张源\",\"F_Salary\":\"13,500.00\",\"F_Position\":\"风控经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13333550900\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"风险部\",\"F_UserId\":\"125\",\"F_UserName\":\"冯浩\",\"F_Salary\":\"8,000.00\",\"F_Position\":\"风控经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13383458811\",\"F_Address\":\"河北\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"资金部\",\"F_UserId\":\"126\",\"F_UserName\":\"张亚强\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"资金经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"15392555666\",\"F_Address\":\"石家庄\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"资金部\",\"F_UserId\":\"127\",\"F_UserName\":\"靳伟\",\"F_Salary\":\"50,000.00\",\"F_Position\":\"资金经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13994675055\",\"F_Address\":\"河北\",\"F_ZipCode\":\"047300\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"128\",\"F_UserName\":\"倪刚\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13720964398\",\"F_Address\":\"石家庄\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"129\",\"F_UserName\":\"王泓杰\",\"F_Salary\":\"16,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"18625504986\",\"F_Address\":\"石家庄\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"130\",\"F_UserName\":\"李晓波\",\"F_Salary\":\"20,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13935513232\",\"F_Address\":\"河北\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"131\",\"F_UserName\":\"张洋铭\",\"F_Salary\":\"20,000.50元\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20111219\",\"F_Telephone\":\"15234699068\",\"F_Address\":\"石家庄\",\"F_ZipCode\":\"046100\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"132\",\"F_UserName\":\"宋东\",\"F_Salary\":\"12,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20111219\",\"F_Telephone\":\"13453515589\",\"F_Address\":\"辽宁\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"133\",\"F_UserName\":\"李淑荣\",\"F_Salary\":\"13,500.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20111222\",\"F_Telephone\":\"13283557468\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"134\",\"F_UserName\":\"马垒布\",\"F_Salary\":\"8,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20111223\",\"F_Telephone\":\"18003456655\",\"F_Address\":\"河南\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"135\",\"F_UserName\":\"陈和平\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20111228\",\"F_Telephone\":\"18635531186\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"136\",\"F_UserName\":\"叶昌银\",\"F_Salary\":\"16,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20111229\",\"F_Telephone\":\"13203558555\",\"F_Address\":\"北京\",\"F_ZipCode\":\"047300\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"137\",\"F_UserName\":\"王增\",\"F_Salary\":\"20,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20120116\",\"F_Telephone\":\"15835557732\",\"F_Address\":\"山西\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"138\",\"F_UserName\":\"梁姝丽\",\"F_Salary\":\"20,000.50元\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20120118\",\"F_Telephone\":\"13453535388\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"139\",\"F_UserName\":\"申亚丽\",\"F_Salary\":\"12,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20120118\",\"F_Telephone\":\"18635559721\",\"F_Address\":\"山东\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"141\",\"F_UserName\":\"牛彩红\",\"F_Salary\":\"13,500.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20120119\",\"F_Telephone\":\"13835567286\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"142\",\"F_UserName\":\"陈玉芬\",\"F_Salary\":\"8,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20120208\",\"F_Telephone\":\"18636510130\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"143\",\"F_UserName\":\"秦虎明\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20120221\",\"F_Telephone\":\"15935502225\",\"F_Address\":\"天津\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"144\",\"F_UserName\":\"卢风莲\",\"F_Salary\":\"50,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20120301\",\"F_Telephone\":\"13509753890\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"风险部\",\"F_UserId\":\"145\",\"F_UserName\":\"李静\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"风控经理\",\"F_EntryDate\":\"20120302\",\"F_Telephone\":\"18636518169\",\"F_Address\":\"北京\",\"F_ZipCode\":\"047300\"},{\"F_DepartmentName\":\"风险部\",\"F_UserId\":\"146\",\"F_UserName\":\"申建文\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"风控经理\",\"F_EntryDate\":\"20120328\",\"F_Telephone\":\"13467048348\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"资金部\",\"F_UserId\":\"147\",\"F_UserName\":\"王慧芳\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"资金经理\",\"F_EntryDate\":\"20120328\",\"F_Telephone\":\"13233363689\",\"F_Address\":\"河北\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"资金部\",\"F_UserId\":\"148\",\"F_UserName\":\"马建刚\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"资金经理\",\"F_EntryDate\":\"20131017\",\"F_Telephone\":\"18235562999\",\"F_Address\":\"石家庄\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"综合部\",\"F_UserId\":\"149\",\"F_UserName\":\"孛森润\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"人力资源\",\"F_EntryDate\":\"20131018\",\"F_Telephone\":\"13096666703\",\"F_Address\":\"河北\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"综合部\",\"F_UserId\":\"151\",\"F_UserName\":\"宋拴琴\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"人力资源\",\"F_EntryDate\":\"20131028\",\"F_Telephone\":\"13994659670\",\"F_Address\":\"石家庄\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"综合部\",\"F_UserId\":\"152\",\"F_UserName\":\"姜旭军\",\"F_Salary\":\"10,001.50元\",\"F_Position\":\"综合部总监\",\"F_EntryDate\":\"20131030\",\"F_Telephone\":\"18636518186\",\"F_Address\":\"石家庄\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"财务部\",\"F_UserId\":\"153\",\"F_UserName\":\"丁路广\",\"F_Salary\":\"15,000.00\",\"F_Position\":\"财务部出纳\",\"F_EntryDate\":\"20130805\",\"F_Telephone\":\"15534555586\",\"F_Address\":\"辽宁\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"财务部\",\"F_UserId\":\"154\",\"F_UserName\":\"陈连胜\",\"F_Salary\":\"16,000.00\",\"F_Position\":\"财务部总监\",\"F_EntryDate\":\"20130805\",\"F_Telephone\":\"18903452550\",\"F_Address\":\"北京\",\"F_ZipCode\":\"047300\"},{\"F_DepartmentName\":\"风险部\",\"F_UserId\":\"155\",\"F_UserName\":\"苗艳芳\",\"F_Salary\":\"20,000.00\",\"F_Position\":\"风控经理\",\"F_EntryDate\":\"20130829\",\"F_Telephone\":\"13994633133\",\"F_Address\":\"河南\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"风险部\",\"F_UserId\":\"156\",\"F_UserName\":\"张俊莲\",\"F_Salary\":\"20,000.50元\",\"F_Position\":\"风控总监\",\"F_EntryDate\":\"20130829\",\"F_Telephone\":\"13994631297\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"资金部\",\"F_UserId\":\"157\",\"F_UserName\":\"陈永庆\",\"F_Salary\":\"12,000.00\",\"F_Position\":\"资金经理\",\"F_EntryDate\":\"20130917\",\"F_Telephone\":\"15534578988\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"资金部\",\"F_UserId\":\"158\",\"F_UserName\":\"李晓飞\",\"F_Salary\":\"13,500.00\",\"F_Position\":\"资金总监\",\"F_EntryDate\":\"20130917\",\"F_Telephone\":\"15935533271\",\"F_Address\":\"山西\",\"F_ZipCode\":\"046100\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"159\",\"F_UserName\":\"葛明伟\",\"F_Salary\":\"8,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20130927\",\"F_Telephone\":\"18635550586\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"160\",\"F_UserName\":\"王金才\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"业务总监\",\"F_EntryDate\":\"20131010\",\"F_Telephone\":\"15035554586\",\"F_Address\":\"山东\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"总裁办\",\"F_UserId\":\"161\",\"F_UserName\":\"王炜\",\"F_Salary\":\"50,000.00\",\"F_Position\":\"总裁CEO\",\"F_EntryDate\":\"20140409\",\"F_Telephone\":\"13333550900\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"总裁办\",\"F_UserId\":\"162\",\"F_UserName\":\"张亚楠\",\"F_Salary\":\"50,000.00\",\"F_Position\":\"总助\",\"F_EntryDate\":\"20140409\",\"F_Telephone\":\"13383458811\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"163\",\"F_UserName\":\"段卫军\",\"F_Salary\":\"8,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20140409\",\"F_Telephone\":\"13513553121\",\"F_Address\":\"天津\",\"F_ZipCode\":\"047300\"}]"; + List> data = JsonUtil.getJsonToListMap(json); + return ActionResult.success(data); + } + + /** + * 演示分组报表 - 导出Excel + * + * @return + */ + @Operation(summary = "(待定)演示分组报表 - 导出Excel") + @GetMapping("/GroupToExcel") + public void groupToExcel() { + String json = "[{\"F_DepartmentName\":\"综合部\",\"F_UserId\":\"1\",\"F_UserName\":\"申志强\",\"F_Salary\":\"15,000.00\",\"F_Position\":\"人力资源\",\"F_EntryDate\":\"20141024\",\"F_Telephone\":\"13403555190\",\"F_Address\":\"辽宁\",\"F_ZipCode\":\"047300\"},{\"F_DepartmentName\":\"综合部\",\"F_UserId\":\"111\",\"F_UserName\":\"王建国\",\"F_Salary\":\"16,000.00\",\"F_Position\":\"人力资源\",\"F_EntryDate\":\"20141113\",\"F_Telephone\":\"15364758000\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"综合部\",\"F_UserId\":\"112\",\"F_UserName\":\"张义芳\",\"F_Salary\":\"20,000.00\",\"F_Position\":\"人力资源\",\"F_EntryDate\":\"20141117\",\"F_Telephone\":\"15935538888\",\"F_Address\":\"河南\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"综合部\",\"F_UserId\":\"113\",\"F_UserName\":\"原琼\",\"F_Salary\":\"20,000.50元\",\"F_Position\":\"人力资源\",\"F_EntryDate\":\"20141208\",\"F_Telephone\":\"13333550900\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"财务部\",\"F_UserId\":\"114\",\"F_UserName\":\"马惠军\",\"F_Salary\":\"12,000.00\",\"F_Position\":\"财务经理\",\"F_EntryDate\":\"20141015\",\"F_Telephone\":\"13383458811\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"财务部\",\"F_UserId\":\"115\",\"F_UserName\":\"武继宏\",\"F_Salary\":\"13,500.00\",\"F_Position\":\"财务经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13834776068\",\"F_Address\":\"山西\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"风险部\",\"F_UserId\":\"116\",\"F_UserName\":\"宋利敏\",\"F_Salary\":\"8,000.00\",\"F_Position\":\"风控经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"15234556806\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"风险部\",\"F_UserId\":\"117\",\"F_UserName\":\"王冀玲\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"风控经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13333554333\",\"F_Address\":\"山东\",\"F_ZipCode\":\"047300\"},{\"F_DepartmentName\":\"资金部\",\"F_UserId\":\"118\",\"F_UserName\":\"李燕红\",\"F_Salary\":\"50,000.00\",\"F_Position\":\"资金经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13333550900\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"资金部\",\"F_UserId\":\"119\",\"F_UserName\":\"郑 强\",\"F_Salary\":\"16,000.00\",\"F_Position\":\"资金经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13383458811\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"121\",\"F_UserName\":\"冯 莅\",\"F_Salary\":\"20,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13834776068\",\"F_Address\":\"天津\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"122\",\"F_UserName\":\"李静\",\"F_Salary\":\"20,000.50元\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"15234556806\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"总裁办\",\"F_UserId\":\"123\",\"F_UserName\":\"卫晓勤\",\"F_Salary\":\"12,000.00\",\"F_Position\":\"总助\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13333554333\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"风险部\",\"F_UserId\":\"124\",\"F_UserName\":\"张源\",\"F_Salary\":\"13,500.00\",\"F_Position\":\"风控经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13333550900\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"风险部\",\"F_UserId\":\"125\",\"F_UserName\":\"冯浩\",\"F_Salary\":\"8,000.00\",\"F_Position\":\"风控经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13383458811\",\"F_Address\":\"河北\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"资金部\",\"F_UserId\":\"126\",\"F_UserName\":\"张亚强\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"资金经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"15392555666\",\"F_Address\":\"石家庄\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"资金部\",\"F_UserId\":\"127\",\"F_UserName\":\"靳伟\",\"F_Salary\":\"50,000.00\",\"F_Position\":\"资金经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13994675055\",\"F_Address\":\"河北\",\"F_ZipCode\":\"047300\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"128\",\"F_UserName\":\"倪刚\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13720964398\",\"F_Address\":\"石家庄\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"129\",\"F_UserName\":\"王泓杰\",\"F_Salary\":\"16,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"18625504986\",\"F_Address\":\"石家庄\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"130\",\"F_UserName\":\"李晓波\",\"F_Salary\":\"20,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20140707\",\"F_Telephone\":\"13935513232\",\"F_Address\":\"河北\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"131\",\"F_UserName\":\"张洋铭\",\"F_Salary\":\"20,000.50元\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20111219\",\"F_Telephone\":\"15234699068\",\"F_Address\":\"石家庄\",\"F_ZipCode\":\"046100\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"132\",\"F_UserName\":\"宋东\",\"F_Salary\":\"12,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20111219\",\"F_Telephone\":\"13453515589\",\"F_Address\":\"辽宁\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"133\",\"F_UserName\":\"李淑荣\",\"F_Salary\":\"13,500.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20111222\",\"F_Telephone\":\"13283557468\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"134\",\"F_UserName\":\"马垒布\",\"F_Salary\":\"8,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20111223\",\"F_Telephone\":\"18003456655\",\"F_Address\":\"河南\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"135\",\"F_UserName\":\"陈和平\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20111228\",\"F_Telephone\":\"18635531186\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"136\",\"F_UserName\":\"叶昌银\",\"F_Salary\":\"16,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20111229\",\"F_Telephone\":\"13203558555\",\"F_Address\":\"北京\",\"F_ZipCode\":\"047300\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"137\",\"F_UserName\":\"王增\",\"F_Salary\":\"20,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20120116\",\"F_Telephone\":\"15835557732\",\"F_Address\":\"山西\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"138\",\"F_UserName\":\"梁姝丽\",\"F_Salary\":\"20,000.50元\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20120118\",\"F_Telephone\":\"13453535388\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"139\",\"F_UserName\":\"申亚丽\",\"F_Salary\":\"12,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20120118\",\"F_Telephone\":\"18635559721\",\"F_Address\":\"山东\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"141\",\"F_UserName\":\"牛彩红\",\"F_Salary\":\"13,500.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20120119\",\"F_Telephone\":\"13835567286\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"142\",\"F_UserName\":\"陈玉芬\",\"F_Salary\":\"8,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20120208\",\"F_Telephone\":\"18636510130\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"143\",\"F_UserName\":\"秦虎明\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20120221\",\"F_Telephone\":\"15935502225\",\"F_Address\":\"天津\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"144\",\"F_UserName\":\"卢风莲\",\"F_Salary\":\"50,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20120301\",\"F_Telephone\":\"13509753890\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"风险部\",\"F_UserId\":\"145\",\"F_UserName\":\"李静\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"风控经理\",\"F_EntryDate\":\"20120302\",\"F_Telephone\":\"18636518169\",\"F_Address\":\"北京\",\"F_ZipCode\":\"047300\"},{\"F_DepartmentName\":\"风险部\",\"F_UserId\":\"146\",\"F_UserName\":\"申建文\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"风控经理\",\"F_EntryDate\":\"20120328\",\"F_Telephone\":\"13467048348\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"资金部\",\"F_UserId\":\"147\",\"F_UserName\":\"王慧芳\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"资金经理\",\"F_EntryDate\":\"20120328\",\"F_Telephone\":\"13233363689\",\"F_Address\":\"河北\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"资金部\",\"F_UserId\":\"148\",\"F_UserName\":\"马建刚\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"资金经理\",\"F_EntryDate\":\"20131017\",\"F_Telephone\":\"18235562999\",\"F_Address\":\"石家庄\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"综合部\",\"F_UserId\":\"149\",\"F_UserName\":\"孛森润\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"人力资源\",\"F_EntryDate\":\"20131018\",\"F_Telephone\":\"13096666703\",\"F_Address\":\"河北\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"综合部\",\"F_UserId\":\"151\",\"F_UserName\":\"宋拴琴\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"人力资源\",\"F_EntryDate\":\"20131028\",\"F_Telephone\":\"13994659670\",\"F_Address\":\"石家庄\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"综合部\",\"F_UserId\":\"152\",\"F_UserName\":\"姜旭军\",\"F_Salary\":\"10,001.50元\",\"F_Position\":\"综合部总监\",\"F_EntryDate\":\"20131030\",\"F_Telephone\":\"18636518186\",\"F_Address\":\"石家庄\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"财务部\",\"F_UserId\":\"153\",\"F_UserName\":\"丁路广\",\"F_Salary\":\"15,000.00\",\"F_Position\":\"财务部出纳\",\"F_EntryDate\":\"20130805\",\"F_Telephone\":\"15534555586\",\"F_Address\":\"辽宁\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"财务部\",\"F_UserId\":\"154\",\"F_UserName\":\"陈连胜\",\"F_Salary\":\"16,000.00\",\"F_Position\":\"财务部总监\",\"F_EntryDate\":\"20130805\",\"F_Telephone\":\"18903452550\",\"F_Address\":\"北京\",\"F_ZipCode\":\"047300\"},{\"F_DepartmentName\":\"风险部\",\"F_UserId\":\"155\",\"F_UserName\":\"苗艳芳\",\"F_Salary\":\"20,000.00\",\"F_Position\":\"风控经理\",\"F_EntryDate\":\"20130829\",\"F_Telephone\":\"13994633133\",\"F_Address\":\"河南\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"风险部\",\"F_UserId\":\"156\",\"F_UserName\":\"张俊莲\",\"F_Salary\":\"20,000.50元\",\"F_Position\":\"风控总监\",\"F_EntryDate\":\"20130829\",\"F_Telephone\":\"13994631297\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"资金部\",\"F_UserId\":\"157\",\"F_UserName\":\"陈永庆\",\"F_Salary\":\"12,000.00\",\"F_Position\":\"资金经理\",\"F_EntryDate\":\"20130917\",\"F_Telephone\":\"15534578988\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"资金部\",\"F_UserId\":\"158\",\"F_UserName\":\"李晓飞\",\"F_Salary\":\"13,500.00\",\"F_Position\":\"资金总监\",\"F_EntryDate\":\"20130917\",\"F_Telephone\":\"15935533271\",\"F_Address\":\"山西\",\"F_ZipCode\":\"046100\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"159\",\"F_UserName\":\"葛明伟\",\"F_Salary\":\"8,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20130927\",\"F_Telephone\":\"18635550586\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"160\",\"F_UserName\":\"王金才\",\"F_Salary\":\"10,000.00\",\"F_Position\":\"业务总监\",\"F_EntryDate\":\"20131010\",\"F_Telephone\":\"15035554586\",\"F_Address\":\"山东\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"总裁办\",\"F_UserId\":\"161\",\"F_UserName\":\"王炜\",\"F_Salary\":\"50,000.00\",\"F_Position\":\"总裁CEO\",\"F_EntryDate\":\"20140409\",\"F_Telephone\":\"13333550900\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"总裁办\",\"F_UserId\":\"162\",\"F_UserName\":\"张亚楠\",\"F_Salary\":\"50,000.00\",\"F_Position\":\"总助\",\"F_EntryDate\":\"20140409\",\"F_Telephone\":\"13383458811\",\"F_Address\":\"北京\",\"F_ZipCode\":\"046000\"},{\"F_DepartmentName\":\"业务部\",\"F_UserId\":\"163\",\"F_UserName\":\"段卫军\",\"F_Salary\":\"8,000.00\",\"F_Position\":\"客户经理\",\"F_EntryDate\":\"20140409\",\"F_Telephone\":\"13513553121\",\"F_Address\":\"天津\",\"F_ZipCode\":\"047300\"}]"; + List> data = JsonUtil.getJsonToListMap(json); + } + + /** + * 组合多图表报表 + * + * @return + */ + @Operation(summary = "获取组合多图表报表") + @GetMapping("/Combination") + public ActionResult combinationList() { + String json = "[{\"F_UserName\":\"李贵宾\",\"F_Jan\":\"108\",\"F_Feb\":\"231\",\"F_Mar\":\"389\",\"F_Apr\":\"808\",\"F_May\":\"160\",\"F_Jun\":\"266\",\"F_Jul\":\"374\",\"F_Aug\":\"241\",\"F_Sep\":\"144\",\"F_Oct\":\"172\",\"F_Nov\":\"607\",\"F_Dec\":\"217\"},{\"F_UserName\":\"张琳蓉\",\"F_Jan\":\"205\",\"F_Feb\":\"249\",\"F_Mar\":\"552\",\"F_Apr\":\"71\",\"F_May\":\"511\",\"F_Jun\":\"236\",\"F_Jul\":\"795\",\"F_Aug\":\"10\",\"F_Sep\":\"31\",\"F_Oct\":\"38\",\"F_Nov\":\"107\",\"F_Dec\":\"344\"},{\"F_UserName\":\"邱杨佳\",\"F_Jan\":\"101\",\"F_Feb\":\"236\",\"F_Mar\":\"374\",\"F_Apr\":\"73\",\"F_May\":\"66\",\"F_Jun\":\"11\",\"F_Jul\":\"12\",\"F_Aug\":\"37\",\"F_Sep\":\"11\",\"F_Oct\":\"93\",\"F_Nov\":\"107\",\"F_Dec\":\"239\"},{\"F_UserName\":\"张红霞\",\"F_Jan\":\"738\",\"F_Feb\":\"451\",\"F_Mar\":\"37\",\"F_Apr\":\"404\",\"F_May\":\"336\",\"F_Jun\":\"373\",\"F_Jul\":\"715\",\"F_Aug\":\"678\",\"F_Sep\":\"437\",\"F_Oct\":\"551\",\"F_Nov\":\"101\",\"F_Dec\":\"127\"},{\"F_UserName\":\"朱鹏\",\"F_Jan\":\"256\",\"F_Feb\":\"221\",\"F_Mar\":\"104\",\"F_Apr\":\"115\",\"F_May\":\"289\",\"F_Jun\":\"654\",\"F_Jul\":\"488\",\"F_Aug\":\"225\",\"F_Sep\":\"267\",\"F_Oct\":\"127\",\"F_Nov\":\"0\",\"F_Dec\":\"314\"},{\"F_UserName\":\"张峰\",\"F_Jan\":\"488\",\"F_Feb\":\"535\",\"F_Mar\":\"115\",\"F_Apr\":\"667\",\"F_May\":\"370\",\"F_Jun\":\"379\",\"F_Jul\":\"90\",\"F_Aug\":\"437\",\"F_Sep\":\"115\",\"F_Oct\":\"267\",\"F_Nov\":\"372\",\"F_Dec\":\"438\"},{\"F_UserName\":\"王瑞\",\"F_Jan\":\"939\",\"F_Feb\":\"262\",\"F_Mar\":\"351\",\"F_Apr\":\"478\",\"F_May\":\"162\",\"F_Jun\":\"125\",\"F_Jul\":\"115\",\"F_Aug\":\"535\",\"F_Sep\":\"522\",\"F_Oct\":\"315\",\"F_Nov\":\"315\",\"F_Dec\":\"90\"},{\"F_UserName\":\"秦涛\",\"F_Jan\":\"146\",\"F_Feb\":\"488\",\"F_Mar\":\"535\",\"F_Apr\":\"127\",\"F_May\":\"906\",\"F_Jun\":\"66\",\"F_Jul\":\"607\",\"F_Aug\":\"116\",\"F_Sep\":\"93\",\"F_Oct\":\"618\",\"F_Nov\":\"66\",\"F_Dec\":\"643\"},{\"F_UserName\":\"郭强\",\"F_Jan\":\"108\",\"F_Feb\":\"268\",\"F_Mar\":\"653\",\"F_Apr\":\"314\",\"F_May\":\"481\",\"F_Jun\":\"535\",\"F_Jul\":\"132\",\"F_Aug\":\"12\",\"F_Sep\":\"336\",\"F_Oct\":\"768\",\"F_Nov\":\"244\",\"F_Dec\":\"122\"},{\"F_UserName\":\"赵丹\",\"F_Jan\":\"48\",\"F_Feb\":\"12\",\"F_Mar\":\"969\",\"F_Apr\":\"241\",\"F_May\":\"939\",\"F_Jun\":\"172\",\"F_Jul\":\"286\",\"F_Aug\":\"404\",\"F_Sep\":\"990\",\"F_Oct\":\"11\",\"F_Nov\":\"484\",\"F_Dec\":\"76\"}]"; + List> data = JsonUtil.getJsonToListMap(json); + return ActionResult.success(data); + } + + /** + * 月度工资对比表 + * + * @return + */ + @Operation(summary = "获取月度工资对比表") + @GetMapping("/Month") + public ActionResult monthList() { + String json = "[{\"F_Item\":\"财务部\",\"F_LastMonthNumber\":\"2\",\"F_LastMonthPay\":\"9008\",\"F_ThisMonthNumber\":\"2\",\"F_ThisMonthPay\":\"12800\",\"F_ChangeNumber\":\"0\",\"F_ChangePay\":\"3792\",\"F_ChangeDescription\":\"\"},{\"F_Item\":\"企划部\",\"F_LastMonthNumber\":\"3\",\"F_LastMonthPay\":\"29280\",\"F_ThisMonthNumber\":\"3\",\"F_ThisMonthPay\":\"26235\",\"F_ChangeNumber\":\"0\",\"F_ChangePay\":\"-3045\",\"F_ChangeDescription\":\"\"},{\"F_Item\":\"招商运营部\",\"F_LastMonthNumber\":\"3\",\"F_LastMonthPay\":\"9392\",\"F_ThisMonthNumber\":\"2\",\"F_ThisMonthPay\":\"4092.31\",\"F_ChangeNumber\":\"-1\",\"F_ChangePay\":\"-5299.69\",\"F_ChangeDescription\":\"离职\"},{\"F_Item\":\"物业管理部\",\"F_LastMonthNumber\":\"4\",\"F_LastMonthPay\":\"16450\",\"F_ThisMonthNumber\":\"5\",\"F_ThisMonthPay\":\"1744.86\",\"F_ChangeNumber\":\"1\",\"F_ChangePay\":\"998.46\",\"F_ChangeDescription\":\"新招\"},{\"F_Item\":\"总经办\",\"F_LastMonthNumber\":\"0\",\"F_LastMonthPay\":\"0\",\"F_ThisMonthNumber\":\"2\",\"F_ThisMonthPay\":\"6264.23\",\"F_ChangeNumber\":\"2\",\"F_ChangePay\":\"6264.23\",\"F_ChangeDescription\":\"扩大队伍\"},{\"F_Item\":\"技术部\",\"F_LastMonthNumber\":\"3\",\"F_LastMonthPay\":\"7257\",\"F_ThisMonthNumber\":\"6\",\"F_ThisMonthPay\":\"6264.23\",\"F_ChangeNumber\":\"3\",\"F_ChangePay\":\"6061.85\",\"F_ChangeDescription\":\"业务增加\"},{\"F_Item\":\"调出\",\"F_LastMonthNumber\":\"4\",\"F_LastMonthPay\":\"10560\",\"F_ThisMonthNumber\":\"2\",\"F_ThisMonthPay\":\"7185\",\"F_ChangeNumber\":\"-2\",\"F_ChangePay\":\"-3375\",\"F_ChangeDescription\":\"\"}]"; + List> data = JsonUtil.getJsonToListMap(json); + return ActionResult.success(data); + } + + /** + * 月度工资对比表 - 导出Excel + * + * @return + */ + @Operation(summary = "(待定)月度工资对比表 - 导出Excel") + @GetMapping("/MonthToExcel") + public void monthToExcel() { + String json = "[{\"F_Item\":\"财务部\",\"F_LastMonthNumber\":\"2\",\"F_LastMonthPay\":\"9008\",\"F_ThisMonthNumber\":\"2\",\"F_ThisMonthPay\":\"12800\",\"F_ChangeNumber\":\"0\",\"F_ChangePay\":\"3792\",\"F_ChangeDescription\":\"\"},{\"F_Item\":\"企划部\",\"F_LastMonthNumber\":\"3\",\"F_LastMonthPay\":\"29280\",\"F_ThisMonthNumber\":\"3\",\"F_ThisMonthPay\":\"26235\",\"F_ChangeNumber\":\"0\",\"F_ChangePay\":\"-3045\",\"F_ChangeDescription\":\"\"},{\"F_Item\":\"招商运营部\",\"F_LastMonthNumber\":\"3\",\"F_LastMonthPay\":\"9392\",\"F_ThisMonthNumber\":\"2\",\"F_ThisMonthPay\":\"4092.31\",\"F_ChangeNumber\":\"-1\",\"F_ChangePay\":\"-5299.69\",\"F_ChangeDescription\":\"离职\"},{\"F_Item\":\"物业管理部\",\"F_LastMonthNumber\":\"4\",\"F_LastMonthPay\":\"16450\",\"F_ThisMonthNumber\":\"5\",\"F_ThisMonthPay\":\"1744.86\",\"F_ChangeNumber\":\"1\",\"F_ChangePay\":\"998.46\",\"F_ChangeDescription\":\"新招\"},{\"F_Item\":\"总经办\",\"F_LastMonthNumber\":\"0\",\"F_LastMonthPay\":\"0\",\"F_ThisMonthNumber\":\"2\",\"F_ThisMonthPay\":\"6264.23\",\"F_ChangeNumber\":\"2\",\"F_ChangePay\":\"6264.23\",\"F_ChangeDescription\":\"扩大队伍\"},{\"F_Item\":\"技术部\",\"F_LastMonthNumber\":\"3\",\"F_LastMonthPay\":\"7257\",\"F_ThisMonthNumber\":\"6\",\"F_ThisMonthPay\":\"6264.23\",\"F_ChangeNumber\":\"3\",\"F_ChangePay\":\"6061.85\",\"F_ChangeDescription\":\"业务增加\"},{\"F_Item\":\"调出\",\"F_LastMonthNumber\":\"4\",\"F_LastMonthPay\":\"10560\",\"F_ThisMonthNumber\":\"2\",\"F_ThisMonthPay\":\"7185\",\"F_ChangeNumber\":\"-2\",\"F_ChangePay\":\"-3375\",\"F_ChangeDescription\":\"\"}]"; + List> data = JsonUtil.getJsonToListMap(json); + } + + /** + * 季度销售对比表 + * + * @return + */ + @Operation(summary = "获取季度销售对比表") + @GetMapping("/Quarter") + public ActionResult quarterList() { + String json = "[{\"F_Year\":\"2017\",\"F_Quarter\":\"一季度\",\"F_Number\":\"100000\",\"F_Money\":\"4000000\",\"F_LastQuarter\":\"6.81\",\"F_LastYear\":\"0.992\"},{\"F_Year\":\"2017\",\"F_Quarter\":\"二季度\",\"F_Number\":\"3000000\",\"F_Money\":\"23450000\",\"F_LastQuarter\":\"7.5\",\"F_LastYear\":\"0.888\"},{\"F_Year\":\"2017\",\"F_Quarter\":\"三季度\",\"F_Number\":\"230000\",\"F_Money\":\"500000\",\"F_LastQuarter\":\"6.93\",\"F_LastYear\":\"0.777\"},{\"F_Year\":\"2017\",\"F_Quarter\":\"四季度\",\"F_Number\":\"50000000\",\"F_Money\":\"20000000\",\"F_LastQuarter\":\"23.5\",\"F_LastYear\":\"1.45\"},{\"F_Year\":\"2017\",\"F_Quarter\":\"合计\",\"F_Number\":\"53330000\",\"F_Money\":\"47950000\",\"F_LastQuarter\":\"\",\"F_LastYear\":\"\"},{\"F_Year\":\"2018\",\"F_Quarter\":\"一季度\",\"F_Number\":\"200000\",\"F_Money\":\"6000000\",\"F_LastQuarter\":\"8.81\",\"F_LastYear\":\"0.782\"},{\"F_Year\":\"2018\",\"F_Quarter\":\"二季度\",\"F_Number\":\"1500000\",\"F_Money\":\"230000\",\"F_LastQuarter\":\"4.5\",\"F_LastYear\":\"0.488\"},{\"F_Year\":\"2018\",\"F_Quarter\":\"三季度\",\"F_Number\":\"3000000\",\"F_Money\":\"532000\",\"F_LastQuarter\":\"8.93\",\"F_LastYear\":\"0.797\"},{\"F_Year\":\"2018\",\"F_Quarter\":\"四季度\",\"F_Number\":\"47000000\",\"F_Money\":\"212000\",\"F_LastQuarter\":\"12.5\",\"F_LastYear\":\"1.47\"},{\"F_Year\":\"2018\",\"F_Quarter\":\"合计\",\"F_Number\":\"51700000\",\"F_Money\":\"6974000\",\"F_LastQuarter\":\"\",\"F_LastYear\":\"\"}]"; + List> data = JsonUtil.getJsonToListMap(json); + return ActionResult.success(data); + } + + /** + * 季度销售对比表 - 导出Excel + * + * @return + */ + @Operation(summary = "(待定)季度销售对比表 - 导出Excel") + @GetMapping("/QuarterToExcel") + public void quarterToExcel() { + String json = "[{\"F_Year\":\"2017\",\"F_Quarter\":\"一季度\",\"F_Number\":\"100000\",\"F_Money\":\"4000000\",\"F_LastQuarter\":\"6.81\",\"F_LastYear\":\"0.992\"},{\"F_Year\":\"2017\",\"F_Quarter\":\"二季度\",\"F_Number\":\"3000000\",\"F_Money\":\"23450000\",\"F_LastQuarter\":\"7.5\",\"F_LastYear\":\"0.888\"},{\"F_Year\":\"2017\",\"F_Quarter\":\"三季度\",\"F_Number\":\"230000\",\"F_Money\":\"500000\",\"F_LastQuarter\":\"6.93\",\"F_LastYear\":\"0.777\"},{\"F_Year\":\"2017\",\"F_Quarter\":\"四季度\",\"F_Number\":\"50000000\",\"F_Money\":\"20000000\",\"F_LastQuarter\":\"23.5\",\"F_LastYear\":\"1.45\"},{\"F_Year\":\"2017\",\"F_Quarter\":\"合计\",\"F_Number\":\"53330000\",\"F_Money\":\"47950000\",\"F_LastQuarter\":\"\",\"F_LastYear\":\"\"},{\"F_Year\":\"2018\",\"F_Quarter\":\"一季度\",\"F_Number\":\"200000\",\"F_Money\":\"6000000\",\"F_LastQuarter\":\"8.81\",\"F_LastYear\":\"0.782\"},{\"F_Year\":\"2018\",\"F_Quarter\":\"二季度\",\"F_Number\":\"1500000\",\"F_Money\":\"230000\",\"F_LastQuarter\":\"4.5\",\"F_LastYear\":\"0.488\"},{\"F_Year\":\"2018\",\"F_Quarter\":\"三季度\",\"F_Number\":\"3000000\",\"F_Money\":\"532000\",\"F_LastQuarter\":\"8.93\",\"F_LastYear\":\"0.797\"},{\"F_Year\":\"2018\",\"F_Quarter\":\"四季度\",\"F_Number\":\"47000000\",\"F_Money\":\"212000\",\"F_LastQuarter\":\"12.5\",\"F_LastYear\":\"1.47\"},{\"F_Year\":\"2018\",\"F_Quarter\":\"合计\",\"F_Number\":\"51700000\",\"F_Money\":\"6974000\",\"F_LastQuarter\":\"\",\"F_LastYear\":\"\"}]"; + List> data = JsonUtil.getJsonToListMap(json); + } +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/SalesOrderController.java b/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/SalesOrderController.java new file mode 100644 index 0000000..beb9d92 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/SalesOrderController.java @@ -0,0 +1,131 @@ +package com.yunzhupaas.controller; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.entity.SalesOrderEntity; +import com.yunzhupaas.entity.SalesOrderEntryEntity; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.model.salesorder.SalesOrderEntryEntityInfoModel; +import com.yunzhupaas.model.salesorder.SalesOrderForm; +import com.yunzhupaas.model.salesorder.SalesOrderInfoVO; +import com.yunzhupaas.service.SalesOrderService; +import com.yunzhupaas.util.GeneraterSwapUtil; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 销售订单 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-29 上午9:18 + */ +@Tag(name = "销售订单", description = "SalesOrder") +@RestController +@RequestMapping("/api/extend/Form/SalesOrder") +public class SalesOrderController extends SuperController { + + @Autowired + private SalesOrderService salesOrderService; + @Autowired + private GeneraterSwapUtil generaterSwapUtil; + + /** + * 获取销售订单信息 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "获取销售订单信息") + @GetMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult info(@PathVariable("id") String id) { + SalesOrderEntity entity = salesOrderService.getInfo(id); + List entityList = salesOrderService.getSalesEntryList(id); + SalesOrderInfoVO vo = JsonUtil.getJsonToBean(entity, SalesOrderInfoVO.class); + if (vo != null) { + vo.setEntryList(JsonUtil.getJsonToList(entityList, SalesOrderEntryEntityInfoModel.class)); + } + return ActionResult.success(vo); + } + + /** + * 新建销售订单 + * + * @param salesOrderForm 表单对象 + * @return + * @throws WorkFlowException + */ + @Operation(summary = "新建销售订单") + @PostMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "salesOrderForm", description = "销售模型", required = true), + }) + public ActionResult create(@RequestBody SalesOrderForm salesOrderForm, @PathVariable("id") String id) throws WorkFlowException { + SalesOrderEntity sales = JsonUtil.getJsonToBean(salesOrderForm, SalesOrderEntity.class); + List salesEntryList = JsonUtil.getJsonToList(salesOrderForm.getEntryList(), SalesOrderEntryEntity.class); + salesOrderService.submit(id, sales, salesEntryList, salesOrderForm); + return ActionResult.success(MsgCode.SU006.get()); + } + + /** + * 修改销售订单 + * + * @param salesOrderForm 表单对象 + * @param id 主键 + * @return + * @throws WorkFlowException + */ + @Operation(summary = "修改销售订单") + @PutMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "salesOrderForm", description = "销售模型", required = true), + }) + public ActionResult update(@RequestBody SalesOrderForm salesOrderForm, @PathVariable("id") String id) throws WorkFlowException { + SalesOrderEntity sales = JsonUtil.getJsonToBean(salesOrderForm, SalesOrderEntity.class); + sales.setId(id); + List salesEntryList = JsonUtil.getJsonToList(salesOrderForm.getEntryList(), SalesOrderEntryEntity.class); + salesOrderService.submit(id, sales, salesEntryList, salesOrderForm); + return ActionResult.success(MsgCode.SU006.get()); + } + + /** + * 删除销售订单信息 + * + * @param id 主键 + */ + @Operation(summary = "删除销售订单信息") + @DeleteMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult delete(@PathVariable("id") String id, @RequestParam(name = "forceDel", defaultValue = "false") Boolean forceDel) { + SalesOrderEntity entity = salesOrderService.getInfo(id); + if (null != entity) { + if (!forceDel) { + String errMsg = generaterSwapUtil.deleteFlowTask(entity.getId()); + if (StringUtil.isNotBlank(errMsg)) { + throw new RuntimeException(errMsg); + } + } + salesOrderService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/TableExampleController.java b/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/TableExampleController.java new file mode 100644 index 0000000..904aec4 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/TableExampleController.java @@ -0,0 +1,450 @@ +package com.yunzhupaas.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.Page; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.controller.SuperController; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.JsonUtilEx; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.service.DictionaryDataService; +import com.yunzhupaas.base.service.ProvinceService; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.entity.TableExampleEntity; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.entity.ProvinceEntity; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.model.tableexample.*; +import com.yunzhupaas.model.tableexample.postil.PostilInfoVO; +import com.yunzhupaas.model.tableexample.postil.PostilModel; +import com.yunzhupaas.model.tableexample.postil.PostilSendForm; +import com.yunzhupaas.service.TableExampleService; +import com.yunzhupaas.util.DateUtil; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import com.yunzhupaas.util.treeutil.SumTree; +import com.yunzhupaas.util.treeutil.TreeDotUtils; +import com.yunzhupaas.util.type.StringNumber; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 表格示例数据 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +@Tag(name = "表格示例数据", description = "TableExample") +@RestController +@RequestMapping("/api/extend/TableExample") +public class TableExampleController extends SuperController { + + @Autowired + private TableExampleService tableExampleService; + @Autowired + private ProvinceService provinceService; + @Autowired + private DictionaryDataService dictionaryDataService; + + @Autowired + private UserService userService; + + /** + * 列表 + * + * @param paginationTableExample 分页模型 + * @return + */ + @Operation(summary = "获取表格数据列表") + @GetMapping + @SaCheckPermission("extend.tableDemo.commonTable") + public ActionResult> list(PaginationTableExample paginationTableExample) { + List data = tableExampleService.getList(paginationTableExample); + List list = JsonUtil.getJsonToList(data, TableExampleListVO.class); + List userId = list.stream().map(t -> t.getRegistrant()).collect(Collectors.toList()); + List userList = userService.getUserName(userId); + for (TableExampleListVO tableExampleListVO : list) { + UserEntity user = userList.stream().filter(t -> t.getId().equals(tableExampleListVO.getRegistrant())).findFirst().orElse(null); + tableExampleListVO.setRegistrant(user != null ? user.getRealName() + "/" + user.getAccount() : ""); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(paginationTableExample, PaginationVO.class); + return ActionResult.page(list, paginationVO); + } + + /** + * 列表(树形表格) + * + * @param typeId 主键 + * @param paginationTableExample 查询模型 + * @return + */ + @Operation(summary = "(树形表格)") + @GetMapping("/ControlSample/{typeId}") + @Parameters({ + @Parameter(name = "typeId", description = "主键", required = true), + }) + @SaCheckPermission("extend.tableDemo.tableTree") + public ActionResult> list(@PathVariable("typeId") String typeId, PaginationTableExample paginationTableExample) { + List data = tableExampleService.getList(typeId, paginationTableExample); + List list = JsonUtil.getJsonToList(data, TableExampleListVO.class); + List userId = list.stream().map(t -> t.getRegistrant()).collect(Collectors.toList()); + List userList = userService.getUserName(userId); + for (TableExampleListVO tableExampleListVO : list) { + UserEntity user = userList.stream().filter(t -> t.getId().equals(tableExampleListVO.getRegistrant())).findFirst().orElse(null); + tableExampleListVO.setRegistrant(user != null ? user.getRealName() + "/" + user.getAccount() : ""); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(paginationTableExample, PaginationVO.class); + return ActionResult.page(list, paginationVO); + } + + /** + * 列表 + * + * @return + */ + @Operation(summary = "获取表格分组列表") + @GetMapping("/All") + @SaCheckPermission("extend.tableDemo.groupingTable") + public ActionResult> listAll() { + List data = tableExampleService.getList(); + List list = JsonUtil.getJsonToList(data, TableExampleListAllVO.class); + List userId = list.stream().map(t -> t.getRegistrant()).collect(Collectors.toList()); + List userList = userService.getUserName(userId); + for (TableExampleListAllVO tableExampleListVO : list) { + UserEntity user = userList.stream().filter(t -> t.getId().equals(tableExampleListVO.getRegistrant())).findFirst().orElse(null); + tableExampleListVO.setRegistrant(user != null ? user.getRealName() + "/" + user.getAccount() : ""); + } + ListVO vo = new ListVO<>(); + vo.setList(list); + return ActionResult.success(vo); + } + + /** + * 列表 + * + * @param page 查询模型 + * @return + */ + @Operation(summary = "获取延伸扩展列表(行政区划)") + @GetMapping("/IndustryList") + @SaCheckPermission("extend.tableDemo.extension") + public ActionResult> industryList(Page page) { + String keyword = page.getKeyword(); + List data = provinceService.getList("-1"); + if (!StringUtil.isEmpty(keyword)) { + data = data.stream().filter(t -> t.getFullName().contains(keyword)).collect(Collectors.toList()); + } + List listVos = JsonUtil.getJsonToList(data, TableExampleIndustryListVO.class); + ListVO vo = new ListVO<>(); + vo.setList(listVos); + return ActionResult.success(vo); + } + + /** + * 列表 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "获取城市信息列表(获取延伸扩展列表(行政区划))") + @GetMapping("/CityList/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("extend.tableDemo.extension") + public ActionResult> cityList(@PathVariable("id") String id) { + List data = provinceService.getList(id); + List listVos = JsonUtil.getJsonToList(data, TableExampleCityListVO.class); + ListVO vo = new ListVO<>(); + vo.setList(listVos); + return ActionResult.success(vo); + } + + /** + * 列表(表格树形) + * + * @param isTree 类型 + * @return + */ + @Operation(summary = "表格树形") + @GetMapping("/ControlSample/TreeList") + @Parameters({ + @Parameter(name = "isTree", description = "类型"), + }) + @SaCheckPermission("extend.tableDemo.tableTree") + public ActionResult> treeList(@RequestParam("isTree")String isTree) { + List data = dictionaryDataService.getList("d59a3cf65f9847dbb08be449e3feae16"); + List treeList = new ArrayList<>(); + for (DictionaryDataEntity entity : data) { + TableExampleTreeModel treeModel = new TableExampleTreeModel(); + treeModel.setId(entity.getId()); + treeModel.setText(entity.getFullName()); + treeModel.setParentId(entity.getParentId()); + treeModel.setLoaded(true); + treeModel.setExpanded(true); + treeModel.setHt(JsonUtil.entityToMap(entity)); + treeList.add(treeModel); + } + if (isTree != null && StringNumber.ONE.equals(isTree)) { + List> trees = TreeDotUtils.convertListToTreeDot(treeList); + List listVO = JsonUtil.getJsonToList(trees, TableExampleTreeModel.class); + ListVO vo = new ListVO(); + vo.setList(listVO); + return ActionResult.success(vo); + } + ListVO vo = new ListVO(); + vo.setList(treeList); + return ActionResult.success(vo); + } + + /** + * 信息 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取普通表格示例信息") + @GetMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("extend.tableDemo.extension") + public ActionResult info(@PathVariable("id") String id) throws DataException { + TableExampleEntity entity = tableExampleService.getInfo(id); + TableExampleInfoVO vo = JsonUtil.getJsonToBeanEx(entity, TableExampleInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 删除 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除项目") + @DeleteMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("extend.tableDemo.extension") + public ActionResult delete(@PathVariable("id") String id) { + TableExampleEntity entity = tableExampleService.getInfo(id); + if (entity != null) { + tableExampleService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + /** + * 创建 + * + * @param tableExampleCrForm 项目模型 + * @return + */ + @Operation(summary = "新建项目") + @PostMapping + @Parameters({ + @Parameter(name = "tableExampleCrForm", description = "项目模型",required = true), + }) + @SaCheckPermission("extend.tableDemo.extension") + public ActionResult create(@RequestBody @Valid TableExampleCrForm tableExampleCrForm) { + TableExampleEntity entity = JsonUtil.getJsonToBean(tableExampleCrForm, TableExampleEntity.class); + entity.setCostAmount(entity.getCostAmount() == null ? new BigDecimal("0") : entity.getCostAmount()); + entity.setTunesAmount(entity.getTunesAmount() == null ? new BigDecimal("0") : entity.getTunesAmount()); + entity.setProjectedIncome(entity.getProjectedIncome() == null ? new BigDecimal("0") : entity.getProjectedIncome()); + entity.setSign("0000000"); + tableExampleService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 更新 + * + * @param id 主键 + * @param tableExampleUpForm 项目模型 + * @return + */ + @Operation(summary = "更新项目") + @PutMapping("/{id}") + @Parameters({ + @Parameter(name = "tableExampleUpForm", description = "项目模型",required = true), + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("extend.tableDemo.postilTable") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid TableExampleUpForm tableExampleUpForm) { + TableExampleEntity entity = JsonUtil.getJsonToBean(tableExampleUpForm, TableExampleEntity.class); + entity.setCostAmount(entity.getCostAmount() == null ? new BigDecimal("0") : entity.getCostAmount()); + entity.setTunesAmount(entity.getTunesAmount() == null ? new BigDecimal("0") : entity.getTunesAmount()); + entity.setProjectedIncome(entity.getProjectedIncome() == null ? new BigDecimal("0") : entity.getProjectedIncome()); + boolean flag = tableExampleService.update(id, entity); + if (flag == false) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 更新标签 + * + * @param id 主键 + * @param tableExampleSignUpForm 项目模型 + * @return + */ + @Operation(summary = "更新标记") + @PutMapping("/UpdateSign/{id}") + @Parameters({ + @Parameter(name = "tableExampleSignUpForm", description = "项目模型",required = true), + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("extend.tableDemo.postilTable") + public ActionResult updateSign(@PathVariable("id") String id, @RequestBody @Valid TableExampleSignUpForm tableExampleSignUpForm) { + TableExampleEntity entity = JsonUtil.getJsonToBean(tableExampleSignUpForm, TableExampleEntity.class); + TableExampleEntity tableExampleEntity = tableExampleService.getInfo(id); + if (tableExampleEntity == null) { + return ActionResult.success(MsgCode.FA002.get()); + } + tableExampleEntity.setSign(entity.getSign()); + tableExampleService.update(id, entity); + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 行编辑 + * + * @param tableExampleRowUpForm 项目模型 + * @param id 主键 + * @return + */ + @Operation(summary = "行编辑") + @PutMapping("/{id}/Actions/RowsEdit") + @Parameters({ + @Parameter(name = "tableExampleRowUpForm", description = "项目模型",required = true), + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("extend.tableDemo.redactTable") + public ActionResult rowEditing(@PathVariable("id") String id, @RequestBody @Valid TableExampleRowUpForm tableExampleRowUpForm) { + TableExampleEntity entity = JsonUtil.getJsonToBean(tableExampleRowUpForm, TableExampleEntity.class); + entity.setCostAmount(entity.getCostAmount() == null ? new BigDecimal("0") : entity.getCostAmount()); + entity.setTunesAmount(entity.getTunesAmount() == null ? new BigDecimal("0") : entity.getTunesAmount()); + entity.setProjectedIncome(entity.getProjectedIncome() == null ? new BigDecimal("0") : entity.getProjectedIncome()); + entity.setId(id); + boolean falg = tableExampleService.rowEditing(entity); + if (falg == false) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 发送 + * + * @param postilSendForm 项目模型 + * @param id 主键 + * @return + */ + @Operation(summary = "发送批注") + @PostMapping("/{id}/Postil") + @Parameters({ + @Parameter(name = "postilSendForm", description = "项目模型",required = true), + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("extend.tableDemo.postilTable") + public ActionResult sendPostil(@PathVariable("id") String id, @RequestBody PostilSendForm postilSendForm) { + TableExampleEntity tableExampleEntity = tableExampleService.getInfo(id); + if (tableExampleEntity == null) { + return ActionResult.success(MsgCode.FA005.get()); + } + UserInfo userInfo = UserProvider.getUser(); + PostilModel model = new PostilModel(); + model.setCreatorTime(DateUtil.getNow("+8")); + model.setText(postilSendForm.getText()); + model.setUserId(userInfo != null ? userInfo.getUserName() + "/" + userInfo.getUserAccount() : ""); + List list = new ArrayList<>(); + list.add(model); + if (!StringUtil.isEmpty(tableExampleEntity.getPostilJson())) { + list.addAll(JsonUtil.getJsonToList(tableExampleEntity.getPostilJson(), PostilModel.class)); + } + + String postilJson = JsonUtil.getObjectToString(list); + tableExampleEntity.setPostilJson(postilJson); + tableExampleEntity.setPostilCount(list.size()); + tableExampleService.update(id, tableExampleEntity); + return ActionResult.success(MsgCode.SU012.get()); + } + + + /** + * 发送 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "获取批注") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @GetMapping("/{id}/Actions/Postil") + @SaCheckPermission("extend.tableDemo.postilTable") + public ActionResult getPostil(@PathVariable("id") String id) { + TableExampleEntity tableExampleEntity = tableExampleService.getInfo(id); + if (tableExampleEntity == null) { + return ActionResult.success(MsgCode.FA012.get()); + } + PostilInfoVO vo = new PostilInfoVO(); + vo.setPostilJson(tableExampleEntity.getPostilJson()); + return ActionResult.success(vo); + } + + /** + * 删除批注 + * + * @param id 主键值 + * @param index 行数 + * @return + */ + @Operation(summary = "删除批注") + @DeleteMapping("/{id}/Postil/{index}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "index", description = "行数", required = true), + }) + @SaCheckPermission("extend.tableDemo.postilTable") + public ActionResult deletePostil(@PathVariable("id") String id, @PathVariable("index") int index) { + TableExampleEntity tableExampleEntity = tableExampleService.getInfo(id); + if (tableExampleEntity == null) { + return ActionResult.success(MsgCode.FA003.get()); + } + List list = JsonUtil.getJsonToList(tableExampleEntity.getPostilJson(), PostilModel.class); + list.remove(index); + String postilJson = JsonUtil.getObjectToString(list); + tableExampleEntity.setPostilJson(postilJson); + tableExampleEntity.setPostilCount((list.size())); + tableExampleService.update(id, tableExampleEntity); + return ActionResult.success(MsgCode.SU003.get()); + } +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/WorkLogController.java b/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/WorkLogController.java new file mode 100644 index 0000000..7bb59f8 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-controller/src/main/java/com/yunzhupaas/controller/WorkLogController.java @@ -0,0 +1,172 @@ +package com.yunzhupaas.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.entity.WorkLogEntity; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.model.worklog.WorkLogCrForm; +import com.yunzhupaas.model.worklog.WorkLogInfoVO; +import com.yunzhupaas.model.worklog.WorkLogListVO; +import com.yunzhupaas.model.worklog.WorkLogUpForm; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.service.WorkLogService; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.JsonUtilEx; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; +import java.util.Arrays; +import java.util.List; +import java.util.StringJoiner; + +/** + * 工作日志 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +@Tag(name = "app工作日志", description = "WorkLog") +@RestController +@RequestMapping("/api/extend/WorkLog") +public class WorkLogController extends SuperController { + + @Autowired + private WorkLogService workLogService; + @Autowired + private UserService userService; + + /** + * 列表(我发出的) + * + * @param pageModel 分页模型 + * @return + */ + @Operation(summary = "列表") + @GetMapping("/Send") + @SaCheckPermission("reportinglog") + public ActionResult> getSendList(Pagination pageModel) { + List data = workLogService.getSendList(pageModel); + List list = JsonUtil.getJsonToList(data, WorkLogListVO.class); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pageModel, PaginationVO.class); + return ActionResult.page(list, paginationVO); + } + + /** + * 列表(我收到的) + * + * @param pageModel 分页模型 + * @return + */ + @GetMapping("/Receive") + @SaCheckPermission("reportinglog") + public ActionResult> getReceiveList(Pagination pageModel) { + List data = workLogService.getReceiveList(pageModel); + List list = JsonUtil.getJsonToList(data, WorkLogListVO.class); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pageModel, PaginationVO.class); + return ActionResult.page(list, paginationVO); + } + + /** + * 信息 + * + * @param id 主键 + * @return + */ + @GetMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("reportinglog") + public ActionResult info(@PathVariable("id") String id) throws DataException { + WorkLogEntity entity = workLogService.getInfo(id); + StringJoiner userName = new StringJoiner(","); + StringJoiner userIds = new StringJoiner(","); + List userId = Arrays.asList(entity.getToUserId().split(",")); + List userList = userService.getUserName(userId); + for (UserEntity user : userList) { + userIds.add(user.getId()); + userName.add(user.getRealName() + "/" + user.getAccount()); + } + entity.setToUserId(userName.toString()); + WorkLogInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, WorkLogInfoVO.class); + vo.setUserIds(userIds.toString()); + return ActionResult.success(vo); + } + + /** + * 新建 + * + * @param workLogCrForm 日志模型 + * @return + */ + @Operation(summary = "新建") + @PostMapping + @Parameters({ + @Parameter(name = "workLogCrForm", description = "日志模型",required = true), + }) + @SaCheckPermission("reportinglog") + public ActionResult create(@RequestBody @Valid WorkLogCrForm workLogCrForm) { + WorkLogEntity entity = JsonUtil.getJsonToBean(workLogCrForm, WorkLogEntity.class); + workLogService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 更新 + * + * @param id 主键 + * @param workLogUpForm 日志模型 + * @return + */ + @Operation(summary = "更新") + @PutMapping("/{id}") + @Parameters({ + @Parameter(name = "workLogUpForm", description = "日志模型",required = true), + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("reportinglog") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid WorkLogUpForm workLogUpForm) { + WorkLogEntity entity = JsonUtil.getJsonToBean(workLogUpForm, WorkLogEntity.class); + boolean flag = workLogService.update(id, entity); + if (flag == false) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除") + @DeleteMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("reportinglog") + public ActionResult delete(@PathVariable("id") String id) { + WorkLogEntity entity = workLogService.getInfo(id); + if (entity != null) { + workLogService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } +} + + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/pom.xml b/yunzhupaas-extend/yunzhupaas-extend-entity/pom.xml new file mode 100644 index 0000000..dbb4a90 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/pom.xml @@ -0,0 +1,22 @@ + + + + yunzhupaas-extend + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-extend-entity + + + + com.yunzhupaas + yunzhupaas-common-all + ${project.version} + + + + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/BigDataEntity.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/BigDataEntity.java new file mode 100644 index 0000000..59f2710 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/BigDataEntity.java @@ -0,0 +1,34 @@ +package com.yunzhupaas.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + + +/** + * 大数据测试 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +@Data +@TableName("ext_big_data") +public class BigDataEntity extends SuperExtendEntity { + + /** + * 编码 + */ + @TableField("F_EN_CODE") + private String enCode; + + /** + * 名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/CustomerEntity.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/CustomerEntity.java new file mode 100644 index 0000000..c6713bb --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/CustomerEntity.java @@ -0,0 +1,51 @@ +package com.yunzhupaas.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperEntity; +import lombok.Data; + +/** + * 客户信息 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021-07-10 14:09:05 + */ +@Data +@TableName("ext_customer") +public class CustomerEntity extends SuperEntity { + + /** + * 编码 + */ + @TableField("F_EN_CODE") + private String code; + + /** + * 客户名称 + */ + @TableField("F_CUSTOMER_NAME") + private String customerName; + + /** + * 地址 + */ + @TableField("F_ADDRESS") + private String address; + + /** + * 姓名 + */ + @TableField("F_FULL_NAME") + private String name; + + /** + * 联系方式 + */ + @TableField("F_CONTACT_TEL") + private String contactTel; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/DocumentEntity.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/DocumentEntity.java new file mode 100644 index 0000000..9a78e3d --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/DocumentEntity.java @@ -0,0 +1,82 @@ +package com.yunzhupaas.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * 知识文档 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +@Data +@TableName("ext_document") +public class DocumentEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 文档父级 + */ + @TableField("F_PARENT_ID") + private String parentId; + + /** + * 文档分类 + */ + @TableField("F_TYPE") + private Integer type; + + /** + * 文件名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + + /** + * 文件路径 + */ + @TableField("F_FILE_PATH") + private String filePath; + + /** + * 文件大小 + */ + @TableField("F_FILE_SIZE") + private String fileSize; + + /** + * 文件后缀 + */ + @TableField("F_FILE_EXTENSION") + private String fileExtension; + + /** + * 阅读数量 + */ + @TableField("F_READ_COUNT") + private Integer readCount; + + /** + * 是否共享 + */ + @TableField("F_IS_SHARE") + private Integer isShare; + + /** + * 共享时间 + */ + @TableField("F_SHARE_TIME") + private Date shareTime; + + /** + * 文档下载地址 + */ + @TableField("F_UPLOAD_URL") + private String uploaderUrl; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/DocumentLogEntity.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/DocumentLogEntity.java new file mode 100644 index 0000000..0ca8c3d --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/DocumentLogEntity.java @@ -0,0 +1,34 @@ +package com.yunzhupaas.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperEntity; +import lombok.Data; + +/** + * 知识文档删除记录 + * + * @author 云筑产品开发平台组 + * @version V5.2.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024年4月10日 上午9:18 + */ +@Data +@TableName("ext_document_log") +public class DocumentLogEntity extends SuperEntity { + + /** + * 文档主键 + */ + @TableField("F_DOCUMENT_ID") + private String documentId; + + /** + * 共享人员 + */ + @TableField("F_CHILD_DOCUMENT") + private String childDocument; + + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/DocumentShareEntity.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/DocumentShareEntity.java new file mode 100644 index 0000000..3983560 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/DocumentShareEntity.java @@ -0,0 +1,41 @@ +package com.yunzhupaas.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * 知识文档共享 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +@Data +@TableName("ext_document_share") +public class DocumentShareEntity extends SuperExtendEntity { + + /** + * 文档主键 + */ + @TableField("F_DOCUMENT_ID") + private String documentId; + + /** + * 共享人员 + */ + @TableField("F_SHARE_USER_ID") + private String shareUserId; + + /** + * 共享时间 + */ + @TableField("F_SHARE_TIME") + private Date shareTime; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/EmailSendEntity.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/EmailSendEntity.java new file mode 100644 index 0000000..6d7e8f7 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/EmailSendEntity.java @@ -0,0 +1,81 @@ +package com.yunzhupaas.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +/** + * 邮件发送 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +@Data +@TableName("ext_email_send") +public class EmailSendEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 类型 1-外部、0-内部 + */ + @TableField("F_TYPE") + private Integer type; + + /** + * 发件人 + */ + @TableField("F_SENDER") + private String sender; + + /** + * 收件人 + */ + @TableField("F_TO") + private String recipient; + + /** + * 抄送人 + */ + @TableField("F_CC") + private String cc; + + /** + * 密送人 + */ + @TableField("F_BCC") + private String bcc; + + /** + * 颜色 + */ + @TableField("F_COLOUR") + private String colour; + + /** + * 主题 + */ + @TableField("F_SUBJECT") + private String subject; + + /** + * 正文 + */ + @TableField("F_BODY_TEXT") + private String bodyText; + + /** + * 附件 + */ + @TableField("F_ATTACHMENT") + private String attachment; + + /** + * 状态 -1-草稿、0-正在投递、1-投递成功 + */ + @TableField("F_STATE") + private Integer state; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/EmployeeEntity.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/EmployeeEntity.java new file mode 100644 index 0000000..c183a2d --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/EmployeeEntity.java @@ -0,0 +1,107 @@ +package com.yunzhupaas.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * 职员信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * + */ +@Data +@TableName("ext_employee") +public class EmployeeEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 工号 + */ + @TableField("F_EN_CODE") + private String enCode; + + /** + * 姓名 + */ + @TableField("F_FULL_NAME") + private String fullName; + + /** + * 性别 + */ + @TableField("F_GENDER") + private String gender; + + /** + * 部门 + */ + @TableField("F_DEPARTMENT_NAME") + private String departmentName; + + /** + * 岗位 + */ + @TableField("F_POSITION_NAME") + private String positionName; + + /** + * 用工性质 + */ + @TableField("F_WORKING_NATURE") + private String workingNature; + + /** + * 身份证号 + */ + @TableField("F_ID_NUMBER") + private String idNumber; + + /** + * 联系电话 + */ + @TableField("F_TELEPHONE") + private String telephone; + + /** + * 参加工作 + */ + @TableField("F_ATTEND_WORK_TIME") + private Date attendWorkTime; + + /** + * 出生年月 + */ + @TableField("F_BIRTHDAY") + private Date birthday; + + /** + * 最高学历 + */ + @TableField("F_EDUCATION") + private String education; + + /** + * 所学专业 + */ + @TableField("F_MAJOR") + private String major; + + /** + * 毕业院校 + */ + @TableField("F_GRADUATION_ACADEMY") + private String graduationAcademy; + + /** + * 毕业时间 + */ + @TableField("F_GRADUATION_TIME") + private Date graduationTime; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/LeaveApplyEntity.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/LeaveApplyEntity.java new file mode 100644 index 0000000..53a1f77 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/LeaveApplyEntity.java @@ -0,0 +1,119 @@ +package com.yunzhupaas.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperBaseEntity; +import lombok.Data; + +import java.util.Date; + +/** + * 流程表单【请假申请】 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Data +@TableName("wform_leaveapply") +public class LeaveApplyEntity extends SuperBaseEntity.SuperTBaseEntity { + + /** + * 流程主键 + */ + @TableField("F_FLOWID") + private String flowId; + + /** + * 流程标题 + */ + @TableField("F_FLOWTITLE") + private String flowTitle; + + /** + * 紧急程度 + */ + @TableField("F_FLOWURGENT") + private Integer flowUrgent; + + /** + * 单据编码 + */ + @TableField("F_BILLNO") + private String billNo; + + /** + * 申请人员 + */ + @TableField("F_APPLYUSER") + private String applyUser; + + /** + * 申请日期 + */ + @TableField("F_APPLYDATE") + private Date applyDate; + + /** + * 申请部门 + */ + @TableField("F_APPLYDEPT") + private String applyDept; + + /** + * 申请职位 + */ + @TableField("F_APPLYPOST") + private String applyPost; + + /** + * 请假类别 + */ + @TableField("F_LEAVETYPE") + private String leaveType; + + /** + * 请假原因 + */ + @TableField("F_LEAVEREASON") + private String leaveReason; + + /** + * 请假时间 + */ + @TableField("F_LEAVESTARTTIME") + private Date leaveStartTime; + + /** + * 结束时间 + */ + @TableField("F_LEAVEENDTIME") + private Date leaveEndTime; + + /** + * 请假天数 + */ + @TableField("F_LEAVEDAYCOUNT") + private String leaveDayCount; + + /** + * 请假小时 + */ + @TableField("F_LEAVEHOUR") + private String leaveHour; + + /** + * 相关附件 + */ + @TableField("F_FILEJSON") + private String fileJson; + + /** + * 备注 + */ + @TableField("F_DESCRIPTION") + private String description; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/OrderEntity.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/OrderEntity.java new file mode 100644 index 0000000..c04acd9 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/OrderEntity.java @@ -0,0 +1,120 @@ +package com.yunzhupaas.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 订单信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +@Data +@TableName("ext_order") +public class OrderEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 客户Id + */ + @TableField("F_CUSTOMER_ID") + private String customerId; + + /** + * 客户名称 + */ + @TableField("F_CUSTOMER_NAME") + private String customerName; + + /** + * 业务员Id + */ + @TableField("F_SALESMAN_ID") + private String salesmanId; + + /** + * 业务员 + */ + @TableField("F_SALESMAN_NAME") + private String salesmanName; + + /** + * 订单日期 + */ + @TableField("F_ORDER_DATE") + private Date orderDate; + + /** + * 订单编码 + */ + @TableField("F_ORDER_CODE") + private String orderCode; + + /** + * 运输方式 + */ + @TableField("F_TRANSPORT_MODE") + private String transportMode; + + /** + * 发货日期 + */ + @TableField("F_DELIVERY_DATE") + private Date deliveryDate; + + /** + * 发货地址 + */ + @TableField("F_DELIVERY_ADDRESS") + private String deliveryAddress; + + /** + * 付款方式 + */ + @TableField("F_PAYMENT_MODE") + private String paymentMode; + + /** + * 应收金额 + */ + @TableField("F_RECEIVABLE_MONEY") + private BigDecimal receivableMoney; + + /** + * 定金比率 + */ + @TableField("F_EARNEST_RATE") + private BigDecimal earnestRate; + + /** + * 预付定金 + */ + @TableField("F_PREPAY_EARNEST") + private BigDecimal prepayEarnest; + + /** + * 当前状态 + */ + @TableField("F_CURRENT_STATE") + private Integer currentState; + + /** + * 流程引擎 + */ + @TableField("F_FLOW_ID") + private String flowId; + + /** + * 附件信息 + */ + @TableField("F_FILE_JSON") + private String fileJson; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/OrderEntryEntity.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/OrderEntryEntity.java new file mode 100644 index 0000000..909f931 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/OrderEntryEntity.java @@ -0,0 +1,101 @@ +package com.yunzhupaas.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 订单明细 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +@Data +@TableName("ext_order_entry") +public class OrderEntryEntity extends SuperExtendEntity.SuperExtendDescriptionEntity { + + /** + * 订单主键 + */ + @TableField("F_ORDER_ID") + private String orderId; + + /** + * 商品Id + */ + @TableField("F_GOODS_ID") + private String goodsId; + + /** + * 商品编码 + */ + @TableField("F_GOODS_CODE") + private String goodsCode; + + /** + * 商品名称 + */ + @TableField("F_GOODS_NAME") + private String goodsName; + + /** + * 规格型号 + */ + @TableField("F_SPECIFICATIONS") + private String specifications; + + /** + * 单位 + */ + @TableField("F_UNIT") + private String unit; + + /** + * 数量 + */ + @TableField("F_QTY") + private BigDecimal qty; + + /** + * 单价 + */ + @TableField("F_PRICE") + private BigDecimal price; + + /** + * 金额 + */ + @TableField("F_AMOUNT") + private BigDecimal amount; + + /** + * 折扣% + */ + @TableField("F_DISCOUNT") + private BigDecimal discount; + + /** + * 税率% + */ + @TableField("F_CESS") + private BigDecimal cess; + + /** + * 实际单价 + */ + @TableField("F_ACTUAL_PRICE") + private BigDecimal actualPrice; + + /** + * 实际金额 + */ + @TableField("F_ACTUAL_AMOUNT") + private BigDecimal actualAmount; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/OrderReceivableEntity.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/OrderReceivableEntity.java new file mode 100644 index 0000000..d6ed4f4 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/OrderReceivableEntity.java @@ -0,0 +1,67 @@ +package com.yunzhupaas.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 订单收款 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +@Data +@TableName("ext_order_receivable") +public class OrderReceivableEntity extends SuperExtendEntity.SuperExtendDescriptionEntity { + + /** + * 订单主键 + */ + @TableField("F_ORDER_ID") + private String orderId; + + /** + * 收款摘要 + * + */ + @TableField("F_ABSTRACT") + private String fabstract; + + /** + * 收款日期 + */ + @TableField("F_RECEIVABLE_DATE") + private Date receivableDate; + + /** + * 收款比率 + */ + @TableField("F_RECEIVABLE_RATE") + private BigDecimal receivableRate; + + /** + * 收款金额 + */ + @TableField("F_RECEIVABLE_MONEY") + private BigDecimal receivableMoney; + + /** + * 收款方式 + */ + @TableField("F_RECEIVABLE_MODE") + private String receivableMode; + + /** + * 收款状态 + */ + @TableField("F_RECEIVABLE_STATE") + private Integer receivableState; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/ProductEntity.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/ProductEntity.java new file mode 100644 index 0000000..1d814df --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/ProductEntity.java @@ -0,0 +1,188 @@ +package com.yunzhupaas.entity; + +import com.alibaba.fastjson.annotation.JSONField; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 销售订单 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021-07-10 10:40:59 + */ +@Data +@TableName("ext_product") +public class ProductEntity extends SuperExtendEntity.SuperExtendDescriptionEntity { + + /** + * 订单编号 + */ + @TableField("F_EN_CODE") + @JSONField(name = "code") + private String enCode; + + /** + * 客户类别 + */ + @TableField("F_TYPE") + private String type; + + /** + * 客户id + */ + @TableField("F_CUSTOMER_ID") + private String customerId; + + /** + * 客户名称 + */ + @TableField("F_CUSTOMER_NAME") + private String customerName; + + /** + * 制单人 + */ + @TableField("F_SALESMAN_ID") + private String salesmanId; + + /** + * 制单人 + */ + @TableField("F_SALESMAN_NAME") + private String salesmanName; + + /** + * 制单日期 + */ + @TableField("F_SALESMAN_DATE") + private Date salesmanDate; + + /** + * 审核人 + */ + @TableField("F_AUDIT_NAME") + private String auditName; + + /** + * 审核日期 + */ + @TableField("F_AUDIT_DATE") + private Date auditDate; + + /** + * 审核状态 + */ + @TableField("F_AUDIT_STATE") + private Integer auditState; + + /** + * 发货仓库 + */ + @TableField("F_GOODS_WAREHOUSE") + private String goodsWarehouse; + + /** + * 发货日期 + */ + @TableField("F_GOODS_DATE") + private Date goodsDate; + + /** + * 发货通知人 + */ + @TableField("F_CONSIGNOR") + private String consignor; + + /** + * 发货状态 + */ + @TableField("F_GOODS_STATE") + private Integer goodsState; + + /** + * 关闭状态 + */ + @TableField("F_CLOSE_STATE") + private Integer closeState; + + /** + * 关闭日期 + */ + @TableField("F_CLOSE_DATE") + private Date closeDate; + + /** + * 收款方式 + */ + @TableField("F_GATHERING_TYPE") + private String gatheringType; + + /** + * 业务员 + */ + @TableField("F_BUSINESS") + private String business; + + /** + * 送货地址 + */ + @TableField("F_ADDRESS") + private String address; + + /** + * 联系方式 + */ + @TableField("F_CONTACT_TEL") + private String contactTel; + + /** + * 联系人 + */ + @TableField("F_CONTACT_NAME") + private String contactName; + + /** + * 收货消息 + */ + @TableField("F_HARVEST_MSG") + private Integer harvestMsg; + + /** + * 收货仓库 + */ + @TableField("F_HARVEST_WAREHOUSE") + private String harvestWarehouse; + + /** + * 代发客户 + */ + @TableField("F_ISSUING_NAME") + private String issuingName; + + /** + * 让利金额 + */ + @TableField("F_PART_PRICE") + private BigDecimal partPrice; + + /** + * 优惠金额 + */ + @TableField("F_REDUCED_PRICE") + private BigDecimal reducedPrice; + + /** + * 折后金额 + */ + @TableField("F_DISCOUNT_PRICE") + private BigDecimal discountPrice; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/ProductEntryEntity.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/ProductEntryEntity.java new file mode 100644 index 0000000..bd212fb --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/ProductEntryEntity.java @@ -0,0 +1,95 @@ +package com.yunzhupaas.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 产品明细 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021-07-10 10:40:59 + */ +@Data +@TableName("ext_product_entry") +public class ProductEntryEntity extends SuperExtendEntity.SuperExtendDescriptionEntity { + + /** + * 订单主键 + */ + @TableField("F_PRODUCT_ID") + private String productId; + + /** + * 产品编码 + */ + @TableField("F_PRODUCT_CODE") + private String productCode; + + /** + * 产品名称 + */ + @TableField("F_PRODUCT_NAME") + private String productName; + + /** + * 产品规格 + */ + @TableField("F_PRODUCT_SPECIFICATION") + private String productSpecification; + + /** + * 数量 + */ + @TableField("F_QTY") + private Integer qty; + + /** + * 订货类型 + */ + @TableField("F_TYPE") + private String type; + + /** + * 单价 + */ + @TableField("F_MONEY") + private BigDecimal money; + + /** + * 折后单价 + */ + @TableField("F_PRICE") + private BigDecimal price; + + /** + * 单位 + */ + @TableField("F_UTIL") + private String util; + + /** + * 控制方式 + */ + @TableField("F_COMMAND_TYPE") + private String commandType; + + /** + * 金额 + */ + @TableField("F_AMOUNT") + private BigDecimal amount; + + /** + * 活动 + */ + @TableField("F_ACTIVITY") + private String activity; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/ProductGoodsEntity.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/ProductGoodsEntity.java new file mode 100644 index 0000000..477cc98 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/ProductGoodsEntity.java @@ -0,0 +1,65 @@ +package com.yunzhupaas.entity; + +import com.alibaba.fastjson.annotation.JSONField; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +/** + * 产品商品 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021-07-10 15:57:50 + */ +@Data +@TableName("ext_product_goods") +public class ProductGoodsEntity extends SuperExtendEntity { + + /** + * 分类主键 + */ + @TableField("F_CLASSIFY_ID") + private String classifyId; + + /** + * 产品编号 + */ + @TableField("F_EN_CODE") + @JSONField(name = "code") + private String enCode; + + /** + * 产品名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + + /** + * 订货类型 + */ + @TableField("F_TYPE") + private String type; + + /** 产品规格 */ + @TableField("F_PRODUCT_SPECIFICATION") + private String productSpecification; + + /** 单价 */ + @TableField("F_MONEY") + private String money; + + /** + * 库存数 + */ + @TableField("F_QTY") + private Integer qty; + + /** 金额 */ + @TableField("F_AMOUNT") + private String amount; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/ProductclassifyEntity.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/ProductclassifyEntity.java new file mode 100644 index 0000000..5b06daf --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/ProductclassifyEntity.java @@ -0,0 +1,33 @@ +package com.yunzhupaas.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperEntity; +import lombok.Data; + +/** + * 产品分类 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021-07-10 14:34:04 + */ +@Data +@TableName("ext_product_classify") +public class ProductclassifyEntity extends SuperEntity { + + /** + * 上级 + */ + @TableField("F_PARENT_ID") + private String parentId; + + /** + * 名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/ProjectGanttEntity.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/ProjectGanttEntity.java new file mode 100644 index 0000000..e0d1b96 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/ProjectGanttEntity.java @@ -0,0 +1,96 @@ +package com.yunzhupaas.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 项目计划 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +@Data +@TableName("ext_project_gantt") +public class ProjectGanttEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 项目上级 + */ + @TableField("F_PARENT_ID") + private String parentId; + + /** + * 项目主键 + */ + @TableField("F_PROJECT_ID") + private String projectId; + + /** + * 项目类型 + */ + @TableField("F_TYPE") + private Integer type; + + /** + * 项目编码 + */ + @TableField("F_EN_CODE") + private String enCode; + + /** + * 项目名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + + /** + * 项目工期 + */ + @TableField("F_TIME_LIMIT") + private BigDecimal timeLimit; + + /** + * 项目标记 + */ + @TableField("F_SIGN") + private String sign; + + /** + * 标记颜色 + */ + @TableField("F_SIGN_COLOR") + private String signColor; + + /** + * 开始时间 + */ + @TableField("F_START_TIME") + private Date startTime; + + /** + * 结束时间 + */ + @TableField("F_END_TIME") + private Date endTime; + + /** + * 当前进度 + */ + @TableField("F_SCHEDULE") + private Integer schedule; + + /** + * 负责人 + */ + @TableField("F_MANAGER_IDS") + private String managerIds; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/SalesOrderEntity.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/SalesOrderEntity.java new file mode 100644 index 0000000..2921aad --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/SalesOrderEntity.java @@ -0,0 +1,126 @@ +package com.yunzhupaas.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperBaseEntity; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 销售订单 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-29 上午9:18 + */ +@Data +@TableName("wform_salesorder") +public class SalesOrderEntity extends SuperBaseEntity.SuperTBaseEntity { + + /** + * 流程主键 + */ + @TableField("F_FLOWID") + private String flowId; + + /** + * 流程标题 + */ + @TableField("F_FLOWTITLE") + private String flowTitle; + + /** + * 流程等级 + */ + @TableField("F_FLOWURGENT") + private Integer flowUrgent; + + /** + * 流程单据 + */ + @TableField("F_BILLNO") + private String billNo; + + /** + * 业务人员 + */ + @TableField("F_SALESMAN") + private String salesman; + + /** + * 客户名称 + */ + @TableField("F_CUSTOMERNAME") + private String customerName; + + /** + * 联系人 + */ + @TableField("F_CONTACTS") + private String contacts; + + /** + * 联系电话 + */ + @TableField("F_CONTACTPHONE") + private String contactPhone; + + /** + * 客户地址 + */ + @TableField("F_CUSTOMERADDRES") + private String customerAddres; + + /** + * 发票编码 + */ + @TableField("F_TICKETNUM") + private String ticketNum; + + /** + * 开票日期 + */ + @TableField("F_TICKETDATE") + private Date ticketDate; + + /** + * 发票类型 + */ + @TableField("F_INVOICETYPE") + private String invoiceType; + + /** + * 付款方式 + */ + @TableField("F_PAYMENTMETHOD") + private String paymentMethod; + + /** + * 付款金额 + */ + @TableField("F_PAYMENTMONEY") + private BigDecimal paymentMoney; + + /** + * 销售日期 + */ + @TableField("F_SALESDATE") + private Date salesDate; + + /** + * 相关附件 + */ + @TableField("F_FILEJSON") + private String fileJson; + + /** + * 描述 + */ + @TableField("F_DESCRIPTION") + private String description; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/SalesOrderEntryEntity.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/SalesOrderEntryEntity.java new file mode 100644 index 0000000..5ad155b --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/SalesOrderEntryEntity.java @@ -0,0 +1,77 @@ +package com.yunzhupaas.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperBaseEntity; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 销售订单明细 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-29 上午9:18 + */ +@Data +@TableName("wform_salesorderentry") +public class SalesOrderEntryEntity extends SuperBaseEntity.SuperTBaseEntity { + + /** + * 订单主键 + */ + @TableField("F_SALESORDERID") + private String salesOrderId; + + /** + * 商品名称 + */ + @TableField("F_GOODSNAME") + private String goodsName; + + /** + * 规格型号 + */ + @TableField("F_SPECIFICATIONS") + private String specifications; + + /** + * 单位 + */ + @TableField("F_UNIT") + private String unit; + + /** + * 数量 + */ + @TableField("F_QTY") + private BigDecimal qty; + + /** + * 单价 + */ + @TableField("F_PRICE") + private BigDecimal price; + + /** + * 金额 + */ + @TableField("F_AMOUNT") + private BigDecimal amount; + + /** + * 描述 + */ + @TableField("F_DESCRIPTION") + private String description; + + /** + * 排序码 + */ + @TableField("F_SORTCODE") + private Long sortCode; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/TableExampleEntity.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/TableExampleEntity.java new file mode 100644 index 0000000..c0fef1a --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/TableExampleEntity.java @@ -0,0 +1,120 @@ +package com.yunzhupaas.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 表格示例数据 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +@Data +@TableName("ext_table_example") +public class TableExampleEntity extends SuperExtendEntity { + + /** + * 交互日期 + */ + @TableField("F_INTERACTION_DATE") + private Date interactionDate; + + /** + * 项目编码 + */ + @TableField("F_PROJECT_CODE") + private String projectCode; + + /** + * 项目名称 + */ + @TableField("F_PROJECT_NAME") + private String projectName; + + /** + * 负责人 + */ + @TableField("F_PRINCIPAL") + private String principal; + + /** + * 立顶人 + */ + @TableField("F_JACK_STANDS") + private String jackStands; + + /** + * 项目类型 + */ + @TableField("F_PROJECT_TYPE") + private String projectType; + + /** + * 项目阶段 + */ + @TableField("F_PROJECT_PHASE") + private String projectPhase; + + /** + * 客户名称 + */ + @TableField("F_CUSTOMER_NAME") + private String customerName; + + /** + * 费用金额 + */ + @TableField("F_COST_AMOUNT") + private BigDecimal costAmount; + + /** + * 已用金额 + */ + @TableField("F_TUNES_AMOUNT") + private BigDecimal tunesAmount; + + /** + * 预计收入 + */ + @TableField("F_PROJECTED_INCOME") + private BigDecimal projectedIncome; + + /** + * 登记人 + */ + @TableField("F_REGISTRANT") + private String registrant; + + /** + * 登记时间 + */ + @TableField("F_REGISTER_DATE") + private Date registerDate; + + /** + * 标记 + */ + @TableField("F_SIGN") + private String sign; + + /** + * 批注列表Json + */ + @TableField("f_postil_json") + private String postilJson; + + /** + * 批注总数 + */ + @TableField("F_POSTIL_COUNT") + private Integer postilCount; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/WorkLogEntity.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/WorkLogEntity.java new file mode 100644 index 0000000..460c7ce --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/WorkLogEntity.java @@ -0,0 +1,52 @@ +package com.yunzhupaas.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + + +/** + * + * 工作日志 + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +@Data +@TableName("ext_work_log") +public class WorkLogEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 日志标题 + */ + @TableField("F_TITLE") + private String title; + + /** + * 今天内容 + */ + @TableField("F_TODAY_CONTENT") + private String todayContent; + + /** + * 明天内容 + */ + @TableField("F_TOMORROW_CONTENT") + private String tomorrowContent; + + /** + * 遇到问题 + */ + @TableField("F_QUESTION") + private String question; + + /** + * 发送给谁 + */ + @TableField("F_TO_USER_ID") + private String toUserId; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/WorkLogShareEntity.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/WorkLogShareEntity.java new file mode 100644 index 0000000..15bf008 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/entity/WorkLogShareEntity.java @@ -0,0 +1,41 @@ +package com.yunzhupaas.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * + * 工作日志分享 + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +@Data +@TableName("ext_work_log_share") +public class WorkLogShareEntity extends SuperExtendEntity { + + /** + * 日志主键 + */ + @TableField("F_WORK_LOG_ID") + private String workLogId; + + /** + * 共享人员 + */ + @TableField("F_SHARE_USER_ID") + private String shareUserId; + + /** + * 共享时间 + */ + @TableField("F_SHARE_TIME") + private Date shareTime; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/EmployeeModel.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/EmployeeModel.java new file mode 100644 index 0000000..2a303c5 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/EmployeeModel.java @@ -0,0 +1,68 @@ +package com.yunzhupaas.model; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * + */ +@Data +public class EmployeeModel { + @Excel(name = "工号", isImportField = "true") + @Schema(description ="工号") + private String enCode; + @Excel(name = "姓名", isImportField = "true") + @Schema(description ="姓名") + private String fullName; + @Excel(name = "性别", isImportField = "true") + @Schema(description ="性别") + private String gender; + @Excel(name = "部门", isImportField = "true") + @Schema(description ="部门") + private String departmentName; + @Excel(name = "职务", isImportField = "true") + @Schema(description ="职务") + private String positionName; + @Excel(name = "用工性质", isImportField = "true") + @Schema(description ="用工性质") + private String workingNature; + @Excel(name = "身份证号", isImportField = "true") + @Schema(description ="身份证号") + private String idNumber; + @Excel(name = "联系电话", isImportField = "true") + @Schema(description ="联系电话") + private String telephone; + @Excel(name = "参加工作", isImportField = "true") + @Schema(description ="参加工作") + private String attendWorkTime; + @Excel(name = "出生年月", isImportField = "true") + @Schema(description ="出生年月") + private String birthday; + @Excel(name = "最高学历", isImportField = "true") + @Schema(description ="最高学历") + private String education; + @Excel(name = "所学专业", isImportField = "true") + @Schema(description ="所学专业") + private String major; + @Excel(name = "毕业院校", isImportField = "true") + @Schema(description ="毕业院校") + private String graduationAcademy; + @Excel(name = "毕业时间", isImportField = "true") + @Schema(description ="毕业时间") + private String graduationTime; + @Schema(description ="字表数据") + private List list; + @Schema(description ="创建时间") + private String creatorTime; + + private boolean type; + private String fileName; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/ReportManageModel.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/ReportManageModel.java new file mode 100644 index 0000000..fed2c1b --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/ReportManageModel.java @@ -0,0 +1,23 @@ +package com.yunzhupaas.model; + + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ReportManageModel { + @Schema(description ="主键") + @JSONField(name = "F_Id") + private String id; + @Schema(description ="名称") + @JSONField(name = "F_FullName") + private String fullName; + @Schema(description ="分类") + @JSONField(name = "F_Category") + private String category; + @Schema(description ="地址") + @JSONField(name = "F_UrlAddress") + private String urlAddress; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/bidata/BigBigDataListVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/bidata/BigBigDataListVO.java new file mode 100644 index 0000000..342f4ee --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/bidata/BigBigDataListVO.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.model.bidata; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class BigBigDataListVO { + @Schema(description ="编码") + private String enCode; + @Schema(description ="名称") + private String fullName; + @Schema(description ="主键id") + private String id; + @Schema(description ="创建时间") + private long creatorTime; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/customer/CustomerCrForm.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/customer/CustomerCrForm.java new file mode 100644 index 0000000..2ad5654 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/customer/CustomerCrForm.java @@ -0,0 +1,27 @@ +package com.yunzhupaas.model.customer; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * 客户信息 + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021-07-10 14:09:05 + */ +@Data +public class CustomerCrForm { + @Schema(description ="编码") + private String code; + @Schema(description ="客户名称") + private String customerName; + @Schema(description ="地址") + private String address; + @Schema(description ="名称") + private String name; + @Schema(description ="联系方式") + private String contactTel; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/customer/CustomerInfoVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/customer/CustomerInfoVO.java new file mode 100644 index 0000000..24abc7b --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/customer/CustomerInfoVO.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.model.customer; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * 客户信息 + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021-07-10 14:09:05 + */ +@Data +public class CustomerInfoVO{ + @Schema(description ="主键") + private String id; + @Schema(description ="编码") + private String code; + @Schema(description ="客户名称") + private String customerName; + @Schema(description ="地址") + private String address; + @Schema(description ="名称") + private String name; + @Schema(description ="联系方式") + private String contactTel; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/customer/CustomerListVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/customer/CustomerListVO.java new file mode 100644 index 0000000..2107505 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/customer/CustomerListVO.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.model.customer; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * 客户信息 + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021-07-10 14:09:05 + */ +@Data +public class CustomerListVO{ + @Schema(description ="主键") + private String id; + @Schema(description ="编码") + private String code; + @Schema(description ="客户名称") + private String customerName; + @Schema(description ="地址") + private String address; + @Schema(description ="名称") + private String name; + @Schema(description ="联系方式") + private String contactTel; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/customer/CustomerUpForm.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/customer/CustomerUpForm.java new file mode 100644 index 0000000..9bf7d7a --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/customer/CustomerUpForm.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.model.customer; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * 客户信息 + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021-07-10 14:09:05 + */ +@Data +public class CustomerUpForm extends CustomerCrForm { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/document/DocumentCrForm.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/document/DocumentCrForm.java new file mode 100644 index 0000000..ba69cef --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/document/DocumentCrForm.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.model.document; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.hibernate.validator.constraints.NotBlank; + +import jakarta.validation.constraints.NotNull; + +@Data +public class DocumentCrForm { + @NotBlank(message = "必填") + @Schema(description ="文件夹名称") + private String fullName; + @NotNull(message = "必填") + @Schema(description ="文档分类") + private Integer type; + @NotBlank(message = "必填") + @Schema(description ="文档父级") + private String parentId; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/document/DocumentFolderTreeModel.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/document/DocumentFolderTreeModel.java new file mode 100644 index 0000000..bfefc3c --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/document/DocumentFolderTreeModel.java @@ -0,0 +1,12 @@ +package com.yunzhupaas.model.document; + +import com.yunzhupaas.util.treeutil.SumTree; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class DocumentFolderTreeModel extends SumTree { + private String icon; + private String fullName; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/document/DocumentFolderTreeVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/document/DocumentFolderTreeVO.java new file mode 100644 index 0000000..b832526 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/document/DocumentFolderTreeVO.java @@ -0,0 +1,23 @@ +package com.yunzhupaas.model.document; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +@Data +public class DocumentFolderTreeVO { + @Schema(description ="名称") + private String fullName; + @Schema(description ="图标") + private String icon; + @Schema(description ="是否有下级菜单") + private Boolean hasChildren; + @Schema(description ="主键") + private String id; + @Schema(description ="父级主键") + private String parentId; + + @Schema(description ="子数据") + private List children; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/document/DocumentInfoVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/document/DocumentInfoVO.java new file mode 100644 index 0000000..eb26770 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/document/DocumentInfoVO.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.model.document; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class DocumentInfoVO { + @Schema(description ="文件名称") + private String fullName; + @Schema(description ="主键id") + private String id; + @Schema(description ="文档分类") + private Integer type; + @Schema(description ="文档父级") + private String parentId; + + @Schema(description ="文档下载地址") + private String uploaderUrl; + @Schema(description ="文件路径") + private String filePath; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/document/DocumentListVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/document/DocumentListVO.java new file mode 100644 index 0000000..8c87266 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/document/DocumentListVO.java @@ -0,0 +1,39 @@ +package com.yunzhupaas.model.document; +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + + +@Data +public class DocumentListVO { + @Schema(description ="主键id") + private String id; + @Schema(description ="文件夹名称") + private String fullName; + @Schema(description ="文档分类(0-文件夹,1-文件)") + private Integer type; + @Schema(description ="创建日期") + private long creatorTime; + @Schema(description ="是否分享") + private Integer isShare; + @Schema(description ="大小") + private String fileSize; + @Schema(description ="父级Id") + private String parentId; + @Schema(description ="后缀名") + private String fileExtension; + @Schema(description ="文档下载地址") + private String uploaderUrl; + @Schema(description ="文件路径") + private String filePath; + @Schema(description ="是否支持预览") + private String isPreview; + @Schema(description ="创建用户") + private String creatorUserId; + + @Schema(description ="共享时间") + private Date shareTime; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/document/DocumentShareForm.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/document/DocumentShareForm.java new file mode 100644 index 0000000..e3bf402 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/document/DocumentShareForm.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.model.document; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +@Data +public class DocumentShareForm { + + @Schema(description = "用户id列表") + private List userIds; + + @Schema(description = "共享文件id列表") + private List ids; + + private String creatorUserId; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/document/DocumentSuserListVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/document/DocumentSuserListVO.java new file mode 100644 index 0000000..f66c837 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/document/DocumentSuserListVO.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.model.document; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +@Data +public class DocumentSuserListVO { + @Schema(description ="主键") + private String id; + @Schema(description ="文档主键") + private String documentId; + @Schema(description ="用户") + private String shareUserId; + @Schema(description ="时间") + private Date shareTime; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/document/DocumentTrashListVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/document/DocumentTrashListVO.java new file mode 100644 index 0000000..a25c3a3 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/document/DocumentTrashListVO.java @@ -0,0 +1,23 @@ +package com.yunzhupaas.model.document; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class DocumentTrashListVO { + @Schema(description = "主键id") + private String id; + @Schema(description = "文件名称") + private String fullName; + @Schema(description = "文件id") + private String documentId; + @Schema(description = "删除日期") + private String deleteTime; + @Schema(description = "大小") + private String fileSize; + @Schema(description = "类型:0-文件夹,1-文件") + private Integer type; + @Schema(description ="后缀名") + private String fileExtension; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/document/DocumentUpForm.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/document/DocumentUpForm.java new file mode 100644 index 0000000..4cb8e28 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/document/DocumentUpForm.java @@ -0,0 +1,9 @@ +package com.yunzhupaas.model.document; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +@Data +public class DocumentUpForm extends DocumentCrForm{ +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/document/DocumentUploader.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/document/DocumentUploader.java new file mode 100644 index 0000000..b4ebfea --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/document/DocumentUploader.java @@ -0,0 +1,38 @@ +package com.yunzhupaas.model.document; +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.springframework.web.multipart.MultipartFile; + +import java.io.Serializable; + +@Data +public class DocumentUploader implements Serializable { + @Schema(description ="父级id") + private String parentId; + @JSONField(serialize = false) + @Schema(description ="文件") + private MultipartFile file; + + @Schema(description ="文件") + private String fileName; + + @Schema(description ="流程任务id") + private String taskId; + + public DocumentUploader(MultipartFile file, String parentId, String taskId) { + this.file = file; + this.parentId = parentId; + this.taskId = taskId; + } + + public DocumentUploader(MultipartFile file, String parentId) { + this.file = file; + this.parentId = parentId; + } + + public DocumentUploader() { + } + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/document/FlowFileModel.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/document/FlowFileModel.java new file mode 100644 index 0000000..3da7cd9 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/document/FlowFileModel.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.model.document; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/12/4 16:29 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class FlowFileModel { + private String userId; + private String templateId; + /** + * 数据读取范围,近七天、近一个月、近半年、近一年、全部 + */ + private Integer dataRange = 0; +} diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/document/PageDocument.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/document/PageDocument.java new file mode 100644 index 0000000..4e15206 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/document/PageDocument.java @@ -0,0 +1,11 @@ +package com.yunzhupaas.model.document; +import com.yunzhupaas.base.Page; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class PageDocument extends Page { + @Schema(description ="父级主键") + private String parentId; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/documentpreview/FileInfoVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/documentpreview/FileInfoVO.java new file mode 100644 index 0000000..4f9a92c --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/documentpreview/FileInfoVO.java @@ -0,0 +1,11 @@ +package com.yunzhupaas.model.documentpreview; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class FileInfoVO { + + private String fileName; + private String filePath; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/email/EmailCheckForm.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/email/EmailCheckForm.java new file mode 100644 index 0000000..1800312 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/email/EmailCheckForm.java @@ -0,0 +1,33 @@ +package com.yunzhupaas.model.email; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.hibernate.validator.constraints.NotBlank; + +@Data +public class EmailCheckForm { + @NotBlank(message = "必填") + @Schema(description ="POP3端口") + private String pop3Port; + @Schema(description ="ssl登录") + private String emailSsl; + @NotBlank(message = "必填") + @Schema(description ="邮箱地址") + private String account; + @NotBlank(message = "必填") + @Schema(description ="POP3服务") + private String pop3Host; + @NotBlank(message = "必填") + @Schema(description ="邮箱密码") + private String password; + @NotBlank(message = "必填") + @Schema(description ="SMTP服务") + private String smtpHost; + @NotBlank(message = "必填") + @Schema(description ="SMTP端口") + private String smtpPort; + @NotBlank(message = "必填") + @Schema(description ="显示名称") + private String senderName; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/email/EmailCofigInfoVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/email/EmailCofigInfoVO.java new file mode 100644 index 0000000..345978a --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/email/EmailCofigInfoVO.java @@ -0,0 +1,33 @@ +package com.yunzhupaas.model.email; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class EmailCofigInfoVO { + + @Schema(description ="账户") + private String account; + + @Schema(description ="密码") + private String password; + + @Schema(description ="POP3服务") + private String pop3Host; + + @Schema(description ="POP3端口") + private Integer pop3Port; + + @Schema(description ="发件人名称") + private String senderName; + + @Schema(description ="SMTP服务") + private String smtpHost; + + @Schema(description ="SMTP端口") + private Integer smtpPort; + @Schema(description ="创建时间") + private long creatorTime; + @Schema(description ="是否开户SSL登录(1-是,0否)") + private Integer emailSsl; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/email/EmailCrForm.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/email/EmailCrForm.java new file mode 100644 index 0000000..644c627 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/email/EmailCrForm.java @@ -0,0 +1,37 @@ +package com.yunzhupaas.model.email; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.hibernate.validator.constraints.NotBlank; + +/** + * 发邮件 + */ +@Data +public class EmailCrForm { + @JsonIgnore + @Schema(description ="id",hidden = true) + private String id; + @Schema(description ="抄送人") + private String cc; + + @Schema(description ="密送人") + private String bcc; + + @Schema(description ="正文") + private String bodyText; + + @Schema(description ="附件") + private String attachment; + + @NotBlank(message = "必填") + @Schema(description ="主题") + private String subject; + + @NotBlank(message = "必填") + @Schema(description ="收件人") + private String recipient; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/email/EmailDraftListVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/email/EmailDraftListVO.java new file mode 100644 index 0000000..e7cb3a0 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/email/EmailDraftListVO.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.model.email; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class EmailDraftListVO { + @Schema(description ="附件") + private String attachment; + @Schema(description ="发件人") + private String id; + @Schema(description ="主题") + private String subject; + @Schema(description ="收件人") + private String recipient; + @Schema(description ="创建时间") + private long creatorTime; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/email/EmailInfoModel.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/email/EmailInfoModel.java new file mode 100644 index 0000000..fb2e779 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/email/EmailInfoModel.java @@ -0,0 +1,13 @@ +package com.yunzhupaas.model.email; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class EmailInfoModel { + private String fileId; + private String fileName; + private String fileSize; + private String fileTime; + private String fileState; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/email/EmailInfoVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/email/EmailInfoVO.java new file mode 100644 index 0000000..e809424 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/email/EmailInfoVO.java @@ -0,0 +1,32 @@ +package com.yunzhupaas.model.email; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class EmailInfoVO{ + @Schema(description ="主键") + private String id; + @Schema(description ="邮件主题") + private String subject; + @Schema(description ="抄送人") + private String cc; + @Schema(description ="密送人") + private String bcc; + @Schema(description ="发件人姓名") + private String senderName; + @Schema(description ="发件人邮箱") + private String sender; + @Schema(description ="时间") + private Long fdate; + @Schema(description ="创建时间") + private Long creatorTime; + @Schema(description ="收件箱收件人") + private String mAccount; + @Schema(description ="发送收件人") + private String recipient; + @Schema(description ="附件对象") + private String attachment; + @Schema(description ="邮件内容") + private String bodyText; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/email/EmailReceiveListVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/email/EmailReceiveListVO.java new file mode 100644 index 0000000..9991793 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/email/EmailReceiveListVO.java @@ -0,0 +1,27 @@ +package com.yunzhupaas.model.email; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class EmailReceiveListVO { + @Schema(description ="是否已读(1-已读,0-未)") + private Integer isRead; + @Schema(description ="附件") + private String attachment; + @Schema(description ="时间") + private Long fdate; + @Schema(description ="发件人") + private String id; + @Schema(description ="是否标星(1-是,0-否)") + private Integer starred; + @Schema(description ="发件人") + private String sender; + @Schema(description ="主题") + private String subject; + @Schema(description ="创建时间") + private Long creatorTime; + @Schema(description ="收件人") + private String recipient; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/email/EmailSendCrForm.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/email/EmailSendCrForm.java new file mode 100644 index 0000000..ca661c8 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/email/EmailSendCrForm.java @@ -0,0 +1,38 @@ +package com.yunzhupaas.model.email; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.hibernate.validator.constraints.NotBlank; + +/** + * 存草稿 + */ +@Data +public class EmailSendCrForm { +// @JsonIgnore + @Schema(description ="id",hidden = true) + private String id; + + @Schema(description ="抄送人") + private String cc; + + @Schema(description ="密送人") + private String bcc; + + @Schema(description ="正文") + private String bodyText; + + @Schema(description ="附件") + private String attachment; + + @NotBlank(message = "必填") + @Schema(description ="主题") + private String subject; + + @NotBlank(message = "必填") + @Schema(description ="收件人") + private String recipient; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/email/EmailSentListVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/email/EmailSentListVO.java new file mode 100644 index 0000000..5a24e1a --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/email/EmailSentListVO.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.model.email; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class EmailSentListVO { + @Schema(description ="附件") + private String attachment; + @Schema(description ="发件人") + private String id; + @Schema(description ="主题") + private String subject; + @Schema(description ="收件人") + private String recipient; + @Schema(description ="创建时间") + private Long creatorTime; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/email/EmailStarredListVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/email/EmailStarredListVO.java new file mode 100644 index 0000000..7ca764e --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/email/EmailStarredListVO.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.model.email; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class EmailStarredListVO { + @Schema(description ="是否已读(1-已读,0-未)") + private Integer isRead; + @Schema(description ="附件") + private String attachment; + @Schema(description ="时间") + private Long fdate; + @Schema(description ="发件人") + private String id; + @Schema(description ="是否标星(1-是,0-否)") + private Integer starred; + @Schema(description ="发件人") + private String sender; + @Schema(description ="主题") + private String subject; + @Schema(description ="创建时间") + private long creatorTime; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/email/PaginationEmail.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/email/PaginationEmail.java new file mode 100644 index 0000000..5e3193a --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/email/PaginationEmail.java @@ -0,0 +1,11 @@ +package com.yunzhupaas.model.email; +import com.yunzhupaas.base.PaginationTime; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class PaginationEmail extends PaginationTime { + @Schema(description ="类型") + private String type; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/emailconfig/EmailConfigCheckForm.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/emailconfig/EmailConfigCheckForm.java new file mode 100644 index 0000000..aaa3bd4 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/emailconfig/EmailConfigCheckForm.java @@ -0,0 +1,37 @@ +package com.yunzhupaas.model.emailconfig; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 邮箱账户密码验证 + */ +@Data +public class EmailConfigCheckForm { + @Schema(description ="邮箱密码") + private String password; + + @Schema(description ="显示名称") + private String senderName; + + @Schema(description ="SMTP服务") + private String smtpHost; + + @Schema(description ="POP3端口") + private Integer pop3Port; + + @Schema(description ="主键id") + private String id; + + @Schema(description ="SMTP端口") + private Integer smtpPort; + + @Schema(description ="ssl登录") + private Integer emailSsl; + + @Schema(description ="邮箱地址") + private String account; + + @Schema(description ="POP3服务") + private String pop3Host; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/emailconfig/EmailConfigSavaForm.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/emailconfig/EmailConfigSavaForm.java new file mode 100644 index 0000000..da224f8 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/emailconfig/EmailConfigSavaForm.java @@ -0,0 +1,35 @@ +package com.yunzhupaas.model.emailconfig; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * 保存邮箱配置 + */ +@Data +public class EmailConfigSavaForm { + + private String creatorUserId; + + private String password; + + private String senderName; + + private String smtpHost; + + private Integer pop3Port; + + private String id; + + private Date creatorTime; + + private Integer smtpPort; + + private Integer emailSsl; + + private String account; + + private String pop3Host; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/employee/EmployeeCrForm.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/employee/EmployeeCrForm.java new file mode 100644 index 0000000..b11c333 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/employee/EmployeeCrForm.java @@ -0,0 +1,44 @@ +package com.yunzhupaas.model.employee; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.hibernate.validator.constraints.NotBlank; + +@Data +public class EmployeeCrForm { + @NotBlank(message = "必填") + @Schema(description ="姓名") + private String fullName; + @NotBlank(message = "必填") + @Schema(description ="工号") + private String enCode; + @NotBlank(message = "必填") + @Schema(description ="性别") + private String gender; + @NotBlank(message = "必填") + @Schema(description ="部门") + private String departmentName; + @NotBlank(message = "必填") + @Schema(description ="岗位") + private String positionName; + @Schema(description ="用工性质") + private String workingNature; + @NotBlank(message = "必填") + @Schema(description ="身份证号") + private String idNumber; + @NotBlank(message = "必填") + @Schema(description ="联系电话") + private String telephone; + @Schema(description ="参加工作") + private long attendWorkTime; + @Schema(description ="出生年月") + private long birthday; + @Schema(description ="最高学历") + private String education; + @Schema(description ="所学专业") + private String major; + @Schema(description ="毕业院校") + private String graduationAcademy; + @Schema(description ="毕业时间") + private long graduationTime; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/employee/EmployeeExportVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/employee/EmployeeExportVO.java new file mode 100644 index 0000000..8f95d88 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/employee/EmployeeExportVO.java @@ -0,0 +1,139 @@ +package com.yunzhupaas.model.employee; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * + */ +@Data +public class EmployeeExportVO { + /** + * 职员主键 + */ + private String id; + + /** + * 工号 + */ + private String enCode; + + /** + * 姓名 + */ + private String fullName; + + /** + * 性别 + */ + private String gender; + + /** + * 部门 + */ + private String departmentName; + + /** + * 岗位 + */ + private String positionName; + + /** + * 用工性质 + */ + private String workingNature; + + /** + * 身份证号 + */ + private String idNumber; + + /** + * 联系电话 + */ + private String telephone; + + /** + * 参加工作 + */ + private String attendWorkTime; + + /** + * 出生年月 + */ + private String birthday; + + /** + * 最高学历 + */ + private String education; + + /** + * 所学专业 + */ + private String major; + + /** + * 毕业院校 + */ + private String graduationAcademy; + + /** + * 毕业时间 + */ + private String graduationTime; + + /** + * 描述 + */ + private String description; + + /** + * 排序码 + */ + private Long sortCode; + + /** + * 有效标志 + */ + private Integer enabledMark; + + /** + * 创建时间 + */ + private String creatorTime; + + /** + * 创建用户 + */ + private String creatorUserId; + + /** + * 修改时间 + */ + private String lastModifyTime; + + /** + * 修改用户 + */ + private String lastModifyUserId; + + /** + * 删除标志 + */ + private Integer deleteMark; + + /** + * 删除时间 + */ + private String deleteTime; + + /** + * 删除用户 + */ + private String deleteUserId; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/employee/EmployeeImportVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/employee/EmployeeImportVO.java new file mode 100644 index 0000000..2cb006b --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/employee/EmployeeImportVO.java @@ -0,0 +1,36 @@ +package com.yunzhupaas.model.employee; + +import com.yunzhupaas.model.EmployeeModel; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * + */ +@Data +public class EmployeeImportVO { + /** + * 导入成功条数 + */ + private int snum; + /** + * 导入失败条数 + */ + private int fnum; + /** + * 导入结果状态(0,成功 1,失败) + */ + private int resultType; + /** + * 失败结果 + */ + private List failResult; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/employee/EmployeeInfoModel.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/employee/EmployeeInfoModel.java new file mode 100644 index 0000000..b6bf985 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/employee/EmployeeInfoModel.java @@ -0,0 +1,67 @@ +package com.yunzhupaas.model.employee; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * + */ +@Data +public class EmployeeInfoModel { + @Schema(description ="出生年月") + private Date birthday; + @Schema(description ="参加工作") + private String attendWorkTime; + @Schema(description ="创建时间") + private Date creatorTime; + @Schema(description ="创建用户") + private String creatorUserId; + @Schema(description ="删除标志") + private String deleteMark; + @Schema(description ="删除时间") + private Date deleteTime; + @Schema(description ="删除用户") + private String deleteUserId; + @Schema(description ="部门") + private String departmentName; + @Schema(description ="描述") + private String description; + @Schema(description ="最高学历") + private String education; + @Schema(description ="工号") + private String enCode; + @Schema(description ="有效标志") + private Integer enabledMark; + @Schema(description ="姓名") + private String fullName; + @Schema(description ="性别") + private String gender; + @Schema(description ="毕业院校") + private String graduationAcademy ; + @Schema(description ="毕业时间") + private Date graduationTime; + @Schema(description ="自然主键") + private String id; + @Schema(description ="身份证号") + private String idNumber; + @Schema(description ="修改时间") + private Date lastModifyTime; + @Schema(description ="修改用户") + private String lastModifyUserId; + @Schema(description ="所学专业") + private String major; + @Schema(description ="岗位") + private String positionName; + @Schema(description ="排序") + private String sortCode; + @Schema(description ="联系电话") + private String telephone; + @Schema(description ="用工性质") + private String workingNature; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/employee/EmployeeInfoVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/employee/EmployeeInfoVO.java new file mode 100644 index 0000000..25f3c13 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/employee/EmployeeInfoVO.java @@ -0,0 +1,37 @@ +package com.yunzhupaas.model.employee; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +@Data +public class EmployeeInfoVO { + @Schema(description ="姓名") + private String fullName; + @Schema(description ="工号") + private String enCode; + @Schema(description ="性别") + private String gender; + @Schema(description ="部门") + private String departmentName; + @Schema(description ="岗位") + private String positionName; + @Schema(description ="用工性质") + private String workingNature; + @Schema(description ="身份证号") + private String idNumber; + @Schema(description ="联系电话") + private String telephone; + @Schema(description ="参加工作") + private long attendWorkTime; + @Schema(description ="出生年月") + private long birthday; + @Schema(description ="最高学历") + private String education; + @Schema(description ="所学专业") + private String major; + @Schema(description ="毕业院校") + private String graduationAcademy; + @Schema(description ="毕业时间") + private long graduationTime; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/employee/EmployeeListVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/employee/EmployeeListVO.java new file mode 100644 index 0000000..b53adc1 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/employee/EmployeeListVO.java @@ -0,0 +1,41 @@ +package com.yunzhupaas.model.employee; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class EmployeeListVO { + @Schema(description ="主鍵") + private String id; + @Schema(description ="工号") + private String enCode; + @Schema(description ="姓名") + private String fullName; + @Schema(description ="性别ID") + private String gender; + @Schema(description ="部门") + private String departmentName; + @Schema(description ="岗位") + private String positionName; + @Schema(description ="用工性质") + private String workingNature; + @Schema(description ="身份证") + private String idNumber; + @Schema(description ="联系电话") + private String telephone; + @Schema(description ="生日") + private long birthday; + @Schema(description ="参加工作时间") + private long attendWorkTime; + @Schema(description ="学历") + private String education; + @Schema(description ="所学专业") + private String major; + @Schema(description ="毕业院校") + private String graduationAcademy; + @Schema(description ="毕业时间") + private long graduationTime; + @Schema(description ="创建时间") + private long creatorTime; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/employee/EmployeeUpForm.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/employee/EmployeeUpForm.java new file mode 100644 index 0000000..0a6dfd4 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/employee/EmployeeUpForm.java @@ -0,0 +1,8 @@ +package com.yunzhupaas.model.employee; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class EmployeeUpForm extends EmployeeCrForm{ +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/employee/PaginationEmployee.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/employee/PaginationEmployee.java new file mode 100644 index 0000000..c067e32 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/employee/PaginationEmployee.java @@ -0,0 +1,15 @@ +package com.yunzhupaas.model.employee; +import com.yunzhupaas.base.PaginationTime; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class PaginationEmployee extends PaginationTime { + @Schema(description ="字段") + private String condition; + @Schema(description ="类型") + private String dataType; + @Schema(description ="字段") + private String selectKey; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/leaveapply/LeaveApplyForm.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/leaveapply/LeaveApplyForm.java new file mode 100644 index 0000000..b89153a --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/leaveapply/LeaveApplyForm.java @@ -0,0 +1,50 @@ +package com.yunzhupaas.model.leaveapply; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 请假申请 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 8:46 + */ +@Data +public class LeaveApplyForm { + @Schema(description = "相关附件") + private String fileJson; + @Schema(description = "紧急程度") + private Integer flowUrgent; + @Schema(description = "请假天数") + private String leaveDayCount; + @Schema(description = "请假小时") + private String leaveHour; + @Schema(description = "请假时间") + private Long leaveStartTime; + @Schema(description = "申请职位") + private String applyPost; + @Schema(description = "申请人员") + private String applyUser; + @Schema(description = "流程标题") + private String flowTitle; + @Schema(description = "申请部门") + private String applyDept; + @Schema(description = "请假类别") + private String leaveType; + @Schema(description = "请假原因") + private String leaveReason; + @Schema(description = "申请日期") + private Long applyDate; + @Schema(description = "流程主键") + private String flowId; + @Schema(description = "流程单据") + private String billNo; + @Schema(description = "结束时间") + private Long leaveEndTime; + @Schema(description = "提交/保存 0-1") + private String status; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/leaveapply/LeaveApplyInfoVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/leaveapply/LeaveApplyInfoVO.java new file mode 100644 index 0000000..1d5e7d9 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/leaveapply/LeaveApplyInfoVO.java @@ -0,0 +1,50 @@ +package com.yunzhupaas.model.leaveapply; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 请假申请 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 8:46 + */ +@Data +public class LeaveApplyInfoVO { + @Schema(description = "主键id") + private String id; + @Schema(description = "相关附件") + private String fileJson; + @Schema(description = "紧急程度") + private Integer flowUrgent; + @Schema(description = "请假天数") + private String leaveDayCount; + @Schema(description = "请假小时") + private String leaveHour; + @Schema(description = "请假时间") + private Long leaveStartTime; + @Schema(description = "申请职位") + private String applyPost; + @Schema(description = "申请人员") + private String applyUser; + @Schema(description = "流程标题") + private String flowTitle; + @Schema(description = "申请部门") + private String applyDept; + @Schema(description = "请假类别") + private String leaveType; + @Schema(description = "请假原因") + private String leaveReason; + @Schema(description = "申请日期") + private Long applyDate; + @Schema(description = "流程主键") + private String flowId; + @Schema(description = "流程单据") + private String billNo; + @Schema(description = "结束时间") + private Long leaveEndTime; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/OrderCustomerVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/OrderCustomerVO.java new file mode 100644 index 0000000..9c6be99 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/OrderCustomerVO.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.model.order; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 订单信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 8:46 + */ +@Data +public class OrderCustomerVO { + @Schema(description = "主键id") + private String id; + @Schema(description = "编码") + private String code; + @Schema(description = "内容") + private String text; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/OrderEntryListVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/OrderEntryListVO.java new file mode 100644 index 0000000..33c4e68 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/OrderEntryListVO.java @@ -0,0 +1,40 @@ +package com.yunzhupaas.model.order; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 订单信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 8:46 + */ +@Data +public class OrderEntryListVO { + @Schema(description ="自然主键") + private String id; + @Schema(description ="商品名称") + private String goodsName; + @Schema(description ="规格型号") + private String specifications; + @Schema(description ="单位") + private String unit; + @Schema(description ="数量") + private String qty; + @Schema(description ="单价") + private String price; + @Schema(description ="金额") + private String amount; + @Schema(description =" 折扣%") + private String discount; + @Schema(description =" 税率%") + private String cess; + @Schema(description ="实际单价") + private String actualPrice; + @Schema(description ="实际金额") + private String actualAmount; + @Schema(description ="描述") + private String description; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/OrderEntryModel.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/OrderEntryModel.java new file mode 100644 index 0000000..4ffd4b6 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/OrderEntryModel.java @@ -0,0 +1,66 @@ +package com.yunzhupaas.model.order; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; + +/** + * 订单信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 8:46 + */ +@Data +public class OrderEntryModel { + @NotNull(message = "必填") + @Schema(description ="订单日期") + private Long remove; + @NotBlank(message = "必填") + @Schema(description ="自然主键") + private String id; + @NotBlank(message = "必填") + @Schema(description ="商品Id") + private String goodsId; + @NotBlank(message = "必填") + @Schema(description ="商品编码") + private String goodsCode; + @NotBlank(message = "必填") + @Schema(description ="商品名称") + private String goodsName; + @NotBlank(message = "必填") + @Schema(description ="规格型号") + private String specifications; + @NotBlank(message = "必填") + @Schema(description ="单位") + private String unit; + @NotBlank(message = "必填") + @Schema(description ="数量") + private String qty; + @NotBlank(message = "必填") + @Schema(description ="单价") + private String price; + @NotBlank(message = "金额不能为空") + @Schema(description ="金额") + private String amount; + @NotBlank(message = "折扣%不能为空") + @Schema(description =" 折扣%") + private String discount; + @NotBlank(message = "税率%不能为空") + @Schema(description =" 税率%") + private String cess; + @NotBlank(message = "实际单价不能为空") + @Schema(description ="实际单价") + private String actualPrice; + @NotBlank(message = "实际金额不能为空") + @Schema(description ="实际金额") + private String actualAmount; + @Schema(description ="描述") + private String description; + @Schema(description ="角标") + private String index; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/OrderExportModel.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/OrderExportModel.java new file mode 100644 index 0000000..eb2593d --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/OrderExportModel.java @@ -0,0 +1,44 @@ +package com.yunzhupaas.model.order; + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 订单信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 8:46 + */ +@Data +public class OrderExportModel { + private String customerId; + private String customerName; + private String salesmanId; + private String salesmanName; + @JSONField(format = "yyyy-MM-dd HH:mm:ss") + private Date orderDate; + private String orderCode; + private String transportMode; + @JSONField(format = "yyyy-MM-dd HH:mm:ss") + private Date deliveryDate; + private String deliveryAddress; + private String paymentMode; + private BigDecimal receivableMoney; + private BigDecimal earnestRate; + private BigDecimal prepayEarnest; + private String description; + @JSONField(format = "yyyy-MM-dd HH:mm:ss") + private Date creatorTime; + private String creatorUserId; + @JSONField(format = "yyyy-MM-dd HH:mm:ss") + private Date lastModifyTime; + private String lastModifyUserId; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/OrderForm.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/OrderForm.java new file mode 100644 index 0000000..f81c8bc --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/OrderForm.java @@ -0,0 +1,62 @@ +package com.yunzhupaas.model.order; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 订单信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 8:46 + */ +@Data +public class OrderForm { + @Schema(description ="订单日期") + private Long orderDate; + @Schema(description ="订单编号") + private String orderCode; + @Schema(description ="应收金额") + private String receivableMoney; + @Schema(description ="定金比率") + private String earnestRate; + @Schema(description ="预付定金") + private String prepayEarnest; + @Schema(description ="客户名称") + private String customerName; + @Schema(description ="客户Id") + private String customerId; + @Schema(description ="业务员Id") + private String salesmanId; + @Schema(description ="业务员") + private String salesmanName; + @Schema(description ="付款方式") + private String paymentMode; + @Schema(description ="描述") + private String description; + @Schema(description ="运输方式") + private String transportMode; + @Schema(description ="发货日期") + private Long deliveryDate; + @Schema(description ="发货地址") + private String deliveryAddress; + @Schema(description ="附件信息") + private String fileJson; + @Schema(description ="自然主键") + private String id; + @Schema(description ="商品明细") + private List goodsList = new ArrayList<>(); + @Schema(description ="收款计划") + private List collectionPlanList = new ArrayList<>(); + @Schema(description ="状态") + private String status; + @Schema(description ="流程") + private String flowId; +} + + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/OrderGoodsVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/OrderGoodsVO.java new file mode 100644 index 0000000..51cdac0 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/OrderGoodsVO.java @@ -0,0 +1,28 @@ +package com.yunzhupaas.model.order; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 订单信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 8:46 + */ +@Data +public class OrderGoodsVO { + @Schema(description = "主键id") + private String id; + @Schema(description = "编码") + private String code; + @Schema(description = "内容") + private String text; + @Schema(description = "价格") + private String specifications; + @Schema(description = "单位") + private String unit; + @Schema(description = "价格") + private String price; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/OrderInfoOrderEntryModel.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/OrderInfoOrderEntryModel.java new file mode 100644 index 0000000..93c6a6e --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/OrderInfoOrderEntryModel.java @@ -0,0 +1,49 @@ +package com.yunzhupaas.model.order; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 订单信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 8:46 + */ +@Data +public class OrderInfoOrderEntryModel { + @Schema(description ="订单日期") + private String remove; + @Schema(description ="自然主键") + private String id; + @Schema(description ="商品Id") + private String goodsId; + @Schema(description ="商品编码") + private String goodsCode; + @Schema(description ="商品名称") + private String goodsName; + @Schema(description ="规格型号") + private String specifications; + @Schema(description ="单位") + private String unit; + @Schema(description ="数量") + private String qty; + @Schema(description ="单价") + private String price; + @Schema(description ="金额", example = "1") + private int amount; + @Schema(description =" 折扣%", example = "1") + private int discount; + @Schema(description =" 税率%") + private String cess; + @Schema(description ="实际单价") + private String actualPrice; + @Schema(description ="实际金额") + private String actualAmount; + @Schema(description ="描述") + private String description; + @Schema(description ="排序", example = "1") + private int sortCode; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/OrderInfoOrderReceivableModel.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/OrderInfoOrderReceivableModel.java new file mode 100644 index 0000000..d52b315 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/OrderInfoOrderReceivableModel.java @@ -0,0 +1,40 @@ +package com.yunzhupaas.model.order; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 订单信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 8:46 + */ +@Data +public class OrderInfoOrderReceivableModel { + @Schema(description ="自然主键") + private String id; + @Schema(description ="收款日期") + private Long receivableDate; + @Schema(description ="收款比率", example = "1") + private int receivableRate; + @Schema(description ="收款金额") + private String receivableMoney; + @Schema(description ="收款方式") + private String receivableMode; + @Schema(description ="收款摘要") + @JsonProperty("abstract") + private String fabstract; + @Schema(description ="排序", example = "1") + private int sortCode; + @Schema(description ="收款状态") + private String receivableState; + @Schema(description ="订单主键") + private String orderId; + @Schema(description ="描述") + private String description; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/OrderInfoVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/OrderInfoVO.java new file mode 100644 index 0000000..faf8ef8 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/OrderInfoVO.java @@ -0,0 +1,64 @@ +package com.yunzhupaas.model.order; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * 订单信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 8:46 + */ +@Data +public class OrderInfoVO { + @Schema(description ="有效标志", example = "1") + private Integer enabledMark; + @Schema(description ="制单人员") + private String creatorUserId; + @Schema(description ="附件信息") + private String fileJson; + @Schema(description ="付款方式") + private String paymentMode; + @Schema(description ="制单时间") + private Long creatorTime; + @Schema(description ="业务员Id") + private String salesmanId; + @Schema(description ="预付定金") + private String prepayEarnest; + @Schema(description ="运输方式") + private String transportMode; + @Schema(description ="客户名称") + private String customerName; + @Schema(description ="发货日期") + private Long deliveryDate; + @Schema(description ="订单主键") + private String id; + @Schema(description ="业务员") + private String salesmanName; + @Schema(description ="客户Id") + private String customerId; + @Schema(description ="修改时间") + private Long lastModifyTime; + @Schema(description ="应收金额") + private String receivableMoney; + @Schema(description ="发货地址") + private String deliveryAddress; + @Schema(description ="定金比率") + private String earnestRate; + @Schema(description ="描述") + private String description; + @Schema(description ="修改用户") + private String lastModifyUserId; + @Schema(description ="订单日期") + private Long orderDate; + @Schema(description ="订单编号") + private String orderCode; + @Schema(description ="订单明细") + List goodsList; + @Schema(description ="收款计划") + List collectionPlanList; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/OrderListVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/OrderListVO.java new file mode 100644 index 0000000..40364e0 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/OrderListVO.java @@ -0,0 +1,38 @@ +package com.yunzhupaas.model.order; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 订单信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 8:46 + */ +@Data +public class OrderListVO { + @Schema(description ="订单日期") + private Long orderDate; + @Schema(description ="订单编号") + private String orderCode; + @Schema(description ="客户名称") + private String customerName; + @Schema(description ="业务员") + private String salesmanName; + @Schema(description ="描述") + private String description; + @Schema(description ="付款金额") + private String receivableMoney; + @Schema(description ="制单人员") + private String creatorUser; + @Schema(description ="制单人员Id") + private String creatorUserId; + @Schema(description ="主键id") + private String id; + @Schema(description ="当前状态") + private Integer currentState; + @Schema(description ="流程主键") + private String flowId; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/OrderReceivableListVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/OrderReceivableListVO.java new file mode 100644 index 0000000..a84b8d1 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/OrderReceivableListVO.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.model.order; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 订单信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 8:46 + */ +@Data +public class OrderReceivableListVO { + @Schema(description ="自然主键") + private String id; + @Schema(description ="收款日期") + private Long receivableDate; + @Schema(description ="收款比率") + private Integer receivableRate; + @Schema(description ="收款金额") + private String receivableMoney; + @Schema(description ="收款方式") + private String receivableMode; + @Schema(description ="收款摘要") + @JsonProperty("abstract") + private String fabstract; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/OrderReceivableModel.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/OrderReceivableModel.java new file mode 100644 index 0000000..8b98307 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/OrderReceivableModel.java @@ -0,0 +1,46 @@ +package com.yunzhupaas.model.order; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; + +/** + * 订单信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 8:46 + */ +@Data +public class OrderReceivableModel { + @Schema(description ="") + private String remove; + @NotBlank(message = "必填") + @Schema(description ="自然主键") + private String id; + @NotNull(message = "必填") + @Schema(description ="收款日期") + private Long receivableDate; + @NotNull(message = "必填") + @Schema(description ="收款比率") + private int receivableRate; + @NotBlank(message = "必填") + @Schema(description ="收款金额") + private String receivableMoney; + @NotBlank(message = "必填") + @Schema(description ="收款方式") + private String receivableMode; + @Schema(description ="收款摘要") + @JsonProperty("abstract") + private String fabstract; + @Schema(description ="") + private String index; + @Schema(description ="描述") + private String description; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/PaginationOrder.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/PaginationOrder.java new file mode 100644 index 0000000..1aa5fd9 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/order/PaginationOrder.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.model.order; +import com.yunzhupaas.base.PaginationTime; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 订单信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 8:46 + */ +@Data +public class PaginationOrder extends PaginationTime { + @Schema(description ="有效标志") + private String enabledMark; + + @Schema(description ="有效标志") + private String templateId; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/product/ProductCrForm.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/product/ProductCrForm.java new file mode 100644 index 0000000..d6078c4 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/product/ProductCrForm.java @@ -0,0 +1,61 @@ +package com.yunzhupaas.model.product; +import com.yunzhupaas.model.productEntry.ProductEntryInfoVO; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +/** + * + * Product模型 + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021-07-10 10:40:59 + */ +@Data +public class ProductCrForm { + @Schema(description ="订单编号") + private String code; + @Schema(description ="客户Id") + private String customerId; + @Schema(description ="客户名称") + private String customerName; + @Schema(description ="审核人") + private String auditName; + @Schema(description ="审核日期") + private Long auditDate; + @Schema(description ="发货仓库") + private String goodsWarehouse; + @Schema(description ="发货通知时间") + private Long goodsDate; + @Schema(description ="发货通知人") + private String goodsName; + @Schema(description ="收款方式") + private String gatheringType; + @Schema(description ="业务员") + private String business; + @Schema(description ="送货地址") + private String address; + @Schema(description ="联系方式") + private String contactTel; + @Schema(description ="收货消息") + private Integer harvestMsg; + @Schema(description ="收货仓库") + private String harvestWarehouse; + @Schema(description ="代发客户") + private String issuingName; + @Schema(description ="让利金额") + private BigDecimal partPrice; + @Schema(description ="优惠金额") + private BigDecimal reducedPrice; + @Schema(description ="折后金额") + private BigDecimal discountPrice; + @Schema(description ="备注") + private String description; + @Schema(description ="子表数据") + private List productEntryList; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/product/ProductInfoVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/product/ProductInfoVO.java new file mode 100644 index 0000000..a73cf19 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/product/ProductInfoVO.java @@ -0,0 +1,62 @@ +package com.yunzhupaas.model.product; +import com.yunzhupaas.model.productEntry.ProductEntryInfoVO; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +/** + * + * Product模型 + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021-07-10 10:40:59 + */ +@Data +public class ProductInfoVO{ + @Schema(description ="主键") + private String id; + @Schema(description ="订单编号") + private String code; + @Schema(description ="客户id") + private String customerId; + @Schema(description ="客户名称") + private String customerName; + @Schema(description ="审核人") + private String auditName; + @Schema(description ="审核日期") + private Long auditDate; + @Schema(description ="发货仓库") + private String goodsWarehouse; + @Schema(description ="发货通知时间") + private Long goodsDate; + @Schema(description ="发货通知人") + private String goodsName; + @Schema(description ="收款方式") + private String gatheringType; + @Schema(description ="业务员") + private String business; + @Schema(description ="送货地址") + private String address; + @Schema(description ="联系方式") + private String contactTel; + @Schema(description ="收货消息") + private Integer harvestMsg; + @Schema(description ="收货仓库") + private String harvestWarehouse; + @Schema(description ="代发客户") + private String issuingName; + @Schema(description ="让利金额") + private BigDecimal partPrice; + @Schema(description ="优惠金额") + private BigDecimal reducedPrice; + @Schema(description ="折后金额") + private BigDecimal discountPrice; + @Schema(description ="备注") + private String description; + @Schema(description ="子表数据") + private List productEntryList; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/product/ProductListVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/product/ProductListVO.java new file mode 100644 index 0000000..9dcc7e0 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/product/ProductListVO.java @@ -0,0 +1,40 @@ +package com.yunzhupaas.model.product; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * Product模型 + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021-07-10 10:40:59 + */ +@Data +public class ProductListVO{ + @Schema(description ="主键") + private String id; + @Schema(description ="订单编号") + private String code; + @Schema(description ="客户名称") + private String customerName; + @Schema(description ="业务员") + private String business; + @Schema(description ="送货地址") + private String address; + @Schema(description ="联系方式") + private String contactTel; + @Schema(description ="制单人") + private String salesmanName; + @Schema(description ="审核状态") + private Integer auditState; + @Schema(description ="发货状态") + private Integer goodsState; + @Schema(description ="关闭状态") + private Integer closeState; + @Schema(description ="关闭日期") + private Long closeDate; + @Schema(description ="联系人") + private String contactName; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/product/ProductPagination.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/product/ProductPagination.java new file mode 100644 index 0000000..1c93fc4 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/product/ProductPagination.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.model.product; +import com.yunzhupaas.base.Pagination; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * Product模型 + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021-07-10 10:40:59 + */ +@Data +public class ProductPagination extends Pagination { + @Schema(description ="订单编号") + private String code; + @Schema(description ="客户名称") + private String customerName; + @Schema(description ="联系方式") + private String contactTel; + + + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/product/ProductUpForm.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/product/ProductUpForm.java new file mode 100644 index 0000000..b4aafd9 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/product/ProductUpForm.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.model.product; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * Product模型 + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021-07-10 10:40:59 + */ +@Data +public class ProductUpForm extends ProductCrForm { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productEntry/ProductEntryInfoVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productEntry/ProductEntryInfoVO.java new file mode 100644 index 0000000..42a024f --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productEntry/ProductEntryInfoVO.java @@ -0,0 +1,34 @@ +package com.yunzhupaas.model.productEntry; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * Product模型 + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021-07-10 10:40:59 + */ +@Data +public class ProductEntryInfoVO { + @Schema(description ="产品编号") + private String productCode; + @Schema(description ="产品名称") + private String productName; + @Schema(description ="产品规格") + private String productSpecification; + @Schema(description ="数量") + private Long qty; + @Schema(description ="订货类型") + private String type; + @Schema(description ="单价") + private String money; + @Schema(description ="折后单价") + private String price; + @Schema(description ="金额") + private String amount; + @Schema(description ="备注") + private String description; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productEntry/ProductEntryListVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productEntry/ProductEntryListVO.java new file mode 100644 index 0000000..9e9869b --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productEntry/ProductEntryListVO.java @@ -0,0 +1,30 @@ +package com.yunzhupaas.model.productEntry; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * Product模型 + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021-07-10 10:40:59 + */ +@Data +public class ProductEntryListVO { + @Schema(description ="产品编号") + private String productCode; + @Schema(description ="产品名称") + private String productName; + @Schema(description ="数量") + private Long qty; + @Schema(description ="订货类型") + private String type; + @Schema(description ="活动") + private String activity; + @Schema(description ="数据") + private List dataList; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productEntry/ProductEntryMdoel.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productEntry/ProductEntryMdoel.java new file mode 100644 index 0000000..148d590 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productEntry/ProductEntryMdoel.java @@ -0,0 +1,28 @@ +package com.yunzhupaas.model.productEntry; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * Product模型 + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021-07-10 10:40:59 + */ +@Data +public class ProductEntryMdoel { + @Schema(description ="产品规格") + private String productSpecification; + @Schema(description ="数量") + private String qty; + @Schema(description ="单价") + private String money; + @Schema(description ="折后单价") + private String price; + @Schema(description ="单位") + private String util; + @Schema(description ="控制方式") + private String commandType; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productclassify/ProductclassifyCrForm.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productclassify/ProductclassifyCrForm.java new file mode 100644 index 0000000..8be4a1f --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productclassify/ProductclassifyCrForm.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.model.productclassify; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 产品分类 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021-07-10 14:34:04 + */ +@Data +public class ProductclassifyCrForm { + @Schema(description ="名称") + private String fullName; + @Schema(description ="上级") + private String parentId; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productclassify/ProductclassifyInfoVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productclassify/ProductclassifyInfoVO.java new file mode 100644 index 0000000..9706610 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productclassify/ProductclassifyInfoVO.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.model.productclassify; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * 产品分类 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021-07-10 14:34:04 + */ +@Data +public class ProductclassifyInfoVO{ + @Schema(description ="主键") + private String id; + @Schema(description ="名称") + private String fullName; + @Schema(description ="上级") + private String parentId; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productclassify/ProductclassifyListVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productclassify/ProductclassifyListVO.java new file mode 100644 index 0000000..b8164f4 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productclassify/ProductclassifyListVO.java @@ -0,0 +1,28 @@ +package com.yunzhupaas.model.productclassify; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * 产品分类 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021-07-10 14:34:04 + */ +@Data +public class ProductclassifyListVO{ + @Schema(description ="主键") + private String id; + @Schema(description ="名称") + private String fullName; + @Schema(description ="是否子节点") + private String hasChildren; + @Schema(description ="子节点") + private List children; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productclassify/ProductclassifyModel.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productclassify/ProductclassifyModel.java new file mode 100644 index 0000000..a46125c --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productclassify/ProductclassifyModel.java @@ -0,0 +1,23 @@ +package com.yunzhupaas.model.productclassify; + +import com.yunzhupaas.util.treeutil.SumTree; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * 产品分类 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021-07-10 14:34:04 + */ +@Data +public class ProductclassifyModel extends SumTree { + + /** 名称 */ + private String fullName; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productclassify/ProductclassifyUpForm.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productclassify/ProductclassifyUpForm.java new file mode 100644 index 0000000..0132e8d --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productclassify/ProductclassifyUpForm.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.model.productclassify; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * 产品分类 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021-07-10 14:34:04 + */ +@Data +public class ProductclassifyUpForm extends ProductclassifyCrForm { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productgoods/ProductGoodsCrForm.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productgoods/ProductGoodsCrForm.java new file mode 100644 index 0000000..206ba01 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productgoods/ProductGoodsCrForm.java @@ -0,0 +1,30 @@ +package com.yunzhupaas.model.productgoods; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * 产品商品 + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021-07-10 15:57:50 + */ +@Data +public class ProductGoodsCrForm { + @Schema(description ="分类主键") + private String classifyId; + @Schema(description ="产品编号") + private String code; + @Schema(description ="产品名称") + private String fullName; + @Schema(description ="产品规格") + private String productSpecification; + @Schema(description ="单价") + private String money; + @Schema(description ="金额") + private String amount; + @Schema(description ="库存数") + private String qty; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productgoods/ProductGoodsInfoVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productgoods/ProductGoodsInfoVO.java new file mode 100644 index 0000000..1f28b4b --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productgoods/ProductGoodsInfoVO.java @@ -0,0 +1,33 @@ +package com.yunzhupaas.model.productgoods; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * 产品商品 + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021-07-10 15:57:50 + */ +@Data +public class ProductGoodsInfoVO{ + @Schema(description ="主键") + private String id; + @Schema(description ="分类主键") + private String classifyId; + @Schema(description ="产品编号") + private String code; + @Schema(description ="产品名称") + private String fullName; + @Schema(description ="产品规格") + private String productSpecification; + @Schema(description ="单价") + private String money; + @Schema(description ="金额") + private String amount; + @Schema(description ="库存数") + private String qty; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productgoods/ProductGoodsListVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productgoods/ProductGoodsListVO.java new file mode 100644 index 0000000..98db46c --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productgoods/ProductGoodsListVO.java @@ -0,0 +1,34 @@ +package com.yunzhupaas.model.productgoods; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * 产品商品 + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021-07-10 15:57:50 + */ +@Data +public class ProductGoodsListVO{ + @Schema(description ="主键") + private String id; + @Schema(description ="分类主键") + private String classifyId; + @Schema(description ="产品编号") + private String code; + @Schema(description ="产品名称") + private String fullName; + @Schema(description ="产品规格") + private String productSpecification; + @Schema(description ="单价") + private String money; + @Schema(description ="金额") + private String amount; + @Schema(description ="库存数") + private String qty; + @Schema(description ="订货分类") + private String type; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productgoods/ProductGoodsPagination.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productgoods/ProductGoodsPagination.java new file mode 100644 index 0000000..3a70af9 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productgoods/ProductGoodsPagination.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.model.productgoods; +import com.yunzhupaas.base.Pagination; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * 产品商品 + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021-07-10 15:57:50 + */ +@Data +public class ProductGoodsPagination extends Pagination { + @Schema(description ="分类主键") + private String classifyId; + @Schema(description ="产品编号") + private String code; + @Schema(description ="产品名称") + private String fullName; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productgoods/ProductGoodsUpForm.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productgoods/ProductGoodsUpForm.java new file mode 100644 index 0000000..fe07797 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/productgoods/ProductGoodsUpForm.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.model.productgoods; +import lombok.Data; + +/** + * + * 产品商品 + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021-07-10 15:57:50 + */ +@Data +public class ProductGoodsUpForm extends ProductGoodsCrForm { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/projectgantt/ProjectGanttCrForm.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/projectgantt/ProjectGanttCrForm.java new file mode 100644 index 0000000..e5e04a2 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/projectgantt/ProjectGanttCrForm.java @@ -0,0 +1,47 @@ +package com.yunzhupaas.model.projectgantt; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.hibernate.validator.constraints.NotBlank; + +import jakarta.validation.constraints.NotNull; +import java.math.BigDecimal; + +@Data +public class ProjectGanttCrForm { + + @NotNull(message = "必填") + @Schema(description ="完成进度") + private Integer schedule; + + @NotBlank(message = "必填") + @Schema(description ="项目名称") + private String fullName; + + @NotBlank(message = "必填") + @Schema(description ="项目编码") + private String enCode; + + @NotBlank(message = "必填") + @Schema(description ="参与人员") + private String managerIds; + + @NotNull(message = "必填") + @Schema(description ="开始时间") + private long startTime; + + @NotNull(message = "必填") + @Schema(description ="结束时间") + private long endTime; + + @NotNull(message = "必填") + @Schema(description ="项目工期") + private BigDecimal timeLimit; + + @Schema(description ="项目描述") + private String description; + + @Schema(description ="项目状态") + private Integer state; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/projectgantt/ProjectGanttInfoVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/projectgantt/ProjectGanttInfoVO.java new file mode 100644 index 0000000..d72808e --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/projectgantt/ProjectGanttInfoVO.java @@ -0,0 +1,30 @@ +package com.yunzhupaas.model.projectgantt; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ProjectGanttInfoVO { + @Schema(description ="父级id") + private String parentId; + @Schema(description ="项目编码") + private String enCode; + @Schema(description ="开始时间") + private long startTime; + @Schema(description ="完成进度") + private String schedule; + @Schema(description ="项目工期") + private String timeLimit; + @Schema(description ="项目名称") + private String fullName; + @Schema(description ="主键id") + private String id; + @Schema(description ="结束时间") + private long endTime; + @Schema(description ="参与人员") + private String managerIds; + @Schema(description ="项目描述") + private String description; + @Schema(description ="状态") + private Integer state; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/projectgantt/ProjectGanttListVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/projectgantt/ProjectGanttListVO.java new file mode 100644 index 0000000..54ba5d8 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/projectgantt/ProjectGanttListVO.java @@ -0,0 +1,30 @@ +package com.yunzhupaas.model.projectgantt; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +@Data +public class ProjectGanttListVO { + @Schema(description ="主键id") + private String id; + @Schema(description ="项目编码") + private String enCode; + @Schema(description ="项目名称") + private String fullName; + @Schema(description ="项目工期") + private String timeLimit; + @Schema(description ="开始时间") + private long startTime; + @Schema(description ="结束时间") + private long endTime; + private Integer schedule; + @Schema(description ="参与人员") + private String managerIds; + @Schema(description ="状态") + private Integer state; + @Schema(description ="详情") + private List managersInfo; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/projectgantt/ProjectGanttManagerIModel.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/projectgantt/ProjectGanttManagerIModel.java new file mode 100644 index 0000000..2d327a4 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/projectgantt/ProjectGanttManagerIModel.java @@ -0,0 +1,12 @@ +package com.yunzhupaas.model.projectgantt; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ProjectGanttManagerIModel { + @Schema(description ="账号+名字") + private String account; + @Schema(description ="用户头像") + private String headIcon; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/projectgantt/ProjectGanttTaskInfoVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/projectgantt/ProjectGanttTaskInfoVO.java new file mode 100644 index 0000000..60eb749 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/projectgantt/ProjectGanttTaskInfoVO.java @@ -0,0 +1,32 @@ +package com.yunzhupaas.model.projectgantt; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ProjectGanttTaskInfoVO { + @Schema(description ="开始时间") + private long startTime; + @Schema(description ="完成进度") + private String schedule; + @Schema(description ="项目工期") + private String timeLimit; + @Schema(description ="项目名称") + private String fullName; + @Schema(description ="父级id") + private String parentId; + @Schema(description ="主键id") + private String id; + @Schema(description ="结束时间") + private long endTime; + @Schema(description ="参与人员") + private String managerIds; + @Schema(description ="项目描述") + private String description; + @Schema(description ="项目主键") + private String projectId; + @Schema(description ="标记颜色") + private String signColor; + @Schema(description ="标记") + private String sign; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/projectgantt/ProjectGanttTaskTreeModel.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/projectgantt/ProjectGanttTaskTreeModel.java new file mode 100644 index 0000000..625e1cf --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/projectgantt/ProjectGanttTaskTreeModel.java @@ -0,0 +1,11 @@ +package com.yunzhupaas.model.projectgantt; + +import com.yunzhupaas.util.treeutil.SumTree; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ProjectGanttTaskTreeModel extends SumTree { + private String fullName; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/projectgantt/ProjectGanttTaskTreeVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/projectgantt/ProjectGanttTaskTreeVO.java new file mode 100644 index 0000000..c2cb070 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/projectgantt/ProjectGanttTaskTreeVO.java @@ -0,0 +1,32 @@ +package com.yunzhupaas.model.projectgantt; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +@Data +public class ProjectGanttTaskTreeVO { + @Schema(description ="主键") + private String id; + @Schema(description ="父级主键") + private String parentId; + @Schema(description ="是否有子集") + private Boolean hasChildren; + @Schema(description ="名称") + private String fullName; + @Schema(description ="完成进度") + private Integer schedule; + @Schema(description ="项目主键") + private String projectId; + @Schema(description ="开始时间") + private long startTime; + @Schema(description ="结束时间") + private long endTime; + @Schema(description ="标记颜色") + private String signColor; + @Schema(description ="标记") + private String sign; + @Schema(description ="开始时间") + private List children; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/projectgantt/ProjectGanttTreeModel.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/projectgantt/ProjectGanttTreeModel.java new file mode 100644 index 0000000..956e807 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/projectgantt/ProjectGanttTreeModel.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.model.projectgantt; + +import com.yunzhupaas.util.treeutil.SumTree; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ProjectGanttTreeModel extends SumTree { + + private Integer schedule; + + private String fullName; + + private long startTime; + + private long endTime; + + private String signColor; + private String sign; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/projectgantt/ProjectGanttTreeVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/projectgantt/ProjectGanttTreeVO.java new file mode 100644 index 0000000..ad708bc --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/projectgantt/ProjectGanttTreeVO.java @@ -0,0 +1,30 @@ +package com.yunzhupaas.model.projectgantt; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +@Data +public class ProjectGanttTreeVO { + @Schema(description ="主键") + private String id; + @Schema(description ="父级主键") + private String parentId; + @Schema(description ="名称") + private String fullName; + @Schema(description ="开始时间") + private String startTime; + @Schema(description ="结束时间") + private String endTime; + @Schema(description ="标记") + private String sign; + @Schema(description ="标记颜色") + private String signColor; + @Schema(description ="完成进度") + private String schedule; + @Schema(description ="是否有子集") + private Boolean hasChildren; + @Schema(description ="开始时间") + private List children; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/projectgantt/ProjectGanttTsakCrForm.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/projectgantt/ProjectGanttTsakCrForm.java new file mode 100644 index 0000000..54e8941 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/projectgantt/ProjectGanttTsakCrForm.java @@ -0,0 +1,47 @@ +package com.yunzhupaas.model.projectgantt; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.hibernate.validator.constraints.NotBlank; + +import jakarta.validation.constraints.NotNull; +import java.math.BigDecimal; + +@Data +public class ProjectGanttTsakCrForm { + @NotBlank(message = "必填") + @Schema(description ="父级Id") + private String parentId; + private String projectId; + + @NotNull(message = "必填") + @Schema(description ="完成进度") + private Integer schedule; + + @NotBlank(message = "必填") + @Schema(description ="项目名称") + private String fullName; + + @NotBlank(message = "必填") + @Schema(description ="参与人员") + private String managerIds; + + @NotNull(message = "必填") + @Schema(description ="开始时间") + private long startTime; + + @NotNull(message = "必填") + @Schema(description ="结束时间") + private long endTime; + + @NotNull(message = "必填") + @Schema(description ="项目工期") + private BigDecimal timeLimit; + + @Schema(description ="项目描述") + private String description; + @Schema(description ="标记颜色") + private String signColor; + @Schema(description ="标记") + private String sign; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/projectgantt/ProjectGanttTsakUpForm.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/projectgantt/ProjectGanttTsakUpForm.java new file mode 100644 index 0000000..8cb40e6 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/projectgantt/ProjectGanttTsakUpForm.java @@ -0,0 +1,9 @@ +package com.yunzhupaas.model.projectgantt; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ProjectGanttTsakUpForm extends ProjectGanttTsakCrForm{ + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/projectgantt/ProjectGanttUpForm.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/projectgantt/ProjectGanttUpForm.java new file mode 100644 index 0000000..78756e7 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/projectgantt/ProjectGanttUpForm.java @@ -0,0 +1,10 @@ +package com.yunzhupaas.model.projectgantt; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +@Data +public class ProjectGanttUpForm extends ProjectGanttCrForm { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/salesorder/SalesOrderEntryEntityInfoModel.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/salesorder/SalesOrderEntryEntityInfoModel.java new file mode 100644 index 0000000..2235f18 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/salesorder/SalesOrderEntryEntityInfoModel.java @@ -0,0 +1,39 @@ +package com.yunzhupaas.model.salesorder; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 销售订单 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 8:46 + */ +@Data +public class SalesOrderEntryEntityInfoModel { + @Schema(description = "发货明细主键") + private String id; + @Schema(description = "订单主键") + private String salesOrderId; + @Schema(description = "商品名称") + private String goodsName; + @Schema(description = "规格型号") + private String specifications; + @Schema(description = "单位") + private String unit; + @Schema(description = "数量") + private BigDecimal qty; + @Schema(description = "单价") + private BigDecimal price; + @Schema(description = "金额") + private BigDecimal amount; + @Schema(description = "描述") + private String description; + @Schema(description = "排序码") + private Long sortCode; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/salesorder/SalesOrderForm.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/salesorder/SalesOrderForm.java new file mode 100644 index 0000000..056ad9f --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/salesorder/SalesOrderForm.java @@ -0,0 +1,60 @@ +package com.yunzhupaas.model.salesorder; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +/** + * 销售订单 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 8:46 + */ +@Data +public class SalesOrderForm { + @Schema(description = "流程主键") + private String flowId; + @Schema(description = "流程标题") + private String flowTitle; + @Schema(description = "流程等级") + private Integer flowUrgent; + @Schema(description = "流程单据") + private String billNo; + @Schema(description = "业务人员") + private String salesman; + @Schema(description = "客户名称") + private String customerName; + @Schema(description = "联系人") + private String contacts; + @Schema(description = "联系电话") + private String contactPhone; + @Schema(description = "客户地址") + private String customerAddres; + @Schema(description = "发票编码") + private String ticketNum; + @Schema(description = "开票日期") + private Long ticketDate; + @Schema(description = "发票类型") + private String invoiceType; + @Schema(description = "付款方式") + private String paymentMethod; + @Schema(description = "付款金额") + private BigDecimal paymentMoney; + @Schema(description = "销售日期") + private Long salesDate; + @Schema(description = "相关附件") + private String fileJson; + @Schema(description = "描述") + private String description; + @Schema(description = "提交/保存 0-1") + private String status; + @Schema(description = "明细") + private List entryList = new ArrayList<>(); + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/salesorder/SalesOrderInfoVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/salesorder/SalesOrderInfoVO.java new file mode 100644 index 0000000..e010d56 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/salesorder/SalesOrderInfoVO.java @@ -0,0 +1,66 @@ +package com.yunzhupaas.model.salesorder; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import java.math.BigDecimal; +import java.util.List; + +/** + * 销售订单 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 8:46 + */ +@Data +public class SalesOrderInfoVO { + @Schema(description = "明细") + List entryList; + @Schema(description = "主键") + private String id; + @NotBlank(message = "流程主键不能为空") + @Schema(description = "流程主键") + private String flowId; + @NotBlank(message = "流程标题不能为空") + @Schema(description = "流程标题") + private String flowTitle; + @NotNull(message = "流程等级不能为空") + @Schema(description = "流程等级") + private Integer flowUrgent; + @NotBlank(message = "流程单据不能为空") + @Schema(description = "流程单据") + private String billNo; + @Schema(description = "业务人员") + private String salesman; + @NotBlank(message = "客户名称不能为空") + @Schema(description = "客户名称") + private String customerName; + @Schema(description = "联系人") + private String contacts; + @Schema(description = "联系电话") + private String contactPhone; + @Schema(description = "客户地址") + private String customerAddres; + @Schema(description = "发票编码") + private String ticketNum; + @NotBlank(message = "开票日期不能为空") + @Schema(description = "开票日期") + private Long ticketDate; + @Schema(description = "发票类型") + private String invoiceType; + @Schema(description = "付款方式") + private String paymentMethod; + @Schema(description = "付款金额") + private BigDecimal paymentMoney; + @Schema(description = "销售日期") + private Long salesDate; + @Schema(description = "相关附件") + private String fileJson; + @Schema(description = "描述") + private String description; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/schedule/ScheduleCrForm.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/schedule/ScheduleCrForm.java new file mode 100644 index 0000000..0be9c26 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/schedule/ScheduleCrForm.java @@ -0,0 +1,34 @@ +package com.yunzhupaas.model.schedule; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.hibernate.validator.constraints.NotBlank; + +import jakarta.validation.constraints.NotNull; + +@Data +public class ScheduleCrForm { + @Schema(description ="开始时间") + private long startTime; + @NotNull(message = "必填") + @Schema(description ="结束时间") + private long endTime; + @NotBlank(message = "必填") + @Schema(description ="日程内容") + private String content; + @Schema(description ="提醒设置") + private Integer early; + @Schema(description ="APP提醒(1-提醒,0-不提醒)") + private Integer appAlert; + @Schema(description ="日程颜色") + private String colour; + @Schema(description ="颜色样式") + private String colourCss; + @Schema(description ="微信提醒(1-提醒,0-不提醒)") + private Integer weChatAlert; + @Schema(description ="邮件提醒(1-提醒,0-不提醒)") + private Integer mailAlert; + @Schema(description ="短信提醒(1-提醒,0-不提醒)") + private Integer mobileAlert; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/schedule/ScheduleInfoVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/schedule/ScheduleInfoVO.java new file mode 100644 index 0000000..6fe7d3f --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/schedule/ScheduleInfoVO.java @@ -0,0 +1,30 @@ +package com.yunzhupaas.model.schedule; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ScheduleInfoVO { + @Schema(description ="日程主键") + private String id; + @Schema(description ="开始时间(时间戳)") + private long startTime; + @Schema(description ="结束时间(时间戳)") + private long endTime; + @Schema(description ="日程内容") + private String content; + @Schema(description ="提醒设置",example = "1") + private Integer early; + @Schema(description ="APP提醒(1-提醒,0-不提醒)",example = "1") + private Integer appAlert; + @Schema(description ="日程颜色") + private String colour; + @Schema(description ="颜色样式") + private String colourCss; + @Schema(description ="微信提醒(1-提醒,0-不提醒)",example = "1") + private Integer weChatAlert; + @Schema(description ="邮件提醒(1-提醒,0-不提醒)",example = "1") + private Integer mailAlert; + @Schema(description ="短信提醒(1-提醒,0-不提醒)",example = "1") + private Integer mobileAlert; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/schedule/ScheduleListVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/schedule/ScheduleListVO.java new file mode 100644 index 0000000..5b5130c --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/schedule/ScheduleListVO.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.model.schedule; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ScheduleListVO{ + @Schema(description ="日程主键") + private String id; + @Schema(description ="开始时间") + private long startTime; + @Schema(description ="开始时间") + private long endTime; + @Schema(description ="颜色") + private String colour; + @Schema(description ="日程内容") + private String content; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/schedule/ScheduleTime.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/schedule/ScheduleTime.java new file mode 100644 index 0000000..58f6fa7 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/schedule/ScheduleTime.java @@ -0,0 +1,12 @@ +package com.yunzhupaas.model.schedule; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ScheduleTime { + @Schema(description ="开始时间") + private String startTime; + @Schema(description ="结束时间") + private String endTime; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/schedule/ScheduleTimes.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/schedule/ScheduleTimes.java new file mode 100644 index 0000000..0d586df --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/schedule/ScheduleTimes.java @@ -0,0 +1,10 @@ +package com.yunzhupaas.model.schedule; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ScheduleTimes extends ScheduleTime { + @Schema(description ="日期") + private String dateTime; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/schedule/ScheduleUpForm.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/schedule/ScheduleUpForm.java new file mode 100644 index 0000000..1736791 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/schedule/ScheduleUpForm.java @@ -0,0 +1,9 @@ +package com.yunzhupaas.model.schedule; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +@Data +public class ScheduleUpForm extends ScheduleCrForm{ +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/PaginationTableExample.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/PaginationTableExample.java new file mode 100644 index 0000000..2df6dab --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/PaginationTableExample.java @@ -0,0 +1,11 @@ +package com.yunzhupaas.model.tableexample; +import com.yunzhupaas.base.PaginationTime; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class PaginationTableExample extends PaginationTime { + @Schema(description ="标签") + private String F_Sign; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/TableExampleCityListVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/TableExampleCityListVO.java new file mode 100644 index 0000000..566e996 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/TableExampleCityListVO.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.model.tableexample; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class TableExampleCityListVO { + @Schema(description ="父级主键") + private String id; + @Schema(description ="名称") + private String fullName; + @Schema(description ="图标") + private String enCode; + @Schema(description ="父级主键") + private String parentId; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/TableExampleCrForm.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/TableExampleCrForm.java new file mode 100644 index 0000000..0dc2cf3 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/TableExampleCrForm.java @@ -0,0 +1,49 @@ +package com.yunzhupaas.model.tableexample; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.hibernate.validator.constraints.NotBlank; + +@Data +public class TableExampleCrForm { + @NotBlank(message = "必填") + @Schema(description ="负责人") + private String principal; + + @Schema(description ="交互日期") + private long interactionDate; + + @Schema(description ="立顶人") + private String jackStands; + + @NotBlank(message = "必填") + @Schema(description ="项目编码") + private String projectCode; + + @Schema(description ="项目阶段") + private String projectPhase; + + @Schema(description ="已用金额",example = "1") + private Long tunesAmount; + + @NotBlank(message = "必填") + @Schema(description ="项目类型") + private String projectType; + + @Schema(description ="费用金额",example = "1") + private Long costAmount; + + @Schema(description ="预计收入",example = "1") + private Long projectedIncome; + + @Schema(description ="备注") + private String description; + + @NotBlank(message = "必填") + @Schema(description ="项目名称") + private String projectName; + + @Schema(description ="客户名称") + private String customerName; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/TableExampleIndustryListVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/TableExampleIndustryListVO.java new file mode 100644 index 0000000..95657b4 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/TableExampleIndustryListVO.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.model.tableexample; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class TableExampleIndustryListVO { + @Schema(description ="父级主键") + private String id; + @Schema(description ="名称") + private String fullName; + @Schema(description ="图标") + private String enCode; + @Schema(description ="是否有下级菜单") + private Boolean isLeaf; + @Schema(description ="父级主键") + private String parentId; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/TableExampleInfoVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/TableExampleInfoVO.java new file mode 100644 index 0000000..5a1dc77 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/TableExampleInfoVO.java @@ -0,0 +1,10 @@ +package com.yunzhupaas.model.tableexample; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class TableExampleInfoVO extends TableExampleCrForm { + @Schema(description ="主键") + private String id; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/TableExampleListAllVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/TableExampleListAllVO.java new file mode 100644 index 0000000..7941bb0 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/TableExampleListAllVO.java @@ -0,0 +1,52 @@ +package com.yunzhupaas.model.tableexample; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class TableExampleListAllVO { + @Schema(description ="主键") + private String id; + + @Schema(description ="项目名称") + private String projectName; + + @Schema(description ="项目编码") + private String projectCode; + + @Schema(description ="项目类型") + private String projectType; + + @Schema(description ="项目阶段") + private String projectPhase; + + @Schema(description ="客户名称") + private String customerName; + + @Schema(description ="负责人") + private String principal; + + @Schema(description ="立顶人") + private String jackStands; + + @Schema(description ="交付日期") + private long interactionDate; + + @Schema(description ="费用金额", example = "1") + private Long costAmount; + + @Schema(description ="已用金额", example = "1") + private Long tunesAmount; + + @Schema(description ="预计收入", example = "1") + private Long projectedIncome; + + @Schema(description ="登记人") + private String registrant; + @Schema(description ="登记日期") + private long registerDate; + + @Schema(description ="备注") + private String description; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/TableExampleListDTO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/TableExampleListDTO.java new file mode 100644 index 0000000..a28deed --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/TableExampleListDTO.java @@ -0,0 +1,82 @@ +package com.yunzhupaas.model.tableexample; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +@Data +public class TableExampleListDTO { + + @Schema(description ="负责人") + private String principal; + + @Schema(description ="交互日期") + private Date interactionDate; + + @Schema(description ="立顶人") + private String jackStands; + + @Schema(description ="项目编码") + private String projectCode; + + @Schema(description ="项目阶段") + private String projectPhase; + + @Schema(description ="已用金额") + private Long tunesAmount; + + @Schema(description ="项目类型") + private String projectType; + + @Schema(description ="费用金额") + private Long costAmount; + + @Schema(description ="预计收入") + private Long projectedIncome; + + @Schema(description ="备注") + private String description; + + @Schema(description ="项目名称") + private String projectName; + + @Schema(description ="客户名称") + private String customerName; + + + + + @Schema(description ="批注总数") + private String postilCount; + + @Schema(description ="批注列表Json") + private String postilJson; + + @Schema(description ="编辑时间") + private Date lastModifyTime; + + @Schema(description ="编辑用户") + private String lastModifyUserId; + + + + @Schema(description ="标记") + private String sign; + + @Schema(description ="登记人") + private String registrant; + + @Schema(description ="登记时间") + private Date registerDate; + + @Schema(description ="自然主键") + private String id; + + @Schema(description ="排序码") + private String sortCode; + + @Schema(description ="有效标志") + private Integer enabledMark; + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/TableExampleListVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/TableExampleListVO.java new file mode 100644 index 0000000..c63934c --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/TableExampleListVO.java @@ -0,0 +1,58 @@ +package com.yunzhupaas.model.tableexample; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +@Data +public class TableExampleListVO { + @Schema(description ="主键") + private String id; + + @Schema(description ="项目名称") + private String projectName; + + @Schema(description ="项目编码") + private String projectCode; + + @Schema(description ="项目类型") + private String projectType; + + @Schema(description ="项目阶段") + private String projectPhase; + + @Schema(description ="客户名称") + private String customerName; + + @Schema(description ="负责人") + private String principal; + + @Schema(description ="立顶人") + private String jackStands; + + @Schema(description ="交付日期") + private long interactionDate; + + @Schema(description ="费用金额",example = "1") + private Long costAmount; + + @Schema(description ="已用金额",example = "1") + private Long tunesAmount; + + @Schema(description ="预计收入",example = "1") + private Long projectedIncome; + + @Schema(description ="登记人") + private String registrant; + @Schema(description ="登记人") + private long registerDate; + + @Schema(description ="备注") + private String description; + + @Schema(description ="批注") + private String postilJson; + @Schema(description ="标记") + private String sign; + private String postilCount; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/TableExampleRowUpForm.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/TableExampleRowUpForm.java new file mode 100644 index 0000000..893347e --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/TableExampleRowUpForm.java @@ -0,0 +1,55 @@ +package com.yunzhupaas.model.tableexample; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.hibernate.validator.constraints.NotBlank; + +import java.math.BigDecimal; + +/** + * 行编辑 + */ +@Data +public class TableExampleRowUpForm { + @NotBlank(message = "必填") + @Schema(description ="项目名称") + private String projectName; + + @NotBlank(message = "必填") + @Schema(description ="项目编码") + private String projectCode; + + @NotBlank(message = "必填") + @Schema(description ="项目类型") + private String projectType; + + @Schema(description ="项目阶段") + private String projectPhase; + + @Schema(description ="交互日期") + private long interactionDate; + + @Schema(description ="客户名称") + private String customerName; + + @NotBlank(message = "必填") + @Schema(description ="负责人") + private String principal; + + @Schema(description ="立顶人") + private String jackStands; + + @Schema(description ="费用金额",example = "1") + private BigDecimal costAmount; + + @Schema(description ="已用金额",example = "1") + private BigDecimal tunesAmount; + + @Schema(description ="预计收入",example = "1") + private BigDecimal projectedIncome; + + @Schema(description ="备注") + private String description; + + private String oper; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/TableExampleSignUpForm.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/TableExampleSignUpForm.java new file mode 100644 index 0000000..be4acb9 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/TableExampleSignUpForm.java @@ -0,0 +1,15 @@ +package com.yunzhupaas.model.tableexample; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.hibernate.validator.constraints.NotBlank; + +/** + * 更新标签 + */ +@Data +public class TableExampleSignUpForm { + @NotBlank(message = "必填") + @Schema(description ="项目标记") + private String sign; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/TableExampleTreeModel.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/TableExampleTreeModel.java new file mode 100644 index 0000000..735145c --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/TableExampleTreeModel.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.model.tableexample; + +import com.yunzhupaas.util.treeutil.SumTree; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Map; + +@Data +public class TableExampleTreeModel extends SumTree { + private Boolean loaded; + private Boolean expanded; + private Map ht; + private String text; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/TableExampleUpForm.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/TableExampleUpForm.java new file mode 100644 index 0000000..3fd59f1 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/TableExampleUpForm.java @@ -0,0 +1,9 @@ +package com.yunzhupaas.model.tableexample; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class TableExampleUpForm extends TableExampleCrForm { + +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/postil/PostilInfoVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/postil/PostilInfoVO.java new file mode 100644 index 0000000..1dca323 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/postil/PostilInfoVO.java @@ -0,0 +1,11 @@ +package com.yunzhupaas.model.tableexample.postil; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.checkerframework.checker.units.qual.A; + +@Data +public class PostilInfoVO { + @Schema(description ="批注列表Json") + private String postilJson; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/postil/PostilModel.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/postil/PostilModel.java new file mode 100644 index 0000000..efc8a9b --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/postil/PostilModel.java @@ -0,0 +1,11 @@ +package com.yunzhupaas.model.tableexample.postil; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class PostilModel { + private String userId; + private String text; + private String creatorTime; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/postil/PostilSendForm.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/postil/PostilSendForm.java new file mode 100644 index 0000000..c6a7a70 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/tableexample/postil/PostilSendForm.java @@ -0,0 +1,10 @@ +package com.yunzhupaas.model.tableexample.postil; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class PostilSendForm { + @Schema(description ="内容") + private String text; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/worklog/WorkLogCrForm.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/worklog/WorkLogCrForm.java new file mode 100644 index 0000000..e87e515 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/worklog/WorkLogCrForm.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.model.worklog; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.hibernate.validator.constraints.NotBlank; + + +@Data +public class WorkLogCrForm { + @NotBlank(message = "必填") + @Schema(description ="标题") + private String title; + @NotBlank(message = "必填") + @Schema(description ="内容") + private String question; + @NotBlank(message = "必填") + @Schema(description ="内容") + private String todayContent; + @NotBlank(message = "必填") + @Schema(description ="内容") + private String tomorrowContent; + @NotBlank(message = "必填") + @Schema(description ="用户id") + private String toUserId; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/worklog/WorkLogInfoVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/worklog/WorkLogInfoVO.java new file mode 100644 index 0000000..2d74f8b --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/worklog/WorkLogInfoVO.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.model.worklog; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class WorkLogInfoVO { + @Schema(description ="主键") + private String id; + @Schema(description ="标题") + private String title; + @Schema(description ="内容") + private String question; + @Schema(description ="创建时间") + private long creatorTime; + @Schema(description ="内容") + private String todayContent; + @Schema(description ="内容") + private String tomorrowContent; + @Schema(description ="用户主键") + private String toUserId; + @Schema(description ="用户主键") + private String userIds; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/worklog/WorkLogListVO.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/worklog/WorkLogListVO.java new file mode 100644 index 0000000..e8c6d80 --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/worklog/WorkLogListVO.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.model.worklog; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class WorkLogListVO { + @Schema(description ="主键") + private String id; + @Schema(description ="标题") + private String title; + @Schema(description ="内容") + private String question; + @Schema(description ="创建时间") + private long creatorTime; + @Schema(description ="内容") + private String todayContent; + @Schema(description ="内容") + private String tomorrowContent; + @Schema(description ="用户主键") + private String toUserId; +} + diff --git a/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/worklog/WorkLogUpForm.java b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/worklog/WorkLogUpForm.java new file mode 100644 index 0000000..e48db2d --- /dev/null +++ b/yunzhupaas-extend/yunzhupaas-extend-entity/src/main/java/com/yunzhupaas/model/worklog/WorkLogUpForm.java @@ -0,0 +1,9 @@ +package com.yunzhupaas.model.worklog; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +@Data +public class WorkLogUpForm extends WorkLogCrForm { +} + diff --git a/yunzhupaas-file/pom.xml b/yunzhupaas-file/pom.xml new file mode 100644 index 0000000..c520e7c --- /dev/null +++ b/yunzhupaas-file/pom.xml @@ -0,0 +1,20 @@ + + + + yunzhupaas-java-boot + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-file + pom + + yunzhupaas-file-entity + yunzhupaas-file-biz + yunzhupaas-file-controller + + + diff --git a/yunzhupaas-file/yunzhupaas-file-biz/pom.xml b/yunzhupaas-file/yunzhupaas-file-biz/pom.xml new file mode 100644 index 0000000..2c130d7 --- /dev/null +++ b/yunzhupaas-file/yunzhupaas-file-biz/pom.xml @@ -0,0 +1,37 @@ + + + + yunzhupaas-file + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-file-biz + + + + com.yunzhupaas + yunzhupaas-file-entity + ${project.version} + + + com.yunzhupaas + yunzhupaas-system-biz + ${project.version} + + + + org.aspectj + aspectjweaver + + + com.yunzhupaas + yunzhupaas-exception + ${project.version} + + + + diff --git a/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/mapper/FileMapper.java b/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/mapper/FileMapper.java new file mode 100644 index 0000000..258a9fd --- /dev/null +++ b/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/mapper/FileMapper.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.entity.FileEntity; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2021/5/13 + */ +public interface FileMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/service/YozoService.java b/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/service/YozoService.java new file mode 100644 index 0000000..f26ba18 --- /dev/null +++ b/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/service/YozoService.java @@ -0,0 +1,86 @@ +package com.yunzhupaas.service; + +import com.yunzhupaas.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import com.yunzhupaas.entity.FileEntity; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.vo.PaginationVO; + +import com.yunzhupaas.model.YozoFileParams; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2021/5/13 + */ +@Service +public interface YozoService extends SuperService { + /** + * 生成文件预览url + * @param params + * @return + */ + String getPreviewUrl(YozoFileParams params); + + /** + * 新建文档保存versionId + * @param fileVersionId + * @param fileId + * @param fileName + * @return + */ + ActionResult saveFileId(String fileVersionId, String fileId, String fileName); + + /** + * 根据文件名查询 + * @param fileNa + * @return + */ + FileEntity selectByName(String fileNa); + + /** + * 上传文件到永中 + * @param fileVersionId + * @param fileId + * @param fileUrl + * @return + */ + ActionResult saveFileIdByHttp(String fileVersionId, String fileId, String fileUrl); + + /** + * 删除文件 + * @param versionId + * @return + */ + ActionResult deleteFileByVersionId(String versionId); + + /** + * 根据versionId查询文件 + * @param fileVersionId + * @return + */ + FileEntity selectByVersionId(String fileVersionId); + + /** + * 批量删除 + * @param versions + * @return + */ + ActionResult deleteBatch(String[] versions); + + /** + * 更新versionId + * @param oldFileId + * @param newFileId + */ + void editFileVersion(String oldFileId, String newFileId); + + List getAllList(PaginationVO pageModel); +} + diff --git a/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/service/impl/YozoServiceImpl.java b/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/service/impl/YozoServiceImpl.java new file mode 100644 index 0000000..832b580 --- /dev/null +++ b/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/service/impl/YozoServiceImpl.java @@ -0,0 +1,149 @@ +package com.yunzhupaas.service.impl; + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.entity.FileEntity; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.mapper.FileMapper; +import com.yunzhupaas.model.YozoFileParams; +import com.yunzhupaas.service.YozoService; +import com.yunzhupaas.utils.SplicingUrlUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import java.util.List; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2021/5/13 + */ +@Service +public class YozoServiceImpl extends SuperServiceImpl implements YozoService { + + @Autowired + private FileMapper fileMapper; + + @Override + public String getPreviewUrl(YozoFileParams params) { + String previewUrl = SplicingUrlUtil.getPreviewUrl(params); + return previewUrl; + } + + @Override + public ActionResult saveFileId(String fileVersionId, String fileId, String fileName) { + FileEntity fileEntity =new FileEntity(); + fileEntity.setId(fileId); + fileEntity.setFileName(fileName); + fileEntity.setFileVersionId(fileVersionId); + fileEntity.setType("create"); + this.save(fileEntity); + + return ActionResult.success(MsgCode.SU001.get()); + } + + @Override + public FileEntity selectByName(String fileNa) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(FileEntity::getFileName,fileNa); + return this.getOne(wrapper); + } + + @Override + public ActionResult saveFileIdByHttp(String fileVersionId, String fileId, String fileUrl) { + String fileName = ""; + String url = ""; + String name = ""; + try { + url = URLDecoder.decode(fileUrl, "UTF-8"); + if (url.contains("/")) { + fileName = url.substring(url.lastIndexOf("/") + 1); + } else { + fileName = url.substring(url.lastIndexOf("\\") + 1); + } + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + //同一url文件数 + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("F_Url", url); + Long total = fileMapper.selectCount(wrapper); + if (total == 0) { + name = fileName; + } else { + String t = total.toString(); + name = fileName + "(" + t + ")"; + } + FileEntity fileEntity = new FileEntity(); + fileEntity.setType(url.contains("http") ? "http" : "local"); + fileEntity.setFileVersionId(fileVersionId); + fileEntity.setId(fileId); + fileEntity.setFileName(name); + fileEntity.setUrl(url); + fileMapper.insert(fileEntity); + return ActionResult.success(MsgCode.SU001.get()); + } + + @Override + public ActionResult deleteFileByVersionId(String versionId) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("F_FileVersion", versionId); + int i = fileMapper.delete(wrapper); + if (i == 1) { + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + @Override + public FileEntity selectByVersionId(String fileVersionId) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("F_FileVersion", fileVersionId); + FileEntity fileEntity = fileMapper.selectOne(wrapper); + return fileEntity; + } + + @Override + public ActionResult deleteBatch(String[] versions) { + for (String version : versions) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("F_FileVersion", version); + int i = fileMapper.delete(wrapper); + if (i == 0) { + return ActionResult.fail(MsgCode.FA045.get(version)); + } + } + return ActionResult.success(MsgCode.SU003.get()); + + } + + @Override + public void editFileVersion(String oldFileId, String newFileId) { + UpdateWrapper wrapper = new UpdateWrapper<>(); + wrapper.eq("F_FileVersion", oldFileId); + FileEntity fileEntity = new FileEntity(); + fileEntity.setFileVersionId(newFileId); + fileEntity.setOldFileVersionId(oldFileId); + fileMapper.update(fileEntity, wrapper); + } + + @Override + public List getAllList(PaginationVO pageModel) { + Page page = new Page(pageModel.getCurrentPage(), pageModel.getPageSize()); + IPage iPage = fileMapper.selectPage(page, null); + return iPage.getRecords(); + } + +} + diff --git a/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/utils/YozoUtils.java b/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/utils/YozoUtils.java new file mode 100644 index 0000000..8c15ce0 --- /dev/null +++ b/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/utils/YozoUtils.java @@ -0,0 +1,211 @@ +package com.yunzhupaas.utils; + +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.yozo.client.AppAuthenticator; +import com.yunzhupaas.yozo.client.UaaAppAuthenticator; +import com.yunzhupaas.yozo.utils.DefaultResult; +import com.yunzhupaas.yozo.utils.IResult; +import com.yunzhupaas.model.YozoParams; +import com.yunzhupaas.util.XSSEscape; +import com.yunzhupaas.yozo.constants.EnumResultCode; +import com.yunzhupaas.yozo.constants.UaaConstant; +import lombok.Cleanup; +import org.apache.http.HttpEntity; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.mime.HttpMultipartMode; +import org.apache.http.entity.mime.MultipartEntityBuilder; +import org.apache.http.entity.mime.content.FileBody; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.util.EntityUtils; +import org.springframework.stereotype.Component; +import org.springframework.util.StringUtils; + +import java.io.*; +import java.net.HttpURLConnection; +import java.net.URL; +import java.nio.charset.Charset; +import java.util.HashMap; +import java.util.Map; + +/** + * 文件预览编辑工具类 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2021/5/13 + */ +@Component +public class YozoUtils { + /** + * 生成签名 + * + * @param appId + * @param secret + * @param params + * @return + */ + public IResult generateSign(String appId, String secret, Map params) { + AppAuthenticator authenticator = new UaaAppAuthenticator(UaaConstant.SIGN, null, UaaConstant.APPID); + try { + String[] appIds = params.get(UaaConstant.APPID); + if (appIds == null || appIds.length != 1 || StringUtils.isEmpty(appIds[0])) { + params.put(UaaConstant.APPID, new String[]{appId}); + } + String sign = authenticator.generateSign(secret, params); + return DefaultResult.successResult(sign); + } catch (Exception e) { + return DefaultResult.failResult(EnumResultCode.E_GENERATE_SIGN_FAIL.getInfo()); + } + } + /** + * 获取文件名 + * @param fileName + * @param templateType + * @return + */ + public String getFileName(String fileName, String templateType) { + String suffix; + switch (templateType) { + case "1": + suffix = ".doc"; + break; + case "2": + suffix = ".docx"; + break; + case "3": + suffix = ".ppt"; + break; + case "4": + suffix = ".pptx"; + break; + case "5": + suffix = ".xls"; + break; + case "6": + suffix = ".xlsx"; + break; + default: + suffix = null; + } + if (suffix==null){ + return null; + } + String name = fileName + suffix; + return name; + } + + /** + * 使用httpclint 发送文件 + * @author: qingfeng + * @date: 2019-05-27 + * @param file + * 上传的文件 + */ + public String uploadFile(String url , File file, String appId, String sign) { + String result=""; + //构建HttpClient对象 + CloseableHttpResponse response = null; + //构建POST请求 + HttpPost httpPost = new HttpPost(url); + try { + @Cleanup CloseableHttpClient client = HttpClients.createDefault(); + //构建文件体 + String fileName = file.getName(); + FileBody fileBody = new FileBody(file, ContentType.MULTIPART_FORM_DATA, fileName); + HttpEntity httpEntity = MultipartEntityBuilder + .create() + .setMode(HttpMultipartMode.BROWSER_COMPATIBLE) + .addPart("file", fileBody) + .addTextBody("appId",appId) + .addTextBody("sign",sign) + .build(); + httpPost.setEntity(httpEntity); + // 执行http请求 + response = client.execute(httpPost); + result = EntityUtils.toString(response.getEntity(), "utf-8"); + } catch (IOException e) { + e.printStackTrace(); + } + return result; + } + + /** + * 下载文件到指定目录 + * @param fileUrl + * @param savePath + * @throws Exception + */ + public void downloadFile(String fileUrl,String savePath) throws Exception { + File file=new File(XSSEscape.escapePath(savePath)); + //判断文件是否存在,不存在则创建文件 + if(!file.exists()){ + file.createNewFile(); + } + URL url = new URL(fileUrl); + HttpURLConnection urlCon = (HttpURLConnection) url.openConnection(); + urlCon.setConnectTimeout(6000); + urlCon.setReadTimeout(6000); + int code = urlCon.getResponseCode(); + if (code != HttpURLConnection.HTTP_OK) { + throw new Exception(MsgCode.FA046.get()); + } + @Cleanup DataInputStream in = new DataInputStream(urlCon.getInputStream()); + @Cleanup FileOutputStream fileOutputStream = new FileOutputStream(savePath); + @Cleanup DataOutputStream out = new DataOutputStream(fileOutputStream); + byte[] buffer = new byte[2048]; + int count = 0; + while ((count = in.read(buffer)) > 0) { + out.write(buffer, 0, count); + } + try { + out.close(); + in.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * 上传文件到永中 + * @param + * @return + */ + public String uploadFileInPreview(InputStream inputStream,String fileName) throws IOException { + //获取签名 + Map parameter = new HashMap(); + parameter.put("appId", new String[]{YozoParams.APP_ID}); + String sign = this.generateSign(YozoParams.APP_ID, YozoParams.APP_KEY, parameter).getData(); + String url= "http://dmc.yozocloud.cn/api/file/upload?appId="+YozoParams.APP_ID+"&sign="+sign; + + @Cleanup CloseableHttpClient httpClient = HttpClients.createDefault(); + String result =""; + HttpEntity httpEntity =null; + HttpEntity responseEntity = null; + + try { + HttpPost httpPost = new HttpPost(url); + MultipartEntityBuilder multipartEntityBuilder = MultipartEntityBuilder.create(); + multipartEntityBuilder.setCharset(Charset.forName("utf-8")); + multipartEntityBuilder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);//加上此行代码解决返回中文乱码问题 + multipartEntityBuilder.addBinaryBody("file", inputStream, ContentType.MULTIPART_FORM_DATA, fileName); + + httpEntity = multipartEntityBuilder.build(); + httpPost.setEntity(httpEntity); + CloseableHttpResponse response = httpClient.execute(httpPost); + responseEntity = response.getEntity(); + result = EntityUtils.toString(responseEntity,Charset.forName("UTF-8")); + } catch (Exception e) { + e.printStackTrace(); + }finally { + if (inputStream!=null){ + inputStream.close(); + } + } + return result; + } +} + diff --git a/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/yozo/client/AppAuthenticator.java b/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/yozo/client/AppAuthenticator.java new file mode 100644 index 0000000..352a050 --- /dev/null +++ b/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/yozo/client/AppAuthenticator.java @@ -0,0 +1,8 @@ +package com.yunzhupaas.yozo.client; + +import java.util.Map; + +public interface AppAuthenticator { + String generateSign(String var1, Map var2) throws Exception; +} + diff --git a/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/yozo/client/UaaAppAuthenticator.java b/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/yozo/client/UaaAppAuthenticator.java new file mode 100644 index 0000000..ce03fc3 --- /dev/null +++ b/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/yozo/client/UaaAppAuthenticator.java @@ -0,0 +1,99 @@ +package com.yunzhupaas.yozo.client; + +import com.yunzhupaas.yozo.utils.SecretSignatureUtils; +import com.yunzhupaas.util.StringUtil; + +import java.util.Arrays; +import java.util.Iterator; +import java.util.Map; + +public class UaaAppAuthenticator implements AppAuthenticator { + public static final String OPEN_PARAM_PREFIX = "y_"; + public static final String OPEN_PARAM_APPID = "y_appid"; + public static final String OPEN_PARAM_SIGN = "y_SIGN"; + private String signParamName; + private String paramNamePrefix; + private String appidParamName; + + public UaaAppAuthenticator() { + } + + public UaaAppAuthenticator(String signParamName, String paramNamePrefix, String appidParamName) { + this.signParamName = signParamName; + this.paramNamePrefix = paramNamePrefix; + this.appidParamName = appidParamName; + } + + public String getSignParamName() { + return this.signParamName; + } + + public void setSignParamName(String signParamName) { + this.signParamName = signParamName; + } + + public String getParamNamePrefix() { + return this.paramNamePrefix; + } + + public void setParamNamePrefix(String paramNamePrefix) { + this.paramNamePrefix = paramNamePrefix; + } + + public String getAppidParamName() { + return this.appidParamName; + } + + public void setAppidParamName(String appidParamName) { + this.appidParamName = appidParamName; + } + + public String generateSign(String secret, Map params) throws Exception { + String fullParamStr = this.uniqSortParams(params); + return SecretSignatureUtils.hmacSHA256(fullParamStr, secret); + } + + private String uniqSortParams(Map params) { + boolean prefix = StringUtil.isNotEmpty(this.paramNamePrefix); + params.remove(this.signParamName); + String[] paramKeys = new String[params.keySet().size()]; + int idx = 0; + Iterator var5 = params.keySet().iterator(); + + while(true) { + String param; + do { + if (!var5.hasNext()) { + Arrays.sort(paramKeys, 0, idx); + StringBuilder builder = new StringBuilder(); + String[] var16 = paramKeys; + int var7 = paramKeys.length; + + for(int var8 = 0; var8 < var7; ++var8) { + String key = var16[var8]; + String[] values = (String[])((String[])params.get(key)); + if (values != null && values.length > 0) { + Arrays.sort(values); + String[] var11 = values; + int var12 = values.length; + + for(int var13 = 0; var13 < var12; ++var13) { + String val = var11[var13]; + builder.append(key).append("=").append(val); + } + } else { + builder.append(key).append("="); + } + } + + return builder.toString(); + } + + param = (String)var5.next(); + } while(prefix && param.startsWith(this.paramNamePrefix)); + + paramKeys[idx++] = param; + } + } +} + diff --git a/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/yozo/client/UaaAppConfigClient.java b/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/yozo/client/UaaAppConfigClient.java new file mode 100644 index 0000000..2a6175b --- /dev/null +++ b/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/yozo/client/UaaAppConfigClient.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.yozo.client; + +import com.yunzhupaas.yozo.utils.DefaultResult; +import com.yunzhupaas.yozo.utils.IResult; +import com.yunzhupaas.yozo.constants.EnumResultCode; + +import java.util.Map; + +public class UaaAppConfigClient { + public UaaAppConfigClient() { + } + + public IResult generateSign(String appId, String secret, Map params) { + UaaAppAuthenticator authenticator = new UaaAppAuthenticator("sign", (String)null, "appId"); + + try { + String[] appIds = (String[])params.get("appId"); + if (appIds == null || appIds.length != 1 || appIds[0] == null || "".equals(appIds[0])) { + params.put("appId", new String[]{appId}); + } + + String sign = authenticator.generateSign(secret, params); + return DefaultResult.successResult(sign); + } catch (Exception var7) { + return DefaultResult.failResult(EnumResultCode.E_GENERATE_SIGN_FAIL.getInfo()); + } + } +} + diff --git a/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/yozo/constants/EnumResultCode.java b/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/yozo/constants/EnumResultCode.java new file mode 100644 index 0000000..fe3fe24 --- /dev/null +++ b/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/yozo/constants/EnumResultCode.java @@ -0,0 +1,37 @@ +package com.yunzhupaas.yozo.constants; + +public enum EnumResultCode { + E_SUCCESS(0, "操作成功"), + E_GENERATE_SIGN_FAIL(1000, "获取签名失败"); + + private Integer value; + private String info; + + private EnumResultCode(Integer value, String info) { + this.value = value; + this.info = info; + } + + public Integer getValue() { + return this.value; + } + + public String getInfo() { + return this.info; + } + + public static EnumResultCode getEnum(Integer value) { + EnumResultCode[] var1 = values(); + int var2 = var1.length; + + for(int var3 = 0; var3 < var2; ++var3) { + EnumResultCode code = var1[var3]; + if (code.getValue().equals(value)) { + return code; + } + } + + return null; + } +} + diff --git a/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/yozo/constants/UaaConstant.java b/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/yozo/constants/UaaConstant.java new file mode 100644 index 0000000..4450614 --- /dev/null +++ b/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/yozo/constants/UaaConstant.java @@ -0,0 +1,10 @@ +package com.yunzhupaas.yozo.constants; + +public class UaaConstant { + public static final String APPID = "appId"; + public static final String SIGN = "sign"; + + public UaaConstant() { + } +} + diff --git a/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/yozo/utils/DefaultResult.java b/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/yozo/utils/DefaultResult.java new file mode 100644 index 0000000..2ff7173 --- /dev/null +++ b/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/yozo/utils/DefaultResult.java @@ -0,0 +1,87 @@ +package com.yunzhupaas.yozo.utils; + +public class DefaultResult implements IResult { + private static final DefaultResult.SuccessResult SUCCESS = new DefaultResult.SuccessResult(); + private static final DefaultResult.FailResult FAIL = new DefaultResult.FailResult(); + private boolean success; + private String message; + private T data; + + public DefaultResult() { + } + + public DefaultResult(boolean success, String message) { + this(success, message, (T) null); + } + + public DefaultResult(boolean success, T data) { + this(success, (String)null, data); + } + + public DefaultResult(boolean success, String message, T data) { + this.success = success; + this.message = message; + this.data = data; + } + + public static DefaultResult successResult() { + return (DefaultResult) SUCCESS; + } + + public static DefaultResult successResult(T data) { + return new DefaultResult(true, (String)null, data); + } + + public static DefaultResult successResult(String message, T data) { + return new DefaultResult(true, message, data); + } + + public static DefaultResult failResult() { + return (DefaultResult) FAIL; + } + + public static DefaultResult failResult(String message) { + return new DefaultResult(false, message, (Object)null); + } + + public static DefaultResult failResult(String message, T data) { + return new DefaultResult(false, message, data); + } + + public static DefaultResult failResult(T data) { + return new DefaultResult(false, (String)null, data); + } + + public static DefaultResult result(boolean success, String message, T data) { + return new DefaultResult(success, message, data); + } + + public boolean isSuccess() { + return this.success; + } + + public String getMessage() { + return this.message; + } + + public T getData() { + return this.data; + } + + public void setData(T obj) { + this.data = obj; + } + + private static class FailResult extends DefaultResult { + public FailResult() { + super(false, (String)null, (Object)null); + } + } + + private static class SuccessResult extends DefaultResult { + public SuccessResult() { + super(true, (String)null, (Object)null); + } + } +} + diff --git a/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/yozo/utils/HttpRequestUtils.java b/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/yozo/utils/HttpRequestUtils.java new file mode 100644 index 0000000..83a1f67 --- /dev/null +++ b/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/yozo/utils/HttpRequestUtils.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.yozo.utils; + +public class HttpRequestUtils { + public HttpRequestUtils() { + } + + public static class StringUtils { + public StringUtils() { + } + + public static boolean isNotEmpty(String data) { + return data != null && data.trim().length() > 0; + } + + public static boolean equals(String cs1, String cs2) { + if (cs1 == cs2) { + return true; + } else if (cs1 != null && cs2 != null) { + return cs1.length() != cs2.length() ? false : cs1.equals(cs2); + } else { + return false; + } + } + } +} + diff --git a/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/yozo/utils/IResult.java b/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/yozo/utils/IResult.java new file mode 100644 index 0000000..eb9cb14 --- /dev/null +++ b/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/yozo/utils/IResult.java @@ -0,0 +1,12 @@ +package com.yunzhupaas.yozo.utils; + +public interface IResult { + boolean isSuccess(); + + String getMessage(); + + T getData(); + + void setData(T var1); +} + diff --git a/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/yozo/utils/SecretSignatureUtils.java b/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/yozo/utils/SecretSignatureUtils.java new file mode 100644 index 0000000..6dfb2a1 --- /dev/null +++ b/yunzhupaas-file/yunzhupaas-file-biz/src/main/java/com/yunzhupaas/yozo/utils/SecretSignatureUtils.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.yozo.utils; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; + +public class SecretSignatureUtils { + public static final String SHA256 = "HmacSHA256"; + + public SecretSignatureUtils() { + } + + public static String hmacSHA256(String data, String key) throws Exception { + Mac mac = Mac.getInstance("HmacSHA256"); + SecretKeySpec secret_key = new SecretKeySpec(key.getBytes("UTF-8"), "HmacSHA256"); + mac.init(secret_key); + byte[] array = mac.doFinal(data.getBytes("UTF-8")); + StringBuilder sb = new StringBuilder(); + byte[] var6 = array; + int var7 = array.length; + + for(int var8 = 0; var8 < var7; ++var8) { + byte item = var6[var8]; + sb.append(Integer.toHexString(item & 255 | 256).substring(1, 3)); + } + + return sb.toString().toUpperCase(); + } +} + diff --git a/yunzhupaas-file/yunzhupaas-file-controller/pom.xml b/yunzhupaas-file/yunzhupaas-file-controller/pom.xml new file mode 100644 index 0000000..88d81b3 --- /dev/null +++ b/yunzhupaas-file/yunzhupaas-file-controller/pom.xml @@ -0,0 +1,22 @@ + + + + yunzhupaas-file + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-file-controller + + + + com.yunzhupaas + yunzhupaas-file-biz + ${project.version} + + + + diff --git a/yunzhupaas-file/yunzhupaas-file-controller/src/main/java/com/yunzhupaas/controller/UtilsController.java b/yunzhupaas-file/yunzhupaas-file-controller/src/main/java/com/yunzhupaas/controller/UtilsController.java new file mode 100644 index 0000000..d74503f --- /dev/null +++ b/yunzhupaas-file/yunzhupaas-file-controller/src/main/java/com/yunzhupaas/controller/UtilsController.java @@ -0,0 +1,846 @@ +package com.yunzhupaas.controller; + +import cn.xuyanwu.spring.file.storage.FileInfo; +import com.alibaba.fastjson.JSONObject; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.service.DictionaryDataService; +import com.yunzhupaas.base.util.OptimizeUtil; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.FileTypeConstant; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.consts.DeviceType; +import com.yunzhupaas.entity.FileDetail; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.model.*; +import com.yunzhupaas.util.*; +import com.yunzhupaas.utils.YozoUtils; +import lombok.Cleanup; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.codec.binary.Base64; +import org.apache.commons.io.FileUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.*; +import java.nio.channels.Channels; +import java.nio.channels.FileChannel; +import java.nio.channels.WritableByteChannel; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 通用控制器 + * + * @author 云筑产品开发平台组 + * @version v5.2.7 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +@Slf4j +@Tag(name = "公共", description = "file") +@RestController +@RequestMapping("/api/file") +public class UtilsController { + + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private RedisUtil redisUtil; + @Autowired + private DictionaryDataService dictionaryDataService; + @Autowired + private YozoUtils yozoUtils; + + /** + * 语言列表 + * + * @return + */ + @Operation(summary = "语言列表") + @GetMapping("/Language") + public ActionResult> getList() { + String dictionaryTypeId = "dc6b2542d94b407cac61ec1d59592901"; + List list = dictionaryDataService.getList(dictionaryTypeId); + List language = JsonUtil.getJsonToList(list, LanguageVO.class); + ListVO vo = new ListVO(); + vo.setList(language); + return ActionResult.success(vo); + } + + /** + * 图形验证码 + * + * @return + */ + @NoDataSourceBind() + @Operation(summary = "图形验证码") + @GetMapping("/ImageCode/{timestamp}") + @Parameters({ + @Parameter(name = "timestamp", description = "时间戳", required = true), + }) + public void imageCode(@PathVariable("timestamp") String timestamp) { + DownUtil.downCode(null); + redisUtil.insert(timestamp, ServletUtil.getSession().getAttribute(CodeUtil.RANDOMCODEKEY), 120); + } + + /** + * 获取全部下载文件链接(打包下载) + * + * @return + */ + @NoDataSourceBind + @Operation(summary = "获取全部下载文件链接(打包下载)") + @PostMapping("/PackDownload/{type}") + public ActionResult packDownloadUrl(@PathVariable("type") String type, + @RequestBody List> fileInfoList) throws Exception { + type = XSSEscape.escape(type); + if (fileInfoList == null || fileInfoList.isEmpty()) { + return ActionResult.fail(MsgCode.FA047.get()); + } + List filePathList = new ArrayList(); + + String zipTempFilePath = null; + String zipFileId = RandomUtil.uuId() + ".zip"; + List repeatName = new ArrayList<>(); + for (Map fileInfoMap : fileInfoList) { + String fileId = XSSEscape.escape((String) fileInfoMap.get("fileId")).trim(); + String fileName = XSSEscape.escape((String) fileInfoMap.get("fileName")).trim(); + if (repeatName.contains(fileName)) { + fileName = fileName.substring(0, fileName.lastIndexOf(".")) + "副本" + + UUID.randomUUID().toString().substring(0, 5) + fileName.substring(fileName.lastIndexOf(".")); + } else { + repeatName.add(fileName); + } + if (StringUtil.isEmpty(fileId) || StringUtil.isEmpty(fileName)) { + continue; + } + if (FileUploadUtils.exists(type, fileId)) { + String typePath = FilePathUtil.getFilePath(type); + if (fileId.indexOf(",") >= 0) { + typePath += fileId.substring(0, fileId.lastIndexOf(",") + 1).replaceAll(",", "/"); + fileId = fileId.substring(fileId.lastIndexOf(",") + 1); + } + byte[] bytes = FileUploadUtils.downloadFileByte(typePath, fileId, false); + if (zipTempFilePath == null) { + zipTempFilePath = FileUploadUtils.getLocalBasePath() + + FilePathUtil.getFilePath(FileTypeConstant.FILEZIPDOWNTEMPPATH); + if (!new File(zipTempFilePath).exists()) { + new File(zipTempFilePath).mkdirs(); + } + zipTempFilePath += zipFileId; + } + ZipUtil.fileAddToZip(zipTempFilePath, new ByteArrayInputStream(bytes), fileName); + } + } + if (zipTempFilePath == null) { + return ActionResult.fail(MsgCode.FA018.get()); + } + // 将文件上传到默认文件服务器 + String newFileId = zipFileId; + if (!"local".equals(FileUploadUtils.getDefaultPlatform())) { // 不是本地,说明是其他文件服务器,将zip文件上传到其他服务器里,方便下载 + FileInfo fileInfo = FileUploadUtils.uploadFile(new File(zipTempFilePath), + FilePathUtil.getFilePath(FileTypeConstant.FILEZIPDOWNTEMPPATH), zipFileId); + new File(zipTempFilePath).delete(); + newFileId = fileInfo.getFilename(); + } + com.yunzhupaas.base.vo.DownloadVO vo = DownloadVO.builder().name(zipFileId) + .url(UploaderUtil.uploaderFile(newFileId + "#" + FileTypeConstant.FILEZIPDOWNTEMPPATH)).build(); + Map map = new HashMap(); + map.put("downloadVo", vo); + map.put("downloadName", "文件" + zipFileId); + return ActionResult.success(map); + } + + /** + * 上传文件/图片 + * + * @return + */ + @NoDataSourceBind() + @Operation(summary = "上传文件/图片") + @PostMapping(value = "/Uploader/{type}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + @Parameters({ + @Parameter(name = "type", description = "类型", required = true) + }) + public ActionResult uploader(@PathVariable("type") String type, MultipartFile file, + HttpServletRequest httpServletRequest) throws IOException { + String fileType = UpUtil.getFileType(file); + // 验证类型 + if (!OptimizeUtil.fileType(configValueUtil.getAllowUploadFileType(), fileType)) { + return ActionResult.fail(MsgCode.FA017.get()); + } + PathTypeModel pathTypeModel = new PathTypeModel(); + pathTypeModel.setPathType(httpServletRequest.getParameter("pathType")); + pathTypeModel.setTimeFormat(httpServletRequest.getParameter("timeFormat")); + pathTypeModel.setSortRule(httpServletRequest.getParameter("sortRule")); + pathTypeModel.setFolder(httpServletRequest.getParameter("folder")); + if ("selfPath".equals(pathTypeModel.getPathType())) { + if (StringUtil.isNotEmpty(pathTypeModel.getFolder())) { + String folder = pathTypeModel.getFolder(); + folder = folder.replaceAll("\\\\", "/"); + // String regex = "^[a-z0-9A-Z\\u4e00-\\u9fa5\\\\\\/]+$"; + String regex = "^[a-zA-Z0-9][a-zA-Z0-9_\\-\\\\\\/]{0,99}$"; + if (!folder.matches(regex)) { + return ActionResult.fail(MsgCode.FA038.get()); + } + } + } + UploaderVO vo = uploaderVO(file, type, pathTypeModel); + return ActionResult.success(vo); + } + + /** + * 图片转成base64 + * + * @return + */ + @NoDataSourceBind() + @Operation(summary = "图片转成base64") + @PostMapping(value = "/Uploader/imgToBase64", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ActionResult imgToBase64(@RequestParam("file") MultipartFile file) throws IOException { + String encode = cn.hutool.core.codec.Base64.encode(file.getBytes()); + Object base64Name = ""; + if (StringUtil.isNotEmpty(encode)) { + base64Name = "data:image/jpeg;base64," + encode; + } + return ActionResult.success(base64Name); + } + + /** + * 获取下载文件链接 + * + * @return + */ + @NoDataSourceBind() + @Operation(summary = "获取下载文件链接") + @GetMapping("/Download/{type}/{fileName}") + @Parameters({ + @Parameter(name = "type", description = "类型", required = true), + @Parameter(name = "fileName", description = "文件名称", required = true), + }) + public ActionResult downloadUrl(@PathVariable("type") String type, @PathVariable("fileName") String fileName) { + type = XSSEscape.escape(type); + fileName = XSSEscape.escape(fileName); + boolean exists = FileUploadUtils.exists(type, fileName); + if (exists) { + DownloadVO vo = DownloadVO.builder().name(fileName).url(UploaderUtil.uploaderFile(fileName + "#" + type)) + .build(); + return ActionResult.success(vo); + } + return ActionResult.fail(MsgCode.FA018.get()); + } + + /** + * 下载文件链接 + * + * @return + */ + @NoDataSourceBind() + @Operation(summary = "下载文件链接") + @GetMapping("/Download") + public void downloadFile() throws DataException { + HttpServletRequest request = ServletUtil.getRequest(); + String reqJson = request.getParameter("encryption"); + String name = request.getParameter("name"); + String fileNameAll = DesUtil.aesDecode(reqJson); + if (!StringUtil.isEmpty(fileNameAll)) { + fileNameAll = fileNameAll.replaceAll("\n", ""); + String[] data = fileNameAll.split("#"); + String cacheKEY = data.length > 0 ? data[0] : ""; + String fileName = XSSEscape.escapePath(data.length > 1 ? data[1] : ""); + String type = data.length > 2 ? data[2] : ""; + Object ticketObj = TicketUtil.parseTicket(cacheKEY); + // 验证缓存 + if (ticketObj != null) { + // 某些手机浏览器下载后会有提示窗口, 会访问两次下载地址 + if (UserProvider.getDeviceForAgent().equals(DeviceType.APP) && "".equals(ticketObj)) { + TicketUtil.updateTicket(cacheKEY, "1", 30L); + } else { + TicketUtil.deleteTicket(cacheKEY); + } + // 下载文件 + String typePath = FilePathUtil.getFilePath(type.toLowerCase()); + if (fileName.indexOf(",") >= 0) { + typePath += fileName.substring(0, fileName.lastIndexOf(",") + 1).replaceAll(",", "/"); + fileName = fileName.substring(fileName.lastIndexOf(",") + 1); + } + // String filePath = FilePathUtil.getFilePath(type.toLowerCase()); + byte[] bytes = FileUploadUtils.downloadFileByte(typePath, fileName, false); + FileDownloadUtil.downloadFile(bytes, fileName, name); + if (FileTypeConstant.FILEZIPDOWNTEMPPATH.equals(type)) { // 删除打包的临时文件,释放存储 + FileUploadUtils.deleteFileByPathAndFileName(typePath, fileName); + } + } else { + if (FileTypeConstant.FILEZIPDOWNTEMPPATH.equals(type)) { // 删除打包的临时文件,释放存储 + String typePath = FilePathUtil.getFilePath(type); + FileUploadUtils.deleteFileByPathAndFileName(typePath, fileName); + } + throw new DataException(MsgCode.FA039.get()); + } + } else { + throw new DataException(MsgCode.FA039.get()); + } + } + + /** + * 下载文件链接 + * + * @return + */ + @NoDataSourceBind() + @Operation(summary = "下载模板文件链接") + @GetMapping("/DownloadModel") + public void downloadModel() throws DataException { + HttpServletRequest request = ServletUtil.getRequest(); + String reqJson = request.getParameter("encryption"); + String fileNameAll = DesUtil.aesDecode(reqJson); + if (!StringUtil.isEmpty(fileNameAll)) { + String token = fileNameAll.split("#")[0]; + if (TicketUtil.parseTicket(token) != null) { + TicketUtil.deleteTicket(token); + String fileName = fileNameAll.split("#")[1]; + String filePath = configValueUtil.getTemplateFilePath(); + // 下载文件 + byte[] bytes = FileUploadUtils.downloadFileByte(filePath, fileName, false); + FileDownloadUtil.downloadFile(bytes, fileName, null); + } else { + throw new DataException(MsgCode.FA039.get()); + } + } else { + throw new DataException(MsgCode.FA039.get()); + } + } + + /** + * 获取图片 + * + * @param fileName + * @param type + * @return + */ + @NoDataSourceBind() + @Operation(summary = "获取图片") + @GetMapping("/Image/{type}/{fileName}") + @Parameters({ + @Parameter(name = "type", description = "类型", required = true), + @Parameter(name = "fileName", description = "名称", required = true), + }) + public void downLoadImg(@PathVariable("type") String type, @PathVariable("fileName") String fileName) { + String filePath = FilePathUtil.getFilePath(type.toLowerCase()); + if (fileName.indexOf(",") >= 0) { + filePath += fileName.substring(0, fileName.lastIndexOf(",") + 1).replaceAll(",", "/"); + fileName = fileName.substring(fileName.lastIndexOf(",") + 1); + } + // if ("im".equalsIgnoreCase(type)) { + // type = "imfile"; + // } + // else if (FileTypeEnum.ANNEXPIC.equalsIgnoreCase(type)) { + // type = FileTypeEnum.ANNEX; + // } + // 下载文件 + byte[] bytes = FileUploadUtils.downloadFileByte(filePath, fileName, false); + FileDownloadUtil.flushImage(bytes, fileName); + } + + /** + * 获取IM聊天图片 + * 注意 后缀名前端故意把 .替换@ + * + * @param fileName + * @return + */ + @NoDataSourceBind() + @Operation(summary = "获取IM聊天图片") + @GetMapping("/IMImage/{fileName}") + @Parameters({ + @Parameter(name = "fileName", description = "名称", required = true), + }) + public void imImage(@PathVariable("fileName") String fileName) { + byte[] bytes = FileUploadUtils.downloadFileByte(configValueUtil.getImContentFilePath(), fileName, false); + FileDownloadUtil.flushImage(bytes, fileName); + } + + /** + * 查看图片 + * + * @param type 哪个文件夹 + * @param fileName 文件名称 + * @return + */ + @NoDataSourceBind() + @Operation(summary = "查看图片") + @GetMapping("/{type}/{fileName}") + @Parameters({ + @Parameter(name = "fileName", description = "名称", required = true), + @Parameter(name = "type", description = "类型", required = true), + }) + public void img(@PathVariable("type") String type, @PathVariable("fileName") String fileName) { + // String filePath = configValueUtil.getBiVisualPath() + type + File.separator; + // if (StorageType.MINIO.equals(configValueUtil.getFileType())) { + // fileName = "/" + type + "/" + fileName; + // filePath = configValueUtil.getBiVisualPath().substring(0, + // configValueUtil.getBiVisualPath().length() - 1); + // } + String filePath = FilePathUtil.getFilePath(type.toLowerCase()); + if (fileName.indexOf(",") >= 0) { + filePath += fileName.substring(0, fileName.lastIndexOf(",") + 1).replaceAll(",", "/"); + fileName = fileName.substring(fileName.lastIndexOf(",") + 1); + } + // 下载文件 + byte[] bytes = FileUploadUtils.downloadFileByte(filePath, fileName, false); + FileDownloadUtil.flushImage(bytes, fileName); + } + + /** + * 获取IM聊天语音 + * 注意 后缀名前端故意把 .替换@ + * + * @param fileName + * @return + */ + @NoDataSourceBind() + @Operation(summary = "获取IM聊天语音") + @GetMapping("/IMVoice/{fileName}") + @Parameters({ + @Parameter(name = "fileName", description = "名称", required = true), + }) + public void imVoice(@PathVariable("fileName") String fileName) { + fileName = fileName.replaceAll("@", "."); + byte[] bytes = FileUploadUtils.downloadFileByte(configValueUtil.getImContentFilePath(), fileName, false); + FileDownloadUtil.flushImage(bytes, fileName); + } + + /** + * app启动获取信息 + * + * @param appName + * @return + */ + @NoDataSourceBind() + @Operation(summary = "app启动获取信息") + @GetMapping("/AppStartInfo/{appName}") + @Parameters({ + @Parameter(name = "appName", description = "名称", required = true), + }) + public ActionResult getAppStartInfo(@PathVariable("appName") String appName) { + appName = XSSEscape.escape(appName); + JSONObject object = new JSONObject(); + object.put("AppVersion", configValueUtil.getAppVersion()); + object.put("AppUpdateContent", configValueUtil.getAppUpdateContent()); + return ActionResult.success(object); + } + + // ----------大屏图片下载--------- + @NoDataSourceBind() + @Operation(summary = "获取图片") + @GetMapping("/VisusalImg/{bivisualpath}/{type}/{fileName}") + @Parameters({ + @Parameter(name = "type", description = "类型", required = true), + @Parameter(name = "bivisualpath", description = "路径", required = true), + @Parameter(name = "fileName", description = "名称", required = true), + }) + public void downVisusalImg(@PathVariable("type") String type, @PathVariable("bivisualpath") String bivisualpath, + @PathVariable("fileName") String fileName) { + fileName = XSSEscape.escape(fileName); + String filePath = configValueUtil.getBiVisualPath(); + byte[] bytes = FileUploadUtils.downloadFileByte(filePath + type + "/", fileName, false); + FileDownloadUtil.flushImage(bytes, fileName); + } + + // ---------------------- + + @NoDataSourceBind() + @Operation(summary = "预览文件") + @GetMapping("/Uploader/Preview") + public ActionResult Preview(PreviewParams previewParams) { + // 读取允许文件预览类型 + String allowPreviewType = configValueUtil.getAllowPreviewFileType(); + String[] fileType = allowPreviewType.split(","); + + String fileName = XSSEscape.escape(previewParams.getFileName()); + + // 文件预览类型检验 + String docType = fileName.substring(fileName.lastIndexOf(".") + 1); + String s = Arrays.asList(fileType).stream().filter(type -> type.equals(docType)).findFirst().orElse(null); + + if (StringUtil.isEmpty(s)) { + return ActionResult.fail(MsgCode.FA040.get()); + } + + // 解析文件url 获取类型 + String type = configValueUtil.getWebAnnexFilePath(); + + String fileNameAll = previewParams.getFileDownloadUrl(); + if (!StringUtil.isEmpty(fileNameAll)) { + String[] data = fileNameAll.split("/"); + type = data.length > 4 ? data[4] : ""; + } + + String url; + // 文件预览策略 + if ("yozo".equals(configValueUtil.getPreviewType())) { + if (StringUtil.isEmpty(previewParams.getFileVersionId())) { + return ActionResult.fail(MsgCode.FA041.get()); + } + + String fileVersionId = XSSEscape.escape(previewParams.getFileVersionId()); + + // 获取签名 + Map parameter = new HashMap(); + parameter.put("appId", new String[] { YozoParams.APP_ID }); + parameter.put("fileVersionId", new String[] { fileVersionId }); + String sign = yozoUtils.generateSign(YozoParams.APP_ID, YozoParams.APP_KEY, parameter).getData(); + url = "http://eic.yozocloud.cn/api/view/file?fileVersionId=" + + fileVersionId + + "&appId=" + + YozoParams.APP_ID + + "&sign=" + + sign; + } else { + if (FileUploadUtils.getDefaultPlatform().startsWith("local-plus")) { + url = YozoParams.YUNZHUPAAS_DOMAINS + "/api/file/filedownload/" + type + "/" + + previewParams.getFileName(); + } else { + // 图像格式 + if ("jpg,gif,png,bmp,jpeg".contains(docType)) { + url = YozoParams.YUNZHUPAAS_DOMAINS + "/api/file/filedownload/" + type; + } else { + String[] split = fileNameAll.split("/"); + if (split.length > 5) { + type = FilePathUtil.getFilePath(type) + split[5].replaceAll(",", "/"); + } + FileDetail fileDetail = FileUploadUtils.getFileDetail(type, fileName, false); + url = FileUploadUtils.getDomain() + FileUploadUtils.getBucketName() + fileDetail.getBasePath() + + fileDetail.getPath(); + } + } + // encode编码 + String fileUrl = Base64.encodeBase64String(url.getBytes()); + url = configValueUtil.getKkFileUrl() + "onlinePreview?url=" + fileUrl; + } + return ActionResult.success(MsgCode.SU000.get(), url); + } + + @NoDataSourceBind() + @Operation(summary = "kk本地文件预览") + @GetMapping("/filedownload/{type}/{fileName}") + public void filedownload(@PathVariable("type") String type, @PathVariable("fileName") String fileName, + HttpServletResponse response) { + String typePath = FilePathUtil.getFilePath(type); + if (fileName.indexOf(",") >= 0) { + typePath += fileName.substring(0, fileName.lastIndexOf(",") + 1).replaceAll(",", "/"); + fileName = fileName.substring(fileName.lastIndexOf(",") + 1); + } + String tmpPath = typePath + fileName; + boolean b = FileUtil.fileIsFile(tmpPath); + if (!b) { + FileUploadUtils.downLocal(FilePathUtil.getFilePath(type), FileUploadUtils.getLocalBasePath() + typePath, + fileName); + } + String filePath = XSSEscape.escapePath(FileUploadUtils.getLocalBasePath() + typePath + fileName); + OutputStream os = null; + // 本地取对应文件 + File file = new File(filePath); + try { + os = response.getOutputStream(); + String contentType = Files.probeContentType(Paths.get(file.getAbsolutePath())); + response.setHeader("Content-Type", contentType); + response.setHeader("Content-Dispostion", + "attachment;filename=" + new String(file.getName().getBytes("utf-8"), "ISO8859-1")); + @Cleanup + FileInputStream fileInputStream = new FileInputStream(file); + + @Cleanup + WritableByteChannel writableByteChannel = Channels.newChannel(os); + + @Cleanup + FileChannel channel = fileInputStream.getChannel(); + channel.transferTo(0, channel.size(), writableByteChannel); + channel.close(); + os.flush(); + writableByteChannel.close(); + } catch (IOException e) { + e.printStackTrace(); + } finally { + try { + if (os != null) { + os.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + @Operation(summary = "分片上传获取") + @GetMapping("/chunk") + public ActionResult checkChunk(Chunk chunk) { + String type = chunk.getExtension(); + if (!OptimizeUtil.fileType(configValueUtil.getAllowUploadFileType(), type)) { + return ActionResult.fail(MsgCode.FA017.get()); + } + String identifier = chunk.getIdentifier(); + String path = configValueUtil.getTemporaryFilePath(); + String filePath = XSSEscape.escapePath(path + identifier); + List chunkFiles = FileUtil.getFile(new File(FileUploadUtils.getLocalBasePath() + filePath)); + List existsChunk = chunkFiles.stream().filter(f -> { + if (f.getName().endsWith(".tmp")) { + FileUtils.deleteQuietly(f); + } else + return f.getName().startsWith(identifier); + return false; + }).map(f -> Integer.parseInt(f.getName().replace(identifier.concat("-"), ""))).collect(Collectors.toList()); + ChunkRes chunkRes = ChunkRes.builder().merge(chunk.getTotalChunks().equals(existsChunk.size())) + .chunkNumbers(existsChunk).build(); + return ActionResult.success(chunkRes); + } + + @Operation(summary = "分片上传附件") + @PostMapping("/chunk") + public ActionResult upload(Chunk chunk, @RequestParam("file") MultipartFile file) { + String type = chunk.getExtension(); + if (!OptimizeUtil.fileType(configValueUtil.getAllowUploadFileType(), type)) { + return ActionResult.fail(MsgCode.FA017.get()); + } + ChunkRes chunkRes = ChunkRes.builder().build(); + chunkRes.setMerge(false); + File chunkFile = null; + File chunkTmpFile = null; + try { + String filePath = FileUploadUtils.getLocalBasePath() + configValueUtil.getTemporaryFilePath(); + Integer chunkNumber = chunk.getChunkNumber(); + String identifier = XSSEscape.escapePath(chunk.getIdentifier()); + String chunkTempPath = XSSEscape.escapePath(filePath + identifier); + File path = new File(chunkTempPath); + if (!path.exists()) { + path.mkdirs(); + } + String chunkName = XSSEscape.escapePath(identifier.concat("-") + chunkNumber); + String chunkTmpName = XSSEscape.escapePath(chunkName.concat(".tmp")); + chunkFile = new File(chunkTempPath, chunkName); + chunkTmpFile = new File(chunkTempPath, chunkTmpName); + if (chunkFile.exists() && chunkFile.length() == chunk.getCurrentChunkSize()) { + System.out.println("该分块已经上传:" + chunkFile.getName()); + } else { + @Cleanup + InputStream inputStream = file.getInputStream(); + FileUtils.copyInputStreamToFile(inputStream, chunkTmpFile); + chunkTmpFile.renameTo(chunkFile); + } + int existsSize = (int) FileUtil.getFile(new File(chunkTempPath)).stream() + .filter(f -> f.getName().startsWith(identifier) && !f.getName().endsWith(".tmp")).count(); + chunkRes.setMerge(Objects.equals(existsSize, chunk.getTotalChunks())); + } catch (Exception e) { + try { + FileUtils.deleteQuietly(chunkTmpFile); + FileUtils.deleteQuietly(chunkFile); + } catch (Exception ee) { + e.printStackTrace(); + } + System.out.println("上传异常:" + e); + return ActionResult.fail(MsgCode.FA033.get()); + } + return ActionResult.success(chunkRes); + } + + @Operation(summary = "分片组装") + @PostMapping("/merge") + public ActionResult merge(MergeChunkDto mergeChunkDto) { + String identifier = XSSEscape.escapePath(mergeChunkDto.getIdentifier()); + String path = FileUploadUtils.getLocalBasePath() + configValueUtil.getTemporaryFilePath(); + String filePath = XSSEscape.escapePath(path + identifier); + String uuid = RandomUtil.uuId(); + String partFile = XSSEscape.escapePath(path + uuid + "." + mergeChunkDto.getExtension()); + UploaderVO vo = UploaderVO.builder().build(); + try { + List mergeFileList = FileUtil.getFile(new File(filePath)); + @Cleanup + FileOutputStream destTempfos = new FileOutputStream(partFile, true); + for (int i = 0; i < mergeFileList.size(); i++) { + String chunkName = identifier.concat("-") + (i + 1); + File files = new File(filePath, chunkName); + if (files.exists()) { + FileUtils.copyFile(files, destTempfos); + } + } + File partFiles = new File(partFile); + if (partFiles.exists()) { + MultipartFile multipartFile = FileUtil.createFileItem(partFiles); + String type = mergeChunkDto.getType(); + PathTypeModel pathTypeModel = new PathTypeModel(); + pathTypeModel.setPathType(mergeChunkDto.getPathType()); + pathTypeModel.setSortRule(mergeChunkDto.getSortRule()); + pathTypeModel.setTimeFormat(mergeChunkDto.getTimeFormat()); + pathTypeModel.setFolder(mergeChunkDto.getFolder()); + if ("selfPath".equals(pathTypeModel.getPathType())) { + if (StringUtil.isNotEmpty(pathTypeModel.getFolder())) { + String folder = pathTypeModel.getFolder(); + folder = folder.replaceAll("\\\\", "/"); + // String regex = "^[a-z0-9A-Z\\u4e00-\\u9fa5\\\\\\/]+$"; + // 文件夹名以字母或数字开头,由字母、数字、下划线和连字符组成,长度不超过100个字符 + String regex = "^[a-zA-Z0-9][a-zA-Z0-9_\\-\\\\\\/]{0,99}$"; + if (!folder.matches(regex)) { + return ActionResult.fail(MsgCode.FA038.get()); + } + } + } + vo = uploaderVO(multipartFile, type, pathTypeModel); + FileUtil.deleteTmp(multipartFile); + } + } catch (Exception e) { + log.error("合并分片失败: {}", e.getMessage()); + throw new DataException(MsgCode.FA033.get()); + } finally { + FileUtils.deleteQuietly(new File(filePath)); + FileUtils.deleteQuietly(new File(partFile)); + } + return ActionResult.success(vo); + } + + /** + * 封装上传附件 + * + * @param file + * @param type + * @return + * @throws IOException + */ + private UploaderVO uploaderVO(MultipartFile file, String type, PathTypeModel pathTypeModel) throws IOException { + String orgFileName = file.getOriginalFilename(); + String fileType = UpUtil.getFileType(file); + // if (OptimizeUtil.fileSize(file.getSize(), 1024000)) { + // return ActionResult.fail("上传失败,文件大小超过1M"); + // } + // if ("mail".equals(type)) { + // type = "temporary"; + // } + // 实际文件名 + String fileName = DateUtil.dateNow("yyyyMMdd") + "_" + RandomUtil.uuId() + "." + fileType; + // 文件上传路径 + String filePath = FilePathUtil.getFilePath(type.toLowerCase()); + + // 文件自定义路径相对路径 + String relativeFilePath = ""; + if ("selfPath".equals(pathTypeModel.getPathType()) && pathTypeModel.getSortRule() != null) { + // 按路径规则顺序构建生成目录 + String sortRule = pathTypeModel.getSortRule(); + List rules = null; + if (sortRule.contains("[")) { + rules = JsonUtil.getJsonToList(sortRule, String.class); + } else { + rules = Arrays.asList(pathTypeModel.getSortRule().split(",")); + } + for (String rule : rules) { + // 按用户存储 + if ("1".equals(rule)) { + UserInfo userInfo = UserProvider.getUser(); + relativeFilePath += userInfo.getUserAccount() + "/"; + } + // 按照时间格式 + else if (StringUtil.isNotEmpty(pathTypeModel.getTimeFormat()) && "2".equals(rule)) { + String timeFormat = pathTypeModel.getTimeFormat(); + timeFormat = timeFormat.replaceAll("YYYY", "yyyy"); + timeFormat = timeFormat.replaceAll("DD", "dd"); + LocalDate currentDate = LocalDate.now(); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern(timeFormat); + String currentDateStr = currentDate.format(formatter); + relativeFilePath += currentDateStr; + if (!currentDateStr.endsWith("/")) { + relativeFilePath += "/"; + } + } + // 按自定义目录 + else if (StringUtil.isNotEmpty(pathTypeModel.getFolder()) && "3".equals(rule)) { + String folder = pathTypeModel.getFolder(); + folder = folder.replaceAll("\\\\", "/"); + relativeFilePath += folder; + if (!folder.endsWith("/")) { + relativeFilePath += "/"; + } + } + } + + if (StringUtil.isNotEmpty(relativeFilePath)) { + relativeFilePath = StringUtil.replaceMoreStrToOneStr(relativeFilePath, "/"); + if (relativeFilePath.startsWith("/")) { + relativeFilePath = relativeFilePath.substring(1); + } + filePath += relativeFilePath; + fileName = relativeFilePath.replaceAll("/", ",") + fileName; + } + } + + UploaderVO vo = UploaderVO.builder().fileSize(file.getSize()).fileExtension(fileType).build(); + FileInfo fileInfo = FileUploadUtils.uploadFile(file, filePath, fileName); + fileName = fileInfo.getFilename(); + String thFilename = fileInfo.getThFilename(); + if (!StringUtil.isNotEmpty(thFilename)) { + // 小图没有压缩直接用原图 + thFilename = fileName; + } + // 自定义文件实际文件名 + if (StringUtil.isNotEmpty(relativeFilePath)) { + fileName = relativeFilePath.replaceAll("/", ",") + fileName; + thFilename = relativeFilePath.replaceAll("/", ",") + thFilename; + } + vo.setName(fileName); + // UploadUtil.uploadFile(configValueUtil.getFileType(), type, fileName, file, + // filePath); + if ("useravatar".equalsIgnoreCase(type)) { + vo.setUrl(UploaderUtil.uploaderImg(fileName)); + vo.setUrl(UploaderUtil.uploaderImg(thFilename)); + } else if ("annex".equalsIgnoreCase(type)) { + // UserInfo userInfo = UserProvider.getUser(); + // vo.setUrl(UploaderUtil.uploaderFile(userInfo.getId() + "#" + fileName + "#" + + // type)); + vo.setUrl(UploaderUtil.uploaderImg("/api/file/Image/annex/", fileName)); + vo.setThumbUrl(UploaderUtil.uploaderImg("/api/file/Image/annex/", thFilename)); + } else if ("annexpic".equalsIgnoreCase(type)) { + vo.setUrl(UploaderUtil.uploaderImg("/api/file/Image/annexpic/", fileName)); + vo.setThumbUrl(UploaderUtil.uploaderImg("/api/file/Image/annexpic/", thFilename)); + } else { + vo.setUrl(UploaderUtil.uploaderImg("/api/file/Image/" + type.toLowerCase() + "/", fileName)); + vo.setThumbUrl(UploaderUtil.uploaderImg("/api/file/Image/" + type.toLowerCase() + "/", thFilename)); + } + + // 上传到永中 + if ("yozo".equals(configValueUtil.getPreviewType())) { + try { + @Cleanup + InputStream inputStream = file.getInputStream(); + String s = yozoUtils.uploadFileInPreview(inputStream, orgFileName); + Map map = JsonUtil.stringToMap(s); + if ("操作成功".equals(map.get("message"))) { + Map dataMap = JsonUtil.stringToMap(String.valueOf(map.get("data"))); + String verId = String.valueOf(dataMap.get("fileVersionId")); + vo.setFileVersionId(verId); + } + } catch (Exception e) { + System.out.println("上传到永中失败"); + e.printStackTrace(); + } + } + return vo; + } + + public static void main(String[] args) { + String path = "../../../windows/win.ini|userAvatar/../../../../windows/win.ini"; + System.out.printf(XSSEscape.escapePath(path)); + } +} diff --git a/yunzhupaas-file/yunzhupaas-file-controller/src/main/java/com/yunzhupaas/controller/YozoFileController.java b/yunzhupaas-file/yunzhupaas-file-controller/src/main/java/com/yunzhupaas/controller/YozoFileController.java new file mode 100644 index 0000000..aea7186 --- /dev/null +++ b/yunzhupaas-file/yunzhupaas-file-controller/src/main/java/com/yunzhupaas/controller/YozoFileController.java @@ -0,0 +1,307 @@ +package com.yunzhupaas.controller; + + +import com.alibaba.fastjson.JSONObject; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.entity.FileEntity; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.model.FileForm; +import com.yunzhupaas.model.UploaderVO; +import com.yunzhupaas.model.YozoFileParams; +import com.yunzhupaas.model.YozoParams; +import com.yunzhupaas.service.YozoService; +import com.yunzhupaas.util.FileUtil; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.XSSEscape; +import com.yunzhupaas.util.wxutil.HttpUtil; +import com.yunzhupaas.utils.YozoUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.File; +import java.io.IOException; +import java.util.*; + +/** + * @author 云筑产品开发平台组 + */ +@RestController +@RequestMapping +@Tag(name = "在线文档预览", description = "文件在线预览") +public class YozoFileController { + + @Autowired + private YozoService yozoService; + + @Autowired + private YozoUtils yozoUtil; + + @Autowired + private ConfigValueUtil configValueUtil; + + @PostMapping("/api/file/getViewUrlWebPath") + @Operation(summary = "文档预览") + public ActionResult getUrl(YozoFileParams params) { + String previewUrl = XSSEscape.escape(yozoService.getPreviewUrl(params)); + return ActionResult.success("success", previewUrl); + } + + @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + @Operation(summary = "上传本地文件") + public ActionResult upload(@RequestPart("multipartFile") MultipartFile file) throws IOException { + String result = yozoUtil.uploadFileInPreview(file.getInputStream(),file.getOriginalFilename()); + String fileName = file.getOriginalFilename(); + UploaderVO vo = UploaderVO.builder().name(fileName).build(); + Map map = JsonUtil.stringToMap(result); + if ("操作成功".equals(map.get("message"))){ + Map dataMap = JsonUtil.stringToMap(String.valueOf(map.get("data"))); + String verId = String.valueOf(dataMap.get("fileVersionId")); + vo.setFileVersionId(verId); + return ActionResult.success("Success",vo); + } + + return ActionResult.fail(MsgCode.FA033.get()); + } + + /** + * + * @param fileName 新建文件名 + * @param templateType (模板类型;1新建doc文档,2新建docx文档,3新建ppt文档,4新建pptx文档,5新建xls文档,6新建xlsx文档) + * @return + */ + @GetMapping("/newCreate") + @Operation(summary = "新建文件") + @Parameters({ + @Parameter(name = "fileName", description = "名称"), + @Parameter(name = "templateType", description = "类型"), + }) + public ActionResult newCreate(@RequestParam("fileName") String fileName, @RequestParam("templateType") String templateType) { + String fileNa = yozoUtil.getFileName(fileName, templateType); + if (fileNa == null) { + return ActionResult.fail(MsgCode.FA042.get()); + } + //判断文件是否创建过 + FileEntity fileEntity = yozoService.selectByName(fileNa); + if (fileEntity != null) { + return ActionResult.fail(MsgCode.FA043.get()); + } + Map params = new HashMap(); + params.put("templateType", new String[]{templateType}); + params.put("fileName", new String[]{fileName}); + String sign = yozoUtil.generateSign(YozoParams.APP_ID, YozoParams.APP_KEY, params).getData(); + String url = YozoParams.CLOUD_DOMAIN + "/api/file/template?templateType=" + templateType + + "&fileName=" + fileName + + "&appId=" + YozoParams.APP_ID + + "&sign=" + sign; + String s = HttpUtil.sendHttpPost(url); + Map maps = JSONObject.parseObject(s, Map.class); + Map fileMap = (Map) maps.get("data"); + String fileVersionId = fileMap.get("fileVersionId"); + String fileId = fileMap.get("fileId"); + ActionResult back = yozoService.saveFileId(fileVersionId, fileId, fileNa); + //在本地新建文件 + FileUtil.createFile(configValueUtil.getDocumentPreviewPath(), fileNa); + return back; + } + + @GetMapping("/uploadByHttp") + @Operation(summary = "http上传文件") + @Parameters({ + @Parameter(name = "fileUrl", description = "路径"), + }) + public ActionResult uploadByHttp(@RequestParam("fileUrl") String fileUrl) { + //获取签名 + Map params = new HashMap(); + params.put("fileUrl", new String[]{fileUrl}); + String sign = yozoUtil.generateSign(YozoParams.APP_ID, YozoParams.APP_KEY, params).getData(); + String url = YozoParams.CLOUD_DOMAIN + "/api/file/http?fileUrl=" + fileUrl + + "&appId=" + YozoParams.APP_ID + + "&sign=" + sign; + String s = HttpUtil.sendHttpPost(url); + Map maps = JSONObject.parseObject(s, Map.class); + Map fileMap = (Map) maps.get("data"); + String fileVersionId = fileMap.get("fileVersionId"); + String fileId = fileMap.get("fileId"); + ActionResult back = yozoService.saveFileIdByHttp(fileVersionId, fileId, fileUrl); + return back; + } + + @GetMapping("/downloadFile") + @Operation(summary = "永中下载文件") + @Parameters({ + @Parameter(name = "fileVersionId", description = "主键"), + }) + public String downloadFile(@RequestParam("fileVersionId") String fileVersionId) { + String newFileVersionId = XSSEscape.escape(fileVersionId); + FileEntity fileEntity = yozoService.selectByVersionId(newFileVersionId); + if (fileEntity == null) { + return MsgCode.FA044.get(); + } + //获取签名 + Map params = new HashMap(); + params.put("fileVersionId", new String[]{newFileVersionId}); + String sign = yozoUtil.generateSign(YozoParams.APP_ID, YozoParams.APP_KEY, params).getData(); + String url = YozoParams.CLOUD_DOMAIN + "/api/file/download?fileVersionId=" + newFileVersionId + + "&appId=" + YozoParams.APP_ID + + "&sign=" + sign; + return url; + } + + + @GetMapping("/deleteVersionFile") + @Operation(summary = "删除文件版本") + @Parameters({ + @Parameter(name = "fileVersionId", description = "主键"), + }) + public ActionResult deleteVersion(@RequestParam("fileVersionId") String fileVersionId) { + //获取签名 + Map params = new HashMap(); + params.put("fileVersionId", new String[]{fileVersionId}); + String sign = yozoUtil.generateSign(YozoParams.APP_ID, YozoParams.APP_KEY, params).getData(); + String url = YozoParams.CLOUD_DOMAIN + "/api/file/delete/version?fileVersionId=" + fileVersionId + + "&appId=" + YozoParams.APP_ID + + "&sign=" + sign; + String s = HttpUtil.sendHttpGet(url); + Map maps = JSONObject.parseObject(s, Map.class); + String fileName = yozoService.selectByVersionId(fileVersionId).getFileName(); + String path = configValueUtil.getDocumentPreviewPath() + fileName; + if (FileUtil.fileIsFile(path)) { + File file = new File(XSSEscape.escapePath(path)); + file.delete(); + } + String versionId = (String) maps.get("data"); + ActionResult back = yozoService.deleteFileByVersionId(versionId); + return back; + } + + @GetMapping("/batchDelete") + @Operation(summary = "批量删除文件版本") + @Parameters({ + @Parameter(name = "fileVersionIds", description = "主键"), + }) + public ActionResult batchDelete(@RequestParam("fileVersionIds") String[] fileVersionIds) { + List asList = new ArrayList<>(16); + //获取签名 + for (String fileVersionId : fileVersionIds) { + String escape = XSSEscape.escape(fileVersionId); + asList.add(escape); + } + String[] newFileVersionIds = asList.toArray(fileVersionIds); + Map params = new HashMap<>(); + params.put("fileVersionIds", newFileVersionIds); + String sign = yozoUtil.generateSign(YozoParams.APP_ID, YozoParams.APP_KEY, params).getData(); + + StringBuilder fileVersionIdList = new StringBuilder(); + for (String s : newFileVersionIds) { + String fileName = yozoService.selectByVersionId(s).getFileName(); + String path = configValueUtil.getDocumentPreviewPath() + fileName; + File file = new File(XSSEscape.escapePath(path)); + file.delete(); + fileVersionIdList.append("fileVersionIds=" + s + "&"); + } + String list = fileVersionIdList.toString(); + String url = YozoParams.CLOUD_DOMAIN + "/api/file/delete/versions?" + list + + "appId=" + YozoParams.APP_ID + + "&sign=" + sign; + String s = HttpUtil.sendHttpGet(url); + ActionResult back = yozoService.deleteBatch(newFileVersionIds); + return back; + } + + @GetMapping("/editFile") + @Operation(summary = "在线编辑") + @Parameters({ + @Parameter(name = "fileVersionId", description = "主键"), + }) + public ActionResult editFile(@RequestParam("fileVersionId") String fileVersionId) { + String newFileVersionId = XSSEscape.escape(fileVersionId); + //获取签名 + Map params = new HashMap<>(); + params.put("fileVersionId", new String[]{newFileVersionId}); + String sign = yozoUtil.generateSign(YozoParams.APP_ID, YozoParams.APP_KEY, params).getData(); + String url = YozoParams.EDIT_DOMAIN + "/api/edit/file?fileVersionId=" + newFileVersionId + + "&appId=" + YozoParams.APP_ID + + "&sign=" + sign; + return ActionResult.success("success", url); + } + + /** + * 永中回调 + * + * @param oldFileId + * @param newFileId + * @param message + * @param errorCode + * @return + */ + @PostMapping("/3rd/edit/callBack") + @Parameters({ + @Parameter(name = "oldFileId", description = "主键"), + @Parameter(name = "newFileId", description = "主键"), + @Parameter(name = "message", description = "消息"), + @Parameter(name = "errorCode", description = "编码"), + }) + public Map editCallBack(@RequestParam("oldFileId") String oldFileId, @RequestParam("newFileId") String newFileId, @RequestParam("message") String message, @RequestParam("errorCode") Integer errorCode) { + + String escapeOldFileId = XSSEscape.escape(oldFileId); + String escapeNewFileId = XSSEscape.escape(newFileId); + String escapeMessage = XSSEscape.escape(message); + yozoService.editFileVersion(escapeOldFileId, escapeNewFileId); + + Map result = new HashMap<>(); + result.put("oldFileId", escapeOldFileId); + result.put("newFileId", escapeNewFileId); + result.put("message", escapeMessage); + result.put("errorCode", errorCode); + return result; + } + + @PostMapping("/documentList") + @Operation(summary = "文档列表") + @Parameters({ + @Parameter(name = "pageModel", description = "分页模型", required = true), + }) + public ActionResult documentList(@RequestBody PaginationVO pageModel) { + PaginationVO pv = new PaginationVO(); + pv.setCurrentPage(pageModel.getCurrentPage()); + pv.setPageSize(pageModel.getPageSize()); + pv.setTotal(pageModel.getTotal()); + List list = yozoService.getAllList(pv); + List listVo = JsonUtil.getJsonToList(list, FileForm.class); + return ActionResult.page(listVo, pv); + } + + /** + * 传入新的fileVersionId同步 + * + * @param fileVersionId + * @return + * @throws Exception + */ + @GetMapping("/updateFile") + @Operation(summary = "/同步文件版本到本地") + @Parameters({ + @Parameter(name = "fileVersionId", description = "主键"), + }) + public ActionResult updateFile(@RequestParam("fileVersionId") String fileVersionId) throws Exception { + FileEntity fileEntity = yozoService.selectByVersionId(fileVersionId); + String fileName = fileEntity.getFileName(); + String path = configValueUtil.getDocumentPreviewPath() + fileName; + if (FileUtil.fileIsFile(path)) { + File file = new File(XSSEscape.escapePath(path)); + file.delete(); + } + String fileUrl = this.downloadFile(fileVersionId); + yozoUtil.downloadFile(fileUrl, path); + return ActionResult.success(MsgCode.SU004.get()); + } +} + diff --git a/yunzhupaas-file/yunzhupaas-file-entity/pom.xml b/yunzhupaas-file/yunzhupaas-file-entity/pom.xml new file mode 100644 index 0000000..9746ec1 --- /dev/null +++ b/yunzhupaas-file/yunzhupaas-file-entity/pom.xml @@ -0,0 +1,23 @@ + + + + yunzhupaas-file + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-file-entity + + + + com.yunzhupaas + yunzhupaas-common-all + ${project.version} + compile + + + + diff --git a/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/entity/FileEntity.java b/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/entity/FileEntity.java new file mode 100644 index 0000000..0302fe4 --- /dev/null +++ b/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/entity/FileEntity.java @@ -0,0 +1,44 @@ +package com.yunzhupaas.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +/** + * @author YUNZHUPAAS + */ +@Data +@TableName("base_file") +public class FileEntity extends SuperExtendEntity { + + /** + * 文件编辑版本 + */ + @TableField("f_file_version") + private String fileVersionId; + + /** + * 文件名 + */ + @TableField("f_file_name") + private String fileName; + + /** + * 文件上传方式 + */ + @TableField("f_type") + private String type; + + /** + * 上传的url + */ + @TableField("f_url") + private String url; + + /** + * 上次文件版本 + */ + @TableField("f_old_file_version_id") + private String oldFileVersionId; +} diff --git a/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/enums/FilePreviewTypeEnum.java b/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/enums/FilePreviewTypeEnum.java new file mode 100644 index 0000000..b339ecd --- /dev/null +++ b/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/enums/FilePreviewTypeEnum.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.enums; +/** + * 文件预览方式 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2021/5/6 + */ +public enum FilePreviewTypeEnum { + /** + * yozo:永中预览; doc:kk文档预览; + */ + YOZO_ONLINE_PREVIEW("yozoOnlinePreview"), + LOCAL_PREVIEW("localPreview"); + FilePreviewTypeEnum(String type) { + this.type = type; + } + private String type; + + public String getType() { + return type; + } +} + diff --git a/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/model/Chunk.java b/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/model/Chunk.java new file mode 100644 index 0000000..a161430 --- /dev/null +++ b/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/model/Chunk.java @@ -0,0 +1,60 @@ +package com.yunzhupaas.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class Chunk implements Serializable { + /** + * 当前文件块,从1开始 + */ + @Schema(description = "当前文件块") + private Integer chunkNumber; + /** + * 分块大小 + */ + @Schema(description = "分块大小") + private Long chunkSize; + /** + * 当前分块大小 + */ + @Schema(description = "当前分块大小") + private Long currentChunkSize; + /** + * 总大小 + */ + @Schema(description = "总大小") + private Long totalSize; + /** + * 文件标识 + */ + @Schema(description = "文件标识") + private String identifier; + /** + * 文件名 + */ + @Schema(description = "文件名") + private String fileName; + /** + * 相对路径 + */ + @Schema(description = "相对路径") + private String relativePath; + /** + * 总块数 + */ + @Schema(description = "总块数") + private Integer totalChunks; + /** + * 文件类型 + */ + @Schema(description = "文件类型") + private String type; + + private String extension; + + private String fileType; +} + diff --git a/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/model/ChunkRes.java b/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/model/ChunkRes.java new file mode 100644 index 0000000..aa34aae --- /dev/null +++ b/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/model/ChunkRes.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Builder; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Description: 分片上传响应 + * @date 2024/6/10 20:59 + */ +@Data +@Builder +public class ChunkRes implements Serializable { + + @Schema(description = "块数") + private List chunkNumbers = new ArrayList<>(); + + @Schema(description = "是否合并") + private Boolean merge; +} + diff --git a/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/model/FileForm.java b/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/model/FileForm.java new file mode 100644 index 0000000..5a07526 --- /dev/null +++ b/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/model/FileForm.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.model; + +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2021/5/14 + */ +@Data +public class FileForm { + private String fileId; + private String fileVersionId; + private String fileName; +} + diff --git a/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/model/LanguageVO.java b/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/model/LanguageVO.java new file mode 100644 index 0000000..5d05b95 --- /dev/null +++ b/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/model/LanguageVO.java @@ -0,0 +1,14 @@ +package com.yunzhupaas.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class LanguageVO { + @Schema(description ="语言编码") + private String encode; + @Schema(description ="语言名称") + private String fullName; +} + diff --git a/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/model/MergeChunkDto.java b/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/model/MergeChunkDto.java new file mode 100644 index 0000000..caf7752 --- /dev/null +++ b/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/model/MergeChunkDto.java @@ -0,0 +1,54 @@ +package com.yunzhupaas.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description: + * @date 2024/6/10 20:39 + */ +@Data +public class MergeChunkDto implements Serializable { + + @Schema(description = "名称") + private String fileName; + + @Schema(description = "分片") + private String identifier; + + @Schema(description = "文件大小") + private Long filesize; + + @Schema(description = "扩展") + private String extension; + + @Schema(description = "文件类型") + private String fileType; + + @Schema(description = "类型") + private String type; + + @Schema(description = "父级id") + private String parentId; + + /** + * 文件上传路径类型 + */ + @Schema(description = "文件上传路径类型") + private String pathType; + + @Schema(description = "文件上传路径规则") + private String sortRule; + + + @Schema(description = "时间存储格式") + private String timeFormat; + /** + * 文件路径,子级文件用“/”隔开,如:文件1/文件1-1 + */ + @Schema(description = "文件路径") + private String folder; +} + diff --git a/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/model/PathTypeModel.java b/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/model/PathTypeModel.java new file mode 100644 index 0000000..a693f59 --- /dev/null +++ b/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/model/PathTypeModel.java @@ -0,0 +1,28 @@ +package com.yunzhupaas.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * 文件上传路径配置模型 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-07-26 + */ +@Data +public class PathTypeModel implements Serializable{ + + private String pathType; + + private String sortRule; + + private String timeFormat; + + private String folder; + +} + diff --git a/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/model/PreviewParams.java b/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/model/PreviewParams.java new file mode 100644 index 0000000..88657e4 --- /dev/null +++ b/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/model/PreviewParams.java @@ -0,0 +1,23 @@ +package com.yunzhupaas.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.3 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2022/3/30 + */ +@Data +public class PreviewParams { + @Schema(description = "文件名") + private String fileName; + @Schema(description = "预览文件id") + private String fileVersionId; + @Schema(description = "文件下载路径") + private String fileDownloadUrl; +} + diff --git a/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/model/SuffixParams.java b/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/model/SuffixParams.java new file mode 100644 index 0000000..52fb1ad --- /dev/null +++ b/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/model/SuffixParams.java @@ -0,0 +1,50 @@ +package com.yunzhupaas.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 预览文件相关参数 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2021/5/6 + */ +@Data +public class SuffixParams { + /** + * 是否强制重新转换(忽略缓存),true为强制重新转换,false为不强制重新转换。 + */ + @Schema(description = "是否强制重新转换") + private Boolean noCache; + + /** + * 针对单文档设置水印内容。 + */ + @Schema(description = "设置水印内容") + private String watermark; + + /** + * 0否1是,默认为0。针对单文档设置是否防复制 + */ + @Schema(description = "是否防复制") + private Integer isCopy; + + /** + * 试读功能(转换页数的起始页和转换页数的终止页,拥有对应权限的域名才能调用) + */ + @Schema(description = "开始") + private Integer pageStart; + + @Schema(description = "结束") + private Integer pageEnd; + + /** + * 用于无文件后缀链接,指定预览文件后缀名 + */ + @Schema(description = "文件后缀链接") + private String type; + +} + diff --git a/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/model/UploaderVO.java b/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/model/UploaderVO.java new file mode 100644 index 0000000..601fc88 --- /dev/null +++ b/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/model/UploaderVO.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Builder; +import lombok.Data; + +@Data +@Builder +public class UploaderVO { + @Schema(description ="名称") + private String name; + @Schema(description ="请求接口") + private String url; + @Schema(description ="预览文件id") + private String fileVersionId; + @Schema(description ="文件大小") + private Long fileSize; + @Schema(description ="文件后缀") + private String fileExtension; + @Schema(description ="缩略图") + private String thumbUrl; +} + diff --git a/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/model/YozoFileParams.java b/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/model/YozoFileParams.java new file mode 100644 index 0000000..295f07a --- /dev/null +++ b/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/model/YozoFileParams.java @@ -0,0 +1,47 @@ +package com.yunzhupaas.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * @author YUNZHUPAAS + */ +@Data +public class YozoFileParams { + @Schema(description = "路径") + private String url; + + /** + * 是否强制重新转换(忽略缓存),true为强制重新转换,false为不强制重新转换。 + */ + @Schema(description = "是否强制重新转换") + private Boolean noCache; + + /** + * 针对单文档设置水印内容。 + */ + @Schema(description = "设置水印内容") + private String watermark; + + /** + * 0否1是,默认为0。针对单文档设置是否防复制 + */ + @Schema(description = "是否防复制") + private Integer isCopy; + + /** + * 试读功能(转换页数的起始页和转换页数的终止页,拥有对应权限的域名才能调用) + */ + @Schema(description = "开始") + private Integer pageStart; + + @Schema(description = "结束") + private Integer pageEnd; + + /** + * 用于无文件后缀链接,指定预览文件后缀名 + */ + @Schema(description = "文件后缀链接") + private String type; + +} diff --git a/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/model/YozoParams.java b/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/model/YozoParams.java new file mode 100644 index 0000000..aae3678 --- /dev/null +++ b/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/model/YozoParams.java @@ -0,0 +1,54 @@ +package com.yunzhupaas.model; + +import lombok.Data; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +/** + * @author YUNZHUPAAS + */ +@Data +@Component +public class YozoParams implements InitializingBean { + + @Value("${config.YozoDomainKey}") + private String domainKey; + + @Value("${config.YozoDomain}") + private String domain; + + @Value("${config.YozoCloudDomain}") + private String cloudDomain; + + @Value("${config.YozoAppId}") + private String appId; + + @Value("${config.YozoAppKey}") + private String appKey; + + @Value("${config.YozoEditDomain}") + private String editDomain; + + @Value("${config.ApiDomain}") + private String yunzhupaasDomain; + + public static String DOMAIN_KEY; + public static String DOMAIN; + public static String CLOUD_DOMAIN; + public static String APP_ID; + public static String APP_KEY; + public static String EDIT_DOMAIN; + public static String YUNZHUPAAS_DOMAINS; + + @Override + public void afterPropertiesSet() throws Exception { + DOMAIN = domain; + DOMAIN_KEY = domainKey; + CLOUD_DOMAIN = cloudDomain; + APP_ID = appId; + APP_KEY = appKey; + EDIT_DOMAIN = editDomain; + YUNZHUPAAS_DOMAINS = yunzhupaasDomain; + } +} diff --git a/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/utils/SplicingUrlUtil.java b/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/utils/SplicingUrlUtil.java new file mode 100644 index 0000000..10e1944 --- /dev/null +++ b/yunzhupaas-file/yunzhupaas-file-entity/src/main/java/com/yunzhupaas/utils/SplicingUrlUtil.java @@ -0,0 +1,45 @@ +package com.yunzhupaas.utils; + +import com.yunzhupaas.model.YozoFileParams; +import com.yunzhupaas.model.YozoParams; +import com.yunzhupaas.util.XSSEscape; +import org.springframework.util.StringUtils; + +/** + * @author 云筑产品开发平台组 + */ +public class SplicingUrlUtil { + /** + * 永中预览url拼接 + * @param params + * @return + */ + public static String getPreviewUrl(YozoFileParams params) { + StringBuilder paramsUrl = new StringBuilder(); + if (!StringUtils.isEmpty(params.getNoCache())) { + paramsUrl.append("&noCache=" + params.getNoCache()); + } + if (!StringUtils.isEmpty(params.getWatermark())) { + String watermark = XSSEscape.escape(params.getWatermark()); + paramsUrl.append("&watermark=" + watermark); + } + if (!StringUtils.isEmpty(params.getIsCopy())) { + paramsUrl.append("&isCopy=" + params.getIsCopy()); + } + if (!StringUtils.isEmpty(params.getPageStart())) { + paramsUrl.append("&pageStart=" + params.getPageStart()); + } + if (!StringUtils.isEmpty(params.getPageEnd())) { + paramsUrl.append("&pageEnd=" + params.getPageEnd()); + } + if (!StringUtils.isEmpty(params.getType())) { + String type = XSSEscape.escape(params.getType()); + paramsUrl.append("&type=" + type); + } + String s = paramsUrl.toString(); + String previewUrl= YozoParams.DOMAIN+"?k=" + YozoParams.DOMAIN_KEY + "&url=" + params.getUrl() + s; + return previewUrl; + } + +} + diff --git a/yunzhupaas-flowable/pom.xml b/yunzhupaas-flowable/pom.xml new file mode 100644 index 0000000..bf07f88 --- /dev/null +++ b/yunzhupaas-flowable/pom.xml @@ -0,0 +1,21 @@ + + + + yunzhupaas-java-boot + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-flowable + pom + + yunzhupaas-flowable-entity + yunzhupaas-flowable-controller + yunzhupaas-flowable-biz + + + + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/pom.xml b/yunzhupaas-flowable/yunzhupaas-flowable-biz/pom.xml new file mode 100644 index 0000000..4d353f6 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/pom.xml @@ -0,0 +1,52 @@ + + + + yunzhupaas-flowable + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-flowable-biz + + + + com.yunzhupaas + yunzhupaas-flowable-entity + ${project.version} + + + com.yunzhupaas + yunzhupaas-provider + ${project.version} + + + com.yunzhupaas + yunzhupaas-generater-base + ${project.version} + + + com.yunzhupaas + yunzhupaas-system-biz + ${project.version} + + + com.yunzhupaas + yunzhupaas-permission-biz + ${project.version} + + + com.yunzhupaas + yunzhupaas-visualdev-base-biz + ${project.version} + + + + com.yunzhupaas + yunzhupaas-common-security + ${project.version} + + + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/job/AutoAuditJob.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/job/AutoAuditJob.java new file mode 100644 index 0000000..6f19839 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/job/AutoAuditJob.java @@ -0,0 +1,156 @@ +package com.yunzhupaas.flowable.job; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.OperatorEntity; +import com.yunzhupaas.flowable.entity.TaskEntity; +import com.yunzhupaas.flowable.model.task.FlowMethod; +import com.yunzhupaas.flowable.model.task.FlowModel; +import com.yunzhupaas.flowable.model.templatenode.nodejson.NodeModel; +import com.yunzhupaas.flowable.model.time.FlowTimeModel; +import com.yunzhupaas.flowable.service.OperatorService; +import com.yunzhupaas.flowable.service.TaskService; +import com.yunzhupaas.flowable.util.*; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.util.RedisUtil; +import com.yunzhupaas.util.context.SpringContext; +import lombok.extern.slf4j.Slf4j; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; +import org.springframework.scheduling.quartz.QuartzJobBean; + +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/23 17:42 + */ +@Slf4j +public class AutoAuditJob extends QuartzJobBean { + + private static RedisUtil redisUtil; + private static ConfigValueUtil configValueUtil; + private static OperatorService operatorService; + private static ConditionService conditionService; + private static TaskUtil taskUtil; + private static TaskService taskService; + private static ServiceUtil serviceUtil; + private static OperatorUtil operatorUtil; + + static { + redisUtil = SpringContext.getBean(RedisUtil.class); + configValueUtil = SpringContext.getBean(ConfigValueUtil.class); + operatorService = SpringContext.getBean(OperatorService.class); + conditionService = SpringContext.getBean(ConditionService.class); + taskUtil = SpringContext.getBean(TaskUtil.class); + taskService = SpringContext.getBean(TaskService.class); + serviceUtil = SpringContext.getBean(ServiceUtil.class); + operatorUtil = SpringContext.getBean(OperatorUtil.class); + } + + @Override + protected void executeInternal(JobExecutionContext context) throws JobExecutionException { + List list = FlowJobUtil.getOperator(redisUtil); + if (CollectionUtil.isNotEmpty(list)) { + for (FlowTimeModel timeModel : list) { + FlowModel flowModel = timeModel.getFlowModel(); + Map formData = flowModel.getFormData(); + String deploymentId = flowModel.getDeploymentId(); + Map nodes = flowModel.getNodes(); + + UserInfo userInfo = flowModel.getUserInfo(); + if (configValueUtil.isMultiTenancy()) { + TenantDataSourceUtil.switchTenant(userInfo.getTenantId()); + } + + TaskEntity taskEntity = taskService.getById(timeModel.getTaskId()); + if (null == taskEntity) { + taskEntity = flowModel.getTaskEntity(); + } + + String operatorId = timeModel.getOperatorId(); + try { + OperatorEntity operator = operatorService.getInfo(operatorId); + if (null != operator) { + flowModel.setTaskEntity(taskEntity); + if (operator.getSignTime() == null) { + operator.setSignTime(new Date()); + } + if (operator.getStartHandleTime() == null) { + operator.setStartHandleTime(new Date()); + } + FlowMethod flowMethod = new FlowMethod(); + flowMethod.setTaskEntity(taskEntity); + flowMethod.setFormData(formData == null ? new HashMap<>() : formData); + flowMethod.setDeploymentId(deploymentId); + flowMethod.setNodeCode(operator.getNodeCode()); + flowMethod.setNodes(nodes); + // 判断节点的线的条件 + Map resMap = conditionService.handleCondition(flowMethod); + try { + conditionService.checkCondition(resMap, nodes); + } catch (WorkFlowException e) { + continue; + } + List nextApprover; + boolean mark = true; + try { + nextApprover = taskUtil.getNextApprover(flowMethod); + } catch (WorkFlowException e) { + nextApprover = null; + mark = false; + } + if (!mark) { + continue; + } + NodeModel nodeModel = nodes.get(operator.getNodeCode()); + if (!taskUtil.checkBranch(nodeModel) && taskUtil.checkNextCandidates(nextApprover) + && taskUtil.checkNextError(flowModel, nextApprover, false, false) == 0) { + String handleId = operator.getHandleId(); + String username = ""; + UserEntity user = serviceUtil.getUserInfo(handleId); + if (user != null) { + username = user.getAccount() + "(" + user.getRealName() + ")"; + } + String str = ObjectUtil.equals(operator.getIsProcessing(), 0) ? "自动审批通过" : "自动办理通过"; + flowModel.setHandleOpinion(username + str); + UserEntity userEntity = serviceUtil.getUserInfo(operator.getHandleId()); + if (null != userEntity) { + userInfo.setUserId(userEntity.getId()); + userInfo.setUserName(userEntity.getRealName()); + userInfo.setUserAccount(userEntity.getAccount()); + } + operatorService.auditWithCheck(operator.getId(), flowModel); + operatorUtil.handleEvent(); + List operatorList = flowModel.getList(); + if (CollectionUtil.isNotEmpty(operatorList)) { + TimeUtil.timeModel(operatorList, flowModel, redisUtil); + } + } + } + } catch (Exception e) { + log.error("超时自动审批异常", e); + try { + operatorUtil.compensate(taskEntity); + } catch (Exception ex) { + log.error("超时自动审批补偿异常", ex); + } + } finally { + // TimeUtil.deleteJob(timeModel.getId()); + FlowJobUtil.remove(timeModel, redisUtil); + } + } + } + + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/job/AutoTransferJob.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/job/AutoTransferJob.java new file mode 100644 index 0000000..dd71a62 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/job/AutoTransferJob.java @@ -0,0 +1,232 @@ +package com.yunzhupaas.flowable.job; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.flowable.entity.OperatorEntity; +import com.yunzhupaas.flowable.entity.RecordEntity; +import com.yunzhupaas.flowable.entity.TaskEntity; +import com.yunzhupaas.flowable.enums.OperatorStateEnum; +import com.yunzhupaas.flowable.model.task.FlowModel; +import com.yunzhupaas.flowable.model.templatenode.nodejson.NodeModel; +import com.yunzhupaas.flowable.model.templatenode.nodejson.TemplateJsonModel; +import com.yunzhupaas.flowable.model.templatenode.nodejson.TimeConfig; +import com.yunzhupaas.flowable.model.time.FlowTimeModel; +import com.yunzhupaas.flowable.service.OperatorService; +import com.yunzhupaas.flowable.service.TaskService; +import com.yunzhupaas.flowable.util.*; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.util.AuthUtil; +import com.yunzhupaas.util.RedisUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import com.yunzhupaas.util.context.SpringContext; +import lombok.extern.slf4j.Slf4j; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; +import org.springframework.scheduling.quartz.QuartzJobBean; + +import java.util.*; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/12/10 9:17 + */ +@Slf4j +public class AutoTransferJob extends QuartzJobBean { + private static RedisUtil redisUtil; + private static ConfigValueUtil configValueUtil; + private static OperatorService operatorService; + private static TaskUtil taskUtil; + private static TaskService taskService; + private static ServiceUtil serviceUtil; + private static MsgUtil msgUtil; + private static RedisLock redisLock; + + static { + redisUtil = SpringContext.getBean(RedisUtil.class); + configValueUtil = SpringContext.getBean(ConfigValueUtil.class); + operatorService = SpringContext.getBean(OperatorService.class); + taskUtil = SpringContext.getBean(TaskUtil.class); + taskService = SpringContext.getBean(TaskService.class); + serviceUtil = SpringContext.getBean(ServiceUtil.class); + msgUtil = SpringContext.getBean(MsgUtil.class); + redisLock = SpringContext.getBean(RedisLock.class); + } + + @Override + protected void executeInternal(JobExecutionContext context) throws JobExecutionException { + List list = FlowJobUtil.getTransfer(redisUtil); + if (CollectionUtil.isNotEmpty(list)) { + Set nodeCodes = new TreeSet<>(); + for (FlowTimeModel timeModel : list) { + FlowModel flowModel = timeModel.getFlowModel(); + + UserInfo userInfo = flowModel.getUserInfo(); + if (configValueUtil.isMultiTenancy()) { + TenantDataSourceUtil.switchTenant(userInfo.getTenantId()); + } + + String operatorId = timeModel.getOperatorId(); + + boolean lock = redisLock.lock("transfer-" + operatorId, operatorId, 2, TimeUnit.SECONDS); + if (!lock) + continue; + + String nodeCode = flowModel.getNodeCode(); + + Map formData = flowModel.getFormData(); + Map nodes = flowModel.getNodes(); + + NodeModel nodeModel = nodes.get(nodeCode); + TimeConfig config = nodeModel.getOverTimeConfig(); + + if (ObjectUtil.equals(config.getOverTimeType(), 6) || ObjectUtil.equals(config.getOverTimeType(), 9)) { + if (nodeCodes.contains(flowModel.getNodeCode())) { + log.info("自动转审失败,该经办已处理(id:" + operatorId + ",code:" + nodeCode + ")"); + FlowJobUtil.removeTransfer(timeModel, redisUtil); + continue; + } + nodeCodes.add(nodeCode); + } + OperatorEntity operator = operatorService.getById(operatorId); + if (null == operator || operator.getHandleStatus() != null) { + TimeUtil.deleteJob(timeModel.getId()); + FlowJobUtil.remove(timeModel, redisUtil); + continue; + } + if (ObjectUtil.equals(operator.getStatus(), OperatorStateEnum.Transfer.getCode())) { + log.info("转审状态的经办,不执行: " + operator.getId()); + FlowJobUtil.removeTransfer(timeModel, redisUtil); + continue; + } + // 指派类型的转审,判断整个节点 是否存在转审类型的经办 + if (ObjectUtil.equals(config.getOverTimeType(), 6) || ObjectUtil.equals(config.getOverTimeType(), 9)) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OperatorEntity::getTaskId, operator.getTaskId()) + .eq(OperatorEntity::getNodeId, operator.getNodeId()) + .eq(OperatorEntity::getStatus, OperatorStateEnum.Transfer.getCode()); + long count = operatorService.count(queryWrapper); + if (count > 0) { + log.info("节点存在转审状态的经办,不执行: " + operator.getId() + " " + operator.getNodeId()); + FlowJobUtil.removeTransfer(timeModel, redisUtil); + continue; + } + } + + String userId = operator.getHandleId(); + if (!ObjectUtil.equals(userInfo.getUserId(), userId)) { + String token = AuthUtil.loginTempUser(userId, userInfo.getTenantId()); + userInfo = UserProvider.getUser(token); + UserProvider.setLoginUser(userInfo); + flowModel.setUserInfo(userInfo); + } + UserProvider.setLocalLoginUser(userInfo); + + try { + TaskEntity taskEntity = taskService.getById(operator.getTaskId()); + if (null == taskEntity) { + taskEntity = flowModel.getTaskEntity(); + } + String handleIds = null; + if (ObjectUtil.equals(config.getOverTimeType(), 6)) { + // 指定人员 + // 349057407209541--user + if (CollectionUtil.isNotEmpty(config.getReApprovers())) { + String handleId = config.getReApprovers().get(0).split("--")[0]; + UserEntity userEntity = serviceUtil.getUserInfo(handleId); + if (!ObjectUtil.equals(userId, handleId) && null != userEntity + && ObjectUtil.equals(userEntity.getEnabledMark(), 1)) { + handleIds = handleId; + } + } + if (StringUtil.isNotEmpty(handleIds)) { + flowModel.setHandleIds(handleIds); + flowModel.setAutoTransferFlag(true); + taskService.assign(operator.getTaskId(), flowModel); + this.delete(timeModel); + } + } else if (ObjectUtil.equals(config.getOverTimeType(), 9)) { + // 接口 + String interfaceId = config.getInterfaceId(); + List templateJson = config.getTemplateJson(); + if (StringUtil.isNotEmpty(interfaceId)) { + RecordEntity record = new RecordEntity(); + record.setTaskId(taskEntity.getId()); + record.setNodeCode(operator.getNodeCode()); + record.setHandleId(operator.getHandleId()); + + // UserEntity createUser = + // serviceUtil.getUserInfo(taskEntity.getCreatorUserId()); + // UserEntity delegate = StringUtil.isNotEmpty(taskEntity.getDelegateUserId()) ? + // serviceUtil.getUserInfo(taskEntity.getDelegateUserId()) : null; + + Map parameterMap = msgUtil.parameterMap(formData, templateJson, record, + taskEntity); + ActionResult result = serviceUtil.infoToId(interfaceId, parameterMap); + if (Objects.equals(200, result.getCode())) { + Object data = result.getData(); + if (data instanceof Map) { + JSONObject map = new JSONObject((Map) data); + List handleId = StringUtil.isNotEmpty(map.getString("handleId")) + ? Arrays.asList(map.getString("handleId").split(",")) + : new ArrayList<>(); + handleId = serviceUtil.getUserName(handleId, true) + .stream().map(UserEntity::getId).filter(e -> !ObjectUtil.equals(userId, e)) + .sorted().collect(Collectors.toList()); + handleIds = CollectionUtil.isNotEmpty(handleId) ? handleId.get(0) : null; + } + } + if (StringUtil.isNotEmpty(handleIds)) { + flowModel.setHandleIds(handleIds); + flowModel.setAutoTransferFlag(true); + taskService.assign(operator.getTaskId(), flowModel); + this.delete(timeModel); + } + } + } else { + // 超时审批人,2.同一部门 7.同一角色 3.同一岗位 8.同一分组 + UserEntity userEntity = serviceUtil.getUserInfo(userId); + if (null != userEntity) { + Integer overTimeExtraRule = config.getOverTimeExtraRule(); + List userIds = new ArrayList<>(); + taskUtil.getByRule(userIds, userEntity, overTimeExtraRule); + userIds = serviceUtil.getUserName(userIds, true) + .stream().map(UserEntity::getId).filter(e -> !ObjectUtil.equals(userId, e)).sorted() + .collect(Collectors.toList()); + if (CollectionUtil.isNotEmpty(userIds)) { + handleIds = userIds.get(0); + } + } + if (StringUtil.isNotEmpty(handleIds)) { + flowModel.setHandleIds(handleIds); + operatorService.transfer(operatorId, flowModel); + this.delete(timeModel); + } + } + + } catch (Exception e) { + log.error("超时自动转审异常", e); + this.delete(timeModel); + } finally { + FlowJobUtil.removeTransfer(timeModel, redisUtil); + } + } + } + } + + private void delete(FlowTimeModel timeModel) { + TimeUtil.deleteJob(timeModel.getId()); + FlowJobUtil.remove(timeModel, redisUtil); + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/job/FlowJobConfig.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/job/FlowJobConfig.java new file mode 100644 index 0000000..45b391a --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/job/FlowJobConfig.java @@ -0,0 +1,53 @@ +package com.yunzhupaas.flowable.job; + +import org.quartz.*; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/23 18:16 + */ +@Configuration +public class FlowJobConfig { + @Bean + public JobDetail autoAuditDetail() { + JobDetail jobDetail = JobBuilder.newJob(AutoAuditJob.class) + .storeDurably() // 必须调用该方法,添加任务 + .build(); + return jobDetail; + } + + @Bean + public Trigger autoAuditTrigger() { + // 任务频率 + CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule("0/5 * * * * ?"); + CronTrigger trigger = TriggerBuilder.newTrigger() + .forJob(autoAuditDetail()) + .withSchedule(cronScheduleBuilder) + .build(); + return trigger; + } + + @Bean + public JobDetail autoTransferDetail() { + JobDetail jobDetail = JobBuilder.newJob(AutoTransferJob.class) + .storeDurably() // 必须调用该方法,添加任务 + .build(); + return jobDetail; + } + + @Bean + public Trigger autoTransferTrigger() { + // 任务频率 + CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule("0/8 * * * * ?"); + CronTrigger trigger = TriggerBuilder.newTrigger() + .forJob(autoTransferDetail()) + .withSchedule(cronScheduleBuilder) + .build(); + return trigger; + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/job/FlowJobUtil.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/job/FlowJobUtil.java new file mode 100644 index 0000000..c10a759 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/job/FlowJobUtil.java @@ -0,0 +1,118 @@ +package com.yunzhupaas.flowable.job; + +import cn.hutool.core.collection.CollectionUtil; +import com.yunzhupaas.flowable.model.time.FlowTimeModel; +import com.yunzhupaas.flowable.util.TimeUtil; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RedisUtil; +import com.yunzhupaas.util.StringUtil; +import lombok.extern.slf4j.Slf4j; + +import java.util.ArrayList; +import java.util.List; + + +/** + * @author 云筑产品开发平台组 + * @version V3.3.0 flowable + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/15 17:37 + */ +@Slf4j +public class FlowJobUtil { + /** + * 自动审批 + */ + public static final String OPERATOR_REDIS_KEY = "flowable_OperatorList"; + + /** + * 自动转审 + */ + public static final String OPERATOR_TRANSFER = "flowable_transfer"; + + /** + * 超时 + */ + public static final String TIME_REDIS_KEY = "flowable_TimeModel"; + + /** + * 提醒 + */ + public static final String NOTICE_REDIS_KEY = "flowable_NoticeModel"; + + public static FlowTimeModel getModel(FlowTimeModel model, RedisUtil redisUtil) { + String id = model.getOperatorId(); + String hashValues = redisUtil.getHashValues(model.getOverTime() ? TIME_REDIS_KEY : NOTICE_REDIS_KEY, id); + FlowTimeModel integrateModel = StringUtil.isNotEmpty(hashValues) ? JsonUtil.getJsonToBean(hashValues, FlowTimeModel.class) : null; + return integrateModel; + } + + public static void insertModel(FlowTimeModel model, RedisUtil redisUtil) { + String integrateId = model.getOperatorId(); + redisUtil.insertHash(model.getOverTime() ? TIME_REDIS_KEY : NOTICE_REDIS_KEY, integrateId, JsonUtil.getObjectToString(model)); + } + + public static void removeModel(FlowTimeModel model, RedisUtil redisUtil) { + redisUtil.removeHash(model.getOverTime() ? TIME_REDIS_KEY : NOTICE_REDIS_KEY, model.getOperatorId()); + } + + public static void insertOperator(FlowTimeModel model, RedisUtil redisUtil) { + redisUtil.insertHash(OPERATOR_REDIS_KEY, model.getOperatorId(), JsonUtil.getObjectToString(model)); + } + + public static void remove(FlowTimeModel model, RedisUtil redisUtil) { + redisUtil.removeHash(OPERATOR_TRANSFER, model.getOperatorId()); + redisUtil.removeHash(OPERATOR_REDIS_KEY, model.getOperatorId()); + redisUtil.removeHash(TIME_REDIS_KEY, model.getOperatorId()); + redisUtil.removeHash(NOTICE_REDIS_KEY, model.getOperatorId()); + } + + public static void removeTransfer(FlowTimeModel model, RedisUtil redisUtil) { + redisUtil.removeHash(OPERATOR_TRANSFER, model.getOperatorId()); + } + + public static List getOperator(RedisUtil redisUtil) { + List list = new ArrayList<>(); + List hashValues = redisUtil.getHashValues(OPERATOR_REDIS_KEY); + if (CollectionUtil.isNotEmpty(hashValues)) { + for (String hashValue : hashValues) { + FlowTimeModel integrateModel = StringUtil.isNotEmpty(hashValue) ? JsonUtil.getJsonToBean(hashValue, FlowTimeModel.class) : null; + list.add(integrateModel); + } + } + return list; + } + + public static void insertTransfer(FlowTimeModel model, RedisUtil redisUtil) { + redisUtil.insertHash(OPERATOR_TRANSFER, model.getOperatorId(), JsonUtil.getObjectToString(model)); + } + + public static List getTransfer(RedisUtil redisUtil) { + List list = new ArrayList<>(); + List hashValues = redisUtil.getHashValues(OPERATOR_TRANSFER); + if (CollectionUtil.isNotEmpty(hashValues)) { + for (String hashValue : hashValues) { + FlowTimeModel integrateModel = StringUtil.isNotEmpty(hashValue) ? JsonUtil.getJsonToBean(hashValue, FlowTimeModel.class) : null; + list.add(integrateModel); + } + } + return list; + } + + public static void deleteByOperatorId(String operatorId, RedisUtil redisUtil) { + FlowTimeModel timeModel = new FlowTimeModel(); + timeModel.setOperatorId(operatorId); + FlowTimeModel flowTimeModel = FlowJobUtil.getModel(timeModel, redisUtil); + if (null != flowTimeModel) { + TimeUtil.deleteJob(flowTimeModel.getId()); + FlowJobUtil.remove(flowTimeModel, redisUtil); + } + timeModel.setOverTime(true); + FlowTimeModel overTimeModel = FlowJobUtil.getModel(timeModel, redisUtil); + if (null != overTimeModel) { + TimeUtil.deleteJob(overTimeModel.getId()); + FlowJobUtil.remove(overTimeModel, redisUtil); + } + } +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/job/FlowTime.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/job/FlowTime.java new file mode 100644 index 0000000..c7a6dfd --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/job/FlowTime.java @@ -0,0 +1,90 @@ +package com.yunzhupaas.flowable.job; + +import cn.hutool.core.util.ObjectUtil; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.flowable.model.task.FlowModel; +import com.yunzhupaas.flowable.model.templatenode.nodejson.NodeModel; +import com.yunzhupaas.flowable.model.templatenode.nodejson.TimeConfig; +import com.yunzhupaas.flowable.model.time.FlowTimeModel; +import com.yunzhupaas.flowable.util.OverTimeUtil; +import com.yunzhupaas.flowable.util.TimeUtil; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RedisUtil; +import com.yunzhupaas.util.context.SpringContext; +import org.quartz.*; +import org.springframework.scheduling.quartz.QuartzJobBean; + + +@DisallowConcurrentExecution +public class FlowTime extends QuartzJobBean { + + private static RedisUtil redisUtil; + private static ConfigValueUtil configValueUtil; + private static OverTimeUtil overTimeUtil; + + + static { + redisUtil = SpringContext.getBean(RedisUtil.class); + configValueUtil = SpringContext.getBean(ConfigValueUtil.class); + overTimeUtil = SpringContext.getBean(OverTimeUtil.class); + } + + @Override + protected void executeInternal(JobExecutionContext context) throws JobExecutionException { + JobDetail jobDetail = context.getJobDetail(); + String jobName = jobDetail.getKey().getName(); + JobDataMap jobDataMap = jobDetail.getJobDataMap(); + FlowTimeModel model = FlowJobUtil.getModel(JsonUtil.getJsonToBean(jobDataMap, FlowTimeModel.class), redisUtil); + boolean isModel = model == null; + FlowTimeModel timeModel = isModel ? JsonUtil.getJsonToBean(jobDataMap, FlowTimeModel.class) : model; + if (timeModel != null) { + FlowModel flowModel = timeModel.getFlowModel(); + UserInfo userInfo = flowModel.getUserInfo(); + if (configValueUtil.isMultiTenancy()) { + TenantDataSourceUtil.switchTenant(userInfo.getTenantId()); + } + try { + overTimeUtil.overMsg(timeModel); + Boolean isPause = timeModel.getIsPause(); + timeModel.setIsPause(false); + boolean overTime = timeModel.getOverTime(); + FlowJobUtil.insertModel(timeModel, redisUtil); + if (overTime) { + if (isPause) { + return; + } + NodeModel nodeModel = timeModel.getChildNode(); + TimeConfig time = nodeModel.getOverTimeConfig(); + Integer num = time.getOverAutoApproveTime(); + Boolean overAutoApprove = timeModel.getChildNode().getOverTimeConfig().getOverAutoApprove(); + if (overAutoApprove && ObjectUtil.equals(timeModel.getNum(), num)) { + // 放在另一个redis的key(用于自动审批) + FlowJobUtil.insertOperator(timeModel, redisUtil); + } + Boolean overAutoTransfer = timeModel.getChildNode().getOverTimeConfig().getOverAutoTransfer(); + Integer transferNum = time.getOverAutoTransferTime(); + if (!overAutoApprove && overAutoTransfer && ObjectUtil.equals(timeModel.getTransferNum(), transferNum)) { + FlowJobUtil.insertTransfer(timeModel, redisUtil); + } + } else { + // 下一次时间大于结束时间 删除提醒缓存 + if (timeModel.getEndDate().getTime() < context.getNextFireTime().getTime()) { + FlowJobUtil.removeModel(timeModel, redisUtil); + TimeUtil.deleteJob(jobName); + } + } + } catch (Exception e) { + FlowJobUtil.removeModel(timeModel, redisUtil); + TimeUtil.deleteJob(jobName); + } + } else { + TimeUtil.deleteJob(jobName); + FlowJobUtil.removeModel(model, redisUtil); + } + } + + +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/job/JobRunner.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/job/JobRunner.java new file mode 100644 index 0000000..cad76e5 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/job/JobRunner.java @@ -0,0 +1,49 @@ +package com.yunzhupaas.flowable.job; + +import com.yunzhupaas.flowable.model.time.FlowTimeModel; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.RedisUtil; +import com.yunzhupaas.flowable.util.TimeUtil; +import org.quartz.JobDataMap; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.ApplicationArguments; +import org.springframework.boot.ApplicationRunner; + +import java.util.Date; +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/23 17:49 + */ +// @Component +public class JobRunner implements ApplicationRunner { + @Autowired + private RedisUtil redisUtil; + + @Override + public void run(ApplicationArguments args) throws Exception { + // 获取缓存中定时相关信息 + List list = FlowJobUtil.getOperator(redisUtil); + for (FlowTimeModel timeModel : list) { + Date date = new Date(); + // 判断当前时间是否已经 超过了结束时间 + if (date.getTime() > timeModel.getEndDate().getTime()) { + continue; + } + if (timeModel.getOn()) { + timeModel.setId(RandomUtil.uuId()); + JobDataMap jobDataMap = new JobDataMap(); + jobDataMap.putAll(JsonUtil.entityToMap(timeModel)); + FlowJobUtil.insertModel(timeModel, redisUtil); + TimeUtil.addJob(timeModel.getId(), timeModel.getDuring(), FlowTime.class, jobDataMap, + timeModel.getStartDate(), timeModel.getEndDate()); + } + } + + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/job/QuartzJobUtil.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/job/QuartzJobUtil.java new file mode 100644 index 0000000..0d62c86 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/job/QuartzJobUtil.java @@ -0,0 +1,67 @@ +package com.yunzhupaas.flowable.job; + +import lombok.extern.slf4j.Slf4j; +import org.quartz.*; +import org.quartz.impl.StdSchedulerFactory; + +import java.util.Date; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/20 16:48 + */ +@Slf4j +public class QuartzJobUtil { + private static final SchedulerFactory schedulerFactory = new StdSchedulerFactory(); + + public static void addJob(String jobName, String cron, Class jobClass, JobDataMap jobDataMap, + Date startDate, Date endDate) { + if (jobDataMap == null) { + jobDataMap = new JobDataMap(); + } + JobDetail jobDetail = JobBuilder.newJob(jobClass).withIdentity(jobName).setJobData(jobDataMap).build(); + Trigger trigger = TriggerBuilder.newTrigger() + .forJob(jobDetail) + .withIdentity(jobName) + .withSchedule(CronScheduleBuilder.cronSchedule(cron)) + .startAt(startDate == null ? new Date() : startDate) + .endAt(endDate != null ? endDate : null) + .build(); + try { + // 获取实例化的 Scheduler。 + Scheduler scheduler = getScheduler(); + // 将任务及其触发器放入调度器 + scheduler.scheduleJob(jobDetail, trigger); + // 调度器开始调度任务 + if (!scheduler.isShutdown()) { + scheduler.start(); + } + } catch (SchedulerException e) { + log.error("新增调度失败:" + e.getMessage()); + } + } + + private static Scheduler getScheduler() { + try { + return schedulerFactory.getScheduler(); + } catch (SchedulerException e) { + e.getMessage(); + } + return null; + } + + public static void deleteJob(String jobName) { + try { + TriggerKey triggerKey = TriggerKey.triggerKey(jobName); + Scheduler scheduler = getScheduler(); + scheduler.pauseTrigger(triggerKey); + scheduler.unscheduleJob(triggerKey); + scheduler.deleteJob(JobKey.jobKey(jobName)); + } catch (SchedulerException e) { + e.getMessage(); + } + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/job/TimeTriggerJob.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/job/TimeTriggerJob.java new file mode 100644 index 0000000..1cd67ad --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/job/TimeTriggerJob.java @@ -0,0 +1,95 @@ +package com.yunzhupaas.flowable.job; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.http.HttpRequest; +import cn.hutool.http.Method; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.flowable.entity.TemplateJsonEntity; +import com.yunzhupaas.flowable.model.trigger.TimeTriggerModel; +import com.yunzhupaas.flowable.model.trigger.TriggerModel; +import com.yunzhupaas.flowable.service.TemplateJsonService; +import com.yunzhupaas.util.AuthUtil; +import com.yunzhupaas.util.Constants; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RedisUtil; +import com.yunzhupaas.util.context.SpringContext; +import org.quartz.*; +import org.springframework.scheduling.quartz.QuartzJobBean; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/20 9:28 + */ +// @DisallowConcurrentExecution +public class TimeTriggerJob extends QuartzJobBean { + private static RedisUtil redisUtil; + private static ConfigValueUtil configValueUtil; + private static TemplateJsonService templateJsonService; + + static { + redisUtil = SpringContext.getBean(RedisUtil.class); + configValueUtil = SpringContext.getBean(ConfigValueUtil.class); + templateJsonService = SpringContext.getBean(TemplateJsonService.class); + } + + @Override + protected void executeInternal(JobExecutionContext context) throws JobExecutionException { + JobDetail jobDetail = context.getJobDetail(); + String jobName = jobDetail.getKey().getName(); + JobDataMap jobDataMap = jobDetail.getJobDataMap(); + TimeTriggerModel jsonToBean = JsonUtil.getJsonToBean(jobDataMap, TimeTriggerModel.class); + TimeTriggerModel timeTriggerModel = TriggerJobUtil.getModel(jsonToBean, redisUtil); + TimeTriggerModel model = timeTriggerModel == null ? jsonToBean : timeTriggerModel; + + UserInfo userInfo = model.getUserInfo(); + if (configValueUtil.isMultiTenancy()) { + TenantDataSourceUtil.switchTenant(userInfo.getTenantId()); + } + + TemplateJsonEntity jsonEntity = templateJsonService.getById(model.getFlowId()); + + if (null != jsonEntity && ObjectUtil.equals(jsonEntity.getState(), 1)) { + long currentTimeMillis = System.currentTimeMillis(); + model.setTime(currentTimeMillis); + Integer num = model.getNum(); + Integer endTimeType = model.getEndTimeType(); + Integer endLimit = model.getEndLimit(); + int currentNum = num + 1; + + boolean isNext = true; + // 触发次数、指定时间 + if (ObjectUtil.equals(endTimeType, 1)) { + isNext = currentNum <= endLimit; + } else if (ObjectUtil.equals(endTimeType, 2)) { + isNext = currentTimeMillis <= model.getEndTime(); + } + + model.setNum(currentNum); + if (isNext) { + TriggerJobUtil.insertModel(model, redisUtil); + + String token = AuthUtil.loginTempUser(userInfo.getUserId(), userInfo.getTenantId(), true); + String url = configValueUtil.getApiDomain() + "/api/workflow/trigger/TimeExecute"; + + TriggerModel triggerModel = new TriggerModel(); + triggerModel.setUserInfo(userInfo); + triggerModel.setId(model.getFlowId()); + HttpRequest request = HttpRequest.of(url).method(Method.POST) + .body(JsonUtil.getObjectToString(triggerModel)); + request.header(Constants.AUTHORIZATION, token); + request.execute().body(); + } else { + TriggerJobUtil.removeModel(model, redisUtil); + QuartzJobUtil.deleteJob(jobName); + } + } else { + TriggerJobUtil.removeModel(model, redisUtil); + QuartzJobUtil.deleteJob(jobName); + } + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/job/TimeTriggerRunner.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/job/TimeTriggerRunner.java new file mode 100644 index 0000000..f213afd --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/job/TimeTriggerRunner.java @@ -0,0 +1,43 @@ +package com.yunzhupaas.flowable.job; + +import com.yunzhupaas.flowable.model.trigger.TimeTriggerModel; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RedisUtil; +import org.quartz.JobDataMap; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.ApplicationArguments; +import org.springframework.boot.ApplicationRunner; +import org.springframework.stereotype.Component; + +import java.util.Date; +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/20 14:55 + */ +@Component +public class TimeTriggerRunner implements ApplicationRunner { + @Autowired + private RedisUtil redisUtil; + + @Override + public void run(ApplicationArguments args) throws Exception { + List hashValues = redisUtil.getHashValues(TriggerJobUtil.TRIGGER_MODEL); + for (String value : hashValues) { + TimeTriggerModel model = JsonUtil.getJsonToBean(value, TimeTriggerModel.class); + JobDataMap jobDataMap = new JobDataMap(); + jobDataMap.putAll(JsonUtil.entityToMap(model)); + Date startTime = new Date(model.getStartTime()); + Date endTime = null != model.getEndTime() ? new Date(model.getEndTime()) : null; + boolean isAdd = null != endTime ? endTime.getTime() > System.currentTimeMillis() : true; + if (isAdd) { + QuartzJobUtil.addJob(model.getId(), model.getCron(), TimeTriggerJob.class, jobDataMap, startTime, + endTime); + } + } + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/job/TriggerJobUtil.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/job/TriggerJobUtil.java new file mode 100644 index 0000000..013f535 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/job/TriggerJobUtil.java @@ -0,0 +1,37 @@ +package com.yunzhupaas.flowable.job; + +import com.yunzhupaas.flowable.model.trigger.TimeTriggerModel; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RedisUtil; +import com.yunzhupaas.util.StringUtil; +import lombok.extern.slf4j.Slf4j; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/20 10:22 + */ +@Slf4j +public class TriggerJobUtil { + public static final String TRIGGER_MODEL = "trigger_model"; + + public static TimeTriggerModel getModel(TimeTriggerModel model, RedisUtil redisUtil) { + String hashValues = redisUtil.getHashValues(TRIGGER_MODEL, model.getId()); + TimeTriggerModel timeTriggerModel = StringUtil.isNotEmpty(hashValues) + ? JsonUtil.getJsonToBean(hashValues, TimeTriggerModel.class) + : null; + return timeTriggerModel; + } + + public static void insertModel(TimeTriggerModel model, RedisUtil redisUtil) { + String id = model.getId(); + redisUtil.insertHash(TRIGGER_MODEL, id, JsonUtil.getObjectToString(model)); + } + + public static void removeModel(TimeTriggerModel model, RedisUtil redisUtil) { + redisUtil.removeHash(TRIGGER_MODEL, model.getId()); + } + +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/CandidatesMapper.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/CandidatesMapper.java new file mode 100644 index 0000000..232cca6 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/CandidatesMapper.java @@ -0,0 +1,14 @@ +package com.yunzhupaas.flowable.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.flowable.entity.CandidatesEntity; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/18 16:00 + */ +public interface CandidatesMapper extends SuperMapper { +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/CirculateMapper.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/CirculateMapper.java new file mode 100644 index 0000000..d93760f --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/CirculateMapper.java @@ -0,0 +1,14 @@ +package com.yunzhupaas.flowable.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.flowable.entity.CirculateEntity; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/18 16:00 + */ +public interface CirculateMapper extends SuperMapper { +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/CommentMapper.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/CommentMapper.java new file mode 100644 index 0000000..1c77f21 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/CommentMapper.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.flowable.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.flowable.entity.CommentEntity; + +/** + * 流程评论 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +public interface CommentMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/CommonMapper.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/CommonMapper.java new file mode 100644 index 0000000..7fd38f4 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/CommonMapper.java @@ -0,0 +1,14 @@ +package com.yunzhupaas.flowable.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.flowable.entity.CommonEntity; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/22 20:30 + */ +public interface CommonMapper extends SuperMapper { +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/DelegateInfoMapper.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/DelegateInfoMapper.java new file mode 100644 index 0000000..5447df5 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/DelegateInfoMapper.java @@ -0,0 +1,14 @@ +package com.yunzhupaas.flowable.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.flowable.entity.DelegateInfoEntity; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/2 13:39 + */ +public interface DelegateInfoMapper extends SuperMapper { +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/DelegateMapper.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/DelegateMapper.java new file mode 100644 index 0000000..ad6d9eb --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/DelegateMapper.java @@ -0,0 +1,14 @@ +package com.yunzhupaas.flowable.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.flowable.entity.DelegateEntity; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/13 16:54 + */ +public interface DelegateMapper extends SuperMapper { +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/LaunchUserMapper.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/LaunchUserMapper.java new file mode 100644 index 0000000..38c1485 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/LaunchUserMapper.java @@ -0,0 +1,14 @@ +package com.yunzhupaas.flowable.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.flowable.entity.LaunchUserEntity; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/18 9:44 + */ +public interface LaunchUserMapper extends SuperMapper { +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/NodeRecordMapper.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/NodeRecordMapper.java new file mode 100644 index 0000000..db40e30 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/NodeRecordMapper.java @@ -0,0 +1,14 @@ +package com.yunzhupaas.flowable.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.flowable.entity.NodeRecordEntity; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/6/25 17:06 + */ +public interface NodeRecordMapper extends SuperMapper { +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/OperatorMapper.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/OperatorMapper.java new file mode 100644 index 0000000..cb1cf99 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/OperatorMapper.java @@ -0,0 +1,14 @@ +package com.yunzhupaas.flowable.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.flowable.entity.OperatorEntity; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/18 15:28 + */ +public interface OperatorMapper extends SuperMapper { +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/RecordMapper.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/RecordMapper.java new file mode 100644 index 0000000..76a692a --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/RecordMapper.java @@ -0,0 +1,14 @@ +package com.yunzhupaas.flowable.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.flowable.entity.RecordEntity; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/23 9:20 + */ +public interface RecordMapper extends SuperMapper { +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/RejectDataMapper.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/RejectDataMapper.java new file mode 100644 index 0000000..07b6bd7 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/RejectDataMapper.java @@ -0,0 +1,14 @@ +package com.yunzhupaas.flowable.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.flowable.entity.RejectDataEntity; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/8 18:06 + */ +public interface RejectDataMapper extends SuperMapper { +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/RevokeMapper.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/RevokeMapper.java new file mode 100644 index 0000000..821492d --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/RevokeMapper.java @@ -0,0 +1,14 @@ +package com.yunzhupaas.flowable.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.flowable.entity.RevokeEntity; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/8/24 13:39 + */ +public interface RevokeMapper extends SuperMapper { +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/SubtaskDataMapper.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/SubtaskDataMapper.java new file mode 100644 index 0000000..97c30a9 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/SubtaskDataMapper.java @@ -0,0 +1,14 @@ +package com.yunzhupaas.flowable.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.flowable.entity.SubtaskDataEntity; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/12/6 15:32 + */ +public interface SubtaskDataMapper extends SuperMapper { +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/TaskLineMapper.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/TaskLineMapper.java new file mode 100644 index 0000000..6586398 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/TaskLineMapper.java @@ -0,0 +1,14 @@ +package com.yunzhupaas.flowable.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.flowable.entity.TaskLineEntity; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/8/23 17:35 + */ +public interface TaskLineMapper extends SuperMapper { +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/TaskMapper.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/TaskMapper.java new file mode 100644 index 0000000..f007b0a --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/TaskMapper.java @@ -0,0 +1,14 @@ +package com.yunzhupaas.flowable.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.flowable.entity.TaskEntity; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/17 15:07 + */ +public interface TaskMapper extends SuperMapper { +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/TemplateJsonMapper.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/TemplateJsonMapper.java new file mode 100644 index 0000000..b404a4b --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/TemplateJsonMapper.java @@ -0,0 +1,9 @@ +package com.yunzhupaas.flowable.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.flowable.entity.TemplateJsonEntity; + +public interface TemplateJsonMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/TemplateMapper.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/TemplateMapper.java new file mode 100644 index 0000000..de6569a --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/TemplateMapper.java @@ -0,0 +1,9 @@ +package com.yunzhupaas.flowable.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.flowable.entity.TemplateEntity; + +public interface TemplateMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/TemplateNodeMapper.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/TemplateNodeMapper.java new file mode 100644 index 0000000..5f8ed96 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/TemplateNodeMapper.java @@ -0,0 +1,9 @@ +package com.yunzhupaas.flowable.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.flowable.entity.TemplateNodeEntity; + +public interface TemplateNodeMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/TriggerRecordMapper.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/TriggerRecordMapper.java new file mode 100644 index 0000000..0dc3ab2 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/TriggerRecordMapper.java @@ -0,0 +1,14 @@ +package com.yunzhupaas.flowable.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.flowable.entity.TriggerRecordEntity; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/10 17:14 + */ +public interface TriggerRecordMapper extends SuperMapper { +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/TriggerTaskMapper.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/TriggerTaskMapper.java new file mode 100644 index 0000000..e194fb1 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/mapper/TriggerTaskMapper.java @@ -0,0 +1,14 @@ +package com.yunzhupaas.flowable.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.flowable.entity.TriggerTaskEntity; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/10 17:11 + */ +public interface TriggerTaskMapper extends SuperMapper { +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/CandidatesService.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/CandidatesService.java new file mode 100644 index 0000000..e7b8cd5 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/CandidatesService.java @@ -0,0 +1,78 @@ +package com.yunzhupaas.flowable.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.flowable.entity.CandidatesEntity; +import com.yunzhupaas.flowable.entity.OperatorEntity; +import com.yunzhupaas.flowable.entity.TemplateNodeEntity; +import com.yunzhupaas.flowable.model.task.FlowModel; + +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/18 16:01 + */ +public interface CandidatesService extends SuperService { + + /** + * 获取候选人 + * + * @param taskId 任务id + * @param nodeCode 节点编码 + */ + List getList(String taskId, String nodeCode); + + /** + * 新建 + * + * @param fo 参数类 + * @param taskId 任务id + * @param nodeEntityList 节点集合 + * @param operator 经办实体 + */ + void create(FlowModel fo, String taskId, List nodeEntityList, OperatorEntity operator); + + /** + * 删除 + * + * @param taskId 任务主键 + * @param nodeIds 节点编码集合 + */ + void deleteByCodes(String taskId, List nodeIds); + + /** + * 删除 + * + * @param taskId 任务主键 + * @param nodeIds 节点编码 + * @param userId 用户主键 + */ + void delete(String taskId, List nodeIds, List userId); + + /** + * 获取选择分支 + * + * @param taskId 任务主键 + * @param nodeCode 节点编码 + */ + List getBranch(String taskId, String nodeCode); + + /** + * 保存选择分支 + * + * @param branchList 选择分支 + * @param operator 经办 + */ + void createBranch(List branchList, OperatorEntity operator); + + /** + * 删除选择分支 + * + * @param taskId 任务主键 + * @param nodeCode 节点编码 + */ + void deleteBranch(String taskId, String nodeCode); +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/CirculateService.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/CirculateService.java new file mode 100644 index 0000000..9a2be23 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/CirculateService.java @@ -0,0 +1,33 @@ +package com.yunzhupaas.flowable.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.flowable.entity.CirculateEntity; +import com.yunzhupaas.flowable.model.operator.OperatorVo; +import com.yunzhupaas.flowable.model.task.TaskPagination; + +import java.util.List; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2024/4/29 下午5:14 + */ +public interface CirculateService extends SuperService { + + /** + * 列表 + * + * @param taskId 任务主键 + */ + List getList(String taskId); + + + /** + * 分页列表 + * + * @param pagination 分页 + */ + List getList(TaskPagination pagination); +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/CommentService.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/CommentService.java new file mode 100644 index 0000000..ea170b0 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/CommentService.java @@ -0,0 +1,71 @@ +package com.yunzhupaas.flowable.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.flowable.entity.CommentEntity; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.model.comment.CommentPagination; + +import java.util.List; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2024/4/24 上午9:07 + */ +public interface CommentService extends SuperService { + + /** + * 列表 + * + * @param pagination 请求参数 + * @return + */ + List getlist(CommentPagination pagination); + + /** + * 列表 + * @return + */ + List getList(); + + /** + * 列表 + * + * @return + */ + List getlist(List idList); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + CommentEntity getInfo(String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(CommentEntity entity) throws WorkFlowException; + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return + */ + void update(String id, CommentEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + * @return + */ + void delete(CommentEntity entity,boolean delComment); +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/CommonService.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/CommonService.java new file mode 100644 index 0000000..037721a --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/CommonService.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.flowable.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.flowable.entity.CommonEntity; + +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/22 20:31 + */ +public interface CommonService extends SuperService { + /** + * 根据用户主键获取常用 + * + * @param userId 用户主键 + */ + List getCommonByUserId(String userId); + + /** + * 设置常用流程 + * + * @param flowId 流程版本主键 + */ + int setCommonFLow(String flowId); +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/DelegateInfoService.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/DelegateInfoService.java new file mode 100644 index 0000000..250b8c0 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/DelegateInfoService.java @@ -0,0 +1,78 @@ +package com.yunzhupaas.flowable.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.flowable.entity.DelegateEntity; +import com.yunzhupaas.flowable.entity.DelegateInfoEntity; +import com.yunzhupaas.flowable.model.delegate.DelegateCrForm; +import com.yunzhupaas.flowable.model.delegate.DelegateListVO; +import com.yunzhupaas.flowable.model.delegate.DelegatePagination; +import com.yunzhupaas.flowable.model.delegate.DelegateUpForm; + +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/2 13:40 + */ +public interface DelegateInfoService extends SuperService { + /** + * 列表 + * + * @param pagination 分页参数 + */ + List getList(DelegatePagination pagination); + + /** + * 列表 + * + * @param delegateIds 委托主键集合 + */ + List getList(List delegateIds); + + /** + * 列表 + * + * @param delegateId 委托主键 + */ + List getList(String delegateId); + + /** + * 获取列表 + * + * @param toUserId 被委托人/代理人id + */ + List getByToUserId(String toUserId); + + /** + * 获取列表 + * + * @param toUserIds 被委托人/代理人id + */ + List getByToUserIds(List toUserIds); + + /** + * 新增被 委托/代理 的用户 + * + * @param fo 参数 + * @param delegateEntity 委托实体 + */ + void create(DelegateCrForm fo, DelegateEntity delegateEntity); + + /** + * 更新 + * + * @param fo 参数 + * @param delegateEntity 委托实体 + */ + void update(DelegateUpForm fo, DelegateEntity delegateEntity); + + /** + * 删除 + * + * @param delegateId 委托主键 + */ + void delete(String delegateId); +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/DelegateService.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/DelegateService.java new file mode 100644 index 0000000..0d8440a --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/DelegateService.java @@ -0,0 +1,134 @@ +package com.yunzhupaas.flowable.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.DelegateEntity; +import com.yunzhupaas.flowable.entity.DelegateInfoEntity; +import com.yunzhupaas.flowable.model.candidates.CandidateUserVo; +import com.yunzhupaas.flowable.model.delegate.DelegateCrForm; +import com.yunzhupaas.flowable.model.delegate.DelegateListVO; +import com.yunzhupaas.flowable.model.delegate.DelegatePagination; +import com.yunzhupaas.flowable.model.delegate.DelegateUpForm; +import com.yunzhupaas.flowable.model.template.TemplatePageLisVO; +import com.yunzhupaas.flowable.model.template.TemplatePagination; + +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/13 16:55 + */ +public interface DelegateService extends SuperService { + + /** + * 列表 + * + * @param pagination 分页参数 + */ + List getList(DelegatePagination pagination); + + /** + * 详情 + * + * @param id 委托主键 + */ + DelegateEntity getInfo(String id); + + /** + * 创建 + * + * @param fo 参数 + */ + void create(DelegateCrForm fo); + + /** + * 更新 + * + * @param entity 实体 + * @param fo 参数 + */ + boolean update(DelegateEntity entity, DelegateUpForm fo); + + /** + * 委托结束 + * + * @param id 主键 + * @param entity 实体 + */ + boolean updateStop(String id, DelegateEntity entity); + + /** + * 删除 + * + * @param entity 实体 + */ + void delete(DelegateEntity entity); + + /** + * 获取被委托人/代理人 + * + * @param userId 委托人 + * @param flowId 流程主键 + */ + List getToUser(String userId, String flowId); + + /** + * 根据 被委托人/代理人id 获取列表 + * + * @param toUserId 被委托人/代理人id + */ + List getByToUserId(String toUserId); + + /** + * 根据 被委托人/代理人id 获取列表 + * + * @param toUserId 被委托人/代理人id + * @param type 类型 + */ + List getByToUserId(String toUserId, Integer type); + + /** + * 获取我的委托发起 + * + * @param pagination 分页参数 + */ + List getFlow(TemplatePagination pagination); + + // /** + // * 获取委托人列表 + // */ + // ListVO getUserList() throws WorkFlowException; + + /** + * 获取委托人列表 + */ + ListVO getUserList(String templateId) throws WorkFlowException; + + /** + * 获取当前用户所有发起委托列表 + */ + List getLaunchDelagateList(); + + /** + * 根据条件查询相关委托信息 + * + * @param fo 参数 + */ + List selectSameParamAboutDelaget(DelegateCrForm fo); + + /** + * 列表 + */ + List getList(); + + /** + * 确认 + * + * @param delegateInfo 委托信息 + */ + void notarize(DelegateInfoEntity delegateInfo); +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/LaunchUserService.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/LaunchUserService.java new file mode 100644 index 0000000..1520edd --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/LaunchUserService.java @@ -0,0 +1,36 @@ +package com.yunzhupaas.flowable.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.flowable.entity.LaunchUserEntity; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/18 9:45 + */ +public interface LaunchUserService extends SuperService { + + /** + * 根据任务id获取发起用户 + * + * @param taskId 任务id + */ + LaunchUserEntity getInfoByTask(String taskId); + + /** + * 创建发起用户 + * + * @param taskId 任务id + * @param userId 用户id + */ + void createLaunchUser(String taskId, String userId); + + /** + * 删除发起用户 + * + * @param taskId 任务主键 + */ + void delete(String taskId); +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/NodeRecordService.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/NodeRecordService.java new file mode 100644 index 0000000..b9bc754 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/NodeRecordService.java @@ -0,0 +1,37 @@ +package com.yunzhupaas.flowable.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.flowable.entity.NodeRecordEntity; +import com.yunzhupaas.flowable.model.record.NodeRecordModel; + +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/6/25 17:07 + */ +public interface NodeRecordService extends SuperService { + /** + * 列表 + * + * @param taskId 任务主键 + */ + List getList(String taskId); + + /** + * 节点记录保存 + * + * @param model 参数 + */ + void create(NodeRecordModel model); + + /** + * 节点记录更新 + * + * @param model 参数 + */ + void update(NodeRecordModel model); +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/OperatorService.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/OperatorService.java new file mode 100644 index 0000000..2f4f2ee --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/OperatorService.java @@ -0,0 +1,229 @@ +package com.yunzhupaas.flowable.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.OperatorEntity; +import com.yunzhupaas.flowable.model.candidates.CandidateCheckVo; +import com.yunzhupaas.flowable.model.operator.FlowBatchModel; +import com.yunzhupaas.flowable.model.operator.OperatorVo; +import com.yunzhupaas.flowable.model.operator.ReducePagination; +import com.yunzhupaas.flowable.model.operator.ReduceUserModel; +import com.yunzhupaas.flowable.model.task.FlowModel; +import com.yunzhupaas.flowable.model.task.TaskPagination; +import com.yunzhupaas.flowable.model.templatenode.BackNodeModel; +import com.yunzhupaas.model.FlowWorkListVO; +import com.yunzhupaas.permission.model.user.WorkHandoverModel; + +import java.util.List; +import java.util.Map; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/18 15:29 + */ +public interface OperatorService extends SuperService { + + /** + * 经办实体 + * + * @param id 经办主键 + */ + OperatorEntity getInfo(String id) throws WorkFlowException; + + /** + * 列表 + * + * @param taskId 任务主键 + */ + List getList(String taskId); + + /** + * 列表 + * + * @param pagination 参数 + */ + List getList(TaskPagination pagination); + + /** + * 处理经办 + * + * @param flowModel 参数 + */ + List handleOperator(FlowModel flowModel) throws Exception; + + /** + * 同意 + * + * @param id 经办主键 + * @param flowModel 参数 + */ + void auditWithCheck(String id, FlowModel flowModel) throws Exception; + + /** + * 同意 + * + * @param id 经办主键 + * @param flowModel 参数 + */ + void audit(String id, FlowModel flowModel) throws Exception; + + /** + * 同意(发起时自动通过) + * + * @param operator 经办实体 + * @param flowModel 参数 + */ + void audit(OperatorEntity operator, FlowModel flowModel) throws Exception; + + /** + * 签收 + * + * @param flowModel 参数,ids 、type 0 签收 1 退签 + */ + void sign(FlowModel flowModel) throws WorkFlowException; + + /** + * 开始办理 + * + * @param flowModel 参数,ids + */ + void startHandle(FlowModel flowModel) throws WorkFlowException; + + /** + * 暂存 + * + * @param id 经办主键 + * @param flowModel 参数 + */ + void saveAudit(String id, FlowModel flowModel) throws WorkFlowException; + + /** + * 加签 + * + * @param id 经办主键 + * @param flowModel 参数 + */ + void addSign(String id, FlowModel flowModel) throws Exception; + + /** + * 获取加签的人 + * + * @param id 经办主键 + * @param pagination 参数 + */ + List getReduceList(String id, ReducePagination pagination) throws WorkFlowException; + + /** + * 减签 + * + * @param id 记录主键 + * @param flowModel 参数 + */ + void reduce(String id, FlowModel flowModel) throws WorkFlowException; + + /** + * 获取退回的节点 + * + * @param id 经办主键 + */ + List getFallbacks(String id) throws WorkFlowException; + + /** + * 退回 + * + * @param id 经办主键 + * @param flowModel 参数 + */ + void back(String id, FlowModel flowModel) throws Exception; + + /** + * 撤回 + * + * @param id 记录主键 + * @param flowModel 参数 + */ + void recall(String id, FlowModel flowModel) throws WorkFlowException; + + /** + * 转审 + * + * @param id 经办主键 + * @param flowModel 参数 + */ + void transfer(String id, FlowModel flowModel) throws Exception; + + /** + * 协办 + * + * @param id 经办主键 + * @param flowModel 参数 + */ + void assist(String id, FlowModel flowModel) throws WorkFlowException; + + /** + * 协办保存 + * + * @param id 经办主键 + * @param flowModel 参数 + */ + void assistSave(String id, FlowModel flowModel) throws WorkFlowException; + + /** + * 批量审批流程分类列表 + */ + List batchFlowSelector(); + + /** + * 批量审批流程版本列表 + * + * @param templateId 流程定义主键 + */ + List batchVersionSelector(String templateId); + + /** + * 批量审批节点列表 + * + * @param flowId 流程定义版本主键 + */ + List batchNodeSelector(String flowId); + + /** + * 批量审批节点属性 + * + * @param flowModel 参数 + */ + Map batchNode(FlowModel flowModel) throws WorkFlowException; + + /** + * 批量审批获取候选人 + * + * @param flowId 版本主键 + * @param operatorId 经办主键 + * @param batchType 类型,0.同意 1.拒绝 + */ + CandidateCheckVo batchCandidates(String flowId, String operatorId, Integer batchType) throws WorkFlowException; + + /** + * 批量审批 + * + * @param flowModel 参数 + */ + void batch(FlowModel flowModel) throws Exception; + + /** + * 流程交接 + * + * @param fromId 移交人 + */ + FlowWorkListVO flowWork(String fromId); + + /** + * 流程交接 + * + * @param workHandoverModel 参数 + */ + boolean flowWork(WorkHandoverModel workHandoverModel); +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/RecordService.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/RecordService.java new file mode 100644 index 0000000..e7c7b25 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/RecordService.java @@ -0,0 +1,79 @@ +package com.yunzhupaas.flowable.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.flowable.entity.RecordEntity; +import com.yunzhupaas.flowable.model.operator.OperatorVo; +import com.yunzhupaas.flowable.model.record.RecordVo; +import com.yunzhupaas.flowable.model.task.TaskPagination; + +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/23 9:21 + */ +public interface RecordService extends SuperService { + + /** + * 列表 + * + * @param taskId 任务id + */ + List getList(String taskId); + + /** + * 分页列表 + * + * @param pagination 分页 + */ + List getList(TaskPagination pagination); + + /** + * 消息汇总列表 + * + * @param taskId 任务id + * @param statusList 状态 + */ + List getRecordList(String taskId, List statusList); + + /** + * 详情 + * + * @param id 记录主键 + */ + RecordEntity getInfo(String id); + + /** + * 保存 + * + * @param entity 记录实体 + */ + void create(RecordEntity entity); + + /** + * 修改 + * + * @param id 主键 + * @param entity 实体 + */ + void update(String id, RecordEntity entity); + + /** + * 变更状态为作废 + * + * @param taskId 任务主键 + * @param nodeCodeList 节点编码 + */ + void updateStatusToInvalid(String taskId, List nodeCodeList); + + /** + * 记录列表 + * + * @param taskId 任务主键 + * @param nodeId 节点id + */ + List getList(String taskId, String nodeId); +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/RejectDataService.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/RejectDataService.java new file mode 100644 index 0000000..ac5a987 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/RejectDataService.java @@ -0,0 +1,34 @@ +package com.yunzhupaas.flowable.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.flowable.entity.OperatorEntity; +import com.yunzhupaas.flowable.entity.RejectDataEntity; +import com.yunzhupaas.flowable.entity.TaskEntity; +import com.yunzhupaas.exception.WorkFlowException; + +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/8 18:07 + */ +public interface RejectDataService extends SuperService { + /** + * 详情 + * + * @param id 主键 + */ + RejectDataEntity getInfo(String id) throws WorkFlowException; + + /** + * 新增 + * + * @param taskEntity 任务 + * @param operatorEntityList 经办集合 + * @param nodeCode 节点编码 + */ + RejectDataEntity create(TaskEntity taskEntity, List operatorEntityList, String nodeCode); +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/RevokeService.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/RevokeService.java new file mode 100644 index 0000000..b210368 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/RevokeService.java @@ -0,0 +1,43 @@ +package com.yunzhupaas.flowable.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.flowable.entity.RevokeEntity; + +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/8/24 13:39 + */ +public interface RevokeService extends SuperService { + /** + * 获取撤销任务关联 + * + * @param revokeTaskId 撤销任务主键 + */ + RevokeEntity getRevokeTask(String revokeTaskId); + + /** + * 用于判断原任务是否能撤销 + * + * @param taskId 任务主键 + */ + Boolean checkExist(String taskId); + + /** + * 假删除 + * + * @param revokeTaskId 撤销任务主键 + */ + void deleteRevoke(String revokeTaskId); + + /** + * 根据任务id获取撤销任务id + * + * @param ids 任务id + */ + List getByTaskId(List ids); +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/SubtaskDataService.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/SubtaskDataService.java new file mode 100644 index 0000000..2a37ae3 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/SubtaskDataService.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.flowable.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.flowable.entity.SubtaskDataEntity; +import com.yunzhupaas.flowable.model.task.FlowModel; + +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/12/6 15:33 + */ +public interface SubtaskDataService extends SuperService { + /** + * 获取列表 + * + * @param parentId 父实例主键 + * @param parentCode 父节点编码 + */ + List getList(String parentId, String parentCode); + + /** + * 保存 + * + * @param subTaskData 依次创建子流程参数集合 + */ + void save(List subTaskData); +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/TaskLineService.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/TaskLineService.java new file mode 100644 index 0000000..bc7f235 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/TaskLineService.java @@ -0,0 +1,38 @@ +package com.yunzhupaas.flowable.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.flowable.entity.TaskLineEntity; + +import java.util.List; +import java.util.Map; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/8/23 17:36 + */ +public interface TaskLineService extends SuperService { + /** + * 列表 + * + * @param taskId 任务主键 + */ + List getList(String taskId); + + /** + * 保存任务条件 + * + * @param taskId 任务主键 + * @param conditionResMap 条件 + */ + void create(String taskId, Map conditionResMap); + + /** + * 获取最新的(值为true的)线的集合 + * + * @param taskId 任务主键 + */ + List getLineKeyList(String taskId); +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/TaskService.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/TaskService.java new file mode 100644 index 0000000..17ea932 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/TaskService.java @@ -0,0 +1,201 @@ +package com.yunzhupaas.flowable.service; + +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.TaskEntity; +import com.yunzhupaas.flowable.model.candidates.CandidateCheckFo; +import com.yunzhupaas.flowable.model.candidates.CandidateCheckVo; +import com.yunzhupaas.flowable.model.candidates.CandidateUserFo; +import com.yunzhupaas.flowable.model.candidates.CandidateUserVo; +import com.yunzhupaas.flowable.model.task.FlowModel; +import com.yunzhupaas.flowable.model.task.TaskPagination; +import com.yunzhupaas.flowable.model.task.TaskUserListModel; +import com.yunzhupaas.flowable.model.task.ViewFormModel; +import com.yunzhupaas.flowable.model.template.BeforeInfoVo; + +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/17 15:08 + */ +public interface TaskService extends SuperService { + + TaskEntity getInfoSubmit(String id, SFunction... columns); + + List getInfosSubmit(String[] ids, SFunction... columns); + + /** + * 我发起的 列表 + * + * @param pagination 分页 + */ + List getList(TaskPagination pagination); + + /** + * 监控列表 + * + * @param pagination 分页参数 + */ + List getMonitorList(TaskPagination pagination); + + /** + * 任务实体 + * + * @param id 任务主键 + */ + TaskEntity getInfo(String id) throws WorkFlowException; + + /** + * 发起、审批详情 + * + * @param id 任务id + * @param fo 参数类 + */ + BeforeInfoVo getInfo(String id, FlowModel fo) throws WorkFlowException; + + /** + * 获取能走的节点,判断候选人 + * + * @param id 经办主键 + * @param fo 参数类 + */ + CandidateCheckVo checkCandidates(String id, CandidateCheckFo fo) throws WorkFlowException; + + /** + * 获取候选人 + * + * @param fo 参数类 + */ + List getCandidateUser(String id, CandidateUserFo fo) throws WorkFlowException; + + /** + * 暂存、提交 + * + * @param flowModel 参数 + */ + void batchSaveOrSubmit(FlowModel flowModel) throws Exception; + + /** + * 暂存、提交 + * + * @param fo 参数类 + */ + void saveOrSubmit(FlowModel fo) throws Exception; + + /** + * 发起撤回 + * + * @param id 任务主键 + * @param flowModel 参数 + */ + void recall(String id, FlowModel flowModel) throws WorkFlowException; + + /** + * 催办 + * + * @param id 任务主键 + */ + boolean press(String id) throws WorkFlowException; + + /** + * 撤销 + * + * @param id 任务主键 + */ + void revoke(String id, FlowModel flowModel) throws Exception; + + /** + * 删除 + * + * @param id 主键 + */ + List delete(String id) throws Exception; + + /** + * 删除 + * + * @param ids 主键数组 + */ + void deleteBatch(List ids) throws Exception; + + /** + * 递归获取子流程 + * + * @param idList 需要递归的任务主键集合 + * @param idAll 结果任务主键集合 + */ + void deleTaskAll(List idList, List idAll); + + /** + * 终止、复活 + * + * @param id 主键 + * @param flowModel 参数 + * @param isCancel 标识,true 终止 + */ + void cancel(String id, FlowModel flowModel, boolean isCancel) throws WorkFlowException; + + /** + * 判断是否存在异步子流程 + * + * @param id 任务主键 + */ + boolean checkAsync(String id); + + /** + * 挂起、恢复 + * + * @param id 主键 + * @param flowModel 参数 + * @param isSuspend 标识,true 挂起、false 恢复 + */ + void pause(String id, FlowModel flowModel, Boolean isSuspend) throws WorkFlowException; + + /** + * 指派 + * + * @param id 主键 + * @param flowModel 参数 + */ + void assign(String id, FlowModel flowModel) throws WorkFlowException; + + /** + * 获取流程所关联的用户信息 + * + * @param taskId 任务主键 + */ + TaskUserListModel getTaskUserList(String taskId); + + /** + * 子流程详情 + * + * @param flowModel 参数 + */ + List subFlowInfo(FlowModel flowModel) throws WorkFlowException; + + /** + * 消息跳转流程校验 + * + * @param id 经办或抄送主键 + */ + String checkInfo(String id) throws WorkFlowException; + + /** + * 更新归档状态 + * + * @param taskId 任务主键 + */ + void updateIsFile(String taskId) throws WorkFlowException; + + /** + * 获取发起表单 + * + * @param taskId 任务主键 + */ + ViewFormModel getStartForm(String taskId) throws WorkFlowException; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/TemplateJsonService.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/TemplateJsonService.java new file mode 100644 index 0000000..7fddb6e --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/TemplateJsonService.java @@ -0,0 +1,101 @@ +package com.yunzhupaas.flowable.service; + +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.TemplateJsonEntity; +import com.yunzhupaas.flowable.model.templatejson.TemplateJsonInfoVO; +import com.yunzhupaas.flowable.model.templatenode.TemplateNodeUpFrom; + +import java.util.List; + +public interface TemplateJsonService extends SuperService { + + /** + * 列表 + * + * @return + */ + List getListByTemplateIds(List id); + + /** + * 列表 + * + * @return + */ + List getList(String templateId); + + /** + * 获取启用的列表 + */ + List getListOfEnable(); + + /** + * 信息 + * + * @param id 主键值 + * @return ignore + */ + TemplateJsonEntity getInfo(String id) throws WorkFlowException; + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return ignore + */ + boolean update(String id, TemplateJsonEntity entity); + + /** + * 流程保存或发布 + * + * @param from 主键值 + * @return ignore + */ + void save(TemplateNodeUpFrom from) throws WorkFlowException; + + /** + * 新增 + * + * @param from 对象 + * @return ignore + */ + void create(TemplateNodeUpFrom from); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(TemplateJsonEntity entity); + + /** + * 删除 + * + * @param id 实体对象 + */ + void delete(List id); + + /** + * 复制 + * + * @param entity 实体对象 + */ + void copy(TemplateJsonEntity entity, String id); + + /** + * 版本详情 + * + * @param id 版本主键 + */ + TemplateJsonInfoVO getInfoVo(String id) throws WorkFlowException; + + /** + * 获取表单 + * + * @param id 版本主键 + */ + VisualdevEntity getFormInfo(String id) throws WorkFlowException; +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/TemplateNodeService.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/TemplateNodeService.java new file mode 100644 index 0000000..19d54d8 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/TemplateNodeService.java @@ -0,0 +1,82 @@ +package com.yunzhupaas.flowable.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.TemplateNodeEntity; + +import java.util.List; + +public interface TemplateNodeService extends SuperService { + + /** + * 列表 + * + * @return + */ + List getList(String flowId); + + /** + * 获取节点 + * + * @param flowIds 版本主键集合 + */ + List getList(List flowIds, String nodeType); + + /** + * 根据用户主键 获取节点 + * + * @param userId 用户主键 + */ + List getListLikeUserId(String userId); + + /** + * 信息 + * + * @param id 主键值 + * @return ignore + */ + TemplateNodeEntity getInfo(String id) throws WorkFlowException; + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(TemplateNodeEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return ignore + */ + boolean update(String id, TemplateNodeEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(TemplateNodeEntity entity); + + /** + * 删除 + * + * @param idList + */ + void deleteList(List idList); + + /** + * 删除 + * + * @param idList + */ + void delete(List idList); + + /** + * 获取开始节点表单列表 + */ + List getListStart(); +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/TemplateService.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/TemplateService.java new file mode 100644 index 0000000..747ffd0 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/TemplateService.java @@ -0,0 +1,187 @@ +package com.yunzhupaas.flowable.service; + +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.TemplateEntity; +import com.yunzhupaas.flowable.model.template.*; +import com.yunzhupaas.flowable.model.templatejson.FlowFormModel; +import com.yunzhupaas.permission.entity.UserEntity; + +import java.util.List; +import java.util.Map; + +public interface TemplateService extends SuperService { + + /** + * 列表 + * + * @return + */ + List getList(TemplatePagination pagination); + + /** + * 列表 + * + * @return + */ + List getSelector(TemplatePagination pagination); + + /** + * 树形常用 + */ + List getTreeCommon(); + + /** + * 树形集合 + */ + List treeList(Integer formType); + + /** + * 权限树形集合 + */ + List treeListWithPower(); + + /** + * 列表 + * + * @param pagination 分页参数 + * @param isPage 是否分页 + */ + List getListAll(TemplatePagination pagination, boolean isPage); + + /** + * 根据版本主键集合获取流程模板集合 + * + * @param flowIds 版本主键集合 + */ + List getListByFlowIds(List flowIds); + + /** + * 信息 + * + * @param id 主键值 + * @return ignore + */ + TemplateEntity getInfo(String id) throws WorkFlowException; + + /** + * 验证名称 + * + * @param fullName 名称 + * @param id 主键值 + * @return + */ + boolean isExistByFullName(String fullName, String id); + + /** + * 验证编码 + * + * @param enCode 编码 + * @param id 主键值 + * @return + */ + boolean isExistByEnCode(String enCode, String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(TemplateEntity entity, String flowXml, Map> flowNodes) throws WorkFlowException; + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return ignore + */ + boolean update(String id, TemplateEntity entity) throws WorkFlowException; + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(TemplateEntity entity) throws WorkFlowException; + + /** + * 复制 + * + * @param entity 实体对象 + */ + void copy(TemplateEntity entity) throws WorkFlowException; + + /** + * 导出 + * + * @param id 定义主键 + */ + TemplateExportModel export(String id) throws WorkFlowException; + + /** + * 导入 + * + * @param model 导出model + * @param type 类型 + */ + void importData(TemplateExportModel model, String type) throws WorkFlowException; + + /** + * 查询 + */ + List getList(List ids); + + /** + * 查询(status为 1、2 的) + */ + List getListOfHidden(List ids); + + /** + * 根据表单主键获取流程(权限过滤) + * + * @param formId 表单主键 + */ + FlowByFormModel getFlowByFormId(String formId, Boolean start); + + /** + * 子流程可发起人员 + * + * @param flowId 流程主键 + * @param pagination 分页参数 + */ + List getSubFlowUserList(String flowId, TemplatePagination pagination) throws WorkFlowException; + + /** + * 根据模板主键获取表单 + * + * @param templateId 流程模板主键 + */ + VisualdevEntity getFormByTemplateId(String templateId) throws WorkFlowException; + + /** + * 根据模板主键获取表单主键和流程版本主键 + * + * @param templateId 流程模板主键 + */ + FlowFormModel getFormIdAndFlowId(String templateId) throws WorkFlowException; + + /** + * 根据模板主键获取表单主键和流程版本主键 + * + * @param templateId 流程模板主键 + */ + FlowFormModel getFormIdAndFlowId(List userId ,String templateId) throws WorkFlowException; + + /** + * 获取启用的流程版本的表单集合 + */ + List getFormList(); + + /** + * 获取流程templateId和表单formId组成的map + */ + Map getFlowFormMap(); +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/TriggerRecordService.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/TriggerRecordService.java new file mode 100644 index 0000000..91c7af3 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/TriggerRecordService.java @@ -0,0 +1,33 @@ +package com.yunzhupaas.flowable.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.flowable.entity.TriggerRecordEntity; +import com.yunzhupaas.flowable.entity.TriggerTaskEntity; +import com.yunzhupaas.flowable.model.flowable.FlowableTaskModel; +import com.yunzhupaas.flowable.model.templatenode.nodejson.NodeModel; + +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/10 17:15 + */ +public interface TriggerRecordService extends SuperService { + + List getList(String triggerTaskId); + + List getListByTaskId(String taskId); + + void create(TriggerRecordEntity entity); + + void create(TriggerTaskEntity triggerTask, NodeModel nodeModel, FlowableTaskModel taskModel); + + void createStart(String triggerId); + + void createEnd(String triggerId); + + void delete(List triggerTaskIds); +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/TriggerTaskService.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/TriggerTaskService.java new file mode 100644 index 0000000..87ed9b3 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/TriggerTaskService.java @@ -0,0 +1,91 @@ +package com.yunzhupaas.flowable.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.TriggerTaskEntity; +import com.yunzhupaas.flowable.model.trigger.TriggerInfoListModel; +import com.yunzhupaas.flowable.model.trigger.TriggerInfoModel; +import com.yunzhupaas.flowable.model.trigger.TriggerPagination; + +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/10 17:12 + */ +public interface TriggerTaskService extends SuperService { + /** + * 获取任务下的触发记录 + * + * @param taskId 任务主键 + * @param nodeCode 节点编码 + */ + List getListByTaskId(String taskId, String nodeCode); + + /** + * 判断是否有任务流程 + * + * @param taskId 任务主键 + * @param nodeCode 节点编码 + */ + boolean existTriggerTask(String taskId, String nodeCode); + + /** + * 列表 + * + * @param pagination 分页参数 + */ + List getList(TriggerPagination pagination); + + /** + * 详情 + * + * @param id 主键 + */ + TriggerInfoModel getInfo(String id) throws WorkFlowException; + + /** + * 重试 + * + * @param id 主键 + */ + void retry(String id) throws Exception; + + /** + * 保存 + * + * @param entity 实体 + */ + void saveTriggerTask(TriggerTaskEntity entity); + + /** + * 更新 + * + * @param entity 实体 + */ + void updateTriggerTask(TriggerTaskEntity entity); + + /** + * 批量删除 + * + * @param ids 任务流程实例主键 + */ + void batchDelete(List ids); + + /** + * 根据任务主键删除 + * + * @param taskId 任务主键 + */ + void deleteByTaskId(List taskId); + + /** + * 判断流程版本下是否存在任务流程 + * + * @param flowIds 流程版本主键集合 + */ + boolean checkByFlowIds(List flowIds); +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/CandidatesServiceImpl.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/CandidatesServiceImpl.java new file mode 100644 index 0000000..032a199 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/CandidatesServiceImpl.java @@ -0,0 +1,202 @@ +package com.yunzhupaas.flowable.service.impl; + +import cn.hutool.core.collection.CollectionUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.github.yulichang.extension.mapping.wrapper.MappingQuery; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.flowable.entity.CandidatesEntity; +import com.yunzhupaas.flowable.entity.OperatorEntity; +import com.yunzhupaas.flowable.entity.TemplateNodeEntity; +import com.yunzhupaas.flowable.mapper.CandidatesMapper; +import com.yunzhupaas.flowable.model.task.FlowModel; +import com.yunzhupaas.flowable.model.util.FlowNature; +import com.yunzhupaas.flowable.service.CandidatesService; +import com.yunzhupaas.flowable.service.OperatorService; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/18 16:03 + */ +@Service +public class CandidatesServiceImpl extends SuperServiceImpl + implements CandidatesService { + @Autowired + private OperatorService operatorService; + + @Override + public List getList(String taskId, String nodeCode) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(taskId)) { + queryWrapper.lambda().eq(CandidatesEntity::getTaskId, taskId); + } + if (StringUtil.isNotEmpty(nodeCode)) { + queryWrapper.lambda().eq(CandidatesEntity::getNodeCode, nodeCode); + } + return this.list(queryWrapper); + } + + public List getListByCode(String taskId, String nodeCode) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(CandidatesEntity::getTaskId, taskId).eq(CandidatesEntity::getNodeCode, nodeCode); + return this.list(queryWrapper); + } + + @Override + public void create(FlowModel fo, String taskId, List nodeEntityList, OperatorEntity operator) { + UserInfo userInfo = UserProvider.getUser(); + // 候选人 + Map> candidateList = fo.getCandidateList(); + for (String key : candidateList.keySet()) { + TemplateNodeEntity nodeEntity = nodeEntityList.stream().filter(e -> e.getNodeCode().equals(key)).findFirst() + .orElse(null); + if (null == nodeEntity) { + continue; + } + // 删除原先的节点的候选人 + // this.delete(taskId, nodeEntity.getNodeCode()); + + List list = candidateList.get(key); + this.create(taskId, nodeEntity, operator, userInfo, list, FlowNature.Candidates); + } + // 异常人 + Map> errorRuleUserList = fo.getErrorRuleUserList(); + for (String key : errorRuleUserList.keySet()) { + TemplateNodeEntity nodeEntity = nodeEntityList.stream().filter(e -> e.getNodeCode().equals(key)).findFirst() + .orElse(null); + if (null == nodeEntity) { + continue; + } + List list = errorRuleUserList.get(key); + this.create(taskId, nodeEntity, operator, userInfo, list, FlowNature.CandidatesError); + } + } + + public void create(String taskId, TemplateNodeEntity nodeEntity, OperatorEntity operator, UserInfo userInfo, + List list, Integer type) { + CandidatesEntity entity = new CandidatesEntity(); + entity.setId(RandomUtil.uuId()); + entity.setTaskId(taskId); + entity.setNodeCode(nodeEntity.getNodeCode()); + + String nodeId = ""; + if (operator != null) { + entity.setOperatorId(operator.getId()); + nodeId = operator.getNodeId(); + } else { + entity.setOperatorId(FlowNature.ParentId); + } + List entityList = this.getListByCode(taskId, nodeEntity.getNodeCode()); + if (CollectionUtil.isNotEmpty(entityList)) { + QueryWrapper operatorWrapper = new QueryWrapper<>(); + operatorWrapper.lambda().eq(OperatorEntity::getTaskId, taskId).eq(OperatorEntity::getNodeId, nodeId); + List opList = operatorService.list(operatorWrapper); + if (CollectionUtil.isNotEmpty(opList)) { + List opIds = opList.stream().map(OperatorEntity::getId).collect(Collectors.toList()); + List deleteList = entityList.stream() + .filter(e -> !opIds.contains(e.getOperatorId())).collect(Collectors.toList()); + if (CollectionUtil.isNotEmpty(deleteList)) { + this.removeByIds(deleteList); + } + } + } + + entity.setAccount(userInfo.getUserAccount()); + entity.setHandleId(userInfo.getUserId()); + entity.setType(type); + + entity.setCandidates(String.join(",", list)); + this.save(entity); + } + + public void delete(String taskId, String nodeCode) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(CandidatesEntity::getTaskId, taskId) + .eq(CandidatesEntity::getNodeCode, nodeCode); + List list = this.list(queryWrapper); + if (CollectionUtil.isNotEmpty(list)) { + this.removeByIds(list); + } + } + + @Override + public void deleteByCodes(String taskId, List nodeIds) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(CandidatesEntity::getTaskId, taskId); + if (CollectionUtil.isNotEmpty(nodeIds)) { + queryWrapper.lambda().in(CandidatesEntity::getNodeCode, nodeIds); + } + List list = this.list(queryWrapper); + if (CollectionUtil.isNotEmpty(list)) { + this.removeByIds(list); + } + } + + @Override + public void delete(String taskId, List nodeIds, List userId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(CandidatesEntity::getTaskId, taskId).in(CandidatesEntity::getHandleId, userId); + if (CollectionUtil.isNotEmpty(nodeIds)) { + queryWrapper.lambda().in(CandidatesEntity::getNodeCode, nodeIds); + } + List list = this.list(queryWrapper); + if (CollectionUtil.isNotEmpty(list)) { + this.removeByIds(list); + } + } + + @Override + public List getBranch(String taskId, String nodeCode) { + List resList = new ArrayList<>(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(CandidatesEntity::getTaskId, taskId).eq(CandidatesEntity::getNodeCode, nodeCode) + .eq(CandidatesEntity::getType, FlowNature.Branch); + List list = this.list(queryWrapper); + if (CollectionUtil.isNotEmpty(list)) { + for (CandidatesEntity entity : list) { + if (StringUtil.isNotEmpty(entity.getCandidates())) { + List branch = Arrays.stream(entity.getCandidates().split(",")).collect(Collectors.toList()); + resList.addAll(branch); + } + } + } + return resList; + } + + @Override + public void createBranch(List branchList, OperatorEntity operator) { + if (CollectionUtil.isNotEmpty(branchList)) { + this.deleteBranch(operator.getTaskId(), operator.getNodeCode()); + CandidatesEntity entity = new CandidatesEntity(); + entity.setId(RandomUtil.uuId()); + entity.setTaskId(operator.getTaskId()); + entity.setNodeCode(operator.getNodeCode()); + entity.setOperatorId(operator.getId()); + entity.setType(FlowNature.Branch); + entity.setCandidates(String.join(",", branchList)); + this.save(entity); + } + } + + @Override + public void deleteBranch(String taskId, String nodeCode) { + QueryWrapper wrapper = new MappingQuery<>(); + wrapper.lambda().eq(CandidatesEntity::getTaskId, taskId).eq(CandidatesEntity::getNodeCode, nodeCode) + .eq(CandidatesEntity::getType, FlowNature.Branch); + this.remove(wrapper); + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/CirculateServiceImpl.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/CirculateServiceImpl.java new file mode 100644 index 0000000..911b306 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/CirculateServiceImpl.java @@ -0,0 +1,93 @@ +package com.yunzhupaas.flowable.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.github.yulichang.toolkit.JoinWrappers; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.flowable.entity.CirculateEntity; +import com.yunzhupaas.flowable.entity.TaskEntity; +import com.yunzhupaas.flowable.enums.TaskStatusEnum; +import com.yunzhupaas.flowable.mapper.CirculateMapper; +import com.yunzhupaas.flowable.service.CirculateService; +import com.yunzhupaas.flowable.model.operator.OperatorVo; +import com.yunzhupaas.flowable.model.task.TaskPagination; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2024/4/29 下午5:21 + */ +@Service +public class CirculateServiceImpl extends SuperServiceImpl implements CirculateService { + + @Override + public List getList(String taskId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(CirculateEntity::getTaskId, taskId); + return this.list(queryWrapper); + } + + @Override + public List getList(TaskPagination pagination) { + String userId = StringUtil.isNotEmpty(pagination.getUserId()) ? pagination.getUserId() : UserProvider.getLoginUserId(); + MPJLambdaWrapper wrapper = JoinWrappers.lambda(CirculateEntity.class) + .selectAll(TaskEntity.class) + .leftJoin(TaskEntity.class, TaskEntity::getId, CirculateEntity::getTaskId) + .selectAs(CirculateEntity::getNodeName, OperatorVo::getNodeName) + .selectAs(CirculateEntity::getNodeCode, OperatorVo::getNodeCode) + .selectAs(CirculateEntity::getId, OperatorVo::getId) + .selectAs(TaskEntity::getId, OperatorVo::getTaskId) + .selectAs(TaskEntity::getUrgent, OperatorVo::getFlowUrgent) + .selectAs(CirculateEntity::getCreatorTime, OperatorVo::getCreatorTime) + .ne(TaskEntity::getStatus, TaskStatusEnum.CANCEL.getCode()) + .eq(CirculateEntity::getUserId, userId); + //关键字(流程名称、流程编码) + String keyWord = pagination.getKeyword(); + if (ObjectUtil.isNotEmpty(keyWord)) { + wrapper.and(t -> t.like(TaskEntity::getEnCode, keyWord).or().like(TaskEntity::getFullName, keyWord)); + } + //日期范围(近7天、近1月、近3月、自定义) + if (ObjectUtil.isNotEmpty(pagination.getStartTime()) && ObjectUtil.isNotEmpty(pagination.getEndTime())) { + wrapper.between(TaskEntity::getStartTime, new Date(pagination.getStartTime()), new Date(pagination.getEndTime())); + } + //所属流程 + String templateId = pagination.getTemplateId(); + if (ObjectUtil.isNotEmpty(templateId)) { + wrapper.eq(TaskEntity::getTemplateId, templateId); + } + //所属分类 + String category = pagination.getFlowCategory(); + if (ObjectUtil.isNotEmpty(category)) { + wrapper.in(TaskEntity::getFlowCategory, category.split(",")); + } + //是否已读 + Integer status = pagination.getStatus(); + if (ObjectUtil.isNotEmpty(status)) { + wrapper.in(CirculateEntity::getCirculateRead, status); + } + //发起人员 + String creatorUserId = pagination.getCreatorUserId(); + if (ObjectUtil.isNotEmpty(creatorUserId)) { + wrapper.in(TaskEntity::getCreatorUserId, creatorUserId); + } + //紧急程度 + Integer flowUrgent = pagination.getFlowUrgent(); + if (ObjectUtil.isNotEmpty(flowUrgent)) { + wrapper.in(TaskEntity::getUrgent, flowUrgent); + } + wrapper.orderByDesc(CirculateEntity::getCreatorTime); + Page page = new Page(pagination.getCurrentPage(), pagination.getPageSize()); + Page data = this.selectJoinListPage(page, OperatorVo.class, wrapper); + return pagination.setData(data.getRecords(), page.getTotal()); + } +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/CommentServiceImpl.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/CommentServiceImpl.java new file mode 100644 index 0000000..c189012 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/CommentServiceImpl.java @@ -0,0 +1,241 @@ +package com.yunzhupaas.flowable.service.impl; + +import cn.hutool.core.collection.CollectionUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.flowable.enums.NodeEnum; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.*; +import com.yunzhupaas.flowable.mapper.CommentMapper; +import com.yunzhupaas.flowable.util.MsgUtil; +import com.yunzhupaas.flowable.util.ServiceUtil; +import com.yunzhupaas.flowable.util.TaskUtil; +import com.yunzhupaas.flowable.model.comment.CommentPagination; +import com.yunzhupaas.flowable.model.message.FlowMsgModel; +import com.yunzhupaas.flowable.model.task.FlowModel; +import com.yunzhupaas.flowable.model.task.TaskUserListModel; +import com.yunzhupaas.flowable.model.templatenode.nodejson.MsgConfig; +import com.yunzhupaas.flowable.model.templatenode.nodejson.NodeModel; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.flowable.service.CommentService; +import com.yunzhupaas.flowable.service.TaskService; +import com.yunzhupaas.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +/** + * 流程评论 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Service +public class CommentServiceImpl extends SuperServiceImpl implements CommentService { + + @Autowired + private MsgUtil msgUtil; + @Autowired + private TaskUtil taskUtil; + @Autowired + private ServiceUtil serviceUtil; + @Autowired + private TaskService taskService; + + @Override + public List getlist(CommentPagination pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(CommentEntity::getTaskId, pagination.getTaskId()); + queryWrapper.lambda().isNull(CommentEntity::getDeleteMark); + queryWrapper.lambda().orderByDesc(CommentEntity::getCreatorTime); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage userIPage = this.page(page, queryWrapper); + return pagination.setData(userIPage.getRecords(), page.getTotal()); + } + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + return this.list(queryWrapper); + } + + @Override + public List getlist(List idList) { + List list = new ArrayList<>(); + if (!idList.isEmpty()) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(CommentEntity::getId, idList); + list.addAll(this.list(queryWrapper)); + } + return list; + } + + @Override + public CommentEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(CommentEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(CommentEntity entity) throws WorkFlowException { + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + entity.setId(RandomUtil.uuId()); + if (this.save(entity)) { + this.sendMsg(entity); + } + } + + // 发送评论消息 + public void sendMsg(CommentEntity entity) throws WorkFlowException { + FlowModel flowModel = new FlowModel(); + taskUtil.setFlowModel(entity.getTaskId(), flowModel); + TaskEntity taskEntity = flowModel.getTaskEntity(); + List nodeEntityList = flowModel.getNodeEntityList(); + TemplateNodeEntity start = nodeEntityList.stream() + .filter(e -> e.getNodeType().equals(NodeEnum.start.getType())).findFirst().orElse(null); + if (null == start) { + return; + } + // 开始节点的评论配置 + NodeModel startNode = JsonUtil.getJsonToBean(start.getNodeJson(), NodeModel.class); + MsgConfig commentMsgConfig = startNode.getCommentMsgConfig(); + if (commentMsgConfig.getOn() != 1 && commentMsgConfig.getOn() != 3) { + return; + } + + String text = entity.getText(); + + // 不包含@{ 且 回复ID为空(不发消息) + if (StringUtil.isBlank(text) || !text.contains("@{") && StringUtil.isBlank(entity.getReplyId())) { + return; + } + + List userIds = new ArrayList<>(); + + // 回复的人 + if (StringUtil.isNotEmpty(entity.getReplyId())) { + CommentEntity reply = this.getInfo(entity.getReplyId()); + if (reply != null) { + userIds.add(reply.getCreatorUserId()); + } + } + + String regex = "@\\{([^}]*)\\}"; + + Pattern pattern = Pattern.compile(regex); + + List userNameList = new ArrayList<>(); + + Matcher matcher = pattern.matcher(text); + while (matcher.find()) { + String group = matcher.group(); + userNameList.add(group.substring(2, group.length() - 1)); + } + + // 获取@的人的account + List accountList = new ArrayList<>(); + if (CollectionUtil.isNotEmpty(userNameList)) { + for (String userName : userNameList) { + String[] split = userName.split("/"); + if (split.length >= 2) { + String account = split[split.length - 1]; + accountList.add(account); + } + } + } + + List userList = serviceUtil.getUserByAccount(accountList.stream().distinct().collect(Collectors.toList())); + + List ids = userList.stream().map(UserEntity::getId).collect(Collectors.toList()); + userIds.addAll(ids); + + // 过滤自己 + String userId = UserProvider.getLoginUserId(); + userIds = userIds.stream().filter(e -> !e.equals(userId)).distinct().collect(Collectors.toList()); + + if (userIds.isEmpty()) { + return; + } + + List operatorList = new ArrayList<>(); + List circulateList = new ArrayList<>(); + + List userIdList = new ArrayList<>(userIds); + + TaskUserListModel model = taskService.getTaskUserList(taskEntity.getId()); + + // 经办 + for (OperatorEntity operator : model.getOperatorList()) { + String handleId = operator.getHandleId(); + if (userIdList.contains(handleId)) { + operatorList.add(operator); + userIdList.remove(handleId); + } + } + + // 抄送 + if (!userIdList.isEmpty()) { + for (CirculateEntity circulate : model.getCirculateList()) { + String circulateUserId = circulate.getUserId(); + if (userIdList.contains(circulateUserId)) { + circulateList.add(circulate); + userIdList.remove(circulateUserId); + } + } + } + + // 发起人 + boolean startHandleId = false; + if (!userIdList.isEmpty()) { + if (userIdList.contains(taskEntity.getCreatorUserId())) { + startHandleId = true; + } + } + + // 消息 + FlowMsgModel flowMsgModel = new FlowMsgModel(); + flowMsgModel.setNodeList(flowModel.getNodeEntityList()); + flowMsgModel.setCirculateList(circulateList); + flowMsgModel.setFlowModel(flowModel); + flowMsgModel.setTaskEntity(taskEntity); + flowMsgModel.setOperatorList(operatorList); + flowMsgModel.setStartHandId(startHandleId); + flowMsgModel.setComment(true); + flowMsgModel.setWait(false); + msgUtil.message(flowMsgModel); + } + + @Override + public void update(String id, CommentEntity entity) { + entity.setId(id); + this.updateById(entity); + } + + @Override + public void delete(CommentEntity entity, boolean delComment) { + if (entity != null) { + UserInfo userInfo = UserProvider.getUser(); + if (delComment) { + entity.setDeleteShow(1); + } else { + entity.setDeleteMark(1); + } + entity.setDeleteTime(new Date()); + entity.setDeleteUserId(userInfo.getUserId()); + this.updateById(entity); + } + } +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/CommonServiceImpl.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/CommonServiceImpl.java new file mode 100644 index 0000000..586609a --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/CommonServiceImpl.java @@ -0,0 +1,58 @@ +package com.yunzhupaas.flowable.service.impl; + +import cn.hutool.core.collection.CollectionUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.flowable.entity.CommonEntity; +import com.yunzhupaas.flowable.mapper.CommonMapper; +import com.yunzhupaas.flowable.service.CommonService; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/22 20:32 + */ +@Service +public class CommonServiceImpl extends SuperServiceImpl implements CommonService { + + @Override + public List getCommonByUserId(String userId) { + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(CommonEntity::getCreatorUserId, userId); + + return this.list(queryWrapper); + } + + @Override + public int setCommonFLow(String flowId) { + + UserInfo userInfo = UserProvider.getUser(); + String userId = userInfo.getUserId(); + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(CommonEntity::getFlowId, flowId) + .eq(CommonEntity::getCreatorUserId, userId); + List list = this.list(queryWrapper); + + if (CollectionUtil.isNotEmpty(list)) { + this.removeByIds(list); + return 2; + } else { + CommonEntity entity = new CommonEntity(); + entity.setId(RandomUtil.uuId()); + entity.setFlowId(flowId); + entity.setCreatorUserId(userId); + this.save(entity); + } + return 1; + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/DelegateInfoServiceImpl.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/DelegateInfoServiceImpl.java new file mode 100644 index 0000000..5d1b10d --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/DelegateInfoServiceImpl.java @@ -0,0 +1,219 @@ +package com.yunzhupaas.flowable.service.impl; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.github.yulichang.toolkit.JoinWrappers; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.model.systemconfig.SysConfigModel; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.flowable.entity.DelegateEntity; +import com.yunzhupaas.flowable.entity.DelegateInfoEntity; +import com.yunzhupaas.flowable.mapper.DelegateInfoMapper; +import com.yunzhupaas.flowable.model.delegate.*; +import com.yunzhupaas.flowable.model.message.DelegateModel; +import com.yunzhupaas.flowable.service.DelegateInfoService; +import com.yunzhupaas.flowable.util.MsgUtil; +import com.yunzhupaas.flowable.util.ServiceUtil; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/2 13:41 + */ +@Service +public class DelegateInfoServiceImpl extends SuperServiceImpl + implements DelegateInfoService { + @Autowired + private ServiceUtil serviceUtil; + @Autowired + private MsgUtil msgUtil; + + @Override + public List getList(DelegatePagination pagination) { + Integer type = ObjectUtil.equals(pagination.getType(), 2) ? 0 : 1; + String userId = UserProvider.getLoginUserId(); + MPJLambdaWrapper wrapper = JoinWrappers.lambda(DelegateInfoEntity.class) + .leftJoin(DelegateEntity.class, DelegateEntity::getId, DelegateInfoEntity::getDelegateId) + .selectAs(DelegateInfoEntity::getId, DelegateInfoModel::getId) + .selectAs(DelegateInfoEntity::getDelegateId, DelegateInfoModel::getDelegateId) + .selectAs(DelegateInfoEntity::getToUserName, DelegateInfoModel::getToUserName) + .selectAs(DelegateInfoEntity::getStatus, DelegateInfoModel::getConfirmStatus) + .selectAs(DelegateEntity::getFlowName, DelegateInfoModel::getFlowName) + .selectAs(DelegateEntity::getUserName, DelegateInfoModel::getUserName) + .selectAs(DelegateEntity::getStartTime, DelegateInfoModel::getStartTime) + .selectAs(DelegateEntity::getEndTime, DelegateInfoModel::getEndTime) + .selectAs(DelegateEntity::getType, DelegateInfoModel::getType) + .selectAs(DelegateEntity::getDescription, DelegateInfoModel::getDescription) + .eq(DelegateInfoEntity::getToUserId, userId) + .eq(DelegateEntity::getType, type); + + String keyword = pagination.getKeyword(); + if (StringUtil.isNotBlank(keyword)) { + wrapper.and( + t -> t.like(DelegateEntity::getUserName, keyword).or().like(DelegateEntity::getFlowName, keyword)); + } + + wrapper.orderByDesc(DelegateInfoEntity::getCreatorTime); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + Page data = this.selectJoinListPage(page, DelegateInfoModel.class, wrapper); + List dataList = pagination.setData(data.getRecords(), page.getTotal()); + + List voList = new ArrayList<>(); + long time = new Date().getTime(); + List delegateIds = dataList.stream().map(DelegateInfoModel::getDelegateId).distinct() + .collect(Collectors.toList()); + List list = this.getList(delegateIds); + for (DelegateInfoModel model : dataList) { + DelegateListVO vo = JsonUtil.getJsonToBean(model, DelegateListVO.class); + List infoList = list.stream() + .filter(e -> ObjectUtil.equals(e.getDelegateId(), model.getDelegateId())) + .collect(Collectors.toList()); + long rejectCount = infoList.stream().filter(e -> ObjectUtil.equals(e.getStatus(), 2)).count(); + long acceptCount = infoList.stream().filter(e -> ObjectUtil.equals(e.getStatus(), 1)).count(); + if (time >= vo.getEndTime() || rejectCount == infoList.size()) {// 已失效,1、所有人都拒绝;2、到达结束时间或终止委托 + vo.setStatus(2); + } else if (time >= vo.getStartTime() && acceptCount > 0) {// 生效中,对方接受且到达开始时间的状态 + vo.setStatus(1); + } else {// 未生效,两种场景1:对方已接受但未达到开始时间状态为未生效,2、对方未接受状态为未生效 + vo.setStatus(0); + } + voList.add(vo); + } + return voList; + } + + @Override + public List getList(List delegateIds) { + if (CollectionUtil.isEmpty(delegateIds)) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(DelegateInfoEntity::getDelegateId, delegateIds); + return this.list(queryWrapper); + } + + @Override + public List getList(String delegateId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DelegateInfoEntity::getDelegateId, delegateId); + return this.list(queryWrapper); + } + + @Override + public List getByToUserId(String toUserId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DelegateInfoEntity::getToUserId, toUserId); + return this.list(queryWrapper); + } + + @Override + public List getByToUserIds(List userIds) { + List resList = new ArrayList<>(); + if (CollectionUtil.isEmpty(userIds)) { + return resList; + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(DelegateInfoEntity::getToUserId, userIds); + resList = this.list(queryWrapper); + return resList; + } + + @Override + public void create(DelegateCrForm fo, DelegateEntity delegateEntity) { + this.save(fo.getToUserId(), delegateEntity); + } + + public void save(List toUserIdList, DelegateEntity delegateEntity) { + if (CollectionUtil.isNotEmpty(toUserIdList)) { + Integer type = delegateEntity.getType(); + // 获取全局配置,是否确认 + SysConfigModel sysConfig = serviceUtil.getSysConfig(); + Integer ack = ObjectUtil.equals(type, 0) ? sysConfig.getDelegateAck() : sysConfig.getProxyAck(); + List userList = serviceUtil.getUserName(toUserIdList); + List list = new ArrayList<>(); + for (String toUserId : toUserIdList) { + DelegateInfoEntity entity = new DelegateInfoEntity(); + entity.setId(RandomUtil.uuId()); + entity.setStatus(0); + if (ObjectUtil.equals(ack, 0)) { + entity.setStatus(1); + } + entity.setDelegateId(delegateEntity.getId()); + entity.setToUserId(toUserId); + UserEntity user = userList.stream().filter(e -> ObjectUtil.equals(e.getId(), toUserId)).findFirst() + .orElse(null); + if (null != user) { + entity.setToUserName(user.getRealName() + "/" + user.getAccount()); + } + list.add(entity); + } + this.saveBatch(list); + + // 委托消息 + UserInfo userInfo = UserProvider.getUser(); + DelegateModel model = new DelegateModel(); + model.setToUserIds(toUserIdList); + model.setType(type); + model.setUserInfo(userInfo); + model.setDelegate(ObjectUtil.equals(type, 0)); + msgUtil.delegateMsg(model); + } + } + + @Override + public void update(DelegateUpForm fo, DelegateEntity delegateEntity) { + String delegateId = delegateEntity.getId(); + List toUserIdList = fo.getToUserId(); + if (CollectionUtil.isNotEmpty(toUserIdList)) { + List createList = new ArrayList<>(); + List deleteList = new ArrayList<>(); + List list = this.getList(delegateId); + + for (String userId : toUserIdList) { + DelegateInfoEntity infoEntity = list.stream() + .filter(e -> ObjectUtil.equals(e.getToUserId(), userId)).findFirst().orElse(null); + if (null == infoEntity) { + createList.add(userId); + } + } + for (DelegateInfoEntity entity : list) { + String userId = toUserIdList.stream() + .filter(e -> ObjectUtil.equals(entity.getToUserId(), e)).findFirst().orElse(null); + if (StringUtil.isEmpty(userId)) { + deleteList.add(entity.getToUserId()); + } + } + if (CollectionUtil.isNotEmpty(deleteList)) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(DelegateInfoEntity::getDelegateId, delegateId) + .in(DelegateInfoEntity::getToUserId, deleteList); + this.remove(wrapper); + } + if (CollectionUtil.isNotEmpty(createList)) { + this.save(createList, delegateEntity); + } + } + } + + @Override + public void delete(String delegateId) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(DelegateInfoEntity::getDelegateId, delegateId); + this.remove(wrapper); + } + +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/DelegateServiceImpl.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/DelegateServiceImpl.java new file mode 100644 index 0000000..8c8e784 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/DelegateServiceImpl.java @@ -0,0 +1,445 @@ +package com.yunzhupaas.flowable.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.bean.copier.CopyOptions; +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.google.common.collect.ImmutableList; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.constant.PermissionConst; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.DelegateEntity; +import com.yunzhupaas.flowable.entity.DelegateInfoEntity; +import com.yunzhupaas.flowable.entity.TemplateEntity; +import com.yunzhupaas.flowable.entity.TemplateJsonEntity; +import com.yunzhupaas.flowable.mapper.DelegateMapper; +import com.yunzhupaas.flowable.model.candidates.CandidateUserVo; +import com.yunzhupaas.flowable.model.delegate.DelegateCrForm; +import com.yunzhupaas.flowable.model.delegate.DelegateListVO; +import com.yunzhupaas.flowable.model.delegate.DelegatePagination; +import com.yunzhupaas.flowable.model.delegate.DelegateUpForm; +import com.yunzhupaas.flowable.model.message.DelegateModel; +import com.yunzhupaas.flowable.model.template.TemplatePageLisVO; +import com.yunzhupaas.flowable.model.template.TemplatePagination; +import com.yunzhupaas.flowable.model.util.FlowConstant; +import com.yunzhupaas.flowable.model.util.FlowNature; +import com.yunzhupaas.flowable.service.DelegateInfoService; +import com.yunzhupaas.flowable.service.DelegateService; +import com.yunzhupaas.flowable.service.TemplateJsonService; +import com.yunzhupaas.flowable.service.TemplateService; +import com.yunzhupaas.flowable.util.MsgUtil; +import com.yunzhupaas.flowable.util.ServiceUtil; +import com.yunzhupaas.message.model.SentMessageForm; +import com.yunzhupaas.permission.entity.OrganizeEntity; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.entity.UserRelationEntity; +import com.yunzhupaas.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/13 16:56 + */ +@Service +public class DelegateServiceImpl extends SuperServiceImpl implements DelegateService { + @Autowired + private TemplateService templateService; + @Autowired + private TemplateJsonService templateJsonService; + @Lazy + @Autowired + private MsgUtil msgUtil; + @Autowired + private ServiceUtil serviceUtil; + @Autowired + private DelegateInfoService delegateInfoService; + + @Override + public List getList(DelegatePagination pagination) { + String userId = UserProvider.getLoginUserId(); + String keyword = pagination.getKeyword(); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(DelegateEntity::getUserId, userId); + + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotBlank(keyword)) { + queryWrapper.lambda().like(DelegateInfoEntity::getToUserName, keyword); + } + List delegateInfoList = delegateInfoService.list(queryWrapper); + List delegateIds = delegateInfoList.stream().map(DelegateInfoEntity::getDelegateId).distinct() + .collect(Collectors.toList()); + if (CollectionUtil.isNotEmpty(delegateIds)) { + if (StringUtil.isNotBlank(keyword)) { + wrapper.lambda().and( + e -> e.in(DelegateEntity::getId, delegateIds).or().like(DelegateEntity::getFlowName, keyword)); + } else { + wrapper.lambda().in(DelegateEntity::getId, delegateIds); + } + } else { + if (StringUtil.isNotBlank(keyword)) { + wrapper.lambda().like(DelegateEntity::getFlowName, keyword); + } else { + return new ArrayList<>(); + } + } + if (ObjectUtil.equals(pagination.getType(), 1)) { + wrapper.lambda().eq(DelegateEntity::getType, 0);// 委托 + } else { + wrapper.lambda().eq(DelegateEntity::getType, 1);// 代理 + } + wrapper.lambda().orderByAsc(DelegateEntity::getSortCode).orderByDesc(DelegateEntity::getCreatorTime); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage iPage = this.page(page, wrapper); + List dataList = pagination.setData(iPage.getRecords(), page.getTotal()); + + List voList = new ArrayList<>(); + long time = new Date().getTime(); + List ids = dataList.stream().map(DelegateEntity::getId).distinct().collect(Collectors.toList()); + List list = delegateInfoService.getList(ids); + for (DelegateEntity delegate : dataList) { + DelegateListVO vo = JsonUtil.getJsonToBean(delegate, DelegateListVO.class); + List infoList = list.stream() + .filter(e -> ObjectUtil.equals(e.getDelegateId(), delegate.getId())).collect(Collectors.toList()); + List toUserNameList = infoList.stream().map(DelegateInfoEntity::getToUserName) + .collect(Collectors.toList()); + vo.setToUserName(String.join(",", toUserNameList)); + long rejectCount = infoList.stream().filter(e -> ObjectUtil.equals(e.getStatus(), 2)).count(); + long acceptCount = infoList.stream().filter(e -> ObjectUtil.equals(e.getStatus(), 1)).count(); + if (time >= vo.getEndTime() || rejectCount == infoList.size()) {// 已失效,1、所有人都拒绝;2、到达结束时间或终止委托 + vo.setStatus(2); + } else if (time >= vo.getStartTime() && acceptCount > 0) {// 生效中,对方接受且到达开始时间的状态 + vo.setStatus(1); + } else {// 未生效,两种场景1:对方已接受但未达到开始时间状态为未生效,2、对方未接受状态为未生效 + vo.setStatus(0); + } + if (acceptCount > 0) { + vo.setIsEdit(false); + } + voList.add(vo); + } + return voList; + } + + @Override + public DelegateEntity getInfo(String id) { + if (StringUtil.isBlank(id)) { + return null; + } + return this.getById(id); + } + + @Override + public void create(DelegateCrForm fo) { + String userId = UserProvider.getLoginUserId(); + DelegateEntity entity = JsonUtil.getJsonToBean(fo, DelegateEntity.class); + entity.setId(RandomUtil.uuId()); + entity.setSortCode(RandomUtil.parses()); + entity.setCreatorUserId(userId); + + this.save(entity); + delegateInfoService.create(fo, entity); + } + + @Override + public boolean update(DelegateEntity entity, DelegateUpForm fo) { + BeanUtil.copyProperties(fo, entity, CopyOptions.create().setIgnoreNullValue(true)); + UserInfo userInfo = UserProvider.getUser(); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(userInfo.getUserId()); + delegateInfoService.update(fo, entity); + return this.updateById(entity); + } + + @Override + public boolean updateStop(String id, DelegateEntity entity) { + UserInfo userInfo = UserProvider.getUser(); + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(userInfo.getUserId()); + DelegateModel delegate = new DelegateModel(); + List infoList = delegateInfoService.getList(entity.getId()); + delegate.setToUserIds(infoList.stream().map(DelegateInfoEntity::getToUserId).collect(Collectors.toList())); + delegate.setType(FlowNature.EndMsg); + delegate.setUserInfo(userInfo); + boolean isDelegate = ObjectUtil.equals(entity.getType(), 0); + delegate.setDelegate(isDelegate); + msgUtil.delegateMsg(delegate); + return this.updateById(entity); + } + + @Override + public void delete(DelegateEntity entity) { + this.removeById(entity.getId()); + } + + @Override + public List getToUser(String userId, String flowId) { + Date thisTime = DateUtil.getNowDate(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DelegateEntity::getType, 1); + queryWrapper.lambda().le(DelegateEntity::getStartTime, thisTime).ge(DelegateEntity::getEndTime, thisTime); + if (StringUtil.isNotEmpty(userId)) { + queryWrapper.lambda().eq(DelegateEntity::getUserId, userId); + } + List list = this.list(queryWrapper); + List listRes = new ArrayList<>(); + if (StringUtil.isNotEmpty(flowId)) { + for (DelegateEntity item : list) { + if (StringUtil.isNotEmpty(item.getFlowId())) { + String[] split = item.getFlowId().split(","); + if (Arrays.asList(split).contains(flowId)) { + listRes.add(item); + } + } else {// 为空是全部流程 + listRes.add(item); + } + } + } else { + listRes = list; + } + List toUser = new ArrayList<>(); + if (CollectionUtil.isNotEmpty(listRes)) { + List ids = listRes.stream().map(DelegateEntity::getId).distinct().collect(Collectors.toList()); + List infoList = delegateInfoService.getList(ids); + toUser = infoList.stream().filter(e -> ObjectUtil.equals(e.getStatus(), 1)) + .map(DelegateInfoEntity::getToUserId).collect(Collectors.toList()); + } + return toUser; + } + + @Override + public List getByToUserId(String toUserId) { + return this.getByToUserId(toUserId, 1); + } + + // 根据 被委托人/代理人id 获取列表 + @Override + public List getByToUserId(String toUserId, Integer type) { + List infoList = delegateInfoService.getByToUserId(toUserId); + List ids = infoList.stream().filter(e -> ObjectUtil.equals(e.getStatus(), 1)) + .map(DelegateInfoEntity::getDelegateId).distinct().collect(Collectors.toList()); + List list = new ArrayList<>(); + if (CollectionUtil.isNotEmpty(ids)) { + Date thisTime = DateUtil.getNowDate(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(DelegateEntity::getId, ids).eq(DelegateEntity::getType, type) + .le(DelegateEntity::getStartTime, thisTime).ge(DelegateEntity::getEndTime, thisTime); + list = this.list(queryWrapper); + } + return list; + } + + // 获取我的委托发起(统一到发起流程列表,待删除) + @Override + public List getFlow(TemplatePagination pagination) { + List list = this.getLaunchDelagateList(); + if (list.isEmpty()) { + return new ArrayList<>(); + } + + List templateIdList = new ArrayList<>(); + int num = 0; + for (DelegateEntity entity : list) { + if (StringUtil.isNotEmpty(entity.getFlowId())) { + templateIdList.addAll(Arrays.asList(entity.getFlowId().split(","))); + } + num += StringUtil.isEmpty(entity.getFlowId()) ? 1 : 0; + } + if (num == 0) { + pagination.setTemplateIdList(templateIdList); + } + + List templateList = templateService.getListAll(pagination, true); + return JsonUtil.getJsonToList(templateList, TemplatePageLisVO.class); + } + + @Override + public ListVO getUserList(String templateId) throws WorkFlowException { + String userId = UserProvider.getLoginUserId(); + TemplateEntity template = templateService.getById(templateId); + if (null == template) { + TemplateJsonEntity jsonEntity = templateJsonService.getById(templateId); + if (null != jsonEntity) { + template = templateService.getById(jsonEntity.getTemplateId()); + } + } + if (null == template) { + throw new WorkFlowException(MsgCode.WF122.get()); + } + if (!ObjectUtil.equals(template.getStatus(), 1)) { + throw new WorkFlowException(MsgCode.WF140.get()); + } + List userIds = this.getDelegateUser(userId, template); + List userName = serviceUtil.getUserName(userIds); + + List userIdAll = userName.stream().map(UserEntity::getId).collect(Collectors.toList()); + Map> userMap = serviceUtil.getListByUserIdAll(userIdAll).stream() + .filter(t -> PermissionConst.ORGANIZE.equals(t.getObjectType())) + .collect(Collectors.groupingBy(UserRelationEntity::getUserId)); + List jsonToList = new ArrayList<>(); + for (UserEntity entity : userName) { + List listByUserId = userMap.get(entity.getId()) != null ? userMap.get(entity.getId()) + : new ArrayList<>(); + StringJoiner joiner = new StringJoiner(","); + for (UserRelationEntity relation : listByUserId) { + List organizeId = serviceUtil.getOrganizeId(relation.getObjectId()); + if (organizeId.size() > 0) { + String organizeName = organizeId.stream().map(OrganizeEntity::getFullName) + .collect(Collectors.joining("/")); + joiner.add(organizeName); + } + } + CandidateUserVo vo = JsonUtil.getJsonToBean(entity, CandidateUserVo.class); + vo.setFullName(entity.getRealName() + "/" + entity.getAccount()); + vo.setHeadIcon(UploaderUtil.uploaderImg(entity.getHeadIcon())); + vo.setOrganize(joiner.toString()); + jsonToList.add(vo); + } + if (jsonToList.isEmpty()) { + throw new WorkFlowException(MsgCode.WF125.get()); + } + ListVO vo = new ListVO<>(); + vo.setList(jsonToList); + return vo; + } + + public List getDelegateUser(String userId, TemplateEntity template) throws WorkFlowException { + List ids = new ArrayList<>(); + List delegateList = this.getByToUserId(userId, 0); + if (CollectionUtil.isNotEmpty(delegateList)) { + int permissionCount = 0; + for (DelegateEntity delegateEntity : delegateList) { + String flowId = delegateEntity.getFlowId(); + if (StringUtil.isNotBlank(flowId)) { + if (flowId.contains(template.getId())) { + if (ObjectUtil.equals(template.getVisibleType(), 1)) { + ids.add(delegateEntity.getUserId()); + continue; + } + List launchPermission = serviceUtil.getLaunchPermission(delegateEntity.getUserId()); + if (launchPermission.contains(template.getId())) { + ids.add(delegateEntity.getUserId()); + } else { + permissionCount++; + } + } + } else { + // 全部流程 + if (ObjectUtil.equals(template.getVisibleType(), 1)) { + ids.add(delegateEntity.getUserId()); + continue; + } + List launchPermission = serviceUtil.getLaunchPermission(delegateEntity.getUserId()); + if (launchPermission.contains(template.getId())) { + ids.add(delegateEntity.getUserId()); + } else { + permissionCount++; + } + } + } + if (CollectionUtil.isEmpty(ids) && delegateList.size() == permissionCount) { + throw new WorkFlowException(MsgCode.WF129.get()); + } + } + return ids; + } + + /** + * 获取当前用户所有发起委托列表 + */ + @Override + public List getLaunchDelagateList() { + String userId = UserProvider.getLoginUserId(); + Date thisTime = DateUtil.getNowDate(); + List infoList = delegateInfoService.getByToUserId(userId); + List ids = infoList.stream().filter(e -> ObjectUtil.equals(e.getStatus(), 1)) + .map(DelegateInfoEntity::getDelegateId).distinct().collect(Collectors.toList()); + if (CollectionUtil.isEmpty(ids)) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(DelegateEntity::getId, ids) + .le(DelegateEntity::getStartTime, thisTime).ge(DelegateEntity::getEndTime, thisTime) + .eq(DelegateEntity::getType, 0); + return this.list(queryWrapper); + } + + @Override + public List selectSameParamAboutDelaget(DelegateCrForm fo) { + List infoList = delegateInfoService.getByToUserIds(fo.getToUserId()); + if (CollectionUtil.isEmpty(infoList)) { + return new ArrayList<>(); + } + List ids = infoList.stream().map(DelegateInfoEntity::getDelegateId).distinct() + .collect(Collectors.toList()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DelegateEntity::getUserId, fo.getUserId()).in(DelegateEntity::getId, ids) + .eq(DelegateEntity::getType, Integer.valueOf(fo.getType())) + .gt(DelegateEntity::getEndTime, new Date()); + return this.list(queryWrapper); + } + + @Override + public List getList() { + String userId = UserProvider.getLoginUserId(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .and(t -> t.eq(DelegateEntity::getCreatorUserId, userId).or().eq(DelegateEntity::getUserId, userId)); + return this.baseMapper.selectList(queryWrapper); + } + + @Override + public void notarize(DelegateInfoEntity delegateInfo) { + delegateInfoService.updateById(delegateInfo); + // 判断全部拒绝,更新时间 + DelegateEntity entity = this.getById(delegateInfo.getDelegateId()); + List infoList = delegateInfoService.getList(entity.getId()); + boolean isAllReject = infoList.stream().allMatch(e -> ObjectUtil.equals(e.getStatus(), 2)); + if (isAllReject) { + Date date = new Date(); + entity.setStartTime(date); + entity.setEndTime(date); + this.updateById(entity); + } + if (!ObjectUtil.equals(delegateInfo.getStatus(), 0)) { + UserInfo userInfo = UserProvider.getUser(); + List toUserIds = ImmutableList.of(entity.getUserId()); + + SentMessageForm flowMsgModel = new SentMessageForm(); + flowMsgModel.setToUserIds(toUserIds); + flowMsgModel.setUserInfo(userInfo); + flowMsgModel.setTemplateId("PZXTLG022"); + Map parameterMap = new HashMap<>(); + parameterMap.put(FlowConstant.MANDATOR, userInfo.getUserName()); + parameterMap.put(FlowConstant.TITLE, ObjectUtil.equals(entity.getType(), 0) ? "委托" : "代理"); + parameterMap.put(FlowConstant.ACTION, ObjectUtil.equals(delegateInfo.getStatus(), 1) ? "接受" : "拒绝"); + flowMsgModel.setParameterMap(parameterMap); + + Integer delegateType = FlowNature.EndMsg.equals(entity.getType()) ? 0 + : ObjectUtil.equals(entity.getType(), 0) ? 1 : 3; + Map contentMsg = new HashMap<>(); + contentMsg.put("type", delegateType + ""); + flowMsgModel.setContentMsg(contentMsg); + flowMsgModel.setFlowType(2); + flowMsgModel.setType(2); + + List messageListAll = new ArrayList<>(); + messageListAll.add(flowMsgModel); + serviceUtil.sendDelegateMsg(messageListAll); + } + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/LaunchUserServiceImpl.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/LaunchUserServiceImpl.java new file mode 100644 index 0000000..88a01a2 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/LaunchUserServiceImpl.java @@ -0,0 +1,70 @@ +package com.yunzhupaas.flowable.service.impl; + +import cn.hutool.core.collection.CollectionUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import jakarta.annotation.Resource; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.flowable.entity.LaunchUserEntity; +import com.yunzhupaas.flowable.mapper.LaunchUserMapper; +import com.yunzhupaas.flowable.service.LaunchUserService; +import com.yunzhupaas.flowable.util.ServiceUtil; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.util.RandomUtil; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/18 9:46 + */ +@Service +public class LaunchUserServiceImpl extends SuperServiceImpl + implements LaunchUserService { + @Resource + private ServiceUtil serviceUtil; + + @Override + public LaunchUserEntity getInfoByTask(String taskId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(LaunchUserEntity::getTaskId, taskId); + return this.getOne(queryWrapper); + } + + @Override + public void createLaunchUser(String taskId, String userId) { + LaunchUserEntity launchUserEntity = this.getInfoByTask(taskId); + if (null != launchUserEntity) { + return; + } + UserEntity user = serviceUtil.getUserInfo(userId); + if (null != user) { + LaunchUserEntity entity = new LaunchUserEntity(); + entity.setId(RandomUtil.uuId()); + entity.setTaskId(taskId); + entity.setOrganizeId(user.getOrganizeId()); + entity.setPositionId(user.getPositionId()); + entity.setManagerId(user.getManagerId()); + List list = serviceUtil.getListByManagerId(user.getId()); + String subordinate = list.stream().map(UserEntity::getId).collect(Collectors.joining(",")); + entity.setSubordinate(subordinate); + entity.setSuperior(user.getManagerId()); + // Department用到时,再递归获取 serviceUtil.getDepartmentAll + this.save(entity); + } + } + + @Override + public void delete(String taskId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(LaunchUserEntity::getTaskId, taskId); + List list = this.list(queryWrapper); + if (CollectionUtil.isNotEmpty(list)) { + this.removeByIds(list); + } + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/NodeRecordServiceImpl.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/NodeRecordServiceImpl.java new file mode 100644 index 0000000..cf42340 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/NodeRecordServiceImpl.java @@ -0,0 +1,57 @@ +package com.yunzhupaas.flowable.service.impl; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.flowable.entity.NodeRecordEntity; +import com.yunzhupaas.flowable.mapper.NodeRecordMapper; +import com.yunzhupaas.flowable.model.record.NodeRecordModel; +import com.yunzhupaas.flowable.service.NodeRecordService; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RandomUtil; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/6/25 17:08 + */ +@Service +public class NodeRecordServiceImpl extends SuperServiceImpl + implements NodeRecordService { + @Override + public List getList(String taskId) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(NodeRecordEntity::getTaskId, taskId).orderByAsc(NodeRecordEntity::getCreatorTime); + return this.list(wrapper); + } + + @Override + public void create(NodeRecordModel model) { + NodeRecordEntity entity = JsonUtil.getJsonToBean(model, NodeRecordEntity.class); + entity.setId(RandomUtil.uuId()); + this.save(entity); + } + + @Override + public void update(NodeRecordModel model) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(NodeRecordEntity::getTaskId, model.getTaskId()) + .eq(NodeRecordEntity::getNodeCode, model.getNodeCode()); + if (ObjectUtil.isNotEmpty(model.getNodeId())) { + wrapper.lambda().eq(NodeRecordEntity::getNodeId, model.getNodeId()); + } + wrapper.lambda().orderByDesc(NodeRecordEntity::getCreatorTime); + List list = this.list(wrapper); + if (CollectionUtil.isNotEmpty(list)) { + NodeRecordEntity entity = list.get(0); + entity.setNodeStatus(model.getNodeStatus()); + this.updateById(entity); + } + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/OperatorServiceImpl.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/OperatorServiceImpl.java new file mode 100644 index 0000000..fcc4687 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/OperatorServiceImpl.java @@ -0,0 +1,2116 @@ +package com.yunzhupaas.flowable.service.impl; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.github.yulichang.toolkit.JoinWrappers; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.google.common.collect.ImmutableList; +import com.yunzhupaas.base.model.flow.FlowFormDataModel; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.*; +import com.yunzhupaas.flowable.enums.NodeEnum; +import com.yunzhupaas.flowable.enums.OperatorStateEnum; +import com.yunzhupaas.flowable.enums.RecordEnum; +import com.yunzhupaas.flowable.enums.TaskStatusEnum; +import com.yunzhupaas.flowable.job.FlowJobUtil; +import com.yunzhupaas.flowable.mapper.OperatorMapper; +import com.yunzhupaas.flowable.model.candidates.CandidateCheckFo; +import com.yunzhupaas.flowable.model.candidates.CandidateCheckVo; +import com.yunzhupaas.flowable.model.flowable.*; +import com.yunzhupaas.flowable.model.message.FlowMsgModel; +import com.yunzhupaas.flowable.model.operator.*; +import com.yunzhupaas.flowable.model.record.NodeRecordModel; +import com.yunzhupaas.flowable.model.task.AuditModel; +import com.yunzhupaas.flowable.model.task.FlowMethod; +import com.yunzhupaas.flowable.model.task.FlowModel; +import com.yunzhupaas.flowable.model.task.TaskPagination; +import com.yunzhupaas.flowable.model.templatejson.TemplateJsonInfoVO; +import com.yunzhupaas.flowable.model.templatenode.BackNodeModel; +import com.yunzhupaas.flowable.model.templatenode.FlowErrorModel; +import com.yunzhupaas.flowable.model.templatenode.nodejson.NodeModel; +import com.yunzhupaas.flowable.model.util.FlowContextHolder; +import com.yunzhupaas.flowable.model.util.FlowNature; +import com.yunzhupaas.flowable.model.util.SystemAuditHolder; +import com.yunzhupaas.flowable.model.util.SystemAuditModel; +import com.yunzhupaas.flowable.service.*; +import com.yunzhupaas.flowable.util.*; +import com.yunzhupaas.model.FlowWorkListVO; +import com.yunzhupaas.model.FlowWorkModel; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.model.user.WorkHandoverModel; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RedisUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/18 15:30 + */ +@Service +public class OperatorServiceImpl extends SuperServiceImpl implements OperatorService { + @Autowired + private FlowAbleUrl flowAbleUrl; + @Autowired + private TaskUtil taskUtil; + @Autowired + private TaskService taskService; + @Autowired + private ServiceUtil serviceUtil; + @Autowired + private OperatorUtil operatorUtil; + @Autowired + private ConditionService conditionService; + @Autowired + private TemplateNodeService templateNodeService; + @Autowired + private TemplateJsonService templateJsonService; + @Autowired + private RecordUtil recordUtil; + @Autowired + private CirculateUtil circulateUtil; + @Autowired + private CandidatesService candidatesService; + @Autowired + private MsgUtil msgUtil; + @Autowired + private RejectDataService rejectDataService; + @Autowired + private RecordService recordService; + @Autowired + private LaunchUserService launchUserService; + @Autowired + private DelegateService delegateService; + @Autowired + private TemplateService templateService; + @Autowired + private ButtonUtil buttonUtil; + @Autowired + private RedisUtil redisUtil; + @Autowired + private NodeRecordService nodeRecordService; + @Autowired + private TaskLineService taskLineService; + @Autowired + private RevokeService revokeService; + + @Override + public OperatorEntity getInfo(String id) throws WorkFlowException { + if (StringUtil.isBlank(id)) { + return null; + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OperatorEntity::getId, id); + OperatorEntity operator = this.getOne(queryWrapper); + if (null == operator) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + return operator; + } + + @Override + public List getList(String taskId) { + if (StringUtil.isBlank(taskId)) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OperatorEntity::getTaskId, taskId).orderByDesc(OperatorEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getList(TaskPagination pagination) { + String loginUserId = StringUtil.isNotEmpty(pagination.getUserId()) ? pagination.getUserId() + : UserProvider.getLoginUserId(); + List statusList = ImmutableList.of(1, 2); + MPJLambdaWrapper wrapper = JoinWrappers.lambda(OperatorEntity.class) + .selectAll(OperatorEntity.class) + .selectAs(OperatorEntity::getStatus, OperatorVo::getStatus) + .selectAs(OperatorEntity::getNodeName, OperatorVo::getCurrentNodeName) + .selectAs(TaskEntity::getCreatorUserId, OperatorVo::getCreatorUserId) + .selectAs(TaskEntity::getUrgent, OperatorVo::getFlowUrgent) + .selectAs(TaskEntity::getFullName, OperatorVo::getFullName) + .selectAs(TaskEntity::getFlowName, OperatorVo::getFlowName) + .selectAs(TaskEntity::getStartTime, OperatorVo::getStartTime) + .selectAs(TaskEntity::getFlowId, OperatorVo::getFlowId) + .selectAs(TaskEntity::getFlowVersion, OperatorVo::getFlowVersion) + .selectAs(TaskEntity::getFlowCategory, OperatorVo::getFlowCategory) + .leftJoin(TaskEntity.class, TaskEntity::getId, OperatorEntity::getTaskId) + .leftJoin(TemplateEntity.class, TemplateEntity::getId, TaskEntity::getTemplateId) + .in(TemplateEntity::getStatus, statusList) + .eq(OperatorEntity::getCompletion, 0) + .ne(OperatorEntity::getStatus, OperatorStateEnum.Futility.getCode()) + .ne(OperatorEntity::getStatus, OperatorStateEnum.Waiting.getCode()) + .ne(TaskEntity::getStatus, TaskStatusEnum.CANCEL.getCode()) + .ne(TaskEntity::getStatus, TaskStatusEnum.REVOKED.getCode()); + + Integer status = pagination.getStatus(); + switch (pagination.getCategory()) { + case "0": // 待签 + wrapper.isNull(OperatorEntity::getSignTime).isNull(OperatorEntity::getStartHandleTime) + .isNull(OperatorEntity::getHandleStatus); + break; + case "1": // 待办 + wrapper.isNotNull(OperatorEntity::getSignTime).isNull(OperatorEntity::getStartHandleTime) + .isNull(OperatorEntity::getHandleStatus); + break; + case "2": // 在办 + wrapper.isNotNull(OperatorEntity::getSignTime).isNotNull(OperatorEntity::getStartHandleTime) + .isNull(OperatorEntity::getHandleStatus); + break; + case "5": // 批量在办 + wrapper.isNotNull(OperatorEntity::getSignTime).isNotNull(OperatorEntity::getStartHandleTime) + .isNull(OperatorEntity::getHandleStatus) + .ne(OperatorEntity::getStatus, OperatorStateEnum.Assist.getCode()) + .ne(OperatorEntity::getStatus, OperatorStateEnum.AddSign.getCode()); + } + if (null != status) { + if (status == -2) {// 超时 + wrapper.isNotNull(OperatorEntity::getDuedate); + } else {// 7.协办 5.退回 + wrapper.eq(OperatorEntity::getStatus, status); + } + } + // 版本 + String flowId = pagination.getFlowId(); + if (ObjectUtil.isNotEmpty(flowId)) { + wrapper.eq(TaskEntity::getFlowId, flowId); + } + String nodeCode = pagination.getNodeCode(); + if (StringUtil.isNotBlank(nodeCode)) { + wrapper.eq(OperatorEntity::getNodeCode, nodeCode); + } + + Boolean delegateType = pagination.getDelegateType(); + Map delegateListAll = new HashMap<>(); + List handleId = new ArrayList<>(); + // 是否委托 + if (delegateType) { + List delegateList = delegateService.getByToUserId(loginUserId); + for (DelegateEntity delegate : delegateList) { + if (StringUtil.isNotEmpty(delegate.getFlowId())) { + String[] flowIds = delegate.getFlowId().split(","); + delegateListAll.put(delegate.getUserId(), flowIds); + } else { + handleId.add(delegate.getUserId()); + } + } + } + wrapper.and(t -> { + t.eq(OperatorEntity::getHandleId, loginUserId); + if (!handleId.isEmpty()) { + t.or(t1 -> t1.in(OperatorEntity::getHandleId, handleId).ne(OperatorEntity::getStatus, + OperatorStateEnum.Assist.getCode())); + } + if (delegateType) { + for (String key : delegateListAll.keySet()) { + t.or(tw -> tw.in(TaskEntity::getTemplateId, delegateListAll.get(key)) + .eq(OperatorEntity::getHandleId, key) + .ne(OperatorEntity::getStatus, OperatorStateEnum.Assist.getCode())); + } + } + }); + // 关键字 + String keyWord = pagination.getKeyword(); + if (ObjectUtil.isNotEmpty(keyWord)) { + wrapper.and(t -> t.like(TaskEntity::getEnCode, keyWord).or().like(TaskEntity::getFullName, keyWord)); + } + // 所属分类 + String category = pagination.getFlowCategory(); + if (ObjectUtil.isNotEmpty(category)) { + List categoryList = Arrays.stream(category.split(",")).collect(Collectors.toList()); + wrapper.in(TaskEntity::getFlowCategory, categoryList); + } + // 所属流程 + String templateId = pagination.getTemplateId(); + if (ObjectUtil.isNotEmpty(templateId)) { + wrapper.eq(TaskEntity::getTemplateId, templateId); + } + // 紧急程度 + Integer flowUrgent = pagination.getFlowUrgent(); + if (ObjectUtil.isNotEmpty(flowUrgent)) { + wrapper.eq(TaskEntity::getUrgent, flowUrgent); + } + // 发起人员 + String creatorUserId = pagination.getCreatorUserId(); + if (ObjectUtil.isNotEmpty(creatorUserId)) { + wrapper.eq(TaskEntity::getCreatorUserId, creatorUserId); + } + // 日期范围(近7天、近1月、近3月、自定义) + if (ObjectUtil.isNotEmpty(pagination.getStartTime()) && ObjectUtil.isNotEmpty(pagination.getEndTime())) { + wrapper.between(TaskEntity::getStartTime, new Date(pagination.getStartTime()), + new Date(pagination.getEndTime())); + } + wrapper.orderByDesc(OperatorEntity::getCreatorTime); + + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage operatorVoPage = this.selectJoinListPage(page, OperatorVo.class, wrapper); + + for (OperatorVo record : operatorVoPage.getRecords()) { + boolean isUser = record.getHandleId().equals(loginUserId); + record.setDelegateUser(!isUser ? record.getCreatorUserId() : null); + // 待签状态 + if (pagination.getCategory().equals("0")) { + record.setStatus(0); + } + } + return pagination.setData(operatorVoPage.getRecords(), page.getTotal()); + } + + @Override + public List handleOperator(FlowModel flowModel) throws Exception { + TaskEntity taskEntity = flowModel.getTaskEntity(); + List nodeEntityList = flowModel.getNodeEntityList(); + Map nodes = flowModel.getNodes(); + Map formData = flowModel.getFormData(); + String instanceId = taskEntity.getInstanceId(); + String deploymentId = flowModel.getDeploymentId(); + NodeModel global = nodes.get(NodeEnum.global.getType()); + OperatorEntity operatorEntity = flowModel.getOperatorEntity(); + // 最终要返回一个所有节点下的审批人的集合 + List list = new ArrayList<>(); + + // 原来的当前节点 + List srcCurrentList = StringUtil.isNotEmpty(taskEntity.getCurrentNodeCode()) + ? Arrays.stream(taskEntity.getCurrentNodeCode().split(",")).collect(Collectors.toList()) + : new ArrayList<>(); + + // 获取引擎当前任务 + List taskModelList = flowAbleUrl.getCurrentTask(instanceId); + if (CollectionUtil.isEmpty(taskModelList)) { + return list; + } + taskUtil.updateCurrentNode(taskModelList, nodes, taskEntity); + List types = ImmutableList.of(NodeEnum.subFlow.getType(), NodeEnum.approver.getType(), + NodeEnum.processing.getType()); + List errorList = new ArrayList<>(); + + // 生成经办 + for (FlowableTaskModel model : taskModelList) { + // 当前节点已存在,跳过 + if (CollectionUtil.isNotEmpty(srcCurrentList) && srcCurrentList.contains(model.getTaskKey())) { + continue; + } + // 获取对应的节点信息 + TemplateNodeEntity nodeEntity = nodeEntityList.stream() + .filter(e -> e.getNodeCode().equals(model.getTaskKey())).findFirst().orElse(null); + if (null == nodeEntity) { + continue; + } + NodeModel nodeModel = JsonUtil.getJsonToBean(nodeEntity.getNodeJson(), NodeModel.class); + if (nodeModel == null) { + continue; + } + // 不是审批、子流程节点 + if (!types.contains(nodeModel.getType())) { + continue; + } + // 流程参数 + taskUtil.updateGlobalParam(taskEntity, nodeModel, global, flowModel.getFormData()); + flowModel.setFlowableTaskId(model.getTaskId()); + // 处理子流程节点,传递表单数据 + if (nodeModel.getType().equals(NodeEnum.subFlow.getType())) { + if (StringUtil.isEmpty(taskEntity.getRejectDataId()) + && CollectionUtil.isEmpty(flowModel.getErrorRuleUserList())) { + FlowMethod method = new FlowMethod(); + method.setDeploymentId(flowModel.getDeploymentId()); + method.setNodeCode(nodeModel.getNodeId()); + method.setNodes(flowModel.getNodes()); + method.setFormData(flowModel.getFormData()); + List nextApprover = taskUtil.getNextApprover(method); + int nextError = taskUtil.checkNextError(flowModel, nextApprover, true, true, true); + if (nextError == 3) { + errorList.addAll(flowModel.getErrorList()); + flowModel.setErrorList(new ArrayList<>()); + continue; + } else if (nextError == 2) { + throw new WorkFlowException(MsgCode.WF061.get()); + } + } + flowModel.setOperatorEntity(operatorEntity); + operatorUtil.handleSubFlow(nodeEntity, flowModel); + continue; + } + FlowMethod flowMethod = new FlowMethod(); + flowMethod.setTaskEntity(taskEntity); + flowMethod.setNodeEntity(nodeEntity); + flowMethod.setNodeEntityList(nodeEntityList); + flowMethod.setFlowModel(flowModel); + flowMethod.setIsAssign(true); + flowMethod.setIsData(true); + taskUtil.dataTransfer(flowMethod); + flowMethod.setNodeModel(nodeModel); + flowMethod.setFormData(formData); + flowMethod.setDeploymentId(deploymentId); + flowMethod.setNodeCode(nodeEntity.getNodeCode()); + flowMethod.setNodes(nodes); + // 节点自动审批 + if (taskEntity.getRejectDataId() == null) { + int flag = operatorUtil.checkAuto(flowMethod); + if (flag == 1 || flag == 2) { + // 判断下一级是否存在候选人,存在候选人返回false + List nextApprover; + boolean mark = true; + try { + nextApprover = taskUtil.getNextApprover(flowMethod); + } catch (WorkFlowException e) { + nextApprover = null; + mark = false; + } + Map resMap = conditionService.handleCondition(flowMethod); + try { + conditionService.checkCondition(resMap, nodes); + } catch (WorkFlowException e) { + mark = false; + } + // 下一节点的条件判断不满足,不触发系统审批 + if (mark) { + boolean isBranch = taskUtil.checkBranch(nodeModel); + int nextError = taskUtil.checkNextError(flowModel, nextApprover, false, false); + if (!isBranch && taskUtil.checkNextCandidates(nextApprover) && nextError == 0) { + flowModel.setHandleOpinion("系统审批"); + flowModel.setSignImg(null); + flowModel.setFileList(null); + flowModel.setHandleStatus( + flag == 1 ? FlowNature.AuditCompletion : FlowNature.RejectCompletion); + flowMethod.setFlowModel(JsonUtil.getJsonToBean(flowModel, FlowModel.class)); + flowMethod.setNodeModel(nodeModel); + OperatorEntity operator = operatorUtil.saveSystemOperator(flowMethod); + SystemAuditModel systemAuditModel = new SystemAuditModel(); + systemAuditModel.setOperator(operator); + systemAuditModel.setFlowModel(flowMethod.getFlowModel()); + SystemAuditHolder.add(systemAuditModel); + continue; + } + } + } + } + + // 获取审批人 + flowMethod.setErrorRule(true); + flowMethod.setExtraRule(true); + List userIds = taskUtil.userListAll(flowMethod); + // 获取正常的用户 + List users = serviceUtil.getUserName(userIds, true); + // 全局异常处理 + if (users.isEmpty()) { + // 自动通过 + Integer pass = flowMethod.getPass(); + if (pass > 0) { + // 自动审批 要判断候选人等 + boolean mark = true; + List nextApprover; + try { + nextApprover = taskUtil.getNextApprover(flowMethod); + } catch (WorkFlowException e) { + // 异常节点(默认通过)下条件不满足、候选人,走admin兜底方案 + nextApprover = null; + mark = false; + } + Map resMap = conditionService.handleCondition(flowMethod); + try { + conditionService.checkCondition(resMap, nodes); + } catch (WorkFlowException e) { + mark = false; + } + if (mark && !taskUtil.checkBranch(nodeModel) && taskUtil.checkNextCandidates(nextApprover)) { + flowModel.setHandleOpinion( + ObjectUtil.equals(nodeModel.getType(), NodeEnum.processing.getType()) ? "默认办理通过" + : "默认审批通过"); + flowModel.setSignImg(null); + flowModel.setFileList(null); + flowModel.setHandleStatus(FlowNature.AuditCompletion); + flowMethod.setFlowModel(JsonUtil.getJsonToBean(flowModel, FlowModel.class)); + flowMethod.setNodeModel(nodeModel); + OperatorEntity operator = operatorUtil.saveSystemOperator(flowMethod); + SystemAuditModel systemAuditModel = new SystemAuditModel(); + systemAuditModel.setOperator(operator); + systemAuditModel.setFlowModel(flowMethod.getFlowModel()); + SystemAuditHolder.add(systemAuditModel); + continue; + } else { + String admin = serviceUtil.getAdmin(); + UserEntity userEntity = serviceUtil.getUserInfo(admin); + users.add(userEntity); + } + } + // 上一节点审批人指定处理人 + Integer node = flowMethod.getNode(); + if (node > 0) { + operatorUtil.handleErrorRule(nodeModel, errorList); + } + // 无法提交 + Integer notSubmit = flowMethod.getNotSubmit(); + if (notSubmit > 0) { + throw new WorkFlowException(MsgCode.WF061.get()); + } + } + userIds = users.stream().map(UserEntity::getId).collect(Collectors.toList()); + flowMethod.setNodeModel(nodeModel); + flowMethod.setUserIds(userIds); + flowMethod.setFlowModel(flowModel); + List operator = operatorUtil.createOperator(flowMethod); + list.addAll(operator); + } + + if (!errorList.isEmpty()) { + AuditModel model = new AuditModel(); + model.setErrorCodeList(errorList); + throw new WorkFlowException(200, JsonUtil.getObjectToString(model)); + } + flowModel.setList(list); + return list; + } + + @DSTransactional(rollbackFor = Exception.class) + @Override + public void auditWithCheck(String id, FlowModel flowModel) throws Exception { + this.audit(id, flowModel); + } + + @Override + public void audit(String id, FlowModel flowModel) throws Exception { + OperatorEntity operator = operatorUtil.checkOperator(id); + taskUtil.setFlowModel(operator.getTaskId(), flowModel); + TaskEntity taskEntity = flowModel.getTaskEntity(); + String handleOpinion = flowModel.getHandleOpinion(); + String signId = flowModel.getSignId(); + String signImg = flowModel.getSignImg(); + Boolean useSignNext = flowModel.getUseSignNext(); + Map formData = flowModel.getFormData(); + Map nodes = flowModel.getNodes(); + NodeModel global = nodes.get(NodeEnum.global.getType()); + NodeModel nodeModel = nodes.get(operator.getNodeCode()); + TemplateJsonEntity jsonEntity = flowModel.getJsonEntity(); + List nodeEntityList = flowModel.getNodeEntityList(); + TemplateNodeEntity nodeEntity = nodeEntityList.stream() + .filter(e -> StringUtil.equals(e.getNodeCode(), operator.getNodeCode())).findFirst().orElse(null); + String formId = null != nodeEntity ? nodeEntity.getFormId() : ""; + // 获取流程参数 + taskUtil.getGlobalParam(taskEntity, nodeModel, global, formData); + flowModel.setTaskEntity(taskEntity); + RevokeEntity revokeEntity = revokeService.getRevokeTask(taskEntity.getId()); + if (CollectionUtil.isNotEmpty(formData) && null == revokeEntity) { + FlowFormDataModel model = new FlowFormDataModel(); + model.setFormId(formId); + model.setId(taskEntity.getId()); + model.setFormOperates(nodeModel.getFormOperates()); + model.setMap(formData); + model.setFlowId(jsonEntity.getId()); + serviceUtil.saveOrUpdateFormData(model); + } + formData = serviceUtil.infoData(formId, taskEntity.getId()); + // 表单 + if (CollectionUtil.isNotEmpty(formData)) { + flowModel.setFormData(formData); + // 保存表单到线程 + FlowContextHolder.addChildData(taskEntity.getId(), formId, formData, nodeModel.getFormOperates(), false); + } + this.audit(operator, flowModel); + if (useSignNext) { + serviceUtil.updateSign(signId, signImg); + } + serviceUtil.addCommonWordsNum(handleOpinion); + // 保存表单数据 + // FlowContextHolder.delete(taskEntity.getId(), formId); + FlowContextHolder.deleteFormOperator(); + serviceUtil.handleFormData(taskEntity.getFlowId(), true); + } + + @Override + public void audit(OperatorEntity operator, FlowModel flowModel) throws Exception { + TaskEntity taskEntity = flowModel.getTaskEntity(); + // 判断是否审批过 + if (null != operator.getHandleStatus()) { + return; + } + taskUtil.isSuspend(taskEntity); + taskUtil.isCancel(taskEntity); + + if (null == flowModel.getUserInfo()) { + flowModel.setUserInfo(UserProvider.getUser()); + } + RevokeEntity revokeEntity = revokeService.getRevokeTask(taskEntity.getId()); + if (null != revokeEntity) { + // 处理撤销的经办 + operatorUtil.handleRevoke(flowModel, operator, revokeEntity); + return; + } + + List nodeEntityList = flowModel.getNodeEntityList(); + TemplateNodeEntity nodeEntity = nodeEntityList.stream() + .filter(e -> StringUtil.equals(e.getNodeCode(), operator.getNodeCode())).findFirst().orElse(null); + if (nodeEntity == null) { + throw new WorkFlowException(MsgCode.WF076.get()); + } + flowModel.setNodeEntity(nodeEntity); + String deploymentId = flowModel.getDeploymentId(); + Map nodes = flowModel.getNodes(); + NodeModel nodeModel = nodes.get(operator.getNodeCode()); + // 全局节点 + TemplateNodeEntity globalEntity = nodeEntityList.stream() + .filter(e -> StringUtil.equals(NodeEnum.global.getType(), e.getNodeType())).findFirst() + .orElse(new TemplateNodeEntity()); + NodeModel global = JsonUtil.getJsonToBean(globalEntity.getNodeJson(), NodeModel.class); + + // 表单 + Map formData = flowModel.getFormData(); + + if (CollectionUtil.isNotEmpty(flowModel.getCandidateList())) { + // 或签,删除其他人选择的候选人 + if (ObjectUtil.equals(nodeModel.getCounterSign(), 0)) { + NextOrPrevFo nextOrPrevFo = new NextOrPrevFo(); + nextOrPrevFo.setDeploymentId(flowModel.getDeploymentId()); + nextOrPrevFo.setTaskKey(operator.getNodeCode()); + List nextModels = flowAbleUrl.getNext(nextOrPrevFo); + List nextCodes = nextModels.stream().map(FlowableNodeModel::getId).collect(Collectors.toList()); + if (CollectionUtil.isNotEmpty(nextCodes)) { + candidatesService.deleteByCodes(operator.getTaskId(), nextCodes); + } + } + } + // 保存候选人、异常人 + candidatesService.create(flowModel, operator.getTaskId(), nodeEntityList, operator); + + // 流程参数 + taskUtil.updateGlobalParam(taskEntity, nodeModel, global, flowModel.getFormData()); + flowModel.setTaskEntity(taskEntity); + + FlowMethod flowMethod = new FlowMethod(); + Integer handleStatus = flowModel.getHandleStatus(); + if (handleStatus.equals(FlowNature.AuditCompletion)) { + operator.setHandleStatus(FlowNature.AuditCompletion); + flowMethod.setType(RecordEnum.audit.getCode()); + flowModel.setEventStatus(4); + } else { + operator.setHandleStatus(FlowNature.RejectCompletion); + flowMethod.setType(RecordEnum.reject.getCode()); + flowModel.setEventStatus(5); + } + + // 同意、拒绝 + operator.setHandleTime(new Date()); + operator.setCompletion(1); + this.updateById(operator); + if (StringUtil.isNotBlank(operator.getDraftData())) { + // 清除草稿数据 + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.lambda().eq(OperatorEntity::getId, operator.getId()) + .set(OperatorEntity::getDraftData, null); + this.update(updateWrapper); + } + // 记录 + flowMethod.setFlowModel(flowModel); + flowMethod.setOperatorEntity(operator); + recordUtil.createRecord(flowMethod); + + flowMethod.setTaskEntity(taskEntity); + flowMethod.setNodeEntity(nodeEntity); + flowMethod.setNodeEntityList(nodeEntityList); + flowMethod.setDeploymentId(deploymentId); + flowMethod.setFormData(formData); + flowMethod.setNodes(nodes); + flowMethod.setNodeCode(operator.getNodeCode()); + flowMethod.setNodeModel(nodeModel); + flowMethod.setHandleStatus(handleStatus); + // 抄送 + List circulateList = new ArrayList<>(); + if (flowModel.getCopyMsgFlag()) { + circulateList = circulateUtil.circulateList(flowMethod); + } + flowMethod.setCirculateList(circulateList); + + // 判断加签比例 + if (!StringUtil.equals(operator.getParentId(), "0")) { + operatorUtil.handleAddCounterSign(operator, flowModel); + FlowMsgModel flowMsgModel = new FlowMsgModel(); + flowMsgModel.setNodeList(nodeEntityList); + flowMsgModel.setCirculateList(circulateList); + flowMsgModel.setFlowModel(flowModel); + flowMsgModel.setTaskEntity(taskEntity); + flowMsgModel.setNodeCode(nodeEntity.getNodeCode()); + flowMsgModel.setWait(false); + flowMsgModel.setCopy(true); + flowMsgModel.setFormData(FlowContextHolder.getAllData()); + msgUtil.message(flowMsgModel); + return; + } + // 选择分支 + candidatesService.createBranch(flowModel.getBranchList(), operator); + + // 指派的经办无需计算比例,或系统审批 + if (!ObjectUtil.equals(operator.getStatus(), OperatorStateEnum.Assigned.getCode()) + || ObjectUtil.equals(operator.getHandleId(), FlowNature.SYSTEM_CODE)) { + // 判断比例 + boolean auditRes = operatorUtil.checkAudit(flowMethod); + if (!auditRes) { + return; + } + } + operatorUtil.addEvent(flowModel); + Integer tempStatus = flowMethod.getHandleStatus() != null ? flowMethod.getHandleStatus() : handleStatus; + // 判断拒绝后是否继续流转 + if (FlowNature.RejectCompletion.equals(tempStatus) && !global.getHasContinueAfterReject()) { + flowMethod.setOperatorEntity(operator); + flowMethod.setFlowModel(flowModel); + taskUtil.handleEndTask(flowMethod); + return; + } + flowModel.setOperatorEntity(operator); + boolean isRejectDataId = taskEntity.getRejectDataId() != null; + if (isRejectDataId) { + operatorUtil.handleRejectData(flowModel); + } else { + List branchList = candidatesService.getBranch(operator.getTaskId(), operator.getNodeCode()); + Map resMap; + if (branchList.isEmpty()) { + resMap = conditionService.handleCondition(flowMethod); + conditionService.checkCondition(resMap, nodes); + } else { + resMap = conditionService.getForBranch(flowMethod, branchList); + } + taskLineService.create(taskEntity.getId(), resMap); + + // 完成 + CompleteFo fo = new CompleteFo(); + fo.setTaskId(operator.getNodeId()); + fo.setVariables(new HashMap<>(resMap)); + flowAbleUrl.complete(fo); + } + // 节点记录 + NodeRecordModel nodeRecordModel = new NodeRecordModel(); + nodeRecordModel.setTaskId(operator.getTaskId()); + nodeRecordModel.setNodeId(operator.getNodeId()); + nodeRecordModel.setNodeCode(operator.getNodeCode()); + nodeRecordModel.setNodeName(operator.getNodeName()); + nodeRecordModel + .setNodeStatus(ObjectUtil.equals(flowMethod.getHandleStatus(), FlowNature.AuditCompletion) ? 2 : 3); + nodeRecordService.create(nodeRecordModel); + + // 生成下一节点 + List entityList = this.handleOperator(flowModel); + // 删除选择分支 + candidatesService.deleteBranch(operator.getTaskId(), operator.getNodeCode()); + + if (!isRejectDataId) { + boolean isProcessing = ObjectUtil.equals(nodeEntity.getNodeType(), NodeEnum.processing.getType()); + flowModel + .setAction(ObjectUtil.equals(handleStatus, FlowNature.RejectCompletion) ? 2 : isProcessing ? 4 : 1); + operatorUtil.handleTrigger(operator, flowModel); + } + + // 判断任务是否结束 + flowModel.setHandleStatus(flowMethod.getHandleStatus() != null ? flowMethod.getHandleStatus() : handleStatus); + taskUtil.isFinished(flowModel); + + // 消息 + FlowMsgModel flowMsgModel = new FlowMsgModel(); + flowMsgModel.setNodeList(nodeEntityList); + flowMsgModel.setCirculateList(circulateList); + flowMsgModel.setFlowModel(flowModel); + flowMsgModel.setTaskEntity(taskEntity); + flowMsgModel.setNodeCode(nodeEntity.getNodeCode()); + flowMsgModel.setOperatorList(entityList); + if (flowModel.getCopyMsgFlag()) { + flowMsgModel.setCopy(true); + } + if (flowModel.getHandleStatus().equals(FlowNature.AuditCompletion)) { + flowMsgModel.setApprove(true); + } else { + flowMsgModel.setReject(true); + } + flowMsgModel.setFormData(FlowContextHolder.getAllData()); + msgUtil.message(flowMsgModel); + + // 系统审批 + operatorUtil.systemAudit(); + } + + @Override + public void sign(FlowModel flowModel) throws WorkFlowException { + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + if (CollectionUtil.isNotEmpty(flowModel.getIds())) { + List ids = new ArrayList<>(); + if (flowModel.getType().equals(0)) { + operatorUtil.checkBatch(flowModel.getIds(), ids, false); + List list = new ArrayList<>(); + operatorUtil.checkCancel(ids, list); + // 签收 + updateWrapper.lambda().in(OperatorEntity::getId, list) + .set(OperatorEntity::getSignTime, new Date()); + } else { + operatorUtil.checkBatch(flowModel.getIds(), ids, true); + List list = new ArrayList<>(); + operatorUtil.checkCancel(ids, list); + // 退签 + updateWrapper.lambda().in(OperatorEntity::getId, list) + .set(OperatorEntity::getSignTime, null); + } + this.update(updateWrapper); + } + } + + @Override + public void startHandle(FlowModel flowModel) throws WorkFlowException { + List ids = new ArrayList<>(); + operatorUtil.checkBatch(flowModel.getIds(), ids, false); + List list = new ArrayList<>(); + operatorUtil.checkCancel(ids, list); + + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.lambda().in(OperatorEntity::getId, list) + .set(OperatorEntity::getStartHandleTime, new Date()); + this.update(updateWrapper); + } + + @Override + public void saveAudit(String id, FlowModel flowModel) throws WorkFlowException { + OperatorEntity entity = this.getById(id); + if (null == entity) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + TaskEntity taskEntity = taskService.getInfo(entity.getTaskId()); + taskUtil.checkTemplateHide(taskEntity.getTemplateId()); + taskUtil.isSuspend(taskEntity); + taskUtil.isCancel(taskEntity); + entity.setDraftData(JsonUtil.getObjectToString(flowModel.getFormData())); + this.updateById(entity); + } + + @DSTransactional + @Override + public void addSign(String id, FlowModel flowModel) throws Exception { + OperatorEntity operator = operatorUtil.checkOperator(id); + List childList = operatorUtil.getChildList(operator.getId()); + childList = childList.stream() + .filter(e -> ObjectUtil.equals(e.getCompletion(), 0) && !ObjectUtil.equals(e.getStatus(), -1)) + .collect(Collectors.toList()); + if (CollectionUtil.isNotEmpty(childList)) { + throw new WorkFlowException(MsgCode.WF081.get()); + } + AddSignModel parameter = flowModel.getAddSignParameter(); + List idList = parameter.getAddSignUserIdList(); + buttonUtil.checkAddSign(operator, parameter); + // 保存选择分支 + List branchList = flowModel.getBranchList(); + if (CollectionUtil.isNotEmpty(branchList)) { + candidatesService.createBranch(branchList, operator); + } + if (idList.isEmpty() || operator.getStatus().equals(OperatorStateEnum.Transfer.getCode()) + || operator.getStatus().equals(OperatorStateEnum.Assist.getCode())) { + throw new WorkFlowException(MsgCode.WF081.get()); + } + String userId = UserProvider.getLoginUserId(); + if (idList.contains(userId)) { + throw new WorkFlowException(MsgCode.WF106.get()); + } + if (!ObjectUtil.equals(operator.getHandleId(), userId)) { + List delegateList = delegateService.getByToUserId(userId); + List userIds = delegateList.stream().map(DelegateEntity::getUserId).distinct() + .collect(Collectors.toList()); + List filterList = userIds.stream().filter(idList::contains).collect(Collectors.toList()); + if (CollectionUtil.isNotEmpty(filterList)) { + throw new WorkFlowException(MsgCode.WF116.get()); + } + } + // 将之前的加签经办作废 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OperatorEntity::getTaskId, operator.getTaskId()).eq(OperatorEntity::getParentId, id) + .and(i -> i.eq(OperatorEntity::getStatus, OperatorStateEnum.AddSign.getCode()) + .or().eq(OperatorEntity::getStatus, OperatorStateEnum.Recall.getCode())); + List list = this.list(queryWrapper); + if (CollectionUtil.isNotEmpty(list)) { + list.forEach(e -> e.setStatus(OperatorStateEnum.Futility.getCode())); + this.updateBatchById(list); + } + taskUtil.setFlowModel(operator.getTaskId(), flowModel); + TaskEntity taskEntity = flowModel.getTaskEntity(); + taskUtil.checkTemplateHide(taskEntity.getTemplateId()); + taskUtil.isSuspend(taskEntity); + taskUtil.isCancel(taskEntity); + List nodeEntityList = flowModel.getNodeEntityList(); + Map formData = flowModel.getFormData(); + // 表单 + if (CollectionUtil.isNotEmpty(formData)) { + TemplateNodeEntity nodeEntity = nodeEntityList.stream() + .filter(e -> StringUtil.equals(e.getNodeCode(), operator.getNodeCode())).findFirst().orElse(null); + if (null != nodeEntity) { + NodeModel nodeModel = JsonUtil.getJsonToBean(nodeEntity.getNodeJson(), NodeModel.class); + // 保存表单到线程 + FlowContextHolder.addChildData(taskEntity.getId(), nodeEntity.getFormId(), formData, + nodeModel.getFormOperates(), true); + } + } + // 保存候选人、异常人 + candidatesService.create(flowModel, operator.getTaskId(), nodeEntityList, operator); + // 更新经办信息 + operator.setHandleParameter(JsonUtil.getObjectToString(parameter)); + if (parameter.getAddSignType().equals(2)) { + operator.setHandleStatus(FlowNature.AuditCompletion); + } + operator.setCompletion(1); + if (this.updateById(operator)) { + TemplateNodeEntity nodeEntity = nodeEntityList.stream() + .filter(e -> e.getNodeCode().equals(operator.getNodeCode())).findFirst().orElse(null); + if (null == nodeEntity) { + throw new WorkFlowException(MsgCode.WF076.get()); + } + + NodeModel nodeModel = JsonUtil.getJsonToBean(nodeEntity.getNodeJson(), NodeModel.class); + // 全局节点 + TemplateNodeEntity globalEntity = nodeEntityList.stream() + .filter(e -> StringUtil.equals(NodeEnum.global.getType(), e.getNodeType())).findFirst() + .orElse(new TemplateNodeEntity()); + NodeModel global = JsonUtil.getJsonToBean(globalEntity.getNodeJson(), NodeModel.class); + Date date = new Date(); + // 后加签默认同意的记录 + if (parameter.getAddSignType().equals(2)) { + FlowMethod flowMethod = new FlowMethod(); + flowMethod.setType(RecordEnum.audit.getCode()); + flowMethod.setFlowModel(flowModel); + operator.setHandleTime(date); + flowMethod.setOperatorEntity(operator); + recordUtil.createRecord(flowMethod); + } + // 生成加签的经办 + List entityList = new ArrayList<>(); + for (String handleId : idList) { + FlowMethod flowMethod = new FlowMethod(); + flowMethod.setTaskEntity(taskEntity); + flowMethod.setNodeEntity(nodeEntity); + flowMethod.setNodeModel(nodeModel); + flowMethod.setSignFor(global.getHasSignFor()); + flowMethod.setFlowableTaskId(operator.getNodeId()); + OperatorEntity entity = operatorUtil.createOperatorEntity(flowMethod); + entity.setHandleId(handleId); + entity.setParentId(operator.getId()); + entity.setStatus(OperatorStateEnum.AddSign.getCode()); + entityList.add(entity); + if (ObjectUtil.equals(parameter.getCounterSign(), 2)) { + break; + } + } + // 加签记录 + FlowMethod flowMethod = new FlowMethod(); + flowMethod.setFlowModel(flowModel); + operator.setHandleTime(date); + flowMethod.setOperatorEntity(operator); + Integer type = RecordEnum.addSign.getCode(); + flowMethod.setType(type); + flowMethod.setUserId(String.join(",", idList)); + recordUtil.createRecord(flowMethod); + if (CollectionUtil.isNotEmpty(entityList)) { + this.saveBatch(entityList); + // 消息 + FlowMsgModel flowMsgModel = new FlowMsgModel(); + flowMsgModel.setOperatorList(entityList); + flowMsgModel.setNodeList(nodeEntityList); + flowMsgModel.setFlowModel(flowModel); + flowMsgModel.setTaskEntity(taskEntity); + flowMsgModel.setNodeCode(operator.getNodeCode()); + flowMsgModel.setFormData(FlowContextHolder.getAllData()); + msgUtil.message(flowMsgModel); + // 超时 + TimeUtil.timeModel(entityList, flowModel, redisUtil); + } + } + serviceUtil.handleFormData(taskEntity.getFlowId(), false); + } + + @Override + public List getReduceList(String id, ReducePagination pagination) throws WorkFlowException { + RecordEntity record = recordService.getInfo(id); + if (null == record) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + OperatorEntity operator = this.getById(record.getOperatorId()); + if (null == operator) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + if (null == operator.getHandleParameter()) { + throw new WorkFlowException(MsgCode.WF082.get()); + } + pagination.setOperator(operator); + + AddSignModel model = JsonUtil.getJsonToBean(operator.getHandleParameter(), AddSignModel.class); + + List list = new ArrayList<>(); + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OperatorEntity::getTaskId, operator.getTaskId()) + .eq(OperatorEntity::getParentId, operator.getId()) + .ne(OperatorEntity::getStatus, OperatorStateEnum.Futility.getCode()) + .ne(OperatorEntity::getStatus, OperatorStateEnum.Assist.getCode()); + List entityList = this.list(queryWrapper); + if (CollectionUtil.isEmpty(entityList)) { + return list; + } + + // 获取未审批的加签经办 + List todoList = entityList.stream().filter(e -> null == e.getHandleStatus() + && ObjectUtil.equals(e.getCompletion(), 0)).collect(Collectors.toList()); + + // 依次审批,获取未创建经办的人员 + if (ObjectUtil.equals(model.getCounterSign(), 2) && CollectionUtil.isNotEmpty(todoList)) { + List idList = model.getAddSignUserIdList(); + OperatorEntity operatorEntity = todoList.get(0); + int index = idList.indexOf(operatorEntity.getHandleId()); + if (index < idList.size() - 1) { + for (int i = index + 1; i < idList.size(); i++) { + OperatorEntity op = new OperatorEntity(); + op.setHandleId(idList.get(i)); + todoList.add(op); + } + } + } + + return operatorUtil.getReduceUsers(todoList, pagination); + } + + // 减签 + @Override + @DSTransactional + public void reduce(String id, FlowModel flowModel) throws WorkFlowException { + List ids = flowModel.getIds(); + RecordEntity record = recordService.getInfo(id); + if (null == record) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + OperatorEntity operator = this.getById(record.getOperatorId()); + if (null == operator) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OperatorEntity::getTaskId, operator.getTaskId()) + .eq(OperatorEntity::getParentId, operator.getId()) + .ne(OperatorEntity::getStatus, OperatorStateEnum.Futility.getCode()) + .ne(OperatorEntity::getStatus, OperatorStateEnum.Assist.getCode()); + List list = this.list(queryWrapper); + if (CollectionUtil.isEmpty(list)) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + if (CollectionUtil.isNotEmpty(ids)) { + String userId = ids.get(0); + OperatorEntity operatorEntity = list.stream() + .filter(e -> ObjectUtil.equals(e.getHandleId(), userId) && e.getHandleTime() != null).findFirst() + .orElse(null); + if (null != operatorEntity && null != operatorEntity.getHandleStatus()) { + throw new WorkFlowException(MsgCode.WF128.get()); + } + } + AddSignModel model = JsonUtil.getJsonToBean(operator.getHandleParameter(), AddSignModel.class); + boolean inTurn = ObjectUtil.equals(model.getCounterSign(), 2); + + List unApproved = list.stream() + .filter(e -> ObjectUtil.equals(e.getCompletion(), 0) && e.getHandleTime() == null) + .collect(Collectors.toList()); + if (inTurn) { + // 依次审批的处理 + List idList = model.getAddSignUserIdList(); + OperatorEntity entity = unApproved.stream().filter(e -> ids.contains(e.getHandleId())).findFirst() + .orElse(null); + if (null != entity) { + taskUtil.setFlowModel(operator.getTaskId(), flowModel); + Map nodes = flowModel.getNodes(); + NodeModel global = nodes.get(NodeEnum.global.getType()); + + int index = idList.indexOf(entity.getHandleId()); + if (index == idList.size() - 1) { + throw new WorkFlowException(MsgCode.WF109.get()); + } + String handleId = idList.get(index + 1); + // 创建下一个经办 + OperatorEntity newOperator = operatorUtil.createOperator(entity, OperatorStateEnum.AddSign.getCode(), + handleId, global); + this.save(newOperator); + FlowMethod flowMethod = new FlowMethod(); + flowMethod.setFlowModel(flowModel); + flowMethod.setAddSignModel(model); + flowMethod.setOperatorEntity(operator); + flowMethod.setTaskEntity(flowModel.getTaskEntity()); + List nodeEntityList = flowModel.getNodeEntityList(); + flowMethod.setNodeEntityList(nodeEntityList); + TemplateNodeEntity nodeEntity = nodeEntityList.stream() + .filter(e -> ObjectUtil.equals(e.getNodeCode(), operator.getNodeCode())) + .findFirst().orElse(null); + flowMethod.setNodeEntity(nodeEntity); + operatorUtil.improperApproverMessage(flowMethod, newOperator); + // 删除需要减签的经办 + this.removeById(entity); + } + // 更新handleParameter + idList.removeAll(ids); + model.setAddSignUserIdList(idList); + operator.setHandleParameter(JsonUtil.getObjectToString(model)); + this.updateById(operator); + } else { + if (unApproved.size() == 1) { + throw new WorkFlowException(MsgCode.WF109.get()); + } + } + // 记录 + FlowMethod flowMethod = new FlowMethod(); + flowMethod.setFlowModel(flowModel); + flowMethod.setOperatorEntity(operator); + Integer type = RecordEnum.subtractSign.getCode(); + flowMethod.setType(type); + flowMethod.setUserId(String.join(",", ids)); + recordUtil.createRecord(flowMethod); + + if (inTurn) { + return; + } + + List handleIds = list.stream().map(OperatorEntity::getHandleId).collect(Collectors.toList()); + + handleIds.removeAll(ids); + + if (handleIds.isEmpty()) { + // 全部减签 + this.removeByIds(list); + // 还原经办 + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.lambda().eq(OperatorEntity::getId, operator.getId()) + .set(OperatorEntity::getCompletion, 0) + .set(OperatorEntity::getHandleParameter, null); + this.update(updateWrapper); + } else { + List collect = list.stream().filter(t -> ids.contains(t.getHandleId())) + .collect(Collectors.toList()); + this.removeByIds(collect); + } + } + + // 获取可退回的节点 + @Override + public List getFallbacks(String id) throws WorkFlowException { + OperatorEntity operator = this.getInfo(id); + if (null == operator) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + TaskEntity taskEntity = taskService.getInfo(operator.getTaskId()); + if (null == taskEntity) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + TemplateJsonEntity jsonEntity = templateJsonService.getInfo(taskEntity.getFlowId()); + List nodeEntityList = templateNodeService.getList(taskEntity.getFlowId()); + Map nodes = new HashMap<>(); + for (TemplateNodeEntity nodeEntity : nodeEntityList) { + nodes.put(nodeEntity.getNodeCode(), JsonUtil.getJsonToBean(nodeEntity.getNodeJson(), NodeModel.class)); + } + + NodeModel nodeModel = nodes.get(operator.getNodeCode()); + List list = new ArrayList<>(); + + // 获取经办过滤 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OperatorEntity::getTaskId, operator.getTaskId()); + List operatorEntityList = this.list(queryWrapper); + List nodeList = operatorEntityList.stream().map(OperatorEntity::getNodeCode).distinct() + .collect(Collectors.toList()); + + TemplateNodeEntity start = nodeEntityList.stream().filter(e -> e.getNodeType().equals(NodeEnum.start.getType())) + .findFirst().orElse(null); + if (null == start) { + throw new WorkFlowException(MsgCode.WF076.get()); + } + NodeModel startModel = JsonUtil.getJsonToBean(start.getNodeJson(), NodeModel.class); + if (ObjectUtil.equals(nodeModel.getBackNodeCode(), FlowNature.START)) { + BackNodeModel model = new BackNodeModel(); + model.setNodeName(startModel.getNodeName()); + model.setNodeCode(startModel.getNodeId()); + list.add(model); + } else if (ObjectUtil.equals(nodeModel.getBackNodeCode(), FlowNature.UP)) { + List resList = new ArrayList<>(); + List nodeCodeList = new ArrayList<>(); + taskUtil.prevNode(jsonEntity.getFlowableId(), operator.getNodeCode(), nodeEntityList, nodeCodeList); + + List nodeCodes = operatorUtil.getList(taskEntity.getId()).stream() + .filter(e -> !e.getStatus().equals(OperatorStateEnum.Futility.getCode())) + .map(OperatorEntity::getNodeCode).distinct().collect(Collectors.toList()); + nodeCodes.add(start.getNodeCode()); + + for (String nodeCode : nodeCodeList) { + NodeModel node = nodes.get(nodeCode); + // 退回节点包含子流程 + if (null != node && ObjectUtil.equals(node.getType(), NodeEnum.subFlow.getType())) { + throw new WorkFlowException(MsgCode.WF046.get()); + } + if (!nodeCodes.contains(nodeCode)) { + continue; + } + resList.add(nodeCode); + } + + if (resList.isEmpty()) { + resList.addAll(nodeCodeList); + } + + BackNodeModel model = new BackNodeModel(); + model.setNodeName("上级审批节点"); + model.setNodeCode(String.join(",", resList)); + list.add(model); + } else if (ObjectUtil.equals(nodeModel.getBackNodeCode(), FlowNature.Reject)) { + List fallbacks = flowAbleUrl.getFallbacks(operator.getNodeId()); + nodeList.add(start.getNodeCode()); + fallbacks = fallbacks.stream().filter(nodeList::contains).collect(Collectors.toList()); + // 获取经办进行过滤 + List nodeCodeList = operatorUtil.getList(taskEntity.getId()).stream() + .filter(e -> !e.getStatus().equals(OperatorStateEnum.Futility.getCode())) + .map(OperatorEntity::getNodeCode).distinct().collect(Collectors.toList()); + nodeCodeList.add(start.getNodeCode()); + + for (String nodeCode : fallbacks) { + // 过滤没有走过的点 + if (!nodeCodeList.contains(nodeCode) || ObjectUtil.equals(nodeCode, operator.getNodeCode())) { + continue; + } + NodeModel node = nodes.get(nodeCode); + BackNodeModel model = new BackNodeModel(); + model.setNodeName(node.getNodeName()); + model.setNodeCode(node.getNodeId()); + list.add(model); + } + } else { + NodeModel optional = nodes.get(nodeModel.getBackNodeCode()); + if (null != optional) { + BackNodeModel model = new BackNodeModel(); + model.setNodeName(optional.getNodeName()); + model.setNodeCode(nodeModel.getBackNodeCode()); + list.add(model); + } + } + return list; + } + + // 退回 + @DSTransactional + @Override + public void back(String id, FlowModel flowModel) throws Exception { + OperatorEntity operator = operatorUtil.checkOperator(id); + + taskUtil.setFlowModel(operator.getTaskId(), flowModel); + TaskEntity taskEntity = flowModel.getTaskEntity(); + taskUtil.checkTemplateHide(taskEntity.getTemplateId()); + taskUtil.isSuspend(taskEntity); + taskUtil.isCancel(taskEntity); + if (null != taskEntity.getRejectDataId()) { + throw new WorkFlowException(MsgCode.WF083.get()); + } + Map nodes = flowModel.getNodes(); + List nodeEntityList = flowModel.getNodeEntityList(); + String deploymentId = flowModel.getDeploymentId(); + + NodeModel nodeModel = nodes.get(operator.getNodeCode()); + TemplateNodeEntity nodeEntity = nodeEntityList.stream() + .filter(e -> ObjectUtil.equals(e.getNodeCode(), operator.getNodeCode())).findFirst().orElse(null); + flowModel.setNodeEntity(nodeEntity); + + TemplateNodeEntity start = nodeEntityList.stream().filter(e -> e.getNodeType().equals(NodeEnum.start.getType())) + .findFirst().orElse(null); + if (null == start) { + throw new WorkFlowException(MsgCode.WF076.get()); + } + + Integer backType = flowModel.getBackType(); + String backStep = flowModel.getBackNodeCode(); + List stepList = new ArrayList<>(); + if (FlowNature.START.equals(backStep)) { + stepList.add(start.getNodeCode()); + } else { + stepList = StringUtil.isNotEmpty(backStep) ? Arrays.stream(backStep.split(",")).collect(Collectors.toList()) + : new ArrayList<>(); + // 判断没有经过的节点,不能退回 + List nodeCodeList = operatorUtil.getList(taskEntity.getId()).stream() + .filter(e -> !e.getStatus().equals(OperatorStateEnum.Futility.getCode())) + .map(OperatorEntity::getNodeCode).distinct().collect(Collectors.toList()); + nodeCodeList.add(start.getNodeCode()); + for (String step : stepList) { + if (!nodeCodeList.contains(step)) { + throw new WorkFlowException(MsgCode.WF047.get()); + } + } + } + + AfterFo afterFo = new AfterFo(); + afterFo.setDeploymentId(deploymentId); + afterFo.setTaskKeys(stepList); + // 获取目标节点之后的所有节点,将这些节点的经办全部保存、更新状态 + List afterList = flowAbleUrl.getAfter(afterFo); + afterList.addAll(stepList); + afterList = afterList.stream().distinct().collect(Collectors.toList()); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(OperatorEntity::getTaskId, operator.getTaskId()) + .in(OperatorEntity::getNodeCode, afterList); + List list = this.list(wrapper); + + // 当前审批时 保存 任务、经办 转json + RejectDataEntity rejectDataEntity = null; + if (FlowNature.PresentType.equals(backType)) { + rejectDataEntity = rejectDataService.create(taskEntity, list, stepList.get(0)); + } else { + // 子流程处理,重新审批:子流程需删除,当前审批:无需终止 + taskUtil.deleteSubflow(taskEntity.getId(), afterList); + } + + // 更改状态 state 转 -1 + for (OperatorEntity operatorEntity : list) { + operatorEntity.setStatus(OperatorStateEnum.Futility.getCode()); + // 删除超时相关 + FlowJobUtil.deleteByOperatorId(operatorEntity.getId(), redisUtil); + } + this.updateBatchById(list); + + // 记录 + FlowMethod flowMethod = new FlowMethod(); + flowMethod.setType(RecordEnum.back.getCode()); + flowMethod.setFlowModel(flowModel); + flowMethod.setOperatorEntity(operator); + recordUtil.createRecord(flowMethod); + + // 记录作废 + if (ObjectUtil.equals(backType, FlowNature.RestartType)) { + recordService.updateStatusToInvalid(taskEntity.getId(), afterList); + } + + // 节点记录 + NodeRecordModel nodeRecordModel = new NodeRecordModel(); + nodeRecordModel.setTaskId(operator.getTaskId()); + nodeRecordModel.setNodeId(operator.getNodeId()); + nodeRecordModel.setNodeCode(operator.getNodeCode()); + nodeRecordModel.setNodeName(operator.getNodeName()); + nodeRecordModel.setNodeStatus(5); + nodeRecordService.create(nodeRecordModel); + + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.lambda().eq(TaskEntity::getId, operator.getTaskId()); + if (null != rejectDataEntity) { + updateWrapper.lambda().set(TaskEntity::getRejectDataId, rejectDataEntity.getId()); + } + FlowMsgModel flowMsgModel = new FlowMsgModel(); + + flowModel.setAction(3); + flowModel.setOperatorEntity(operator); + if (null != nodeEntity) { + Map map = serviceUtil.infoData(nodeEntity.getFormId(), operator.getTaskId()); + flowModel.setFormData(map); + } + if (!FlowNature.PresentType.equals(backType)) { + operatorUtil.handleTrigger(operator, flowModel); + } + + // 开始节点 + if (stepList.size() == 1 && stepList.get(0).equals(start.getNodeCode())) { + // 更新任务 + updateWrapper.lambda() + .set(TaskEntity::getCurrentNodeName, FlowNature.START_NAME) + .set(TaskEntity::getCurrentNodeCode, FlowNature.START_CODE) + .set(TaskEntity::getStatus, TaskStatusEnum.BACKED.getCode()); + if (rejectDataEntity == null) { + updateWrapper.lambda().set(TaskEntity::getInstanceId, null); + } + taskService.update(updateWrapper); + + List entityList = new ArrayList<>(); + OperatorEntity operatorEntity = new OperatorEntity(); + operatorEntity.setNodeCode(start.getNodeCode()); + operatorEntity.setHandleId(taskEntity.getCreatorUserId()); + entityList.add(operatorEntity); + flowMsgModel.setOperatorList(entityList); + flowMsgModel.setWait(false); + + if (!FlowNature.PresentType.equals(backType)) { + // 删除发起用户 + launchUserService.delete(taskEntity.getId()); + } + // 删除引擎实例 + if (rejectDataEntity == null) { + String instanceId = taskEntity.getInstanceId(); + flowAbleUrl.deleteInstance(instanceId, "back"); + } + } else { + String sourceId = StringUtil.isNotEmpty(flowModel.getBackId()) ? flowModel.getBackId() + : operator.getNodeId(); + BackFo fo = new BackFo(); + fo.setTaskId(sourceId); + fo.setTargetKey(backStep); + flowAbleUrl.back(fo); + List entityList = this.handleOperator(flowModel); + + // 更新状态为退回状态 + for (OperatorEntity entity : entityList) { + entity.setStatus(OperatorStateEnum.Back.getCode()); + } + this.updateBatchById(entityList); + + flowMsgModel.setOperatorList(entityList); + + TimeUtil.timeModel(entityList, flowModel, redisUtil); + + if (null != rejectDataEntity) { + taskService.update(updateWrapper); + } + } + if (!FlowNature.PresentType.equals(backType)) { + // 重新审批,删除候选人 + if (CollectionUtil.isNotEmpty(afterList)) { + candidatesService.deleteByCodes(taskEntity.getId(), afterList); + } + } + + // 消息 + flowMsgModel.setNodeList(nodeEntityList); + flowMsgModel.setFlowModel(flowModel); + flowMsgModel.setTaskEntity(taskEntity); + flowMsgModel.setNodeCode(nodeModel.getNodeId()); + flowMsgModel.setBack(true); + msgUtil.message(flowMsgModel); + + } + + // 撤回 + @DSTransactional + @Override + public void recall(String id, FlowModel flowModel) throws WorkFlowException { + RecordEntity record = flowModel.getRecordEntity(); + OperatorEntity operator = flowModel.getOperatorEntity(); + + taskUtil.setFlowModel(operator.getTaskId(), flowModel); + TaskEntity taskEntity = flowModel.getTaskEntity(); + taskUtil.checkTemplateHide(taskEntity.getTemplateId()); + taskUtil.isSuspend(taskEntity); + taskUtil.isCancel(taskEntity); + List nodeEntityList = flowModel.getNodeEntityList(); + if (CollectionUtil.isEmpty(nodeEntityList)) { + throw new WorkFlowException(MsgCode.WF076.get()); + } + TemplateNodeEntity nodeEntity = nodeEntityList.stream() + .filter(e -> e.getNodeCode().equals(operator.getNodeCode())).findFirst().orElse(null); + if (null == nodeEntity) { + throw new WorkFlowException(MsgCode.WF076.get()); + } + + flowModel.setNodeEntity(nodeEntity); + flowModel.setRecordEntity(record); + flowModel.setFlag(2); + flowModel.setIsException(true); + if (!buttonUtil.checkRecall(flowModel)) { + throw new WorkFlowException(MsgCode.WF077.get()); + } + List nextCodes = flowModel.getNextCodes(); + // 删除子流程 + taskUtil.deleteSubflow(taskEntity.getId(), nextCodes); + + // 更新记录状态 + record.setStatus(FlowNature.Invalid); + recordService.updateById(record); + + // 记录 + FlowMethod flowMethod = new FlowMethod(); + flowMethod.setType(RecordEnum.recall.getCode()); + flowMethod.setFlowModel(flowModel); + operator.setHandleTime(null); + flowMethod.setOperatorEntity(operator); + recordUtil.createRecord(flowMethod); + + List currentNodes = new ArrayList<>(); + String currentNodeCode = taskEntity.getCurrentNodeCode(); + if (StringUtil.isNotBlank(currentNodeCode)) { + currentNodes = Arrays.stream(currentNodeCode.split(",")).collect(Collectors.toList()); + } + if (currentNodes.contains(operator.getNodeCode())) { + // 加签 撤回的处理 + if (!ObjectUtil.equals(operator.getParentId(), "0")) { + OperatorEntity parentEntity = this.getById(operator.getParentId()); + if (null != parentEntity) { + if (ObjectUtil.equals(parentEntity.getCompletion(), 0)) { + parentEntity.setCompletion(1); + this.updateById(parentEntity); + } + } + } + // 当前节点已审批的人 撤回无需跳转 + UpdateWrapper wrapper = new UpdateWrapper<>(); + wrapper.lambda().eq(OperatorEntity::getId, operator.getId()) + .set(OperatorEntity::getCompletion, 0) + .set(OperatorEntity::getStatus, OperatorStateEnum.Recall.getCode()) + .set(OperatorEntity::getHandleStatus, null) + .set(OperatorEntity::getCreatorTime, new Date()) + .set(OperatorEntity::getHandleTime, null); + // 依次审批,删除其他的经办 + if (StringUtil.isNotBlank(operator.getHandleAll()) && ObjectUtil.equals(operator.getParentId(), "0")) { + operatorUtil.deleteInTurnOperator(operator, operator.getHandleId()); + } + this.update(wrapper); + return; + } + // 节点记录 + NodeRecordModel nodeRecordModel = new NodeRecordModel(); + nodeRecordModel.setTaskId(operator.getTaskId()); + nodeRecordModel.setNodeId(operator.getNodeId()); + nodeRecordModel.setNodeCode(operator.getNodeCode()); + nodeRecordModel.setNodeName(operator.getNodeName()); + nodeRecordModel.setNodeStatus(6); + nodeRecordService.update(nodeRecordModel); + + // 删除该节点下一级的经办 + if (CollectionUtil.isNotEmpty(nextCodes)) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(OperatorEntity::getTaskId, taskEntity.getId()) + .in(OperatorEntity::getNodeCode, nextCodes); + List list = this.list(wrapper); + if (CollectionUtil.isNotEmpty(list)) { + this.remove(wrapper); + // 删除超时相关 + FlowJobUtil.deleteByOperatorId(operator.getId(), redisUtil); + for (OperatorEntity operatorEntity : list) { + FlowJobUtil.deleteByOperatorId(operatorEntity.getId(), redisUtil); + } + } + } + + // 撤回跳转 + JumpFo fo = new JumpFo(); + fo.setInstanceId(taskEntity.getInstanceId()); + List executeNodes = this.getNodeCodeByGroupId(nextCodes, flowModel.getNodes()); + if (CollectionUtil.isNotEmpty(executeNodes)) { + nextCodes.addAll(executeNodes); + } + fo.setSource(nextCodes); + List targetList = new ArrayList<>(); + targetList.add(nodeEntity.getNodeCode()); + fo.setTarget(targetList); + flowAbleUrl.jump(fo); + + List taskModelList = flowAbleUrl.getCurrentTask(taskEntity.getInstanceId()); + FlowableTaskModel model = taskModelList.stream().filter(e -> e.getTaskKey().equals(operator.getNodeCode())) + .findFirst().orElse(null); + String nodeId = null; + if (null != model) { + nodeId = model.getTaskId(); + } + + // 还原经办(其它已审批、作废的经办无需还原) + UpdateWrapper wrapper = new UpdateWrapper<>(); + wrapper.lambda().eq(OperatorEntity::getId, operator.getId()) + .set(OperatorEntity::getCompletion, 0) + .set(OperatorEntity::getNodeId, nodeId) + .set(OperatorEntity::getStatus, OperatorStateEnum.Recall.getCode()) + .set(OperatorEntity::getHandleStatus, null) + .set(OperatorEntity::getCreatorTime, new Date()) + .set(OperatorEntity::getHandleTime, null); + this.update(wrapper); + // 更新节点经办的nodeId + wrapper.clear(); + wrapper.lambda().eq(OperatorEntity::getTaskId, operator.getTaskId()) + .eq(OperatorEntity::getNodeCode, operator.getNodeCode()) + .eq(OperatorEntity::getParentId, operator.getParentId()) + .set(OperatorEntity::getNodeId, nodeId); + this.update(wrapper); + + List userIds = new ArrayList<>(); + userIds.add(operator.getHandleId()); + // 获取未审批过的复原 + operatorUtil.recallRestore(operator, nodeId, userIds); + + // 删除该节点下一级的候选人,有修改操作的 + // candidatesService.deleteByCodes(taskEntity.getId(), nextCodes); + candidatesService.delete(taskEntity.getId(), nextCodes, userIds); + + // 超时 + List entityList = new ArrayList<>(); + OperatorEntity entity = this.getById(operator.getId()); + entityList.add(entity); + TimeUtil.timeModel(entityList, flowModel, redisUtil); + + // 获取当前节点信息 + taskUtil.updateCurrentNode(taskModelList, flowModel.getNodes(), taskEntity); + } + + // 根据组ID获取同组的执行节点 + public List getNodeCodeByGroupId(List nextCodes, Map nodes) { + List list = new ArrayList<>(); + if (CollectionUtil.isEmpty(nextCodes) || CollectionUtil.isEmpty(nodes)) { + return list; + } + for (String nextCode : nextCodes) { + NodeModel nodeModel = nodes.get(nextCode); + if (null != nodeModel && ObjectUtil.equals(nodeModel.getType(), NodeEnum.trigger.getType())) { + String groupId = nodeModel.getGroupId(); + for (String key : nodes.keySet()) { + NodeModel model = nodes.get(key); + if (null != model && ObjectUtil.equals(model.getGroupId(), groupId)) { + list.add(key); + } + } + } + } + return list; + } + + // 转审 + @Override + public void transfer(String id, FlowModel flowModel) throws Exception { + String transferUserId = flowModel.getHandleIds(); + OperatorEntity operator = operatorUtil.checkOperator(id); + boolean isProcessing = ObjectUtil.equals(operator.getIsProcessing(), 1); + if (StringUtil.isBlank(transferUserId) || operator.getStatus().equals(OperatorStateEnum.Transfer.getCode()) + || operator.getStatus().equals(OperatorStateEnum.AddSign.getCode())) { + throw new WorkFlowException(isProcessing ? MsgCode.WF151.get() : MsgCode.WF084.get()); + } + String userId = flowModel.getUserInfo() == null ? UserProvider.getLoginUserId() + : flowModel.getUserInfo().getUserId(); + if (StringUtil.equals(transferUserId, userId)) { + throw new WorkFlowException(isProcessing ? MsgCode.WF149.get() : MsgCode.WF107.get()); + } + if (!ObjectUtil.equals(operator.getHandleId(), userId)) { + List delegateList = delegateService.getByToUserId(userId); + List userIds = delegateList.stream().map(DelegateEntity::getUserId).distinct() + .collect(Collectors.toList()); + if (userIds.contains(transferUserId)) { + throw new WorkFlowException(isProcessing ? MsgCode.WF150.get() : MsgCode.WF117.get()); + } + } + + taskUtil.setFlowModel(operator.getTaskId(), flowModel); + TaskEntity taskEntity = flowModel.getTaskEntity(); + taskUtil.checkTemplateHide(taskEntity.getTemplateId()); + taskUtil.isSuspend(taskEntity); + taskUtil.isCancel(taskEntity); + + List nodeEntityList = flowModel.getNodeEntityList(); + + TemplateNodeEntity globalEntity = nodeEntityList.stream() + .filter(e -> StringUtil.equals(NodeEnum.global.getType(), e.getNodeType())).findFirst() + .orElse(new TemplateNodeEntity()); + NodeModel global = JsonUtil.getJsonToBean(globalEntity.getNodeJson(), NodeModel.class); + + // 记录 + FlowMethod flowMethod = new FlowMethod(); + flowMethod.setType(ObjectUtil.equals(operator.getIsProcessing(), 0) ? RecordEnum.transfer.getCode() + : RecordEnum.transferProcessing.getCode()); + flowMethod.setFlowModel(flowModel); + flowMethod.setOperatorEntity(operator); + List userIds = new ArrayList<>(); + userIds.add(transferUserId); + flowMethod.setUserId(String.join(",", userIds)); + recordUtil.createRecord(flowMethod); + + // 更新经办 + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.lambda().eq(OperatorEntity::getId, operator.getId()) + .set(OperatorEntity::getHandleId, transferUserId) + .set(OperatorEntity::getCreatorTime, new Date()) + .set(OperatorEntity::getDraftData, null) + .set(OperatorEntity::getStatus, OperatorStateEnum.Transfer.getCode()); + Boolean flowTodo = serviceUtil.getFlowTodo(); + if (!flowTodo) { + updateWrapper.lambda().set(OperatorEntity::getStartHandleTime, null); + Boolean flowSign = serviceUtil.getFlowSign(); + if (!flowSign) { + if (global != null && global.getHasSignFor()) { + updateWrapper.lambda().set(OperatorEntity::getSignTime, null); + } + } + } + this.update(updateWrapper); + + // 消息 + FlowMsgModel flowMsgModel = new FlowMsgModel(); + List list = new ArrayList<>(); + operator = this.getById(operator.getId()); + list.add(operator); + flowMsgModel.setOperatorList(list); + flowMsgModel.setNodeList(nodeEntityList); + flowMsgModel.setFlowModel(flowModel); + flowMsgModel.setTaskEntity(taskEntity); + flowMsgModel.setNodeCode(operator.getNodeCode()); + flowMsgModel.setFormData(FlowContextHolder.getAllData()); + flowMsgModel.setTransfer(true); + msgUtil.message(flowMsgModel); + + // 删除超时相关 + FlowJobUtil.deleteByOperatorId(operator.getId(), redisUtil); + // 超时 + TimeUtil.timeModel(list, flowModel, redisUtil); + } + + // 协办, 新增经办,节点通过后,删除协办 + @Override + public void assist(String id, FlowModel flowModel) throws WorkFlowException { + String handleIds = flowModel.getHandleIds(); + List ids = Arrays.stream(handleIds.split(",")).collect(Collectors.toList()); + String userId = UserProvider.getLoginUserId(); + if (ids.contains(userId)) { + throw new WorkFlowException(MsgCode.WF108.get()); + } + + OperatorEntity operator = operatorUtil.checkOperator(id); + + if (!ObjectUtil.equals(operator.getHandleId(), userId)) { + List delegateList = delegateService.getByToUserId(userId); + List userIds = delegateList.stream().map(DelegateEntity::getUserId).distinct() + .collect(Collectors.toList()); + List filterList = userIds.stream().filter(ids::contains).collect(Collectors.toList()); + if (CollectionUtil.isNotEmpty(filterList)) { + throw new WorkFlowException(MsgCode.WF118.get()); + } + } + + // QueryWrapper wrapper = new QueryWrapper<>(); + // wrapper.lambda().eq(OperatorEntity::getParentId, + // id).eq(OperatorEntity::getStatus, OperatorStateEnum.Assist.getCode()); + // long count = this.count(wrapper); + // if (count > 0) { + // throw new WorkFlowException(MsgCode.WF085.get()); + // } + + taskUtil.setFlowModel(operator.getTaskId(), flowModel); + TaskEntity taskEntity = flowModel.getTaskEntity(); + taskUtil.checkTemplateHide(taskEntity.getTemplateId()); + taskUtil.isSuspend(taskEntity); + taskUtil.isCancel(taskEntity); + + Map nodes = flowModel.getNodes(); + NodeModel global = nodes.get(NodeEnum.global.getType()); + boolean signFor = false; + if (null != global) { + signFor = global.getHasSignFor(); + } + List userList = serviceUtil.getUserName(ids); + if (CollectionUtil.isNotEmpty(userList)) { + Boolean flowTodo = serviceUtil.getFlowTodo(); + Boolean flowSign = serviceUtil.getFlowSign(); + List list = new ArrayList<>(); + for (UserEntity user : userList) { + OperatorEntity operatorEntity = new OperatorEntity(); + operatorEntity.setParentId(operator.getId()); + operatorEntity.setNodeName(operator.getNodeName()); + operatorEntity.setNodeCode(operator.getNodeCode()); + operatorEntity.setTaskId(operator.getTaskId()); + operatorEntity.setNodeId(operator.getNodeId()); + operatorEntity.setEngineType(operator.getEngineType()); + operatorEntity.setHandleId(user.getId()); + operatorEntity.setStatus(OperatorStateEnum.Assist.getCode()); + operatorEntity.setCompletion(0); + if (flowTodo) { + operatorEntity.setSignTime(new Date()); + operatorEntity.setStartHandleTime(new Date()); + } else { + if (flowSign) { + operatorEntity.setSignTime(new Date()); + } else { + if (!signFor) { + operatorEntity.setSignTime(new Date()); + } + } + } + list.add(operatorEntity); + } + this.saveBatch(list); + + // 记录 + FlowMethod flowMethod = new FlowMethod(); + flowMethod.setType(RecordEnum.assist.getCode()); + flowMethod.setFlowModel(flowModel); + flowMethod.setOperatorEntity(operator); + List userIds = userList.stream().map(UserEntity::getId).collect(Collectors.toList()); + flowMethod.setUserId(String.join(",", userIds)); + recordUtil.createRecord(flowMethod); + + // 消息 + FlowMsgModel flowMsgModel = new FlowMsgModel(); + flowMsgModel.setOperatorList(list); + flowMsgModel.setNodeList(flowModel.getNodeEntityList()); + flowMsgModel.setFlowModel(flowModel); + flowMsgModel.setTaskEntity(taskEntity); + flowMsgModel.setNodeCode(operator.getNodeCode()); + msgUtil.message(flowMsgModel); + } + } + + // 协办保存,仅保存表单数据 + @DSTransactional(rollbackFor = Exception.class) + @Override + public void assistSave(String id, FlowModel flowModel) throws WorkFlowException { + OperatorEntity operator = operatorUtil.checkOperator(id); + taskUtil.setFlowModel(operator.getTaskId(), flowModel); + TaskEntity taskEntity = flowModel.getTaskEntity(); + taskUtil.checkTemplateHide(taskEntity.getTemplateId()); + taskUtil.isSuspend(taskEntity); + taskUtil.isCancel(taskEntity); + Map formData = flowModel.getFormData(); + List nodeEntityList = flowModel.getNodeEntityList(); + TemplateNodeEntity nodeEntity = nodeEntityList.stream() + .filter(e -> e.getNodeCode().equals(operator.getNodeCode())).findFirst().orElse(null); + if (null == nodeEntity) { + throw new WorkFlowException(MsgCode.WF076.get()); + } + NodeModel nodeModel = JsonUtil.getJsonToBean(nodeEntity.getNodeJson(), NodeModel.class); + + FlowContextHolder.addChildData(operator.getTaskId(), nodeEntity.getFormId(), formData, + nodeModel.getFormOperates(), true); + serviceUtil.handleFormData(taskEntity.getFlowId(), false); + } + + @Override + public List batchFlowSelector() { + List batchList = this.getBatchList(); + List taskIdList = batchList.stream().map(OperatorEntity::getTaskId).collect(Collectors.toList()); + + List taskList = taskUtil.getOrderStaList(taskIdList); + + Map> flowList = taskList.stream() + .collect(Collectors.groupingBy(TaskEntity::getTemplateId)); + + List batchFlowList = new ArrayList<>(); + for (String key : flowList.keySet()) { + List flowTaskList = flowList.get(key); + if (CollectionUtil.isNotEmpty(flowTaskList)) { + List taskIds = flowTaskList.stream().map(TaskEntity::getId).collect(Collectors.toList()); + List flowIds = flowTaskList.stream().map(TaskEntity::getFlowId).collect(Collectors.toList()); + List jsonList = templateJsonService.listByIds(flowIds); + + String fullName = flowTaskList.stream().map(TaskEntity::getFlowName).distinct() + .collect(Collectors.joining(",")); + String flowId = jsonList.stream().map(TemplateJsonEntity::getTemplateId).distinct() + .collect(Collectors.joining(",")); + long count = batchList.stream().filter(e -> taskIds.contains(e.getTaskId())).count(); + + FlowBatchModel model = new FlowBatchModel(); + model.setNum(count); + model.setId(flowId); + model.setFullName(fullName + "(" + count + ")"); + batchFlowList.add(model); + } + } + batchFlowList = batchFlowList.stream().sorted(Comparator.comparing(FlowBatchModel::getNum).reversed()) + .collect(Collectors.toList()); + return batchFlowList; + } + + public List getBatchList() { + String userId = UserProvider.getLoginUserId(); + List userList = delegateService.getByToUserId(userId).stream() + .map(DelegateEntity::getCreatorUserId).collect(Collectors.toList()); + userList.add(userId); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(OperatorEntity::getHandleId, userList) + .eq(OperatorEntity::getCompletion, 0) + .ne(OperatorEntity::getStatus, OperatorStateEnum.Futility.getCode()) + .ne(OperatorEntity::getStatus, OperatorStateEnum.Assist.getCode()) + .isNotNull(OperatorEntity::getSignTime).isNotNull(OperatorEntity::getStartHandleTime) + .isNull(OperatorEntity::getHandleStatus) + .select(OperatorEntity::getTaskId); + return this.list(queryWrapper); + } + + @Override + public List batchVersionSelector(String templateId) { + List taskIdList = this.getBatchList().stream().map(OperatorEntity::getTaskId) + .collect(Collectors.toList()); + List taskList = taskUtil.getOrderStaList(taskIdList); + List flowIdList = taskList.stream().filter(e -> e.getTemplateId().equals(templateId)) + .map(TaskEntity::getFlowId).collect(Collectors.toList()); + List batchFlowList = new ArrayList<>(); + if (CollectionUtil.isEmpty(flowIdList)) { + return batchFlowList; + } + + List jsonList = templateJsonService.listByIds(flowIdList); + List templateList = templateService.listByIds( + jsonList.stream().map(TemplateJsonEntity::getTemplateId).distinct().collect(Collectors.toList())); + + for (TemplateJsonEntity jsonEntity : jsonList) { + FlowBatchModel model = JsonUtil.getJsonToBean(jsonEntity, FlowBatchModel.class); + TemplateEntity template = templateList.stream().filter(e -> e.getId().equals(jsonEntity.getTemplateId())) + .findFirst().orElse(null); + if (null != template) { + model.setFullName(template.getFullName() + "(v" + jsonEntity.getVersion() + ")"); + batchFlowList.add(model); + } + } + return batchFlowList; + } + + @Override + public List batchNodeSelector(String flowId) { + List nodeList = templateNodeService.getList(flowId); + List list = new ArrayList<>(); + for (TemplateNodeEntity nodeEntity : nodeList) { + if (NodeEnum.approver.getType().equals(nodeEntity.getNodeType())) { + NodeModel nodeModel = JsonUtil.getJsonToBean(nodeEntity.getNodeJson(), NodeModel.class); + FlowBatchModel model = new FlowBatchModel(); + model.setId(nodeModel.getNodeId()); + model.setFullName(nodeModel.getNodeName()); + list.add(model); + } + } + return list; + } + + @Override + public Map batchNode(FlowModel flowModel) throws WorkFlowException { + String flowId = flowModel.getFlowId(); + String nodeCode = flowModel.getNodeCode(); + + TemplateJsonInfoVO jsonInfoVO = templateJsonService.getInfoVo(flowId); + Map> flowNodes = jsonInfoVO.getFlowNodes(); + + return flowNodes.get(nodeCode); + } + + // 批量获取候选人,不允许条件 1.线上存在条件 2.下一级节点存在候选人(20240711 第二项去除) + @Override + public CandidateCheckVo batchCandidates(String flowId, String operatorId, Integer batchType) + throws WorkFlowException { + TemplateJsonEntity jsonEntity = templateJsonService.getInfo(flowId); + OperatorEntity operator = this.getById(operatorId); + if (null == operator) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + + List nodeEntityList = templateNodeService.getList(flowId); + Map nodes = new HashMap<>(); + for (TemplateNodeEntity nodeEntity : nodeEntityList) { + nodes.put(nodeEntity.getNodeCode(), JsonUtil.getJsonToBean(nodeEntity.getNodeJson(), NodeModel.class)); + } + + NodeModel nodeModel = nodes.get(operator.getNodeCode()); + if (taskUtil.checkBranch(nodeModel)) { + throw new WorkFlowException("下一节点为选择分支无法批量审批"); + } + + NodeModel global = nodes.get(NodeEnum.global.getType()); + if (ObjectUtil.equals(batchType, 1) && !global.getHasContinueAfterReject()) { + return new CandidateCheckVo(); + } + // 获取节点的出线 + OutgoingFlowsFo flowsFo = new OutgoingFlowsFo(); + flowsFo.setDeploymentId(jsonEntity.getFlowableId()); + flowsFo.setTaskKey(operator.getNodeCode()); + List outgoingFlows = flowAbleUrl.getOutgoingFlows(flowsFo); + // 线上存在条件 + for (String outgoingFlow : outgoingFlows) { + NodeModel flowNode = nodes.get(outgoingFlow); + if (flowNode != null && CollectionUtil.isNotEmpty(flowNode.getConditions())) { + throw new WorkFlowException(MsgCode.WF119.get()); + } + } + + CandidateCheckFo fo = new CandidateCheckFo(); + fo.setFlowId(flowId); + fo.setHandleStatus(ObjectUtil.equals(batchType, 1) ? FlowNature.RejectCompletion : FlowNature.AuditCompletion); + return taskService.checkCandidates(operatorId, fo); + } + + @DSTransactional + @Override + public void batch(FlowModel flowModel) throws Exception { + Integer batchType = flowModel.getBatchType(); + List ids = new ArrayList<>(); + List idList = new ArrayList<>(); + operatorUtil.checkBatch(flowModel.getIds(), idList, false); + operatorUtil.checkBatchRevoke(idList, ids, batchType); + int count = 0; + List taskList = new ArrayList<>(); + for (String id : ids) { + OperatorEntity operator = operatorUtil.checkOperator(id); + TaskEntity taskEntity = taskService.getInfo(operator.getTaskId()); + taskList.add(taskEntity); + FlowModel model = JsonUtil.getJsonToBean(flowModel, FlowModel.class); + model.setId(id); + switch (batchType) { + case 0: + model.setVoluntarily(true); + model.setHandleStatus(FlowNature.AuditCompletion); + try { + this.audit(id, model); + } catch (Exception e) { + if (e instanceof WorkFlowException) { + // 当选择多条数据且下个审批节点出现异常时,跳过异常节点能通过的即审批通过,异常的不处理 + WorkFlowException workFlowException = (WorkFlowException) e; + if (ObjectUtil.equals(workFlowException.getCode(), 200)) { + count++; + break; + } + } + operatorUtil.compensate(taskEntity); + throw e; + } + break; + case 1: + model.setHandleStatus(FlowNature.RejectCompletion); + try { + this.audit(id, model); + } catch (Exception e) { + if (e instanceof WorkFlowException) { + // 当选择多条数据且下个审批节点出现异常时,跳过异常节点能通过的即审批通过,异常的不处理 + WorkFlowException workFlowException = (WorkFlowException) e; + if (ObjectUtil.equals(workFlowException.getCode(), 200)) { + count++; + break; + } + } + operatorUtil.compensate(taskEntity); + throw e; + } + break; + case 2: + this.transfer(id, model); + break; + case 3: + try { + this.back(id, model); + } catch (Exception e) { + operatorUtil.compensate(taskEntity); + throw e; + } + } + } + // 当选择的数据都是异常时,提示:“下一节点审批异常,无法批量审批” + if (ids.size() == count) { + flowModel.setTaskList(taskList); + throw new WorkFlowException(MsgCode.WF120.get()); + } + } + + @Override + public FlowWorkListVO flowWork(String fromId) { + FlowWorkListVO vo = new FlowWorkListVO(); + List waitList = new ArrayList<>(); + // 经办 + QueryWrapper operatorWrapper = new QueryWrapper<>(); + operatorWrapper.lambda().eq(OperatorEntity::getHandleId, fromId).eq(OperatorEntity::getCompletion, 0) + .ne(OperatorEntity::getStatus, OperatorStateEnum.Futility.getCode()); + List operatorList = this.list(operatorWrapper); + + if (CollectionUtil.isNotEmpty(operatorList)) { + List taskIds = operatorList.stream().map(OperatorEntity::getTaskId).collect(Collectors.toList()); + List taskList = taskUtil.getOrderStaList(taskIds); + + List templateList = templateService + .getListOfHidden(taskList.stream().map(TaskEntity::getTemplateId).collect(Collectors.toList())); + + for (OperatorEntity operator : operatorList) { + FlowWorkModel workModel = JsonUtil.getJsonToBean(operator, FlowWorkModel.class); + TaskEntity taskEntity = taskList.stream().filter(e -> e.getId().equals(operator.getTaskId())) + .findFirst().orElse(null); + if (null != taskEntity) { + workModel.setFullName(taskEntity.getFullName()); + TemplateEntity template = templateList.stream() + .filter(e -> e.getId().equals(taskEntity.getTemplateId())).findFirst().orElse(null); + if (null != template) { + workModel.setIcon(template.getIcon()); + waitList.add(workModel); + } + } + } + } + vo.setFlowTask(waitList); + + // 流程 + List flowList = new ArrayList<>(); + List nodeList = templateNodeService.getListLikeUserId(fromId); + if (CollectionUtil.isNotEmpty(nodeList)) { + List flowIds = nodeList.stream().map(TemplateNodeEntity::getFlowId).collect(Collectors.toList()); + List versionList = templateJsonService.listByIds(flowIds); + List templateList = templateService.getListByFlowIds(flowIds); + for (TemplateJsonEntity jsonEntity : versionList) { + if (!ObjectUtil.equals(jsonEntity.getState(), 1)) { + continue; + } + FlowWorkModel workModel = JsonUtil.getJsonToBean(jsonEntity, FlowWorkModel.class); + for (TemplateNodeEntity nodeEntity : nodeList) { + if (nodeEntity.getNodeJson().contains(fromId)) { + TemplateEntity template = templateList.stream() + .filter(e -> e.getId().equals(jsonEntity.getTemplateId())).findFirst().orElse(null); + if (null != template) { + workModel.setIcon(template.getIcon()); + workModel.setFullName(template.getFullName() + "(V" + jsonEntity.getVersion() + ")"); + flowList.add(workModel); + break; + } + } + } + } + } + vo.setFlow(flowList); + return vo; + } + + @Override + public boolean flowWork(WorkHandoverModel workHandoverModel) { + String fromId = workHandoverModel.getFromId(); + String toId = workHandoverModel.getToId(); + List waitList = workHandoverModel.getFlowTaskList(); + if (!waitList.isEmpty()) { + // 更新经办 + QueryWrapper operator = new QueryWrapper<>(); + operator.lambda().in(OperatorEntity::getId, waitList) + .eq(OperatorEntity::getHandleId, fromId); + List operatorList = this.list(operator); + if (CollectionUtil.isNotEmpty(operatorList)) { + for (OperatorEntity entity : operatorList) { + entity.setHandleId(toId); + String handleAll = entity.getHandleAll(); + if (StringUtil.isNotBlank(handleAll)) { + String str = handleAll.replaceAll(fromId, toId); + entity.setHandleAll(str); + } + } + this.updateBatchById(operatorList); + } + // 更新候选人 + UpdateWrapper candidate = new UpdateWrapper<>(); + candidate.lambda().in(CandidatesEntity::getOperatorId, waitList) + .eq(CandidatesEntity::getHandleId, fromId) + .set(CandidatesEntity::getHandleId, toId); + candidatesService.update(candidate); + } + // 流程 + List flowList = workHandoverModel.getFlowList(); + if (!flowList.isEmpty()) { + UserEntity toUser = serviceUtil.getUserInfo(toId); + String toUserName = toUser != null ? toUser.getRealName() + "/" + toUser.getAccount() : ""; + UserEntity fromUser = serviceUtil.getUserInfo(fromId); + String fromUserName = fromUser != null ? fromUser.getRealName() + "/" + fromUser.getAccount() : ""; + + List versionList = templateJsonService.listByIds(flowList); + if (CollectionUtil.isNotEmpty(versionList)) { + List updateList = new ArrayList<>(); + for (TemplateJsonEntity jsonEntity : versionList) { + List nodeList = templateNodeService.getList(jsonEntity.getId()); + for (TemplateNodeEntity nodeEntity : nodeList) { + if (nodeEntity.getNodeJson().contains(fromId)) { + String str = nodeEntity.getNodeJson().replaceAll(fromId, toId).replaceAll(fromUserName, + toUserName); + nodeEntity.setNodeJson(str); + updateList.add(nodeEntity); + } + } + } + if (CollectionUtil.isNotEmpty(updateList)) { + templateNodeService.updateBatchById(updateList); + } + } + } + return true; + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/RecordServiceImpl.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/RecordServiceImpl.java new file mode 100644 index 0000000..eccf733 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/RecordServiceImpl.java @@ -0,0 +1,255 @@ +package com.yunzhupaas.flowable.service.impl; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.github.yulichang.toolkit.JoinWrappers; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.flowable.entity.*; +import com.yunzhupaas.flowable.enums.RecordEnum; +import com.yunzhupaas.flowable.enums.TaskStatusEnum; +import com.yunzhupaas.flowable.mapper.RecordMapper; +import com.yunzhupaas.flowable.model.operator.OperatorVo; +import com.yunzhupaas.flowable.model.record.RecordVo; +import com.yunzhupaas.flowable.model.task.TaskPagination; +import com.yunzhupaas.flowable.model.util.FlowNature; +import com.yunzhupaas.flowable.service.DelegateService; +import com.yunzhupaas.flowable.service.RecordService; +import com.yunzhupaas.flowable.service.TaskService; +import com.yunzhupaas.flowable.util.RecordUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/23 9:22 + */ +@Service +public class RecordServiceImpl extends SuperServiceImpl implements RecordService { + @Autowired + private TaskService taskService; + @Autowired + private RecordUtil recordUtil; + @Autowired + private DelegateService delegateService; + + @Override + public List getList(String taskId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(RecordEntity::getTaskId, taskId).orderByAsc(RecordEntity::getHandleTime); + return this.list(queryWrapper); + } + + @Override + public List getRecordList(String taskId, List statusList) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(RecordEntity::getTaskId, taskId); + if (CollectionUtil.isNotEmpty(statusList)) { + queryWrapper.lambda().in(RecordEntity::getHandleType, statusList); + } + queryWrapper.lambda().orderByAsc(RecordEntity::getHandleTime); + return this.list(queryWrapper); + } + + @Override + public List getList(TaskPagination pagination) { + String loginUserId = UserProvider.getLoginUserId(); + if (StringUtil.isNotEmpty(pagination.getUserId())) { + loginUserId = pagination.getUserId(); + } + Integer[] handleStatus = new Integer[] { 0, 1, 3, 5, 7, 18 }; + MPJLambdaWrapper recordWrapper = JoinWrappers.lambda(RecordEntity.class) + .leftJoin(TaskEntity.class, TaskEntity::getId, RecordEntity::getTaskId) + .select(RecordEntity::getHandleId) + .select(RecordEntity::getNodeCode) + .select(RecordEntity::getTaskId) + .selectMax(RecordEntity::getHandleTime) + .in(RecordEntity::getHandleType, handleStatus) + .isNotNull(RecordEntity::getOperatorId) + .groupBy(RecordEntity::getTaskId, RecordEntity::getNodeCode, RecordEntity::getHandleId); + + List delegateList = delegateService.getByToUserId(loginUserId); + String finalLoginUserId = loginUserId; + recordWrapper.and(t -> { + t.eq(RecordEntity::getHandleId, finalLoginUserId); + for (DelegateEntity delegate : delegateList) { + if (StringUtil.isNotEmpty(delegate.getFlowId())) { + String[] flowIds = delegate.getFlowId().split(","); + t.or(tw -> tw.in(TaskEntity::getTemplateId, flowIds) + .eq(RecordEntity::getHandleId, delegate.getUserId()) + .eq(RecordEntity::getCreatorUserId, finalLoginUserId) + .between(RecordEntity::getHandleTime, delegate.getStartTime(), delegate.getEndTime())); + } else { + t.or(t1 -> t1.eq(RecordEntity::getHandleId, delegate.getUserId()) + .eq(RecordEntity::getCreatorUserId, finalLoginUserId) + .between(RecordEntity::getHandleTime, delegate.getStartTime(), delegate.getEndTime())); + } + } + }); + + List recordList = this.selectJoinList(RecordEntity.class, recordWrapper); + + if (recordList.isEmpty()) { + return new ArrayList<>(); + } + List taskId = recordList.stream().map(RecordEntity::getTaskId).collect(Collectors.toList()); + List nodeCode = recordList.stream().map(RecordEntity::getNodeCode).collect(Collectors.toList()); + List handleTime = recordList.stream().map(RecordEntity::getHandleTime).collect(Collectors.toList()); + MPJLambdaWrapper wrapper = JoinWrappers.lambda(TaskEntity.class) + .leftJoin(RecordEntity.class, RecordEntity::getTaskId, TaskEntity::getId) + .leftJoin(OperatorEntity.class, OperatorEntity::getId, RecordEntity::getOperatorId) + .selectAll(TaskEntity.class) + .selectAs(TaskEntity::getUrgent, OperatorVo::getFlowUrgent) + .selectAs(RecordEntity::getId, OperatorVo::getId) + .selectAs(RecordEntity::getNodeName, OperatorVo::getCurrentNodeName) + .selectAs(RecordEntity::getNodeCode, OperatorVo::getNodeCode) + .selectAs(RecordEntity::getHandleType, OperatorVo::getStatus) + .selectAs(RecordEntity::getHandleId, OperatorVo::getHandleId) + .selectAs(RecordEntity::getHandleTime, OperatorVo::getCreatorTime) + .selectAs(OperatorEntity::getHandleId, OperatorVo::getOperatorHandleId) + .selectAs(RecordEntity::getTaskId, OperatorVo::getTaskId) + .selectAs(RecordEntity::getCreatorUserId, OperatorVo::getRecordCreatorUserId) + .selectAs(TaskEntity::getCreatorUserId, OperatorVo::getCreatorUserId) + .in(RecordEntity::getTaskId, taskId) + .in(RecordEntity::getNodeCode, nodeCode) + .ne(TaskEntity::getStatus, TaskStatusEnum.CANCEL.getCode()); + + if (CollectionUtil.isNotEmpty(handleTime)) { + wrapper.and(e -> { + for (Date date : handleTime) { + Calendar start = Calendar.getInstance(); + start.setTime(date); + start.set(Calendar.MILLISECOND, 0); + Calendar end = Calendar.getInstance(); + end.setTime(date); + end.set(Calendar.MILLISECOND, 999); + e.or(t -> t.between(RecordEntity::getHandleTime, start.getTime(), end.getTime())); + } + }); + } + + Integer status = pagination.getStatus(); + if (null != status) { + switch (status) { + case 1: + // 同意 + wrapper.eq(RecordEntity::getHandleType, RecordEnum.audit.getCode()); + break; + case 2: + // 拒绝 + wrapper.eq(RecordEntity::getHandleType, RecordEnum.reject.getCode()); + break; + case 3: + // 转审 + List transferList = ImmutableList.of(RecordEnum.transfer.getCode(), + RecordEnum.transferProcessing.getCode()); + wrapper.in(RecordEntity::getHandleType, transferList); + break; + case 4: + // 加签 + wrapper.eq(RecordEntity::getHandleType, RecordEnum.addSign.getCode()); + break; + case 5: + // 退回 + wrapper.eq(RecordEntity::getHandleType, RecordEnum.back.getCode()); + break; + } + } + String keyWord = pagination.getKeyword(); + if (ObjectUtil.isNotEmpty(keyWord)) { + wrapper.and(t -> t.like(TaskEntity::getEnCode, keyWord).or().like(TaskEntity::getFullName, keyWord)); + } + // 所属分类 + String category = pagination.getFlowCategory(); + if (ObjectUtil.isNotEmpty(category)) { + wrapper.in(TaskEntity::getFlowCategory, category.split(",")); + } + // 所属流程 + String templateId = pagination.getTemplateId(); + if (ObjectUtil.isNotEmpty(templateId)) { + wrapper.eq(TaskEntity::getTemplateId, templateId); + } + // 紧急程度 + Integer flowUrgent = pagination.getFlowUrgent(); + if (ObjectUtil.isNotEmpty(flowUrgent)) { + wrapper.eq(TaskEntity::getUrgent, flowUrgent); + } + // 发起人员 + String creatorUserId = pagination.getCreatorUserId(); + if (ObjectUtil.isNotEmpty(creatorUserId)) { + wrapper.eq(TaskEntity::getCreatorUserId, creatorUserId); + } + // 日期范围(近7天、近1月、近3月、自定义) + if (ObjectUtil.isNotEmpty(pagination.getStartTime()) && ObjectUtil.isNotEmpty(pagination.getEndTime())) { + wrapper.between(TaskEntity::getStartTime, new Date(pagination.getStartTime()), + new Date(pagination.getEndTime())); + } + wrapper.orderByDesc(RecordEntity::getHandleTime); + + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + Page data = taskService.selectJoinListPage(page, OperatorVo.class, wrapper); + for (OperatorVo record : data.getRecords()) { + if (!ObjectUtil.equals(record.getRecordCreatorUserId(), record.getHandleId())) { + boolean isUser = ObjectUtil.equals(record.getHandleId(), loginUserId) + && ObjectUtil.equals(record.getOperatorHandleId(), record.getRecordCreatorUserId()); + record.setDelegateUser(!isUser ? record.getRecordCreatorUserId() : null); + } + } + return pagination.setData(data.getRecords(), page.getTotal()); + } + + @Override + public RecordEntity getInfo(String id) { + if (StringUtil.isBlank(id)) { + return null; + } + return this.getById(id); + } + + @Override + public void create(RecordEntity entity) { + entity.setId(RandomUtil.uuId()); + this.save(entity); + } + + @Override + public void update(String id, RecordEntity entity) { + entity.setId(id); + this.updateById(entity); + } + + @Override + public void updateStatusToInvalid(String taskId, List nodeCodeList) { + UpdateWrapper wrapper = new UpdateWrapper<>(); + wrapper.lambda().eq(RecordEntity::getTaskId, taskId); + if (CollectionUtil.isNotEmpty(nodeCodeList)) { + wrapper.lambda().in(RecordEntity::getNodeCode, nodeCodeList); + } + wrapper.lambda().set(RecordEntity::getStatus, FlowNature.Invalid); + this.update(wrapper); + } + + @Override + public List getList(String taskId, String nodeId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(RecordEntity::getTaskId, taskId).like(RecordEntity::getNodeId, nodeId) + .orderByDesc(RecordEntity::getHandleTime).orderByDesc(RecordEntity::getId); + List list = this.list(queryWrapper); + return recordUtil.getRecordList(list); + } + +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/RejectDataServiceImpl.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/RejectDataServiceImpl.java new file mode 100644 index 0000000..0328ec8 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/RejectDataServiceImpl.java @@ -0,0 +1,48 @@ +package com.yunzhupaas.flowable.service.impl; + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.flowable.entity.OperatorEntity; +import com.yunzhupaas.flowable.entity.RejectDataEntity; +import com.yunzhupaas.flowable.entity.TaskEntity; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.mapper.RejectDataMapper; +import com.yunzhupaas.flowable.service.RejectDataService; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RandomUtil; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/8 18:08 + */ +@Service +public class RejectDataServiceImpl extends SuperServiceImpl + implements RejectDataService { + + @Override + public RejectDataEntity getInfo(String id) throws WorkFlowException { + RejectDataEntity entity = this.getById(id); + if (entity == null) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + return entity; + } + + @Override + public RejectDataEntity create(TaskEntity taskEntity, List operatorEntityList, String nodeCode) { + RejectDataEntity entity = new RejectDataEntity(); + entity.setId(RandomUtil.uuId()); + entity.setTaskJson(JsonUtil.getObjectToString(taskEntity)); + entity.setOperatorJson(JsonUtil.getObjectToString(operatorEntityList)); + entity.setNodeCode(nodeCode); + this.save(entity); + return entity; + } + +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/RevokeServiceImpl.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/RevokeServiceImpl.java new file mode 100644 index 0000000..3df01d0 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/RevokeServiceImpl.java @@ -0,0 +1,62 @@ +package com.yunzhupaas.flowable.service.impl; + +import cn.hutool.core.collection.CollectionUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.flowable.entity.RevokeEntity; +import com.yunzhupaas.flowable.mapper.RevokeMapper; +import com.yunzhupaas.flowable.service.RevokeService; +import com.yunzhupaas.util.UserProvider; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/8/24 13:40 + */ +@Service +public class RevokeServiceImpl extends SuperServiceImpl implements RevokeService { + @Override + public RevokeEntity getRevokeTask(String revokeTaskId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(RevokeEntity::getRevokeTaskId, revokeTaskId); + return this.getOne(queryWrapper); + } + + @Override + public Boolean checkExist(String taskId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(RevokeEntity::getTaskId, taskId).isNull(RevokeEntity::getDeleteMark); + return this.count(queryWrapper) == 0; + } + + @Override + public void deleteRevoke(String revokeTaskId) { + RevokeEntity revokeEntity = this.getRevokeTask(revokeTaskId); + if (null != revokeEntity) { + revokeEntity.setDeleteMark(-1); + revokeEntity.setDeleteTime(new Date()); + revokeEntity.setDeleteUserId(UserProvider.getLoginUserId()); + this.updateById(revokeEntity); + } + } + + @Override + public List getByTaskId(List ids) { + if (CollectionUtil.isEmpty(ids)) { + return new ArrayList<>(); + } + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().in(RevokeEntity::getTaskId, ids); + List list = this.list(wrapper); + return list.stream().map(RevokeEntity::getRevokeTaskId).collect(Collectors.toList()); + } + +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/SubtaskDataServiceImpl.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/SubtaskDataServiceImpl.java new file mode 100644 index 0000000..5854970 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/SubtaskDataServiceImpl.java @@ -0,0 +1,58 @@ +package com.yunzhupaas.flowable.service.impl; + +import cn.hutool.core.collection.CollectionUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.flowable.entity.SubtaskDataEntity; +import com.yunzhupaas.flowable.mapper.SubtaskDataMapper; +import com.yunzhupaas.flowable.model.task.FlowModel; +import com.yunzhupaas.flowable.service.SubtaskDataService; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RandomUtil; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/12/6 15:35 + */ +@Service +public class SubtaskDataServiceImpl extends SuperServiceImpl + implements SubtaskDataService { + + @Override + public List getList(String parentId, String parentCode) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SubtaskDataEntity::getParentId, parentId) + .eq(SubtaskDataEntity::getNodeCode, parentCode) + .orderByAsc(SubtaskDataEntity::getSortCode); + return this.list(queryWrapper); + } + + @Override + public void save(List subTaskData) { + if (CollectionUtil.isEmpty(subTaskData)) { + return; + } + List list = new ArrayList<>(); + for (int i = 0; i < subTaskData.size(); i++) { + FlowModel model = subTaskData.get(i); + SubtaskDataEntity entity = new SubtaskDataEntity(); + entity.setId(RandomUtil.uuId()); + entity.setParentId(model.getParentId()); + entity.setNodeCode(model.getSubCode()); + entity.setSubtaskJson(JsonUtil.getObjectToString(model)); + int sortCode = i + 1; + entity.setSortCode((long) sortCode); + list.add(entity); + } + if (CollectionUtil.isNotEmpty(list)) { + this.saveBatch(list); + } + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/TaskLineServiceImpl.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/TaskLineServiceImpl.java new file mode 100644 index 0000000..87a1890 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/TaskLineServiceImpl.java @@ -0,0 +1,110 @@ +package com.yunzhupaas.flowable.service.impl; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.flowable.entity.RevokeEntity; +import com.yunzhupaas.flowable.entity.TaskLineEntity; +import com.yunzhupaas.flowable.mapper.TaskLineMapper; +import com.yunzhupaas.flowable.service.RevokeService; +import com.yunzhupaas.flowable.service.TaskLineService; +import com.yunzhupaas.util.RandomUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/8/23 17:37 + */ +@Service +public class TaskLineServiceImpl extends SuperServiceImpl implements TaskLineService { + @Autowired + private RevokeService revokeService; + + @Override + public List getList(String taskId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TaskLineEntity::getTaskId, taskId); + return this.list(queryWrapper); + } + + @Override + public void create(String taskId, Map conditionResMap) { + if (CollectionUtil.isEmpty(conditionResMap)) { + return; + } + List createList = new ArrayList<>(); + List updateList = new ArrayList<>(); + + List list = this.getList(taskId); + + if (CollectionUtil.isNotEmpty(list)) { + conditionResMap.forEach((k, v) -> { + TaskLineEntity entity = list.stream().filter(e -> ObjectUtil.equals(k, e.getLineKey())).findFirst() + .orElse(null); + if (null != entity) { + Boolean b = conditionResMap.get(entity.getLineKey()); + if (null != b) { + entity.setLineValue(String.valueOf(b)); + updateList.add(entity); + } + } else { + entity = new TaskLineEntity(); + entity.setId(RandomUtil.uuId()); + entity.setTaskId(taskId); + entity.setLineKey(k); + entity.setLineValue(String.valueOf(v)); + createList.add(entity); + } + }); + } else { + conditionResMap.forEach((k, v) -> { + TaskLineEntity entity = new TaskLineEntity(); + entity.setId(RandomUtil.uuId()); + entity.setTaskId(taskId); + entity.setLineKey(k); + entity.setLineValue(String.valueOf(v)); + createList.add(entity); + }); + } + + if (CollectionUtil.isNotEmpty(createList)) { + this.saveBatch(createList); + } + if (CollectionUtil.isNotEmpty(updateList)) { + this.updateBatchById(updateList); + } + } + + @Override + public List getLineKeyList(String taskId) { + List resList = new ArrayList<>(); + RevokeEntity revokeEntity = revokeService.getRevokeTask(taskId); + if (null != revokeEntity) { + taskId = revokeEntity.getTaskId(); + } + List list = this.getList(taskId); + Map> collect = list.stream() + .collect(Collectors.groupingBy(TaskLineEntity::getLineKey)); + collect.forEach((k, v) -> { + List sortList = v.stream() + .sorted(Comparator.comparing(TaskLineEntity::getCreatorTime).reversed()) + .collect(Collectors.toList()); + boolean bo = Boolean.parseBoolean(sortList.get(0).getLineValue()); + if (bo) { + resList.add(k); + } + }); + return resList; + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/TaskServiceImpl.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/TaskServiceImpl.java new file mode 100644 index 0000000..cba26dc --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/TaskServiceImpl.java @@ -0,0 +1,1854 @@ +package com.yunzhupaas.flowable.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.github.yulichang.toolkit.JoinWrappers; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.google.common.collect.ImmutableList; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.model.flow.FlowFormDataModel; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.constant.PermissionConst; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.*; +import com.yunzhupaas.flowable.enums.*; +import com.yunzhupaas.flowable.mapper.TaskMapper; +import com.yunzhupaas.flowable.model.candidates.*; +import com.yunzhupaas.flowable.model.flowable.FlowAbleUrl; +import com.yunzhupaas.flowable.model.flowable.FlowableNodeModel; +import com.yunzhupaas.flowable.model.flowable.NextOrPrevFo; +import com.yunzhupaas.flowable.model.message.FlowMsgModel; +import com.yunzhupaas.flowable.model.record.NodeRecordModel; +import com.yunzhupaas.flowable.model.task.*; +import com.yunzhupaas.flowable.model.template.BeforeInfoVo; +import com.yunzhupaas.flowable.model.templatejson.TemplateJsonInfoVO; +import com.yunzhupaas.flowable.model.templatenode.ButtonModel; +import com.yunzhupaas.flowable.model.templatenode.TaskNodeModel; +import com.yunzhupaas.flowable.model.templatenode.nodejson.CounterSignConfig; +import com.yunzhupaas.flowable.model.templatenode.nodejson.FileConfig; +import com.yunzhupaas.flowable.model.templatenode.nodejson.NodeModel; +import com.yunzhupaas.flowable.model.util.FlowConstant; +import com.yunzhupaas.flowable.model.util.FlowContextHolder; +import com.yunzhupaas.flowable.model.util.FlowNature; +import com.yunzhupaas.flowable.service.*; +import com.yunzhupaas.flowable.util.*; +import com.yunzhupaas.permission.entity.OrganizeEntity; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.entity.UserRelationEntity; +import com.yunzhupaas.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/17 15:09 + */ +@Service +public class TaskServiceImpl extends SuperServiceImpl implements TaskService { + @Autowired + private TemplateService templateService; + @Autowired + private TemplateJsonService templateJsonService; + @Autowired + private TemplateNodeService templateNodeService; + @Autowired + private FlowAbleUrl flowAbleUrl; + @Autowired + private LaunchUserService launchUserService; + @Autowired + private ServiceUtil serviceUtil; + @Autowired + private ConditionService conditionService; + @Autowired + private CandidatesService candidatesService; + @Autowired + private OperatorService operatorService; + @Autowired + private RecordUtil recordUtil; + @Autowired + private RecordService recordService; + @Autowired + private CirculateService circulateService; + @Autowired + private NodeUtil nodeUtil; + @Autowired + private OperatorUtil operatorUtil; + @Autowired + private MsgUtil msgUtil; + @Autowired + private CommentService commentService; + @Autowired + private RejectDataService rejectDataService; + @Autowired + private TaskUtil taskUtil; + @Autowired + private ButtonUtil buttonUtil; + @Autowired + private RedisUtil redisUtil; + @Autowired + private DelegateService delegateService; + @Autowired + private NodeRecordService nodeRecordService; + @Autowired + private TaskLineService taskLineService; + @Autowired + private RevokeService revokeService; + @Autowired + private TriggerTaskService triggerTaskService; + + @Override + public TaskEntity getInfoSubmit(String id, SFunction... columns) { + List list = getInfosSubmit(new String[] { id }, columns); + if (list.isEmpty()) { + return null; + } + return list.get(0); + } + + @Override + public List getInfosSubmit(String[] ids, SFunction... columns) { + List resultList = Collections.emptyList(); + if (ids == null || ids.length == 0) { + return resultList; + } + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + if (ids.length == 1) { + queryWrapper.select(columns).and( + t -> t.eq(TaskEntity::getId, ids[0])); + resultList = this.list(queryWrapper); + if (resultList.isEmpty()) { + queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.select(columns).and( + t -> t.eq(TaskEntity::getFlowId, ids[0])); + resultList = this.list(queryWrapper); + } + } else { + queryWrapper.select(TaskEntity::getId).and(t -> { + t.in(TaskEntity::getId, ids).or().in(TaskEntity::getId, ids); + }); + List resultIds = this.listObjs(queryWrapper, Object::toString); + if (!resultIds.isEmpty()) { + queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.select(columns).in(TaskEntity::getId, resultIds); + resultList = this.list(queryWrapper); + } + } + return resultList; + } + + @Override + public List getList(TaskPagination pagination) { + String userId = UserProvider.getUser().getUserId(); + List templateStatusList = ImmutableList.of(1, 2); + List taskStatusList = ImmutableList.of(0, 1, 5, 8, 9); + MPJLambdaWrapper queryWrapper = JoinWrappers.lambda(TaskEntity.class) + .selectAll(TaskEntity.class) + .leftJoin(TemplateEntity.class, TemplateEntity::getId, TaskEntity::getTemplateId) + .and(e -> e.in(TemplateEntity::getStatus, templateStatusList) + .or(t -> t.eq(TemplateEntity::getStatus, 3).notIn(TaskEntity::getStatus, taskStatusList))); + + List delegateList = delegateService.getByToUserId(userId, 0); + queryWrapper.and(t -> { + t.eq(TaskEntity::getCreatorUserId, userId); + for (DelegateEntity delegate : delegateList) { + if (StringUtil.isNotEmpty(delegate.getFlowId())) { + String[] flowIds = delegate.getFlowId().split(","); + t.or(tw -> tw.in(TaskEntity::getTemplateId, flowIds) + .eq(TaskEntity::getCreatorUserId, delegate.getUserId()) + .eq(TaskEntity::getDelegateUserId, userId) + .between(TaskEntity::getStartTime, delegate.getStartTime(), delegate.getEndTime())); + } else { + t.or().eq(TaskEntity::getCreatorUserId, delegate.getUserId()) + .eq(TaskEntity::getDelegateUserId, userId) + .between(TaskEntity::getStartTime, delegate.getStartTime(), delegate.getEndTime()); + } + } + }); + + // 关键字(流程名称、流程编码) + String keyWord = pagination.getKeyword(); + if (ObjectUtil.isNotEmpty(keyWord)) { + queryWrapper.and(t -> t.like(TaskEntity::getEnCode, keyWord).or().like(TaskEntity::getFullName, keyWord)); + } + // 日期范围(近7天、近1月、近3月、自定义) + if (ObjectUtil.isNotEmpty(pagination.getStartTime()) && ObjectUtil.isNotEmpty(pagination.getEndTime())) { + queryWrapper.between(TaskEntity::getStartTime, new Date(pagination.getStartTime()), + new Date(pagination.getEndTime())); + } + // 所属流程 + String templateId = pagination.getTemplateId(); + if (ObjectUtil.isNotEmpty(templateId)) { + queryWrapper.eq(TaskEntity::getTemplateId, templateId); + } + // 流程状态 + Integer status = pagination.getStatus(); + if (ObjectUtil.isNotEmpty(status)) { + if (status.equals(0)) {// 待提交 + List list = ImmutableList.of(TaskStatusEnum.TO_BE_SUBMIT.getCode(), + TaskStatusEnum.BACKED.getCode(), TaskStatusEnum.RECALL.getCode()); + queryWrapper.in(TaskEntity::getStatus, list); + } else if (status.equals(1)) { // 进行中 + List list = ImmutableList.of(TaskStatusEnum.RUNNING.getCode(), + TaskStatusEnum.PAUSED.getCode()); + queryWrapper.in(TaskEntity::getStatus, list); + } else { // 已完成 + List list = ImmutableList.of(TaskStatusEnum.PASSED.getCode(), + TaskStatusEnum.REJECTED.getCode(), + TaskStatusEnum.CANCEL.getCode(), TaskStatusEnum.REVOKED.getCode()); + queryWrapper.in(TaskEntity::getStatus, list); + } + } + // 紧急程度 + Integer flowUrgent = pagination.getFlowUrgent(); + if (ObjectUtil.isNotEmpty(flowUrgent)) { + queryWrapper.eq(TaskEntity::getUrgent, flowUrgent); + } + // 所属分类 + String flowCategory = pagination.getFlowCategory(); + if (ObjectUtil.isNotEmpty(flowCategory)) { + queryWrapper.eq(TaskEntity::getFlowCategory, flowCategory); + } + // 排序 + queryWrapper.orderByAsc(TaskEntity::getStatus).orderByDesc(TaskEntity::getStartTime); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage taskEntityPage = this.selectJoinListPage(page, TaskEntity.class, queryWrapper); + + return pagination.setData(taskEntityPage.getRecords(), page.getTotal()); + } + + @Override + public List getMonitorList(TaskPagination pagination) { + // 定义变量判断是否需要使用修改时间倒序 + boolean flag = false; + UserInfo userInfo = UserProvider.getUser(); + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(TaskEntity::getId) + .isNotNull(TaskEntity::getStartTime) + .gt(TaskEntity::getStatus, TaskStatusEnum.TO_BE_SUBMIT.getCode()); + + if (!userInfo.getIsAdministrator()) { + List userList = serviceUtil.getOrganizeUserList("select"); + if (userList.isEmpty()) { + return new ArrayList<>(); + } + queryWrapper.lambda().in(TaskEntity::getCreatorUserId, userList); + } + // 关键字(流程名称、流程编码) + String keyWord = pagination.getKeyword(); + if (ObjectUtil.isNotEmpty(keyWord)) { + flag = true; + queryWrapper.lambda() + .and(t -> t.like(TaskEntity::getEnCode, keyWord).or().like(TaskEntity::getFullName, keyWord)); + } + // 日期范围(近7天、近1月、近3月、自定义) + if (ObjectUtil.isNotEmpty(pagination.getStartTime()) && ObjectUtil.isNotEmpty(pagination.getEndTime())) { + queryWrapper.lambda().between(TaskEntity::getStartTime, new Date(pagination.getStartTime()), + new Date(pagination.getEndTime())); + } + // 所属流程 + String templateId = pagination.getTemplateId(); + if (ObjectUtil.isNotEmpty(templateId)) { + flag = true; + queryWrapper.lambda().eq(TaskEntity::getTemplateId, templateId); + } + // 流程状态 + Integer status = pagination.getStatus(); + if (ObjectUtil.isNotEmpty(status)) { + flag = true; + queryWrapper.lambda().eq(TaskEntity::getStatus, status); + } + // 紧急程度 + Integer flowUrgent = pagination.getFlowUrgent(); + if (ObjectUtil.isNotEmpty(flowUrgent)) { + flag = true; + queryWrapper.lambda().eq(TaskEntity::getUrgent, flowUrgent); + } + // 所属分类 + String flowCategory = pagination.getFlowCategory(); + if (ObjectUtil.isNotEmpty(flowCategory)) { + flag = true; + queryWrapper.lambda().eq(TaskEntity::getFlowCategory, flowCategory); + } + // 发起人员 + String creatorUserId = pagination.getCreatorUserId(); + if (StringUtil.isNotBlank(creatorUserId)) { + flag = true; + queryWrapper.lambda().eq(TaskEntity::getCreatorUserId, creatorUserId); + } + + queryWrapper.lambda().orderByDesc(TaskEntity::getStartTime); + if (flag) { + queryWrapper.lambda().orderByDesc(TaskEntity::getLastModifyTime); + } + + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + Page iPage = this.page(page, queryWrapper); + if (!iPage.getRecords().isEmpty()) { + List ids = iPage.getRecords().stream().map(TaskEntity::getId).collect(Collectors.toList()); + queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(TaskEntity::getId, ids); + // 排序 + queryWrapper.lambda().orderByDesc(TaskEntity::getStartTime); + if (flag) { + queryWrapper.lambda().orderByDesc(TaskEntity::getLastModifyTime); + } + iPage.setRecords(this.list(queryWrapper)); + } + return pagination.setData(iPage.getRecords(), page.getTotal()); + } + + @Override + public TaskEntity getInfo(String id) throws WorkFlowException { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TaskEntity::getId, id == null ? "" : id); + TaskEntity entity = this.getOne(queryWrapper); + if (null == entity) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + return entity; + } + + // 发起、审批详情 + @Override + public BeforeInfoVo getInfo(String id, FlowModel fo) throws WorkFlowException { + BeforeInfoVo vo = new BeforeInfoVo(); + TemplateJsonInfoVO jsonInfoVO = null; + TemplateEntity template = null; + + if (!StringUtil.equals("0", id)) { + TaskEntity taskEntity = this.getById(id); + if (null != taskEntity) { + jsonInfoVO = templateJsonService.getInfoVo(taskEntity.getFlowId()); + template = templateService.getInfo(taskEntity.getTemplateId()); + } + vo.setLineKeyList(taskLineService.getLineKeyList(id)); + } + if (null == jsonInfoVO) { + template = null == template ? templateService.getInfo(fo.getFlowId()) : template; + jsonInfoVO = templateJsonService.getInfoVo(template.getFlowId()); + } + fo.setTemplateEntity(template); + vo.setFlowInfo(jsonInfoVO); + fo.setDeploymentId(jsonInfoVO.getFlowableId()); + + // 节点 + List nodeEntities = templateNodeService.getList(jsonInfoVO.getFlowId()); + + TemplateNodeEntity nodeEntity = null; + OperatorEntity operatorEntity = new OperatorEntity(); + RecordEntity recordEntity = new RecordEntity(); + Map map = new HashMap<>(); + Map draft = new HashMap<>(); + String operatorId = ObjectUtil.isNotEmpty(fo.getOperatorId()) ? fo.getOperatorId() : ""; + switch (fo.getOpType()) { + case "-1": + case "1": // 待签 + case "2": // 待办 + case "3": // 在办 + OperatorEntity operator = operatorService.getInfo(operatorId); + if (null != operator) { + nodeEntity = nodeEntities.stream() + .filter(e -> StringUtil.equals(operator.getNodeCode(), e.getNodeCode())).findFirst() + .orElse(null); + operatorEntity = operator; + } + break; + case "4": // 已办 + RecordEntity record = recordService.getInfo(operatorId); + if (null != record) { + nodeEntity = nodeEntities.stream() + .filter(e -> StringUtil.equals(record.getNodeCode(), e.getNodeCode())).findFirst() + .orElse(null); + if (StringUtil.isNotBlank(record.getOperatorId())) { + OperatorEntity op = operatorService.getById(record.getOperatorId()); + if (null != op) { + operatorEntity = op; + } + } + recordEntity = record; + } + break; + case "5": // 抄送 + CirculateEntity circulateEntity = circulateService.getById(operatorId); + if (null != circulateEntity) { + nodeEntity = nodeEntities.stream() + .filter(e -> StringUtil.equals(circulateEntity.getNodeCode(), e.getNodeCode())).findFirst() + .orElse(null); + circulateEntity.setCirculateRead(1); + circulateService.updateById(circulateEntity); + if (StringUtil.isNotBlank(circulateEntity.getOperatorId())) { + OperatorEntity ope = operatorService.getById(circulateEntity.getOperatorId()); + if (null != ope) { + operatorEntity = ope; + } + } + } + break; + } + if (null == nodeEntity) { + // 默认获取开始节点 + nodeEntity = nodeEntities.stream() + .filter(e -> StringUtil.equals(NodeEnum.start.getType(), e.getNodeType())).findFirst().orElse(null); + } + if (null == nodeEntity) { + throw new WorkFlowException(MsgCode.WF076.get()); + } + if (null != operatorEntity.getDraftData()) { + Map draftData = JsonUtil.stringToMap(operatorEntity.getDraftData()); + draftData.forEach((k, v) -> { + if (ObjectUtil.isNotEmpty(v) && !Objects.equals(TableFeildsEnum.VERSION.getField(), k)) { + map.put(k, v); + } + }); + draft.putAll(draftData); + } + String formId = nodeEntity.getFormId(); + NodeModel currentNode = JsonUtil.getJsonToBean(nodeEntity.getNodeJson(), NodeModel.class); + vo.setFormOperates(currentNode.getFormOperates()); + // 表单数据 + if (!StringUtil.equals("0", id)) { + Map formData = serviceUtil.infoData(formId, id); + vo.setFormData(formData); + fo.setFormData(formData); + formData.putAll(map); + draft.putAll(formData); + + String flowTaskID = Objects.nonNull(formData.get(FlowFormConstant.FLOWTASKID)) + ? formData.get(FlowFormConstant.FLOWTASKID).toString() + : ""; + id = StringUtil.isNotBlank(flowTaskID) ? flowTaskID : id; + TaskEntity taskEntity = this.getById(id); + if (null != taskEntity) { + TaskVo taskVo = JsonUtil.getJsonToBean(taskEntity, TaskVo.class); + taskVo.setFlowUrgent(taskEntity.getUrgent()); + UserEntity user = serviceUtil.getUserInfo(taskEntity.getCreatorUserId()); + taskVo.setCreatorUser(user.getRealName()); + taskVo.setHeadIcon(UploaderUtil.uploaderImg(user.getHeadIcon())); + String flowCategory = taskEntity.getFlowCategory(); + // 分类名称 + List categoryIds = ImmutableList.of(flowCategory); + List dictionName = serviceUtil.getDictionName(categoryIds); + taskVo.setFlowCategory( + dictionName.stream().map(DictionaryDataEntity::getFullName).collect(Collectors.joining(","))); + + vo.setTaskInfo(taskVo); + fo.setTaskEntity(taskEntity); + + // 流转记录 + List records = recordService.getList(taskEntity.getId()); + vo.setRecordList(recordUtil.getRecordList(records)); + + FlowModel flowModel = new FlowModel(); + flowModel.setFormData(formData); + flowModel.setDeploymentId(fo.getDeploymentId()); + flowModel.setTaskEntity(taskEntity); + flowModel.setNodeEntityList(nodeEntities); + flowModel.setNodeEntity(nodeEntity); + // 节点 + List nodeList = nodeUtil.getNodeList(flowModel); + vo.setNodeList(nodeList); + fo.setNodeList(nodeList); + + vo.setFlowInfo(jsonInfoVO); + Map nodeProperties = jsonInfoVO.getFlowNodes().get(nodeEntity.getNodeCode()); + nodeUtil.setFlowFile(currentNode, taskEntity, nodeProperties); + vo.setNodeProperties(nodeProperties); + + vo.setProgressList(!Objects.equals(fo.getOpType(), "6") ? recordUtil.getProgressList(flowModel) + : new ArrayList<>()); + } + } + // 判断按钮 + fo.setOperatorEntity(operatorEntity); + fo.setNodeEntity(nodeEntity); + fo.setRecordEntity(recordEntity); + fo.setNodeEntityList(nodeEntities); + fo.setFlowId(jsonInfoVO.getFlowId()); + ButtonModel model = buttonUtil.handleButton(fo); + vo.setBtnInfo(model); + // vo.setDraftData(draft); + RevokeEntity revokeEntity = revokeService.getRevokeTask(id); + if (null != revokeEntity) { + Map revokeMap = JsonUtil.stringToMap(revokeEntity.getFormData()); + vo.setFormData(revokeMap); + VisualdevEntity formInfo = new VisualdevEntity(); + formInfo.setEnCode(FlowNature.REVOKE_FORM_CODE); + formInfo.setType(2); + vo.setFormInfo(formInfo); + TaskVo taskInfo = vo.getTaskInfo(); + if (null != taskInfo) { + taskInfo.setIsRevokeTask(true); + } + } else { + vo.setFormData(draft); + // 获取表单 + if (null != formId) { + VisualdevEntity formInfo = serviceUtil.getFormInfo(formId); + vo.setFormInfo(formInfo); + } + } + return vo; + } + + @Override + public CandidateCheckVo checkCandidates(String id, CandidateCheckFo fo) throws WorkFlowException { + CandidateCheckVo vo = new CandidateCheckVo(); + List list = new ArrayList<>(); + + String flowId = fo.getFlowId(); + String nodeCode = null; + Map formData = fo.getFormData(); + String taskId = fo.getId(); + + TemplateEntity template; + TemplateJsonEntity jsonEntity = templateJsonService.getById(flowId); + if (null == jsonEntity) { + template = templateService.getInfo(flowId); + jsonEntity = templateJsonService.getInfo(template.getFlowId()); + } else { + template = templateService.getInfo(jsonEntity.getTemplateId()); + } + if (ObjectUtil.equals(id, "0")) { + if (!ObjectUtil.equals(template.getStatus(), 1)) { + throw new WorkFlowException(MsgCode.WF140.get()); + } + } else { + List templateStatus = ImmutableList.of(1, 2); + if (!templateStatus.contains(template.getStatus())) { + throw new WorkFlowException(MsgCode.WF140.get()); + } + } + if (StringUtil.isNotBlank(fo.getDelegateUser())) { + List launchPermission = serviceUtil.getLaunchPermission(fo.getDelegateUser()); + if (ObjectUtil.equals(template.getVisibleType(), 2) && !launchPermission.contains(template.getId())) { + throw new WorkFlowException(MsgCode.WF129.get()); + } + } + + List nodeEntities = templateNodeService.getList(jsonEntity.getId()); + + Map nodes = new HashMap<>(); + for (TemplateNodeEntity nodeEntity : nodeEntities) { + nodes.put(nodeEntity.getNodeCode(), JsonUtil.getJsonToBean(nodeEntity.getNodeJson(), NodeModel.class)); + } + NodeModel global = nodes.get(NodeEnum.global.getType()); + + TemplateNodeEntity currentNode; + OperatorEntity operatorEntity = new OperatorEntity(); + // 默认获取开始节点编码 + if (StringUtil.equals(id, "0")) { + currentNode = nodeEntities.stream() + .filter(e -> StringUtil.equals(NodeEnum.start.getType(), e.getNodeType())).findFirst().orElse(null); + } else { + operatorEntity = operatorService.getInfo(id); + if (operatorEntity == null) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + // 加签的经办无需选择候选人 + if (!ObjectUtil.equals(operatorEntity.getParentId(), "0")) { + vo.setList(list); + return vo; + } + String finalNodeCode = operatorEntity.getNodeCode(); + currentNode = nodeEntities.stream().filter(e -> StringUtil.equals(finalNodeCode, e.getNodeCode())) + .findFirst().orElse(null); + taskId = operatorEntity.getTaskId(); + } + RevokeEntity revokeEntity = revokeService.getRevokeTask(taskId); + if (null != revokeEntity) { + vo.setList(list); + return vo; + } + if (null == currentNode) { + throw new WorkFlowException(MsgCode.WF076.get()); + } + nodeCode = currentNode.getNodeCode(); + NodeModel currentNodeModel = nodes.get(nodeCode); + String divideRule = currentNodeModel.getDivideRule(); + boolean branchFlow = ObjectUtil.equals(DivideRuleEnum.CHOOSE.getType(), divideRule); + + UserInfo userInfo = UserProvider.getUser(); + // 判断条件 + TaskEntity taskEntity = this.getById(taskId); + if (taskEntity == null) { + FlowModel flowModel = new FlowModel(); + flowModel.setFlowId(flowId); + flowModel.setFormData(formData); + flowModel.setDelegateUser(fo.getDelegateUser()); + flowModel.setUserInfo(userInfo); + flowModel.setJsonEntity(jsonEntity); + taskEntity = this.createEntity(flowModel, template, nodes); + } + if (ObjectUtil.isNotEmpty(taskEntity.getRejectDataId())) { + return vo; + } + taskUtil.getGlobalParam(taskEntity, nodes.get(nodeCode), nodes.get(NodeEnum.global.getType()), formData); + FlowMethod flowMethod = new FlowMethod(); + flowMethod.setDeploymentId(jsonEntity.getFlowableId()); + flowMethod.setNodeCode(nodeCode); + flowMethod.setFormData(formData); + flowMethod.setNodes(nodes); + flowMethod.setTaskEntity(taskEntity); + flowMethod.setUserInfo(userInfo); + Map resMap = conditionService.handleCondition(flowMethod); + + CounterSignConfig counterSignConfig = currentNodeModel.getCounterSignConfig(); + boolean delay = ObjectUtil.equals(counterSignConfig.getCalculateType(), 2); + // 全是false,说明没有分支可走 + if (!branchFlow && !delay) { + // 拒绝 且 配置拒绝不允许继续流转 直接返回 + if (ObjectUtil.equals(fo.getHandleStatus(), FlowNature.RejectCompletion) + && !global.getHasContinueAfterReject()) { + vo.setList(list); + return vo; + } + conditionService.checkCondition(resMap, nodes); + } else { + // 选择分支、且不是最后一个审批人,直接返回 + // 删除原先存在的下一级候选人 + NextOrPrevFo nextOrPrevFo = new NextOrPrevFo(); + nextOrPrevFo.setDeploymentId(jsonEntity.getFlowableId()); + nextOrPrevFo.setTaskKey(currentNode.getNodeCode()); + List nextModels = flowAbleUrl.getNext(nextOrPrevFo); + List nextCodes = nextModels.stream().map(FlowableNodeModel::getId).collect(Collectors.toList()); + if (CollectionUtil.isNotEmpty(nextCodes)) { + candidatesService.deleteByCodes(taskId, nextCodes); + } + operatorEntity.setHandleStatus(fo.getHandleStatus()); + flowMethod.setOperatorEntity(operatorEntity); + flowMethod.setNodeModel(currentNodeModel); + flowMethod.setHandleStatus(fo.getHandleStatus()); + flowMethod.setAuditFlag(true); + boolean auditRes = operatorUtil.checkAudit(flowMethod); + if (!auditRes) { + return vo; + } + if (ObjectUtil.equals(flowMethod.getHandleStatus(), FlowNature.RejectCompletion) + && !global.getHasContinueAfterReject()) { + return vo; + } + } + List typeList = ImmutableList.of(NodeEnum.eventTrigger.getType(), NodeEnum.timeTrigger.getType(), + NodeEnum.noticeTrigger.getType(), NodeEnum.webhookTrigger.getType(), NodeEnum.trigger.getType()); + List connectList = global.getConnectList(); + List flows = flowMethod.getOutgoingFlows(); + // 判断排他 + boolean isExclusive = ObjectUtil.equals(currentNodeModel.getDivideRule(), DivideRuleEnum.EXCLUSIVE.getType()); + boolean exclusive = false; + // 根据true的分支获取节点 + for (String key : flows) { + if (!connectList.contains(key)) { + continue; + } + if (!branchFlow) { + if (!resMap.get(key)) { + continue; + } + if (exclusive) { // 标识为true,说明排他的第一个条件为true + break; + } + if (isExclusive) {// 排他网关 变更标识 + exclusive = true; + } + } + // 获取连接线的目标节点 + List nodeKey = flowAbleUrl.getTaskKeyAfterFlow(jsonEntity.getFlowableId(), key); + if (CollectionUtil.isEmpty(nodeKey)) { + continue; + } + NodeModel nodeModel = nodes.get(nodeKey.get(0)); + if (null == nodeModel) { + continue; + } + if (typeList.contains(nodeModel.getType())) { + continue; + } + getCandidateListModel(nodeModel, list); + if (nodeModel.getType().equals(NodeEnum.subFlow.getType())) { + // 判断子流程,获取审批节点 + FlowMethod jsonToBean = JsonUtil.getJsonToBean(flowMethod, FlowMethod.class); + jsonToBean.setNodeCode(nodeModel.getNodeId()); + jsonToBean.setNextSubFlow(true); + List nextApprover = taskUtil.getNextApprover(jsonToBean); + for (NodeModel node : nextApprover) { + getCandidateListModel(node, list); + } + } + } + // 获取已选择的候选人 + Integer counterSign = currentNodeModel.getCounterSign(); + if (StringUtil.isNotBlank(taskId) && !ObjectUtil.equals(counterSign, 0)) { + for (CandidateListModel model : list) { + List candidates = candidatesService.getList(taskId, model.getNodeCode()); + String candidateStr = candidates.stream().map(CandidatesEntity::getCandidates) + .collect(Collectors.joining(",")); + if (StringUtil.isNotEmpty(candidateStr)) { + List selected = new ArrayList<>(); + List userIds = Arrays.stream(candidateStr.split(",")).distinct() + .collect(Collectors.toList()); + List userList = serviceUtil.getUserName(userIds); + for (UserEntity user : userList) { + selected.add(user.getRealName() + "/" + user.getAccount()); + } + model.setSelected(String.join(";", selected)); + } + } + } + if (branchFlow) { + vo.setType(1); + list = list.stream().peek(e -> e.setIsBranchFlow(true)).collect(Collectors.toList()); + } else { + CandidateListModel listModel = list.stream().filter(e -> ObjectUtil.equals(e.getIsCandidates(), true)) + .findFirst().orElse(null); + if (null != listModel) { + vo.setType(2); + } + } + vo.setList(list); + return vo; + } + + public void getCandidateListModel(NodeModel nodeModel, List list) { + CandidateListModel listModel = list.stream() + .filter(e -> ObjectUtil.equals(nodeModel.getNodeId(), e.getNodeCode())).findFirst().orElse(null); + if (null != listModel) { + return; + } + CandidateListModel model = new CandidateListModel(); + model.setNodeCode(nodeModel.getNodeId()); + model.setNodeName(nodeModel.getNodeName()); + boolean isCandidate = FlowTaskOperatorEnum.Candidate.getCode().equals(nodeModel.getAssigneeType()); + model.setIsCandidates(isCandidate); + if (isCandidate) { + List userIds = serviceUtil.getUserListAll(nodeModel.getApprovers()); + List users = serviceUtil.getUserName(userIds, true); + model.setHasCandidates(!users.isEmpty()); + } + list.add(model); + } + + @Override + public List getCandidateUser(String id, CandidateUserFo fo) throws WorkFlowException { + TemplateJsonEntity jsonEntity = templateJsonService.getById(fo.getFlowId()); + if (null == jsonEntity) { + TemplateEntity template = templateService.getInfo(fo.getFlowId()); + jsonEntity = templateJsonService.getInfo(template.getFlowId()); + } + List nodeEntities = templateNodeService.getList(jsonEntity.getId()); + + Map nodes = new HashMap<>(); + for (TemplateNodeEntity nodeEntity : nodeEntities) { + nodes.put(nodeEntity.getNodeCode(), JsonUtil.getJsonToBean(nodeEntity.getNodeJson(), NodeModel.class)); + } + NodeModel nodeModel = nodes.get(fo.getNodeCode()); + if (null == nodeModel) { + throw new WorkFlowException(MsgCode.WF076.get()); + } + List vos = new ArrayList<>(); + // 获取候选人 + List approvers = taskUtil.getSub(nodeModel); + List userIds = serviceUtil.getUserListAll(approvers); + Pagination pagination = JsonUtil.getJsonToBean(fo, Pagination.class); + + // 候选人范围过滤 + UserInfo userInfo = UserProvider.getUser(); + UserEntity userEntity = serviceUtil.getUserInfo(userInfo.getUserId()); + OperatorEntity operator = operatorService.getById(id); + if (null != operator) { + userEntity = serviceUtil.getUserInfo(operator.getHandleId()); + } else { + if (StringUtil.isNotBlank(fo.getDelegateUser())) { + userEntity = serviceUtil.getUserInfo(fo.getDelegateUser()); + } + } + taskUtil.rule(userIds, userEntity, nodeModel.getExtraRule()); + + List userList = serviceUtil.getUserName(userIds, pagination); + fo.setTotal(pagination.getTotal()); + List userIdList = userList.stream().map(UserEntity::getId).collect(Collectors.toList()); + Map> userMap = serviceUtil.getListByUserIdAll(userIdList).stream() + .filter(t -> PermissionConst.ORGANIZE.equals(t.getObjectType())) + .collect(Collectors.groupingBy(UserRelationEntity::getUserId)); + + for (UserEntity user : userList) { + CandidateUserVo vo = JsonUtil.getJsonToBean(user, CandidateUserVo.class); + vo.setFullName(user.getRealName() + "/" + user.getAccount()); + vo.setHeadIcon(UploaderUtil.uploaderImg(user.getHeadIcon())); + List listByUserId = userMap.get(user.getId()) != null ? userMap.get(user.getId()) + : new ArrayList<>(); + StringJoiner joiner = new StringJoiner(","); + for (UserRelationEntity relation : listByUserId) { + List organizeId = serviceUtil.getOrganizeId(relation.getObjectId()); + if (!organizeId.isEmpty()) { + String organizeName = organizeId.stream().map(OrganizeEntity::getFullName) + .collect(Collectors.joining("/")); + joiner.add(organizeName); + } + } + vo.setOrganize(joiner.toString()); + vos.add(vo); + } + return vos; + } + + // 提交的候选人校验 + public void checkCandidateOfSubmit(Map> candidateList, String flowId, + Map formData, String taskId) throws WorkFlowException { + CandidateCheckFo checkFo = new CandidateCheckFo(); + checkFo.setFlowId(flowId); + checkFo.setFormData(formData); + checkFo.setId(taskId); + CandidateCheckVo candidateCheckVo = checkCandidates("0", checkFo); + if (null != candidateCheckVo && CollectionUtil.isNotEmpty(candidateCheckVo.getList())) { + for (CandidateListModel model : candidateCheckVo.getList()) { + // 候选人选项,但候选人集合为空 + if (model.getIsCandidates() && CollectionUtil.isEmpty(candidateList.get(model.getNodeCode()))) { + throw new WorkFlowException(MsgCode.WF121.get()); + } + } + } + } + + @DSTransactional(rollbackFor = Exception.class) + @Override + public void batchSaveOrSubmit(FlowModel flowModel) throws Exception { + UserInfo userInfo = flowModel.getUserInfo(); + if (null == userInfo) { + userInfo = UserProvider.getUser(); + flowModel.setUserInfo(userInfo); + } + + String delegateUser = flowModel.getDelegateUser(); + if (StringUtil.isBlank(delegateUser)) { + this.saveOrSubmit(flowModel); + } else { + FlowModel model = JsonUtil.getJsonToBean(flowModel, FlowModel.class); + model.setDelegateUser(userInfo.getUserId()); + model.setUserId(delegateUser); + UserEntity userEntity = serviceUtil.getUserInfo(delegateUser); + if (null != userEntity) { + UserInfo info = model.getUserInfo(); + info.setUserName(userEntity.getRealName()); + info.setUserAccount(userEntity.getAccount()); + info.setUserId(userEntity.getId()); + model.setUserInfo(info); + } + this.saveOrSubmit(model); + // 赋值给原来的FlowModel + BeanUtil.copyProperties(model, flowModel); + } + // 保存表单数据 + FlowContextHolder.deleteFormOperator(); + Map> allData = FlowContextHolder.getAllData(); + Map>> formOperates = FlowContextHolder.getFormOperates(); + List writeIdList = FlowContextHolder.getWriteIdList(); + for (String idAll : writeIdList) { + String[] idList = idAll.split("_yunzhupaas_"); + List> operates = formOperates.get(idAll); + Map formData = allData.get(idAll); + formData = formData == null ? new HashMap<>() : formData; + String flowId = (String) formData.get(FlowFormConstant.FLOWID); + FlowFormDataModel formDataModel = FlowFormDataModel.builder().formId(idList[1]).id(idList[0]).map(formData) + .formOperates(operates).flowId(flowId).isTransfer(true).build(); + serviceUtil.saveOrUpdateFormData(formDataModel); + } + FlowContextHolder.clearAll(); + } + + // 提交或暂存 + @Override + public void saveOrSubmit(FlowModel flowModel) throws Exception { + TemplateEntity templateEntity = null; + + TemplateJsonEntity jsonEntity = templateJsonService.getById(flowModel.getFlowId()); + if (null == jsonEntity) { + templateEntity = templateService.getInfo(flowModel.getFlowId()); + jsonEntity = templateJsonService.getInfo(templateEntity.getFlowId()); + } else { + templateEntity = templateService.getInfo(jsonEntity.getTemplateId()); + } + + UserInfo userInfo = flowModel.getUserInfo(); + List branchList = flowModel.getBranchList(); + // taskUtil.checkLaunchPermission(userInfo.getUserId(), templateEntity); + + // 获取节点 + List nodeEntityList = templateNodeService.getList(jsonEntity.getId()); + if (CollectionUtil.isEmpty(nodeEntityList)) { + throw new WorkFlowException(MsgCode.WF076.get()); + } + Map nodes = new HashMap<>(); + for (TemplateNodeEntity nodeEntity : nodeEntityList) { + nodes.put(nodeEntity.getNodeCode(), JsonUtil.getJsonToBean(nodeEntity.getNodeJson(), NodeModel.class)); + } + + flowModel.setJsonEntity(jsonEntity); + TaskEntity entity = this.createEntity(flowModel, templateEntity, nodes); + // 开始节点 + TemplateNodeEntity nodeEntity = nodeEntityList.stream() + .filter(e -> StringUtil.equals(NodeEnum.start.getType(), e.getNodeType())).findFirst().orElse(null); + if (null == nodeEntity) { + throw new WorkFlowException(MsgCode.WF076.get()); + } + String nodeCode = nodeEntity.getNodeCode(); + // 传递部署id、节点集合 + String deploymentId = jsonEntity.getFlowableId(); + flowModel.setDeploymentId(deploymentId); + flowModel.setNodeEntityList(nodeEntityList); + flowModel.setNodes(nodes); + flowModel.setNodeEntity(nodeEntity); + + NodeModel nodeModel = JsonUtil.getJsonToBean(nodeEntity.getNodeJson(), NodeModel.class); + // 表单主键 + String formId = nodeEntity.getFormId(); + + Map data = flowModel.getFormData(); + data.put(FlowFormConstant.FLOWID, jsonEntity.getId()); + FlowMethod flowMethod = new FlowMethod(); + flowMethod.setDeploymentId(deploymentId); + flowMethod.setNodeCode(nodeCode); + flowMethod.setFormData(data); + flowMethod.setNodes(nodes); + flowMethod.setTaskEntity(entity); + // flowMethod.setJsonEntity(jsonEntity); + + // 退回到发起 + if (null != entity.getRejectDataId() && ObjectUtil.equals(flowModel.getStatus(), 1)) { + RejectDataEntity rejectData = rejectDataService.getInfo(entity.getRejectDataId()); + String taskJson = rejectData.getTaskJson(); + String operatorJson = rejectData.getOperatorJson(); + + TaskEntity srcTask = JsonUtil.getJsonToBean(taskJson, TaskEntity.class); + List srcOperatorList = JsonUtil.getJsonToList(operatorJson, OperatorEntity.class); + for (OperatorEntity operator : srcOperatorList) { + operator.setCreatorTime(new Date()); + } + operatorService.updateBatchById(srcOperatorList); + + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.lambda().eq(TaskEntity::getId, srcTask.getId()) + .set(TaskEntity::getCurrentNodeCode, srcTask.getCurrentNodeCode()) + .set(TaskEntity::getCurrentNodeName, srcTask.getCurrentNodeName()) + .set(TaskEntity::getStatus, srcTask.getStatus()) + .set(TaskEntity::getStartTime, srcTask.getStartTime()) + .set(TaskEntity::getRejectDataId, null); + this.update(updateWrapper); + + rejectDataService.removeById(entity.getRejectDataId()); + + TaskEntity task = this.getById(srcTask.getId()); + flowModel.setTaskEntity(task); + + // 记录 + flowMethod.setFlowModel(flowModel); + flowMethod.setType(RecordEnum.submit.getCode()); + OperatorEntity operatorEntity = new OperatorEntity(); + operatorEntity.setNodeCode(nodeEntity.getNodeCode()); + operatorEntity.setNodeName(nodeModel.getNodeName()); + operatorEntity.setTaskId(entity.getId()); + if (StringUtil.isNotBlank(flowModel.getUserId())) { + flowMethod.setHandId(flowModel.getUserId()); + } + flowMethod.setOperatorEntity(operatorEntity); + recordUtil.createRecord(flowMethod); + return; + } + + FlowFormDataModel model = new FlowFormDataModel(); + model.setFormId(formId); + model.setId(entity.getId()); + model.setFormOperates(nodeModel.getFormOperates()); + model.setMap(flowModel.getFormData()); + model.setFlowId(jsonEntity.getId()); + + if (ObjectUtil.equals(TaskStatusEnum.TO_BE_SUBMIT.getCode(), flowModel.getStatus())) { + // 生成任务,保存表单数据 + if (flowModel.getSubFlow()) { + model.setIsTransfer(true); + } + // 菜单入口、编辑 + if (Objects.equals(flowModel.getIsFlow(), 0)) { + serviceUtil.saveOrUpdateFormData(model); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(null != userInfo ? userInfo.getUserId() : UserProvider.getLoginUserId()); + this.updateById(entity); + flowModel.setTaskEntity(entity); + return; + } + + if (StringUtil.isEmpty(flowModel.getId())) { + entity.setStatus(TaskStatusEnum.TO_BE_SUBMIT.getCode()); + if (this.save(entity)) { + // 保存表单数据 + serviceUtil.saveOrUpdateFormData(model); + } + } else { + // 我发起的暂存 直接修改表单数据 + serviceUtil.saveOrUpdateFormData(model); + } + flowModel.setTaskEntity(entity); + } else if (ObjectUtil.equals(TaskStatusEnum.RUNNING.getCode(), flowModel.getStatus())) { + // 判断条件 + Map resMap = new HashMap<>(); + if (branchList.isEmpty()) { + resMap = conditionService.handleCondition(flowMethod); + // 全是false,说明没有分支可走 + conditionService.checkCondition(resMap, nodes); + // 判断候选人 + // checkCandidateOfSubmit(flowModel.getCandidateList(), flowModel.getFlowId(), + // flowModel.getFormData(), entity.getId()); + // Map> errorRuleUserList = + // flowModel.getErrorRuleUserList(); + // if (CollectionUtil.isEmpty(errorRuleUserList)) { + // List nextApprover = taskUtil.getNextApprover(flowMethod); + // flowModel.setTaskEntity(entity); + // taskUtil.checkNextError(flowModel, nextApprover); + // } + } else { + // 选择分支的处理 + resMap = conditionService.getForBranch(flowMethod, branchList); + } + // 引擎启动的变量 + Map variables = new HashMap<>(resMap); + // 生成引擎实例 + String instanceId = entity.getInstanceId(); + if (entity.getInstanceId() == null) { + taskLineService.create(entity.getId(), resMap); + instanceId = flowAbleUrl.startInstance(jsonEntity.getFlowableId(), variables); + entity.setInstanceId(instanceId); + } + entity.setEngineType(1); + entity.setStatus(TaskStatusEnum.RUNNING.getCode()); + entity.setStartTime(new Date()); + // 生成任务 + try { + TaskEntity task = this.getById(entity.getId()); + if (null == task) { + this.save(entity); + } else { + entity.setStatus(TaskStatusEnum.RUNNING.getCode()); + this.updateById(entity); + } + flowModel.setTaskEntity(entity); + serviceUtil.saveOrUpdateFormData(model); + data = serviceUtil.infoData(formId, entity.getId()); + // 表单数据存储 + data.put(FlowFormConstant.FLOWID, jsonEntity.getId()); + FlowContextHolder.addChildData(entity.getId(), nodeEntity.getFormId(), data, + nodeModel.getFormOperates(), false); + flowModel.setFormData(data); + // 流程参数 + NodeModel global = nodes.get(NodeEnum.global.getType()); + taskUtil.updateGlobalParam(entity, nodeModel, global, flowModel.getFormData()); + // 记录 + flowMethod.setFlowModel(flowModel); + flowMethod.setType(RecordEnum.submit.getCode()); + OperatorEntity operatorEntity = new OperatorEntity(); + operatorEntity.setNodeCode(nodeEntity.getNodeCode()); + operatorEntity.setNodeName(nodeModel.getNodeName()); + operatorEntity.setTaskId(entity.getId()); + if (StringUtil.isNotBlank(flowModel.getUserId())) { + flowMethod.setHandId(flowModel.getUserId()); + } + operatorEntity.setHandleTime(entity.getStartTime()); + flowMethod.setOperatorEntity(operatorEntity); + recordUtil.createRecord(flowMethod); + // 节点记录 + NodeRecordModel nodeRecordModel = new NodeRecordModel(); + nodeRecordModel.setTaskId(entity.getId()); + nodeRecordModel.setNodeCode(nodeEntity.getNodeCode()); + nodeRecordModel.setNodeName(nodeModel.getNodeName()); + nodeRecordModel.setNodeStatus(1); + nodeRecordService.create(nodeRecordModel); + + // 保存候选人、异常人 + candidatesService.create(flowModel, entity.getId(), nodeEntityList, null); + // 保存发起用户信息 + launchUserService.createLaunchUser(entity.getId(), entity.getCreatorUserId()); + + // 生成经办 + List operatorEntities = operatorService.handleOperator(flowModel); + + // 系统审批 + operatorUtil.systemAudit(); + // 消息 + FlowMsgModel flowMsgModel = new FlowMsgModel(); + flowMsgModel.setNodeList(nodeEntityList); + flowMsgModel.setTaskEntity(entity); + flowMsgModel.setFlowModel(flowModel); + flowMsgModel.setOperatorList(operatorEntities); + flowMsgModel.setFormData(FlowContextHolder.getAllData()); + msgUtil.message(flowMsgModel); + + } catch (WorkFlowException e) { + log.error("提交异常", e); + // 异常,手动删除实例 + flowAbleUrl.deleteInstance(instanceId, "submitException"); + throw e; + } + } + } + + public TaskEntity createEntity(FlowModel fo, TemplateEntity templateEntity, Map nodes) + throws WorkFlowException { + UserInfo user = UserProvider.getUser(); + String userName = user.getUserName(); + String userId = user.getUserId(); + UserInfo userInfo = fo.getUserInfo(); + if (null != userInfo) { + if (StringUtil.isBlank(fo.getUserId())) { + fo.setUserId(userInfo.getUserId()); + } + userName = userInfo.getUserName(); + userId = userInfo.getUserId(); + } + Map data = fo.getFormData() == null ? new HashMap<>() : fo.getFormData(); + data.put(FlowConstant.FLOW_FULL_NAME, templateEntity.getFullName()); + data.put(FlowConstant.FLOW_FULL_CODE, templateEntity.getEnCode()); + data.put(FlowConstant.LAUNCH_USER_NAME, userName); + data.put(FlowConstant.LAUNCH_TIME, DateUtil.daFormat(new Date())); + NodeModel global = nodes.get(NodeEnum.global.getType()); + if (StringUtil.isNotEmpty(fo.getId())) { + TaskEntity taskEntity = this.getById(fo.getId()); + if (null != taskEntity) { + if (StringUtil.isNotBlank(fo.getDelegateUser())) { + taskEntity.setDelegateUserId(fo.getDelegateUser()); + } + taskEntity.setCreatorUserId(StringUtil.isNotBlank(fo.getUserId()) ? fo.getUserId() : userId); + // 流程名称 + if (ObjectUtil.equals(TaskStatusEnum.RUNNING.getCode(), fo.getStatus()) + && ObjectUtil.equals(taskEntity.getStatus(), TaskStatusEnum.TO_BE_SUBMIT.getCode())) { + String fullName = userName + "的" + taskEntity.getFullName(); + if (!FlowNature.TitleType.equals(global.getTitleType())) { + fullName = FlowJsonUtil.field(global.getTitleContent(), data, "1"); + } + taskEntity.setFullName(fullName); + } + return taskEntity; + } + } + TaskEntity entity = new TaskEntity(); + + entity.setType(fo.getIsFlow()); + if (StringUtil.isNotEmpty(fo.getId())) { + entity.setId(fo.getId()); + } else { + entity.setId(RandomUtil.uuId()); + } + entity.setUrgent(fo.getFlowUrgent()); + entity.setSortCode(0L); + + if (StringUtil.isNotBlank(fo.getDelegateUser())) { + entity.setDelegateUserId(fo.getDelegateUser()); + } + + // 发起人就是创建人 + entity.setCreatorUserId(StringUtil.isNotBlank(fo.getUserId()) ? fo.getUserId() : userId); + entity.setCreatorTime(new Date()); + + FileConfig fileConfig = global.getFileConfig(); + entity.setIsFile(fileConfig.getOn() ? 0 : null); + // 流程名称 + String fullName = templateEntity.getFullName(); + if (!ObjectUtil.equals(fo.getStatus(), TaskStatusEnum.TO_BE_SUBMIT.getCode())) { + fullName = userName + "的" + templateEntity.getFullName(); + if (!FlowNature.TitleType.equals(global.getTitleType())) { + fullName = FlowJsonUtil.field(global.getTitleContent(), data, "1"); + } + } + entity.setParentId(fo.getParentId()); + if (!StringUtil.equals("0", fo.getParentId())) { + fullName += "(子流程)"; + entity.setSubCode(fo.getSubCode()); + entity.setSubParameter(JsonUtil.getObjectToString(fo.getSubParameter())); + entity.setIsAsync(fo.getIsAsync()); + } + entity.setFullName(fullName); + + entity.setDelegateUserId(fo.getDelegateUser()); + entity.setFlowCode(templateEntity.getEnCode()); + entity.setFlowName(templateEntity.getFullName()); + entity.setFlowCategory(templateEntity.getCategory()); + TemplateJsonEntity jsonEntity = fo.getJsonEntity(); + if (null != jsonEntity && StringUtil.isNotBlank(jsonEntity.getVersion())) { + entity.setFlowVersion(jsonEntity.getVersion()); + } else { + entity.setFlowVersion(templateEntity.getVersion()); + } + entity.setTemplateId(templateEntity.getId()); + entity.setFlowId(templateEntity.getFlowId()); + // entity.setIsBatch(1);// 0:否,1:是 + + if (templateEntity.getType() != null) { + entity.setFlowType(templateEntity.getType()); + } + return entity; + } + + // 发起撤回 + @DSTransactional + @Override + public void recall(String id, FlowModel flowModel) throws WorkFlowException { + taskUtil.setFlowModel(id, flowModel); + TaskEntity taskEntity = flowModel.getTaskEntity(); + taskUtil.checkTemplateHide(taskEntity.getTemplateId()); + List nodeEntityList = flowModel.getNodeEntityList(); + if (CollectionUtil.isEmpty(nodeEntityList)) { + throw new WorkFlowException(MsgCode.WF076.get()); + } + + // 开始节点 + TemplateNodeEntity nodeEntity = nodeEntityList.stream() + .filter(e -> StringUtil.equals(NodeEnum.start.getType(), e.getNodeType())).findFirst().orElse(null); + if (null == nodeEntity) { + throw new WorkFlowException(MsgCode.WF076.get()); + } + NodeModel start = JsonUtil.getJsonToBean(nodeEntity.getNodeJson(), NodeModel.class); + + flowModel.setNodeEntity(nodeEntity); + flowModel.setIsException(true); + if (!buttonUtil.checkRecall(flowModel)) { + throw new WorkFlowException(MsgCode.WF077.get()); + } + // 删除子流程(判断方法中,存在异步 或 同步子流程已提交 则不允许撤回) + taskUtil.deleteSubflow(taskEntity.getId(), null); + // 记录 + FlowMethod flowMethod = new FlowMethod(); + flowMethod.setType(RecordEnum.recall.getCode()); + flowMethod.setFlowModel(flowModel); + OperatorEntity operatorEntity = new OperatorEntity(); + operatorEntity.setNodeCode(nodeEntity.getNodeCode()); + operatorEntity.setNodeName(start.getNodeName()); + operatorEntity.setTaskId(taskEntity.getId()); + operatorEntity.setHandleId(taskEntity.getCreatorUserId()); + operatorEntity.setHandleTime(new Date()); + flowMethod.setOperatorEntity(operatorEntity); + recordUtil.createRecord(flowMethod); + + // 节点记录 + NodeRecordModel nodeRecordModel = new NodeRecordModel(); + nodeRecordModel.setTaskId(taskEntity.getId()); + nodeRecordModel.setNodeCode(nodeEntity.getNodeCode()); + nodeRecordModel.setNodeStatus(6); + nodeRecordService.update(nodeRecordModel); + + // 删除经办 + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(OperatorEntity::getTaskId, taskEntity.getId()); + operatorService.remove(wrapper); + + // 删除候选人 + candidatesService.deleteByCodes(taskEntity.getId(), null); + + // 删除发起人 + launchUserService.delete(taskEntity.getId()); + + // 删除引擎实例 + flowAbleUrl.deleteInstance(taskEntity.getInstanceId(), "retract"); + + // 变更任务状态 + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.lambda().eq(TaskEntity::getId, taskEntity.getId()) + .set(TaskEntity::getInstanceId, null) + .set(TaskEntity::getRejectDataId, null) + .set(TaskEntity::getCurrentNodeName, FlowNature.START_NAME) + .set(TaskEntity::getCurrentNodeCode, FlowNature.START_CODE) + .set(TaskEntity::getStatus, TaskStatusEnum.RECALL.getCode()); + this.update(updateWrapper); + if (taskEntity.getRejectDataId() != null) { + rejectDataService.removeById(taskEntity.getRejectDataId()); + } + } + + // 催办 + @Override + public boolean press(String id) throws WorkFlowException { + FlowModel flowModel = new FlowModel(); + taskUtil.setFlowModel(id, flowModel); + TaskEntity taskEntity = flowModel.getTaskEntity(); + List nodeEntityList = flowModel.getNodeEntityList(); + + // 消息 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OperatorEntity::getTaskId, id).eq(OperatorEntity::getCompletion, 0) + .ne(OperatorEntity::getStatus, OperatorStateEnum.Futility.getCode()) + .isNull(OperatorEntity::getHandleStatus).isNotNull(OperatorEntity::getDuedate); + List operatorList = operatorService.list(queryWrapper); + if (operatorList.isEmpty()) { + return false; + } + FlowMsgModel flowMsgModel = new FlowMsgModel(); + flowMsgModel.setNodeList(nodeEntityList); + flowMsgModel.setFlowModel(flowModel); + flowMsgModel.setTaskEntity(taskEntity); + flowMsgModel.setOperatorList(operatorList); + flowMsgModel.setPress(true); + msgUtil.message(flowMsgModel); + return true; + } + + @DSTransactional + @Override + public void revoke(String id, FlowModel flowModel) throws Exception { + taskUtil.setFlowModel(id, flowModel); + TaskEntity taskEntity = flowModel.getTaskEntity(); + if (!TaskStatusEnum.PASSED.getCode().equals(taskEntity.getStatus())) { + throw new WorkFlowException(MsgCode.WF078.get()); + } + // 处理撤销表单的数据 + taskUtil.submitOfRevoke(flowModel); + } + + @DSTransactional(rollbackFor = Exception.class) + @Override + public List delete(String id) throws Exception { + TaskEntity entity = this.getById(id); + if (null == entity) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + if (TaskStatusEnum.PAUSED.getCode().equals(entity.getStatus())) { + throw new WorkFlowException(MsgCode.WF114.get()); + } + ImmutableList status = ImmutableList.of(TaskStatusEnum.TO_BE_SUBMIT.getCode(), + TaskStatusEnum.RECALL.getCode()); + if (!status.contains(entity.getStatus())) { + throw new WorkFlowException(MsgCode.WF063.get()); + } + if (StringUtil.isNotEmpty(entity.getParentId()) && !FlowNature.ParentId.equals(entity.getParentId())) { + throw new WorkFlowException(entity.getFullName() + MsgCode.WF021.get()); + } + + List idList = ImmutableList.of(entity.getId()); + this.delete(idList); + List list = ImmutableList.of(entity); + return list; + } + + @DSTransactional(rollbackFor = Exception.class) + @Override + public void deleteBatch(List ids) throws Exception { + if (ids.isEmpty()) { + return; + } + List taskList = taskUtil.getOrderStaList(ids); + + List child = taskList.stream() + .filter(t -> StringUtil.isNotEmpty(t.getParentId()) && !FlowNature.ParentId.equals(t.getParentId())) + .collect(Collectors.toList()); + if (!child.isEmpty()) { + throw new WorkFlowException(child.get(0).getFullName() + MsgCode.WF021.get()); + } + + List taskStatusList = new ArrayList<>(); + for (String id : ids) { + List childAllList = this.getChildAllList(id); + taskStatusList.addAll(taskUtil.getOrderStaList(childAllList)); + } + List taskStatus = taskStatusList.stream() + .filter(t -> TaskStatusEnum.PAUSED.getCode().equals(t.getStatus())).collect(Collectors.toList()); + if (!taskStatus.isEmpty()) { + throw new WorkFlowException(taskStatus.get(0).getFullName() + MsgCode.WF113.get()); + } + + UserInfo userInfo = UserProvider.getUser(); + if (!userInfo.getIsAdministrator()) { + List organizeUserList = serviceUtil.getOrganizeUserList("delete"); + List taskOrganize = taskStatusList.stream() + .filter(t -> !organizeUserList.contains(t.getCreatorUserId())).collect(Collectors.toList()); + if (!taskOrganize.isEmpty()) { + throw new WorkFlowException(taskOrganize.get(0).getFullName() + MsgCode.WF051.get()); + } + } + + this.delete(ids); + taskUtil.deleteFormData(taskStatusList); + + List instanceIds = taskStatusList.stream() + .filter(t -> TaskStatusEnum.RUNNING.getCode().equals(t.getStatus()) + || TaskStatusEnum.CANCEL.getCode().equals(t.getStatus())) + .map(TaskEntity::getInstanceId).distinct().collect(Collectors.toList()); + if (CollectionUtil.isNotEmpty(instanceIds)) { + for (String instanceId : instanceIds) { + flowAbleUrl.deleteInstance(instanceId, "monitor"); + } + } + } + + public void delete(List idList) { + List idAll = new ArrayList<>(); + this.deleTaskAll(idList, idAll); + List revokeTaskIds = revokeService.getByTaskId(idAll); + idAll.addAll(revokeTaskIds); + if (!idAll.isEmpty()) { + QueryWrapper task = new QueryWrapper<>(); + task.lambda().in(TaskEntity::getId, idAll); + this.setIgnoreLogicDelete().remove(task); + this.clearIgnoreLogicDelete(); + // 候选人 + QueryWrapper candidates = new QueryWrapper<>(); + candidates.lambda().in(CandidatesEntity::getTaskId, idAll); + candidatesService.setIgnoreLogicDelete().remove(candidates); + candidatesService.clearIgnoreLogicDelete(); + // 发起人 + QueryWrapper launchUser = new QueryWrapper<>(); + launchUser.lambda().in(LaunchUserEntity::getTaskId, idAll); + launchUserService.setIgnoreLogicDelete().remove(launchUser); + launchUserService.clearIgnoreLogicDelete(); + // 评论 + QueryWrapper comment = new QueryWrapper<>(); + comment.lambda().in(CommentEntity::getTaskId, idAll); + commentService.setIgnoreLogicDelete().remove(comment); + commentService.clearIgnoreLogicDelete(); + // 经办 + QueryWrapper operator = new QueryWrapper<>(); + operator.lambda().in(OperatorEntity::getTaskId, idAll); + operatorService.setIgnoreLogicDelete().remove(operator); + operatorService.clearIgnoreLogicDelete(); + // 记录 + QueryWrapper record = new QueryWrapper<>(); + record.lambda().in(RecordEntity::getTaskId, idAll); + recordService.setIgnoreLogicDelete().remove(record); + recordService.clearIgnoreLogicDelete(); + // 退回信息 + List taskList = this.list(task); + List rejectDataIds = taskList.stream().map(TaskEntity::getRejectDataId) + .collect(Collectors.toList()); + if (CollectionUtil.isNotEmpty(rejectDataIds)) { + QueryWrapper rejectData = new QueryWrapper<>(); + rejectData.lambda().in(RejectDataEntity::getId, rejectDataIds); + rejectDataService.setIgnoreLogicDelete().remove(rejectData); + rejectDataService.clearIgnoreLogicDelete(); + } + // 抄送 + QueryWrapper circulate = new QueryWrapper<>(); + circulate.lambda().in(CirculateEntity::getTaskId, idAll); + circulateService.setIgnoreLogicDelete().remove(circulate); + circulateService.clearIgnoreLogicDelete(); + // 任务条件 + QueryWrapper taskLine = new QueryWrapper<>(); + taskLine.lambda().in(TaskLineEntity::getTaskId, idAll); + taskLineService.setIgnoreLogicDelete().remove(taskLine); + taskLineService.clearIgnoreLogicDelete(); + // 撤销 + QueryWrapper revokeWrapper = new QueryWrapper<>(); + revokeWrapper.lambda().in(RevokeEntity::getRevokeTaskId, idAll); + revokeService.setIgnoreLogicDelete().remove(revokeWrapper); + revokeService.clearIgnoreLogicDelete(); + // 任务流程 + triggerTaskService.deleteByTaskId(idAll); + } + } + + @Override + public void deleTaskAll(List idList, List idAll) { + idAll.addAll(idList); + for (String id : idList) { + List taskAll = this.getChildList(id, TaskEntity::getId); + List list = taskAll.stream().map(TaskEntity::getId).collect(Collectors.toList()); + this.deleTaskAll(list, idAll); + } + } + + public List getChildList(String id, SFunction... columns) { + return getChildList(ImmutableList.of(id), columns); + } + + public List getChildList(List id, SFunction... columns) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(columns).in(TaskEntity::getParentId, id); + return this.list(queryWrapper); + } + + public List getChildAllList(String id) { + List idAll = new ArrayList<>(); + List idList = ImmutableList.of(id); + this.deleTaskAll(idList, idAll); + return idAll; + } + + public void getChildList(String id, boolean suspend, List list) { + List taskAll = this.getChildList(id, TaskEntity::getId, TaskEntity::getIsAsync); + if (suspend) { + taskAll = taskAll.stream().filter(t -> FlowNature.ChildSync.equals(t.getIsAsync())) + .collect(Collectors.toList()); + } + for (TaskEntity entity : taskAll) { + list.add(entity.getId()); + this.getChildList(entity.getId(), suspend, list); + } + } + + // 终止与挂起的区别,就是能否在列表中查询到,撤销中不允许终止等操作 + @DSTransactional + @Override + public void cancel(String id, FlowModel flowModel, boolean isCancel) throws WorkFlowException { + if (isCancel) { + // 任务流程的终止 + TriggerTaskEntity triggerTask = triggerTaskService.getById(id); + if (null != triggerTask) { + triggerTask.setStatus(TaskStatusEnum.CANCEL.getCode()); + triggerTaskService.updateById(triggerTask); + return; + } + } + taskUtil.setFlowModel(id, flowModel); + TaskEntity taskEntity = flowModel.getTaskEntity(); + taskUtil.isSuspend(taskEntity); + + // 下架的判断 + if (!isCancel) { + TemplateEntity template = templateService.getById(taskEntity.getTemplateId()); + if (null != template) { + if (!ObjectUtil.equals(template.getStatus(), 1)) { + throw new WorkFlowException(MsgCode.WF140.get()); + } + } + } + + List idList = ImmutableList.of(id); + + List taskList = new ArrayList<>(); + // 递归获取子流程 + for (String taskId : idList) { + List childAllList = this.getChildAllList(taskId); + taskList.addAll(taskUtil.getOrderStaList(childAllList)); + } + + List nodeEntityList = flowModel.getNodeEntityList(); + + for (TaskEntity entity : taskList) { + taskUtil.isSuspend(entity); + // 记录 + FlowMethod flowMethod = new FlowMethod(); + flowMethod.setFlowModel(flowModel); + Integer type = isCancel ? RecordEnum.cancel.getCode() : RecordEnum.activate.getCode(); + flowMethod.setType(type); + OperatorEntity operatorEntity = new OperatorEntity(); + String code = StringUtil.isNotEmpty(entity.getCurrentNodeCode()) ? entity.getCurrentNodeCode() + : FlowNature.START_CODE; + operatorEntity.setNodeCode(code); + String name = StringUtil.isNotEmpty(entity.getCurrentNodeName()) ? entity.getCurrentNodeName() + : FlowNature.START_NAME; + operatorEntity.setNodeName(name); + operatorEntity.setTaskId(entity.getId()); + operatorEntity.setHandleId(UserProvider.getLoginUserId()); + flowMethod.setOperatorEntity(operatorEntity); + recordUtil.createRecord(flowMethod); + + if (isCancel) { + // 终止,更新实例 + entity.setHisStatus(entity.getStatus()); + entity.setStatus(TaskStatusEnum.CANCEL.getCode()); + this.updateById(entity); + + // 消息 + FlowMsgModel flowMsgModel = new FlowMsgModel(); + flowMsgModel.setNodeList(nodeEntityList); + flowMsgModel.setFlowModel(flowModel); + flowMsgModel.setTaskEntity(entity); + flowMsgModel.setEnd(true); + msgUtil.message(flowMsgModel); + } else { + // 复活 + entity.setStatus(entity.getHisStatus()); + this.updateById(entity); + operatorUtil.updateCreateTime(flowModel); + } + } + } + + @Override + public boolean checkAsync(String id) { + List childList = this.getChildList(id, TaskEntity::getId, TaskEntity::getIsAsync); + return childList.stream().filter(e -> FlowNature.ChildAsync.equals(e.getIsAsync())).count() > 0; + } + + // isSuspend: true 挂起、false 恢复 + @DSTransactional + @Override + public void pause(String id, FlowModel flowModel, Boolean isSuspend) throws WorkFlowException { + List idList = new ArrayList<>(); + idList.add(id); + + boolean pause = false; + + // 暂停的选项,0.全部 1:仅主流程,同时暂停同步子流程 + if (isSuspend) { + pause = flowModel.getPause() == 1; + } else { + TaskEntity taskEntity = this.getInfo(id); + if (ObjectUtil.equals(taskEntity.getIsRestore(), 1)) { + throw new WorkFlowException("无法恢复"); + } + List childList = this.getChildList(id, TaskEntity::getId, TaskEntity::getIsRestore); + // 存在 0(能恢复的),就只恢复 1(不能恢复的,即同步的) + pause = childList.stream().filter(e -> ObjectUtil.equals(e.getIsRestore(), 0)).count() > 0; + } + String userId = UserProvider.getLoginUserId(); + + this.getChildList(id, pause, idList); + + List orderStaList = taskUtil.getOrderStaList(idList); + + this.pause(orderStaList, isSuspend, id); + + for (TaskEntity entity : orderStaList) { + // 记录 + FlowMethod flowMethod = new FlowMethod(); + flowMethod.setFlowModel(flowModel); + flowMethod.setType(isSuspend ? RecordEnum.pause.getCode() : RecordEnum.reboot.getCode()); + OperatorEntity operatorEntity = new OperatorEntity(); + operatorEntity.setNodeCode(StringUtil.isNotBlank(entity.getCurrentNodeCode()) ? entity.getCurrentNodeCode() + : FlowNature.START_CODE); + operatorEntity.setNodeName(StringUtil.isNotBlank(entity.getCurrentNodeName()) ? entity.getCurrentNodeName() + : FlowNature.START_NAME); + operatorEntity.setTaskId(entity.getId()); + operatorEntity.setHandleId(userId); + flowMethod.setOperatorEntity(operatorEntity); + recordUtil.createRecord(flowMethod); + } + + } + + public List pause(List orderStaList, boolean isSuspend, String id) { + List operatorList = new ArrayList<>(); + for (TaskEntity taskEntity : orderStaList) { + if (isSuspend) { + // 暂停 + if (!ObjectUtil.equals(taskEntity.getStatus(), TaskStatusEnum.PAUSED.getCode())) { + taskEntity.setHisStatus(taskEntity.getStatus()); + taskEntity.setStatus(TaskStatusEnum.PAUSED.getCode()); + } + taskEntity.setIsRestore(ObjectUtil.equals(taskEntity.getId(), id) ? 0 : 1); + this.updateById(taskEntity); + } else { + // 恢复 + taskEntity.setStatus(taskEntity.getHisStatus()); + taskEntity.setHisStatus(TaskStatusEnum.PAUSED.getCode()); + taskEntity.setIsRestore(0); + this.updateById(taskEntity); + } + // 过滤作废的经办 + List list = operatorUtil.getList(taskEntity.getId()).stream() + .filter(e -> !e.getStatus().equals(OperatorStateEnum.Futility.getCode())) + .collect(Collectors.toList()); + operatorList.addAll(list); + } + return operatorList; + } + + @DSTransactional + @Override + public void assign(String id, FlowModel flowModel) throws WorkFlowException { + taskUtil.setFlowModel(id, flowModel); + TaskEntity entity = flowModel.getTaskEntity(); + taskUtil.isSuspend(entity); + taskUtil.isCancel(entity); + + String handleId = flowModel.getUserInfo() == null ? UserProvider.getLoginUserId() + : flowModel.getUserInfo().getUserId(); + + List nodeEntityList = flowModel.getNodeEntityList(); + + // 作废原先的经办、生成指派的经办 + OperatorEntity operator = operatorUtil.handleAssign(flowModel); + List list = new ArrayList<>(); + list.add(operator); + + String nodeCode = flowModel.getNodeCode(); + NodeModel nodeModel = flowModel.getNodes().get(nodeCode); + Boolean autoTransfer = flowModel.getAutoTransferFlag(); + boolean isProcessing = ObjectUtil.equals(nodeModel.getType(), NodeEnum.processing.getType()); + if (autoTransfer) { + flowModel.setHandleOpinion(isProcessing ? "系统转办" : "系统转审"); + } + // 记录 + FlowMethod flowMethod = new FlowMethod(); + flowMethod.setFlowModel(flowModel); + Integer transferType = isProcessing ? RecordEnum.transferProcessing.getCode() : RecordEnum.transfer.getCode(); + flowMethod.setType(autoTransfer ? transferType : RecordEnum.assign.getCode()); + OperatorEntity operatorEntity = new OperatorEntity(); + operatorEntity.setId(operator.getId()); + operatorEntity.setNodeCode(nodeCode); + operatorEntity.setNodeId(operator.getNodeId()); + operatorEntity.setNodeName(nodeModel.getNodeName()); + operatorEntity.setTaskId(entity.getId()); + operatorEntity.setHandleId(autoTransfer ? FlowNature.SYSTEM_CODE : handleId); + flowMethod.setOperatorEntity(operatorEntity); + List userIds = ImmutableList.of(flowModel.getHandleIds()); + flowMethod.setUserId(String.join(",", userIds)); + recordUtil.createRecord(flowMethod); + + // 消息 + FlowMsgModel flowMsgModel = new FlowMsgModel(); + flowMsgModel.setNodeList(nodeEntityList); + flowMsgModel.setFlowModel(flowModel); + flowMsgModel.setTaskEntity(entity); + flowMsgModel.setOperatorList(list); + if (flowModel.getAutoTransferFlag()) { + flowMsgModel.setTransfer(true); + } else { + flowMsgModel.setAssign(true); + } + msgUtil.message(flowMsgModel); + + // 超时 + TimeUtil.timeModel(list, flowModel, redisUtil); + } + + @Override + public TaskUserListModel getTaskUserList(String taskId) { + Set userIdSet = new HashSet<>(); + + // 发起人 + TaskEntity taskEntity = this.getById(taskId); + if (null != taskEntity) { + userIdSet.add(taskEntity.getCreatorUserId()); + } + + // 审批人 + List operatorList = operatorService.getList(taskId); + if (CollectionUtil.isNotEmpty(operatorList)) { + userIdSet.addAll(operatorList.stream().map(OperatorEntity::getHandleId).collect(Collectors.toList())); + } + + // 抄送 + List circulateList = circulateService.getList(taskId); + if (CollectionUtil.isNotEmpty(circulateList)) { + userIdSet.addAll(circulateList.stream().map(CirculateEntity::getUserId).collect(Collectors.toList())); + } + + List recordList = recordService.getList(taskId); + if (CollectionUtil.isNotEmpty(recordList)) { + userIdSet.addAll(recordList.stream().map(RecordEntity::getHandleId).collect(Collectors.toList())); + } + + TaskUserListModel model = new TaskUserListModel(); + model.setAllUserIdList(userIdSet.stream().collect(Collectors.toList())); + model.setFlowTask(taskEntity); + model.setOperatorList(operatorList); + model.setCirculateList(circulateList); + model.setOperatorRecordList(recordList); + + return model; + } + + @Override + public List subFlowInfo(FlowModel flowModel) throws WorkFlowException { + String taskId = flowModel.getTaskId(); + String nodeCode = flowModel.getNodeCode(); + List list = new ArrayList<>(); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(TaskEntity::getParentId, taskId).eq(TaskEntity::getSubCode, nodeCode); + List entityList = this.list(wrapper); + if (CollectionUtil.isNotEmpty(entityList)) { + for (TaskEntity entity : entityList) { + FlowModel model = new FlowModel(); + model.setFlowId(entity.getFlowId()); + BeforeInfoVo info = this.getInfo(entity.getId(), model); + list.add(info); + } + } + return list; + } + + // 消息跳转流程时,校验以及返回opType + @Override + public String checkInfo(String id) throws WorkFlowException { + CirculateEntity circulate = circulateService.getById(id); + if (null != circulate) { + return FlowNature.Circulate; + } + OperatorEntity operator = operatorService.getInfo(id); + if (null == operator) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + if (operator.getStatus().equals(OperatorStateEnum.Futility.getCode())) { + throw new WorkFlowException("该流程无权限查看"); + } + + TaskEntity taskEntity = this.getById(operator.getTaskId()); + if (null == taskEntity) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + if (TaskStatusEnum.CANCEL.getCode().equals(taskEntity.getStatus())) { + throw new WorkFlowException(MsgCode.WF041.get()); + } + if (TaskStatusEnum.RECALL.getCode().equals(taskEntity.getStatus())) { + throw new WorkFlowException(MsgCode.WF042.get()); + } + taskUtil.checkTemplateHide(taskEntity.getTemplateId()); + + String handleId = operator.getHandleId(); + String userId = UserProvider.getLoginUserId(); + List delegateList = delegateService.getToUser(handleId, taskEntity.getFlowId()); + delegateList.add(handleId); + if (!delegateList.contains(userId)) { + throw new WorkFlowException(MsgCode.FA021.get()); + } + + String opType = FlowNature.LaunchDetail; + if (null == operator.getSignTime() && null == operator.getStartHandleTime() + && null == operator.getHandleStatus()) { + opType = FlowNature.WaitSign; + } + if (null != operator.getSignTime() && null == operator.getStartHandleTime() + && null == operator.getHandleStatus()) { + opType = FlowNature.Todo; + } + if (null != operator.getSignTime() && null != operator.getStartHandleTime() + && null == operator.getHandleStatus()) { + opType = FlowNature.Doing; + } + if (null != operator.getHandleStatus() || operator.getCompletion().equals(1)) { + opType = FlowNature.Circulate; + } + return opType; + } + + @Override + public void updateIsFile(String taskId) throws WorkFlowException { + TaskEntity taskEntity = this.getInfo(taskId); + if (null != taskEntity) { + taskEntity.setIsFile(1); + this.updateById(taskEntity); + } + } + + // 获取发起表单 + @Override + public ViewFormModel getStartForm(String taskId) throws WorkFlowException { + ViewFormModel model = new ViewFormModel(); + TaskEntity taskEntity = this.getInfo(taskId); + List nodeEntityList = templateNodeService.getList(taskEntity.getFlowId()); + TemplateNodeEntity nodeEntity = nodeEntityList.stream() + .filter(e -> ObjectUtil.equals(e.getNodeType(), NodeEnum.start.getType())).findFirst().orElse(null); + if (null != nodeEntity) { + String formId = nodeEntity.getFormId(); + VisualdevEntity formInfo = serviceUtil.getFormInfo(formId); + model.setFormInfo(formInfo); + Map map = serviceUtil.infoData(formId, taskId); + model.setFormData(map); + } + return model; + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/TemplateJsonServiceImpl.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/TemplateJsonServiceImpl.java new file mode 100644 index 0000000..19ea80e --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/TemplateJsonServiceImpl.java @@ -0,0 +1,360 @@ +package com.yunzhupaas.flowable.service.impl; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.TemplateEntity; +import com.yunzhupaas.flowable.entity.TemplateJsonEntity; +import com.yunzhupaas.flowable.entity.TemplateNodeEntity; +import com.yunzhupaas.flowable.enums.NodeEnum; +import com.yunzhupaas.flowable.job.QuartzJobUtil; +import com.yunzhupaas.flowable.job.TimeTriggerJob; +import com.yunzhupaas.flowable.job.TriggerJobUtil; +import com.yunzhupaas.flowable.mapper.TemplateJsonMapper; +import com.yunzhupaas.flowable.model.flowable.FlowAbleUrl; +import com.yunzhupaas.flowable.model.template.FlowConfigModel; +import com.yunzhupaas.flowable.model.templatejson.TemplateJsonInfoVO; +import com.yunzhupaas.flowable.model.templatenode.TemplateNodeUpFrom; +import com.yunzhupaas.flowable.model.templatenode.nodejson.NodeModel; +import com.yunzhupaas.flowable.model.trigger.TimeTriggerModel; +import com.yunzhupaas.flowable.service.TemplateJsonService; +import com.yunzhupaas.flowable.service.TemplateNodeService; +import com.yunzhupaas.flowable.service.TemplateService; +import com.yunzhupaas.flowable.util.ServiceUtil; +import com.yunzhupaas.util.*; +import org.quartz.JobDataMap; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +@Service +public class TemplateJsonServiceImpl extends SuperServiceImpl implements TemplateJsonService { + + @Autowired + private FlowAbleUrl flowAbleUrl; + @Autowired + private TemplateService templateService; + @Autowired + private TemplateNodeService templateNodeService; + @Autowired + private ServiceUtil serviceUtil; + @Autowired + private RedisUtil redisUtil; + + @Override + public List getListByTemplateIds(List id) { + List list = new ArrayList<>(); + if (!id.isEmpty()) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(TemplateJsonEntity::getTemplateId, id); + list.addAll(this.list(queryWrapper)); + } + return list; + } + + @Override + public List getList(String templateId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TemplateJsonEntity::getTemplateId, templateId); + List list = this.list(queryWrapper); + + List resList = new ArrayList<>(); + if (CollectionUtil.isNotEmpty(list)) { + // 启用中 + List enableList = list.stream().filter(e -> ObjectUtil.equals(e.getState(), 1)) + .sorted(Comparator.comparing(TemplateJsonEntity::getCreatorTime).reversed()).collect(Collectors.toList()); + // 已归档 + List historicList = list.stream().filter(e -> ObjectUtil.equals(e.getState(), 2)) + .sorted(Comparator.comparing(TemplateJsonEntity::getCreatorTime).reversed()).collect(Collectors.toList()); + // 设计中 + List designList = list.stream().filter(e -> ObjectUtil.equals(e.getState(), 0)) + .sorted(Comparator.comparing(TemplateJsonEntity::getCreatorTime).reversed()).collect(Collectors.toList()); + + resList.addAll(enableList); + resList.addAll(historicList); + resList.addAll(designList); + } + + return resList; + } + + @Override + public List getListOfEnable() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TemplateJsonEntity::getState, 1); + return this.list(queryWrapper); + } + + @Override + public TemplateJsonEntity getInfo(String id) throws WorkFlowException { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TemplateJsonEntity::getId, id); + TemplateJsonEntity jsonEntity = this.getOne(queryWrapper); + if (jsonEntity == null) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + return jsonEntity; + } + + @Override + public boolean update(String id, TemplateJsonEntity entity) { + entity.setId(id); + return this.updateById(entity); + } + + @DSTransactional + @Override + public void save(TemplateNodeUpFrom from) throws WorkFlowException { + String templateJsonId = from.getFlowId(); + String id = from.getId(); + String flowXml = from.getFlowXml(); + Map> flowNodes = from.getFlowNodes(); + TemplateJsonEntity jsonEntity = getInfo(templateJsonId); + jsonEntity.setFlowXml(flowXml); + TemplateEntity entity = templateService.getInfo(id); + String flowConfig = from.getFlowConfig(); + entity.setFlowConfig(flowConfig); + FlowConfigModel config = JsonUtil.getJsonToBean(flowConfig, FlowConfigModel.class); + config = config == null ? new FlowConfigModel() : config; + entity.setVisibleType(config.getVisibleType()); + //发布流程 + if (Objects.equals(from.getType(), 1)) { + if (StringUtil.isEmpty(jsonEntity.getFlowableId())) { + String deploymentId = flowAbleUrl.deployFlowAble(flowXml, templateJsonId); + jsonEntity.setFlowableId(deploymentId); + } + //改流程版本 + if (StringUtil.isNotEmpty(id)) { + TemplateJsonEntity info = getList(id).stream().filter(t -> Objects.equals(t.getState(), 1)).findFirst().orElse(null); + int state = jsonEntity.getState(); + if (info != null) { + // 变更归档状态,排序码 + //info.setSortCode(0L); + info.setState(2); + this.update(info.getId(), info); + } + jsonEntity.setState(1); + //jsonEntity.setSortCode(1L); + entity.setFlowId(templateJsonId); + entity.setFlowableId(jsonEntity.getFlowableId()); + entity.setVersion(jsonEntity.getVersion()); + entity.setEnabledMark(1); + entity.setStatus(1); + // 归档状态的仅启用 + if (Objects.equals(2, state)) { + templateService.update(entity.getId(), entity); + this.update(jsonEntity.getId(), jsonEntity); +// this.timeTrigger(jsonEntity.getId()); + return; + } + } + } + templateService.update(entity.getId(), entity); + + TemplateNodeEntity timeTriggerNode = null; + if (ObjectUtil.isNotEmpty(flowNodes)) { + List list = templateNodeService.getList(jsonEntity.getId()); + List deleteList = list.stream().map(TemplateNodeEntity::getId).collect(Collectors.toList()); + templateNodeService.delete(deleteList); + // 开始节点的表单 + String startFormId = null; + for (String key : flowNodes.keySet()) { + NodeModel startNode = JsonUtil.getJsonToBean(flowNodes.get(key), NodeModel.class); + if (ObjectUtil.equals(startNode.getType(), NodeEnum.start.getType())) { + startFormId = startNode.getFormId(); + break; + } + } + String formId = null; + for (String key : flowNodes.keySet()) { + NodeModel nodeModel = JsonUtil.getJsonToBean(flowNodes.get(key), NodeModel.class); + if (ObjectUtil.equals(nodeModel.getType(), NodeEnum.global.getType())) { + formId = nodeModel.getFormId(); + } + TemplateNodeEntity nodeEntity = list.stream().filter(t -> ObjectUtil.equals(t.getNodeCode(), key)).findFirst().orElse(new TemplateNodeEntity()); + nodeEntity.setId(StringUtil.isNotEmpty(nodeEntity.getId()) ? nodeEntity.getId() : RandomUtil.uuId()); + nodeEntity.setFlowId(jsonEntity.getId()); + nodeEntity.setNodeCode(key); + nodeEntity.setNodeJson(JsonUtil.getObjectToString(flowNodes.get(key))); + nodeEntity.setNodeType(nodeModel.getType()); + if (StringUtil.isNotEmpty(nodeModel.getFormId())) { + nodeEntity.setFormId(nodeModel.getFormId()); + } else { + nodeEntity.setFormId(startFormId); + } + // 触发节点:定时、webhook 将flowId设置到formId字段 通知将msgId设置到formId + if (ObjectUtil.equals(nodeModel.getType(), NodeEnum.timeTrigger.getType())) { + nodeEntity.setFormId(nodeEntity.getFlowId()); + if (Objects.equals(from.getType(), 1)) { + timeTriggerNode = nodeEntity; + } + } else if (ObjectUtil.equals(nodeModel.getType(), NodeEnum.webhookTrigger.getType())) { + nodeEntity.setFormId(nodeEntity.getFlowId()); + } else if (ObjectUtil.equals(nodeModel.getType(), NodeEnum.noticeTrigger.getType())) { + nodeEntity.setFormId(nodeModel.getNoticeId()); + } + templateNodeService.setIgnoreLogicDelete().removeById(nodeEntity.getId()); + templateNodeService.setIgnoreLogicDelete().saveOrUpdate(nodeEntity); + templateNodeService.clearIgnoreLogicDelete(); + } + // 保存表单关联 + if (null != formId) { + List formIds = new ArrayList<>(); + formIds.add(formId); + } + } + this.update(jsonEntity.getId(), jsonEntity); + if (null != timeTriggerNode) { + this.timeTrigger(timeTriggerNode); + } + } + + public void timeTrigger(String flowId) { + List list = templateNodeService.getList(flowId); + List timeTriggerList = list.stream() + .filter(e -> ObjectUtil.equals(e.getNodeType(), NodeEnum.timeTrigger.getType())).collect(Collectors.toList()); + if (CollectionUtil.isNotEmpty(timeTriggerList)) { + for (TemplateNodeEntity nodeEntity : timeTriggerList) { + this.timeTrigger(nodeEntity); + } + } + } + + public void timeTrigger(TemplateNodeEntity nodeEntity) { + NodeModel nodeModel = JsonUtil.getJsonToBean(nodeEntity.getNodeJson(), NodeModel.class); + String id = RandomUtil.uuId(); + TimeTriggerModel model = new TimeTriggerModel(); + model.setId(id); + model.setFlowId(nodeEntity.getFlowId()); + model.setUserInfo(UserProvider.getUser()); + model.setCron(nodeModel.getCron()); + model.setEndLimit(nodeModel.getEndLimit()); + model.setEndTimeType(nodeModel.getEndTimeType()); + + String start = nodeModel.getStartTime(); + String end = nodeModel.getEndTime(); + Date startTime = ObjectUtil.isNotEmpty(start) ? new Date(Long.parseLong(start)) : new Date(); + Date endTime = ObjectUtil.equals(nodeModel.getEndTimeType(), 2) ? new Date(Long.parseLong(end)) : null; + model.setStartTime(startTime.getTime()); + model.setEndTime(endTime != null ? endTime.getTime() : null); + + JobDataMap jobDataMap = new JobDataMap(); + jobDataMap.putAll(JsonUtil.entityToMap(model)); + + redisUtil.removeHash(TriggerJobUtil.TRIGGER_MODEL, model.getId()); + boolean isAdd = endTime == null || endTime.getTime() > System.currentTimeMillis(); + if (isAdd) { + QuartzJobUtil.addJob(id, nodeModel.getCron(), TimeTriggerJob.class, jobDataMap, startTime, endTime); + } + } + + @DSTransactional + @Override + public void create(TemplateNodeUpFrom from) { + Map> flowNodes = from.getFlowNodes(); + String flowXml = from.getFlowXml(); + String templateJsonId = from.getFlowId(); + String id = from.getId(); + List jsonList = getList(id); + int version = jsonList.stream().map(TemplateJsonEntity::getVersion).mapToInt(Integer::parseInt).max().orElse(0) + 1; + TemplateJsonEntity entity = new TemplateJsonEntity(); + entity.setId(StringUtil.isNotEmpty(templateJsonId) ? templateJsonId : RandomUtil.uuId()); + entity.setTemplateId(id); + entity.setFlowXml(flowXml); + NodeModel startNode = JsonUtil.getJsonToList(new ArrayList<>(flowNodes.values()), NodeModel.class).stream().filter(t -> NodeEnum.start.getType().equals(t.getType())).findFirst().orElse(null); + entity.setVersion(String.valueOf(version)); + entity.setState(0); + entity.setSortCode(0L); + String formId = null != startNode ? startNode.getFormId() : null; + for (String key : flowNodes.keySet()) { + NodeModel nodeModel = JsonUtil.getJsonToBean(flowNodes.get(key), NodeModel.class); + TemplateNodeEntity nodeEntity = new TemplateNodeEntity(); + nodeEntity.setId(StringUtil.isNotEmpty(nodeEntity.getId()) ? nodeEntity.getId() : RandomUtil.uuId()); + nodeEntity.setFlowId(entity.getId()); + nodeEntity.setNodeCode(key); + nodeEntity.setNodeJson(JsonUtil.getObjectToString(flowNodes.get(key))); + nodeEntity.setNodeType(nodeModel.getType()); + nodeEntity.setFormId(StringUtil.isBlank(nodeModel.getFormId()) ? formId : nodeModel.getFormId()); + templateNodeService.setIgnoreLogicDelete().removeById(nodeEntity.getId()); + templateNodeService.setIgnoreLogicDelete().saveOrUpdate(nodeEntity); + templateNodeService.clearIgnoreLogicDelete(); + } + this.setIgnoreLogicDelete().removeById(entity.getId()); + this.setIgnoreLogicDelete().saveOrUpdate(entity); + this.clearIgnoreLogicDelete(); + } + + @Override + public void delete(TemplateJsonEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + + @Override + public void delete(List idList) { + if (idList.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(TemplateJsonEntity::getId, idList); + this.remove(queryWrapper); + templateNodeService.delete(idList); + } + } + + @Override + public void copy(TemplateJsonEntity entity, String flowId) { + List list = templateNodeService.getList(entity.getId()); + Map> flowNodes = new HashMap<>(); + for (TemplateNodeEntity nodeEntity : list) { + Map map = JsonUtil.stringToMap(nodeEntity.getNodeJson()); + if (ObjectUtil.equals(nodeEntity.getNodeType(), NodeEnum.webhookTrigger.getType())) { + map.put("webhookUrl", ""); + } + flowNodes.put(nodeEntity.getNodeCode(), map); + } + TemplateNodeUpFrom from = new TemplateNodeUpFrom(); + from.setId(entity.getTemplateId()); + from.setFlowXml(entity.getFlowXml()); + from.setFlowNodes(flowNodes); + from.setFlowId(flowId); + create(from); + } + + @Override + public TemplateJsonInfoVO getInfoVo(String id) throws WorkFlowException { + TemplateJsonEntity jsonEntity = this.getInfo(id); + TemplateEntity entity = templateService.getInfo(jsonEntity.getTemplateId()); + TemplateJsonInfoVO vo = JsonUtil.getJsonToBean(entity, TemplateJsonInfoVO.class); + vo.setFlowXml(jsonEntity.getFlowXml()); + List templateNodeList = templateNodeService.getList(jsonEntity.getId()); + Map> flowNodes = new HashMap<>(); + for (TemplateNodeEntity nodeEntity : templateNodeList) { + flowNodes.put(nodeEntity.getNodeCode(), JsonUtil.stringToMap(nodeEntity.getNodeJson())); + } + vo.setFlowableId(jsonEntity.getFlowableId()); + vo.setFlowNodes(flowNodes); + vo.setFlowId(jsonEntity.getId()); + return vo; + } + + @Override + public VisualdevEntity getFormInfo(String id) throws WorkFlowException { + TemplateEntity template = templateService.getInfo(id); + String flowId = template.getFlowId(); + TemplateJsonEntity jsonEntity = this.getInfo(flowId); + List templateNodeList = templateNodeService.getList(jsonEntity.getId()); + TemplateNodeEntity global = templateNodeList.stream().filter(e -> ObjectUtil.equals(e.getNodeType(), NodeEnum.global.getType())).findFirst().orElse(null); + if (null != global) { + return serviceUtil.getFormInfo(global.getFormId()); + } + return null; + } +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/TemplateNodeServiceImpl.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/TemplateNodeServiceImpl.java new file mode 100644 index 0000000..97f1d06 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/TemplateNodeServiceImpl.java @@ -0,0 +1,112 @@ +package com.yunzhupaas.flowable.service.impl; + +import cn.hutool.core.collection.CollectionUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.flowable.entity.TemplateJsonEntity; +import com.yunzhupaas.flowable.entity.TemplateNodeEntity; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.enums.NodeEnum; +import com.yunzhupaas.flowable.mapper.TemplateNodeMapper; +import com.yunzhupaas.flowable.service.TemplateJsonService; +import com.yunzhupaas.flowable.service.TemplateNodeService; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +@Service +public class TemplateNodeServiceImpl extends SuperServiceImpl implements TemplateNodeService { + + @Autowired + private TemplateJsonService templateJsonService; + + @Override + public List getList(String flowId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TemplateNodeEntity::getFlowId, flowId); + return this.list(queryWrapper); + } + + @Override + public List getList(List flowIds, String nodeType) { + if (flowIds.isEmpty()) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(TemplateNodeEntity::getFlowId, flowIds); + if (StringUtil.isNotBlank(nodeType)) { + queryWrapper.lambda().eq(TemplateNodeEntity::getNodeType, nodeType); + } + return this.list(queryWrapper); + } + + @Override + public List getListLikeUserId(String userId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().like(TemplateNodeEntity::getNodeJson, userId); + return this.list(queryWrapper); + } + + @Override + public TemplateNodeEntity getInfo(String id) throws WorkFlowException { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TemplateNodeEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(TemplateNodeEntity entity) { + entity.setId(RandomUtil.uuId()); + this.save(entity); + } + + @Override + public boolean update(String id, TemplateNodeEntity entity) { + entity.setId(id); + return this.updateById(entity); + } + + @Override + public void delete(TemplateNodeEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + + @Override + public void deleteList(List idList) { + if (!idList.isEmpty()) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(TemplateNodeEntity::getId, idList); + this.remove(queryWrapper); + } + } + + @Override + public void delete(List idList) { + if (!idList.isEmpty()) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(TemplateNodeEntity::getId, idList); + this.remove(queryWrapper); + } + } + + @Override + public List getListStart() { + List listOfEnable = templateJsonService.getListOfEnable(); + List flowIds = listOfEnable.stream().map(TemplateJsonEntity::getId).collect(Collectors.toList()); + if (CollectionUtil.isNotEmpty(flowIds)) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(TemplateNodeEntity::getFlowId, TemplateNodeEntity::getFormId); + queryWrapper.lambda().eq(TemplateNodeEntity::getNodeType, NodeEnum.start.getType()).in(TemplateNodeEntity::getFlowId, flowIds); + return this.list(queryWrapper); + } + return new ArrayList<>(); + } +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/TemplateServiceImpl.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/TemplateServiceImpl.java new file mode 100644 index 0000000..f2993d4 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/TemplateServiceImpl.java @@ -0,0 +1,730 @@ +package com.yunzhupaas.flowable.service.impl; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.github.yulichang.toolkit.JoinWrappers; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.google.common.collect.ImmutableList; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.*; +import com.yunzhupaas.flowable.enums.NodeEnum; +import com.yunzhupaas.flowable.mapper.TemplateMapper; +import com.yunzhupaas.flowable.model.template.*; +import com.yunzhupaas.flowable.model.templatejson.FlowFormModel; +import com.yunzhupaas.flowable.model.templatejson.TemplateJsonExportModel; +import com.yunzhupaas.flowable.model.templatenode.TemplateNodeUpFrom; +import com.yunzhupaas.flowable.service.*; +import com.yunzhupaas.flowable.util.ServiceUtil; +import com.yunzhupaas.flowable.util.TaskUtil; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +@Service +public class TemplateServiceImpl extends SuperServiceImpl implements TemplateService { + + @Autowired + private TemplateJsonService templateJsonService; + @Autowired + private TemplateNodeService templateNodeService; + @Autowired + private ServiceUtil serviceUtil; + @Autowired + private DelegateService delegateService; + @Autowired + private CommonService commonService; + @Autowired + private TaskUtil taskUtil; + @Autowired + private TriggerTaskService triggerTaskService; + + @Override + public List getList(TemplatePagination pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + String keyword = pagination.getKeyword(); + if (ObjectUtil.isNotEmpty(keyword)) { + queryWrapper.lambda().and(t -> t.like(TemplateEntity::getEnCode, keyword).or().like(TemplateEntity::getFullName, keyword)); + } + String category = pagination.getCategory(); + if (ObjectUtil.isNotEmpty(category)) { + queryWrapper.lambda().eq(TemplateEntity::getCategory, category); + } + Integer type = pagination.getType(); + if (ObjectUtil.isNotEmpty(type)) { + queryWrapper.lambda().eq(TemplateEntity::getType, type); + } + Integer enabledMark = pagination.getEnabledMark(); + if (ObjectUtil.isNotEmpty(enabledMark)) { + queryWrapper.lambda().eq(TemplateEntity::getEnabledMark, enabledMark); + } + queryWrapper.lambda().orderByAsc(TemplateEntity::getSortCode).orderByDesc(TemplateEntity::getCreatorTime); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage userPage = this.page(page, queryWrapper); + return pagination.setData(userPage.getRecords(), page.getTotal()); + } + + @Override + public List getSelector(TemplatePagination pagination) { + // 流程权限 + List flowId = new ArrayList<>(); + List id = new ArrayList<>(); + String userId = UserProvider.getLoginUserId(); + if (StringUtil.isNotBlank(pagination.getDelegateUser())) { + userId = pagination.getDelegateUser(); + } + // 权限 + boolean commonUser = serviceUtil.isCommonUser(userId); + // 是否委托列表 + if (ObjectUtil.equals(pagination.getIsDelegate(), 1)) { + if (commonUser) { + flowId.addAll(serviceUtil.getLaunchPermission(userId)); + } + } else { + if (ObjectUtil.equals(pagination.getIsAuthority(), 1)) { + if (commonUser) { + flowId.addAll(serviceUtil.getLaunchPermission(userId)); + } + // 委托 + List delegateEntityList = delegateService.getByToUserId(userId, 0); + for (DelegateEntity delegate : delegateEntityList) { + List launchPermission = serviceUtil.getLaunchPermission(delegate.getUserId()); + if (StringUtil.isNotEmpty(delegate.getFlowId())) { + launchPermission.retainAll(Arrays.asList(delegate.getFlowId().split(","))); + } + id.addAll(launchPermission); + } + flowId.addAll(id); + flowId = flowId.stream().distinct().collect(Collectors.toList()); + } + } + + MPJLambdaWrapper wrapper = JoinWrappers.lambda(TemplateEntity.class) + .selectAll(TemplateEntity.class) + .eq(TemplateEntity::getEnabledMark, 1).ne(TemplateEntity::getType, 2) + .eq(TemplateEntity::getStatus, 1); + if (ObjectUtil.equals(pagination.getIsLaunch(), 1)) { + wrapper.in(TemplateEntity::getShowType, 0, 1); + } + + if (ObjectUtil.equals(pagination.getIsAuthority(), 1)) { + if (commonUser) { + List finalFlowId = flowId; + wrapper.and(t -> t.eq(TemplateEntity::getVisibleType, 1) + .or().in(!finalFlowId.isEmpty(), TemplateEntity::getId, finalFlowId) + ); + } + } + + //关键字(流程名称、流程编码) + String keyWord = pagination.getKeyword(); + if (ObjectUtil.isNotEmpty(keyWord)) { + wrapper.and(t -> t.like(TemplateEntity::getEnCode, keyWord).or().like(TemplateEntity::getFullName, keyWord)); + } + //所属分类 + String category = pagination.getCategory(); + if (ObjectUtil.isNotEmpty(category)) { + if (StringUtil.equals(category, "commonFlow")) { + wrapper.leftJoin(CommonEntity.class, CommonEntity::getFlowId, TemplateJsonEntity::getId) + .eq(CommonEntity::getCreatorUserId, userId).isNotNull(CommonEntity::getFlowId); + } else { + wrapper.in(TemplateEntity::getCategory, category.split(",")); + } + } + wrapper.orderByAsc(TemplateEntity::getSortCode).orderByDesc(TemplateEntity::getCreatorTime); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage userPage = this.selectJoinListPage(page, TemplatePageVo.class, wrapper); + + List records = userPage.getRecords(); + // 设置常用流程标识 + List commonList = commonService.getCommonByUserId(userId); + if (CollectionUtil.isNotEmpty(commonList)) { + List flowIds = commonList.stream().map(CommonEntity::getFlowId).distinct().collect(Collectors.toList()); + for (TemplatePageVo record : records) { + if (flowIds.contains(record.getId())) { + record.setIsCommonFlow(true); + } + } + } + return pagination.setData(records, page.getTotal()); + } + + @Override + public List getTreeCommon() { + String userId = UserProvider.getLoginUserId(); + List vos = new ArrayList<>(); + List commonList = commonService.getCommonByUserId(userId); + if (CollectionUtil.isEmpty(commonList)) { + return vos; + } + List flowIds = commonList.stream().map(CommonEntity::getFlowId).collect(Collectors.toList()); + List templateList = this.getList(flowIds); + + if (CollectionUtil.isNotEmpty(templateList)) { + TemplateTreeListVo allVo = new TemplateTreeListVo(); + allVo.setId(RandomUtil.uuId()); + allVo.setFullName("全部流程"); + List childrenList = this.getChildren(templateList); + allVo.setChildren(childrenList); + vos.add(allVo); + + Map> map = childrenList.stream().collect(Collectors.groupingBy(TemplateTreeListVo::getCategory)); + List categoryIds = map.keySet().stream().collect(Collectors.toList()); + + List dictionNameList = serviceUtil.getDictionName(categoryIds); + for (DictionaryDataEntity dict : dictionNameList) { + TemplateTreeListVo vo = new TemplateTreeListVo(); + vo.setId(dict.getId()); + vo.setFullName(dict.getFullName()); + vo.setChildren(map.get(dict.getId())); + vos.add(vo); + } + } + return vos; + } + + public List getChildren(List templates) { + List resList = new ArrayList<>(); + for (TemplateEntity template : templates) { + TemplateTreeListVo vo = JsonUtil.getJsonToBean(template, TemplateTreeListVo.class); + resList.add(vo); + } + return resList; + } + + @Override + public List treeList(Integer formType) { + List dictionList = serviceUtil.getDiList(); + + TemplatePagination pagination = new TemplatePagination(); + List list = getListAll(pagination, false); + + List startNodeList; + // formType 1.系统表单 2.在线开发表单 + if (null != formType) { + // 版本主键 + List flowIds = list.stream().map(TemplateEntity::getFlowId).collect(Collectors.toList()); + startNodeList = templateNodeService.getList(flowIds, NodeEnum.start.getType()); + } else { + startNodeList = new ArrayList<>(); + } + List formIds = startNodeList.stream().map(TemplateNodeEntity::getFormId).collect(Collectors.toList()); + List formList = serviceUtil.getFormList(formIds); + + List vos = new ArrayList<>(); + + for (DictionaryDataEntity dict : dictionList) { + TemplateTreeListVo vo = new TemplateTreeListVo(); + vo.setFullName(dict.getFullName()); + vo.setId(dict.getId()); + vo.setDisabled(true); + if (CollectionUtil.isNotEmpty(list)) { + List childList = list.stream() + .filter(e -> dict.getId().equals(e.getCategory())).collect(Collectors.toList()); + + if (null != formType) { + childList = childList.stream().filter(e -> { + // 是流程显示类型 + if (ObjectUtil.equals(e.getShowType(), 1)) { + return false; + } + TemplateNodeEntity node = startNodeList.stream().filter(a -> a.getFlowId().equals(e.getFlowId())).findFirst().orElse(null); + if (null != node) { + VisualdevEntity form = formList.stream().filter(b -> b.getId().equals(node.getFormId())).findFirst().orElse(null); + if (null != form) { + return form.getType().equals(1); + } + } + return false; + }).collect(Collectors.toList()); + } + + if (CollectionUtil.isNotEmpty(childList)) { + childList = childList.stream() + .sorted(Comparator.comparing(TemplateEntity::getSortCode, Comparator.nullsLast(Comparator.naturalOrder())).thenComparing(TemplateEntity::getCreatorTime).reversed()) + .collect(Collectors.toList()); + vo.setNum(childList.size()); + vo.setChildren(JsonUtil.getJsonToList(childList, TemplateTreeListVo.class)); + vos.add(vo); + } + } + } + return vos; + } + + @Override + public List treeListWithPower() { + List vos = new ArrayList<>(); + + MPJLambdaWrapper wrapper = JoinWrappers.lambda(TemplateEntity.class) + .selectAll(TemplateEntity.class) + .eq(TemplateEntity::getVisibleType, 2) + .isNotNull(TemplateEntity::getFlowId); + + List list = this.selectJoinList(TemplateEntity.class, wrapper); + List categoryList = list.stream().map(TemplateEntity::getCategory).collect(Collectors.toList()); + List dictionList = serviceUtil.getDictionName(categoryList); + for (DictionaryDataEntity dict : dictionList) { + TemplateTreeListVo vo = new TemplateTreeListVo(); + vo.setFullName(dict.getFullName()); + vo.setId(dict.getId()); + vo.setDisabled(true); + if (CollectionUtil.isNotEmpty(list)) { + List childList = list.stream() + .filter(e -> dict.getId().equals(e.getCategory())) + .sorted(Comparator.comparing(TemplateEntity::getSortCode, Comparator.nullsLast(Comparator.naturalOrder())).thenComparing(TemplateEntity::getCreatorTime, Comparator.reverseOrder())) + .collect(Collectors.toList()); + + if (CollectionUtil.isNotEmpty(childList)) { + vo.setNum(childList.size()); + vo.setChildren(JsonUtil.getJsonToList(childList, TemplateTreeListVo.class)); + vos.add(vo); + } + } + } + + return vos; + } + + @Override + public List getListAll(TemplatePagination pagination, boolean isPage) { + // 定义变量判断是否需要使用修改时间倒序 + boolean flag = false; + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TemplateEntity::getEnabledMark, 1).eq(TemplateEntity::getStatus, 1); + if (ObjectUtil.isNotEmpty(pagination.getType())) { + flag = true; + queryWrapper.lambda().eq(TemplateEntity::getType, pagination.getType()); + } + if (ObjectUtil.isNotEmpty(pagination.getKeyword())) { + flag = true; + queryWrapper.lambda().like(TemplateEntity::getFullName, pagination.getKeyword()); + } + if (ObjectUtil.isNotEmpty(pagination.getCategory())) { + flag = true; + queryWrapper.lambda().eq(TemplateEntity::getCategory, pagination.getCategory()); + } + if (ObjectUtil.isNotEmpty(pagination.getTemplateIdList())) { + queryWrapper.lambda().in(TemplateEntity::getId, pagination.getTemplateIdList()); + } + queryWrapper.lambda().orderByAsc(TemplateEntity::getSortCode).orderByDesc(TemplateEntity::getCreatorTime); + if (flag) { + queryWrapper.lambda().orderByDesc(TemplateEntity::getLastModifyTime); + } + queryWrapper.lambda().select( + TemplateEntity::getId, TemplateEntity::getEnCode, + TemplateEntity::getFullName, + TemplateEntity::getFlowId, + TemplateEntity::getStatus, TemplateEntity::getShowType, + TemplateEntity::getType, TemplateEntity::getIcon, + TemplateEntity::getCategory, TemplateEntity::getIconBackground, + TemplateEntity::getCreatorUserId, TemplateEntity::getSortCode, + TemplateEntity::getEnabledMark, TemplateEntity::getCreatorTime + ); + if (isPage) { + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage userPage = this.page(page, queryWrapper); + return pagination.setData(userPage.getRecords(), page.getTotal()); + } else { + return this.list(queryWrapper); + } + } + + @Override + public List getListByFlowIds(List flowIds) { + List list = new ArrayList<>(); + List jsonEntityList = templateJsonService.listByIds(flowIds); + if (CollectionUtil.isNotEmpty(jsonEntityList)) { + List templateIds = jsonEntityList.stream().map(TemplateJsonEntity::getTemplateId).distinct().collect(Collectors.toList()); + if (CollectionUtil.isNotEmpty(templateIds)) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().in(TemplateEntity::getId, templateIds).eq(TemplateEntity::getStatus, 1); + list = this.list(wrapper); + } + } + return list; + } + + @Override + public TemplateEntity getInfo(String id) throws WorkFlowException { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TemplateEntity::getId, id); + TemplateEntity templateEntity = this.getOne(queryWrapper); + if (templateEntity == null) { + throw new WorkFlowException(MsgCode.WF122.get()); + } + return templateEntity; + } + + @Override + public boolean isExistByFullName(String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TemplateEntity::getFullName, fullName); + if (!StringUtils.isEmpty(id)) { + queryWrapper.lambda().ne(TemplateEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public boolean isExistByEnCode(String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TemplateEntity::getEnCode, enCode); + if (!StringUtils.isEmpty(id)) { + queryWrapper.lambda().ne(TemplateEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public void create(TemplateEntity entity, String flowXml, Map> flowNodes) throws WorkFlowException { + if (isExistByFullName(entity.getFullName(), entity.getId())) { + throw new WorkFlowException(MsgCode.EXIST001.get()); + } + if (isExistByEnCode(entity.getEnCode(), entity.getId())) { + throw new WorkFlowException(MsgCode.EXIST002.get()); + } + UserInfo userInfo = UserProvider.getUser(); + entity.setId(StringUtil.isNotEmpty(entity.getId()) ? entity.getId() : RandomUtil.uuId()); + entity.setCreatorUserId(userInfo.getUserId()); + entity.setCreatorTime(new Date()); + entity.setFlowId(null); + entity.setEnabledMark(0); + entity.setStatus(0); + entity.setLastModifyUserId(null); + entity.setLastModifyTime(null); + this.setIgnoreLogicDelete().removeById(entity.getId()); + this.setIgnoreLogicDelete().saveOrUpdate(entity); + this.clearIgnoreLogicDelete(); + TemplateNodeUpFrom from = new TemplateNodeUpFrom(); + from.setId(entity.getId()); + from.setFlowXml(flowXml); + from.setFlowNodes(flowNodes); + templateJsonService.create(from); + } + + @Override + public boolean update(String id, TemplateEntity entity) throws WorkFlowException { + if (isExistByFullName(entity.getFullName(), id)) { + throw new WorkFlowException(MsgCode.EXIST001.get()); + } + if (isExistByEnCode(entity.getEnCode(), id)) { + throw new WorkFlowException(MsgCode.EXIST002.get()); + } + entity.setId(id); + return this.updateById(entity); + } + + @Override + public void delete(TemplateEntity entity) throws WorkFlowException { + if (entity != null) { + if (ObjectUtil.equals(entity.getType(), 2)) { + List list = templateJsonService.getList(entity.getId()); + List flowIds = list.stream().map(TemplateJsonEntity::getId).collect(Collectors.toList()); + if (triggerTaskService.checkByFlowIds(flowIds)) { + throw new WorkFlowException(MsgCode.WF139.get()); + } + } else { + List taskList = taskUtil.getTaskByTemplate(entity.getId()); + if (CollectionUtil.isNotEmpty(taskList)) { + throw new WorkFlowException(MsgCode.WF124.get()); + } + } + this.removeById(entity.getId()); + List idList = templateJsonService.getList(entity.getId()).stream().map(TemplateJsonEntity::getId).collect(Collectors.toList()); + templateJsonService.delete(idList); + } + } + + @Override + public void copy(TemplateEntity entity) throws WorkFlowException { + try { + TemplateJsonEntity jsonEntity = StringUtil.isNotEmpty(entity.getFlowId()) ? templateJsonService.getInfo(entity.getFlowId()) : null; + String formXml = jsonEntity != null ? jsonEntity.getFlowXml() : null; + List list = jsonEntity != null ? templateNodeService.getList(jsonEntity.getId()) : new ArrayList<>(); + String copyNum = UUID.randomUUID().toString().substring(0, 5); + entity.setFullName(entity.getFullName() + ".副本" + copyNum); + entity.setEnCode(entity.getEnCode() + copyNum); + entity.setId(null); + Map> flowNodes = new HashMap<>(); + for (TemplateNodeEntity nodeEntity : list) { + flowNodes.put(nodeEntity.getNodeCode(), JsonUtil.stringToMap(nodeEntity.getNodeJson())); + } + this.create(entity, formXml, flowNodes); + } catch (Exception e) { + log.error(e.getMessage()); + throw new WorkFlowException(MsgCode.PRI006.get()); + } + } + + @Override + public TemplateExportModel export(String id) throws WorkFlowException { + TemplateEntity entity = getInfo(id); + TemplateExportModel exportModel = new TemplateExportModel(); + exportModel.setTemplate(entity); + // 版本 + TemplateJsonEntity jsonEntity = templateJsonService.getInfo(entity.getFlowId()); + TemplateJsonExportModel versionModel = JsonUtil.getJsonToBean(jsonEntity, TemplateJsonExportModel.class); + // 节点 + List list = templateNodeService.getList(entity.getFlowId()); + exportModel.setNodeList(list); + exportModel.setFlowVersion(versionModel); + return exportModel; + } + + @Override + public void importData(TemplateExportModel model, String type) throws WorkFlowException { + TemplateEntity entity = model.getTemplate(); + TemplateJsonExportModel versionModel = model.getFlowVersion(); + if (null != entity) { + entity.setFlowId(null); + entity.setVersion(null); + entity.setCreatorUserId(UserProvider.getLoginUserId()); + entity.setCreatorTime(new Date()); + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + entity.setEnabledMark(0); + + List errList = new ArrayList<>(); + // type: 0.当导入数据不存在,作为新数据导入;数据已存在,不做处理 1.当导入数据已存在,增加相同记录新数据,名称和编码自动增加随机码 + TemplateEntity templateEntity = checkImportEntity(entity, type, errList); + + if (!errList.isEmpty()) { + StringJoiner joiner = new StringJoiner(";"); + joiner.add(String.join("、", errList) + "重复"); + if (StringUtil.isNotEmpty(joiner.toString())) { + throw new WorkFlowException(joiner.toString()); + } + } + Map> flowNodes = new HashMap<>(); + for (TemplateNodeEntity nodeEntity : model.getNodeList()) { + flowNodes.put(nodeEntity.getNodeCode(), JsonUtil.stringToMap(nodeEntity.getNodeJson())); + } + this.create(templateEntity, versionModel.getFlowXml(), flowNodes); + } + } + + @Override + public List getList(List ids) { + if (ids.isEmpty()) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(TemplateEntity::getId, ids).eq(TemplateEntity::getStatus, 1); + return this.list(queryWrapper); + } + + @Override + public List getListOfHidden(List ids) { + if (ids.isEmpty()) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(TemplateEntity::getId, ids).in(TemplateEntity::getStatus, 1, 2); + return this.list(queryWrapper); + } + + // 校验导入的实体 + public TemplateEntity checkImportEntity(TemplateEntity templateEntity, String type, List errList) { + TemplateEntity entity = JsonUtil.getJsonToBean(templateEntity, TemplateEntity.class); + boolean skip = Objects.equals("0", type); + int num = 0; + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TemplateEntity::getId, entity.getId()); + if (this.count(queryWrapper) > 0) { + num++; + if (skip) { + errList.add("ID"); + } + } + queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TemplateEntity::getEnCode, entity.getEnCode()); + if (this.count(queryWrapper) > 0) { + num++; + if (skip) { + errList.add("编码"); + } + } + queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TemplateEntity::getFullName, entity.getFullName()); + if (this.count(queryWrapper) > 0) { + num++; + if (skip) { + errList.add("名称"); + } + } + if (num > 0 && !skip) { + String copyNum = UUID.randomUUID().toString().substring(0, 5); + entity.setFullName(entity.getFullName() + ".副本" + copyNum); + entity.setEnCode(entity.getEnCode() + copyNum); + } + entity.setId(RandomUtil.uuId()); + return entity; + } + + @Override + public FlowByFormModel getFlowByFormId(String formId, Boolean start) { + FlowByFormModel res = new FlowByFormModel(); + List resList = new ArrayList<>(); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(TemplateNodeEntity::getFormId, formId); + // start 传true 仅发起节点 false 全部节点 + start = null == start || start; + if (start) { + wrapper.lambda().eq(TemplateNodeEntity::getNodeType, NodeEnum.start.getType()); + } + List nodeList = templateNodeService.list(wrapper); + if (CollectionUtil.isEmpty(nodeList)) { + return res; + } + List flowIds = nodeList.stream().map(TemplateNodeEntity::getFlowId).distinct().collect(Collectors.toList()); + if (CollectionUtil.isEmpty(flowIds)) { + return res; + } + List versionList = templateJsonService.listByIds(flowIds); + if (CollectionUtil.isEmpty(versionList)) { + return res; + } + // 获取启用版本 + versionList = versionList.stream().filter(e -> e.getState().equals(1)) + .sorted(Comparator.comparing(TemplateJsonEntity::getCreatorTime).reversed()).collect(Collectors.toList()); + // 获取流程 + List templateIds = versionList.stream().map(TemplateJsonEntity::getTemplateId).distinct().collect(Collectors.toList()); + List templateList = CollectionUtil.isNotEmpty(templateIds) ? this.listByIds(templateIds) : new ArrayList<>(); + // 获取权限流程 + String loginUserId = UserProvider.getLoginUserId(); + List templatePermissionIds = serviceUtil.getLaunchPermission(loginUserId); + //是否普通用户 + boolean commonUser = serviceUtil.isCommonUser(loginUserId); + for (TemplateJsonEntity jsonEntity : versionList) { + TemplateByFormModel model = new TemplateByFormModel(); + model.setId(jsonEntity.getId()); + + TemplateEntity template = templateList.stream() + .filter(e -> ObjectUtil.equals(e.getId(), jsonEntity.getTemplateId())).findFirst().orElse(null); + if (null == template || !ObjectUtil.equals(template.getStatus(), 1)) { + continue; + } + if (commonUser && ObjectUtil.equals(template.getVisibleType(), 2)) { + // 带权限 + if (templatePermissionIds.contains(jsonEntity.getId())) { + model.setFullName(template.getFullName()); + resList.add(model); + } + } else { + model.setFullName(template.getFullName()); + resList.add(model); + } + } + res.setList(resList); + res.setIsConfig(true); + return res; + } + + @Override + public List getSubFlowUserList(String flowId, TemplatePagination pagination) throws WorkFlowException { + TemplateEntity template = this.getInfo(flowId); + return serviceUtil.getLaunchUserByTemplateId(template, pagination); + } + + @Override + public VisualdevEntity getFormByTemplateId(String templateId) throws WorkFlowException { + TemplateEntity template = this.getInfo(templateId); + List nodeEntityList = templateNodeService.getList(template.getFlowId()); + + TemplateNodeEntity nodeEntity = nodeEntityList.stream() + .filter(e -> ObjectUtil.equals(e.getNodeType(), NodeEnum.start.getType())).findFirst().orElse(null); + if (null == nodeEntity) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + return serviceUtil.getFormInfo(nodeEntity.getFormId()); + } + + @Override + public FlowFormModel getFormIdAndFlowId(String templateId) throws WorkFlowException { + List userId = ImmutableList.of(UserProvider.getLoginUserId()); + FlowFormModel model = getFormIdAndFlowId(userId, templateId); + if (model.getUserId().isEmpty()) { + throw new WorkFlowException(MsgCode.WF029.get()); + } + return model; + } + + @Override + public FlowFormModel getFormIdAndFlowId(List userIdAll, String templateId) throws WorkFlowException { + List userList = new ArrayList<>(); + TemplateEntity template = this.getInfo(templateId); + List nodeEntityList = templateNodeService.getList(template.getFlowId()); + // 判断权限 + for (String userId : userIdAll) { + userList.add(userId); + if (ObjectUtil.equals(template.getVisibleType(), 2)) { + boolean commonUser = serviceUtil.isCommonUser(userId); + if (commonUser) { + List flowIds = serviceUtil.getLaunchPermission(userId); + if (!flowIds.contains(template.getId())) { + userList.remove(userId); + } + } + } + } + TemplateNodeEntity nodeEntity = nodeEntityList.stream() + .filter(e -> ObjectUtil.equals(e.getNodeType(), NodeEnum.start.getType())).findFirst().orElse(null); + if (null == nodeEntity) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + FlowFormModel model = new FlowFormModel(); + model.setFormId(nodeEntity.getFormId()); + model.setFlowId(template.getFlowId()); + model.setUserId(userList); + return model; + } + + @Override + public List getFormList() { + List resList = new ArrayList<>(); + List list = templateJsonService.getListOfEnable(); + if (CollectionUtil.isNotEmpty(list)) { + List flowIds = list.stream().map(TemplateJsonEntity::getId).distinct().collect(Collectors.toList()); + List startNodeList = templateNodeService.getList(flowIds, NodeEnum.start.getType()); + resList = startNodeList.stream().map(TemplateNodeEntity::getFormId).distinct().collect(Collectors.toList()); + } + return resList; + } + + @Override + public Map getFlowFormMap() { + Map map = new HashMap<>(); + List listStart = templateNodeService.getListStart(); + List collect = listStart.stream().map(TemplateNodeEntity::getFlowId).collect(Collectors.toList()); + if (ObjectUtil.isNotEmpty(collect)) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(TemplateEntity::getId, TemplateEntity::getFlowId); + queryWrapper.lambda().in(TemplateEntity::getFlowId, collect); + Map flowTempMap = this.list(queryWrapper).stream().collect(Collectors.toMap(TemplateEntity::getFlowId, TemplateEntity::getId)); + for (TemplateNodeEntity templateNodeEntity : listStart) { + if (ObjectUtil.isNotEmpty(flowTempMap.get(templateNodeEntity.getFlowId()))) { + map.put(flowTempMap.get(templateNodeEntity.getFlowId()), templateNodeEntity.getFormId()); + } + } + } + return map; + } +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/TriggerRecordServiceImpl.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/TriggerRecordServiceImpl.java new file mode 100644 index 0000000..251905a --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/TriggerRecordServiceImpl.java @@ -0,0 +1,125 @@ +package com.yunzhupaas.flowable.service.impl; + +import cn.hutool.core.collection.CollectionUtil; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.dynamic.datasource.tx.DsPropagation; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.flowable.entity.TriggerRecordEntity; +import com.yunzhupaas.flowable.entity.TriggerTaskEntity; +import com.yunzhupaas.flowable.enums.TriggerRecordEnum; +import com.yunzhupaas.flowable.mapper.TriggerRecordMapper; +import com.yunzhupaas.flowable.model.flowable.FlowableTaskModel; +import com.yunzhupaas.flowable.model.templatenode.nodejson.NodeModel; +import com.yunzhupaas.flowable.model.util.FlowNature; +import com.yunzhupaas.flowable.service.TriggerRecordService; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/10 17:18 + */ +@Service +public class TriggerRecordServiceImpl extends SuperServiceImpl + implements TriggerRecordService { + + @Override + public List getList(String triggerTaskId) { + if (StringUtil.isBlank(triggerTaskId)) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TriggerRecordEntity::getTriggerId, triggerTaskId) + .orderByAsc(TriggerRecordEntity::getStartTime); + return this.list(queryWrapper); + } + + @Override + public List getListByTaskId(String taskId) { + if (StringUtil.isBlank(taskId)) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TriggerRecordEntity::getTaskId, taskId).orderByDesc(TriggerRecordEntity::getStartTime); + return this.list(queryWrapper); + } + + @Override + // @DSTransactional(propagation = DsPropagation.NOT_SUPPORTED) + public void create(TriggerRecordEntity entity) { + if (StringUtil.isEmpty(entity.getId())) { + entity.setId(RandomUtil.uuId()); + } + entity.setCreatorTime(new Date()); + this.save(entity); + } + + @Override + // @DSTransactional(propagation = DsPropagation.NOT_SUPPORTED) + public void create(TriggerTaskEntity triggerTask, NodeModel nodeModel, FlowableTaskModel taskModel) { + TriggerRecordEntity entity = new TriggerRecordEntity(); + entity.setId(RandomUtil.uuId()); + entity.setStatus(TriggerRecordEnum.PASSED.getCode()); + Date date = new Date(); + entity.setStartTime(date); + entity.setEndTime(date); + + entity.setNodeCode(nodeModel.getNodeId()); + entity.setNodeName(nodeModel.getNodeName()); + entity.setNodeId(taskModel.getTaskId()); + + entity.setTriggerId(triggerTask.getId()); + if (StringUtil.isNotEmpty(triggerTask.getTaskId())) { + entity.setTaskId(triggerTask.getTaskId()); + } + + this.save(entity); + } + + @Override + // @DSTransactional(propagation = DsPropagation.NOT_SUPPORTED) + public void createStart(String triggerId) { + TriggerRecordEntity entity = new TriggerRecordEntity(); + entity.setId(RandomUtil.uuId()); + entity.setStatus(TriggerRecordEnum.PASSED.getCode()); + Date date = new Date(); + entity.setStartTime(date); + entity.setEndTime(date); + entity.setTriggerId(triggerId); + entity.setNodeCode(FlowNature.START_CODE); + entity.setNodeName(FlowNature.START_NAME); + this.save(entity); + } + + @Override + public void createEnd(String triggerId) { + TriggerRecordEntity entity = new TriggerRecordEntity(); + entity.setId(RandomUtil.uuId()); + entity.setStatus(TriggerRecordEnum.PASSED.getCode()); + Date date = new Date(); + entity.setStartTime(date); + entity.setEndTime(date); + entity.setTriggerId(triggerId); + entity.setNodeCode(FlowNature.END_CODE); + entity.setNodeName(FlowNature.END_NAME); + this.save(entity); + } + + @Override + public void delete(List triggerTaskIds) { + if (CollectionUtil.isNotEmpty(triggerTaskIds)) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(TriggerRecordEntity::getTriggerId, triggerTaskIds); + this.remove(queryWrapper); + } + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/TriggerTaskServiceImpl.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/TriggerTaskServiceImpl.java new file mode 100644 index 0000000..7b1958b --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/service/impl/TriggerTaskServiceImpl.java @@ -0,0 +1,247 @@ +package com.yunzhupaas.flowable.service.impl; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.google.common.collect.ImmutableList; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.*; +import com.yunzhupaas.flowable.enums.DivideRuleEnum; +import com.yunzhupaas.flowable.enums.NodeEnum; +import com.yunzhupaas.flowable.enums.TaskStatusEnum; +import com.yunzhupaas.flowable.mapper.TriggerTaskMapper; +import com.yunzhupaas.flowable.model.templatejson.TemplateJsonInfoVO; +import com.yunzhupaas.flowable.model.templatenode.ButtonModel; +import com.yunzhupaas.flowable.model.templatenode.TaskNodeModel; +import com.yunzhupaas.flowable.model.templatenode.nodejson.NodeModel; +import com.yunzhupaas.flowable.model.trigger.*; +import com.yunzhupaas.flowable.model.util.FlowNature; +import com.yunzhupaas.flowable.service.*; +import com.yunzhupaas.flowable.util.TriggerUtil; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/10 17:13 + */ +@Service +public class TriggerTaskServiceImpl extends SuperServiceImpl + implements TriggerTaskService { + @Autowired + private TriggerRecordService triggerRecordService; + @Autowired + private TemplateService templateService; + @Autowired + private TemplateJsonService templateJsonService; + @Autowired + private TemplateNodeService templateNodeService; + @Autowired + private TriggerUtil triggerUtil; + + @Override + public List getListByTaskId(String taskId, String nodeCode) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotBlank(taskId)) { + queryWrapper.lambda().eq(TriggerTaskEntity::getTaskId, taskId); + } + if (StringUtil.isNotBlank(nodeCode)) { + queryWrapper.lambda().eq(TriggerTaskEntity::getNodeId, nodeCode); + } + queryWrapper.lambda().orderByDesc(TriggerTaskEntity::getStartTime); + List list = this.list(queryWrapper); + List modelList = new ArrayList<>(); + if (CollectionUtil.isNotEmpty(list)) { + for (TriggerTaskEntity triggerTask : list) { + TriggerInfoListModel model = JsonUtil.getJsonToBean(triggerTask, TriggerInfoListModel.class); + List recordList = triggerRecordService.getList(triggerTask.getId()); + model.setRecordList(recordList); + modelList.add(model); + } + } + return modelList; + } + + @Override + public boolean existTriggerTask(String taskId, String nodeId) { + if (StringUtil.isBlank(taskId) || StringUtil.isBlank(nodeId)) { + return false; + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TriggerTaskEntity::getTaskId, taskId) + .eq(TriggerTaskEntity::getNodeId, nodeId); + return this.count(queryWrapper) > 0; + } + + @Override + public List getList(TriggerPagination pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + queryWrapper.lambda().and(e -> e.like(TriggerTaskEntity::getFullName, pagination.getKeyword()) + .or().like(TriggerTaskEntity::getId, pagination.getKeyword())); + } + if (ObjectUtil.isNotEmpty(pagination.getStartTime()) && ObjectUtil.isNotEmpty(pagination.getEndTime())) { + queryWrapper.lambda().between(TriggerTaskEntity::getStartTime, new Date(pagination.getStartTime()), + new Date(pagination.getEndTime())); + } + queryWrapper.lambda().isNull(TriggerTaskEntity::getTaskId).orderByDesc(TriggerTaskEntity::getCreatorTime); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + Page iPage = this.page(page, queryWrapper); + return pagination.setData(iPage.getRecords(), page.getTotal()); + } + + @Override + public TriggerInfoModel getInfo(String id) throws WorkFlowException { + TriggerTaskEntity triggerTask = this.getById(id); + if (null == triggerTask) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + TriggerInfoModel model = new TriggerInfoModel(); + model.setTaskInfo(JsonUtil.getJsonToBean(triggerTask, TriggerTaskModel.class)); + TemplateJsonInfoVO jsonInfoVO = templateJsonService.getInfoVo(triggerTask.getFlowId()); + model.setFlowInfo(jsonInfoVO); + List recordList = triggerRecordService.getList(triggerTask.getId()); + List nodeList = this.getNodeList(triggerTask, recordList); + model.setNodeList(nodeList); + recordList = recordList.stream().filter(e -> e.getStatus() != null).collect(Collectors.toList()); + model.setRecordList(recordList); + ButtonModel btnInfo = model.getBtnInfo(); + if (ObjectUtil.equals(triggerTask.getStatus(), TaskStatusEnum.RUNNING.getCode())) { + btnInfo.setHasCancelBtn(true); + } + return model; + } + + public List getNodeList(TriggerTaskEntity triggerTask, List recordList) { + List list = new ArrayList<>(); + if (ObjectUtil.equals(triggerTask.getStatus(), TaskStatusEnum.CANCEL.getCode())) { + return list; + } + String flowId = triggerTask.getFlowId(); + List nodeEntityList = templateNodeService.getList(flowId); + List typeList = ImmutableList.of(NodeEnum.global.getType(), NodeEnum.connect.getType(), "confluence", + "gateway"); + List divideList = Arrays.stream(DivideRuleEnum.values()).map(DivideRuleEnum::getType) + .collect(Collectors.toList()); + divideList.addAll(typeList); + for (TemplateNodeEntity node : nodeEntityList) { + if (divideList.contains(node.getNodeType())) { + continue; + } + TaskNodeModel model = new TaskNodeModel(); + NodeModel nodeModel = JsonUtil.getJsonToBean(node.getNodeJson(), NodeModel.class); + model.setNodeName(nodeModel.getNodeName()); + model.setNodeCode(nodeModel.getNodeId()); + model.setNodeType(nodeModel.getType()); + + String type = null; + String nodeCode = node.getNodeCode(); + if (ObjectUtil.equals(node.getNodeType(), NodeEnum.start.getType())) { + nodeCode = FlowNature.START_CODE; + } else if (ObjectUtil.equals(node.getNodeType(), NodeEnum.end.getType())) { + nodeCode = FlowNature.END_CODE; + } + String finalNodeCode = nodeCode; + TriggerRecordEntity record = recordList.stream() + .filter(e -> ObjectUtil.equals(e.getNodeCode(), finalNodeCode)).findFirst().orElse(null); + if (null != record) { + if (ObjectUtil.equals(record.getStatus(), 1)) { + type = "3"; + } else if (ObjectUtil.equals(record.getStatus(), 0)) { + type = "0"; + } else { + type = "1"; + } + } + model.setType(type); + list.add(model); + } + return list; + } + + @Override + // @DSTransactional + public void retry(String id) throws Exception { + TriggerTaskEntity triggerTask = this.getById(id); + if (null == triggerTask) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + TemplateJsonEntity jsonEntity = templateJsonService.getInfo(triggerTask.getFlowId()); + TemplateEntity template = templateService.getInfo(jsonEntity.getTemplateId()); + if (!ObjectUtil.equals(template.getStatus(), 1)) { + throw new WorkFlowException(MsgCode.WF146.get()); + } + ExecuteModel model = new ExecuteModel(); + model.setFlowId(triggerTask.getFlowId()); + List jsonToList = JsonUtil.getJsonToList(triggerTask.getData(), Map.class); + List> dataList = triggerUtil.castListMap(jsonToList); + model.setDataList(dataList); + UserInfo userInfo = UserProvider.getUser(); + model.setUserInfo(userInfo); + model.setParentId(triggerTask.getId()); + triggerUtil.execute(model); + } + + @Override + public void saveTriggerTask(TriggerTaskEntity entity) { + this.save(entity); + } + + @Override + public void updateTriggerTask(TriggerTaskEntity entity) { + this.updateById(entity); + } + + @Override + public void batchDelete(List ids) { + if (ids.isEmpty()) { + return; + } + this.removeByIds(ids); + triggerRecordService.delete(ids); + } + + @Override + public void deleteByTaskId(List taskId) { + if (CollectionUtil.isEmpty(taskId)) { + return; + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(TriggerTaskEntity::getTaskId, taskId); + List list = this.list(queryWrapper); + if (CollectionUtil.isEmpty(list)) { + return; + } + List ids = list.stream().map(TriggerTaskEntity::getId).collect(Collectors.toList()); + this.setIgnoreLogicDelete().removeByIds(ids); + this.clearIgnoreLogicDelete(); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().in(TriggerRecordEntity::getTriggerId, ids); + triggerRecordService.setIgnoreLogicDelete().remove(wrapper); + triggerRecordService.clearIgnoreLogicDelete(); + } + + @Override + public boolean checkByFlowIds(List flowIds) { + if (CollectionUtil.isNotEmpty(flowIds)) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(TriggerTaskEntity::getFlowId, flowIds); + return this.count(queryWrapper) > 0; + } + return false; + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/ButtonUtil.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/ButtonUtil.java new file mode 100644 index 0000000..e2c30a7 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/ButtonUtil.java @@ -0,0 +1,735 @@ +package com.yunzhupaas.flowable.util; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.google.common.collect.ImmutableList; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.model.systemconfig.SysConfigModel; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.*; +import com.yunzhupaas.flowable.enums.NodeEnum; +import com.yunzhupaas.flowable.enums.OperatorStateEnum; +import com.yunzhupaas.flowable.enums.RecordEnum; +import com.yunzhupaas.flowable.enums.TaskStatusEnum; +import com.yunzhupaas.flowable.model.flowable.FlowAbleUrl; +import com.yunzhupaas.flowable.model.flowable.FlowableNodeModel; +import com.yunzhupaas.flowable.model.flowable.NextOrPrevFo; +import com.yunzhupaas.flowable.model.operator.AddSignModel; +import com.yunzhupaas.flowable.model.task.FlowMethod; +import com.yunzhupaas.flowable.model.task.FlowModel; +import com.yunzhupaas.flowable.model.templatenode.ButtonModel; +import com.yunzhupaas.flowable.model.templatenode.TaskNodeModel; +import com.yunzhupaas.flowable.model.templatenode.nodejson.FileConfig; +import com.yunzhupaas.flowable.model.templatenode.nodejson.NodeModel; +import com.yunzhupaas.flowable.model.templatenode.nodejson.PrintConfig; +import com.yunzhupaas.flowable.model.templatenode.nodejson.ProperCond; +import com.yunzhupaas.flowable.model.util.FlowNature; +import com.yunzhupaas.flowable.service.*; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/16 17:35 + */ +@Component +public class ButtonUtil { + @Autowired + private OperatorService operatorService; + @Autowired + private FlowAbleUrl flowAbleUrl; + @Autowired + private ServiceUtil serviceUtil; + @Autowired + private OperatorUtil operatorUtil; + @Autowired + private TaskService taskService; + @Autowired + private RevokeService revokeService; + @Autowired + private DelegateService delegateService; + @Autowired + private TriggerRecordService triggerRecordService; + @Autowired + private RecordService recordService; + + /** + * 按钮控制 + * + * @param flowModel 参数 + */ + public ButtonModel handleButton(FlowModel flowModel) throws WorkFlowException { + String opType = flowModel.getOpType(); + TaskEntity taskEntity = flowModel.getTaskEntity(); + OperatorEntity operatorEntity = flowModel.getOperatorEntity(); + RecordEntity recordEntity = flowModel.getRecordEntity(); + Map formData = flowModel.getFormData(); + List nodeList = flowModel.getNodeList(); + TemplateEntity template = flowModel.getTemplateEntity(); + UserInfo userInfo = flowModel.getUserInfo() == null ? UserProvider.getUser() : flowModel.getUserInfo(); + String userId = userInfo.getUserId(); + + List nodeEntityList = flowModel.getNodeEntityList(); + Map nodes = new HashMap<>(); + for (TemplateNodeEntity nodeEntity : nodeEntityList) { + nodes.put(nodeEntity.getNodeCode(), JsonUtil.getJsonToBean(nodeEntity.getNodeJson(), NodeModel.class)); + } + flowModel.setNodes(nodes); + RevokeEntity revokeEntity = revokeService.getRevokeTask(taskEntity.getId()); + + // 全局节点 + NodeModel global = nodes.get(NodeEnum.global.getType()); + + ButtonModel model = new ButtonModel(); + FlowMethod flowMethod = new FlowMethod(); + flowMethod.setNodes(nodes); + flowMethod.setTaskEntity(taskEntity); + flowMethod.setFormData(formData); + flowMethod.setPrintNodeList(nodeList); + switch (opType) { + case "-1": // 我发起的新建/编辑 + // List templateStatus = ImmutableList.of(1, 2); + // if (!templateStatus.contains(template.getStatus())) { + // break; + // } + // 是否是退回撤回的任务 + List taskStatus = ImmutableList.of(TaskStatusEnum.BACKED.getCode(), + TaskStatusEnum.RECALL.getCode()); + boolean isBack = null != taskEntity && taskStatus.contains(taskEntity.getStatus()); + if (isBack) { + // 是否是委托的任务 + boolean isDelegate = StringUtil.isNotBlank(taskEntity.getDelegateUserId()); + if (isDelegate) { + if (ObjectUtil.equals(taskEntity.getParentId(), "0")) { + model.setHasDelegateSubmitBtn(this.checkDelegateSubmit(userId, template)); + } + } else { + model.setHasSubmitBtn(true); + } + model.setHasSaveBtn(true); + } else { + boolean commonUser = serviceUtil.isCommonUser(userId); + if (commonUser && ObjectUtil.equals(template.getVisibleType(), 2)) { + List permission = serviceUtil.getLaunchPermission(userId); + if (permission.contains(template.getId())) { + model.setHasSubmitBtn(true); + model.setHasSaveBtn(true); + } + } else { + model.setHasSubmitBtn(true); + model.setHasSaveBtn(true); + } + // 委托发起 + if (null == taskEntity.getId()) { + model.setHasDelegateSubmitBtn(this.checkDelegateSubmit(userId, template)); + } else { + if (ObjectUtil.equals(taskEntity.getParentId(), "0")) { + model.setHasDelegateSubmitBtn(this.checkDelegateSubmit(userId, template)); + } + } + } + break; + case "0": // 我发起的详情 + // 打印 + TemplateNodeEntity start = nodeEntityList.stream() + .filter(e -> e.getNodeType().equals(NodeEnum.start.getType())).findFirst().orElse(null); + if (null != start) { + NodeModel startNode = JsonUtil.getJsonToBean(start.getNodeJson(), NodeModel.class); + flowMethod.setNodeModel(startNode); + model.setHasPrintBtn(this.checkPrint(flowMethod)); + } + // 催办 + List statusList = ImmutableList.of(TaskStatusEnum.RUNNING.getCode(), + TaskStatusEnum.REVOKING.getCode()); + if (global.getHasInitiatorPressOverdueNode() && statusList.contains(taskEntity.getStatus())) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OperatorEntity::getTaskId, taskEntity.getId()) + .eq(OperatorEntity::getCompletion, 0) + .ne(OperatorEntity::getStatus, OperatorStateEnum.Futility.getCode()) + .isNull(OperatorEntity::getHandleStatus).isNotNull(OperatorEntity::getDuedate); + List operatorList = operatorService.list(queryWrapper); + if (!operatorList.isEmpty()) { + model.setHasPressBtn(true); + } + } + // 撤回 + if (null == revokeEntity) { + flowModel.setFlag(1); + if (this.checkRecall(flowModel)) { + model.setHasRecallLaunchBtn(true); + } + } + // 撤销,全局属性开启 且 同意状态的任务才能撤销 且不是子流程 + if (global.getHasRevoke() && Objects.equals(taskEntity.getStatus(), TaskStatusEnum.PASSED.getCode()) + && Objects.equals(taskEntity.getParentId(), "0")) { + Boolean isExist = revokeService.checkExist(taskEntity.getId()); + if (null == revokeEntity && isExist) { + model.setHasRevokeBtn(true); + } + } + break; + case "1": // 待签事宜 + if (Objects.equals(taskEntity.getStatus(), TaskStatusEnum.PAUSED.getCode())) { + break; + } + model.setHasSignBtn(true); + if (null != operatorEntity) { + model.setProxyMark(!ObjectUtil.equals(operatorEntity.getHandleId(), userId)); + NodeModel nodeModel = nodes.get(operatorEntity.getNodeCode()); + if (this.checkViewStartForm(global, nodeModel)) { + model.setHasViewStartFormBtn(true); + } + } + break; + case "2": // 待办事宜 + if (Objects.equals(taskEntity.getStatus(), TaskStatusEnum.PAUSED.getCode())) { + break; + } + if (global.getHasSignFor()) { + model.setHasReduceSignBtn(true); + } + model.setHasTransactBtn(true); + if (null != operatorEntity) { + NodeModel nodeModel = nodes.get(operatorEntity.getNodeCode()); + if (this.checkViewStartForm(global, nodeModel)) { + model.setHasViewStartFormBtn(true); + } + } + break; + case "3": // 在办事宜 + if (Objects.equals(taskEntity.getStatus(), TaskStatusEnum.PAUSED.getCode())) { + break; + } + if (null == operatorEntity) { + break; + } + // 待办的opType传的也是3,所以待办的代理标识需要再在办判断 + model.setProxyMark(!ObjectUtil.equals(operatorEntity.getHandleId(), userId)); + if (null != revokeEntity) { + model.setHasAuditBtn(true); + model.setHasRejectBtn(true); + break; + } + NodeModel nodeModel = nodes.get(operatorEntity.getNodeCode()); + if (null == nodeModel) { + break; + } + if (this.checkViewStartForm(global, nodeModel)) { + model.setHasViewStartFormBtn(true); + } + // 协办状态的经办 只有协办保存按钮 + if (OperatorStateEnum.Assist.getCode().equals(operatorEntity.getStatus())) { + model.setHasAssistSaveBtn(true); + break; + } + // 打印 + flowMethod.setNodeModel(nodeModel); + model.setHasPrintBtn(this.checkPrint(flowMethod)); + if (nodeModel.getHasAuditBtn()) { + model.setHasAuditBtn(true); + } + if (nodeModel.getHasRejectBtn() && ObjectUtil.equals(operatorEntity.getIsProcessing(), 0)) { + model.setHasRejectBtn(true); + } + if (nodeModel.getHasBackBtn() && taskEntity.getRejectDataId() == null) { + model.setHasBackBtn(true); + } + if (nodeModel.getHasSaveAuditBtn()) { + model.setHasSaveAuditBtn(true); + } + List operatorState = ImmutableList.of(OperatorStateEnum.AddSign.getCode(), + OperatorStateEnum.Transfer.getCode()); + if (nodeModel.getHasFreeApproverBtn()) { + if (!ObjectUtil.equals(operatorEntity.getStatus(), OperatorStateEnum.Transfer.getCode())) { + model.setHasFreeApproverBtn(this.checkAddSign(operatorEntity, null, false)); + } + } + if (nodeModel.getHasTransferBtn()) { + if (!operatorState.contains(operatorEntity.getStatus()) + && ObjectUtil.equals(operatorEntity.getParentId(), "0")) { + model.setHasTransferBtn(true); + } + } + if (nodeModel.getHasAssistBtn()) { + model.setHasAssistBtn(true); + } + break; + case "4": // 已办事宜 + if (null == operatorEntity || operatorEntity.getId() == null) { + break; + } + // 减签 + NodeModel node = nodes.get(operatorEntity.getNodeCode()); + // 节点属性开启、经办存在加签信息、记录是加签操作 + if (node != null) { + if (null != recordEntity) { + if (node.getHasReduceApproverBtn() && null != operatorEntity.getHandleParameter() + && recordEntity.getHandleType().equals(RecordEnum.addSign.getCode())) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OperatorEntity::getTaskId, operatorEntity.getTaskId()) + .eq(OperatorEntity::getParentId, operatorEntity.getId()) + .ne(OperatorEntity::getStatus, OperatorStateEnum.Futility.getCode()) + .ne(OperatorEntity::getStatus, OperatorStateEnum.Assist.getCode()) + .eq(OperatorEntity::getCompletion, 0).isNull(OperatorEntity::getHandleStatus); + List list = operatorService.list(queryWrapper); + if (CollectionUtil.isNotEmpty(list)) { + model.setHasReduceApproverBtn(true); + } + } + // 审批撤回 + List handleTypes = ImmutableList.of(RecordEnum.audit.getCode(), + RecordEnum.reject.getCode()); + if (handleTypes.contains(recordEntity.getHandleType())) { + flowModel.setFlag(2); + if (this.checkRecall(flowModel)) { + model.setHasRecallAuditBtn(true); + } + } + } + flowMethod.setNodeModel(node); + // 打印 + model.setHasPrintBtn(this.checkPrint(flowMethod)); + if (this.checkViewStartForm(global, node)) { + model.setHasViewStartFormBtn(true); + } + } + break; + case "5": // 抄送事宜 + if (null != operatorEntity) { + NodeModel node1 = nodes.get(operatorEntity.getNodeCode()); + if (this.checkViewStartForm(global, node1)) { + model.setHasViewStartFormBtn(true); + } + } + break; + case "6": // 流程监控 + if (!userInfo.getIsAdministrator()) { + List organizeUserList = serviceUtil.getOrganizeUserList("edit"); + if (!organizeUserList.contains(taskEntity.getCreatorUserId())) { + break; + } + } + // 终止状态下只有复活 + if (ObjectUtil.equals(taskEntity.getStatus(), TaskStatusEnum.CANCEL.getCode()) + && ObjectUtil.equals(taskEntity.getParentId(), "0") + && ObjectUtil.equals(template.getStatus(), 1)) { + List triggerRecordList = triggerRecordService + .getListByTaskId(taskEntity.getId()); + long count = triggerRecordList.stream().filter(e -> ObjectUtil.equals(e.getStatus(), 1)).count(); + if (count == 0) { + model.setHasActivateBtn(true); + } + } + // 挂起状态下只有恢复 + if (ObjectUtil.equals(taskEntity.getStatus(), TaskStatusEnum.PAUSED.getCode())) { + if (!ObjectUtil.equals(taskEntity.getIsRestore(), 1)) { + model.setHasRebootBtn(true); + } + } + // 运行状态下,终止、挂起 + if (ObjectUtil.equals(taskEntity.getStatus(), TaskStatusEnum.RUNNING.getCode())) { + // 子流程不允许终止 + if (ObjectUtil.equals(taskEntity.getParentId(), "0")) { + model.setHasCancelBtn(true); + } + model.setHasPauseBtn(true); + if (this.checkAssign(taskEntity, nodes)) { + model.setHasAssignBtn(true); + } + } + // 归档按钮 + FileConfig config = global.getFileConfig(); + if (config.getOn() && StringUtil.isNotBlank(config.getTemplateId())) { + if (ObjectUtil.isNotEmpty(taskEntity.getEndTime()) + || ObjectUtil.equals(taskEntity.getStatus(), TaskStatusEnum.CANCEL.getCode())) { + if (serviceUtil.checkFlowFile(taskEntity.getId())) { + model.setHasFileBtn(true); + } + } + } + break; + } + return model; + } + + // 判断指派,当前节点全是子流程,就隐藏 + public boolean checkAssign(TaskEntity taskEntity, Map nodes) { + String currentNodeCode = taskEntity.getCurrentNodeCode(); + if (StringUtil.isNotBlank(currentNodeCode)) { + List currentNodeList = Arrays.stream(currentNodeCode.split(",")).collect(Collectors.toList()); + for (String nodeCode : currentNodeList) { + NodeModel nodeModel = nodes.get(nodeCode); + if (null != nodeModel && !Objects.equals(nodeModel.getType(), NodeEnum.subFlow.getType())) { + return true; + } + } + } + return false; + } + + // 委托发起按钮 + public boolean checkDelegateSubmit(String userId, TemplateEntity template) { + List delegateList = delegateService.getByToUserId(userId, 0); + if (CollectionUtil.isNotEmpty(delegateList) && ObjectUtil.equals(template.getStatus(), 1)) { + for (DelegateEntity delegateEntity : delegateList) { + String flowId = delegateEntity.getFlowId(); + if (StringUtil.isNotBlank(flowId)) { + if (flowId.contains(template.getId())) { + if (ObjectUtil.equals(template.getVisibleType(), 1)) { + return true; + } + List launchPermission = serviceUtil.getLaunchPermission(delegateEntity.getUserId()); + if (launchPermission.contains(template.getId())) { + return true; + } + } + } else { + // 全部流程 + if (ObjectUtil.equals(template.getVisibleType(), 1)) { + return true; + } + List launchPermission = serviceUtil.getLaunchPermission(delegateEntity.getUserId()); + if (launchPermission.contains(template.getId())) { + return true; + } + } + } + } + return false; + } + + /** + * 查看发起表单 + */ + public boolean checkViewStartForm(NodeModel global, NodeModel nodeModel) { + if (null != nodeModel) { + if (global.getHasAloneConfigureForms() && StringUtil.isNotBlank(nodeModel.getFormId())) { + return true; + } + } + return false; + } + + /** + * 判断撤回 + * + * @param flowModel 参数 + */ + public boolean checkRecall(FlowModel flowModel) throws WorkFlowException { + String deploymentId = flowModel.getDeploymentId(); + String currentNodeCode = flowModel.getNodeEntity().getNodeCode(); + TaskEntity taskEntity = flowModel.getTaskEntity(); + RecordEntity recordEntity = flowModel.getRecordEntity(); + Map nodes = flowModel.getNodes(); + // 判断撤回的标识 1.发起撤回 2.审批撤回 + int flag = flowModel.getFlag(); + boolean isException = flowModel.getIsException(); + + NodeModel global = nodes.get(NodeEnum.global.getType()); + Integer recallRule = global.getRecallRule(); + + // 全局撤回配置为1 直接不允许撤回 (流程撤回规则 1: 不允许撤回 2: 发起节点允许撤回 3:所有节点允许撤回) + if (recallRule == null || recallRule == 1) { + return false; + } + + // 不是进行中的任务、存在退回冻结数据 + if (!Objects.equals(TaskStatusEnum.RUNNING.getCode(), taskEntity.getStatus()) + || null != taskEntity.getRejectDataId()) { + if (isException) { + throw new WorkFlowException(MsgCode.WF036.get()); + } + return false; + } + // 经办未审批 说明是已撤回的,不允许撤回 + OperatorEntity operator = operatorService.getInfo(recordEntity.getOperatorId()); + if (null != operator) { + if (!ObjectUtil.equals(operator.getParentId(), "0")) { + if (isException) { + throw new WorkFlowException(MsgCode.WF077.get()); + } + return false; + } + // 判断依次审批 + boolean inTurn = this.checkInTurn(operator, isException); + if (!inTurn && !isException) { + return false; + } + if (operator.getHandleStatus() == null) { + if (isException) { + throw new WorkFlowException(MsgCode.WF006.get()); + } + return false; + } else if (null == operator.getHandleTime()) { + // 后加签的同意未真正审批,不允许撤回 + List childList = operatorUtil.getChildList(operator.getId()); + if (CollectionUtil.isNotEmpty(childList)) { + if (isException) { + throw new WorkFlowException(MsgCode.WF006.get()); + } + return false; + } + } + } else { + // 发起撤回的校验 + QueryWrapper recordWrapper = new QueryWrapper<>(); + recordWrapper.lambda().eq(RecordEntity::getTaskId, taskEntity.getId()) + .and(t -> t.ne(RecordEntity::getStatus, -1).or().eq(RecordEntity::getHandleType, + RecordEnum.back.getCode())); + List recordList = recordService.list(recordWrapper); + if (CollectionUtil.isNotEmpty(recordList)) { + RecordEntity submit = recordList.stream() + .filter(e -> ObjectUtil.equals(e.getHandleType(), RecordEnum.submit.getCode())).findFirst() + .orElse(null); + if (null != submit) { + recordList = recordList.stream() + .filter(e -> !ObjectUtil.equals(e.getNodeCode(), submit.getNodeCode())) + .collect(Collectors.toList()); + } + if (!recordList.isEmpty()) { + if (isException) { + throw new WorkFlowException(MsgCode.WF006.get()); + } + return false; + } + } + } + // 获取节点的下一级节点,判断撤回 + NextOrPrevFo fo = new NextOrPrevFo(); + fo.setDeploymentId(deploymentId); + fo.setTaskKey(currentNodeCode); + List nextModels = flowAbleUrl.getNext(fo); + List nextCodes = nextModels.stream().map(FlowableNodeModel::getId).collect(Collectors.toList()); + // 审批撤回需要用到下一级节点 + flowModel.setNextCodes(nextCodes); + + if (CollectionUtil.isNotEmpty(nextCodes)) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TaskEntity::getParentId, taskEntity.getId()) + .in(TaskEntity::getSubCode, nextCodes); + List list = taskService.list(queryWrapper); + if (CollectionUtil.isNotEmpty(list)) { + // 异步子流程,不允许撤回 + long asyncCount = list.stream().filter(e -> Objects.equals(e.getIsAsync(), FlowNature.ChildAsync)) + .count(); + if (asyncCount > 0) { + return false; + } + long count = list.stream() + .filter(e -> !Objects.equals(e.getStatus(), TaskStatusEnum.TO_BE_SUBMIT.getCode())).count(); + if (count > 0) { + if (isException) { + throw new WorkFlowException(MsgCode.WF036.get()); + } + return false; + } + } + } + + if (flag == 2 && recallRule == 2) { + return false; + } + if (CollectionUtil.isEmpty(nextCodes)) { + return true; + } + // 存在已办理的经办,撤回后可以重新提交(下个审批节点只进行了签收 此时还可以撤回) + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(OperatorEntity::getTaskId, taskEntity.getId()); + if (CollectionUtil.isNotEmpty(nextCodes)) { + wrapper.lambda().in(OperatorEntity::getNodeCode, nextCodes); + } + wrapper.lambda().orderByDesc(OperatorEntity::getCreatorTime); + List list = operatorService.list(wrapper); + boolean mark = this.checkDraftAndRecord(list); + if (mark) { + if (isException) { + throw new WorkFlowException(MsgCode.WF077.get()); + } + return false; + } + return true; + } + + // 依次审批的撤回判断 + public boolean checkInTurn(OperatorEntity operator, boolean isException) throws WorkFlowException { + if (StringUtil.isNotBlank(operator.getHandleAll())) { + List handleIds = Arrays.stream(operator.getHandleAll().split(",")).collect(Collectors.toList()); + int index = handleIds.indexOf(operator.getHandleId()); + if (index != -1 && index < handleIds.size() - 1) { + String nextHandleId = handleIds.get(index + 1); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OperatorEntity::getHandleId, nextHandleId) + .eq(OperatorEntity::getParentId, operator.getParentId()) + .eq(OperatorEntity::getNodeId, operator.getNodeId()) + .orderByDesc(OperatorEntity::getCreatorTime); + List list = operatorService.list(queryWrapper); + if (CollectionUtil.isNotEmpty(list)) { + OperatorEntity nextOperator = list.get(0); + if (StringUtil.isNotEmpty(nextOperator.getDraftData())) { + if (isException) { + throw new WorkFlowException(MsgCode.WF036.get()); + } + return false; + } + QueryWrapper recordWrapper = new QueryWrapper<>(); + recordWrapper.lambda().eq(RecordEntity::getOperatorId, nextOperator.getId()) + .ne(RecordEntity::getStatus, -1); + List recordList = recordService.list(recordWrapper); + if (CollectionUtil.isNotEmpty(recordList)) { + if (isException) { + throw new WorkFlowException(MsgCode.WF036.get()); + } + return false; + } + } + } + } + return true; + } + + public boolean checkDraftAndRecord(List list) { + return this.checkDraftAndRecord(list, false); + } + + // 判断草稿、操作记录 + public boolean checkDraftAndRecord(List list, boolean filterAddSign) { + list = list.stream().filter(e -> !ObjectUtil.equals(e.getStatus(), -1)).collect(Collectors.toList()); + if (CollectionUtil.isEmpty(list)) { + return false; + } + // if (CollectionUtil.isNotEmpty(list)) { + // // 回流的处理 + // OperatorEntity first = list.get(0); + // list = list.stream().filter(e -> ObjectUtil.equals(first.getNodeId(), + // e.getNodeId())).collect(Collectors.toList()); + // } + // 只要有操作就不让撤回,草稿数据(暂存) + long draftCount = list.stream().filter(e -> StringUtil.isNotEmpty(e.getDraftData())).count(); + boolean mark = false; + // 不存在草稿数据,继续根据记录判断 + if (draftCount == 0) { + List collect = list.stream().map(OperatorEntity::getId).collect(Collectors.toList()); + if (CollectionUtil.isNotEmpty(collect)) { + QueryWrapper recordWrapper = new QueryWrapper<>(); + recordWrapper.lambda().in(RecordEntity::getOperatorId, collect).ne(RecordEntity::getStatus, -1); + List recordList = recordService.list(recordWrapper); + if (filterAddSign) { + List status = ImmutableList.of(RecordEnum.addSign.getCode(), + RecordEnum.subtractSign.getCode()); + recordList = recordList.stream().filter(e -> !status.contains(e.getHandleType())) + .collect(Collectors.toList()); + } + mark = !recordList.isEmpty(); + } + } else { + mark = true; + } + return mark; + } + + /** + * 判断打印 + */ + public boolean checkPrint(FlowMethod flowMethod) { + NodeModel nodeModel = flowMethod.getNodeModel(); + TaskEntity taskEntity = flowMethod.getTaskEntity(); + Map formData = flowMethod.getFormData(); + List nodeList = flowMethod.getPrintNodeList(); + + // 发起除了草稿状态都显示 + if (Objects.equals(taskEntity.getStatus(), TaskStatusEnum.TO_BE_SUBMIT.getCode())) { + return false; + } + PrintConfig printConfig = nodeModel.getPrintConfig(); + if (printConfig.getOn()) { + // 打印没有选择模版,按钮不显示 + if (CollectionUtil.isEmpty(printConfig.getPrintIds())) { + return false; + } + switch (printConfig.getConditionType()) { + case 1: + // 不限制 + return true; + case 2: + // 节点结束 + // 开始节点直接返回true,除草稿状态 + if (nodeModel.getType().equals(NodeEnum.start.getType()) + && !taskEntity.getStatus().equals(TaskStatusEnum.TO_BE_SUBMIT.getCode())) { + return true; + } + TaskNodeModel taskNode = nodeList.stream() + .filter(e -> e.getNodeCode().equals(nodeModel.getNodeId())).findFirst().orElse(null); + if (null != taskNode && taskNode.getType().equals("0")) { + return true; + } + break; + case 3: + // 流程结束 + ImmutableList status = ImmutableList.of(TaskStatusEnum.PASSED.getCode(), + TaskStatusEnum.REJECTED.getCode()); + if (status.contains(taskEntity.getStatus())) { + return true; + } + break; + case 4: + // 条件设置 + List conditions = printConfig.getConditions(); + String matchLogic = printConfig.getMatchLogic(); + UserInfo userInfo = UserProvider.getUser(); + flowMethod.setUserInfo(userInfo); + flowMethod.setUserEntity(serviceUtil.getUserInfo(userInfo.getUserId())); + flowMethod.setConditions(conditions); + flowMethod.setMatchLogic(matchLogic); + if (FlowJsonUtil.nodeConditionDecide(flowMethod)) { + return true; + } + break; + } + } + return false; + } + + /** + * 判断加签 + */ + public void checkAddSign(OperatorEntity operator, AddSignModel parameter) throws WorkFlowException { + this.checkAddSign(operator, parameter, true); + } + + public boolean checkAddSign(OperatorEntity operator, AddSignModel parameter, Boolean isException) + throws WorkFlowException { + int level = 1; + if (!ObjectUtil.equals(operator.getParentId(), "0")) { + OperatorEntity parent = operatorService.getById(operator.getParentId()); + if (null != parent) { + String handleParameter = parent.getHandleParameter() == null ? operator.getHandleParameter() + : parent.getHandleParameter(); + AddSignModel jsonToBean = JsonUtil.getJsonToBean(handleParameter, AddSignModel.class); + level = jsonToBean.getLevel() + 1; + } + } + SysConfigModel sysConfig = serviceUtil.getSysConfig(); + Integer addSignLevel = sysConfig.getAddSignLevel(); + if (level > addSignLevel) { + if (isException) { + throw new WorkFlowException(MsgCode.WF143.get()); + } + return false; + } + if (null != parameter) { + parameter.setLevel(level); + } + return true; + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/CirculateUtil.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/CirculateUtil.java new file mode 100644 index 0000000..b67d327 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/CirculateUtil.java @@ -0,0 +1,109 @@ +package com.yunzhupaas.flowable.util; + +import cn.hutool.core.util.ObjectUtil; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.CirculateEntity; +import com.yunzhupaas.flowable.entity.OperatorEntity; +import com.yunzhupaas.flowable.entity.TaskEntity; +import com.yunzhupaas.flowable.entity.TemplateNodeEntity; +import com.yunzhupaas.flowable.enums.RecordEnum; +import com.yunzhupaas.flowable.model.task.FlowMethod; +import com.yunzhupaas.flowable.model.task.FlowModel; +import com.yunzhupaas.flowable.model.templatenode.nodejson.NodeModel; +import com.yunzhupaas.flowable.model.util.FlowNature; +import com.yunzhupaas.flowable.service.CirculateService; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.entity.UserRelationEntity; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2024/4/29 下午3:12 + */ +@Component +public class CirculateUtil { + + @Autowired + private ServiceUtil serviceUtil; + @Autowired + private TaskUtil taskUtil; + @Autowired + private CirculateService circulateService; + + public List circulateList(FlowMethod flowMethod) throws WorkFlowException { + FlowModel flowModel = flowMethod.getFlowModel(); + List circulateList = new ArrayList<>(); + TaskEntity task = flowMethod.getTaskEntity(); + OperatorEntity operator = flowMethod.getOperatorEntity(); + TemplateNodeEntity nodeEntity = flowMethod.getNodeEntity(); + NodeModel nodeModel = JsonUtil.getJsonToBean(nodeEntity.getNodeJson(), NodeModel.class); + List userIdAll = new ArrayList<>(); + //附加规则 + if (!ObjectUtil.equals(flowMethod.getType(), RecordEnum.reject.getCode())) { + List all = taskUtil.getSub(nodeModel.getCirculateUser()); + userIdAll = serviceUtil.getUserListAll(all); + taskUtil.rule(userIdAll, task.getId(), nodeModel.getExtraCopyRule()); + } + //指定传阅人 + userIdAll.addAll(Arrays.asList(StringUtil.isNotEmpty(flowModel.getCopyIds()) ? flowModel.getCopyIds().split(",") : new String[]{})); + //抄送自己 + if (nodeModel.getIsInitiatorCopy()) { + userIdAll.add(task.getCreatorUserId()); + } + //抄送表单变量 + if (nodeModel.getIsFormFieldCopy()) { + flowMethod.setIsAssign(false); + flowMethod.setIsData(true); + Map dataAll = taskUtil.createOrUpdate(flowMethod); + Object data = dataAll.get(nodeModel.getCopyFormField() + FlowNature.FORM_FIELD_SUFFIX); + if (data != null) { + List list = new ArrayList<>(); + try { + list.addAll(JsonUtil.getJsonToList(String.valueOf(data), String.class)); + } catch (Exception e) {} + if (data instanceof List) { + list.addAll((List) data); + } else { + list.addAll(Arrays.asList(String.valueOf(data).split(","))); + } + List id = new ArrayList<>(); + for (String s : list) { + id.add(s.split("--")[0]); + } + List listByObjectIdAll = serviceUtil.getListByObjectIdAll(id); + List userPosition = listByObjectIdAll.stream().map(UserRelationEntity::getUserId).collect(Collectors.toList()); + List handleIdAll = new ArrayList<>(); + handleIdAll.addAll(userPosition); + handleIdAll.addAll(id); + userIdAll.addAll(handleIdAll); + } + } + //获取最新用户 + List userList = serviceUtil.getUserName(userIdAll, true); + for (UserEntity userEntity : userList) { + CirculateEntity circulate = new CirculateEntity(); + circulate.setId(RandomUtil.uuId()); + circulate.setUserId(userEntity.getId()); + circulate.setNodeCode(nodeModel.getNodeId()); + circulate.setNodeName(nodeModel.getNodeName()); + circulate.setTaskId(task.getId()); + circulate.setCirculateRead(0); + circulate.setOperatorId(operator.getId()); + circulate.setNodeId(operator.getNodeId()); + circulate.setCreatorTime(new Date()); + circulateList.add(circulate); + } + circulateService.saveBatch(circulateList); + return circulateList; + } +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/ConditionService.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/ConditionService.java new file mode 100644 index 0000000..94819da --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/ConditionService.java @@ -0,0 +1,234 @@ +package com.yunzhupaas.flowable.util; + +import cn.hutool.core.collection.CollectionUtil; +import com.google.common.collect.ImmutableList; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.TaskEntity; +import com.yunzhupaas.flowable.enums.DivideRuleEnum; +import com.yunzhupaas.flowable.enums.NodeEnum; +import com.yunzhupaas.flowable.model.flowable.FlowAbleUrl; +import com.yunzhupaas.flowable.model.flowable.OutgoingFlowsFo; +import com.yunzhupaas.flowable.model.task.FlowMethod; +import com.yunzhupaas.flowable.model.templatenode.nodejson.NodeModel; +import com.yunzhupaas.flowable.model.templatenode.nodejson.ProperCond; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.*; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/19 15:14 + */ +@Component +public class ConditionService { + @Autowired + private ServiceUtil serviceUtil; + @Autowired + private FlowAbleUrl flowAbleUrl; + + // 处理选择分支的条件 + public Map getForBranch(FlowMethod flowMethod, List branchList) throws WorkFlowException { + Map resMap = new HashMap<>(); + + String deploymentId = flowMethod.getDeploymentId(); + String nodeCode = flowMethod.getNodeCode(); + Map nodes = flowMethod.getNodes(); + NodeModel global = nodes.get(NodeEnum.global.getType()); + List connectList = global.getConnectList(); + List typeList = ImmutableList.of(NodeEnum.trigger.getType()); + + OutgoingFlowsFo flowsFo = new OutgoingFlowsFo(); + flowsFo.setDeploymentId(deploymentId); + flowsFo.setTaskKey(nodeCode); + List outgoingFlows = flowAbleUrl.getOutgoingFlows(flowsFo); + + for (String flow : outgoingFlows) { + resMap.put(flow, false); + if (!connectList.contains(flow)) { + // 不存在connectList中,说明是隐藏的线,默认给true + resMap.put(flow, true); + continue; + } + List nodeKey = flowAbleUrl.getTaskKeyAfterFlow(deploymentId, flow); + if (CollectionUtil.isNotEmpty(nodeKey)) { + NodeModel nodeModel = nodes.get(nodeKey.get(0)); + if (null != nodeModel && typeList.contains(nodeModel.getType())) { + resMap.put(flow, true); + } else if (branchList.contains(nodeKey.get(0))) { + resMap.put(flow, true); + } + } + } + + return resMap; + } + + /** + * 处理条件 + */ + public Map handleCondition(FlowMethod flowMethod) throws WorkFlowException { + String deploymentId = flowMethod.getDeploymentId(); + String nodeCode = flowMethod.getNodeCode(); + // 获取节点的出线 + OutgoingFlowsFo flowsFo = new OutgoingFlowsFo(); + flowsFo.setDeploymentId(deploymentId); + flowsFo.setTaskKey(nodeCode); + List outgoingFlows = flowAbleUrl.getOutgoingFlows(flowsFo); + + Map resMap = new HashMap<>(); + flowMethod.setResMap(resMap); + flowMethod.setOutgoingFlows(outgoingFlows); + // 判断条件 + getConditionResult(flowMethod); + return resMap; + } + + /** + * 获取条件结果 + */ + public void getConditionResult(FlowMethod flowMethod) { + List outgoingFlows = flowMethod.getOutgoingFlows(); + Map resMap = flowMethod.getResMap(); + Map nodes = flowMethod.getNodes(); + String nodeCode = flowMethod.getNodeCode(); + TaskEntity taskEntity = flowMethod.getTaskEntity(); + if (CollectionUtil.isNotEmpty(outgoingFlows)) { + + Set userList = new HashSet<>(); + userList.add(UserProvider.getLoginUserId()); + + if (taskEntity != null) { + userList.add(taskEntity.getCreatorUserId()); + if (StringUtil.isNotEmpty(taskEntity.getDelegateUserId())) { + userList.add(taskEntity.getDelegateUserId()); + } + } + + List userName = serviceUtil.getUserName(new ArrayList<>(userList)); + UserEntity createUser = null; + UserEntity delegate = null; + if (taskEntity != null) { + createUser = userName.stream().filter(e -> Objects.equals(e.getId(), taskEntity.getCreatorUserId())) + .findFirst().orElse(null); + if (StringUtil.isNotEmpty(taskEntity.getDelegateUserId())) { + delegate = userName.stream().filter(e -> Objects.equals(e.getId(), taskEntity.getDelegateUserId())) + .findFirst().orElse(null); + } + } + + // 设置条件判断 所需参数 + UserEntity userEntity = userName.stream() + .filter(e -> Objects.equals(e.getId(), UserProvider.getLoginUserId())).findFirst().orElse(null); + flowMethod.setUserEntity(userEntity); + if (flowMethod.getUserInfo() == null) { + flowMethod.setUserInfo(UserProvider.getUser()); + } + flowMethod.setCreateUser(createUser); + flowMethod.setDelegate(delegate); + + NodeModel currentNodeModel = nodes.get(nodeCode); + flowMethod.setNodeModel(currentNodeModel); + if (StringUtil.equals(currentNodeModel.getDivideRule(), DivideRuleEnum.PARALLEL.getType())) { + // 并行,全都为true + for (String key : outgoingFlows) { + resMap.put(key, true); + } + } + // else if (StringUtil.equals(currentNodeModel.getDivideRule(), + // DivideRuleEnum.EXCLUSIVE.getType())) { + // // 排他,获取到第一条为true的结果,其余默认为false + // for (String key : outgoingFlows) { + // // 获取出线节点 判断条件,没有设置条件的默认true + // NodeModel nodeModel = nodes.get(key); + // boolean res = true; + // if (null != nodeModel) { + // List conditions = nodeModel.getConditions(); + // if (CollectionUtil.isNotEmpty(conditions)) { + // flowMethod.setConditions(conditions); + // flowMethod.setMatchLogic(nodeModel.getMatchLogic()); + // res = FlowJsonUtil.nodeConditionDecide(flowMethod); + // } + // conditionResMap.put(key, res); + // } + // resMap.put(key, res); + // } + // } + else { + for (String key : outgoingFlows) { + // 获取出线节点 判断条件,没有设置条件的默认true + NodeModel nodeModel = nodes.get(key); + boolean res = true; + if (null != nodeModel) { + List conditions = nodeModel.getConditions(); + if (CollectionUtil.isNotEmpty(conditions)) { + flowMethod.setConditions(conditions); + flowMethod.setMatchLogic(nodeModel.getMatchLogic()); + res = FlowJsonUtil.nodeConditionDecide(flowMethod); + } + } + resMap.put(key, res); + } + } + } + } + + // 处理条件 + public boolean hasCondition(FlowMethod flowMethod) { + TaskEntity taskEntity = flowMethod.getTaskEntity(); + UserEntity createUser = null; + UserEntity delegate = null; + if (taskEntity != null) { + createUser = serviceUtil.getUserInfo(taskEntity.getCreatorUserId()); + delegate = StringUtil.isNotEmpty(taskEntity.getDelegateUserId()) + ? serviceUtil.getUserInfo(taskEntity.getDelegateUserId()) + : null; + } + flowMethod.setCreateUser(createUser); + flowMethod.setDelegate(delegate); + UserEntity userEntity = serviceUtil.getUserInfo(UserProvider.getLoginUserId()); + flowMethod.setUserEntity(userEntity); + flowMethod.setUserInfo(UserProvider.getUser()); + return FlowJsonUtil.nodeConditionDecide(flowMethod); + } + + public void checkCondition(Map resMap, Map nodes) throws WorkFlowException { + if (CollectionUtil.isEmpty(nodes)) { + return; + } + NodeModel global = nodes.get(NodeEnum.global.getType()); + if (null == global) { + throw new WorkFlowException(MsgCode.WF076.get()); + } + List connectList = global.getConnectList(); + long count = resMap.values().stream().filter(t -> Objects.equals(t, true)).count(); + Set set = resMap.keySet(); + + if (count == resMap.size()) { + return; + } + + if (CollectionUtil.isNotEmpty(connectList)) { + int c = 0; + for (String key : set) { + if (connectList.contains(key) && resMap.get(key)) { + c++; + } + } + if (c < 1) { + throw new WorkFlowException(MsgCode.WF075.get()); + } + } else { + if (count < 1) { + throw new WorkFlowException(MsgCode.WF075.get()); + } + } + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/FlowAsyncUtil.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/FlowAsyncUtil.java new file mode 100644 index 0000000..7cd26d1 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/FlowAsyncUtil.java @@ -0,0 +1,172 @@ +package com.yunzhupaas.flowable.util; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.util.SentMessageUtil; +import com.yunzhupaas.flowable.entity.OperatorEntity; +import com.yunzhupaas.flowable.entity.TaskEntity; +import com.yunzhupaas.flowable.enums.OperatorStateEnum; +import com.yunzhupaas.flowable.model.message.DelegateModel; +import com.yunzhupaas.flowable.model.task.FlowModel; +import com.yunzhupaas.flowable.model.trigger.ExecuteAsyncModel; +import com.yunzhupaas.flowable.model.trigger.ExecuteModel; +import com.yunzhupaas.flowable.model.util.FlowConstant; +import com.yunzhupaas.flowable.model.util.FlowNature; +import com.yunzhupaas.flowable.model.util.SystemAuditModel; +import com.yunzhupaas.flowable.service.OperatorService; +import com.yunzhupaas.flowable.service.TaskService; +import com.yunzhupaas.message.model.SentMessageForm; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.util.StringUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/8/26 16:56 + */ +@Component +public class FlowAsyncUtil { + + @Lazy + @Autowired + private ServiceUtil serviceUtil; + @Autowired + private SentMessageUtil sentMessageUtil; + @Autowired + private TriggerUtil triggerUtil; + @Autowired + private OperatorService operatorService; + @Autowired + private TaskService taskService; + @Autowired + private OperatorUtil operatorUtil; + + // --------------------------------------委托消息------------------------------------------------------ + @Async + public void delegateMsg(DelegateModel flowDelegate) { + List toUserIds = flowDelegate.getToUserIds(); + if (!toUserIds.isEmpty()) { + UserInfo userInfo = flowDelegate.getUserInfo(); + TaskEntity flowTask = flowDelegate.getFlowTask(); + Map contentMsg = new HashMap<>(); + Boolean delegate = flowDelegate.getDelegate(); + boolean approve = flowDelegate.getApprove(); + if (approve) { + SentMessageForm flowMsgModel = new SentMessageForm(); + flowMsgModel.setToUserIds(toUserIds); + flowMsgModel.setUserInfo(flowDelegate.getUserInfo()); + Map parameterMap = new HashMap<>(); + parameterMap.put(FlowConstant.MANDATOR, userInfo.getUserName()); + UserEntity mandatary = StringUtil.isNotEmpty(flowTask.getDelegateUserId()) + ? serviceUtil.getUserInfo(flowTask.getDelegateUserId()) + : null; + parameterMap.put(FlowConstant.MANDATARY, mandatary != null ? mandatary.getRealName() : ""); + parameterMap.put(FlowConstant.TITLE, delegate ? "委托" : "代理"); + flowMsgModel.setParameterMap(parameterMap); + // 委托/代理确认通知 + Integer ack = flowDelegate.getAck(); + // 1.委托设置 2.委托给我 + Integer type = flowDelegate.getType(); + String templateId = FlowNature.EndMsg.equals(type) ? "PZXTLG021" + : ObjectUtil.equals(ack, 1) ? "PZXTLG020" : "PZXTLG019"; + flowMsgModel.setTemplateId(templateId); + + Integer delegateType = FlowNature.EndMsg.equals(type) ? 0 : delegate ? 2 : 4; + contentMsg.put("type", delegateType + ""); + + flowMsgModel.setContentMsg(contentMsg); + flowMsgModel.setFlowType(2); + flowMsgModel.setType(2); + List messageListAll = new ArrayList<>(); + messageListAll.add(flowMsgModel); + serviceUtil.sendDelegateMsg(messageListAll); + } + } + } + + // --------------------------------发送消息------------------------------ + @Async + public void sendMessage(List messageListAll) { + for (SentMessageForm messageForm : messageListAll) { + if (messageForm.isSysMessage()) { + sentMessageUtil.sendMessage(messageForm); + } + } + } + + @Async + public void execute(List list) throws Exception { + for (ExecuteAsyncModel asyncModel : list) { + FlowModel flowModel = asyncModel.getFlowModel(); + ExecuteModel model = asyncModel.getModel(); + Boolean sync = asyncModel.getSync(); + List operatorList = asyncModel.getOperatorList(); + List systemList = asyncModel.getSystemList(); + List subTaskList = asyncModel.getSubTaskList(); + this.execute(model, sync, operatorList, subTaskList, systemList, flowModel); + } + } + + public void execute(ExecuteModel model, Boolean isAsync, List operatorList, + List subTaskList, List systemList, FlowModel flowModel) throws Exception { + try { + triggerUtil.execute(model); + } catch (Exception e) { + e.printStackTrace(); + // 终止流程 + if (isAsync) { + TaskEntity taskEntity = flowModel.getTaskEntity(); + taskService.cancel(taskEntity.getId(), flowModel, true); + } + return; + } + // try { + // System.out.println("==================================================1"); + // Thread.sleep(20000); + // System.out.println("==================================================2"); + // } catch (InterruptedException e) { + // e.printStackTrace(); + // } + if (isAsync) { + if (CollectionUtil.isNotEmpty(operatorList)) { + for (OperatorEntity operator : operatorList) { + operator.setStatus(OperatorStateEnum.Runing.getCode()); + } + operatorService.updateBatchById(operatorList); + } + if (CollectionUtil.isNotEmpty(subTaskList)) { + for (TaskEntity taskEntity : subTaskList) { + Integer hisStatus = taskEntity.getHisStatus(); + taskEntity.setStatus(hisStatus); + } + taskService.updateBatchById(subTaskList); + } + if (CollectionUtil.isNotEmpty(systemList)) { + for (SystemAuditModel systemAuditModel : systemList) { + try { + operatorUtil.autoAudit(systemAuditModel.getOperator(), systemAuditModel.getFlowModel()); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + try { + operatorUtil.autoAudit(flowModel, false); + } catch (Exception e) { + e.printStackTrace(); + } + } + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/FlowJsonUtil.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/FlowJsonUtil.java new file mode 100644 index 0000000..1515721 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/FlowJsonUtil.java @@ -0,0 +1,492 @@ +package com.yunzhupaas.flowable.util; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.emnus.SearchMethodEnum; +import com.yunzhupaas.emnus.TemplateEnum; +import com.yunzhupaas.flowable.entity.RecordEntity; +import com.yunzhupaas.flowable.entity.TaskEntity; +import com.yunzhupaas.flowable.enums.NodeEnum; +import com.yunzhupaas.flowable.model.task.FlowMethod; +import com.yunzhupaas.flowable.model.templatejson.FlowParamModel; +import com.yunzhupaas.flowable.model.templatenode.nodejson.GroupsModel; +import com.yunzhupaas.flowable.model.templatenode.nodejson.NodeModel; +import com.yunzhupaas.flowable.model.templatenode.nodejson.ProperCond; +import com.yunzhupaas.flowable.model.templatenode.nodejson.TemplateJsonModel; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.text.StringSubstitutor; + +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.text.NumberFormat; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/18 20:22 + */ + +public class FlowJsonUtil { + + /** + * 节点条件判断 + **/ + public static boolean nodeConditionDecide(FlowMethod flowMethod) { + List conditionList = flowMethod.getConditions(); + String matchLogic = flowMethod.getMatchLogic(); + boolean flag = false; + ScriptEngineManager scriptEngineManager = new ScriptEngineManager(); + ScriptEngine scriptEngine = scriptEngineManager.getEngineByName("js"); + Map map = flowMethod.getFormData(); + List expressionAll = new ArrayList<>(); + StringBuilder condition = new StringBuilder(); + for (int k = 0; k < conditionList.size(); k++) { + StringBuilder expression = new StringBuilder(); + expression.append("("); + ProperCond properCond = conditionList.get(k); + String logic = properCond.getLogic(); + List groups = properCond.getGroups(); + for (int i = 0; i < groups.size(); i++) { + GroupsModel groupsModel = groups.get(i); + String contain = "!=-1"; + String field = groupsModel.getField(); + String yunzhupaasKey = groupsModel.getYunzhupaasKey(); + int fieldType = groupsModel.getFieldType(); + Object form = fieldType == 1 ? formValue(flowMethod, yunzhupaasKey, map.get(field)) + : formula(groupsModel, map); + Object formValue = form; + String symbol = groupsModel.getSymbol(); + boolean include = ("like".equals(symbol) || "notLike".equals(symbol)); + if ("<>".equals(symbol)) { + symbol = "!="; + } + int fieldValueType = groupsModel.getFieldValueType(); + String valueYunzhupaasKey = StringUtil.isNotEmpty(groupsModel.getFieldValueYunzhupaasKey()) + ? groupsModel.getFieldValueYunzhupaasKey() + : yunzhupaasKey; + Object filedData = groupsModel.getFieldValue(); + + Object value; + if (fieldValueType == 3 || fieldValueType == 4) { + + TemplateJsonModel templateJsonModel = new TemplateJsonModel(); + templateJsonModel.setField(groupsModel.getField()); + templateJsonModel.setSourceType(fieldValueType == 3 ? 4 : TemplateEnum.Field.getCode()); + templateJsonModel.setMsgTemplateId(groupsModel.getField()); + templateJsonModel.setRelationField(String.valueOf(groupsModel.getFieldValue())); + + MsgUtil msgUtil = new MsgUtil(); + TaskEntity flowTaskEntity = flowMethod.getTaskEntity(); + + Map mapData = new HashMap<>(); + if (null != flowTaskEntity) { + if (StringUtil.isNotEmpty(flowTaskEntity.getGlobalParameter())) { + mapData = JsonUtil.stringToMap(flowTaskEntity.getGlobalParameter()); + } + } + if (CollectionUtil.isEmpty(mapData)) { + NodeModel global = flowMethod.getNodes().get(NodeEnum.global.getType()); + if (null != global) { + List paramModelList = global.getGlobalParameterList(); + for (FlowParamModel model : paramModelList) { + mapData.put(model.getFieldName(), model.getDefaultValue()); + } + } + } + + List list = new ArrayList<>(); + list.add(templateJsonModel); + + RecordEntity record = new RecordEntity(); + record.setNodeCode(flowMethod.getNodeCode()); + UserEntity createUser = flowMethod.getCreateUser(); + UserEntity delegate = flowMethod.getDelegate(); + Map resMap = msgUtil.parameterMap(mapData, list, record, flowTaskEntity, createUser, + delegate); + value = resMap.get(field); + if (value != null) { + value = "'" + value + "'"; + } + } else { + value = fieldValueType == 2 ? filedValue(flowMethod, filedData, valueYunzhupaasKey, form) + : filedData(flowMethod, filedData, valueYunzhupaasKey, form); + } + Object fieldValue = value; + String pression = formValue + symbol + fieldValue; + // 比较的处理 + if ("<=".equals(symbol) || "<".equals(symbol) || ">".equals(symbol) || ">=".equals(symbol)) { + try { + String formValueStr = formValue.toString(); + if (formValueStr.startsWith("'") && formValueStr.endsWith("'")) { + formValueStr = formValueStr.substring(1, formValueStr.length() - 1); + } + fieldValue = fieldValue == null ? "" : fieldValue; + String fieldValueStr = fieldValue.toString(); + if (fieldValueStr.startsWith("'") && fieldValueStr.endsWith("'")) { + fieldValueStr = fieldValueStr.substring(1, fieldValueStr.length() - 1); + } + BigDecimal a = new BigDecimal(formValueStr); + BigDecimal b = new BigDecimal(fieldValueStr); + boolean res = false; + if ("<=".equals(symbol)) { + res = a.compareTo(b) <= 0; + } else if ("<".equals(symbol)) { + res = a.compareTo(b) < 0; + } else if (">".equals(symbol)) { + res = a.compareTo(b) > 0; + } else if (">=".equals(symbol)) { + res = a.compareTo(b) >= 0; + } + pression = res + ""; + } catch (Exception e) { + System.out.println(e.getMessage()); + pression = "false"; + } + } + if (include) { + if ("notLike".equals(symbol)) { + contain = "==-1"; + } + symbol = ".indexOf"; + if (!(formValue instanceof CharSequence)) { + formValue = "'" + formValue + "'"; + } + if (!(fieldValue instanceof CharSequence)) { + fieldValue = "'" + fieldValue + "'"; + } + pression = formValue + ".toString()" + symbol + "(" + fieldValue + ")" + contain; + } + if (ObjectUtil.equals(symbol, "null")) { + pression = "(" + formValue + " == null || " + formValue + " == '')"; + } + if (ObjectUtil.equals(symbol, "notNull")) { + pression = "(" + formValue + " != null && " + formValue + " != '')"; + } + expression.append(pression); + if (!StringUtils.isEmpty(logic) && i != groups.size() - 1) { + expression.append(" " + search(logic) + " "); + } + } + expression.append(")"); + expressionAll.add(expression.toString()); + } + for (int i = 0; i < expressionAll.size(); i++) { + String script = expressionAll.get(i); + String search = i != expressionAll.size() - 1 ? search(matchLogic) : ""; + condition.append(script + " " + search + " "); + } + try { + flag = (Boolean) scriptEngine.eval(condition.toString()); + } catch (Exception e) { + System.out.println(e.getMessage()); + } + return flag; + } + + /** + * 条件表达式 + * + * @param logic + */ + private static String search(String logic) { + return SearchMethodEnum.And.getSymbol().equalsIgnoreCase(logic) ? "&&" : "||"; + } + + /** + * 条件数据修改 + * + * @param flowMethod + * @param value + */ + private static Object filedValue(FlowMethod flowMethod, Object value, String yunzhupaasKey, Object form) { + UserInfo userInfo = flowMethod.getUserInfo(); + if ("currentUser".equals(value)) { + value = userInfo.getUserId(); + } + try { + try { + List> dataAll = JsonUtil.getJsonToBean(value, List.class); + List id = new ArrayList<>(); + for (List data : dataAll) { + id.addAll(data); + } + value = String.join(",", id); + } catch (Exception e) { + try { + List id = new ArrayList<>(); + List dataAll = JsonUtil.getJsonToList(value, String.class); + if (YunzhupaasKeyConsts.CURRORGANIZE.equals(yunzhupaasKey)) { + value = dataAll.stream().filter(t -> ("'" + t + "'").equals(form)).findFirst().orElse(null); + } else { + for (String data : dataAll) { + id.add(data); + } + value = String.join(",", id); + } + } catch (Exception e1) { + + } + } + } catch (Exception e) { + + } + if (value instanceof CharSequence) { + value = "'" + value + "'"; + } + return value; + } + + /** + * 条件数据修改 + * + * @param flowMethod + * @param value + */ + private static Object filedData(FlowMethod flowMethod, Object value, String yunzhupaasKey, Object form) { + Map map = flowMethod.getFormData(); + value = map.get(value); + UserEntity userEntity = flowMethod.getUserEntity(); + TaskEntity taskEntity = flowMethod.getTaskEntity(); + try { + try { + List> dataAll = JsonUtil.getJsonToBean(value, List.class); + List id = new ArrayList<>(); + for (List data : dataAll) { + id.addAll(data); + } + value = String.join(",", id); + } catch (Exception e) { + try { + List id = new ArrayList<>(); + List dataAll = JsonUtil.getJsonToList(value, String.class); + if (YunzhupaasKeyConsts.CURRORGANIZE.equals(yunzhupaasKey) + || YunzhupaasKeyConsts.COMSELECT.equals(yunzhupaasKey)) { + value = dataAll.stream().filter(t -> ("'" + t + "'").equals(form)).findFirst().orElse(null); + } else { + for (String data : dataAll) { + id.add(data); + } + value = String.join(",", id); + } + } catch (Exception e1) { + + } + } + if (YunzhupaasKeyConsts.CREATETIME.equals(yunzhupaasKey)) { + Date creatorTime = taskEntity.getCreatorTime(); + value = null == creatorTime ? null : creatorTime.getTime(); + } else if (YunzhupaasKeyConsts.CREATEUSER.equals(yunzhupaasKey)) { + value = taskEntity.getCreatorUserId(); + } else if (YunzhupaasKeyConsts.CURRORGANIZE.equals(yunzhupaasKey)) { + value = userEntity.getOrganizeId(); + } else if (YunzhupaasKeyConsts.CURRPOSITION.equals(yunzhupaasKey)) { + value = userEntity.getPositionId(); + } else if (YunzhupaasKeyConsts.MODIFYTIME.equals(yunzhupaasKey)) { + Date lastModifyTime = taskEntity.getLastModifyTime(); + value = null == lastModifyTime ? null : lastModifyTime.getTime(); + } else if (YunzhupaasKeyConsts.MODIFYUSER.equals(yunzhupaasKey)) { + value = taskEntity.getLastModifyUserId(); + } + } catch (Exception e) { + + } + if (value instanceof CharSequence) { + value = "'" + value + "'"; + } + return value; + } + + /** + * 表单数据修改 + * + * @param form + */ + private static Object formValue(FlowMethod flowMethod, String yunzhupaasKey, Object form) { + Object result = form; + UserEntity userEntity = flowMethod.getUserEntity(); + TaskEntity flowTaskEntity = flowMethod.getTaskEntity(); + try { + try { + List> dataAll = JsonUtil.getJsonToBean(form, List.class); + List id = new ArrayList<>(); + for (List data : dataAll) { + id.addAll(data); + } + result = String.join(",", id); + } catch (Exception e) { + try { + List id = new ArrayList<>(); + List dataAll = JsonUtil.getJsonToList(form, String.class); + for (String data : dataAll) { + id.add(data); + } + result = String.join(",", id); + } catch (Exception e1) { + } + } + if (YunzhupaasKeyConsts.CREATETIME.equals(yunzhupaasKey)) { + Date creatorTime = flowTaskEntity.getCreatorTime(); + result = null == creatorTime ? null : creatorTime.getTime(); + } else if (YunzhupaasKeyConsts.CREATEUSER.equals(yunzhupaasKey)) { + result = StringUtil.isNotEmpty(flowTaskEntity.getDelegateUserId()) ? flowTaskEntity.getDelegateUserId() + : flowTaskEntity.getCreatorUserId(); + } else if (YunzhupaasKeyConsts.CURRORGANIZE.equals(yunzhupaasKey)) { + result = userEntity.getOrganizeId(); + } else if (YunzhupaasKeyConsts.CURRPOSITION.equals(yunzhupaasKey)) { + result = userEntity.getPositionId(); + } else if (YunzhupaasKeyConsts.MODIFYTIME.equals(yunzhupaasKey)) { + Date lastModifyTime = flowTaskEntity.getLastModifyTime(); + result = null == lastModifyTime ? null : lastModifyTime.getTime(); + } else if (YunzhupaasKeyConsts.MODIFYUSER.equals(yunzhupaasKey)) { + result = flowTaskEntity.getLastModifyUserId(); + } + } catch (Exception e) { + } + if (result instanceof CharSequence) { + result = "'" + result + "'"; + } + return result; + } + + /** + * 表达式 + */ + private static Object formula(GroupsModel properCond, Map data) { + String result = null; + try { + StringBuilder builder = new StringBuilder(); + builder.append("function getNum(val) {\n" + + " return isNaN(val) ? 0 : Number(val)\n" + + "};\n" + + "// 求和\n" + + "function SUM() {\n" + + " var value = 0\n" + + " for (var i = 0; i < arguments.length; i++) {\n" + + " value += getNum(arguments[i])\n" + + " }\n" + + " return value\n" + + "};\n" + + "// 求差\n" + + "function SUBTRACT(num1, num2) {\n" + + " return getNum(num1) - getNum(num2)\n" + + "};\n" + + "// 相乘\n" + + "function PRODUCT() {\n" + + " var value = 1\n" + + " for (var i = 0; i < arguments.length; i++) {\n" + + " value = value * getNum(arguments[i])\n" + + " }\n" + + " return value\n" + + "};\n" + + "// 相除\n" + + "function DIVIDE(num1, num2) {\n" + + " return getNum(num1) / (getNum(num2) === 0 ? 1 : getNum(num2))\n" + + "};\n" + + "// 获取参数的数量\n" + + "function COUNT() {\n" + + " var value = 0\n" + + " for (var i = 0; i < arguments.length; i++) {\n" + + " value ++\n" + + " }\n" + + " return value\n" + + "};\n"); + String field = field(properCond.getField(), data, null); + ScriptEngineManager scriptEngineManager = new ScriptEngineManager(); + ScriptEngine scriptEngine = scriptEngineManager.getEngineByName("js"); + String eval = builder.toString() + " var result = " + field + ";"; + scriptEngine.eval(eval); + double d = (double) scriptEngine.get("result"); + NumberFormat nf = NumberFormat.getNumberInstance(); + nf.setRoundingMode(RoundingMode.UP); + result = nf.format(d); + } catch (Exception e) { + System.out.println(e.getMessage()); + } + return result; + } + + /** + * 替换文本值 + * + * @param content + * @param data + * @return + */ + public static String field(String content, Map data, String type) { + String pattern = "[{]([^}]+)[}]"; + Pattern patternList = Pattern.compile(pattern); + Matcher matcher = patternList.matcher(content); + Map> parameterMap = data(matcher, data); + Map result = new HashMap<>(); + if (StringUtils.isNotEmpty(type)) { + Map datas = new HashMap<>(); + for (String key : parameterMap.keySet()) { + datas.put(key, data.get(key) != null ? String.valueOf(data.get(key)) : ""); + } + result.putAll(datas); + } else { + Map dataAll = new HashMap<>(); + for (String key : parameterMap.keySet()) { + StringJoiner joiner = new StringJoiner(","); + List list = parameterMap.get(key); + for (String id : list) { + joiner.add("'" + id + "'"); + } + String value = joiner.toString(); + if (list.size() > 1) { + value = "SUM(" + joiner.toString() + ")"; + } + dataAll.put(key, value); + } + result.putAll(dataAll); + } + StringSubstitutor strSubstitutor = new StringSubstitutor(result, "{", "}"); + String field = strSubstitutor.replace(content); + return field; + } + + /** + * 赋值 + */ + private static Map> data(Matcher matcher, Map dataAll) { + Map> map = new HashMap<>(); + Map keyAll = new HashMap<>(); + while (matcher.find()) { + String group = matcher.group().replaceAll("\\{", "").replaceAll("}", ""); + keyAll.put(group, group); + } + for (String id : keyAll.keySet()) { + List valueData = new ArrayList<>(); + String valueAll[] = id.split("-"); + String key = valueAll[0]; + Object childDataAll = dataAll.get(key) != null ? dataAll.get(key) : ""; + if (valueAll.length > 1) { + String data = valueAll[1]; + if (childDataAll instanceof List) { + List> childData = (List>) childDataAll; + for (Map childDatum : childData) { + Object childDatas = childDatum.get(data); + valueData.add(childDatas + ""); + } + } + } else if (valueAll.length == 1) { + valueData.add(childDataAll + ""); + } + map.put(id, valueData); + } + return map; + } + +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/MsgUtil.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/MsgUtil.java new file mode 100644 index 0000000..e21c85d --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/MsgUtil.java @@ -0,0 +1,727 @@ +package com.yunzhupaas.flowable.util; + +import cn.hutool.core.util.ObjectUtil; +import com.google.common.collect.ImmutableList; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.model.systemconfig.SysConfigModel; +import com.yunzhupaas.emnus.TemplateEnum; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.*; +import com.yunzhupaas.flowable.model.message.ContModel; +import com.yunzhupaas.flowable.model.message.DelegateModel; +import com.yunzhupaas.flowable.model.message.FlowEventModel; +import com.yunzhupaas.flowable.model.message.FlowMsgModel; +import com.yunzhupaas.flowable.model.task.FlowModel; +import com.yunzhupaas.flowable.model.templatenode.nodejson.*; +import com.yunzhupaas.flowable.model.util.FlowConstant; +import com.yunzhupaas.flowable.model.util.FlowNature; +import com.yunzhupaas.flowable.service.DelegateService; +import com.yunzhupaas.message.model.SentMessageForm; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.util.DateUtil; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; +import org.springframework.stereotype.Component; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/3/30 11:45 + */ +@Slf4j +@Component +public class MsgUtil { + + @Autowired + private ServiceUtil serviceUtil; + @Autowired + private DelegateService delegateService; + @Lazy + @Autowired + private FlowAsyncUtil flowAsyncUtil; + + public Map infoData(String formId, String taskId, Map> allData) throws WorkFlowException { + Map dataAll = allData.get(taskId + "_yunzhupaas_" + formId) != null ? allData.get(taskId + "_yunzhupaas_" + formId) : serviceUtil.infoData(formId, taskId); + return dataAll; + } + + /** + * 发送消息 + * + * @param flowMsgModel + */ + public void message(FlowMsgModel flowMsgModel) throws WorkFlowException { + List messageListAll = new ArrayList<>(); + TaskEntity task = flowMsgModel.getTaskEntity(); + String taskId = task.getId(); + UserEntity user = StringUtil.isNotEmpty(task.getCreatorUserId()) ? serviceUtil.getUserInfo(task.getCreatorUserId()) : null; + flowMsgModel.setCreateUser(user); + UserEntity delegate = StringUtil.isNotEmpty(task.getDelegateUserId()) ? serviceUtil.getUserInfo(task.getDelegateUserId()) : null; + flowMsgModel.setDelegate(delegate); + Map> formData = flowMsgModel.getFormData(); + String nodeCode = flowMsgModel.getNodeCode(); + List nodeList = flowMsgModel.getNodeList(); + List operatorList = flowMsgModel.getOperatorList(); + List circulateList = flowMsgModel.getCirculateList(); + TemplateNodeEntity startNodeEntity = nodeList.stream().filter(t -> FlowNature.NodeStart.equals(t.getNodeType())).findFirst().orElse(null); + String nodeJson = startNodeEntity != null ? startNodeEntity.getNodeJson() : "{}"; + NodeModel startNode = JsonUtil.getJsonToBean(nodeJson, NodeModel.class); + //同意 + if (flowMsgModel.getApprove()) { + MsgConfig msgConfig = startNode.getApproveMsgConfig(); + TemplateNodeEntity taskNode = nodeList.stream().filter(t -> t.getNodeCode().equals(nodeCode)).findFirst().orElse(null); + NodeModel taskChildNode = JsonUtil.getJsonToBean(taskNode.getNodeJson(), NodeModel.class); + MsgConfig taskMsgConfig = taskChildNode.getApproveMsgConfig(); + if (taskMsgConfig.getOn() == 2) { + taskMsgConfig = msgConfig; + } + if (taskMsgConfig.getOn() == 3) { + taskMsgConfig.setMsgId("PZXTLC002"); + } + List messageList = new ArrayList<>(); + flowMsgModel.setOpType(FlowNature.LaunchDetail); + Map data = this.infoData(startNode.getFormId(), taskId, formData); + flowMsgModel.setData(data); + flowMsgModel.setMsgConfig(taskMsgConfig); + List taskOperatorList = new ArrayList() {{ + OperatorEntity operatorEntity = new OperatorEntity(); + operatorEntity.setTaskId(task.getId()); + operatorEntity.setHandleId(task.getCreatorUserId()); + add(operatorEntity); + }}; + FlowMsgModel msgModel = messageModel(taskOperatorList, flowMsgModel); + setMessageList(messageList, msgModel); + messageListAll.addAll(messageList); + } + // 拒绝 + if (flowMsgModel.getReject()) { + MsgConfig msgConfig = startNode.getRejectMsgConfig(); + TemplateNodeEntity taskNode = nodeList.stream().filter(t -> t.getNodeCode().equals(nodeCode)).findFirst().orElse(null); + NodeModel taskChildNode = JsonUtil.getJsonToBean(taskNode.getNodeJson(), NodeModel.class); + MsgConfig taskMsgConfig = taskChildNode.getRejectMsgConfig(); + if (taskMsgConfig.getOn() == 2) { + taskMsgConfig = msgConfig; + } + if (taskMsgConfig.getOn() == 3) { + taskMsgConfig.setMsgId("PZXTLC018"); + } + List messageList = new ArrayList<>(); + flowMsgModel.setOpType(FlowNature.LaunchDetail); + Map data = this.infoData(startNode.getFormId(), taskId, formData); + flowMsgModel.setData(data); + flowMsgModel.setMsgConfig(taskMsgConfig); + List taskOperatorList = new ArrayList() {{ + OperatorEntity operatorEntity = new OperatorEntity(); + operatorEntity.setTaskId(task.getId()); + operatorEntity.setHandleId(task.getCreatorUserId()); + add(operatorEntity); + }}; + FlowMsgModel msgModel = messageModel(taskOperatorList, flowMsgModel); + setMessageList(messageList, msgModel); + messageListAll.addAll(messageList); + } + //等待 + if (flowMsgModel.getWait()) { + MsgConfig taskMsgConfig = startNode.getWaitMsgConfig(); + if (taskMsgConfig.getOn() == 3) { + if (flowMsgModel.getTransfer()) { + taskMsgConfig.setMsgId("PZXTLC006"); + } else if (flowMsgModel.getAssign()) { + taskMsgConfig.setMsgId("PZXTLC005"); + } else if (flowMsgModel.getPress()) { + taskMsgConfig.setMsgId("PZXTLC004"); + } else { + taskMsgConfig.setMsgId("PZXTLC001"); + } + } + Map> operatorMap = operatorList.stream().collect(Collectors.groupingBy(OperatorEntity::getNodeCode)); + for (String key : operatorMap.keySet()) { + List messageList = new ArrayList<>(); + List taskOperatorList = operatorMap.get(key); + flowMsgModel.setOpType(FlowNature.WaitSign); + TemplateNodeEntity taskNode = nodeList.stream().filter(t -> t.getNodeCode().equals(key)).findFirst().orElse(null); + // 获取表单数据 + Map data = this.infoData(taskNode.getFormId(), taskId, formData); + flowMsgModel.setData(data); + flowMsgModel.setMsgConfig(taskMsgConfig); + FlowMsgModel msgModel = messageModel(taskOperatorList, flowMsgModel); + setMessageList(messageList, msgModel); + messageListAll.addAll(messageList); + for (OperatorEntity operator : taskOperatorList) { + List delegationMsg = delegationMsg(operator, msgModel); + messageListAll.addAll(delegationMsg); + } + } + } + //结束 + if (flowMsgModel.getEnd()) { + MsgConfig taskMsgConfig = startNode.getEndMsgConfig(); + if (taskMsgConfig.getOn() == 3) { + taskMsgConfig.setMsgId("PZXTLC010"); + } + List messageList = new ArrayList<>(); + flowMsgModel.setOpType(FlowNature.LaunchDetail); + Map data = this.infoData(startNode.getFormId(), taskId, formData); + flowMsgModel.setData(data); + flowMsgModel.setMsgConfig(taskMsgConfig); + List taskOperatorList = new ArrayList() {{ + OperatorEntity operatorEntity = new OperatorEntity(); + operatorEntity.setTaskId(task.getId()); + operatorEntity.setHandleId(task.getCreatorUserId()); + add(operatorEntity); + }}; + FlowMsgModel msgModel = messageModel(taskOperatorList, flowMsgModel); + setMessageList(messageList, msgModel); + messageListAll.addAll(messageList); + } + //退回 + if (flowMsgModel.getBack()) { + MsgConfig msgConfig = startNode.getBackMsgConfig(); + Map> operatorMap = operatorList.stream().collect(Collectors.groupingBy(OperatorEntity::getNodeCode)); + for (String key : operatorMap.keySet()) { + TemplateNodeEntity taskNode = nodeList.stream().filter(t -> t.getNodeCode().equals(nodeCode)).findFirst().orElse(null); + NodeModel taskChildNode = JsonUtil.getJsonToBean(taskNode.getNodeJson(), NodeModel.class); + MsgConfig taskMsgConfig = taskChildNode.getBackMsgConfig(); + if (taskMsgConfig.getOn() == 2) { + taskMsgConfig = msgConfig; + } + if (taskMsgConfig.getOn() == 3) { + taskMsgConfig.setMsgId("PZXTLC003"); + } + List messageList = new ArrayList<>(); + List taskOperatorList = operatorMap.get(key); + if (ObjectUtil.equals(flowMsgModel.getWait(), true)) { + flowMsgModel.setOpType(FlowNature.WaitSign); + } + Map data = this.infoData(taskNode.getFormId(), taskId, formData); + flowMsgModel.setData(data); + flowMsgModel.setMsgConfig(taskMsgConfig); + FlowMsgModel msgModel = messageModel(taskOperatorList, flowMsgModel); + setMessageList(messageList, msgModel); + messageListAll.addAll(messageList); + for (OperatorEntity operator : taskOperatorList) { + List delegationMsg = delegationMsg(operator, msgModel); + messageListAll.addAll(delegationMsg); + } + } + } + //抄送 + if (flowMsgModel.getCopy()) { + MsgConfig msgConfig = startNode.getCopyMsgConfig(); + Map> circulateMap = circulateList.stream().collect(Collectors.groupingBy(CirculateEntity::getNodeCode)); + for (String key : circulateMap.keySet()) { + TemplateNodeEntity taskNode = nodeList.stream().filter(t -> t.getNodeCode().equals(key)).findFirst().orElse(null); + NodeModel taskChildNode = JsonUtil.getJsonToBean(taskNode.getNodeJson(), NodeModel.class); + MsgConfig taskMsgConfig = taskChildNode.getCopyMsgConfig(); + if (taskMsgConfig.getOn() == 2) { + taskMsgConfig = msgConfig; + } + if (taskMsgConfig.getOn() == 3) { + taskMsgConfig.setMsgId("PZXTLC007"); + } + List messageList = new ArrayList<>(); + List taskOperatorList = new ArrayList<>(); + for (CirculateEntity circulateEntity : circulateMap.get(key)) { + OperatorEntity operatorEntity = JsonUtil.getJsonToBean(circulateEntity, OperatorEntity.class); + operatorEntity.setHandleId(circulateEntity.getUserId()); + taskOperatorList.add(operatorEntity); + } + flowMsgModel.setOpType(FlowNature.Circulate); + Map data = this.infoData(taskNode.getFormId(), taskId, formData); + flowMsgModel.setData(data); + flowMsgModel.setMsgConfig(taskMsgConfig); + FlowMsgModel msgModel = messageModel(taskOperatorList, flowMsgModel); + setMessageList(messageList, msgModel); + messageListAll.addAll(messageList); + } + } + //子流程 + if (flowMsgModel.getLaunch()) { + MsgConfig msgConfig = startNode.getLaunchMsgConfig(); + Map> operatorMap = operatorList.stream().collect(Collectors.groupingBy(OperatorEntity::getNodeCode)); + for (String key : operatorMap.keySet()) { + TemplateNodeEntity taskNode = nodeList.stream().filter(t -> t.getNodeCode().equals(key)).findFirst().orElse(null); + NodeModel taskChildNode = JsonUtil.getJsonToBean(taskNode.getNodeJson(), NodeModel.class); + MsgConfig taskMsgConfig = taskChildNode.getLaunchMsgConfig(); + if (taskMsgConfig.getOn() == 2) { + taskMsgConfig = msgConfig; + } + if (taskMsgConfig.getOn() == 3) { + taskMsgConfig.setMsgId("PZXTLC011"); + } + List messageList = new ArrayList<>(); + List taskOperatorList = operatorMap.get(key); + Map data = this.infoData(taskNode.getFormId(), taskId, formData); + flowMsgModel.setData(data); + flowMsgModel.setMsgConfig(taskMsgConfig); + flowMsgModel.setOpType(taskChildNode.getAutoSubmit().equals(1) ? FlowNature.LaunchDetail : FlowNature.LaunchCreate); + FlowMsgModel msgModel = messageModel(taskOperatorList, flowMsgModel); + setMessageList(messageList, msgModel); + messageListAll.addAll(messageList); + } + } + //发起人 + if (flowMsgModel.getStart()) { + MsgConfig msgConfig = startNode.getBackMsgConfig(); + if (msgConfig.getOn() == 3) { + msgConfig.setMsgId("PZXTLC003"); + } + List messageList = new ArrayList<>(); + flowMsgModel.setOpType(FlowNature.LaunchDetail); + Map data = this.infoData(startNode.getFormId(), taskId, formData); + flowMsgModel.setData(data); + List meOperatorList = new ArrayList() {{ + OperatorEntity operatorEntity = new OperatorEntity(); + operatorEntity.setTaskId(taskId); + operatorEntity.setHandleId(task.getCreatorUserId()); + add(operatorEntity); + }}; + FlowMsgModel msgModel = messageModel(meOperatorList, flowMsgModel); + setMessageList(messageList, msgModel); + messageListAll.addAll(messageList); + } + //超时 + if (flowMsgModel.getOvertime()) { + MsgConfig msgConfig = startNode.getOverTimeMsgConfig(); + Map> operatorMap = operatorList.stream().collect(Collectors.groupingBy(OperatorEntity::getNodeCode)); + for (String key : operatorMap.keySet()) { + TemplateNodeEntity taskNode = nodeList.stream().filter(t -> t.getNodeCode().equals(key)).findFirst().orElse(null); + NodeModel taskChildNode = JsonUtil.getJsonToBean(taskNode.getNodeJson(), NodeModel.class); + MsgConfig taskMsgConfig = taskChildNode.getOverTimeMsgConfig(); + if (taskMsgConfig.getOn() == 2) { + taskMsgConfig = msgConfig; + } + if (taskMsgConfig.getOn() == 3) { + taskMsgConfig.setMsgId("PZXTLC009"); + } + List messageList = new ArrayList<>(); + List taskOperatorList = operatorMap.get(key); + flowMsgModel.setOpType(FlowNature.WaitSign); + Map data = this.infoData(taskNode.getFormId(), taskId, formData); + flowMsgModel.setData(data); + flowMsgModel.setMsgConfig(taskMsgConfig); + FlowMsgModel msgModel = messageModel(taskOperatorList, flowMsgModel); + setMessageList(messageList, msgModel); + messageListAll.addAll(messageList); + for (OperatorEntity operator : taskOperatorList) { + List delegationMsg = delegationMsg(operator, flowMsgModel); + messageListAll.addAll(delegationMsg); + } + } + } + //提醒 + if (flowMsgModel.getNotice()) { + MsgConfig msgConfig = startNode.getNoticeMsgConfig(); + Map> operatorMap = operatorList.stream().collect(Collectors.groupingBy(OperatorEntity::getNodeCode)); + for (String key : operatorMap.keySet()) { + TemplateNodeEntity taskNode = nodeList.stream().filter(t -> t.getNodeCode().equals(key)).findFirst().orElse(null); + NodeModel taskChildNode = JsonUtil.getJsonToBean(taskNode.getNodeJson(), NodeModel.class); + MsgConfig taskMsgConfig = taskChildNode.getNoticeMsgConfig(); + if (taskMsgConfig.getOn() == 2) { + taskMsgConfig = msgConfig; + } + if (taskMsgConfig.getOn() == 3) { + taskMsgConfig.setMsgId("PZXTLC008"); + } + List messageList = new ArrayList<>(); + List taskOperatorList = operatorMap.get(key); + flowMsgModel.setOpType(FlowNature.WaitSign); + Map data = this.infoData(taskNode.getFormId(), taskId, formData); + flowMsgModel.setData(data); + flowMsgModel.setMsgConfig(taskMsgConfig); + FlowMsgModel msgModel = messageModel(taskOperatorList, flowMsgModel); + setMessageList(messageList, msgModel); + messageListAll.addAll(messageList); + for (OperatorEntity operator : taskOperatorList) { + List delegationMsg = delegationMsg(operator, msgModel); + messageListAll.addAll(delegationMsg); + } + } + } + //评论 + if (flowMsgModel.getComment()) { + MsgConfig msgConfig = startNode.getCommentMsgConfig(); + if (msgConfig.getOn() == 3) { + msgConfig.setMsgId("PZXTLC017"); + } + Map> operatorMap = operatorList.stream().collect(Collectors.groupingBy(OperatorEntity::getNodeCode)); + for (String key : operatorMap.keySet()) { + List messageList = new ArrayList<>(); + List taskOperatorList = operatorMap.get(key); + flowMsgModel.setOpType(FlowNature.Circulate); + TemplateNodeEntity taskNode = nodeList.stream().filter(t -> t.getNodeCode().equals(key)).findFirst().orElse(null); + Map data = this.infoData(taskNode.getFormId(), taskId, formData); + flowMsgModel.setData(data); + flowMsgModel.setMsgConfig(msgConfig); + FlowMsgModel msgModel = messageModel(taskOperatorList, flowMsgModel); + setMessageList(messageList, msgModel); + messageListAll.addAll(messageList); + } + //抄送 + Map> circulateMap = circulateList.stream().collect(Collectors.groupingBy(CirculateEntity::getNodeCode)); + for (String key : circulateMap.keySet()) { + TemplateNodeEntity taskNode = nodeList.stream().filter(t -> t.getNodeCode().equals(key)).findFirst().orElse(null); + List messageList = new ArrayList<>(); + List taskOperatorList = new ArrayList<>(); + for (CirculateEntity circulateEntity : circulateMap.get(key)) { + OperatorEntity operatorEntity = JsonUtil.getJsonToBean(circulateEntity, OperatorEntity.class); + operatorEntity.setHandleId(circulateEntity.getUserId()); + taskOperatorList.add(operatorEntity); + } + flowMsgModel.setOpType(FlowNature.Circulate); + Map data = this.infoData(taskNode.getFormId(), taskId, formData); + flowMsgModel.setData(data); + flowMsgModel.setMsgConfig(msgConfig); + FlowMsgModel msgModel = messageModel(taskOperatorList, flowMsgModel); + setMessageList(messageList, msgModel); + messageListAll.addAll(messageList); + } + if (flowMsgModel.getStartHandId()) { + List messageList = new ArrayList<>(); + flowMsgModel.setOpType(FlowNature.LaunchDetail); + Map data = this.infoData(startNode.getFormId(), taskId, formData); + flowMsgModel.setData(data); + List meOperatorList = new ArrayList() {{ + OperatorEntity operatorEntity = new OperatorEntity(); + operatorEntity.setTaskId(task.getId()); + operatorEntity.setHandleId(task.getCreatorUserId()); + add(operatorEntity); + }}; + FlowMsgModel msgModel = messageModel(meOperatorList, flowMsgModel); + setMessageList(messageList, msgModel); + messageListAll.addAll(messageList); + } + } + for (SentMessageForm sentMessageForm : messageListAll) { + sentMessageForm.setFlowName(task.getFullName()); + sentMessageForm.setUserName(user != null ? user.getRealName() : ""); + } + serviceUtil.sendMessage(messageListAll); + } + + /** + * 组装接口数据 + * + * @return + */ + public Map parameterMap(Map data, List templateJsonModelList, RecordEntity record, TaskEntity task) { + List creator = ImmutableList.of( + FlowConstant.LAUNCH_USER_NAME, + FlowConstant.CREATORUSERNAME, + FlowConstant.MANDATOR + ); + List mandatary = ImmutableList.of(FlowConstant.MANDATARY); + List templateList = templateJsonModelList.stream().filter(e -> Objects.equals(e.getSourceType(), TemplateEnum.System.getCode())).collect(Collectors.toList()); + boolean isCreator = templateList.stream().anyMatch(e -> creator.contains(e.getRelationField())); + UserEntity createUser = null; + if (isCreator) { + createUser = serviceUtil.getUserInfo(task.getCreatorUserId()); + } + boolean isMandatary = templateList.stream().anyMatch(e -> mandatary.contains(e.getRelationField())); + UserEntity delegate = null; + if (isMandatary) { + delegate = StringUtil.isNotEmpty(task.getDelegateUserId()) ? serviceUtil.getUserInfo(task.getDelegateUserId()) : null; + } + return parameterMap(data, templateJsonModelList, record, task, createUser, delegate); + } + + /** + * 组装接口数据 + * + * @return + */ + public Map parameterMap(Map data, List templateJsonModelList, RecordEntity record, TaskEntity task, UserEntity createUser, UserEntity delegate) { + Map parameterMap = new HashMap<>(); + for (TemplateJsonModel templateJsonModel : templateJsonModelList) { + String fieldId = templateJsonModel.getField(); + String msgTemplateId = templateJsonModel.getMsgTemplateId(); + String relationField = templateJsonModel.getRelationField(); + String dataValue = data.get(relationField) != null ? String.valueOf(data.get(relationField)) : null; + String dataFieldValue = relationField; + String dataJson = Objects.equals(TemplateEnum.Field.getCode(), templateJsonModel.getSourceType()) ? dataValue : dataFieldValue; + FlowEventModel eventModel = FlowEventModel.builder().data(data).dataJson(dataJson).record(record).templateJson(templateJsonModel).taskEntity(task).createUser(createUser).delegate(delegate).build(); + dataJson = data(eventModel); + parameterMap.put(StringUtil.isNotEmpty(msgTemplateId) ? msgTemplateId : "" + fieldId, dataJson); + } + return parameterMap; + } + + /** + * @return + */ + private String data(FlowEventModel eventModel) { + RecordEntity record = eventModel.getRecord(); + TemplateJsonModel templateJson = eventModel.getTemplateJson(); + String relationField = StringUtil.isNotEmpty(templateJson.getRelationField()) ? templateJson.getRelationField() : ""; + List typeList = ImmutableList.of(TemplateEnum.Field.getCode(), TemplateEnum.System.getCode()); + boolean isType = typeList.contains(templateJson.getSourceType()); + String dataJson = eventModel.getDataJson(); + Map data = eventModel.getData(); + UserInfo userInfo = UserProvider.getUser(); + String userId = userInfo.getUserId(); + String userName = userInfo.getUserName() != null ? userInfo.getUserName() : ""; + String value = dataJson; + TaskEntity taskEntity = eventModel.getTaskEntity(); + if (isType) { + switch (relationField) { + case FlowConstant.FLOW_ID: + value = taskEntity.getFlowId(); + break; + case FlowConstant.TASK_ID: + value = taskEntity.getId(); + break; + case FlowConstant.TASK_NODE_ID: + value = record.getNodeCode(); + break; + case FlowConstant.FLOW_FULL_NAME: + value = taskEntity.getFlowName(); + break; + case FlowConstant.TASK_FULL_NAME: + value = taskEntity.getFullName(); + break; + case FlowConstant.LAUNCH_USER_ID: + value = taskEntity.getCreatorUserId(); + break; + case FlowConstant.LAUNCH_USER_NAME: + case FlowConstant.CREATORUSERNAME: + case FlowConstant.MANDATOR: +// UserEntity createUser = StringUtil.isNotBlank(taskEntity.getCreatorUserId()) ? serviceUtil.getUserInfo(taskEntity.getCreatorUserId()) : null; + UserEntity createUser = eventModel.getCreateUser(); + value = createUser != null ? createUser.getRealName() : ""; + break; + case FlowConstant.FLOW_OPERATOR_USER_ID: + value = userId; + break; + case FlowConstant.FLOW_OPERATOR_USER_NAME: + value = userName; + break; + case FlowConstant.SENDTIME: + value = DateUtil.getNow(); + break; + case FlowConstant.MANDATARY: +// UserEntity delegate = StringUtil.isNotBlank(taskEntity.getDelegateUserId()) ? serviceUtil.getUserInfo(taskEntity.getDelegateUserId()) : null; + UserEntity delegate = eventModel.getDelegate(); + value = delegate != null ? delegate.getRealName() : ""; + break; + default: + String[] model = StringUtil.isNotEmpty(relationField) ? relationField.split("-") : new String[]{}; + if (model.length > 1) { + Object dataList = data.get(model[0]); + if (dataList instanceof List) { + List> listAll = (List>) dataList; + List list = new ArrayList<>(); + for (Map objectMap : listAll) { + list.add(objectMap.get(model[1])); + } + value = String.valueOf(list); + } + } + break; + } + } + return value; + } + + private void setMessageList(List messageList, FlowMsgModel flowMsgModel) { + HashMap data = new HashMap<>(flowMsgModel.getData()); + MsgConfig msgConfig = flowMsgModel.getMsgConfig() != null ? flowMsgModel.getMsgConfig() : new MsgConfig(); + List userList = flowMsgModel.getUserList(); + UserInfo userInfo = flowMsgModel.getFlowModel().getUserInfo(); + TaskEntity task = flowMsgModel.getTaskEntity(); + UserEntity createUser = flowMsgModel.getCreateUser(); + UserEntity delegate = flowMsgModel.getDelegate(); + if (!userList.isEmpty()) { + String templateId = msgConfig.getOn() == 0 ? "0" : msgConfig.getMsgId(); + boolean sysMessage = msgConfig.getOn() != 0; + //解析发送配置json,获取消息模板参数 + List templateJson = new ArrayList<>(); + for (SendConfigJson configJson : msgConfig.getTemplateJson()) { + List paramJson = configJson.getParamJson(); + templateJson.addAll(paramJson); + List list = ImmutableList.of(FlowConstant.MANDATOR, FlowConstant.MANDATARY, FlowConstant.CREATORUSERNAME, FlowConstant.SENDTIME); + for (String field : list) { + TemplateJsonModel jsonModel = new TemplateJsonModel(); + jsonModel.setMsgTemplateId(configJson.getId()); + jsonModel.setRelationField(field); + jsonModel.setField(field); + jsonModel.setSourceType(TemplateEnum.System.getCode()); + templateJson.add(jsonModel); + } + } + SentMessageForm sentMessageForm = new SentMessageForm(); + sentMessageForm.setSysMessage(sysMessage); + sentMessageForm.setTemplateId(templateId); + sentMessageForm.setToUserIds(userList); + Map parameterMap = new HashMap<>(); + RecordEntity record = new RecordEntity(); + record.setNodeCode(flowMsgModel.getNodeCode()); + for (TemplateJsonModel templateJsonModel : templateJson) { + String fieldId = templateJsonModel.getField(); + String msgTemplateId = templateJsonModel.getMsgTemplateId(); + String relationField = templateJsonModel.getRelationField(); + String dataValue = data.get(relationField) != null ? String.valueOf(data.get(relationField)) : ""; + String dataFieldValue = relationField; + String dataJson = Objects.equals(TemplateEnum.Field.getCode(), templateJsonModel.getSourceType()) ? dataValue : dataFieldValue; + FlowEventModel eventModel = FlowEventModel.builder().data(data).dataJson(dataJson).record(record).templateJson(templateJsonModel) + .taskEntity(task).createUser(createUser).delegate(delegate).build(); + dataJson = data(eventModel); + parameterMap.put(msgTemplateId + fieldId, dataJson); + } + data.putAll(parameterMap); + sentMessageForm.setUserInfo(userInfo); + sentMessageForm.setParameterMap(data); + sentMessageForm.setContentMsg(flowMsgModel.getContMsg()); + sentMessageForm.setTitle(task.getFullName()); + messageList.add(sentMessageForm); + } + } + + private FlowMsgModel messageModel(List taskOperatorList, FlowMsgModel flowMsgModel) { + FlowMsgModel msgModel = JsonUtil.getJsonToBean(flowMsgModel, FlowMsgModel.class); + List userList = new ArrayList<>(); + TaskEntity task = flowMsgModel.getTaskEntity(); + Map contMsg = new HashMap<>(); + for (OperatorEntity taskOperator : taskOperatorList) { + ContModel contModel = new ContModel(); + contModel.setFlowId(task.getFlowId()); + contModel.setOperatorId(taskOperator.getId()); + contModel.setTaskId(task.getId()); + contModel.setOpType(flowMsgModel.getOpType()); + if (StringUtil.equals(flowMsgModel.getOpType(), FlowNature.WaitSign)) { + if (null == taskOperator.getSignTime() && null == taskOperator.getStartHandleTime() && null == taskOperator.getHandleStatus()) { + contModel.setOpType(FlowNature.WaitSign); + } else if (null != taskOperator.getSignTime() && null == taskOperator.getStartHandleTime() && null == taskOperator.getHandleStatus()) { + contModel.setOpType(FlowNature.Todo); + } else if (null != taskOperator.getSignTime() && null != taskOperator.getStartHandleTime() && null == taskOperator.getHandleStatus()) { + contModel.setOpType(FlowNature.Doing); + } + } + contMsg.put(taskOperator.getHandleId(), JsonUtil.getObjectToString(contModel)); + userList.add(taskOperator.getHandleId()); + } + msgModel.setUserList(userList); + msgModel.setContMsg(contMsg); + return msgModel; + } + + private List delegationMsg(OperatorEntity operator, FlowMsgModel flowMsgModel) { + List messageList = new ArrayList<>(); + TaskEntity task = flowMsgModel.getTaskEntity(); + if (task != null) { + // 获取委托人 + List userList = delegateService.getToUser(operator.getHandleId(), task.getFlowId()); + List operatorList = new ArrayList<>(); + for (String user : userList) { + OperatorEntity delegate = JsonUtil.getJsonToBean(operator, OperatorEntity.class); + delegate.setHandleId(user); + operatorList.add(delegate); + FlowMsgModel msgModel = messageModel(operatorList, flowMsgModel); + setMessageList(messageList, msgModel); + } + } + return messageList; + } + + + //--------------------------------------委托消息------------------------------------------------------ + public void delegateMsg(DelegateModel flowDelegate) { + SysConfigModel sysConfig = serviceUtil.getSysConfig(); + Integer ack = flowDelegate.getDelegate() ? sysConfig.getDelegateAck() : sysConfig.getProxyAck(); + flowDelegate.setAck(ack); + flowAsyncUtil.delegateMsg(flowDelegate); + } + + /** + * 流程事件 + * + * @param status 事件状态 1.发起 2.结束 3.发起撤回 4同意 5拒绝 6节点撤回 7 超时 8提醒 9退回 + * @param nodeModel 节点数据 + * @param record 审批数据 + */ + public void event(Integer status, NodeModel nodeModel, RecordEntity record, FlowModel flowModel) { + if (nodeModel != null) { + boolean on = false; + String interId = ""; + List templateJsonModelList = new ArrayList<>(); + FuncConfig config = null; + switch (status) { + case 1: + config = nodeModel.getInitFuncConfig(); + break; + case 2: + config = nodeModel.getEndFuncConfig(); + break; + case 3: + config = nodeModel.getFlowRecallFuncConfig(); + break; + case 4: + config = nodeModel.getApproveFuncConfig(); + break; + case 5: + config = nodeModel.getRejectFuncConfig(); + break; + case 6: + config = nodeModel.getRecallFuncConfig(); + break; + case 7: + config = nodeModel.getOvertimeFuncConfig(); + break; + case 8: + config = nodeModel.getNoticeFuncConfig(); + break; + case 9: + config = nodeModel.getBackFuncConfig(); + break; + default: + break; + } + if (config != null) { + on = config.getOn(); + interId = config.getInterfaceId(); + templateJsonModelList = config.getTemplateJson(); + } + if (on && StringUtil.isNotEmpty(interId)) { + Map data = flowModel.getFormData(); + TaskEntity taskEntity = flowModel.getTaskEntity(); +// UserEntity createUser = null; +// UserEntity delegate = null; +// if (taskEntity != null) { +// createUser = serviceUtil.getUserInfo(taskEntity.getCreatorUserId()); +// delegate = StringUtil.isNotEmpty(taskEntity.getDelegateUserId()) ? serviceUtil.getUserInfo(taskEntity.getDelegateUserId()) : null; +// } + Map parameterMap = parameterMap(data, templateJsonModelList, record, taskEntity); + ActionResult result = serviceUtil.infoToId(interId, parameterMap); + if (null == result || Objects.equals(400, result.getCode())) { + log.error("接口调用失败: {}", result); + } + } + } + } + + // 接口调用的参数需转为字符串 + public Map intefaceParameterMap(Map data, List templateJsonModelList, RecordEntity record, TaskEntity task, UserEntity createUser, UserEntity delegate) { + Map parameterMap = new HashMap<>(); + for (TemplateJsonModel templateJsonModel : templateJsonModelList) { + String fieldId = templateJsonModel.getField(); + String msgTemplateId = templateJsonModel.getMsgTemplateId(); + String relationField = templateJsonModel.getRelationField(); + String dataValue = data.get(relationField) != null ? JsonUtil.getObjectToString(data.get(relationField)) : null; + String dataFieldValue = relationField; + String dataJson = Objects.equals(TemplateEnum.Field.getCode(), templateJsonModel.getSourceType()) ? dataValue : dataFieldValue; + FlowEventModel eventModel = FlowEventModel.builder().data(data).dataJson(dataJson).record(record).templateJson(templateJsonModel).taskEntity(task).createUser(createUser).delegate(delegate).build(); + dataJson = data(eventModel); + parameterMap.put(StringUtil.isNotEmpty(msgTemplateId) ? msgTemplateId : "" + fieldId, dataJson); + } + return parameterMap; + } +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/NodeUtil.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/NodeUtil.java new file mode 100644 index 0000000..276bc53 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/NodeUtil.java @@ -0,0 +1,335 @@ +package com.yunzhupaas.flowable.util; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.google.common.collect.ImmutableList; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.*; +import com.yunzhupaas.flowable.enums.DivideRuleEnum; +import com.yunzhupaas.flowable.enums.NodeEnum; +import com.yunzhupaas.flowable.enums.OperatorStateEnum; +import com.yunzhupaas.flowable.enums.TaskStatusEnum; +import com.yunzhupaas.flowable.model.flowable.FlowAbleUrl; +import com.yunzhupaas.flowable.model.flowable.FlowableHistoricModel; +import com.yunzhupaas.flowable.model.task.FlowMethod; +import com.yunzhupaas.flowable.model.task.FlowModel; +import com.yunzhupaas.flowable.model.templatenode.TaskNodeModel; +import com.yunzhupaas.flowable.model.templatenode.nodejson.AuxiliaryInfo; +import com.yunzhupaas.flowable.model.templatenode.nodejson.AuxiliaryInfoConfig; +import com.yunzhupaas.flowable.model.templatenode.nodejson.NodeModel; +import com.yunzhupaas.flowable.model.util.FlowNature; +import com.yunzhupaas.flowable.service.OperatorService; +import com.yunzhupaas.flowable.service.RevokeService; +import com.yunzhupaas.flowable.service.TaskService; +import com.yunzhupaas.flowable.service.TriggerRecordService; +import com.yunzhupaas.model.document.FlowFileModel; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/29 10:29 + */ +@Component +public class NodeUtil { + @Autowired + private FlowAbleUrl flowAbleUrl; + @Autowired + private ServiceUtil serviceUtil; + @Autowired + private TaskUtil taskUtil; + @Autowired + private OperatorService operatorService; + @Autowired + private OperatorUtil operatorUtil; + @Autowired + private TaskService taskService; + @Autowired + private RevokeService revokeService; + @Autowired + private TriggerRecordService triggerRecordService; + + public List getNodeList(FlowModel flowModel) throws WorkFlowException { + List nodeList = new ArrayList<>(); + TaskEntity taskEntity = flowModel.getTaskEntity(); + // 终止后 任务详情的流程图,需全部置灰 + if (ObjectUtil.equals(TaskStatusEnum.CANCEL.getCode(), taskEntity.getStatus())) { + return nodeList; + } + List nodeEntities = flowModel.getNodeEntityList(); + // 当前节点 + String currentNodeCode = StringUtil.isNotEmpty(taskEntity.getCurrentNodeCode()) + ? taskEntity.getCurrentNodeCode() + : ""; + List currentNodes = new ArrayList<>(Arrays.asList(currentNodeCode.split(","))); + // 未经过的节点 + List tobePass = flowAbleUrl.getTobePass(taskEntity.getInstanceId()); + if (currentNodeCode.equals(FlowNature.END_CODE)) { + currentNodes = nodeEntities.stream() + .filter(t -> NodeEnum.end.getType().equals(t.getNodeType())).map(TemplateNodeEntity::getNodeCode) + .collect(Collectors.toList()); + } + // 经过的节点 + FlowMethod flowMethod = new FlowMethod(); + flowMethod.setTobePass(tobePass); + flowMethod.setCurrentNodes(currentNodes); + flowMethod.setTaskId(taskEntity.getId()); + flowMethod.setTaskEntity(taskEntity); + flowMethod.setNodeEntityList(nodeEntities); + List passed = this.getPassed(flowMethod); + TemplateNodeEntity start = nodeEntities.stream().filter(e -> e.getNodeType().equals(NodeEnum.start.getType())) + .findFirst().orElse(null); + if (start != null) { + passed.add(start.getNodeCode()); + } + + List triggerRecordList = triggerRecordService.getListByTaskId(taskEntity.getId()); + + List typeList = ImmutableList.of(NodeEnum.global.getType(), NodeEnum.connect.getType(), "confluence", + "gateway"); + List divideList = Arrays.stream(DivideRuleEnum.values()).map(DivideRuleEnum::getType) + .collect(Collectors.toList()); + divideList.addAll(typeList); + + flowMethod.setFlowModel(flowModel); + flowMethod.setErrorRule(false); + flowMethod.setExtraRule(true); + + // 节点 (-1没有经过,0.经过 1.当前 2.未经过) + for (TemplateNodeEntity node : nodeEntities) { + String nodeCode = node.getNodeCode(); + // 跳过全局节点、连接线 + if (divideList.contains(node.getNodeType())) { + continue; + } + TaskNodeModel model = JsonUtil.getJsonToBean(node, TaskNodeModel.class); + // 节点名称 + NodeModel nodeModel = JsonUtil.getJsonToBean(node.getNodeJson(), NodeModel.class); + model.setNodeName(nodeModel.getNodeName()); + if (CollectionUtil.isNotEmpty(currentNodes)) { + if (currentNodes.contains(nodeCode)) { + model.setType("1"); + if (NodeEnum.end.getType().equals(node.getNodeType())) { + model.setType("0"); + } + } + } + if (CollectionUtil.isNotEmpty(passed)) { + if (passed.contains(nodeCode)) { + model.setType("0"); + } + } + TriggerRecordEntity triggerRecord = triggerRecordList.stream() + .filter(e -> ObjectUtil.equals(e.getNodeCode(), nodeModel.getNodeId())).findFirst().orElse(null); + if (null != triggerRecord) { + String type = "1"; + if (ObjectUtil.equals(triggerRecord.getStatus(), 0)) { + type = "0"; + } else if (ObjectUtil.equals(triggerRecord.getStatus(), 1)) { + type = "3"; + } + model.setType(type); + } + + List userNameList = new ArrayList<>(); + + if (StringUtil.equals(node.getNodeType(), NodeEnum.start.getType())) { + List userIds = new ArrayList<>(); + userIds.add(taskEntity.getCreatorUserId()); + List users = serviceUtil.getUserName(userIds); + UserEntity user = users.get(0); + userNameList.add(user.getRealName() + "/" + user.getAccount()); + if (!TaskStatusEnum.TO_BE_SUBMIT.getCode().equals(taskEntity.getStatus())) { + model.setType("0"); + } + } else if (StringUtil.equals(node.getNodeType(), NodeEnum.subFlow.getType())) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TaskEntity::getParentId, taskEntity.getId()).eq(TaskEntity::getSubCode, + node.getNodeCode()); + List list = taskService.list(queryWrapper); + List userIds; + if (CollectionUtil.isNotEmpty(list)) { + userIds = list.stream().map(TaskEntity::getCreatorUserId).collect(Collectors.toList()); + } else { + flowMethod.setNodeEntity(node); + userIds = taskUtil.userListAll(flowMethod); + } + List users = serviceUtil.getUserName(userIds); + if (CollectionUtil.isNotEmpty(users)) { + for (UserEntity user : users) { + userNameList.add(user.getRealName() + "/" + user.getAccount()); + } + } + } else if (StringUtil.equals(node.getNodeType(), NodeEnum.approver.getType()) + || StringUtil.equals(node.getNodeType(), NodeEnum.processing.getType())) { + List userIds; + List operatorList = operatorUtil.getByNodeCode(taskEntity.getId(), node.getNodeCode()); + + Integer counterSign = nodeModel.getCounterSign(); + + // 获取生成经办的人 + List statusList = ImmutableList.of(OperatorStateEnum.Revoke.getCode(), + OperatorStateEnum.AddSign.getCode(), OperatorStateEnum.Assist.getCode()); + List list = operatorList.stream() + .filter(e -> !statusList.contains(e.getStatus()) && ObjectUtil.equals(e.getParentId(), "0")) + .collect(Collectors.toList()); + userIds = list.stream().map(OperatorEntity::getHandleId).collect(Collectors.toList()); + // 依次审批 + if (counterSign.equals(FlowNature.ImproperApprover)) { + OperatorEntity last = list.stream().filter(e -> e.getCompletion().equals(0)).findFirst() + .orElse(null); + if (null != last && StringUtil.isNotBlank(last.getHandleAll())) { + String[] split = last.getHandleAll().split(","); + userIds = Arrays.stream(split).collect(Collectors.toList()); + } + } + + // 经办处理人的id为0,为系统自动通过 + if (userIds.contains(FlowNature.SYSTEM_CODE)) { + // model.setUserName(FlowNature.SYSTEM_NAME); + nodeList.add(model); + continue; + } + if (CollectionUtil.isEmpty(userIds)) { + flowMethod.setNodeEntity(node); + userIds = taskUtil.userListAll(flowMethod); + } + if (CollectionUtil.isEmpty(userIds)) { + nodeList.add(model); + continue; + } + userIds = userIds.stream().distinct().sorted().collect(Collectors.toList()); + List users = serviceUtil.getUserName(userIds); + + if (CollectionUtil.isNotEmpty(users)) { + for (String userId : userIds) { + UserEntity user = users.stream().filter(e -> e.getId().equals(userId)).findFirst().orElse(null); + if (null != user) { + userNameList.add(user.getRealName() + "/" + user.getAccount()); + } + } + } + } + model.setUserName(String.join(",", userNameList)); + nodeList.add(model); + } + return nodeList; + } + + /** + * 经过的节点 + */ + public List getPassed(FlowMethod flowMethod) { + List tobePass = flowMethod.getTobePass(); + List currentNodes = flowMethod.getCurrentNodes(); + TaskEntity taskEntity = flowMethod.getTaskEntity(); + String taskId = flowMethod.getTaskId(); + List nodeEntityList = flowMethod.getNodeEntityList(); + List resList = new ArrayList<>(); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(OperatorEntity::getTaskId, taskId).ne(OperatorEntity::getStatus, + OperatorStateEnum.Futility.getCode()); + List operatorList = operatorService.list(wrapper); + if (CollectionUtil.isNotEmpty(operatorList)) { + List nodeCodes = operatorList.stream().map(OperatorEntity::getNodeCode) + .filter(e -> !currentNodes.contains(e)).collect(Collectors.toList()); + resList.addAll(nodeCodes); + } + + RevokeEntity revokeEntity = revokeService.getRevokeTask(taskEntity.getId()); + if (null != revokeEntity) { + taskId = revokeEntity.getTaskId(); + } + if (!ObjectUtil.equals(TaskStatusEnum.BACKED.getCode(), taskEntity.getStatus())) { + QueryWrapper taskWrapper = new QueryWrapper<>(); + taskWrapper.lambda().eq(TaskEntity::getParentId, taskId); + List subFlowList = taskService.list(taskWrapper); + List historic = new ArrayList<>(); + try { + historic = flowAbleUrl.getHistoric(taskEntity.getInstanceId()).stream() + .map(FlowableHistoricModel::getCode).collect(Collectors.toList()); + } catch (Exception e) { + e.printStackTrace(); + } + if (CollectionUtil.isNotEmpty(subFlowList)) { + List subCodes = subFlowList.stream().map(TaskEntity::getSubCode) + .filter(e -> !currentNodes.contains(e) && !tobePass.contains(e)) + .collect(Collectors.toList()); + if (null != revokeEntity) { + subCodes = subCodes.stream().filter(historic::contains).collect(Collectors.toList()); + } + resList.addAll(subCodes); + } + // 撤销会跳过办理节点 + if (null != revokeEntity) { + List finalHistoric = historic; + List processingList = nodeEntityList.stream() + .filter(e -> ObjectUtil.equals(e.getNodeType(), NodeEnum.processing.getType()) + && !currentNodes.contains(e.getNodeCode()) && finalHistoric.contains(e.getNodeCode())) + .map(TemplateNodeEntity::getNodeCode).collect(Collectors.toList()); + if (CollectionUtil.isNotEmpty(processingList)) { + resList.addAll(processingList); + } + } + } + + return resList.stream().distinct().collect(Collectors.toList()); + } + + /** + * 辅助信息 添加归档文件信息 + */ + public void setFlowFile(NodeModel currentNode, TaskEntity taskEntity, Map nodeProperties) { + List auxiliaryList = currentNode.getAuxiliaryInfo(); + if (auxiliaryList.isEmpty()) { + return; + } + long count = auxiliaryList.stream().filter(e -> ObjectUtil.equals(e.getConfig().getOn(), 0)).count(); + if (count == auxiliaryList.size()) { + nodeProperties.put("auxiliaryInfo", null); + return; + } + AuxiliaryInfo auxiliary = auxiliaryList.stream().filter(e -> ObjectUtil.equals(e.getId(), 3)).findFirst() + .orElse(null); + if (null == auxiliary) { + return; + } + AuxiliaryInfoConfig auxiliaryConfig = auxiliary.getConfig(); + if (!ObjectUtil.equals(auxiliaryConfig.getOn(), 1)) { + return; + } + String templateId = taskEntity.getTemplateId(); + FlowFileModel flowFileModel = FlowFileModel.builder().templateId(templateId) + .userId(UserProvider.getLoginUserId()) + .dataRange(auxiliaryConfig.getDataRange()).build(); + List> flowFile = serviceUtil.getFlowFile(flowFileModel); + if (CollectionUtil.isEmpty(flowFile)) { + return; + } + Object auxiliaryInfo = nodeProperties.get("auxiliaryInfo"); + if (auxiliaryInfo instanceof List) { + List> list = (List>) auxiliaryInfo; + for (Map map : list) { + if (ObjectUtil.equals(map.get("id"), 3)) { + Map config = (Map) map.get("config"); + config.put("fileList", flowFile); + } + } + } + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/OperatorUtil.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/OperatorUtil.java new file mode 100644 index 0000000..7ec98e5 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/OperatorUtil.java @@ -0,0 +1,2141 @@ +package com.yunzhupaas.flowable.util; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.google.common.collect.ImmutableList; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.constant.PermissionConst; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.*; +import com.yunzhupaas.flowable.enums.NodeEnum; +import com.yunzhupaas.flowable.enums.OperatorStateEnum; +import com.yunzhupaas.flowable.enums.RecordEnum; +import com.yunzhupaas.flowable.enums.TaskStatusEnum; +import com.yunzhupaas.flowable.job.FlowJobUtil; +import com.yunzhupaas.flowable.model.flowable.*; +import com.yunzhupaas.flowable.model.message.FlowMsgModel; +import com.yunzhupaas.flowable.model.operator.AddSignModel; +import com.yunzhupaas.flowable.model.operator.ReducePagination; +import com.yunzhupaas.flowable.model.operator.ReduceUserModel; +import com.yunzhupaas.flowable.model.record.NodeRecordModel; +import com.yunzhupaas.flowable.model.task.FlowMethod; +import com.yunzhupaas.flowable.model.task.FlowModel; +import com.yunzhupaas.flowable.model.task.SubParameterModel; +import com.yunzhupaas.flowable.model.templatenode.FlowErrorModel; +import com.yunzhupaas.flowable.model.templatenode.nodejson.*; +import com.yunzhupaas.flowable.model.trigger.ExecuteAsyncModel; +import com.yunzhupaas.flowable.model.trigger.ExecuteModel; +import com.yunzhupaas.flowable.model.util.*; +import com.yunzhupaas.flowable.service.*; +import com.yunzhupaas.permission.entity.OrganizeEntity; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.entity.UserRelationEntity; +import com.yunzhupaas.util.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/24 20:38 + */ +@Slf4j +@Component +public class OperatorUtil { + @Autowired + private OperatorService operatorService; + @Autowired + private TaskUtil taskUtil; + @Autowired + private ConditionService conditionService; + @Autowired + private ServiceUtil serviceUtil; + @Autowired + private TaskService taskService; + @Autowired + private FlowAbleUrl flowAbleUrl; + @Autowired + private RejectDataService rejectDataService; + @Autowired + private RecordUtil recordUtil; + @Autowired + private MsgUtil msgUtil; + @Autowired + private TemplateNodeService templateNodeService; + @Autowired + private CirculateService circulateService; + @Autowired + private TemplateService templateService; + @Autowired + private TemplateJsonService templateJsonService; + @Autowired + private RedisUtil redisUtil; + @Autowired + private NodeRecordService nodeRecordService; + @Autowired + private CirculateUtil circulateUtil; + @Autowired + private TaskLineService taskLineService; + @Autowired + private RevokeService revokeService; + @Autowired + private FlowAsyncUtil flowAsyncUtil; + @Autowired + private TriggerUtil triggerUtil; + @Autowired + private SubtaskDataService subtaskDataService; + + // 组建FlowMethod + public FlowMethod getFlowMethod(FlowMethod flowMethod) { + FlowModel flowModel = flowMethod.getFlowModel(); + String nodeCode = flowMethod.getNodeCode(); + Map nodes = flowMethod.getNodes(); + FlowModel model = JsonUtil.getJsonToBean(flowModel, FlowModel.class); + model.setHandleOpinion("系统审批"); + model.setSignImg(null); + model.setFileList(null); + model.setHandleStatus(FlowNature.AuditCompletion); + model.setTaskEntity(flowMethod.getTaskEntity()); + model.setFlowableTaskId(flowMethod.getFlowableTaskId()); + FlowMethod method = new FlowMethod(); + method.setFlowModel(model); + NodeModel nodeModel = nodes.get(nodeCode); + method.setNodeModel(nodeModel); + method.setNodeCode(nodeCode); + return method; + } + + // 处理撤销的经办 + public void handleRevokeOperator(FlowMethod flowMethod) throws Exception { + FlowModel flowModel = flowMethod.getFlowModel(); + String taskId = flowMethod.getTaskId(); + TaskEntity taskEntity = flowMethod.getTaskEntity(); + String instanceId = taskEntity.getInstanceId(); + List nodeEntityList = flowModel.getNodeEntityList(); + Map nodes = flowModel.getNodes(); + NodeModel global = nodes.get(NodeEnum.global.getType()); + List operatorEntities = new ArrayList<>(); + // 生成经办,获取之前同意的经办,再次生成经办 + List operatorList = this.getList(taskId) + .stream().filter(e -> ObjectUtil.equals(e.getHandleStatus(), FlowNature.AuditCompletion) + && !ObjectUtil.equals(e.getStatus(), OperatorStateEnum.Futility.getCode())) + .collect(Collectors.toList()); + List taskModelList = flowAbleUrl.getCurrentTask(instanceId); + + // 原来的当前节点 + List srcCurrentList = StringUtil.isNotEmpty(taskEntity.getCurrentNodeCode()) + ? Arrays.stream(taskEntity.getCurrentNodeCode().split(",")).collect(Collectors.toList()) + : new ArrayList<>(); + + taskUtil.updateCurrentNode(taskModelList, nodes, taskEntity); + + List nodeRecordList = nodeRecordService.getList(taskId); + nodeRecordList = nodeRecordList.stream() + .sorted(Comparator.comparing(NodeRecordEntity::getCreatorTime).reversed()).collect(Collectors.toList()); + + for (FlowableTaskModel flowableTaskModel : taskModelList) { + // 当前节点已存在,跳过 + if (CollectionUtil.isNotEmpty(srcCurrentList) && srcCurrentList.contains(flowableTaskModel.getTaskKey())) { + continue; + } + TemplateNodeEntity nodeEntity = nodeEntityList.stream() + .filter(e -> ObjectUtil.equals(e.getNodeCode(), flowableTaskModel.getTaskKey())).findFirst() + .orElse(null); + if (null == nodeEntity) { + continue; + } + // 处理子流程、办理节点 + if (ObjectUtil.equals(nodeEntity.getNodeType(), NodeEnum.subFlow.getType()) + || ObjectUtil.equals(nodeEntity.getNodeType(), NodeEnum.processing.getType())) { + // FlowModel model = JsonUtil.getJsonToBean(flowModel, FlowModel.class); + // model.setTaskEntity(taskEntity); + // model.setFlowableTaskId(flowableTaskModel.getTaskId()); + // this.handleSubFlow(nodeEntity, model); + + CompleteFo completeFo = new CompleteFo(); + completeFo.setTaskId(flowableTaskModel.getTaskId()); + flowAbleUrl.complete(completeFo); + this.handleRevokeOperator(flowMethod); + continue; + } + + String nodeCode = flowableTaskModel.getTaskKey(); + String nodeId = flowableTaskModel.getTaskId(); + flowMethod.setFlowableTaskId(flowableTaskModel.getTaskId()); + flowMethod.setNodes(nodes); + flowMethod.setNodeCode(nodeCode); + // 判断拒绝 + NodeRecordEntity nodeRecord = nodeRecordList.stream() + .filter(e -> ObjectUtil.equals(e.getNodeCode(), flowableTaskModel.getTaskKey())).findFirst() + .orElse(new NodeRecordEntity()); + if (ObjectUtil.equals(nodeRecord.getNodeStatus(), 3)) { + // 系统通过 + FlowMethod method = this.getFlowMethod(flowMethod); + this.autoAudit(method); + continue; + } + List list = operatorList.stream() + .filter(e -> ObjectUtil.equals(e.getNodeCode(), nodeCode)).collect(Collectors.toList()); + if (CollectionUtil.isNotEmpty(list)) { + if ((list.size() == 1 && ObjectUtil.equals(list.get(0).getHandleId(), FlowNature.SYSTEM_CODE))) { + // 系统通过 + FlowMethod method = this.getFlowMethod(flowMethod); + this.autoAudit(method); + continue; + } + for (OperatorEntity operator : list) { + OperatorEntity operatorEntity = this.createOperator(operator, OperatorStateEnum.Revoke.getCode(), + operator.getHandleId(), global); + operatorEntity.setTaskId(taskEntity.getId()); + operatorEntity.setNodeId(nodeId); + operatorEntity.setParentId("0"); + operatorEntities.add(operatorEntity); + } + } + } + if (CollectionUtil.isNotEmpty(operatorEntities)) { + operatorService.saveBatch(operatorEntities); + flowModel.setList(operatorEntities); + // 消息 + FlowMsgModel flowMsgModel = new FlowMsgModel(); + flowMsgModel.setNodeList(nodeEntityList); + flowMsgModel.setTaskEntity(taskEntity); + flowMsgModel.setFlowModel(flowModel); + flowMsgModel.setOperatorList(operatorEntities); + flowMsgModel.setFormData(FlowContextHolder.getAllData()); + msgUtil.message(flowMsgModel); + } + } + + public List getList(String taskId) { + return operatorService.getList(taskId); + } + + // 归档 最后节点审批人:表示最后节点的审批人才有权限查看该文档(取最后节点实际参与审批的人,不包含加签和转审人员); + public List getListOfLast(String taskId) { + List resList = new ArrayList<>(); + + List status = ImmutableList.of(OperatorStateEnum.AddSign.getCode(), + OperatorStateEnum.Transfer.getCode(), + OperatorStateEnum.Assist.getCode(), OperatorStateEnum.Futility.getCode()); + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OperatorEntity::getTaskId, taskId) + .ne(OperatorEntity::getHandleId, FlowNature.SYSTEM_CODE) + .notIn(OperatorEntity::getStatus, status) + .isNotNull(OperatorEntity::getHandleStatus).orderByDesc(OperatorEntity::getHandleTime); + + List list = operatorService.list(queryWrapper); + if (CollectionUtil.isNotEmpty(list)) { + // 获取符合条件的最后一个审批人,通过该审批人获取节点 + OperatorEntity operator = list.get(0); + List operatorList = list.stream() + .filter(e -> ObjectUtil.equals(operator.getNodeId(), e.getNodeId())) + .sorted(Comparator.comparing(OperatorEntity::getHandleTime).reversed()) + .collect(Collectors.toList()); + if (CollectionUtil.isNotEmpty(operatorList)) { + List handleIds = operatorList.stream().map(OperatorEntity::getHandleId).distinct() + .collect(Collectors.toList()); + resList.addAll(handleIds); + } + List circulateList = circulateService.getList(taskId); + if (CollectionUtil.isNotEmpty(circulateList)) { + List userIds = circulateList.stream() + .filter(e -> ObjectUtil.equals(operator.getNodeId(), e.getNodeId())) + .map(CirculateEntity::getUserId).collect(Collectors.toList()); + resList.addAll(userIds); + } + } + return resList.stream().distinct().collect(Collectors.toList()); + } + + // 归档 当前流程所有人:包含流程的发起人、所有节点的审批人及抄送人员,不包含加签和转审人员;(审批人读取参与审批的人) + public List getListOfFile(String taskId) { + List resList = new ArrayList<>(); + List operatorList = operatorService.getList(taskId); + if (CollectionUtil.isNotEmpty(operatorList)) { + List status = ImmutableList.of(OperatorStateEnum.AddSign.getCode(), + OperatorStateEnum.Transfer.getCode(), + OperatorStateEnum.Assist.getCode(), OperatorStateEnum.Futility.getCode()); + List list = operatorList.stream() + .filter(e -> !status.contains(e.getStatus()) && e.getHandleStatus() != null) + .collect(Collectors.toList()); + + resList.addAll(list.stream().map(OperatorEntity::getHandleId).collect(Collectors.toList())); + } + List circulateList = circulateService.getList(taskId); + if (CollectionUtil.isNotEmpty(circulateList)) { + resList.addAll(circulateList.stream().map(CirculateEntity::getUserId).collect(Collectors.toList())); + } + return resList.stream().distinct().collect(Collectors.toList()); + } + + // 校验经办 + public OperatorEntity checkOperator(String id) throws WorkFlowException { + OperatorEntity operator = operatorService.getInfo(id); + if (null == operator) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + if (null == operator.getSignTime()) { + throw new WorkFlowException(MsgCode.WF087.get()); + } + if (null == operator.getStartHandleTime()) { + throw new WorkFlowException(MsgCode.WF088.get()); + } + if (null != operator.getHandleStatus()) { + throw new WorkFlowException(MsgCode.WF031.get()); + } + return operator; + } + + // 创建经办 + public List createOperator(FlowMethod flowMethod) { + List userIds = flowMethod.getUserIds(); + NodeModel nodeModel = flowMethod.getNodeModel(); + FlowModel flowModel = flowMethod.getFlowModel(); + List entityList = new ArrayList<>(); + if (userIds.isEmpty()) { + return entityList; + } + TaskEntity taskEntity = flowModel.getTaskEntity(); + String flowableTaskId = flowModel.getFlowableTaskId(); + NodeModel global = flowModel.getNodes().get(NodeEnum.global.getType()); + + // 是否签收 + Boolean signFor = global.getHasSignFor(); + flowMethod.setTaskEntity(taskEntity); + flowMethod.setSignFor(signFor); + flowMethod.setFlowableTaskId(flowableTaskId); + + if (nodeModel.getCounterSign().equals(FlowNature.ImproperApprover)) { + List list = taskUtil.improperSort(userIds, nodeModel); + if (CollectionUtil.isNotEmpty(list)) { + OperatorEntity entity = this.createOperatorEntity(flowMethod); + entity.setHandleId(list.get(0)); + entity.setHandleAll(String.join(",", list)); + entity.setParentId("0"); + entityList.add(entity); + } + } else { + // 或签、会签 + for (String userId : userIds) { + OperatorEntity entity = this.createOperatorEntity(flowMethod); + entity.setHandleId(userId); + entity.setParentId("0"); + entityList.add(entity); + } + } + + if (CollectionUtil.isNotEmpty(entityList)) { + operatorService.saveBatch(entityList); + } + return entityList; + } + + public OperatorEntity createOperatorEntity(FlowMethod flowMethod) { + TaskEntity taskEntity = flowMethod.getTaskEntity(); + TemplateNodeEntity nodeEntity = flowMethod.getNodeEntity(); + NodeModel nodeModel = flowMethod.getNodeModel(); + Boolean signFor = flowMethod.getSignFor(); + String flowableTaskId = flowMethod.getFlowableTaskId(); + OperatorEntity entity = new OperatorEntity(); + entity.setId(RandomUtil.uuId()); + entity.setIsProcessing(ObjectUtil.equals(nodeEntity.getNodeType(), NodeEnum.processing.getType()) ? 1 : 0); + entity.setNodeId(flowableTaskId); + entity.setNodeName(nodeModel.getNodeName()); + entity.setNodeCode(nodeEntity.getNodeCode()); + entity.setStatus(OperatorStateEnum.Runing.getCode()); + Boolean flowTodo = serviceUtil.getFlowTodo(); + if (flowTodo) { + entity.setSignTime(new Date()); + entity.setStartHandleTime(new Date()); + } else { + Boolean flowSign = serviceUtil.getFlowSign(); + if (flowSign) { + entity.setSignTime(new Date()); + } else { + if (!signFor) { + entity.setSignTime(new Date()); + } + } + } + entity.setCompletion(0); + entity.setTaskId(taskEntity.getId()); + entity.setEngineType(taskEntity.getEngineType()); + return entity; + } + + // 判断节点的审批结果 + public boolean checkAudit(FlowMethod flowMethod) throws WorkFlowException { + OperatorEntity operator = flowMethod.getOperatorEntity(); + NodeModel nodeModel = flowMethod.getNodeModel(); + NodeModel global = flowMethod.getNodes().get(NodeEnum.global.getType()); + Integer handleStatus = flowMethod.getHandleStatus(); + boolean result = false; + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OperatorEntity::getTaskId, operator.getTaskId()) + .eq(OperatorEntity::getNodeCode, operator.getNodeCode()) + .eq(OperatorEntity::getParentId, "0") + .ne(OperatorEntity::getStatus, OperatorStateEnum.Futility.getCode()) + .select(OperatorEntity::getId, OperatorEntity::getHandleStatus, OperatorEntity::getHandleTime); + List list = operatorService.list(queryWrapper); + + Boolean auditFlag = flowMethod.getAuditFlag(); + if (auditFlag) { + for (OperatorEntity entity : list) { + if (ObjectUtil.equals(entity.getId(), operator.getId())) { + entity.setHandleStatus(operator.getHandleStatus()); + break; + } + } + } + + Integer counterSign = nodeModel.getCounterSign(); + if (FlowNature.FixedApprover.equals(counterSign)) { + // 或签,一人同意或拒绝 + result = operator.getHandleStatus().equals(handleStatus); + } else if (FlowNature.FixedJointlyApprover.equals(counterSign)) { + // 会签 + long numAudit; + long numReject; + if (auditFlag) { + numAudit = list.stream().filter(e -> FlowNature.AuditCompletion.equals(e.getHandleStatus())).count(); + numReject = list.stream().filter(e -> FlowNature.RejectCompletion.equals(e.getHandleStatus())).count(); + } else { + numAudit = list.stream() + .filter(e -> FlowNature.AuditCompletion.equals(e.getHandleStatus()) + && null != e.getHandleTime()) + .count(); + numReject = list.stream() + .filter(e -> FlowNature.RejectCompletion.equals(e.getHandleStatus()) + && null != e.getHandleTime()) + .count(); + } + CounterSignConfig config = nodeModel.getCounterSignConfig(); + + // 判断计算方式,延后计算(在所有审批人审批完成后进行规则判断) + int type = config.getCalculateType(); + if (ObjectUtil.equals(type, FlowNature.CALCULATE_TYPE_DELAY)) { + int auditCount = (int) list.stream().filter(e -> null != e.getHandleStatus()).count(); + if (list.size() != auditCount) { + return false; + } + } + + int auditNum = config.getAuditNum(); + int auditRatio = config.getAuditRatio(); + int rejectNum = config.getRejectNum(); + int rejectRatio = config.getRejectRatio(); + + if (config.getAuditType().equals(FlowNature.Percent)) { + // 百分比 + int res = (int) (numAudit * 100 / list.size()); + result = res >= auditRatio; + } else if (config.getAuditType().equals(FlowNature.Number)) { + // 人数 + result = numAudit >= auditNum; + } + // 同意比例没通过,再计算拒绝的比例 + if (!result) { + if (config.getRejectType().equals(FlowNature.Percent)) { + // 百分比 + int res = (int) (numReject * 100 / list.size()); + result = res >= rejectRatio; + } else if (config.getRejectType().equals(FlowNature.Number)) { + // 人数 + result = numReject >= rejectNum; + } else { + // 同意取反 + if (numReject > 0) { + if (config.getAuditType().equals(FlowNature.Percent)) { + int res = (int) (numReject * 100 / list.size()); + result = res >= (100 - auditRatio); + } else if (config.getAuditType().equals(FlowNature.Number)) { + result = numReject >= (list.size() - auditNum); + } + } + } + if (result && ObjectUtil.equals(type, FlowNature.CALCULATE_TYPE_DELAY)) { + flowMethod.setHandleStatus(FlowNature.RejectCompletion); + } + } else { + if (ObjectUtil.equals(type, FlowNature.CALCULATE_TYPE_DELAY)) { + flowMethod.setHandleStatus(FlowNature.AuditCompletion); + } + } + } else if (FlowNature.ImproperApprover.equals(counterSign)) { + // 依次审批 + if (ObjectUtil.equals(handleStatus, FlowNature.RejectCompletion)) { + // 拒绝直接返回true,根据拒绝是否继续流转,直接结束 或 流转一下节点 + return true; + } + List allList = StringUtil.isNotEmpty(operator.getHandleAll()) + ? Arrays.stream(operator.getHandleAll().split(",")).collect(Collectors.toList()) + : new ArrayList<>(); + + String userId = operator.getHandleId(); + // 转审的经办,通过记录获取原来的审批人 + if (ObjectUtil.equals(operator.getStatus(), OperatorStateEnum.Transfer.getCode())) { + RecordEntity record = recordUtil.getTransferRecord(operator.getId()); + String handleId = record.getHandleId(); + if (StringUtil.isNotBlank(handleId)) { + userId = handleId; + } + } + int index = allList.indexOf(userId); + // 最后一人直接返回 + if (index == allList.size() - 1) { + return true; + } + if (flowMethod.getAuditFlag()) { + return false; + } + String handleId = ""; + if (index != -1) { + handleId = allList.get(index + 1); + } + OperatorEntity entity = this.createOperator(operator, OperatorStateEnum.Runing.getCode(), handleId, global); + operatorService.save(entity); + + this.improperApproverMessage(flowMethod, entity); + } + if (result && !flowMethod.getAuditFlag()) { + // 结束该节点的其他经办 + flowMethod.setTaskId(operator.getTaskId()); + flowMethod.setNodeCode(operator.getNodeCode()); + endOperator(flowMethod); + } + return result; + } + + // 依次审批消息 + public void improperApproverMessage(FlowMethod flowMethod, OperatorEntity entity) throws WorkFlowException { + FlowModel flowModel = flowMethod.getFlowModel(); + List circulateList = flowMethod.getCirculateList(); + TemplateNodeEntity nodeEntity = flowMethod.getNodeEntity(); + TaskEntity taskEntity = flowMethod.getTaskEntity(); + List nodeEntityList = flowMethod.getNodeEntityList(); + + List entityList = new ArrayList<>(); + entityList.add(entity); + // 消息 + FlowMsgModel flowMsgModel = new FlowMsgModel(); + flowMsgModel.setNodeList(nodeEntityList); + flowMsgModel.setCirculateList(circulateList); + flowMsgModel.setFlowModel(flowModel); + flowMsgModel.setTaskEntity(taskEntity); + flowMsgModel.setNodeCode(nodeEntity.getNodeCode()); + flowMsgModel.setOperatorList(entityList); + flowMsgModel.setCopy(true); + flowMsgModel.setApprove(true); + flowMsgModel.setFormData(FlowContextHolder.getAllData()); + msgUtil.message(flowMsgModel); + } + + // 结束经办 + public void endOperator(FlowMethod flowMethod) { + String taskId = flowMethod.getTaskId(); + String nodeCode = flowMethod.getNodeCode(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OperatorEntity::getTaskId, taskId) + .isNull(OperatorEntity::getHandleStatus); + if (StringUtil.isNotEmpty(nodeCode)) { + queryWrapper.lambda().eq(OperatorEntity::getNodeCode, nodeCode); + } + List list = operatorService.list(queryWrapper); + if (CollectionUtil.isNotEmpty(list)) { + for (OperatorEntity entity : list) { + entity.setCompletion(1); + } + operatorService.updateBatchById(list); + } + } + + // 结束加签经办 + public void endAddSign(String taskId, String parentId) { + List list = new ArrayList<>(); + this.getAddSignChildren(parentId, list); + if (CollectionUtil.isNotEmpty(list)) { + operatorService.updateBatchById(list); + } + } + + // 撤回复原 + public void recallRestore(OperatorEntity operator, String nodeId, List userIds) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OperatorEntity::getTaskId, operator.getTaskId()) + .eq(OperatorEntity::getNodeCode, operator.getNodeCode()).eq(OperatorEntity::getNodeId, nodeId) + .eq(OperatorEntity::getCompletion, 1).isNull(OperatorEntity::getHandleTime); + List list = operatorService.list(queryWrapper); + if (CollectionUtil.isEmpty(list)) { + return; + } + + List updateList = new ArrayList<>(); + for (OperatorEntity operatorEntity : list) { + if (ObjectUtil.equals(operatorEntity.getParentId(), operator.getParentId())) { + updateList.add(operatorEntity); + if (null != userIds) { + userIds.add(operatorEntity.getHandleId()); + } + } + } + + if (CollectionUtil.isNotEmpty(updateList)) { + Date date = new Date(); + UpdateWrapper wrapper = new UpdateWrapper<>(); + List ids = updateList.stream().map(OperatorEntity::getId).collect(Collectors.toList()); + wrapper.lambda().in(OperatorEntity::getId, ids) + .set(OperatorEntity::getCreatorTime, date) + .set(OperatorEntity::getStatus, OperatorStateEnum.Runing.getCode()) + .set(OperatorEntity::getCompletion, 0) + .set(OperatorEntity::getHandleStatus, null); + operatorService.update(wrapper); + // 作废记录 + recordUtil.invalid(updateList); + } + + List deleteList = new ArrayList<>(); + if (CollectionUtil.isNotEmpty(updateList)) { + for (OperatorEntity op : updateList) { + this.getAddSignChildren(op.getId(), deleteList); + } + if (CollectionUtil.isNotEmpty(deleteList)) { + deleteList.forEach(e -> e.setStatus(OperatorStateEnum.Futility.getCode())); + operatorService.updateBatchById(deleteList); + // 作废记录 + recordUtil.invalid(deleteList); + } + } + } + + public List getAddSignChildren(String operatorId, List list) { + list = null == list ? new ArrayList<>() : list; + List childList = this.getChildList(operatorId); + if (CollectionUtil.isNotEmpty(childList)) { + for (OperatorEntity operator : childList) { + operator.setCompletion(1); + list.add(operator); + this.getAddSignChildren(operator.getId(), list); + } + } + return list; + } + + // 判断自动审批 + public int checkAuto(FlowMethod flowMethod) { + NodeModel nodeModel = flowMethod.getNodeModel(); + if (nodeModel.getHasAutoApprover()) { + AutoAuditRule autoAuditRule = nodeModel.getAutoAuditRule(); + if (null != autoAuditRule) { + List conditions = autoAuditRule.getConditions(); + flowMethod.setConditions(conditions); + flowMethod.setMatchLogic(autoAuditRule.getMatchLogic()); + if (conditionService.hasCondition(flowMethod)) { + return 1; + } + } + AutoAuditRule autoRejectRule = nodeModel.getAutoRejectRule(); + if (null != autoRejectRule) { + List conditions = autoRejectRule.getConditions(); + flowMethod.setConditions(conditions); + flowMethod.setMatchLogic(autoRejectRule.getMatchLogic()); + if (conditionService.hasCondition(flowMethod)) { + return 2; + } + } + } + return 3; + } + + // 节点的自动审批 + public void autoAudit(FlowMethod flowMethod) throws Exception { + FlowModel flowModel = flowMethod.getFlowModel(); + + OperatorEntity entity = this.saveSystemOperator(flowMethod); + if (null == entity) { + return; + } + operatorService.audit(entity, flowModel); + } + + public void autoAudit(OperatorEntity entity, FlowModel flowModel) throws Exception { + if (null == entity || null == flowModel) { + return; + } + operatorService.audit(entity, flowModel); + } + + // 系统审批 + public void systemAudit() { + List systemList = SystemAuditHolder.getAll(); + if (CollectionUtil.isNotEmpty(systemList)) { + List jsonToList = JsonUtil.getJsonToList(systemList, SystemAuditModel.class); + Map nodes = null; + TaskEntity taskEntity = null; + + SystemAuditHolder.clear(); + for (SystemAuditModel model : jsonToList) { + OperatorEntity operator = model.getOperator(); + FlowModel flowModel = model.getFlowModel(); + if (null == nodes) { + nodes = flowModel.getNodes(); + } + if (null == taskEntity) { + taskEntity = flowModel.getTaskEntity(); + } + try { + this.autoAudit(operator, flowModel); + } catch (Exception e) { + e.printStackTrace(); + } + } + if (null != taskEntity) { + List newTaskModelList = null; + try { + newTaskModelList = flowAbleUrl.getCurrentTask(taskEntity.getInstanceId()); + } catch (WorkFlowException e) { + e.printStackTrace(); + } + if (CollectionUtil.isNotEmpty(newTaskModelList)) { + taskUtil.updateCurrentNode(newTaskModelList, nodes, taskEntity); + } + } + } + } + + public OperatorEntity saveSystemOperator(FlowMethod flowMethod) { + NodeModel nodeModel = flowMethod.getNodeModel(); + FlowModel flowModel = flowMethod.getFlowModel(); + + TaskEntity taskEntity = flowModel.getTaskEntity(); + String flowableTaskId = flowModel.getFlowableTaskId(); + + OperatorEntity entity = new OperatorEntity(); + entity.setStatus(OperatorStateEnum.Runing.getCode()); + entity.setCompletion(1); + entity.setParentId("0"); + + entity.setTaskId(taskEntity.getId()); + entity.setNodeCode(nodeModel.getNodeId()); + entity.setNodeId(flowableTaskId); + entity.setNodeName(nodeModel.getNodeName()); + entity.setEngineType(taskEntity.getEngineType()); + + entity.setSignTime(new Date()); + entity.setStartHandleTime(new Date()); + entity.setHandleId(FlowNature.SYSTEM_CODE); + entity.setHandleTime(new Date()); + + operatorService.save(entity); + + return entity; + } + + // 全局属性的自动审批 + public boolean handleGlobalAuto(FlowMethod flowMethod) throws WorkFlowException { + OperatorEntity entity = flowMethod.getOperatorEntity(); + NodeModel global = flowMethod.getNodeModel(); + FlowModel flowModel = flowMethod.getFlowModel(); + TaskEntity taskEntity = flowModel.getTaskEntity(); + List nodeEntityList = flowModel.getNodeEntityList(); + String deploymentId = flowModel.getDeploymentId(); + if (null == entity.getSignTime()) { + entity.setSignTime(new Date()); + } + + // 自动提交规则 + AutoSubmitConfig autoSubmitConfig = global.getAutoSubmitConfig(); + // 相邻节点审批人重复 + if (autoSubmitConfig.getAdjacentNodeApproverRepeated()) { + // 获取上一级节点编码 + List nodeCodeList = new ArrayList<>(); + taskUtil.prevNodeList(deploymentId, entity.getNodeCode(), nodeEntityList, nodeCodeList); + if (CollectionUtil.isNotEmpty(nodeCodeList)) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OperatorEntity::getTaskId, taskEntity.getId()) + .eq(OperatorEntity::getHandleId, entity.getHandleId()) + .isNotNull(OperatorEntity::getHandleStatus) + .ne(OperatorEntity::getStatus, OperatorStateEnum.Futility.getCode()) + .in(OperatorEntity::getNodeCode, nodeCodeList); + long count = operatorService.count(queryWrapper); + if (count > 0) { + entity.setStartHandleTime(new Date()); + return true; + } + } + } + // 审批人审批过该流程 + if (autoSubmitConfig.getApproverHasApproval()) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OperatorEntity::getTaskId, taskEntity.getId()) + .eq(OperatorEntity::getHandleId, entity.getHandleId()) + .ne(OperatorEntity::getStatus, OperatorStateEnum.Futility.getCode()) + .isNotNull(OperatorEntity::getHandleStatus); + long count = operatorService.count(queryWrapper); + if (count > 0) { + entity.setStartHandleTime(new Date()); + return true; + } + } + // 发起人与审批人重复 + if (autoSubmitConfig.getInitiatorApproverRepeated()) { + if (StringUtil.equals(taskEntity.getCreatorUserId(), entity.getHandleId())) { + entity.setStartHandleTime(new Date()); + return true; + } + } + return false; + } + + public List getChildList(String id) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(OperatorEntity::getParentId, id) + .ne(OperatorEntity::getStatus, OperatorStateEnum.Assist.getCode()); + return operatorService.list(wrapper); + } + + // 处理加签审批比例 + public void handleAddCounterSign(OperatorEntity operator, FlowModel flowModel) throws Exception { + if (null == operator.getParentId()) { + return; + } + OperatorEntity parentEntity = operatorService.getInfo(operator.getParentId()); + if (null == parentEntity) { + return; + } + String handleParameter = parentEntity.getHandleParameter(); + AddSignModel addSignModel = JsonUtil.getJsonToBean(handleParameter, AddSignModel.class); + if (null == addSignModel) { + return; + } + TaskEntity taskEntity = flowModel.getTaskEntity(); + List list = this.getChildList(operator.getParentId()); + + int total = list.size(); + long countAudit = list.stream() + .filter(e -> FlowNature.AuditCompletion.equals(e.getHandleStatus()) && null != e.getHandleTime()) + .count(); + long countReject = list.stream() + .filter(e -> FlowNature.RejectCompletion.equals(e.getHandleStatus()) && null != e.getHandleTime()) + .count(); + + FlowMethod flowMethod = new FlowMethod(); + flowMethod.setAddSignModel(addSignModel); + flowMethod.setOperatorEntity(parentEntity); + flowMethod.setFlowModel(flowModel); + if (ObjectUtil.equals(addSignModel.getCounterSign(), FlowNature.ImproperApprover)) { + if (ObjectUtil.equals(flowModel.getHandleStatus(), FlowNature.RejectCompletion)) { + Map nodes = flowModel.getNodes(); + NodeModel global = nodes.get(NodeEnum.global.getType()); + // 101003前加签给10001、10002、10003,不管是否开启拒绝继续流转,10001通过,10002拒绝,应该回到101003那里 + // 后加签逻辑:流程设置继续流转,依次审批中只要有人拒绝,其他审批人不用审批流程就流转下一节点;流程未设置继续流转,依次审批中只要有人拒绝,就拒绝回发起节点 + if (ObjectUtil.equals(addSignModel.getAddSignType(), FlowNature.Later) + && !global.getHasContinueAfterReject()) { + flowMethod.setTaskEntity(taskEntity); + taskUtil.handleEndTask(flowMethod); + } else { + this.handleAddSign(flowMethod); + } + return; + } + String userId = operator.getHandleId(); + // 转审的经办,通过记录获取原来的审批人 + if (ObjectUtil.equals(operator.getStatus(), OperatorStateEnum.Transfer.getCode())) { + RecordEntity record = recordUtil.getTransferRecord(operator.getId()); + String handleId = record.getHandleId(); + if (StringUtil.isNotBlank(handleId)) { + userId = handleId; + } + } + List idList = addSignModel.getAddSignUserIdList(); + int index = idList.indexOf(userId); + if (index == idList.size() - 1) { + // 依次审批最后一个人 + this.handleAddSign(flowMethod); + } else { + NodeModel global = flowModel.getNodes().get(NodeEnum.global.getType()); + String handleId = idList.get(index + 1); + OperatorEntity entity = this.createOperator(operator, OperatorStateEnum.AddSign.getCode(), handleId, + global); + operatorService.save(entity); + flowMethod.setNodeEntity(flowModel.getNodeEntity()); + flowMethod.setTaskEntity(taskEntity); + flowMethod.setNodeEntityList(flowModel.getNodeEntityList()); + this.improperApproverMessage(flowMethod, entity); + return; + } + } else if (ObjectUtil.equals(addSignModel.getCounterSign(), FlowNature.FixedJointlyApprover)) { + // 会签 + Integer ratio = addSignModel.getAuditRatio(); + + int rejectRatio = 100 - ratio; + int rejectRes = (int) (countReject * 100 / total); + if (rejectRes != 0 && rejectRes >= rejectRatio) { + // 直接拒绝 + flowMethod.setHandleStatus(FlowNature.RejectCompletion); + this.handleAddSign(flowMethod); + this.endAddSign(taskEntity.getId(), parentEntity.getId()); + return; + } + + int res = (int) (countAudit * 100 / total); + if (res >= ratio) { + flowMethod.setHandleStatus(FlowNature.AuditCompletion); + this.handleAddSign(flowMethod); + this.endAddSign(taskEntity.getId(), parentEntity.getId()); + } + } else { + int auditFlag = FlowNature.AuditCompletion; + // 或签 + if (countReject >= 1) { + auditFlag = FlowNature.RejectCompletion; + } + flowMethod.setHandleStatus(auditFlag); + this.handleAddSign(flowMethod); + this.endAddSign(taskEntity.getId(), parentEntity.getId()); + } + if (CollectionUtil.isNotEmpty(flowModel.getList())) { + UserEntity userEntity = serviceUtil.getUserInfo(taskEntity.getCreatorUserId()); + if (null != userEntity) { + FlowModel model = JsonUtil.getJsonToBean(flowModel, FlowModel.class); + UserInfo userInfo = model.getUserInfo(); + userInfo.setUserName(userEntity.getRealName()); + userInfo.setUserAccount(userEntity.getAccount()); + userInfo.setUserId(userEntity.getId()); + model.setUserInfo(userInfo); + for (OperatorEntity operatorEntity : flowModel.getList()) { + FlowJobUtil.deleteByOperatorId(operatorEntity.getId(), redisUtil); + } + TimeUtil.timeModel(flowModel.getList(), model, redisUtil); + flowModel.setList(null); + } + } + } + + public void handleAddSign(FlowMethod flowMethod) throws Exception { + AddSignModel addSignModel = flowMethod.getAddSignModel(); + OperatorEntity parentEntity = flowMethod.getOperatorEntity(); + FlowModel flowModel = flowMethod.getFlowModel(); + if (addSignModel.getAddSignType().equals(FlowNature.Later)) { + // 后加签需要默认同意 + flowModel.setHandleStatus(FlowNature.AuditCompletion); + UserEntity userEntity = serviceUtil.getUserInfo(parentEntity.getHandleId()); + UserInfo userInfo = JsonUtil.getJsonToBean(UserProvider.getUser(), UserInfo.class); + userInfo.setUserId(userEntity.getId()); + userInfo.setUserName(userEntity.getRealName()); + flowModel.setUserInfo(userInfo); + flowModel.setCopyMsgFlag(false); + parentEntity.setHandleStatus(null); + operatorService.audit(parentEntity, flowModel); + flowModel.setCopyMsgFlag(true); + } else { + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.lambda().eq(OperatorEntity::getId, parentEntity.getId()) + .set(OperatorEntity::getCreatorTime, new Date()) + .set(OperatorEntity::getCompletion, 0); + NodeModel global = flowModel.getNodes().get(NodeEnum.global.getType()); + Boolean flowTodo = serviceUtil.getFlowTodo(); + if (!flowTodo) { + updateWrapper.lambda().set(OperatorEntity::getStartHandleTime, null); + Boolean flowSign = serviceUtil.getFlowSign(); + if (!flowSign) { + if (global != null && global.getHasSignFor()) { + updateWrapper.lambda().set(OperatorEntity::getSignTime, null); + } + } + } + operatorService.update(updateWrapper); + parentEntity = operatorService.getById(parentEntity.getId()); + // recordUtil.invalidAddSignRecord(parentEntity); + // 超时经办 + List list = new ArrayList<>(); + list.add(parentEntity); + flowModel.setList(list); + } + } + + // 设置可减签的人员名称 + public List getReduceUsers(List todoList, ReducePagination pagination) { + List ids = todoList.stream().map(OperatorEntity::getHandleId).collect(Collectors.toList()); + List userIds = serviceUtil.getUserListAll(ids); + + List userList = serviceUtil.getUserName(userIds, pagination); + pagination.setTotal(pagination.getTotal()); + List userIdList = userList.stream().map(UserEntity::getId).collect(Collectors.toList()); + Map> userMap = serviceUtil.getListByUserIdAll(userIdList).stream() + .filter(t -> PermissionConst.ORGANIZE.equals(t.getObjectType())) + .collect(Collectors.groupingBy(UserRelationEntity::getUserId)); + + List list = new ArrayList<>(); + for (UserEntity user : userList) { + ReduceUserModel model = JsonUtil.getJsonToBean(user, ReduceUserModel.class); + model.setFullName(user.getRealName() + "/" + user.getAccount()); + model.setHeadIcon(UploaderUtil.uploaderImg(user.getHeadIcon())); + List listByUserId = userMap.get(user.getId()) != null ? userMap.get(user.getId()) + : new ArrayList<>(); + StringJoiner joiner = new StringJoiner(","); + for (UserRelationEntity relation : listByUserId) { + List organizeId = serviceUtil.getOrganizeId(relation.getObjectId()); + if (!organizeId.isEmpty()) { + String organizeName = organizeId.stream().map(OrganizeEntity::getFullName) + .collect(Collectors.joining("/")); + joiner.add(organizeName); + } + } + model.setOrganize(joiner.toString()); + list.add(model); + } + return list; + } + + // 处理退回数据,当前的经办通过计算比例后进入该方法,无需变更状态 + public void handleRejectData(FlowModel flowModel) throws WorkFlowException { + List nodeEntityList = flowModel.getNodeEntityList(); + OperatorEntity operatorEntity = flowModel.getOperatorEntity(); + + TaskEntity taskEntity = flowModel.getTaskEntity(); + String currentNodeCode = taskEntity.getCurrentNodeCode(); + // 待提交(即未发起)重新发起,需要获取当前节点 + String instanceId = taskEntity.getInstanceId(); + if (instanceId != null) { + List taskModelList = flowAbleUrl.getCurrentTask(instanceId); + List currentCodes = taskModelList.stream().map(FlowableTaskModel::getTaskKey) + .collect(Collectors.toList()); + currentNodeCode = String.join(",", currentCodes); + } + + String rejectDataId = taskEntity.getRejectDataId(); + + RejectDataEntity rejectData = rejectDataService.getInfo(taskEntity.getRejectDataId()); + if (!ObjectUtil.equals(rejectData.getNodeCode(), operatorEntity.getNodeCode())) { + throw new WorkFlowException("当前节点无法操作"); + } + String taskJson = rejectData.getTaskJson(); + String operatorJson = rejectData.getOperatorJson(); + + List srcOperatorList = JsonUtil.getJsonToList(operatorJson, OperatorEntity.class); + // 获取被退回的节点编码,用于表单值传递 + List nodeCodes = srcOperatorList.stream().sorted(Comparator.comparing(OperatorEntity::getCreatorTime)) + .map(OperatorEntity::getNodeCode).distinct().collect(Collectors.toList()); + + TaskEntity srcTask = JsonUtil.getJsonToBean(taskJson, TaskEntity.class); + String srcCurrentNodeCode = srcTask.getCurrentNodeCode(); + // 跳转 + JumpFo fo = new JumpFo(); + fo.setInstanceId(instanceId); + List sourceList = StringUtil.isNotEmpty(currentNodeCode) + ? Arrays.stream(currentNodeCode.split(",")).collect(Collectors.toList()) + : new ArrayList<>(); + List targetList = StringUtil.isNotEmpty(srcCurrentNodeCode) + ? Arrays.stream(srcCurrentNodeCode.split(",")).collect(Collectors.toList()) + : new ArrayList<>(); + + List source = sourceList.stream().filter(e -> !targetList.contains(e)).collect(Collectors.toList()); + List target = targetList.stream().filter(e -> !sourceList.contains(e)).collect(Collectors.toList()); + fo.setSource(source); + fo.setTarget(target); + flowAbleUrl.jump(fo); + + // 跳转后,获取当前的节点信息,更新经办 + List taskModelList = flowAbleUrl.getCurrentTask(instanceId); + if (CollectionUtil.isNotEmpty(taskModelList)) { + for (OperatorEntity operator : srcOperatorList) { + FlowableTaskModel model = taskModelList.stream() + .filter(e -> ObjectUtil.equals(e.getTaskKey(), operator.getNodeCode())).findFirst() + .orElse(null); + if (null != model) { + operator.setNodeId(model.getTaskId()); + } + operator.setCreatorTime(new Date()); + } + } + // 还原经办 + operatorService.updateBatchById(srcOperatorList); + + // 还原任务 + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.lambda().eq(TaskEntity::getId, srcTask.getId()) + .set(TaskEntity::getInstanceId, instanceId) + .set(TaskEntity::getCurrentNodeCode, srcTask.getCurrentNodeCode()) + .set(TaskEntity::getCurrentNodeName, srcTask.getCurrentNodeName()) + .set(TaskEntity::getStatus, srcTask.getStatus()) + .set(TaskEntity::getStartTime, srcTask.getStartTime()) + .set(TaskEntity::getRejectDataId, null); + taskService.update(updateWrapper); + + // 赋值更新后的任务 + flowModel.setTaskEntity(srcTask); + + rejectDataService.removeById(rejectDataId); + + // 处理表单值传递 + for (TemplateNodeEntity nodeEntity : nodeEntityList) { + if (nodeCodes.contains(nodeEntity.getNodeCode())) { + FlowMethod flowMethod = new FlowMethod(); + flowMethod.setTaskEntity(taskEntity); + flowMethod.setNodeEntity(nodeEntity); + flowMethod.setNodeEntityList(nodeEntityList); + flowMethod.setFlowModel(flowModel); + flowMethod.setIsAssign(true); + flowMethod.setIsData(true); + taskUtil.dataTransfer(flowMethod); + } + } + } + + // 获取任务 节点下的经办 + public List getByNodeCode(String taskId, String nodeCode) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OperatorEntity::getTaskId, taskId) + .eq(OperatorEntity::getNodeCode, nodeCode) + .ne(OperatorEntity::getStatus, OperatorStateEnum.Futility.getCode()); + List list = operatorService.list(queryWrapper); + if (CollectionUtil.isNotEmpty(list)) { + return list; + } + return new ArrayList<>(); + } + + // 处理指派 + public OperatorEntity handleAssign(FlowModel flowModel) throws WorkFlowException { + TaskEntity taskEntity = flowModel.getTaskEntity(); + NodeModel global = flowModel.getNodes().get(NodeEnum.global.getType()); + String nodeCode = flowModel.getNodeCode(); + String assignUserId = flowModel.getHandleIds(); + NodeModel nodeModel = flowModel.getNodes().get(nodeCode); + Integer transferState = ObjectUtil.equals(nodeModel.getType(), NodeEnum.processing.getType()) + ? OperatorStateEnum.TransferProcessing.getCode() + : OperatorStateEnum.Transfer.getCode(); + + Integer state = flowModel.getAutoTransferFlag() ? transferState : OperatorStateEnum.Assigned.getCode(); + + List operatorList = this.getByNodeCode(taskEntity.getId(), nodeCode); + if (CollectionUtil.isNotEmpty(operatorList)) { + // 作废记录 + recordUtil.invalid(operatorList); + // 删除原来的经办 + operatorService.removeByIds(operatorList); + + OperatorEntity operator = operatorList.get(0); + operator.setParentId("0"); + // 生成指派经办 + OperatorEntity entity = this.createOperator(operator, state, assignUserId, global); + + operatorService.save(entity); + return entity; + } else { + OperatorEntity entity = new OperatorEntity(); + entity.setId(RandomUtil.uuId()); + NodeModel node = flowModel.getNodes().get(nodeCode); + entity.setNodeName(node.getNodeName()); + List currentTask = flowAbleUrl.getCurrentTask(taskEntity.getInstanceId()); + FlowableTaskModel model = currentTask.stream().filter(e -> e.getTaskKey().equals(nodeCode)).findFirst() + .orElse(null); + if (null == model) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + entity.setNodeId(model.getTaskId()); + entity.setNodeCode(nodeCode); + entity.setStatus(state); + entity.setTaskId(taskEntity.getId()); + entity.setEngineType(taskEntity.getEngineType()); + Boolean flowTodo = serviceUtil.getFlowTodo(); + if (flowTodo) { + entity.setSignTime(new Date()); + entity.setStartHandleTime(new Date()); + } else { + Boolean flowSign = serviceUtil.getFlowSign(); + if (flowSign) { + entity.setSignTime(new Date()); + } else { + if (global != null && !global.getHasSignFor()) { + entity.setSignTime(new Date()); + } + } + } + if (node.getCounterSign().equals(FlowNature.ImproperApprover)) { + entity.setHandleAll(assignUserId); + } + entity.setHandleId(assignUserId); + entity.setParentId("0"); + entity.setCompletion(0); + operatorService.save(entity); + return entity; + } + } + + public void handleRevoke(FlowModel flowModel, OperatorEntity operator, RevokeEntity revokeEntity) throws Exception { + TaskEntity taskEntity = flowModel.getTaskEntity(); + Integer handleStatus = flowModel.getHandleStatus(); + List nodeEntityList = flowModel.getNodeEntityList(); + TemplateNodeEntity nodeEntity = nodeEntityList.stream() + .filter(e -> StringUtil.equals(e.getNodeCode(), operator.getNodeCode())).findFirst().orElse(null); + + FlowMethod flowMethod = new FlowMethod(); + flowMethod.setNodeEntity(nodeEntity); + + FlowMsgModel flowMsgModel = new FlowMsgModel(); + flowMsgModel.setFormData(FlowContextHolder.getAllData()); + flowMsgModel.setNodeList(nodeEntityList); + flowMsgModel.setFlowModel(flowModel); + flowMsgModel.setTaskEntity(taskEntity); + flowMsgModel.setNodeCode(operator.getNodeCode()); + flowMsgModel.setWait(false); + List operatorList = new ArrayList<>(); + OperatorEntity entity = new OperatorEntity(); + entity.setNodeCode(operator.getNodeCode()); + entity.setHandleId(taskEntity.getCreatorUserId()); + operatorList.add(entity); + flowMsgModel.setOperatorList(operatorList); + + TaskEntity task = taskService.getById(revokeEntity.getTaskId()); + boolean endFlag = false; + if (ObjectUtil.equals(handleStatus, FlowNature.AuditCompletion)) { + flowMsgModel.setApprove(true); + // 消息 + msgUtil.message(flowMsgModel); + operator.setHandleStatus(FlowNature.AuditCompletion); + flowMethod.setType(RecordEnum.audit.getCode()); + } else { + operator.setHandleStatus(FlowNature.RejectCompletion); + flowMethod.setType(RecordEnum.reject.getCode()); + // 结束 + endFlag = true; + } + + // 经办记录 + flowMethod.setFlowModel(flowModel); + flowMethod.setOperatorEntity(operator); + recordUtil.createRecord(flowMethod); + + operator.setHandleTime(new Date()); + operator.setCompletion(1); + operatorService.updateById(operator); + + flowMethod.setTaskEntity(taskEntity); + List circulateList = circulateUtil.circulateList(flowMethod); + flowMethod.setCirculateList(circulateList); + + if (endFlag) { + flowMethod.setIsRevoke(true); + taskUtil.handleEndTask(flowMethod); + revokeService.deleteRevoke(taskEntity.getId()); + return; + } + // 判断撤销经办的比例 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OperatorEntity::getTaskId, operator.getTaskId()) + .eq(OperatorEntity::getNodeCode, operator.getNodeCode()) + .ne(OperatorEntity::getStatus, OperatorStateEnum.Futility.getCode()); + List list = operatorService.list(queryWrapper); + + long count = list.stream().filter(e -> ObjectUtil.equals(e.getHandleStatus(), FlowNature.AuditCompletion)) + .count(); + if (count == list.size()) { + // 节点记录 + NodeRecordModel nodeRecordModel = new NodeRecordModel(); + nodeRecordModel.setTaskId(operator.getTaskId()); + nodeRecordModel.setNodeId(operator.getNodeId()); + nodeRecordModel.setNodeCode(operator.getNodeCode()); + nodeRecordModel.setNodeName(operator.getNodeName()); + nodeRecordModel.setNodeStatus(2); + nodeRecordService.create(nodeRecordModel); + + // 节点通过 + CompleteFo fo = new CompleteFo(); + fo.setTaskId(operator.getNodeId()); + flowAbleUrl.complete(fo); + + flowMethod.setTaskId(revokeEntity.getTaskId()); + flowMethod.setTaskEntity(taskEntity); + this.handleRevokeOperator(flowMethod); + + // 判断结束,更新源任务的状态 + if (taskUtil.isFinished(flowModel)) { + if (null != task) { + taskUtil.endRevoke(task); + } + } + + } + } + + public OperatorEntity createOperator(OperatorEntity operator, Integer state, String handleId, NodeModel global) { + OperatorEntity entity = new OperatorEntity(); + entity.setId(RandomUtil.uuId()); + entity.setNodeName(operator.getNodeName()); + entity.setNodeId(operator.getNodeId()); + entity.setNodeCode(operator.getNodeCode()); + entity.setStatus(state); + entity.setTaskId(operator.getTaskId()); + entity.setIsProcessing(operator.getIsProcessing()); + entity.setEngineType(operator.getEngineType()); + Boolean flowTodo = serviceUtil.getFlowTodo(); + if (flowTodo) { + entity.setSignTime(new Date()); + entity.setStartHandleTime(new Date()); + } else { + Boolean flowSign = serviceUtil.getFlowSign(); + if (flowSign) { + entity.setSignTime(new Date()); + } else { + if (global != null && !global.getHasSignFor()) { + entity.setSignTime(new Date()); + } + } + } + entity.setHandleId(handleId); + entity.setHandleAll(operator.getHandleAll()); + entity.setParentId(operator.getParentId()); + entity.setCompletion(0); + return entity; + } + + // 处理子流程 + public void handleSubFlow(TemplateNodeEntity nodeEntity, FlowModel flowModel) throws Exception { + if (!nodeEntity.getNodeType().equals(NodeEnum.subFlow.getType())) { + return; + } + NodeModel nodeModel = JsonUtil.getJsonToBean(nodeEntity.getNodeJson(), NodeModel.class); + List nodeEntityList = flowModel.getNodeEntityList(); + Map> errorRuleUserList = flowModel.getErrorRuleUserList(); + + String templateId = nodeModel.getFlowId(); + TemplateEntity template = templateService.getById(templateId); + if (null == template) { + return; + } + if (!ObjectUtil.equals(template.getStatus(), 1)) { + throw new WorkFlowException(MsgCode.WF140.get()); + } + String flowId = template.getFlowId(); + + TemplateJsonEntity jsonEntity = templateJsonService.getById(flowId); + if (null == jsonEntity) { + return; + } + List subNodeEntityList = templateNodeService.getList(jsonEntity.getId()); + Map subNodes = new HashMap<>(); + for (TemplateNodeEntity node : subNodeEntityList) { + subNodes.put(node.getNodeCode(), JsonUtil.getJsonToBean(node.getNodeJson(), NodeModel.class)); + } + FlowMethod method = new FlowMethod(); + method.setDeploymentId(jsonEntity.getFlowableId()); + TemplateNodeEntity subStart = subNodeEntityList.stream() + .filter(e -> StringUtil.equals(NodeEnum.start.getType(), e.getNodeType())).findFirst() + .orElse(new TemplateNodeEntity()); + method.setNodeCode(subStart.getNodeCode()); + method.setNodes(subNodes); + method.setNodeEntityList(subNodeEntityList); + + List nextApprover = taskUtil.getNextApprover(method); + boolean autoSubmit = ObjectUtil.equals(nodeModel.getAutoSubmit(), 1); + if (autoSubmit) { + if (taskUtil.checkBranch(subStart)) { + throw new WorkFlowException(MsgCode.WF121.get()); + } + if (!taskUtil.checkNextCandidates(nextApprover)) { + throw new WorkFlowException(MsgCode.WF121.get()); + } + } + + String nodeCode = nodeModel.getNodeId(); + TaskEntity taskEntity = flowModel.getTaskEntity(); + String deploymentId = flowModel.getDeploymentId(); + Map nodes = flowModel.getNodes(); + String flowableTaskId = flowModel.getFlowableTaskId(); + + FlowMethod flowMethod = new FlowMethod(); + flowMethod.setFlowModel(flowModel); + flowMethod.setTaskEntity(taskEntity); + flowMethod.setNodeEntity(nodeEntity); + flowMethod.setNodeEntityList(nodeEntityList); + flowMethod.setErrorRule(true); + flowMethod.setExtraRule(true); + // 获取上一级节点 + List nodeCodeList = new ArrayList<>(); + taskUtil.prevNodeList(deploymentId, nodeCode, nodeEntityList, nodeCodeList); + nodeCodeList = nodeCodeList.stream().distinct().collect(Collectors.toList()); + String parentCode; + if (nodeCodeList.size() == 1) { + parentCode = nodeCodeList.get(0); + } else if (nodeCodeList.size() > 1) { + // 如果子流程是合流节点 就存最后一个审批的分流节点 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OperatorEntity::getTaskId, taskEntity.getId()) + .in(OperatorEntity::getNodeCode, nodeCodeList).isNotNull(OperatorEntity::getHandleStatus) + .orderByDesc(OperatorEntity::getHandleTime); + List list = operatorService.list(queryWrapper); + if (CollectionUtil.isNotEmpty(list)) { + parentCode = list.get(0).getNodeCode(); + } else { + parentCode = null; + } + } else { + TemplateNodeEntity startNode = nodeEntityList.stream() + .filter(e -> StringUtil.equals(e.getNodeType(), NodeEnum.start.getType())).findFirst() + .orElse(new TemplateNodeEntity()); + parentCode = startNode.getNodeCode(); + } + TemplateNodeEntity parentNode = nodeEntityList.stream() + .filter(e -> StringUtil.equals(e.getNodeCode(), parentCode)).findFirst() + .orElse(new TemplateNodeEntity()); + String formId = parentNode.getFormId(); + Map resMap = new HashMap<>(); + Map> allData = FlowContextHolder.getAllData(); + Map formData = allData.get(taskEntity.getId() + "_yunzhupaas_" + formId); + if (nodeModel.getIsAsync().equals(FlowNature.ChildAsync)) { + flowMethod.setDeploymentId(deploymentId); + flowMethod.setNodeCode(nodeCode); + flowMethod.setFormData(formData); + flowMethod.setNodes(nodes); + flowMethod.setTaskEntity(taskEntity); + resMap = conditionService.handleCondition(flowMethod); + conditionService.checkCondition(resMap, nodes); + } + // 表单数据传递 + flowMethod.setIsAssign(true); + flowMethod.setIsData(true); + formData = taskUtil.createOrUpdate(flowMethod); + flowMethod.setSubFormData(formData); + + List userIds = taskUtil.userListAll(flowMethod); + List userList = serviceUtil.getUserName(userIds, true); + if (userList.isEmpty()) { + userIds.add(serviceUtil.getAdmin()); + } + + Integer createRule = nodeModel.getCreateRule(); + boolean inTurn = ObjectUtil.equals(createRule, 1); + int flag = 0; + List subTaskData = new ArrayList<>(); + + UserInfo userInfo = flowModel.getUserInfo(); + + for (UserEntity user : userList) { + flag++; + FlowModel model = new FlowModel(); + model.setSubCode(nodeCode); + model.setParentId(taskEntity.getId()); + model.setDeploymentId(jsonEntity.getFlowableId()); + + Map map = new HashMap<>(); + if (CollectionUtil.isNotEmpty(formData)) { + map = new HashMap<>(formData); + } + map.put(FlowFormConstant.FLOWID, flowId); + model.setFormData(map); + model.setFlowId(flowId); + model.setErrorRuleUserList(errorRuleUserList); + + // 自动提交 0.否 + if (autoSubmit) { + model.setStatus(1); + } else { + model.setSubFlow(true); + } + + SubParameterModel subParameter = new SubParameterModel(); + subParameter.setParentCode(parentCode); + subParameter.setNodeId(flowableTaskId); + model.setSubParameter(subParameter); + + UserInfo info = JsonUtil.getJsonToBean(userInfo, UserInfo.class); + info.setUserName(user.getRealName()); + info.setUserAccount(user.getAccount()); + info.setUserId(user.getId()); + model.setUserInfo(info); + + model.setIsAsync(nodeModel.getIsAsync()); + model.setIsFlow(1); + + TaskEntity subTask = new TaskEntity(); + subTask.setCreatorUserId(user.getId()); + model.setTaskEntity(subTask); + + // 依次创建,只创建第一个人的,存储后续的人员参数 + if (inTurn && flag > 1) { + subTaskData.add(model); + continue; + } + + if (nodeModel.getAutoSubmit().equals(1)) { + model.setNodeEntityList(subNodeEntityList); + if (taskUtil.checkNextError(model, nextApprover, false, false) != 0) { + throw new WorkFlowException(MsgCode.WF121.get()); + } + } + + UserProvider.setLocalLoginUser(info); + // 生成任务,根据是否自动发起进行提交 + taskService.saveOrSubmit(model); + + // 组装消息发送的人 + OperatorEntity operator = new OperatorEntity(); + operator.setHandleId(user.getId()); + operator.setNodeCode(nodeEntity.getNodeCode()); + // 子流程任务 + TaskEntity task = model.getTaskEntity(); + operator.setTaskId(task.getId()); + + List operatorList = new ArrayList<>(); + operatorList.add(operator); + + // 消息 + if (ObjectUtil.equals(nodeModel.getAutoSubmit(), 0)) { + FlowMsgModel flowMsgModel = new FlowMsgModel(); + flowMsgModel.setOperatorList(operatorList); + flowMsgModel.setNodeList(nodeEntityList); + flowMsgModel.setFlowModel(flowModel); + flowMsgModel.setTaskEntity(task); + flowMsgModel.setNodeCode(nodeCode); + flowMsgModel.setWait(false); + flowMsgModel.setLaunch(true); + flowMsgModel.setFormData(FlowContextHolder.getAllData()); + msgUtil.message(flowMsgModel); + } + this.autoAudit(model); + } + UserProvider.setLocalLoginUser(userInfo); + // 保存依次创建的子流程数据 + subtaskDataService.save(subTaskData); + + // 异步,直接通过节点,后续继续递归下一级节点生成经办 + if (nodeModel.getIsAsync().equals(FlowNature.ChildAsync)) { + flowMethod.setFlowableTaskId(flowableTaskId); + flowMethod.setResMap(resMap); + completeNode(flowMethod); + } + } + + // 完成节点 + public void completeNode(FlowMethod flowMethod) throws Exception { + FlowModel flowModel = flowMethod.getFlowModel(); + String flowableTaskId = flowMethod.getFlowableTaskId(); + Map resMap = flowMethod.getResMap(); + TaskEntity taskEntity = flowMethod.getTaskEntity(); + taskLineService.create(taskEntity.getId(), resMap); + CompleteFo completeFo = new CompleteFo(); + completeFo.setTaskId(flowableTaskId); + completeFo.setVariables(new HashMap<>(resMap)); + flowAbleUrl.complete(completeFo); + + if (taskUtil.isFinished(flowModel)) { + return; + } + + // 生成经办 + List operatorEntities = operatorService.handleOperator(flowModel); + + List nodeEntityList = flowMethod.getNodeEntityList(); + FlowMsgModel flowMsgModel = new FlowMsgModel(); + flowMsgModel.setNodeList(nodeEntityList); + flowMsgModel.setTaskEntity(taskEntity); + flowMsgModel.setFlowModel(flowModel); + flowMsgModel.setOperatorList(operatorEntities); + flowMsgModel.setFormData(FlowContextHolder.getAllData()); + msgUtil.message(flowMsgModel); + + if (taskEntity.getRejectDataId() == null) { + this.autoAudit(flowModel); + } + } + + public void autoAudit(FlowModel flowModel) throws Exception { + this.autoAudit(flowModel, true); + } + + public void autoAudit(FlowModel flowModel, Boolean flag) throws Exception { + TaskEntity taskEntity = flowModel.getTaskEntity(); + if (null == taskEntity) { + return; + } + flowModel.setBranchList(new ArrayList<>()); + String taskId = taskEntity.getId(); + List operatorList = operatorService.getList(taskId); + operatorList = operatorList.stream() + .filter(e -> !ObjectUtil.equals(e.getStatus(), OperatorStateEnum.Back.getCode()) + && !ObjectUtil.equals(e.getCompletion(), 1)) + .collect(Collectors.toList()); + this.autoAudit(flowModel, operatorList, flag); + } + + @DSTransactional + public void autoAudit(FlowModel flowModel, List operatorList, Boolean flag) throws Exception { + // flag标识为true时 需要排除未激活的经办 + if (flag) { + operatorList = operatorList.stream() + .filter(e -> !ObjectUtil.equals(e.getStatus(), OperatorStateEnum.Waiting.getCode())) + .collect(Collectors.toList()); + } + if (CollectionUtil.isEmpty(operatorList)) { + return; + } + String deploymentId = flowModel.getDeploymentId(); + TaskEntity taskEntity = flowModel.getTaskEntity(); + Map nodes = flowModel.getNodes(); + NodeModel global = nodes.get(NodeEnum.global.getType()); + List nodeEntityList = flowModel.getNodeEntityList(); + TemplateNodeEntity globalEntity = nodeEntityList.stream() + .filter(e -> StringUtil.equals(NodeEnum.global.getType(), e.getNodeType())).findFirst() + .orElse(new TemplateNodeEntity()); + + AutoSubmitConfig autoConfig = global.getAutoSubmitConfig(); + if (!autoConfig.getApproverHasApproval() && !autoConfig.getInitiatorApproverRepeated() + && !autoConfig.getAdjacentNodeApproverRepeated()) { + // 先判断自动审批,未开启直接返回 + return; + } + flowModel.setSignImg(null); + flowModel.setFileList(null); + Map> map = operatorList.stream() + .collect(Collectors.groupingBy(OperatorEntity::getNodeCode)); + List handleIds = operatorList.stream().map(OperatorEntity::getHandleId).distinct() + .collect(Collectors.toList()); + List users = serviceUtil.getUserName(handleIds); + for (String key : map.keySet()) { + NodeModel model = nodes.get(key); + Map> allData = FlowContextHolder.getAllData(); + String modelFormId = model.getFormId(); + modelFormId = StringUtil.isNotBlank(modelFormId) ? modelFormId : globalEntity.getFormId(); + Map formData = allData.get(taskEntity.getId() + "_yunzhupaas_" + modelFormId); + // 获取流程参数 + taskUtil.getGlobalParam(taskEntity, model, global, formData); + flowModel.setTaskEntity(taskEntity); + FlowMethod flowMethod = new FlowMethod(); + flowMethod.setTaskEntity(taskEntity); + flowMethod.setFormData(formData == null ? new HashMap<>() : formData); + flowMethod.setDeploymentId(deploymentId); + flowMethod.setNodeCode(key); + flowMethod.setNodes(nodes); + // 判断节点的线的条件 + Map resMap = conditionService.handleCondition(flowMethod); + try { + conditionService.checkCondition(resMap, nodes); + } catch (WorkFlowException e) { + continue; + } + List nextApprover; + boolean mark = true; + try { + nextApprover = taskUtil.getNextApprover(flowMethod); + } catch (WorkFlowException e) { + nextApprover = null; + mark = false; + } + if (!mark) { + continue; + } + List list = map.get(key); + if (CollectionUtil.isNotEmpty(list)) { + flowModel.setOperatorEntity(list.get(0)); + } + boolean isBranch = taskUtil.checkBranch(model); + boolean nextCandidates = taskUtil.checkNextCandidates(nextApprover); + int nextError = taskUtil.checkNextError(flowModel, nextApprover, false, false); + if (!isBranch && nextCandidates && nextError == 0) { + for (OperatorEntity operator : list) { + operator = operatorService.getById(operator.getId()); + if (null == operator || ObjectUtil.equals(operator.getCompletion(), 1)) { + continue; + } + String handleId = operator.getHandleId(); + String username = ""; + String userId = ""; + String userName = ""; + String userAccount = ""; + UserEntity user = users.stream().filter(e -> ObjectUtil.equals(e.getId(), handleId)).findFirst() + .orElse(null); + if (user != null) { + username = user.getAccount() + "(" + user.getRealName() + ")"; + userId = user.getId(); + userName = user.getRealName(); + userAccount = user.getAccount(); + } + String str = ObjectUtil.equals(operator.getIsProcessing(), 0) ? "自动审批通过" : "自动办理通过"; + flowModel.setHandleOpinion(username + str); + FlowMethod method = new FlowMethod(); + method.setOperatorEntity(operator); + method.setNodeModel(global); + method.setFlowModel(flowModel); + if (this.handleGlobalAuto(method)) { + if (taskEntity.getEndTime() != null) { + return; + } + UserInfo userInfo = flowModel.getUserInfo(); + userInfo.setUserId(userId); + userInfo.setUserAccount(userAccount); + userInfo.setUserName(userName); + flowModel.setUserInfo(userInfo); + flowModel.setHandleStatus(FlowNature.AuditCompletion); + operatorService.audit(operator, flowModel); + if (taskEntity.getRejectDataId() == null) { + this.autoAudit(flowModel); + } + } + } + } + } + } + + // 异常补偿 + public void compensate(TaskEntity taskEntity) throws WorkFlowException { + String instanceId = taskEntity.getInstanceId(); + CompensateFo fo = new CompensateFo(); + fo.setInstanceId(instanceId); + List sourceList = Arrays.stream(taskEntity.getCurrentNodeCode().split(",")) + .collect(Collectors.toList()); + fo.setSource(sourceList); + List models = flowAbleUrl.compensate(fo); + + if (CollectionUtil.isNotEmpty(models)) { + FlowableTaskModel flowableTaskModel = models.get(0); + // 实例ID不一样,更新 + String newInstanceId = flowableTaskModel.getInstanceId(); + if (StringUtil.isNotBlank(newInstanceId) && !instanceId.equals(newInstanceId)) { + taskEntity.setInstanceId(newInstanceId); + taskService.updateById(taskEntity); + } + List nodeRecords = recordUtil.getNodeRecord(taskEntity.getId()); + List nodeIds = nodeRecords.stream().map(NodeRecordEntity::getNodeId).filter(StringUtil::isNotBlank) + .collect(Collectors.toList()); + // 更新经办关联的flowable的任务id + List operatorList = this.getList(taskEntity.getId()); + List updateList = new ArrayList<>(); + // 更新记录关联的flowable的任务id + List recordList = recordUtil.getList(taskEntity.getId()); + List updateRecordList = new ArrayList<>(); + + if (CollectionUtil.isNotEmpty(nodeIds)) { + // 在节点记录中的存在的nodeId,不需要更新 + operatorList = operatorList.stream().filter(e -> !nodeIds.contains(e.getNodeId())) + .collect(Collectors.toList()); + recordList = recordList.stream().filter(e -> !nodeIds.contains(e.getNodeId())) + .collect(Collectors.toList()); + } + + for (FlowableTaskModel model : models) { + List list = operatorList.stream() + .filter(e -> e.getNodeCode().equals(model.getTaskKey())).collect(Collectors.toList()); + list.forEach(e -> e.setNodeId(model.getTaskId())); + updateList.addAll(list); + // 记录修改 + List collect = recordList.stream() + .filter(e -> e.getNodeCode().equals(model.getTaskKey())).collect(Collectors.toList()); + collect.forEach(e -> e.setNodeId(model.getTaskId())); + updateRecordList.addAll(collect); + } + operatorService.updateBatchById(updateList); + recordUtil.updateRecords(updateRecordList); + } + if (!ObjectUtil.equals(taskEntity.getParentId(), "0")) { + TaskEntity parent = taskService.getById(taskEntity.getParentId()); + if (null == parent) { + return; + } + this.compensate(parent); + List currentModel = flowAbleUrl.getCurrentTask(parent.getInstanceId()); + FlowableTaskModel model = currentModel.stream() + .filter(e -> ObjectUtil.equals(taskEntity.getSubCode(), e.getTaskKey())).findFirst().orElse(null); + if (null != model) { + SubParameterModel subParameter = JsonUtil.getJsonToBean(taskEntity.getSubParameter(), + SubParameterModel.class); + subParameter.setNodeId(model.getTaskId()); + taskEntity.setSubParameter(JsonUtil.getObjectToString(subParameter)); + taskService.updateById(taskEntity); + } + } + } + + // 设置异常处理 + public void handleErrorRule(NodeModel nodeModel, List errorList) { + if (null == nodeModel) { + return; + } + FlowErrorModel errorModel = new FlowErrorModel(); + errorModel.setNodeCode(nodeModel.getNodeId()); + errorModel.setNodeName(nodeModel.getNodeName()); + errorList.add(errorModel); + } + + /** + * 校验经办的任务是否暂停 + * + * @param ids 经办主键集合 + * @param resList 结果经办主键集合 + * @param flag true则判断退签 + */ + public void checkBatch(List ids, List resList, Boolean flag) throws WorkFlowException { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(OperatorEntity::getId, ids); + List list = operatorService.list(queryWrapper); + List taskIds = list.stream().map(OperatorEntity::getTaskId).collect(Collectors.toList()); + List taskEntityList = taskIds.isEmpty() ? new ArrayList<>() : taskService.listByIds(taskIds); + + for (OperatorEntity operator : list) { + TaskEntity taskEntity = taskEntityList.stream() + .filter(e -> !Objects.equals(e.getStatus(), TaskStatusEnum.PAUSED.getCode()) + && e.getId().equals(operator.getTaskId())) + .findFirst().orElse(null); + if (null != taskEntity) { + resList.add(operator.getId()); + } + } + if (CollectionUtil.isEmpty(resList)) { + throw new WorkFlowException(MsgCode.WF112.get()); + } + + if (flag) { + resList.clear(); + List flowIds = taskEntityList.stream().map(TaskEntity::getFlowId).collect(Collectors.toList()); + List globalList = templateNodeService.getList(flowIds, NodeEnum.global.getType()); + for (OperatorEntity operator : list) { + TaskEntity taskEntity = taskEntityList.stream() + .filter(e -> e.getId().equals(operator.getTaskId())).findFirst().orElse(null); + if (null != taskEntity) { + TemplateNodeEntity globalEntity = globalList.stream() + .filter(e -> e.getFlowId().equals(taskEntity.getFlowId())).findFirst().orElse(null); + if (null != globalEntity) { + NodeModel global = JsonUtil.getJsonToBean(globalEntity.getNodeJson(), NodeModel.class); + // 开启签收,允许退签 + if (global.getHasSignFor()) { + resList.add(operator.getId()); + } + } + } + } + if (CollectionUtil.isEmpty(resList)) { + throw new WorkFlowException(MsgCode.WF080.get()); + } + } + } + + public void checkBatchRevoke(List ids, List resList, Integer batchType) throws WorkFlowException { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(OperatorEntity::getId, ids); + List list = operatorService.list(queryWrapper); + List status = ImmutableList.of(2, 3); + for (OperatorEntity operator : list) { + if (status.contains(batchType) + && ObjectUtil.equals(operator.getStatus(), OperatorStateEnum.Revoke.getCode())) { + continue; + } + resList.add(operator.getId()); + } + if (CollectionUtil.isEmpty(resList)) { + if (ObjectUtil.equals(batchType, 2)) { + throw new WorkFlowException(MsgCode.WF126.get()); + } else if (ObjectUtil.equals(batchType, 3)) { + throw new WorkFlowException(MsgCode.WF127.get()); + } + } + } + + // 判断终止 + public void checkCancel(List ids, List resList) throws WorkFlowException { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(OperatorEntity::getId, ids); + List list = operatorService.list(queryWrapper); + List taskIds = list.stream().map(OperatorEntity::getTaskId).collect(Collectors.toList()); + List taskEntityList = taskIds.isEmpty() ? new ArrayList<>() : taskService.listByIds(taskIds); + + for (OperatorEntity operator : list) { + TaskEntity taskEntity = taskEntityList.stream() + .filter(e -> !Objects.equals(e.getStatus(), TaskStatusEnum.CANCEL.getCode()) + && e.getId().equals(operator.getTaskId())) + .findFirst().orElse(null); + if (null != taskEntity) { + resList.add(operator.getId()); + } + } + if (CollectionUtil.isEmpty(resList)) { + throw new WorkFlowException(MsgCode.WF123.get()); + } + } + + // 更新经办的接收时间 + public void updateCreateTime(FlowModel flowModel) { + TaskEntity taskEntity = flowModel.getTaskEntity(); + String taskId = taskEntity.getId(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OperatorEntity::getTaskId, taskId) + .isNull(OperatorEntity::getHandleStatus); + List list = operatorService.list(queryWrapper); + if (CollectionUtil.isNotEmpty(list)) { + list.forEach(e -> e.setCreatorTime(new Date())); + operatorService.updateBatchById(list); + TimeUtil.timeModel(list, flowModel, redisUtil); + } + } + + // 添加事件到线程变量 + public void addEvent(FlowModel flowModel) { + Integer status = flowModel.getEventStatus(); + FlowModel model = new FlowModel(); + model.setTaskEntity(flowModel.getTaskEntity()); + model.setNodeEntity(flowModel.getNodeEntity()); + model.setNodes(flowModel.getNodes()); + model.setFormData(flowModel.getFormData()); + if (ObjectUtil.equals(2, status)) { + List nodeEntityList = flowModel.getNodeEntityList(); + TemplateNodeEntity start = nodeEntityList.stream() + .filter(e -> ObjectUtil.equals(e.getNodeType(), NodeEnum.start.getType())).findFirst().orElse(null); + if (null != start) { + model.setNodeEntity(start); + } + } + FlowEventHolder.addEvent(status, model, FlowContextHolder.getAllData()); + } + + // 处理线程变量中的事件 + public void handleEvent() throws WorkFlowException { + List allEvent = FlowEventHolder.getAllEvent(); + for (EventModel eventModel : allEvent) { + this.event(eventModel.getFlowModel(), eventModel.getStatus(), eventModel.getAllData()); + } + FlowEventHolder.clear(); + } + + // 事件 + public void event(FlowModel flowModel, Integer status, Map> allData) + throws WorkFlowException { + FlowModel model = JsonUtil.getJsonToBean(flowModel, FlowModel.class); + TemplateNodeEntity nodeEntity = model.getNodeEntity(); + NodeModel nodeModel = JsonUtil.getJsonToBean(nodeEntity.getNodeJson(), NodeModel.class); + RecordEntity record = new RecordEntity(); + record.setNodeCode(nodeModel.getNodeId()); + // 结束事件 + if (ObjectUtil.equals(status, 2)) { + List nodeEntityList = model.getNodeEntityList(); + TemplateNodeEntity start = nodeEntityList.stream() + .filter(e -> ObjectUtil.equals(e.getNodeType(), NodeEnum.start.getType())).findFirst().orElse(null); + if (null != start) { + nodeModel = JsonUtil.getJsonToBean(start.getNodeJson(), NodeModel.class); + } + } + TaskEntity taskEntity = model.getTaskEntity(); + String formId = nodeEntity.getFormId(); + String taskId = taskEntity.getId(); + Map map = allData.get(taskId + "_yunzhupaas_" + formId) != null + ? allData.get(taskId + "_yunzhupaas_" + formId) + : serviceUtil.infoData(formId, taskId); + model.setFormData(map); + msgUtil.event(status, nodeModel, record, model); + } + + // 事件 + public void event(FlowModel flowModel, Integer status) throws WorkFlowException { + event(flowModel, status, new HashMap<>()); + } + + public List getList(String taskId, List nodeCodes) { + if (StringUtil.isEmpty(taskId)) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OperatorEntity::getTaskId, taskId).ne(OperatorEntity::getStatus, + OperatorStateEnum.Futility.getCode()); + if (CollectionUtil.isNotEmpty(nodeCodes)) { + queryWrapper.lambda().in(OperatorEntity::getNodeCode, nodeCodes); + } + queryWrapper.lambda().orderByDesc(OperatorEntity::getCreatorTime); + return operatorService.list(queryWrapper); + } + + public void deleteInTurnOperator(OperatorEntity operator, String handleId) { + List handleAll = new ArrayList<>(); + if (operator.getHandleAll() != null) { + handleAll = Arrays.stream(operator.getHandleAll().split(",")).collect(Collectors.toList()); + } else { + String handleParameter = operator.getHandleParameter(); + AddSignModel addSignModel = JsonUtil.getJsonToBean(handleParameter, AddSignModel.class); + if (ObjectUtil.equals(addSignModel.getCounterSign(), 2)) { + handleAll = addSignModel.getAddSignUserIdList(); + } + } + int index = handleAll.indexOf(handleId); + if (index != -1 && index < handleAll.size() - 1) { + String nextHandleId = handleAll.get(index + 1); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OperatorEntity::getNodeId, operator.getNodeId()) + .eq(OperatorEntity::getHandleId, nextHandleId); + List deleteList = operatorService.list(queryWrapper); + if (CollectionUtil.isNotEmpty(deleteList)) { + operatorService.removeByIds(deleteList); + } + } + } + + // 处理嵌入的任务流程 + public void handleTrigger(OperatorEntity operatorEntity, FlowModel flowModel) throws WorkFlowException { + String nodeCode = operatorEntity.getNodeCode(); + Map nodes = flowModel.getNodes(); + List nextList = new ArrayList<>(); + nextList = taskUtil.getNextList(flowModel.getDeploymentId(), nodeCode, nodes, nextList); + if (CollectionUtil.isEmpty(nextList)) { + return; + } + + Integer action = flowModel.getAction(); + TaskEntity taskEntity = flowModel.getTaskEntity(); + String flowId = taskEntity.getFlowId(); + Map formData = flowModel.getFormData(); + List systemList = SystemAuditHolder.getAll(); + + // 存在同步 + boolean isAsync = false; + + List approveNode = new ArrayList<>(); + Map triggers = new HashMap<>(); + for (String next : nextList) { + NodeModel nodeModel = nodes.get(next); + if (null != nodeModel) { + if (ObjectUtil.equals(nodeModel.getType(), NodeEnum.trigger.getType())) { + if (ObjectUtil.equals(nodeModel.getIsAsync(), 0)) { + isAsync = true; + } + triggers.put(next, nodeModel); + } else if (ObjectUtil.equals(nodeModel.getType(), NodeEnum.approver.getType())) { + approveNode.add(nodeModel.getNodeId()); + } + } + } + + if (CollectionUtil.isEmpty(triggers)) { + return; + } + + Boolean rejectTrigger = flowModel.getRejectTrigger(); + if (ObjectUtil.equals(action, 3) || rejectTrigger) { + Map variables = triggerUtil.getVariables(flowModel.getDeploymentId(), nodeCode); + if (ObjectUtil.equals(action, 3)) { + List nodeEntityList = flowModel.getNodeEntityList(); + TemplateNodeEntity end = nodeEntityList.stream() + .filter(e -> ObjectUtil.equals(e.getNodeType(), NodeEnum.end.getType())).findFirst() + .orElse(null); + if (null != end) { + // 将目标是结束节点的线 的值变更为false + FlowableNodeModel info = flowAbleUrl.getElementInfo(flowModel.getDeploymentId(), end.getNodeCode()); + List incomingList = info.getIncomingList(); + if (CollectionUtil.isNotEmpty(incomingList)) { + for (String key : variables.keySet()) { + if (incomingList.contains(key)) { + variables.put(key, false); + } + } + } + } + } + triggerUtil.complete(operatorEntity.getNodeId(), variables); + } else { + // 异步处理 + if (!isAsync) { + // 获取线程存储的需要系统通过的经办 + if (CollectionUtil.isNotEmpty(systemList)) { + for (SystemAuditModel model : systemList) { + try { + this.autoAudit(model.getOperator(), model.getFlowModel()); + } catch (Exception e) { + log.error("系统审批异常", e); + } + } + systemList = new ArrayList<>(); + } + } + } + + UserInfo userInfo = UserProvider.getUser(); + List list = new ArrayList<>(); + for (String key : triggers.keySet()) { + NodeModel nodeModel = nodes.get(key); + if (null == nodeModel) { + continue; + } + if (ObjectUtil.equals(nodeModel.getTriggerEvent(), 2)) { + if (!nodeModel.getActionList().contains(action)) { + continue; + } + } + List operatorList = new ArrayList<>(); + List subTaskList = new ArrayList<>(); + Boolean sync = ObjectUtil.equals(nodeModel.getIsAsync(), 0); + if (sync) { + if (CollectionUtil.isNotEmpty(approveNode)) { + operatorList = this.getList(taskEntity.getId(), approveNode); + if (CollectionUtil.isNotEmpty(operatorList)) { + for (OperatorEntity operator : operatorList) { + operator.setStatus(OperatorStateEnum.Waiting.getCode()); + } + operatorService.updateBatchById(operatorList); + } + // 子流程的处理 + subTaskList = taskUtil.getSubTask(taskEntity.getId(), approveNode); + if (CollectionUtil.isNotEmpty(subTaskList)) { + for (TaskEntity subTask : subTaskList) { + Integer status = subTask.getStatus(); + subTask.setHisStatus(status); + subTask.setStatus(-2); + } + taskService.updateBatchById(subTaskList); + } + } + } + List> dataList = new ArrayList<>(); + dataList.add(formData); + ExecuteModel model = new ExecuteModel(); + model.setFlowId(flowId); + model.setDataList(dataList); + model.setUserInfo(userInfo); + model.setParentId("0"); + model.setTaskId(taskEntity.getId()); + model.setInstanceId(taskEntity.getInstanceId()); + model.setGroupId(nodeModel.getGroupId()); + model.setNodeCode(nodeCode); + model.setNodeId(operatorEntity.getNodeId()); + model.setTriggerKey(key); + model.setIsAsync(nodeModel.getIsAsync()); + if (ObjectUtil.equals(action, 3) || rejectTrigger) { + try { + triggerUtil.execute(model); + } catch (Exception e) { + e.printStackTrace(); + // TriggerRecordHolder.clear(); + if (sync) { + taskService.cancel(taskEntity.getId(), flowModel, true); + } + } + flowModel.setBackId(model.getCurrentNodeId()); + } else { + // flowAsyncUtil.execute(model, sync, operatorList, subTaskList, systemList, + // flowModel); + ExecuteAsyncModel asyncModel = new ExecuteAsyncModel(); + asyncModel.setModel(model); + asyncModel.setSync(sync); + asyncModel.setOperatorList(operatorList); + asyncModel.setSubTaskList(subTaskList); + asyncModel.setSystemList(systemList); + asyncModel.setFlowModel(flowModel); + list.add(asyncModel); + } + } + try { + flowAsyncUtil.execute(list); + } catch (Exception e) { + e.printStackTrace(); + // TriggerRecordHolder.clear(); + } + SystemAuditHolder.clear(); + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/OverTimeUtil.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/OverTimeUtil.java new file mode 100644 index 0000000..414b0d9 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/OverTimeUtil.java @@ -0,0 +1,105 @@ +package com.yunzhupaas.flowable.util; + +import cn.hutool.core.util.ObjectUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.OperatorEntity; +import com.yunzhupaas.flowable.entity.TaskEntity; +import com.yunzhupaas.flowable.entity.TemplateEntity; +import com.yunzhupaas.flowable.enums.OperatorStateEnum; +import com.yunzhupaas.flowable.model.message.FlowMsgModel; +import com.yunzhupaas.flowable.model.time.FlowTimeModel; +import com.yunzhupaas.flowable.service.OperatorService; +import com.yunzhupaas.flowable.service.TaskService; +import com.yunzhupaas.flowable.service.TemplateService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2024/5/23 上午10:33 + */ +@Component +public class OverTimeUtil { + @Autowired + private MsgUtil msgUtil; + @Autowired + private TaskUtil taskUtil; + @Autowired + private TaskService taskService; + @Autowired + private OperatorService operatorService; + @Autowired + private TemplateService templateService; + + public void overMsg(FlowTimeModel flowTimeModel) throws WorkFlowException { + TaskEntity task = taskService.getInfo(flowTimeModel.getTaskId()); + //暂停,是跳过 + if (task == null) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + boolean isSuccess = false; + try { + taskUtil.isSuspend(task); + } catch (Exception e) { + isSuccess = true; + } + if (!isSuccess) { + // 判断是否下架 + TemplateEntity template = templateService.getById(task.getTemplateId()); + if (null != template && !ObjectUtil.equals(template.getStatus(), 1)) { + isSuccess = true; + } + } + if (isSuccess) { + if (flowTimeModel.getOverTime()) { + flowTimeModel.setNum(flowTimeModel.getNum() + 1); + flowTimeModel.setTransferNum(flowTimeModel.getTransferNum() + 1); + } + flowTimeModel.setIsPause(true); + return; + } + taskUtil.isCancel(task); + OperatorEntity operator = operatorService.getById(flowTimeModel.getOperatorId()); + if (operator == null || ObjectUtil.equals(operator.getStatus(), OperatorStateEnum.Futility.getCode())) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + if (operator.getHandleStatus() != null) { + throw new WorkFlowException(MsgCode.WF031.get()); + } + // complete为1的经办,不执行(加签、指派、转办、驳回、撤回、变更、复活流程,该节点的限时提醒规则重新生效) + if (operator.getCompletion().equals(1)) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + if (flowTimeModel.getOverTime()) { + if (operator.getDuedate() == null) { + operator.setDuedate(new Date()); + operatorService.updateById(operator); + } + } + List list = new ArrayList<>(); + list.add(operator); + FlowMsgModel msgModel = new FlowMsgModel(); + msgModel.setFlowModel(flowTimeModel.getFlowModel()); + msgModel.setTaskEntity(task); + msgModel.setNodeList(flowTimeModel.getFlowModel().getNodeEntityList()); + msgModel.setNodeCode(operator.getNodeCode()); + msgModel.setOperatorList(list); + msgModel.setNotice(!flowTimeModel.getOverTime()); + msgModel.setOvertime(flowTimeModel.getOverTime()); + msgModel.setWait(false); + msgUtil.message(msgModel); + if (flowTimeModel.getOverTime()) { + flowTimeModel.setNum(flowTimeModel.getNum() + 1); + flowTimeModel.setTransferNum(flowTimeModel.getTransferNum() + 1); + } + } + +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/RecordUtil.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/RecordUtil.java new file mode 100644 index 0000000..f6a3920 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/RecordUtil.java @@ -0,0 +1,443 @@ +package com.yunzhupaas.flowable.util; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.google.common.collect.ImmutableList; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.*; +import com.yunzhupaas.flowable.enums.NodeEnum; +import com.yunzhupaas.flowable.enums.OperatorStateEnum; +import com.yunzhupaas.flowable.enums.RecordEnum; +import com.yunzhupaas.flowable.enums.TaskStatusEnum; +import com.yunzhupaas.flowable.model.record.ProgressModel; +import com.yunzhupaas.flowable.model.record.RecordVo; +import com.yunzhupaas.flowable.model.record.UserItem; +import com.yunzhupaas.flowable.model.task.FlowMethod; +import com.yunzhupaas.flowable.model.task.FlowModel; +import com.yunzhupaas.flowable.model.templatenode.nodejson.NodeModel; +import com.yunzhupaas.flowable.model.util.FlowNature; +import com.yunzhupaas.flowable.service.NodeRecordService; +import com.yunzhupaas.flowable.service.OperatorService; +import com.yunzhupaas.flowable.service.RecordService; +import com.yunzhupaas.flowable.service.TriggerTaskService; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/26 17:05 + */ +@Component +public class RecordUtil { + @Autowired + private RecordService recordService; + @Autowired + private ServiceUtil serviceUtil; + @Autowired + private OperatorUtil operatorUtil; + @Autowired + private OperatorService operatorService; + @Autowired + private NodeRecordService nodeRecordService; + @Autowired + private TriggerTaskService triggerTaskService; + + // 根据经办主键获取转审/转办记录 + public RecordEntity getTransferRecord(String operatorId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(RecordEntity::getOperatorId, operatorId) + .in(RecordEntity::getHandleType, RecordEnum.transfer.getCode(), RecordEnum.transferProcessing.getCode()) + .orderByDesc(RecordEntity::getHandleTime); + queryWrapper.lambda().select(RecordEntity::getId, RecordEntity::getHandleId); + List list = recordService.page(new Page<>(1, 1, false), queryWrapper).getRecords(); + if (CollectionUtil.isNotEmpty(list)) { + return list.get(0); + } + return new RecordEntity(); + } + + // 获取节点记录 + public List getNodeRecord(String taskId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(NodeRecordEntity::getTaskId, taskId).ne(NodeRecordEntity::getNodeStatus, 5) + .orderByDesc(NodeRecordEntity::getCreatorTime); + List list = nodeRecordService.list(queryWrapper); + return CollectionUtil.isNotEmpty(list) ? list : new ArrayList<>(); + } + + // 根据任务主键、节点id 获取记录 + public List getList(String taskId, String nodeId) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(RecordEntity::getTaskId, taskId).eq(RecordEntity::getNodeId, nodeId) + .orderByDesc(RecordEntity::getHandleTime); + return recordService.list(wrapper); + } + + public List getList(String taskId) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(RecordEntity::getTaskId, taskId).orderByAsc(RecordEntity::getHandleTime); + return recordService.list(wrapper); + } + + public void updateRecords(List recordList) { + if (CollectionUtil.isNotEmpty(recordList)) { + recordService.updateBatchById(recordList); + } + } + + // 将经办相关的记录作废 + public void invalid(List operatorList) { + List opIds = operatorList.stream().map(OperatorEntity::getId).collect(Collectors.toList()); + if (CollectionUtil.isNotEmpty(opIds)) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(RecordEntity::getOperatorId, opIds); + List list = recordService.list(queryWrapper); + for (RecordEntity record : list) { + record.setStatus(-1); + } + recordService.updateBatchById(list); + } + } + + // 作废加签记录 + public void invalidAddSignRecord(OperatorEntity operator) { + if (null != operator && null != operator.getId()) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(RecordEntity::getOperatorId, operator.getId()).eq(RecordEntity::getHandleType, + RecordEnum.addSign.getCode()); + List list = recordService.list(queryWrapper); + if (CollectionUtil.isNotEmpty(list)) { + for (RecordEntity record : list) { + record.setStatus(-1); + } + recordService.updateBatchById(list); + } + } + } + + /** + * 创建记录 + */ + public void createRecord(FlowMethod flowMethod) { + FlowModel flowModel = flowMethod.getFlowModel(); + String userId = flowMethod.getUserId(); + OperatorEntity operator = flowMethod.getOperatorEntity(); + Integer type = flowMethod.getType(); + String handId = flowMethod.getHandId(); + + // 已存在同意操作的记录(说明是后加签默认同意,无需再次保存) + if (ObjectUtil.equals(RecordEnum.audit.getCode(), type)) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(RecordEntity::getOperatorId, operator.getId()) + .eq(RecordEntity::getHandleType, type) + .ne(RecordEntity::getStatus, -1); + if (recordService.count(queryWrapper) > 0) + return; + } + + RecordEntity entity = new RecordEntity(); + entity.setId(RandomUtil.uuId()); + entity.setHandleId(handId); + if (null != operator) { + if (StringUtil.isBlank(handId)) { + if (ObjectUtil.equals(operator.getHandleId(), FlowNature.SYSTEM_CODE)) { + entity.setHandleId(FlowNature.SYSTEM_CODE); + } else { + entity.setHandleId(operator.getHandleId()); + } + } + if (StringUtil.isBlank(entity.getHandleId())) { + String loginUserId = UserProvider.getLoginUserId(); + entity.setHandleId(loginUserId); + } + entity.setNodeId(operator.getNodeId()); + entity.setNodeCode(operator.getNodeCode()); + entity.setNodeName(operator.getNodeName()); + entity.setTaskId(operator.getTaskId()); + entity.setOperatorId(operator.getId()); + entity.setHandleType(operator.getHandleStatus()); + entity.setHandleTime(operator.getHandleTime() == null ? new Date() : operator.getHandleTime()); + entity.setCreatorTime(operator.getCreatorTime() == null ? new Date() : operator.getCreatorTime()); + } + entity.setHandleOpinion(flowModel.getHandleOpinion()); + entity.setHandleUserId(userId); + entity.setSignImg(flowModel.getSignImg()); + if (CollectionUtil.isNotEmpty(flowModel.getFileList())) { + entity.setFileList(JsonUtil.getObjectToString(flowModel.getFileList())); + } + // 拓展字段 + List expandField = flowModel.getApprovalField(); + if (CollectionUtil.isNotEmpty(expandField)) { + String str = JsonUtil.getObjectToString(expandField); + entity.setExpandField(str); + } + entity.setHandleType(type); + entity.setStatus(0); + + recordService.save(entity); + } + + /** + * 获取流转记录 + * + * @param records 流转记录集合 + */ + public List getRecordList(List records) { + List vos = new ArrayList<>(); + if (CollectionUtil.isNotEmpty(records)) { + List userList = serviceUtil + .getUserName(records.stream().map(RecordEntity::getHandleId).collect(Collectors.toList())); + for (RecordEntity record : records) { + RecordVo vo = JsonUtil.getJsonToBean(record, RecordVo.class); + UserEntity userEntity = userList.stream().filter(t -> t.getId().equals(record.getHandleId())) + .findFirst().orElse(null); + vo.setUserName(userEntity != null ? userEntity.getRealName() + "/" + userEntity.getAccount() : ""); + if (userEntity != null) { + vo.setHeadIcon(UploaderUtil.uploaderImg(userEntity.getHeadIcon())); + } + // 设置流转操作人 + String handleUserId = record.getHandleUserId(); + if (StringUtil.isNotEmpty(handleUserId)) { + List userIds = Arrays.stream(handleUserId.split(",")).collect(Collectors.toList()); + List handleUserList = serviceUtil.getUserName(userIds); + List handleUserName = new ArrayList<>(); + for (String userId : userIds) { + UserEntity user = handleUserList.stream().filter(t -> t.getId().equals(userId)).findFirst() + .orElse(null); + if (null != user) { + handleUserName.add(user.getRealName() + "/" + user.getAccount()); + } + } + if (CollectionUtil.isNotEmpty(handleUserName)) { + vo.setHandleUserName(String.join(",", handleUserName)); + } + } + if (record.getExpandField() != null) { + List expandField = JsonUtil.getJsonToList(record.getExpandField(), Map.class); + vo.setApprovalField(expandField); + } + vos.add(vo); + } + } + return vos; + } + + /** + * 进度 + * + * @param flowModel 参数 + */ + public List getProgressList(FlowModel flowModel) throws WorkFlowException { + List progressList = new ArrayList<>(); + TaskEntity taskEntity = flowModel.getTaskEntity(); + List nodeEntities = flowModel.getNodeEntityList(); + + List nodeRecordList = nodeRecordService.getList(taskEntity.getId()); + + List operatorList = operatorService.getList(taskEntity.getId()); + List recordList = recordService.getList(taskEntity.getId()); + + List userIds = new ArrayList<>(); + List operatorUserIds = operatorList.stream().map(OperatorEntity::getHandleId) + .collect(Collectors.toList()); + List recordUserIds = recordList.stream().map(RecordEntity::getHandleId).collect(Collectors.toList()); + userIds.addAll(operatorUserIds); + userIds.addAll(recordUserIds); + userIds = userIds.stream().distinct().collect(Collectors.toList()); + + List users = serviceUtil.getUserName(userIds, false); + + for (NodeRecordEntity nodeRecord : nodeRecordList) { + + TemplateNodeEntity nodeEntity = nodeEntities.stream() + .filter(e -> e.getNodeCode().equals(nodeRecord.getNodeCode())).findFirst().orElse(null); + if (null == nodeEntity) { + continue; + } + NodeModel nodeModel = JsonUtil.getJsonToBean(nodeEntity.getNodeJson(), NodeModel.class); + if (nodeModel.getType().equals(NodeEnum.subFlow.getType())) { + continue; + } + ProgressModel model = new ProgressModel(); + model.setId(RandomUtil.uuId()); + model.setStartTime(nodeRecord.getCreatorTime().getTime()); + model.setNodeId(nodeRecord.getNodeId()); + model.setNodeCode(nodeRecord.getNodeCode()); + model.setNodeName(nodeRecord.getNodeName()); + model.setNodeType(NodeEnum.approver.getType()); + model.setNodeStatus(nodeRecord.getNodeStatus()); + if (nodeModel.getType().equals(NodeEnum.start.getType())) { + model.setNodeType(NodeEnum.start.getType()); + progressList.add(model); + continue; + } + + model.setCounterSign(nodeModel.getCounterSign()); + + List records = recordList.stream() + .filter(e -> Objects.equals(e.getNodeCode(), nodeModel.getNodeId()) + && Objects.equals(e.getNodeId(), nodeRecord.getNodeId())) + .sorted(Comparator.comparing(RecordEntity::getHandleTime).reversed()).collect(Collectors.toList()); + + model.setApproverCount(CollectionUtil.isNotEmpty(records) ? records.size() : 0); + + List items = new ArrayList<>(); + for (int i = 0; i < records.size(); i++) { + UserItem item = new UserItem(); + RecordEntity record = records.get(i); + UserEntity user = users.stream().filter(e -> ObjectUtil.equals(record.getHandleId(), e.getId())) + .findFirst().orElse(null); + if (user != null) { + item.setHeadIcon(UploaderUtil.uploaderImg(user.getHeadIcon())); + item.setUserId(user.getId()); + item.setUserName(user.getRealName()); + } else { + item.setHeadIcon(UploaderUtil.uploaderImg(FlowNature.SYSTEM_HEAD_ICON)); + item.setUserId(FlowNature.SYSTEM_CODE); + item.setUserName(FlowNature.SYSTEM_NAME); + } + item.setHandleType(record.getHandleType()); + items.add(item); + if (i == 3) { + break; + } + } + model.setApprover(items); + // 判断是否存在任务流程 + model.setShowTaskFlow(triggerTaskService.existTriggerTask(taskEntity.getId(), model.getNodeId())); + progressList.add(model); + } + + // 当前节点 + List status = ImmutableList.of(TaskStatusEnum.RECALL.getCode(), TaskStatusEnum.BACKED.getCode(), + TaskStatusEnum.CANCEL.getCode()); + if (taskEntity.getEndTime() == null && !status.contains(taskEntity.getStatus())) { + String currentNodeCode = taskEntity.getCurrentNodeCode(); + if (StringUtil.isNotBlank(currentNodeCode)) { + List currentCodeList = Arrays.stream(currentNodeCode.split(",")).collect(Collectors.toList()); + + for (int i = 0; i < currentCodeList.size(); i++) { + String nodeCode = currentCodeList.get(i); + + TemplateNodeEntity nodeEntity = nodeEntities.stream().filter(e -> e.getNodeCode().equals(nodeCode)) + .findFirst().orElse(null); + if (null == nodeEntity) { + continue; + } + NodeModel nodeModel = JsonUtil.getJsonToBean(nodeEntity.getNodeJson(), NodeModel.class); + if (nodeModel.getType().equals(NodeEnum.subFlow.getType())) { + continue; + } + boolean isProcessing = ObjectUtil.equals(nodeEntity.getNodeType(), NodeEnum.processing.getType()); + ProgressModel model = new ProgressModel(); + model.setId(RandomUtil.uuId()); + + model.setNodeCode(nodeCode); + model.setNodeName(nodeModel.getNodeName()); + model.setNodeType(isProcessing ? NodeEnum.processing.getType() : NodeEnum.approver.getType()); + model.setNodeStatus(isProcessing ? 8 : 4); + model.setCounterSign(nodeModel.getCounterSign()); + + List operators = operatorList.stream() + .filter(e -> Objects.equals(e.getNodeCode(), nodeModel.getNodeId()) + && !(ObjectUtil.equals(e.getCompletion(), 1) && null == e.getHandleTime() + && !ObjectUtil.equals(e.getParentId(), "0")) + && !Objects.equals(e.getStatus(), OperatorStateEnum.Assist.getCode()) + && !Objects.equals(e.getStatus(), OperatorStateEnum.Futility.getCode())) + .sorted(Comparator.comparing(OperatorEntity::getCreatorTime, Comparator.reverseOrder()) + .thenComparing(OperatorEntity::getCompletion)) + .collect(Collectors.toList()); + + String nodeId; + if (CollectionUtil.isNotEmpty(operators)) { + OperatorEntity operator = operators.get(0); + nodeId = operator.getNodeId(); + model.setStartTime(operators.get(0).getCreatorTime().getTime()); + operators = operators.stream().filter(e -> ObjectUtil.equals(e.getNodeId(), nodeId)) + .collect(Collectors.toList()); + // 触发节点选择同步,变更为等待中状态 + if (ObjectUtil.equals(operator.getStatus(), OperatorStateEnum.Waiting.getCode())) { + model.setNodeStatus(7); + } + } else { + nodeId = ""; + } + model.setNodeId(nodeId); + model.setApproverCount(CollectionUtil.isNotEmpty(operators) ? operators.size() : 0); + + List records = recordList.stream() + .filter(e -> Objects.equals(e.getNodeCode(), nodeModel.getNodeId())) + .sorted(Comparator.comparing(RecordEntity::getHandleTime).reversed()) + .collect(Collectors.toList()); + + List items = new ArrayList<>(); + for (int j = 0; j < operators.size(); j++) { + OperatorEntity operator = operators.get(j); + UserItem item = new UserItem(); + UserEntity user = users.stream() + .filter(e -> ObjectUtil.equals(operator.getHandleId(), e.getId())).findFirst() + .orElse(null); + if (user != null) { + item.setHeadIcon(UploaderUtil.uploaderImg(user.getHeadIcon())); + item.setUserId(user.getId()); + item.setUserName(user.getRealName()); + } else { + if (ObjectUtil.equals(operator.getHandleId(), FlowNature.SYSTEM_CODE)) { + item.setHeadIcon(FlowNature.SYSTEM_HEAD_ICON); + item.setUserName(FlowNature.SYSTEM_NAME); + item.setUserId(FlowNature.SYSTEM_CODE); + } + } + + if (null != operator.getHandleStatus() && null != operator.getHandleTime()) { + item.setHandleType(operator.getHandleStatus()); + } else { + RecordEntity record = records.stream() + .sorted(Comparator.comparing(RecordEntity::getId).reversed()) + .filter(e -> ObjectUtil.equals(e.getOperatorId(), operator.getId()) + && ObjectUtil.equals(e.getNodeId(), operator.getNodeId()) + && !ObjectUtil.equals(e.getStatus(), -1) + && !ObjectUtil.equals(e.getHandleType(), RecordEnum.back.getCode())) + .findFirst().orElse(null); + if (null != record) { + item.setHandleType(record.getHandleType()); + } else { + // -1.待审 -2.未审 -3.待办理 -4.未办理(暂未用到) + item.setHandleType(isProcessing ? -3 : -1); + } + } + items.add(item); + } + // items = + // items.stream().sorted(Comparator.comparing(UserItem::getHandleType)).collect(Collectors.toList()); + if (items.size() > 4) { + items = items.subList(0, 4); + } + model.setApprover(items); + progressList.add(model); + } + } + } + + // 添加结束节点 + if (taskEntity.getEndTime() != null) { + ProgressModel model = new ProgressModel(); + model.setId(RandomUtil.uuId()); + model.setStartTime(taskEntity.getEndTime().getTime()); + model.setNodeType(NodeEnum.end.getType()); + model.setNodeName("结束"); + progressList.add(model); + } + return progressList; + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/RedisLock.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/RedisLock.java new file mode 100644 index 0000000..6d2c8c8 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/RedisLock.java @@ -0,0 +1,44 @@ +package com.yunzhupaas.flowable.util; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.script.DefaultRedisScript; +import org.springframework.data.redis.core.script.RedisScript; +import org.springframework.stereotype.Component; + +import java.util.Collections; +import java.util.concurrent.TimeUnit; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2025/1/9 14:19 + */ +@Component +public class RedisLock { + private static final String LOCK_KEY_PREFIX = "workflow-lock:"; + + @Autowired + private RedisTemplate redisTemplate; + + private String getLockKey(String lockName) { + return LOCK_KEY_PREFIX + lockName; + } + + // false表示设置失败 + public boolean lock(String lockName, String lockValue, long expireTime, TimeUnit unit) { + Boolean result = redisTemplate.opsForValue().setIfAbsent(getLockKey(lockName), lockValue, + unit.toSeconds(expireTime), TimeUnit.SECONDS); + return result != null && result; + } + + public boolean unlock(String lockName, String lockValue) { + String script = "if redis.call('get', KEYS[1]) == ARGV[1] then return redis.call('del', KEYS[1]) else return 0 end"; + RedisScript redisScript = new DefaultRedisScript<>(script, Long.class); + Long result = redisTemplate.execute(redisScript, Collections.singletonList(getLockKey(lockName)), + Collections.singletonList(lockValue)); + return result != null && result > 0; + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/ServiceUtil.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/ServiceUtil.java new file mode 100644 index 0000000..edb66ac --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/ServiceUtil.java @@ -0,0 +1,515 @@ +package com.yunzhupaas.flowable.util; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.DataInterfaceEntity; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.model.VisualDevJsonModel; +import com.yunzhupaas.base.model.flow.DataModel; +import com.yunzhupaas.base.model.flow.FlowFormDataModel; +import com.yunzhupaas.base.model.schedule.ScheduleNewCrForm; +import com.yunzhupaas.base.model.systemconfig.SysConfigModel; +import com.yunzhupaas.base.service.*; +import com.yunzhupaas.base.util.SentMessageUtil; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.emnus.ModuleTypeEnum; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.extend.service.DocumentApi; +import com.yunzhupaas.flowable.entity.TemplateEntity; +import com.yunzhupaas.flowable.model.template.TemplateExportModel; +import com.yunzhupaas.flowable.model.util.FlowContextHolder; +import com.yunzhupaas.flowable.model.util.FlowNature; +import com.yunzhupaas.message.model.SentMessageForm; +import com.yunzhupaas.message.service.SendMessageConfigService; +import com.yunzhupaas.model.document.FlowFileModel; +import com.yunzhupaas.model.login.UserSystemVO; +import com.yunzhupaas.onlinedev.model.PaginationModel; +import com.yunzhupaas.base.model.OnlineImport.VisualdevModelDataInfoVO; +import com.yunzhupaas.onlinedev.model.VisualParamModel; +import com.yunzhupaas.permission.constant.AuthorizeConst; +import com.yunzhupaas.permission.entity.*; +import com.yunzhupaas.permission.model.organizeadministrator.OrganizeAdministratorModel; +import com.yunzhupaas.permission.model.user.UserIdListVo; +import com.yunzhupaas.permission.service.*; +import com.yunzhupaas.util.DataFileExport; +import com.yunzhupaas.util.GeneraterSwapUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.enums.DictionaryDataEnum; +import com.yunzhupaas.visual.service.VisualdevApi; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; +import org.springframework.stereotype.Component; + +import java.util.*; +import java.util.stream.Collectors; + +import static com.yunzhupaas.util.Constants.ADMIN_KEY; + +@Component +public class ServiceUtil { + @Autowired + private DictionaryDataService dictionaryDataService; + @Autowired + private UserRelationService userRelationService; + @Autowired + private UserService userService; + @Autowired + private RoleService roleService; + @Autowired + private OrganizeService organizeService; + @Autowired + private OrganizeAdministratorService organizeAdministratorService; + @Autowired + private PositionService positionService; + @Autowired + private BillRuleService billRuleService; + @Autowired + private DataInterfaceService dataInterfaceService; + @Autowired + private SentMessageUtil sentMessageUtil; + @Lazy + @Autowired + private FlowAsyncUtil flowAsyncUtil; + @Autowired + private SendMessageConfigService sendMessageConfigService; + @Autowired + private DataFileExport fileExport; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private CommonWordsService commonWordsService; + @Autowired + private SignService signService; + + @Autowired + private PermissionGroupService permissionGroupService; + @Autowired + private AuthorizeService authorizeService; + + @Autowired + private VisualdevApi visualdevApi; + @Autowired + private DocumentApi documentApi; + @Autowired + private GeneraterSwapUtil generaterSwapUtil; + @Autowired + private SystemConfigApi systemConfigApi; + @Autowired + private ScheduleNewApi scheduleNewApi; + + // 创建日程 + public void createSchedule(ScheduleNewCrForm fo) throws WorkFlowException { + ActionResult result = scheduleNewApi.create(fo); + if (result.getCode() != 200) { + throw new WorkFlowException(result.getMsg()); + } + } + + // 获取系统配置 + public SysConfigModel getSysConfig() { + ActionResult actionResult = systemConfigApi.list(); + return actionResult.getData(); + } + + // 获取系统配置,流程签收 + public Boolean getFlowSign() { + ActionResult actionResult = systemConfigApi.list(); + SysConfigModel data = actionResult.getData(); + return data.getFlowSign() == 0; + } + + // 获取系统配置,流程办理 + public Boolean getFlowTodo() { + ActionResult actionResult = systemConfigApi.list(); + SysConfigModel data = actionResult.getData(); + return data.getFlowTodo() == 0; + } + + // 流水号 + public String getBillNumber() { + return generaterSwapUtil.getBillNumber(FlowNature.REVOKE_BILL_CODE, false); + } + + // -------------------------------签名----------------------------- + public void updateSign(String signId, String signImg) { + SignEntity signEntity = signService.getById(signId); + if (null != signEntity) { + signService.updateDefault(signId); + } else { + signEntity = new SignEntity(); + signEntity.setIsDefault(1); + signEntity.setSignImg(signImg); + signService.create(signEntity); + } + } + + // -------------------------------常用语----------------------------- + public void addCommonWordsNum(String handleOpinion) { + commonWordsService.addCommonWordsNum(handleOpinion); + } + + // -------------------------------文件----------------------------- + // 判断是否存在归档文件,不存在为true + public Boolean checkFlowFile(String taskId) { + return documentApi.checkFlowFile(taskId); + } + + // 获取归档文件 + public List> getFlowFile(FlowFileModel model) { + return documentApi.getFlowFile(model); + } + + // -------------------------------发起权限----------------------------- + public List getLaunchPermission(String userId) { + List resList = new ArrayList<>(); + List groups = permissionGroupService.getPermissionGroupByUserId(userId, null, false, null); + if (CollectionUtil.isNotEmpty(groups)) { + List objectIds = groups.stream().map(PermissionGroupEntity::getId).collect(Collectors.toList()); + resList = authorizeService.getListByObjectId(objectIds) + .stream().filter(t -> AuthorizeConst.FLOW.equals(t.getItemType())).map(AuthorizeEntity::getItemId).collect(Collectors.toList()); + } + return resList; + } + + // true是普通用户 + public boolean isCommonUser(String userId) { + List userStanding = authorizeService.getUserStanding(false, userId); + return userStanding.stream().anyMatch(t -> "3".equals(t.getId())); + } + + // true是分管 + public boolean isOrgAdmin(String userId) { + List userStanding = authorizeService.getUserStanding(true, userId); + return userStanding.stream().anyMatch(t -> "2".equals(t.getId())); + } + + // 获取流程有发起权限的人员 + public List getLaunchUserByTemplateId(TemplateEntity template, Pagination pagination) { + if (ObjectUtil.equals(template.getVisibleType(), 1)) { + // 公开直接返回用户分页 + return userService.getUserPage(pagination); + } + + // 根据流程主键、权限为流程类型 获取权限关联 + List flowAuthList = authorizeService.getListByObjectAndItemIdAndType(template.getId(), AuthorizeConst.FLOW); + // 获取权限组 + List groupIds = flowAuthList.stream().map(AuthorizeEntity::getObjectId).collect(Collectors.toList()); + List permissionGroupList = permissionGroupService.list(true, groupIds); + permissionGroupList = permissionGroupList.stream().filter(e -> ObjectUtil.equals(e.getEnabledMark(), 1)).collect(Collectors.toList()); + if (CollectionUtil.isEmpty(permissionGroupList)) { + return new ArrayList<>(); + } + + List userIdList = new ArrayList<>(); + for (PermissionGroupEntity permission : permissionGroupList) { + if (permission.getType() != null && permission.getType().equals(1)) { + // 自定义 + String permissionMember = permission.getPermissionMember(); + if (StringUtil.isNotEmpty(permissionMember)) { + String[] split = permissionMember.split(","); + userIdList.addAll(Arrays.stream(split).collect(Collectors.toList())); + } + } else { + // 全部成员,直接分页返回 + List userPage = userService.getUserPage(pagination); + return userPage; + } + } + List userListAll = this.getUserListAll(userIdList); + return this.getUserName(userListAll, pagination); + } + + //--------------------------------表单------------------------------ + public VisualdevEntity getFormInfo(String id) { + return visualdevApi.getFormConfig(id); + } + + public List getFormList(List formIds) { + if (formIds.isEmpty()) { + return new ArrayList<>(); + } + return visualdevApi.getFormConfigList(formIds); + } + + public void saveOrUpdateFormData(FlowFormDataModel model) throws WorkFlowException { + ActionResult actionResult = visualdevApi.saveOrUpdate(model); + if (actionResult.getCode() != 200) { + throw new WorkFlowException(actionResult.getMsg()); + } + } + + public void deleteFormData(String formId, String id) throws Exception { + if (StringUtil.isBlank(formId) || StringUtil.isBlank(id)) { + return; + } + try { + visualdevApi.delete(formId, id); + } catch (Exception e) { + e.printStackTrace(); + } + } + + public Map infoData(String formId, String id) throws WorkFlowException { + // 流程调用表单接口 + Map dataAll = new HashMap<>(); + if (StringUtil.isNotEmpty(formId) && StringUtil.isNotEmpty(id)) { + ActionResult result = visualdevApi.info(formId, id); + if (null != result && null != result.getData()) { + dataAll = (Map) result.getData(); + } + } + return dataAll; + } + + public void handleFormData(String flowId, Boolean isTransfer) throws WorkFlowException { + try { + Map> allData = FlowContextHolder.getAllData(); + Map>> formOperates = FlowContextHolder.getFormOperates(); + List writeIdList = FlowContextHolder.getWriteIdList(); + for (String key : writeIdList) { + String[] idList = key.split("_yunzhupaas_"); + List> operates = formOperates.get(key); + Map formData = allData.get(key); + formData = formData == null ? new HashMap<>() : formData; + FlowFormDataModel formDataModel = FlowFormDataModel.builder().formId(idList[1]).id(idList[0]).map(formData).formOperates(operates) + .flowId(flowId).isTransfer(isTransfer).build(); + this.saveOrUpdateFormData(formDataModel); + } + } catch (WorkFlowException e) { + throw e; + } finally { + FlowContextHolder.clearAll(); + } + } + + public VisualdevModelDataInfoVO getEditDataInfo(String id, VisualdevEntity visualdevEntity) { + return visualdevApi.getEditDataInfo(id, visualdevEntity); + } + + public List> getListWithTableList(VisualDevJsonModel visualDevJsonModel, PaginationModel pagination, UserInfo userInfo) { + return visualdevApi.getListWithTableList(visualDevJsonModel, pagination, userInfo); + } + + public VisualdevEntity getReleaseInfo(String formId) { + return visualdevApi.getReleaseInfo(formId); + } + + public DataModel visualCreate(VisualdevEntity visualdevEntity, Map data) throws Exception { + VisualParamModel visualParamModel = VisualParamModel.builder().visualdevEntity(visualdevEntity).data(data).build(); + return visualdevApi.visualCreate(visualParamModel); + } + + public DataModel visualUpdate(VisualdevEntity visualdevEntity, Map data, String id) throws Exception { + VisualParamModel visualParamModel = VisualParamModel.builder().visualdevEntity(visualdevEntity).data(data).id(id).onlyUpdate(true).build(); + return visualdevApi.visualUpdate(visualParamModel); + } + + public void visualDelete(VisualdevEntity visualdevEntity, List> dataList) throws Exception { + VisualParamModel visualParamModel = VisualParamModel.builder().visualdevEntity(visualdevEntity).dataList(dataList).build(); + visualdevApi.visualDelete(visualParamModel); + } + + public void deleteSubTable(FlowFormDataModel model) throws Exception { + visualdevApi.deleteByTableName(model); + } + + //--------------------------------数据字典------------------------------ + public List getDiList() { + List dictionList = dictionaryDataService.getListByTypeDataCode(DictionaryDataEnum.FLOWWOEK_ENGINE.getDictionaryTypeId()); + return dictionList; + } + + public List getDictionName(List id) { + List dictionList = dictionaryDataService.getDictionName(id); + return dictionList; + } + + //--------------------------------用户关系表------------------------------ + public List getListByUserIdAll(List id) { + List list = userRelationService.getListByUserIdAll(id).stream().filter(t -> StringUtil.isNotEmpty(t.getObjectId())).collect(Collectors.toList()); + return list; + } + + public List getListByObjectIdAll(List id) { + List list = userRelationService.getListByObjectIdAll(id); + return list; + } + + public String getAdmin() { + UserEntity admin = userService.getUserByAccount(ADMIN_KEY); + return admin.getId(); + } + + //--------------------------------用户------------------------------ + public List getUserByAccount(List accountList) { + List list = new ArrayList<>(); + if (CollectionUtil.isEmpty(accountList)) { + return list; + } + for (String account : accountList) { + UserEntity user = userService.getUserByAccount(account); + if (null != user) { + list.add(user); + } + } + return list; + } + + public List getUserName(List id) { + List list = getUserName(id, false); + return list; + } + + public List getListByManagerId(String managerId) { + List list = StringUtil.isNotEmpty(managerId) ? userService.getListByManagerId(managerId, null) : new ArrayList<>(); + return list; + } + + public List getUserName(List id, boolean enableMark) { + List list = userService.getUserName(id); + if (enableMark) list = list.stream().filter(t -> t.getEnabledMark() == 1).collect(Collectors.toList()); + return list; + } + + public List getUserName(List id, Pagination pagination) { + List list = userService.getUserName(id, pagination); + return list; + } + + public UserEntity getUserInfo(String id) { + UserEntity entity = null; + if (StringUtil.isNotEmpty(id)) { + entity = id.equalsIgnoreCase(ADMIN_KEY) ? userService.getUserByAccount(id) : userService.getInfo(id); + } + return entity; + } + + public List getUserListAll(List idList) { + List userIdList = userService.getUserIdList(idList, null); + return userIdList; + } + + public List getAdminList() { + return userService.getAdminList(); + } + + public List getOrganizeUserList(String type) { + OrganizeAdministratorModel model = organizeAdministratorService.getOrganizeAdministratorList(); + Map> map = new HashMap<>(); + map.put("select", model.getSelectList()); + map.put("add", model.getAddList()); + map.put("delete", model.getDeleteList()); + map.put("edit", model.getEditList()); + List list = map.get(type) != null ? map.get(type) : new ArrayList<>(); + List userList = userRelationService.getListByObjectIdAll(list).stream().map(UserRelationEntity::getUserId).collect(Collectors.toList()); + return userList; + } + + public List getUserList(List userIds, Pagination pagination, String type) { + List list = userService.getObjList(userIds, pagination, type); + return list; + } + + //--------------------------------角色------------------------------ + public List getListByIds(List id) { + List list = roleService.getListByIds(id, null, false); + return list; + } + + public List getCurRolesByOrgId(String orgId) { + List curRolesByOrgId = roleService.getCurRolesByOrgId(orgId); + return curRolesByOrgId; + } + + //--------------------------------组织------------------------------ + public List getOrganizeName(List id) { + List list = organizeService.getOrganizeName(id); + return list; + } + + public OrganizeEntity getOrganizeInfo(String id) { + OrganizeEntity entity = StringUtil.isNotEmpty(id) ? organizeService.getInfo(id) : null; + return entity; + } + + public List getOrganizeId(String organizeId) { + List organizeList = new ArrayList<>(); + organizeService.getOrganizeId(organizeId, organizeList); + Collections.reverse(organizeList); + return organizeList; + } + + public List getDepartmentAll(String organizeId) { + List departmentAll = organizeService.getDepartmentAll(organizeId); + return departmentAll; + } + + public List getChildOrg(String id) { + List res = new ArrayList<>(); + // 获取 id 存在organizeIdTree中的组织 + List list = organizeService.getAllChild(id); + if (CollectionUtil.isNotEmpty(list)) { + for (OrganizeEntity entity : list) { + res.add(entity.getId() + "--" + entity.getCategory()); + } + } + return res; + } + + public List getUnderOrg(String orgId) { + return organizeService.getUnderOrganizations(orgId, false); + } + + public List getOrgUserList(String type) { + return organizeAdministratorService.getOrganizeUserList(type); + } + + //--------------------------------岗位------------------------------ + public List getPositionName(List id) { + List list = positionService.getPositionName(id, false); + return list; + } + + //--------------------------------远端------------------------------ + public ActionResult infoToId(String interId, Map parameterMap) { + return dataInterfaceService.infoToId(interId, null, parameterMap); + } + + public ActionResult infoToId(String interId, String tenantId, Map parameterMap, String token) { + return dataInterfaceService.infoToId(interId, tenantId, parameterMap, token, null, null, null, null); + } + + public List getInterfaceList(List id) { + return dataInterfaceService.getList(id); + } + + //--------------------------------发送消息------------------------------ + public void sendMessage(List messageListAll) { + flowAsyncUtil.sendMessage(messageListAll); + } + + public void updateSendConfigUsed(String id, List idList) { + sendMessageConfigService.updateUsed(id, idList); + } + + public List sendDelegateMsg(List messageListAll) { + List list = new ArrayList<>(); + for (SentMessageForm messageForm : messageListAll) { + List errList = sentMessageUtil.sendDelegateMsg(messageForm); + list.addAll(errList); + } + return list; + } + + //------------------------------导出------------------------------- + public DownloadVO exportData(TemplateExportModel model) { + DownloadVO downloadVO = fileExport.exportFile(model, configValueUtil.getTemporaryFilePath(), model.getTemplate().getFullName(), ModuleTypeEnum.FLOW_FLOWENGINE.getTableName()); + return downloadVO; + } +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/TaskUtil.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/TaskUtil.java new file mode 100644 index 0000000..514a86f --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/TaskUtil.java @@ -0,0 +1,1931 @@ +package com.yunzhupaas.flowable.util; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.google.common.collect.ImmutableList; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.constant.PermissionConst; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.*; +import com.yunzhupaas.flowable.enums.*; +import com.yunzhupaas.flowable.model.flowable.*; +import com.yunzhupaas.flowable.model.message.FlowMsgModel; +import com.yunzhupaas.flowable.model.record.NodeRecordModel; +import com.yunzhupaas.flowable.model.task.*; +import com.yunzhupaas.flowable.model.templatejson.FlowFormModel; +import com.yunzhupaas.flowable.model.templatejson.FlowParamModel; +import com.yunzhupaas.flowable.model.templatenode.FlowErrorModel; +import com.yunzhupaas.flowable.model.templatenode.nodejson.*; +import com.yunzhupaas.flowable.model.util.FlowConstant; +import com.yunzhupaas.flowable.model.util.FlowContextHolder; +import com.yunzhupaas.flowable.model.util.FlowNature; +import com.yunzhupaas.flowable.service.*; +import com.yunzhupaas.permission.entity.OrganizeEntity; +import com.yunzhupaas.permission.entity.RoleEntity; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.entity.UserRelationEntity; +import com.yunzhupaas.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/22 16:46 + */ +@Component +public class TaskUtil { + @Autowired + private ServiceUtil serviceUtil; + @Autowired + private LaunchUserService launchUserService; + @Autowired + private CandidatesService candidatesService; + @Autowired + private RecordService recordService; + @Autowired + private MsgUtil msgUtil; + @Autowired + private FlowAbleUrl flowAbleUrl; + @Autowired + private TaskService taskService; + @Autowired + private OperatorService operatorService; + @Autowired + private OperatorUtil operatorUtil; + @Autowired + private TemplateService templateService; + @Autowired + private TemplateJsonService templateJsonService; + @Autowired + private TemplateNodeService templateNodeService; + @Autowired + private ConditionService conditionService; + @Autowired + private TaskLineService taskLineService; + @Autowired + private RevokeService revokeService; + @Autowired + private NodeRecordService nodeRecordService; + @Autowired + private RecordUtil recordUtil; + @Autowired + private SubtaskDataService subtaskDataService; + + // 提交撤销流程 + public void submitOfRevoke(FlowModel flowModel) throws Exception { + TaskEntity task = flowModel.getTaskEntity(); + List lineList = taskLineService.getList(task.getId()); + if (CollectionUtil.isEmpty(lineList)) { + throw new WorkFlowException("无法撤销"); + } + // 委托人的处理 + UserInfo userInfo = flowModel.getUserInfo(); + String creatorUserId = task.getCreatorUserId(); + String delegateUserId = task.getDelegateUserId(); + boolean isDelegate = !ObjectUtil.equals(userInfo.getUserId(), creatorUserId); + if (isDelegate) { + if (StringUtil.isNotEmpty(delegateUserId)) { + String token = AuthUtil.loginTempUser(task.getCreatorUserId(), UserProvider.getUser().getTenantId()); + userInfo = UserProvider.getUser(token); + flowModel.setUserInfo(userInfo); + } + } + + Map variables = new HashMap<>(); + for (TaskLineEntity condition : lineList) { + variables.put(condition.getLineKey(), Boolean.valueOf(condition.getLineValue())); + } + + TaskEntity entity = new TaskEntity(); + entity.setId(RandomUtil.uuId()); + entity.setType(1); + entity.setUrgent(task.getUrgent()); + entity.setCreatorUserId(task.getCreatorUserId()); + entity.setStartTime(new Date()); + entity.setCreatorTime(new Date()); + entity.setFullName(task.getFullName() + "的撤销申请"); + entity.setFlowCategory(task.getFlowCategory()); + entity.setFlowCode(task.getFlowCode()); + entity.setFlowName(task.getFlowName()); + entity.setFlowVersion(task.getFlowVersion()); + entity.setFlowId(task.getFlowId()); + entity.setTemplateId(task.getTemplateId()); + entity.setParentId(task.getParentId()); + entity.setFlowType(task.getFlowType()); + entity.setStatus(TaskStatusEnum.RUNNING.getCode()); + entity.setEngineType(task.getEngineType()); + if (isDelegate) { + entity.setDelegateUserId(delegateUserId); + } + + TemplateJsonEntity jsonEntity = templateJsonService.getInfo(task.getFlowId()); + String instanceId = flowAbleUrl.startInstance(jsonEntity.getFlowableId(), variables); + entity.setInstanceId(instanceId); + + if (taskService.save(entity)) { + List nodeEntityList = flowModel.getNodeEntityList(); + TemplateNodeEntity nodeEntity = nodeEntityList.stream() + .filter(e -> StringUtil.equals(NodeEnum.start.getType(), e.getNodeType())).findFirst() + .orElse(new TemplateNodeEntity()); + NodeModel nodeModel = JsonUtil.getJsonToBean(nodeEntity.getNodeJson(), NodeModel.class); + // 记录 + FlowMethod method = new FlowMethod(); + method.setFlowModel(flowModel); + method.setType(RecordEnum.submit.getCode()); + OperatorEntity operatorEntity = new OperatorEntity(); + operatorEntity.setNodeCode(nodeEntity.getNodeCode()); + operatorEntity.setNodeName(nodeModel.getNodeName()); + operatorEntity.setTaskId(entity.getId()); + operatorEntity.setHandleId(entity.getCreatorUserId()); + if (StringUtil.isNotBlank(flowModel.getUserId())) { + method.setHandId(flowModel.getUserId()); + } + operatorEntity.setHandleTime(entity.getStartTime()); + method.setOperatorEntity(operatorEntity); + recordUtil.createRecord(method); + // 节点记录 + NodeRecordModel nodeRecordModel = new NodeRecordModel(); + nodeRecordModel.setTaskId(entity.getId()); + nodeRecordModel.setNodeCode(nodeEntity.getNodeCode()); + nodeRecordModel.setNodeName(nodeModel.getNodeName()); + nodeRecordModel.setNodeStatus(1); + nodeRecordService.create(nodeRecordModel); + // 保存到撤销表 + RevokeEntity revokeEntity = new RevokeEntity(); + revokeEntity.setId(RandomUtil.uuId()); + revokeEntity.setTaskId(task.getId()); + revokeEntity.setRevokeTaskId(entity.getId()); + + RevokeFormDataModel model = new RevokeFormDataModel(); + String billNumber = serviceUtil.getBillNumber(); + model.setBillRule(billNumber); + model.setHandleOpinion(flowModel.getHandleOpinion()); + Date date = new Date(); + model.setCreatorTime(date.getTime()); + model.setRevokeTaskId(task.getId()); + model.setRevokeTaskName(task.getFullName()); + String str = JsonUtil.getObjectToString(model); + revokeEntity.setFormData(str); + revokeService.save(revokeEntity); + // 处理撤销经办 + FlowMethod flowMethod = new FlowMethod(); + flowMethod.setFlowModel(flowModel); + flowMethod.setTaskId(task.getId()); + flowMethod.setTaskEntity(entity); + operatorUtil.handleRevokeOperator(flowMethod); + // 自动审批 + FlowModel revokeModel = JsonUtil.getJsonToBean(flowModel, FlowModel.class); + revokeModel.setTaskEntity(entity); + operatorUtil.autoAudit(revokeModel); + // 判断结束 + flowModel.setTaskEntity(entity); + if (this.isFinished(flowModel)) { + this.endRevoke(task); + } + } + } + + public void endRevoke(TaskEntity task) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().in(TaskEntity::getParentId, task.getId()); + List subTaskList = taskService.list(wrapper); + // 变更子流程任务状态 + if (CollectionUtil.isNotEmpty(subTaskList)) { + for (TaskEntity subTask : subTaskList) { + subTask.setStatus(TaskStatusEnum.REVOKED.getCode()); + } + taskService.updateBatchById(subTaskList); + } + task.setStatus(TaskStatusEnum.REVOKED.getCode()); + taskService.updateById(task); + } + + // 更新当前节点 + public void updateCurrentNode(List taskModelList, Map nodes, + TaskEntity taskEntity) { + List currentNodeList = new ArrayList<>(); + List currentNodeNameList = new ArrayList<>(); + + List nodeTypes = ImmutableList.of(NodeEnum.approver.getType(), NodeEnum.subFlow.getType(), + NodeEnum.processing.getType()); + for (FlowableTaskModel model : taskModelList) { + NodeModel nodeModel = nodes.get(model.getTaskKey()); + if (null != nodeModel && nodeTypes.contains(nodeModel.getType())) { + currentNodeList.add(nodeModel.getNodeId()); + currentNodeNameList.add(nodeModel.getNodeName()); + } + } + if (CollectionUtil.isNotEmpty(currentNodeList)) { + // 更新任务的当前节点信息 + taskEntity.setCurrentNodeName(String.join(",", currentNodeNameList)); + taskEntity.setCurrentNodeCode(String.join(",", currentNodeList)); + taskService.updateById(taskEntity); + } + } + + // 拒绝结束流程 + public void handleEndTask(FlowMethod flowMethod) throws Exception { + OperatorEntity operator = flowMethod.getOperatorEntity(); + List circulateList = flowMethod.getCirculateList(); + FlowModel flowModel = flowMethod.getFlowModel(); + TaskEntity taskEntity = flowModel.getTaskEntity(); + List nodeEntityList = flowModel.getNodeEntityList(); + + // 触发 + if (!flowMethod.getIsRevoke()) { + flowModel.setAction(2); + flowModel.setRejectTrigger(true); + operatorUtil.handleTrigger(operator, flowModel); + } + + // 直接结束流程 + flowMethod.setState(TaskStatusEnum.REJECTED.getCode()); + this.endTask(flowMethod); + // 处理当前节点 + flowModel.setFinishFlag(false); + List codes = Arrays.stream(taskEntity.getCurrentNodeCode().split(",")).collect(Collectors.toList()); + codes.remove(operator.getNodeCode()); + taskEntity.setCurrentNodeCode(String.join(",", codes)); + + // 节点记录 + NodeRecordModel nodeRecordModel = new NodeRecordModel(); + nodeRecordModel.setTaskId(operator.getTaskId()); + nodeRecordModel.setNodeId(operator.getNodeId()); + nodeRecordModel.setNodeCode(operator.getNodeCode()); + nodeRecordModel.setNodeName(operator.getNodeName()); + nodeRecordModel.setNodeStatus(3); + nodeRecordService.create(nodeRecordModel); + + FlowMsgModel flowMsgModel = new FlowMsgModel(); + flowMsgModel.setNodeList(nodeEntityList); + flowMsgModel.setFlowModel(flowModel); + flowMsgModel.setTaskEntity(taskEntity); + flowMsgModel.setNodeCode(operator.getNodeCode()); + flowMsgModel.setWait(false); + flowMsgModel.setReject(true); + flowMsgModel.setCopy(true); + List operatorList = new ArrayList<>(); + OperatorEntity entity = new OperatorEntity(); + entity.setNodeCode(operator.getNodeCode()); + entity.setHandleId(taskEntity.getCreatorUserId()); + operatorList.add(entity); + flowMsgModel.setOperatorList(operatorList); + flowMsgModel.setCirculateList(circulateList); + flowMsgModel.setFormData(FlowContextHolder.getAllData()); + msgUtil.message(flowMsgModel); + + this.isFinished(flowModel); + } + + public List getTaskByTemplate(String templateId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TaskEntity::getTemplateId, templateId); + return taskService.list(queryWrapper); + } + + // 判断用户是否有发起权限 + public void checkLaunchPermission(String userId, TemplateEntity template) throws WorkFlowException { + if (null != template && ObjectUtil.equals(template.getVisibleType(), 2)) { + if (serviceUtil.isCommonUser(userId)) { + List flowIds = serviceUtil.getLaunchPermission(userId); + if (!flowIds.contains(template.getId())) { + throw new WorkFlowException(MsgCode.WF029.get()); + } + } + } + } + + public void updateGlobalParam(TaskEntity taskEntity, NodeModel nodeModel, NodeModel global, + Map formData) throws WorkFlowException { + this.getGlobalParam(taskEntity, nodeModel, global, formData); + taskService.updateById(taskEntity); + } + + public void getGlobalParam(TaskEntity taskEntity, NodeModel nodeModel, NodeModel global, + Map formData) throws WorkFlowException { + List paramModelList = global.getGlobalParameterList(); + if (CollectionUtil.isEmpty(paramModelList)) { + return; + } + formData = formData == null ? new HashMap<>() : formData; + List list = new ArrayList<>(); + for (GroupsModel group : nodeModel.getParameterList()) { + TemplateJsonModel model = new TemplateJsonModel(); + model.setField(group.getField()); + model.setSourceType(group.getFieldValueType() == 3 ? 4 : group.getFieldValueType()); + model.setRelationField(String.valueOf(group.getFieldValue())); + model.setMsgTemplateId(group.getField()); + list.add(model); + } + Map taskMap = taskEntity.getGlobalParameter() != null + ? JsonUtil.stringToMap(taskEntity.getGlobalParameter()) + : new HashMap<>(); + if (CollectionUtil.isEmpty(taskMap)) { + for (FlowParamModel model : paramModelList) { + if (model.getDefaultValue() != null) { + taskMap.put(model.getFieldName(), model.getDefaultValue()); + } + } + } + RecordEntity record = new RecordEntity(); + record.setNodeCode(nodeModel.getNodeId()); + // UserEntity createUser = + // serviceUtil.getUserInfo(taskEntity.getCreatorUserId()); + // UserEntity delegate = StringUtil.isNotEmpty(taskEntity.getDelegateUserId()) ? + // serviceUtil.getUserInfo(taskEntity.getDelegateUserId()) : null; + Map map = msgUtil.parameterMap(formData, list, record, taskEntity); + taskMap.putAll(map); + for (FlowParamModel model : paramModelList) { + if (ObjectUtil.equals(model.getDataType(), "datetime")) { + String fieldName = model.getFieldName(); + Long longVal = Long.valueOf(String.valueOf(taskMap.get(fieldName))); + taskMap.put(fieldName, longVal); + } + } + taskEntity.setGlobalParameter(JsonUtil.getObjectToString(taskMap)); + } + + /** + * 根据主键集合获取任务实体 + * + * @param ids 主键集合 + */ + public List getOrderStaList(List ids) { + List list = new ArrayList<>(); + if (CollectionUtil.isNotEmpty(ids)) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(TaskEntity::getId, ids); + list = taskService.list(queryWrapper); + } + return list; + } + + /** + * 设置参数 + * + * @param taskId 任务主键 + * @param flowModel 参数 + */ + public void setFlowModel(String taskId, FlowModel flowModel) throws WorkFlowException { + if (flowModel.getUserInfo() == null) { + flowModel.setUserInfo(UserProvider.getUser()); + } + TaskEntity taskEntity = taskService.getInfo(taskId); + if (null == taskEntity) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + TemplateJsonEntity jsonEntity = templateJsonService.getInfo(taskEntity.getFlowId()); + flowModel.setJsonEntity(jsonEntity); + flowModel.setDeploymentId(jsonEntity.getFlowableId()); + flowModel.setTaskEntity(taskEntity); + List nodeEntityList = templateNodeService.getList(taskEntity.getFlowId()); + flowModel.setNodeEntityList(nodeEntityList); + Map nodes = new HashMap<>(); + for (TemplateNodeEntity nodeEntity : nodeEntityList) { + nodes.put(nodeEntity.getNodeCode(), JsonUtil.getJsonToBean(nodeEntity.getNodeJson(), NodeModel.class)); + } + flowModel.setNodes(nodes); + } + + /** + * 依次审批的排序 + * + * @param userIds 用户主键集合 + * @param nodeModel 节点属性 + */ + public List improperSort(List userIds, NodeModel nodeModel) { + List list = new ArrayList<>(); + List sortList = nodeModel.getApproversSortList(); + if (sortList.isEmpty()) { + return userIds; + } + for (String id : sortList) { + List collect = userIds.stream().filter(id::contains).collect(Collectors.toList()); + list.addAll(collect); + } + return list.stream().distinct().collect(Collectors.toList()); + } + + // 结束任务 + public void endTask(FlowMethod flowMethod) throws Exception { + TaskEntity taskEntity = flowMethod.getTaskEntity(); + Integer state = flowMethod.getState(); + taskEntity.setStatus(state); + taskEntity.setEndTime(new Date()); + if (taskService.updateById(taskEntity)) { + flowMethod.setTaskId(taskEntity.getId()); + flowMethod.setNodeCode(null); + operatorUtil.endOperator(flowMethod); + flowAbleUrl.deleteInstance(taskEntity.getInstanceId(), "reject"); + } + } + + /** + * 判断任务是否结束 + * + * @param flowModel 参数 + */ + public boolean isFinished(FlowModel flowModel) throws Exception { + TaskEntity taskEntity = flowModel.getTaskEntity(); + if (null == taskEntity.getId()) { + return false; + } + TaskEntity task = taskService.getById(taskEntity.getId()); + if (null != task && ObjectUtil.equals(task.getStatus(), TaskStatusEnum.CANCEL.getCode())) { + return false; + } + List nodeEntityList = flowModel.getNodeEntityList(); + String instanceId = taskEntity.getInstanceId(); + boolean flag; + FlowableInstanceModel instance = flowAbleUrl.getInstance(instanceId); + if (null != instance && null != instance.getEndTime()) { + flag = true; + } else { + List historicEnd = flowAbleUrl.getHistoricEnd(instanceId); + flag = CollectionUtil.isNotEmpty(historicEnd); + } + if (flag) { + TemplateNodeEntity endNodeEntity = nodeEntityList.stream() + .filter(e -> StringUtil.equals(e.getNodeType(), NodeEnum.end.getType())).findFirst().orElse(null); + if (null != endNodeEntity) { + if (flowModel.getFinishFlag()) { + taskEntity.setCurrentNodeCode(FlowNature.END_CODE); + taskEntity.setCurrentNodeName(FlowNature.END_NAME); + } + Integer status = flowModel.getHandleStatus().equals(FlowNature.AuditCompletion) + ? TaskStatusEnum.PASSED.getCode() + : TaskStatusEnum.REJECTED.getCode(); + taskEntity.setStatus(status); + taskEntity.setEndTime(new Date()); + if (taskService.updateById(taskEntity)) { + this.subFlowOfEnd(flowModel); + flowModel.setEventStatus(2); + operatorUtil.addEvent(flowModel); + // 发送结束消息 + FlowMsgModel flowMsgModel = new FlowMsgModel(); + flowMsgModel.setNodeList(nodeEntityList); + flowMsgModel.setTaskEntity(taskEntity); + flowMsgModel.setFlowModel(flowModel); + flowMsgModel.setEnd(true); + flowMsgModel.setFormData(FlowContextHolder.getAllData()); + msgUtil.message(flowMsgModel); + return true; + } + } + } + return false; + } + + // 判断能否归档 + public AuditModel getAuditModel(String taskId, FlowModel flowModel, OperatorEntity operator) { + TaskEntity task = taskService.getById(taskId); + AuditModel model = new AuditModel(); + if (operator != null && ObjectUtil.equals(operator.getStatus(), OperatorStateEnum.Revoke.getCode())) { + return model; + } + if (task != null) { + model.setTaskId(taskId); + if (task.getEndTime() != null) { + NodeModel global = flowModel.getNodes().get(NodeEnum.global.getType()); + FileConfig config = global.getFileConfig(); + if (config.getOn() && StringUtil.isNotBlank(config.getTemplateId())) { + model.setIsEnd(true); + } + } + } + return model; + } + + // 子流程结束 要处理的事情 + public void subFlowOfEnd(FlowModel flowModel) throws Exception { + TaskEntity taskEntity = flowModel.getTaskEntity(); + if (StringUtil.equals("0", taskEntity.getParentId())) { + return; + } + // 获取父级节点集合 + TaskEntity parentTask = taskService.getInfo(taskEntity.getParentId()); + if (null == parentTask) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + TemplateJsonEntity jsonEntity = templateJsonService.getById(parentTask.getFlowId()); + String deploymentId = jsonEntity.getFlowableId(); + List parentNodeList = templateNodeService.getList(parentTask.getFlowId()); + + String subCode = taskEntity.getSubCode(); + SubParameterModel subParameter = JsonUtil.getJsonToBean(taskEntity.getSubParameter(), SubParameterModel.class); + String flowableTaskId = subParameter.getNodeId(); + String parentCode = subParameter.getParentCode(); + + TemplateNodeEntity parentNode = parentNodeList.stream() + .filter(e -> e.getNodeCode().equals(parentCode)).findFirst().orElse(new TemplateNodeEntity()); + TemplateNodeEntity subNode = parentNodeList.stream() + .filter(e -> e.getNodeCode().equals(subCode)).findFirst().orElse(new TemplateNodeEntity()); + NodeModel nodeModel = JsonUtil.getJsonToBean(subNode.getNodeJson(), NodeModel.class); + if (nodeModel == null) { + return; + } + // 判断是否依次创建,存在依次创建的子流程数据,则发起子流程 + if (ObjectUtil.equals(nodeModel.getCreateRule(), 1)) { + List list = subtaskDataService.getList(taskEntity.getParentId(), subCode); + if (CollectionUtil.isNotEmpty(list)) { + SubtaskDataEntity subtaskData = list.get(0); + FlowModel model = JsonUtil.getJsonToBean(subtaskData.getSubtaskJson(), FlowModel.class); + taskService.batchSaveOrSubmit(model); + subtaskDataService.removeById(subtaskData); + return; + } + } + + // 判断下一级是否子流程节点,且是否存在候选人 + NextOrPrevFo fo = new NextOrPrevFo(); + fo.setDeploymentId(deploymentId); + fo.setTaskKey(subCode); + List nextModels = flowAbleUrl.getNext(fo); + + for (FlowableNodeModel nextModel : nextModels) { + TemplateNodeEntity nodeEntity = parentNodeList.stream() + .filter(e -> ObjectUtil.equals(e.getNodeCode(), nextModel.getId())) + .findFirst().orElse(new TemplateNodeEntity()); + if (ObjectUtil.equals(nodeEntity.getNodeType(), NodeEnum.subFlow.getType())) { + NodeModel subFlow = JsonUtil.getJsonToBean(nodeEntity.getNodeJson(), NodeModel.class); + TemplateEntity template = templateService.getById(subFlow.getFlowId()); + TemplateJsonEntity subJsonEntity = templateJsonService.getById(template.getFlowId()); + List subNodeList = templateNodeService.getList(template.getFlowId()); + Map subNodes = new HashMap<>(); + for (TemplateNodeEntity node : subNodeList) { + subNodes.put(node.getNodeCode(), JsonUtil.getJsonToBean(node.getNodeJson(), NodeModel.class)); + } + TemplateNodeEntity subStart = subNodeList.stream() + .filter(e -> StringUtil.equals(NodeEnum.start.getType(), e.getNodeType())).findFirst() + .orElse(new TemplateNodeEntity()); + + FlowMethod method = new FlowMethod(); + method.setDeploymentId(subJsonEntity.getFlowableId()); + method.setNodes(subNodes); + method.setNodeEntityList(subNodeList); + method.setNodeCode(subStart.getNodeCode()); + + if (this.checkBranch(subStart)) { + throw new WorkFlowException(MsgCode.WF121.get()); + } + List nextApprover = this.getNextApprover(method); + if (!this.checkNextCandidates(nextApprover)) { + throw new WorkFlowException(MsgCode.WF121.get()); + } + FlowModel model = new FlowModel(); + model.setDeploymentId(flowModel.getDeploymentId()); + model.setNodeEntityList(subNodeList); + if (this.checkNextError(model, nextApprover, false, false) != 0) { + throw new WorkFlowException(MsgCode.WF121.get()); + } + } + } + + if (nodeModel.getIsAsync().equals(FlowNature.ChildAsync)) { + // 异步已经完成节点 + return; + } + // 父节点下的子流程 + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(TaskEntity::getParentId, taskEntity.getParentId()) + .eq(TaskEntity::getSubCode, subCode); + List subList = taskService.list(wrapper); + // 未审批集合 + List unfinishedList = subList.stream() + .filter(e -> !e.getStatus().equals(TaskStatusEnum.PASSED.getCode()) + && !e.getStatus().equals(TaskStatusEnum.REJECTED.getCode())) + .collect(Collectors.toList()); + if (unfinishedList.isEmpty()) { + FlowModel model = JsonUtil.getJsonToBean(flowModel, FlowModel.class); + model.setFinishFlag(true); + subList = subList.stream().filter(e -> null != e.getEndTime()) + .sorted(Comparator.comparing(TaskEntity::getEndTime).reversed()).collect(Collectors.toList()); + if (CollectionUtil.isNotEmpty(subList)) { + TaskEntity finalTask = subList.get(0); + model.setHandleStatus( + ObjectUtil.equals(finalTask.getStatus(), TaskStatusEnum.PASSED.getCode()) ? 1 : 0); + } else { + model.setHandleStatus(1); + } + String formId = parentNode.getFormId(); + this.setFlowModel(parentTask.getId(), model); + Map nodes = model.getNodes(); + Map formData = serviceUtil.infoData(formId, parentTask.getId()); + model.setFormData(formData); + FlowMethod flowMethod = new FlowMethod(); + flowMethod.setDeploymentId(model.getDeploymentId()); + flowMethod.setNodeCode(subCode); + flowMethod.setFormData(formData); + flowMethod.setNodes(nodes); + flowMethod.setTaskEntity(parentTask); + Map resMap = conditionService.handleCondition(flowMethod); + flowMethod.setFlowModel(model); + flowMethod.setFlowableTaskId(flowableTaskId); + flowMethod.setResMap(resMap); + flowMethod.setNodeEntityList(parentNodeList); + // 递归subCode的所有上级节点,获取审批节点的经办 + model.setOperatorEntity(new OperatorEntity()); + List nodeCodeList = new ArrayList<>(); + prevNodeList(flowModel.getDeploymentId(), subCode, parentNodeList, nodeCodeList); + if (CollectionUtil.isNotEmpty(nodeCodeList)) { + List list = operatorUtil.getList(parentTask.getId(), nodeCodeList); + if (CollectionUtil.isNotEmpty(list)) { + model.setOperatorEntity(list.get(0)); + } + } + operatorUtil.completeNode(flowMethod); + } + } + + // 删除子流程(退回时若是重新审批) + public void deleteSubflow(String taskId, List nodeCodeList) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TaskEntity::getParentId, taskId); + if (CollectionUtil.isNotEmpty(nodeCodeList)) { + queryWrapper.lambda().in(TaskEntity::getSubCode, nodeCodeList); + } + List list = taskService.list(queryWrapper); + if (CollectionUtil.isNotEmpty(list)) { + List idList = list.stream().map(TaskEntity::getId).distinct().collect(Collectors.toList()); + List idAll = new ArrayList<>(); + taskService.deleTaskAll(idList, idAll); + taskService.setIgnoreLogicDelete().removeByIds(idAll); + taskService.clearIgnoreLogicDelete(); + } + } + + /** + * 判断任务是否在挂起状态 + * + * @param taskEntity 任务 + */ + public void isSuspend(TaskEntity taskEntity) throws WorkFlowException { + Integer status = taskEntity != null ? taskEntity.getStatus() : null; + if (TaskStatusEnum.PAUSED.getCode().equals(status)) { + throw new WorkFlowException(MsgCode.WF114.get()); + } + } + + /** + * 判断任务是否终止状态 + * + * @param taskEntity 任务 + */ + public void isCancel(TaskEntity taskEntity) throws WorkFlowException { + Integer status = taskEntity != null ? taskEntity.getStatus() : null; + if (ObjectUtil.equals(TaskStatusEnum.CANCEL.getCode(), status)) { + throw new WorkFlowException(MsgCode.WF123.get()); + } + } + + /** + * 获取审批人 + * + * @param flowMethod + * @return + */ + public List userListAll(FlowMethod flowMethod) throws WorkFlowException { + List nodeEntityList = flowMethod.getNodeEntityList(); + TemplateNodeEntity nodeEntity = flowMethod.getNodeEntity(); + NodeModel nodeModel = JsonUtil.getJsonToBean(nodeEntity.getNodeJson(), NodeModel.class); + + TemplateNodeEntity globalEntity = nodeEntityList.stream() + .filter(t -> NodeEnum.global.getType().equals(t.getNodeType())).findFirst().get(); + NodeModel global = JsonUtil.getJsonToBean(globalEntity.getNodeJson(), NodeModel.class); + Integer errRule = global.getErrorRule(); + List errRuleUser = global.getErrorRuleUser(); + // 子流程去获取指定成员、异常处理 + if (StringUtil.equals(nodeModel.getType(), NodeEnum.subFlow.getType())) { + errRule = nodeModel.getErrorRule(); + errRuleUser = nodeModel.getErrorRuleUser(); + } + + Boolean errorRule = flowMethod.getErrorRule(); + int pass = 0; + int notSubmit = 0; + int node = 0; + Boolean extraRule = flowMethod.getExtraRule(); + TaskEntity taskEntity = flowMethod.getTaskEntity(); + + List userIdAll = user(flowMethod, nodeModel.getAssigneeType()); + // String admin = serviceUtil.getAdmin(); + // userIdAll = userIdAll.stream().filter(e -> !ObjectUtil.equals(e, + // admin)).distinct().collect(Collectors.toList()); + // 附加规则 + if (extraRule && !ObjectUtil.equals(nodeModel.getAssigneeType(), FlowTaskOperatorEnum.Candidate.getCode())) { + rule(userIdAll, taskEntity.getId(), nodeModel.getExtraRule()); + } + // 获取最新用户 + List userList = serviceUtil.getUserName(userIdAll, true); + + // 子流程权限 + if (StringUtil.equals(nodeModel.getType(), NodeEnum.subFlow.getType())) { + String flowId = nodeModel.getFlowId(); + TemplateEntity template = templateService.getById(flowId); + if (template != null && template.getVisibleType().equals(2) && ObjectUtil.equals(template.getStatus(), 1)) { + List list = new ArrayList<>(userList); + for (UserEntity user : list) { + if (serviceUtil.isCommonUser(user.getId())) { + List flowIds = serviceUtil.getLaunchPermission(user.getId()); + // 权限中不存在 该流程版本 + if (!flowIds.contains(flowId)) { + UserEntity userEntity = list.stream().filter(e -> e.getId().equals(user.getId())) + .findFirst().orElse(null); + if (null != userEntity) { + userList.remove(user); + } + } + } + } + } + } + userIdAll = userList.stream().map(UserEntity::getId).collect(Collectors.toList()); + + // 异常规则 + if (errorRule && userList.size() == 0) { + // 异常处理规则 + switch (ErrorRuleEnum.getByCode(errRule)) { + case administrator: + userIdAll.add(serviceUtil.getAdmin()); + break; + case initiator: + List errorRuleUser = serviceUtil.getUserName(errRuleUser, true); + if (errorRuleUser.size() > 0) { + userIdAll.addAll(errorRuleUser.stream().map(UserEntity::getId).collect(Collectors.toList())); + } else { + userIdAll.add(serviceUtil.getAdmin()); + } + break; + case node: + String nodeId = nodeEntity.getNodeCode(); + List list = candidatesService.getList(taskEntity.getId(), nodeId); + for (CandidatesEntity t : list) { + List candidates = StringUtil.isNotEmpty(t.getCandidates()) + ? Arrays.stream(t.getCandidates().split(",")).collect(Collectors.toList()) + : new ArrayList<>(); + userIdAll.addAll(candidates); + } + node++; + break; + case pass: + pass++; + break; + case notSubmit: + notSubmit++; + break; + case creatorUserId: + userIdAll.add(taskEntity.getCreatorUserId()); + break; + default: + break; + } + } + flowMethod.setPass(pass); + flowMethod.setNotSubmit(notSubmit); + flowMethod.setNode(node); + return userIdAll; + } + + /** + * 附加条件 + */ + public void rule(List userIdAll, String taskId, int rule) { + List ruleList = ImmutableList.of(ExtraRuleEnum.organize.getCode(), ExtraRuleEnum.position.getCode(), + ExtraRuleEnum.manager.getCode(), ExtraRuleEnum.subordinate.getCode(), + ExtraRuleEnum.department.getCode()); + if (ruleList.contains(rule)) { + LaunchUserEntity flowUser = launchUserService.getInfoByTask(taskId); + if (flowUser != null) { + List userList = serviceUtil.getUserName(userIdAll, true); + List userListAll = userList.stream().map(UserEntity::getId).collect(Collectors.toList()); + Map> relationUserList = serviceUtil.getListByUserIdAll(userListAll) + .stream().filter(t -> StringUtil.isNotEmpty(t.getObjectId())) + .collect(Collectors.groupingBy(UserRelationEntity::getObjectId)); + // 附加条件 + switch (ExtraRuleEnum.getByCode(rule)) { + case organize: + List organize = new ArrayList<>(); + OrganizeEntity organizeInfo = serviceUtil.getOrganizeInfo(flowUser.getOrganizeId()); + if (null != organizeInfo + && Objects.equals(organizeInfo.getCategory(), PermissionConst.DEPARTMENT)) { + organize.addAll(relationUserList.get(flowUser.getOrganizeId()) != null + ? relationUserList.get(flowUser.getOrganizeId()).stream() + .map(UserRelationEntity::getUserId).collect(Collectors.toList()) + : new ArrayList<>()); + } + userIdAll.retainAll(organize); + break; + case position: + List position = new ArrayList<>(); + position.addAll(relationUserList.get(flowUser.getPositionId()) != null + ? relationUserList.get(flowUser.getPositionId()).stream() + .map(UserRelationEntity::getUserId).collect(Collectors.toList()) + : new ArrayList<>()); + userIdAll.retainAll(position); + break; + case manager: + List manager = new ArrayList<>(); + manager.add(flowUser.getSuperior()); + userIdAll.retainAll(manager); + break; + case subordinate: + List subordinate = new ArrayList<>(); + subordinate.addAll(StringUtil.isNotEmpty(flowUser.getSubordinate()) + ? new ArrayList<>(Arrays.asList(flowUser.getSubordinate().split(","))) + : new ArrayList<>()); + userIdAll.retainAll(subordinate); + break; + case department: + List department = new ArrayList<>(); + List departmentAll = serviceUtil.getDepartmentAll(flowUser.getOrganizeId()).stream() + .map(OrganizeEntity::getId).collect(Collectors.toList()); + for (String id : departmentAll) { + department.addAll(relationUserList.get(id) != null ? relationUserList.get(id).stream() + .map(UserRelationEntity::getUserId).collect(Collectors.toList()) + : new ArrayList<>()); + } + userIdAll.retainAll(department); + break; + default: + break; + } + } + } + } + + // 附加条件过滤 + public void rule(List userIdAll, UserEntity flowUser, int rule) { + List ruleList = ImmutableList.of(ExtraRuleEnum.organize.getCode(), ExtraRuleEnum.position.getCode(), + ExtraRuleEnum.manager.getCode(), ExtraRuleEnum.subordinate.getCode(), + ExtraRuleEnum.department.getCode()); + if (ruleList.contains(rule)) { + if (flowUser != null) { + List userList = serviceUtil.getUserName(userIdAll, true); + List userListAll = userList.stream().map(UserEntity::getId).collect(Collectors.toList()); + Map> relationUserList = serviceUtil.getListByUserIdAll(userListAll) + .stream().filter(t -> StringUtil.isNotEmpty(t.getObjectId())) + .collect(Collectors.groupingBy(UserRelationEntity::getObjectId)); + // 附加条件 + switch (ExtraRuleEnum.getByCode(rule)) { + case organize: + List organize = new ArrayList<>(); + OrganizeEntity organizeInfo = serviceUtil.getOrganizeInfo(flowUser.getOrganizeId()); + if (null != organizeInfo + && Objects.equals(organizeInfo.getCategory(), PermissionConst.DEPARTMENT)) { + organize.addAll(relationUserList.get(flowUser.getOrganizeId()) != null + ? relationUserList.get(flowUser.getOrganizeId()).stream() + .map(UserRelationEntity::getUserId).collect(Collectors.toList()) + : new ArrayList<>()); + } + userIdAll.retainAll(organize); + break; + case position: + List position = new ArrayList<>(); + String positionId = flowUser.getPositionId(); + position.addAll(relationUserList.get(positionId) != null ? relationUserList.get(positionId) + .stream().map(UserRelationEntity::getUserId).collect(Collectors.toList()) + : new ArrayList<>()); + userIdAll.retainAll(position); + break; + case manager: + List manager = new ArrayList<>(); + String managerId = flowUser.getManagerId(); + manager.add(managerId); + userIdAll.retainAll(manager); + break; + case department: + List department = new ArrayList<>(); + List departmentAll = serviceUtil.getDepartmentAll(flowUser.getOrganizeId()).stream() + .map(OrganizeEntity::getId).collect(Collectors.toList()); + for (String id : departmentAll) { + department.addAll(relationUserList.get(id) != null ? relationUserList.get(id).stream() + .map(UserRelationEntity::getUserId).collect(Collectors.toList()) + : new ArrayList<>()); + } + userIdAll.retainAll(department); + break; + default: + break; + } + } + } + } + + public void getByRule(List userIdAll, UserEntity flowUser, int rule) { + if (flowUser != null) { + String userId = flowUser.getId(); + String orgId = flowUser.getOrganizeId(); + List objectIds = new ArrayList<>(); + // 附加条件 + switch (ExtraRuleEnum.getByCode(rule)) { + case organize: + OrganizeEntity organizeInfo = serviceUtil.getOrganizeInfo(orgId); + if (null != organizeInfo + && ObjectUtil.equals(organizeInfo.getCategory(), PermissionConst.DEPARTMENT)) { + objectIds.add(orgId); + List orgRelationList = serviceUtil.getListByObjectIdAll(objectIds); + List org = orgRelationList.stream().map(UserRelationEntity::getUserId) + .filter(id -> !ObjectUtil.equals(id, userId)).collect(Collectors.toList()); + userIdAll.addAll(org); + } + break; + case position: + String positionId = flowUser.getPositionId(); + objectIds.add(positionId); + List positionRelationList = serviceUtil.getListByObjectIdAll(objectIds); + List position = positionRelationList.stream().map(UserRelationEntity::getUserId) + .filter(id -> !ObjectUtil.equals(id, userId)).collect(Collectors.toList()); + userIdAll.addAll(position); + break; + case role: + List curRolesByOrgId = serviceUtil.getCurRolesByOrgId(orgId); + List roleIds = curRolesByOrgId.stream().map(RoleEntity::getId).collect(Collectors.toList()); + List listByObjectIdAll = serviceUtil.getListByObjectIdAll(roleIds); + + List userIds = listByObjectIdAll.stream().map(UserRelationEntity::getUserId) + .filter(id -> !ObjectUtil.equals(id, userId)).collect(Collectors.toList()); + userIdAll.addAll(userIds); + break; + case group: + List ids = new ArrayList<>(); + ids.add(userId); + List listByUserIdAll = serviceUtil.getListByUserIdAll(ids); + List groupIds = listByUserIdAll.stream() + .filter(e -> ObjectUtil.equals(e.getObjectType(), PermissionConst.GROUP)) + .map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + List relations = serviceUtil.getListByObjectIdAll(groupIds); + List collect = relations.stream().map(UserRelationEntity::getUserId) + .filter(id -> !ObjectUtil.equals(id, userId)).collect(Collectors.toList()); + userIdAll.addAll(collect); + break; + } + } + } + + /** + * 封装查询审批人 + */ + private List user(FlowMethod flowMethod, int type) throws WorkFlowException { + List userIdAll = new ArrayList<>(); + TemplateNodeEntity nodeEntity = flowMethod.getNodeEntity(); + NodeModel nodeModel = JsonUtil.getJsonToBean(nodeEntity.getNodeJson(), NodeModel.class); + TaskEntity taskEntity = flowMethod.getTaskEntity(); + String createUserId = taskEntity.getCreatorUserId(); + FlowModel flowModel = flowMethod.getFlowModel(); + OperatorEntity operator = flowModel.getOperatorEntity(); + String deploymentId = flowModel.getDeploymentId(); + List nodeEntityList = flowMethod.getNodeEntityList(); + List prevList = new ArrayList<>(); + TemplateNodeEntity startNode = nodeEntityList.stream() + .filter(e -> ObjectUtil.equals(e.getNodeType(), NodeEnum.start.getType())).findFirst().orElse(null); + boolean prevIsStart = false; + // 发起者【部门主管】 + if (FlowTaskOperatorEnum.DepartmentCharge.getCode().equals(type)) { + this.prevNode(deploymentId, nodeEntity.getNodeCode(), nodeEntityList, prevList); + if (null != startNode) { + prevIsStart = prevList.contains(startNode.getNodeCode()); + } + // 判断 发起人、上一节点 + Integer managerType = nodeModel.getManagerApproverType(); + if (ObjectUtil.equals(managerType, 2) && !prevIsStart) { + List handleIds = this.getHandleIds(taskEntity.getId(), operator); + List userList = serviceUtil.getUserName(handleIds); + + for (UserEntity user : userList) { + OrganizeEntity organizeEntity = getManageOrgByLevel(user.getOrganizeId(), 1); + if (null != organizeEntity) { + userIdAll.add(organizeEntity.getManagerId()); + } + } + } else { + LaunchUserEntity launchUser = launchUserService.getInfoByTask(taskEntity.getId()); + String orgId; + if (launchUser != null) { + orgId = launchUser.getOrganizeId(); + } else { + UserEntity info = serviceUtil.getUserInfo(createUserId); + orgId = info == null ? "" : info.getOrganizeId(); + } + OrganizeEntity organizeEntity = getManageOrgByLevel(orgId, 1); + if (organizeEntity != null) { + userIdAll.add(organizeEntity.getManagerId()); + } + } + } + // 发起者【发起者主管】 + if (FlowTaskOperatorEnum.LaunchCharge.getCode().equals(type)) { + this.prevNode(deploymentId, nodeEntity.getNodeCode(), nodeEntityList, prevList); + if (null != startNode) { + prevIsStart = prevList.contains(startNode.getNodeCode()); + } + // 判断 发起人、上一节点 + Integer approverType = nodeModel.getApproverType(); + if (ObjectUtil.equals(approverType, 2) && !prevIsStart) { + List handleIds = this.getHandleIds(taskEntity.getId(), operator); + List userList = serviceUtil.getUserName(handleIds); + + for (UserEntity user : userList) { + String managerByLevel = getManagerByLevel(user.getManagerId(), nodeModel.getManagerLevel()); + if (StringUtil.isNotEmpty(managerByLevel)) { + userIdAll.add(managerByLevel); + } + } + } else { + UserEntity info = serviceUtil.getUserInfo(createUserId); + if (info != null) { + String managerByLevel = getManagerByLevel(info.getManagerId(), nodeModel.getManagerLevel()); + if (StringUtil.isNotEmpty(managerByLevel)) { + userIdAll.add(managerByLevel); + } + } + } + } + // 【发起本人】 + if (FlowTaskOperatorEnum.InitiatorMe.getCode().equals(type)) { + userIdAll.add(createUserId); + } + // 【变量】 + if (FlowTaskOperatorEnum.Variate.getCode().equals(type)) { + flowMethod.setIsAssign(false); + flowMethod.setIsData(true); + Map dataAll = flowMethod.getSubFormData(); + if (CollectionUtil.isEmpty(dataAll)) { + dataAll = createOrUpdate(flowMethod); + } + Object data = this.getOneData(dataAll, nodeModel.getFormField()); + if (ObjectUtil.isNotEmpty(data)) { + List list = new ArrayList<>(); + try { + List> dataList = JsonUtil.getJsonToBean(data, List.class); + for (List ids : dataList) { + for (String id : ids) { + list.add(id); + } + } + } catch (Exception e) { + try { + List dataList = JsonUtil.getJsonToList(data, String.class); + for (String id : dataList) { + list.add(id); + } + } catch (Exception e1) { + list.addAll(Arrays.asList(String.valueOf(data).split(","))); + } + } + List id = new ArrayList<>(); + for (String s : list) { + id.add(s.split("--")[0]); + } + List listByObjectIdAll = serviceUtil.getListByObjectIdAll(id); + List userPosition = listByObjectIdAll.stream().map(UserRelationEntity::getUserId) + .collect(Collectors.toList()); + List handleIdAll = new ArrayList<>(); + handleIdAll.addAll(userPosition); + handleIdAll.addAll(id); + userIdAll.addAll(handleIdAll); + } + } + // 【环节】 + if (FlowTaskOperatorEnum.Tache.getCode().equals(type)) { + List list = recordUtil.getList(taskEntity.getId()); + list = list.stream().filter(e -> ObjectUtil.equals(e.getNodeCode(), nodeModel.getApproverNodeId()) + && (FlowNature.AuditCompletion.equals(e.getHandleType()) + || FlowNature.RejectCompletion.equals(e.getHandleType())) + && !FlowNature.Invalid.equals(e.getStatus()) && !e.getHandleId().equals(FlowNature.SYSTEM_CODE) + && !e.getHandleId().equals("0")) + .collect(Collectors.toList()); + List handleId = list.stream().map(RecordEntity::getHandleId).collect(Collectors.toList()); + userIdAll.addAll(handleId); + } + // 【服务】 + if (FlowTaskOperatorEnum.Serve.getCode().equals(type)) { + flowMethod.setIsAssign(false); + flowMethod.setIsData(true); + Map dataAll = createOrUpdate(flowMethod); + InterfaceConfig interfaceConfig = nodeModel.getInterfaceConfig(); + String interfaceId = interfaceConfig.getInterfaceId(); + if (StringUtil.isNotEmpty(interfaceId)) { + UserInfo userInfo = UserProvider.getUser(); + List templateJsonModelList = interfaceConfig.getTemplateJson(); + RecordEntity record = new RecordEntity(); + record.setTaskId(taskEntity.getId()); + record.setNodeCode(nodeEntity.getNodeCode()); + record.setHandleId(userInfo.getUserId()); + // UserEntity createUser = + // serviceUtil.getUserInfo(taskEntity.getCreatorUserId()); + // UserEntity delegate = StringUtil.isNotEmpty(taskEntity.getDelegateUserId()) ? + // serviceUtil.getUserInfo(taskEntity.getDelegateUserId()) : null; + Map parameterMap = msgUtil.parameterMap(dataAll, templateJsonModelList, record, + taskEntity); + ActionResult result = serviceUtil.infoToId(interfaceId, parameterMap); + if (Objects.equals(200, result.getCode())) { + Object data = result.getData(); + if (data instanceof Map) { + JSONObject map = new JSONObject((Map) data); + List handleId = StringUtil.isNotEmpty(map.getString("handleId")) + ? Arrays.asList(map.getString("handleId").split(",")) + : new ArrayList<>(); + userIdAll.addAll(handleId); + } + } + } + } + // 【候选人】 + if (FlowTaskOperatorEnum.Candidate.getCode().equals(type)) { + String nodeCode = nodeEntity.getNodeCode(); + List candidatesList = candidatesService.getList(taskEntity.getId(), nodeCode); + if (CollectionUtil.isNotEmpty(candidatesList)) { + List opIds = candidatesList.stream().map(CandidatesEntity::getOperatorId) + .collect(Collectors.toList()); + List operators = operatorService.listByIds(opIds); + for (CandidatesEntity t : candidatesList) { + OperatorEntity op = operators.stream().filter(e -> ObjectUtil.equals(e.getId(), t.getOperatorId())) + .findFirst().orElse(null); + if (null != op && null == op.getHandleStatus() && null != op.getHandleParameter()) { + continue; + } + List candidates = StringUtil.isNotEmpty(t.getCandidates()) + ? Arrays.stream(t.getCandidates().split(",")).collect(Collectors.toList()) + : new ArrayList<>(); + userIdAll.addAll(candidates); + } + } + } + // 【指定人】 + if (FlowTaskOperatorEnum.Nominator.getCode().equals(type)) { + List list = this.getSub(nodeModel); + List handleIdAll = serviceUtil.getUserListAll(list); + userIdAll.addAll(handleIdAll); + } + return userIdAll; + } + + public Object getOneData(Map map, String key) { + Object obj = null; + if (null != map) { + obj = map.get(key + FlowNature.FORM_FIELD_SUFFIX); + if (null == obj) { + obj = map.get(key); + } + } + return obj; + } + + public List getSub(NodeModel nodeModel) { + return this.getSub(nodeModel.getApprovers()); + } + + public List getSub(List approvers) { + List list = new ArrayList<>(); + if (CollectionUtil.isNotEmpty(approvers)) { + list.addAll(approvers); + List consts = ImmutableList.of(PermissionConst.COMPANY, PermissionConst.DEPARTMENT); + // 获取公司、部门的所有下级 + for (String approver : approvers) { + String[] split = approver.split("--"); + if (split.length > 1 && consts.contains(split[1])) { + List childOrg = serviceUtil.getChildOrg(split[0]); + list.addAll(childOrg); + } + } + list = list.stream().distinct().collect(Collectors.toList()); + } + return list; + } + + // 根据经办获取上一审批节点的审批人 + public List getHandleIds(String taskId, OperatorEntity operator) { + List handleIds = new ArrayList<>(); + List operatorList = operatorUtil.getList(taskId); + if (CollectionUtil.isNotEmpty(operatorList)) { + List list = operatorList.stream() + .filter(e -> e.getHandleTime() != null && ObjectUtil.equals(e.getNodeId(), operator.getNodeId())) + .collect(Collectors.toList()); + handleIds = list.stream().map(OperatorEntity::getHandleId).distinct().collect(Collectors.toList()); + } + if (CollectionUtil.isEmpty(handleIds)) { + handleIds.add(operator.getHandleId()); + } + return handleIds; + } + + /** + * 递归上级部门 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/29 + */ + private OrganizeEntity getManageOrgByLevel(String organizeId, long level) { + --level; + if (level == 0) { + return serviceUtil.getOrganizeInfo(organizeId); + } else { + OrganizeEntity organizeInfo = serviceUtil.getOrganizeInfo(organizeId); + return organizeInfo != null ? getManageOrgByLevel(organizeInfo.getParentId(), level) : null; + } + } + + /** + * 递归主管 + * + * @param managerId 主管id + * @param level 第几级 + * @return + */ + public String getManagerByLevel(String managerId, long level) { + --level; + if (level == 0) { + return managerId; + } else { + UserEntity userEntity = serviceUtil.getUserInfo(managerId); + return userEntity != null ? getManagerByLevel(userEntity.getManagerId(), level) : ""; + } + } + + /** + * 保存、更新数据,仅处理数据 + */ + public Map createOrUpdate(FlowMethod flowMethod) throws WorkFlowException { + TaskEntity taskEntity = flowMethod.getTaskEntity(); + TemplateNodeEntity nodeEntity = flowMethod.getNodeEntity(); + NodeModel nodeModel = JsonUtil.getJsonToBean(nodeEntity.getNodeJson(), NodeModel.class); + + List nodeEntityList = flowMethod.getNodeEntityList(); + + FlowModel flowModel = flowMethod.getFlowModel(); + boolean voluntarily = flowModel.getVoluntarily(); + boolean isData = flowMethod.getIsData(); + Map formData = flowModel.getFormData(); + Map data = new HashMap<>(); + // 保存数据的表单 + String formId = nodeEntity.getFormId(); + // 子流程选择的流程版本id + String flowId = nodeEntity.getFlowId(); + String taskId = taskEntity.getId(); + + List handleStatus = ImmutableList.of(FlowRecordEnum.audit.getCode(), FlowRecordEnum.submit.getCode()); + // 递归 + List nodeIdList = new ArrayList<>(); + prevNodeList(flowModel.getDeploymentId(), nodeEntity.getNodeCode(), nodeEntityList, nodeIdList); + List list = recordService.getRecordList(taskId, handleStatus).stream() + .filter(t -> nodeIdList.contains(t.getNodeCode())) + .sorted(Comparator.comparing(RecordEntity::getHandleTime).reversed()) + .collect(Collectors.toList()); + List recordNodeIdList = new ArrayList<>(); + for (int i = 0; i < list.size(); i++) { + if (i == 0) { + recordNodeIdList.add(list.get(i).getNodeCode()); + } + } + List taskNodeEntity = nodeEntityList.stream() + .filter(t -> nodeIdList.contains(t.getNodeCode())).collect(Collectors.toList()); + if (taskNodeEntity.size() == 0) { + taskNodeEntity.addAll(nodeEntityList.stream().filter(t -> recordNodeIdList.contains(t.getNodeCode())) + .collect(Collectors.toList())); + } + String taskNodeFormId = ""; + String nodeCode = ""; + if (CollectionUtil.isNotEmpty(list)) { + nodeCode = list.get(0).getNodeCode(); + } else { + if (!taskNodeEntity.isEmpty()) { + nodeCode = taskNodeEntity.get(0).getNodeCode(); + } + } + if (!taskNodeEntity.isEmpty()) { + formData.put(FlowConstant.PREV_NODE_FORM_ID, taskNodeEntity.get(0).getFormId()); + } + if (StringUtil.isNotEmpty(taskNodeFormId) && isData) { + Map taskNodeData = infoData(taskNodeFormId, taskId); + if (NodeEnum.subFlow.getType().equals(nodeModel.getType()) || voluntarily) { + if (NodeEnum.subFlow.getType().equals(nodeModel.getType())) { + taskNodeData.put(FlowFormConstant.FLOWID, flowId); + } + formData.putAll(taskNodeData); + } + } + String resultNodeCode = nodeCode; + List assignList = nodeModel.getAssignList().stream().filter(e -> e.getNodeId().equals(resultNodeCode)) + .collect(Collectors.toList()); + // 获取当前表单 + Map thisNodeData = infoData(formId, taskId); + data.putAll(thisNodeData); + data.putAll(formData(formData, assignList, taskEntity, flowMethod)); + return data; + } + + /** + * 处理数据传递,并存储在线程,后续保存数据库 + */ + public Map dataTransfer(FlowMethod flowMethod) throws WorkFlowException { + TaskEntity taskEntity = flowMethod.getTaskEntity(); + TemplateNodeEntity nodeEntity = flowMethod.getNodeEntity(); + NodeModel nodeModel = JsonUtil.getJsonToBean(nodeEntity.getNodeJson(), NodeModel.class); + FlowModel flowModel = flowMethod.getFlowModel(); + Map formData = flowModel.getFormData(); + + List nodeEntityList = flowMethod.getNodeEntityList(); + + TemplateNodeEntity globalEntity = nodeEntityList.stream() + .filter(e -> ObjectUtil.equals(e.getNodeType(), NodeEnum.global.getType())).findFirst().orElse(null); + // 判断是否能数据传递 + if (null != globalEntity) { + NodeModel global = JsonUtil.getJsonToBean(globalEntity.getNodeJson(), NodeModel.class); + if (!global.getHasAloneConfigureForms()) { + return formData; + } + } + if (CollectionUtil.isEmpty(nodeModel.getAssignList())) { + return formData; + } + + boolean voluntarily = flowModel.getVoluntarily(); + boolean isAssign = flowMethod.getIsAssign(); + boolean isData = flowMethod.getIsData(); + + Map data = new HashMap<>(); + // 保存数据的表单 + String formId = nodeEntity.getFormId(); + // 子流程选择的流程版本id + String flowId = nodeEntity.getFlowId(); + String taskId = taskEntity.getId(); + + List handleStatus = ImmutableList.of(FlowRecordEnum.audit.getCode(), FlowRecordEnum.submit.getCode()); + // 递归 + List nodeIdList = new ArrayList<>(); + prevNodeList(flowModel.getDeploymentId(), nodeEntity.getNodeCode(), nodeEntityList, nodeIdList); + List list = recordService.getRecordList(taskId, handleStatus).stream() + .filter(t -> nodeIdList.contains(t.getNodeCode())) + .sorted(Comparator.comparing(RecordEntity::getHandleTime).reversed()) + .collect(Collectors.toList()); + List recordNodeIdList = new ArrayList<>(); + for (int i = 0; i < list.size(); i++) { + if (i == 0) { + recordNodeIdList.add(list.get(i).getNodeCode()); + } + } + List taskNodeEntity = nodeEntityList.stream() + .filter(t -> nodeIdList.contains(t.getNodeCode())).collect(Collectors.toList()); + if (taskNodeEntity.size() == 0) { + taskNodeEntity.addAll(nodeEntityList.stream().filter(t -> recordNodeIdList.contains(t.getNodeCode())) + .collect(Collectors.toList())); + } + String taskNodeFormId = ""; + String nodeCode = ""; + if (CollectionUtil.isNotEmpty(list)) { + nodeCode = list.get(0).getNodeCode(); + } else { + if (!taskNodeEntity.isEmpty()) { + nodeCode = taskNodeEntity.get(0).getNodeCode(); + } + } + if (!taskNodeEntity.isEmpty()) { + formData.put(FlowConstant.PREV_NODE_FORM_ID, taskNodeEntity.get(0).getFormId()); + } + if (StringUtil.isNotEmpty(taskNodeFormId) && isData) { + Map taskNodeData = infoData(taskNodeFormId, taskId); + if (NodeEnum.subFlow.getType().equals(nodeModel.getType()) || voluntarily) { + if (NodeEnum.subFlow.getType().equals(nodeModel.getType())) { + taskNodeData.put(FlowFormConstant.FLOWID, flowId); + } + formData.putAll(taskNodeData); + } + } + String resultNodeCode = nodeCode; + List assignList = nodeModel.getAssignList().stream().filter(e -> e.getNodeId().equals(resultNodeCode)) + .collect(Collectors.toList()); + // 获取当前表单 + Map thisNodeData = infoData(formId, taskId); + data.putAll(thisNodeData); + data.putAll(formData(formData, assignList, taskEntity, flowMethod)); + List typeList = ImmutableList.of(NodeEnum.end.getType(), NodeEnum.subFlow.getType()); + if (isAssign) { + boolean isWrite = !typeList.contains(nodeModel.getType()); + FlowContextHolder.addChildData(taskId, formId, data, new ArrayList<>(), isWrite); + } + return data; + } + + /** + * 获取上级节点 + * + * @param deploymentId 部署id + * @param nodeCode 节点编码 + * @param nodeEntityList 节点集合 + * @param nodeCodeList 上一级节点编码集合 + */ + public void prevNodeList(String deploymentId, String nodeCode, List nodeEntityList, + List nodeCodeList) throws WorkFlowException { + NextOrPrevFo fo = new NextOrPrevFo(); + fo.setDeploymentId(deploymentId); + fo.setTaskKey(nodeCode); + List prevList = flowAbleUrl.getPrev(fo); + if (CollectionUtil.isNotEmpty(prevList)) { + for (String prev : prevList) { + TemplateNodeEntity nodeEntity = nodeEntityList.stream().filter(e -> e.getNodeCode().equals(prev)) + .findFirst().orElse(null); + if (nodeEntity != null) { + // 获取 不是子流程类型的节点 + if (nodeEntity.getNodeType().equals(NodeEnum.subFlow.getType())) { + prevNodeList(deploymentId, nodeEntity.getNodeCode(), nodeEntityList, nodeCodeList); + } else { + nodeCodeList.add(nodeEntity.getNodeCode()); + } + } + } + } + } + + /** + * 获取上级节点,不过滤子流程节点 + * + * @param deploymentId 部署id + * @param nodeCode 节点编码 + * @param nodeEntityList 节点集合 + * @param nodeCodeList 上一级节点编码集合 + */ + public void prevNode(String deploymentId, String nodeCode, List nodeEntityList, + List nodeCodeList) throws WorkFlowException { + NextOrPrevFo fo = new NextOrPrevFo(); + fo.setDeploymentId(deploymentId); + fo.setTaskKey(nodeCode); + List prevList = flowAbleUrl.getPrev(fo); + if (CollectionUtil.isNotEmpty(prevList)) { + for (String prev : prevList) { + TemplateNodeEntity nodeEntity = nodeEntityList.stream().filter(e -> e.getNodeCode().equals(prev)) + .findFirst().orElse(null); + if (nodeEntity != null) { + nodeCodeList.add(nodeEntity.getNodeCode()); + } + } + } + } + + /** + * 查询表单值 + * + * @return + */ + public Map infoData(String formId, String taskId) throws WorkFlowException { + Map> allData = FlowContextHolder.getAllData(); + Map dataAll = allData.get(taskId + "_yunzhupaas_" + formId) != null + ? allData.get(taskId + "_yunzhupaas_" + formId) + : serviceUtil.infoData(formId, taskId); + return dataAll; + } + + // 截取数据传递字段,获取表单id + public List handleAssignRule(List ruleList) { + List list = new ArrayList<>(); + if (CollectionUtil.isNotEmpty(ruleList)) { + for (AssignRule assignRule : ruleList) { + AssignRule rule = JsonUtil.getJsonToBean(assignRule, AssignRule.class); + String parentField = assignRule.getParentField(); + int index = parentField.lastIndexOf("|"); + if (index != -1) { + String field = parentField.substring(0, index); + rule.setParentField(field); + String substring = parentField.substring(index + 1); + rule.setFormId(substring); + } + list.add(rule); + } + } + return list; + } + + // 表单赋值 + public Map formData(Map formData, List assignListAll, TaskEntity taskEntity, + FlowMethod flowMethod) throws WorkFlowException { + String taskId = taskEntity.getId(); + List nodeEntityList = flowMethod.getNodeEntityList(); + TemplateNodeEntity startNode = nodeEntityList.stream() + .filter(e -> ObjectUtil.equals(e.getNodeType(), NodeEnum.start.getType())).findFirst().orElse(null); + if (startNode != null) { + formData.put(FlowNature.StartNodeFormId, startNode.getFormId()); + } + + Map result = new HashMap<>(formData); + Map oldData = new HashMap<>(formData); + + Map> map = new HashMap<>(); + + // 全局参数 + String globalParameter = taskEntity.getGlobalParameter(); + Map taskMap = globalParameter != null ? JsonUtil.stringToMap(globalParameter) : new HashMap<>(); + + for (Assign assignModel : assignListAll) { + List ruleList = this.handleAssignRule(assignModel.getRuleList()); + for (AssignRule assignMode : ruleList) { + String parentField = assignMode.getParentField(); + String[] parentFieldList = parentField.split("-"); + String childField = assignMode.getChildField(); + String[] childFieldList = childField.split("-"); + + if (childFieldList.length > 1 && parentFieldList.length > 1) { + int end = 0; + if (oldData.get(parentFieldList[0]) instanceof List) { + List> parentList = (List>) oldData + .get(parentFieldList[0]); + end = parentList.size(); + } + if (result.get(childFieldList[0]) instanceof List) { + List> childList = (List>) result.get(childFieldList[0]); + for (int i = 0; i < childList.size() - end; i++) { + childList.add(new HashMap<>()); + } + } else { + List> childList = new ArrayList<>(); + for (int i = 0; i < end; i++) { + childList.add(new HashMap<>()); + } + result.put(childFieldList[0], childList); + result.put(childFieldList[0] + FlowNature.FORM_FIELD_SUFFIX, childList); + } + } + } + } + + for (Assign assignModel : assignListAll) { + List ruleList = this.handleAssignRule(assignModel.getRuleList()); + for (AssignRule assignMode : ruleList) { + String formId = assignMode.getFormId(); + if (StringUtil.equals(formId, FlowNature.GLOBAL_PARAMETER)) { + oldData.putAll(taskMap); + } else { + Map mapData = map.get(formId); + if (CollectionUtil.isEmpty(mapData)) { + Map data = serviceUtil.infoData(formId, taskId); + map.put(formId, data); + oldData.putAll(data); + } + } + // 子表处理规则 + String parentField = assignMode.getParentField(); + String[] parentFieldList = parentField.split("-"); + String childField = assignMode.getChildField(); + String[] childFieldList = childField.split("-"); + Object childData = getSysParamData(oldData, parentField, taskId); + if (childFieldList.length > 1) { + List> childMapAll = new ArrayList<>(); + if (result.get(childFieldList[0]) instanceof List) { + List> childList = (List>) result.get(childFieldList[0]); + for (Map objectMap : childList) { + Map childMap = new HashMap<>(objectMap); + childMapAll.add(childMap); + } + } + if (parentFieldList.length > 1) { + if (oldData.get(parentFieldList[0]) instanceof List) { + List> parentList = (List>) oldData + .get(parentFieldList[0]); + int num = parentList.size() - childMapAll.size(); + for (int i = 0; i < num; i++) { + childMapAll.add(new HashMap<>()); + } + for (int i = 0; i < parentList.size(); i++) { + Map parentMap = parentList.get(i); + Map childMap = childMapAll.get(i); + childMap.put(childFieldList[1], parentMap.get(parentFieldList[1])); + } + } + } else { + // 主传子 + if (1 > childMapAll.size()) { + childMapAll.add(new HashMap<>()); + } + for (Map childMap : childMapAll) { + childMap.put(childFieldList[1], childData); + } + } + result.put(childFieldList[0], childMapAll); + result.put(childFieldList[0] + FlowNature.FORM_FIELD_SUFFIX, childMapAll); + } else { + if (parentFieldList.length > 1) { + if (oldData.get(parentFieldList[0]) instanceof List) { + List> parentList = (List>) oldData + .get(parentFieldList[0]); + for (int i = 0; i < parentList.size(); i++) { + Map parentMap = parentList.get(i); + if (i == 0) { + childData = parentMap.get(parentFieldList[1]); + } + } + } + } + result.put(childField, childData); + result.put(childField + FlowNature.FORM_FIELD_SUFFIX, childData); + } + } + } + return result; + } + + /** + * 处理系统参数: + * + * @prevNodeFormId上节点表单id + */ + private Object getSysParamData(Map formData, String parentField, String taskId) { + Object data; + if (FlowConstant.PREV_NODE_FORM_ID.equals(parentField)) { + data = taskId; + } else { + data = formData.get(parentField); + } + return data; + } + + // true为选择分支 + public boolean checkBranch(TemplateNodeEntity nodeEntity) { + NodeModel nodeModel = JsonUtil.getJsonToBean(nodeEntity.getNodeJson(), NodeModel.class); + return this.checkBranch(nodeModel); + } + + public boolean checkBranch(NodeModel nodeModel) { + String divideRule = nodeModel.getDivideRule(); + return ObjectUtil.equals(DivideRuleEnum.CHOOSE.getType(), divideRule); + } + + // false为候选人 + public boolean checkNextCandidates(List nodeList) { + if (CollectionUtil.isNotEmpty(nodeList)) { + for (NodeModel node : nodeList) { + if (node.getAssigneeType().equals(FlowTaskOperatorEnum.Candidate.getCode())) { + return false; + } + } + } + return true; + } + + public int checkNextError(FlowModel flowModel, List nextApprover, boolean nodeFlag, + boolean notSubmitFlag) throws WorkFlowException { + return this.checkNextError(flowModel, nextApprover, nodeFlag, notSubmitFlag, false); + } + + // 判断异常处理是否是 上一节点审批人指定处理人、无法提交 + public int checkNextError(FlowModel flowModel, List nextApprover, boolean nodeFlag, + boolean notSubmitFlag, boolean errorFlag) throws WorkFlowException { + List nodeEntityList = flowModel.getNodeEntityList(); + TaskEntity taskEntity = flowModel.getTaskEntity(); + List errorList = new ArrayList<>(); + for (NodeModel nodeModel : nextApprover) { + // 候选人节点跳过 + if (ObjectUtil.equals(nodeModel.getAssigneeType(), FlowTaskOperatorEnum.Candidate.getCode())) { + continue; + } + TemplateNodeEntity nodeEntity = nodeEntityList.stream() + .filter(e -> e.getNodeCode().equals(nodeModel.getNodeId())).findFirst().orElse(null); + // 获取审批人 + FlowMethod flowMethod = new FlowMethod(); + flowMethod.setFlowModel(flowModel); + flowMethod.setTaskEntity(taskEntity); + flowMethod.setNodeEntity(nodeEntity); + flowMethod.setNodeEntityList(nodeEntityList); + flowMethod.setErrorRule(true); + flowMethod.setExtraRule(true); + List userIds = this.userListAll(flowMethod); + + Integer node = flowMethod.getNode(); + Integer notSubmit = flowMethod.getNotSubmit(); + + if (node > 0) { + if (nodeFlag) { + operatorUtil.handleErrorRule(nodeModel, errorList); + } else { + return 1; + } + } + if (notSubmit > 0) { + if (notSubmitFlag) { + throw new WorkFlowException(MsgCode.WF061.get()); + } + return 2; + } + } + if (errorFlag && CollectionUtil.isNotEmpty(errorList)) { + flowModel.setErrorList(errorList); + return 3; + } + if (!errorList.isEmpty()) { + AuditModel model = new AuditModel(); + model.setErrorCodeList(errorList); + throw new WorkFlowException(200, JsonUtil.getObjectToString(model)); + } + return 0; + } + + /** + * 获取下一级审批节点 + */ + public List getNextApprover(FlowMethod flowMethod) throws WorkFlowException { + String deploymentId = flowMethod.getDeploymentId(); + String nodeCode = flowMethod.getNodeCode(); + Map nodes = flowMethod.getNodes(); + List nextNode = flowMethod.getNextNode(); + + // 获取下一级节点 + NextOrPrevFo fo = new NextOrPrevFo(); + fo.setDeploymentId(deploymentId); + fo.setTaskKey(nodeCode); + List nextList = flowAbleUrl.getNext(fo); + + if (CollectionUtil.isNotEmpty(nextList)) { + OutgoingFlowsFo flowsFo = new OutgoingFlowsFo(); + flowsFo.setDeploymentId(deploymentId); + flowsFo.setTaskKey(nodeCode); + List outgoingFlows = flowAbleUrl.getOutgoingFlows(flowsFo); + Map res = new HashMap<>(); + + flowMethod.setOutgoingFlows(outgoingFlows); + flowMethod.setResMap(res); + conditionService.getConditionResult(flowMethod); + conditionService.checkCondition(res, nodes); + + for (FlowableNodeModel next : nextList) { + // 判断条件,子流程的出线 条件都为false 则跳过 + Map resMap = new HashMap<>(); + flowMethod.setOutgoingFlows(next.getIncomingList()); + flowMethod.setResMap(resMap); + flowMethod.setNodeCode(next.getId()); + conditionService.getConditionResult(flowMethod); + try { + conditionService.checkCondition(resMap, nodes); + } catch (WorkFlowException e) { + continue; + } + NodeModel nodeModel = nodes.get(next.getId()); + if (null != nodeModel) { + // 子流程往下递归 + if (nodeModel.getType().equals(NodeEnum.subFlow.getType())) { + if (flowMethod.getNextSubFlow()) { + nextNode.add(nodeModel); + } + getNextApprover(flowMethod); + } else { + nextNode.add(nodeModel); + } + } + } + } + return nextNode; + } + + // 删除表单数据 + public void deleteFormData(List taskList) throws Exception { + if (taskList.isEmpty()) { + return; + } + List nodeEntityList = new ArrayList<>(); + List flowIds = taskList.stream().map(TaskEntity::getFlowId).collect(Collectors.toList()); + if (!flowIds.isEmpty()) { + nodeEntityList = templateNodeService.getList(flowIds, null); + } + + for (TaskEntity taskEntity : taskList) { + List formIds = nodeEntityList.stream() + .filter(e -> e.getFlowId().equals(taskEntity.getFlowId()) && StringUtil.isNotBlank(e.getFormId())) + .map(TemplateNodeEntity::getFormId).distinct().collect(Collectors.toList()); + for (String formId : formIds) { + serviceUtil.deleteFormData(formId, taskEntity.getId()); + } + } + } + + public List getNextList(String deploymentId, String nodeCode, Map nodes, + List nextList) throws WorkFlowException { + nextList = nextList != null ? nextList : new ArrayList<>(); + NextOrPrevFo fo = new NextOrPrevFo(); + fo.setDeploymentId(deploymentId); + fo.setTaskKey(nodeCode); + List nextModels = flowAbleUrl.getNext(fo); + for (FlowableNodeModel next : nextModels) { + + NodeModel nodeModel = nodes.get(next.getId()); + if (null != nodeModel) { + // 子流程往下递归 + if (nodeModel.getType().equals(NodeEnum.subFlow.getType())) { + nextList.add(next.getId()); + getNextList(deploymentId, next.getId(), nodes, nextList); + } else { + nextList.add(next.getId()); + } + } + } + return nextList; + } + + public List getSubTask(String taskId, List nodeCodes) { + if (StringUtil.isEmpty(taskId)) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TaskEntity::getParentId, taskId); + if (CollectionUtil.isNotEmpty(nodeCodes)) { + queryWrapper.lambda().in(TaskEntity::getSubCode, nodeCodes); + } + return taskService.list(queryWrapper); + } + + public void checkTemplateHide(String templateId) throws WorkFlowException { + TemplateEntity template = templateService.getById(templateId); + if (null != template) { + List templateStatus = ImmutableList.of(1, 2); + if (!templateStatus.contains(template.getStatus())) { + throw new WorkFlowException(MsgCode.WF140.get()); + } + } + } + + public ActionResult launchFlow(FlowModel flowModel) throws Exception { + String templateId = flowModel.getTemplateId(); + List userIds = flowModel.getUserIds(); + List> formDataList = flowModel.getFormDataList(); + if (CollectionUtil.isEmpty(formDataList)) { + return ActionResult.fail("未选择记录,发起失败"); + } + TemplateEntity template = templateService.getById(templateId); + if (null == template) { + return ActionResult.fail(MsgCode.WF122.get()); + } + if (!ObjectUtil.equals(template.getStatus(), 1)) { + throw new WorkFlowException(MsgCode.WF140.get()); + } + TemplateJsonEntity jsonEntity = templateJsonService.getById(template.getFlowId()); + List nodeEntityList = templateNodeService.getList(jsonEntity.getId()); + Map nodes = new HashMap<>(); + for (TemplateNodeEntity node : nodeEntityList) { + nodes.put(node.getNodeCode(), JsonUtil.getJsonToBean(node.getNodeJson(), NodeModel.class)); + } + FlowMethod method = new FlowMethod(); + method.setDeploymentId(jsonEntity.getFlowableId()); + TemplateNodeEntity startNode = nodeEntityList.stream() + .filter(e -> StringUtil.equals(NodeEnum.start.getType(), e.getNodeType())).findFirst() + .orElse(new TemplateNodeEntity()); + if (this.checkBranch(startNode)) { + throw new WorkFlowException(MsgCode.WF147.get()); + } + method.setNodeCode(startNode.getNodeCode()); + method.setNodes(nodes); + method.setNodeEntityList(nodeEntityList); + Map resMap = conditionService.handleCondition(method); + // 判断条件、候选人 + try { + conditionService.checkCondition(resMap, nodes); + } catch (WorkFlowException e) { + throw new WorkFlowException(MsgCode.WF133.get()); + } + method.setNextSubFlow(true); + List nextApprover = this.getNextApprover(method); + if (!this.checkNextCandidates(nextApprover)) { + throw new WorkFlowException(MsgCode.WF134.get()); + } + + String flowId = jsonEntity.getId(); + // 判断流程权限 + List userListAll = serviceUtil.getUserListAll(userIds); + FlowFormModel formIdAndFlowId = templateService.getFormIdAndFlowId(userListAll, templateId); + List userList = serviceUtil.getUserName(formIdAndFlowId.getUserId(), true); + if (CollectionUtil.isEmpty(userList)) { + throw new WorkFlowException(MsgCode.WF136.get()); + } + for (UserEntity user : userList) { + UserInfo userInfo = new UserInfo(); + userInfo.setUserId(user.getId()); + userInfo.setUserName(user.getRealName()); + + FlowModel model = new FlowModel(); + model.setUserInfo(userInfo); + model.setFlowId(flowId); + model.setStatus(1); + model.setDeploymentId(jsonEntity.getFlowableId()); + model.setNodeEntityList(nodeEntityList); + for (Map formData : formDataList) { + model.setFormData(formData); + if (this.checkNextError(model, nextApprover, false, false) != 0) { + throw new WorkFlowException(MsgCode.WF135.get()); + } + taskService.batchSaveOrSubmit(model); + TaskEntity taskEntity = model.getTaskEntity(); + if (taskEntity.getRejectDataId() == null) { + operatorUtil.autoAudit(model); + operatorUtil.handleEvent(); + } + } + } + return ActionResult.success(MsgCode.SU006.get()); + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/TimeUtil.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/TimeUtil.java new file mode 100644 index 0000000..12f13fb --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/TimeUtil.java @@ -0,0 +1,184 @@ +package com.yunzhupaas.flowable.util; + +import cn.hutool.core.date.DateUtil; +import com.yunzhupaas.flowable.entity.OperatorEntity; +import com.yunzhupaas.flowable.entity.TaskEntity; +import com.yunzhupaas.flowable.enums.NodeEnum; +import com.yunzhupaas.flowable.job.FlowJobUtil; +import com.yunzhupaas.flowable.job.FlowTime; +import com.yunzhupaas.flowable.model.task.FlowModel; +import com.yunzhupaas.flowable.model.templatenode.nodejson.NodeModel; +import com.yunzhupaas.flowable.model.templatenode.nodejson.TimeConfig; +import com.yunzhupaas.flowable.model.time.FlowTimeModel; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.RedisUtil; +import org.quartz.*; +import org.quartz.impl.StdSchedulerFactory; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2024/5/22 下午7:22 + */ +public class TimeUtil { + + public static boolean test = false; + + private static final SchedulerFactory schedulerFactory = new StdSchedulerFactory(); + + public static void addJob(String jobName, Integer time, Class jobClass, JobDataMap jobDataMap, Date startDate, Date endDate) { + if (jobDataMap == null) { + jobDataMap = new JobDataMap(); + } + JobDetail jobDetail = JobBuilder.newJob(jobClass).withIdentity(jobName).setJobData(jobDataMap).build(); + Trigger trigger = TriggerBuilder.newTrigger() + .forJob(jobDetail) + .withIdentity(jobName) + .withSchedule(CalendarIntervalScheduleBuilder.calendarIntervalSchedule().withIntervalInMinutes(test ? time : time * 60)) + .startAt(startDate == null ? new Date() : startDate) + .endAt(endDate != null ? endDate : null) + .build(); + try { + //获取实例化的 Scheduler。 + Scheduler scheduler = getScheduler(); + //将任务及其触发器放入调度器 + scheduler.scheduleJob(jobDetail, trigger); + //调度器开始调度任务 + if (!scheduler.isShutdown()) { + scheduler.start(); + } + } catch (SchedulerException e) { + } + } + + private static Scheduler getScheduler() { + try { + return schedulerFactory.getScheduler(); + } catch (SchedulerException e) { + e.getMessage(); + } + return null; + } + + public static void deleteJob(String jobName) { + try { + TriggerKey triggerKey = TriggerKey.triggerKey(jobName); + Scheduler scheduler = getScheduler(); + scheduler.pauseTrigger(triggerKey); + scheduler.unscheduleJob(triggerKey); + scheduler.deleteJob(JobKey.jobKey(jobName)); + } catch (SchedulerException e) { + e.getMessage(); + } + } + + public static void timeModel(List operatorList, FlowModel flowModel, RedisUtil redisUtil) { + FlowModel model = new FlowModel(); + model.setUserInfo(flowModel.getUserInfo()); + model.setNodeEntityList(flowModel.getNodeEntityList()); + model.setNodes(flowModel.getNodes()); + model.setDeploymentId(flowModel.getDeploymentId()); + model.setTaskEntity(flowModel.getTaskEntity()); + model.setFormData(flowModel.getFormData()); + List timeList = new ArrayList<>(); + TaskEntity task = flowModel.getTaskEntity(); + Map nodes = flowModel.getNodes(); + Map formData = flowModel.getFormData(); + Map> map = operatorList.stream().collect(Collectors.groupingBy(OperatorEntity::getNodeCode)); + for (String key : map.keySet()) { + model.setNodeCode(key); + NodeModel nodeModel = new NodeModel(); + NodeModel childNode = nodes.get(key); + NodeModel startNode = nodes.values().stream().filter(e -> e.getType().equals(NodeEnum.start.getType())).findFirst().orElse(new NodeModel()); + List operatorEntities = map.get(key); + for (OperatorEntity entity : operatorEntities) { + TimeConfig limit = childNode.getTimeLimitConfig(); + if (limit.getOn() == 2) { + limit = startNode.getTimeLimitConfig(); + } + nodeModel.setTimeLimitConfig(limit); + boolean isOn = limit.getOn() != 0; + if (isOn) { + TimeConfig notice = childNode.getNoticeConfig(); + FlowTimeModel noticeModel = new FlowTimeModel(); + noticeModel.setOperatorId(entity.getId()); + noticeModel.setTaskId(entity.getTaskId()); + noticeModel.setFlowModel(model); + if (notice.getOn() == 2) { + notice = startNode.getNoticeConfig(); + } + noticeModel.setOn(notice.getOn() != 0); + nodeModel.setNoticeConfig(notice); + FlowTimeModel overModel = new FlowTimeModel(); + overModel.setOperatorId(entity.getId()); + overModel.setTaskId(entity.getTaskId()); + overModel.setFlowModel(model); + + TimeConfig overTime = childNode.getOverTimeConfig(); + if (overTime.getOn() == 2) { + overTime = startNode.getOverTimeConfig(); + } + overModel.setOn(overTime.getOn() != 0); + nodeModel.setOverTimeConfig(overTime); + Date date = null; + if (limit.getNodeLimit() == 0) { + date = entity.getCreatorTime(); + } else if (limit.getNodeLimit() == 1) { + date = task.getStartTime(); + } else if (limit.getNodeLimit() == 2) { + Object data = formData.get(limit.getFormField()); + try { + date = new Date((Long) data); + } catch (Exception e) { + try { + date = DateUtil.parse(String.valueOf(data)); + } catch (Exception e1) { + } + } + } + if (date == null) { +// date = new Date(); + continue; + } + noticeModel.setStartDate(DateUtil.offsetMinute(date, test ? notice.getFirstOver() : notice.getFirstOver() * 60)); + noticeModel.setEndDate(DateUtil.offsetSecond(DateUtil.offsetMinute(date, test ? limit.getDuringDeal() : limit.getDuringDeal() * 60), 1)); + noticeModel.setChildNode(nodeModel); + noticeModel.setDuring(notice.getOverTimeDuring()); + timeList.add(noticeModel); + + overModel.setStartDate(DateUtil.offsetMinute(noticeModel.getEndDate(), test ? overTime.getFirstOver() : overTime.getFirstOver() * 60)); + overModel.setEndDate(null); + overModel.setChildNode(nodeModel); + overModel.setOverTime(true); + overModel.setDuring(overTime.getOverTimeDuring()); + timeList.add(overModel); + } + } + } + for (FlowTimeModel timeModel : timeList) { + Date date = new Date(); + if (timeModel.getEndDate() != null && timeModel.getEndDate().getTime() < date.getTime()) { + continue; + } + if (timeModel.getOn()) { + String uuid = RandomUtil.uuId(); + timeModel.setId(uuid); + JobDataMap jobDataMap = new JobDataMap(); + jobDataMap.putAll(JsonUtil.entityToMap(timeModel)); + FlowJobUtil.insertModel(timeModel, redisUtil); + TimeUtil.addJob(uuid, timeModel.getDuring(), FlowTime.class, jobDataMap, timeModel.getStartDate(), timeModel.getEndDate()); + } + } + } + + +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/TriggerUtil.java b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/TriggerUtil.java new file mode 100644 index 0000000..355edf5 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-biz/src/main/java/com/yunzhupaas/flowable/util/TriggerUtil.java @@ -0,0 +1,1748 @@ +package com.yunzhupaas.flowable.util; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.model.VisualDevJsonModel; +import com.yunzhupaas.base.model.flow.FlowFormDataModel; +import com.yunzhupaas.base.model.schedule.ScheduleNewCrForm; +import com.yunzhupaas.constant.DataInterfaceVarConst; +import com.yunzhupaas.constant.YunzhupaasConst; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.database.model.superQuery.SuperJsonModel; +import com.yunzhupaas.database.model.superQuery.SuperQueryJsonModel; +import com.yunzhupaas.emnus.TemplateEnum; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.*; +import com.yunzhupaas.flowable.enums.NodeEnum; +import com.yunzhupaas.flowable.enums.TaskStatusEnum; +import com.yunzhupaas.flowable.enums.TriggerRecordEnum; +import com.yunzhupaas.flowable.model.flowable.*; +import com.yunzhupaas.flowable.model.task.FlowMethod; +import com.yunzhupaas.flowable.model.task.FlowModel; +import com.yunzhupaas.flowable.model.templatejson.FlowFormModel; +import com.yunzhupaas.flowable.model.templatenode.nodejson.*; +import com.yunzhupaas.flowable.model.trigger.ExecuteModel; +import com.yunzhupaas.flowable.model.trigger.TriggerDataFo; +import com.yunzhupaas.flowable.model.trigger.TriggerDataModel; +import com.yunzhupaas.flowable.model.trigger.TriggerModel; +import com.yunzhupaas.flowable.model.util.FlowNature; +import com.yunzhupaas.flowable.model.util.TriggerHolder; +import com.yunzhupaas.flowable.model.util.TriggerRecordHolder; +import com.yunzhupaas.flowable.service.*; +import com.yunzhupaas.message.model.SentMessageForm; +import com.yunzhupaas.model.visualJson.FieLdsModel; +import com.yunzhupaas.onlinedev.model.PaginationModel; +import com.yunzhupaas.onlinedev.util.onlineDevUtil.OnlinePublicUtils; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.entity.UserRelationEntity; +import com.yunzhupaas.permission.model.authorize.AuthorizeConditionEnum; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/9 9:51 + */ +@Component +@Slf4j +public class TriggerUtil { + @Autowired + private ServiceUtil serviceUtil; + @Autowired + private TaskService taskService; + @Autowired + private TemplateService templateService; + @Autowired + private TemplateJsonService templateJsonService; + @Autowired + private TemplateNodeService templateNodeService; + @Autowired + private TriggerTaskService triggerTaskService; + @Autowired + private TriggerRecordService triggerRecordService; + @Autowired + private FlowAbleUrl flowAbleUrl; + @Autowired + private TaskUtil taskUtil; + @Autowired + private OperatorUtil operatorUtil; + @Autowired + private ConditionService conditionService; + + public List getTriggerDataModel(TriggerDataFo fo) { + String modelId = fo.getModelId(); + Integer trigger = fo.getTrigger(); + List dataId = fo.getDataId(); + List> dataMap = fo.getDataMap(); + List updateFields = fo.getUpdateFields(); + List res = new ArrayList<>(); + Map triggerMap = this.getTriggerNode(modelId, trigger); + if (CollectionUtil.isNotEmpty(triggerMap)) { + for (String key : triggerMap.keySet()) { + NodeModel nodeModel = triggerMap.get(key); + // 判断指定字段修改 + if (this.checkUpdateField(trigger, nodeModel, updateFields)) { + continue; + } + if (CollectionUtil.isNotEmpty(dataMap)) { + TriggerDataModel model = new TriggerDataModel(); + model.setData(JsonUtil.getObjectToString(dataMap)); + model.setFlowId(key); + res.add(model); + continue; + } + List> dataList = this.getDataList(nodeModel, new HashMap<>(), dataId); + if (!dataList.isEmpty()) { + TriggerDataModel model = new TriggerDataModel(); + model.setData(JsonUtil.getObjectToString(dataList)); + model.setFlowId(key); + res.add(model); + } + } + } + return res; + } + + // true表示 指定字段没有发生修改 + public boolean checkUpdateField(Integer trigger, NodeModel nodeModel, List updateFields) { + List updateFieldList = nodeModel.getUpdateFieldList(); + if (CollectionUtil.isEmpty(updateFieldList)) { + return false; + } + if (ObjectUtil.equals(nodeModel.getType(), NodeEnum.eventTrigger.getType()) && ObjectUtil.equals(trigger, 2)) { + // 任意字段发生修改,结果集合为空 说明指定字段(updateFieldList)不存在发生修改的字段(updateFields)中 + List list = updateFieldList.stream().filter(updateFields::contains).collect(Collectors.toList()); + return CollectionUtil.isEmpty(list); + } + return false; + } + + public Map getTriggerNode(String formId, Integer trigger) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + List typeList = ImmutableList.of(NodeEnum.eventTrigger.getType()); + queryWrapper.lambda().in(TemplateNodeEntity::getNodeType, typeList) + .eq(TemplateNodeEntity::getFormId, formId); + List nodeEntityList = templateNodeService.list(queryWrapper); + + List flowIds = new ArrayList<>(); + for (TemplateNodeEntity nodeEntity : nodeEntityList) { + NodeModel nodeModel = JsonUtil.getJsonToBean(nodeEntity.getNodeJson(), NodeModel.class); + if (ObjectUtil.equals(nodeModel.getTriggerFormEvent(), trigger)) { + flowIds.add(nodeEntity.getFlowId()); + } + } + flowIds = flowIds.stream().distinct().collect(Collectors.toList()); + + // 获取启用的任务流程id,用于过滤节点 + List filterFlowIds = new ArrayList<>(); + if (CollectionUtil.isNotEmpty(flowIds)) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().in(TemplateEntity::getFlowId, flowIds).eq(TemplateEntity::getType, 2); + List templateList = templateService.list(wrapper); + filterFlowIds = templateList.stream().map(TemplateEntity::getFlowId).collect(Collectors.toList()); + } + + // Map + Map map = new HashMap<>(); + for (String flowId : filterFlowIds) { + TemplateNodeEntity nodeEntity = nodeEntityList.stream() + .filter(e -> ObjectUtil.equals(e.getFlowId(), flowId)).findFirst().orElse(null); + if (null != nodeEntity) { + map.put(flowId, JsonUtil.getJsonToBean(nodeEntity.getNodeJson(), NodeModel.class)); + } + } + return map; + } + + // @DSTransactional + public void handleTimeTrigger(TriggerModel triggerModel) throws Exception { + String flowId = triggerModel.getId(); + UserInfo userInfo = triggerModel.getUserInfo(); + + List nodeEntityList = templateNodeService.getList(flowId); + TemplateNodeEntity timeTrigger = nodeEntityList.stream() + .filter(e -> ObjectUtil.equals(e.getNodeType(), NodeEnum.timeTrigger.getType())).findFirst() + .orElse(null); + if (null == timeTrigger) { + return; + } + // TemplateJsonEntity jsonEntity = templateJsonService.getById(flowId); + // NextOrPrevFo fo = new NextOrPrevFo(); + // fo.setDeploymentId(jsonEntity.getFlowableId()); + // fo.setTaskKey(timeTrigger.getNodeCode()); + // List next = flowAbleUrl.getNext(fo); + // if (CollectionUtil.isEmpty(next)) { + // return; + // } + // String nodeCode = next.get(0).getId(); + // TemplateNodeEntity nodeEntity = nodeEntityList.stream().filter(e -> + // ObjectUtil.equals(e.getNodeCode(), nodeCode)).findFirst().orElse(null); + // ExecuteModel executeModel = new ExecuteModel(); + // executeModel.setNodeModel(JsonUtil.getJsonToBean(nodeEntity, + // NodeModel.class)); + // executeModel.setUserInfo(userInfo); + // List> dataList = this.getData(executeModel); + + ExecuteModel model = new ExecuteModel(); + model.setFlowId(flowId); + model.setUserInfo(userInfo); + // model.setDataList(dataList); + this.execute(model); + } + + // @DSTransactional + public void handleTrigger(TriggerDataModel dataModel, UserInfo userInfo) throws Exception { + List> dataList = JsonUtil.getJsonToListMap(dataModel.getData()); + ExecuteModel model = new ExecuteModel(); + model.setFlowId(dataModel.getFlowId()); + model.setDataList(dataList); + model.setUserInfo(userInfo); + model.setParentId("0"); + this.execute(model); + } + + // 执行 + public void execute(ExecuteModel model) throws Exception { + String flowId = model.getFlowId(); + List> dataList = model.getDataList(); + String parentId = model.getParentId(); + // if (dataList.isEmpty()) { + // return; + // } + TemplateJsonEntity jsonEntity = templateJsonService.getById(flowId); + if (null != jsonEntity) { + TemplateEntity template = templateService.getById(jsonEntity.getTemplateId()); + if (template == null) { + return; + } + if (model.getTaskId() == null && !ObjectUtil.equals(template.getStatus(), 1)) { + return; + } + model.setJsonEntity(jsonEntity); + // 重试判断 + TriggerTaskEntity parentTask = triggerTaskService.getById(parentId); + boolean isParentId = parentTask != null; + + List nodeEntityList = templateNodeService.getList(flowId); + model.setNodeEntityList(nodeEntityList); + + // 保存触发任务 + TriggerTaskEntity entity = new TriggerTaskEntity(); + entity.setId(RandomUtil.uuId()); + entity.setFullName(template.getFullName()); + entity.setParentId(isParentId ? parentTask.getId() : parentId); + entity.setParentTime(isParentId ? parentTask.getStartTime() : null); + entity.setFlowId(flowId); + entity.setStartTime(new Date()); + entity.setData(JsonUtil.getObjectToString(dataList)); + entity.setStatus(TaskStatusEnum.RUNNING.getCode()); + entity.setTaskId(StringUtil.isNotEmpty(model.getTaskId()) ? model.getTaskId() : null); + entity.setNodeCode(StringUtil.isNotEmpty(model.getNodeCode()) ? model.getNodeCode() : null); + entity.setNodeId(StringUtil.isNotEmpty(model.getNodeId()) ? model.getNodeId() : null); + + TemplateNodeEntity start = nodeEntityList.stream() + .filter(e -> ObjectUtil.equals(e.getNodeType(), NodeEnum.start.getType())).findFirst() + .orElse(new TemplateNodeEntity()); + String deploymentId = jsonEntity.getFlowableId(); + + Map variables = this.getVariables(deploymentId, start.getNodeCode()); + String instanceId = model.getInstanceId(); + if (StringUtil.isEmpty(model.getInstanceId())) { + instanceId = flowAbleUrl.startInstance(deploymentId, variables); + entity.setInstanceId(instanceId); + model.setInstanceId(instanceId); + } + if (null != model.getIsAsync()) { + entity.setIsAsync(model.getIsAsync()); + } + entity.setEngineType(1); + + UserInfo userInfo = model.getUserInfo(); + if (null != userInfo) { + entity.setCreatorUserId(userInfo.getUserId()); + } + triggerTaskService.saveTriggerTask(entity); + model.setTriggerTask(entity); + if (StringUtil.isEmpty(entity.getTaskId())) { + triggerRecordService.createStart(entity.getId()); + } + + this.globalMsg(model, 1); + + List taskModelList = flowAbleUrl.getCurrentTask(instanceId); + // 触发节点 + List typeList = ImmutableList.of(NodeEnum.eventTrigger.getType(), NodeEnum.timeTrigger.getType(), + NodeEnum.noticeTrigger.getType(), NodeEnum.webhookTrigger.getType(), NodeEnum.trigger.getType()); + + String triggerKey = model.getTriggerKey(); + + TemplateNodeEntity triggerNode = null; + if (StringUtil.isNotEmpty(triggerKey)) { + triggerNode = nodeEntityList.stream().filter(e -> ObjectUtil.equals(e.getNodeCode(), triggerKey)) + .findFirst().orElse(null); + } else { + triggerNode = nodeEntityList.stream().filter(e -> typeList.contains(e.getNodeType())).findFirst() + .orElse(null); + } + if (null != triggerNode) { + for (Map map : dataList) { + map.put(DataInterfaceVarConst.FORM_ID, map.get(FlowFormConstant.ID)); + } + TriggerHolder.addData(triggerNode.getNodeCode(), dataList); + NodeModel nodeModel = JsonUtil.getJsonToBean(triggerNode.getNodeJson(), NodeModel.class); + + TemplateNodeEntity finalTriggerNode = triggerNode; + FlowableTaskModel taskModel = taskModelList.stream() + .filter(e -> ObjectUtil.equals(e.getTaskKey(), finalTriggerNode.getNodeCode())).findFirst() + .orElse(null); + if (null == taskModel) { + return; + } + triggerRecordService.create(entity, nodeModel, taskModel); + + Map variableMap = this.getVariables(deploymentId, taskModel.getTaskKey()); + this.complete(taskModel.getTaskId(), variableMap); + this.executeNode(model); + TriggerHolder.clear(); + } + } + } + + public Map getVariables(String deploymentId, String nodeCode) throws WorkFlowException { + OutgoingFlowsFo flowsFo = new OutgoingFlowsFo(); + flowsFo.setDeploymentId(deploymentId); + flowsFo.setTaskKey(nodeCode); + List outgoingFlows = flowAbleUrl.getOutgoingFlows(flowsFo); + Map variables = new HashMap<>(); + for (String line : outgoingFlows) { + variables.put(line, true); + } + return variables; + } + + public void complete(String id, Map variables) throws WorkFlowException { + CompleteFo fo = new CompleteFo(); + fo.setTaskId(id); + fo.setVariables(variables); + flowAbleUrl.complete(fo); + } + + public void executeNode(ExecuteModel model) throws WorkFlowException { + TemplateJsonEntity jsonEntity = model.getJsonEntity(); + String deploymentId = jsonEntity.getFlowableId(); + String instanceId = model.getInstanceId(); + List nodeEntityList = model.getNodeEntityList(); + TriggerTaskEntity triggerTask = model.getTriggerTask(); + + String groupId = model.getGroupId(); + String taskId = model.getTaskId(); + + FlowableInstanceModel instance = flowAbleUrl.getInstance(instanceId); + if (null != instance && null != instance.getEndTime()) { + triggerRecordService.createEnd(triggerTask.getId()); + triggerTask.setStatus(TaskStatusEnum.PASSED.getCode()); + triggerTaskService.updateTriggerTask(triggerTask); + return; + } + List taskModelList = flowAbleUrl.getCurrentTask(instanceId); + if (CollectionUtil.isNotEmpty(taskModelList)) { + // 统计执行节点的数量 + int count = 0; + int executedCount = 0; + + boolean multiple = taskModelList.size() > 1; + List recordList = triggerRecordService.getList(triggerTask.getId()); + List codeList = recordList.stream().map(TriggerRecordEntity::getNodeCode) + .collect(Collectors.toList()); + + List nodeTypes = ImmutableList.of(NodeEnum.getData.getType(), NodeEnum.addData.getType(), + NodeEnum.updateData.getType(), NodeEnum.deleteData.getType(), NodeEnum.dataInterface.getType(), + NodeEnum.message.getType(), NodeEnum.launchFlow.getType(), NodeEnum.schedule.getType()); + + for (FlowableTaskModel taskModel : taskModelList) { + // 任务流程的状态为终止,则结束 + TriggerTaskEntity entity = triggerTaskService.getById(triggerTask.getId()); + if (null != entity && ObjectUtil.equals(entity.getStatus(), TaskStatusEnum.CANCEL.getCode())) { + return; + } + if (codeList.contains(taskModel.getTaskKey())) { + executedCount++; + continue; + } + TemplateNodeEntity nodeEntity = nodeEntityList.stream() + .filter(e -> ObjectUtil.equals(e.getNodeCode(), taskModel.getTaskKey())).findFirst() + .orElse(null); + if (null != nodeEntity && nodeTypes.contains(nodeEntity.getNodeType())) { + NodeModel nodeModel = JsonUtil.getJsonToBean(nodeEntity.getNodeJson(), NodeModel.class); + if (StringUtil.isNotBlank(groupId)) { + if (!ObjectUtil.equals(nodeModel.getGroupId(), groupId)) { + continue; + } + count++; + } + model.setNodeModel(nodeModel); + model.setCurrentNodeId(taskModel.getTaskId()); + + TriggerRecordEntity record = new TriggerRecordEntity(); + record.setStartTime(new Date()); + record.setNodeId(taskModel.getTaskId()); + record.setNodeCode(taskModel.getTaskKey()); + record.setNodeName(nodeModel.getNodeName()); + record.setTriggerId(triggerTask.getId()); + if (StringUtil.isNotEmpty(triggerTask.getTaskId())) { + record.setTaskId(triggerTask.getTaskId()); + } + triggerRecordService.create(record); + + try { + switch (nodeEntity.getNodeType()) { + case "getData": + List> data = this.getData(model); + TriggerHolder.addData(nodeEntity.getNodeCode(), data); + break; + case "addData": + this.addData(model); + break; + case "updateData": + this.updateData(model); + break; + case "deleteData": + this.deleteData(model); + break; + case "message": + this.message(model); + break; + case "launchFlow": + this.launchFlow(model); + break; + case "dataInterface": + List> maps = this.dataInterface(model); + // TriggerHolder.addData(nodeEntity.getNodeCode(), maps); + break; + case "schedule": + this.createSchedule(model); + break; + } + } catch (Exception e) { + String msg = this.getErrMsg(e); + record.setErrorTip(msg); + record.setErrorData(JsonUtil.getObjectToString(model.getDataList())); + record.setStatus(TriggerRecordEnum.EXCEPTION.getCode()); + this.globalMsg(model, 2); + log.error("执行异常", e); + } + if (record.getStatus() == null) { + record.setStatus(TriggerRecordEnum.PASSED.getCode()); + } + record.setEndTime(new Date()); + triggerRecordService.updateById(record); + if (ObjectUtil.equals(record.getStatus(), TriggerRecordEnum.EXCEPTION.getCode())) { + if (!ObjectUtil.equals(triggerTask.getStatus(), TaskStatusEnum.EXCEPTION.getCode())) { + triggerTask.setStatus(TaskStatusEnum.EXCEPTION.getCode()); + triggerTaskService.updateTriggerTask(triggerTask); + model.setTriggerTask(triggerTask); + } + if (multiple) { + continue; + } else { + throw new WorkFlowException(record.getErrorTip()); + } + // triggerTask.setStatus(TaskStatusEnum.EXCEPTION.getCode()); + // TriggerRecordHolder.addData(triggerTask, record); + // throw new WorkFlowException(record.getErrorTip()); + } + if (StringUtil.isBlank(taskId)) { + Map variables = this.getVariables(deploymentId, taskModel.getTaskKey()); + this.complete(taskModel.getTaskId(), variables); + } else { + // 嵌入的任务流程,最后的执行节点不能通过,否则退回会有问题 + NextOrPrevFo fo = new NextOrPrevFo(); + fo.setDeploymentId(deploymentId); + fo.setTaskKey(taskModel.getTaskKey()); + List next = flowAbleUrl.getNext(fo); + if (CollectionUtil.isNotEmpty(next)) { + Map variables = this.getVariables(deploymentId, taskModel.getTaskKey()); + this.complete(taskModel.getTaskId(), variables); + } + } + } + } + if (executedCount == taskModelList.size()) { + return; + } + // 嵌入的任务流程可能存在多个,需要区分组别 + if (StringUtil.isNotBlank(groupId) && count == 0) { + return; + } + this.executeNode(model); + } + } + + private String getErrMsg(Exception e) { + ActionResult result = new ActionResult(); + result.setCode(400); + result.setMsg(e.getMessage()); + return JsonUtil.getObjectToString(result); + } + + // ----------------------------------------------------------------------------- + // 获取数据 + public List> getData(ExecuteModel model) throws WorkFlowException { + List> dataList = new ArrayList<>(); + + UserInfo userInfo = model.getUserInfo(); + NodeModel nodeModel = model.getNodeModel(); + Integer formType = nodeModel.getFormType(); + + switch (formType) { + case 1: + case 2: + List> list = this.getDataList(nodeModel, new HashMap<>(), new ArrayList<>()); + dataList.addAll(list); + break; + case 3: + List resultList = this.interfaceTemplateJson(nodeModel, new HashMap<>(), userInfo); + List errList = new ArrayList<>(); + for (ActionResult result : resultList) { + if (!ObjectUtil.equals(result.getCode(), 200)) { + errList.add(result.getMsg()); + continue; + } + if (result.getData() instanceof List) { + List> maps = this.castListMap(result.getData()); + if (CollectionUtil.isNotEmpty(maps)) { + dataList.addAll(maps); + } + } + } + if (CollectionUtil.isNotEmpty(errList)) { + throw new WorkFlowException(errList.get(0)); + } + break; + case 4: + List> data = this.getDataList(nodeModel, new HashMap<>(), new ArrayList<>(), true); + String subTable = nodeModel.getSubTable(); + for (Map map : data) { + Object obj = map.get(subTable); + if (null != obj) { + List> mapList = this.castListMap(obj); + List> resList = new ArrayList<>(); + for (Map objectMap : mapList) { + Map resMap = new HashMap<>(); + for (String key : objectMap.keySet()) { + if (ObjectUtil.equals(key, FlowFormConstant.ID)) { + resMap.put(key, objectMap.get(key)); + } else { + resMap.put(subTable + "-" + key, objectMap.get(key)); + } + } + resMap.put(FlowNature.SUB_TABLE, subTable); + resList.add(resMap); + } + dataList.addAll(resList); + } + } + break; + } + for (Map map : dataList) { + map.put(DataInterfaceVarConst.FORM_ID, map.get(FlowFormConstant.ID)); + } + return dataList; + } + + public List> castListMap(Object obj) { + return this.castListMap(obj, String.class, Object.class); + } + + // 对象转Map类型的List + public List> castListMap(Object obj, Class kClazz, Class vClazz) { + List> result = new ArrayList<>(); + if (obj instanceof List) { + for (Object o : (List) obj) { + if (o instanceof Map) { + Map map = new HashMap<>(16); + for (Map.Entry entry : ((Map) o).entrySet()) { + map.put(kClazz.cast(entry.getKey()), vClazz.cast(entry.getValue())); + } + result.add(map); + } + } + } + return result; + } + + // 接口获取数据 + public List interfaceTemplateJson(NodeModel nodeModel, Map data, UserInfo userInfo) + throws WorkFlowException { + String interId = nodeModel.getFormId(); + List templateJson = nodeModel.getTemplateJson(); + boolean isGetData = ObjectUtil.equals(nodeModel.getType(), NodeEnum.getData.getType()); + if (isGetData) { + templateJson = nodeModel.getInterfaceTemplateJson(); + } + Map parameterMap = new HashMap<>(); + Set msg = new HashSet<>(); + Map>> allData = TriggerHolder.getData(); + String dataSourceForm = nodeModel.getDataSourceForm(); + List> maps = allData.get(dataSourceForm); + List resultList = new ArrayList<>(); + if (StringUtil.isBlank(dataSourceForm)) { + maps = new ArrayList<>(); + maps.add(new HashMap<>()); + } + if (CollectionUtil.isNotEmpty(maps)) { + for (Map map : maps) { + Map tempMap = new HashMap<>(data); + tempMap.putAll(map); + for (IntegrateTplModel tpl : templateJson) { + String fieldId = tpl.getField(); + Boolean required = tpl.getRequired(); + String relationField = tpl.getRelationField(); + Map dataMap = new HashMap<>(tempMap); + String[] split = relationField.split("\\|"); + String dataValue; + if (isGetData) { + dataValue = this.getFieldValue(relationField, TemplateEnum.Field.getCode(), allData); + } else { + dataValue = this.getStrData(dataMap, split[0]); + } + if (AuthorizeConditionEnum.FORMID.getCondition().equals(relationField)) { + dataValue = String.valueOf(dataMap.get(FlowFormConstant.ID)); + } else if (AuthorizeConditionEnum.USER.getCondition().equals(relationField)) { + dataValue = userInfo.getUserId(); + } else if (AuthorizeConditionEnum.USERANDUNDER.getCondition().equals(relationField)) { + List subOrganizeIds = new ArrayList<>(); + List list = serviceUtil.getListByManagerId(userInfo.getUserId()).stream() + .map(UserEntity::getId).collect(Collectors.toList()); + subOrganizeIds.addAll(list); + subOrganizeIds.add(userInfo.getUserId()); + dataValue = subOrganizeIds.stream().collect(Collectors.joining(",")); + } else if (AuthorizeConditionEnum.ORGANIZE.getCondition().equals(relationField)) { + String orgId = userInfo.getOrganizeId(); + if (StringUtil.isNotEmpty(userInfo.getDepartmentId())) { + orgId = userInfo.getDepartmentId(); + } + dataValue = orgId; + } else if (AuthorizeConditionEnum.ORGANIZEANDUNDER.getCondition().equals(relationField)) { + String orgId = userInfo.getOrganizeId(); + if (StringUtil.isNotEmpty(userInfo.getDepartmentId())) { + orgId = userInfo.getDepartmentId(); + } + List underOrganizations = serviceUtil.getUnderOrg(orgId); + underOrganizations.add(orgId); + dataValue = underOrganizations.stream().collect(Collectors.joining(",")); + } else if (AuthorizeConditionEnum.BRANCHMANAGEORG.getCondition().equals(relationField)) { + List orgIds = serviceUtil.getOrgUserList(YunzhupaasConst.CURRENT_ORG_SUB); + dataValue = orgIds.stream().collect(Collectors.joining(",")); + } + String dataFieldValue = split[0]; + String dataJson = !ObjectUtil.equals(tpl.getSourceType(), TemplateEnum.Custom.getCode()) ? dataValue + : dataFieldValue; + String[] model = StringUtil.isNotEmpty(split[0]) ? split[0].split("-") : new String[] {}; + if (model.length > 1) { + Object dataList = dataMap.get(model[0]); + if (dataList instanceof List) { + List> listAll = (List>) dataList; + List dataListAll = new ArrayList<>(); + for (Map objectMap : listAll) { + dataListAll.add(objectMap.get(model[1] + FlowNature.FORM_FIELD_SUFFIX)); + } + if (required && ObjectUtil.isEmpty(dataListAll)) { + msg.add(fieldId); + } + dataJson = String.valueOf(dataListAll); + } else { + // 子表数据的处理 + String oneData = this.getStrData(dataMap, split[0]); + dataJson = oneData; + } + } + if (required && ObjectUtil.isEmpty(dataJson)) { + msg.add(fieldId); + } + parameterMap.put(fieldId, dataJson); + } + this.errRequiredMsg(msg); + ActionResult result = serviceUtil.infoToId(interId, userInfo.getTenantId(), parameterMap, + userInfo.getToken()); + if (!ObjectUtil.equals(result.getCode(), 200)) { + resultList.add(result); + return resultList; + } + if (result.getData() instanceof Map) { + Map dataMap = (Map) result.getData(); + Integer code = (Integer) dataMap.get("code"); + if (ObjectUtil.equals(code, 400)) { + ActionResult ar = new ActionResult<>(); + ar.setCode(code); + ar.setMsg((String) dataMap.get("msg")); + resultList.add(ar); + return resultList; + } + } + resultList.add(result); + } + } + return resultList; + } + + private void errRequiredMsg(Set msg) throws WorkFlowException { + if (!msg.isEmpty()) { + throw new WorkFlowException(new ArrayList(msg).get(0) + MsgCode.VS015.get()); + } + } + + public List> getDataList(NodeModel nodeModel, Map data, List dataId) { + return this.getDataList(nodeModel, data, dataId, false); + } + + private List> getDataList(NodeModel nodeModel, Map data, List dataId, + Boolean isSub) { + boolean idDelete = Objects.equals(nodeModel.getType(), "deleteData"); + String formId = nodeModel.getFormId(); + List ruleList = JsonUtil.getJsonToList(nodeModel.getRuleList(), SuperQueryJsonModel.class); + String ruleMatchLogic = nodeModel.getRuleMatchLogic(); + String flowId = ""; + boolean isFlow = false; + if (ObjectUtil.equals(nodeModel.getFormType(), 2)) { + isFlow = true; + flowId = formId; + TemplateEntity template = templateService.getById(flowId); + if (null != template) { + List nodeEntityList = templateNodeService.getList(template.getFlowId()); + TemplateNodeEntity startNode = nodeEntityList.stream() + .filter(e -> ObjectUtil.equals(e.getNodeType(), NodeEnum.start.getType())).findFirst() + .orElse(null); + if (null != startNode) { + formId = startNode.getFormId(); + } + } + } + VisualdevEntity visualdevEntity = serviceUtil.getReleaseInfo(formId); + + // 条件选择 + for (SuperQueryJsonModel superQueryJsonModel : ruleList) { + List groups = superQueryJsonModel.getGroups(); + for (FieLdsModel fieLdsModel : groups) { + if (ObjectUtil.equals(fieLdsModel.getFieldValueType(), "1")) { + // 字段名 | 节点编码 + if (null != fieLdsModel.getFieldValue()) { + String[] split = fieLdsModel.getFieldValue().split("\\|"); + if (split.length > 1) { + if (CollectionUtil.isNotEmpty(data)) { + String obj = this.getStrData(data, split[0]); + if (null != obj) { + fieLdsModel.setFieldValue(obj); + } + } else { + Map>> allData = TriggerHolder.getData(); + List> maps = allData.get(split[1]); + if (CollectionUtil.isNotEmpty(maps)) { + Map map = maps.get(0); + String oneData = this.getStrData(map, split[0]); + fieLdsModel.setFieldValue(oneData); + } + } + } + } + } else { + boolean valueType = "1".equals(fieLdsModel.getFieldValueType()); + String fieldValue = data.get(fieLdsModel.getFieldValue()) != null + ? String.valueOf(data.get(fieLdsModel.getFieldValue())) + : null; + if (DataInterfaceVarConst.FORM_ID.equals(fieLdsModel.getFieldValue())) { + fieldValue = String.valueOf(data.get(FlowFormConstant.ID)); + } + fieLdsModel.setFieldValue(valueType ? fieldValue : fieLdsModel.getFieldValue()); + } + } + } + + SuperJsonModel superJsonModel = new SuperJsonModel(); + superJsonModel.setConditionList(ruleList); + superJsonModel + .setMatchLogic(StringUtil.isNotEmpty(ruleMatchLogic) ? ruleMatchLogic : superJsonModel.getMatchLogic()); + PaginationModel paginationModel = new PaginationModel(); + paginationModel.setDataType("1"); + paginationModel.setSuperQueryJson(ruleList.size() > 0 ? JsonUtil.getObjectToString(superJsonModel) : ""); + String sidx = this.handleSort(nodeModel.getSortList()); + paginationModel.setSidx(sidx); + + VisualDevJsonModel visualJsonModel = OnlinePublicUtils.getVisualJsonModel(visualdevEntity); + List idAll = new ArrayList<>(); + List idList = new ArrayList<>(); + List> dataList = new ArrayList<>(); + try { + if (ruleList.size() > 0) { + visualJsonModel.setSuperQuery(superJsonModel); + } + if (isFlow) { + List flowVersionIds = templateJsonService.getListByTemplateIds(ImmutableList.of(flowId)) + .stream().map(TemplateJsonEntity::getId).collect(Collectors.toList()); + visualJsonModel.setFlowVersionIds(flowVersionIds); + visualJsonModel.setEnableFlow(flowVersionIds.size() > 0); + } + dataList.addAll(serviceUtil.getListWithTableList(visualJsonModel, paginationModel, UserProvider.getUser())); + if (isSub) { + return dataList; + } + idList.addAll(dataList.stream().map(t -> String.valueOf(t.get(FlowFormConstant.ID))) + .collect(Collectors.toList())); + } catch (Exception e) { + log.error("数据获取异常", e); + } + List intersection = idList.stream().filter(item -> dataId.contains(item)).collect(Collectors.toList()); + if (dataId.size() > 0) { + idAll.addAll(intersection); + } else { + idAll.addAll(idList); + } + List> result = new ArrayList<>(); + for (String id : idAll) { + List> collect = dataList.stream() + .filter(t -> Objects.equals(String.valueOf(t.get(FlowFormConstant.ID)), id)) + .collect(Collectors.toList()); + for (Map map : collect) { + boolean isAdd = true; + if (isFlow && !idDelete) { + TaskEntity infoSubmit = taskService.getInfoSubmit( + String.valueOf(map.get(FlowFormConstant.FLOWTASKID)), TaskEntity::getEndTime); + isAdd = infoSubmit != null && infoSubmit.getEndTime() != null; + } + if (isAdd) { + result.add(map); + } + } + } + return result; + } + + private String handleSort(List sortList) { + List list = new ArrayList<>(); + for (SortModel sortModel : sortList) { + String field = sortModel.getField(); + String sortType = sortModel.getSortType(); + if (!ObjectUtil.equals(sortType, "asc")) { + field = "-" + field; + } + list.add(field); + } + return String.join(",", list); + } + + public String getStrData(Map map, String key) { + Object oneData = taskUtil.getOneData(map, key); + if (null != oneData) { + if (oneData instanceof String) { + return oneData.toString(); + } else { + return JsonUtil.getObjectToString(oneData); + } + } + return null; + } + + // 数据接口 -------------------------- + public List> dataInterface(ExecuteModel model) throws WorkFlowException { + List> dataList = new ArrayList<>(); + NodeModel nodeModel = model.getNodeModel(); + List resultList = this.interfaceTemplateJson(nodeModel, new HashMap<>(), model.getUserInfo()); + List errList = new ArrayList<>(); + for (ActionResult result : resultList) { + if (!ObjectUtil.equals(result.getCode(), 200)) { + errList.add(result.getMsg()); + continue; + } + if (result.getData() instanceof List) { + List> maps = this.castListMap(result.getData()); + if (CollectionUtil.isNotEmpty(maps)) { + dataList.addAll(maps); + } + } + } + if (CollectionUtil.isNotEmpty(errList)) { + throw new WorkFlowException(errList.get(0)); + } + return dataList; + } + + // 消息 ----------------------------- + public void message(ExecuteModel model) throws WorkFlowException { + NodeModel nodeModel = model.getNodeModel(); + if (null != nodeModel) { + String msgId = nodeModel.getMsgId(); + List templateJson = nodeModel.getMsgTemplateJson(); + UserInfo userInfo = model.getUserInfo(); + Map>> allData = TriggerHolder.getData(); + Map parameterMap = this.templateJson(templateJson, allData, userInfo); + + List userIds = this.getUserList(nodeModel.getMsgUserIds(), nodeModel.getMsgUserIdsSourceType(), + allData); + this.message(msgId, userIds, parameterMap, userInfo); + } + } + + private void message(String msgId, List userIdList, Map parameterMap, UserInfo userInfo) + throws WorkFlowException { + List formList = new ArrayList<>(); + SentMessageForm sentMessageForm = new SentMessageForm(); + sentMessageForm.setUserInfo(userInfo); + sentMessageForm.setTemplateId(msgId); + sentMessageForm.setToUserIds(userIdList); + sentMessageForm.setParameterMap(parameterMap); + sentMessageForm.setType(3); + sentMessageForm.setContentMsg(new HashMap<>()); + sentMessageForm.setId(msgId); + sentMessageForm.setSysMessage(true); + formList.add(sentMessageForm); + List errList = serviceUtil.sendDelegateMsg(formList); + if (CollectionUtil.isNotEmpty(errList)) { + throw new WorkFlowException(errList.get(0)); + } + } + + private Map templateJson(List templateJson, + Map>> data, UserInfo userInfo) throws WorkFlowException { + Map parameterMap = new HashMap<>(); + Set msg = new HashSet<>(); + + for (IntegrateTplModel tplModel : templateJson) { + List paramJson = tplModel.getParamJson(); + for (IntegrateParamModel paramModel : paramJson) { + String field = paramModel.getField(); + String relationField = paramModel.getRelationField() == null ? "" : paramModel.getRelationField(); + if (ObjectUtil.equals(paramModel.getSourceType(), 2)) { + // 参数来源为自定义 + parameterMap.put(paramModel.getMsgTemplateId() + field, relationField); + continue; + } + Boolean required = paramModel.getRequired(); + String[] split = relationField.split("\\|"); + if (split.length < 2) { + continue; + } + List> mapList = data.get(split[1]); + Map map = CollectionUtil.isNotEmpty(mapList) ? mapList.get(0) : new HashMap<>(); + if (map == null) { + map = new HashMap<>(); + } + String dataValue = ""; + if (DataInterfaceVarConst.FORM_ID.equals(split[0])) { + dataValue = map.get(FlowFormConstant.ID) != null ? String.valueOf(map.get(FlowFormConstant.ID)) + : ""; + } else { + if (map.get(split[0]) != null) { + dataValue = String.valueOf(map.get(split[0])); + } + } + if (required && ObjectUtil.isEmpty(dataValue)) { + msg.add(field); + } + parameterMap.put(paramModel.getMsgTemplateId() + field, dataValue); + } + Map paramMap = ImmutableMap.of("@CreatorUserName", userInfo.getUserName(), "@SendTime", + DateUtil.getNow().substring(11)); + for (String key : paramMap.keySet()) { + parameterMap.put(tplModel.getId() + key, paramMap.get(key)); + } + } + this.errRequiredMsg(msg); + return parameterMap; + } + + // 新增数据 ------------------- + public void addData(ExecuteModel model) throws Exception { + NodeModel nodeModel = model.getNodeModel(); + if (null == nodeModel) { + return; + } + String formId = nodeModel.getFormId(); + List transferList = nodeModel.getTransferList(); + String dataSourceForm = nodeModel.getDataSourceForm(); + List ruleList = nodeModel.getRuleList(); + + VisualdevEntity visualdevEntity = serviceUtil.getReleaseInfo(formId); + if (StringUtil.isBlank(dataSourceForm)) { + // 数据源没有数据时,将字段设置中的自定义添加到数据中 + transferList = transferList.stream().filter(e -> ObjectUtil.equals(e.getSourceType(), 2)) + .collect(Collectors.toList()); + Map data = new HashMap<>(); + for (TransferModel transferModel : transferList) { + data.put(transferModel.getTargetField(), transferModel.getSourceValue()); + } + if (CollectionUtil.isNotEmpty(data)) { + serviceUtil.visualCreate(visualdevEntity, data); + } + return; + } + + // 数据源的数据 + Map>> allData = TriggerHolder.getData(); + List> maps = allData.get(dataSourceForm) != null ? allData.get(dataSourceForm) + : new ArrayList<>(); + + for (Map map : maps) { + List> dataList = new ArrayList<>(); + if (CollectionUtil.isNotEmpty(ruleList)) { + dataList = this.getDataList(nodeModel, map, new ArrayList<>()); + } + if (dataList.isEmpty()) { + List> list = this.handleAddData(map, transferList); + if (CollectionUtil.isNotEmpty(list)) { + for (Map saveData : list) { + serviceUtil.visualCreate(visualdevEntity, saveData); + } + } + } + } + } + + public List> handleAddData(Map data, List transferList) { + return this.handleData(data, new ArrayList<>(), transferList); + } + + // 将后缀为_yunzhupaasId的值赋给原字段 + public Map setData(Map data) { + data = CollectionUtil.isNotEmpty(data) ? data : new HashMap<>(); + for (String key : data.keySet()) { + Object o = data.get(key); + Object o1 = data.get(key + FlowNature.FORM_FIELD_SUFFIX); + if (o != null && o1 != null) { + data.put(key, o1); + } + if (o != null && key.toLowerCase().startsWith(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX)) { + // 处理子表 + if (o instanceof List) { + List> subList = (List>) o; + for (Map map : subList) { + this.setData(map); + } + } + } + } + return data; + } + + /** + * 字段设置 + * + * @param data 数据源 + * @param dataList 目标数据 + * @param transferList 传递规则 + */ + public List> handleData(Map data, List> dataList, + List transferList) { + boolean isAdd = CollectionUtil.isEmpty(dataList); + List> list = new ArrayList<>(dataList); + Map oldData = new HashMap<>(data != null ? data : new HashMap<>()); + + int max = 1; + for (TransferModel transferModel : transferList) { + Integer sourceType = transferModel.getSourceType(); + String sourceValue = transferModel.getSourceValue(); + String targetField = transferModel.getTargetField(); + if (ObjectUtil.equals(sourceType, TemplateEnum.Field.getCode())) { + String[] sourceFieldList = sourceValue.split("-"); + String[] targetFieldList = targetField.split("-"); + if (sourceFieldList.length > 1 && targetFieldList.length == 1) { + if (oldData.get(sourceFieldList[0]) instanceof List) { + List> parentList = (List>) oldData + .get(sourceFieldList[0]); + if (parentList.size() > max) { + max = parentList.size(); + } + } + } + } + } + + // 更新或新增的数据条数 小于 结果的最大数 + int size = dataList.size(); + if (size < max) { + for (int i = 0; i < max - size; i++) { + list.add(new HashMap<>()); + } + } + + if (isAdd) { + for (TransferModel transferModel : transferList) { + Integer sourceType = transferModel.getSourceType(); + String sourceValue = transferModel.getSourceValue(); + String targetField = transferModel.getTargetField(); + if (ObjectUtil.equals(sourceType, TemplateEnum.Field.getCode())) { + String[] sourceFieldList = sourceValue.split("-"); + String[] targetFieldList = targetField.split("-"); + if (sourceFieldList.length > 1) { + // 目标数据 大于 源数据 补差集 + if (targetFieldList.length > 1) { + int diff = 0; + // 源数据 + if (oldData.get(sourceFieldList[0]) instanceof List) { + List> sourceList = (List>) oldData + .get(sourceFieldList[0]); + diff = sourceList.size(); + } + for (Map map : list) { + if (map.get(targetFieldList[0]) instanceof List) { + List> targetList = (List>) map + .get(targetFieldList[0]); + int max1 = targetList.size() - diff; + for (int i = 0; i < max1; i++) { + targetList.add(new HashMap<>()); + } + } else { + List> childList = new ArrayList<>(); + for (int i = 0; i < diff; i++) { + childList.add(new HashMap<>()); + } + map.put(targetFieldList[0], childList); + } + } + } + } + } + } + } + + // for (Map map : list) { + // this.setData(map); + // } + + for (TransferModel transferModel : transferList) { + Integer sourceType = transferModel.getSourceType(); + String[] split = transferModel.getSourceValue().split("\\|"); + String sourceValue = split.length > 0 ? split[0] : transferModel.getSourceValue(); + + boolean isData = ObjectUtil.equals(sourceType, TemplateEnum.Custom.getCode()); + String[] sourceFieldList = isData ? new String[] { sourceValue } : sourceValue.split("-"); + + Object o = data.get(sourceValue + FlowNature.FORM_FIELD_SUFFIX) == null ? data.get(sourceValue) + : data.get(sourceValue + FlowNature.FORM_FIELD_SUFFIX); + String targetField = transferModel.getTargetField(); + String[] targetFieldList = targetField.split("-"); + Object childData = isData ? sourceValue + : DataInterfaceVarConst.FORM_ID.equals(sourceValue) + ? data.get(FlowFormConstant.ID) + : o; + + // 目标字段为子表 + if (targetFieldList.length > 1) { + if (sourceFieldList.length > 1) { + // 来源是子表、目标是子表 + if (oldData.get(sourceFieldList[0]) instanceof List) { + // 源数据 + List> parentList = (List>) oldData + .get(sourceFieldList[0]); + + for (int i = 0; i < list.size(); i++) { + Map targetMap = list.get(i); + List> childList = (List>) targetMap + .get(targetFieldList[0]); + if (CollectionUtil.isNotEmpty(childList)) { + for (int j = 0; j < parentList.size(); j++) { + Map sourceMap = parentList.get(j); + // this.setData(sourceMap); + if (childList.size() > j) { + Map map = childList.get(j); + Object oneData = taskUtil.getOneData(sourceMap, sourceFieldList[1]); + map.put(targetFieldList[1], oneData); + } + } + targetMap.put(targetFieldList[0], childList); + } + } + } else if (oldData.get(FlowNature.SUB_TABLE) != null) { + // this.setData(oldData); + for (Map map : list) { + Object obj = taskUtil.getOneData(oldData, split[0]); + if (map.get(targetFieldList[0]) instanceof List) { + List> childList = (List>) map + .get(targetFieldList[0]); + if (CollectionUtil.isEmpty(childList)) { + childList.add(new HashMap<>()); + } + for (Map objectMap : childList) { + objectMap.put(targetFieldList[1], obj); + } + map.put(targetFieldList[0], childList); + } + } + } + } else { + // 来源不是子表、目标是子表 + for (Map map : list) { + if (null == map.get(targetFieldList[0])) { + List> childList = new ArrayList<>(); + Map child = new HashMap<>(); + child.put(targetFieldList[1], childData); + childList.add(child); + map.put(targetFieldList[0], childList); + continue; + } + if (map.get(targetFieldList[0]) instanceof List) { + // 目标子表数据进行赋值 + List> childList = (List>) map + .get(targetFieldList[0]); + for (Map childMap : childList) { + childMap.put(targetFieldList[1], childData); + } + } + } + } + } else { + if (sourceFieldList.length > 1) { + // 来源是子表、目标不是子表 + if (oldData.get(sourceFieldList[0]) instanceof List) { + List> parentList = (List>) oldData + .get(sourceFieldList[0]); + // 新增时,一一对应;更新时,取子表第一条数据 + if (isAdd) { + for (int i = 0; i < parentList.size(); i++) { + if (list.size() > i) { + Map parentMap = parentList.get(i); + // this.setData(parentMap); + Map map = list.get(i); + Object oneData = taskUtil.getOneData(parentMap, sourceFieldList[1]); + map.put(targetField, oneData); + } + } + } else { + if (CollectionUtil.isNotEmpty(parentList)) { + Map parentMap = parentList.get(0); + // this.setData(parentMap); + for (Map map : list) { + Object oneData = taskUtil.getOneData(parentMap, sourceFieldList[1]); + map.put(targetField, oneData); + } + } + } + } else if (oldData.get(FlowNature.SUB_TABLE) != null) { + for (Map map : list) { + Object obj = taskUtil.getOneData(oldData, split[0]); + map.put(targetFieldList[0], obj); + } + } + } else { + // 来源不是子表、目标不是子表 + for (Map map : list) { + map.put(targetField, childData); + } + } + } + } + return list; + } + + // 更新数据 ------------------------------- + public void updateData(ExecuteModel model) throws Exception { + NodeModel nodeModel = model.getNodeModel(); + String formId = nodeModel.getFormId(); + VisualdevEntity visualdevEntity = serviceUtil.getReleaseInfo(formId); + String dataSourceForm = nodeModel.getDataSourceForm(); + List transferList = nodeModel.getTransferList(); + + // 没有可修改的数据时,向对应表单中新增一条数据 + boolean unFoundRule = nodeModel.getUnFoundRule(); + + Map>> allData = TriggerHolder.getData(); + List> maps = allData.get(dataSourceForm); + + // 数据源可以不选,不选则直接更新目标表单的某些数据 + if (StringUtil.isBlank(dataSourceForm)) { + transferList = transferList.stream().filter(e -> ObjectUtil.equals(e.getSourceType(), 2)) + .collect(Collectors.toList()); + Map map = new HashMap<>(); + for (TransferModel transferModel : transferList) { + map.put(transferModel.getTargetField(), transferModel.getSourceValue()); + } + maps = new ArrayList<>(); + maps.add(map); + } + + // 更新数据 + if (CollectionUtil.isNotEmpty(maps)) { + for (Map map : maps) { + List> tempList = this.getDataList(nodeModel, map, new ArrayList<>()); + for (Map tempMap : tempList) { + this.setData(tempMap); + } + List> list = this.handleData(map, tempList, transferList); + if (CollectionUtil.isNotEmpty(list)) { + for (Map data : list) { + if (null != data.get(FlowFormConstant.ID)) { + String id = data.get(FlowFormConstant.ID).toString(); + serviceUtil.visualUpdate(visualdevEntity, data, id); + } else { + if (unFoundRule) { + serviceUtil.visualCreate(visualdevEntity, data); + } + } + } + } + } + } + } + + // 删除数据 ------------------------------- + public void deleteData(ExecuteModel model) throws Exception { + NodeModel nodeModel = model.getNodeModel(); + Integer deleteType = nodeModel.getDeleteType(); + + String formId = nodeModel.getFormId(); + VisualdevEntity visualdevEntity = serviceUtil.getReleaseInfo(formId); + + // 直接删除表 + if (ObjectUtil.equals(deleteType, 0)) { + Integer tableType = nodeModel.getTableType(); + if (ObjectUtil.equals(tableType, 0)) { + // 删除主表 + List> dataList = this.getDataList(nodeModel, new HashMap<>(), new ArrayList<>()); + if (CollectionUtil.isNotEmpty(dataList)) { + serviceUtil.visualDelete(visualdevEntity, dataList); + } + } else { + // 删除子表 + // List> mapList = this.getDataList(nodeModel, new + // HashMap<>(), new ArrayList<>(), true); + FlowFormDataModel formDataModel = new FlowFormDataModel(); + formDataModel.setTableName(nodeModel.getSubTable()); + formDataModel.setFormId(nodeModel.getFormId()); + formDataModel.setRuleMatchLogic(nodeModel.getRuleMatchLogic()); + List ruleList = nodeModel.getRuleList(); + List> list = JsonUtil.getJsonToListMap(JsonUtil.getObjectToString(ruleList)); + formDataModel.setRuleList(list); + serviceUtil.deleteSubTable(formDataModel); + } + } else { + // 按节点删除 + Integer condition = nodeModel.getDeleteCondition(); + String dataSourceForm = nodeModel.getDataSourceForm(); + + Map>> allData = TriggerHolder.getData(); + List> maps = allData.get(dataSourceForm) != null ? allData.get(dataSourceForm) + : new ArrayList<>(); + + // 获取条件过滤的目标数据 + List> dataList = new ArrayList<>(); + for (Map map : maps) { + List> data = this.getDataList(nodeModel, map, new ArrayList<>()); + dataList.addAll(data); + } + + // 全部目标数据 + nodeModel.setRuleList(new ArrayList<>()); + List> targetData = this.getDataList(nodeModel, new HashMap<>(), new ArrayList<>()); + + List> intersection = new ArrayList<>(); + List> differentSet = new ArrayList<>(); + + if (ObjectUtil.equals(condition, 1)) { + // 存在,删除交集 + intersection = dataList; + if (CollectionUtil.isNotEmpty(intersection)) { + serviceUtil.visualDelete(visualdevEntity, intersection); + } + } else { + // 不存在,删除差集 + for (Map map : targetData) { + String sourceId = map.get(FlowFormConstant.ID).toString(); + for (Map data : dataList) { + String targetId = data.get(FlowFormConstant.ID).toString(); + if (!ObjectUtil.equals(sourceId, targetId)) { + differentSet.add(map); + } + } + } + if (CollectionUtil.isNotEmpty(differentSet)) { + serviceUtil.visualDelete(visualdevEntity, differentSet); + } + } + } + } + + // 发起审批 ------------------------------- + public void launchFlow(ExecuteModel model) throws Exception { + NodeModel nodeModel = model.getNodeModel(); + String flowId = nodeModel.getFlowId(); + List initiator = nodeModel.getInitiator(); + List transferList = nodeModel.getTransferList(); + + TemplateEntity template = templateService.getById(flowId); + if (null == template) { + return; + } + if (!ObjectUtil.equals(template.getStatus(), 1)) { + throw new WorkFlowException(MsgCode.WF140.get()); + } + TemplateJsonEntity jsonEntity = templateJsonService.getById(template.getFlowId()); + List nodeEntityList = templateNodeService.getList(jsonEntity.getId()); + Map nodes = new HashMap<>(); + for (TemplateNodeEntity node : nodeEntityList) { + nodes.put(node.getNodeCode(), JsonUtil.getJsonToBean(node.getNodeJson(), NodeModel.class)); + } + FlowMethod method = new FlowMethod(); + method.setDeploymentId(jsonEntity.getFlowableId()); + TemplateNodeEntity startNode = nodeEntityList.stream() + .filter(e -> StringUtil.equals(NodeEnum.start.getType(), e.getNodeType())).findFirst() + .orElse(new TemplateNodeEntity()); + if (taskUtil.checkBranch(startNode)) { + throw new WorkFlowException(MsgCode.WF147.get()); + } + method.setNodeCode(startNode.getNodeCode()); + method.setNodes(nodes); + method.setNodeEntityList(nodeEntityList); + Map resMap = conditionService.handleCondition(method); + // 判断条件、候选人 + try { + conditionService.checkCondition(resMap, nodes); + } catch (WorkFlowException e) { + throw new WorkFlowException(MsgCode.WF133.get()); + } + method.setNextSubFlow(true); + List nextApprover = taskUtil.getNextApprover(method); + if (!taskUtil.checkNextCandidates(nextApprover)) { + throw new WorkFlowException(MsgCode.WF134.get()); + } + + // 数据源数据 + String dataSourceForm = nodeModel.getDataSourceForm(); + Map>> allData = TriggerHolder.getData(); + List> maps = allData.get(dataSourceForm) != null ? allData.get(dataSourceForm) + : new ArrayList<>(); + + List> mapList = new ArrayList<>(); + + for (Map map : maps) { + List> list = this.handleAddData(map, transferList); + mapList.addAll(list); + } + // 不选数据源的处理 + if (StringUtil.isEmpty(dataSourceForm)) { + transferList = transferList.stream().filter(e -> ObjectUtil.equals(e.getSourceType(), 2)) + .collect(Collectors.toList()); + Map map = new HashMap<>(); + for (TransferModel transferModel : transferList) { + map.put(transferModel.getTargetField(), transferModel.getSourceValue()); + } + mapList = new ArrayList<>(); + mapList.add(map); + } + if (CollectionUtil.isEmpty(mapList)) { + return; + } + // 判断流程权限 + List userListAll = serviceUtil.getUserListAll(initiator); + FlowFormModel formIdAndFlowId = templateService.getFormIdAndFlowId(userListAll, flowId); + List userList = serviceUtil.getUserName(formIdAndFlowId.getUserId(), true); + if (CollectionUtil.isEmpty(userList)) { + throw new WorkFlowException(MsgCode.WF136.get()); + } + for (UserEntity user : userList) { + UserInfo userInfo = new UserInfo(); + userInfo.setUserId(user.getId()); + userInfo.setUserName(user.getRealName()); + + FlowModel flowModel = new FlowModel(); + flowModel.setUserInfo(userInfo); + flowModel.setFlowId(flowId); + flowModel.setStatus(1); + flowModel.setDeploymentId(jsonEntity.getFlowableId()); + flowModel.setNodeEntityList(nodeEntityList); + for (Map map : mapList) { + flowModel.setFormData(map); + if (taskUtil.checkNextError(flowModel, nextApprover, false, false) != 0) { + throw new WorkFlowException(MsgCode.WF135.get()); + } + taskService.batchSaveOrSubmit(flowModel); + TaskEntity taskEntity = flowModel.getTaskEntity(); + if (taskEntity.getRejectDataId() == null) { + operatorUtil.autoAudit(flowModel); + operatorUtil.handleEvent(); + } + } + } + } + + // 创建日程 -------------------------- + public void createSchedule(ExecuteModel model) throws WorkFlowException { + ScheduleNewCrForm fo = new ScheduleNewCrForm(); + NodeModel nodeModel = model.getNodeModel(); + + Map>> allData = TriggerHolder.getData(); + + List list = ImmutableList.of(nodeModel.getCreatorUserId()); + List creatorUserIds = this.getUserList(list, nodeModel.getCreatorUserIdSourceType(), allData); + if (CollectionUtil.isEmpty(creatorUserIds)) { + throw new WorkFlowException("找不到创建人"); + } + + Integer titleSourceType = nodeModel.getTitleSourceType(); + String title = this.getFieldValue(nodeModel.getTitle(), titleSourceType, allData); + fo.setTitle(title); + + String contents = this.getFieldValue(nodeModel.getContents(), nodeModel.getContentsSourceType(), allData); + fo.setContent(contents); + + String startDay = this.getFieldValue(nodeModel.getStartDay(), nodeModel.getStartDaySourceType(), allData); + if (StringUtil.isBlank(startDay)) { + throw new WorkFlowException("开始时间不能为空"); + } + fo.setStartDay(Long.valueOf(StringUtil.isBlank(startDay) ? new Date().getTime() + "" : startDay)); + fo.setStartTime(nodeModel.getStartTime()); + + String endDay = this.getFieldValue(nodeModel.getEndDay(), nodeModel.getEndDaySourceType(), allData); + + if (ObjectUtil.equals(nodeModel.getDuration(), -1) || ObjectUtil.equals(nodeModel.getAllDay(), 1)) { + if (StringUtil.isBlank(endDay)) { + throw new WorkFlowException("结束时间不能为空"); + } + } + fo.setEndDay(Long.valueOf(StringUtil.isBlank(endDay) ? new Date().getTime() + "" : endDay)); + fo.setEndTime(nodeModel.getEndTime()); + String category = nodeModel.getCategory(); + fo.setCategory(StringUtil.isNotEmpty(category) ? category : "391233231405462789"); + + fo.setDuration(nodeModel.getDuration()); + fo.setAllDay(nodeModel.getAllDay()); + fo.setFiles(nodeModel.getFiles()); + + List value = this.getUserList(nodeModel.getToUserIds(), nodeModel.getToUserIdsSourceType(), allData); + fo.setToUserIds(value); + fo.setColor(nodeModel.getColor()); + fo.setReminderType(nodeModel.getReminderType()); + fo.setReminderTime(nodeModel.getReminderTime()); + fo.setSend(nodeModel.getSend()); + fo.setSendName(nodeModel.getSendName()); + fo.setRepetition(nodeModel.getRepetition()); + fo.setRepeatTime(nodeModel.getRepeatTime()); + + for (String creatorUserId : creatorUserIds) { + ScheduleNewCrForm jsonToBean = JsonUtil.getJsonToBean(fo, ScheduleNewCrForm.class); + jsonToBean.setCreatorUserId(creatorUserId); + serviceUtil.createSchedule(jsonToBean); + } + } + + public String getFieldValue(String value, Integer sourceType, Map>> allData) { + if (ObjectUtil.equals(sourceType, TemplateEnum.Field.getCode())) { + String[] split = value.split("\\|"); + if (split.length > 1) { + List> data = allData.get(split[1]); + if (CollectionUtil.isNotEmpty(data)) { + Map map = data.get(0); + if (ObjectUtil.equals(split[0], DataInterfaceVarConst.FORM_ID)) { + value = map.get(FlowFormConstant.ID) + ""; + } else { + value = this.getStrData(map, split[0]); + } + return value; + } + } + return null; + } + return value; + } + + public List getUserList(List value, Integer sourceType, + Map>> allData) { + if (ObjectUtil.equals(sourceType, TemplateEnum.Field.getCode()) && CollectionUtil.isNotEmpty(value)) { + String str = value.get(0); + String[] split = str.split("\\|"); + if (split.length > 1) { + List> data = allData.get(split[1]); + if (null != data && !data.isEmpty()) { + Object obj = taskUtil.getOneData(data.get(0), split[0]); + if (obj instanceof String) { + String val = (String) obj; + val = val.split("--")[0]; + List paramList = new ArrayList<>(); + paramList.add(val); + List all = serviceUtil.getListByObjectIdAll(paramList); + List ids = all.stream().map(UserRelationEntity::getUserId).collect(Collectors.toList()); + ids.add(val); + ids = serviceUtil.getUserName(ids, true).stream().map(UserEntity::getId) + .collect(Collectors.toList()); + return ids; + } else if (obj instanceof List) { + List ids = new ArrayList<>(); + try { + // 处理二维数组的数据,如组织选择等 + List> list = (List) obj; + for (List item : list) { + ids.addAll(item); + } + } catch (Exception e) { + List list = (List) obj; + ids.addAll(list); + } + List userListAll = serviceUtil.getUserListAll(ids); + ids.addAll(userListAll); + List all = serviceUtil.getListByObjectIdAll(ids); + ids.addAll(all.stream().map(UserRelationEntity::getUserId).collect(Collectors.toList())); + ids = serviceUtil.getUserName(ids, true).stream().map(UserEntity::getId) + .collect(Collectors.toList()); + return ids; + } + } + } + return new ArrayList<>(); + } + return value == null ? new ArrayList<>() : serviceUtil.getUserListAll(value); + } + + // webhook触发-------------------------------------------- + // @DSTransactional + public void handleWebhookTrigger(String id, String tenantId, Map body) throws Exception { + TemplateJsonEntity jsonEntity = templateJsonService.getById(id); + if (null == jsonEntity) { + throw new WorkFlowException(MsgCode.VS016.get()); + } + if (!ObjectUtil.equals(jsonEntity.getState(), 1)) { + throw new WorkFlowException("版本未启用"); + } + List nodeEntityList = templateNodeService.getList(jsonEntity.getId()); + TemplateNodeEntity nodeEntity = nodeEntityList.stream() + .filter(e -> ObjectUtil.equals(e.getNodeType(), NodeEnum.webhookTrigger.getType())).findFirst() + .orElse(null); + if (null != nodeEntity) { + NodeModel nodeModel = JsonUtil.getJsonToBean(nodeEntity.getNodeJson(), NodeModel.class); + List> dataList = new ArrayList<>(); + Map map = new HashMap<>(); + List formFieldList = nodeModel.getFormFieldList(); + for (FieLdsModel fieLdsModel : formFieldList) { + map.put(fieLdsModel.getId(), body.get(fieLdsModel.getId())); + } + dataList.add(map); + String token = AuthUtil.loginTempUser(jsonEntity.getCreatorUserId(), tenantId); + UserInfo userInfo = UserProvider.getUser(token); + UserProvider.setLoginUser(userInfo); + UserProvider.setLocalLoginUser(userInfo); + ExecuteModel model = new ExecuteModel(); + model.setFlowId(jsonEntity.getId()); + model.setDataList(dataList); + model.setUserInfo(userInfo); + this.execute(model); + } + } + + // 通知触发--------------------------------------------------------- + + // @DSTransactional + public void msgTrigger(TemplateNodeEntity triggerNode, UserInfo userInfo) throws Exception { + String flowId = triggerNode.getFlowId(); + ExecuteModel model = new ExecuteModel(); + model.setFlowId(flowId); + model.setUserInfo(userInfo); + this.execute(model); + } + + // 获取触发节点之后的获取数据节点的数据 + public List> getDataListAfterTriggerNode(String flowId, String triggerNode, + List nodeEntityList, UserInfo userInfo) throws WorkFlowException { + TemplateJsonEntity jsonEntity = templateJsonService.getById(flowId); + NextOrPrevFo fo = new NextOrPrevFo(); + fo.setDeploymentId(jsonEntity.getFlowableId()); + fo.setTaskKey(triggerNode); + List next = flowAbleUrl.getNext(fo); + if (CollectionUtil.isEmpty(next)) { + return new ArrayList<>(); + } + String nodeCode = next.get(0).getId(); + TemplateNodeEntity nodeEntity = nodeEntityList.stream() + .filter(e -> ObjectUtil.equals(e.getNodeCode(), nodeCode)).findFirst().orElse(null); + ExecuteModel executeModel = new ExecuteModel(); + executeModel.setNodeModel(JsonUtil.getJsonToBean(nodeEntity, NodeModel.class)); + executeModel.setUserInfo(userInfo); + List> dataList = this.getData(executeModel); + return dataList; + } + + // 全局属性配置的消息通知,mark 1.开始执行 2.执行失败 + public void globalMsg(ExecuteModel model, Integer mark) throws WorkFlowException { + TriggerTaskEntity triggerTask = model.getTriggerTask(); + UserInfo userInfo = model.getUserInfo(); + List nodeEntityList = model.getNodeEntityList(); + TemplateNodeEntity nodeEntity = nodeEntityList.stream() + .filter(e -> ObjectUtil.equals(e.getNodeType(), NodeEnum.global.getType())).findFirst().orElse(null); + if (null == nodeEntity) { + return; + } + NodeModel global = JsonUtil.getJsonToBean(nodeEntity.getNodeJson(), NodeModel.class); + + String code = ObjectUtil.equals(mark, 1) ? "PZXTJC002" : "PZXTJC001"; + MsgConfig msgConfig; + if (ObjectUtil.equals(mark, 1)) { + msgConfig = global.getStartMsgConfig(); + } else { + msgConfig = global.getFailMsgConfig(); + } + Integer on = msgConfig.getOn(); + boolean acquiesce = ObjectUtil.equals(on, 3); + String msgId = ObjectUtil.equals(on, 0) ? "" : acquiesce ? code : msgConfig.getMsgId(); + + List msgUserType = global.getMsgUserType(); + List msgUserIds = global.getMsgUserIds(); + + Set userIdList = new HashSet<>(); + for (String type : msgUserType) { + switch (type) { + case "1": + userIdList.add(triggerTask.getCreatorUserId()); + break; + case "2": + List adminList = serviceUtil.getAdminList().stream().map(UserEntity::getId) + .collect(Collectors.toList()); + userIdList.addAll(adminList); + break; + case "3": + List userList = serviceUtil.getUserListAll(msgUserIds); + userIdList.addAll(userList); + break; + } + } + + Map dataMap = new HashMap<>(); + dataMap.put("@Title", triggerTask.getFullName()); + dataMap.put("@CreatorUserName", ""); + + List templateJson = msgConfig.getTemplateJson(); + List jsonToList = JsonUtil.getJsonToList(templateJson, IntegrateTplModel.class); + + if (StringUtil.isNotEmpty(msgId) && CollectionUtil.isNotEmpty(userIdList)) { + Map map = acquiesce ? dataMap : this.templateJson(jsonToList, new HashMap<>(), userInfo); + try { + this.message(msgId, new ArrayList<>(userIdList), map, userInfo); + } catch (WorkFlowException e) { + e.printStackTrace(); + } + } + } + + public void createErrorRecord() { + List taskList = TriggerRecordHolder.getTaskList(); + for (TriggerTaskEntity triggerTask : taskList) { + triggerTaskService.save(triggerTask); + } + List recordList = TriggerRecordHolder.getRecordList(); + for (TriggerRecordEntity record : recordList) { + triggerRecordService.create(record); + } + TriggerRecordHolder.clear(); + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-controller/pom.xml b/yunzhupaas-flowable/yunzhupaas-flowable-controller/pom.xml new file mode 100644 index 0000000..44ac031 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-controller/pom.xml @@ -0,0 +1,27 @@ + + + + yunzhupaas-flowable + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-flowable-controller + + + + + com.yunzhupaas + yunzhupaas-flowable-biz + ${project.version} + + + com.yunzhupaas + yunzhupaas-exception + ${project.version} + + + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-controller/src/main/java/com/yunzhupaas/flowable/controller/CommentController.java b/yunzhupaas-flowable/yunzhupaas-flowable-controller/src/main/java/com/yunzhupaas/flowable/controller/CommentController.java new file mode 100644 index 0000000..3c37bb6 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-controller/src/main/java/com/yunzhupaas/flowable/controller/CommentController.java @@ -0,0 +1,163 @@ +package com.yunzhupaas.flowable.controller; + +import cn.hutool.core.util.ObjectUtil; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.CommentEntity; +import com.yunzhupaas.flowable.entity.TaskEntity; +import com.yunzhupaas.flowable.entity.TemplateNodeEntity; +import com.yunzhupaas.flowable.enums.NodeEnum; +import com.yunzhupaas.flowable.model.comment.CommentCrForm; +import com.yunzhupaas.flowable.model.comment.CommentListVO; +import com.yunzhupaas.flowable.model.comment.CommentPagination; +import com.yunzhupaas.flowable.model.templatenode.nodejson.NodeModel; +import com.yunzhupaas.flowable.service.CommentService; +import com.yunzhupaas.flowable.service.TaskService; +import com.yunzhupaas.flowable.service.TemplateNodeService; +import com.yunzhupaas.flowable.util.ServiceUtil; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UploaderUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.StringJoiner; +import java.util.stream.Collectors; + +/** + * 流程评论 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Tag(name = "流程评论", description = "Comment") +@RestController +@RequestMapping("/api/workflow/comment") +public class CommentController extends SuperController { + + @Autowired + private ServiceUtil serviceUtil; + + @Autowired + private CommentService commentService; + @Autowired + private TaskService taskService; + @Autowired + private TemplateNodeService templateNodeService; + + /** + * 获取流程评论列表 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "获取流程评论列表") + @GetMapping + public ActionResult> list(CommentPagination pagination) { + List list = commentService.getlist(pagination); + List replyId = list.stream().filter(t -> StringUtil.isNotEmpty(t.getReplyId())).map(CommentEntity::getReplyId).collect(Collectors.toList()); + List replyList = commentService.getlist(replyId); + List listVO = JsonUtil.getJsonToList(list, CommentListVO.class); + List userId = list.stream().map(t -> t.getCreatorUserId()).collect(Collectors.toList()); + userId.addAll(replyList.stream().map(CommentEntity::getCreatorUserId).collect(Collectors.toList())); + UserInfo userInfo = UserProvider.getUser(); + List userName = serviceUtil.getUserName(userId); + for (CommentListVO commentModel : listVO) { + UserEntity userEntity = userName.stream().filter(t -> t.getId().equals(commentModel.getCreatorUserId())).findFirst().orElse(null); + if (commentModel.getCreatorUserId().equals(userInfo.getUserId()) && !"1".equals(String.valueOf(commentModel.getDeleteShow()))) { + commentModel.setIsDel(1); //1-删除按钮显示 + } else if ("1".equals(String.valueOf(commentModel.getDeleteShow()))) { + commentModel.setIsDel(2); //1-删除按钮显示 + commentModel.setText("该评论已被删除"); + } else { + commentModel.setIsDel(0); + } + commentModel.setCreatorUser(userEntity != null ? userEntity.getRealName() + "/" + userEntity.getAccount() : ""); + commentModel.setCreatorUserHeadIcon(userEntity != null ? UploaderUtil.uploaderImg(userEntity.getHeadIcon()) : commentModel.getCreatorUserHeadIcon()); + List collect = replyList.stream().filter(t -> t.getId().equals(commentModel.getReplyId())).collect(Collectors.toList()); + StringJoiner name = new StringJoiner(","); + StringJoiner text = new StringJoiner(","); + for (CommentEntity replyEntity : collect) { + if (null != replyEntity) { + UserEntity user = userName.stream().filter(t -> t.getId().equals(replyEntity.getCreatorUserId())).findFirst().orElse(null); + if (user != null) { + name.add(user.getRealName() + "/" + user.getAccount()); + } + String resText = ("1".equals(String.valueOf(replyEntity.getDeleteShow())) || "1".equals(String.valueOf(replyEntity.getDeleteMark()))) ? "该评论已被删除" : replyEntity.getText(); + text.add(resText); + } + } + commentModel.setReplyText(text.toString()); + commentModel.setReplyUser(name.toString()); + CommentEntity entity = list.stream().filter(e -> ObjectUtil.equals(e.getId(), commentModel.getId())).findFirst().orElse(null); + if (null != entity) { + commentModel.setFile(entity.getFiles()); + } + } + PaginationVO vo = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(listVO, vo); + } + + /** + * 新建流程评论 + * + * @param commentForm 流程评论模型 + * @return + */ + @Operation(summary = "新建流程评论") + @PostMapping + @Parameters({ + @Parameter(name = "commentForm", description = "流程评论模型", required = true), + }) + public ActionResult create(@RequestBody @Valid CommentCrForm commentForm) throws WorkFlowException { + CommentEntity entity = JsonUtil.getJsonToBean(commentForm, CommentEntity.class); + entity.setFiles(commentForm.getFile()); + commentService.create(entity); + return ActionResult.success(MsgCode.SU002.get()); + } + + /** + * 删除流程评论 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除流程评论") + @DeleteMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult delete(@PathVariable("id") String id) { + CommentEntity entity = commentService.getInfo(id); + if (entity.getCreatorUserId().equals(UserProvider.getUser().getUserId())) { + boolean delComment = false; + TaskEntity task = taskService.getInfoSubmit(entity.getTaskId(), TaskEntity::getId, TaskEntity::getFlowId); + if (task != null) { + TemplateNodeEntity nodeEntity = templateNodeService.getList(task.getFlowId()).stream().filter(e -> StringUtil.equals(NodeEnum.global.getType(), e.getNodeType())).findFirst().orElse(null); + if (nodeEntity != null) { + NodeModel nodeModel = JsonUtil.getJsonToBean(nodeEntity.getNodeJson(), NodeModel.class); + delComment = nodeModel.getHasCommentDeletedTips(); + } + } + commentService.delete(entity, delComment); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.success(MsgCode.FA003.get()); + } + +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-controller/src/main/java/com/yunzhupaas/flowable/controller/DelegateController.java b/yunzhupaas-flowable/yunzhupaas-flowable-controller/src/main/java/com/yunzhupaas/flowable/controller/DelegateController.java new file mode 100644 index 0000000..ef2dcaa --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-controller/src/main/java/com/yunzhupaas/flowable/controller/DelegateController.java @@ -0,0 +1,321 @@ +package com.yunzhupaas.flowable.controller; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import com.google.common.collect.ImmutableList; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.DelegateEntity; +import com.yunzhupaas.flowable.entity.DelegateInfoEntity; +import com.yunzhupaas.flowable.model.candidates.CandidateUserVo; +import com.yunzhupaas.flowable.model.delegate.*; +import com.yunzhupaas.flowable.model.template.TemplatePageLisVO; +import com.yunzhupaas.flowable.model.template.TemplatePagination; +import com.yunzhupaas.flowable.service.DelegateInfoService; +import com.yunzhupaas.flowable.service.DelegateService; +import com.yunzhupaas.flowable.util.ServiceUtil; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.JsonUtilEx; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/13 17:27 + */ +@Tag(name = "流程委托", description = "DelegateController") +@RestController +@RequestMapping("/api/workflow/delegate") +public class DelegateController extends SuperController { + @Autowired + private DelegateService delegateService; + @Autowired + private ServiceUtil serviceUtil; + @Autowired + private DelegateInfoService delegateInfoService; + + /** + * 获取流程委托列表 + * + * @param pagination 分页参数 + */ + @Operation(summary = "获取流程委托列表") + @GetMapping + public ActionResult list(DelegatePagination pagination) { + List voList; + if (ObjectUtil.equals(pagination.getType(), 2) || ObjectUtil.equals(pagination.getType(), 4)) { + voList = delegateInfoService.getList(pagination); + } else { + voList = delegateService.getList(pagination); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(voList, paginationVO); + } + + /** + * 委托信息列表 + * + * @param delegateId 委托主键 + */ + @Operation(summary = "委托信息列表") + @GetMapping("/Info/{delegateId}") + public ActionResult getDelegateInfo(@PathVariable("delegateId") String delegateId) { + List list = delegateInfoService.getList(delegateId); + return ActionResult.success(JsonUtil.getJsonToList(list, DelegateListVO.class)); + } + + /** + * 获取流程委托信息 + * + * @param id 主键 + */ + @Operation(summary = "获取流程委托信息") + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) throws WorkFlowException { + DelegateEntity entity = delegateService.getInfo(id); + if (null == entity) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + DelegateInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, DelegateInfoVO.class); + List infoList = delegateInfoService.getList(entity.getId()); + if (CollectionUtil.isNotEmpty(infoList)) { + List toUserNameList = infoList.stream().map(DelegateInfoEntity::getToUserName) + .collect(Collectors.toList()); + vo.setToUserName(String.join(",", toUserNameList)); + List toUserIdList = infoList.stream().map(DelegateInfoEntity::getToUserId) + .collect(Collectors.toList()); + vo.setToUserId(toUserIdList); + } + return ActionResult.success(vo); + } + + /** + * 新建流程委托 + * + * @param fo 参数 + */ + @Operation(summary = "新建流程委托") + @PostMapping + public ActionResult create(@RequestBody @Valid DelegateCrForm fo) { + // 超管和管理员不能新增委托/代理(即:只有普通用户身份才能新建委托/代理,提示:“管理员不能新建委托/代理”) + if (!serviceUtil.isCommonUser(UserProvider.getLoginUserId())) { + return ActionResult.fail(MsgCode.WF130.get()); + } + if (StringUtil.isBlank(fo.getUserId())) { + UserInfo userInfo = UserProvider.getUser(); + fo.setUserId(userInfo.getUserId()); + fo.setUserName(userInfo.getUserName() + "/" + userInfo.getUserAccount()); + } + boolean isDelegate = ObjectUtil.equals(fo.getType(), "0"); + if (fo.getToUserId().contains(fo.getUserId())) { + return ActionResult.fail(isDelegate ? MsgCode.WF017.get() : MsgCode.WF137.get()); + } + // 受托人/代理人不能选择admin和本人 + List toUserList = fo.getToUserId(); + String admin = serviceUtil.getAdmin(); + for (String toUser : toUserList) { + if (ObjectUtil.equals(toUser, admin)) { + return ActionResult.fail(MsgCode.WF131.get()); + } + } + if (this.alreadyDelegate(fo, null)) { + return ActionResult.fail(isDelegate ? MsgCode.WF018.get() : MsgCode.WF144.get()); + } + DelegateCrForm reverse = new DelegateCrForm(); + BeanUtils.copyProperties(fo, reverse); + reverse.setUserIdList(fo.getToUserId()); + reverse.setToUserId(ImmutableList.of(fo.getUserId())); + if (this.alreadyDelegate(reverse, null)) { + return ActionResult.fail(isDelegate ? MsgCode.WF019.get() : MsgCode.WF145.get()); + } + delegateService.create(fo); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 更新流程委托 + * + * @param id 主键 + * @param fo 参数 + */ + @Operation(summary = "更新流程委托") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid DelegateUpForm fo) + throws WorkFlowException { + DelegateEntity entity = delegateService.getInfo(id); + if (null == entity) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + fo.setUserId(entity.getUserId()); + boolean isDelegate = ObjectUtil.equals(fo.getType(), "0"); + if (fo.getToUserId().contains(fo.getUserId())) { + return ActionResult.fail(isDelegate ? MsgCode.WF017.get() : MsgCode.WF137.get()); + } + if (this.alreadyDelegate(fo, id)) { + return ActionResult.fail(isDelegate ? MsgCode.WF018.get() : MsgCode.WF144.get()); + } + // 判断是否有人接受 + List infoList = delegateInfoService.getList(id); + if (CollectionUtil.isNotEmpty(infoList)) { + DelegateInfoEntity delegateInfoEntity = infoList.stream().filter(e -> ObjectUtil.equals(e.getStatus(), 1)) + .findFirst().orElse(null); + if (null != delegateInfoEntity) { + return ActionResult.fail(MsgCode.WF132.get()); + } + } + DelegateCrForm reverse = new DelegateCrForm(); + BeanUtils.copyProperties(fo, reverse); + reverse.setUserIdList(fo.getToUserId()); + reverse.setToUserId(ImmutableList.of(fo.getUserId())); + if (this.alreadyDelegate(reverse, id)) { + return ActionResult.fail(isDelegate ? MsgCode.WF019.get() : MsgCode.WF145.get()); + } + if (delegateService.update(entity, fo)) { + return ActionResult.success(MsgCode.SU004.get()); + } + return ActionResult.success(MsgCode.FA002.get()); + } + + // 判断是否已有委托 + private boolean alreadyDelegate(DelegateCrForm form, String id) { + List delegateEntities = new ArrayList<>(); + if (CollectionUtil.isNotEmpty(form.getUserIdList())) { + for (String userId : form.getUserIdList()) { + form.setUserId(userId); + List list = delegateService.selectSameParamAboutDelaget(form); + delegateEntities.addAll(list); + } + } else { + delegateEntities = delegateService.selectSameParamAboutDelaget(form); + } + for (DelegateEntity delegate : delegateEntities) { + if (delegate.getId().equals(id)) { + continue; + } + // 时间交叉 + if ((form.getStartTime() <= delegate.getStartTime().getTime() + && form.getEndTime() >= delegate.getStartTime().getTime()) || + (form.getStartTime() >= delegate.getStartTime().getTime() + && form.getStartTime() <= delegate.getEndTime().getTime())) { + if (StringUtil.isEmpty(form.getFlowId())) { + return true; + } else { + if (StringUtil.isEmpty(delegate.getFlowId())) { + return true; + } else { + List split = Arrays.asList(delegate.getFlowId().split(",")); + List split1 = Arrays.asList(form.getFlowId().split(",")); + for (String srt : split) { + if (split1.contains(srt)) { + return true; + } + } + } + } + } + } + return false; + } + + /** + * 结束委托 + * + * @param id 主键 + */ + @Operation(summary = "结束委托") + @PutMapping("/Stop/{id}") + public ActionResult stop(@PathVariable("id") String id) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); + calendar.add(Calendar.SECOND, -1); + Date date = calendar.getTime(); + DelegateEntity entity = delegateService.getInfo(id); + if (null != entity) { + entity.setStartTime(date); + entity.setEndTime(date); + delegateService.updateStop(id, entity); + return ActionResult.success(MsgCode.SU008.get()); + } + return ActionResult.fail(MsgCode.FA002.get()); + } + + /** + * 删除流程委托 + * + * @param id 主键 + */ + @Operation(summary = "删除流程委托") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + DelegateEntity entity = delegateService.getInfo(id); + if (null != entity) { + delegateService.delete(entity); + delegateInfoService.delete(entity.getId()); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + /** + * 被委托发起 + * 根据被委托人查询可发起的流程列表 + * + * @param pagination 分页参数 + */ + @Operation(summary = "被委托发起") + @GetMapping("/GetFlow") + public ActionResult getFlow(TemplatePagination pagination) { + List flows = delegateService.getFlow(pagination); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + List voList = JsonUtil.getJsonToList(flows, TemplatePageLisVO.class); + return ActionResult.page(voList, paginationVO); + } + + /** + * 获取委托人 + * 根据被委托人查询可发起的流程列表 + */ + @Operation(summary = "获取委托人") + @GetMapping("/UserList") + public ActionResult getUserListByFlowId(@RequestParam("templateId") String templateId) throws WorkFlowException { + ListVO userList = delegateService.getUserList(templateId); + return ActionResult.success(userList); + } + + /** + * 确认 + * + * @param id 委托信息主键 + * @param type 类型,1.接受 2.拒绝 + */ + @Operation(summary = "确认") + @PostMapping("/Notarize/{id}") + public ActionResult accept(@PathVariable("id") String id, @RequestParam("type") Integer type) + throws WorkFlowException { + DelegateInfoEntity delegateInfo = delegateInfoService.getById(id == null ? "" : id); + if (null == delegateInfo) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + delegateInfo.setStatus(type); + delegateService.notarize(delegateInfo); + return ActionResult.success(MsgCode.SU004.get()); + } + +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-controller/src/main/java/com/yunzhupaas/flowable/controller/OperatorController.java b/yunzhupaas-flowable/yunzhupaas-flowable-controller/src/main/java/com/yunzhupaas/flowable/controller/OperatorController.java new file mode 100644 index 0000000..029d712 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-controller/src/main/java/com/yunzhupaas/flowable/controller/OperatorController.java @@ -0,0 +1,521 @@ +package com.yunzhupaas.flowable.controller; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import com.google.common.collect.ImmutableList; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.OperatorEntity; +import com.yunzhupaas.flowable.entity.RecordEntity; +import com.yunzhupaas.flowable.entity.TaskEntity; +import com.yunzhupaas.flowable.enums.OperatorStateEnum; +import com.yunzhupaas.flowable.enums.TaskStatusEnum; +import com.yunzhupaas.flowable.model.candidates.CandidateCheckFo; +import com.yunzhupaas.flowable.model.candidates.CandidateCheckVo; +import com.yunzhupaas.flowable.model.candidates.CandidateUserFo; +import com.yunzhupaas.flowable.model.candidates.CandidateUserVo; +import com.yunzhupaas.flowable.model.operator.FlowBatchModel; +import com.yunzhupaas.flowable.model.operator.OperatorVo; +import com.yunzhupaas.flowable.model.operator.ReducePagination; +import com.yunzhupaas.flowable.model.operator.ReduceUserModel; +import com.yunzhupaas.flowable.model.task.AuditModel; +import com.yunzhupaas.flowable.model.task.FlowModel; +import com.yunzhupaas.flowable.model.task.TaskPagination; +import com.yunzhupaas.flowable.model.templatenode.BackNodeModel; +import com.yunzhupaas.flowable.model.util.FlowNature; +import com.yunzhupaas.flowable.service.CirculateService; +import com.yunzhupaas.flowable.service.OperatorService; +import com.yunzhupaas.flowable.service.RecordService; +import com.yunzhupaas.flowable.service.TaskService; +import com.yunzhupaas.flowable.util.*; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RedisUtil; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.*; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/25 14:48 + */ +@Tag(name = "经办", description = "OperatorController") +@RestController +@RequestMapping("/api/workflow/operator") +@RequiredArgsConstructor +public class OperatorController extends SuperController { + private final OperatorService operatorService; + private final TaskService taskService; + @Autowired + private ServiceUtil serviceUtil; + @Autowired + private RecordService recordService; + @Autowired + private CirculateService circulateService; + @Autowired + private OperatorUtil operatorUtil; + @Autowired + private TaskUtil taskUtil; + @Autowired + private RedisUtil redisUtil; + @Autowired + private RedisLock redisLock; + + /** + * 判断候选人 + * + * @param id 经办主键 + * @param fo 参数类 + */ + @Operation(summary = "判断候选人") + @PostMapping("/CandidateNode/{id}") + public ActionResult candidates(@PathVariable("id") String id, @RequestBody CandidateCheckFo fo) + throws WorkFlowException { + return ActionResult.success(taskService.checkCandidates(id, fo)); + } + + /** + * 获取候选人 + * + * @param fo 参数类 + */ + @Operation(summary = "获取候选人") + @PostMapping("/CandidateUser/{id}") + public ActionResult candidateUser(@PathVariable("id") String id, @RequestBody CandidateUserFo fo) + throws WorkFlowException { + List candidates = taskService.getCandidateUser(id, fo); + PaginationVO paginationVO = JsonUtil.getJsonToBean(fo, PaginationVO.class); + return ActionResult.page(candidates, paginationVO); + } + + /** + * 列表 + * + * @param category 列表标识 + * @param pagination 参数 + */ + @Operation(summary = "列表") + @GetMapping("/List/{category}") + public ActionResult list(@PathVariable("category") String category, TaskPagination pagination) { + List list = new ArrayList<>(); + pagination.setCategory(category); + pagination.setDelegateType(true); + switch (category) { + case "0": // 待签 + case "1": // 待办 + case "2": // 在办 + case "5": // 批量在办 + list = operatorService.getList(pagination); + break; + case "3": // 已办 + list = recordService.getList(pagination); + break; + case "4": // 抄送 + list = circulateService.getList(pagination); + } + List vos = new ArrayList<>(); + List userList = serviceUtil + .getUserName(list.stream().map(OperatorVo::getCreatorUserId).collect(Collectors.toList())); + for (OperatorVo operatorVo : list) { + OperatorVo vo = JsonUtil.getJsonToBean(operatorVo, OperatorVo.class); + UserEntity userEntity = userList.stream().filter(t -> t.getId().equals(vo.getCreatorUserId())).findFirst() + .orElse(null); + vo.setCreatorUser(userEntity != null ? userEntity.getRealName() + "/" + userEntity.getAccount() : ""); + if (ObjectUtil.equals(operatorVo.getIsProcessing(), 1) + && ObjectUtil.equals(operatorVo.getStatus(), OperatorStateEnum.Transfer.getCode())) { + vo.setStatus(OperatorStateEnum.TransferProcessing.getCode()); + } + vos.add(vo); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(vos, paginationVO); + } + + /** + * 签收或退签 + * + * @param flowModel 参数类,ids 主键集合、type 0 签收 1 退签 + */ + @Operation(summary = "签收或退签") + @PostMapping("/Sign") + public ActionResult sign(@RequestBody FlowModel flowModel) throws WorkFlowException { + operatorService.sign(flowModel); + return ActionResult.success(MsgCode.SU005.get()); + } + + /** + * 开始办理 + * + * @param flowModel 参数类,ids 主键集合 + */ + @Operation(summary = "开始办理") + @PostMapping("/Transact") + public ActionResult startHandle(@RequestBody FlowModel flowModel) throws WorkFlowException { + operatorService.startHandle(flowModel); + return ActionResult.success(MsgCode.SU005.get()); + } + + /** + * 保存草稿 + * + * @param id 经办主键 + * @param flowModel 参数 + */ + @Operation(summary = "保存草稿") + @PostMapping("/SaveAudit/{id}") + public ActionResult saveAudit(@PathVariable("id") String id, @RequestBody FlowModel flowModel) + throws WorkFlowException { + operatorService.saveAudit(id, flowModel); + return ActionResult.success(MsgCode.SU002.get()); + } + + /** + * 同意拒绝 + * + * @param id 经办主键 + * @param flowModel 参数 + */ + @Operation(summary = "同意拒绝") + @PostMapping("/Audit/{id}") + public ActionResult audit(@PathVariable("id") String id, @RequestBody FlowModel flowModel) throws Exception { + OperatorEntity operator = operatorUtil.checkOperator(id); + TaskEntity taskEntity = taskService.getInfo(operator.getTaskId()); + if (null == taskEntity) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + boolean lock = redisLock.lock(taskEntity.getId() + operator.getNodeId(), operator.getId(), 5, TimeUnit.SECONDS); + if (!lock) { + throw new WorkFlowException("当前节点正在审批中,请稍后再试"); + } + Integer handleStatus = flowModel.getHandleStatus(); + try { + operatorService.auditWithCheck(id, flowModel); + List list = flowModel.getList(); + if (CollectionUtil.isNotEmpty(list)) { + TimeUtil.timeModel(list, flowModel, redisUtil); + } + } catch (Exception e) { + operatorUtil.compensate(taskEntity); + throw e; + } finally { + redisLock.unlock(taskEntity.getId() + operator.getNodeId(), operator.getId()); + } + operatorUtil.handleEvent(); + taskEntity = flowModel.getTaskEntity(); + if (taskEntity.getRejectDataId() == null) { + operatorUtil.autoAudit(flowModel); + operatorUtil.handleEvent(); + } + TaskEntity task = taskService.getById(taskEntity.getId()); + taskEntity = task == null ? taskEntity : task; + AuditModel model = taskUtil.getAuditModel(taskEntity.getId(), flowModel, operator); + String msg = Objects.equals(handleStatus, FlowNature.RejectCompletion) ? MsgCode.WF065.get() + : MsgCode.WF066.get(); + if (ObjectUtil.equals(operator.getIsProcessing(), 1)) { + msg = MsgCode.WF148.get(); + } + return ActionResult.success(msg, model); + } + + /** + * 加签 + * + * @param id 经办主键 + * @param flowModel 参数 + */ + @Operation(summary = "加签") + @PostMapping("/AddSign/{id}") + public ActionResult freeApprover(@PathVariable("id") String id, @RequestBody FlowModel flowModel) + throws Exception { + operatorService.addSign(id, flowModel); + operatorUtil.autoAudit(flowModel); + operatorUtil.handleEvent(); + return ActionResult.success(MsgCode.WF004.get()); + } + + /** + * 获取加签的人 + * + * @param id 经办主键 + * @param pagination 参数 + */ + @Operation(summary = "获取加签的人") + @PostMapping("/AddSignUserIdList/{id}") + public ActionResult getAddSignUserIdList(@PathVariable("id") String id, @RequestBody ReducePagination pagination) + throws WorkFlowException { + List reduceList = operatorService.getReduceList(id, pagination); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(reduceList, paginationVO); + } + + /** + * 减签 + * + * @param flowModel 参数 + * @param id 记录主键 + */ + @Operation(summary = "减签") + @PostMapping("/ReduceApprover/{id}") + public ActionResult reduceApprover(@RequestBody FlowModel flowModel, @PathVariable("id") String id) + throws WorkFlowException { + operatorService.reduce(id, flowModel); + return ActionResult.success(MsgCode.WF069.get()); + } + + /** + * 获取退回的节点 + * + * @param id 经办主键 + */ + @Operation(summary = "获取退回的节点") + @GetMapping("/SendBackNodeList/{id}") + public ActionResult getFallbacks(@PathVariable("id") String id) throws WorkFlowException { + ListVO vo = new ListVO<>(); + vo.setList(operatorService.getFallbacks(id)); + return ActionResult.success(vo); + } + + /** + * 退回 + * + * @param id 经办主键 + * @param flowModel 参数 + */ + @Operation(summary = "退回") + @PostMapping("/SendBack/{id}") + public ActionResult reject(@PathVariable("id") String id, @RequestBody FlowModel flowModel) + throws Exception { + OperatorEntity operator = operatorUtil.checkOperator(id); + TaskEntity taskEntity = taskService.getInfo(operator.getTaskId()); + if (null == taskEntity) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + try { + operatorService.back(id, flowModel); + } catch (Exception e) { + operatorUtil.compensate(taskEntity); + throw e; + } + operatorUtil.event(flowModel, 9); + return ActionResult.success(MsgCode.WF002.get()); + } + + /** + * 撤回 + * + * @param id 记录主键 + * @param flowModel 参数 + */ + @Operation(summary = "撤回") + @PostMapping("/Recall/{taskRecordId}") + public ActionResult recall(@PathVariable("taskRecordId") String id, @RequestBody FlowModel flowModel) + throws Exception { + RecordEntity record = recordService.getInfo(id); + if (null == record) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + if (record.getStatus().equals(FlowNature.Invalid)) { + throw new WorkFlowException(MsgCode.WF005.get()); + } + OperatorEntity operator = operatorService.getInfo(record.getOperatorId()); + if (null == operator) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + TaskEntity taskEntity = taskService.getInfo(operator.getTaskId()); + if (null == taskEntity) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + + flowModel.setRecordEntity(record); + flowModel.setOperatorEntity(operator); + try { + operatorService.recall(id, flowModel); + } catch (Exception e) { + operatorUtil.compensate(taskEntity); + throw e; + } + operatorUtil.event(flowModel, 6); + return ActionResult.success(MsgCode.WF008.get()); + } + + /** + * 转审 + * + * @param id 经办主键 + * @param flowModel 参数 + */ + @Operation(summary = "转审") + @PostMapping("/Transfer/{id}") + public ActionResult transfer(@PathVariable("id") String id, @RequestBody FlowModel flowModel) + throws Exception { + operatorService.transfer(id, flowModel); + operatorUtil.autoAudit(flowModel); + operatorUtil.handleEvent(); + OperatorEntity operator = operatorService.getById(id); + return ActionResult + .success(ObjectUtil.equals(operator.getIsProcessing(), 1) ? MsgCode.WF003.get() : MsgCode.WF152.get()); + } + + /** + * 协办 + * + * @param id 主键 + * @param flowModel 参数 + */ + @Operation(summary = "协办") + @PostMapping("/Assist/{id}") + public ActionResult assist(@PathVariable("id") String id, @RequestBody FlowModel flowModel) + throws WorkFlowException { + operatorService.assist(id, flowModel); + return ActionResult.success(MsgCode.WF067.get()); + } + + /** + * 协办保存 + * + * @param id 主键 + * @param flowModel 参数 + */ + @Operation(summary = "协办保存") + @PostMapping("/AssistSave/{id}") + public ActionResult assistSave(@PathVariable("id") String id, @RequestBody FlowModel flowModel) + throws WorkFlowException { + operatorService.assistSave(id, flowModel); + return ActionResult.success(MsgCode.WF068.get()); + } + + /** + * 批量审批流程分类列表 + */ + @Operation(summary = "批量审批流程分类列表") + @GetMapping("/BatchFlowSelector") + public ActionResult> batchFlowSelector() { + List list = operatorService.batchFlowSelector(); + return ActionResult.success(list); + } + + /** + * 批量审批流程版本列表 + * + * @param templateId 流程定义主键 + */ + @Operation(summary = "批量审批流程版本列表") + @GetMapping("/BatchVersionSelector/{templateId}") + public ActionResult> batchVersionSelector(@PathVariable("templateId") String templateId) { + List list = operatorService.batchVersionSelector(templateId); + return ActionResult.success(list); + } + + /** + * 批量审批节点列表 + * + * @param flowId 定义版本主键 + */ + @Operation(summary = "批量审批节点列表") + @GetMapping("/BatchNodeSelector/{flowId}") + public ActionResult> batchNodeSelector(@PathVariable("flowId") String flowId) { + List list = operatorService.batchNodeSelector(flowId); + return ActionResult.success(list); + } + + /** + * 批量审批节点属性 + * + * @param flowModel 参数 + */ + @Operation(summary = "批量审批节点属性") + @GetMapping("/BatchNode") + public ActionResult batchNode(FlowModel flowModel) throws WorkFlowException { + Map nodeMap = operatorService.batchNode(flowModel); + return ActionResult.success(nodeMap); + } + + /** + * 批量获取候选人 + * + * @param flowId 版本主键 + * @param operatorId 经办主键 + * @param batchType 类型,0.同意 1.拒绝 + */ + @Operation(summary = "批量获取候选人") + @GetMapping("/BatchCandidate") + public ActionResult batchCandidate(String flowId, String operatorId, Integer batchType) throws WorkFlowException { + CandidateCheckVo vo = operatorService.batchCandidates(flowId, operatorId, batchType); + return ActionResult.success(vo); + } + + /** + * 批量审批 + * + * @param flowModel 参数 + */ + @Operation(summary = "批量审批") + @PostMapping("/BatchOperation") + public ActionResult batchOperation(@RequestBody FlowModel flowModel) throws Exception { + try { + operatorService.batch(flowModel); + } catch (Exception e) { + List taskList = flowModel.getTaskList(); + if (CollectionUtil.isNotEmpty(taskList)) { + for (TaskEntity taskEntity : taskList) { + operatorUtil.compensate(taskEntity); + } + } + throw e; + } + return ActionResult.success(MsgCode.WF011.get()); + } + + /** + * 消息跳转工作流 + * + * @param id 经办或抄送主键 + */ + @Operation(summary = "消息跳转工作流") + @GetMapping("/{id}/Info") + public ActionResult checkInfo(@PathVariable("id") String id, + @RequestParam(value = "opType", required = false) String opType) throws WorkFlowException { + Map map = new HashMap<>(); + List list = ImmutableList.of(FlowNature.LaunchDetail, FlowNature.LaunchCreate); + if (list.contains(opType)) { + String type = FlowNature.LaunchDetail; + TaskEntity task = taskService.getById(id); + if (null != task) { + taskUtil.checkTemplateHide(task.getTemplateId()); + if (ObjectUtil.equals(task.getStatus(), TaskStatusEnum.TO_BE_SUBMIT.getCode())) { + type = FlowNature.LaunchCreate; + } + } + map.put("opType", type); + return ActionResult.success(map); + } + String type = taskService.checkInfo(id); + map.put("opType", type); + return ActionResult.success(map); + } + + /** + * 进度节点记录列表 + * + * @param taskId 任务主键 + * @param nodeId 节点id + */ + @Operation(summary = "进度节点记录列表") + @GetMapping("/RecordList") + public ActionResult getRecordList(@RequestParam("taskId") String taskId, @RequestParam("nodeId") String nodeId) { + return ActionResult.success(recordService.getList(taskId, nodeId)); + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-controller/src/main/java/com/yunzhupaas/flowable/controller/TaskController.java b/yunzhupaas-flowable/yunzhupaas-flowable-controller/src/main/java/com/yunzhupaas/flowable/controller/TaskController.java new file mode 100644 index 0000000..5d2eb93 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-controller/src/main/java/com/yunzhupaas/flowable/controller/TaskController.java @@ -0,0 +1,275 @@ +package com.yunzhupaas.flowable.controller; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import com.google.common.collect.ImmutableMap; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.OperatorEntity; +import com.yunzhupaas.flowable.entity.TaskEntity; +import com.yunzhupaas.flowable.entity.TriggerTaskEntity; +import com.yunzhupaas.flowable.enums.TaskStatusEnum; +import com.yunzhupaas.flowable.model.task.*; +import com.yunzhupaas.flowable.model.template.BeforeInfoVo; +import com.yunzhupaas.flowable.model.trigger.TriggerInfoModel; +import com.yunzhupaas.flowable.service.TaskService; +import com.yunzhupaas.flowable.service.TriggerTaskService; +import com.yunzhupaas.flowable.util.OperatorUtil; +import com.yunzhupaas.flowable.util.ServiceUtil; +import com.yunzhupaas.flowable.util.TaskUtil; +import com.yunzhupaas.flowable.util.TimeUtil; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.model.user.UserIdListVo; +import com.yunzhupaas.util.*; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * 流程任务 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/17 15:13 + */ +@Tag(name = "流程任务", description = "TaskController") +@RestController +@RequestMapping("/api/workflow/task") +@RequiredArgsConstructor +public class TaskController extends SuperController { + private final TaskService taskService; + @Autowired + private ServiceUtil serviceUtil; + @Autowired + private TaskUtil taskUtil; + @Autowired + private RedisUtil redisUtil; + @Autowired + private OperatorUtil operatorUtil; + @Autowired + private TriggerTaskService triggerTaskService; + + /** + * 详情 + * + * @param id 任务id + * @param fo 参数类 + */ + @Operation(summary = "详情") + @GetMapping("/{id}") + public ActionResult getInfo(@PathVariable("id") String id, FlowModel fo) throws WorkFlowException { + if (ObjectUtil.equals(fo.getType(), 2)) { + TriggerInfoModel triggerInfo = triggerTaskService.getInfo(id); + return ActionResult.success(triggerInfo); + } + return ActionResult.success(taskService.getInfo(id, fo)); + } + + /** + * 暂存或提交 + * + * @param fo 参数类 + */ + @Operation(summary = "暂存或提交") + @PostMapping + public ActionResult saveOrSubmit(@RequestBody FlowModel fo) throws Exception { + taskService.batchSaveOrSubmit(fo); + if (ObjectUtil.equals(TaskStatusEnum.RUNNING.getCode(), fo.getStatus())) { + operatorUtil.event(fo, 1); + } + TaskEntity taskEntity = fo.getTaskEntity(); + if (taskEntity.getRejectDataId() == null) { + operatorUtil.autoAudit(fo); + operatorUtil.handleEvent(); + } + List list = fo.getList(); + if (CollectionUtil.isNotEmpty(list)) { + TimeUtil.timeModel(list, fo, redisUtil); + } + String msg = TaskStatusEnum.TO_BE_SUBMIT.getCode().equals(fo.getStatus()) ? MsgCode.SU002.get() + : MsgCode.SU006.get(); + TaskEntity task = taskService.getById(taskEntity.getId()); + taskEntity = task == null ? taskEntity : task; + AuditModel model = taskUtil.getAuditModel(taskEntity.getId(), fo, null); + return ActionResult.success(msg, model); + } + + /** + * 暂存或提交,已暂存的再次暂存或提交 + * + * @param id 任务主键 + * @param fo 参数 + */ + @Operation(summary = "暂存或提交(我发起的)") + @PutMapping("/{id}") + public ActionResult saveOrSubmit(@PathVariable("id") String id, @RequestBody FlowModel fo) throws Exception { + Map data = fo.getFormData(); + String flowTaskID = Objects.nonNull(data.get(FlowFormConstant.FLOWTASKID)) + ? data.get(FlowFormConstant.FLOWTASKID).toString() + : id; + fo.setId(flowTaskID); + TaskEntity taskEntity = taskService.getById(flowTaskID); + if (taskEntity != null) { + taskUtil.isSuspend(taskEntity); + taskUtil.isCancel(taskEntity); + } + taskService.batchSaveOrSubmit(fo); + if (ObjectUtil.equals(TaskStatusEnum.RUNNING.getCode(), fo.getStatus())) { + operatorUtil.event(fo, 1); + } + taskEntity = fo.getTaskEntity(); + if (taskEntity.getRejectDataId() == null) { + operatorUtil.autoAudit(fo); + operatorUtil.handleEvent(); + } + List list = fo.getList(); + if (CollectionUtil.isNotEmpty(list)) { + TimeUtil.timeModel(list, fo, redisUtil); + } + TaskEntity task = taskService.getById(taskEntity.getId()); + taskEntity = task == null ? taskEntity : task; + String msg = TaskStatusEnum.TO_BE_SUBMIT.getCode().equals(fo.getStatus()) ? MsgCode.SU002.get() + : MsgCode.SU006.get(); + AuditModel model = taskUtil.getAuditModel(taskEntity.getId(), fo, null); + return ActionResult.success(msg, model); + } + + /** + * 删除 + * + * @param id 主键 + */ + @Operation(summary = "删除") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) throws Exception { + List list = taskService.delete(id); + taskUtil.deleteFormData(list); + return ActionResult.success(MsgCode.SU003.get()); + } + + /** + * 我发起的 列表 + * + * @param pagination 分页参数 + */ + @Operation(summary = "我发起的") + @GetMapping + public ActionResult> list(TaskPagination pagination) { + List list = taskService.getList(pagination); + List voList = new ArrayList<>(); + List userList = serviceUtil + .getUserName(list.stream().map(TaskEntity::getCreatorUserId).collect(Collectors.toList())); + for (TaskEntity entity : list) { + TaskVo vo = JsonUtil.getJsonToBean(entity, TaskVo.class); + UserEntity userEntity = userList.stream().filter(t -> t.getId().equals(entity.getCreatorUserId())) + .findFirst().orElse(null); + vo.setCreatorUser(userEntity != null ? userEntity.getRealName() + "/" + userEntity.getAccount() : ""); + vo.setFlowUrgent(entity.getUrgent()); + if (StringUtil.isNotBlank(entity.getDelegateUserId())) { + vo.setDelegateUser(entity.getDelegateUserId()); + } + voList.add(vo); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(voList, paginationVO); + } + + /** + * 发起撤回 + * + * @param id 任务主键 + */ + @Operation(summary = "发起撤回") + @PutMapping("/Recall/{id}") + public ActionResult recall(@PathVariable("id") String id, @RequestBody FlowModel flowModel) + throws WorkFlowException { + taskService.recall(id, flowModel); + operatorUtil.event(flowModel, 3); + return ActionResult.success(MsgCode.WF008.get()); + } + + /** + * 催办 + * + * @param id 任务主键 + */ + @Operation(summary = "催办") + @PostMapping("/Press/{id}") + public ActionResult press(@PathVariable("id") String id) throws WorkFlowException { + if (taskService.press(id)) { + return ActionResult.success(MsgCode.WF022.get()); + } + return ActionResult.fail(MsgCode.WF023.get()); + } + + /** + * 撤销 + * + * @param id 任务主键 + */ + @Operation(summary = "撤销") + @PutMapping("/Revoke/{id}") + public ActionResult revoke(@PathVariable("id") String id, @RequestBody FlowModel flowModel) + throws Exception { + taskService.revoke(id, flowModel); + return ActionResult.success(MsgCode.SU006.get()); + } + + /** + * 获取流程所关联的用户信息 + * + * @param id 任务主键 + * @param pagination 分页参数 + */ + @Operation(summary = "获取流程所关联的用户信息") + @GetMapping("/TaskUserList/{id}") + public ActionResult getTaskUserList(@PathVariable("id") String id, TaskPagination pagination) { + TaskUserListModel model = taskService.getTaskUserList(id); + List allUserIdList = model.getAllUserIdList(); + List userList = serviceUtil.getUserList(allUserIdList, pagination, null); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(userList, paginationVO); + } + + /** + * 子流程详情 + * + * @param flowModel 参数 + */ + @Operation(summary = "子流程详情") + @GetMapping("/SubFlowInfo") + public ActionResult subFlowInfo(FlowModel flowModel) throws WorkFlowException { + List list = taskService.subFlowInfo(flowModel); + return ActionResult.success(list); + } + + /** + * 查看发起表单 + * + * @param taskId 任务主键 + */ + @Operation(summary = "查看发起表单") + @GetMapping("/ViewStartForm/{taskId}") + public ActionResult getStartForm(@PathVariable("taskId") String taskId) throws WorkFlowException { + ViewFormModel model = taskService.getStartForm(taskId); + return ActionResult.success(model); + } + + @GetMapping("/test") + public Map test() { + return ImmutableMap.of("handleId", + "03d159a3-0f88-424c-a24f-02f63855fe4f,9624fa22-ac3a-4184-af0b-b2c720df9d60,3977de33-668c-4585-b09b-239aacfb4ebe"); + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-controller/src/main/java/com/yunzhupaas/flowable/controller/TaskForFileController.java b/yunzhupaas-flowable/yunzhupaas-flowable-controller/src/main/java/com/yunzhupaas/flowable/controller/TaskForFileController.java new file mode 100644 index 0000000..656b4dc --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-controller/src/main/java/com/yunzhupaas/flowable/controller/TaskForFileController.java @@ -0,0 +1,202 @@ +package com.yunzhupaas.flowable.controller; + +import cn.hutool.core.collection.CollectionUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.*; +import com.yunzhupaas.flowable.enums.NodeEnum; +import com.yunzhupaas.flowable.enums.OperatorStateEnum; +import com.yunzhupaas.flowable.model.operator.OperatorVo; +import com.yunzhupaas.flowable.model.task.FileModel; +import com.yunzhupaas.flowable.model.task.FlowModel; +import com.yunzhupaas.flowable.model.task.TaskPagination; +import com.yunzhupaas.flowable.model.templatenode.nodejson.FileConfig; +import com.yunzhupaas.flowable.model.templatenode.nodejson.NodeModel; +import com.yunzhupaas.flowable.service.*; +import com.yunzhupaas.flowable.util.OperatorUtil; +import com.yunzhupaas.flowable.util.RecordUtil; +import com.yunzhupaas.flowable.util.TaskUtil; +import com.yunzhupaas.util.DateUtil; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.workflow.service.TaskApi; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/28 14:32 + */ +@Component +public class TaskForFileController implements TaskApi { + @Autowired + private TaskService taskService; + @Autowired + private OperatorService operatorService; + @Autowired + private RecordService recordService; + @Autowired + private CirculateService circulateService; + @Autowired + private DelegateService delegateService; + @Autowired + private TemplateNodeService templateNodeService; + @Autowired + private RecordUtil recordUtil; + @Autowired + private OperatorUtil operatorUtil; + @Autowired + private TaskUtil taskUtil; + + // 获取归档信息 + @Override + public FileModel getFileModel(String taskId) throws WorkFlowException { + TaskEntity taskEntity = taskService.getInfo(taskId); + if (null == taskEntity) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + FileModel model = new FileModel(); + + List nodeEntityList = templateNodeService.getList(taskEntity.getFlowId()); + TemplateNodeEntity globalEntity = nodeEntityList.stream() + .filter(e -> StringUtil.equals(NodeEnum.global.getType(), e.getNodeType())).findFirst() + .orElse(new TemplateNodeEntity()); + NodeModel global = JsonUtil.getJsonToBean(globalEntity.getNodeJson(), NodeModel.class); + if (null != global) { + FileConfig fileConfig = global.getFileConfig(); + // 归档路径 + model.setParentId(fileConfig.getParentId()); + + String userId = taskEntity.getCreatorUserId(); + if (fileConfig.getPermissionType().equals(1)) { + // 创建人 + model.setUserId(userId); + // 分享人 + List list = operatorUtil.getListOfFile(taskId); + model.setUserList(list.stream().filter(e -> !e.equals(userId)).collect(Collectors.toList())); + } else if (fileConfig.getPermissionType().equals(3)) { + // 最后节点审批人 + List list = operatorUtil.getListOfLast(taskId); + if (CollectionUtil.isNotEmpty(list)) { + model.setUserId(list.get(0)); + list.remove(0); + if (CollectionUtil.isNotEmpty(list)) { + model.setUserList(list); + } + } else { + model.setUserId(userId); + } + } else { + // 创建人 + model.setUserId(userId); + } + } + + // 文件名称 + String filename = taskEntity.getFullName(); + String datetime; + if (null != taskEntity.getEndTime()) { + datetime = DateUtil.dateToString(taskEntity.getEndTime(), "yyyyMMddHHmmss"); + } else { + datetime = DateUtil.dateToString(new Date(), "yyyyMMddHHmmss"); + } + filename += "-" + datetime; + model.setFilename(filename + ".pdf"); + + return model; + } + + @Override + public TaskEntity getInfoSubmit(String id, SFunction... columns) { + return taskService.getInfoSubmit(id, columns); + } + + @Override + public List getInfosSubmit(String[] ids, SFunction... columns) { + return taskService.getInfosSubmit(ids, columns); + } + + @Override + public void delete(TaskEntity taskEntity) throws Exception { + taskService.delete(taskEntity.getId()); + } + + @Override + public void saveOrSubmit(FlowModel flowModel) throws Exception { + taskService.batchSaveOrSubmit(flowModel); + } + + @Override + public List getRecordList(String taskId) { + return recordUtil.getList(taskId); + } + + @Override + public void updateIsFile(String taskId) { + try { + taskService.updateIsFile(taskId); + } catch (WorkFlowException e) { + System.out.println(e.getMessage()); + } + } + + @Override + public List getWaitList(TaskPagination pagination) { + return operatorService.getList(pagination); + } + + @Override + public List getTrialList(TaskPagination pagination) { + return recordService.getList(pagination); + } + + @Override + public List getCirculateList(TaskPagination pagination) { + return circulateService.getList(pagination); + } + + @Override + public List getDelegateList() { + return delegateService.getList(); + } + + @Override + public Boolean checkSign() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OperatorEntity::getCompletion, 0) + .ne(OperatorEntity::getStatus, OperatorStateEnum.Futility.getCode()) + .isNull(OperatorEntity::getSignTime); + long count = operatorService.count(queryWrapper); + return count > 0; + } + + @Override + public Boolean checkTodo() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OperatorEntity::getCompletion, 0) + .ne(OperatorEntity::getStatus, OperatorStateEnum.Futility.getCode()) + .isNotNull(OperatorEntity::getSignTime).isNull(OperatorEntity::getStartHandleTime); + long count = operatorService.count(queryWrapper); + return count > 0; + } + + @Override + public ActionResult launchFlow(FlowModel flowModel) { + try { + return taskUtil.launchFlow(flowModel); + } catch (Exception e) { + e.printStackTrace(); + return ActionResult.fail(e.getMessage()); + } + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-controller/src/main/java/com/yunzhupaas/flowable/controller/TemplateController.java b/yunzhupaas-flowable/yunzhupaas-flowable-controller/src/main/java/com/yunzhupaas/flowable/controller/TemplateController.java new file mode 100644 index 0000000..210d241 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-controller/src/main/java/com/yunzhupaas/flowable/controller/TemplateController.java @@ -0,0 +1,617 @@ +package com.yunzhupaas.flowable.controller; + + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.util.ObjectUtil; +import com.google.common.collect.ImmutableList; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.constant.PermissionConst; +import com.yunzhupaas.emnus.ModuleTypeEnum; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.TemplateEntity; +import com.yunzhupaas.flowable.entity.TemplateJsonEntity; +import com.yunzhupaas.flowable.model.candidates.CandidateUserVo; +import com.yunzhupaas.flowable.model.template.*; +import com.yunzhupaas.flowable.model.templatejson.FlowListModel; +import com.yunzhupaas.flowable.model.templatejson.TemplateJsonInfoVO; +import com.yunzhupaas.flowable.model.templatejson.TemplateJsonSelectVO; +import com.yunzhupaas.flowable.model.templatenode.TemplateNodeCrFrom; +import com.yunzhupaas.flowable.model.templatenode.TemplateNodeUpFrom; +import com.yunzhupaas.flowable.service.CommonService; +import com.yunzhupaas.flowable.service.OperatorService; +import com.yunzhupaas.flowable.service.TemplateJsonService; +import com.yunzhupaas.flowable.service.TemplateService; +import com.yunzhupaas.flowable.util.ServiceUtil; +import com.yunzhupaas.model.FlowWorkListVO; +import com.yunzhupaas.permission.entity.OrganizeEntity; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.entity.UserRelationEntity; +import com.yunzhupaas.permission.model.user.WorkHandoverModel; +import com.yunzhupaas.util.FileUtil; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.UploaderUtil; +import com.yunzhupaas.workflow.service.TemplateApi; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.util.*; +import java.util.stream.Collectors; + +@Slf4j +@Tag(name = "流程模板", description = "flowTemplate") +@RestController +@RequestMapping("/api/workflow/template") +public class TemplateController extends SuperController implements TemplateApi { + + @Autowired + private TemplateService templateService; + @Autowired + private TemplateJsonService templateJsonService; + @Autowired + private ServiceUtil serviceUtil; + @Autowired + private CommonService commonService; + @Autowired + private OperatorService operatorService; + + /** + * 流程列表 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "流程列表") + @GetMapping + public ActionResult> list(TemplatePagination pagination) { + List list = templateService.getList(pagination); + List dictionList = serviceUtil.getDictionName(list.stream().map(TemplateEntity::getCategory).collect(Collectors.toList())); + List userList = serviceUtil.getUserName(list.stream().map(TemplateEntity::getCreatorUserId).collect(Collectors.toList())); + List listVO = new ArrayList<>(); + for (TemplateEntity entity : list) { + TemplatePageLisVO vo = JsonUtil.getJsonToBean(entity, TemplatePageLisVO.class); + DictionaryDataEntity dataEntity = dictionList.stream().filter(t -> t.getId().equals(entity.getCategory())).findFirst().orElse(null); + vo.setCategory(dataEntity != null ? dataEntity.getFullName() : ""); + UserEntity userEntity = userList.stream().filter(t -> t.getId().equals(entity.getCreatorUserId())).findFirst().orElse(null); + vo.setCreatorUser(userEntity != null ? userEntity.getRealName() + "/" + userEntity.getAccount() : ""); + listVO.add(vo); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(listVO, paginationVO); + } + + /** + * 流程列表 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "流程列表") + @GetMapping("/Selector") + public ActionResult> selector(TemplatePagination pagination) { + List list = templateService.getSelector(pagination); + List voList = JsonUtil.getJsonToList(list, TemplatePageModel.class); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(voList, paginationVO); + } + + /** + * 常用流程树 + */ + @Operation(summary = "常用流程树") + @GetMapping("/CommonFlowTree") + public ActionResult getTreeCommon() { + ListVO vo = new ListVO<>(); + vo.setList(templateService.getTreeCommon()); + return ActionResult.success(vo); + } + + /** + * 树形列表 + */ + @Operation(summary = "树形列表") + @GetMapping("/TreeList") + public ActionResult> treeList(@RequestParam(value = "formType", required = false) Integer formType) { + ListVO vo = new ListVO<>(); + vo.setList(templateService.treeList(formType)); + return ActionResult.success(vo); + } + + /** + * 权限树形集合 + */ + @Operation(summary = "权限树形列表") + @GetMapping("/Power/TreeList") + public ActionResult> treeListPower() { + return ActionResult.success(templateService.treeListWithPower()); + } + + /** + * 流程基础信息 + * + * @param id 主键 + * @return + */ + @Operation(summary = "流程基础信息") + @GetMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult info(@PathVariable("id") String id) throws WorkFlowException { + TemplateEntity entity = templateService.getInfo(id); + TemplateInfoVO vo = JsonUtil.getJsonToBean(entity, TemplateInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 流程版本列表 + * + * @param id 主键 + * @return + */ + @Operation(summary = "流程版本列表") + @GetMapping("/Version/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult> version(@PathVariable("id") String id) throws WorkFlowException { + List list = templateJsonService.getList(id); + List listVO = new ArrayList<>(); + for (TemplateJsonEntity jsonEntity : list) { + TemplateJsonSelectVO vo = JsonUtil.getJsonToBean(jsonEntity, TemplateJsonSelectVO.class); + vo.setFlowVersion(jsonEntity.getVersion()); + vo.setFullName("流程版本V" + jsonEntity.getVersion()); + listVO.add(vo); + } + return ActionResult.success(listVO); + } + + /** + * 流程模板信息 + * + * @param id 主键 + * @return + */ + @Operation(summary = "流程模板信息") + @GetMapping("/Info/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult templateJsonInfo(@PathVariable("id") String id) throws WorkFlowException { + return ActionResult.success(templateJsonService.getInfoVo(id)); + } + + /** + * 新建流程 + * + * @param form 流程模型 + * @return + */ + @Operation(summary = "新建流程") + @PostMapping + @Parameters({ + @Parameter(name = "form", description = "流程模型", required = true), + }) + @SaCheckPermission(value = {"workFlow.flowEngine"}) + public ActionResult create(@RequestBody @Valid TemplateNodeCrFrom form) throws WorkFlowException { + TemplateEntity entity = JsonUtil.getJsonToBean(form, TemplateEntity.class); + String flowConfig = form.getFlowConfig(); + FlowConfigModel config = JsonUtil.getJsonToBean(flowConfig, FlowConfigModel.class); + config = config == null ? new FlowConfigModel() : config; + entity.setVisibleType(config.getVisibleType()); + templateService.create(entity, form.getFlowXml(), form.getFlowNodes()); + return ActionResult.success(MsgCode.SU001.get(), entity.getId()); + } + + /** + * 更新流程 + * + * @param id 主键 + * @param form 流程模型 + * @return + */ + @Operation(summary = "更新流程") + @PutMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "form", description = "流程模型", required = true), + }) + @SaCheckPermission(value = {"workFlow.flowEngine"}) + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid TemplateNodeUpFrom form) throws WorkFlowException { + TemplateEntity entity = JsonUtil.getJsonToBean(form, TemplateEntity.class); + String flowConfig = form.getFlowConfig(); + FlowConfigModel config = JsonUtil.getJsonToBean(flowConfig, FlowConfigModel.class); + config = config == null ? new FlowConfigModel() : config; + entity.setVisibleType(config.getVisibleType()); + templateService.update(id, entity); + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 更新流程类型 + * + * @param id 主键 + */ + @Operation(summary = "更新流程类型") + @PutMapping("/{id}/UpdateType") + @SaCheckPermission(value = {"workFlow.flowEngine"}) + public ActionResult updateType(@PathVariable("id") String id) throws WorkFlowException { + TemplateEntity entity = templateService.getInfo(id); + entity.setType(0); + templateService.updateById(entity); + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除流程引擎 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除流程引擎") + @DeleteMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission(value = {"workFlow.flowEngine"}) + public ActionResult delete(@PathVariable("id") String id) throws WorkFlowException { + TemplateEntity entity = templateService.getInfo(id); + templateService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + + /** + * 删除流程版本 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除流程版本") + @DeleteMapping("/Info/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission(value = {"workFlow.flowEngine"}) + public ActionResult deleteInfo(@PathVariable("id") String id) throws WorkFlowException { + TemplateJsonEntity entity = templateJsonService.getInfo(id); + List list = templateJsonService.getList(entity.getTemplateId()); + if (list.size() == 1) { + return ActionResult.fail(MsgCode.WF071.get()); + } + if (Objects.equals(entity.getState(), 1)) { + return ActionResult.fail(MsgCode.WF072.get()); + } + if (Objects.equals(entity.getState(), 2)) { + return ActionResult.fail(MsgCode.WF073.get()); + } + templateJsonService.delete(ImmutableList.of(id)); + return ActionResult.success(MsgCode.SU003.get()); + } + + /** + * 上架下架 + * + * @param id 主键 + * @param fo 参数 + */ + @Operation(summary = "上架下架") + @PutMapping("/{id}/UpDownShelf") + @SaCheckPermission(value = {"workFlow.flowEngine"}) + public ActionResult updateStatus(@PathVariable("id") String id, @RequestBody UpDownModel fo) throws WorkFlowException { + TemplateEntity entity = templateService.getInfo(id); + if (ObjectUtil.equals(fo.getIsUp(), 0)) { + entity.setStatus(1); + } else { + entity.setStatus(ObjectUtil.equals(fo.getIsHidden(), 0) ? 2 : 3); + } + templateService.updateById(entity); + return ActionResult.success(MsgCode.SU005.get()); + } + + /** + * 复制流程引擎 + * + * @param id 主键 + * @return + */ + @Operation(summary = "复制流程引擎") + @PostMapping("/{id}/Actions/Copy") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission(value = {"workFlow.flowEngine"}) + public ActionResult copy(@PathVariable("id") String id) throws WorkFlowException { + TemplateEntity entity = templateService.getInfo(id); + templateService.copy(entity); + return ActionResult.success(MsgCode.SU007.get()); + } + + /** + * 复制流程版本 + * + * @param id 主键 + * @return + */ + @Operation(summary = "复制流程版本") + @PostMapping("/Info/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission(value = {"workFlow.flowEngine"}) + public ActionResult copyVersion(@PathVariable("id") String id) throws WorkFlowException { + String templateJsonId = RandomUtil.uuId(); + TemplateJsonEntity entity = templateJsonService.getInfo(id); + templateJsonService.copy(entity, templateJsonId); + return ActionResult.success(MsgCode.SU007.get(), templateJsonId); + } + + /** + * 流程保存或发布 + * + * @return + */ + @Operation(summary = "流程保存或发布") + @PostMapping("/Save") + @SaCheckPermission(value = {"workFlow.flowEngine"}) + public ActionResult save(@RequestBody @Valid TemplateNodeUpFrom form) throws WorkFlowException { + templateJsonService.save(form); + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 导出 + * + * @param id 主键 + */ + @Operation(summary = "导出") + @GetMapping("/{id}/Actions/Export") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult export(@PathVariable("id") String id) throws WorkFlowException { + TemplateExportModel model = templateService.export(id); + DownloadVO downloadVO = serviceUtil.exportData(model); + return ActionResult.success(downloadVO); + } + + /** + * 导入 + * + * @param file 文件 + * @param type 类型 + */ + @Operation(summary = "导入") + @PostMapping(value = "/Actions/Import", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + @SaCheckPermission(value = {"workFlow.flowEngine"}) + public ActionResult importData(@RequestPart("file") MultipartFile file, @RequestParam("type") String type) throws WorkFlowException { + //判断是否为.json结尾 + if (FileUtil.existsSuffix(file, ModuleTypeEnum.FLOW_FLOWENGINE.getTableName())) { + return ActionResult.fail(MsgCode.IMP002.get()); + } + //获取文件内容 + String fileContent = FileUtil.getFileContent(file); + TemplateExportModel model = JsonUtil.getJsonToBean(fileContent, TemplateExportModel.class); + if (ObjectUtil.isEmpty(model.getTemplate())) { + return ActionResult.fail(MsgCode.IMP004.get()); + } + templateService.importData(model, type); + return ActionResult.success(MsgCode.IMP001.get()); + } + + /** + * 委托可选全部流程 + * + * @param pagination 分页参数 + */ + @Operation(summary = "委托可选全部流程") + @GetMapping("/GetFlowAll") + public ActionResult getFlowAll(TemplatePagination pagination) { + List list = templateService.getListAll(pagination, true); + List voList = JsonUtil.getJsonToList(list, TemplatePageLisVO.class); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(voList, paginationVO); + } + + /** + * 委托流程选择展示 + * + * @param ids 版本主键集合 + */ + @Operation(summary = "委托流程选择展示") + @PostMapping("/GetFlowList") + public ActionResult getFlowList(@RequestBody List ids) { + List list = templateService.getList(ids); + List voList = new ArrayList<>(); + for (TemplateEntity templateEntity : list) { + FlowListModel model = new FlowListModel(); + model.setId(templateEntity.getId()); + model.setFullName(templateEntity.getFullName()); + model.setEnCode(templateEntity.getEnCode()); + voList.add(model); + } + return ActionResult.success(voList); + } + + /** + * 子流程表单信息 + * + * @param id 版本主键 + */ + @Operation(summary = "子流程表单信息") + @GetMapping("/{id}/FormInfo") + public ActionResult formInfo(@PathVariable("id") String id) throws WorkFlowException { + VisualdevEntity formInfo = templateJsonService.getFormInfo(id); + return ActionResult.success(formInfo); + } + + /** + * 根据表单主键获取流程 + * + * @param formId 表单主键 + */ + @Operation(summary = "根据表单主键获取流程") + @GetMapping("/{formId}/FlowList") + public ActionResult getByFormId(@PathVariable("formId") String formId, Boolean start) { + FlowByFormModel model = templateService.getFlowByFormId(formId, start); + return ActionResult.success(model); + } + + /** + * 子流程可发起人员 + * + * @param id 版本主键 + * @param pagination 分页参数 + */ + @Operation(summary = "子流程可发起人员") + @GetMapping("/{id}/SubFlowUserList") + public ActionResult getSubFlowUserList(@PathVariable("id") String id, TemplatePagination pagination) throws WorkFlowException { + List list = templateService.getSubFlowUserList(id, pagination); + List voList = new ArrayList<>(); + List userIdList = list.stream().map(UserEntity::getId).collect(Collectors.toList()); + Map> userMap = serviceUtil.getListByUserIdAll(userIdList).stream() + .filter(t -> PermissionConst.ORGANIZE.equals(t.getObjectType())).collect(Collectors.groupingBy(UserRelationEntity::getUserId)); + for (UserEntity user : list) { + CandidateUserVo vo = JsonUtil.getJsonToBean(user, CandidateUserVo.class); + vo.setFullName(user.getRealName() + "/" + user.getAccount()); + vo.setHeadIcon(UploaderUtil.uploaderImg(user.getHeadIcon())); + List listByUserId = userMap.get(user.getId()) != null ? userMap.get(user.getId()) : new ArrayList<>(); + StringJoiner joiner = new StringJoiner(","); + for (UserRelationEntity relation : listByUserId) { + List organizeId = serviceUtil.getOrganizeId(relation.getObjectId()); + if (!organizeId.isEmpty()) { + String organizeName = organizeId.stream().map(OrganizeEntity::getFullName).collect(Collectors.joining("/")); + joiner.add(organizeName); + } + } + vo.setOrganize(joiner.toString()); + voList.add(vo); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(voList, paginationVO); + } + + /** + * 常用流程 + * + * @param id 版本主键 + */ + @Operation(summary = "常用流程") + @PostMapping("/SetCommonFlow/{id}") + public ActionResult SetCommonFlow(@PathVariable("id") String id) { + int flag = commonService.setCommonFLow(id); + if (flag == 2) { + return ActionResult.success(MsgCode.SU021.get()); + } + return ActionResult.success(MsgCode.SU016.get()); + } + + /** + * 根据模板主键获取表单 + * + * @param templateId 流程模板主键 + */ + @Operation(summary = "根据模板主键获取表单") + @GetMapping("/StartForm/{templateId}") + public ActionResult getFormByTemplateId(@PathVariable("templateId") String templateId) throws WorkFlowException { + return ActionResult.success(templateService.getFormByTemplateId(templateId)); + } + + /** + * 根据模板主键获取表单主键和流程版本主键 + * + * @param templateId 流程模板主键 + */ + @Operation(summary = "根据模板主键获取表单主键和流程版本主键") + @GetMapping("/StartFormId/{templateId}") + public ActionResult getFormIdAndFlowIdByTemplateId(@PathVariable("templateId") String templateId) throws WorkFlowException { + return ActionResult.success(templateService.getFormIdAndFlowId(templateId)); + } + + @Override + public FlowByFormModel getFlowByFormId(String formId, Boolean start) { + return templateService.getFlowByFormId(formId, start); + } + + @Override + public String getFormByFlowId(String templateId) { + String formId = ""; + try { + VisualdevEntity entity = templateService.getFormByTemplateId(templateId); + if (null == entity) { + throw new WorkFlowException(MsgCode.VS412.get()); + } + formId = entity.getId(); + } catch (Exception e) { + log.error("流程获取表单失败: {}", e.getMessage()); + } + return formId; + } + + @Override + public List getFlowIdsByTemplateId(String templateId) { + List list = templateJsonService.getList(templateId); + return list.stream().map(TemplateJsonEntity::getId).distinct().collect(Collectors.toList()); + } + + @Override + public List getFlowIdsByTemplate(String templateId) { + return templateJsonService.getList(templateId); + } + + @Override + public List getListByFlowIds(List flowId) { + return templateService.getList(flowId); + } + + @Override + public List treeListWithPower() { + return templateService.treeListWithPower(); + } + + @Override + public FlowWorkListVO flowWork(String fromId) { + return operatorService.flowWork(fromId); + } + + @Override + public boolean flowWork(WorkHandoverModel workHandoverModel) { + return operatorService.flowWork(workHandoverModel); + } + + @Override + public List getFormList() { + return templateService.getFormList(); + } + + @Override + public String getTemplateByVersionId(String flowId) { + String templateId = ""; + TemplateJsonEntity byId = templateJsonService.getById(flowId); + if (byId != null) { + templateId = byId.getTemplateId(); + } + return templateId; + } + + @Override + public Map getFlowFormMap() { + return templateService.getFlowFormMap(); + } +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-controller/src/main/java/com/yunzhupaas/flowable/controller/TriggerController.java b/yunzhupaas-flowable/yunzhupaas-flowable-controller/src/main/java/com/yunzhupaas/flowable/controller/TriggerController.java new file mode 100644 index 0000000..bc56785 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-controller/src/main/java/com/yunzhupaas/flowable/controller/TriggerController.java @@ -0,0 +1,126 @@ +package com.yunzhupaas.flowable.controller; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.flowable.entity.TemplateJsonEntity; +import com.yunzhupaas.flowable.entity.TemplateNodeEntity; +import com.yunzhupaas.flowable.enums.NodeEnum; +import com.yunzhupaas.flowable.model.trigger.TriggerDataFo; +import com.yunzhupaas.flowable.model.trigger.TriggerDataModel; +import com.yunzhupaas.flowable.model.trigger.TriggerModel; +import com.yunzhupaas.flowable.service.TemplateJsonService; +import com.yunzhupaas.flowable.service.TemplateNodeService; +import com.yunzhupaas.flowable.util.TriggerUtil; +import com.yunzhupaas.workflow.service.TriggerApi; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +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 java.util.List; +import java.util.stream.Collectors; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/11 10:39 + */ +@Tag(name = "流程触发", description = "trigger") +@RestController +@RequestMapping("/api/workflow/trigger") +@Slf4j +public class TriggerController implements TriggerApi { + @Autowired + private TriggerUtil triggerUtil; + @Autowired + private TemplateNodeService templateNodeService; + @Autowired + private TemplateJsonService templateJsonService; + + /** + * 任务流程触发 + * + * @param model 参数 + */ + @PostMapping("/Execute") + public ActionResult execute(@RequestBody TriggerModel model) throws Exception { + for (TriggerDataModel dataModel : model.getDataList()) { + try { + triggerUtil.handleTrigger(dataModel, model.getUserInfo()); + } catch (Exception e) { + log.error("触发异常", e); + // triggerUtil.createErrorRecord(); + } + } + return ActionResult.success(); + } + + /** + * 定时触发 + * + * @param triggerModel 参数 + */ + @PostMapping("/TimeExecute") + public ActionResult timeExecute(@RequestBody TriggerModel triggerModel) { + try { + triggerUtil.handleTimeTrigger(triggerModel); + } catch (Exception e) { + log.error("定时触发异常", e); + // triggerUtil.createErrorRecord(); + } + return ActionResult.success(); + } + + /** + * 通知触发 + * + * @param triggerModel 参数 + */ + @PostMapping("/MsgExecute") + public ActionResult msgExecute(@RequestBody TriggerModel triggerModel) { + String msgId = triggerModel.getId(); + UserInfo userInfo = triggerModel.getUserInfo(); + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TemplateNodeEntity::getNodeType, NodeEnum.noticeTrigger.getType()) + .eq(TemplateNodeEntity::getFormId, msgId); + List triggerNodeList = templateNodeService.list(queryWrapper); + if (CollectionUtil.isNotEmpty(triggerNodeList)) { + List flowIds = triggerNodeList.stream().map(TemplateNodeEntity::getFlowId).distinct() + .collect(Collectors.toList()); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(TemplateJsonEntity::getState, 1).in(TemplateJsonEntity::getId, flowIds); + List jsonEntityList = templateJsonService.list(wrapper); + + for (TemplateNodeEntity triggerNode : triggerNodeList) { + String flowId = triggerNode.getFlowId(); + TemplateJsonEntity jsonEntity = jsonEntityList.stream() + .filter(e -> ObjectUtil.equals(e.getId(), flowId)).findFirst().orElse(null); + if (null == jsonEntity) { + continue; + } + try { + triggerUtil.msgTrigger(triggerNode, userInfo); + } catch (Exception e) { + log.error("通知触发异常", e); + // triggerUtil.createErrorRecord(); + } + } + } + return ActionResult.success(); + } + + @Override + public List getTriggerDataModel(TriggerDataFo fo) { + return triggerUtil.getTriggerDataModel(fo); + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-controller/src/main/java/com/yunzhupaas/flowable/controller/TriggerTaskController.java b/yunzhupaas-flowable/yunzhupaas-flowable-controller/src/main/java/com/yunzhupaas/flowable/controller/TriggerTaskController.java new file mode 100644 index 0000000..aae404a --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-controller/src/main/java/com/yunzhupaas/flowable/controller/TriggerTaskController.java @@ -0,0 +1,130 @@ +package com.yunzhupaas.flowable.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.flowable.entity.TemplateEntity; +import com.yunzhupaas.flowable.entity.TemplateJsonEntity; +import com.yunzhupaas.flowable.entity.TriggerTaskEntity; +import com.yunzhupaas.flowable.model.monitor.MonitorModel; +import com.yunzhupaas.flowable.model.trigger.TriggerInfoListModel; +import com.yunzhupaas.flowable.model.trigger.TriggerPagination; +import com.yunzhupaas.flowable.model.trigger.TriggerTaskModel; +import com.yunzhupaas.flowable.service.TemplateJsonService; +import com.yunzhupaas.flowable.service.TemplateService; +import com.yunzhupaas.flowable.service.TriggerTaskService; +import com.yunzhupaas.flowable.util.TriggerUtil; +import com.yunzhupaas.util.JsonUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 任务流程 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/21 9:57 + */ +@Tag(name = "任务流程实例", description = "triggerTask") +@RestController +@RequestMapping("/api/workflow/trigger/task") +@Slf4j +public class TriggerTaskController { + @Autowired + private TriggerTaskService triggerTaskService; + @Autowired + private TriggerUtil triggerUtil; + @Autowired + private TemplateJsonService templateJsonService; + @Autowired + private TemplateService templateService; + + /** + * 获取任务下的触发记录 + * + * @param taskId 任务主键 + */ + @Operation(summary = "获取任务下的触发记录") + @GetMapping("/List") + public ActionResult list(@RequestParam("taskId") String taskId, @RequestParam("nodeCode") String nodeCode) { + List list = triggerTaskService.getListByTaskId(taskId, nodeCode); + return ActionResult.success(list); + } + + /** + * 任务流程列表 + * + * @param pagination 分页参数 + */ + @Operation(summary = "任务流程列表") + @GetMapping + public ActionResult list(TriggerPagination pagination) { + List list = triggerTaskService.getList(pagination); + + List flowIds = list.stream().map(TriggerTaskEntity::getFlowId).collect(Collectors.toList()); + List versionList = new ArrayList<>(); + List templateList = new ArrayList<>(); + if (CollectionUtil.isNotEmpty(flowIds)) { + versionList = templateJsonService.listByIds(flowIds); + List templateIds = versionList.stream().map(TemplateJsonEntity::getTemplateId) + .collect(Collectors.toList()); + templateList = templateService.listByIds(templateIds); + } + List voList = JsonUtil.getJsonToList(list, TriggerTaskModel.class); + for (TriggerTaskModel model : voList) { + model.setIsRetry(ObjectUtil.equals(model.getParentId(), "0") ? 0 : 1); + TemplateJsonEntity version = versionList.stream() + .filter(e -> ObjectUtil.equals(model.getFlowId(), e.getId())).findFirst().orElse(null); + if (null != version) { + TemplateEntity template = templateList.stream() + .filter(e -> ObjectUtil.equals(version.getTemplateId(), e.getId())).findFirst().orElse(null); + if (null != template) { + model.setTemplateStatus(template.getStatus()); + } + } + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(voList, paginationVO); + } + + /** + * 重试 + * + * @param id 主键 + */ + @Operation(summary = "重试") + @PostMapping("/Retry/{id}") + @SaCheckPermission(value = { "workFlow.flowMonitor" }) + public ActionResult retry(@PathVariable("id") String id) throws Exception { + try { + triggerTaskService.retry(id); + } catch (Exception e) { + // triggerUtil.createErrorRecord(); + throw e; + } + return ActionResult.success(MsgCode.SU005.get()); + } + + /** + * 批量删除 + * + * @param model 参数 + */ + @Operation(summary = "批量删除") + @DeleteMapping + @SaCheckPermission(value = { "workFlow.flowMonitor" }) + public ActionResult delete(@RequestBody MonitorModel model) { + triggerTaskService.batchDelete(model.getIds()); + return ActionResult.success(MsgCode.SU003.get()); + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-controller/src/main/java/com/yunzhupaas/flowable/controller/TriggerWebHookController.java b/yunzhupaas-flowable/yunzhupaas-flowable-controller/src/main/java/com/yunzhupaas/flowable/controller/TriggerWebHookController.java new file mode 100644 index 0000000..7f70fe7 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-controller/src/main/java/com/yunzhupaas/flowable/controller/TriggerWebHookController.java @@ -0,0 +1,204 @@ +package com.yunzhupaas.flowable.controller; + +import cn.hutool.core.util.ObjectUtil; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.TemplateJsonEntity; +import com.yunzhupaas.flowable.model.trigger.TriggerWebHookInfoVo; +import com.yunzhupaas.flowable.service.TemplateJsonService; +import com.yunzhupaas.flowable.util.TriggerUtil; +import com.yunzhupaas.util.*; +import org.apache.commons.codec.binary.Base64; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.nio.charset.StandardCharsets; +import java.util.*; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/21 15:39 + */ +@Tag(name = "webhook触发", description = "WebHook") +@RestController +@RequestMapping("/api/workflow/Hooks") +public class TriggerWebHookController { + @Autowired + private RedisUtil redisUtil; + @Autowired + private ConfigValueUtil configValueUtil; + + @Autowired + private TriggerUtil triggerUtil; + @Autowired + private TemplateJsonService templateJsonService; + + private static final String WEBHOOK_RED_KEY = "webhook_trigger"; + private static final long DEFAULT_CACHE_TIME = 60 * 5; + + @Operation(summary = "数据接收接口") + @Parameters({ + @Parameter(name = "id", description = "base64转码id", required = true), + @Parameter(name = "tenantId", description = "租户id", required = false) + }) + @PostMapping("/{id}") + @NoDataSourceBind + public ActionResult webhookTrigger(@PathVariable("id") String id, + @RequestParam(value = "tenantId", required = false) String tenantId, + @RequestBody Map body) throws Exception { + String idReal = new String(Base64.decodeBase64(id.getBytes(StandardCharsets.UTF_8))); + if (configValueUtil.isMultiTenancy()) { + // 判断是不是从外面直接请求 + if (StringUtil.isNotEmpty(tenantId)) { + // 切换成租户库 + try { + TenantDataSourceUtil.switchTenant(tenantId); + } catch (Exception e) { + return ActionResult.fail(MsgCode.LOG105.get()); + } + } + } + try { + triggerUtil.handleWebhookTrigger(idReal, tenantId, body); + } catch (Exception e) { + // triggerUtil.createErrorRecord(); + throw e; + } + return ActionResult.success(); + } + + @Operation(summary = "获取webhookUrl") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @GetMapping("/getUrl") + public ActionResult getWebhookUrl(@RequestParam("id") String id) { + String enCodeBase64 = new String(Base64.encodeBase64(id.getBytes(StandardCharsets.UTF_8))); + String randomStr = UUID.randomUUID().toString().substring(0, 5); + TriggerWebHookInfoVo vo = new TriggerWebHookInfoVo(); + vo.setEnCodeStr(enCodeBase64); + vo.setRandomStr(randomStr); + vo.setWebhookUrl("/api/workflow/Hooks/" + enCodeBase64); + vo.setRequestUrl("/api/workflow/Hooks/" + enCodeBase64 + "/params/" + randomStr); + return ActionResult.success(vo); + } + + @Operation(summary = "通过get接口获取参数") + @Parameters({ + @Parameter(name = "id", description = "base64转码id", required = true), + @Parameter(name = "randomStr", description = "获取webhookUrl提供的随机字符", required = true) + }) + @GetMapping("/{id}/params/{randomStr}") + @NoDataSourceBind + public ActionResult getWebhookParams(@PathVariable("id") String id, + @PathVariable("randomStr") String randomStr) throws WorkFlowException { + insertRedis(id, randomStr, new HashMap<>()); + return ActionResult.success(); + } + + @Operation(summary = "通过post接口获取参数") + @Parameters({ + @Parameter(name = "id", description = "base64转码id", required = true), + @Parameter(name = "randomStr", description = "获取webhookUrl提供的随机字符", required = true) + }) + @PostMapping("/{id}/params/{randomStr}") + @NoDataSourceBind + public ActionResult postWebhookParams(@PathVariable("id") String id, + @PathVariable("randomStr") String randomStr, + @RequestBody Map obj) throws WorkFlowException { + insertRedis(id, randomStr, new HashMap<>(obj)); + return ActionResult.success(); + } + + /** + * 助手id查询信息,写入缓存 + * + * @param id + * @param randomStr + * @param resultMap + * @throws WorkFlowException + */ + private void insertRedis(String id, String randomStr, Map resultMap) throws WorkFlowException { + String idReal = new String(Base64.decodeBase64(id.getBytes(StandardCharsets.UTF_8))); + String key1 = WEBHOOK_RED_KEY + "_" + idReal + "_" + randomStr; + if (!redisUtil.exists(key1)) { + throw new WorkFlowException(MsgCode.VS016.get()); + } + String tenantId = redisUtil.getString(key1).toString(); + + if (configValueUtil.isMultiTenancy()) { + // 判断是不是从外面直接请求 + if (StringUtil.isNotEmpty(tenantId)) { + // 切换成租户库 + try { + TenantDataSourceUtil.switchTenant(tenantId); + } catch (Exception e) { + throw new WorkFlowException(MsgCode.LOG105.get()); + } + } + } + TemplateJsonEntity jsonEntity = templateJsonService.getById(idReal == null ? "" : idReal); + if (!ObjectUtil.equals(jsonEntity.getState(), 1)) { + throw new WorkFlowException("版本未启用"); + } + Map parameterMap = new HashMap<>(ServletUtil.getRequest().getParameterMap()); + for (String key : parameterMap.keySet()) { + String[] parameterValues = ServletUtil.getRequest().getParameterValues(key); + if (parameterValues.length == 1) { + parameterMap.put(key, parameterValues[0]); + } else { + parameterMap.put(key, parameterValues); + } + } + resultMap.putAll(parameterMap); + if (resultMap.keySet().size() > 0) { + redisUtil.insert(WEBHOOK_RED_KEY + "_" + randomStr, resultMap, DEFAULT_CACHE_TIME); + redisUtil.remove(key1); + } + } + + @Operation(summary = "请求参数添加触发接口") + @Parameters({ + @Parameter(name = "id", description = "base64转码id", required = true), + @Parameter(name = "randomStr", description = "获取webhookUrl提供的随机字符", required = true) + }) + @GetMapping("/{id}/start/{randomStr}") + public ActionResult start(@PathVariable("id") String id, + @PathVariable("randomStr") String randomStr) { + redisUtil.remove(WEBHOOK_RED_KEY + "_" + randomStr); + redisUtil.insert(WEBHOOK_RED_KEY + "_" + id + "_" + randomStr, UserProvider.getUser().getTenantId(), + DEFAULT_CACHE_TIME); + return ActionResult.success(); + } + + @Operation(summary = "获取缓存的接口参数") + @Parameters({ + @Parameter(name = "randomStr", description = "获取webhookUrl提供的随机字符", required = true) + }) + @GetMapping("/getParams/{randomStr}") + public ActionResult getRedisParams(@PathVariable("randomStr") String randomStr) { + Map mapRedis = new HashMap<>(); + String key = WEBHOOK_RED_KEY + "_" + randomStr; + if (redisUtil.exists(key)) { + mapRedis = redisUtil.getMap(key); + } + List> list = new ArrayList<>(); + for (String redisKey : mapRedis.keySet()) { + Map map = new HashMap<>(); + map.put("id", redisKey); + map.put("fullName", mapRedis.get(redisKey)); + list.add(map); + } + return ActionResult.success(list); + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-controller/src/main/java/com/yunzhupaas/flowable/controller/WorkflowMonitorController.java b/yunzhupaas-flowable/yunzhupaas-flowable-controller/src/main/java/com/yunzhupaas/flowable/controller/WorkflowMonitorController.java new file mode 100644 index 0000000..b209a2b --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-controller/src/main/java/com/yunzhupaas/flowable/controller/WorkflowMonitorController.java @@ -0,0 +1,175 @@ +package com.yunzhupaas.flowable.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.util.ObjectUtil; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.TaskEntity; +import com.yunzhupaas.flowable.model.monitor.MonitorModel; +import com.yunzhupaas.flowable.model.monitor.MonitorVo; +import com.yunzhupaas.flowable.model.task.FlowModel; +import com.yunzhupaas.flowable.model.task.TaskPagination; +import com.yunzhupaas.flowable.service.TaskService; +import com.yunzhupaas.flowable.util.ServiceUtil; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.util.JsonUtil; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.LinkedList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 流程监控 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/15 10:15 + */ +@Tag(name = "流程监控", description = "Monitor") +@RestController +@RequestMapping("/api/workflow/monitor") +@RequiredArgsConstructor +public class WorkflowMonitorController { + @Autowired + private TaskService taskService; + @Autowired + private ServiceUtil serviceUtil; + + /** + * 监控列表 + * + * @param pagination 分页参数 + */ + @Operation(summary = "流程监控列表") + @GetMapping + public ActionResult> list(TaskPagination pagination) { + List list = taskService.getMonitorList(pagination); + List userList = serviceUtil + .getUserName(list.stream().map(TaskEntity::getCreatorUserId).collect(Collectors.toList())); + List voList = new LinkedList<>(); + for (TaskEntity taskEntity : list) { + MonitorVo vo = JsonUtil.getJsonToBean(taskEntity, MonitorVo.class); + UserEntity user = userList.stream().filter(t -> t.getId().equals(taskEntity.getCreatorUserId())).findFirst() + .orElse(null); + vo.setCreatorUser(user != null ? user.getRealName() + "/" + user.getAccount() : ""); + vo.setFlowUrgent(taskEntity.getUrgent()); + if (ObjectUtil.equals(taskEntity.getIsFile(), 0)) { + vo.setIsFile("否"); + } else if (ObjectUtil.equals(taskEntity.getIsFile(), 1)) { + vo.setIsFile("是"); + } else { + vo.setIsFile(""); + } + voList.add(vo); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(voList, paginationVO); + } + + /** + * 批量删除流程监控 + * + * @param model 参数 + */ + @Operation(summary = "批量删除流程监控") + @DeleteMapping + @SaCheckPermission(value = { "workFlow.flowMonitor" }) + public ActionResult delete(@RequestBody MonitorModel model) throws Exception { + taskService.deleteBatch(model.getIds()); + return ActionResult.success(MsgCode.SU003.get()); + } + + /** + * 判断是否存在异步子流程 + * + * @param id 任务主键 + */ + @Operation(summary = "判断是否存在异步子流程") + @GetMapping("/AnySubFlow/{id}") + public ActionResult pause(@PathVariable("id") String id) { + return ActionResult.success(taskService.checkAsync(id)); + } + + /** + * 暂停 + * + * @param id 主键 + * @param flowModel 参数 + */ + @Operation(summary = "暂停") + @PostMapping("/Pause/{id}") + @SaCheckPermission(value = { "workFlow.flowMonitor" }) + public ActionResult pause(@PathVariable("id") String id, @RequestBody FlowModel flowModel) + throws WorkFlowException { + taskService.pause(id, flowModel, true); + return ActionResult.success(MsgCode.WF074.get()); + } + + /** + * 恢复 + * + * @param id 主键 + * @param flowModel 参数 + */ + @Operation(summary = "恢复") + @PostMapping("/Reboot/{id}") + @SaCheckPermission(value = { "workFlow.flowMonitor" }) + public ActionResult reboot(@PathVariable("id") String id, @RequestBody FlowModel flowModel) + throws WorkFlowException { + taskService.pause(id, flowModel, false); + return ActionResult.success(MsgCode.WF016.get()); + } + + /** + * 终止 + * + * @param id 任务主键 + * @param flowModel 参数 + */ + @Operation(summary = "终止") + @PostMapping("/Cancel/{id}") + @SaCheckPermission(value = { "workFlow.flowMonitor" }) + public ActionResult cancel(@PathVariable("id") String id, @RequestBody FlowModel flowModel) + throws WorkFlowException { + taskService.cancel(id, flowModel, true); + return ActionResult.success(MsgCode.SU009.get()); + } + + /** + * 复活 + * + * @param id 任务主键 + * @param flowModel 参数 + */ + @Operation(summary = "复活") + @PostMapping("/Activate/{id}") + @SaCheckPermission(value = { "workFlow.flowMonitor" }) + public ActionResult activate(@PathVariable("id") String id, @RequestBody FlowModel flowModel) + throws WorkFlowException { + taskService.cancel(id, flowModel, false); + return ActionResult.success(MsgCode.WF013.get()); + } + + /** + * 指派 + * + * @param id 主键 + * @param flowModel 参数 + */ + @Operation(summary = "指派") + @PostMapping("/Assign/{id}") + @SaCheckPermission(value = { "workFlow.flowMonitor" }) + public ActionResult assign(@PathVariable("id") String id, @RequestBody FlowModel flowModel) + throws WorkFlowException { + taskService.assign(id, flowModel); + return ActionResult.success(MsgCode.WF010.get()); + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/pom.xml b/yunzhupaas-flowable/yunzhupaas-flowable-entity/pom.xml new file mode 100644 index 0000000..c9174dc --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/pom.xml @@ -0,0 +1,27 @@ + + + + yunzhupaas-flowable + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-flowable-entity + + + + com.yunzhupaas + yunzhupaas-common-all + ${project.version} + + + com.yunzhupaas + yunzhupaas-permission-entity + ${project.version} + + + + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/CandidatesEntity.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/CandidatesEntity.java new file mode 100644 index 0000000..4f8a63b --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/CandidatesEntity.java @@ -0,0 +1,55 @@ +package com.yunzhupaas.flowable.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/18 15:50 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@TableName("workflow_candidates") +public class CandidatesEntity extends SuperExtendEntity { + /** + * 节点编码 + */ + @TableField("f_node_code") + private String nodeCode; + /** + * 任务id + */ + @TableField("f_task_id") + private String taskId; + /** + * 审批人id + */ + @TableField("f_handle_id") + private String handleId; + /** + * 审批人账号 + */ + @TableField("f_account") + private String account; + /** + * 候选人 + */ + @TableField("f_candidates") + private String candidates; + /** + * 经办主键 + */ + @TableField("f_operator_id") + private String operatorId; + /** + * 审批类型(1-候选人 2-异常处理人) + */ + @TableField("f_type") + private Integer type; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/CirculateEntity.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/CirculateEntity.java new file mode 100644 index 0000000..e746576 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/CirculateEntity.java @@ -0,0 +1,62 @@ +package com.yunzhupaas.flowable.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2024/4/25 下午6:12 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@TableName("workflow_circulate") +public class CirculateEntity extends SuperExtendEntity { + + /** + * 用户主键 + */ + @TableField("f_user_id") + private String userId; + + /** + * 任务主键 + */ + @TableField("f_task_id") + private String taskId; + + /** + * 节点编号 + */ + @TableField("f_node_code") + private String nodeCode; + + /** + * 节点名称 + */ + @TableField("f_node_name") + private String nodeName; + + /** + * 节点主键 + */ + @TableField("f_node_id") + private String nodeId; + + /** + * 经办主键 + */ + @TableField("f_operator_id") + private String operatorId; + + /** + * 是否已读 + */ + @TableField("f_read") + private Integer circulateRead; +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/CommentEntity.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/CommentEntity.java new file mode 100644 index 0000000..dd682d6 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/CommentEntity.java @@ -0,0 +1,56 @@ +package com.yunzhupaas.flowable.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +/** + * 流程评论 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Data +@TableName("workflow_comment") +public class CommentEntity extends SuperExtendEntity.SuperExtendEnabledEntity { + + /** + * 任务主键 + */ + @TableField("F_TASK_ID") + private String taskId; + + /** + * 评论id + */ + @TableField("F_REPLY_ID") + private String replyId; + + /** + * 文本 + */ + @TableField("F_TEXT") + private String text; + + /** + * 图片 + */ + @TableField("F_IMAGE") + private String image; + + /** + * 附件 + */ + @TableField("F_FILE") + private String files; + + /** + * 评论删除 + */ + @TableField("f_delete_show") + private Integer deleteShow; + +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/CommonEntity.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/CommonEntity.java new file mode 100644 index 0000000..76a6020 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/CommonEntity.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.flowable.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 常用流程 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/22 20:19 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@TableName("workflow_common") +public class CommonEntity extends SuperExtendEntity { + /** + * 对象主键 + */ + @TableField("F_FLOW_ID") + private String flowId; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/DelegateEntity.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/DelegateEntity.java new file mode 100644 index 0000000..0701ff6 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/DelegateEntity.java @@ -0,0 +1,65 @@ +package com.yunzhupaas.flowable.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 流程委托 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@TableName("workflow_delegate") +public class DelegateEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 委托人id + */ + @TableField("F_USER_ID") + private String userId; + /** + * 委托人 + */ + @TableField("F_USER_NAME") + private String userName; + + /** + * 委托类型(0-发起委托,1-审批委托) + */ + @TableField("F_TYPE") + private Integer type; + + /** + * 委托流程 + */ + @TableField("F_FLOW_ID") + private String flowId; + /** + * 委托流程名称 + */ + @TableField("F_FLOW_NAME") + private String flowName; + + /** + * 开始时间 + */ + @TableField("F_START_TIME") + private Date startTime; + + /** + * 结束时间 + */ + @TableField("F_END_TIME") + private Date endTime; + +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/DelegateInfoEntity.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/DelegateInfoEntity.java new file mode 100644 index 0000000..639a845 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/DelegateInfoEntity.java @@ -0,0 +1,40 @@ +package com.yunzhupaas.flowable.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/2 11:54 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@TableName("workflow_delegate_info") +public class DelegateInfoEntity extends SuperExtendEntity { + /** + * 委托主键 + */ + @TableField("F_DELEGATE_ID") + private String delegateId; + /** + * 被委托人id + */ + @TableField("F_TO_USER_ID") + private String toUserId; + /** + * 被委托人 + */ + @TableField("F_TO_USER_NAME") + private String toUserName; + /** + * 状态(0.待确认 1.已接受 2.已拒绝) + */ + @TableField("F_STATUS") + private Integer status; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/LaunchUserEntity.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/LaunchUserEntity.java new file mode 100644 index 0000000..12e6e72 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/LaunchUserEntity.java @@ -0,0 +1,55 @@ +package com.yunzhupaas.flowable.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 流程发起用户信息 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/18 9:36 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@TableName("workflow_launch_user") +public class LaunchUserEntity extends SuperExtendEntity { + /** + * 组织主键 + */ + @TableField("f_organize_id") + private String organizeId; + /** + * 岗位主键 + */ + @TableField("f_position_id") + private String positionId; + /** + * 主管主键 + */ + @TableField("f_manager_id") + private String managerId; + /** + * 上级用户 + */ + @TableField("f_superior") + private String superior; + /** + * 下属用户 + */ + @TableField("f_subordinate") + private String subordinate; + /** + * 任务主键 + */ + @TableField("f_task_id") + private String taskId; + /** + * 公司下所有部门 + */ + @TableField("f_department") + private String department; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/NodeRecordEntity.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/NodeRecordEntity.java new file mode 100644 index 0000000..3a7c790 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/NodeRecordEntity.java @@ -0,0 +1,45 @@ +package com.yunzhupaas.flowable.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/6/25 17:00 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@TableName("workflow_node_record") +public class NodeRecordEntity extends SuperExtendEntity { + /** + * 任务id + */ + @TableField("F_TASK_ID") + private String taskId; + /** + * 节点id + */ + @TableField("F_NODE_ID") + private String nodeId; + /** + * 节点编码 + */ + @TableField("F_NODE_CODE") + private String nodeCode; + /** + * 节点名称 + */ + @TableField("F_NODE_NAME") + private String nodeName; + /** + * 节点状态,1-已提交 2-已通过 3-已拒绝 4-审批中 5-已退回 6-已撤回 7-等待中 + */ + @TableField("F_NODE_STATUS") + private Integer nodeStatus; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/OperatorEntity.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/OperatorEntity.java new file mode 100644 index 0000000..f07f148 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/OperatorEntity.java @@ -0,0 +1,112 @@ +package com.yunzhupaas.flowable.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 经办 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/18 15:10 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@TableName("workflow_operator") +public class OperatorEntity extends SuperExtendEntity { + /** + * 节点名称 + */ + @TableField("f_node_name") + private String nodeName; + /** + * 节点编码 + */ + @TableField("f_node_code") + private String nodeCode; + /** + * 任务id + */ + @TableField("f_task_id") + private String taskId; + /** + * 节点id,更新节点是先删除后添加,所以节点id待删除 + */ + @TableField("f_node_id") + private String nodeId; + /** + * 加签经办父级id + */ + @TableField("f_parent_id") + private String parentId; + /** + * 处理时间 + */ + @TableField("f_handle_time") + private Date handleTime; + /** + * 处理人id + */ + @TableField("f_handle_id") + private String handleId; + /** + * 全部处理人 + */ + @TableField("f_handle_all") + private String handleAll; + /** + * 处理状态,同意、拒绝 + */ + @TableField("f_handle_status") + private Integer handleStatus; + /** + * 处理参数,加签信息 + */ + @TableField("f_handle_parameter") + private String handleParameter; + /** + * 开始处理时间 + */ + @TableField("f_start_handle_time") + private Date startHandleTime; + /** + * 签收时间 + */ + @TableField("f_sign_time") + private Date signTime; + /** + * 截止时间 + */ + @TableField("f_duedate") + private Date duedate; + /** + * 状态 + */ + @TableField("f_status") + private Integer status; + /** + * 是否完成,有操作(如加签、同意等)变1,加签经办完成后变0 + */ + @TableField("f_completion") + private Integer completion; + /** + * 流程引擎类型;1.flowable,2,activity,3.camunda + */ + @TableField("f_engine_type") + private Integer engineType; + /** + * 草稿数据 + */ + @TableField("f_draft_data") + private String draftData; + /** + * 是否办理节点(0否 1是) + */ + @TableField("f_is_processing") + private Integer isProcessing; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/RecordEntity.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/RecordEntity.java new file mode 100644 index 0000000..bd354d1 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/RecordEntity.java @@ -0,0 +1,92 @@ +package com.yunzhupaas.flowable.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 经办记录 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/23 9:13 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@TableName("workflow_record") +public class RecordEntity extends SuperExtendEntity { + /** + * 节点名称 + */ + @TableField("f_node_name") + private String nodeName; + /** + * 节点编码 + */ + @TableField("f_node_code") + private String nodeCode; + /** + * 节点id + */ + @TableField("f_node_id") + private String nodeId; + /** + * 经办类型 + */ + @TableField("f_handle_type") + private Integer handleType; + /** + * 经办人员 + */ + @TableField("f_handle_id") + private String handleId; + /** + * 经办时间 + */ + @TableField("f_handle_time") + private Date handleTime; + /** + * 经办理由 + */ + @TableField("f_handle_opinion") + private String handleOpinion; + /** + * 经办主键 + */ + @TableField("f_operator_id") + private String operatorId; + /** + * 任务id + */ + @TableField("f_task_id") + private String taskId; + /** + * 签名图片 + */ + @TableField("f_sign_img") + private String signImg; + /** + * 状态,0.进行数据 1.加签数据 3.已办不显示数据 -1.作废 + */ + @TableField("f_status") + private Integer status; + /** + * 流转操作人 + */ + @TableField("f_handle_user_id") + private String handleUserId; + /** + * 经办文件 + */ + @TableField("f_file_list") + private String fileList; + /** + * 拓展字段 + */ + @TableField("f_expand_field") + private String expandField; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/RejectDataEntity.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/RejectDataEntity.java new file mode 100644 index 0000000..dd37598 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/RejectDataEntity.java @@ -0,0 +1,35 @@ +package com.yunzhupaas.flowable.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/8 17:57 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@TableName("workflow_reject_data") +public class RejectDataEntity extends SuperExtendEntity { + /** + * 任务json + */ + @TableField("F_TASK_JSON") + private String taskJson; + /** + * 经办json + */ + @TableField("F_OPERATOR_JSON") + private String operatorJson; + /** + * 节点编码 + */ + @TableField("F_NODE_CODE") + private String nodeCode; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/RevokeEntity.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/RevokeEntity.java new file mode 100644 index 0000000..c397294 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/RevokeEntity.java @@ -0,0 +1,35 @@ +package com.yunzhupaas.flowable.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 撤销 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/8/23 17:27 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@TableName("workflow_revoke") +public class RevokeEntity extends SuperExtendEntity { + /** + * 任务主键 + */ + @TableField("F_TASK_ID") + private String taskId; + /** + * 撤销任务主键 + */ + @TableField("F_REVOKE_TASK_ID") + private String revokeTaskId; + /** + * 表单数据 + */ + @TableField("F_FORM_DATA") + private String formData; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/SubtaskDataEntity.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/SubtaskDataEntity.java new file mode 100644 index 0000000..77d69c4 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/SubtaskDataEntity.java @@ -0,0 +1,35 @@ +package com.yunzhupaas.flowable.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 子流程发起参数(依次发起) + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/12/6 15:27 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@TableName("workflow_subtask_data") +public class SubtaskDataEntity extends SuperExtendEntity { + /** + * 子流程发起参数 + */ + @TableField("F_SUBTASK_JSON") + private String subtaskJson; + /** + * 父流程id + */ + @TableField("F_PARENT_ID") + private String parentId; + /** + * 节点编码 + */ + @TableField("F_NODE_CODE") + private String nodeCode; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/TaskEntity.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/TaskEntity.java new file mode 100644 index 0000000..a27acf5 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/TaskEntity.java @@ -0,0 +1,180 @@ +package com.yunzhupaas.flowable.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 流程引擎 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年7月11日 上午9:18 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@TableName("workflow_task") +public class TaskEntity extends SuperExtendEntity { + + /** + * 任务编码 + */ + @TableField("F_EN_CODE") + private String enCode; + + /** + * 任务标题 + */ + @TableField("F_FULL_NAME") + private String fullName; + + /** + * 流程名称 + */ + @TableField("F_FLOW_NAME") + private String flowName; + + /** + * 流程编码 + */ + @TableField("F_FLOW_CODE") + private String flowCode; + + /** + * 任务状态 + */ + @TableField("F_STATUS") + private Integer status; + /** + * 历史状态 + */ + @TableField("F_HIS_STATUS") + private Integer hisStatus; + + /** + * 流程分类 + */ + @TableField("F_FLOW_CATEGORY") + private String flowCategory; + + /** + * 流程类型 + */ + @TableField("F_FLOW_TYPE") + private Integer flowType; + + /** + * 流程版本 + */ + @TableField("F_FLOW_VERSION") + private String flowVersion; + + /** + * 同步异步(0:同步,1:异步) + */ + @TableField("F_IS_ASYNC") + private Integer isAsync; + + /** + * 子流程参数 + */ + @TableField("F_SUB_PARAMETER") + private String subParameter; + + /** + * 父级实例id + */ + @TableField("F_PARENT_ID") + private String parentId; + + /** + * 紧急程度 + */ + @TableField("F_URGENT") + private Integer urgent; + + /** + * 流程主键 + */ + @TableField("F_TEMPLATE_ID") + private String templateId; + + /** + * 流程版本主键 + */ + @TableField("F_FLOW_ID") + private String flowId; + + /** + * 流程引擎实例id + */ + @TableField("F_INSTANCE_ID") + private String instanceId; + /** + * 流程引擎类型;1.flowable,2,activity,3.camunda + */ + @TableField("F_ENGINE_TYPE") + private Integer engineType; + + /** + * 委托用户 + */ + @TableField("f_delegate_user_id") + private String delegateUserId; + /** + * 开始时间 + */ + @TableField("f_start_time") + private Date startTime; + /** + * 结束时间 + */ + @TableField("f_end_time") + private Date endTime; + /** + * 当前节点名称 + */ + @TableField("f_current_node_name") + private String currentNodeName; + /** + * 当前节点编码 + */ + @TableField("f_current_node_code") + private String currentNodeCode; + /** + * 冻结审批,退回前的任务、经办的信息 + */ + @TableField("f_reject_data_id") + private String rejectDataId; + /** + * 子流程节点编码 + */ + @TableField("f_sub_code") + private String subCode; + /** + * 全局参数 + */ + @TableField("f_global_parameter") + private String globalParameter; + /** + * 是否能恢复(0:能,1:不能) + */ + @TableField("F_RESTORE") + private Integer isRestore; + /** + * 是否归档(null:未配置,0:未归档,1:已归档) + */ + @TableField("F_IS_FILE") + private Integer isFile; + /** + * 类型(0-功能 1-发起) + */ + @TableField("F_TYPE") + private Integer type; +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/TaskLineEntity.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/TaskLineEntity.java new file mode 100644 index 0000000..3b2a87f --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/TaskLineEntity.java @@ -0,0 +1,35 @@ +package com.yunzhupaas.flowable.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 任务条件 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/8/23 17:27 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@TableName("workflow_task_line") +public class TaskLineEntity extends SuperExtendEntity { + /** + * 任务主键 + */ + @TableField("F_TASK_ID") + private String taskId; + /** + * 线的键 + */ + @TableField("F_LINE_KEY") + private String lineKey; + /** + * 线的值 + */ + @TableField("F_LINE_VALUE") + private String lineValue; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/TemplateEntity.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/TemplateEntity.java new file mode 100644 index 0000000..94cdfbf --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/TemplateEntity.java @@ -0,0 +1,97 @@ +package com.yunzhupaas.flowable.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +/** + * 流程引擎 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年7月11日 上午9:18 + */ +@Data +@TableName("workflow_template") +public class TemplateEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 流程主版本 + */ + @TableField("F_FLOW_ID") + private String flowId; + /** + * 流程主版本 + */ + @TableField("F_VERSION") + private String version; + + /** + * 流程编码 + */ + @TableField("F_EN_CODE") + private String enCode; + + /** + * 流程名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + + /** + * 流程类型,0.标准 1.简流 + */ + @TableField("F_TYPE") + private Integer type; + + /** + * 流程分类 + */ + @TableField("F_CATEGORY") + private String category; + + /** + * 图标 + */ + @TableField("F_ICON") + private String icon; + + /** + * 图标背景色 + */ + @TableField("F_ICON_BACKGROUND") + private String iconBackground; + + /** + * 流程设置 + */ + @TableField("F_FLOW_CONFIG") + private String flowConfig; + + /** + * 流程权限(1全局 2权限) + */ + @TableField("F_VISIBLE_TYPE") + private Integer visibleType; + + @TableField("F_FLOWABLE_ID") + private String flowableId; + @TableField("F_ACTIVITI_ID") + private String activitiId; + @TableField("F_CAMUNDA_ID") + private String camundaId; + + /** + * 流程显示类型(0-全局 1-流程 2-菜单) + */ + @TableField("F_SHOW_TYPE") + private Integer showType; + /** + * 状态(0.未上架,1.上架,2.下架-继续审批,3.下架-隐藏审批) + */ + @TableField("F_STATUS") + private Integer status; +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/TemplateJsonEntity.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/TemplateJsonEntity.java new file mode 100644 index 0000000..ac19fd3 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/TemplateJsonEntity.java @@ -0,0 +1,66 @@ +package com.yunzhupaas.flowable.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +/** + * 流程引擎 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年7月11日 上午9:18 + */ +@Data +@TableName("workflow_version") +public class TemplateJsonEntity extends SuperExtendEntity { + + /** + * 流程模板id + */ + @TableField("F_TEMPLATE_ID") + private String templateId; + + /** + * 流程版本 + */ + @TableField("F_VERSION") + private String version; + + /** + * 状态(0.设计,1.启用,2.历史) + */ + @TableField("F_STATUS") + private Integer state; + + /** + * 流程模板 + */ + @TableField("F_XML") + private String flowXml; + + /** + * flowable部署ID + */ + @TableField("f_flowable_id") + private String flowableId; + /** + * activiti部署ID + */ + @TableField("f_activiti_id") + private String activitiId; + /** + * camunda部署ID + */ + @TableField("f_camunda_id") + private String camundaId; + /** + * 消息配置id + */ + @TableField("f_send_config_ids") + private String sendConfigIds; + +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/TemplateNodeEntity.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/TemplateNodeEntity.java new file mode 100644 index 0000000..53247d0 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/TemplateNodeEntity.java @@ -0,0 +1,47 @@ +package com.yunzhupaas.flowable.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +/** + * 流程引擎 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年7月11日 上午9:18 + */ +@Data +@TableName("workflow_node") +public class TemplateNodeEntity extends SuperExtendEntity { + + /** + * 流程版本主键 + */ + @TableField("F_FLOW_ID") + private String flowId; + /** + * 表单主键 + */ + @TableField("f_form_id") + private String formId; + /** + * 节点类型 + */ + @TableField("f_node_type") + private String nodeType; + /** + * 节点编码 + */ + @TableField("f_node_code") + private String nodeCode; + /** + * 节点属性 + */ + @TableField("f_node_json") + private String nodeJson; + +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/TriggerRecordEntity.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/TriggerRecordEntity.java new file mode 100644 index 0000000..af47f03 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/TriggerRecordEntity.java @@ -0,0 +1,72 @@ +package com.yunzhupaas.flowable.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/10 17:06 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@TableName("workflow_trigger_record") +public class TriggerRecordEntity extends SuperExtendEntity { + /** + * 触发主键 + */ + @TableField("F_TRIGGER_ID") + private String triggerId; + /** + * 任务主键 + */ + @TableField("F_TASK_ID") + private String taskId; + /** + * 节点id + */ + @TableField("F_NODE_ID") + private String nodeId; + /** + * 节点编号 + */ + @TableField("F_NODE_CODE") + private String nodeCode; + /** + * 节点名称 + */ + @TableField("F_NODE_NAME") + private String nodeName; + /** + * 开始时间 + */ + @TableField("F_START_TIME") + private Date startTime; + /** + * 结束时间 + */ + @TableField("F_END_TIME") + private Date endTime; + /** + * 状态,0-通过 1-异常 + */ + @TableField("F_STATUS") + private Integer status; + /** + * 错误提示 + */ + @TableField("F_ERROR_TIP") + private String errorTip; + /** + * 错误数据 + */ + @TableField("F_ERROR_DATA") + private String errorData; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/TriggerTaskEntity.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/TriggerTaskEntity.java new file mode 100644 index 0000000..5d56341 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/entity/TriggerTaskEntity.java @@ -0,0 +1,93 @@ +package com.yunzhupaas.flowable.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 触发任务 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/10 16:52 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@TableName("workflow_trigger_task") +public class TriggerTaskEntity extends SuperExtendEntity { + /** + * 标题 + */ + @TableField("F_FULL_NAME") + private String fullName; + /** + * 重试任务开始时间 + */ + @TableField("F_PARENT_TIME") + private Date parentTime; + /** + * 重试任务主键id + */ + @TableField("F_PARENT_ID") + private String parentId; + /** + * 标准任务主键 + */ + @TableField("F_TASK_ID") + private String taskId; + /** + * 节点编码 + */ + @TableField("F_NODE_CODE") + private String nodeCode; + /** + * 节点id + */ + @TableField("F_NODE_ID") + private String nodeId; + /** + * 同步异步 + */ + @TableField("F_IS_ASYNC") + private Integer isAsync; + /** + * 开始时间 + */ + @TableField("F_START_TIME") + private Date startTime; + /** + * 模板id + */ + @TableField("F_FLOW_ID") + private String flowId; + /** + * 数据 + */ + @TableField("F_DATA") + private String data; + /** + * 数据主键 + */ + @TableField("F_DATA_ID") + private String dataId; + /** + * 引擎主键 + */ + @TableField("F_INSTANCE_ID") + private String instanceId; + /** + * 流程引擎类型;1.flowable,2,activity,3.camunda + */ + @TableField("F_ENGINE_TYPE") + private Integer engineType; + /** + * 状态 + */ + @TableField("F_STATUS") + private Integer status; + +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/enums/DivideRuleEnum.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/enums/DivideRuleEnum.java new file mode 100644 index 0000000..ffdadcf --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/enums/DivideRuleEnum.java @@ -0,0 +1,36 @@ +package com.yunzhupaas.flowable.enums; + +import lombok.Getter; + +/** + * 分流规则(网关类型) + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/19 9:21 + */ +@Getter +public enum DivideRuleEnum { + /** + * 根据条件多分支流转(包容网关) + */ + INCLUSION("inclusion"), + /** + * 根据条件单分支流转(排它网关) + */ + EXCLUSIVE("exclusive"), + /** + * 所有分支都流转(并行网关) + */ + PARALLEL("parallel"), + /** + * 选择分支 + */ + CHOOSE("choose"); + + private final String type; + + DivideRuleEnum(String type) { + this.type = type; + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/enums/ErrorRuleEnum.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/enums/ErrorRuleEnum.java new file mode 100644 index 0000000..a0caf82 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/enums/ErrorRuleEnum.java @@ -0,0 +1,76 @@ +package com.yunzhupaas.flowable.enums; + +/** + * 异常规则 + * + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/6/17 10:57 + */ +public enum ErrorRuleEnum { + /** + * 1.超级管理员 + */ + administrator(1, "超级管理员"), + /** + * 2.指定人员 + */ + initiator(2, "指定人员"), + /** + * 3.上一节点审批人指定处理人 + */ + node(3, "上一节点审批人指定处理人"), + /** + * 4.默认审批通过 + */ + pass(4, "默认审批通过"), + /** + * 5.无法提交 + */ + notSubmit(5, "无法提交"), + /** + * 6.发起者本人处理 + */ + creatorUserId(6, "发起者本人处理"); + + private int code; + private String message; + + ErrorRuleEnum(int code, String message) { + this.code = code; + this.message = message; + } + + /** + * 根据状态code获取枚举名称 + * + * @return + */ + public static ErrorRuleEnum getByCode(Integer code) { + for (ErrorRuleEnum status : ErrorRuleEnum.values()) { + if (status.getCode().equals(code)) { + return status; + } + } + return null; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/enums/ExtraRuleEnum.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/enums/ExtraRuleEnum.java new file mode 100644 index 0000000..ea22f1f --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/enums/ExtraRuleEnum.java @@ -0,0 +1,85 @@ +package com.yunzhupaas.flowable.enums; + +/** + * 附件条件 + * + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/6/14 16:50 + */ +public enum ExtraRuleEnum { + /** + * 无条件 + */ + unconditional(1, "无条件"), + /** + * 同一部门 + */ + organize(2, "同一部门"), + /** + * 同一岗位 + */ + position(3, "同一岗位"), + /** + * 发起人上级 + */ + manager(4, "发起人上级"), + /** + * 发起人下属 + */ + subordinate(5, "发起人下属"), + /** + * 同一公司 + */ + department(6, "同一公司"), + /** + * 同一角色 + */ + role(7, "同一角色"), + /** + * 同一分组 + */ + group(8, "同一分组"); + + private int code; + private String message; + + ExtraRuleEnum(int code, String message) { + this.code = code; + this.message = message; + } + + /** + * 根据状态code获取枚举名称 + * + * @return + */ + public static ExtraRuleEnum getByCode(Integer code) { + for (ExtraRuleEnum status : ExtraRuleEnum.values()) { + if (status.getCode().equals(code)) { + return status; + } + } + return null; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/enums/FlowMessageEnum.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/enums/FlowMessageEnum.java new file mode 100644 index 0000000..14de7c4 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/enums/FlowMessageEnum.java @@ -0,0 +1,46 @@ +package com.yunzhupaas.flowable.enums; + +/** + * 消息类型 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-29 上午9:18 + */ +public enum FlowMessageEnum { + //发起 + me(1, "me"), + //待签 + sign(2, "sign"), + //待办 + doing(3, "doing"), + //抄送 + circulate(4, "circulate"); + + private String message; + private int code; + + FlowMessageEnum(int code, String message) { + this.code = code; + this.message = message; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/enums/FlowRecordEnum.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/enums/FlowRecordEnum.java new file mode 100644 index 0000000..e870e93 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/enums/FlowRecordEnum.java @@ -0,0 +1,71 @@ +package com.yunzhupaas.flowable.enums; + +/** + * 工作流开发 + * + * @author 云筑产品开发平台组 + * @version V3.0.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public enum FlowRecordEnum { + + //拒绝 + reject(0, "拒绝"), + //同意 + audit(1, "同意"), + //提交 + submit(2, "提交"), + //撤回 + revoke(3, "撤回"), + //终止 + cancel(4, "终止"), + //指派 + assign(5, "指派"), + //加签 + copyId(6, "加签"), + //转办 + transfer(7, "转办"), + //变更 + change(8, "变更"), + //复活 + resurrection(9, "复活"), + //前加签 + befoCopyId(10, "前加签"), + //挂起 + suspend(11, "挂起"), + //恢复 + restore(12, "恢复"), + //转向 + swerve(13, "转向"), + //结束 + end(100, "结束"), + //节点撤回 + recall(-1, "节点撤回"); + + private Integer code; + private String message; + + FlowRecordEnum(Integer code, String message) { + this.code = code; + this.message = message; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/enums/FlowTaskOperatorEnum.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/enums/FlowTaskOperatorEnum.java new file mode 100644 index 0000000..a40919d --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/enums/FlowTaskOperatorEnum.java @@ -0,0 +1,99 @@ +package com.yunzhupaas.flowable.enums; + +/** + * 经办对象 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public enum FlowTaskOperatorEnum { + + /** + * 发起者主管 + */ + LaunchCharge(1, "发起者主管"), + /** + * 部门经理 + */ + DepartmentCharge(2, "部门经理"), + /** + * 发起者本人 + */ + InitiatorMe(3, "发起者本人"), + /** + * 变量 + */ + Variate(4, "变量"), + /** + * 环节 + */ + Tache(5, "环节"), + /** + * 指定人 + */ + Nominator(6, "指定人"), + /** + * 候选人 + */ + Candidate(7, "候选人"), + /** + * 服务 + */ + Serve(9, "服务"); + + + private Integer code; + private String message; + + FlowTaskOperatorEnum(Integer code, String message) { + this.code = code; + this.message = message; + } + + /** + * 根据状态code获取枚举名称 + * + * @return + */ + public static String getMessageByCode(String code) { + for (FlowTaskOperatorEnum status : FlowTaskOperatorEnum.values()) { + if (status.getCode().equals(code)) { + return status.message; + } + } + return null; + } + + /** + * 根据状态code获取枚举值 + * + * @return + */ + public static FlowTaskOperatorEnum getByCode(String code) { + for (FlowTaskOperatorEnum status : FlowTaskOperatorEnum.values()) { + if (status.getCode().equals(code)) { + return status; + } + } + return null; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/enums/NodeEnum.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/enums/NodeEnum.java new file mode 100644 index 0000000..d981166 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/enums/NodeEnum.java @@ -0,0 +1,96 @@ +package com.yunzhupaas.flowable.enums; + +public enum NodeEnum { + /** + * 开始 + */ + start("start"), + /** + * 结束 + */ + end("end"), + /** + * 全局 + */ + global("global"), + /** + * 子流程 + */ + subFlow("subFlow"), + /** + * 线 + */ + connect("connect"), + /** + * 审批 + */ + approver("approver"), + /** + * 办理 + */ + processing("processing"), + /** + * 触发事件 + */ + trigger("trigger"), + /** + * 事件触发 + */ + eventTrigger("eventTrigger"), + /** + * 定时触发 + */ + timeTrigger("timeTrigger"), + /** + * 通知触发 + */ + noticeTrigger("noticeTrigger"), + /** + * webhook触发 + */ + webhookTrigger("webhookTrigger"), + /** + * 获取数据 + */ + getData("getData"), + /** + * 新增数据 + */ + addData("addData"), + /** + * 更新数据 + */ + updateData("updateData"), + /** + * 删除数据 + */ + deleteData("deleteData"), + /** + * 数据接口 + */ + dataInterface("dataInterface"), + /** + * 消息通知 + */ + message("message"), + /** + * 发起审批 + */ + launchFlow("launchFlow"), + /** + * 创建日程 + */ + schedule("schedule"); + + private final String type; + + NodeEnum(String type) { + this.type = type; + } + + public String getType() { + return type; + } + +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/enums/OperatorStateEnum.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/enums/OperatorStateEnum.java new file mode 100644 index 0000000..6002e16 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/enums/OperatorStateEnum.java @@ -0,0 +1,49 @@ +package com.yunzhupaas.flowable.enums; + +import lombok.Getter; + +/** + * 经办类型 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/23 17:23 + */ +@Getter +public enum OperatorStateEnum { + + // 待去除 + WaitSign(0, "待签收"), + + Runing(1, "流转中"), + + AddSign(2, "加签"), + + Transfer(3, "转审"), + + Assigned(4, "指派"), + + Back(5, "退回"), + + Recall(6, "撤回"), + + Assist(7, "协办"), + + Revoke(8, "撤销"), + + TransferProcessing(9, "转办"), + + // 无用节点 + Futility(-1, "无用节点"), + // 用于嵌入的任务流程 + Waiting(-2, "未激活"); + + private Integer code; + private String message; + + OperatorStateEnum(Integer code, String message) { + this.code = code; + this.message = message; + } + +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/enums/PrintEnum.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/enums/PrintEnum.java new file mode 100644 index 0000000..3a0c9c2 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/enums/PrintEnum.java @@ -0,0 +1,69 @@ +package com.yunzhupaas.flowable.enums; + +/** + * 打印条件 + * + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/6/14 16:50 + */ +public enum PrintEnum { + /** + * 不限制 + */ + unconditional(1, "不限制"), + /** + * 节点结束 + */ + nodeEnd(2, "节点结束"), + /** + * 流程结束 + */ + flowEnd(3, "流程结束"), + /** + * 条件设置 + */ + conditions(4, "条件设置"); + + private int code; + private String message; + + PrintEnum(int code, String message) { + this.code = code; + this.message = message; + } + + /** + * 根据状态code获取枚举名称 + * + * @return + */ + public static PrintEnum getByCode(Integer code) { + for (PrintEnum status : PrintEnum.values()) { + if (status.getCode().equals(code)) { + return status; + } + } + return null; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/enums/RecordEnum.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/enums/RecordEnum.java new file mode 100644 index 0000000..1fc3231 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/enums/RecordEnum.java @@ -0,0 +1,60 @@ +package com.yunzhupaas.flowable.enums; + +import lombok.Getter; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/26 17:32 + */ +@Getter +public enum RecordEnum { + // 拒绝 + reject(0, "拒绝"), + // 同意 + audit(1, "同意"), + // 提交 + submit(2, "提交"), + // 退回 + back(3, "退回"), + // 撤回 + recall(4, "撤回"), + // 加签 + addSign(5, "加签"), + // 减签 + subtractSign(6, "减签"), + // 转审 + transfer(7, "转审"), + // 暂停 + pause(8, "暂停"), + // 重启 + reboot(9, "重启"), + // 复活 + activate(10, "复活"), + // 指派 + assign(11, "指派"), + // 催办 + press(12, "催办"), + // 协办 + assist(13, "协办"), + // 撤销 + revoke(14, "撤销"), + // 终止 + cancel(15, "终止"), + + auditRevoke(16, "同意撤销"), + + rejectRevoke(17, "拒绝撤销"), + + transferProcessing(18, "转办"); + + private Integer code; + private String message; + + RecordEnum(Integer code, String message) { + this.code = code; + this.message = message; + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/enums/TaskStatusEnum.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/enums/TaskStatusEnum.java new file mode 100644 index 0000000..326bb6c --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/enums/TaskStatusEnum.java @@ -0,0 +1,66 @@ +package com.yunzhupaas.flowable.enums; + +import lombok.Getter; + +/** + * 任务状态枚举 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/17 19:03 + */ +@Getter +public enum TaskStatusEnum { + /** + * 待提交 + */ + TO_BE_SUBMIT(0, "待提交"), + /** + * 进行中 + */ + RUNNING(1, "进行中"), + /** + * 已通过 + */ + PASSED(2, "已通过"), + /** + * 已拒绝 + */ + REJECTED(3, "已拒绝"), + /** + * 已终止 + */ + CANCEL(4, "已终止"), + /** + * 已暂停 + */ + PAUSED(5, "已暂停"), + /** + * 撤销中 + */ + REVOKING(6, "撤销中"), + /** + * 已撤销 + */ + REVOKED(7, "已撤销"), + /** + * 已退回 + */ + BACKED(8, "已退回"), + /** + * 已撤回 + */ + RECALL(9, "已撤回"), + /** + * 异常 + */ + EXCEPTION(10, "异常"); + + private final Integer code; + private final String message; + + TaskStatusEnum(int code, String message) { + this.code = code; + this.message = message; + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/enums/TriggerRecordEnum.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/enums/TriggerRecordEnum.java new file mode 100644 index 0000000..ba2a3f4 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/enums/TriggerRecordEnum.java @@ -0,0 +1,30 @@ +package com.yunzhupaas.flowable.enums; + +import lombok.Getter; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/11 9:20 + */ +@Getter +public enum TriggerRecordEnum { + /** + * 通过 + */ + PASSED(0, "通过"), + /** + * 异常 + */ + EXCEPTION(1, "异常"); + + private final Integer code; + private final String message; + + TriggerRecordEnum(int code, String message) { + this.code = code; + this.message = message; + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/candidates/CandidateCheckFo.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/candidates/CandidateCheckFo.java new file mode 100644 index 0000000..b786178 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/candidates/CandidateCheckFo.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.flowable.model.candidates; + +import lombok.Data; + +import java.util.HashMap; +import java.util.Map; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/18 21:17 + */ +@Data +public class CandidateCheckFo { + String flowId; + Map formData = new HashMap<>(); + // 1.同意 0.拒绝 + Integer handleStatus = 1; + // 任务主键 + String id; + + String delegateUser; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/candidates/CandidateCheckVo.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/candidates/CandidateCheckVo.java new file mode 100644 index 0000000..3d89b57 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/candidates/CandidateCheckVo.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.flowable.model.candidates; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/19 10:24 + */ +@Data +public class CandidateCheckVo implements Serializable { + @Schema(description = "节点") + private List list = new ArrayList<>(); + /** + * 1.有分支 //2.没有分支有候选人 //3.没有分支也没有候选人 + */ + private Integer type = 3; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/candidates/CandidateListModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/candidates/CandidateListModel.java new file mode 100644 index 0000000..355c84d --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/candidates/CandidateListModel.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.flowable.model.candidates; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/19 10:22 + */ +@Data +public class CandidateListModel implements Serializable { + @Schema(description = "节点编码") + private String nodeCode; + @Schema(description = "节点名称") + private String nodeName; + @Schema(description = "是否候选人") + private Boolean isCandidates = false; + @Schema(description = "是否有候选人") + private Boolean hasCandidates = false; + @Schema(description = "已经选择的候选人") + private String selected; + @Schema(description = "是否选择分支") + private Boolean isBranchFlow = false; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/candidates/CandidateUserFo.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/candidates/CandidateUserFo.java new file mode 100644 index 0000000..5eac248 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/candidates/CandidateUserFo.java @@ -0,0 +1,33 @@ +package com.yunzhupaas.flowable.model.candidates; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/20 11:06 + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class CandidateUserFo extends Pagination { + /** + * 版本主键 + */ + @Schema(description = "版本主键") + private String flowId; + /** + * 节点编码 + */ + @Schema(description = "节点编码") + private String nodeCode; + /** + * 委托人 + */ + @Schema(description = "委托人") + private String delegateUser; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/candidates/CandidateUserVo.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/candidates/CandidateUserVo.java new file mode 100644 index 0000000..f92b7fa --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/candidates/CandidateUserVo.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.flowable.model.candidates; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/20 11:06 + */ +@Data +public class CandidateUserVo implements Serializable { + @Schema(description = "主键") + private String id; + @Schema(description = "名称") + private String fullName; + @Schema(description = "头像") + private String headIcon; + @Schema(description = "组织") + private String organize; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/candidates/CandidatesVo.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/candidates/CandidatesVo.java new file mode 100644 index 0000000..6d2dd32 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/candidates/CandidatesVo.java @@ -0,0 +1,52 @@ +package com.yunzhupaas.flowable.model.candidates; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/18 15:58 + */ +@Data +public class CandidatesVo implements Serializable { + /** + * 节点id + */ + @Schema(description = "节点id") + private String nodeId; + /** + * 任务id + */ + @Schema(description = "任务id") + private String taskId; + /** + * 审批人id + */ + @Schema(description = "审批人id") + private String handleId; + /** + * 审批人账号 + */ + @Schema(description = "审批人账号") + private String account; + /** + * 候选人 + */ + @Schema(description = "候选人") + private String candidates; + /** + * 经办主键 + */ + @Schema(description = "经办主键") + private String operatorId; + /** + * 审批类型(1-候选人 2-异常处理人) + */ + @Schema(description = "审批类型(1-候选人 2-异常处理人)") + private Integer type; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/comment/CommentCrForm.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/comment/CommentCrForm.java new file mode 100644 index 0000000..ffd91f0 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/comment/CommentCrForm.java @@ -0,0 +1,30 @@ +package com.yunzhupaas.flowable.model.comment; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 版本: V3.1.0 + * 版权: 深圳市乐程软件有限公司 + * 作者: 云筑产品开发平台组 + */ +@Data +public class CommentCrForm { + + @Schema(description = "附件") + private String file; + + @Schema(description = "图片") + private String image; + + @Schema(description = "流程id") + private String taskId; + + @Schema(description = "文本") + private String text; + + @Schema(description = "评论id") + private String replyId; + +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/comment/CommentInfoVO.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/comment/CommentInfoVO.java new file mode 100644 index 0000000..8042f0f --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/comment/CommentInfoVO.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.flowable.model.comment; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 版本: V3.1.0 + * 版权: 深圳市乐程软件有限公司 + * 作者: 云筑产品开发平台组 + */ +@Data +public class CommentInfoVO extends CommentCrForm{ + + @Schema(description = "主键") + private String id; +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/comment/CommentListVO.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/comment/CommentListVO.java new file mode 100644 index 0000000..732da5c --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/comment/CommentListVO.java @@ -0,0 +1,57 @@ +package com.yunzhupaas.flowable.model.comment; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 版本: V3.1.0 + * 版权: 深圳市乐程软件有限公司 + * 作者: 云筑产品开发平台组 + */ +@Data +public class CommentListVO { + + @Schema(description = "附件") + private String file; + + @Schema(description = "图片") + private String image; + + @Schema(description = "流程id") + private String taskId; + + @Schema(description = "文本") + private String text; + + @Schema(description = "创建人") + private String creatorUserId; + + @Schema(description = "创建人") + private String creatorUser; + + @Schema(description = "头像") + private String creatorUserHeadIcon; + + @Schema(description = "创建时间") + private Long creatorTime; + + @Schema(description = "是否删除") + private Integer isDel; + + @Schema(description = "主键") + private String id; + + @Schema(description = "评论id") + private String replyId; + + @Schema(description = "评论删除") + private Integer deleteShow; + + @Schema(description = "评论内容") + private String replyText; + + @Schema(description = "评论用户") + private String replyUser; + +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/comment/CommentPagination.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/comment/CommentPagination.java new file mode 100644 index 0000000..5e4f16c --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/comment/CommentPagination.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.flowable.model.comment; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import lombok.Data; + +/** + * 版本: V3.1.0 + * 版权: 深圳市乐程软件有限公司 + * 作者: 云筑产品开发平台组 + */ +@Data +public class CommentPagination extends Pagination { + + @Schema(description = "任务主键") + private String taskId; + +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/delegate/DelegateCrForm.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/delegate/DelegateCrForm.java new file mode 100644 index 0000000..15fb0e0 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/delegate/DelegateCrForm.java @@ -0,0 +1,50 @@ +package com.yunzhupaas.flowable.model.delegate; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:18 + */ +@Data +public class DelegateCrForm { + @Schema(description = "委托人名称") + private String userName; + @Schema(description = "委托人id") + private String userId; + /** + * 委托人id集合 + */ + private List userIdList = new ArrayList<>(); + @Schema(description = "被委托人") + @NotBlank(message = "必填") + private String toUserName; + @Schema(description = "被委托人id") + private List toUserId = new ArrayList<>(); + @Schema(description = "委托类型(0-发起委托,1-审批委托)") + @NotBlank(message = "必填") + private String type; + @Schema(description = "描述") + private String description; + @Schema(description = "开始日期") + @NotNull(message = "必填") + private Long startTime; + @Schema(description = "结束日期") + @NotNull(message = "必填") + private Long endTime; + @Schema(description = "委托流程id") + private String flowId; + @Schema(description = "委托流程名称") + @NotBlank(message = "必填") + private String flowName; +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/delegate/DelegateInfoModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/delegate/DelegateInfoModel.java new file mode 100644 index 0000000..4cb8aba --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/delegate/DelegateInfoModel.java @@ -0,0 +1,47 @@ +package com.yunzhupaas.flowable.model.delegate; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/2 16:31 + */ +@Data +public class DelegateInfoModel { + @Schema(description = "主键id") + private String id; + @Schema(description = "委托类型0-发起委托,1-审批委托") + private String type; + @Schema(description = "委托人id") + private String userId; + @Schema(description = "委托人") + private String userName; + @Schema(description = "被委托人id") + private String toUserId; + @Schema(description = "被委托人") + private String toUserName; + @Schema(description = "描述") + private String description; + @Schema(description = "开始日期") + private Date startTime; + @Schema(description = "结束日期") + private Date endTime; + @Schema(description = "委托流程id") + private String flowId; + @Schema(description = "委托流程名称") + private String flowName; + @Schema(description = "有效标志") + private Integer enabledMark; + @Schema(description = "状态") + private Integer status; + @Schema(description = "确认状态") + private Integer confirmStatus; + @Schema(description = "委托id") + private String delegateId; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/delegate/DelegateInfoVO.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/delegate/DelegateInfoVO.java new file mode 100644 index 0000000..2ba6c19 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/delegate/DelegateInfoVO.java @@ -0,0 +1,41 @@ +package com.yunzhupaas.flowable.model.delegate; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:18 + */ +@Data +public class DelegateInfoVO { + @Schema(description = "主键id") + private String id; + @Schema(description = "委托类型0-发起委托,1-审批委托") + private Integer type; + @Schema(description = "委托人id") + private String userId; + @Schema(description = "委托人") + private String userName; + @Schema(description = "流程分类") + private String flowCategory; + @Schema(description = "被委托人") + private String toUserName; + @Schema(description = "被委托人") + private List toUserId; + @Schema(description = "描述") + private String description; + @Schema(description = "开始日期") + private Long startTime; + @Schema(description = "结束日期") + private Long endTime; + @Schema(description = "委托流程id") + private String flowId; + @Schema(description = "委托流程名称") + private String flowName; +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/delegate/DelegateListVO.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/delegate/DelegateListVO.java new file mode 100644 index 0000000..1265662 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/delegate/DelegateListVO.java @@ -0,0 +1,51 @@ +package com.yunzhupaas.flowable.model.delegate; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:18 + */ +@Data +public class DelegateListVO { + @Schema(description = "主键id") + private String id; + @Schema(description = "委托类型0-发起委托,1-审批委托") + private String type; + @Schema(description = "委托人id") + private String userId; + @Schema(description = "委托人") + private String userName; + @Schema(description = "被委托人id") + private String toUserId; + @Schema(description = "被委托人") + private String toUserName; + @Schema(description = "描述") + private String description; + @Schema(description = "开始日期") + private Long startTime; + @Schema(description = "结束日期") + private Long endTime; + @Schema(description = "委托流程id") + private String flowId; + @Schema(description = "委托流程名称") + private String flowName; + @Schema(description = "有效标志") + private Integer enabledMark; + /** + * 生效状态,0.未生效 1.生效中 2.已失效 + */ + private Integer status; + /** + * 确认状态,0.待确认 1.已接受 2.已拒绝 + */ + private Integer confirmStatus; + /** + * 是否可编辑 + */ + private Boolean isEdit = true; +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/delegate/DelegatePagination.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/delegate/DelegatePagination.java new file mode 100644 index 0000000..05449d1 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/delegate/DelegatePagination.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.flowable.model.delegate; + +import com.yunzhupaas.base.Pagination; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/13 17:35 + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class DelegatePagination extends Pagination { + /** + * 1.我的委托 2.委托给我 3.我的代理 4.代理给我 + */ + private Integer type; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/delegate/DelegateUpForm.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/delegate/DelegateUpForm.java new file mode 100644 index 0000000..ebb726f --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/delegate/DelegateUpForm.java @@ -0,0 +1,15 @@ +package com.yunzhupaas.flowable.model.delegate; + +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:18 + */ +@Data +public class DelegateUpForm extends DelegateCrForm { + +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/AfterFo.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/AfterFo.java new file mode 100644 index 0000000..65c8d5c --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/AfterFo.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.flowable.model.flowable; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/8 20:12 + */ +@Data +public class AfterFo { + /** + * 部署ID + */ + private String deploymentId; + /** + * 节点Key + */ + private List taskKeys = new ArrayList<>(); +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/BackFo.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/BackFo.java new file mode 100644 index 0000000..b0ec31a --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/BackFo.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.flowable.model.flowable; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/8 9:13 + */ +@Data +public class BackFo { + /** + * 任务ID + */ + @Schema(name = "taskId", description = "任务ID") + private String taskId; + /** + * 目标节点ID + */ + @Schema(name = "targetKey", description = "目标节点ID") + private String targetKey; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/CompensateFo.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/CompensateFo.java new file mode 100644 index 0000000..628bb8a --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/CompensateFo.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.flowable.model.flowable; + +import lombok.Data; + +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/6/4 15:59 + */ +@Data +public class CompensateFo { + /** + * 实例主键 + */ + private String instanceId; + /** + * 原先的节点 + */ + private List source; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/CompleteFo.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/CompleteFo.java new file mode 100644 index 0000000..f756fc4 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/CompleteFo.java @@ -0,0 +1,27 @@ +package com.yunzhupaas.flowable.model.flowable; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Map; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/9 9:53 + */ +@Data +public class CompleteFo { + /** + * 任务ID + */ + @Schema(name = "taskId", description = "任务ID") + private String taskId; + /** + * 变量 + */ + @Schema(name = "variables", description = "变量") + private Map variables; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/FlowAbleData.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/FlowAbleData.java new file mode 100644 index 0000000..d876076 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/FlowAbleData.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.flowable.model.flowable; + +import lombok.Data; + +@Data +public class FlowAbleData { + /** + * 部署ID + */ + private String deploymentId; + /** + * 实例ID + */ + private String instanceId; +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/FlowAbleForm.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/FlowAbleForm.java new file mode 100644 index 0000000..2edad4e --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/FlowAbleForm.java @@ -0,0 +1,10 @@ +package com.yunzhupaas.flowable.model.flowable; + +import lombok.Data; + +@Data +public class FlowAbleForm { + private String bpmnXml; + private String key; +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/FlowAbleModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/FlowAbleModel.java new file mode 100644 index 0000000..9ef3866 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/FlowAbleModel.java @@ -0,0 +1,11 @@ +package com.yunzhupaas.flowable.model.flowable; + +import lombok.Data; + +@Data +public class FlowAbleModel { + private Boolean success = false; + private Object data = new Object(); + private String msg; +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/FlowAbleUrl.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/FlowAbleUrl.java new file mode 100644 index 0000000..38a9d81 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/FlowAbleUrl.java @@ -0,0 +1,414 @@ +package com.yunzhupaas.flowable.model.flowable; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import com.yunzhupaas.util.wxutil.HttpUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.net.URLDecoder; +import java.util.List; +import java.util.Map; + +@Slf4j +@Component +public class FlowAbleUrl { + + @Autowired + private ConfigValueUtil configValueUtil; + + public String deployFlowAble(String flowXml, String key) throws WorkFlowException { + String url = getFlowAbleUrl() + "/api/Flow/definition/deploy"; + FlowAbleForm flowAbleForm = new FlowAbleForm(); + flowAbleForm.setKey(key); + try { + flowAbleForm.setBpmnXml(URLDecoder.decode(flowXml, Constants.UTF_8)); + } catch (Exception e) { + flowAbleForm.setBpmnXml(flowXml); + } + JSONObject jsonObject = HttpUtil.httpRequest(url, "POST", JsonUtil.getObjectToString(flowAbleForm), UserProvider.getToken()); + FlowAbleModel flowAbleModel = JsonUtil.getJsonToBean(jsonObject, FlowAbleModel.class); + if (null == flowAbleModel) { + log.error(MsgCode.WF090.get()); + throw new WorkFlowException(MsgCode.WF142.get()); + } + if (!flowAbleModel.getSuccess()) { + throw new WorkFlowException(flowAbleModel.getMsg()); + } + FlowAbleData data = JsonUtil.getJsonToBean(flowAbleModel.getData(), FlowAbleData.class); + return data.getDeploymentId(); + } + + private String getFlowAbleUrl() { + return configValueUtil.getFlowDomain(); + } + + /** + * 启动流程实例 + * + * @param deploymentId 引擎部署ID + * @param variables 变量 + */ + public String startInstance(String deploymentId, Map variables) throws WorkFlowException { + String url = getFlowAbleUrl() + "/api/Flow/instance/start"; + InstanceStartFo fo = new InstanceStartFo(); + fo.setDeploymentId(deploymentId); + fo.setVariables(variables); + JSONObject jsonObject = HttpUtil.httpRequest(url, "POST", JsonUtil.getObjectToString(fo), UserProvider.getToken()); + FlowAbleModel flowAbleModel = JsonUtil.getJsonToBean(jsonObject, FlowAbleModel.class); + if (null == flowAbleModel) { + log.error(MsgCode.WF091.get()); + throw new WorkFlowException(MsgCode.WF142.get()); + } + if (!flowAbleModel.getSuccess()) { + throw new WorkFlowException(flowAbleModel.getMsg()); + } + FlowAbleData data = JsonUtil.getJsonToBean(flowAbleModel.getData(), FlowAbleData.class); + return data.getInstanceId(); + } + + /** + * 获取当前任务 + * + * @param instanceId 引擎实例ID + */ + public List getCurrentTask(String instanceId) throws WorkFlowException { + String url = getFlowAbleUrl() + "/api/Flow/task/list/" + instanceId; + JSONObject jsonObject = HttpUtil.httpRequest(url, "GET", null, UserProvider.getToken()); + FlowAbleModel flowAbleModel = JsonUtil.getJsonToBean(jsonObject, FlowAbleModel.class); + if (null == flowAbleModel) { + log.error(MsgCode.WF092.get()); + throw new WorkFlowException(MsgCode.WF142.get()); + } + if (!flowAbleModel.getSuccess()) { + throw new WorkFlowException(flowAbleModel.getMsg()); + } + return JsonUtil.getJsonToList(flowAbleModel.getData(), FlowableTaskModel.class); + } + + /** + * 删除流程实例 + * + * @param instanceId 实例ID + * @param deleteReason 删除原因 + */ + public void deleteInstance(String instanceId, String deleteReason) throws WorkFlowException { + String url = getFlowAbleUrl() + "/api/Flow/instance?instanceId=" + instanceId; + if (StringUtil.isNotEmpty(deleteReason)) { + url += "&deleteReason=" + deleteReason; + } + JSONObject jsonObject = HttpUtil.httpRequest(url, "DELETE", null, UserProvider.getToken()); + FlowAbleModel flowAbleModel = JsonUtil.getJsonToBean(jsonObject, FlowAbleModel.class); + if (null == flowAbleModel || !flowAbleModel.getSuccess()) { + log.error("流程实例删除异常: {}", flowAbleModel); + } + } + + /** + * 获取出线Key集合 + * + * @param fo 参数类 + */ + public List getOutgoingFlows(OutgoingFlowsFo fo) throws WorkFlowException { + String url = getFlowAbleUrl() + "/api/Flow/task/outgoing/flows"; + if (StringUtil.isNotEmpty(fo.getTaskId())) { + url += "?taskId=" + fo.getTaskId(); + } else { + url += "?deploymentId=" + fo.getDeploymentId() + "&taskKey=" + fo.getTaskKey(); + } + JSONObject jsonObject = HttpUtil.httpRequest(url, "GET", null, UserProvider.getToken()); + FlowAbleModel flowAbleModel = JsonUtil.getJsonToBean(jsonObject, FlowAbleModel.class); + if (null == flowAbleModel) { + log.error(MsgCode.WF094.get()); + throw new WorkFlowException(MsgCode.WF142.get()); + } + if (!flowAbleModel.getSuccess()) { + throw new WorkFlowException(flowAbleModel.getMsg()); + } + return JsonUtil.getJsonToList(flowAbleModel.getData(), String.class); + } + + /** + * 获取线之后的任务节点 + * + * @param deploymentId 部署id + * @param flowKey 连接线的Key + */ + public List getTaskKeyAfterFlow(String deploymentId, String flowKey) throws WorkFlowException { + String url = getFlowAbleUrl() + "/api/Flow/task/flow/target?deploymentId=" + deploymentId + "&flowKey=" + flowKey; + JSONObject jsonObject = HttpUtil.httpRequest(url, "GET", null, UserProvider.getToken()); + FlowAbleModel flowAbleModel = JsonUtil.getJsonToBean(jsonObject, FlowAbleModel.class); + if (null == flowAbleModel) { + log.error(MsgCode.WF095.get()); + throw new WorkFlowException(MsgCode.WF142.get()); + } + if (!flowAbleModel.getSuccess()) { + throw new WorkFlowException(flowAbleModel.getMsg()); + } + return JsonUtil.getJsonToList(flowAbleModel.getData(), String.class); + } + + /** + * 获取下一级任务节点集合 + * + * @param fo 参数类 + */ + public List getNext(NextOrPrevFo fo) throws WorkFlowException { + String url = getFlowAbleUrl() + "/api/Flow/task/next"; + if (StringUtil.isNotEmpty(fo.getTaskId())) { + url += "?taskId=" + fo.getTaskId(); + } else { + url += "?deploymentId=" + fo.getDeploymentId() + "&taskKey=" + fo.getTaskKey(); + } + JSONObject jsonObject = HttpUtil.httpRequest(url, "GET", null, UserProvider.getToken()); + FlowAbleModel flowAbleModel = JsonUtil.getJsonToBean(jsonObject, FlowAbleModel.class); + if (null == flowAbleModel) { + log.error(MsgCode.WF096.get()); + throw new WorkFlowException(MsgCode.WF142.get()); + } + if (!flowAbleModel.getSuccess()) { + throw new WorkFlowException(flowAbleModel.getMsg()); + } + return JsonUtil.getJsonToList(flowAbleModel.getData(), FlowableNodeModel.class); + } + + /** + * 获取上一级任务节点id集合 + * + * @param fo 参数类 + */ + public List getPrev(NextOrPrevFo fo) throws WorkFlowException { + String url = getFlowAbleUrl() + "/api/Flow/task/prev"; + if (StringUtil.isNotEmpty(fo.getTaskId())) { + url += "?taskId=" + fo.getTaskId(); + } else { + url += "?deploymentId=" + fo.getDeploymentId() + "&taskKey=" + fo.getTaskKey(); + } + JSONObject jsonObject = HttpUtil.httpRequest(url, "GET", null, UserProvider.getToken()); + FlowAbleModel flowAbleModel = JsonUtil.getJsonToBean(jsonObject, FlowAbleModel.class); + if (null == flowAbleModel) { + log.error(MsgCode.WF097.get()); + throw new WorkFlowException(MsgCode.WF142.get()); + } + if (!flowAbleModel.getSuccess()) { + throw new WorkFlowException(flowAbleModel.getMsg()); + } + return JsonUtil.getJsonToList(flowAbleModel.getData(), String.class); + } + + /** + * 完成流程任务 + * + * @param fo 参数类 + */ + public void complete(CompleteFo fo) throws WorkFlowException { + String url = getFlowAbleUrl() + "/api/Flow/task/complete"; + JSONObject jsonObject = HttpUtil.httpRequest(url, "POST", JsonUtil.getObjectToString(fo), UserProvider.getToken()); + FlowAbleModel flowAbleModel = JsonUtil.getJsonToBean(jsonObject, FlowAbleModel.class); + if (null == flowAbleModel) { + log.error(MsgCode.WF098.get()); + throw new WorkFlowException(MsgCode.WF142.get()); + } + if (!flowAbleModel.getSuccess()) { + throw new WorkFlowException(flowAbleModel.getMsg()); + } + } + + /** + * 获取流程实例 + * + * @param instanceId 实例id + */ + public FlowableInstanceModel getInstance(String instanceId) throws WorkFlowException { + String url = getFlowAbleUrl() + "/api/Flow/instance/" + instanceId; + JSONObject jsonObject = HttpUtil.httpRequest(url, "GET", null, UserProvider.getToken()); + FlowAbleModel flowAbleModel = JsonUtil.getJsonToBean(jsonObject, FlowAbleModel.class); + if (null == flowAbleModel) { + log.error(MsgCode.WF099.get()); + throw new WorkFlowException(MsgCode.WF142.get()); + } + if (!flowAbleModel.getSuccess()) { + throw new WorkFlowException(flowAbleModel.getMsg()); + } + return JsonUtil.getJsonToBean(flowAbleModel.getData(), FlowableInstanceModel.class); + } + + /** + * 获取未经过的节点 + * + * @param instanceId 引擎实例主键 + */ + public List getTobePass(String instanceId) throws WorkFlowException { + String url = getFlowAbleUrl() + "/api/Flow/task/tobe/pass/" + instanceId; + JSONObject jsonObject = HttpUtil.httpRequest(url, "GET", null, UserProvider.getToken()); + FlowAbleModel flowAbleModel = JsonUtil.getJsonToBean(jsonObject, FlowAbleModel.class); + if (null == flowAbleModel) { + log.error(MsgCode.WF100.get()); + throw new WorkFlowException(MsgCode.WF142.get()); + } + if (!flowAbleModel.getSuccess()) { + throw new WorkFlowException(flowAbleModel.getMsg()); + } + return JsonUtil.getJsonToList(flowAbleModel.getData(), String.class); + } + + /** + * 获取节点的后续节点 + * + * @param fo 参数 + */ + public List getAfter(AfterFo fo) throws WorkFlowException { + String url = getFlowAbleUrl() + "/api/Flow/task/after"; + JSONObject jsonObject = HttpUtil.httpRequest(url, "POST", JsonUtil.getObjectToString(fo), UserProvider.getToken()); + FlowAbleModel flowAbleModel = JsonUtil.getJsonToBean(jsonObject, FlowAbleModel.class); + if (null == flowAbleModel) { + log.error(MsgCode.WF101.get()); + throw new WorkFlowException(MsgCode.WF142.get()); + } + if (!flowAbleModel.getSuccess()) { + throw new WorkFlowException(flowAbleModel.getMsg()); + } + return JsonUtil.getJsonToList(flowAbleModel.getData(), String.class); + } + + /** + * 获取可回退的节点ID + * + * @param taskId 引擎任务主键 + */ + public List getFallbacks(String taskId) throws WorkFlowException { + String url = getFlowAbleUrl() + "/api/Flow/task/fallbacks/" + taskId; + JSONObject jsonObject = HttpUtil.httpRequest(url, "GET", null, UserProvider.getToken()); + FlowAbleModel flowAbleModel = JsonUtil.getJsonToBean(jsonObject, FlowAbleModel.class); + if (null == flowAbleModel) { + log.error(MsgCode.WF102.get()); + throw new WorkFlowException(MsgCode.WF142.get()); + } + if (!flowAbleModel.getSuccess()) { + throw new WorkFlowException(flowAbleModel.getMsg()); + } + return JsonUtil.getJsonToList(flowAbleModel.getData(), String.class); + } + + /** + * 退回 + * + * @param fo 参数 + */ + public void back(BackFo fo) throws WorkFlowException { + String url = getFlowAbleUrl() + "/api/Flow/task/back"; + JSONObject jsonObject = HttpUtil.httpRequest(url, "POST", JsonUtil.getObjectToString(fo), UserProvider.getToken()); + FlowAbleModel flowAbleModel = JsonUtil.getJsonToBean(jsonObject, FlowAbleModel.class); + if (null == flowAbleModel) { + log.error(MsgCode.WF103.get()); + throw new WorkFlowException(MsgCode.WF142.get()); + } + if (!flowAbleModel.getSuccess()) { + throw new WorkFlowException(flowAbleModel.getMsg()); + } + } + + /** + * 节点跳转 + * + * @param fo 参数 + */ + public void jump(JumpFo fo) throws WorkFlowException { + String url = getFlowAbleUrl() + "/api/Flow/task/jump"; + JSONObject jsonObject = HttpUtil.httpRequest(url, "POST", JsonUtil.getObjectToString(fo), UserProvider.getToken()); + FlowAbleModel flowAbleModel = JsonUtil.getJsonToBean(jsonObject, FlowAbleModel.class); + if (null == flowAbleModel) { + log.error(MsgCode.WF104.get()); + throw new WorkFlowException(MsgCode.WF142.get()); + } + if (!flowAbleModel.getSuccess()) { + throw new WorkFlowException(flowAbleModel.getMsg()); + } + } + + /** + * 任务完成的补偿 + * + * @param fo 参数 + */ + public List compensate(CompensateFo fo) throws WorkFlowException { + String url = getFlowAbleUrl() + "/api/Flow/task/compensate"; + JSONObject jsonObject = HttpUtil.httpRequest(url, "POST", JsonUtil.getObjectToString(fo), UserProvider.getToken()); + FlowAbleModel flowAbleModel = JsonUtil.getJsonToBean(jsonObject, FlowAbleModel.class); + if (null == flowAbleModel) { + log.error(MsgCode.WF105.get()); + throw new WorkFlowException(MsgCode.WF142.get()); + } + if (!flowAbleModel.getSuccess()) { + throw new WorkFlowException(flowAbleModel.getMsg()); + } + return JsonUtil.getJsonToList(flowAbleModel.getData(), FlowableTaskModel.class); + } + + /** + * 获取历史节点 + * + * @param instanceId 实例主键 + */ + public List getHistoric(String instanceId) throws WorkFlowException { + String url = getFlowAbleUrl() + "/api/Flow/task/historic/" + instanceId; + JSONObject jsonObject = HttpUtil.httpRequest(url, "GET", null, UserProvider.getToken()); + FlowAbleModel flowAbleModel = JsonUtil.getJsonToBean(jsonObject, FlowAbleModel.class); + if (null == flowAbleModel) { + log.error("获取历史节点失败"); + throw new WorkFlowException(MsgCode.WF142.get()); + } + if (!flowAbleModel.getSuccess()) { + throw new WorkFlowException(flowAbleModel.getMsg()); + } + return JsonUtil.getJsonToList(flowAbleModel.getData(), FlowableHistoricModel.class); + } + + /** + * 获取历史结束节点 + * + * @param instanceId 实例主键 + */ + public List getHistoricEnd(String instanceId) throws WorkFlowException { + String url = getFlowAbleUrl() + "/api/Flow/task/historic/end/" + instanceId; + JSONObject jsonObject = HttpUtil.httpRequest(url, "GET", null, UserProvider.getToken()); + FlowAbleModel flowAbleModel = JsonUtil.getJsonToBean(jsonObject, FlowAbleModel.class); + if (null == flowAbleModel) { + log.error("获取历史结束节点失败"); + throw new WorkFlowException(MsgCode.WF142.get()); + } + if (!flowAbleModel.getSuccess()) { + throw new WorkFlowException(flowAbleModel.getMsg()); + } + return JsonUtil.getJsonToList(flowAbleModel.getData(), String.class); + } + + /** + * 获取元素信息 + * + * @param deploymentId 部署id + * @param key 节点key + */ + public FlowableNodeModel getElementInfo(String deploymentId, String key) throws WorkFlowException { + String url = getFlowAbleUrl() + "/api/Flow/task/element/info"; + url += "?deploymentId=" + deploymentId + "&key=" + key; + JSONObject jsonObject = HttpUtil.httpRequest(url, "GET", null, UserProvider.getToken()); + FlowAbleModel flowAbleModel = JsonUtil.getJsonToBean(jsonObject, FlowAbleModel.class); + if (null == flowAbleModel) { + log.error("获取元素信息失败"); + throw new WorkFlowException(MsgCode.WF142.get()); + } + if (!flowAbleModel.getSuccess()) { + throw new WorkFlowException(flowAbleModel.getMsg()); + } + return JsonUtil.getJsonToBean(flowAbleModel.getData(), FlowableNodeModel.class); + } +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/FlowableHistoricModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/FlowableHistoricModel.java new file mode 100644 index 0000000..921db1c --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/FlowableHistoricModel.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.flowable.model.flowable; + +import lombok.Data; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/6/18 17:21 + */ +@Data +public class FlowableHistoricModel { + /** + * 任务ID + */ + private String taskId; + /** + * 节点编码 + */ + private String code; + /** + * 开始时间 + */ + private Long startTime; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/FlowableInstanceModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/FlowableInstanceModel.java new file mode 100644 index 0000000..87fb036 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/FlowableInstanceModel.java @@ -0,0 +1,46 @@ +package com.yunzhupaas.flowable.model.flowable; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/25 8:57 + */ +@Data +public class FlowableInstanceModel { + /** + * 实例ID + */ + @Schema(name = "instanceId", description = "实例ID") + private String instanceId; + /** + * 开始时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @Schema(name = "startTime", description = "开始时间") + private Date startTime; + /** + * 结束时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @Schema(name = "endTime", description = "结束时间") + private Date endTime; + /** + * 耗时 + */ + @Schema(name = "durationInMillis", description = "耗时") + private Long durationInMillis; + /** + * 删除原因 + */ + @Schema(name = "deleteReason", description = "删除原因") + private String deleteReason; +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/FlowableNodeModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/FlowableNodeModel.java new file mode 100644 index 0000000..d04ca23 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/FlowableNodeModel.java @@ -0,0 +1,38 @@ +package com.yunzhupaas.flowable.model.flowable; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * flowable节点 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/19 17:52 + */ +@Data +public class FlowableNodeModel implements Serializable { + /** + * 元素ID + */ + @Schema(name = "id", description = "元素ID") + private String id; + /** + * 元素名称 + */ + @Schema(name = "name", description = "元素名称") + private String name; + /** + * 进线ID + */ + @Schema(name = "incoming", description = "进线ID") + private List incomingList; + /** + * 出线ID + */ + @Schema(name = "outgoingList", description = "出线ID") + private List outgoingList; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/FlowableTaskModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/FlowableTaskModel.java new file mode 100644 index 0000000..169ab06 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/FlowableTaskModel.java @@ -0,0 +1,37 @@ +package com.yunzhupaas.flowable.model.flowable; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * 引擎任务 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/18 9:17 + */ +@Data +public class FlowableTaskModel implements Serializable { + /** + * 任务ID + */ + @Schema(name = "taskId", description = "任务ID") + private String taskId; + /** + * 任务名称 + */ + @Schema(name = "taskName", description = "任务名称") + private String taskName; + /** + * 任务Key + */ + @Schema(name = "taskKey", description = "任务Key") + private String taskKey; + /** + * 实例ID + */ + @Schema(name = "instanceId", description = "实例ID") + private String instanceId; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/InstanceStartFo.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/InstanceStartFo.java new file mode 100644 index 0000000..e5aeb4f --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/InstanceStartFo.java @@ -0,0 +1,28 @@ +package com.yunzhupaas.flowable.model.flowable; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Map; + +/** + * 启动实例参数类 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/17 21:14 + */ +@Data +public class InstanceStartFo implements Serializable { + /** + * 部署ID + */ + @Schema(name = "deploymentId", description = "部署ID") + private String deploymentId; + /** + * 变量 + */ + @Schema(name = "variables", description = "变量") + private Map variables; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/JumpFo.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/JumpFo.java new file mode 100644 index 0000000..e4dba83 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/JumpFo.java @@ -0,0 +1,28 @@ +package com.yunzhupaas.flowable.model.flowable; + +import lombok.Data; + +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/9 16:36 + */ +@Data +public class JumpFo { + /** + * 实例ID + */ + private String instanceId; + /** + * 源节点集合 + */ + private List source; + /** + * 目标节点集合 + */ + private List target; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/NextOrPrevFo.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/NextOrPrevFo.java new file mode 100644 index 0000000..70e2c30 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/NextOrPrevFo.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.flowable.model.flowable; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/23 11:06 + */ +@Data +public class NextOrPrevFo { + /** + * 部署ID + */ + @Schema(name = "deploymentId", description = "部署ID") + private String deploymentId; + /** + * 节点Key + */ + @Schema(name = "taskKey", description = "节点Key") + private String taskKey; + /** + * 任务ID + */ + @Schema(name = "taskId", description = "任务ID") + private String taskId; +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/OutgoingFlowsFo.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/OutgoingFlowsFo.java new file mode 100644 index 0000000..dcee957 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/flowable/OutgoingFlowsFo.java @@ -0,0 +1,32 @@ +package com.yunzhupaas.flowable.model.flowable; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/18 13:34 + */ +@Data +public class OutgoingFlowsFo implements Serializable { + /** + * 部署ID + */ + @Schema(name = "deploymentId", description = "部署ID") + private String deploymentId; + /** + * 节点Key + */ + @Schema(name = "taskKey", description = "节点Key") + private String taskKey; + /** + * 任务ID + */ + @Schema(name = "taskId", description = "任务ID") + private String taskId; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/message/ContModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/message/ContModel.java new file mode 100644 index 0000000..81d4910 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/message/ContModel.java @@ -0,0 +1,30 @@ +package com.yunzhupaas.flowable.model.message; + +import lombok.Data; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2024/4/25 下午5:13 + */ +@Data +public class ContModel { + /** + * 引擎id + */ + private String flowId; + /** + * 任务id + */ + private String taskId; + /** + * 经办id或抄送id + */ + private String operatorId; + /** + * 页面类型 + */ + private String opType; +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/message/DelegateModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/message/DelegateModel.java new file mode 100644 index 0000000..cb7da01 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/message/DelegateModel.java @@ -0,0 +1,33 @@ +package com.yunzhupaas.flowable.model.message; + +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.flowable.entity.TaskEntity; +import com.yunzhupaas.flowable.model.util.FlowNature; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:18 + */ +@Data +public class DelegateModel { + //true 委托 false 审批 + private Boolean delegate = true; + //0.发起 1.审批 2.结束 + private Integer type = FlowNature.StartMsg; + private List toUserIds = new ArrayList<>(); + private UserInfo userInfo = new UserInfo(); + private TaskEntity flowTask = new TaskEntity(); + //审批是否要发送消息 + private Boolean approve = true; + /** + * 确认 + */ + private Integer ack = 0; +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/message/FlowEventModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/message/FlowEventModel.java new file mode 100644 index 0000000..ca6406e --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/message/FlowEventModel.java @@ -0,0 +1,41 @@ +package com.yunzhupaas.flowable.model.message; + +import com.yunzhupaas.flowable.entity.RecordEntity; +import com.yunzhupaas.flowable.entity.TaskEntity; +import com.yunzhupaas.flowable.model.templatenode.nodejson.TemplateJsonModel; +import com.yunzhupaas.permission.entity.UserEntity; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Map; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/23 9:41 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class FlowEventModel { + //数据 + private String dataJson; + //表单数据 + private Map data; + //系统匹配 + private TemplateJsonModel templateJson; + //操作对象 + private RecordEntity record; + // 任务 + private TaskEntity taskEntity; + + private UserEntity createUser; + private UserEntity delegate; + +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/message/FlowMsgModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/message/FlowMsgModel.java new file mode 100644 index 0000000..3c55128 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/message/FlowMsgModel.java @@ -0,0 +1,117 @@ +package com.yunzhupaas.flowable.model.message; + +import com.yunzhupaas.flowable.entity.CirculateEntity; +import com.yunzhupaas.flowable.entity.OperatorEntity; +import com.yunzhupaas.flowable.entity.TaskEntity; +import com.yunzhupaas.flowable.entity.TemplateNodeEntity; +import com.yunzhupaas.flowable.model.task.FlowModel; +import com.yunzhupaas.flowable.model.templatenode.nodejson.MsgConfig; +import com.yunzhupaas.flowable.model.util.FlowNature; +import com.yunzhupaas.permission.entity.UserEntity; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2024/4/25 下午1:49 + */ +@Data +@Accessors(chain = true) +@NoArgsConstructor +public class FlowMsgModel { + private Boolean startHandId = false; + private FlowModel flowModel = new FlowModel(); + private TaskEntity taskEntity = new TaskEntity(); + private String nodeCode; + private List nodeList = new ArrayList<>(); + private List operatorList = new ArrayList<>(); + private List circulateList = new ArrayList<>(); + private Map> formData = new HashMap<>(); + /** + * 代办 (通知代办) + */ + private Boolean wait = true; + /** + * 同意 + */ + private Boolean approve = false; + /** + * 退回 + */ + private Boolean back = false; + /** + * 抄送人 + */ + private Boolean copy = false; + /** + * 结束 (通知发起人) + */ + private Boolean end = false; + /** + * 子流程通知 + */ + private Boolean launch = false; + /** + * 拒绝发起节点 + */ + private Boolean start = false; + /** + * 超时 + */ + private Boolean overtime = false; + /** + * 提醒 + */ + private Boolean notice = false; + /** + * 评论 + */ + private Boolean comment = false; + /** + * 拒绝 + */ + private Boolean reject = false; + + private Boolean transfer = false; + private Boolean assign = false; + private Boolean press = false; + + /** + * 消息类型 + */ + private MsgConfig msgConfig = new MsgConfig(); + /** + * 审批类型 + */ + private String opType = FlowNature.LaunchCreate; + /** + * 节点数据 + */ + private Map data = new HashMap<>(); + /** + * 审批人 + */ + private List userList = new ArrayList<>(); + /** + * + */ + private Map contMsg = new HashMap<>(); + + /** + * 创建人 + */ + private UserEntity createUser; + /** + * 委托人 + */ + private UserEntity delegate; +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/monitor/MonitorModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/monitor/MonitorModel.java new file mode 100644 index 0000000..cdc6fe5 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/monitor/MonitorModel.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.flowable.model.monitor; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/15 11:11 + */ +@Data +public class MonitorModel { + @Schema(description = "主键") + private List ids; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/monitor/MonitorVo.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/monitor/MonitorVo.java new file mode 100644 index 0000000..ffa7422 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/monitor/MonitorVo.java @@ -0,0 +1,152 @@ +package com.yunzhupaas.flowable.model.monitor; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/15 11:00 + */ +@Data +public class MonitorVo { + /** + * 主键 + */ + @Schema(description = "主键") + private String id; + /** + * 任务编码 + */ + @Schema(description = "任务编码") + private String enCode; + + /** + * 任务标题 + */ + @Schema(description = "任务标题") + private String fullName; + + /** + * 流程名称 + */ + @Schema(description = "流程名称") + private String flowName; + + /** + * 流程编码 + */ + @Schema(description = "流程编码") + private String flowCode; + + /** + * 任务状态 + */ + @Schema(description = "任务状态") + private Integer status; + + /** + * 流程分类 + */ + @Schema(description = "流程分类") + private String flowCategory; + + /** + * 流程类型 + */ + @Schema(description = "流程类型") + private String flowType; + + /** + * 流程版本 + */ + @Schema(description = "流程版本") + private String flowVersion; + + /** + * 同步异步(0:同步,1:异步) + */ + @Schema(description = "同步异步(0:同步,1:异步)") + private Integer isAsync; + + /** + * 父级实例节点编码 + */ + @Schema(description = "父级实例节点编码") + private String parentCode; + + /** + * 父级实例id + */ + @Schema(description = "父级实例id") + private String parentId; + + /** + * 紧急程度 + */ + @Schema(description = "紧急程度") + private Integer flowUrgent; + + /** + * 流程主键 + */ + @Schema(description = "流程主键") + private String templateId; + + /** + * 流程版本主键 + */ + @Schema(description = "流程版本主键") + private String flowId; + + /** + * 是否批量(0:否,1:是) + */ + @Schema(description = "是否批量(0:否,1:是)") + private Integer isBatch; + + /** + * 委托用户 + */ + @Schema(description = "委托用户") + private String delegateUserId; + /** + * 开始时间 + */ + @Schema(description = "开始时间") + private Date startTime; + /** + * 结束时间 + */ + @Schema(description = "结束时间") + private Date endTime; + /** + * 当前节点名称 + */ + @Schema(description = "当前节点名称") + private String currentNodeName; + /** + * 指派节点 + */ + @Schema(description = "指派节点") + private String assignNode; + /** + * 创建人 + */ + @Schema(description = "创建人") + private String creatorUser; + /** + * 创建时间 + */ + @Schema(description = "创建时间") + private Long creatorTime; + /** + * 归档状态 + */ + @Schema(description = "归档状态") + private String isFile; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/operator/AddSignModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/operator/AddSignModel.java new file mode 100644 index 0000000..528e2fa --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/operator/AddSignModel.java @@ -0,0 +1,37 @@ +package com.yunzhupaas.flowable.model.operator; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 加签参数 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/30 10:33 + */ +@Data +public class AddSignModel { + /** + * 加签人 + */ + private List addSignUserIdList = new ArrayList<>(); + /** + * 加签类型 1.前 2 后 + */ + private Integer addSignType = 1; + /** + * 审批类型(0:或签 1:会签 2:依次审批) + */ + private Integer counterSign = 0; + /** + * 会签比例 + */ + private Integer auditRatio = 100; + /** + * 加签层级 + */ + private Integer level = 1; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/operator/FlowBatchModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/operator/FlowBatchModel.java new file mode 100644 index 0000000..b629768 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/operator/FlowBatchModel.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.flowable.model.operator; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/16 10:07 + */ +@Data +public class FlowBatchModel { + @Schema(description = "名称") + private String fullName; + @Schema(description = "主键") + private String id; + @Schema(description = "数量") + private Long num; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/operator/OperatorVo.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/operator/OperatorVo.java new file mode 100644 index 0000000..c6f1a30 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/operator/OperatorVo.java @@ -0,0 +1,168 @@ +package com.yunzhupaas.flowable.model.operator; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/18 15:23 + */ +@Data +public class OperatorVo { + /** + * 主键 + */ + @Schema(description = "主键") + private String id; + /** + * 节点名称 + */ + @Schema(description = "节点名称") + private String nodeName; + /** + * 节点编码 + */ + @Schema(description = "节点编码") + private String nodeCode; + /** + * 任务id + */ + @Schema(description = "任务id") + private String taskId; + /** + * 节点id + */ + @Schema(description = "节点id") + private String nodeId; + /** + * 加签经办父级id + */ + @Schema(description = "加签经办父级id") + private String parentId; + /** + * 处理时间 + */ + @Schema(description = "处理时间") + private Date handleTime; + /** + * 处理人id + */ + @Schema(description = "处理人id") + private String handleId; + /** + * 处理状态 + */ + @Schema(description = "处理状态") + private Integer handleStatus; + /** + * 处理参数 + */ + @Schema(description = "处理参数") + private String handleParameter; + /** + * 退回参数 + */ + @Schema(description = "退回参数") + private String backParameter; + /** + * 开始处理时间 + */ + @Schema(description = "开始处理时间") + private Date startHandleTime; + /** + * 签收时间 + */ + @Schema(description = "签收时间") + private Date signTime; + /** + * 截止时间 + */ + @Schema(description = "截止时间") + private Date duedate; + /** + * 协办id + */ + @Schema(description = "协办id") + private String assistId; + /** + * 草稿数据 + */ + @Schema(description = "草稿数据") + private String draftData; + /** + * 是否办理节点(0否 1是) + */ + @Schema(description = "是否办理节点") + private Integer isProcessing; + + /* --------------- 任务相关属性 --------------- */ + /** + * 任务标题 + */ + @Schema(description = "任务标题") + private String fullName; + /** + * 流程名称 + */ + @Schema(description = "流程名称") + private String flowName; + /** + * 紧急程度 + */ + @Schema(description = "紧急程度") + private Integer flowUrgent; + /** + * 当前节点名称 + */ + @Schema(description = "当前节点名称") + private String currentNodeName; + /** + * 创建人id + */ + @Schema(description = "创建人id") + private String creatorUserId; + /** + * 创建人 + */ + @Schema(description = "创建人") + private String creatorUser; + /** + * 创建时间 + */ + @Schema(description = "创建时间") + private Date creatorTime; + /** + * 任务 + */ + @Schema(description = "任务") + private Integer status; + + @Schema(description = "版本主键") + private String flowId; + + @Schema(description = "版本") + private String flowVersion; + + @Schema(description = "开始时间") + private Date startTime; + + @Schema(description = "流程分类") + private String flowCategory; + + private String delegateUser; + /** + * 经办审批人id + */ + @Schema(description = "经办审批人id") + private String operatorHandleId; + /** + * 记录创建人id + */ + @Schema(description = "记录创建人id") + private String recordCreatorUserId; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/operator/ReducePagination.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/operator/ReducePagination.java new file mode 100644 index 0000000..faba057 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/operator/ReducePagination.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.flowable.model.operator; + +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.flowable.entity.OperatorEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/7 15:22 + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class ReducePagination extends Pagination { + + private OperatorEntity operator; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/operator/ReduceUserModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/operator/ReduceUserModel.java new file mode 100644 index 0000000..6f160c8 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/operator/ReduceUserModel.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.flowable.model.operator; + +import com.yunzhupaas.flowable.model.candidates.CandidateUserVo; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 可减签人员 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/7 15:20 + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class ReduceUserModel extends CandidateUserVo { +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/record/NodeRecordModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/record/NodeRecordModel.java new file mode 100644 index 0000000..362675f --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/record/NodeRecordModel.java @@ -0,0 +1,34 @@ +package com.yunzhupaas.flowable.model.record; + +import lombok.Data; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/6/25 17:18 + */ +@Data +public class NodeRecordModel { + /** + * 任务id + */ + private String taskId; + /** + * 节点id + */ + private String nodeId; + /** + * 节点编码 + */ + private String nodeCode; + /** + * 节点名称 + */ + private String nodeName; + /** + * 节点状态,1-已提交 2-已通过 3-已拒绝 4-审批中 5-已退回 6-已撤回 + */ + private Integer nodeStatus; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/record/ProgressModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/record/ProgressModel.java new file mode 100644 index 0000000..0f18072 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/record/ProgressModel.java @@ -0,0 +1,61 @@ +package com.yunzhupaas.flowable.model.record; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/6/18 17:09 + */ +@Data +public class ProgressModel { + /** + * 主键 + */ + private String id; + /** + * 开始时间 + */ + private Long startTime; + /** + * 节点id + */ + private String nodeId; + /** + * 节点编码 + */ + private String nodeCode; + /** + * 节点名称 + */ + private String nodeName; + /** + * 节点类型 + */ + private String nodeType; + /** + * 节点状态, 1-已提交 2-已通过 3-已拒绝 4-审批中. 7等待中、8待办理 + */ + private Integer nodeStatus; + /** + * 审批类型(0:或签 1:会签 2:依次审批) + */ + private Integer counterSign; + /** + * 审批人 + */ + private List approver = new ArrayList<>(); + /** + * 审批人数 + */ + private Integer approverCount = 0; + /** + * 显示任务流程按钮 + */ + private Boolean showTaskFlow = false; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/record/RecordModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/record/RecordModel.java new file mode 100644 index 0000000..ba331d7 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/record/RecordModel.java @@ -0,0 +1,33 @@ +package com.yunzhupaas.flowable.model.record; + +import com.yunzhupaas.flowable.entity.OperatorEntity; +import com.yunzhupaas.flowable.model.task.FlowModel; +import lombok.Data; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/26 17:10 + */ +@Data +public class RecordModel { + /** + * 记录操作类型,RecordEnum + */ + private Integer type; + /** + * 审批原因 + */ + private FlowModel flowModel = new FlowModel(); + /** + * 流转操作人,如加签给谁 + */ + private String userId; + /** + * 经办对象 + */ + private OperatorEntity operator = new OperatorEntity(); + +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/record/RecordVo.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/record/RecordVo.java new file mode 100644 index 0000000..d67a759 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/record/RecordVo.java @@ -0,0 +1,102 @@ +package com.yunzhupaas.flowable.model.record; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.*; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/29 10:55 + */ +@Data +public class RecordVo { + /** + * 主键 + */ + @Schema(description = "主键") + private String id; + /** + * 节点名称 + */ + @Schema(description = "节点名称") + private String nodeName; + /** + * 节点编码 + */ + @Schema(description = "节点编码") + private String nodeCode; + /** + * 经办类型 + */ + @Schema(description = "经办类型") + private Integer handleType; + /** + * 经办人员 + */ + @Schema(description = "经办人员") + private String handleId; + /** + * 经办时间 + */ + @Schema(description = "经办时间") + private Date handleTime; + /** + * 经办理由 + */ + @Schema(description = "经办理由") + private String handleOpinion; + /** + * 经办主键 + */ + @Schema(description = "经办主键") + private String operatorId; + /** + * 任务id + */ + @Schema(description = "任务id") + private String taskId; + /** + * 签名图片 + */ + @Schema(description = "签名图片") + private String signImg; + /** + * 状态 + */ + @Schema(description = "状态") + private Integer status; + /** + * 流转操作人名称 + */ + @Schema(description = "流转操作人名称") + private String handleUserName; + /** + * 经办文件 + */ + @Schema(description = "经办文件") + private String fileList; + /** + * 用户名称 + */ + @Schema(description = "用户名称") + private String userName; + /** + * 创建时间 + */ + @Schema(description = "创建时间") + private Date creatorTime; + /** + * 头像 + */ + @Schema(description = "头像") + private String headIcon; + /** + * 拓展字段 + */ + @Schema(description = "拓展字段") + private List approvalField = new ArrayList<>(); +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/record/UserItem.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/record/UserItem.java new file mode 100644 index 0000000..03ee1df --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/record/UserItem.java @@ -0,0 +1,30 @@ +package com.yunzhupaas.flowable.model.record; + +import lombok.Data; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/6/18 17:12 + */ +@Data +public class UserItem { + /** + * 审批人名 + */ + private String userName; + /** + * 头像 + */ + private String headIcon; + /** + * 审批人 + */ + private String userId; + /** + * 审批类型 + */ + private Integer handleType; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/task/AuditModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/task/AuditModel.java new file mode 100644 index 0000000..cf75bba --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/task/AuditModel.java @@ -0,0 +1,30 @@ +package com.yunzhupaas.flowable.model.task; + +import com.yunzhupaas.flowable.model.templatenode.FlowErrorModel; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 审批返回 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/6/20 15:49 + */ +@Data +public class AuditModel { + /** + * 是否结束 + */ + private Boolean isEnd = false; + /** + * 异常处理 + */ + private List errorCodeList = new ArrayList<>(); + /** + * 任务主键 + */ + private String taskId; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/task/FileModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/task/FileModel.java new file mode 100644 index 0000000..38b4602 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/task/FileModel.java @@ -0,0 +1,37 @@ +package com.yunzhupaas.flowable.model.task; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 归档模型 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/28 14:16 + */ +@Data +public class FileModel { + /** + * 归档文件夹名称 + */ + public static String FOLDER_NAME = "流程归档"; + /** + * 归档路径 + */ + private String parentId; + /** + * 文件名称 + */ + private String filename; + /** + * 创建人 + */ + private String userId; + /** + * 分享人 + */ + private List userList = new ArrayList<>(); +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/task/FlowHandleModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/task/FlowHandleModel.java new file mode 100644 index 0000000..a0d4869 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/task/FlowHandleModel.java @@ -0,0 +1,117 @@ +package com.yunzhupaas.flowable.model.task; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.flowable.model.util.FlowNature; +import lombok.Data; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:17 + */ +@Data +public class FlowHandleModel extends Pagination { + /** + * 意见 + **/ + @Schema(description = "意见") + private String handleOpinion; + /** + * 拓展字段 + **/ + @Schema(description = "拓展字段") + private List approvalField = new ArrayList<>(); + /** + * 处理人,如 转审人、指派人 + **/ + @Schema(description = "处理人") + private String handleIds; + /** + * 审批数据 + **/ + @Schema(description = "审批数据") + private Map formData = new HashMap<>(); + /** + * 自定义抄送人 + **/ + @Schema(description = "自定义抄送人") + private String copyIds; + /** + * 签名 + **/ + @Schema(description = "签名") + private String signImg; + /** + * 指派节点 + **/ + @Schema(description = "指派节点") + private String nodeCode; + /** + * 候选人 + */ + @Schema(description = "候选人") + private Map> candidateList = new HashMap<>(); + /** + * 异常处理人 + */ + @Schema(description = "异常处理人") + private Map> errorRuleUserList = new HashMap<>(); + /** + * 选择分支 + */ + @Schema(description = "选择分支") + private List branchList = new ArrayList<>(); + /** + * 批量审批id + */ + @Schema(description = "批量审批主键") + private List ids = new ArrayList<>(); + /** + * 签收类型,0、签收 1、退签 2、表示流程监控的类型为任务流程 + */ + @Schema(description = "签收类型") + private Integer type = 0; + /** + * 经办文件 + **/ + @Schema(description = "经办文件") + private List fileList = new ArrayList<>(); + /** + * 批量审批类型 0.通过 1.拒绝 2.转办 + */ + @Schema(description = "批量审批类型") + private Integer batchType = 0; + /** + * 批量发起用户 + */ + @Schema(description = "批量发起用户") + private List delegateUserList = new ArrayList<>(); + /** + * 退回节点 + */ + @Schema(description = "退回节点") + private String backNodeCode = FlowNature.START; + /** + * 退回类型 1.重新审批 2.从当前节点审批 + */ + @Schema(description = "退回类型") + private Integer backType = FlowNature.RestartType; + /** + * false 变更 true 复活 + */ + @Schema(description = "类型") + private Boolean resurgence = false; + /** + * true 同步子流程 false 全部子流程 + */ + @Schema(description = "冻结类型") + private Boolean suspend = false; +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/task/FlowMethod.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/task/FlowMethod.java new file mode 100644 index 0000000..126d92a --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/task/FlowMethod.java @@ -0,0 +1,277 @@ +package com.yunzhupaas.flowable.model.task; + +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.flowable.entity.CirculateEntity; +import com.yunzhupaas.flowable.entity.OperatorEntity; +import com.yunzhupaas.flowable.entity.TaskEntity; +import com.yunzhupaas.flowable.entity.TemplateNodeEntity; +import com.yunzhupaas.flowable.model.operator.AddSignModel; +import com.yunzhupaas.flowable.model.templatenode.FlowErrorModel; +import com.yunzhupaas.flowable.model.templatenode.TaskNodeModel; +import com.yunzhupaas.flowable.model.templatenode.nodejson.Assign; +import com.yunzhupaas.flowable.model.templatenode.nodejson.NodeModel; +import com.yunzhupaas.flowable.model.templatenode.nodejson.ProperCond; +import com.yunzhupaas.permission.entity.UserEntity; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2024/6/24 下午4:57 + */ +@Data +@Accessors(chain = true) +public class FlowMethod { + //handleAssignOperator + /** + * 任务主键 + */ + public String taskId; + /** + * 审批对象 + */ + private FlowModel flowModel; + + //createOperator + /** + * 经办实体 + */ + private OperatorEntity operatorEntity; + /** + * 状态 + */ + private Integer state; + /** + * 节点 + */ + private NodeModel nodeModel; + + //prevNodeList + /** + * flowable部署id + */ + private String deploymentId; + /** + * 节点编码 + */ + private String nodeCode; + /** + * 节点对象 + */ + private List nodeEntityList; + private List nodeCodeList; + + //handleErrorRule + private List errorList; + + //handleCondition + /** + * 表单数据 + */ + private Map formData = new HashMap<>(); + /** + * 节点集合 + */ + private Map nodes; + /** + * 任务 + */ + private TaskEntity taskEntity; + + //completeNode + /** + * flowable主键 + */ + private String flowableTaskId; + /** + * 结果Map + */ + private Map resMap = new HashMap<>(); + + + //FlowDataModel + /** + * 节点对象 + */ + private TemplateNodeEntity nodeEntity; + // false 仅查询表单数据 + /** + * 是否保存表单数据 + */ + private Boolean isAssign = true; + /** + * 是否查询数据 + */ + private Boolean isData = true; + + //getNextApprover + /** + * 下一节点 + */ + private List nextNode = new ArrayList<>(); + + + //RecordModel + /** + * 记录操作类型,RecordEnum + */ + private Integer type; + /** + * 流转操作人,如加签给谁 + */ + private String userId; + + + //improperSort + /** + * 审批用户 + */ + private List userIds; + + + //TaskOperator + /** + * 异常规则 + */ + private Boolean errorRule = false; + /** + * 附加条件 + */ + private Boolean extraRule = false; + /** + * 默认审批通过 + */ + private Integer pass = 0; + /** + * 无法提交 + */ + private Integer notSubmit = 0; + /** + * 上一节点审批人指定处理人 + */ + private Integer node = 0; + + //rule + private Integer rule; + + //getManageOrgByLevel + private String organizeOrManager; + private Integer level; + + //formData + private List assignListAll; + + + //checkNextCandidates + private List nodeList; + + //deleteFormData + private List taskList; + + + //getConditionResult + /** + * 出线集合 + */ + private List outgoingFlows; + + /** + * 条件 + */ + private List conditions; + + /** + * 条件匹配逻辑 + */ + private String matchLogic; + + //checkPrint + /** + * 打印对象 + */ + private List printNodeList; + + private String handId; + + /** + * 未经过的节点 + */ + private List tobePass; + /** + * 当前节点 + */ + private List currentNodes; + /** + * 是否签收 + */ + private Boolean signFor; + + /** + * 审批方式 + */ + private Integer handleStatus; + + /** + * 加签审批方式 + */ + private AddSignModel addSignModel; + + /** + * 当前用户 + */ + private UserEntity userEntity; + + /** + * 创建人 + */ + private UserEntity createUser; + + /** + * 委托人 + */ + private UserEntity delegate; + + /** + * 用户信息 + */ + private UserInfo userInfo; + + /** + * 经办集合 + */ + private List operatorList; + + /** + * 抄送集合 + */ + List circulateList = new ArrayList<>(); + + /** + * 选择分支时(true) 判断 审批比例 标识 + */ + private Boolean auditFlag = false; + + /** + * 获取下一级节点,是否获取子流程节点 + */ + private Boolean nextSubFlow = false; + + /** + * 子流程表单数据 + */ + private Map subFormData = new HashMap<>(); + + /** + * 是否撤销流程 + */ + private Boolean isRevoke = false; + +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/task/FlowModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/task/FlowModel.java new file mode 100644 index 0000000..7f96490 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/task/FlowModel.java @@ -0,0 +1,261 @@ +package com.yunzhupaas.flowable.model.task; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.flowable.entity.*; +import com.yunzhupaas.flowable.enums.TaskStatusEnum; +import com.yunzhupaas.flowable.model.operator.AddSignModel; +import com.yunzhupaas.flowable.model.templatejson.TemplateJsonInfoVO; +import com.yunzhupaas.flowable.model.templatenode.FlowErrorModel; +import com.yunzhupaas.flowable.model.templatenode.TaskNodeModel; +import com.yunzhupaas.flowable.model.templatenode.nodejson.NodeModel; +import com.yunzhupaas.flowable.model.util.FlowNature; +import lombok.Data; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:17 + */ +@Data +@JsonInclude +public class FlowModel extends FlowHandleModel { + /** + * 判断新增 + **/ + @Schema(description = "判断新增") + private String id; + /** + * 版本ID + **/ + @Schema(description = "版本ID") + private String flowId; + /** + * 部署id + **/ + @Schema(description = "部署id") + private String deploymentId; + + private TemplateJsonEntity jsonEntity; + private TaskEntity taskEntity = new TaskEntity(); + private List nodeEntityList = new ArrayList<>(); + private Map nodes = new HashMap<>(); + private String flowableTaskId; + private TemplateNodeEntity nodeEntity = new TemplateNodeEntity(); + /** + * 加签参数 + */ + private AddSignModel addSignParameter = new AddSignModel(); + /** + * 审批处理标识,0.拒绝 1.同意 + */ + private Integer handleStatus = FlowNature.AuditCompletion; + /** + * 任务详情类型 + * -1-我发起的新建/编辑 + * 0-我发起的详情 + * 1-待签事宜 + * 2-待办事宜 + * 3-在办事宜 + * 4-已办事宜 + * 5-抄送事宜 + * 6-流程监控 + */ + private String opType = "-1"; + + private TemplateJsonInfoVO jsonInfoVO = new TemplateJsonInfoVO(); + private OperatorEntity operatorEntity = new OperatorEntity(); + private RecordEntity recordEntity = new RecordEntity(); + private List list = new ArrayList<>(); + private List taskList = new ArrayList<>(); + private TemplateEntity templateEntity = new TemplateEntity(); + + /** + * 判断撤回的标识 1.发起撤回 2.审批撤回 + */ + private Integer flag = 1; + /** + * 事件状态 + */ + private Integer eventStatus = 0; + /** + * 判断撤回时,为true会抛出异常 + */ + private Boolean isException = false; + /** + * 下一级节点编码 + */ + private List nextCodes = new ArrayList<>(); + + /** + * 挂起,0.全部 1.仅主流程 + */ + private Integer pause = 0; + /** + * 流程结束是否更新为结束节点 + */ + private Boolean finishFlag = true; + + /** + * 子流程节点编码 + */ + private String subCode; + /** + * 子流程参数 + */ + private SubParameterModel subParameter; + /** + * 流程详情节点 + */ + private List nodeList = new ArrayList<>(); + /** + * 是否流程,0-菜单 1-发起 + */ + private Integer isFlow = 0; + /** + * 签名主键 + */ + private String signId; + /** + * 下次继续使用此签名 + */ + private Boolean useSignNext = false; + /** + * 触发动作,1同意 2拒绝 3退回 + */ + private Integer action; + /** + * 拒绝直接结束的触发标识 + */ + private Boolean rejectTrigger = false; + /** + * 退回id,任务流程为退回触发时,获取最后一个执行节点的id用于退回 + */ + private String backId; + + /** + * 流程主键 + **/ + @Schema(description = "流程主键") + private String processId; + /** + * 流程标题 + **/ + @Schema(description = "流程标题") + private String flowTitle; + /** + * 紧急程度 + */ + @Schema(description = "紧急程度") + private Integer flowUrgent = 1; + /** + * 流水号 + **/ + @Schema(description = "流水号") + private String billNo; + /** + * 0.保存 1.提交 + **/ + @Schema(description = "类型") + private Integer status = TaskStatusEnum.TO_BE_SUBMIT.getCode(); + /** + * 父级实例节点编码 + */ + @Schema(description = "父级实例节点编码") + private String parentCode; + /** + * 子流程 + **/ + @Schema(description = "子流程") + private String parentId = FlowNature.ParentId; + /** + * 创建人 + **/ + @Schema(description = "创建人") + private String userId; + /** + * 被委托人 + */ + @Schema(description = "被委托人") + private String delegateUser; + /** + * 当前经办id + **/ + @Schema(description = "当前经办id") + private String operatorId; + /** + * 回流id + */ + @Schema(description = "回流主键") + private String rollbackId; + /** + * 任务主键 + */ + @Schema(description = "任务主键") + private String taskId; + /** + * 任务主键 + */ + @Schema(description = "变更节点") + private String taskNodeId; + /** + * 是否冻结审批 + */ + private Boolean rejectUser = false; + /** + * 子流程,是否异步 + **/ + private Integer isAsync = 0; + /** + * 用户信息 + */ + private UserInfo userInfo; + /** + * 定时器 + */ + private Boolean isTimer = false; + /** + * 系统主键 + */ + private String systemId; + /** + * 自动审批 + */ + private Boolean voluntarily = false; + + /** + * 抄送消息标识 + */ + private Boolean copyMsgFlag = true; + /** + * 自动转审,走指派方法的标识 + */ + private Boolean autoTransferFlag = false; + /** + * 子流程是否暂存标识 + */ + private Boolean subFlow = false; + + private List errorList = new ArrayList<>(); + + /** + * 流程模板id + */ + private String templateId; + /** + * 发起人 + */ + private List userIds = new ArrayList<>(); + /** + * 表单数据集合 + */ + private List> formDataList = new ArrayList<>(); +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/task/RevokeFormDataModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/task/RevokeFormDataModel.java new file mode 100644 index 0000000..d04d21c --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/task/RevokeFormDataModel.java @@ -0,0 +1,34 @@ +package com.yunzhupaas.flowable.model.task; + +import lombok.Data; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/8/26 11:00 + */ +@Data +public class RevokeFormDataModel { + /** + * 审批编号 + */ + private String billRule; + /** + * 提交时间 + */ + private Long creatorTime; + /** + * 撤销理由 + */ + private String handleOpinion; + /** + * 关联流程id + */ + private String revokeTaskId; + /** + * 关联流程名称 + */ + private String revokeTaskName; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/task/SubParameterModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/task/SubParameterModel.java new file mode 100644 index 0000000..765679c --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/task/SubParameterModel.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.flowable.model.task; + +import lombok.Data; + +/** + * 任务子流程参数 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/21 9:43 + */ +@Data +public class SubParameterModel { + /** + * 子流程 上一级任务 节点编码(如果子流程是合流节点 就存最后一个审批的分流节点) + */ + private String parentCode; + /** + * flowable task id + */ + private String nodeId; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/task/TaskPagination.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/task/TaskPagination.java new file mode 100644 index 0000000..18f787d --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/task/TaskPagination.java @@ -0,0 +1,44 @@ +package com.yunzhupaas.flowable.model.task; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.PaginationTime; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/22 9:06 + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class TaskPagination extends PaginationTime { + @Schema(description = "所属名称") + private String flowId; + @Schema(description = "分类") + private String flowCategory; + @Schema(description = "紧急程度") + private Integer flowUrgent; + @Schema(description = "所属流程") + private String templateId; + @Schema(description = "状态") + private Integer status; + @Schema(description = "用户主键") + private String creatorUserId; + @Schema(description = "编码") + private String nodeCode; + /** + * 待签、待办、在办、已办、批量在办 + */ + private String category; + + @JsonIgnore + private Boolean delegateType = false; + @JsonIgnore + private String userId; + @JsonIgnore + private Integer isBatch; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/task/TaskUserListModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/task/TaskUserListModel.java new file mode 100644 index 0000000..f308158 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/task/TaskUserListModel.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.flowable.model.task; + +import com.yunzhupaas.flowable.entity.CirculateEntity; +import com.yunzhupaas.flowable.entity.OperatorEntity; +import com.yunzhupaas.flowable.entity.RecordEntity; +import com.yunzhupaas.flowable.entity.TaskEntity; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/21 11:15 + */ +@Data +public class TaskUserListModel { + + private List allUserIdList; + + private TaskEntity flowTask; + + private List operatorList = new ArrayList<>(); + + private List circulateList = new ArrayList<>(); + + private List operatorRecordList = new ArrayList<>(); +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/task/TaskVo.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/task/TaskVo.java new file mode 100644 index 0000000..b115cac --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/task/TaskVo.java @@ -0,0 +1,151 @@ +package com.yunzhupaas.flowable.model.task; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/17 15:02 + */ +@Data +public class TaskVo implements Serializable { + /** + * 主键 + */ + @Schema(description = "主键") + private String id; + /** + * 任务编码 + */ + @Schema(description = "任务编码") + private String enCode; + + /** + * 任务标题 + */ + @Schema(description = "任务标题") + private String fullName; + + /** + * 流程名称 + */ + @Schema(description = "流程名称") + private String flowName; + + /** + * 流程编码 + */ + @Schema(description = "流程编码") + private String flowCode; + + /** + * 任务状态 + */ + @Schema(description = "任务状态") + private Integer status; + + /** + * 流程分类 + */ + @Schema(description = "流程分类") + private String flowCategory; + + /** + * 流程类型 + */ + @Schema(description = "流程类型") + private String flowType; + + /** + * 流程版本 + */ + @Schema(description = "流程版本") + private String flowVersion; + + /** + * 同步异步(0:同步,1:异步) + */ + @Schema(description = "同步异步(0:同步,1:异步)") + private Integer isAsync; + + /** + * 父级实例id + */ + @Schema(description = "父级实例id") + private String parentId; + + /** + * 紧急程度 + */ + @Schema(description = "紧急程度") + private Integer flowUrgent; + + /** + * 流程主键 + */ + @Schema(description = "流程主键") + private String templateId; + + /** + * 流程版本主键 + */ + @Schema(description = "流程版本主键") + private String flowId; + + /** + * 流程引擎实例id + */ + @Schema(description = "流程引擎实例id") + private String instanceId; + /** + * 流程引擎类型;1.flowable,2,activity,3.camunda + */ + @Schema(description = "流程引擎类型;1.flowable,2,activity,3.camunda") + private Integer engineType; + + /** + * 委托用户 + */ + @Schema(description = "委托用户") + private String delegateUser; + /** + * 开始时间 + */ + @Schema(description = "开始时间") + private Date startTime; + /** + * 结束时间 + */ + @Schema(description = "结束时间") + private Date endTime; + /** + * 当前节点名称 + */ + @Schema(description = "当前节点名称") + private String currentNodeName; + /** + * 创建人 + */ + @Schema(description = "创建人") + private String creatorUser; + /** + * 创建人头像 + */ + @Schema(description = "创建人头像") + private String headIcon; + /** + * 创建时间 + */ + @Schema(description = "创建时间") + private Date creatorTime; + /** + * 是否撤销流程 + */ + private Boolean isRevokeTask = false; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/task/ViewFormModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/task/ViewFormModel.java new file mode 100644 index 0000000..d71f623 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/task/ViewFormModel.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.flowable.model.task; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.HashMap; +import java.util.Map; + +/** + * 查看表单 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/8/29 9:42 + */ +@Data +public class ViewFormModel { + @Schema(description = "表单详情") + private Object formInfo; + @Schema(description = "表单数据") + private Map formData = new HashMap<>(); +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/BeforeInfoVo.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/BeforeInfoVo.java new file mode 100644 index 0000000..b6c8147 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/BeforeInfoVo.java @@ -0,0 +1,67 @@ +package com.yunzhupaas.flowable.model.template; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.flowable.model.record.ProgressModel; +import com.yunzhupaas.flowable.model.record.RecordVo; +import com.yunzhupaas.flowable.model.task.TaskVo; +import com.yunzhupaas.flowable.model.templatejson.TemplateJsonInfoVO; +import com.yunzhupaas.flowable.model.templatenode.ButtonModel; +import com.yunzhupaas.flowable.model.templatenode.TaskNodeModel; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 发起、审批详情 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/17 15:32 + */ +@Data +public class BeforeInfoVo implements Serializable { + + @Schema(description = "当前节点属性") + private Map nodeProperties = new HashMap<>(); + + @Schema(description = "表单详情") + private Object formInfo; + + @Schema(description = "流程详情") + private TemplateJsonInfoVO flowInfo; + + @Schema(description = "流程任务") + private TaskVo taskInfo; + + /** + * 用于节点的完成情况、经办人等 + */ + @Schema(description = "节点") + private List nodeList = new ArrayList<>(); + + @Schema(description = "流转记录") + private List recordList = new ArrayList<>(); + + @Schema(description = "表单权限") + private List> formOperates = new ArrayList<>(); + + @Schema(description = "表单数据") + private Map formData = new HashMap<>(); + + @Schema(description = "按钮控制") + private ButtonModel btnInfo; + + @Schema(description = "进度") + private List progressList = new ArrayList<>(); + + @Schema(description = "草稿") + private Object draftData; + + @Schema(description = "最新的线的集合") + private List lineKeyList = new ArrayList<>(); +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/FlowByFormModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/FlowByFormModel.java new file mode 100644 index 0000000..fed4e19 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/FlowByFormModel.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.flowable.model.template; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/24 9:57 + */ +@Data +public class FlowByFormModel { + /** + * 流程集合 + */ + private List list = new ArrayList<>(); + /** + * 是否绑定流程 + */ + private Boolean isConfig = false; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/FlowConfigModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/FlowConfigModel.java new file mode 100644 index 0000000..54551bc --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/FlowConfigModel.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.flowable.model.template; + +import lombok.Data; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/7/22 11:15 + */ +@Data +public class FlowConfigModel { + /** + * 发起可见类型(1-全部 2-权限) + */ + private Integer visibleType = 1; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/TemplateByFormModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/TemplateByFormModel.java new file mode 100644 index 0000000..6978d52 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/TemplateByFormModel.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.flowable.model.template; + +import lombok.Data; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/22 11:20 + */ +@Data +public class TemplateByFormModel { + /** + * 流程版本主键 + */ + private String id; + /** + * 流程名称 + */ + private String fullName; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/TemplateCrForm.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/TemplateCrForm.java new file mode 100644 index 0000000..33d9c59 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/TemplateCrForm.java @@ -0,0 +1,52 @@ +package com.yunzhupaas.flowable.model.template; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class TemplateCrForm { + + @Schema(description = "流程编码") + private String enCode; + + @Schema(description = "流程名称") + private String fullName; + + /** + * 0.标准 1.简流 + */ + @Schema(description = "流程类型") + private Integer type = 0; + + @Schema(description = "流程分类") + private String category; + + @Schema(description = "图标") + private String icon; + + @Schema(description = "图标背景色") + private String iconBackground; + +// @Schema(description = "流程参数") +// private String configuration; + + @Schema(description = "说明") + private String description; + + @Schema(description = "排序") + private Long sortCode; + + @Schema(description = "流程设置") + private String flowConfig; + + /** + * 流程显示类型(0-全局 1-流程 2-菜单) + */ + private Integer showType = 0; + /** + * 状态(0.未上架,1.上架,2.下架-继续审批,3.下架-隐藏审批) + */ + private Integer status = 0; + +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/TemplateExportModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/TemplateExportModel.java new file mode 100644 index 0000000..8f32200 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/TemplateExportModel.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.flowable.model.template; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.flowable.entity.TemplateEntity; +import com.yunzhupaas.flowable.entity.TemplateNodeEntity; +import com.yunzhupaas.flowable.model.templatejson.TemplateJsonExportModel; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 定义导出 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/17 10:38 + */ +@Data +public class TemplateExportModel implements Serializable { + @Schema(description = "流程定义") + private TemplateEntity template; + + @Schema(description = "流程定义版本") + private TemplateJsonExportModel flowVersion; + + @Schema(description = "流程节点") + private List nodeList; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/TemplateInfoVO.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/TemplateInfoVO.java new file mode 100644 index 0000000..6016af2 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/TemplateInfoVO.java @@ -0,0 +1,9 @@ +package com.yunzhupaas.flowable.model.template; + +import lombok.Data; + +@Data +public class TemplateInfoVO extends TemplateUpForm { + private Integer visibleType; +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/TemplatePageLisVO.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/TemplatePageLisVO.java new file mode 100644 index 0000000..6aacb8e --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/TemplatePageLisVO.java @@ -0,0 +1,41 @@ +package com.yunzhupaas.flowable.model.template; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +@Data +public class TemplatePageLisVO { + @Schema(description = "流程编码") + private String enCode; + @Schema(description = "流程名称") + private String fullName; + @Schema(description = "主键") + private String id; + @Schema(description = "流程分类") + private String category; + @Schema(description = "流程类型") + private Integer type; + @Schema(description = "排序码") + private Long sortCode; + @Schema(description = "图标") + private String icon; + @Schema(description = "图标背景色") + private String iconBackground; + @Schema(description = "创建人") + private String creatorUser; + @Schema(description = "创建时间") + private Date creatorTime; + @Schema(description = "有效标志") + private Integer enabledMark; + @Schema(description = "有效标志") + private Integer visibleType; + @Schema(description = "版本主键") + private String flowId; + @Schema(description = "流程显示类型(0-全局 1-流程 2-菜单)") + private Integer showType; + @Schema(description = "状态(0.未上架,1.上架,2.下架-继续审批,3.下架-隐藏审批)") + private Integer status; +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/TemplatePageModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/TemplatePageModel.java new file mode 100644 index 0000000..76ae92d --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/TemplatePageModel.java @@ -0,0 +1,40 @@ +package com.yunzhupaas.flowable.model.template; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +@Data +public class TemplatePageModel { + @Schema(description = "流程编码") + private String enCode; + @Schema(description = "流程名称") + private String fullName; + @Schema(description = "版本主键") + private String id; + @Schema(description = "流程分类") + private String category; + @Schema(description = "流程类型") + private Integer type; + @Schema(description = "排序码") + private Long sortCode; + @Schema(description = "图标") + private String icon; + @Schema(description = "图标背景色") + private String iconBackground; + @Schema(description = "创建人") + private String creatorUser; + @Schema(description = "创建时间") + private Long creatorTime; + @Schema(description = "有效标志") + private Integer enabledMark; + @Schema(description = "有效标志") + private Integer visibleType; + @Schema(description = "定义主键") + private String templateId; + + @Schema(description = "是否常用") + private Boolean isCommonFlow; +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/TemplatePageVo.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/TemplatePageVo.java new file mode 100644 index 0000000..ffdc342 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/TemplatePageVo.java @@ -0,0 +1,40 @@ +package com.yunzhupaas.flowable.model.template; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +@Data +public class TemplatePageVo { + @Schema(description = "流程编码") + private String enCode; + @Schema(description = "流程名称") + private String fullName; + @Schema(description = "版本主键") + private String id; + @Schema(description = "流程分类") + private String category; + @Schema(description = "流程类型") + private Integer type; + @Schema(description = "排序码") + private Long sortCode; + @Schema(description = "图标") + private String icon; + @Schema(description = "图标背景色") + private String iconBackground; + @Schema(description = "创建人") + private String creatorUser; + @Schema(description = "创建时间") + private Date creatorTime; + @Schema(description = "有效标志") + private Integer enabledMark; + @Schema(description = "有效标志") + private Integer visibleType; + @Schema(description = "定义主键") + private String templateId; + + @Schema(description = "是否常用") + private Boolean isCommonFlow; +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/TemplatePagination.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/TemplatePagination.java new file mode 100644 index 0000000..8bbcde9 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/TemplatePagination.java @@ -0,0 +1,33 @@ +package com.yunzhupaas.flowable.model.template; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.ArrayList; +import java.util.List; + +@EqualsAndHashCode(callSuper = true) +@Data +@Schema(description = "分页模型") +public class TemplatePagination extends Pagination { + @Schema(description = "分类") + private String category; + @Schema(description = "标志") + private Integer enabledMark; + @Schema(description = "类型") + private Integer type; + @Schema(description = "权限过滤") + private Integer isAuthority = 1; + @Schema(description = "是否委托代理列表,1-委托代理列表") + private Integer isDelegate = 0; + @Schema(description = "委托人") + private String delegateUser; + @Schema(description = "是否发起列表(0-否 1-是)") + private Integer isLaunch = 0; + @JsonIgnore + private List templateIdList = new ArrayList<>(); +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/TemplateTreeListVo.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/TemplateTreeListVo.java new file mode 100644 index 0000000..4832222 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/TemplateTreeListVo.java @@ -0,0 +1,39 @@ +package com.yunzhupaas.flowable.model.template; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/25 19:41 + */ +@Data +public class TemplateTreeListVo { + @Schema(description = "编码") + private String enCode; + @Schema(description = "数量") + private Integer num; + @Schema(description = "名称") + private String fullName; + @Schema(description = "主键") + private String id; + @Schema(description = "流程分类") + private String category; + @Schema(description = "排序码") + private Long sortCode; + @Schema(description = "图标") + private String icon; + @Schema(description = "图标背景色") + private String iconBackground; + @Schema(description = "有效标志") + private Integer enabledMark; + @Schema(description = "是否选择") + private Boolean disabled = false; + @Schema(description = "子节点") + private List children; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/TemplateUpForm.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/TemplateUpForm.java new file mode 100644 index 0000000..db26a12 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/TemplateUpForm.java @@ -0,0 +1,11 @@ +package com.yunzhupaas.flowable.model.template; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class TemplateUpForm extends TemplateCrForm { + @Schema(description = "流程主键") + private String id; +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/UpDownModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/UpDownModel.java new file mode 100644 index 0000000..9bdc4ee --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/template/UpDownModel.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.flowable.model.template; + +import lombok.Data; + +/** + * 上架下架参数类 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/11/28 9:06 + */ +@Data +public class UpDownModel { + /** + * 0.上架 1.下架 + */ + private Integer isUp = 0; + /** + * 0.继续审批 1.隐藏审批数据 + */ + private Integer isHidden = 0; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatejson/FlowFormModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatejson/FlowFormModel.java new file mode 100644 index 0000000..6dbbcd5 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatejson/FlowFormModel.java @@ -0,0 +1,30 @@ +package com.yunzhupaas.flowable.model.templatejson; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/6/25 17:34 + */ +@Data +public class FlowFormModel { + /** + * 版本id + */ + private String flowId; + /** + * 表单id + */ + private String formId; + + /** + * 可以审批用户 + */ + private List userId = new ArrayList<>(); +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatejson/FlowListModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatejson/FlowListModel.java new file mode 100644 index 0000000..e579d2f --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatejson/FlowListModel.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.flowable.model.templatejson; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/7/5 15:40 + */ +@Data +public class FlowListModel { + @Schema(description = "名称") + private String fullName; + @Schema(description = "主键") + private String id; + @Schema(description = "编码") + private String enCode; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatejson/FlowParamModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatejson/FlowParamModel.java new file mode 100644 index 0000000..01a3bd4 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatejson/FlowParamModel.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.flowable.model.templatejson; + +import lombok.Data; + +/** + * 流程参数 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/6/12 9:08 + */ +@Data +public class FlowParamModel { + private String id; + private String fieldName; + private String dataType; + private String defaultValue; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatejson/TemplateJsonExportModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatejson/TemplateJsonExportModel.java new file mode 100644 index 0000000..3c441bf --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatejson/TemplateJsonExportModel.java @@ -0,0 +1,52 @@ +package com.yunzhupaas.flowable.model.templatejson; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * 版本导出 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/17 10:48 + */ +@Data +public class TemplateJsonExportModel implements Serializable { + /** + * 流程模板id + */ + @Schema(description = "流程模板id") + private String templateId; + + /** + * 可见类型 1.公开 2.权限设置 + */ + @Schema(description = "可见类型 1.公开 2.权限设置") + private Integer visibleType; + + /** + * 流程版本 + */ + @Schema(description = "流程版本") + private String flowVersion; + + /** + * 状态(0.设计,1.启用,2.历史) + */ + @Schema(description = "状态(0.设计,1.启用,2.历史)") + private Integer state; + + /** + * 流程模板 + */ + @Schema(description = "流程模板") + private String flowXml; + + /** + * 消息配置id + */ + @Schema(description = "消息配置id") + private String sendConfigIds; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatejson/TemplateJsonInfoVO.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatejson/TemplateJsonInfoVO.java new file mode 100644 index 0000000..f926a14 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatejson/TemplateJsonInfoVO.java @@ -0,0 +1,11 @@ +package com.yunzhupaas.flowable.model.templatejson; + +import com.yunzhupaas.flowable.model.templatenode.TemplateNodeUpFrom; +import lombok.Data; + +@Data +public class TemplateJsonInfoVO extends TemplateNodeUpFrom { + private String flowableId; + +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatejson/TemplateJsonSelectVO.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatejson/TemplateJsonSelectVO.java new file mode 100644 index 0000000..6ed195b --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatejson/TemplateJsonSelectVO.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.flowable.model.templatejson; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class TemplateJsonSelectVO { + @Schema(description = "流程状态") + private Integer state; + @Schema(description = "流程状态") + private Integer enabledMark; + @Schema(description = "流程主键") + private String id; + @Schema(description = "流程名称") + private String fullName; + @Schema(description = "流程名称") + private String flowVersion; +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/BackNodeModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/BackNodeModel.java new file mode 100644 index 0000000..9048bba --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/BackNodeModel.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.flowable.model.templatenode; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/8 11:33 + */ +@Data +public class BackNodeModel { + /** + * 节点编码 + */ + @Schema(description = "节点编码") + private String nodeCode; + /** + * 节点名称 + */ + @Schema(description = "节点名称") + private String nodeName; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/ButtonModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/ButtonModel.java new file mode 100644 index 0000000..dcfb7d6 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/ButtonModel.java @@ -0,0 +1,153 @@ +package com.yunzhupaas.flowable.model.templatenode; + +import lombok.Data; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/16 16:56 + */ +@Data +public class ButtonModel { + /** + * 通过按钮开关 + */ + private Boolean hasAuditBtn = false; + + /** + * 拒绝按钮开关 + */ + private Boolean hasRejectBtn = false; + + /** + * 退回按钮开关 + */ + private Boolean hasBackBtn = false; + + /** + * 加签按钮开关 + */ + private Boolean hasFreeApproverBtn = false; + + /** + * 减签按钮开关 + */ + private Boolean hasReduceApproverBtn = false; + + /** + * 转审按钮开关 + */ + private Boolean hasTransferBtn = false; + + /** + * 协办按钮开关 + */ + private Boolean hasAssistBtn = false; + + /** + * 审批暂存按钮开关 + */ + private Boolean hasSaveAuditBtn = false; + + /** + * 暂存 + */ + private Boolean hasSaveBtn = false; + + /** + * 提交按钮开关 + */ + private Boolean hasSubmitBtn = false; + + /** + * 发起撤回按钮开关 + */ + private Boolean hasRecallLaunchBtn = false; + + /** + * 催办按钮开关 + */ + private Boolean hasPressBtn = false; + + /** + * 撤销按钮开关 + */ + private Boolean hasRevokeBtn = false; + + /** + * 审批撤回按钮开关 + */ + private Boolean hasRecallAuditBtn = false; + + /** + * 签收按钮开关 + */ + private Boolean hasSignBtn = false; + + /** + * 办理按钮开关 + */ + private Boolean hasTransactBtn = false; + + /** + * 退签按钮开关 + */ + private Boolean hasReduceSignBtn = false; + + /** + * 终止按钮开关 + */ + private Boolean hasCancelBtn = false; + + /** + * 协办保存 + */ + private Boolean hasAssistSaveBtn = false; + + /** + * 指派 + */ + private Boolean hasAssignBtn = false; + + /** + * 复活 + */ + private Boolean hasActivateBtn = false; + + /** + * 暂停 + */ + private Boolean hasPauseBtn = false; + + /** + * 恢复 + */ + private Boolean hasRebootBtn = false; + + /** + * 打印 + */ + private Boolean hasPrintBtn = false; + + /** + * 归档按钮 + */ + private Boolean hasFileBtn = false; + + /** + * 查看发起表单 + */ + private Boolean hasViewStartFormBtn = false; + + /** + * 委托发起按钮 + */ + private Boolean hasDelegateSubmitBtn = false; + + /** + * 代理标识 + */ + private Boolean proxyMark = false; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/FlowErrorModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/FlowErrorModel.java new file mode 100644 index 0000000..68d5d00 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/FlowErrorModel.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.flowable.model.templatenode; + +import lombok.Data; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/6/5 18:01 + */ +@Data +public class FlowErrorModel { + private String nodeCode; + private String nodeName; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/TaskNodeModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/TaskNodeModel.java new file mode 100644 index 0000000..cf2d35a --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/TaskNodeModel.java @@ -0,0 +1,45 @@ +package com.yunzhupaas.flowable.model.templatenode; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/26 10:05 + */ +@Data +public class TaskNodeModel implements Serializable { + + /** + * 节点类型 + */ + @Schema(description = "节点类型") + private String nodeType; + /** + * 节点编码 + */ + @Schema(description = "节点编码") + private String nodeCode; + /** + * 节点名称 + */ + @Schema(description = "节点名称") + private String nodeName; + + /** + * 审核用户 + */ + @Schema(description = "审核用户") + private String userName; + /** + * 节点类型(-1没有经过,0.经过 1.当前 2.未经过 3.异常) + */ + @Schema(description = "节点类型(-1没有经过,0.经过 1.当前 2.未经过 3.异常)") + private String type; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/TemplateNodeCrFrom.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/TemplateNodeCrFrom.java new file mode 100644 index 0000000..8946b04 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/TemplateNodeCrFrom.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.flowable.model.templatenode; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.flowable.model.template.TemplateCrForm; +import lombok.Data; + +import java.util.HashMap; +import java.util.Map; + +@Data +public class TemplateNodeCrFrom extends TemplateCrForm { + + @Schema(description = "流程节点") + private Map> flowNodes = new HashMap<>(); + + @Schema(description = "流程xml") + private String flowXml; + +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/TemplateNodeUpFrom.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/TemplateNodeUpFrom.java new file mode 100644 index 0000000..83e11fc --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/TemplateNodeUpFrom.java @@ -0,0 +1,15 @@ +package com.yunzhupaas.flowable.model.templatenode; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class TemplateNodeUpFrom extends TemplateNodeCrFrom { + + @Schema(description = "流程模板主键") + private String id; + + @Schema(description = "流程版本主键") + private String flowId; +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/Assign.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/Assign.java new file mode 100644 index 0000000..5d7b667 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/Assign.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.flowable.model.templatenode.nodejson; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/16 9:59 + */ +@Data +public class Assign implements Serializable { + /** + * 节点编码 + */ + @Schema(description = "节点编码") + private String nodeId; + /** + * 传递规则 + */ + @Schema(description = "传递规则") + private List ruleList = new ArrayList<>(); +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/AssignRule.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/AssignRule.java new file mode 100644 index 0000000..08ab5a7 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/AssignRule.java @@ -0,0 +1,32 @@ +package com.yunzhupaas.flowable.model.templatenode.nodejson; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * 传递规则 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/16 9:59 + */ +@Data +public class AssignRule implements Serializable { + /** + * 父字段 + **/ + @Schema(description = "父字段") + private String parentField; + /** + * 子字段 + **/ + @Schema(description = "子字段") + private String childField; + /** + * 表单ID + **/ + @Schema(description = "表单ID") + private String formId; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/AutoAuditRule.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/AutoAuditRule.java new file mode 100644 index 0000000..372ac7a --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/AutoAuditRule.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.flowable.model.templatenode.nodejson; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 自动审批 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/18 17:23 + */ +@Data +public class AutoAuditRule implements Serializable { + /** + * 逻辑 + **/ + @Schema(description = "逻辑") + private String matchLogic; + /** + * 条件 + **/ + @Schema(description = "条件") + private List conditions = new ArrayList<>(); +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/AutoSubmitConfig.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/AutoSubmitConfig.java new file mode 100644 index 0000000..fda5ce4 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/AutoSubmitConfig.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.flowable.model.templatenode.nodejson; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class AutoSubmitConfig { + /** + * 相邻节点审批人重复 + */ + @Schema(description = "相邻节点审批人重复") + private Boolean adjacentNodeApproverRepeated = false; + /** + * 审批人审批过该流程 + */ + @Schema(description = "审批人审批过该流程") + private Boolean ApproverHasApproval = false; + /** + * 发起人与审批人重复 + */ + @Schema(description = "发起人与审批人重复") + private Boolean initiatorApproverRepeated = false; +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/AuxiliaryInfo.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/AuxiliaryInfo.java new file mode 100644 index 0000000..2eb27d5 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/AuxiliaryInfo.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.flowable.model.templatenode.nodejson; + +import lombok.Data; + +/** + * 辅助信息 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/12/4 14:21 + */ +@Data +public class AuxiliaryInfo { + /** + * 3、附件信息 + */ + private Integer id; + private String fullName; + private AuxiliaryInfoConfig config = new AuxiliaryInfoConfig(); +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/AuxiliaryInfoConfig.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/AuxiliaryInfoConfig.java new file mode 100644 index 0000000..7a264b9 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/AuxiliaryInfoConfig.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.flowable.model.templatenode.nodejson; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/12/4 14:25 + */ +@Data +public class AuxiliaryInfoConfig { + private Integer on = 0; + + private String content; + + private List linkList = new ArrayList<>(); + private List dataList = new ArrayList<>(); + private List> fileList = new ArrayList<>(); + + /** + * 数据读取范围,近七天、近一个月、近半年、近一年、全部 + */ + private Integer dataRange = 0; +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/CounterSignConfig.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/CounterSignConfig.java new file mode 100644 index 0000000..1055b86 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/CounterSignConfig.java @@ -0,0 +1,54 @@ +package com.yunzhupaas.flowable.model.templatenode.nodejson; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.flowable.model.util.FlowNature; +import lombok.Data; + +import java.io.Serializable; + +/** + * 会签流转配置 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/16 10:09 + */ +@Data +public class CounterSignConfig implements Serializable { + /** + * 通过类型 0.无 1.百分比 2.人数 + */ + @Schema(description = "通过类型") + private Integer auditType = FlowNature.Percent; + /** + * 通过百分比 + */ + @Schema(description = "通过百分比") + private Integer auditRatio = 100; + /** + * 通过人数 + */ + @Schema(description = "通过人数") + private Integer auditNum = 1; + /** + * 拒绝类型 0.无 1.百分比 2.人数 + */ + @Schema(description = "拒绝类型") + private Integer rejectType = 0; + /** + * 拒绝百分比 + */ + @Schema(description = "拒绝百分比") + private Integer rejectRatio = 10; + /** + * 拒绝人数 + */ + @Schema(description = "拒绝人数") + private Integer rejectNum = 1; + /** + * 计算方式,1.实时计算 2.延后计算 + */ + @Schema(description = "计算方式") + private Integer calculateType = 1; +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/FileConfig.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/FileConfig.java new file mode 100644 index 0000000..e9b400a --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/FileConfig.java @@ -0,0 +1,30 @@ +package com.yunzhupaas.flowable.model.templatenode.nodejson; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.flowable.model.util.FlowNature; +import lombok.Data; + +@Data +public class FileConfig { + /** + * 流程归档配置 + */ + @Schema(description = "流程归档配置") + private Boolean on = false; + /** + * 1:当前流程所有人 2:流程发起人 3:最后节点审批人 + */ + @Schema(description = "查看权限") + private Integer permissionType = FlowNature.PermissionType; + /** + * 归档路径 + */ + @Schema(description = "归档路径") + private String parentId; + /** + * 归档模板 + */ + @Schema(description = "归档模板") + private String templateId; +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/FuncConfig.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/FuncConfig.java new file mode 100644 index 0000000..74a4d2c --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/FuncConfig.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.flowable.model.templatenode.nodejson; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/8/20 17:19 + */ +@Data +public class FuncConfig { + @Schema(description = "类型") + private Boolean on = false; + @Schema(description = "接口主键") + private String interfaceId; + @Schema(description = "数据") + private List templateJson = new ArrayList<>(); +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/GroupsModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/GroupsModel.java new file mode 100644 index 0000000..bc240df --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/GroupsModel.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.flowable.model.templatenode.nodejson; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class GroupsModel { + // 1.字段 2.公式 + @Schema(description = "类型") + private int fieldType = 1; + @Schema(description = "类型") + // 1.数据里面获取 //2.解析表达式 + private String field; + @Schema(description = "类型") + // 1.字段 2.自定义 4.流程参数 + private int fieldValueType = 2; + @Schema(description = "类型") + // 1.数据里面获取 2.直接获取 + private Object fieldValue; + @Schema(description = "属性") + private String symbol; + @Schema(description = "类型") + private String yunzhupaasKey; + @Schema(description = "类型") + private String fieldValueYunzhupaasKey; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/IntegrateParamModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/IntegrateParamModel.java new file mode 100644 index 0000000..6d037a1 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/IntegrateParamModel.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.flowable.model.templatenode.nodejson; + +import lombok.Data; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/9 10:49 + */ +@Data +public class IntegrateParamModel { + private String field; + private String fieldName; + private Boolean required = false; + private String relationField; + private String msgTemplateId; + private Boolean isSubTable = false; + private Integer sourceType = 2; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/IntegrateTplModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/IntegrateTplModel.java new file mode 100644 index 0000000..13b2d33 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/IntegrateTplModel.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.flowable.model.templatenode.nodejson; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/9 10:47 + */ +@Data +public class IntegrateTplModel { + // 远端接口 + private String field; + private Boolean required = false; + private Integer sourceType; + private String relationField; + + // 发送配置 + private String id; + private String templateId; + private String sendConfigId; + private String msgTemplateName; + private List paramJson = new ArrayList<>(); +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/InterfaceConfig.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/InterfaceConfig.java new file mode 100644 index 0000000..77489f1 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/InterfaceConfig.java @@ -0,0 +1,27 @@ +package com.yunzhupaas.flowable.model.templatenode.nodejson; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 接口服务 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/4/16 10:35 + */ +@Data +public class InterfaceConfig implements Serializable { + @Schema(description = "类型") + private Boolean on = false; + @Schema(description = "接口主键") + private String interfaceId; + @Schema(description = "接口名称") + private String interfaceName; + @Schema(description = "模块json") + private List templateJson = new ArrayList<>(); +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/MsgConfig.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/MsgConfig.java new file mode 100644 index 0000000..f2af95a --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/MsgConfig.java @@ -0,0 +1,30 @@ +package com.yunzhupaas.flowable.model.templatenode.nodejson; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 解析引擎 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Data +public class MsgConfig { + /** + * 0.关闭 1.自定义 2.同步发起配置 3.默认 + */ + @Schema(description = "类型") + private Integer on = 0; + @Schema(description = "消息主键") + private String msgId; + @Schema(description = "接口主键") + private String interfaceId; + @Schema(description = "数据") + private List templateJson = new ArrayList<>(); +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/NodeModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/NodeModel.java new file mode 100644 index 0000000..75ebdb5 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/NodeModel.java @@ -0,0 +1,868 @@ +package com.yunzhupaas.flowable.model.templatenode.nodejson; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.database.model.superQuery.SuperQueryJsonModel; +import com.yunzhupaas.flowable.enums.ErrorRuleEnum; +import com.yunzhupaas.flowable.model.templatejson.FlowParamModel; +import com.yunzhupaas.flowable.model.util.FlowNature; +import com.yunzhupaas.model.visualJson.FieLdsModel; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +@Data +public class NodeModel { + + /** + * 节点类型 + */ + @Schema(description = "节点类型") + private String type; + /** + * 节点id + */ + @Schema(description = "节点id") + private String nodeId; + /** + * 节点名称 + */ + @Schema(description = "节点名称") + private String nodeName; + + /*------------- 全局 -------------*/ + /** + * 可见的连线集合,用于条件判断 + */ + private List connectList = new ArrayList<>(); + /** + * 全局参数 + */ + @Schema(description = "全局参数") + private List globalParameterList = new ArrayList<>(); + /** + * 所有节点表单字段 + */ + @Schema(description = "所有节点表单字段") + private Map allFormMap; + /** + * 标题类型 0:默认 1:自定义 + */ + @Schema(description = "标题类型 0:默认 1:自定义") + private Integer titleType = FlowNature.TitleType; + /** + * 默认名称 + */ + @Schema(description = "默认名称") + private String defaultContent = "{发起用户名}的{流程名称}"; + /** + * 自定义名称 + */ + @Schema(description = "自定义名称") + private String titleContent; + /** + * 启用签名 + */ + @Schema(description = "启用签名") + private Boolean hasSign = false; + /** + * 允许撤销 + */ + @Schema(description = "允许撤销") + private Boolean hasRevoke = false; + /** + * 允许评论 + */ + @Schema(description = "允许评论") + private Boolean hasComment = true; + /** + * 显示评论已被删除提示 + */ + @Schema(description = "显示评论已被删除提示") + private Boolean hasCommentDeletedTips = true; + /** + * 审批任务是否签收 + */ + @Schema(description = "审批任务是否签收") + private Boolean hasSignFor = false; + /** + * 允许审批节点独立配置表单 + */ + @Schema(description = "允许审批节点独立配置表单") + private Boolean hasAloneConfigureForms = false; + /** + * 拒绝后允许流程继续流转审批 + */ + @Schema(description = "拒绝后允许流程继续流转审批") + private Boolean hasContinueAfterReject = false; + /** + * 允许发起人对当前逾期节点进行催办 + */ + @Schema(description = "逾期节点催办") + private Boolean hasInitiatorPressOverdueNode = true; + /** + * 自动提交规则 + */ + @Schema(description = "自动提交规则") + private AutoSubmitConfig autoSubmitConfig = new AutoSubmitConfig(); + /** + * 流程撤回规则 1: 不允许撤回 2: 发起节点允许撤回 3:所有节点允许撤回 + */ + @Schema(description = "流程撤回规则") + private Integer recallRule = 1; + /** + * 异常处理规则 1:超级管理员 2:指定人员 3:上一节点审批人指定 4:默认审批通过 5:无法提交 + */ + @Schema(description = "异常处理规则") + private Integer errorRule = ErrorRuleEnum.administrator.getCode(); + /** + * 异常处理指定人员 + */ + @Schema(description = "异常处理指定人员") + private List errorRuleUser = new ArrayList<>(); + /** + * 流程归档配置 + */ + @Schema(description = "流程归档配置") + private FileConfig fileConfig = new FileConfig(); + + /*------------- 开始 -------------*/ + /** + * 流程表单id + */ + @Schema(description = "流程表单id") + private String formId; + /** + * 流程表单名称 + */ + @Schema(description = "流程表单名称") + private String formName; + /** + * 流程表单权限 + */ + @Schema(description = "流程表单权限") + private List> formOperates = new ArrayList<>(); + /** + * 发起权限 1.公开 2.权限设置 + */ + @Schema(description = "发起权限 1.公开 2.权限设置") + private Integer launchPermission = FlowNature.LaunchPermission; + /** + * 打印配置 + */ + @Schema(description = "打印配置") + private PrintConfig printConfig = new PrintConfig(); + /** + * 限时设置配置 + */ + @Schema(description = "限时设置配置") + private TimeConfig timeLimitConfig = new TimeConfig(); + /** + * 提醒配置 + */ + @Schema(description = "提醒配置") + private TimeConfig noticeConfig = new TimeConfig(); + /** + * 超时设置 + */ + @Schema(description = "超时设置") + private TimeConfig overTimeConfig = new TimeConfig(); + /** + * 流程待办通知 + */ + @Schema(description = "流程待办通知") + public MsgConfig waitMsgConfig = new MsgConfig(); + /** + * 流程结束通知 + */ + @Schema(description = "流程结束通知") + public MsgConfig endMsgConfig = new MsgConfig(); + /** + * 节点同意通知 + */ + @Schema(description = "节点同意通知") + public MsgConfig approveMsgConfig = new MsgConfig(); + /** + * 节点拒绝通知 + */ + @Schema(description = "节点拒绝通知") + public MsgConfig rejectMsgConfig = new MsgConfig(); + /** + * 节点退回通知 + */ + @Schema(description = "节点退回通知") + public MsgConfig backMsgConfig = new MsgConfig(); + /** + * 节点抄送通知 + */ + @Schema(description = "节点抄送通知") + public MsgConfig copyMsgConfig = new MsgConfig(); + /** + * 节点超时通知 + */ + @Schema(description = "节点超时通知") + public MsgConfig overTimeMsgConfig = new MsgConfig(); + /** + * 节点提醒通知 + */ + @Schema(description = "节点提醒通知") + public MsgConfig noticeMsgConfig = new MsgConfig(); + /** + * 节点提醒通知 + */ + @Schema(description = "评论提醒通知") + public MsgConfig commentMsgConfig = new MsgConfig(); + + + /*------------- 审批 -------------*/ + /** + * 数据传递 + */ + @Schema(description = "数据传递") + private List assignList = new ArrayList<>(); + /** + * 指定审批人 + */ + @Schema(description = "指定审批人") + private Integer assigneeType = 6; + /** + * 直属主管审批人类型,1.发起人 2.上节点审批人 + */ + private Integer approverType = 1; + /** + * 部门主管审批人类型,1.发起人 2.上节点审批人 + */ + private Integer managerApproverType = 1; + /** + * 发起者主管 1:直属 2:第二级主管 .... 10:第10级主管 + */ + @Schema(description = "发起者主管") + private Integer managerLevel = 1; + /** + * 表单字段审核方式的类型 1:用户 2:部门 3:岗位 4:角色 5:分组 + */ + @Schema(description = "表单字段审核方式的类型") + private Integer formFieldType = 1; + /** + * 表单字段 + */ + @Schema(description = "表单字段") + private String formField; + /** + * 审批节点id + */ + @Schema(description = "审批节点id") + private String approverNodeId; + /** + * 审批人集合 + */ + @Schema(description = "审批人集合") + private List approvers = new ArrayList<>(); + /** + * 审批人依次审批顺序 + */ + @Schema(description = "审批人依次审批顺序") + private List approversSortList = new ArrayList<>(); + /** + * 审批人范围 1:无审批人范围 2:同一部门 3:同一岗位 4:发起人上级 5:发起人下属 6:同一公司 + */ + @Schema(description = "审批人范围") + private Integer extraRule = 1; + /** + * 会签规则 0:或签 1:会签 2:依次审批 + */ + @Schema(description = "会签规则") + private Integer counterSign = 0; + /** + * 会签流转配置 + */ + @Schema(description = "会签流转配置") + private CounterSignConfig counterSignConfig = new CounterSignConfig(); + /** + * 抄送人集合 + */ + @Schema(description = "抄送人集合") + private List circulateUser = new ArrayList<>(); + /** + * 抄送人范围 + */ + @Schema(description = "抄送人范围") + private Integer extraCopyRule = 1; + /** + * 允许自选抄送人 + */ + @Schema(description = "允许自选抄送人") + private Boolean isCustomCopy = false; + /** + * 抄送给流程发起人 + */ + @Schema(description = "抄送给流程发起人") + private Boolean isInitiatorCopy = false; + /** + * 抄送给表单变量 + */ + @Schema(description = "抄送给表单变量") + private Boolean isFormFieldCopy = false; + /** + * 表单字段类型 1:用户 2:部门 3:岗位 4:角色 5:分组 + */ + @Schema(description = "表单字段类型") + private Integer copyFormFieldType = 1; + /** + * 表单字段 + */ + @Schema(description = "表单字段") + private String copyFormField; + /** + * + */ + @Schema(description = "") + private Boolean hasFile = false; + /** + * 节点参数 + */ + @Schema(description = "节点参数") + private List parameterList = new ArrayList<>(); + /** + * 辅助信息 + */ + @Schema(description = "辅助信息") + private List auxiliaryInfo = new ArrayList<>(); + /** + * 自动同意规则,默认不启用 + */ + @Schema(description = "自动同意规则,默认不启用") + private Boolean hasAutoApprover = false; + /** + * 自动同意规则 + */ + @Schema(description = "自动同意规则") + private AutoAuditRule autoAuditRule; + /** + * 自动拒绝规则 + */ + @Schema(description = "自动拒绝规则") + private AutoAuditRule autoRejectRule; + + /** + * 通过按钮 + */ + @Schema(description = "通过按钮") + private Boolean hasAuditBtn = true; + /** + * 通过按钮名称 + */ + @Schema(description = "通过按钮名称") + private String auditBtnText = "同意"; + /** + * 拒绝按钮 + */ + @Schema(description = "拒绝按钮") + private Boolean hasRejectBtn = true; + /** + * 拒绝按钮名称 + */ + @Schema(description = "拒绝按钮名称") + private String rejectBtnText = "拒绝"; + /** + * 退回按钮 + */ + @Schema(description = "退回按钮") + private Boolean hasBackBtn = false; + /** + * 退回按钮名称 + */ + @Schema(description = "退回按钮名称") + private String backBtnText = "退回"; + /** + * 加签按钮 + */ + @Schema(description = "加签按钮") + private Boolean hasFreeApproverBtn = false; + /** + * 加签按钮名称 + */ + @Schema(description = "加签按钮名称") + private String freeApproverBtnText = "加签"; + /** + * 减签按钮 + */ + @Schema(description = "减签按钮") + private Boolean hasReduceApproverBtn = false; + /** + * 减签按钮名称 + */ + @Schema(description = "减签按钮名称") + private String reduceApproverBtnText = "减签"; + /** + * 转审按钮 + */ + @Schema(description = "转审按钮") + private Boolean hasTransferBtn = false; + /** + * 转审按钮名称 + */ + @Schema(description = "转审按钮名称") + private String transferBtnText = "转审"; + /** + * 协办按钮 + */ + @Schema(description = "协办按钮") + private Boolean hasAssistBtn = false; + /** + * 协办按钮名称 + */ + @Schema(description = "协办按钮名称") + private String assistBtnText = "协办"; + /** + * 暂存按钮 + */ + @Schema(description = "暂存按钮") + private Boolean hasSaveAuditBtn = false; + /** + * 暂存按钮名称 + */ + @Schema(description = "暂存按钮名称") + private String saveAuditBtnText = "暂存"; + /** + * 分流规则 inclusion: 根据条件多分支流转(包容网关) exclusive:根据条件单分支流转(排它网关) parallel:所有分支都流转(并行网关) + */ + @Schema(description = "分流规则") + private String divideRule = "inclusion"; + /** + * 接口服务 + */ + @Schema(description = "接口服务") + private InterfaceConfig interfaceConfig = new InterfaceConfig(); + /** + * 内容 + */ + @Schema(description = "内容") + private String content; + /** + * 子流程发起权限 + */ + @Schema(description = "子流程发起权限") + private Integer subFlowLaunchPermission = 1; + /** + * 退回设置,被退回的节点重新提交时 + */ + private Integer backType = FlowNature.RestartType; + /** + * 设置退回到的节点 + */ + private String backNodeCode = FlowNature.START; + + + /*------------- 子流程 -------------*/ + /** + * 子流程同步 0:同步 1:异步 + */ + @Schema(description = "子流程同步") + private Integer isAsync = 0; + /** + * 自动提交 0:否 1:是 + */ + @Schema(description = "自动提交") + private Integer autoSubmit = 0; + /** + * 节点提醒通知 + */ + @Schema(description = "节点提醒通知") + public MsgConfig launchMsgConfig = new MsgConfig(); + /** + * 流程版本主键 + */ + @Schema(description = "流程版本主键") + private String flowId; + /** + * 创建规则 0:同时创建 1:依次创建 + */ + @Schema(description = "创建规则 0:同时创建 1:依次创建") + private Integer createRule = 0; + + /*------------- 线 -------------*/ + /** + * 连接线条件 + */ + @Schema(description = "连接线条件") + private List conditions = new ArrayList<>(); + /** + * 逻辑 + */ + @Schema(description = "逻辑") + private String matchLogic = "and"; + + /*--------------------------*/ + /** + * 退回事件 + **/ + @Schema(description = "退回事件") + private FuncConfig backFuncConfig = new FuncConfig(); + /** + * 拒绝事件 + **/ + @Schema(description = "拒绝事件") + private FuncConfig rejectFuncConfig = new FuncConfig(); + /** + * 同意事件 + **/ + @Schema(description = "同意事件") + private FuncConfig approveFuncConfig = new FuncConfig(); + /** + * 开始事件 + **/ + @Schema(description = "开始事件") + private FuncConfig initFuncConfig = new FuncConfig(); + /** + * 结束事件 + **/ + @Schema(description = "结束事件") + private FuncConfig endFuncConfig = new FuncConfig(); + /** + * 超时事件 + **/ + @Schema(description = "超时事件") + private FuncConfig overtimeFuncConfig = new FuncConfig(); + /** + * 提醒事件 + */ + @Schema(description = "提醒事件") + private FuncConfig noticeFuncConfig = new FuncConfig(); + /** + * 节点撤回事件 + **/ + @Schema(description = "节点撤回事件") + private FuncConfig recallFuncConfig = new FuncConfig(); + /** + * 发起撤回事件 + **/ + @Schema(description = "发起撤回事件") + private FuncConfig flowRecallFuncConfig = new FuncConfig(); + + /*------------- 触发 -------------*/ + /** + * 触发事件 1-表单事件 2-审批事件 3-空白事件 + */ + @Schema(description = "触发事件") + private Integer triggerEvent = 1; + /** + * 触发表单事件 1-新增 2-修改 3-删除 + */ + @Schema(description = "触发表单事件") + private Integer triggerFormEvent = 1; + /** + * 1-同意 2-拒绝 3-退回 4-确认办理 + */ + @Schema(description = "") + private List actionList = new ArrayList<>(); + /** + * 表单事件-修改数据-修改字段 + */ + @Schema(description = "") + private List updateFieldList = new ArrayList<>(); + /** + * 触发条件 + */ + @Schema(description = "触发条件") + private List ruleList = new ArrayList<>(); + /** + * 条件规则匹配逻辑 + */ + @Schema(description = "条件规则匹配逻辑") + private String ruleMatchLogic = "and"; + + /** + * 通知人类型 + */ + @Schema(description = "通知人类型") + private List msgUserType = new ArrayList<>(); + /** + * 执行失败通知 + */ + @Schema(description = "执行失败通知") + private MsgConfig failMsgConfig = new MsgConfig(); + /** + * 开始执行通知 + */ + @Schema(description = "开始执行通知") + private MsgConfig startMsgConfig = new MsgConfig(); + /** + * cron表达式 + */ + @Schema(description = "cron表达式") + private String cron; + /** + * 触发结束时间类型 + */ + @Schema(description = "触发结束时间类型") + private Integer endTimeType; + /** + * 触发次数 + */ + @Schema(description = "触发次数") + private Integer endLimit; + /** + * webhookUrl + */ + @Schema(description = "webhookUrl") + private String webhookUrl; + /** + * webhook获取接口字段Url + */ + @Schema(description = "webhook获取接口字段Url") + private String webhookGetFieldsUrl; + /** + * webhook获取接口字段识别码 + */ + @Schema(description = "webhook获取接口字段识别码") + private String webhookRandomStr; + /** + * 通知触发消息id + */ + @Schema(description = "通知触发消息id") + private String noticeId; + /** + * 分组id + */ + @Schema(description = "分组id") + private String groupId; + + /*------------- 获取数据 -------------*/ + /** + * 菜单id + */ + private String id; + /** + * 表单类型 1-从表单中获取 2-从流程中获取 3-从数据接口中获取 4-从子表 + */ + @Schema(description = "表单类型") + private Integer formType = 1; + /** + * 接口参数 + */ + @Schema(description = "接口参数") + private List interfaceTemplateJson = new ArrayList<>(); + /** + * 表单字段 + */ + @Schema(description = "表单字段") + private List formFieldList = new ArrayList<>(); + /** + * 排序 + */ + @Schema(description = "排序") + private List sortList = new ArrayList<>(); + + /*------------- 新增数据 -------------*/ + /** + * 字段设置 + */ + @Schema(description = "字段设置") + private List transferList = new ArrayList<>(); + /** + * 数据源 + */ + @Schema(description = "数据源") + private String dataSourceForm; + + /*------------- 更新数据 -------------*/ + /** + * 没有可修改的数据时,向对应表单中新增一条数据 + */ + @Schema(description = "") + private Boolean unFoundRule = false; + + /*------------- 删除数据 -------------*/ + /** + * 删除类型 + */ + @Schema(description = "删除类型") + private Integer deleteType; + /** + * 表类型 0-主表 1-子表 + */ + @Schema(description = "表类型") + private Integer tableType; + /** + * 子表 + */ + @Schema(description = "子表") + private String subTable; + /** + * 删除条件 1-存在 2-不存在 + */ + @Schema(description = "删除条件") + private Integer deleteCondition; + + /*------------- 数据接口节点 -------------*/ + /** + * 数据接口参数 + */ + @Schema(description = "数据接口参数") + private List templateJson = new ArrayList<>(); + + /*------------- 消息通知节点 -------------*/ + /** + * 通知人来源类型 + */ + @Schema(description = "通知人来源类型") + private Integer msgUserIdsSourceType = 1; + /** + * 通知人 + */ + @Schema(description = "通知人") + private List msgUserIds = new ArrayList<>(); + /** + * 消息id + */ + @Schema(description = "消息id") + private String msgId; + /** + * 消息名称 + */ + @Schema(description = "消息名称") + private String msgName; + /** + * 消息接口参数 + */ + @Schema(description = "消息接口参数") + private List msgTemplateJson = new ArrayList<>(); + + /*------------- 发起审批节点 -------------*/ + /** + * 发起人 + */ + @Schema(description = "发起人") + private List initiator = new ArrayList<>(); + + /*------------- 创建日程 -------------*/ + /** + * 日程标题 + */ + @Schema(description = "日程标题") + private String title; + /** + * 日程内容 + */ + @Schema(description = "日程内容") + private String contents; + /** + * 日程附件 + */ + @Schema(description = "日程附件") + private String files; + /** + * 日程全天 + */ + @Schema(description = "日程全天") + private Integer allDay = 0; + /** + * 日程开始日期 + */ + @Schema(description = "日程开始日期") + private String startDay; + /** + * 日程开始时间 + */ + @Schema(description = "日程开始时间") + private String startTime; + /** + * 日程时长 + */ + @Schema(description = "日程时长") + private Integer duration = 0; + /** + * 日程结束日期 + */ + @Schema(description = "日程结束日期") + private String endDay; + /** + * 日程结束时间 + */ + @Schema(description = "日程结束时间") + private String endTime; + /** + * 日程创建人 + */ + @Schema(description = "日程创建人") + private String creatorUserId; + /** + * 日程参与人 + */ + @Schema(description = "日程参与人") + private List toUserIds = new ArrayList<>(); + /** + * 日程标签颜色 + */ + @Schema(description = "日程标签颜色") + private String color; + /** + * 日程提醒时间 + */ + @Schema(description = "日程提醒时间") + private Integer reminderTime = -1; + /** + * 日程提醒方式 + */ + @Schema(description = "日程提醒方式") + private Integer reminderType = 1; + /** + * + */ + @Schema(description = "") + private String send; + /** + * + */ + @Schema(description = "") + private String sendName; + /** + * + */ + @Schema(description = "") + private String category; + /** + * + */ + @Schema(description = "") + private Integer repetition = 1; + /** + * + */ + @Schema(description = "") + private Long repeatTime; + /** + * + */ + @Schema(description = "") + private Integer startDaySourceType = 1; + /** + * + */ + @Schema(description = "") + private Integer endDaySourceType = 1; + /** + * + */ + @Schema(description = "") + private Integer titleSourceType = 1; + /** + * + */ + @Schema(description = "") + private Integer contentsSourceType = 1; + /** + * + */ + @Schema(description = "") + private Integer creatorUserIdSourceType = 1; + /** + * + */ + @Schema(description = "") + private Integer toUserIdsSourceType = 1; + +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/PrintConfig.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/PrintConfig.java new file mode 100644 index 0000000..f327114 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/PrintConfig.java @@ -0,0 +1,38 @@ +package com.yunzhupaas.flowable.model.templatenode.nodejson; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.flowable.enums.PrintEnum; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class PrintConfig { + /** + * 开启打印 + */ + @Schema(description = "开启打印") + private Boolean on = false; + /** + * 模板 + */ + @Schema(description = "模板") + private List printIds = new ArrayList<>(); + /** + * 1:不限制 2:节点结束 3:流程结束 4:条件设置 + */ + @Schema(description = "打印配置") + private Integer conditionType = PrintEnum.unconditional.getCode(); + /** + * 条件设置 + */ + @Schema(description = "条件设置") + private List conditions = new ArrayList<>(); + /** + * 逻辑 + */ + @Schema(description = "逻辑") + private String matchLogic = "and"; +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/ProperCond.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/ProperCond.java new file mode 100644 index 0000000..5587d51 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/ProperCond.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.flowable.model.templatenode.nodejson; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.emnus.SearchMethodEnum; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 解析引擎 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:10 + */ +@Data +public class ProperCond { + @Schema(description = "表达式") + private String logic = SearchMethodEnum.And.getSymbol(); + @Schema(description = "条件") + private List groups = new ArrayList<>(); +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/SendConfigJson.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/SendConfigJson.java new file mode 100644 index 0000000..793d174 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/SendConfigJson.java @@ -0,0 +1,65 @@ +package com.yunzhupaas.flowable.model.templatenode.nodejson; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 版本: V3.2.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2022-08-19 + */ +@Data +public class SendConfigJson { + + @Schema(description = "主键") + private String id; + + /** + * 消息发送配置主键 + **/ + @Schema(description = "消息发送配置主键") + private String sendConfigId; + + /** + * 消息类型 + **/ + @Schema(description = "消息类型") + private String messageType; + + /** + * 消息模板主键 + **/ + @Schema(description = "消息模板主键") + private String templateId; + + /** + * 账号配置主键 + **/ + @Schema(description = "账号配置主键") + private String accountConfigId; + + /** + * 接收人 + **/ + @Schema(description = "接收人") + private List toUser; + + /** + * 模板参数 + **/ + @Schema(description = "模板参数") + private List paramJson = new ArrayList<>(); + + /** + * 消息模板名称 + **/ + @Schema(description = "消息模板名称") + private String msgTemplateName; + + +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/SortModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/SortModel.java new file mode 100644 index 0000000..cd865fc --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/SortModel.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.flowable.model.templatenode.nodejson; + +import lombok.Data; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/6 10:55 + */ +@Data +public class SortModel { + private String sortType = "asc"; + private String field; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/TemplateJsonModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/TemplateJsonModel.java new file mode 100644 index 0000000..3656da9 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/TemplateJsonModel.java @@ -0,0 +1,35 @@ +package com.yunzhupaas.flowable.model.templatenode.nodejson; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.emnus.TemplateEnum; +import lombok.Data; + +/** + * 解析引擎 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Data +public class TemplateJsonModel { + + @Schema(description = "字段") + public String field; + @Schema(description = "名称") + public String fieldName; + @Schema(description = "字段") + public String relationField; + @Schema(description = "主键") + private String id; + @Schema(description = "是否子流程") + private Boolean isSubTable = false; + @Schema(description = "消息主键") + private String msgTemplateId; + @Schema(description = "默认值") + private String defaultValue; + @Schema(description = "参数来源") + private Integer sourceType = TemplateEnum.Field.getCode(); + +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/TimeConfig.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/TimeConfig.java new file mode 100644 index 0000000..ca2b4e8 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/TimeConfig.java @@ -0,0 +1,115 @@ +package com.yunzhupaas.flowable.model.templatenode.nodejson; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class TimeConfig { + + //----------------------限时------------------------ + /** + * 开始时间 0-接收时间,1-发起时间,2-表单变量 + */ + @Schema(description = "开始类型") + private Integer nodeLimit = 0; + /** + * 表单字段key + */ + @Schema(description = "表单字段key") + private String formField = ""; + /** + * 限定时长 默认24 (小时) + */ + @Schema(description = "限定时长") + private Integer duringDeal = 24; + + //--------------------超时------------------------- + /** + * 超时自动审批 + */ + @Schema(description = "超时自动审批") + private Boolean overAutoApprove = false; + /** + * 超时自动审批次数 + */ + @Schema(description = "超时次数") + private Integer overAutoApproveTime = 5; + + /** + * 超时自动转审 + */ + @Schema(description = "超时自动转审") + private Boolean overAutoTransfer = false; + /** + * 转审超时次数 + */ + @Schema(description = "转审超时次数") + private Integer overAutoTransferTime = 5; + /** + * 转审人类型 + */ + @Schema(description = "转审人类型") + private Integer overTimeType = 6; + /** + * 接口主键 + */ + @Schema(description = "接口主键") + private String interfaceId; + /** + * 接口名称 + */ + @Schema(description = "接口名称") + private String interfaceName; + /** + * 模块json + */ + @Schema(description = "模块json") + private List templateJson = new ArrayList<>(); + /** + * 转审人 + */ + @Schema(description = "转审人") + private List reApprovers = new ArrayList<>(); + /** + * 超时审批人,2.同一部门 7.同一角色 3.同一岗位 8.同一分组 + */ + @Schema(description = "超时审批人") + private Integer overTimeExtraRule = 2; + + //---------------------公共---------------------------------- + /** + * 超时设置 0.关闭 1.自定义 2.同步发起配置 + */ + @Schema(description = "超时设置") + private Integer on = 0; + /** + * 事件(提醒、超时) + */ + @Schema(description = "事件") + private Boolean overEvent = false; + /** + * 次数(提醒、超时) + */ + @Schema(description = "次数") + private Integer overEventTime = 5; + /** + * 第一次时间 + * (小时)第一次超时时间默认值0=第一次触发超时事件时间=节点限定时长起始值+节点处理限定时长+设定的第一次超时时间 + */ + @Schema(description = "第一次时间") + private Integer firstOver = 0; + /** + * 时间间隔(提醒、超时) + */ + @Schema(description = "时间间隔") + private Integer overTimeDuring = 2; + /** + * 通知(提醒、超时) + */ + @Schema(description = "通知") + private Boolean overNotice = false; +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/TransferModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/TransferModel.java new file mode 100644 index 0000000..57c9fcd --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/templatenode/nodejson/TransferModel.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.flowable.model.templatenode.nodejson; + +import lombok.Data; + +/** + * 版本: V3.0.0 + * 版权: 深圳市乐程软件有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class TransferModel { + private String targetField; + private String targetFieldLabel; + private Integer sourceType; + private String sourceValue; + private Boolean required = false; +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/time/FlowTimeModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/time/FlowTimeModel.java new file mode 100644 index 0000000..c0c94ae --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/time/FlowTimeModel.java @@ -0,0 +1,71 @@ +package com.yunzhupaas.flowable.model.time; + +import com.yunzhupaas.flowable.model.task.FlowModel; +import com.yunzhupaas.flowable.model.templatenode.nodejson.NodeModel; +import lombok.Data; + +import java.util.Date; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/6/18 11:38 + */ +@Data +public class FlowTimeModel { + /** + * 限时提醒 + */ + private Boolean on = false; + /** + * 主键 + */ + private String id; + /** + * 经办主键 + */ + private String operatorId; + /** + * 实例主键 + */ + private String taskId; + /** + * 开始时间 + */ + private Date startDate = new Date(); + /** + * 结束时间 + */ + private Date endDate = new Date(); + /** + * 通知 + */ + private NodeModel childNode = new NodeModel(); + /** + * 表单对象 + */ + private FlowModel flowModel = new FlowModel(); + /** + * 是否超时 + */ + private Boolean overTime = false; + /** + * 时间间隔 + */ + private Integer during = 2; + /** + * 超时次数 + */ + private Integer num = 0; + /** + * 转审超时次数 + */ + private Integer transferNum = 0; + /** + * 暂停标识 + */ + private Boolean isPause = false; + +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/time/TimeModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/time/TimeModel.java new file mode 100644 index 0000000..e6559fe --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/time/TimeModel.java @@ -0,0 +1,23 @@ +package com.yunzhupaas.flowable.model.time; + +import com.yunzhupaas.flowable.entity.OperatorEntity; +import com.yunzhupaas.flowable.model.task.FlowModel; +import com.yunzhupaas.util.RedisUtil; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/7/19 16:20 + */ +@Data +public class TimeModel { + private List operatorList = new ArrayList<>(); + private FlowModel flowModel = new FlowModel(); + private RedisUtil redisUtil; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/trigger/ExecuteAsyncModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/trigger/ExecuteAsyncModel.java new file mode 100644 index 0000000..7dc820a --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/trigger/ExecuteAsyncModel.java @@ -0,0 +1,27 @@ +package com.yunzhupaas.flowable.model.trigger; + +import com.yunzhupaas.flowable.entity.OperatorEntity; +import com.yunzhupaas.flowable.entity.TaskEntity; +import com.yunzhupaas.flowable.model.task.FlowModel; +import com.yunzhupaas.flowable.model.util.SystemAuditModel; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/11/7 16:31 + */ +@Data +public class ExecuteAsyncModel { + private ExecuteModel model; + private Boolean sync = false; + private List operatorList = new ArrayList<>(); + private List subTaskList = new ArrayList<>(); + private List systemList = new ArrayList<>(); + private FlowModel flowModel; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/trigger/ExecuteModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/trigger/ExecuteModel.java new file mode 100644 index 0000000..2111e71 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/trigger/ExecuteModel.java @@ -0,0 +1,48 @@ +package com.yunzhupaas.flowable.model.trigger; + +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.flowable.entity.TemplateJsonEntity; +import com.yunzhupaas.flowable.entity.TemplateNodeEntity; +import com.yunzhupaas.flowable.entity.TriggerRecordEntity; +import com.yunzhupaas.flowable.entity.TriggerTaskEntity; +import com.yunzhupaas.flowable.model.templatenode.nodejson.NodeModel; +import lombok.Data; + +import java.util.*; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/10 20:44 + */ +@Data +public class ExecuteModel { + private String flowId; + private String taskId; + private String nodeCode; + private String nodeId; + private String groupId; + private List> dataList = new ArrayList<>(); + private UserInfo userInfo = new UserInfo(); + private String parentId = "0"; + private List nodeEntityList = new ArrayList<>(); + private String instanceId; + + private TemplateJsonEntity jsonEntity = new TemplateJsonEntity(); + + private TriggerTaskEntity triggerTask = new TriggerTaskEntity(); + private List recordList = new ArrayList<>(); + + private NodeModel nodeModel = new NodeModel(); + + /** + * 当前执行节点,用于获取最后的执行节点引擎id + */ + private String currentNodeId; + + private String triggerKey; + + private Integer isAsync; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/trigger/TimeTriggerModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/trigger/TimeTriggerModel.java new file mode 100644 index 0000000..df4c6b5 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/trigger/TimeTriggerModel.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.flowable.model.trigger; + +import com.yunzhupaas.base.UserInfo; +import lombok.Data; + +/** + * 定时触发模型 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/20 10:28 + */ +@Data +public class TimeTriggerModel { + private UserInfo userInfo; + private String id; + private String flowId; + private String cron; + private Long startTime = System.currentTimeMillis(); + private Long endTime; + private Integer endTimeType = 1; + private Integer endLimit = 1; + private Integer num = 0; + private Integer state = 0; + private Long time = System.currentTimeMillis(); +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/trigger/TriggerDataFo.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/trigger/TriggerDataFo.java new file mode 100644 index 0000000..35c26fe --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/trigger/TriggerDataFo.java @@ -0,0 +1,38 @@ +package com.yunzhupaas.flowable.model.trigger; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/19 14:55 + */ +@Data +public class TriggerDataFo { + /** + * 表单模板id + */ + private String modelId; + /** + * 事件触发类型,1新增 2修改 3删除 + */ + private Integer trigger; + /** + * 数据id + */ + private List dataId = new ArrayList<>(); + /** + * 删除,异步执行会存在数据先被删除的情况 + */ + private List> dataMap = new ArrayList<>(); + /** + * 发生修改的表单字段 + */ + private List updateFields = new ArrayList<>(); +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/trigger/TriggerDataModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/trigger/TriggerDataModel.java new file mode 100644 index 0000000..bb4c929 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/trigger/TriggerDataModel.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.flowable.model.trigger; + +import lombok.Data; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/10 17:34 + */ +@Data +public class TriggerDataModel { + private String id; + private String data; + private String flowId; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/trigger/TriggerInfoListModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/trigger/TriggerInfoListModel.java new file mode 100644 index 0000000..bfd8889 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/trigger/TriggerInfoListModel.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.flowable.model.trigger; + +import com.yunzhupaas.flowable.entity.TriggerRecordEntity; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/21 11:45 + */ +@Data +public class TriggerInfoListModel { + private String id; + private Long startTime; + private Integer isAsync = 1; + private List recordList = new ArrayList<>(); +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/trigger/TriggerInfoModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/trigger/TriggerInfoModel.java new file mode 100644 index 0000000..97924f2 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/trigger/TriggerInfoModel.java @@ -0,0 +1,32 @@ +package com.yunzhupaas.flowable.model.trigger; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.flowable.entity.TriggerRecordEntity; +import com.yunzhupaas.flowable.model.templatejson.TemplateJsonInfoVO; +import com.yunzhupaas.flowable.model.templatenode.ButtonModel; +import com.yunzhupaas.flowable.model.templatenode.TaskNodeModel; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/21 10:35 + */ +@Data +public class TriggerInfoModel { + @Schema(description = "流程详情") + private TemplateJsonInfoVO flowInfo; + @Schema(description = "流转记录") + private List recordList = new ArrayList<>(); + @Schema(description = "节点") + private List nodeList = new ArrayList<>(); + @Schema(description = "按钮控制") + private ButtonModel btnInfo = new ButtonModel(); + @Schema(description = "任务信息") + private TriggerTaskModel taskInfo; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/trigger/TriggerModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/trigger/TriggerModel.java new file mode 100644 index 0000000..56dc270 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/trigger/TriggerModel.java @@ -0,0 +1,40 @@ +package com.yunzhupaas.flowable.model.trigger; + +import com.yunzhupaas.base.UserInfo; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/10 15:36 + */ +@Data +public class TriggerModel { + /** + * 表单id、消息id、流程版本id + */ + private String id; + /** + * 触发表单事件 1-新增 2-修改 3-删除 + */ + private Integer triggerFormEvent = 0; + /** + * 事件、定时、消息、webhook + */ + private Integer triggerType = 0; + + /** + * 数据 + */ + private List dataList = new ArrayList<>(); + /** + * 用户信息 + */ + private UserInfo userInfo; + +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/trigger/TriggerPagination.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/trigger/TriggerPagination.java new file mode 100644 index 0000000..f47a23d --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/trigger/TriggerPagination.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.flowable.model.trigger; + +import com.yunzhupaas.base.PaginationTime; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/21 9:40 + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class TriggerPagination extends PaginationTime { +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/trigger/TriggerTaskModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/trigger/TriggerTaskModel.java new file mode 100644 index 0000000..759890a --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/trigger/TriggerTaskModel.java @@ -0,0 +1,52 @@ +package com.yunzhupaas.flowable.model.trigger; + +import lombok.Data; + +import java.util.Date; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/21 13:51 + */ +@Data +public class TriggerTaskModel { + /** + * 开始时间 + */ + private String id; + /** + * 标题 + */ + private String fullName; + /** + * 重试任务开始时间 + */ + private Long parentTime; + /** + * 重试任务主键id + */ + private String parentId; + /** + * 开始时间 + */ + private Date startTime; + /** + * 状态(0-进行中 1-通过 2-异常 3-终止) + */ + private Integer status; + /** + * 是否重试任务 0否 1是 + */ + private Integer isRetry; + /** + * 流程版本主键 + */ + private String flowId; + /** + * 流程上下架状态 + */ + private Integer templateStatus = 1; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/trigger/TriggerWebHookInfoVo.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/trigger/TriggerWebHookInfoVo.java new file mode 100644 index 0000000..5d2670a --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/trigger/TriggerWebHookInfoVo.java @@ -0,0 +1,23 @@ +package com.yunzhupaas.flowable.model.trigger; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/21 15:43 + */ +@Data +public class TriggerWebHookInfoVo { + @Schema(description = "系统生成数据接收接口") + private String webhookUrl; + @Schema(description = "系统生成参数接收接口") + private String requestUrl; + @Schema(description = "base64未转换16进制字符串") + private String enCodeStr; + @Schema(description = "随机字符") + private String randomStr; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/util/EventModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/util/EventModel.java new file mode 100644 index 0000000..4693b4d --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/util/EventModel.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.flowable.model.util; + +import com.yunzhupaas.flowable.model.task.FlowModel; +import lombok.Data; + +import java.util.Map; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/8/21 15:34 + */ +@Data +public class EventModel { + private Integer status; + private FlowModel flowModel; + private Map> allData; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/util/FlowConstant.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/util/FlowConstant.java new file mode 100644 index 0000000..e68b3ff --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/util/FlowConstant.java @@ -0,0 +1,95 @@ +package com.yunzhupaas.flowable.model.util; + +/** + * 在线工作流开发 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public class FlowConstant { + /** + * 定时器 + */ + public static final String TIMER = "timer"; + /** + * 空节点 + */ + public static final String EMPTY = "empty"; + /** + * 流程名称 + */ + public static final String FLOW_FULL_NAME = "@flowFullName"; + /** + * 流程编码 + */ + public static final String FLOW_FULL_CODE = "@flowFullCode"; + /** + * 当前用户 + */ + public static final String LAUNCH_USER_NAME = "@launchUserName"; + /** + * 当前时间 + */ + public static final String LAUNCH_TIME = "@launchTime"; + /** + * 上节点表单ID + */ + public static final String PREV_NODE_FORM_ID = "@prevNodeFormId"; + /** + * 流程ID + */ + public static final String FLOW_ID = "@flowId"; + /** + * 任务ID + */ + public static final String TASK_ID = "@taskId"; + /** + * 节点ID + */ + public static final String TASK_NODE_ID = "@taskNodeId"; + /** + * 任务标题 + */ + public static final String TASK_FULL_NAME = "@taskFullName"; + /** + * 发起用户ID + */ + public static final String LAUNCH_USER_ID = "@launchUserId"; + /** + * 当前操作用户ID + */ + public static final String FLOW_OPERATOR_USER_ID = "@flowOperatorUserId"; + /** + * 当前操作用户名 + */ + public static final String FLOW_OPERATOR_USER_NAME = "@flowOperatorUserName"; + /** + * 委托人 + */ + public static final String MANDATOR = "@Mandator"; + /** + * 被委托人 + */ + public static final String MANDATARY = "@Mandatary"; + /** + * 创建人 + */ + public static final String CREATORUSERNAME = "@CreatorUserName"; + /** + * 发送时间 + */ + public static final String SENDTIME = "@SendTime"; + /** + * 消息标题 + */ + public static final String TITLE = "@Title"; + /** + * 执行动作 + */ + public static final String ACTION = "@Action"; +} + + + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/util/FlowContextHolder.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/util/FlowContextHolder.java new file mode 100644 index 0000000..ab452ff --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/util/FlowContextHolder.java @@ -0,0 +1,104 @@ +package com.yunzhupaas.flowable.model.util; + +import cn.hutool.core.util.ObjectUtil; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 事件数据添加 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/8/20 8:49 + */ +public class FlowContextHolder { + + // 子流程表单数据 + private static final ThreadLocal>> CHILD_DATA = new ThreadLocal<>(); + + // 保存表单的Key集合 + private static final ThreadLocal> WRITE_ID_LIST = new ThreadLocal<>(); + + // 表单权限 + private static final ThreadLocal>>> FORM_OPERATES_DATA = new ThreadLocal<>(); + + /** + * 获取数据 + */ + public static Map> getAllData() { + Map> data = CHILD_DATA.get() != null ? CHILD_DATA.get() : new HashMap<>(); + return data; + } + + /** + * 获取保存的Key集合 + */ + public static List getWriteIdList() { + return WRITE_ID_LIST.get() != null ? WRITE_ID_LIST.get() : new ArrayList<>(); + } + + /** + * 清除数据 + */ + public static void clearAll() { + CHILD_DATA.remove(); + WRITE_ID_LIST.remove(); + FORM_OPERATES_DATA.remove(); + } + + + /** + * 添加数据 + */ + public static void addChildData(String taskId, String formId, Map parameterMap, List> formOperates, boolean isWrite) { + if (StringUtil.isNotEmpty(taskId) && StringUtil.isNotEmpty(formId)) { + Map> map = CHILD_DATA.get() != null ? CHILD_DATA.get() : new HashMap<>(); + String key = taskId + "_yunzhupaas_" + formId; + map.put(key, JsonUtil.entityToMap(parameterMap)); + CHILD_DATA.set(map); + Map>> formMap = FORM_OPERATES_DATA.get() != null ? FORM_OPERATES_DATA.get() : new HashMap<>(); + if (ObjectUtil.isEmpty(formMap.get(key))) { + formMap.put(key, formOperates); + FORM_OPERATES_DATA.set(formMap); + } + if (isWrite) { + List writeList = getWriteIdList(); + writeList.add(key); + WRITE_ID_LIST.set(writeList); + } + } + } + + /** + * 获取权限 + */ + public static Map>> getFormOperates() { + Map>> data = FORM_OPERATES_DATA.get() != null ? FORM_OPERATES_DATA.get() : new HashMap<>(); + return data; + } + + /** + * 删除数据 + */ + public static void delete(String taskId, String formId) { + Map> data = CHILD_DATA.get() != null ? CHILD_DATA.get() : new HashMap<>(); + String key = taskId + "_yunzhupaas_" + formId; + data.remove(key); + CHILD_DATA.set(data); + } + + /** + * 删除权限 + */ + public static void deleteFormOperator() { + FORM_OPERATES_DATA.remove(); + } + +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/util/FlowEventHolder.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/util/FlowEventHolder.java new file mode 100644 index 0000000..2e3a54d --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/util/FlowEventHolder.java @@ -0,0 +1,44 @@ +package com.yunzhupaas.flowable.model.util; + +import com.yunzhupaas.flowable.model.task.FlowModel; +import com.yunzhupaas.util.JsonUtil; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 事件 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/8/21 15:31 + */ +public class FlowEventHolder { + + private static final ThreadLocal> EVENT_LIST = new ThreadLocal<>(); + + public static void addEvent(Integer status, FlowModel flowModel, Map> allData) { + EventModel eventModel = new EventModel(); + eventModel.setStatus(status); + eventModel.setFlowModel(flowModel); + Map> data = new HashMap<>(); + for (String key : allData.keySet()) { + Map dataValue = JsonUtil.entityToMap(allData.get(key)); + data.put(key, dataValue); + } + eventModel.setAllData(data); + List list = EVENT_LIST.get() != null ? EVENT_LIST.get() : new ArrayList<>(); + list.add(eventModel); + EVENT_LIST.set(list); + } + + public static List getAllEvent() { + return EVENT_LIST.get() != null ? EVENT_LIST.get() : new ArrayList<>(); + } + + public static void clear() { + EVENT_LIST.remove(); + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/util/FlowNature.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/util/FlowNature.java new file mode 100644 index 0000000..3c2b5e7 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/util/FlowNature.java @@ -0,0 +1,349 @@ +package com.yunzhupaas.flowable.model.util; + +import lombok.Data; + +/** + * 在线工作流开发 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Data +public class FlowNature { + + /** + * 子表数据标识 + */ + public static String SUB_TABLE = "@subTable"; + + /** + * 发起节点表单id + */ + public static String StartNodeFormId = "@startNodeFormId"; + /** + * 数据传递 全局参数 + */ + public static String GLOBAL_PARAMETER = "globalParameter"; + /** + * 撤销流水号编码 + */ + public static String REVOKE_BILL_CODE = "workflow_revoke"; + /** + * 撤销表单编码 + */ + public static String REVOKE_FORM_CODE = "revoke"; + + /** + * 会签计算方式,1.实时计算 2.延后计算 + */ + public static Integer CALCULATE_TYPE_DELAY = 2; + + /** + * 结束编码、名称 + */ + public static String END_CODE = "end"; + public static String END_NAME = "结束"; + /** + * 开始编码、名称 + */ + public static String START_CODE = "start"; + public static String START_NAME = "开始"; + + /** + * 表单字段后缀 + */ + public static String FORM_FIELD_SUFFIX = "_yunzhupaasId"; + + /** + * 系统编码 + */ + public static String SYSTEM_CODE = "com.yunzhupaas"; + /** + * 系统名称 + */ + public static String SYSTEM_NAME = "系统"; + /** + * 系统头像 + */ + public static String SYSTEM_HEAD_ICON = "001.png"; + + /** + * 我发起的新建/编辑 + */ + public static String LaunchCreate = "-1"; + /** + * 我发起的详情 + */ + public static String LaunchDetail = "0"; + /** + * 待签事宜 + */ + public static String WaitSign = "1"; + /** + * 待办事宜 + */ + public static String Todo = "2"; + /** + * 在办事宜 + */ + public static String Doing = "3"; + /** + * 已办事宜 + */ + public static String Done = "4"; + /** + * 抄送事宜 + */ + public static String Circulate = "5"; + /** + * 流程监控 + */ + public static String Monitor = "6"; + + + /** + * 正常状态 + */ + public static Integer Normal = 0; + /** + * 作废状态(记录) + */ + public static Integer Invalid = -1; + + /** + * 流程标题 + */ + public static Integer TitleType = 0; + + /** + * 百分比 + **/ + public static Integer Percent = 1; + + /** + * 无 + **/ + public static Integer No = 0; + + /** + * 人数 + **/ + public static Integer Number = 2; + + /** + * 比率 + **/ + public static Integer Ratio = 100; + + /** + * 比率 + **/ + public static Integer PermissionType = 1; + + /** + * 发起权限 + **/ + public static Integer LaunchPermission = 1; + + + //------------------------------- + /** + * 驳回开始 + **/ + public static String START = "0"; + + /** + * 驳回上一节点 + **/ + public static String UP = "1"; + + /** + * 自选节点 + **/ + public static String Reject = "2"; + + /** + * 候选人 + **/ + public static Integer Candidates = 1; + + /** + * 异常人 + **/ + public static Integer CandidatesError = 2; + + /** + * 选择分支 + **/ + public static Integer Branch = 3; + + /** + * 重新审批 + **/ + public static Integer RestartType = 1; + + /** + * 当前审批 + **/ + public static Integer PresentType = 2; + + /** + * 待办事宜 + **/ + public static String WAIT = "1"; + + /** + * 已办事宜 + **/ + public static String TRIAL = "2"; + + /** + * 抄送事宜 + **/ + public static String CIRCULATE = "3"; + + /** + * 抄送事宜 + **/ + public static String BATCH = "4"; + + /** + * 流程父节点 + **/ + public static String ParentId = "0"; + + /** + * 加签人 + **/ + public static String RecordStatus = "0"; + + /** + * 审批开始 + **/ + public static String NodeStart = "start"; + + /** + * 审批结束 + **/ + public static String NodeEnd = "end"; + + /** + * 子流程 + **/ + public static String NodeSubFlow = "subFlow"; + + /** + * 结束节点 + **/ + public static String EndRound = "endround"; + + /** + * 或签 + **/ + public static Integer FixedApprover = 0; + + /** + * 会签 + **/ + public static Integer FixedJointlyApprover = 1; + + /** + * 依次 + **/ + public static Integer ImproperApprover = 2; + + /** + * 通过 + **/ + public static Integer AuditCompletion = 1; + + /** + * 拒绝 + **/ + public static Integer RejectCompletion = 0; + +// /** +// * 进行 +// **/ +// public static Integer ProcessCompletion = 0; + + /** + * 子流程同步 + **/ + public static Integer ChildSync = 0; + + /** + * 子流程异步 + **/ + public static Integer ChildAsync = 1; + + /** + * 完成情况 + */ + public static Integer Progress = 100; + + /** + * 加签回流 + */ + public static Integer Reflux = 0; + + /** + * 加签前 + */ + public static Integer Before = 1; +// + /** + * 加签后 + */ + public static Integer Later = 2; + + /** + * 发起消息 + */ + public static Integer StartMsg = 0; + + /** + * 审批消息 + */ + public static Integer ApproveMsg = 1; + + /** + * 结束消息 + */ + public static Integer EndMsg = 2; + + /** + * 复活取最后数据 + */ + public static Integer ResurgenceLast = 0; + + /** + * 复活取当时数据 + */ + public static Integer ResurgenceThis = 1; + + /** + * 事件失败流程继续 + */ + public static Integer FuncResume = 0; + + /** + * 事件失败流程终止 + */ + public static Integer FuncTerminate = 1; + + /** + * 发起撤回终止 + */ + public static Integer RevokeTerminate = 1; + + /** + * 发起撤回提交 + */ + public static Integer RevokeSubmit = 2; + + +} + diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/util/SystemAuditHolder.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/util/SystemAuditHolder.java new file mode 100644 index 0000000..dc8ad96 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/util/SystemAuditHolder.java @@ -0,0 +1,32 @@ +package com.yunzhupaas.flowable.model.util; + +import java.util.ArrayList; +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/10/8 18:05 + */ +public class SystemAuditHolder { + + private static final ThreadLocal> MODEL_LIST = new ThreadLocal<>(); + + public static void add(SystemAuditModel model) { + if (null != model) { + List list = MODEL_LIST.get() != null ? MODEL_LIST.get() : new ArrayList<>(); + list.add(model); + MODEL_LIST.set(list); + } + } + + public static List getAll() { + return MODEL_LIST.get() != null ? MODEL_LIST.get() : new ArrayList<>(); + } + + public static void clear() { + MODEL_LIST.remove(); + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/util/SystemAuditModel.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/util/SystemAuditModel.java new file mode 100644 index 0000000..ae06455 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/util/SystemAuditModel.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.flowable.model.util; + +import com.yunzhupaas.flowable.entity.OperatorEntity; +import com.yunzhupaas.flowable.model.task.FlowModel; +import lombok.Data; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/10/9 8:59 + */ +@Data +public class SystemAuditModel { + private OperatorEntity operator; + private FlowModel flowModel; +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/util/TriggerHolder.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/util/TriggerHolder.java new file mode 100644 index 0000000..6b25bef --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/util/TriggerHolder.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.flowable.model.util; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 触发 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/11 10:13 + */ +public class TriggerHolder { + private static final ThreadLocal>>> DATA = new ThreadLocal<>(); + + public static void addData(String nodeCode, List> dataList) { + Map>> data = DATA.get() != null ? DATA.get() : new HashMap<>(); + data.put(nodeCode, dataList != null ? dataList : new ArrayList<>()); + DATA.set(data); + } + + public static Map>> getData() { + return DATA.get() != null ? DATA.get() : new HashMap<>(); + } + + public static void clear() { + DATA.remove(); + } +} diff --git a/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/util/TriggerRecordHolder.java b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/util/TriggerRecordHolder.java new file mode 100644 index 0000000..6ac9336 --- /dev/null +++ b/yunzhupaas-flowable/yunzhupaas-flowable-entity/src/main/java/com/yunzhupaas/flowable/model/util/TriggerRecordHolder.java @@ -0,0 +1,48 @@ +package com.yunzhupaas.flowable.model.util; + +import com.yunzhupaas.flowable.entity.TriggerRecordEntity; +import com.yunzhupaas.flowable.entity.TriggerTaskEntity; + +import java.util.ArrayList; +import java.util.List; + +/** + * 任务流程异常回滚,需要存储的记录集合 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/11/21 13:53 + */ +public class TriggerRecordHolder { + + private static final ThreadLocal> TRIGGER_TASK_LIST = new ThreadLocal<>(); + private static final ThreadLocal> TRIGGER_RECORD_LIST = new ThreadLocal<>(); + + public static void addData(TriggerTaskEntity triggerTask, TriggerRecordEntity triggerRecord) { + if (null != triggerTask) { + List taskList = TRIGGER_TASK_LIST.get() != null ? TRIGGER_TASK_LIST.get() + : new ArrayList<>(); + taskList.add(triggerTask); + TRIGGER_TASK_LIST.set(taskList); + } + if (null != triggerRecord) { + List recordList = TRIGGER_RECORD_LIST.get() != null ? TRIGGER_RECORD_LIST.get() + : new ArrayList<>(); + recordList.add(triggerRecord); + TRIGGER_RECORD_LIST.set(recordList); + } + } + + public static List getRecordList() { + return TRIGGER_RECORD_LIST.get() != null ? TRIGGER_RECORD_LIST.get() : new ArrayList<>(); + } + + public static List getTaskList() { + return TRIGGER_TASK_LIST.get() != null ? TRIGGER_TASK_LIST.get() : new ArrayList<>(); + } + + public static void clear() { + TRIGGER_TASK_LIST.remove(); + TRIGGER_RECORD_LIST.remove(); + } +} diff --git a/yunzhupaas-mdm/pom.xml b/yunzhupaas-mdm/pom.xml new file mode 100644 index 0000000..a4e057a --- /dev/null +++ b/yunzhupaas-mdm/pom.xml @@ -0,0 +1,50 @@ + + + + yunzhupaas-java-boot + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-mdm + pom + + yunzhupaas-mdm-entity + yunzhupaas-mdm-biz + yunzhupaas-mdm-controller + + + + + org.apache.poi + poi + 4.1.2 + + + org.apache.xmlbeans + xmlbeans + 3.1.0 + + + + org.apache.poi + poi-ooxml + 4.1.2 + + + org.apache.poi + poi-ooxml-schemas + 4.1.2 + + + + org.apache.poi + poi-scratchpad + 4.1.2 + + + + diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/pom.xml b/yunzhupaas-mdm/yunzhupaas-mdm-biz/pom.xml new file mode 100644 index 0000000..266f258 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/pom.xml @@ -0,0 +1,30 @@ + + + + yunzhupaas-mdm + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-mdm-biz + + + + com.yunzhupaas + yunzhupaas-mdm-entity + ${project.version} + + + + + com.yunzhupaas + yunzhupaas-generater-base + 5.2.0-RELEASE + + + + + diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/mapper/AssetMapper.java b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/mapper/AssetMapper.java new file mode 100644 index 0000000..380df81 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/mapper/AssetMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.mdm.mapper; + + +import com.yunzhupaas.mdm.entity.AssetEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.mapper.SuperMapper; + +/** + * 资产信息 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-28 + */ +public interface AssetMapper extends SuperMapper { + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/mapper/CompanyBankMapper.java b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/mapper/CompanyBankMapper.java new file mode 100644 index 0000000..6991ed1 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/mapper/CompanyBankMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.mdm.mapper; + + +import com.yunzhupaas.mdm.entity.CompanyBankEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.mapper.SuperMapper; + +/** + * 法人公司 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-24 + */ +public interface CompanyBankMapper extends SuperMapper { + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/mapper/CompanyInvoiceMapper.java b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/mapper/CompanyInvoiceMapper.java new file mode 100644 index 0000000..3e18dc4 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/mapper/CompanyInvoiceMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.mdm.mapper; + + +import com.yunzhupaas.mdm.entity.CompanyInvoiceEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.mapper.SuperMapper; + +/** + * 法人公司 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-24 + */ +public interface CompanyInvoiceMapper extends SuperMapper, BaseMapper { + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/mapper/CompanyMapper.java b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/mapper/CompanyMapper.java new file mode 100644 index 0000000..8d56868 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/mapper/CompanyMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.mdm.mapper; + + +import com.yunzhupaas.mdm.entity.CompanyEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.mapper.SuperMapper; + +/** + * 法人公司 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-24 + */ +public interface CompanyMapper extends SuperMapper { + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/mapper/CorporationMapper.java b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/mapper/CorporationMapper.java new file mode 100644 index 0000000..18368a2 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/mapper/CorporationMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.mdm.mapper; + + +import com.yunzhupaas.mdm.entity.CorporationEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.mapper.SuperMapper; + +/** + * 法人公司 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-24 + */ +public interface CorporationMapper extends SuperMapper { + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/mapper/CustomersMapper.java b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/mapper/CustomersMapper.java new file mode 100644 index 0000000..3406c47 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/mapper/CustomersMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.mdm.mapper; + + +import com.yunzhupaas.mdm.entity.CustomerEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.mapper.SuperMapper; + +/** + * 客户信息 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-24 + */ +public interface CustomersMapper extends SuperMapper { + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/mapper/MaterialMapper.java b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/mapper/MaterialMapper.java new file mode 100644 index 0000000..3392618 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/mapper/MaterialMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.mdm.mapper; + + +import com.yunzhupaas.mdm.entity.MaterialEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.mapper.SuperMapper; + +/** + * 物料信息 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-27 + */ +public interface MaterialMapper extends SuperMapper { + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/mapper/PanyInvoiceMapper.java b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/mapper/PanyInvoiceMapper.java new file mode 100644 index 0000000..f4e9331 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/mapper/PanyInvoiceMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.mdm.mapper; + + +import com.yunzhupaas.mdm.entity.PanyInvoiceEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.mapper.SuperMapper; + +/** + * 供应商信息 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-24 + */ +public interface PanyInvoiceMapper extends SuperMapper { + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/mapper/ProductsMapper.java b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/mapper/ProductsMapper.java new file mode 100644 index 0000000..7829b05 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/mapper/ProductsMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.mdm.mapper; + + +import com.yunzhupaas.mdm.entity.ProductEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.mapper.SuperMapper; + +/** + * 商品信息 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-27 + */ +public interface ProductsMapper extends SuperMapper { + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/mapper/SupplierMapper.java b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/mapper/SupplierMapper.java new file mode 100644 index 0000000..a872db6 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/mapper/SupplierMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.mdm.mapper; + + +import com.yunzhupaas.mdm.entity.SupplierEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.mapper.SuperMapper; + +/** + * 供应商信息 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-24 + */ +public interface SupplierMapper extends SuperMapper { + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/AssetService.java b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/AssetService.java new file mode 100644 index 0000000..e4f42ac --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/AssetService.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.mdm.service; + +import com.yunzhupaas.mdm.entity.*; +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.mdm.model.asset.*; +import java.util.*; + +/** + * 资产信息 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-28 + */ +public interface AssetService extends SuperService { + List getList(AssetPagination assetPagination); + + List getTypeList(AssetPagination assetPagination,String dataType); + + AssetEntity getInfo(String assetid); + + void delete(AssetEntity entity); + + void create(AssetEntity entity); + + boolean update(String assetid, AssetEntity entity); + + String checkForm(AssetForm form,int i); + + void saveOrUpdate(AssetForm assetForm,String id, boolean isSave) throws Exception; +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/CompanyBankService.java b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/CompanyBankService.java new file mode 100644 index 0000000..68cd5b9 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/CompanyBankService.java @@ -0,0 +1,14 @@ +package com.yunzhupaas.mdm.service; + +import com.yunzhupaas.mdm.entity.*; +import com.yunzhupaas.base.service.SuperService; + +/** + * 法人公司 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-24 + */ +public interface CompanyBankService extends SuperService { +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/CompanyInvoiceService.java b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/CompanyInvoiceService.java new file mode 100644 index 0000000..6cc3135 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/CompanyInvoiceService.java @@ -0,0 +1,14 @@ +package com.yunzhupaas.mdm.service; + +import com.yunzhupaas.mdm.entity.*; +import com.yunzhupaas.base.service.SuperService; + +/** + * 法人公司 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-24 + */ +public interface CompanyInvoiceService extends SuperService { +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/CompanyService.java b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/CompanyService.java new file mode 100644 index 0000000..5891b17 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/CompanyService.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.mdm.service; + +import com.yunzhupaas.mdm.entity.*; +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.mdm.model.company.*; +import java.util.*; + +/** + * 企业信息 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-24 + */ +public interface CompanyService extends SuperService { + List getList(CompanyPagination companyPagination); + + List getTypeList(CompanyPagination companyPagination,String dataType); + + CompanyEntity getInfo(String companyid); + + void delete(CompanyEntity entity); + + void create(CompanyEntity entity); + + boolean update(String companyid, CompanyEntity entity); + + String checkForm(CompanyForm form,int i); + + void saveOrUpdate(CompanyForm companyForm,String id, boolean isSave) throws Exception; +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/CorporationService.java b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/CorporationService.java new file mode 100644 index 0000000..c64d3d0 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/CorporationService.java @@ -0,0 +1,14 @@ +package com.yunzhupaas.mdm.service; + +import com.yunzhupaas.mdm.entity.*; +import com.yunzhupaas.base.service.SuperService; + +/** + * 法人公司 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-24 + */ +public interface CorporationService extends SuperService { +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/CustinfoService.java b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/CustinfoService.java new file mode 100644 index 0000000..5238ac2 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/CustinfoService.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.mdm.service; + +import com.yunzhupaas.mdm.entity.*; +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.mdm.model.custinfo.*; +import java.util.*; + +/** + * 客户信息 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-24 + */ +public interface CustinfoService extends SuperService { + List getList(CustinfoPagination companyPagination); + + List getTypeList(CustinfoPagination companyPagination,String dataType); + + CompanyEntity getInfo(String companyid); + + void delete(CompanyEntity entity); + + void create(CompanyEntity entity); + + boolean update(String companyid, CompanyEntity entity); + + String checkForm(CustinfoForm form,int i); + + void saveOrUpdate(CustinfoForm companyForm,String id, boolean isSave) throws Exception; +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/CustomerService.java b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/CustomerService.java new file mode 100644 index 0000000..ad038a2 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/CustomerService.java @@ -0,0 +1,14 @@ +package com.yunzhupaas.mdm.service; + +import com.yunzhupaas.mdm.entity.*; +import com.yunzhupaas.base.service.SuperService; + +/** + * 客户信息 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-24 + */ +public interface CustomerService extends SuperService { +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/LpcService.java b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/LpcService.java new file mode 100644 index 0000000..6c5c5e3 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/LpcService.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.mdm.service; + +import com.yunzhupaas.mdm.entity.*; +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.mdm.model.lpc.*; +import java.util.*; + +/** + * 法人公司 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-24 + */ +public interface LpcService extends SuperService { + List getList(LpcPagination companyPagination); + + List getTypeList(LpcPagination companyPagination,String dataType); + + CompanyEntity getInfo(String companyid); + + void delete(CompanyEntity entity); + + void create(CompanyEntity entity); + + boolean update(String companyid, CompanyEntity entity); + + String checkForm(LpcForm form,int i); + + void saveOrUpdate(LpcForm companyForm,String id, boolean isSave) throws Exception; +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/MaterialService.java b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/MaterialService.java new file mode 100644 index 0000000..ee0001d --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/MaterialService.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.mdm.service; + +import com.yunzhupaas.mdm.entity.*; +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.mdm.model.material.*; +import java.util.*; + +/** + * 物料信息 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-27 + */ +public interface MaterialService extends SuperService { + List getList(MaterialPagination materialPagination); + + List getTypeList(MaterialPagination materialPagination,String dataType); + + MaterialEntity getInfo(String materialid); + + void delete(MaterialEntity entity); + + void create(MaterialEntity entity); + + boolean update(String materialid, MaterialEntity entity); + + String checkForm(MaterialForm form,int i); + + void saveOrUpdate(MaterialForm materialForm,String id, boolean isSave) throws Exception; +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/PanyInvoiceService.java b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/PanyInvoiceService.java new file mode 100644 index 0000000..237169c --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/PanyInvoiceService.java @@ -0,0 +1,14 @@ +package com.yunzhupaas.mdm.service; + +import com.yunzhupaas.mdm.entity.*; +import com.yunzhupaas.base.service.SuperService; + +/** + * 供应商信息 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-24 + */ +public interface PanyInvoiceService extends SuperService { +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/ProductsService.java b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/ProductsService.java new file mode 100644 index 0000000..6b63cc6 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/ProductsService.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.mdm.service; + +import com.yunzhupaas.mdm.entity.*; +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.mdm.model.product.*; +import java.util.*; + +/** + * 商品信息 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-27 + */ +public interface ProductsService extends SuperService { + List getList(ProductPagination productPagination); + + List getTypeList(ProductPagination productPagination,String dataType); + + ProductEntity getInfo(String productid); + + void delete(ProductEntity entity); + + void create(ProductEntity entity); + + boolean update(String productid, ProductEntity entity); + + String checkForm(ProductForm form,int i); + + void saveOrUpdate(ProductForm productForm,String id, boolean isSave) throws Exception; +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/SuppinfoService.java b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/SuppinfoService.java new file mode 100644 index 0000000..8465eb4 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/SuppinfoService.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.mdm.service; + +import com.yunzhupaas.mdm.entity.*; +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.mdm.model.suppinfo.*; +import java.util.*; + +/** + * 供应商信息 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-24 + */ +public interface SuppinfoService extends SuperService { + List getList(SuppinfoPagination companyPagination); + + List getTypeList(SuppinfoPagination companyPagination,String dataType); + + CompanyEntity getInfo(String companyid); + + void delete(CompanyEntity entity); + + void create(CompanyEntity entity); + + boolean update(String companyid, CompanyEntity entity); + + String checkForm(SuppinfoForm form,int i); + + void saveOrUpdate(SuppinfoForm companyForm,String id, boolean isSave) throws Exception; +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/SupplierService.java b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/SupplierService.java new file mode 100644 index 0000000..f9d197a --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/SupplierService.java @@ -0,0 +1,14 @@ +package com.yunzhupaas.mdm.service; + +import com.yunzhupaas.mdm.entity.*; +import com.yunzhupaas.base.service.SuperService; + +/** + * 供应商信息 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-24 + */ +public interface SupplierService extends SuperService { +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/AssetServiceImpl.java b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/AssetServiceImpl.java new file mode 100644 index 0000000..66e4566 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/AssetServiceImpl.java @@ -0,0 +1,354 @@ + +package com.yunzhupaas.mdm.service.impl; + +import com.yunzhupaas.mdm.entity.*; +import com.yunzhupaas.mdm.mapper.AssetMapper; +import com.yunzhupaas.mdm.service.*; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yunzhupaas.mdm.model.asset.*; +import org.springframework.stereotype.Service; +import com.yunzhupaas.base.service.SuperServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import com.yunzhupaas.util.GeneraterSwapUtil; +import java.sql.Connection; +import java.sql.SQLException; +import lombok.Cleanup; +import com.yunzhupaas.database.plugins.DynamicSourceGeneratorInterface; +import com.yunzhupaas.database.util.DynamicDataSourceUtil; +import org.apache.commons.collections4.CollectionUtils; +import com.yunzhupaas.i18n.util.I18nUtil; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.constant.MsgCode; +import java.math.BigDecimal; +import cn.hutool.core.util.ObjectUtil; +import java.lang.reflect.Field; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import java.util.regex.Pattern; +import java.util.stream.Collectors; +import com.yunzhupaas.base.model.ColumnDataModel; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.transaction.annotation.Transactional; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.github.yulichang.toolkit.JoinWrappers; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.yunzhupaas.model.QueryAllModel; +import java.text.SimpleDateFormat; +import com.yunzhupaas.util.*; +import java.util.*; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.permission.entity.UserEntity; +import com.github.pagehelper.PageHelper; +/** + * + * 资产信息 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-28 + */ +@Service +public class AssetServiceImpl extends SuperServiceImpl implements AssetService{ + @Autowired + private GeneraterSwapUtil generaterSwapUtil; + @Autowired + private UserProvider userProvider; + @Override + public List getList(AssetPagination assetPagination){ + return getTypeList(assetPagination,assetPagination.getDataType()); + } + /** 列表查询 */ + @Override + public List getTypeList(AssetPagination assetPagination,String dataType){ + String userId=userProvider.get().getUserId(); + Map tableClassMap=new HashMap<>(); + tableClassMap.put("mdm_asset",AssetEntity.class); + + MPJLambdaWrapper wrapper = JoinWrappers + .lambda("mdm_asset",AssetEntity.class) + .selectAll(AssetEntity.class); + MPJLambdaWrapper wrapper2 = JoinWrappers + .lambda("mdm_asset",AssetEntity.class) + .distinct().select(AssetEntity::getAssetId); + + QueryAllModel queryAllModel = new QueryAllModel(); + queryAllModel.setWrapper(wrapper); + queryAllModel.setClassMap(tableClassMap); + queryAllModel.setDbLink(AssetConstant.DBLINKID); + //数据过滤 + boolean isPc = ServletUtil.getHeader("yunzhupaas-origin").equals("pc"); + String columnData = !isPc ? AssetConstant.getAppColumnData() : AssetConstant.getColumnData(); + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class); + String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList()); + queryAllModel.setRuleJson(ruleJson); + //高级查询 + boolean hasSuperQuery = true; + if (hasSuperQuery) { + queryAllModel.setSuperJson(assetPagination.getSuperQueryJson()); + } + //数据权限 + boolean pcPermission = true; + boolean appPermission = false; + if (isPc && pcPermission) { + queryAllModel.setModuleId(assetPagination.getMenuId()); + } + if (!isPc && appPermission) { + queryAllModel.setModuleId(assetPagination.getMenuId()); + } + //拼接复杂条件 + wrapper = generaterSwapUtil.getConditionAllTable(queryAllModel); + if(wrapper == null) return new ArrayList<>(); + queryAllModel.setWrapper(wrapper2); + wrapper2 = generaterSwapUtil.getConditionAllTable(queryAllModel); + //其他条件拼接 + otherConditions(assetPagination, wrapper, isPc); + otherConditions(assetPagination, wrapper2, isPc); + + if("0".equals(dataType)){ + com.github.pagehelper.Page objects = PageHelper.startPage((int) assetPagination.getCurrentPage(), (int) assetPagination.getPageSize(), true); + List userIPage = this.selectJoinList(AssetEntity.class, wrapper2); + List collect = userIPage.stream().map(t -> t.getAssetId()).collect(Collectors.toList()); + if(CollectionUtils.isNotEmpty(collect)){ + wrapper.in(AssetEntity::getAssetId,collect); + } + List result = this.selectJoinList(AssetEntity.class, wrapper); + return assetPagination.setData(result,objects.getTotal()); + }else{ + List list = this.selectJoinList(AssetEntity.class, wrapper); + if("2".equals(dataType)){ + List selectIds = Arrays.asList(assetPagination.getSelectIds()); + return list.stream().filter(t -> selectIds.contains(t.getAssetId())).collect(Collectors.toList()); + }else{ + return list; + } + } + + } + + /** + * 其他条件拼接 + */ + private void otherConditions(AssetPagination assetPagination, MPJLambdaWrapper wrapper, boolean isPc) { + String databaseName; + try { + @Cleanup Connection cnn = DynamicDataSourceUtil.getCurrentConnection(); + databaseName = cnn.getMetaData().getDatabaseProductName().trim(); + } catch (SQLException e) { + throw new DataException(e.getMessage()); + } + //假删除标志 + wrapper.isNull(AssetEntity::getDeleteMark); + + wrapper.isNull(AssetEntity::getFlowId); + //关键词 + if(ObjectUtil.isNotEmpty(assetPagination.getYunzhupaasKeyword())){ + } + //普通查询 + if(isPc){ + if(ObjectUtil.isNotEmpty(assetPagination.getAssetCode())){ + String value = assetPagination.getAssetCode() instanceof List ? + JsonUtil.getObjectToString(assetPagination.getAssetCode()) : + String.valueOf(assetPagination.getAssetCode()); + wrapper.like(AssetEntity::getAssetCode,value); + } + + if(ObjectUtil.isNotEmpty(assetPagination.getAssetName())){ + String value = assetPagination.getAssetName() instanceof List ? + JsonUtil.getObjectToString(assetPagination.getAssetName()) : + String.valueOf(assetPagination.getAssetName()); + wrapper.like(AssetEntity::getAssetName,value); + } + + if(ObjectUtil.isNotEmpty(assetPagination.getAssetStatus())){ + List idList = new ArrayList<>(); + try { + String[][] assetStatus = JsonUtil.getJsonToBean(assetPagination.getAssetStatus(),String[][].class); + for(int i=0;i0){ + idList.add(JsonUtil.getObjectToString(Arrays.asList(assetStatus[i]))); + } + } + }catch (Exception e1){ + try { + List assetStatus = JsonUtil.getJsonToList(assetPagination.getAssetStatus(),String.class); + if(assetStatus.size()>0){ + idList.addAll(assetStatus); + } + }catch (Exception e2){ + idList.add(String.valueOf(assetPagination.getAssetStatus())); + } + } + wrapper.and(t->{ + idList.forEach(tt->{ + if(StringUtil.isNotEmpty(tt) && "Microsoft SQL Server".equalsIgnoreCase(databaseName)){ + tt = tt.replaceFirst("\\[","[[]"); + } + t.like(AssetEntity::getAssetStatus, tt).or(); + }); + }); + } + + if(ObjectUtil.isNotEmpty(assetPagination.getPurchaseDate())){ + List PurchaseDateList = JsonUtil.getJsonToList(assetPagination.getPurchaseDate(),String.class); + for(int i=0;i Objects.equals(finalOderTableField, t.getTableAlias()) + && Objects.equals(finalSidxField, t.getColumn())).findFirst().orElse(null); + oderTableField = oderTableField + "." + sidxField; + if (select == null) { + wrapper.select(oderTableField); + } + if (descFlag) { + wrapper.orderByDesc(oderTableField); + } else { + wrapper.orderByAsc(oderTableField); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } + @Override + public AssetEntity getInfo(String assetid){ + MPJLambdaWrapper wrapper = JoinWrappers + .lambda("mdm_asset",AssetEntity.class) + .selectAll(AssetEntity.class); + wrapper.and( + t->t.eq(AssetEntity::getAssetId, assetid ) + .or().eq(AssetEntity::getFlowTaskId, assetid) + ); + return this.selectJoinOne(AssetEntity.class,wrapper); + } + @Override + public void create(AssetEntity entity){ + this.save(entity); + } + @Override + public boolean update(String assetid, AssetEntity entity){ + return this.updateById(entity); + } + @Override + public void delete(AssetEntity entity){ + if(entity!=null){ + this.removeById(entity.getAssetId()); + } + } + /** 验证表单唯一字段,正则,非空 i-0新增-1修改*/ + @Override + public String checkForm(AssetForm form,int i) { + boolean isUp =StringUtil.isNotEmpty(form.getAssetId()) && !form.getAssetId().equals("0"); + Object id= null; + String countRecover = ""; + String fieldTipName = ""; + String canNotNull = I18nUtil.getMessageStr("sys.validate.textRequiredSuffix", "不能为空"); + String canNotRepeated = I18nUtil.getMessageStr("EXIST103", "不能重复"); + if (isUp){ + id = form.getAssetId(); + } + //主表字段验证 + fieldTipName = "资产编码"; + fieldTipName = "资产名称"; + if(StringUtil.isEmpty(form.getAssetName())){ + return fieldTipName + canNotNull; + } + fieldTipName = "资产类型"; + fieldTipName = "资产分类"; + fieldTipName = "资产状态"; + fieldTipName = "资产位置"; + fieldTipName = "使用组织"; + fieldTipName = "保管用户"; + fieldTipName = "资产权属"; + fieldTipName = "单位"; + fieldTipName = "数量"; + fieldTipName = "购置日期"; + fieldTipName = "启用日期"; + fieldTipName = "预计使用年限"; + fieldTipName = "供应商"; + fieldTipName = "备注"; + return countRecover; + } + /** + * 新增修改数据(事务回滚) + * @param id + * @param assetForm + * @return + */ + @Override + @Transactional + public void saveOrUpdate(AssetForm assetForm,String id, boolean isSave) throws Exception{ + UserInfo userInfo=userProvider.get(); + UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId()); + assetForm = JsonUtil.getJsonToBean( + generaterSwapUtil.swapDatetime(AssetConstant.getFormData(),assetForm,AssetConstant.TABLERENAMES),AssetForm.class); + AssetEntity entity = JsonUtil.getJsonToBean(assetForm, AssetEntity.class); + String mainUuid = StringUtil.isEmpty(id) ? RandomUtil.uuId() : id; + if(isSave){ + entity.setFlowTaskId(mainUuid); + entity.setAssetCode(generaterSwapUtil.getBillNumber("assetCode", false)); + entity.setAssetId(mainUuid); + } else { + if(StringUtil.isEmpty(entity.getAssetCode()) ){ + entity.setAssetCode(generaterSwapUtil.getBillNumber("assetCode", false)); + } + } + boolean b = this.saveOrUpdate(entity); + AssetEntity info = this.getInfo(mainUuid); + if (info == null) throw new RuntimeException(MsgCode.FA001.get()); + + } +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/CompanyBankServiceImpl.java b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/CompanyBankServiceImpl.java new file mode 100644 index 0000000..026364c --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/CompanyBankServiceImpl.java @@ -0,0 +1,24 @@ + +package com.yunzhupaas.mdm.service.impl; + +import com.yunzhupaas.mdm.entity.*; +import com.yunzhupaas.mdm.mapper.CompanyBankMapper; +import com.yunzhupaas.mdm.service.*; +import org.springframework.stereotype.Service; +import com.yunzhupaas.base.service.SuperServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import com.yunzhupaas.util.GeneraterSwapUtil; + +/** + * + * 法人公司 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-24 + */ +@Service +public class CompanyBankServiceImpl extends SuperServiceImpl implements CompanyBankService{ + @Autowired + private GeneraterSwapUtil generaterSwapUtil; +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/CompanyInvoiceServiceImpl.java b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/CompanyInvoiceServiceImpl.java new file mode 100644 index 0000000..f96ea25 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/CompanyInvoiceServiceImpl.java @@ -0,0 +1,24 @@ + +package com.yunzhupaas.mdm.service.impl; + +import com.yunzhupaas.mdm.entity.*; +import com.yunzhupaas.mdm.mapper.CompanyInvoiceMapper; +import com.yunzhupaas.mdm.service.*; +import org.springframework.stereotype.Service; +import com.yunzhupaas.base.service.SuperServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import com.yunzhupaas.util.GeneraterSwapUtil; + +/** + * + * 法人公司 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-24 + */ +@Service +public class CompanyInvoiceServiceImpl extends SuperServiceImpl implements CompanyInvoiceService{ + @Autowired + private GeneraterSwapUtil generaterSwapUtil; +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/CompanyServiceImpl.java b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/CompanyServiceImpl.java new file mode 100644 index 0000000..f1f5b8d --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/CompanyServiceImpl.java @@ -0,0 +1,485 @@ + +package com.yunzhupaas.mdm.service.impl; + +import com.yunzhupaas.mdm.entity.*; +import com.yunzhupaas.mdm.mapper.CompanyMapper; +import com.yunzhupaas.mdm.service.*; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yunzhupaas.mdm.model.company.*; +import org.springframework.stereotype.Service; +import com.yunzhupaas.base.service.SuperServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import com.yunzhupaas.util.GeneraterSwapUtil; +import java.sql.Connection; +import java.sql.SQLException; +import lombok.Cleanup; +import com.yunzhupaas.database.plugins.DynamicSourceGeneratorInterface; +import com.yunzhupaas.database.util.DynamicDataSourceUtil; +import org.apache.commons.collections4.CollectionUtils; +import com.yunzhupaas.i18n.util.I18nUtil; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.constant.MsgCode; +import java.math.BigDecimal; +import cn.hutool.core.util.ObjectUtil; +import java.lang.reflect.Field; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import java.util.regex.Pattern; +import java.util.stream.Collectors; +import com.yunzhupaas.base.model.ColumnDataModel; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.transaction.annotation.Transactional; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.github.yulichang.toolkit.JoinWrappers; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.yunzhupaas.model.QueryAllModel; +import java.text.SimpleDateFormat; +import com.yunzhupaas.util.*; +import java.util.*; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.permission.entity.UserEntity; +import com.github.pagehelper.PageHelper; +/** + * + * 企业信息 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-24 + */ +@Service +public class CompanyServiceImpl extends SuperServiceImpl implements CompanyService{ + @Autowired + private GeneraterSwapUtil generaterSwapUtil; + @Autowired + private UserProvider userProvider; + @Autowired + private CompanyBankService mdmCompanyBankService; + @Autowired + private CompanyInvoiceService companyInvoiceService; + @Override + public List getList(CompanyPagination companyPagination){ + return getTypeList(companyPagination,companyPagination.getDataType()); + } + /** 列表查询 */ + @Override + public List getTypeList(CompanyPagination companyPagination,String dataType){ + String userId=userProvider.get().getUserId(); + Map tableClassMap=new HashMap<>(); + tableClassMap.put("mdm_company",CompanyEntity.class); + tableClassMap.put("mdm_company_bank",CompanyBankEntity.class); + tableClassMap.put("mdm_company_invoice",CompanyInvoiceEntity.class); + + MPJLambdaWrapper wrapper = JoinWrappers + .lambda("mdm_company",CompanyEntity.class) + .selectCollection(CompanyBankEntity.class,CompanyEntity::getCompanyBank) + .leftJoin(CompanyBankEntity.class,"mdm_company_bank",CompanyBankEntity::getCompanyId,CompanyEntity::getCompanyId) + .selectCollection(CompanyInvoiceEntity.class,CompanyEntity::getCompanyInvoice) + .leftJoin(CompanyInvoiceEntity.class,"mdm_company_invoice",CompanyInvoiceEntity::getCompanyId,CompanyEntity::getCompanyId) + .selectAll(CompanyEntity.class); + MPJLambdaWrapper wrapper2 = JoinWrappers + .lambda("mdm_company",CompanyEntity.class) + .leftJoin(CompanyBankEntity.class,"mdm_company_bank",CompanyBankEntity::getCompanyId,CompanyEntity::getCompanyId) + .leftJoin(CompanyInvoiceEntity.class,"mdm_company_invoice",CompanyInvoiceEntity::getCompanyId,CompanyEntity::getCompanyId) + .distinct().select(CompanyEntity::getCompanyId); + + QueryAllModel queryAllModel = new QueryAllModel(); + queryAllModel.setWrapper(wrapper); + queryAllModel.setClassMap(tableClassMap); + queryAllModel.setDbLink(CompanyConstant.DBLINKID); + //数据过滤 + boolean isPc = ServletUtil.getHeader("yunzhupaas-origin").equals("pc"); + String columnData = !isPc ? CompanyConstant.getAppColumnData() : CompanyConstant.getColumnData(); + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class); + String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList()); + queryAllModel.setRuleJson(ruleJson); + //高级查询 + boolean hasSuperQuery = true; + if (hasSuperQuery) { + queryAllModel.setSuperJson(companyPagination.getSuperQueryJson()); + } + //数据权限 + boolean pcPermission = true; + boolean appPermission = false; + if (isPc && pcPermission) { + queryAllModel.setModuleId(companyPagination.getMenuId()); + } + if (!isPc && appPermission) { + queryAllModel.setModuleId(companyPagination.getMenuId()); + } + //拼接复杂条件 + wrapper = generaterSwapUtil.getConditionAllTable(queryAllModel); + if(wrapper == null) return new ArrayList<>(); + queryAllModel.setWrapper(wrapper2); + wrapper2 = generaterSwapUtil.getConditionAllTable(queryAllModel); + //其他条件拼接 + otherConditions(companyPagination, wrapper, isPc); + otherConditions(companyPagination, wrapper2, isPc); + + if("0".equals(dataType)){ + com.github.pagehelper.Page objects = PageHelper.startPage((int) companyPagination.getCurrentPage(), (int) companyPagination.getPageSize(), true); + List userIPage = this.selectJoinList(CompanyEntity.class, wrapper2); + List collect = userIPage.stream().map(t -> t.getCompanyId()).collect(Collectors.toList()); + if(CollectionUtils.isNotEmpty(collect)){ + wrapper.in(CompanyEntity::getCompanyId,collect); + } + List result = this.selectJoinList(CompanyEntity.class, wrapper); + return companyPagination.setData(result,objects.getTotal()); + }else{ + List list = this.selectJoinList(CompanyEntity.class, wrapper); + if("2".equals(dataType)){ + List selectIds = Arrays.asList(companyPagination.getSelectIds()); + return list.stream().filter(t -> selectIds.contains(t.getCompanyId())).collect(Collectors.toList()); + }else{ + return list; + } + } + + } + + /** + * 其他条件拼接 + */ + private void otherConditions(CompanyPagination companyPagination, MPJLambdaWrapper wrapper, boolean isPc) { + String databaseName; + try { + @Cleanup Connection cnn = DynamicDataSourceUtil.getCurrentConnection(); + databaseName = cnn.getMetaData().getDatabaseProductName().trim(); + } catch (SQLException e) { + throw new DataException(e.getMessage()); + } + wrapper.isNull(CompanyEntity::getFlowId); + //关键词 + if(ObjectUtil.isNotEmpty(companyPagination.getYunzhupaasKeyword())){ + } + //普通查询 + if(isPc){ + if(ObjectUtil.isNotEmpty(companyPagination.getCompanyName())){ + String value = companyPagination.getCompanyName() instanceof List ? + JsonUtil.getObjectToString(companyPagination.getCompanyName()) : + String.valueOf(companyPagination.getCompanyName()); + wrapper.like(CompanyEntity::getCompanyName,value); + } + + if(ObjectUtil.isNotEmpty(companyPagination.getOrgId())){ + List idList = new ArrayList<>(); + try { + String[][] orgId = JsonUtil.getJsonToBean(companyPagination.getOrgId(),String[][].class); + for(int i=0;i0){ + idList.add(JsonUtil.getObjectToString(Arrays.asList(orgId[i]))); + } + } + }catch (Exception e1){ + try { + List orgId = JsonUtil.getJsonToList(companyPagination.getOrgId(),String.class); + if(orgId.size()>0){ + idList.add(JsonUtil.getObjectToString(orgId)); + } + }catch (Exception e2){ + idList.add(String.valueOf(companyPagination.getOrgId())); + } + } + wrapper.and(t->{ + idList.forEach(tt->{ + if(StringUtil.isNotEmpty(tt) && "Microsoft SQL Server".equalsIgnoreCase(databaseName)){ + tt = tt.replaceFirst("\\[","[[]"); + } + t.like(CompanyEntity::getOrgId, tt).or(); + }); + }); + } + + } + //排序 + if(StringUtil.isEmpty(companyPagination.getSidx())){ + wrapper.orderByDesc(CompanyEntity::getCompanyId); + }else{ + try { + String[] split = companyPagination.getSidx().split(","); + for(String sidx:split){ + CompanyEntity companyEntity = new CompanyEntity(); + String oderTableField = companyEntity.getClass().getAnnotation(TableName.class).value(); + boolean descFlag = sidx.startsWith("-"); + String sidxField = descFlag ? sidx.substring(1) : sidx; + try{ + Field declaredField = companyEntity.getClass().getDeclaredField(sidxField); + declaredField.setAccessible(true); + sidxField = declaredField.getAnnotation(TableField.class).value(); + }catch (Exception e){ + } + String finalOderTableField = oderTableField; + String finalSidxField = sidxField; + Object select = wrapper.getSelectColumns().stream().filter(t -> Objects.equals(finalOderTableField, t.getTableAlias()) + && Objects.equals(finalSidxField, t.getColumn())).findFirst().orElse(null); + oderTableField = oderTableField + "." + sidxField; + if (select == null) { + wrapper.select(oderTableField); + } + if (descFlag) { + wrapper.orderByDesc(oderTableField); + } else { + wrapper.orderByAsc(oderTableField); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } + @Override + public CompanyEntity getInfo(String companyid){ + MPJLambdaWrapper wrapper = JoinWrappers + .lambda("mdm_company",CompanyEntity.class) + .selectCollection(CompanyBankEntity.class,CompanyEntity::getCompanyBank) + .leftJoin(CompanyBankEntity.class,"mdm_company_bank",CompanyBankEntity::getCompanyId,CompanyEntity::getCompanyId) + .selectCollection(CompanyInvoiceEntity.class,CompanyEntity::getCompanyInvoice) + .leftJoin(CompanyInvoiceEntity.class,"mdm_company_invoice",CompanyInvoiceEntity::getCompanyId,CompanyEntity::getCompanyId) + .selectAll(CompanyEntity.class); + wrapper.and( + t->t.eq(CompanyEntity::getCompanyId, companyid ) + .or().eq(CompanyEntity::getFlowTaskId, companyid) + ); + return this.selectJoinOne(CompanyEntity.class,wrapper); + } + @Override + public void create(CompanyEntity entity){ + this.save(entity); + } + @Override + public boolean update(String companyid, CompanyEntity entity){ + return this.updateById(entity); + } + @Override + public void delete(CompanyEntity entity){ + if(entity!=null){ + this.removeById(entity.getCompanyId()); + } + } + /** 验证表单唯一字段,正则,非空 i-0新增-1修改*/ + @Override + public String checkForm(CompanyForm form,int i) { + boolean isUp =StringUtil.isNotEmpty(form.getCompanyId()) && !form.getCompanyId().equals("0"); + Object id= null; + String countRecover = ""; + String fieldTipName = ""; + String canNotNull = I18nUtil.getMessageStr("sys.validate.textRequiredSuffix", "不能为空"); + String canNotRepeated = I18nUtil.getMessageStr("EXIST103", "不能重复"); + if (isUp){ + id = form.getCompanyId(); + } + //主表字段验证 + fieldTipName = "企业编码"; + fieldTipName = "企业名称"; + if(StringUtil.isEmpty(form.getCompanyName())){ + return fieldTipName + canNotNull; + } + if(StringUtil.isNotEmpty(form.getCompanyName())){ + form.setCompanyName(form.getCompanyName().trim()); + QueryWrapper company_nameWrapper=new QueryWrapper<>(); + company_nameWrapper.lambda().eq(CompanyEntity::getCompanyName,form.getCompanyName()); + company_nameWrapper.lambda().isNull(CompanyEntity::getFlowId); + if (isUp){ + company_nameWrapper.lambda().ne(CompanyEntity::getCompanyId, id); + } + if((int) this.count(company_nameWrapper)>0){ + countRecover = fieldTipName + canNotRepeated; + } + } + fieldTipName = "简称/昵称"; + fieldTipName = "类型"; + fieldTipName = "社会信用代码"; + if(StringUtil.isEmpty(form.getCreditCode())){ + return fieldTipName + canNotNull; + } + if(StringUtil.isNotEmpty(form.getCreditCode())){ + form.setCreditCode(form.getCreditCode().trim()); + QueryWrapper credit_codeWrapper=new QueryWrapper<>(); + credit_codeWrapper.lambda().eq(CompanyEntity::getCreditCode,form.getCreditCode()); + credit_codeWrapper.lambda().isNull(CompanyEntity::getFlowId); + if (isUp){ + credit_codeWrapper.lambda().ne(CompanyEntity::getCompanyId, id); + } + if((int) this.count(credit_codeWrapper)>0){ + countRecover = fieldTipName + canNotRepeated; + } + } + fieldTipName = "归属组织"; + fieldTipName = "所属地区"; + fieldTipName = "纳税人类别"; + fieldTipName = "企业规模"; + fieldTipName = "企业类型"; + fieldTipName = "行业代码"; + fieldTipName = "成立日期"; + fieldTipName = "注册资本"; + fieldTipName = "法定代表人"; + fieldTipName = "联系电话"; + if(StringUtil.isNotEmpty(form.getPhone())){ + if(!Pattern.compile("^1[3456789]\\d{9}$|^0\\d{2,3}-?\\d{7,8}$").matcher(String.valueOf(form.getPhone())).matches()){ + return I18nUtil.getMessageStr("sys.validate.telephone", "请输入正确的电话号码"); + } + } + fieldTipName = "邮箱"; + if(StringUtil.isNotEmpty(form.getEmail())){ + if(!Pattern.compile("^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$").matcher(String.valueOf(form.getEmail())).matches()){ + return I18nUtil.getMessageStr("sys.validate.email", "请输入正确的邮箱"); + } + } + fieldTipName = "网站"; + fieldTipName = "地址"; + fieldTipName = "经营范围"; + fieldTipName = "备注"; + //子表字段验证 + if (form.getMdmCompanyBankList()!=null){ + + fieldTipName = "设计子表" + + "-" + "开户行"; + + + fieldTipName = "设计子表" + + "-" + "账户名"; + + + fieldTipName = "设计子表" + + "-" + "银行账号"; + + + fieldTipName = "设计子表" + + "-" + "开户行城市"; + + + fieldTipName = "设计子表" + + "-" + "备注"; + + } + if (form.getCompanyInvoiceList()!=null){ + + fieldTipName = "设计子表" + + "-" + "发票抬头编码"; + + + fieldTipName = "设计子表" + + "-" + "发票抬头名称"; + + + fieldTipName = "设计子表" + + "-" + "纳税人识别号"; + + + fieldTipName = "设计子表" + + "-" + "纳税人类别"; + + + fieldTipName = "设计子表" + + "-" + "地址"; + + + fieldTipName = "设计子表" + + "-" + "电话"; + + + fieldTipName = "设计子表" + + "-" + "开户银行"; + + + fieldTipName = "设计子表" + + "-" + "银行账户"; + + + fieldTipName = "设计子表" + + "-" + "是否默认"; + + + fieldTipName = "设计子表" + + "-" + "是否有效"; + + + fieldTipName = "设计子表" + + "-" + "备注"; + + } + return countRecover; + } + /** + * 新增修改数据(事务回滚) + * @param id + * @param companyForm + * @return + */ + @Override + @Transactional + public void saveOrUpdate(CompanyForm companyForm,String id, boolean isSave) throws Exception{ + UserInfo userInfo=userProvider.get(); + UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId()); + companyForm = JsonUtil.getJsonToBean( + generaterSwapUtil.swapDatetime(CompanyConstant.getFormData(),companyForm,CompanyConstant.TABLERENAMES),CompanyForm.class); + CompanyEntity entity = JsonUtil.getJsonToBean(companyForm, CompanyEntity.class); + String mainUuid = StringUtil.isEmpty(id) ? RandomUtil.uuId() : id; + if(isSave){ + entity.setFlowTaskId(mainUuid); + entity.setCompanyCode(generaterSwapUtil.getBillNumber("companyCode", false)); + entity.setCompanyId(mainUuid); + } else { + if(StringUtil.isEmpty(entity.getCompanyCode()) ){ + entity.setCompanyCode(generaterSwapUtil.getBillNumber("companyCode", false)); + } + } + boolean b = this.saveOrUpdate(entity); + CompanyEntity info = this.getInfo(mainUuid); + if (info == null) throw new RuntimeException(MsgCode.FA001.get()); + + //MdmCompanyBank子表数据新增修改 + QueryWrapper MdmCompanyBankqueryWrapper = new QueryWrapper<>(); + MdmCompanyBankqueryWrapper.lambda().eq(CompanyBankEntity::getCompanyId, info.getCompanyId()); + if(!isSave && !CollectionUtils.isNotEmpty(companyForm.getMdmCompanyBankList())){ + mdmCompanyBankService.remove(MdmCompanyBankqueryWrapper); + } + if (CollectionUtils.isNotEmpty(companyForm.getMdmCompanyBankList())){ + List tableFieldad9d92 = JsonUtil.getJsonToList(companyForm.getMdmCompanyBankList(),CompanyBankEntity.class); + //移除的数据 + List childIds = tableFieldad9d92.stream().filter(t->t.getBankId()!=null).map(CompanyBankEntity::getBankId).collect(Collectors.toList()); + if(CollectionUtils.isNotEmpty(childIds)){ + MdmCompanyBankqueryWrapper.lambda().notIn(CompanyBankEntity::getBankId,childIds); + } + mdmCompanyBankService.remove(MdmCompanyBankqueryWrapper); + for(CompanyBankEntity entitys : tableFieldad9d92){ + entitys.setCompanyId(entity.getCompanyId()); + if(entitys.getBankId()==null){ + entitys.setBankId(RandomUtil.uuId()); + } + mdmCompanyBankService.saveOrUpdate(entitys); + } + } + //CompanyInvoice子表数据新增修改 + QueryWrapper CompanyInvoicequeryWrapper = new QueryWrapper<>(); + CompanyInvoicequeryWrapper.lambda().eq(CompanyInvoiceEntity::getCompanyId, info.getCompanyId()); + if(!isSave && !CollectionUtils.isNotEmpty(companyForm.getCompanyInvoiceList())){ + companyInvoiceService.remove(CompanyInvoicequeryWrapper); + } + if (CollectionUtils.isNotEmpty(companyForm.getCompanyInvoiceList())){ + List tableField46dc53 = JsonUtil.getJsonToList(companyForm.getCompanyInvoiceList(),CompanyInvoiceEntity.class); + //移除的数据 + List childIds = tableField46dc53.stream().filter(t->t.getInvoiceId()!=null).map(CompanyInvoiceEntity::getInvoiceId).collect(Collectors.toList()); + if(CollectionUtils.isNotEmpty(childIds)){ + CompanyInvoicequeryWrapper.lambda().notIn(CompanyInvoiceEntity::getInvoiceId,childIds); + } + companyInvoiceService.remove(CompanyInvoicequeryWrapper); + for(CompanyInvoiceEntity entitys : tableField46dc53){ + entitys.setCompanyId(entity.getCompanyId()); + if(isSave || entitys.getInvoiceId()==null){ + entitys.setTitleCode(generaterSwapUtil.getBillNumber("InvoiceTitleCode", false)); + }else{ + if(StringUtil.isEmpty(entitys.getTitleCode()) || entitys.getInvoiceId() == null ){ + entitys.setTitleCode(generaterSwapUtil.getBillNumber("InvoiceTitleCode", false)); + } + } + if(entitys.getInvoiceId()==null){ + entitys.setInvoiceId(RandomUtil.uuId()); + } + companyInvoiceService.saveOrUpdate(entitys); + } + } + } +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/CorporationServiceImpl.java b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/CorporationServiceImpl.java new file mode 100644 index 0000000..f939f8e --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/CorporationServiceImpl.java @@ -0,0 +1,24 @@ + +package com.yunzhupaas.mdm.service.impl; + +import com.yunzhupaas.mdm.entity.*; +import com.yunzhupaas.mdm.mapper.CorporationMapper; +import com.yunzhupaas.mdm.service.*; +import org.springframework.stereotype.Service; +import com.yunzhupaas.base.service.SuperServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import com.yunzhupaas.util.GeneraterSwapUtil; + +/** + * + * 法人公司 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-24 + */ +@Service +public class CorporationServiceImpl extends SuperServiceImpl implements CorporationService{ + @Autowired + private GeneraterSwapUtil generaterSwapUtil; +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/CustinfoServiceImpl.java b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/CustinfoServiceImpl.java new file mode 100644 index 0000000..8d44322 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/CustinfoServiceImpl.java @@ -0,0 +1,509 @@ + +package com.yunzhupaas.mdm.service.impl; + +import com.yunzhupaas.mdm.entity.*; +import com.yunzhupaas.mdm.mapper.CompanyMapper; +import com.yunzhupaas.mdm.service.*; +import com.yunzhupaas.mdm.model.custinfo.*; +import org.springframework.stereotype.Service; +import com.yunzhupaas.base.service.SuperServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import com.yunzhupaas.util.GeneraterSwapUtil; +import java.sql.Connection; +import java.sql.SQLException; +import lombok.Cleanup; +import com.yunzhupaas.database.util.DynamicDataSourceUtil; +import org.apache.commons.collections4.CollectionUtils; +import com.yunzhupaas.i18n.util.I18nUtil; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.constant.MsgCode; +import cn.hutool.core.util.ObjectUtil; +import java.lang.reflect.Field; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import java.util.regex.Pattern; +import java.util.stream.Collectors; +import com.yunzhupaas.base.model.ColumnDataModel; +import org.springframework.transaction.annotation.Transactional; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.github.yulichang.toolkit.JoinWrappers; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.yunzhupaas.model.QueryAllModel; +import com.yunzhupaas.util.*; +import java.util.*; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.permission.entity.UserEntity; +import com.github.pagehelper.PageHelper; +/** + * + * 客户信息 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-24 + */ +@Service +public class CustinfoServiceImpl extends SuperServiceImpl implements CustinfoService{ + @Autowired + private GeneraterSwapUtil generaterSwapUtil; + @Autowired + private UserProvider userProvider; + @Autowired + private CustomerService customerService; + @Autowired + private CompanyInvoiceService companyInvoiceService; + @Autowired + private CompanyBankService companyBankService; + @Override + public List getList(CustinfoPagination companyPagination){ + return getTypeList(companyPagination,companyPagination.getDataType()); + } + /** 列表查询 */ + @Override + public List getTypeList(CustinfoPagination companyPagination,String dataType){ + String userId=userProvider.get().getUserId(); + Map tableClassMap=new HashMap<>(); + tableClassMap.put("mdm_company",CompanyEntity.class); + tableClassMap.put("mdm_company_bank",CompanyBankEntity.class); + tableClassMap.put("mdm_company_invoice",CompanyInvoiceEntity.class); + tableClassMap.put("mdm_customer",CustomerEntity.class); + + MPJLambdaWrapper wrapper = JoinWrappers + .lambda("mdm_company",CompanyEntity.class) + .selectCollection(CompanyBankEntity.class,CompanyEntity::getCompanyBank) + .leftJoin(CompanyBankEntity.class,"mdm_company_bank",CompanyBankEntity::getCompanyId,CompanyEntity::getCompanyId) + .selectCollection(CompanyInvoiceEntity.class,CompanyEntity::getCompanyInvoice) + .leftJoin(CompanyInvoiceEntity.class,"mdm_company_invoice",CompanyInvoiceEntity::getCompanyId,CompanyEntity::getCompanyId) + .selectAssociation(CustomerEntity.class,CompanyEntity::getCustomer) + .leftJoin(CustomerEntity.class,"mdm_customer",CustomerEntity::getCompanyId,CompanyEntity::getCompanyId) + .selectAll(CompanyEntity.class); + MPJLambdaWrapper wrapper2 = JoinWrappers + .lambda("mdm_company",CompanyEntity.class) + .leftJoin(CompanyBankEntity.class,"mdm_company_bank",CompanyBankEntity::getCompanyId,CompanyEntity::getCompanyId) + .leftJoin(CompanyInvoiceEntity.class,"mdm_company_invoice",CompanyInvoiceEntity::getCompanyId,CompanyEntity::getCompanyId) + .leftJoin(CustomerEntity.class,"mdm_customer",CustomerEntity::getCompanyId,CompanyEntity::getCompanyId) + .distinct().select(CompanyEntity::getCompanyId); + + QueryAllModel queryAllModel = new QueryAllModel(); + queryAllModel.setWrapper(wrapper); + queryAllModel.setClassMap(tableClassMap); + queryAllModel.setDbLink(CustinfoConstant.DBLINKID); + //数据过滤 + boolean isPc = ServletUtil.getHeader("yunzhupaas-origin").equals("pc"); + String columnData = !isPc ? CustinfoConstant.getAppColumnData() : CustinfoConstant.getColumnData(); + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class); + String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList()); + queryAllModel.setRuleJson(ruleJson); + //高级查询 + boolean hasSuperQuery = true; + if (hasSuperQuery) { + queryAllModel.setSuperJson(companyPagination.getSuperQueryJson()); + } + //数据权限 + boolean pcPermission = true; + boolean appPermission = false; + if (isPc && pcPermission) { + queryAllModel.setModuleId(companyPagination.getMenuId()); + } + if (!isPc && appPermission) { + queryAllModel.setModuleId(companyPagination.getMenuId()); + } + //拼接复杂条件 + wrapper = generaterSwapUtil.getConditionAllTable(queryAllModel); + if(wrapper == null) return new ArrayList<>(); + queryAllModel.setWrapper(wrapper2); + wrapper2 = generaterSwapUtil.getConditionAllTable(queryAllModel); + //其他条件拼接 + otherConditions(companyPagination, wrapper, isPc); + otherConditions(companyPagination, wrapper2, isPc); + + if("0".equals(dataType)){ + com.github.pagehelper.Page objects = PageHelper.startPage((int) companyPagination.getCurrentPage(), (int) companyPagination.getPageSize(), true); + List userIPage = this.selectJoinList(CompanyEntity.class, wrapper2); + List collect = userIPage.stream().map(t -> t.getCompanyId()).collect(Collectors.toList()); + if(CollectionUtils.isNotEmpty(collect)){ + wrapper.in(CompanyEntity::getCompanyId,collect); + } + List result = this.selectJoinList(CompanyEntity.class, wrapper); + return companyPagination.setData(result,objects.getTotal()); + }else{ + List list = this.selectJoinList(CompanyEntity.class, wrapper); + if("2".equals(dataType)){ + List selectIds = Arrays.asList(companyPagination.getSelectIds()); + return list.stream().filter(t -> selectIds.contains(t.getCompanyId())).collect(Collectors.toList()); + }else{ + return list; + } + } + + } + + /** + * 其他条件拼接 + */ + private void otherConditions(CustinfoPagination companyPagination, MPJLambdaWrapper wrapper, boolean isPc) { + String databaseName; + try { + @Cleanup Connection cnn = DynamicDataSourceUtil.getCurrentConnection(); + databaseName = cnn.getMetaData().getDatabaseProductName().trim(); + } catch (SQLException e) { + throw new DataException(e.getMessage()); + } + wrapper.isNull(CompanyEntity::getFlowId); + //关键词 + if(ObjectUtil.isNotEmpty(companyPagination.getYunzhupaasKeyword())){ + } + //普通查询 + if(isPc){ + if(ObjectUtil.isNotEmpty(companyPagination.getCompanyName())){ + String value = companyPagination.getCompanyName() instanceof List ? + JsonUtil.getObjectToString(companyPagination.getCompanyName()) : + String.valueOf(companyPagination.getCompanyName()); + wrapper.like(CompanyEntity::getCompanyName,value); + } + + if(ObjectUtil.isNotEmpty(companyPagination.getOrgId())){ + List idList = new ArrayList<>(); + try { + String[][] orgId = JsonUtil.getJsonToBean(companyPagination.getOrgId(),String[][].class); + for(int i=0;i0){ + idList.add(JsonUtil.getObjectToString(Arrays.asList(orgId[i]))); + } + } + }catch (Exception e1){ + try { + List orgId = JsonUtil.getJsonToList(companyPagination.getOrgId(),String.class); + if(orgId.size()>0){ + idList.add(JsonUtil.getObjectToString(orgId)); + } + }catch (Exception e2){ + idList.add(String.valueOf(companyPagination.getOrgId())); + } + } + wrapper.and(t->{ + idList.forEach(tt->{ + if(StringUtil.isNotEmpty(tt) && "Microsoft SQL Server".equalsIgnoreCase(databaseName)){ + tt = tt.replaceFirst("\\[","[[]"); + } + t.like(CompanyEntity::getOrgId, tt).or(); + }); + }); + } + + } + //排序 + if(StringUtil.isEmpty(companyPagination.getSidx())){ + wrapper.orderByDesc(CompanyEntity::getCompanyId); + }else{ + try { + String[] split = companyPagination.getSidx().split(","); + for(String sidx:split){ + CompanyEntity companyEntity = new CompanyEntity(); + String oderTableField = companyEntity.getClass().getAnnotation(TableName.class).value(); + boolean descFlag = sidx.startsWith("-"); + String sidxField = descFlag ? sidx.substring(1) : sidx; + try{ + Field declaredField = companyEntity.getClass().getDeclaredField(sidxField); + declaredField.setAccessible(true); + sidxField = declaredField.getAnnotation(TableField.class).value(); + }catch (Exception e){ + } + String finalOderTableField = oderTableField; + String finalSidxField = sidxField; + Object select = wrapper.getSelectColumns().stream().filter(t -> Objects.equals(finalOderTableField, t.getTableAlias()) + && Objects.equals(finalSidxField, t.getColumn())).findFirst().orElse(null); + oderTableField = oderTableField + "." + sidxField; + if (select == null) { + wrapper.select(oderTableField); + } + if (descFlag) { + wrapper.orderByDesc(oderTableField); + } else { + wrapper.orderByAsc(oderTableField); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } + @Override + public CompanyEntity getInfo(String companyid){ + MPJLambdaWrapper wrapper = JoinWrappers + .lambda("mdm_company",CompanyEntity.class) + .selectCollection(CompanyBankEntity.class,CompanyEntity::getCompanyBank) + .leftJoin(CompanyBankEntity.class,"mdm_company_bank",CompanyBankEntity::getCompanyId,CompanyEntity::getCompanyId) + .selectCollection(CompanyInvoiceEntity.class,CompanyEntity::getCompanyInvoice) + .leftJoin(CompanyInvoiceEntity.class,"mdm_company_invoice",CompanyInvoiceEntity::getCompanyId,CompanyEntity::getCompanyId) + .selectAssociation(CustomerEntity.class,CompanyEntity::getCustomer) + .leftJoin(CustomerEntity.class,"mdm_customer",CustomerEntity::getCompanyId,CompanyEntity::getCompanyId) + .selectAll(CompanyEntity.class); + wrapper.and( + t->t.eq(CompanyEntity::getCompanyId, companyid ) + .or().eq(CompanyEntity::getFlowTaskId, companyid) + ); + return this.selectJoinOne(CompanyEntity.class,wrapper); + } + @Override + public void create(CompanyEntity entity){ + this.save(entity); + } + @Override + public boolean update(String companyid, CompanyEntity entity){ + return this.updateById(entity); + } + @Override + public void delete(CompanyEntity entity){ + if(entity!=null){ + this.removeById(entity.getCompanyId()); + } + } + /** 验证表单唯一字段,正则,非空 i-0新增-1修改*/ + @Override + public String checkForm(CustinfoForm form,int i) { + boolean isUp =StringUtil.isNotEmpty(form.getCompanyId()) && !form.getCompanyId().equals("0"); + Object id= null; + String countRecover = ""; + String fieldTipName = ""; + String canNotNull = I18nUtil.getMessageStr("sys.validate.textRequiredSuffix", "不能为空"); + String canNotRepeated = I18nUtil.getMessageStr("EXIST103", "不能重复"); + if (isUp){ + id = form.getCompanyId(); + } + //主表字段验证 + fieldTipName = "客户编码"; + fieldTipName = "客户名称"; + if(StringUtil.isEmpty(form.getCompanyName())){ + return fieldTipName + canNotNull; + } + if(StringUtil.isNotEmpty(form.getCompanyName())){ + form.setCompanyName(form.getCompanyName().trim()); + QueryWrapper company_nameWrapper=new QueryWrapper<>(); + company_nameWrapper.lambda().eq(CompanyEntity::getCompanyName,form.getCompanyName()); + company_nameWrapper.lambda().isNull(CompanyEntity::getFlowId); + if (isUp){ + company_nameWrapper.lambda().ne(CompanyEntity::getCompanyId, id); + } + if((int) this.count(company_nameWrapper)>0){ + countRecover = fieldTipName + canNotRepeated; + } + } + fieldTipName = "简称/昵称"; + fieldTipName = "类型"; + fieldTipName = "社会信用代码"; + if(StringUtil.isEmpty(form.getCreditCode())){ + return fieldTipName + canNotNull; + } + if(StringUtil.isNotEmpty(form.getCreditCode())){ + form.setCreditCode(form.getCreditCode().trim()); + QueryWrapper credit_codeWrapper=new QueryWrapper<>(); + credit_codeWrapper.lambda().eq(CompanyEntity::getCreditCode,form.getCreditCode()); + credit_codeWrapper.lambda().isNull(CompanyEntity::getFlowId); + if (isUp){ + credit_codeWrapper.lambda().ne(CompanyEntity::getCompanyId, id); + } + if((int) this.count(credit_codeWrapper)>0){ + countRecover = fieldTipName + canNotRepeated; + } + } + fieldTipName = "归属组织"; + fieldTipName = "所属地区"; + fieldTipName = "纳税人类别"; + fieldTipName = "企业规模"; + fieldTipName = "企业类型"; + fieldTipName = "行业代码"; + fieldTipName = "成立日期"; + fieldTipName = "注册资本"; + fieldTipName = "法定代表人"; + fieldTipName = "联系电话"; + if(StringUtil.isNotEmpty(form.getPhone())){ + if(!Pattern.compile("^1[3456789]\\d{9}$|^0\\d{2,3}-?\\d{7,8}$").matcher(String.valueOf(form.getPhone())).matches()){ + return I18nUtil.getMessageStr("sys.validate.telephone", "请输入正确的电话号码"); + } + } + fieldTipName = "邮箱"; + if(StringUtil.isNotEmpty(form.getEmail())){ + if(!Pattern.compile("^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$").matcher(String.valueOf(form.getEmail())).matches()){ + return I18nUtil.getMessageStr("sys.validate.email", "请输入正确的邮箱"); + } + } + fieldTipName = "网站"; + fieldTipName = "地址"; + fieldTipName = "经营范围"; + fieldTipName = "备注"; + //副表字段验证 + fieldTipName = "销售责任人"; + if( form.getYunzhupaas_customer_yunzhupaas_personId() == null ){ + return fieldTipName + canNotNull; + } + fieldTipName = "客户级别"; + fieldTipName = "客户来源"; + //子表字段验证 + if (form.getCompanyInvoiceList()!=null){ + + fieldTipName = "设计子表" + + "-" + "发票抬头编码"; + + + fieldTipName = "设计子表" + + "-" + "发票抬头名称"; + + + fieldTipName = "设计子表" + + "-" + "纳税人识别号"; + + + fieldTipName = "设计子表" + + "-" + "纳税人类别"; + + + fieldTipName = "设计子表" + + "-" + "地址"; + + + fieldTipName = "设计子表" + + "-" + "电话"; + + + fieldTipName = "设计子表" + + "-" + "开户银行"; + + + fieldTipName = "设计子表" + + "-" + "银行账户"; + + + fieldTipName = "设计子表" + + "-" + "是否默认"; + + + fieldTipName = "设计子表" + + "-" + "是否有效"; + + + fieldTipName = "设计子表" + + "-" + "备注"; + + } + if (form.getCompanyBankList()!=null){ + + fieldTipName = "设计子表" + + "-" + "开户行"; + + + fieldTipName = "设计子表" + + "-" + "账户名"; + + + fieldTipName = "设计子表" + + "-" + "银行账号"; + + + fieldTipName = "设计子表" + + "-" + "开户行城市"; + + + fieldTipName = "设计子表" + + "-" + "备注"; + + } + return countRecover; + } + /** + * 新增修改数据(事务回滚) + * @param id + * @param companyForm + * @return + */ + @Override + @Transactional + public void saveOrUpdate(CustinfoForm companyForm,String id, boolean isSave) throws Exception{ + UserInfo userInfo=userProvider.get(); + UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId()); + companyForm = JsonUtil.getJsonToBean( + generaterSwapUtil.swapDatetime(CustinfoConstant.getFormData(),companyForm,CustinfoConstant.TABLERENAMES),CustinfoForm.class); + CompanyEntity entity = JsonUtil.getJsonToBean(companyForm, CompanyEntity.class); + String mainUuid = StringUtil.isEmpty(id) ? RandomUtil.uuId() : id; + if(isSave){ + entity.setFlowTaskId(mainUuid); + entity.setCompanyCode(generaterSwapUtil.getBillNumber("companyCode", false)); + entity.setCompanyId(mainUuid); + } else { + if(StringUtil.isEmpty(entity.getCompanyCode()) ){ + entity.setCompanyCode(generaterSwapUtil.getBillNumber("companyCode", false)); + } + } + boolean b = this.saveOrUpdate(entity); + CompanyEntity info = this.getInfo(mainUuid); + if (info == null) throw new RuntimeException(MsgCode.FA001.get()); + + //CompanyInvoice子表数据新增修改 + QueryWrapper CompanyInvoicequeryWrapper = new QueryWrapper<>(); + CompanyInvoicequeryWrapper.lambda().eq(CompanyInvoiceEntity::getCompanyId, info.getCompanyId()); + if(!isSave && !CollectionUtils.isNotEmpty(companyForm.getCompanyInvoiceList())){ + companyInvoiceService.remove(CompanyInvoicequeryWrapper); + } + if (CollectionUtils.isNotEmpty(companyForm.getCompanyInvoiceList())){ + List tableField46dc53 = JsonUtil.getJsonToList(companyForm.getCompanyInvoiceList(),CompanyInvoiceEntity.class); + //移除的数据 + List childIds = tableField46dc53.stream().filter(t->t.getInvoiceId()!=null).map(CompanyInvoiceEntity::getInvoiceId).collect(Collectors.toList()); + if(CollectionUtils.isNotEmpty(childIds)){ + CompanyInvoicequeryWrapper.lambda().notIn(CompanyInvoiceEntity::getInvoiceId,childIds); + } + companyInvoiceService.remove(CompanyInvoicequeryWrapper); + for(CompanyInvoiceEntity entitys : tableField46dc53){ + entitys.setCompanyId(entity.getCompanyId()); + if(isSave || entitys.getInvoiceId()==null){ + entitys.setTitleCode(generaterSwapUtil.getBillNumber("InvoiceTitleCode", false)); + }else{ + if(StringUtil.isEmpty(entitys.getTitleCode()) || entitys.getInvoiceId() == null ){ + entitys.setTitleCode(generaterSwapUtil.getBillNumber("InvoiceTitleCode", false)); + } + } + if(entitys.getInvoiceId()==null){ + entitys.setInvoiceId(RandomUtil.uuId()); + } + companyInvoiceService.saveOrUpdate(entitys); + } + } + //CompanyBank子表数据新增修改 + QueryWrapper CompanyBankqueryWrapper = new QueryWrapper<>(); + CompanyBankqueryWrapper.lambda().eq(CompanyBankEntity::getCompanyId, info.getCompanyId()); + if(!isSave && !CollectionUtils.isNotEmpty(companyForm.getCompanyBankList())){ + companyBankService.remove(CompanyBankqueryWrapper); + } + if (CollectionUtils.isNotEmpty(companyForm.getCompanyBankList())){ + List tableFieldad9d92 = JsonUtil.getJsonToList(companyForm.getCompanyBankList(),CompanyBankEntity.class); + //移除的数据 + List childIds = tableFieldad9d92.stream().filter(t->t.getBankId()!=null).map(CompanyBankEntity::getBankId).collect(Collectors.toList()); + if(CollectionUtils.isNotEmpty(childIds)){ + CompanyBankqueryWrapper.lambda().notIn(CompanyBankEntity::getBankId,childIds); + } + companyBankService.remove(CompanyBankqueryWrapper); + for(CompanyBankEntity entitys : tableFieldad9d92){ + entitys.setCompanyId(entity.getCompanyId()); + if(entitys.getBankId()==null){ + entitys.setBankId(RandomUtil.uuId()); + } + companyBankService.saveOrUpdate(entitys); + } + } + //mdm_customer副表数据新增修改 + Map CustomerMap = generaterSwapUtil.getMastTabelData(companyForm,"mdm_customer"); + CustomerEntity customerentity = JsonUtil.getJsonToBean(CustomerMap,CustomerEntity.class); + //自动生成的字段 + if(isSave){ + customerentity.setCustomerId(RandomUtil.uuId()); + customerentity.setCompanyId(entity.getCompanyId()); + }else{ + QueryWrapper queryWrapperCustomer =new QueryWrapper<>(); + queryWrapperCustomer.lambda().eq(CustomerEntity::getCompanyId,info.getCompanyId()); + CustomerEntity customerOneEntity= customerService.getOne(queryWrapperCustomer); + customerentity.setCustomerId(customerOneEntity.getCustomerId()); + customerentity.setCompanyId(entity.getCompanyId()); + } + + customerService.saveOrUpdate(customerentity); + } +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/CustomersServiceImpl.java b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/CustomersServiceImpl.java new file mode 100644 index 0000000..c2b5c10 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/CustomersServiceImpl.java @@ -0,0 +1,34 @@ + +package com.yunzhupaas.mdm.service.impl; + +import com.yunzhupaas.mdm.entity.*; +import com.yunzhupaas.mdm.mapper.CustomersMapper; +import com.yunzhupaas.mdm.service.*; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yunzhupaas.mdm.model.custinfo.*; +import org.springframework.stereotype.Service; +import com.yunzhupaas.base.service.SuperServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import com.yunzhupaas.util.GeneraterSwapUtil; +import java.sql.Connection; +import java.sql.SQLException; +import lombok.Cleanup; +import com.yunzhupaas.database.plugins.DynamicSourceGeneratorInterface; +import com.yunzhupaas.database.util.DynamicDataSourceUtil; +import org.apache.commons.collections4.CollectionUtils; +import com.yunzhupaas.i18n.util.I18nUtil; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.constant.MsgCode; +/** + * + * 客户信息 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-24 + */ +@Service +public class CustomersServiceImpl extends SuperServiceImpl implements CustomerService{ + @Autowired + private GeneraterSwapUtil generaterSwapUtil; +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/LcpServiceImpl.java b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/LcpServiceImpl.java new file mode 100644 index 0000000..064c3f4 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/LcpServiceImpl.java @@ -0,0 +1,515 @@ + +package com.yunzhupaas.mdm.service.impl; + +import com.yunzhupaas.mdm.entity.*; +import com.yunzhupaas.mdm.mapper.CompanyMapper; +import com.yunzhupaas.mdm.model.companyInvoice.CompanyInvoiceModel; +import com.yunzhupaas.mdm.service.*; +import com.yunzhupaas.mdm.model.lpc.*; +import org.springframework.stereotype.Service; +import com.yunzhupaas.base.service.SuperServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import com.yunzhupaas.util.GeneraterSwapUtil; +import java.sql.Connection; +import java.sql.SQLException; +import lombok.Cleanup; +import com.yunzhupaas.database.util.DynamicDataSourceUtil; +import org.apache.commons.collections4.CollectionUtils; +import com.yunzhupaas.i18n.util.I18nUtil; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.constant.MsgCode; +import cn.hutool.core.util.ObjectUtil; +import java.lang.reflect.Field; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.util.stream.Collectors; +import com.yunzhupaas.base.model.ColumnDataModel; +import org.springframework.transaction.annotation.Transactional; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.github.yulichang.toolkit.JoinWrappers; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.yunzhupaas.model.QueryAllModel; +import com.yunzhupaas.util.*; +import java.util.*; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.permission.entity.UserEntity; +import com.github.pagehelper.PageHelper; +/** + * + * 法人公司 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-24 + */ +@Service +public class LcpServiceImpl extends SuperServiceImpl implements LpcService{ + @Autowired + private GeneraterSwapUtil generaterSwapUtil; + @Autowired + private UserProvider userProvider; + @Autowired + private CorporationService corporationService; + @Autowired + private CompanyInvoiceService companyInvoiceService; + @Autowired + private CompanyBankService companyBankService; + @Override + public List getList(LpcPagination companyPagination){ + return getTypeList(companyPagination,companyPagination.getDataType()); + } + /** 列表查询 */ + @Override + public List getTypeList(LpcPagination companyPagination,String dataType){ + String userId=userProvider.get().getUserId(); + Map tableClassMap=new HashMap<>(); + tableClassMap.put("mdm_company",CompanyEntity.class); + tableClassMap.put("mdm_corporation",CorporationEntity.class); + tableClassMap.put("mdm_company_bank",CompanyBankEntity.class); + tableClassMap.put("mdm_companyInvoice",CompanyInvoiceEntity.class); + + MPJLambdaWrapper wrapper = JoinWrappers + .lambda("mdm_company",CompanyEntity.class) + .selectAssociation(CorporationEntity.class,CompanyEntity::getCorporation) + .leftJoin(CorporationEntity.class,"mdm_corporation",CorporationEntity::getCompanyId,CompanyEntity::getCompanyId) + .selectCollection(CompanyBankEntity.class,CompanyEntity::getCompanyBank) + .leftJoin(CompanyBankEntity.class,"mdm_company_bank",CompanyBankEntity::getCompanyId,CompanyEntity::getCompanyId) + .selectCollection(CompanyInvoiceEntity.class,CompanyEntity::getCompanyInvoice) + .leftJoin(CompanyInvoiceEntity.class,"mdm_companyInvoice",CompanyInvoiceEntity::getCompanyId,CompanyEntity::getCompanyId) + .selectAll(CompanyEntity.class); + MPJLambdaWrapper wrapper2 = JoinWrappers + .lambda("mdm_company",CompanyEntity.class) + .leftJoin(CorporationEntity.class,"mdm_corporation",CorporationEntity::getCompanyId,CompanyEntity::getCompanyId) + .leftJoin(CompanyBankEntity.class,"mdm_company_bank",CompanyBankEntity::getCompanyId,CompanyEntity::getCompanyId) + .leftJoin(CompanyInvoiceEntity.class,"mdm_companyInvoice",CompanyInvoiceEntity::getCompanyId,CompanyEntity::getCompanyId) + .distinct().select(CompanyEntity::getCompanyId); + + QueryAllModel queryAllModel = new QueryAllModel(); + queryAllModel.setWrapper(wrapper); + queryAllModel.setClassMap(tableClassMap); + queryAllModel.setDbLink(LpcConstant.DBLINKID); + //数据过滤 + boolean isPc = ServletUtil.getHeader("yunzhupaas-origin").equals("pc"); + String columnData = !isPc ? LpcConstant.getAppColumnData() : LpcConstant.getColumnData(); + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class); + String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList()); + queryAllModel.setRuleJson(ruleJson); + //高级查询 + boolean hasSuperQuery = true; + if (hasSuperQuery) { + queryAllModel.setSuperJson(companyPagination.getSuperQueryJson()); + } + //数据权限 + boolean pcPermission = true; + boolean appPermission = false; + if (isPc && pcPermission) { + queryAllModel.setModuleId(companyPagination.getMenuId()); + } + if (!isPc && appPermission) { + queryAllModel.setModuleId(companyPagination.getMenuId()); + } + //拼接复杂条件 + wrapper = generaterSwapUtil.getConditionAllTable(queryAllModel); + if(wrapper == null) return new ArrayList<>(); + queryAllModel.setWrapper(wrapper2); + wrapper2 = generaterSwapUtil.getConditionAllTable(queryAllModel); + //其他条件拼接 + otherConditions(companyPagination, wrapper, isPc); + otherConditions(companyPagination, wrapper2, isPc); + + if("0".equals(dataType)){ + com.github.pagehelper.Page objects = PageHelper.startPage((int) companyPagination.getCurrentPage(), (int) companyPagination.getPageSize(), true); + List userIPage = this.selectJoinList(CompanyEntity.class, wrapper2); + List collect = userIPage.stream().map(t -> t.getCompanyId()).collect(Collectors.toList()); + if(CollectionUtils.isNotEmpty(collect)){ + wrapper.in(CompanyEntity::getCompanyId,collect); + } + List result = this.selectJoinList(CompanyEntity.class, wrapper); + return companyPagination.setData(result,objects.getTotal()); + }else{ + List list = this.selectJoinList(CompanyEntity.class, wrapper); + if("2".equals(dataType)){ + List selectIds = Arrays.asList(companyPagination.getSelectIds()); + return list.stream().filter(t -> selectIds.contains(t.getCompanyId())).collect(Collectors.toList()); + }else{ + return list; + } + } + + } + + /** + * 其他条件拼接 + */ + private void otherConditions(LpcPagination companyPagination, MPJLambdaWrapper wrapper, boolean isPc) { + String databaseName; + try { + @Cleanup Connection cnn = DynamicDataSourceUtil.getCurrentConnection(); + databaseName = cnn.getMetaData().getDatabaseProductName().trim(); + } catch (SQLException e) { + throw new DataException(e.getMessage()); + } + //假删除标志 + wrapper.isNull(CompanyEntity::getDeleteMark); + + wrapper.isNull(CompanyEntity::getFlowId); + //关键词 + if(ObjectUtil.isNotEmpty(companyPagination.getYunzhupaasKeyword())){ + } + //普通查询 + if(isPc){ + if(ObjectUtil.isNotEmpty(companyPagination.getOrgId())){ + List idList = new ArrayList<>(); + try { + String[][] orgId = JsonUtil.getJsonToBean(companyPagination.getOrgId(),String[][].class); + for(int i=0;i0){ + idList.add(JsonUtil.getObjectToString(Arrays.asList(orgId[i]))); + } + } + }catch (Exception e1){ + try { + List orgId = JsonUtil.getJsonToList(companyPagination.getOrgId(),String.class); + if(orgId.size()>0){ + idList.add(JsonUtil.getObjectToString(orgId)); + } + }catch (Exception e2){ + idList.add(String.valueOf(companyPagination.getOrgId())); + } + } + wrapper.and(t->{ + idList.forEach(tt->{ + if(StringUtil.isNotEmpty(tt) && "Microsoft SQL Server".equalsIgnoreCase(databaseName)){ + tt = tt.replaceFirst("\\[","[[]"); + } + t.like(CompanyEntity::getOrgId, tt).or(); + }); + }); + } + + if(ObjectUtil.isNotEmpty(companyPagination.getCompanyName())){ + String value = companyPagination.getCompanyName() instanceof List ? + JsonUtil.getObjectToString(companyPagination.getCompanyName()) : + String.valueOf(companyPagination.getCompanyName()); + wrapper.like(CompanyEntity::getCompanyName,value); + } + + } + //排序 + if(StringUtil.isEmpty(companyPagination.getSidx())){ + wrapper.orderByDesc(CompanyEntity::getCompanyId); + }else{ + try { + String[] split = companyPagination.getSidx().split(","); + for(String sidx:split){ + CompanyEntity companyEntity = new CompanyEntity(); + String oderTableField = companyEntity.getClass().getAnnotation(TableName.class).value(); + boolean descFlag = sidx.startsWith("-"); + String sidxField = descFlag ? sidx.substring(1) : sidx; + try{ + Field declaredField = companyEntity.getClass().getDeclaredField(sidxField); + declaredField.setAccessible(true); + sidxField = declaredField.getAnnotation(TableField.class).value(); + }catch (Exception e){ + } + String finalOderTableField = oderTableField; + String finalSidxField = sidxField; + Object select = wrapper.getSelectColumns().stream().filter(t -> Objects.equals(finalOderTableField, t.getTableAlias()) + && Objects.equals(finalSidxField, t.getColumn())).findFirst().orElse(null); + oderTableField = oderTableField + "." + sidxField; + if (select == null) { + wrapper.select(oderTableField); + } + if (descFlag) { + wrapper.orderByDesc(oderTableField); + } else { + wrapper.orderByAsc(oderTableField); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } + @Override + public CompanyEntity getInfo(String companyid){ + MPJLambdaWrapper wrapper = JoinWrappers + .lambda("mdm_company",CompanyEntity.class) + .selectAssociation(CorporationEntity.class,CompanyEntity::getCorporation) + .leftJoin(CorporationEntity.class,"mdm_corporation",CorporationEntity::getCompanyId,CompanyEntity::getCompanyId) + .selectCollection(CompanyBankEntity.class,CompanyEntity::getCompanyBank) + .leftJoin(CompanyBankEntity.class,"mdm_company_bank",CompanyBankEntity::getCompanyId,CompanyEntity::getCompanyId) + .selectCollection(CompanyInvoiceEntity.class,CompanyEntity::getCompanyInvoice) + .leftJoin(CompanyInvoiceEntity.class,"mdm_companyInvoice",CompanyInvoiceEntity::getCompanyId,CompanyEntity::getCompanyId) + .selectAll(CompanyEntity.class); + wrapper.and( + t->t.eq(CompanyEntity::getCompanyId, companyid ) + .or().eq(CompanyEntity::getFlowTaskId, companyid) + ); + return this.selectJoinOne(CompanyEntity.class,wrapper); + } + @Override + public void create(CompanyEntity entity){ + this.save(entity); + } + @Override + public boolean update(String companyid, CompanyEntity entity){ + return this.updateById(entity); + } + @Override + public void delete(CompanyEntity entity){ + if(entity!=null){ + this.removeById(entity.getCompanyId()); + } + } + /** 验证表单唯一字段,正则,非空 i-0新增-1修改*/ + @Override + public String checkForm(LpcForm form,int i) { + boolean isUp =StringUtil.isNotEmpty(form.getCompanyId()) && !form.getCompanyId().equals("0"); + Object id= null; + String countRecover = ""; + String fieldTipName = ""; + String canNotNull = I18nUtil.getMessageStr("sys.validate.textRequiredSuffix", "不能为空"); + String canNotRepeated = I18nUtil.getMessageStr("EXIST103", "不能重复"); + if (isUp){ + id = form.getCompanyId(); + } + //主表字段验证 + fieldTipName = "实体类型"; + fieldTipName = "企业编码"; + fieldTipName = "企业名称"; + if(StringUtil.isEmpty(form.getCompanyName())){ + return fieldTipName + canNotNull; + } + fieldTipName = "简称/昵称"; + fieldTipName = "社会信用代码"; + if(StringUtil.isEmpty(form.getCreditCode())){ + return fieldTipName + canNotNull; + } + if(StringUtil.isNotEmpty(form.getCreditCode())){ + form.setCreditCode(form.getCreditCode().trim()); + QueryWrapper credit_codeWrapper=new QueryWrapper<>(); + credit_codeWrapper.lambda().eq(CompanyEntity::getCreditCode,form.getCreditCode()); + credit_codeWrapper.lambda().isNull(CompanyEntity::getFlowId); + //假删除标志 + credit_codeWrapper.lambda().isNull(CompanyEntity::getDeleteMark); + if (isUp){ + credit_codeWrapper.lambda().ne(CompanyEntity::getCompanyId, id); + } + if((int) this.count(credit_codeWrapper)>0){ + countRecover = fieldTipName + canNotRepeated; + } + } + fieldTipName = "纳税人类别"; + fieldTipName = "归属组织"; + fieldTipName = "所属地区"; + fieldTipName = "企业类型"; + fieldTipName = "行业代码"; + fieldTipName = "企业规模"; + fieldTipName = "成立日期"; + fieldTipName = "注册资本"; + fieldTipName = "法定代表人"; + fieldTipName = "联系电话"; + fieldTipName = "邮箱"; + fieldTipName = "网站"; + fieldTipName = "地址"; + fieldTipName = "经营范围"; + fieldTipName = "备注"; + //副表字段验证 + fieldTipName = "负责人"; + if( form.getYunzhupaas_corporation_yunzhupaas_majorPersonId() == null ){ + return fieldTipName + canNotNull; + } + //子表字段验证 + if (form.getCompanyInvoiceList()!=null){ + + fieldTipName = "设计子表" + + "-" + "发票抬头编码"; + + + fieldTipName = "设计子表" + + "-" + "发票抬头名称"; + + for(CompanyInvoiceModel t : form.getCompanyInvoiceList()){ + if( StringUtil.isNotEmpty(t.getTitleName()) ){ + t.setTitleName(t.getTitleName().trim()); + } + else{ + return fieldTipName + canNotNull; + } + } + + fieldTipName = "设计子表" + + "-" + "纳税人识别号"; + + for(CompanyInvoiceModel t : form.getCompanyInvoiceList()){ + if( StringUtil.isNotEmpty(t.getCreditCode()) ){ + t.setCreditCode(t.getCreditCode().trim()); + } + else{ + return fieldTipName + canNotNull; + } + } + + fieldTipName = "设计子表" + + "-" + "纳税人类别"; + + for(CompanyInvoiceModel t : form.getCompanyInvoiceList()){ + if( t.getTaxType() != null ){ + t.setTaxType(t.getTaxType()); + } + else{ + return fieldTipName + canNotNull; + } + } + + fieldTipName = "设计子表" + + "-" + "地址"; + + + fieldTipName = "设计子表" + + "-" + "电话"; + + + fieldTipName = "设计子表" + + "-" + "开户银行"; + + + fieldTipName = "设计子表" + + "-" + "银行账户"; + + + fieldTipName = "设计子表" + + "-" + "是否默认抬头"; + + + fieldTipName = "设计子表" + + "-" + "是否有效"; + + + fieldTipName = "设计子表" + + "-" + "备注"; + + } + if (form.getCompanyBankList()!=null){ + + fieldTipName = "设计子表" + + "-" + "开户行"; + + + fieldTipName = "设计子表" + + "-" + "账户名"; + + + fieldTipName = "设计子表" + + "-" + "银行账号"; + + + fieldTipName = "设计子表" + + "-" + "开户行城市"; + + + fieldTipName = "设计子表" + + "-" + "备注"; + + } + return countRecover; + } + /** + * 新增修改数据(事务回滚) + * @param id + * @param companyForm + * @return + */ + @Override + @Transactional + public void saveOrUpdate(LpcForm companyForm,String id, boolean isSave) throws Exception{ + UserInfo userInfo=userProvider.get(); + UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId()); + companyForm = JsonUtil.getJsonToBean( + generaterSwapUtil.swapDatetime(LpcConstant.getFormData(),companyForm,LpcConstant.TABLERENAMES),LpcForm.class); + CompanyEntity entity = JsonUtil.getJsonToBean(companyForm, CompanyEntity.class); + String mainUuid = StringUtil.isEmpty(id) ? RandomUtil.uuId() : id; + if(isSave){ + entity.setFlowTaskId(mainUuid); + entity.setCompanyCode(generaterSwapUtil.getBillNumber("companyCode", false)); + entity.setCompanyId(mainUuid); + } else { + if(StringUtil.isEmpty(entity.getCompanyCode()) ){ + entity.setCompanyCode(generaterSwapUtil.getBillNumber("companyCode", false)); + } + } + boolean b = this.saveOrUpdate(entity); + CompanyEntity info = this.getInfo(mainUuid); + if (info == null) throw new RuntimeException(MsgCode.FA001.get()); + + //CompanyInvoice子表数据新增修改 + QueryWrapper CompanyInvoicequeryWrapper = new QueryWrapper<>(); + CompanyInvoicequeryWrapper.lambda().eq(CompanyInvoiceEntity::getCompanyId, info.getCompanyId()); + if(!isSave && !CollectionUtils.isNotEmpty(companyForm.getCompanyInvoiceList())){ + companyInvoiceService.remove(CompanyInvoicequeryWrapper); + } + if (CollectionUtils.isNotEmpty(companyForm.getCompanyInvoiceList())){ + List tableField5ced3a = JsonUtil.getJsonToList(companyForm.getCompanyInvoiceList(),CompanyInvoiceEntity.class); + //移除的数据 + List childIds = tableField5ced3a.stream().filter(t->t.getInvoiceId()!=null).map(CompanyInvoiceEntity::getInvoiceId).collect(Collectors.toList()); + if(CollectionUtils.isNotEmpty(childIds)){ + CompanyInvoicequeryWrapper.lambda().notIn(CompanyInvoiceEntity::getInvoiceId,childIds); + } + companyInvoiceService.remove(CompanyInvoicequeryWrapper); + for(CompanyInvoiceEntity entitys : tableField5ced3a){ + entitys.setCompanyId(entity.getCompanyId()); + if(isSave || entitys.getInvoiceId()==null){ + entitys.setTitleCode(generaterSwapUtil.getBillNumber("InvoiceTitleCode", false)); + }else{ + if(StringUtil.isEmpty(entitys.getTitleCode()) || entitys.getInvoiceId() == null ){ + entitys.setTitleCode(generaterSwapUtil.getBillNumber("InvoiceTitleCode", false)); + } + } + if(entitys.getInvoiceId()==null){ + entitys.setInvoiceId(RandomUtil.uuId()); + } + companyInvoiceService.saveOrUpdate(entitys); + } + } + //CompanyBank子表数据新增修改 + QueryWrapper CompanyBankqueryWrapper = new QueryWrapper<>(); + CompanyBankqueryWrapper.lambda().eq(CompanyBankEntity::getCompanyId, info.getCompanyId()); + if(!isSave && !CollectionUtils.isNotEmpty(companyForm.getCompanyBankList())){ + companyBankService.remove(CompanyBankqueryWrapper); + } + if (CollectionUtils.isNotEmpty(companyForm.getCompanyBankList())){ + List tableFieldbd0aa4 = JsonUtil.getJsonToList(companyForm.getCompanyBankList(),CompanyBankEntity.class); + //移除的数据 + List childIds = tableFieldbd0aa4.stream().filter(t->t.getBankId()!=null).map(CompanyBankEntity::getBankId).collect(Collectors.toList()); + if(CollectionUtils.isNotEmpty(childIds)){ + CompanyBankqueryWrapper.lambda().notIn(CompanyBankEntity::getBankId,childIds); + } + companyBankService.remove(CompanyBankqueryWrapper); + for(CompanyBankEntity entitys : tableFieldbd0aa4){ + entitys.setCompanyId(entity.getCompanyId()); + if(entitys.getBankId()==null){ + entitys.setBankId(RandomUtil.uuId()); + } + companyBankService.saveOrUpdate(entitys); + } + } + //mdm_corporation副表数据新增修改 + Map CorporationMap = generaterSwapUtil.getMastTabelData(companyForm,"mdm_corporation"); + CorporationEntity corporationentity = JsonUtil.getJsonToBean(CorporationMap,CorporationEntity.class); + //自动生成的字段 + if(isSave){ + corporationentity.setCorporationId(RandomUtil.uuId()); + corporationentity.setCompanyId(entity.getCompanyId()); + }else{ + QueryWrapper queryWrapperCorporation =new QueryWrapper<>(); + queryWrapperCorporation.lambda().eq(CorporationEntity::getCompanyId,info.getCompanyId()); + CorporationEntity corporationOneEntity= corporationService.getOne(queryWrapperCorporation); + corporationentity.setCorporationId(corporationOneEntity.getCorporationId()); + corporationentity.setCompanyId(entity.getCompanyId()); + } + + corporationService.saveOrUpdate(corporationentity); + } +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/MaterialServiceImpl.java b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/MaterialServiceImpl.java new file mode 100644 index 0000000..c0b3fd6 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/MaterialServiceImpl.java @@ -0,0 +1,336 @@ + +package com.yunzhupaas.mdm.service.impl; + +import com.yunzhupaas.mdm.entity.*; +import com.yunzhupaas.mdm.mapper.MaterialMapper; +import com.yunzhupaas.mdm.service.*; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yunzhupaas.mdm.model.material.*; +import org.springframework.stereotype.Service; +import com.yunzhupaas.base.service.SuperServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import com.yunzhupaas.util.GeneraterSwapUtil; +import java.sql.Connection; +import java.sql.SQLException; +import lombok.Cleanup; +import com.yunzhupaas.database.plugins.DynamicSourceGeneratorInterface; +import com.yunzhupaas.database.util.DynamicDataSourceUtil; +import org.apache.commons.collections4.CollectionUtils; +import com.yunzhupaas.i18n.util.I18nUtil; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.constant.MsgCode; +import java.math.BigDecimal; +import cn.hutool.core.util.ObjectUtil; +import java.lang.reflect.Field; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import java.util.regex.Pattern; +import java.util.stream.Collectors; +import com.yunzhupaas.base.model.ColumnDataModel; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.transaction.annotation.Transactional; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.github.yulichang.toolkit.JoinWrappers; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.yunzhupaas.model.QueryAllModel; +import java.text.SimpleDateFormat; +import com.yunzhupaas.util.*; +import java.util.*; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.permission.entity.UserEntity; +import com.github.pagehelper.PageHelper; +/** + * + * 物料信息 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-27 + */ +@Service +public class MaterialServiceImpl extends SuperServiceImpl implements MaterialService{ + @Autowired + private GeneraterSwapUtil generaterSwapUtil; + @Autowired + private UserProvider userProvider; + @Override + public List getList(MaterialPagination materialPagination){ + return getTypeList(materialPagination,materialPagination.getDataType()); + } + /** 列表查询 */ + @Override + public List getTypeList(MaterialPagination materialPagination,String dataType){ + String userId=userProvider.get().getUserId(); + Map tableClassMap=new HashMap<>(); + tableClassMap.put("mdm_material",MaterialEntity.class); + + MPJLambdaWrapper wrapper = JoinWrappers + .lambda("mdm_material",MaterialEntity.class) + .selectAll(MaterialEntity.class); + MPJLambdaWrapper wrapper2 = JoinWrappers + .lambda("mdm_material",MaterialEntity.class) + .distinct().select(MaterialEntity::getMaterialId); + + QueryAllModel queryAllModel = new QueryAllModel(); + queryAllModel.setWrapper(wrapper); + queryAllModel.setClassMap(tableClassMap); + queryAllModel.setDbLink(MaterialConstant.DBLINKID); + //数据过滤 + boolean isPc = ServletUtil.getHeader("yunzhupaas-origin").equals("pc"); + String columnData = !isPc ? MaterialConstant.getAppColumnData() : MaterialConstant.getColumnData(); + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class); + String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList()); + queryAllModel.setRuleJson(ruleJson); + //高级查询 + boolean hasSuperQuery = true; + if (hasSuperQuery) { + queryAllModel.setSuperJson(materialPagination.getSuperQueryJson()); + } + //数据权限 + boolean pcPermission = false; + boolean appPermission = false; + if (isPc && pcPermission) { + queryAllModel.setModuleId(materialPagination.getMenuId()); + } + if (!isPc && appPermission) { + queryAllModel.setModuleId(materialPagination.getMenuId()); + } + //拼接复杂条件 + wrapper = generaterSwapUtil.getConditionAllTable(queryAllModel); + if(wrapper == null) return new ArrayList<>(); + queryAllModel.setWrapper(wrapper2); + wrapper2 = generaterSwapUtil.getConditionAllTable(queryAllModel); + //其他条件拼接 + otherConditions(materialPagination, wrapper, isPc); + otherConditions(materialPagination, wrapper2, isPc); + + if("0".equals(dataType)){ + com.github.pagehelper.Page objects = PageHelper.startPage((int) materialPagination.getCurrentPage(), (int) materialPagination.getPageSize(), true); + List userIPage = this.selectJoinList(MaterialEntity.class, wrapper2); + List collect = userIPage.stream().map(t -> t.getMaterialId()).collect(Collectors.toList()); + if(CollectionUtils.isNotEmpty(collect)){ + wrapper.in(MaterialEntity::getMaterialId,collect); + } + List result = this.selectJoinList(MaterialEntity.class, wrapper); + return materialPagination.setData(result,objects.getTotal()); + }else{ + List list = this.selectJoinList(MaterialEntity.class, wrapper); + if("2".equals(dataType)){ + List selectIds = Arrays.asList(materialPagination.getSelectIds()); + return list.stream().filter(t -> selectIds.contains(t.getMaterialId())).collect(Collectors.toList()); + }else{ + return list; + } + } + + } + + /** + * 其他条件拼接 + */ + private void otherConditions(MaterialPagination materialPagination, MPJLambdaWrapper wrapper, boolean isPc) { + String databaseName; + try { + @Cleanup Connection cnn = DynamicDataSourceUtil.getCurrentConnection(); + databaseName = cnn.getMetaData().getDatabaseProductName().trim(); + } catch (SQLException e) { + throw new DataException(e.getMessage()); + } + //假删除标志 + wrapper.isNull(MaterialEntity::getDeleteMark); + + wrapper.isNull(MaterialEntity::getFlowId); + //关键词 + if(ObjectUtil.isNotEmpty(materialPagination.getYunzhupaasKeyword())){ + } + //普通查询 + if(isPc){ + if(ObjectUtil.isNotEmpty(materialPagination.getMaterialName())){ + String value = materialPagination.getMaterialName() instanceof List ? + JsonUtil.getObjectToString(materialPagination.getMaterialName()) : + String.valueOf(materialPagination.getMaterialName()); + wrapper.like(MaterialEntity::getMaterialName,value); + } + + if(ObjectUtil.isNotEmpty(materialPagination.getMaterialModel())){ + String value = materialPagination.getMaterialModel() instanceof List ? + JsonUtil.getObjectToString(materialPagination.getMaterialModel()) : + String.valueOf(materialPagination.getMaterialModel()); + wrapper.like(MaterialEntity::getMaterialModel,value); + } + + if(ObjectUtil.isNotEmpty(materialPagination.getMaterialCategory())){ + String value = materialPagination.getMaterialCategory() instanceof List ? + JsonUtil.getObjectToString(materialPagination.getMaterialCategory()) : + String.valueOf(materialPagination.getMaterialCategory()); + wrapper.like(MaterialEntity::getMaterialCategory,value); + } + + } + //排序 + if(StringUtil.isEmpty(materialPagination.getSidx())){ + wrapper.orderByDesc(MaterialEntity::getMaterialId); + }else{ + try { + String[] split = materialPagination.getSidx().split(","); + for(String sidx:split){ + MaterialEntity materialEntity = new MaterialEntity(); + String oderTableField = materialEntity.getClass().getAnnotation(TableName.class).value(); + boolean descFlag = sidx.startsWith("-"); + String sidxField = descFlag ? sidx.substring(1) : sidx; + try{ + Field declaredField = materialEntity.getClass().getDeclaredField(sidxField); + declaredField.setAccessible(true); + sidxField = declaredField.getAnnotation(TableField.class).value(); + }catch (Exception e){ + } + String finalOderTableField = oderTableField; + String finalSidxField = sidxField; + Object select = wrapper.getSelectColumns().stream().filter(t -> Objects.equals(finalOderTableField, t.getTableAlias()) + && Objects.equals(finalSidxField, t.getColumn())).findFirst().orElse(null); + oderTableField = oderTableField + "." + sidxField; + if (select == null) { + wrapper.select(oderTableField); + } + if (descFlag) { + wrapper.orderByDesc(oderTableField); + } else { + wrapper.orderByAsc(oderTableField); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } + @Override + public MaterialEntity getInfo(String materialid){ + MPJLambdaWrapper wrapper = JoinWrappers + .lambda("mdm_material",MaterialEntity.class) + .selectAll(MaterialEntity.class); + wrapper.and( + t->t.eq(MaterialEntity::getMaterialId, materialid ) + .or().eq(MaterialEntity::getFlowTaskId, materialid) + ); + return this.selectJoinOne(MaterialEntity.class,wrapper); + } + @Override + public void create(MaterialEntity entity){ + this.save(entity); + } + @Override + public boolean update(String materialid, MaterialEntity entity){ + return this.updateById(entity); + } + @Override + public void delete(MaterialEntity entity){ + if(entity!=null){ + this.removeById(entity.getMaterialId()); + } + } + /** 验证表单唯一字段,正则,非空 i-0新增-1修改*/ + @Override + public String checkForm(MaterialForm form,int i) { + boolean isUp =StringUtil.isNotEmpty(form.getMaterialId()) && !form.getMaterialId().equals("0"); + Object id= null; + String countRecover = ""; + String fieldTipName = ""; + String canNotNull = I18nUtil.getMessageStr("sys.validate.textRequiredSuffix", "不能为空"); + String canNotRepeated = I18nUtil.getMessageStr("EXIST103", "不能重复"); + if (isUp){ + id = form.getMaterialId(); + } + //验证业务主键 + String businessErr = checkBusinessKey(form, isUp ? id : null, null); + if (StringUtil.isNotEmpty(businessErr)) { + return businessErr; + } + //主表字段验证 + fieldTipName = "物料编码"; + fieldTipName = "物料名称"; + fieldTipName = "物料分类"; + fieldTipName = "规格型号"; + fieldTipName = "单位名称"; + fieldTipName = "品牌"; + fieldTipName = "税率"; + fieldTipName = "税收分类"; + fieldTipName = "材质/纹理"; + fieldTipName = "质量标准"; + fieldTipName = "技术标准"; + fieldTipName = "验收标准"; + fieldTipName = "交付要求"; + fieldTipName = "储存条件"; + return countRecover; + } + /** + * 验证业务主键 + */ + private String checkBusinessKey(MaterialForm form, Object id, List flowIds){ + QueryWrapper wrapper = new QueryWrapper<>(); + //修改 + if (id != null){ + wrapper.lambda().ne(MaterialEntity::getMaterialId, id); + } + //是否流程 + if(flowIds == null){ + wrapper.lambda().isNull(MaterialEntity::getFlowId); + }else{ + wrapper.lambda().in(MaterialEntity::getFlowId, flowIds); + } + //假删除标志 + wrapper.lambda().isNull(MaterialEntity::getDeleteMark); + //物料名称字段判断 + if(form.getMaterialName() == null || form.getMaterialName().toString().trim().isEmpty()){ + wrapper.lambda().isNull(MaterialEntity::getMaterialName); + }else{ + wrapper.lambda().eq(MaterialEntity::getMaterialName, form.getMaterialName()); + } + //物料分类字段判断 + if(form.getMaterialCategory() == null || form.getMaterialCategory().toString().trim().isEmpty() + ||(form.getMaterialCategory() instanceof List && ((List) form.getMaterialCategory()).size() == 0)){ + wrapper.lambda().isNull(MaterialEntity::getMaterialCategory); + }else{ + Object obj = form.getMaterialCategory() instanceof List ?JsonUtil.getObjectToString(form.getMaterialCategory()):form.getMaterialCategory(); + wrapper.lambda().eq(MaterialEntity::getMaterialCategory, obj); + } + if((int) this.count(wrapper)>0){ + return "该物料分类下,该物料名称数据已存在,请勿重复提交!"; + } + return ""; + } + /** + * 新增修改数据(事务回滚) + * @param id + * @param materialForm + * @return + */ + @Override + @Transactional + public void saveOrUpdate(MaterialForm materialForm,String id, boolean isSave) throws Exception{ + UserInfo userInfo=userProvider.get(); + UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId()); + materialForm = JsonUtil.getJsonToBean( + generaterSwapUtil.swapDatetime(MaterialConstant.getFormData(),materialForm,MaterialConstant.TABLERENAMES),MaterialForm.class); + MaterialEntity entity = JsonUtil.getJsonToBean(materialForm, MaterialEntity.class); + String mainUuid = StringUtil.isEmpty(id) ? RandomUtil.uuId() : id; + if(isSave){ + entity.setFlowTaskId(mainUuid); + entity.setMaterialCode(generaterSwapUtil.getBillNumber("materialCode", false)); + entity.setMaterialId(mainUuid); + entity.setVersion(0); + } else { + if(StringUtil.isEmpty(entity.getMaterialCode()) ){ + entity.setMaterialCode(generaterSwapUtil.getBillNumber("materialCode", false)); + } + } + boolean b = this.saveOrUpdate(entity); + if(!b){ + throw new DataException("当前表单原数据已被调整,请重新进入该页面编辑并提交数据"); + } + MaterialEntity info = this.getInfo(mainUuid); + if (info == null) throw new RuntimeException(MsgCode.FA001.get()); + + } +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/PanyInvoiceServiceImpl.java b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/PanyInvoiceServiceImpl.java new file mode 100644 index 0000000..7b18bb0 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/PanyInvoiceServiceImpl.java @@ -0,0 +1,24 @@ + +package com.yunzhupaas.mdm.service.impl; + +import com.yunzhupaas.mdm.entity.*; +import com.yunzhupaas.mdm.mapper.PanyInvoiceMapper; +import com.yunzhupaas.mdm.service.*; +import org.springframework.stereotype.Service; +import com.yunzhupaas.base.service.SuperServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import com.yunzhupaas.util.GeneraterSwapUtil; + +/** + * + * 供应商信息 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-24 + */ +@Service +public class PanyInvoiceServiceImpl extends SuperServiceImpl implements PanyInvoiceService{ + @Autowired + private GeneraterSwapUtil generaterSwapUtil; +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/ProductsServiceImpl.java b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/ProductsServiceImpl.java new file mode 100644 index 0000000..5f3fb0e --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/ProductsServiceImpl.java @@ -0,0 +1,366 @@ + +package com.yunzhupaas.mdm.service.impl; + +import com.yunzhupaas.mdm.entity.*; +import com.yunzhupaas.mdm.mapper.ProductsMapper; +import com.yunzhupaas.mdm.service.*; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yunzhupaas.mdm.model.product.*; +import org.springframework.stereotype.Service; +import com.yunzhupaas.base.service.SuperServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import com.yunzhupaas.util.GeneraterSwapUtil; +import java.sql.Connection; +import java.sql.SQLException; +import lombok.Cleanup; +import com.yunzhupaas.database.plugins.DynamicSourceGeneratorInterface; +import com.yunzhupaas.database.util.DynamicDataSourceUtil; +import org.apache.commons.collections4.CollectionUtils; +import com.yunzhupaas.i18n.util.I18nUtil; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.constant.MsgCode; +import java.math.BigDecimal; +import cn.hutool.core.util.ObjectUtil; +import java.lang.reflect.Field; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import java.util.regex.Pattern; +import java.util.stream.Collectors; +import com.yunzhupaas.base.model.ColumnDataModel; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.transaction.annotation.Transactional; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.github.yulichang.toolkit.JoinWrappers; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.yunzhupaas.model.QueryAllModel; +import java.text.SimpleDateFormat; +import com.yunzhupaas.util.*; +import java.util.*; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.permission.entity.UserEntity; +import com.github.pagehelper.PageHelper; +/** + * + * 商品信息 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-27 + */ +@Service +public class ProductsServiceImpl extends SuperServiceImpl implements ProductsService{ + @Autowired + private GeneraterSwapUtil generaterSwapUtil; + @Autowired + private UserProvider userProvider; + @Override + public List getList(ProductPagination productPagination){ + return getTypeList(productPagination,productPagination.getDataType()); + } + /** 列表查询 */ + @Override + public List getTypeList(ProductPagination productPagination,String dataType){ + String userId=userProvider.get().getUserId(); + Map tableClassMap=new HashMap<>(); + tableClassMap.put("mdm_product",ProductEntity.class); + + MPJLambdaWrapper wrapper = JoinWrappers + .lambda("mdm_product",ProductEntity.class) + .selectAll(ProductEntity.class); + MPJLambdaWrapper wrapper2 = JoinWrappers + .lambda("mdm_product",ProductEntity.class) + .distinct().select(ProductEntity::getProductId); + + QueryAllModel queryAllModel = new QueryAllModel(); + queryAllModel.setWrapper(wrapper); + queryAllModel.setClassMap(tableClassMap); + queryAllModel.setDbLink(ProductsConstant.DBLINKID); + //数据过滤 + boolean isPc = ServletUtil.getHeader("yunzhupaas-origin").equals("pc"); + String columnData = !isPc ? ProductsConstant.getAppColumnData() : ProductsConstant.getColumnData(); + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class); + String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList()); + queryAllModel.setRuleJson(ruleJson); + //高级查询 + boolean hasSuperQuery = true; + if (hasSuperQuery) { + queryAllModel.setSuperJson(productPagination.getSuperQueryJson()); + } + //数据权限 + boolean pcPermission = true; + boolean appPermission = false; + if (isPc && pcPermission) { + queryAllModel.setModuleId(productPagination.getMenuId()); + } + if (!isPc && appPermission) { + queryAllModel.setModuleId(productPagination.getMenuId()); + } + //拼接复杂条件 + wrapper = generaterSwapUtil.getConditionAllTable(queryAllModel); + if(wrapper == null) return new ArrayList<>(); + queryAllModel.setWrapper(wrapper2); + wrapper2 = generaterSwapUtil.getConditionAllTable(queryAllModel); + //其他条件拼接 + otherConditions(productPagination, wrapper, isPc); + otherConditions(productPagination, wrapper2, isPc); + + if("0".equals(dataType)){ + com.github.pagehelper.Page objects = PageHelper.startPage((int) productPagination.getCurrentPage(), (int) productPagination.getPageSize(), true); + List userIPage = this.selectJoinList(ProductEntity.class, wrapper2); + List collect = userIPage.stream().map(t -> t.getProductId()).collect(Collectors.toList()); + if(CollectionUtils.isNotEmpty(collect)){ + wrapper.in(ProductEntity::getProductId,collect); + } + List result = this.selectJoinList(ProductEntity.class, wrapper); + return productPagination.setData(result,objects.getTotal()); + }else{ + List list = this.selectJoinList(ProductEntity.class, wrapper); + if("2".equals(dataType)){ + List selectIds = Arrays.asList(productPagination.getSelectIds()); + return list.stream().filter(t -> selectIds.contains(t.getProductId())).collect(Collectors.toList()); + }else{ + return list; + } + } + + } + + /** + * 其他条件拼接 + */ + private void otherConditions(ProductPagination productPagination, MPJLambdaWrapper wrapper, boolean isPc) { + String databaseName; + try { + @Cleanup Connection cnn = DynamicDataSourceUtil.getCurrentConnection(); + databaseName = cnn.getMetaData().getDatabaseProductName().trim(); + } catch (SQLException e) { + throw new DataException(e.getMessage()); + } + //假删除标志 + wrapper.isNull(ProductEntity::getDeleteMark); + + wrapper.isNull(ProductEntity::getFlowId); + //关键词 + if(ObjectUtil.isNotEmpty(productPagination.getYunzhupaasKeyword())){ + } + //普通查询 + if(isPc){ + if(ObjectUtil.isNotEmpty(productPagination.getProductName())){ + String value = productPagination.getProductName() instanceof List ? + JsonUtil.getObjectToString(productPagination.getProductName()) : + String.valueOf(productPagination.getProductName()); + wrapper.like(ProductEntity::getProductName,value); + } + + if(ObjectUtil.isNotEmpty(productPagination.getProductCategory())){ + List idList = new ArrayList<>(); + try { + String[][] productCategory = JsonUtil.getJsonToBean(productPagination.getProductCategory(),String[][].class); + for(int i=0;i0){ + idList.add(JsonUtil.getObjectToString(Arrays.asList(productCategory[i]))); + } + } + }catch (Exception e1){ + try { + List productCategory = JsonUtil.getJsonToList(productPagination.getProductCategory(),String.class); + if(productCategory.size()>0){ + idList.add(JsonUtil.getObjectToString(productCategory)); + } + }catch (Exception e2){ + idList.add(String.valueOf(productPagination.getProductCategory())); + } + } + wrapper.and(t->{ + idList.forEach(tt->{ + if(StringUtil.isNotEmpty(tt) && "Microsoft SQL Server".equalsIgnoreCase(databaseName)){ + tt = tt.replaceFirst("\\[","[[]"); + } + t.like(ProductEntity::getProductCategory, tt).or(); + }); + }); + } + + if(ObjectUtil.isNotEmpty(productPagination.getProductType())){ + wrapper.eq(ProductEntity::getProductType,productPagination.getProductType()); + } + + } + //排序 + if(StringUtil.isEmpty(productPagination.getSidx())){ + wrapper.orderByDesc(ProductEntity::getProductId); + }else{ + try { + String[] split = productPagination.getSidx().split(","); + for(String sidx:split){ + ProductEntity productEntity = new ProductEntity(); + String oderTableField = productEntity.getClass().getAnnotation(TableName.class).value(); + boolean descFlag = sidx.startsWith("-"); + String sidxField = descFlag ? sidx.substring(1) : sidx; + try{ + Field declaredField = productEntity.getClass().getDeclaredField(sidxField); + declaredField.setAccessible(true); + sidxField = declaredField.getAnnotation(TableField.class).value(); + }catch (Exception e){ + } + String finalOderTableField = oderTableField; + String finalSidxField = sidxField; + Object select = wrapper.getSelectColumns().stream().filter(t -> Objects.equals(finalOderTableField, t.getTableAlias()) + && Objects.equals(finalSidxField, t.getColumn())).findFirst().orElse(null); + oderTableField = oderTableField + "." + sidxField; + if (select == null) { + wrapper.select(oderTableField); + } + if (descFlag) { + wrapper.orderByDesc(oderTableField); + } else { + wrapper.orderByAsc(oderTableField); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } + @Override + public ProductEntity getInfo(String productid){ + MPJLambdaWrapper wrapper = JoinWrappers + .lambda("mdm_product",ProductEntity.class) + .selectAll(ProductEntity.class); + wrapper.and( + t->t.eq(ProductEntity::getProductId, productid ) + .or().eq(ProductEntity::getFlowTaskId, productid) + ); + return this.selectJoinOne(ProductEntity.class,wrapper); + } + @Override + public void create(ProductEntity entity){ + this.save(entity); + } + @Override + public boolean update(String productid, ProductEntity entity){ + return this.updateById(entity); + } + @Override + public void delete(ProductEntity entity){ + if(entity!=null){ + this.removeById(entity.getProductId()); + } + } + /** 验证表单唯一字段,正则,非空 i-0新增-1修改*/ + @Override + public String checkForm(ProductForm form,int i) { + boolean isUp =StringUtil.isNotEmpty(form.getProductId()) && !form.getProductId().equals("0"); + Object id= null; + String countRecover = ""; + String fieldTipName = ""; + String canNotNull = I18nUtil.getMessageStr("sys.validate.textRequiredSuffix", "不能为空"); + String canNotRepeated = I18nUtil.getMessageStr("EXIST103", "不能重复"); + if (isUp){ + id = form.getProductId(); + } + //验证业务主键 + String businessErr = checkBusinessKey(form, isUp ? id : null, null); + if (StringUtil.isNotEmpty(businessErr)) { + return businessErr; + } + //主表字段验证 + fieldTipName = "商品编码"; + fieldTipName = "商品名称"; + if(StringUtil.isEmpty(form.getProductName())){ + return fieldTipName + canNotNull; + } + fieldTipName = "商品类型"; + fieldTipName = "商品分类"; + fieldTipName = "商品简称"; + fieldTipName = "品牌"; + fieldTipName = "规格型号"; + fieldTipName = "颜色"; + fieldTipName = "尺寸/规格"; + fieldTipName = "重量"; + fieldTipName = "最小起订量"; + fieldTipName = "标准销售单价"; + fieldTipName = "毛重"; + fieldTipName = "净重"; + fieldTipName = "单位名称"; + fieldTipName = "包装尺寸"; + fieldTipName = "成本价"; + fieldTipName = "保修期"; + fieldTipName = "税率"; + fieldTipName = "税收分类"; + fieldTipName = "保修条款"; + fieldTipName = "备注"; + return countRecover; + } + /** + * 验证业务主键 + */ + private String checkBusinessKey(ProductForm form, Object id, List flowIds){ + QueryWrapper wrapper = new QueryWrapper<>(); + //修改 + if (id != null){ + wrapper.lambda().ne(ProductEntity::getProductId, id); + } + //是否流程 + if(flowIds == null){ + wrapper.lambda().isNull(ProductEntity::getFlowId); + }else{ + wrapper.lambda().in(ProductEntity::getFlowId, flowIds); + } + //假删除标志 + wrapper.lambda().isNull(ProductEntity::getDeleteMark); + //商品名称字段判断 + if(form.getProductName() == null || form.getProductName().toString().trim().isEmpty()){ + wrapper.lambda().isNull(ProductEntity::getProductName); + }else{ + wrapper.lambda().eq(ProductEntity::getProductName, form.getProductName()); + } + //商品分类字段判断 + if(form.getProductCategory() == null || form.getProductCategory().toString().trim().isEmpty() + ||(form.getProductCategory() instanceof List && ((List) form.getProductCategory()).size() == 0)){ + wrapper.lambda().isNull(ProductEntity::getProductCategory); + }else{ + Object obj = form.getProductCategory() instanceof List ?JsonUtil.getObjectToString(form.getProductCategory()):form.getProductCategory(); + wrapper.lambda().eq(ProductEntity::getProductCategory, obj); + } + if((int) this.count(wrapper)>0){ + return "商品分类下,商品名称数据已存在,请勿重复提交!"; + } + return ""; + } + /** + * 新增修改数据(事务回滚) + * @param id + * @param productForm + * @return + */ + @Override + @Transactional + public void saveOrUpdate(ProductForm productForm,String id, boolean isSave) throws Exception{ + UserInfo userInfo=userProvider.get(); + UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId()); + productForm = JsonUtil.getJsonToBean( + generaterSwapUtil.swapDatetime(ProductsConstant.getFormData(),productForm,ProductsConstant.TABLERENAMES),ProductForm.class); + ProductEntity entity = JsonUtil.getJsonToBean(productForm, ProductEntity.class); + String mainUuid = StringUtil.isEmpty(id) ? RandomUtil.uuId() : id; + if(isSave){ + entity.setFlowTaskId(mainUuid); + entity.setProductCode(generaterSwapUtil.getBillNumber("productCode", false)); + entity.setProductId(mainUuid); + entity.setVersion(0); + } else { + if(StringUtil.isEmpty(entity.getProductCode()) ){ + entity.setProductCode(generaterSwapUtil.getBillNumber("productCode", false)); + } + } + boolean b = this.saveOrUpdate(entity); + if(!b){ + throw new DataException("当前表单原数据已被调整,请重新进入该页面编辑并提交数据"); + } + ProductEntity info = this.getInfo(mainUuid); + if (info == null) throw new RuntimeException(MsgCode.FA001.get()); + + } +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/SuppinfoServiceImpl.java b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/SuppinfoServiceImpl.java new file mode 100644 index 0000000..59000aa --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/SuppinfoServiceImpl.java @@ -0,0 +1,520 @@ + +package com.yunzhupaas.mdm.service.impl; + +import com.yunzhupaas.mdm.entity.*; +import com.yunzhupaas.mdm.mapper.CompanyMapper; +import com.yunzhupaas.mdm.service.*; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yunzhupaas.mdm.model.suppinfo.*; +import org.springframework.stereotype.Service; +import com.yunzhupaas.base.service.SuperServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import com.yunzhupaas.util.GeneraterSwapUtil; +import java.sql.Connection; +import java.sql.SQLException; +import lombok.Cleanup; +import com.yunzhupaas.database.plugins.DynamicSourceGeneratorInterface; +import com.yunzhupaas.database.util.DynamicDataSourceUtil; +import org.apache.commons.collections4.CollectionUtils; +import com.yunzhupaas.i18n.util.I18nUtil; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.constant.MsgCode; +import java.math.BigDecimal; +import cn.hutool.core.util.ObjectUtil; +import java.lang.reflect.Field; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import java.util.regex.Pattern; +import java.util.stream.Collectors; +import com.yunzhupaas.base.model.ColumnDataModel; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.transaction.annotation.Transactional; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.github.yulichang.toolkit.JoinWrappers; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.yunzhupaas.model.QueryAllModel; +import java.text.SimpleDateFormat; +import com.yunzhupaas.util.*; +import java.util.*; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.permission.entity.UserEntity; +import com.github.pagehelper.PageHelper; +/** + * + * 供应商信息 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-24 + */ +@Service +public class SuppinfoServiceImpl extends SuperServiceImpl implements SuppinfoService{ + @Autowired + private GeneraterSwapUtil generaterSwapUtil; + @Autowired + private UserProvider userProvider; + @Autowired + private SupplierService supplierService; + @Autowired + private PanyInvoiceService panyInvoiceService; + @Autowired + private CompanyBankService companyBankService; + @Override + public List getList(SuppinfoPagination companyPagination){ + return getTypeList(companyPagination,companyPagination.getDataType()); + } + /** 列表查询 */ + @Override + public List getTypeList(SuppinfoPagination companyPagination,String dataType){ + String userId=userProvider.get().getUserId(); + Map tableClassMap=new HashMap<>(); + tableClassMap.put("mdm_company",CompanyEntity.class); + tableClassMap.put("mdm_company_bank",CompanyBankEntity.class); + tableClassMap.put("mdm_company_invoice",PanyInvoiceEntity.class); + tableClassMap.put("mdm_supplier",SupplierEntity.class); + + MPJLambdaWrapper wrapper = JoinWrappers + .lambda("mdm_company",CompanyEntity.class) + .selectCollection(CompanyBankEntity.class,CompanyEntity::getCompanyBank) + .leftJoin(CompanyBankEntity.class,"mdm_company_bank",CompanyBankEntity::getCompanyId,CompanyEntity::getCompanyId) + .selectCollection(PanyInvoiceEntity.class,CompanyEntity::getPanyInvoice) + .leftJoin(PanyInvoiceEntity.class,"mdm_company_invoice",PanyInvoiceEntity::getCompanyId,CompanyEntity::getCompanyId) + .selectAssociation(SupplierEntity.class,CompanyEntity::getSupplier) + .leftJoin(SupplierEntity.class,"mdm_supplier",SupplierEntity::getCompanyId,CompanyEntity::getCompanyId) + .selectAll(CompanyEntity.class); + MPJLambdaWrapper wrapper2 = JoinWrappers + .lambda("mdm_company",CompanyEntity.class) + .leftJoin(CompanyBankEntity.class,"mdm_company_bank",CompanyBankEntity::getCompanyId,CompanyEntity::getCompanyId) + .leftJoin(PanyInvoiceEntity.class,"mdm_company_invoice",PanyInvoiceEntity::getCompanyId,CompanyEntity::getCompanyId) + .leftJoin(SupplierEntity.class,"mdm_supplier",SupplierEntity::getCompanyId,CompanyEntity::getCompanyId) + .distinct().select(CompanyEntity::getCompanyId); + + QueryAllModel queryAllModel = new QueryAllModel(); + queryAllModel.setWrapper(wrapper); + queryAllModel.setClassMap(tableClassMap); + queryAllModel.setDbLink(SuppinfoConstant.DBLINKID); + //数据过滤 + boolean isPc = ServletUtil.getHeader("yunzhupaas-origin").equals("pc"); + String columnData = !isPc ? SuppinfoConstant.getAppColumnData() : SuppinfoConstant.getColumnData(); + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class); + String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList()); + queryAllModel.setRuleJson(ruleJson); + //高级查询 + boolean hasSuperQuery = true; + if (hasSuperQuery) { + queryAllModel.setSuperJson(companyPagination.getSuperQueryJson()); + } + //数据权限 + boolean pcPermission = true; + boolean appPermission = false; + if (isPc && pcPermission) { + queryAllModel.setModuleId(companyPagination.getMenuId()); + } + if (!isPc && appPermission) { + queryAllModel.setModuleId(companyPagination.getMenuId()); + } + //拼接复杂条件 + wrapper = generaterSwapUtil.getConditionAllTable(queryAllModel); + if(wrapper == null) return new ArrayList<>(); + queryAllModel.setWrapper(wrapper2); + wrapper2 = generaterSwapUtil.getConditionAllTable(queryAllModel); + //其他条件拼接 + otherConditions(companyPagination, wrapper, isPc); + otherConditions(companyPagination, wrapper2, isPc); + + if("0".equals(dataType)){ + com.github.pagehelper.Page objects = PageHelper.startPage((int) companyPagination.getCurrentPage(), (int) companyPagination.getPageSize(), true); + List userIPage = this.selectJoinList(CompanyEntity.class, wrapper2); + List collect = userIPage.stream().map(t -> t.getCompanyId()).collect(Collectors.toList()); + if(CollectionUtils.isNotEmpty(collect)){ + wrapper.in(CompanyEntity::getCompanyId,collect); + } + List result = this.selectJoinList(CompanyEntity.class, wrapper); + return companyPagination.setData(result,objects.getTotal()); + }else{ + List list = this.selectJoinList(CompanyEntity.class, wrapper); + if("2".equals(dataType)){ + List selectIds = Arrays.asList(companyPagination.getSelectIds()); + return list.stream().filter(t -> selectIds.contains(t.getCompanyId())).collect(Collectors.toList()); + }else{ + return list; + } + } + + } + + /** + * 其他条件拼接 + */ + private void otherConditions(SuppinfoPagination companyPagination, MPJLambdaWrapper wrapper, boolean isPc) { + String databaseName; + try { + @Cleanup Connection cnn = DynamicDataSourceUtil.getCurrentConnection(); + databaseName = cnn.getMetaData().getDatabaseProductName().trim(); + } catch (SQLException e) { + throw new DataException(e.getMessage()); + } + wrapper.isNull(CompanyEntity::getFlowId); + //关键词 + if(ObjectUtil.isNotEmpty(companyPagination.getYunzhupaasKeyword())){ + } + //普通查询 + if(isPc){ + if(ObjectUtil.isNotEmpty(companyPagination.getCompanyName())){ + String value = companyPagination.getCompanyName() instanceof List ? + JsonUtil.getObjectToString(companyPagination.getCompanyName()) : + String.valueOf(companyPagination.getCompanyName()); + wrapper.like(CompanyEntity::getCompanyName,value); + } + + if(ObjectUtil.isNotEmpty(companyPagination.getOrgId())){ + List idList = new ArrayList<>(); + try { + String[][] orgId = JsonUtil.getJsonToBean(companyPagination.getOrgId(),String[][].class); + for(int i=0;i0){ + idList.add(JsonUtil.getObjectToString(Arrays.asList(orgId[i]))); + } + } + }catch (Exception e1){ + try { + List orgId = JsonUtil.getJsonToList(companyPagination.getOrgId(),String.class); + if(orgId.size()>0){ + idList.add(JsonUtil.getObjectToString(orgId)); + } + }catch (Exception e2){ + idList.add(String.valueOf(companyPagination.getOrgId())); + } + } + wrapper.and(t->{ + idList.forEach(tt->{ + if(StringUtil.isNotEmpty(tt) && "Microsoft SQL Server".equalsIgnoreCase(databaseName)){ + tt = tt.replaceFirst("\\[","[[]"); + } + t.like(CompanyEntity::getOrgId, tt).or(); + }); + }); + } + + } + //排序 + if(StringUtil.isEmpty(companyPagination.getSidx())){ + wrapper.orderByDesc(CompanyEntity::getCompanyId); + }else{ + try { + String[] split = companyPagination.getSidx().split(","); + for(String sidx:split){ + CompanyEntity companyEntity = new CompanyEntity(); + String oderTableField = companyEntity.getClass().getAnnotation(TableName.class).value(); + boolean descFlag = sidx.startsWith("-"); + String sidxField = descFlag ? sidx.substring(1) : sidx; + try{ + Field declaredField = companyEntity.getClass().getDeclaredField(sidxField); + declaredField.setAccessible(true); + sidxField = declaredField.getAnnotation(TableField.class).value(); + }catch (Exception e){ + } + String finalOderTableField = oderTableField; + String finalSidxField = sidxField; + Object select = wrapper.getSelectColumns().stream().filter(t -> Objects.equals(finalOderTableField, t.getTableAlias()) + && Objects.equals(finalSidxField, t.getColumn())).findFirst().orElse(null); + oderTableField = oderTableField + "." + sidxField; + if (select == null) { + wrapper.select(oderTableField); + } + if (descFlag) { + wrapper.orderByDesc(oderTableField); + } else { + wrapper.orderByAsc(oderTableField); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } + @Override + public CompanyEntity getInfo(String companyid){ + MPJLambdaWrapper wrapper = JoinWrappers + .lambda("mdm_company",CompanyEntity.class) + .selectCollection(CompanyBankEntity.class,CompanyEntity::getCompanyBank) + .leftJoin(CompanyBankEntity.class,"mdm_company_bank",CompanyBankEntity::getCompanyId,CompanyEntity::getCompanyId) + .selectCollection(PanyInvoiceEntity.class,CompanyEntity::getPanyInvoice) + .leftJoin(PanyInvoiceEntity.class,"mdm_company_invoice",PanyInvoiceEntity::getCompanyId,CompanyEntity::getCompanyId) + .selectAssociation(SupplierEntity.class,CompanyEntity::getSupplier) + .leftJoin(SupplierEntity.class,"mdm_supplier",SupplierEntity::getCompanyId,CompanyEntity::getCompanyId) + .selectAll(CompanyEntity.class); + wrapper.and( + t->t.eq(CompanyEntity::getCompanyId, companyid ) + .or().eq(CompanyEntity::getFlowTaskId, companyid) + ); + return this.selectJoinOne(CompanyEntity.class,wrapper); + } + @Override + public void create(CompanyEntity entity){ + this.save(entity); + } + @Override + public boolean update(String companyid, CompanyEntity entity){ + return this.updateById(entity); + } + @Override + public void delete(CompanyEntity entity){ + if(entity!=null){ + this.removeById(entity.getCompanyId()); + } + } + /** 验证表单唯一字段,正则,非空 i-0新增-1修改*/ + @Override + public String checkForm(SuppinfoForm form,int i) { + boolean isUp =StringUtil.isNotEmpty(form.getCompanyId()) && !form.getCompanyId().equals("0"); + Object id= null; + String countRecover = ""; + String fieldTipName = ""; + String canNotNull = I18nUtil.getMessageStr("sys.validate.textRequiredSuffix", "不能为空"); + String canNotRepeated = I18nUtil.getMessageStr("EXIST103", "不能重复"); + if (isUp){ + id = form.getCompanyId(); + } + //主表字段验证 + fieldTipName = "企业编码"; + fieldTipName = "企业名称"; + if(StringUtil.isEmpty(form.getCompanyName())){ + return fieldTipName + canNotNull; + } + if(StringUtil.isNotEmpty(form.getCompanyName())){ + form.setCompanyName(form.getCompanyName().trim()); + QueryWrapper company_nameWrapper=new QueryWrapper<>(); + company_nameWrapper.lambda().eq(CompanyEntity::getCompanyName,form.getCompanyName()); + company_nameWrapper.lambda().isNull(CompanyEntity::getFlowId); + if (isUp){ + company_nameWrapper.lambda().ne(CompanyEntity::getCompanyId, id); + } + if((int) this.count(company_nameWrapper)>0){ + countRecover = fieldTipName + canNotRepeated; + } + } + fieldTipName = "简称/昵称"; + fieldTipName = "类型"; + fieldTipName = "社会信用代码"; + if(StringUtil.isEmpty(form.getCreditCode())){ + return fieldTipName + canNotNull; + } + if(StringUtil.isNotEmpty(form.getCreditCode())){ + form.setCreditCode(form.getCreditCode().trim()); + QueryWrapper credit_codeWrapper=new QueryWrapper<>(); + credit_codeWrapper.lambda().eq(CompanyEntity::getCreditCode,form.getCreditCode()); + credit_codeWrapper.lambda().isNull(CompanyEntity::getFlowId); + if (isUp){ + credit_codeWrapper.lambda().ne(CompanyEntity::getCompanyId, id); + } + if((int) this.count(credit_codeWrapper)>0){ + countRecover = fieldTipName + canNotRepeated; + } + } + fieldTipName = "归属组织"; + fieldTipName = "所属地区"; + fieldTipName = "纳税人类别"; + fieldTipName = "企业规模"; + fieldTipName = "企业类型"; + fieldTipName = "行业代码"; + fieldTipName = "成立日期"; + fieldTipName = "注册资本"; + fieldTipName = "法定代表人"; + fieldTipName = "联系电话"; + if(StringUtil.isNotEmpty(form.getPhone())){ + if(!Pattern.compile("^1[3456789]\\d{9}$|^0\\d{2,3}-?\\d{7,8}$").matcher(String.valueOf(form.getPhone())).matches()){ + return I18nUtil.getMessageStr("sys.validate.telephone", "请输入正确的电话号码"); + } + } + fieldTipName = "邮箱"; + if(StringUtil.isNotEmpty(form.getEmail())){ + if(!Pattern.compile("^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$").matcher(String.valueOf(form.getEmail())).matches()){ + return I18nUtil.getMessageStr("sys.validate.email", "请输入正确的邮箱"); + } + } + fieldTipName = "网站"; + fieldTipName = "地址"; + fieldTipName = "经营范围"; + fieldTipName = "备注"; + //副表字段验证 + fieldTipName = "责任人"; + if( form.getYunzhupaas_supplier_yunzhupaas_majorPersonId() == null ){ + return fieldTipName + canNotNull; + } + fieldTipName = "供应商级别"; + fieldTipName = "供应商类型"; + fieldTipName = "供应商分类"; + fieldTipName = "荣誉、资质"; + fieldTipName = "供应商业绩"; + fieldTipName = "完工项目"; + //子表字段验证 + if (form.getPanyInvoiceList()!=null){ + + fieldTipName = "设计子表" + + "-" + "发票抬头编码"; + + + fieldTipName = "设计子表" + + "-" + "发票抬头名称"; + + + fieldTipName = "设计子表" + + "-" + "纳税人识别号"; + + + fieldTipName = "设计子表" + + "-" + "纳税人类别"; + + + fieldTipName = "设计子表" + + "-" + "地址"; + + + fieldTipName = "设计子表" + + "-" + "电话"; + + + fieldTipName = "设计子表" + + "-" + "开户银行"; + + + fieldTipName = "设计子表" + + "-" + "银行账户"; + + + fieldTipName = "设计子表" + + "-" + "是否默认"; + + + fieldTipName = "设计子表" + + "-" + "是否有效"; + + + fieldTipName = "设计子表" + + "-" + "备注"; + + } + if (form.getCompanyBankList()!=null){ + + fieldTipName = "设计子表" + + "-" + "开户行"; + + + fieldTipName = "设计子表" + + "-" + "账户名"; + + + fieldTipName = "设计子表" + + "-" + "银行账号"; + + + fieldTipName = "设计子表" + + "-" + "开户行城市"; + + + fieldTipName = "设计子表" + + "-" + "备注"; + + } + return countRecover; + } + /** + * 新增修改数据(事务回滚) + * @param id + * @param companyForm + * @return + */ + @Override + @Transactional + public void saveOrUpdate(SuppinfoForm companyForm,String id, boolean isSave) throws Exception{ + UserInfo userInfo=userProvider.get(); + UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId()); + companyForm = JsonUtil.getJsonToBean( + generaterSwapUtil.swapDatetime(SuppinfoConstant.getFormData(),companyForm,SuppinfoConstant.TABLERENAMES),SuppinfoForm.class); + CompanyEntity entity = JsonUtil.getJsonToBean(companyForm, CompanyEntity.class); + String mainUuid = StringUtil.isEmpty(id) ? RandomUtil.uuId() : id; + if(isSave){ + entity.setFlowTaskId(mainUuid); + entity.setCompanyCode(generaterSwapUtil.getBillNumber("CustomerCompanyCode", false)); + entity.setCompanyId(mainUuid); + } else { + if(StringUtil.isEmpty(entity.getCompanyCode()) ){ + entity.setCompanyCode(generaterSwapUtil.getBillNumber("CustomerCompanyCode", false)); + } + } + boolean b = this.saveOrUpdate(entity); + CompanyEntity info = this.getInfo(mainUuid); + if (info == null) throw new RuntimeException(MsgCode.FA001.get()); + + //PanyInvoice子表数据新增修改 + QueryWrapper PanyInvoicequeryWrapper = new QueryWrapper<>(); + PanyInvoicequeryWrapper.lambda().eq(PanyInvoiceEntity::getCompanyId, info.getCompanyId()); + if(!isSave && !CollectionUtils.isNotEmpty(companyForm.getPanyInvoiceList())){ + panyInvoiceService.remove(PanyInvoicequeryWrapper); + } + if (CollectionUtils.isNotEmpty(companyForm.getPanyInvoiceList())){ + List tableField46dc53 = JsonUtil.getJsonToList(companyForm.getPanyInvoiceList(),PanyInvoiceEntity.class); + //移除的数据 + List childIds = tableField46dc53.stream().filter(t->t.getInvoiceId()!=null).map(PanyInvoiceEntity::getInvoiceId).collect(Collectors.toList()); + if(CollectionUtils.isNotEmpty(childIds)){ + PanyInvoicequeryWrapper.lambda().notIn(PanyInvoiceEntity::getInvoiceId,childIds); + } + panyInvoiceService.remove(PanyInvoicequeryWrapper); + for(PanyInvoiceEntity entitys : tableField46dc53){ + entitys.setCompanyId(entity.getCompanyId()); + if(isSave || entitys.getInvoiceId()==null){ + entitys.setTitleCode(generaterSwapUtil.getBillNumber("InvoiceTitleCode", false)); + }else{ + if(StringUtil.isEmpty(entitys.getTitleCode()) || entitys.getInvoiceId() == null ){ + entitys.setTitleCode(generaterSwapUtil.getBillNumber("InvoiceTitleCode", false)); + } + } + if(entitys.getInvoiceId()==null){ + entitys.setInvoiceId(RandomUtil.uuId()); + } + panyInvoiceService.saveOrUpdate(entitys); + } + } + //CompanyBank子表数据新增修改 + QueryWrapper CompanyBankqueryWrapper = new QueryWrapper<>(); + CompanyBankqueryWrapper.lambda().eq(CompanyBankEntity::getCompanyId, info.getCompanyId()); + if(!isSave && !CollectionUtils.isNotEmpty(companyForm.getCompanyBankList())){ + companyBankService.remove(CompanyBankqueryWrapper); + } + if (CollectionUtils.isNotEmpty(companyForm.getCompanyBankList())){ + List tableFieldad9d92 = JsonUtil.getJsonToList(companyForm.getCompanyBankList(),CompanyBankEntity.class); + //移除的数据 + List childIds = tableFieldad9d92.stream().filter(t->t.getBankId()!=null).map(CompanyBankEntity::getBankId).collect(Collectors.toList()); + if(CollectionUtils.isNotEmpty(childIds)){ + CompanyBankqueryWrapper.lambda().notIn(CompanyBankEntity::getBankId,childIds); + } + companyBankService.remove(CompanyBankqueryWrapper); + for(CompanyBankEntity entitys : tableFieldad9d92){ + entitys.setCompanyId(entity.getCompanyId()); + if(entitys.getBankId()==null){ + entitys.setBankId(RandomUtil.uuId()); + } + companyBankService.saveOrUpdate(entitys); + } + } + //mdm_supplier副表数据新增修改 + Map SupplierMap = generaterSwapUtil.getMastTabelData(companyForm,"mdm_supplier"); + SupplierEntity supplierentity = JsonUtil.getJsonToBean(SupplierMap,SupplierEntity.class); + //自动生成的字段 + if(isSave){ + supplierentity.setSupplierId(RandomUtil.uuId()); + supplierentity.setCompanyId(entity.getCompanyId()); + }else{ + QueryWrapper queryWrapperSupplier =new QueryWrapper<>(); + queryWrapperSupplier.lambda().eq(SupplierEntity::getCompanyId,info.getCompanyId()); + SupplierEntity supplierOneEntity= supplierService.getOne(queryWrapperSupplier); + supplierentity.setSupplierId(supplierOneEntity.getSupplierId()); + supplierentity.setCompanyId(entity.getCompanyId()); + } + + supplierService.saveOrUpdate(supplierentity); + } +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/SupplierServiceImpl.java b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/SupplierServiceImpl.java new file mode 100644 index 0000000..2a57930 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-biz/src/main/java/com/yunzhupaas/mdm/service/impl/SupplierServiceImpl.java @@ -0,0 +1,24 @@ + +package com.yunzhupaas.mdm.service.impl; + +import com.yunzhupaas.mdm.entity.*; +import com.yunzhupaas.mdm.mapper.SupplierMapper; +import com.yunzhupaas.mdm.service.*; +import org.springframework.stereotype.Service; +import com.yunzhupaas.base.service.SuperServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import com.yunzhupaas.util.GeneraterSwapUtil; + +/** + * + * 供应商信息 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-24 + */ +@Service +public class SupplierServiceImpl extends SuperServiceImpl implements SupplierService{ + @Autowired + private GeneraterSwapUtil generaterSwapUtil; +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-controller/pom.xml b/yunzhupaas-mdm/yunzhupaas-mdm-controller/pom.xml new file mode 100644 index 0000000..2cec45a --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-controller/pom.xml @@ -0,0 +1,23 @@ + + + + yunzhupaas-mdm + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-mdm-controller + + + + com.yunzhupaas + yunzhupaas-mdm-biz + ${project.version} + + + + + diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-controller/src/main/java/com/yunzhupaas/mdm/controller/AssetController.java b/yunzhupaas-mdm/yunzhupaas-mdm-controller/src/main/java/com/yunzhupaas/mdm/controller/AssetController.java new file mode 100644 index 0000000..f3bdfee --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-controller/src/main/java/com/yunzhupaas/mdm/controller/AssetController.java @@ -0,0 +1,697 @@ +package com.yunzhupaas.mdm.controller; + + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.mdm.service.*; +import com.yunzhupaas.mdm.entity.*; +import com.yunzhupaas.util.*; +import com.yunzhupaas.mdm.model.asset.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import com.yunzhupaas.flowable.entity.TaskEntity; +import jakarta.validation.Valid; +import java.util.*; +import com.yunzhupaas.model.ExcelModel; +import com.yunzhupaas.excel.ExcelExportStyler; +import com.yunzhupaas.excel.ExcelHelper; +import com.yunzhupaas.annotation.YunzhupaasField; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.base.entity.ProvinceEntity; +import java.io.IOException; +import java.util.stream.Collectors; +import com.yunzhupaas.flowable.entity.TaskEntity; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.model.visualJson.UploaderTemplateModel; +import com.yunzhupaas.base.util.FormExecelUtils; +import org.springframework.web.multipart.MultipartFile; +import cn.afterturn.easypoi.excel.ExcelExportUtil; +import cn.afterturn.easypoi.excel.ExcelImportUtil; +import cn.afterturn.easypoi.excel.entity.ExportParams; +import cn.afterturn.easypoi.excel.entity.ImportParams; +import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; +import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.Workbook; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import com.yunzhupaas.onlinedev.model.ExcelImFieldModel; +import com.yunzhupaas.base.model.OnlineImport.ImportDataModel; +import com.yunzhupaas.base.model.OnlineImport.ImportFormCheckUniqueModel; +import com.yunzhupaas.base.model.OnlineImport.ExcelImportModel; +import com.yunzhupaas.base.model.OnlineImport.VisualImportModel; +import cn.xuyanwu.spring.file.storage.FileInfo; +import lombok.Cleanup; +import com.yunzhupaas.model.visualJson.config.HeaderModel; +import com.yunzhupaas.base.model.ColumnDataModel; +import com.yunzhupaas.base.util.VisualUtils; +import org.springframework.transaction.annotation.Transactional; + +/** + * 资产信息 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-28 + */ +@Slf4j +@RestController +@Tag(name = "资产信息" , description = "bcm") +@RequestMapping("/api/bcm/Asset") +public class AssetController { + + @Autowired + private GeneraterSwapUtil generaterSwapUtil; + + @Autowired + private UserProvider userProvider; + + @Autowired + private AssetService assetService; + + @Autowired + private SuppinfoService companyService; + + @Autowired + private ConfigValueUtil configValueUtil; + + /** + * 列表 + * + * @param assetPagination + * @return + */ + @Operation(summary = "获取列表") + @PostMapping("/getList") + public ActionResult list(@RequestBody AssetPagination assetPagination)throws Exception{ + List list= assetService.getList(assetPagination); + List> realList=new ArrayList<>(); + for (AssetEntity entity : list) { + Map assetMap=JsonUtil.entityToMap(entity); + assetMap.put("id", assetMap.get("asset_id")); + //副表数据 + //子表数据 + realList.add(assetMap); + } + //数据转换 + boolean isPc = "pc".equals(ServletUtil.getHeader("yunzhupaas-origin" )); + realList = generaterSwapUtil.swapDataList(realList, AssetConstant.getFormData(), AssetConstant.getColumnData(), assetPagination.getModuleId(),isPc?false:false); + for (Map map : realList) { + if(ObjectUtil.isNotEmpty( map.get("supplier_id"))){ + map.put("supplier_id", companyService.getInfo(map.get("supplier_id").toString()).getCompanyName()); + } + + } + //返回对象 + PageListVO vo = new PageListVO(); + vo.setList(realList); + PaginationVO page = JsonUtil.getJsonToBean(assetPagination, PaginationVO.class); + vo.setPagination(page); + return ActionResult.success(vo); + } + /** + * 创建 + * + * @param assetForm + * @return + */ + @PostMapping() + @Operation(summary = "创建") + public ActionResult create(@RequestBody @Valid AssetForm assetForm) { + String b = assetService.checkForm(assetForm,0); + if (StringUtil.isNotEmpty(b)){ + return ActionResult.fail(b ); + } + try{ + assetService.saveOrUpdate(assetForm, null ,true); + }catch(Exception e){ + return ActionResult.fail(MsgCode.FA028.get()); + } + return ActionResult.success(MsgCode.SU001.get()); + } + /** + * 导出Excel + * + * @return + */ + @Operation(summary = "导出Excel") + @PostMapping("/Actions/Export") + public ActionResult Export(@RequestBody AssetPagination assetPagination) throws IOException { + if (StringUtil.isEmpty(assetPagination.getSelectKey())){ + return ActionResult.fail(MsgCode.IMP011.get()); + } + List list= assetService.getList(assetPagination); + List> realList=new ArrayList<>(); + for (AssetEntity entity : list) { + Map assetMap=JsonUtil.entityToMap(entity); + assetMap.put("id", assetMap.get("asset_id")); + //副表数据 + //子表数据 + realList.add(assetMap); + } + //数据转换 + realList = generaterSwapUtil.swapDataList(realList, AssetConstant.getFormData(), AssetConstant.getColumnData(), assetPagination.getModuleId(),false); + String[]keys=!StringUtil.isEmpty(assetPagination.getSelectKey())?assetPagination.getSelectKey():new String[0]; + UserInfo userInfo=userProvider.get(); + String menuFullName = generaterSwapUtil.getMenuName(assetPagination.getMenuId()); + + DownloadVO vo=this.creatModelExcel(configValueUtil.getTemporaryFilePath(),realList,keys,userInfo,menuFullName); + return ActionResult.success(vo); + } + + /** + * 导出表格方法 + */ + public DownloadVO creatModelExcel(String path,List>list,String[]keys,UserInfo userInfo,String menuFullName){ + DownloadVO vo=DownloadVO.builder().build(); + List entitys=new ArrayList<>(); + if(keys.length>0){ + for(String key:keys){ + switch(key){ + case "asset_code" : + entitys.add(new ExcelExportEntity("资产编码" ,"asset_code")); + break; + case "asset_name" : + entitys.add(new ExcelExportEntity("资产名称" ,"asset_name")); + break; + case "asset_type" : + entitys.add(new ExcelExportEntity("资产类型" ,"asset_type")); + break; + case "asset_category" : + entitys.add(new ExcelExportEntity("资产分类" ,"asset_category")); + break; + case "asset_status" : + entitys.add(new ExcelExportEntity("资产状态" ,"asset_status")); + break; + case "asset_location" : + entitys.add(new ExcelExportEntity("资产位置" ,"asset_location")); + break; + case "current_org_id" : + entitys.add(new ExcelExportEntity("使用组织" ,"current_org_id")); + break; + case "current_user_id" : + entitys.add(new ExcelExportEntity("保管用户" ,"current_user_id")); + break; + case "asset_ownership" : + entitys.add(new ExcelExportEntity("资产权属" ,"asset_ownership")); + break; + case "measurement_unit" : + entitys.add(new ExcelExportEntity("单位" ,"measurement_unit")); + break; + case "quantity" : + entitys.add(new ExcelExportEntity("数量" ,"quantity")); + break; + case "purchase_date" : + entitys.add(new ExcelExportEntity("购置日期" ,"purchase_date")); + break; + case "commissioning_date" : + entitys.add(new ExcelExportEntity("启用日期" ,"commissioning_date")); + break; + case "expected_life" : + entitys.add(new ExcelExportEntity("预计使用年限" ,"expected_life")); + break; + case "supplier_id" : + entitys.add(new ExcelExportEntity("供应商" ,"supplier_id")); + break; + case "remark" : + entitys.add(new ExcelExportEntity("备注" ,"remark")); + break; + default: + break; + } + } + } + + ExportParams exportParams = new ExportParams(null, "表单信息"); + exportParams.setType(ExcelType.XSSF); + try{ + @Cleanup Workbook workbook = new HSSFWorkbook(); + if (entitys.size()>0){ + if (list.size()==0){ + list.add(new HashMap<>()); + } + //去除空数据 + List> dataList = new ArrayList<>(); + for (Map map : list) { + int i = 0; + for (String key : keys) { + //子表 + if (key.toLowerCase().startsWith("tablefield")) { + String tableField = key.substring(0, key.indexOf("-" )); + String field = key.substring(key.indexOf("-" ) + 1); + Object o = map.get(tableField); + if (o != null) { + List> childList = (List>) o; + for (Map childMap : childList) { + if (childMap.get(field) != null) { + i++; + } + } + } + } else { + Object o = map.get(key); + if (o != null) { + i++; + } + } + } + if (i > 0) { + dataList.add(map); + } + } + List mergerEntitys = new ArrayList<>(entitys); + List> mergerList=new ArrayList<>(dataList); + //复杂表头-表头和数据处理 + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(AssetConstant.getColumnData(), ColumnDataModel.class); + List complexHeaderList = columnDataModel.getComplexHeaderList(); + if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { + entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList, Objects.equals(columnDataModel.getType(), 4)); + dataList = VisualUtils.complexHeaderDataHandel(dataList, complexHeaderList, Objects.equals(columnDataModel.getType(), 4)); + } + + exportParams.setStyle(ExcelExportStyler.class); + workbook = ExcelExportUtil.exportExcel(exportParams, entitys, dataList); + VisualUtils.mergerVertical(workbook, mergerEntitys, mergerList); + ExcelModel excelModel = generaterSwapUtil.getExcelParams(AssetConstant.getFormData(),Arrays.asList(keys)); + ExcelHelper helper = new ExcelHelper(); + helper.init(workbook, exportParams, entitys, excelModel); + helper.doPreHandle(); + helper.doPostHandle(); + } + String fileName = menuFullName +"_"+ DateUtil.dateNow("yyyyMMddHHmmss") + ".xls"; + MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName); + String temporaryFilePath = configValueUtil.getTemporaryFilePath(); + FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName); + vo.setName(fileInfo.getFilename()); + vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName); + } catch (Exception e) { + log.error("信息导出Excel错误:{}", e.getMessage()); + e.printStackTrace(); + } + return vo; + } + @Operation(summary = "上传文件") + @PostMapping("/Uploader") + public ActionResult Uploader() { + List list = UpUtil.getFileAll(); + MultipartFile file = list.get(0); + if (file.getOriginalFilename().endsWith(".xlsx") || file.getOriginalFilename().endsWith(".xls")) { + String filePath = XSSEscape.escape(configValueUtil.getTemporaryFilePath()); + String fileName = XSSEscape.escape(RandomUtil.uuId() + "." + UpUtil.getFileType(file)); + //上传文件 + FileInfo fileInfo = FileUploadUtils.uploadFile(file, filePath, fileName); + DownloadVO vo = DownloadVO.builder().build(); + vo.setName(fileInfo.getFilename()); + return ActionResult.success(vo); + } else { + return ActionResult.fail(MsgCode.FA017.get()); + } + } + + /** + * 模板下载 + * + * @return + */ + @Operation(summary = "模板下载") + @GetMapping("/TemplateDownload") + public ActionResult TemplateDownload(@RequestParam("menuId") String menuId){ + DownloadVO vo = DownloadVO.builder().build(); + UserInfo userInfo = userProvider.get(); + String menuFullName = generaterSwapUtil.getMenuName(menuId); + //主表对象 + List entitys = new ArrayList<>(); + List selectKeys = new ArrayList<>(); + //以下添加字段 + entitys.add(new ExcelExportEntity("资产名称(asset_name)" ,"asset_name")); + selectKeys.add("asset_name"); + entitys.add(new ExcelExportEntity("资产类型(asset_type)" ,"asset_type")); + selectKeys.add("asset_type"); + entitys.add(new ExcelExportEntity("资产分类(asset_category)" ,"asset_category")); + selectKeys.add("asset_category"); + entitys.add(new ExcelExportEntity("资产状态(asset_status)" ,"asset_status")); + selectKeys.add("asset_status"); + entitys.add(new ExcelExportEntity("资产权属(asset_ownership)" ,"asset_ownership")); + selectKeys.add("asset_ownership"); + entitys.add(new ExcelExportEntity("资产位置(asset_location)" ,"asset_location")); + selectKeys.add("asset_location"); + entitys.add(new ExcelExportEntity("使用组织(current_org_id)" ,"current_org_id")); + selectKeys.add("current_org_id"); + entitys.add(new ExcelExportEntity("单位(measurement_unit)" ,"measurement_unit")); + selectKeys.add("measurement_unit"); + entitys.add(new ExcelExportEntity("启用日期(commissioning_date)" ,"commissioning_date")); + selectKeys.add("commissioning_date"); + entitys.add(new ExcelExportEntity("购置日期(purchase_date)" ,"purchase_date")); + selectKeys.add("purchase_date"); + entitys.add(new ExcelExportEntity("备注(remark)" ,"remark")); + selectKeys.add("remark"); + entitys.add(new ExcelExportEntity("预计使用年限(expected_life)" ,"expected_life")); + selectKeys.add("expected_life"); + entitys.add(new ExcelExportEntity("数量(quantity)" ,"quantity")); + selectKeys.add("quantity"); + entitys.add(new ExcelExportEntity("保管用户(current_user_id)" ,"current_user_id")); + selectKeys.add("current_user_id"); + ExcelModel excelModel = generaterSwapUtil.getExcelParams(AssetConstant.getFormData(),selectKeys); + List> list = new ArrayList<>(); + list.add(excelModel.getDataMap()); + + ExportParams exportParams = new ExportParams(null, menuFullName + "模板"); + exportParams.setStyle(ExcelExportStyler.class); + exportParams.setType(ExcelType.XSSF); + try{ + @Cleanup Workbook workbook = new HSSFWorkbook(); + if (entitys.size()>0){ + if (list.size()==0){ + list.add(new HashMap<>()); + } + //复杂表头-表头和数据处理 + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(AssetConstant.getColumnData(), ColumnDataModel.class); + List complexHeaderList = columnDataModel.getComplexHeaderList(); + if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { + entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList, false); + list = VisualUtils.complexHeaderDataHandel(list, complexHeaderList, false); + } + workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list); + ExcelHelper helper = new ExcelHelper(); + helper.init(workbook, exportParams, entitys, excelModel); + helper.doPreHandle(); + helper.doPostHandle(); + } + String fileName = menuFullName + "导入模板.xls"; + MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName); + String temporaryFilePath = configValueUtil.getTemporaryFilePath(); + FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName); + vo.setName(fileInfo.getFilename()); + vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName); + } catch (Exception e) { + log.error("模板信息导出Excel错误:{}", e.getMessage()); + e.printStackTrace(); + } + return ActionResult.success(vo); + } + + /** + * 导入预览 + * + * @return + */ + @Operation(summary = "导入预览" ) + @GetMapping("/ImportPreview") + public ActionResult> ImportPreview(String fileName) throws Exception { + Map headAndDataMap = new HashMap<>(2); + String filePath = FileUploadUtils.getLocalBasePath() + configValueUtil.getTemporaryFilePath(); + FileUploadUtils.downLocal(configValueUtil.getTemporaryFilePath(), filePath, fileName); + File temporary = new File(XSSEscape.escapePath(filePath + fileName)); + int headerRowIndex = 1; + ImportParams params = new ImportParams(); + params.setTitleRows(0); + params.setHeadRows(headerRowIndex); + params.setNeedVerify(true); + try { + InputStream inputStream = ExcelUtil.solveOrginTitle(temporary, headerRowIndex); + List excelDataList = ExcelUtil.importExcelByInputStream(inputStream, 0, headerRowIndex, Map.class); + //数据超过1000条 + if(excelDataList != null && excelDataList.size() > 1000) { + return ActionResult.fail(MsgCode.ETD117.get()); + } + + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(AssetConstant.getColumnData(), ColumnDataModel.class); + UploaderTemplateModel uploaderTemplateModel = JsonUtil.getJsonToBean(columnDataModel.getUploaderTemplateJson(), UploaderTemplateModel.class); + List selectKey = uploaderTemplateModel.getSelectKey(); + //子表合并 + List> results = FormExecelUtils.dataMergeChildTable(excelDataList,selectKey); + // 导入字段 + List columns = new ArrayList<>(); + columns.add(new ExcelImFieldModel("asset_name","资产名称","input")); + columns.add(new ExcelImFieldModel("asset_type","资产类型","select")); + columns.add(new ExcelImFieldModel("asset_category","资产分类","select")); + columns.add(new ExcelImFieldModel("asset_status","资产状态","select")); + columns.add(new ExcelImFieldModel("asset_ownership","资产权属","select")); + columns.add(new ExcelImFieldModel("asset_location","资产位置","cascader")); + columns.add(new ExcelImFieldModel("current_org_id","使用组织","organizeSelect")); + columns.add(new ExcelImFieldModel("measurement_unit","单位","input")); + columns.add(new ExcelImFieldModel("commissioning_date","启用日期","datePicker")); + columns.add(new ExcelImFieldModel("purchase_date","购置日期","datePicker")); + columns.add(new ExcelImFieldModel("remark","备注","textarea")); + columns.add(new ExcelImFieldModel("expected_life","预计使用年限","inputNumber")); + columns.add(new ExcelImFieldModel("quantity","数量","inputNumber")); + columns.add(new ExcelImFieldModel("current_user_id","保管用户","userSelect")); + headAndDataMap.put("dataRow" , results); + headAndDataMap.put("headerRow" , JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(columns))); + } catch (Exception e){ + e.printStackTrace(); + return ActionResult.fail(MsgCode.VS407.get()); + } + return ActionResult.success(headAndDataMap); + } + + /** + * 导入数据 + * + * @return + */ + @Operation(summary = "导入数据" ) + @PostMapping("/ImportData") + public ActionResult ImportData(@RequestBody VisualImportModel visualImportModel) throws Exception { + List> listData = visualImportModel.getList(); + ImportFormCheckUniqueModel uniqueModel = new ImportFormCheckUniqueModel(); + uniqueModel.setDbLinkId(AssetConstant.DBLINKID); + uniqueModel.setUpdate(Objects.equals("1", "2")); + + Map tablefieldkey = new HashMap<>(); + for(String key:AssetConstant.TABLEFIELDKEY.keySet()){ + tablefieldkey.put(key,AssetConstant.TABLERENAMES.get(AssetConstant.TABLEFIELDKEY.get(key))); + } + ExcelImportModel excelImportModel = generaterSwapUtil.importData(AssetConstant.getFormData(),listData,uniqueModel, tablefieldkey,AssetConstant.getTableList()); + List importDataModel = uniqueModel.getImportDataModel(); + for (ImportDataModel model : importDataModel) { + String id = model.getId(); + Map result = model.getResultData(); + if(StringUtil.isNotEmpty(id)){ + update(id, JsonUtil.getJsonToBean(result,AssetForm.class), true); + }else { + create( JsonUtil.getJsonToBean(result,AssetForm.class)); + } + } + return ActionResult.success(excelImportModel); + } + + /** + * 导出异常报告 + * + * @return + */ + @Operation(summary = "导出异常报告") + @PostMapping("/ImportExceptionData") + public ActionResult ImportExceptionData(@RequestBody VisualImportModel visualImportModel) { + DownloadVO vo = DownloadVO.builder().build(); + UserInfo userInfo = userProvider.get(); + String menuFullName = generaterSwapUtil.getMenuName(visualImportModel.getMenuId()); + //主表对象 + List entitys = new ArrayList<>(); + entitys.add(new ExcelExportEntity("异常原因", "errorsInfo",30)); + List selectKeys = new ArrayList<>(); + //以下添加字段 + entitys.add(new ExcelExportEntity("资产名称(asset_name)" ,"asset_name")); + selectKeys.add("asset_name"); + entitys.add(new ExcelExportEntity("资产类型(asset_type)" ,"asset_type")); + selectKeys.add("asset_type"); + entitys.add(new ExcelExportEntity("资产分类(asset_category)" ,"asset_category")); + selectKeys.add("asset_category"); + entitys.add(new ExcelExportEntity("资产状态(asset_status)" ,"asset_status")); + selectKeys.add("asset_status"); + entitys.add(new ExcelExportEntity("资产权属(asset_ownership)" ,"asset_ownership")); + selectKeys.add("asset_ownership"); + entitys.add(new ExcelExportEntity("资产位置(asset_location)" ,"asset_location")); + selectKeys.add("asset_location"); + entitys.add(new ExcelExportEntity("使用组织(current_org_id)" ,"current_org_id")); + selectKeys.add("current_org_id"); + entitys.add(new ExcelExportEntity("单位(measurement_unit)" ,"measurement_unit")); + selectKeys.add("measurement_unit"); + entitys.add(new ExcelExportEntity("启用日期(commissioning_date)" ,"commissioning_date")); + selectKeys.add("commissioning_date"); + entitys.add(new ExcelExportEntity("购置日期(purchase_date)" ,"purchase_date")); + selectKeys.add("purchase_date"); + entitys.add(new ExcelExportEntity("备注(remark)" ,"remark")); + selectKeys.add("remark"); + entitys.add(new ExcelExportEntity("预计使用年限(expected_life)" ,"expected_life")); + selectKeys.add("expected_life"); + entitys.add(new ExcelExportEntity("数量(quantity)" ,"quantity")); + selectKeys.add("quantity"); + entitys.add(new ExcelExportEntity("保管用户(current_user_id)" ,"current_user_id")); + selectKeys.add("current_user_id"); + ExcelModel excelModel = generaterSwapUtil.getExcelParams(AssetConstant.getFormData(),selectKeys); + List> list = new ArrayList<>(); + list.addAll(visualImportModel.getList()); + + ExportParams exportParams = new ExportParams(null, menuFullName + "模板"); + exportParams.setStyle(ExcelExportStyler.class); + exportParams.setType(ExcelType.XSSF); + exportParams.setFreezeCol(1); + try{ + @Cleanup Workbook workbook = new HSSFWorkbook(); + if (entitys.size()>0){ + if (list.size()==0){ + list.add(new HashMap<>()); + } + //复杂表头-表头和数据处理 + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(AssetConstant.getColumnData(), ColumnDataModel.class); + List complexHeaderList = columnDataModel.getComplexHeaderList(); + if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { + entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList, false); + list = VisualUtils.complexHeaderDataHandel(list, complexHeaderList, false); + } + + workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list); + ExcelHelper helper = new ExcelHelper(); + helper.init(workbook, exportParams, entitys, excelModel); + helper.doPreHandle(); + helper.doPostHandle(); + } + + String fileName = menuFullName + "错误报告_" + DateUtil.dateNow("yyyyMMddHHmmss") + ".xls"; + MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName); + String temporaryFilePath = configValueUtil.getTemporaryFilePath(); + FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName); + vo.setName(fileInfo.getFilename()); + vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName); + } catch (Exception e) { + e.printStackTrace(); + } + return ActionResult.success(vo); + } + /** + * 删除 + * @param id + * @return + */ + @Operation(summary = "删除") + @DeleteMapping("/{id}") + @Transactional + public ActionResult delete(@PathVariable("id") String id,@RequestParam(name = "forceDel",defaultValue = "false") boolean forceDel) throws Exception{ + AssetEntity entity= assetService.getInfo(id); + if(entity!=null){ + //假删除 + entity.setDeleteMark(1); + entity.setDeleteUserId(userProvider.get().getUserId()); + entity.setDeleteTime(new Date()); + assetService.setIgnoreLogicDelete().updateById(entity); + } + return ActionResult.success(MsgCode.SU003.get()); + } + /** + * 批量删除 + * @param obj + * @return + */ + @DeleteMapping("/batchRemove") + @Transactional + @Operation(summary = "批量删除") + public ActionResult batchRemove(@RequestBody Object obj){ + Map objectMap = JsonUtil.entityToMap(obj); + List idList = JsonUtil.getJsonToList(objectMap.get("ids"), String.class); + String errInfo = ""; + List successList = new ArrayList<>(); + for (String allId : idList){ + try { + this.delete(allId,false); + successList.add(allId); + } catch (Exception e) { + errInfo = e.getMessage(); + } + } + if (successList.size() == 0 && StringUtil.isNotEmpty(errInfo)){ + return ActionResult.fail(errInfo); + } + return ActionResult.success(MsgCode.SU003.get()); + } + /** + * 编辑 + * @param id + * @param assetForm + * @return + */ + @PutMapping("/{id}") + @Operation(summary = "更新") + public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid AssetForm assetForm, + @RequestParam(value = "isImport", required = false) boolean isImport){ + AssetEntity entity= assetService.getInfo(id); + if(entity!=null){ + assetForm.setAssetId(String.valueOf(entity.getAssetId())); + + if (!isImport) { + String b = assetService.checkForm(assetForm,1); + if (StringUtil.isNotEmpty(b)){ + return ActionResult.fail(b ); + } + } + + try{ + assetService.saveOrUpdate(assetForm,id,false); + }catch (DataException e1){ + return ActionResult.fail(e1.getMessage()); + }catch(Exception e){ + return ActionResult.fail(MsgCode.FA029.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + }else{ + return ActionResult.fail(MsgCode.FA002.get()); + } + } + /** + * 表单信息(详情页) + * 详情页面使用-转换数据 + * @param id + * @return + */ + @Operation(summary = "表单信息(详情页)") + @GetMapping("/detail/{id}") + public ActionResult detailInfo(@PathVariable("id") String id){ + AssetEntity entity= assetService.getInfo(id); + if(entity==null){ + return ActionResult.fail(MsgCode.FA001.get()); + } + Map assetMap=JsonUtil.entityToMap(entity); + assetMap.put("id", assetMap.get("asset_id")); + //副表数据 + //子表数据 + boolean isPc = "pc".equals(ServletUtil.getHeader("yunzhupaas-origin" )); + assetMap = generaterSwapUtil.swapDataDetail(assetMap,AssetConstant.getFormData(),"818770027560829701",isPc?false:false); + assetMap.put("supplier_id", companyService.getInfo(assetMap.get("supplier_id").toString()).getCompanyName()); + //子表数据 + return ActionResult.success(assetMap); + } + /** + * 获取详情(编辑页) + * 编辑页面使用-不转换数据 + * @param id + * @return + */ + @Operation(summary = "信息") + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id){ + AssetEntity entity= assetService.getInfo(id); + if(entity==null){ + return ActionResult.fail(MsgCode.FA001.get()); + } + Map assetMap=JsonUtil.entityToMap(entity); + assetMap.put("id", assetMap.get("asset_id")); + //副表数据 + //子表数据 + assetMap = generaterSwapUtil.swapDataForm(assetMap,AssetConstant.getFormData(),AssetConstant.TABLEFIELDKEY,AssetConstant.TABLERENAMES); + return ActionResult.success(assetMap); + } + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-controller/src/main/java/com/yunzhupaas/mdm/controller/CompanyController.java b/yunzhupaas-mdm/yunzhupaas-mdm-controller/src/main/java/com/yunzhupaas/mdm/controller/CompanyController.java new file mode 100644 index 0000000..65f7ab8 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-controller/src/main/java/com/yunzhupaas/mdm/controller/CompanyController.java @@ -0,0 +1,932 @@ +package com.yunzhupaas.mdm.controller; + + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.mdm.service.*; +import com.yunzhupaas.mdm.entity.*; +import com.yunzhupaas.util.*; +import com.yunzhupaas.mdm.model.company.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import com.yunzhupaas.flowable.entity.TaskEntity; +import jakarta.validation.Valid; +import java.util.*; +import com.yunzhupaas.model.ExcelModel; +import com.yunzhupaas.excel.ExcelExportStyler; +import com.yunzhupaas.excel.ExcelHelper; +import com.yunzhupaas.annotation.YunzhupaasField; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.base.entity.ProvinceEntity; +import java.io.IOException; +import java.util.stream.Collectors; +import com.yunzhupaas.flowable.entity.TaskEntity; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.model.visualJson.UploaderTemplateModel; +import com.yunzhupaas.base.util.FormExecelUtils; +import org.springframework.web.multipart.MultipartFile; +import cn.afterturn.easypoi.excel.ExcelExportUtil; +import cn.afterturn.easypoi.excel.ExcelImportUtil; +import cn.afterturn.easypoi.excel.entity.ExportParams; +import cn.afterturn.easypoi.excel.entity.ImportParams; +import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; +import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.Workbook; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import com.yunzhupaas.onlinedev.model.ExcelImFieldModel; +import com.yunzhupaas.base.model.OnlineImport.ImportDataModel; +import com.yunzhupaas.base.model.OnlineImport.ImportFormCheckUniqueModel; +import com.yunzhupaas.base.model.OnlineImport.ExcelImportModel; +import com.yunzhupaas.base.model.OnlineImport.VisualImportModel; +import cn.xuyanwu.spring.file.storage.FileInfo; +import lombok.Cleanup; +import com.yunzhupaas.model.visualJson.config.HeaderModel; +import com.yunzhupaas.base.model.ColumnDataModel; +import com.yunzhupaas.base.util.VisualUtils; +import org.springframework.transaction.annotation.Transactional; + +/** + * 企业信息 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-24 + */ +@Slf4j +@RestController +@Tag(name = "企业信息" , description = "bcm") +@RequestMapping("/api/bcm/Company") +public class CompanyController { + + @Autowired + private GeneraterSwapUtil generaterSwapUtil; + + @Autowired + private UserProvider userProvider; + + @Autowired + private CompanyService companyService; + + @Autowired + private CompanyBankService mdmCompanyBankService; + @Autowired + private CompanyInvoiceService companyInvoiceService; + + + @Autowired + private ConfigValueUtil configValueUtil; + + /** + * 列表 + * + * @param companyPagination + * @return + */ + @Operation(summary = "获取列表") + @PostMapping("/getList") + public ActionResult list(@RequestBody CompanyPagination companyPagination)throws Exception{ + List list= companyService.getList(companyPagination); + List> realList=new ArrayList<>(); + for (CompanyEntity entity : list) { + Map companyMap=JsonUtil.entityToMap(entity); + companyMap.put("id", companyMap.get("company_id")); + //副表数据 + //子表数据 + List mdmCompanyBankList = entity.getCompanyBank(); + companyMap.put("tableFieldad9d92",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(mdmCompanyBankList))); + companyMap.put("mdmCompanyBankList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(mdmCompanyBankList))); + List companyInvoiceList = entity.getCompanyInvoice(); + companyMap.put("tableField46dc53",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyInvoiceList))); + companyMap.put("companyInvoiceList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyInvoiceList))); + realList.add(companyMap); + } + //数据转换 + boolean isPc = "pc".equals(ServletUtil.getHeader("yunzhupaas-origin" )); + realList = generaterSwapUtil.swapDataList(realList, CompanyConstant.getFormData(), CompanyConstant.getColumnData(), companyPagination.getModuleId(),isPc?false:false); + + //返回对象 + PageListVO vo = new PageListVO(); + vo.setList(realList); + PaginationVO page = JsonUtil.getJsonToBean(companyPagination, PaginationVO.class); + vo.setPagination(page); + return ActionResult.success(vo); + } + /** + * 创建 + * + * @param companyForm + * @return + */ + @PostMapping() + @Operation(summary = "创建") + public ActionResult create(@RequestBody @Valid CompanyForm companyForm) { + String b = companyService.checkForm(companyForm,0); + if (StringUtil.isNotEmpty(b)){ + return ActionResult.fail(b ); + } + try{ + companyService.saveOrUpdate(companyForm, null ,true); + }catch(Exception e){ + return ActionResult.fail(MsgCode.FA028.get()); + } + return ActionResult.success(MsgCode.SU001.get()); + } + /** + * 导出Excel + * + * @return + */ + @Operation(summary = "导出Excel") + @PostMapping("/Actions/Export") + public ActionResult Export(@RequestBody CompanyPagination companyPagination) throws IOException { + if (StringUtil.isEmpty(companyPagination.getSelectKey())){ + return ActionResult.fail(MsgCode.IMP011.get()); + } + List list= companyService.getList(companyPagination); + List> realList=new ArrayList<>(); + for (CompanyEntity entity : list) { + Map companyMap=JsonUtil.entityToMap(entity); + companyMap.put("id", companyMap.get("company_id")); + //副表数据 + //子表数据 + List mdmCompanyBankList = entity.getCompanyBank(); + companyMap.put("tableFieldad9d92",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(mdmCompanyBankList))); + companyMap.put("mdmCompanyBankList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(mdmCompanyBankList))); + List companyInvoiceList = entity.getCompanyInvoice(); + companyMap.put("tableField46dc53",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyInvoiceList))); + companyMap.put("companyInvoiceList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyInvoiceList))); + realList.add(companyMap); + } + //数据转换 + realList = generaterSwapUtil.swapDataList(realList, CompanyConstant.getFormData(), CompanyConstant.getColumnData(), companyPagination.getModuleId(),false); + String[]keys=!StringUtil.isEmpty(companyPagination.getSelectKey())?companyPagination.getSelectKey():new String[0]; + UserInfo userInfo=userProvider.get(); + String menuFullName = generaterSwapUtil.getMenuName(companyPagination.getMenuId()); + + DownloadVO vo=this.creatModelExcel(configValueUtil.getTemporaryFilePath(),realList,keys,userInfo,menuFullName); + return ActionResult.success(vo); + } + + /** + * 导出表格方法 + */ + public DownloadVO creatModelExcel(String path,List>list,String[]keys,UserInfo userInfo,String menuFullName){ + DownloadVO vo=DownloadVO.builder().build(); + List entitys=new ArrayList<>(); + if(keys.length>0){ + ExcelExportEntity tableFieldad9d92ExcelEntity = new ExcelExportEntity("设计子表(tableFieldad9d92)","tableFieldad9d92"); + List tableFieldad9d92List = new ArrayList<>(); + ExcelExportEntity tableField46dc53ExcelEntity = new ExcelExportEntity("设计子表(tableField46dc53)","tableField46dc53"); + List tableField46dc53List = new ArrayList<>(); + for(String key:keys){ + switch(key){ + case "company_code" : + entitys.add(new ExcelExportEntity("企业编码" ,"company_code")); + break; + case "company_name" : + entitys.add(new ExcelExportEntity("企业名称" ,"company_name")); + break; + case "short_name" : + entitys.add(new ExcelExportEntity("简称/昵称" ,"short_name")); + break; + case "entity_type" : + entitys.add(new ExcelExportEntity("类型" ,"entity_type")); + break; + case "credit_code" : + entitys.add(new ExcelExportEntity("社会信用代码" ,"credit_code")); + break; + case "org_id" : + entitys.add(new ExcelExportEntity("归属组织" ,"org_id")); + break; + case "province_id" : + entitys.add(new ExcelExportEntity("所属地区" ,"province_id")); + break; + case "tax_type" : + entitys.add(new ExcelExportEntity("纳税人类别" ,"tax_type")); + break; + case "enterprise_scale" : + entitys.add(new ExcelExportEntity("企业规模" ,"enterprise_scale")); + break; + case "enterprise_nature" : + entitys.add(new ExcelExportEntity("企业类型" ,"enterprise_nature")); + break; + case "industry_code" : + entitys.add(new ExcelExportEntity("行业代码" ,"industry_code")); + break; + case "registration_date" : + entitys.add(new ExcelExportEntity("成立日期" ,"registration_date")); + break; + case "registered_capital" : + entitys.add(new ExcelExportEntity("注册资本" ,"registered_capital")); + break; + case "legal_representative" : + entitys.add(new ExcelExportEntity("法定代表人" ,"legal_representative")); + break; + case "phone" : + entitys.add(new ExcelExportEntity("联系电话" ,"phone")); + break; + case "email" : + entitys.add(new ExcelExportEntity("邮箱" ,"email")); + break; + case "website" : + entitys.add(new ExcelExportEntity("网站" ,"website")); + break; + case "address" : + entitys.add(new ExcelExportEntity("地址" ,"address")); + break; + case "business_scope" : + entitys.add(new ExcelExportEntity("经营范围" ,"business_scope")); + break; + case "remark" : + entitys.add(new ExcelExportEntity("备注" ,"remark")); + break; + case "tableFieldad9d92-bank_name": + tableFieldad9d92List.add(new ExcelExportEntity("开户行" ,"bank_name")); + break; + case "tableFieldad9d92-bank_account_name": + tableFieldad9d92List.add(new ExcelExportEntity("账户名" ,"bank_account_name")); + break; + case "tableFieldad9d92-bank_account_number": + tableFieldad9d92List.add(new ExcelExportEntity("银行账号" ,"bank_account_number")); + break; + case "tableFieldad9d92-bank_province": + tableFieldad9d92List.add(new ExcelExportEntity("开户行城市" ,"bank_province")); + break; + case "tableFieldad9d92-remark": + tableFieldad9d92List.add(new ExcelExportEntity("备注" ,"remark")); + break; + case "tableField46dc53-title_code": + tableField46dc53List.add(new ExcelExportEntity("发票抬头编码" ,"title_code")); + break; + case "tableField46dc53-title_name": + tableField46dc53List.add(new ExcelExportEntity("发票抬头名称" ,"title_name")); + break; + case "tableField46dc53-credit_code": + tableField46dc53List.add(new ExcelExportEntity("纳税人识别号" ,"credit_code")); + break; + case "tableField46dc53-tax_type": + tableField46dc53List.add(new ExcelExportEntity("纳税人类别" ,"tax_type")); + break; + case "tableField46dc53-address": + tableField46dc53List.add(new ExcelExportEntity("地址" ,"address")); + break; + case "tableField46dc53-phone": + tableField46dc53List.add(new ExcelExportEntity("电话" ,"phone")); + break; + case "tableField46dc53-bank_name": + tableField46dc53List.add(new ExcelExportEntity("开户银行" ,"bank_name")); + break; + case "tableField46dc53-bank_account": + tableField46dc53List.add(new ExcelExportEntity("银行账户" ,"bank_account")); + break; + case "tableField46dc53-is_defalut": + tableField46dc53List.add(new ExcelExportEntity("是否默认" ,"is_defalut")); + break; + case "tableField46dc53-is_valid": + tableField46dc53List.add(new ExcelExportEntity("是否有效" ,"is_valid")); + break; + case "tableField46dc53-remark": + tableField46dc53List.add(new ExcelExportEntity("备注" ,"remark")); + break; + default: + break; + } + } + if(tableFieldad9d92List.size() > 0){ + tableFieldad9d92ExcelEntity.setList(tableFieldad9d92List); + entitys.add(tableFieldad9d92ExcelEntity); + } + if(tableField46dc53List.size() > 0){ + tableField46dc53ExcelEntity.setList(tableField46dc53List); + entitys.add(tableField46dc53ExcelEntity); + } + } + + ExportParams exportParams = new ExportParams(null, "表单信息"); + exportParams.setType(ExcelType.XSSF); + try{ + @Cleanup Workbook workbook = new HSSFWorkbook(); + if (entitys.size()>0){ + if (list.size()==0){ + list.add(new HashMap<>()); + } + //去除空数据 + List> dataList = new ArrayList<>(); + for (Map map : list) { + int i = 0; + for (String key : keys) { + //子表 + if (key.toLowerCase().startsWith("tablefield")) { + String tableField = key.substring(0, key.indexOf("-" )); + String field = key.substring(key.indexOf("-" ) + 1); + Object o = map.get(tableField); + if (o != null) { + List> childList = (List>) o; + for (Map childMap : childList) { + if (childMap.get(field) != null) { + i++; + } + } + } + } else { + Object o = map.get(key); + if (o != null) { + i++; + } + } + } + if (i > 0) { + dataList.add(map); + } + } + List mergerEntitys = new ArrayList<>(entitys); + List> mergerList=new ArrayList<>(dataList); + //复杂表头-表头和数据处理 + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(CompanyConstant.getColumnData(), ColumnDataModel.class); + List complexHeaderList = columnDataModel.getComplexHeaderList(); + if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { + entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList, Objects.equals(columnDataModel.getType(), 4)); + dataList = VisualUtils.complexHeaderDataHandel(dataList, complexHeaderList, Objects.equals(columnDataModel.getType(), 4)); + } + + exportParams.setStyle(ExcelExportStyler.class); + workbook = ExcelExportUtil.exportExcel(exportParams, entitys, dataList); + VisualUtils.mergerVertical(workbook, mergerEntitys, mergerList); + ExcelModel excelModel = generaterSwapUtil.getExcelParams(CompanyConstant.getFormData(),Arrays.asList(keys)); + ExcelHelper helper = new ExcelHelper(); + helper.init(workbook, exportParams, entitys, excelModel); + helper.doPreHandle(); + helper.doPostHandle(); + } + String fileName = menuFullName +"_"+ DateUtil.dateNow("yyyyMMddHHmmss") + ".xls"; + MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName); + String temporaryFilePath = configValueUtil.getTemporaryFilePath(); + FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName); + vo.setName(fileInfo.getFilename()); + vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName); + } catch (Exception e) { + log.error("信息导出Excel错误:{}", e.getMessage()); + e.printStackTrace(); + } + return vo; + } + @Operation(summary = "上传文件") + @PostMapping("/Uploader") + public ActionResult Uploader() { + List list = UpUtil.getFileAll(); + MultipartFile file = list.get(0); + if (file.getOriginalFilename().endsWith(".xlsx") || file.getOriginalFilename().endsWith(".xls")) { + String filePath = XSSEscape.escape(configValueUtil.getTemporaryFilePath()); + String fileName = XSSEscape.escape(RandomUtil.uuId() + "." + UpUtil.getFileType(file)); + //上传文件 + FileInfo fileInfo = FileUploadUtils.uploadFile(file, filePath, fileName); + DownloadVO vo = DownloadVO.builder().build(); + vo.setName(fileInfo.getFilename()); + return ActionResult.success(vo); + } else { + return ActionResult.fail(MsgCode.FA017.get()); + } + } + + /** + * 模板下载 + * + * @return + */ + @Operation(summary = "模板下载") + @GetMapping("/TemplateDownload") + public ActionResult TemplateDownload(@RequestParam("menuId") String menuId){ + DownloadVO vo = DownloadVO.builder().build(); + UserInfo userInfo = userProvider.get(); + String menuFullName = generaterSwapUtil.getMenuName(menuId); + //主表对象 + List entitys = new ArrayList<>(); + List selectKeys = new ArrayList<>(); + //以下添加字段 + entitys.add(new ExcelExportEntity("企业名称(company_name)" ,"company_name")); + selectKeys.add("company_name"); + entitys.add(new ExcelExportEntity("社会信用代码(credit_code)" ,"credit_code")); + selectKeys.add("credit_code"); + entitys.add(new ExcelExportEntity("归属组织(org_id)" ,"org_id")); + selectKeys.add("org_id"); + entitys.add(new ExcelExportEntity("企业编码(company_code)" ,"company_code")); + selectKeys.add("company_code"); + entitys.add(new ExcelExportEntity("简称/昵称(short_name)" ,"short_name")); + selectKeys.add("short_name"); + entitys.add(new ExcelExportEntity("类型(entity_type)" ,"entity_type")); + selectKeys.add("entity_type"); + entitys.add(new ExcelExportEntity("纳税人类别(tax_type)" ,"tax_type")); + selectKeys.add("tax_type"); + entitys.add(new ExcelExportEntity("企业规模(enterprise_scale)" ,"enterprise_scale")); + selectKeys.add("enterprise_scale"); + entitys.add(new ExcelExportEntity("企业类型(enterprise_nature)" ,"enterprise_nature")); + selectKeys.add("enterprise_nature"); + entitys.add(new ExcelExportEntity("行业代码(industry_code)" ,"industry_code")); + selectKeys.add("industry_code"); + entitys.add(new ExcelExportEntity("成立日期(registration_date)" ,"registration_date")); + selectKeys.add("registration_date"); + entitys.add(new ExcelExportEntity("注册资本(registered_capital)" ,"registered_capital")); + selectKeys.add("registered_capital"); + entitys.add(new ExcelExportEntity("法定代表人(legal_representative)" ,"legal_representative")); + selectKeys.add("legal_representative"); + entitys.add(new ExcelExportEntity("联系电话(phone)" ,"phone")); + selectKeys.add("phone"); + entitys.add(new ExcelExportEntity("邮箱(email)" ,"email")); + selectKeys.add("email"); + entitys.add(new ExcelExportEntity("网站(website)" ,"website")); + selectKeys.add("website"); + entitys.add(new ExcelExportEntity("地址(address)" ,"address")); + selectKeys.add("address"); + entitys.add(new ExcelExportEntity("所属地区(province_id)" ,"province_id")); + selectKeys.add("province_id"); + entitys.add(new ExcelExportEntity("经营范围(business_scope)" ,"business_scope")); + selectKeys.add("business_scope"); + entitys.add(new ExcelExportEntity("备注(remark)" ,"remark")); + selectKeys.add("remark"); + //tableFieldad9d92子表对象 + ExcelExportEntity tableFieldad9d92ExcelEntity = new ExcelExportEntity("设计子表(tableFieldad9d92)","tableFieldad9d92"); + List tableFieldad9d92ExcelEntityList = new ArrayList<>(); + tableFieldad9d92ExcelEntityList.add(new ExcelExportEntity("开户行(tableFieldad9d92-bank_name)" ,"bank_name")); + selectKeys.add("tableFieldad9d92-bank_name"); + tableFieldad9d92ExcelEntityList.add(new ExcelExportEntity("账户名(tableFieldad9d92-bank_account_name)" ,"bank_account_name")); + selectKeys.add("tableFieldad9d92-bank_account_name"); + tableFieldad9d92ExcelEntityList.add(new ExcelExportEntity("银行账号(tableFieldad9d92-bank_account_number)" ,"bank_account_number")); + selectKeys.add("tableFieldad9d92-bank_account_number"); + tableFieldad9d92ExcelEntityList.add(new ExcelExportEntity("开户行城市(tableFieldad9d92-bank_province)" ,"bank_province")); + selectKeys.add("tableFieldad9d92-bank_province"); + tableFieldad9d92ExcelEntityList.add(new ExcelExportEntity("备注(tableFieldad9d92-remark)" ,"remark")); + selectKeys.add("tableFieldad9d92-remark"); + tableFieldad9d92ExcelEntity.setList(tableFieldad9d92ExcelEntityList); + if(tableFieldad9d92ExcelEntityList.size() > 0){ + entitys.add(tableFieldad9d92ExcelEntity); + } + //tableField46dc53子表对象 + ExcelExportEntity tableField46dc53ExcelEntity = new ExcelExportEntity("设计子表(tableField46dc53)","tableField46dc53"); + List tableField46dc53ExcelEntityList = new ArrayList<>(); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("发票抬头名称(tableField46dc53-title_name)" ,"title_name")); + selectKeys.add("tableField46dc53-title_name"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("纳税人识别号(tableField46dc53-credit_code)" ,"credit_code")); + selectKeys.add("tableField46dc53-credit_code"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("纳税人类别(tableField46dc53-tax_type)" ,"tax_type")); + selectKeys.add("tableField46dc53-tax_type"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("地址(tableField46dc53-address)" ,"address")); + selectKeys.add("tableField46dc53-address"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("电话(tableField46dc53-phone)" ,"phone")); + selectKeys.add("tableField46dc53-phone"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("开户银行(tableField46dc53-bank_name)" ,"bank_name")); + selectKeys.add("tableField46dc53-bank_name"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("银行账户(tableField46dc53-bank_account)" ,"bank_account")); + selectKeys.add("tableField46dc53-bank_account"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("是否默认(tableField46dc53-is_defalut)" ,"is_defalut")); + selectKeys.add("tableField46dc53-is_defalut"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("是否有效(tableField46dc53-is_valid)" ,"is_valid")); + selectKeys.add("tableField46dc53-is_valid"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("备注(tableField46dc53-remark)" ,"remark")); + selectKeys.add("tableField46dc53-remark"); + tableField46dc53ExcelEntity.setList(tableField46dc53ExcelEntityList); + if(tableField46dc53ExcelEntityList.size() > 0){ + entitys.add(tableField46dc53ExcelEntity); + } + ExcelModel excelModel = generaterSwapUtil.getExcelParams(CompanyConstant.getFormData(),selectKeys); + List> list = new ArrayList<>(); + list.add(excelModel.getDataMap()); + + ExportParams exportParams = new ExportParams(null, menuFullName + "模板"); + exportParams.setStyle(ExcelExportStyler.class); + exportParams.setType(ExcelType.XSSF); + try{ + @Cleanup Workbook workbook = new HSSFWorkbook(); + if (entitys.size()>0){ + if (list.size()==0){ + list.add(new HashMap<>()); + } + //复杂表头-表头和数据处理 + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(CompanyConstant.getColumnData(), ColumnDataModel.class); + List complexHeaderList = columnDataModel.getComplexHeaderList(); + if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { + entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList, false); + list = VisualUtils.complexHeaderDataHandel(list, complexHeaderList, false); + } + workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list); + ExcelHelper helper = new ExcelHelper(); + helper.init(workbook, exportParams, entitys, excelModel); + helper.doPreHandle(); + helper.doPostHandle(); + } + String fileName = menuFullName + "导入模板.xls"; + MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName); + String temporaryFilePath = configValueUtil.getTemporaryFilePath(); + FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName); + vo.setName(fileInfo.getFilename()); + vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName); + } catch (Exception e) { + log.error("模板信息导出Excel错误:{}", e.getMessage()); + e.printStackTrace(); + } + return ActionResult.success(vo); + } + + /** + * 导入预览 + * + * @return + */ + @Operation(summary = "导入预览" ) + @GetMapping("/ImportPreview") + public ActionResult> ImportPreview(String fileName) throws Exception { + Map headAndDataMap = new HashMap<>(2); + String filePath = FileUploadUtils.getLocalBasePath() + configValueUtil.getTemporaryFilePath(); + FileUploadUtils.downLocal(configValueUtil.getTemporaryFilePath(), filePath, fileName); + File temporary = new File(XSSEscape.escapePath(filePath + fileName)); + int headerRowIndex = 2; + ImportParams params = new ImportParams(); + params.setTitleRows(0); + params.setHeadRows(headerRowIndex); + params.setNeedVerify(true); + try { + InputStream inputStream = ExcelUtil.solveOrginTitle(temporary, headerRowIndex); + List excelDataList = ExcelUtil.importExcelByInputStream(inputStream, 0, headerRowIndex, Map.class); + //数据超过1000条 + if(excelDataList != null && excelDataList.size() > 1000) { + return ActionResult.fail(MsgCode.ETD117.get()); + } + + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(CompanyConstant.getColumnData(), ColumnDataModel.class); + UploaderTemplateModel uploaderTemplateModel = JsonUtil.getJsonToBean(columnDataModel.getUploaderTemplateJson(), UploaderTemplateModel.class); + List selectKey = uploaderTemplateModel.getSelectKey(); + //子表合并 + List> results = FormExecelUtils.dataMergeChildTable(excelDataList,selectKey); + // 导入字段 + List columns = new ArrayList<>(); + columns.add(new ExcelImFieldModel("company_name","企业名称","input")); + columns.add(new ExcelImFieldModel("credit_code","社会信用代码","input")); + columns.add(new ExcelImFieldModel("org_id","归属组织","organizeSelect")); + columns.add(new ExcelImFieldModel("company_code","企业编码","billRule")); + columns.add(new ExcelImFieldModel("short_name","简称/昵称","input")); + columns.add(new ExcelImFieldModel("entity_type","类型","radio")); + columns.add(new ExcelImFieldModel("tax_type","纳税人类别","select")); + columns.add(new ExcelImFieldModel("enterprise_scale","企业规模","select")); + columns.add(new ExcelImFieldModel("enterprise_nature","企业类型","select")); + columns.add(new ExcelImFieldModel("industry_code","行业代码","select")); + columns.add(new ExcelImFieldModel("registration_date","成立日期","datePicker")); + columns.add(new ExcelImFieldModel("registered_capital","注册资本","inputNumber")); + columns.add(new ExcelImFieldModel("legal_representative","法定代表人","input")); + columns.add(new ExcelImFieldModel("phone","联系电话","input")); + columns.add(new ExcelImFieldModel("email","邮箱","input")); + columns.add(new ExcelImFieldModel("website","网站","input")); + columns.add(new ExcelImFieldModel("address","地址","input")); + columns.add(new ExcelImFieldModel("province_id","所属地区","areaSelect")); + columns.add(new ExcelImFieldModel("business_scope","经营范围","textarea")); + columns.add(new ExcelImFieldModel("remark","备注","textarea")); + //tableFieldad9d92子表对象 + List tableFieldad9d92columns = new ArrayList<>(); + tableFieldad9d92columns.add(new ExcelImFieldModel("bank_name" ,"开户行")); + tableFieldad9d92columns.add(new ExcelImFieldModel("bank_account_name" ,"账户名")); + tableFieldad9d92columns.add(new ExcelImFieldModel("bank_account_number" ,"银行账号")); + tableFieldad9d92columns.add(new ExcelImFieldModel("bank_province" ,"开户行城市")); + tableFieldad9d92columns.add(new ExcelImFieldModel("remark" ,"备注")); + columns.add(new ExcelImFieldModel("tableFieldad9d92","设计子表","table",tableFieldad9d92columns)); + //tableField46dc53子表对象 + List tableField46dc53columns = new ArrayList<>(); + tableField46dc53columns.add(new ExcelImFieldModel("title_name" ,"发票抬头名称")); + tableField46dc53columns.add(new ExcelImFieldModel("credit_code" ,"纳税人识别号")); + tableField46dc53columns.add(new ExcelImFieldModel("tax_type" ,"纳税人类别")); + tableField46dc53columns.add(new ExcelImFieldModel("address" ,"地址")); + tableField46dc53columns.add(new ExcelImFieldModel("phone" ,"电话")); + tableField46dc53columns.add(new ExcelImFieldModel("bank_name" ,"开户银行")); + tableField46dc53columns.add(new ExcelImFieldModel("bank_account" ,"银行账户")); + tableField46dc53columns.add(new ExcelImFieldModel("is_defalut" ,"是否默认")); + tableField46dc53columns.add(new ExcelImFieldModel("is_valid" ,"是否有效")); + tableField46dc53columns.add(new ExcelImFieldModel("remark" ,"备注")); + columns.add(new ExcelImFieldModel("tableField46dc53","设计子表","table",tableField46dc53columns)); + headAndDataMap.put("dataRow" , results); + headAndDataMap.put("headerRow" , JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(columns))); + } catch (Exception e){ + e.printStackTrace(); + return ActionResult.fail(MsgCode.VS407.get()); + } + return ActionResult.success(headAndDataMap); + } + + /** + * 导入数据 + * + * @return + */ + @Operation(summary = "导入数据" ) + @PostMapping("/ImportData") + public ActionResult ImportData(@RequestBody VisualImportModel visualImportModel) throws Exception { + List> listData = visualImportModel.getList(); + ImportFormCheckUniqueModel uniqueModel = new ImportFormCheckUniqueModel(); + uniqueModel.setDbLinkId(CompanyConstant.DBLINKID); + uniqueModel.setUpdate(Objects.equals("2", "2")); + + Map tablefieldkey = new HashMap<>(); + for(String key:CompanyConstant.TABLEFIELDKEY.keySet()){ + tablefieldkey.put(key,CompanyConstant.TABLERENAMES.get(CompanyConstant.TABLEFIELDKEY.get(key))); + } + ExcelImportModel excelImportModel = generaterSwapUtil.importData(CompanyConstant.getFormData(),listData,uniqueModel, tablefieldkey,CompanyConstant.getTableList()); + List importDataModel = uniqueModel.getImportDataModel(); + for (ImportDataModel model : importDataModel) { + String id = model.getId(); + Map result = model.getResultData(); + if(StringUtil.isNotEmpty(id)){ + update(id, JsonUtil.getJsonToBean(result,CompanyForm.class), true); + }else { + create( JsonUtil.getJsonToBean(result,CompanyForm.class)); + } + } + return ActionResult.success(excelImportModel); + } + + /** + * 导出异常报告 + * + * @return + */ + @Operation(summary = "导出异常报告") + @PostMapping("/ImportExceptionData") + public ActionResult ImportExceptionData(@RequestBody VisualImportModel visualImportModel) { + DownloadVO vo = DownloadVO.builder().build(); + UserInfo userInfo = userProvider.get(); + String menuFullName = generaterSwapUtil.getMenuName(visualImportModel.getMenuId()); + //主表对象 + List entitys = new ArrayList<>(); + entitys.add(new ExcelExportEntity("异常原因", "errorsInfo",30)); + List selectKeys = new ArrayList<>(); + //以下添加字段 + entitys.add(new ExcelExportEntity("企业名称(company_name)" ,"company_name")); + selectKeys.add("company_name"); + entitys.add(new ExcelExportEntity("社会信用代码(credit_code)" ,"credit_code")); + selectKeys.add("credit_code"); + entitys.add(new ExcelExportEntity("归属组织(org_id)" ,"org_id")); + selectKeys.add("org_id"); + entitys.add(new ExcelExportEntity("企业编码(company_code)" ,"company_code")); + selectKeys.add("company_code"); + entitys.add(new ExcelExportEntity("简称/昵称(short_name)" ,"short_name")); + selectKeys.add("short_name"); + entitys.add(new ExcelExportEntity("类型(entity_type)" ,"entity_type")); + selectKeys.add("entity_type"); + entitys.add(new ExcelExportEntity("纳税人类别(tax_type)" ,"tax_type")); + selectKeys.add("tax_type"); + entitys.add(new ExcelExportEntity("企业规模(enterprise_scale)" ,"enterprise_scale")); + selectKeys.add("enterprise_scale"); + entitys.add(new ExcelExportEntity("企业类型(enterprise_nature)" ,"enterprise_nature")); + selectKeys.add("enterprise_nature"); + entitys.add(new ExcelExportEntity("行业代码(industry_code)" ,"industry_code")); + selectKeys.add("industry_code"); + entitys.add(new ExcelExportEntity("成立日期(registration_date)" ,"registration_date")); + selectKeys.add("registration_date"); + entitys.add(new ExcelExportEntity("注册资本(registered_capital)" ,"registered_capital")); + selectKeys.add("registered_capital"); + entitys.add(new ExcelExportEntity("法定代表人(legal_representative)" ,"legal_representative")); + selectKeys.add("legal_representative"); + entitys.add(new ExcelExportEntity("联系电话(phone)" ,"phone")); + selectKeys.add("phone"); + entitys.add(new ExcelExportEntity("邮箱(email)" ,"email")); + selectKeys.add("email"); + entitys.add(new ExcelExportEntity("网站(website)" ,"website")); + selectKeys.add("website"); + entitys.add(new ExcelExportEntity("地址(address)" ,"address")); + selectKeys.add("address"); + entitys.add(new ExcelExportEntity("所属地区(province_id)" ,"province_id")); + selectKeys.add("province_id"); + entitys.add(new ExcelExportEntity("经营范围(business_scope)" ,"business_scope")); + selectKeys.add("business_scope"); + entitys.add(new ExcelExportEntity("备注(remark)" ,"remark")); + selectKeys.add("remark"); + //tableFieldad9d92子表对象 + ExcelExportEntity tableFieldad9d92ExcelEntity = new ExcelExportEntity("设计子表(tableFieldad9d92)","tableFieldad9d92"); + List tableFieldad9d92ExcelEntityList = new ArrayList<>(); + tableFieldad9d92ExcelEntityList.add(new ExcelExportEntity("开户行(tableFieldad9d92-bank_name)" ,"bank_name")); + selectKeys.add("tableFieldad9d92-bank_name"); + tableFieldad9d92ExcelEntityList.add(new ExcelExportEntity("账户名(tableFieldad9d92-bank_account_name)" ,"bank_account_name")); + selectKeys.add("tableFieldad9d92-bank_account_name"); + tableFieldad9d92ExcelEntityList.add(new ExcelExportEntity("银行账号(tableFieldad9d92-bank_account_number)" ,"bank_account_number")); + selectKeys.add("tableFieldad9d92-bank_account_number"); + tableFieldad9d92ExcelEntityList.add(new ExcelExportEntity("开户行城市(tableFieldad9d92-bank_province)" ,"bank_province")); + selectKeys.add("tableFieldad9d92-bank_province"); + tableFieldad9d92ExcelEntityList.add(new ExcelExportEntity("备注(tableFieldad9d92-remark)" ,"remark")); + selectKeys.add("tableFieldad9d92-remark"); + tableFieldad9d92ExcelEntity.setList(tableFieldad9d92ExcelEntityList); + entitys.add(tableFieldad9d92ExcelEntity); + //tableField46dc53子表对象 + ExcelExportEntity tableField46dc53ExcelEntity = new ExcelExportEntity("设计子表(tableField46dc53)","tableField46dc53"); + List tableField46dc53ExcelEntityList = new ArrayList<>(); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("发票抬头名称(tableField46dc53-title_name)" ,"title_name")); + selectKeys.add("tableField46dc53-title_name"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("纳税人识别号(tableField46dc53-credit_code)" ,"credit_code")); + selectKeys.add("tableField46dc53-credit_code"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("纳税人类别(tableField46dc53-tax_type)" ,"tax_type")); + selectKeys.add("tableField46dc53-tax_type"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("地址(tableField46dc53-address)" ,"address")); + selectKeys.add("tableField46dc53-address"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("电话(tableField46dc53-phone)" ,"phone")); + selectKeys.add("tableField46dc53-phone"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("开户银行(tableField46dc53-bank_name)" ,"bank_name")); + selectKeys.add("tableField46dc53-bank_name"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("银行账户(tableField46dc53-bank_account)" ,"bank_account")); + selectKeys.add("tableField46dc53-bank_account"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("是否默认(tableField46dc53-is_defalut)" ,"is_defalut")); + selectKeys.add("tableField46dc53-is_defalut"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("是否有效(tableField46dc53-is_valid)" ,"is_valid")); + selectKeys.add("tableField46dc53-is_valid"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("备注(tableField46dc53-remark)" ,"remark")); + selectKeys.add("tableField46dc53-remark"); + tableField46dc53ExcelEntity.setList(tableField46dc53ExcelEntityList); + entitys.add(tableField46dc53ExcelEntity); + ExcelModel excelModel = generaterSwapUtil.getExcelParams(CompanyConstant.getFormData(),selectKeys); + List> list = new ArrayList<>(); + list.addAll(visualImportModel.getList()); + + ExportParams exportParams = new ExportParams(null, menuFullName + "模板"); + exportParams.setStyle(ExcelExportStyler.class); + exportParams.setType(ExcelType.XSSF); + exportParams.setFreezeCol(1); + try{ + @Cleanup Workbook workbook = new HSSFWorkbook(); + if (entitys.size()>0){ + if (list.size()==0){ + list.add(new HashMap<>()); + } + //复杂表头-表头和数据处理 + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(CompanyConstant.getColumnData(), ColumnDataModel.class); + List complexHeaderList = columnDataModel.getComplexHeaderList(); + if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { + entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList, false); + list = VisualUtils.complexHeaderDataHandel(list, complexHeaderList, false); + } + + workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list); + ExcelHelper helper = new ExcelHelper(); + helper.init(workbook, exportParams, entitys, excelModel); + helper.doPreHandle(); + helper.doPostHandle(); + } + + String fileName = menuFullName + "错误报告_" + DateUtil.dateNow("yyyyMMddHHmmss") + ".xls"; + MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName); + String temporaryFilePath = configValueUtil.getTemporaryFilePath(); + FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName); + vo.setName(fileInfo.getFilename()); + vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName); + } catch (Exception e) { + e.printStackTrace(); + } + return ActionResult.success(vo); + } + /** + * 删除 + * @param id + * @return + */ + @Operation(summary = "删除") + @DeleteMapping("/{id}") + @Transactional + public ActionResult delete(@PathVariable("id") String id,@RequestParam(name = "forceDel",defaultValue = "false") boolean forceDel) throws Exception{ + CompanyEntity entity= companyService.getInfo(id); + if(entity!=null){ + //主表数据删除 + companyService.delete(entity); + QueryWrapper queryWrapperMdmCompanyBank=new QueryWrapper<>(); + queryWrapperMdmCompanyBank.lambda().eq(CompanyBankEntity::getCompanyId,entity.getCompanyId()); + //子表数据删除 + mdmCompanyBankService.remove(queryWrapperMdmCompanyBank); + QueryWrapper queryWrapperCompanyInvoice=new QueryWrapper<>(); + queryWrapperCompanyInvoice.lambda().eq(CompanyInvoiceEntity::getCompanyId,entity.getCompanyId()); + //子表数据删除 + companyInvoiceService.remove(queryWrapperCompanyInvoice); + } + return ActionResult.success(MsgCode.SU003.get()); + } + /** + * 批量删除 + * @param obj + * @return + */ + @DeleteMapping("/batchRemove") + @Transactional + @Operation(summary = "批量删除") + public ActionResult batchRemove(@RequestBody Object obj){ + Map objectMap = JsonUtil.entityToMap(obj); + List idList = JsonUtil.getJsonToList(objectMap.get("ids"), String.class); + String errInfo = ""; + List successList = new ArrayList<>(); + for (String allId : idList){ + try { + this.delete(allId,false); + successList.add(allId); + } catch (Exception e) { + errInfo = e.getMessage(); + } + } + if (successList.size() == 0 && StringUtil.isNotEmpty(errInfo)){ + return ActionResult.fail(errInfo); + } + return ActionResult.success(MsgCode.SU003.get()); + } + /** + * 编辑 + * @param id + * @param companyForm + * @return + */ + @PutMapping("/{id}") + @Operation(summary = "更新") + public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid CompanyForm companyForm, + @RequestParam(value = "isImport", required = false) boolean isImport){ + CompanyEntity entity= companyService.getInfo(id); + if(entity!=null){ + companyForm.setCompanyId(String.valueOf(entity.getCompanyId())); + + if (!isImport) { + String b = companyService.checkForm(companyForm,1); + if (StringUtil.isNotEmpty(b)){ + return ActionResult.fail(b ); + } + } + + try{ + companyService.saveOrUpdate(companyForm,id,false); + }catch (DataException e1){ + return ActionResult.fail(e1.getMessage()); + }catch(Exception e){ + return ActionResult.fail(MsgCode.FA029.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + }else{ + return ActionResult.fail(MsgCode.FA002.get()); + } + } + /** + * 表单信息(详情页) + * 详情页面使用-转换数据 + * @param id + * @return + */ + @Operation(summary = "表单信息(详情页)") + @GetMapping("/detail/{id}") + public ActionResult detailInfo(@PathVariable("id") String id){ + CompanyEntity entity= companyService.getInfo(id); + if(entity==null){ + return ActionResult.fail(MsgCode.FA001.get()); + } + Map companyMap=JsonUtil.entityToMap(entity); + companyMap.put("id", companyMap.get("company_id")); + //副表数据 + //子表数据 + List mdmCompanyBankList = entity.getCompanyBank(); + companyMap.put("tableFieldad9d92",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(mdmCompanyBankList))); + companyMap.put("mdmCompanyBankList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(mdmCompanyBankList))); + List companyInvoiceList = entity.getCompanyInvoice(); + companyMap.put("tableField46dc53",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyInvoiceList))); + companyMap.put("companyInvoiceList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyInvoiceList))); + boolean isPc = "pc".equals(ServletUtil.getHeader("yunzhupaas-origin" )); + companyMap = generaterSwapUtil.swapDataDetail(companyMap,CompanyConstant.getFormData(),"806858527036409349",isPc?false:false); + //子表数据 + companyMap.put("mdmCompanyBankList",companyMap.get("tableFieldad9d92")); + companyMap.put("companyInvoiceList",companyMap.get("tableField46dc53")); + return ActionResult.success(companyMap); + } + /** + * 获取详情(编辑页) + * 编辑页面使用-不转换数据 + * @param id + * @return + */ + @Operation(summary = "信息") + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id){ + CompanyEntity entity= companyService.getInfo(id); + if(entity==null){ + return ActionResult.fail(MsgCode.FA001.get()); + } + Map companyMap=JsonUtil.entityToMap(entity); + companyMap.put("id", companyMap.get("company_id")); + //副表数据 + //子表数据 + List mdmCompanyBankList = entity.getCompanyBank(); + companyMap.put("tableFieldad9d92",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(mdmCompanyBankList))); + companyMap.put("mdmCompanyBankList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(mdmCompanyBankList))); + List companyInvoiceList = entity.getCompanyInvoice(); + companyMap.put("tableField46dc53",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyInvoiceList))); + companyMap.put("companyInvoiceList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyInvoiceList))); + companyMap = generaterSwapUtil.swapDataForm(companyMap,CompanyConstant.getFormData(),CompanyConstant.TABLEFIELDKEY,CompanyConstant.TABLERENAMES); + return ActionResult.success(companyMap); + } + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-controller/src/main/java/com/yunzhupaas/mdm/controller/CustinfoController.java b/yunzhupaas-mdm/yunzhupaas-mdm-controller/src/main/java/com/yunzhupaas/mdm/controller/CustinfoController.java new file mode 100644 index 0000000..f189ff9 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-controller/src/main/java/com/yunzhupaas/mdm/controller/CustinfoController.java @@ -0,0 +1,970 @@ +package com.yunzhupaas.mdm.controller; + + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.mdm.model.custinfo.CustinfoConstant; +import com.yunzhupaas.mdm.model.custinfo.CustinfoForm; +import com.yunzhupaas.mdm.model.custinfo.CustinfoPagination; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.mdm.service.*; +import com.yunzhupaas.mdm.entity.*; +import com.yunzhupaas.util.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import jakarta.validation.Valid; +import java.util.*; +import com.yunzhupaas.model.ExcelModel; +import com.yunzhupaas.excel.ExcelExportStyler; +import com.yunzhupaas.excel.ExcelHelper; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.config.ConfigValueUtil; + +import java.io.IOException; + +import com.yunzhupaas.model.visualJson.UploaderTemplateModel; +import com.yunzhupaas.base.util.FormExecelUtils; +import org.springframework.web.multipart.MultipartFile; +import cn.afterturn.easypoi.excel.ExcelExportUtil; +import cn.afterturn.easypoi.excel.entity.ExportParams; +import cn.afterturn.easypoi.excel.entity.ImportParams; +import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; +import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.Workbook; +import java.io.File; +import java.io.InputStream; +import com.yunzhupaas.onlinedev.model.ExcelImFieldModel; +import com.yunzhupaas.base.model.OnlineImport.ImportDataModel; +import com.yunzhupaas.base.model.OnlineImport.ImportFormCheckUniqueModel; +import com.yunzhupaas.base.model.OnlineImport.ExcelImportModel; +import com.yunzhupaas.base.model.OnlineImport.VisualImportModel; +import cn.xuyanwu.spring.file.storage.FileInfo; +import lombok.Cleanup; +import com.yunzhupaas.model.visualJson.config.HeaderModel; +import com.yunzhupaas.base.model.ColumnDataModel; +import com.yunzhupaas.base.util.VisualUtils; +import org.springframework.transaction.annotation.Transactional; + +/** + * 客户信息 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-24 + */ +@Slf4j +@RestController +@Tag(name = "客户信息" , description = "bcm") +@RequestMapping("/api/bcm/Custinfo") +public class CustinfoController { + + @Autowired + private GeneraterSwapUtil generaterSwapUtil; + + @Autowired + private UserProvider userProvider; + + @Autowired + private CustinfoService companyService; + + @Autowired + private CompanyInvoiceService companyInvoiceService; + @Autowired + private CompanyBankService companyBankService; + + @Autowired + private CustomerService customerService; + + @Autowired + private ConfigValueUtil configValueUtil; + + /** + * 列表 + * + * @param companyPagination + * @return + */ + @Operation(summary = "获取列表") + @PostMapping("/getList") + public ActionResult list(@RequestBody CustinfoPagination companyPagination)throws Exception{ + List list= companyService.getList(companyPagination); + List> realList=new ArrayList<>(); + for (CompanyEntity entity : list) { + Map companyMap=JsonUtil.entityToMap(entity); + companyMap.put("id", companyMap.get("company_id")); + //副表数据 + CustomerEntity customerEntity = entity.getCustomer(); + if(ObjectUtil.isNotEmpty(customerEntity)){ + Map customerMap=JsonUtil.entityToMap(customerEntity); + for(String key:customerMap.keySet()){ + companyMap.put("yunzhupaas_mdm_customer_yunzhupaas_"+key,customerMap.get(key)); + } + } + //子表数据 + List companyInvoiceList = entity.getCompanyInvoice(); + companyMap.put("tableField46dc53",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyInvoiceList))); + companyMap.put("companyInvoiceList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyInvoiceList))); + List companyBankList = entity.getCompanyBank(); + companyMap.put("tableFieldad9d92",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyBankList))); + companyMap.put("companyBankList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyBankList))); + realList.add(companyMap); + } + //数据转换 + boolean isPc = "pc".equals(ServletUtil.getHeader("yunzhupaas-origin" )); + realList = generaterSwapUtil.swapDataList(realList, CustinfoConstant.getFormData(), CustinfoConstant.getColumnData(), companyPagination.getModuleId(),isPc?false:false); + + //返回对象 + PageListVO vo = new PageListVO(); + vo.setList(realList); + PaginationVO page = JsonUtil.getJsonToBean(companyPagination, PaginationVO.class); + vo.setPagination(page); + return ActionResult.success(vo); + } + /** + * 创建 + * + * @param companyForm + * @return + */ + @PostMapping() + @Operation(summary = "创建") + public ActionResult create(@RequestBody @Valid CustinfoForm companyForm) { + String b = companyService.checkForm(companyForm,0); + if (StringUtil.isNotEmpty(b)){ + return ActionResult.fail(b ); + } + try{ + companyService.saveOrUpdate(companyForm, null ,true); + }catch(Exception e){ + return ActionResult.fail(MsgCode.FA028.get()); + } + return ActionResult.success(MsgCode.SU001.get()); + } + /** + * 导出Excel + * + * @return + */ + @Operation(summary = "导出Excel") + @PostMapping("/Actions/Export") + public ActionResult Export(@RequestBody CustinfoPagination companyPagination) throws IOException { + if (StringUtil.isEmpty(companyPagination.getSelectKey())){ + return ActionResult.fail(MsgCode.IMP011.get()); + } + List list= companyService.getList(companyPagination); + List> realList=new ArrayList<>(); + for (CompanyEntity entity : list) { + Map companyMap=JsonUtil.entityToMap(entity); + companyMap.put("id", companyMap.get("company_id")); + //副表数据 + CustomerEntity customerEntity = entity.getCustomer(); + if(ObjectUtil.isNotEmpty(customerEntity)){ + Map customerMap=JsonUtil.entityToMap(customerEntity); + for(String key:customerMap.keySet()){ + companyMap.put("yunzhupaas_mdm_customer_yunzhupaas_"+key,customerMap.get(key)); + } + } + //子表数据 + List companyInvoiceList = entity.getCompanyInvoice(); + companyMap.put("tableField46dc53",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyInvoiceList))); + companyMap.put("companyInvoiceList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyInvoiceList))); + List companyBankList = entity.getCompanyBank(); + companyMap.put("tableFieldad9d92",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyBankList))); + companyMap.put("companyBankList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyBankList))); + realList.add(companyMap); + } + //数据转换 + realList = generaterSwapUtil.swapDataList(realList, CustinfoConstant.getFormData(), CustinfoConstant.getColumnData(), companyPagination.getModuleId(),false); + String[]keys=!StringUtil.isEmpty(companyPagination.getSelectKey())?companyPagination.getSelectKey():new String[0]; + UserInfo userInfo=userProvider.get(); + String menuFullName = generaterSwapUtil.getMenuName(companyPagination.getMenuId()); + + DownloadVO vo=this.creatModelExcel(configValueUtil.getTemporaryFilePath(),realList,keys,userInfo,menuFullName); + return ActionResult.success(vo); + } + + /** + * 导出表格方法 + */ + public DownloadVO creatModelExcel(String path,List>list,String[]keys,UserInfo userInfo,String menuFullName){ + DownloadVO vo=DownloadVO.builder().build(); + List entitys=new ArrayList<>(); + if(keys.length>0){ + ExcelExportEntity tableField46dc53ExcelEntity = new ExcelExportEntity("设计子表(tableField46dc53)","tableField46dc53"); + List tableField46dc53List = new ArrayList<>(); + ExcelExportEntity tableFieldad9d92ExcelEntity = new ExcelExportEntity("设计子表(tableFieldad9d92)","tableFieldad9d92"); + List tableFieldad9d92List = new ArrayList<>(); + for(String key:keys){ + switch(key){ + case "company_code" : + entitys.add(new ExcelExportEntity("客户编码" ,"company_code")); + break; + case "company_name" : + entitys.add(new ExcelExportEntity("客户名称" ,"company_name")); + break; + case "short_name" : + entitys.add(new ExcelExportEntity("简称/昵称" ,"short_name")); + break; + case "entity_type" : + entitys.add(new ExcelExportEntity("类型" ,"entity_type")); + break; + case "credit_code" : + entitys.add(new ExcelExportEntity("社会信用代码" ,"credit_code")); + break; + case "org_id" : + entitys.add(new ExcelExportEntity("归属组织" ,"org_id")); + break; + case "province_id" : + entitys.add(new ExcelExportEntity("所属地区" ,"province_id")); + break; + case "tax_type" : + entitys.add(new ExcelExportEntity("纳税人类别" ,"tax_type")); + break; + case "enterprise_scale" : + entitys.add(new ExcelExportEntity("企业规模" ,"enterprise_scale")); + break; + case "enterprise_nature" : + entitys.add(new ExcelExportEntity("企业类型" ,"enterprise_nature")); + break; + case "industry_code" : + entitys.add(new ExcelExportEntity("行业代码" ,"industry_code")); + break; + case "registration_date" : + entitys.add(new ExcelExportEntity("成立日期" ,"registration_date")); + break; + case "registered_capital" : + entitys.add(new ExcelExportEntity("注册资本" ,"registered_capital")); + break; + case "legal_representative" : + entitys.add(new ExcelExportEntity("法定代表人" ,"legal_representative")); + break; + case "phone" : + entitys.add(new ExcelExportEntity("联系电话" ,"phone")); + break; + case "email" : + entitys.add(new ExcelExportEntity("邮箱" ,"email")); + break; + case "website" : + entitys.add(new ExcelExportEntity("网站" ,"website")); + break; + case "address" : + entitys.add(new ExcelExportEntity("地址" ,"address")); + break; + case "business_scope" : + entitys.add(new ExcelExportEntity("经营范围" ,"business_scope")); + break; + case "remark" : + entitys.add(new ExcelExportEntity("备注" ,"remark")); + break; + case "yunzhupaas_mdm_customer_yunzhupaas_major_person_id" : + entitys.add(new ExcelExportEntity("销售责任人" ,"yunzhupaas_mdm_customer_yunzhupaas_major_person_id")); + break; + case "yunzhupaas_mdm_customer_yunzhupaas_customer_level" : + entitys.add(new ExcelExportEntity("客户级别" ,"yunzhupaas_mdm_customer_yunzhupaas_customer_level")); + break; + case "yunzhupaas_mdm_customer_yunzhupaas_customer_source" : + entitys.add(new ExcelExportEntity("客户来源" ,"yunzhupaas_mdm_customer_yunzhupaas_customer_source")); + break; + case "tableField46dc53-title_code": + tableField46dc53List.add(new ExcelExportEntity("发票抬头编码" ,"title_code")); + break; + case "tableField46dc53-title_name": + tableField46dc53List.add(new ExcelExportEntity("发票抬头名称" ,"title_name")); + break; + case "tableField46dc53-credit_code": + tableField46dc53List.add(new ExcelExportEntity("纳税人识别号" ,"credit_code")); + break; + case "tableField46dc53-tax_type": + tableField46dc53List.add(new ExcelExportEntity("纳税人类别" ,"tax_type")); + break; + case "tableField46dc53-address": + tableField46dc53List.add(new ExcelExportEntity("地址" ,"address")); + break; + case "tableField46dc53-phone": + tableField46dc53List.add(new ExcelExportEntity("电话" ,"phone")); + break; + case "tableField46dc53-bank_name": + tableField46dc53List.add(new ExcelExportEntity("开户银行" ,"bank_name")); + break; + case "tableField46dc53-bank_account": + tableField46dc53List.add(new ExcelExportEntity("银行账户" ,"bank_account")); + break; + case "tableField46dc53-is_defalut": + tableField46dc53List.add(new ExcelExportEntity("是否默认" ,"is_defalut")); + break; + case "tableField46dc53-is_valid": + tableField46dc53List.add(new ExcelExportEntity("是否有效" ,"is_valid")); + break; + case "tableField46dc53-remark": + tableField46dc53List.add(new ExcelExportEntity("备注" ,"remark")); + break; + case "tableFieldad9d92-bank_name": + tableFieldad9d92List.add(new ExcelExportEntity("开户行" ,"bank_name")); + break; + case "tableFieldad9d92-bank_account_name": + tableFieldad9d92List.add(new ExcelExportEntity("账户名" ,"bank_account_name")); + break; + case "tableFieldad9d92-bank_account_number": + tableFieldad9d92List.add(new ExcelExportEntity("银行账号" ,"bank_account_number")); + break; + case "tableFieldad9d92-bank_province": + tableFieldad9d92List.add(new ExcelExportEntity("开户行城市" ,"bank_province")); + break; + case "tableFieldad9d92-remark": + tableFieldad9d92List.add(new ExcelExportEntity("备注" ,"remark")); + break; + default: + break; + } + } + if(tableField46dc53List.size() > 0){ + tableField46dc53ExcelEntity.setList(tableField46dc53List); + entitys.add(tableField46dc53ExcelEntity); + } + if(tableFieldad9d92List.size() > 0){ + tableFieldad9d92ExcelEntity.setList(tableFieldad9d92List); + entitys.add(tableFieldad9d92ExcelEntity); + } + } + + ExportParams exportParams = new ExportParams(null, "表单信息"); + exportParams.setType(ExcelType.XSSF); + try{ + @Cleanup Workbook workbook = new HSSFWorkbook(); + if (entitys.size()>0){ + if (list.size()==0){ + list.add(new HashMap<>()); + } + //去除空数据 + List> dataList = new ArrayList<>(); + for (Map map : list) { + int i = 0; + for (String key : keys) { + //子表 + if (key.toLowerCase().startsWith("tablefield")) { + String tableField = key.substring(0, key.indexOf("-" )); + String field = key.substring(key.indexOf("-" ) + 1); + Object o = map.get(tableField); + if (o != null) { + List> childList = (List>) o; + for (Map childMap : childList) { + if (childMap.get(field) != null) { + i++; + } + } + } + } else { + Object o = map.get(key); + if (o != null) { + i++; + } + } + } + if (i > 0) { + dataList.add(map); + } + } + List mergerEntitys = new ArrayList<>(entitys); + List> mergerList=new ArrayList<>(dataList); + //复杂表头-表头和数据处理 + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(CustinfoConstant.getColumnData(), ColumnDataModel.class); + List complexHeaderList = columnDataModel.getComplexHeaderList(); + if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { + entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList, Objects.equals(columnDataModel.getType(), 4)); + dataList = VisualUtils.complexHeaderDataHandel(dataList, complexHeaderList, Objects.equals(columnDataModel.getType(), 4)); + } + + exportParams.setStyle(ExcelExportStyler.class); + workbook = ExcelExportUtil.exportExcel(exportParams, entitys, dataList); + VisualUtils.mergerVertical(workbook, mergerEntitys, mergerList); + ExcelModel excelModel = generaterSwapUtil.getExcelParams(CustinfoConstant.getFormData(),Arrays.asList(keys)); + ExcelHelper helper = new ExcelHelper(); + helper.init(workbook, exportParams, entitys, excelModel); + helper.doPreHandle(); + helper.doPostHandle(); + } + String fileName = menuFullName +"_"+ DateUtil.dateNow("yyyyMMddHHmmss") + ".xls"; + MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName); + String temporaryFilePath = configValueUtil.getTemporaryFilePath(); + FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName); + vo.setName(fileInfo.getFilename()); + vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName); + } catch (Exception e) { + log.error("信息导出Excel错误:{}", e.getMessage()); + e.printStackTrace(); + } + return vo; + } + @Operation(summary = "上传文件") + @PostMapping("/Uploader") + public ActionResult Uploader() { + List list = UpUtil.getFileAll(); + MultipartFile file = list.get(0); + if (file.getOriginalFilename().endsWith(".xlsx") || file.getOriginalFilename().endsWith(".xls")) { + String filePath = XSSEscape.escape(configValueUtil.getTemporaryFilePath()); + String fileName = XSSEscape.escape(RandomUtil.uuId() + "." + UpUtil.getFileType(file)); + //上传文件 + FileInfo fileInfo = FileUploadUtils.uploadFile(file, filePath, fileName); + DownloadVO vo = DownloadVO.builder().build(); + vo.setName(fileInfo.getFilename()); + return ActionResult.success(vo); + } else { + return ActionResult.fail(MsgCode.FA017.get()); + } + } + + /** + * 模板下载 + * + * @return + */ + @Operation(summary = "模板下载") + @GetMapping("/TemplateDownload") + public ActionResult TemplateDownload(@RequestParam("menuId") String menuId){ + DownloadVO vo = DownloadVO.builder().build(); + UserInfo userInfo = userProvider.get(); + String menuFullName = generaterSwapUtil.getMenuName(menuId); + //主表对象 + List entitys = new ArrayList<>(); + List selectKeys = new ArrayList<>(); + //以下添加字段 + entitys.add(new ExcelExportEntity("客户名称(company_name)" ,"company_name")); + selectKeys.add("company_name"); + entitys.add(new ExcelExportEntity("社会信用代码(credit_code)" ,"credit_code")); + selectKeys.add("credit_code"); + entitys.add(new ExcelExportEntity("归属组织(org_id)" ,"org_id")); + selectKeys.add("org_id"); + entitys.add(new ExcelExportEntity("客户编码(company_code)" ,"company_code")); + selectKeys.add("company_code"); + entitys.add(new ExcelExportEntity("简称/昵称(short_name)" ,"short_name")); + selectKeys.add("short_name"); + entitys.add(new ExcelExportEntity("类型(entity_type)" ,"entity_type")); + selectKeys.add("entity_type"); + entitys.add(new ExcelExportEntity("纳税人类别(tax_type)" ,"tax_type")); + selectKeys.add("tax_type"); + entitys.add(new ExcelExportEntity("企业规模(enterprise_scale)" ,"enterprise_scale")); + selectKeys.add("enterprise_scale"); + entitys.add(new ExcelExportEntity("企业类型(enterprise_nature)" ,"enterprise_nature")); + selectKeys.add("enterprise_nature"); + entitys.add(new ExcelExportEntity("行业代码(industry_code)" ,"industry_code")); + selectKeys.add("industry_code"); + entitys.add(new ExcelExportEntity("成立日期(registration_date)" ,"registration_date")); + selectKeys.add("registration_date"); + entitys.add(new ExcelExportEntity("注册资本(registered_capital)" ,"registered_capital")); + selectKeys.add("registered_capital"); + entitys.add(new ExcelExportEntity("法定代表人(legal_representative)" ,"legal_representative")); + selectKeys.add("legal_representative"); + entitys.add(new ExcelExportEntity("联系电话(phone)" ,"phone")); + selectKeys.add("phone"); + entitys.add(new ExcelExportEntity("邮箱(email)" ,"email")); + selectKeys.add("email"); + entitys.add(new ExcelExportEntity("网站(website)" ,"website")); + selectKeys.add("website"); + entitys.add(new ExcelExportEntity("地址(address)" ,"address")); + selectKeys.add("address"); + entitys.add(new ExcelExportEntity("所属地区(province_id)" ,"province_id")); + selectKeys.add("province_id"); + entitys.add(new ExcelExportEntity("经营范围(business_scope)" ,"business_scope")); + selectKeys.add("business_scope"); + entitys.add(new ExcelExportEntity("备注(remark)" ,"remark")); + selectKeys.add("remark"); + //tableField46dc53子表对象 + ExcelExportEntity tableField46dc53ExcelEntity = new ExcelExportEntity("设计子表(tableField46dc53)","tableField46dc53"); + List tableField46dc53ExcelEntityList = new ArrayList<>(); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("发票抬头名称(tableField46dc53-title_name)" ,"title_name")); + selectKeys.add("tableField46dc53-title_name"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("纳税人识别号(tableField46dc53-credit_code)" ,"credit_code")); + selectKeys.add("tableField46dc53-credit_code"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("纳税人类别(tableField46dc53-tax_type)" ,"tax_type")); + selectKeys.add("tableField46dc53-tax_type"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("地址(tableField46dc53-address)" ,"address")); + selectKeys.add("tableField46dc53-address"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("电话(tableField46dc53-phone)" ,"phone")); + selectKeys.add("tableField46dc53-phone"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("开户银行(tableField46dc53-bank_name)" ,"bank_name")); + selectKeys.add("tableField46dc53-bank_name"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("银行账户(tableField46dc53-bank_account)" ,"bank_account")); + selectKeys.add("tableField46dc53-bank_account"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("是否默认(tableField46dc53-is_defalut)" ,"is_defalut")); + selectKeys.add("tableField46dc53-is_defalut"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("是否有效(tableField46dc53-is_valid)" ,"is_valid")); + selectKeys.add("tableField46dc53-is_valid"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("备注(tableField46dc53-remark)" ,"remark")); + selectKeys.add("tableField46dc53-remark"); + tableField46dc53ExcelEntity.setList(tableField46dc53ExcelEntityList); + if(tableField46dc53ExcelEntityList.size() > 0){ + entitys.add(tableField46dc53ExcelEntity); + } + //tableFieldad9d92子表对象 + ExcelExportEntity tableFieldad9d92ExcelEntity = new ExcelExportEntity("设计子表(tableFieldad9d92)","tableFieldad9d92"); + List tableFieldad9d92ExcelEntityList = new ArrayList<>(); + tableFieldad9d92ExcelEntityList.add(new ExcelExportEntity("开户行(tableFieldad9d92-bank_name)" ,"bank_name")); + selectKeys.add("tableFieldad9d92-bank_name"); + tableFieldad9d92ExcelEntityList.add(new ExcelExportEntity("账户名(tableFieldad9d92-bank_account_name)" ,"bank_account_name")); + selectKeys.add("tableFieldad9d92-bank_account_name"); + tableFieldad9d92ExcelEntityList.add(new ExcelExportEntity("银行账号(tableFieldad9d92-bank_account_number)" ,"bank_account_number")); + selectKeys.add("tableFieldad9d92-bank_account_number"); + tableFieldad9d92ExcelEntityList.add(new ExcelExportEntity("开户行城市(tableFieldad9d92-bank_province)" ,"bank_province")); + selectKeys.add("tableFieldad9d92-bank_province"); + tableFieldad9d92ExcelEntityList.add(new ExcelExportEntity("备注(tableFieldad9d92-remark)" ,"remark")); + selectKeys.add("tableFieldad9d92-remark"); + tableFieldad9d92ExcelEntity.setList(tableFieldad9d92ExcelEntityList); + if(tableFieldad9d92ExcelEntityList.size() > 0){ + entitys.add(tableFieldad9d92ExcelEntity); + } + ExcelModel excelModel = generaterSwapUtil.getExcelParams(CustinfoConstant.getFormData(),selectKeys); + List> list = new ArrayList<>(); + list.add(excelModel.getDataMap()); + + ExportParams exportParams = new ExportParams(null, menuFullName + "模板"); + exportParams.setStyle(ExcelExportStyler.class); + exportParams.setType(ExcelType.XSSF); + try{ + @Cleanup Workbook workbook = new HSSFWorkbook(); + if (entitys.size()>0){ + if (list.size()==0){ + list.add(new HashMap<>()); + } + //复杂表头-表头和数据处理 + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(CustinfoConstant.getColumnData(), ColumnDataModel.class); + List complexHeaderList = columnDataModel.getComplexHeaderList(); + if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { + entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList, false); + list = VisualUtils.complexHeaderDataHandel(list, complexHeaderList, false); + } + workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list); + ExcelHelper helper = new ExcelHelper(); + helper.init(workbook, exportParams, entitys, excelModel); + helper.doPreHandle(); + helper.doPostHandle(); + } + String fileName = menuFullName + "导入模板.xls"; + MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName); + String temporaryFilePath = configValueUtil.getTemporaryFilePath(); + FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName); + vo.setName(fileInfo.getFilename()); + vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName); + } catch (Exception e) { + log.error("模板信息导出Excel错误:{}", e.getMessage()); + e.printStackTrace(); + } + return ActionResult.success(vo); + } + + /** + * 导入预览 + * + * @return + */ + @Operation(summary = "导入预览" ) + @GetMapping("/ImportPreview") + public ActionResult> ImportPreview(String fileName) throws Exception { + Map headAndDataMap = new HashMap<>(2); + String filePath = FileUploadUtils.getLocalBasePath() + configValueUtil.getTemporaryFilePath(); + FileUploadUtils.downLocal(configValueUtil.getTemporaryFilePath(), filePath, fileName); + File temporary = new File(XSSEscape.escapePath(filePath + fileName)); + int headerRowIndex = 2; + ImportParams params = new ImportParams(); + params.setTitleRows(0); + params.setHeadRows(headerRowIndex); + params.setNeedVerify(true); + try { + InputStream inputStream = ExcelUtil.solveOrginTitle(temporary, headerRowIndex); + List excelDataList = ExcelUtil.importExcelByInputStream(inputStream, 0, headerRowIndex, Map.class); + //数据超过1000条 + if(excelDataList != null && excelDataList.size() > 1000) { + return ActionResult.fail(MsgCode.ETD117.get()); + } + + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(CustinfoConstant.getColumnData(), ColumnDataModel.class); + UploaderTemplateModel uploaderTemplateModel = JsonUtil.getJsonToBean(columnDataModel.getUploaderTemplateJson(), UploaderTemplateModel.class); + List selectKey = uploaderTemplateModel.getSelectKey(); + //子表合并 + List> results = FormExecelUtils.dataMergeChildTable(excelDataList,selectKey); + // 导入字段 + List columns = new ArrayList<>(); + columns.add(new ExcelImFieldModel("company_name","客户名称","input")); + columns.add(new ExcelImFieldModel("credit_code","社会信用代码","input")); + columns.add(new ExcelImFieldModel("org_id","归属组织","organizeSelect")); + columns.add(new ExcelImFieldModel("company_code","客户编码","billRule")); + columns.add(new ExcelImFieldModel("short_name","简称/昵称","input")); + columns.add(new ExcelImFieldModel("entity_type","类型","radio")); + columns.add(new ExcelImFieldModel("tax_type","纳税人类别","select")); + columns.add(new ExcelImFieldModel("enterprise_scale","企业规模","select")); + columns.add(new ExcelImFieldModel("enterprise_nature","企业类型","select")); + columns.add(new ExcelImFieldModel("industry_code","行业代码","select")); + columns.add(new ExcelImFieldModel("registration_date","成立日期","datePicker")); + columns.add(new ExcelImFieldModel("registered_capital","注册资本","inputNumber")); + columns.add(new ExcelImFieldModel("legal_representative","法定代表人","input")); + columns.add(new ExcelImFieldModel("phone","联系电话","input")); + columns.add(new ExcelImFieldModel("email","邮箱","input")); + columns.add(new ExcelImFieldModel("website","网站","input")); + columns.add(new ExcelImFieldModel("address","地址","input")); + columns.add(new ExcelImFieldModel("province_id","所属地区","areaSelect")); + columns.add(new ExcelImFieldModel("business_scope","经营范围","textarea")); + columns.add(new ExcelImFieldModel("remark","备注","textarea")); + //tableField46dc53子表对象 + List tableField46dc53columns = new ArrayList<>(); + tableField46dc53columns.add(new ExcelImFieldModel("title_name" ,"发票抬头名称")); + tableField46dc53columns.add(new ExcelImFieldModel("credit_code" ,"纳税人识别号")); + tableField46dc53columns.add(new ExcelImFieldModel("tax_type" ,"纳税人类别")); + tableField46dc53columns.add(new ExcelImFieldModel("address" ,"地址")); + tableField46dc53columns.add(new ExcelImFieldModel("phone" ,"电话")); + tableField46dc53columns.add(new ExcelImFieldModel("bank_name" ,"开户银行")); + tableField46dc53columns.add(new ExcelImFieldModel("bank_account" ,"银行账户")); + tableField46dc53columns.add(new ExcelImFieldModel("is_defalut" ,"是否默认")); + tableField46dc53columns.add(new ExcelImFieldModel("is_valid" ,"是否有效")); + tableField46dc53columns.add(new ExcelImFieldModel("remark" ,"备注")); + columns.add(new ExcelImFieldModel("tableField46dc53","设计子表","table",tableField46dc53columns)); + //tableFieldad9d92子表对象 + List tableFieldad9d92columns = new ArrayList<>(); + tableFieldad9d92columns.add(new ExcelImFieldModel("bank_name" ,"开户行")); + tableFieldad9d92columns.add(new ExcelImFieldModel("bank_account_name" ,"账户名")); + tableFieldad9d92columns.add(new ExcelImFieldModel("bank_account_number" ,"银行账号")); + tableFieldad9d92columns.add(new ExcelImFieldModel("bank_province" ,"开户行城市")); + tableFieldad9d92columns.add(new ExcelImFieldModel("remark" ,"备注")); + columns.add(new ExcelImFieldModel("tableFieldad9d92","设计子表","table",tableFieldad9d92columns)); + headAndDataMap.put("dataRow" , results); + headAndDataMap.put("headerRow" , JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(columns))); + } catch (Exception e){ + e.printStackTrace(); + return ActionResult.fail(MsgCode.VS407.get()); + } + return ActionResult.success(headAndDataMap); + } + + /** + * 导入数据 + * + * @return + */ + @Operation(summary = "导入数据" ) + @PostMapping("/ImportData") + public ActionResult ImportData(@RequestBody VisualImportModel visualImportModel) throws Exception { + List> listData = visualImportModel.getList(); + ImportFormCheckUniqueModel uniqueModel = new ImportFormCheckUniqueModel(); + uniqueModel.setDbLinkId(CustinfoConstant.DBLINKID); + uniqueModel.setUpdate(Objects.equals("2", "2")); + + Map tablefieldkey = new HashMap<>(); + for(String key:CustinfoConstant.TABLEFIELDKEY.keySet()){ + tablefieldkey.put(key,CustinfoConstant.TABLERENAMES.get(CustinfoConstant.TABLEFIELDKEY.get(key))); + } + ExcelImportModel excelImportModel = generaterSwapUtil.importData(CustinfoConstant.getFormData(),listData,uniqueModel, tablefieldkey,CustinfoConstant.getTableList()); + List importDataModel = uniqueModel.getImportDataModel(); + for (ImportDataModel model : importDataModel) { + String id = model.getId(); + Map result = model.getResultData(); + if(StringUtil.isNotEmpty(id)){ + update(id, JsonUtil.getJsonToBean(result,CustinfoForm.class), true); + }else { + create( JsonUtil.getJsonToBean(result,CustinfoForm.class)); + } + } + return ActionResult.success(excelImportModel); + } + + /** + * 导出异常报告 + * + * @return + */ + @Operation(summary = "导出异常报告") + @PostMapping("/ImportExceptionData") + public ActionResult ImportExceptionData(@RequestBody VisualImportModel visualImportModel) { + DownloadVO vo = DownloadVO.builder().build(); + UserInfo userInfo = userProvider.get(); + String menuFullName = generaterSwapUtil.getMenuName(visualImportModel.getMenuId()); + //主表对象 + List entitys = new ArrayList<>(); + entitys.add(new ExcelExportEntity("异常原因", "errorsInfo",30)); + List selectKeys = new ArrayList<>(); + //以下添加字段 + entitys.add(new ExcelExportEntity("客户名称(company_name)" ,"company_name")); + selectKeys.add("company_name"); + entitys.add(new ExcelExportEntity("社会信用代码(credit_code)" ,"credit_code")); + selectKeys.add("credit_code"); + entitys.add(new ExcelExportEntity("归属组织(org_id)" ,"org_id")); + selectKeys.add("org_id"); + entitys.add(new ExcelExportEntity("客户编码(company_code)" ,"company_code")); + selectKeys.add("company_code"); + entitys.add(new ExcelExportEntity("简称/昵称(short_name)" ,"short_name")); + selectKeys.add("short_name"); + entitys.add(new ExcelExportEntity("类型(entity_type)" ,"entity_type")); + selectKeys.add("entity_type"); + entitys.add(new ExcelExportEntity("纳税人类别(tax_type)" ,"tax_type")); + selectKeys.add("tax_type"); + entitys.add(new ExcelExportEntity("企业规模(enterprise_scale)" ,"enterprise_scale")); + selectKeys.add("enterprise_scale"); + entitys.add(new ExcelExportEntity("企业类型(enterprise_nature)" ,"enterprise_nature")); + selectKeys.add("enterprise_nature"); + entitys.add(new ExcelExportEntity("行业代码(industry_code)" ,"industry_code")); + selectKeys.add("industry_code"); + entitys.add(new ExcelExportEntity("成立日期(registration_date)" ,"registration_date")); + selectKeys.add("registration_date"); + entitys.add(new ExcelExportEntity("注册资本(registered_capital)" ,"registered_capital")); + selectKeys.add("registered_capital"); + entitys.add(new ExcelExportEntity("法定代表人(legal_representative)" ,"legal_representative")); + selectKeys.add("legal_representative"); + entitys.add(new ExcelExportEntity("联系电话(phone)" ,"phone")); + selectKeys.add("phone"); + entitys.add(new ExcelExportEntity("邮箱(email)" ,"email")); + selectKeys.add("email"); + entitys.add(new ExcelExportEntity("网站(website)" ,"website")); + selectKeys.add("website"); + entitys.add(new ExcelExportEntity("地址(address)" ,"address")); + selectKeys.add("address"); + entitys.add(new ExcelExportEntity("所属地区(province_id)" ,"province_id")); + selectKeys.add("province_id"); + entitys.add(new ExcelExportEntity("经营范围(business_scope)" ,"business_scope")); + selectKeys.add("business_scope"); + entitys.add(new ExcelExportEntity("备注(remark)" ,"remark")); + selectKeys.add("remark"); + //tableField46dc53子表对象 + ExcelExportEntity tableField46dc53ExcelEntity = new ExcelExportEntity("设计子表(tableField46dc53)","tableField46dc53"); + List tableField46dc53ExcelEntityList = new ArrayList<>(); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("发票抬头名称(tableField46dc53-title_name)" ,"title_name")); + selectKeys.add("tableField46dc53-title_name"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("纳税人识别号(tableField46dc53-credit_code)" ,"credit_code")); + selectKeys.add("tableField46dc53-credit_code"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("纳税人类别(tableField46dc53-tax_type)" ,"tax_type")); + selectKeys.add("tableField46dc53-tax_type"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("地址(tableField46dc53-address)" ,"address")); + selectKeys.add("tableField46dc53-address"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("电话(tableField46dc53-phone)" ,"phone")); + selectKeys.add("tableField46dc53-phone"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("开户银行(tableField46dc53-bank_name)" ,"bank_name")); + selectKeys.add("tableField46dc53-bank_name"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("银行账户(tableField46dc53-bank_account)" ,"bank_account")); + selectKeys.add("tableField46dc53-bank_account"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("是否默认(tableField46dc53-is_defalut)" ,"is_defalut")); + selectKeys.add("tableField46dc53-is_defalut"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("是否有效(tableField46dc53-is_valid)" ,"is_valid")); + selectKeys.add("tableField46dc53-is_valid"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("备注(tableField46dc53-remark)" ,"remark")); + selectKeys.add("tableField46dc53-remark"); + tableField46dc53ExcelEntity.setList(tableField46dc53ExcelEntityList); + entitys.add(tableField46dc53ExcelEntity); + //tableFieldad9d92子表对象 + ExcelExportEntity tableFieldad9d92ExcelEntity = new ExcelExportEntity("设计子表(tableFieldad9d92)","tableFieldad9d92"); + List tableFieldad9d92ExcelEntityList = new ArrayList<>(); + tableFieldad9d92ExcelEntityList.add(new ExcelExportEntity("开户行(tableFieldad9d92-bank_name)" ,"bank_name")); + selectKeys.add("tableFieldad9d92-bank_name"); + tableFieldad9d92ExcelEntityList.add(new ExcelExportEntity("账户名(tableFieldad9d92-bank_account_name)" ,"bank_account_name")); + selectKeys.add("tableFieldad9d92-bank_account_name"); + tableFieldad9d92ExcelEntityList.add(new ExcelExportEntity("银行账号(tableFieldad9d92-bank_account_number)" ,"bank_account_number")); + selectKeys.add("tableFieldad9d92-bank_account_number"); + tableFieldad9d92ExcelEntityList.add(new ExcelExportEntity("开户行城市(tableFieldad9d92-bank_province)" ,"bank_province")); + selectKeys.add("tableFieldad9d92-bank_province"); + tableFieldad9d92ExcelEntityList.add(new ExcelExportEntity("备注(tableFieldad9d92-remark)" ,"remark")); + selectKeys.add("tableFieldad9d92-remark"); + tableFieldad9d92ExcelEntity.setList(tableFieldad9d92ExcelEntityList); + entitys.add(tableFieldad9d92ExcelEntity); + ExcelModel excelModel = generaterSwapUtil.getExcelParams(CustinfoConstant.getFormData(),selectKeys); + List> list = new ArrayList<>(); + list.addAll(visualImportModel.getList()); + + ExportParams exportParams = new ExportParams(null, menuFullName + "模板"); + exportParams.setStyle(ExcelExportStyler.class); + exportParams.setType(ExcelType.XSSF); + exportParams.setFreezeCol(1); + try{ + @Cleanup Workbook workbook = new HSSFWorkbook(); + if (entitys.size()>0){ + if (list.size()==0){ + list.add(new HashMap<>()); + } + //复杂表头-表头和数据处理 + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(CustinfoConstant.getColumnData(), ColumnDataModel.class); + List complexHeaderList = columnDataModel.getComplexHeaderList(); + if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { + entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList, false); + list = VisualUtils.complexHeaderDataHandel(list, complexHeaderList, false); + } + + workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list); + ExcelHelper helper = new ExcelHelper(); + helper.init(workbook, exportParams, entitys, excelModel); + helper.doPreHandle(); + helper.doPostHandle(); + } + + String fileName = menuFullName + "错误报告_" + DateUtil.dateNow("yyyyMMddHHmmss") + ".xls"; + MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName); + String temporaryFilePath = configValueUtil.getTemporaryFilePath(); + FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName); + vo.setName(fileInfo.getFilename()); + vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName); + } catch (Exception e) { + e.printStackTrace(); + } + return ActionResult.success(vo); + } + /** + * 删除 + * @param id + * @return + */ + @Operation(summary = "删除") + @DeleteMapping("/{id}") + @Transactional + public ActionResult delete(@PathVariable("id") String id,@RequestParam(name = "forceDel",defaultValue = "false") boolean forceDel) throws Exception{ + CompanyEntity entity= companyService.getInfo(id); + if(entity!=null){ + //主表数据删除 + companyService.delete(entity); + QueryWrapper queryWrapperCustomer=new QueryWrapper<>(); + queryWrapperCustomer.lambda().eq(CustomerEntity::getCompanyId,entity.getCompanyId()); + //副表数据删除 + customerService.remove(queryWrapperCustomer); + QueryWrapper queryWrapperCompanyInvoice=new QueryWrapper<>(); + queryWrapperCompanyInvoice.lambda().eq(CompanyInvoiceEntity::getCompanyId,entity.getCompanyId()); + //子表数据删除 + companyInvoiceService.remove(queryWrapperCompanyInvoice); + QueryWrapper queryWrapperCompanyBank=new QueryWrapper<>(); + queryWrapperCompanyBank.lambda().eq(CompanyBankEntity::getCompanyId,entity.getCompanyId()); + //子表数据删除 + companyBankService.remove(queryWrapperCompanyBank); + } + return ActionResult.success(MsgCode.SU003.get()); + } + /** + * 批量删除 + * @param obj + * @return + */ + @DeleteMapping("/batchRemove") + @Transactional + @Operation(summary = "批量删除") + public ActionResult batchRemove(@RequestBody Object obj){ + Map objectMap = JsonUtil.entityToMap(obj); + List idList = JsonUtil.getJsonToList(objectMap.get("ids"), String.class); + String errInfo = ""; + List successList = new ArrayList<>(); + for (String allId : idList){ + try { + this.delete(allId,false); + successList.add(allId); + } catch (Exception e) { + errInfo = e.getMessage(); + } + } + if (successList.size() == 0 && StringUtil.isNotEmpty(errInfo)){ + return ActionResult.fail(errInfo); + } + return ActionResult.success(MsgCode.SU003.get()); + } + /** + * 编辑 + * @param id + * @param companyForm + * @return + */ + @PutMapping("/{id}") + @Operation(summary = "更新") + public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid CustinfoForm companyForm, + @RequestParam(value = "isImport", required = false) boolean isImport){ + CompanyEntity entity= companyService.getInfo(id); + if(entity!=null){ + companyForm.setCompanyId(String.valueOf(entity.getCompanyId())); + + if (!isImport) { + String b = companyService.checkForm(companyForm,1); + if (StringUtil.isNotEmpty(b)){ + return ActionResult.fail(b ); + } + } + + try{ + companyService.saveOrUpdate(companyForm,id,false); + }catch (DataException e1){ + return ActionResult.fail(e1.getMessage()); + }catch(Exception e){ + return ActionResult.fail(MsgCode.FA029.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + }else{ + return ActionResult.fail(MsgCode.FA002.get()); + } + } + /** + * 表单信息(详情页) + * 详情页面使用-转换数据 + * @param id + * @return + */ + @Operation(summary = "表单信息(详情页)") + @GetMapping("/detail/{id}") + public ActionResult detailInfo(@PathVariable("id") String id){ + CompanyEntity entity= companyService.getInfo(id); + if(entity==null){ + return ActionResult.fail(MsgCode.FA001.get()); + } + Map companyMap=JsonUtil.entityToMap(entity); + companyMap.put("id", companyMap.get("company_id")); + //副表数据 + CustomerEntity customerEntity = entity.getCustomer(); + if(ObjectUtil.isNotEmpty(customerEntity)){ + Map customerMap=JsonUtil.entityToMap(customerEntity); + for(String key:customerMap.keySet()){ + companyMap.put("yunzhupaas_mdm_customer_yunzhupaas_"+key,customerMap.get(key)); + } + } + //子表数据 + List companyInvoiceList = entity.getCompanyInvoice(); + companyMap.put("tableField46dc53",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyInvoiceList))); + companyMap.put("companyInvoiceList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyInvoiceList))); + List companyBankList = entity.getCompanyBank(); + companyMap.put("tableFieldad9d92",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyBankList))); + companyMap.put("companyBankList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyBankList))); + boolean isPc = "pc".equals(ServletUtil.getHeader("yunzhupaas-origin" )); + companyMap = generaterSwapUtil.swapDataDetail(companyMap,CustinfoConstant.getFormData(),"816972827587510981",isPc?false:false); + //子表数据 + companyMap.put("companyInvoiceList",companyMap.get("tableField46dc53")); + companyMap.put("companyBankList",companyMap.get("tableFieldad9d92")); + return ActionResult.success(companyMap); + } + /** + * 获取详情(编辑页) + * 编辑页面使用-不转换数据 + * @param id + * @return + */ + @Operation(summary = "信息") + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id){ + CompanyEntity entity= companyService.getInfo(id); + if(entity==null){ + return ActionResult.fail(MsgCode.FA001.get()); + } + Map companyMap=JsonUtil.entityToMap(entity); + companyMap.put("id", companyMap.get("company_id")); + //副表数据 + CustomerEntity customerEntity = entity.getCustomer(); + if(ObjectUtil.isNotEmpty(customerEntity)){ + Map customerMap=JsonUtil.entityToMap(customerEntity); + for(String key:customerMap.keySet()){ + companyMap.put("yunzhupaas_mdm_customer_yunzhupaas_"+key,customerMap.get(key)); + } + } + //子表数据 + List companyInvoiceList = entity.getCompanyInvoice(); + companyMap.put("tableField46dc53",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyInvoiceList))); + companyMap.put("companyInvoiceList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyInvoiceList))); + List companyBankList = entity.getCompanyBank(); + companyMap.put("tableFieldad9d92",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyBankList))); + companyMap.put("companyBankList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyBankList))); + companyMap = generaterSwapUtil.swapDataForm(companyMap,CustinfoConstant.getFormData(),CustinfoConstant.TABLEFIELDKEY,CustinfoConstant.TABLERENAMES); + return ActionResult.success(companyMap); + } + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-controller/src/main/java/com/yunzhupaas/mdm/controller/LpcController.java b/yunzhupaas-mdm/yunzhupaas-mdm-controller/src/main/java/com/yunzhupaas/mdm/controller/LpcController.java new file mode 100644 index 0000000..bc32d2f --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-controller/src/main/java/com/yunzhupaas/mdm/controller/LpcController.java @@ -0,0 +1,947 @@ +package com.yunzhupaas.mdm.controller; + + +import cn.hutool.core.util.ObjectUtil; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.mdm.service.*; +import com.yunzhupaas.mdm.entity.*; +import com.yunzhupaas.util.*; +import com.yunzhupaas.mdm.model.lpc.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import jakarta.validation.Valid; +import java.util.*; +import com.yunzhupaas.model.ExcelModel; +import com.yunzhupaas.excel.ExcelExportStyler; +import com.yunzhupaas.excel.ExcelHelper; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.config.ConfigValueUtil; + +import java.io.IOException; + +import com.yunzhupaas.model.visualJson.UploaderTemplateModel; +import com.yunzhupaas.base.util.FormExecelUtils; +import org.springframework.web.multipart.MultipartFile; +import cn.afterturn.easypoi.excel.ExcelExportUtil; +import cn.afterturn.easypoi.excel.entity.ExportParams; +import cn.afterturn.easypoi.excel.entity.ImportParams; +import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; +import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.Workbook; +import java.io.File; +import java.io.InputStream; +import com.yunzhupaas.onlinedev.model.ExcelImFieldModel; +import com.yunzhupaas.base.model.OnlineImport.ImportDataModel; +import com.yunzhupaas.base.model.OnlineImport.ImportFormCheckUniqueModel; +import com.yunzhupaas.base.model.OnlineImport.ExcelImportModel; +import com.yunzhupaas.base.model.OnlineImport.VisualImportModel; +import cn.xuyanwu.spring.file.storage.FileInfo; +import lombok.Cleanup; +import com.yunzhupaas.model.visualJson.config.HeaderModel; +import com.yunzhupaas.base.model.ColumnDataModel; +import com.yunzhupaas.base.util.VisualUtils; +import org.springframework.transaction.annotation.Transactional; + +/** + * 法人公司 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-24 + */ +@Slf4j +@RestController +@Tag(name = "法人公司" , description = "bcm") +@RequestMapping("/api/bcm/Lpc") +public class LpcController { + + @Autowired + private GeneraterSwapUtil generaterSwapUtil; + + @Autowired + private UserProvider userProvider; + + @Autowired + private LpcService companyService; + + @Autowired + private CompanyInvoiceService company_invoiceService; + @Autowired + private CompanyBankService companyBankService; + + @Autowired + private CorporationService corporationService; + + @Autowired + private ConfigValueUtil configValueUtil; + + /** + * 列表 + * + * @param companyPagination + * @return + */ + @Operation(summary = "获取列表") + @PostMapping("/getList") + public ActionResult list(@RequestBody LpcPagination companyPagination)throws Exception{ + List list= companyService.getList(companyPagination); + List> realList=new ArrayList<>(); + for (CompanyEntity entity : list) { + Map companyMap=JsonUtil.entityToMap(entity); + companyMap.put("id", companyMap.get("company_id")); + //副表数据 + CorporationEntity corporationEntity = entity.getCorporation(); + if(ObjectUtil.isNotEmpty(corporationEntity)){ + Map corporationMap=JsonUtil.entityToMap(corporationEntity); + for(String key:corporationMap.keySet()){ + companyMap.put("yunzhupaas_mdm_corporation_yunzhupaas_"+key,corporationMap.get(key)); + } + } + //子表数据 + List company_invoiceList = entity.getCompanyInvoice(); + companyMap.put("tableField5ced3a",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(company_invoiceList))); + companyMap.put("company_invoiceList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(company_invoiceList))); + List companyBankList = entity.getCompanyBank(); + companyMap.put("tableFieldbd0aa4",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyBankList))); + companyMap.put("companyBankList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyBankList))); + realList.add(companyMap); + } + //数据转换 + boolean isPc = "pc".equals(ServletUtil.getHeader("yunzhupaas-origin" )); + realList = generaterSwapUtil.swapDataList(realList, LpcConstant.getFormData(), LpcConstant.getColumnData(), companyPagination.getModuleId(),isPc?false:false); + + //返回对象 + PageListVO vo = new PageListVO(); + vo.setList(realList); + PaginationVO page = JsonUtil.getJsonToBean(companyPagination, PaginationVO.class); + vo.setPagination(page); + return ActionResult.success(vo); + } + /** + * 创建 + * + * @param companyForm + * @return + */ + @PostMapping() + @Operation(summary = "创建") + public ActionResult create(@RequestBody @Valid LpcForm companyForm) throws Exception { + String b = companyService.checkForm(companyForm,0); + if (StringUtil.isNotEmpty(b)){ + return ActionResult.fail(b ); + } +// try{ + companyService.saveOrUpdate(companyForm, null ,true); +// }catch(Exception e){ +// return ActionResult.fail(MsgCode.FA028.get()); +// } + return ActionResult.success(MsgCode.SU001.get()); + } + /** + * 导出Excel + * + * @return + */ + @Operation(summary = "导出Excel") + @PostMapping("/Actions/Export") + public ActionResult Export(@RequestBody LpcPagination companyPagination) throws IOException { + if (StringUtil.isEmpty(companyPagination.getSelectKey())){ + return ActionResult.fail(MsgCode.IMP011.get()); + } + List list= companyService.getList(companyPagination); + List> realList=new ArrayList<>(); + for (CompanyEntity entity : list) { + Map companyMap=JsonUtil.entityToMap(entity); + companyMap.put("id", companyMap.get("company_id")); + //副表数据 + CorporationEntity corporationEntity = entity.getCorporation(); + if(ObjectUtil.isNotEmpty(corporationEntity)){ + Map corporationMap=JsonUtil.entityToMap(corporationEntity); + for(String key:corporationMap.keySet()){ + companyMap.put("yunzhupaas_mdm_corporation_yunzhupaas_"+key,corporationMap.get(key)); + } + } + //子表数据 + List company_invoiceList = entity.getCompanyInvoice(); + companyMap.put("tableField5ced3a",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(company_invoiceList))); + companyMap.put("company_invoiceList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(company_invoiceList))); + List companyBankList = entity.getCompanyBank(); + companyMap.put("tableFieldbd0aa4",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyBankList))); + companyMap.put("companyBankList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyBankList))); + realList.add(companyMap); + } + //数据转换 + realList = generaterSwapUtil.swapDataList(realList, LpcConstant.getFormData(),LpcConstant.getColumnData(), companyPagination.getModuleId(),false); + String[]keys=!StringUtil.isEmpty(companyPagination.getSelectKey())?companyPagination.getSelectKey():new String[0]; + UserInfo userInfo=userProvider.get(); + String menuFullName = generaterSwapUtil.getMenuName(companyPagination.getMenuId()); + + DownloadVO vo=this.creatModelExcel(configValueUtil.getTemporaryFilePath(),realList,keys,userInfo,menuFullName); + return ActionResult.success(vo); + } + + /** + * 导出表格方法 + */ + public DownloadVO creatModelExcel(String path,List>list,String[]keys,UserInfo userInfo,String menuFullName){ + DownloadVO vo=DownloadVO.builder().build(); + List entitys=new ArrayList<>(); + if(keys.length>0){ + ExcelExportEntity tableField5ced3aExcelEntity = new ExcelExportEntity("设计子表(tableField5ced3a)","tableField5ced3a"); + List tableField5ced3aList = new ArrayList<>(); + ExcelExportEntity tableFieldbd0aa4ExcelEntity = new ExcelExportEntity("设计子表(tableFieldbd0aa4)","tableFieldbd0aa4"); + List tableFieldbd0aa4List = new ArrayList<>(); + for(String key:keys){ + switch(key){ + case "entity_type" : + entitys.add(new ExcelExportEntity("实体类型" ,"entity_type")); + break; + case "company_code" : + entitys.add(new ExcelExportEntity("企业编码" ,"company_code")); + break; + case "company_name" : + entitys.add(new ExcelExportEntity("企业名称" ,"company_name")); + break; + case "short_name" : + entitys.add(new ExcelExportEntity("简称/昵称" ,"short_name")); + break; + case "credit_code" : + entitys.add(new ExcelExportEntity("社会信用代码" ,"credit_code")); + break; + case "tax_type" : + entitys.add(new ExcelExportEntity("纳税人类别" ,"tax_type")); + break; + case "org_id" : + entitys.add(new ExcelExportEntity("归属组织" ,"org_id")); + break; + case "province_id" : + entitys.add(new ExcelExportEntity("所属地区" ,"province_id")); + break; + case "enterprise_nature" : + entitys.add(new ExcelExportEntity("企业类型" ,"enterprise_nature")); + break; + case "industry_code" : + entitys.add(new ExcelExportEntity("行业代码" ,"industry_code")); + break; + case "enterprise_scale" : + entitys.add(new ExcelExportEntity("企业规模" ,"enterprise_scale")); + break; + case "registration_date" : + entitys.add(new ExcelExportEntity("成立日期" ,"registration_date")); + break; + case "registered_capital" : + entitys.add(new ExcelExportEntity("注册资本" ,"registered_capital")); + break; + case "legal_representative" : + entitys.add(new ExcelExportEntity("法定代表人" ,"legal_representative")); + break; + case "phone" : + entitys.add(new ExcelExportEntity("联系电话" ,"phone")); + break; + case "email" : + entitys.add(new ExcelExportEntity("邮箱" ,"email")); + break; + case "website" : + entitys.add(new ExcelExportEntity("网站" ,"website")); + break; + case "address" : + entitys.add(new ExcelExportEntity("地址" ,"address")); + break; + case "business_scope" : + entitys.add(new ExcelExportEntity("经营范围" ,"business_scope")); + break; + case "remark" : + entitys.add(new ExcelExportEntity("备注" ,"remark")); + break; + case "yunzhupaas_mdm_corporation_yunzhupaas_major_person_id" : + entitys.add(new ExcelExportEntity("负责人" ,"yunzhupaas_mdm_corporation_yunzhupaas_major_person_id")); + break; + case "tableField5ced3a-title_code": + tableField5ced3aList.add(new ExcelExportEntity("发票抬头编码" ,"title_code")); + break; + case "tableField5ced3a-title_name": + tableField5ced3aList.add(new ExcelExportEntity("发票抬头名称" ,"title_name")); + break; + case "tableField5ced3a-credit_code": + tableField5ced3aList.add(new ExcelExportEntity("纳税人识别号" ,"credit_code")); + break; + case "tableField5ced3a-tax_type": + tableField5ced3aList.add(new ExcelExportEntity("纳税人类别" ,"tax_type")); + break; + case "tableField5ced3a-address": + tableField5ced3aList.add(new ExcelExportEntity("地址" ,"address")); + break; + case "tableField5ced3a-phone": + tableField5ced3aList.add(new ExcelExportEntity("电话" ,"phone")); + break; + case "tableField5ced3a-bank_name": + tableField5ced3aList.add(new ExcelExportEntity("开户银行" ,"bank_name")); + break; + case "tableField5ced3a-bank_account": + tableField5ced3aList.add(new ExcelExportEntity("银行账户" ,"bank_account")); + break; + case "tableField5ced3a-is_defalut": + tableField5ced3aList.add(new ExcelExportEntity("是否默认抬头" ,"is_defalut")); + break; + case "tableField5ced3a-is_valid": + tableField5ced3aList.add(new ExcelExportEntity("是否有效" ,"is_valid")); + break; + case "tableField5ced3a-remark": + tableField5ced3aList.add(new ExcelExportEntity("备注" ,"remark")); + break; + case "tableFieldbd0aa4-bank_name": + tableFieldbd0aa4List.add(new ExcelExportEntity("开户行" ,"bank_name")); + break; + case "tableFieldbd0aa4-bank_account_name": + tableFieldbd0aa4List.add(new ExcelExportEntity("账户名" ,"bank_account_name")); + break; + case "tableFieldbd0aa4-bank_account_number": + tableFieldbd0aa4List.add(new ExcelExportEntity("银行账号" ,"bank_account_number")); + break; + case "tableFieldbd0aa4-bank_province": + tableFieldbd0aa4List.add(new ExcelExportEntity("开户行城市" ,"bank_province")); + break; + case "tableFieldbd0aa4-remark": + tableFieldbd0aa4List.add(new ExcelExportEntity("备注" ,"remark")); + break; + default: + break; + } + } + if(tableField5ced3aList.size() > 0){ + tableField5ced3aExcelEntity.setList(tableField5ced3aList); + entitys.add(tableField5ced3aExcelEntity); + } + if(tableFieldbd0aa4List.size() > 0){ + tableFieldbd0aa4ExcelEntity.setList(tableFieldbd0aa4List); + entitys.add(tableFieldbd0aa4ExcelEntity); + } + } + + ExportParams exportParams = new ExportParams(null, "表单信息"); + exportParams.setType(ExcelType.XSSF); + try{ + @Cleanup Workbook workbook = new HSSFWorkbook(); + if (entitys.size()>0){ + if (list.size()==0){ + list.add(new HashMap<>()); + } + //去除空数据 + List> dataList = new ArrayList<>(); + for (Map map : list) { + int i = 0; + for (String key : keys) { + //子表 + if (key.toLowerCase().startsWith("tablefield")) { + String tableField = key.substring(0, key.indexOf("-" )); + String field = key.substring(key.indexOf("-" ) + 1); + Object o = map.get(tableField); + if (o != null) { + List> childList = (List>) o; + for (Map childMap : childList) { + if (childMap.get(field) != null) { + i++; + } + } + } + } else { + Object o = map.get(key); + if (o != null) { + i++; + } + } + } + if (i > 0) { + dataList.add(map); + } + } + List mergerEntitys = new ArrayList<>(entitys); + List> mergerList=new ArrayList<>(dataList); + //复杂表头-表头和数据处理 + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(LpcConstant.getColumnData(), ColumnDataModel.class); + List complexHeaderList = columnDataModel.getComplexHeaderList(); + if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { + entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList, Objects.equals(columnDataModel.getType(), 4)); + dataList = VisualUtils.complexHeaderDataHandel(dataList, complexHeaderList, Objects.equals(columnDataModel.getType(), 4)); + } + + exportParams.setStyle(ExcelExportStyler.class); + workbook = ExcelExportUtil.exportExcel(exportParams, entitys, dataList); + VisualUtils.mergerVertical(workbook, mergerEntitys, mergerList); + ExcelModel excelModel = generaterSwapUtil.getExcelParams(LpcConstant.getFormData(),Arrays.asList(keys)); + ExcelHelper helper = new ExcelHelper(); + helper.init(workbook, exportParams, entitys, excelModel); + helper.doPreHandle(); + helper.doPostHandle(); + } + String fileName = menuFullName +"_"+ DateUtil.dateNow("yyyyMMddHHmmss") + ".xls"; + MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName); + String temporaryFilePath = configValueUtil.getTemporaryFilePath(); + FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName); + vo.setName(fileInfo.getFilename()); + vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName); + } catch (Exception e) { + log.error("信息导出Excel错误:{}", e.getMessage()); + e.printStackTrace(); + } + return vo; + } + @Operation(summary = "上传文件") + @PostMapping("/Uploader") + public ActionResult Uploader() { + List list = UpUtil.getFileAll(); + MultipartFile file = list.get(0); + if (file.getOriginalFilename().endsWith(".xlsx") || file.getOriginalFilename().endsWith(".xls")) { + String filePath = XSSEscape.escape(configValueUtil.getTemporaryFilePath()); + String fileName = XSSEscape.escape(RandomUtil.uuId() + "." + UpUtil.getFileType(file)); + //上传文件 + FileInfo fileInfo = FileUploadUtils.uploadFile(file, filePath, fileName); + DownloadVO vo = DownloadVO.builder().build(); + vo.setName(fileInfo.getFilename()); + return ActionResult.success(vo); + } else { + return ActionResult.fail(MsgCode.FA017.get()); + } + } + + /** + * 模板下载 + * + * @return + */ + @Operation(summary = "模板下载") + @GetMapping("/TemplateDownload") + public ActionResult TemplateDownload(@RequestParam("menuId") String menuId){ + DownloadVO vo = DownloadVO.builder().build(); + UserInfo userInfo = userProvider.get(); + String menuFullName = generaterSwapUtil.getMenuName(menuId); + //主表对象 + List entitys = new ArrayList<>(); + List selectKeys = new ArrayList<>(); + //以下添加字段 + entitys.add(new ExcelExportEntity("企业名称(company_name)" ,"company_name")); + selectKeys.add("company_name"); + entitys.add(new ExcelExportEntity("简称/昵称(short_name)" ,"short_name")); + selectKeys.add("short_name"); + entitys.add(new ExcelExportEntity("社会信用代码(credit_code)" ,"credit_code")); + selectKeys.add("credit_code"); + entitys.add(new ExcelExportEntity("纳税人类别(tax_type)" ,"tax_type")); + selectKeys.add("tax_type"); + entitys.add(new ExcelExportEntity("归属组织(org_id)" ,"org_id")); + selectKeys.add("org_id"); + entitys.add(new ExcelExportEntity("所属地区(province_id)" ,"province_id")); + selectKeys.add("province_id"); + entitys.add(new ExcelExportEntity("企业类型(enterprise_nature)" ,"enterprise_nature")); + selectKeys.add("enterprise_nature"); + entitys.add(new ExcelExportEntity("行业代码(industry_code)" ,"industry_code")); + selectKeys.add("industry_code"); + entitys.add(new ExcelExportEntity("企业规模(enterprise_scale)" ,"enterprise_scale")); + selectKeys.add("enterprise_scale"); + entitys.add(new ExcelExportEntity("成立日期(registration_date)" ,"registration_date")); + selectKeys.add("registration_date"); + entitys.add(new ExcelExportEntity("注册资本(registered_capital)" ,"registered_capital")); + selectKeys.add("registered_capital"); + entitys.add(new ExcelExportEntity("法定代表人(legal_representative)" ,"legal_representative")); + selectKeys.add("legal_representative"); + entitys.add(new ExcelExportEntity("联系电话(phone)" ,"phone")); + selectKeys.add("phone"); + entitys.add(new ExcelExportEntity("邮箱(email)" ,"email")); + selectKeys.add("email"); + entitys.add(new ExcelExportEntity("网站(website)" ,"website")); + selectKeys.add("website"); + entitys.add(new ExcelExportEntity("地址(address)" ,"address")); + selectKeys.add("address"); + entitys.add(new ExcelExportEntity("负责人(yunzhupaas_mdm_corporation_yunzhupaas_major_person_id)" ,"yunzhupaas_mdm_corporation_yunzhupaas_major_person_id")); + selectKeys.add("yunzhupaas_mdm_corporation_yunzhupaas_major_person_id"); + entitys.add(new ExcelExportEntity("经营范围(business_scope)" ,"business_scope")); + selectKeys.add("business_scope"); + entitys.add(new ExcelExportEntity("备注(remark)" ,"remark")); + selectKeys.add("remark"); + //tableField5ced3a子表对象 + ExcelExportEntity tableField5ced3aExcelEntity = new ExcelExportEntity("设计子表(tableField5ced3a)","tableField5ced3a"); + List tableField5ced3aExcelEntityList = new ArrayList<>(); + tableField5ced3aExcelEntityList.add(new ExcelExportEntity("发票抬头名称(tableField5ced3a-title_name)" ,"title_name")); + selectKeys.add("tableField5ced3a-title_name"); + tableField5ced3aExcelEntityList.add(new ExcelExportEntity("纳税人识别号(tableField5ced3a-credit_code)" ,"credit_code")); + selectKeys.add("tableField5ced3a-credit_code"); + tableField5ced3aExcelEntityList.add(new ExcelExportEntity("纳税人类别(tableField5ced3a-tax_type)" ,"tax_type")); + selectKeys.add("tableField5ced3a-tax_type"); + tableField5ced3aExcelEntityList.add(new ExcelExportEntity("地址(tableField5ced3a-address)" ,"address")); + selectKeys.add("tableField5ced3a-address"); + tableField5ced3aExcelEntityList.add(new ExcelExportEntity("电话(tableField5ced3a-phone)" ,"phone")); + selectKeys.add("tableField5ced3a-phone"); + tableField5ced3aExcelEntityList.add(new ExcelExportEntity("开户银行(tableField5ced3a-bank_name)" ,"bank_name")); + selectKeys.add("tableField5ced3a-bank_name"); + tableField5ced3aExcelEntityList.add(new ExcelExportEntity("银行账户(tableField5ced3a-bank_account)" ,"bank_account")); + selectKeys.add("tableField5ced3a-bank_account"); + tableField5ced3aExcelEntityList.add(new ExcelExportEntity("是否默认抬头(tableField5ced3a-is_defalut)" ,"is_defalut")); + selectKeys.add("tableField5ced3a-is_defalut"); + tableField5ced3aExcelEntityList.add(new ExcelExportEntity("是否有效(tableField5ced3a-is_valid)" ,"is_valid")); + selectKeys.add("tableField5ced3a-is_valid"); + tableField5ced3aExcelEntityList.add(new ExcelExportEntity("备注(tableField5ced3a-remark)" ,"remark")); + selectKeys.add("tableField5ced3a-remark"); + tableField5ced3aExcelEntity.setList(tableField5ced3aExcelEntityList); + if(tableField5ced3aExcelEntityList.size() > 0){ + entitys.add(tableField5ced3aExcelEntity); + } + //tableFieldbd0aa4子表对象 + ExcelExportEntity tableFieldbd0aa4ExcelEntity = new ExcelExportEntity("设计子表(tableFieldbd0aa4)","tableFieldbd0aa4"); + List tableFieldbd0aa4ExcelEntityList = new ArrayList<>(); + tableFieldbd0aa4ExcelEntityList.add(new ExcelExportEntity("开户行(tableFieldbd0aa4-bank_name)" ,"bank_name")); + selectKeys.add("tableFieldbd0aa4-bank_name"); + tableFieldbd0aa4ExcelEntityList.add(new ExcelExportEntity("账户名(tableFieldbd0aa4-bank_account_name)" ,"bank_account_name")); + selectKeys.add("tableFieldbd0aa4-bank_account_name"); + tableFieldbd0aa4ExcelEntityList.add(new ExcelExportEntity("银行账号(tableFieldbd0aa4-bank_account_number)" ,"bank_account_number")); + selectKeys.add("tableFieldbd0aa4-bank_account_number"); + tableFieldbd0aa4ExcelEntityList.add(new ExcelExportEntity("开户行城市(tableFieldbd0aa4-bank_province)" ,"bank_province")); + selectKeys.add("tableFieldbd0aa4-bank_province"); + tableFieldbd0aa4ExcelEntityList.add(new ExcelExportEntity("备注(tableFieldbd0aa4-remark)" ,"remark")); + selectKeys.add("tableFieldbd0aa4-remark"); + tableFieldbd0aa4ExcelEntity.setList(tableFieldbd0aa4ExcelEntityList); + if(tableFieldbd0aa4ExcelEntityList.size() > 0){ + entitys.add(tableFieldbd0aa4ExcelEntity); + } + ExcelModel excelModel = generaterSwapUtil.getExcelParams(LpcConstant.getFormData(),selectKeys); + List> list = new ArrayList<>(); + list.add(excelModel.getDataMap()); + + ExportParams exportParams = new ExportParams(null, menuFullName + "模板"); + exportParams.setStyle(ExcelExportStyler.class); + exportParams.setType(ExcelType.XSSF); + try{ + @Cleanup Workbook workbook = new HSSFWorkbook(); + if (entitys.size()>0){ + if (list.size()==0){ + list.add(new HashMap<>()); + } + //复杂表头-表头和数据处理 + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(LpcConstant.getColumnData(), ColumnDataModel.class); + List complexHeaderList = columnDataModel.getComplexHeaderList(); + if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { + entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList, false); + list = VisualUtils.complexHeaderDataHandel(list, complexHeaderList, false); + } + workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list); + ExcelHelper helper = new ExcelHelper(); + helper.init(workbook, exportParams, entitys, excelModel); + helper.doPreHandle(); + helper.doPostHandle(); + } + String fileName = menuFullName + "导入模板.xls"; + MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName); + String temporaryFilePath = configValueUtil.getTemporaryFilePath(); + FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName); + vo.setName(fileInfo.getFilename()); + vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName); + } catch (Exception e) { + log.error("模板信息导出Excel错误:{}", e.getMessage()); + e.printStackTrace(); + } + return ActionResult.success(vo); + } + + /** + * 导入预览 + * + * @return + */ + @Operation(summary = "导入预览" ) + @GetMapping("/ImportPreview") + public ActionResult> ImportPreview(String fileName) throws Exception { + Map headAndDataMap = new HashMap<>(2); + String filePath = FileUploadUtils.getLocalBasePath() + configValueUtil.getTemporaryFilePath(); + FileUploadUtils.downLocal(configValueUtil.getTemporaryFilePath(), filePath, fileName); + File temporary = new File(XSSEscape.escapePath(filePath + fileName)); + int headerRowIndex = 2; + ImportParams params = new ImportParams(); + params.setTitleRows(0); + params.setHeadRows(headerRowIndex); + params.setNeedVerify(true); + try { + InputStream inputStream = ExcelUtil.solveOrginTitle(temporary, headerRowIndex); + List excelDataList = ExcelUtil.importExcelByInputStream(inputStream, 0, headerRowIndex, Map.class); + //数据超过1000条 + if(excelDataList != null && excelDataList.size() > 1000) { + return ActionResult.fail(MsgCode.ETD117.get()); + } + + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(LpcConstant.getColumnData(), ColumnDataModel.class); + UploaderTemplateModel uploaderTemplateModel = JsonUtil.getJsonToBean(columnDataModel.getUploaderTemplateJson(), UploaderTemplateModel.class); + List selectKey = uploaderTemplateModel.getSelectKey(); + //子表合并 + List> results = FormExecelUtils.dataMergeChildTable(excelDataList,selectKey); + // 导入字段 + List columns = new ArrayList<>(); + columns.add(new ExcelImFieldModel("company_name","企业名称","input")); + columns.add(new ExcelImFieldModel("short_name","简称/昵称","input")); + columns.add(new ExcelImFieldModel("credit_code","社会信用代码","input")); + columns.add(new ExcelImFieldModel("tax_type","纳税人类别","select")); + columns.add(new ExcelImFieldModel("org_id","归属组织","organizeSelect")); + columns.add(new ExcelImFieldModel("province_id","所属地区","areaSelect")); + columns.add(new ExcelImFieldModel("enterprise_nature","企业类型","select")); + columns.add(new ExcelImFieldModel("industry_code","行业代码","select")); + columns.add(new ExcelImFieldModel("enterprise_scale","企业规模","select")); + columns.add(new ExcelImFieldModel("registration_date","成立日期","datePicker")); + columns.add(new ExcelImFieldModel("registered_capital","注册资本","inputNumber")); + columns.add(new ExcelImFieldModel("legal_representative","法定代表人","input")); + columns.add(new ExcelImFieldModel("phone","联系电话","input")); + columns.add(new ExcelImFieldModel("email","邮箱","input")); + columns.add(new ExcelImFieldModel("website","网站","input")); + columns.add(new ExcelImFieldModel("address","地址","input")); + columns.add(new ExcelImFieldModel("yunzhupaas_mdm_corporation_yunzhupaas_major_person_id","负责人","userSelect")); + columns.add(new ExcelImFieldModel("business_scope","经营范围","textarea")); + columns.add(new ExcelImFieldModel("remark","备注","textarea")); + //tableField5ced3a子表对象 + List tableField5ced3acolumns = new ArrayList<>(); + tableField5ced3acolumns.add(new ExcelImFieldModel("title_name" ,"*发票抬头名称")); + tableField5ced3acolumns.add(new ExcelImFieldModel("credit_code" ,"*纳税人识别号")); + tableField5ced3acolumns.add(new ExcelImFieldModel("tax_type" ,"*纳税人类别")); + tableField5ced3acolumns.add(new ExcelImFieldModel("address" ,"地址")); + tableField5ced3acolumns.add(new ExcelImFieldModel("phone" ,"电话")); + tableField5ced3acolumns.add(new ExcelImFieldModel("bank_name" ,"开户银行")); + tableField5ced3acolumns.add(new ExcelImFieldModel("bank_account" ,"银行账户")); + tableField5ced3acolumns.add(new ExcelImFieldModel("is_defalut" ,"是否默认抬头")); + tableField5ced3acolumns.add(new ExcelImFieldModel("is_valid" ,"是否有效")); + tableField5ced3acolumns.add(new ExcelImFieldModel("remark" ,"备注")); + columns.add(new ExcelImFieldModel("tableField5ced3a","设计子表","table",tableField5ced3acolumns)); + //tableFieldbd0aa4子表对象 + List tableFieldbd0aa4columns = new ArrayList<>(); + tableFieldbd0aa4columns.add(new ExcelImFieldModel("bank_name" ,"开户行")); + tableFieldbd0aa4columns.add(new ExcelImFieldModel("bank_account_name" ,"账户名")); + tableFieldbd0aa4columns.add(new ExcelImFieldModel("bank_account_number" ,"银行账号")); + tableFieldbd0aa4columns.add(new ExcelImFieldModel("bank_province" ,"开户行城市")); + tableFieldbd0aa4columns.add(new ExcelImFieldModel("remark" ,"备注")); + columns.add(new ExcelImFieldModel("tableFieldbd0aa4","设计子表","table",tableFieldbd0aa4columns)); + headAndDataMap.put("dataRow" , results); + headAndDataMap.put("headerRow" , JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(columns))); + } catch (Exception e){ + e.printStackTrace(); + return ActionResult.fail(MsgCode.VS407.get()); + } + return ActionResult.success(headAndDataMap); + } + + /** + * 导入数据 + * + * @return + */ + @Operation(summary = "导入数据" ) + @PostMapping("/ImportData") + public ActionResult ImportData(@RequestBody VisualImportModel visualImportModel) throws Exception { + List> listData = visualImportModel.getList(); + ImportFormCheckUniqueModel uniqueModel = new ImportFormCheckUniqueModel(); + uniqueModel.setDbLinkId(LpcConstant.DBLINKID); + uniqueModel.setUpdate(Objects.equals("2", "2")); + + Map tablefieldkey = new HashMap<>(); + for(String key:LpcConstant.TABLEFIELDKEY.keySet()){ + tablefieldkey.put(key,LpcConstant.TABLERENAMES.get(LpcConstant.TABLEFIELDKEY.get(key))); + } + ExcelImportModel excelImportModel = generaterSwapUtil.importData(LpcConstant.getFormData(),listData,uniqueModel, tablefieldkey,LpcConstant.getTableList()); + List importDataModel = uniqueModel.getImportDataModel(); + for (ImportDataModel model : importDataModel) { + String id = model.getId(); + Map result = model.getResultData(); + if(StringUtil.isNotEmpty(id)){ + update(id, JsonUtil.getJsonToBean(result,LpcForm.class), true); + }else { + create( JsonUtil.getJsonToBean(result,LpcForm.class)); + } + } + return ActionResult.success(excelImportModel); + } + + /** + * 导出异常报告 + * + * @return + */ + @Operation(summary = "导出异常报告") + @PostMapping("/ImportExceptionData") + public ActionResult ImportExceptionData(@RequestBody VisualImportModel visualImportModel) { + DownloadVO vo = DownloadVO.builder().build(); + UserInfo userInfo = userProvider.get(); + String menuFullName = generaterSwapUtil.getMenuName(visualImportModel.getMenuId()); + //主表对象 + List entitys = new ArrayList<>(); + entitys.add(new ExcelExportEntity("异常原因", "errorsInfo",30)); + List selectKeys = new ArrayList<>(); + //以下添加字段 + entitys.add(new ExcelExportEntity("企业名称(company_name)" ,"company_name")); + selectKeys.add("company_name"); + entitys.add(new ExcelExportEntity("简称/昵称(short_name)" ,"short_name")); + selectKeys.add("short_name"); + entitys.add(new ExcelExportEntity("社会信用代码(credit_code)" ,"credit_code")); + selectKeys.add("credit_code"); + entitys.add(new ExcelExportEntity("纳税人类别(tax_type)" ,"tax_type")); + selectKeys.add("tax_type"); + entitys.add(new ExcelExportEntity("归属组织(org_id)" ,"org_id")); + selectKeys.add("org_id"); + entitys.add(new ExcelExportEntity("所属地区(province_id)" ,"province_id")); + selectKeys.add("province_id"); + entitys.add(new ExcelExportEntity("企业类型(enterprise_nature)" ,"enterprise_nature")); + selectKeys.add("enterprise_nature"); + entitys.add(new ExcelExportEntity("行业代码(industry_code)" ,"industry_code")); + selectKeys.add("industry_code"); + entitys.add(new ExcelExportEntity("企业规模(enterprise_scale)" ,"enterprise_scale")); + selectKeys.add("enterprise_scale"); + entitys.add(new ExcelExportEntity("成立日期(registration_date)" ,"registration_date")); + selectKeys.add("registration_date"); + entitys.add(new ExcelExportEntity("注册资本(registered_capital)" ,"registered_capital")); + selectKeys.add("registered_capital"); + entitys.add(new ExcelExportEntity("法定代表人(legal_representative)" ,"legal_representative")); + selectKeys.add("legal_representative"); + entitys.add(new ExcelExportEntity("联系电话(phone)" ,"phone")); + selectKeys.add("phone"); + entitys.add(new ExcelExportEntity("邮箱(email)" ,"email")); + selectKeys.add("email"); + entitys.add(new ExcelExportEntity("网站(website)" ,"website")); + selectKeys.add("website"); + entitys.add(new ExcelExportEntity("地址(address)" ,"address")); + selectKeys.add("address"); + entitys.add(new ExcelExportEntity("负责人(yunzhupaas_mdm_corporation_yunzhupaas_major_person_id)" ,"yunzhupaas_mdm_corporation_yunzhupaas_major_person_id")); + selectKeys.add("yunzhupaas_mdm_corporation_yunzhupaas_major_person_id"); + entitys.add(new ExcelExportEntity("经营范围(business_scope)" ,"business_scope")); + selectKeys.add("business_scope"); + entitys.add(new ExcelExportEntity("备注(remark)" ,"remark")); + selectKeys.add("remark"); + //tableField5ced3a子表对象 + ExcelExportEntity tableField5ced3aExcelEntity = new ExcelExportEntity("设计子表(tableField5ced3a)","tableField5ced3a"); + List tableField5ced3aExcelEntityList = new ArrayList<>(); + tableField5ced3aExcelEntityList.add(new ExcelExportEntity("发票抬头名称(tableField5ced3a-title_name)" ,"title_name")); + selectKeys.add("tableField5ced3a-title_name"); + tableField5ced3aExcelEntityList.add(new ExcelExportEntity("纳税人识别号(tableField5ced3a-credit_code)" ,"credit_code")); + selectKeys.add("tableField5ced3a-credit_code"); + tableField5ced3aExcelEntityList.add(new ExcelExportEntity("纳税人类别(tableField5ced3a-tax_type)" ,"tax_type")); + selectKeys.add("tableField5ced3a-tax_type"); + tableField5ced3aExcelEntityList.add(new ExcelExportEntity("地址(tableField5ced3a-address)" ,"address")); + selectKeys.add("tableField5ced3a-address"); + tableField5ced3aExcelEntityList.add(new ExcelExportEntity("电话(tableField5ced3a-phone)" ,"phone")); + selectKeys.add("tableField5ced3a-phone"); + tableField5ced3aExcelEntityList.add(new ExcelExportEntity("开户银行(tableField5ced3a-bank_name)" ,"bank_name")); + selectKeys.add("tableField5ced3a-bank_name"); + tableField5ced3aExcelEntityList.add(new ExcelExportEntity("银行账户(tableField5ced3a-bank_account)" ,"bank_account")); + selectKeys.add("tableField5ced3a-bank_account"); + tableField5ced3aExcelEntityList.add(new ExcelExportEntity("是否默认抬头(tableField5ced3a-is_defalut)" ,"is_defalut")); + selectKeys.add("tableField5ced3a-is_defalut"); + tableField5ced3aExcelEntityList.add(new ExcelExportEntity("是否有效(tableField5ced3a-is_valid)" ,"is_valid")); + selectKeys.add("tableField5ced3a-is_valid"); + tableField5ced3aExcelEntityList.add(new ExcelExportEntity("备注(tableField5ced3a-remark)" ,"remark")); + selectKeys.add("tableField5ced3a-remark"); + tableField5ced3aExcelEntity.setList(tableField5ced3aExcelEntityList); + entitys.add(tableField5ced3aExcelEntity); + //tableFieldbd0aa4子表对象 + ExcelExportEntity tableFieldbd0aa4ExcelEntity = new ExcelExportEntity("设计子表(tableFieldbd0aa4)","tableFieldbd0aa4"); + List tableFieldbd0aa4ExcelEntityList = new ArrayList<>(); + tableFieldbd0aa4ExcelEntityList.add(new ExcelExportEntity("开户行(tableFieldbd0aa4-bank_name)" ,"bank_name")); + selectKeys.add("tableFieldbd0aa4-bank_name"); + tableFieldbd0aa4ExcelEntityList.add(new ExcelExportEntity("账户名(tableFieldbd0aa4-bank_account_name)" ,"bank_account_name")); + selectKeys.add("tableFieldbd0aa4-bank_account_name"); + tableFieldbd0aa4ExcelEntityList.add(new ExcelExportEntity("银行账号(tableFieldbd0aa4-bank_account_number)" ,"bank_account_number")); + selectKeys.add("tableFieldbd0aa4-bank_account_number"); + tableFieldbd0aa4ExcelEntityList.add(new ExcelExportEntity("开户行城市(tableFieldbd0aa4-bank_province)" ,"bank_province")); + selectKeys.add("tableFieldbd0aa4-bank_province"); + tableFieldbd0aa4ExcelEntityList.add(new ExcelExportEntity("备注(tableFieldbd0aa4-remark)" ,"remark")); + selectKeys.add("tableFieldbd0aa4-remark"); + tableFieldbd0aa4ExcelEntity.setList(tableFieldbd0aa4ExcelEntityList); + entitys.add(tableFieldbd0aa4ExcelEntity); + ExcelModel excelModel = generaterSwapUtil.getExcelParams(LpcConstant.getFormData(),selectKeys); + List> list = new ArrayList<>(); + list.addAll(visualImportModel.getList()); + + ExportParams exportParams = new ExportParams(null, menuFullName + "模板"); + exportParams.setStyle(ExcelExportStyler.class); + exportParams.setType(ExcelType.XSSF); + exportParams.setFreezeCol(1); + try{ + @Cleanup Workbook workbook = new HSSFWorkbook(); + if (entitys.size()>0){ + if (list.size()==0){ + list.add(new HashMap<>()); + } + //复杂表头-表头和数据处理 + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(LpcConstant.getColumnData(), ColumnDataModel.class); + List complexHeaderList = columnDataModel.getComplexHeaderList(); + if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { + entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList, false); + list = VisualUtils.complexHeaderDataHandel(list, complexHeaderList, false); + } + + workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list); + ExcelHelper helper = new ExcelHelper(); + helper.init(workbook, exportParams, entitys, excelModel); + helper.doPreHandle(); + helper.doPostHandle(); + } + + String fileName = menuFullName + "错误报告_" + DateUtil.dateNow("yyyyMMddHHmmss") + ".xls"; + MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName); + String temporaryFilePath = configValueUtil.getTemporaryFilePath(); + FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName); + vo.setName(fileInfo.getFilename()); + vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName); + } catch (Exception e) { + e.printStackTrace(); + } + return ActionResult.success(vo); + } + /** + * 删除 + * @param id + * @return + */ + @Operation(summary = "删除") + @DeleteMapping("/{id}") + @Transactional + public ActionResult delete(@PathVariable("id") String id,@RequestParam(name = "forceDel",defaultValue = "false") boolean forceDel) throws Exception{ + CompanyEntity entity= companyService.getInfo(id); + if(entity!=null){ + //假删除 + entity.setDeleteMark(1); + entity.setDeleteUserId(userProvider.get().getUserId()); + entity.setDeleteTime(new Date()); + companyService.setIgnoreLogicDelete().updateById(entity); + } + return ActionResult.success(MsgCode.SU003.get()); + } + /** + * 批量删除 + * @param obj + * @return + */ + @DeleteMapping("/batchRemove") + @Transactional + @Operation(summary = "批量删除") + public ActionResult batchRemove(@RequestBody Object obj){ + Map objectMap = JsonUtil.entityToMap(obj); + List idList = JsonUtil.getJsonToList(objectMap.get("ids"), String.class); + String errInfo = ""; + List successList = new ArrayList<>(); + for (String allId : idList){ + try { + this.delete(allId,false); + successList.add(allId); + } catch (Exception e) { + errInfo = e.getMessage(); + } + } + if (successList.size() == 0 && StringUtil.isNotEmpty(errInfo)){ + return ActionResult.fail(errInfo); + } + return ActionResult.success(MsgCode.SU003.get()); + } + /** + * 编辑 + * @param id + * @param companyForm + * @return + */ + @PutMapping("/{id}") + @Operation(summary = "更新") + public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid LpcForm companyForm, + @RequestParam(value = "isImport", required = false) boolean isImport){ + CompanyEntity entity= companyService.getInfo(id); + if(entity!=null){ + companyForm.setCompanyId(String.valueOf(entity.getCompanyId())); + + if (!isImport) { + String b = companyService.checkForm(companyForm,1); + if (StringUtil.isNotEmpty(b)){ + return ActionResult.fail(b ); + } + } + + try{ + companyService.saveOrUpdate(companyForm,id,false); + }catch (DataException e1){ + return ActionResult.fail(e1.getMessage()); + }catch(Exception e){ + return ActionResult.fail(MsgCode.FA029.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + }else{ + return ActionResult.fail(MsgCode.FA002.get()); + } + } + /** + * 表单信息(详情页) + * 详情页面使用-转换数据 + * @param id + * @return + */ + @Operation(summary = "表单信息(详情页)") + @GetMapping("/detail/{id}") + public ActionResult detailInfo(@PathVariable("id") String id){ + CompanyEntity entity= companyService.getInfo(id); + if(entity==null){ + return ActionResult.fail(MsgCode.FA001.get()); + } + Map companyMap=JsonUtil.entityToMap(entity); + companyMap.put("id", companyMap.get("company_id")); + //副表数据 + CorporationEntity corporationEntity = entity.getCorporation(); + if(ObjectUtil.isNotEmpty(corporationEntity)){ + Map corporationMap=JsonUtil.entityToMap(corporationEntity); + for(String key:corporationMap.keySet()){ + companyMap.put("yunzhupaas_mdm_corporation_yunzhupaas_"+key,corporationMap.get(key)); + } + } + //子表数据 + List company_invoiceList = entity.getCompanyInvoice(); + companyMap.put("tableField5ced3a",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(company_invoiceList))); + companyMap.put("company_invoiceList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(company_invoiceList))); + List companyBankList = entity.getCompanyBank(); + companyMap.put("tableFieldbd0aa4",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyBankList))); + companyMap.put("companyBankList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyBankList))); + boolean isPc = "pc".equals(ServletUtil.getHeader("yunzhupaas-origin" )); + companyMap = generaterSwapUtil.swapDataDetail(companyMap,LpcConstant.getFormData(),"816296614598542021",isPc?false:false); + //子表数据 + companyMap.put("company_invoiceList",companyMap.get("tableField5ced3a")); + companyMap.put("companyBankList",companyMap.get("tableFieldbd0aa4")); + return ActionResult.success(companyMap); + } + /** + * 获取详情(编辑页) + * 编辑页面使用-不转换数据 + * @param id + * @return + */ + @Operation(summary = "信息") + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id){ + CompanyEntity entity= companyService.getInfo(id); + if(entity==null){ + return ActionResult.fail(MsgCode.FA001.get()); + } + Map companyMap=JsonUtil.entityToMap(entity); + companyMap.put("id", companyMap.get("company_id")); + //副表数据 + CorporationEntity corporationEntity = entity.getCorporation(); + if(ObjectUtil.isNotEmpty(corporationEntity)){ + Map corporationMap=JsonUtil.entityToMap(corporationEntity); + for(String key:corporationMap.keySet()){ + companyMap.put("yunzhupaas_mdm_corporation_yunzhupaas_"+key,corporationMap.get(key)); + } + } + //子表数据 + List company_invoiceList = entity.getCompanyInvoice(); + companyMap.put("tableField5ced3a",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(company_invoiceList))); + companyMap.put("company_invoiceList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(company_invoiceList))); + List companyBankList = entity.getCompanyBank(); + companyMap.put("tableFieldbd0aa4",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyBankList))); + companyMap.put("companyBankList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyBankList))); + companyMap = generaterSwapUtil.swapDataForm(companyMap,LpcConstant.getFormData(),LpcConstant.TABLEFIELDKEY,LpcConstant.TABLERENAMES); + return ActionResult.success(companyMap); + } + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-controller/src/main/java/com/yunzhupaas/mdm/controller/MaterialController.java b/yunzhupaas-mdm/yunzhupaas-mdm-controller/src/main/java/com/yunzhupaas/mdm/controller/MaterialController.java new file mode 100644 index 0000000..b34825f --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-controller/src/main/java/com/yunzhupaas/mdm/controller/MaterialController.java @@ -0,0 +1,679 @@ +package com.yunzhupaas.mdm.controller; + + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.mdm.service.*; +import com.yunzhupaas.mdm.entity.*; +import com.yunzhupaas.util.*; +import com.yunzhupaas.mdm.model.material.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import com.yunzhupaas.flowable.entity.TaskEntity; +import jakarta.validation.Valid; +import java.util.*; +import com.yunzhupaas.model.ExcelModel; +import com.yunzhupaas.excel.ExcelExportStyler; +import com.yunzhupaas.excel.ExcelHelper; +import com.yunzhupaas.annotation.YunzhupaasField; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.base.entity.ProvinceEntity; +import java.io.IOException; +import java.util.stream.Collectors; +import com.yunzhupaas.flowable.entity.TaskEntity; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.model.visualJson.UploaderTemplateModel; +import com.yunzhupaas.base.util.FormExecelUtils; +import org.springframework.web.multipart.MultipartFile; +import cn.afterturn.easypoi.excel.ExcelExportUtil; +import cn.afterturn.easypoi.excel.ExcelImportUtil; +import cn.afterturn.easypoi.excel.entity.ExportParams; +import cn.afterturn.easypoi.excel.entity.ImportParams; +import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; +import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.Workbook; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import com.yunzhupaas.onlinedev.model.ExcelImFieldModel; +import com.yunzhupaas.base.model.OnlineImport.ImportDataModel; +import com.yunzhupaas.base.model.OnlineImport.ImportFormCheckUniqueModel; +import com.yunzhupaas.base.model.OnlineImport.ExcelImportModel; +import com.yunzhupaas.base.model.OnlineImport.VisualImportModel; +import cn.xuyanwu.spring.file.storage.FileInfo; +import lombok.Cleanup; +import com.yunzhupaas.model.visualJson.config.HeaderModel; +import com.yunzhupaas.base.model.ColumnDataModel; +import com.yunzhupaas.base.util.VisualUtils; +import org.springframework.transaction.annotation.Transactional; + +/** + * 物料信息 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-27 + */ +@Slf4j +@RestController +@Tag(name = "物料信息" , description = "bcm") +@RequestMapping("/api/bcm/Material") +public class MaterialController { + + @Autowired + private GeneraterSwapUtil generaterSwapUtil; + + @Autowired + private UserProvider userProvider; + + @Autowired + private MaterialService materialService; + + + + @Autowired + private ConfigValueUtil configValueUtil; + + /** + * 列表 + * + * @param materialPagination + * @return + */ + @Operation(summary = "获取列表") + @PostMapping("/getList") + public ActionResult list(@RequestBody MaterialPagination materialPagination)throws Exception{ + List list= materialService.getList(materialPagination); + List> realList=new ArrayList<>(); + for (MaterialEntity entity : list) { + Map materialMap=JsonUtil.entityToMap(entity); + materialMap.put("id", materialMap.get("material_id")); + //副表数据 + //子表数据 + realList.add(materialMap); + } + //数据转换 + boolean isPc = "pc".equals(ServletUtil.getHeader("yunzhupaas-origin" )); + realList = generaterSwapUtil.swapDataList(realList, MaterialConstant.getFormData(), MaterialConstant.getColumnData(), materialPagination.getModuleId(),isPc?false:false); + + //返回对象 + PageListVO vo = new PageListVO(); + vo.setList(realList); + PaginationVO page = JsonUtil.getJsonToBean(materialPagination, PaginationVO.class); + vo.setPagination(page); + return ActionResult.success(vo); + } + /** + * 创建 + * + * @param materialForm + * @return + */ + @PostMapping() + @Operation(summary = "创建") + public ActionResult create(@RequestBody @Valid MaterialForm materialForm) { + String b = materialService.checkForm(materialForm,0); + if (StringUtil.isNotEmpty(b)){ + return ActionResult.fail(b ); + } + try{ + materialService.saveOrUpdate(materialForm, null ,true); + }catch(Exception e){ + return ActionResult.fail(MsgCode.FA028.get()); + } + return ActionResult.success(MsgCode.SU001.get()); + } + /** + * 导出Excel + * + * @return + */ + @Operation(summary = "导出Excel") + @PostMapping("/Actions/Export") + public ActionResult Export(@RequestBody MaterialPagination materialPagination) throws IOException { + if (StringUtil.isEmpty(materialPagination.getSelectKey())){ + return ActionResult.fail(MsgCode.IMP011.get()); + } + List list= materialService.getList(materialPagination); + List> realList=new ArrayList<>(); + for (MaterialEntity entity : list) { + Map materialMap=JsonUtil.entityToMap(entity); + materialMap.put("id", materialMap.get("material_id")); + //副表数据 + //子表数据 + realList.add(materialMap); + } + //数据转换 + realList = generaterSwapUtil.swapDataList(realList, MaterialConstant.getFormData(), MaterialConstant.getColumnData(), materialPagination.getModuleId(),false); + String[]keys=!StringUtil.isEmpty(materialPagination.getSelectKey())?materialPagination.getSelectKey():new String[0]; + UserInfo userInfo=userProvider.get(); + String menuFullName = generaterSwapUtil.getMenuName(materialPagination.getMenuId()); + + DownloadVO vo=this.creatModelExcel(configValueUtil.getTemporaryFilePath(),realList,keys,userInfo,menuFullName); + return ActionResult.success(vo); + } + + /** + * 导出表格方法 + */ + public DownloadVO creatModelExcel(String path,List>list,String[]keys,UserInfo userInfo,String menuFullName){ + DownloadVO vo=DownloadVO.builder().build(); + List entitys=new ArrayList<>(); + if(keys.length>0){ + for(String key:keys){ + switch(key){ + case "material_code" : + entitys.add(new ExcelExportEntity("物料编码" ,"material_code")); + break; + case "material_name" : + entitys.add(new ExcelExportEntity("物料名称" ,"material_name")); + break; + case "material_category" : + entitys.add(new ExcelExportEntity("物料分类" ,"material_category")); + break; + case "material_model" : + entitys.add(new ExcelExportEntity("规格型号" ,"material_model")); + break; + case "unit_name" : + entitys.add(new ExcelExportEntity("单位名称" ,"unit_name")); + break; + case "brand" : + entitys.add(new ExcelExportEntity("品牌" ,"brand")); + break; + case "tax_rate" : + entitys.add(new ExcelExportEntity("税率" ,"tax_rate")); + break; + case "tax_code" : + entitys.add(new ExcelExportEntity("税收分类" ,"tax_code")); + break; + case "texture" : + entitys.add(new ExcelExportEntity("材质/纹理" ,"texture")); + break; + case "quality_standard" : + entitys.add(new ExcelExportEntity("质量标准" ,"quality_standard")); + break; + case "technical_standard" : + entitys.add(new ExcelExportEntity("技术标准" ,"technical_standard")); + break; + case "acceptance_criteria" : + entitys.add(new ExcelExportEntity("验收标准" ,"acceptance_criteria")); + break; + case "delivery_requirements" : + entitys.add(new ExcelExportEntity("交付要求" ,"delivery_requirements")); + break; + case "storage_conditions" : + entitys.add(new ExcelExportEntity("储存条件" ,"storage_conditions")); + break; + default: + break; + } + } + } + + ExportParams exportParams = new ExportParams(null, "表单信息"); + exportParams.setType(ExcelType.XSSF); + try{ + @Cleanup Workbook workbook = new HSSFWorkbook(); + if (entitys.size()>0){ + if (list.size()==0){ + list.add(new HashMap<>()); + } + //去除空数据 + List> dataList = new ArrayList<>(); + for (Map map : list) { + int i = 0; + for (String key : keys) { + //子表 + if (key.toLowerCase().startsWith("tablefield")) { + String tableField = key.substring(0, key.indexOf("-" )); + String field = key.substring(key.indexOf("-" ) + 1); + Object o = map.get(tableField); + if (o != null) { + List> childList = (List>) o; + for (Map childMap : childList) { + if (childMap.get(field) != null) { + i++; + } + } + } + } else { + Object o = map.get(key); + if (o != null) { + i++; + } + } + } + if (i > 0) { + dataList.add(map); + } + } + List mergerEntitys = new ArrayList<>(entitys); + List> mergerList=new ArrayList<>(dataList); + //复杂表头-表头和数据处理 + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(MaterialConstant.getColumnData(), ColumnDataModel.class); + List complexHeaderList = columnDataModel.getComplexHeaderList(); + if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { + entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList, Objects.equals(columnDataModel.getType(), 4)); + dataList = VisualUtils.complexHeaderDataHandel(dataList, complexHeaderList, Objects.equals(columnDataModel.getType(), 4)); + } + + exportParams.setStyle(ExcelExportStyler.class); + workbook = ExcelExportUtil.exportExcel(exportParams, entitys, dataList); + VisualUtils.mergerVertical(workbook, mergerEntitys, mergerList); + ExcelModel excelModel = generaterSwapUtil.getExcelParams(MaterialConstant.getFormData(),Arrays.asList(keys)); + ExcelHelper helper = new ExcelHelper(); + helper.init(workbook, exportParams, entitys, excelModel); + helper.doPreHandle(); + helper.doPostHandle(); + } + String fileName = menuFullName +"_"+ DateUtil.dateNow("yyyyMMddHHmmss") + ".xls"; + MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName); + String temporaryFilePath = configValueUtil.getTemporaryFilePath(); + FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName); + vo.setName(fileInfo.getFilename()); + vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName); + } catch (Exception e) { + log.error("信息导出Excel错误:{}", e.getMessage()); + e.printStackTrace(); + } + return vo; + } + @Operation(summary = "上传文件") + @PostMapping("/Uploader") + public ActionResult Uploader() { + List list = UpUtil.getFileAll(); + MultipartFile file = list.get(0); + if (file.getOriginalFilename().endsWith(".xlsx") || file.getOriginalFilename().endsWith(".xls")) { + String filePath = XSSEscape.escape(configValueUtil.getTemporaryFilePath()); + String fileName = XSSEscape.escape(RandomUtil.uuId() + "." + UpUtil.getFileType(file)); + //上传文件 + FileInfo fileInfo = FileUploadUtils.uploadFile(file, filePath, fileName); + DownloadVO vo = DownloadVO.builder().build(); + vo.setName(fileInfo.getFilename()); + return ActionResult.success(vo); + } else { + return ActionResult.fail(MsgCode.FA017.get()); + } + } + + /** + * 模板下载 + * + * @return + */ + @Operation(summary = "模板下载") + @GetMapping("/TemplateDownload") + public ActionResult TemplateDownload(@RequestParam("menuId") String menuId){ + DownloadVO vo = DownloadVO.builder().build(); + UserInfo userInfo = userProvider.get(); + String menuFullName = generaterSwapUtil.getMenuName(menuId); + //主表对象 + List entitys = new ArrayList<>(); + List selectKeys = new ArrayList<>(); + //以下添加字段 + entitys.add(new ExcelExportEntity("物料名称(material_name)" ,"material_name")); + selectKeys.add("material_name"); + entitys.add(new ExcelExportEntity("物料分类(material_category)" ,"material_category")); + selectKeys.add("material_category"); + entitys.add(new ExcelExportEntity("规格型号(material_model)" ,"material_model")); + selectKeys.add("material_model"); + entitys.add(new ExcelExportEntity("单位名称(unit_name)" ,"unit_name")); + selectKeys.add("unit_name"); + entitys.add(new ExcelExportEntity("品牌(brand)" ,"brand")); + selectKeys.add("brand"); + entitys.add(new ExcelExportEntity("税率(tax_rate)" ,"tax_rate")); + selectKeys.add("tax_rate"); + entitys.add(new ExcelExportEntity("税收分类(tax_code)" ,"tax_code")); + selectKeys.add("tax_code"); + entitys.add(new ExcelExportEntity("材质/纹理(texture)" ,"texture")); + selectKeys.add("texture"); + entitys.add(new ExcelExportEntity("质量标准(quality_standard)" ,"quality_standard")); + selectKeys.add("quality_standard"); + entitys.add(new ExcelExportEntity("技术标准(technical_standard)" ,"technical_standard")); + selectKeys.add("technical_standard"); + entitys.add(new ExcelExportEntity("验收标准(acceptance_criteria)" ,"acceptance_criteria")); + selectKeys.add("acceptance_criteria"); + entitys.add(new ExcelExportEntity("交付要求(delivery_requirements)" ,"delivery_requirements")); + selectKeys.add("delivery_requirements"); + entitys.add(new ExcelExportEntity("储存条件(storage_conditions)" ,"storage_conditions")); + selectKeys.add("storage_conditions"); + ExcelModel excelModel = generaterSwapUtil.getExcelParams(MaterialConstant.getFormData(),selectKeys); + List> list = new ArrayList<>(); + list.add(excelModel.getDataMap()); + + ExportParams exportParams = new ExportParams(null, menuFullName + "模板"); + exportParams.setStyle(ExcelExportStyler.class); + exportParams.setType(ExcelType.XSSF); + try{ + @Cleanup Workbook workbook = new HSSFWorkbook(); + if (entitys.size()>0){ + if (list.size()==0){ + list.add(new HashMap<>()); + } + //复杂表头-表头和数据处理 + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(MaterialConstant.getColumnData(), ColumnDataModel.class); + List complexHeaderList = columnDataModel.getComplexHeaderList(); + if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { + entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList, false); + list = VisualUtils.complexHeaderDataHandel(list, complexHeaderList, false); + } + workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list); + ExcelHelper helper = new ExcelHelper(); + helper.init(workbook, exportParams, entitys, excelModel); + helper.doPreHandle(); + helper.doPostHandle(); + } + String fileName = menuFullName + "导入模板.xls"; + MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName); + String temporaryFilePath = configValueUtil.getTemporaryFilePath(); + FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName); + vo.setName(fileInfo.getFilename()); + vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName); + } catch (Exception e) { + log.error("模板信息导出Excel错误:{}", e.getMessage()); + e.printStackTrace(); + } + return ActionResult.success(vo); + } + + /** + * 导入预览 + * + * @return + */ + @Operation(summary = "导入预览" ) + @GetMapping("/ImportPreview") + public ActionResult> ImportPreview(String fileName) throws Exception { + Map headAndDataMap = new HashMap<>(2); + String filePath = FileUploadUtils.getLocalBasePath() + configValueUtil.getTemporaryFilePath(); + FileUploadUtils.downLocal(configValueUtil.getTemporaryFilePath(), filePath, fileName); + File temporary = new File(XSSEscape.escapePath(filePath + fileName)); + int headerRowIndex = 1; + ImportParams params = new ImportParams(); + params.setTitleRows(0); + params.setHeadRows(headerRowIndex); + params.setNeedVerify(true); + try { + InputStream inputStream = ExcelUtil.solveOrginTitle(temporary, headerRowIndex); + List excelDataList = ExcelUtil.importExcelByInputStream(inputStream, 0, headerRowIndex, Map.class); + //数据超过1000条 + if(excelDataList != null && excelDataList.size() > 1000) { + return ActionResult.fail(MsgCode.ETD117.get()); + } + + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(MaterialConstant.getColumnData(), ColumnDataModel.class); + UploaderTemplateModel uploaderTemplateModel = JsonUtil.getJsonToBean(columnDataModel.getUploaderTemplateJson(), UploaderTemplateModel.class); + List selectKey = uploaderTemplateModel.getSelectKey(); + //子表合并 + List> results = FormExecelUtils.dataMergeChildTable(excelDataList,selectKey); + // 导入字段 + List columns = new ArrayList<>(); + columns.add(new ExcelImFieldModel("material_name","物料名称","input")); + columns.add(new ExcelImFieldModel("material_category","物料分类","cascader")); + columns.add(new ExcelImFieldModel("material_model","规格型号","input")); + columns.add(new ExcelImFieldModel("unit_name","单位名称","input")); + columns.add(new ExcelImFieldModel("brand","品牌","input")); + columns.add(new ExcelImFieldModel("tax_rate","税率","select")); + columns.add(new ExcelImFieldModel("tax_code","税收分类","cascader")); + columns.add(new ExcelImFieldModel("texture","材质/纹理","input")); + columns.add(new ExcelImFieldModel("quality_standard","质量标准","input")); + columns.add(new ExcelImFieldModel("technical_standard","技术标准","textarea")); + columns.add(new ExcelImFieldModel("acceptance_criteria","验收标准","textarea")); + columns.add(new ExcelImFieldModel("delivery_requirements","交付要求","textarea")); + columns.add(new ExcelImFieldModel("storage_conditions","储存条件","textarea")); + headAndDataMap.put("dataRow" , results); + headAndDataMap.put("headerRow" , JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(columns))); + } catch (Exception e){ + e.printStackTrace(); + return ActionResult.fail(MsgCode.VS407.get()); + } + return ActionResult.success(headAndDataMap); + } + + /** + * 导入数据 + * + * @return + */ + @Operation(summary = "导入数据" ) + @PostMapping("/ImportData") + public ActionResult ImportData(@RequestBody VisualImportModel visualImportModel) throws Exception { + List> listData = visualImportModel.getList(); + ImportFormCheckUniqueModel uniqueModel = new ImportFormCheckUniqueModel(); + uniqueModel.setDbLinkId(MaterialConstant.DBLINKID); + uniqueModel.setUpdate(Objects.equals("2", "2")); + + Map tablefieldkey = new HashMap<>(); + for(String key:MaterialConstant.TABLEFIELDKEY.keySet()){ + tablefieldkey.put(key,MaterialConstant.TABLERENAMES.get(MaterialConstant.TABLEFIELDKEY.get(key))); + } + ExcelImportModel excelImportModel = generaterSwapUtil.importData(MaterialConstant.getFormData(),listData,uniqueModel, tablefieldkey,MaterialConstant.getTableList()); + List importDataModel = uniqueModel.getImportDataModel(); + for (ImportDataModel model : importDataModel) { + String id = model.getId(); + Map result = model.getResultData(); + if(StringUtil.isNotEmpty(id)){ + update(id, JsonUtil.getJsonToBean(result,MaterialForm.class), true); + }else { + create( JsonUtil.getJsonToBean(result,MaterialForm.class)); + } + } + return ActionResult.success(excelImportModel); + } + + /** + * 导出异常报告 + * + * @return + */ + @Operation(summary = "导出异常报告") + @PostMapping("/ImportExceptionData") + public ActionResult ImportExceptionData(@RequestBody VisualImportModel visualImportModel) { + DownloadVO vo = DownloadVO.builder().build(); + UserInfo userInfo = userProvider.get(); + String menuFullName = generaterSwapUtil.getMenuName(visualImportModel.getMenuId()); + //主表对象 + List entitys = new ArrayList<>(); + entitys.add(new ExcelExportEntity("异常原因", "errorsInfo",30)); + List selectKeys = new ArrayList<>(); + //以下添加字段 + entitys.add(new ExcelExportEntity("物料名称(material_name)" ,"material_name")); + selectKeys.add("material_name"); + entitys.add(new ExcelExportEntity("物料分类(material_category)" ,"material_category")); + selectKeys.add("material_category"); + entitys.add(new ExcelExportEntity("规格型号(material_model)" ,"material_model")); + selectKeys.add("material_model"); + entitys.add(new ExcelExportEntity("单位名称(unit_name)" ,"unit_name")); + selectKeys.add("unit_name"); + entitys.add(new ExcelExportEntity("品牌(brand)" ,"brand")); + selectKeys.add("brand"); + entitys.add(new ExcelExportEntity("税率(tax_rate)" ,"tax_rate")); + selectKeys.add("tax_rate"); + entitys.add(new ExcelExportEntity("税收分类(tax_code)" ,"tax_code")); + selectKeys.add("tax_code"); + entitys.add(new ExcelExportEntity("材质/纹理(texture)" ,"texture")); + selectKeys.add("texture"); + entitys.add(new ExcelExportEntity("质量标准(quality_standard)" ,"quality_standard")); + selectKeys.add("quality_standard"); + entitys.add(new ExcelExportEntity("技术标准(technical_standard)" ,"technical_standard")); + selectKeys.add("technical_standard"); + entitys.add(new ExcelExportEntity("验收标准(acceptance_criteria)" ,"acceptance_criteria")); + selectKeys.add("acceptance_criteria"); + entitys.add(new ExcelExportEntity("交付要求(delivery_requirements)" ,"delivery_requirements")); + selectKeys.add("delivery_requirements"); + entitys.add(new ExcelExportEntity("储存条件(storage_conditions)" ,"storage_conditions")); + selectKeys.add("storage_conditions"); + ExcelModel excelModel = generaterSwapUtil.getExcelParams(MaterialConstant.getFormData(),selectKeys); + List> list = new ArrayList<>(); + list.addAll(visualImportModel.getList()); + + ExportParams exportParams = new ExportParams(null, menuFullName + "模板"); + exportParams.setStyle(ExcelExportStyler.class); + exportParams.setType(ExcelType.XSSF); + exportParams.setFreezeCol(1); + try{ + @Cleanup Workbook workbook = new HSSFWorkbook(); + if (entitys.size()>0){ + if (list.size()==0){ + list.add(new HashMap<>()); + } + //复杂表头-表头和数据处理 + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(MaterialConstant.getColumnData(), ColumnDataModel.class); + List complexHeaderList = columnDataModel.getComplexHeaderList(); + if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { + entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList, false); + list = VisualUtils.complexHeaderDataHandel(list, complexHeaderList, false); + } + + workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list); + ExcelHelper helper = new ExcelHelper(); + helper.init(workbook, exportParams, entitys, excelModel); + helper.doPreHandle(); + helper.doPostHandle(); + } + + String fileName = menuFullName + "错误报告_" + DateUtil.dateNow("yyyyMMddHHmmss") + ".xls"; + MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName); + String temporaryFilePath = configValueUtil.getTemporaryFilePath(); + FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName); + vo.setName(fileInfo.getFilename()); + vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName); + } catch (Exception e) { + e.printStackTrace(); + } + return ActionResult.success(vo); + } + /** + * 删除 + * @param id + * @return + */ + @Operation(summary = "删除") + @DeleteMapping("/{id}") + @Transactional + public ActionResult delete(@PathVariable("id") String id,@RequestParam(name = "forceDel",defaultValue = "false") boolean forceDel) throws Exception{ + MaterialEntity entity= materialService.getInfo(id); + if(entity!=null){ + //假删除 + entity.setDeleteMark(1); + entity.setDeleteUserId(userProvider.get().getUserId()); + entity.setDeleteTime(new Date()); + materialService.setIgnoreLogicDelete().updateById(entity); + } + return ActionResult.success(MsgCode.SU003.get()); + } + /** + * 批量删除 + * @param obj + * @return + */ + @DeleteMapping("/batchRemove") + @Transactional + @Operation(summary = "批量删除") + public ActionResult batchRemove(@RequestBody Object obj){ + Map objectMap = JsonUtil.entityToMap(obj); + List idList = JsonUtil.getJsonToList(objectMap.get("ids"), String.class); + String errInfo = ""; + List successList = new ArrayList<>(); + for (String allId : idList){ + try { + this.delete(allId,false); + successList.add(allId); + } catch (Exception e) { + errInfo = e.getMessage(); + } + } + if (successList.size() == 0 && StringUtil.isNotEmpty(errInfo)){ + return ActionResult.fail(errInfo); + } + return ActionResult.success(MsgCode.SU003.get()); + } + /** + * 编辑 + * @param id + * @param materialForm + * @return + */ + @PutMapping("/{id}") + @Operation(summary = "更新") + public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid MaterialForm materialForm, + @RequestParam(value = "isImport", required = false) boolean isImport){ + MaterialEntity entity= materialService.getInfo(id); + if(entity!=null){ + materialForm.setMaterialId(String.valueOf(entity.getMaterialId())); + + if (!isImport) { + String b = materialService.checkForm(materialForm,1); + if (StringUtil.isNotEmpty(b)){ + return ActionResult.fail(b ); + } + } + + try{ + materialService.saveOrUpdate(materialForm,id,false); + }catch (DataException e1){ + return ActionResult.fail(e1.getMessage()); + }catch(Exception e){ + return ActionResult.fail(MsgCode.FA029.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + }else{ + return ActionResult.fail(MsgCode.FA002.get()); + } + } + /** + * 表单信息(详情页) + * 详情页面使用-转换数据 + * @param id + * @return + */ + @Operation(summary = "表单信息(详情页)") + @GetMapping("/detail/{id}") + public ActionResult detailInfo(@PathVariable("id") String id){ + MaterialEntity entity= materialService.getInfo(id); + if(entity==null){ + return ActionResult.fail(MsgCode.FA001.get()); + } + Map materialMap=JsonUtil.entityToMap(entity); + materialMap.put("id", materialMap.get("material_id")); + //副表数据 + //子表数据 + boolean isPc = "pc".equals(ServletUtil.getHeader("yunzhupaas-origin" )); + materialMap = generaterSwapUtil.swapDataDetail(materialMap,MaterialConstant.getFormData(),"817350987260887813",isPc?false:false); + //子表数据 + return ActionResult.success(materialMap); + } + /** + * 获取详情(编辑页) + * 编辑页面使用-不转换数据 + * @param id + * @return + */ + @Operation(summary = "信息") + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id){ + MaterialEntity entity= materialService.getInfo(id); + if(entity==null){ + return ActionResult.fail(MsgCode.FA001.get()); + } + Map materialMap=JsonUtil.entityToMap(entity); + materialMap.put("id", materialMap.get("material_id")); + //副表数据 + //子表数据 + materialMap = generaterSwapUtil.swapDataForm(materialMap,MaterialConstant.getFormData(),MaterialConstant.TABLEFIELDKEY,MaterialConstant.TABLERENAMES); + return ActionResult.success(materialMap); + } + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-controller/src/main/java/com/yunzhupaas/mdm/controller/ProductsController.java b/yunzhupaas-mdm/yunzhupaas-mdm-controller/src/main/java/com/yunzhupaas/mdm/controller/ProductsController.java new file mode 100644 index 0000000..8c29edb --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-controller/src/main/java/com/yunzhupaas/mdm/controller/ProductsController.java @@ -0,0 +1,743 @@ +package com.yunzhupaas.mdm.controller; + + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.mdm.service.*; +import com.yunzhupaas.mdm.entity.*; +import com.yunzhupaas.util.*; +import com.yunzhupaas.mdm.model.product.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import com.yunzhupaas.flowable.entity.TaskEntity; +import jakarta.validation.Valid; +import java.util.*; +import com.yunzhupaas.model.ExcelModel; +import com.yunzhupaas.excel.ExcelExportStyler; +import com.yunzhupaas.excel.ExcelHelper; +import com.yunzhupaas.annotation.YunzhupaasField; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.base.entity.ProvinceEntity; +import java.io.IOException; +import java.util.stream.Collectors; +import com.yunzhupaas.flowable.entity.TaskEntity; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.model.visualJson.UploaderTemplateModel; +import com.yunzhupaas.base.util.FormExecelUtils; +import org.springframework.web.multipart.MultipartFile; +import cn.afterturn.easypoi.excel.ExcelExportUtil; +import cn.afterturn.easypoi.excel.ExcelImportUtil; +import cn.afterturn.easypoi.excel.entity.ExportParams; +import cn.afterturn.easypoi.excel.entity.ImportParams; +import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; +import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.Workbook; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import com.yunzhupaas.onlinedev.model.ExcelImFieldModel; +import com.yunzhupaas.base.model.OnlineImport.ImportDataModel; +import com.yunzhupaas.base.model.OnlineImport.ImportFormCheckUniqueModel; +import com.yunzhupaas.base.model.OnlineImport.ExcelImportModel; +import com.yunzhupaas.base.model.OnlineImport.VisualImportModel; +import cn.xuyanwu.spring.file.storage.FileInfo; +import lombok.Cleanup; +import com.yunzhupaas.model.visualJson.config.HeaderModel; +import com.yunzhupaas.base.model.ColumnDataModel; +import com.yunzhupaas.base.util.VisualUtils; +import org.springframework.transaction.annotation.Transactional; + +/** + * 商品信息 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-27 + */ +@Slf4j +@RestController +@Tag(name = "商品信息" , description = "bcm") +@RequestMapping("/api/bcm/Products") +public class ProductsController { + + @Autowired + private GeneraterSwapUtil generaterSwapUtil; + + @Autowired + private UserProvider userProvider; + + @Autowired + private ProductsService productsService; + + + + @Autowired + private ConfigValueUtil configValueUtil; + + /** + * 列表 + * + * @param productPagination + * @return + */ + @Operation(summary = "获取列表") + @PostMapping("/getList") + public ActionResult list(@RequestBody ProductPagination productPagination)throws Exception{ + List list= productsService.getList(productPagination); + List> realList=new ArrayList<>(); + for (ProductEntity entity : list) { + Map productMap=JsonUtil.entityToMap(entity); + productMap.put("id", productMap.get("product_id")); + //副表数据 + //子表数据 + realList.add(productMap); + } + //数据转换 + boolean isPc = "pc".equals(ServletUtil.getHeader("yunzhupaas-origin" )); + realList = generaterSwapUtil.swapDataList(realList, ProductsConstant.getFormData(), ProductsConstant.getColumnData(), productPagination.getModuleId(),isPc?false:false); + + //返回对象 + PageListVO vo = new PageListVO(); + vo.setList(realList); + PaginationVO page = JsonUtil.getJsonToBean(productPagination, PaginationVO.class); + vo.setPagination(page); + return ActionResult.success(vo); + } + /** + * 创建 + * + * @param productForm + * @return + */ + @PostMapping() + @Operation(summary = "创建") + public ActionResult create(@RequestBody @Valid ProductForm productForm) { + String b = productsService.checkForm(productForm,0); + if (StringUtil.isNotEmpty(b)){ + return ActionResult.fail(b ); + } + try{ + productsService.saveOrUpdate(productForm, null ,true); + }catch(Exception e){ + return ActionResult.fail(MsgCode.FA028.get()); + } + return ActionResult.success(MsgCode.SU001.get()); + } + /** + * 导出Excel + * + * @return + */ + @Operation(summary = "导出Excel") + @PostMapping("/Actions/Export") + public ActionResult Export(@RequestBody ProductPagination productPagination) throws IOException { + if (StringUtil.isEmpty(productPagination.getSelectKey())){ + return ActionResult.fail(MsgCode.IMP011.get()); + } + List list= productsService.getList(productPagination); + List> realList=new ArrayList<>(); + for (ProductEntity entity : list) { + Map productMap=JsonUtil.entityToMap(entity); + productMap.put("id", productMap.get("product_id")); + //副表数据 + //子表数据 + realList.add(productMap); + } + //数据转换 + realList = generaterSwapUtil.swapDataList(realList, ProductsConstant.getFormData(), ProductsConstant.getColumnData(), productPagination.getModuleId(),false); + String[]keys=!StringUtil.isEmpty(productPagination.getSelectKey())?productPagination.getSelectKey():new String[0]; + UserInfo userInfo=userProvider.get(); + String menuFullName = generaterSwapUtil.getMenuName(productPagination.getMenuId()); + + DownloadVO vo=this.creatModelExcel(configValueUtil.getTemporaryFilePath(),realList,keys,userInfo,menuFullName); + return ActionResult.success(vo); + } + + /** + * 导出表格方法 + */ + public DownloadVO creatModelExcel(String path,List>list,String[]keys,UserInfo userInfo,String menuFullName){ + DownloadVO vo=DownloadVO.builder().build(); + List entitys=new ArrayList<>(); + if(keys.length>0){ + for(String key:keys){ + switch(key){ + case "product_code" : + entitys.add(new ExcelExportEntity("商品编码" ,"product_code")); + break; + case "product_name" : + entitys.add(new ExcelExportEntity("商品名称" ,"product_name")); + break; + case "product_type" : + entitys.add(new ExcelExportEntity("商品类型" ,"product_type")); + break; + case "product_category" : + entitys.add(new ExcelExportEntity("商品分类" ,"product_category")); + break; + case "short_name" : + entitys.add(new ExcelExportEntity("商品简称" ,"short_name")); + break; + case "brand" : + entitys.add(new ExcelExportEntity("品牌" ,"brand")); + break; + case "product_model" : + entitys.add(new ExcelExportEntity("规格型号" ,"product_model")); + break; + case "color" : + entitys.add(new ExcelExportEntity("颜色" ,"color")); + break; + case "product_size" : + entitys.add(new ExcelExportEntity("尺寸/规格" ,"product_size")); + break; + case "weight" : + entitys.add(new ExcelExportEntity("重量" ,"weight")); + break; + case "min_order_quantity" : + entitys.add(new ExcelExportEntity("最小起订量" ,"min_order_quantity")); + break; + case "standard_sales_price" : + entitys.add(new ExcelExportEntity("标准销售单价" ,"standard_sales_price")); + break; + case "gross_weight" : + entitys.add(new ExcelExportEntity("毛重" ,"gross_weight")); + break; + case "net_weight" : + entitys.add(new ExcelExportEntity("净重" ,"net_weight")); + break; + case "unit_name" : + entitys.add(new ExcelExportEntity("单位名称" ,"unit_name")); + break; + case "packagesize" : + entitys.add(new ExcelExportEntity("包装尺寸" ,"packagesize")); + break; + case "cost_price" : + entitys.add(new ExcelExportEntity("成本价" ,"cost_price")); + break; + case "warranty_period" : + entitys.add(new ExcelExportEntity("保修期" ,"warranty_period")); + break; + case "tax_rate" : + entitys.add(new ExcelExportEntity("税率" ,"tax_rate")); + break; + case "tax_code" : + entitys.add(new ExcelExportEntity("税收分类" ,"tax_code")); + break; + case "warranty_terms" : + entitys.add(new ExcelExportEntity("保修条款" ,"warranty_terms")); + break; + case "remark" : + entitys.add(new ExcelExportEntity("备注" ,"remark")); + break; + default: + break; + } + } + } + + ExportParams exportParams = new ExportParams(null, "表单信息"); + exportParams.setType(ExcelType.XSSF); + try{ + @Cleanup Workbook workbook = new HSSFWorkbook(); + if (entitys.size()>0){ + if (list.size()==0){ + list.add(new HashMap<>()); + } + //去除空数据 + List> dataList = new ArrayList<>(); + for (Map map : list) { + int i = 0; + for (String key : keys) { + //子表 + if (key.toLowerCase().startsWith("tablefield")) { + String tableField = key.substring(0, key.indexOf("-" )); + String field = key.substring(key.indexOf("-" ) + 1); + Object o = map.get(tableField); + if (o != null) { + List> childList = (List>) o; + for (Map childMap : childList) { + if (childMap.get(field) != null) { + i++; + } + } + } + } else { + Object o = map.get(key); + if (o != null) { + i++; + } + } + } + if (i > 0) { + dataList.add(map); + } + } + List mergerEntitys = new ArrayList<>(entitys); + List> mergerList=new ArrayList<>(dataList); + //复杂表头-表头和数据处理 + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(ProductsConstant.getColumnData(), ColumnDataModel.class); + List complexHeaderList = columnDataModel.getComplexHeaderList(); + if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { + entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList, Objects.equals(columnDataModel.getType(), 4)); + dataList = VisualUtils.complexHeaderDataHandel(dataList, complexHeaderList, Objects.equals(columnDataModel.getType(), 4)); + } + + exportParams.setStyle(ExcelExportStyler.class); + workbook = ExcelExportUtil.exportExcel(exportParams, entitys, dataList); + VisualUtils.mergerVertical(workbook, mergerEntitys, mergerList); + ExcelModel excelModel = generaterSwapUtil.getExcelParams(ProductsConstant.getFormData(),Arrays.asList(keys)); + ExcelHelper helper = new ExcelHelper(); + helper.init(workbook, exportParams, entitys, excelModel); + helper.doPreHandle(); + helper.doPostHandle(); + } + String fileName = menuFullName +"_"+ DateUtil.dateNow("yyyyMMddHHmmss") + ".xls"; + MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName); + String temporaryFilePath = configValueUtil.getTemporaryFilePath(); + FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName); + vo.setName(fileInfo.getFilename()); + vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName); + } catch (Exception e) { + log.error("信息导出Excel错误:{}", e.getMessage()); + e.printStackTrace(); + } + return vo; + } + @Operation(summary = "上传文件") + @PostMapping("/Uploader") + public ActionResult Uploader() { + List list = UpUtil.getFileAll(); + MultipartFile file = list.get(0); + if (file.getOriginalFilename().endsWith(".xlsx") || file.getOriginalFilename().endsWith(".xls")) { + String filePath = XSSEscape.escape(configValueUtil.getTemporaryFilePath()); + String fileName = XSSEscape.escape(RandomUtil.uuId() + "." + UpUtil.getFileType(file)); + //上传文件 + FileInfo fileInfo = FileUploadUtils.uploadFile(file, filePath, fileName); + DownloadVO vo = DownloadVO.builder().build(); + vo.setName(fileInfo.getFilename()); + return ActionResult.success(vo); + } else { + return ActionResult.fail(MsgCode.FA017.get()); + } + } + + /** + * 模板下载 + * + * @return + */ + @Operation(summary = "模板下载") + @GetMapping("/TemplateDownload") + public ActionResult TemplateDownload(@RequestParam("menuId") String menuId){ + DownloadVO vo = DownloadVO.builder().build(); + UserInfo userInfo = userProvider.get(); + String menuFullName = generaterSwapUtil.getMenuName(menuId); + //主表对象 + List entitys = new ArrayList<>(); + List selectKeys = new ArrayList<>(); + //以下添加字段 + entitys.add(new ExcelExportEntity("商品名称(product_name)" ,"product_name")); + selectKeys.add("product_name"); + entitys.add(new ExcelExportEntity("商品类型(product_type)" ,"product_type")); + selectKeys.add("product_type"); + entitys.add(new ExcelExportEntity("商品分类(product_category)" ,"product_category")); + selectKeys.add("product_category"); + entitys.add(new ExcelExportEntity("商品简称(short_name)" ,"short_name")); + selectKeys.add("short_name"); + entitys.add(new ExcelExportEntity("品牌(brand)" ,"brand")); + selectKeys.add("brand"); + entitys.add(new ExcelExportEntity("规格型号(product_model)" ,"product_model")); + selectKeys.add("product_model"); + entitys.add(new ExcelExportEntity("颜色(color)" ,"color")); + selectKeys.add("color"); + entitys.add(new ExcelExportEntity("尺寸/规格(product_size)" ,"product_size")); + selectKeys.add("product_size"); + entitys.add(new ExcelExportEntity("重量(weight)" ,"weight")); + selectKeys.add("weight"); + entitys.add(new ExcelExportEntity("最小起订量(min_order_quantity)" ,"min_order_quantity")); + selectKeys.add("min_order_quantity"); + entitys.add(new ExcelExportEntity("标准销售单价(standard_sales_price)" ,"standard_sales_price")); + selectKeys.add("standard_sales_price"); + entitys.add(new ExcelExportEntity("毛重(gross_weight)" ,"gross_weight")); + selectKeys.add("gross_weight"); + entitys.add(new ExcelExportEntity("净重(net_weight)" ,"net_weight")); + selectKeys.add("net_weight"); + entitys.add(new ExcelExportEntity("单位名称(unit_name)" ,"unit_name")); + selectKeys.add("unit_name"); + entitys.add(new ExcelExportEntity("包装尺寸(packagesize)" ,"packagesize")); + selectKeys.add("packagesize"); + entitys.add(new ExcelExportEntity("成本价(cost_price)" ,"cost_price")); + selectKeys.add("cost_price"); + entitys.add(new ExcelExportEntity("保修期(warranty_period)" ,"warranty_period")); + selectKeys.add("warranty_period"); + entitys.add(new ExcelExportEntity("税率(tax_rate)" ,"tax_rate")); + selectKeys.add("tax_rate"); + entitys.add(new ExcelExportEntity("税收分类(tax_code)" ,"tax_code")); + selectKeys.add("tax_code"); + entitys.add(new ExcelExportEntity("保修条款(warranty_terms)" ,"warranty_terms")); + selectKeys.add("warranty_terms"); + entitys.add(new ExcelExportEntity("备注(remark)" ,"remark")); + selectKeys.add("remark"); + ExcelModel excelModel = generaterSwapUtil.getExcelParams(ProductsConstant.getFormData(),selectKeys); + List> list = new ArrayList<>(); + list.add(excelModel.getDataMap()); + + ExportParams exportParams = new ExportParams(null, menuFullName + "模板"); + exportParams.setStyle(ExcelExportStyler.class); + exportParams.setType(ExcelType.XSSF); + try{ + @Cleanup Workbook workbook = new HSSFWorkbook(); + if (entitys.size()>0){ + if (list.size()==0){ + list.add(new HashMap<>()); + } + //复杂表头-表头和数据处理 + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(ProductsConstant.getColumnData(), ColumnDataModel.class); + List complexHeaderList = columnDataModel.getComplexHeaderList(); + if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { + entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList, false); + list = VisualUtils.complexHeaderDataHandel(list, complexHeaderList, false); + } + workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list); + ExcelHelper helper = new ExcelHelper(); + helper.init(workbook, exportParams, entitys, excelModel); + helper.doPreHandle(); + helper.doPostHandle(); + } + String fileName = menuFullName + "导入模板.xls"; + MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName); + String temporaryFilePath = configValueUtil.getTemporaryFilePath(); + FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName); + vo.setName(fileInfo.getFilename()); + vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName); + } catch (Exception e) { + log.error("模板信息导出Excel错误:{}", e.getMessage()); + e.printStackTrace(); + } + return ActionResult.success(vo); + } + + /** + * 导入预览 + * + * @return + */ + @Operation(summary = "导入预览" ) + @GetMapping("/ImportPreview") + public ActionResult> ImportPreview(String fileName) throws Exception { + Map headAndDataMap = new HashMap<>(2); + String filePath = FileUploadUtils.getLocalBasePath() + configValueUtil.getTemporaryFilePath(); + FileUploadUtils.downLocal(configValueUtil.getTemporaryFilePath(), filePath, fileName); + File temporary = new File(XSSEscape.escapePath(filePath + fileName)); + int headerRowIndex = 1; + ImportParams params = new ImportParams(); + params.setTitleRows(0); + params.setHeadRows(headerRowIndex); + params.setNeedVerify(true); + try { + InputStream inputStream = ExcelUtil.solveOrginTitle(temporary, headerRowIndex); + List excelDataList = ExcelUtil.importExcelByInputStream(inputStream, 0, headerRowIndex, Map.class); + //数据超过1000条 + if(excelDataList != null && excelDataList.size() > 1000) { + return ActionResult.fail(MsgCode.ETD117.get()); + } + + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(ProductsConstant.getColumnData(), ColumnDataModel.class); + UploaderTemplateModel uploaderTemplateModel = JsonUtil.getJsonToBean(columnDataModel.getUploaderTemplateJson(), UploaderTemplateModel.class); + List selectKey = uploaderTemplateModel.getSelectKey(); + //子表合并 + List> results = FormExecelUtils.dataMergeChildTable(excelDataList,selectKey); + // 导入字段 + List columns = new ArrayList<>(); + columns.add(new ExcelImFieldModel("product_name","商品名称","input")); + columns.add(new ExcelImFieldModel("product_type","商品类型","select")); + columns.add(new ExcelImFieldModel("product_category","商品分类","cascader")); + columns.add(new ExcelImFieldModel("short_name","商品简称","input")); + columns.add(new ExcelImFieldModel("brand","品牌","input")); + columns.add(new ExcelImFieldModel("product_model","规格型号","input")); + columns.add(new ExcelImFieldModel("color","颜色","input")); + columns.add(new ExcelImFieldModel("product_size","尺寸/规格","input")); + columns.add(new ExcelImFieldModel("weight","重量","input")); + columns.add(new ExcelImFieldModel("min_order_quantity","最小起订量","inputNumber")); + columns.add(new ExcelImFieldModel("standard_sales_price","标准销售单价","inputNumber")); + columns.add(new ExcelImFieldModel("gross_weight","毛重","inputNumber")); + columns.add(new ExcelImFieldModel("net_weight","净重","inputNumber")); + columns.add(new ExcelImFieldModel("unit_name","单位名称","input")); + columns.add(new ExcelImFieldModel("packagesize","包装尺寸","input")); + columns.add(new ExcelImFieldModel("cost_price","成本价","inputNumber")); + columns.add(new ExcelImFieldModel("warranty_period","保修期","inputNumber")); + columns.add(new ExcelImFieldModel("tax_rate","税率","select")); + columns.add(new ExcelImFieldModel("tax_code","税收分类","cascader")); + columns.add(new ExcelImFieldModel("warranty_terms","保修条款","textarea")); + columns.add(new ExcelImFieldModel("remark","备注","textarea")); + headAndDataMap.put("dataRow" , results); + headAndDataMap.put("headerRow" , JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(columns))); + } catch (Exception e){ + e.printStackTrace(); + return ActionResult.fail(MsgCode.VS407.get()); + } + return ActionResult.success(headAndDataMap); + } + + /** + * 导入数据 + * + * @return + */ + @Operation(summary = "导入数据" ) + @PostMapping("/ImportData") + public ActionResult ImportData(@RequestBody VisualImportModel visualImportModel) throws Exception { + List> listData = visualImportModel.getList(); + ImportFormCheckUniqueModel uniqueModel = new ImportFormCheckUniqueModel(); + uniqueModel.setDbLinkId(ProductsConstant.DBLINKID); + uniqueModel.setUpdate(Objects.equals("2", "2")); + + Map tablefieldkey = new HashMap<>(); + for(String key:ProductsConstant.TABLEFIELDKEY.keySet()){ + tablefieldkey.put(key,ProductsConstant.TABLERENAMES.get(ProductsConstant.TABLEFIELDKEY.get(key))); + } + ExcelImportModel excelImportModel = generaterSwapUtil.importData(ProductsConstant.getFormData(),listData,uniqueModel, tablefieldkey,ProductsConstant.getTableList()); + List importDataModel = uniqueModel.getImportDataModel(); + for (ImportDataModel model : importDataModel) { + String id = model.getId(); + Map result = model.getResultData(); + if(StringUtil.isNotEmpty(id)){ + update(id, JsonUtil.getJsonToBean(result,ProductForm.class), true); + }else { + create( JsonUtil.getJsonToBean(result,ProductForm.class)); + } + } + return ActionResult.success(excelImportModel); + } + + /** + * 导出异常报告 + * + * @return + */ + @Operation(summary = "导出异常报告") + @PostMapping("/ImportExceptionData") + public ActionResult ImportExceptionData(@RequestBody VisualImportModel visualImportModel) { + DownloadVO vo = DownloadVO.builder().build(); + UserInfo userInfo = userProvider.get(); + String menuFullName = generaterSwapUtil.getMenuName(visualImportModel.getMenuId()); + //主表对象 + List entitys = new ArrayList<>(); + entitys.add(new ExcelExportEntity("异常原因", "errorsInfo",30)); + List selectKeys = new ArrayList<>(); + //以下添加字段 + entitys.add(new ExcelExportEntity("商品名称(product_name)" ,"product_name")); + selectKeys.add("product_name"); + entitys.add(new ExcelExportEntity("商品类型(product_type)" ,"product_type")); + selectKeys.add("product_type"); + entitys.add(new ExcelExportEntity("商品分类(product_category)" ,"product_category")); + selectKeys.add("product_category"); + entitys.add(new ExcelExportEntity("商品简称(short_name)" ,"short_name")); + selectKeys.add("short_name"); + entitys.add(new ExcelExportEntity("品牌(brand)" ,"brand")); + selectKeys.add("brand"); + entitys.add(new ExcelExportEntity("规格型号(product_model)" ,"product_model")); + selectKeys.add("product_model"); + entitys.add(new ExcelExportEntity("颜色(color)" ,"color")); + selectKeys.add("color"); + entitys.add(new ExcelExportEntity("尺寸/规格(product_size)" ,"product_size")); + selectKeys.add("product_size"); + entitys.add(new ExcelExportEntity("重量(weight)" ,"weight")); + selectKeys.add("weight"); + entitys.add(new ExcelExportEntity("最小起订量(min_order_quantity)" ,"min_order_quantity")); + selectKeys.add("min_order_quantity"); + entitys.add(new ExcelExportEntity("标准销售单价(standard_sales_price)" ,"standard_sales_price")); + selectKeys.add("standard_sales_price"); + entitys.add(new ExcelExportEntity("毛重(gross_weight)" ,"gross_weight")); + selectKeys.add("gross_weight"); + entitys.add(new ExcelExportEntity("净重(net_weight)" ,"net_weight")); + selectKeys.add("net_weight"); + entitys.add(new ExcelExportEntity("单位名称(unit_name)" ,"unit_name")); + selectKeys.add("unit_name"); + entitys.add(new ExcelExportEntity("包装尺寸(packagesize)" ,"packagesize")); + selectKeys.add("packagesize"); + entitys.add(new ExcelExportEntity("成本价(cost_price)" ,"cost_price")); + selectKeys.add("cost_price"); + entitys.add(new ExcelExportEntity("保修期(warranty_period)" ,"warranty_period")); + selectKeys.add("warranty_period"); + entitys.add(new ExcelExportEntity("税率(tax_rate)" ,"tax_rate")); + selectKeys.add("tax_rate"); + entitys.add(new ExcelExportEntity("税收分类(tax_code)" ,"tax_code")); + selectKeys.add("tax_code"); + entitys.add(new ExcelExportEntity("保修条款(warranty_terms)" ,"warranty_terms")); + selectKeys.add("warranty_terms"); + entitys.add(new ExcelExportEntity("备注(remark)" ,"remark")); + selectKeys.add("remark"); + ExcelModel excelModel = generaterSwapUtil.getExcelParams(ProductsConstant.getFormData(),selectKeys); + List> list = new ArrayList<>(); + list.addAll(visualImportModel.getList()); + + ExportParams exportParams = new ExportParams(null, menuFullName + "模板"); + exportParams.setStyle(ExcelExportStyler.class); + exportParams.setType(ExcelType.XSSF); + exportParams.setFreezeCol(1); + try{ + @Cleanup Workbook workbook = new HSSFWorkbook(); + if (entitys.size()>0){ + if (list.size()==0){ + list.add(new HashMap<>()); + } + //复杂表头-表头和数据处理 + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(ProductsConstant.getColumnData(), ColumnDataModel.class); + List complexHeaderList = columnDataModel.getComplexHeaderList(); + if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { + entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList, false); + list = VisualUtils.complexHeaderDataHandel(list, complexHeaderList, false); + } + + workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list); + ExcelHelper helper = new ExcelHelper(); + helper.init(workbook, exportParams, entitys, excelModel); + helper.doPreHandle(); + helper.doPostHandle(); + } + + String fileName = menuFullName + "错误报告_" + DateUtil.dateNow("yyyyMMddHHmmss") + ".xls"; + MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName); + String temporaryFilePath = configValueUtil.getTemporaryFilePath(); + FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName); + vo.setName(fileInfo.getFilename()); + vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName); + } catch (Exception e) { + e.printStackTrace(); + } + return ActionResult.success(vo); + } + /** + * 删除 + * @param id + * @return + */ + @Operation(summary = "删除") + @DeleteMapping("/{id}") + @Transactional + public ActionResult delete(@PathVariable("id") String id,@RequestParam(name = "forceDel",defaultValue = "false") boolean forceDel) throws Exception{ + ProductEntity entity= productsService.getInfo(id); + if(entity!=null){ + //假删除 + entity.setDeleteMark(1); + entity.setDeleteUserId(userProvider.get().getUserId()); + entity.setDeleteTime(new Date()); + productsService.setIgnoreLogicDelete().updateById(entity); + } + return ActionResult.success(MsgCode.SU003.get()); + } + /** + * 批量删除 + * @param obj + * @return + */ + @DeleteMapping("/batchRemove") + @Transactional + @Operation(summary = "批量删除") + public ActionResult batchRemove(@RequestBody Object obj){ + Map objectMap = JsonUtil.entityToMap(obj); + List idList = JsonUtil.getJsonToList(objectMap.get("ids"), String.class); + String errInfo = ""; + List successList = new ArrayList<>(); + for (String allId : idList){ + try { + this.delete(allId,false); + successList.add(allId); + } catch (Exception e) { + errInfo = e.getMessage(); + } + } + if (successList.size() == 0 && StringUtil.isNotEmpty(errInfo)){ + return ActionResult.fail(errInfo); + } + return ActionResult.success(MsgCode.SU003.get()); + } + /** + * 编辑 + * @param id + * @param productForm + * @return + */ + @PutMapping("/{id}") + @Operation(summary = "更新") + public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid ProductForm productForm, + @RequestParam(value = "isImport", required = false) boolean isImport){ + ProductEntity entity= productsService.getInfo(id); + if(entity!=null){ + productForm.setProductId(String.valueOf(entity.getProductId())); + + if (!isImport) { + String b = productsService.checkForm(productForm,1); + if (StringUtil.isNotEmpty(b)){ + return ActionResult.fail(b ); + } + } + + try{ + productsService.saveOrUpdate(productForm,id,false); + }catch (DataException e1){ + return ActionResult.fail(e1.getMessage()); + }catch(Exception e){ + return ActionResult.fail(MsgCode.FA029.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + }else{ + return ActionResult.fail(MsgCode.FA002.get()); + } + } + /** + * 表单信息(详情页) + * 详情页面使用-转换数据 + * @param id + * @return + */ + @Operation(summary = "表单信息(详情页)") + @GetMapping("/detail/{id}") + public ActionResult detailInfo(@PathVariable("id") String id){ + ProductEntity entity= productsService.getInfo(id); + if(entity==null){ + return ActionResult.fail(MsgCode.FA001.get()); + } + Map productMap=JsonUtil.entityToMap(entity); + productMap.put("id", productMap.get("product_id")); + //副表数据 + //子表数据 + boolean isPc = "pc".equals(ServletUtil.getHeader("yunzhupaas-origin" )); + productMap = generaterSwapUtil.swapDataDetail(productMap,ProductsConstant.getFormData(),"817386322065883909",isPc?false:false); + //子表数据 + return ActionResult.success(productMap); + } + /** + * 获取详情(编辑页) + * 编辑页面使用-不转换数据 + * @param id + * @return + */ + @Operation(summary = "信息") + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id){ + ProductEntity entity= productsService.getInfo(id); + if(entity==null){ + return ActionResult.fail(MsgCode.FA001.get()); + } + Map productMap=JsonUtil.entityToMap(entity); + productMap.put("id", productMap.get("product_id")); + //副表数据 + //子表数据 + productMap = generaterSwapUtil.swapDataForm(productMap,ProductsConstant.getFormData(),ProductsConstant.TABLEFIELDKEY,ProductsConstant.TABLERENAMES); + return ActionResult.success(productMap); + } + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-controller/src/main/java/com/yunzhupaas/mdm/controller/SuppinfoController.java b/yunzhupaas-mdm/yunzhupaas-mdm-controller/src/main/java/com/yunzhupaas/mdm/controller/SuppinfoController.java new file mode 100644 index 0000000..67581bd --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-controller/src/main/java/com/yunzhupaas/mdm/controller/SuppinfoController.java @@ -0,0 +1,992 @@ +package com.yunzhupaas.mdm.controller; + + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.mdm.service.*; +import com.yunzhupaas.mdm.entity.*; +import com.yunzhupaas.util.*; +import com.yunzhupaas.mdm.model.suppinfo.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import com.yunzhupaas.flowable.entity.TaskEntity; +import jakarta.validation.Valid; +import java.util.*; +import com.yunzhupaas.model.ExcelModel; +import com.yunzhupaas.excel.ExcelExportStyler; +import com.yunzhupaas.excel.ExcelHelper; +import com.yunzhupaas.annotation.YunzhupaasField; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.base.entity.ProvinceEntity; +import java.io.IOException; +import java.util.stream.Collectors; +import com.yunzhupaas.flowable.entity.TaskEntity; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.model.visualJson.UploaderTemplateModel; +import com.yunzhupaas.base.util.FormExecelUtils; +import org.springframework.web.multipart.MultipartFile; +import cn.afterturn.easypoi.excel.ExcelExportUtil; +import cn.afterturn.easypoi.excel.ExcelImportUtil; +import cn.afterturn.easypoi.excel.entity.ExportParams; +import cn.afterturn.easypoi.excel.entity.ImportParams; +import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; +import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.Workbook; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import com.yunzhupaas.onlinedev.model.ExcelImFieldModel; +import com.yunzhupaas.base.model.OnlineImport.ImportDataModel; +import com.yunzhupaas.base.model.OnlineImport.ImportFormCheckUniqueModel; +import com.yunzhupaas.base.model.OnlineImport.ExcelImportModel; +import com.yunzhupaas.base.model.OnlineImport.VisualImportModel; +import cn.xuyanwu.spring.file.storage.FileInfo; +import lombok.Cleanup; +import com.yunzhupaas.model.visualJson.config.HeaderModel; +import com.yunzhupaas.base.model.ColumnDataModel; +import com.yunzhupaas.base.util.VisualUtils; +import org.springframework.transaction.annotation.Transactional; + +/** + * 供应商信息 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-24 + */ +@Slf4j +@RestController +@Tag(name = "供应商信息" , description = "bcm") +@RequestMapping("/api/bcm/Suppinfo") +public class SuppinfoController { + + @Autowired + private GeneraterSwapUtil generaterSwapUtil; + + @Autowired + private UserProvider userProvider; + + @Autowired + private SuppinfoService companyService; + + @Autowired + private PanyInvoiceService panyInvoiceService; + @Autowired + private CompanyBankService companyBankService; + + @Autowired + private SupplierService supplierService; + + @Autowired + private ConfigValueUtil configValueUtil; + + /** + * 列表 + * + * @param companyPagination + * @return + */ + @Operation(summary = "获取列表") + @PostMapping("/getList") + public ActionResult list(@RequestBody SuppinfoPagination companyPagination)throws Exception{ + List list= companyService.getList(companyPagination); + List> realList=new ArrayList<>(); + for (CompanyEntity entity : list) { + Map companyMap=JsonUtil.entityToMap(entity); + companyMap.put("id", companyMap.get("company_id")); + //副表数据 + SupplierEntity supplierEntity = entity.getSupplier(); + if(ObjectUtil.isNotEmpty(supplierEntity)){ + Map supplierMap=JsonUtil.entityToMap(supplierEntity); + for(String key:supplierMap.keySet()){ + companyMap.put("yunzhupaas_mdm_supplier_yunzhupaas_"+key,supplierMap.get(key)); + } + } + //子表数据 + List panyInvoiceList = entity.getPanyInvoice(); + companyMap.put("tableField46dc53",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(panyInvoiceList))); + companyMap.put("panyInvoiceList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(panyInvoiceList))); + List companyBankList = entity.getCompanyBank(); + companyMap.put("tableFieldad9d92",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyBankList))); + companyMap.put("companyBankList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyBankList))); + realList.add(companyMap); + } + //数据转换 + boolean isPc = "pc".equals(ServletUtil.getHeader("yunzhupaas-origin" )); + realList = generaterSwapUtil.swapDataList(realList, SuppinfoConstant.getFormData(), SuppinfoConstant.getColumnData(), companyPagination.getModuleId(),isPc?false:false); + + //返回对象 + PageListVO vo = new PageListVO(); + vo.setList(realList); + PaginationVO page = JsonUtil.getJsonToBean(companyPagination, PaginationVO.class); + vo.setPagination(page); + return ActionResult.success(vo); + } + /** + * 创建 + * + * @param companyForm + * @return + */ + @PostMapping() + @Operation(summary = "创建") + public ActionResult create(@RequestBody @Valid SuppinfoForm companyForm) throws Exception { + String b = companyService.checkForm(companyForm,0); + if (StringUtil.isNotEmpty(b)){ + return ActionResult.fail(b ); + } +// try{ + companyService.saveOrUpdate(companyForm, null ,true); +// }catch(Exception e){ +// return ActionResult.fail(MsgCode.FA028.get()); +// } + return ActionResult.success(MsgCode.SU001.get()); + } + /** + * 导出Excel + * + * @return + */ + @Operation(summary = "导出Excel") + @PostMapping("/Actions/Export") + public ActionResult Export(@RequestBody SuppinfoPagination companyPagination) throws IOException { + if (StringUtil.isEmpty(companyPagination.getSelectKey())){ + return ActionResult.fail(MsgCode.IMP011.get()); + } + List list= companyService.getList(companyPagination); + List> realList=new ArrayList<>(); + for (CompanyEntity entity : list) { + Map companyMap=JsonUtil.entityToMap(entity); + companyMap.put("id", companyMap.get("company_id")); + //副表数据 + SupplierEntity supplierEntity = entity.getSupplier(); + if(ObjectUtil.isNotEmpty(supplierEntity)){ + Map supplierMap=JsonUtil.entityToMap(supplierEntity); + for(String key:supplierMap.keySet()){ + companyMap.put("yunzhupaas_mdm_supplier_yunzhupaas_"+key,supplierMap.get(key)); + } + } + //子表数据 + List panyInvoiceList = entity.getPanyInvoice(); + companyMap.put("tableField46dc53",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(panyInvoiceList))); + companyMap.put("panyInvoiceList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(panyInvoiceList))); + List companyBankList = entity.getCompanyBank(); + companyMap.put("tableFieldad9d92",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyBankList))); + companyMap.put("companyBankList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyBankList))); + realList.add(companyMap); + } + //数据转换 + realList = generaterSwapUtil.swapDataList(realList, SuppinfoConstant.getFormData(), SuppinfoConstant.getColumnData(), companyPagination.getModuleId(),false); + String[]keys=!StringUtil.isEmpty(companyPagination.getSelectKey())?companyPagination.getSelectKey():new String[0]; + UserInfo userInfo=userProvider.get(); + String menuFullName = generaterSwapUtil.getMenuName(companyPagination.getMenuId()); + + DownloadVO vo=this.creatModelExcel(configValueUtil.getTemporaryFilePath(),realList,keys,userInfo,menuFullName); + return ActionResult.success(vo); + } + + /** + * 导出表格方法 + */ + public DownloadVO creatModelExcel(String path,List>list,String[]keys,UserInfo userInfo,String menuFullName){ + DownloadVO vo=DownloadVO.builder().build(); + List entitys=new ArrayList<>(); + if(keys.length>0){ + ExcelExportEntity tableField46dc53ExcelEntity = new ExcelExportEntity("设计子表(tableField46dc53)","tableField46dc53"); + List tableField46dc53List = new ArrayList<>(); + ExcelExportEntity tableFieldad9d92ExcelEntity = new ExcelExportEntity("设计子表(tableFieldad9d92)","tableFieldad9d92"); + List tableFieldad9d92List = new ArrayList<>(); + for(String key:keys){ + switch(key){ + case "company_code" : + entitys.add(new ExcelExportEntity("企业编码" ,"company_code")); + break; + case "company_name" : + entitys.add(new ExcelExportEntity("企业名称" ,"company_name")); + break; + case "short_name" : + entitys.add(new ExcelExportEntity("简称/昵称" ,"short_name")); + break; + case "entity_type" : + entitys.add(new ExcelExportEntity("类型" ,"entity_type")); + break; + case "credit_code" : + entitys.add(new ExcelExportEntity("社会信用代码" ,"credit_code")); + break; + case "org_id" : + entitys.add(new ExcelExportEntity("归属组织" ,"org_id")); + break; + case "province_id" : + entitys.add(new ExcelExportEntity("所属地区" ,"province_id")); + break; + case "tax_type" : + entitys.add(new ExcelExportEntity("纳税人类别" ,"tax_type")); + break; + case "enterprise_scale" : + entitys.add(new ExcelExportEntity("企业规模" ,"enterprise_scale")); + break; + case "enterprise_nature" : + entitys.add(new ExcelExportEntity("企业类型" ,"enterprise_nature")); + break; + case "industry_code" : + entitys.add(new ExcelExportEntity("行业代码" ,"industry_code")); + break; + case "registration_date" : + entitys.add(new ExcelExportEntity("成立日期" ,"registration_date")); + break; + case "registered_capital" : + entitys.add(new ExcelExportEntity("注册资本" ,"registered_capital")); + break; + case "legal_representative" : + entitys.add(new ExcelExportEntity("法定代表人" ,"legal_representative")); + break; + case "phone" : + entitys.add(new ExcelExportEntity("联系电话" ,"phone")); + break; + case "email" : + entitys.add(new ExcelExportEntity("邮箱" ,"email")); + break; + case "website" : + entitys.add(new ExcelExportEntity("网站" ,"website")); + break; + case "address" : + entitys.add(new ExcelExportEntity("地址" ,"address")); + break; + case "business_scope" : + entitys.add(new ExcelExportEntity("经营范围" ,"business_scope")); + break; + case "remark" : + entitys.add(new ExcelExportEntity("备注" ,"remark")); + break; + case "yunzhupaas_mdm_supplier_yunzhupaas_major_person_id" : + entitys.add(new ExcelExportEntity("责任人" ,"yunzhupaas_mdm_supplier_yunzhupaas_major_person_id")); + break; + case "yunzhupaas_mdm_supplier_yunzhupaas_supplier_level" : + entitys.add(new ExcelExportEntity("供应商级别" ,"yunzhupaas_mdm_supplier_yunzhupaas_supplier_level")); + break; + case "yunzhupaas_mdm_supplier_yunzhupaas_supplier_type" : + entitys.add(new ExcelExportEntity("供应商类型" ,"yunzhupaas_mdm_supplier_yunzhupaas_supplier_type")); + break; + case "yunzhupaas_mdm_supplier_yunzhupaas_supplier_category" : + entitys.add(new ExcelExportEntity("供应商分类" ,"yunzhupaas_mdm_supplier_yunzhupaas_supplier_category")); + break; + case "yunzhupaas_mdm_supplier_yunzhupaas_honor" : + entitys.add(new ExcelExportEntity("荣誉、资质" ,"yunzhupaas_mdm_supplier_yunzhupaas_honor")); + break; + case "yunzhupaas_mdm_supplier_yunzhupaas_achievement" : + entitys.add(new ExcelExportEntity("供应商业绩" ,"yunzhupaas_mdm_supplier_yunzhupaas_achievement")); + break; + case "yunzhupaas_mdm_supplier_yunzhupaas_finish_project" : + entitys.add(new ExcelExportEntity("完工项目" ,"yunzhupaas_mdm_supplier_yunzhupaas_finish_project")); + break; + case "tableField46dc53-title_code": + tableField46dc53List.add(new ExcelExportEntity("发票抬头编码" ,"title_code")); + break; + case "tableField46dc53-title_name": + tableField46dc53List.add(new ExcelExportEntity("发票抬头名称" ,"title_name")); + break; + case "tableField46dc53-credit_code": + tableField46dc53List.add(new ExcelExportEntity("纳税人识别号" ,"credit_code")); + break; + case "tableField46dc53-tax_type": + tableField46dc53List.add(new ExcelExportEntity("纳税人类别" ,"tax_type")); + break; + case "tableField46dc53-address": + tableField46dc53List.add(new ExcelExportEntity("地址" ,"address")); + break; + case "tableField46dc53-phone": + tableField46dc53List.add(new ExcelExportEntity("电话" ,"phone")); + break; + case "tableField46dc53-bank_name": + tableField46dc53List.add(new ExcelExportEntity("开户银行" ,"bank_name")); + break; + case "tableField46dc53-bank_account": + tableField46dc53List.add(new ExcelExportEntity("银行账户" ,"bank_account")); + break; + case "tableField46dc53-is_defalut": + tableField46dc53List.add(new ExcelExportEntity("是否默认" ,"is_defalut")); + break; + case "tableField46dc53-is_valid": + tableField46dc53List.add(new ExcelExportEntity("是否有效" ,"is_valid")); + break; + case "tableField46dc53-remark": + tableField46dc53List.add(new ExcelExportEntity("备注" ,"remark")); + break; + case "tableFieldad9d92-bank_name": + tableFieldad9d92List.add(new ExcelExportEntity("开户行" ,"bank_name")); + break; + case "tableFieldad9d92-bank_account_name": + tableFieldad9d92List.add(new ExcelExportEntity("账户名" ,"bank_account_name")); + break; + case "tableFieldad9d92-bank_account_number": + tableFieldad9d92List.add(new ExcelExportEntity("银行账号" ,"bank_account_number")); + break; + case "tableFieldad9d92-bank_province": + tableFieldad9d92List.add(new ExcelExportEntity("开户行城市" ,"bank_province")); + break; + case "tableFieldad9d92-remark": + tableFieldad9d92List.add(new ExcelExportEntity("备注" ,"remark")); + break; + default: + break; + } + } + if(tableField46dc53List.size() > 0){ + tableField46dc53ExcelEntity.setList(tableField46dc53List); + entitys.add(tableField46dc53ExcelEntity); + } + if(tableFieldad9d92List.size() > 0){ + tableFieldad9d92ExcelEntity.setList(tableFieldad9d92List); + entitys.add(tableFieldad9d92ExcelEntity); + } + } + + ExportParams exportParams = new ExportParams(null, "表单信息"); + exportParams.setType(ExcelType.XSSF); + try{ + @Cleanup Workbook workbook = new HSSFWorkbook(); + if (entitys.size()>0){ + if (list.size()==0){ + list.add(new HashMap<>()); + } + //去除空数据 + List> dataList = new ArrayList<>(); + for (Map map : list) { + int i = 0; + for (String key : keys) { + //子表 + if (key.toLowerCase().startsWith("tablefield")) { + String tableField = key.substring(0, key.indexOf("-" )); + String field = key.substring(key.indexOf("-" ) + 1); + Object o = map.get(tableField); + if (o != null) { + List> childList = (List>) o; + for (Map childMap : childList) { + if (childMap.get(field) != null) { + i++; + } + } + } + } else { + Object o = map.get(key); + if (o != null) { + i++; + } + } + } + if (i > 0) { + dataList.add(map); + } + } + List mergerEntitys = new ArrayList<>(entitys); + List> mergerList=new ArrayList<>(dataList); + //复杂表头-表头和数据处理 + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(SuppinfoConstant.getColumnData(), ColumnDataModel.class); + List complexHeaderList = columnDataModel.getComplexHeaderList(); + if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { + entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList, Objects.equals(columnDataModel.getType(), 4)); + dataList = VisualUtils.complexHeaderDataHandel(dataList, complexHeaderList, Objects.equals(columnDataModel.getType(), 4)); + } + + exportParams.setStyle(ExcelExportStyler.class); + workbook = ExcelExportUtil.exportExcel(exportParams, entitys, dataList); + VisualUtils.mergerVertical(workbook, mergerEntitys, mergerList); + ExcelModel excelModel = generaterSwapUtil.getExcelParams(SuppinfoConstant.getFormData(),Arrays.asList(keys)); + ExcelHelper helper = new ExcelHelper(); + helper.init(workbook, exportParams, entitys, excelModel); + helper.doPreHandle(); + helper.doPostHandle(); + } + String fileName = menuFullName +"_"+ DateUtil.dateNow("yyyyMMddHHmmss") + ".xls"; + MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName); + String temporaryFilePath = configValueUtil.getTemporaryFilePath(); + FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName); + vo.setName(fileInfo.getFilename()); + vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName); + } catch (Exception e) { + log.error("信息导出Excel错误:{}", e.getMessage()); + e.printStackTrace(); + } + return vo; + } + @Operation(summary = "上传文件") + @PostMapping("/Uploader") + public ActionResult Uploader() { + List list = UpUtil.getFileAll(); + MultipartFile file = list.get(0); + if (file.getOriginalFilename().endsWith(".xlsx") || file.getOriginalFilename().endsWith(".xls")) { + String filePath = XSSEscape.escape(configValueUtil.getTemporaryFilePath()); + String fileName = XSSEscape.escape(RandomUtil.uuId() + "." + UpUtil.getFileType(file)); + //上传文件 + FileInfo fileInfo = FileUploadUtils.uploadFile(file, filePath, fileName); + DownloadVO vo = DownloadVO.builder().build(); + vo.setName(fileInfo.getFilename()); + return ActionResult.success(vo); + } else { + return ActionResult.fail(MsgCode.FA017.get()); + } + } + + /** + * 模板下载 + * + * @return + */ + @Operation(summary = "模板下载") + @GetMapping("/TemplateDownload") + public ActionResult TemplateDownload(@RequestParam("menuId") String menuId){ + DownloadVO vo = DownloadVO.builder().build(); + UserInfo userInfo = userProvider.get(); + String menuFullName = generaterSwapUtil.getMenuName(menuId); + //主表对象 + List entitys = new ArrayList<>(); + List selectKeys = new ArrayList<>(); + //以下添加字段 + entitys.add(new ExcelExportEntity("企业名称(company_name)" ,"company_name")); + selectKeys.add("company_name"); + entitys.add(new ExcelExportEntity("社会信用代码(credit_code)" ,"credit_code")); + selectKeys.add("credit_code"); + entitys.add(new ExcelExportEntity("归属组织(org_id)" ,"org_id")); + selectKeys.add("org_id"); + entitys.add(new ExcelExportEntity("企业编码(company_code)" ,"company_code")); + selectKeys.add("company_code"); + entitys.add(new ExcelExportEntity("简称/昵称(short_name)" ,"short_name")); + selectKeys.add("short_name"); + entitys.add(new ExcelExportEntity("类型(entity_type)" ,"entity_type")); + selectKeys.add("entity_type"); + entitys.add(new ExcelExportEntity("纳税人类别(tax_type)" ,"tax_type")); + selectKeys.add("tax_type"); + entitys.add(new ExcelExportEntity("企业规模(enterprise_scale)" ,"enterprise_scale")); + selectKeys.add("enterprise_scale"); + entitys.add(new ExcelExportEntity("企业类型(enterprise_nature)" ,"enterprise_nature")); + selectKeys.add("enterprise_nature"); + entitys.add(new ExcelExportEntity("行业代码(industry_code)" ,"industry_code")); + selectKeys.add("industry_code"); + entitys.add(new ExcelExportEntity("成立日期(registration_date)" ,"registration_date")); + selectKeys.add("registration_date"); + entitys.add(new ExcelExportEntity("注册资本(registered_capital)" ,"registered_capital")); + selectKeys.add("registered_capital"); + entitys.add(new ExcelExportEntity("法定代表人(legal_representative)" ,"legal_representative")); + selectKeys.add("legal_representative"); + entitys.add(new ExcelExportEntity("联系电话(phone)" ,"phone")); + selectKeys.add("phone"); + entitys.add(new ExcelExportEntity("邮箱(email)" ,"email")); + selectKeys.add("email"); + entitys.add(new ExcelExportEntity("网站(website)" ,"website")); + selectKeys.add("website"); + entitys.add(new ExcelExportEntity("地址(address)" ,"address")); + selectKeys.add("address"); + entitys.add(new ExcelExportEntity("所属地区(province_id)" ,"province_id")); + selectKeys.add("province_id"); + entitys.add(new ExcelExportEntity("经营范围(business_scope)" ,"business_scope")); + selectKeys.add("business_scope"); + entitys.add(new ExcelExportEntity("备注(remark)" ,"remark")); + selectKeys.add("remark"); + entitys.add(new ExcelExportEntity("责任人(yunzhupaas_mdm_supplier_yunzhupaas_major_person_id)" ,"yunzhupaas_mdm_supplier_yunzhupaas_major_person_id")); + selectKeys.add("yunzhupaas_mdm_supplier_yunzhupaas_major_person_id"); + //tableField46dc53子表对象 + ExcelExportEntity tableField46dc53ExcelEntity = new ExcelExportEntity("设计子表(tableField46dc53)","tableField46dc53"); + List tableField46dc53ExcelEntityList = new ArrayList<>(); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("发票抬头名称(tableField46dc53-title_name)" ,"title_name")); + selectKeys.add("tableField46dc53-title_name"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("纳税人识别号(tableField46dc53-credit_code)" ,"credit_code")); + selectKeys.add("tableField46dc53-credit_code"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("纳税人类别(tableField46dc53-tax_type)" ,"tax_type")); + selectKeys.add("tableField46dc53-tax_type"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("地址(tableField46dc53-address)" ,"address")); + selectKeys.add("tableField46dc53-address"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("电话(tableField46dc53-phone)" ,"phone")); + selectKeys.add("tableField46dc53-phone"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("开户银行(tableField46dc53-bank_name)" ,"bank_name")); + selectKeys.add("tableField46dc53-bank_name"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("银行账户(tableField46dc53-bank_account)" ,"bank_account")); + selectKeys.add("tableField46dc53-bank_account"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("是否默认(tableField46dc53-is_defalut)" ,"is_defalut")); + selectKeys.add("tableField46dc53-is_defalut"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("是否有效(tableField46dc53-is_valid)" ,"is_valid")); + selectKeys.add("tableField46dc53-is_valid"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("备注(tableField46dc53-remark)" ,"remark")); + selectKeys.add("tableField46dc53-remark"); + tableField46dc53ExcelEntity.setList(tableField46dc53ExcelEntityList); + if(tableField46dc53ExcelEntityList.size() > 0){ + entitys.add(tableField46dc53ExcelEntity); + } + //tableFieldad9d92子表对象 + ExcelExportEntity tableFieldad9d92ExcelEntity = new ExcelExportEntity("设计子表(tableFieldad9d92)","tableFieldad9d92"); + List tableFieldad9d92ExcelEntityList = new ArrayList<>(); + tableFieldad9d92ExcelEntityList.add(new ExcelExportEntity("开户行(tableFieldad9d92-bank_name)" ,"bank_name")); + selectKeys.add("tableFieldad9d92-bank_name"); + tableFieldad9d92ExcelEntityList.add(new ExcelExportEntity("账户名(tableFieldad9d92-bank_account_name)" ,"bank_account_name")); + selectKeys.add("tableFieldad9d92-bank_account_name"); + tableFieldad9d92ExcelEntityList.add(new ExcelExportEntity("银行账号(tableFieldad9d92-bank_account_number)" ,"bank_account_number")); + selectKeys.add("tableFieldad9d92-bank_account_number"); + tableFieldad9d92ExcelEntityList.add(new ExcelExportEntity("开户行城市(tableFieldad9d92-bank_province)" ,"bank_province")); + selectKeys.add("tableFieldad9d92-bank_province"); + tableFieldad9d92ExcelEntityList.add(new ExcelExportEntity("备注(tableFieldad9d92-remark)" ,"remark")); + selectKeys.add("tableFieldad9d92-remark"); + tableFieldad9d92ExcelEntity.setList(tableFieldad9d92ExcelEntityList); + if(tableFieldad9d92ExcelEntityList.size() > 0){ + entitys.add(tableFieldad9d92ExcelEntity); + } + ExcelModel excelModel = generaterSwapUtil.getExcelParams(SuppinfoConstant.getFormData(),selectKeys); + List> list = new ArrayList<>(); + list.add(excelModel.getDataMap()); + + ExportParams exportParams = new ExportParams(null, menuFullName + "模板"); + exportParams.setStyle(ExcelExportStyler.class); + exportParams.setType(ExcelType.XSSF); + try{ + @Cleanup Workbook workbook = new HSSFWorkbook(); + if (entitys.size()>0){ + if (list.size()==0){ + list.add(new HashMap<>()); + } + //复杂表头-表头和数据处理 + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(SuppinfoConstant.getColumnData(), ColumnDataModel.class); + List complexHeaderList = columnDataModel.getComplexHeaderList(); + if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { + entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList, false); + list = VisualUtils.complexHeaderDataHandel(list, complexHeaderList, false); + } + workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list); + ExcelHelper helper = new ExcelHelper(); + helper.init(workbook, exportParams, entitys, excelModel); + helper.doPreHandle(); + helper.doPostHandle(); + } + String fileName = menuFullName + "导入模板.xls"; + MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName); + String temporaryFilePath = configValueUtil.getTemporaryFilePath(); + FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName); + vo.setName(fileInfo.getFilename()); + vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName); + } catch (Exception e) { + log.error("模板信息导出Excel错误:{}", e.getMessage()); + e.printStackTrace(); + } + return ActionResult.success(vo); + } + + /** + * 导入预览 + * + * @return + */ + @Operation(summary = "导入预览" ) + @GetMapping("/ImportPreview") + public ActionResult> ImportPreview(String fileName) throws Exception { + Map headAndDataMap = new HashMap<>(2); + String filePath = FileUploadUtils.getLocalBasePath() + configValueUtil.getTemporaryFilePath(); + FileUploadUtils.downLocal(configValueUtil.getTemporaryFilePath(), filePath, fileName); + File temporary = new File(XSSEscape.escapePath(filePath + fileName)); + int headerRowIndex = 2; + ImportParams params = new ImportParams(); + params.setTitleRows(0); + params.setHeadRows(headerRowIndex); + params.setNeedVerify(true); + try { + InputStream inputStream = ExcelUtil.solveOrginTitle(temporary, headerRowIndex); + List excelDataList = ExcelUtil.importExcelByInputStream(inputStream, 0, headerRowIndex, Map.class); + //数据超过1000条 + if(excelDataList != null && excelDataList.size() > 1000) { + return ActionResult.fail(MsgCode.ETD117.get()); + } + + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(SuppinfoConstant.getColumnData(), ColumnDataModel.class); + UploaderTemplateModel uploaderTemplateModel = JsonUtil.getJsonToBean(columnDataModel.getUploaderTemplateJson(), UploaderTemplateModel.class); + List selectKey = uploaderTemplateModel.getSelectKey(); + //子表合并 + List> results = FormExecelUtils.dataMergeChildTable(excelDataList,selectKey); + // 导入字段 + List columns = new ArrayList<>(); + columns.add(new ExcelImFieldModel("company_name","企业名称","input")); + columns.add(new ExcelImFieldModel("credit_code","社会信用代码","input")); + columns.add(new ExcelImFieldModel("org_id","归属组织","organizeSelect")); + columns.add(new ExcelImFieldModel("company_code","企业编码","billRule")); + columns.add(new ExcelImFieldModel("short_name","简称/昵称","input")); + columns.add(new ExcelImFieldModel("entity_type","类型","radio")); + columns.add(new ExcelImFieldModel("tax_type","纳税人类别","select")); + columns.add(new ExcelImFieldModel("enterprise_scale","企业规模","select")); + columns.add(new ExcelImFieldModel("enterprise_nature","企业类型","select")); + columns.add(new ExcelImFieldModel("industry_code","行业代码","select")); + columns.add(new ExcelImFieldModel("registration_date","成立日期","datePicker")); + columns.add(new ExcelImFieldModel("registered_capital","注册资本","inputNumber")); + columns.add(new ExcelImFieldModel("legal_representative","法定代表人","input")); + columns.add(new ExcelImFieldModel("phone","联系电话","input")); + columns.add(new ExcelImFieldModel("email","邮箱","input")); + columns.add(new ExcelImFieldModel("website","网站","input")); + columns.add(new ExcelImFieldModel("address","地址","input")); + columns.add(new ExcelImFieldModel("province_id","所属地区","areaSelect")); + columns.add(new ExcelImFieldModel("business_scope","经营范围","textarea")); + columns.add(new ExcelImFieldModel("remark","备注","textarea")); + columns.add(new ExcelImFieldModel("yunzhupaas_mdm_supplier_yunzhupaas_major_person_id","责任人","userSelect")); + //tableField46dc53子表对象 + List tableField46dc53columns = new ArrayList<>(); + tableField46dc53columns.add(new ExcelImFieldModel("title_name" ,"发票抬头名称")); + tableField46dc53columns.add(new ExcelImFieldModel("credit_code" ,"纳税人识别号")); + tableField46dc53columns.add(new ExcelImFieldModel("tax_type" ,"纳税人类别")); + tableField46dc53columns.add(new ExcelImFieldModel("address" ,"地址")); + tableField46dc53columns.add(new ExcelImFieldModel("phone" ,"电话")); + tableField46dc53columns.add(new ExcelImFieldModel("bank_name" ,"开户银行")); + tableField46dc53columns.add(new ExcelImFieldModel("bank_account" ,"银行账户")); + tableField46dc53columns.add(new ExcelImFieldModel("is_defalut" ,"是否默认")); + tableField46dc53columns.add(new ExcelImFieldModel("is_valid" ,"是否有效")); + tableField46dc53columns.add(new ExcelImFieldModel("remark" ,"备注")); + columns.add(new ExcelImFieldModel("tableField46dc53","设计子表","table",tableField46dc53columns)); + //tableFieldad9d92子表对象 + List tableFieldad9d92columns = new ArrayList<>(); + tableFieldad9d92columns.add(new ExcelImFieldModel("bank_name" ,"开户行")); + tableFieldad9d92columns.add(new ExcelImFieldModel("bank_account_name" ,"账户名")); + tableFieldad9d92columns.add(new ExcelImFieldModel("bank_account_number" ,"银行账号")); + tableFieldad9d92columns.add(new ExcelImFieldModel("bank_province" ,"开户行城市")); + tableFieldad9d92columns.add(new ExcelImFieldModel("remark" ,"备注")); + columns.add(new ExcelImFieldModel("tableFieldad9d92","设计子表","table",tableFieldad9d92columns)); + headAndDataMap.put("dataRow" , results); + headAndDataMap.put("headerRow" , JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(columns))); + } catch (Exception e){ + e.printStackTrace(); + return ActionResult.fail(MsgCode.VS407.get()); + } + return ActionResult.success(headAndDataMap); + } + + /** + * 导入数据 + * + * @return + */ + @Operation(summary = "导入数据" ) + @PostMapping("/ImportData") + public ActionResult ImportData(@RequestBody VisualImportModel visualImportModel) throws Exception { + List> listData = visualImportModel.getList(); + ImportFormCheckUniqueModel uniqueModel = new ImportFormCheckUniqueModel(); + uniqueModel.setDbLinkId(SuppinfoConstant.DBLINKID); + uniqueModel.setUpdate(Objects.equals("2", "2")); + + Map tablefieldkey = new HashMap<>(); + for(String key:SuppinfoConstant.TABLEFIELDKEY.keySet()){ + tablefieldkey.put(key,SuppinfoConstant.TABLERENAMES.get(SuppinfoConstant.TABLEFIELDKEY.get(key))); + } + ExcelImportModel excelImportModel = generaterSwapUtil.importData(SuppinfoConstant.getFormData(),listData,uniqueModel, tablefieldkey,SuppinfoConstant.getTableList()); + List importDataModel = uniqueModel.getImportDataModel(); + for (ImportDataModel model : importDataModel) { + String id = model.getId(); + Map result = model.getResultData(); + if(StringUtil.isNotEmpty(id)){ + update(id, JsonUtil.getJsonToBean(result,SuppinfoForm.class), true); + }else { + create( JsonUtil.getJsonToBean(result,SuppinfoForm.class)); + } + } + return ActionResult.success(excelImportModel); + } + + /** + * 导出异常报告 + * + * @return + */ + @Operation(summary = "导出异常报告") + @PostMapping("/ImportExceptionData") + public ActionResult ImportExceptionData(@RequestBody VisualImportModel visualImportModel) { + DownloadVO vo = DownloadVO.builder().build(); + UserInfo userInfo = userProvider.get(); + String menuFullName = generaterSwapUtil.getMenuName(visualImportModel.getMenuId()); + //主表对象 + List entitys = new ArrayList<>(); + entitys.add(new ExcelExportEntity("异常原因", "errorsInfo",30)); + List selectKeys = new ArrayList<>(); + //以下添加字段 + entitys.add(new ExcelExportEntity("企业名称(company_name)" ,"company_name")); + selectKeys.add("company_name"); + entitys.add(new ExcelExportEntity("社会信用代码(credit_code)" ,"credit_code")); + selectKeys.add("credit_code"); + entitys.add(new ExcelExportEntity("归属组织(org_id)" ,"org_id")); + selectKeys.add("org_id"); + entitys.add(new ExcelExportEntity("企业编码(company_code)" ,"company_code")); + selectKeys.add("company_code"); + entitys.add(new ExcelExportEntity("简称/昵称(short_name)" ,"short_name")); + selectKeys.add("short_name"); + entitys.add(new ExcelExportEntity("类型(entity_type)" ,"entity_type")); + selectKeys.add("entity_type"); + entitys.add(new ExcelExportEntity("纳税人类别(tax_type)" ,"tax_type")); + selectKeys.add("tax_type"); + entitys.add(new ExcelExportEntity("企业规模(enterprise_scale)" ,"enterprise_scale")); + selectKeys.add("enterprise_scale"); + entitys.add(new ExcelExportEntity("企业类型(enterprise_nature)" ,"enterprise_nature")); + selectKeys.add("enterprise_nature"); + entitys.add(new ExcelExportEntity("行业代码(industry_code)" ,"industry_code")); + selectKeys.add("industry_code"); + entitys.add(new ExcelExportEntity("成立日期(registration_date)" ,"registration_date")); + selectKeys.add("registration_date"); + entitys.add(new ExcelExportEntity("注册资本(registered_capital)" ,"registered_capital")); + selectKeys.add("registered_capital"); + entitys.add(new ExcelExportEntity("法定代表人(legal_representative)" ,"legal_representative")); + selectKeys.add("legal_representative"); + entitys.add(new ExcelExportEntity("联系电话(phone)" ,"phone")); + selectKeys.add("phone"); + entitys.add(new ExcelExportEntity("邮箱(email)" ,"email")); + selectKeys.add("email"); + entitys.add(new ExcelExportEntity("网站(website)" ,"website")); + selectKeys.add("website"); + entitys.add(new ExcelExportEntity("地址(address)" ,"address")); + selectKeys.add("address"); + entitys.add(new ExcelExportEntity("所属地区(province_id)" ,"province_id")); + selectKeys.add("province_id"); + entitys.add(new ExcelExportEntity("经营范围(business_scope)" ,"business_scope")); + selectKeys.add("business_scope"); + entitys.add(new ExcelExportEntity("备注(remark)" ,"remark")); + selectKeys.add("remark"); + entitys.add(new ExcelExportEntity("责任人(yunzhupaas_mdm_supplier_yunzhupaas_major_person_id)" ,"yunzhupaas_mdm_supplier_yunzhupaas_major_person_id")); + selectKeys.add("yunzhupaas_mdm_supplier_yunzhupaas_major_person_id"); + //tableField46dc53子表对象 + ExcelExportEntity tableField46dc53ExcelEntity = new ExcelExportEntity("设计子表(tableField46dc53)","tableField46dc53"); + List tableField46dc53ExcelEntityList = new ArrayList<>(); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("发票抬头名称(tableField46dc53-title_name)" ,"title_name")); + selectKeys.add("tableField46dc53-title_name"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("纳税人识别号(tableField46dc53-credit_code)" ,"credit_code")); + selectKeys.add("tableField46dc53-credit_code"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("纳税人类别(tableField46dc53-tax_type)" ,"tax_type")); + selectKeys.add("tableField46dc53-tax_type"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("地址(tableField46dc53-address)" ,"address")); + selectKeys.add("tableField46dc53-address"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("电话(tableField46dc53-phone)" ,"phone")); + selectKeys.add("tableField46dc53-phone"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("开户银行(tableField46dc53-bank_name)" ,"bank_name")); + selectKeys.add("tableField46dc53-bank_name"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("银行账户(tableField46dc53-bank_account)" ,"bank_account")); + selectKeys.add("tableField46dc53-bank_account"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("是否默认(tableField46dc53-is_defalut)" ,"is_defalut")); + selectKeys.add("tableField46dc53-is_defalut"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("是否有效(tableField46dc53-is_valid)" ,"is_valid")); + selectKeys.add("tableField46dc53-is_valid"); + tableField46dc53ExcelEntityList.add(new ExcelExportEntity("备注(tableField46dc53-remark)" ,"remark")); + selectKeys.add("tableField46dc53-remark"); + tableField46dc53ExcelEntity.setList(tableField46dc53ExcelEntityList); + entitys.add(tableField46dc53ExcelEntity); + //tableFieldad9d92子表对象 + ExcelExportEntity tableFieldad9d92ExcelEntity = new ExcelExportEntity("设计子表(tableFieldad9d92)","tableFieldad9d92"); + List tableFieldad9d92ExcelEntityList = new ArrayList<>(); + tableFieldad9d92ExcelEntityList.add(new ExcelExportEntity("开户行(tableFieldad9d92-bank_name)" ,"bank_name")); + selectKeys.add("tableFieldad9d92-bank_name"); + tableFieldad9d92ExcelEntityList.add(new ExcelExportEntity("账户名(tableFieldad9d92-bank_account_name)" ,"bank_account_name")); + selectKeys.add("tableFieldad9d92-bank_account_name"); + tableFieldad9d92ExcelEntityList.add(new ExcelExportEntity("银行账号(tableFieldad9d92-bank_account_number)" ,"bank_account_number")); + selectKeys.add("tableFieldad9d92-bank_account_number"); + tableFieldad9d92ExcelEntityList.add(new ExcelExportEntity("开户行城市(tableFieldad9d92-bank_province)" ,"bank_province")); + selectKeys.add("tableFieldad9d92-bank_province"); + tableFieldad9d92ExcelEntityList.add(new ExcelExportEntity("备注(tableFieldad9d92-remark)" ,"remark")); + selectKeys.add("tableFieldad9d92-remark"); + tableFieldad9d92ExcelEntity.setList(tableFieldad9d92ExcelEntityList); + entitys.add(tableFieldad9d92ExcelEntity); + ExcelModel excelModel = generaterSwapUtil.getExcelParams(SuppinfoConstant.getFormData(),selectKeys); + List> list = new ArrayList<>(); + list.addAll(visualImportModel.getList()); + + ExportParams exportParams = new ExportParams(null, menuFullName + "模板"); + exportParams.setStyle(ExcelExportStyler.class); + exportParams.setType(ExcelType.XSSF); + exportParams.setFreezeCol(1); + try{ + @Cleanup Workbook workbook = new HSSFWorkbook(); + if (entitys.size()>0){ + if (list.size()==0){ + list.add(new HashMap<>()); + } + //复杂表头-表头和数据处理 + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(SuppinfoConstant.getColumnData(), ColumnDataModel.class); + List complexHeaderList = columnDataModel.getComplexHeaderList(); + if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { + entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList, false); + list = VisualUtils.complexHeaderDataHandel(list, complexHeaderList, false); + } + + workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list); + ExcelHelper helper = new ExcelHelper(); + helper.init(workbook, exportParams, entitys, excelModel); + helper.doPreHandle(); + helper.doPostHandle(); + } + + String fileName = menuFullName + "错误报告_" + DateUtil.dateNow("yyyyMMddHHmmss") + ".xls"; + MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName); + String temporaryFilePath = configValueUtil.getTemporaryFilePath(); + FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName); + vo.setName(fileInfo.getFilename()); + vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName); + } catch (Exception e) { + e.printStackTrace(); + } + return ActionResult.success(vo); + } + /** + * 删除 + * @param id + * @return + */ + @Operation(summary = "删除") + @DeleteMapping("/{id}") + @Transactional + public ActionResult delete(@PathVariable("id") String id,@RequestParam(name = "forceDel",defaultValue = "false") boolean forceDel) throws Exception{ + CompanyEntity entity= companyService.getInfo(id); + if(entity!=null){ + //主表数据删除 + companyService.delete(entity); + QueryWrapper queryWrapperSupplier=new QueryWrapper<>(); + queryWrapperSupplier.lambda().eq(SupplierEntity::getCompanyId,entity.getCompanyId()); + //副表数据删除 + supplierService.remove(queryWrapperSupplier); + QueryWrapper queryWrapperPanyInvoice=new QueryWrapper<>(); + queryWrapperPanyInvoice.lambda().eq(PanyInvoiceEntity::getCompanyId,entity.getCompanyId()); + //子表数据删除 + panyInvoiceService.remove(queryWrapperPanyInvoice); + QueryWrapper queryWrapperCompanyBank=new QueryWrapper<>(); + queryWrapperCompanyBank.lambda().eq(CompanyBankEntity::getCompanyId,entity.getCompanyId()); + //子表数据删除 + companyBankService.remove(queryWrapperCompanyBank); + } + return ActionResult.success(MsgCode.SU003.get()); + } + /** + * 批量删除 + * @param obj + * @return + */ + @DeleteMapping("/batchRemove") + @Transactional + @Operation(summary = "批量删除") + public ActionResult batchRemove(@RequestBody Object obj){ + Map objectMap = JsonUtil.entityToMap(obj); + List idList = JsonUtil.getJsonToList(objectMap.get("ids"), String.class); + String errInfo = ""; + List successList = new ArrayList<>(); + for (String allId : idList){ + try { + this.delete(allId,false); + successList.add(allId); + } catch (Exception e) { + errInfo = e.getMessage(); + } + } + if (successList.size() == 0 && StringUtil.isNotEmpty(errInfo)){ + return ActionResult.fail(errInfo); + } + return ActionResult.success(MsgCode.SU003.get()); + } + /** + * 编辑 + * @param id + * @param companyForm + * @return + */ + @PutMapping("/{id}") + @Operation(summary = "更新") + public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid SuppinfoForm companyForm, + @RequestParam(value = "isImport", required = false) boolean isImport){ + CompanyEntity entity= companyService.getInfo(id); + if(entity!=null){ + companyForm.setCompanyId(String.valueOf(entity.getCompanyId())); + + if (!isImport) { + String b = companyService.checkForm(companyForm,1); + if (StringUtil.isNotEmpty(b)){ + return ActionResult.fail(b ); + } + } + + try{ + companyService.saveOrUpdate(companyForm,id,false); + }catch (DataException e1){ + return ActionResult.fail(e1.getMessage()); + }catch(Exception e){ + return ActionResult.fail(MsgCode.FA029.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + }else{ + return ActionResult.fail(MsgCode.FA002.get()); + } + } + /** + * 表单信息(详情页) + * 详情页面使用-转换数据 + * @param id + * @return + */ + @Operation(summary = "表单信息(详情页)") + @GetMapping("/detail/{id}") + public ActionResult detailInfo(@PathVariable("id") String id){ + CompanyEntity entity= companyService.getInfo(id); + if(entity==null){ + return ActionResult.fail(MsgCode.FA001.get()); + } + Map companyMap=JsonUtil.entityToMap(entity); + companyMap.put("id", companyMap.get("company_id")); + //副表数据 + SupplierEntity supplierEntity = entity.getSupplier(); + if(ObjectUtil.isNotEmpty(supplierEntity)){ + Map supplierMap=JsonUtil.entityToMap(supplierEntity); + for(String key:supplierMap.keySet()){ + companyMap.put("yunzhupaas_mdm_supplier_yunzhupaas_"+key,supplierMap.get(key)); + } + } + //子表数据 + List panyInvoiceList = entity.getPanyInvoice(); + companyMap.put("tableField46dc53",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(panyInvoiceList))); + companyMap.put("panyInvoiceList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(panyInvoiceList))); + List companyBankList = entity.getCompanyBank(); + companyMap.put("tableFieldad9d92",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyBankList))); + companyMap.put("companyBankList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyBankList))); + boolean isPc = "pc".equals(ServletUtil.getHeader("yunzhupaas-origin" )); + companyMap = generaterSwapUtil.swapDataDetail(companyMap,SuppinfoConstant.getFormData(),"817082533433836293",isPc?false:false); + //子表数据 + companyMap.put("panyInvoiceList",companyMap.get("tableField46dc53")); + companyMap.put("companyBankList",companyMap.get("tableFieldad9d92")); + return ActionResult.success(companyMap); + } + /** + * 获取详情(编辑页) + * 编辑页面使用-不转换数据 + * @param id + * @return + */ + @Operation(summary = "信息") + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id){ + CompanyEntity entity= companyService.getInfo(id); + if(entity==null){ + return ActionResult.fail(MsgCode.FA001.get()); + } + Map companyMap=JsonUtil.entityToMap(entity); + companyMap.put("id", companyMap.get("company_id")); + //副表数据 + SupplierEntity supplierEntity = entity.getSupplier(); + if(ObjectUtil.isNotEmpty(supplierEntity)){ + Map supplierMap=JsonUtil.entityToMap(supplierEntity); + for(String key:supplierMap.keySet()){ + companyMap.put("yunzhupaas_mdm_supplier_yunzhupaas_"+key,supplierMap.get(key)); + } + } + //子表数据 + List panyInvoiceList = entity.getPanyInvoice(); + companyMap.put("tableField46dc53",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(panyInvoiceList))); + companyMap.put("panyInvoiceList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(panyInvoiceList))); + List companyBankList = entity.getCompanyBank(); + companyMap.put("tableFieldad9d92",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyBankList))); + companyMap.put("companyBankList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(companyBankList))); + companyMap = generaterSwapUtil.swapDataForm(companyMap,SuppinfoConstant.getFormData(),SuppinfoConstant.TABLEFIELDKEY,SuppinfoConstant.TABLERENAMES); + return ActionResult.success(companyMap); + } + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/pom.xml b/yunzhupaas-mdm/yunzhupaas-mdm-entity/pom.xml new file mode 100644 index 0000000..55a335b --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/pom.xml @@ -0,0 +1,27 @@ + + + + yunzhupaas-mdm + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-mdm-entity + + + + com.yunzhupaas + yunzhupaas-common-all + ${project.version} + + + com.yunzhupaas + yunzhupaas-crm-controller + 5.2.0-RELEASE + + + + diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/entity/AssetEntity.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/entity/AssetEntity.java new file mode 100644 index 0000000..8a36c49 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/entity/AssetEntity.java @@ -0,0 +1,103 @@ +package com.yunzhupaas.mdm.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import java.util.Date; +import java.util.List; +import com.alibaba.fastjson.annotation.JSONField; +import java.math.BigDecimal; +import java.math.BigDecimal; +/** + * 资产信息 + * + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-28 + */ +@Data +@TableName("mdm_asset") +public class AssetEntity { + @TableId(value ="asset_id" ) + @JSONField(name = "asset_id") + private String assetId; + @TableField(value = "asset_code" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "asset_code") + private String assetCode; + @TableField(value = "asset_name" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "asset_name") + private String assetName; + @TableField(value = "asset_type" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "asset_type") + private String assetType; + @TableField(value = "asset_category" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "asset_category") + private String assetCategory; + @TableField(value = "asset_status" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "asset_status") + private String assetStatus; + @TableField(value = "asset_location" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "asset_location") + private String assetLocation; + @TableField(value = "current_org_id" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "current_org_id") + private String currentOrgId; + @TableField(value = "current_user_id" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "current_user_id") + private String currentUserId; + @TableField(value = "asset_ownership" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "asset_ownership") + private String assetOwnership; + @TableField(value = "measurement_unit" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "measurement_unit") + private String measurementUnit; + @TableField(value = "quantity" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "quantity") + private BigDecimal quantity; + @TableField(value = "purchase_date" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "purchase_date") + private Date purchaseDate; + @TableField(value = "commissioning_date" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "commissioning_date") + private Date commissioningDate; + @TableField(value = "expected_life" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "expected_life") + private BigDecimal expectedLife; + @TableField(value = "supplier_id" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "supplier_id") + private String supplierId; + @TableField(value = "remark" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "remark") + private String remark; + @TableField("create_by") + @JSONField(name = "create_by") + private String createBy; + @TableField("create_time") + @JSONField(name = "create_time") + private Date createTime; + @TableField("update_by") + @JSONField(name = "update_by") + private String updateBy; + @TableField("update_time") + @JSONField(name = "update_time") + private Date updateTime; + @TableField(value = "f_tenant_id",fill = FieldFill.INSERT_UPDATE) + @JSONField(name = "f_tenant_id") + private String tenantId; + @TableField("f_flow_id") + @JSONField(name = "f_flow_id") + private String flowId; + @TableField("f_flow_task_id") + @JSONField(name = "f_flow_task_id") + private String flowTaskId; + @TableField("f_delete_mark") + @JSONField(name = "f_delete_mark") + private Integer deleteMark; + @TableField("f_delete_time") + @JSONField(name = "f_delete_time") + private Date deleteTime; + @TableField("f_delete_user_id") + @JSONField(name = "f_delete_user_id") + private String deleteUserId; + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/entity/CompanyBankEntity.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/entity/CompanyBankEntity.java new file mode 100644 index 0000000..57cc5ee --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/entity/CompanyBankEntity.java @@ -0,0 +1,65 @@ +package com.yunzhupaas.mdm.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import java.util.Date; +import java.util.List; +import com.alibaba.fastjson.annotation.JSONField; +/** + * 企业银行信息 + * + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-24 + */ +@Data +@TableName("mdm_company_bank") +public class CompanyBankEntity { + @TableId(value ="bank_id" ) + @JSONField(name = "bank_id") + private String bankId; + @TableField("company_id") + @JSONField(name = "company_id") + private String companyId; + @TableField(value = "bank_name" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "bank_name") + private String bankName; + @TableField(value = "bank_account_name" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "bank_account_name") + private String bankAccountName; + @TableField(value = "bank_account_number" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "bank_account_number") + private String bankAccountNumber; + @TableField(value = "bank_province" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "bank_province") + private String bankProvince; + @TableField(value = "remark" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "remark") + private String remark; + @TableField("create_by") + @JSONField(name = "create_by") + private String createBy; + @TableField("create_time") + @JSONField(name = "create_time") + private Date createTime; + @TableField("update_by") + @JSONField(name = "update_by") + private String updateBy; + @TableField("update_time") + @JSONField(name = "update_time") + private Date updateTime; + @TableField(value = "f_tenant_id",fill = FieldFill.INSERT_UPDATE) + @JSONField(name = "f_tenant_id") + private String tenantId; + @TableField("f_delete_mark") + @JSONField(name = "f_delete_mark") + private Integer deleteMark; + @TableField("f_delete_time") + @JSONField(name = "f_delete_time") + private Date deleteTime; + @TableField("f_delete_user_id") + @JSONField(name = "f_delete_user_id") + private String deleteUserId; + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/entity/CompanyEntity.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/entity/CompanyEntity.java new file mode 100644 index 0000000..ae721c3 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/entity/CompanyEntity.java @@ -0,0 +1,135 @@ +package com.yunzhupaas.mdm.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import java.util.Date; +import java.util.List; +import com.alibaba.fastjson.annotation.JSONField; +import java.math.BigDecimal; +/** + * 企业信息(包括:客商与企业内部单位) + * + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-24 + */ +@Data +@TableName("mdm_company") +public class CompanyEntity { + @TableId(value ="company_id" ) + @JSONField(name = "company_id") + private String companyId; + @TableField(value = "company_code" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "company_code") + private String companyCode; + @TableField(value = "company_name" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "company_name") + private String companyName; + @TableField(value = "entity_type" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "entity_type") + private String entityType; + @TableField(value = "short_name" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "short_name") + private String shortName; + @TableField(value = "org_id" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "org_id") + private String orgId; + @TableField("company_scope") + @JSONField(name = "company_scope") + private String companyScope; + @TableField(value = "credit_code" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "credit_code") + private String creditCode; + @TableField(value = "province_id" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "province_id") + private String provinceId; + @TableField(value = "tax_type" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "tax_type") + private String taxType; + @TableField(value = "enterprise_nature" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "enterprise_nature") + private String enterpriseNature; + @TableField(value = "industry_code" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "industry_code") + private String industryCode; + @TableField(value = "enterprise_scale" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "enterprise_scale") + private String enterpriseScale; + @TableField(value = "registration_date" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "registration_date") + private Date registrationDate; + @TableField(value = "registered_capital" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "registered_capital") + private BigDecimal registeredCapital; + @TableField(value = "legal_representative" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "legal_representative") + private String legalRepresentative; + @TableField(value = "phone" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "phone") + private String phone; + @TableField(value = "email" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "email") + private String email; + @TableField(value = "website" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "website") + private String website; + @TableField(value = "address" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "address") + private String address; + @TableField(value = "business_scope" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "business_scope") + private String businessScope; + @TableField(value = "remark" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "remark") + private String remark; + @TableField("create_by") + @JSONField(name = "create_by") + private String createBy; + @TableField("create_time") + @JSONField(name = "create_time") + private Date createTime; + @TableField("update_by") + @JSONField(name = "update_by") + private String updateBy; + @TableField("update_time") + @JSONField(name = "update_time") + private Date updateTime; + @TableField(value = "f_tenant_id",fill = FieldFill.INSERT_UPDATE) + @JSONField(name = "f_tenant_id") + private String tenantId; + @TableField("f_delete_mark") + @JSONField(name = "f_delete_mark") + private Integer deleteMark; + @TableField("f_delete_time") + @JSONField(name = "f_delete_time") + private Date deleteTime; + @TableField("f_delete_user_id") + @JSONField(name = "f_delete_user_id") + private String deleteUserId; + @TableField("f_flow_id") + @JSONField(name = "f_flow_id") + private String flowId; + @TableField("f_flow_task_id") + @JSONField(name = "f_flow_task_id") + private String flowTaskId; + + @JSONField(name = "corporation") + @TableField(exist = false) + private CorporationEntity corporation; + @JSONField(name = "companyBank") + @TableField(exist = false) + private List companyBank; + @JSONField(name = "company_invoice") + @TableField(exist = false) + private List companyInvoice; + @JSONField(name = "panyInvoice") + @TableField(exist = false) + private List panyInvoice; + @JSONField(name = "supplier") + @TableField(exist = false) + private SupplierEntity supplier; + @JSONField(name = "customer") + @TableField(exist = false) + private CustomerEntity customer; +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/entity/CompanyInvoiceEntity.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/entity/CompanyInvoiceEntity.java new file mode 100644 index 0000000..624d27d --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/entity/CompanyInvoiceEntity.java @@ -0,0 +1,83 @@ +package com.yunzhupaas.mdm.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import java.util.Date; +import java.util.List; +import com.alibaba.fastjson.annotation.JSONField; +/** + * 企业发票抬头 + * + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-24 + */ +@Data +@TableName("mdm_company_invoice") +public class CompanyInvoiceEntity { + @TableId(value ="invoice_id" ) + @JSONField(name = "invoice_id") + private String invoiceId; + @TableField("company_id") + @JSONField(name = "company_id") + private String companyId; + @TableField(value = "title_code" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "title_code") + private String titleCode; + @TableField(value = "title_name" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "title_name") + private String titleName; + @TableField(value = "credit_code" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "credit_code") + private String creditCode; + @TableField(value = "tax_type" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "tax_type") + private String taxType; + @TableField(value = "address" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "address") + private String address; + @TableField(value = "phone" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "phone") + private String phone; + @TableField(value = "bank_name" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "bank_name") + private String bankName; + @TableField(value = "bank_account" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "bank_account") + private String bankAccount; + @TableField(value = "is_valid" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "is_valid") + private String isValid; + @TableField(value = "is_defalut" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "is_defalut") + private String isDefalut; + @TableField(value = "remark" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "remark") + private String remark; + @TableField("create_by") + @JSONField(name = "create_by") + private String createBy; + @TableField("create_time") + @JSONField(name = "create_time") + private Date createTime; + @TableField("update_by") + @JSONField(name = "update_by") + private String updateBy; + @TableField("update_time") + @JSONField(name = "update_time") + private Date updateTime; + @TableField(value = "f_tenant_id",fill = FieldFill.INSERT_UPDATE) + @JSONField(name = "f_tenant_id") + private String tenantId; + @TableField("f_delete_mark") + @JSONField(name = "f_delete_mark") + private Integer deleteMark; + @TableField("f_delete_time") + @JSONField(name = "f_delete_time") + private Date deleteTime; + @TableField("f_delete_user_id") + @JSONField(name = "f_delete_user_id") + private String deleteUserId; + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/entity/CorporationEntity.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/entity/CorporationEntity.java new file mode 100644 index 0000000..2a55b66 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/entity/CorporationEntity.java @@ -0,0 +1,62 @@ +package com.yunzhupaas.mdm.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import java.util.Date; +import java.util.List; +import com.alibaba.fastjson.annotation.JSONField; +/** + * 法人公司 + * + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-24 + */ +@Data +@TableName("mdm_corporation") +public class CorporationEntity { + @TableId(value ="corporation_id" ) + @JSONField(name = "corporation_id") + private String corporationId; + @TableField("company_id") + @JSONField(name = "company_id") + private String companyId; + @TableField(value = "major_person_id" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "major_person_id") + private String majorPersonId; + @TableField("remark") + @JSONField(name = "remark") + private String remark; + @TableField("create_by") + @JSONField(name = "create_by") + private String createBy; + @TableField("create_time") + @JSONField(name = "create_time") + private Date createTime; + @TableField("update_by") + @JSONField(name = "update_by") + private String updateBy; + @TableField("update_time") + @JSONField(name = "update_time") + private Date updateTime; + @TableField(value = "f_tenant_id",fill = FieldFill.INSERT_UPDATE) + @JSONField(name = "f_tenant_id") + private String tenantId; + @TableField("f_delete_mark") + @JSONField(name = "f_delete_mark") + private Integer deleteMark; + @TableField("f_delete_time") + @JSONField(name = "f_delete_time") + private Date deleteTime; + @TableField("f_delete_user_id") + @JSONField(name = "f_delete_user_id") + private String deleteUserId; + @TableField("f_flow_id") + @JSONField(name = "f_flow_id") + private String flowId; + @TableField("f_flow_task_id") + @JSONField(name = "f_flow_task_id") + private String flowTaskId; + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/entity/CustomerEntity.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/entity/CustomerEntity.java new file mode 100644 index 0000000..5209442 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/entity/CustomerEntity.java @@ -0,0 +1,53 @@ +package com.yunzhupaas.mdm.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import java.util.Date; +import java.util.List; +import com.alibaba.fastjson.annotation.JSONField; +/** + * 客户 + * + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-24 + */ +@Data +@TableName("mdm_customer") +public class CustomerEntity { + @TableId(value ="customer_id" ) + @JSONField(name = "customer_id") + private String customerId; + @TableField("company_id") + @JSONField(name = "company_id") + private String companyId; + @TableField(value = "major_person_id" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "major_person_id") + private String personId; + @TableField(value = "customer_level" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "customer_level") + private String customerLevel; + @TableField(value = "customer_source" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "customer_source") + private String customerSource; + @TableField("remark") + @JSONField(name = "remark") + private String remark; + @TableField("create_by") + @JSONField(name = "create_by") + private String createBy; + @TableField("create_time") + @JSONField(name = "create_time") + private Date createTime; + @TableField("update_by") + @JSONField(name = "update_by") + private String updateBy; + @TableField("update_time") + @JSONField(name = "update_time") + private Date updateTime; + @TableField(value = "f_tenant_id",fill = FieldFill.INSERT_UPDATE) + @JSONField(name = "f_tenant_id") + private String tenantId; + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/entity/MaterialEntity.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/entity/MaterialEntity.java new file mode 100644 index 0000000..f57183f --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/entity/MaterialEntity.java @@ -0,0 +1,103 @@ +package com.yunzhupaas.mdm.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import java.util.Date; +import java.util.List; +import com.alibaba.fastjson.annotation.JSONField; +import java.math.BigDecimal; +/** + * 物料信息 + * + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-27 + */ +@Data +@TableName("mdm_material") +public class MaterialEntity { + @TableId(value ="material_id" ) + @JSONField(name = "material_id") + private String materialId; + @TableField(value = "material_code" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "material_code") + private String materialCode; + @TableField(value = "material_name" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "material_name") + private String materialName; + @TableField(value = "material_model" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "material_model") + private String materialModel; + @TableField(value = "material_category" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "material_category") + private String materialCategory; + @TableField(value = "unit_name" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "unit_name") + private String unitName; + @TableField(value = "texture" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "texture") + private String texture; + @TableField(value = "brand" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "brand") + private String brand; + @TableField(value = "quality_standard" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "quality_standard") + private String qualityStandard; + @TableField(value = "technical_standard" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "technical_standard") + private String technicalStandard; + @TableField(value = "acceptance_criteria" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "acceptance_criteria") + private String acceptanceCriteria; + @TableField(value = "delivery_requirements" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "delivery_requirements") + private String deliveryRequirements; + @TableField(value = "storage_conditions" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "storage_conditions") + private String storageConditions; + @TableField(value = "tax_rate" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "tax_rate") + private BigDecimal taxRate; + @TableField(value = "tax_code" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "tax_code") + private String taxCode; + @TableField("remark") + @JSONField(name = "remark") + private String remark; + @TableField("create_by") + @JSONField(name = "create_by") + private String createBy; + @TableField("create_time") + @JSONField(name = "create_time") + private Date createTime; + @TableField("update_by") + @JSONField(name = "update_by") + private String updateBy; + @TableField("update_time") + @JSONField(name = "update_time") + private Date updateTime; + @TableField(value = "f_tenant_id",fill = FieldFill.INSERT_UPDATE) + @JSONField(name = "f_tenant_id") + private String tenantId; + @TableField("f_flow_id") + @JSONField(name = "f_flow_id") + private String flowId; + @TableField("f_flow_task_id") + @JSONField(name = "f_flow_task_id") + private String flowTaskId; + @TableField("f_delete_mark") + @JSONField(name = "f_delete_mark") + private Integer deleteMark; + @TableField("f_delete_time") + @JSONField(name = "f_delete_time") + private Date deleteTime; + @TableField("f_delete_user_id") + @JSONField(name = "f_delete_user_id") + private String deleteUserId; + @TableField("f_version") + @Version + @JSONField(name = "f_version") + private Integer version; + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/entity/PanyInvoiceEntity.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/entity/PanyInvoiceEntity.java new file mode 100644 index 0000000..0a77463 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/entity/PanyInvoiceEntity.java @@ -0,0 +1,83 @@ +package com.yunzhupaas.mdm.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import java.util.Date; +import java.util.List; +import com.alibaba.fastjson.annotation.JSONField; +/** + * 企业发票抬头 + * + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-24 + */ +@Data +@TableName("mdm_company_invoice") +public class PanyInvoiceEntity { + @TableId(value ="invoice_id" ) + @JSONField(name = "invoice_id") + private String invoiceId; + @TableField("company_id") + @JSONField(name = "company_id") + private String companyId; + @TableField(value = "title_code" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "title_code") + private String titleCode; + @TableField(value = "title_name" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "title_name") + private String titleName; + @TableField(value = "credit_code" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "credit_code") + private String creditCode; + @TableField(value = "tax_type" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "tax_type") + private String taxType; + @TableField(value = "address" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "address") + private String address; + @TableField(value = "phone" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "phone") + private String phone; + @TableField(value = "bank_name" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "bank_name") + private String bankName; + @TableField(value = "bank_account" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "bank_account") + private String bankAccount; + @TableField(value = "is_valid" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "is_valid") + private String isValid; + @TableField(value = "is_defalut" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "is_defalut") + private String isDefalut; + @TableField(value = "remark" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "remark") + private String remark; + @TableField("create_by") + @JSONField(name = "create_by") + private String createBy; + @TableField("create_time") + @JSONField(name = "create_time") + private Date createTime; + @TableField("update_by") + @JSONField(name = "update_by") + private String updateBy; + @TableField("update_time") + @JSONField(name = "update_time") + private Date updateTime; + @TableField(value = "f_tenant_id",fill = FieldFill.INSERT_UPDATE) + @JSONField(name = "f_tenant_id") + private String tenantId; + @TableField("f_delete_mark") + @JSONField(name = "f_delete_mark") + private Integer deleteMark; + @TableField("f_delete_time") + @JSONField(name = "f_delete_time") + private Date deleteTime; + @TableField("f_delete_user_id") + @JSONField(name = "f_delete_user_id") + private String deleteUserId; + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/entity/ProductEntity.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/entity/ProductEntity.java new file mode 100644 index 0000000..7f77c49 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/entity/ProductEntity.java @@ -0,0 +1,130 @@ +package com.yunzhupaas.mdm.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import java.util.Date; +import java.util.List; +import com.alibaba.fastjson.annotation.JSONField; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigDecimal; +/** + * 商品信息 + * + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-27 + */ +@Data +@TableName("mdm_product") +public class ProductEntity { + @TableId(value ="product_id" ) + @JSONField(name = "product_id") + private String productId; + @TableField(value = "product_code" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "product_code") + private String productCode; + @TableField(value = "product_name" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "product_name") + private String productName; + @TableField(value = "short_name" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "short_name") + private String shortName; + @TableField(value = "product_type" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "product_type") + private String productType; + @TableField(value = "product_category" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "product_category") + private String productCategory; + @TableField(value = "brand" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "brand") + private String brand; + @TableField(value = "product_model" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "product_model") + private String productModel; + @TableField(value = "color" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "color") + private String color; + @TableField(value = "product_size" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "product_size") + private String productSize; + @TableField(value = "weight" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "weight") + private BigDecimal weight; + @TableField(value = "unit_name" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "unit_name") + private String unitName; + @TableField(value = "min_order_quantity" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "min_order_quantity") + private BigDecimal minOrderQuantity; + @TableField(value = "standard_sales_price" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "standard_sales_price") + private BigDecimal standardSalesPrice; + @TableField(value = "gross_weight" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "gross_weight") + private BigDecimal grossWeight; + @TableField(value = "net_weight" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "net_weight") + private BigDecimal netWeight; + @TableField(value = "packagesize" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "packagesize") + private String packagesize; + @TableField(value = "cost_price" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "cost_price") + private BigDecimal costPrice; + @TableField(value = "tax_rate" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "tax_rate") + private BigDecimal taxRate; + @TableField(value = "tax_code" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "tax_code") + private String taxCode; + @TableField(value = "warranty_period" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "warranty_period") + private Integer warrantyPeriod; + @TableField(value = "warranty_terms" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "warranty_terms") + private String warrantyTerms; + @TableField(value = "remark" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "remark") + private String remark; + @TableField("create_by") + @JSONField(name = "create_by") + private String createBy; + @TableField("create_time") + @JSONField(name = "create_time") + private Date createTime; + @TableField("update_by") + @JSONField(name = "update_by") + private String updateBy; + @TableField("update_time") + @JSONField(name = "update_time") + private Date updateTime; + @TableField(value = "f_tenant_id",fill = FieldFill.INSERT_UPDATE) + @JSONField(name = "f_tenant_id") + private String tenantId; + @TableField("f_flow_id") + @JSONField(name = "f_flow_id") + private String flowId; + @TableField("f_flow_task_id") + @JSONField(name = "f_flow_task_id") + private String flowTaskId; + @TableField("f_delete_mark") + @JSONField(name = "f_delete_mark") + private Integer deleteMark; + @TableField("f_delete_time") + @JSONField(name = "f_delete_time") + private Date deleteTime; + @TableField("f_delete_user_id") + @JSONField(name = "f_delete_user_id") + private String deleteUserId; + @TableField("f_version") + @Version + @JSONField(name = "f_version") + private Integer version; + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/entity/SupplierEntity.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/entity/SupplierEntity.java new file mode 100644 index 0000000..5c598ad --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/entity/SupplierEntity.java @@ -0,0 +1,65 @@ +package com.yunzhupaas.mdm.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import java.util.Date; +import java.util.List; +import com.alibaba.fastjson.annotation.JSONField; +/** + * 供应商 + * + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-24 + */ +@Data +@TableName("mdm_supplier") +public class SupplierEntity { + @TableId(value ="supplier_id" ) + @JSONField(name = "supplier_id") + private String supplierId; + @TableField("company_id") + @JSONField(name = "company_id") + private String companyId; + @TableField(value = "major_person_id" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "major_person_id") + private String majorPersonId; + @TableField(value = "supplier_level" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "supplier_level") + private String supplierLevel; + @TableField(value = "supplier_type" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "supplier_type") + private String supplierType; + @TableField(value = "supplier_category" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "supplier_category") + private String supplierCategory; + @TableField(value = "honor" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "honor") + private String honor; + @TableField(value = "achievement" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "achievement") + private String achievement; + @TableField(value = "finish_project" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "finish_project") + private String finishProject; + @TableField("remark") + @JSONField(name = "remark") + private String remark; + @TableField("create_by") + @JSONField(name = "create_by") + private String createBy; + @TableField("create_time") + @JSONField(name = "create_time") + private Date createTime; + @TableField("update_by") + @JSONField(name = "update_by") + private String updateBy; + @TableField("update_time") + @JSONField(name = "update_time") + private Date updateTime; + @TableField(value = "f_tenant_id",fill = FieldFill.INSERT_UPDATE) + @JSONField(name = "f_tenant_id") + private String tenantId; + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/asset/AssetConstant.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/asset/AssetConstant.java new file mode 100644 index 0000000..211dfc9 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/asset/AssetConstant.java @@ -0,0 +1,42 @@ +package com.yunzhupaas.mdm.model.asset; + +import com.yunzhupaas.util.JsonUtil; +import java.util.*; + +/** + * mdm_asset配置json + * + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-28 + */ +public class AssetConstant{ + /** 数据库链接 */ + public static final String DBLINKID = "0"; + /** 表别名 map */ + public static final Map TABLERENAMES = JsonUtil.getJsonToBean("{\"mdm_asset\":\"asset\"}",Map.class); + /** 子表model map */ + public static final Map TABLEFIELDKEY = JsonUtil.getJsonToBean("{}",Map.class); + /** 整个表单配置json */ + public static final String getFormData(){ + StringBuilder sb = new StringBuilder(); + sb.append("{\"popupType\":\"fullScreen\",\"labelWidth\":100,\"classNames\":[],\"className\":[],\"fullScreenWidth\":\"100%\",\"hasConfirmAndAddBtn\":true,\"cancelButtonTextI18nCode\":\"common.cancelText\",\"businessKeyTip\":\"数据已存在,请勿重复提交!\",\"labelPosition\":\"right\",\"printId\":\"\",\"labelSuffix\":\"\",\"customBtns\":[],\"disabled\":false,\"formModel\":\"dataForm\",\"cancelButtonText\":\"取消\",\"confirmButtonText\":\"确定\",\"hasCancelBtn\":true,\"primaryKeyPolicy\":1,\"hasPrintBtn\":false,\"concurrencyLock\":false,\"classJson\":\"\",\"drawerWidth\":\"1000px\",\"confirmButtonTextI18nCode\":\"common.okText\",\"printButtonText\":\"打印\",\"businessKeyList\":[],\"formRef\":\"formRef\",\"gutter\":15,\"logicalDelete\":true,\"size\":\"middle\",\"formRules\":\"rules\",\"generalWidth\":\"600px\",\"colon\":false,\"hasConfirmBtn\":true,\"useBusinessKey\":false,\"formStyle\":\"\",\"printButtonTextI18nCode\":\"common.printText\",\"fields\":[{\"__config__\":{\"formId\":\"formItemec5a15\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"assetCode\",\"className\":[],\"label\":\"资产编码\",\"trigger\":\"change\",\"ruleConfig\":{\"startNumber\":\"\",\"dateFormat\":\"YYYY\",\"randomDigit\":16,\"prefixList\":[],\"randomType\":1,\"suffixList\":[],\"type\":1},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777345780019,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"资产编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":12},\"readonly\":true,\"__vModel__\":\"asset_code\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"系统自动生成\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem120e88\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"defaultValue\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"资产名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777345895532,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":false,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"asset_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"10\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777346352365,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItema4f72a\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"assetType\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"资产类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"multiple\":false,\"__vModel__\":\"asset_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"}},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"40\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777347095610,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem03ef8d\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"assetCategory\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"资产分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"multiple\":false,\"__vModel__\":\"asset_category\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"}},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"InUse\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777347177897,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemc6c516\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"资产状态\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"options\":[{\"fullName\":\"在用\",\"id\":\"InUse\"},{\"fullName\":\"闲置\",\"id\":\"Idle\"},{\"fullName\":\"故障\",\"id\":\"Fault\"},{\"fullName\":\"维修中\",\"id\":\"FIX\"},{\"fullName\":\"借用中\",\"id\":\"OnLoan\"},{\"fullName\":\"已报废\",\"id\":\"Scrapped\"},{\"fullName\":\"已处置\",\"id\":\"Disposed\"}],\"multiple\":false,\"__vModel__\":\"asset_status\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"}},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347474179,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItem2ea454\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"assetLocation\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"资产位置\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"multiple\":false,\"__vModel__\":\"asset_location\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"}},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"formId\":\"formItem60e2d0\",\"yunzhupaasKey\":\"organizeSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"使用组织\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347508873,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasOrganizeSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"ableIds\":[],\"multiple\":false,\"__vModel__\":\"current_org_id\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"placeholder\":\"请选择\"},{\"ableRelationIds\":[],\"clearable\":true,\"__config__\":{\"formId\":\"formItem8d2078\",\"yunzhupaasKey\":\"userSelect\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"保管用户\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347525827,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-user\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasUserSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"ableIds\":[],\"multiple\":false,\"__vModel__\":\"current_user_id\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"placeholder\":\"请选择\",\"relationField\":\"\"},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"Owned\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777347571406,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem4eae10\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"资产权属\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"options\":[{\"fullName\":\"自有\",\"id\":\"Owned\"},{\"fullName\":\"租赁\",\"id\":\"Leased\"},{\"fullName\":\"融资租赁\",\"id\":\"FinLeased\"},{\"fullName\":\"借用\",\"id\":\"Borrowed\"},{\"fullName\":\"托管\",\"id\":\"Trusteeship\"}],\"multiple\":false,\"__vModel__\":\"asset_ownership\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"}},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemec96d9\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"单位\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347663137,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"measurement_unit\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"controls\":false,\"precision\":2,\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"\",\"__config__\":{\"formId\":\"formItem21ecc7\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"数量\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347687893,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"min\":0,\"__vModel__\":\"quantity\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"placeholder\":\"请输入\",\"addonBefore\":\"\"},{\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347731278,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItem375d5b\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"购置日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"format\":\"yyyy-MM-dd\",\"__vModel__\":\"purchase_date\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择\"},{\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347763029,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItem99411c\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"启用日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"format\":\"yyyy-MM-dd\",\"__vModel__\":\"commissioning_date\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择\"},{\"controls\":false,\"precision\":2,\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"月\",\"__config__\":{\"formId\":\"formItembba5e3\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"预计使用年限\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347785655,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"min\":0,\"__vModel__\":\"expected_life\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"placeholder\":\"请输入\",\"addonBefore\":\"\"},{\"popupType\":\"dialog\",\"hasPage\":true,\"filterable\":false,\"clearable\":true,\"modelId\":\"817082533433836293\",\"pageSize\":20,\"columnOptions\":[{\"label\":\"企业编码\",\"value\":\"company_code\"},{\"label\":\"企业名称\",\"value\":\"company_name\"},{\"label\":\"简称/昵称\",\"value\":\"short_name\"},{\"label\":\"类型\",\"value\":\"entity_type\"},{\"label\":\"社会信用代码\",\"value\":\"credit_code\"},{\"label\":\"归属组织\",\"value\":\"org_id\"},{\"label\":\"所属地区\",\"value\":\"province_id\"},{\"label\":\"法定代表人\",\"value\":\"legal_representative\"},{\"label\":\"责任人\",\"value\":\"yunzhupaas_mdm_supplier_yunzhupaas_major_person_id\"}],\"relationField\":\"company_name\",\"queryType\":0,\"__config__\":{\"formId\":\"formItem218e23\",\"yunzhupaasKey\":\"relationForm\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":\"\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"供应商\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347854600,\"layout\":\"colFormItem\",\"transferList\":[],\"tagIcon\":\"icon-ym icon-ym-generator-menu\",\"tag\":\"YunzhupaasRelationForm\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"extraOptions\":[],\"popupTitle\":\"选择数据\",\"__vModel__\":\"supplier_id\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择\",\"popupWidth\":\"1000px\",\"propsValue\":\"company_id\"},{\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"clearable\":true,\"showCount\":false,\"__config__\":{\"formId\":\"formItema2c991\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347940332,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maxlength\":255,\"__vModel__\":\"remark\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\"}],\"detailExtraList\":[],\"span\":24,\"dataLog\":true}"); return sb.toString(); + } + /** 列表字段配置json */ + public static final String getColumnData(){ + StringBuilder sb = new StringBuilder(); + sb.append("{\"showSummary\":false,\"treePropsValue\":\"enCode\",\"columnOptions\":[{\"__config__\":{\"formId\":\"formItemec5a15\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"assetCode\",\"className\":[],\"label\":\"资产编码\",\"trigger\":\"change\",\"ruleConfig\":{\"startNumber\":\"\",\"dateFormat\":\"YYYY\",\"randomDigit\":16,\"prefixList\":[],\"randomType\":1,\"suffixList\":[],\"type\":1},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777345780019,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"资产编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":12},\"readonly\":true,\"__vModel__\":\"asset_code\",\"fullName\":\"资产编码\",\"fullNameI18nCode\":[\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"asset_code\",\"placeholder\":\"系统自动生成\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"资产名称\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem120e88\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"defaultValue\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"资产名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777345895532,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":false,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"asset_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"asset_name\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"资产类型\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"10\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777346352365,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItema4f72a\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"assetType\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"资产类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"asset_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"asset_type\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"资产分类\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"40\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777347095610,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem03ef8d\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"assetCategory\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"资产分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"asset_category\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"asset_category\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"资产状态\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"InUse\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777347177897,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemc6c516\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"资产状态\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"options\":[{\"fullName\":\"在用\",\"id\":\"InUse\"},{\"fullName\":\"闲置\",\"id\":\"Idle\"},{\"fullName\":\"故障\",\"id\":\"Fault\"},{\"fullName\":\"维修中\",\"id\":\"FIX\"},{\"fullName\":\"借用中\",\"id\":\"OnLoan\"},{\"fullName\":\"已报废\",\"id\":\"Scrapped\"},{\"fullName\":\"已处置\",\"id\":\"Disposed\"}],\"__vModel__\":\"asset_status\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"asset_status\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"资产位置\",\"fullNameI18nCode\":[\"\"],\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347474179,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItem2ea454\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"assetLocation\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"资产位置\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"asset_location\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"asset_location\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"使用组织\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"formId\":\"formItem60e2d0\",\"yunzhupaasKey\":\"organizeSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"使用组织\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347508873,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasOrganizeSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"current_org_id\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"current_org_id\",\"placeholder\":\"请选择\"},{\"ableRelationIds\":[],\"clearable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"保管用户\",\"fullNameI18nCode\":[\"\"],\"relationField\":\"\",\"__config__\":{\"formId\":\"formItem8d2078\",\"yunzhupaasKey\":\"userSelect\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"保管用户\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347525827,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-user\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasUserSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"current_user_id\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"current_user_id\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"资产权属\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"Owned\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777347571406,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem4eae10\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"资产权属\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"options\":[{\"fullName\":\"自有\",\"id\":\"Owned\"},{\"fullName\":\"租赁\",\"id\":\"Leased\"},{\"fullName\":\"融资租赁\",\"id\":\"FinLeased\"},{\"fullName\":\"借用\",\"id\":\"Borrowed\"},{\"fullName\":\"托管\",\"id\":\"Trusteeship\"}],\"__vModel__\":\"asset_ownership\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"asset_ownership\",\"placeholder\":\"请选择\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单位\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemec96d9\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"单位\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347663137,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"measurement_unit\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"measurement_unit\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"controls\":false,\"precision\":2,\"fullName\":\"数量\",\"fullNameI18nCode\":[\"\"],\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"\",\"__config__\":{\"formId\":\"formItem21ecc7\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"数量\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347687893,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"min\":0,\"__vModel__\":\"quantity\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"quantity\",\"placeholder\":\"请输入\",\"addonBefore\":\"\"},{\"clearable\":true,\"format\":\"yyyy-MM-dd\",\"fullName\":\"购置日期\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347731278,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItem375d5b\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"购置日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"purchase_date\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"purchase_date\",\"placeholder\":\"请选择\"},{\"clearable\":true,\"format\":\"yyyy-MM-dd\",\"fullName\":\"启用日期\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347763029,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItem99411c\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"启用日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"commissioning_date\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"commissioning_date\",\"placeholder\":\"请选择\"},{\"controls\":false,\"precision\":2,\"fullName\":\"预计使用年限\",\"fullNameI18nCode\":[\"\"],\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"月\",\"__config__\":{\"formId\":\"formItembba5e3\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"预计使用年限\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347785655,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"min\":0,\"__vModel__\":\"expected_life\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"expected_life\",\"placeholder\":\"请输入\",\"addonBefore\":\"\"},{\"popupType\":\"dialog\",\"hasPage\":false,\"filterable\":false,\"clearable\":true,\"modelId\":\"817082533433836293\",\"fullName\":\"供应商\",\"pageSize\":20,\"columnOptions\":[],\"fullNameI18nCode\":[\"\"],\"relationField\":\"company_name\",\"queryType\":0,\"__config__\":{\"formId\":\"formItem218e23\",\"yunzhupaasKey\":\"relationForm\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":\"\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"供应商\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347854600,\"layout\":\"colFormItem\",\"transferList\":[],\"tagIcon\":\"icon-ym icon-ym-generator-menu\",\"tag\":\"YunzhupaasRelationForm\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"extraOptions\":[],\"popupTitle\":\"选择数据\",\"__vModel__\":\"supplier_id\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"supplier_id\",\"placeholder\":\"请选择\",\"popupWidth\":\"1000px\",\"propsValue\":\"company_id\"},{\"clearable\":true,\"maxlength\":255,\"fullName\":\"备注\",\"fullNameI18nCode\":[\"\"],\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"showCount\":false,\"__config__\":{\"formId\":\"formItema2c991\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347940332,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"remark\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"remark\",\"placeholder\":\"请输入\"}],\"pageSize\":20,\"type\":1,\"columnBtnsList\":[{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-edit\",\"label\":\"编辑\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"edit\",\"labelI18nCode\":\"common.editText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"删除\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"remove\",\"labelI18nCode\":\"common.delText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-generator-menu\",\"label\":\"详情\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"detail\",\"labelI18nCode\":\"common.detailText\"}],\"treeTitle\":\"左侧标题\",\"defaultColumnList\":[{\"yunzhupaasKey\":\"billRule\",\"resizable\":true,\"fullName\":\"资产编码\",\"fullNameI18nCode\":[\"\"],\"label\":\"资产编码\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItemec5a15\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"assetCode\",\"className\":[],\"label\":\"资产编码\",\"trigger\":\"change\",\"ruleConfig\":{\"startNumber\":\"\",\"dateFormat\":\"YYYY\",\"randomDigit\":16,\"prefixList\":[],\"randomType\":1,\"suffixList\":[],\"type\":1},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777345780019,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"资产编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":12},\"readonly\":true,\"prop\":\"asset_code\",\"__vModel__\":\"asset_code\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"asset_code\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem120e88\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"defaultValue\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"资产名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777345895532,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":false,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"asset_name\",\"__vModel__\":\"asset_name\",\"checked\":true,\"disabled\":false,\"id\":\"asset_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"资产名称\",\"label\":\"资产名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"资产类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"资产类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"10\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777346352365,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItema4f72a\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"assetType\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"资产类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"asset_type\",\"__vModel__\":\"asset_type\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"asset_type\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"资产分类\",\"fullNameI18nCode\":[\"\"],\"label\":\"资产分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"40\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777347095610,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem03ef8d\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"assetCategory\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"资产分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"asset_category\",\"__vModel__\":\"asset_category\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"asset_category\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"资产状态\",\"fullNameI18nCode\":[\"\"],\"label\":\"资产状态\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"InUse\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777347177897,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemc6c516\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"资产状态\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"asset_status\",\"options\":[{\"fullName\":\"在用\",\"id\":\"InUse\"},{\"fullName\":\"闲置\",\"id\":\"Idle\"},{\"fullName\":\"故障\",\"id\":\"Fault\"},{\"fullName\":\"维修中\",\"id\":\"FIX\"},{\"fullName\":\"借用中\",\"id\":\"OnLoan\"},{\"fullName\":\"已报废\",\"id\":\"Scrapped\"},{\"fullName\":\"已处置\",\"id\":\"Disposed\"}],\"__vModel__\":\"asset_status\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"asset_status\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"cascader\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"资产位置\",\"fullNameI18nCode\":[\"\"],\"label\":\"资产位置\",\"sortable\":false,\"align\":\"left\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347474179,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItem2ea454\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"assetLocation\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"资产位置\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"asset_location\",\"__vModel__\":\"asset_location\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"asset_location\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"organizeSelect\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"使用组织\",\"fullNameI18nCode\":[\"\"],\"label\":\"使用组织\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItem60e2d0\",\"yunzhupaasKey\":\"organizeSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"使用组织\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347508873,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasOrganizeSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"current_org_id\",\"__vModel__\":\"current_org_id\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"current_org_id\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"ableRelationIds\":[],\"yunzhupaasKey\":\"userSelect\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"__config__\":{\"formId\":\"formItem8d2078\",\"yunzhupaasKey\":\"userSelect\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"保管用户\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347525827,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-user\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasUserSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"current_user_id\",\"__vModel__\":\"current_user_id\",\"checked\":true,\"selectType\":\"all\",\"disabled\":false,\"id\":\"current_user_id\",\"placeholder\":\"请选择\",\"clearable\":true,\"resizable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"保管用户\",\"label\":\"保管用户\",\"sortable\":false,\"relationField\":\"\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"资产权属\",\"fullNameI18nCode\":[\"\"],\"label\":\"资产权属\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"Owned\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777347571406,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem4eae10\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"资产权属\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"asset_ownership\",\"options\":[{\"fullName\":\"自有\",\"id\":\"Owned\"},{\"fullName\":\"租赁\",\"id\":\"Leased\"},{\"fullName\":\"融资租赁\",\"id\":\"FinLeased\"},{\"fullName\":\"借用\",\"id\":\"Borrowed\"},{\"fullName\":\"托管\",\"id\":\"Trusteeship\"}],\"__vModel__\":\"asset_ownership\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"asset_ownership\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemec96d9\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"单位\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347663137,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"measurement_unit\",\"__vModel__\":\"measurement_unit\",\"checked\":true,\"disabled\":false,\"id\":\"measurement_unit\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"单位\",\"label\":\"单位\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":2,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItem21ecc7\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"数量\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347687893,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"min\":0,\"prop\":\"quantity\",\"__vModel__\":\"quantity\",\"checked\":true,\"disabled\":false,\"id\":\"quantity\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"resizable\":true,\"fullName\":\"数量\",\"label\":\"数量\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"datePicker\",\"clearable\":true,\"resizable\":true,\"format\":\"yyyy-MM-dd\",\"fullName\":\"购置日期\",\"fullNameI18nCode\":[\"\"],\"label\":\"购置日期\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347731278,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItem375d5b\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"购置日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"purchase_date\",\"__vModel__\":\"purchase_date\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"purchase_date\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"datePicker\",\"clearable\":true,\"resizable\":true,\"format\":\"yyyy-MM-dd\",\"fullName\":\"启用日期\",\"fullNameI18nCode\":[\"\"],\"label\":\"启用日期\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347763029,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItem99411c\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"启用日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"commissioning_date\",\"__vModel__\":\"commissioning_date\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"commissioning_date\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":2,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItembba5e3\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"预计使用年限\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347785655,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"min\":0,\"prop\":\"expected_life\",\"__vModel__\":\"expected_life\",\"checked\":true,\"disabled\":false,\"id\":\"expected_life\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"resizable\":true,\"fullName\":\"预计使用年限\",\"label\":\"预计使用年限\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"月\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"popupType\":\"dialog\",\"yunzhupaasKey\":\"relationForm\",\"hasPage\":false,\"modelId\":\"817082533433836293\",\"pageSize\":20,\"columnOptions\":[],\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"__config__\":{\"formId\":\"formItem218e23\",\"yunzhupaasKey\":\"relationForm\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":\"\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"供应商\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347854600,\"layout\":\"colFormItem\",\"transferList\":[],\"tagIcon\":\"icon-ym icon-ym-generator-menu\",\"tag\":\"YunzhupaasRelationForm\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"supplier_id\",\"__vModel__\":\"supplier_id\",\"checked\":true,\"disabled\":false,\"id\":\"supplier_id\",\"placeholder\":\"请选择\",\"popupWidth\":\"1000px\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"fullName\":\"供应商\",\"label\":\"供应商\",\"sortable\":false,\"relationField\":\"company_name\",\"queryType\":0,\"extraOptions\":[],\"popupTitle\":\"选择数据\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"labelI18nCode\":\"\",\"propsValue\":\"company_id\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"maxlength\":255,\"fullName\":\"备注\",\"fullNameI18nCode\":[\"\"],\"label\":\"备注\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"showCount\":false,\"__config__\":{\"formId\":\"formItema2c991\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347940332,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"remark\",\"__vModel__\":\"remark\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"remark\",\"placeholder\":\"请输入\",\"labelI18nCode\":\"\"}],\"treeRelationFieldAbleIds\":[],\"treeSyncInterfaceName\":\"\",\"treeSyncTemplateJson\":[],\"treeRelation\":\"asset_type\",\"defaultSortConfig\":[],\"tabConfig\":{\"hasAllTab\":true,\"relationField\":\"asset_type\",\"on\":true},\"hasSuperQuery\":true,\"treePropsLabel\":\"fullName\",\"groupField\":\"\",\"printIds\":[],\"uploaderTemplateJson\":{\"selectKey\":[\"asset_name\",\"asset_type\",\"asset_category\",\"asset_status\",\"asset_ownership\",\"asset_location\",\"current_org_id\",\"measurement_unit\",\"commissioning_date\",\"purchase_date\",\"remark\",\"expected_life\",\"quantity\",\"current_user_id\"],\"dataType\":\"1\"},\"hasTreeQuery\":false,\"useFormPermission\":false,\"complexHeaderList\":[],\"useBtnPermission\":true,\"treeSyncType\":0,\"hasPage\":true,\"searchList\":[{\"yunzhupaasKey\":\"billRule\",\"searchType\":2,\"fullName\":\"资产编码\",\"fullNameI18nCode\":[\"\"],\"label\":\"资产编码\",\"__config__\":{\"formId\":\"formItemec5a15\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"assetCode\",\"className\":[],\"label\":\"资产编码\",\"trigger\":\"change\",\"ruleConfig\":{\"startNumber\":\"\",\"dateFormat\":\"YYYY\",\"randomDigit\":16,\"prefixList\":[],\"randomType\":1,\"suffixList\":[],\"type\":1},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777345780019,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"资产编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":12},\"readonly\":true,\"prop\":\"asset_code\",\"__vModel__\":\"asset_code\",\"searchMultiple\":false,\"isKeyword\":false,\"style\":{\"width\":\"100%\"},\"id\":\"asset_code\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"showCount\":false,\"__config__\":{\"formId\":\"formItem120e88\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"defaultValue\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"资产名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777345895532,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":false,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"asset_name\",\"__vModel__\":\"asset_name\",\"searchMultiple\":false,\"disabled\":false,\"id\":\"asset_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"searchType\":2,\"maxlength\":20,\"fullName\":\"资产名称\",\"label\":\"资产名称\",\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"isKeyword\":false,\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"searchType\":1,\"multiple\":false,\"fullName\":\"资产状态\",\"fullNameI18nCode\":[\"\"],\"label\":\"资产状态\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"InUse\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777347177897,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemc6c516\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"资产状态\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"asset_status\",\"options\":[{\"fullName\":\"在用\",\"id\":\"InUse\"},{\"fullName\":\"闲置\",\"id\":\"Idle\"},{\"fullName\":\"故障\",\"id\":\"Fault\"},{\"fullName\":\"维修中\",\"id\":\"FIX\"},{\"fullName\":\"借用中\",\"id\":\"OnLoan\"},{\"fullName\":\"已报废\",\"id\":\"Scrapped\"},{\"fullName\":\"已处置\",\"id\":\"Disposed\"}],\"__vModel__\":\"asset_status\",\"searchMultiple\":true,\"isKeyword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"asset_status\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"datePicker\",\"clearable\":true,\"searchType\":3,\"noShow\":false,\"format\":\"yyyy-MM-dd\",\"fullName\":\"购置日期\",\"fullNameI18nCode\":[\"\"],\"label\":\"购置日期\",\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347731278,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItem375d5b\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"购置日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"purchase_date\",\"__vModel__\":\"purchase_date\",\"searchMultiple\":false,\"isKeyword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"purchase_date\",\"placeholder\":\"请选择\",\"value\":[],\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"datePicker\",\"clearable\":true,\"searchType\":3,\"noShow\":false,\"format\":\"yyyy-MM-dd\",\"fullName\":\"启用日期\",\"fullNameI18nCode\":[\"\"],\"label\":\"启用日期\",\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347763029,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItem99411c\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"启用日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"commissioning_date\",\"__vModel__\":\"commissioning_date\",\"searchMultiple\":false,\"isKeyword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"commissioning_date\",\"placeholder\":\"请选择\",\"value\":[],\"labelI18nCode\":\"\"}],\"ruleList\":{\"conditionList\":[],\"matchLogic\":\"and\"},\"childTableStyle\":1,\"treePropsChildren\":\"children\",\"treeRelationFieldSelectType\":\"all\",\"showOverflow\":true,\"treeTemplateJson\":[],\"treeTitleI18nCode\":\"\",\"treePropsName\":\"\",\"useColumnPermission\":false,\"treePropsUrl\":\"\",\"btnsList\":[{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-add\",\"label\":\"新增\",\"value\":\"add\",\"labelI18nCode\":\"common.add2Text\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-download\",\"label\":\"导出\",\"value\":\"download\",\"labelI18nCode\":\"common.exportText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-upload\",\"label\":\"导入\",\"value\":\"upload\",\"labelI18nCode\":\"common.importText\"},{\"show\":false,\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"批量删除\",\"value\":\"batchRemove\",\"labelI18nCode\":\"common.batchDelText\"},{\"show\":false,\"icon\":\"icon-ym icon-ym-report-icon-preview-printPreview\",\"label\":\"批量打印\",\"value\":\"batchPrint\",\"labelI18nCode\":\"common.batchPrintText\"}],\"useDataPermission\":true,\"viewKey\":\"\",\"columnList\":[{\"yunzhupaasKey\":\"billRule\",\"resizable\":true,\"fullName\":\"资产编码\",\"fullNameI18nCode\":[\"\"],\"label\":\"资产编码\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItemec5a15\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"assetCode\",\"className\":[],\"label\":\"资产编码\",\"trigger\":\"change\",\"ruleConfig\":{\"startNumber\":\"\",\"dateFormat\":\"YYYY\",\"randomDigit\":16,\"prefixList\":[],\"randomType\":1,\"suffixList\":[],\"type\":1},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777345780019,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"资产编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":12},\"readonly\":true,\"prop\":\"asset_code\",\"__vModel__\":\"asset_code\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"asset_code\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem120e88\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"defaultValue\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"资产名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777345895532,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":false,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"asset_name\",\"__vModel__\":\"asset_name\",\"disabled\":false,\"id\":\"asset_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"资产名称\",\"label\":\"资产名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"资产类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"资产类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"10\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777346352365,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItema4f72a\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"assetType\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"资产类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"asset_type\",\"__vModel__\":\"asset_type\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"asset_type\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"资产分类\",\"fullNameI18nCode\":[\"\"],\"label\":\"资产分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"40\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777347095610,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem03ef8d\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"assetCategory\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"资产分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"asset_category\",\"__vModel__\":\"asset_category\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"asset_category\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"资产状态\",\"fullNameI18nCode\":[\"\"],\"label\":\"资产状态\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"InUse\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777347177897,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemc6c516\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"资产状态\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"asset_status\",\"options\":[{\"fullName\":\"在用\",\"id\":\"InUse\"},{\"fullName\":\"闲置\",\"id\":\"Idle\"},{\"fullName\":\"故障\",\"id\":\"Fault\"},{\"fullName\":\"维修中\",\"id\":\"FIX\"},{\"fullName\":\"借用中\",\"id\":\"OnLoan\"},{\"fullName\":\"已报废\",\"id\":\"Scrapped\"},{\"fullName\":\"已处置\",\"id\":\"Disposed\"}],\"__vModel__\":\"asset_status\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"asset_status\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"cascader\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"资产位置\",\"fullNameI18nCode\":[\"\"],\"label\":\"资产位置\",\"sortable\":false,\"align\":\"left\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347474179,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItem2ea454\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"assetLocation\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"资产位置\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"asset_location\",\"__vModel__\":\"asset_location\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"asset_location\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"organizeSelect\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"使用组织\",\"fullNameI18nCode\":[\"\"],\"label\":\"使用组织\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItem60e2d0\",\"yunzhupaasKey\":\"organizeSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"使用组织\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347508873,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasOrganizeSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"current_org_id\",\"__vModel__\":\"current_org_id\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"current_org_id\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"ableRelationIds\":[],\"yunzhupaasKey\":\"userSelect\",\"clearable\":true,\"resizable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"保管用户\",\"fullNameI18nCode\":[\"\"],\"label\":\"保管用户\",\"sortable\":false,\"align\":\"left\",\"relationField\":\"\",\"__config__\":{\"formId\":\"formItem8d2078\",\"yunzhupaasKey\":\"userSelect\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"保管用户\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347525827,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-user\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasUserSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"current_user_id\",\"__vModel__\":\"current_user_id\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"current_user_id\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"资产权属\",\"fullNameI18nCode\":[\"\"],\"label\":\"资产权属\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"Owned\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777347571406,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem4eae10\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"资产权属\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"asset_ownership\",\"options\":[{\"fullName\":\"自有\",\"id\":\"Owned\"},{\"fullName\":\"租赁\",\"id\":\"Leased\"},{\"fullName\":\"融资租赁\",\"id\":\"FinLeased\"},{\"fullName\":\"借用\",\"id\":\"Borrowed\"},{\"fullName\":\"托管\",\"id\":\"Trusteeship\"}],\"__vModel__\":\"asset_ownership\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"asset_ownership\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemec96d9\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"单位\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347663137,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"measurement_unit\",\"__vModel__\":\"measurement_unit\",\"disabled\":false,\"id\":\"measurement_unit\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"单位\",\"label\":\"单位\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":2,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItem21ecc7\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"数量\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347687893,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"min\":0,\"prop\":\"quantity\",\"__vModel__\":\"quantity\",\"disabled\":false,\"id\":\"quantity\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"resizable\":true,\"fullName\":\"数量\",\"label\":\"数量\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"datePicker\",\"clearable\":true,\"resizable\":true,\"format\":\"yyyy-MM-dd\",\"fullName\":\"购置日期\",\"fullNameI18nCode\":[\"\"],\"label\":\"购置日期\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347731278,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItem375d5b\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"购置日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"purchase_date\",\"__vModel__\":\"purchase_date\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"purchase_date\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"datePicker\",\"clearable\":true,\"resizable\":true,\"format\":\"yyyy-MM-dd\",\"fullName\":\"启用日期\",\"fullNameI18nCode\":[\"\"],\"label\":\"启用日期\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347763029,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItem99411c\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"启用日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"commissioning_date\",\"__vModel__\":\"commissioning_date\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"commissioning_date\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":2,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItembba5e3\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"预计使用年限\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347785655,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"min\":0,\"prop\":\"expected_life\",\"__vModel__\":\"expected_life\",\"disabled\":false,\"id\":\"expected_life\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"resizable\":true,\"fullName\":\"预计使用年限\",\"label\":\"预计使用年限\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"月\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"popupType\":\"dialog\",\"yunzhupaasKey\":\"relationForm\",\"hasPage\":false,\"modelId\":\"817082533433836293\",\"pageSize\":20,\"columnOptions\":[],\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"__config__\":{\"formId\":\"formItem218e23\",\"yunzhupaasKey\":\"relationForm\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":\"\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"供应商\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347854600,\"layout\":\"colFormItem\",\"transferList\":[],\"tagIcon\":\"icon-ym icon-ym-generator-menu\",\"tag\":\"YunzhupaasRelationForm\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"supplier_id\",\"__vModel__\":\"supplier_id\",\"disabled\":false,\"id\":\"supplier_id\",\"placeholder\":\"请选择\",\"popupWidth\":\"1000px\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"fullName\":\"供应商\",\"label\":\"供应商\",\"sortable\":false,\"relationField\":\"company_name\",\"queryType\":0,\"extraOptions\":[],\"popupTitle\":\"选择数据\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"labelI18nCode\":\"\",\"propsValue\":\"company_id\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"maxlength\":255,\"fullName\":\"备注\",\"fullNameI18nCode\":[\"\"],\"label\":\"备注\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"showCount\":false,\"__config__\":{\"formId\":\"formItema2c991\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347940332,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"remark\",\"__vModel__\":\"remark\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"remark\",\"placeholder\":\"请输入\",\"labelI18nCode\":\"\"}],\"summaryField\":[],\"parentField\":\"\",\"treeDataSource\":\"dictionary\",\"treeDictionary\":\"assetType\",\"treeSyncInterfaceId\":\"\",\"customBtnsList\":[]}"); return sb.toString(); + } + /** app列表字段配置json */ + public static final String getAppColumnData(){ + StringBuilder sb = new StringBuilder(); + sb.append("{\"hasPage\":true,\"useColumnPermission\":false,\"searchList\":[],\"btnsList\":[{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-add\",\"label\":\"新增\",\"value\":\"add\",\"labelI18nCode\":\"common.add2Text\"},{\"show\":false,\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"批量删除\",\"value\":\"batchRemove\",\"labelI18nCode\":\"common.batchDelText\"}],\"useDataPermission\":false,\"viewKey\":\"\",\"ruleListApp\":{\"conditionList\":[],\"matchLogic\":\"and\"},\"columnList\":[{\"yunzhupaasKey\":\"billRule\",\"resizable\":true,\"fullName\":\"资产编码\",\"fullNameI18nCode\":[\"\"],\"label\":\"资产编码\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItemec5a15\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"assetCode\",\"className\":[],\"label\":\"资产编码\",\"trigger\":\"change\",\"ruleConfig\":{\"startNumber\":\"\",\"dateFormat\":\"YYYY\",\"randomDigit\":16,\"prefixList\":[],\"randomType\":1,\"suffixList\":[],\"type\":1},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777345780019,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"资产编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":12},\"readonly\":true,\"prop\":\"asset_code\",\"__vModel__\":\"asset_code\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"asset_code\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem120e88\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"defaultValue\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"资产名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777345895532,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":false,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"asset_name\",\"__vModel__\":\"asset_name\",\"disabled\":false,\"id\":\"asset_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"资产名称\",\"label\":\"资产名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"资产类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"资产类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"10\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777346352365,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItema4f72a\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"assetType\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"资产类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"asset_type\",\"__vModel__\":\"asset_type\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"asset_type\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"资产分类\",\"fullNameI18nCode\":[\"\"],\"label\":\"资产分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"40\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777347095610,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem03ef8d\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"assetCategory\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"资产分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"asset_category\",\"__vModel__\":\"asset_category\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"asset_category\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"资产状态\",\"fullNameI18nCode\":[\"\"],\"label\":\"资产状态\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"InUse\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777347177897,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemc6c516\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"资产状态\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"asset_status\",\"options\":[{\"fullName\":\"在用\",\"id\":\"InUse\"},{\"fullName\":\"闲置\",\"id\":\"Idle\"},{\"fullName\":\"故障\",\"id\":\"Fault\"},{\"fullName\":\"维修中\",\"id\":\"FIX\"},{\"fullName\":\"借用中\",\"id\":\"OnLoan\"},{\"fullName\":\"已报废\",\"id\":\"Scrapped\"},{\"fullName\":\"已处置\",\"id\":\"Disposed\"}],\"__vModel__\":\"asset_status\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"asset_status\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"cascader\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"资产位置\",\"fullNameI18nCode\":[\"\"],\"label\":\"资产位置\",\"sortable\":false,\"align\":\"left\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347474179,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItem2ea454\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"assetLocation\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"资产位置\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"asset_location\",\"__vModel__\":\"asset_location\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"asset_location\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"organizeSelect\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"使用组织\",\"fullNameI18nCode\":[\"\"],\"label\":\"使用组织\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItem60e2d0\",\"yunzhupaasKey\":\"organizeSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"使用组织\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347508873,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasOrganizeSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"current_org_id\",\"__vModel__\":\"current_org_id\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"current_org_id\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"ableRelationIds\":[],\"yunzhupaasKey\":\"userSelect\",\"clearable\":true,\"resizable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"保管用户\",\"fullNameI18nCode\":[\"\"],\"label\":\"保管用户\",\"sortable\":false,\"align\":\"left\",\"relationField\":\"\",\"__config__\":{\"formId\":\"formItem8d2078\",\"yunzhupaasKey\":\"userSelect\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"保管用户\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347525827,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-user\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasUserSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"current_user_id\",\"__vModel__\":\"current_user_id\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"current_user_id\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"资产权属\",\"fullNameI18nCode\":[\"\"],\"label\":\"资产权属\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"Owned\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777347571406,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem4eae10\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"资产权属\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"asset_ownership\",\"options\":[{\"fullName\":\"自有\",\"id\":\"Owned\"},{\"fullName\":\"租赁\",\"id\":\"Leased\"},{\"fullName\":\"融资租赁\",\"id\":\"FinLeased\"},{\"fullName\":\"借用\",\"id\":\"Borrowed\"},{\"fullName\":\"托管\",\"id\":\"Trusteeship\"}],\"__vModel__\":\"asset_ownership\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"asset_ownership\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemec96d9\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"单位\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347663137,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"measurement_unit\",\"__vModel__\":\"measurement_unit\",\"disabled\":false,\"id\":\"measurement_unit\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"单位\",\"label\":\"单位\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":2,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItem21ecc7\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"数量\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347687893,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"min\":0,\"prop\":\"quantity\",\"__vModel__\":\"quantity\",\"disabled\":false,\"id\":\"quantity\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"resizable\":true,\"fullName\":\"数量\",\"label\":\"数量\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"datePicker\",\"clearable\":true,\"resizable\":true,\"format\":\"yyyy-MM-dd\",\"fullName\":\"购置日期\",\"fullNameI18nCode\":[\"\"],\"label\":\"购置日期\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347731278,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItem375d5b\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"购置日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"purchase_date\",\"__vModel__\":\"purchase_date\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"purchase_date\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"datePicker\",\"clearable\":true,\"resizable\":true,\"format\":\"yyyy-MM-dd\",\"fullName\":\"启用日期\",\"fullNameI18nCode\":[\"\"],\"label\":\"启用日期\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347763029,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItem99411c\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"启用日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"commissioning_date\",\"__vModel__\":\"commissioning_date\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"commissioning_date\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":2,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItembba5e3\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"预计使用年限\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347785655,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"min\":0,\"prop\":\"expected_life\",\"__vModel__\":\"expected_life\",\"disabled\":false,\"id\":\"expected_life\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"resizable\":true,\"fullName\":\"预计使用年限\",\"label\":\"预计使用年限\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"月\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"popupType\":\"dialog\",\"yunzhupaasKey\":\"relationForm\",\"hasPage\":false,\"modelId\":\"817082533433836293\",\"pageSize\":20,\"columnOptions\":[],\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"__config__\":{\"formId\":\"formItem218e23\",\"yunzhupaasKey\":\"relationForm\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":\"\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"供应商\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347854600,\"layout\":\"colFormItem\",\"transferList\":[],\"tagIcon\":\"icon-ym icon-ym-generator-menu\",\"tag\":\"YunzhupaasRelationForm\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"supplier_id\",\"__vModel__\":\"supplier_id\",\"disabled\":false,\"id\":\"supplier_id\",\"placeholder\":\"请选择\",\"popupWidth\":\"1000px\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"fullName\":\"供应商\",\"label\":\"供应商\",\"sortable\":false,\"relationField\":\"company_name\",\"queryType\":0,\"extraOptions\":[],\"popupTitle\":\"选择数据\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"labelI18nCode\":\"\",\"propsValue\":\"company_id\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"maxlength\":255,\"fullName\":\"备注\",\"fullNameI18nCode\":[\"\"],\"label\":\"备注\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"showCount\":false,\"__config__\":{\"formId\":\"formItema2c991\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347940332,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"remark\",\"__vModel__\":\"remark\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"remark\",\"placeholder\":\"请输入\",\"labelI18nCode\":\"\"}],\"columnOptions\":[{\"__config__\":{\"formId\":\"formItemec5a15\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"assetCode\",\"className\":[],\"label\":\"资产编码\",\"trigger\":\"change\",\"ruleConfig\":{\"startNumber\":\"\",\"dateFormat\":\"YYYY\",\"randomDigit\":16,\"prefixList\":[],\"randomType\":1,\"suffixList\":[],\"type\":1},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777345780019,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"资产编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":12},\"readonly\":true,\"__vModel__\":\"asset_code\",\"fullName\":\"资产编码\",\"fullNameI18nCode\":[\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"asset_code\",\"placeholder\":\"系统自动生成\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"资产名称\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem120e88\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"defaultValue\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"资产名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777345895532,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":false,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"asset_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"asset_name\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"资产类型\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"10\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777346352365,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItema4f72a\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"assetType\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"资产类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"asset_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"asset_type\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"资产分类\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"40\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777347095610,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem03ef8d\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"assetCategory\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"资产分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"asset_category\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"asset_category\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"资产状态\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"InUse\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777347177897,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemc6c516\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"资产状态\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"options\":[{\"fullName\":\"在用\",\"id\":\"InUse\"},{\"fullName\":\"闲置\",\"id\":\"Idle\"},{\"fullName\":\"故障\",\"id\":\"Fault\"},{\"fullName\":\"维修中\",\"id\":\"FIX\"},{\"fullName\":\"借用中\",\"id\":\"OnLoan\"},{\"fullName\":\"已报废\",\"id\":\"Scrapped\"},{\"fullName\":\"已处置\",\"id\":\"Disposed\"}],\"__vModel__\":\"asset_status\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"asset_status\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"资产位置\",\"fullNameI18nCode\":[\"\"],\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347474179,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItem2ea454\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"assetLocation\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"资产位置\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"asset_location\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"asset_location\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"使用组织\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"formId\":\"formItem60e2d0\",\"yunzhupaasKey\":\"organizeSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"使用组织\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347508873,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasOrganizeSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"current_org_id\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"current_org_id\",\"placeholder\":\"请选择\"},{\"ableRelationIds\":[],\"clearable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"保管用户\",\"fullNameI18nCode\":[\"\"],\"relationField\":\"\",\"__config__\":{\"formId\":\"formItem8d2078\",\"yunzhupaasKey\":\"userSelect\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"保管用户\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347525827,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-user\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasUserSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"current_user_id\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"current_user_id\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"资产权属\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"Owned\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777347571406,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem4eae10\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"资产权属\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"options\":[{\"fullName\":\"自有\",\"id\":\"Owned\"},{\"fullName\":\"租赁\",\"id\":\"Leased\"},{\"fullName\":\"融资租赁\",\"id\":\"FinLeased\"},{\"fullName\":\"借用\",\"id\":\"Borrowed\"},{\"fullName\":\"托管\",\"id\":\"Trusteeship\"}],\"__vModel__\":\"asset_ownership\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"asset_ownership\",\"placeholder\":\"请选择\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单位\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemec96d9\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"单位\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347663137,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"measurement_unit\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"measurement_unit\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"controls\":false,\"precision\":2,\"fullName\":\"数量\",\"fullNameI18nCode\":[\"\"],\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"\",\"__config__\":{\"formId\":\"formItem21ecc7\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"数量\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347687893,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"min\":0,\"__vModel__\":\"quantity\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"quantity\",\"placeholder\":\"请输入\",\"addonBefore\":\"\"},{\"clearable\":true,\"format\":\"yyyy-MM-dd\",\"fullName\":\"购置日期\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347731278,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItem375d5b\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"购置日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"purchase_date\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"purchase_date\",\"placeholder\":\"请选择\"},{\"clearable\":true,\"format\":\"yyyy-MM-dd\",\"fullName\":\"启用日期\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347763029,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItem99411c\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"启用日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"commissioning_date\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"commissioning_date\",\"placeholder\":\"请选择\"},{\"controls\":false,\"precision\":2,\"fullName\":\"预计使用年限\",\"fullNameI18nCode\":[\"\"],\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"月\",\"__config__\":{\"formId\":\"formItembba5e3\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"预计使用年限\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347785655,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"min\":0,\"__vModel__\":\"expected_life\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"expected_life\",\"placeholder\":\"请输入\",\"addonBefore\":\"\"},{\"popupType\":\"dialog\",\"hasPage\":false,\"filterable\":false,\"clearable\":true,\"modelId\":\"817082533433836293\",\"fullName\":\"供应商\",\"pageSize\":20,\"columnOptions\":[],\"fullNameI18nCode\":[\"\"],\"relationField\":\"company_name\",\"queryType\":0,\"__config__\":{\"formId\":\"formItem218e23\",\"yunzhupaasKey\":\"relationForm\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":\"\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"供应商\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347854600,\"layout\":\"colFormItem\",\"transferList\":[],\"tagIcon\":\"icon-ym icon-ym-generator-menu\",\"tag\":\"YunzhupaasRelationForm\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"extraOptions\":[],\"popupTitle\":\"选择数据\",\"__vModel__\":\"supplier_id\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"supplier_id\",\"placeholder\":\"请选择\",\"popupWidth\":\"1000px\",\"propsValue\":\"company_id\"},{\"clearable\":true,\"maxlength\":255,\"fullName\":\"备注\",\"fullNameI18nCode\":[\"\"],\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"showCount\":false,\"__config__\":{\"formId\":\"formItema2c991\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347940332,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"remark\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"remark\",\"placeholder\":\"请输入\"}],\"pageSize\":20,\"defaultSortConfig\":[],\"type\":1,\"columnBtnsList\":[{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-edit\",\"label\":\"编辑\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"edit\",\"labelI18nCode\":\"common.editText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"删除\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"remove\",\"labelI18nCode\":\"common.delText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-generator-menu\",\"label\":\"详情\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"detail\",\"labelI18nCode\":\"common.detailText\"}],\"tabConfig\":{\"hasAllTab\":true,\"relationField\":\"\",\"on\":false},\"hasSuperQuery\":false,\"defaultColumnList\":[{\"yunzhupaasKey\":\"billRule\",\"resizable\":true,\"fullName\":\"资产编码\",\"fullNameI18nCode\":[\"\"],\"label\":\"资产编码\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItemec5a15\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"assetCode\",\"className\":[],\"label\":\"资产编码\",\"trigger\":\"change\",\"ruleConfig\":{\"startNumber\":\"\",\"dateFormat\":\"YYYY\",\"randomDigit\":16,\"prefixList\":[],\"randomType\":1,\"suffixList\":[],\"type\":1},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777345780019,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"资产编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":12},\"readonly\":true,\"prop\":\"asset_code\",\"__vModel__\":\"asset_code\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"asset_code\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem120e88\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"defaultValue\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"资产名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777345895532,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":false,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"asset_name\",\"__vModel__\":\"asset_name\",\"checked\":true,\"disabled\":false,\"id\":\"asset_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"资产名称\",\"label\":\"资产名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"资产类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"资产类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"10\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777346352365,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItema4f72a\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"assetType\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"资产类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"asset_type\",\"__vModel__\":\"asset_type\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"asset_type\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"资产分类\",\"fullNameI18nCode\":[\"\"],\"label\":\"资产分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"40\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777347095610,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem03ef8d\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"assetCategory\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"资产分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"asset_category\",\"__vModel__\":\"asset_category\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"asset_category\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"资产状态\",\"fullNameI18nCode\":[\"\"],\"label\":\"资产状态\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"InUse\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777347177897,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemc6c516\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"资产状态\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"asset_status\",\"options\":[{\"fullName\":\"在用\",\"id\":\"InUse\"},{\"fullName\":\"闲置\",\"id\":\"Idle\"},{\"fullName\":\"故障\",\"id\":\"Fault\"},{\"fullName\":\"维修中\",\"id\":\"FIX\"},{\"fullName\":\"借用中\",\"id\":\"OnLoan\"},{\"fullName\":\"已报废\",\"id\":\"Scrapped\"},{\"fullName\":\"已处置\",\"id\":\"Disposed\"}],\"__vModel__\":\"asset_status\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"asset_status\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"cascader\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"资产位置\",\"fullNameI18nCode\":[\"\"],\"label\":\"资产位置\",\"sortable\":false,\"align\":\"left\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347474179,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItem2ea454\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"assetLocation\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"资产位置\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"asset_location\",\"__vModel__\":\"asset_location\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"asset_location\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"organizeSelect\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"使用组织\",\"fullNameI18nCode\":[\"\"],\"label\":\"使用组织\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItem60e2d0\",\"yunzhupaasKey\":\"organizeSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"使用组织\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347508873,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasOrganizeSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"current_org_id\",\"__vModel__\":\"current_org_id\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"current_org_id\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"ableRelationIds\":[],\"yunzhupaasKey\":\"userSelect\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"__config__\":{\"formId\":\"formItem8d2078\",\"yunzhupaasKey\":\"userSelect\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"保管用户\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347525827,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-user\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasUserSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"current_user_id\",\"__vModel__\":\"current_user_id\",\"checked\":true,\"selectType\":\"all\",\"disabled\":false,\"id\":\"current_user_id\",\"placeholder\":\"请选择\",\"clearable\":true,\"resizable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"保管用户\",\"label\":\"保管用户\",\"sortable\":false,\"relationField\":\"\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"资产权属\",\"fullNameI18nCode\":[\"\"],\"label\":\"资产权属\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"Owned\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_asset\",\"renderKey\":1777347571406,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem4eae10\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"资产权属\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"asset_ownership\",\"options\":[{\"fullName\":\"自有\",\"id\":\"Owned\"},{\"fullName\":\"租赁\",\"id\":\"Leased\"},{\"fullName\":\"融资租赁\",\"id\":\"FinLeased\"},{\"fullName\":\"借用\",\"id\":\"Borrowed\"},{\"fullName\":\"托管\",\"id\":\"Trusteeship\"}],\"__vModel__\":\"asset_ownership\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"asset_ownership\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemec96d9\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"单位\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347663137,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"measurement_unit\",\"__vModel__\":\"measurement_unit\",\"checked\":true,\"disabled\":false,\"id\":\"measurement_unit\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"单位\",\"label\":\"单位\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":2,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItem21ecc7\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"数量\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347687893,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"min\":0,\"prop\":\"quantity\",\"__vModel__\":\"quantity\",\"checked\":true,\"disabled\":false,\"id\":\"quantity\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"resizable\":true,\"fullName\":\"数量\",\"label\":\"数量\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"datePicker\",\"clearable\":true,\"resizable\":true,\"format\":\"yyyy-MM-dd\",\"fullName\":\"购置日期\",\"fullNameI18nCode\":[\"\"],\"label\":\"购置日期\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347731278,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItem375d5b\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"购置日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"purchase_date\",\"__vModel__\":\"purchase_date\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"purchase_date\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"datePicker\",\"clearable\":true,\"resizable\":true,\"format\":\"yyyy-MM-dd\",\"fullName\":\"启用日期\",\"fullNameI18nCode\":[\"\"],\"label\":\"启用日期\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347763029,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItem99411c\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"启用日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"commissioning_date\",\"__vModel__\":\"commissioning_date\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"commissioning_date\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":2,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItembba5e3\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"预计使用年限\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347785655,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"min\":0,\"prop\":\"expected_life\",\"__vModel__\":\"expected_life\",\"checked\":true,\"disabled\":false,\"id\":\"expected_life\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"resizable\":true,\"fullName\":\"预计使用年限\",\"label\":\"预计使用年限\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"月\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"popupType\":\"dialog\",\"yunzhupaasKey\":\"relationForm\",\"hasPage\":false,\"modelId\":\"817082533433836293\",\"pageSize\":20,\"columnOptions\":[],\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"__config__\":{\"formId\":\"formItem218e23\",\"yunzhupaasKey\":\"relationForm\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":\"\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"供应商\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347854600,\"layout\":\"colFormItem\",\"transferList\":[],\"tagIcon\":\"icon-ym icon-ym-generator-menu\",\"tag\":\"YunzhupaasRelationForm\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"supplier_id\",\"__vModel__\":\"supplier_id\",\"checked\":true,\"disabled\":false,\"id\":\"supplier_id\",\"placeholder\":\"请选择\",\"popupWidth\":\"1000px\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"fullName\":\"供应商\",\"label\":\"供应商\",\"sortable\":false,\"relationField\":\"company_name\",\"queryType\":0,\"extraOptions\":[],\"popupTitle\":\"选择数据\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"labelI18nCode\":\"\",\"propsValue\":\"company_id\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"maxlength\":255,\"fullName\":\"备注\",\"fullNameI18nCode\":[\"\"],\"label\":\"备注\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"showCount\":false,\"__config__\":{\"formId\":\"formItema2c991\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_asset\",\"renderKey\":1777347940332,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"remark\",\"__vModel__\":\"remark\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"remark\",\"placeholder\":\"请输入\",\"labelI18nCode\":\"\"}],\"showOverflow\":true,\"useFormPermission\":false,\"customBtnsList\":[],\"useBtnPermission\":false}"); return sb.toString(); + } + /** 表列表 */ + public static final String getTableList(){ + StringBuilder sb = new StringBuilder(); + sb.append("[{\"relationTable\":\"\",\"tableField\":\"\",\"typeId\":\"1\",\"fields\":[{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"asset_id\",\"fieldName\":\"资产ID\",\"identity\":0,\"primaryKey\":1},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"asset_code\",\"fieldName\":\"资产编码\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"100\",\"dataType\":\"varchar\",\"field\":\"asset_name\",\"fieldName\":\"资产名称\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"asset_type\",\"fieldName\":\"资产类型。关联字典:assetType\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"asset_category\",\"fieldName\":\"资产分类。关联字典:assetCategory\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"10\",\"dataType\":\"varchar\",\"field\":\"asset_status\",\"fieldName\":\"资产状态。枚举值:InUse=在用,Idle=闲置,Fault= 故障, FIX=维修中, OnLoan=借用中, Scrapped=已报废, Disposed=已处置。\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"asset_location\",\"fieldName\":\"资产位置。关联字典:assetLocation\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"current_org_id\",\"fieldName\":\"当前使用组织。关联表:base_organize\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"current_user_id\",\"fieldName\":\"当前保管用户。关联表:base_user\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"10\",\"dataType\":\"varchar\",\"field\":\"asset_ownership\",\"fieldName\":\"资产权属。枚举值:Owned=自有,Leased=租赁, FinLeased=融资租赁, Borrowed=借用, Trusteeship=托管\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"255\",\"dataType\":\"varchar\",\"field\":\"measurement_unit\",\"fieldName\":\"单位\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"10,2\",\"dataType\":\"decimal\",\"field\":\"quantity\",\"fieldName\":\"数量\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"purchase_date\",\"fieldName\":\"购置日期\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"commissioning_date\",\"fieldName\":\"启用日期。用于折旧计算。\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"10,2\",\"dataType\":\"decimal\",\"field\":\"expected_life\",\"fieldName\":\"预计使用年限(月)。用于折旧计算。\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"supplier_id\",\"fieldName\":\"供应商ID。关联表:mdm_supplier\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"500\",\"dataType\":\"varchar\",\"field\":\"remark\",\"fieldName\":\"备注\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"create_by\",\"fieldName\":\"创建人\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"create_time\",\"fieldName\":\"创建时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"update_by\",\"fieldName\":\"更新人ID\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"update_time\",\"fieldName\":\"更新时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_tenant_id\",\"fieldName\":\"租户id\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_flow_id\",\"fieldName\":\"流程id\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_flow_task_id\",\"fieldName\":\"流程任务主键\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":null,\"dataType\":\"int\",\"field\":\"f_delete_mark\",\"fieldName\":\"删除标志\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"f_delete_time\",\"fieldName\":\"删除时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_delete_user_id\",\"fieldName\":\"删除用户\",\"identity\":0,\"primaryKey\":0}],\"relationField\":\"\",\"table\":\"mdm_asset\",\"tableName\":\"资产信息\"}]"); return sb.toString(); + } + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/asset/AssetExcelErrorVO.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/asset/AssetExcelErrorVO.java new file mode 100644 index 0000000..9b8d712 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/asset/AssetExcelErrorVO.java @@ -0,0 +1,22 @@ + + +package com.yunzhupaas.mdm.model.asset; + +import lombok.Data; +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.alibaba.fastjson.annotation.JSONField; +/** + * + * 资产信息 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-28 + */ +@Data +public class AssetExcelErrorVO extends AssetExcelVO{ + + @Excel(name = "异常原因",orderNum = "-999") + @JSONField(name = "errorsInfo") + private String errorsInfo; +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/asset/AssetExcelVO.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/asset/AssetExcelVO.java new file mode 100644 index 0000000..a6320fa --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/asset/AssetExcelVO.java @@ -0,0 +1,95 @@ +package com.yunzhupaas.mdm.model.asset; + +import lombok.Data; +import java.sql.Time; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; +import cn.afterturn.easypoi.excel.annotation.Excel; +import cn.afterturn.easypoi.excel.annotation.ExcelEntity; +import cn.afterturn.easypoi.excel.annotation.ExcelCollection; +import java.math.BigDecimal; +import java.util.List; +/** + * + * 资产信息 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-28 + */ +@Data +public class AssetExcelVO{ + /** 资产名称 **/ + @JSONField(name = "asset_name") + @Excel(name = "资产名称(asset_name)",orderNum = "1", isImportField = "true" ) + private String asset_name; + + /** 资产类型 **/ + @JSONField(name = "asset_type") + @Excel(name = "资产类型(asset_type)",orderNum = "1", isImportField = "true" ) + private String asset_type; + + /** 资产分类 **/ + @JSONField(name = "asset_category") + @Excel(name = "资产分类(asset_category)",orderNum = "1", isImportField = "true" ) + private String asset_category; + + /** 资产状态 **/ + @JSONField(name = "asset_status") + @Excel(name = "资产状态(asset_status)",orderNum = "1", isImportField = "true" ) + private String asset_status; + + /** 资产权属 **/ + @JSONField(name = "asset_ownership") + @Excel(name = "资产权属(asset_ownership)",orderNum = "1", isImportField = "true" ) + private String asset_ownership; + + /** 资产位置 **/ + @JSONField(name = "asset_location") + @Excel(name = "资产位置(asset_location)",orderNum = "1", isImportField = "true" ) + private String asset_location; + + /** 使用组织 **/ + @JSONField(name = "current_org_id") + @Excel(name = "使用组织(current_org_id)",orderNum = "1", isImportField = "true" ) + private String current_org_id; + + /** 单位 **/ + @JSONField(name = "measurement_unit") + @Excel(name = "单位(measurement_unit)",orderNum = "1", isImportField = "true" ) + private String measurement_unit; + + /** 启用日期 **/ + @JSONField(name = "commissioning_date") + @Excel(name = "启用日期(commissioning_date)",orderNum = "1", isImportField = "true" ) + private String commissioning_date; + + /** 购置日期 **/ + @JSONField(name = "purchase_date") + @Excel(name = "购置日期(purchase_date)",orderNum = "1", isImportField = "true" ) + private String purchase_date; + + /** 备注 **/ + @JSONField(name = "remark") + @Excel(name = "备注(remark)",orderNum = "1", isImportField = "true" ) + private String remark; + + /** 预计使用年限 **/ + @JSONField(name = "expected_life") + @Excel(name = "预计使用年限(expected_life)",orderNum = "1", isImportField = "true" ) + private String expected_life; + + /** 数量 **/ + @JSONField(name = "quantity") + @Excel(name = "数量(quantity)",orderNum = "1", isImportField = "true" ) + private String quantity; + + /** 保管用户 **/ + @JSONField(name = "current_user_id") + @Excel(name = "保管用户(current_user_id)",orderNum = "1", isImportField = "true" ) + private String current_user_id; + + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/asset/AssetForm.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/asset/AssetForm.java new file mode 100644 index 0000000..05c05dd --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/asset/AssetForm.java @@ -0,0 +1,107 @@ +package com.yunzhupaas.mdm.model.asset; + +import lombok.Data; +import java.util.*; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * 资产信息 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-28 + */ +@Data +@Schema(description = "表单参数") +public class AssetForm { + /** 主键 */ + @Schema(description = "主键") + @JSONField(name = "asset_id") + private String assetId; + + + /** 资产编码 **/ + @Schema(description = "资产编码") + @JsonProperty("asset_code") + @JSONField(name = "asset_code") + private String assetCode; + /** 资产名称 **/ + @Schema(description = "资产名称") + @JsonProperty("asset_name") + @JSONField(name = "asset_name") + private String assetName; + /** 资产类型 **/ + @Schema(description = "资产类型") + @JsonProperty("asset_type") + @JSONField(name = "asset_type") + private Object assetType; + /** 资产分类 **/ + @Schema(description = "资产分类") + @JsonProperty("asset_category") + @JSONField(name = "asset_category") + private Object assetCategory; + /** 资产状态 **/ + @Schema(description = "资产状态") + @JsonProperty("asset_status") + @JSONField(name = "asset_status") + private Object assetStatus; + /** 资产位置 **/ + @Schema(description = "资产位置") + @JsonProperty("asset_location") + @JSONField(name = "asset_location") + private Object assetLocation; + /** 使用组织 **/ + @Schema(description = "使用组织") + @JsonProperty("current_org_id") + @JSONField(name = "current_org_id") + private Object currentOrgId; + /** 保管用户 **/ + @Schema(description = "保管用户") + @JsonProperty("current_user_id") + @JSONField(name = "current_user_id") + private Object currentUserId; + /** 资产权属 **/ + @Schema(description = "资产权属") + @JsonProperty("asset_ownership") + @JSONField(name = "asset_ownership") + private Object assetOwnership; + /** 单位 **/ + @Schema(description = "单位") + @JsonProperty("measurement_unit") + @JSONField(name = "measurement_unit") + private String measurementUnit; + /** 数量 **/ + @Schema(description = "数量") + @JsonProperty("quantity") + @JSONField(name = "quantity") + private BigDecimal quantity; + /** 购置日期 **/ + @Schema(description = "购置日期") + @JsonProperty("purchase_date") + @JSONField(name = "purchase_date") + private String purchaseDate; + /** 启用日期 **/ + @Schema(description = "启用日期") + @JsonProperty("commissioning_date") + @JSONField(name = "commissioning_date") + private String commissioningDate; + /** 预计使用年限 **/ + @Schema(description = "预计使用年限") + @JsonProperty("expected_life") + @JSONField(name = "expected_life") + private BigDecimal expectedLife; + /** 供应商 **/ + @Schema(description = "供应商") + @JsonProperty("supplier_id") + @JSONField(name = "supplier_id") + private String supplierId; + /** 备注 **/ + @Schema(description = "备注") + @JsonProperty("remark") + @JSONField(name = "remark") + private String remark; + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/asset/AssetPagination.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/asset/AssetPagination.java new file mode 100644 index 0000000..2ae16ee --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/asset/AssetPagination.java @@ -0,0 +1,75 @@ +package com.yunzhupaas.mdm.model.asset; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import com.yunzhupaas.base.Pagination; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.List; + +/** + * + * 资产信息 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-28 + */ +@Data +@Schema(description = "列表查询参数") +public class AssetPagination extends Pagination { + /** 关键词搜索 */ + @Schema(description = "关键词搜索") + private String yunzhupaasKeyword; + /** 查询key */ + @Schema(description = "查询key") + private String[] selectKey; + /** 选中数据数组id */ + @Schema(description = "选中数据数组id") + private Object[] selectIds; + /** json */ + @Schema(description = "json") + private String json; + /** 数据类型 0-当前页,1-全部数据 */ + @Schema(description = "数据类型 0-当前页,1-全部数据") + private String dataType; + /** 高级查询 */ + @Schema(description = "高级查询") + private String superQueryJson; + /** 功能id */ + @Schema(description = "功能id") + private String moduleId; + /** 菜单id */ + @Schema(description = "菜单id") + private String menuId; + /** 资产编码 */ + @Schema(description = "资产编码") + @JsonProperty("asset_code") + @JSONField(name = "assetCode") + private Object assetCode; + /** 资产名称 */ + @Schema(description = "资产名称") + @JsonProperty("asset_name") + @JSONField(name = "assetName") + private Object assetName; + /** 资产状态 */ + @Schema(description = "资产状态") + @JsonProperty("asset_status") + @JSONField(name = "assetStatus") + private Object assetStatus; + /** 购置日期 */ + @Schema(description = "购置日期") + @JsonProperty("purchase_date") + @JSONField(name = "purchaseDate") + private Object purchaseDate; + /** 启用日期 */ + @Schema(description = "启用日期") + @JsonProperty("commissioning_date") + @JSONField(name = "commissioningDate") + private Object commissioningDate; + /** 标签面板字段 */ + @Schema(description = "标签面板字段") + @JsonProperty("asset_type") + @JSONField(name = "assetType") + private Object assetType; +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/company/CompanyConstant.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/company/CompanyConstant.java new file mode 100644 index 0000000..f76f27f --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/company/CompanyConstant.java @@ -0,0 +1,46 @@ +package com.yunzhupaas.mdm.model.company; + +import com.yunzhupaas.util.JsonUtil; +import java.util.*; + +/** + * 企业信息配置json + * + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-24 + */ +public class CompanyConstant{ + /** 数据库链接 */ + public static final String DBLINKID = "0"; + /** 表别名 map */ + public static final Map TABLERENAMES = JsonUtil.getJsonToBean("{\"mdm_company_bank\":\"mdmCompanyBank\",\"mdm_company_invoice\":\"companyInvoice\",\"mdm_company\":\"company\"}",Map.class); + /** 子表model map */ + public static final Map TABLEFIELDKEY = JsonUtil.getJsonToBean("{\"tableField46dc53\":\"mdm_company_invoice\",\"tableFieldad9d92\":\"mdm_company_bank\"}",Map.class); + /** 整个表单配置json */ + public static final String getFormData(){ + StringBuilder sb = new StringBuilder(); +sb.append("{\"popupType\":\"drawer\",\"labelWidth\":100,\"classNames\":[],\"className\":[],\"fullScreenWidth\":\"100%\",\"hasConfirmAndAddBtn\":true,\"cancelButtonTextI18nCode\":\"common.cancelText\",\"businessKeyTip\":\"数据已存在,请勿重复提交!\",\"labelPosition\":\"right\",\"printId\":\"\",\"labelSuffix\":\"\",\"customBtns\":[],\"disabled\":false,\"formModel\":\"dataForm\",\"cancelButtonText\":\"取消\",\"confirmButtonText\":\"确定\",\"hasCancelBtn\":true,\"primaryKeyPolicy\":1,\"hasPrintBtn\":false,\"concurrencyLock\":false,\"classJson\":\"\",\"drawerWidth\":\"600px\",\"confirmButtonTextI18nCode\":\"common.okText\",\"printButtonText\":\"打印\",\"businessKeyList\":[],\"formRef\":\"formRef\",\"gutter\":15,\"logicalDelete\":false,\"size\":\"middle\",\"formRules\":\"rules\",\"generalWidth\":\"1000px\",\"colon\":false,\"hasConfirmBtn\":true,\"useBusinessKey\":false,\"formStyle\":\"\",\"printButtonTextI18nCode\":\"common.printText\",\"fields\":[{\"__config__\":{\"formId\":\"formItem7a91b8\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"companyCode\",\"className\":[],\"label\":\"企业编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776916036468,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"企业编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":8},\"readonly\":true,\"__vModel__\":\"company_code\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"系统自动生成\"},{\"clearable\":true,\"maxlength\":200,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem478e5c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"企业名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506482470,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"company_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入企业名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem84e51c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"简称/昵称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506482631,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"short_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入简称/昵称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"optionType\":\"default\",\"__config__\":{\"yunzhupaasKey\":\"radio\",\"defaultValue\":\"ORG\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506487223,\"tagIcon\":\"icon-ym icon-ym-generator-radio\",\"tag\":\"YunzhupaasRadio\",\"formId\":\"formItemb3f6cd\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"size\":\"default\",\"buttonStyle\":\"solid\",\"options\":[{\"fullName\":\"企业\",\"id\":\"ORG\"},{\"fullName\":\"个人\",\"id\":\"IND\"}],\"__vModel__\":\"entity_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"direction\":\"horizontal\"},{\"clearable\":true,\"maxlength\":100,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem10350c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"社会信用代码\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506494880,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"credit_code\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入社会信用代码\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"formId\":\"formItemfc6848\",\"yunzhupaasKey\":\"organizeSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"归属组织\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776912270086,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasOrganizeSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"ableIds\":[],\"multiple\":false,\"__vModel__\":\"org_id\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"formId\":\"formItemcc9deb\",\"yunzhupaasKey\":\"areaSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属地区\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507118587,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-Provinces\",\"tag\":\"YunzhupaasAreaSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"level\":2,\"multiple\":false,\"__vModel__\":\"province_id\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择所属地区\"},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503586,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem05d07f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"multiple\":false,\"__vModel__\":\"tax_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择纳税人类别\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"}},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503806,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem66e88f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"enterpriseScale\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业规模\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"multiple\":false,\"__vModel__\":\"enterprise_scale\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择企业规模\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"}},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506504118,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItema76b83\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"9b542177a477488994ce09fff3c93901\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"multiple\":false,\"__vModel__\":\"enterprise_nature\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择企业类型\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"}},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506507062,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem6bd8a7\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"d59a3cf65f9847dbb08be449e3feae16\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"行业代码\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"multiple\":false,\"__vModel__\":\"industry_code\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择行业代码\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"}},{\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506509988,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItembab00e\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"成立日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"format\":\"yyyy-MM-dd\",\"__vModel__\":\"registration_date\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择成立日期\"},{\"controls\":false,\"max\":999999,\"precision\":4,\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"万元\",\"__config__\":{\"formId\":\"formItem3134b1\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"注册资本\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506514957,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"registered_capital\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"placeholder\":\"请输入注册资本\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem4f2d0b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"法定代表人\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524679,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"legal_representative\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入法定代表人\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":11,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem97bd9d\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"联系电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524966,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^1[3456789]\\\\d{9}$|^0\\\\d{2,3}-?\\\\d{7,8}$/\",\"message\":\"请输入正确的电话号码\",\"messageI18nCode\":\"sys.validate.telephone\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"phone\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入联系电话\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":100,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem439010\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"邮箱\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506525554,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^[a-z0-9]+([._\\\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/\",\"message\":\"请输入正确的邮箱\",\"messageI18nCode\":\"sys.validate.email\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"email\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":100,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem7fa940\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"网站\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528130,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"website\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入网站\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":200,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5b2d2b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528353,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"address\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入地址\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"autoSize\":{\"minRows\":3,\"maxRows\":3},\"clearable\":true,\"showCount\":false,\"__config__\":{\"formId\":\"formItem8cbf03\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"经营范围\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534652,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maxlength\":200,\"__vModel__\":\"business_scope\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入经营范围\"},{\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"clearable\":true,\"showCount\":false,\"__config__\":{\"formId\":\"formItem9f5e00\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534863,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"remark\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入备注\"},{\"__config__\":{\"formId\":\"formItemfe79ef\",\"yunzhupaasKey\":\"tab\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dragDisabled\":false,\"active\":\"2\",\"className\":[],\"label\":\"标签面板\",\"showLabel\":false,\"renderKey\":1774507317203,\"tableName\":\"mdm_company\",\"layout\":\"rowFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-label\",\"children\":[{\"__config__\":{\"formId\":\"formItemc68c47\",\"yunzhupaasKey\":\"tabItem\",\"children\":[{\"showSummary\":false,\"__config__\":{\"formId\":\"formItemad9d92\",\"yunzhupaasKey\":\"table\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"设计子表\",\"showLabel\":false,\"tableName\":\"mdm_company_bank\",\"renderKey\":1774507573802,\"layout\":\"rowFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-table\",\"children\":[{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem3756b9\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507591361,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入开户行\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemf42745\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"账户名\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507611465,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_account_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入账户名\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem8abffe\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507627371,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_account_number\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入银行账号\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemb870cb\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行城市\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507627772,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_province\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入开户行城市\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":200,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemf22092\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507628423,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"remark\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入备注\",\"prefixIcon\":\"\",\"addonBefore\":\"\"}],\"showTitle\":false,\"complexHeaderList\":[],\"tag\":\"YunzhupaasInputTable\",\"componentName\":\"tablead9d92\",\"tableAlign\":\"left\",\"span\":24},\"defaultValue\":[],\"footerBtnsList\":[{\"btnIcon\":\"icon-ym icon-ym-btn-add\",\"show\":true,\"label\":\"添加\",\"btnType\":\"primary\",\"value\":\"add\",\"labelI18nCode\":\"common.add1Text\"},{\"btnIcon\":\"icon-ym icon-ym-btn-clearn\",\"showConfirm\":true,\"show\":true,\"label\":\"批量删除\",\"btnType\":\"danger\",\"value\":\"batchRemove\",\"labelI18nCode\":\"common.batchDelText\"}],\"defaultExpandAll\":true,\"__vModel__\":\"tableFieldad9d92\",\"layoutType\":\"table\",\"disabled\":false,\"columnBtnsList\":[{\"btnIcon\":\"icon-ym icon-ym-btn-edit\",\"show\":true,\"label\":\"复制\",\"btnType\":\"primary\",\"value\":\"copy\",\"labelI18nCode\":\"common.copyText\"},{\"btnIcon\":\"icon-ym icon-ym-btn-clearn\",\"showConfirm\":true,\"show\":true,\"label\":\"删除\",\"btnType\":\"danger\",\"value\":\"remove\",\"labelI18nCode\":\"common.delText\"}],\"summaryField\":[]}],\"renderKey\":1774507317203},\"name\":\"2\",\"title\":\"银行卡信息\"},{\"__config__\":{\"formId\":\"formItem9787c7\",\"yunzhupaasKey\":\"tabItem\",\"children\":[{\"showSummary\":false,\"__config__\":{\"formId\":\"formItem46dc53\",\"yunzhupaasKey\":\"table\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"设计子表\",\"showLabel\":false,\"tableName\":\"mdm_company_invoice\",\"renderKey\":1774507347680,\"layout\":\"rowFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-table\",\"children\":[{\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"billRule\",\"parentVModel\":\"tableField46dc53\",\"dragDisabled\":false,\"rule\":\"InvoiceTitleCode\",\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754320599,\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"isSubTable\":true,\"ruleName\":\"发票抬头编码\",\"tag\":\"YunzhupaasInput\",\"formId\":\"formItem57f1d4\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"发票抬头编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"layout\":\"colFormItem\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"title_code\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"系统自动生成\"},{\"clearable\":true,\"maxlength\":10,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItema8b1f4\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"发票抬头名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507383593,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"title_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入联系人\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1963f0\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"纳税人识别号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507440273,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"credit_code\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入联系人职务\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"parentVModel\":\"tableField46dc53\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754396382,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemb3492f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"multiple\":false,\"__vModel__\":\"tax_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择纳税人类别\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"}},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItema9aaf2\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507448061,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"address\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入联系人邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItemf8b766\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754421983,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"phone\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入联系人邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1730ca\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户银行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754433217,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入联系人邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1089bb\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账户\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754444839,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_account\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入联系人邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"formId\":\"formItem4743e7\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否默认\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754525239,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"activeValue\":1,\"inactiveValue\":0,\"__vModel__\":\"is_defalut\",\"inactiveTxt\":\"关\",\"disabled\":false,\"activeTxt\":\"开\"},{\"__config__\":{\"formId\":\"formItema2b4cf\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否有效\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754540042,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"activeValue\":1,\"inactiveValue\":0,\"__vModel__\":\"is_valid\",\"inactiveTxt\":\"关\",\"disabled\":false,\"activeTxt\":\"开\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem560a27\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507449005,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"remark\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入备注\",\"prefixIcon\":\"\",\"addonBefore\":\"\"}],\"showTitle\":false,\"complexHeaderList\":[],\"tag\":\"YunzhupaasInputTable\",\"componentName\":\"table46dc53\",\"tableAlign\":\"left\",\"span\":24},\"defaultValue\":[],\"footerBtnsList\":[{\"btnIcon\":\"icon-ym icon-ym-btn-add\",\"show\":true,\"label\":\"添加\",\"btnType\":\"primary\",\"value\":\"add\",\"labelI18nCode\":\"common.add1Text\"},{\"btnIcon\":\"icon-ym icon-ym-btn-clearn\",\"showConfirm\":true,\"show\":true,\"label\":\"批量删除\",\"btnType\":\"danger\",\"value\":\"batchRemove\",\"labelI18nCode\":\"common.batchDelText\"}],\"defaultExpandAll\":true,\"__vModel__\":\"tableField46dc53\",\"layoutType\":\"table\",\"disabled\":false,\"columnBtnsList\":[{\"btnIcon\":\"icon-ym icon-ym-btn-edit\",\"show\":true,\"label\":\"复制\",\"btnType\":\"primary\",\"value\":\"copy\",\"labelI18nCode\":\"common.copyText\"},{\"btnIcon\":\"icon-ym icon-ym-btn-clearn\",\"showConfirm\":true,\"show\":true,\"label\":\"删除\",\"btnType\":\"danger\",\"value\":\"remove\",\"labelI18nCode\":\"common.delText\"}],\"summaryField\":[]}],\"renderKey\":1774507317203},\"name\":\"1\",\"title\":\"发票抬头\"}],\"tag\":\"ATab\",\"componentName\":\"tabfe79ef\",\"span\":24},\"tabPosition\":\"top\",\"type\":\"\"}],\"detailExtraList\":[],\"span\":24,\"dataLog\":false}"); return sb.toString(); + } + /** 列表字段配置json */ + public static final String getColumnData(){ + StringBuilder sb = new StringBuilder(); + sb.append("{\"showSummary\":false,\"treePropsValue\":\"id\",\"columnOptions\":[{\"__config__\":{\"formId\":\"formItem7a91b8\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"CorporationCode\",\"className\":[],\"label\":\"企业编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776916036468,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"法人单位编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":8},\"readonly\":true,\"__vModel__\":\"company_code\",\"fullName\":\"企业编码\",\"fullNameI18nCode\":[\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"company_code\",\"placeholder\":\"系统自动生成\"},{\"clearable\":true,\"maxlength\":200,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"企业名称\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem478e5c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"企业名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506482470,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"company_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"company_name\",\"placeholder\":\"请输入企业名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"简称/昵称\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem84e51c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"简称/昵称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506482631,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"short_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"short_name\",\"placeholder\":\"请输入简称/昵称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"buttonStyle\":\"solid\",\"fullName\":\"类型\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"optionType\":\"default\",\"__config__\":{\"yunzhupaasKey\":\"radio\",\"defaultValue\":\"ORG\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506487223,\"tagIcon\":\"icon-ym icon-ym-generator-radio\",\"tag\":\"YunzhupaasRadio\",\"formId\":\"formItemb3f6cd\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"size\":\"default\",\"options\":[{\"fullName\":\"企业\",\"id\":\"ORG\"},{\"fullName\":\"个人\",\"id\":\"IND\"}],\"__vModel__\":\"entity_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"entity_type\",\"direction\":\"horizontal\"},{\"clearable\":true,\"maxlength\":100,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"社会信用代码\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem10350c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"社会信用代码\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506494880,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"credit_code\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"credit_code\",\"placeholder\":\"请输入社会信用代码\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"企业范围\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"EXT\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506498092,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem13797c\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业范围\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"options\":[{\"fullName\":\"内部公司\",\"id\":\"INT\"},{\"fullName\":\"客商企业\",\"id\":\"EXT\"}],\"__vModel__\":\"company_scope\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"company_scope\",\"placeholder\":\"请选择企业范围\"},{\"filterable\":false,\"clearable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"归属组织\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"formId\":\"formItemfc6848\",\"yunzhupaasKey\":\"organizeSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"归属组织\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776912270086,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasOrganizeSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"org_id\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"org_id\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"level\":2,\"multiple\":false,\"fullName\":\"所属地区\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"formId\":\"formItemcc9deb\",\"yunzhupaasKey\":\"areaSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属地区\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507118587,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-Provinces\",\"tag\":\"YunzhupaasAreaSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"province_id\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"province_id\",\"placeholder\":\"请选择所属地区\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"纳税人类别\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503586,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem05d07f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_type\",\"placeholder\":\"请选择纳税人类别\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"企业规模\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503806,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem66e88f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"enterpriseScale\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业规模\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"enterprise_scale\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_scale\",\"placeholder\":\"请选择企业规模\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"企业类型\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506504118,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItema76b83\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"9b542177a477488994ce09fff3c93901\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"enterprise_nature\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_nature\",\"placeholder\":\"请选择企业类型\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"行业代码\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506507062,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem6bd8a7\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"d59a3cf65f9847dbb08be449e3feae16\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"行业代码\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"industry_code\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"industry_code\",\"placeholder\":\"请选择行业代码\"},{\"clearable\":true,\"format\":\"yyyy-MM-dd\",\"fullName\":\"成立日期\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506509988,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItembab00e\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"成立日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"registration_date\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"registration_date\",\"placeholder\":\"请选择成立日期\"},{\"controls\":false,\"max\":999999,\"precision\":4,\"fullName\":\"注册资本\",\"fullNameI18nCode\":[\"\"],\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"万元\",\"__config__\":{\"formId\":\"formItem3134b1\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"注册资本\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506514957,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"registered_capital\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"registered_capital\",\"placeholder\":\"请输入注册资本\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"法定代表人\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem4f2d0b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"法定代表人\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524679,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"legal_representative\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"legal_representative\",\"placeholder\":\"请输入法定代表人\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":11,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"联系电话\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem97bd9d\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"联系电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524966,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^1[3456789]\\\\d{9}$|^0\\\\d{2,3}-?\\\\d{7,8}$/\",\"message\":\"请输入正确的电话号码\",\"messageI18nCode\":\"sys.validate.telephone\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"phone\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"phone\",\"placeholder\":\"请输入联系电话\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":100,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"邮箱\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem439010\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"邮箱\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506525554,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^[a-z0-9]+([._\\\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/\",\"message\":\"请输入正确的邮箱\",\"messageI18nCode\":\"sys.validate.email\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"email\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"email\",\"placeholder\":\"请输入邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":100,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"网站\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem7fa940\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"网站\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528130,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"website\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"website\",\"placeholder\":\"请输入网站\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":200,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"地址\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5b2d2b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528353,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"address\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"address\",\"placeholder\":\"请输入地址\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":200,\"fullName\":\"经营范围\",\"fullNameI18nCode\":[\"\"],\"autoSize\":{\"minRows\":3,\"maxRows\":3},\"showCount\":false,\"__config__\":{\"formId\":\"formItem8cbf03\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"经营范围\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534652,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"business_scope\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"business_scope\",\"placeholder\":\"请输入经营范围\"},{\"clearable\":true,\"fullName\":\"备注\",\"fullNameI18nCode\":[\"\"],\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"showCount\":false,\"__config__\":{\"formId\":\"formItem9f5e00\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534863,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"remark\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"remark\",\"placeholder\":\"请输入备注\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-开户行\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem3756b9\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507591361,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldad9d92-bank_name\",\"placeholder\":\"请输入开户行\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-账户名\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemf42745\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"账户名\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507611465,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_account_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldad9d92-bank_account_name\",\"placeholder\":\"请输入账户名\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-银行账号\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem8abffe\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507627371,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_account_number\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldad9d92-bank_account_number\",\"placeholder\":\"请输入银行账号\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-开户行城市\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemb870cb\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行城市\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507627772,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_province\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldad9d92-bank_province\",\"placeholder\":\"请输入开户行城市\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":200,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-备注\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemf22092\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507628423,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"remark\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldad9d92-remark\",\"placeholder\":\"请输入备注\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"billRule\",\"parentVModel\":\"tableField46dc53\",\"dragDisabled\":false,\"rule\":\"InvoiceTitleCode\",\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754320599,\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"isSubTable\":true,\"ruleName\":\"发票抬头编码\",\"tag\":\"YunzhupaasInput\",\"formId\":\"formItem57f1d4\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"发票抬头编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"layout\":\"colFormItem\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"title_code\",\"fullName\":\"设计子表-发票抬头编码\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField46dc53-title_code\",\"placeholder\":\"系统自动生成\"},{\"clearable\":true,\"maxlength\":10,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-发票抬头名称\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItema8b1f4\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"发票抬头名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507383593,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"title_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-title_name\",\"placeholder\":\"请输入联系人\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-纳税人识别号\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1963f0\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"纳税人识别号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507440273,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"credit_code\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-credit_code\",\"placeholder\":\"请输入联系人职务\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"设计子表-纳税人类别\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"parentVModel\":\"tableField46dc53\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754396382,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemb3492f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-tax_type\",\"placeholder\":\"请选择纳税人类别\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-地址\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItema9aaf2\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507448061,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"address\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-address\",\"placeholder\":\"请输入联系人邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-电话\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItemf8b766\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754421983,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"phone\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-phone\",\"placeholder\":\"请输入联系人邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-开户银行\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1730ca\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户银行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754433217,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-bank_name\",\"placeholder\":\"请输入联系人邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-银行账户\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1089bb\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账户\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754444839,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_account\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-bank_account\",\"placeholder\":\"请输入联系人邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"formId\":\"formItem4743e7\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否默认\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754525239,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"activeValue\":1,\"inactiveValue\":0,\"__vModel__\":\"is_defalut\",\"fullName\":\"设计子表-是否默认\",\"inactiveTxt\":\"关\",\"fullNameI18nCode\":[\"\",\"\"],\"disabled\":false,\"activeTxt\":\"开\",\"id\":\"tableField46dc53-is_defalut\"},{\"__config__\":{\"formId\":\"formItema2b4cf\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否有效\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754540042,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"activeValue\":1,\"inactiveValue\":0,\"__vModel__\":\"is_valid\",\"fullName\":\"设计子表-是否有效\",\"inactiveTxt\":\"关\",\"fullNameI18nCode\":[\"\",\"\"],\"disabled\":false,\"activeTxt\":\"开\",\"id\":\"tableField46dc53-is_valid\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-备注\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem560a27\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507449005,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"remark\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-remark\",\"placeholder\":\"请输入备注\",\"prefixIcon\":\"\",\"addonBefore\":\"\"}],\"pageSize\":20,\"type\":1,\"columnBtnsList\":[{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-edit\",\"label\":\"编辑\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"edit\",\"labelI18nCode\":\"common.editText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"删除\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"remove\",\"labelI18nCode\":\"common.delText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-generator-menu\",\"label\":\"详情\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"detail\",\"labelI18nCode\":\"common.detailText\"}],\"treeTitle\":\"左侧标题\",\"defaultColumnList\":[{\"yunzhupaasKey\":\"billRule\",\"resizable\":true,\"fullName\":\"企业编码\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业编码\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItem7a91b8\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"CorporationCode\",\"className\":[],\"label\":\"企业编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776916036468,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"法人单位编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":8},\"readonly\":true,\"prop\":\"company_code\",\"__vModel__\":\"company_code\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"company_code\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem478e5c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"企业名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506482470,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"company_name\",\"__vModel__\":\"company_name\",\"checked\":true,\"disabled\":false,\"id\":\"company_name\",\"placeholder\":\"请输入企业名称\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"企业名称\",\"label\":\"企业名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem84e51c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"简称/昵称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506482631,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"short_name\",\"__vModel__\":\"short_name\",\"checked\":true,\"disabled\":false,\"id\":\"short_name\",\"placeholder\":\"请输入简称/昵称\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"简称/昵称\",\"label\":\"简称/昵称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"radio\",\"resizable\":true,\"buttonStyle\":\"solid\",\"fullName\":\"类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"optionType\":\"default\",\"__config__\":{\"yunzhupaasKey\":\"radio\",\"defaultValue\":\"ORG\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506487223,\"tagIcon\":\"icon-ym icon-ym-generator-radio\",\"tag\":\"YunzhupaasRadio\",\"formId\":\"formItemb3f6cd\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"size\":\"default\",\"prop\":\"entity_type\",\"options\":[{\"fullName\":\"企业\",\"id\":\"ORG\"},{\"fullName\":\"个人\",\"id\":\"IND\"}],\"__vModel__\":\"entity_type\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"entity_type\",\"labelI18nCode\":\"\",\"direction\":\"horizontal\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem10350c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"社会信用代码\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506494880,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"credit_code\",\"__vModel__\":\"credit_code\",\"checked\":true,\"disabled\":false,\"id\":\"credit_code\",\"placeholder\":\"请输入社会信用代码\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":100,\"fullName\":\"社会信用代码\",\"label\":\"社会信用代码\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"企业范围\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业范围\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"EXT\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506498092,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem13797c\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业范围\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"company_scope\",\"options\":[{\"fullName\":\"内部公司\",\"id\":\"INT\"},{\"fullName\":\"客商企业\",\"id\":\"EXT\"}],\"__vModel__\":\"company_scope\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"company_scope\",\"placeholder\":\"请选择企业范围\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"organizeSelect\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"归属组织\",\"fullNameI18nCode\":[\"\"],\"label\":\"归属组织\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItemfc6848\",\"yunzhupaasKey\":\"organizeSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"归属组织\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776912270086,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasOrganizeSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"org_id\",\"__vModel__\":\"org_id\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"org_id\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"areaSelect\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"level\":2,\"multiple\":false,\"fullName\":\"所属地区\",\"fullNameI18nCode\":[\"\"],\"label\":\"所属地区\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItemcc9deb\",\"yunzhupaasKey\":\"areaSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属地区\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507118587,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-Provinces\",\"tag\":\"YunzhupaasAreaSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"province_id\",\"__vModel__\":\"province_id\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"province_id\",\"placeholder\":\"请选择所属地区\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"纳税人类别\",\"fullNameI18nCode\":[\"\"],\"label\":\"纳税人类别\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503586,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem05d07f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"tax_type\",\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_type\",\"placeholder\":\"请选择纳税人类别\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"企业规模\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业规模\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503806,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem66e88f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"enterpriseScale\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业规模\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"enterprise_scale\",\"__vModel__\":\"enterprise_scale\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_scale\",\"placeholder\":\"请选择企业规模\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"企业类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506504118,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItema76b83\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"9b542177a477488994ce09fff3c93901\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"enterprise_nature\",\"__vModel__\":\"enterprise_nature\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_nature\",\"placeholder\":\"请选择企业类型\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"行业代码\",\"fullNameI18nCode\":[\"\"],\"label\":\"行业代码\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506507062,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem6bd8a7\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"d59a3cf65f9847dbb08be449e3feae16\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"行业代码\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"industry_code\",\"__vModel__\":\"industry_code\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"industry_code\",\"placeholder\":\"请选择行业代码\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"datePicker\",\"clearable\":true,\"resizable\":true,\"format\":\"yyyy-MM-dd\",\"fullName\":\"成立日期\",\"fullNameI18nCode\":[\"\"],\"label\":\"成立日期\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506509988,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItembab00e\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"成立日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"registration_date\",\"__vModel__\":\"registration_date\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"registration_date\",\"placeholder\":\"请选择成立日期\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":4,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItem3134b1\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"注册资本\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506514957,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"registered_capital\",\"__vModel__\":\"registered_capital\",\"checked\":true,\"disabled\":false,\"id\":\"registered_capital\",\"placeholder\":\"请输入注册资本\",\"addonBefore\":\"\",\"resizable\":true,\"max\":999999,\"fullName\":\"注册资本\",\"label\":\"注册资本\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"万元\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem4f2d0b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"法定代表人\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524679,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"legal_representative\",\"__vModel__\":\"legal_representative\",\"checked\":true,\"disabled\":false,\"id\":\"legal_representative\",\"placeholder\":\"请输入法定代表人\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"法定代表人\",\"label\":\"法定代表人\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem97bd9d\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"联系电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524966,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^1[3456789]\\\\d{9}$|^0\\\\d{2,3}-?\\\\d{7,8}$/\",\"message\":\"请输入正确的电话号码\",\"messageI18nCode\":\"sys.validate.telephone\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"phone\",\"__vModel__\":\"phone\",\"checked\":true,\"disabled\":false,\"id\":\"phone\",\"placeholder\":\"请输入联系电话\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":11,\"fullName\":\"联系电话\",\"label\":\"联系电话\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem439010\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"邮箱\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506525554,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^[a-z0-9]+([._\\\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/\",\"message\":\"请输入正确的邮箱\",\"messageI18nCode\":\"sys.validate.email\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"email\",\"__vModel__\":\"email\",\"checked\":true,\"disabled\":false,\"id\":\"email\",\"placeholder\":\"请输入邮箱\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":100,\"fullName\":\"邮箱\",\"label\":\"邮箱\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem7fa940\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"网站\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528130,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"website\",\"__vModel__\":\"website\",\"checked\":true,\"disabled\":false,\"id\":\"website\",\"placeholder\":\"请输入网站\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":100,\"fullName\":\"网站\",\"label\":\"网站\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5b2d2b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528353,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"address\",\"__vModel__\":\"address\",\"checked\":true,\"disabled\":false,\"id\":\"address\",\"placeholder\":\"请输入地址\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"地址\",\"label\":\"地址\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"经营范围\",\"fullNameI18nCode\":[\"\"],\"label\":\"经营范围\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":3,\"maxRows\":3},\"showCount\":false,\"__config__\":{\"formId\":\"formItem8cbf03\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"经营范围\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534652,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\""); + sb.append("prop\":\"business_scope\",\"__vModel__\":\"business_scope\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"business_scope\",\"placeholder\":\"请输入经营范围\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"fullName\":\"备注\",\"fullNameI18nCode\":[\"\"],\"label\":\"备注\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"showCount\":false,\"__config__\":{\"formId\":\"formItem9f5e00\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534863,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"remark\",\"__vModel__\":\"remark\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"remark\",\"placeholder\":\"请输入备注\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem3756b9\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507591361,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldad9d92-bank_name\",\"__vModel__\":\"bank_name\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldad9d92-bank_name\",\"placeholder\":\"请输入开户行\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"设计子表-开户行\",\"label\":\"设计子表-开户行\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemf42745\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"账户名\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507611465,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldad9d92-bank_account_name\",\"__vModel__\":\"bank_account_name\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldad9d92-bank_account_name\",\"placeholder\":\"请输入账户名\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"设计子表-账户名\",\"label\":\"设计子表-账户名\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem8abffe\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507627371,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldad9d92-bank_account_number\",\"__vModel__\":\"bank_account_number\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldad9d92-bank_account_number\",\"placeholder\":\"请输入银行账号\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"设计子表-银行账号\",\"label\":\"设计子表-银行账号\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemb870cb\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行城市\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507627772,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldad9d92-bank_province\",\"__vModel__\":\"bank_province\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldad9d92-bank_province\",\"placeholder\":\"请输入开户行城市\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"设计子表-开户行城市\",\"label\":\"设计子表-开户行城市\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemf22092\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507628423,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldad9d92-remark\",\"__vModel__\":\"remark\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldad9d92-remark\",\"placeholder\":\"请输入备注\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"设计子表-备注\",\"label\":\"设计子表-备注\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"billRule\",\"resizable\":true,\"fullName\":\"设计子表-发票抬头编码\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"设计子表-发票抬头编码\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"billRule\",\"parentVModel\":\"tableField46dc53\",\"dragDisabled\":false,\"rule\":\"InvoiceTitleCode\",\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754320599,\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"isSubTable\":true,\"ruleName\":\"发票抬头编码\",\"tag\":\"YunzhupaasInput\",\"formId\":\"formItem57f1d4\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"发票抬头编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"layout\":\"colFormItem\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField46dc53-title_code\",\"__vModel__\":\"title_code\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField46dc53-title_code\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItema8b1f4\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"发票抬头名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507383593,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-title_name\",\"__vModel__\":\"title_name\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-title_name\",\"placeholder\":\"请输入联系人\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":10,\"fullName\":\"设计子表-发票抬头名称\",\"label\":\"设计子表-发票抬头名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1963f0\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"纳税人识别号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507440273,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-credit_code\",\"__vModel__\":\"credit_code\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-credit_code\",\"placeholder\":\"请输入联系人职务\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"设计子表-纳税人识别号\",\"label\":\"设计子表-纳税人识别号\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"设计子表-纳税人类别\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"设计子表-纳税人类别\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"parentVModel\":\"tableField46dc53\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754396382,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemb3492f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"tableField46dc53-tax_type\",\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-tax_type\",\"placeholder\":\"请选择纳税人类别\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItema9aaf2\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507448061,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-address\",\"__vModel__\":\"address\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-address\",\"placeholder\":\"请输入联系人邮箱\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"设计子表-地址\",\"label\":\"设计子表-地址\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItemf8b766\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754421983,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-phone\",\"__vModel__\":\"phone\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-phone\",\"placeholder\":\"请输入联系人邮箱\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"设计子表-电话\",\"label\":\"设计子表-电话\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1730ca\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户银行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754433217,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-bank_name\",\"__vModel__\":\"bank_name\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-bank_name\",\"placeholder\":\"请输入联系人邮箱\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"设计子表-开户银行\",\"label\":\"设计子表-开户银行\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1089bb\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账户\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754444839,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-bank_account\",\"__vModel__\":\"bank_account\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-bank_account\",\"placeholder\":\"请输入联系人邮箱\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"设计子表-银行账户\",\"label\":\"设计子表-银行账户\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"switch\",\"resizable\":true,\"activeValue\":1,\"inactiveValue\":0,\"fullName\":\"设计子表-是否默认\",\"inactiveTxt\":\"关\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"设计子表-是否默认\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItem4743e7\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否默认\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754525239,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"tableField46dc53-is_defalut\",\"__vModel__\":\"is_defalut\",\"checked\":false,\"fixed\":\"none\",\"disabled\":false,\"activeTxt\":\"开\",\"id\":\"tableField46dc53-is_defalut\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"switch\",\"resizable\":true,\"activeValue\":1,\"inactiveValue\":0,\"fullName\":\"设计子表-是否有效\",\"inactiveTxt\":\"关\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"设计子表-是否有效\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItema2b4cf\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否有效\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754540042,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"tableField46dc53-is_valid\",\"__vModel__\":\"is_valid\",\"checked\":false,\"fixed\":\"none\",\"disabled\":false,\"activeTxt\":\"开\",\"id\":\"tableField46dc53-is_valid\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem560a27\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507449005,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-remark\",\"__vModel__\":\"remark\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-remark\",\"placeholder\":\"请输入备注\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"设计子表-备注\",\"label\":\"设计子表-备注\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"}],\"treeRelationFieldAbleIds\":[],\"treeSyncInterfaceName\":\"\",\"treeSyncTemplateJson\":[],\"treeRelation\":\"\",\"defaultSortConfig\":[],\"tabConfig\":{\"hasAllTab\":true,\"relationField\":\"\",\"on\":false},\"hasSuperQuery\":true,\"treePropsLabel\":\"fullName\",\"groupField\":\"\",\"printIds\":[],\"uploaderTemplateJson\":{\"selectKey\":[\"company_name\",\"credit_code\",\"org_id\",\"company_code\",\"short_name\",\"entity_type\",\"company_scope\",\"tax_type\",\"enterprise_scale\",\"enterprise_nature\",\"industry_code\",\"registration_date\",\"registered_capital\",\"legal_representative\",\"phone\",\"email\",\"website\",\"address\",\"province_id\",\"business_scope\",\"remark\",\"tableFieldad9d92-bank_name\",\"tableFieldad9d92-bank_account_name\",\"tableFieldad9d92-bank_account_number\",\"tableFieldad9d92-bank_province\",\"tableFieldad9d92-remark\",\"tableField46dc53-title_name\",\"tableField46dc53-credit_code\",\"tableField46dc53-tax_type\",\"tableField46dc53-address\",\"tableField46dc53-phone\",\"tableField46dc53-bank_name\",\"tableField46dc53-bank_account\",\"tableField46dc53-is_defalut\",\"tableField46dc53-is_valid\",\"tableField46dc53-remark\"],\"dataType\":\"2\"},\"hasTreeQuery\":false,\"useFormPermission\":true,\"complexHeaderList\":[],\"useBtnPermission\":true,\"treeSyncType\":0,\"hasPage\":true,\"searchList\":[{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"showCount\":false,\"__config__\":{\"formId\":\"formItem478e5c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"企业名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506482470,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"company_name\",\"__vModel__\":\"company_name\",\"searchMultiple\":false,\"disabled\":false,\"id\":\"company_name\",\"placeholder\":\"请输入企业名称\",\"addonBefore\":\"\",\"clearable\":true,\"searchType\":2,\"maxlength\":200,\"fullName\":\"企业名称\",\"label\":\"企业名称\",\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"isKeyword\":false,\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"organizeSelect\",\"filterable\":false,\"clearable\":true,\"searchType\":1,\"ableIds\":[],\"multiple\":false,\"fullName\":\"归属组织\",\"fullNameI18nCode\":[\"\"],\"label\":\"归属组织\",\"__config__\":{\"formId\":\"formItemfc6848\",\"yunzhupaasKey\":\"organizeSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"归属组织\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776912270086,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasOrganizeSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"org_id\",\"__vModel__\":\"org_id\",\"searchMultiple\":true,\"isKeyword\":false,\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"org_id\",\"placeholder\":\"请选择\",\"value\":[],\"labelI18nCode\":\"\"}],\"ruleList\":{\"conditionList\":[],\"matchLogic\":\"and\"},\"childTableStyle\":1,\"treePropsChildren\":\"children\",\"treeRelationFieldSelectType\":\"all\",\"showOverflow\":true,\"treeTemplateJson\":[],\"treeTitleI18nCode\":\"\",\"treePropsName\":\"\",\"useColumnPermission\":true,\"treePropsUrl\":\"\",\"btnsList\":[{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-add\",\"label\":\"新增\",\"value\":\"add\",\"labelI18nCode\":\"common.add2Text\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-download\",\"label\":\"导出\",\"value\":\"download\",\"labelI18nCode\":\"common.exportText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-upload\",\"label\":\"导入\",\"value\":\"upload\",\"labelI18nCode\":\"common.importText\"},{\"show\":false,\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"批量删除\",\"value\":\"batchRemove\",\"labelI18nCode\":\"common.batchDelText\"},{\"show\":false,\"icon\":\"icon-ym icon-ym-report-icon-preview-printPreview\",\"label\":\"批量打印\",\"value\":\"batchPrint\",\"labelI18nCode\":\"common.batchPrintText\"}],\"useDataPermission\":true,\"viewKey\":\"\",\"columnList\":[{\"yunzhupaasKey\":\"billRule\",\"resizable\":true,\"fullName\":\"企业编码\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业编码\",\"sortable\":true,\"align\":\"left\",\"__config__\":{\"formId\":\"formItem7a91b8\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"CorporationCode\",\"className\":[],\"label\":\"企业编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776916036468,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"法人单位编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":8},\"readonly\":true,\"prop\":\"company_code\",\"__vModel__\":\"company_code\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"company_code\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem478e5c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"企业名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506482470,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"company_name\",\"__vModel__\":\"company_name\",\"disabled\":false,\"id\":\"company_name\",\"placeholder\":\"请输入企业名称\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"企业名称\",\"label\":\"企业名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem84e51c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"简称/昵称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506482631,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"short_name\",\"__vModel__\":\"short_name\",\"disabled\":false,\"id\":\"short_name\",\"placeholder\":\"请输入简称/昵称\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"简称/昵称\",\"label\":\"简称/昵称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"organizeSelect\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"归属组织\",\"fullNameI18nCode\":[\"\"],\"label\":\"归属组织\",\"sortable\":true,\"align\":\"left\",\"__config__\":{\"formId\":\"formItemfc6848\",\"yunzhupaasKey\":\"organizeSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"归属组织\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776912270086,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasOrganizeSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"org_id\",\"__vModel__\":\"org_id\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"org_id\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"radio\",\"resizable\":true,\"buttonStyle\":\"solid\",\"fullName\":\"类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"optionType\":\"default\",\"__config__\":{\"yunzhupaasKey\":\"radio\",\"defaultValue\":\"ORG\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506487223,\"tagIcon\":\"icon-ym icon-ym-generator-radio\",\"tag\":\"YunzhupaasRadio\",\"formId\":\"formItemb3f6cd\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"size\":\"default\",\"prop\":\"entity_type\",\"options\":[{\"fullName\":\"企业\",\"id\":\"ORG\"},{\"fullName\":\"个人\",\"id\":\"IND\"}],\"__vModel__\":\"entity_type\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"entity_type\",\"labelI18nCode\":\"\",\"direction\":\"horizontal\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem10350c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"社会信用代码\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506494880,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"credit_code\",\"__vModel__\":\"credit_code\",\"disabled\":false,\"id\":\"credit_code\",\"placeholder\":\"请输入社会信用代码\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":100,\"fullName\":\"社会信用代码\",\"label\":\"社会信用代码\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"企业范围\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业范围\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"EXT\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506498092,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem13797c\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业范围\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"company_scope\",\"options\":[{\"fullName\":\"内部公司\",\"id\":\"INT\"},{\"fullName\":\"客商企业\",\"id\":\"EXT\"}],\"__vModel__\":\"company_scope\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"company_scope\",\"placeholder\":\"请选择企业范围\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"纳税人类别\",\"fullNameI18nCode\":[\"\"],\"label\":\"纳税人类别\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503586,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem05d07f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"tax_type\",\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_type\",\"placeholder\":\"请选择纳税人类别\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"企业规模\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业规模\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503806,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem66e88f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"enterpriseScale\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业规模\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"enterprise_scale\",\"__vModel__\":\"enterprise_scale\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_scale\",\"placeholder\":\"请选择企业规模\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"企业类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506504118,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItema76b83\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"9b542177a477488994ce09fff3c93901\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"enterprise_nature\",\"__vModel__\":\"enterprise_nature\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_nature\",\"placeholder\":\"请选择企业类型\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"行业代码\",\"fullNameI18nCode\":[\"\"],\"label\":\"行业代码\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506507062,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem6bd8a7\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"d59a3cf65f9847dbb08be449e3feae16\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"行业代码\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"industry_code\",\"__vModel__\":\"industry_code\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"industry_code\",\"placeholder\":\"请选择行业代码\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"datePicker\",\"clearable\":true,\"resizable\":true,\"format\":\"yyyy-MM-dd\",\"fullName\":\"成立日期\",\"fullNameI18nCode\":[\"\"],\"label\":\"成立日期\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506509988,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItembab00e\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"成立日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"registration_date\",\"__vModel__\":\"registration_date\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"registration_date\",\"placeholder\":\"请选择成立日期\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":4,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItem3134b1\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"注册资本\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506514957,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"registered_capital\",\"__vModel__\":\"registered_capital\",\"disabled\":false,\"id\":\"registered_capital\",\"placeholder\":\"请输入注册资本\",\"addonBefore\":\"\",\"resizable\":true,\"max\":999999,\"fullName\":\"注册资本\",\"label\":\"注册资本\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"万元\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem4f2d0b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"法定代表人\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524679,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"legal_representative\",\"__vModel__\":\"legal_representative\",\"disabled\":false,\"id\":\"legal_representative\",\"placeholder\":\"请输入法定代表人\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"法定代表人\",\"label\":\"法定代表人\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem97bd9d\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"联系电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524966,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^1[3456789]\\\\d{9}$|^0\\\\d{2,3}-?\\\\d{7,8}$/\",\"message\":\"请输入正确的电话号码\",\"messageI18nCode\":\"sys.validate.telephone\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"phone\",\"__vModel__\":\"phone\",\"disabled\":false,\"id\":\"phone\",\"placeholder\":\"请输入联系电话\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":11,\"fullName\":\"联系电话\",\"label\":\"联系电话\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem439010\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"邮箱\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506525554,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^[a-z0-9]+([._\\\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/\",\"message\":\"请输入正确的邮箱\",\"messageI18nCode\":\"sys.validate.email\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"email\",\"__vModel__\":\"email\",\"disabled\":false,\"id\":\"email\",\"placeholder\":\"请输入邮箱\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":100,\"fullName\":\"邮箱\",\"label\":\"邮箱\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem7fa940\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"网站\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528130,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"website\",\"__vModel__\":\"website\",\"disabled\":false,\"id\":\"website\",\"placeholder\":\"请输入网站\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":100,\"fullName\":\"网站\",\"label\":\"网站\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5b2d2b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528353,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"address\",\"__vModel__\":\"address\",\"disabled\":false,\"id\":\"address\",\"placeholder\":\"请输入地址\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"地址\",\"label\":\"地址\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"areaSelect\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"level\":2,\"multiple\":false,\"fullName\":\"所属地区\",\"fullNameI18nCode\":[\"\"],\"label\":\"所属地区\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItemcc9deb\",\"yunzhupaasKey\":\"areaSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属地区\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507118587,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-Provinces\",\"tag\":\"YunzhupaasAreaSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"province_id\",\"__vModel__\":\"province_id\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"province_id\",\"placeholder\":\"请选择所属地区\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"经营范围\",\"fullNameI18nCode\":[\"\"],\"label\":\"经营范围\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":3,\"maxRows\":3},\"showCount\":false,\"__config__\":{\"formId\":\"formItem8cbf03\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"经营范围\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534652,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"business_scope\",\"__vModel__\":\"business_scope\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"business_scope\",\"placeholder\":\"请输入经营范围\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"fullName\":\"备注\",\"fullNameI18nCode\":[\"\"],\"label\":\"备注\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"showCount\":false,\"__config__\":{\"formId\":\"formItem9f5e00\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534863,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"remark\",\"__vModel__\":\"remark\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"remark\",\"placeholder\":\"请输入备注\",\"labelI18nCode\":\"\"}],\"summaryField\":[],\"parentField\":\"\",\"treeDataSource\":\"dictionary\",\"treeDictionary\":\"\",\"treeSyncInterfaceId\":\"\",\"customBtnsList\":[]}"); + return sb.toString(); + } + /** app列表字段配置json */ + public static final String getAppColumnData(){ + StringBuilder sb = new StringBuilder(); + sb.append("{\"hasPage\":true,\"useColumnPermission\":false,\"searchList\":[],\"btnsList\":[{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-add\",\"label\":\"新增\",\"value\":\"add\",\"labelI18nCode\":\"common.add2Text\"},{\"show\":false,\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"批量删除\",\"value\":\"batchRemove\",\"labelI18nCode\":\"common.batchDelText\"}],\"useDataPermission\":false,\"viewKey\":\"\",\"ruleListApp\":{\"conditionList\":[],\"matchLogic\":\"and\"},\"columnList\":[{\"yunzhupaasKey\":\"billRule\",\"resizable\":true,\"fullName\":\"企业编码\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业编码\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItem7a91b8\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"CorporationCode\",\"className\":[],\"label\":\"企业编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776916036468,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"法人单位编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":8},\"readonly\":true,\"prop\":\"company_code\",\"__vModel__\":\"company_code\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"company_code\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem478e5c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"企业名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506482470,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"company_name\",\"__vModel__\":\"company_name\",\"disabled\":false,\"id\":\"company_name\",\"placeholder\":\"请输入企业名称\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"企业名称\",\"label\":\"企业名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem84e51c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"简称/昵称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506482631,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"short_name\",\"__vModel__\":\"short_name\",\"disabled\":false,\"id\":\"short_name\",\"placeholder\":\"请输入简称/昵称\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"简称/昵称\",\"label\":\"简称/昵称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"radio\",\"resizable\":true,\"buttonStyle\":\"solid\",\"fullName\":\"类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"optionType\":\"default\",\"__config__\":{\"yunzhupaasKey\":\"radio\",\"defaultValue\":\"ORG\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506487223,\"tagIcon\":\"icon-ym icon-ym-generator-radio\",\"tag\":\"YunzhupaasRadio\",\"formId\":\"formItemb3f6cd\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"size\":\"default\",\"prop\":\"entity_type\",\"options\":[{\"fullName\":\"企业\",\"id\":\"ORG\"},{\"fullName\":\"个人\",\"id\":\"IND\"}],\"__vModel__\":\"entity_type\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"entity_type\",\"labelI18nCode\":\"\",\"direction\":\"horizontal\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem10350c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"社会信用代码\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506494880,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"credit_code\",\"__vModel__\":\"credit_code\",\"disabled\":false,\"id\":\"credit_code\",\"placeholder\":\"请输入社会信用代码\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":100,\"fullName\":\"社会信用代码\",\"label\":\"社会信用代码\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"企业范围\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业范围\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"EXT\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506498092,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem13797c\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业范围\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"company_scope\",\"options\":[{\"fullName\":\"内部公司\",\"id\":\"INT\"},{\"fullName\":\"客商企业\",\"id\":\"EXT\"}],\"__vModel__\":\"company_scope\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"company_scope\",\"placeholder\":\"请选择企业范围\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"纳税人类别\",\"fullNameI18nCode\":[\"\"],\"label\":\"纳税人类别\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503586,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem05d07f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"tax_type\",\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_type\",\"placeholder\":\"请选择纳税人类别\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"企业规模\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业规模\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503806,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem66e88f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"enterpriseScale\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业规模\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"enterprise_scale\",\"__vModel__\":\"enterprise_scale\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_scale\",\"placeholder\":\"请选择企业规模\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"企业类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506504118,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItema76b83\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"9b542177a477488994ce09fff3c93901\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"enterprise_nature\",\"__vModel__\":\"enterprise_nature\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_nature\",\"placeholder\":\"请选择企业类型\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"行业代码\",\"fullNameI18nCode\":[\"\"],\"label\":\"行业代码\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506507062,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem6bd8a7\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"d59a3cf65f9847dbb08be449e3feae16\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"行业代码\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"industry_code\",\"__vModel__\":\"industry_code\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"industry_code\",\"placeholder\":\"请选择行业代码\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"datePicker\",\"clearable\":true,\"resizable\":true,\"format\":\"yyyy-MM-dd\",\"fullName\":\"成立日期\",\"fullNameI18nCode\":[\"\"],\"label\":\"成立日期\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506509988,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItembab00e\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"成立日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"registration_date\",\"__vModel__\":\"registration_date\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"registration_date\",\"placeholder\":\"请选择成立日期\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":4,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItem3134b1\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"注册资本\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506514957,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"registered_capital\",\"__vModel__\":\"registered_capital\",\"disabled\":false,\"id\":\"registered_capital\",\"placeholder\":\"请输入注册资本\",\"addonBefore\":\"\",\"resizable\":true,\"max\":999999,\"fullName\":\"注册资本\",\"label\":\"注册资本\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"万元\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem4f2d0b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"法定代表人\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524679,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"legal_representative\",\"__vModel__\":\"legal_representative\",\"disabled\":false,\"id\":\"legal_representative\",\"placeholder\":\"请输入法定代表人\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"法定代表人\",\"label\":\"法定代表人\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem97bd9d\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"联系电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524966,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^1[3456789]\\\\d{9}$|^0\\\\d{2,3}-?\\\\d{7,8}$/\",\"message\":\"请输入正确的电话号码\",\"messageI18nCode\":\"sys.validate.telephone\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"phone\",\"__vModel__\":\"phone\",\"disabled\":false,\"id\":\"phone\",\"placeholder\":\"请输入联系电话\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":11,\"fullName\":\"联系电话\",\"label\":\"联系电话\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem439010\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"邮箱\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506525554,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^[a-z0-9]+([._\\\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/\",\"message\":\"请输入正确的邮箱\",\"messageI18nCode\":\"sys.validate.email\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"email\",\"__vModel__\":\"email\",\"disabled\":false,\"id\":\"email\",\"placeholder\":\"请输入邮箱\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":100,\"fullName\":\"邮箱\",\"label\":\"邮箱\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem7fa940\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"网站\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528130,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"website\",\"__vModel__\":\"website\",\"disabled\":false,\"id\":\"website\",\"placeholder\":\"请输入网站\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":100,\"fullName\":\"网站\",\"label\":\"网站\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5b2d2b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528353,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"address\",\"__vModel__\":\"address\",\"disabled\":false,\"id\":\"address\",\"placeholder\":\"请输入地址\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"地址\",\"label\":\"地址\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"areaSelect\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"level\":2,\"multiple\":false,\"fullName\":\"所属地区\",\"fullNameI18nCode\":[\"\"],\"label\":\"所属地区\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItemcc9deb\",\"yunzhupaasKey\":\"areaSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属地区\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507118587,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-Provinces\",\"tag\":\"YunzhupaasAreaSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"province_id\",\"__vModel__\":\"province_id\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"province_id\",\"placeholder\":\"请选择所属地区\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"经营范围\",\"fullNameI18nCode\":[\"\"],\"label\":\"经营范围\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":3,\"maxRows\":3},\"showCount\":false,\"__config__\":{\"formId\":\"formItem8cbf03\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"经营范围\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534652,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"business_scope\",\"__vModel__\":\"business_scope\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"business_scope\",\"placeholder\":\"请输入经营范围\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"fullName\":\"备注\",\"fullNameI18nCode\":[\"\"],\"label\":\"备注\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"showCount\":false,\"__config__\":{\"formId\":\"formItem9f5e00\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534863,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"remark\",\"__vModel__\":\"remark\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"remark\",\"placeholder\":\"请输入备注\",\"labelI18nCode\":\"\"}],\"columnOptions\":[{\"__config__\":{\"formId\":\"formItem7a91b8\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"CorporationCode\",\"className\":[],\"label\":\"企业编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776916036468,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"法人单位编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":8},\"readonly\":true,\"__vModel__\":\"company_code\",\"fullName\":\"企业编码\",\"fullNameI18nCode\":[\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"company_code\",\"placeholder\":\"系统自动生成\"},{\"clearable\":true,\"maxlength\":200,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"企业名称\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem478e5c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"企业名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506482470,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"company_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"company_name\",\"placeholder\":\"请输入企业名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"简称/昵称\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem84e51c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"简称/昵称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506482631,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"short_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"short_name\",\"placeholder\":\"请输入简称/昵称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"buttonStyle\":\"solid\",\"fullName\":\"类型\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"optionType\":\"default\",\"__config__\":{\"yunzhupaasKey\":\"radio\",\"defaultValue\":\"ORG\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506487223,\"tagIcon\":\"icon-ym icon-ym-generator-radio\",\"tag\":\"YunzhupaasRadio\",\"formId\":\"formItemb3f6cd\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"size\":\"default\",\"options\":[{\"fullName\":\"企业\",\"id\":\"ORG\"},{\"fullName\":\"个人\",\"id\":\"IND\"}],\"__vModel__\":\"entity_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"entity_type\",\"direction\":\"horizontal\"},{\"clearable\":true,\"maxlength\":100,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"社会信用代码\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem10350c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"社会信用代码\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506494880,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"credit_code\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"credit_code\",\"placeholder\":\"请输入社会信用代码\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"企业范围\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"EXT\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506498092,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem13797c\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业范围\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"options\":[{\"fullName\":\"内部公司\",\"id\":\"INT\"},{\"fullName\":\"客商企业\",\"id\":\"EXT\"}],\"__vModel__\":\"company_scope\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"company_scope\",\"placeholder\":\"请选择企业范围\"},{\"filterable\":false,\"clearable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"归属组织\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"formId\":\"formItemfc6848\",\"yunzhupaasKey\":\"organizeSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"归属组织\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776912270086,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasOrganizeSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"org_id\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"org_id\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"level\":2,\"multiple\":false,\"fullName\":\"所属地区\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"formId\":\"formItemcc9deb\",\"yunzhupaasKey\":\"areaSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属地区\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507118587,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-Provinces\",\"tag\":\"YunzhupaasAreaSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"province_id\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"province_id\",\"placeholder\":\"请选择所属地区\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"纳税人类别\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503586,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem05d07f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_type\",\"placeholder\":\"请选择纳税人类别\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"企业规模\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503806,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem66e88f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"enterpriseScale\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业规模\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"enterprise_scale\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_scale\",\"placeholder\":\"请选择企业规模\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"企业类型\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506504118,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItema76b83\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"9b542177a477488994ce09fff3c93901\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"enterprise_nature\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_nature\",\"placeholder\":\"请选择企业类型\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"行业代码\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506507062,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem6bd8a7\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"d59a3cf65f9847dbb08be449e3feae16\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"行业代码\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"industry_code\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"industry_code\",\"placeholder\":\"请选择行业代码\"},{\"clearable\":true,\"format\":\"yyyy-MM-dd\",\"fullName\":\"成立日期\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506509988,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItembab00e\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"成立日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"registration_date\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"registration_date\",\"placeholder\":\"请选择成立日期\"},{\"controls\":false,\"max\":999999,\"precision\":4,\"fullName\":\"注册资本\",\"fullNameI18nCode\":[\"\"],\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"万元\",\"__config__\":{\"formId\":\"formItem3134b1\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"注册资本\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506514957,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"registered_capital\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"registered_capital\",\"placeholder\":\"请输入注册资本\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"法定代表人\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem4f2d0b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"法定代表人\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524679,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"legal_representative\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"legal_representative\",\"placeholder\":\"请输入法定代表人\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":11,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"联系电话\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem97bd9d\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"联系电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524966,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^1[3456789]\\\\d{9}$|^0\\\\d{2,3}-?\\\\d{7,8}$/\",\"message\":\"请输入正确的电话号码\",\"messageI18nCode\":\"sys.validate.telephone\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"phone\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"phone\",\"placeholder\":\"请输入联系电话\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":100,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"邮箱\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem439010\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"邮箱\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506525554,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^[a-z0-9]+([._\\\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/\",\"message\":\"请输入正确的邮箱\",\"messageI18nCode\":\"sys.validate.email\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"email\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"email\",\"placeholder\":\"请输入邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":100,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"网站\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem7fa940\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"网站\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528130,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"website\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"website\",\"placeholder\":\"请输入网站\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":200,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"地址\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5b2d2b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528353,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"address\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"address\",\"placeholder\":\"请输入地址\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":200,\"fullName\":\"经营范围\",\"fullNameI18nCode\":[\"\"],\"autoSize\":{\"minRows\":3,\"maxRows\":3},\"showCount\":false,\"__config__\":{\"formId\":\"formItem8cbf03\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"经营范围\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534652,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"business_scope\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"business_scope\",\"placeholder\":\"请输入经营范围\"},{\"clearable\":true,\"fullName\":\"备注\",\"fullNameI18nCode\":[\"\"],\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"showCount\":false,\"__config__\":{\"formId\":\"formItem9f5e00\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534863,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"remark\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"remark\",\"placeholder\":\"请输入备注\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-开户行\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem3756b9\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507591361,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldad9d92-bank_name\",\"placeholder\":\"请输入开户行\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-账户名\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemf42745\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"账户名\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507611465,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_account_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldad9d92-bank_account_name\",\"placeholder\":\"请输入账户名\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-银行账号\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem8abffe\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507627371,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_account_number\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldad9d92-bank_account_number\",\"placeholder\":\"请输入银行账号\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-开户行城市\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemb870cb\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行城市\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507627772,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_province\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldad9d92-bank_province\",\"placeholder\":\"请输入开户行城市\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":200,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-备注\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemf22092\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507628423,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"remark\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldad9d92-remark\",\"placeholder\":\"请输入备注\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"billRule\",\"parentVModel\":\"tableField46dc53\",\"dragDisabled\":false,\"rule\":\"InvoiceTitleCode\",\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754320599,\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"isSubTable\":true,\"ruleName\":\"发票抬头编码\",\"tag\":\"YunzhupaasInput\",\"formId\":\"formItem57f1d4\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"发票抬头编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"layout\":\"colFormItem\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"title_code\",\"fullName\":\"设计子表-发票抬头编码\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField46dc53-title_code\",\"placeholder\":\"系统自动生成\"},{\"clearable\":true,\"maxlength\":10,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-发票抬头名称\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItema8b1f4\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"发票抬头名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507383593,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"title_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-title_name\",\"placeholder\":\"请输入联系人\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-纳税人识别号\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1963f0\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"纳税人识别号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507440273,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"credit_code\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-credit_code\",\"placeholder\":\"请输入联系人职务\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"设计子表-纳税人类别\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"parentVModel\":\"tableField46dc53\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754396382,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemb3492f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-tax_type\",\"placeholder\":\"请选择纳税人类别\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-地址\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItema9aaf2\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507448061,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"address\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-address\",\"placeholder\":\"请输入联系人邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-电话\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItemf8b766\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754421983,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"phone\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-phone\",\"placeholder\":\"请输入联系人邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-开户银行\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1730ca\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户银行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754433217,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-bank_name\",\"placeholder\":\"请输入联系人邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-银行账户\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1089bb\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账户\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754444839,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_account\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-bank_account\",\"placeholder\":\"请输入联系人邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"formId\":\"formItem4743e7\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否默认\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754525239,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"activeValue\":1,\"inactiveValue\":0,\"__vModel__\":\"is_defalut\",\"fullName\":\"设计子表-是否默认\",\"inactiveTxt\":\"关\",\"fullNameI18nCode\":[\"\",\"\"],\"disabled\":false,\"activeTxt\":\"开\",\"id\":\"tableField46dc53-is_defalut\"},{\"__config__\":{\"formId\":\"formItema2b4cf\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否有效\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754540042,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"activeValue\":1,\"inactiveValue\":0,\"__vModel__\":\"is_valid\",\"fullName\":\"设计子表-是否有效\",\"inactiveTxt\":\"关\",\"fullNameI18nCode\":[\"\",\"\"],\"disabled\":false,\"activeTxt\":\"开\",\"id\":\"tableField46dc53-is_valid\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-备注\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem560a27\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507449005,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"remark\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-remark\",\"placeholder\":\"请输入备注\",\"prefixIcon\":\"\",\"addonBefore\":\"\"}],\"pageSize\":20,\"defaultSortConfig\":[],\"type\":1,\"columnBtnsList\":[{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-edit\",\"label\":\"编辑\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"edit\",\"labelI18nCode\":\"common.editText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"删除\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"remove\",\"labelI18nCode\":\"common.delText\"},{\"show\":tr"); + sb.append("ue,\"icon\":\"icon-ym icon-ym-generator-menu\",\"label\":\"详情\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"detail\",\"labelI18nCode\":\"common.detailText\"}],\"tabConfig\":{\"hasAllTab\":true,\"relationField\":\"\",\"on\":false},\"hasSuperQuery\":false,\"defaultColumnList\":[{\"yunzhupaasKey\":\"billRule\",\"resizable\":true,\"fullName\":\"企业编码\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业编码\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItem7a91b8\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"CorporationCode\",\"className\":[],\"label\":\"企业编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776916036468,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"法人单位编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":8},\"readonly\":true,\"prop\":\"company_code\",\"__vModel__\":\"company_code\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"company_code\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem478e5c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"企业名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506482470,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"company_name\",\"__vModel__\":\"company_name\",\"checked\":true,\"disabled\":false,\"id\":\"company_name\",\"placeholder\":\"请输入企业名称\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"企业名称\",\"label\":\"企业名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem84e51c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"简称/昵称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506482631,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"short_name\",\"__vModel__\":\"short_name\",\"checked\":true,\"disabled\":false,\"id\":\"short_name\",\"placeholder\":\"请输入简称/昵称\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"简称/昵称\",\"label\":\"简称/昵称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"radio\",\"resizable\":true,\"buttonStyle\":\"solid\",\"fullName\":\"类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"optionType\":\"default\",\"__config__\":{\"yunzhupaasKey\":\"radio\",\"defaultValue\":\"ORG\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506487223,\"tagIcon\":\"icon-ym icon-ym-generator-radio\",\"tag\":\"YunzhupaasRadio\",\"formId\":\"formItemb3f6cd\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"size\":\"default\",\"prop\":\"entity_type\",\"options\":[{\"fullName\":\"企业\",\"id\":\"ORG\"},{\"fullName\":\"个人\",\"id\":\"IND\"}],\"__vModel__\":\"entity_type\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"entity_type\",\"labelI18nCode\":\"\",\"direction\":\"horizontal\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem10350c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"社会信用代码\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506494880,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"credit_code\",\"__vModel__\":\"credit_code\",\"checked\":true,\"disabled\":false,\"id\":\"credit_code\",\"placeholder\":\"请输入社会信用代码\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":100,\"fullName\":\"社会信用代码\",\"label\":\"社会信用代码\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"企业范围\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业范围\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"EXT\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506498092,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem13797c\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业范围\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"company_scope\",\"options\":[{\"fullName\":\"内部公司\",\"id\":\"INT\"},{\"fullName\":\"客商企业\",\"id\":\"EXT\"}],\"__vModel__\":\"company_scope\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"company_scope\",\"placeholder\":\"请选择企业范围\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"organizeSelect\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"归属组织\",\"fullNameI18nCode\":[\"\"],\"label\":\"归属组织\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItemfc6848\",\"yunzhupaasKey\":\"organizeSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"归属组织\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776912270086,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasOrganizeSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"org_id\",\"__vModel__\":\"org_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"org_id\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"areaSelect\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"level\":2,\"multiple\":false,\"fullName\":\"所属地区\",\"fullNameI18nCode\":[\"\"],\"label\":\"所属地区\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItemcc9deb\",\"yunzhupaasKey\":\"areaSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属地区\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507118587,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-Provinces\",\"tag\":\"YunzhupaasAreaSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"province_id\",\"__vModel__\":\"province_id\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"province_id\",\"placeholder\":\"请选择所属地区\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"纳税人类别\",\"fullNameI18nCode\":[\"\"],\"label\":\"纳税人类别\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503586,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem05d07f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"tax_type\",\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_type\",\"placeholder\":\"请选择纳税人类别\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"企业规模\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业规模\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503806,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem66e88f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"enterpriseScale\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业规模\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"enterprise_scale\",\"__vModel__\":\"enterprise_scale\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_scale\",\"placeholder\":\"请选择企业规模\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"企业类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506504118,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItema76b83\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"9b542177a477488994ce09fff3c93901\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"enterprise_nature\",\"__vModel__\":\"enterprise_nature\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_nature\",\"placeholder\":\"请选择企业类型\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"行业代码\",\"fullNameI18nCode\":[\"\"],\"label\":\"行业代码\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506507062,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem6bd8a7\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"d59a3cf65f9847dbb08be449e3feae16\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"行业代码\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"industry_code\",\"__vModel__\":\"industry_code\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"industry_code\",\"placeholder\":\"请选择行业代码\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"datePicker\",\"clearable\":true,\"resizable\":true,\"format\":\"yyyy-MM-dd\",\"fullName\":\"成立日期\",\"fullNameI18nCode\":[\"\"],\"label\":\"成立日期\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506509988,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItembab00e\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"成立日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"registration_date\",\"__vModel__\":\"registration_date\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"registration_date\",\"placeholder\":\"请选择成立日期\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":4,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItem3134b1\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"注册资本\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506514957,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"registered_capital\",\"__vModel__\":\"registered_capital\",\"checked\":true,\"disabled\":false,\"id\":\"registered_capital\",\"placeholder\":\"请输入注册资本\",\"addonBefore\":\"\",\"resizable\":true,\"max\":999999,\"fullName\":\"注册资本\",\"label\":\"注册资本\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"万元\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem4f2d0b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"法定代表人\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524679,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"legal_representative\",\"__vModel__\":\"legal_representative\",\"checked\":true,\"disabled\":false,\"id\":\"legal_representative\",\"placeholder\":\"请输入法定代表人\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"法定代表人\",\"label\":\"法定代表人\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem97bd9d\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"联系电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524966,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^1[3456789]\\\\d{9}$|^0\\\\d{2,3}-?\\\\d{7,8}$/\",\"message\":\"请输入正确的电话号码\",\"messageI18nCode\":\"sys.validate.telephone\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"phone\",\"__vModel__\":\"phone\",\"checked\":true,\"disabled\":false,\"id\":\"phone\",\"placeholder\":\"请输入联系电话\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":11,\"fullName\":\"联系电话\",\"label\":\"联系电话\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem439010\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"邮箱\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506525554,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^[a-z0-9]+([._\\\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/\",\"message\":\"请输入正确的邮箱\",\"messageI18nCode\":\"sys.validate.email\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"email\",\"__vModel__\":\"email\",\"checked\":true,\"disabled\":false,\"id\":\"email\",\"placeholder\":\"请输入邮箱\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":100,\"fullName\":\"邮箱\",\"label\":\"邮箱\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem7fa940\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"网站\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528130,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"website\",\"__vModel__\":\"website\",\"checked\":true,\"disabled\":false,\"id\":\"website\",\"placeholder\":\"请输入网站\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":100,\"fullName\":\"网站\",\"label\":\"网站\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5b2d2b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528353,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"address\",\"__vModel__\":\"address\",\"checked\":true,\"disabled\":false,\"id\":\"address\",\"placeholder\":\"请输入地址\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"地址\",\"label\":\"地址\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"经营范围\",\"fullNameI18nCode\":[\"\"],\"label\":\"经营范围\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":3,\"maxRows\":3},\"showCount\":false,\"__config__\":{\"formId\":\"formItem8cbf03\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"经营范围\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534652,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"business_scope\",\"__vModel__\":\"business_scope\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"business_scope\",\"placeholder\":\"请输入经营范围\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"fullName\":\"备注\",\"fullNameI18nCode\":[\"\"],\"label\":\"备注\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"showCount\":false,\"__config__\":{\"formId\":\"formItem9f5e00\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534863,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"remark\",\"__vModel__\":\"remark\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"remark\",\"placeholder\":\"请输入备注\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem3756b9\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507591361,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldad9d92-bank_name\",\"__vModel__\":\"bank_name\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldad9d92-bank_name\",\"placeholder\":\"请输入开户行\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"设计子表-开户行\",\"label\":\"设计子表-开户行\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemf42745\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"账户名\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507611465,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldad9d92-bank_account_name\",\"__vModel__\":\"bank_account_name\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldad9d92-bank_account_name\",\"placeholder\":\"请输入账户名\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"设计子表-账户名\",\"label\":\"设计子表-账户名\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem8abffe\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507627371,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldad9d92-bank_account_number\",\"__vModel__\":\"bank_account_number\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldad9d92-bank_account_number\",\"placeholder\":\"请输入银行账号\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"设计子表-银行账号\",\"label\":\"设计子表-银行账号\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemb870cb\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行城市\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507627772,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldad9d92-bank_province\",\"__vModel__\":\"bank_province\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldad9d92-bank_province\",\"placeholder\":\"请输入开户行城市\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"设计子表-开户行城市\",\"label\":\"设计子表-开户行城市\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemf22092\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507628423,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldad9d92-remark\",\"__vModel__\":\"remark\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldad9d92-remark\",\"placeholder\":\"请输入备注\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"设计子表-备注\",\"label\":\"设计子表-备注\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"billRule\",\"resizable\":true,\"fullName\":\"设计子表-发票抬头编码\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"设计子表-发票抬头编码\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"billRule\",\"parentVModel\":\"tableField46dc53\",\"dragDisabled\":false,\"rule\":\"InvoiceTitleCode\",\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754320599,\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"isSubTable\":true,\"ruleName\":\"发票抬头编码\",\"tag\":\"YunzhupaasInput\",\"formId\":\"formItem57f1d4\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"发票抬头编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"layout\":\"colFormItem\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField46dc53-title_code\",\"__vModel__\":\"title_code\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField46dc53-title_code\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItema8b1f4\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"发票抬头名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507383593,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-title_name\",\"__vModel__\":\"title_name\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-title_name\",\"placeholder\":\"请输入联系人\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":10,\"fullName\":\"设计子表-发票抬头名称\",\"label\":\"设计子表-发票抬头名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1963f0\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"纳税人识别号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507440273,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-credit_code\",\"__vModel__\":\"credit_code\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-credit_code\",\"placeholder\":\"请输入联系人职务\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"设计子表-纳税人识别号\",\"label\":\"设计子表-纳税人识别号\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"设计子表-纳税人类别\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"设计子表-纳税人类别\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"parentVModel\":\"tableField46dc53\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754396382,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemb3492f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"tableField46dc53-tax_type\",\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-tax_type\",\"placeholder\":\"请选择纳税人类别\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItema9aaf2\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507448061,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-address\",\"__vModel__\":\"address\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-address\",\"placeholder\":\"请输入联系人邮箱\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"设计子表-地址\",\"label\":\"设计子表-地址\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItemf8b766\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754421983,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-phone\",\"__vModel__\":\"phone\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-phone\",\"placeholder\":\"请输入联系人邮箱\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"设计子表-电话\",\"label\":\"设计子表-电话\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1730ca\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户银行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754433217,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-bank_name\",\"__vModel__\":\"bank_name\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-bank_name\",\"placeholder\":\"请输入联系人邮箱\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"设计子表-开户银行\",\"label\":\"设计子表-开户银行\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1089bb\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账户\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754444839,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-bank_account\",\"__vModel__\":\"bank_account\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-bank_account\",\"placeholder\":\"请输入联系人邮箱\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"设计子表-银行账户\",\"label\":\"设计子表-银行账户\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"switch\",\"resizable\":true,\"activeValue\":1,\"inactiveValue\":0,\"fullName\":\"设计子表-是否默认\",\"inactiveTxt\":\"关\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"设计子表-是否默认\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItem4743e7\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否默认\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754525239,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"tableField46dc53-is_defalut\",\"__vModel__\":\"is_defalut\",\"checked\":false,\"fixed\":\"none\",\"disabled\":false,\"activeTxt\":\"开\",\"id\":\"tableField46dc53-is_defalut\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"switch\",\"resizable\":true,\"activeValue\":1,\"inactiveValue\":0,\"fullName\":\"设计子表-是否有效\",\"inactiveTxt\":\"关\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"设计子表-是否有效\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItema2b4cf\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否有效\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754540042,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"tableField46dc53-is_valid\",\"__vModel__\":\"is_valid\",\"checked\":false,\"fixed\":\"none\",\"disabled\":false,\"activeTxt\":\"开\",\"id\":\"tableField46dc53-is_valid\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem560a27\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507449005,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-remark\",\"__vModel__\":\"remark\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-remark\",\"placeholder\":\"请输入备注\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"设计子表-备注\",\"label\":\"设计子表-备注\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"}],\"showOverflow\":true,\"useFormPermission\":false,\"customBtnsList\":[],\"useBtnPermission\":false}"); + return sb.toString(); + } + /** 表列表 */ + public static final String getTableList(){ + StringBuilder sb = new StringBuilder(); +sb.append("[{\"relationTable\":\"\",\"tableField\":\"\",\"typeId\":\"1\",\"fields\":[{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"company_id\",\"fieldName\":\"企业唯一ID\",\"identity\":0,\"primaryKey\":1},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"company_code\",\"fieldName\":\"企业编码(系统生成或用户定义)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"200\",\"dataType\":\"varchar\",\"field\":\"company_name\",\"fieldName\":\"企业名称(企业名或个人姓名)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"3\",\"dataType\":\"char\",\"field\":\"entity_type\",\"fieldName\":\"实体类型: ORG-组织/企业(Organization), IND-个人(Individual)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"100\",\"dataType\":\"varchar\",\"field\":\"short_name\",\"fieldName\":\"简称/昵称\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"100\",\"dataType\":\"varchar\",\"field\":\"org_id\",\"fieldName\":\"归属组织。关联表:base_organize\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"3\",\"dataType\":\"char\",\"field\":\"company_scope\",\"fieldName\":\"伙伴性质:INT-内部(Internal), EXT-外部(External)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"credit_code\",\"fieldName\":\"社会信用代码(企业)或身份证号(个人)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"province_id\",\"fieldName\":\"所属地区。关联表:base_province\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"20\",\"dataType\":\"varchar\",\"field\":\"tax_type\",\"fieldName\":\"纳税人类别: GENERAL-一般纳税人, SMALL-小规模\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"enterprise_nature\",\"fieldName\":\"企业类型。关联字典:企业性质(EnterpriseNature)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"industry_code\",\"fieldName\":\"行业代码。关联字典:行业类别(IndustryType)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"enterprise_scale\",\"fieldName\":\"企业规模。关联字典:企业规模(EnterpriseScale)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"registration_date\",\"fieldName\":\"成立日期\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"10,2\",\"dataType\":\"decimal\",\"field\":\"registered_capital\",\"fieldName\":\"注册资本(单位:万元)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"legal_representative\",\"fieldName\":\"法定代表人\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"phone\",\"fieldName\":\"联系电话\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"email\",\"fieldName\":\"邮箱\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"200\",\"dataType\":\"varchar\",\"field\":\"website\",\"fieldName\":\"网站\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"500\",\"dataType\":\"varchar\",\"field\":\"address\",\"fieldName\":\"地址\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":null,\"dataType\":\"tinytext\",\"field\":\"business_scope\",\"fieldName\":\"经营范围\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"500\",\"dataType\":\"varchar\",\"field\":\"remark\",\"fieldName\":\"备注\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"create_by\",\"fieldName\":\"创建人\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"create_time\",\"fieldName\":\"创建时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"update_by\",\"fieldName\":\"更新人ID\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"update_time\",\"fieldName\":\"更新时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_tenant_id\",\"fieldName\":\"租户id\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":null,\"dataType\":\"int\",\"field\":\"f_delete_mark\",\"fieldName\":\"删除标志\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"f_delete_time\",\"fieldName\":\"删除时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_delete_user_id\",\"fieldName\":\"删除用户\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_flow_id\",\"fieldName\":\"流程id\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_flow_task_id\",\"fieldName\":\"流程任务主键\",\"identity\":0,\"primaryKey\":0}],\"relationField\":\"\",\"table\":\"mdm_company\",\"tableName\":\"企业信息(包括:客商与企业内部单位)\"},{\"relationTable\":\"mdm_company\",\"tableField\":\"company_id\",\"typeId\":\"0\",\"fields\":[{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"bank_id\",\"fieldName\":\"商业伙伴银行ID\",\"identity\":0,\"primaryKey\":1},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"company_id\",\"fieldName\":\"关联的企业信息ID。关联表:mdm_company\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"100\",\"dataType\":\"varchar\",\"field\":\"bank_name\",\"fieldName\":\"开户行\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"200\",\"dataType\":\"varchar\",\"field\":\"bank_account_name\",\"fieldName\":\"账户名\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"bank_account_number\",\"fieldName\":\"银行账号\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"bank_province\",\"fieldName\":\"开户行城市\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"500\",\"dataType\":\"varchar\",\"field\":\"remark\",\"fieldName\":\"备注\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"create_by\",\"fieldName\":\"创建人\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"create_time\",\"fieldName\":\"创建时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"update_by\",\"fieldName\":\"更新人ID\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"update_time\",\"fieldName\":\"更新时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_tenant_id\",\"fieldName\":\"租户id\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":null,\"dataType\":\"int\",\"field\":\"f_delete_mark\",\"fieldName\":\"删除标志\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"f_delete_time\",\"fieldName\":\"删除时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_delete_user_id\",\"fieldName\":\"删除用户\",\"identity\":0,\"primaryKey\":0}],\"relationField\":\"company_id\",\"table\":\"mdm_company_bank\",\"tableName\":\"企业银行信息\"},{\"relationTable\":\"mdm_company\",\"tableField\":\"company_id\",\"typeId\":\"0\",\"fields\":[{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"invoice_id\",\"fieldName\":\"发票抬头ID\",\"identity\":0,\"primaryKey\":1},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"company_id\",\"fieldName\":\"企业信息ID。关联表:mdm_company\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"100\",\"dataType\":\"varchar\",\"field\":\"title_code\",\"fieldName\":\"发票抬头编码\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"200\",\"dataType\":\"varchar\",\"field\":\"title_name\",\"fieldName\":\"发票抬头名称\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"credit_code\",\"fieldName\":\"纳税人识别号\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"20\",\"dataType\":\"varchar\",\"field\":\"tax_type\",\"fieldName\":\"纳税人类别: GENERAL-一般纳税人, SMALL-小规模\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"200\",\"dataType\":\"varchar\",\"field\":\"address\",\"fieldName\":\"地址\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"20\",\"dataType\":\"varchar\",\"field\":\"phone\",\"fieldName\":\"电话\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"100\",\"dataType\":\"varchar\",\"field\":\"bank_name\",\"fieldName\":\"开户银行\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"30\",\"dataType\":\"varchar\",\"field\":\"bank_account\",\"fieldName\":\"银行账户\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"1\",\"dataType\":\"char\",\"field\":\"is_valid\",\"fieldName\":\"是否有效。Y=有效、N=无效\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"1\",\"dataType\":\"char\",\"field\":\"is_defalut\",\"fieldName\":\"是否默认抬头。Y=是、N=否\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"500\",\"dataType\":\"varchar\",\"field\":\"remark\",\"fieldName\":\"备注\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"create_by\",\"fieldName\":\"创建人\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"create_time\",\"fieldName\":\"创建时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"update_by\",\"fieldName\":\"更新人ID\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"update_time\",\"fieldName\":\"更新时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_tenant_id\",\"fieldName\":\"租户id\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":null,\"dataType\":\"int\",\"field\":\"f_delete_mark\",\"fieldName\":\"删除标志\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"f_delete_time\",\"fieldName\":\"删除时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_delete_user_id\",\"fieldName\":\"删除用户\",\"identity\":0,\"primaryKey\":0}],\"relationField\":\"company_id\",\"table\":\"mdm_company_invoice\",\"tableName\":\"企业发票抬头\"}]"); return sb.toString(); + } + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/company/CompanyExcelErrorVO.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/company/CompanyExcelErrorVO.java new file mode 100644 index 0000000..2367290 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/company/CompanyExcelErrorVO.java @@ -0,0 +1,22 @@ + + +package com.yunzhupaas.mdm.model.company; + +import lombok.Data; +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.alibaba.fastjson.annotation.JSONField; +/** + * + * 企业信息 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-24 + */ +@Data +public class CompanyExcelErrorVO extends CompanyExcelVO{ + + @Excel(name = "异常原因",orderNum = "-999") + @JSONField(name = "errorsInfo") + private String errorsInfo; +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/company/CompanyExcelVO.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/company/CompanyExcelVO.java new file mode 100644 index 0000000..ee34b52 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/company/CompanyExcelVO.java @@ -0,0 +1,135 @@ +package com.yunzhupaas.mdm.model.company; + +import com.yunzhupaas.mdm.model.companyBank.CompanyBankExcelVO; +import com.yunzhupaas.mdm.model.companyInvoice.CompanyInvoiceExcelVO; +import lombok.Data; +import java.sql.Time; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; +import cn.afterturn.easypoi.excel.annotation.Excel; +import cn.afterturn.easypoi.excel.annotation.ExcelEntity; +import cn.afterturn.easypoi.excel.annotation.ExcelCollection; +import java.math.BigDecimal; +import java.util.List; +/** + * + * 企业信息 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-24 + */ +@Data +public class CompanyExcelVO{ + /** 企业名称 **/ + @JSONField(name = "company_name") + @Excel(name = "企业名称(company_name)",orderNum = "1", isImportField = "true" ) + private String company_name; + + /** 社会信用代码 **/ + @JSONField(name = "credit_code") + @Excel(name = "社会信用代码(credit_code)",orderNum = "1", isImportField = "true" ) + private String credit_code; + + /** 归属组织 **/ + @JSONField(name = "org_id") + @Excel(name = "归属组织(org_id)",orderNum = "1", isImportField = "true" ) + private String org_id; + + /** 企业编码 **/ + @JSONField(name = "company_code") + @Excel(name = "企业编码(company_code)",orderNum = "1", isImportField = "true" ) + private String company_code; + + /** 简称/昵称 **/ + @JSONField(name = "short_name") + @Excel(name = "简称/昵称(short_name)",orderNum = "1", isImportField = "true" ) + private String short_name; + + /** 类型 **/ + @JSONField(name = "entity_type") + @Excel(name = "类型(entity_type)",orderNum = "1", isImportField = "true" ) + private String entity_type; + + /** 纳税人类别 **/ + @JSONField(name = "tax_type") + @Excel(name = "纳税人类别(tax_type)",orderNum = "1", isImportField = "true" ) + private String tax_type; + + /** 企业规模 **/ + @JSONField(name = "enterprise_scale") + @Excel(name = "企业规模(enterprise_scale)",orderNum = "1", isImportField = "true" ) + private String enterprise_scale; + + /** 企业类型 **/ + @JSONField(name = "enterprise_nature") + @Excel(name = "企业类型(enterprise_nature)",orderNum = "1", isImportField = "true" ) + private String enterprise_nature; + + /** 行业代码 **/ + @JSONField(name = "industry_code") + @Excel(name = "行业代码(industry_code)",orderNum = "1", isImportField = "true" ) + private String industry_code; + + /** 成立日期 **/ + @JSONField(name = "registration_date") + @Excel(name = "成立日期(registration_date)",orderNum = "1", isImportField = "true" ) + private String registration_date; + + /** 注册资本 **/ + @JSONField(name = "registered_capital") + @Excel(name = "注册资本(registered_capital)",orderNum = "1", isImportField = "true" ) + private String registered_capital; + + /** 法定代表人 **/ + @JSONField(name = "legal_representative") + @Excel(name = "法定代表人(legal_representative)",orderNum = "1", isImportField = "true" ) + private String legal_representative; + + /** 联系电话 **/ + @JSONField(name = "phone") + @Excel(name = "联系电话(phone)",orderNum = "1", isImportField = "true" ) + private String phone; + + /** 邮箱 **/ + @JSONField(name = "email") + @Excel(name = "邮箱(email)",orderNum = "1", isImportField = "true" ) + private String email; + + /** 网站 **/ + @JSONField(name = "website") + @Excel(name = "网站(website)",orderNum = "1", isImportField = "true" ) + private String website; + + /** 地址 **/ + @JSONField(name = "address") + @Excel(name = "地址(address)",orderNum = "1", isImportField = "true" ) + private String address; + + /** 所属地区 **/ + @JSONField(name = "province_id") + @Excel(name = "所属地区(province_id)",orderNum = "1", isImportField = "true" ) + private String province_id; + + /** 经营范围 **/ + @JSONField(name = "business_scope") + @Excel(name = "经营范围(business_scope)",orderNum = "1", isImportField = "true" ) + private String business_scope; + + /** 备注 **/ + @JSONField(name = "remark") + @Excel(name = "备注(remark)",orderNum = "1", isImportField = "true" ) + private String remark; + + @JsonProperty("tableFieldad9d92") + @ExcelCollection(name="设计子表(tableFieldad9d92)",orderNum = "5") + private List tableFieldad9d92; + + @JsonProperty("tableField46dc53") + @ExcelCollection(name="设计子表(tableField46dc53)",orderNum = "10") + private List tableField46dc53; + + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/company/CompanyForm.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/company/CompanyForm.java new file mode 100644 index 0000000..ab08e37 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/company/CompanyForm.java @@ -0,0 +1,137 @@ +package com.yunzhupaas.mdm.model.company; + +import com.yunzhupaas.mdm.model.companyBank.CompanyBankModel; +import com.yunzhupaas.mdm.model.companyInvoice.CompanyInvoiceModel; +import lombok.Data; +import java.util.*; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * 企业信息 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-24 + */ +@Data +@Schema(description = "表单参数") +public class CompanyForm { + /** 主键 */ + @Schema(description = "主键") + @JSONField(name = "company_id") + private String companyId; + + + /** 企业编码 **/ + @Schema(description = "企业编码") + @JsonProperty("company_code") + @JSONField(name = "company_code") + private String companyCode; + /** 企业名称 **/ + @Schema(description = "企业名称") + @JsonProperty("company_name") + @JSONField(name = "company_name") + private String companyName; + /** 简称/昵称 **/ + @Schema(description = "简称/昵称") + @JsonProperty("short_name") + @JSONField(name = "short_name") + private String shortName; + /** 类型 **/ + @Schema(description = "类型") + @JsonProperty("entity_type") + @JSONField(name = "entity_type") + private String entityType; + /** 社会信用代码 **/ + @Schema(description = "社会信用代码") + @JsonProperty("credit_code") + @JSONField(name = "credit_code") + private String creditCode; + /** 归属组织 **/ + @Schema(description = "归属组织") + @JsonProperty("org_id") + @JSONField(name = "org_id") + private Object orgId; + /** 所属地区 **/ + @Schema(description = "所属地区") + @JsonProperty("province_id") + @JSONField(name = "province_id") + private Object provinceId; + /** 纳税人类别 **/ + @Schema(description = "纳税人类别") + @JsonProperty("tax_type") + @JSONField(name = "tax_type") + private Object taxType; + /** 企业规模 **/ + @Schema(description = "企业规模") + @JsonProperty("enterprise_scale") + @JSONField(name = "enterprise_scale") + private Object enterpriseScale; + /** 企业类型 **/ + @Schema(description = "企业类型") + @JsonProperty("enterprise_nature") + @JSONField(name = "enterprise_nature") + private Object enterpriseNature; + /** 行业代码 **/ + @Schema(description = "行业代码") + @JsonProperty("industry_code") + @JSONField(name = "industry_code") + private Object industryCode; + /** 成立日期 **/ + @Schema(description = "成立日期") + @JsonProperty("registration_date") + @JSONField(name = "registration_date") + private String registrationDate; + /** 注册资本 **/ + @Schema(description = "注册资本") + @JsonProperty("registered_capital") + @JSONField(name = "registered_capital") + private BigDecimal registeredCapital; + /** 法定代表人 **/ + @Schema(description = "法定代表人") + @JsonProperty("legal_representative") + @JSONField(name = "legal_representative") + private String legalRepresentative; + /** 联系电话 **/ + @Schema(description = "联系电话") + @JsonProperty("phone") + @JSONField(name = "phone") + private String phone; + /** 邮箱 **/ + @Schema(description = "邮箱") + @JsonProperty("email") + @JSONField(name = "email") + private String email; + /** 网站 **/ + @Schema(description = "网站") + @JsonProperty("website") + @JSONField(name = "website") + private String website; + /** 地址 **/ + @Schema(description = "地址") + @JsonProperty("address") + @JSONField(name = "address") + private String address; + /** 经营范围 **/ + @Schema(description = "经营范围") + @JsonProperty("business_scope") + @JSONField(name = "business_scope") + private String businessScope; + /** 备注 **/ + @Schema(description = "备注") + @JsonProperty("remark") + @JSONField(name = "remark") + private String remark; + + /** 子表数据 **/ + @Schema(description = "mdmCompanyBank子表数据") + @JsonProperty("mdmCompanyBankList") + private List mdmCompanyBankList; + /** 子表数据 **/ + @Schema(description = "companyInvoice子表数据") + @JsonProperty("companyInvoiceList") + private List companyInvoiceList; +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/company/CompanyPagination.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/company/CompanyPagination.java new file mode 100644 index 0000000..eba94f1 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/company/CompanyPagination.java @@ -0,0 +1,55 @@ +package com.yunzhupaas.mdm.model.company; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import com.yunzhupaas.base.Pagination; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.List; + +/** + * + * 企业信息 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-24 + */ +@Data +@Schema(description = "列表查询参数") +public class CompanyPagination extends Pagination { + /** 关键词搜索 */ + @Schema(description = "关键词搜索") + private String yunzhupaasKeyword; + /** 查询key */ + @Schema(description = "查询key") + private String[] selectKey; + /** 选中数据数组id */ + @Schema(description = "选中数据数组id") + private Object[] selectIds; + /** json */ + @Schema(description = "json") + private String json; + /** 数据类型 0-当前页,1-全部数据 */ + @Schema(description = "数据类型 0-当前页,1-全部数据") + private String dataType; + /** 高级查询 */ + @Schema(description = "高级查询") + private String superQueryJson; + /** 功能id */ + @Schema(description = "功能id") + private String moduleId; + /** 菜单id */ + @Schema(description = "菜单id") + private String menuId; + /** 企业名称 */ + @Schema(description = "企业名称") + @JsonProperty("company_name") + @JSONField(name = "companyName") + private Object companyName; + /** 归属组织 */ + @Schema(description = "归属组织") + @JsonProperty("org_id") + @JSONField(name = "orgId") + private Object orgId; +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/companyBank/CompanyBankExcelVO.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/companyBank/CompanyBankExcelVO.java new file mode 100644 index 0000000..cc89aaf --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/companyBank/CompanyBankExcelVO.java @@ -0,0 +1,43 @@ +package com.yunzhupaas.mdm.model.companyBank; + +import lombok.Data; +import com.alibaba.fastjson.annotation.JSONField; +import cn.afterturn.easypoi.excel.annotation.Excel; + +/** + * + * 法人公司 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-24 + */ +@Data +public class CompanyBankExcelVO{ + /** 开户行 **/ + @JSONField(name = "bank_name") + @Excel(name = "开户行(bank_name)",orderNum = "1", isImportField = "true" ) + private String bank_name; + + /** 账户名 **/ + @JSONField(name = "bank_account_name") + @Excel(name = "账户名(bank_account_name)",orderNum = "1", isImportField = "true" ) + private String bank_account_name; + + /** 银行账号 **/ + @JSONField(name = "bank_account_number") + @Excel(name = "银行账号(bank_account_number)",orderNum = "1", isImportField = "true" ) + private String bank_account_number; + + /** 开户行城市 **/ + @JSONField(name = "bank_province") + @Excel(name = "开户行城市(bank_province)",orderNum = "1", isImportField = "true" ) + private String bank_province; + + /** 备注 **/ + @JSONField(name = "remark") + @Excel(name = "备注(remark)",orderNum = "1", isImportField = "true" ) + private String remark; + + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/companyBank/CompanyBankModel.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/companyBank/CompanyBankModel.java new file mode 100644 index 0000000..4d88ff0 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/companyBank/CompanyBankModel.java @@ -0,0 +1,55 @@ +package com.yunzhupaas.mdm.model.companyBank; + +import lombok.Data; +import com.alibaba.fastjson.annotation.JSONField; +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * + * 法人公司 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-24 + */ +@Data +@Schema(description = "CompanyBank子表参数") +public class CompanyBankModel { + + /** 子表:CompanyBank 主键:bank_id **/ + @Schema(description = "主键") + @JsonProperty("bank_id") + private String bank_id; + /** 开户行 **/ + @Schema(description = "开户行") + @Excel(name = "开户行",orderNum = "1",isImportField = "true") + @JsonProperty("bank_name") + @JSONField(name = "bank_name") + private String bankName; + /** 账户名 **/ + @Schema(description = "账户名") + @Excel(name = "账户名",orderNum = "1",isImportField = "true") + @JsonProperty("bank_account_name") + @JSONField(name = "bank_account_name") + private String bankAccountName; + /** 银行账号 **/ + @Schema(description = "银行账号") + @Excel(name = "银行账号",orderNum = "1",isImportField = "true") + @JsonProperty("bank_account_number") + @JSONField(name = "bank_account_number") + private String bankAccountNumber; + /** 开户行城市 **/ + @Schema(description = "开户行城市") + @Excel(name = "开户行城市",orderNum = "1",isImportField = "true") + @JsonProperty("bank_province") + @JSONField(name = "bank_province") + private String bankProvince; + /** 备注 **/ + @Schema(description = "备注") + @Excel(name = "备注",orderNum = "1",isImportField = "true") + @JsonProperty("remark") + @JSONField(name = "remark") + private String remark; +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/companyInvoice/CompanyInvoiceExcelVO.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/companyInvoice/CompanyInvoiceExcelVO.java new file mode 100644 index 0000000..09ebccf --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/companyInvoice/CompanyInvoiceExcelVO.java @@ -0,0 +1,68 @@ +package com.yunzhupaas.mdm.model.companyInvoice; + +import lombok.Data; +import com.alibaba.fastjson.annotation.JSONField; +import cn.afterturn.easypoi.excel.annotation.Excel; + +/** + * + * 法人公司 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-24 + */ +@Data +public class CompanyInvoiceExcelVO{ + /** 发票抬头名称 **/ + @JSONField(name = "title_name") + @Excel(name = "发票抬头名称(title_name)",orderNum = "1", isImportField = "true" ) + private String title_name; + + /** 纳税人识别号 **/ + @JSONField(name = "credit_code") + @Excel(name = "纳税人识别号(credit_code)",orderNum = "1", isImportField = "true" ) + private String credit_code; + + /** 纳税人类别 **/ + @JSONField(name = "tax_type") + @Excel(name = "纳税人类别(tax_type)",orderNum = "1", isImportField = "true" ) + private String tax_type; + + /** 地址 **/ + @JSONField(name = "address") + @Excel(name = "地址(address)",orderNum = "1", isImportField = "true" ) + private String address; + + /** 电话 **/ + @JSONField(name = "phone") + @Excel(name = "电话(phone)",orderNum = "1", isImportField = "true" ) + private String phone; + + /** 开户银行 **/ + @JSONField(name = "bank_name") + @Excel(name = "开户银行(bank_name)",orderNum = "1", isImportField = "true" ) + private String bank_name; + + /** 银行账户 **/ + @JSONField(name = "bank_account") + @Excel(name = "银行账户(bank_account)",orderNum = "1", isImportField = "true" ) + private String bank_account; + + /** 是否默认抬头 **/ + @JSONField(name = "is_defalut") + @Excel(name = "是否默认抬头(is_defalut)",orderNum = "1", isImportField = "true" ) + private String is_defalut; + + /** 是否有效 **/ + @JSONField(name = "is_valid") + @Excel(name = "是否有效(is_valid)",orderNum = "1", isImportField = "true" ) + private String is_valid; + + /** 备注 **/ + @JSONField(name = "remark") + @Excel(name = "备注(remark)",orderNum = "1", isImportField = "true" ) + private String remark; + + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/companyInvoice/CompanyInvoiceModel.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/companyInvoice/CompanyInvoiceModel.java new file mode 100644 index 0000000..6087323 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/companyInvoice/CompanyInvoiceModel.java @@ -0,0 +1,90 @@ +package com.yunzhupaas.mdm.model.companyInvoice; + +import lombok.Data; +import com.alibaba.fastjson.annotation.JSONField; +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * + * 法人公司 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-24 + */ +@Data +@Schema(description = "Company_invoice子表参数") +public class CompanyInvoiceModel { + + /** 子表:Company_invoice 主键:invoice_id **/ + @Schema(description = "主键") + @JsonProperty("invoice_id") + private String invoice_id; + /** 发票抬头编码 **/ + @Schema(description = "发票抬头编码") + @JsonProperty("title_code") + @JSONField(name = "title_code") + private String titleCode; + /** 发票抬头名称 **/ + @Schema(description = "发票抬头名称") + @Excel(name = "发票抬头名称",orderNum = "1",isImportField = "true") + @JsonProperty("title_name") + @JSONField(name = "title_name") + private String titleName; + /** 纳税人识别号 **/ + @Schema(description = "纳税人识别号") + @Excel(name = "纳税人识别号",orderNum = "1",isImportField = "true") + @JsonProperty("credit_code") + @JSONField(name = "credit_code") + private String creditCode; + /** 纳税人类别 **/ + @Schema(description = "纳税人类别") + @Excel(name = "纳税人类别",orderNum = "1",isImportField = "true") + @JsonProperty("tax_type") + @JSONField(name = "tax_type") + private Object taxType; + /** 地址 **/ + @Schema(description = "地址") + @Excel(name = "地址",orderNum = "1",isImportField = "true") + @JsonProperty("address") + @JSONField(name = "address") + private String address; + /** 电话 **/ + @Schema(description = "电话") + @Excel(name = "电话",orderNum = "1",isImportField = "true") + @JsonProperty("phone") + @JSONField(name = "phone") + private String phone; + /** 开户银行 **/ + @Schema(description = "开户银行") + @Excel(name = "开户银行",orderNum = "1",isImportField = "true") + @JsonProperty("bank_name") + @JSONField(name = "bank_name") + private String bankName; + /** 银行账户 **/ + @Schema(description = "银行账户") + @Excel(name = "银行账户",orderNum = "1",isImportField = "true") + @JsonProperty("bank_account") + @JSONField(name = "bank_account") + private String bankAccount; + /** 是否默认抬头 **/ + @Schema(description = "是否默认抬头") + @Excel(name = "是否默认抬头",orderNum = "1",isImportField = "true") + @JsonProperty("is_defalut") + @JSONField(name = "is_defalut") + private String isDefalut; + /** 是否有效 **/ + @Schema(description = "是否有效") + @Excel(name = "是否有效",orderNum = "1",isImportField = "true") + @JsonProperty("is_valid") + @JSONField(name = "is_valid") + private String isValid; + /** 备注 **/ + @Schema(description = "备注") + @Excel(name = "备注",orderNum = "1",isImportField = "true") + @JsonProperty("remark") + @JSONField(name = "remark") + private String remark; +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/custinfo/CustinfoConstant.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/custinfo/CustinfoConstant.java new file mode 100644 index 0000000..372c7ed --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/custinfo/CustinfoConstant.java @@ -0,0 +1,46 @@ +package com.yunzhupaas.mdm.model.custinfo; + +import com.yunzhupaas.util.JsonUtil; +import java.util.*; + +/** + * 客户信息配置json + * + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-24 + */ +public class CustinfoConstant{ + /** 数据库链接 */ + public static final String DBLINKID = "0"; + /** 表别名 map */ + public static final Map TABLERENAMES = JsonUtil.getJsonToBean("{\"mdm_customer\":\"customer\",\"mdm_company_bank\":\"companyBank\",\"mdm_company_invoice\":\"companyInvoice\",\"mdm_company\":\"company\"}",Map.class); + /** 子表model map */ + public static final Map TABLEFIELDKEY = JsonUtil.getJsonToBean("{\"tableField46dc53\":\"mdm_company_invoice\",\"tableFieldad9d92\":\"mdm_company_bank\"}",Map.class); + /** 整个表单配置json */ + public static final String getFormData(){ + StringBuilder sb = new StringBuilder(); +sb.append("{\"popupType\":\"drawer\",\"labelWidth\":100,\"classNames\":[],\"className\":[],\"fullScreenWidth\":\"100%\",\"hasConfirmAndAddBtn\":true,\"cancelButtonTextI18nCode\":\"common.cancelText\",\"businessKeyTip\":\"数据已存在,请勿重复提交!\",\"labelPosition\":\"right\",\"printId\":\"\",\"labelSuffix\":\"\",\"customBtns\":[],\"disabled\":false,\"formModel\":\"dataForm\",\"cancelButtonText\":\"取消\",\"confirmButtonText\":\"确定\",\"hasCancelBtn\":true,\"primaryKeyPolicy\":1,\"hasPrintBtn\":false,\"concurrencyLock\":false,\"classJson\":\"\",\"drawerWidth\":\"1000px\",\"confirmButtonTextI18nCode\":\"common.okText\",\"printButtonText\":\"打印\",\"businessKeyList\":[],\"formRef\":\"formRef\",\"gutter\":15,\"logicalDelete\":false,\"size\":\"middle\",\"formRules\":\"rules\",\"generalWidth\":\"1000px\",\"colon\":false,\"hasConfirmBtn\":true,\"useBusinessKey\":false,\"formStyle\":\"\",\"printButtonTextI18nCode\":\"common.printText\",\"fields\":[{\"__config__\":{\"formId\":\"formItem7a91b8\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"companyCode\",\"className\":[],\"label\":\"客户编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776916036468,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"企业编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":8},\"readonly\":true,\"__vModel__\":\"company_code\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"系统自动生成\"},{\"clearable\":true,\"maxlength\":200,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem478e5c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"客户名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506482470,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"company_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入企业名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem84e51c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"简称/昵称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506482631,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"short_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入简称/昵称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"optionType\":\"default\",\"__config__\":{\"yunzhupaasKey\":\"radio\",\"defaultValue\":\"ORG\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506487223,\"tagIcon\":\"icon-ym icon-ym-generator-radio\",\"tag\":\"YunzhupaasRadio\",\"formId\":\"formItemb3f6cd\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"size\":\"default\",\"buttonStyle\":\"solid\",\"options\":[{\"fullName\":\"企业\",\"id\":\"ORG\"},{\"fullName\":\"个人\",\"id\":\"IND\"}],\"__vModel__\":\"entity_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"direction\":\"horizontal\"},{\"clearable\":true,\"maxlength\":100,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem10350c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"社会信用代码\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506494880,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"credit_code\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入社会信用代码\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"formId\":\"formItemfc6848\",\"yunzhupaasKey\":\"organizeSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"归属组织\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776912270086,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasOrganizeSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"ableIds\":[],\"multiple\":false,\"__vModel__\":\"org_id\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"formId\":\"formItemcc9deb\",\"yunzhupaasKey\":\"areaSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属地区\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507118587,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-Provinces\",\"tag\":\"YunzhupaasAreaSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"level\":2,\"multiple\":false,\"__vModel__\":\"province_id\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择所属地区\"},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503586,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem05d07f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"multiple\":false,\"__vModel__\":\"tax_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择纳税人类别\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"}},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503806,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem66e88f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"enterpriseScale\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业规模\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"multiple\":false,\"__vModel__\":\"enterprise_scale\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择企业规模\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"}},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506504118,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItema76b83\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"9b542177a477488994ce09fff3c93901\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"multiple\":false,\"__vModel__\":\"enterprise_nature\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择企业类型\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"}},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506507062,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem6bd8a7\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"d59a3cf65f9847dbb08be449e3feae16\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"行业代码\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"multiple\":false,\"__vModel__\":\"industry_code\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择行业代码\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"}},{\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506509988,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItembab00e\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"成立日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"format\":\"yyyy-MM-dd\",\"__vModel__\":\"registration_date\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择成立日期\"},{\"controls\":false,\"max\":999999,\"precision\":4,\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"万元\",\"__config__\":{\"formId\":\"formItem3134b1\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"注册资本\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506514957,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"registered_capital\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"placeholder\":\"请输入注册资本\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem4f2d0b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"法定代表人\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524679,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"legal_representative\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入法定代表人\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":11,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem97bd9d\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"联系电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524966,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^1[3456789]\\\\d{9}$|^0\\\\d{2,3}-?\\\\d{7,8}$/\",\"message\":\"请输入正确的电话号码\",\"messageI18nCode\":\"sys.validate.telephone\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"phone\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入联系电话\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":100,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem439010\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"邮箱\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506525554,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^[a-z0-9]+([._\\\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/\",\"message\":\"请输入正确的邮箱\",\"messageI18nCode\":\"sys.validate.email\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"email\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":100,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem7fa940\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"网站\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528130,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"website\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入网站\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":200,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5b2d2b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528353,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"address\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入地址\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"ableRelationIds\":[],\"clearable\":true,\"__config__\":{\"formId\":\"formItemf4ca17\",\"yunzhupaasKey\":\"userSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":\"\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"销售责任人\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_customer\",\"renderKey\":1776918111506,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-user\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasUserSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"ableIds\":[],\"multiple\":false,\"__vModel__\":\"yunzhupaas_mdm_customer_yunzhupaas_major_person_id\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"placeholder\":\"请选择\",\"relationField\":\"\"},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_customer\",\"renderKey\":1776918157184,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem379bfe\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"customerLevel\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"客户级别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"multiple\":false,\"__vModel__\":\"yunzhupaas_mdm_customer_yunzhupaas_customer_level\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"}},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_customer\",\"renderKey\":1776918191565,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem68763d\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"customerSource\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"客户来源\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"multiple\":false,\"__vModel__\":\"yunzhupaas_mdm_customer_yunzhupaas_customer_source\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"}},{\"autoSize\":{\"minRows\":3,\"maxRows\":3},\"clearable\":true,\"showCount\":false,\"__config__\":{\"formId\":\"formItem8cbf03\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"经营范围\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534652,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maxlength\":200,\"__vModel__\":\"business_scope\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入经营范围\"},{\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"clearable\":true,\"showCount\":false,\"__config__\":{\"formId\":\"formItem9f5e00\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534863,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"remark\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入备注\"},{\"__config__\":{\"formId\":\"formItemfe79ef\",\"yunzhupaasKey\":\"tab\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dragDisabled\":false,\"active\":\"1\",\"className\":[],\"label\":\"标签面板\",\"showLabel\":false,\"renderKey\":1774507317203,\"tableName\":\"mdm_company\",\"layout\":\"rowFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-label\",\"children\":[{\"__config__\":{\"formId\":\"formItem9787c7\",\"yunzhupaasKey\":\"tabItem\",\"children\":[{\"showSummary\":false,\"__config__\":{\"formId\":\"formItem46dc53\",\"yunzhupaasKey\":\"table\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"设计子表\",\"showLabel\":false,\"tableName\":\"mdm_company_invoice\",\"renderKey\":1774507347680,\"layout\":\"rowFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-table\",\"children\":[{\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"billRule\",\"parentVModel\":\"tableField46dc53\",\"dragDisabled\":false,\"rule\":\"InvoiceTitleCode\",\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754320599,\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"isSubTable\":true,\"ruleName\":\"发票抬头编码\",\"tag\":\"YunzhupaasInput\",\"formId\":\"formItem57f1d4\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"发票抬头编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"layout\":\"colFormItem\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"title_code\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"系统自动生成\"},{\"clearable\":true,\"maxlength\":10,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItema8b1f4\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"发票抬头名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507383593,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"title_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入联系人\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1963f0\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"纳税人识别号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507440273,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"credit_code\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入联系人职务\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"parentVModel\":\"tableField46dc53\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754396382,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemb3492f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"multiple\":false,\"__vModel__\":\"tax_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择纳税人类别\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"}},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItema9aaf2\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507448061,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"address\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入联系人邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItemf8b766\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754421983,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"phone\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入联系人邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1730ca\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户银行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754433217,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入联系人邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1089bb\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账户\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754444839,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_account\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入联系人邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"formId\":\"formItem4743e7\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否默认\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754525239,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"activeValue\":1,\"inactiveValue\":0,\"__vModel__\":\"is_defalut\",\"inactiveTxt\":\"关\",\"disabled\":false,\"activeTxt\":\"开\"},{\"__config__\":{\"formId\":\"formItema2b4cf\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否有效\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754540042,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"activeValue\":1,\"inactiveValue\":0,\"__vModel__\":\"is_valid\",\"inactiveTxt\":\"关\",\"disabled\":false,\"activeTxt\":\"开\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem560a27\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507449005,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"remark\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入备注\",\"prefixIcon\":\"\",\"addonBefore\":\"\"}],\"showTitle\":false,\"complexHeaderList\":[],\"tag\":\"YunzhupaasInputTable\",\"componentName\":\"table46dc53\",\"tableAlign\":\"left\",\"span\":24},\"defaultValue\":[],\"footerBtnsList\":[{\"btnIcon\":\"icon-ym icon-ym-btn-add\",\"show\":true,\"label\":\"添加\",\"btnType\":\"primary\",\"value\":\"add\",\"labelI18nCode\":\"common.add1Text\"},{\"btnIcon\":\"icon-ym icon-ym-btn-clearn\",\"showConfirm\":true,\"show\":true,\"label\":\"批量删除\",\"btnType\":\"danger\",\"value\":\"batchRemove\",\"labelI18nCode\":\"common.batchDelText\"}],\"defaultExpandAll\":true,\"__vModel__\":\"tableField46dc53\",\"layoutType\":\"table\",\"disabled\":false,\"columnBtnsList\":[{\"btnIcon\":\"icon-ym icon-ym-btn-edit\",\"show\":true,\"label\":\"复制\",\"btnType\":\"primary\",\"value\":\"copy\",\"labelI18nCode\":\"common.copyText\"},{\"btnIcon\":\"icon-ym icon-ym-btn-clearn\",\"showConfirm\":true,\"show\":true,\"label\":\"删除\",\"btnType\":\"danger\",\"value\":\"remove\",\"labelI18nCode\":\"common.delText\"}],\"summaryField\":[]}],\"renderKey\":1774507317203},\"name\":\"1\",\"title\":\"发票抬头\"},{\"__config__\":{\"formId\":\"formItemc68c47\",\"yunzhupaasKey\":\"tabItem\",\"children\":[{\"showSummary\":false,\"__config__\":{\"formId\":\"formItemad9d92\",\"yunzhupaasKey\":\"table\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"设计子表\",\"showLabel\":false,\"tableName\":\"mdm_company_bank\",\"renderKey\":1774507573802,\"layout\":\"rowFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-table\",\"children\":[{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem3756b9\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507591361,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入开户行\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemf42745\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"账户名\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507611465,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_account_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入账户名\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem8abffe\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507627371,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_account_number\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入银行账号\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemb870cb\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行城市\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507627772,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_province\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入开户行城市\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":200,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemf22092\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507628423,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"remark\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入备注\",\"prefixIcon\":\"\",\"addonBefore\":\"\"}],\"showTitle\":false,\"complexHeaderList\":[],\"tag\":\"YunzhupaasInputTable\",\"componentName\":\"tablead9d92\",\"tableAlign\":\"left\",\"span\":24},\"defaultValue\":[],\"footerBtnsList\":[{\"btnIcon\":\"icon-ym icon-ym-btn-add\",\"show\":true,\"label\":\"添加\",\"btnType\":\"primary\",\"value\":\"add\",\"labelI18nCode\":\"common.add1Text\"},{\"btnIcon\":\"icon-ym icon-ym-btn-clearn\",\"showConfirm\":true,\"show\":true,\"label\":\"批量删除\",\"btnType\":\"danger\",\"value\":\"batchRemove\",\"labelI18nCode\":\"common.batchDelText\"}],\"defaultExpandAll\":true,\"__vModel__\":\"tableFieldad9d92\",\"layoutType\":\"table\",\"disabled\":false,\"columnBtnsList\":[{\"btnIcon\":\"icon-ym icon-ym-btn-edit\",\"show\":true,\"label\":\"复制\",\"btnType\":\"primary\",\"value\":\"copy\",\"labelI18nCode\":\"common.copyText\"},{\"btnIcon\":\"icon-ym icon-ym-btn-clearn\",\"showConfirm\":true,\"show\":true,\"label\":\"删除\",\"btnType\":\"danger\",\"value\":\"remove\",\"labelI18nCode\":\"common.delText\"}],\"summaryField\":[]}],\"renderKey\":1774507317203},\"name\":\"2\",\"title\":\"银行卡信息\"}],\"tag\":\"ATab\",\"componentName\":\"tabfe79ef\",\"span\":24},\"tabPosition\":\"top\",\"type\":\"\"}],\"detailExtraList\":[],\"span\":24,\"dataLog\":false}"); return sb.toString(); + } + /** 列表字段配置json */ + public static final String getColumnData(){ + StringBuilder sb = new StringBuilder(); + sb.append("{\"showSummary\":false,\"treePropsValue\":\"id\",\"columnOptions\":[{\"buttonStyle\":\"solid\",\"fullName\":\"伙伴性质\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"optionType\":\"default\",\"__config__\":{\"yunzhupaasKey\":\"radio\",\"defaultValue\":\"EXT\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776918211021,\"tagIcon\":\"icon-ym icon-ym-generator-radio\",\"tag\":\"YunzhupaasRadio\",\"formId\":\"formItem97bed8\",\"visibility\":[\"pc\",\"app\"],\"noShow\":true,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"伙伴性质\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"size\":\"default\",\"options\":[{\"fullName\":\"内部\",\"id\":\"INT\"},{\"fullName\":\"外部\",\"id\":\"EXT\"}],\"__vModel__\":\"company_scope\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"company_scope\",\"direction\":\"horizontal\"},{\"__config__\":{\"formId\":\"formItem7a91b8\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"CorporationCode\",\"className\":[],\"label\":\"企业编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776916036468,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"法人单位编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":8},\"readonly\":true,\"__vModel__\":\"company_code\",\"fullName\":\"企业编码\",\"fullNameI18nCode\":[\"\"],\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"company_code\",\"placeholder\":\"系统自动生成\"},{\"clearable\":true,\"maxlength\":200,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"企业名称\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem478e5c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"企业名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506482470,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"company_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"company_name\",\"placeholder\":\"请输入企业名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"简称/昵称\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem84e51c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"简称/昵称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506482631,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"short_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"short_name\",\"placeholder\":\"请输入简称/昵称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"buttonStyle\":\"solid\",\"fullName\":\"类型\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"optionType\":\"default\",\"__config__\":{\"yunzhupaasKey\":\"radio\",\"defaultValue\":\"ORG\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506487223,\"tagIcon\":\"icon-ym icon-ym-generator-radio\",\"tag\":\"YunzhupaasRadio\",\"formId\":\"formItemb3f6cd\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"size\":\"default\",\"options\":[{\"fullName\":\"企业\",\"id\":\"ORG\"},{\"fullName\":\"个人\",\"id\":\"IND\"}],\"__vModel__\":\"entity_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"entity_type\",\"direction\":\"horizontal\"},{\"clearable\":true,\"maxlength\":100,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"社会信用代码\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem10350c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"社会信用代码\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506494880,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"credit_code\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"credit_code\",\"placeholder\":\"请输入社会信用代码\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"归属组织\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"formId\":\"formItemfc6848\",\"yunzhupaasKey\":\"organizeSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"归属组织\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776912270086,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasOrganizeSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"org_id\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"org_id\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"level\":2,\"multiple\":false,\"fullName\":\"所属地区\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"formId\":\"formItemcc9deb\",\"yunzhupaasKey\":\"areaSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属地区\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507118587,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-Provinces\",\"tag\":\"YunzhupaasAreaSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"province_id\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"province_id\",\"placeholder\":\"请选择所属地区\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"纳税人类别\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503586,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem05d07f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_type\",\"placeholder\":\"请选择纳税人类别\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"企业规模\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503806,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem66e88f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"enterpriseScale\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业规模\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"enterprise_scale\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_scale\",\"placeholder\":\"请选择企业规模\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"企业类型\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506504118,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItema76b83\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"9b542177a477488994ce09fff3c93901\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"enterprise_nature\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_nature\",\"placeholder\":\"请选择企业类型\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"行业代码\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506507062,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem6bd8a7\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"d59a3cf65f9847dbb08be449e3feae16\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"行业代码\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"industry_code\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"industry_code\",\"placeholder\":\"请选择行业代码\"},{\"clearable\":true,\"format\":\"yyyy-MM-dd\",\"fullName\":\"成立日期\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506509988,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItembab00e\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"成立日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"registration_date\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"registration_date\",\"placeholder\":\"请选择成立日期\"},{\"controls\":false,\"max\":999999,\"precision\":4,\"fullName\":\"注册资本\",\"fullNameI18nCode\":[\"\"],\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"万元\",\"__config__\":{\"formId\":\"formItem3134b1\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"注册资本\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506514957,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"registered_capital\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"registered_capital\",\"placeholder\":\"请输入注册资本\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"法定代表人\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem4f2d0b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"法定代表人\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524679,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"legal_representative\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"legal_representative\",\"placeholder\":\"请输入法定代表人\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":11,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"联系电话\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem97bd9d\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"联系电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524966,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^1[3456789]\\\\d{9}$|^0\\\\d{2,3}-?\\\\d{7,8}$/\",\"message\":\"请输入正确的电话号码\",\"messageI18nCode\":\"sys.validate.telephone\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"phone\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"phone\",\"placeholder\":\"请输入联系电话\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":100,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"邮箱\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem439010\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"邮箱\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506525554,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^[a-z0-9]+([._\\\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/\",\"message\":\"请输入正确的邮箱\",\"messageI18nCode\":\"sys.validate.email\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"email\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"email\",\"placeholder\":\"请输入邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":100,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"网站\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem7fa940\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"网站\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528130,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"website\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"website\",\"placeholder\":\"请输入网站\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":200,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"地址\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5b2d2b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528353,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"address\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"address\",\"placeholder\":\"请输入地址\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"ableRelationIds\":[],\"clearable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"销售责任人\",\"fullNameI18nCode\":[\"\"],\"relationField\":\"\",\"__config__\":{\"formId\":\"formItemf4ca17\",\"yunzhupaasKey\":\"userSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":\"\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"销售责任人\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_customer\",\"renderKey\":1776918111506,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-user\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasUserSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"yunzhupaas_mdm_customer_yunzhupaas_major_person_id\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"yunzhupaas_mdm_customer_yunzhupaas_major_person_id\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"客户级别。关联字典:客户级别(CustomerLevel)\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_customer\",\"renderKey\":1776918157184,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem379bfe\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"客户级别。关联字典:客户级别(CustomerLevel)\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"options\":[{\"fullName\":\"选项一\",\"id\":\"1\"},{\"fullName\":\"选项二\",\"id\":\"2\"}],\"__vModel__\":\"yunzhupaas_mdm_customer_yunzhupaas_customer_level\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"yunzhupaas_mdm_customer_yunzhupaas_customer_level\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"客户来源。关联字典:客户来源(CustomerSource)\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_customer\",\"renderKey\":1776918191565,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem68763d\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"客户来源。关联字典:客户来源(CustomerSource)\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"options\":[{\"fullName\":\"选项一\",\"id\":\"1\"},{\"fullName\":\"选项二\",\"id\":\"2\"}],\"__vModel__\":\"yunzhupaas_mdm_customer_yunzhupaas_customer_source\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"yunzhupaas_mdm_customer_yunzhupaas_customer_source\",\"placeholder\":\"请选择\"},{\"clearable\":true,\"maxlength\":200,\"fullName\":\"经营范围\",\"fullNameI18nCode\":[\"\"],\"autoSize\":{\"minRows\":3,\"maxRows\":3},\"showCount\":false,\"__config__\":{\"formId\":\"formItem8cbf03\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"经营范围\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534652,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"business_scope\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"business_scope\",\"placeholder\":\"请输入经营范围\"},{\"clearable\":true,\"fullName\":\"备注\",\"fullNameI18nCode\":[\"\"],\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"showCount\":false,\"__config__\":{\"formId\":\"formItem9f5e00\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534863,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"remark\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"remark\",\"placeholder\":\"请输入备注\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-开户行\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem3756b9\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507591361,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldad9d92-bank_name\",\"placeholder\":\"请输入开户行\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-账户名\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemf42745\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"账户名\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507611465,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_account_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldad9d92-bank_account_name\",\"placeholder\":\"请输入账户名\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-银行账号\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem8abffe\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507627371,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_account_number\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldad9d92-bank_account_number\",\"placeholder\":\"请输入银行账号\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-开户行城市\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemb870cb\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行城市\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507627772,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_province\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldad9d92-bank_province\",\"placeholder\":\"请输入开户行城市\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":200,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-备注\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemf22092\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507628423,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"remark\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldad9d92-remark\",\"placeholder\":\"请输入备注\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"billRule\",\"parentVModel\":\"tableField46dc53\",\"dragDisabled\":false,\"rule\":\"InvoiceTitleCode\",\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754320599,\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"isSubTable\":true,\"ruleName\":\"发票抬头编码\",\"tag\":\"YunzhupaasInput\",\"formId\":\"formItem57f1d4\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"发票抬头编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"layout\":\"colFormItem\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"title_code\",\"fullName\":\"设计子表-发票抬头编码\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-title_code\",\"placeholder\":\"系统自动生成\"},{\"clearable\":true,\"maxlength\":10,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-发票抬头名称\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItema8b1f4\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"发票抬头名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507383593,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"title_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-title_name\",\"placeholder\":\"请输入联系人\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-纳税人识别号\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1963f0\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"纳税人识别号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507440273,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"credit_code\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-credit_code\",\"placeholder\":\"请输入联系人职务\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"设计子表-纳税人类别\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"parentVModel\":\"tableField46dc53\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754396382,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemb3492f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-tax_type\",\"placeholder\":\"请选择纳税人类别\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-地址\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItema9aaf2\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507448061,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"address\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-address\",\"placeholder\":\"请输入联系人邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-电话\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItemf8b766\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754421983,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"phone\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-phone\",\"placeholder\":\"请输入联系人邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-开户银行\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1730ca\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户银行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754433217,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-bank_name\",\"placeholder\":\"请输入联系人邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-银行账户\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1089bb\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账户\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754444839,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_account\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-bank_account\",\"placeholder\":\"请输入联系人邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"formId\":\"formItem4743e7\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否默认\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754525239,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"activeValue\":1,\"inactiveValue\":0,\"__vModel__\":\"is_defalut\",\"fullName\":\"设计子表-是否默认\",\"inactiveTxt\":\"关\",\"fullNameI18nCode\":[\"\",\"\"],\"disabled\":false,\"activeTxt\":\"开\",\"id\":\"tableField46dc53-is_defalut\"},{\"__config__\":{\"formId\":\"formItema2b4cf\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否有效\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754540042,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"activeValue\":1,\"inactiveValue\":0,\"__vModel__\":\"is_valid\",\"fullName\":\"设计子表-是否有效\",\"inactiveTxt\":\"关\",\"fullNameI18nCode\":[\"\",\"\"],\"disabled\":false,\"activeTxt\":\"开\",\"id\":\"tableField46dc53-is_valid\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-备注\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem560a27\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507449005,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"remark\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-remark\",\"placeholder\":\"请输入备注\",\"prefixIcon\":\"\",\"addonBefore\":\"\"}],\"pageSize\":20,\"type\":1,\"columnBtnsList\":[{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-edit\",\"label\":\"编辑\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"edit\",\"labelI18nCode\":\"common.editText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"删除\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"remove\",\"labelI18nCode\":\"common.delText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-generator-menu\",\"label\":\"详情\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"detail\",\"labelI18nCode\":\"common.detailText\"}],\"treeTitle\":\"左侧标题\",\"defaultColumnList\":[{\"yunzhupaasKey\":\"radio\",\"resizable\":true,\"buttonStyle\":\"solid\",\"fullName\":\"伙伴性质\",\"fullNameI18nCode\":[\"\"],\"label\":\"伙伴性质\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"optionType\":\"default\",\"__config__\":{\"yunzhupaasKey\":\"radio\",\"defaultValue\":\"EXT\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776918211021,\"tagIcon\":\"icon-ym icon-ym-generator-radio\",\"tag\":\"YunzhupaasRadio\",\"formId\":\"formItem97bed8\",\"visibility\":[\"pc\",\"app\"],\"noShow\":true,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"伙伴性质\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"size\":\"default\",\"prop\":\"company_scope\",\"options\":[{\"fullName\":\"内部\",\"id\":\"INT\"},{\"fullName\":\"外部\",\"id\":\"EXT\"}],\"__vModel__\":\"company_scope\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"company_scope\",\"labelI18nCode\":\"\",\"direction\":\"horizontal\"},{\"yunzhupaasKey\":\"billRule\",\"resizable\":true,\"fullName\":\"企业编码\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业编码\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItem7a91b8\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"CorporationCode\",\"className\":[],\"label\":\"企业编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776916036468,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"法人单位编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":8},\"readonly\":true,\"prop\":\"company_code\",\"__vModel__\":\"company_code\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"company_code\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem478e5c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"企业名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506482470,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"company_name\",\"__vModel__\":\"company_name\",\"checked\":true,\"disabled\":false,\"id\":\"company_name\",\"placeholder\":\"请输入企业名称\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"企业名称\",\"label\":\"企业名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem84e51c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"简称/昵称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506482631,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"short_name\",\"__vModel__\":\"short_name\",\"checked\":true,\"disabled\":false,\"id\":\"short_name\",\"placeholder\":\"请输入简称/昵称\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"简称/昵称\",\"label\":\"简称/昵称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"radio\",\"resizable\":true,\"buttonStyle\":\"solid\",\"fullName\":\"类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"optionType\":\"default\",\"__config__\":{\"yunzhupaasKey\":\"radio\",\"defaultValue\":\"ORG\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506487223,\"tagIcon\":\"icon-ym icon-ym-generator-radio\",\"tag\":\"YunzhupaasRadio\",\"formId\":\"formItemb3f6cd\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"size\":\"default\",\"prop\":\"entity_type\",\"options\":[{\"fullName\":\"企业\",\"id\":\"ORG\"},{\"fullName\":\"个人\",\"id\":\"IND\"}],\"__vModel__\":\"entity_type\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"entity_type\",\"labelI18nCode\":\"\",\"direction\":\"horizontal\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem10350c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"社会信用代码\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506494880,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"credit_code\",\"__vModel__\":\"credit_code\",\"checked\":true,\"disabled\":false,\"id\":\"credit_code\",\"placeholder\":\"请输入社会信用代码\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":100,\"fullName\":\"社会信用代码\",\"label\":\"社会信用代码\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"organizeSelect\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"归属组织\",\"fullNameI18nCode\":[\"\"],\"label\":\"归属组织\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItemfc6848\",\"yunzhupaasKey\":\"organizeSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"归属组织\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776912270086,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasOrganizeSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"org_id\",\"__vModel__\":\"org_id\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"org_id\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"areaSelect\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"level\":2,\"multiple\":false,\"fullName\":\"所属地区\",\"fullNameI18nCode\":[\"\"],\"label\":\"所属地区\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItemcc9deb\",\"yunzhupaasKey\":\"areaSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属地区\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507118587,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-Provinces\",\"tag\":\"YunzhupaasAreaSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"province_id\",\"__vModel__\":\"province_id\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"province_id\",\"placeholder\":\"请选择所属地区\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"纳税人类别\",\"fullNameI18nCode\":[\"\"],\"label\":\"纳税人类别\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503586,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem05d07f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"tax_type\",\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_type\",\"placeholder\":\"请选择纳税人类别\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"企业规模\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业规模\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503806,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem66e88f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"enterpriseScale\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业规模\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"enterprise_scale\",\"__vModel__\":\"enterprise_scale\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_scale\",\"placeholder\":\"请选择企业规模\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"企业类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506504118,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItema76b83\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"9b542177a477488994ce09fff3c93901\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"enterprise_nature\",\"__vModel__\":\"enterprise_nature\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_nature\",\"placeholder\":\"请选择企业类型\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"行业代码\",\"fullNameI18nCode\":[\"\"],\"label\":\"行业代码\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506507062,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem6bd8a7\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"d59a3cf65f9847dbb08be449e3feae16\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"行业代码\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"industry_code\",\"__vModel__\":\"industry_code\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"industry_code\",\"placeholder\":\"请选择行业代码\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"datePicker\",\"clearable\":true,\"resizable\":true,\"format\":\"yyyy-MM-dd\",\"fullName\":\"成立日期\",\"fullNameI18nCode\":[\"\"],\"label\":\"成立日期\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506509988,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItembab00e\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"成立日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"registration_date\",\"__vModel__\":\"registration_date\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"registration_date\",\"placeholder\":\"请选择成立日期\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":4,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItem3134b1\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"注册资本\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506514957,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"registered_capital\",\"__vModel__\":\"registered_capital\",\"checked\":true,\"disabled\":false,\"id\":\"registered_capital\",\"placeholder\":\"请输入注册资本\",\"addonBefore\":\"\",\"resizable\":true,\"max\":999999,\"fullName\":\"注册资本\",\"label\":\"注册资本\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"万元\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem4f2d0b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"法定代表人\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524679,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"legal_representative\",\"__vModel__\":\"legal_representative\",\"checked\":true,\"disabled\":false,\"id\":\"legal_representative\",\"placeholder\":\"请输入法定代表人\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"法定代表人\",\"label\":\"法定代表人\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem97bd9d\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"联系电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524966,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^1[3456789]\\\\d{9}$|^0\\\\d{2,3}-?\\\\d{7,8}$/\",\"message\":\"请输入正确的电话号码\",\"messageI18nCode\":\"sys.validate.telephone\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"phone\",\"__vModel__\":\"phone\",\"checked\":true,\"disabled\":false,\"id\":\"phone\",\"placeholder\":\"请输入联系电话\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":11,\"fullName\":\"联系电话\",\"label\":\"联系电话\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem439010\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"邮箱\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506525554,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^[a-z0-9]+([._\\\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/\",\"message\":\"请输入正确的邮箱\",\"messageI18nCode\":\"sys.validate.email\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"email\",\"__vModel__\":\"email\",\"checked\":true,\"disabled\":false,\"id\":\"email\",\"placeholder\":\"请输入邮箱\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":100,\"fullName\":\"邮箱\",\"label\":\"邮箱\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"a"); + sb.append("lign\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem7fa940\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"网站\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528130,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"website\",\"__vModel__\":\"website\",\"checked\":true,\"disabled\":false,\"id\":\"website\",\"placeholder\":\"请输入网站\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":100,\"fullName\":\"网站\",\"label\":\"网站\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5b2d2b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528353,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"address\",\"__vModel__\":\"address\",\"checked\":true,\"disabled\":false,\"id\":\"address\",\"placeholder\":\"请输入地址\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"地址\",\"label\":\"地址\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"ableRelationIds\":[],\"yunzhupaasKey\":\"userSelect\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"__config__\":{\"formId\":\"formItemf4ca17\",\"yunzhupaasKey\":\"userSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":\"\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"销售责任人\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_customer\",\"renderKey\":1776918111506,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-user\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasUserSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"yunzhupaas_mdm_customer_yunzhupaas_major_person_id\",\"__vModel__\":\"yunzhupaas_mdm_customer_yunzhupaas_major_person_id\",\"checked\":false,\"selectType\":\"all\",\"disabled\":false,\"id\":\"yunzhupaas_mdm_customer_yunzhupaas_major_person_id\",\"placeholder\":\"请选择\",\"clearable\":true,\"resizable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"销售责任人\",\"label\":\"销售责任人\",\"sortable\":false,\"relationField\":\"\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"客户级别。关联字典:客户级别(CustomerLevel)\",\"fullNameI18nCode\":[\"\"],\"label\":\"客户级别。关联字典:客户级别(CustomerLevel)\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_customer\",\"renderKey\":1776918157184,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem379bfe\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"客户级别。关联字典:客户级别(CustomerLevel)\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"yunzhupaas_mdm_customer_yunzhupaas_customer_level\",\"options\":[{\"fullName\":\"选项一\",\"id\":\"1\"},{\"fullName\":\"选项二\",\"id\":\"2\"}],\"__vModel__\":\"yunzhupaas_mdm_customer_yunzhupaas_customer_level\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"yunzhupaas_mdm_customer_yunzhupaas_customer_level\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"客户来源。关联字典:客户来源(CustomerSource)\",\"fullNameI18nCode\":[\"\"],\"label\":\"客户来源。关联字典:客户来源(CustomerSource)\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_customer\",\"renderKey\":1776918191565,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem68763d\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"客户来源。关联字典:客户来源(CustomerSource)\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"yunzhupaas_mdm_customer_yunzhupaas_customer_source\",\"options\":[{\"fullName\":\"选项一\",\"id\":\"1\"},{\"fullName\":\"选项二\",\"id\":\"2\"}],\"__vModel__\":\"yunzhupaas_mdm_customer_yunzhupaas_customer_source\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"yunzhupaas_mdm_customer_yunzhupaas_customer_source\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"经营范围\",\"fullNameI18nCode\":[\"\"],\"label\":\"经营范围\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":3,\"maxRows\":3},\"showCount\":false,\"__config__\":{\"formId\":\"formItem8cbf03\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"经营范围\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534652,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"business_scope\",\"__vModel__\":\"business_scope\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"business_scope\",\"placeholder\":\"请输入经营范围\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"fullName\":\"备注\",\"fullNameI18nCode\":[\"\"],\"label\":\"备注\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"showCount\":false,\"__config__\":{\"formId\":\"formItem9f5e00\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534863,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"remark\",\"__vModel__\":\"remark\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"remark\",\"placeholder\":\"请输入备注\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem3756b9\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507591361,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldad9d92-bank_name\",\"__vModel__\":\"bank_name\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldad9d92-bank_name\",\"placeholder\":\"请输入开户行\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"设计子表-开户行\",\"label\":\"设计子表-开户行\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemf42745\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"账户名\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507611465,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldad9d92-bank_account_name\",\"__vModel__\":\"bank_account_name\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldad9d92-bank_account_name\",\"placeholder\":\"请输入账户名\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"设计子表-账户名\",\"label\":\"设计子表-账户名\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem8abffe\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507627371,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldad9d92-bank_account_number\",\"__vModel__\":\"bank_account_number\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldad9d92-bank_account_number\",\"placeholder\":\"请输入银行账号\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"设计子表-银行账号\",\"label\":\"设计子表-银行账号\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemb870cb\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行城市\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507627772,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldad9d92-bank_province\",\"__vModel__\":\"bank_province\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldad9d92-bank_province\",\"placeholder\":\"请输入开户行城市\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"设计子表-开户行城市\",\"label\":\"设计子表-开户行城市\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemf22092\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507628423,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldad9d92-remark\",\"__vModel__\":\"remark\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldad9d92-remark\",\"placeholder\":\"请输入备注\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"设计子表-备注\",\"label\":\"设计子表-备注\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"billRule\",\"resizable\":true,\"fullName\":\"设计子表-发票抬头编码\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"设计子表-发票抬头编码\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"billRule\",\"parentVModel\":\"tableField46dc53\",\"dragDisabled\":false,\"rule\":\"InvoiceTitleCode\",\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754320599,\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"isSubTable\":true,\"ruleName\":\"发票抬头编码\",\"tag\":\"YunzhupaasInput\",\"formId\":\"formItem57f1d4\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"发票抬头编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"layout\":\"colFormItem\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField46dc53-title_code\",\"__vModel__\":\"title_code\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField46dc53-title_code\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItema8b1f4\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"发票抬头名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507383593,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-title_name\",\"__vModel__\":\"title_name\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-title_name\",\"placeholder\":\"请输入联系人\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":10,\"fullName\":\"设计子表-发票抬头名称\",\"label\":\"设计子表-发票抬头名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1963f0\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"纳税人识别号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507440273,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-credit_code\",\"__vModel__\":\"credit_code\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-credit_code\",\"placeholder\":\"请输入联系人职务\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"设计子表-纳税人识别号\",\"label\":\"设计子表-纳税人识别号\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"设计子表-纳税人类别\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"设计子表-纳税人类别\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"parentVModel\":\"tableField46dc53\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754396382,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemb3492f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"tableField46dc53-tax_type\",\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-tax_type\",\"placeholder\":\"请选择纳税人类别\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItema9aaf2\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507448061,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-address\",\"__vModel__\":\"address\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-address\",\"placeholder\":\"请输入联系人邮箱\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"设计子表-地址\",\"label\":\"设计子表-地址\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItemf8b766\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754421983,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-phone\",\"__vModel__\":\"phone\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-phone\",\"placeholder\":\"请输入联系人邮箱\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"设计子表-电话\",\"label\":\"设计子表-电话\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1730ca\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户银行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754433217,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-bank_name\",\"__vModel__\":\"bank_name\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-bank_name\",\"placeholder\":\"请输入联系人邮箱\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"设计子表-开户银行\",\"label\":\"设计子表-开户银行\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1089bb\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账户\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754444839,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-bank_account\",\"__vModel__\":\"bank_account\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-bank_account\",\"placeholder\":\"请输入联系人邮箱\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"设计子表-银行账户\",\"label\":\"设计子表-银行账户\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"switch\",\"resizable\":true,\"activeValue\":1,\"inactiveValue\":0,\"fullName\":\"设计子表-是否默认\",\"inactiveTxt\":\"关\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"设计子表-是否默认\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItem4743e7\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否默认\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754525239,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"tableField46dc53-is_defalut\",\"__vModel__\":\"is_defalut\",\"checked\":false,\"fixed\":\"none\",\"disabled\":false,\"activeTxt\":\"开\",\"id\":\"tableField46dc53-is_defalut\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"switch\",\"resizable\":true,\"activeValue\":1,\"inactiveValue\":0,\"fullName\":\"设计子表-是否有效\",\"inactiveTxt\":\"关\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"设计子表-是否有效\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItema2b4cf\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否有效\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754540042,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"tableField46dc53-is_valid\",\"__vModel__\":\"is_valid\",\"checked\":false,\"fixed\":\"none\",\"disabled\":false,\"activeTxt\":\"开\",\"id\":\"tableField46dc53-is_valid\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem560a27\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507449005,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-remark\",\"__vModel__\":\"remark\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-remark\",\"placeholder\":\"请输入备注\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"设计子表-备注\",\"label\":\"设计子表-备注\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"}],\"treeRelationFieldAbleIds\":[],\"treeSyncInterfaceName\":\"\",\"treeSyncTemplateJson\":[],\"treeRelation\":\"\",\"defaultSortConfig\":[],\"tabConfig\":{\"hasAllTab\":true,\"relationField\":\"\",\"on\":false},\"hasSuperQuery\":true,\"treePropsLabel\":\"fullName\",\"groupField\":\"\",\"printIds\":[],\"uploaderTemplateJson\":{\"selectKey\":[\"company_name\",\"credit_code\",\"org_id\",\"company_code\",\"short_name\",\"entity_type\",\"company_scope\",\"tax_type\",\"enterprise_scale\",\"enterprise_nature\",\"industry_code\",\"registration_date\",\"registered_capital\",\"legal_representative\",\"phone\",\"email\",\"website\",\"address\",\"province_id\",\"business_scope\",\"remark\",\"tableFieldad9d92-bank_name\",\"tableFieldad9d92-bank_account_name\",\"tableFieldad9d92-bank_account_number\",\"tableFieldad9d92-bank_province\",\"tableFieldad9d92-remark\",\"tableField46dc53-title_name\",\"tableField46dc53-credit_code\",\"tableField46dc53-tax_type\",\"tableField46dc53-address\",\"tableField46dc53-phone\",\"tableField46dc53-bank_name\",\"tableField46dc53-bank_account\",\"tableField46dc53-is_defalut\",\"tableField46dc53-is_valid\",\"tableField46dc53-remark\"],\"dataType\":\"2\"},\"hasTreeQuery\":false,\"useFormPermission\":true,\"complexHeaderList\":[],\"useBtnPermission\":true,\"treeSyncType\":0,\"hasPage\":true,\"searchList\":[{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"showCount\":false,\"__config__\":{\"formId\":\"formItem478e5c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"企业名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506482470,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"company_name\",\"__vModel__\":\"company_name\",\"searchMultiple\":false,\"disabled\":false,\"id\":\"company_name\",\"placeholder\":\"请输入企业名称\",\"addonBefore\":\"\",\"clearable\":true,\"searchType\":2,\"maxlength\":200,\"fullName\":\"企业名称\",\"label\":\"企业名称\",\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"isKeyword\":false,\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"organizeSelect\",\"filterable\":false,\"clearable\":true,\"searchType\":1,\"ableIds\":[],\"multiple\":false,\"fullName\":\"归属组织\",\"fullNameI18nCode\":[\"\"],\"label\":\"归属组织\",\"__config__\":{\"formId\":\"formItemfc6848\",\"yunzhupaasKey\":\"organizeSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"归属组织\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776912270086,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasOrganizeSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"org_id\",\"__vModel__\":\"org_id\",\"searchMultiple\":true,\"isKeyword\":false,\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"org_id\",\"placeholder\":\"请选择\",\"value\":[],\"labelI18nCode\":\"\"}],\"ruleList\":{\"conditionList\":[{\"groups\":[{\"ableRelationIds\":[],\"symbol\":\"notNull\",\"yunzhupaasKey\":\"userSelect\",\"clearable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"销售责任人\",\"fullNameI18nCode\":[\"\"],\"relationField\":\"\",\"fieldValueYunzhupaasKey\":\"\",\"__config__\":{\"formId\":\"formItemf4ca17\",\"yunzhupaasKey\":\"userSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":\"\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"销售责任人\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_customer\",\"renderKey\":1776918111506,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-user\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasUserSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"field\":\"yunzhupaas_mdm_customer_yunzhupaas_major_person_id\",\"__vModel__\":\"yunzhupaas_mdm_customer_yunzhupaas_major_person_id\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":true,\"cellKey\":1776918329044,\"id\":\"yunzhupaas_mdm_customer_yunzhupaas_major_person_id\",\"placeholder\":\"请选择\",\"fieldValueType\":2}],\"logic\":\"and\"}],\"matchLogic\":\"and\"},\"childTableStyle\":1,\"treePropsChildren\":\"children\",\"treeRelationFieldSelectType\":\"all\",\"showOverflow\":true,\"treeTemplateJson\":[],\"treeTitleI18nCode\":\"\",\"treePropsName\":\"\",\"useColumnPermission\":true,\"treePropsUrl\":\"\",\"btnsList\":[{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-add\",\"label\":\"新增\",\"value\":\"add\",\"labelI18nCode\":\"common.add2Text\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-download\",\"label\":\"导出\",\"value\":\"download\",\"labelI18nCode\":\"common.exportText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-upload\",\"label\":\"导入\",\"value\":\"upload\",\"labelI18nCode\":\"common.importText\"},{\"show\":false,\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"批量删除\",\"value\":\"batchRemove\",\"labelI18nCode\":\"common.batchDelText\"},{\"show\":false,\"icon\":\"icon-ym icon-ym-report-icon-preview-printPreview\",\"label\":\"批量打印\",\"value\":\"batchPrint\",\"labelI18nCode\":\"common.batchPrintText\"}],\"useDataPermission\":true,\"viewKey\":\"\",\"columnList\":[{\"yunzhupaasKey\":\"billRule\",\"resizable\":true,\"fullName\":\"企业编码\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业编码\",\"sortable\":true,\"align\":\"left\",\"__config__\":{\"formId\":\"formItem7a91b8\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"CorporationCode\",\"className\":[],\"label\":\"企业编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776916036468,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"法人单位编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":8},\"readonly\":true,\"prop\":\"company_code\",\"__vModel__\":\"company_code\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"company_code\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem478e5c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"企业名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506482470,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"company_name\",\"__vModel__\":\"company_name\",\"disabled\":false,\"id\":\"company_name\",\"placeholder\":\"请输入企业名称\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"企业名称\",\"label\":\"企业名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem84e51c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"简称/昵称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506482631,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"short_name\",\"__vModel__\":\"short_name\",\"disabled\":false,\"id\":\"short_name\",\"placeholder\":\"请输入简称/昵称\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"简称/昵称\",\"label\":\"简称/昵称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"organizeSelect\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"归属组织\",\"fullNameI18nCode\":[\"\"],\"label\":\"归属组织\",\"sortable\":true,\"align\":\"left\",\"__config__\":{\"formId\":\"formItemfc6848\",\"yunzhupaasKey\":\"organizeSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"归属组织\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776912270086,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasOrganizeSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"org_id\",\"__vModel__\":\"org_id\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"org_id\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"radio\",\"resizable\":true,\"buttonStyle\":\"solid\",\"fullName\":\"类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"optionType\":\"default\",\"__config__\":{\"yunzhupaasKey\":\"radio\",\"defaultValue\":\"ORG\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506487223,\"tagIcon\":\"icon-ym icon-ym-generator-radio\",\"tag\":\"YunzhupaasRadio\",\"formId\":\"formItemb3f6cd\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"size\":\"default\",\"prop\":\"entity_type\",\"options\":[{\"fullName\":\"企业\",\"id\":\"ORG\"},{\"fullName\":\"个人\",\"id\":\"IND\"}],\"__vModel__\":\"entity_type\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"entity_type\",\"labelI18nCode\":\"\",\"direction\":\"horizontal\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem10350c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"社会信用代码\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506494880,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"credit_code\",\"__vModel__\":\"credit_code\",\"disabled\":false,\"id\":\"credit_code\",\"placeholder\":\"请输入社会信用代码\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":100,\"fullName\":\"社会信用代码\",\"label\":\"社会信用代码\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"radio\",\"resizable\":true,\"buttonStyle\":\"solid\",\"fullName\":\"伙伴性质\",\"fullNameI18nCode\":[\"\"],\"label\":\"伙伴性质\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"optionType\":\"default\",\"__config__\":{\"yunzhupaasKey\":\"radio\",\"defaultValue\":\"EXT\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776918211021,\"tagIcon\":\"icon-ym icon-ym-generator-radio\",\"tag\":\"YunzhupaasRadio\",\"formId\":\"formItem97bed8\",\"visibility\":[\"pc\",\"app\"],\"noShow\":true,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"伙伴性质\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"size\":\"default\",\"prop\":\"company_scope\",\"options\":[{\"fullName\":\"内部\",\"id\":\"INT\"},{\"fullName\":\"外部\",\"id\":\"EXT\"}],\"__vModel__\":\"company_scope\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"company_scope\",\"labelI18nCode\":\"\",\"direction\":\"horizontal\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"纳税人类别\",\"fullNameI18nCode\":[\"\"],\"label\":\"纳税人类别\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503586,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem05d07f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"tax_type\",\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_type\",\"placeholder\":\"请选择纳税人类别\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"企业规模\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业规模\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503806,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem66e88f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"enterpriseScale\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业规模\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"enterprise_scale\",\"__vModel__\":\"enterprise_scale\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_scale\",\"placeholder\":\"请选择企业规模\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"企业类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506504118,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItema76b83\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"9b542177a477488994ce09fff3c93901\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"enterprise_nature\",\"__vModel__\":\"enterprise_nature\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_nature\",\"placeholder\":\"请选择企业类型\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"行业代码\",\"fullNameI18nCode\":[\"\"],\"label\":\"行业代码\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506507062,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem6bd8a7\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"d59a3cf65f9847dbb08be449e3feae16\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"行业代码\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"industry_code\",\"__vModel__\":\"industry_code\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"industry_code\",\"placeholder\":\"请选择行业代码\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"datePicker\",\"clearable\":true,\"resizable\":true,\"format\":\"yyyy-MM-dd\",\"fullName\":\"成立日期\",\"fullNameI18nCode\":[\"\"],\"label\":\"成立日期\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506509988,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItembab00e\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"成立日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"registration_date\",\"__vModel__\":\"registration_date\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"registration_date\",\"placeholder\":\"请选择成立日期\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":4,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItem3134b1\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"注册资本\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506514957,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"registered_capital\",\"__vModel__\":\"registered_capital\",\"disabled\":false,\"id\":\"registered_capital\",\"placeholder\":\"请输入注册资本\",\"addonBefore\":\"\",\"resizable\":true,\"max\":999999,\"fullName\":\"注册资本\",\"label\":\"注册资本\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"万元\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem4f2d0b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"法定代表人\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524679,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"legal_representative\",\"__vModel__\":\"legal_representative\",\"disabled\":false,\"id\":\"legal_representative\",\"placeholder\":\"请输入法定代表人\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"法定代表人\",\"label\":\"法定代表人\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem97bd9d\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"联系电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524966,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^1[3456789]\\\\d{9}$|^0\\\\d{2,3}-?\\\\d{7,8}$/\",\"message\":\"请输入正确的电话号码\",\"messageI18nCode\":\"sys.validate.telephone\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"phone\",\"__vModel__\":\"phone\",\"disabled\":false,\"id\":\"phone\",\"placeholder\":\"请输入联系电话\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":11,\"fullName\":\"联系电话\",\"label\":\"联系电话\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem439010\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"邮箱\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506525554,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^[a-z0-9]+([._\\\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/\",\"message\":\"请输入正确的邮箱\",\"messageI18nCode\":\"sys.validate.email\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"email\",\"__vModel__\":\"email\",\"disabled\":false,\"id\":\"email\",\"placeholder\":\"请输入邮箱\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":100,\"fullName\":\"邮箱\",\"label\":\"邮箱\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem7fa940\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"网站\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528130,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"website\",\"__vModel__\":\"website\",\"disabled\":false,\"id\":\"website\",\"placeholder\":\"请输入网站\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":100,\"fullName\":\"网站\",\"label\":\"网站\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5b2d2b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528353,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"address\",\"__vModel__\":\"address\",\"disabled\":false,\"id\":\"address\",\"placeholder\":\"请输入地址\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"地址\",\"label\":\"地址\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"areaSelect\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"level\":2,\"multiple\":false,\"fullName\":\"所属地区\",\"fullNameI18nCode\":[\"\"],\"label\":\"所属地区\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItemcc9deb\",\"yunzhupaasKey\":\"areaSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属地区\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507118587,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-Provinces\",\"tag\":\"YunzhupaasAreaSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"province_id\",\"__vModel__\":\"province_id\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"province_id\",\"placeholder\":\"请选择所属地区\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"经营范围\",\"fullNameI18nCode\":[\"\"],\"label\":\"经营范围\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":3,\"maxRows\":3},\"showCount\":false,\"__config__\":{\"formId\":\"formItem8cbf03\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"经营范围\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534652,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"business_scope\",\"__vModel__\":\"business_scope\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"business_scope\",\"placeholder\":\"请输入经营范围\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"fullName\":\"备注\",\"fullNameI18nCode\":[\"\"],\"label\":\"备注\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"showCount\":false,\"__config__\":{\"formId\":\"formItem9f5e00\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534863,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"remark\",\"__vModel__\":\"remark\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"remark\",\"placeholder\":\"请输入备注\",\"labelI18nCode\":\"\"}],\"summaryField\":[],\"parentField\":\"\",\"treeDataSource\":\"dictionary\",\"treeDictionary\":\"\",\"treeSyncInterfaceId\":\"\",\"customBtnsList\":[]}"); + return sb.toString(); + } + /** app列表字段配置json */ + public static final String getAppColumnData(){ + StringBuilder sb = new StringBuilder(); + sb.append("{\"hasPage\":true,\"useColumnPermission\":false,\"searchList\":[],\"btnsList\":[{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-add\",\"label\":\"新增\",\"value\":\"add\",\"labelI18nCode\":\"common.add2Text\"},{\"show\":false,\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"批量删除\",\"value\":\"batchRemove\",\"labelI18nCode\":\"common.batchDelText\"}],\"useDataPermission\":false,\"viewKey\":\"\",\"ruleListApp\":{\"conditionList\":[],\"matchLogic\":\"and\"},\"columnList\":[{\"yunzhupaasKey\":\"billRule\",\"resizable\":true,\"fullName\":\"企业编码\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业编码\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItem7a91b8\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"CorporationCode\",\"className\":[],\"label\":\"企业编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776916036468,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"法人单位编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":8},\"readonly\":true,\"prop\":\"company_code\",\"__vModel__\":\"company_code\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"company_code\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem478e5c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"企业名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506482470,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"company_name\",\"__vModel__\":\"company_name\",\"disabled\":false,\"id\":\"company_name\",\"placeholder\":\"请输入企业名称\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"企业名称\",\"label\":\"企业名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem84e51c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"简称/昵称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506482631,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"short_name\",\"__vModel__\":\"short_name\",\"disabled\":false,\"id\":\"short_name\",\"placeholder\":\"请输入简称/昵称\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"简称/昵称\",\"label\":\"简称/昵称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"radio\",\"resizable\":true,\"buttonStyle\":\"solid\",\"fullName\":\"类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"optionType\":\"default\",\"__config__\":{\"yunzhupaasKey\":\"radio\",\"defaultValue\":\"ORG\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506487223,\"tagIcon\":\"icon-ym icon-ym-generator-radio\",\"tag\":\"YunzhupaasRadio\",\"formId\":\"formItemb3f6cd\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"size\":\"default\",\"prop\":\"entity_type\",\"options\":[{\"fullName\":\"企业\",\"id\":\"ORG\"},{\"fullName\":\"个人\",\"id\":\"IND\"}],\"__vModel__\":\"entity_type\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"entity_type\",\"labelI18nCode\":\"\",\"direction\":\"horizontal\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem10350c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"社会信用代码\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506494880,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"credit_code\",\"__vModel__\":\"credit_code\",\"disabled\":false,\"id\":\"credit_code\",\"placeholder\":\"请输入社会信用代码\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":100,\"fullName\":\"社会信用代码\",\"label\":\"社会信用代码\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"radio\",\"resizable\":true,\"buttonStyle\":\"solid\",\"fullName\":\"伙伴性质\",\"fullNameI18nCode\":[\"\"],\"label\":\"伙伴性质\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"optionType\":\"default\",\"__config__\":{\"yunzhupaasKey\":\"radio\",\"defaultValue\":\"EXT\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776918211021,\"tagIcon\":\"icon-ym icon-ym-generator-radio\",\"tag\":\"YunzhupaasRadio\",\"formId\":\"formItem97bed8\",\"visibility\":[\"pc\",\"app\"],\"noShow\":true,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"伙伴性质\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"size\":\"default\",\"prop\":\"company_scope\",\"options\":[{\"fullName\":\"内部\",\"id\":\"INT\"},{\"fullName\":\"外部\",\"id\":\"EXT\"}],\"__vModel__\":\"company_scope\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"company_scope\",\"labelI18nCode\":\"\",\"direction\":\"horizontal\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"纳税人类别\",\"fullNameI18nCode\":[\"\"],\"label\":\"纳税人类别\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503586,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem05d07f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"tax_type\",\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_type\",\"placeholder\":\"请选择纳税人类别\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"企业规模\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业规模\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503806,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem66e88f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"enterpriseScale\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业规模\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"enterprise_scale\",\"__vModel__\":\"enterprise_scale\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_scale\",\"placeholder\":\"请选择企业规模\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"企业类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506504118,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItema76b83\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"9b542177a477488994ce09fff3c93901\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"enterprise_nature\",\"__vModel__\":\"enterprise_nature\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_nature\",\"placeholder\":\"请选择企业类型\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"行业代码\",\"fullNameI18nCode\":[\"\"],\"label\":\"行业代码\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506507062,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem6bd8a7\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"d59a3cf65f9847dbb08be449e3feae16\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"行业代码\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"industry_code\",\"__vModel__\":\"industry_code\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"industry_code\",\"placeholder\":\"请选择行业代码\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"datePicker\",\"clearable\":true,\"resizable\":true,\"format\":\"yyyy-MM-dd\",\"fullName\":\"成立日期\",\"fullNameI18nCode\":[\"\"],\"label\":\"成立日期\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506509988,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItembab00e\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"成立日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"registration_date\",\"__vModel__\":\"registration_date\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"registration_date\",\"placeholder\":\"请选择成立日期\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":4,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItem3134b1\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"注册资本\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506514957,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"registered_capital\",\"__vModel__\":\"registered_capital\",\"disabled\":false,\"id\":\"registered_capital\",\"placeholder\":\"请输入注册资本\",\"addonBefore\":\"\",\"resizable\":true,\"max\":999999,\"fullName\":\"注册资本\",\"label\":\"注册资本\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"万元\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem4f2d0b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"法定代表人\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524679,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"legal_representative\",\"__vModel__\":\"legal_representative\",\"disabled\":false,\"id\":\"legal_representative\",\"placeholder\":\"请输入法定代表人\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"法定代表人\",\"label\":\"法定代表人\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem97bd9d\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"联系电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524966,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^1[3456789]\\\\d{9}$|^0\\\\d{2,3}-?\\\\d{7,8}$/\",\"message\":\"请输入正确的电话号码\",\"messageI18nCode\":\"sys.validate.telephone\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"phone\",\"__vModel__\":\"phone\",\"disabled\":false,\"id\":\"phone\",\"placeholder\":\"请输入联系电话\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":11,\"fullName\":\"联系电话\",\"label\":\"联系电话\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem439010\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"邮箱\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506525554,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^[a-z0-9]+([._\\\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/\",\"message\":\"请输入正确的邮箱\",\"messageI18nCode\":\"sys.validate.email\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"email\",\"__vModel__\":\"email\",\"disabled\":false,\"id\":\"email\",\"placeholder\":\"请输入邮箱\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":100,\"fullName\":\"邮箱\",\"label\":\"邮箱\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem7fa940\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"网站\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528130,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"website\",\"__vModel__\":\"website\",\"disabled\":false,\"id\":\"website\",\"placeholder\":\"请输入网站\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":100,\"fullName\":\"网站\",\"label\":\"网站\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5b2d2b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528353,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"address\",\"__vModel__\":\"address\",\"disabled\":false,\"id\":\"address\",\"placeholder\":\"请输入地址\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"地址\",\"label\":\"地址\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"areaSelect\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"level\":2,\"multiple\":false,\"fullName\":\"所属地区\",\"fullNameI18nCode\":[\"\"],\"label\":\"所属地区\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItemcc9deb\",\"yunzhupaasKey\":\"areaSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属地区\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507118587,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-Provinces\",\"tag\":\"YunzhupaasAreaSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"province_id\",\"__vModel__\":\"province_id\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"province_id\",\"placeholder\":\"请选择所属地区\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"经营范围\",\"fullNameI18nCode\":[\"\"],\"label\":\"经营范围\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":3,\"maxRows\":3},\"showCount\":false,\"__config__\":{\"formId\":\"formItem8cbf03\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"经营范围\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534652,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"business_scope\",\"__vModel__\":\"business_scope\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"business_scope\",\"placeholder\":\"请输入经营范围\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"fullName\":\"备注\",\"fullNameI18nCode\":[\"\"],\"label\":\"备注\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"showCount\":false,\"__config__\":{\"formId\":\"formItem9f5e00\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534863,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"remark\",\"__vModel__\":\"remark\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"remark\",\"placeholder\":\"请输入备注\",\"labelI18nCode\":\"\"}],\"columnOptions\":[{\"buttonStyle\":\"solid\",\"fullName\":\"伙伴性质\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"optionType\":\"default\",\"__config__\":{\"yunzhupaasKey\":\"radio\",\"defaultValue\":\"EXT\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776918211021,\"tagIcon\":\"icon-ym icon-ym-generator-radio\",\"tag\":\"YunzhupaasRadio\",\"formId\":\"formItem97bed8\",\"visibility\":[\"pc\",\"app\"],\"noShow\":true,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"伙伴性质\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"size\":\"default\",\"options\":[{\"fullName\":\"内部\",\"id\":\"INT\"},{\"fullName\":\"外部\",\"id\":\"EXT\"}],\"__vModel__\":\"company_scope\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"company_scope\",\"direction\":\"horizontal\"},{\"__config__\":{\"formId\":\"formItem7a91b8\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"CorporationCode\",\"className\":[],\"label\":\"企业编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776916036468,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"法人单位编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":8},\"readonly\":true,\"__vModel__\":\"company_code\",\"fullName\":\"企业编码\",\"fullNameI18nCode\":[\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"company_code\",\"placeholder\":\"系统自动生成\"},{\"clearable\":true,\"maxlength\":200,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"企业名称\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem478e5c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"企业名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506482470,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"company_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"company_name\",\"placeholder\":\"请输入企业名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"简称/昵称\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem84e51c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"简称/昵称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506482631,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"short_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"short_name\",\"placeholder\":\"请输入简称/昵称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"buttonStyle\":\"solid\",\"fullName\":\"类型\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"optionType\":\"default\",\"__config__\":{\"yunzhupaasKey\":\"radio\",\"defaultValue\":\"ORG\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506487223,\"tagIcon\":\"icon-ym icon-ym-generator-radio\",\"tag\":\"YunzhupaasRadio\",\"formId\":\"formItemb3f6cd\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"size\":\"default\",\"options\":[{\"fullName\":\"企业\",\"id\":\"ORG\"},{\"fullName\":\"个人\",\"id\":\"IND\"}],\"__vModel__\":\"entity_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"entity_type\",\"direction\":\"horizontal\"},{\"clearable\":true,\"maxlength\":100,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"社会信用代码\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem10350c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"社会信用代码\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506494880,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"credit_code\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"credit_code\",\"placeholder\":\"请输入社会信用代码\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"归属组织\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"formId\":\"formItemfc6848\",\"yunzhupaasKey\":\"organizeSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"归属组织\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776912270086,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasOrganizeSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"org_id\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"org_id\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"level\":2,\"multiple\":false,\"fullName\":\"所属地区\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"formId\":\"formItemcc9deb\",\"yunzhupaasKey\":\"areaSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属地区\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507118587,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-Provinces\",\"tag\":\"YunzhupaasAreaSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"province_id\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"province_id\",\"placeholder\":\"请选择所属地区\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"纳税人类别\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503586,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem05d07f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_type\",\"placeholder\":\"请选择纳税人类别\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"企业规模\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503806,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem66e88f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"enterpriseScale\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业规模\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"enterprise_scale\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_scale\",\"placeholder\":\"请选择企业规模\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"企业类型\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506504118,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItema76b83\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"9b542177a477488994ce09fff3c93901\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"enterprise_nature\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_nature\",\"placeholder\":\"请选择企业类型\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"行业代码\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506507062,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem6bd8a7\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"d59a3cf65f9847dbb08be449e3feae16\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"行业代码\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"industry_code\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"industry_code\",\"placeholder\":\"请选择行业代码\"},{\"clearable\":true,\"format\":\"yyyy-MM-dd\",\"fullName\":\"成立日期\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506509988,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItembab00e\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"成立日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"registration_date\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"registration_date\",\"placeholder\":\"请选择成立日期\"},{\"controls\":false,\"max\":999999,\"precision\":4,\"fullName\":\"注册资本\",\"fullNameI18nCode\":[\"\"],\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"万元\",\"__config__\":{\"formId\":\"formItem3134b1\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"注册资本\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506514957,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"registered_capital\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"registered_capital\",\"placeholder\":\"请输入注册资本\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"法定代表人\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem4f2d0b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"法定代表人\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524679,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"legal_representative\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"legal_representative\",\"placeholder\":\"请输入法定代表人\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":11,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"联系电话\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem97bd9d\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"联系电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524966,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^1[3456789]\\\\d{9}$|^0\\\\d{2,3}-?\\\\d{7,8}$/\",\"message\":\"请输入正确的电话号码\",\"messageI18nCode\":\"sys.validate.telephone\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"phone\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"phone\",\"placeholder\":\"请输入联系电话\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":100,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"邮箱\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem439010\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"邮箱\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506525554,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^[a-z0-9]+([._\\\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/\",\"message\":\"请输入正确的邮箱\",\"messageI18nCode\":\"sys.validate.email\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"email\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"email\",\"placeholder\":\"请输入邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":100,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"网站\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem7fa940\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"网站\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528130,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"website\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"website\",\"placeholder\":\"请输入网站\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":200,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"地址\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5b2d2b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528353,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"address\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"address\",\"placeholder\":\"请输入地址\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"ableRelationIds\":[],\"clearable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"销售责任人\",\"fullNameI18nCode\":[\"\"],\"relationField\":\"\",\"__config__\":{\"formId\":\"formItemf4ca17\",\"yunzhupaasKey\":\"userSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":\"\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"销售责任人\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_customer\",\"renderKey\":1776918111506,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-user\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasUserSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"yunzhupaas_mdm_customer_yunzhupaas_major_person_id\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"yunzhupaas_mdm_customer_yunzhupaas_major_person_id\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"客户级别。关联字典:客户级别(CustomerLevel)\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_customer\",\"renderKey\":1776918157184,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem379bfe\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"客户级别。关联字典:客户级别(CustomerLevel)\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"options\":[{\"fullName\":\"选项一\",\"id\":\"1\"},{\"fullName\":\"选项二\",\"id\":\"2\"}],\"__vModel__\":\"yunzhupaas_mdm_customer_yunzhupaas_customer_level\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"yunzhupaas_mdm_customer_yunzhupaas_customer_level\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"客户来源。关联字典:客户来源(CustomerSource)\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_customer\",\"renderKey\":1776918191565,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem68763d\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"客户来源。关联字典:客户来源(CustomerSource)\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"options\":[{\"fullName\":\"选项一\",\"id\":\"1\"},{\"fullName\":\"选项二\",\"id\":\"2\"}],\"__vModel__\":\"yunzhupaas_mdm_customer_yunzhupaas_customer_source\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"yunzhupaas_mdm_customer_yunzhupaas_customer_source\",\"placeholder\":\"请选择\"},{\"clearable\":true,\"maxlength\":200,\"fullName\":\"经营范围\",\"fullNameI18nCode\":[\"\"],\"autoSize\":{\"minRows\":3,\"maxRows\":3},\"showCount\":false,\"__config__\":{\"formId\":\"formItem8cbf03\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"经营范围\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534652,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"business_scope\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"business_scope\",\"placeholder\":\"请输入经营范围\"},{\"clearable\":true,\"fullName\":\"备注\",\"fullNameI18nCode\":[\"\"],\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"showCount\":false,\"__config__\":{\"formId\":\"formItem9f5e00\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534863,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"remark\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"remark\",\"placeholder\":\"请输入备注\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-开户行\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem3756b9\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507591361,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldad9d92-bank_name\",\"placeholder\":\"请输入开户行\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-账户名\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemf42745\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"账户名\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507611465,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_account_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldad9d92-bank_account_name\",\"placeholder\":\"请输入账户名\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-银行账号\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem8abffe\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507627371,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_account_number\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldad9d92-bank_account_number\",\"placeholder\":\"请输入银行账号\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-开户行城市\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemb870cb\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行城市\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507627772,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_province\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldad9d92-bank_province\",\"placeholder\":\"请输入开户行城市\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":200,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-备注\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemf22092\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507628423,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"remark\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldad9d92-remark\",\"placeholder\":\"请输入备注\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"billRule\",\"parentVModel\":\"tableField46dc53\",\"dragDisabled\":false,\"rule\":\"InvoiceTitleCode\",\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754320599,\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"isSubTable\":true,\"ruleName\":\"发票抬头编码\",\"tag\":\"YunzhupaasInput\",\"formId\":\"formItem57f1d4\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"发票抬头编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"layout\":\"colFormItem\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"title_code\",\"fullName\":\"设计子表-发票抬头编码\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField46dc53-title_code\",\"placeholder\":\"系统自动生成\"},{\"clearable\":true,\"maxlength\":10,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-发票抬头名称\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItema8b1f4\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"发票抬头名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507383593,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"title_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-title_name\",\"placeholder\":\"请输入联系人\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-纳税人识别号\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1963f0\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"纳税人识别号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507440273,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"credit_code\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-credit_code\",\"placeholder\":\"请输入联系人职务\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"设计子表-纳税人类别\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"parentVModel\":\"tableField46dc53\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754396382,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemb3492f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-tax_type\",\"placeholder\":\"请选择纳税人类别\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-地址\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItema9aaf2\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507448061,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"address\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-address\",\"placeholder\":\"请输入联系人邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-电话\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItemf8b766\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754421983,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"phone\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-phone\",\"placeholder\":\"请输入联系人邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-开户银行\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1730ca\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户银行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754433217,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-bank_name\",\"placeholder\":\"请输入联系人邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-银行账户\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1089bb\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账户\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754444839,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_account\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-bank_account\",\"placeholder\":\"请输入联系人邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"formId\":\"formItem4743e7\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\""); + sb.append(":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否默认\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754525239,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"activeValue\":1,\"inactiveValue\":0,\"__vModel__\":\"is_defalut\",\"fullName\":\"设计子表-是否默认\",\"inactiveTxt\":\"关\",\"fullNameI18nCode\":[\"\",\"\"],\"disabled\":false,\"activeTxt\":\"开\",\"id\":\"tableField46dc53-is_defalut\"},{\"__config__\":{\"formId\":\"formItema2b4cf\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否有效\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754540042,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"activeValue\":1,\"inactiveValue\":0,\"__vModel__\":\"is_valid\",\"fullName\":\"设计子表-是否有效\",\"inactiveTxt\":\"关\",\"fullNameI18nCode\":[\"\",\"\"],\"disabled\":false,\"activeTxt\":\"开\",\"id\":\"tableField46dc53-is_valid\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-备注\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem560a27\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507449005,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"remark\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-remark\",\"placeholder\":\"请输入备注\",\"prefixIcon\":\"\",\"addonBefore\":\"\"}],\"pageSize\":20,\"defaultSortConfig\":[],\"type\":1,\"columnBtnsList\":[{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-edit\",\"label\":\"编辑\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"edit\",\"labelI18nCode\":\"common.editText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"删除\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"remove\",\"labelI18nCode\":\"common.delText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-generator-menu\",\"label\":\"详情\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"detail\",\"labelI18nCode\":\"common.detailText\"}],\"tabConfig\":{\"hasAllTab\":true,\"relationField\":\"\",\"on\":false},\"hasSuperQuery\":false,\"defaultColumnList\":[{\"yunzhupaasKey\":\"radio\",\"resizable\":true,\"buttonStyle\":\"solid\",\"fullName\":\"伙伴性质\",\"fullNameI18nCode\":[\"\"],\"label\":\"伙伴性质\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"optionType\":\"default\",\"__config__\":{\"yunzhupaasKey\":\"radio\",\"defaultValue\":\"EXT\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776918211021,\"tagIcon\":\"icon-ym icon-ym-generator-radio\",\"tag\":\"YunzhupaasRadio\",\"formId\":\"formItem97bed8\",\"visibility\":[\"pc\",\"app\"],\"noShow\":true,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"伙伴性质\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"size\":\"default\",\"prop\":\"company_scope\",\"options\":[{\"fullName\":\"内部\",\"id\":\"INT\"},{\"fullName\":\"外部\",\"id\":\"EXT\"}],\"__vModel__\":\"company_scope\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"company_scope\",\"labelI18nCode\":\"\",\"direction\":\"horizontal\"},{\"yunzhupaasKey\":\"billRule\",\"resizable\":true,\"fullName\":\"企业编码\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业编码\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItem7a91b8\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"CorporationCode\",\"className\":[],\"label\":\"企业编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776916036468,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"法人单位编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":8},\"readonly\":true,\"prop\":\"company_code\",\"__vModel__\":\"company_code\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"company_code\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem478e5c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"企业名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506482470,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"company_name\",\"__vModel__\":\"company_name\",\"checked\":true,\"disabled\":false,\"id\":\"company_name\",\"placeholder\":\"请输入企业名称\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"企业名称\",\"label\":\"企业名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem84e51c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"简称/昵称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506482631,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"short_name\",\"__vModel__\":\"short_name\",\"checked\":true,\"disabled\":false,\"id\":\"short_name\",\"placeholder\":\"请输入简称/昵称\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"简称/昵称\",\"label\":\"简称/昵称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"radio\",\"resizable\":true,\"buttonStyle\":\"solid\",\"fullName\":\"类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"optionType\":\"default\",\"__config__\":{\"yunzhupaasKey\":\"radio\",\"defaultValue\":\"ORG\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506487223,\"tagIcon\":\"icon-ym icon-ym-generator-radio\",\"tag\":\"YunzhupaasRadio\",\"formId\":\"formItemb3f6cd\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"size\":\"default\",\"prop\":\"entity_type\",\"options\":[{\"fullName\":\"企业\",\"id\":\"ORG\"},{\"fullName\":\"个人\",\"id\":\"IND\"}],\"__vModel__\":\"entity_type\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"entity_type\",\"labelI18nCode\":\"\",\"direction\":\"horizontal\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem10350c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"社会信用代码\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506494880,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"credit_code\",\"__vModel__\":\"credit_code\",\"checked\":true,\"disabled\":false,\"id\":\"credit_code\",\"placeholder\":\"请输入社会信用代码\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":100,\"fullName\":\"社会信用代码\",\"label\":\"社会信用代码\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"organizeSelect\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"归属组织\",\"fullNameI18nCode\":[\"\"],\"label\":\"归属组织\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItemfc6848\",\"yunzhupaasKey\":\"organizeSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"归属组织\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776912270086,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasOrganizeSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"org_id\",\"__vModel__\":\"org_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"org_id\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"areaSelect\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"level\":2,\"multiple\":false,\"fullName\":\"所属地区\",\"fullNameI18nCode\":[\"\"],\"label\":\"所属地区\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItemcc9deb\",\"yunzhupaasKey\":\"areaSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属地区\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507118587,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-Provinces\",\"tag\":\"YunzhupaasAreaSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"province_id\",\"__vModel__\":\"province_id\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"province_id\",\"placeholder\":\"请选择所属地区\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"纳税人类别\",\"fullNameI18nCode\":[\"\"],\"label\":\"纳税人类别\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503586,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem05d07f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"tax_type\",\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_type\",\"placeholder\":\"请选择纳税人类别\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"企业规模\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业规模\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503806,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem66e88f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"enterpriseScale\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业规模\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"enterprise_scale\",\"__vModel__\":\"enterprise_scale\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_scale\",\"placeholder\":\"请选择企业规模\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"企业类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506504118,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItema76b83\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"9b542177a477488994ce09fff3c93901\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"enterprise_nature\",\"__vModel__\":\"enterprise_nature\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_nature\",\"placeholder\":\"请选择企业类型\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"行业代码\",\"fullNameI18nCode\":[\"\"],\"label\":\"行业代码\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506507062,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem6bd8a7\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"d59a3cf65f9847dbb08be449e3feae16\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"行业代码\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"industry_code\",\"__vModel__\":\"industry_code\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"industry_code\",\"placeholder\":\"请选择行业代码\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"datePicker\",\"clearable\":true,\"resizable\":true,\"format\":\"yyyy-MM-dd\",\"fullName\":\"成立日期\",\"fullNameI18nCode\":[\"\"],\"label\":\"成立日期\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506509988,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItembab00e\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"成立日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"registration_date\",\"__vModel__\":\"registration_date\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"registration_date\",\"placeholder\":\"请选择成立日期\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":4,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItem3134b1\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"注册资本\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506514957,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"registered_capital\",\"__vModel__\":\"registered_capital\",\"checked\":true,\"disabled\":false,\"id\":\"registered_capital\",\"placeholder\":\"请输入注册资本\",\"addonBefore\":\"\",\"resizable\":true,\"max\":999999,\"fullName\":\"注册资本\",\"label\":\"注册资本\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"万元\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem4f2d0b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"法定代表人\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524679,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"legal_representative\",\"__vModel__\":\"legal_representative\",\"checked\":true,\"disabled\":false,\"id\":\"legal_representative\",\"placeholder\":\"请输入法定代表人\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"法定代表人\",\"label\":\"法定代表人\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem97bd9d\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"联系电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524966,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^1[3456789]\\\\d{9}$|^0\\\\d{2,3}-?\\\\d{7,8}$/\",\"message\":\"请输入正确的电话号码\",\"messageI18nCode\":\"sys.validate.telephone\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"phone\",\"__vModel__\":\"phone\",\"checked\":true,\"disabled\":false,\"id\":\"phone\",\"placeholder\":\"请输入联系电话\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":11,\"fullName\":\"联系电话\",\"label\":\"联系电话\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem439010\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"邮箱\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506525554,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^[a-z0-9]+([._\\\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/\",\"message\":\"请输入正确的邮箱\",\"messageI18nCode\":\"sys.validate.email\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"email\",\"__vModel__\":\"email\",\"checked\":true,\"disabled\":false,\"id\":\"email\",\"placeholder\":\"请输入邮箱\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":100,\"fullName\":\"邮箱\",\"label\":\"邮箱\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem7fa940\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"网站\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528130,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"website\",\"__vModel__\":\"website\",\"checked\":true,\"disabled\":false,\"id\":\"website\",\"placeholder\":\"请输入网站\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":100,\"fullName\":\"网站\",\"label\":\"网站\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5b2d2b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528353,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"address\",\"__vModel__\":\"address\",\"checked\":true,\"disabled\":false,\"id\":\"address\",\"placeholder\":\"请输入地址\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"地址\",\"label\":\"地址\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"ableRelationIds\":[],\"yunzhupaasKey\":\"userSelect\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"__config__\":{\"formId\":\"formItemf4ca17\",\"yunzhupaasKey\":\"userSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":\"\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"销售责任人\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_customer\",\"renderKey\":1776918111506,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-user\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasUserSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"yunzhupaas_mdm_customer_yunzhupaas_major_person_id\",\"__vModel__\":\"yunzhupaas_mdm_customer_yunzhupaas_major_person_id\",\"checked\":false,\"selectType\":\"all\",\"disabled\":false,\"id\":\"yunzhupaas_mdm_customer_yunzhupaas_major_person_id\",\"placeholder\":\"请选择\",\"clearable\":true,\"resizable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"销售责任人\",\"label\":\"销售责任人\",\"sortable\":false,\"relationField\":\"\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"客户级别。关联字典:客户级别(CustomerLevel)\",\"fullNameI18nCode\":[\"\"],\"label\":\"客户级别。关联字典:客户级别(CustomerLevel)\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_customer\",\"renderKey\":1776918157184,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem379bfe\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"客户级别。关联字典:客户级别(CustomerLevel)\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"yunzhupaas_mdm_customer_yunzhupaas_customer_level\",\"options\":[{\"fullName\":\"选项一\",\"id\":\"1\"},{\"fullName\":\"选项二\",\"id\":\"2\"}],\"__vModel__\":\"yunzhupaas_mdm_customer_yunzhupaas_customer_level\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"yunzhupaas_mdm_customer_yunzhupaas_customer_level\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"客户来源。关联字典:客户来源(CustomerSource)\",\"fullNameI18nCode\":[\"\"],\"label\":\"客户来源。关联字典:客户来源(CustomerSource)\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_customer\",\"renderKey\":1776918191565,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem68763d\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"客户来源。关联字典:客户来源(CustomerSource)\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"yunzhupaas_mdm_customer_yunzhupaas_customer_source\",\"options\":[{\"fullName\":\"选项一\",\"id\":\"1\"},{\"fullName\":\"选项二\",\"id\":\"2\"}],\"__vModel__\":\"yunzhupaas_mdm_customer_yunzhupaas_customer_source\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"yunzhupaas_mdm_customer_yunzhupaas_customer_source\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"经营范围\",\"fullNameI18nCode\":[\"\"],\"label\":\"经营范围\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":3,\"maxRows\":3},\"showCount\":false,\"__config__\":{\"formId\":\"formItem8cbf03\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"经营范围\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534652,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"business_scope\",\"__vModel__\":\"business_scope\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"business_scope\",\"placeholder\":\"请输入经营范围\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"fullName\":\"备注\",\"fullNameI18nCode\":[\"\"],\"label\":\"备注\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"showCount\":false,\"__config__\":{\"formId\":\"formItem9f5e00\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534863,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"remark\",\"__vModel__\":\"remark\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"remark\",\"placeholder\":\"请输入备注\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem3756b9\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507591361,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldad9d92-bank_name\",\"__vModel__\":\"bank_name\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldad9d92-bank_name\",\"placeholder\":\"请输入开户行\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"设计子表-开户行\",\"label\":\"设计子表-开户行\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemf42745\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"账户名\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507611465,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldad9d92-bank_account_name\",\"__vModel__\":\"bank_account_name\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldad9d92-bank_account_name\",\"placeholder\":\"请输入账户名\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"设计子表-账户名\",\"label\":\"设计子表-账户名\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem8abffe\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507627371,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldad9d92-bank_account_number\",\"__vModel__\":\"bank_account_number\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldad9d92-bank_account_number\",\"placeholder\":\"请输入银行账号\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"设计子表-银行账号\",\"label\":\"设计子表-银行账号\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemb870cb\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行城市\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507627772,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldad9d92-bank_province\",\"__vModel__\":\"bank_province\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldad9d92-bank_province\",\"placeholder\":\"请输入开户行城市\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"设计子表-开户行城市\",\"label\":\"设计子表-开户行城市\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemf22092\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507628423,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldad9d92-remark\",\"__vModel__\":\"remark\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldad9d92-remark\",\"placeholder\":\"请输入备注\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"设计子表-备注\",\"label\":\"设计子表-备注\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"billRule\",\"resizable\":true,\"fullName\":\"设计子表-发票抬头编码\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"设计子表-发票抬头编码\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"billRule\",\"parentVModel\":\"tableField46dc53\",\"dragDisabled\":false,\"rule\":\"InvoiceTitleCode\",\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754320599,\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"isSubTable\":true,\"ruleName\":\"发票抬头编码\",\"tag\":\"YunzhupaasInput\",\"formId\":\"formItem57f1d4\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"发票抬头编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"layout\":\"colFormItem\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField46dc53-title_code\",\"__vModel__\":\"title_code\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField46dc53-title_code\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItema8b1f4\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"发票抬头名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507383593,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-title_name\",\"__vModel__\":\"title_name\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-title_name\",\"placeholder\":\"请输入联系人\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":10,\"fullName\":\"设计子表-发票抬头名称\",\"label\":\"设计子表-发票抬头名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1963f0\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"纳税人识别号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507440273,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-credit_code\",\"__vModel__\":\"credit_code\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-credit_code\",\"placeholder\":\"请输入联系人职务\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"设计子表-纳税人识别号\",\"label\":\"设计子表-纳税人识别号\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"设计子表-纳税人类别\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"设计子表-纳税人类别\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"parentVModel\":\"tableField46dc53\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754396382,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemb3492f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"tableField46dc53-tax_type\",\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-tax_type\",\"placeholder\":\"请选择纳税人类别\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItema9aaf2\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507448061,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-address\",\"__vModel__\":\"address\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-address\",\"placeholder\":\"请输入联系人邮箱\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"设计子表-地址\",\"label\":\"设计子表-地址\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItemf8b766\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754421983,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-phone\",\"__vModel__\":\"phone\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-phone\",\"placeholder\":\"请输入联系人邮箱\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"设计子表-电话\",\"label\":\"设计子表-电话\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1730ca\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户银行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754433217,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-bank_name\",\"__vModel__\":\"bank_name\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-bank_name\",\"placeholder\":\"请输入联系人邮箱\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"设计子表-开户银行\",\"label\":\"设计子表-开户银行\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1089bb\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账户\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754444839,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-bank_account\",\"__vModel__\":\"bank_account\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-bank_account\",\"placeholder\":\"请输入联系人邮箱\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"设计子表-银行账户\",\"label\":\"设计子表-银行账户\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"switch\",\"resizable\":true,\"activeValue\":1,\"inactiveValue\":0,\"fullName\":\"设计子表-是否默认\",\"inactiveTxt\":\"关\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"设计子表-是否默认\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItem4743e7\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否默认\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754525239,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"tableField46dc53-is_defalut\",\"__vModel__\":\"is_defalut\",\"checked\":false,\"fixed\":\"none\",\"disabled\":false,\"activeTxt\":\"开\",\"id\":\"tableField46dc53-is_defalut\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"switch\",\"resizable\":true,\"activeValue\":1,\"inactiveValue\":0,\"fullName\":\"设计子表-是否有效\",\"inactiveTxt\":\"关\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"设计子表-是否有效\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItema2b4cf\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否有效\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754540042,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"tableField46dc53-is_valid\",\"__vModel__\":\"is_valid\",\"checked\":false,\"fixed\":\"none\",\"disabled\":false,\"activeTxt\":\"开\",\"id\":\"tableField46dc53-is_valid\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem560a27\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507449005,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-remark\",\"__vModel__\":\"remark\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-remark\",\"placeholder\":\"请输入备注\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"设计子表-备注\",\"label\":\"设计子表-备注\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"}],\"showOverflow\":true,\"useFormPermission\":false,\"customBtnsList\":[],\"useBtnPermission\":false}"); + return sb.toString(); + } + /** 表列表 */ + public static final String getTableList(){ + StringBuilder sb = new StringBuilder(); +sb.append("[{\"relationTable\":\"\",\"tableField\":\"\",\"typeId\":\"1\",\"fields\":[{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"company_id\",\"fieldName\":\"企业唯一ID\",\"identity\":0,\"primaryKey\":1},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"company_code\",\"fieldName\":\"企业编码(系统生成或用户定义)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"200\",\"dataType\":\"varchar\",\"field\":\"company_name\",\"fieldName\":\"企业名称(企业名或个人姓名)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"3\",\"dataType\":\"char\",\"field\":\"entity_type\",\"fieldName\":\"实体类型: ORG-组织/企业(Organization), IND-个人(Individual)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"100\",\"dataType\":\"varchar\",\"field\":\"short_name\",\"fieldName\":\"简称/昵称\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"100\",\"dataType\":\"varchar\",\"field\":\"org_id\",\"fieldName\":\"归属组织。关联表:base_organize\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"3\",\"dataType\":\"char\",\"field\":\"company_scope\",\"fieldName\":\"伙伴性质:INT-内部(Internal), EXT-外部(External)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"credit_code\",\"fieldName\":\"社会信用代码(企业)或身份证号(个人)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"province_id\",\"fieldName\":\"所属地区。关联表:base_province\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"20\",\"dataType\":\"varchar\",\"field\":\"tax_type\",\"fieldName\":\"纳税人类别: GENERAL-一般纳税人, SMALL-小规模\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"enterprise_nature\",\"fieldName\":\"企业类型。关联字典:企业性质(EnterpriseNature)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"industry_code\",\"fieldName\":\"行业代码。关联字典:行业类别(IndustryType)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"enterprise_scale\",\"fieldName\":\"企业规模。关联字典:企业规模(EnterpriseScale)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"registration_date\",\"fieldName\":\"成立日期\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"10,2\",\"dataType\":\"decimal\",\"field\":\"registered_capital\",\"fieldName\":\"注册资本(单位:万元)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"legal_representative\",\"fieldName\":\"法定代表人\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"phone\",\"fieldName\":\"联系电话\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"email\",\"fieldName\":\"邮箱\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"200\",\"dataType\":\"varchar\",\"field\":\"website\",\"fieldName\":\"网站\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"500\",\"dataType\":\"varchar\",\"field\":\"address\",\"fieldName\":\"地址\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":null,\"dataType\":\"tinytext\",\"field\":\"business_scope\",\"fieldName\":\"经营范围\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"500\",\"dataType\":\"varchar\",\"field\":\"remark\",\"fieldName\":\"备注\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"create_by\",\"fieldName\":\"创建人\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"create_time\",\"fieldName\":\"创建时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"update_by\",\"fieldName\":\"更新人ID\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"update_time\",\"fieldName\":\"更新时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_tenant_id\",\"fieldName\":\"租户id\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":null,\"dataType\":\"int\",\"field\":\"f_delete_mark\",\"fieldName\":\"删除标志\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"f_delete_time\",\"fieldName\":\"删除时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_delete_user_id\",\"fieldName\":\"删除用户\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_flow_id\",\"fieldName\":\"流程id\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_flow_task_id\",\"fieldName\":\"流程任务主键\",\"identity\":0,\"primaryKey\":0}],\"relationField\":\"\",\"table\":\"mdm_company\",\"tableName\":\"企业信息(包括:客商与企业内部单位)\"},{\"relationTable\":\"mdm_company\",\"tableField\":\"company_id\",\"typeId\":\"0\",\"fields\":[{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"bank_id\",\"fieldName\":\"商业伙伴银行ID\",\"identity\":0,\"primaryKey\":1},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"company_id\",\"fieldName\":\"关联的企业信息ID。关联表:mdm_company\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"100\",\"dataType\":\"varchar\",\"field\":\"bank_name\",\"fieldName\":\"开户行\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"200\",\"dataType\":\"varchar\",\"field\":\"bank_account_name\",\"fieldName\":\"账户名\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"bank_account_number\",\"fieldName\":\"银行账号\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"bank_province\",\"fieldName\":\"开户行城市\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"500\",\"dataType\":\"varchar\",\"field\":\"remark\",\"fieldName\":\"备注\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"create_by\",\"fieldName\":\"创建人\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"create_time\",\"fieldName\":\"创建时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"update_by\",\"fieldName\":\"更新人ID\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"update_time\",\"fieldName\":\"更新时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_tenant_id\",\"fieldName\":\"租户id\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":null,\"dataType\":\"int\",\"field\":\"f_delete_mark\",\"fieldName\":\"删除标志\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"f_delete_time\",\"fieldName\":\"删除时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_delete_user_id\",\"fieldName\":\"删除用户\",\"identity\":0,\"primaryKey\":0}],\"relationField\":\"company_id\",\"table\":\"mdm_company_bank\",\"tableName\":\"企业银行信息\"},{\"relationTable\":\"mdm_company\",\"tableField\":\"company_id\",\"typeId\":\"0\",\"fields\":[{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"invoice_id\",\"fieldName\":\"发票抬头ID\",\"identity\":0,\"primaryKey\":1},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"company_id\",\"fieldName\":\"企业信息ID。关联表:mdm_company\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"title_code\",\"fieldName\":\"发票抬头编码\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"200\",\"dataType\":\"varchar\",\"field\":\"title_name\",\"fieldName\":\"发票抬头名称\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"credit_code\",\"fieldName\":\"纳税人识别号\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"20\",\"dataType\":\"varchar\",\"field\":\"tax_type\",\"fieldName\":\"纳税人类别: GENERAL-一般纳税人, SMALL-小规模\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"200\",\"dataType\":\"varchar\",\"field\":\"address\",\"fieldName\":\"地址\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"20\",\"dataType\":\"varchar\",\"field\":\"phone\",\"fieldName\":\"电话\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"100\",\"dataType\":\"varchar\",\"field\":\"bank_name\",\"fieldName\":\"开户银行\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"30\",\"dataType\":\"varchar\",\"field\":\"bank_account\",\"fieldName\":\"银行账户\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"1\",\"dataType\":\"char\",\"field\":\"is_valid\",\"fieldName\":\"是否有效。Y=有效、N=无效\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"1\",\"dataType\":\"char\",\"field\":\"is_defalut\",\"fieldName\":\"是否默认抬头。Y=是、N=否\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"500\",\"dataType\":\"varchar\",\"field\":\"remark\",\"fieldName\":\"备注\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"create_by\",\"fieldName\":\"创建人\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"create_time\",\"fieldName\":\"创建时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"update_by\",\"fieldName\":\"更新人ID\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"update_time\",\"fieldName\":\"更新时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_tenant_id\",\"fieldName\":\"租户id\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":null,\"dataType\":\"int\",\"field\":\"f_delete_mark\",\"fieldName\":\"删除标志\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"f_delete_time\",\"fieldName\":\"删除时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_delete_user_id\",\"fieldName\":\"删除用户\",\"identity\":0,\"primaryKey\":0}],\"relationField\":\"company_id\",\"table\":\"mdm_company_invoice\",\"tableName\":\"企业发票抬头\"},{\"relationTable\":\"mdm_company\",\"tableField\":\"company_id\",\"typeId\":\"0\",\"fields\":[{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"customer_id\",\"fieldName\":\"客户ID\",\"identity\":0,\"primaryKey\":1},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"company_id\",\"fieldName\":\"企业唯一ID。关联表:mdm_company\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"major_person_id\",\"fieldName\":\"销售责任人。关联表:base_user\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"customer_level\",\"fieldName\":\"客户级别。关联字典:客户级别(CustomerLevel)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"customer_source\",\"fieldName\":\"客户来源。关联字典:客户来源(CustomerSource)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"500\",\"dataType\":\"varchar\",\"field\":\"remark\",\"fieldName\":\"备注\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"create_by\",\"fieldName\":\"创建人\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"create_time\",\"fieldName\":\"创建时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"update_by\",\"fieldName\":\"更新人ID\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"update_time\",\"fieldName\":\"更新时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_tenant_id\",\"fieldName\":\"租户id\",\"identity\":0,\"primaryKey\":0}],\"relationField\":\"company_id\",\"table\":\"mdm_customer\",\"tableName\":\"客户\"}]"); return sb.toString(); + } + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/custinfo/CustinfoExcelErrorVO.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/custinfo/CustinfoExcelErrorVO.java new file mode 100644 index 0000000..54b1481 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/custinfo/CustinfoExcelErrorVO.java @@ -0,0 +1,22 @@ + + +package com.yunzhupaas.mdm.model.custinfo; + +import lombok.Data; +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.alibaba.fastjson.annotation.JSONField; +/** + * + * 客户信息 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-24 + */ +@Data +public class CustinfoExcelErrorVO extends CustinfoExcelVO{ + + @Excel(name = "异常原因",orderNum = "-999") + @JSONField(name = "errorsInfo") + private String errorsInfo; +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/custinfo/CustinfoExcelVO.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/custinfo/CustinfoExcelVO.java new file mode 100644 index 0000000..68c3874 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/custinfo/CustinfoExcelVO.java @@ -0,0 +1,135 @@ +package com.yunzhupaas.mdm.model.custinfo; + +import com.yunzhupaas.mdm.model.companyBank.CompanyBankExcelVO; +import com.yunzhupaas.mdm.model.companyInvoice.CompanyInvoiceExcelVO; +import lombok.Data; +import java.sql.Time; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; +import cn.afterturn.easypoi.excel.annotation.Excel; +import cn.afterturn.easypoi.excel.annotation.ExcelEntity; +import cn.afterturn.easypoi.excel.annotation.ExcelCollection; +import java.math.BigDecimal; +import java.util.List; +/** + * + * 客户信息 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-24 + */ +@Data +public class CustinfoExcelVO{ + /** 客户名称 **/ + @JSONField(name = "company_name") + @Excel(name = "客户名称(company_name)",orderNum = "1", isImportField = "true" ) + private String company_name; + + /** 社会信用代码 **/ + @JSONField(name = "credit_code") + @Excel(name = "社会信用代码(credit_code)",orderNum = "1", isImportField = "true" ) + private String credit_code; + + /** 归属组织 **/ + @JSONField(name = "org_id") + @Excel(name = "归属组织(org_id)",orderNum = "1", isImportField = "true" ) + private String org_id; + + /** 客户编码 **/ + @JSONField(name = "company_code") + @Excel(name = "客户编码(company_code)",orderNum = "1", isImportField = "true" ) + private String company_code; + + /** 简称/昵称 **/ + @JSONField(name = "short_name") + @Excel(name = "简称/昵称(short_name)",orderNum = "1", isImportField = "true" ) + private String short_name; + + /** 类型 **/ + @JSONField(name = "entity_type") + @Excel(name = "类型(entity_type)",orderNum = "1", isImportField = "true" ) + private String entity_type; + + /** 纳税人类别 **/ + @JSONField(name = "tax_type") + @Excel(name = "纳税人类别(tax_type)",orderNum = "1", isImportField = "true" ) + private String tax_type; + + /** 企业规模 **/ + @JSONField(name = "enterprise_scale") + @Excel(name = "企业规模(enterprise_scale)",orderNum = "1", isImportField = "true" ) + private String enterprise_scale; + + /** 企业类型 **/ + @JSONField(name = "enterprise_nature") + @Excel(name = "企业类型(enterprise_nature)",orderNum = "1", isImportField = "true" ) + private String enterprise_nature; + + /** 行业代码 **/ + @JSONField(name = "industry_code") + @Excel(name = "行业代码(industry_code)",orderNum = "1", isImportField = "true" ) + private String industry_code; + + /** 成立日期 **/ + @JSONField(name = "registration_date") + @Excel(name = "成立日期(registration_date)",orderNum = "1", isImportField = "true" ) + private String registration_date; + + /** 注册资本 **/ + @JSONField(name = "registered_capital") + @Excel(name = "注册资本(registered_capital)",orderNum = "1", isImportField = "true" ) + private String registered_capital; + + /** 法定代表人 **/ + @JSONField(name = "legal_representative") + @Excel(name = "法定代表人(legal_representative)",orderNum = "1", isImportField = "true" ) + private String legal_representative; + + /** 联系电话 **/ + @JSONField(name = "phone") + @Excel(name = "联系电话(phone)",orderNum = "1", isImportField = "true" ) + private String phone; + + /** 邮箱 **/ + @JSONField(name = "email") + @Excel(name = "邮箱(email)",orderNum = "1", isImportField = "true" ) + private String email; + + /** 网站 **/ + @JSONField(name = "website") + @Excel(name = "网站(website)",orderNum = "1", isImportField = "true" ) + private String website; + + /** 地址 **/ + @JSONField(name = "address") + @Excel(name = "地址(address)",orderNum = "1", isImportField = "true" ) + private String address; + + /** 所属地区 **/ + @JSONField(name = "province_id") + @Excel(name = "所属地区(province_id)",orderNum = "1", isImportField = "true" ) + private String province_id; + + /** 经营范围 **/ + @JSONField(name = "business_scope") + @Excel(name = "经营范围(business_scope)",orderNum = "1", isImportField = "true" ) + private String business_scope; + + /** 备注 **/ + @JSONField(name = "remark") + @Excel(name = "备注(remark)",orderNum = "1", isImportField = "true" ) + private String remark; + + @JsonProperty("tableField46dc53") + @ExcelCollection(name="设计子表(tableField46dc53)",orderNum = "10") + private List tableField46dc53; + + @JsonProperty("tableFieldad9d92") + @ExcelCollection(name="设计子表(tableFieldad9d92)",orderNum = "5") + private List tableFieldad9d92; + + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/custinfo/CustinfoForm.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/custinfo/CustinfoForm.java new file mode 100644 index 0000000..f98ec69 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/custinfo/CustinfoForm.java @@ -0,0 +1,152 @@ +package com.yunzhupaas.mdm.model.custinfo; + +import com.yunzhupaas.mdm.model.companyBank.CompanyBankModel; +import com.yunzhupaas.mdm.model.companyInvoice.CompanyInvoiceModel; +import lombok.Data; +import java.util.*; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * 客户信息 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-24 + */ +@Data +@Schema(description = "表单参数") +public class CustinfoForm { + /** 主键 */ + @Schema(description = "主键") + @JSONField(name = "company_id") + private String companyId; + + + /** 客户编码 **/ + @Schema(description = "客户编码") + @JsonProperty("company_code") + @JSONField(name = "company_code") + private String companyCode; + /** 客户名称 **/ + @Schema(description = "客户名称") + @JsonProperty("company_name") + @JSONField(name = "company_name") + private String companyName; + /** 简称/昵称 **/ + @Schema(description = "简称/昵称") + @JsonProperty("short_name") + @JSONField(name = "short_name") + private String shortName; + /** 类型 **/ + @Schema(description = "类型") + @JsonProperty("entity_type") + @JSONField(name = "entity_type") + private String entityType; + /** 社会信用代码 **/ + @Schema(description = "社会信用代码") + @JsonProperty("credit_code") + @JSONField(name = "credit_code") + private String creditCode; + /** 归属组织 **/ + @Schema(description = "归属组织") + @JsonProperty("org_id") + @JSONField(name = "org_id") + private Object orgId; + /** 所属地区 **/ + @Schema(description = "所属地区") + @JsonProperty("province_id") + @JSONField(name = "province_id") + private Object provinceId; + /** 纳税人类别 **/ + @Schema(description = "纳税人类别") + @JsonProperty("tax_type") + @JSONField(name = "tax_type") + private Object taxType; + /** 企业规模 **/ + @Schema(description = "企业规模") + @JsonProperty("enterprise_scale") + @JSONField(name = "enterprise_scale") + private Object enterpriseScale; + /** 企业类型 **/ + @Schema(description = "企业类型") + @JsonProperty("enterprise_nature") + @JSONField(name = "enterprise_nature") + private Object enterpriseNature; + /** 行业代码 **/ + @Schema(description = "行业代码") + @JsonProperty("industry_code") + @JSONField(name = "industry_code") + private Object industryCode; + /** 成立日期 **/ + @Schema(description = "成立日期") + @JsonProperty("registration_date") + @JSONField(name = "registration_date") + private String registrationDate; + /** 注册资本 **/ + @Schema(description = "注册资本") + @JsonProperty("registered_capital") + @JSONField(name = "registered_capital") + private BigDecimal registeredCapital; + /** 法定代表人 **/ + @Schema(description = "法定代表人") + @JsonProperty("legal_representative") + @JSONField(name = "legal_representative") + private String legalRepresentative; + /** 联系电话 **/ + @Schema(description = "联系电话") + @JsonProperty("phone") + @JSONField(name = "phone") + private String phone; + /** 邮箱 **/ + @Schema(description = "邮箱") + @JsonProperty("email") + @JSONField(name = "email") + private String email; + /** 网站 **/ + @Schema(description = "网站") + @JsonProperty("website") + @JSONField(name = "website") + private String website; + /** 地址 **/ + @Schema(description = "地址") + @JsonProperty("address") + @JSONField(name = "address") + private String address; + /** 销售责任人 **/ + @Schema(description = "销售责任人") + @JsonProperty("yunzhupaas_mdm_customer_yunzhupaas_major_person_id") + @JSONField(name = "yunzhupaas_mdm_customer_yunzhupaas_major_person_id") + private Object yunzhupaas_customer_yunzhupaas_personId; + /** 客户级别 **/ + @Schema(description = "客户级别") + @JsonProperty("yunzhupaas_mdm_customer_yunzhupaas_customer_level") + @JSONField(name = "yunzhupaas_mdm_customer_yunzhupaas_customer_level") + private Object yunzhupaas_customer_yunzhupaas_customerLevel; + /** 客户来源 **/ + @Schema(description = "客户来源") + @JsonProperty("yunzhupaas_mdm_customer_yunzhupaas_customer_source") + @JSONField(name = "yunzhupaas_mdm_customer_yunzhupaas_customer_source") + private Object yunzhupaas_customer_yunzhupaas_customerSource; + /** 经营范围 **/ + @Schema(description = "经营范围") + @JsonProperty("business_scope") + @JSONField(name = "business_scope") + private String businessScope; + /** 备注 **/ + @Schema(description = "备注") + @JsonProperty("remark") + @JSONField(name = "remark") + private String remark; + + /** 子表数据 **/ + @Schema(description = "companyInvoice子表数据") + @JsonProperty("companyInvoiceList") + private List companyInvoiceList; + /** 子表数据 **/ + @Schema(description = "companyBank子表数据") + @JsonProperty("companyBankList") + private List companyBankList; +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/custinfo/CustinfoPagination.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/custinfo/CustinfoPagination.java new file mode 100644 index 0000000..41e3d2c --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/custinfo/CustinfoPagination.java @@ -0,0 +1,55 @@ +package com.yunzhupaas.mdm.model.custinfo; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import com.yunzhupaas.base.Pagination; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.List; + +/** + * + * 客户信息 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-24 + */ +@Data +@Schema(description = "列表查询参数") +public class CustinfoPagination extends Pagination { + /** 关键词搜索 */ + @Schema(description = "关键词搜索") + private String yunzhupaasKeyword; + /** 查询key */ + @Schema(description = "查询key") + private String[] selectKey; + /** 选中数据数组id */ + @Schema(description = "选中数据数组id") + private Object[] selectIds; + /** json */ + @Schema(description = "json") + private String json; + /** 数据类型 0-当前页,1-全部数据 */ + @Schema(description = "数据类型 0-当前页,1-全部数据") + private String dataType; + /** 高级查询 */ + @Schema(description = "高级查询") + private String superQueryJson; + /** 功能id */ + @Schema(description = "功能id") + private String moduleId; + /** 菜单id */ + @Schema(description = "菜单id") + private String menuId; + /** 企业名称 */ + @Schema(description = "企业名称") + @JsonProperty("company_name") + @JSONField(name = "companyName") + private Object companyName; + /** 归属组织 */ + @Schema(description = "归属组织") + @JsonProperty("org_id") + @JSONField(name = "orgId") + private Object orgId; +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/lpc/LpcConstant.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/lpc/LpcConstant.java new file mode 100644 index 0000000..8cc35aa --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/lpc/LpcConstant.java @@ -0,0 +1,46 @@ +package com.yunzhupaas.mdm.model.lpc; + +import com.yunzhupaas.util.JsonUtil; +import java.util.*; + +/** + * 法人公司配置json + * + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-24 + */ +public class LpcConstant{ + /** 数据库链接 */ + public static final String DBLINKID = "0"; + /** 表别名 map */ + public static final Map TABLERENAMES = JsonUtil.getJsonToBean("{\"mdm_company_bank\":\"companyBank\",\"mdm_company_invoice\":\"company_invoice\",\"mdm_corporation\":\"corporation\",\"mdm_company\":\"company\"}",Map.class); + /** 子表model map */ + public static final Map TABLEFIELDKEY = JsonUtil.getJsonToBean("{\"tableFieldbd0aa4\":\"mdm_company_bank\",\"tableField5ced3a\":\"mdm_company_invoice\"}",Map.class); + /** 整个表单配置json */ + public static final String getFormData(){ + StringBuilder sb = new StringBuilder(); +sb.append("{\"popupType\":\"drawer\",\"labelWidth\":100,\"classNames\":[],\"className\":[],\"fullScreenWidth\":\"100%\",\"hasConfirmAndAddBtn\":true,\"cancelButtonTextI18nCode\":\"common.cancelText\",\"businessKeyTip\":\"数据已存在,请勿重复提交!\",\"labelPosition\":\"right\",\"printId\":\"\",\"labelSuffix\":\"\",\"customBtns\":[],\"disabled\":false,\"formModel\":\"dataForm\",\"cancelButtonText\":\"取消\",\"confirmButtonText\":\"确定\",\"hasCancelBtn\":true,\"primaryKeyPolicy\":1,\"hasPrintBtn\":false,\"concurrencyLock\":false,\"classJson\":\"\",\"drawerWidth\":\"1000px\",\"confirmButtonTextI18nCode\":\"common.okText\",\"printButtonText\":\"打印\",\"businessKeyList\":[],\"formRef\":\"formRef\",\"gutter\":15,\"logicalDelete\":true,\"size\":\"middle\",\"formRules\":\"rules\",\"generalWidth\":\"600px\",\"colon\":false,\"hasConfirmBtn\":true,\"useBusinessKey\":false,\"formStyle\":\"\",\"printButtonTextI18nCode\":\"common.printText\",\"fields\":[{\"optionType\":\"default\",\"__config__\":{\"yunzhupaasKey\":\"radio\",\"defaultValue\":\"ORG\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776916730323,\"tagIcon\":\"icon-ym icon-ym-generator-radio\",\"tag\":\"YunzhupaasRadio\",\"formId\":\"formItembb71f5\",\"visibility\":[\"pc\",\"app\"],\"noShow\":true,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"实体类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"size\":\"default\",\"buttonStyle\":\"solid\",\"options\":[{\"fullName\":\"组织/企业\",\"id\":\"ORG\"},{\"fullName\":\"个人\",\"id\":\"IND\"}],\"__vModel__\":\"entity_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"direction\":\"horizontal\"},{\"__config__\":{\"formId\":\"formItemd86399\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"CorporationCode\",\"className\":[],\"label\":\"企业编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756346790,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"法人单位编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":8},\"readonly\":true,\"__vModel__\":\"company_code\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"系统自动生成\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemac3814\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"企业名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776756270027,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"company_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem950378\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"简称/昵称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756445058,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"short_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formIteme913d2\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"社会信用代码\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776756480142,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"credit_code\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776756520113,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemf1b719\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"multiple\":false,\"__vModel__\":\"tax_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"}},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"formId\":\"formItem3e0d06\",\"yunzhupaasKey\":\"organizeSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"归属组织\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776756606740,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasOrganizeSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"ableIds\":[],\"multiple\":false,\"__vModel__\":\"org_id\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"formId\":\"formItembac4d7\",\"yunzhupaasKey\":\"areaSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属地区\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756709692,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-Provinces\",\"tag\":\"YunzhupaasAreaSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"level\":2,\"multiple\":false,\"__vModel__\":\"province_id\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756797475,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem402f2c\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"9b542177a477488994ce09fff3c93901\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"multiple\":false,\"__vModel__\":\"enterprise_nature\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"}},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756887768,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem62cf2d\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"d59a3cf65f9847dbb08be449e3feae16\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"行业代码\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"multiple\":false,\"__vModel__\":\"industry_code\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"}},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756923859,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem236419\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"enterpriseScale\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业规模\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"multiple\":false,\"__vModel__\":\"enterprise_scale\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"}},{\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756967842,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItem31fbac\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"成立日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"format\":\"yyyy-MM-dd\",\"__vModel__\":\"registration_date\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择\"},{\"__config__\":{\"formId\":\"formItembe6067\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"注册资本\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757334161,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"controls\":false,\"__vModel__\":\"registered_capital\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"placeholder\":\"请输入\",\"thousands\":false,\"isAmountChinese\":false,\"addonBefore\":\"\",\"addonAfter\":\"万元\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemb811fc\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"法定代表人\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757395564,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"legal_representative\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5f994c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"联系电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757411562,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"phone\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItembcb540\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"邮箱\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757415485,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"email\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem2b0674\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"网站\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757420940,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"website\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem8e2a41\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757434551,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"address\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"ableRelationIds\":[],\"clearable\":true,\"__config__\":{\"formId\":\"formItem9e3ebb\",\"yunzhupaasKey\":\"userSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":\"\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"负责人\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_corporation\",\"renderKey\":1776911034109,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-user\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasUserSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"ableIds\":[],\"multiple\":false,\"__vModel__\":\"yunzhupaas_mdm_corporation_yunzhupaas_major_person_id\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"placeholder\":\"请选择\",\"relationField\":\"\"},{\"autoSize\":{\"minRows\":2,\"maxRows\":10},\"clearable\":true,\"showCount\":false,\"__config__\":{\"formId\":\"formItem1cbed8\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"经营范围\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757471228,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"business_scope\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\"},{\"autoSize\":{\"minRows\":2,\"maxRows\":10},\"clearable\":true,\"showCount\":false,\"__config__\":{\"formId\":\"formItem5e3ca2\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757518231,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"remark\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\"},{\"__config__\":{\"formId\":\"formItem509c12\",\"yunzhupaasKey\":\"tab\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dragDisabled\":false,\"active\":\"1\",\"className\":[],\"label\":\"标签面板\",\"showLabel\":false,\"renderKey\":1776757617618,\"tableName\":\"mdm_legal\",\"layout\":\"rowFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-label\",\"children\":[{\"__config__\":{\"formId\":\"formItem36ded3\",\"yunzhupaasKey\":\"tabItem\",\"children\":[{\"showSummary\":false,\"__config__\":{\"formId\":\"formItem5ced3a\",\"yunzhupaasKey\":\"table\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"设计子表\",\"showLabel\":false,\"tableName\":\"mdm_company_invoice\",\"renderKey\":1776757656101,\"layout\":\"rowFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-table\",\"children\":[{\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"billRule\",\"parentVModel\":\"tableField5ced3a\",\"dragDisabled\":false,\"rule\":\"InvoiceTitleCode\",\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757704179,\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"isSubTable\":true,\"ruleName\":\"发票抬头编码\",\"tag\":\"YunzhupaasInput\",\"formId\":\"formItemf85a31\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"发票抬头编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"layout\":\"colFormItem\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"title_code\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"系统自动生成\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItema0f091\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"发票抬头名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776757735612,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"title_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem410ef8\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"纳税人识别号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776757742594,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"credit_code\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"parentVModel\":\"tableField5ced3a\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776757754042,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem9a9db2\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"multiple\":false,\"__vModel__\":\"tax_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"}},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formIteme1488f\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757782422,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"address\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem58d117\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757790773,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"phone\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5736dd\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户银行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757797258,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem7541c6\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账户\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757803853,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_account\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItemfa99ed\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否默认抬头\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757838265,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"activeValue\":1,\"inactiveValue\":0,\"__vModel__\":\"is_defalut\",\"inactiveTxt\":\"N\",\"disabled\":false,\"activeTxt\":\"Y\"},{\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItema0c23f\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否有效\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757884853,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"activeValue\":1,\"inactiveValue\":0,\"__vModel__\":\"is_valid\",\"inactiveTxt\":\"N\",\"disabled\":false,\"activeTxt\":\"Y\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemf6c9b4\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_legal\",\"renderKey\":1776757948832,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"remark\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"}],\"showTitle\":false,\"complexHeaderList\":[],\"tag\":\"YunzhupaasInputTable\",\"componentName\":\"table5ced3a\",\"tableAlign\":\"left\",\"span\":24},\"defaultValue\":[],\"footerBtnsList\":[{\"btnIcon\":\"icon-ym icon-ym-btn-add\",\"show\":true,\"label\":\"添加\",\"btnType\":\"primary\",\"value\":\"add\",\"labelI18nCode\":\"common.add1Text\"},{\"btnIcon\":\"icon-ym icon-ym-btn-clearn\",\"showConfirm\":true,\"show\":true,\"label\":\"批量删除\",\"btnType\":\"danger\",\"value\":\"batchRemove\",\"labelI18nCode\":\"common.batchDelText\"}],\"defaultExpandAll\":true,\"__vModel__\":\"tableField5ced3a\",\"layoutType\":\"table\",\"disabled\":false,\"columnBtnsList\":[{\"btnIcon\":\"icon-ym icon-ym-btn-edit\",\"show\":true,\"label\":\"复制\",\"btnType\":\"primary\",\"value\":\"copy\",\"labelI18nCode\":\"common.copyText\"},{\"btnIcon\":\"icon-ym icon-ym-btn-clearn\",\"showConfirm\":true,\"show\":true,\"label\":\"删除\",\"btnType\":\"danger\",\"value\":\"remove\",\"labelI18nCode\":\"common.delText\"}],\"summaryField\":[]}],\"renderKey\":1776757617618},\"name\":\"1\",\"title\":\"发票抬头\"},{\"__config__\":{\"formId\":\"formItemabc8f8\",\"yunzhupaasKey\":\"tabItem\",\"children\":[{\"showSummary\":false,\"__config__\":{\"formId\":\"formItembd0aa4\",\"yunzhupaasKey\":\"table\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"设计子表\",\"showLabel\":false,\"tableName\":\"mdm_company_bank\",\"renderKey\":1776757996304,\"layout\":\"rowFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-table\",\"children\":[{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItema6ee01\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldbd0aa4\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776758021515,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem961220\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldbd0aa4\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"账户名\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776758032023,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_account_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem68e172\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldbd0aa4\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776758041593,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_account_number\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formIteme5e523\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldbd0aa4\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行城市\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776758062168,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_province\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem5c7f16\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldbd0aa4\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776758070020,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"remark\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"}],\"showTitle\":false,\"complexHeaderList\":[],\"tag\":\"YunzhupaasInputTable\",\"componentName\":\"tablebd0aa4\",\"tableAlign\":\"left\",\"span\":24},\"defaultValue\":[],\"footerBtnsList\":[{\"btnIcon\":\"icon-ym icon-ym-btn-add\",\"show\":true,\"label\":\"添加\",\"btnType\":\"primary\",\"value\":\"add\",\"labelI18nCode\":\"common.add1Text\"},{\"btnIcon\":\"icon-ym icon-ym-btn-clearn\",\"showConfirm\":true,\"show\":true,\"label\":\"批量删除\",\"btnType\":\"danger\",\"value\":\"batchRemove\",\"labelI18nCode\":\"common.batchDelText\"}],\"defaultExpandAll\":true,\"__vModel__\":\"tableFieldbd0aa4\",\"layoutType\":\"table\",\"disabled\":false,\"columnBtnsList\":[{\"btnIcon\":\"icon-ym icon-ym-btn-edit\",\"show\":true,\"label\":\"复制\",\"btnType\":\"primary\",\"value\":\"copy\",\"labelI18nCode\":\"common.copyText\"},{\"btnIcon\":\"icon-ym icon-ym-btn-clearn\",\"showConfirm\":true,\"show\":true,\"label\":\"删除\",\"btnType\":\"danger\",\"value\":\"remove\",\"labelI18nCode\":\"common.delText\"}],\"summaryField\":[]}],\"renderKey\":1776757617618},\"name\":\"2\",\"title\":\"银行账户\"}],\"tag\":\"ATab\",\"componentName\":\"tab509c12\",\"span\":24},\"tabPosition\":\"top\",\"type\":\"\"}],\"detailExtraList\":[],\"span\":24,\"dataLog\":false}"); return sb.toString(); + } + /** 列表字段配置json */ + public static final String getColumnData(){ + StringBuilder sb = new StringBuilder(); + sb.append("{\"showSummary\":false,\"treePropsValue\":\"id\",\"columnOptions\":[{\"buttonStyle\":\"solid\",\"fullName\":\"实体类型\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"optionType\":\"default\",\"__config__\":{\"yunzhupaasKey\":\"radio\",\"defaultValue\":\"ORG\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776916730323,\"tagIcon\":\"icon-ym icon-ym-generator-radio\",\"tag\":\"YunzhupaasRadio\",\"formId\":\"formItembb71f5\",\"visibility\":[\"pc\",\"app\"],\"noShow\":true,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"实体类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"size\":\"default\",\"options\":[{\"fullName\":\"组织/企业\",\"id\":\"ORG\"},{\"fullName\":\"个人\",\"id\":\"IND\"}],\"__vModel__\":\"entity_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"entity_type\",\"direction\":\"horizontal\"},{\"__config__\":{\"formId\":\"formItemd86399\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"CorporationCode\",\"className\":[],\"label\":\"企业编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756346790,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"法人单位编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":8},\"readonly\":true,\"__vModel__\":\"company_code\",\"fullName\":\"企业编码\",\"fullNameI18nCode\":[\"\"],\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"company_code\",\"placeholder\":\"系统自动生成\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"企业名称\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemac3814\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"企业名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776756270027,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"company_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"company_name\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"简称/昵称\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem950378\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"简称/昵称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756445058,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"short_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"short_name\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"社会信用代码\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formIteme913d2\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"社会信用代码\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776756480142,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"credit_code\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"credit_code\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"纳税人类别\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776756520113,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemf1b719\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_type\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"归属组织\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"formId\":\"formItem3e0d06\",\"yunzhupaasKey\":\"organizeSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"归属组织\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776756606740,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasOrganizeSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"org_id\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"org_id\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"level\":2,\"multiple\":false,\"fullName\":\"所属地区\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"formId\":\"formItembac4d7\",\"yunzhupaasKey\":\"areaSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属地区\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756709692,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-Provinces\",\"tag\":\"YunzhupaasAreaSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"province_id\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"province_id\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"企业类型\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756797475,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem402f2c\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"9b542177a477488994ce09fff3c93901\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"enterprise_nature\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_nature\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"行业代码\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756887768,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem62cf2d\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"d59a3cf65f9847dbb08be449e3feae16\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"行业代码\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"industry_code\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"industry_code\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"企业规模\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756923859,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem236419\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"enterpriseScale\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业规模\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"enterprise_scale\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_scale\",\"placeholder\":\"请选择\"},{\"clearable\":true,\"format\":\"yyyy-MM-dd\",\"fullName\":\"成立日期\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756967842,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItem31fbac\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"成立日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"registration_date\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"registration_date\",\"placeholder\":\"请选择\"},{\"controls\":false,\"fullName\":\"注册资本\",\"fullNameI18nCode\":[\"\"],\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"万元\",\"__config__\":{\"formId\":\"formItembe6067\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"注册资本\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757334161,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"registered_capital\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"registered_capital\",\"placeholder\":\"请输入\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"法定代表人\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemb811fc\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"法定代表人\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757395564,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"legal_representative\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"legal_representative\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"联系电话\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5f994c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"联系电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757411562,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"phone\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"phone\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"邮箱\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItembcb540\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"邮箱\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757415485,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"email\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"email\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"网站\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem2b0674\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"网站\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757420940,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"website\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"website\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"地址\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem8e2a41\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757434551,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"address\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"address\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"ableRelationIds\":[],\"clearable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"负责人\",\"fullNameI18nCode\":[\"\"],\"relationField\":\"\",\"__config__\":{\"formId\":\"formItem9e3ebb\",\"yunzhupaasKey\":\"userSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":\"\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"负责人\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_corporation\",\"renderKey\":1776911034109,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-user\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasUserSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"yunzhupaas_mdm_corporation_yunzhupaas_major_person_id\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"yunzhupaas_mdm_corporation_yunzhupaas_major_person_id\",\"placeholder\":\"请选择\"},{\"clearable\":true,\"fullName\":\"经营范围\",\"fullNameI18nCode\":[\"\"],\"autoSize\":{\"minRows\":2,\"maxRows\":10},\"showCount\":false,\"__config__\":{\"formId\":\"formItem1cbed8\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"经营范围\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757471228,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"business_scope\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"business_scope\",\"placeholder\":\"请输入\"},{\"clearable\":true,\"fullName\":\"备注\",\"fullNameI18nCode\":[\"\"],\"autoSize\":{\"minRows\":2,\"maxRows\":10},\"showCount\":false,\"__config__\":{\"formId\":\"formItem5e3ca2\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757518231,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"remark\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"remark\",\"placeholder\":\"请输入\"},{\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"billRule\",\"parentVModel\":\"tableField5ced3a\",\"dragDisabled\":false,\"rule\":\"InvoiceTitleCode\",\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757704179,\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"isSubTable\":true,\"ruleName\":\"发票抬头编码\",\"tag\":\"YunzhupaasInput\",\"formId\":\"formItemf85a31\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"发票抬头编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"layout\":\"colFormItem\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"title_code\",\"fullName\":\"设计子表-发票抬头编码\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField5ced3a-title_code\",\"placeholder\":\"系统自动生成\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-发票抬头名称\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItema0f091\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"发票抬头名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776757735612,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"title_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField5ced3a-title_name\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-纳税人识别号\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem410ef8\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"纳税人识别号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776757742594,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"credit_code\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField5ced3a-credit_code\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"设计子表-纳税人类别\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"parentVModel\":\"tableField5ced3a\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776757754042,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem9a9db2\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField5ced3a-tax_type\",\"placeholder\":\"请选择\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-地址\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formIteme1488f\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757782422,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"address\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField5ced3a-address\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-电话\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem58d117\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757790773,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"phone\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField5ced3a-phone\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-开户银行\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5736dd\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户银行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757797258,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField5ced3a-bank_name\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-银行账户\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem7541c6\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账户\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757803853,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_account\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField5ced3a-bank_account\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItemfa99ed\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否默认抬头\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757838265,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"activeValue\":1,\"inactiveValue\":0,\"__vModel__\":\"is_defalut\",\"fullName\":\"设计子表-是否默认抬头\",\"inactiveTxt\":\"N\",\"fullNameI18nCode\":[\"\",\"\"],\"disabled\":false,\"activeTxt\":\"Y\",\"id\":\"tableField5ced3a-is_defalut\"},{\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItema0c23f\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否有效\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757884853,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"activeValue\":1,\"inactiveValue\":0,\"__vModel__\":\"is_valid\",\"fullName\":\"设计子表-是否有效\",\"inactiveTxt\":\"N\",\"fullNameI18nCode\":[\"\",\"\"],\"disabled\":false,\"activeTxt\":\"Y\",\"id\":\"tableField5ced3a-is_valid\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-备注\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemf6c9b4\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_legal\",\"renderKey\":1776757948832,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"remark\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField5ced3a-remark\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-开户行\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItema6ee01\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldbd0aa4\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776758021515,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldbd0aa4-bank_name\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-账户名\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem961220\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldbd0aa4\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"账户名\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776758032023,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_account_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldbd0aa4-bank_account_name\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-银行账号\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem68e172\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldbd0aa4\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776758041593,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_account_number\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldbd0aa4-bank_account_number\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-开户行城市\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formIteme5e523\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldbd0aa4\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行城市\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776758062168,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_province\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldbd0aa4-bank_province\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-备注\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem5c7f16\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldbd0aa4\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776758070020,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"remark\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldbd0aa4-remark\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"}],\"pageSize\":20,\"type\":1,\"columnBtnsList\":[{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-edit\",\"label\":\"编辑\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"edit\",\"labelI18nCode\":\"common.editText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"删除\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"remove\",\"labelI18nCode\":\"common.delText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-generator-menu\",\"label\":\"详情\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"detail\",\"labelI18nCode\":\"common.detailText\"}],\"treeTitle\":\"左侧标题\",\"defaultColumnList\":[{\"yunzhupaasKey\":\"radio\",\"resizable\":true,\"buttonStyle\":\"solid\",\"fullName\":\"实体类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"实体类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"optionType\":\"default\",\"__config__\":{\"yunzhupaasKey\":\"radio\",\"defaultValue\":\"ORG\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776916730323,\"tagIcon\":\"icon-ym icon-ym-generator-radio\",\"tag\":\"YunzhupaasRadio\",\"formId\":\"formItembb71f5\",\"visibility\":[\"pc\",\"app\"],\"noShow\":true,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"实体类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"size\":\"default\",\"prop\":\"entity_type\",\"options\":[{\"fullName\":\"组织/企业\",\"id\":\"ORG\"},{\"fullName\":\"个人\",\"id\":\"IND\"}],\"__vModel__\":\"entity_type\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"entity_type\",\"labelI18nCode\":\"\",\"direction\":\"horizontal\"},{\"yunzhupaasKey\":\"billRule\",\"resizable\":true,\"fullName\":\"企业编码\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业编码\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItemd86399\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"CorporationCode\",\"className\":[],\"label\":\"企业编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756346790,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"法人单位编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":8},\"readonly\":true,\"prop\":\"company_code\",\"__vModel__\":\"company_code\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"company_code\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemac3814\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"企业名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776756270027,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"company_name\",\"__vModel__\":\"company_name\",\"checked\":true,\"disabled\":false,\"id\":\"company_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"企业名称\",\"label\":\"企业名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem950378\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"简称/昵称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756445058,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"short_name\",\"__vModel__\":\"short_name\",\"checked\":true,\"disabled\":false,\"id\":\"short_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"简称/昵称\",\"label\":\"简称/昵称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formIteme913d2\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"社会信用代码\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776756480142,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"credit_code\",\"__vModel__\":\"credit_code\",\"checked\":true,\"disabled\":false,\"id\":\"credit_code\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"社会信用代码\",\"label\":\"社会信用代码\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"纳税人类别\",\"fullNameI18nCode\":[\"\"],\"label\":\"纳税人类别\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776756520113,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemf1b719\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"tax_type\",\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_type\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"organizeSelect\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"归属组织\",\"fullNameI18nCode\":[\"\"],\"label\":\"归属组织\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItem3e0d06\",\"yunzhupaasKey\":\"organizeSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"归属组织\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776756606740,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasOrganizeSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"org_id\",\"__vModel__\":\"org_id\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"org_id\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"areaSelect\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"level\":2,\"multiple\":false,\"fullName\":\"所属地区\",\"fullNameI18nCode\":[\"\"],\"label\":\"所属地区\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItembac4d7\",\"yunzhupaasKey\":\"areaSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属地区\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756709692,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-Provinces\",\"tag\":\"YunzhupaasAreaSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"province_id\",\"__vModel__\":\"province_id\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"province_id\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"企业类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756797475,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem402f2c\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"9b542177a477488994ce09fff3c93901\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"enterprise_nature\",\"__vModel__\":\"enterprise_nature\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_nature\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"行业代码\",\"fullNameI18nCode\":[\"\"],\"label\":\"行业代码\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756887768,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem62cf2d\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"d59a3cf65f9847dbb08be449e3feae16\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"行业代码\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"industry_code\",\"__vModel__\":\"industry_code\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"industry_code\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"企业规模\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业规模\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756923859,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem236419\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"enterpriseScale\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业规模\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"enterprise_scale\",\"__vModel__\":\"enterprise_scale\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_scale\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"datePicker\",\"clearable\":true,\"resizable\":true,\"format\":\"yyyy-MM-dd\",\"fullName\":\"成立日期\",\"fullNameI18nCode\":[\"\"],\"label\":\"成立日期\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756967842,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItem31fbac\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"成立日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"registration_date\",\"__vModel__\":\"registration_date\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"registration_date\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItembe6067\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"注册资本\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757334161,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"registered_capital\",\"__vModel__\":\"registered_capital\",\"checked\":true,\"disabled\":false,\"id\":\"registered_capital\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"resizable\":true,\"fullName\":\"注册资本\",\"label\":\"注册资本\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"万元\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemb811fc\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"法定代表人\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757395564,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"legal_representative\",\"__vModel__\":\"legal_representative\",\"checked\":true,\"disabled\":false,\"id\":\"legal_representative\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"法定代表人\",\"label\":\"法定代表人\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5f994c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"联系电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757411562,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"phone\",\"__vModel__\":\"phone\",\"checked\":true,\"disabled\":false,\"id\":\"phone\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"联系电话\",\"label\":\"联系电话\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItembcb540\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"邮箱\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757415485,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"email\",\"__vModel__\":\"email\",\"checked\":true,\"disabled\":false,\"id\":\"email\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"邮箱\",\"label\":\"邮箱\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem2b0674\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"网站\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757420940,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"website\",\"__vModel__\":\"website\",\"checked\":true,\"disabled\":false,\"id\":\"website\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"网站\",\"label\":\"网站\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem8e2a41\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757434551,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"address\",\"__vModel__\":\"address\",\"checked\":true,\"disabled\":false,\"id\":\"address\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"地址\",\"label\":\"地址\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"ableRelationIds\":[],\"yunzhupaasKey\":\"userSelect\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"__config__\":{\"formId\":\"formItem9e3ebb\",\"yunzhupaasKey\":\"userSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":\"\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"负责人\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_corporation\",\"renderKey\":1776911034109,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-user\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasUserSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"yunzhupaas_mdm_corporation_yunzhupaas_major_person_id\",\"__vModel__\":\"yunzhupaas_mdm_corporation_yunzhupaas_major_person_id\",\"checked\":true,\"selectType\":\"all\",\"disabled\":false,\"id\":\"yunzhupaas_mdm_corporation_yunzhupaas_major_person_id\",\"placeholder\":\"请选择\",\"clearable\":true,\"resizable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"负责人\",\"label\":\"负责人\",\"sortable\":false,\"relationField\":\"\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"fullName\":\"经营范围\",\"fullNameI18nCode\":[\"\"],\"label\":\"经营范围\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":10},\"showCount\":false,\"__config__\":{\"formId\":\"formItem1cbed8\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"经营范围\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757471228,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"business_scope\",\"__vModel__\":\"business_scope\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"business_scope\",\"placeholder\":\"请输入\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"fullName\":\"备注\",\"fullNameI18nCode\":[\"\"],\"label\":\"备注\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":10},\"showCount\":false,\"__config__\":{\"formId\":\"formItem5e3ca2\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757518231,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"remark\",\"__vModel__\":\"remark\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"remark\",\"placeholder\":\"请输入\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"billRule\",\"resizable\":true,\"fullName\":\"设计子表-发票抬头编码\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"设计子表-发票抬头编码\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"billRule\",\"parentVModel\":\"tableField5ced3a\",\"dragDisabled\":false,\"rule\":\"InvoiceTitleCode\""); + sb.append(",\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757704179,\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"isSubTable\":true,\"ruleName\":\"发票抬头编码\",\"tag\":\"YunzhupaasInput\",\"formId\":\"formItemf85a31\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"发票抬头编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"layout\":\"colFormItem\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField5ced3a-title_code\",\"__vModel__\":\"title_code\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField5ced3a-title_code\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItema0f091\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"发票抬头名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776757735612,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField5ced3a-title_name\",\"__vModel__\":\"title_name\",\"checked\":false,\"disabled\":false,\"id\":\"tableField5ced3a-title_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"设计子表-发票抬头名称\",\"label\":\"设计子表-发票抬头名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem410ef8\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"纳税人识别号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776757742594,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField5ced3a-credit_code\",\"__vModel__\":\"credit_code\",\"checked\":false,\"disabled\":false,\"id\":\"tableField5ced3a-credit_code\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"设计子表-纳税人识别号\",\"label\":\"设计子表-纳税人识别号\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"设计子表-纳税人类别\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"设计子表-纳税人类别\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"parentVModel\":\"tableField5ced3a\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776757754042,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem9a9db2\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"tableField5ced3a-tax_type\",\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField5ced3a-tax_type\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formIteme1488f\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757782422,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField5ced3a-address\",\"__vModel__\":\"address\",\"checked\":false,\"disabled\":false,\"id\":\"tableField5ced3a-address\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"设计子表-地址\",\"label\":\"设计子表-地址\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem58d117\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757790773,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField5ced3a-phone\",\"__vModel__\":\"phone\",\"checked\":false,\"disabled\":false,\"id\":\"tableField5ced3a-phone\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"设计子表-电话\",\"label\":\"设计子表-电话\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5736dd\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户银行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757797258,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField5ced3a-bank_name\",\"__vModel__\":\"bank_name\",\"checked\":false,\"disabled\":false,\"id\":\"tableField5ced3a-bank_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"设计子表-开户银行\",\"label\":\"设计子表-开户银行\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem7541c6\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账户\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757803853,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField5ced3a-bank_account\",\"__vModel__\":\"bank_account\",\"checked\":false,\"disabled\":false,\"id\":\"tableField5ced3a-bank_account\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"设计子表-银行账户\",\"label\":\"设计子表-银行账户\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"switch\",\"resizable\":true,\"activeValue\":1,\"inactiveValue\":0,\"fullName\":\"设计子表-是否默认抬头\",\"inactiveTxt\":\"N\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"设计子表-是否默认抬头\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItemfa99ed\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否默认抬头\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757838265,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"tableField5ced3a-is_defalut\",\"__vModel__\":\"is_defalut\",\"checked\":false,\"fixed\":\"none\",\"disabled\":false,\"activeTxt\":\"Y\",\"id\":\"tableField5ced3a-is_defalut\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"switch\",\"resizable\":true,\"activeValue\":1,\"inactiveValue\":0,\"fullName\":\"设计子表-是否有效\",\"inactiveTxt\":\"N\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"设计子表-是否有效\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItema0c23f\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否有效\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757884853,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"tableField5ced3a-is_valid\",\"__vModel__\":\"is_valid\",\"checked\":false,\"fixed\":\"none\",\"disabled\":false,\"activeTxt\":\"Y\",\"id\":\"tableField5ced3a-is_valid\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemf6c9b4\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_legal\",\"renderKey\":1776757948832,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField5ced3a-remark\",\"__vModel__\":\"remark\",\"checked\":false,\"disabled\":false,\"id\":\"tableField5ced3a-remark\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"设计子表-备注\",\"label\":\"设计子表-备注\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItema6ee01\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldbd0aa4\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776758021515,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldbd0aa4-bank_name\",\"__vModel__\":\"bank_name\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldbd0aa4-bank_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"设计子表-开户行\",\"label\":\"设计子表-开户行\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem961220\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldbd0aa4\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"账户名\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776758032023,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldbd0aa4-bank_account_name\",\"__vModel__\":\"bank_account_name\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldbd0aa4-bank_account_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"设计子表-账户名\",\"label\":\"设计子表-账户名\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem68e172\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldbd0aa4\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776758041593,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldbd0aa4-bank_account_number\",\"__vModel__\":\"bank_account_number\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldbd0aa4-bank_account_number\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"设计子表-银行账号\",\"label\":\"设计子表-银行账号\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formIteme5e523\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldbd0aa4\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行城市\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776758062168,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldbd0aa4-bank_province\",\"__vModel__\":\"bank_province\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldbd0aa4-bank_province\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"设计子表-开户行城市\",\"label\":\"设计子表-开户行城市\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem5c7f16\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldbd0aa4\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776758070020,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldbd0aa4-remark\",\"__vModel__\":\"remark\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldbd0aa4-remark\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"设计子表-备注\",\"label\":\"设计子表-备注\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"}],\"treeRelationFieldAbleIds\":[],\"treeSyncInterfaceName\":\"\",\"treeSyncTemplateJson\":[],\"treeRelation\":\"org_id\",\"defaultSortConfig\":[{\"field\":\"company_code\",\"sort\":\"asc\",\"id\":\"sort38931d\"}],\"tabConfig\":{\"hasAllTab\":true,\"relationField\":\"\",\"on\":false},\"hasSuperQuery\":true,\"treePropsLabel\":\"fullName\",\"groupField\":\"\",\"printIds\":[],\"uploaderTemplateJson\":{\"selectKey\":[\"company_name\",\"short_name\",\"credit_code\",\"tax_type\",\"org_id\",\"province_id\",\"enterprise_nature\",\"industry_code\",\"enterprise_scale\",\"registration_date\",\"registered_capital\",\"legal_representative\",\"phone\",\"email\",\"website\",\"address\",\"yunzhupaas_mdm_corporation_yunzhupaas_major_person_id\",\"business_scope\",\"remark\",\"tableField5ced3a-title_name\",\"tableField5ced3a-credit_code\",\"tableField5ced3a-tax_type\",\"tableField5ced3a-address\",\"tableField5ced3a-phone\",\"tableField5ced3a-bank_name\",\"tableField5ced3a-bank_account\",\"tableField5ced3a-is_defalut\",\"tableField5ced3a-is_valid\",\"tableField5ced3a-remark\",\"tableFieldbd0aa4-bank_name\",\"tableFieldbd0aa4-bank_account_name\",\"tableFieldbd0aa4-bank_account_number\",\"tableFieldbd0aa4-bank_province\",\"tableFieldbd0aa4-remark\"],\"dataType\":\"2\"},\"hasTreeQuery\":false,\"useFormPermission\":true,\"complexHeaderList\":[],\"useBtnPermission\":true,\"treeSyncType\":0,\"hasPage\":true,\"searchList\":[{\"yunzhupaasKey\":\"organizeSelect\",\"filterable\":false,\"clearable\":true,\"searchType\":1,\"ableIds\":[],\"multiple\":false,\"fullName\":\"归属组织\",\"fullNameI18nCode\":[\"\"],\"label\":\"归属组织\",\"__config__\":{\"formId\":\"formItem3e0d06\",\"yunzhupaasKey\":\"organizeSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"归属组织\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776756606740,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasOrganizeSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"org_id\",\"__vModel__\":\"org_id\",\"searchMultiple\":true,\"isKeyword\":false,\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"org_id\",\"placeholder\":\"请选择\",\"value\":[],\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"showCount\":false,\"__config__\":{\"formId\":\"formItemac3814\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"企业名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776756270027,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"company_name\",\"__vModel__\":\"company_name\",\"searchMultiple\":false,\"disabled\":false,\"id\":\"company_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"searchType\":2,\"noShow\":false,\"fullName\":\"企业名称\",\"label\":\"企业名称\",\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"isKeyword\":false,\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"}],\"ruleList\":{\"conditionList\":[{\"groups\":[{\"ableRelationIds\":[],\"symbol\":\"notNull\",\"yunzhupaasKey\":\"userSelect\",\"clearable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"负责人\",\"fullNameI18nCode\":[\"\"],\"relationField\":\"\",\"fieldValueYunzhupaasKey\":\"\",\"__config__\":{\"formId\":\"formItem9e3ebb\",\"yunzhupaasKey\":\"userSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":\"\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"负责人\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_corporation\",\"renderKey\":1776911034109,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-user\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasUserSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"field\":\"yunzhupaas_mdm_corporation_yunzhupaas_major_person_id\",\"__vModel__\":\"yunzhupaas_mdm_corporation_yunzhupaas_major_person_id\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":true,\"cellKey\":1776919033119,\"id\":\"yunzhupaas_mdm_corporation_yunzhupaas_major_person_id\",\"placeholder\":\"请选择\",\"fieldValueType\":2}],\"logic\":\"and\"}],\"matchLogic\":\"and\"},\"childTableStyle\":1,\"treePropsChildren\":\"children\",\"treeRelationFieldSelectType\":\"all\",\"showOverflow\":true,\"treeTemplateJson\":[],\"treeTitleI18nCode\":\"\",\"treePropsName\":\"\",\"useColumnPermission\":false,\"treePropsUrl\":\"\",\"btnsList\":[{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-add\",\"label\":\"新增\",\"value\":\"add\",\"labelI18nCode\":\"common.add2Text\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-download\",\"label\":\"导出\",\"value\":\"download\",\"labelI18nCode\":\"common.exportText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-upload\",\"label\":\"导入\",\"value\":\"upload\",\"labelI18nCode\":\"common.importText\"},{\"show\":false,\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"批量删除\",\"value\":\"batchRemove\",\"labelI18nCode\":\"common.batchDelText\"},{\"show\":false,\"icon\":\"icon-ym icon-ym-report-icon-preview-printPreview\",\"label\":\"批量打印\",\"value\":\"batchPrint\",\"labelI18nCode\":\"common.batchPrintText\"}],\"useDataPermission\":true,\"viewKey\":\"\",\"columnList\":[{\"yunzhupaasKey\":\"billRule\",\"resizable\":true,\"fullName\":\"企业编码\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业编码\",\"sortable\":true,\"align\":\"left\",\"__config__\":{\"formId\":\"formItemd86399\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"CorporationCode\",\"className\":[],\"label\":\"企业编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756346790,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"法人单位编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":8},\"readonly\":true,\"prop\":\"company_code\",\"__vModel__\":\"company_code\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"company_code\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemac3814\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"企业名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776756270027,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"company_name\",\"__vModel__\":\"company_name\",\"disabled\":false,\"id\":\"company_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"企业名称\",\"label\":\"企业名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem950378\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"简称/昵称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756445058,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"short_name\",\"__vModel__\":\"short_name\",\"disabled\":false,\"id\":\"short_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"简称/昵称\",\"label\":\"简称/昵称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formIteme913d2\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"社会信用代码\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776756480142,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"credit_code\",\"__vModel__\":\"credit_code\",\"disabled\":false,\"id\":\"credit_code\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"社会信用代码\",\"label\":\"社会信用代码\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"纳税人类别\",\"fullNameI18nCode\":[\"\"],\"label\":\"纳税人类别\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776756520113,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemf1b719\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"tax_type\",\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_type\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"organizeSelect\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"归属组织\",\"fullNameI18nCode\":[\"\"],\"label\":\"归属组织\",\"sortable\":true,\"align\":\"left\",\"__config__\":{\"formId\":\"formItem3e0d06\",\"yunzhupaasKey\":\"organizeSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"归属组织\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776756606740,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasOrganizeSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"org_id\",\"__vModel__\":\"org_id\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"org_id\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"areaSelect\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"level\":2,\"multiple\":false,\"fullName\":\"所属地区\",\"fullNameI18nCode\":[\"\"],\"label\":\"所属地区\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItembac4d7\",\"yunzhupaasKey\":\"areaSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属地区\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756709692,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-Provinces\",\"tag\":\"YunzhupaasAreaSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"province_id\",\"__vModel__\":\"province_id\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"province_id\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"企业类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756797475,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem402f2c\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"9b542177a477488994ce09fff3c93901\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"enterprise_nature\",\"__vModel__\":\"enterprise_nature\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_nature\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"行业代码\",\"fullNameI18nCode\":[\"\"],\"label\":\"行业代码\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756887768,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem62cf2d\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"d59a3cf65f9847dbb08be449e3feae16\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"行业代码\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"industry_code\",\"__vModel__\":\"industry_code\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"industry_code\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"企业规模\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业规模\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756923859,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem236419\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"enterpriseScale\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业规模\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"enterprise_scale\",\"__vModel__\":\"enterprise_scale\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_scale\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"datePicker\",\"clearable\":true,\"resizable\":true,\"format\":\"yyyy-MM-dd\",\"fullName\":\"成立日期\",\"fullNameI18nCode\":[\"\"],\"label\":\"成立日期\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756967842,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItem31fbac\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"成立日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"registration_date\",\"__vModel__\":\"registration_date\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"registration_date\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"resizable\":true,\"fullName\":\"注册资本\",\"fullNameI18nCode\":[\"\"],\"label\":\"注册资本\",\"sortable\":false,\"align\":\"left\",\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"万元\",\"__config__\":{\"formId\":\"formItembe6067\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"注册资本\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757334161,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"registered_capital\",\"__vModel__\":\"registered_capital\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"registered_capital\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemb811fc\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"法定代表人\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757395564,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"legal_representative\",\"__vModel__\":\"legal_representative\",\"disabled\":false,\"id\":\"legal_representative\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"法定代表人\",\"label\":\"法定代表人\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5f994c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"联系电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757411562,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"phone\",\"__vModel__\":\"phone\",\"disabled\":false,\"id\":\"phone\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"联系电话\",\"label\":\"联系电话\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItembcb540\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"邮箱\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757415485,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"email\",\"__vModel__\":\"email\",\"disabled\":false,\"id\":\"email\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"邮箱\",\"label\":\"邮箱\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem2b0674\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"网站\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757420940,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"website\",\"__vModel__\":\"website\",\"disabled\":false,\"id\":\"website\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"网站\",\"label\":\"网站\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem8e2a41\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757434551,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"address\",\"__vModel__\":\"address\",\"disabled\":false,\"id\":\"address\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"地址\",\"label\":\"地址\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"ableRelationIds\":[],\"yunzhupaasKey\":\"userSelect\",\"clearable\":true,\"resizable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"负责人\",\"fullNameI18nCode\":[\"\"],\"label\":\"负责人\",\"sortable\":false,\"align\":\"left\",\"relationField\":\"\",\"__config__\":{\"formId\":\"formItem9e3ebb\",\"yunzhupaasKey\":\"userSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":\"\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"负责人\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_corporation\",\"renderKey\":1776911034109,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-user\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasUserSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"yunzhupaas_mdm_corporation_yunzhupaas_major_person_id\",\"__vModel__\":\"yunzhupaas_mdm_corporation_yunzhupaas_major_person_id\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"yunzhupaas_mdm_corporation_yunzhupaas_major_person_id\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"fullName\":\"备注\",\"fullNameI18nCode\":[\"\"],\"label\":\"备注\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":10},\"showCount\":false,\"__config__\":{\"formId\":\"formItem5e3ca2\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757518231,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"remark\",\"__vModel__\":\"remark\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"remark\",\"placeholder\":\"请输入\",\"labelI18nCode\":\"\"}],\"summaryField\":[],\"parentField\":\"\",\"treeDataSource\":\"organize\",\"treeDictionary\":\"\",\"treeSyncInterfaceId\":\"\",\"customBtnsList\":[]}"); + return sb.toString(); + } + /** app列表字段配置json */ + public static final String getAppColumnData(){ + StringBuilder sb = new StringBuilder(); + sb.append("{\"hasPage\":true,\"useColumnPermission\":false,\"searchList\":[],\"btnsList\":[{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-add\",\"label\":\"新增\",\"value\":\"add\",\"labelI18nCode\":\"common.add2Text\"},{\"show\":false,\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"批量删除\",\"value\":\"batchRemove\",\"labelI18nCode\":\"common.batchDelText\"}],\"useDataPermission\":false,\"viewKey\":\"\",\"ruleListApp\":{\"conditionList\":[],\"matchLogic\":\"and\"},\"columnList\":[{\"yunzhupaasKey\":\"organizeSelect\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"归属组织\",\"fullNameI18nCode\":[\"\"],\"label\":\"归属组织\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItem3e0d06\",\"yunzhupaasKey\":\"organizeSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"归属组织\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776756606740,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasOrganizeSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"org_id\",\"__vModel__\":\"org_id\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"org_id\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"}],\"columnOptions\":[{\"buttonStyle\":\"solid\",\"fullName\":\"实体类型\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"optionType\":\"default\",\"__config__\":{\"yunzhupaasKey\":\"radio\",\"defaultValue\":\"ORG\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776916730323,\"tagIcon\":\"icon-ym icon-ym-generator-radio\",\"tag\":\"YunzhupaasRadio\",\"formId\":\"formItembb71f5\",\"visibility\":[\"pc\",\"app\"],\"noShow\":true,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"实体类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"size\":\"default\",\"options\":[{\"fullName\":\"组织/企业\",\"id\":\"ORG\"},{\"fullName\":\"个人\",\"id\":\"IND\"}],\"__vModel__\":\"entity_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"entity_type\",\"direction\":\"horizontal\"},{\"__config__\":{\"formId\":\"formItemd86399\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"CorporationCode\",\"className\":[],\"label\":\"企业编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756346790,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"法人单位编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":8},\"readonly\":true,\"__vModel__\":\"company_code\",\"fullName\":\"企业编码\",\"fullNameI18nCode\":[\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"company_code\",\"placeholder\":\"系统自动生成\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"企业名称\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemac3814\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"企业名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776756270027,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"company_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"company_name\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"简称/昵称\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem950378\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"简称/昵称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756445058,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"short_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"short_name\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"社会信用代码\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formIteme913d2\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"社会信用代码\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776756480142,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"credit_code\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"credit_code\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"纳税人类别\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776756520113,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemf1b719\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_type\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"归属组织\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"formId\":\"formItem3e0d06\",\"yunzhupaasKey\":\"organizeSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"归属组织\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776756606740,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasOrganizeSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"org_id\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"org_id\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"level\":2,\"multiple\":false,\"fullName\":\"所属地区\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"formId\":\"formItembac4d7\",\"yunzhupaasKey\":\"areaSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属地区\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756709692,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-Provinces\",\"tag\":\"YunzhupaasAreaSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"province_id\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"province_id\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"企业类型\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756797475,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem402f2c\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"9b542177a477488994ce09fff3c93901\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"enterprise_nature\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_nature\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"行业代码\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756887768,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem62cf2d\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"d59a3cf65f9847dbb08be449e3feae16\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"行业代码\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"industry_code\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"industry_code\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"企业规模\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756923859,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem236419\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"enterpriseScale\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业规模\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"enterprise_scale\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_scale\",\"placeholder\":\"请选择\"},{\"clearable\":true,\"format\":\"yyyy-MM-dd\",\"fullName\":\"成立日期\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756967842,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItem31fbac\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"成立日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"registration_date\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"registration_date\",\"placeholder\":\"请选择\"},{\"controls\":false,\"fullName\":\"注册资本\",\"fullNameI18nCode\":[\"\"],\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"万元\",\"__config__\":{\"formId\":\"formItembe6067\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"注册资本\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757334161,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"registered_capital\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"registered_capital\",\"placeholder\":\"请输入\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"法定代表人\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemb811fc\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"法定代表人\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757395564,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"legal_representative\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"legal_representative\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"联系电话\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5f994c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"联系电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757411562,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"phone\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"phone\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"邮箱\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItembcb540\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"邮箱\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757415485,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"email\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"email\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"网站\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem2b0674\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"网站\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757420940,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"website\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"website\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"地址\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem8e2a41\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757434551,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"address\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"address\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"ableRelationIds\":[],\"clearable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"负责人\",\"fullNameI18nCode\":[\"\"],\"relationField\":\"\",\"__config__\":{\"formId\":\"formItem9e3ebb\",\"yunzhupaasKey\":\"userSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":\"\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"负责人\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_corporation\",\"renderKey\":1776911034109,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-user\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasUserSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"yunzhupaas_mdm_corporation_yunzhupaas_major_person_id\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"yunzhupaas_mdm_corporation_yunzhupaas_major_person_id\",\"placeholder\":\"请选择\"},{\"clearable\":true,\"fullName\":\"经营范围\",\"fullNameI18nCode\":[\"\"],\"autoSize\":{\"minRows\":2,\"maxRows\":10},\"showCount\":false,\"__config__\":{\"formId\":\"formItem1cbed8\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"经营范围\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757471228,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"business_scope\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"business_scope\",\"placeholder\":\"请输入\"},{\"clearable\":true,\"fullName\":\"备注\",\"fullNameI18nCode\":[\"\"],\"autoSize\":{\"minRows\":2,\"maxRows\":10},\"showCount\":false,\"__config__\":{\"formId\":\"formItem5e3ca2\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757518231,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"remark\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"remark\",\"placeholder\":\"请输入\"},{\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"billRule\",\"parentVModel\":\"tableField5ced3a\",\"dragDisabled\":false,\"rule\":\"InvoiceTitleCode\",\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757704179,\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"isSubTable\":true,\"ruleName\":\"发票抬头编码\",\"tag\":\"YunzhupaasInput\",\"formId\":\"formItemf85a31\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"发票抬头编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"layout\":\"colFormItem\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"title_code\",\"fullName\":\"设计子表-发票抬头编码\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField5ced3a-title_code\",\"placeholder\":\"系统自动生成\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-发票抬头名称\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItema0f091\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"发票抬头名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776757735612,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"title_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField5ced3a-title_name\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-纳税人识别号\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem410ef8\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"纳税人识别号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776757742594,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"credit_code\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField5ced3a-credit_code\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"设计子表-纳税人类别\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"parentVModel\":\"tableField5ced3a\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776757754042,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem9a9db2\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField5ced3a-tax_type\",\"placeholder\":\"请选择\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-地址\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formIteme1488f\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757782422,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"address\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField5ced3a-address\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-电话\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem58d117\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757790773,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"phone\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField5ced3a-phone\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-开户银行\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5736dd\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户银行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757797258,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField5ced3a-bank_name\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-银行账户\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem7541c6\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账户\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757803853,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_account\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField5ced3a-bank_account\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItemfa99ed\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否默认抬头\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757838265,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"activeValue\":1,\"inactiveValue\":0,\"__vModel__\":\"is_defalut\",\"fullName\":\"设计子表-是否默认抬头\",\"inactiveTxt\":\"N\",\"fullNameI18nCode\":[\"\",\"\"],\"disabled\":false,\"activeTxt\":\"Y\",\"id\":\"tableField5ced3a-is_defalut\"},{\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItema0c23f\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否有效\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757884853,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"activeValue\":1,\"inactiveValue\":0,\"__vModel__\":\"is_valid\",\"fullName\":\"设计子表-是否有效\",\"inactiveTxt\":\"N\",\"fullNameI18nCode\":[\"\",\"\"],\"disabled\":false,\"activeTxt\":\"Y\",\"id\":\"tableField5ced3a-is_valid\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-备注\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemf6c9b4\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_legal\",\"renderKey\":1776757948832,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"remark\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField5ced3a-remark\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-开户行\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItema6ee01\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldbd0aa4\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776758021515,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldbd0aa4-bank_name\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-账户名\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem961220\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldbd0aa4\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"账户名\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776758032023,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_account_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldbd0aa4-bank_account_name\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-银行账号\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem68e172\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldbd0aa4\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776758041593,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_account_number\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldbd0aa4-bank_account_number\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-开户行城市\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formIteme5e523\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldbd0aa4\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行城市\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776758062168,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_province\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldbd0aa4-bank_province\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-备注\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem5c7f16\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldbd0aa4\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776758070020,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"remark\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldbd0aa4-remark\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"}],\"pageSize\":20,\"defaultSortConfig\":[],\"type\":1,\"columnBtnsList\":[{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-edit\",\"label\":\"编辑\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"edit\",\"labelI18nCode\":\"common.editText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"删除\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"remove\",\"labelI18nCode\":\"common.delText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-generator-menu\",\"label\":\"详情\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"detail\",\"labelI18nCode\":\"common.detailText\"}],\"tabConfig\":{\"hasAllTab\":true,\"relationField\":\"\",\"on\":false},\"hasSuperQuery\":false,\"defaultColumnList\":[{\"yunzhupaasKey\":\"radio\",\"resizable\":true,\"buttonStyle\":\"solid\",\"fullName\":\"实体类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"实体类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"optionType\":\"default\",\"__config__\":{\"yunzhupaasKey\":\"radio\",\"defaultValue\":\"ORG\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776916730323,\"tagIcon\":\"icon-ym icon-ym-generator-radio\",\"tag\":\"YunzhupaasRadio\",\"formId\":\"formItembb71f5\",\"visibility\":[\"pc\",\"app\"],\"noShow\":true,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"实体类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"size\":\"default\",\"prop\":\"entity_type\",\"options\":[{\"fullName\":\"组织/企业\",\"id\":\"ORG\"},{\"fullName\":\"个人\",\"id\":\"IND\"}],\"__vModel__\":\"entity_type\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"entity_type\",\"labelI18nCode\":\"\",\"direction\":\"horizontal\"},{\"yunzhupaasKey\":\"billRule\",\"resizable\":true,\"fullName\":\"企业编码\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业编码\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItemd86399\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"CorporationCode\",\"className\":[],\"label\":\"企业编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756346790,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"法人单位编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":8},\"readonly\":true,\"prop\":\"company_code\",\"__vModel__\":\"company_code\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"company_code\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemac3814\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"企业名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776756270027,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"company_name\",\"__vModel__\":\"company_name\",\"checked\":false,\"disabled\":false,\"id\":\"company_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"企业名称\",\"label\":\"企业名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem950378\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"简称/昵称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756445058,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"short_name\",\"__vModel__\":\"short_name\",\"checked\":false,\"disabled\":false,\"id\":\"short_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"简称/昵称\",\"label\":\"简称/昵称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formIteme913d2\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"社会信用代码\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776756480142,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"credit_code\",\"__vModel__\":\"credit_code\",\"checked\":false,\"disabled\":false,\"id\":\"credit_code\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"社会信用代码\",\"label\":\"社会信用代码\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"纳税人类别\",\"fullNameI18nCode\":[\"\"],\"label\":\"纳税人类别\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776756520113,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemf1b719\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"tax_type\",\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_type\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"organizeSelect\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"归属组织\",\"fullNameI18nCode\":[\"\"],\"label\":\"归属组织\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItem3e0d06\",\"yunzhupaasKey\":\"organizeSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"归属组织\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776756606740,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasOrganizeSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"org_id\",\"__vModel__\":\"org_id\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"org_id\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"areaSelect\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"level\":2,\"multiple\":false,\"fullName\":\"所属地区\",\"fullNameI18nCode\":[\"\"],\"label\":\"所属地区\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItembac4d7\",\"yunzhupaasKey\":\"areaSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属地区\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756709692,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-Provinces\",\"tag\":\"YunzhupaasAreaSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"province_id\",\"__vModel__\":\"province_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"province_id\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"企业类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756797475,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem402f2c\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"9b542177a477488994ce09fff3c93901\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"enterprise_nature\",\"__vModel__\":\"enterprise_nature\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_nature\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"行业代码\",\"fullNameI18nCode\":[\"\"],\"label\":\"行业代码\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756887768,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem62cf2d\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"d59a3cf65f9847dbb08be449e3feae16\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"行业代码\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"industry_code\",\"__vModel__\":\"industry_code\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"industry_code\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"企业规模\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业规模\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756923859,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem236419\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"enterpriseScale\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业规模\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"enterprise_scale\",\"__vModel__\":\"enterprise_scale\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_scale\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"datePicker\",\"clearable\":true,\"resizable\":true,\"format\":\"yyyy-MM-dd\",\"fullName\":\"成立日期\",\"fullNameI18nCode\":[\"\"],\"label\":\"成立日期\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776756967842,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItem31fbac\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"成立日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"registration_date\",\"__vModel__\":\"registration_date\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"registration_date\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItembe6067\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"注册资本\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757334161,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"registered_capital\",\"__vModel__\":\"registered_capital\",\"checked\":false,\"disabled\":false,\"id\":\"registered_capital\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"resizable\":true,\"fullName\":\"注册资本\",\"label\":\"注册资本\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"万元\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemb811fc\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"法定代表人\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757395564,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"legal_representative\",\"__vModel__\":\"legal_representative\",\"checked\":false,\"disabled\":false,\"id\":\"legal_representative\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"法定代表人\",\"label\":\"法定代表人\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5f994c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"联系电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757411562,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"phone\",\"__vModel__\":\"phone\",\"checked\":false,\"disabled\":false,\"id\":\"phone\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"联系电话\",\"label\":\"联系电话\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItembcb540\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"邮箱\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757415485,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"email\",\"__vModel__\":\"email\",\"checked\":false,\"disabled\":false,\"id\":\"email\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"邮箱\",\"label\":\"邮箱\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem2b0674\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"网站\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757420940,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"website\",\"__vModel__\":\"website\",\"checked\":false,\"disabled\":false,\"id\":\"website\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"网站\",\"label\":\"网站\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem8e2a41\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757434551,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"address\",\"__vModel__\":\"address\",\"checked\":false,\"disabled\":false,\"id\":\"address\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"地址\",\"label\":\"地址\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"ableRelationIds\":[],\"yunzhupaasKey\":\"userSelect\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"__config__\":{\"formId\":\"formItem9e3ebb\",\"yunzhupaasKey\":\"userSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":\"\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"负责人\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_corporation\",\"renderKey\":1776911034109,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-user\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasUserSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"yunzhupaas_mdm_corporation_yunzhupaas_major_person_id\",\"__vModel__\":\"yunzhupaas_mdm_corporation_yunzhupaas_major_person_id\",\"checked\":false,\"selectType\":\"all\",\"disabled\":false,\"id\":\"yunzhupaas_mdm_corporation_yunzhupaas_major_person_id\",\"placeholder\":\"请选择\",\"clearable\":true,\"resizable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"负责人\",\"label\":\"负责人\",\"sortable\":false,\"relationField\":\"\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"fullName\":\"经营范围\",\"fullNameI18nCode\":[\"\"],\"label\":\"经营范围\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":10},\"showCount\":false,\"__config__\":{\"formId\":\"formItem1cbed8\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"经营范围\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757471228,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"business_scope\",\"__"); + sb.append("vModel__\":\"business_scope\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"business_scope\",\"placeholder\":\"请输入\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"fullName\":\"备注\",\"fullNameI18nCode\":[\"\"],\"label\":\"备注\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":10},\"showCount\":false,\"__config__\":{\"formId\":\"formItem5e3ca2\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757518231,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"remark\",\"__vModel__\":\"remark\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"remark\",\"placeholder\":\"请输入\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"billRule\",\"resizable\":true,\"fullName\":\"设计子表-发票抬头编码\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"设计子表-发票抬头编码\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"billRule\",\"parentVModel\":\"tableField5ced3a\",\"dragDisabled\":false,\"rule\":\"InvoiceTitleCode\",\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757704179,\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"isSubTable\":true,\"ruleName\":\"发票抬头编码\",\"tag\":\"YunzhupaasInput\",\"formId\":\"formItemf85a31\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"发票抬头编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"layout\":\"colFormItem\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField5ced3a-title_code\",\"__vModel__\":\"title_code\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField5ced3a-title_code\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItema0f091\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"发票抬头名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776757735612,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField5ced3a-title_name\",\"__vModel__\":\"title_name\",\"checked\":false,\"disabled\":false,\"id\":\"tableField5ced3a-title_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"设计子表-发票抬头名称\",\"label\":\"设计子表-发票抬头名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem410ef8\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"纳税人识别号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776757742594,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField5ced3a-credit_code\",\"__vModel__\":\"credit_code\",\"checked\":false,\"disabled\":false,\"id\":\"tableField5ced3a-credit_code\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"设计子表-纳税人识别号\",\"label\":\"设计子表-纳税人识别号\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"设计子表-纳税人类别\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"设计子表-纳税人类别\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"parentVModel\":\"tableField5ced3a\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776757754042,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem9a9db2\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"tableField5ced3a-tax_type\",\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField5ced3a-tax_type\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formIteme1488f\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757782422,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField5ced3a-address\",\"__vModel__\":\"address\",\"checked\":false,\"disabled\":false,\"id\":\"tableField5ced3a-address\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"设计子表-地址\",\"label\":\"设计子表-地址\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem58d117\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757790773,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField5ced3a-phone\",\"__vModel__\":\"phone\",\"checked\":false,\"disabled\":false,\"id\":\"tableField5ced3a-phone\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"设计子表-电话\",\"label\":\"设计子表-电话\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5736dd\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户银行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757797258,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField5ced3a-bank_name\",\"__vModel__\":\"bank_name\",\"checked\":false,\"disabled\":false,\"id\":\"tableField5ced3a-bank_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"设计子表-开户银行\",\"label\":\"设计子表-开户银行\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem7541c6\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账户\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757803853,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField5ced3a-bank_account\",\"__vModel__\":\"bank_account\",\"checked\":false,\"disabled\":false,\"id\":\"tableField5ced3a-bank_account\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"设计子表-银行账户\",\"label\":\"设计子表-银行账户\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"switch\",\"resizable\":true,\"activeValue\":1,\"inactiveValue\":0,\"fullName\":\"设计子表-是否默认抬头\",\"inactiveTxt\":\"N\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"设计子表-是否默认抬头\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItemfa99ed\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否默认抬头\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757838265,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"tableField5ced3a-is_defalut\",\"__vModel__\":\"is_defalut\",\"checked\":false,\"fixed\":\"none\",\"disabled\":false,\"activeTxt\":\"Y\",\"id\":\"tableField5ced3a-is_defalut\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"switch\",\"resizable\":true,\"activeValue\":1,\"inactiveValue\":0,\"fullName\":\"设计子表-是否有效\",\"inactiveTxt\":\"N\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"设计子表-是否有效\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItema0c23f\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否有效\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776757884853,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"tableField5ced3a-is_valid\",\"__vModel__\":\"is_valid\",\"checked\":false,\"fixed\":\"none\",\"disabled\":false,\"activeTxt\":\"Y\",\"id\":\"tableField5ced3a-is_valid\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemf6c9b4\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField5ced3a\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_legal\",\"renderKey\":1776757948832,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField5ced3a-remark\",\"__vModel__\":\"remark\",\"checked\":false,\"disabled\":false,\"id\":\"tableField5ced3a-remark\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"设计子表-备注\",\"label\":\"设计子表-备注\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItema6ee01\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldbd0aa4\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776758021515,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldbd0aa4-bank_name\",\"__vModel__\":\"bank_name\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldbd0aa4-bank_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"设计子表-开户行\",\"label\":\"设计子表-开户行\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem961220\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldbd0aa4\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"账户名\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776758032023,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldbd0aa4-bank_account_name\",\"__vModel__\":\"bank_account_name\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldbd0aa4-bank_account_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"设计子表-账户名\",\"label\":\"设计子表-账户名\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem68e172\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldbd0aa4\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776758041593,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldbd0aa4-bank_account_number\",\"__vModel__\":\"bank_account_number\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldbd0aa4-bank_account_number\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"设计子表-银行账号\",\"label\":\"设计子表-银行账号\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formIteme5e523\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldbd0aa4\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行城市\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776758062168,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldbd0aa4-bank_province\",\"__vModel__\":\"bank_province\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldbd0aa4-bank_province\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"设计子表-开户行城市\",\"label\":\"设计子表-开户行城市\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem5c7f16\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldbd0aa4\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776758070020,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldbd0aa4-remark\",\"__vModel__\":\"remark\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldbd0aa4-remark\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"设计子表-备注\",\"label\":\"设计子表-备注\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"}],\"showOverflow\":true,\"useFormPermission\":false,\"customBtnsList\":[],\"useBtnPermission\":false}"); + return sb.toString(); + } + /** 表列表 */ + public static final String getTableList(){ + StringBuilder sb = new StringBuilder(); +sb.append("[{\"relationTable\":\"\",\"tableField\":\"\",\"typeId\":\"1\",\"fields\":[{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"company_id\",\"fieldName\":\"企业唯一ID\",\"identity\":0,\"primaryKey\":1},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"company_code\",\"fieldName\":\"企业编码(系统生成或用户定义)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"200\",\"dataType\":\"varchar\",\"field\":\"company_name\",\"fieldName\":\"企业名称(企业名或个人姓名)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"3\",\"dataType\":\"char\",\"field\":\"entity_type\",\"fieldName\":\"实体类型: ORG-组织/企业(Organization), IND-个人(Individual)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"100\",\"dataType\":\"varchar\",\"field\":\"short_name\",\"fieldName\":\"简称/昵称\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"100\",\"dataType\":\"varchar\",\"field\":\"org_id\",\"fieldName\":\"归属组织。关联表:base_organize\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"3\",\"dataType\":\"char\",\"field\":\"company_scope\",\"fieldName\":\"伙伴性质:INT-内部(Internal), EXT-外部(External)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"credit_code\",\"fieldName\":\"社会信用代码(企业)或身份证号(个人)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"province_id\",\"fieldName\":\"所属地区。关联表:base_province\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"20\",\"dataType\":\"varchar\",\"field\":\"tax_type\",\"fieldName\":\"纳税人类别: GENERAL-一般纳税人, SMALL-小规模\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"enterprise_nature\",\"fieldName\":\"企业类型。关联字典:企业性质(EnterpriseNature)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"industry_code\",\"fieldName\":\"行业代码。关联字典:行业类别(IndustryType)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"enterprise_scale\",\"fieldName\":\"企业规模。关联字典:企业规模(EnterpriseScale)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"registration_date\",\"fieldName\":\"成立日期\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"10,2\",\"dataType\":\"decimal\",\"field\":\"registered_capital\",\"fieldName\":\"注册资本(单位:万元)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"legal_representative\",\"fieldName\":\"法定代表人\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"phone\",\"fieldName\":\"联系电话\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"email\",\"fieldName\":\"邮箱\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"200\",\"dataType\":\"varchar\",\"field\":\"website\",\"fieldName\":\"网站\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"500\",\"dataType\":\"varchar\",\"field\":\"address\",\"fieldName\":\"地址\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":null,\"dataType\":\"tinytext\",\"field\":\"business_scope\",\"fieldName\":\"经营范围\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"500\",\"dataType\":\"varchar\",\"field\":\"remark\",\"fieldName\":\"备注\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"create_by\",\"fieldName\":\"创建人\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"create_time\",\"fieldName\":\"创建时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"update_by\",\"fieldName\":\"更新人ID\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"update_time\",\"fieldName\":\"更新时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_tenant_id\",\"fieldName\":\"租户id\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":null,\"dataType\":\"int\",\"field\":\"f_delete_mark\",\"fieldName\":\"删除标志\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"f_delete_time\",\"fieldName\":\"删除时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_delete_user_id\",\"fieldName\":\"删除用户\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_flow_id\",\"fieldName\":\"流程id\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_flow_task_id\",\"fieldName\":\"流程任务主键\",\"identity\":0,\"primaryKey\":0}],\"relationField\":\"\",\"table\":\"mdm_company\",\"tableName\":\"企业信息(包括:客商与企业内部单位)\"},{\"relationTable\":\"mdm_company\",\"tableField\":\"company_id\",\"typeId\":\"0\",\"fields\":[{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"corporation_id\",\"fieldName\":\"客户ID\",\"identity\":0,\"primaryKey\":1},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"company_id\",\"fieldName\":\"企业唯一ID。关联表:mdm_company\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"major_person_id\",\"fieldName\":\"负责人。关联表:base_user\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"500\",\"dataType\":\"varchar\",\"field\":\"remark\",\"fieldName\":\"备注\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"create_by\",\"fieldName\":\"创建人\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"create_time\",\"fieldName\":\"创建时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"update_by\",\"fieldName\":\"更新人ID\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"update_time\",\"fieldName\":\"更新时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_tenant_id\",\"fieldName\":\"租户id\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":null,\"dataType\":\"int\",\"field\":\"f_delete_mark\",\"fieldName\":\"删除标志\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"f_delete_time\",\"fieldName\":\"删除时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_delete_user_id\",\"fieldName\":\"删除用户\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_flow_id\",\"fieldName\":\"流程id\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_flow_task_id\",\"fieldName\":\"流程任务主键\",\"identity\":0,\"primaryKey\":0}],\"relationField\":\"company_id\",\"table\":\"mdm_corporation\",\"tableName\":\"法人公司\"},{\"relationTable\":\"mdm_company\",\"tableField\":\"company_id\",\"typeId\":\"0\",\"fields\":[{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"bank_id\",\"fieldName\":\"商业伙伴银行ID\",\"identity\":0,\"primaryKey\":1},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"company_id\",\"fieldName\":\"关联的企业信息ID。关联表:mdm_company\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"100\",\"dataType\":\"varchar\",\"field\":\"bank_name\",\"fieldName\":\"开户行\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"200\",\"dataType\":\"varchar\",\"field\":\"bank_account_name\",\"fieldName\":\"账户名\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"bank_account_number\",\"fieldName\":\"银行账号\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"bank_province\",\"fieldName\":\"开户行城市\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"500\",\"dataType\":\"varchar\",\"field\":\"remark\",\"fieldName\":\"备注\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"create_by\",\"fieldName\":\"创建人\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"create_time\",\"fieldName\":\"创建时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"update_by\",\"fieldName\":\"更新人ID\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"update_time\",\"fieldName\":\"更新时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_tenant_id\",\"fieldName\":\"租户id\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":null,\"dataType\":\"int\",\"field\":\"f_delete_mark\",\"fieldName\":\"删除标志\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"f_delete_time\",\"fieldName\":\"删除时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_delete_user_id\",\"fieldName\":\"删除用户\",\"identity\":0,\"primaryKey\":0}],\"relationField\":\"company_id\",\"table\":\"mdm_company_bank\",\"tableName\":\"企业银行信息\"},{\"relationTable\":\"mdm_company\",\"tableField\":\"company_id\",\"typeId\":\"0\",\"fields\":[{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"invoice_id\",\"fieldName\":\"发票抬头ID\",\"identity\":0,\"primaryKey\":1},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"company_id\",\"fieldName\":\"企业信息ID。关联表:mdm_company\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"100\",\"dataType\":\"varchar\",\"field\":\"title_code\",\"fieldName\":\"发票抬头编码\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"200\",\"dataType\":\"varchar\",\"field\":\"title_name\",\"fieldName\":\"发票抬头名称\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"credit_code\",\"fieldName\":\"纳税人识别号\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"20\",\"dataType\":\"varchar\",\"field\":\"tax_type\",\"fieldName\":\"纳税人类别: GENERAL-一般纳税人, SMALL-小规模\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"200\",\"dataType\":\"varchar\",\"field\":\"address\",\"fieldName\":\"地址\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"20\",\"dataType\":\"varchar\",\"field\":\"phone\",\"fieldName\":\"电话\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"100\",\"dataType\":\"varchar\",\"field\":\"bank_name\",\"fieldName\":\"开户银行\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"30\",\"dataType\":\"varchar\",\"field\":\"bank_account\",\"fieldName\":\"银行账户\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"1\",\"dataType\":\"char\",\"field\":\"is_valid\",\"fieldName\":\"是否有效。Y=有效、N=无效\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"1\",\"dataType\":\"char\",\"field\":\"is_defalut\",\"fieldName\":\"是否默认抬头。Y=是、N=否\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"500\",\"dataType\":\"varchar\",\"field\":\"remark\",\"fieldName\":\"备注\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"create_by\",\"fieldName\":\"创建人\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"create_time\",\"fieldName\":\"创建时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"update_by\",\"fieldName\":\"更新人ID\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"update_time\",\"fieldName\":\"更新时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_tenant_id\",\"fieldName\":\"租户id\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":null,\"dataType\":\"int\",\"field\":\"f_delete_mark\",\"fieldName\":\"删除标志\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"f_delete_time\",\"fieldName\":\"删除时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_delete_user_id\",\"fieldName\":\"删除用户\",\"identity\":0,\"primaryKey\":0}],\"relationField\":\"company_id\",\"table\":\"mdm_company_invoice\",\"tableName\":\"企业发票抬头\"}]"); return sb.toString(); + } + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/lpc/LpcExcelErrorVO.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/lpc/LpcExcelErrorVO.java new file mode 100644 index 0000000..2dd4a00 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/lpc/LpcExcelErrorVO.java @@ -0,0 +1,22 @@ + + +package com.yunzhupaas.mdm.model.lpc; + +import lombok.Data; +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.alibaba.fastjson.annotation.JSONField; +/** + * + * 法人公司 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-24 + */ +@Data +public class LpcExcelErrorVO extends LpcExcelVO{ + + @Excel(name = "异常原因",orderNum = "-999") + @JSONField(name = "errorsInfo") + private String errorsInfo; +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/lpc/LpcExcelVO.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/lpc/LpcExcelVO.java new file mode 100644 index 0000000..f289819 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/lpc/LpcExcelVO.java @@ -0,0 +1,126 @@ +package com.yunzhupaas.mdm.model.lpc; + +import com.yunzhupaas.mdm.model.companyBank.CompanyBankExcelVO; +import com.yunzhupaas.mdm.model.companyInvoice.CompanyInvoiceExcelVO; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; +import cn.afterturn.easypoi.excel.annotation.Excel; +import cn.afterturn.easypoi.excel.annotation.ExcelCollection; + +import java.util.List; +/** + * + * 法人公司 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-24 + */ +@Data +public class LpcExcelVO{ + /** 企业名称 **/ + @JSONField(name = "company_name") + @Excel(name = "企业名称(company_name)",orderNum = "1", isImportField = "true" ) + private String company_name; + + /** 简称/昵称 **/ + @JSONField(name = "short_name") + @Excel(name = "简称/昵称(short_name)",orderNum = "1", isImportField = "true" ) + private String short_name; + + /** 社会信用代码 **/ + @JSONField(name = "credit_code") + @Excel(name = "社会信用代码(credit_code)",orderNum = "1", isImportField = "true" ) + private String credit_code; + + /** 纳税人类别 **/ + @JSONField(name = "tax_type") + @Excel(name = "纳税人类别(tax_type)",orderNum = "1", isImportField = "true" ) + private String tax_type; + + /** 归属组织 **/ + @JSONField(name = "org_id") + @Excel(name = "归属组织(org_id)",orderNum = "1", isImportField = "true" ) + private String org_id; + + /** 所属地区 **/ + @JSONField(name = "province_id") + @Excel(name = "所属地区(province_id)",orderNum = "1", isImportField = "true" ) + private String province_id; + + /** 企业类型 **/ + @JSONField(name = "enterprise_nature") + @Excel(name = "企业类型(enterprise_nature)",orderNum = "1", isImportField = "true" ) + private String enterprise_nature; + + /** 行业代码 **/ + @JSONField(name = "industry_code") + @Excel(name = "行业代码(industry_code)",orderNum = "1", isImportField = "true" ) + private String industry_code; + + /** 企业规模 **/ + @JSONField(name = "enterprise_scale") + @Excel(name = "企业规模(enterprise_scale)",orderNum = "1", isImportField = "true" ) + private String enterprise_scale; + + /** 成立日期 **/ + @JSONField(name = "registration_date") + @Excel(name = "成立日期(registration_date)",orderNum = "1", isImportField = "true" ) + private String registration_date; + + /** 注册资本 **/ + @JSONField(name = "registered_capital") + @Excel(name = "注册资本(registered_capital)",orderNum = "1", isImportField = "true" ) + private String registered_capital; + + /** 法定代表人 **/ + @JSONField(name = "legal_representative") + @Excel(name = "法定代表人(legal_representative)",orderNum = "1", isImportField = "true" ) + private String legal_representative; + + /** 联系电话 **/ + @JSONField(name = "phone") + @Excel(name = "联系电话(phone)",orderNum = "1", isImportField = "true" ) + private String phone; + + /** 邮箱 **/ + @JSONField(name = "email") + @Excel(name = "邮箱(email)",orderNum = "1", isImportField = "true" ) + private String email; + + /** 网站 **/ + @JSONField(name = "website") + @Excel(name = "网站(website)",orderNum = "1", isImportField = "true" ) + private String website; + + /** 地址 **/ + @JSONField(name = "address") + @Excel(name = "地址(address)",orderNum = "1", isImportField = "true" ) + private String address; + + /** 负责人 **/ + @JSONField(name = "yunzhupaas_mdm_corporation_yunzhupaas_major_person_id") + @Excel(name = "负责人(yunzhupaas_mdm_corporation_yunzhupaas_major_person_id)",orderNum = "1", isImportField = "true" ) + private String yunzhupaas_mdm_corporation_yunzhupaas_major_person_id; + + /** 经营范围 **/ + @JSONField(name = "business_scope") + @Excel(name = "经营范围(business_scope)",orderNum = "1", isImportField = "true" ) + private String business_scope; + + /** 备注 **/ + @JSONField(name = "remark") + @Excel(name = "备注(remark)",orderNum = "1", isImportField = "true" ) + private String remark; + + @JsonProperty("tableField5ced3a") + @ExcelCollection(name="设计子表(tableField5ced3a)",orderNum = "10") + private List tableField5ced3a; + + @JsonProperty("tableFieldbd0aa4") + @ExcelCollection(name="设计子表(tableFieldbd0aa4)",orderNum = "5") + private List tableFieldbd0aa4; + + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/lpc/LpcForm.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/lpc/LpcForm.java new file mode 100644 index 0000000..1f80d44 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/lpc/LpcForm.java @@ -0,0 +1,142 @@ +package com.yunzhupaas.mdm.model.lpc; + +import com.yunzhupaas.mdm.model.companyBank.CompanyBankModel; +import com.yunzhupaas.mdm.model.companyInvoice.CompanyInvoiceModel; +import lombok.Data; +import java.util.*; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * 法人公司 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-24 + */ +@Data +@Schema(description = "表单参数") +public class LpcForm { + /** 主键 */ + @Schema(description = "主键") + @JSONField(name = "company_id") + private String companyId; + + + /** 实体类型 **/ + @Schema(description = "实体类型") + @JsonProperty("entity_type") + @JSONField(name = "entity_type") + private String entityType; + /** 企业编码 **/ + @Schema(description = "企业编码") + @JsonProperty("company_code") + @JSONField(name = "company_code") + private String companyCode; + /** 企业名称 **/ + @Schema(description = "企业名称") + @JsonProperty("company_name") + @JSONField(name = "company_name") + private String companyName; + /** 简称/昵称 **/ + @Schema(description = "简称/昵称") + @JsonProperty("short_name") + @JSONField(name = "short_name") + private String shortName; + /** 社会信用代码 **/ + @Schema(description = "社会信用代码") + @JsonProperty("credit_code") + @JSONField(name = "credit_code") + private String creditCode; + /** 纳税人类别 **/ + @Schema(description = "纳税人类别") + @JsonProperty("tax_type") + @JSONField(name = "tax_type") + private Object taxType; + /** 归属组织 **/ + @Schema(description = "归属组织") + @JsonProperty("org_id") + @JSONField(name = "org_id") + private Object orgId; + /** 所属地区 **/ + @Schema(description = "所属地区") + @JsonProperty("province_id") + @JSONField(name = "province_id") + private Object provinceId; + /** 企业类型 **/ + @Schema(description = "企业类型") + @JsonProperty("enterprise_nature") + @JSONField(name = "enterprise_nature") + private Object enterpriseNature; + /** 行业代码 **/ + @Schema(description = "行业代码") + @JsonProperty("industry_code") + @JSONField(name = "industry_code") + private Object industryCode; + /** 企业规模 **/ + @Schema(description = "企业规模") + @JsonProperty("enterprise_scale") + @JSONField(name = "enterprise_scale") + private Object enterpriseScale; + /** 成立日期 **/ + @Schema(description = "成立日期") + @JsonProperty("registration_date") + @JSONField(name = "registration_date") + private String registrationDate; + /** 注册资本 **/ + @Schema(description = "注册资本") + @JsonProperty("registered_capital") + @JSONField(name = "registered_capital") + private BigDecimal registeredCapital; + /** 法定代表人 **/ + @Schema(description = "法定代表人") + @JsonProperty("legal_representative") + @JSONField(name = "legal_representative") + private String legalRepresentative; + /** 联系电话 **/ + @Schema(description = "联系电话") + @JsonProperty("phone") + @JSONField(name = "phone") + private String phone; + /** 邮箱 **/ + @Schema(description = "邮箱") + @JsonProperty("email") + @JSONField(name = "email") + private String email; + /** 网站 **/ + @Schema(description = "网站") + @JsonProperty("website") + @JSONField(name = "website") + private String website; + /** 地址 **/ + @Schema(description = "地址") + @JsonProperty("address") + @JSONField(name = "address") + private String address; + /** 负责人 **/ + @Schema(description = "负责人") + @JsonProperty("yunzhupaas_mdm_corporation_yunzhupaas_major_person_id") + @JSONField(name = "yunzhupaas_mdm_corporation_yunzhupaas_major_person_id") + private Object yunzhupaas_corporation_yunzhupaas_majorPersonId; + /** 经营范围 **/ + @Schema(description = "经营范围") + @JsonProperty("business_scope") + @JSONField(name = "business_scope") + private String businessScope; + /** 备注 **/ + @Schema(description = "备注") + @JsonProperty("remark") + @JSONField(name = "remark") + private String remark; + + /** 子表数据 **/ + @Schema(description = "company_invoice子表数据") + @JsonProperty("company_invoiceList") + private List companyInvoiceList; + /** 子表数据 **/ + @Schema(description = "companyBank子表数据") + @JsonProperty("companyBankList") + private List companyBankList; +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/lpc/LpcPagination.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/lpc/LpcPagination.java new file mode 100644 index 0000000..ffc5e57 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/lpc/LpcPagination.java @@ -0,0 +1,54 @@ +package com.yunzhupaas.mdm.model.lpc; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import com.yunzhupaas.base.Pagination; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * + * 法人公司 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-24 + */ +@Data +@Schema(description = "列表查询参数") +public class LpcPagination extends Pagination { + /** 关键词搜索 */ + @Schema(description = "关键词搜索") + private String yunzhupaasKeyword; + /** 查询key */ + @Schema(description = "查询key") + private String[] selectKey; + /** 选中数据数组id */ + @Schema(description = "选中数据数组id") + private Object[] selectIds; + /** json */ + @Schema(description = "json") + private String json; + /** 数据类型 0-当前页,1-全部数据 */ + @Schema(description = "数据类型 0-当前页,1-全部数据") + private String dataType; + /** 高级查询 */ + @Schema(description = "高级查询") + private String superQueryJson; + /** 功能id */ + @Schema(description = "功能id") + private String moduleId; + /** 菜单id */ + @Schema(description = "菜单id") + private String menuId; + /** 归属组织 */ + @Schema(description = "归属组织") + @JsonProperty("org_id") + @JSONField(name = "orgId") + private Object orgId; + /** 企业名称 */ + @Schema(description = "企业名称") + @JsonProperty("company_name") + @JSONField(name = "companyName") + private Object companyName; +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/material/MaterialConstant.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/material/MaterialConstant.java new file mode 100644 index 0000000..933df40 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/material/MaterialConstant.java @@ -0,0 +1,42 @@ +package com.yunzhupaas.mdm.model.material; + +import com.yunzhupaas.util.JsonUtil; +import java.util.*; + +/** + * mdm_material配置json + * + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-28 + */ +public class MaterialConstant{ + /** 数据库链接 */ + public static final String DBLINKID = "0"; + /** 表别名 map */ + public static final Map TABLERENAMES = JsonUtil.getJsonToBean("{\"mdm_material\":\"material\"}",Map.class); + /** 子表model map */ + public static final Map TABLEFIELDKEY = JsonUtil.getJsonToBean("{}",Map.class); + /** 整个表单配置json */ + public static final String getFormData(){ + StringBuilder sb = new StringBuilder(); + sb.append("{\"popupType\":\"drawer\",\"labelWidth\":100,\"classNames\":[],\"className\":[],\"fullScreenWidth\":\"100%\",\"hasConfirmAndAddBtn\":true,\"cancelButtonTextI18nCode\":\"common.cancelText\",\"businessKeyTip\":\"该物料分类下,该物料名称数据已存在,请勿重复提交!\",\"labelPosition\":\"right\",\"printId\":\"\",\"labelSuffix\":\"\",\"customBtns\":[],\"disabled\":false,\"formModel\":\"dataForm\",\"cancelButtonText\":\"取消\",\"confirmButtonText\":\"确定\",\"hasCancelBtn\":true,\"primaryKeyPolicy\":1,\"hasPrintBtn\":false,\"concurrencyLock\":true,\"classJson\":\"\",\"drawerWidth\":\"800px\",\"confirmButtonTextI18nCode\":\"common.okText\",\"printButtonText\":\"打印\",\"businessKeyList\":[\"material_name\",\"material_category\"],\"formRef\":\"formRef\",\"gutter\":15,\"logicalDelete\":true,\"size\":\"middle\",\"formRules\":\"rules\",\"generalWidth\":\"800px\",\"colon\":false,\"hasConfirmBtn\":true,\"useBusinessKey\":true,\"formStyle\":\"\",\"printButtonTextI18nCode\":\"common.printText\",\"fields\":[{\"__config__\":{\"formId\":\"formItem8ccf90\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"materialCode\",\"className\":[],\"label\":\"物料编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013211756,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"物料编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":12},\"readonly\":true,\"__vModel__\":\"material_code\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"系统自动生成\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem83c40d\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"物料名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777008057645,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"material_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013275790,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItem493db2\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"materialCategory\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"物料分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"multiple\":false,\"__vModel__\":\"material_category\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"}},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItembbc1a2\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"规格型号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777014869849,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"material_model\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemb35646\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"单位名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013263798,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"unit_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem8c9279\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"品牌\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013311315,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"brand\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"controls\":false,\"precision\":2,\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"%\",\"__config__\":{\"formId\":\"formItem36dd63\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0.01,\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"税率\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777341602337,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"min\":0.01,\"__vModel__\":\"tax_rate\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"placeholder\":\"请输入\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777014893882,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItem0b34b4\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"taxCode\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"税收分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"multiple\":false,\"__vModel__\":\"tax_code\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"}},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemb369a1\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"材质/纹理\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013303007,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"texture\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5b262b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"质量标准\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013318024,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"quality_standard\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"autoSize\":{\"minRows\":2,\"maxRows\":3},\"clearable\":true,\"showCount\":false,\"__config__\":{\"formId\":\"formItem8f3df1\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"技术标准\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013366266,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"technical_standard\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\"},{\"autoSize\":{\"minRows\":2,\"maxRows\":3},\"clearable\":true,\"showCount\":false,\"__config__\":{\"formId\":\"formItemb1305e\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"验收标准\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013375099,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"acceptance_criteria\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\"},{\"autoSize\":{\"minRows\":2,\"maxRows\":3},\"clearable\":true,\"showCount\":false,\"__config__\":{\"formId\":\"formItemf44c38\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"交付要求\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013396926,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"delivery_requirements\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\"},{\"autoSize\":{\"minRows\":2,\"maxRows\":3},\"clearable\":true,\"showCount\":false,\"__config__\":{\"formId\":\"formItem4fad6e\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"储存条件\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013402484,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"storage_conditions\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\"}],\"detailExtraList\":[],\"span\":24,\"dataLog\":false}"); return sb.toString(); + } + /** 列表字段配置json */ + public static final String getColumnData(){ + StringBuilder sb = new StringBuilder(); + sb.append("{\"showSummary\":false,\"treePropsValue\":\"id\",\"columnOptions\":[{\"__config__\":{\"formId\":\"formItem8ccf90\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"materialCode\",\"className\":[],\"label\":\"物料编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013211756,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"物料编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":12},\"readonly\":true,\"__vModel__\":\"material_code\",\"fullName\":\"物料编码\",\"fullNameI18nCode\":[\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"material_code\",\"placeholder\":\"系统自动生成\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"物料名称\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem83c40d\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"物料名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777008057645,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"material_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"material_name\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"物料分类\",\"fullNameI18nCode\":[\"\"],\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013275790,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItem493db2\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"materialCategory\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"物料分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"material_category\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"material_category\",\"placeholder\":\"请选择\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"规格型号\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItembbc1a2\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"规格型号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777014869849,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"material_model\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"material_model\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单位名称\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemb35646\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"单位名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013263798,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"unit_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"unit_name\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"品牌\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem8c9279\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"品牌\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013311315,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"brand\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"brand\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"税率\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777014805432,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemd0f934\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"817378654752342789\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"税率\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"tax_rate\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_rate\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"税收分类\",\"fullNameI18nCode\":[\"\"],\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777014893882,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItem0b34b4\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"taxCode\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"税收分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"tax_code\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_code\",\"placeholder\":\"请选择\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"材质/纹理\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemb369a1\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"材质/纹理\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013303007,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"texture\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"texture\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"质量标准\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5b262b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"质量标准\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013318024,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"quality_standard\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"quality_standard\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"fullName\":\"技术标准\",\"fullNameI18nCode\":[\"\"],\"autoSize\":{\"minRows\":2,\"maxRows\":3},\"showCount\":false,\"__config__\":{\"formId\":\"formItem8f3df1\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"技术标准\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013366266,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"technical_standard\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"technical_standard\",\"placeholder\":\"请输入\"},{\"clearable\":true,\"fullName\":\"验收标准\",\"fullNameI18nCode\":[\"\"],\"autoSize\":{\"minRows\":2,\"maxRows\":3},\"showCount\":false,\"__config__\":{\"formId\":\"formItemb1305e\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"验收标准\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013375099,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"acceptance_criteria\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"acceptance_criteria\",\"placeholder\":\"请输入\"},{\"clearable\":true,\"fullName\":\"交付要求\",\"fullNameI18nCode\":[\"\"],\"autoSize\":{\"minRows\":2,\"maxRows\":3},\"showCount\":false,\"__config__\":{\"formId\":\"formItemf44c38\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"交付要求\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013396926,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"delivery_requirements\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"delivery_requirements\",\"placeholder\":\"请输入\"},{\"clearable\":true,\"fullName\":\"储存条件\",\"fullNameI18nCode\":[\"\"],\"autoSize\":{\"minRows\":2,\"maxRows\":3},\"showCount\":false,\"__config__\":{\"formId\":\"formItem4fad6e\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"储存条件\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013402484,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"storage_conditions\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"storage_conditions\",\"placeholder\":\"请输入\"}],\"pageSize\":20,\"type\":2,\"columnBtnsList\":[{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-edit\",\"label\":\"编辑\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"edit\",\"labelI18nCode\":\"common.editText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"删除\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"remove\",\"labelI18nCode\":\"common.delText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-generator-menu\",\"label\":\"详情\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"detail\",\"labelI18nCode\":\"common.detailText\"}],\"treeTitle\":\"物料分类\",\"defaultColumnList\":[{\"yunzhupaasKey\":\"billRule\",\"resizable\":true,\"fullName\":\"物料编码\",\"fullNameI18nCode\":[\"\"],\"label\":\"物料编码\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItem8ccf90\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"materialCode\",\"className\":[],\"label\":\"物料编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013211756,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"物料编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":12},\"readonly\":true,\"prop\":\"material_code\",\"__vModel__\":\"material_code\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"material_code\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem83c40d\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"物料名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777008057645,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"material_name\",\"__vModel__\":\"material_name\",\"checked\":true,\"disabled\":false,\"id\":\"material_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"物料名称\",\"label\":\"物料名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"cascader\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"物料分类\",\"fullNameI18nCode\":[\"\"],\"label\":\"物料分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013275790,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItem493db2\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"materialCategory\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"物料分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"material_category\",\"__vModel__\":\"material_category\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"material_category\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItembbc1a2\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"规格型号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777014869849,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"material_model\",\"__vModel__\":\"material_model\",\"checked\":true,\"disabled\":false,\"id\":\"material_model\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"规格型号\",\"label\":\"规格型号\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemb35646\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"单位名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013263798,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"unit_name\",\"__vModel__\":\"unit_name\",\"checked\":true,\"disabled\":false,\"id\":\"unit_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"单位名称\",\"label\":\"单位名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem8c9279\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"品牌\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013311315,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"brand\",\"__vModel__\":\"brand\",\"checked\":true,\"disabled\":false,\"id\":\"brand\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"品牌\",\"label\":\"品牌\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"税率\",\"fullNameI18nCode\":[\"\"],\"label\":\"税率\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777014805432,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemd0f934\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"817378654752342789\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"税率\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"tax_rate\",\"__vModel__\":\"tax_rate\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_rate\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"cascader\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"税收分类\",\"fullNameI18nCode\":[\"\"],\"label\":\"税收分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777014893882,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItem0b34b4\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"taxCode\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"税收分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"tax_code\",\"__vModel__\":\"tax_code\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_code\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemb369a1\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"材质/纹理\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013303007,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"texture\",\"__vModel__\":\"texture\",\"checked\":true,\"disabled\":false,\"id\":\"texture\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"材质/纹理\",\"label\":\"材质/纹理\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5b262b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"质量标准\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013318024,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"quality_standard\",\"__vModel__\":\"quality_standard\",\"checked\":false,\"disabled\":false,\"id\":\"quality_standard\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"质量标准\",\"label\":\"质量标准\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"fullName\":\"技术标准\",\"fullNameI18nCode\":[\"\"],\"label\":\"技术标准\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":3},\"showCount\":false,\"__config__\":{\"formId\":\"formItem8f3df1\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"技术标准\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013366266,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"technical_standard\",\"__vModel__\":\"technical_standard\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"technical_standard\",\"placeholder\":\"请输入\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"fullName\":\"验收标准\",\"fullNameI18nCode\":[\"\"],\"label\":\"验收标准\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":3},\"showCount\":false,\"__config__\":{\"formId\":\"formItemb1305e\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"验收标准\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013375099,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"acceptance_criteria\",\"__vModel__\":\"acceptance_criteria\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"acceptance_criteria\",\"placeholder\":\"请输入\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"fullName\":\"交付要求\",\"fullNameI18nCode\":[\"\"],\"label\":\"交付要求\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":3},\"showCount\":false,\"__config__\":{\"formId\":\"formItemf44c38\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"交付要求\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013396926,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"delivery_requirements\",\"__vModel__\":\"delivery_requirements\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"delivery_requirements\",\"placeholder\":\"请输入\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"fullName\":\"储存条件\",\"fullNameI18nCode\":[\"\"],\"label\":\"储存条件\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":3},\"showCount\":false,\"__config__\":{\"formId\":\"formItem4fad6e\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"储存条件\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013402484,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"storage_conditions\",\"__vModel__\":\"storage_conditions\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"storage_conditions\",\"placeholder\":\"请输入\",\"labelI18nCode\":\"\"}],\"treeRelationFieldAbleIds\":[],\"treeSyncInterfaceName\":\"\",\"treeSyncTemplateJson\":[],\"treeRelation\":\"material_category\",\"defaultSortConfig\":[],\"tabConfig\":{\"hasAllTab\":true,\"relationField\":\"\",\"on\":false},\"hasSuperQuery\":true,\"treePropsLabel\":\"fullName\",\"groupField\":\"\",\"printIds\":[],\"uploaderTemplateJson\":{\"selectKey\":[\"material_name\",\"material_category\",\"material_model\",\"unit_name\",\"brand\",\"tax_rate\",\"tax_code\",\"texture\",\"quality_standard\",\"technical_standard\",\"acceptance_criteria\",\"delivery_requirements\",\"storage_conditions\"],\"dataType\":\"2\"},\"hasTreeQuery\":true,\"useFormPermission\":false,\"complexHeaderList\":[],\"useBtnPermission\":true,\"treeSyncType\":0,\"hasPage\":true,\"searchList\":[{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"showCount\":false,\"__config__\":{\"formId\":\"formItem83c40d\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"物料名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777008057645,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"material_name\",\"__vModel__\":\"material_name\",\"searchMultiple\":false,\"disabled\":false,\"id\":\"material_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"searchType\":2,\"fullName\":\"物料名称\",\"label\":\"物料名称\",\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"isKeyword\":false,\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"showCount\":false,\"__config__\":{\"formId\":\"formItembbc1a2\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"规格型号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777014869849,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"material_model\",\"__vModel__\":\"material_model\",\"searchMultiple\":false,\"disabled\":false,\"id\":\"material_model\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"searchType\":2,\"fullName\":\"规格型号\",\"label\":\"规格型号\",\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"isKeyword\":false,\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"}],\"ruleList\":{\"conditionList\":[],\"matchLogic\":\"and\"},\"childTableStyle\":1,\"treePropsChildren\":\"children\",\"treeRelationFieldSelectType\":\"all\",\"showOverflow\":true,\"treeTemplateJson\":[],\"treeTitleI18nCode\":\"\",\"treePropsName\":\"\",\"useColumnPermission\":false,\"treePropsUrl\":\"\",\"btnsList\":[{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-add\",\"label\":\"新增\",\"value\":\"add\",\"labelI18nCode\":\"common.add2Text\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-download\",\"label\":\"导出\",\"value\":\"download\",\"labelI18nCode\":\"common.exportText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-upload\",\"label\":\"导入\",\"value\":\"upload\",\"labelI18nCode\":\"common.importText\"},{\"show\":false,\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"批量删除\",\"value\":\"batchRemove\",\"labelI18nCode\":\"common.batchDelText\"},{\"show\":false,\"icon\":\"icon-ym icon-ym-report-icon-preview-printPreview\",\"label\":\"批量打印\",\"value\":\"batchPrint\",\"labelI18nCode\":\"common.batchPrintText\"}],\"useDataPermission\":true,\"viewKey\":\"\",\"columnList\":[{\"yunzhupaasKey\":\"billRule\",\"resizable\":true,\"fullName\":\"物料编码\",\"fullNameI18nCode\":[\"\"],\"label\":\"物料编码\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItem8ccf90\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"materialCode\",\"className\":[],\"label\":\"物料编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013211756,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"物料编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":12},\"readonly\":true,\"prop\":\"material_code\",\"__vModel__\":\"material_code\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"material_code\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem83c40d\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"物料名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777008057645,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"material_name\",\"__vModel__\":\"material_name\",\"disabled\":false,\"id\":\"material_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"物料名称\",\"label\":\"物料名称\",\"sortable\":true,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"cascader\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"物料分类\",\"fullNameI18nCode\":[\"\"],\"label\":\"物料分类\",\"sortable\":true,\"align\":\"left\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013275790,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItem493db2\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"materialCategory\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"物料分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"material_category\",\"__vModel__\":\"material_category\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"material_category\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemb35646\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"单位名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013263798,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"unit_name\",\"__vModel__\":\"unit_name\",\"disabled\":false,\"id\":\"unit_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"单位名称\",\"label\":\"单位名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemb369a1\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"材质/纹理\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013303007,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"texture\",\"__vModel__\":\"texture\",\"disabled\":false,\"id\":\"texture\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"材质/纹理\",\"label\":\"材质/纹理\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItembbc1a2\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"规格型号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777014869849,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"material_model\",\"__vModel__\":\"material_model\",\"disabled\":false,\"id\":\"material_model\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"规格型号\",\"label\":\"规格型号\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem8c9279\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"品牌\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013311315,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"brand\",\"__vModel__\":\"brand\",\"disabled\":false,\"id\":\"brand\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"品牌\",\"label\":\"品牌\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"税率\",\"fullNameI18nCode\":[\"\"],\"label\":\"税率\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777014805432,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemd0f934\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"817378654752342789\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"税率\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"tax_rate\",\"__vModel__\":\"tax_rate\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_rate\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"cascader\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"税收分类\",\"fullNameI18nCode\":[\"\"],\"label\":\"税收分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777014893882,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItem0b34b4\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"taxCode\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"税收分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"tax_code\",\"__vModel__\":\"tax_code\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_code\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"}],\"summaryField\":[],\"parentField\":\"\",\"treeDataSource\":\"dictionary\",\"treeDictionary\":\"materialCategory\",\"treeSyncInterfaceId\":\"\",\"customBtnsList\":[]}"); return sb.toString(); + } + /** app列表字段配置json */ + public static final String getAppColumnData(){ + StringBuilder sb = new StringBuilder(); + sb.append("{\"hasPage\":true,\"useColumnPermission\":false,\"searchList\":[],\"btnsList\":[{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-add\",\"label\":\"新增\",\"value\":\"add\",\"labelI18nCode\":\"common.add2Text\"},{\"show\":false,\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"批量删除\",\"value\":\"batchRemove\",\"labelI18nCode\":\"common.batchDelText\"}],\"useDataPermission\":false,\"viewKey\":\"\",\"ruleListApp\":{\"conditionList\":[],\"matchLogic\":\"and\"},\"columnList\":[{\"yunzhupaasKey\":\"billRule\",\"resizable\":true,\"fullName\":\"物料编码\",\"fullNameI18nCode\":[\"\"],\"label\":\"物料编码\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItem8ccf90\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"materialCode\",\"className\":[],\"label\":\"物料编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013211756,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"物料编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":12},\"readonly\":true,\"prop\":\"material_code\",\"__vModel__\":\"material_code\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"material_code\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem83c40d\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"物料名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777008057645,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"material_name\",\"__vModel__\":\"material_name\",\"disabled\":false,\"id\":\"material_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"物料名称\",\"label\":\"物料名称\",\"sortable\":true,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"cascader\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"物料分类\",\"fullNameI18nCode\":[\"\"],\"label\":\"物料分类\",\"sortable\":true,\"align\":\"left\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013275790,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItem493db2\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"materialCategory\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"物料分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"material_category\",\"__vModel__\":\"material_category\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"material_category\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemb35646\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"单位名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013263798,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"unit_name\",\"__vModel__\":\"unit_name\",\"disabled\":false,\"id\":\"unit_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"单位名称\",\"label\":\"单位名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemb369a1\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"材质/纹理\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013303007,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"texture\",\"__vModel__\":\"texture\",\"disabled\":false,\"id\":\"texture\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"材质/纹理\",\"label\":\"材质/纹理\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItembbc1a2\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"规格型号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777014869849,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"material_model\",\"__vModel__\":\"material_model\",\"disabled\":false,\"id\":\"material_model\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"规格型号\",\"label\":\"规格型号\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem8c9279\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"品牌\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013311315,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"brand\",\"__vModel__\":\"brand\",\"disabled\":false,\"id\":\"brand\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"品牌\",\"label\":\"品牌\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"税率\",\"fullNameI18nCode\":[\"\"],\"label\":\"税率\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777014805432,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemd0f934\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"817378654752342789\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"税率\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"tax_rate\",\"__vModel__\":\"tax_rate\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_rate\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"cascader\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"税收分类\",\"fullNameI18nCode\":[\"\"],\"label\":\"税收分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777014893882,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItem0b34b4\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"taxCode\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"税收分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"tax_code\",\"__vModel__\":\"tax_code\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_code\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"}],\"columnOptions\":[{\"__config__\":{\"formId\":\"formItem8ccf90\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"materialCode\",\"className\":[],\"label\":\"物料编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013211756,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"物料编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":12},\"readonly\":true,\"__vModel__\":\"material_code\",\"fullName\":\"物料编码\",\"fullNameI18nCode\":[\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"material_code\",\"placeholder\":\"系统自动生成\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"物料名称\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem83c40d\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"物料名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777008057645,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"material_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"material_name\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"物料分类\",\"fullNameI18nCode\":[\"\"],\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013275790,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItem493db2\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"materialCategory\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"物料分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"material_category\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"material_category\",\"placeholder\":\"请选择\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"规格型号\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItembbc1a2\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"规格型号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777014869849,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"material_model\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"material_model\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单位名称\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemb35646\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"单位名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013263798,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"unit_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"unit_name\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"品牌\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem8c9279\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"品牌\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013311315,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"brand\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"brand\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"税率\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777014805432,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemd0f934\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"817378654752342789\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"税率\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"tax_rate\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_rate\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"税收分类\",\"fullNameI18nCode\":[\"\"],\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777014893882,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItem0b34b4\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"taxCode\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"税收分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"tax_code\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_code\",\"placeholder\":\"请选择\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"材质/纹理\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemb369a1\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"材质/纹理\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013303007,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"texture\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"texture\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"质量标准\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5b262b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"质量标准\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013318024,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"quality_standard\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"quality_standard\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"fullName\":\"技术标准\",\"fullNameI18nCode\":[\"\"],\"autoSize\":{\"minRows\":2,\"maxRows\":3},\"showCount\":false,\"__config__\":{\"formId\":\"formItem8f3df1\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"技术标准\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013366266,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"technical_standard\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"technical_standard\",\"placeholder\":\"请输入\"},{\"clearable\":true,\"fullName\":\"验收标准\",\"fullNameI18nCode\":[\"\"],\"autoSize\":{\"minRows\":2,\"maxRows\":3},\"showCount\":false,\"__config__\":{\"formId\":\"formItemb1305e\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"验收标准\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013375099,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"acceptance_criteria\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"acceptance_criteria\",\"placeholder\":\"请输入\"},{\"clearable\":true,\"fullName\":\"交付要求\",\"fullNameI18nCode\":[\"\"],\"autoSize\":{\"minRows\":2,\"maxRows\":3},\"showCount\":false,\"__config__\":{\"formId\":\"formItemf44c38\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"交付要求\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013396926,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"delivery_requirements\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"delivery_requirements\",\"placeholder\":\"请输入\"},{\"clearable\":true,\"fullName\":\"储存条件\",\"fullNameI18nCode\":[\"\"],\"autoSize\":{\"minRows\":2,\"maxRows\":3},\"showCount\":false,\"__config__\":{\"formId\":\"formItem4fad6e\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"储存条件\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013402484,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"storage_conditions\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"storage_conditions\",\"placeholder\":\"请输入\"}],\"pageSize\":20,\"defaultSortConfig\":[],\"type\":1,\"columnBtnsList\":[{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-edit\",\"label\":\"编辑\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"edit\",\"labelI18nCode\":\"common.editText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"删除\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"remove\",\"labelI18nCode\":\"common.delText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-generator-menu\",\"label\":\"详情\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"detail\",\"labelI18nCode\":\"common.detailText\"}],\"tabConfig\":{\"hasAllTab\":true,\"relationField\":\"\",\"on\":false},\"hasSuperQuery\":false,\"defaultColumnList\":[{\"yunzhupaasKey\":\"billRule\",\"resizable\":true,\"fullName\":\"物料编码\",\"fullNameI18nCode\":[\"\"],\"label\":\"物料编码\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItem8ccf90\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"materialCode\",\"className\":[],\"label\":\"物料编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013211756,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"物料编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":12},\"readonly\":true,\"prop\":\"material_code\",\"__vModel__\":\"material_code\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"material_code\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem83c40d\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"物料名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777008057645,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"material_name\",\"__vModel__\":\"material_name\",\"checked\":true,\"disabled\":false,\"id\":\"material_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"物料名称\",\"label\":\"物料名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"cascader\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"物料分类\",\"fullNameI18nCode\":[\"\"],\"label\":\"物料分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013275790,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItem493db2\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"materialCategory\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"物料分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"material_category\",\"__vModel__\":\"material_category\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"material_category\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItembbc1a2\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"规格型号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777014869849,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"material_model\",\"__vModel__\":\"material_model\",\"checked\":true,\"disabled\":false,\"id\":\"material_model\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"规格型号\",\"label\":\"规格型号\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemb35646\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"单位名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013263798,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"unit_name\",\"__vModel__\":\"unit_name\",\"checked\":true,\"disabled\":false,\"id\":\"unit_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"单位名称\",\"label\":\"单位名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem8c9279\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"品牌\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013311315,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"brand\",\"__vModel__\":\"brand\",\"checked\":true,\"disabled\":false,\"id\":\"brand\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"品牌\",\"label\":\"品牌\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"税率\",\"fullNameI18nCode\":[\"\"],\"label\":\"税率\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777014805432,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemd0f934\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"817378654752342789\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"税率\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"tax_rate\",\"__vModel__\":\"tax_rate\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_rate\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"cascader\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"税收分类\",\"fullNameI18nCode\":[\"\"],\"label\":\"税收分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777014893882,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItem0b34b4\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"taxCode\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"税收分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"tax_code\",\"__vModel__\":\"tax_code\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_code\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemb369a1\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"材质/纹理\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013303007,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"texture\",\"__vModel__\":\"texture\",\"checked\":true,\"disabled\":false,\"id\":\"texture\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"材质/纹理\",\"label\":\"材质/纹理\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5b262b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"质量标准\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013318024,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"quality_standard\",\"__vModel__\":\"quality_standard\",\"checked\":false,\"disabled\":false,\"id\":\"quality_standard\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"质量标准\",\"label\":\"质量标准\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"fullName\":\"技术标准\",\"fullNameI18nCode\":[\"\"],\"label\":\"技术标准\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":3},\"showCount\":false,\"__config__\":{\"formId\":\"formItem8f3df1\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"技术标准\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013366266,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"technical_standard\",\"__vModel__\":\"technical_standard\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"technical_standard\",\"placeholder\":\"请输入\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"fullName\":\"验收标准\",\"fullNameI18nCode\":[\"\"],\"label\":\"验收标准\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":3},\"showCount\":false,\"__config__\":{\"formId\":\"formItemb1305e\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"验收标准\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013375099,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"acceptance_criteria\",\"__vModel__\":\"acceptance_criteria\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"acceptance_criteria\",\"placeholder\":\"请输入\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"fullName\":\"交付要求\",\"fullNameI18nCode\":[\"\"],\"label\":\"交付要求\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":3},\"showCount\":false,\"__config__\":{\"formId\":\"formItemf44c38\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"交付要求\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013396926,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"delivery_requirements\",\"__vModel__\":\"delivery_requirements\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"delivery_requirements\",\"placeholder\":\"请输入\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"fullName\":\"储存条件\",\"fullNameI18nCode\":[\"\"],\"label\":\"储存条件\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":3},\"showCount\":false,\"__config__\":{\"formId\":\"formItem4fad6e\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"储存条件\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_material\",\"renderKey\":1777013402484,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"storage_conditions\",\"__vModel__\":\"storage_conditions\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"storage_conditions\",\"placeholder\":\"请输入\",\"labelI18nCode\":\"\"}],\"showOverflow\":true,\"useFormPermission\":false,\"customBtnsList\":[],\"useBtnPermission\":false}"); return sb.toString(); + } + /** 表列表 */ + public static final String getTableList(){ + StringBuilder sb = new StringBuilder(); + sb.append("[{\"relationTable\":\"\",\"tableField\":\"\",\"typeId\":\"1\",\"fields\":[{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"material_id\",\"fieldName\":\"物料主键ID\",\"identity\":0,\"primaryKey\":1},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"100\",\"dataType\":\"varchar\",\"field\":\"material_code\",\"fieldName\":\"物料编码(公司内部唯一)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"200\",\"dataType\":\"varchar\",\"field\":\"material_name\",\"fieldName\":\"物料名称\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"500\",\"dataType\":\"varchar\",\"field\":\"material_model\",\"fieldName\":\"规格型号\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"material_category\",\"fieldName\":\"物料分类。关联字典:materialCategory\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"unit_name\",\"fieldName\":\"单位名称(如:个、千克、米)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"200\",\"dataType\":\"varchar\",\"field\":\"texture\",\"fieldName\":\"材质/纹理\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"100\",\"dataType\":\"varchar\",\"field\":\"brand\",\"fieldName\":\"品牌\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"200\",\"dataType\":\"varchar\",\"field\":\"quality_standard\",\"fieldName\":\"质量标准(如:国标、企标)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"200\",\"dataType\":\"varchar\",\"field\":\"technical_standard\",\"fieldName\":\"技术标准\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":null,\"dataType\":\"text\",\"field\":\"acceptance_criteria\",\"fieldName\":\"验收标准\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":null,\"dataType\":\"text\",\"field\":\"delivery_requirements\",\"fieldName\":\"交付要求\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"200\",\"dataType\":\"varchar\",\"field\":\"storage_conditions\",\"fieldName\":\"储存条件\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"10,4\",\"dataType\":\"decimal\",\"field\":\"tax_rate\",\"fieldName\":\"税率(默认13%)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"tax_code\",\"fieldName\":\"税收分类编码\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":null,\"dataType\":\"text\",\"field\":\"remark\",\"fieldName\":\"备注\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"create_by\",\"fieldName\":\"创建人\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"timestamp\",\"field\":\"create_time\",\"fieldName\":\"创建时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"update_by\",\"fieldName\":\"更新人\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"timestamp\",\"field\":\"update_time\",\"fieldName\":\"更新时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_tenant_id\",\"fieldName\":\"租户id\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_flow_id\",\"fieldName\":\"流程id\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_flow_task_id\",\"fieldName\":\"流程任务主键\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":null,\"dataType\":\"int\",\"field\":\"f_delete_mark\",\"fieldName\":\"删除标志\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"f_delete_time\",\"fieldName\":\"删除时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_delete_user_id\",\"fieldName\":\"删除用户\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":null,\"dataType\":\"int\",\"field\":\"f_version\",\"fieldName\":\"乐观锁\",\"identity\":0,\"primaryKey\":0}],\"relationField\":\"\",\"table\":\"mdm_material\",\"tableName\":\"物料主表\"}]"); return sb.toString(); + } + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/material/MaterialExcelErrorVO.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/material/MaterialExcelErrorVO.java new file mode 100644 index 0000000..80cd719 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/material/MaterialExcelErrorVO.java @@ -0,0 +1,22 @@ + + +package com.yunzhupaas.mdm.model.material; + +import lombok.Data; +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.alibaba.fastjson.annotation.JSONField; +/** + * + * 物料信息 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-27 + */ +@Data +public class MaterialExcelErrorVO extends MaterialExcelVO{ + + @Excel(name = "异常原因",orderNum = "-999") + @JSONField(name = "errorsInfo") + private String errorsInfo; +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/material/MaterialExcelVO.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/material/MaterialExcelVO.java new file mode 100644 index 0000000..1800458 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/material/MaterialExcelVO.java @@ -0,0 +1,90 @@ +package com.yunzhupaas.mdm.model.material; + +import lombok.Data; +import java.sql.Time; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; +import cn.afterturn.easypoi.excel.annotation.Excel; +import cn.afterturn.easypoi.excel.annotation.ExcelEntity; +import cn.afterturn.easypoi.excel.annotation.ExcelCollection; +import java.math.BigDecimal; +import java.util.List; +/** + * + * 物料信息 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-27 + */ +@Data +public class MaterialExcelVO{ + /** 物料名称 **/ + @JSONField(name = "material_name") + @Excel(name = "物料名称(material_name)",orderNum = "1", isImportField = "true" ) + private String material_name; + + /** 物料分类 **/ + @JSONField(name = "material_category") + @Excel(name = "物料分类(material_category)",orderNum = "1", isImportField = "true" ) + private String material_category; + + /** 规格型号 **/ + @JSONField(name = "material_model") + @Excel(name = "规格型号(material_model)",orderNum = "1", isImportField = "true" ) + private String material_model; + + /** 单位名称 **/ + @JSONField(name = "unit_name") + @Excel(name = "单位名称(unit_name)",orderNum = "1", isImportField = "true" ) + private String unit_name; + + /** 品牌 **/ + @JSONField(name = "brand") + @Excel(name = "品牌(brand)",orderNum = "1", isImportField = "true" ) + private String brand; + + /** 税率 **/ + @JSONField(name = "tax_rate") + @Excel(name = "税率(tax_rate)",orderNum = "1", isImportField = "true" ) + private String tax_rate; + + /** 税收分类 **/ + @JSONField(name = "tax_code") + @Excel(name = "税收分类(tax_code)",orderNum = "1", isImportField = "true" ) + private String tax_code; + + /** 材质/纹理 **/ + @JSONField(name = "texture") + @Excel(name = "材质/纹理(texture)",orderNum = "1", isImportField = "true" ) + private String texture; + + /** 质量标准 **/ + @JSONField(name = "quality_standard") + @Excel(name = "质量标准(quality_standard)",orderNum = "1", isImportField = "true" ) + private String quality_standard; + + /** 技术标准 **/ + @JSONField(name = "technical_standard") + @Excel(name = "技术标准(technical_standard)",orderNum = "1", isImportField = "true" ) + private String technical_standard; + + /** 验收标准 **/ + @JSONField(name = "acceptance_criteria") + @Excel(name = "验收标准(acceptance_criteria)",orderNum = "1", isImportField = "true" ) + private String acceptance_criteria; + + /** 交付要求 **/ + @JSONField(name = "delivery_requirements") + @Excel(name = "交付要求(delivery_requirements)",orderNum = "1", isImportField = "true" ) + private String delivery_requirements; + + /** 储存条件 **/ + @JSONField(name = "storage_conditions") + @Excel(name = "储存条件(storage_conditions)",orderNum = "1", isImportField = "true" ) + private String storage_conditions; + + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/material/MaterialForm.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/material/MaterialForm.java new file mode 100644 index 0000000..ac450fa --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/material/MaterialForm.java @@ -0,0 +1,102 @@ +package com.yunzhupaas.mdm.model.material; + +import lombok.Data; +import java.util.*; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * 物料信息 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-27 + */ +@Data +@Schema(description = "表单参数") +public class MaterialForm { + /** 主键 */ + @Schema(description = "主键") + @JSONField(name = "material_id") + private String materialId; + + /** 乐观锁 **/ + @Schema(description = "乐观锁") + @JsonProperty("f_version") + @JSONField(name = "f_version") + private Integer version; + + /** 物料编码 **/ + @Schema(description = "物料编码") + @JsonProperty("material_code") + @JSONField(name = "material_code") + private String materialCode; + /** 物料名称 **/ + @Schema(description = "物料名称") + @JsonProperty("material_name") + @JSONField(name = "material_name") + private String materialName; + /** 物料分类 **/ + @Schema(description = "物料分类") + @JsonProperty("material_category") + @JSONField(name = "material_category") + private Object materialCategory; + /** 规格型号 **/ + @Schema(description = "规格型号") + @JsonProperty("material_model") + @JSONField(name = "material_model") + private String materialModel; + /** 单位名称 **/ + @Schema(description = "单位名称") + @JsonProperty("unit_name") + @JSONField(name = "unit_name") + private String unitName; + /** 品牌 **/ + @Schema(description = "品牌") + @JsonProperty("brand") + @JSONField(name = "brand") + private String brand; + /** 税率 **/ + @Schema(description = "税率") + @JsonProperty("tax_rate") + @JSONField(name = "tax_rate") + private Object taxRate; + /** 税收分类 **/ + @Schema(description = "税收分类") + @JsonProperty("tax_code") + @JSONField(name = "tax_code") + private Object taxCode; + /** 材质/纹理 **/ + @Schema(description = "材质/纹理") + @JsonProperty("texture") + @JSONField(name = "texture") + private String texture; + /** 质量标准 **/ + @Schema(description = "质量标准") + @JsonProperty("quality_standard") + @JSONField(name = "quality_standard") + private String qualityStandard; + /** 技术标准 **/ + @Schema(description = "技术标准") + @JsonProperty("technical_standard") + @JSONField(name = "technical_standard") + private String technicalStandard; + /** 验收标准 **/ + @Schema(description = "验收标准") + @JsonProperty("acceptance_criteria") + @JSONField(name = "acceptance_criteria") + private String acceptanceCriteria; + /** 交付要求 **/ + @Schema(description = "交付要求") + @JsonProperty("delivery_requirements") + @JSONField(name = "delivery_requirements") + private String deliveryRequirements; + /** 储存条件 **/ + @Schema(description = "储存条件") + @JsonProperty("storage_conditions") + @JSONField(name = "storage_conditions") + private String storageConditions; + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/material/MaterialPagination.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/material/MaterialPagination.java new file mode 100644 index 0000000..9b16b03 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/material/MaterialPagination.java @@ -0,0 +1,60 @@ +package com.yunzhupaas.mdm.model.material; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import com.yunzhupaas.base.Pagination; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.List; + +/** + * + * 物料信息 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-27 + */ +@Data +@Schema(description = "列表查询参数") +public class MaterialPagination extends Pagination { + /** 关键词搜索 */ + @Schema(description = "关键词搜索") + private String yunzhupaasKeyword; + /** 查询key */ + @Schema(description = "查询key") + private String[] selectKey; + /** 选中数据数组id */ + @Schema(description = "选中数据数组id") + private Object[] selectIds; + /** json */ + @Schema(description = "json") + private String json; + /** 数据类型 0-当前页,1-全部数据 */ + @Schema(description = "数据类型 0-当前页,1-全部数据") + private String dataType; + /** 高级查询 */ + @Schema(description = "高级查询") + private String superQueryJson; + /** 功能id */ + @Schema(description = "功能id") + private String moduleId; + /** 菜单id */ + @Schema(description = "菜单id") + private String menuId; + /** 物料名称 */ + @Schema(description = "物料名称") + @JsonProperty("material_name") + @JSONField(name = "materialName") + private Object materialName; + /** 规格型号 */ + @Schema(description = "规格型号") + @JsonProperty("material_model") + @JSONField(name = "materialModel") + private Object materialModel; + /** tree */ + @Schema(description = "tree") + @JsonProperty("material_category") + @JSONField(name = "materialCategory") + private Object materialCategory; +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/product/ProductExcelErrorVO.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/product/ProductExcelErrorVO.java new file mode 100644 index 0000000..f786b51 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/product/ProductExcelErrorVO.java @@ -0,0 +1,22 @@ + + +package com.yunzhupaas.mdm.model.product; + +import lombok.Data; +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.alibaba.fastjson.annotation.JSONField; +/** + * + * 商品信息 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-27 + */ +@Data +public class ProductExcelErrorVO extends ProductExcelVO{ + + @Excel(name = "异常原因",orderNum = "-999") + @JSONField(name = "errorsInfo") + private String errorsInfo; +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/product/ProductExcelVO.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/product/ProductExcelVO.java new file mode 100644 index 0000000..419fbaf --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/product/ProductExcelVO.java @@ -0,0 +1,130 @@ +package com.yunzhupaas.mdm.model.product; + +import lombok.Data; +import java.sql.Time; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; +import cn.afterturn.easypoi.excel.annotation.Excel; +import cn.afterturn.easypoi.excel.annotation.ExcelEntity; +import cn.afterturn.easypoi.excel.annotation.ExcelCollection; +import java.math.BigDecimal; +import java.util.List; +/** + * + * 商品信息 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-27 + */ +@Data +public class ProductExcelVO{ + /** 商品名称 **/ + @JSONField(name = "product_name") + @Excel(name = "商品名称(product_name)",orderNum = "1", isImportField = "true" ) + private String product_name; + + /** 商品类型 **/ + @JSONField(name = "product_type") + @Excel(name = "商品类型(product_type)",orderNum = "1", isImportField = "true" ) + private String product_type; + + /** 商品分类 **/ + @JSONField(name = "product_category") + @Excel(name = "商品分类(product_category)",orderNum = "1", isImportField = "true" ) + private String product_category; + + /** 商品简称 **/ + @JSONField(name = "short_name") + @Excel(name = "商品简称(short_name)",orderNum = "1", isImportField = "true" ) + private String short_name; + + /** 品牌 **/ + @JSONField(name = "brand") + @Excel(name = "品牌(brand)",orderNum = "1", isImportField = "true" ) + private String brand; + + /** 规格型号 **/ + @JSONField(name = "product_model") + @Excel(name = "规格型号(product_model)",orderNum = "1", isImportField = "true" ) + private String product_model; + + /** 颜色 **/ + @JSONField(name = "color") + @Excel(name = "颜色(color)",orderNum = "1", isImportField = "true" ) + private String color; + + /** 尺寸/规格 **/ + @JSONField(name = "product_size") + @Excel(name = "尺寸/规格(product_size)",orderNum = "1", isImportField = "true" ) + private String product_size; + + /** 重量 **/ + @JSONField(name = "weight") + @Excel(name = "重量(weight)",orderNum = "1", isImportField = "true" ) + private String weight; + + /** 最小起订量 **/ + @JSONField(name = "min_order_quantity") + @Excel(name = "最小起订量(min_order_quantity)",orderNum = "1", isImportField = "true" ) + private String min_order_quantity; + + /** 标准销售单价 **/ + @JSONField(name = "standard_sales_price") + @Excel(name = "标准销售单价(standard_sales_price)",orderNum = "1", isImportField = "true" ) + private String standard_sales_price; + + /** 毛重 **/ + @JSONField(name = "gross_weight") + @Excel(name = "毛重(gross_weight)",orderNum = "1", isImportField = "true" ) + private String gross_weight; + + /** 净重 **/ + @JSONField(name = "net_weight") + @Excel(name = "净重(net_weight)",orderNum = "1", isImportField = "true" ) + private String net_weight; + + /** 单位名称 **/ + @JSONField(name = "unit_name") + @Excel(name = "单位名称(unit_name)",orderNum = "1", isImportField = "true" ) + private String unit_name; + + /** 包装尺寸 **/ + @JSONField(name = "packagesize") + @Excel(name = "包装尺寸(packagesize)",orderNum = "1", isImportField = "true" ) + private String packagesize; + + /** 成本价 **/ + @JSONField(name = "cost_price") + @Excel(name = "成本价(cost_price)",orderNum = "1", isImportField = "true" ) + private String cost_price; + + /** 保修期 **/ + @JSONField(name = "warranty_period") + @Excel(name = "保修期(warranty_period)",orderNum = "1", isImportField = "true" ) + private String warranty_period; + + /** 税率 **/ + @JSONField(name = "tax_rate") + @Excel(name = "税率(tax_rate)",orderNum = "1", isImportField = "true" ) + private String tax_rate; + + /** 税收分类 **/ + @JSONField(name = "tax_code") + @Excel(name = "税收分类(tax_code)",orderNum = "1", isImportField = "true" ) + private String tax_code; + + /** 保修条款 **/ + @JSONField(name = "warranty_terms") + @Excel(name = "保修条款(warranty_terms)",orderNum = "1", isImportField = "true" ) + private String warranty_terms; + + /** 备注 **/ + @JSONField(name = "remark") + @Excel(name = "备注(remark)",orderNum = "1", isImportField = "true" ) + private String remark; + + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/product/ProductForm.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/product/ProductForm.java new file mode 100644 index 0000000..398d1a8 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/product/ProductForm.java @@ -0,0 +1,142 @@ +package com.yunzhupaas.mdm.model.product; + +import lombok.Data; +import java.util.*; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * 商品信息 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-27 + */ +@Data +@Schema(description = "表单参数") +public class ProductForm { + /** 主键 */ + @Schema(description = "主键") + @JSONField(name = "product_id") + private String productId; + + /** 乐观锁 **/ + @Schema(description = "乐观锁") + @JsonProperty("f_version") + @JSONField(name = "f_version") + private Integer version; + + /** 商品编码 **/ + @Schema(description = "商品编码") + @JsonProperty("product_code") + @JSONField(name = "product_code") + private String productCode; + /** 商品名称 **/ + @Schema(description = "商品名称") + @JsonProperty("product_name") + @JSONField(name = "product_name") + private String productName; + /** 商品类型 **/ + @Schema(description = "商品类型") + @JsonProperty("product_type") + @JSONField(name = "product_type") + private Object productType; + /** 商品分类 **/ + @Schema(description = "商品分类") + @JsonProperty("product_category") + @JSONField(name = "product_category") + private Object productCategory; + /** 商品简称 **/ + @Schema(description = "商品简称") + @JsonProperty("short_name") + @JSONField(name = "short_name") + private String shortName; + /** 品牌 **/ + @Schema(description = "品牌") + @JsonProperty("brand") + @JSONField(name = "brand") + private String brand; + /** 规格型号 **/ + @Schema(description = "规格型号") + @JsonProperty("product_model") + @JSONField(name = "product_model") + private String productModel; + /** 颜色 **/ + @Schema(description = "颜色") + @JsonProperty("color") + @JSONField(name = "color") + private String color; + /** 尺寸/规格 **/ + @Schema(description = "尺寸/规格") + @JsonProperty("product_size") + @JSONField(name = "product_size") + private String productSize; + /** 重量 **/ + @Schema(description = "重量") + @JsonProperty("weight") + @JSONField(name = "weight") + private String weight; + /** 最小起订量 **/ + @Schema(description = "最小起订量") + @JsonProperty("min_order_quantity") + @JSONField(name = "min_order_quantity") + private BigDecimal minOrderQuantity; + /** 标准销售单价 **/ + @Schema(description = "标准销售单价") + @JsonProperty("standard_sales_price") + @JSONField(name = "standard_sales_price") + private BigDecimal standardSalesPrice; + /** 毛重 **/ + @Schema(description = "毛重") + @JsonProperty("gross_weight") + @JSONField(name = "gross_weight") + private BigDecimal grossWeight; + /** 净重 **/ + @Schema(description = "净重") + @JsonProperty("net_weight") + @JSONField(name = "net_weight") + private BigDecimal netWeight; + /** 单位名称 **/ + @Schema(description = "单位名称") + @JsonProperty("unit_name") + @JSONField(name = "unit_name") + private String unitName; + /** 包装尺寸 **/ + @Schema(description = "包装尺寸") + @JsonProperty("packagesize") + @JSONField(name = "packagesize") + private String packagesize; + /** 成本价 **/ + @Schema(description = "成本价") + @JsonProperty("cost_price") + @JSONField(name = "cost_price") + private BigDecimal costPrice; + /** 保修期 **/ + @Schema(description = "保修期") + @JsonProperty("warranty_period") + @JSONField(name = "warranty_period") + private BigDecimal warrantyPeriod; + /** 税率 **/ + @Schema(description = "税率") + @JsonProperty("tax_rate") + @JSONField(name = "tax_rate") + private Object taxRate; + /** 税收分类 **/ + @Schema(description = "税收分类") + @JsonProperty("tax_code") + @JSONField(name = "tax_code") + private Object taxCode; + /** 保修条款 **/ + @Schema(description = "保修条款") + @JsonProperty("warranty_terms") + @JSONField(name = "warranty_terms") + private String warrantyTerms; + /** 备注 **/ + @Schema(description = "备注") + @JsonProperty("remark") + @JSONField(name = "remark") + private String remark; + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/product/ProductPagination.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/product/ProductPagination.java new file mode 100644 index 0000000..59e2acf --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/product/ProductPagination.java @@ -0,0 +1,60 @@ +package com.yunzhupaas.mdm.model.product; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import com.yunzhupaas.base.Pagination; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.List; + +/** + * + * 商品信息 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-27 + */ +@Data +@Schema(description = "列表查询参数") +public class ProductPagination extends Pagination { + /** 关键词搜索 */ + @Schema(description = "关键词搜索") + private String yunzhupaasKeyword; + /** 查询key */ + @Schema(description = "查询key") + private String[] selectKey; + /** 选中数据数组id */ + @Schema(description = "选中数据数组id") + private Object[] selectIds; + /** json */ + @Schema(description = "json") + private String json; + /** 数据类型 0-当前页,1-全部数据 */ + @Schema(description = "数据类型 0-当前页,1-全部数据") + private String dataType; + /** 高级查询 */ + @Schema(description = "高级查询") + private String superQueryJson; + /** 功能id */ + @Schema(description = "功能id") + private String moduleId; + /** 菜单id */ + @Schema(description = "菜单id") + private String menuId; + /** 商品名称 */ + @Schema(description = "商品名称") + @JsonProperty("product_name") + @JSONField(name = "productName") + private Object productName; + /** 商品分类 */ + @Schema(description = "商品分类") + @JsonProperty("product_category") + @JSONField(name = "productCategory") + private Object productCategory; + /** 标签面板字段 */ + @Schema(description = "标签面板字段") + @JsonProperty("product_type") + @JSONField(name = "productType") + private Object productType; +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/product/ProductsConstant.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/product/ProductsConstant.java new file mode 100644 index 0000000..ea15ff7 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/product/ProductsConstant.java @@ -0,0 +1,46 @@ +package com.yunzhupaas.mdm.model.product; + +import com.yunzhupaas.util.JsonUtil; +import java.util.*; + +/** + * mdm_product配置json + * + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-28 + */ +public class ProductsConstant{ + /** 数据库链接 */ + public static final String DBLINKID = "0"; + /** 表别名 map */ + public static final Map TABLERENAMES = JsonUtil.getJsonToBean("{\"mdm_product\":\"product\"}",Map.class); + /** 子表model map */ + public static final Map TABLEFIELDKEY = JsonUtil.getJsonToBean("{}",Map.class); + /** 整个表单配置json */ + public static final String getFormData(){ + StringBuilder sb = new StringBuilder(); + sb.append("{\"popupType\":\"fullScreen\",\"labelWidth\":100,\"classNames\":[],\"className\":[],\"fullScreenWidth\":\"100%\",\"hasConfirmAndAddBtn\":true,\"cancelButtonTextI18nCode\":\"common.cancelText\",\"businessKeyTip\":\"商品分类下,商品名称数据已存在,请勿重复提交!\",\"labelPosition\":\"right\",\"printId\":\"\",\"labelSuffix\":\"\",\"customBtns\":[],\"disabled\":false,\"formModel\":\"dataForm\",\"cancelButtonText\":\"取消\",\"confirmButtonText\":\"确定\",\"hasCancelBtn\":true,\"primaryKeyPolicy\":1,\"hasPrintBtn\":false,\"concurrencyLock\":true,\"classJson\":\"\",\"drawerWidth\":\"800px\",\"confirmButtonTextI18nCode\":\"common.okText\",\"printButtonText\":\"打印\",\"businessKeyList\":[\"product_name\",\"product_category\"],\"formRef\":\"formRef\",\"gutter\":15,\"logicalDelete\":true,\"size\":\"middle\",\"formRules\":\"rules\",\"generalWidth\":\"800px\",\"colon\":false,\"hasConfirmBtn\":true,\"useBusinessKey\":true,\"formStyle\":\"\",\"printButtonTextI18nCode\":\"common.printText\",\"fields\":[{\"__config__\":{\"formId\":\"formItem8978c9\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"productCode\",\"className\":[],\"label\":\"商品编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777015748420,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"商品编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":12},\"readonly\":true,\"__vModel__\":\"product_code\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"系统自动生成\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem388306\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"商品名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_product\",\"renderKey\":1777015778372,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"product_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_product\",\"renderKey\":1777016063171,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemfede94\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"productType\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"商品类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"multiple\":false,\"__vModel__\":\"product_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"}},{\"filterable\":true,\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_product\",\"renderKey\":1777016020981,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItema7e5eb\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"productCategory\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"商品分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"multiple\":false,\"__vModel__\":\"product_category\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"id\"}},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem77df66\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"商品简称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777015813586,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"short_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem990d79\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"品牌\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777015990788,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"brand\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemffeec4\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"规格型号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016647380,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"product_model\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem01dbb3\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"颜色\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016185738,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"color\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem813de2\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"尺寸/规格\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016206973,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"product_size\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formIteme04c5d\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"重量\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016212624,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"weight\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"controls\":false,\"precision\":4,\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"\",\"__config__\":{\"formId\":\"formItemb270cb\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"最小起订量\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016935479,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"min_order_quantity\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"placeholder\":\"请输入\",\"addonBefore\":\"\"},{\"controls\":false,\"precision\":2,\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"元\",\"__config__\":{\"formId\":\"formItem3a8055\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"标准销售单价\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016944560,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"standard_sales_price\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"placeholder\":\"请输入\",\"addonBefore\":\"\"},{\"controls\":false,\"precision\":4,\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"KG\",\"__config__\":{\"formId\":\"formItemb1a46c\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"毛重\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016995149,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"gross_weight\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"placeholder\":\"请输入\",\"addonBefore\":\"\"},{\"controls\":false,\"precision\":4,\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"KG\",\"__config__\":{\"formId\":\"formItem0ff3be\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"净重\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016999511,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"net_weight\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"placeholder\":\"请输入\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formIteme0cfab\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"单位名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016218388,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"unit_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemcfb8fe\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"包装尺寸\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016338579,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"packagesize\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"controls\":false,\"precision\":2,\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"%\",\"__config__\":{\"formId\":\"formItem35dbf8\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"税率\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777344586796,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"min\":0.01,\"__vModel__\":\"tax_rate\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"placeholder\":\"请输入\",\"addonBefore\":\"\"},{\"controls\":false,\"precision\":2,\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"元\",\"__config__\":{\"formId\":\"formItem0d3a1f\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"成本价\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777017076802,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"cost_price\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"placeholder\":\"请输入\",\"addonBefore\":\"\"},{\"__config__\":{\"formId\":\"formItemfe52ba\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"保修期\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777017256548,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"controls\":false,\"__vModel__\":\"warranty_period\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"placeholder\":\"请输入\",\"thousands\":false,\"isAmountChinese\":false,\"addonBefore\":\"\",\"addonAfter\":\"月\"},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016375009,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItemecba02\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"taxCode\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"税收分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"multiple\":false,\"__vModel__\":\"tax_code\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"}},{\"autoSize\":{\"minRows\":3,\"maxRows\":4},\"clearable\":true,\"showCount\":false,\"__config__\":{\"formId\":\"formItem542030\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"保修条款\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777017312713,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"warranty_terms\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\"},{\"autoSize\":{\"minRows\":2,\"maxRows\":4},\"clearable\":true,\"showCount\":false,\"__config__\":{\"formId\":\"formItemdd92df\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777017339245,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"remark\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\"}],\"detailExtraList\":[],\"span\":24,\"dataLog\":false}"); return sb.toString(); + } + /** 列表字段配置json */ + public static final String getColumnData(){ + StringBuilder sb = new StringBuilder(); + sb.append("{\"showSummary\":false,\"treePropsValue\":\"id\",\"columnOptions\":[{\"__config__\":{\"formId\":\"formItem8978c9\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"productCode\",\"className\":[],\"label\":\"商品编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777015748420,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"商品编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":12},\"readonly\":true,\"__vModel__\":\"product_code\",\"fullName\":\"商品编码\",\"fullNameI18nCode\":[\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"product_code\",\"placeholder\":\"系统自动生成\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"商品名称\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem388306\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"商品名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_product\",\"renderKey\":1777015778372,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"product_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"product_name\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"商品类型\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_product\",\"renderKey\":1777016063171,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemfede94\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"productType\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"商品类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"product_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"product_type\",\"placeholder\":\"请选择\"},{\"filterable\":true,\"clearable\":true,\"multiple\":false,\"fullName\":\"商品分类\",\"fullNameI18nCode\":[\"\"],\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_product\",\"renderKey\":1777016020981,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItema7e5eb\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"productCategory\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"商品分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"product_category\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"product_category\",\"placeholder\":\"请选择\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"商品简称\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem77df66\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"商品简称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777015813586,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"short_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"short_name\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"品牌\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem990d79\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"品牌\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777015990788,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"brand\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"brand\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"规格型号\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemffeec4\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"规格型号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016647380,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"product_model\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"product_model\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"颜色\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem01dbb3\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"颜色\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016185738,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"color\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"color\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"尺寸/规格\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem813de2\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"尺寸/规格\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016206973,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"product_size\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"product_size\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"重量\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formIteme04c5d\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"重量\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016212624,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"weight\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"weight\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"controls\":false,\"precision\":4,\"fullName\":\"最小起订量\",\"fullNameI18nCode\":[\"\"],\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"\",\"__config__\":{\"formId\":\"formItemb270cb\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"最小起订量\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016935479,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"min_order_quantity\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"min_order_quantity\",\"placeholder\":\"请输入\",\"addonBefore\":\"\"},{\"controls\":false,\"precision\":2,\"fullName\":\"标准销售单价\",\"fullNameI18nCode\":[\"\"],\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"元\",\"__config__\":{\"formId\":\"formItem3a8055\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"标准销售单价\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016944560,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"standard_sales_price\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"standard_sales_price\",\"placeholder\":\"请输入\",\"addonBefore\":\"\"},{\"controls\":false,\"precision\":4,\"fullName\":\"毛重\",\"fullNameI18nCode\":[\"\"],\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"KG\",\"__config__\":{\"formId\":\"formItemb1a46c\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"毛重\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016995149,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"gross_weight\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"gross_weight\",\"placeholder\":\"请输入\",\"addonBefore\":\"\"},{\"controls\":false,\"precision\":4,\"fullName\":\"净重\",\"fullNameI18nCode\":[\"\"],\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"KG\",\"__config__\":{\"formId\":\"formItem0ff3be\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"净重\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016999511,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"net_weight\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"net_weight\",\"placeholder\":\"请输入\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单位名称\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formIteme0cfab\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"单位名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016218388,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"unit_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"unit_name\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"包装尺寸\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemcfb8fe\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"包装尺寸\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016338579,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"packagesize\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"packagesize\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"controls\":false,\"precision\":2,\"fullName\":\"成本价\",\"fullNameI18nCode\":[\"\"],\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"元\",\"__config__\":{\"formId\":\"formItem0d3a1f\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"成本价\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777017076802,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"cost_price\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"cost_price\",\"placeholder\":\"请输入\",\"addonBefore\":\"\"},{\"controls\":false,\"fullName\":\"保修期\",\"fullNameI18nCode\":[\"\"],\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"月\",\"__config__\":{\"formId\":\"formItemfe52ba\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"保修期\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777017256548,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"warranty_period\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"warranty_period\",\"placeholder\":\"请输入\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"税率\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016371157,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem601a00\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"817378654752342789\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"税率\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"tax_rate\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_rate\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"税收分类\",\"fullNameI18nCode\":[\"\"],\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016375009,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItemecba02\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"taxCode\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"税收分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"tax_code\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_code\",\"placeholder\":\"请选择\"},{\"clearable\":true,\"fullName\":\"保修条款\",\"fullNameI18nCode\":[\"\"],\"autoSize\":{\"minRows\":3,\"maxRows\":4},\"showCount\":false,\"__config__\":{\"formId\":\"formItem542030\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"保修条款\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777017312713,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"warranty_terms\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"warranty_terms\",\"placeholder\":\"请输入\"},{\"clearable\":true,\"fullName\":\"备注\",\"fullNameI18nCode\":[\"\"],\"autoSize\":{\"minRows\":2,\"maxRows\":4},\"showCount\":false,\"__config__\":{\"formId\":\"formItemdd92df\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777017339245,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"remark\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"remark\",\"placeholder\":\"请输入\"}],\"pageSize\":20,\"type\":1,\"columnBtnsList\":[{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-edit\",\"label\":\"编辑\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"edit\",\"labelI18nCode\":\"common.editText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"删除\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"remove\",\"labelI18nCode\":\"common.delText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-generator-menu\",\"label\":\"详情\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"detail\",\"labelI18nCode\":\"common.detailText\"}],\"treeTitle\":\"左侧标题\",\"defaultColumnList\":[{\"yunzhupaasKey\":\"billRule\",\"resizable\":true,\"fullName\":\"商品编码\",\"fullNameI18nCode\":[\"\"],\"label\":\"商品编码\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItem8978c9\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"productCode\",\"className\":[],\"label\":\"商品编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777015748420,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"商品编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":12},\"readonly\":true,\"prop\":\"product_code\",\"__vModel__\":\"product_code\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"product_code\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem388306\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"商品名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_product\",\"renderKey\":1777015778372,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"product_name\",\"__vModel__\":\"product_name\",\"checked\":true,\"disabled\":false,\"id\":\"product_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"商品名称\",\"label\":\"商品名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"商品类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"商品类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_product\",\"renderKey\":1777016063171,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemfede94\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"productType\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"商品类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"product_type\",\"__vModel__\":\"product_type\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"product_type\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"cascader\",\"filterable\":true,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"商品分类\",\"fullNameI18nCode\":[\"\"],\"label\":\"商品分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_product\",\"renderKey\":1777016020981,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItema7e5eb\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"productCategory\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"商品分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"product_category\",\"__vModel__\":\"product_category\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"product_category\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem77df66\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"商品简称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777015813586,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"short_name\",\"__vModel__\":\"short_name\",\"checked\":true,\"disabled\":false,\"id\":\"short_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"商品简称\",\"label\":\"商品简称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem990d79\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"品牌\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777015990788,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"brand\",\"__vModel__\":\"brand\",\"checked\":true,\"disabled\":false,\"id\":\"brand\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"品牌\",\"label\":\"品牌\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemffeec4\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"规格型号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016647380,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"product_model\",\"__vModel__\":\"product_model\",\"checked\":true,\"disabled\":false,\"id\":\"product_model\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"规格型号\",\"label\":\"规格型号\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem01dbb3\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"颜色\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016185738,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"color\",\"__vModel__\":\"color\",\"checked\":true,\"disabled\":false,\"id\":\"color\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"颜色\",\"label\":\"颜色\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem813de2\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"尺寸/规格\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016206973,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"product_size\",\"__vModel__\":\"product_size\",\"checked\":true,\"disabled\":false,\"id\":\"product_size\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"尺寸/规格\",\"label\":\"尺寸/规格\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formIteme04c5d\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"重量\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016212624,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"weight\",\"__vModel__\":\"weight\",\"checked\":true,\"disabled\":false,\"id\":\"weight\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"重量\",\"label\":\"重量\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":4,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItemb270cb\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"最小起订量\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016935479,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"min_order_quantity\",\"__vModel__\":\"min_order_quantity\",\"checked\":true,\"disabled\":false,\"id\":\"min_order_quantity\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"resizable\":true,\"fullName\":\"最小起订量\",\"label\":\"最小起订量\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":2,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItem3a8055\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"标准销售单价\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016944560,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"standard_sales_price\",\"__vModel__\":\"standard_sales_price\",\"checked\":true,\"disabled\":false,\"id\":\"standard_sales_price\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"resizable\":true,\"fullName\":\"标准销售单价\",\"label\":\"标准销售单价\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"元\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":4,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItemb1a46c\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"毛重\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016995149,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"gross_weight\",\"__vModel__\":\"gross_weight\",\"checked\":true,\"disabled\":false,\"id\":\"gross_weight\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"resizable\":true,\"fullName\":\"毛重\",\"label\":\"毛重\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"KG\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":4,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItem0ff3be\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"净重\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016999511,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"net_weight\",\"__vModel__\":\"net_weight\",\"checked\":true,\"disabled\":false,\"id\":\"net_weight\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"resizable\":true,\"fullName\":\"净重\",\"label\":\"净重\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"KG\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formIteme0cfab\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"单位名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016218388,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"unit_name\",\"__vModel__\":\"unit_name\",\"checked\":true,\"disabled\":false,\"id\":\"unit_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"单位名称\",\"label\":\"单位名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemcfb8fe\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"包装尺寸\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016338579,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"packagesize\",\"__vModel__\":\"packagesize\",\"checked\":true,\"disabled\":false,\"id\":\"packagesize\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"包装尺寸\",\"label\":\"包装尺寸\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":2,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItem0d3a1f\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"成本价\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777017076802,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"cost_price\",\"__vModel__\":\"cost_price\",\"checked\":true,\"disabled\":false,\"id\":\"cost_price\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"resizable\":true,\"fullName\":\"成本价\",\"label\":\"成本价\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"元\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItemfe52ba\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"保修期\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777017256548,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"warranty_period\",\"__vModel__\":\"warranty_period\",\"checked\":true,\"disabled\":false,\"id\":\"warranty_period\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"resizable\":true,\"fullName\":\"保修期\",\"label\":\"保修期\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"月\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"税率\",\"fullNameI18nCode\":[\"\"],\"label\":\"税率\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016371157,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem601a00\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"817378654752342789\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"税率\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"tax_rate\",\"__vModel__\":\"tax_rate\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_rate\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"cascader\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"税收分类\",\"fullNameI18nCode\":[\"\"],\"label\":\"税收分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016375009,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItemecba02\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"taxCode\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"税收分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"tax_code\",\"__vModel__\":\"tax_code\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_code\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"fullName\":\"保修条款\",\"fullNameI18nCode\":[\"\"],\"label\":\"保修条款\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":3,\"maxRows\":4},\"showCount\":false,\"__config__\":{\"formId\":\"formItem542030\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"保修条款\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777017312713,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"warranty_terms\",\"__vModel__\":\"warranty_terms\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"warranty_terms\",\"placeholder\":\"请输入\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"fullName\":\"备注\",\"fullNameI18nCode\":[\"\"],\"label\":\"备注\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":4},\"showCount\":false,\"__config__\":{\"formId\":\"formItemdd92df\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777017339245,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"remark\",\"__vModel__\":\"remark\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"remark\",\"placeholder\":\"请输入\",\"labelI18nCode\":\"\"}],\"treeRelationFieldAbleIds\":[],\"treeSyncInterfaceName\":\"\",\"treeSyncTemplateJson\":[],\"treeRelation\":\"\",\"defaultSortConfig\":[],\"tabConfig\":{\"hasAllTab\":true,\"relationField\":\"product_type\",\"on\":true},\"hasSuperQuery\":true,\"treePropsLabel\":\"fullName\",\"groupField\":\"\",\"printIds\":[],\"uploaderTemplateJson\":{\"selectKey\":[\"product_name\",\"product_type\",\"product_category\",\"short_name\",\"brand\",\"product_model\",\"color\",\"product_size\",\"weight\",\"min_order_quantity\",\"standard_sales_price\",\"gross_weight\",\"net_weight\",\"unit_name\",\"packagesize\",\"cost_price\",\"warranty_period\",\"tax_rate\",\"tax_code\",\"warranty_terms\",\"remark\"],\"dataType\":\"2\"},\"hasTreeQuery\":false,\"useFormPermission\":false,\"complexHeaderList\":[],\"useBtnPermission\":true,\"treeSyncType\":0,\"hasPage\":true,\"searchList\":[{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"showCount\":false,\"__config__\":{\"formId\":\"formItem388306\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"商品名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_product\",\"renderKey\":1777015778372,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"product_name\",\"__vModel__\":\"product_name\",\"searchMultiple\":false,\"disabled\":false,\"id\":\"product_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"searchType\":2,\"fullName\":\"商品名称\",\"label\":\"商品名称\",\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"isKeyword\":false,\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"cascader\",\"filterable\":true,\"clearable\":true,\"searchType\":1,\"multiple\":false,\"fullName\":\"商品分类\",\"fullNameI18nCode\":[\"\"],\"label\":\"商品分类\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_product\",\"renderKey\":1777016020981,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItema7e5eb\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"productCategory\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"商品分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"product_category\",\"__vModel__\":\"product_category\",\"searchMultiple\":false,\"isKeyword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"product_category\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"}],\"ruleList\":{\"conditionList\":[],\"matchLogic\":\"and\"},\"childTableStyle\":1,\"treePropsChildren\":\"children\",\"treeRelationFieldSelectType\":\"all\",\"showOverflow\":true,\"treeTemplateJson\":[],\"treeTitleI18nCode\":\"\",\"treePropsName\":\"\",\"useColumnPermission\":false,\"treePropsUrl\":\"\",\"btnsList\":[{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-add\",\"label\":\"新增\",\"value\":\"add\",\"labelI18nCode\":\"common.add2Text\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-download\",\"label\":\"导出\",\"value\":\"download\",\"labelI18nCode\":\"common.exportText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-upload\",\"label\":\"导入\",\"value\":\"upload\",\"labelI18nCode\":\"common.importText\"},{\"show\":false,\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"批量删除\",\"value\":\"batchRemove\",\"labelI18nCode\":\"common.batchDelText\"},{\"show\":false,\"icon\":\"icon-ym icon-ym-report-icon-preview-printPreview\",\"label\":\"批量打印\",\"value\":\"batchPrint\",\"labelI18nCode\":\"common.batchPrintText\"}],\"useDataPermission\":true,\"viewKey\":\"\",\"columnList\":[{\"yunzhupaasKey\":\"billRule\",\"resizable\":true,\"fullName\":\"商品编码\",\"fullNameI18nCode\":[\"\"],\"label\":\"商品编码\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItem8978c9\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"productCode\",\"className\":[],\"label\":\"商品编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777015748420,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"商品编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":12},\"readonly\":true,\"prop\":\"product_code\",\"__vModel__\":\"product_code\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"product_code\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem388306\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"商品名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_product\",\"renderKey\":1777015778372,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"product_name\",\"__vModel__\":\"product_name\",\"disabled\":false,\"id\":\"product_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"商品名称\",\"label\":\"商品名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"商品类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"商品类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_product\",\"renderKey\":1777016063171,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemfede94\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"productType\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"商品类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"product_type\",\"__vModel__\":\"product_type\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"product_type\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"cascader\",\"filterable\":true,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"商品分类\",\"fullNameI18nCode\":[\"\"],\"label\":\"商品分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_product\",\"renderKey\":1777016020981,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItema7e5eb\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"productCategory\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"商品分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"product_category\",\"__vModel__\":\"product_category\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"product_category\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem77df66\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"商品简称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777015813586,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"short_name\",\"__vModel__\":\"short_name\",\"disabled\":false,\"id\":\"short_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"商品简称\",\"label\":\"商品简称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem990d79\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"品牌\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777015990788,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"brand\",\"__vModel__\":\"brand\",\"disabled\":false,\"id\":\"brand\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"品牌\",\"label\":\"品牌\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemffeec4\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"规格型号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016647380,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"product_model\",\"__vModel__\":\"product_model\",\"disabled\":false,\"id\":\"product_model\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"规格型号\",\"label\":\"规格型号\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem01dbb3\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"颜色\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016185738,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"color\",\"__vModel__\":\"color\",\"disabled\":false,\"id\":\"color\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"颜色\",\"label\":\"颜色\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem813de2\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"尺寸/规格\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016206973,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"product_size\",\"__vModel__\":\"product_size\",\"disabled\":false,\"id\":\"product_size\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"尺寸/规格\",\"label\":\"尺寸/规格\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formIteme04c5d\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"重量\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016212624,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"weight\",\"__vModel__\":\"weight\",\"disabled\":false,\"id\":\"weight\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"重量\",\"label\":\"重量\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":4,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItemb270cb\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"最小起订量\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016935479,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"min_order_quantity\",\"__vModel__\":\"min_order_quantity\",\"disabled\":false,\"id\":\"min_order_quantity\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"resizable\":true,\"fullName\":\"最小起订量\",\"label\":\"最小起订量\",\"sortable\":false,\"thousands\":f"); + sb.append("alse,\"addonAfter\":\"\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":2,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItem3a8055\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"标准销售单价\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016944560,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"standard_sales_price\",\"__vModel__\":\"standard_sales_price\",\"disabled\":false,\"id\":\"standard_sales_price\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"resizable\":true,\"fullName\":\"标准销售单价\",\"label\":\"标准销售单价\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"元\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":4,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItemb1a46c\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"毛重\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016995149,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"gross_weight\",\"__vModel__\":\"gross_weight\",\"disabled\":false,\"id\":\"gross_weight\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"resizable\":true,\"fullName\":\"毛重\",\"label\":\"毛重\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"KG\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":4,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItem0ff3be\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"净重\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016999511,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"net_weight\",\"__vModel__\":\"net_weight\",\"disabled\":false,\"id\":\"net_weight\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"resizable\":true,\"fullName\":\"净重\",\"label\":\"净重\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"KG\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formIteme0cfab\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"单位名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016218388,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"unit_name\",\"__vModel__\":\"unit_name\",\"disabled\":false,\"id\":\"unit_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"单位名称\",\"label\":\"单位名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemcfb8fe\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"包装尺寸\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016338579,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"packagesize\",\"__vModel__\":\"packagesize\",\"disabled\":false,\"id\":\"packagesize\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"包装尺寸\",\"label\":\"包装尺寸\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":2,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItem0d3a1f\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"成本价\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777017076802,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"cost_price\",\"__vModel__\":\"cost_price\",\"disabled\":false,\"id\":\"cost_price\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"resizable\":true,\"fullName\":\"成本价\",\"label\":\"成本价\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"元\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"resizable\":true,\"fullName\":\"保修期\",\"fullNameI18nCode\":[\"\"],\"label\":\"保修期\",\"sortable\":false,\"align\":\"left\",\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"月\",\"__config__\":{\"formId\":\"formItemfe52ba\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"保修期\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777017256548,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"warranty_period\",\"__vModel__\":\"warranty_period\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"warranty_period\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"税率\",\"fullNameI18nCode\":[\"\"],\"label\":\"税率\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016371157,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem601a00\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"817378654752342789\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"税率\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"tax_rate\",\"__vModel__\":\"tax_rate\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_rate\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"cascader\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"税收分类\",\"fullNameI18nCode\":[\"\"],\"label\":\"税收分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016375009,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItemecba02\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"taxCode\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"税收分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"tax_code\",\"__vModel__\":\"tax_code\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_code\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"}],\"summaryField\":[],\"parentField\":\"\",\"treeDataSource\":\"dictionary\",\"treeDictionary\":\"\",\"treeSyncInterfaceId\":\"\",\"customBtnsList\":[]}"); + return sb.toString(); + } + /** app列表字段配置json */ + public static final String getAppColumnData(){ + StringBuilder sb = new StringBuilder(); + sb.append("{\"hasPage\":true,\"useColumnPermission\":false,\"searchList\":[],\"btnsList\":[{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-add\",\"label\":\"新增\",\"value\":\"add\",\"labelI18nCode\":\"common.add2Text\"},{\"show\":false,\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"批量删除\",\"value\":\"batchRemove\",\"labelI18nCode\":\"common.batchDelText\"}],\"useDataPermission\":false,\"viewKey\":\"\",\"ruleListApp\":{\"conditionList\":[],\"matchLogic\":\"and\"},\"columnList\":[{\"yunzhupaasKey\":\"billRule\",\"resizable\":true,\"fullName\":\"商品编码\",\"fullNameI18nCode\":[\"\"],\"label\":\"商品编码\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItem8978c9\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"productCode\",\"className\":[],\"label\":\"商品编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777015748420,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"商品编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":12},\"readonly\":true,\"prop\":\"product_code\",\"__vModel__\":\"product_code\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"product_code\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem388306\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"商品名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_product\",\"renderKey\":1777015778372,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"product_name\",\"__vModel__\":\"product_name\",\"disabled\":false,\"id\":\"product_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"商品名称\",\"label\":\"商品名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"商品类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"商品类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_product\",\"renderKey\":1777016063171,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemfede94\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"productType\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"商品类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"product_type\",\"__vModel__\":\"product_type\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"product_type\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"cascader\",\"filterable\":true,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"商品分类\",\"fullNameI18nCode\":[\"\"],\"label\":\"商品分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_product\",\"renderKey\":1777016020981,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItema7e5eb\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"productCategory\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"商品分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"product_category\",\"__vModel__\":\"product_category\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"product_category\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem77df66\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"商品简称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777015813586,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"short_name\",\"__vModel__\":\"short_name\",\"disabled\":false,\"id\":\"short_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"商品简称\",\"label\":\"商品简称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem990d79\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"品牌\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777015990788,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"brand\",\"__vModel__\":\"brand\",\"disabled\":false,\"id\":\"brand\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"品牌\",\"label\":\"品牌\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemffeec4\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"规格型号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016647380,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"product_model\",\"__vModel__\":\"product_model\",\"disabled\":false,\"id\":\"product_model\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"规格型号\",\"label\":\"规格型号\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem01dbb3\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"颜色\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016185738,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"color\",\"__vModel__\":\"color\",\"disabled\":false,\"id\":\"color\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"颜色\",\"label\":\"颜色\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem813de2\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"尺寸/规格\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016206973,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"product_size\",\"__vModel__\":\"product_size\",\"disabled\":false,\"id\":\"product_size\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"尺寸/规格\",\"label\":\"尺寸/规格\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formIteme04c5d\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"重量\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016212624,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"weight\",\"__vModel__\":\"weight\",\"disabled\":false,\"id\":\"weight\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"重量\",\"label\":\"重量\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":4,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItemb270cb\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"最小起订量\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016935479,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"min_order_quantity\",\"__vModel__\":\"min_order_quantity\",\"disabled\":false,\"id\":\"min_order_quantity\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"resizable\":true,\"fullName\":\"最小起订量\",\"label\":\"最小起订量\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":2,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItem3a8055\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"标准销售单价\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016944560,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"standard_sales_price\",\"__vModel__\":\"standard_sales_price\",\"disabled\":false,\"id\":\"standard_sales_price\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"resizable\":true,\"fullName\":\"标准销售单价\",\"label\":\"标准销售单价\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"元\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":4,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItemb1a46c\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"毛重\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016995149,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"gross_weight\",\"__vModel__\":\"gross_weight\",\"disabled\":false,\"id\":\"gross_weight\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"resizable\":true,\"fullName\":\"毛重\",\"label\":\"毛重\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"KG\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":4,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItem0ff3be\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"净重\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016999511,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"net_weight\",\"__vModel__\":\"net_weight\",\"disabled\":false,\"id\":\"net_weight\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"resizable\":true,\"fullName\":\"净重\",\"label\":\"净重\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"KG\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formIteme0cfab\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"单位名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016218388,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"unit_name\",\"__vModel__\":\"unit_name\",\"disabled\":false,\"id\":\"unit_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"单位名称\",\"label\":\"单位名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemcfb8fe\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"包装尺寸\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016338579,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"packagesize\",\"__vModel__\":\"packagesize\",\"disabled\":false,\"id\":\"packagesize\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"包装尺寸\",\"label\":\"包装尺寸\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":2,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItem0d3a1f\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"成本价\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777017076802,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"cost_price\",\"__vModel__\":\"cost_price\",\"disabled\":false,\"id\":\"cost_price\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"resizable\":true,\"fullName\":\"成本价\",\"label\":\"成本价\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"元\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"resizable\":true,\"fullName\":\"保修期\",\"fullNameI18nCode\":[\"\"],\"label\":\"保修期\",\"sortable\":false,\"align\":\"left\",\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"月\",\"__config__\":{\"formId\":\"formItemfe52ba\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"保修期\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777017256548,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"warranty_period\",\"__vModel__\":\"warranty_period\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"warranty_period\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"税率\",\"fullNameI18nCode\":[\"\"],\"label\":\"税率\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016371157,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem601a00\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"817378654752342789\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"税率\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"tax_rate\",\"__vModel__\":\"tax_rate\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_rate\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"cascader\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"税收分类\",\"fullNameI18nCode\":[\"\"],\"label\":\"税收分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016375009,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItemecba02\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"taxCode\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"税收分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"tax_code\",\"__vModel__\":\"tax_code\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_code\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"}],\"columnOptions\":[{\"__config__\":{\"formId\":\"formItem8978c9\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"productCode\",\"className\":[],\"label\":\"商品编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777015748420,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"商品编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":12},\"readonly\":true,\"__vModel__\":\"product_code\",\"fullName\":\"商品编码\",\"fullNameI18nCode\":[\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"product_code\",\"placeholder\":\"系统自动生成\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"商品名称\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem388306\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"商品名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_product\",\"renderKey\":1777015778372,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"product_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"product_name\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"商品类型\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_product\",\"renderKey\":1777016063171,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemfede94\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"productType\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"商品类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"product_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"product_type\",\"placeholder\":\"请选择\"},{\"filterable\":true,\"clearable\":true,\"multiple\":false,\"fullName\":\"商品分类\",\"fullNameI18nCode\":[\"\"],\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_product\",\"renderKey\":1777016020981,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItema7e5eb\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"productCategory\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"商品分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"product_category\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"product_category\",\"placeholder\":\"请选择\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"商品简称\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem77df66\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"商品简称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777015813586,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"short_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"short_name\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"品牌\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem990d79\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"品牌\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777015990788,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"brand\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"brand\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"规格型号\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemffeec4\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"规格型号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016647380,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"product_model\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"product_model\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"颜色\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem01dbb3\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"颜色\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016185738,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"color\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"color\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"尺寸/规格\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem813de2\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"尺寸/规格\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016206973,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"product_size\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"product_size\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"重量\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formIteme04c5d\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"重量\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016212624,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"weight\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"weight\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"controls\":false,\"precision\":4,\"fullName\":\"最小起订量\",\"fullNameI18nCode\":[\"\"],\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"\",\"__config__\":{\"formId\":\"formItemb270cb\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"最小起订量\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016935479,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"min_order_quantity\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"min_order_quantity\",\"placeholder\":\"请输入\",\"addonBefore\":\"\"},{\"controls\":false,\"precision\":2,\"fullName\":\"标准销售单价\",\"fullNameI18nCode\":[\"\"],\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"元\",\"__config__\":{\"formId\":\"formItem3a8055\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"标准销售单价\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016944560,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"standard_sales_price\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"standard_sales_price\",\"placeholder\":\"请输入\",\"addonBefore\":\"\"},{\"controls\":false,\"precision\":4,\"fullName\":\"毛重\",\"fullNameI18nCode\":[\"\"],\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"KG\",\"__config__\":{\"formId\":\"formItemb1a46c\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"毛重\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016995149,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"gross_weight\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"gross_weight\",\"placeholder\":\"请输入\",\"addonBefore\":\"\"},{\"controls\":false,\"precision\":4,\"fullName\":\"净重\",\"fullNameI18nCode\":[\"\"],\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"KG\",\"__config__\":{\"formId\":\"formItem0ff3be\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"净重\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016999511,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"net_weight\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"net_weight\",\"placeholder\":\"请输入\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单位名称\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formIteme0cfab\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"单位名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016218388,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"unit_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"unit_name\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"包装尺寸\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemcfb8fe\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"包装尺寸\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016338579,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"packagesize\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"packagesize\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"controls\":false,\"precision\":2,\"fullName\":\"成本价\",\"fullNameI18nCode\":[\"\"],\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"元\",\"__config__\":{\"formId\":\"formItem0d3a1f\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"成本价\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777017076802,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"cost_price\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"cost_price\",\"placeholder\":\"请输入\",\"addonBefore\":\"\"},{\"controls\":false,\"fullName\":\"保修期\",\"fullNameI18nCode\":[\"\"],\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"月\",\"__config__\":{\"formId\":\"formItemfe52ba\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"保修期\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777017256548,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"warranty_period\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"warranty_period\",\"placeholder\":\"请输入\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"税率\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016371157,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem601a00\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"817378654752342789\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"税率\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"tax_rate\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_rate\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"税收分类\",\"fullNameI18nCode\":[\"\"],\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016375009,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItemecba02\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"taxCode\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"税收分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"tax_code\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_code\",\"placeholder\":\"请选择\"},{\"clearable\":true,\"fullName\":\"保修条款\",\"fullNameI18nCode\":[\"\"],\"autoSize\":{\"minRows\":3,\"maxRows\":4},\"showCount\":false,\"__config__\":{\"formId\":\"formItem542030\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"保修条款\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777017312713,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"warranty_terms\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"warranty_terms\",\"placeholder\":\"请输入\"},{\"clearable\":true,\"fullName\":\"备注\",\"fullNameI18nCode\":[\"\"],\"autoSize\":{\"minRows\":2,\"maxRows\":4},\"showCount\":false,\"__config__\":{\"formId\":\"formItemdd92df\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777017339245,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"remark\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"remark\",\"placeholder\":\"请输入\"}],\"pageSize\":20,\"defaultSortConfig\":[],\"type\":1,\"columnBtnsList\":[{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-edit\",\"label\":\"编辑\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"edit\",\"labelI18nCode\":\"common.editText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"删除\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"remove\",\"labelI18nCode\":\"common.delText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-generator-menu\",\"label\":\"详情\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"detail\",\"labelI18nCode\":\"common.detailText\"}],\"tabConfig\":{\"hasAllTab\":true,\"relationField\":\"\",\"on\":false},\"hasSuperQuery\":false,\"defaultColumnList\":[{\"yunzhupaasKey\":\"billRule\",\"resizable\":true,\"fullName\":\"商品编码\",\"fullNameI18nCode\":[\"\"],\"label\":\"商品编码\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItem8978c9\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"productCode\",\"className\":[],\"label\":\"商品编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777015748420,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"商品编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":12},\"readonly\":true,\"prop\":\"product_code\",\"__vModel__\":\"product_code\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"product_code\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem388306\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"商品名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_product\",\"renderKey\":1777015778372,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"product_name\",\"__vModel__\":\"product_name\",\"checked\":false,\"disabled\":false,\"id\":\"product_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"商品名称\",\"label\":\"商品名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"商品类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"商品类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_product\",\"renderKey\":1777016063171,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemfede94\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"productType\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"商品类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"product_type\",\"__vModel__\":\"product_type\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"product_type\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"cascader\",\"filterable\":true,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"商品分类\",\"fullNameI18nCode\":[\"\"],\"label\":\"商品分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_product\",\"renderKey\":1777016020981,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItema7e5eb\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"productCategory\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"商品分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"product_category\",\"__vModel__\":\"product_category\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"product_category\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem77df66\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"商品简称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777015813586,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"short_name\",\"__vModel__\":\"short_name\",\"checked\":false,\"disabled\":false,\"id\":\"short_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"商品简称\",\"label\":\"商品简称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem990d79\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"品牌\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777015990788,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"brand\",\"__vModel__\":\"brand\",\"checked\":false,\"disabled\":false,\"id\":\"brand\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"品牌\",\"label\":\"品牌\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemffeec4\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"规格型号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016647380,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"product_model\",\"__vModel__\":\"product_model\",\"checked\":false,\"disabled\":false,\"id\":\"product_model\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"规格型号\",\"label\":\"规格型号\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem01dbb3\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"颜色\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016185738,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"color\",\"__vModel__\":\"color\",\"checked\":false,\"disabled\":false,\"id\":\"color\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"颜色\",\"label\":\"颜色\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem813de2\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"尺寸/规格\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016206973,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"product_size\",\"__vModel__\":\"product_size\",\"checked\":false,\"disabled\":false,\"id\":\"product_size\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"尺寸/规格\",\"label\":\"尺寸/规格\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formIteme04c5d\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"重量\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016212624,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"weight\",\"__vModel__\":\"weight\",\"checked\":false,\"disabled\":false,\"id\":\"weight\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"重量\",\"label\":\"重量\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":4,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItemb270cb\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"最小起订量\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016935479,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"min_order_quantity\",\"__vModel__\":\"min_order_quantity\",\"checked\":false,\"disabled\":false,\"id\":\"min_order_quantity\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"resizable\":true,\"fullName\":\"最小起订量\",\"label\":\"最小起订量\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":2,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItem3a8055\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"标准销售单价\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016944560,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"standard_sales_price\",\"__vModel__\":\"standard_sales_price\",\"checked\":false,\"disabled\":false,\"id\":\"standard_sales_price\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"resizable\":true,\"fullName\":\"标准销售单价\",\"label\":\"标准销售单价\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"元\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":4,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItemb1a46c\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"毛重\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016995149,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"gross_weight\",\"__vModel__\":\"gross_weight\",\"checked\":false,\"disabled\":false,\"id\":\"gross_weight\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"resizable\":true,\"fullName\":\"毛重\",\"label\":\"毛重\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"KG\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":4,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItem0ff3be\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"净重\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016999511,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"net_weight\",\"__vModel__\":\"net_weight\",\"checked\":false,\"disabled\":false,\"id\":\"net_weight\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"resizable\":true,\"fullName\":\"净重\",\"label\":\"净重\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"KG\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formIteme0cfab\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"单位名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016218388,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"unit_name\",\"__vModel__\":\"unit_name\",\"checked\":false,\"disabled\":false,\"id\":\"unit_name\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"单位名称\",\"label\":\"单位名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItemcfb8fe\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"包装尺寸\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016338579,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"packagesize\",\"__vModel__\":\"packagesize\",\"checked\":false,\"disabled\":false,\"id\":\"packagesize\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"fullName\":\"包装尺寸\",\"label\":\"包装尺寸\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":2,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmoun"); + sb.append("tChinese\":false,\"__config__\":{\"formId\":\"formItem0d3a1f\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"成本价\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777017076802,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"cost_price\",\"__vModel__\":\"cost_price\",\"checked\":false,\"disabled\":false,\"id\":\"cost_price\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"resizable\":true,\"fullName\":\"成本价\",\"label\":\"成本价\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"元\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItemfe52ba\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"保修期\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777017256548,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"warranty_period\",\"__vModel__\":\"warranty_period\",\"checked\":false,\"disabled\":false,\"id\":\"warranty_period\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"resizable\":true,\"fullName\":\"保修期\",\"label\":\"保修期\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"月\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"税率\",\"fullNameI18nCode\":[\"\"],\"label\":\"税率\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016371157,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem601a00\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"817378654752342789\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"税率\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"tax_rate\",\"__vModel__\":\"tax_rate\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_rate\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"cascader\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"税收分类\",\"fullNameI18nCode\":[\"\"],\"label\":\"税收分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777016375009,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItemecba02\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"taxCode\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"税收分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"tax_code\",\"__vModel__\":\"tax_code\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_code\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"fullName\":\"保修条款\",\"fullNameI18nCode\":[\"\"],\"label\":\"保修条款\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":3,\"maxRows\":4},\"showCount\":false,\"__config__\":{\"formId\":\"formItem542030\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"保修条款\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777017312713,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"warranty_terms\",\"__vModel__\":\"warranty_terms\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"warranty_terms\",\"placeholder\":\"请输入\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"fullName\":\"备注\",\"fullNameI18nCode\":[\"\"],\"label\":\"备注\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":4},\"showCount\":false,\"__config__\":{\"formId\":\"formItemdd92df\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_product\",\"renderKey\":1777017339245,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"remark\",\"__vModel__\":\"remark\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"remark\",\"placeholder\":\"请输入\",\"labelI18nCode\":\"\"}],\"showOverflow\":true,\"useFormPermission\":false,\"customBtnsList\":[],\"useBtnPermission\":false}"); + return sb.toString(); + } + /** 表列表 */ + public static final String getTableList(){ + StringBuilder sb = new StringBuilder(); + sb.append("[{\"relationTable\":\"\",\"tableField\":\"\",\"typeId\":\"1\",\"fields\":[{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"product_id\",\"fieldName\":\"产品主键ID\",\"identity\":0,\"primaryKey\":1},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"100\",\"dataType\":\"varchar\",\"field\":\"product_code\",\"fieldName\":\"商品编码(SKU)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"200\",\"dataType\":\"varchar\",\"field\":\"product_name\",\"fieldName\":\"商品名称\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"100\",\"dataType\":\"varchar\",\"field\":\"short_name\",\"fieldName\":\"商品简称\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"product_type\",\"fieldName\":\"商品类型。关联字典。productType。如:1-自产成品,2-贸易商品,3-服务商品\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"product_category\",\"fieldName\":\"商品分类编码。关联字典:productCategory\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"brand\",\"fieldName\":\"品牌\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"200\",\"dataType\":\"varchar\",\"field\":\"product_model\",\"fieldName\":\"规格型号\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"color\",\"fieldName\":\"颜色\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"100\",\"dataType\":\"varchar\",\"field\":\"product_size\",\"fieldName\":\"尺寸/规格\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"20,6\",\"dataType\":\"decimal\",\"field\":\"weight\",\"fieldName\":\"重量\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"unit_name\",\"fieldName\":\"单位名称\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"20,6\",\"dataType\":\"decimal\",\"field\":\"min_order_quantity\",\"fieldName\":\"最小起订量\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"20,6\",\"dataType\":\"decimal\",\"field\":\"standard_sales_price\",\"fieldName\":\"标准销售单价\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"20,6\",\"dataType\":\"decimal\",\"field\":\"gross_weight\",\"fieldName\":\"毛重\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"20,6\",\"dataType\":\"decimal\",\"field\":\"net_weight\",\"fieldName\":\"净重\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"100\",\"dataType\":\"varchar\",\"field\":\"packagesize\",\"fieldName\":\"包装尺寸(长×宽×高)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"20,6\",\"dataType\":\"decimal\",\"field\":\"cost_price\",\"fieldName\":\"成本价\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"10,4\",\"dataType\":\"decimal\",\"field\":\"tax_rate\",\"fieldName\":\"税率(默认13%)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"tax_code\",\"fieldName\":\"税收分类编码\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":null,\"dataType\":\"int\",\"field\":\"warranty_period\",\"fieldName\":\"保修期(月)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":null,\"dataType\":\"text\",\"field\":\"warranty_terms\",\"fieldName\":\"保修条款\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":null,\"dataType\":\"text\",\"field\":\"remark\",\"fieldName\":\"备注\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"create_by\",\"fieldName\":\"创建人\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"timestamp\",\"field\":\"create_time\",\"fieldName\":\"创建时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"update_by\",\"fieldName\":\"更新人\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"timestamp\",\"field\":\"update_time\",\"fieldName\":\"更新时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_tenant_id\",\"fieldName\":\"租户id\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_flow_id\",\"fieldName\":\"流程id\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_flow_task_id\",\"fieldName\":\"流程任务主键\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":null,\"dataType\":\"int\",\"field\":\"f_delete_mark\",\"fieldName\":\"删除标志\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"f_delete_time\",\"fieldName\":\"删除时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_delete_user_id\",\"fieldName\":\"删除用户\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":null,\"dataType\":\"int\",\"field\":\"f_version\",\"fieldName\":\"乐观锁\",\"identity\":0,\"primaryKey\":0}],\"relationField\":\"\",\"table\":\"mdm_product\",\"tableName\":\"商品信息\"}]"); return sb.toString(); + } + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/suppinfo/PanyInvoiceExcelVO.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/suppinfo/PanyInvoiceExcelVO.java new file mode 100644 index 0000000..af7072c --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/suppinfo/PanyInvoiceExcelVO.java @@ -0,0 +1,75 @@ +package com.yunzhupaas.mdm.model.suppinfo; + +import lombok.Data; +import java.sql.Time; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; +import cn.afterturn.easypoi.excel.annotation.Excel; +import cn.afterturn.easypoi.excel.annotation.ExcelEntity; +import cn.afterturn.easypoi.excel.annotation.ExcelCollection; +import java.math.BigDecimal; +import java.util.List; +/** + * + * 供应商信息 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-24 + */ +@Data +public class PanyInvoiceExcelVO{ + /** 发票抬头名称 **/ + @JSONField(name = "title_name") + @Excel(name = "发票抬头名称(title_name)",orderNum = "1", isImportField = "true" ) + private String title_name; + + /** 纳税人识别号 **/ + @JSONField(name = "credit_code") + @Excel(name = "纳税人识别号(credit_code)",orderNum = "1", isImportField = "true" ) + private String credit_code; + + /** 纳税人类别 **/ + @JSONField(name = "tax_type") + @Excel(name = "纳税人类别(tax_type)",orderNum = "1", isImportField = "true" ) + private String tax_type; + + /** 地址 **/ + @JSONField(name = "address") + @Excel(name = "地址(address)",orderNum = "1", isImportField = "true" ) + private String address; + + /** 电话 **/ + @JSONField(name = "phone") + @Excel(name = "电话(phone)",orderNum = "1", isImportField = "true" ) + private String phone; + + /** 开户银行 **/ + @JSONField(name = "bank_name") + @Excel(name = "开户银行(bank_name)",orderNum = "1", isImportField = "true" ) + private String bank_name; + + /** 银行账户 **/ + @JSONField(name = "bank_account") + @Excel(name = "银行账户(bank_account)",orderNum = "1", isImportField = "true" ) + private String bank_account; + + /** 是否默认 **/ + @JSONField(name = "is_defalut") + @Excel(name = "是否默认(is_defalut)",orderNum = "1", isImportField = "true" ) + private String is_defalut; + + /** 是否有效 **/ + @JSONField(name = "is_valid") + @Excel(name = "是否有效(is_valid)",orderNum = "1", isImportField = "true" ) + private String is_valid; + + /** 备注 **/ + @JSONField(name = "remark") + @Excel(name = "备注(remark)",orderNum = "1", isImportField = "true" ) + private String remark; + + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/suppinfo/PanyInvoiceModel.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/suppinfo/PanyInvoiceModel.java new file mode 100644 index 0000000..d312338 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/suppinfo/PanyInvoiceModel.java @@ -0,0 +1,93 @@ +package com.yunzhupaas.mdm.model.suppinfo; + +import lombok.Data; +import java.util.List; +import java.util.Date; +import java.math.BigDecimal; +import com.alibaba.fastjson.annotation.JSONField; +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * + * 供应商信息 + * 版本: V5.2.7 + * 版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * 作者: 深圳市乐程软件有限公司 + * 日期: 2026-04-24 + */ +@Data +@Schema(description = "PanyInvoice子表参数") +public class PanyInvoiceModel { + + /** 子表:PanyInvoice 主键:invoice_id **/ + @Schema(description = "主键") + @JsonProperty("invoice_id") + private String invoice_id; + /** 发票抬头编码 **/ + @Schema(description = "发票抬头编码") + @JsonProperty("title_code") + @JSONField(name = "title_code") + private String titleCode; + /** 发票抬头名称 **/ + @Schema(description = "发票抬头名称") + @Excel(name = "发票抬头名称",orderNum = "1",isImportField = "true") + @JsonProperty("title_name") + @JSONField(name = "title_name") + private String titleName; + /** 纳税人识别号 **/ + @Schema(description = "纳税人识别号") + @Excel(name = "纳税人识别号",orderNum = "1",isImportField = "true") + @JsonProperty("credit_code") + @JSONField(name = "credit_code") + private String creditCode; + /** 纳税人类别 **/ + @Schema(description = "纳税人类别") + @Excel(name = "纳税人类别",orderNum = "1",isImportField = "true") + @JsonProperty("tax_type") + @JSONField(name = "tax_type") + private Object taxType; + /** 地址 **/ + @Schema(description = "地址") + @Excel(name = "地址",orderNum = "1",isImportField = "true") + @JsonProperty("address") + @JSONField(name = "address") + private String address; + /** 电话 **/ + @Schema(description = "电话") + @Excel(name = "电话",orderNum = "1",isImportField = "true") + @JsonProperty("phone") + @JSONField(name = "phone") + private String phone; + /** 开户银行 **/ + @Schema(description = "开户银行") + @Excel(name = "开户银行",orderNum = "1",isImportField = "true") + @JsonProperty("bank_name") + @JSONField(name = "bank_name") + private String bankName; + /** 银行账户 **/ + @Schema(description = "银行账户") + @Excel(name = "银行账户",orderNum = "1",isImportField = "true") + @JsonProperty("bank_account") + @JSONField(name = "bank_account") + private String bankAccount; + /** 是否默认 **/ + @Schema(description = "是否默认") + @Excel(name = "是否默认",orderNum = "1",isImportField = "true") + @JsonProperty("is_defalut") + @JSONField(name = "is_defalut") + private String isDefalut; + /** 是否有效 **/ + @Schema(description = "是否有效") + @Excel(name = "是否有效",orderNum = "1",isImportField = "true") + @JsonProperty("is_valid") + @JSONField(name = "is_valid") + private String isValid; + /** 备注 **/ + @Schema(description = "备注") + @Excel(name = "备注",orderNum = "1",isImportField = "true") + @JsonProperty("remark") + @JSONField(name = "remark") + private String remark; +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/suppinfo/SuppinfoConstant.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/suppinfo/SuppinfoConstant.java new file mode 100644 index 0000000..f340a31 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/suppinfo/SuppinfoConstant.java @@ -0,0 +1,47 @@ +package com.yunzhupaas.mdm.model.suppinfo; + +import com.yunzhupaas.util.JsonUtil; +import java.util.*; + +/** + * 供应商信息配置json + * + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-24 + */ +public class SuppinfoConstant{ + /** 数据库链接 */ + public static final String DBLINKID = "0"; + /** 表别名 map */ + public static final Map TABLERENAMES = JsonUtil.getJsonToBean("{\"mdm_company_bank\":\"companyBank\",\"mdm_company_invoice\":\"panyInvoice\",\"mdm_supplier\":\"supplier\",\"mdm_company\":\"company\"}",Map.class); + /** 子表model map */ + public static final Map TABLEFIELDKEY = JsonUtil.getJsonToBean("{\"tableField46dc53\":\"mdm_company_invoice\",\"tableFieldad9d92\":\"mdm_company_bank\"}",Map.class); + /** 整个表单配置json */ + public static final String getFormData(){ + StringBuilder sb = new StringBuilder(); +sb.append("{\"popupType\":\"drawer\",\"labelWidth\":100,\"classNames\":[],\"className\":[],\"fullScreenWidth\":\"100%\",\"hasConfirmAndAddBtn\":true,\"cancelButtonTextI18nCode\":\"common.cancelText\",\"businessKeyTip\":\"数据已存在,请勿重复提交!\",\"labelPosition\":\"right\",\"printId\":\"\",\"labelSuffix\":\"\",\"customBtns\":[],\"disabled\":false,\"formModel\":\"dataForm\",\"cancelButtonText\":\"取消\",\"confirmButtonText\":\"确定\",\"hasCancelBtn\":true,\"primaryKeyPolicy\":1,\"hasPrintBtn\":false,\"concurrencyLock\":false,\"classJson\":\"\",\"drawerWidth\":\"1000px\",\"confirmButtonTextI18nCode\":\"common.okText\",\"printButtonText\":\"打印\",\"businessKeyList\":[],\"formRef\":\"formRef\",\"gutter\":15,\"logicalDelete\":false,\"size\":\"middle\",\"formRules\":\"rules\",\"generalWidth\":\"1000px\",\"colon\":false,\"hasConfirmBtn\":true,\"useBusinessKey\":false,\"formStyle\":\"\",\"printButtonTextI18nCode\":\"common.printText\",\"fields\":[{\"__config__\":{\"formId\":\"formItem7a91b8\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"CustomerCompanyCode\",\"className\":[],\"label\":\"企业编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776916036468,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"客户编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":8},\"readonly\":true,\"__vModel__\":\"company_code\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"系统自动生成\"},{\"clearable\":true,\"maxlength\":200,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem478e5c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"企业名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506482470,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"company_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入企业名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem84e51c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"简称/昵称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506482631,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"short_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入简称/昵称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"optionType\":\"default\",\"__config__\":{\"yunzhupaasKey\":\"radio\",\"defaultValue\":\"ORG\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506487223,\"tagIcon\":\"icon-ym icon-ym-generator-radio\",\"tag\":\"YunzhupaasRadio\",\"formId\":\"formItemb3f6cd\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"size\":\"default\",\"buttonStyle\":\"solid\",\"options\":[{\"fullName\":\"企业\",\"id\":\"ORG\"},{\"fullName\":\"个人\",\"id\":\"IND\"}],\"__vModel__\":\"entity_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"direction\":\"horizontal\"},{\"clearable\":true,\"maxlength\":100,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem10350c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"社会信用代码\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506494880,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"credit_code\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入社会信用代码\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"formId\":\"formItemfc6848\",\"yunzhupaasKey\":\"organizeSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"归属组织\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776912270086,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasOrganizeSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"ableIds\":[],\"multiple\":false,\"__vModel__\":\"org_id\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"formId\":\"formItemcc9deb\",\"yunzhupaasKey\":\"areaSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属地区\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507118587,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-Provinces\",\"tag\":\"YunzhupaasAreaSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"level\":2,\"multiple\":false,\"__vModel__\":\"province_id\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择所属地区\"},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503586,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem05d07f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"multiple\":false,\"__vModel__\":\"tax_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择纳税人类别\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"}},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503806,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem66e88f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"enterpriseScale\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业规模\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"multiple\":false,\"__vModel__\":\"enterprise_scale\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择企业规模\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"}},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506504118,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItema76b83\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"9b542177a477488994ce09fff3c93901\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"multiple\":false,\"__vModel__\":\"enterprise_nature\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择企业类型\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"}},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506507062,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem6bd8a7\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"d59a3cf65f9847dbb08be449e3feae16\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"行业代码\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"multiple\":false,\"__vModel__\":\"industry_code\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择行业代码\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"}},{\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506509988,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItembab00e\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"成立日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"format\":\"yyyy-MM-dd\",\"__vModel__\":\"registration_date\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择成立日期\"},{\"controls\":false,\"max\":999999,\"precision\":4,\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"万元\",\"__config__\":{\"formId\":\"formItem3134b1\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"注册资本\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506514957,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"registered_capital\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"placeholder\":\"请输入注册资本\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem4f2d0b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"法定代表人\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524679,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"legal_representative\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入法定代表人\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":11,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem97bd9d\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"联系电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524966,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^1[3456789]\\\\d{9}$|^0\\\\d{2,3}-?\\\\d{7,8}$/\",\"message\":\"请输入正确的电话号码\",\"messageI18nCode\":\"sys.validate.telephone\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"phone\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入联系电话\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":100,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem439010\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"邮箱\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506525554,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^[a-z0-9]+([._\\\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/\",\"message\":\"请输入正确的邮箱\",\"messageI18nCode\":\"sys.validate.email\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"email\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":100,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem7fa940\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"网站\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528130,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"website\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入网站\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":200,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5b2d2b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528353,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"address\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入地址\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"autoSize\":{\"minRows\":3,\"maxRows\":3},\"clearable\":true,\"showCount\":false,\"__config__\":{\"formId\":\"formItem8cbf03\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"经营范围\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534652,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maxlength\":200,\"__vModel__\":\"business_scope\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入经营范围\"},{\"ableRelationIds\":[],\"clearable\":true,\"__config__\":{\"formId\":\"formItemf4ca17\",\"yunzhupaasKey\":\"userSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":\"\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"责任人\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_supplier\",\"renderKey\":1776918111506,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-user\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasUserSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"ableIds\":[],\"multiple\":false,\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_major_person_id\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"placeholder\":\"请选择\",\"relationField\":\"\"},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_supplier\",\"renderKey\":1776918157184,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem379bfe\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"SupplierLevel\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"供应商级别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"multiple\":false,\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_level\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"}},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_supplier\",\"renderKey\":1776918191565,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem68763d\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"SupplierType\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"供应商类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"multiple\":false,\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"}},{\"filterable\":true,\"clearable\":true,\"__config__\":{\"yunzhupaasKey\":\"cascader\",\"defaultValue\":[],\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_supplier\",\"renderKey\":1776996214391,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"tag\":\"YunzhupaasCascader\",\"formId\":\"formItem7d75c1\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"SupplierCategory\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"供应商分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"multiple\":false,\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_category\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"id\"}},{\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"clearable\":true,\"showCount\":false,\"__config__\":{\"formId\":\"formItem108619\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"荣誉、资质\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_supplier\",\"renderKey\":1776944281798,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_honor\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入备注\"},{\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"clearable\":true,\"showCount\":false,\"__config__\":{\"formId\":\"formItem237f5f\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"供应商业绩\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_supplier\",\"renderKey\":1776944313831,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_achievement\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入备注\"},{\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"clearable\":true,\"showCount\":false,\"__config__\":{\"formId\":\"formItem0c9119\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"完工项目\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_supplier\",\"renderKey\":1776944334228,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_finish_project\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入备注\"},{\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"clearable\":true,\"showCount\":false,\"__config__\":{\"formId\":\"formItem9f5e00\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534863,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"remark\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入备注\"},{\"__config__\":{\"formId\":\"formItemfe79ef\",\"yunzhupaasKey\":\"tab\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dragDisabled\":false,\"active\":\"1\",\"className\":[],\"label\":\"标签面板\",\"showLabel\":false,\"renderKey\":1774507317203,\"tableName\":\"mdm_company\",\"layout\":\"rowFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-label\",\"children\":[{\"__config__\":{\"formId\":\"formItem9787c7\",\"yunzhupaasKey\":\"tabItem\",\"children\":[{\"showSummary\":false,\"__config__\":{\"formId\":\"formItem46dc53\",\"yunzhupaasKey\":\"table\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"设计子表\",\"showLabel\":false,\"tableName\":\"mdm_company_invoice\",\"renderKey\":1774507347680,\"layout\":\"rowFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-table\",\"children\":[{\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"billRule\",\"parentVModel\":\"tableField46dc53\",\"dragDisabled\":false,\"rule\":\"InvoiceTitleCode\",\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754320599,\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"isSubTable\":true,\"ruleName\":\"发票抬头编码\",\"tag\":\"YunzhupaasInput\",\"formId\":\"formItem57f1d4\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"发票抬头编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"layout\":\"colFormItem\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"title_code\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"系统自动生成\"},{\"clearable\":true,\"maxlength\":10,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItema8b1f4\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"发票抬头名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507383593,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"title_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入联系人\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1963f0\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"纳税人识别号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507440273,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"credit_code\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入联系人职务\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"parentVModel\":\"tableField46dc53\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754396382,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemb3492f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"multiple\":false,\"__vModel__\":\"tax_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择纳税人类别\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"}},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItema9aaf2\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507448061,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"address\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入联系人邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItemf8b766\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754421983,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"phone\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入联系人邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1730ca\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户银行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754433217,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入联系人邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1089bb\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账户\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754444839,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_account\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入联系人邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"formId\":\"formItem4743e7\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否默认\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754525239,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"activeValue\":1,\"inactiveValue\":0,\"__vModel__\":\"is_defalut\",\"inactiveTxt\":\"关\",\"disabled\":false,\"activeTxt\":\"开\"},{\"__config__\":{\"formId\":\"formItema2b4cf\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否有效\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754540042,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"activeValue\":1,\"inactiveValue\":0,\"__vModel__\":\"is_valid\",\"inactiveTxt\":\"关\",\"disabled\":false,\"activeTxt\":\"开\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem560a27\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507449005,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"remark\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入备注\",\"prefixIcon\":\"\",\"addonBefore\":\"\"}],\"showTitle\":false,\"complexHeaderList\":[],\"tag\":\"YunzhupaasInputTable\",\"componentName\":\"table46dc53\",\"tableAlign\":\"left\",\"span\":24},\"defaultValue\":[],\"footerBtnsList\":[{\"btnIcon\":\"icon-ym icon-ym-btn-add\",\"show\":true,\"label\":\"添加\",\"btnType\":\"primary\",\"value\":\"add\",\"labelI18nCode\":\"common.add1Text\"},{\"btnIcon\":\"icon-ym icon-ym-btn-clearn\",\"showConfirm\":true,\"show\":true,\"label\":\"批量删除\",\"btnType\":\"danger\",\"value\":\"batchRemove\",\"labelI18nCode\":\"common.batchDelText\"}],\"defaultExpandAll\":true,\"__vModel__\":\"tableField46dc53\",\"layoutType\":\"table\",\"disabled\":false,\"columnBtnsList\":[{\"btnIcon\":\"icon-ym icon-ym-btn-edit\",\"show\":true,\"label\":\"复制\",\"btnType\":\"primary\",\"value\":\"copy\",\"labelI18nCode\":\"common.copyText\"},{\"btnIcon\":\"icon-ym icon-ym-btn-clearn\",\"showConfirm\":true,\"show\":true,\"label\":\"删除\",\"btnType\":\"danger\",\"value\":\"remove\",\"labelI18nCode\":\"common.delText\"}],\"summaryField\":[]}],\"renderKey\":1774507317203},\"name\":\"1\",\"title\":\"发票抬头\"},{\"__config__\":{\"formId\":\"formItemc68c47\",\"yunzhupaasKey\":\"tabItem\",\"children\":[{\"showSummary\":false,\"__config__\":{\"formId\":\"formItemad9d92\",\"yunzhupaasKey\":\"table\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"设计子表\",\"showLabel\":false,\"tableName\":\"mdm_company_bank\",\"renderKey\":1774507573802,\"layout\":\"rowFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-table\",\"children\":[{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem3756b9\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507591361,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入开户行\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemf42745\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"账户名\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507611465,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_account_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入账户名\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem8abffe\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507627371,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_account_number\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入银行账号\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemb870cb\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行城市\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507627772,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_province\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入开户行城市\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":200,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemf22092\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507628423,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"remark\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入备注\",\"prefixIcon\":\"\",\"addonBefore\":\"\"}],\"showTitle\":false,\"complexHeaderList\":[],\"tag\":\"YunzhupaasInputTable\",\"componentName\":\"tablead9d92\",\"tableAlign\":\"left\",\"span\":24},\"defaultValue\":[],\"footerBtnsList\":[{\"btnIcon\":\"icon-ym icon-ym-btn-add\",\"show\":true,\"label\":\"添加\",\"btnType\":\"primary\",\"value\":\"add\",\"labelI18nCode\":\"common.add1Text\"},{\"btnIcon\":\"icon-ym icon-ym-btn-clearn\",\"showConfirm\":true,\"show\":true,\"label\":\"批量删除\",\"btnType\":\"danger\",\"value\":\"batchRemove\",\"labelI18nCode\":\"common.batchDelText\"}],\"defaultExpandAll\":true,\"__vModel__\":\"tableFieldad9d92\",\"layoutType\":\"table\",\"disabled\":false,\"columnBtnsList\":[{\"btnIcon\":\"icon-ym icon-ym-btn-edit\",\"show\":true,\"label\":\"复制\",\"btnType\":\"primary\",\"value\":\"copy\",\"labelI18nCode\":\"common.copyText\"},{\"btnIcon\":\"icon-ym icon-ym-btn-clearn\",\"showConfirm\":true,\"show\":true,\"label\":\"删除\",\"btnType\":\"danger\",\"value\":\"remove\",\"labelI18nCode\":\"common.delText\"}],\"summaryField\":[]}],\"renderKey\":1774507317203},\"name\":\"2\",\"title\":\"银行卡信息\"}],\"tag\":\"ATab\",\"componentName\":\"tabfe79ef\",\"span\":24},\"tabPosition\":\"top\",\"type\":\"\"}],\"detailExtraList\":[],\"span\":24,\"dataLog\":false}"); return sb.toString(); + } + /** 列表字段配置json */ + public static final String getColumnData(){ + StringBuilder sb = new StringBuilder(); + sb.append("{\"showSummary\":false,\"treePropsValue\":\"id\",\"columnOptions\":[{\"__config__\":{\"formId\":\"formItem7a91b8\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"CustomerCompanyCode\",\"className\":[],\"label\":\"企业编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776916036468,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"客户编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":8},\"readonly\":true,\"__vModel__\":\"company_code\",\"fullName\":\"企业编码\",\"fullNameI18nCode\":[\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"company_code\",\"placeholder\":\"系统自动生成\"},{\"clearable\":true,\"maxlength\":200,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"企业名称\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem478e5c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"企业名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506482470,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"company_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"company_name\",\"placeholder\":\"请输入企业名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"简称/昵称\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem84e51c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"简称/昵称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506482631,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"short_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"short_name\",\"placeholder\":\"请输入简称/昵称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"buttonStyle\":\"solid\",\"fullName\":\"类型\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"optionType\":\"default\",\"__config__\":{\"yunzhupaasKey\":\"radio\",\"defaultValue\":\"ORG\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506487223,\"tagIcon\":\"icon-ym icon-ym-generator-radio\",\"tag\":\"YunzhupaasRadio\",\"formId\":\"formItemb3f6cd\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"size\":\"default\",\"options\":[{\"fullName\":\"企业\",\"id\":\"ORG\"},{\"fullName\":\"个人\",\"id\":\"IND\"}],\"__vModel__\":\"entity_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"entity_type\",\"direction\":\"horizontal\"},{\"clearable\":true,\"maxlength\":100,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"社会信用代码\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem10350c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"社会信用代码\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506494880,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"credit_code\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"credit_code\",\"placeholder\":\"请输入社会信用代码\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"归属组织\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"formId\":\"formItemfc6848\",\"yunzhupaasKey\":\"organizeSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"归属组织\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776912270086,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasOrganizeSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"org_id\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"org_id\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"level\":2,\"multiple\":false,\"fullName\":\"所属地区\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"formId\":\"formItemcc9deb\",\"yunzhupaasKey\":\"areaSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属地区\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507118587,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-Provinces\",\"tag\":\"YunzhupaasAreaSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"province_id\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"province_id\",\"placeholder\":\"请选择所属地区\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"纳税人类别\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503586,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem05d07f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_type\",\"placeholder\":\"请选择纳税人类别\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"企业规模\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503806,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem66e88f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"enterpriseScale\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业规模\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"enterprise_scale\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_scale\",\"placeholder\":\"请选择企业规模\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"企业类型\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506504118,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItema76b83\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"9b542177a477488994ce09fff3c93901\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"enterprise_nature\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_nature\",\"placeholder\":\"请选择企业类型\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"行业代码\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506507062,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem6bd8a7\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"d59a3cf65f9847dbb08be449e3feae16\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"行业代码\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"industry_code\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"industry_code\",\"placeholder\":\"请选择行业代码\"},{\"clearable\":true,\"format\":\"yyyy-MM-dd\",\"fullName\":\"成立日期\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506509988,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItembab00e\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"成立日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"registration_date\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"registration_date\",\"placeholder\":\"请选择成立日期\"},{\"controls\":false,\"max\":999999,\"precision\":4,\"fullName\":\"注册资本\",\"fullNameI18nCode\":[\"\"],\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"万元\",\"__config__\":{\"formId\":\"formItem3134b1\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"注册资本\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506514957,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"registered_capital\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"registered_capital\",\"placeholder\":\"请输入注册资本\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"法定代表人\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem4f2d0b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"法定代表人\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524679,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"legal_representative\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"legal_representative\",\"placeholder\":\"请输入法定代表人\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":11,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"联系电话\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem97bd9d\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"联系电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524966,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^1[3456789]\\\\d{9}$|^0\\\\d{2,3}-?\\\\d{7,8}$/\",\"message\":\"请输入正确的电话号码\",\"messageI18nCode\":\"sys.validate.telephone\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"phone\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"phone\",\"placeholder\":\"请输入联系电话\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":100,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"邮箱\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem439010\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"邮箱\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506525554,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^[a-z0-9]+([._\\\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/\",\"message\":\"请输入正确的邮箱\",\"messageI18nCode\":\"sys.validate.email\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"email\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"email\",\"placeholder\":\"请输入邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":100,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"网站\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem7fa940\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"网站\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528130,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"website\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"website\",\"placeholder\":\"请输入网站\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":200,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"地址\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5b2d2b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528353,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"address\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"address\",\"placeholder\":\"请输入地址\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":200,\"fullName\":\"经营范围\",\"fullNameI18nCode\":[\"\"],\"autoSize\":{\"minRows\":3,\"maxRows\":3},\"showCount\":false,\"__config__\":{\"formId\":\"formItem8cbf03\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"经营范围\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534652,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"business_scope\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"business_scope\",\"placeholder\":\"请输入经营范围\"},{\"ableRelationIds\":[],\"clearable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"责任人\",\"fullNameI18nCode\":[\"\"],\"relationField\":\"\",\"__config__\":{\"formId\":\"formItemf4ca17\",\"yunzhupaasKey\":\"userSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":\"\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"责任人\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_supplier\",\"renderKey\":1776918111506,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-user\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasUserSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_major_person_id\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"yunzhupaas_mdm_supplier_yunzhupaas_major_person_id\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"供应商级别\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_supplier\",\"renderKey\":1776918157184,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem379bfe\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"供应商级别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"options\":[{\"fullName\":\"选项一\",\"id\":\"1\"},{\"fullName\":\"选项二\",\"id\":\"2\"}],\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_level\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_level\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"供应商类型\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_supplier\",\"renderKey\":1776918191565,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem68763d\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"供应商类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"options\":[{\"fullName\":\"选项一\",\"id\":\"1\"},{\"fullName\":\"选项二\",\"id\":\"2\"}],\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_type\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"供应商分类\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_supplier\",\"renderKey\":1776944232887,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItembc9eef\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"供应商分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"options\":[{\"fullName\":\"选项一\",\"id\":\"1\"},{\"fullName\":\"选项二\",\"id\":\"2\"}],\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_category\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_category\",\"placeholder\":\"请选择\"},{\"clearable\":true,\"fullName\":\"荣誉、资质\",\"fullNameI18nCode\":[\"\"],\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"showCount\":false,\"__config__\":{\"formId\":\"formItem108619\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"荣誉、资质\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_supplier\",\"renderKey\":1776944281798,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_honor\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"yunzhupaas_mdm_supplier_yunzhupaas_honor\",\"placeholder\":\"请输入备注\"},{\"clearable\":true,\"fullName\":\"供应商业绩\",\"fullNameI18nCode\":[\"\"],\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"showCount\":false,\"__config__\":{\"formId\":\"formItem237f5f\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"供应商业绩\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_supplier\",\"renderKey\":1776944313831,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_achievement\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"yunzhupaas_mdm_supplier_yunzhupaas_achievement\",\"placeholder\":\"请输入备注\"},{\"clearable\":true,\"fullName\":\"完工项目\",\"fullNameI18nCode\":[\"\"],\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"showCount\":false,\"__config__\":{\"formId\":\"formItem0c9119\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"完工项目\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_supplier\",\"renderKey\":1776944334228,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_finish_project\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"yunzhupaas_mdm_supplier_yunzhupaas_finish_project\",\"placeholder\":\"请输入备注\"},{\"clearable\":true,\"fullName\":\"备注\",\"fullNameI18nCode\":[\"\"],\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"showCount\":false,\"__config__\":{\"formId\":\"formItem9f5e00\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534863,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"remark\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"remark\",\"placeholder\":\"请输入备注\"},{\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"billRule\",\"parentVModel\":\"tableField46dc53\",\"dragDisabled\":false,\"rule\":\"InvoiceTitleCode\",\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754320599,\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"isSubTable\":true,\"ruleName\":\"发票抬头编码\",\"tag\":\"YunzhupaasInput\",\"formId\":\"formItem57f1d4\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"发票抬头编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"layout\":\"colFormItem\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"title_code\",\"fullName\":\"设计子表-发票抬头编码\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField46dc53-title_code\",\"placeholder\":\"系统自动生成\"},{\"clearable\":true,\"maxlength\":10,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-发票抬头名称\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItema8b1f4\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"发票抬头名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507383593,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"title_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-title_name\",\"placeholder\":\"请输入联系人\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-纳税人识别号\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1963f0\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"纳税人识别号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507440273,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"credit_code\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-credit_code\",\"placeholder\":\"请输入联系人职务\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"设计子表-纳税人类别\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"parentVModel\":\"tableField46dc53\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754396382,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemb3492f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-tax_type\",\"placeholder\":\"请选择纳税人类别\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-地址\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItema9aaf2\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507448061,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"address\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-address\",\"placeholder\":\"请输入联系人邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-电话\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItemf8b766\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754421983,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"phone\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-phone\",\"placeholder\":\"请输入联系人邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-开户银行\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1730ca\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户银行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754433217,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-bank_name\",\"placeholder\":\"请输入联系人邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-银行账户\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1089bb\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账户\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754444839,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_account\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-bank_account\",\"placeholder\":\"请输入联系人邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"formId\":\"formItem4743e7\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否默认\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754525239,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"activeValue\":1,\"inactiveValue\":0,\"__vModel__\":\"is_defalut\",\"fullName\":\"设计子表-是否默认\",\"inactiveTxt\":\"关\",\"fullNameI18nCode\":[\"\",\"\"],\"disabled\":false,\"activeTxt\":\"开\",\"id\":\"tableField46dc53-is_defalut\"},{\"__config__\":{\"formId\":\"formItema2b4cf\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否有效\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754540042,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"activeValue\":1,\"inactiveValue\":0,\"__vModel__\":\"is_valid\",\"fullName\":\"设计子表-是否有效\",\"inactiveTxt\":\"关\",\"fullNameI18nCode\":[\"\",\"\"],\"disabled\":false,\"activeTxt\":\"开\",\"id\":\"tableField46dc53-is_valid\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-备注\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem560a27\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507449005,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"remark\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-remark\",\"placeholder\":\"请输入备注\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-开户行\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem3756b9\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507591361,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldad9d92-bank_name\",\"placeholder\":\"请输入开户行\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-账户名\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemf42745\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"账户名\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507611465,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_account_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldad9d92-bank_account_name\",\"placeholder\":\"请输入账户名\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-银行账号\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem8abffe\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507627371,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_account_number\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldad9d92-bank_account_number\",\"placeholder\":\"请输入银行账号\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-开户行城市\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemb870cb\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行城市\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507627772,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_province\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldad9d92-bank_province\",\"placeholder\":\"请输入开户行城市\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":200,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-备注\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemf22092\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507628423,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"remark\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldad9d92-remark\",\"placeholder\":\"请输入备注\",\"prefixIcon\":\"\",\"addonBefore\":\"\"}],\"pageSize\":20,\"type\":1,\"columnBtnsList\":[{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-edit\",\"label\":\"编辑\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"edit\",\"labelI18nCode\":\"common.editText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"删除\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"remove\",\"labelI18nCode\":\"common.delText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-generator-menu\",\"label\":\"详情\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"detail\",\"labelI18nCode\":\"common.detailText\"}],\"treeTitle\":\"左侧标题\",\"defaultColumnList\":[{\"yunzhupaasKey\":\"billRule\",\"resizable\":true,\"fullName\":\"企业编码\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业编码\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItem7a91b8\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"CustomerCompanyCode\",\"className\":[],\"label\":\"企业编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776916036468,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"客户编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":8},\"readonly\":true,\"prop\":\"company_code\",\"__vModel__\":\"company_code\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"company_code\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem478e5c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"企业名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506482470,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"company_name\",\"__vModel__\":\"company_name\",\"checked\":true,\"disabled\":false,\"id\":\"company_name\",\"placeholder\":\"请输入企业名称\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"企业名称\",\"label\":\"企业名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem84e51c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"简称/昵称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506482631,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"short_name\",\"__vModel__\":\"short_name\",\"checked\":true,\"disabled\":false,\"id\":\"short_name\",\"placeholder\":\"请输入简称/昵称\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"简称/昵称\",\"label\":\"简称/昵称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"radio\",\"resizable\":true,\"buttonStyle\":\"solid\",\"fullName\":\"类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"optionType\":\"default\",\"__config__\":{\"yunzhupaasKey\":\"radio\",\"defaultValue\":\"ORG\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506487223,\"tagIcon\":\"icon-ym icon-ym-generator-radio\",\"tag\":\"YunzhupaasRadio\",\"formId\":\"formItemb3f6cd\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"size\":\"default\",\"prop\":\"entity_type\",\"options\":[{\"fullName\":\"企业\",\"id\":\"ORG\"},{\"fullName\":\"个人\",\"id\":\"IND\"}],\"__vModel__\":\"entity_type\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"entity_type\",\"labelI18nCode\":\"\",\"direction\":\"horizontal\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem10350c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"社会信用代码\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506494880,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"credit_code\",\"__vModel__\":\"credit_code\",\"checked\":true,\"disabled\":false,\"id\":\"credit_code\",\"placeholder\":\"请输入社会信用代码\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":100,\"fullName\":\"社会信用代码\",\"label\":\"社会信用代码\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"organizeSelect\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"归属组织\",\"fullNameI18nCode\":[\"\"],\"label\":\"归属组织\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItemfc6848\",\"yunzhupaasKey\":\"organizeSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"归属组织\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776912270086,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasOrganizeSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"org_id\",\"__vModel__\":\"org_id\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"org_id\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"areaSelect\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"level\":2,\"multiple\":false,\"fullName\":\"所属地区\",\"fullNameI18nCode\":[\"\"],\"label\":\"所属地区\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItemcc9deb\",\"yunzhupaasKey\":\"areaSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属地区\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507118587,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-Provinces\",\"tag\":\"YunzhupaasAreaSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"province_id\",\"__vModel__\":\"province_id\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"province_id\",\"placeholder\":\"请选择所属地区\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"纳税人类别\",\"fullNameI18nCode\":[\"\"],\"label\":\"纳税人类别\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503586,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem05d07f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"tax_type\",\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_type\",\"placeholder\":\"请选择纳税人类别\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"企业规模\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业规模\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503806,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem66e88f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"enterpriseScale\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业规模\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"enterprise_scale\",\"__vModel__\":\"enterprise_scale\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_scale\",\"placeholder\":\"请选择企业规模\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"企业类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506504118,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItema76b83\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"9b542177a477488994ce09fff3c93901\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"enterprise_nature\",\"__vModel__\":\"enterprise_nature\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_nature\",\"placeholder\":\"请选择企业类型\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"行业代码\",\"fullNameI18nCode\":[\"\"],\"label\":\"行业代码\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506507062,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem6bd8a7\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"d59a3cf65f9847dbb08be449e3feae16\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"行业代码\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"industry_code\",\"__vModel__\":\"industry_code\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"industry_code\",\"placeholder\":\"请选择行业代码\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"datePicker\",\"clearable\":true,\"resizable\":true,\"format\":\"yyyy-MM-dd\",\"fullName\":\"成立日期\",\"fullNameI18nCode\":[\"\"],\"label\":\"成立日期\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506509988,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItembab00e\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"成立日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"registration_date\",\"__vModel__\":\"registration_date\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"registration_date\",\"placeholder\":\"请选择成立日期\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":4,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItem3134b1\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"注册资本\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506514957,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"registered_capital\",\"__vModel__\":\"registered_capital\",\"checked\":true,\"disabled\":false,\"id\":\"registered_capital\",\"placeholder\":\"请输入注册资本\",\"addonBefore\":\"\",\"resizable\":true,\"max\":999999,\"fullName\":\"注册资本\",\"label\":\"注册资本\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"万元\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem4f2d0b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"法定代表人\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524679,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"legal_representative\",\"__vModel__\":\"legal_representative\",\"checked\":true,\"disabled\":false,\"id\":\"legal_representative\",\"placeholder\":\"请输入法定代表人\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"法定代表人\",\"label\":\"法定代表人\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem97bd9d\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"联系电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524966,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^1[3456789]\\\\d{9}$|^0\\\\d{2,3}-?\\\\d{7,8}$/\",\"message\":\"请输入正确的电话号码\",\"messageI18nCode\":\"sys.validate.telephone\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"phone\",\"__vModel__\":\"phone\",\"checked\":true,\"disabled\":false,\"id\":\"phone\",\"placeholder\":\"请输入联系电话\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":11,\"fullName\":\"联系电话\",\"label\":\"联系电话\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem439010\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDis"); + sb.append("abled\":false,\"className\":[],\"label\":\"邮箱\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506525554,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^[a-z0-9]+([._\\\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/\",\"message\":\"请输入正确的邮箱\",\"messageI18nCode\":\"sys.validate.email\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"email\",\"__vModel__\":\"email\",\"checked\":true,\"disabled\":false,\"id\":\"email\",\"placeholder\":\"请输入邮箱\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":100,\"fullName\":\"邮箱\",\"label\":\"邮箱\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem7fa940\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"网站\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528130,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"website\",\"__vModel__\":\"website\",\"checked\":true,\"disabled\":false,\"id\":\"website\",\"placeholder\":\"请输入网站\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":100,\"fullName\":\"网站\",\"label\":\"网站\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5b2d2b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528353,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"address\",\"__vModel__\":\"address\",\"checked\":true,\"disabled\":false,\"id\":\"address\",\"placeholder\":\"请输入地址\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"地址\",\"label\":\"地址\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"经营范围\",\"fullNameI18nCode\":[\"\"],\"label\":\"经营范围\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":3,\"maxRows\":3},\"showCount\":false,\"__config__\":{\"formId\":\"formItem8cbf03\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"经营范围\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534652,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"business_scope\",\"__vModel__\":\"business_scope\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"business_scope\",\"placeholder\":\"请输入经营范围\",\"labelI18nCode\":\"\"},{\"ableRelationIds\":[],\"yunzhupaasKey\":\"userSelect\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"__config__\":{\"formId\":\"formItemf4ca17\",\"yunzhupaasKey\":\"userSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":\"\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"责任人\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_supplier\",\"renderKey\":1776918111506,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-user\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasUserSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"yunzhupaas_mdm_supplier_yunzhupaas_major_person_id\",\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_major_person_id\",\"checked\":true,\"selectType\":\"all\",\"disabled\":false,\"id\":\"yunzhupaas_mdm_supplier_yunzhupaas_major_person_id\",\"placeholder\":\"请选择\",\"clearable\":true,\"resizable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"责任人\",\"label\":\"责任人\",\"sortable\":false,\"relationField\":\"\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"供应商级别\",\"fullNameI18nCode\":[\"\"],\"label\":\"供应商级别\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_supplier\",\"renderKey\":1776918157184,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem379bfe\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"供应商级别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_level\",\"options\":[{\"fullName\":\"选项一\",\"id\":\"1\"},{\"fullName\":\"选项二\",\"id\":\"2\"}],\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_level\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_level\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"供应商类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"供应商类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_supplier\",\"renderKey\":1776918191565,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem68763d\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"供应商类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_type\",\"options\":[{\"fullName\":\"选项一\",\"id\":\"1\"},{\"fullName\":\"选项二\",\"id\":\"2\"}],\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_type\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_type\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"供应商分类\",\"fullNameI18nCode\":[\"\"],\"label\":\"供应商分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_supplier\",\"renderKey\":1776944232887,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItembc9eef\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"供应商分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_category\",\"options\":[{\"fullName\":\"选项一\",\"id\":\"1\"},{\"fullName\":\"选项二\",\"id\":\"2\"}],\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_category\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_category\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"fullName\":\"荣誉、资质\",\"fullNameI18nCode\":[\"\"],\"label\":\"荣誉、资质\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"showCount\":false,\"__config__\":{\"formId\":\"formItem108619\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"荣誉、资质\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_supplier\",\"renderKey\":1776944281798,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"yunzhupaas_mdm_supplier_yunzhupaas_honor\",\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_honor\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"yunzhupaas_mdm_supplier_yunzhupaas_honor\",\"placeholder\":\"请输入备注\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"fullName\":\"供应商业绩\",\"fullNameI18nCode\":[\"\"],\"label\":\"供应商业绩\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"showCount\":false,\"__config__\":{\"formId\":\"formItem237f5f\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"供应商业绩\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_supplier\",\"renderKey\":1776944313831,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"yunzhupaas_mdm_supplier_yunzhupaas_achievement\",\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_achievement\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"yunzhupaas_mdm_supplier_yunzhupaas_achievement\",\"placeholder\":\"请输入备注\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"fullName\":\"完工项目\",\"fullNameI18nCode\":[\"\"],\"label\":\"完工项目\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"showCount\":false,\"__config__\":{\"formId\":\"formItem0c9119\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"完工项目\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_supplier\",\"renderKey\":1776944334228,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"yunzhupaas_mdm_supplier_yunzhupaas_finish_project\",\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_finish_project\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"yunzhupaas_mdm_supplier_yunzhupaas_finish_project\",\"placeholder\":\"请输入备注\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"fullName\":\"备注\",\"fullNameI18nCode\":[\"\"],\"label\":\"备注\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"showCount\":false,\"__config__\":{\"formId\":\"formItem9f5e00\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534863,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"remark\",\"__vModel__\":\"remark\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"remark\",\"placeholder\":\"请输入备注\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"billRule\",\"resizable\":true,\"fullName\":\"设计子表-发票抬头编码\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"设计子表-发票抬头编码\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"billRule\",\"parentVModel\":\"tableField46dc53\",\"dragDisabled\":false,\"rule\":\"InvoiceTitleCode\",\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754320599,\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"isSubTable\":true,\"ruleName\":\"发票抬头编码\",\"tag\":\"YunzhupaasInput\",\"formId\":\"formItem57f1d4\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"发票抬头编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"layout\":\"colFormItem\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField46dc53-title_code\",\"__vModel__\":\"title_code\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField46dc53-title_code\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItema8b1f4\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"发票抬头名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507383593,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-title_name\",\"__vModel__\":\"title_name\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-title_name\",\"placeholder\":\"请输入联系人\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":10,\"fullName\":\"设计子表-发票抬头名称\",\"label\":\"设计子表-发票抬头名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1963f0\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"纳税人识别号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507440273,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-credit_code\",\"__vModel__\":\"credit_code\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-credit_code\",\"placeholder\":\"请输入联系人职务\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"设计子表-纳税人识别号\",\"label\":\"设计子表-纳税人识别号\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"设计子表-纳税人类别\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"设计子表-纳税人类别\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"parentVModel\":\"tableField46dc53\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754396382,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemb3492f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"tableField46dc53-tax_type\",\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-tax_type\",\"placeholder\":\"请选择纳税人类别\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItema9aaf2\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507448061,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-address\",\"__vModel__\":\"address\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-address\",\"placeholder\":\"请输入联系人邮箱\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"设计子表-地址\",\"label\":\"设计子表-地址\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItemf8b766\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754421983,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-phone\",\"__vModel__\":\"phone\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-phone\",\"placeholder\":\"请输入联系人邮箱\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"设计子表-电话\",\"label\":\"设计子表-电话\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1730ca\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户银行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754433217,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-bank_name\",\"__vModel__\":\"bank_name\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-bank_name\",\"placeholder\":\"请输入联系人邮箱\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"设计子表-开户银行\",\"label\":\"设计子表-开户银行\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1089bb\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账户\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754444839,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-bank_account\",\"__vModel__\":\"bank_account\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-bank_account\",\"placeholder\":\"请输入联系人邮箱\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"设计子表-银行账户\",\"label\":\"设计子表-银行账户\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"switch\",\"resizable\":true,\"activeValue\":1,\"inactiveValue\":0,\"fullName\":\"设计子表-是否默认\",\"inactiveTxt\":\"关\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"设计子表-是否默认\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItem4743e7\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否默认\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754525239,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"tableField46dc53-is_defalut\",\"__vModel__\":\"is_defalut\",\"checked\":false,\"fixed\":\"none\",\"disabled\":false,\"activeTxt\":\"开\",\"id\":\"tableField46dc53-is_defalut\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"switch\",\"resizable\":true,\"activeValue\":1,\"inactiveValue\":0,\"fullName\":\"设计子表-是否有效\",\"inactiveTxt\":\"关\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"设计子表-是否有效\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItema2b4cf\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否有效\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754540042,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"tableField46dc53-is_valid\",\"__vModel__\":\"is_valid\",\"checked\":false,\"fixed\":\"none\",\"disabled\":false,\"activeTxt\":\"开\",\"id\":\"tableField46dc53-is_valid\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem560a27\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507449005,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-remark\",\"__vModel__\":\"remark\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-remark\",\"placeholder\":\"请输入备注\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"设计子表-备注\",\"label\":\"设计子表-备注\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem3756b9\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507591361,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldad9d92-bank_name\",\"__vModel__\":\"bank_name\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldad9d92-bank_name\",\"placeholder\":\"请输入开户行\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"设计子表-开户行\",\"label\":\"设计子表-开户行\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemf42745\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"账户名\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507611465,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldad9d92-bank_account_name\",\"__vModel__\":\"bank_account_name\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldad9d92-bank_account_name\",\"placeholder\":\"请输入账户名\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"设计子表-账户名\",\"label\":\"设计子表-账户名\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem8abffe\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507627371,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldad9d92-bank_account_number\",\"__vModel__\":\"bank_account_number\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldad9d92-bank_account_number\",\"placeholder\":\"请输入银行账号\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"设计子表-银行账号\",\"label\":\"设计子表-银行账号\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemb870cb\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行城市\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507627772,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldad9d92-bank_province\",\"__vModel__\":\"bank_province\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldad9d92-bank_province\",\"placeholder\":\"请输入开户行城市\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"设计子表-开户行城市\",\"label\":\"设计子表-开户行城市\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemf22092\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507628423,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldad9d92-remark\",\"__vModel__\":\"remark\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldad9d92-remark\",\"placeholder\":\"请输入备注\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"设计子表-备注\",\"label\":\"设计子表-备注\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"}],\"treeRelationFieldAbleIds\":[],\"treeSyncInterfaceName\":\"\",\"treeSyncTemplateJson\":[],\"treeRelation\":\"\",\"defaultSortConfig\":[],\"tabConfig\":{\"hasAllTab\":true,\"relationField\":\"\",\"on\":false},\"hasSuperQuery\":true,\"treePropsLabel\":\"fullName\",\"groupField\":\"\",\"printIds\":[],\"uploaderTemplateJson\":{\"selectKey\":[\"company_name\",\"credit_code\",\"org_id\",\"company_code\",\"short_name\",\"entity_type\",\"tax_type\",\"enterprise_scale\",\"enterprise_nature\",\"industry_code\",\"registration_date\",\"registered_capital\",\"legal_representative\",\"phone\",\"email\",\"website\",\"address\",\"province_id\",\"business_scope\",\"remark\",\"tableFieldad9d92-bank_name\",\"tableFieldad9d92-bank_account_name\",\"tableFieldad9d92-bank_account_number\",\"tableFieldad9d92-bank_province\",\"tableFieldad9d92-remark\",\"tableField46dc53-title_name\",\"tableField46dc53-credit_code\",\"tableField46dc53-tax_type\",\"tableField46dc53-address\",\"tableField46dc53-phone\",\"tableField46dc53-bank_name\",\"tableField46dc53-bank_account\",\"tableField46dc53-is_defalut\",\"tableField46dc53-is_valid\",\"tableField46dc53-remark\",\"yunzhupaas_mdm_supplier_yunzhupaas_major_person_id\"],\"dataType\":\"2\"},\"hasTreeQuery\":false,\"useFormPermission\":true,\"complexHeaderList\":[],\"useBtnPermission\":true,\"treeSyncType\":0,\"hasPage\":true,\"searchList\":[{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"showCount\":false,\"__config__\":{\"formId\":\"formItem478e5c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"企业名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506482470,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"company_name\",\"__vModel__\":\"company_name\",\"searchMultiple\":false,\"disabled\":false,\"id\":\"company_name\",\"placeholder\":\"请输入企业名称\",\"addonBefore\":\"\",\"clearable\":true,\"searchType\":2,\"maxlength\":200,\"fullName\":\"企业名称\",\"label\":\"企业名称\",\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"isKeyword\":false,\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"organizeSelect\",\"filterable\":false,\"clearable\":true,\"searchType\":1,\"ableIds\":[],\"multiple\":false,\"fullName\":\"归属组织\",\"fullNameI18nCode\":[\"\"],\"label\":\"归属组织\",\"__config__\":{\"formId\":\"formItemfc6848\",\"yunzhupaasKey\":\"organizeSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"归属组织\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776912270086,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasOrganizeSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"org_id\",\"__vModel__\":\"org_id\",\"searchMultiple\":true,\"isKeyword\":false,\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"org_id\",\"placeholder\":\"请选择\",\"value\":[],\"labelI18nCode\":\"\"}],\"ruleList\":{\"conditionList\":[{\"groups\":[{\"ableRelationIds\":[],\"symbol\":\"notNull\",\"yunzhupaasKey\":\"userSelect\",\"clearable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"责任人\",\"fullNameI18nCode\":[\"\"],\"relationField\":\"\",\"fieldValueYunzhupaasKey\":\"\",\"__config__\":{\"formId\":\"formItemf4ca17\",\"yunzhupaasKey\":\"userSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":\"\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"责任人\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_supplier\",\"renderKey\":1776918111506,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-user\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasUserSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"field\":\"yunzhupaas_mdm_supplier_yunzhupaas_major_person_id\",\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_major_person_id\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":true,\"cellKey\":1776944411759,\"id\":\"yunzhupaas_mdm_supplier_yunzhupaas_major_person_id\",\"placeholder\":\"请选择\",\"fieldValueType\":2}],\"logic\":\"and\"}],\"matchLogic\":\"and\"},\"childTableStyle\":1,\"treePropsChildren\":\"children\",\"treeRelationFieldSelectType\":\"all\",\"showOverflow\":true,\"treeTemplateJson\":[],\"treeTitleI18nCode\":\"\",\"treePropsName\":\"\",\"useColumnPermission\":true,\"treePropsUrl\":\"\",\"btnsList\":[{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-add\",\"label\":\"新增\",\"value\":\"add\",\"labelI18nCode\":\"common.add2Text\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-download\",\"label\":\"导出\",\"value\":\"download\",\"labelI18nCode\":\"common.exportText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-upload\",\"label\":\"导入\",\"value\":\"upload\",\"labelI18nCode\":\"common.importText\"},{\"show\":false,\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"批量删除\",\"value\":\"batchRemove\",\"labelI18nCode\":\"common.batchDelText\"},{\"show\":false,\"icon\":\"icon-ym icon-ym-report-icon-preview-printPreview\",\"label\":\"批量打印\",\"value\":\"batchPrint\",\"labelI18nCode\":\"common.batchPrintText\"}],\"useDataPermission\":true,\"viewKey\":\"\",\"columnList\":[{\"yunzhupaasKey\":\"billRule\",\"resizable\":true,\"fullName\":\"企业编码\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业编码\",\"sortable\":true,\"align\":\"left\",\"__config__\":{\"formId\":\"formItem7a91b8\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"CustomerCompanyCode\",\"className\":[],\"label\":\"企业编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776916036468,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"客户编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":8},\"readonly\":true,\"prop\":\"company_code\",\"__vModel__\":\"company_code\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"company_code\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem478e5c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"企业名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506482470,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"company_name\",\"__vModel__\":\"company_name\",\"disabled\":false,\"id\":\"company_name\",\"placeholder\":\"请输入企业名称\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"企业名称\",\"label\":\"企业名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem84e51c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"简称/昵称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506482631,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"short_name\",\"__vModel__\":\"short_name\",\"disabled\":false,\"id\":\"short_name\",\"placeholder\":\"请输入简称/昵称\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"简称/昵称\",\"label\":\"简称/昵称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"organizeSelect\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"归属组织\",\"fullNameI18nCode\":[\"\"],\"label\":\"归属组织\",\"sortable\":true,\"align\":\"left\",\"__config__\":{\"formId\":\"formItemfc6848\",\"yunzhupaasKey\":\"organizeSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"归属组织\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776912270086,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasOrganizeSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"org_id\",\"__vModel__\":\"org_id\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"org_id\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"radio\",\"resizable\":true,\"buttonStyle\":\"solid\",\"fullName\":\"类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"optionType\":\"default\",\"__config__\":{\"yunzhupaasKey\":\"radio\",\"defaultValue\":\"ORG\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506487223,\"tagIcon\":\"icon-ym icon-ym-generator-radio\",\"tag\":\"YunzhupaasRadio\",\"formId\":\"formItemb3f6cd\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"size\":\"default\",\"prop\":\"entity_type\",\"options\":[{\"fullName\":\"企业\",\"id\":\"ORG\"},{\"fullName\":\"个人\",\"id\":\"IND\"}],\"__vModel__\":\"entity_type\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"entity_type\",\"labelI18nCode\":\"\",\"direction\":\"horizontal\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem10350c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"社会信用代码\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506494880,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"credit_code\",\"__vModel__\":\"credit_code\",\"disabled\":false,\"id\":\"credit_code\",\"placeholder\":\"请输入社会信用代码\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":100,\"fullName\":\"社会信用代码\",\"label\":\"社会信用代码\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"纳税人类别\",\"fullNameI18nCode\":[\"\"],\"label\":\"纳税人类别\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503586,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem05d07f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"tax_type\",\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_type\",\"placeholder\":\"请选择纳税人类别\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"供应商级别\",\"fullNameI18nCode\":[\"\"],\"label\":\"供应商级别\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_supplier\",\"renderKey\":1776918157184,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem379bfe\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"供应商级别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_level\",\"options\":[{\"fullName\":\"选项一\",\"id\":\"1\"},{\"fullName\":\"选项二\",\"id\":\"2\"}],\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_level\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_level\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"供应商类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"供应商类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_supplier\",\"renderKey\":1776918191565,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem68763d\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"供应商类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_type\",\"options\":[{\"fullName\":\"选项一\",\"id\":\"1\"},{\"fullName\":\"选项二\",\"id\":\"2\"}],\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_type\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_type\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"供应商分类\",\"fullNameI18nCode\":[\"\"],\"label\":\"供应商分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_supplier\",\"renderKey\":1776944232887,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItembc9eef\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"供应商分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_category\",\"options\":[{\"fullName\":\"选项一\",\"id\":\"1\"},{\"fullName\":\"选项二\",\"id\":\"2\"}],\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_category\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_category\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem4f2d0b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"法定代表人\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524679,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"legal_representative\",\"__vModel__\":\"legal_representative\",\"disabled\":false,\"id\":\"legal_representative\",\"placeholder\":\"请输入法定代表人\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"法定代表人\",\"label\":\"法定代表人\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"企业规模\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业规模\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503806,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem66e88f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"enterpriseScale\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业规模\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"enterprise_scale\",\"__vModel__\":\"enterprise_scale\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_scale\",\"placeholder\":\"请选择企业规模\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"企业类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506504118,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItema76b83\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"9b542177a477488994ce09fff3c93901\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"enterprise_nature\",\"__vModel__\":\"enterprise_nature\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_nature\",\"placeholder\":\"请选择企业类型\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"行业代码\",\"fullNameI18nCode\":[\"\"],\"label\":\"行业代码\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506507062,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem6bd8a7\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"d59a3cf65f9847dbb08be449e3feae16\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"行业代码\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"industry_code\",\"__vModel__\":\"industry_code\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"industry_code\",\"placeholder\":\"请选择行业代码\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"datePicker\",\"clearable\":true,\"resizable\":true,\"format\":\"yyyy-MM-dd\",\"fullName\":\"成立日期\",\"fullNameI18nCode\":[\"\"],\"label\":\"成立日期\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506509988,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItembab00e\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"成立日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"registration_date\",\"__vModel__\":\"registration_date\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"registration_date\",\"placeholder\":\"请选择成立日期\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":4,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItem3134b1\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"注册资本\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506514957,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"registered_capital\",\"__vModel__\":\"registered_capital\",\"disabled\":false,\"id\":\"registered_capital\",\"placeholder\":\"请输入注册资本\",\"addonBefore\":\"\",\"resizable\":true,\"max\":999999,\"fullName\":\"注册资本\",\"label\":\"注册资本\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"万元\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem97bd9d\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"联系电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524966,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^1[3456789]\\\\d{9}$|^0\\\\d{2,3}-?\\\\d{7,8}$/\",\"message\":\"请输入正确的电话号码\",\"messageI18nCode\":\"sys.validate.telephone\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"phone\",\"__vModel__\":\"phone\",\"disabled\":false,\"id\":\"phone\",\"placeholder\":\"请输入联系电话\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":11,\"fullName\":\"联系电话\",\"label\":\"联系电话\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem439010\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"邮箱\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506525554,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^[a-z0-9]+([._\\\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/\",\"message\":\"请输入正确的邮箱\",\"messageI18nCode\":\"sys.validate.email\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"email\",\"__vModel__\":\"email\",\"disabled\":false,\"id\":\"email\",\"placeholder\":\"请输入邮箱\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":100,\"fullName\":\"邮箱\",\"label\":\"邮箱\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem7fa940\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"网站\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528130,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\""); + sb.append("regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"website\",\"__vModel__\":\"website\",\"disabled\":false,\"id\":\"website\",\"placeholder\":\"请输入网站\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":100,\"fullName\":\"网站\",\"label\":\"网站\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5b2d2b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528353,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"address\",\"__vModel__\":\"address\",\"disabled\":false,\"id\":\"address\",\"placeholder\":\"请输入地址\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"地址\",\"label\":\"地址\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"areaSelect\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"level\":2,\"multiple\":false,\"fullName\":\"所属地区\",\"fullNameI18nCode\":[\"\"],\"label\":\"所属地区\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItemcc9deb\",\"yunzhupaasKey\":\"areaSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属地区\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507118587,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-Provinces\",\"tag\":\"YunzhupaasAreaSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"province_id\",\"__vModel__\":\"province_id\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"province_id\",\"placeholder\":\"请选择所属地区\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"经营范围\",\"fullNameI18nCode\":[\"\"],\"label\":\"经营范围\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":3,\"maxRows\":3},\"showCount\":false,\"__config__\":{\"formId\":\"formItem8cbf03\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"经营范围\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534652,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"business_scope\",\"__vModel__\":\"business_scope\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"business_scope\",\"placeholder\":\"请输入经营范围\",\"labelI18nCode\":\"\"},{\"ableRelationIds\":[],\"yunzhupaasKey\":\"userSelect\",\"clearable\":true,\"resizable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"责任人\",\"fullNameI18nCode\":[\"\"],\"label\":\"责任人\",\"sortable\":false,\"align\":\"left\",\"relationField\":\"\",\"__config__\":{\"formId\":\"formItemf4ca17\",\"yunzhupaasKey\":\"userSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":\"\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"责任人\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_supplier\",\"renderKey\":1776918111506,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-user\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasUserSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"yunzhupaas_mdm_supplier_yunzhupaas_major_person_id\",\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_major_person_id\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"yunzhupaas_mdm_supplier_yunzhupaas_major_person_id\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"fullName\":\"备注\",\"fullNameI18nCode\":[\"\"],\"label\":\"备注\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"showCount\":false,\"__config__\":{\"formId\":\"formItem9f5e00\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534863,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"remark\",\"__vModel__\":\"remark\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"remark\",\"placeholder\":\"请输入备注\",\"labelI18nCode\":\"\"}],\"summaryField\":[],\"parentField\":\"\",\"treeDataSource\":\"dictionary\",\"treeDictionary\":\"\",\"treeSyncInterfaceId\":\"\",\"customBtnsList\":[]}"); + return sb.toString(); + } + /** app列表字段配置json */ + public static final String getAppColumnData(){ + StringBuilder sb = new StringBuilder(); + sb.append("{\"hasPage\":true,\"useColumnPermission\":false,\"searchList\":[],\"btnsList\":[{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-add\",\"label\":\"新增\",\"value\":\"add\",\"labelI18nCode\":\"common.add2Text\"},{\"show\":false,\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"批量删除\",\"value\":\"batchRemove\",\"labelI18nCode\":\"common.batchDelText\"}],\"useDataPermission\":false,\"viewKey\":\"\",\"ruleListApp\":{\"conditionList\":[],\"matchLogic\":\"and\"},\"columnList\":[{\"yunzhupaasKey\":\"billRule\",\"resizable\":true,\"fullName\":\"企业编码\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业编码\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItem7a91b8\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"CustomerCompanyCode\",\"className\":[],\"label\":\"企业编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776916036468,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"客户编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":8},\"readonly\":true,\"prop\":\"company_code\",\"__vModel__\":\"company_code\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"company_code\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem478e5c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"企业名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506482470,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"company_name\",\"__vModel__\":\"company_name\",\"disabled\":false,\"id\":\"company_name\",\"placeholder\":\"请输入企业名称\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"企业名称\",\"label\":\"企业名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem84e51c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"简称/昵称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506482631,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"short_name\",\"__vModel__\":\"short_name\",\"disabled\":false,\"id\":\"short_name\",\"placeholder\":\"请输入简称/昵称\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"简称/昵称\",\"label\":\"简称/昵称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"radio\",\"resizable\":true,\"buttonStyle\":\"solid\",\"fullName\":\"类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"optionType\":\"default\",\"__config__\":{\"yunzhupaasKey\":\"radio\",\"defaultValue\":\"ORG\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506487223,\"tagIcon\":\"icon-ym icon-ym-generator-radio\",\"tag\":\"YunzhupaasRadio\",\"formId\":\"formItemb3f6cd\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"size\":\"default\",\"prop\":\"entity_type\",\"options\":[{\"fullName\":\"企业\",\"id\":\"ORG\"},{\"fullName\":\"个人\",\"id\":\"IND\"}],\"__vModel__\":\"entity_type\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"entity_type\",\"labelI18nCode\":\"\",\"direction\":\"horizontal\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem10350c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"社会信用代码\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506494880,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"credit_code\",\"__vModel__\":\"credit_code\",\"disabled\":false,\"id\":\"credit_code\",\"placeholder\":\"请输入社会信用代码\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":100,\"fullName\":\"社会信用代码\",\"label\":\"社会信用代码\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"纳税人类别\",\"fullNameI18nCode\":[\"\"],\"label\":\"纳税人类别\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503586,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem05d07f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"tax_type\",\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_type\",\"placeholder\":\"请选择纳税人类别\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"企业规模\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业规模\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503806,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem66e88f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"enterpriseScale\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业规模\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"enterprise_scale\",\"__vModel__\":\"enterprise_scale\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_scale\",\"placeholder\":\"请选择企业规模\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"企业类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506504118,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItema76b83\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"9b542177a477488994ce09fff3c93901\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"enterprise_nature\",\"__vModel__\":\"enterprise_nature\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_nature\",\"placeholder\":\"请选择企业类型\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"行业代码\",\"fullNameI18nCode\":[\"\"],\"label\":\"行业代码\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506507062,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem6bd8a7\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"d59a3cf65f9847dbb08be449e3feae16\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"行业代码\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"industry_code\",\"__vModel__\":\"industry_code\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"industry_code\",\"placeholder\":\"请选择行业代码\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"datePicker\",\"clearable\":true,\"resizable\":true,\"format\":\"yyyy-MM-dd\",\"fullName\":\"成立日期\",\"fullNameI18nCode\":[\"\"],\"label\":\"成立日期\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506509988,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItembab00e\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"成立日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"registration_date\",\"__vModel__\":\"registration_date\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"registration_date\",\"placeholder\":\"请选择成立日期\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":4,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItem3134b1\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"注册资本\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506514957,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"registered_capital\",\"__vModel__\":\"registered_capital\",\"disabled\":false,\"id\":\"registered_capital\",\"placeholder\":\"请输入注册资本\",\"addonBefore\":\"\",\"resizable\":true,\"max\":999999,\"fullName\":\"注册资本\",\"label\":\"注册资本\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"万元\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem4f2d0b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"法定代表人\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524679,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"legal_representative\",\"__vModel__\":\"legal_representative\",\"disabled\":false,\"id\":\"legal_representative\",\"placeholder\":\"请输入法定代表人\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"法定代表人\",\"label\":\"法定代表人\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem97bd9d\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"联系电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524966,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^1[3456789]\\\\d{9}$|^0\\\\d{2,3}-?\\\\d{7,8}$/\",\"message\":\"请输入正确的电话号码\",\"messageI18nCode\":\"sys.validate.telephone\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"phone\",\"__vModel__\":\"phone\",\"disabled\":false,\"id\":\"phone\",\"placeholder\":\"请输入联系电话\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":11,\"fullName\":\"联系电话\",\"label\":\"联系电话\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem439010\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"邮箱\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506525554,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^[a-z0-9]+([._\\\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/\",\"message\":\"请输入正确的邮箱\",\"messageI18nCode\":\"sys.validate.email\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"email\",\"__vModel__\":\"email\",\"disabled\":false,\"id\":\"email\",\"placeholder\":\"请输入邮箱\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":100,\"fullName\":\"邮箱\",\"label\":\"邮箱\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem7fa940\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"网站\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528130,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"website\",\"__vModel__\":\"website\",\"disabled\":false,\"id\":\"website\",\"placeholder\":\"请输入网站\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":100,\"fullName\":\"网站\",\"label\":\"网站\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5b2d2b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528353,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"address\",\"__vModel__\":\"address\",\"disabled\":false,\"id\":\"address\",\"placeholder\":\"请输入地址\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"地址\",\"label\":\"地址\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"areaSelect\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"level\":2,\"multiple\":false,\"fullName\":\"所属地区\",\"fullNameI18nCode\":[\"\"],\"label\":\"所属地区\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItemcc9deb\",\"yunzhupaasKey\":\"areaSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属地区\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507118587,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-Provinces\",\"tag\":\"YunzhupaasAreaSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"province_id\",\"__vModel__\":\"province_id\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"province_id\",\"placeholder\":\"请选择所属地区\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"经营范围\",\"fullNameI18nCode\":[\"\"],\"label\":\"经营范围\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":3,\"maxRows\":3},\"showCount\":false,\"__config__\":{\"formId\":\"formItem8cbf03\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"经营范围\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534652,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"business_scope\",\"__vModel__\":\"business_scope\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"business_scope\",\"placeholder\":\"请输入经营范围\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"fullName\":\"备注\",\"fullNameI18nCode\":[\"\"],\"label\":\"备注\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"showCount\":false,\"__config__\":{\"formId\":\"formItem9f5e00\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534863,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"remark\",\"__vModel__\":\"remark\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"remark\",\"placeholder\":\"请输入备注\",\"labelI18nCode\":\"\"}],\"columnOptions\":[{\"__config__\":{\"formId\":\"formItem7a91b8\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"CustomerCompanyCode\",\"className\":[],\"label\":\"企业编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776916036468,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"客户编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":8},\"readonly\":true,\"__vModel__\":\"company_code\",\"fullName\":\"企业编码\",\"fullNameI18nCode\":[\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"company_code\",\"placeholder\":\"系统自动生成\"},{\"clearable\":true,\"maxlength\":200,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"企业名称\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem478e5c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"企业名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506482470,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"company_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"company_name\",\"placeholder\":\"请输入企业名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"简称/昵称\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem84e51c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"简称/昵称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506482631,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"short_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"short_name\",\"placeholder\":\"请输入简称/昵称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"buttonStyle\":\"solid\",\"fullName\":\"类型\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"optionType\":\"default\",\"__config__\":{\"yunzhupaasKey\":\"radio\",\"defaultValue\":\"ORG\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506487223,\"tagIcon\":\"icon-ym icon-ym-generator-radio\",\"tag\":\"YunzhupaasRadio\",\"formId\":\"formItemb3f6cd\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"size\":\"default\",\"options\":[{\"fullName\":\"企业\",\"id\":\"ORG\"},{\"fullName\":\"个人\",\"id\":\"IND\"}],\"__vModel__\":\"entity_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"entity_type\",\"direction\":\"horizontal\"},{\"clearable\":true,\"maxlength\":100,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"社会信用代码\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem10350c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"社会信用代码\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506494880,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"credit_code\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"credit_code\",\"placeholder\":\"请输入社会信用代码\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"归属组织\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"formId\":\"formItemfc6848\",\"yunzhupaasKey\":\"organizeSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"归属组织\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776912270086,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasOrganizeSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"org_id\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"org_id\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"level\":2,\"multiple\":false,\"fullName\":\"所属地区\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"formId\":\"formItemcc9deb\",\"yunzhupaasKey\":\"areaSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属地区\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507118587,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-Provinces\",\"tag\":\"YunzhupaasAreaSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"province_id\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"province_id\",\"placeholder\":\"请选择所属地区\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"纳税人类别\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503586,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem05d07f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_type\",\"placeholder\":\"请选择纳税人类别\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"企业规模\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503806,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem66e88f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"enterpriseScale\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业规模\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"enterprise_scale\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_scale\",\"placeholder\":\"请选择企业规模\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"企业类型\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506504118,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItema76b83\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"9b542177a477488994ce09fff3c93901\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"enterprise_nature\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_nature\",\"placeholder\":\"请选择企业类型\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"行业代码\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506507062,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem6bd8a7\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"d59a3cf65f9847dbb08be449e3feae16\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"行业代码\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"industry_code\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"industry_code\",\"placeholder\":\"请选择行业代码\"},{\"clearable\":true,\"format\":\"yyyy-MM-dd\",\"fullName\":\"成立日期\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506509988,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItembab00e\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"成立日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"registration_date\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"registration_date\",\"placeholder\":\"请选择成立日期\"},{\"controls\":false,\"max\":999999,\"precision\":4,\"fullName\":\"注册资本\",\"fullNameI18nCode\":[\"\"],\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"万元\",\"__config__\":{\"formId\":\"formItem3134b1\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"注册资本\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506514957,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"registered_capital\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"registered_capital\",\"placeholder\":\"请输入注册资本\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"法定代表人\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem4f2d0b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"法定代表人\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524679,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"legal_representative\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"legal_representative\",\"placeholder\":\"请输入法定代表人\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":11,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"联系电话\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem97bd9d\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"联系电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524966,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^1[3456789]\\\\d{9}$|^0\\\\d{2,3}-?\\\\d{7,8}$/\",\"message\":\"请输入正确的电话号码\",\"messageI18nCode\":\"sys.validate.telephone\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"phone\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"phone\",\"placeholder\":\"请输入联系电话\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":100,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"邮箱\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem439010\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"邮箱\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506525554,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^[a-z0-9]+([._\\\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/\",\"message\":\"请输入正确的邮箱\",\"messageI18nCode\":\"sys.validate.email\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"email\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"email\",\"placeholder\":\"请输入邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":100,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"网站\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem7fa940\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"网站\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528130,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"website\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"website\",\"placeholder\":\"请输入网站\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":200,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"地址\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5b2d2b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528353,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"address\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"address\",\"placeholder\":\"请输入地址\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":200,\"fullName\":\"经营范围\",\"fullNameI18nCode\":[\"\"],\"autoSize\":{\"minRows\":3,\"maxRows\":3},\"showCount\":false,\"__config__\":{\"formId\":\"formItem8cbf03\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"经营范围\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534652,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"business_scope\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"business_scope\",\"placeholder\":\"请输入经营范围\"},{\"ableRelationIds\":[],\"clearable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"责任人\",\"fullNameI18nCode\":[\"\"],\"relationField\":\"\",\"__config__\":{\"formId\":\"formItemf4ca17\",\"yunzhupaasKey\":\"userSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":\"\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"责任人\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_supplier\",\"renderKey\":1776918111506,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-user\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasUserSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_major_person_id\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"yunzhupaas_mdm_supplier_yunzhupaas_major_person_id\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"供应商级别\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_supplier\",\"renderKey\":1776918157184,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem379bfe\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"供应商级别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"options\":[{\"fullName\":\"选项一\",\"id\":\"1\"},{\"fullName\":\"选项二\",\"id\":\"2\"}],\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_level\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_level\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"供应商类型\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_supplier\",\"renderKey\":1776918191565,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem68763d\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"供应商类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"options\":[{\"fullName\":\"选项一\",\"id\":\"1\"},{\"fullName\":\"选项二\",\"id\":\"2\"}],\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_type\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"供应商分类\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_supplier\",\"renderKey\":1776944232887,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItembc9eef\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"供应商分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"options\":[{\"fullName\":\"选项一\",\"id\":\"1\"},{\"fullName\":\"选项二\",\"id\":\"2\"}],\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_category\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_category\",\"placeholder\":\"请选择\"},{\"clearable\":true,\"fullName\":\"荣誉、资质\",\"fullNameI18nCode\":[\"\"],\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"showCount\":false,\"__config__\":{\"formId\":\"formItem108619\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"荣誉、资质\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_supplier\",\"renderKey\":1776944281798,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_honor\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"yunzhupaas_mdm_supplier_yunzhupaas_honor\",\"placeholder\":\"请输入备注\"},{\"clearable\":true,\"fullName\":\"供应商业绩\",\"fullNameI18nCode\":[\"\"],\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"showCount\":false,\"__config__\":{\"formId\":\"formItem237f5f\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"供应商业绩\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_supplier\",\"renderKey\":1776944313831,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_achievement\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"yunzhupaas_mdm_supplier_yunzhupaas_achievement\",\"placeholder\":\"请输入备注\"},{\"clearable\":true,\"fullName\":\"完工项目\",\"fullNameI18nCode\":[\"\"],\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"showCount\":false,\"__config__\":{\"formId\":\"formItem0c9119\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"完工项目\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_supplier\",\"renderKey\":1776944334228,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_finish_project\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"yunzhupaas_mdm_supplier_yunzhupaas_finish_project\",\"placeholder\":\"请输入备注\"},{\"clearable\":true,\"fullName\":\"备注\",\"fullNameI18nCode\":[\"\"],\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"showCount\":false,\"__config__\":{\"formId\":\"formItem9f5e00\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534863,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"__vModel__\":\"remark\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"remark\",\"placeholder\":\"请输入备注\"},{\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"billRule\",\"parentVModel\":\"tableField46dc53\",\"dragDisabled\":false,\"rule\":\"InvoiceTitleCode\",\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754320599,\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"isSubTable\":true,\"ruleName\":\"发票抬头编码\",\"tag\":\"YunzhupaasInput\",\"formId\":\"formItem57f1d4\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"发票抬头编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"layout\":\"colFormItem\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"title_code\",\"fullName\":\"设计子表-发票抬头编码\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField46dc53-title_code\",\"placeholder\":\"系统自动生成\"},{\"clearable\":true,\"maxlength\":10,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-发票抬头名称\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItema8b1f4\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"发票抬头名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507383593,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"title_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-title_name\",\"placeholder\":\"请输入联系人\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-纳税人识别号\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1963f0\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"纳税人识别号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507440273,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"credit_code\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-credit_code\",\"placeholder\":\"请输入联系人职务\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"设计子表-纳税人类别\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"parentVModel\":\"tableField46dc53\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754396382,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemb3492f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-tax_type\",\"placeholder\":\"请选择纳税人类别\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-地址\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItema9aaf2\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507448061,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"address\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-address\",\"placeholder\":\"请输入联系人邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-电话\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItemf8b766\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754421983,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"phone\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-phone\",\"placeholder\":\"请输入联系人邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-开户银行\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1730ca\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户银行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754433217,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-bank_name\",\"placeholder\":\"请输入联系人邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-银行账户\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1089bb\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账户\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754444839,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_account\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-bank_account\",\"placeholder\":\"请输入联系人邮箱\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"formId\":\"formItem4743e7\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否默认\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754525239,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"activeValue\":1,\"inactiveValue\":0,\"__vModel__\":\"is_defalut\",\"fullName\":\"设计子表-是否默认\",\"inactiveTxt\":\"关\",\"fullNameI18nCode\":[\"\",\"\"],\"disabled\":false,\"activeTxt\":\"开\",\"id\":\"tableField46dc53-is_defalut\"},{\"__config__\":{\"formId\":\"formItema2b4cf\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否有效\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754540042,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"activeValue\":1,\"inactiveValue\":0,\"__vModel__\":\"is_valid\",\"fullName\":\"设计子表-是否有效\",\"inactiveTxt\":\"关\",\"fullNameI18nCode\":[\"\",\"\"],\"disabled\":false,\"activeTxt\":\"开\",\"id\":\"tableField46dc53-is_valid\"},{\"clearable\":true,\"maxlength\":50,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-备注\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem560a27\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507449005,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"remark\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-remark\",\"placeholder\":\"请输入备注\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-开户行\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem3756b9\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507591361,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldad9d92-bank_name\",\"placeholder\":\"请输入开户行\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-账户名\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemf42745\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"账户名\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507611465,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\""); + sb.append(":\"bank_account_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldad9d92-bank_account_name\",\"placeholder\":\"请输入账户名\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-银行账号\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem8abffe\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507627371,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_account_number\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldad9d92-bank_account_number\",\"placeholder\":\"请输入银行账号\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":20,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-开户行城市\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemb870cb\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行城市\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507627772,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"bank_province\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldad9d92-bank_province\",\"placeholder\":\"请输入开户行城市\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"maxlength\":200,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"设计子表-备注\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemf22092\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507628423,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"remark\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableFieldad9d92-remark\",\"placeholder\":\"请输入备注\",\"prefixIcon\":\"\",\"addonBefore\":\"\"}],\"pageSize\":20,\"defaultSortConfig\":[],\"type\":1,\"columnBtnsList\":[{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-edit\",\"label\":\"编辑\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"edit\",\"labelI18nCode\":\"common.editText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"删除\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"remove\",\"labelI18nCode\":\"common.delText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-generator-menu\",\"label\":\"详情\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"detail\",\"labelI18nCode\":\"common.detailText\"}],\"tabConfig\":{\"hasAllTab\":true,\"relationField\":\"\",\"on\":false},\"hasSuperQuery\":false,\"defaultColumnList\":[{\"yunzhupaasKey\":\"billRule\",\"resizable\":true,\"fullName\":\"企业编码\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业编码\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItem7a91b8\",\"yunzhupaasKey\":\"billRule\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"rule\":\"CustomerCompanyCode\",\"className\":[],\"label\":\"企业编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776916036468,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"ruleName\":\"客户编码\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":8},\"readonly\":true,\"prop\":\"company_code\",\"__vModel__\":\"company_code\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"company_code\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem478e5c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"企业名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506482470,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"company_name\",\"__vModel__\":\"company_name\",\"checked\":true,\"disabled\":false,\"id\":\"company_name\",\"placeholder\":\"请输入企业名称\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"企业名称\",\"label\":\"企业名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem84e51c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"简称/昵称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506482631,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"short_name\",\"__vModel__\":\"short_name\",\"checked\":true,\"disabled\":false,\"id\":\"short_name\",\"placeholder\":\"请输入简称/昵称\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"简称/昵称\",\"label\":\"简称/昵称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"radio\",\"resizable\":true,\"buttonStyle\":\"solid\",\"fullName\":\"类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"optionType\":\"default\",\"__config__\":{\"yunzhupaasKey\":\"radio\",\"defaultValue\":\"ORG\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506487223,\"tagIcon\":\"icon-ym icon-ym-generator-radio\",\"tag\":\"YunzhupaasRadio\",\"formId\":\"formItemb3f6cd\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"size\":\"default\",\"prop\":\"entity_type\",\"options\":[{\"fullName\":\"企业\",\"id\":\"ORG\"},{\"fullName\":\"个人\",\"id\":\"IND\"}],\"__vModel__\":\"entity_type\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"entity_type\",\"labelI18nCode\":\"\",\"direction\":\"horizontal\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem10350c\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"社会信用代码\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1774506494880,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"credit_code\",\"__vModel__\":\"credit_code\",\"checked\":true,\"disabled\":false,\"id\":\"credit_code\",\"placeholder\":\"请输入社会信用代码\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":100,\"fullName\":\"社会信用代码\",\"label\":\"社会信用代码\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"organizeSelect\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"归属组织\",\"fullNameI18nCode\":[\"\"],\"label\":\"归属组织\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItemfc6848\",\"yunzhupaasKey\":\"organizeSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"归属组织\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_company\",\"renderKey\":1776912270086,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasOrganizeSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"org_id\",\"__vModel__\":\"org_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"org_id\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"areaSelect\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"level\":2,\"multiple\":false,\"fullName\":\"所属地区\",\"fullNameI18nCode\":[\"\"],\"label\":\"所属地区\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItemcc9deb\",\"yunzhupaasKey\":\"areaSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属地区\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507118587,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-Provinces\",\"tag\":\"YunzhupaasAreaSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"province_id\",\"__vModel__\":\"province_id\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"province_id\",\"placeholder\":\"请选择所属地区\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"纳税人类别\",\"fullNameI18nCode\":[\"\"],\"label\":\"纳税人类别\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503586,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem05d07f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"tax_type\",\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tax_type\",\"placeholder\":\"请选择纳税人类别\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"企业规模\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业规模\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506503806,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem66e88f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"enterpriseScale\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业规模\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"enterprise_scale\",\"__vModel__\":\"enterprise_scale\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_scale\",\"placeholder\":\"请选择企业规模\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"企业类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"企业类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506504118,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItema76b83\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"9b542177a477488994ce09fff3c93901\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"企业类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"enterprise_nature\",\"__vModel__\":\"enterprise_nature\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"enterprise_nature\",\"placeholder\":\"请选择企业类型\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"行业代码\",\"fullNameI18nCode\":[\"\"],\"label\":\"行业代码\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506507062,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem6bd8a7\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"d59a3cf65f9847dbb08be449e3feae16\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"行业代码\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"industry_code\",\"__vModel__\":\"industry_code\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"industry_code\",\"placeholder\":\"请选择行业代码\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"datePicker\",\"clearable\":true,\"resizable\":true,\"format\":\"yyyy-MM-dd\",\"fullName\":\"成立日期\",\"fullNameI18nCode\":[\"\"],\"label\":\"成立日期\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"yunzhupaasKey\":\"datePicker\",\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506509988,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":\"formItembab00e\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"成立日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"registration_date\",\"__vModel__\":\"registration_date\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"registration_date\",\"placeholder\":\"请选择成立日期\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"inputNumber\",\"controls\":false,\"precision\":4,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":\"formItem3134b1\",\"yunzhupaasKey\":\"inputNumber\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"注册资本\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506514957,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"registered_capital\",\"__vModel__\":\"registered_capital\",\"checked\":true,\"disabled\":false,\"id\":\"registered_capital\",\"placeholder\":\"请输入注册资本\",\"addonBefore\":\"\",\"resizable\":true,\"max\":999999,\"fullName\":\"注册资本\",\"label\":\"注册资本\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"万元\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem4f2d0b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"法定代表人\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524679,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"legal_representative\",\"__vModel__\":\"legal_representative\",\"checked\":true,\"disabled\":false,\"id\":\"legal_representative\",\"placeholder\":\"请输入法定代表人\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"法定代表人\",\"label\":\"法定代表人\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem97bd9d\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"联系电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506524966,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^1[3456789]\\\\d{9}$|^0\\\\d{2,3}-?\\\\d{7,8}$/\",\"message\":\"请输入正确的电话号码\",\"messageI18nCode\":\"sys.validate.telephone\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"phone\",\"__vModel__\":\"phone\",\"checked\":true,\"disabled\":false,\"id\":\"phone\",\"placeholder\":\"请输入联系电话\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":11,\"fullName\":\"联系电话\",\"label\":\"联系电话\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem439010\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"邮箱\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506525554,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[{\"pattern\":\"/^[a-z0-9]+([._\\\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/\",\"message\":\"请输入正确的邮箱\",\"messageI18nCode\":\"sys.validate.email\"}],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"email\",\"__vModel__\":\"email\",\"checked\":true,\"disabled\":false,\"id\":\"email\",\"placeholder\":\"请输入邮箱\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":100,\"fullName\":\"邮箱\",\"label\":\"邮箱\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem7fa940\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"网站\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528130,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"website\",\"__vModel__\":\"website\",\"checked\":true,\"disabled\":false,\"id\":\"website\",\"placeholder\":\"请输入网站\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":100,\"fullName\":\"网站\",\"label\":\"网站\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":\"formItem5b2d2b\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506528353,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"readonly\":false,\"prop\":\"address\",\"__vModel__\":\"address\",\"checked\":true,\"disabled\":false,\"id\":\"address\",\"placeholder\":\"请输入地址\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"地址\",\"label\":\"地址\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"经营范围\",\"fullNameI18nCode\":[\"\"],\"label\":\"经营范围\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":3,\"maxRows\":3},\"showCount\":false,\"__config__\":{\"formId\":\"formItem8cbf03\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"经营范围\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534652,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"business_scope\",\"__vModel__\":\"business_scope\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"business_scope\",\"placeholder\":\"请输入经营范围\",\"labelI18nCode\":\"\"},{\"ableRelationIds\":[],\"yunzhupaasKey\":\"userSelect\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"__config__\":{\"formId\":\"formItemf4ca17\",\"yunzhupaasKey\":\"userSelect\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":\"\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"责任人\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"mdm_supplier\",\"renderKey\":1776918111506,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-user\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasUserSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"yunzhupaas_mdm_supplier_yunzhupaas_major_person_id\",\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_major_person_id\",\"checked\":false,\"selectType\":\"all\",\"disabled\":false,\"id\":\"yunzhupaas_mdm_supplier_yunzhupaas_major_person_id\",\"placeholder\":\"请选择\",\"clearable\":true,\"resizable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"责任人\",\"label\":\"责任人\",\"sortable\":false,\"relationField\":\"\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"供应商级别\",\"fullNameI18nCode\":[\"\"],\"label\":\"供应商级别\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_supplier\",\"renderKey\":1776918157184,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem379bfe\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"供应商级别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_level\",\"options\":[{\"fullName\":\"选项一\",\"id\":\"1\"},{\"fullName\":\"选项二\",\"id\":\"2\"}],\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_level\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_level\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"供应商类型\",\"fullNameI18nCode\":[\"\"],\"label\":\"供应商类型\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_supplier\",\"renderKey\":1776918191565,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItem68763d\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"供应商类型\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_type\",\"options\":[{\"fullName\":\"选项一\",\"id\":\"1\"},{\"fullName\":\"选项二\",\"id\":\"2\"}],\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_type\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_type\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"供应商分类\",\"fullNameI18nCode\":[\"\"],\"label\":\"供应商分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_supplier\",\"renderKey\":1776944232887,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItembc9eef\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"供应商分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_category\",\"options\":[{\"fullName\":\"选项一\",\"id\":\"1\"},{\"fullName\":\"选项二\",\"id\":\"2\"}],\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_category\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"yunzhupaas_mdm_supplier_yunzhupaas_supplier_category\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"fullName\":\"荣誉、资质\",\"fullNameI18nCode\":[\"\"],\"label\":\"荣誉、资质\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"showCount\":false,\"__config__\":{\"formId\":\"formItem108619\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"荣誉、资质\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_supplier\",\"renderKey\":1776944281798,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"yunzhupaas_mdm_supplier_yunzhupaas_honor\",\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_honor\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"yunzhupaas_mdm_supplier_yunzhupaas_honor\",\"placeholder\":\"请输入备注\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"fullName\":\"供应商业绩\",\"fullNameI18nCode\":[\"\"],\"label\":\"供应商业绩\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"showCount\":false,\"__config__\":{\"formId\":\"formItem237f5f\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"供应商业绩\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_supplier\",\"renderKey\":1776944313831,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"yunzhupaas_mdm_supplier_yunzhupaas_achievement\",\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_achievement\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"yunzhupaas_mdm_supplier_yunzhupaas_achievement\",\"placeholder\":\"请输入备注\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"fullName\":\"完工项目\",\"fullNameI18nCode\":[\"\"],\"label\":\"完工项目\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"showCount\":false,\"__config__\":{\"formId\":\"formItem0c9119\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"完工项目\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_supplier\",\"renderKey\":1776944334228,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"yunzhupaas_mdm_supplier_yunzhupaas_finish_project\",\"__vModel__\":\"yunzhupaas_mdm_supplier_yunzhupaas_finish_project\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"yunzhupaas_mdm_supplier_yunzhupaas_finish_project\",\"placeholder\":\"请输入备注\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"textarea\",\"clearable\":true,\"resizable\":true,\"fullName\":\"备注\",\"fullNameI18nCode\":[\"\"],\"label\":\"备注\",\"sortable\":false,\"align\":\"left\",\"autoSize\":{\"minRows\":2,\"maxRows\":2},\"showCount\":false,\"__config__\":{\"formId\":\"formItem9f5e00\",\"yunzhupaasKey\":\"textarea\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774506534863,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-textarea\",\"tag\":\"YunzhupaasTextarea\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"remark\",\"__vModel__\":\"remark\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"remark\",\"placeholder\":\"请输入备注\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"billRule\",\"resizable\":true,\"fullName\":\"设计子表-发票抬头编码\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"设计子表-发票抬头编码\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"billRule\",\"parentVModel\":\"tableField46dc53\",\"dragDisabled\":false,\"rule\":\"InvoiceTitleCode\",\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754320599,\"tagIcon\":\"icon-ym icon-ym-generator-documents\",\"ruleType\":1,\"isSubTable\":true,\"ruleName\":\"发票抬头编码\",\"tag\":\"YunzhupaasInput\",\"formId\":\"formItem57f1d4\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"发票抬头编码\",\"trigger\":\"change\",\"ruleConfig\":{},\"layout\":\"colFormItem\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField46dc53-title_code\",\"__vModel__\":\"title_code\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField46dc53-title_code\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItema8b1f4\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"发票抬头名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507383593,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-title_name\",\"__vModel__\":\"title_name\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-title_name\",\"placeholder\":\"请输入联系人\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":10,\"fullName\":\"设计子表-发票抬头名称\",\"label\":\"设计子表-发票抬头名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1963f0\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"纳税人识别号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507440273,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-credit_code\",\"__vModel__\":\"credit_code\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-credit_code\",\"placeholder\":\"请输入联系人职务\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"设计子表-纳税人识别号\",\"label\":\"设计子表-纳税人识别号\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"select\",\"filterable\":false,\"clearable\":true,\"resizable\":true,\"multiple\":false,\"fullName\":\"设计子表-纳税人类别\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"设计子表-纳税人类别\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"select\",\"defaultValue\":\"\",\"parentVModel\":\"tableField46dc53\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754396382,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":\"formItemb3492f\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"纳税人类别\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":8},\"prop\":\"tableField46dc53-tax_type\",\"options\":[{\"fullName\":\"一般纳税人\",\"id\":\"GENERAL\"},{\"fullName\":\"小规模纳税人\",\"id\":\"SMALL\"}],\"__vModel__\":\"tax_type\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField46dc53-tax_type\",\"placeholder\":\"请选择纳税人类别\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItema9aaf2\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"地址\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507448061,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-address\",\"__vModel__\":\"address\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-address\",\"placeholder\":\"请输入联系人邮箱\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"设计子表-地址\",\"label\":\"设计子表-地址\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItemf8b766\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"电话\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754421983,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-phone\",\"__vModel__\":\"phone\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-phone\",\"placeholder\":\"请输入联系人邮箱\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"设计子表-电话\",\"label\":\"设计子表-电话\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1730ca\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户银行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754433217,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-bank_name\",\"__vModel__\":\"bank_name\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-bank_name\",\"placeholder\":\"请输入联系人邮箱\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"设计子表-开户银行\",\"label\":\"设计子表-开户银行\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem1089bb\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账户\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754444839,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-bank_account\",\"__vModel__\":\"bank_account\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-bank_account\",\"placeholder\":\"请输入联系人邮箱\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"设计子表-银行账户\",\"label\":\"设计子表-银行账户\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"switch\",\"resizable\":true,\"activeValue\":1,\"inactiveValue\":0,\"fullName\":\"设计子表-是否默认\",\"inactiveTxt\":\"关\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"设计子表-是否默认\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItem4743e7\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否默认\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754525239,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"tableField46dc53-is_defalut\",\"__vModel__\":\"is_defalut\",\"checked\":false,\"fixed\":\"none\",\"disabled\":false,\"activeTxt\":\"开\",\"id\":\"tableField46dc53-is_defalut\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"switch\",\"resizable\":true,\"activeValue\":1,\"inactiveValue\":0,\"fullName\":\"设计子表-是否有效\",\"inactiveTxt\":\"关\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"设计子表-是否有效\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":\"formItema2b4cf\",\"relationTable\":\"mdm_company_invoice\",\"yunzhupaasKey\":\"switch\",\"visibility\":[\"pc\",\"app\"],\"defaultValue\":0,\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"是否有效\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1776754540042,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-switch\",\"isSubTable\":true,\"tag\":\"YunzhupaasSwitch\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"tableField46dc53-is_valid\",\"__vModel__\":\"is_valid\",\"checked\":false,\"fixed\":\"none\",\"disabled\":false,\"activeTxt\":\"开\",\"id\":\"tableField46dc53-is_valid\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_invoice\",\"formId\":\"formItem560a27\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableField46dc53\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507449005,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField46dc53-remark\",\"__vModel__\":\"remark\",\"checked\":false,\"disabled\":false,\"id\":\"tableField46dc53-remark\",\"placeholder\":\"请输入备注\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":50,\"fullName\":\"设计子表-备注\",\"label\":\"设计子表-备注\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem3756b9\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507591361,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldad9d92-bank_name\",\"__vModel__\":\"bank_name\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldad9d92-bank_name\",\"placeholder\":\"请输入开户行\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"设计子表-开户行\",\"label\":\"设计子表-开户行\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemf42745\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"账户名\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507611465,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldad9d92-bank_account_name\",\"__vModel__\":\"bank_account_name\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldad9d92-bank_account_name\",\"placeholder\":\"请输入账户名\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"设计子表-账户名\",\"label\":\"设计子表-账户名\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItem8abffe\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"银行账号\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507627371,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldad9d92-bank_account_number\",\"__vModel__\":\"bank_account_number\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldad9d92-bank_account_number\",\"placeholder\":\"请输入银行账号\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"设计子表-银行账号\",\"label\":\"设计子表-银行账号\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemb870cb\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"开户行城市\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507627772,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldad9d92-bank_province\",\"__vModel__\":\"bank_province\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldad9d92-bank_province\",\"placeholder\":\"请输入开户行城市\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":20,\"fullName\":\"设计子表-开户行城市\",\"label\":\"设计子表-开户行城市\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"input\",\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"relationTable\":\"mdm_company_bank\",\"formId\":\"formItemf22092\",\"yunzhupaasKey\":\"input\",\"visibility\":[\"pc\",\"app\"],\"noShow\":false,\"parentVModel\":\"tableFieldad9d92\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"备注\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"mdm_company\",\"renderKey\":1774507628423,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableFieldad9d92-remark\",\"__vModel__\":\"remark\",\"checked\":false,\"disabled\":false,\"id\":\"tableFieldad9d92-remark\",\"placeholder\":\"请输入备注\",\"addonBefore\":\"\",\"clearable\":true,\"resizable\":true,\"maxlength\":200,\"fullName\":\"设计子表-备注\",\"label\":\"设计子表-备注\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"}],\"showOverflow\":true,\"useFormPermission\":false,\"customBtnsList\":[],\"useBtnPermission\":false}"); + return sb.toString(); + } + /** 表列表 */ + public static final String getTableList(){ + StringBuilder sb = new StringBuilder(); +sb.append("[{\"relationTable\":\"\",\"tableField\":\"\",\"typeId\":\"1\",\"fields\":[{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"company_id\",\"fieldName\":\"企业唯一ID\",\"identity\":0,\"primaryKey\":1},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"company_code\",\"fieldName\":\"企业编码(系统生成或用户定义)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"200\",\"dataType\":\"varchar\",\"field\":\"company_name\",\"fieldName\":\"企业名称(企业名或个人姓名)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"3\",\"dataType\":\"char\",\"field\":\"entity_type\",\"fieldName\":\"实体类型: ORG-组织/企业(Organization), IND-个人(Individual)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"100\",\"dataType\":\"varchar\",\"field\":\"short_name\",\"fieldName\":\"简称/昵称\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"100\",\"dataType\":\"varchar\",\"field\":\"org_id\",\"fieldName\":\"归属组织。关联表:base_organize\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"3\",\"dataType\":\"char\",\"field\":\"company_scope\",\"fieldName\":\"伙伴性质:INT-内部(Internal), EXT-外部(External)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"credit_code\",\"fieldName\":\"社会信用代码(企业)或身份证号(个人)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"province_id\",\"fieldName\":\"所属地区。关联表:base_province\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"20\",\"dataType\":\"varchar\",\"field\":\"tax_type\",\"fieldName\":\"纳税人类别: GENERAL-一般纳税人, SMALL-小规模\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"enterprise_nature\",\"fieldName\":\"企业类型。关联字典:企业性质(EnterpriseNature)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"industry_code\",\"fieldName\":\"行业代码。关联字典:行业类别(IndustryType)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"enterprise_scale\",\"fieldName\":\"企业规模。关联字典:企业规模(EnterpriseScale)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"registration_date\",\"fieldName\":\"成立日期\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"10,2\",\"dataType\":\"decimal\",\"field\":\"registered_capital\",\"fieldName\":\"注册资本(单位:万元)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"legal_representative\",\"fieldName\":\"法定代表人\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"phone\",\"fieldName\":\"联系电话\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"email\",\"fieldName\":\"邮箱\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"200\",\"dataType\":\"varchar\",\"field\":\"website\",\"fieldName\":\"网站\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"500\",\"dataType\":\"varchar\",\"field\":\"address\",\"fieldName\":\"地址\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":null,\"dataType\":\"tinytext\",\"field\":\"business_scope\",\"fieldName\":\"经营范围\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"500\",\"dataType\":\"varchar\",\"field\":\"remark\",\"fieldName\":\"备注\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"create_by\",\"fieldName\":\"创建人\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"create_time\",\"fieldName\":\"创建时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"update_by\",\"fieldName\":\"更新人ID\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"update_time\",\"fieldName\":\"更新时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_tenant_id\",\"fieldName\":\"租户id\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":null,\"dataType\":\"int\",\"field\":\"f_delete_mark\",\"fieldName\":\"删除标志\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"f_delete_time\",\"fieldName\":\"删除时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_delete_user_id\",\"fieldName\":\"删除用户\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_flow_id\",\"fieldName\":\"流程id\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_flow_task_id\",\"fieldName\":\"流程任务主键\",\"identity\":0,\"primaryKey\":0}],\"relationField\":\"\",\"table\":\"mdm_company\",\"tableName\":\"企业信息(包括:客商与企业内部单位)\"},{\"relationTable\":\"mdm_company\",\"tableField\":\"company_id\",\"typeId\":\"0\",\"fields\":[{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"bank_id\",\"fieldName\":\"商业伙伴银行ID\",\"identity\":0,\"primaryKey\":1},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"company_id\",\"fieldName\":\"关联的企业信息ID。关联表:mdm_company\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"100\",\"dataType\":\"varchar\",\"field\":\"bank_name\",\"fieldName\":\"开户行\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"200\",\"dataType\":\"varchar\",\"field\":\"bank_account_name\",\"fieldName\":\"账户名\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"bank_account_number\",\"fieldName\":\"银行账号\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"bank_province\",\"fieldName\":\"开户行城市\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"500\",\"dataType\":\"varchar\",\"field\":\"remark\",\"fieldName\":\"备注\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"create_by\",\"fieldName\":\"创建人\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"create_time\",\"fieldName\":\"创建时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"update_by\",\"fieldName\":\"更新人ID\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"update_time\",\"fieldName\":\"更新时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_tenant_id\",\"fieldName\":\"租户id\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":null,\"dataType\":\"int\",\"field\":\"f_delete_mark\",\"fieldName\":\"删除标志\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"f_delete_time\",\"fieldName\":\"删除时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_delete_user_id\",\"fieldName\":\"删除用户\",\"identity\":0,\"primaryKey\":0}],\"relationField\":\"company_id\",\"table\":\"mdm_company_bank\",\"tableName\":\"企业银行信息\"},{\"relationTable\":\"mdm_company\",\"tableField\":\"company_id\",\"typeId\":\"0\",\"fields\":[{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"invoice_id\",\"fieldName\":\"发票抬头ID\",\"identity\":0,\"primaryKey\":1},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"company_id\",\"fieldName\":\"企业信息ID。关联表:mdm_company\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"title_code\",\"fieldName\":\"发票抬头编码\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"200\",\"dataType\":\"varchar\",\"field\":\"title_name\",\"fieldName\":\"发票抬头名称\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"credit_code\",\"fieldName\":\"纳税人识别号\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"20\",\"dataType\":\"varchar\",\"field\":\"tax_type\",\"fieldName\":\"纳税人类别: GENERAL-一般纳税人, SMALL-小规模\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"200\",\"dataType\":\"varchar\",\"field\":\"address\",\"fieldName\":\"地址\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"20\",\"dataType\":\"varchar\",\"field\":\"phone\",\"fieldName\":\"电话\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"100\",\"dataType\":\"varchar\",\"field\":\"bank_name\",\"fieldName\":\"开户银行\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"30\",\"dataType\":\"varchar\",\"field\":\"bank_account\",\"fieldName\":\"银行账户\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"1\",\"dataType\":\"char\",\"field\":\"is_valid\",\"fieldName\":\"是否有效。Y=有效、N=无效\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"1\",\"dataType\":\"char\",\"field\":\"is_defalut\",\"fieldName\":\"是否默认抬头。Y=是、N=否\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"500\",\"dataType\":\"varchar\",\"field\":\"remark\",\"fieldName\":\"备注\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"create_by\",\"fieldName\":\"创建人\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"create_time\",\"fieldName\":\"创建时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"update_by\",\"fieldName\":\"更新人ID\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"update_time\",\"fieldName\":\"更新时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_tenant_id\",\"fieldName\":\"租户id\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":null,\"dataType\":\"int\",\"field\":\"f_delete_mark\",\"fieldName\":\"删除标志\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"f_delete_time\",\"fieldName\":\"删除时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_delete_user_id\",\"fieldName\":\"删除用户\",\"identity\":0,\"primaryKey\":0}],\"relationField\":\"company_id\",\"table\":\"mdm_company_invoice\",\"tableName\":\"企业发票抬头\"},{\"relationTable\":\"mdm_company\",\"tableField\":\"company_id\",\"typeId\":\"0\",\"fields\":[{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"supplier_id\",\"fieldName\":\"供应商ID\",\"identity\":0,\"primaryKey\":1},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"company_id\",\"fieldName\":\"企业唯一ID。关联表:mdm_company\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"org_id\",\"fieldName\":\"归属组织。关联表:base_organize\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"major_person_id\",\"fieldName\":\"责任人。关联表:base_user\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"supplier_level\",\"fieldName\":\"供应商级别。关联字典:供应商级别(SupplierLevel)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"supplier_type\",\"fieldName\":\"供应商类型。关联字典:供应商类型(SupplierType)。如:生产商、代理商,、经销商、服务商等\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"supplier_category\",\"fieldName\":\"供应商分类。关联字典:供应商分类(SupplierCategory)\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"2000\",\"dataType\":\"varchar\",\"field\":\"honor\",\"fieldName\":\"荣誉、资质\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"2000\",\"dataType\":\"varchar\",\"field\":\"achievement\",\"fieldName\":\"供应商业绩\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"2000\",\"dataType\":\"varchar\",\"field\":\"finish_project\",\"fieldName\":\"完工项目\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"500\",\"dataType\":\"varchar\",\"field\":\"remark\",\"fieldName\":\"备注\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"create_by\",\"fieldName\":\"创建人\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"create_time\",\"fieldName\":\"创建时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"update_by\",\"fieldName\":\"更新人ID\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":1,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"\",\"dataType\":\"datetime\",\"field\":\"update_time\",\"fieldName\":\"更新时间\",\"identity\":0,\"primaryKey\":0},{\"allowNull\":0,\"autoIncrement\":0,\"columnName\":null,\"dataLength\":\"50\",\"dataType\":\"varchar\",\"field\":\"f_tenant_id\",\"fieldName\":\"租户id\",\"identity\":0,\"primaryKey\":0}],\"relationField\":\"company_id\",\"table\":\"mdm_supplier\",\"tableName\":\"供应商\"}]"); return sb.toString(); + } + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/suppinfo/SuppinfoExcelErrorVO.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/suppinfo/SuppinfoExcelErrorVO.java new file mode 100644 index 0000000..6ebcd6f --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/suppinfo/SuppinfoExcelErrorVO.java @@ -0,0 +1,22 @@ + + +package com.yunzhupaas.mdm.model.suppinfo; + +import lombok.Data; +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.alibaba.fastjson.annotation.JSONField; +/** + * + * 供应商信息 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-24 + */ +@Data +public class SuppinfoExcelErrorVO extends SuppinfoExcelVO{ + + @Excel(name = "异常原因",orderNum = "-999") + @JSONField(name = "errorsInfo") + private String errorsInfo; +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/suppinfo/SuppinfoExcelVO.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/suppinfo/SuppinfoExcelVO.java new file mode 100644 index 0000000..6bea356 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/suppinfo/SuppinfoExcelVO.java @@ -0,0 +1,135 @@ +package com.yunzhupaas.mdm.model.suppinfo; + +import com.yunzhupaas.mdm.model.companyBank.CompanyBankExcelVO; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; +import cn.afterturn.easypoi.excel.annotation.Excel; +import cn.afterturn.easypoi.excel.annotation.ExcelCollection; + +import java.util.List; +/** + * + * 供应商信息 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-24 + */ +@Data +public class SuppinfoExcelVO{ + /** 企业名称 **/ + @JSONField(name = "company_name") + @Excel(name = "企业名称(company_name)",orderNum = "1", isImportField = "true" ) + private String company_name; + + /** 社会信用代码 **/ + @JSONField(name = "credit_code") + @Excel(name = "社会信用代码(credit_code)",orderNum = "1", isImportField = "true" ) + private String credit_code; + + /** 归属组织 **/ + @JSONField(name = "org_id") + @Excel(name = "归属组织(org_id)",orderNum = "1", isImportField = "true" ) + private String org_id; + + /** 企业编码 **/ + @JSONField(name = "company_code") + @Excel(name = "企业编码(company_code)",orderNum = "1", isImportField = "true" ) + private String company_code; + + /** 简称/昵称 **/ + @JSONField(name = "short_name") + @Excel(name = "简称/昵称(short_name)",orderNum = "1", isImportField = "true" ) + private String short_name; + + /** 类型 **/ + @JSONField(name = "entity_type") + @Excel(name = "类型(entity_type)",orderNum = "1", isImportField = "true" ) + private String entity_type; + + /** 纳税人类别 **/ + @JSONField(name = "tax_type") + @Excel(name = "纳税人类别(tax_type)",orderNum = "1", isImportField = "true" ) + private String tax_type; + + /** 企业规模 **/ + @JSONField(name = "enterprise_scale") + @Excel(name = "企业规模(enterprise_scale)",orderNum = "1", isImportField = "true" ) + private String enterprise_scale; + + /** 企业类型 **/ + @JSONField(name = "enterprise_nature") + @Excel(name = "企业类型(enterprise_nature)",orderNum = "1", isImportField = "true" ) + private String enterprise_nature; + + /** 行业代码 **/ + @JSONField(name = "industry_code") + @Excel(name = "行业代码(industry_code)",orderNum = "1", isImportField = "true" ) + private String industry_code; + + /** 成立日期 **/ + @JSONField(name = "registration_date") + @Excel(name = "成立日期(registration_date)",orderNum = "1", isImportField = "true" ) + private String registration_date; + + /** 注册资本 **/ + @JSONField(name = "registered_capital") + @Excel(name = "注册资本(registered_capital)",orderNum = "1", isImportField = "true" ) + private String registered_capital; + + /** 法定代表人 **/ + @JSONField(name = "legal_representative") + @Excel(name = "法定代表人(legal_representative)",orderNum = "1", isImportField = "true" ) + private String legal_representative; + + /** 联系电话 **/ + @JSONField(name = "phone") + @Excel(name = "联系电话(phone)",orderNum = "1", isImportField = "true" ) + private String phone; + + /** 邮箱 **/ + @JSONField(name = "email") + @Excel(name = "邮箱(email)",orderNum = "1", isImportField = "true" ) + private String email; + + /** 网站 **/ + @JSONField(name = "website") + @Excel(name = "网站(website)",orderNum = "1", isImportField = "true" ) + private String website; + + /** 地址 **/ + @JSONField(name = "address") + @Excel(name = "地址(address)",orderNum = "1", isImportField = "true" ) + private String address; + + /** 所属地区 **/ + @JSONField(name = "province_id") + @Excel(name = "所属地区(province_id)",orderNum = "1", isImportField = "true" ) + private String province_id; + + /** 经营范围 **/ + @JSONField(name = "business_scope") + @Excel(name = "经营范围(business_scope)",orderNum = "1", isImportField = "true" ) + private String business_scope; + + /** 备注 **/ + @JSONField(name = "remark") + @Excel(name = "备注(remark)",orderNum = "1", isImportField = "true" ) + private String remark; + + /** 责任人 **/ + @JSONField(name = "yunzhupaas_mdm_supplier_yunzhupaas_major_person_id") + @Excel(name = "责任人(yunzhupaas_mdm_supplier_yunzhupaas_major_person_id)",orderNum = "1", isImportField = "true" ) + private String yunzhupaas_mdm_supplier_yunzhupaas_major_person_id; + + @JsonProperty("tableField46dc53") + @ExcelCollection(name="设计子表(tableField46dc53)",orderNum = "10") + private List tableField46dc53; + + @JsonProperty("tableFieldad9d92") + @ExcelCollection(name="设计子表(tableFieldad9d92)",orderNum = "5") + private List tableFieldad9d92; + + +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/suppinfo/SuppinfoForm.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/suppinfo/SuppinfoForm.java new file mode 100644 index 0000000..d58d3c7 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/suppinfo/SuppinfoForm.java @@ -0,0 +1,171 @@ +package com.yunzhupaas.mdm.model.suppinfo; + +import com.yunzhupaas.mdm.model.companyBank.CompanyBankModel; +import lombok.Data; +import java.util.*; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * 供应商信息 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-24 + */ +@Data +@Schema(description = "表单参数") +public class SuppinfoForm { + /** 主键 */ + @Schema(description = "主键") + @JSONField(name = "company_id") + private String companyId; + + + /** 企业编码 **/ + @Schema(description = "企业编码") + @JsonProperty("company_code") + @JSONField(name = "company_code") + private String companyCode; + /** 企业名称 **/ + @Schema(description = "企业名称") + @JsonProperty("company_name") + @JSONField(name = "company_name") + private String companyName; + /** 简称/昵称 **/ + @Schema(description = "简称/昵称") + @JsonProperty("short_name") + @JSONField(name = "short_name") + private String shortName; + /** 类型 **/ + @Schema(description = "类型") + @JsonProperty("entity_type") + @JSONField(name = "entity_type") + private String entityType; + /** 社会信用代码 **/ + @Schema(description = "社会信用代码") + @JsonProperty("credit_code") + @JSONField(name = "credit_code") + private String creditCode; + /** 归属组织 **/ + @Schema(description = "归属组织") + @JsonProperty("org_id") + @JSONField(name = "org_id") + private Object orgId; + /** 所属地区 **/ + @Schema(description = "所属地区") + @JsonProperty("province_id") + @JSONField(name = "province_id") + private Object provinceId; + /** 纳税人类别 **/ + @Schema(description = "纳税人类别") + @JsonProperty("tax_type") + @JSONField(name = "tax_type") + private Object taxType; + /** 企业规模 **/ + @Schema(description = "企业规模") + @JsonProperty("enterprise_scale") + @JSONField(name = "enterprise_scale") + private Object enterpriseScale; + /** 企业类型 **/ + @Schema(description = "企业类型") + @JsonProperty("enterprise_nature") + @JSONField(name = "enterprise_nature") + private Object enterpriseNature; + /** 行业代码 **/ + @Schema(description = "行业代码") + @JsonProperty("industry_code") + @JSONField(name = "industry_code") + private Object industryCode; + /** 成立日期 **/ + @Schema(description = "成立日期") + @JsonProperty("registration_date") + @JSONField(name = "registration_date") + private String registrationDate; + /** 注册资本 **/ + @Schema(description = "注册资本") + @JsonProperty("registered_capital") + @JSONField(name = "registered_capital") + private BigDecimal registeredCapital; + /** 法定代表人 **/ + @Schema(description = "法定代表人") + @JsonProperty("legal_representative") + @JSONField(name = "legal_representative") + private String legalRepresentative; + /** 联系电话 **/ + @Schema(description = "联系电话") + @JsonProperty("phone") + @JSONField(name = "phone") + private String phone; + /** 邮箱 **/ + @Schema(description = "邮箱") + @JsonProperty("email") + @JSONField(name = "email") + private String email; + /** 网站 **/ + @Schema(description = "网站") + @JsonProperty("website") + @JSONField(name = "website") + private String website; + /** 地址 **/ + @Schema(description = "地址") + @JsonProperty("address") + @JSONField(name = "address") + private String address; + /** 经营范围 **/ + @Schema(description = "经营范围") + @JsonProperty("business_scope") + @JSONField(name = "business_scope") + private String businessScope; + /** 责任人 **/ + @Schema(description = "责任人") + @JsonProperty("yunzhupaas_mdm_supplier_yunzhupaas_major_person_id") + @JSONField(name = "yunzhupaas_mdm_supplier_yunzhupaas_major_person_id") + private Object yunzhupaas_supplier_yunzhupaas_majorPersonId; + /** 供应商级别 **/ + @Schema(description = "供应商级别") + @JsonProperty("yunzhupaas_mdm_supplier_yunzhupaas_supplier_level") + @JSONField(name = "yunzhupaas_mdm_supplier_yunzhupaas_supplier_level") + private Object yunzhupaas_supplier_yunzhupaas_supplierLevel; + /** 供应商类型 **/ + @Schema(description = "供应商类型") + @JsonProperty("yunzhupaas_mdm_supplier_yunzhupaas_supplier_type") + @JSONField(name = "yunzhupaas_mdm_supplier_yunzhupaas_supplier_type") + private Object yunzhupaas_supplier_yunzhupaas_supplierType; + /** 供应商分类 **/ + @Schema(description = "供应商分类") + @JsonProperty("yunzhupaas_mdm_supplier_yunzhupaas_supplier_category") + @JSONField(name = "yunzhupaas_mdm_supplier_yunzhupaas_supplier_category") + private Object yunzhupaas_supplier_yunzhupaas_supplierCategory; + /** 荣誉、资质 **/ + @Schema(description = "荣誉、资质") + @JsonProperty("yunzhupaas_mdm_supplier_yunzhupaas_honor") + @JSONField(name = "yunzhupaas_mdm_supplier_yunzhupaas_honor") + private String yunzhupaas_supplier_yunzhupaas_honor; + /** 供应商业绩 **/ + @Schema(description = "供应商业绩") + @JsonProperty("yunzhupaas_mdm_supplier_yunzhupaas_achievement") + @JSONField(name = "yunzhupaas_mdm_supplier_yunzhupaas_achievement") + private String yunzhupaas_supplier_yunzhupaas_achievement; + /** 完工项目 **/ + @Schema(description = "完工项目") + @JsonProperty("yunzhupaas_mdm_supplier_yunzhupaas_finish_project") + @JSONField(name = "yunzhupaas_mdm_supplier_yunzhupaas_finish_project") + private String yunzhupaas_supplier_yunzhupaas_finishProject; + /** 备注 **/ + @Schema(description = "备注") + @JsonProperty("remark") + @JSONField(name = "remark") + private String remark; + + /** 子表数据 **/ + @Schema(description = "panyInvoice子表数据") + @JsonProperty("panyInvoiceList") + private List panyInvoiceList; + /** 子表数据 **/ + @Schema(description = "companyBank子表数据") + @JsonProperty("companyBankList") + private List companyBankList; +} diff --git a/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/suppinfo/SuppinfoPagination.java b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/suppinfo/SuppinfoPagination.java new file mode 100644 index 0000000..d195c71 --- /dev/null +++ b/yunzhupaas-mdm/yunzhupaas-mdm-entity/src/main/java/com/yunzhupaas/mdm/model/suppinfo/SuppinfoPagination.java @@ -0,0 +1,55 @@ +package com.yunzhupaas.mdm.model.suppinfo; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import com.yunzhupaas.base.Pagination; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.List; + +/** + * + * 供应商信息 + * @版本: V5.2.7 + * @版权: Copyright @ 2025 深圳市乐程软件有限公司版权所有 + * @作者: 深圳市乐程软件有限公司 + * @日期: 2026-04-24 + */ +@Data +@Schema(description = "列表查询参数") +public class SuppinfoPagination extends Pagination { + /** 关键词搜索 */ + @Schema(description = "关键词搜索") + private String yunzhupaasKeyword; + /** 查询key */ + @Schema(description = "查询key") + private String[] selectKey; + /** 选中数据数组id */ + @Schema(description = "选中数据数组id") + private Object[] selectIds; + /** json */ + @Schema(description = "json") + private String json; + /** 数据类型 0-当前页,1-全部数据 */ + @Schema(description = "数据类型 0-当前页,1-全部数据") + private String dataType; + /** 高级查询 */ + @Schema(description = "高级查询") + private String superQueryJson; + /** 功能id */ + @Schema(description = "功能id") + private String moduleId; + /** 菜单id */ + @Schema(description = "菜单id") + private String menuId; + /** 企业名称 */ + @Schema(description = "企业名称") + @JsonProperty("company_name") + @JSONField(name = "companyName") + private Object companyName; + /** 归属组织 */ + @Schema(description = "归属组织") + @JsonProperty("org_id") + @JSONField(name = "orgId") + private Object orgId; +} diff --git a/yunzhupaas-message/pom.xml b/yunzhupaas-message/pom.xml new file mode 100644 index 0000000..eca5712 --- /dev/null +++ b/yunzhupaas-message/pom.xml @@ -0,0 +1,21 @@ + + + + yunzhupaas-java-boot + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-message + pom + + yunzhupaas-message-entity + yunzhupaas-message-biz + yunzhupaas-message-controller + + + + diff --git a/yunzhupaas-message/yunzhupaas-message-biz/pom.xml b/yunzhupaas-message/yunzhupaas-message-biz/pom.xml new file mode 100644 index 0000000..c35cca8 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/pom.xml @@ -0,0 +1,36 @@ + + + + yunzhupaas-message + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-message-biz + + + + com.yunzhupaas + yunzhupaas-provider + ${project.version} + + + org.springframework.boot + spring-boot-starter-websocket + + + com.yunzhupaas + yunzhupaas-permission-biz + ${project.version} + + + com.yunzhupaas + yunzhupaas-system-biz + ${project.version} + + + + diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/config/WebsocketConfig.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/config/WebsocketConfig.java new file mode 100644 index 0000000..849f00b --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/config/WebsocketConfig.java @@ -0,0 +1,27 @@ +package com.yunzhupaas.message.config; + +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.condition.ConditionalOnNotWarDeployment; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.socket.server.standard.ServerEndpointExporter; + +@Configuration +@ComponentScan +@EnableAutoConfiguration +public class WebsocketConfig { + + /** + * 支持websocket + * 如果不使用内置tomcat,则无需配置 + * + * @return + */ + @Bean + @ConditionalOnNotWarDeployment + public ServerEndpointExporter serverEndpointExporter() { + return new ServerEndpointExporter(); + } +} + diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/AccountConfigMapper.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/AccountConfigMapper.java new file mode 100644 index 0000000..e321e38 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/AccountConfigMapper.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.message.mapper; + + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.message.entity.AccountConfigEntity; + +/** + * + * 账号配置功能 + * 版本: V3.2.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2022-08-18 + */ +public interface AccountConfigMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/ImContentMapper.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/ImContentMapper.java new file mode 100644 index 0000000..6a22771 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/ImContentMapper.java @@ -0,0 +1,30 @@ +package com.yunzhupaas.message.mapper; + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.message.entity.ImContentEntity; +import com.yunzhupaas.message.model.ImUnreadNumModel; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 聊天内容 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface ImContentMapper extends SuperMapper { + + List getUnreadList(@Param("receiveUserId") String receiveUserId); + + List getUnreadLists(@Param("receiveUserId") String receiveUserId); + + int readMessage(@Param("map") Map map); +} + + diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/ImReplyMapper.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/ImReplyMapper.java new file mode 100644 index 0000000..7327f19 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/ImReplyMapper.java @@ -0,0 +1,27 @@ +package com.yunzhupaas.message.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.message.entity.ImReplyEntity; +import com.yunzhupaas.message.model.ImReplyListModel; + +import java.util.List; + +/** + * 聊天会话 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-05-28 + */ +public interface ImReplyMapper extends SuperMapper { + + /** + * 聊天会话列表 + * @return + */ + List getImReplyList(); + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/MessageMapper.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/MessageMapper.java new file mode 100644 index 0000000..bae49ec --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/MessageMapper.java @@ -0,0 +1,28 @@ +package com.yunzhupaas.message.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.message.entity.MessageEntity; +import com.yunzhupaas.message.entity.MessageReceiveEntity; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 消息实例 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2023/09/27 + */ +public interface MessageMapper extends SuperMapper { + + List getMessageList(@Param("map") Map map); + + int getUnreadCount(@Param("userId") String userId,@Param("type") Integer type); + + List getInfoDefault(@Param("type") int type); +} + diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/MessageMonitorMapper.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/MessageMonitorMapper.java new file mode 100644 index 0000000..b74fe30 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/MessageMonitorMapper.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.message.mapper; + + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.message.entity.MessageMonitorEntity; + +/** + * + * 消息监控 + * 版本: V3.2.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2022-08-22 + */ +public interface MessageMonitorMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/MessageTemplateConfigMapper.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/MessageTemplateConfigMapper.java new file mode 100644 index 0000000..08a8201 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/MessageTemplateConfigMapper.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.message.mapper; + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.message.entity.MessageTemplateConfigEntity; + +/** + * + * 消息模板(新) + * 版本: V3.2.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2022-08-18 + */ +public interface MessageTemplateConfigMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/MessagereceiveMapper.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/MessagereceiveMapper.java new file mode 100644 index 0000000..e608bf0 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/MessagereceiveMapper.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.message.mapper; + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.message.entity.MessageReceiveEntity; + +/** + * 消息接收 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface MessagereceiveMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/SendConfigTemplateMapper.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/SendConfigTemplateMapper.java new file mode 100644 index 0000000..4397f59 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/SendConfigTemplateMapper.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.message.mapper; + + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.message.entity.SendConfigTemplateEntity; + +/** + * + * 消息发送配置 + * 版本: V3.2.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2022-08-19 + */ +public interface SendConfigTemplateMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/SendMessageConfigMapper.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/SendMessageConfigMapper.java new file mode 100644 index 0000000..bb6aa6f --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/SendMessageConfigMapper.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.message.mapper; + + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.message.entity.SendMessageConfigEntity; + +/** + * + * 消息发送配置 + * 版本: V3.2.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2022-08-19 + */ +public interface SendMessageConfigMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/ShortLInkMapper.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/ShortLInkMapper.java new file mode 100644 index 0000000..05e1173 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/ShortLInkMapper.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.message.mapper; + + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.message.entity.ShortLinkEntity; + +/** + * + * 消息模板(新) + * 版本: V3.2.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2022-08-18 + */ +public interface ShortLInkMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/SmsFieldMapper.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/SmsFieldMapper.java new file mode 100644 index 0000000..3beac37 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/SmsFieldMapper.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.message.mapper; + + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.message.entity.SmsFieldEntity; + +/** + * + * 消息模板(新) + * 版本: V3.2.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2022-08-18 + */ +public interface SmsFieldMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/SynThirdInfoMapper.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/SynThirdInfoMapper.java new file mode 100644 index 0000000..d99b5c2 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/SynThirdInfoMapper.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.message.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.message.entity.SynThirdInfoEntity; + +/** + * 第三方工具对象同步表 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021/4/23 17:25 + */ +public interface SynThirdInfoMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/TemplateParamMapper.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/TemplateParamMapper.java new file mode 100644 index 0000000..b45d7bc --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/TemplateParamMapper.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.message.mapper; + + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.message.entity.TemplateParamEntity; + +/** + * + * 消息模板(新) + * 版本: V3.2.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2022-08-18 + */ +public interface TemplateParamMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/UserDeviceMapper.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/UserDeviceMapper.java new file mode 100644 index 0000000..1148cff --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/UserDeviceMapper.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.message.mapper; + + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.message.entity.UserDeviceEntity; + +/** + * + * 消息模板(新) + * 版本: V3.2.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2022-08-18 + */ +public interface UserDeviceMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/WechatUserMapper.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/WechatUserMapper.java new file mode 100644 index 0000000..45cfe86 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/mapper/WechatUserMapper.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.message.mapper; + + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.message.entity.WechatUserEntity; + +/** + * + * 消息模板(新) + * 版本: V3.2.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2022-08-18 + */ +public interface WechatUserMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/ImContentService.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/ImContentService.java new file mode 100644 index 0000000..6b84d56 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/ImContentService.java @@ -0,0 +1,75 @@ +package com.yunzhupaas.message.service; + + +import com.yunzhupaas.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import com.yunzhupaas.base.PageModel; +import com.yunzhupaas.message.entity.ImContentEntity; +import com.yunzhupaas.message.model.ImUnreadNumModel; + +import java.util.List; + +/** + * 聊天内容 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface ImContentService extends SuperService { + + /** + * 获取消息列表 + * + * @param sendUserId 发送者 + * @param receiveUserId 接收者 + * @param pageModel + * @return + */ + List getMessageList(String sendUserId, String receiveUserId, PageModel pageModel); + + /** + * 获取未读消息 + * + * @param receiveUserId 接收者 + * @return + */ + List getUnreadList(String receiveUserId); + + /** + * 获取未读消息 + * + * @param receiveUserId 接收者 + * @return + */ + int getUnreadCount(String sendUserId, String receiveUserId); + + /** + * 发送消息 + * + * @param sendUserId 发送者 + * @param receiveUserId 接收者 + * @param message 消息内容 + * @param messageType 消息类型 + * @return + */ + void sendMessage(String sendUserId, String receiveUserId, String message, String messageType); + + /** + * 已读消息 + * + * @param sendUserId 发送者 + * @param receiveUserId 接收者 + * @return + */ + void readMessage(String sendUserId, String receiveUserId); + /** + * 删除聊天记录 + * + * @return + */ + boolean deleteChatRecord(String sendUserId, String receiveUserId); + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/ImReplyService.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/ImReplyService.java new file mode 100644 index 0000000..d49d8a7 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/ImReplyService.java @@ -0,0 +1,50 @@ +package com.yunzhupaas.message.service; + +import com.yunzhupaas.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import com.yunzhupaas.message.entity.ImReplyEntity; +import com.yunzhupaas.message.model.ImReplyListModel; + +import java.util.List; + +/** + * 聊天会话 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-05-29 + */ +public interface ImReplyService extends SuperService { + + /** + * 获取消息会话列表 + * + * @return + */ + List getList(); + + /** + * 保存聊天会话 + * + * @param entity + * @return + */ + boolean savaImReply(ImReplyEntity entity); + + /** + * 获取聊天会话列表 + * + * @return + */ + List getImReplyList(); + + /** + * 移除聊天会话列表 + * + * @return + */ + boolean relocation(String sendUserId,String receiveUserId); + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/UserDeviceService.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/UserDeviceService.java new file mode 100644 index 0000000..72bf108 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/UserDeviceService.java @@ -0,0 +1,33 @@ +package com.yunzhupaas.message.service; + +import com.yunzhupaas.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; + +import com.yunzhupaas.message.entity.UserDeviceEntity; + +import java.util.List; + +/** + * + * 消息模板(新) + * 版本: V3.2.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2022-08-18 + */ +public interface UserDeviceService extends SuperService { + + UserDeviceEntity getInfoByUserId(String userId); + + List getCidList(String userId); + + UserDeviceEntity getInfoByClientId(String clientId); + + void create(UserDeviceEntity entity); + + boolean update(String id, UserDeviceEntity entity); + + void delete(UserDeviceEntity entity); + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/AccountConfigServiceImpl.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/AccountConfigServiceImpl.java new file mode 100644 index 0000000..4cc46bd --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/AccountConfigServiceImpl.java @@ -0,0 +1,409 @@ +package com.yunzhupaas.message.service.impl; + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.database.model.superQuery.ConditionJsonModel; +import com.yunzhupaas.database.model.superQuery.SuperQueryConditionModel; +import com.yunzhupaas.entity.*; + +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.message.entity.AccountConfigEntity; +import com.yunzhupaas.message.mapper.AccountConfigMapper; +import com.yunzhupaas.message.model.accountconfig.*; +import com.yunzhupaas.message.service.AccountConfigService; +import cn.hutool.core.util.ObjectUtil; +import com.yunzhupaas.permission.service.AuthorizeService; +import java.lang.reflect.Field; +import com.baomidou.mybatisplus.annotation.TableField; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.beans.factory.annotation.Autowired; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; + +import com.yunzhupaas.util.*; + +import java.util.*; + +/** + * 账号配置功能 + * 版本: V3.2.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2022-08-18 + */ +@Service +public class AccountConfigServiceImpl extends SuperServiceImpl + implements AccountConfigService { + + @Autowired + private AuthorizeService authorizeService; + + @Override + public List getList(AccountConfigPagination accountConfigPagination) { + return getTypeList(accountConfigPagination, accountConfigPagination.getDataType()); + } + + @Override + public List getTypeList(AccountConfigPagination accountConfigPagination, String dataType) { + String userId = UserProvider.getUser().getUserId(); + int total = 0; + int accountConfigNum = 0; + QueryWrapper accountConfigQueryWrapper = new QueryWrapper<>(); + + // 关键字 + if (StringUtil.isNotBlank(accountConfigPagination.getKeyword()) + && !"null".equals(accountConfigPagination.getKeyword())) { + accountConfigNum++; + accountConfigQueryWrapper.lambda() + .and(t -> t.like(AccountConfigEntity::getEnCode, accountConfigPagination.getKeyword()) + .or().like(AccountConfigEntity::getFullName, accountConfigPagination.getKeyword()).or() + .like(AccountConfigEntity::getAddressorName, accountConfigPagination.getKeyword()) + .or().like(AccountConfigEntity::getSmtpUser, accountConfigPagination.getKeyword()).or() + .like(AccountConfigEntity::getSmsSignature, accountConfigPagination.getKeyword())); + } + // webhook类型 + if (ObjectUtil.isNotEmpty(accountConfigPagination.getWebhookType())) { + accountConfigNum++; + accountConfigQueryWrapper.lambda().eq(AccountConfigEntity::getWebhookType, + accountConfigPagination.getWebhookType()); + } + // 渠道 + if (ObjectUtil.isNotEmpty(accountConfigPagination.getChannel())) { + accountConfigNum++; + accountConfigQueryWrapper.lambda().eq(AccountConfigEntity::getChannel, + accountConfigPagination.getChannel()); + } + // 状态 + if (ObjectUtil.isNotEmpty(accountConfigPagination.getEnabledMark())) { + accountConfigNum++; + int enabledMark = Integer.parseInt(accountConfigPagination.getEnabledMark()); + accountConfigQueryWrapper.lambda().eq(AccountConfigEntity::getEnabledMark, enabledMark); + } + // 配置类型 + if (ObjectUtil.isNotEmpty(accountConfigPagination.getType())) { + accountConfigNum++; + accountConfigQueryWrapper.lambda().eq(AccountConfigEntity::getType, accountConfigPagination.getType()); + } + + // 排序 + if (StringUtil.isEmpty(accountConfigPagination.getSidx())) { + accountConfigQueryWrapper.lambda().orderByAsc(AccountConfigEntity::getSortCode) + .orderByDesc(AccountConfigEntity::getCreatorTime) + .orderByDesc(AccountConfigEntity::getLastModifyTime); + } else { + try { + String sidx = accountConfigPagination.getSidx(); + AccountConfigEntity accountConfigEntity = new AccountConfigEntity(); + Field declaredField = accountConfigEntity.getClass().getDeclaredField(sidx); + declaredField.setAccessible(true); + String value = declaredField.getAnnotation(TableField.class).value(); + accountConfigQueryWrapper = "asc".equals(accountConfigPagination.getSort().toLowerCase()) + ? accountConfigQueryWrapper.orderByAsc(value) + : accountConfigQueryWrapper.orderByDesc(value); + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } + } + if (!"1".equals(dataType)) { + if (total > 0 || total == 0) { + Page page = new Page<>(accountConfigPagination.getCurrentPage(), + accountConfigPagination.getPageSize()); + IPage userIPage = this.page(page, accountConfigQueryWrapper); + return accountConfigPagination.setData(userIPage.getRecords(), userIPage.getTotal()); + } else { + List list = new ArrayList(); + return accountConfigPagination.setData(list, list.size()); + } + } else { + return this.list(accountConfigQueryWrapper); + } + } + + @Override + public AccountConfigEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AccountConfigEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(AccountConfigEntity entity) { + this.save(entity); + } + + @Override + public boolean update(String id, AccountConfigEntity entity) { + entity.setId(id); + return this.updateById(entity); + } + + @Override + public void delete(AccountConfigEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + // 子表方法 + + // 列表子表数据方法 + + // 验证表单唯一字段 + @Override + public boolean checkForm(AccountConfigForm form, int i, String type, String id) { + int total = 0; + if (ObjectUtil.isNotEmpty(form.getEnCode())) { + QueryWrapper codeWrapper = new QueryWrapper<>(); + codeWrapper.lambda().eq(AccountConfigEntity::getEnCode, form.getEnCode()); + codeWrapper.lambda().eq(AccountConfigEntity::getType, type); + if (StringUtil.isNotBlank(id) && !"null".equals(id)) { + codeWrapper.lambda().ne(AccountConfigEntity::getId, id); + } + total += (int) this.count(codeWrapper); + } + int c = 0; + if (total > i + c) { + return true; + } + return false; + } + + @Override + public boolean checkGzhId(String gzhId, int i, String type, String id) { + int total = 0; + if (StringUtil.isNotEmpty(gzhId) && !"null".equals(gzhId)) { + QueryWrapper codeWrapper = new QueryWrapper<>(); + codeWrapper.lambda().eq(AccountConfigEntity::getAppKey, gzhId); + codeWrapper.lambda().eq(AccountConfigEntity::getType, type); + if (StringUtil.isNotBlank(id) && !"null".equals(id)) { + codeWrapper.lambda().ne(AccountConfigEntity::getId, id); + } + total += (int) this.count(codeWrapper); + } + int c = 0; + if (total > i + c) { + return true; + } + return false; + } + + @Override + public AccountConfigEntity getInfoByType(String appKey, String type) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AccountConfigEntity::getType, type); + queryWrapper.lambda().eq(AccountConfigEntity::getAppKey, appKey); + return this.getOne(queryWrapper); + } + + @Override + public AccountConfigEntity getInfoByEnCode(String enCode, String type) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AccountConfigEntity::getType, type); + queryWrapper.lambda().eq(AccountConfigEntity::getEnCode, enCode); + return this.getOne(queryWrapper); + } + + @Override + public List getListByType(String type) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AccountConfigEntity::getType, type); + queryWrapper.lambda().eq(AccountConfigEntity::getEnabledMark, 1); + return this.list(queryWrapper); + } + + @Override + public boolean isExistByFullName(String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AccountConfigEntity::getFullName, fullName); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(AccountConfigEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public boolean isExistByEnCode(String enCode, String id, String type) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AccountConfigEntity::getEnCode, enCode); + queryWrapper.lambda().eq(AccountConfigEntity::getType, type); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(AccountConfigEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public ActionResult ImportData(AccountConfigEntity entity) throws DataException { + if (entity != null) { + // if (isExistByFullName(entity.getFullName(), entity.getId())) { + // return ActionResult.fail(MsgCode.EXIST001.get()); + // } + if (isExistByEnCode(entity.getEnCode(), entity.getId(), entity.getType())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + try { + this.save(entity); + } catch (Exception e) { + throw new DataException(MsgCode.IMP003.get()); + } + return ActionResult.success(MsgCode.IMP001.get()); + } + return ActionResult.fail(MsgCode.IMP006.get()); + } + + /** + * 高级查询 + * + * @param conditionModel + * @param entity + * @param num + * @return + */ + public Integer getCondition(SuperQueryConditionModel conditionModel, Object entity, int num) { + QueryWrapper queryWrapper = conditionModel.getObj(); + List queryConditionModels = conditionModel.getConditionList(); + String op = conditionModel.getMatchLogic(); + String tableName = conditionModel.getTableName(); + List useCondition = new ArrayList<>(); + for (ConditionJsonModel queryConditionModel : queryConditionModels) { + if (queryConditionModel.getTableName().equalsIgnoreCase(tableName)) { + if (queryConditionModel.getField().contains("yunzhupaas")) { + String child = queryConditionModel.getField(); + String s1 = child.substring(child.lastIndexOf("yunzhupaas_")).replace("yunzhupaas_", ""); + queryConditionModel.setField(s1); + } + if (queryConditionModel.getField().toLowerCase().startsWith(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX)) { + String child = queryConditionModel.getField(); + String s1 = child.substring(child.indexOf("-") + 1); + queryConditionModel.setField(s1); + } + useCondition.add(queryConditionModel); + } + } + + if (queryConditionModels.size() < 1 || useCondition.size() < 1) { + return num; + } + if (useCondition.size() > 0) { + num += 1; + } + // 处理控件 转换为有效值 + for (ConditionJsonModel queryConditionModel : useCondition) { + String yunzhupaasKey = queryConditionModel.getYunzhupaasKey(); + String fieldValue = queryConditionModel.getFieldValue(); + if (yunzhupaasKey.equals(YunzhupaasKeyConsts.DATE)) { + Long o1 = Long.valueOf(fieldValue); + String startTime = DateUtil.daFormat(o1); + queryConditionModel.setFieldValue(startTime); + } else if (yunzhupaasKey.equals(YunzhupaasKeyConsts.CREATETIME) + || yunzhupaasKey.equals(YunzhupaasKeyConsts.MODIFYTIME)) { + Long o1 = Long.valueOf(fieldValue); + String startTime = DateUtil.daFormatHHMMSS(o1); + queryConditionModel.setFieldValue(startTime); + } else if (yunzhupaasKey.equals(YunzhupaasKeyConsts.CURRORGANIZE)) { + List orgList = JsonUtil.getJsonToList(fieldValue, String.class); + queryConditionModel.setFieldValue(orgList.get(orgList.size() - 1)); + } + } + // 反射获取数据库实际字段 + Class aClass = entity.getClass(); + + queryWrapper.and(tw -> { + for (ConditionJsonModel conditionJsonModel : useCondition) { + String conditionField = conditionJsonModel.getField(); + Field declaredField = null; + try { + declaredField = aClass.getDeclaredField(conditionField); + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } + declaredField.setAccessible(true); + String field = declaredField.getAnnotation(TableField.class).value(); + String fieldValue = conditionJsonModel.getFieldValue(); + String symbol = conditionJsonModel.getSymbol(); + if ("AND".equalsIgnoreCase(op)) { + if (symbol.equals("==")) { + tw.eq(field, fieldValue); + } else if (symbol.equals(">=")) { + tw.ge(field, fieldValue); + } else if (symbol.equals("<=")) { + tw.le(field, fieldValue); + tw.and( + qw -> qw.ne(field, "")); + } else if (symbol.equals(">")) { + tw.gt(field, fieldValue); + } else if (symbol.equals("<")) { + tw.lt(field, fieldValue); + tw.and( + qw -> qw.ne(field, "")); + } else if (symbol.equals("<>")) { + tw.ne(field, fieldValue); + if (StringUtil.isNotEmpty(fieldValue)) { + tw.or( + qw -> qw.isNull(field)); + } + } else if (symbol.equals("like")) { + if (StringUtil.isNotEmpty(fieldValue)) { + tw.like(field, fieldValue); + } else { + tw.isNull(field); + } + } else if (symbol.equals("notLike")) { + if (StringUtil.isNotEmpty(fieldValue)) { + tw.notLike(field, fieldValue); + tw.or( + qw -> qw.isNull(field)); + } else { + tw.isNotNull(field); + } + } + } else { + if (symbol.equals("==")) { + tw.or( + qw -> qw.eq(field, fieldValue)); + } else if (symbol.equals(">=")) { + tw.or( + qw -> qw.ge(field, fieldValue)); + } else if (symbol.equals("<=")) { + tw.or( + qw -> qw.le(field, fieldValue)); + } else if (symbol.equals(">")) { + tw.or( + qw -> qw.gt(field, fieldValue)); + } else if (symbol.equals("<")) { + tw.or( + qw -> qw.lt(field, fieldValue)); + } else if (symbol.equals("<>")) { + tw.or( + qw -> qw.ne(field, fieldValue)); + if (StringUtil.isNotEmpty(fieldValue)) { + tw.or( + qw -> qw.isNull(field)); + } + } else if (symbol.equals("like")) { + if (StringUtil.isNotEmpty(fieldValue)) { + tw.or( + qw -> qw.like(field, fieldValue)); + } else { + tw.or( + qw -> qw.isNull(field)); + } + } else if (symbol.equals("notLike")) { + if (StringUtil.isNotEmpty(fieldValue)) { + tw.or( + qw -> qw.notLike(field, fieldValue)); + tw.or( + qw -> qw.isNull(field)); + } else { + tw.or( + qw -> qw.isNotNull(field)); + } + } + } + } + }); + return num; + } +} diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/ImContentServiceImpl.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/ImContentServiceImpl.java new file mode 100644 index 0000000..01ff27f --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/ImContentServiceImpl.java @@ -0,0 +1,168 @@ +package com.yunzhupaas.message.service.impl; + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yunzhupaas.base.PageModel; +import com.yunzhupaas.message.entity.ImContentEntity; +import com.yunzhupaas.message.entity.ImReplyEntity; +import com.yunzhupaas.message.mapper.ImContentMapper; +import com.yunzhupaas.message.model.ImReplySavaModel; +import com.yunzhupaas.message.service.ImContentService; +import com.yunzhupaas.message.model.ImUnreadNumModel; +import com.yunzhupaas.message.service.ImReplyService; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Optional; + +/** + * 聊天内容 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Service +public class ImContentServiceImpl extends SuperServiceImpl implements ImContentService { + + @Autowired + private ImReplyService imReplyService; + @Override + public List getMessageList(String sendUserId, String receiveUserId, PageModel pageModel) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + //发件人、收件人 + if (!StringUtil.isEmpty(sendUserId) && !StringUtil.isEmpty(receiveUserId)) { + + queryWrapper.lambda().and(wrapper -> { + wrapper.eq(ImContentEntity::getSendUserId, sendUserId); + wrapper.eq(ImContentEntity::getReceiveUserId, receiveUserId); + wrapper.or().eq(ImContentEntity::getSendUserId, receiveUserId); + wrapper.eq(ImContentEntity::getReceiveUserId, sendUserId); + }); + queryWrapper.lambda().and(wrapper -> { + wrapper.isNull(ImContentEntity::getDeleteUserId); + wrapper.or(). ne(ImContentEntity::getDeleteUserId,receiveUserId); +// wrapper.ne(ImContentEntity::getDeleteMark, 1); + }); + + } + //关键字查询 + if (pageModel != null && pageModel.getKeyword() != null) { + queryWrapper.lambda().like(ImContentEntity::getContent, pageModel.getKeyword()); + //排序 + pageModel.setSidx("f_send_time"); + } + + if (StringUtil.isEmpty(pageModel.getSidx())) { + queryWrapper.lambda().orderByDesc(ImContentEntity::getSendTime); + } else { + queryWrapper = "asc".equals(pageModel.getSord().toLowerCase()) ? queryWrapper.orderByAsc(pageModel.getSidx()) : queryWrapper.orderByDesc(pageModel.getSidx()); + } + Page page = new Page<>(pageModel.getPage(), pageModel.getRows()); + IPage iPage = this.page(page, queryWrapper); + return pageModel.setData(iPage.getRecords(), page.getTotal()); + } + + @Override + public List getUnreadList(String receiveUserId) { + List list = this.baseMapper.getUnreadList(receiveUserId); + List list1 = this.baseMapper.getUnreadLists(receiveUserId); + for (ImUnreadNumModel item : list) { + Optional first = list1.stream().filter(q -> q.getSendUserId().equals(item.getSendUserId())).findFirst(); + if(first.isPresent()){ + ImUnreadNumModel defaultItem = first.get(); + item.setDefaultMessage(defaultItem.getDefaultMessage()); + item.setDefaultMessageType(defaultItem.getDefaultMessageType()); + item.setDefaultMessageTime(defaultItem.getDefaultMessageTime()); + } + } + return list; + } + + @Override + public int getUnreadCount(String sendUserId, String receiveUserId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ImContentEntity::getSendUserId, sendUserId).eq(ImContentEntity::getReceiveUserId, receiveUserId).eq(ImContentEntity::getEnabledMark, 0); + return (int) this.count(queryWrapper); + } + + @Override + @DSTransactional + public void sendMessage(String sendUserId, String receiveUserId, String message, String messageType) { + ImContentEntity entity = new ImContentEntity(); + entity.setId(RandomUtil.uuId()); + entity.setSendUserId(sendUserId); + entity.setSendTime(new Date()); + entity.setReceiveUserId(receiveUserId); + entity.setEnabledMark(0); + entity.setContent(message); + entity.setContentType(messageType); + this.save(entity); + + //写入到会话表中 + ImReplySavaModel imReplySavaModel = new ImReplySavaModel(sendUserId, receiveUserId, entity.getSendTime()); + ImReplyEntity imReplyEntity = JsonUtil.getJsonToBean(imReplySavaModel, ImReplyEntity.class); + imReplyService.savaImReply(imReplyEntity); + } + + @Override + public void readMessage(String sendUserId, String receiveUserId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ImContentEntity::getSendUserId, sendUserId); + queryWrapper.lambda().eq(ImContentEntity::getReceiveUserId, receiveUserId); + queryWrapper.lambda().eq(ImContentEntity::getEnabledMark, 0); + List list = this.list(queryWrapper); + for (ImContentEntity entity : list) { + entity.setEnabledMark(1); + entity.setReceiveTime(new Date()); + this.updateById(entity); + } + } + +// @Override +// public ImContentEntity getList(String userId, String receiveUserId) { +// QueryWrapper queryWrapper = new QueryWrapper<>(); +// queryWrapper.lambda().eq(ImContentEntity::getSendUserId, userId) +// .and(t -> t.eq(ImContentEntity::getReceiveUserId, receiveUserId)).orderByDesc(ImContentEntity::getReceiveTime); +// List list = this.list(queryWrapper); +// return list.size() > 0 ? list.get(0) : null; +// } + + + @Override + public boolean deleteChatRecord(String sendUserId, String receiveUserId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().and(t-> { + t.eq(ImContentEntity::getSendUserId, receiveUserId) + .eq(ImContentEntity::getReceiveUserId, sendUserId).or(); + t.eq(ImContentEntity::getReceiveUserId, receiveUserId) + .eq(ImContentEntity::getSendUserId, sendUserId); + }); + List list = this.list(queryWrapper); + for (ImContentEntity entity : list) { + if(entity.getDeleteUserId()!=null){ + if(!entity.getDeleteUserId().equals(sendUserId)) { + entity.setDeleteMark(1); + this.updateById(entity); + } + } + entity.setDeleteUserId(sendUserId); + this.updateById(entity); + } + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(ImContentEntity::getDeleteMark,1); + this.remove(wrapper); + return false; + } +} + diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/ImReplyServiceImpl.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/ImReplyServiceImpl.java new file mode 100644 index 0000000..e280d50 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/ImReplyServiceImpl.java @@ -0,0 +1,154 @@ +package com.yunzhupaas.message.service.impl; + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yunzhupaas.message.entity.ImContentEntity; +import com.yunzhupaas.message.entity.ImReplyEntity; +import com.yunzhupaas.message.mapper.ImReplyMapper; +import com.yunzhupaas.message.model.ImReplyListModel; +import com.yunzhupaas.message.service.ImReplyService; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-05-29 + */ +@Service +public class ImReplyServiceImpl extends SuperServiceImpl implements ImReplyService { + + @Autowired + private UserService userService; + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ImReplyEntity::getUserId, UserProvider.getUser().getUserId()).or() + .eq(ImReplyEntity::getReceiveUserId, UserProvider.getUser().getUserId()) + .orderByDesc(ImReplyEntity::getUserId); + return this.list(); + } + + @Override + public boolean savaImReply(ImReplyEntity entity) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ImReplyEntity::getUserId, entity.getUserId()).eq(ImReplyEntity::getReceiveUserId, entity.getReceiveUserId()); + //判断数据是否存在 + ImReplyEntity imReplyEntity = this.getOne(queryWrapper); + if (imReplyEntity != null) { + entity.setId(imReplyEntity.getId()); + this.updateById(entity); + return true; + } + this.save(entity); + return true; + + } + + @Override + public List getImReplyList() { + List imReplyList = this.baseMapper.getImReplyList(); + List imReplyLists = new ArrayList<>(imReplyList); + // 过滤掉用户id和接收id相同的 + imReplyLists = imReplyList.stream().filter(t ->{ + if(t.getImreplySendDeleteMark() == null){ + return true; + } + return false; + }).collect(Collectors.toList()); +// // 过滤掉用户id和接收id相同的 +// List imReplyListModels = new ArrayList<>(imReplyList); +// for (int i = 0; i < imReplyList.size(); i++) { +// ImReplyListModel imReplyListModel = imReplyList.get(i); +// // 不和自己比 +// imReplyListModels.remove(imReplyList.get(i)); +// List irs = new ArrayList<>(imReplyListModels); +// ImReplyListModel model = irs.stream().filter(t -> t.getUserId().equals(imReplyListModel.getUserId()) && t.getId().equals(imReplyListModel.getId())).findFirst().orElse(null); +// if (model != null) { +// imReplyLists.remove(model); +// } +// } + //我发给别人 + List collect = imReplyLists.stream().filter(t -> t.getUserId().equals(UserProvider.getUser().getUserId())).collect(Collectors.toList()); + //头像替换成对方的 + for (ImReplyListModel imReplyListModel : collect) { + UserEntity entity = userService.getInfo(imReplyListModel.getId()); + imReplyListModel.setHeadIcon(entity != null ? entity.getHeadIcon() : ""); +// imReplyListModel.setSendDeleteMark(imReplyListModel.getSendDeleteMark()); +// imReplyListModel.setImreplySendDeleteMark(imReplyListModel.getImreplySendDeleteMark()); +// imReplyListModel.setDeleteMark(imReplyListModel.getDeleteMark()); + } + //别人发给我 + List list = imReplyLists.stream().filter(t -> t.getId().equals(UserProvider.getUser().getUserId())).collect(Collectors.toList()); + for (ImReplyListModel model : list) { + //移除掉互发的 + List collect1 = collect.stream().filter(t -> t.getId().equals(model.getUserId())).collect(Collectors.toList()); + if (collect1.size() > 0) { + //判断我发给别人的时间和接收的时间大小 + //接收的大于发送的 + if (model.getLatestDate().getTime() > collect1.get(0).getLatestDate().getTime()) { + collect.remove(collect1.get(0)); + } else { //发送的大于接收的则跳过 + continue; + } + } + ImReplyListModel imReplyListModel = new ImReplyListModel(); + UserEntity entity = userService.getInfo(model.getUserId()); + if(entity != null) { + imReplyListModel.setHeadIcon(entity.getHeadIcon()); + imReplyListModel.setUserId(UserProvider.getUser().getUserId()); + imReplyListModel.setId(entity.getId()); + imReplyListModel.setLatestDate(model.getLatestDate()); + imReplyListModel.setLatestMessage(model.getLatestMessage()); + imReplyListModel.setMessageType(model.getMessageType()); + if (model.getImreplySendDeleteMark() != null && !model.getImreplySendDeleteMark().equals(UserProvider.getUser().getUserId())) { + imReplyListModel.setSendDeleteMark(model.getSendDeleteMark()); + imReplyListModel.setImreplySendDeleteMark(model.getImreplySendDeleteMark()); + imReplyListModel.setDeleteMark(model.getDeleteMark()); + } + imReplyListModel.setDeleteUserId(model.getDeleteUserId()); + + collect.add(imReplyListModel); + } + } + return collect; + } + + @Override + public boolean relocation(String sendUserId, String receiveUserId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().and(t-> { + t.eq(ImReplyEntity::getUserId, receiveUserId) + .eq(ImReplyEntity::getReceiveUserId, sendUserId).or(); + t.eq(ImReplyEntity::getReceiveUserId, receiveUserId) + .eq(ImReplyEntity::getUserId, sendUserId); + }); + List list = this.list(queryWrapper); + for (ImReplyEntity entity : list) { + if(entity.getDeleteUserId()!=null){ + if(!entity.getDeleteUserId().equals(sendUserId)) { + entity.setDeleteMark(1); + this.updateById(entity); + } + } + entity.setDeleteUserId(sendUserId); + this.updateById(entity); + } + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(ImReplyEntity::getDeleteMark,1); + this.remove(wrapper); + return false; + } + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/MessageMonitorServiceImpl.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/MessageMonitorServiceImpl.java new file mode 100644 index 0000000..f0b4dfa --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/MessageMonitorServiceImpl.java @@ -0,0 +1,199 @@ +package com.yunzhupaas.message.service.impl; + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.yunzhupaas.message.entity.MessageMonitorEntity; +import com.yunzhupaas.message.mapper.MessageMonitorMapper; +import com.yunzhupaas.message.model.messagemonitor.*; +import com.yunzhupaas.message.service.MessageMonitorService; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import cn.hutool.core.util.ObjectUtil; +import com.yunzhupaas.permission.service.AuthorizeService; +import java.lang.reflect.Field; +import com.baomidou.mybatisplus.annotation.TableField; +import com.yunzhupaas.util.DateUtil; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.beans.factory.annotation.Autowired; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; + +import java.util.*; + +/** + * 消息监控 + * 版本: V3.2.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2022-08-22 + */ +@Service +public class MessageMonitorServiceImpl extends SuperServiceImpl implements MessageMonitorService { + + + + @Autowired + private UserService userService; + + + @Override + public List getList(MessageMonitorPagination messageMonitorPagination) { + return getTypeList(messageMonitorPagination, messageMonitorPagination.getDataType()); + } + + @Override + public List getTypeList(MessageMonitorPagination messageMonitorPagination, String dataType) { + String userId = UserProvider.getUser().getUserId(); + int total = 0; + int messageMonitorNum = 0; + QueryWrapper messageMonitorQueryWrapper = new QueryWrapper<>(); + //关键字 + if (ObjectUtil.isNotEmpty(messageMonitorPagination.getKeyword())) { + messageMonitorNum++; + messageMonitorQueryWrapper.lambda().and(t -> t.like(MessageMonitorEntity::getTitle, messageMonitorPagination.getKeyword())); + } + //消息类型 + if (ObjectUtil.isNotEmpty(messageMonitorPagination.getMessageType())) { + messageMonitorNum++; + messageMonitorQueryWrapper.lambda().eq(MessageMonitorEntity::getMessageType, messageMonitorPagination.getMessageType()); + } + //发送时间 + if (ObjectUtil.isNotEmpty(messageMonitorPagination.getStartTime()) && ObjectUtil.isNotEmpty(messageMonitorPagination.getEndTime())) { + messageMonitorNum++; + + messageMonitorQueryWrapper.lambda().ge(MessageMonitorEntity::getSendTime, new Date(messageMonitorPagination.getStartTime())) + .le(MessageMonitorEntity::getSendTime, new Date(messageMonitorPagination.getEndTime())); + + } + //消息来源 + if (ObjectUtil.isNotEmpty(messageMonitorPagination.getMessageSource())) { + messageMonitorNum++; + messageMonitorQueryWrapper.lambda().eq(MessageMonitorEntity::getMessageSource, messageMonitorPagination.getMessageSource()); + } + //排序 + if (StringUtil.isEmpty(messageMonitorPagination.getSidx())) { + messageMonitorQueryWrapper.lambda().orderByDesc(MessageMonitorEntity::getSendTime); + } else { + try { + String sidx = messageMonitorPagination.getSidx(); + MessageMonitorEntity messageMonitorEntity = new MessageMonitorEntity(); + Field declaredField = messageMonitorEntity.getClass().getDeclaredField(sidx); + declaredField.setAccessible(true); + String value = declaredField.getAnnotation(TableField.class).value(); + messageMonitorQueryWrapper = "asc".equals(messageMonitorPagination.getSort().toLowerCase()) ? messageMonitorQueryWrapper.orderByAsc(value) : messageMonitorQueryWrapper.orderByDesc(value); + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } + } + if (!"1".equals(dataType)) { + if (total > 0 || total == 0) { + Page page = new Page<>(messageMonitorPagination.getCurrentPage(), messageMonitorPagination.getPageSize()); + IPage userIPage = this.page(page, messageMonitorQueryWrapper); + return messageMonitorPagination.setData(userIPage.getRecords(), userIPage.getTotal()); + } else { + List list = new ArrayList(); + return messageMonitorPagination.setData(list, list.size()); + } + } else { + return this.list(messageMonitorQueryWrapper); + } + } + + + @Override + public MessageMonitorEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(MessageMonitorEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(MessageMonitorEntity entity) { + this.save(entity); + } + + @Override + public boolean update(String id, MessageMonitorEntity entity) { + entity.setId(id); + return this.updateById(entity); + } + + @Override + public void delete(MessageMonitorEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + //子表方法 + + //列表子表数据方法 + + + //验证表单唯一字段 + @Override + public boolean checkForm(MessageMonitorForm form, int i) { + int total = 0; + if (total > 0) { + return true; + } + return false; + } + @Override + public void emptyMonitor(){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + this.remove(queryWrapper); + } + + + @Override + @DSTransactional + public boolean delete(String[] ids) { + if (ids.length > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(MessageMonitorEntity::getId, ids); + return this.remove(queryWrapper); + } + return false; + } + /** + * 用户id转名称(多选) + * + * @param ids + * @return + */ + @Override + public String userSelectValues(String ids) { + if (StringUtil.isEmpty(ids)) { + return ids; + } + if (ids.contains("[")){ + List nameList = new ArrayList<>(); + List jsonToList = JsonUtil.getJsonToList(ids, String.class); + for (String userId : jsonToList){ + UserEntity info = userService.getInfo(userId); + nameList.add(Objects.nonNull(info) ? info.getRealName()+ "/" + info.getAccount() : userId); + } + return String.join(";", nameList); + }else { + List userInfoList = new ArrayList<>(); + String[] idList = ids.split(","); + if (idList.length > 0) { + for (String id : idList) { + UserEntity userEntity = userService.getInfo(id); + if (ObjectUtil.isNotEmpty(userEntity)) { + String info = userEntity.getRealName() + "/" + userEntity.getAccount(); + userInfoList.add(info); + } + } + } + return String.join("-", userInfoList); + } + } + + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/MessageServiceImpl.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/MessageServiceImpl.java new file mode 100644 index 0000000..6bf1f06 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/MessageServiceImpl.java @@ -0,0 +1,806 @@ +package com.yunzhupaas.message.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.http.HttpRequest; +import cn.hutool.http.Method; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.entity.DictionaryTypeEntity; +import com.yunzhupaas.base.entity.MessageTemplateEntity; +import com.yunzhupaas.base.service.DictionaryDataService; +import com.yunzhupaas.base.service.DictionaryTypeService; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.base.util.SentMessageUtil; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.flowable.model.trigger.TriggerModel; +import com.yunzhupaas.message.entity.*; +import com.yunzhupaas.message.mapper.MessageMapper; +import com.yunzhupaas.message.model.NoticePagination; +import com.yunzhupaas.message.model.SentMessageForm; +import com.yunzhupaas.message.model.message.NoticeVO; +import com.yunzhupaas.message.model.message.PaginationMessage; +import com.yunzhupaas.message.service.*; +import com.yunzhupaas.message.util.OnlineUserProvider; +import com.yunzhupaas.message.util.PushMessageUtil; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.*; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.text.StringSubstitutor; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.concurrent.Callable; +import java.util.concurrent.Future; +import java.util.stream.Collectors; + +/** + * 消息实例 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Service +@Slf4j +public class MessageServiceImpl extends SuperServiceImpl implements MessageService { + + @Autowired + private MessagereceiveService messagereceiveService; + @Autowired + private MessageMonitorService messageMonitorService; + @Autowired + private RedisUtil redisUtil; + @Autowired + private SentMessageUtil sentMessageUtil; + @Autowired + private SendMessageConfigService sendMessageConfigService; + @Autowired + private SendConfigTemplateService sendConfigTemplateService; + @Autowired + private MessageTemplateConfigService messageTemplateConfigService; + @Autowired + private UserService userService; + @Autowired + private DictionaryTypeService dictionaryTypeService; + @Autowired + private DictionaryDataService dictionaryDataService; + @Autowired + private ConfigValueUtil configValueUtil; + + @Override + public List getNoticeList(NoticePagination pagination) { + // 定义变量判断是否需要使用修改时间倒序 + QueryWrapper queryWrapper = new QueryWrapper<>(); + //关键词(消息标题) + if (!StringUtils.isEmpty(pagination.getKeyword())) { + queryWrapper.lambda().like(MessageEntity::getTitle, pagination.getKeyword()); + } + // 类型 + if (CollectionUtil.isNotEmpty(pagination.getType())) { + queryWrapper.lambda().in(MessageEntity::getCategory, pagination.getType()); + } + // 状态 + if (CollectionUtil.isNotEmpty(pagination.getEnabledMark())) { + queryWrapper.lambda().in(MessageEntity::getEnabledMark, pagination.getEnabledMark()); + } else { + queryWrapper.lambda().and(t -> t.ne(MessageEntity::getEnabledMark, 3) + .or().isNull(MessageEntity::getEnabledMark)); + queryWrapper.lambda().ne(MessageEntity::getEnabledMark, -1); + } + // 发布人 + if (CollectionUtil.isNotEmpty(pagination.getReleaseUser())) { + queryWrapper.lambda().in(MessageEntity::getLastModifyUserId, pagination.getReleaseUser()); + } + // 发布时间 + if (CollectionUtil.isNotEmpty(pagination.getReleaseTime())) { + queryWrapper.lambda().between(MessageEntity::getLastModifyTime, new Date(pagination.getReleaseTime().get(0)), new Date(pagination.getReleaseTime().get(1))); + } + // 失效时间 + if (CollectionUtil.isNotEmpty(pagination.getExpirationTime())) { + queryWrapper.lambda().between(MessageEntity::getExpirationTime, new Date(pagination.getExpirationTime().get(0)), new Date(pagination.getExpirationTime().get(1))); + } + // 创建人 + if (CollectionUtil.isNotEmpty(pagination.getCreatorUser())) { + queryWrapper.lambda().in(MessageEntity::getCreatorUserId, pagination.getCreatorUser()); + } + // 创建时间 + if (CollectionUtil.isNotEmpty(pagination.getCreatorTime())) { + queryWrapper.lambda().between(MessageEntity::getCreatorTime, new Date(pagination.getCreatorTime().get(0)), new Date(pagination.getCreatorTime().get(1))); + } + //默认排序 + queryWrapper.lambda().orderByAsc(MessageEntity::getEnabledMark).orderByDesc(MessageEntity::getLastModifyTime).orderByDesc(MessageEntity::getCreatorTime); + queryWrapper.lambda().select(MessageEntity::getId, MessageEntity::getCreatorUserId, MessageEntity::getEnabledMark, + MessageEntity::getLastModifyTime, MessageEntity::getTitle, MessageEntity::getCreatorTime, + MessageEntity::getLastModifyUserId, MessageEntity::getExpirationTime, MessageEntity::getCategory); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage userIPage = this.page(page, queryWrapper); + return pagination.setData(userIPage.getRecords(), page.getTotal()); + } + + @Override + public List getNoticeList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(MessageEntity::getEnabledMark, 1); + queryWrapper.lambda().orderByAsc(MessageEntity::getSortCode); + return this.baseMapper.selectList(queryWrapper); + } + + @Override + public List getDashboardNoticeList(List typeList) { + List list = new ArrayList<>(16); + // 判断哪些消息是自己接收的 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(MessageReceiveEntity::getUserId, UserProvider.getUser().getUserId()); + queryWrapper.lambda().eq(MessageReceiveEntity::getType, 1); + List receiveEntities = messagereceiveService.list(queryWrapper); + for (int i = 0; i < receiveEntities.size(); i++) { + // 得到message + MessageReceiveEntity messageReceiveEntity = receiveEntities.get(i); + try{ + MessageEntity entity = JsonUtil.getJsonToBean(messageReceiveEntity.getBodyText(), MessageEntity.class); + if (entity != null) { + if (StringUtil.isNotEmpty(entity.getId())) { + MessageEntity messageEntity = this.getInfo(entity.getId()); + if (messageEntity != null) { + if ((typeList != null && typeList.size() > 0 && typeList.contains(messageEntity.getCategory()) || typeList == null || typeList.size() == 0)) { + if (Objects.equals(messageEntity.getEnabledMark(), 1) + && (entity.getExpirationTime() == null || entity.getExpirationTime().getTime() > System.currentTimeMillis())) { + messageEntity.setId(messageReceiveEntity.getId()); + list.add(messageEntity); + } + } + } + }else{ + entity.setId(messageReceiveEntity.getId()); + list.add(entity); + } + } + }catch (Exception e){ + MessageEntity messageEntity = JsonUtil.getJsonToBean(messageReceiveEntity, MessageEntity.class); + list.add(messageEntity); + } + if (list.size() > 49) { + break; + } + } + list = list.stream().sorted(Comparator.comparing(MessageEntity::getLastModifyTime).reversed()).collect(Collectors.toList()); + return list; + } + + @Override + public List getMessageList3(Pagination pagination, Integer type, String user, Integer isRead) { + PaginationMessage paginationMessage = BeanUtil.copyProperties(pagination, PaginationMessage.class); + List messageColumnList = getMessageColumnList(paginationMessage, + MessageReceiveEntity::getId, + MessageReceiveEntity::getUserId, + MessageReceiveEntity::getType, + MessageReceiveEntity::getTitle, + MessageReceiveEntity::getFlowType, + MessageReceiveEntity::getIsRead, + MessageReceiveEntity::getSortCode, + MessageReceiveEntity::getCreatorTime, + MessageReceiveEntity::getCreatorUserId); + return pagination.setData(messageColumnList, paginationMessage.getTotal()); + } + + @Override + public List getMessageColumnList(PaginationMessage pagination, SFunction... columns) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(MessageReceiveEntity::getId); + if (StringUtil.isNotEmpty(pagination.getUserId())) { + queryWrapper.lambda().eq(MessageReceiveEntity::getUserId, pagination.getUserId()); + } else { + queryWrapper.lambda().eq(MessageReceiveEntity::getUserId, UserProvider.getLoginUserId()); + } + if (pagination.getType() != null) { + queryWrapper.lambda().eq(MessageReceiveEntity::getType, pagination.getType()); + } + if (pagination.getIsRead() != null) { + queryWrapper.lambda().eq(MessageReceiveEntity::getIsRead, pagination.getIsRead()); + } + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + queryWrapper.lambda().like(MessageReceiveEntity::getTitle, pagination.getKeyword()); + } + queryWrapper.lambda().orderByDesc(MessageReceiveEntity::getCreatorTime); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage userIPage = messagereceiveService.page(page, queryWrapper); + + List ids = userIPage.getRecords().stream().map(MessageReceiveEntity::getId).collect(Collectors.toList()); + List list = new ArrayList<>(); + if (CollectionUtil.isNotEmpty(ids)) { + QueryWrapper wrapper = new QueryWrapper<>(); + if (columns != null && columns.length > 0) { + wrapper.lambda().select(columns); + } + wrapper.lambda().in(MessageReceiveEntity::getId, ids); + wrapper.lambda().orderByDesc(MessageReceiveEntity::getCreatorTime); + list = messagereceiveService.list(wrapper); + } + return pagination.setData(list, page.getTotal()); + } + + + @Override + public List getMessageList(Pagination pagination) { + return this.getMessageList3(pagination, null, null, null); + } + + @Override + public MessageEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(MessageEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public MessageEntity getInfoDefault(int type) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(MessageEntity::getEnabledMark, 1); + if (type == 1) { + queryWrapper.lambda().orderByDesc(MessageEntity::getCreatorTime); + } else { + queryWrapper.lambda().orderByDesc(MessageEntity::getLastModifyTime); + } + // 只查询id + queryWrapper.lambda().select(MessageEntity::getId, MessageEntity::getTitle, MessageEntity::getCreatorTime); + List list = this.page(new Page<>(1, 1, false), queryWrapper).getRecords(); + MessageEntity entity = new MessageEntity(); + if (list.size() > 0) { + entity = list.get(0); + } + return entity; + } + + @Override + @DSTransactional + public void delete(MessageEntity entity) { + entity.setEnabledMark(-1); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + updateById(entity); + } + + @Override + public void create(MessageEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setBodyText(XSSEscape.escapeImgOnlyBase64(entity.getBodyText())); + entity.setEnabledMark(0); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + this.save(entity); + } + + @Override + public boolean update(String id, MessageEntity entity) { + entity.setId(id); + entity.setBodyText(XSSEscape.escapeImgOnlyBase64(entity.getBodyText())); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + entity.setLastModifyUserId(null); + entity.setLastModifyTime(null); + return this.updateById(entity); + } + + @Override + public MessageReceiveEntity messageRead(String messageId) { + String userId = UserProvider.getUser().getUserId(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(MessageReceiveEntity::getUserId, userId).eq(MessageReceiveEntity::getId, messageId); + MessageReceiveEntity entity = messagereceiveService.getOne(queryWrapper); + if (entity != null) { + entity.setIsRead(1); + messagereceiveService.updateById(entity); + } + return entity; + } + + @Override + @DSTransactional + public void messageRead(List idList) { + String userId = UserProvider.getUser().getUserId(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(MessageReceiveEntity::getId) + .eq(MessageReceiveEntity::getUserId, userId).eq(MessageReceiveEntity::getIsRead, 0); +// queryWrapper.lambda().in(MessageReceiveEntity::getMessageId,idList); + List entitys = messagereceiveService.list(queryWrapper); + if (entitys.size() > 0) { + for (MessageReceiveEntity entity : entitys) { + entity.setIsRead(1); + messagereceiveService.updateById(entity); + } + } + } + + @Override + @DSTransactional + public void deleteRecord(List messageIds) { + // 删除已读表 + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (messageIds.size() > 0) { + queryWrapper.lambda().in(MessageReceiveEntity::getId, messageIds); + } + // 通过id删除无需判断接收人 + queryWrapper.lambda().eq(MessageReceiveEntity::getUserId, UserProvider.getLoginUserId()); + messagereceiveService.remove(queryWrapper); + } + + @Override + public int getUnreadCount(String userId, Integer type) { + int result = this.baseMapper.getUnreadCount(userId, type); + return result; + } + + @Override + public boolean sentNotice(List toUserIds, MessageEntity entity) { + // 存到redis中的key对象 + UserInfo userInfo = UserProvider.getUser(); + List idList = new ArrayList<>(); + // 修改发送状态 + entity.setEnabledMark(1); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(userInfo.getUserId()); + this.updateById(entity); + // 存到redis,生成Redis的key + Callable executeInsert = () -> { + executeInsert(toUserIds, idList); + return true; + }; + Future submit = ThreadPoolExecutorUtil.getExecutor().submit(executeInsert); + try { + if (submit.get()) { + // 执行发送公告操作 + Runnable runnable = () -> executeBatch(idList, entity, userInfo); + ThreadPoolExecutorUtil.getExecutor().submit(runnable); + } + return true; + } catch (Exception e) { + // 还原公告状态 + entity.setEnabledMark(0); + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + this.updateById(entity); + } + return false; + } + + /** + * 数据存到redis中 + * + * @param toUserIds 接受者id + */ + private void executeInsert(List toUserIds, List idList) throws Exception { + List key = new ArrayList<>(); + try { + int frequency = 10000; + int count = toUserIds.size() / frequency + 1; + if (toUserIds.size() < 1) return; + for (int i = 0; i < count; i++) { + // 生成redis的key + String cacheKey = RandomUtil.uuId() + toUserIds.get(i); + // 存到redis + int endSize = Math.min(((i + 1) * frequency), toUserIds.size()); + redisUtil.insert(cacheKey, toUserIds.subList(i * frequency, endSize)); + key.add(cacheKey); + } + } catch (Exception e) { + key.forEach(k -> redisUtil.remove(k)); + key.clear(); + throw new Exception(); + } + idList.addAll(key); + } + + /** + * 执行发送操作 + * + * @param idList 存到redis中的key + * @param entity + * @param userInfo + */ + private void executeBatch(List idList, MessageEntity entity, UserInfo userInfo) { + if (idList.size() == 0 || "3".equals(String.valueOf(entity.getRemindCategory()))) { + return; + } + SentMessageForm sentMessageForm = new SentMessageForm(); + List toUserId = new ArrayList<>(); + for (String cacheKey : idList) { + List cacheValue = (List) redisUtil.get(cacheKey, 0, -1); + toUserId.addAll(cacheValue); + } + sentMessageForm.setToUserIds(toUserId); + sentMessageForm.setTitle(entity.getTitle()); + sentMessageForm.setContent(entity.getBodyText()); + sentMessageForm.setContentMsg(Collections.EMPTY_MAP); + sentMessageForm.setUserInfo(userInfo); + sentMessageForm.setType(1); + sentMessageForm.setId(entity.getId()); + + // 站内信 + if ("1".equals(String.valueOf(entity.getRemindCategory()))) { + message(sentMessageForm); + } else if ("2".equals(String.valueOf(entity.getRemindCategory()))) { + SendMessageConfigEntity sendMessageConfigEntity = sendMessageConfigService.getInfo(entity.getSendConfigId()); + if (sendMessageConfigEntity != null) { + List configTemplateEntityList = sendConfigTemplateService.getDetailListByParentId(sendMessageConfigEntity.getId()); + for (SendConfigTemplateEntity sendConfigTemplateEntity : configTemplateEntityList) { + Map map = new HashMap<>(); + map.put("Title", entity.getTitle()); + map.put("Content", entity.getBodyText()); + map.put("Remark", entity.getExcerpt()); + Map paramMap = new HashMap<>(); + paramMap.put("@title", entity.getTitle()); + paramMap.put("@Content", entity.getBodyText()); + paramMap.put("@Remark", entity.getExcerpt()); + switch (sendConfigTemplateEntity.getMessageType()) { + case "1": + MessageTemplateConfigEntity configEntity = messageTemplateConfigService.getInfo(sendConfigTemplateEntity.getTemplateId()); + if (configEntity != null) { + sentMessageForm.setTitle(configEntity.getTitle()); + } + message(sentMessageForm); + break; + case "2": + // 邮件 + sentMessageUtil.SendMail(toUserId, userInfo, "2", sendConfigTemplateEntity, new HashMap<>(), map); + break; + case "3": + // 发送短信 + sentMessageUtil.sendSms(toUserId, userInfo, sendConfigTemplateEntity, paramMap, new HashMap<>()); + break; + case "4": + // 钉钉 + JSONObject jsonObject1 = sentMessageUtil.SendDingTalk(toUserId, userInfo, "4", sendConfigTemplateEntity, new HashMap<>(), map); + if (!(Boolean) jsonObject1.get("code")) { + log.error("发送企业微信消息失败,错误:" + jsonObject1.get("error")); + } + break; + case "5": + // 企业微信 + JSONObject jsonObject = sentMessageUtil.SendQyWebChat(toUserId, userInfo, "5", sendConfigTemplateEntity, new HashMap<>(), map); + if (!(Boolean) jsonObject.get("code")) { + log.error("发送企业微信消息失败,错误:" + jsonObject.get("error")); + } + break; + case "6": + // webhook + sentMessageUtil.SendWebHook(null, userInfo, sendConfigTemplateEntity, new HashMap<>(), map); + break; + case "7": + // 微信公众号 + sentMessageUtil.SendWXGzhChat(toUserId, userInfo, "7", sendConfigTemplateEntity, new HashMap<>(), paramMap); + break; + default: + break; + } + } + + } + } + } + + + @Override + public void sentMessage(List toUserIds, String title) { + this.sentMessage(toUserIds, title, null); + } + + @Override + @DSTransactional + public void sentMessage(List toUserIds, String title, String bodyText) { + UserInfo userInfo = UserProvider.getUser(); + + MessageReceiveEntity messageReceiveEntity = new MessageReceiveEntity(); + messageReceiveEntity.setTitle(title); + messageReceiveEntity.setType(2); + messageReceiveEntity.setFlowType(1); + messageReceiveEntity.setIsRead(0); + Map map = new HashMap<>(); + for (String item : toUserIds) { + MessageReceiveEntity messageReceiveEntitys = new MessageReceiveEntity(); + BeanUtils.copyProperties(messageReceiveEntity, messageReceiveEntitys); + messageReceiveEntitys.setId(RandomUtil.uuId()); + messageReceiveEntitys.setUserId(item); + messageReceiveEntitys.setBodyText(bodyText); + messagereceiveService.save(messageReceiveEntitys); + map.put(messageReceiveEntitys.getUserId(), messageReceiveEntitys); + } + //消息推送 - PC端 + PushMessageUtil.pushMessage(map, userInfo, 2); + } + + @Override + @DSTransactional + public void sentMessage(List toUserIds, String title, String bodyText, Map contentMsg, UserInfo userInfo) { + MessageReceiveEntity messageReceiveEntity = new MessageReceiveEntity(); + messageReceiveEntity.setTitle(title); + messageReceiveEntity.setType(2); + messageReceiveEntity.setFlowType(1); + messageReceiveEntity.setIsRead(0); + Map map = new HashMap<>(); + for (String item : toUserIds) { + MessageReceiveEntity messageReceiveEntitys = new MessageReceiveEntity(); + BeanUtils.copyProperties(messageReceiveEntity, messageReceiveEntitys); + messageReceiveEntitys.setId(RandomUtil.uuId()); + messageReceiveEntitys.setUserId(item); + String msg = contentMsg.get(item) != null ? contentMsg.get(item) : "{}" ; + messageReceiveEntitys.setBodyText(msg); + messageReceiveEntitys.setCreatorUserId(userInfo.getUserId()); + messageReceiveEntitys.setCreatorTime(new Date()); + messagereceiveService.save(messageReceiveEntitys); + map.put(messageReceiveEntitys.getUserId(), messageReceiveEntitys); + } + + //消息推送 - PC端 + PushMessageUtil.pushMessage(map, userInfo, 2); + } + + @Override + @DSTransactional + public void sentMessage(List toUserIds, String title, String bodyText, UserInfo userInfo, Integer source, Integer type) { + sentMessage(toUserIds, title, bodyText, userInfo, source, type, false); + } + + @Override + @DSTransactional + public void sentMessage(List toUserIds, String title, String bodyText, UserInfo userInfo, Integer source, Integer type, boolean testMessage) { + MessageReceiveEntity messageReceiveEntity = new MessageReceiveEntity(); + messageReceiveEntity.setTitle(title); + messageReceiveEntity.setType(source); + messageReceiveEntity.setFlowType(1); + messageReceiveEntity.setBodyText(bodyText); + messageReceiveEntity.setIsRead(0); + Map map = new HashMap<>(); + for (String item : toUserIds) { + MessageReceiveEntity messageReceiveEntitys = new MessageReceiveEntity(); + BeanUtils.copyProperties(messageReceiveEntity, messageReceiveEntitys); + messageReceiveEntitys.setId(RandomUtil.uuId()); + messageReceiveEntitys.setUserId(item); + messagereceiveService.save(messageReceiveEntitys); + map.put(messageReceiveEntitys.getUserId(), messageReceiveEntitys); + } + //消息监控写入 + MessageMonitorEntity monitorEntity = new MessageMonitorEntity(); + monitorEntity.setId(RandomUtil.uuId()); + monitorEntity.setTitle(title); + monitorEntity.setMessageType(String.valueOf(type)); + monitorEntity.setMessageSource(String.valueOf(source)); + monitorEntity.setReceiveUser(JsonUtil.getObjectToString(toUserIds)); + monitorEntity.setSendTime(DateUtil.getNowDate()); + monitorEntity.setCreatorTime(DateUtil.getNowDate()); + monitorEntity.setCreatorUserId(userInfo.getUserId()); + messageMonitorService.create(monitorEntity); + PushMessageUtil.pushMessage(map, userInfo, source); + } + + @Override + public void sentFlowMessage(List toUserIds, MessageTemplateEntity entity, String content) { + if (entity != null) { + // 消息标题 + String title = entity.getTitle(); + this.sentMessage(toUserIds, title, content); + } + } + + @Override + public void logoutWebsocketByToken(String token, String userId) { + if (StringUtil.isNotEmpty(token)) { + OnlineUserProvider.removeWebSocketByToken(token.split(",")); + } else { + OnlineUserProvider.removeWebSocketByUser(userId); + } + } + + @Override + public List sentScheduleMessage(SentMessageForm sentMessageForm, String type) { + List errList = new ArrayList<>(); + UserInfo userInfo = sentMessageForm.getUserInfo(); + String templateId = sentMessageForm.getTemplateId(); + String title = sentMessageForm.getTitle(); + List toUserIds = sentMessageForm.getToUserIds(); + //获取发送配置详情 + SendMessageConfigEntity configEntity = sendMessageConfigService.getInfoByEnCode(templateId); + if (configEntity != null) { + templateId = configEntity.getId(); + } else { + configEntity = sendMessageConfigService.getInfo(templateId); + } + List list = sendConfigTemplateService.getDetailListByParentId(templateId); + if (configEntity != null) { + for (SendConfigTemplateEntity sendConfigTemplateEntity : list) { + Map objectMap = new HashMap<>(sentMessageForm.getParameterMap()); + Map parameterMap = new HashMap<>(); + for (String key : objectMap.keySet()) { + if (key.contains(sendConfigTemplateEntity.getId())) { + parameterMap.put(key.substring(sendConfigTemplateEntity.getId().length()), objectMap.get(key)); + } + } + parameterMap.putAll(objectMap); + Map contentMsg = new HashMap<>(); + for (String key : parameterMap.keySet()) { + contentMsg.put(key, String.valueOf(parameterMap.get(key))); + } + String sendType = sendConfigTemplateEntity.getMessageType(); + switch (sendType) { + case "1": + MessageTemplateConfigEntity templateConfigEntity = messageTemplateConfigService.getInfo(sendConfigTemplateEntity.getTemplateId()); + String messageTitle = StringUtil.isNotEmpty(templateConfigEntity.getTitle()) ? templateConfigEntity.getTitle() : "" ; + String content = StringUtil.isNotEmpty(templateConfigEntity.getContent()) ? templateConfigEntity.getContent() : "" ; + StringSubstitutor strSubstitutor = new StringSubstitutor(parameterMap, "{", "}"); + messageTitle = strSubstitutor.replace(messageTitle); + content = strSubstitutor.replace(content); + sentMessageForm.setTitle(messageTitle); + sentMessageForm.setContent(content); + // 站内消息 + message(sentMessageForm); + // 通知触发 + String url = configValueUtil.getApiDomain() + "/api/workflow/trigger/MsgExecute"; + TriggerModel model = new TriggerModel(); + model.setUserInfo(userInfo); + model.setId(templateConfigEntity.getId()); + HttpRequest request = HttpRequest.of(url).method(Method.POST).body(JsonUtil.getObjectToString(model)); + request.header(Constants.AUTHORIZATION, userInfo.getToken()); + request.execute().body(); + break; + case "2": + // 邮件 + List mailErrs = sentMessageUtil.SendMail(toUserIds, userInfo, sendType, sendConfigTemplateEntity, new HashMap<>(), contentMsg); + errList.addAll(mailErrs.stream().distinct().collect(Collectors.toList())); + break; + case "3": + // 发送短信 + List smsErrs = sentMessageUtil.sendSms(toUserIds, userInfo, sendConfigTemplateEntity, parameterMap, new HashMap<>()); + errList.addAll(smsErrs.stream().distinct().collect(Collectors.toList())); + break; + case "4": + // 钉钉 + JSONObject jsonObject1 = sentMessageUtil.SendDingTalk(toUserIds, userInfo, sendType, sendConfigTemplateEntity, new HashMap<>(), contentMsg); + if (!(Boolean) jsonObject1.get("code")) { + log.error("发送企业微信消息失败,错误:" + jsonObject1.get("error")); + errList.add("发送钉钉消息失败,错误:" + jsonObject1.get("error")); + } + break; + case "5": + // 企业微信 + JSONObject jsonObject = sentMessageUtil.SendQyWebChat(toUserIds, userInfo, sendType, sendConfigTemplateEntity, new HashMap<>(), contentMsg); + if (!(Boolean) jsonObject.get("code")) { + log.error("发送企业微信消息失败,错误:" + jsonObject.get("error")); + errList.add("发送企业微信消息失败,错误:" + jsonObject.get("error")); + } + break; + case "6": + // webhook + sentMessageUtil.SendWebHook(sendType, userInfo, sendConfigTemplateEntity, new HashMap<>(), contentMsg); + break; + case "7": + // 微信公众号 + JSONObject jsonObject2 = sentMessageUtil.SendWXGzhChat(toUserIds, userInfo, sendType, sendConfigTemplateEntity, new HashMap<>(), parameterMap); + if (!(Boolean) jsonObject2.get("code")) { + errList.add("发送微信公众号消息失败,错误:" + jsonObject2.get("error")); + } + break; + default: + break; + } + } + } + return errList; + } + + @Override + public Boolean updateEnabledMark() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().and(t -> t.eq(MessageEntity::getEnabledMark, 1).lt(MessageEntity::getExpirationTime, new Date())); + List list = this.list(queryWrapper); + list.forEach(t -> { + t.setEnabledMark(2); + this.updateById(t); + }); + return true; + } + + private void message(SentMessageForm sentMessageForm) { + List toUserIds = sentMessageForm.getToUserIds(); + Integer type = sentMessageForm.getType(); + String title = sentMessageForm.getTitle(); + String content = sentMessageForm.getContent(); + String bodyText = Objects.equals(type, 3) ? content : JsonUtil.getObjectToString(sentMessageForm.getContentMsg()); + UserInfo userInfo = sentMessageForm.getUserInfo(); + MessageReceiveEntity messageReceiveEntity = new MessageReceiveEntity(); + messageReceiveEntity.setIsRead(0); + messageReceiveEntity.setId(RandomUtil.uuId()); + messageReceiveEntity.setType(sentMessageForm.getType()); + if (type != null) { + messageReceiveEntity.setId(sentMessageForm.getId()); + messageReceiveEntity.setType(type); + messageReceiveEntity.setCreatorUserId(userInfo.getUserId()); + messageReceiveEntity.setCreatorTime(DateUtil.getNowDate()); + } + //消息监控写入 + MessageMonitorEntity monitorEntity = new MessageMonitorEntity(); + MessageEntity messageEntity = this.getInfo(sentMessageForm.getId()); + if (!"1".equals(String.valueOf(messageReceiveEntity.getType()))) { + monitorEntity.setMessageSource(sentMessageForm.getType() + ""); + messageReceiveEntity.setFlowType(sentMessageForm.getFlowType()); + monitorEntity.setTitle(title); + } else { + monitorEntity.setMessageSource("1"); + title = title.replaceAll("\\{@Title}", messageEntity.getTitle()) + .replaceAll("\\{@CreatorUserName}", userInfo.getUserName()) + .replaceAll("\\{@SendTime}", DateUtil.getNow().substring(11)) + .replaceAll("\\{@Content}", messageEntity.getBodyText()) + .replaceAll("\\{@Remark}", StringUtil.isNotEmpty(messageEntity.getExcerpt()) ? messageEntity.getExcerpt() : ""); + monitorEntity.setTitle(title); + + MessageEntity messageEntity2 = new MessageEntity(); + messageEntity2.setId(messageEntity.getId()); + bodyText = JsonUtil.getObjectToString(messageEntity2); + } + Map map = new HashMap<>(); + for (String item : toUserIds) { + MessageReceiveEntity messageReceiveEntitys = new MessageReceiveEntity(); + BeanUtils.copyProperties(messageReceiveEntity, messageReceiveEntitys); + messageReceiveEntitys.setId(RandomUtil.uuId()); + messageReceiveEntitys.setUserId(item); + messageReceiveEntitys.setTitle(title); +// if(ObjectUtil.isNotEmpty(messageEntity)) { +// messageReceiveEntitys.setTitle(title.replaceAll("\\{@Title}", messageEntity.getTitle()) +// .replaceAll("\\{@CreatorUserName}", userInfo.getUserName()) +// .replaceAll("\\{@Content}", messageEntity.getBodyText()) +// .replaceAll("\\{@Remark}", StringUtil.isNotEmpty(messageEntity.getExcerpt()) ? messageEntity.getExcerpt() : "")); +// } + messageReceiveEntitys.setBodyText(bodyText); + messagereceiveService.save(messageReceiveEntitys); + map.put(messageReceiveEntitys.getUserId(), messageReceiveEntitys); + } + monitorEntity.setId(RandomUtil.uuId()); + monitorEntity.setMessageType("1"); + monitorEntity.setReceiveUser(JsonUtil.getObjectToString(toUserIds)); + monitorEntity.setSendTime(DateUtil.getNowDate()); + monitorEntity.setCreatorTime(DateUtil.getNowDate()); + monitorEntity.setCreatorUserId(userInfo.getUserId()); + monitorEntity.setContent(content); + messageMonitorService.create(monitorEntity); + //消息推送 - PC端 + PushMessageUtil.pushMessage(map, userInfo, type != null ? type : 2); + } + + + public List getNoticeList(List list) { + List dashboardNoticeList = this.getDashboardNoticeList(list); + List userList = userService.getUserName(dashboardNoticeList.stream().map(MessageEntity::getCreatorUserId).collect(Collectors.toList())); + DictionaryTypeEntity dictionaryTypeEntity = dictionaryTypeService.getInfoByEnCode("NoticeType"); + List noticeType = dictionaryDataService.getDicList(dictionaryTypeEntity.getId()); + dashboardNoticeList.forEach(t -> { + // 转换创建人、发布人 + UserEntity user = userList.stream().filter(ul -> ul.getId().equals(t.getCreatorUserId())).findFirst().orElse(null); + t.setCreatorUserId(user != null ? user.getRealName() + "/" + user.getAccount() : ""); + if (t.getEnabledMark() != null && t.getEnabledMark() != 0) { + UserEntity entity = userService.getInfo(t.getLastModifyUserId()); + t.setLastModifyUserId(entity != null ? entity.getRealName() + "/" + entity.getAccount() : ""); + } + DictionaryDataEntity dictionaryDataEntity = noticeType.stream().filter(notice -> notice.getEnCode().equals(t.getCategory())).findFirst().orElse(new DictionaryDataEntity()); + t.setCategory(dictionaryDataEntity.getFullName()); + }); + List jsonToList = new ArrayList<>(); + dashboardNoticeList.forEach(t -> { + NoticeVO vo = JsonUtil.getJsonToBean(t, NoticeVO.class); + vo.setReleaseTime(t.getLastModifyTime() != null ? t.getLastModifyTime().getTime() : null); + vo.setReleaseUser(t.getLastModifyUserId()); + vo.setCreatorUser(t.getCreatorUserId()); + jsonToList.add(vo); + }); + return jsonToList; + } +} + diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/MessageTemplateConfigServiceImpl.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/MessageTemplateConfigServiceImpl.java new file mode 100644 index 0000000..f1c2e14 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/MessageTemplateConfigServiceImpl.java @@ -0,0 +1,494 @@ +package com.yunzhupaas.message.service.impl; + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.database.model.superQuery.ConditionJsonModel; +import com.yunzhupaas.database.model.superQuery.SuperQueryConditionModel; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.message.entity.MessageTemplateConfigEntity; +import com.yunzhupaas.message.entity.SmsFieldEntity; +import com.yunzhupaas.message.entity.TemplateParamEntity; +import com.yunzhupaas.message.mapper.MessageTemplateConfigMapper; +import com.yunzhupaas.message.model.messagetemplateconfig.MessageTemplateConfigForm; +import com.yunzhupaas.message.model.messagetemplateconfig.MessageTemplateConfigPagination; +import com.yunzhupaas.message.model.messagetemplateconfig.TemplateParamModel; +import com.yunzhupaas.message.service.MessageTemplateConfigService; +import com.yunzhupaas.message.service.SmsFieldService; +import com.yunzhupaas.message.service.TemplateParamService; +import cn.hutool.core.util.ObjectUtil; +import com.yunzhupaas.permission.service.AuthorizeService; +import java.lang.reflect.Field; +import com.baomidou.mybatisplus.annotation.TableField; +import com.yunzhupaas.util.DateUtil; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.beans.factory.annotation.Autowired; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; + +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +/** + * 消息模板(新) + * 版本: V3.2.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2022-08-18 + */ +@Service +public class MessageTemplateConfigServiceImpl + extends SuperServiceImpl + implements MessageTemplateConfigService { + + @Autowired + private TemplateParamService templateParamService; + + @Autowired + private SmsFieldService smsFieldService; + + @Override + public List getList(MessageTemplateConfigPagination MessageTemplateConfigPagination) { + return getTypeList(MessageTemplateConfigPagination, MessageTemplateConfigPagination.getDataType()); + } + + @Override + public List getTypeList( + MessageTemplateConfigPagination MessageTemplateConfigPagination, String dataType) { + String userId = UserProvider.getUser().getUserId(); + int total = 0; + int messageTemplateNewNum = 0; + QueryWrapper messageTemplateNewQueryWrapper = new QueryWrapper<>(); + int templateParamNum = 0; + QueryWrapper templateParamQueryWrapper = new QueryWrapper<>(); + int smsFieldNum = 0; + QueryWrapper smsFieldQueryWrapper = new QueryWrapper<>(); + // 关键字 + if (ObjectUtil.isNotEmpty(MessageTemplateConfigPagination.getKeyword())) { + messageTemplateNewNum++; + messageTemplateNewQueryWrapper.lambda().and(t -> t + .like(MessageTemplateConfigEntity::getEnCode, MessageTemplateConfigPagination.getKeyword()).or() + .like(MessageTemplateConfigEntity::getFullName, MessageTemplateConfigPagination.getKeyword())); + } + // 模板类型 + if (ObjectUtil.isNotEmpty(MessageTemplateConfigPagination.getTemplateType())) { + messageTemplateNewNum++; + messageTemplateNewQueryWrapper.lambda().eq(MessageTemplateConfigEntity::getTemplateType, + MessageTemplateConfigPagination.getTemplateType()); + } + // 消息类型 + if (ObjectUtil.isNotEmpty(MessageTemplateConfigPagination.getMessageType())) { + messageTemplateNewNum++; + messageTemplateNewQueryWrapper.lambda().eq(MessageTemplateConfigEntity::getMessageType, + MessageTemplateConfigPagination.getMessageType()); + } + // 消息来源 + if (ObjectUtil.isNotEmpty(MessageTemplateConfigPagination.getMessageSource())) { + messageTemplateNewNum++; + messageTemplateNewQueryWrapper.lambda().eq(MessageTemplateConfigEntity::getMessageSource, + MessageTemplateConfigPagination.getMessageSource()); + } + // 状态 + if (ObjectUtil.isNotEmpty(MessageTemplateConfigPagination.getEnabledMark())) { + messageTemplateNewNum++; + int enabledMark = Integer.parseInt(MessageTemplateConfigPagination.getEnabledMark()); + messageTemplateNewQueryWrapper.lambda().eq(MessageTemplateConfigEntity::getEnabledMark, enabledMark); + } + + // 排序 + if (StringUtil.isEmpty(MessageTemplateConfigPagination.getSidx())) { + messageTemplateNewQueryWrapper.lambda().orderByAsc(MessageTemplateConfigEntity::getSortCode) + .orderByDesc(MessageTemplateConfigEntity::getCreatorTime) + .orderByDesc(MessageTemplateConfigEntity::getLastModifyTime); + } else { + try { + String sidx = MessageTemplateConfigPagination.getSidx(); + MessageTemplateConfigEntity MessageTemplateConfigEntity = new MessageTemplateConfigEntity(); + Field declaredField = MessageTemplateConfigEntity.getClass().getDeclaredField(sidx); + declaredField.setAccessible(true); + String value = declaredField.getAnnotation(TableField.class).value(); + messageTemplateNewQueryWrapper = "asc".equals(MessageTemplateConfigPagination.getSort().toLowerCase()) + ? messageTemplateNewQueryWrapper.orderByAsc(value) + : messageTemplateNewQueryWrapper.orderByDesc(value); + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } + } + if (!"1".equals(dataType)) { + if (total > 0 || total == 0) { + Page page = new Page<>(MessageTemplateConfigPagination.getCurrentPage(), + MessageTemplateConfigPagination.getPageSize()); + IPage userIPage = this.page(page, messageTemplateNewQueryWrapper); + return MessageTemplateConfigPagination.setData(userIPage.getRecords(), userIPage.getTotal()); + } else { + List list = new ArrayList(); + return MessageTemplateConfigPagination.setData(list, list.size()); + } + } else { + return this.list(messageTemplateNewQueryWrapper); + } + } + + @Override + public MessageTemplateConfigEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(MessageTemplateConfigEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public MessageTemplateConfigEntity getInfoByEnCode(String enCode, String messageType) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(MessageTemplateConfigEntity::getEnCode, enCode); + queryWrapper.lambda().eq(MessageTemplateConfigEntity::getMessageType, messageType); + return this.getOne(queryWrapper); + } + + @Override + public void create(MessageTemplateConfigEntity entity) { + this.save(entity); + } + + @Override + public boolean update(String id, MessageTemplateConfigEntity entity) { + entity.setId(id); + return this.updateById(entity); + } + + @Override + public void delete(MessageTemplateConfigEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + + // 子表方法 + @Override + public List getTemplateParamList(String id, + MessageTemplateConfigPagination MessageTemplateConfigPagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TemplateParamEntity::getTemplateId, id); + return templateParamService.list(templateParamService.getChild(MessageTemplateConfigPagination, queryWrapper)); + } + + @Override + public List getTemplateParamList(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TemplateParamEntity::getTemplateId, id); + return templateParamService.list(queryWrapper); + } + + @Override + public List getSmsFieldList(String id, + MessageTemplateConfigPagination MessageTemplateConfigPagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SmsFieldEntity::getTemplateId, id); + return smsFieldService.list(smsFieldService.getChild(MessageTemplateConfigPagination, queryWrapper)); + } + + @Override + public List getSmsFieldList(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SmsFieldEntity::getTemplateId, id); + return smsFieldService.list(queryWrapper); + } + + // 验证表单唯一字段 + @Override + public boolean checkForm(MessageTemplateConfigForm form, int i, String id) { + int total = 0; + if (ObjectUtil.isNotEmpty(form.getEnCode())) { + QueryWrapper codeWrapper = new QueryWrapper<>(); + codeWrapper.lambda().eq(MessageTemplateConfigEntity::getEnCode, form.getEnCode()); + if (StringUtil.isNotBlank(id) && !"null".equals(id)) { + codeWrapper.lambda().ne(MessageTemplateConfigEntity::getId, id); + } + if ((int) this.count(codeWrapper) > i) { + total++; + } + } + if (form.getTemplateParamList() != null) { + } + if (form.getSmsFieldList() != null) { + } + if (total > 0) { + return true; + } + return false; + } + + @Override + public boolean isExistByFullName(String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(MessageTemplateConfigEntity::getFullName, fullName); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(MessageTemplateConfigEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public boolean isExistByEnCode(String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(MessageTemplateConfigEntity::getEnCode, enCode); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(MessageTemplateConfigEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public ActionResult ImportData(MessageTemplateConfigEntity entity) throws DataException { + if (entity != null) { + // if (isExistByFullName(entity.getFullName(), null)) { + // return ActionResult.fail(MsgCode.EXIST001.get()); + // } + if (isExistByEnCode(entity.getEnCode(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + try { + this.save(entity); + } catch (Exception e) { + throw new DataException(MsgCode.IMP003.get()); + } + return ActionResult.success(MsgCode.IMP001.get()); + } + return ActionResult.fail(MsgCode.IMP006.get()); + } + + @Override + public List getParamJson(String id) { + MessageTemplateConfigEntity entity = getInfo(id); + List paramModelList = new ArrayList<>(); + List smsField = new ArrayList<>(); + List paramList = new ArrayList<>(); + if (entity != null) { + if ("3".equals(entity.getMessageType()) || "7".equals(entity.getMessageType())) { + List smsFieldList = smsFieldService.getDetailListByParentId(id); + for (SmsFieldEntity entity1 : smsFieldList) { + if (!"@flowLink".equals(entity1.getField())) { + smsField.add(entity1.getField()); + } + } + List paramFieldList = templateParamService.getDetailListByParentId(id); + for (TemplateParamEntity entity1 : paramFieldList) { + if (smsField.contains(entity1.getField())) { + TemplateParamModel paramModel = new TemplateParamModel(); + paramModel.setTemplateId(entity.getId()); + paramModel.setTemplateCode(entity.getEnCode()); + paramModel.setTemplateType(entity.getTemplateType()); + paramModel.setField(entity1.getField()); + paramModel.setFieldName(entity1.getFieldName()); + paramModel.setId(entity1.getId()); + paramModel.setTemplateName(entity.getFullName()); + paramModelList.add(paramModel); + } + } + } else { + String content = StringUtil.isNotEmpty(entity.getContent()) ? entity.getContent() : ""; + String title = StringUtil.isNotEmpty(entity.getTitle()) ? entity.getTitle() : ""; + Set list = new HashSet<>(); + list.addAll(regexContent(content)); + list.addAll(regexContent(title)); + List paramFieldList = templateParamService.getDetailListByParentId(id); + for (TemplateParamEntity entity1 : paramFieldList) { + TemplateParamModel paramModel = new TemplateParamModel(); + paramModel.setTemplateId(entity.getId()); + paramModel.setTemplateCode(entity.getEnCode()); + paramModel.setTemplateType(entity.getTemplateType()); + paramModel.setField(entity1.getField()); + paramModel.setFieldName(entity1.getFieldName()); + paramModel.setId(entity1.getId()); + paramModel.setTemplateName(entity.getFullName()); + if (list.contains(entity1.getField())) { + if (!"@FlowLink".equals(entity1.getField()) + && !"@CreatorUserName".equals(entity1.getField()) + && !"@SendTime".equals(entity1.getField()) + && !"@Mandator".equals(entity1.getField()) + && !"@Mandatary".equals(entity1.getField())) { + paramModelList.add(paramModel); + } + } + } + } + } + // 将参数模板转为json格式数据 + // String data = JsonUtil.getObjectToString(paramModelList); + return paramModelList; + } + + // 获取消息内容参数 + public List regexContent(String content) { + List list = new ArrayList<>(); + String pattern = "[{]([^}]+)[}]"; + Pattern patternList = Pattern.compile(pattern); + Matcher m = patternList.matcher(content); + while (m.find()) { + String group = m.group().replaceAll("\\{", "").replaceAll("}", ""); + list.add(group); + } + return list; + } + + /** + * 高级查询 + * + * @param conditionModel + * @param entity + * @param num + * @return + */ + public Integer getCondition(SuperQueryConditionModel conditionModel, Object entity, int num) { + QueryWrapper queryWrapper = conditionModel.getObj(); + List queryConditionModels = conditionModel.getConditionList(); + String op = conditionModel.getMatchLogic(); + String tableName = conditionModel.getTableName(); + List useCondition = new ArrayList<>(); + for (ConditionJsonModel queryConditionModel : queryConditionModels) { + if (queryConditionModel.getTableName().equalsIgnoreCase(tableName)) { + if (queryConditionModel.getField().contains("yunzhupaas")) { + String child = queryConditionModel.getField(); + String s1 = child.substring(child.lastIndexOf("yunzhupaas_")).replace("yunzhupaas_", ""); + queryConditionModel.setField(s1); + } + if (queryConditionModel.getField().toLowerCase().startsWith(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX)) { + String child = queryConditionModel.getField(); + String s1 = child.substring(child.indexOf("-") + 1); + queryConditionModel.setField(s1); + } + useCondition.add(queryConditionModel); + } + } + + if (queryConditionModels.size() < 1 || useCondition.size() < 1) { + return num; + } + if (useCondition.size() > 0) { + num += 1; + } + // 处理控件 转换为有效值 + for (ConditionJsonModel queryConditionModel : useCondition) { + String yunzhupaasKey = queryConditionModel.getYunzhupaasKey(); + String fieldValue = queryConditionModel.getFieldValue(); + if (yunzhupaasKey.equals(YunzhupaasKeyConsts.DATE)) { + Long o1 = Long.valueOf(fieldValue); + String startTime = DateUtil.daFormat(o1); + queryConditionModel.setFieldValue(startTime); + } else if (yunzhupaasKey.equals(YunzhupaasKeyConsts.CREATETIME) + || yunzhupaasKey.equals(YunzhupaasKeyConsts.MODIFYTIME)) { + Long o1 = Long.valueOf(fieldValue); + String startTime = DateUtil.daFormatHHMMSS(o1); + queryConditionModel.setFieldValue(startTime); + } else if (yunzhupaasKey.equals(YunzhupaasKeyConsts.CURRORGANIZE)) { + List orgList = JsonUtil.getJsonToList(fieldValue, String.class); + queryConditionModel.setFieldValue(orgList.get(orgList.size() - 1)); + } + } + // 反射获取数据库实际字段 + Class aClass = entity.getClass(); + + queryWrapper.and(tw -> { + for (ConditionJsonModel conditionJsonModel : useCondition) { + String conditionField = conditionJsonModel.getField(); + Field declaredField = null; + try { + declaredField = aClass.getDeclaredField(conditionField); + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } + declaredField.setAccessible(true); + String field = declaredField.getAnnotation(TableField.class).value(); + String fieldValue = conditionJsonModel.getFieldValue(); + String symbol = conditionJsonModel.getSymbol(); + if ("AND".equalsIgnoreCase(op)) { + if (symbol.equals("==")) { + tw.eq(field, fieldValue); + } else if (symbol.equals(">=")) { + tw.ge(field, fieldValue); + } else if (symbol.equals("<=")) { + tw.le(field, fieldValue); + tw.and( + qw -> qw.ne(field, "")); + } else if (symbol.equals(">")) { + tw.gt(field, fieldValue); + } else if (symbol.equals("<")) { + tw.lt(field, fieldValue); + tw.and( + qw -> qw.ne(field, "")); + } else if (symbol.equals("<>")) { + tw.ne(field, fieldValue); + if (StringUtil.isNotEmpty(fieldValue)) { + tw.or( + qw -> qw.isNull(field)); + } + } else if (symbol.equals("like")) { + if (StringUtil.isNotEmpty(fieldValue)) { + tw.like(field, fieldValue); + } else { + tw.isNull(field); + } + } else if (symbol.equals("notLike")) { + if (StringUtil.isNotEmpty(fieldValue)) { + tw.notLike(field, fieldValue); + tw.or( + qw -> qw.isNull(field)); + } else { + tw.isNotNull(field); + } + } + } else { + if (symbol.equals("==")) { + tw.or( + qw -> qw.eq(field, fieldValue)); + } else if (symbol.equals(">=")) { + tw.or( + qw -> qw.ge(field, fieldValue)); + } else if (symbol.equals("<=")) { + tw.or( + qw -> qw.le(field, fieldValue)); + } else if (symbol.equals(">")) { + tw.or( + qw -> qw.gt(field, fieldValue)); + } else if (symbol.equals("<")) { + tw.or( + qw -> qw.lt(field, fieldValue)); + } else if (symbol.equals("<>")) { + tw.or( + qw -> qw.ne(field, fieldValue)); + if (StringUtil.isNotEmpty(fieldValue)) { + tw.or( + qw -> qw.isNull(field)); + } + } else if (symbol.equals("like")) { + if (StringUtil.isNotEmpty(fieldValue)) { + tw.or( + qw -> qw.like(field, fieldValue)); + } else { + tw.or( + qw -> qw.isNull(field)); + } + } else if (symbol.equals("notLike")) { + if (StringUtil.isNotEmpty(fieldValue)) { + tw.or( + qw -> qw.notLike(field, fieldValue)); + tw.or( + qw -> qw.isNull(field)); + } else { + tw.or( + qw -> qw.isNotNull(field)); + } + } + } + } + }); + return num; + } + +} diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/MessagereceiveServiceImpl.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/MessagereceiveServiceImpl.java new file mode 100644 index 0000000..beb3a7d --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/MessagereceiveServiceImpl.java @@ -0,0 +1,23 @@ +package com.yunzhupaas.message.service.impl; + + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yunzhupaas.message.entity.MessageReceiveEntity; +import com.yunzhupaas.message.mapper.MessagereceiveMapper; +import com.yunzhupaas.message.service.MessagereceiveService; +import org.springframework.stereotype.Service; + +/** + * 消息接收 服务实现类 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Service +public class MessagereceiveServiceImpl extends SuperServiceImpl implements MessagereceiveService { + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/SendConfigTemplateServiceImpl.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/SendConfigTemplateServiceImpl.java new file mode 100644 index 0000000..477df91 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/SendConfigTemplateServiceImpl.java @@ -0,0 +1,82 @@ +package com.yunzhupaas.message.service.impl; + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.message.entity.SendConfigTemplateEntity; +import com.yunzhupaas.message.mapper.SendConfigTemplateMapper; +import com.yunzhupaas.message.model.sendmessageconfig.SendMessageConfigPagination; +import com.yunzhupaas.message.service.SendConfigTemplateService; +import com.yunzhupaas.permission.service.AuthorizeService; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; + +import com.yunzhupaas.util.*; + +import java.util.List; + +/** + * 消息发送配置 + * 版本: V3.2.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2022-08-19 + */ +@Service +public class SendConfigTemplateServiceImpl extends SuperServiceImpl implements SendConfigTemplateService { + + @Override + public QueryWrapper getChild(SendMessageConfigPagination pagination, QueryWrapper sendConfigTemplateQueryWrapper) { +// boolean pcPermission = false; +// boolean appPermission = false; +// boolean isPc = ServletUtil.getHeader("yunzhupaas-origin").equals("pc"); +// if (isPc) { +// } + + return sendConfigTemplateQueryWrapper; + } + + @Override + public SendConfigTemplateEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SendConfigTemplateEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public List getDetailListByParentId(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SendConfigTemplateEntity::getSendConfigId, id); + return this.list(queryWrapper); + } + + @Override + public List getConfigTemplateListByConfigId(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SendConfigTemplateEntity::getSendConfigId, id); + queryWrapper.lambda().eq(SendConfigTemplateEntity::getEnabledMark, 1); + return this.list(queryWrapper); + } + + @Override + public boolean isUsedAccount(String accountId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SendConfigTemplateEntity::getAccountConfigId, accountId); + if (this.list(queryWrapper) != null && this.list(queryWrapper).size() > 0) { + return true; + } else { + return false; + } + } + + @Override + public boolean isUsedTemplate(String templateId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SendConfigTemplateEntity::getTemplateId, templateId); + if (this.list(queryWrapper) != null && this.list(queryWrapper).size() > 0) { + return true; + } else { + return false; + } + } +} + diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/SendMessageConfigServiceImpl.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/SendMessageConfigServiceImpl.java new file mode 100644 index 0000000..ddd2eff --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/SendMessageConfigServiceImpl.java @@ -0,0 +1,332 @@ +package com.yunzhupaas.message.service.impl; + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.constant.MsgCode; + +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.message.entity.SendConfigTemplateEntity; +import com.yunzhupaas.message.entity.SendMessageConfigEntity; +import com.yunzhupaas.message.mapper.SendMessageConfigMapper; +import com.yunzhupaas.message.model.sendmessageconfig.*; +import com.yunzhupaas.message.service.SendConfigTemplateService; +import com.yunzhupaas.message.service.SendMessageConfigService; +import com.yunzhupaas.util.RandomUtil; + +import cn.hutool.core.util.ObjectUtil; + +import java.lang.reflect.Field; + +import com.baomidou.mybatisplus.annotation.TableField; + +import java.util.stream.Collectors; + + +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.beans.factory.annotation.Autowired; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; + +import com.yunzhupaas.util.*; + +import java.util.*; + +/** + * 消息发送配置 + * 版本: V3.2.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2022-08-19 + */ +@Service +public class SendMessageConfigServiceImpl extends SuperServiceImpl implements SendMessageConfigService { + + + @Autowired + private SendConfigTemplateService sendConfigTemplateService; + + @Override + public List getList(SendMessageConfigPagination sendMessageConfigPagination, String dataType) { + String userId = UserProvider.getUser().getUserId(); + int total = 0; + int sendMessageConfigNum = 0; + QueryWrapper sendMessageConfigQueryWrapper = new QueryWrapper<>(); + int sendConfigTemplateNum = 0; + QueryWrapper sendConfigTemplateQueryWrapper = new QueryWrapper<>(); + //关键字 + if (ObjectUtil.isNotEmpty(sendMessageConfigPagination.getKeyword())) { + sendMessageConfigNum++; + sendMessageConfigQueryWrapper.lambda().and(t -> t.like(SendMessageConfigEntity::getEnCode, sendMessageConfigPagination.getKeyword()). + or().like(SendMessageConfigEntity::getFullName, sendMessageConfigPagination.getKeyword())); + } + //模板类型 + if (ObjectUtil.isNotEmpty(sendMessageConfigPagination.getTemplateType())) { + sendMessageConfigNum++; + sendMessageConfigQueryWrapper.lambda().eq(SendMessageConfigEntity::getTemplateType, sendMessageConfigPagination.getTemplateType()); + } + //状态 + if (ObjectUtil.isNotEmpty(sendMessageConfigPagination.getEnabledMark())) { + sendMessageConfigNum++; + int enabledMark = Integer.parseInt(sendMessageConfigPagination.getEnabledMark()); + sendMessageConfigQueryWrapper.lambda().eq(SendMessageConfigEntity::getEnabledMark, enabledMark); + } + //消息来源 + if (ObjectUtil.isNotEmpty(sendMessageConfigPagination.getMessageSource())) { + sendMessageConfigNum++; + sendMessageConfigQueryWrapper.lambda().eq(SendMessageConfigEntity::getMessageSource, sendMessageConfigPagination.getMessageSource()); + } + + //排序 + if (StringUtil.isEmpty(sendMessageConfigPagination.getSidx())) { + sendMessageConfigQueryWrapper.lambda().orderByAsc(SendMessageConfigEntity::getSortCode).orderByDesc(SendMessageConfigEntity::getCreatorTime).orderByDesc(SendMessageConfigEntity::getLastModifyTime);; + } else { + try { + String sidx = sendMessageConfigPagination.getSidx(); + SendMessageConfigEntity sendMessageConfigEntity = new SendMessageConfigEntity(); + Field declaredField = sendMessageConfigEntity.getClass().getDeclaredField(sidx); + declaredField.setAccessible(true); + String value = declaredField.getAnnotation(TableField.class).value(); + sendMessageConfigQueryWrapper = "asc".equals(sendMessageConfigPagination.getSort().toLowerCase()) ? sendMessageConfigQueryWrapper.orderByAsc(value) : sendMessageConfigQueryWrapper.orderByDesc(value); + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } + } + if (!"1".equals(dataType)) { + if (total > 0 || total == 0) { + Page page = new Page<>(sendMessageConfigPagination.getCurrentPage(), sendMessageConfigPagination.getPageSize()); + IPage userIPage = this.page(page, sendMessageConfigQueryWrapper); + return sendMessageConfigPagination.setData(userIPage.getRecords(), userIPage.getTotal()); + } else { + List list = new ArrayList(); + return sendMessageConfigPagination.setData(list, list.size()); + } + } else { + return this.list(sendMessageConfigQueryWrapper); + } + } + + @Override + public List getSelectorList(SendMessageConfigPagination sendMessageConfigPagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SendMessageConfigEntity::getMessageSource, 5).eq(SendMessageConfigEntity::getEnabledMark, 1); + queryWrapper.lambda().eq(SendMessageConfigEntity::getTemplateType, 0); + Page page = new Page<>(sendMessageConfigPagination.getCurrentPage(), sendMessageConfigPagination.getPageSize()); + IPage userIPage = this.page(page, queryWrapper); + return sendMessageConfigPagination.setData(userIPage.getRecords(), userIPage.getTotal()); + } + + + @Override + public SendMessageConfigEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SendMessageConfigEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public SendMessageConfigEntity getInfoByEnCode(String enCode){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SendMessageConfigEntity::getEnCode, enCode); + return this.getOne(queryWrapper); + } + + @Override + public SendMessageConfigEntity getSysConfig(String enCode,String type){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SendMessageConfigEntity::getTemplateType, type); + queryWrapper.lambda().eq(SendMessageConfigEntity::getEnCode,enCode); + return this.getOne(queryWrapper); + } + + @Override + public void create(SendMessageConfigEntity entity) { + this.save(entity); + } + + @Override + public boolean update(String id, SendMessageConfigEntity entity) { + entity.setId(id); + return this.updateById(entity); + } + + @Override + public void delete(SendMessageConfigEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + + //子表方法 + @Override + public List getSendConfigTemplateList(String id, SendMessageConfigPagination sendMessageConfigPagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SendConfigTemplateEntity::getSendConfigId, id); + return sendConfigTemplateService.list(sendConfigTemplateService.getChild(sendMessageConfigPagination, queryWrapper)); + } + + @Override + public List getSendConfigTemplateList(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SendConfigTemplateEntity::getSendConfigId, id); + queryWrapper.lambda().orderByDesc(SendConfigTemplateEntity::getSortCode); + return sendConfigTemplateService.list(queryWrapper); + } + + //列表子表数据方法 + + + //验证表单唯一字段 + @Override + public boolean checkForm(SendMessageConfigForm form, int i,String id) { + int total = 0; + if (ObjectUtil.isNotEmpty(form.getEnCode())) { + QueryWrapper enCodeWrapper = new QueryWrapper<>(); + enCodeWrapper.lambda().eq(SendMessageConfigEntity::getEnCode, form.getEnCode()); + if(StringUtil.isNotBlank(id) && !"null".equals(id)) { + enCodeWrapper.lambda().ne(SendMessageConfigEntity::getId, id); + } + if ((int) this.count(enCodeWrapper) > i) { + total++; + } + } + if (form.getSendConfigTemplateList() != null) { + } + if (total > 0) { + return true; + } + return false; + } + + @Override + public boolean isExistByFullName(String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SendMessageConfigEntity::getFullName, fullName); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(SendMessageConfigEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public boolean isExistByEnCode(String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SendMessageConfigEntity::getEnCode, enCode); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(SendMessageConfigEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public ActionResult ImportData(SendMessageConfigEntity entity) throws DataException { + if (entity != null) { +// if (isExistByFullName(entity.getFullName(), null)) { +// return ActionResult.fail(MsgCode.EXIST001.get()); +// } + if (isExistByEnCode(entity.getEnCode(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + try { + this.save(entity); + } catch (Exception e) { + throw new DataException(MsgCode.IMP003.get()); + } + return ActionResult.success(MsgCode.IMP001.get()); + } + return ActionResult.fail(MsgCode.IMP006.get()); + } + @Override + public List getList(List idList){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(SendMessageConfigEntity::getId,idList); + return this.list(queryWrapper); + } + + + public List getIdList(String usedId){ + List idList = new ArrayList<>(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + if(this.list(queryWrapper) != null && this.list(queryWrapper).size()>0){ + idList = this.list(queryWrapper).stream().distinct().map(t->t.getId()).collect(Collectors.toList()); + } + return idList; + } + + @Override + public void updateUsed(String id,List sendConfigIdList){ + UserInfo userInfo = UserProvider.getUser(); + List oldSendConfigList = this.getIdList(id); + if(oldSendConfigList != null && oldSendConfigList.size()>0){ + List subSendConfigIdList = this.subList(oldSendConfigList,sendConfigIdList); + this.removeUsed(id,subSendConfigIdList); + } + if(sendConfigIdList != null && sendConfigIdList.size()>0) { + List sendConfigList = this.getList(sendConfigIdList); + if (sendConfigIdList != null && sendConfigIdList.size() > 0) { +// for (SendMessageConfigEntity entity : sendConfigList) { +// SendConfigRecordEntity recordEntity = new SendConfigRecordEntity(); +// recordEntity = sendConfigRecordService.getRecord(entity.getId(),id); +// if(recordEntity != null){ +// recordEntity.setLastModifyTime(DateUtil.getNowDate()); +// recordEntity.setLastModifyUserId(userInfo.getUserId()); +// sendConfigRecordService.update(recordEntity.getId(),recordEntity); +// }else { +// recordEntity = new SendConfigRecordEntity(); +// recordEntity.setId(RandomUtil.uuId()); +// recordEntity.setSendConfigId(entity.getId()); +// recordEntity.setMessageSource(entity.getMessageSource()); +// recordEntity.setUsedId(id); +// recordEntity.setCreatorTime(DateUtil.getNowDate()); +// recordEntity.setCreatorUserId(userInfo.getUserId()); +// sendConfigRecordService.create(recordEntity); +// } +// } + this.updateBatchById(sendConfigList); + } + } + } + + @Override + public void removeUsed(String id,List sendConfigIdList){ + if(sendConfigIdList != null && sendConfigIdList.size()>0){ + List subConfigList = this.getList(sendConfigIdList); +// if(subConfigList != null && subConfigList.size()>0){ +// for(SendMessageConfigEntity subEntity : subConfigList) { +// SendConfigRecordEntity recordEntity = sendConfigRecordService.getRecord(subEntity.getId(),id); +// if(recordEntity != null){ +// sendConfigRecordService.delete(recordEntity); +// } +// } +// } + this.updateBatchById(subConfigList); + } + } + + @Override + public List subList(List list1, List list2) { + //空间换时间 降低时间复杂度 + Map tempMap = new HashMap<>(); + for(String str:list2){ + tempMap.put(str,str); + } + //LinkedList 频繁添加删除 也可以ArrayList容量初始化为List1.size(),防止数据量过大时频繁扩容以及数组复制 + List resList = new LinkedList<>(); + for(String str:list1){ + if(!tempMap.containsKey(str)){ + resList.add(str); + } + } + return resList; + } + @Override + public boolean idUsed(String id){ + boolean flag = false; + SendMessageConfigEntity entity = this.getInfo(id); + // TODO 删除逻辑重新设置 + return flag; + } + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/ShortLinkServiceImpl.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/ShortLinkServiceImpl.java new file mode 100644 index 0000000..d8f4a24 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/ShortLinkServiceImpl.java @@ -0,0 +1,129 @@ +package com.yunzhupaas.message.service.impl; + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.message.entity.ShortLinkEntity; +import com.yunzhupaas.message.mapper.ShortLInkMapper; +import com.yunzhupaas.message.service.ShortLinkService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + + +import com.yunzhupaas.permission.service.AuthorizeService; + + +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; + +import com.yunzhupaas.util.*; + +import java.security.MessageDigest; +import java.util.*; + +/** + * 消息模板(新) + * 版本: V3.2.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2022-08-18 + */ +@Service +public class ShortLinkServiceImpl extends SuperServiceImpl implements ShortLinkService { + + + @Override + public ShortLinkEntity getInfoByLink(String link){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ShortLinkEntity::getShortLink,link); + return this.getOne(queryWrapper); + } + + + @Override + public String shortLink (String link){ + String shortUrl = null; + if(StringUtil.isNotBlank(link)) { + String[] aResult = shortUrl(link);//将产生4组6位字符串 + // 打印出结果 + Random random = new Random(); + int j = random.nextInt(4);//产成4以内随机数 + shortUrl = aResult[j]; + if(StringUtil.isNotBlank(shortUrl)) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(shortUrl)) { + queryWrapper.lambda().eq(ShortLinkEntity::getShortLink, shortUrl); + } + if (this.list(queryWrapper) != null && this.list(queryWrapper).size() > 0) { + shortUrl = shortUrl + j; + } + } + } + return shortUrl; + } + + + public static String[] shortUrl(String url) { + // 可以自定义生成 MD5 加密字符传前的混合 KEY + String key = "test"; + // 要使用生成 URL 的字符 + String[] chars = new String[] { "a", "b", "c", "d", "e", "f", "g", "h", + "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", + "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", + "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", + "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", + "U", "V", "W", "X", "Y", "Z" + + }; + // 对传入网址进行 MD5 加密 + String hex = md5ByHex(key + url); + + String[] resUrl = new String[4]; + for (int i = 0; i < 4; i++) { + + // 把加密字符按照 8 位一组 16 进制与 0x3FFFFFFF 进行位与运算 + String sTempSubString = hex.substring(i * 8, i * 8 + 8); + + // 这里需要使用 long 型来转换,因为 Inteper .parseInt() 只能处理 31 位 , 首位为符号位 , 如果不用long ,则会越界 + long lHexLong = 0x3FFFFFFF & Long.parseLong(sTempSubString, 16); + String outChars = ""; + for (int j = 0; j < 6; j++) { + // 把得到的值与 0x0000003D 进行位与运算,取得字符数组 chars 索引 + long index = 0x0000003D & lHexLong; + // 把取得的字符相加 + outChars += chars[(int) index]; + // 每次循环按位右移 5 位 + lHexLong = lHexLong >> 5; + } + // 把字符串存入对应索引的输出数组 + resUrl[i] = outChars; + } + return resUrl; + } + /** + * MD5加密(32位大写) + * @param src + * @return + */ + public static String md5ByHex(String src) { + try { + MessageDigest md = MessageDigest.getInstance("MD5"); + byte[] b = src.getBytes(); + md.reset(); + md.update(b); + byte[] hash = md.digest(); + String hs = ""; + String stmp = ""; + for (int i = 0; i < hash.length; i++) { + stmp = Integer.toHexString(hash[i] & 0xFF); + if (stmp.length() == 1) + hs = hs + "0" + stmp; + else { + hs = hs + stmp; + } + } + return hs.toUpperCase(); + } catch (Exception e) { + return ""; + } + } +} + diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/SmsFieldServiceImpl.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/SmsFieldServiceImpl.java new file mode 100644 index 0000000..4d5d965 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/SmsFieldServiceImpl.java @@ -0,0 +1,89 @@ +package com.yunzhupaas.message.service.impl; + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.message.entity.SmsFieldEntity; +import com.yunzhupaas.message.mapper.SmsFieldMapper; +import com.yunzhupaas.message.model.messagetemplateconfig.MessageTemplateConfigPagination; +import com.yunzhupaas.message.service.SmsFieldService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + + +import com.yunzhupaas.permission.service.AuthorizeService; + + +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; + +import com.yunzhupaas.util.*; + +import java.util.*; + +/** + * 消息模板(新) + * 版本: V3.2.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2022-08-18 + */ +@Service +public class SmsFieldServiceImpl extends SuperServiceImpl implements SmsFieldService { + + + @Override + public QueryWrapper getChild(MessageTemplateConfigPagination pagination, QueryWrapper smsFieldQueryWrapper) { +// boolean pcPermission = false; +// boolean appPermission = false; +// boolean isPc = ServletUtil.getHeader("yunzhupaas-origin").equals("pc"); +// if (isPc) { +// } + + return smsFieldQueryWrapper; + } + @Override + public SmsFieldEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SmsFieldEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public List getDetailListByParentId(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SmsFieldEntity::getTemplateId, id); + return this.list(queryWrapper); + } + + @Override + public List getParamList(String id,List params) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SmsFieldEntity::getTemplateId, id); + queryWrapper.lambda().in(SmsFieldEntity::getField,params); + return this.list(queryWrapper); + } + + @Override + public Map getParamMap(String templateId,Map map) { + Map paramMap = new HashMap<>(); + List list = this.getDetailListByParentId(templateId); + if (list != null && list.size() > 0) { + for (SmsFieldEntity entity : list) { + if (map.containsKey(entity.getField())) { + for (String key : map.keySet()) { + if (key.equals(entity.getField())) { + paramMap.put(entity.getSmsField(), map.get(key)); + if(StringUtil.isNotEmpty(String.valueOf(entity.getIsTitle())) &&!"null".equals(String.valueOf(entity.getIsTitle())) && entity.getIsTitle()==1){ + paramMap.put("title",map.get(key)); + } + } + } + if(entity.getField().equals("@FlowLink")){ + paramMap.put(entity.getSmsField(),"@FlowLink"); + } + } + } + } + return paramMap; + } +} + diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/SynThirdDingTalkServiceImpl.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/SynThirdDingTalkServiceImpl.java new file mode 100644 index 0000000..af7f8aa --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/SynThirdDingTalkServiceImpl.java @@ -0,0 +1,3346 @@ +package com.yunzhupaas.message.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.dingtalk.api.response.OapiV2UserListResponse; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.SysConfigEntity; +import com.yunzhupaas.base.service.SysconfigService; +import com.yunzhupaas.message.entity.SynThirdInfoEntity; +import com.yunzhupaas.message.model.message.DingTalkDeptModel; +import com.yunzhupaas.message.model.message.DingTalkUserModel; +import com.yunzhupaas.message.service.SynThirdDingTalkService; +import com.yunzhupaas.message.service.SynThirdInfoService; +import com.yunzhupaas.base.util.SynDingTalkUtil; +import com.yunzhupaas.message.util.SynThirdConsts; +import com.yunzhupaas.model.BaseSystemInfo; +import com.yunzhupaas.permission.entity.OrganizeEntity; +import com.yunzhupaas.permission.entity.PositionEntity; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.entity.UserRelationEntity; +import com.yunzhupaas.permission.service.OrganizeService; +import com.yunzhupaas.permission.service.PositionService; +import com.yunzhupaas.permission.service.UserRelationService; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.util.Assert; + +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 本系统的公司-部门-用户同步到钉钉的功能代码 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021/5/7 8:42 + */ +@Component +public class SynThirdDingTalkServiceImpl implements SynThirdDingTalkService { + @Autowired + private PositionService positionService; + @Autowired + private SysconfigService sysconfigService; + @Autowired + private SynThirdInfoService synThirdInfoService; + @Autowired + private OrganizeService organizeService; + @Autowired + private UserService userService; + + @Autowired + private UserRelationService userRelationService; + + /** + * 获取钉钉的配置信息 + * @return + */ + @Override + public BaseSystemInfo getDingTalkConfig() { + Map objModel = new HashMap<>(); + List configList = sysconfigService.getList("SysConfig"); + for (SysConfigEntity entity : configList) { + objModel.put(entity.getFkey(), entity.getValue()); + } + BaseSystemInfo baseSystemInfo = JsonUtil.getJsonToBean(objModel, BaseSystemInfo.class); + return baseSystemInfo; + } + + //------------------------------------本系统同步公司、部门到钉钉------------------------------------- + + /** + * 根据部门的同步表信息判断同步情况 + * 带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param synThirdInfoEntity + * @param dingDeptList + * @return + */ +// public JSONObject checkDepartmentSysToDing(SynThirdInfoEntity synThirdInfoEntity, List dingDeptList) { +// JSONObject retMsg = new JSONObject(); +// retMsg.put("code",true); +// retMsg.put("flag",""); +// retMsg.put("error",""); +// +// if(synThirdInfoEntity!=null){ +// if(StringUtil.isNotEmpty(synThirdInfoEntity.getThirdObjId())) { +// // 同步表存在钉钉ID,仍需要判断钉钉上有没此部门 +// if(dingDeptList.stream().filter(t -> t.getDeptId().toString().equals(synThirdInfoEntity.getThirdObjId())).count() == 0 ? true : false){ +// retMsg.put("code",false); +// retMsg.put("flag","1"); +// retMsg.put("error","钉钉不存在同步表对应的部门ID!"); +// } +// }else{ +// // 同步表的钉钉ID为空 +// retMsg.put("code",false); +// retMsg.put("flag","2"); +// retMsg.put("error","同步表中部门对应的钉钉ID为空!"); +// } +// }else{ +// // 上级部门未同步 +// retMsg.put("code",false); +// retMsg.put("flag","3"); +// retMsg.put("error","部门未同步到钉钉!"); +// } +// +// return retMsg; +// } + + + /** + * 根据部门的同步表信息判断同步情况 + * 不带错第三方误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param synThirdInfoEntity + * @return + */ + public JSONObject checkDepartmentSysToDing(SynThirdInfoEntity synThirdInfoEntity) { + JSONObject retMsg = new JSONObject(); + retMsg.put("code",true); + retMsg.put("flag",""); + retMsg.put("error",""); + + if(synThirdInfoEntity!=null){ + if("".equals(String.valueOf(synThirdInfoEntity.getThirdObjId())) || "null".equals(String.valueOf(synThirdInfoEntity.getThirdObjId()))) { + // 同步表的钉钉ID为空 + retMsg.put("code",false); + retMsg.put("flag","2"); + retMsg.put("error","同步表中部门对应的钉钉ID为空!"); + } + }else{ + // 上级部门未同步 + retMsg.put("code",false); + retMsg.put("flag","3"); + retMsg.put("error","部门未同步到钉钉!"); + } + + return retMsg; + } + + public JSONObject checkDepartmentSysToDing2(List objectIdList) { + JSONObject retMsg = new JSONObject(); + List thirdIdList = new ArrayList<>(); + retMsg.put("code",true); + retMsg.put("error",""); + + for(String objectId: objectIdList){ + SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG,objectId); + if(synThirdInfoEntity!=null){ + if("".equals(String.valueOf(synThirdInfoEntity.getThirdObjId())) || "null".equals(String.valueOf(synThirdInfoEntity.getThirdObjId()))) { + // 同步表的钉钉ID为空 + retMsg.put("code",false); + retMsg.put("flag","2"); + retMsg.put("error","同步表中部门对应的钉钉ID为空!"); + return retMsg; + } + }else{ + // 上级部门未同步 + retMsg.put("code",false); + retMsg.put("flag","3"); + retMsg.put("error","部门未同步到钉钉!"); + return retMsg; + } + thirdIdList.add(synThirdInfoEntity.getThirdObjId()); + } + retMsg.put("flag",thirdIdList.stream().collect(Collectors.joining(","))); + return retMsg; + } + + + /** + * 检查部门名称不能含有特殊字符 + * @param deptName + * @param opType + * @param synThirdInfoEntity + * @param thirdType + * @param dataType + * @param sysObjId + * @param thirdObjId + * @param deptFlag + * @return + */ + public JSONObject checkDeptName(String deptName, String opType, SynThirdInfoEntity synThirdInfoEntity, Integer thirdType, + Integer dataType, String sysObjId, String thirdObjId, String deptFlag){ + JSONObject retMsg = new JSONObject(); + retMsg.put("code",true); + retMsg.put("error",""); + if(deptName.indexOf("-")>-1 || deptName.indexOf(",")>-1 || deptName.indexOf(",")>-1){ + // 同步失败 + Integer synState = SynThirdConsts.SYN_STATE_FAIL; + String description = deptFlag + "部门名称不能含有,、,、-三种特殊字符"; + + // 更新同步表 + saveSynThirdInfoEntity(opType,synThirdInfoEntity,thirdType,dataType,sysObjId,thirdObjId,synState,description); + + retMsg.put("code", false); + retMsg.put("error", description); + } + return retMsg; + } + + + /** + * 将组织、用户的信息写入同步表 + * @param opType "add":创建 “upd”:修改 + * @param synThirdInfoEntity 本地同步表信息 + * @param thirdType 第三方类型 + * @param dataType 数据类型 + * @param sysObjId 本地对象ID + * @param thirdObjId 第三方对象ID + * @param synState 同步状态(0:未同步;1:同步成功;2:同步失败) + * @param description + */ + public void saveSynThirdInfoEntity(String opType, SynThirdInfoEntity synThirdInfoEntity, Integer thirdType, + Integer dataType, String sysObjId, String thirdObjId, Integer synState, + String description) { + UserInfo userInfo = UserProvider.getUser(); + SynThirdInfoEntity entity = new SynThirdInfoEntity(); + String compValue = SynThirdConsts.OBJECT_OP_ADD; + if(compValue.equals(opType)) { + entity.setId(RandomUtil.uuId()); + entity.setThirdType(thirdType); + entity.setDataType(dataType); + entity.setSysObjId(sysObjId); + entity.setThirdObjId(thirdObjId); + entity.setEnabledMark(synState); + // 备注当作同步失败信息来用 + entity.setDescription(description); + entity.setCreatorUserId(userInfo.getUserId()); + entity.setCreatorTime(DateUtil.getNowDate()); + entity.setLastModifyUserId(userInfo.getUserId()); + // 修改时间当作最后同步时间来用 + entity.setLastModifyTime(DateUtil.getNowDate()); + synThirdInfoService.create(entity); + }else{ + entity = synThirdInfoEntity; + entity.setThirdType(thirdType); + entity.setDataType(dataType); + entity.setThirdObjId(thirdObjId); + entity.setEnabledMark(synState); + // 备注当作同步失败信息来用 + entity.setDescription(description); + entity.setLastModifyUserId(userInfo.getUserId()); + // 修改时间当作最后同步时间来用 + entity.setLastModifyTime(DateUtil.getNowDate()); + synThirdInfoService.update(entity.getId(), entity); + } + } + + + /** + * 往钉钉创建组织-部门 + * 带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param dingDeptListPara 单条执行时为null + * @return + */ +// @Override +// public JSONObject createDepartmentSysToDing(boolean isBatch, OrganizeEntity deptEntity, List dingDeptListPara) { +// BaseSystemInfo config = getDingTalkConfig(); +// String corpId = config.getDingSynAppKey(); +// String corpSecret = config.getDingSynAppSecret(); +// String compValue = SynThirdConsts.OBJECT_TYPE_COMPANY; +// // 单条记录执行时,受开关限制 +// int dingIsSyn = isBatch ? 1 : config.getDingSynIsSynOrg(); +// JSONObject tokenObject = new JSONObject(); +// String access_token = ""; +// JSONObject retMsg = new JSONObject(); +// DingTalkDeptModel deptModel = new DingTalkDeptModel(); +// List dingDeptList = new ArrayList<>(); +// String thirdObjId = ""; +// Integer synState = 0; +// String description = ""; +// boolean isDeptDiff = true; +// String deptFlag = "创建:"; +// +// // 返回值初始化 +// retMsg.put("code", true); +// retMsg.put("error", "创建:系统未设置单条同步"); +// +// // 支持同步 +// if(dingIsSyn==1){ +// // 获取 access_token 值 +// tokenObject = SynDingTalkUtil.getAccessToken(corpId, corpSecret); +// access_token = tokenObject.getString("access_token"); +// +// if (access_token != null && !"".equals(access_token)) { +// // 获取钉钉上的所有部门列表信息 +// if(isBatch){ +// dingDeptList = dingDeptListPara; +// }else { +// JSONObject deptObject = SynDingTalkUtil.getDepartmentList(SynThirdConsts.DING_ROOT_DEPT_ID, access_token); +// if (deptObject.getBoolean("code")) { +// dingDeptList = JsonUtil.getJsonToList(deptObject.getObject("department", List.class), DingTalkDeptModel.class); +// } else { +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + "获取钉钉的部门列表信息失败"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// +// // 更新同步表 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_ADD, null, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG), deptEntity.getId(), thirdObjId, synState, description); +// +// return retMsg; +// } +// } +// +// deptModel.setDeptId(null); +// deptModel.setName(deptEntity.getFullName()); +// // 从本地数据库的同步表获取对应的钉钉ID,为空报异常,不为空再验证所获取接口部门列表是否当前ID 未处理 +// if(compValue.equals(deptEntity.getCategory()) && "-1".equals(deptEntity.getParentId())){ +// //顶级节点时,钉钉的父节点设置为1 +// deptModel.setParentId(SynThirdConsts.DING_ROOT_DEPT_ID); +// }else{ +// SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getParentId()); +// +// retMsg = checkDepartmentSysToDing(synThirdInfoEntity,dingDeptList); +// isDeptDiff = retMsg.getBoolean("code"); +// if(isDeptDiff) { +// deptModel.setParentId(Long.parseLong(synThirdInfoEntity.getThirdObjId())); +// } +// } +// deptModel.setOrder(deptEntity.getSortCode()); +// deptModel.setCreateDeptGroup(false); +// +// // 创建时:部门名称不能带有特殊字符 +// retMsg = checkDeptName(deptEntity.getFullName(),SynThirdConsts.OBJECT_OP_ADD,null, +// Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING),Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// if(isDeptDiff) { +// if(dingIsSyn==1) { +// // 往钉钉写入公司或部门 +// retMsg = SynDingTalkUtil.createDepartment(deptModel, access_token); +// +// // 往同步写入本系统与第三方的对应信息 +// if (retMsg.getBoolean("code")) { +// // 同步成功 +// thirdObjId = retMsg.getString("retDeptId"); +// retMsg.put("retDeptId", thirdObjId); +// synState = SynThirdConsts.SYN_STATE_OK; +// } else { +// // 同步失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + retMsg.getString("error"); +// } +// }else{ +// // 未设置单条同步,归并到未同步状态 +// // 未同步 +// synState = SynThirdConsts.SYN_STATE_NO; +// description = deptFlag + "系统未设置单条同步"; +// +// retMsg.put("code", true); +// retMsg.put("error", description); +// retMsg.put("retDeptId", "0"); +// } +// }else{ +// // 同步失败,上级部门无对应的钉钉ID +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + "部门所属的上级部门未同步到钉钉"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// retMsg.put("retDeptId", "0"); +// } +// +// }else{ +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + "access_token值为空,不能同步信息"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// retMsg.put("retDeptId", "0"); +// } +// +// } +// +// // 更新同步表 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_ADD,null,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,synState,description); +// +// return retMsg; +// } + + + /** + * 往钉钉更新组织-部门 + * 带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param dingDeptListPara 单条执行时为null + * @return + */ +// @Override +// public JSONObject updateDepartmentSysToDing(boolean isBatch, OrganizeEntity deptEntity, List dingDeptListPara) { +// BaseSystemInfo config = getDingTalkConfig(); +// String corpId = config.getDingSynAppKey(); +// String corpSecret = config.getDingSynAppSecret(); +// String compValue = SynThirdConsts.OBJECT_TYPE_COMPANY; +// // 单条记录执行时,受开关限制 +// int dingIsSyn = isBatch ? 1 : config.getDingSynIsSynOrg(); +// JSONObject tokenObject = new JSONObject(); +// String access_token = ""; +// JSONObject retMsg = new JSONObject(); +// DingTalkDeptModel deptModel = new DingTalkDeptModel(); +// List dingDeptList = new ArrayList<>(); +// SynThirdInfoEntity synThirdInfoEntity = new SynThirdInfoEntity(); +// String opType = ""; +// Integer synState = 0; +// String description = ""; +// String thirdObjId = ""; +// SynThirdInfoEntity synThirdInfoPara = new SynThirdInfoEntity(); +// boolean isDeptDiff = true; +// String deptFlag = "更新:"; +// +// // 返回值初始化 +// retMsg.put("code", true); +// retMsg.put("error", "系统未设置单条同步"); +// +// // 支持同步,设置需要同步到钉钉的对象属性值 +// if(dingIsSyn==1) { +// // 获取 access_token +// tokenObject = SynDingTalkUtil.getAccessToken(corpId, corpSecret); +// access_token = tokenObject.getString("access_token"); +// +// // 获取同步表信息 +// synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getId()); +// +// if (access_token != null && !"".equals(access_token)) { +// // 获取钉钉上的所有部门列表信息 +// if(isBatch){ +// dingDeptList = dingDeptListPara; +// }else { +// JSONObject deptObject = SynDingTalkUtil.getDepartmentList(SynThirdConsts.DING_ROOT_DEPT_ID, access_token); +// if (deptObject.getBoolean("code")) { +// dingDeptList = JsonUtil.getJsonToList(deptObject.getObject("department", List.class), DingTalkDeptModel.class); +// } else { +// if (synThirdInfoEntity != null) { +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// } else { +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + "获取钉钉的部门列表信息失败"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// +// // 更新同步表 +// saveSynThirdInfoEntity(opType, synThirdInfoPara, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG), deptEntity.getId(), thirdObjId, synState, description); +// +// return retMsg; +// } +// } +// +// deptModel.setDeptId(null); +// deptModel.setName(deptEntity.getFullName()); +// // 从本地数据库的同步表获取对应的钉钉ID,为空报异常,不为空再验证所获取接口部门列表是否当前ID 未处理 +// if(compValue.equals(deptEntity.getCategory()) && "-1".equals(deptEntity.getParentId())){ +// //顶级节点时,钉钉的父节点设置为1 +// deptModel.setParentId(SynThirdConsts.DING_ROOT_DEPT_ID); +// } else { +// // 判断上级部门的合法性 +// synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getParentId()); +// retMsg = checkDepartmentSysToDing(synThirdInfoEntity, dingDeptList); +// isDeptDiff = retMsg.getBoolean("code"); +// if (isDeptDiff) { +// deptModel.setParentId(Long.parseLong(synThirdInfoEntity.getThirdObjId())); +// } +// } +// deptModel.setOrder(deptEntity.getSortCode()); +// +// // 上级部门检查是否异常 +// if(isDeptDiff){ +// // 获取同步表信息 +// synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getId()); +// +// // 判断当前部门对应的第三方的合法性 +// retMsg = checkDepartmentSysToDing(synThirdInfoEntity, dingDeptList); +// if (!retMsg.getBoolean("code")) { +// if ("3".equals(retMsg.getString("flag")) || "1".equals(retMsg.getString("flag"))) { +// // flag:3 未同步,需要创建同步到钉钉、写入同步表 +// // flag:1 已同步但第三方上没对应的ID,需要删除原来的同步信息,再创建同步到钉钉、写入同步表 +// if("1".equals(retMsg.getString("flag"))) { +// synThirdInfoService.delete(synThirdInfoEntity); +// } +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// +// // 创建时:部门名称不能带有特殊字符 +// retMsg = checkDeptName(deptEntity.getFullName(), +// opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 往钉钉写入公司或部门 +// retMsg = SynDingTalkUtil.createDepartment(deptModel, access_token); +// +// // 往同步写入本系统与第三方的对应信息 +// if(retMsg.getBoolean("code")) { +// // 同步成功 +// thirdObjId = retMsg.getString("retDeptId"); +// retMsg.put("retDeptId", thirdObjId); +// synState = SynThirdConsts.SYN_STATE_OK; +// description = ""; +// }else{ +// // 同步失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + retMsg.getString("error"); +// } +// } +// +// if ("2".equals(retMsg.getString("flag"))) { +// // flag:2 已同步但第三方ID为空,需要创建同步到钉钉、修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = ""; +// +// // 创建时:部门名称不能带有特殊字符 +// retMsg = checkDeptName(deptEntity.getFullName(), +// opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 往钉钉写入公司或部门 +// retMsg = SynDingTalkUtil.createDepartment(deptModel, access_token); +// +// // 往同步表更新本系统与第三方的对应信息 +// if (retMsg.getBoolean("code")) { +// // 同步成功 +// thirdObjId = retMsg.getString("retDeptId"); +// retMsg.put("retDeptId", thirdObjId); +// synState = SynThirdConsts.SYN_STATE_OK; +// description = ""; +// } else { +// // 同步失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + retMsg.getString("error"); +// } +// } +// +// } else { +// // 更新同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// +// // 部门名称不能带有特殊字符 +// retMsg = checkDeptName(deptEntity.getFullName(), +// opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 往钉钉写入公司或部门 +// deptModel.setDeptId(Long.parseLong(synThirdInfoEntity.getThirdObjId())); +// +// // 设置部门主管:只有在更新时才可以执行 +// // 初始化时:组织同步=>用户同步=>组织同步(用来更新部门主管的) +// if(StringUtil.isNotEmpty(deptEntity.getManager())){ +// SynThirdInfoEntity userThirdInfo = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_USER,deptEntity.getManager()); +// if(userThirdInfo!=null){ +// if(StringUtil.isNotEmpty(userThirdInfo.getThirdObjId())) { +// deptModel.setDeptManagerUseridList(userThirdInfo.getThirdObjId()); +// } +// } +// } +// +// retMsg = SynDingTalkUtil.updateDepartment(deptModel, access_token); +// +// // 往同步表更新本系统与第三方的对应信息 +// if (retMsg.getBoolean("code")) { +// // 同步成功 +// synState = SynThirdConsts.SYN_STATE_OK; +// description = ""; +// } else { +// // 同步失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + retMsg.getString("error"); +// } +// } +// }else{ +// // 同步失败,上级部门检查有异常 +// if(synThirdInfoEntity!=null){ +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// }else{ +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + "上级部门无对应的钉钉ID"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// } +// +// }else{ +// // 同步失败 +// if(synThirdInfoEntity!=null){ +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// }else{ +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + "access_token值为空,不能同步信息"; +// +// retMsg.put("code", true); +// retMsg.put("error", description); +// } +// +// }else{ +// // 未设置单条同步,归并到未同步状态 +// // 获取同步表信息 +// synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getId()); +// if(synThirdInfoEntity!=null){ +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// }else{ +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// +// synState = SynThirdConsts.SYN_STATE_NO; +// description = deptFlag + "系统未设置单条同步"; +// +// retMsg.put("code", true); +// retMsg.put("error", description); +// } +// +// // 更新同步表 +// saveSynThirdInfoEntity(opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,synState,description); +// +// return retMsg; +// } + + + /** + * 往钉钉删除组织-部门 + * 带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param id 本系统的公司或部门ID + * @param dingDeptListPara 单条执行时为null + * @return + */ +// @Override +// public JSONObject deleteDepartmentSysToDing(boolean isBatch, String id, List dingDeptListPara) { +// BaseSystemInfo config = getDingTalkConfig(); +// String corpId = config.getDingSynAppKey(); +// String corpSecret = config.getDingSynAppSecret(); +// // 单条记录执行时,受开关限制 +// int dingIsSyn = isBatch ? 1 : config.getDingSynIsSynOrg(); +// JSONObject tokenObject = new JSONObject(); +// String access_token = ""; +// JSONObject retMsg = new JSONObject(); +// List dingDeptList = new ArrayList<>(); +// SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG,id); +// String deptFlag = "删除:"; +// +// // 返回值初始化 +// retMsg.put("code", true); +// retMsg.put("error", "系统未设置单条同步"); +// +// // 支持同步 +// if(synThirdInfoEntity!=null) { +// if(dingIsSyn==1){ +// // 获取 access_token +// tokenObject = SynDingTalkUtil.getAccessToken(corpId, corpSecret); +// access_token = tokenObject.getString("access_token"); +// +// if (access_token != null && !"".equals(access_token)) { +// // 获取钉钉上的所有部门列表信息 +// if(isBatch){ +// dingDeptList = dingDeptListPara; +// }else{ +// JSONObject deptObject = SynDingTalkUtil.getDepartmentList(SynThirdConsts.DING_ROOT_DEPT_ID,access_token); +// if(deptObject.getBoolean("code")) { +// dingDeptList = JsonUtil.getJsonToList(deptObject.getObject("department", List.class), DingTalkDeptModel.class); +// }else{ +// // 同步失败,获取部门列表失败 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, deptFlag + "获取企业微信的部门列表信息失败"); +// +// retMsg.put("code", false); +// retMsg.put("error", deptFlag + "获取钉钉的部门列表信息失败"); +// return retMsg; +// } +// } +// +// // 删除钉钉对应的部门 +// if (dingDeptList.stream().filter(t -> t.getDeptId().toString().equals(synThirdInfoEntity.getThirdObjId())).count() > 0 ? true : false) { +// retMsg = SynDingTalkUtil.deleteDepartment(Long.parseLong(synThirdInfoEntity.getThirdObjId()), access_token); +// if (retMsg.getBoolean("code")) { +// // 同步成功,直接删除同步表记录 +// synThirdInfoService.delete(synThirdInfoEntity); +// } else { +// // 同步失败 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, deptFlag + retMsg.getString("error")); +// } +// }else{ +// // 根据钉钉ID找不到相应的信息,直接删除同步表记录 +// synThirdInfoService.delete(synThirdInfoEntity); +// } +// }else{ +// // 同步失败 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, deptFlag + "access_token值为空,不能同步信息"); +// +// retMsg.put("code", false); +// retMsg.put("error", deptFlag + "access_token值为空,不能同步信息!"); +// } +// +// }else{ +// // 未设置单条同步,归并到未同步状态 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_NO, deptFlag + "系统未设置单条同步"); +// +// retMsg.put("code", true); +// retMsg.put("error", deptFlag + "系统未设置单条同步"); +// } +// } +// +// return retMsg; +// } + + + /** + * 往钉钉创建组织-部门 + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param accessToken (单条调用时为空) + * @return + */ + @Override + public JSONObject createDepartmentSysToDing(boolean isBatch, OrganizeEntity deptEntity,String accessToken) { + BaseSystemInfo config = getDingTalkConfig(); + String corpId = config.getDingSynAppKey(); + String corpSecret = config.getDingSynAppSecret(); + String compValue = SynThirdConsts.OBJECT_TYPE_COMPANY; + // 单条记录执行时,受开关限制 + int dingIsSyn = isBatch ? 1 : config.getDingSynIsSynOrg(); + JSONObject tokenObject = new JSONObject(); + String access_token = ""; + JSONObject retMsg = new JSONObject(); + DingTalkDeptModel deptModel = new DingTalkDeptModel(); + String thirdObjId = ""; + Integer synState = 0; + String description = ""; + boolean isDeptDiff = true; + String deptFlag = "创建:"; + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", "创建:系统未设置单条同步"); + + // 支持同步 + if(isBatch || dingIsSyn==1){ + // 获取 access_token 值 + if(isBatch) { + access_token = accessToken; + }else{ + List synThirdInfoList = synThirdInfoService.syncThirdInfoByType(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG, SynThirdConsts.THIRD_TYPE_DING_To_Sys); + tokenObject = SynDingTalkUtil.getAccessToken(corpId, corpSecret); + access_token = tokenObject.getString("access_token"); + } + + if (access_token != null && !"".equals(access_token)) { + deptModel.setDeptId(null); + deptModel.setName(deptEntity.getFullName()); + // 从本地数据库的同步表获取对应的钉钉ID,为空报异常,不为空再验证所获取接口部门列表是否当前ID 未处理 + if(compValue.equals(deptEntity.getCategory()) && "-1".equals(deptEntity.getParentId())){ + //顶级节点时,钉钉的父节点设置为1 + deptModel.setParentId(SynThirdConsts.DING_ROOT_DEPT_ID); + }else{ + SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getParentId()); + + retMsg = checkDepartmentSysToDing(synThirdInfoEntity); + isDeptDiff = retMsg.getBoolean("code"); + if(isDeptDiff) { + deptModel.setParentId(Long.parseLong(synThirdInfoEntity.getThirdObjId())); + } + } + deptModel.setOrder(deptEntity.getSortCode()); + deptModel.setCreateDeptGroup(false); + if("company".equals(deptEntity.getCategory())){ + deptModel.setSourceIdentifier("company"); + }else{ + deptModel.setSourceIdentifier("department"); + } + + + // 创建时:部门名称不能带有特殊字符 + retMsg = checkDeptName(deptEntity.getFullName(),SynThirdConsts.OBJECT_OP_ADD,null, + Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING),Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); + if (!retMsg.getBoolean("code")) { + return retMsg; + } + + if(isDeptDiff) { + if(isBatch || dingIsSyn==1) { + // 往钉钉写入公司或部门 + if(!"-1".equals(deptEntity.getParentId())){ + retMsg = SynDingTalkUtil.createDepartment(deptModel, access_token); + }else{ + retMsg.put("code", true); + retMsg.put("error", "顶级不同步,默认值id1"); + retMsg.put("retDeptId", "1"); + } + + // 往同步写入本系统与第三方的对应信息 + if (retMsg.getBoolean("code")) { + // 同步成功 + thirdObjId = retMsg.getString("retDeptId"); + retMsg.put("retDeptId", thirdObjId); + synState = SynThirdConsts.SYN_STATE_OK; + } else { + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + retMsg.getString("error"); + } + }else{ + // 未设置单条同步,归并到未同步状态 + // 未同步 + synState = SynThirdConsts.SYN_STATE_NO; + description = deptFlag + "系统未设置单条同步"; + + retMsg.put("code", true); + retMsg.put("error", description); + retMsg.put("retDeptId", "0"); + } + }else{ + // 同步失败,上级部门无对应的钉钉ID + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + "部门所属的上级部门未同步到钉钉"; + + retMsg.put("code", false); + retMsg.put("error", description); + retMsg.put("retDeptId", "0"); + } + + }else{ + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + "access_token值为空,不能同步信息"; + + retMsg.put("code", false); + retMsg.put("error", description); + retMsg.put("retDeptId", "0"); + } + + } + + // 更新同步表 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_ADD,null,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,synState,description); + + return retMsg; + } + + + /** + * 往钉钉更新组织-部门 + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param accessToken (单条调用时为空) + * @return + */ + @Override + public JSONObject updateDepartmentSysToDing(boolean isBatch, OrganizeEntity deptEntity,String accessToken) { + BaseSystemInfo config = getDingTalkConfig(); + String corpId = config.getDingSynAppKey(); + String corpSecret = config.getDingSynAppSecret(); + String compValue = SynThirdConsts.OBJECT_TYPE_COMPANY; + // 单条记录执行时,受开关限制 + int dingIsSyn = isBatch ? 1 : config.getDingSynIsSynOrg(); + JSONObject tokenObject = new JSONObject(); + String access_token = ""; + JSONObject retMsg = new JSONObject(); + DingTalkDeptModel deptModel = new DingTalkDeptModel(); + SynThirdInfoEntity synThirdInfoEntity = new SynThirdInfoEntity(); + String opType = ""; + Integer synState = 0; + String description = ""; + String thirdObjId = ""; + SynThirdInfoEntity synThirdInfoPara = new SynThirdInfoEntity(); + boolean isDeptDiff = true; + String deptFlag = "更新:"; + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", "系统未设置单条同步"); + + // 支持同步,设置需要同步到钉钉的对象属性值 + if(isBatch || dingIsSyn==1) { + // 获取 access_token + if(isBatch) { + access_token = accessToken; + }else{ + List synThirdInfoList = synThirdInfoService.syncThirdInfoByType(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG, SynThirdConsts.THIRD_TYPE_DING_To_Sys); + tokenObject = SynDingTalkUtil.getAccessToken(corpId, corpSecret); + access_token = tokenObject.getString("access_token"); + } + + // 获取同步表信息 + synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getId()); + + if (access_token != null && !"".equals(access_token)) { + deptModel.setDeptId(null); + deptModel.setName(deptEntity.getFullName()); + // 从本地数据库的同步表获取对应的钉钉ID,为空报异常,不为空再验证所获取接口部门列表是否当前ID 未处理 + if(compValue.equals(deptEntity.getCategory()) && "-1".equals(deptEntity.getParentId())){ + //顶级节点时,钉钉的父节点设置为1 + deptModel.setParentId(SynThirdConsts.DING_ROOT_DEPT_ID); + } else { + // 判断上级部门的合法性 + synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getParentId()); + + retMsg = checkDepartmentSysToDing(synThirdInfoEntity); + isDeptDiff = retMsg.getBoolean("code"); + if (isDeptDiff) { + deptModel.setParentId(Long.parseLong(synThirdInfoEntity.getThirdObjId())); + } + } + deptModel.setOrder(deptEntity.getSortCode()); + + // 上级部门检查是否异常 + if(isDeptDiff){ + // 获取同步表信息 + synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getId()); + + // 判断当前部门对应的第三方的合法性 + retMsg = checkDepartmentSysToDing(synThirdInfoEntity); + if (!retMsg.getBoolean("code")) { + if ("3".equals(retMsg.getString("flag")) || "1".equals(retMsg.getString("flag"))) { + // flag:3 未同步,需要创建同步到钉钉、写入同步表 + // flag:1 已同步但第三方上没对应的ID,需要删除原来的同步信息,再创建同步到钉钉、写入同步表 + if("1".equals(retMsg.getString("flag"))) { + synThirdInfoService.delete(synThirdInfoEntity); + } + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + + // 创建时:部门名称不能带有特殊字符 + retMsg = checkDeptName(deptEntity.getFullName(), + opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); + if (!retMsg.getBoolean("code")) { + return retMsg; + } + + if("company".equals(deptEntity.getCategory())){ + deptModel.setSourceIdentifier("company"); + }else{ + deptModel.setSourceIdentifier("department"); + } + // 往钉钉写入公司或部门 + if(!"-1".equals(deptEntity.getParentId())){ + retMsg = SynDingTalkUtil.createDepartment(deptModel, access_token); + }else{ + retMsg.put("code", true); + retMsg.put("error", "顶级不同步,默认值id1"); + retMsg.put("retDeptId", "1"); + } + + // 往同步写入本系统与第三方的对应信息 + if(retMsg.getBoolean("code")) { + // 同步成功 + thirdObjId = retMsg.getString("retDeptId"); + retMsg.put("retDeptId", thirdObjId); + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + }else{ + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + retMsg.getString("error"); + } + } + + if ("2".equals(retMsg.getString("flag"))) { + // flag:2 已同步但第三方ID为空,需要创建同步到钉钉、修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = ""; + + // 创建时:部门名称不能带有特殊字符 + retMsg = checkDeptName(deptEntity.getFullName(), + opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); + if (!retMsg.getBoolean("code")) { + return retMsg; + } + + if("company".equals(deptEntity.getCategory())){ + deptModel.setSourceIdentifier("company"); + }else{ + deptModel.setSourceIdentifier("department"); + } + // 往钉钉写入公司或部门 + if(!"-1".equals(deptEntity.getParentId())){ + retMsg = SynDingTalkUtil.createDepartment(deptModel, access_token); + }else{ + retMsg.put("code", true); + retMsg.put("error", "顶级不同步,默认值id1"); + retMsg.put("retDeptId", "1"); + } + + // 往同步表更新本系统与第三方的对应信息 + if (retMsg.getBoolean("code")) { + // 同步成功 + thirdObjId = retMsg.getString("retDeptId"); + retMsg.put("retDeptId", thirdObjId); + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + } else { + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + retMsg.getString("error"); + } + } + + } else { + // 更新同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + + // 部门名称不能带有特殊字符 + retMsg = checkDeptName(deptEntity.getFullName(), + opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); + if (!retMsg.getBoolean("code")) { + return retMsg; + } + + // 往钉钉写入公司或部门 + deptModel.setDeptId(Long.parseLong(synThirdInfoEntity.getThirdObjId())); + + // 设置部门主管:只有在更新时才可以执行 + // 初始化时:组织同步=>用户同步=>组织同步(用来更新部门主管的) + if(StringUtil.isNotEmpty(deptEntity.getManagerId())){ + SynThirdInfoEntity userThirdInfo = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_USER,deptEntity.getManagerId()); + if(userThirdInfo!=null){ + if(StringUtil.isNotEmpty(userThirdInfo.getThirdObjId())) { + deptModel.setDeptManagerUseridList(userThirdInfo.getThirdObjId()); + } + } + } + + retMsg = SynDingTalkUtil.updateDepartment(deptModel, access_token); + + // 往同步表更新本系统与第三方的对应信息 + if (retMsg.getBoolean("code")) { + // 同步成功 + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + } else { + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + retMsg.getString("error"); + } + } + }else{ + // 同步失败,上级部门检查有异常 + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + } + + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + "上级部门无对应的钉钉ID"; + + retMsg.put("code", false); + retMsg.put("error", description); + } + + }else{ + // 同步失败 + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + } + + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + "access_token值为空,不能同步信息"; + + retMsg.put("code", true); + retMsg.put("error", description); + } + + }else{ + // 未设置单条同步,归并到未同步状态 + // 获取同步表信息 + synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getId()); + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + } + + synState = SynThirdConsts.SYN_STATE_NO; + description = deptFlag + "系统未设置单条同步"; + + retMsg.put("code", true); + retMsg.put("error", description); + } + + // 更新同步表 + saveSynThirdInfoEntity(opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,synState,description); + + return retMsg; + } + + + /** + * 往钉钉删除组织-部门 + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param id 本系统的公司或部门ID + * @param accessToken (单条调用时为空) + * @return + */ + @Override + public JSONObject deleteDepartmentSysToDing(boolean isBatch, String id,String accessToken) { + BaseSystemInfo config = getDingTalkConfig(); + String corpId = config.getDingSynAppKey(); + String corpSecret = config.getDingSynAppSecret(); + // 单条记录执行时,受开关限制 + int dingIsSyn = isBatch ? 1 : config.getDingSynIsSynOrg(); + JSONObject tokenObject = new JSONObject(); + String access_token = ""; + JSONObject retMsg = new JSONObject(); + SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG,id); + String deptFlag = "删除:"; + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", "系统未设置单条同步"); + + // 支持同步 + if(synThirdInfoEntity!=null) { + if(isBatch || dingIsSyn==1){ + // 获取 access_token + if(isBatch) { + access_token = accessToken; + }else{ + List synThirdInfoList = synThirdInfoService.syncThirdInfoByType(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG, SynThirdConsts.THIRD_TYPE_DING_To_Sys); + tokenObject = SynDingTalkUtil.getAccessToken(corpId, corpSecret); + access_token = tokenObject.getString("access_token"); + } + + if (access_token != null && !"".equals(access_token)) { + // 删除钉钉对应的部门 + if (!"".equals(String.valueOf(synThirdInfoEntity.getThirdObjId())) && !"null".equals(String.valueOf(synThirdInfoEntity.getThirdObjId()))) { + retMsg = SynDingTalkUtil.deleteDepartment(Long.parseLong(synThirdInfoEntity.getThirdObjId()), access_token); + if (retMsg.getBoolean("code")) { + // 同步成功,直接删除同步表记录 + synThirdInfoService.delete(synThirdInfoEntity); + } else { + // 同步失败 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, deptFlag + retMsg.getString("error")); + } + }else{ + // 根据钉钉ID找不到相应的信息,直接删除同步表记录 + synThirdInfoService.delete(synThirdInfoEntity); + } + }else{ + // 同步失败 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, deptFlag + "access_token值为空,不能同步信息"); + + retMsg.put("code", false); + retMsg.put("error", deptFlag + "access_token值为空,不能同步信息!"); + } + + }else{ + // 未设置单条同步,归并到未同步状态 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_NO, deptFlag + "系统未设置单条同步"); + + retMsg.put("code", true); + retMsg.put("error", deptFlag + "系统未设置单条同步"); + } + } + + return retMsg; + } + + + + + + //------------------------------------钉钉同步公司、部门到本系统20220330------------------------------------- + + + /** + * 根据部门的同步表信息判断同步情况 + * 不带错第三方误定位判断的功能代码,只获取调用接口的返回信息 20220331 + * @param synThirdInfoEntity + * @return + */ + public JSONObject checkDepartmentDingToSys(SynThirdInfoEntity synThirdInfoEntity) { + JSONObject retMsg = new JSONObject(); + retMsg.put("code",true); + retMsg.put("flag",""); + retMsg.put("error",""); + + if(synThirdInfoEntity!=null){ + if("".equals(String.valueOf(synThirdInfoEntity.getSysObjId())) || "null".equals(String.valueOf(synThirdInfoEntity.getSysObjId()))) { + // 同步表的钉钉ID为空 + retMsg.put("code",false); + retMsg.put("flag","2"); + retMsg.put("error","同步表中部门对应的本地ID为空!"); + } + }else{ + // 上级部门未同步 + retMsg.put("code",false); + retMsg.put("flag","3"); + retMsg.put("error","部门未同步到本地!"); + } + + return retMsg; + } + + + /** + * 往本地创建组织-部门 + * 钉钉同步单个公司或部门到本地(供调用) + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param accessToken (单条调用时为空) + * @return + */ + @Override + public JSONObject createDepartmentDingToSys(boolean isBatch, DingTalkDeptModel deptEntity,String accessToken) { + BaseSystemInfo config = getDingTalkConfig(); + // 单条记录执行时,受开关限制 + int dingIsSyn = isBatch ? 1 : config.getDingSynIsSynOrg(); + + Long dingDeptId = deptEntity.getDeptId(); + String dingDeptName = deptEntity.getName(); + Long dingParentId = deptEntity.getParentId(); + + Integer synState = 0; + String deptFlag = "创建:"; + String description = ""; + + JSONObject retMsg = new JSONObject(); + boolean isDeptDiff = true; + String sysParentId = ""; + String sysObjId = ""; + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", "创建:系统未设置单条同步"); + + // 支持同步 + if(isBatch || dingIsSyn==1){ + boolean tag = false; + if(dingDeptId==1L){ + tag=true; + } + SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoByThirdObjId(SynThirdConsts.THIRD_TYPE_DING_To_Sys,SynThirdConsts.DATA_TYPE_ORG,dingParentId+""); + + + retMsg = checkDepartmentDingToSys(synThirdInfoEntity); + isDeptDiff = retMsg.getBoolean("code"); + if(isDeptDiff || tag) { + sysParentId = tag==true?" -1" : synThirdInfoEntity.getSysObjId(); + + if(isBatch || dingIsSyn==1) { + // 新增保存组织 + OrganizeEntity newOrg = new OrganizeEntity(); + sysObjId = RandomUtil.uuId(); + newOrg.setId(sysObjId); + if(!"1".equals(dingDeptId+"") ){ +// newOrg.setCategory(SynThirdConsts.OBJECT_TYPE_COMPANY); +// newOrg.setParentId("-1"); +// newOrg.setOrganizeIdTree(sysObjId); + + Assert.notNull(sysParentId,"父级组织未同步"); + newOrg.setCategory(SynThirdConsts.OBJECT_TYPE_DEPARTMENT); + newOrg.setParentId(sysParentId); + // 通过组织id获取父级组织 + String organizeIdTree = organizeService.getOrganizeIdTree(newOrg); + newOrg.setOrganizeIdTree(organizeIdTree+","+sysObjId); + + newOrg.setEnCode(dingDeptId+""); + newOrg.setFullName(dingDeptName); + newOrg.setSortCode(deptEntity.getOrder()!=null?deptEntity.getOrder():1L); + newOrg.setCategory("company".equals(deptEntity.getSourceIdentifier())?"company":"department"); + organizeService.save(newOrg); + }else{ + sysObjId = organizeService.getOrganizeByParentId("-1").get(0).getId(); + } + + // 中间表 + retMsg.put("retDeptId", sysObjId); + synState = SynThirdConsts.SYN_STATE_OK; + }else{ + // 未设置单条同步,归并到未同步状态 + // 未同步 + synState = SynThirdConsts.SYN_STATE_NO; + description = deptFlag + "系统未设置单条同步"; + + retMsg.put("code", true); + retMsg.put("error", description); + retMsg.put("retDeptId", "0"); + } + }else{ + // 同步失败,上级部门无对应的钉钉ID + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + "部门所属的上级部门未同步到本地"; + + retMsg.put("code", false); + retMsg.put("error", description); + retMsg.put("retDeptId", "0"); + } + } + + // 更新同步表 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_ADD,null,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING_To_Sys), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),sysObjId,dingDeptId+"",synState,description); + + return retMsg; + } + + + /** + * 往钉钉更新组织-部门 + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param accessToken (单条调用时为空) + * @return + */ + @Override + public JSONObject updateDepartmentDingToSys(boolean isBatch, DingTalkDeptModel deptEntity,String accessToken) { + BaseSystemInfo config = getDingTalkConfig(); +// String corpId = config.getDingSynAppKey(); +// String corpSecret = config.getDingSynAppSecret(); +// String compValue = SynThirdConsts.OBJECT_TYPE_COMPANY; + // 单条记录执行时,受开关限制 + int dingIsSyn = isBatch ? 1 : config.getDingSynIsSynOrg(); + +// JSONObject tokenObject = new JSONObject(); +// String access_token = ""; + JSONObject retMsg = new JSONObject(); + DingTalkDeptModel deptModel = new DingTalkDeptModel(); + SynThirdInfoEntity synThirdInfoEntity = new SynThirdInfoEntity(); + String opType = ""; + Integer synState = 0; + String description = ""; +// String thirdObjId = ""; + String sysObjId = ""; + String sysParentId = ""; + SynThirdInfoEntity synThirdInfoPara = new SynThirdInfoEntity(); + boolean isDeptDiff = true; + String deptFlag = "更新:"; + + Long dingDeptId = deptEntity.getDeptId(); + String dingDeptName = deptEntity.getName(); + Long dingParentId = deptEntity.getParentId(); + OrganizeEntity orgInfo = new OrganizeEntity(); + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", "系统未设置单条同步"); + + if(isBatch || dingIsSyn==1) { + // 获取同步表信息 + synThirdInfoEntity = synThirdInfoService.getInfoByThirdObjId(SynThirdConsts.THIRD_TYPE_DING_To_Sys,SynThirdConsts.DATA_TYPE_ORG,dingParentId+""); + retMsg = checkDepartmentDingToSys(synThirdInfoEntity); + isDeptDiff = retMsg.getBoolean("code"); + if(isDeptDiff) { + sysParentId = synThirdInfoEntity.getSysObjId(); + // 获取同步表信息 + synThirdInfoEntity = synThirdInfoService.getInfoByThirdObjId(SynThirdConsts.THIRD_TYPE_DING_To_Sys,SynThirdConsts.DATA_TYPE_ORG,dingDeptId+""); + // 判断当前部门对应的第三方的合法性 + retMsg = checkDepartmentDingToSys(synThirdInfoEntity); + if (!retMsg.getBoolean("code")) { + if ("3".equals(retMsg.getString("flag")) || "1".equals(retMsg.getString("flag"))) { + // flag:3 未同步,需要创建同步到钉钉、写入同步表 + // flag:1 已同步但第三方上没对应的ID,需要删除原来的同步信息,再创建同步到钉钉、写入同步表 + if("1".equals(retMsg.getString("flag"))) { + synThirdInfoService.delete(synThirdInfoEntity); + } + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; +// thirdObjId = dingDeptId+""; + + // 新增保存组织 + orgInfo = new OrganizeEntity(); + sysObjId = RandomUtil.uuId(); + orgInfo.setId(sysObjId); + if(!"1".equals(dingDeptId+"") ){ +// newOrg.setCategory(SynThirdConsts.OBJECT_TYPE_COMPANY); +// newOrg.setParentId("-1"); +// newOrg.setOrganizeIdTree(sysObjId); + + orgInfo.setCategory(SynThirdConsts.OBJECT_TYPE_DEPARTMENT); + orgInfo.setParentId(sysParentId); + // 通过组织id获取父级组织 + String organizeIdTree = organizeService.getOrganizeIdTree(orgInfo); + orgInfo.setOrganizeIdTree(organizeIdTree+","+sysObjId); + + orgInfo.setEnCode(dingDeptId+""); + orgInfo.setFullName(dingDeptName); + orgInfo.setSortCode(deptEntity.getOrder()!=null?deptEntity.getOrder():1L); +// orgInfo.setCategory("company".equals(deptEntity.getSourceIdentifier())?"company":"department"); + organizeService.save(orgInfo); + }else{ + sysObjId = organizeService.getOrganizeByParentId("-1").get(0).getId(); + } + + + // 同步成功 +// thirdObjId = retMsg.getString("retDeptId"); + retMsg.put("retDeptId", sysObjId); + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + + } + + if ("2".equals(retMsg.getString("flag"))) { + // flag:2 已同步但第三方ID为空,需要创建同步到钉钉、修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = dingDeptId+""; + + // 新增保存组织 + orgInfo = new OrganizeEntity(); + sysObjId = RandomUtil.uuId(); + orgInfo.setId(sysObjId); + if(!"1".equals(dingDeptId+"") ){ +// newOrg.setCategory(SynThirdConsts.OBJECT_TYPE_COMPANY); +// newOrg.setParentId("-1"); +// newOrg.setOrganizeIdTree(sysObjId); + + orgInfo.setCategory(SynThirdConsts.OBJECT_TYPE_DEPARTMENT); + orgInfo.setParentId(sysParentId); + // 通过组织id获取父级组织 + String organizeIdTree = organizeService.getOrganizeIdTree(orgInfo); + orgInfo.setOrganizeIdTree(organizeIdTree+","+sysObjId); + + orgInfo.setEnCode(dingDeptId+""); + orgInfo.setFullName(dingDeptName); + orgInfo.setSortCode(deptEntity.getOrder()!=null?deptEntity.getOrder():1L); +// orgInfo.setCategory("company".equals(deptEntity.getSourceIdentifier())?"company":"department"); + organizeService.save(orgInfo); + }else{ + sysObjId = organizeService.getOrganizeByParentId("-1").get(0).getId(); + } + + + // 同步成功 + retMsg.put("retDeptId", sysObjId); + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + } + }else { + // 更新同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); + sysObjId = synThirdInfoEntity.getSysObjId(); + + orgInfo = organizeService.getInfo(sysObjId); + if(orgInfo!=null){ + orgInfo.setParentId(dingParentId+""); + orgInfo.setFullName(dingDeptName); + if(!"1".equals(dingDeptId+"")){ +// orgInfo.setCategory(SynThirdConsts.OBJECT_TYPE_COMPANY); +// orgInfo.setParentId("-1"); + +// orgInfo.setCategory(SynThirdConsts.OBJECT_TYPE_DEPARTMENT); + orgInfo.setParentId(sysParentId); + orgInfo.setOrganizeIdTree(orgInfo.getOrganizeIdTree().replace(","+orgInfo.getId(),"")); + organizeService.update(orgInfo.getId(),orgInfo); + } + + + // 同步成功 + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + }else{ + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + "未找到对应的部门"; + } + } + }else{ + synThirdInfoEntity = synThirdInfoService.getInfoByThirdObjId(SynThirdConsts.THIRD_TYPE_DING_To_Sys,SynThirdConsts.DATA_TYPE_ORG,dingDeptId+""); + // 同步失败,上级部门检查有异常 + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + sysObjId = synThirdInfoEntity.getSysObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + sysObjId = ""; + } + + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + "上级部门无对应的本地ID"; + + retMsg.put("code", false); + retMsg.put("error", description); + } + }else{ + // 未设置单条同步,归并到未同步状态 + // 获取同步表信息 + synThirdInfoEntity = synThirdInfoService.getInfoByThirdObjId(SynThirdConsts.THIRD_TYPE_DING_To_Sys,SynThirdConsts.DATA_TYPE_ORG,dingDeptId+""); + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + sysObjId = synThirdInfoEntity.getSysObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + sysObjId = ""; + } + + synState = SynThirdConsts.SYN_STATE_NO; + description = deptFlag + "系统未设置单条同步"; + + retMsg.put("code", true); + retMsg.put("error", description); + } + + // 更新同步表 + saveSynThirdInfoEntity(opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING_To_Sys), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),sysObjId,dingDeptId+"",synState,description); + + return retMsg; + } + + + /** + * 往钉钉删除组织-部门 + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param thirdObjId 钉钉的公司或部门ID + * @return + */ + @Override + public JSONObject deleteDepartmentDingToSys(boolean isBatch, String thirdObjId) { + BaseSystemInfo config = getDingTalkConfig(); + // 单条记录执行时,受开关限制 + int dingIsSyn = isBatch ? 1 : config.getDingSynIsSynOrg(); + String deptFlag = "删除:"; + JSONObject retMsg = new JSONObject(); + + // 获取当前第三方同步表对应记录 + SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoByThirdObjId(SynThirdConsts.THIRD_TYPE_DING_To_Sys,SynThirdConsts.DATA_TYPE_ORG,thirdObjId); + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", "系统未设置单条同步"); + + if(synThirdInfoEntity!=null) { + if(isBatch || dingIsSyn==1){ + String sysObjId = synThirdInfoEntity.getSysObjId(); + if (!"".equals(String.valueOf(sysObjId)) && !"null".equals(String.valueOf(sysObjId))){ + OrganizeEntity sysOrgEntity = organizeService.getInfo(sysObjId); + if(sysOrgEntity!=null){ + // 删除本的的组织 + organizeService.delete(sysOrgEntity.getId()); + // 同步成功,直接删除同步表记录 + synThirdInfoService.delete(synThirdInfoEntity); + }else{ + // 根据本系统ID找不到相应的信息,直接删除同步表记录 + synThirdInfoService.delete(synThirdInfoEntity); + } + }else{ + // 根据本系统ID找不到相应的信息,直接删除同步表记录 + synThirdInfoService.delete(synThirdInfoEntity); + } + }else{ + // 未设置单条同步,归并到未同步状态 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING_To_Sys), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG), synThirdInfoEntity.getSysObjId(), thirdObjId, SynThirdConsts.SYN_STATE_NO, deptFlag + "系统未设置单条同步"); + + retMsg.put("code", true); + retMsg.put("error", deptFlag + "系统未设置单条同步"); + } + } + return retMsg; + } + + + + + + + //------------------------------------本系统同步用户到钉钉------------------------------------- + + /** + * 设置需要提交给钉钉接口的单个成员信息 + * 带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param userEntity 本地用户信息 + * @param dingDeptList 钉钉的部门信息 + * @return + */ +// public JSONObject setDingUserObject(UserEntity userEntity, List dingDeptList) throws ParseException { +// DingTalkUserModel userModel = new DingTalkUserModel(); +// JSONObject retMsg = new JSONObject(); +// retMsg.put("code", true); +// retMsg.put("error", ""); +// +// // 验证邮箱格式的格式合法性、唯一性 +// if(StringUtil.isNotEmpty(userEntity.getEmail())){ +// if(!RegexUtils.checkEmail(userEntity.getEmail())){ +// retMsg.put("code", false); +// retMsg.put("error", "邮箱格式不合法!"); +// retMsg.put("dingUserObject", null); +// return retMsg; +// } +// } +// +// // 判断手机号的合法性 +// if(StringUtil.isNotEmpty(userEntity.getMobilePhone())){ +// if(!RegexUtils.checkMobile(userEntity.getMobilePhone())){ +// retMsg.put("code", false); +// retMsg.put("error", "手机号不合法!"); +// retMsg.put("dingUserObject", null); +// return retMsg; +// } +// } +// +// userModel.setUserid(userEntity.getId()); +// userModel.setName(userEntity.getRealName()); +// userModel.setMobile(userEntity.getMobilePhone()); +// userModel.setTelephone(userEntity.getLandline()); +// userModel.setJobNumber(userEntity.getAccount()); +// +// PositionEntity positionEntity = positionService.getInfo(userEntity.getPositionId()); +// String jobName = ""; +// if(positionEntity!=null){ +// jobName = positionEntity.getFullName(); +// userModel.setTitle(jobName); +// } +// +// userModel.setWorkPlace(userEntity.getPostalAddress()); +// +// if(userEntity.getEntryDate()!= null){ +// String entryDate = DateUtil.daFormat(userEntity.getEntryDate()); +// DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); +// df.setTimeZone(TimeZone.getTimeZone("GMT")); +// if(df.parse(entryDate).getTime()>0) { +// userModel.setHiredDate(df.parse(entryDate).getTime()); +// } +// } +// +// SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG,userEntity.getOrganizeId()); +// retMsg = checkDepartmentSysToDing(synThirdInfoEntity,dingDeptList); +// if(retMsg.getBoolean("code")){ +// userModel.setDeptIdList(synThirdInfoEntity.getThirdObjId()); +// }else{ +// retMsg.put("code", false); +// retMsg.put("error", "部门找不到对应的钉钉ID!"); +// retMsg.put("dingUserObject", null); +// return retMsg; +// } +// userModel.setEmail(userEntity.getEmail()); +// +// retMsg.put("dingUserObject", userModel); +// return retMsg; +// } + + + /** + * 设置需要提交给钉钉接口的单个成员信息 + * 不带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param userEntity 本地用户信息 + * @return + */ + public JSONObject setDingUserObject(UserEntity userEntity) throws ParseException { + DingTalkUserModel userModel = new DingTalkUserModel(); + JSONObject retMsg = new JSONObject(); + retMsg.put("code", true); + retMsg.put("error", ""); + + // 验证邮箱格式的格式合法性、唯一性 + if(StringUtil.isNotEmpty(userEntity.getEmail())){ + if(!RegexUtils.checkEmail(userEntity.getEmail())){ + retMsg.put("code", false); + retMsg.put("error", "邮箱格式不合法!"); + retMsg.put("dingUserObject", null); + return retMsg; + } + } + + // 判断手机号的合法性 + if(StringUtil.isNotEmpty(userEntity.getMobilePhone())){ + if(!RegexUtils.checkMobile(userEntity.getMobilePhone())){ + retMsg.put("code", false); + retMsg.put("error", "手机号不合法!"); + retMsg.put("dingUserObject", null); + return retMsg; + } + } + + userModel.setUserid(userEntity.getId()); + userModel.setName(userEntity.getRealName()); + userModel.setMobile(userEntity.getMobilePhone()); + userModel.setTelephone(userEntity.getLandline()); + userModel.setJobNumber(userEntity.getAccount()); + + PositionEntity positionEntity = positionService.getInfo(userEntity.getPositionId()); + String jobName = ""; + if(positionEntity!=null){ + jobName = positionEntity.getFullName(); + userModel.setTitle(jobName); + } + + userModel.setWorkPlace(userEntity.getPostalAddress()); + + if(userEntity.getEntryDate()!= null){ + String entryDate = DateUtil.daFormat(userEntity.getEntryDate()); + DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); + df.setTimeZone(TimeZone.getTimeZone("GMT")); + if(df.parse(entryDate).getTime()>0) { + userModel.setHiredDate(df.parse(entryDate).getTime()); + } + } + + SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG,userEntity.getOrganizeId()); + // retMsg = checkDepartmentSysToDing(synThirdInfoEntity,dingDeptList); + List userRelationList = userRelationService.getListByObjectType(userEntity.getId(),"Organize"); + List objectIdList = userRelationList.stream().map(t->t.getObjectId()).collect(Collectors.toList()); +// String objectId = userRelationList.stream().map(t->t.getObjectId()).collect(Collectors.joining(",")); + retMsg = checkDepartmentSysToDing2(objectIdList); + if(retMsg.getBoolean("code")){ +// userModel.setDeptIdList(synThirdInfoEntity.getThirdObjId()); + userModel.setDeptIdList(retMsg.getString("flag")); + }else{ + retMsg.put("code", false); + retMsg.put("error", "部门找不到对应的钉钉ID!"); + retMsg.put("dingUserObject", null); + return retMsg; + } + userModel.setEmail(userEntity.getEmail()); + + retMsg.put("dingUserObject", userModel); + return retMsg; + } + + + /** + * 判断用户的手机号、邮箱是否唯一,钉钉不允许重复 + * @param mobile + * @param email + * @param userId + * @param dingUserList + * @param opType + * @param synThirdInfoEntity + * @param thirdType + * @param dataType + * @param sysObjId + * @param thirdObjId + * @param deptFlag + * @return + */ + public JSONObject checkUserMobileEmailRepeat(String mobile, String email, String userId, List dingUserList, + String opType, SynThirdInfoEntity synThirdInfoEntity, Integer thirdType, + Integer dataType, String sysObjId, String thirdObjId, String deptFlag){ + boolean isDiff = true; + String description = ""; + JSONObject retMsg = new JSONObject(); + + // 钉钉限制:手机号唯一性 + if(StringUtil.isNotEmpty(mobile)){ + if(StringUtil.isNotEmpty(userId)){ + if(dingUserList.stream().filter(t -> String.valueOf(t.getMobile()).equals(mobile) && !(t.getUserid().equals(userId))).count() > 0 ? true : false){ + isDiff = false; + description = deptFlag + "钉钉内已有绑定手机号:" + mobile; + } + }else{ + if(dingUserList.stream().filter(t -> String.valueOf(t.getMobile()).equals(mobile)).count() > 0 ? true : false){ + isDiff = false; + description = deptFlag + "钉钉内已有绑定手机号:" + mobile; + } + } + } + + // 钉钉限制:邮箱地址唯一性 + if(StringUtil.isNotEmpty(email)){ + if(StringUtil.isNotEmpty(userId)){ + if(dingUserList.stream().filter(t -> String.valueOf(t.getEmail()).equals(email) && !(t.getUserid().equals(userId))).count() > 0 ? true : false){ + isDiff = false; + description = deptFlag + "钉钉内已有绑定此邮箱:" + email; + } + }else{ + if(dingUserList.stream().filter(t -> String.valueOf(t.getEmail()).equals(email)).count() > 0 ? true : false){ + isDiff = false; + description = deptFlag + "钉钉内已有绑定此邮箱:" + email; + } + } + } + + retMsg.put("code",isDiff); + retMsg.put("error",description); + + if(!isDiff){ + // 同步失败 + Integer synState = SynThirdConsts.SYN_STATE_FAIL; + + // 更新同步表 + saveSynThirdInfoEntity(opType,synThirdInfoEntity,thirdType,dataType,sysObjId,thirdObjId,synState,description); + } + + return retMsg; + } + + + /** + * 根据用户的同步表信息判断同步情况 + * 带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param synThirdInfoEntity + * @param dingUserList + * @return + */ +// public JSONObject checkUserSysToDing(SynThirdInfoEntity synThirdInfoEntity, List dingUserList) { +// JSONObject retMsg = new JSONObject(); +// retMsg.put("code",true); +// retMsg.put("flag",""); +// retMsg.put("error",""); +// +// if(synThirdInfoEntity!=null){ +// if(StringUtil.isNotEmpty(synThirdInfoEntity.getThirdObjId())) { +// // 同步表存在钉钉ID,仍需要判断钉钉上有没此用户 +// if(dingUserList.stream().filter(t -> t.getUserid().equals(synThirdInfoEntity.getThirdObjId())).count() == 0 ? true : false){ +// retMsg.put("code",false); +// retMsg.put("flag","1"); +// retMsg.put("error","钉钉不存在同步表对应的用户ID!"); +// } +// }else{ +// // 同步表的企业微信ID为空 +// retMsg.put("code",false); +// retMsg.put("flag","2"); +// retMsg.put("error","同步表中用户对应的钉钉ID为空!"); +// } +// }else{ +// // 上级用户未同步 +// retMsg.put("code",false); +// retMsg.put("flag","3"); +// retMsg.put("error","用户未同步!"); +// } +// +// return retMsg; +// } + + /** + * 根据用户的同步表信息判断同步情况 + * 不带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param synThirdInfoEntity + * @return + */ + public JSONObject checkUserSysToDing(SynThirdInfoEntity synThirdInfoEntity) { + JSONObject retMsg = new JSONObject(); + retMsg.put("code",true); + retMsg.put("flag",""); + retMsg.put("error",""); + + if(synThirdInfoEntity!=null){ + if("".equals(String.valueOf(synThirdInfoEntity.getThirdObjId())) || "null".equals(String.valueOf(synThirdInfoEntity.getThirdObjId()))) { + // 同步表的企业微信ID为空 + retMsg.put("code",false); + retMsg.put("flag","2"); + retMsg.put("error","同步表中用户对应的钉钉ID为空!"); + } + }else{ + // 上级用户未同步 + retMsg.put("code",false); + retMsg.put("flag","3"); + retMsg.put("error","用户未同步!"); + } + + return retMsg; + } + + + /** + * 往钉钉创建用户 + * 带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param userEntity + * @param dingDeptListPara 单条执行时为null + * @param dingUserListPara 单条执行时为null + * @return + */ +// @Override +// public JSONObject createUserSysToDing(boolean isBatch, UserEntity userEntity, List dingDeptListPara, +// List dingUserListPara) throws ParseException { +// BaseSystemInfo config = getDingTalkConfig(); +// String corpId = config.getDingSynAppKey(); +// String corpSecret = config.getDingSynAppSecret(); +// // 单条记录执行时,受开关限制 +// int dingIsSyn = isBatch ? 1 : config.getDingSynIsSynUser(); +// JSONObject tokenObject = SynDingTalkUtil.getAccessToken(corpId, corpSecret); +// String access_token = tokenObject.getString("access_token"); +// JSONObject retMsg = new JSONObject(); +// DingTalkUserModel userObjectModel = new DingTalkUserModel(); +// List dingDeptList = new ArrayList<>(); +// List dingUserList = new ArrayList<>(); +// String thirdObjId = ""; +// Integer synState = 0; +// String description = ""; +// String userFlag = "创建:"; +// +// // 返回值初始化 +// retMsg.put("code", true); +// retMsg.put("error", userFlag + "系统未设置单条同步"); +// +// if (dingIsSyn==1){ +// if (access_token != null && !"".equals(access_token)) { +// // 获取企业微信上的所有部门列表信息 +// if(isBatch){ +// dingDeptList = dingDeptListPara; +// }else{ +// JSONObject deptObject = SynDingTalkUtil.getDepartmentList(SynThirdConsts.DING_ROOT_DEPT_ID,access_token); +// if(deptObject.getBoolean("code")) { +// dingDeptList = JsonUtil.getJsonToList(deptObject.getObject("department",List.class), DingTalkDeptModel.class); +// }else{ +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + "获取钉钉的部门列表信息失败"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// +// // 更新同步表 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_ADD, null, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), userEntity.getId(), thirdObjId, synState, description); +// +// return retMsg; +// } +// } +// +// // 获取钉钉上的所有用户列表信息 +// if(isBatch){ +// dingUserList = dingUserListPara; +// }else { +// JSONObject userObject = SynDingTalkUtil.getUserList(dingDeptList, access_token); +// if (userObject.getBoolean("code")) { +// dingUserList = JsonUtil.getJsonToList(userObject.getObject("userlist", List.class), DingTalkUserModel.class); +// } else { +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + "获取钉钉的用户列表信息失败"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// +// // 更新同步表 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_ADD, null, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), userEntity.getId(), thirdObjId, synState, description); +// +// return retMsg; +// } +// } +// +// // 判断用户的手机号、邮箱是否唯一,不能重复 +// retMsg = checkUserMobileEmailRepeat(userEntity.getMobilePhone(),userEntity.getEmail(),thirdObjId,dingUserList, +// SynThirdConsts.OBJECT_OP_ADD,null,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),userEntity.getId(),thirdObjId,userFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 要同步到钉钉的对象赋值 +// retMsg = setDingUserObject(userEntity, dingDeptList); +// if (retMsg.getBoolean("code")) { +// userObjectModel = retMsg.getObject("dingUserObject",DingTalkUserModel.class); +// +// // 往企业微信写入成员 +// retMsg = SynDingTalkUtil.createUser(userObjectModel, access_token); +// +// // 往同步写入本系统与第三方的对应信息 +// if (retMsg.getBoolean("code")) { +// // 同步成功 +// thirdObjId = userEntity.getId(); +// synState = SynThirdConsts.SYN_STATE_OK; +// } else { +// // 同步失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + retMsg.getString("error"); +// } +// }else{ +// // 同步失败,原因:部门找不到对应的第三方ID、邮箱格式不合法 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + retMsg.getString("error"); +// } +// +// }else{ +// // 同步失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + "access_token值为空,不能同步信息"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// } +// +// }else{ +// // 无须同步,未同步状态 +// synState = SynThirdConsts.SYN_STATE_NO; +// description = userFlag + "系统未设置单条同步"; +// +// retMsg.put("code", true); +// retMsg.put("error", description); +// } +// +// // 更新同步表 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_ADD, null, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), userEntity.getId(), thirdObjId, synState, description); +// +// return retMsg; +// } + + + /** + * 往钉钉更新用户 + * 带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param userEntity + * @param dingDeptListPara 单条执行时为null + * @param dingUserListPara 单条执行时为null + * @return + */ +// @Override +// public JSONObject updateUserSysToDing(boolean isBatch, UserEntity userEntity, List dingDeptListPara, +// List dingUserListPara) throws ParseException { +// BaseSystemInfo config = getDingTalkConfig(); +// String corpId = config.getDingSynAppKey(); +// String corpSecret = config.getDingSynAppSecret(); +// // 单条记录执行时,受开关限制 +// int dingIsSyn = isBatch ? 1 : config.getDingSynIsSynUser(); +// JSONObject tokenObject = new JSONObject(); +// String access_token = ""; +// JSONObject retMsg = new JSONObject(); +// DingTalkUserModel userObjectModel = new DingTalkUserModel(); +// List dingDeptList = new ArrayList<>(); +// List dingUserList = new ArrayList<>(); +// SynThirdInfoEntity synThirdInfoEntity = new SynThirdInfoEntity(); +// SynThirdInfoEntity entity = new SynThirdInfoEntity(); +// String opType = ""; +// SynThirdInfoEntity synThirdInfoPara = new SynThirdInfoEntity(); +// String thirdObjId = ""; +// Integer synState = 0; +// String description = ""; +// String userFlag = "更新:"; +// +// // 返回值初始化 +// retMsg.put("code", true); +// retMsg.put("error", userFlag + "系统未设置单条同步"); +// +// // 支持同步 +// if (dingIsSyn==1){ +// // 获取 access_token +// tokenObject = SynDingTalkUtil.getAccessToken(corpId, corpSecret); +// access_token = tokenObject.getString("access_token"); +// +// // 获取同步表信息 +// synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_USER,userEntity.getId()); +// if (access_token != null && !"".equals(access_token)) { +// // 获取企业微信上的所有部门列表信息 +// if(isBatch){ +// dingDeptList = dingDeptListPara; +// }else{ +// JSONObject deptObject = SynDingTalkUtil.getDepartmentList(SynThirdConsts.DING_ROOT_DEPT_ID,access_token); +// if(deptObject.getBoolean("code")) { +// dingDeptList = JsonUtil.getJsonToList(deptObject.getObject("department",List.class), DingTalkDeptModel.class); +// }else{ +// if(synThirdInfoEntity!=null){ +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// }else{ +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + "获取企业微信的部门列表信息失败"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// +// // 更新同步表 +// saveSynThirdInfoEntity(opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),userEntity.getId(),thirdObjId,synState,description); +// +// return retMsg; +// } +// } +// +// +// // 获取钉钉上的所有用户列表信息 +// if(isBatch){ +// dingUserList = dingUserListPara; +// }else { +// JSONObject userObject = SynDingTalkUtil.getUserList(dingDeptList, access_token); +// if (userObject.getBoolean("code")) { +// dingUserList = JsonUtil.getJsonToList(userObject.getObject("userlist", List.class), DingTalkUserModel.class); +// } else { +// if (synThirdInfoEntity != null) { +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// } else { +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + "获取钉钉的用户列表信息失败"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// +// // 更新同步表 +// saveSynThirdInfoEntity(opType, synThirdInfoPara, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), userEntity.getId(), thirdObjId, synState, description); +// +// return retMsg; +// } +// } +// +// // 要同步到企业微信的对象赋值 +// retMsg = setDingUserObject(userEntity,dingDeptList); +// if (retMsg.getBoolean("code")) { +// // 判断当前用户对应的第三方的合法性 +// userObjectModel = retMsg.getObject("dingUserObject",DingTalkUserModel.class); +// retMsg = checkUserSysToDing(synThirdInfoEntity, dingUserList); +// if (!retMsg.getBoolean("code")) { +// if("3".equals(retMsg.getString("flag")) || "1".equals(retMsg.getString("flag"))){ +// // flag:3 未同步,需要创建同步到企业微信、写入同步表 +// // flag:1 已同步但第三方上没对应的ID,需要删除原来的同步信息,再创建同步到企业微信、写入同步表 +// if("1".equals(retMsg.getString("flag"))) { +// synThirdInfoService.delete(synThirdInfoEntity); +// } +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// +// // 判断用户的手机号、邮箱是否唯一,不能重复 +// retMsg = checkUserMobileEmailRepeat(userEntity.getMobilePhone(),userEntity.getEmail(),thirdObjId,dingUserList, +// opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),userEntity.getId(),thirdObjId,userFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 往企业微信写入成员 +// retMsg = SynDingTalkUtil.createUser(userObjectModel, access_token); +// if(retMsg.getBoolean("code")) { +// // 同步成功 +// thirdObjId = userEntity.getId(); +// synState = SynThirdConsts.SYN_STATE_OK; +// description = ""; +// }else{ +// // 同步失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + retMsg.getString("error"); +// } +// } +// +// if("2".equals(retMsg.getString("flag"))){ +// // 已同步但第三方ID为空,需要创建同步到企业微信、修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = ""; +// +// // 判断用户的手机号、邮箱是否唯一,不能重复 +// retMsg = checkUserMobileEmailRepeat(userEntity.getMobilePhone(),userEntity.getEmail(),thirdObjId,dingUserList, +// opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),userEntity.getId(),thirdObjId,userFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 往企业微信写入成员 +// retMsg = SynDingTalkUtil.createUser(userObjectModel, access_token); +// if(retMsg.getBoolean("code")) { +// // 同步成功 +// thirdObjId = userEntity.getId(); +// synState = SynThirdConsts.SYN_STATE_OK; +// description = ""; +// }else{ +// // 同步失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + retMsg.getString("error"); +// } +// } +// +// }else{ +// // 更新同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// +// // 判断用户的手机号、邮箱是否唯一,不能重复 +// retMsg = checkUserMobileEmailRepeat(userEntity.getMobilePhone(),userEntity.getEmail(),thirdObjId,dingUserList, +// opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),userEntity.getId(),thirdObjId,userFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 往企业微信更新成员信息 +// retMsg = SynDingTalkUtil.updateUser(userObjectModel, access_token); +// if(retMsg.getBoolean("code")) { +// // 同步成功 +// synState = SynThirdConsts.SYN_STATE_OK; +// description = ""; +// }else{ +// // 同步失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + retMsg.getString("error"); +// } +// +// } +// +// }else{ +// // 同步失败,原因:用户所属部门找不到相应的企业微信ID、邮箱格式不合法 +// if(synThirdInfoEntity!=null){ +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// }else{ +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + retMsg.getString("error"); +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// } +// +// +// }else{ +// // 同步失败 +// if(synThirdInfoEntity!=null){ +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// }else{ +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + "access_token值为空,不能同步信息"; +// +// retMsg.put("code", true); +// retMsg.put("error", description); +// } +// +// }else{ +// // 未设置单条同步,归并到未同步状态 +// // 获取同步表信息 +// synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_USER,userEntity.getId()); +// if(synThirdInfoEntity!=null){ +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// }else{ +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// +// synState = SynThirdConsts.SYN_STATE_NO; +// description = userFlag + "系统未设置单条同步"; +// +// retMsg.put("code", true); +// retMsg.put("error", description); +// } +// +// // 更新同步表 +// saveSynThirdInfoEntity(opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),userEntity.getId(),thirdObjId,synState,description); +// +// return retMsg; +// } + + + /** + * 往钉钉删除用户 + * 带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param id 本系统的公司或部门ID + * @param dingDeptListPara 单条执行时为null + * @param dingUserListPara 单条执行时为null + * @return + */ +// @Override +// public JSONObject deleteUserSysToDing(boolean isBatch, String id, List dingDeptListPara, +// List dingUserListPara) { +// BaseSystemInfo config = getDingTalkConfig(); +// String corpId = config.getDingSynAppKey(); +// String corpSecret = config.getDingSynAppSecret(); +// // 单条记录执行时,受开关限制 +// int dingIsSyn = isBatch ? 1 : config.getDingSynIsSynUser(); +// JSONObject tokenObject = new JSONObject(); +// String access_token = ""; +// JSONObject retMsg = new JSONObject(); +// List dingDeptList = new ArrayList<>(); +// List dingUserList = new ArrayList<>(); +// SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_USER,id); +// +// // 返回值初始化 +// retMsg.put("code", true); +// retMsg.put("error", "系统未设置单条同步"); +// +// // 支持同步 +// if(synThirdInfoEntity!=null) { +// if(dingIsSyn==1) { +// // 获取 access_token +// tokenObject = SynDingTalkUtil.getAccessToken(corpId, corpSecret); +// access_token = tokenObject.getString("access_token"); +// +// if (access_token != null && !"".equals(access_token)) { +// // 获取企业微信上的所有部门列表信息 +// if(isBatch){ +// dingDeptList = dingDeptListPara; +// }else { +// JSONObject deptObject = SynDingTalkUtil.getDepartmentList(SynThirdConsts.DING_ROOT_DEPT_ID, access_token); +// if (deptObject.getBoolean("code")) { +// dingDeptList = JsonUtil.getJsonToList(deptObject.getObject("department", List.class), DingTalkDeptModel.class); +// } else { +// // 更新同步表 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, "获取钉钉的部门列表信息失败"); +// +// retMsg.put("code", true); +// retMsg.put("error", "获取钉钉的部门列表信息失败"); +// return retMsg; +// } +// } +// +// // 获取企业微信上的所有成员信息列表 +// if(isBatch){ +// dingUserList = dingUserListPara; +// }else{ +// JSONObject userObject = SynDingTalkUtil.getUserList(dingDeptList,access_token); +// if(userObject.getBoolean("code")) { +// dingUserList = JsonUtil.getJsonToList(userObject.getObject("userlist",List.class), DingTalkUserModel.class); +// }else{ +// // 同步失败,获取企业微信的成员列表信息失败 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, "获取企业微信的成员列表信息失败"); +// +// retMsg.put("code", false); +// retMsg.put("error", "获取企业微信的成员列表信息失败"); +// return retMsg; +// } +// } +// +// // 删除企业对应的用户 +// if(dingUserList.stream().filter(t -> t.getUserid().equals(synThirdInfoEntity.getThirdObjId())).count() > 0 ? true : false){ +// retMsg = SynDingTalkUtil.deleteUser(synThirdInfoEntity.getThirdObjId(), access_token); +// if (retMsg.getBoolean("code")) { +// // 同步成功,直接删除同步表记录 +// synThirdInfoService.delete(synThirdInfoEntity); +// }else{ +// // 同步失败 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, retMsg.getString("error")); +// } +// }else{ +// // 根据企业微信ID找不到相应的信息,直接删除同步表记录 +// synThirdInfoService.delete(synThirdInfoEntity); +// } +// }else{ +// // 同步失败 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, "access_token值为空,不能同步信息"); +// +// retMsg.put("code", false); +// retMsg.put("error", "access_token值为空,不能同步信息!"); +// } +// +// }else{ +// // 未设置单条同步,归并到未同步状态 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_NO, "系统未设置同步"); +// +// retMsg.put("code", true); +// retMsg.put("error", "系统未设置单条同步"); +// } +// } +// +// return retMsg; +// } + + + + /** + * 往钉钉创建用户 + * 不带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param userEntity + * @param accessToken (单条调用时为空) + * @return + */ + @Override + public JSONObject createUserSysToDing(boolean isBatch, UserEntity userEntity,String accessToken) throws ParseException { + BaseSystemInfo config = getDingTalkConfig(); + String corpId = config.getDingSynAppKey(); + String corpSecret = config.getDingSynAppSecret(); + // 单条记录执行时,受开关限制 + int dingIsSyn = isBatch ? 1 : config.getDingSynIsSynUser(); + JSONObject tokenObject = new JSONObject(); + String access_token = ""; + JSONObject retMsg = new JSONObject(); + DingTalkUserModel userObjectModel = new DingTalkUserModel(); + String thirdObjId = ""; + Integer synState = 0; + String description = ""; + String userFlag = "创建:"; + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", userFlag + "系统未设置单条同步"); + + if (isBatch || dingIsSyn==1){ + if(isBatch){ + access_token = accessToken; + }else{ + synThirdInfoService.syncThirdInfoByType(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG, SynThirdConsts.THIRD_TYPE_DING_To_Sys); + synThirdInfoService.syncThirdInfoByType(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_USER, SynThirdConsts.THIRD_TYPE_DING_To_Sys); + tokenObject = SynDingTalkUtil.getAccessToken(corpId, corpSecret); + access_token = tokenObject.getString("access_token"); + } + + if (access_token != null && !"".equals(access_token)) { + // 要同步到钉钉的对象赋值 + retMsg = setDingUserObject(userEntity); + if (retMsg.getBoolean("code")) { + userObjectModel = retMsg.getObject("dingUserObject",DingTalkUserModel.class); + + // 往钉钉写入成员 + retMsg = SynDingTalkUtil.createUser(userObjectModel, access_token); + + // 往同步写入本系统与第三方的对应信息 + if (retMsg.getBoolean("code")) { + // 同步成功 + thirdObjId = userEntity.getId(); + synState = SynThirdConsts.SYN_STATE_OK; + } else { + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + } + }else{ + // 同步失败,原因:部门找不到对应的第三方ID、邮箱格式不合法 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + } + + }else{ + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + "access_token值为空,不能同步信息"; + + retMsg.put("code", false); + retMsg.put("error", description); + } + + }else{ + // 无须同步,未同步状态 + synState = SynThirdConsts.SYN_STATE_NO; + description = userFlag + "系统未设置单条同步"; + + retMsg.put("code", true); + retMsg.put("error", description); + } + + // 更新同步表 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_ADD, null, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), userEntity.getId(), thirdObjId, synState, description); + + return retMsg; + } + + + /** + * 往钉钉更新用户 + * 不带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param userEntity + * @param accessToken (单条调用时为空) + * @return + */ + @Override + public JSONObject updateUserSysToDing(boolean isBatch, UserEntity userEntity,String accessToken) throws ParseException { + BaseSystemInfo config = getDingTalkConfig(); + String corpId = config.getDingSynAppKey(); + String corpSecret = config.getDingSynAppSecret(); + // 单条记录执行时,受开关限制 + int dingIsSyn = isBatch ? 1 : config.getDingSynIsSynUser(); + JSONObject tokenObject = new JSONObject(); + String access_token = ""; + JSONObject retMsg = new JSONObject(); + DingTalkUserModel userObjectModel = new DingTalkUserModel(); + SynThirdInfoEntity synThirdInfoEntity = new SynThirdInfoEntity(); + SynThirdInfoEntity entity = new SynThirdInfoEntity(); + String opType = ""; + SynThirdInfoEntity synThirdInfoPara = new SynThirdInfoEntity(); + String thirdObjId = ""; + Integer synState = 0; + String description = ""; + String userFlag = "更新:"; + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", userFlag + "系统未设置单条同步"); + + // 支持同步 + if (isBatch || dingIsSyn==1){ + // 获取 access_token + if(isBatch){ + access_token = accessToken; + }else{ + synThirdInfoService.syncThirdInfoByType(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_USER, SynThirdConsts.THIRD_TYPE_DING_To_Sys); + synThirdInfoService.syncThirdInfoByType(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_ORG, SynThirdConsts.THIRD_TYPE_DING_To_Sys); + tokenObject = SynDingTalkUtil.getAccessToken(corpId, corpSecret); + access_token = tokenObject.getString("access_token"); + } + + // 获取同步表信息 + synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_USER,userEntity.getId()); + if (access_token != null && !"".equals(access_token)) { + // 要同步到企业微信的对象赋值 + retMsg = setDingUserObject(userEntity); + if (retMsg.getBoolean("code")) { + // 判断当前用户对应的第三方的合法性 + userObjectModel = retMsg.getObject("dingUserObject",DingTalkUserModel.class); + retMsg = checkUserSysToDing(synThirdInfoEntity); + if (!retMsg.getBoolean("code")) { + if("3".equals(retMsg.getString("flag")) || "1".equals(retMsg.getString("flag"))){ + // flag:3 未同步,需要创建同步到企业微信、写入同步表 + // flag:1 已同步但第三方上没对应的ID,需要删除原来的同步信息,再创建同步到企业微信、写入同步表 + if("1".equals(retMsg.getString("flag"))) { + synThirdInfoService.delete(synThirdInfoEntity); + } + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + + // 往企业微信写入成员 + retMsg = SynDingTalkUtil.createUser(userObjectModel, access_token); + if(retMsg.getBoolean("code")) { + // 同步成功 + thirdObjId = userEntity.getId(); + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + }else{ + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + } + } + + if("2".equals(retMsg.getString("flag"))){ + // 已同步但第三方ID为空,需要创建同步到企业微信、修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = ""; + + // 往企业微信写入成员 + retMsg = SynDingTalkUtil.createUser(userObjectModel, access_token); + if(retMsg.getBoolean("code")) { + // 同步成功 + thirdObjId = userEntity.getId(); + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + }else{ + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + } + } + + }else{ + // 更新同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + + // 往企业微信更新成员信息 + userObjectModel.setUserid(synThirdInfoEntity.getThirdObjId()); + retMsg = SynDingTalkUtil.updateUser(userObjectModel, access_token); + if(retMsg.getBoolean("code")) { + // 同步成功 + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + }else{ + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + } + + } + + }else{ + // 同步失败,原因:用户所属部门找不到相应的企业微信ID、邮箱格式不合法 + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + } + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + + retMsg.put("code", false); + retMsg.put("error", description); + } + + + }else{ + // 同步失败 + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + } + + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + "access_token值为空,不能同步信息"; + + retMsg.put("code", true); + retMsg.put("error", description); + } + + }else{ + // 未设置单条同步,归并到未同步状态 + // 获取同步表信息 + synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_USER,userEntity.getId()); + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + } + + synState = SynThirdConsts.SYN_STATE_NO; + description = userFlag + "系统未设置单条同步"; + + retMsg.put("code", true); + retMsg.put("error", description); + } + + // 更新同步表 + saveSynThirdInfoEntity(opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),userEntity.getId(),thirdObjId,synState,description); + + return retMsg; + } + + + /** + * 往钉钉删除用户 + * 不带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param id 本系统的公司或部门ID + * @param accessToken (单条调用时为空) + * @return + */ + @Override + public JSONObject deleteUserSysToDing(boolean isBatch, String id,String accessToken) { + BaseSystemInfo config = getDingTalkConfig(); + String corpId = config.getDingSynAppKey(); + String corpSecret = config.getDingSynAppSecret(); + // 单条记录执行时,受开关限制 + int dingIsSyn = isBatch ? 1 : config.getDingSynIsSynUser(); + JSONObject tokenObject = new JSONObject(); + String access_token = ""; + JSONObject retMsg = new JSONObject(); + SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_USER,id); + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", "系统未设置单条同步"); + + // 支持同步 + if(synThirdInfoEntity!=null) { + if(isBatch || dingIsSyn==1) { + // 获取 access_token + if(isBatch){ + access_token = accessToken; + }else{ + List synThirdInfoList = synThirdInfoService.syncThirdInfoByType(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_USER, SynThirdConsts.THIRD_TYPE_DING_To_Sys); + tokenObject = SynDingTalkUtil.getAccessToken(corpId, corpSecret); + access_token = tokenObject.getString("access_token"); + } + + if (access_token != null && !"".equals(access_token)) { + // 删除企业对应的用户 + if (!"".equals(String.valueOf(synThirdInfoEntity.getThirdObjId())) && !"null".equals(String.valueOf(synThirdInfoEntity.getThirdObjId()))) { + retMsg = SynDingTalkUtil.deleteUser(synThirdInfoEntity.getThirdObjId(), access_token); + if (retMsg.getBoolean("code")) { + // 同步成功,直接删除同步表记录 + synThirdInfoService.delete(synThirdInfoEntity); + }else{ + // 同步失败 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, retMsg.getString("error")); + } + }else{ + // 根据企业微信ID找不到相应的信息,直接删除同步表记录 + synThirdInfoService.delete(synThirdInfoEntity); + } + }else{ + // 同步失败 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, "access_token值为空,不能同步信息"); + + retMsg.put("code", false); + retMsg.put("error", "access_token值为空,不能同步信息!"); + } + + }else{ + // 未设置单条同步,归并到未同步状态 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_NO, "系统未设置同步"); + + retMsg.put("code", true); + retMsg.put("error", "系统未设置单条同步"); + } + } + + return retMsg; + } + + + + + //------------------------------------钉钉同步用户到本系统20220331------------------------------------- + + /** + * 钉钉往本地创建用户 + * 不带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20220331 + * @param isBatch 是否批量(批量不受开关限制) + * @param dingUserModel + * @param accessToken (单条调用时为空) + * @return + */ + @Override + public JSONObject createUserDingToSys(boolean isBatch, OapiV2UserListResponse.ListUserResponse dingUserModel, String accessToken) throws Exception { + + String dingUserId = dingUserModel.getUserid(); + String dingUserName = dingUserModel.getName(); + String dingMobile = dingUserModel.getMobile(); + String dingTelephone = dingUserModel.getTelephone(); + // 工号不唯一的情况,不能用于做本系统的账号 + String dingJobNumber = dingUserModel.getJobNumber(); + // 职位:是字符串,手入的 + String title = dingUserModel.getTitle(); + String sysObjId= ""; + BaseSystemInfo config = getDingTalkConfig(); + // 单条记录执行时,受开关限制 + int dingIsSyn = config.getDingSynIsSynUser(); + JSONObject retMsg = new JSONObject(); + String thirdObjId = dingUserId; + Integer synState = 0; + String description = ""; + String userFlag = "创建:"; + UserEntity userEntity = new UserEntity(); + String tag= SynThirdConsts.OBJECT_OP_ADD; + if(isBatch || dingIsSyn==1){ + // 检测账户唯一 + UserEntity userAccount = userService.getUserByMobile(dingMobile); + if (userAccount!=null) { + // 查询用户id在不在同步表 + sysObjId= userAccount.getId(); + boolean hasExist = synThirdInfoService.getBySysObjId(sysObjId); + if (hasExist) { + // 说明创建过了,直接跳过 + tag=SynThirdConsts.OBJECT_OP_UPD; + synState=1; + description="创建过,更新对象"; + return retMsg; + }else{ + retMsg.put("code", true); + description = "账户名重复:线上手机账号"+dingMobile+"自动合并为本地账号"; + synState = SynThirdConsts.SYN_STATE_OK; + retMsg.put("msg", description); + } + }else{ + // 判断中间表用户组织是否存在 + List deptIdList = dingUserModel.getDeptIdList(); + List deptIdStrList = deptIdList.stream().map(t->t+"").collect(Collectors.toList()); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().in(SynThirdInfoEntity::getThirdObjId,deptIdStrList); + wrapper.lambda().eq(SynThirdInfoEntity::getThirdType,SynThirdConsts.THIRD_TYPE_DING_To_Sys); + List synThirdInfoEntities = synThirdInfoService.getBaseMapper().selectList(wrapper); + if(synThirdInfoEntities!=null && synThirdInfoEntities.size()!=0){ + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", userFlag + "系统未设置单条同步"); + userEntity.setId(RandomUtil.uuId()); + userEntity.setHeadIcon("001.png"); + userEntity.setAccount(dingMobile); + // 工号 + userEntity.setDingJobNumber(dingUserModel.getJobNumber()); + userEntity.setEmail(dingUserModel.getEmail()); + + userEntity.setCertificatesNumber(dingUserModel.getJobNumber()); + userEntity.setMobilePhone(dingMobile); +// userEntity.setGender(2); + userEntity.setRealName(dingUserName); + userEntity.setEnabledMark(1); + if(StringUtil.isBlank(userEntity.getOrganizeId())){ + String orgId = synThirdInfoService.getSysByThird(String.valueOf(deptIdList.get(0))); + userEntity.setOrganizeId(orgId); + } + userEntity.setPassword("4a7d1ed414474e4033ac29ccb8653d9b"); + //2025-05-07 钉钉消息bug + //sysObjId = userEntity.getId(); + List orgIdList = new ArrayList<>(); + for (String deptIdStr:deptIdStrList){ + String orgId = synThirdInfoService.getSysByThird(deptIdStr); + orgIdList.add(orgId); + } + userEntity.setOrganizeId(orgIdList.stream().collect(Collectors.joining(","))); + userService.create(userEntity); + sysObjId = userEntity.getId(); + + +// userRelationService.syncDingUserRelation(sysObjId,deptIdList); + // 往同步写入本系统与第三方的对应信息 + if (retMsg.getBoolean("code")) { + // 同步成功 + synState = SynThirdConsts.SYN_STATE_OK; + } else { + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + } + + }else{ + // 无须同步,未同步状态 + synState = SynThirdConsts.SYN_STATE_NO; + description = userFlag + "用户未同步组织信息"; + retMsg.put("code", false); + retMsg.put("error", description); + } + } + }else{ + // 无须同步,未同步状态 + synState = SynThirdConsts.SYN_STATE_NO; + description = userFlag + "系统未设置单条同步"; + retMsg.put("code", true); + retMsg.put("error", description); + } + // 更新同步表 + saveSynThirdInfoEntity(tag, null, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING_To_Sys), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),sysObjId, thirdObjId, synState, description); + return retMsg; + } + + + /** + * 往钉钉更新用户 + * 不带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20220331 + * @param isBatch 是否批量(批量不受开关限制) + * @param userEntity + * @param accessToken (单条调用时为空) + * @return + */ + @Override + public JSONObject updateUserDingToSys(boolean isBatch, UserEntity userEntity,String accessToken) throws ParseException { + BaseSystemInfo config = getDingTalkConfig(); + String corpId = config.getDingSynAppKey(); + String corpSecret = config.getDingSynAppSecret(); + // 单条记录执行时,受开关限制 + int dingIsSyn = isBatch ? 1 : config.getDingSynIsSynUser(); + JSONObject tokenObject = new JSONObject(); + String access_token = ""; + JSONObject retMsg = new JSONObject(); + DingTalkUserModel userObjectModel = new DingTalkUserModel(); + SynThirdInfoEntity synThirdInfoEntity = new SynThirdInfoEntity(); + SynThirdInfoEntity entity = new SynThirdInfoEntity(); + String opType = ""; + SynThirdInfoEntity synThirdInfoPara = new SynThirdInfoEntity(); + String thirdObjId = ""; + Integer synState = 0; + String description = ""; + String userFlag = "更新:"; + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", userFlag + "系统未设置单条同步"); + + // 支持同步 + if (isBatch || dingIsSyn==1){ + // 获取 access_token + if(isBatch){ + access_token = accessToken; + }else{ + tokenObject = SynDingTalkUtil.getAccessToken(corpId, corpSecret); + access_token = tokenObject.getString("access_token"); + } + + // 获取同步表信息 + synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_USER,userEntity.getId()); + if (access_token != null && !"".equals(access_token)) { + // 要同步到企业微信的对象赋值 + retMsg = setDingUserObject(userEntity); + if (retMsg.getBoolean("code")) { + // 判断当前用户对应的第三方的合法性 + userObjectModel = retMsg.getObject("dingUserObject",DingTalkUserModel.class); + retMsg = checkUserSysToDing(synThirdInfoEntity); + if (!retMsg.getBoolean("code")) { + if("3".equals(retMsg.getString("flag")) || "1".equals(retMsg.getString("flag"))){ + // flag:3 未同步,需要创建同步到企业微信、写入同步表 + // flag:1 已同步但第三方上没对应的ID,需要删除原来的同步信息,再创建同步到企业微信、写入同步表 + if("1".equals(retMsg.getString("flag"))) { + synThirdInfoService.delete(synThirdInfoEntity); + } + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + + // 往企业微信写入成员 + retMsg = SynDingTalkUtil.createUser(userObjectModel, access_token); + if(retMsg.getBoolean("code")) { + // 同步成功 + thirdObjId = userEntity.getId(); + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + }else{ + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + } + } + + if("2".equals(retMsg.getString("flag"))){ + // 已同步但第三方ID为空,需要创建同步到企业微信、修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = ""; + + // 往企业微信写入成员 + retMsg = SynDingTalkUtil.createUser(userObjectModel, access_token); + if(retMsg.getBoolean("code")) { + // 同步成功 + thirdObjId = userEntity.getId(); + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + }else{ + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + } + } + + }else{ + // 更新同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + + // 往企业微信更新成员信息 + retMsg = SynDingTalkUtil.updateUser(userObjectModel, access_token); + if(retMsg.getBoolean("code")) { + // 同步成功 + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + }else{ + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + } + + } + + }else{ + // 同步失败,原因:用户所属部门找不到相应的企业微信ID、邮箱格式不合法 + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + } + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + + retMsg.put("code", false); + retMsg.put("error", description); + } + + + }else{ + // 同步失败 + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + } + + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + "access_token值为空,不能同步信息"; + + retMsg.put("code", true); + retMsg.put("error", description); + } + + }else{ + // 未设置单条同步,归并到未同步状态 + // 获取同步表信息 +// synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.DATA_TYPE_USER,userEntity.getId()); +// if(synThirdInfoEntity!=null){ +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// }else{ +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } + synState = SynThirdConsts.SYN_STATE_NO; + description = userFlag + "系统未设置单条同步"; + + retMsg.put("code", true); + retMsg.put("error", description); + } + + // 更新同步表 + saveSynThirdInfoEntity(opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),userEntity.getId(),thirdObjId,synState,description); + + return retMsg; + } + @Override + public JSONObject updateUserDingToSystem(boolean isBatch, OapiV2UserListResponse.ListUserResponse dingUserModel) throws Exception { + BaseSystemInfo config = getDingTalkConfig(); + + JSONObject retMsg = new JSONObject(); + SynThirdInfoEntity synThirdInfoEntity = new SynThirdInfoEntity(); + String opType = ""; + String thirdObjId = ""; + Integer synState = 0; + String description = ""; + String userFlag = "更新:"; + + // 赋值第三方id + thirdObjId = dingUserModel.getUserid(); + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", userFlag + "系统未设置单条同步"); + + // 单条记录执行时,受开关限制 + int dingIsSyn = config.getDingSynIsSynUser(); + // 支持同步 + if (isBatch || dingIsSyn==1){ + // 获取同步表信息 + /** + * 获取指定第三方工具、指定数据类型、本地对象ID的同步信息 + * // 获取方式如果第三方用户id和第三方组织id会一致则须修改 + * thirdType 22 钉钉 + * dataType 2 用户 + * thirdId 第三方id + */ + synThirdInfoEntity = synThirdInfoService.getInfoByThirdObjId(SynThirdConsts.THIRD_TYPE_DING_To_Sys,SynThirdConsts.DATA_TYPE_USER,thirdObjId); + + if(synThirdInfoEntity!=null && StringUtil.isNoneBlank(synThirdInfoEntity.getSysObjId())){ + opType = SynThirdConsts.OBJECT_OP_UPD; + String sysObjId = synThirdInfoEntity.getSysObjId(); + + UserEntity info = userService.getInfo(sysObjId); + if(info==null){ + synState = SynThirdConsts.SYN_STATE_NO; + description = "本地更新记录未找到"; + retMsg.put("code", false); + retMsg.put("error", description); + synThirdInfoService.removeById(synThirdInfoEntity.getId()); + + + }else{ + String dingUserName = dingUserModel.getName(); + String dingMobile = dingUserModel.getMobile(); + + // 更新系统用户表 + List deptIdList = dingUserModel.getDeptIdList(); + List deptIdStrList = deptIdList.stream().map(t->t+"").collect(Collectors.toList()); + info.setMobilePhone(dingMobile); + info.setAccount(dingMobile); + info.setRealName(dingUserName); + List orgIdList = new ArrayList<>(); + for (String deptIdStr:deptIdStrList){ + String orgId = synThirdInfoService.getSysByThird(deptIdStr); + orgIdList.add(orgId); + } + info.setOrganizeId(orgIdList.stream().collect(Collectors.joining(","))); + userService.update(info.getId(), info); + + // 检测是否未同步用户组织关联 + // userRelationService.syncDingUserRelation(info.getId(),deptIdList); + + synState=1; + // 更新同步表记录 + description="账号同步更新完成"; + saveSynThirdInfoEntity(opType, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING_To_Sys), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),synThirdInfoEntity.getSysObjId(), thirdObjId, synState, description); + + } + + }else{ + if((synThirdInfoEntity!=null && StringUtil.isBlank(synThirdInfoEntity.getSysObjId() ))){ + // 删除记录 + synThirdInfoService.removeById(synThirdInfoEntity.getId()); + } + opType = SynThirdConsts.OBJECT_OP_ADD; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + try { + this.createUserDingToSys(true,dingUserModel,null); + } catch (ParseException e) { + e.printStackTrace(); + } + } + }else{ + // 未设置单条同步,归并到未同步状态 + synState = SynThirdConsts.SYN_STATE_NO; + description = userFlag + "系统未设置单条同步"; + + retMsg.put("code", true); + retMsg.put("error", description); + opType= SynThirdConsts.OBJECT_OP_ADD; + + saveSynThirdInfoEntity(opType, null, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING_To_Sys), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),null, thirdObjId, synState, description); + } + + // 更新同步表 + /** + * 将组织、用户的信息写入同步表 + * @param opType "add":创建 “upd”:修改 + * @param synThirdInfoEntity 本地同步表信息 + * @param thirdType 第三方类型 + * @param dataType 数据类型 + * @param sysObjId 本地对象ID + * @param thirdObjId 第三方对象ID + * @param synState 同步状态(0:未同步;1:同步成功;2:同步失败) + * @param description + */ + + return retMsg; + } + + @Override + public void deleteSyncByBothWay(String thirdTypeDing, String id) { + HashMap typeMap = new HashMap<>(); + typeMap.put(SynThirdConsts.THIRD_TYPE_DING,SynThirdConsts.THIRD_TYPE_DING_To_Sys); + typeMap.put(SynThirdConsts.THIRD_TYPE_DING_To_Sys,SynThirdConsts.THIRD_TYPE_DING); + SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(typeMap.get(thirdTypeDing),SynThirdConsts.DATA_TYPE_USER,id); + if(synThirdInfoEntity!=null){ + synThirdInfoService.delete(synThirdInfoEntity); + } + } + + /** + * 本地删除用户、中间表 + * 不带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20220331 + * @param isBatch 是否批量(批量不受开关限制) + * @param thirdObjId 钉钉的用户ID + * @return + */ + @Override + public JSONObject deleteUserDingToSys(boolean isBatch, String thirdObjId) throws Exception { + BaseSystemInfo config = getDingTalkConfig(); +// String corpId = config.getDingSynAppKey(); +// String corpSecret = config.getDingSynAppSecret(); + // 单条记录执行时,受开关限制 + int dingIsSyn = isBatch ? 1 : config.getDingSynIsSynUser(); +// JSONObject tokenObject = new JSONObject(); +// String access_token = ""; + JSONObject retMsg = new JSONObject(); + SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoByThirdObjId(SynThirdConsts.THIRD_TYPE_DING_To_Sys,SynThirdConsts.DATA_TYPE_USER,thirdObjId); + String sysObjId = ""; + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", "系统未设置单条同步"); + + // 支持同步 + if(synThirdInfoEntity!=null) { + sysObjId = synThirdInfoEntity.getSysObjId(); + if(isBatch || dingIsSyn==1) { + // 删除企业对应的用户 + if (!"".equals(String.valueOf(sysObjId)) && !"null".equals(String.valueOf(sysObjId))) { + // 获取用户信息 + UserEntity userEntity = userService.getInfo(sysObjId); + if(userEntity!=null){ + // 删除用户,更新为标记为不可登录 + // 禁用登录 + userEntity.setEnabledMark(0); + userEntity.setDescription("由于钉钉系统删除了该用户"); + + userService.update(userEntity.getId(), userEntity); + + // 同步成功,直接删除同步表记录 + synThirdInfoService.delete(synThirdInfoEntity); + }else{ + // 同步失败 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING_To_Sys), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), sysObjId, thirdObjId, SynThirdConsts.SYN_STATE_FAIL, retMsg.getString("error")); + } + }else{ + // 根据企业微信ID找不到相应的信息,直接删除同步表记录 + synThirdInfoService.delete(synThirdInfoEntity); + } + + }else{ + // 未设置单条同步,归并到未同步状态 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_DING_To_Sys), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), sysObjId, thirdObjId, SynThirdConsts.SYN_STATE_NO, "系统未设置同步"); + + retMsg.put("code", true); + retMsg.put("error", "系统未设置单条同步"); + } + } + + return retMsg; + } + + + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/SynThirdInfoServiceImpl.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/SynThirdInfoServiceImpl.java new file mode 100644 index 0000000..b021ea4 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/SynThirdInfoServiceImpl.java @@ -0,0 +1,303 @@ +package com.yunzhupaas.message.service.impl; + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.dingtalk.api.response.OapiV2DepartmentGetResponse; +import com.yunzhupaas.message.entity.SynThirdInfoEntity; +import com.yunzhupaas.message.mapper.SynThirdInfoMapper; +import com.yunzhupaas.message.model.message.DingTalkDeptModel; +import com.yunzhupaas.message.service.SynThirdDingTalkService; +import com.yunzhupaas.message.service.SynThirdInfoService; +import com.yunzhupaas.base.util.SynDingTalkUtil; +import com.yunzhupaas.message.util.SynThirdConsts; +import com.yunzhupaas.message.util.SynThirdTotal; +import com.yunzhupaas.permission.service.OrganizeService; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 第三方工具的公司-部门-用户同步表模型 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021/4/23 17:33 + */ +@Service +public class SynThirdInfoServiceImpl extends SuperServiceImpl implements SynThirdInfoService { + @Autowired + private OrganizeService organizeApi; + @Autowired + private UserService userApi; + @Autowired + SynThirdDingTalkService synThirdDingTalkService; + + @Override + public List getList(String thirdType, String dataType) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().and(t->t.eq(SynThirdInfoEntity::getThirdType, Integer.valueOf(thirdType))); + queryWrapper.lambda().and(t->t.eq(SynThirdInfoEntity::getDataType, Integer.valueOf(dataType))); + queryWrapper.lambda().orderByAsc(SynThirdInfoEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public SynThirdInfoEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SynThirdInfoEntity::getId,id); + return this.getOne(queryWrapper); + } + + @Override + public void create(SynThirdInfoEntity entity) { + this.save(entity); + } + + @Override + public boolean update(String id, SynThirdInfoEntity entity) { + entity.setId(id); + return this.updateById(entity); + } + + @Override + public void delete(SynThirdInfoEntity entity) { + if(entity!=null){ + this.removeById(entity.getId()); + } + } + + @Override + public SynThirdInfoEntity getInfoBySysObjId(String thirdType,String dataType,String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().and(t->t.eq(SynThirdInfoEntity::getThirdType,thirdType)); + queryWrapper.lambda().and(t->t.eq(SynThirdInfoEntity::getDataType,dataType)); + queryWrapper.lambda().and(t->t.eq(SynThirdInfoEntity::getSysObjId,id)); + return this.getOne(queryWrapper); + } + + @Override + public SynThirdTotal getSynTotal(String thirdType, String dataType) { + String synType = dataType.equals(SynThirdConsts.DATA_TYPE_ORG) ? "组织" : "用户"; + Integer recordTotal = 0; + Long synSuccessCount = 0L; + Long synFailCount = 0L; + Long unSynCount = 0L; + Date synDate = null; + + // 获取列表数据 + List synList = getList(thirdType, dataType).stream().filter(t->t.getLastModifyTime() != null).collect(Collectors.toList()); + if(synList!=null && synList.size()>0){ + synSuccessCount = synList.stream().filter(t -> t.getEnabledMark().equals(SynThirdConsts.SYN_STATE_OK)).count(); + synFailCount = synList.stream().filter(t -> t.getEnabledMark().equals(SynThirdConsts.SYN_STATE_FAIL)).count(); + unSynCount = synList.stream().filter(t -> t.getEnabledMark().equals(SynThirdConsts.SYN_STATE_NO)).count(); + synDate = synList.stream().max(Comparator.comparing(u -> u.getLastModifyTime())).isPresent() ? synList.stream().max(Comparator.comparing(u -> u.getLastModifyTime())).get().getLastModifyTime() : null; + } + + // 获取本系统的组织、用户表的记录数 + if(dataType.equals(SynThirdConsts.DATA_TYPE_ORG)){ + // 获取组织(公司和部门)的记录数 + recordTotal = organizeApi.getList(false).size(); + }else{ + // 获取用户的记录数 + recordTotal = userApi.getList(false).size(); + } + + // 写入同步统计模型对象 + SynThirdTotal synThirdTotal = new SynThirdTotal(); + synThirdTotal.setSynType(synType); + synThirdTotal.setRecordTotal(recordTotal); + synThirdTotal.setSynSuccessCount(synSuccessCount); + synThirdTotal.setSynFailCount(synFailCount); + synThirdTotal.setUnSynCount(unSynCount); + synThirdTotal.setSynDate(synDate); + + return synThirdTotal; + } + + @Override + public List syncThirdInfoByType(String thirdToSysType, String dataTypeOrg, String SysToThirdType) { + + HashMap typeMap = new HashMap<>(); + typeMap.put(SysToThirdType,thirdToSysType); + typeMap.put(thirdToSysType,SysToThirdType); + + List synThirdInfoList = this.getList(thirdToSysType, dataTypeOrg); + List synThirdInfoDingList = this.getList( typeMap.get(thirdToSysType), dataTypeOrg); + + + List collectSource = synThirdInfoList.stream().filter(t -> StringUtil.isBlank(t.getThirdObjId()) || StringUtil.isBlank(t.getSysObjId())).map(t->t.getId()).collect(Collectors.toList()); + List collectTarget = synThirdInfoDingList.stream().filter(t -> StringUtil.isBlank(t.getThirdObjId()) || StringUtil.isBlank(t.getSysObjId())).map(t->t.getId()).collect(Collectors.toList()); + List deleteList = new ArrayList<>(); + deleteList.addAll(collectSource); + deleteList.addAll(collectTarget); +// List fails = this.selectAllFail(); +// deleteList.addAll(fails); + if(!deleteList.isEmpty()){ + + this.getBaseMapper().deleteBatchIds(deleteList); + } + + + synThirdInfoList = this.getList(thirdToSysType, dataTypeOrg); + synThirdInfoDingList = this.getList( typeMap.get(thirdToSysType), dataTypeOrg); + // 记录已经存在的组合 + HashMap existingMap = new HashMap<>(); + synThirdInfoList.forEach(k->{ + String tag = k.getThirdType() + "-" + k.getDataType() + "-" +k.getSysObjId() +"-"+k.getThirdObjId(); + existingMap.put(tag,true); + }); + synThirdInfoDingList.forEach(k->{ + String tag = k.getThirdType() + "-" + k.getDataType() + "-" +k.getSysObjId() +"-"+k.getThirdObjId(); + existingMap.put(tag,true); + }); + + + HashMap mapSource = new HashMap<>(); + HashMap mapTarget = new HashMap<>(); + String tag = ""; + for(SynThirdInfoEntity entity :synThirdInfoList){ +// if(collectSource.size()>0 && !collectSource.contains(entity.getId())){ + tag =entity.getSysObjId() +"-" + entity.getThirdObjId(); + mapSource.put(tag,entity); +// } + } + for(SynThirdInfoEntity entity :synThirdInfoDingList){ +// if(collectTarget.size()>0 && !collectTarget.contains(entity.getId())){ + tag =entity.getSysObjId() +"-" + entity.getThirdObjId(); + mapTarget.put(tag,entity); +// } + } + + // 同步记录 + List synThirdInfoAddList = new ArrayList<>(); + SynThirdInfoEntity addEntity = null; + if(mapSource.size()==0 && mapTarget.size()==0){ + return new ArrayList<>(); + }else if (mapSource.size()>0 && mapTarget.size()==0){ + for(String key : mapSource.keySet()){ + SynThirdInfoEntity synThirdInfoEntity = mapSource.get(key); + addEntity = JsonUtil.getJsonToBean(synThirdInfoEntity,SynThirdInfoEntity.class); + addEntity.setId(RandomUtil.uuId()); + addEntity.setThirdType(Integer.valueOf(typeMap.get(thirdToSysType))); + synThirdInfoAddList.add(addEntity); + } + + }else if (mapSource.size()==0 && mapTarget.size()>0){ + for(String key : mapTarget.keySet()){ + SynThirdInfoEntity synThirdInfoEntity = mapTarget.get(key); + addEntity = JsonUtil.getJsonToBean(synThirdInfoEntity,SynThirdInfoEntity.class); + addEntity.setId(RandomUtil.uuId()); + addEntity.setThirdType(Integer.valueOf(thirdToSysType)); + synThirdInfoAddList.add(addEntity); + } + }else{ + for(String key : mapSource.keySet()){ + if(!mapTarget.containsKey(key)){ + SynThirdInfoEntity synThirdInfoEntity = mapSource.get(key); + addEntity = JsonUtil.getJsonToBean(synThirdInfoEntity,SynThirdInfoEntity.class); + addEntity.setId(RandomUtil.uuId()); + addEntity.setThirdType(Integer.valueOf(typeMap.get(thirdToSysType))); + synThirdInfoAddList.add(addEntity); + } + } + for(String key : mapTarget.keySet()){ + if(!mapSource.containsKey(key)){ + SynThirdInfoEntity synThirdInfoEntity = mapTarget.get(key); + addEntity = JsonUtil.getJsonToBean(synThirdInfoEntity,SynThirdInfoEntity.class); + addEntity.setId(RandomUtil.uuId()); + addEntity.setThirdType(Integer.valueOf(thirdToSysType)); + synThirdInfoAddList.add(addEntity); + } + } + + } + + ArrayList addList = new ArrayList<>(); + if(synThirdInfoAddList.size() > 0 ){ + // 过滤 + synThirdInfoAddList.forEach(k->{ + String addTag = k.getThirdType() + "-" + k.getDataType() + "-" +k.getSysObjId() +"-"+k.getThirdObjId(); + if (existingMap.get(addTag)==null) { + addList.add(k); + } + }); + this.saveBatch(addList); + } + // 查找对应的数据 + synThirdInfoList = this.getList(thirdToSysType, dataTypeOrg); + return synThirdInfoList; + } + + private List selectAllFail() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().and(t->t.eq(SynThirdInfoEntity::getEnabledMark,"2")); + List lists = this.getBaseMapper().selectList(queryWrapper); + return lists.stream().map(t->t.getId()).collect(Collectors.toList()); + } + + @Override + public void initBaseDept(Long dingRootDeptId, String access_token, String thirdType) { + final String sysByThird = this.getSysByThird("1"); + // 判断是否在中间表存在 + JSONObject retMsg = new JSONObject(); + + if(StringUtil.isBlank(sysByThird)){ + if("22".equals(thirdType)){ + retMsg = SynDingTalkUtil.getDepartmentInfo(SynThirdConsts.DING_ROOT_DEPT_ID, access_token); + OapiV2DepartmentGetResponse.DeptGetResponse departmentInfo = (OapiV2DepartmentGetResponse.DeptGetResponse) retMsg.get("departmentInfo"); + DingTalkDeptModel model = JsonUtil.getJsonToBean(departmentInfo, DingTalkDeptModel.class); + retMsg = synThirdDingTalkService.createDepartmentDingToSys(true, model, access_token); + } +// if("11".equals(thirdType)){ +// retMsg = SynDingTalkUtil.getDepartmentInfo(SynThirdConsts.QY_ROOT_DEPT_ID, access_token); +// OapiV2DepartmentGetResponse.DeptGetResponse departmentInfo = (OapiV2DepartmentGetResponse.DeptGetResponse) retMsg.get("departmentInfo"); +// DingTalkDeptModel model = JsonUtil.getJsonToBean(departmentInfo, DingTalkDeptModel.class); +// retMsg = synThirdDingTalkService.createDepartmentDingToSys(true, model, access_token); +// } + } + } + + @Override + public boolean getBySysObjId(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SynThirdInfoEntity::getEnabledMark,"1"); + queryWrapper.lambda().eq(SynThirdInfoEntity::getSysObjId,id); + List list = this.getBaseMapper().selectList(queryWrapper); + if(list!=null && list.size() > 0){ + return true; + }else{ + return false; + } + } + + @Override + public String getSysByThird(String valueOf) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().isNotNull(SynThirdInfoEntity::getSysObjId); + queryWrapper.lambda().eq(SynThirdInfoEntity::getThirdObjId,valueOf); + List list = this.getBaseMapper().selectList(queryWrapper); + if(list!=null && !list.isEmpty()){ + return list.get(0).getSysObjId(); + } + return null; + } + + @Override + public SynThirdInfoEntity getInfoByThirdObjId(String thirdType,String dataType,String thirdObjId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().and(t->t.eq(SynThirdInfoEntity::getThirdType,thirdType)); + queryWrapper.lambda().and(t->t.eq(SynThirdInfoEntity::getDataType,dataType)); + queryWrapper.lambda().and(t->t.eq(SynThirdInfoEntity::getThirdObjId,thirdObjId)); + return this.getOne(queryWrapper); + } + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/SynThirdQyServiceImpl.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/SynThirdQyServiceImpl.java new file mode 100644 index 0000000..5163b99 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/SynThirdQyServiceImpl.java @@ -0,0 +1,3073 @@ +package com.yunzhupaas.message.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.SysConfigEntity; +import com.yunzhupaas.base.service.SysconfigService; +import com.yunzhupaas.exception.WxErrorException; +import com.yunzhupaas.message.entity.SynThirdInfoEntity; +import com.yunzhupaas.message.model.message.DingTalkDeptModel; +import com.yunzhupaas.message.model.message.QyWebChatDeptModel; +import com.yunzhupaas.message.model.message.QyWebChatUserModel; +import com.yunzhupaas.message.service.SynThirdInfoService; +import com.yunzhupaas.message.service.SynThirdQyService; +import com.yunzhupaas.base.util.SynQyWebChatUtil; +import com.yunzhupaas.message.util.SynThirdConsts; +import com.yunzhupaas.model.BaseSystemInfo; +import com.yunzhupaas.permission.entity.OrganizeEntity; +import com.yunzhupaas.permission.entity.PositionEntity; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.OrganizeService; +import com.yunzhupaas.permission.service.PositionService; +import com.yunzhupaas.permission.service.UserRelationService; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.util.Assert; + +import java.text.ParseException; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 本系统的公司、部门、用户与企业微信的同步 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021/4/27 11:12 + */ +@Component +public class SynThirdQyServiceImpl implements SynThirdQyService { + @Autowired + private SysconfigService sysconfigService; + @Autowired + private SynThirdInfoService synThirdInfoService; + @Autowired + private UserService userService; + @Autowired + private PositionService positionService; + @Autowired + private OrganizeService organizeService; + @Autowired + private UserRelationService userRelationService; + /** + * 获取企业微信的配置信息 + * @return + */ + @Override + public BaseSystemInfo getQyhConfig() { + Map objModel = new HashMap<>(); + List configList = sysconfigService.getList("SysConfig"); + for (SysConfigEntity entity : configList) { + objModel.put(entity.getFkey(), entity.getValue()); + } + BaseSystemInfo baseSystemInfo = JsonUtil.getJsonToBean(objModel, BaseSystemInfo.class); + return baseSystemInfo; + } + + //------------------------------------本系统同步公司、部门到企业微信------------------------------------- + + /** + * 根据部门的同步表信息判断同步情况 + * 有带第三方错误定位判断的功能代码 20210604 + * @param synThirdInfoEntity + * @param qyDeptList + * @return + */ +// public JSONObject checkDepartmentSysToQy(SynThirdInfoEntity synThirdInfoEntity, List qyDeptList) { +// JSONObject retMsg = new JSONObject(); +// retMsg.put("code",true); +// retMsg.put("flag",""); +// retMsg.put("error",""); +// +// if(synThirdInfoEntity!=null){ +// if(StringUtil.isNotEmpty(synThirdInfoEntity.getThirdObjId())) { +// // 同步表存在企业微信ID,仍需要判断企业微信上有没此部门 +// if(qyDeptList.stream().filter(t -> t.getId().toString().equals(synThirdInfoEntity.getThirdObjId())).count() == 0 ? true : false){ +// retMsg.put("code",false); +// retMsg.put("flag","1"); +// retMsg.put("error","企业微信不存在同步表对应的部门ID!"); +// } +// }else{ +// // 同步表的企业微信ID为空 +// retMsg.put("code",false); +// retMsg.put("flag","2"); +// retMsg.put("error","同步表中部门对应的企业微信ID为空!"); +// } +// }else{ +// // 上级部门未同步 +// retMsg.put("code",false); +// retMsg.put("flag","3"); +// retMsg.put("error","部门未同步到企业微信!"); +// } +// +// return retMsg; +// } + + /** + * 根据部门的同步表信息判断同步情况 + * 不带第三方错误定位判断的功能代码 20210604 + * @param synThirdInfoEntity + * @return + */ + public JSONObject checkDepartmentSysToQy(SynThirdInfoEntity synThirdInfoEntity) { + JSONObject retMsg = new JSONObject(); + retMsg.put("code",true); + retMsg.put("flag",""); + retMsg.put("error",""); + + if(synThirdInfoEntity!=null){ + // 同步表的企业微信ID为空 + if("".equals(String.valueOf(synThirdInfoEntity.getThirdObjId())) || "null".equals(String.valueOf(synThirdInfoEntity.getThirdObjId()))) { + retMsg.put("code",false); + retMsg.put("flag","2"); + retMsg.put("error","同步表中部门对应的企业微信ID为空!"); + } + + }else{ + // 上级部门未同步 + retMsg.put("code",false); + retMsg.put("flag","3"); + retMsg.put("error","部门未同步到企业微信!"); + } + + return retMsg; + } + + + + /** + * 同步到企业微信的部门名称、部门英文名称是否重复 + * 有带第三方错误定位判断的功能代码 20210604 + * @param isEnglish + * @param name + * @param parentId + * @param id + * @param qyDeptList + * @return + */ +// public JSONObject checkDeptObjectNameSysToQy(boolean isEnglish, String name, String parentId, String id, List qyDeptList, +// String opType, SynThirdInfoEntity synThirdInfoEntity, Integer thirdType, +// Integer dataType, String sysObjId, String thirdObjId, String deptFlag){ +// boolean isDiff = false; +// JSONObject retMsg = new JSONObject(); +// retMsg.put("code",true); +// retMsg.put("error",""); +// +// // 创建时:判断同一个层级的部门名称、部门英文名称不能重复 +// if(StringUtil.isEmpty(id)){ +// isDiff = qyDeptList.stream().filter(t -> t.getName().equals(name) && t.getParentid().toString().equals(parentId)).count() > 0 ? true : false; +// }else{ +// isDiff = qyDeptList.stream().filter(t -> t.getName().equals(name) && t.getParentid().toString().equals(parentId) && !(t.getId().toString().equals(id)) ).count() > 0 ? true : false; +// } +// if(isDiff){ +// // 同步失败 +// Integer synState = SynThirdConsts.SYN_STATE_FAIL; +// String description = deptFlag + (isEnglish ? "同一层次的部门英文名称重复" : "同一层次的部门名称重复"); +// +// // 更新同步表 +// saveSynThirdInfoEntity(opType,synThirdInfoEntity,thirdType,dataType,sysObjId,thirdObjId,synState,description); +// +// retMsg.put("code", false); +// retMsg.put("error",description); +// } +// return retMsg; +// } + + /** + * 检查部门中文名称与英文名称是否相同 + * @param cnName + * @param EnName + * @param opType + * @param synThirdInfoEntity + * @param thirdType + * @param dataType + * @param sysObjId + * @param thirdObjId + * @param deptFlag + * @return + */ + public JSONObject checkCnEnName(String cnName, String EnName, + String opType, SynThirdInfoEntity synThirdInfoEntity, Integer thirdType, + Integer dataType, String sysObjId, String thirdObjId, String deptFlag){ + JSONObject retMsg = new JSONObject(); + retMsg.put("code",true); + retMsg.put("error",""); + if(cnName.equals(EnName)){ + // 同步失败 + Integer synState = SynThirdConsts.SYN_STATE_FAIL; + String description = deptFlag + "部门中文名称与英文名称不能相同"; + + // 更新同步表 + saveSynThirdInfoEntity(opType,synThirdInfoEntity,thirdType,dataType,sysObjId,thirdObjId,synState,description); + + retMsg.put("code", false); + retMsg.put("error", description); + } + return retMsg; + } + + + + /** + * 将组织、用户的信息写入同步表 + * @param opType "add":创建 “upd”:修改 + * @param synThirdInfoEntity 本地同步表信息 + * @param thirdType 第三方类型 + * @param dataType 数据类型 + * @param sysObjId 本地对象ID + * @param thirdObjId 第三方对象ID + * @param synState 同步状态(0:未同步;1:同步成功;2:同步失败) + * @param description + */ + public void saveSynThirdInfoEntity(String opType, SynThirdInfoEntity synThirdInfoEntity, Integer thirdType, + Integer dataType, String sysObjId, String thirdObjId, Integer synState, + String description) { + UserInfo userInfo = UserProvider.getUser(); + SynThirdInfoEntity entity = new SynThirdInfoEntity(); + String compValue = SynThirdConsts.OBJECT_OP_ADD; + if(compValue.equals(opType)) { + entity.setId(RandomUtil.uuId()); + entity.setThirdType(thirdType); + entity.setDataType(dataType); + entity.setSysObjId(sysObjId); + entity.setThirdObjId(thirdObjId); + entity.setEnabledMark(synState); + // 备注当作同步失败信息来用 + entity.setDescription(description); + entity.setCreatorUserId(userInfo.getUserId()); + entity.setCreatorTime(DateUtil.getNowDate()); + entity.setLastModifyUserId(userInfo.getUserId()); + // 修改时间当作最后同步时间来用 + entity.setLastModifyTime(DateUtil.getNowDate()); + synThirdInfoService.create(entity); + }else{ + entity = synThirdInfoEntity; + entity.setThirdType(thirdType); + entity.setDataType(dataType); + entity.setThirdObjId(thirdObjId); + entity.setEnabledMark(synState); + // 备注当作同步失败信息来用 + entity.setDescription(description); + entity.setLastModifyUserId(userInfo.getUserId()); + // 修改时间当作最后同步时间来用 + entity.setLastModifyTime(DateUtil.getNowDate()); + synThirdInfoService.update(entity.getId(), entity); + } + } + + /** + * 往企业微信创建部门 + * 有带错误定位判断的功能代码 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @return + * @throws WxErrorException + */ +// @Override +// public JSONObject createDepartmentSysToQy(boolean isBatch, OrganizeEntity deptEntity) throws WxErrorException { +// BaseSystemInfo config = getQyhConfig(); +// String corpId = config.getQyhCorpId(); +// String corpSecret = config.getQyhCorpSecret(); +// String compValue = SynThirdConsts.OBJECT_TYPE_COMPANY; +// // 单条记录执行时,受开关限制 +// int qyhIsSyn = isBatch ? 1 : config.getQyhIsSynOrg(); +// JSONObject tokenObject = new JSONObject(); +// String access_token = ""; +// JSONObject retMsg = new JSONObject(); +// JSONObject object = new JSONObject(); +// List qyDeptList = new ArrayList<>(); +// String thirdObjId = ""; +// Integer synState = 0; +// String description = ""; +// boolean isDeptDiff = true; +// String deptFlag = "创建:"; +// +// // 返回值初始化 +// retMsg.put("code", true); +// retMsg.put("error", "创建:系统未设置单条同步"); +// +// // 支持同步 +// if(qyhIsSyn==1){ +// // 获取 access_token 值 +// tokenObject = SynQyWebChatUtil.getAccessToken(corpId, corpSecret); +// access_token = tokenObject.getString("access_token"); +// +// if (access_token != null && !"".equals(access_token)) { +// // 获取企业微信上的所有部门列表信息 +// JSONObject deptObject = SynQyWebChatUtil.getDepartmentList(SynThirdConsts.QY_ROOT_DEPT_ID,access_token); +// if(deptObject.getBoolean("code")) { +// qyDeptList = JsonUtil.getJsonToList(deptObject.getString("department"), QyWebChatDeptModel.class); +// }else{ +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + "获取企业微信的部门列表信息失败"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// retMsg.put("retDeptId", "0"); +// +// // 更新同步表 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_ADD,null,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,synState,description); +// +// return retMsg; +// } +// +// object.put("id", null); +// // name:必填项,同一个层级的部门名称不能重复 +// // name_en:必填项,同一个层级的部门名称不能重复 +// // name与name_en的值不能相同,否则会报错, 20210429 +// object.put("name", deptEntity.getFullName()); +// object.put("name_en", deptEntity.getEnCode()); +// // 从本地数据库的同步表获取对应的企业微信ID,为空报异常,不为空再验证所获取接口部门列表是否当前ID 未处理 +// if(compValue.equals(deptEntity.getCategory()) && "-1".equals(deptEntity.getParentId())){ +// //顶级节点时,企业微信的父节点设置为1 +// object.put("parentid", 1); +// }else{ +// SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getParentId()); +// +// retMsg = checkDepartmentSysToQy(synThirdInfoEntity,qyDeptList); +// isDeptDiff = retMsg.getBoolean("code"); +// if(isDeptDiff) { +// object.put("parentid", synThirdInfoEntity.getThirdObjId()); +// } +// } +// object.put("order", deptEntity.getSortCode()); +// +// // 创建时:部门中文名称与英文名称不能相同 +// retMsg = checkCnEnName(object.getString("name"),object.getString("name_en"),SynThirdConsts.OBJECT_OP_ADD,null, +// Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY),Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 创建时:判断同一个层级的部门中文名称不能重复 +// retMsg = checkDeptObjectNameSysToQy(false,object.getString("name"),object.getString("parentid"),thirdObjId,qyDeptList, +// SynThirdConsts.OBJECT_OP_ADD,null,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 创建时:判断同一个层级的部门英文名称不能重复 +// retMsg = checkDeptObjectNameSysToQy(true,object.getString("name_en"),object.getString("parentid"),thirdObjId,qyDeptList, +// SynThirdConsts.OBJECT_OP_ADD,null,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// if(isDeptDiff) { +// if(qyhIsSyn==1) { +// // 往企业微信写入公司或部门 +// retMsg = SynQyWebChatUtil.createDepartment(object.toJSONString(), access_token); +// +// // 往同步写入本系统与第三方的对应信息 +// if (retMsg.getBoolean("code")) { +// // 同步成功 +// thirdObjId = retMsg.getString("retDeptId"); +// synState = SynThirdConsts.SYN_STATE_OK; +// } else { +// // 同步失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + retMsg.getString("error"); +// } +// }else{ +// // 未设置单条同步,归并到未同步状态 +// // 未同步 +// synState = SynThirdConsts.SYN_STATE_NO; +// description = deptFlag + "系统未设置单条同步"; +// +// retMsg.put("code", true); +// retMsg.put("error", description); +// retMsg.put("retDeptId", "0"); +// } +// }else{ +// // 同步失败,上级部门无对应的企业微信ID +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + "部门所属的上级部门未同步到企业微信"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// retMsg.put("retDeptId", "0"); +// } +// }else{ +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + "access_token值为空,不能同步信息"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// retMsg.put("retDeptId", "0"); +// } +// } +// +// // 更新同步表 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_ADD,null,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,synState,description); +// +// return retMsg; +// } + + + /** + * 往企业微信更新部门 + * 有带错误定位判断的功能代码 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @return + * @throws WxErrorException + */ +// @Override +// public JSONObject updateDepartmentSysToQy(boolean isBatch, OrganizeEntity deptEntity) throws WxErrorException { +// BaseSystemInfo config = getQyhConfig(); +// String corpId = config.getQyhCorpId(); +// String corpSecret = config.getQyhCorpSecret(); +// String compValue = SynThirdConsts.OBJECT_TYPE_COMPANY; +// // 单条记录执行时,受开关限制 +// int qyhIsSyn = isBatch ? 1 : config.getQyhIsSynOrg(); +// JSONObject tokenObject = new JSONObject(); +// String access_token = ""; +// JSONObject retMsg = new JSONObject(); +// JSONObject object = new JSONObject(); +// List qyDeptList = new ArrayList<>(); +// SynThirdInfoEntity synThirdInfoEntity = new SynThirdInfoEntity(); +// String opType = ""; +// Integer synState = 0; +// String description = ""; +// String thirdObjId = ""; +// SynThirdInfoEntity synThirdInfoPara = new SynThirdInfoEntity(); +// boolean isDeptDiff = true; +// String deptFlag = "更新:"; +// +// // 返回值初始化 +// retMsg.put("code", true); +// retMsg.put("error", "系统未设置单条同步"); +// +// // 支持同步,设置需要同步到企业微信的对象属性值 +// if(qyhIsSyn==1) { +// // 获取 access_token +// tokenObject = SynQyWebChatUtil.getAccessToken(corpId, corpSecret); +// access_token = tokenObject.getString("access_token"); +// +// // 获取同步表信息 +// synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getId()); +// +// if (access_token != null && !"".equals(access_token)) { +// // 获取企业微信上的所有部门列表信息 +// JSONObject deptObject = SynQyWebChatUtil.getDepartmentList(SynThirdConsts.QY_ROOT_DEPT_ID,access_token); +// if(deptObject.getBoolean("code")) { +// qyDeptList = JsonUtil.getJsonToList(deptObject.getString("department"), QyWebChatDeptModel.class); +// }else{ +// if(synThirdInfoEntity!=null){ +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// }else{ +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + "获取企业微信的部门列表信息失败"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// +// // 更新同步表 +// saveSynThirdInfoEntity(opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,synState,description); +// +// return retMsg; +// } +// +// object.put("id", null); +// object.put("name", deptEntity.getFullName()); +// object.put("name_en", deptEntity.getEnCode()); +// // 从本地数据库的同步表获取对应的企业微信ID,为空报异常,不为空再验证所获取接口部门列表是否当前ID 未处理 +// if(compValue.equals(deptEntity.getCategory()) && "-1".equals(deptEntity.getParentId())){ +// //顶级节点时,企业微信的父节点设置为1 +// object.put("parentid", 1); +// } else { +// // 判断上级部门的合法性 +// synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getParentId()); +// retMsg = checkDepartmentSysToQy(synThirdInfoEntity, qyDeptList); +// isDeptDiff = retMsg.getBoolean("code"); +// if (isDeptDiff) { +// object.put("parentid", synThirdInfoEntity.getThirdObjId()); +// } +// } +// object.put("order", deptEntity.getSortCode()); +// +// // 上级部门检查是否异常 +// if(isDeptDiff){ +// // 获取同步表信息 +// synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getId()); +// +// // 判断当前部门对应的第三方的合法性 +// retMsg = checkDepartmentSysToQy(synThirdInfoEntity, qyDeptList); +// if (!retMsg.getBoolean("code")) { +// if ("3".equals(retMsg.getString("flag")) || "1".equals(retMsg.getString("flag"))) { +// // flag:3 未同步,需要创建同步到企业微信、写入同步表 +// // flag:1 已同步但第三方上没对应的ID,需要删除原来的同步信息,再创建同步到企业微信、写入同步表 +// if("1".equals(retMsg.getString("flag"))) { +// synThirdInfoService.delete(synThirdInfoEntity); +// } +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// +// // 部门中文名称与英文名称不能相同 +// retMsg = checkCnEnName(object.getString("name"),object.getString("name_en"), +// opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 判断同一个层级的部门中文名称不能重复 +// retMsg = checkDeptObjectNameSysToQy(false,object.getString("name"),object.getString("parentid"),thirdObjId,qyDeptList, +// opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 判断同一个层级的部门英文名称不能重复 +// retMsg = checkDeptObjectNameSysToQy(true,object.getString("name_en"),object.getString("parentid"),thirdObjId,qyDeptList, +// opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 往企业微信写入公司或部门 +// retMsg = SynQyWebChatUtil.createDepartment(object.toJSONString(), access_token); +// +// // 往同步写入本系统与第三方的对应信息 +// if(retMsg.getBoolean("code")) { +// // 同步成功 +// thirdObjId = retMsg.getString("retDeptId"); +// synState = SynThirdConsts.SYN_STATE_OK; +// description = ""; +// }else{ +// // 同步失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + retMsg.getString("error"); +// } +// } +// +// if ("2".equals(retMsg.getString("flag"))) { +// // flag:2 已同步但第三方ID为空,需要创建同步到企业微信、修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = ""; +// +// // 部门中文名称与英文名称不能相同 +// retMsg = checkCnEnName(object.getString("name"),object.getString("name_en"), +// opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 判断同一个层级的部门中文名称不能重复 +// retMsg = checkDeptObjectNameSysToQy(false,object.getString("name"),object.getString("parentid"),thirdObjId,qyDeptList, +// opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 判断同一个层级的部门英文名称不能重复 +// retMsg = checkDeptObjectNameSysToQy(true,object.getString("name_en"),object.getString("parentid"),thirdObjId,qyDeptList, +// opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 往企业微信写入公司或部门 +// retMsg = SynQyWebChatUtil.createDepartment(object.toJSONString(), access_token); +// +// // 往同步表更新本系统与第三方的对应信息 +// if (retMsg.getBoolean("code")) { +// // 同步成功 +// thirdObjId = retMsg.getString("retDeptId"); +// synState = SynThirdConsts.SYN_STATE_OK; +// description = ""; +// } else { +// // 同步失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + retMsg.getString("error"); +// } +// } +// +// } else { +// // 更新同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// +// // 部门中文名称与英文名称不能相同 +// retMsg = checkCnEnName(object.getString("name"),object.getString("name_en"), +// opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 判断同一个层级的部门中文名称不能重复 +// retMsg = checkDeptObjectNameSysToQy(false,object.getString("name"),object.getString("parentid"),thirdObjId,qyDeptList, +// opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 判断同一个层级的部门英文名称不能重复 +// retMsg = checkDeptObjectNameSysToQy(true,object.getString("name_en"),object.getString("parentid"),thirdObjId,qyDeptList, +// opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 往企业微信写入公司或部门 +// object.put("id", synThirdInfoEntity.getThirdObjId()); +// retMsg = SynQyWebChatUtil.updateDepartment(object.toJSONString(), access_token); +// +// // 往同步表更新本系统与第三方的对应信息 +// if (retMsg.getBoolean("code")) { +// // 同步成功 +// synState = SynThirdConsts.SYN_STATE_OK; +// description = ""; +// } else { +// // 同步失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + retMsg.getString("error"); +// } +// } +// }else{ +// // 同步失败,上级部门检查有异常 +// if(synThirdInfoEntity!=null){ +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// }else{ +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + "上级部门无对应的企业微信ID"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// } +// +// }else{ +// // 同步失败 +// if(synThirdInfoEntity!=null){ +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// }else{ +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = deptFlag + "access_token值为空,不能同步信息"; +// +// retMsg.put("code", true); +// retMsg.put("error", description); +// } +// +// }else{ +// // 未设置单条同步,归并到未同步状态 +// // 获取同步表信息 +// synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getId()); +// if(synThirdInfoEntity!=null){ +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// }else{ +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// +// synState = SynThirdConsts.SYN_STATE_NO; +// description = deptFlag + "系统未设置单条同步"; +// +// retMsg.put("code", true); +// retMsg.put("error", description); +// } +// +// // 更新同步表 +// saveSynThirdInfoEntity(opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,synState,description); +// +// return retMsg; +// } + + /** + * 往企业微信删除部门 + * 有带错误定位判断的功能代码 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param id 本系统的公司或部门ID + * @return + * @throws WxErrorException + */ +// @Override +// public JSONObject deleteDepartmentSysToQy(boolean isBatch, String id) throws WxErrorException { +// BaseSystemInfo config = getQyhConfig(); +// String corpId = config.getQyhCorpId(); +// String corpSecret = config.getQyhCorpSecret(); +// // 单条记录执行时,受开关限制 +// int qyhIsSyn = isBatch ? 1 : config.getQyhIsSynOrg(); +// JSONObject tokenObject = new JSONObject(); +// String access_token = ""; +// JSONObject retMsg = new JSONObject(); +// List qyDeptList = new ArrayList<>(); +// SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_ORG,id); +// String deptFlag = "删除:"; +// +// // 返回值初始化 +// retMsg.put("code", true); +// retMsg.put("error", "系统未设置单条同步"); +// +// // 支持同步 +// if(synThirdInfoEntity!=null) { +// if(qyhIsSyn==1){ +// // 获取 access_token +// tokenObject = SynQyWebChatUtil.getAccessToken(corpId, corpSecret); +// access_token = tokenObject.getString("access_token"); +// +// if (access_token != null && !"".equals(access_token)) { +// // 获取企业微信上的所有部门列表信息 +// JSONObject deptObject = SynQyWebChatUtil.getDepartmentList(SynThirdConsts.QY_ROOT_DEPT_ID,access_token); +// if(deptObject.getBoolean("code")) { +// qyDeptList = JsonUtil.getJsonToList(deptObject.getString("department"), QyWebChatDeptModel.class); +// +// // 删除企业对应的部门 +// if (qyDeptList.stream().filter(t -> t.getId().toString().equals(synThirdInfoEntity.getThirdObjId())).count() > 0 ? true : false) { +// retMsg = SynQyWebChatUtil.deleteDepartment(synThirdInfoEntity.getThirdObjId(), access_token); +// if (retMsg.getBoolean("code")) { +// // 同步成功,直接删除同步表记录 +// synThirdInfoService.delete(synThirdInfoEntity); +// } else { +// // 同步失败 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, deptFlag + retMsg.getString("error")); +// } +// }else{ +// // 根据企业微信ID找不到相应的信息,直接删除同步表记录 +// synThirdInfoService.delete(synThirdInfoEntity); +// } +// }else{ +// // 同步失败,获取部门列表失败 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, deptFlag + "获取企业微信的部门列表信息失败"); +// +// retMsg.put("code", false); +// retMsg.put("error", deptFlag + "获取企业微信的部门列表信息失败"); +// } +// +// }else{ +// // 同步失败 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, deptFlag + "access_token值为空,不能同步信息"); +// +// retMsg.put("code", false); +// retMsg.put("error", deptFlag + "access_token值为空,不能同步信息!"); +// } +// +// }else{ +// // 未设置单条同步,归并到未同步状态 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_NO, deptFlag + "系统未设置单条同步"); +// +// retMsg.put("code", true); +// retMsg.put("error", deptFlag + "系统未设置单条同步"); +// } +// } +// +// return retMsg; +// } + + + /** + * 往企业微信创建部门 + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param accessToken (单条调用时为空) + * @return + * @throws WxErrorException + */ + @Override + public JSONObject createDepartmentSysToQy(boolean isBatch, OrganizeEntity deptEntity,String accessToken) throws WxErrorException { + BaseSystemInfo config = getQyhConfig(); + String corpId = config.getQyhCorpId(); + // 向企业微信插入数据需要另外token(凭证密钥) + String corpSecret = config.getQyhAgentSecret(); + String compValue = SynThirdConsts.OBJECT_TYPE_COMPANY; + // 单条记录执行时,受开关限制 + int qyhIsSyn = isBatch ? 1 : config.getQyhIsSynOrg(); + JSONObject tokenObject = new JSONObject(); + String access_token = ""; + JSONObject retMsg = new JSONObject(); + JSONObject object = new JSONObject(); + String thirdObjId = ""; + Integer synState = 0; + String description = ""; + boolean isDeptDiff = true; + String deptFlag = "创建:"; + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", "创建:系统未设置单条同步"); + + // 支持同步 + if(isBatch || qyhIsSyn==1){ + if(isBatch){ + access_token = accessToken; + }else{ + // 获取 access_token 值 + tokenObject = SynQyWebChatUtil.getAccessToken(corpId, corpSecret); + access_token = tokenObject.getString("access_token"); + } + + if (access_token != null && !"".equals(access_token)) { + object.put("id", null); + // name:必填项,同一个层级的部门名称不能重复 + // name_en:必填项,同一个层级的部门名称不能重复 + // name与name_en的值不能相同,否则会报错, 20210429 + object.put("name", deptEntity.getFullName()); + object.put("name_en", deptEntity.getEnCode()); + // 从本地数据库的同步表获取对应的企业微信ID,为空报异常,不为空再验证所获取接口部门列表是否当前ID 未处理 + if(compValue.equals(deptEntity.getCategory()) && "-1".equals(deptEntity.getParentId())){ + //顶级节点时,企业微信的父节点设置为1 + object.put("parentid", 1); + }else{ + SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getParentId()); + + retMsg = checkDepartmentSysToQy(synThirdInfoEntity); + isDeptDiff = retMsg.getBoolean("code"); + if(isDeptDiff) { + object.put("parentid", synThirdInfoEntity.getThirdObjId()); + } + } + object.put("order", deptEntity.getSortCode()); + + // 创建时:部门中文名称与英文名称不能相同 +// retMsg = checkCnEnName(object.getString("name"),object.getString("name_en"),SynThirdConsts.OBJECT_OP_ADD,null, +// Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY),Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } + + if(isDeptDiff) { + if(qyhIsSyn==1) { + // 往企业微信写入公司或部门 + if(!"-1".equals(deptEntity.getParentId())){ + retMsg = SynQyWebChatUtil.createDepartment(object.toJSONString(), access_token); + }else{ + retMsg.put("code", true); + retMsg.put("error", "顶级不同步,默认值id1"); + retMsg.put("retDeptId", "1"); + } + + // 往同步写入本系统与第三方的对应信息 + if (retMsg.getBoolean("code")) { + // 同步成功 + thirdObjId = retMsg.getString("retDeptId"); + synState = SynThirdConsts.SYN_STATE_OK; + } else { + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + retMsg.getString("error"); + } + }else{ + // 未设置单条同步,归并到未同步状态 + // 未同步 + synState = SynThirdConsts.SYN_STATE_NO; + description = deptFlag + "系统未设置单条同步"; + + retMsg.put("code", true); + retMsg.put("error", description); + retMsg.put("retDeptId", "0"); + } + }else{ + // 同步失败,上级部门无对应的企业微信ID + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + "部门所属的上级部门未同步到企业微信"; + + retMsg.put("code", false); + retMsg.put("error", description); + retMsg.put("retDeptId", "0"); + } + }else{ + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + "access_token值为空,不能同步信息"; + + retMsg.put("code", false); + retMsg.put("error", description); + retMsg.put("retDeptId", "0"); + } + } + + // 更新同步表 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_ADD,null,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,synState,description); + + return retMsg; + } + + + /** + * 往企业微信更新部门 + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param accessToken (单条调用时为空) + * @return + * @throws WxErrorException + */ + @Override + public JSONObject updateDepartmentSysToQy(boolean isBatch, OrganizeEntity deptEntity,String accessToken) throws WxErrorException { + BaseSystemInfo config = getQyhConfig(); + String corpId = config.getQyhCorpId(); + // 向企业微信插入数据需要另外token(凭证密钥) + String corpSecret = config.getQyhAgentSecret(); + String compValue = SynThirdConsts.OBJECT_TYPE_COMPANY; + // 单条记录执行时,受开关限制 + int qyhIsSyn = isBatch ? 1 : config.getQyhIsSynOrg(); + JSONObject tokenObject = new JSONObject(); + String access_token = ""; + JSONObject retMsg = new JSONObject(); + JSONObject object = new JSONObject(); + SynThirdInfoEntity synThirdInfoEntity = new SynThirdInfoEntity(); + String opType = ""; + Integer synState = 0; + String description = ""; + String thirdObjId = ""; + SynThirdInfoEntity synThirdInfoPara = new SynThirdInfoEntity(); + boolean isDeptDiff = true; + String deptFlag = "更新:"; + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", "系统未设置单条同步"); + + // 支持同步,设置需要同步到企业微信的对象属性值 + if(isBatch || qyhIsSyn==1) { + if(isBatch){ + access_token = accessToken; + }else{ + // 获取 access_token + tokenObject = SynQyWebChatUtil.getAccessToken(corpId, corpSecret); + access_token = tokenObject.getString("access_token"); + } + + // 获取同步表信息 + synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getId()); + + if (access_token != null && !"".equals(access_token)) { + object.put("id", null); + object.put("name", deptEntity.getFullName()); + object.put("name_en", deptEntity.getEnCode()); + // 从本地数据库的同步表获取对应的企业微信ID,为空报异常,不为空再验证所获取接口部门列表是否当前ID 未处理 + if(compValue.equals(deptEntity.getCategory()) && "-1".equals(deptEntity.getParentId())){ + //顶级节点时,企业微信的父节点设置为1 + object.put("parentid", 1); + } else { + // 判断上级部门的合法性 + synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getParentId()); + retMsg = checkDepartmentSysToQy(synThirdInfoEntity); + isDeptDiff = retMsg.getBoolean("code"); + if (isDeptDiff) { + object.put("parentid", synThirdInfoEntity.getThirdObjId()); + } + } + object.put("order", deptEntity.getSortCode()); + + // 上级部门检查是否异常 + if(isDeptDiff){ + // 获取同步表信息 + synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getId()); + + // 判断当前部门对应的第三方的合法性 + retMsg = checkDepartmentSysToQy(synThirdInfoEntity); + if (!retMsg.getBoolean("code")) { + if ("3".equals(retMsg.getString("flag")) || "1".equals(retMsg.getString("flag"))) { + // flag:3 未同步,需要创建同步到企业微信、写入同步表 + // flag:1 已同步但第三方上没对应的ID,需要删除原来的同步信息,再创建同步到企业微信、写入同步表 + if("1".equals(retMsg.getString("flag"))) { + synThirdInfoService.delete(synThirdInfoEntity); + } + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + + // 部门中文名称与英文名称不能相同 + retMsg = checkCnEnName(object.getString("name"),object.getString("name_en"), + opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); + if (!retMsg.getBoolean("code")) { + return retMsg; + } + + // 往企业微信写入公司或部门 + if(!"-1".equals(deptEntity.getParentId())){ + retMsg = SynQyWebChatUtil.createDepartment(object.toJSONString(), access_token); + } + + // 往同步写入本系统与第三方的对应信息 + if(retMsg.getBoolean("code")) { + // 同步成功 + thirdObjId = retMsg.getString("retDeptId"); + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + }else{ + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + retMsg.getString("error"); + } + } + + if ("2".equals(retMsg.getString("flag"))) { + // flag:2 已同步但第三方ID为空,需要创建同步到企业微信、修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = ""; + + // 部门中文名称与英文名称不能相同 + retMsg = checkCnEnName(object.getString("name"),object.getString("name_en"), + opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); + if (!retMsg.getBoolean("code")) { + return retMsg; + } + + // 往企业微信写入公司或部门 + if(!"-1".equals(deptEntity.getParentId())){ + retMsg = SynQyWebChatUtil.createDepartment(object.toJSONString(), access_token); + } + + // 往同步表更新本系统与第三方的对应信息 + if (retMsg.getBoolean("code")) { + // 同步成功 + thirdObjId = retMsg.getString("retDeptId"); + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + } else { + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + retMsg.getString("error"); + } + } + + } else { + // 更新同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + + // 部门中文名称与英文名称不能相同 + retMsg = checkCnEnName(object.getString("name"),object.getString("name_en"), + opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,deptFlag); + if (!retMsg.getBoolean("code")) { + return retMsg; + } + + // 往企业微信写入公司或部门 + object.put("id", synThirdInfoEntity.getThirdObjId()); + if(!"-1".equals(deptEntity.getParentId())){ + retMsg = SynQyWebChatUtil.updateDepartment(object.toJSONString(), access_token); + } + + // 往同步表更新本系统与第三方的对应信息 + if (retMsg.getBoolean("code")) { + // 同步成功 + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + } else { + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + retMsg.getString("error"); + } + } + }else{ + // 同步失败,上级部门检查有异常 + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + } + + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + "上级部门无对应的企业微信ID"; + + retMsg.put("code", false); + retMsg.put("error", description); + } + + }else{ + // 同步失败 + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + } + + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + "access_token值为空,不能同步信息"; + + retMsg.put("code", true); + retMsg.put("error", description); + } + + }else{ + // 未设置单条同步,归并到未同步状态 + // 获取同步表信息 + synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_ORG,deptEntity.getId()); + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + } + + synState = SynThirdConsts.SYN_STATE_NO; + description = deptFlag + "系统未设置单条同步"; + + retMsg.put("code", true); + retMsg.put("error", description); + } + + // 更新同步表 + saveSynThirdInfoEntity(opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),deptEntity.getId(),thirdObjId,synState,description); + + return retMsg; + } + + /** + * 往企业微信删除部门 + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param id 本系统的公司或部门ID + * @param accessToken (单条调用时为空) + * @return + * @throws WxErrorException + */ + @Override + public JSONObject deleteDepartmentSysToQy(boolean isBatch, String id,String accessToken) throws WxErrorException { + BaseSystemInfo config = getQyhConfig(); + String corpId = config.getQyhCorpId(); + String corpSecret = config.getQyhCorpSecret(); + // 单条记录执行时,受开关限制 + int qyhIsSyn = isBatch ? 1 : config.getQyhIsSynOrg(); + JSONObject tokenObject = new JSONObject(); + String access_token = ""; + JSONObject retMsg = new JSONObject(); + SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_ORG,id); + String deptFlag = "删除:"; + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", "系统未设置单条同步"); + + // 支持同步 + if(synThirdInfoEntity!=null) { + if(qyhIsSyn==1){ + if(isBatch){ + access_token = accessToken; + }else{ + // 获取 access_token + tokenObject = SynQyWebChatUtil.getAccessToken(corpId, corpSecret); + access_token = tokenObject.getString("access_token"); + } + + if (access_token != null && !"".equals(access_token)) { + if (!"".equals(String.valueOf(synThirdInfoEntity.getThirdObjId())) && !"null".equals(String.valueOf(synThirdInfoEntity.getThirdObjId()))) { + retMsg = SynQyWebChatUtil.deleteDepartment(synThirdInfoEntity.getThirdObjId(), access_token); + if (retMsg.getBoolean("code")) { + // 同步成功,直接删除同步表记录 + synThirdInfoService.delete(synThirdInfoEntity); + } else { + // 同步失败 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, deptFlag + retMsg.getString("error")); + } + }else{ + // 根据企业微信ID找不到相应的信息,直接删除同步表记录 + synThirdInfoService.delete(synThirdInfoEntity); + } + }else{ + // 同步失败 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, deptFlag + "access_token值为空,不能同步信息"); + + retMsg.put("code", false); + retMsg.put("error", deptFlag + "access_token值为空,不能同步信息!"); + } + + }else{ + // 未设置单条同步,归并到未同步状态 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_NO, deptFlag + "系统未设置单条同步"); + + retMsg.put("code", true); + retMsg.put("error", deptFlag + "系统未设置单条同步"); + } + } + + return retMsg; + } + + + //------------------------------------本系统同步用户到企业微信------------------------------------- + + /** + * 获取企业微信的单个成员列表,用于更新成员信息使用 + * @param id + * @param accessToken + * @return + * @throws WxErrorException + */ + public QyWebChatUserModel getQyUserById(String id, String accessToken) throws WxErrorException { + QyWebChatUserModel userModel = new QyWebChatUserModel(); + JSONObject userObject = SynQyWebChatUtil.getUserById(id,accessToken); + if(userObject.getBoolean("code")) { + userModel = JsonUtil.getJsonToBean(userObject.getString("userinfo"), QyWebChatUserModel.class); + } + return userModel; + } + + /** + * 设置需要提交给企业微信接口的单个成品JSON信息 + * 有带第三方错误定位判断的功能代码 20210604 + * @param userEntity 本地用户信息 + * @param qyDeptList 企业微信的部门信息 + * @param qyWebChatUserModel + * @return + */ +// public JSONObject setQyUserObject(UserEntity userEntity, List qyDeptList, QyWebChatUserModel qyWebChatUserModel) { +// List userList = userService.getList(); +// JSONObject object = new JSONObject(); +// JSONObject retMsg = new JSONObject(); +// retMsg.put("code", true); +// retMsg.put("error", ""); +// +// // 验证邮箱格式的合法性 +// if(StringUtil.isNotEmpty(userEntity.getEmail())){ +// if(!RegexUtils.checkEmail(userEntity.getEmail())){ +// retMsg.put("code", false); +// retMsg.put("error", "邮箱格式不合法!"); +// retMsg.put("qyUserObject", ""); +// return retMsg; +// } +// } +// +// object.put("userid", userEntity.getId()); +// object.put("name", userEntity.getRealName()); +// object.put("mobile",userEntity.getMobilePhone()); +// +// SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_ORG,userEntity.getOrganizeId()); +// retMsg = checkDepartmentSysToQy(synThirdInfoEntity,qyDeptList); +// if(retMsg.getBoolean("code")){ +// String formatString = "[%s]"; +// object.put("department",String.format(formatString,synThirdInfoEntity.getThirdObjId())); +// object.put("main_department",synThirdInfoEntity.getThirdObjId()); +// QyWebChatDeptModel qyWebChatDeptModel = qyDeptList.stream().filter(t -> t.getId().toString().equals(synThirdInfoEntity.getThirdObjId())).findFirst().orElse(null); +// object.put("order",String.format(formatString,qyWebChatDeptModel.getOrder())); +// String isLeader = userList.stream().filter(t -> t.getOrganizeId().equals(userEntity.getOrganizeId()) && t.getManagerId().equals(userEntity.getId()) ).count()==0 ? "0" : "1"; +// object.put("is_leader_in_dept",String.format(formatString,isLeader)); +// }else{ +// retMsg.put("code", false); +// retMsg.put("error", "部门找不到对应的企业微信ID!"); +// retMsg.put("qyUserObject", ""); +// return retMsg; +// } +// object.put("email",userEntity.getEmail()); +// PositionEntity positionEntity = positionService.getInfo(userEntity.getPositionId()); +// if(positionEntity!=null){ +// object.put("position",positionEntity.getFullName()); +// }else{ +// object.put("position",""); +// } +// object.put("gender",userEntity.getGender().toString()); +// object.put("telephone",userEntity.getTelePhone()); +// object.put("enable",userEntity.getEnabledMark()); +// JSONObject extattr = new JSONObject(); +// extattr.put("attrs","[]"); +// object.put("extattr",extattr.toJSONString()); +//// // 创建企业微信成员时才会赋值的 +//// object.put("to_invite", true); +// object.put("address",userEntity.getPostalAddress()); +// object.put("alias",""); +// object.put("avatar_mediaid",""); +// JSONObject external_profile = new JSONObject(); +// external_profile.put("external_corp_name",""); +// external_profile.put("external_attr","[]"); +// object.put("external_profile",external_profile.toJSONString()); +// object.put("external_position",""); +// +// // 修改时:未更新字段信息来源企业微信 +// if(qyWebChatUserModel!=null) { +// object.put("alias", qyWebChatUserModel.getAlias()); +// object.put("avatar_mediaid", qyWebChatUserModel.getAvatar_mediaid()); +// object.put("external_profile", qyWebChatUserModel.getExternal_profile()); +// object.put("external_position", qyWebChatUserModel.getExternal_position()); +// } +// +// String jsonString = object.toJSONString(); +// // 格式与用户的格式不一致就需要做处理,否则提交JSON格式验证无法通过 +// jsonString = jsonString.replaceAll("\\\\",""); +// jsonString = jsonString.replaceAll("\"\\{","{"); +// jsonString = jsonString.replaceAll("}\"","}"); +// jsonString = jsonString.replaceAll("\"\\[","["); +// jsonString = jsonString.replaceAll("\\]\"","]"); +// +// retMsg.put("qyUserObject", jsonString); +// return retMsg; +// } + + + /** + * 设置需要提交给企业微信接口的单个成品JSON信息 + * 不带第三方错误定位判断的功能代码 20210604 + * @param userEntity 本地用户信息 + * @param qyWebChatUserModel + * @return + */ + public JSONObject setQyUserObject(UserEntity userEntity,QyWebChatUserModel qyWebChatUserModel) { + List userList = userService.getList(false); + JSONObject object = new JSONObject(); + JSONObject retMsg = new JSONObject(); + retMsg.put("code", true); + retMsg.put("error", ""); + + // 验证邮箱格式的合法性 + if(StringUtil.isNotEmpty(userEntity.getEmail())){ + if(!RegexUtils.checkEmail(userEntity.getEmail())){ + retMsg.put("code", false); + retMsg.put("error", "邮箱格式不合法!"); + retMsg.put("qyUserObject", ""); + return retMsg; + } + } + + object.put("userid", userEntity.getId()); + object.put("name", userEntity.getRealName()); + object.put("mobile",userEntity.getMobilePhone()); + + SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_ORG,userEntity.getOrganizeId()); + retMsg = checkDepartmentSysToQy(synThirdInfoEntity); + if(retMsg.getBoolean("code")){ + String formatString = "[%s]"; + object.put("department",String.format(formatString,synThirdInfoEntity.getThirdObjId())); + object.put("main_department",synThirdInfoEntity.getThirdObjId()); +// QyWebChatDeptModel qyWebChatDeptModel = qyDeptList.stream().filter(t -> t.getId().toString().equals(synThirdInfoEntity.getThirdObjId())).findFirst().orElse(null); +// object.put("order",String.format(formatString,qyWebChatDeptModel.getOrder())); + String isLeader = userList.stream().filter(t -> userEntity.getOrganizeId().equals(t.getOrganizeId()) && userEntity.getId().equals(t.getManagerId()) ).count()==0 ? "0" : "1"; + object.put("is_leader_in_dept",String.format(formatString,isLeader)); + }else{ + retMsg.put("code", false); + retMsg.put("error", "部门找不到对应的企业微信ID!"); + retMsg.put("qyUserObject", ""); + return retMsg; + } + object.put("email",userEntity.getEmail()); + PositionEntity positionEntity = positionService.getInfo(userEntity.getPositionId()); + if(positionEntity!=null){ + object.put("position",positionEntity.getFullName()); + }else{ + object.put("position",""); + } + object.put("gender",userEntity.getGender().toString()); + object.put("telephone",userEntity.getTelePhone()); + object.put("enable",userEntity.getEnabledMark()); + JSONObject extattr = new JSONObject(); + extattr.put("attrs","[]"); + object.put("extattr",extattr.toJSONString()); +// // 创建企业微信成员时才会赋值的 +// object.put("to_invite", true); + object.put("address",userEntity.getPostalAddress()); + object.put("alias",""); + object.put("avatar_mediaid",""); + JSONObject external_profile = new JSONObject(); + external_profile.put("external_corp_name",""); + external_profile.put("external_attr","[]"); + object.put("external_profile",external_profile.toJSONString()); + object.put("external_position",""); + + // 修改时:未更新字段信息来源企业微信 + if(qyWebChatUserModel!=null) { + object.put("alias", qyWebChatUserModel.getAlias()); + object.put("avatar_mediaid", qyWebChatUserModel.getAvatar_mediaid()); + object.put("external_profile", qyWebChatUserModel.getExternal_profile()); + object.put("external_position", qyWebChatUserModel.getExternal_position()); + } + + String jsonString = object.toJSONString(); + // 格式与用户的格式不一致就需要做处理,否则提交JSON格式验证无法通过 + jsonString = jsonString.replaceAll("\\\\",""); + jsonString = jsonString.replaceAll("\"\\{","{"); + jsonString = jsonString.replaceAll("}\"","}"); + jsonString = jsonString.replaceAll("\"\\[","["); + jsonString = jsonString.replaceAll("\\]\"","]"); + + retMsg.put("qyUserObject", jsonString); + return retMsg; + } + + + /** + * 判断用户的手机号、邮箱是否唯一,企业微信不允许重复 + * @param mobile + * @param email + * @param userId + * @param qyUserList + * @param opType + * @param synThirdInfoEntity + * @param thirdType + * @param dataType + * @param sysObjId + * @param thirdObjId + * @param deptFlag + * @return + */ + public JSONObject checkUserMobileEmailRepeat(String mobile, String email, String userId, List qyUserList, + String opType, SynThirdInfoEntity synThirdInfoEntity, Integer thirdType, + Integer dataType, String sysObjId, String thirdObjId, String deptFlag){ + boolean isDiff = true; + String description = ""; + JSONObject retMsg = new JSONObject(); + + // 企业微信限制:手机号唯一性 + if(StringUtil.isNotEmpty(mobile)){ + if(StringUtil.isNotEmpty(userId)){ + if(qyUserList.stream().filter(t -> String.valueOf(t.getMobile()).equals(mobile) && !(t.getUserid().equals(userId))).count() > 0 ? true : false){ + isDiff = false; + description = deptFlag + "企业内已有绑定手机号:" + mobile; + } + }else{ + if(qyUserList.stream().filter(t -> String.valueOf(t.getMobile()).equals(mobile)).count() > 0 ? true : false){ + isDiff = false; + description = deptFlag + "企业内已有绑定手机号:" + mobile; + } + } + } + + // 企业微信限制:邮箱地址唯一性 + if(StringUtil.isNotEmpty(email)){ + if(StringUtil.isNotEmpty(userId)){ + if(qyUserList.stream().filter(t -> String.valueOf(t.getEmail()).equals(email) && !(t.getUserid().equals(userId))).count() > 0 ? true : false){ + isDiff = false; + description = deptFlag + "企业内已有绑定此邮箱:" + email; + } + }else{ + if(qyUserList.stream().filter(t -> String.valueOf(t.getEmail()).equals(email)).count() > 0 ? true : false){ + isDiff = false; + description = deptFlag + "企业内已有绑定此邮箱:" + email; + } + } + } + + retMsg.put("code",isDiff); + retMsg.put("error",description); + + if(!isDiff){ + // 同步失败 + Integer synState = SynThirdConsts.SYN_STATE_FAIL; + + // 更新同步表 + saveSynThirdInfoEntity(opType,synThirdInfoEntity,thirdType,dataType,sysObjId,thirdObjId,synState,description); + } + + return retMsg; + } + + /** + * 根据用户的同步表信息判断同步情况 + * 带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param synThirdInfoEntity + * @param qyUserList + * @return + */ +// public JSONObject checkUserSysToQy(SynThirdInfoEntity synThirdInfoEntity, List qyUserList) { +// JSONObject retMsg = new JSONObject(); +// retMsg.put("code",true); +// retMsg.put("flag",""); +// retMsg.put("error",""); +// +// if(synThirdInfoEntity!=null){ +// if(StringUtil.isNotEmpty(synThirdInfoEntity.getThirdObjId())) { +// // 同步表存在企业微信ID,仍需要判断企业微信上有没此用户 +// if(qyUserList.stream().filter(t -> t.getUserid().equals(synThirdInfoEntity.getThirdObjId())).count() == 0 ? true : false){ +// retMsg.put("code",false); +// retMsg.put("flag","1"); +// retMsg.put("error","企业微信不存在同步表对应的用户ID!"); +// } +// }else{ +// // 同步表的企业微信ID为空 +// retMsg.put("code",false); +// retMsg.put("flag","2"); +// retMsg.put("error","同步表中用户对应的第三方ID为空!"); +// } +// }else{ +// // 上级用户未同步 +// retMsg.put("code",false); +// retMsg.put("flag","3"); +// retMsg.put("error","用户未同步!"); +// } +// +// return retMsg; +// } + + /** + * 根据用户的同步表信息判断同步情况 + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param synThirdInfoEntity + * @return + */ + public JSONObject checkUserSysToQy(SynThirdInfoEntity synThirdInfoEntity) { + JSONObject retMsg = new JSONObject(); + retMsg.put("code",true); + retMsg.put("flag",""); + retMsg.put("error",""); + + if(synThirdInfoEntity!=null){ + if("".equals(String.valueOf(synThirdInfoEntity.getThirdObjId())) || "null".equals(String.valueOf(synThirdInfoEntity.getThirdObjId()))) { + // 同步表的企业微信ID为空 + retMsg.put("code",false); + retMsg.put("flag","2"); + retMsg.put("error","同步表中用户对应的第三方ID为空!"); + } + }else{ + // 上级用户未同步 + retMsg.put("code",false); + retMsg.put("flag","3"); + retMsg.put("error","用户未同步!"); + } + + return retMsg; + } + + + /** + * 往企业微信创建成员信息 + * 带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param userEntity + * @return + * @throws WxErrorException + */ +// @Override +// public JSONObject createUserSysToQy(boolean isBatch, UserEntity userEntity) throws WxErrorException { +// BaseSystemInfo config = getQyhConfig(); +// String corpId = config.getQyhCorpId(); +// String corpSecret = config.getQyhCorpSecret(); +// // 单条记录执行时,受开关限制 +// int qyhIsSyn = isBatch ? 1 : config.getQyhIsSynUser(); +// JSONObject tokenObject = SynQyWebChatUtil.getAccessToken(corpId, corpSecret); +// String access_token = tokenObject.getString("access_token"); +// JSONObject retMsg = new JSONObject(); +// String userObjectModel = ""; +// List qyDeptList = new ArrayList<>(); +// List qyUserList = new ArrayList<>(); +// String thirdObjId = ""; +// Integer synState = 0; +// String description = ""; +// String userFlag = "创建:"; +// +// // 返回值初始化 +// retMsg.put("code", true); +// retMsg.put("error", userFlag + "系统未设置单条同步"); +// +// // 企业微信限制:不能手机号、邮箱同时为空 +// if(StringUtil.isEmpty(userEntity.getMobilePhone()) && StringUtil.isEmpty(userEntity.getEmail()) && "1".equals(qyhIsSyn)){ +// retMsg.put("code", false); +// retMsg.put("error", userFlag + "企业微信不允许手机号、邮箱不能同时为空!"); +// } +// +// if (qyhIsSyn==1){ +// if(retMsg.getBoolean("code")){ +// if (access_token != null && !"".equals(access_token)) { +// // 获取企业微信上的所有部门列表信息 +// JSONObject deptObject = SynQyWebChatUtil.getDepartmentList(SynThirdConsts.QY_ROOT_DEPT_ID,access_token); +// if(deptObject.getBoolean("code")) { +// qyDeptList = JsonUtil.getJsonToList(deptObject.getString("department"), QyWebChatDeptModel.class); +// }else{ +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + "获取企业微信的部门列表信息失败"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// +// // 更新同步表 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_ADD, null, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), userEntity.getId(), thirdObjId, synState, description); +// +// return retMsg; +// } +// +// // 获取企业微信上的所有成员列表信息 +// JSONObject userObject = SynQyWebChatUtil.getUserDetailList(SynThirdConsts.QY_ROOT_DEPT_ID,"1",access_token); +// if(userObject.getBoolean("code")) { +// qyUserList = JsonUtil.getJsonToList(userObject.getString("userlist"), QyWebChatUserModel.class); +// }else{ +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + "获取企业微信的成员列表信息失败"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// +// // 更新同步表 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_ADD, null, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), userEntity.getId(), thirdObjId, synState, description); +// +// return retMsg; +// } +// +// // 判断用户的手机号、邮箱是否唯一,不能重复 +// retMsg = checkUserMobileEmailRepeat(userEntity.getMobilePhone(),userEntity.getEmail(),thirdObjId,qyUserList, +// SynThirdConsts.OBJECT_OP_ADD,null,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),userEntity.getId(),thirdObjId,userFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 要同步到企业微信的对象赋值 +// retMsg = setQyUserObject(userEntity, qyDeptList, null); +// if (retMsg.getBoolean("code")) { +// userObjectModel = retMsg.getString("qyUserObject"); +// // 往企业微信写入成员 +// retMsg = SynQyWebChatUtil.createUser(userObjectModel, access_token); +// +// // 往同步写入本系统与第三方的对应信息 +// if (retMsg.getBoolean("code")) { +// // 同步成功 +// thirdObjId = userEntity.getId(); +// synState = SynThirdConsts.SYN_STATE_OK; +// } else { +// // 同步失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + retMsg.getString("error"); +// } +// }else{ +// // 同步失败,原因:部门找不到对应的第三方ID、邮箱格式不合法 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + retMsg.getString("error"); +// } +// +// }else{ +// // 同步失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + "access_token值为空,不能同步信息"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// } +// +// }else { +// // 同步失败,原因:企业微信不允许手机号、邮箱不能同时为空 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + retMsg.getString("error"); +// } +// }else{ +// // 无须同步,未同步状态 +// synState = SynThirdConsts.SYN_STATE_NO; +// description = userFlag + "系统未设置单条同步"; +// +// retMsg.put("code", true); +// retMsg.put("error", description); +// } +// +// // 更新同步表 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_ADD, null, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), userEntity.getId(), thirdObjId, synState, description); +// +// return retMsg; +// } + + + /** + * 往企业微信更新成员信息 + * 带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param userEntity + * @return + * @throws WxErrorException + */ +// @Override +// public JSONObject updateUserSysToQy(boolean isBatch, UserEntity userEntity) throws WxErrorException { +// BaseSystemInfo config = getQyhConfig(); +// String corpId = config.getQyhCorpId(); +// String corpSecret = config.getQyhCorpSecret(); +// // 单条记录执行时,受开关限制 +// int qyhIsSyn = isBatch ? 1 : config.getQyhIsSynUser(); +// JSONObject tokenObject = new JSONObject(); +// String access_token = ""; +// JSONObject retMsg = new JSONObject(); +// String userObjectModel = ""; +// List qyDeptList = new ArrayList<>(); +// List qyUserList = new ArrayList<>(); +// SynThirdInfoEntity synThirdInfoEntity = new SynThirdInfoEntity(); +// SynThirdInfoEntity entity = new SynThirdInfoEntity(); +// String opType = ""; +// SynThirdInfoEntity synThirdInfoPara = new SynThirdInfoEntity(); +// String thirdObjId = ""; +// Integer synState = 0; +// String description = ""; +// String userFlag = "更新:"; +// +// // 返回值初始化 +// retMsg.put("code", true); +// retMsg.put("error", userFlag + "系统未设置单条同步"); +// +// // 企业微信限制:不能手机号、邮箱同时为空 +// if(StringUtil.isEmpty(userEntity.getMobilePhone()) && StringUtil.isEmpty(userEntity.getEmail()) && "1".equals(qyhIsSyn)){ +// retMsg.put("code", false); +// retMsg.put("error", userFlag + "企业微信不允许手机号、邮箱不能同时为空!"); +// } +// +// // 支持同步 +// if (qyhIsSyn==1){ +// if(retMsg.getBoolean("code")){ +// // 获取 access_token +// tokenObject = SynQyWebChatUtil.getAccessToken(corpId, corpSecret); +// access_token = tokenObject.getString("access_token"); +// +// // 获取同步表信息 +// synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_USER,userEntity.getId()); +// if (access_token != null && !"".equals(access_token)) { +// // 获取企业微信上的所有部门列表信息 +// JSONObject deptObject = SynQyWebChatUtil.getDepartmentList(SynThirdConsts.QY_ROOT_DEPT_ID,access_token); +// if(deptObject.getBoolean("code")) { +// qyDeptList = JsonUtil.getJsonToList(deptObject.getString("department"), QyWebChatDeptModel.class); +// }else{ +// if(synThirdInfoEntity!=null){ +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// }else{ +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + "获取企业微信的部门列表信息失败"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// +// // 更新同步表 +// saveSynThirdInfoEntity(opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),userEntity.getId(),thirdObjId,synState,description); +// +// return retMsg; +// } +// +// // 获取企业微信上的所有成员列表信息 +// JSONObject userObject = SynQyWebChatUtil.getUserDetailList(SynThirdConsts.QY_ROOT_DEPT_ID,"1",access_token); +// if(userObject.getBoolean("code")) { +// qyUserList = JsonUtil.getJsonToList(userObject.getString("userlist"), QyWebChatUserModel.class); +// }else{ +// if(synThirdInfoEntity!=null){ +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// }else{ +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + "获取企业微信的成员列表信息失败"; +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// +// // 更新同步表 +// saveSynThirdInfoEntity(opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),userEntity.getId(),thirdObjId,synState,description); +// +// return retMsg; +// } +// +// // 要同步到企业微信的对象赋值 +// retMsg = setQyUserObject(userEntity,qyDeptList,null); +// if (retMsg.getBoolean("code")) { +// // 判断当前用户对应的第三方的合法性 +// userObjectModel = retMsg.getString("qyUserObject"); +// retMsg = checkUserSysToQy(synThirdInfoEntity, qyUserList); +// if (!retMsg.getBoolean("code")) { +// if("3".equals(retMsg.getString("flag")) || "1".equals(retMsg.getString("flag"))){ +// // flag:3 未同步,需要创建同步到企业微信、写入同步表 +// // flag:1 已同步但第三方上没对应的ID,需要删除原来的同步信息,再创建同步到企业微信、写入同步表 +// if("1".equals(retMsg.getString("flag"))) { +// synThirdInfoService.delete(synThirdInfoEntity); +// } +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// +// // 判断用户的手机号、邮箱是否唯一,不能重复 +// retMsg = checkUserMobileEmailRepeat(userEntity.getMobilePhone(),userEntity.getEmail(),thirdObjId,qyUserList, +// opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),userEntity.getId(),thirdObjId,userFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 往企业微信写入成员 +// retMsg = SynQyWebChatUtil.createUser(userObjectModel, access_token); +// if(retMsg.getBoolean("code")) { +// // 同步成功 +// thirdObjId = userEntity.getId(); +// synState = SynThirdConsts.SYN_STATE_OK; +// description = ""; +// }else{ +// // 同步失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + retMsg.getString("error"); +// } +// } +// +// if("2".equals(retMsg.getString("flag"))){ +// // 已同步但第三方ID为空,需要创建同步到企业微信、修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = ""; +// +// // 判断用户的手机号、邮箱是否唯一,不能重复 +// retMsg = checkUserMobileEmailRepeat(userEntity.getMobilePhone(),userEntity.getEmail(),thirdObjId,qyUserList, +// opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),userEntity.getId(),thirdObjId,userFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 往企业微信写入成员 +// retMsg = SynQyWebChatUtil.createUser(userObjectModel, access_token); +// if(retMsg.getBoolean("code")) { +// // 同步成功 +// thirdObjId = userEntity.getId(); +// synState = SynThirdConsts.SYN_STATE_OK; +// description = ""; +// }else{ +// // 同步失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + retMsg.getString("error"); +// } +// } +// }else{ +// // 更新同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// +// // 判断用户的手机号、邮箱是否唯一,不能重复 +// retMsg = checkUserMobileEmailRepeat(userEntity.getMobilePhone(),userEntity.getEmail(),thirdObjId,qyUserList, +// opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),userEntity.getId(),thirdObjId,userFlag); +// if (!retMsg.getBoolean("code")) { +// return retMsg; +// } +// +// // 获取当前成员信息 +// QyWebChatUserModel qyWebChatUserModel = getQyUserById(synThirdInfoEntity.getThirdObjId(),access_token); +// if("0".equals(qyWebChatUserModel.getErrcode())){ +// // 要同步到企业微信的对象重新赋值 +// retMsg = setQyUserObject(userEntity,qyDeptList,qyWebChatUserModel); +// userObjectModel = retMsg.getString("qyUserObject"); +// +// // 往企业微信更新成员信息 +// retMsg = SynQyWebChatUtil.updateUser(userObjectModel, access_token); +// if(retMsg.getBoolean("code")) { +// // 同步成功 +// synState = SynThirdConsts.SYN_STATE_OK; +// description = ""; +// }else{ +// // 同步失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + retMsg.getString("error"); +// } +// }else{ +// // 同步失败,获取企业微信当前用户信息失败 +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + "获取企业微信当前用户信息失败"; +// } +// } +// }else{ +// // 同步失败,原因:用户所属部门找不到相应的企业微信ID、邮箱格式不合法 +// if(synThirdInfoEntity!=null){ +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// }else{ +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + retMsg.getString("error"); +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// } +// }else{ +// // 同步失败 +// if(synThirdInfoEntity!=null){ +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// }else{ +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + "access_token值为空,不能同步信息"; +// +// retMsg.put("code", true); +// retMsg.put("error", description); +// } +// }else { +// // 同步失败,原因:企业微信不允许手机号、邮箱不能同时为空; +// // 获取同步表信息 +// synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_USER,userEntity.getId()); +// if(synThirdInfoEntity!=null){ +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// }else{ +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// synState = SynThirdConsts.SYN_STATE_FAIL; +// description = userFlag + retMsg.getString("error"); +// +// retMsg.put("code", false); +// retMsg.put("error", description); +// } +// }else{ +// // 未设置单条同步,归并到未同步状态 +// // 获取同步表信息 +// synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_USER,userEntity.getId()); +// if(synThirdInfoEntity!=null){ +// // 修改同步表 +// opType = SynThirdConsts.OBJECT_OP_UPD; +// synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); +// }else{ +// // 写入同步表 +// opType = SynThirdConsts.OBJECT_OP_ADD; +// synThirdInfoPara = null; +// thirdObjId = ""; +// } +// +// synState = SynThirdConsts.SYN_STATE_NO; +// description = userFlag + "系统未设置单条同步"; +// +// retMsg.put("code", true); +// retMsg.put("error", description); +// } +// +// // 更新同步表 +// saveSynThirdInfoEntity(opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),userEntity.getId(),thirdObjId,synState,description); +// +// return retMsg; +// } + + + /** + * 往企业微信删除成员信息 + * 带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param id 本系统的公司或部门ID + * @return + * @throws WxErrorException + */ +// @Override +// public JSONObject deleteUserSysToQy(boolean isBatch, String id) throws WxErrorException { +// BaseSystemInfo config = getQyhConfig(); +// String corpId = config.getQyhCorpId(); +// String corpSecret = config.getQyhCorpSecret(); +// // 单条记录执行时,受开关限制 +// int qyhIsSyn = isBatch ? 1 : config.getQyhIsSynUser(); +// JSONObject tokenObject = new JSONObject(); +// String access_token = ""; +// JSONObject retMsg = new JSONObject(); +// List qyUserList = new ArrayList<>(); +// SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_USER,id); +// +// // 返回值初始化 +// retMsg.put("code", true); +// retMsg.put("error", "系统未设置单条同步"); +// +// // 支持同步 +// if(synThirdInfoEntity!=null) { +// if(qyhIsSyn==1) { +// // 获取 access_token +// tokenObject = SynQyWebChatUtil.getAccessToken(corpId, corpSecret); +// access_token = tokenObject.getString("access_token"); +// if (access_token != null && !"".equals(access_token)) { +// // 获取企业微信上的所有成员信息列表 +// JSONObject userObject = SynQyWebChatUtil.getUserList(SynThirdConsts.QY_ROOT_DEPT_ID,"1",access_token); +// if(userObject.getBoolean("code")) { +// qyUserList = JsonUtil.getJsonToList(userObject.getString("userlist"), QyWebChatUserModel.class); +// +// // 删除企业对应的用户 +// if(qyUserList.stream().filter(t -> t.getUserid().equals(synThirdInfoEntity.getThirdObjId())).count() > 0 ? true : false){ +// retMsg = SynQyWebChatUtil.deleteUser(synThirdInfoEntity.getThirdObjId(), access_token); +// if (retMsg.getBoolean("code")) { +// // 同步成功,直接删除同步表记录 +// synThirdInfoService.delete(synThirdInfoEntity); +// }else{ +// // 同步失败 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, retMsg.getString("error")); +// } +// }else{ +// // 根据企业微信ID找不到相应的信息,直接删除同步表记录 +// synThirdInfoService.delete(synThirdInfoEntity); +// } +// }else{ +// // 同步失败,获取企业微信的成员列表信息失败 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, "获取企业微信的成员列表信息失败"); +// +// retMsg.put("code", false); +// retMsg.put("error", "获取企业微信的成员列表信息失败"); +// } +// }else{ +// // 同步失败 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, "access_token值为空,不能同步信息"); +// +// retMsg.put("code", false); +// retMsg.put("error", "access_token值为空,不能同步信息!"); +// } +// }else{ +// // 未设置单条同步,归并到未同步状态 +// saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), +// Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_NO, "系统未设置同步"); +// +// retMsg.put("code", true); +// retMsg.put("error", "系统未设置单条同步"); +// } +// } +// +// return retMsg; +// } + + + /** + * 往企业微信创建成员信息 + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param userEntity + * @param accessToken (单条调用时为空) + * @return + * @throws WxErrorException + */ + @Override + public JSONObject createUserSysToQy(boolean isBatch, UserEntity userEntity,String accessToken) throws WxErrorException { + BaseSystemInfo config = getQyhConfig(); + String corpId = config.getQyhCorpId(); + // 向企业微信插入数据需要另外token(凭证密钥) + String corpSecret = config.getQyhAgentSecret(); + // 单条记录执行时,受开关限制 + int qyhIsSyn = isBatch ? 1 : config.getQyhIsSynUser(); + JSONObject tokenObject = new JSONObject(); + String access_token = ""; + JSONObject retMsg = new JSONObject(); + String userObjectModel = ""; + String thirdObjId = ""; + Integer synState = 0; + String description = ""; + String userFlag = "创建:"; + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", userFlag + "系统未设置单条同步"); + + // 企业微信限制:不能手机号、邮箱同时为空 + if(StringUtil.isEmpty(userEntity.getMobilePhone()) && StringUtil.isEmpty(userEntity.getEmail()) && qyhIsSyn == 1){ + retMsg.put("code", false); + retMsg.put("error", userFlag + "企业微信不允许手机号、邮箱不能同时为空!"); + } + + if (isBatch || qyhIsSyn==1){ + if(retMsg.getBoolean("code")){ + if(isBatch){ + access_token = accessToken; + }else{ + // 获取 access_token + tokenObject = SynQyWebChatUtil.getAccessToken(corpId, corpSecret); + access_token = tokenObject.getString("access_token"); + } + + if (access_token != null && !"".equals(access_token)) { + // 要同步到企业微信的对象赋值 + retMsg = setQyUserObject(userEntity, null); + if (retMsg.getBoolean("code")) { + userObjectModel = retMsg.getString("qyUserObject"); + // 往企业微信写入成员 + retMsg = SynQyWebChatUtil.createUser(userObjectModel, access_token); + + // 往同步写入本系统与第三方的对应信息 + if (retMsg.getBoolean("code")) { + // 同步成功 + thirdObjId = userEntity.getId(); + synState = SynThirdConsts.SYN_STATE_OK; + } else { + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + } + }else{ + // 同步失败,原因:部门找不到对应的第三方ID、邮箱格式不合法 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + } + + }else{ + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + "access_token值为空,不能同步信息"; + + retMsg.put("code", false); + retMsg.put("error", description); + } + + }else { + // 同步失败,原因:企业微信不允许手机号、邮箱不能同时为空 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + } + }else{ + // 无须同步,未同步状态 + synState = SynThirdConsts.SYN_STATE_NO; + description = userFlag + "系统未设置单条同步"; + + retMsg.put("code", true); + retMsg.put("error", description); + } + + // 更新同步表 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_ADD, null, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), userEntity.getId(), thirdObjId, synState, description); + + return retMsg; + } + + + /** + * 往企业微信更新成员信息 + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param userEntity + * @param accessToken (单条调用时为空) + * @return + * @throws WxErrorException + */ + @Override + public JSONObject updateUserSysToQy(boolean isBatch, UserEntity userEntity,String accessToken) throws WxErrorException { + BaseSystemInfo config = getQyhConfig(); + String corpId = config.getQyhCorpId(); + // 向企业微信插入数据需要另外token(凭证密钥) + String corpSecret = config.getQyhAgentSecret(); + // 单条记录执行时,受开关限制 + int qyhIsSyn = isBatch ? 1 : config.getQyhIsSynUser(); + JSONObject tokenObject = new JSONObject(); + String access_token = ""; + String access_tokens = ""; + JSONObject retMsg = new JSONObject(); + String userObjectModel = ""; + SynThirdInfoEntity synThirdInfoEntity = new SynThirdInfoEntity(); + SynThirdInfoEntity entity = new SynThirdInfoEntity(); + String opType = ""; + SynThirdInfoEntity synThirdInfoPara = new SynThirdInfoEntity(); + String thirdObjId = ""; + Integer synState = 0; + String description = ""; + String userFlag = "更新:"; + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", userFlag + "系统未设置单条同步"); + + // 企业微信限制:不能手机号、邮箱同时为空 + if(StringUtil.isEmpty(userEntity.getMobilePhone()) && StringUtil.isEmpty(userEntity.getEmail()) && qyhIsSyn == 1){ + retMsg.put("code", false); + retMsg.put("error", userFlag + "企业微信不允许手机号、邮箱不能同时为空!"); + } + + // 支持同步 + if (isBatch || qyhIsSyn==1){ + if(retMsg.getBoolean("code")){ + access_token = accessToken; + tokenObject = SynQyWebChatUtil.getAccessToken(config.getQyhCorpId(), config.getQyhCorpSecret()); + access_tokens = tokenObject.getString("access_token"); + + // 获取同步表信息 + synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_USER,userEntity.getId()); + if (access_token != null && !"".equals(access_token)) { + // 要同步到企业微信的对象赋值 + retMsg = setQyUserObject(userEntity,null); + if (retMsg.getBoolean("code")) { + // 判断当前用户对应的第三方的合法性 + userObjectModel = retMsg.getString("qyUserObject"); + retMsg = checkUserSysToQy(synThirdInfoEntity); + if (!retMsg.getBoolean("code")) { + if("3".equals(retMsg.getString("flag")) || "1".equals(retMsg.getString("flag"))){ + // flag:3 未同步,需要创建同步到企业微信、写入同步表 + // flag:1 已同步但第三方上没对应的ID,需要删除原来的同步信息,再创建同步到企业微信、写入同步表 + if("1".equals(retMsg.getString("flag"))) { + synThirdInfoService.delete(synThirdInfoEntity); + } + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + + // 往企业微信写入成员 + retMsg = SynQyWebChatUtil.createUser(userObjectModel, access_token); + if(retMsg.getBoolean("code")) { + // 同步成功 + thirdObjId = userEntity.getId(); + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + }else{ + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + } + } + + if("2".equals(retMsg.getString("flag"))){ + // 已同步但第三方ID为空,需要创建同步到企业微信、修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = ""; + + // 往企业微信写入成员 + retMsg = SynQyWebChatUtil.createUser(userObjectModel, access_token); + if(retMsg.getBoolean("code")) { + // 同步成功 + thirdObjId = userEntity.getId(); + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + }else{ + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + } + } + }else{ + // 更新同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + + // 获取当前成员信息 + QyWebChatUserModel qyWebChatUserModel = getQyUserById(synThirdInfoEntity.getThirdObjId(),access_tokens); + if("0".equals(qyWebChatUserModel.getErrcode())){ + // 要同步到企业微信的对象重新赋值 + retMsg = setQyUserObject(userEntity,qyWebChatUserModel); + userObjectModel = retMsg.getString("qyUserObject"); + + // 往企业微信更新成员信息 + retMsg = SynQyWebChatUtil.updateUser(userObjectModel, access_token); + if(retMsg.getBoolean("code")) { + // 同步成功 + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + }else{ + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + } + }else{ + // 同步失败,获取企业微信当前用户信息失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + "获取企业微信当前用户信息失败"; + } + } + }else{ + // 同步失败,原因:用户所属部门找不到相应的企业微信ID、邮箱格式不合法 + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + } + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + + retMsg.put("code", false); + retMsg.put("error", description); + } + }else{ + // 同步失败 + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + } + + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + "access_token值为空,不能同步信息"; + + retMsg.put("code", true); + retMsg.put("error", description); + } + }else { + // 同步失败,原因:企业微信不允许手机号、邮箱不能同时为空; + // 获取同步表信息 + synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_USER,userEntity.getId()); + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + } + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + + retMsg.put("code", false); + retMsg.put("error", description); + } + }else{ + // 未设置单条同步,归并到未同步状态 + // 获取同步表信息 + synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_USER,userEntity.getId()); + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + thirdObjId = ""; + } + + synState = SynThirdConsts.SYN_STATE_NO; + description = userFlag + "系统未设置单条同步"; + + retMsg.put("code", true); + retMsg.put("error", description); + } + + // 更新同步表 + saveSynThirdInfoEntity(opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),userEntity.getId(),thirdObjId,synState,description); + + return retMsg; + } + + + /** + * 往企业微信删除成员信息 + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param id 本系统的公司或部门ID + * @param accessToken (单条调用时为空) + * @return + * @throws WxErrorException + */ + @Override + public JSONObject deleteUserSysToQy(boolean isBatch, String id,String accessToken) throws WxErrorException { + BaseSystemInfo config = getQyhConfig(); + String corpId = config.getQyhCorpId(); + String corpSecret = config.getQyhCorpSecret(); + // 单条记录执行时,受开关限制 + int qyhIsSyn = isBatch ? 1 : config.getQyhIsSynUser(); + JSONObject tokenObject = new JSONObject(); + String access_token = ""; + JSONObject retMsg = new JSONObject(); + SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId(SynThirdConsts.THIRD_TYPE_QY,SynThirdConsts.DATA_TYPE_USER,id); + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", "系统未设置单条同步"); + + // 支持同步 + if(synThirdInfoEntity!=null) { + if(qyhIsSyn==1) { + // 获取 access_token + if(isBatch){ + access_token = accessToken; + }else{ + tokenObject = SynQyWebChatUtil.getAccessToken(corpId, corpSecret); + access_token = tokenObject.getString("access_token"); + } + + + if (access_token != null && !"".equals(access_token)) { + if (!"".equals(String.valueOf(synThirdInfoEntity.getThirdObjId())) && !"null".equals(String.valueOf(synThirdInfoEntity.getThirdObjId()))) { + retMsg = SynQyWebChatUtil.deleteUser(synThirdInfoEntity.getThirdObjId(), access_token); + if (retMsg.getBoolean("code")) { + // 同步成功,直接删除同步表记录 + synThirdInfoService.delete(synThirdInfoEntity); + }else{ + // 同步失败 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, retMsg.getString("error")); + } + }else{ + // 根据企业微信ID找不到相应的信息,直接删除同步表记录 + synThirdInfoService.delete(synThirdInfoEntity); + } + + }else{ + // 同步失败 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_FAIL, "access_token值为空,不能同步信息"); + + retMsg.put("code", false); + retMsg.put("error", "access_token值为空,不能同步信息!"); + } + }else{ + // 未设置单条同步,归并到未同步状态 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_UPD, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER), id, synThirdInfoEntity.getThirdObjId(), SynThirdConsts.SYN_STATE_NO, "系统未设置同步"); + + retMsg.put("code", true); + retMsg.put("error", "系统未设置单条同步"); + } + } + + return retMsg; + } + + /** + * 企业微信同步组织部门到本地 + * 企业微信同步单个公司或部门到本地(供调用) + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param accessToken (单条调用时为空) + * @return + */ + @Override + public JSONObject createDepartmentQyToSys(boolean isBatch, QyWebChatDeptModel deptEntity, String accessToken) { + BaseSystemInfo config = getQyhConfig(); + // 单条记录执行时,受开关限制 + int dingIsSyn = isBatch ? 1 : config.getQyhIsSynOrg(); + + Integer dingDeptId = deptEntity.getId(); + String dingDeptName = deptEntity.getName(); + Integer dingParentId = deptEntity.getParentid(); + + Integer synState = 0; + String deptFlag = "创建:"; + String description = ""; + + JSONObject retMsg = new JSONObject(); + boolean isDeptDiff = true; + String sysParentId = ""; + String sysObjId = ""; + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", "创建:系统未设置单条同步"); + + // 支持同步 + if(isBatch || dingIsSyn==1){ + boolean tag = false; + if(dingDeptId==1){ + tag=true; + } + SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoByThirdObjId(SynThirdConsts.THIRD_TYPE_QY_To_Sys,SynThirdConsts.DATA_TYPE_ORG,dingParentId+""); + + +// retMsg = checkDepartmentDingToSys(synThirdInfoEntity); + isDeptDiff = retMsg.getBoolean("code"); + if(isDeptDiff || tag) { + sysParentId = tag==true?" -1" : synThirdInfoEntity.getSysObjId(); + + if(isBatch || dingIsSyn==1) { + // 新增保存组织 + OrganizeEntity newOrg = new OrganizeEntity(); + sysObjId = RandomUtil.uuId(); + newOrg.setId(sysObjId); + if(!"1".equals(dingDeptId+"") ){ +// newOrg.setCategory(SynThirdConsts.OBJECT_TYPE_COMPANY); +// newOrg.setParentId("-1"); +// newOrg.setOrganizeIdTree(sysObjId); + + Assert.notNull(sysParentId,"父级组织未同步"); + newOrg.setCategory(SynThirdConsts.OBJECT_TYPE_DEPARTMENT); + newOrg.setParentId(sysParentId); + // 通过组织id获取父级组织 + String organizeIdTree = organizeService.getOrganizeIdTree(newOrg); + newOrg.setOrganizeIdTree(organizeIdTree+","+sysObjId); + + newOrg.setEnCode(dingDeptId+""); + newOrg.setFullName(dingDeptName); + newOrg.setSortCode(deptEntity.getOrder()!=null?deptEntity.getOrder():1L); + organizeService.save(newOrg); + }else{ + sysObjId = organizeService.getOrganizeByParentId("-1").get(0).getId(); + } + + + // 中间表 + retMsg.put("retDeptId", sysObjId); + synState = SynThirdConsts.SYN_STATE_OK; + + + }else{ + // 未设置单条同步,归并到未同步状态 + // 未同步 + synState = SynThirdConsts.SYN_STATE_NO; + description = deptFlag + "系统未设置单条同步"; + + retMsg.put("code", true); + retMsg.put("error", description); + retMsg.put("retDeptId", "0"); + } + }else{ + // 同步失败,上级部门无对应的企业微信ID + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + "部门所属的上级部门未同步到本地"; + + retMsg.put("code", false); + retMsg.put("error", description); + retMsg.put("retDeptId", "0"); + } + } + + // 更新同步表 + saveSynThirdInfoEntity(SynThirdConsts.OBJECT_OP_ADD,null,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY_To_Sys), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),sysObjId,dingDeptId+"",synState,description); + + return retMsg; + } + + /** + * 企业微信更新组织-部门到本地 + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param accessToken (单条调用时为空) + * @return + */ + @Override + public JSONObject updateDepartmentQyToSys(boolean isBatch, QyWebChatDeptModel deptEntity,String accessToken) { + BaseSystemInfo config = getQyhConfig(); +// String corpId = config.getDingSynAppKey(); +// String corpSecret = config.getDingSynAppSecret(); +// String compValue = SynThirdConsts.OBJECT_TYPE_COMPANY; + // 单条记录执行时,受开关限制 + int dingIsSyn = isBatch ? 1 : config.getQyhIsSynOrg(); + +// JSONObject tokenObject = new JSONObject(); +// String access_token = ""; + JSONObject retMsg = new JSONObject(); + DingTalkDeptModel deptModel = new DingTalkDeptModel(); + SynThirdInfoEntity synThirdInfoEntity = new SynThirdInfoEntity(); + SynThirdInfoEntity synThirdInfoParentEntity = new SynThirdInfoEntity(); + String opType = ""; + Integer synState = 0; + String description = ""; +// String thirdObjId = ""; + String sysObjId = ""; + String sysParentId = ""; + SynThirdInfoEntity synThirdInfoPara = new SynThirdInfoEntity(); + boolean isDeptDiff = true; + String deptFlag = "更新:"; + + Integer dingDeptId = deptEntity.getId(); + String dingDeptName = deptEntity.getName(); + Integer dingParentId = deptEntity.getParentid(); + OrganizeEntity orgInfo = new OrganizeEntity(); + + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", "系统未设置单条同步"); + + if(isBatch || dingIsSyn==1) { + // 获取同步表信息 + synThirdInfoEntity = synThirdInfoService.getInfoByThirdObjId(SynThirdConsts.THIRD_TYPE_QY_To_Sys,SynThirdConsts.DATA_TYPE_ORG,dingDeptId+""); + synThirdInfoParentEntity = synThirdInfoService.getInfoByThirdObjId(SynThirdConsts.THIRD_TYPE_QY_To_Sys,SynThirdConsts.DATA_TYPE_ORG,dingParentId+""); + if(synThirdInfoParentEntity ==null){ + retMsg.put("code", false); + retMsg.put("error", "上级部门未同步"); + return retMsg; + } +// retMsg = checkDepartmentDingToSys(synThirdInfoEntity); + isDeptDiff = retMsg.getBoolean("code"); + if(isDeptDiff) { +// sysParentId = synThirdInfoEntity.getSysObjId(); + sysParentId = synThirdInfoParentEntity.getSysObjId(); + // 获取同步表信息 +// synThirdInfoEntity = synThirdInfoService.getInfoByThirdObjId(SynThirdConsts.THIRD_TYPE_QY_To_Sys,SynThirdConsts.DATA_TYPE_ORG,dingDeptId+""); + // 判断当前部门对应的第三方的合法性 +// retMsg = checkDepartmentDingToSys(synThirdInfoEntity); + if (!retMsg.getBoolean("code")) { + if ("3".equals(retMsg.getString("flag")) || "1".equals(retMsg.getString("flag"))) { + // flag:3 未同步,需要创建同步到企业微信、写入同步表 + // flag:1 已同步但第三方上没对应的ID,需要删除原来的同步信息,再创建同步到企业微信、写入同步表 + if("1".equals(retMsg.getString("flag"))) { + synThirdInfoService.delete(synThirdInfoEntity); + } + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; +// thirdObjId = dingDeptId+""; + + // 新增保存组织 + orgInfo = new OrganizeEntity(); + sysObjId = RandomUtil.uuId(); + orgInfo.setId(sysObjId); + if(!"1".equals(dingDeptId+"") ){ +// newOrg.setCategory(SynThirdConsts.OBJECT_TYPE_COMPANY); +// newOrg.setParentId("-1"); +// newOrg.setOrganizeIdTree(sysObjId); + + orgInfo.setCategory(SynThirdConsts.OBJECT_TYPE_DEPARTMENT); + orgInfo.setParentId(sysParentId); + // 通过组织id获取父级组织 + String organizeIdTree = organizeService.getOrganizeIdTree(orgInfo); + orgInfo.setOrganizeIdTree(organizeIdTree+","+sysObjId); + + orgInfo.setEnCode(dingDeptId+""); + orgInfo.setFullName(dingDeptName); + orgInfo.setSortCode(deptEntity.getOrder()!=null?deptEntity.getOrder():1L); + organizeService.save(orgInfo); + }else{ + sysObjId = organizeService.getOrganizeByParentId("-1").get(0).getId(); + } + + // 同步成功 +// thirdObjId = retMsg.getString("retDeptId"); + retMsg.put("retDeptId", sysObjId); + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + + } + + if ("2".equals(retMsg.getString("flag"))) { + // flag:2 已同步但第三方ID为空,需要创建同步到企业微信、修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = dingDeptId+""; + + // 新增保存组织 + orgInfo = new OrganizeEntity(); + sysObjId = RandomUtil.uuId(); + orgInfo.setId(sysObjId); + if(!"1".equals(dingDeptId+"") ){ +// newOrg.setCategory(SynThirdConsts.OBJECT_TYPE_COMPANY); +// newOrg.setParentId("-1"); +// newOrg.setOrganizeIdTree(sysObjId); + + orgInfo.setCategory(SynThirdConsts.OBJECT_TYPE_DEPARTMENT); + orgInfo.setParentId(sysParentId); + // 通过组织id获取父级组织 + String organizeIdTree = organizeService.getOrganizeIdTree(orgInfo); + orgInfo.setOrganizeIdTree(organizeIdTree+","+sysObjId); + + orgInfo.setEnCode(dingDeptId+""); + orgInfo.setFullName(dingDeptName); + orgInfo.setSortCode(deptEntity.getOrder()!=null?deptEntity.getOrder():1L); + organizeService.save(orgInfo); + }else{ + sysObjId = organizeService.getOrganizeByParentId("-1").get(0).getId(); + } + + // 同步成功 + retMsg.put("retDeptId", sysObjId); + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + } + }else { + // 更新同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; +// thirdObjId = synThirdInfoEntity.getThirdObjId(); + sysObjId = synThirdInfoEntity.getSysObjId(); + + orgInfo = organizeService.getInfo(sysObjId); + if(orgInfo!=null){ +// orgInfo.setParentId(dingParentId+""); + orgInfo.setFullName(dingDeptName); + if(!"1".equals(dingDeptId+"")){ +// orgInfo.setCategory(SynThirdConsts.OBJECT_TYPE_COMPANY); +// orgInfo.setParentId("-1"); + +// orgInfo.setCategory(SynThirdConsts.OBJECT_TYPE_DEPARTMENT); + orgInfo.setParentId(sysParentId); + orgInfo.setOrganizeIdTree(orgInfo.getOrganizeIdTree().replace(","+orgInfo.getId(),"")); + organizeService.update(orgInfo.getId(),orgInfo); + } + + // 同步成功 + synState = SynThirdConsts.SYN_STATE_OK; + description = ""; + }else{ + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + "未找到对应的部门"; + } + } + }else{ + synThirdInfoEntity = synThirdInfoService.getInfoByThirdObjId(SynThirdConsts.THIRD_TYPE_QY_To_Sys,SynThirdConsts.DATA_TYPE_ORG,dingDeptId+""); + // 同步失败,上级部门检查有异常 + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + sysObjId = synThirdInfoEntity.getSysObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + sysObjId = ""; + } + + synState = SynThirdConsts.SYN_STATE_FAIL; + description = deptFlag + "上级部门无对应的本地ID"; + + retMsg.put("code", false); + retMsg.put("error", description); + } + }else{ + // 未设置单条同步,归并到未同步状态 + // 获取同步表信息 + synThirdInfoEntity = synThirdInfoService.getInfoByThirdObjId(SynThirdConsts.THIRD_TYPE_QY_To_Sys,SynThirdConsts.DATA_TYPE_ORG,dingDeptId+""); + if(synThirdInfoEntity!=null){ + // 修改同步表 + opType = SynThirdConsts.OBJECT_OP_UPD; + synThirdInfoPara = synThirdInfoEntity; + sysObjId = synThirdInfoEntity.getSysObjId(); + }else{ + // 写入同步表 + opType = SynThirdConsts.OBJECT_OP_ADD; + synThirdInfoPara = null; + sysObjId = ""; + } + + synState = SynThirdConsts.SYN_STATE_NO; + description = deptFlag + "系统未设置单条同步"; + + retMsg.put("code", true); + retMsg.put("error", description); + } + + // 更新同步表 + saveSynThirdInfoEntity(opType,synThirdInfoPara,Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY_To_Sys), + Integer.parseInt(SynThirdConsts.DATA_TYPE_ORG),sysObjId,dingDeptId+"",synState,description); + + return retMsg; + } + + + /** + * 企业微信同步用户到本地 + * @param isBatch 是否批量(批量不受开关限制) + * @param qyWebChatUserModel + * @return + */ + @Override + public JSONObject createUserQyToSys(boolean isBatch, QyWebChatUserModel qyWebChatUserModel,String access_token) throws Exception { + + + String dingUserId = qyWebChatUserModel.getUserid(); + BaseSystemInfo config = this.getQyhConfig(); + String corpId = config.getQyhCorpId(); + JSONObject retMsg2 = SynQyWebChatUtil.getLinkedcorpUserById(corpId+"/"+dingUserId,access_token); + String dingUserName = qyWebChatUserModel.getName(); + String dingMobile = retMsg2.getJSONObject("userinfo").getString("mobile"); + String dingTelephone = qyWebChatUserModel.getTelephone(); + Integer status = qyWebChatUserModel.getStatus(); + // 工号不唯一的情况,不能用于做本系统的账号 +// String dingJobNumber = qyWebChatUserModel.getJobNumber(); + // 职位:是字符串,手入的 +// String title = qyWebChatUserModel.getTitle(); + String sysObjId= ""; + // 单条记录执行时,受开关限制 + int dingIsSyn = config.getQyhIsSynUser(); + JSONObject retMsg = new JSONObject(); + String thirdObjId = dingUserId; + Integer synState = 0; + String description = ""; + String userFlag = "创建:"; + UserEntity userEntity = new UserEntity(); + String tag= SynThirdConsts.OBJECT_OP_ADD; +// if (status != 1) { +// return retMsg; +// } + if(isBatch || dingIsSyn==1){ + // 检测账户唯一 + UserEntity userAccount = userService.getUserByMobile(dingMobile); + if (userAccount!=null) { + // 查询用户id在不在同步表 + sysObjId= userAccount.getId(); + boolean hasExist = synThirdInfoService.getBySysObjId(sysObjId); + if (hasExist) { + // 说明创建过了,直接跳过 + tag=SynThirdConsts.OBJECT_OP_UPD; + synState=1; + description="创建过,更新对象"; + return retMsg; + }else{ + + retMsg.put("code", true); + description = "账户名重复:线上手机账号"+dingMobile+"自动合并为本地账号"; + synState = SynThirdConsts.SYN_STATE_OK; + retMsg.put("msg", description); + } + }else{ + // 判断中间表用户组织是否存在 + List deptIdList = qyWebChatUserModel.getDepartment(); + List deptIdStrList = deptIdList.stream().map(t->t+"").collect(Collectors.toList()); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().in(SynThirdInfoEntity::getThirdObjId,deptIdStrList); + wrapper.lambda().eq(SynThirdInfoEntity::getThirdType,SynThirdConsts.THIRD_TYPE_QY_To_Sys); + List synThirdInfoEntities = synThirdInfoService.list(wrapper); + if(synThirdInfoEntities!=null && synThirdInfoEntities.size()!=0){ + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", userFlag + "系统未设置单条同步"); + userEntity.setId(RandomUtil.uuId()); + userEntity.setHeadIcon("001.png"); + userEntity.setAccount(dingMobile); + // 工号 +// userEntity.setDingJobNumber(qyWebChatUserModel.getJobNumber()); + userEntity.setEmail(qyWebChatUserModel.getEmail()); + +// userEntity.setCertificatesNumber(qyWebChatUserModel.getJobNumber()); + userEntity.setMobilePhone(dingMobile); +// userEntity.setGender(2); + userEntity.setRealName(dingUserName); + userEntity.setEnabledMark(1); + if(StringUtil.isBlank(userEntity.getOrganizeId())){ + String orgId = synThirdInfoService.getSysByThird(String.valueOf(deptIdList.get(0))); + userEntity.setOrganizeId(orgId); + } + + userEntity.setPassword("4a7d1ed414474e4033ac29ccb8653d9b"); + sysObjId = userEntity.getId(); + List orgIdList = new ArrayList<>(); + for (String deptIdStr:deptIdStrList){ + String orgId = synThirdInfoService.getSysByThird(deptIdStr); + orgIdList.add(orgId); + } + userEntity.setOrganizeId(orgIdList.stream().collect(Collectors.joining(","))); + userService.create(userEntity); + +// userRelationService.syncDingUserRelation(sysObjId,deptIdList); + // 往同步写入本系统与第三方的对应信息 + if (retMsg.getBoolean("code")) { + // 同步成功 + synState = SynThirdConsts.SYN_STATE_OK; + } else { + // 同步失败 + synState = SynThirdConsts.SYN_STATE_FAIL; + description = userFlag + retMsg.getString("error"); + } + + }else{ + // 无须同步,未同步状态 + synState = SynThirdConsts.SYN_STATE_NO; + description = userFlag + "用户未同步组织信息"; + retMsg.put("code", false); + retMsg.put("error", description); + } + } + }else{ + // 无须同步,未同步状态 + synState = SynThirdConsts.SYN_STATE_NO; + description = userFlag + "系统未设置单条同步"; + retMsg.put("code", true); + retMsg.put("error", description); + } + // 更新同步表 + saveSynThirdInfoEntity(tag, null, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY_To_Sys), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),sysObjId, thirdObjId, synState, description); + return retMsg; + } + + // 更新同步表 + /** + * 企业微信更新用户信息到本地 + * 将组织、用户的信息写入同步表 + */ + @Override + public JSONObject updateUserQyToSystem(boolean isBatch, QyWebChatUserModel qyWebChatUserModel,String access_token) throws Exception { + BaseSystemInfo config = getQyhConfig(); + + JSONObject retMsg = new JSONObject(); + SynThirdInfoEntity synThirdInfoEntity = new SynThirdInfoEntity(); + String opType = ""; + String thirdObjId = ""; + Integer synState = 0; + String description = ""; + String userFlag = "更新:"; + + // 赋值第三方id + thirdObjId = qyWebChatUserModel.getUserid(); + // 返回值初始化 + retMsg.put("code", true); + retMsg.put("error", userFlag + "系统未设置单条同步"); + + // 单条记录执行时,受开关限制 + int dingIsSyn = config.getQyhIsSynUser(); + // 支持同步 + if (isBatch || dingIsSyn==1){ + // 获取同步表信息 + /** + * 获取指定第三方工具、指定数据类型、本地对象ID的同步信息 + * // 获取方式如果第三方用户id和第三方组织id会一致则须修改 + * thirdType 22 企业微信 + * dataType 2 用户 + * thirdId 第三方id + */ + synThirdInfoEntity = synThirdInfoService.getInfoByThirdObjId(SynThirdConsts.THIRD_TYPE_QY_To_Sys,SynThirdConsts.DATA_TYPE_USER,thirdObjId); + + if(synThirdInfoEntity!=null && StringUtil.isNoneBlank(synThirdInfoEntity.getSysObjId())){ + opType = SynThirdConsts.OBJECT_OP_UPD; + String sysObjId = synThirdInfoEntity.getSysObjId(); + + UserEntity info = userService.getInfo(sysObjId); + if(info==null){ + synState = SynThirdConsts.SYN_STATE_NO; + description = "本地更新记录未找到"; + retMsg.put("code", false); + retMsg.put("error", description); + synThirdInfoService.removeById(synThirdInfoEntity.getId()); + + + }else{ + String dingUserName = qyWebChatUserModel.getName(); + String dingMobile = qyWebChatUserModel.getMobile(); + + // 更新系统用户表 + List deptIdList = qyWebChatUserModel.getDepartment(); + List deptIdStrList = deptIdList.stream().map(t->t+"").collect(Collectors.toList()); +// info.setMobilePhone(dingMobile); +// info.setAccount(dingMobile); +// info.setRealName(dingUserName); + List orgIdList = new ArrayList<>(); + for (String deptIdStr:deptIdStrList){ + String orgId = synThirdInfoService.getSysByThird(deptIdStr); + orgIdList.add(orgId); + } + info.setOrganizeId(orgIdList.stream().collect(Collectors.joining(","))); + userService.update(info.getId(), info); + + // 检测是否未同步用户组织关联 + // userRelationService.syncDingUserRelation(info.getId(),deptIdList); + + synState=1; + // 更新同步表记录 + description="账号同步更新完成"; + saveSynThirdInfoEntity(opType, synThirdInfoEntity, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY_To_Sys), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),synThirdInfoEntity.getSysObjId(), thirdObjId, synState, description); + + } + + }else{ + if((synThirdInfoEntity!=null && StringUtil.isBlank(synThirdInfoEntity.getSysObjId() ))){ + // 删除记录 + synThirdInfoService.removeById(synThirdInfoEntity.getId()); + } + opType = SynThirdConsts.OBJECT_OP_ADD; + thirdObjId = synThirdInfoEntity.getThirdObjId(); + try { + this.createUserQyToSys(true,qyWebChatUserModel,access_token); + } catch (ParseException e) { + e.printStackTrace(); + } + } + }else{ + // 未设置单条同步,归并到未同步状态 + synState = SynThirdConsts.SYN_STATE_NO; + description = userFlag + "系统未设置单条同步"; + + retMsg.put("code", true); + retMsg.put("error", description); + opType= SynThirdConsts.OBJECT_OP_ADD; + + saveSynThirdInfoEntity(opType, null, Integer.parseInt(SynThirdConsts.THIRD_TYPE_QY_To_Sys), + Integer.parseInt(SynThirdConsts.DATA_TYPE_USER),null, thirdObjId, synState, description); + } + + return retMsg; + } + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/TemplateParamServiceImpl.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/TemplateParamServiceImpl.java new file mode 100644 index 0000000..1bb546a --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/TemplateParamServiceImpl.java @@ -0,0 +1,66 @@ +package com.yunzhupaas.message.service.impl; + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.message.entity.TemplateParamEntity; +import com.yunzhupaas.message.mapper.TemplateParamMapper; +import com.yunzhupaas.message.model.messagetemplateconfig.MessageTemplateConfigPagination; +import com.yunzhupaas.message.service.TemplateParamService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + + +import com.yunzhupaas.permission.service.AuthorizeService; + + +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; + +import com.yunzhupaas.util.*; + +import java.util.*; + +/** + * 消息模板(新) + * 版本: V3.2.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2022-08-18 + */ +@Service +public class TemplateParamServiceImpl extends SuperServiceImpl implements TemplateParamService { + + @Override + public QueryWrapper getChild(MessageTemplateConfigPagination pagination, QueryWrapper templateParamQueryWrapper) { +// boolean pcPermission = false; +// boolean appPermission = false; +// boolean isPc = ServletUtil.getHeader("yunzhupaas-origin").equals("pc"); +// if (isPc) { +// } + + return templateParamQueryWrapper; + } + + @Override + public TemplateParamEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TemplateParamEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public List getDetailListByParentId(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TemplateParamEntity::getTemplateId, id); + return this.list(queryWrapper); + } + + @Override + public List getParamList(String id,List params) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(TemplateParamEntity::getTemplateId, id); + queryWrapper.lambda().in(TemplateParamEntity::getField,params); + return this.list(queryWrapper); + } + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/UserDeviceServiceImpl.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/UserDeviceServiceImpl.java new file mode 100644 index 0000000..408959a --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/UserDeviceServiceImpl.java @@ -0,0 +1,76 @@ +package com.yunzhupaas.message.service.impl; + + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yunzhupaas.message.entity.UserDeviceEntity; +import com.yunzhupaas.message.mapper.UserDeviceMapper; + +import com.yunzhupaas.message.service.UserDeviceService; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; + +import com.yunzhupaas.util.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + + +/** + * 消息模板(新) + * 版本: V3.2.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2022-08-18 + */ +@Service +public class UserDeviceServiceImpl extends SuperServiceImpl implements UserDeviceService { + + + @Override + public UserDeviceEntity getInfoByUserId(String userId){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserDeviceEntity::getUserId,userId); + return this.getOne(queryWrapper); + } + + @Override + public List getCidList(String userId){ + List cidList = new ArrayList<>(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserDeviceEntity::getUserId,userId); + if(this.list(queryWrapper) != null && this.list(queryWrapper).size()>0) { + cidList = this.list(queryWrapper).stream().map(t -> t.getClientId()).distinct().collect(Collectors.toList()); + } + return cidList; + } + + @Override + public UserDeviceEntity getInfoByClientId(String clientId){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserDeviceEntity::getClientId,clientId); + return this.getOne(queryWrapper); + } + + @Override + public void create(UserDeviceEntity entity) { + this.save(entity); + } + + @Override + public boolean update(String id, UserDeviceEntity entity) { + entity.setId(id); + return this.updateById(entity); + } + + @Override + public void delete(UserDeviceEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/WechatUserServiceImpl.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/WechatUserServiceImpl.java new file mode 100644 index 0000000..947aeb8 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/service/impl/WechatUserServiceImpl.java @@ -0,0 +1,62 @@ +package com.yunzhupaas.message.service.impl; + + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.message.entity.WechatUserEntity; +import com.yunzhupaas.message.mapper.WechatUserMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + + +import com.yunzhupaas.message.service.WechatUserService; +import com.yunzhupaas.permission.service.AuthorizeService; + + +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; + +import com.yunzhupaas.util.*; + +import java.security.MessageDigest; +import java.util.*; + +/** + * 消息模板(新) + * 版本: V3.2.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2022-08-18 + */ +@Service +public class WechatUserServiceImpl extends SuperServiceImpl implements WechatUserService { + + + @Override + public WechatUserEntity getInfoByGzhId(String userId,String gzhId){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(WechatUserEntity::getUserId,userId); + queryWrapper.lambda().eq(WechatUserEntity::getGzhId,gzhId); + queryWrapper.lambda().eq(WechatUserEntity::getCloseMark,1); + return this.getOne(queryWrapper); + } + + @Override + public void create(WechatUserEntity entity) { + this.save(entity); + } + + @Override + public boolean update(String id, WechatUserEntity entity) { + entity.setId(id); + return this.updateById(entity); + } + + @Override + public void delete(WechatUserEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/util/PushMessageUtil.java b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/util/PushMessageUtil.java new file mode 100644 index 0000000..af0d8f4 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-biz/src/main/java/com/yunzhupaas/message/util/PushMessageUtil.java @@ -0,0 +1,48 @@ +package com.yunzhupaas.message.util; + +import com.alibaba.fastjson.JSONObject; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.message.entity.MessageReceiveEntity; +import org.springframework.stereotype.Component; + +import java.util.Map; +import java.util.Objects; + +/** + * 消息推送工具类 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-07-07 + */ +@Component +public class PushMessageUtil { + + /** + * 工作流消息发送 + * + * + * @param userInfo + */ + public static void pushMessage(Map map, UserInfo userInfo, int messageType){ + for (String userId : map.keySet()) { + for (OnlineUserModel item : OnlineUserProvider.getOnlineUserList()) { + if (userId.equals(item.getUserId()) && Objects.equals(userInfo.getTenantId(), item.getTenantId())) { + JSONObject jsonObject = new JSONObject(); + jsonObject.put("method", "messagePush"); + jsonObject.put("unreadNoticeCount", 1); + jsonObject.put("messageType", messageType); + jsonObject.put("userId", userInfo.getUserId()); + jsonObject.put("toUserId", userId); + jsonObject.put("title", map.get(userId).getTitle()); + jsonObject.put("id",map.get(userId).getId()); + jsonObject.put("messageDefaultTime", map.get(userId).getLastModifyTime() != null ? map.get(userId).getLastModifyTime().getTime() : null); + OnlineUserProvider.sendMessage(item, jsonObject); + } + } + } + } + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-controller/pom.xml b/yunzhupaas-message/yunzhupaas-message-controller/pom.xml new file mode 100644 index 0000000..71a5fa7 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-controller/pom.xml @@ -0,0 +1,22 @@ + + + + yunzhupaas-message + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-message-controller + + + + com.yunzhupaas + yunzhupaas-message-biz + ${project.version} + + + + diff --git a/yunzhupaas-message/yunzhupaas-message-controller/src/main/java/com/yunzhupaas/message/controller/AccountConfigController.java b/yunzhupaas-message/yunzhupaas-message-controller/src/main/java/com/yunzhupaas/message/controller/AccountConfigController.java new file mode 100644 index 0000000..926be03 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-controller/src/main/java/com/yunzhupaas/message/controller/AccountConfigController.java @@ -0,0 +1,531 @@ +package com.yunzhupaas.message.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import com.yunzhupaas.base.controller.SuperController; +import com.alibaba.fastjson.JSONObject; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.service.BillRuleService; +import com.yunzhupaas.base.service.DictionaryDataService; +import com.yunzhupaas.base.service.DictionaryTypeService; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.message.entity.AccountConfigEntity; +import com.yunzhupaas.message.model.accountconfig.*; +import com.yunzhupaas.message.model.message.EmailModel; +import com.yunzhupaas.message.service.AccountConfigService; +import com.yunzhupaas.message.service.SendConfigTemplateService; +import com.yunzhupaas.message.util.EmailUtil; +import com.yunzhupaas.message.util.QyWebChatUtil; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.emnus.ModuleTypeEnum; +import com.yunzhupaas.util.FileExport; +import com.yunzhupaas.util.third.DingTalkUtil; +import com.yunzhupaas.util.wxutil.HttpUtil; +import org.springframework.http.MediaType; +import org.springframework.transaction.annotation.Transactional; +import com.yunzhupaas.util.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.multipart.MultipartFile; + +import jakarta.validation.Valid; +import java.io.IOException; +import java.util.*; + + +/** + * 账号配置功能 + * + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-08-18 + */ +@Slf4j +@RestController +@Tag(name = "账号配置功能", description = "message") +@RequestMapping("/api/message/AccountConfig") +public class AccountConfigController extends SuperController { + + @Autowired + private FileExport fileExport; + + @Autowired + private BillRuleService billRuleService; + + @Autowired + private ConfigValueUtil configValueUtil; + + @Autowired + private UserService userApi; + + @Autowired + private AccountConfigService accountConfigService; + @Autowired + private DictionaryDataService dictionaryDataApi; + @Autowired + private SendConfigTemplateService sendConfigTemplateService; + + /** + * 列表 + * + * @param accountConfigPagination 账号配置分页模型 + * @return + */ + @Operation(summary = "列表") + @SaCheckPermission("msgCenter.accountConfig") + @GetMapping + public ActionResult> list(AccountConfigPagination accountConfigPagination) throws IOException { + List list = accountConfigService.getList(accountConfigPagination); + List smsSendTypeList = dictionaryDataApi.getListByTypeDataCode("smsSendType"); + List webHookList = dictionaryDataApi.getListByTypeDataCode("msgWebHookSendType"); + //处理id字段转名称,若无需转或者为空可删除 + UserEntity userEntity; + List listVO = JsonUtil.getJsonToList(list, AccountConfigListVO.class); + for (AccountConfigListVO accountConfigVO : listVO) { + //渠道 + if (StringUtil.isNotEmpty(accountConfigVO.getChannel())) { + smsSendTypeList.stream().filter(t -> accountConfigVO.getChannel().equals(t.getEnCode())).findFirst() + .ifPresent(dataTypeEntity -> accountConfigVO.setChannel(dataTypeEntity.getFullName())); + } + //webhook类型 + if (accountConfigVO.getWebhookType() != null) { + webHookList.stream().filter(t -> accountConfigVO.getWebhookType().equals(t.getEnCode())).findFirst() + .ifPresent(dataTypeEntity -> accountConfigVO.setWebhookType(dataTypeEntity.getFullName())); + } + + if (StringUtil.isNotEmpty(accountConfigVO.getCreatorUserId())) { + userEntity = userApi.getInfo(accountConfigVO.getCreatorUserId()); + if (userEntity != null) { + accountConfigVO.setCreatorUser(userEntity.getRealName() + "/" + userEntity.getAccount()); + } + } + } + + PageListVO vo = new PageListVO(); + vo.setList(listVO); + PaginationVO page = JsonUtil.getJsonToBean(accountConfigPagination, PaginationVO.class); + vo.setPagination(page); + return ActionResult.success(vo); + } + + /** + * 创建 + * + * @param accountConfigForm 新建账号配置模型 + * @return ignore + */ + @Operation(summary = "新建") + @Parameters({ + @Parameter(name = "accountConfigForm", description = "新建账号配置模型") + }) + @SaCheckPermission("msgCenter.accountConfig") + @PostMapping + @Transactional + public ActionResult create(@RequestBody @Valid AccountConfigForm accountConfigForm) throws DataException { + boolean b = accountConfigService.checkForm(accountConfigForm, 0,accountConfigForm.getType(),""); + if (b) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + boolean c = accountConfigService.checkGzhId(accountConfigForm.getAppKey(),0, "7", ""); + if("7".equals(accountConfigForm.getType())) { + if (c) { + return ActionResult.fail(MsgCode.FA048.get()); + } + } + String mainId = RandomUtil.uuId(); + UserInfo userInfo = UserProvider.getUser(); + AccountConfigEntity entity = JsonUtil.getJsonToBean(accountConfigForm, AccountConfigEntity.class); + entity.setCreatorTime(DateUtil.getNowDate()); + entity.setCreatorUserId(userInfo.getUserId()); + entity.setId(mainId); + accountConfigService.save(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + + /** + * 信息 + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "信息") + @GetMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("msgCenter.accountConfig") + public ActionResult info(@PathVariable("id") String id) { + AccountConfigEntity entity = accountConfigService.getInfo(id); + AccountConfigInfoVO vo = JsonUtil.getJsonToBean(entity, AccountConfigInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 表单信息(详情页) + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "表单信息(详情页)") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("msgCenter.accountConfig") + @GetMapping("/detail/{id}") + public ActionResult detailInfo(@PathVariable("id") String id) { + return info(id); + } + + + /** + * 更新 + * + * @param id 主键 + * @param accountConfigForm 修改账号配置模型 + * @return ignore + */ + @Operation(summary = "更新") + @PutMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "accountConfigForm", description = "修改账号配置模型", required = true) + }) + @SaCheckPermission("msgCenter.accountConfig") + @Transactional + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid AccountConfigForm accountConfigForm) throws DataException { + + boolean b = accountConfigService.checkForm(accountConfigForm, 0,accountConfigForm.getType(),accountConfigForm.getId()); + if (b) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + boolean c = accountConfigService.checkGzhId(accountConfigForm.getAppKey(),0, "7", id); + if("7".equals(accountConfigForm.getType())) { + if (c) { + return ActionResult.fail(MsgCode.FA048.get()); + } + } + //判断配置是否被引用 + if(Objects.equals(0, accountConfigForm.getEnabledMark())){ + if(sendConfigTemplateService.isUsedAccount(accountConfigForm.getId())) { + return ActionResult.fail(MsgCode.FA049.get()); + } + } + UserInfo userInfo = UserProvider.getUser(); + AccountConfigEntity entity = accountConfigService.getInfo(id); + if (entity != null) { + AccountConfigEntity subentity = JsonUtil.getJsonToBean(accountConfigForm, AccountConfigEntity.class); + subentity.setCreatorTime(entity.getCreatorTime()); + subentity.setCreatorUserId(entity.getCreatorUserId()); + subentity.setLastModifyTime(DateUtil.getNowDate()); + subentity.setLastModifyUserId(userInfo.getUserId()); + boolean b1 = accountConfigService.updateById(subentity); + if (!b1) { + return ActionResult.fail(MsgCode.VS405.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } else { + return ActionResult.fail(MsgCode.FA002.get()); + } + } + + /** + * 删除 + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "删除") + @DeleteMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("msgCenter.accountConfig") + @Transactional + public ActionResult delete(@PathVariable("id") String id) { + AccountConfigEntity entity = accountConfigService.getInfo(id); + if (entity != null) { + //判断是否与消息发送配置关联 + //判断配置是否被引用 + if(sendConfigTemplateService.isUsedAccount(entity.getId())) { + return ActionResult.fail(MsgCode.FA050.get()); + } + + accountConfigService.delete(entity); + + } + return ActionResult.success(MsgCode.SU003.get()); + } + + + /** + * 开启或禁用 + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "开启或禁用") + @PostMapping("/unable/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("msgCenter.accountConfig") + @Transactional + public ActionResult unable(@PathVariable("id") String id) { + AccountConfigEntity entity = accountConfigService.getInfo(id); + if (entity != null) { + if("1".equals(String.valueOf(entity.getEnabledMark()))){ + entity.setEnabledMark(0); + return ActionResult.success(MsgCode.WF027.get()); + }else { + //判断是否被引用 + + entity.setEnabledMark(1); + return ActionResult.success(MsgCode.WF026.get()); + } + }else { + return ActionResult.fail(MsgCode.FA007.get()); + } + } + + /** + * 复制 + * + * @param id 主键 + * @return + */ + @Operation(summary = "复制") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("msgCenter.accountConfig") + @PostMapping("/{id}/Actions/Copy") + @Transactional + public ActionResult copy(@PathVariable("id") String id) { + UserInfo userInfo = UserProvider.getUser(); + AccountConfigEntity entity = accountConfigService.getInfo(id); + if (entity != null) { + entity.setEnabledMark(0); + String copyNum = UUID.randomUUID().toString().substring(0, 5); + entity.setFullName(entity.getFullName()+".副本"+copyNum); + entity.setEnCode(entity.getEnCode()+copyNum); + entity.setCreatorTime(DateUtil.getNowDate()); + entity.setCreatorUserId(userInfo.getUserId()); + if("7".equals(entity.getType())){ + entity.setAppKey(entity.getAppKey()+"副本"+copyNum); + } + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + entity.setId(RandomUtil.uuId()); + AccountConfigEntity copyEntity = JsonUtil.getJsonToBean(entity, AccountConfigEntity.class); + if(copyEntity.getEnCode().length()>50 || copyEntity.getFullName().length()>50){ + return ActionResult.fail(MsgCode.PRI006.get()); + } + accountConfigService.create(copyEntity); + return ActionResult.success(MsgCode.SU007.get()); + }else { + return ActionResult.fail(MsgCode.FA004.get()); + } + } + + + /** + * 导出账号配置 + * + * @param id 账号配置id + * @return ignore + */ + @Operation(summary = "导出") + @GetMapping("/{id}/Action/Export") + public ActionResult export(@PathVariable String id) { + AccountConfigEntity entity = accountConfigService.getInfo(id); + //导出文件 + DownloadVO downloadVO = fileExport.exportFile(entity, configValueUtil.getTemporaryFilePath(), entity.getFullName(), ModuleTypeEnum.ACCOUNT_CONFIG.getTableName()); + return ActionResult.success(downloadVO); + } + + /** + * 导入账号配置 + * + * @param multipartFile 备份json文件 + * @return 执行结果标识 + */ + @Operation(summary = "导入") + @PostMapping(value = "/Action/Import", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ActionResult importData(@RequestPart("file") MultipartFile multipartFile) throws DataException { + UserInfo userInfo = UserProvider.getUser(); + //判断是否为.json结尾 + if (FileUtil.existsSuffix(multipartFile, ModuleTypeEnum.ACCOUNT_CONFIG.getTableName())) { + return ActionResult.fail(MsgCode.IMP002.get()); + } + //获取文件内容 + String fileContent = FileUtil.getFileContent(multipartFile); + AccountConfigEntity entity = JsonUtil.getJsonToBean(fileContent, AccountConfigEntity.class); + entity.setCreatorUserId(userInfo.getUserId()); + entity.setCreatorTime(DateUtil.getNowDate()); + return accountConfigService.ImportData(entity); + } + + /** + * 测试发送邮件 + * + * @param accountConfigForm 账号测试模型 + * @return + */ + @Operation(summary = "测试发送邮箱") + @Parameters({ + @Parameter(name = "accountConfigForm", description = "账号测试模型", required = true) + }) + @SaCheckPermission("msgCenter.accountConfig") + @PostMapping("/testSendMail") + @Transactional + public ActionResult testSendMail(@RequestBody @Valid AccountConfigForm accountConfigForm) { + List toMails = accountConfigForm.getTestSendEmail(); + // 获取邮箱配置 + Map objModel = new HashMap<>(); + objModel.put("emailSmtpHost",accountConfigForm.getSmtpServer()); + objModel.put("emailSmtpPort",accountConfigForm.getSmtpPort().toString()); + objModel.put("emailSenderName",accountConfigForm.getAddressorName()); + objModel.put("emailAccount",accountConfigForm.getSmtpUser()); + objModel.put("emailPassword",accountConfigForm.getSmtpPassword()); + objModel.put("emailSsl",accountConfigForm.getSslLink()== 1 ? "true" : "false"); + + + EmailModel emailModel = JsonUtil.getJsonToBean(objModel, EmailModel.class); + StringBuilder toUserMail = new StringBuilder(); + String userEmailAll = ""; + String userEmail = ""; + String userName = ""; + + // 相关参数验证 + if (StringUtil.isEmpty(emailModel.getEmailSmtpHost())) { + return ActionResult.fail(MsgCode.MSERR101.get()); + } else if (StringUtil.isEmpty(emailModel.getEmailSmtpPort())) { + return ActionResult.fail(MsgCode.MSERR101.get()); + } else if (StringUtil.isEmpty(emailModel.getEmailAccount())) { + return ActionResult.fail(MsgCode.MSERR102.get()); + } else if (StringUtil.isEmpty(emailModel.getEmailPassword())) { + return ActionResult.fail(MsgCode.MSERR103.get()); + } else if (toMails == null || toMails.size() < 1) { + return ActionResult.fail(MsgCode.MSERR104.get()); + } else { + // 设置邮件标题 + emailModel.setEmailTitle(accountConfigForm.getTestEmailTitle()); + // 设置邮件内容 + String content = accountConfigForm.getTestEmailContent(); + emailModel.setEmailContent(content); + + // 获取收件人的邮箱地址、创建消息用户实体 + for (String userId : toMails) { + UserEntity userEntity = userApi.getInfo(userId); + if (userEntity != null) { + userEmail = StringUtil.isEmpty(userEntity.getEmail()) ? "" : userEntity.getEmail(); + userName = userEntity.getRealName(); + } + if (StringUtil.isNotBlank(userEmail) && !"null".equals(userEmail)) { + //校验用户邮箱格式 + if(!isEmail(userEmail)){ + return ActionResult.fail(MsgCode.MSERR105.get(userName)); + } + toUserMail = toUserMail.append(",").append(userName).append("<").append(userEmail).append(">"); + } else { + return ActionResult.fail(MsgCode.MSERR106.get(userName)); + } + } + // 处理接收人员的邮箱信息串并验证 + userEmailAll = toUserMail.toString(); + if (StringUtil.isNotEmpty(userEmailAll)) { + userEmailAll = userEmailAll.substring(1); + } + if (StringUtil.isEmpty(userEmailAll)) { + return ActionResult.fail(MsgCode.MSERR107.get()); + } else { + // 设置接收人员 + emailModel.setEmailToUsers(userEmailAll); + // 发送邮件 + JSONObject retJson = EmailUtil.sendMail(emailModel); + if (!retJson.getBoolean("code")) { + return ActionResult.fail(MsgCode.MSERR108.get(retJson.get("error"))); + } + } + } + return ActionResult.success(MsgCode.MSERR111.get()); + } + + /** + * 测试企业微信配置的连接功能 + * + * @param accountConfigForm 账号测试模型 + * @return ignore + */ + @Operation(summary = "测试企业微信配置的连接") + @Parameters({ + @Parameter(name = "accountConfigForm", description = "账号测试模型", required = true) + }) + @SaCheckPermission("msgCenter.accountConfig") + @PostMapping("/testQyWebChatConnect") + public ActionResult testQyWebChatConnect(@RequestBody @Valid AccountConfigForm accountConfigForm) { + JSONObject retMsg; + // 测试发送消息、组织同步的连接 + //企业微信企业id + String corpId = accountConfigForm.getEnterpriseId(); + //企业微信应用secret + String agentSecret = accountConfigForm.getAppSecret(); +// String corpSecret = testAccountConfigForm.getQyhCorpSecret(); + // 测试发送消息的连接 + retMsg = QyWebChatUtil.getAccessToken(corpId, agentSecret); + if (HttpUtil.isWxError(retMsg)) { + return ActionResult.fail(MsgCode.MSERR110.get(retMsg.getString("errmsg"))); + } + return ActionResult.success(MsgCode.MSERR109.get()); + } + + /** + * 测试钉钉配置的连接功能 + * + * @param accountConfigForm 账号测试模型 + * @return ignore + */ + @Operation(summary = "测试钉钉配置的连接") + @Parameters({ + @Parameter(name = "accountConfigForm", description = "账号测试模型", required = true) + }) + @SaCheckPermission("msgCenter.accountConfig") + @PostMapping("/testDingTalkConnect") + public ActionResult testDingTalkConnect(@RequestBody @Valid AccountConfigForm accountConfigForm) { + JSONObject retMsg; + // 测试钉钉配置的连接 + String appKey = accountConfigForm.getAppId(); + String appSecret = accountConfigForm.getAppSecret(); + /// +// String agentId = dingTalkModel.getDingAgentId(); + // 测试钉钉的连接 + retMsg = DingTalkUtil.getAccessToken(appKey, appSecret); + if (!retMsg.getBoolean("code")) { + return ActionResult.fail(MsgCode.MSERR110.get(retMsg.getString("error"))); + } + return ActionResult.success(MsgCode.MSERR109.get()); + } + + public boolean isEmail(String email){ + String EMAIL_REGEX = "^[\\w-_\\.+]*[\\w-_\\.]\\@([\\w]+\\.)+[\\w]+[\\w]$"; + Boolean b = email.matches(EMAIL_REGEX); + return b; + } +} + diff --git a/yunzhupaas-message/yunzhupaas-message-controller/src/main/java/com/yunzhupaas/message/controller/ImReplyController.java b/yunzhupaas-message/yunzhupaas-message-controller/src/main/java/com/yunzhupaas/message/controller/ImReplyController.java new file mode 100644 index 0000000..499693e --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-controller/src/main/java/com/yunzhupaas/message/controller/ImReplyController.java @@ -0,0 +1,125 @@ +package com.yunzhupaas.message.controller; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import com.yunzhupaas.base.controller.SuperController; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.message.entity.ImReplyEntity; +import com.yunzhupaas.message.model.ImReplyListModel; +import com.yunzhupaas.message.model.ImReplyListVo; +import com.yunzhupaas.message.service.ImContentService; +import com.yunzhupaas.message.service.ImReplyService; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UploaderUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Comparator; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 消息会话接口 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-05-29 + */ +@Tag(name = "消息会话接口", description = "imreply") +@RestController +@RequestMapping("/api/message/imreply") +public class ImReplyController extends SuperController { + @Autowired + private ImReplyService imReplyService; + @Autowired + private ImContentService imContentService; + @Autowired + private UserService userService; + + /** + * 获取消息会话列表 + * + * @return + */ + @Operation(summary = "获取消息会话列表") + @GetMapping + public ActionResult> getList() { + List imReplyList = imReplyService.getImReplyList(); + //过滤 发送者删除标记 + imReplyList = imReplyList.stream().filter(t ->{ + List deleteId = StringUtil.isNotEmpty(t.getDeleteUserId())? Arrays.asList(t.getDeleteUserId().split(",")):new ArrayList<>(); + return !deleteId.contains(UserProvider.getUser().getUserId()); + }).collect(Collectors.toList()); + List imReplyLists = new ArrayList<>(imReplyList); + for (ImReplyListModel vo : imReplyList) { + UserEntity entity = userService.getInfo(vo.getId()); + if (entity == null || entity.getEnabledMark() == 0) { + imReplyLists.remove(vo); + continue; + } + //拼接账号和名称 + vo.setRealName(entity.getRealName()); + vo.setAccount(entity.getAccount()); + //头像路径拼接 + vo.setHeadIcon(UploaderUtil.uploaderImg(vo.getHeadIcon())); + //获取未读消息 + vo.setUnreadMessage(imContentService.getUnreadCount(vo.getId(), UserProvider.getUser().getUserId())); + if(vo.getSendDeleteMark()!=null && vo.getSendDeleteMark().equals(UserProvider.getUser().getUserId()) || vo.getDeleteMark()==1){ + vo.setLatestMessage(""); + vo.setMessageType(""); + } + } + //排序 + imReplyLists = imReplyLists.stream().sorted(Comparator.comparing(ImReplyListModel::getLatestDate).reversed()).collect(Collectors.toList()); + List imReplyListVoList = JsonUtil.getJsonToList(imReplyLists, ImReplyListVo.class); + ListVO listVO = new ListVO(); + listVO.setList(imReplyListVoList); + return ActionResult.success(listVO); + } + + /** + * 删除聊天记录 + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "删除聊天记录") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @DeleteMapping("/deleteChatRecord/{id}") + public ActionResult deleteChatRecord(@PathVariable("id") String id){ + imContentService.deleteChatRecord(UserProvider.getUser().getUserId(),id); + return ActionResult.success(""); + } + + /** + * 移除会话列表 + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "移除会话列表") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @DeleteMapping("/relocation/{id}") + public ActionResult relocation(@PathVariable("id") String id){ + imReplyService.relocation(UserProvider.getUser().getUserId(),id); + return ActionResult.success(""); + } + + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-controller/src/main/java/com/yunzhupaas/message/controller/MessageController.java b/yunzhupaas-message/yunzhupaas-message-controller/src/main/java/com/yunzhupaas/message/controller/MessageController.java new file mode 100644 index 0000000..7f39738 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-controller/src/main/java/com/yunzhupaas/message/controller/MessageController.java @@ -0,0 +1,405 @@ +package com.yunzhupaas.message.controller; + + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import com.yunzhupaas.base.controller.SuperController; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.entity.SuperBaseEntity; +import com.yunzhupaas.base.service.DictionaryDataService; +import com.yunzhupaas.base.service.DictionaryTypeService; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.message.entity.MessageEntity; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.message.entity.MessageReceiveEntity; +import com.yunzhupaas.message.model.NoticePagination; +import com.yunzhupaas.message.service.MessageService; +import com.yunzhupaas.message.model.message.*; +import com.yunzhupaas.message.service.UserDeviceService; +import com.yunzhupaas.message.util.unipush.UinPush; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.JsonUtilEx; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 系统公告 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Tag(name = "系统公告", description = "Message") +@RestController +@RequestMapping("/api/message") +public class MessageController extends SuperController { + + @Autowired + private MessageService messageService; + @Autowired + private UserService userApi; + @Autowired + private UinPush uinPush; + @Autowired + private UserDeviceService userDeviceService; + @Autowired + private DictionaryDataService dictionaryDataApi; + @Autowired + private DictionaryTypeService dictionaryTypeService; + + /** + * 列表(通知公告) + * + * @param pagination + * @return + */ + @Operation(summary = "获取系统公告列表(带分页)") + @SaCheckPermission("system.notice") + @PostMapping("/Notice/List") + public ActionResult> NoticeList(@RequestBody NoticePagination pagination) { + messageService.updateEnabledMark(); + List list = messageService.getNoticeList(pagination); + List userList = userApi.getUserName(list.stream().map(MessageEntity::getCreatorUserId).collect(Collectors.toList())); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + List noticeType = dictionaryDataApi.getListByTypeDataCode("NoticeType"); + List voList = new ArrayList<>(); + // 判断是否过期 + list.forEach(t -> { + MessageNoticeVO vo = JsonUtil.getJsonToBean(t, MessageNoticeVO.class); + // 处理是否过期 + if (t.getExpirationTime() != null) { + // 已发布的情况下 + if (t.getEnabledMark() == 1) { + if (t.getExpirationTime().getTime() < System.currentTimeMillis()) { + vo.setEnabledMark(2); + } + } + } + DictionaryDataEntity dictionaryDataEntity = noticeType.stream().filter(notice -> notice.getEnCode().equals(t.getCategory())).findFirst().orElse(new DictionaryDataEntity()); + vo.setCategory(dictionaryDataEntity.getFullName()); + // 转换创建人、发布人 + UserEntity user = userList.stream().filter(ul -> ul.getId().equals(t.getCreatorUserId())).findFirst().orElse(null); + vo.setCreatorUser(user != null ? user.getRealName() + "/" + user.getAccount() : ""); + if (t.getEnabledMark() != null && t.getEnabledMark() != 0) { + UserEntity entity = userApi.getInfo(t.getLastModifyUserId()); + vo.setLastModifyUserId(entity != null ? entity.getRealName() + "/" + entity.getAccount() : ""); + vo.setReleaseTime(t.getLastModifyTime() != null ? t.getLastModifyTime().getTime() : null); + vo.setReleaseUser(vo.getLastModifyUserId()); + } + voList.add(vo); + }); + return ActionResult.page(voList, paginationVO); + } + + /** + * 添加系统公告 + * + * @param noticeCrForm 实体对象 + * @return + */ + @Operation(summary = "添加系统公告") + @Parameters({ + @Parameter(name = "noticeCrForm", description = "新建系统公告模型", required = true) + }) + @SaCheckPermission("system.notice") + @PostMapping("/Notice") + public ActionResult create(@RequestBody @Valid NoticeCrForm noticeCrForm) { + MessageEntity entity = JsonUtil.getJsonToBean(noticeCrForm, MessageEntity.class); + if(entity != null && StringUtil.isNotEmpty(entity.getBodyText()) && (entity.getBodyText().contains("<") || entity.getBodyText().contains("&lt;"))){ + return ActionResult.fail(MsgCode.MSERR112.get()); + } + messageService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 修改系统公告 + * + * @param id 主键值 + * @param messageUpForm 实体对象 + * @return + */ + @Operation(summary = "修改系统公告") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "messageUpForm", description = "修改系统公告模型", required = true) + }) + @SaCheckPermission("system.notice") + @PutMapping("/Notice/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid NoticeUpForm messageUpForm) { + MessageEntity entity = JsonUtil.getJsonToBean(messageUpForm, MessageEntity.class); + if(entity != null && StringUtil.isNotEmpty(entity.getBodyText()) && (entity.getBodyText().contains("<") || entity.getBodyText().contains("&lt;"))){ + return ActionResult.fail(MsgCode.MSERR112.get()); + } + boolean flag = messageService.update(id, entity); + if (flag == false) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "获取/查看系统公告信息") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("system.notice") + @GetMapping("/Notice/{id}") + public ActionResult Info(@PathVariable("id") String id) throws DataException { + MessageEntity entity = messageService.getInfo(id); + NoticeInfoVO vo = null; + if (entity != null) { + UserEntity info = userApi.getInfo(entity.getCreatorUserId()); + entity.setCreatorUserId(info != null ? info.getRealName() + "/" + info.getAccount() : ""); + vo = JsonUtilEx.getJsonToBeanEx(entity, NoticeInfoVO.class); + vo.setReleaseUser(entity.getCreatorUserId()); + vo.setReleaseTime(entity.getLastModifyTime() != null ? entity.getLastModifyTime().getTime() : null); + UserEntity userEntity = userApi.getInfo(entity.getLastModifyUserId()); + if (userEntity != null && StringUtil.isNotEmpty(userEntity.getId())) { + String realName = userEntity.getRealName(); + String account = userEntity.getAccount(); + if (StringUtil.isNotEmpty(realName)) { + vo.setReleaseUser(realName + "/" + account); + } + } + } + return ActionResult.success(vo); + } + + /** + * 删除 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "删除系统公告") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("system.notice") + @DeleteMapping("/Notice/{id}") + public ActionResult delete(@PathVariable("id") String id) { + MessageEntity entity = messageService.getInfo(id); + if (entity != null) { + messageService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + + /** + * 发布公告 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "发布系统公告") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("system.notice") + @PutMapping("/Notice/{id}/Actions/Release") + public ActionResult release(@PathVariable("id") String id) { + MessageEntity entity = messageService.getInfo(id); + if (entity != null) { + List userIds = null; + if (StringUtil.isNotEmpty(entity.getToUserIds())) { + userIds = Arrays.asList(entity.getToUserIds().split(",")); + } else { + userIds = userApi.getListId(); + } + List userIdList = userApi.getUserIdList(userIds, null); + if (messageService.sentNotice(userIdList, entity)) { + /*if(userIdList != null && userIdList.size()>0) { + for (String userId : userIdList) { + List cidList = userDeviceService.getCidList(userId); + if(cidList != null && cidList.size()>0){ + JSONObject jsonObject = new JSONObject(); + jsonObject.put("type","1"); + jsonObject.put("id",entity.getId()); + jsonObject.put("title",entity.getTitle()); + String text = JSONObject.toJSONString(jsonObject); + byte[] bytes = text.getBytes(StandardCharsets.UTF_8); + text = Base64.getEncoder().encodeToString(bytes); + uinPush.sendUniPush(cidList, entity.getTitle(), "你有一条公告消息", "1", text); + } + } + }*/ + return ActionResult.success(MsgCode.SU011.get()); + } + } + return ActionResult.fail(MsgCode.FA011.get()); + } +//=======================================站内消息、消息中心================================================= + + + /** + * 获取消息中心列表 + * + * @param pagination + * @return + */ + @Operation(summary = "列表(通知公告/系统消息/私信消息)") + @GetMapping + public ActionResult> messageList(PaginationMessage pagination) { + List listVO = new ArrayList<>(); + List list = messageService.getMessageList3(pagination, pagination.getType(), null, pagination.getIsRead()); + List userList = userApi.getUserName(list.stream().map(SuperBaseEntity.SuperCBaseEntity::getCreatorUserId).collect(Collectors.toList())); + list.forEach(t -> { + MessageInfoVO vo = JsonUtil.getJsonToBean(t, MessageInfoVO.class); + UserEntity user = userList.stream().filter(ul -> ul.getId().equals(t.getCreatorUserId())).findFirst().orElse(null); + if (user != null) { + vo.setReleaseTime(t.getCreatorTime() != null ? t.getCreatorTime().getTime() : null); + UserEntity entity = userApi.getInfo(t.getCreatorUserId()); + vo.setReleaseUser(entity != null ? entity.getRealName() + "/" + entity.getAccount() : ""); + vo.setCreatorUser(entity != null ? entity.getRealName() + "/" + entity.getAccount() : ""); + } + listVO.add(vo); + }); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(listVO, paginationVO); + } + + + /** + * 读取消息 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "读取消息") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @GetMapping("/ReadInfo/{id}") + public ActionResult readInfo(@PathVariable("id") String id) throws DataException { + MessageReceiveEntity receive = messageService.messageRead(id); + if (receive != null) { + UserEntity user = userApi.getInfo(receive.getCreatorUserId()); + receive.setCreatorUserId(user != null ? user.getRealName() + "/" + user.getAccount() : ""); + receive.setBodyText(receive.getBodyText()); +// if (entity.getType() == 2) { +// entity.setBodyText(receive.getBodyText()); +// } + } + NoticeInfoVO vo = JsonUtil.getJsonToBean(receive, NoticeInfoVO.class); + if (Objects.equals(receive.getType() , 1)) { + try{ + MessageEntity jsonToBean = JsonUtil.getJsonToBean(receive.getBodyText(), MessageEntity.class); + if (jsonToBean !=null) { + vo.setCategory(jsonToBean.getCategory()); + vo.setCoverImage(jsonToBean.getCoverImage()); + vo.setExcerpt(jsonToBean.getExcerpt()); + vo.setExpirationTime(jsonToBean.getExpirationTime() != null ? jsonToBean.getExpirationTime().getTime() : null); + vo.setFiles(jsonToBean.getFiles()); + vo.setBodyText(jsonToBean.getBodyText()); + if (jsonToBean.getId() != null) { + MessageEntity info = messageService.getInfo(jsonToBean.getId()); + if (info != null) { + vo.setCategory(info.getCategory()); + vo.setCoverImage(info.getCoverImage()); + vo.setExcerpt(info.getExcerpt()); + vo.setExpirationTime(info.getExpirationTime() != null ? info.getExpirationTime().getTime() : null); + vo.setFiles(info.getFiles()); + vo.setBodyText(info.getBodyText()); + } + } + } + }catch (Exception e){ + vo.setBodyText(receive.getBodyText()); + } + + } + vo.setReleaseTime(receive.getCreatorTime() != null ? receive.getCreatorTime().getTime() : null); +// UserEntity info = usersApi.getInfoById(receive.getCreatorUserId()); + vo.setReleaseUser(receive.getCreatorUserId()); + return ActionResult.success(vo); + } + + + /** + * 全部已读 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "全部已读") + @Parameters({ + @Parameter(name = "pagination", description = "分页模型", required = true) + }) + @PostMapping("/Actions/ReadAll") + public ActionResult allRead(@RequestBody PaginationMessage pagination) { + List list = messageService.getMessageList3(pagination, pagination.getType(),null,pagination.getIsRead()); + if(list != null && list.size()>0) { + List idList = list.stream().map(SuperBaseEntity.SuperIBaseEntity::getId).collect(Collectors.toList()); + messageService.messageRead(idList); + return ActionResult.success(MsgCode.SU005.get()); + }else { + return ActionResult.fail(MsgCode.MSERR113.get()); + } + } + + /** + * app端获取未读数据 + * + * @return + */ + @Operation(summary = "app端获取未读数据") + @GetMapping("/getUnReadMsgNum") + public ActionResult getUnReadMsgNum() { + Map map = new HashMap<>(); + UserInfo userInfo = UserProvider.getUser(); + Integer unReadMsg = messageService.getUnreadCount(userInfo.getUserId(), 2); + Integer unReadSchedule = messageService.getUnreadCount(userInfo.getUserId(),4); + Integer unReadNotice = messageService.getUnreadCount(userInfo.getUserId(), 1); + Integer unReadSystemMsg = messageService.getUnreadCount(userInfo.getUserId(), 3); + Integer unReadNum = unReadMsg+unReadNotice+unReadSchedule+unReadSystemMsg; + map.put("unReadMsg",unReadMsg.toString()); + map.put("unReadNotice",unReadNotice.toString()); + map.put("unReadSchedule",unReadSchedule.toString()); + map.put("unReadSystemMsg",unReadSystemMsg.toString()); + map.put("unReadNum",unReadNum.toString()); + return ActionResult.success(map); + } + + /** + * 删除记录 + * + * @param recordForm 已读模型 + * @return + */ + @Operation(summary = "删除消息") + @Parameters({ + @Parameter(name = "recordForm", description = "已读模型", required = true) + }) + @DeleteMapping("/Record") + public ActionResult deleteRecord(@RequestBody MessageRecordForm recordForm) { + String[] id = recordForm.getIds().split(","); + List list = Arrays.asList(id); + messageService.deleteRecord(list); + return ActionResult.success(MsgCode.SU003.get()); + } +} + diff --git a/yunzhupaas-message/yunzhupaas-message-controller/src/main/java/com/yunzhupaas/message/controller/MessageMonitorController.java b/yunzhupaas-message/yunzhupaas-message-controller/src/main/java/com/yunzhupaas/message/controller/MessageMonitorController.java new file mode 100644 index 0000000..a55f5d1 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-controller/src/main/java/com/yunzhupaas/message/controller/MessageMonitorController.java @@ -0,0 +1,227 @@ +package com.yunzhupaas.message.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import com.yunzhupaas.base.controller.SuperController; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.service.DictionaryDataService; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.message.entity.MessageMonitorEntity; +import com.yunzhupaas.message.model.messagemonitor.*; +import com.yunzhupaas.message.service.MessageMonitorService; +import org.springframework.transaction.annotation.Transactional; +import com.yunzhupaas.util.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; +import org.springframework.beans.factory.annotation.Autowired; + +import jakarta.validation.Valid; +import java.io.IOException; +import java.util.*; + +/** + * 消息监控 + * + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-08-22 + */ +@Slf4j +@RestController +@Tag(name = "消息监控", description = "message") +@RequestMapping("/api/message/MessageMonitor") +public class MessageMonitorController extends SuperController { + + + @Autowired + private MessageMonitorService messageMonitorService; + @Autowired + private DictionaryDataService dictionaryDataApi; + + + /** + * 列表 + * + * @param messageMonitorPagination 消息监控分页模型 + * @return ignore + */ + @Operation(summary = "列表") + @SaCheckPermission("msgCenter.msgMonitor") + @GetMapping + public ActionResult> list(MessageMonitorPagination messageMonitorPagination) throws IOException { + List list = messageMonitorService.getList(messageMonitorPagination); + + List msgSendTypeList = dictionaryDataApi.getListByTypeDataCode("msgSendType"); + List msgSourceTypeList = dictionaryDataApi.getListByTypeDataCode("msgSourceType"); + + //处理id字段转名称,若无需转或者为空可删除 + List listVO = JsonUtil.getJsonToList(list, MessageMonitorListVO.class); + for (MessageMonitorListVO messageMonitorVO : listVO) { + //消息类型 + if (StringUtil.isNotEmpty(messageMonitorVO.getMessageType())) { + msgSendTypeList.stream().filter(t -> messageMonitorVO.getMessageType().equals(t.getEnCode())).findFirst() + .ifPresent(dataTypeEntity -> messageMonitorVO.setMessageType(dataTypeEntity.getFullName())); + } + //消息来源 + if (StringUtil.isNotEmpty(messageMonitorVO.getMessageSource())) { + msgSourceTypeList.stream().filter(t -> messageMonitorVO.getMessageSource().equals(t.getEnCode())).findFirst() + .ifPresent(dataTypeEntity -> messageMonitorVO.setMessageSource(dataTypeEntity.getFullName())); + } + //子表数据转换 + } + + PageListVO vo = new PageListVO(); + vo.setList(listVO); + PaginationVO page = JsonUtil.getJsonToBean(messageMonitorPagination, PaginationVO.class); + vo.setPagination(page); + return ActionResult.success(vo); + } + + /** + * 创建 + * + * @param messageMonitorForm 消息监控模型 + * @return ignore + */ + @Operation(summary = ("创建")) + @PostMapping + @Parameters({ + @Parameter(name = "messageMonitorForm", description = "消息监控模型", required = true) + }) + @SaCheckPermission("msgCenter.msgMonitor") + @Transactional + public ActionResult create(@RequestBody @Valid MessageMonitorForm messageMonitorForm) throws DataException { + String mainId = RandomUtil.uuId(); + UserInfo userInfo = UserProvider.getUser(); + MessageMonitorEntity entity = JsonUtil.getJsonToBean(messageMonitorForm, MessageMonitorEntity.class); + entity.setCreatorTime(DateUtil.getNowDate()); + entity.setCreatorUserId(userInfo.getUserId()); + entity.setId(mainId); + messageMonitorService.save(entity); + + return ActionResult.success(MsgCode.SU001.get()); + } + + + /** + * 批量删除 + * + * @param msgDelForm 消息删除模型 + * @return ignore + */ + @Operation(summary = ("批量删除")) + @DeleteMapping("/batchRemove") + @Parameters({ + @Parameter(name = "msgDelForm", description = "消息删除模型", required = true) + }) + @SaCheckPermission("msgCenter.msgMonitor") + @Transactional + public ActionResult batchRemove(@RequestBody MsgDelForm msgDelForm) { + boolean flag = messageMonitorService.delete(msgDelForm.getIds()); + if (flag == false) { + return ActionResult.fail(MsgCode.FA003.get()); + } + return ActionResult.success(MsgCode.SU003.get()); + } + + + /** + * 一键清空消息监控记录 + * + * @return + */ + @Operation(summary = "一键清空消息监控记录") + @SaCheckPermission("msgCenter.msgMonitor") + @DeleteMapping("/empty") + public ActionResult deleteHandelLog() { + messageMonitorService.emptyMonitor(); + return ActionResult.success(MsgCode.SU005.get()); + } + + /** + * 信息 + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "信息") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("msgCenter.msgMonitor") + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) { + MessageMonitorEntity entity = messageMonitorService.getInfo(id); + MessageMonitorInfoVO vo = JsonUtil.getJsonToBean(entity, MessageMonitorInfoVO.class); + + return ActionResult.success(vo); + } + + /** + * 表单信息(详情页) + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "表单信息(详情页)") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("msgCenter.msgMonitor") + @GetMapping("/detail/{id}") + public ActionResult detailInfo(@PathVariable("id") String id) { + MessageMonitorEntity entity = messageMonitorService.getInfo(id); + + List msgSendTypeList = dictionaryDataApi.getListByTypeDataCode("msgSendType"); + List msgSourceTypeList = dictionaryDataApi.getListByTypeDataCode("msgSourceType"); + + MessageMonitorInfoVO vo = JsonUtil.getJsonToBean(entity, MessageMonitorInfoVO.class); + if (StringUtil.isNotEmpty(vo.getMessageType())) { + msgSendTypeList.stream().filter(t -> vo.getMessageType().equals(t.getEnCode())).findFirst() + .ifPresent(dataTypeEntity -> vo.setMessageType(dataTypeEntity.getFullName())); + } + if (StringUtil.isNotEmpty(vo.getMessageSource())) { + msgSourceTypeList.stream().filter(t -> vo.getMessageSource().equals(t.getEnCode())).findFirst() + .ifPresent(dataTypeEntity -> vo.setMessageSource(dataTypeEntity.getFullName())); + } + if (!"webhook".equals(vo.getMessageType())) { + vo.setReceiveUser(messageMonitorService.userSelectValues(vo.getReceiveUser())); + } + return ActionResult.success(vo); + } + + /** + * 删除 + * + * @param id 主键 + * @return ignore + */ + @DeleteMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("msgCenter.msgMonitor") + @Transactional + public ActionResult delete(@PathVariable("id") String id) { + MessageMonitorEntity entity = messageMonitorService.getInfo(id); + if (entity != null) { + messageMonitorService.delete(entity); + + } + return ActionResult.success(MsgCode.SU003.get()); + } + + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-controller/src/main/java/com/yunzhupaas/message/controller/MessageTemplateConfigController.java b/yunzhupaas-message/yunzhupaas-message-controller/src/main/java/com/yunzhupaas/message/controller/MessageTemplateConfigController.java new file mode 100644 index 0000000..751784c --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-controller/src/main/java/com/yunzhupaas/message/controller/MessageTemplateConfigController.java @@ -0,0 +1,611 @@ +package com.yunzhupaas.message.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaMode; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import com.yunzhupaas.base.controller.SuperController; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.service.BillRuleService; +import com.yunzhupaas.base.service.DictionaryDataService; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.message.entity.MessageTemplateConfigEntity; +import com.yunzhupaas.message.entity.SmsFieldEntity; +import com.yunzhupaas.message.entity.TemplateParamEntity; +import com.yunzhupaas.message.model.messagetemplateconfig.MessageTemplateConfigForm; +import com.yunzhupaas.message.model.messagetemplateconfig.MessageTemplateConfigInfoVO; +import com.yunzhupaas.message.model.messagetemplateconfig.MessageTemplateConfigListVO; +import com.yunzhupaas.message.model.messagetemplateconfig.MessageTemplateConfigPagination; +import com.yunzhupaas.message.service.MessageTemplateConfigService; +import com.yunzhupaas.message.service.SendConfigTemplateService; +import com.yunzhupaas.message.service.SmsFieldService; +import com.yunzhupaas.message.service.TemplateParamService; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.emnus.ModuleTypeEnum; +import com.yunzhupaas.util.FileExport; +import org.springframework.http.MediaType; +import org.springframework.transaction.annotation.Transactional; + +import com.yunzhupaas.util.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.multipart.MultipartFile; + +import jakarta.validation.Valid; +import java.io.IOException; +import java.util.stream.Collectors; +import java.util.*; + +/** + * 消息模板(新) + * + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-08-18 + */ +@Slf4j +@RestController +@Tag(name = "消息模板(新)", description = "message") +@RequestMapping("/api/message/MessageTemplateConfig") +public class MessageTemplateConfigController extends SuperController { + + @Autowired + private FileExport fileExport; + + @Autowired + private BillRuleService billRuleService; + + @Autowired + private ConfigValueUtil configValueUtil; + + @Autowired + private UserService userApi; + + @Autowired + private MessageTemplateConfigService messageTemplateConfigService; + + @Autowired + private TemplateParamService templateParamService; + @Autowired + private SmsFieldService smsFieldService; + @Autowired + private DictionaryDataService dictionaryDataApi; + @Autowired + private SendConfigTemplateService sendConfigTemplateService; + + + /** + * 列表 + * + * @param messageTemplateConfigPagination 消息模板分页模型 + * @return + */ + @Operation(summary = "列表") + @SaCheckPermission(value = {"msgCenter.msgTemplate", "msgCenter.accountConfig"}, mode = SaMode.OR) + @GetMapping + public ActionResult> list(MessageTemplateConfigPagination messageTemplateConfigPagination) throws IOException { + List list = messageTemplateConfigService.getList(messageTemplateConfigPagination); + List msgSendTypeList = dictionaryDataApi.getListByTypeDataCode("msgSendType"); + List msgSourceTypeList = dictionaryDataApi.getListByTypeDataCode("msgSourceType"); + //处理id字段转名称,若无需转或者为空可删除 + UserEntity userEntity = new UserEntity(); + List listVO = JsonUtil.getJsonToList(list, MessageTemplateConfigListVO.class); + for (MessageTemplateConfigListVO messageTemplateNewVO : listVO) { + //消息类型 + if(StringUtil.isNotEmpty(messageTemplateNewVO.getMessageType())){ + msgSendTypeList.stream().filter(t -> messageTemplateNewVO.getMessageType().equals(t.getEnCode())).findFirst() + .ifPresent(dataTypeEntity -> messageTemplateNewVO.setMessageType(dataTypeEntity.getFullName())); + } + //创建人员 + if(StringUtil.isNotBlank(messageTemplateNewVO.getCreatorUserId()) && !"null".equals(messageTemplateNewVO.getCreatorUserId())){ + userEntity = userApi.getInfo(messageTemplateNewVO.getCreatorUserId()); + if(userEntity != null){ + messageTemplateNewVO.setCreatorUser(userEntity.getRealName() +"/"+ userEntity.getAccount()); + } + } + //消息来源 + if(StringUtil.isNotEmpty(messageTemplateNewVO.getMessageSource())) { + msgSourceTypeList.stream().filter(t -> messageTemplateNewVO.getMessageSource().equals(t.getEnCode())).findFirst() + .ifPresent(dataTypeEntity -> messageTemplateNewVO.setMessageSource(dataTypeEntity.getFullName())); + } + } + + PageListVO vo = new PageListVO(); + vo.setList(listVO); + PaginationVO page = JsonUtil.getJsonToBean(messageTemplateConfigPagination, PaginationVO.class); + vo.setPagination(page); + return ActionResult.success(vo); + } + + + /** + * 创建 + * + * @param messageTemplateConfigForm 消息模板页模型 + * @return ignore + */ + @Operation(summary = "创建") + @Parameters({ + @Parameter(name = "messageTemplateConfigForm", description = "消息模板页模型", required = true) + }) + @SaCheckPermission("msgCenter.msgTemplate") + @PostMapping + @Transactional + public ActionResult create(@RequestBody @Valid MessageTemplateConfigForm messageTemplateConfigForm) throws DataException { + boolean b = messageTemplateConfigService.checkForm(messageTemplateConfigForm, 0,""); + if (b) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + if(!"1".equals(messageTemplateConfigForm.getTemplateType())){ + if(messageTemplateConfigForm.getEnCode().contains("MBXT")){ + return ActionResult.fail(MsgCode.MSERR114.get()); + } + } + if (messageTemplateConfigForm.getSmsFieldList() != null && "7".equals(messageTemplateConfigForm.getMessageType())) { + List SmsFieldList = JsonUtil.getJsonToList(messageTemplateConfigForm.getSmsFieldList(), SmsFieldEntity.class); + List list = SmsFieldList.stream().filter(t->StringUtil.isNotEmpty(String.valueOf(t.getIsTitle())) &&!"null".equals(String.valueOf(t.getIsTitle())) && t.getIsTitle()==1).collect(Collectors.toList()); + if (list != null) { + if(list.size() > 1) { + return ActionResult.fail(MsgCode.MSERR115.get()); + } + }else { + return ActionResult.fail(MsgCode.MSERR116.get()); + } + } + String mainId = RandomUtil.uuId(); + UserInfo userInfo = UserProvider.getUser(); + MessageTemplateConfigEntity entity = JsonUtil.getJsonToBean(messageTemplateConfigForm, MessageTemplateConfigEntity.class); + entity.setCreatorTime(DateUtil.getNowDate()); + entity.setCreatorUserId(userInfo.getUserId()); + entity.setId(mainId); + if("1".equals(entity.getMessageType()) && "2".equals(entity.getMessageSource())){ + entity.setContent(null); + } + messageTemplateConfigService.save(entity); + if (messageTemplateConfigForm.getTemplateParamList() != null) { + List TemplateParamList = JsonUtil.getJsonToList(messageTemplateConfigForm.getTemplateParamList(), TemplateParamEntity.class); + for (TemplateParamEntity entitys : TemplateParamList) { + entitys.setId(RandomUtil.uuId()); + entitys.setTemplateId(entity.getId()); + templateParamService.save(entitys); + } + } + if (messageTemplateConfigForm.getSmsFieldList() != null) { + List SmsFieldList = JsonUtil.getJsonToList(messageTemplateConfigForm.getSmsFieldList(), SmsFieldEntity.class); + for (SmsFieldEntity entitys : SmsFieldList) { + entitys.setId(RandomUtil.uuId()); + entitys.setTemplateId(entity.getId()); + smsFieldService.save(entitys); + } + } + + return ActionResult.success(MsgCode.SU001.get()); + } + + + /** + * 信息 + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "信息") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission(value = {"msgCenter.msgTemplate", "msgCenter.accountConfig"}, mode = SaMode.OR) + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) { + MessageTemplateConfigEntity entity = messageTemplateConfigService.getInfo(id); + MessageTemplateConfigInfoVO vo = JsonUtil.getJsonToBean(entity, MessageTemplateConfigInfoVO.class); + //子表 + List BaseTemplateParamList = messageTemplateConfigService.getTemplateParamList(id); +// for (TemplateParamEntity basetemplateparamEntity : BaseTemplateParamList) { +// } + vo.setTemplateParamList(BaseTemplateParamList); + List BaseSmsFieldList = messageTemplateConfigService.getSmsFieldList(id); +// for (SmsFieldEntity basesmsfieldEntity : BaseSmsFieldList) { +// } + vo.setSmsFieldList(BaseSmsFieldList); + //副表 + return ActionResult.success(vo); + } + + /** + * 表单信息(详情页) + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "表单信息(详情页)") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("msgCenter.msgTemplate") + @GetMapping("/detail/{id}") + public ActionResult detailInfo(@PathVariable("id") String id) { + MessageTemplateConfigEntity entity = messageTemplateConfigService.getInfo(id); + UserEntity userEntity = new UserEntity(); + MessageTemplateConfigInfoVO vo = JsonUtil.getJsonToBean(entity, MessageTemplateConfigInfoVO.class); + + //子表数据转换 + List BaseTemplateParamList = messageTemplateConfigService.getTemplateParamList(id); +// for (TemplateParamEntity basetemplateparamEntity : BaseTemplateParamList) { +// } + vo.setTemplateParamList(BaseTemplateParamList); + List BaseSmsFieldList = messageTemplateConfigService.getSmsFieldList(id); +// for (SmsFieldEntity basesmsfieldEntity : BaseSmsFieldList) { +// } + vo.setSmsFieldList(BaseSmsFieldList); + + return ActionResult.success(vo); + } + + + /** + * 更新 + * + * @param id 主键 + * @param messageTemplateConfigForm 消息模板页模型 + * @return + */ + @Operation(summary = "更新") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "messageTemplateConfigForm", description = "消息模板页模型", required = true) + }) + @SaCheckPermission("msgCenter.msgTemplate") + @PutMapping("/{id}") + @Transactional + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid MessageTemplateConfigForm messageTemplateConfigForm) throws DataException { + + boolean b = messageTemplateConfigService.checkForm(messageTemplateConfigForm, 0, messageTemplateConfigForm.getId()); + if (b) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + if(!"1".equals(messageTemplateConfigForm.getTemplateType())){ + if(messageTemplateConfigForm.getEnCode().contains("MBXT")){ + return ActionResult.fail(MsgCode.MSERR114.get()); + } + } + //判断配置是否被引用 + if("0".equals(String.valueOf(messageTemplateConfigForm.getEnabledMark()))){ + if(sendConfigTemplateService.isUsedTemplate(messageTemplateConfigForm.getId())) { + return ActionResult.fail(MsgCode.FA049.get()); + } + } + if (messageTemplateConfigForm.getSmsFieldList() != null && "7".equals(messageTemplateConfigForm.getMessageType())) { + List SmsFieldList = JsonUtil.getJsonToList(messageTemplateConfigForm.getSmsFieldList(), SmsFieldEntity.class); + List list = SmsFieldList.stream().filter(t->StringUtil.isNotEmpty(String.valueOf(t.getIsTitle())) &&!"null".equals(String.valueOf(t.getIsTitle())) && t.getIsTitle()==1).collect(Collectors.toList()); + if (list != null) { + if(list.size() > 1) { + return ActionResult.fail(MsgCode.MSERR117.get()); + } + }else { + return ActionResult.fail(MsgCode.MSERR118.get()); + } + } + UserInfo userInfo = UserProvider.getUser(); + MessageTemplateConfigEntity entity = messageTemplateConfigService.getInfo(id); + if (entity != null) { + MessageTemplateConfigEntity subentity = JsonUtil.getJsonToBean(messageTemplateConfigForm, MessageTemplateConfigEntity.class); + subentity.setCreatorTime(entity.getCreatorTime()); + subentity.setCreatorUserId(entity.getCreatorUserId()); + subentity.setLastModifyTime(DateUtil.getNowDate()); + subentity.setLastModifyUserId(userInfo.getUserId()); + if("1".equals(subentity.getMessageType()) && "2".equals(subentity.getMessageSource())){ + subentity.setContent(null); + } + boolean b1 = messageTemplateConfigService.updateById(subentity); + if (!b1) { + return ActionResult.fail(MsgCode.VS405.get()); + } + + //明细表数据更新 + List addParamList = new ArrayList<>(); + List updParamList = new ArrayList<>(); + List delParamList = new ArrayList<>(); + if (messageTemplateConfigForm.getTemplateParamList() != null) { + List templateParamList = JsonUtil.getJsonToList(messageTemplateConfigForm.getTemplateParamList(), TemplateParamEntity.class); + for (TemplateParamEntity entitys : templateParamList) { + if (StringUtil.isNotBlank(entitys.getId()) && !"null".equals(entitys.getId())) { + TemplateParamEntity paramEntity = templateParamService.getInfo(entitys.getId()); + if (paramEntity != null) { + paramEntity.setId(entitys.getId()); + paramEntity.setTemplateId(entitys.getTemplateId()); + paramEntity.setField(entitys.getField()); + paramEntity.setFieldName(entitys.getFieldName()); + paramEntity.setCreatorUserId(entity.getCreatorUserId()); + paramEntity.setCreatorTime(entitys.getCreatorTime()); + paramEntity.setLastModifyUserId(userInfo.getUserId()); + paramEntity.setLastModifyTime(DateUtil.getNowDate()); + updParamList.add(paramEntity); + } + } else { + entitys.setId(RandomUtil.uuId()); + entitys.setTemplateId(entity.getId()); + entitys.setCreatorUserId(userInfo.getUserId()); + entitys.setCreatorTime(DateUtil.getNowDate()); + addParamList.add(entitys); + } + } + + //删除参数记录 + List paramEntityList = templateParamService.getDetailListByParentId(entity.getId()); + if (paramEntityList != null) { + for (TemplateParamEntity paramEntity : paramEntityList) { + TemplateParamEntity paramEntity1 = templateParamList.stream().filter(t -> t.getId().equals(paramEntity.getId())).findFirst().orElse(null); + if (paramEntity1 == null) { + delParamList.add(paramEntity); + } + } + } + if (addParamList != null && addParamList.size() > 0) { + templateParamService.saveBatch(addParamList); + } + if (updParamList != null && updParamList.size() > 0) { + templateParamService.updateBatchById(updParamList); + } + if (delParamList != null && delParamList.size() > 0) { + templateParamService.removeByIds(delParamList.stream().map(TemplateParamEntity::getId).collect(Collectors.toList())); + } + } + + //短信参数明细表数据更新 + List addSmsList = new ArrayList<>(); + List updSmsList = new ArrayList<>(); + List delSmsList = new ArrayList<>(); + if (messageTemplateConfigForm.getSmsFieldList() != null) { + List smsFieldList = JsonUtil.getJsonToList(messageTemplateConfigForm.getSmsFieldList(), SmsFieldEntity.class); + for (SmsFieldEntity entitys : smsFieldList) { + if (StringUtil.isNotBlank(entitys.getId()) && !"null".equals(entitys.getId())) { + SmsFieldEntity smsFieldEntity = smsFieldService.getInfo(entitys.getId()); + if (smsFieldEntity != null) { + smsFieldEntity.setId(entitys.getId()); + smsFieldEntity.setTemplateId(entity.getId()); + smsFieldEntity.setFieldId(entitys.getFieldId()); + smsFieldEntity.setField(entitys.getField()); + smsFieldEntity.setSmsField(entitys.getSmsField()); + smsFieldEntity.setCreatorTime(entitys.getCreatorTime()); + smsFieldEntity.setCreatorUserId(entitys.getCreatorUserId()); + smsFieldEntity.setLastModifyTime(DateUtil.getNowDate()); + smsFieldEntity.setLastModifyUserId(userInfo.getUserId()); + smsFieldEntity.setIsTitle(entitys.getIsTitle()); + updSmsList.add(smsFieldEntity); + } + } else { + entitys.setId(RandomUtil.uuId()); + entitys.setTemplateId(entity.getId()); + entitys.setCreatorTime(DateUtil.getNowDate()); + entitys.setCreatorUserId(userInfo.getUserId()); + addSmsList.add(entitys); + } + } + //删除短信参数明细表 + List smsFieldEntityList = smsFieldService.getDetailListByParentId(entity.getId()); + if (smsFieldEntityList != null && smsFieldEntityList.size() > 0) { + for (SmsFieldEntity smsFieldEntity : smsFieldEntityList) { + SmsFieldEntity smsFieldEntity1 = smsFieldList.stream().filter(t -> t.getId().equals(smsFieldEntity.getId())).findFirst().orElse(null); + if (smsFieldEntity1 == null) { + delSmsList.add(smsFieldEntity); + } + } + } + if (addSmsList != null && addSmsList.size() > 0) { + smsFieldService.saveBatch(addSmsList); + } + if (updSmsList != null && updSmsList.size() > 0) { + smsFieldService.updateBatchById(updSmsList); + } + if (delSmsList != null && delSmsList.size() > 0) { + smsFieldService.removeByIds(delSmsList.stream().map(SmsFieldEntity::getId).collect(Collectors.toList())); + } + } + return ActionResult.success(MsgCode.SU004.get()); + } else { + return ActionResult.fail(MsgCode.FA002.get()); + } + } + + + /** + * 删除 + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "删除") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("msgCenter.msgTemplate") + @DeleteMapping("/{id}") + @Transactional + public ActionResult delete(@PathVariable("id") String id) { + MessageTemplateConfigEntity entity = messageTemplateConfigService.getInfo(id); + if (entity != null) { + if(sendConfigTemplateService.isUsedTemplate(entity.getId())) { + return ActionResult.fail(MsgCode.FA050.get()); + } + messageTemplateConfigService.delete(entity); + QueryWrapper queryWrapperTemplateParam = new QueryWrapper<>(); + queryWrapperTemplateParam.lambda().eq(TemplateParamEntity::getTemplateId, entity.getId()); + templateParamService.remove(queryWrapperTemplateParam); + QueryWrapper queryWrapperSmsField = new QueryWrapper<>(); + queryWrapperSmsField.lambda().eq(SmsFieldEntity::getTemplateId, entity.getId()); + smsFieldService.remove(queryWrapperSmsField); + + } + return ActionResult.success(MsgCode.SU003.get()); + } + + /** + * 开启或禁用 + * + * @param id + * @return + */ + @Operation(summary = "开启或禁用") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("msgCenter.msgTemplate") + @PostMapping("/unable/{id}") + @Transactional + public ActionResult unable(@PathVariable("id") String id) { + MessageTemplateConfigEntity entity = messageTemplateConfigService.getInfo(id); + if (entity != null) { + if("1".equals(String.valueOf(entity.getEnabledMark()))){ + entity.setEnabledMark(0); + return ActionResult.success(MsgCode.WF027.get()); + }else { + //判断是否被引用 + + entity.setEnabledMark(1); + return ActionResult.success(MsgCode.WF026.get()); + } + }else { + return ActionResult.fail(MsgCode.FA007.get()); + } + } + + /** + * 复制 + * + * @param id + * @return + */ + @Operation(summary = "复制") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("msgCenter.msgTemplate") + @PostMapping("/{id}/Actions/Copy") + @Transactional + public ActionResult copy(@PathVariable("id") String id) { + UserInfo userInfo = UserProvider.getUser(); + MessageTemplateConfigEntity entity = messageTemplateConfigService.getInfo(id); + if (entity != null) { + entity.setEnabledMark(0); + String copyNum = UUID.randomUUID().toString().substring(0, 5); + entity.setFullName(entity.getFullName()+".副本"+copyNum); + entity.setEnCode(entity.getEnCode()+copyNum); + entity.setCreatorTime(DateUtil.getNowDate()); + entity.setCreatorUserId(userInfo.getUserId()); + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + entity.setTemplateType("0"); + entity.setId(RandomUtil.uuId()); + MessageTemplateConfigEntity copyEntity = JsonUtil.getJsonToBean(entity, MessageTemplateConfigEntity.class); + if(copyEntity.getEnCode().length()>50 || copyEntity.getFullName().length()>50){ + return ActionResult.fail(MsgCode.PRI006.get()); + } + messageTemplateConfigService.create(copyEntity); + List copyParamList = new ArrayList<>(); + List baseParamList = templateParamService.getDetailListByParentId(id); + if(baseParamList != null && baseParamList.size()>0){ + for(TemplateParamEntity entitys : baseParamList){ + entitys.setId(RandomUtil.uuId()); + entitys.setTemplateId(copyEntity.getId()); + entitys.setCreatorTime(DateUtil.getNowDate()); + entitys.setCreatorUserId(userInfo.getUserId()); + entitys.setLastModifyTime(null); + entitys.setLastModifyUserId(null); + copyParamList.add(entitys); + } + } + if(copyParamList != null && copyParamList.size()>0) { + templateParamService.saveBatch(copyParamList); + } + List copySmsList = new ArrayList<>(); + List baseSmsFieldList = smsFieldService.getDetailListByParentId(id); + if(baseSmsFieldList != null && baseSmsFieldList.size()>0){ + for(SmsFieldEntity entitys : baseSmsFieldList){ + entitys.setId(RandomUtil.uuId()); + entitys.setTemplateId(copyEntity.getId()); + entitys.setCreatorTime(DateUtil.getNowDate()); + entitys.setCreatorUserId(userInfo.getUserId()); + entitys.setLastModifyTime(null); + entitys.setLastModifyUserId(null); + copySmsList.add(entitys); + } + } + if(copySmsList != null && copySmsList.size()>0){ + smsFieldService.saveBatch(copySmsList); + } + return ActionResult.success(MsgCode.SU007.get()); + }else { + return ActionResult.fail(MsgCode.FA004.get()); + } + } + + /** + * 导出消息模板 + * + * @param id 消息模板id + * @return ignore + */ + @Operation(summary = "导出") + @GetMapping("/{id}/Action/Export") + public ActionResult export(@PathVariable String id) { + MessageTemplateConfigEntity entity = messageTemplateConfigService.getInfo(id); + MessageTemplateConfigInfoVO vo = JsonUtil.getJsonToBean(entity, MessageTemplateConfigInfoVO.class); + //子表 + List BaseTemplateParamList = messageTemplateConfigService.getTemplateParamList(id); + vo.setTemplateParamList(BaseTemplateParamList); + List BaseSmsFieldList = messageTemplateConfigService.getSmsFieldList(id); + vo.setSmsFieldList(BaseSmsFieldList); + //导出文件 + DownloadVO downloadVO = fileExport.exportFile(vo, configValueUtil.getTemporaryFilePath(), entity.getFullName(), ModuleTypeEnum.MESSAGE_TEMPLATE.getTableName()); + return ActionResult.success(downloadVO); + } + + /** + * 导入消息模板 + * + * @param multipartFile 备份json文件 + * @return 执行结果标识 + */ + @Operation(summary = "导入") + @PostMapping(value = "/Action/Import", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ActionResult importData(@RequestPart("file") MultipartFile multipartFile) throws DataException { + UserInfo userInfo = UserProvider.getUser(); + //判断是否为.json结尾 + if (FileUtil.existsSuffix(multipartFile, ModuleTypeEnum.MESSAGE_TEMPLATE.getTableName())) { + return ActionResult.fail(MsgCode.IMP002.get()); + } + //获取文件内容 + String fileContent = FileUtil.getFileContent(multipartFile); + MessageTemplateConfigInfoVO infoVO = JsonUtil.getJsonToBean(fileContent, MessageTemplateConfigInfoVO.class); + MessageTemplateConfigEntity entity = JsonUtil.getJsonToBean(infoVO, MessageTemplateConfigEntity.class); + entity.setCreatorUserId(userInfo.getUserId()); + entity.setCreatorTime(DateUtil.getNowDate()); + //子表数据导入 + if (infoVO.getTemplateParamList() != null && infoVO.getTemplateParamList().size()>0) { + List templateParamList = JsonUtil.getJsonToList(infoVO.getTemplateParamList(), TemplateParamEntity.class); + templateParamService.saveBatch(templateParamList); + } + if(infoVO.getSmsFieldList() != null && infoVO.getSmsFieldList().size()>0){ + List smsFieldList = JsonUtil.getJsonToList(infoVO.getSmsFieldList(), SmsFieldEntity.class); + smsFieldService.saveBatch(smsFieldList); + } + return messageTemplateConfigService.ImportData(entity); + } + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-controller/src/main/java/com/yunzhupaas/message/controller/SendMessageConfigController.java b/yunzhupaas-message/yunzhupaas-message-controller/src/main/java/com/yunzhupaas/message/controller/SendMessageConfigController.java new file mode 100644 index 0000000..d98eff8 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-controller/src/main/java/com/yunzhupaas/message/controller/SendMessageConfigController.java @@ -0,0 +1,779 @@ +package com.yunzhupaas.message.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import com.yunzhupaas.base.controller.SuperController; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.entity.SysConfigEntity; +import com.yunzhupaas.base.service.BillRuleService; +import com.yunzhupaas.base.service.DictionaryDataService; +import com.yunzhupaas.base.service.SysconfigService; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.message.entity.*; +import com.yunzhupaas.message.model.message.DingTalkModel; +import com.yunzhupaas.message.model.messagetemplateconfig.TemplateParamModel; +import com.yunzhupaas.message.model.sendmessageconfig.*; +import com.yunzhupaas.message.service.*; +import com.yunzhupaas.base.util.TestSendConfigUtil; +import com.yunzhupaas.model.BaseSystemInfo; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.emnus.ModuleTypeEnum; +import com.yunzhupaas.util.FileExport; +import org.springframework.http.MediaType; +import org.springframework.transaction.annotation.Transactional; +import com.yunzhupaas.util.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.multipart.MultipartFile; + +import jakarta.validation.Valid; +import java.io.IOException; + + +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.util.stream.Collectors; +import java.util.*; + +/** + * 消息发送配置 + * + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-08-19 + */ +@Slf4j +@RestController +@Tag(name = "消息发送配置", description = "message") +@RequestMapping("/api/message/SendMessageConfig") +public class SendMessageConfigController extends SuperController { + @Autowired + private FileExport fileExport; + + @Autowired + private BillRuleService billRuleService; + + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private UserService userApi; + + + + @Autowired + private SysconfigService sysconfigService; + @Autowired + private SendMessageConfigService sendMessageConfigService; + + @Autowired + private SendConfigTemplateService sendConfigTemplateService; + + @Autowired + private AccountConfigService accountConfigService; + + @Autowired + private MessageTemplateConfigService messageTemplateConfigService; + @Autowired + private DictionaryDataService dictionaryDataApi; + + @Autowired + private TestSendConfigUtil testSendConfigUtil; + + /** + * 列表 + * + * @param sendMessageConfigPagination 分页模型 + * @return + */ + @Operation(summary = "消息发送配置列表") + @SaCheckPermission("msgCenter.sendConfig") + @GetMapping + public ActionResult> list(SendMessageConfigPagination sendMessageConfigPagination) throws IOException { + List list = sendMessageConfigService.getList(sendMessageConfigPagination, null); + List msgSendTypeList = dictionaryDataApi.getListByTypeDataCode("msgSendType"); + List msgSourceTypeList = dictionaryDataApi.getListByTypeDataCode("msgSourceType"); + //处理id字段转名称,若无需转或者为空可删除 + UserEntity userEntity = new UserEntity(); + List listVO = JsonUtil.getJsonToList(list, SendMessageConfigListVO.class); + for (SendMessageConfigListVO sendMessageConfigVO : listVO) { + List> mapList = new ArrayList<>(); + //子表数据转换 + List sendConfigTemplateList = sendConfigTemplateService.getDetailListByParentId(sendMessageConfigVO.getId()); + if (sendConfigTemplateList != null && sendConfigTemplateList.size()>0) { + sendConfigTemplateList = sendConfigTemplateList.stream().sorted((a,b)->a.getMessageType().compareTo(b.getMessageType())).collect(Collectors.toList()); + List typeList = sendConfigTemplateList.stream().map(t -> t.getMessageType()).distinct().collect(Collectors.toList()); + if (typeList != null && typeList.size()>0) { + for(String type : typeList) { + String messageType = ""; + Map map = new HashMap<>(); + DictionaryDataEntity dataTypeEntity = msgSendTypeList.stream().filter(t -> t.getEnCode().equals(type)).findFirst().orElse(null); + if (dataTypeEntity != null) { + messageType = dataTypeEntity.getFullName(); + map.put("fullName",messageType); + map.put("type",type); + mapList.add(map); + } + } + sendMessageConfigVO.setMessageType(mapList); + } + } + if(StringUtil.isNotEmpty(sendMessageConfigVO.getCreatorUserId())){ + userEntity = userApi.getInfo(sendMessageConfigVO.getCreatorUserId()); + if(userEntity != null){ + sendMessageConfigVO.setCreatorUser(userEntity.getRealName() +"/"+ userEntity.getAccount()); + } + } + //消息来源 + if(StringUtil.isNotBlank(sendMessageConfigVO.getMessageSource())) { + msgSourceTypeList.stream().filter(t -> sendMessageConfigVO.getMessageSource().equals(t.getEnCode())).findFirst() + .ifPresent(dataTypeEntity -> sendMessageConfigVO.setMessageSource(dataTypeEntity.getFullName())); + } + } + + PageListVO vo = new PageListVO(); + vo.setList(listVO); + PaginationVO page = JsonUtil.getJsonToBean(sendMessageConfigPagination, PaginationVO.class); + vo.setPagination(page); + return ActionResult.success(vo); + } + + /** + * 获取发送配置下拉框 + * + * @return + */ + @Operation(summary = "获取发送配置下拉框") + @GetMapping("/Selector") + public ActionResult> selector(SendMessageConfigPagination sendMessageConfigPagination) { + List list = sendMessageConfigService.getSelectorList(sendMessageConfigPagination); + List listVO = JsonUtil.getJsonToList(list, SendMessageConfigListVO.class); + PageListVO vo = new PageListVO(); + vo.setList(listVO); + PaginationVO page = JsonUtil.getJsonToBean(sendMessageConfigPagination, PaginationVO.class); + vo.setPagination(page); + return ActionResult.success(vo); + } + + /** + * 消息发送配置弹窗列表 + * + * @param sendMessageConfigPagination 分页模型 + * @return + */ + @Operation(summary = "消息发送配置弹窗列表") + @GetMapping("/getSendConfigList") + public ActionResult> getSendConfigList(SendMessageConfigPagination sendMessageConfigPagination) throws IOException { + if(StringUtil.isBlank(sendMessageConfigPagination.getEnabledMark())) { + sendMessageConfigPagination.setEnabledMark("1"); + } + if(StringUtil.isBlank(sendMessageConfigPagination.getTemplateType())){ + sendMessageConfigPagination.setTemplateType("0"); + } + List list = sendMessageConfigService.getList(sendMessageConfigPagination, null); + //处理id字段转名称,若无需转或者为空可删除 + List msgSendTypeList = dictionaryDataApi.getListByTypeDataCode("msgSendType"); + List listVO = JsonUtil.getJsonToList(list, SendConfigListVO.class); + for (SendConfigListVO sendConfigVO : listVO) { + //子表数据转换 + List sendConfigTemplateList = sendConfigTemplateService.getDetailListByParentId(sendConfigVO.getId()); + sendConfigTemplateList = sendConfigTemplateList.stream().filter(t->"1".equals(String.valueOf(t.getEnabledMark()))).collect(Collectors.toList()); + List modelList = JsonUtil.getJsonToList(sendConfigTemplateList, SendConfigTemplateModel.class); + for(SendConfigTemplateModel model:modelList) { + if (modelList != null && modelList.size() > 0) { + List list1 = messageTemplateConfigService.getParamJson(model.getTemplateId()); +// if (list != null && list.size() > 0) { +// model.setParamJson(JsonUtil.getObjectToString(list1)); +// } + List jsonModels = new ArrayList<>(); + for(TemplateParamModel paramModel : list1){ + MsgTemplateJsonModel jsonModel = new MsgTemplateJsonModel(); + jsonModel.setField(paramModel.getField()); + jsonModel.setFieldName(paramModel.getFieldName()); + jsonModel.setMsgTemplateId(model.getId()); + jsonModels.add(jsonModel); + } + model.setParamJson(jsonModels); + MessageTemplateConfigEntity msgTemEntity = messageTemplateConfigService.getInfo(model.getTemplateId()); + if (msgTemEntity != null) { + model.setMsgTemplateName(msgTemEntity.getFullName()); + } + if (StringUtil.isNotEmpty(model.getMessageType())) { + msgSendTypeList.stream().filter(t -> model.getMessageType().equals(t.getEnCode())).findFirst() + .ifPresent(dataTypeEntity -> model.setMessageType(dataTypeEntity.getFullName())); + } + } + sendConfigVO.setTemplateJson(modelList); + } + } + + PageListVO vo = new PageListVO(); + vo.setList(listVO); + PaginationVO page = JsonUtil.getJsonToBean(sendMessageConfigPagination, PaginationVO.class); + vo.setPagination(page); + return ActionResult.success(vo); + } + + /** + * 创建 + * + * @param sendMessageConfigForm 发送消息配置模型 + * @return + */ + @Operation(summary = "创建") + @Parameters({ + @Parameter(name = "sendMessageConfigForm", description = "发送消息配置模型", required = true) + }) + @SaCheckPermission("msgCenter.sendConfig") + @PostMapping + @Transactional + public ActionResult create(@RequestBody @Valid SendMessageConfigForm sendMessageConfigForm) throws DataException { + boolean b = sendMessageConfigService.checkForm(sendMessageConfigForm, 0,""); + if (b) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + if(!"1".equals(sendMessageConfigForm.getTemplateType())){ + if(sendMessageConfigForm.getEnCode().contains("PZXT")){ + return ActionResult.fail(MsgCode.MSERR114.get()); + } + } + String mainId = RandomUtil.uuId(); + UserInfo userInfo = UserProvider.getUser(); + SendMessageConfigEntity entity = JsonUtil.getJsonToBean(sendMessageConfigForm, SendMessageConfigEntity.class); + entity.setCreatorUserId(userInfo.getUserId()); + entity.setCreatorTime(DateUtil.getNowDate()); + entity.setId(mainId); + + if (sendMessageConfigForm.getSendConfigTemplateList() != null) { + List SendConfigTemplateList = JsonUtil.getJsonToList(sendMessageConfigForm.getSendConfigTemplateList(), SendConfigTemplateEntity.class); + long dd = SendConfigTemplateList.stream().filter(t->t.getMessageType().equals("4")).count(); + long qy = SendConfigTemplateList.stream().filter(t->t.getMessageType().equals("5")).count(); + boolean isQy = true; + boolean isDd = true; + Map objModel = getSysConfig(); + if(qy > 0){ + BaseSystemInfo baseSystemInfo = JsonUtil.getJsonToBean(objModel, BaseSystemInfo.class); + // 企业号id + String corpId = baseSystemInfo.getQyhCorpId(); + // 应用凭证 + String agentId = baseSystemInfo.getQyhAgentId(); + // 凭证密钥 + String agentSecret = baseSystemInfo.getQyhAgentSecret(); + // 同步密钥 + String corpSecret = baseSystemInfo.getQyhCorpSecret(); + if(StringUtil.isNotEmpty(corpId) && StringUtil.isNotEmpty(agentId) && StringUtil.isNotEmpty(corpSecret) && StringUtil.isNotEmpty(agentSecret)){ + isQy = true; + }else { + isQy = false; + } + } + if(dd > 0){ + DingTalkModel dingTalkModel = JsonUtil.getJsonToBean(objModel, DingTalkModel.class); + // 钉钉企业号Id + String dingAgentId = dingTalkModel.getDingAgentId(); + // 应用凭证 + String dingSynAppKey = dingTalkModel.getDingSynAppKey(); + // 凭证密钥 + String dingSynAppSecret = dingTalkModel.getDingSynAppSecret(); + if(StringUtil.isNotEmpty(dingSynAppKey) && StringUtil.isNotEmpty(dingSynAppSecret) && StringUtil.isNotEmpty(dingAgentId)){ + isDd = true; + }else { + isDd = false; + } + } + if(!isQy){ + return ActionResult.fail(MsgCode.MSERR120.get()); + } + if(!isDd){ + return ActionResult.fail(MsgCode.MSERR119.get()); + } + for (SendConfigTemplateEntity entitys : SendConfigTemplateList) { + entitys.setId(RandomUtil.uuId()); + entitys.setSendConfigId(entity.getId()); + sendConfigTemplateService.save(entitys); + } + } + sendMessageConfigService.save(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + + /** + * 信息 + * + * @param id 主键 + * @return + */ + @Operation(summary = "信息") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) { + SendMessageConfigEntity entity = sendMessageConfigService.getInfo(id); + SendMessageConfigInfoVO vo = JsonUtil.getJsonToBean(entity, SendMessageConfigInfoVO.class); + List msgSourceTypeList = dictionaryDataApi.getListByTypeDataCode("msgSourceType"); + if (StringUtil.isNotEmpty(vo.getMessageSource())) { + msgSourceTypeList.stream().filter(t -> vo.getMessageSource().equals(t.getEnCode())).findFirst() + .ifPresent(dataTypeEntity -> vo.setMessageSourceName(dataTypeEntity.getFullName())); + } + //子表 + List sendConfigTemplateList = sendMessageConfigService.getSendConfigTemplateList(id); + for (SendConfigTemplateEntity sendconfigtemplateEntity : sendConfigTemplateList) { + AccountConfigEntity accountConfigEntity = accountConfigService.getInfo(sendconfigtemplateEntity.getAccountConfigId()); + if(accountConfigEntity != null){ + sendconfigtemplateEntity.setAccountCode(accountConfigEntity.getEnCode()); + sendconfigtemplateEntity.setAccountName(accountConfigEntity.getFullName()); + } + MessageTemplateConfigEntity messageTemplateConfigEntity = messageTemplateConfigService.getInfo(sendconfigtemplateEntity.getTemplateId()); + if(messageTemplateConfigEntity != null){ + sendconfigtemplateEntity.setTemplateCode(messageTemplateConfigEntity.getEnCode()); + sendconfigtemplateEntity.setTemplateName(messageTemplateConfigEntity.getFullName()); + } + } + vo.setSendConfigTemplateList(sendConfigTemplateList); + //副表 + return ActionResult.success(vo); + } + + /** + * 根据编码获取信息 + * + * @param enCode 编码 + * @return + */ + @Operation(summary = "根据编码获取信息") + @Parameters({ + @Parameter(name = "enCode", description = "编码", required = true) + }) + @SaCheckPermission("msgCenter.sendConfig") + @GetMapping("/getInfoByEnCode/{enCode}") + public ActionResult getInfo(@PathVariable("enCode") String enCode) { + SendMessageConfigEntity entity = sendMessageConfigService.getInfoByEnCode(enCode); + SendMessageConfigInfoVO vo = JsonUtil.getJsonToBean(entity, SendMessageConfigInfoVO.class); + //子表 + List sendConfigTemplateList = sendMessageConfigService.getSendConfigTemplateList(entity.getId()); + for (SendConfigTemplateEntity sendconfigtemplateEntity : sendConfigTemplateList) { + AccountConfigEntity accountConfigEntity = accountConfigService.getInfo(sendconfigtemplateEntity.getAccountConfigId()); + if(accountConfigEntity != null){ + sendconfigtemplateEntity.setAccountCode(accountConfigEntity.getEnCode()); + sendconfigtemplateEntity.setAccountName(accountConfigEntity.getFullName()); + } + MessageTemplateConfigEntity messageTemplateConfigEntity = messageTemplateConfigService.getInfo(sendconfigtemplateEntity.getTemplateId()); + if(messageTemplateConfigEntity != null){ + sendconfigtemplateEntity.setTemplateCode(messageTemplateConfigEntity.getEnCode()); + sendconfigtemplateEntity.setTemplateName(messageTemplateConfigEntity.getFullName()); + } + } + vo.setSendConfigTemplateList(sendConfigTemplateList); + //副表 + return ActionResult.success(vo); + } + + /** + * 表单信息(详情页) + * + * @param id 主键 + * @return + */ + @Operation(summary = "表单信息(详情页)") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("msgCenter.sendConfig") + @GetMapping("/detail/{id}") + public ActionResult detailInfo(@PathVariable("id") String id) { + SendMessageConfigEntity entity = sendMessageConfigService.getInfo(id); + SendMessageConfigInfoVO vo = JsonUtil.getJsonToBean(entity, SendMessageConfigInfoVO.class); + + //子表数据转换 + List sendConfigTemplateList = sendMessageConfigService.getSendConfigTemplateList(id); + for(SendConfigTemplateEntity sendconfigtemplateEntity : sendConfigTemplateList){ + AccountConfigEntity accountConfigEntity = accountConfigService.getInfo(sendconfigtemplateEntity.getAccountConfigId()); + if(accountConfigEntity != null){ + sendconfigtemplateEntity.setAccountCode(accountConfigEntity.getEnCode()); + sendconfigtemplateEntity.setAccountName(accountConfigEntity.getFullName()); + } + MessageTemplateConfigEntity messageTemplateConfigEntity = messageTemplateConfigService.getInfo(sendconfigtemplateEntity.getTemplateId()); + if(messageTemplateConfigEntity != null){ + sendconfigtemplateEntity.setTemplateCode(messageTemplateConfigEntity.getEnCode()); + sendconfigtemplateEntity.setTemplateName(messageTemplateConfigEntity.getFullName()); + } + } + vo.setSendConfigTemplateList(sendConfigTemplateList); + return ActionResult.success(vo); + } + + + /** + * 更新 + * + * @param id 主键 + * @param sendMessageConfigForm 发送信息配置模型 + * @return + */ + @Operation(summary = "更新") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "sendMessageConfigForm", description = "发送信息配置模型", required = true) + }) + @SaCheckPermission("msgCenter.sendConfig") + @PutMapping("/{id}") + @Transactional + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid SendMessageConfigForm sendMessageConfigForm) throws DataException { + + boolean b = sendMessageConfigService.checkForm(sendMessageConfigForm, 0,sendMessageConfigForm.getId()); + if (b) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + if("0".equals(sendMessageConfigForm.getEnabledMark())){ + if(sendMessageConfigService.idUsed(id)){ + return ActionResult.fail(MsgCode.FA049.get()); + } + } + if(!"1".equals(sendMessageConfigForm.getTemplateType())){ + if(sendMessageConfigForm.getEnCode().contains("PZXT")){ + return ActionResult.fail(MsgCode.MSERR114.get()); + } + } + UserInfo userInfo = UserProvider.getUser(); + SendMessageConfigEntity entity = sendMessageConfigService.getInfo(id); + if (entity != null) { + SendMessageConfigEntity subentity = JsonUtil.getJsonToBean(sendMessageConfigForm, SendMessageConfigEntity.class); + subentity.setCreatorUserId(entity.getCreatorUserId()); + subentity.setCreatorTime(entity.getCreatorTime()); + subentity.setLastModifyUserId(userInfo.getUserId()); + subentity.setLastModifyTime(DateUtil.getNowDate()); + + //明细表数据更新 + List addTemplateList = new ArrayList<>(); + List updTemplateList = new ArrayList<>(); + List delTemplateList = new ArrayList<>(); + if (sendMessageConfigForm.getSendConfigTemplateList() != null) { + List sendConfigTemplateEntityList = JsonUtil.getJsonToList(sendMessageConfigForm.getSendConfigTemplateList(), SendConfigTemplateEntity.class); + long dd = sendConfigTemplateEntityList.stream().filter(t->t.getMessageType().equals("4")).count(); + long qy = sendConfigTemplateEntityList.stream().filter(t->t.getMessageType().equals("5")).count(); + boolean isQy = true; + boolean isDd = true; + Map objModel = getSysConfig(); + if(qy > 0){ + BaseSystemInfo baseSystemInfo = JsonUtil.getJsonToBean(objModel, BaseSystemInfo.class); + // 企业号id + String corpId = baseSystemInfo.getQyhCorpId(); + // 应用凭证 + String agentId = baseSystemInfo.getQyhAgentId(); + // 凭证密钥 + String agentSecret = baseSystemInfo.getQyhAgentSecret(); + // 同步密钥 + String corpSecret = baseSystemInfo.getQyhCorpSecret(); + if(StringUtil.isNotEmpty(corpId) && StringUtil.isNotEmpty(agentId) && StringUtil.isNotEmpty(corpSecret) && StringUtil.isNotEmpty(agentSecret)){ + isQy = true; + }else { + isQy = false; + } + } + if(dd > 0){ + DingTalkModel dingTalkModel = JsonUtil.getJsonToBean(objModel, DingTalkModel.class); + // 钉钉企业号Id + String dingAgentId = dingTalkModel.getDingAgentId(); + // 应用凭证 + String dingSynAppKey = dingTalkModel.getDingSynAppKey(); + // 凭证密钥 + String dingSynAppSecret = dingTalkModel.getDingSynAppSecret(); + if(StringUtil.isNotEmpty(dingSynAppKey) && StringUtil.isNotEmpty(dingSynAppSecret) && StringUtil.isNotEmpty(dingAgentId)){ + isDd = true; + }else { + isDd = false; + } + } + if(!isQy){ + return ActionResult.fail(MsgCode.MSERR120.get()); + } + if(!isDd){ + return ActionResult.fail(MsgCode.MSERR119.get()); + } + for (SendConfigTemplateEntity entitys : sendConfigTemplateEntityList) { + SendConfigTemplateEntity templateEntity = StringUtil.isNotEmpty(entitys.getId())?sendConfigTemplateService.getInfo(entitys.getId()):null; + if(templateEntity != null){ + templateEntity.setSendConfigId(entity.getId()); + templateEntity.setId(entitys.getId()); + templateEntity.setEnabledMark(entitys.getEnabledMark()); + templateEntity.setCreatorTime(entitys.getCreatorTime()); + templateEntity.setCreatorUserId(entitys.getCreatorUserId()); + templateEntity.setDescription(entitys.getDescription()); + templateEntity.setAccountConfigId(entitys.getAccountConfigId()); + templateEntity.setSortCode(entitys.getSortCode()); + templateEntity.setLastModifyTime(DateUtil.getNowDate()); + templateEntity.setLastModifyUserId(userInfo.getUserId()); + templateEntity.setTemplateId(entitys.getTemplateId()); + updTemplateList.add(templateEntity); + }else { + entitys.setId(RandomUtil.uuId()); + entitys.setSendConfigId(entity.getId()); + entitys.setCreatorUserId(userInfo.getUserId()); + entitys.setCreatorTime(DateUtil.getNowDate()); + addTemplateList.add(entitys); + } + } + //删除参数记录 + List paramEntityList = sendConfigTemplateService.getDetailListByParentId(entity.getId()); + if (paramEntityList != null) { + for (SendConfigTemplateEntity templateEntity : paramEntityList) { + SendConfigTemplateEntity templateEntity1 = sendConfigTemplateEntityList.stream().filter(t -> t.getId().equals(templateEntity.getId())).findFirst().orElse(null); + if (templateEntity1 == null) { + delTemplateList.add(templateEntity); + } + } + } + if (addTemplateList != null && addTemplateList.size() > 0) { + sendConfigTemplateService.saveBatch(addTemplateList); + } + if (updTemplateList != null && updTemplateList.size() > 0) { + sendConfigTemplateService.updateBatchById(updTemplateList); + } + if (delTemplateList != null && delTemplateList.size() > 0) { + sendConfigTemplateService.removeByIds(delTemplateList.stream().map(SendConfigTemplateEntity::getId).collect(Collectors.toList())); + } + } + boolean b1 = sendMessageConfigService.updateById(subentity); + if (!b1) { + return ActionResult.fail(MsgCode.VS405.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } else { + return ActionResult.fail(MsgCode.FA002.get()); + } + } + + + /** + * 删除 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("msgCenter.sendConfig") + @DeleteMapping("/{id}") + @Transactional + public ActionResult delete(@PathVariable("id") String id) { + SendMessageConfigEntity entity = sendMessageConfigService.getInfo(id); + if (entity != null) { + if(sendMessageConfigService.idUsed(id)){ + return ActionResult.fail(MsgCode.FA050.get()); + } + sendMessageConfigService.delete(entity); + QueryWrapper queryWrapperSendConfigTemplate = new QueryWrapper<>(); + queryWrapperSendConfigTemplate.lambda().eq(SendConfigTemplateEntity::getSendConfigId, entity.getId()); + sendConfigTemplateService.remove(queryWrapperSendConfigTemplate); + + } + return ActionResult.success(MsgCode.SU003.get()); + } + + /** + * 获取消息发送配置 + * + * @param id 发送配置id + * @return + */ + @Operation(summary = "获取消息发送配置") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("msgCenter.sendConfig") + @PostMapping("/getTestConfig/{id}") + @Transactional + public ActionResult getTestConfig(@PathVariable("id") String id){ + List configTemplateList = sendConfigTemplateService.getConfigTemplateListByConfigId(id); + List msgSendTypeList = dictionaryDataApi.getListByTypeDataCode("msgSendType"); + if(configTemplateList != null && configTemplateList.size()>0){ + List modelList = JsonUtil.getJsonToList(configTemplateList, SendConfigTemplateModel.class); + for(SendConfigTemplateModel model:modelList){ + List list = messageTemplateConfigService.getParamJson(model.getTemplateId()); + if(list!=null && list.size()>0){ + model.setParamJson(list); + } + MessageTemplateConfigEntity msgTemEntity = messageTemplateConfigService.getInfo(model.getTemplateId()); + if(msgTemEntity != null){ + model.setMsgTemplateName(msgTemEntity.getFullName()); + } + if(StringUtil.isNotEmpty(model.getMessageType())){ + msgSendTypeList.stream().filter(t -> model.getMessageType().equals(t.getEnCode())).findFirst() + .ifPresent(dataTypeEntity -> model.setMessageType(dataTypeEntity.getFullName())); + } + } + return ActionResult.success(modelList); + }else { + return ActionResult.fail(MsgCode.MSERR121.get()); + } + } + + /** + * 测试消息发送配置 + * + * @param modelList 发送配置 + * @return + */ + @Operation(summary = "测试消息发送配置") + @Parameters({ + @Parameter(name = "modelList", description = "发送配置", required = true) + }) + @SaCheckPermission("msgCenter.sendConfig") + @PostMapping("/testSendConfig") + @Transactional + public ActionResult testSendConfig(@RequestBody @Valid List modelList) throws NoSuchAlgorithmException, InvalidKeyException { + UserInfo userInfo = UserProvider.getUser(); + List resultList = new ArrayList<>(); + List msgSendTypeList = dictionaryDataApi.getListByTypeDataCode("msgSendType"); + if(modelList != null && modelList.size()>0){ + for(SendConfigTemplateModel model: modelList){ + SendConfigTestResultModel resultModel = new SendConfigTestResultModel(); + String result = testSendConfigUtil.sendMessage(model,userInfo); + MessageTemplateConfigEntity msgTemEntity = messageTemplateConfigService.getInfo(model.getTemplateId()); + if(msgTemEntity != null) { + msgSendTypeList.stream().filter(t -> msgTemEntity.getMessageType().equals(t.getEnCode())).findFirst() + .ifPresent(dataTypeEntity -> resultModel.setMessageType("消息类型:" + dataTypeEntity.getFullName())); + resultModel.setResult(result); + if (result != null) { + resultModel.setIsSuccess("0"); + } else { + resultModel.setIsSuccess("1"); + } + } + resultList.add(resultModel); + } + } + return ActionResult.success(resultList); + } + + /** + * 复制 + * + * @param id 主键 + * @return + */ + @Operation(summary = "复制") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("msgCenter.sendConfig") + @PostMapping("/{id}/Actions/Copy") + @Transactional + public ActionResult copy(@PathVariable("id") String id) { + UserInfo userInfo = UserProvider.getUser(); + SendMessageConfigEntity entity = sendMessageConfigService.getInfo(id); + if (entity != null) { + entity.setEnabledMark(0); + String copyNum = UUID.randomUUID().toString().substring(0, 5); + entity.setFullName(entity.getFullName()+".副本"+copyNum); + entity.setEnCode(entity.getEnCode()+copyNum); + entity.setCreatorTime(DateUtil.getNowDate()); + entity.setCreatorUserId(userInfo.getUserId()); + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + entity.setTemplateType("0"); + entity.setId(RandomUtil.uuId()); + SendMessageConfigEntity copyEntity = JsonUtil.getJsonToBean(entity, SendMessageConfigEntity.class); + if(copyEntity.getEnCode().length()>50 || copyEntity.getFullName().length()>50){ + return ActionResult.fail(MsgCode.PRI006.get()); + } + sendMessageConfigService.create(copyEntity); + List copyConfigTemplateList = new ArrayList<>(); + List configTemplateList = sendConfigTemplateService.getDetailListByParentId(id); + if(configTemplateList != null && configTemplateList.size()>0){ + for(SendConfigTemplateEntity entitys : configTemplateList){ + entitys.setId(RandomUtil.uuId()); + entitys.setSendConfigId(copyEntity.getId()); + entitys.setCreatorTime(DateUtil.getNowDate()); + entitys.setCreatorUserId(userInfo.getUserId()); + entitys.setLastModifyTime(null); + entitys.setLastModifyUserId(null); + copyConfigTemplateList.add(entitys); + } + } + if(copyConfigTemplateList != null && copyConfigTemplateList.size()>0) { + sendConfigTemplateService.saveBatch(copyConfigTemplateList); + } + return ActionResult.success(MsgCode.SU007.get()); + }else { + return ActionResult.fail(MsgCode.FA004.get()); + } + } + + /** + * 导出消息发送配置 + * + * @param id 账号配置id + * @return ignore + */ + @Operation(summary = "导出") + @GetMapping("/{id}/Action/Export") + public ActionResult export(@PathVariable String id) { + SendMessageConfigEntity entity = sendMessageConfigService.getInfo(id); + SendMessageConfigInfoVO vo = JsonUtil.getJsonToBean(entity, SendMessageConfigInfoVO.class); + + //子表数据 + List sendConfigTemplateList = sendMessageConfigService.getSendConfigTemplateList(id); + vo.setSendConfigTemplateList(sendConfigTemplateList); + //导出文件 + DownloadVO downloadVO = fileExport.exportFile(vo, configValueUtil.getTemporaryFilePath(), entity.getFullName(), ModuleTypeEnum.MESSAGE_SEND_CONFIG.getTableName()); + return ActionResult.success(downloadVO); + } + + /** + * 导入账号配置 + * + * @param multipartFile 备份json文件 + * @return 执行结果标识 + */ + @Operation(summary = "导入") + @PostMapping(value = "/Action/Import", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ActionResult importData(@RequestPart("file") MultipartFile multipartFile) throws DataException { + UserInfo userInfo = UserProvider.getUser(); + //判断是否为.json结尾 + if (FileUtil.existsSuffix(multipartFile, ModuleTypeEnum.MESSAGE_SEND_CONFIG.getTableName())) { + return ActionResult.fail(MsgCode.IMP002.get()); + } + //获取文件内容 + String fileContent = FileUtil.getFileContent(multipartFile); + SendMessageConfigInfoVO infoVO = JsonUtil.getJsonToBean(fileContent, SendMessageConfigInfoVO.class); + SendMessageConfigEntity entity = JsonUtil.getJsonToBean(infoVO, SendMessageConfigEntity.class); + entity.setCreatorUserId(userInfo.getUserId()); + entity.setCreatorTime(DateUtil.getNowDate()); + if (infoVO.getSendConfigTemplateList() != null) { + List sendConfigTemplateList = JsonUtil.getJsonToList(infoVO.getSendConfigTemplateList(), SendConfigTemplateEntity.class); + sendConfigTemplateService.saveBatch(sendConfigTemplateList); + } + return sendMessageConfigService.ImportData(entity); + } + + + public Map getSysConfig() { + Map objModel = new HashMap<>(); + List configList = sysconfigService.getList("SysConfig"); + for (SysConfigEntity entity : configList) { + objModel.put(entity.getFkey(), entity.getValue()); + } + return objModel; + } +} + diff --git a/yunzhupaas-message/yunzhupaas-message-controller/src/main/java/com/yunzhupaas/message/controller/ShortLinkController.java b/yunzhupaas-message/yunzhupaas-message-controller/src/main/java/com/yunzhupaas/message/controller/ShortLinkController.java new file mode 100644 index 0000000..6aa212e --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-controller/src/main/java/com/yunzhupaas/message/controller/ShortLinkController.java @@ -0,0 +1,119 @@ +package com.yunzhupaas.message.controller; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.servlet.http.HttpServletResponse; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.consts.DeviceType; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.exception.LoginException; +import com.yunzhupaas.message.entity.ShortLinkEntity; +import com.yunzhupaas.message.service.ShortLinkService; +import com.yunzhupaas.util.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.io.IOException; + +@Slf4j +@RestController +@Tag(name = "短链接跳转", description = "message") +@RequestMapping("/api/message/ShortLink") +public class ShortLinkController extends SuperController { + @Autowired + private ShortLinkService shortLinkService; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + protected AuthUtil authUtil; + + + /** + * 消息发送配置弹窗列表 + * + * @return + */ + @NoDataSourceBind + @Operation(summary = "根据短链接获取实际链接地址") + @Parameters({ + @Parameter(name = "shortLink", description = "短链接", required = true), + @Parameter(name = "tenant", description = "租户") + }) + @GetMapping(value = {"/{shortLink}/{tenant}", "/{shortLink}"}) + public ActionResult getShortUrl(@PathVariable("shortLink") String shortLink, @PathVariable(value = "tenant", required = false) String tenant, HttpServletResponse response) throws LoginException, IOException { + if (configValueUtil.isMultiTenancy()) { + if (StringUtil.isNotEmpty(tenant)) { + //切换成租户库 + TenantDataSourceUtil.switchTenant(tenant); + } else { + return ActionResult.fail(MsgCode.LOG115.get()); + } + } + String link = new String(); + ShortLinkEntity entity = shortLinkService.getInfoByLink(shortLink); + String frontDomain = configValueUtil.getFrontDomain(); + String appDomain = configValueUtil.getAppDomain(); + String realPcLink = entity.getRealPcLink(); + String realAppLink = entity.getRealAppLink(); + if (!realPcLink.contains("http")) { + realPcLink = frontDomain + realPcLink; + } + if (!realAppLink.contains("http")) { + realAppLink = appDomain + realAppLink; + } + DeviceType type = UserProvider.getDeviceForAgent(); + if (entity != null) { +// String encode = ""; + String token = authUtil.loginTempUser(entity.getUserId(), tenant); + if (StringUtil.isEmpty(token)) { + return ActionResult.fail(MsgCode.AD104.get()); + } + + if (entity.getIsUsed() == 1) { + if (entity.getClickNum() < entity.getUnableNum() && entity.getUnableTime().after(DateUtil.getNowDate())) { + if (DeviceType.PC.equals(type)) { + link = realPcLink + "&token=" + token; + entity.setClickNum(entity.getClickNum() + 1); + shortLinkService.updateById(entity); + } else { + link = realAppLink + "&token=" + token; + entity.setClickNum(entity.getClickNum() + 1); + shortLinkService.updateById(entity); + } + } else { + return ActionResult.fail(MsgCode.FA039.get()); + } + } else { + if (entity.getUnableTime().after(DateUtil.getNowDate())) { + if (DeviceType.PC.equals(type)) { + link = realPcLink + "&token=" + token; + entity.setClickNum(entity.getClickNum() + 1); + shortLinkService.updateById(entity); + } else { + link = realAppLink + "&token=" + token; + entity.setClickNum(entity.getClickNum() + 1); + shortLinkService.updateById(entity); + } + } else { + return ActionResult.fail(MsgCode.FA039.get()); + } + } + + } else { + return ActionResult.fail(MsgCode.FA039.get()); + } + response.sendRedirect(link); + return ActionResult.success(""); + } + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-controller/src/main/java/com/yunzhupaas/message/controller/WxGZHFunctionController.java b/yunzhupaas-message/yunzhupaas-message-controller/src/main/java/com/yunzhupaas/message/controller/WxGZHFunctionController.java new file mode 100644 index 0000000..10703bc --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-controller/src/main/java/com/yunzhupaas/message/controller/WxGZHFunctionController.java @@ -0,0 +1,262 @@ +package com.yunzhupaas.message.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONObject; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import com.yunzhupaas.base.entity.SysConfigEntity; +import com.yunzhupaas.base.service.SysconfigService; +import com.yunzhupaas.message.entity.AccountConfigEntity; +import com.yunzhupaas.message.entity.WechatUserEntity; +import com.yunzhupaas.message.service.AccountConfigService; +import com.yunzhupaas.message.service.WechatUserService; +import com.yunzhupaas.message.util.weixingzh.WXGZHWebChatUtil; +import com.yunzhupaas.message.util.weixingzh.aes.WXBizMsgCrypt; +import com.yunzhupaas.permission.entity.SocialsUserEntity; +import com.yunzhupaas.permission.service.SocialsUserService; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 发送消息模型 + */ +@Tag(name = "微信公众号事件接收", description = "WechatOpen") +@Controller +@RequestMapping("/api/message/WechatOpen") +@Slf4j +public class WxGZHFunctionController { + + @Autowired + private UserService userService; + @Autowired + private SysconfigService sysconfigService; + @Autowired + private AccountConfigService accountConfigService; + @Autowired + private SocialsUserService socialsUserService; + @Autowired + private WechatUserService wechatUserService; + + /** + * 服务器基本配置链接微信公众号验证 + * + * @param request 请求对象 + * @param response 响应对象 + * @return + */ + @Operation(summary = "服务器基本配置链接微信公众号验证") + @ResponseBody + @Parameters({ + @Parameter(name = "enCode", description = "微信公众号账号配置编码", required = true) + }) + @GetMapping("/token/{enCode}") + public String token(@PathVariable("enCode") String enCode, HttpServletRequest request, HttpServletResponse response) throws Exception { + //获取微信公众号账号配置 + AccountConfigEntity accountConfigEntity = accountConfigService.getInfoByEnCode(enCode,"7"); + if(ObjectUtil.isEmpty(accountConfigEntity)){ + log.info("未找到与编码相对应的微信公众号配置"); + return ""; + } + //微信公众号服务器配置token + String wxToken = accountConfigEntity.getAgentId(); + String signature = request.getParameter("signature"); + String echostr = XSSEscape.escape(request.getParameter("echostr")); + String timestamp = request.getParameter("timestamp"); + String nonce = request.getParameter("nonce"); + + String sortStr = WXGZHWebChatUtil.sort(wxToken,timestamp,nonce); + String mySinStr = WXGZHWebChatUtil.shal(sortStr); + if(StringUtil.isNotBlank(signature) && mySinStr.equals(signature)){ + return echostr; + }else { + log.info("微信公众号链接失败"); + return echostr; + } + } + + + /** + * 微信公众号事件请求 + * + * @param request 请求对象 + * @param response 响应对象 + * @return + * @throws Exception + */ + @Operation(summary = "微信公众号事件请求") + @ResponseBody + @PostMapping("/token/{enCode}") + /** + * 微信公众号事件请求 + */ + public String tokenPost(@PathVariable("enCode") String enCode,HttpServletRequest request, HttpServletResponse response) throws Exception { + log.info("微信公众号请求事件"); + //获取微信公众号账号配置 + AccountConfigEntity accountConfigEntity = accountConfigService.getInfoByEnCode(enCode,"7"); + if(ObjectUtil.isEmpty(accountConfigEntity)){ + log.info("未找到与编码相对应的微信公众号配置"); + return ""; + } + //微信公众号服务器配置token + String wxToken = accountConfigEntity.getAgentId(); + //微信公众号服务器配置EncodingAesKey + String encodingAesKey = accountConfigEntity.getBearer(); + //微信公众号AppId + String wxAppId = accountConfigEntity.getAppId(); + + // 获取系统配置 + String msgSignature = request.getParameter("msg_signature"); + String encrypt_type = request.getParameter("encrypt_type"); + String signature = request.getParameter("signature"); + String echostr = XSSEscape.escape(request.getParameter("echostr")); + String timestamp = request.getParameter("timestamp"); + String nonce = request.getParameter("nonce"); + + String sortStr = WXGZHWebChatUtil.sort(wxToken,timestamp,nonce); + String mySinStr = WXGZHWebChatUtil.shal(sortStr); + //验签 + if(StringUtil.isNotBlank(signature) && mySinStr.equals(signature)){ + //事件信息 + Map map = WXGZHWebChatUtil.parseXml(request); + //事件信息 + String Event = map.get("Event"); + String openid = map.get("FromUserName"); + //公众号原始id + String gzhId = map.get("ToUserName"); + if("aes".equals(encrypt_type)) { + WXBizMsgCrypt pc = new WXBizMsgCrypt(wxToken, encodingAesKey, wxAppId); + String encrypt = map.get("Encrypt"); + String format = ""; + String fromXML = String.format(format, encrypt); + // 获取解密后消息明文 + String result = pc.decryptMsg(msgSignature, timestamp, nonce, fromXML); + + Map resultMap = new HashMap<>(); + resultMap = WXGZHWebChatUtil.xmlToMap(result); + // 获取解密后事件信息 + Event = resultMap.get("Event"); + openid = resultMap.get("FromUserName"); + gzhId = resultMap.get("ToUserName"); + } + + String appId = accountConfigEntity.getAppId(); + String appsecret = accountConfigEntity.getAppSecret(); + String token = WXGZHWebChatUtil.getAccessToken(appId,appsecret); + if("subscribe".equals(Event)){ + //用户关注事件 + if(StringUtil.isNotBlank(token)){ + JSONObject rstObj = WXGZHWebChatUtil.getUsetInfo(token,openid); + if(rstObj.containsKey("unionid")){ + String unionid = rstObj.getString("unionid"); + SocialsUserEntity socialsUserEntity = socialsUserService.getInfoBySocialId(unionid,"wechat_open"); + if(socialsUserEntity==null){ + log.info("微信公众号未绑定系统账号,请登录小程序绑定"); + return ""; + }else{ + WechatUserEntity wechatUserEntity = wechatUserService.getInfoByGzhId(socialsUserEntity.getUserId(),gzhId); + if(wechatUserEntity==null){ + WechatUserEntity entity = new WechatUserEntity(); + entity.setId(RandomUtil.uuId()); + entity.setUserId(socialsUserEntity.getUserId()); + entity.setGzhId(gzhId); + entity.setCloseMark(1); + entity.setCreatorTime(DateUtil.getNowDate()); + entity.setOpenId(openid); + wechatUserService.create(entity); + return ""; + }else { + if(wechatUserEntity.getCloseMark()==0){ + wechatUserEntity.setCloseMark(1); + } + wechatUserEntity.setOpenId(openid); + wechatUserEntity.setLastModifyTime(DateUtil.getNowDate()); + wechatUserService.update(wechatUserEntity.getId(),wechatUserEntity); + } + return ""; + } + }else{ + log.info("微信公众号未绑定系统账号,请登录小程序绑定"); + return ""; + } + }else{ + log.error("微信公众号token错误,请查看配置"); + return ""; + } + }else if("unsubscribe".equals(Event)){ + //用户取消关注事件 + if(StringUtil.isNotBlank(token)){ + JSONObject rstObj = WXGZHWebChatUtil.getUsetInfo(token,openid); + if(rstObj.containsKey("unionid")){ + String unionid = rstObj.getString("unionid"); + SocialsUserEntity socialsUserEntity = socialsUserService.getInfoBySocialId(unionid,"wechat_open"); + if(socialsUserEntity==null){ + log.info("微信公众号未绑定系统账号,请登录小程序绑定"); + }else{ + WechatUserEntity wechatUserEntity = wechatUserService.getInfoByGzhId(socialsUserEntity.getUserId(),gzhId); + if(wechatUserEntity==null){ + WechatUserEntity entity = new WechatUserEntity(); + entity.setId(RandomUtil.uuId()); + entity.setUserId(socialsUserEntity.getUserId()); + entity.setGzhId(gzhId); + entity.setCloseMark(0); + entity.setCreatorTime(DateUtil.getNowDate()); + entity.setOpenId(openid); + wechatUserService.create(entity); + return ""; + }else { + if(wechatUserEntity.getCloseMark()==1){ + wechatUserEntity.setCloseMark(0); + } + wechatUserEntity.setOpenId(openid); + wechatUserEntity.setLastModifyTime(DateUtil.getNowDate()); + wechatUserService.update(wechatUserEntity.getId(),wechatUserEntity); + return ""; + } + } + }else{ + log.info("微信公众号未绑定系统账号,请登录小程序绑定"); + return ""; + } + }else{ + log.error("微信公众号token错误,请查看配置"); + return ""; + } + return ""; + }else { + return ""; + } + }else { + log.info("微信公众号事件请求失败"); + return echostr; + } + } + + /** + * 获取系统配置 + */ + private Map getSystemConfig() { + // 获取系统配置 + List configList = sysconfigService.getList("SysConfig"); + Map objModel = new HashMap<>(16); + for (SysConfigEntity entity : configList) { + objModel.put(entity.getFkey(), entity.getValue()); + } + return objModel; + } + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-controller/src/main/java/com/yunzhupaas/message/websocket/WebSocket.java b/yunzhupaas-message/yunzhupaas-message-controller/src/main/java/com/yunzhupaas/message/websocket/WebSocket.java new file mode 100644 index 0000000..a03ec34 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-controller/src/main/java/com/yunzhupaas/message/websocket/WebSocket.java @@ -0,0 +1,477 @@ +package com.yunzhupaas.message.websocket; + +import com.alibaba.fastjson.JSONObject; +import com.google.common.collect.ImmutableMap; +import com.yunzhupaas.base.PageModel; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.service.SysconfigService; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.message.entity.MessageReceiveEntity; +import com.yunzhupaas.message.service.UserDeviceService; +import com.yunzhupaas.message.util.*; +import com.yunzhupaas.message.util.unipush.UinPush; +import com.yunzhupaas.message.entity.ImContentEntity; +import com.yunzhupaas.message.entity.MessageEntity; +import com.yunzhupaas.message.model.message.PaginationMessage; +import com.yunzhupaas.message.model.websocket.onconnettion.OnConnectionModel; +import com.yunzhupaas.message.model.websocket.onconnettion.OnLineModel; +import com.yunzhupaas.message.model.websocket.receivemessage.ReceiveMessageModel; +import com.yunzhupaas.message.model.websocket.savafile.ImageMessageModel; +import com.yunzhupaas.message.model.websocket.savafile.VoiceMessageModel; +import com.yunzhupaas.message.model.websocket.savamessage.SavaMessageModel; +import com.yunzhupaas.message.service.ImContentService; +import com.yunzhupaas.message.service.MessageService; +import com.yunzhupaas.message.model.ImUnreadNumModel; +import com.yunzhupaas.model.BaseSystemInfo; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.context.SpringContext; +import lombok.extern.slf4j.Slf4j; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Component; + +import jakarta.websocket.*; +import jakarta.websocket.server.PathParam; +import jakarta.websocket.server.ServerEndpoint; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 消息聊天 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +@Slf4j +@Component +@ServerEndpoint(value = "/api/message/websocket/{token}") +@Scope("prototype") +public class WebSocket { + + private ImContentService imContentService; + private MessageService messageService; + private ConfigValueUtil configValueUtil; + private UserInfo userInfo; + private UserService userApi; + private SysconfigService sysConfigApi; + private UinPush uinPush; + private UserDeviceService userDeviceService; + + + /** + * 连接建立成功调用的方法 + */ + @OnOpen + public void onOpen(Session session, @PathParam("token") String token) { + this.init(); + this.userInfo = UserProvider.getUser(token); + if (this.userInfo.getUserId() == null) { + try{ + OnlineUserProvider.closeFrontWs(null, session); + session.close(); + }catch (Exception e){} + log.info("WS建立链接, TOKEN无效:{}, {}", session.getId(), token); + }else { + log.info("WS建立链接:{}, {}", session.getId(), token); + } + } + + /** + * 连接关闭调用的方法 + */ + @OnClose + public void onClose(Session session) { + OnlineUserModel user = OnlineUserProvider.getOnlineUserList().stream().filter(t -> t.getConnectionId().equals(session.getId())).findFirst().orElse(null); + if (user != null) { + OnlineUserProvider.removeWebSocketByToken(user.getToken()); + log.info("WS连接断开: {}, {}, {}, {}", user.getTenantId(), user.getUserId(), session.getId(), user.getToken()); + }else{ + log.debug("WS连接断开, 无用户信息: {}", session.getId()); + } + } + + /** + * 收到客户端消息后调用的方法 + * + * @param message 客户端发送过来的消息 + */ + @OnMessage + public void onMessage(String message, Session session) { + try{ + processMessage(message, session); + }finally { + //多租户切换后清除缓存 + UserProvider.clearLocalUser(); + TenantDataSourceUtil.clearLocalTenantInfo(); + } + } + + private void processMessage(String message, Session session){ + log.debug("WS消息内容: {}, {}", session.getId(), message); + JSONObject receivedMessage = JSONObject.parseObject(message); + String receivedMethod = receivedMessage.getString(MessageParameterEnum.PARAMETER_METHOD.getValue()); + String receivedToken = receivedMessage.getString(MessageParameterEnum.PARAMETER_TOKEN.getValue()); + //验证TOKEN + this.userInfo = UserProvider.getUser(receivedMessage.getString(MessageParameterEnum.PARAMETER_TOKEN.getValue())); + if (this.userInfo.getUserId() == null) { + log.info("WSToken无效: {}, {}", session.getId(), message); + OnlineUserProvider.closeFrontWs(null, session); + return; + } + //判断是否为多租户 + if(!isMultiTenancy()){ + log.info("WS切库失败: {}, {}, {}, {}", userInfo.getTenantId(), userInfo.getUserId(), session.getId(), receivedToken); + //切库失败 + OnlineUserProvider.closeFrontWs(null, session); + } + UserProvider.setLocalLoginUser(userInfo); + switch (receivedMethod) { + case ConnectionType.CONNECTION_ONCONNECTION: + //建立连接 + log.info("WS开启连接: {}, {}, {}, {}", userInfo.getTenantId(), userInfo.getUserId(), session.getId(), receivedToken); + if(OnlineUserProvider.getOnlineUserList().stream().anyMatch(t -> t.getWebSocket().getId().equals(session.getId()))){ + //WS已存在 + log.info("WS已存在: {}, {}, {}, {}", userInfo.getTenantId(), userInfo.getUserId(), session.getId(), receivedToken); + return; + } + //Token已存在, 关闭之前的WebSocket, 继续执行后续代码添加新的WebSocket + List tokenList = OnlineUserProvider.getOnlineUserList().stream().filter(t-> { + if(receivedToken.equals(t.getToken())){ + OnlineUserProvider.closeFrontWs(t, t.getWebSocket()); + return true; + } + return false; + }).collect(Collectors.toList()); + OnlineUserProvider.getOnlineUserList().removeAll(tokenList); + + //app-true, PC-false + Boolean isMobileDevice = receivedMessage.getBoolean(MessageParameterEnum.PARAMETER_MOBILEDEVICE.getValue()); + if (userInfo != null && userInfo.getUserId() != null) { + OnlineUserModel model = new OnlineUserModel(); + model.setConnectionId(session.getId()); + model.setUserId(userInfo.getUserId()); + model.setTenantId(userInfo.getTenantId()); + model.setIsMobileDevice(isMobileDevice); + model.setWebSocket(session); + model.setToken(receivedToken); + model.setSystemId(model.getIsMobileDevice() ? userInfo.getAppSystemId() : userInfo.getSystemId()); + BaseSystemInfo sysInfo = sysConfigApi.getSysInfo(); + //判断是否在线 + isOnLine(sysInfo, model); + + List onlineUserList = OnlineUserProvider.getOnlineUserList().stream().filter(q -> !q.getUserId().equals(userInfo.getUserId()) && q.getTenantId().equals(userInfo.getTenantId())).collect(Collectors.toList()); + //反馈信息给登录者 + List onlineUsers = onlineUserList.stream().map(t -> t.getUserId()).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList()); + List unreadNums = imContentService.getUnreadList(userInfo.getUserId()); + int unreadNoticeCount = messageService.getUnreadCount(userInfo.getUserId(), 1); + int unreadMessageCount = messageService.getUnreadCount(userInfo.getUserId(), 2); + int unreadScheduleCount = messageService.getUnreadCount(userInfo.getUserId(),4); + int unreadSystemMessageCount = messageService.getUnreadCount(userInfo.getUserId(), 3); + MessageEntity noticeDefaultText = messageService.getInfoDefault(1); + PaginationMessage pagination = new PaginationMessage(); + pagination.setCurrentPage(1); + pagination.setPageSize(1); + List list = messageService.getMessageList3(pagination, pagination.getType(),userInfo.getUserId(), null); + MessageReceiveEntity messageDefaultText = new MessageReceiveEntity(); + if(list.size()>0){ + messageDefaultText = list.get(0); + } + String noticeText = noticeDefaultText.getTitle() != null ? noticeDefaultText.getTitle() : ""; + String messageText = messageDefaultText.getTitle() != null ? messageDefaultText.getTitle() : ""; + Long noticeTime = noticeDefaultText.getCreatorTime() != null ? noticeDefaultText.getCreatorTime().getTime() : 0; + Long messageTime = messageDefaultText.getCreatorTime() != null ? messageDefaultText.getCreatorTime().getTime() : 0; + //转model后上传到mq服务器上 + OnConnectionModel onConnectionModel = new OnConnectionModel(); + onConnectionModel.setMethod(MessageChannelType.CHANNEL_INITMESSAGE); + onConnectionModel.setOnlineUsers(onlineUsers); + onConnectionModel.setUnreadNums(JsonUtil.listToJsonField(unreadNums)); + onConnectionModel.setUnreadNoticeCount(unreadNoticeCount); +// onConnectionModel.setNoticeDefaultText(noticeText); + onConnectionModel.setUnreadMessageCount(unreadMessageCount); + onConnectionModel.setUnreadSystemMessageCount(unreadSystemMessageCount); + onConnectionModel.setUnreadScheduleCount(unreadScheduleCount); + onConnectionModel.setMessageDefaultText(messageText); + onConnectionModel.setMessageDefaultTime(messageTime); + onConnectionModel.setUserId(userInfo.getUserId()); + int total = unreadNoticeCount+unreadMessageCount+unreadSystemMessageCount+unreadScheduleCount; + onConnectionModel.setUnreadTotalCount(total); + OnlineUserProvider.sendMessage(session, onConnectionModel); + //通知所有在线用户,有用户在线 + for (OnlineUserModel item : onlineUserList) { + if (!item.getUserId().equals(userInfo.getUserId())) { + //创建模型 + OnLineModel remindUserModel = new OnLineModel(MessageChannelType.CHANNEL_ONLINE, userInfo.getUserId()); + OnlineUserProvider.sendMessage(item, remindUserModel); + } + } + + } + break; + case ConnectionType.CONNECTION_SENDMESSAGE: + //发送消息 + String toUserId = receivedMessage.getString(MessageParameterEnum.PARAMETER_TOUSERID.getValue()); + //text/voice/image + String messageType = receivedMessage.getString(MessageParameterEnum.PARAMETER_MESSAGETYPE.getValue()); + String messageContent = receivedMessage.getString(MessageParameterEnum.PARAMETER_MESSAGECONTENT.getValue()); + String tenantId = UserProvider.getUser(receivedMessage.getString(MessageParameterEnum.PARAMETER_TOKEN.getValue())).getTenantId(); + + String fileName = ""; + if (!SendMessageTypeEnum.MESSAGE_TEXT.getMessage().equals(messageType)) { + JSONObject object = JSONObject.parseObject(messageContent); + fileName = object.getString("name"); + } + List user = OnlineUserProvider.getOnlineUserList().stream().filter(q -> String.valueOf(q.getUserId()).equals(String.valueOf(userInfo.getUserId())) && String.valueOf(q.getTenantId()).equals(tenantId)).collect(Collectors.toList()); + OnlineUserModel onlineUser = user.size() > 0 ? user.get(0) : null; + List toUser = OnlineUserProvider.getOnlineUserList().stream().filter(q -> String.valueOf(q.getTenantId()).equals(String.valueOf(onlineUser.getTenantId())) && String.valueOf(q.getUserId()).equals(String.valueOf(toUserId))).collect(Collectors.toList()); + if (user.size() != 0) { + //saveMessage + if (SendMessageTypeEnum.MESSAGE_TEXT.getMessage().equals(messageType)) { + messageContent = XSSEscape.escape(messageContent); + imContentService.sendMessage(onlineUser.getUserId(), toUserId, messageContent, messageType); + } else if (SendMessageTypeEnum.MESSAGE_IMAGE.getMessage().equals(messageType)) { + JSONObject image = new JSONObject(); + image.put("path", UploaderUtil.uploaderImg("/api/file/Image/IM/", fileName)); + image.put("width", JSONObject.parseObject(messageContent).getString("width")); + image.put("height", JSONObject.parseObject(messageContent).getString("height")); + imContentService.sendMessage(onlineUser.getUserId(), toUserId, image.toJSONString(), messageType); + } else if (SendMessageTypeEnum.MESSAGE_VOICE.getMessage().equals(messageType)) { + JSONObject voice = new JSONObject(); + voice.put("path", UploaderUtil.uploaderImg("/api/file/Image/IM/", fileName)); + voice.put("length", JSONObject.parseObject(messageContent).getString("length")); + imContentService.sendMessage(onlineUser.getUserId(), toUserId, voice.toJSONString(), messageType); + } + for (int i = 0; i < user.size(); i++) { + OnlineUserModel model = user.get(i); + //组装model + SavaMessageModel savaMessageModel = new SavaMessageModel(); + savaMessageModel.setMethod(MessageChannelType.CHANNEL_SENDMESSAGE); + savaMessageModel.setUserId(model.getUserId()); + savaMessageModel.setToUserId(toUserId); + savaMessageModel.setDateTime(DateUtil.getNowDate().getTime()); + //头像 + savaMessageModel.setHeadIcon(UploaderUtil.uploaderImg(userInfo.getUserIcon())); + //最新消息 + savaMessageModel.setLatestDate(DateUtil.getNowDate().getTime()); + //用户姓名 + savaMessageModel.setRealName(userInfo.getUserName()); + savaMessageModel.setAccount(userInfo.getUserAccount()); + //对方的名称账号头像 + Map headers = ImmutableMap.of(Constants.AUTHORIZATION.toLowerCase(), receivedToken); + UserEntity entity = userApi.getInfo(toUserId); + savaMessageModel.setToAccount(entity.getAccount()); + savaMessageModel.setToRealName(entity.getRealName()); + savaMessageModel.setToHeadIcon(UploaderUtil.uploaderImg(entity.getHeadIcon())); + + if (SendMessageTypeEnum.MESSAGE_TEXT.getMessage().equals(messageType)) { + savaMessageModel.setMessageType(messageType); + savaMessageModel.setToMessage(messageContent); + } else if (SendMessageTypeEnum.MESSAGE_IMAGE.getMessage().equals(messageType)) { + //构建图片模型 + ImageMessageModel messageModel = getImageModel(messageContent, UploaderUtil.uploaderImg("/api/file/Image/IM/", fileName)); + savaMessageModel.setToMessage(messageModel); + savaMessageModel.setMessageType(messageType); + } else if (SendMessageTypeEnum.MESSAGE_VOICE.getMessage().equals(messageType)) { + //构建语音模型 + VoiceMessageModel messageModel = getVoiceMessageModel(messageContent, UploaderUtil.uploaderImg("/api/file/Image/IM/", fileName)); + savaMessageModel.setMessageType(messageType); + savaMessageModel.setToMessage(messageModel); + } + /*List cidList = userDeviceService.getCidList(toUserId); + if(cidList != null && cidList.size()>0){ + JSONObject jsonObject = new JSONObject(); + jsonObject.put("type","3"); + jsonObject.put("name",userInfo.getUserName() + "/"+userInfo.getUserAccount()); + jsonObject.put("formUserId",userInfo.getUserId()); + jsonObject.put("headIcon",UploaderUtil.uploaderImg(userInfo.getUserIcon())); +// jsonObject.put("title",userInfo.getUserName() + "/"+userInfo.getUserAccount()); + String text = JSONObject.toJSONString(jsonObject); + byte[] bytes = text.getBytes(StandardCharsets.UTF_8); + text = Base64.getEncoder().encodeToString(bytes); + uinPush.sendUniPush(cidList, userInfo.getUserName(), "你有一条看聊天消息", "3", text); + }*/ + OnlineUserProvider.sendMessage(model, savaMessageModel); + } + } + + //接受消息 + ReceiveMessageModel receiveMessageModel = new ReceiveMessageModel(); + receiveMessageModel.setMethod(MessageChannelType.CHANNEL_RECEIVEMESSAGE); + receiveMessageModel.setFormUserId(onlineUser.getUserId()); + receiveMessageModel.setDateTime(DateUtil.getNowDate().getTime()); + //头像 + receiveMessageModel.setHeadIcon(UploaderUtil.uploaderImg(userInfo.getUserIcon())); + //最新消息 + receiveMessageModel.setLatestDate(DateUtil.getNowDate().getTime()); + //用户姓名 + receiveMessageModel.setRealName(userInfo.getUserName()); + receiveMessageModel.setAccount(userInfo.getUserAccount()); + receiveMessageModel.setUserId(toUserId); + if (toUser.size() != 0) { + for (int i = 0; i < toUser.size(); i++) { + OnlineUserModel onlineToUser = toUser.get(i); + if (SendMessageTypeEnum.MESSAGE_TEXT.getMessage().equals(messageType)) { + receiveMessageModel.setMessageType(messageType); + receiveMessageModel.setFormMessage(messageContent); + } else if (SendMessageTypeEnum.MESSAGE_IMAGE.getMessage().equals(messageType)) { + //构建图片模型 + ImageMessageModel messageModel = getImageModel(messageContent, UploaderUtil.uploaderImg("/api/file/Image/IM/", fileName)); + receiveMessageModel.setMessageType(messageType); + receiveMessageModel.setFormMessage(messageModel); + } else if (SendMessageTypeEnum.MESSAGE_VOICE.getMessage().equals(messageType)) { + //构建语音模型 + VoiceMessageModel messageModel = getVoiceMessageModel(messageContent, UploaderUtil.uploaderImg("/api/file/Image/IM/", fileName)); + receiveMessageModel.setMessageType(messageType); + receiveMessageModel.setFormMessage(messageModel); + } + OnlineUserProvider.sendMessage(onlineToUser, receiveMessageModel); + } + } + break; + case "UpdateReadMessage": + //更新已读 + String formUserId = receivedMessage.getString("formUserId"); + onlineUser = OnlineUserProvider.getOnlineUserList().stream().filter(q -> String.valueOf(q.getConnectionId()).equals(String.valueOf(session.getId()))).findFirst().orElse(new OnlineUserModel()); + if (onlineUser != null) { + imContentService.readMessage(formUserId, onlineUser.getUserId()); + } + break; + case "MessageList": + //获取消息列表 + String sendUserId = receivedMessage.getString("toUserId"); + String receiveUserId = receivedMessage.getString("formUserId"); + PageModel pageModel = new PageModel(); + pageModel.setPage(receivedMessage.getInteger("currentPage")); + pageModel.setRows(receivedMessage.getInteger("pageSize")); + pageModel.setSord(receivedMessage.getString("sord")); + pageModel.setKeyword(receivedMessage.getString("keyword")); + List data = imContentService.getMessageList(sendUserId, receiveUserId, pageModel).stream().sorted(Comparator.comparing(ImContentEntity::getSendTime)).collect(Collectors.toList()); + JSONObject object = new JSONObject(); + object.put("method", "messageList"); + object.put("list", JsonUtil.getListToJsonArray(data)); + JSONObject pagination = new JSONObject(); + pagination.put("total", pageModel.getRecords()); + pagination.put("currentPage", pageModel.getPage()); + pagination.put("pageSize", receivedMessage.getInteger("pageSize")); + object.put("pagination", pagination); + OnlineUserProvider.sendMessage(session, object); + break; + default: + break; + } + } + + /** + * 判断是否在线 + * + * @param model + */ + private void isOnLine(BaseSystemInfo systemInfo, OnlineUserModel model) { + // 不允许多人登录 + if ("1".equals(String.valueOf(systemInfo.getSingleLogin()))) { + Long userAll = OnlineUserProvider.getOnlineUserList().stream().filter(t -> t.getUserId().equals(userInfo.getUserId()) && t.getTenantId().equals(userInfo.getTenantId())).count(); + Long userAllMobile = OnlineUserProvider.getOnlineUserList().stream().filter(t -> t.getUserId().equals(userInfo.getUserId()) && t.getTenantId().equals(userInfo.getTenantId()) && t.getIsMobileDevice().equals(true)).count(); + Long userAllWeb = OnlineUserProvider.getOnlineUserList().stream().filter(t -> t.getUserId().equals(userInfo.getUserId()) && t.getTenantId().equals(userInfo.getTenantId()) && t.getIsMobileDevice().equals(false)).count(); + //都不在线 + if (userAll == 0) { + OnlineUserProvider.addModel(model); + } + //手机在线 + else if (userAllMobile != 0 && userAllWeb == 0) { + if (!model.getIsMobileDevice()) { + OnlineUserProvider.addModel(model); + } + } + //电脑在线 + else { + if (model.getIsMobileDevice()) { + OnlineUserProvider.addModel(model); + } + } + } else { + //同时登录不限制 + OnlineUserProvider.addModel(model); + } + } + + /** + * 判断是否为多租户 + * + */ + private boolean isMultiTenancy() { + if (configValueUtil.isMultiTenancy()) { + //多租户需要切库 + if (StringUtil.isNotEmpty(userInfo.getTenantId())) { + TenantDataSourceUtil.switchTenant(userInfo.getTenantId()); + }else{ + return false; + } + } + return true; + } + + /** + * 构建图片消息模型 + * + * @param messageContent + * @param fileName + * @return + */ + private ImageMessageModel getImageModel(String messageContent, String fileName) { + String width = JSONObject.parseObject(messageContent).getString("width"); + String height = JSONObject.parseObject(messageContent).getString("height"); + return new ImageMessageModel(width, height, fileName); + } + + /** + * 构建语音模型 + * + * @param messageContent + * @param fileName + * @return + */ + private VoiceMessageModel getVoiceMessageModel(String messageContent, String fileName) { + String length = JSONObject.parseObject(messageContent).getString("length"); + return new VoiceMessageModel(length, fileName); + } + + @OnError + public void onError(Session session, Throwable error) { +// OnlineUserModel user = OnlineUserProvider.getOnlineUserList().stream().filter(t -> t.getConnectionId().equals(session.getId())).findFirst().isPresent() ? OnlineUserProvider.getOnlineUserList().stream().filter(t -> t.getConnectionId().equals(session.getId())).findFirst().get() : null; +// if (user != null) { +// log.error("调用onError,租户:" + user.getTenantId() + ",用户:" + user.getUserId()); +// } + try { + onClose(session); + } catch (Exception e) { +// log.error("发生error,调用onclose失败,session为:" + session); + } + if (error.getMessage() != null) { + OnlineUserModel user = OnlineUserProvider.getOnlineUserList().stream().filter(t -> t.getConnectionId().equals(session.getId())).findFirst().isPresent() ? OnlineUserProvider.getOnlineUserList().stream().filter(t -> t.getConnectionId().equals(session.getId())).findFirst().get() : null; + if(user != null){ + log.error("WS发生错误: {}, {}, {}, {}, {}", user.getTenantId(), user.getUserId(), session.getId(), error.getMessage(), user.getToken()); + }else{ + log.error("WS发生错误", error); + } + } + } + + /** + * 初始化 + */ + private void init() { + messageService = SpringContext.getBean(MessageService.class); + imContentService = SpringContext.getBean(ImContentService.class); + configValueUtil = SpringContext.getBean(ConfigValueUtil.class); + userApi = SpringContext.getBean(UserService.class); + sysConfigApi = SpringContext.getBean(SysconfigService.class); + uinPush = SpringContext.getBean(UinPush.class); + userDeviceService = SpringContext.getBean(UserDeviceService.class); + } + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/pom.xml b/yunzhupaas-message/yunzhupaas-message-entity/pom.xml new file mode 100644 index 0000000..d3f06b8 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/pom.xml @@ -0,0 +1,54 @@ + + + + yunzhupaas-message + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-message-entity + + + + com.yunzhupaas + yunzhupaas-system-entity + ${project.version} + + + org.dom4j + dom4j + + + + + + + boot3 + + [17,) + + + + com.sun.mail + jakarta.mail + + + + + boot2 + + (,17) + + + + com.sun.mail + javax.mail + + + + + + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/AccountConfigEntity.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/AccountConfigEntity.java new file mode 100644 index 0000000..f329cbe --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/AccountConfigEntity.java @@ -0,0 +1,108 @@ +package com.yunzhupaas.message.entity; + +import com.yunzhupaas.base.entity.SuperExtendEntity; +import com.alibaba.fastjson.annotation.JSONField; +import com.baomidou.mybatisplus.annotation.*; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 账号配置表 + * + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-08-18 + */ +@Data +@TableName("base_msg_account") +public class AccountConfigEntity extends SuperExtendEntity.SuperExtendDEEntity { + + @TableField("f_category") + private String type; + + @TableField("f_full_name") + private String fullName; + + @TableField("f_en_code") + private String enCode; + + @TableField("f_addressor_name") + private String addressorName; + +// @TableField("F_SEND_EMAIL") +// +// private String sendEmail; + + @TableField("f_smtp_server") + private String smtpServer; + + @TableField("f_smtp_port") + private Integer smtpPort; + + @TableField("f_ssl_link") + private Integer sslLink; + + @TableField("f_smtp_user") + private String smtpUser; + + @TableField("f_smtp_password") + private String smtpPassword; + + @TableField("f_channel") + private Integer channel; + + @TableField("f_sms_signature") + private String smsSignature; + + @TableField("f_app_id") + private String appId; + + @TableField("f_app_secret") + private String appSecret; + + @TableField("f_end_point") + private String endPoint; + + @TableField("f_sdk_app_id") + private String sdkAppId; + + @TableField("f_app_key") + private String appKey; + + @TableField("f_zone_name") + private String zoneName; + + @TableField("f_zone_param") + private String zoneParam; + + @TableField("f_enterprise_id") + private String enterpriseId; + + @TableField("f_agent_id") + private String agentId; + + @TableField("f_webhook_type") + private Integer webhookType; + + @TableField("f_webhook_address") + private String webhookAddress; + + @TableField("f_approve_type") + private Integer approveType; + + @TableField("f_bearer") + private String bearer; + + @TableField("f_user_name") + private String userName; + + @TableField("f_password") + private String password; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/ImContentEntity.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/ImContentEntity.java new file mode 100644 index 0000000..8ab2a1e --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/ImContentEntity.java @@ -0,0 +1,59 @@ +package com.yunzhupaas.message.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * 聊天内容 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Data +@TableName("base_im_content") +public class ImContentEntity extends SuperExtendEntity.SuperExtendEnabledEntity { + + /** + * 发送者 + */ + @TableField("f_send_user_id") + private String sendUserId; + + /** + * 发送时间 + */ + @TableField("f_send_time") + private Date sendTime; + + /** + * 接收者 + */ + @TableField("f_receive_user_id") + private String receiveUserId; + + /** + * 接收时间 + */ + @TableField("f_receive_time") + private Date receiveTime; + + /** + * 内容 + */ + @TableField("f_content") + private String content; + + /** + * 内容 + */ + @TableField("f_content_type") + private String contentType; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/ImReplyEntity.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/ImReplyEntity.java new file mode 100644 index 0000000..b2f0c8d --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/ImReplyEntity.java @@ -0,0 +1,41 @@ +package com.yunzhupaas.message.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * 聊天会话表 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-05-28 + */ +@Data +@TableName("base_im_reply") +public class ImReplyEntity extends SuperExtendEntity { + + /** + * 发送者 + */ + @TableField("f_user_id") + private String userId; + + /** + * 接收者 + */ + @TableField("f_receive_user_id") + private String receiveUserId; + + /** + * 发送时间 + */ + @TableField("f_receive_time") + private Date receiveTime; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/MessageEntity.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/MessageEntity.java new file mode 100644 index 0000000..c6e9276 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/MessageEntity.java @@ -0,0 +1,125 @@ +package com.yunzhupaas.message.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.yunzhupaas.base.entity.SuperBaseEntity; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * 消息实例 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2023/09/27 + */ +@Data +@TableName("base_notice") +public class MessageEntity extends SuperBaseEntity.SuperCBaseEntity { + + /** + * 标题 + */ + @TableField("f_title") + private String title; + + /** + * 正文 + */ + @TableField("f_body_text") + private String bodyText; + + /** + * 收件用户 + */ + @TableField("f_to_user_ids") + private String toUserIds; + + /** + * 附件 + */ + @TableField("f_files") + private String files; + + /** + * 封面图片 + */ + @TableField("f_cover_image") + private String coverImage; + + /** + * 过期时间 + */ + @TableField("f_expiration_time") + private Date expirationTime; + + /** + * 分类 1-公告 2-通知 + */ + @TableField("f_category") + private String category; + + /** + * 提醒方式 1-站内信 2-自定义 3-不通知 + */ + @TableField("f_type") + private Integer remindCategory; + + /** + * 发送配置 + */ + @TableField("f_send_config_id") + private String sendConfigId; + + /** + * 描述 + */ + @TableField("f_description") + private String excerpt; + + /** + * 有效标志 (-1-删除,0-草稿,1-已发送,2-已过期,) + */ + @TableField(value ="f_enabled_mark",fill = FieldFill.INSERT) + private Integer enabledMark; + + /** + * 排序码 + */ + @TableField("f_sort_code") + private Long sortCode; + + /** + * 删除标志 + */ + @TableField(value = "f_delete_mark" , updateStrategy = FieldStrategy.IGNORED) + private Integer deleteMark; + + /** + * 删除时间 + */ + @TableField(value = "f_delete_time" , fill = FieldFill.UPDATE) + private Date deleteTime; + + /** + * 删除用户 + */ + @TableField(value = "f_delete_user_id" , fill = FieldFill.UPDATE) + private String deleteUserId; + + /** + * 修改时间 + */ + @TableField(value = "f_last_modify_time" , updateStrategy = FieldStrategy.IGNORED) + private Date lastModifyTime; + + /** + * 修改用户 + */ + @TableField(value = "f_last_modify_user_id" , updateStrategy = FieldStrategy.IGNORED) + private String lastModifyUserId; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/MessageMonitorEntity.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/MessageMonitorEntity.java new file mode 100644 index 0000000..48fa3d3 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/MessageMonitorEntity.java @@ -0,0 +1,55 @@ +package com.yunzhupaas.message.entity; + +import com.yunzhupaas.base.entity.SuperEntity; +import com.alibaba.fastjson.annotation.JSONField; +import com.baomidou.mybatisplus.annotation.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonProperty; +/** + * + * 消息监控表 + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-08-22 + */ +@Data +@TableName("base_msg_monitor") +public class MessageMonitorEntity extends SuperExtendEntity { + + @TableField("f_account_id") + private String accountId; + + @TableField("f_account_name") + private String accountName; + + @TableField("f_account_code") + private String accountCode; + + @TableField("f_message_type") + private String messageType; + + @TableField("f_message_source") + private String messageSource; + + @TableField("f_send_time") + private Date sendTime; + + @TableField("f_message_template_id") + private String messageTemplateId; + + @TableField("f_title") + private String title; + + @TableField("f_receive_user") + private String receiveUser; + + @TableField("f_content") + private String content; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/MessageReceiveEntity.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/MessageReceiveEntity.java new file mode 100644 index 0000000..1594377 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/MessageReceiveEntity.java @@ -0,0 +1,59 @@ +package com.yunzhupaas.message.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * 消息接收 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2023/09/27 + */ +@Data +@TableName("base_message") +public class MessageReceiveEntity extends SuperExtendEntity { + + /** + * 用户主键 + */ + @TableField("f_user_id") + private String userId; + + /** + * 是否阅读 + */ + @TableField("f_is_read") + private Integer isRead; + + /** + * 站内信息 + */ + @TableField("f_body_text") + private String bodyText; + + /** + * 标题 + */ + @TableField("f_title") + private String title; + + /** + * 类型(1-公告 2-流程 3-系统 4-日程) + */ + @TableField("f_type") + private Integer type; + + /** + * 流程类型(1:审批 2:委托) + */ + @TableField("f_flow_type") + private Integer flowType; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/MessageTemplateConfigEntity.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/MessageTemplateConfigEntity.java new file mode 100644 index 0000000..170279a --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/MessageTemplateConfigEntity.java @@ -0,0 +1,54 @@ +package com.yunzhupaas.message.entity; + +import com.yunzhupaas.base.entity.SuperExtendEntity; +import com.alibaba.fastjson.annotation.JSONField; +import com.baomidou.mybatisplus.annotation.*; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonProperty; +/** + * + * 消息模板表 + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-08-18 + */ +@Data +@TableName("base_msg_template") +public class MessageTemplateConfigEntity extends SuperExtendEntity.SuperExtendDEEntity { + + @TableField("f_full_name") + private String fullName; + + @TableField("f_en_code") + private String enCode; + + @TableField("f_template_type") + private String templateType; + + @TableField("f_message_source") + private String messageSource; + + @TableField("f_message_type") + private String messageType; + + @TableField("f_title") + private String title; + + @TableField("f_content") + private String content; + + @TableField("f_template_code") + private String templateCode; + + @TableField("f_wx_skip") + private String wxSkip; + + @TableField("f_xcx_app_id") + private String xcxAppId; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/QyWebChatModel.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/QyWebChatModel.java new file mode 100644 index 0000000..d86f8c1 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/QyWebChatModel.java @@ -0,0 +1,28 @@ +package com.yunzhupaas.message.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import jakarta.validation.constraints.NotBlank; + +/** + * 企业微信的模型 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021/5/25 14:18 + */ +@Data +public class QyWebChatModel { + @Schema(description = "CorpId") + private String qyhCorpId; + @Schema(description = "AgentId") + private String qyhAgentId; + @Schema(description = "AgentSecret") + private String qyhAgentSecret; + @Schema(description = "CorpSecret") + private String qyhCorpSecret; +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/SendConfigRecordEntity.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/SendConfigRecordEntity.java new file mode 100644 index 0000000..137d868 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/SendConfigRecordEntity.java @@ -0,0 +1,38 @@ +package com.yunzhupaas.message.entity; + +import com.yunzhupaas.base.entity.SuperEntity; +import com.alibaba.fastjson.annotation.JSONField; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonProperty; +/** + * + * 账号配置使用记录表 + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-09-21 + */ +@Data +@TableName("base_message_send_record") +public class SendConfigRecordEntity extends SuperEntity { + + @TableField("F_SENDCONFIGID") + private String sendConfigId; + + @TableField("F_MESSAGESOURCE") + private String messageSource; + + @TableField("F_USEDID") + private String usedId; + + /** + * 状态 + */ + @TableField("F_ENABLEDMARK") + private Integer enabledMark; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/SendConfigTemplateEntity.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/SendConfigTemplateEntity.java new file mode 100644 index 0000000..7fe0c9c --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/SendConfigTemplateEntity.java @@ -0,0 +1,55 @@ +package com.yunzhupaas.message.entity; + +import com.yunzhupaas.base.entity.SuperExtendEntity; +import com.alibaba.fastjson.annotation.JSONField; +import com.baomidou.mybatisplus.annotation.*; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 发送配置模板表 + * + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-08-19 + */ +@Data +@TableName("base_msg_send_template") +public class SendConfigTemplateEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** 发送配置id **/ + @TableField("f_send_config_id") + private String sendConfigId; + /** 消息类型 **/ + @TableField("f_message_type") + private String messageType; + /** 消息模板id **/ + @TableField("f_template_id") + private String templateId; + /** 账号配置id **/ + @TableField("f_account_config_id") + private String accountConfigId; + + /** 消息模板编号 **/ + @TableField(exist = false) + private String templateCode; + + /** 消息模板名称 **/ + @TableField(exist = false) + private String templateName; + + /** 账号编码 **/ + @TableField(exist = false) + private String accountCode; + + /** 账号名称 **/ + @TableField(exist = false) + private String accountName; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/SendMessageConfigEntity.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/SendMessageConfigEntity.java new file mode 100644 index 0000000..fc29d21 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/SendMessageConfigEntity.java @@ -0,0 +1,42 @@ +package com.yunzhupaas.message.entity; + +import com.yunzhupaas.base.entity.SuperExtendEntity; +import com.alibaba.fastjson.annotation.JSONField; +import com.baomidou.mybatisplus.annotation.*; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 消息发送配置表 + * + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-08-19 + */ +@Data +@TableName("base_msg_send") +public class SendMessageConfigEntity extends SuperExtendEntity.SuperExtendDEEntity { + + @TableField("f_full_name") + private String fullName; + + @TableField("f_en_code") + private String enCode; + +// @TableField("F_MESSAGETYPE") +// +// private String messageType; + + @TableField("f_template_type") + private String templateType; + + @TableField("f_message_source") + private String messageSource; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/ShortLinkEntity.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/ShortLinkEntity.java new file mode 100644 index 0000000..cfcd76f --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/ShortLinkEntity.java @@ -0,0 +1,58 @@ +package com.yunzhupaas.message.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * + * 短信变量表 + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-08-18 + */ +@Data +@TableName("base_msg_short_link") +public class ShortLinkEntity extends SuperExtendEntity.SuperExtendEnabledEntity { + + /** 短链接 **/ + @TableField("f_short_link") + private String shortLink; + + /** PC端链接 **/ + @TableField("f_real_pc_link") + private String realPcLink; + + /** App端链接 **/ + @TableField("f_real_app_link") + private String realAppLink; + + /** 流程内容 **/ + @TableField("f_body_text") + private String bodyText; + + /** 是否点击后失效 **/ + @TableField("f_is_used") + private Integer isUsed; + + /** 点击次数 **/ + @TableField("f_click_num") + private Integer clickNum; + + /** 失效次数 **/ + @TableField("f_unable_num") + private Integer unableNum; + + /** 失效时间 **/ + @TableField("f_unable_time") + private Date unableTime; + + /** 用户id **/ + @TableField("f_user_id") + private String userId; +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/SmsFieldEntity.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/SmsFieldEntity.java new file mode 100644 index 0000000..2adff87 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/SmsFieldEntity.java @@ -0,0 +1,40 @@ +package com.yunzhupaas.message.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +/** + * + * 短信变量表 + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-08-18 + */ +@Data +@TableName("base_msg_sms_field") +public class SmsFieldEntity extends SuperExtendEntity.SuperExtendEnabledEntity { + + /** 模板 **/ + @TableField("F_TEMPLATE_ID") + private String templateId; + + /** 参数id **/ + @TableField("F_FIELD_ID") + private String fieldId; + + /** 短信变量 **/ + @TableField("F_SMS_FIELD") + private String smsField; + + /** 参数 **/ + @TableField("F_FIELD") + private String field; + + /** 是否标题 **/ + @TableField("F_IS_TITLE") + private Integer isTitle; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/SynThirdInfoEntity.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/SynThirdInfoEntity.java new file mode 100644 index 0000000..374d71b --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/SynThirdInfoEntity.java @@ -0,0 +1,50 @@ +package com.yunzhupaas.message.entity; + +import com.alibaba.fastjson.annotation.JSONField; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 第三方工具的公司-部门-用户同步表模型 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021/4/23 17:06 + */ +@Data +@TableName("base_syn_third_info") +public class SynThirdInfoEntity extends SuperExtendEntity.SuperExtendDEEntity implements Serializable { + + /** + * 第三方类型(1:企业微信;2:钉钉) + */ + @TableField("F_THIRD_TYPE") + private Integer thirdType; + + /** + * 数据类型(1:组织(公司与部门);2:用户) + */ + @TableField("F_DATA_TYPE") + private Integer dataType; + + /** + * 系统对象ID(公司ID、部门ID、用户ID) + */ + @TableField("F_SYS_OBJ_ID") + private String sysObjId; + + /** + * 第三对象ID(公司ID、部门ID、用户ID) + */ + @TableField("F_THIRD_OBJ_ID") + private String thirdObjId; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/TemplateParamEntity.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/TemplateParamEntity.java new file mode 100644 index 0000000..c8f70b8 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/TemplateParamEntity.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.message.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; +/** + * + * 消息模板参数表 + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-08-18 + */ +@Data +@TableName("base_msg_template_param") +public class TemplateParamEntity extends SuperExtendEntity.SuperExtendEnabledEntity { + + /** 消息模板id **/ + @TableField("f_template_id") + private String templateId; + + /** 参数 **/ + @TableField("f_field") + private String field; + + /** 参数说明 **/ + @TableField("f_field_name") + private String fieldName; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/UserDeviceEntity.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/UserDeviceEntity.java new file mode 100644 index 0000000..5b660ae --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/UserDeviceEntity.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.message.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + + +/** + * + * 短信变量表 + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-08-18 + */ +@Data +@TableName("base_user_device") +public class UserDeviceEntity extends SuperExtendEntity.SuperExtendEnabledEntity { + + /** 用户id **/ + @TableField("F_USERID") + private String userId; + + /** 设备id **/ + @TableField("F_CLIENTID") + private String clientId; +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/WechatUserEntity.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/WechatUserEntity.java new file mode 100644 index 0000000..7cd8d97 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/entity/WechatUserEntity.java @@ -0,0 +1,37 @@ +package com.yunzhupaas.message.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +/** + * + * 短信变量表 + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-08-18 + */ +@Data +@TableName("base_msg_wechat_user") +public class WechatUserEntity extends SuperExtendEntity.SuperExtendEnabledEntity { + + /** 公众号元素id **/ + @TableField("f_gzh_id") + private String gzhId; + + /** 用户id **/ + @TableField("f_user_id") + private String userId; + + /** 公众号用户id **/ + @TableField("f_open_id") + private String openId; + + /** 是否关注公众号 **/ + @TableField("f_close_mark") + private Integer closeMark; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/enums/MessageTypeEnum.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/enums/MessageTypeEnum.java new file mode 100644 index 0000000..e4f775d --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/enums/MessageTypeEnum.java @@ -0,0 +1,84 @@ +package com.yunzhupaas.message.enums; + +/** + * 消息类型枚举 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021/4/23 17:45 + */ +public enum MessageTypeEnum { + /** + * 站内消息 + */ + SysMessage("1", "站内消息"), + /** + * 发送邮件 + */ + MailMessage("2", "发送邮件"), + /** + * 发送短信 + */ + SmsMessage("3", "发送短信"), + /** + * 钉钉消息 + */ + DingMessage("4", "发送钉钉消息"), + /** + * 企业微信 + */ + QyMessage("5", "发送企业微信消息"), + /** + * webhook + */ + WebHookMessage("6", "发送webhook消息"), + /** + * 微信公众号 + */ + WechatMessage("7", "发送微信公众号消息"); + + /** + * 为防止与系统后续更新的功能的消息类型code冲突,客户自定义添加的消息类型code请以ZDY开头。例如:ZDY1 + */ + + + private String code; + private String message; + + MessageTypeEnum(String code, String message) { + this.code = code; + this.message = message; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + /** + * 根据状态code获取枚举值 + * + * @return + */ + public static MessageTypeEnum getByCode(String code) { + for (MessageTypeEnum status : MessageTypeEnum.values()) { + if (status.getCode().equals(code)) { + return status; + } + } + return null; + } +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/ImReplyListModel.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/ImReplyListModel.java new file mode 100644 index 0000000..9ef6955 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/ImReplyListModel.java @@ -0,0 +1,79 @@ +package com.yunzhupaas.message.model; + +import lombok.Data; + +import java.util.Date; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-05-31 + */ +@Data +public class ImReplyListModel { + /** + * id + */ + private String id; + + /** + * 名称 + */ + private String realName; + + /** + * 头像 + */ + private String headIcon; + + /** + * 最新消息 + */ + private String latestMessage; + + /** + * 最新时间 + */ + private Date latestDate; + + /** + * 未读消息 + */ + private Integer unreadMessage; + + /** + * 消息类型 + */ + private String messageType; + + /** + * 账号 + */ + private String account; + + /** + * UserId + */ + private String userId; + + /** + * sendDeleteMark + */ + private String sendDeleteMark; + + /** + * imreplySendDeleteMark + */ + private String imreplySendDeleteMark; + + /** + * deleteMark + */ + private int deleteMark; + + private String deleteUserId; + + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/ImReplyListVo.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/ImReplyListVo.java new file mode 100644 index 0000000..02269cf --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/ImReplyListVo.java @@ -0,0 +1,67 @@ +package com.yunzhupaas.message.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * 消息会话列表 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-05-29 + */ +@Data +public class ImReplyListVo { + /** + * id + */ + @Schema(description = "id") + private String id; + + /** + * 名称 + */ + @Schema(description = "名称") + private String realName; + + /** + * 头像 + */ + @Schema(description = "头像") + private String headIcon; + + /** + * 最新消息 + */ + @Schema(description = "最新消息") + private String latestMessage; + + /** + * 最新时间 + */ + @Schema(description = "最新时间") + private Long latestDate; + + /** + * 未读消息 + */ + @Schema(description = "未读消息") + private Integer unreadMessage; + + /** + * 消息类型 + */ + @Schema(description = "消息类型") + private String messageType; + + /** + * Account + */ + @Schema(description = "Account") + private String account; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/ImReplySavaModel.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/ImReplySavaModel.java new file mode 100644 index 0000000..4d5310d --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/ImReplySavaModel.java @@ -0,0 +1,28 @@ +package com.yunzhupaas.message.model; + +import lombok.Data; + +import java.util.Date; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-05-29 + */ +@Data +public class ImReplySavaModel { + + private String userId; + + private String receiveUserId; + + private Date receiveTime; + + public ImReplySavaModel(String userId, String receiveUserId, Date receiveTime) { + this.userId = userId; + this.receiveUserId = receiveUserId; + this.receiveTime = receiveTime; + } +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/ImUnreadNumModel.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/ImUnreadNumModel.java new file mode 100644 index 0000000..32c5b36 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/ImUnreadNumModel.java @@ -0,0 +1,45 @@ +package com.yunzhupaas.message.model; + +import lombok.Data; + +/** + * 未读消息模型 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +@Data +public class ImUnreadNumModel { + /** + * 发送者Id + */ + private String sendUserId; + + /** + * 租户id + */ + private String tenantId; + + /** + * 未读数量 + */ + private int unreadNum; + + /** + * 默认消息 + */ + private String defaultMessage; + + /** + * 默认消息类型 + */ + private String defaultMessageType; + + /** + * 默认消息时间 + */ + private String defaultMessageTime; +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/NoticeModel.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/NoticeModel.java new file mode 100644 index 0000000..a7c0c87 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/NoticeModel.java @@ -0,0 +1,12 @@ +package com.yunzhupaas.message.model; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class NoticeModel implements Serializable { + private List typeList; +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/NoticePagination.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/NoticePagination.java new file mode 100644 index 0000000..f7efcde --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/NoticePagination.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.message.model; + +import com.yunzhupaas.base.Pagination; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * 分页模型 + */ +@Data +public class NoticePagination extends Pagination { + @Schema(description = "类型") + private List type; + @Schema(description = "状态") + private List enabledMark; + @Schema(description = "创建人") + private List creatorUser; + @Schema(description = "发布人") + private List releaseUser; + @Schema(description = "发布时间") + private List releaseTime; + @Schema(description = "创建时间") + private List creatorTime; + @Schema(description = "过期时间") + private List expirationTime; +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/SentMessageForm.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/SentMessageForm.java new file mode 100644 index 0000000..f6fd72d --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/SentMessageForm.java @@ -0,0 +1,84 @@ +package com.yunzhupaas.message.model; + +import com.yunzhupaas.base.UserInfo; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import java.util.List; +import java.util.Map; + +/** + * 消息模型 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021/4/20 11:44 + */ +@Data +public class SentMessageForm { + /** + * 接收人员用户ID组 + */ + private List toUserIds; + + /** + * 消息模板Id + */ + private String templateId; + + /** + * 内容 + */ + private String content; + + /** + * 参数 + */ + private Map parameterMap; + + /** + * 是否发送站内信 + */ + private boolean sysMessage; + + /** + * 站内信 + */ + private String title; + + /** + * 流程信息 + */ + private String flowName; + + /** + * 发起人 + */ + private String userName; + + /** + * 站内信 + */ + private Map contentMsg; + + /** + * 用户信息 + */ + private UserInfo userInfo; + + /** + * 消息类别 + */ + private Integer type; + + /** + * 流程类型(1:审批 2:委托) + */ + private Integer flowType = 1; + + /** + * 消息类别 + */ + private String id; +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/UserOnlineModel.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/UserOnlineModel.java new file mode 100644 index 0000000..a917258 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/UserOnlineModel.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.message.model; + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class UserOnlineModel { + private String userId; + private String userAccount; + private String userName; + private String loginTime; + private String loginIPAddress; + private String loginSystem; + private String tenantId; + private String token; + private String device; + private String organize; + private String loginBrowser; + private String loginAddress; +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/UserOnlineVO.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/UserOnlineVO.java new file mode 100644 index 0000000..f298a7e --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/UserOnlineVO.java @@ -0,0 +1,28 @@ +package com.yunzhupaas.message.model; + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class UserOnlineVO { + private String userId; + private String userName; + private String loginTime; + private String loginIPAddress; + private String loginSystem; + @Schema(description = "所属组织") + private String organize; + @Schema(description = "浏览器") + private String loginBrowser; + @Schema(description = "登录地址") + private String loginAddress; +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/WxgzhMessageModel.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/WxgzhMessageModel.java new file mode 100644 index 0000000..44267d4 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/WxgzhMessageModel.java @@ -0,0 +1,28 @@ +package com.yunzhupaas.message.model; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; + +import java.io.Serializable; + +/** + */ +@Data +public class WxgzhMessageModel implements Serializable { + //模板ID + @JSONField(name = "template_id") + private String templateId; + //模板标题 + private String title; + //模板所属行业的一级行业 + @JSONField(name = "primary_industry") + private String primaryIndustry; + //模板所属行业的二级行业 + @JSONField(name = "deputy_industry") + private String deputyIndustry; + //模板内容 + private String content; + //模板示例 + private String example; +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/accountconfig/AccountConfigForm.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/accountconfig/AccountConfigForm.java new file mode 100644 index 0000000..e372357 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/accountconfig/AccountConfigForm.java @@ -0,0 +1,208 @@ +package com.yunzhupaas.message.model.accountconfig; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import java.util.List; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; + +/** + * + * + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-08-18 + */ +@Data +public class AccountConfigForm { + /** 主键 */ + @Schema(description = "主键") + private String id; + /** 名称 **/ + @Schema(description = "名称") + @JsonProperty("fullName") + private String fullName; + + /** 配置类型 **/ + @Schema(description = "配置类型") + @JsonProperty("type") + private String type; + + /** 编码 **/ + @Schema(description = "编码") + @JsonProperty("enCode") + private String enCode; + + /** 发件人昵称 **/ + @Schema(description = "发件人昵称") + @JsonProperty("addressorName") + private String addressorName; + +// /** 发件人邮箱 **/ +// @JsonProperty("sendEmail") +// private String sendEmail; + + /** SMTP服务器 **/ + @Schema(description = "SMTP服务器") + @JsonProperty("smtpServer") + private String smtpServer; + + /** SMTP端口 **/ + @Schema(description = "SMTP端口") + @JsonProperty("smtpPort") + private Integer smtpPort; + + /** SSL安全链接 **/ + @Schema(description = "SSL安全链接") + @JsonProperty("sslLink") + private Integer sslLink; + + /** SMTP用户名 **/ + @Schema(description = "SMTP用户名") + @JsonProperty("smtpUser") + private String smtpUser; + + /** SMTP密码 **/ + @Schema(description = "SMTP密码") + @JsonProperty("smtpPassword") + private String smtpPassword; + + /** 渠道 **/ + @Schema(description = "渠道") + @JsonProperty("channel") + private Integer channel; + + /** 短信签名 **/ + @Schema(description = "短信签名") + @JsonProperty("smsSignature") + private String smsSignature; + + /** 应用ID **/ + @Schema(description = "应用ID") + @JsonProperty("appId") + private String appId; + + /** 应用Secret **/ + @Schema(description = "应用Secret") + @JsonProperty("appSecret") + private String appSecret; + + /** EndPoint(阿里云) **/ + @Schema(description = "EndPoint(阿里云)") + @JsonProperty("endPoint") + private String endPoint; + + /** SDK AppID(腾讯云) **/ + @Schema(description = "SDK AppID(腾讯云)") + @JsonProperty("sdkAppId") + private String sdkAppId; + + /** AppKey(腾讯云) **/ + @Schema(description = "AppKey(腾讯云)") + @JsonProperty("appKey") + private String appKey; + + /** 地域域名(腾讯云) **/ + @Schema(description = "地域域名(腾讯云)") + @JsonProperty("zoneName") + private String zoneName; + + /** 地域参数(腾讯云) **/ + @Schema(description = "地域参数(腾讯云)") + @JsonProperty("zoneParam") + private String zoneParam; + + /** 企业id **/ + @Schema(description = "企业id") + @JsonProperty("enterpriseId") + private String enterpriseId; + + /** AgentID **/ + @Schema(description = "AgentID") + @JsonProperty("agentId") + private String agentId; + + /** WebHook类型 **/ + @Schema(description = "WebHook类型") + @JsonProperty("webhookType") + private Integer webhookType; + + /** WebHook地址 **/ + @Schema(description = "WebHook地址") + @JsonProperty("webhookAddress") + private String webhookAddress; + + /** 认证类型 **/ + @Schema(description = "认证类型") + @JsonProperty("approveType") + private Integer approveType; + + /** bearer令牌 **/ + @Schema(description = "bearer令牌") + @JsonProperty("bearer") + private String bearer; + + /** 用户名(基本认证) **/ + @Schema(description = "用户名(基本认证)") + @JsonProperty("userName") + private String userName; + + /** 密码(基本认证) **/ + @Schema(description = "密码(基本认证)") + @JsonProperty("password") + private String password; + + /** 排序 **/ + @Schema(description = "排序") + @JsonProperty("sortCode") + private Integer sortCode; + + /** 状态 **/ + @Schema(description = "状态") + @JsonProperty("enabledMark") + private Integer enabledMark; + + /** 说明 **/ + @Schema(description = "说明") + @JsonProperty("description") + private String description; + +// /** 创建时间 **/ +// @JsonProperty("creatorTime") +// private String creatorTime; +// +// /** 创建用户 **/ +// @JsonProperty("creatorUserId") +// private String creatorUserId; +// +// /** 修改时间 **/ +// @JsonProperty("lastModifyTime") +// private String lastModifyTime; +// +// /** 修改用户 **/ +// @JsonProperty("lastModifyUserId") +// private String lastModifyUserId; + + /** + * 邮件内容 + */ + @Schema(description = "邮件内容") + private String testEmailContent; + + /** + * 收件人 + */ + @Schema(description = "收件人") + private List testSendEmail; + + /** + * 邮箱标题 + */ + @Schema(description = "邮箱标题") + private String testEmailTitle; + + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/accountconfig/AccountConfigInfoVO.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/accountconfig/AccountConfigInfoVO.java new file mode 100644 index 0000000..b37e19f --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/accountconfig/AccountConfigInfoVO.java @@ -0,0 +1,171 @@ +package com.yunzhupaas.message.model.accountconfig; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonProperty; +/** + * + * + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-08-18 + */ +@Data +public class AccountConfigInfoVO{ + /** 主键 **/ + @Schema(description = "主键") + @JsonProperty("id") + private String id; + + /** 名称 **/ + @Schema(description = "名称") + @JsonProperty("fullName") + private String fullName; + + /** 配置类型 **/ + @Schema(description = "配置类型") + @JsonProperty("type") + private String type; + + /** 编码 **/ + @Schema(description = "编码") + @JsonProperty("enCode") + private String enCode; + + /** 发件人昵称 **/ + @Schema(description = "发件人昵称") + @JsonProperty("addressorName") + private String addressorName; + +// /** 发件人邮箱 **/ +// @JsonProperty("sendEmail") +// private String sendEmail; + + /** SMTP服务器 **/ + @Schema(description = "SMTP服务器") + @JsonProperty("smtpServer") + private String smtpServer; + + /** SMTP端口 **/ + @Schema(description = "SMTP端口") + @JsonProperty("smtpPort") + private Integer smtpPort; + + /** SSL安全链接 **/ + @Schema(description = "SSL安全链接") + @JsonProperty("sslLink") + private Integer sslLink; + + /** SMTP用户名 **/ + @Schema(description = "SMTP用户名") + @JsonProperty("smtpUser") + private String smtpUser; + + /** SMTP密码 **/ + @Schema(description = "SMTP密码") + @JsonProperty("smtpPassword") + private String smtpPassword; + + /** 渠道 **/ + @Schema(description = "渠道") + @JsonProperty("channel") + private Integer channel; + + /** 短信签名 **/ + @Schema(description = "短信签名") + @JsonProperty("smsSignature") + private String smsSignature; + + /** 应用ID **/ + @Schema(description = "应用ID") + @JsonProperty("appId") + private String appId; + + /** 应用Secret **/ + @Schema(description = "应用Secret") + @JsonProperty("appSecret") + private String appSecret; + + /** EndPoint(阿里云) **/ + @Schema(description = "EndPoint(阿里云)") + @JsonProperty("endPoint") + private String endpoint; + + /** SDK AppID(腾讯云) **/ + @Schema(description = "SDK AppID(腾讯云)") + @JsonProperty("sdkAppId") + private String sdkAppId; + + /** AppKey(腾讯云) **/ + @Schema(description = "AppKey(腾讯云)") + @JsonProperty("appKey") + private String appKey; + + /** 地域域名(腾讯云) **/ + @Schema(description = "地域域名(腾讯云)") + @JsonProperty("zoneName") + private String zoneName; + + /** 地域参数(腾讯云) **/ + @Schema(description = "地域参数(腾讯云)") + @JsonProperty("zoneParam") + private String zoneParam; + + /** 企业id **/ + @Schema(description = "企业id") + @JsonProperty("enterpriseId") + private String enterpriseId; + + /** AgentID **/ + @Schema(description = "AgentID") + @JsonProperty("agentId") + private String agentId; + + /** WebHook类型 **/ + @Schema(description = "WebHook类型") + @JsonProperty("webhookType") + private String webhookType; + + /** WebHook地址 **/ + @Schema(description = "WebHook地址") + @JsonProperty("webhookAddress") + private String webhookAddress; + + /** 认证类型 **/ + @Schema(description = "认证类型") + @JsonProperty("approveType") + private String approveType; + + /** bearer令牌 **/ + @Schema(description = "bearer令牌") + @JsonProperty("bearer") + private String bearer; + + /** 用户名(基本认证) **/ + @Schema(description = "用户名(基本认证)") + @JsonProperty("userName") + private String userName; + + /** 密码(基本认证) **/ + @Schema(description = "密码(基本认证)") + @JsonProperty("password") + private String password; + + /** 排序 **/ + @Schema(description = "排序") + @JsonProperty("sortCode") + private Integer sortCode; + + /** 状态 **/ + @Schema(description = "状态") + @JsonProperty("enabledMark") + private Integer enabledMark; + + /** 说明 **/ + @Schema(description = "说明") + @JsonProperty("description") + private String description; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/accountconfig/AccountConfigListVO.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/accountconfig/AccountConfigListVO.java new file mode 100644 index 0000000..d40366a --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/accountconfig/AccountConfigListVO.java @@ -0,0 +1,102 @@ +package com.yunzhupaas.message.model.accountconfig; + + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import java.util.Date; +import com.alibaba.fastjson.annotation.JSONField; +/** + * + * + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-08-18 + */ +@Data +public class AccountConfigListVO{ + + @Schema(description = "id") + private String id; + + /** 名称 **/ + @Schema(description = "名称") + @JSONField(name = "fullName") + private String fullName; + + /** 配置类型 **/ + @Schema(description = "配置类型") + @JSONField(name = "type") + private String type; + + /** 编码 **/ + @Schema(description = "编码") + @JSONField(name = "enCode") + private String enCode; + + /** 发件人昵称 **/ + @Schema(description = "发件人昵称") + @JSONField(name = "addressorName") + private String addressorName; + +// /** 发件人邮箱 **/ +// @JSONField(name = "sendEmail") +// private String sendEmail; + + + /** SMTP用户名 **/ + @Schema(description = "SMTP用户名") + @JSONField(name = "smtpUser") + private String smtpUser; +// +// /** SMTP密码 **/ +// @JSONField(name = "smtpPassword") +// private String smtpPassword; + + /** 渠道 **/ + @Schema(description = "渠道") + @JSONField(name = "channel") + private String channel; + + /** 短信签名 **/ + @Schema(description = "短信签名") + @JSONField(name = "smsSignature") + private String smsSignature; + + + /** WebHook类型 **/ + @Schema(description = "WebHook类型") + @JSONField(name = "webhookType") + private String webhookType; + + /** 排序 **/ + @Schema(description = "排序") + @JSONField(name = "sortCode") + private Integer sortCode; + /** 状态 **/ + @Schema(description = "状态") + @JSONField(name = "enabledMark") + private String enabledMark; + + + /** 创建时间 **/ + @Schema(description = "创建时间") + @JSONField(name = "creatorTime") + private Date creatorTime; + + /** 创建用户 **/ + @Schema(description = "创建用户") + @JSONField(name = "creatorUserId") + private String creatorUserId; + + /** 修改时间 **/ + @Schema(description = "修改时间") + @JSONField(name = "lastModifyTime") + private Date lastModifyTime; + + @Schema(description = "创建人") + private String creatorUser; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/accountconfig/AccountConfigPagination.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/accountconfig/AccountConfigPagination.java new file mode 100644 index 0000000..e706368 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/accountconfig/AccountConfigPagination.java @@ -0,0 +1,76 @@ +package com.yunzhupaas.message.model.accountconfig; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import com.yunzhupaas.base.Pagination; + +import java.util.List; + +/** + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-08-18 + */ +@Data +public class AccountConfigPagination extends Pagination { + + /** + * selectKey + */ + @Schema(description = "selectKey") + private String selectKey; + + @Schema(description = "json") + private String json; + + /** + * 类型 + */ + @Schema(description = "类型") + private String dataType; + + /** + * 特别查询Json + */ + @Schema(description = "特别查询Json") + private String superQueryJson; + + /** + * WebHook类型 + */ + @Schema(description = "WebHook类型") + private Integer webhookType; + + /** + * 渠道 + */ + @Schema(description = "渠道") + private Integer channel; + + /** + * 配置类型(2:邮箱,3:短信,4:钉钉,5:企业,6:飞书,7:webhook) + */ + @Schema(description = "配置类型(2:邮箱,3:短信,4:钉钉,5:企业,6:飞书,7:webhook)") + private String type; + + /** + * 状态 + */ + @Schema(description = "状态") + private String enabledMark; + + /** + * 关键字 + **/ + @Schema(description = "关键字") + private String keyword; + + /** + * 菜单id + */ + @Schema(description = "菜单id") + private String menuId; +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/DingTalkDeptModel.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/DingTalkDeptModel.java new file mode 100644 index 0000000..2531a5b --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/DingTalkDeptModel.java @@ -0,0 +1,144 @@ +package com.yunzhupaas.message.model.message; + +import com.baomidou.mybatisplus.annotation.TableField; +import lombok.Data; + +/** + * 钉钉的部门模型 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021/5/6 9:28 + */ +@Data +public class DingTalkDeptModel { + /** + * 部门ID + */ + @TableField("dept_id") + private Long deptId; + + /** + * 上级部门(必填项) + */ + @TableField("parent_id") + private Long parentId; + + /** + * 部门名称(必填项) + */ + @TableField("name") + private String name; + + /** + * 是否隐藏本部门 false(默认值) + */ + @TableField("hide_dept") + private Boolean hideDept; + + /** + * 指定可以查看本部门的其他部门列表,总数不能超过200 + * 当hide_dept为true时,则此值生效 + */ + @TableField("dept_permits") + private String deptPermits; + + /** + * 指定可以查看本部门的人员userid列表,总数不能超过200 + * 当hide_dept为true时,则此值生效 + */ + @TableField("user_permits") + private String userPermits; + + /** + * 是否限制本部门成员查看通讯录 false(默认值) + */ + @TableField("outer_dept") + private Boolean outerDept; + + /** + * 本部门成员是否只能看到所在部门及下级部门通讯录: + * true:只能看到所在部门及下级部门通讯录 + * false:不能查看所有通讯录,在通讯录中仅能看到自己 + * 当outer_dept为true时,此参数生效 + */ + @TableField("outer_dept_only_self") + private Boolean outerDeptOnlySelf; + + /** + * 指定本部门成员可查看的通讯录用户userid列表,总数不能超过200。 + * 当outer_dept为true时,此参数生效 + */ + @TableField("outer_permit_users") + private String outerPermitUsers; + + /** + * 指定本部门成员可查看的通讯录部门ID列表,总数不能超过200 + * 当outer_dept为true时,此参数生效 + */ + @TableField("outer_permit_depts") + private String outerPermitDepts; + + /** + * 是否创建一个关联此部门的企业群,默认为false即不创建 + */ + @TableField("create_dept_group") + private Boolean createDeptGroup; + + /** + * 在父部门中的排序值,order值小的排序靠前 + */ + @TableField("order") + private Long order; + + /** + * 部门标识字段,开发者可用该字段来唯一标识一个部门,并与钉钉外部通讯录里的部门做映射 + */ + @TableField("source_identifier") + private String sourceIdentifier; + + /** + * 扩展属性,Json格式 + */ + @TableField("extension") + private String extension; + + /** + * 当部门群已经创建后,有新人加入部门时是否会自动加入该群 + */ + @TableField("auto_add_user") + private Boolean autoAddUser; + + /** + * 部门的主管userid列表 + */ + @TableField("dept_manager_userid_list") + private String deptManagerUseridList; + + /** + * 部门群是否包含子部门(没什么用) + */ + @TableField("group_contain_sub_dept") + private Boolean groupContainSubDept; + + /** + * 部门群是否包含外包部门(没什么用) + */ + @TableField("group_contain_outer_dept") + private Boolean groupContainOuterDept; + + /** + * 部门群是否包含隐藏部门(没什么用) + */ + @TableField("group_contain_hidden_dept") + private Boolean groupContainHiddenDept; + + /** + * 企业群群主的userid(没什么用) + */ + @TableField("org_dept_owner") + private String orgDeptOwner; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/DingTalkModel.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/DingTalkModel.java new file mode 100644 index 0000000..285b746 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/DingTalkModel.java @@ -0,0 +1,23 @@ +package com.yunzhupaas.message.model.message; + +import lombok.Data; + +import jakarta.validation.constraints.NotBlank; + +/** + * 钉钉发送信息配置模型 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021/4/22 14:12 + */ +@Data +public class DingTalkModel { + @NotBlank(message = "应用凭证必填") + private String dingSynAppKey; + @NotBlank(message = "凭证密钥必填") + private String dingSynAppSecret; + private String dingAgentId; +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/DingTalkUserModel.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/DingTalkUserModel.java new file mode 100644 index 0000000..32f67cc --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/DingTalkUserModel.java @@ -0,0 +1,163 @@ +package com.yunzhupaas.message.model.message; + +import com.baomidou.mybatisplus.annotation.TableField; +import lombok.Data; + + +/** + * 钉钉的用户模型 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021/5/6 9:29 + */ +@Data +public class DingTalkUserModel { + /** + * 员工唯一标识ID(不可修改),企业内必须唯一 + * 长度为1~64个字符,如果不传,将自动生成一个userid + */ + @TableField("userid") + private String userid; + + /** + *员工名称,长度最大80个字符 (必填项) + */ + @TableField("name") + private String name; + + /** + * 手机号码,企业内必须唯一,不可重复 + * 如果是国际号码,请使用+xx-xxxxxx的格式 + */ + @TableField("mobile") + private String mobile; + + /** + * 是否号码隐藏 通常不隐藏:false + */ + @TableField("hide_mobile") + private Boolean hideMobile; + + + /** + * 分机号,长度最大50个字符 + * 企业内必须唯一,不可重复 + */ + @TableField("telephone") + private String telephone; + + /** + * 员工工号,长度最大为50个字符 + */ + @TableField("job_number") + private String jobNumber; + + /** + * 职位,长度最大为200个字符 + */ + @TableField("title") + private String title; + + /** + * 员工邮箱,长度最大50个字符。企业内必须唯一,不可重复 + */ + @TableField("email") + private String email; + + /** + * 员工的企业邮箱,长度最大100个字符 + * 员工的企业邮箱已开通,才能增加此字段,通常不用 + */ + @TableField("org_email") + private String orgEmail; + + /** + * 办公地点,长度最大100个字符 + */ + @TableField("work_place") + private String workPlace; + + /** + * 备注,长度最大2000个字符 + */ + @TableField("remark") + private String remark; + + /** + * 所属部门id列表,如:"2,3,4" + */ + @TableField("dept_id_list") + private String deptIdList; + + /** + * 员工在对应的部门中的排序 DeptOrder[] + */ + @TableField("dept_order_list") + private String deptOrderList; + + /** + * 员工在对应的部门中的职位 DeptTitle[] + */ + @TableField("dept_title_list") + private String deptTitleList; + + + /** + * 扩展属性,可以设置多种属性,最大长度2000个字符 + * 格式:{"爱好":"旅游","年龄":"24"} + */ + @TableField("extension") + private String extension; + + /** + * 是否开启高管模式 + * true:开启 + * 开启后,手机号码对所有员工隐藏。普通员工无法对其发DING、发起钉钉免费商务电话。高管之间不受影响。 + * false:不开启 + */ + @TableField("senior_mode") + private Boolean seniorMode; + + /** + * 入职时间,Unix时间戳,单位毫秒 + */ + @TableField("hired_date") + private Long hiredDate; + + /** + * 登录邮箱 + */ + @TableField("login_email") + private String loginEmail; + + /** + * 是否专属帐号 + * 为true时,不能指定loginEmail或mobile + */ + @TableField("exclusive_account") + private Boolean exclusiveAccount; + + /** + * 专属帐号类型: + * sso:企业自建专属帐号 + * dingtalk:钉钉自建专属帐号 + */ + @TableField("exclusive_account_type") + private String exclusiveAccountType; + + /** + * 钉钉专属帐号登录名 + */ + @TableField("login_id") + private String loginId; + + /** + * 钉钉专属帐号初始密码 + */ + @TableField("init_password") + private String initPassword; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/EmailModel.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/EmailModel.java new file mode 100644 index 0000000..6475d85 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/EmailModel.java @@ -0,0 +1,28 @@ +package com.yunzhupaas.message.model.message; + +import lombok.Data; + +/** + * 发送邮件配置模型 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021/4/20 14:27 + */ +@Data +public class EmailModel { + private String emailPop3Host; + private String emailPop3Port; + private String emailSmtpHost; + private String emailSmtpPort; + private String emailSenderName; + private String emailAccount; + private String emailPassword; + private String emailSsl; + + private String emailToUsers; + private String emailContent; + private String emailTitle; +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/MessageInfoVO.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/MessageInfoVO.java new file mode 100644 index 0000000..94ee9c4 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/MessageInfoVO.java @@ -0,0 +1,49 @@ +package com.yunzhupaas.message.model.message; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class MessageInfoVO { + + @Schema(description = "主键") + private String id; + @Schema(description = "标题") + private String title; + @Schema(description = "类型") + private Integer type; + @Schema(description = "修改时间") + private long lastModifyTime; + @Schema(description = "创建用户") + private String creatorUser; + @Schema(description = "是否已读") + private Integer isRead; + + @Schema(description = "有效标志") + private Integer enabledMark; + + /** + * 发布人员 + */ + @Schema(description = "发布人员") + private String releaseUser; + + /** + * 发布时间 + */ + @Schema(description = "发布时间") + private Long releaseTime; + + @Schema(description = "修改用户") + private String lastModifyUserId; + @Schema(description = "流程类型") + private Integer flowType; +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/MessageNoticeVO.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/MessageNoticeVO.java new file mode 100644 index 0000000..cf1290a --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/MessageNoticeVO.java @@ -0,0 +1,59 @@ +package com.yunzhupaas.message.model.message; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class MessageNoticeVO { + @Schema(description = "id") + private String id; + @Schema(description = "标题") + private String title; + + @Schema(description = "创建人员") + private String creatorUser; + + @Schema(description = "发布时间",example = "1") + private Long lastModifyTime; + + @Schema(description = "状态(0-存草稿,1-已发布,2-已过期)",example = "1") + private Integer enabledMark; + + @Schema(description = "创建时间") + private Long creatorTime; + + /** + * 发布人员 + */ + @Schema(description = "发布人员") + private String releaseUser; + + /** + * 发布时间 + */ + @Schema(description = "发布时间") + private Long releaseTime; + + @Schema(description = "修改用户") + private String lastModifyUserId; + + @Schema(description = "类型") + private Long expirationTime; + + @Schema(description = "摘要") + private String excerpt; + + /** + * 分类 1-公告 2-通知 + */ + @Schema(description = "分类") + private String category; +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/MessageRecordForm.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/MessageRecordForm.java new file mode 100644 index 0000000..243a2f6 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/MessageRecordForm.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.message.model.message; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class MessageRecordForm { + @Schema(description = "id集合") + private String ids; +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/NoticeCrForm.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/NoticeCrForm.java new file mode 100644 index 0000000..0c86852 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/NoticeCrForm.java @@ -0,0 +1,40 @@ +package com.yunzhupaas.message.model.message; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import jakarta.validation.constraints.NotBlank; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class NoticeCrForm { + @Schema(description = "内容") + private String bodyText; + @NotBlank(message = "必填") + @Schema(description = "标题") + private String title; + @Schema(description = "接收人") + private String toUserIds; + @Schema(description = "附件") + private String files; + + @Schema(description = "封面图片") + private String coverImage; + @Schema(description = "过期时间") + private Long expirationTime; + @Schema(description = "分类") + private String category; + @Schema(description = "提醒方式") + private Integer remindCategory; + @Schema(description = "发送配置") + private String sendConfigId; + + @Schema(description = "摘要") + private String excerpt; +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/NoticeInfoVO.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/NoticeInfoVO.java new file mode 100644 index 0000000..c98af27 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/NoticeInfoVO.java @@ -0,0 +1,62 @@ +package com.yunzhupaas.message.model.message; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class NoticeInfoVO { + @Schema(description = "主键") + private String id; + @Schema(description = "标题") + private String title; + @Schema(description = "内容") + private String bodyText; + @Schema(description = "创建用户") + private String creatorUser; + @Schema(description = "修改时间") + private Long lastModifyTime; + @Schema(description = "接收人id集合") + private String toUserIds; + + @Schema(description = "文件") + private String files; + + /** + * 发布人员 + */ + @Schema(description = "发布人员") + private String releaseUser; + + /** + * 发布时间 + */ + @Schema(description = "发布时间") + private Long releaseTime; + + @Schema(description = "封面图片") + private String coverImage; + @Schema(description = "过期时间") + private Long expirationTime; + @Schema(description = "分类") + private String category; + @Schema(description = "提醒方式") + private Integer remindCategory; + @Schema(description = "发送配置") + private String sendConfigId; + + @Schema(description = "摘要") + private String excerpt; + + /** + * 流程类型(1:审批 2:委托) + */ + private Integer flowType; +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/NoticeUpForm.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/NoticeUpForm.java new file mode 100644 index 0000000..b3f42ac --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/NoticeUpForm.java @@ -0,0 +1,15 @@ +package com.yunzhupaas.message.model.message; + +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class NoticeUpForm extends NoticeCrForm { +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/NoticeVO.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/NoticeVO.java new file mode 100644 index 0000000..e9317dc --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/NoticeVO.java @@ -0,0 +1,50 @@ +package com.yunzhupaas.message.model.message; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class NoticeVO { + private String id; + @JSONField(name="title") + private String fullName; + private Long creatorTime; + @Schema(description = "创建用户") + private String creatorUser; + + /** + * 发布人员 + */ + @Schema(description = "发布人员") + private String releaseUser; + + /** + * 发布时间 + */ + @Schema(description = "发布时间") + private Long releaseTime; + + /** + * 消息类型 + */ + @Schema(description ="分类") + private String category; + + @Schema(description = "封面图片") + private String coverImage; + + @Schema(description = "摘要") + private String excerpt; + + @JsonIgnore + @Schema(description = "修改时间") + private Long lastModifyTime; + + @JsonIgnore + @Schema(description = "修改用户") + private String lastModifyUserId; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/OraganizeListVO.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/OraganizeListVO.java new file mode 100644 index 0000000..a233d00 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/OraganizeListVO.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.message.model.message; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class OraganizeListVO { + @Schema(description = "主键") + private String id; + @Schema(description = "父主键") + private String parentId; + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "备注") + private String description; + @Schema(description = "状态") + private int enabledMark; + private Long creatorTime; + @Schema(description = "是否有下级菜单") + private boolean hasChildren = true; + @Schema(description = "下级菜单列表") + private List children = new ArrayList<>(); + @Schema(description = "排序") + private Long sortCode; +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/PaginationMessage.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/PaginationMessage.java new file mode 100644 index 0000000..62e1f50 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/PaginationMessage.java @@ -0,0 +1,36 @@ +package com.yunzhupaas.message.model.message; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class PaginationMessage extends Pagination { + /** + * 类型 + */ + @Schema(description = "类型") + private Integer type; + + /** + * 是否已读 + */ + @Schema(description = "是否已读") + private Integer isRead; + + + /** + * 所属用户 + */ + @Schema(description = "所属用户") + private String userId; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/QyWebChatDeptModel.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/QyWebChatDeptModel.java new file mode 100644 index 0000000..e772014 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/QyWebChatDeptModel.java @@ -0,0 +1,36 @@ +package com.yunzhupaas.message.model.message; + +import lombok.Data; + +/** + * 企业微信获取部门的对象模型 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021/4/25 11:10 + */ +@Data +public class QyWebChatDeptModel { + /** + * 部门ID + */ + private Integer id; + /** + * 部门中文名称 + */ + private String name; + /** + * 部门英文名称 + */ + private String name_en; + /** + * 部门的上级部门 + */ + private Integer parentid; + /** + * 部门排序 + */ + private Integer order; +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/QyWebChatUserModel.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/QyWebChatUserModel.java new file mode 100644 index 0000000..fa26c14 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/QyWebChatUserModel.java @@ -0,0 +1,116 @@ +package com.yunzhupaas.message.model.message; + +import lombok.Data; + +import java.util.LinkedList; +import java.util.List; + +/** + * 企业微信获取成员的对象模型 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021/4/25 16:29 + */ +@Data +public class QyWebChatUserModel { + /** + * 执行返回执行代码 + */ + private String errcode; + /** + * 执行返回执行消息 + */ + private String errmsg; + /** + * 用户ID + */ + private String userid; + /** + * 用户名称 + */ + private String name; + /** + * 成员别名 + */ + private String alias; + /** + * 手机号码。企业内必须唯一,mobile/email二者不能同时为空 + */ + private String mobile; + /** + * 成员所属部门id列表,不超过100个 + */ + private List department; + /** + * 部门内的排序值,默认为0,成员次序以创建时间从小到大排列 + * 个数必须和参数department的个数一致,数值越大排序越前面 + */ + private String order; + /** + * 职务信息 + */ + private String position; + /** + * 性别。1表示男性,2表示女性 + */ + private String gender; + /** + * 邮箱。长度6~64个字节,且为有效的email格式。 + * 企业内必须唯一,mobile/email二者不能同时为空 + */ + private String email; + /** + * 座机。32字节以内,由纯数字或’-‘号组成。 + */ + private String telephone; + /** + * 个数必须和参数department的个数一致,表示在所在的部门内是否为上级。1表示为上级,0表示非上级。 + * 在审批等应用里可以用来标识上级审批人 + */ + private String is_leader_in_dept; + /** + * 成员头像的mediaid,通过素材管理接口上传图片获得的mediaid + */ + private String avatar_mediaid; + /** + * 启用/禁用成员。1表示启用成员,0表示禁用成员 + */ + private String enable; + /** + * 激活状态: 1=已激活,2=已禁用,4=未激活,5=退出企业。 + */ + private Integer status; + /** + * 自定义字段 + */ + private String extattr; + /** + * 是否邀请该成员使用企业微信(将通过微信服务通知或短信或邮件下发邀请,每天自动下发一次,最多持续3个工作日),默认值为true。 + */ + private boolean to_invite; + /** + * 成员对外属性 + */ + private String external_profile; + /** + * 对外职务,如果设置了该值,则以此作为对外展示的职务,否则以position来展示。 + * 长度12个汉字内 + */ + private String external_position; + /** + * 地址 + */ + private String address; + /** + * 主部门 + */ + private String main_department; + + /** + * 部门列表 + */ + private LinkedList deptIdList; +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/SynThirdInfoCrForm.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/SynThirdInfoCrForm.java new file mode 100644 index 0000000..dd52073 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/SynThirdInfoCrForm.java @@ -0,0 +1,79 @@ +package com.yunzhupaas.message.model.message; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 第三方工具的对象同步表 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021/4/25 9:35 + */ +@Data +public class SynThirdInfoCrForm { + + /** + * 第三方类型(1:企业微信;2:钉钉) + */ + @Schema(description = "第三方类型(1:企业微信;2:钉钉)") + private Integer thirdtype; + + /** + * 数据类型(1:公司;2:部门;3:用户) + */ + @Schema(description = "数据类型(1:公司;2:部门;3:用户)") + private Integer datatype; + + /** + * 本地对象ID(公司ID、部门ID、用户ID) + */ + @Schema(description = "本地对象ID(公司ID、部门ID、用户ID)") + private String sysObjId; + + /** + * 第三方对象ID(公司ID、部门ID、用户ID) + */ + @Schema(description = "第三方对象ID(公司ID、部门ID、用户ID)") + private String thirdObjId; + + /** + * 同步状态(0:未同步;1:同步成功;2:同步失败) + */ + @Schema(description = "同步状态(0:未同步;1:同步成功;2:同步失败)") + private Integer synstate; + + /** + * 描述 + */ + @Schema(description = "描述") + private String description; + +// /** +// * 创建时间 +// */ +// @TableField(value = "F_CREATORTIME",fill = FieldFill.INSERT) +// private Date creatorTime; +// +// /** +// * 创建用户 +// */ +// @TableField(value = "F_CREATORUSERID",fill = FieldFill.INSERT) +// private String creatorUserId; +// +// /** +// * 修改用户 +// */ +// @TableField(value = "F_LASTMODIFYUSERID",fill = FieldFill.UPDATE) +// private String lastModifyUserId; +// +// /** +// * 修改时间 +// */ +// @TableField(value = "F_LASTMODIFYTIME",fill = FieldFill.UPDATE) +// @JSONField(name = "F_LastModifyTime") +// private Date lastModifyTime; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/SynThirdInfoUpForm.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/SynThirdInfoUpForm.java new file mode 100644 index 0000000..09b289c --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/message/SynThirdInfoUpForm.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.message.model.message; + +import lombok.Data; + +/** + * 第三方工具的对象同步表 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021/4/25 9:35 + */ +@Data +public class SynThirdInfoUpForm extends SynThirdInfoCrForm{ + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagedatatype/MessageDataTypeForm.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagedatatype/MessageDataTypeForm.java new file mode 100644 index 0000000..520304c --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagedatatype/MessageDataTypeForm.java @@ -0,0 +1,60 @@ +package com.yunzhupaas.message.model.messagedatatype; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import java.util.List; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; + +/** + * + * + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-08-18 + */ +@Data +public class MessageDataTypeForm { + /** 主键 */ + @Schema(description = "主键") + private String id; + /** 数据类型 **/ + @Schema(description = "数据类型") + @JsonProperty("type") + private String type; + + /** 数据名称 **/ + @Schema(description = "数据名称") + @JsonProperty("fullName") + private String fullName; + + /** 数据编码(为防止与系统后续更新的功能的数据编码冲突,客户自定义添加的功能编码请以ZDY开头。例如:ZDY1) **/ + @Schema(description = "数据编码") + @JsonProperty("enCode") + private String enCode; + + /** 创建时间 **/ + @Schema(description = "创建时间") + @JsonProperty("creatorTime") + private String creatorTime; + + /** 创建人员 **/ + @Schema(description = "创建人员") + @JsonProperty("creatorUserId") + private String creatorUserId; + + /** 修改时间 **/ + @Schema(description = "修改时间") + @JsonProperty("lastModifyTime") + private String lastModifyTime; + + /** 修改人员 **/ + @Schema(description = "修改人员") + @JsonProperty("lastModifyUserId") + private String lastModifyUserId; + + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagedatatype/MessageDataTypeInfoVO.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagedatatype/MessageDataTypeInfoVO.java new file mode 100644 index 0000000..edc849e --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagedatatype/MessageDataTypeInfoVO.java @@ -0,0 +1,49 @@ +package com.yunzhupaas.message.model.messagedatatype; + +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Date; +/** + * + * + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-08-18 + */ +@Data +public class MessageDataTypeInfoVO{ + /** 主键 **/ + @JsonProperty("id") + private String id; + + /** 数据类型 **/ + @JsonProperty("type") + private String type; + + /** 数据名称 **/ + @JsonProperty("fullName") + private String fullName; + + /** 数据编码 **/ + @JsonProperty("enCode") + private String enCode; + + /** 创建时间 **/ + @JsonProperty("creatortime") + private Date creatortime; + + /** 创建人员 **/ + @JsonProperty("creatorUserId") + private String creatoruserid; + + /** 修改时间 **/ + @JsonProperty("lastModifyTime") + private Date lastmodifytime; + + /** 修改人员 **/ + @JsonProperty("lastModifyUserId") + private String lastmodifyuserid; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagedatatype/MessageDataTypeListVO.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagedatatype/MessageDataTypeListVO.java new file mode 100644 index 0000000..3bb4c78 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagedatatype/MessageDataTypeListVO.java @@ -0,0 +1,74 @@ +package com.yunzhupaas.message.model.messagedatatype; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonProperty; + + +/** + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-08-18 + */ +@Data +public class MessageDataTypeListVO { + + @Schema(description = "id") + private String id; + + /** + * 数据类型 + **/ + @Schema(description = "数据类型") + @JsonProperty("type") + private String type; + + /** + * 数据名称 + **/ + @Schema(description = "数据名称") + @JsonProperty("fullName") + private String fullName; + + /** + * 数据编码(为防止与系统后续更新的功能的数据编码冲突,客户自定义添加的功能编码请以ZDY开头。例如:ZDY1) + **/ + @Schema(description = "数据编码") + @JsonProperty("enCode") + private String enCode; + + /** + * 创建时间 + **/ + @Schema(description = "创建时间") + @JsonProperty("creatortime") + private Date creatortime; + + /** + * 创建人员 + **/ + @Schema(description = "创建人员") + @JsonProperty("creatorUserId") + private String creatoruserid; + + /** + * 修改时间 + **/ + @Schema(description = "修改时间") + @JsonProperty("lastModifyTime") + private Date lastmodifytime; + + /** + * 修改人员 + **/ + @Schema(description = "修改人员") + @JsonProperty("lastModifyUserId") + private String lastmodifyuserid; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagedatatype/MessageDataTypePagination.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagedatatype/MessageDataTypePagination.java new file mode 100644 index 0000000..f36814c --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagedatatype/MessageDataTypePagination.java @@ -0,0 +1,49 @@ +package com.yunzhupaas.message.model.messagedatatype; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import com.yunzhupaas.base.Pagination; + +import java.util.List; + +/** + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-08-18 + */ +@Data +public class MessageDataTypePagination extends Pagination { + + @Schema(description = "selectKey") + private String selectKey; + + @Schema(description = "json") + private String json; + + @Schema(description = "数据类型") + private String dataType; + + @Schema(description = "特殊查询json") + private String superQueryJson; + + + /** + * 数据名称 + */ + @Schema(description = "数据名称") + private String name; + + /** + * 数据编码 + */ + @Schema(description = "数据编码") + private String code; + /** + * 菜单id + */ + @Schema(description = "菜单id") + private String menuId; +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagemonitor/MessageMonitorForm.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagemonitor/MessageMonitorForm.java new file mode 100644 index 0000000..1f4da85 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagemonitor/MessageMonitorForm.java @@ -0,0 +1,84 @@ +package com.yunzhupaas.message.model.messagemonitor; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; +import java.math.BigDecimal; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; + +/** + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-08-22 + */ +@Data +public class MessageMonitorForm { + /** + * 主键 + */ + @Schema(description = "主键") + private String id; + /** + * 账号id + **/ + @Schema(description = "账号id") + @JsonProperty("accountId") + private String accountId; + + /** + * 账号名称 + **/ + @Schema(description = "账号名称") + @JsonProperty("accountName") + private String accountName; + + /** + * 账号编码 + **/ + @Schema(description = "账号编码") + @JsonProperty("accountCode") + private String accountCode; + + /** + * 消息类型 + **/ + @Schema(description = "消息类型") + @JsonProperty("messageType") + private String messageType; + + /** + * 发送时间 + **/ + @Schema(description = "发送时间") + @JsonProperty("sendTime") + private String sendTime; + + /** + * 消息模板id + **/ + @Schema(description = "消息模板id") + @JsonProperty("messageTemplateId") + private String messageTemplateId; + + /** + * 标题 + **/ + @Schema(description = "标题") + @JsonProperty("title") + private String title; + + /** + * 内容 + **/ + @Schema(description = "内容") + @JsonProperty("content") + private String content; + + + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagemonitor/MessageMonitorInfoVO.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagemonitor/MessageMonitorInfoVO.java new file mode 100644 index 0000000..dba3cea --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagemonitor/MessageMonitorInfoVO.java @@ -0,0 +1,94 @@ +package com.yunzhupaas.message.model.messagemonitor; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-08-22 + */ +@Data +public class MessageMonitorInfoVO { + /** + * 主键 + **/ + @Schema(description = "主键") + @JsonProperty("id") + private String id; + + /** + * 账号id + **/ + @Schema(description = "账号id") + @JsonProperty("accountId") + private String accountId; + + /** + * 账号名称 + **/ + @Schema(description = "账号名称") + @JsonProperty("accountName") + private String accountName; + + /** + * 账号编码 + **/ + @Schema(description = "账号编码") + @JsonProperty("accountCode") + private String accountCode; + + /** + * 消息类型 + **/ + @Schema(description = "消息类型") + @JsonProperty("messageType") + private String messageType; + + /** + * 消息来源 + **/ + @Schema(description = "消息来源") + @JsonProperty("messageSource") + private String messageSource; + + /** + * 发送时间 + **/ + @Schema(description = "发送时间") + @JsonProperty("sendTime") + private Long sendTime; + + /** + * 消息模板id + **/ + @Schema(description = "消息模板id") + @JsonProperty("messageTemplateId") + private String messageTemplateId; + + /** + * 接收人 + **/ + @Schema(description = "接收人") + @JsonProperty("receiveUser") + private String receiveUser; + + /** + * 标题 + **/ + @Schema(description = "标题") + @JsonProperty("title") + private String title; + + /** + * 内容 + **/ + @Schema(description = "内容") + @JsonProperty("content") + private String content; + + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagemonitor/MessageMonitorListVO.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagemonitor/MessageMonitorListVO.java new file mode 100644 index 0000000..8475a64 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagemonitor/MessageMonitorListVO.java @@ -0,0 +1,53 @@ +package com.yunzhupaas.message.model.messagemonitor; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; + + +/** + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-08-22 + */ +@Data +public class MessageMonitorListVO { + @Schema(description = "主键") + private String id; + + /** + * 消息类型 + **/ + @Schema(description = "消息类型") + @JSONField(name = "messageType") + private String messageType; + + /** + * 消息来源 + **/ + @Schema(description = "消息来源") + @JsonProperty("messageSource") + private String messageSource; + + /** + * 发送时间 + **/ + @Schema(description = "发送时间") + @JSONField(name = "sendTime") + private Long sendTime; + + /** + * 标题 + **/ + @Schema(description = "标题") + @JSONField(name = "title") + private String title; + + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagemonitor/MessageMonitorPagination.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagemonitor/MessageMonitorPagination.java new file mode 100644 index 0000000..b260398 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagemonitor/MessageMonitorPagination.java @@ -0,0 +1,67 @@ +package com.yunzhupaas.message.model.messagemonitor; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import com.yunzhupaas.base.Pagination; + +import java.util.List; + +/** + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-08-22 + */ +@Data +public class MessageMonitorPagination extends Pagination { + + @Schema(description = "selectKey") + private String selectKey; + + @Schema(description = "json") + private String json; + + @Schema(description = "数据类型") + private String dataType; + + @Schema(description = "特殊查询json") + private String superQueryJson; + + + /** + * 消息来源 + */ + @Schema(description = "消息来源") + private String messageSource; + + /** + * 消息类型 + */ + @Schema(description = "消息类型") + private String messageType; + + /** + * 关键词 + */ + @Schema(description = "关键词") + private String keyword; + + /** + * 发送时间(开始时间) + */ + @Schema(description = "发送时间") + private Long startTime; + + /** + * 接收时间 + */ + @Schema(description = "接收时间") + private Long endTime; + /** + * 菜单id + */ + @Schema(description = "菜单id") + private String menuId; +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagemonitor/MsgDelForm.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagemonitor/MsgDelForm.java new file mode 100644 index 0000000..99fecfe --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagemonitor/MsgDelForm.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.message.model.messagemonitor; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/16 10:10 + */ +@Data +public class MsgDelForm { + @Schema(description = "id集合") + private String[] ids; +} + + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagetemplateconfig/MessageTemplateConfigForm.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagetemplateconfig/MessageTemplateConfigForm.java new file mode 100644 index 0000000..6b2371c --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagetemplateconfig/MessageTemplateConfigForm.java @@ -0,0 +1,117 @@ +package com.yunzhupaas.message.model.messagetemplateconfig; + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.message.entity.SmsFieldEntity; +import com.yunzhupaas.message.entity.TemplateParamEntity; +import lombok.Data; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * + * + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-08-18 + */ +@Data +public class MessageTemplateConfigForm { + /** 主键 */ + @Schema(description = "主键") + private String id; + /** 名称 **/ + @Schema(description = "名称") + @JsonProperty("fullName") + private String fullName; + + /** 编码 **/ + @Schema(description = "编码") + @JsonProperty("enCode") + private String enCode; + + /** 模板类型 **/ + @Schema(description = "模板类型") + @JsonProperty("templateType") + private String templateType; + + /** 消息来源 **/ + @Schema(description = "消息来源") + @JsonProperty("messageSource") + private String messageSource; + + /** 消息类型 **/ + @Schema(description = "消息类型") + @JsonProperty("messageType") + private String messageType; + + /** 排序 **/ + @Schema(description = "排序") + @JsonProperty("sortCode") + private Integer sortCode; + + /** 状态 **/ + @Schema(description = "状态") + @JsonProperty("enabledMark") + private Integer enabledMark; + + /** 说明 **/ + @Schema(description = "说明") + @JsonProperty("description") + private String description; + + /** 消息标题 **/ + @Schema(description = "消息标题") + @JsonProperty("title") + private String title; + + /** 消息内容 **/ + @Schema(description = "消息内容") + @JsonProperty("content") + private String content; + + /** 模板编号 **/ + @Schema(description = "模板编号") + @JsonProperty("templateCode") + private String templateCode; + + /** 跳转方式 (1:小程序,2:页面)**/ + @Schema(description = "跳转方式") + @JsonProperty("wxSkip") + private String wxSkip; + + /** 关联小程序id **/ + @Schema(description = "关联小程序id") + @JsonProperty("xcxAppId") + private String xcxAppId; + +// /** 创建时间 **/ +// @JsonProperty("creatorTime") +// private String creatorTime; +// +// /** 创建人员 **/ +// @JsonProperty("creatorUserId") +// private String creatorUserId; +// +// /** 修改时间 **/ +// @JsonProperty("lastModifyTime") +// private String lastModifyTime; +// +// /** 修改人员 **/ +// @JsonProperty("lastModifyUserId") +// private String lastModifyUserId; + + /** 子表数据 **/ + @Schema(description = "子表数据") + @JsonProperty("templateParamList") + private List templateParamList; + /** 子表数据 **/ + @Schema(description = "子表数据") + @JsonProperty("smsFieldList") + private List smsFieldList; + + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagetemplateconfig/MessageTemplateConfigInfoVO.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagetemplateconfig/MessageTemplateConfigInfoVO.java new file mode 100644 index 0000000..eb401d6 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagetemplateconfig/MessageTemplateConfigInfoVO.java @@ -0,0 +1,158 @@ +package com.yunzhupaas.message.model.messagetemplateconfig; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.message.entity.SmsFieldEntity; +import com.yunzhupaas.message.entity.TemplateParamEntity; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +/** + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-08-18 + */ +@Data +public class MessageTemplateConfigInfoVO { + /** + * 主键 + **/ + @Schema(description = "主键") + @JsonProperty("id") + private String id; + + /** + * 名称 + **/ + @Schema(description = "名称") + @JsonProperty("fullName") + private String fullName; + + /** + * 编码 + **/ + @Schema(description = "编码") + @JsonProperty("enCode") + private String enCode; + + /** + * 模板类型 + **/ + @Schema(description = "模板类型") + @JsonProperty("templateType") + private String templateType; + + /** + * 消息来源 + **/ + @Schema(description = "消息来源") + @JsonProperty("messageSource") + private String messageSource; + + /** + * 消息类型 + **/ + @Schema(description = "消息类型") + @JsonProperty("messageType") + private String messageType; + + /** + * 排序 + **/ + @Schema(description = "排序") + @JsonProperty("sortCode") + private Integer sortCode; + + /** + * 状态 + **/ + @Schema(description = "状态") + @JsonProperty("enabledMark") + private Integer enabledMark; + + /** + * 说明 + **/ + @Schema(description = "说明") + @JsonProperty("description") + private String description; + + /** + * 消息标题 + **/ + @Schema(description = "消息标题") + @JsonProperty("title") + private String title; + + /** + * 消息内容 + **/ + @Schema(description = "消息内容") + @JsonProperty("content") + private String content; + + /** + * 模板编号 + **/ + @Schema(description = "模板编号") + @JsonProperty("templateCode") + private String templateCode; + + /** + * 跳转方式 (1:小程序,2:页面) + **/ + @Schema(description = "跳转方式 (1:小程序,2:页面)") + @JsonProperty("wxSkip") + private String wxSkip; + + /** + * 关联小程序id + **/ + @Schema(description = "关联小程序id") + @JsonProperty("xcxAppId") + private String xcxAppId; + + /** + * 创建时间 + **/ + @Schema(description = "创建时间") + @JsonProperty("creatorTime") + private Long creatorTime; + + /** + * 创建人员 + **/ + @Schema(description = "创建人员") + @JsonProperty("creatorUserId") + private String creatorUserId; + + /** + * 修改时间 + **/ + @Schema(description = "修改时间") + @JsonProperty("lastModifyTime") + private Long lastModifyTime; + + /** + * 修改人员 + **/ + @Schema(description = "修改人员") + @JsonProperty("lastModifyUserId") + private String lastModifyUserId; + + /** + * 子表数据 + **/ + @Schema(description = "子表数据") + @JsonProperty("templateParamList") + private List templateParamList; + /** + * 子表数据 + **/ + @Schema(description = "子表数据") + @JsonProperty("smsFieldList") + private List smsFieldList; +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagetemplateconfig/MessageTemplateConfigListVO.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagetemplateconfig/MessageTemplateConfigListVO.java new file mode 100644 index 0000000..45d7be6 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagetemplateconfig/MessageTemplateConfigListVO.java @@ -0,0 +1,145 @@ +package com.yunzhupaas.message.model.messagetemplateconfig; + + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.message.entity.SmsFieldEntity; +import com.yunzhupaas.message.entity.TemplateParamEntity; +import lombok.Data; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; + +import java.util.List; + +/** + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-08-18 + */ +@Data +public class MessageTemplateConfigListVO { + private String id; + + + /** + * 子表数据 + **/ + @Schema(description = "子表数据") + @JsonProperty("tableField112") + @JSONField(name = "tableField112") + private List templateParamList; + + /** + * 子表数据 + **/ + @Schema(description = "子表数据") + @JsonProperty("tableField116") + @JSONField(name = "tableField116") + private List smsFieldList; + + /** + * 名称 + **/ + @Schema(description = "名称") + @JSONField(name = "fullName") + private String fullName; + + /** + * 编码 + **/ + @Schema(description = "编码") + @JSONField(name = "enCode") + private String enCode; + + /** + * 模板类型 + **/ + @Schema(description = "模板类型") + @JSONField(name = "templateType") + private String templateType; + + /** + * 消息来源 + **/ + @Schema(description = "消息来源") + @JSONField(name = "messageSource") + private String messageSource; + + /** + * 消息类型 + **/ + @Schema(description = "消息类型") + @JSONField(name = "messageType") + private String messageType; + + /** + * 排序 + **/ + @Schema(description = "排序") + @JSONField(name = "sortCode") + private Integer sortCode; + /** + * 状态 + **/ + @Schema(description = "状态") + @JSONField(name = "enabledMark") + private Integer enabledMark; + +// /** +// * 说明 +// **/ +// @JSONField(name = "remark") +// private String remark; + +// /** +// * 消息标题 +// **/ +// @JSONField(name = "title") +// private String title; +// +// /** +// * 消息内容 +// **/ +// @JSONField(name = "content") +// private String content; +// +// /** +// * 模板编号 +// **/ +// @JSONField(name = "templateCode") +// private String templateCode; + + /** + * 创建时间 + **/ + @Schema(description = "创建时间") + @JSONField(name = "creatorTime") + private Long creatorTime; + + /** + * 创建人员 + **/ + @Schema(description = "创建人员") + @JSONField(name = "creatorUserId") + private String creatorUserId; + + /** + * 修改时间 + **/ + @Schema(description = "修改时间") + @JSONField(name = "lastModifyTime") + private Long lastModifyTime; + +// /** +// * 修改人员 +// **/ +// @JSONField(name = "lastModifyUserId") +// private String lastModifyUserId; + + @Schema(description = "创建人") + private String creatorUser; + + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagetemplateconfig/MessageTemplateConfigPagination.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagetemplateconfig/MessageTemplateConfigPagination.java new file mode 100644 index 0000000..999b31b --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagetemplateconfig/MessageTemplateConfigPagination.java @@ -0,0 +1,67 @@ +package com.yunzhupaas.message.model.messagetemplateconfig; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import com.yunzhupaas.base.Pagination; + +/** + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-08-18 + */ +@Data +public class MessageTemplateConfigPagination extends Pagination { + + @Schema(description = "selectKey") + private String selectKey; + + @Schema(description = "json") + private String json; + + @Schema(description = "数据类型") + private String dataType; + + @Schema(description = "特殊查询json") + private String superQueryJson; + + + + /** + * 模板类型 + */ + @Schema(description = "模板类型") + private String templateType; + + /** + * 消息类型 + */ + @Schema(description = "消息类型") + private String messageType; + + /** + * 关键词 + */ + @Schema(description = "关键词") + private String keyword; + + /** + * 状态 + */ + @Schema(description = "状态") + private String enabledMark; + + /** + * 消息来源 + */ + @Schema(description = "消息来源") + private String messageSource; + + /** + * 菜单id + */ + @Schema(description = "菜单id") + private String menuId; +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagetemplateconfig/SmsFieldModel.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagetemplateconfig/SmsFieldModel.java new file mode 100644 index 0000000..494cb3d --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagetemplateconfig/SmsFieldModel.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.message.model.messagetemplateconfig; + +import lombok.Data; + +/** + * + * + * 版本: V3.2.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2022-08-18 + */ +@Data +public class SmsFieldModel { + + + private String smsField; + + private String field; + + private String fieldId; + + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagetemplateconfig/TemplateParamModel.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagetemplateconfig/TemplateParamModel.java new file mode 100644 index 0000000..e389144 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/messagetemplateconfig/TemplateParamModel.java @@ -0,0 +1,41 @@ +package com.yunzhupaas.message.model.messagetemplateconfig; + +import lombok.Data; + +/** + * + * + * 版本: V3.2.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2022-08-18 + */ +@Data +public class TemplateParamModel { + + /** 模板参数 **/ + private String field; + + /** 参数说明 **/ + private String fieldName; + + /** 参数变量**/ + private String value; + + /** 参数主键 **/ + private String id; + + /** 消息模板类型 **/ + private String templateType; + + /** 消息模板编码 **/ + private String templateCode; + + /** 消息模板id **/ + private String templateId; + + /** 消息模板名称 **/ + private String templateName; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/sendconfigrecord/SendConfigRecordForm.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/sendconfigrecord/SendConfigRecordForm.java new file mode 100644 index 0000000..0cca381 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/sendconfigrecord/SendConfigRecordForm.java @@ -0,0 +1,60 @@ +package com.yunzhupaas.message.model.sendconfigrecord; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import java.util.List; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; + +/** + * + * + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-09-21 + */ +@Data +public class SendConfigRecordForm { + /** 主键 */ + @Schema(description = "主键") + private String id; + /** 发送配置id **/ + @Schema(description = "发送配置id") + @JsonProperty("sendConfigId") + private String sendConfigId; + + /** 消息来源 **/ + @Schema(description = "消息来源") + @JsonProperty("messageSource") + private String messageSource; + + /** 被引用id **/ + @Schema(description = "被引用id") + @JsonProperty("usedId") + private String usedId; + + /** 创建时间 **/ + @Schema(description = "创建时间") + @JsonProperty("creatorTime") + private String creatorTime; + + /** 创建人员 **/ + @Schema(description = "创建人员") + @JsonProperty("creatorUserId") + private String creatorUserId; + + /** 修改时间 **/ + @Schema(description = "修改时间") + @JsonProperty("lastModifyTime") + private String lastModifyTime; + + /** 修改人员 **/ + @Schema(description = "修改人员") + @JsonProperty("lastModifyUserId") + private String lastModifyUserId; + + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/sendconfigrecord/SendConfigRecordInfoVO.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/sendconfigrecord/SendConfigRecordInfoVO.java new file mode 100644 index 0000000..34ac95d --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/sendconfigrecord/SendConfigRecordInfoVO.java @@ -0,0 +1,76 @@ +package com.yunzhupaas.message.model.sendconfigrecord; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; +import java.math.BigDecimal; +import java.util.Date; + + +/** + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-09-21 + */ +@Data +public class SendConfigRecordInfoVO { + /** + * 主键 + **/ + @Schema(description = "主键") + @JsonProperty("id") + private String id; + + /** + * 发送配置id + **/ + @Schema(description = "发送配置id") + @JsonProperty("sendConfigId") + private String sendConfigId; + + /** + * 消息来源 + **/ + @Schema(description = "消息来源") + @JsonProperty("messageSource") + private String messageSource; + + /** + * 被引用id + **/ + @Schema(description = "被引用id") + @JsonProperty("usedId") + private String usedId; + + /** + * 创建时间 + **/ + @Schema(description = "创建时间") + @JsonProperty("creatorTime") + private Long creatorTime; + + /** + * 创建人员 + **/ + @Schema(description = "创建人员") + @JsonProperty("creatorUserId") + private String creatorUserId; + + /** + * 修改时间 + **/ + @Schema(description = "修改时间") + @JsonProperty("lastModifyTime") + private Long lastModifyTime; + + /** + * 修改人员 + **/ + @Schema(description = "修改人员") + @JsonProperty("lastModifyUserId") + private String lastModifyUserId; +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/sendconfigrecord/SendConfigRecordListVO.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/sendconfigrecord/SendConfigRecordListVO.java new file mode 100644 index 0000000..29d5078 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/sendconfigrecord/SendConfigRecordListVO.java @@ -0,0 +1,70 @@ +package com.yunzhupaas.message.model.sendconfigrecord; + + +import lombok.Data; + +import java.sql.Time; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; + +import java.math.BigDecimal; +import java.util.List; + +/** + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-09-21 + */ +@Data +public class SendConfigRecordListVO { + private String id; + + + /** + * 发送配置id + **/ + @JSONField(name = "sendConfigId") + private String sendConfigId; + + /** + * 消息来源 + **/ + @JSONField(name = "messageSource") + private String messageSource; + + /** + * 被引用id + **/ + @JSONField(name = "usedId") + private String usedId; + + /** + * 创建时间 + **/ + @JSONField(name = "creatorTime") + private Long creatorTime; + + /** + * 创建人员 + **/ + @JSONField(name = "creatorUserId") + private String creatorUserId; + + /** + * 修改时间 + **/ + @JSONField(name = "lastModifyTime") + private Long lastModifyTime; + + /** + * 修改人员 + **/ + @JSONField(name = "lastModifyUserId") + private String lastModifyUserId; + + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/sendconfigrecord/SendConfigRecordPagination.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/sendconfigrecord/SendConfigRecordPagination.java new file mode 100644 index 0000000..1ffebea --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/sendconfigrecord/SendConfigRecordPagination.java @@ -0,0 +1,43 @@ +package com.yunzhupaas.message.model.sendconfigrecord; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import com.yunzhupaas.base.Pagination; +import java.util.List; + +/** + * + * + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-09-21 + */ +@Data +public class SendConfigRecordPagination extends Pagination { + + @Schema(description = "selectKey") + private String selectKey; + + @Schema(description = "json") + private String json; + + @Schema(description = "数据类型") + private String dataType; + + @Schema(description = "特殊查询json") + private String superQueryJson; + + + /** 消息来源 */ + @Schema(description = "消息来源") + private String messageSource; + + /** + * 菜单id + */ + @Schema(description = "菜单id") + private String menuId; +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/sendmessageconfig/MsgTemplateJsonModel.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/sendmessageconfig/MsgTemplateJsonModel.java new file mode 100644 index 0000000..530b6b1 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/sendmessageconfig/MsgTemplateJsonModel.java @@ -0,0 +1,23 @@ +package com.yunzhupaas.message.model.sendmessageconfig; + +import lombok.Data; + +/** + * 解析引擎 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Data +public class MsgTemplateJsonModel { + + public String field; + public String fieldName; + public String relationField; + private String id; + private Boolean isSubTable = false; + private String msgTemplateId; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/sendmessageconfig/SendConfigListVO.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/sendmessageconfig/SendConfigListVO.java new file mode 100644 index 0000000..3835d18 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/sendmessageconfig/SendConfigListVO.java @@ -0,0 +1,45 @@ +package com.yunzhupaas.message.model.sendmessageconfig; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.sql.Time; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; + +import java.math.BigDecimal; +import java.util.List; + +/** + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-08-19 + */ +@Data +public class SendConfigListVO { + @Schema(description = "主键") + private String id; + + /** + * 名称 + **/ + @Schema(description = "名称") + @JSONField(name = "fullName") + private String fullName; + + /** + * 编码 + **/ + @Schema(description = "编码") + @JSONField(name = "enCode") + private String enCode; + + @Schema(description = "模板json") + private Object templateJson; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/sendmessageconfig/SendConfigTemplateModel.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/sendmessageconfig/SendConfigTemplateModel.java new file mode 100644 index 0000000..3bd48ff --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/sendmessageconfig/SendConfigTemplateModel.java @@ -0,0 +1,51 @@ +package com.yunzhupaas.message.model.sendmessageconfig; + +import lombok.Data; +import java.util.List; +import java.util.Date; +import java.math.BigDecimal; +import java.math.BigInteger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; + +/** + * + * + * 版本: V3.2.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2022-08-19 + */ +@Data +public class SendConfigTemplateModel { + + private String id; + + /** 消息发送配置id **/ + @JsonProperty("sendConfigId") + private String sendConfigId; + + /** 消息类型 **/ + @JsonProperty("messageType") + private String messageType; + + /** 消息模板id **/ + @JsonProperty("templateId") + private String templateId; + + /** 账号配置id **/ + @JsonProperty("accountConfigId") + private String accountConfigId; + + /** 接收人 **/ + private List toUser; + + /** 模板参数 **/ + private Object paramJson; + + /** 消息模板名称 **/ + private String msgTemplateName; + + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/sendmessageconfig/SendConfigTestResultModel.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/sendmessageconfig/SendConfigTestResultModel.java new file mode 100644 index 0000000..02039bd --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/sendmessageconfig/SendConfigTestResultModel.java @@ -0,0 +1,34 @@ +package com.yunzhupaas.message.model.sendmessageconfig; + +import lombok.Data; +import java.util.List; +import java.util.Date; +import java.math.BigDecimal; +import java.math.BigInteger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; + +/** + * + * + * 版本: V3.2.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2022-08-19 + */ +@Data +public class SendConfigTestResultModel { + + + /** 消息类型 **/ + private String messageType; + + /** 是否成功 **/ + private String isSuccess; + + /** 失败原因 **/ + private String result; + + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/sendmessageconfig/SendMessageConfigForm.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/sendmessageconfig/SendMessageConfigForm.java new file mode 100644 index 0000000..4f65729 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/sendmessageconfig/SendMessageConfigForm.java @@ -0,0 +1,65 @@ +package com.yunzhupaas.message.model.sendmessageconfig; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.message.entity.SendConfigTemplateEntity; +import lombok.Data; +import java.util.List; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; + +/** + * + * + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-08-19 + */ +@Data +public class SendMessageConfigForm { + /** 主键 */ + @Schema(description = "主键") + private String id; + /** 名称 **/ + @Schema(description = "名称") + @JsonProperty("fullName") + private String fullName; + + /** 编码 **/ + @Schema(description = "编码") + @JsonProperty("enCode") + private String enCode; + + /** 模板类型 **/ + @Schema(description = "模板类型") + @JsonProperty("templateType") + private String templateType; + + /** 消息来源 **/ + @Schema(description = "消息来源") + @JsonProperty("messageSource") + private String messageSource; + + /** 排序 **/ + @Schema(description = "排序") + @JsonProperty("sortCode") + private Integer sortCode; + + /** 状态 **/ + @Schema(description = "状态") + @JsonProperty("enabledMark") + private String enabledMark; + + /** 说明 **/ + @Schema(description = "说明") + @JsonProperty("description") + private String description; + + /** 子表数据 **/ + @Schema(description = "子表数据") + @JsonProperty("sendConfigTemplateList") + private List sendConfigTemplateList; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/sendmessageconfig/SendMessageConfigInfoVO.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/sendmessageconfig/SendMessageConfigInfoVO.java new file mode 100644 index 0000000..5fe42fc --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/sendmessageconfig/SendMessageConfigInfoVO.java @@ -0,0 +1,103 @@ +package com.yunzhupaas.message.model.sendmessageconfig; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.message.entity.SendConfigTemplateEntity; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.math.BigDecimal; +import java.util.Date; +/** + * + * + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-08-19 + */ +@Data +public class SendMessageConfigInfoVO{ + /** + * 主键 + **/ + @Schema(description = "主键") + @JsonProperty("id") + private String id; + + /** + * 名称 + **/ + @Schema(description = "名称") + @JsonProperty("fullName") + private String fullName; + + /** + * 编码 + **/ + @Schema(description = "编码") + @JsonProperty("enCode") + private String enCode; + + + /** + * 模板类型 + **/ + @Schema(description = "模板类型") + @JsonProperty("templateType") + private String templateType; + + /** + * 消息来源 + **/ + @Schema(description = "消息来源") + @JsonProperty("messageSource") + private String messageSource; + + @Schema(description = "消息源名称") + private String messageSourceName; + + /** + * 排序 + **/ + @Schema(description = "排序") + @JsonProperty("sortCode") + private Integer sortCode; + + /** + * 状态 + **/ + @Schema(description = "状态") + @JsonProperty("enabledMark") + private String enabledMark; + + /** + * 说明 + **/ + @Schema(description = "说明") + @JsonProperty("description") + private String description; + +// /** 创建人员 **/ +// @JsonProperty("creatorUserId") +// private String creatorUserId; +// +// /** 创建时间 **/ +// @JsonProperty("creatorTime") +// private Long creatorTime; +// +// /** 修改人员 **/ +// @JsonProperty("lastModifyUserId") +// private String lastModifyUserId; +// +// /** 修改时间 **/ +// @JsonProperty("lastModifyTime") +// private Date lastModifyTime; + + /** + * 子表数据 + **/ + @Schema(description = "子表数据") + @JsonProperty("sendConfigTemplateList") + private List sendConfigTemplateList; +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/sendmessageconfig/SendMessageConfigListVO.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/sendmessageconfig/SendMessageConfigListVO.java new file mode 100644 index 0000000..0a291d0 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/sendmessageconfig/SendMessageConfigListVO.java @@ -0,0 +1,112 @@ +package com.yunzhupaas.message.model.sendmessageconfig; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; + +import java.util.List; +import java.util.Map; + +/** + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-08-19 + */ +@Data +public class SendMessageConfigListVO { + @Schema(description = "主键") + private String id; + + + /** + * 子表数据 + **/ + @Schema(description = "子表数据") + @JsonProperty("tableField110") + @JSONField(name = "tableField110") + private List sendConfigTemplateList; + + /** + * 名称 + **/ + @Schema(description = "名称") + @JSONField(name = "fullName") + private String fullName; + + /** + * 编码 + **/ + @Schema(description = "编码") + @JSONField(name = "enCode") + private String enCode; + + /** + * 消息类型 + **/ + @Schema(description = "消息类型") + private List> messageType; + + /** + * 模板类型 + **/ + @Schema(description = "模板类型") + @JSONField(name = "templateType") + private String templateType; + + /** + * 消息来源 + **/ + @Schema(description = "消息来源") + @JSONField(name = "messageSource") + private String messageSource; + + /** + * 排序 + **/ + @Schema(description = "排序") + @JSONField(name = "sortCode") + private Integer sortCode; + /** + * 状态 + **/ + @Schema(description = "状态") + @JSONField(name = "enabledMark") + private String enabledMark; + + /** + * 创建人员 + **/ + @Schema(description = "创建人员") + @JSONField(name = "creatorUserId") + private String creatorUserId; + + /** + * 创建时间 + **/ + @Schema(description = "创建时间") + @JSONField(name = "creatorTime") + private Long creatorTime; + + /** + * 修改人员 + **/ + @Schema(description = "修改人员") + @JSONField(name = "lastModifyUserId") + private String lastModifyUserId; + + /** + * 修改时间 + **/ + @Schema(description = "修改时间") + @JSONField(name = "lastModifyTime") + private Long lastModifyTime; + + @Schema(description = "创建人") + private String creatorUser; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/sendmessageconfig/SendMessageConfigPagination.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/sendmessageconfig/SendMessageConfigPagination.java new file mode 100644 index 0000000..7a3eb9e --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/sendmessageconfig/SendMessageConfigPagination.java @@ -0,0 +1,60 @@ +package com.yunzhupaas.message.model.sendmessageconfig; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import com.yunzhupaas.base.Pagination; + +import java.util.List; + +/** + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2022-08-19 + */ +@Data +public class SendMessageConfigPagination extends Pagination { + + @Schema(description = "selectKey") + private String selectKey; + + @Schema(description = "json") + private String json; + + @Schema(description = "数据类型") + private String dataType; + + @Schema(description = "特殊查询json") + private String superQueryJson; + + + /** + * 状态 + */ + @Schema(description = "状态") + private String enabledMark; + /** + * 模板类型 + */ + @Schema(description = "模板类型") + private String templateType; + + /** + * 消息来源 + */ + @Schema(description = "消息来源") + private String messageSource; + + /** + * 关键词 + */ + @Schema(description = "关键词") + private String keyword; + /** + * 菜单id + */ + @Schema(description = "菜单id") + private String menuId; +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/MessageListVo.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/MessageListVo.java new file mode 100644 index 0000000..cdbb003 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/MessageListVo.java @@ -0,0 +1,35 @@ +package com.yunzhupaas.message.model.websocket; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 消息列表单个模型 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-07-05 + */ +@Data +public class MessageListVo implements Serializable { + + private String content; + + private String contentType; + + private String id; + + private Long receiveTime; + + private String receiveUserId; + + private Long sendTime; + + private String sendUserId; + + private Integer state; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/PaginationMessageModel.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/PaginationMessageModel.java new file mode 100644 index 0000000..dcc3880 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/PaginationMessageModel.java @@ -0,0 +1,32 @@ +package com.yunzhupaas.message.model.websocket; + +import lombok.Builder; +import lombok.Data; + +import java.io.Serializable; + +/** + * 消息分页参数模型 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-07-05 + */ +@Data +@Builder +public class PaginationMessageModel implements Serializable { + + /** + * 当前页 + */ + private Integer currentPage; + + + private Integer pageSize; + + + private Long total; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/PaginationMessageVo.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/PaginationMessageVo.java new file mode 100644 index 0000000..fb6135c --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/PaginationMessageVo.java @@ -0,0 +1,37 @@ +package com.yunzhupaas.message.model.websocket; + +import com.yunzhupaas.message.entity.ImContentEntity; +import lombok.Builder; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 消息分页返回模型 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-07-05 + */ +@Data +@Builder +public class PaginationMessageVo implements Serializable { + + /** + * 消息列表 + */ + private List list; + + /** + * 分页参数 + */ + private PaginationMessageModel pagination; + + /** + * 方法名 + */ + private String method; +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/SendMessageModel.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/SendMessageModel.java new file mode 100644 index 0000000..047ad23 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/SendMessageModel.java @@ -0,0 +1,34 @@ +package com.yunzhupaas.message.model.websocket; + +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.message.entity.MessageEntity; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +/** + * 发送消息到mq模型 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-07-06 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class SendMessageModel implements Serializable { + + private List toUserIds; + + private MessageEntity entity; + + private UserInfo userInfo; + + private Integer messageType; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/model/MessageModel.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/model/MessageModel.java new file mode 100644 index 0000000..8276ba3 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/model/MessageModel.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.message.model.websocket.model; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 消息模型 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-07-07 + */ +@Data +public class MessageModel implements Serializable { + + protected String method; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/onclose/OnCloseModel.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/onclose/OnCloseModel.java new file mode 100644 index 0000000..b9f0477 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/onclose/OnCloseModel.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.message.model.websocket.onclose; + +import com.yunzhupaas.message.model.websocket.model.MessageModel; +import lombok.Data; + +import java.io.Serializable; + +/** + * 关闭连接model + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-07-12 + */ +@Data +public class OnCloseModel extends MessageModel implements Serializable { + + private String userId; + + public OnCloseModel(String userId, String method) { + this.userId = userId; + super.method = method; + } +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/onconnettion/OnConnectionModel.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/onconnettion/OnConnectionModel.java new file mode 100644 index 0000000..89d42ed --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/onconnettion/OnConnectionModel.java @@ -0,0 +1,43 @@ +package com.yunzhupaas.message.model.websocket.onconnettion; + +import com.yunzhupaas.message.model.websocket.model.MessageModel; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 刚连接websocket时推送的模型 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-07-07 + */ +@Data +public class OnConnectionModel extends MessageModel implements Serializable { + + private List onlineUsers; + + private List unreadNums; + + private Integer unreadNoticeCount; + + private String noticeDefaultText; + + private Integer unreadMessageCount; + + private Integer unreadScheduleCount; + + private Integer unreadSystemMessageCount; + + private String messageDefaultText; + + private Long messageDefaultTime; + + private Integer unreadTotalCount; + + private String userId; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/onconnettion/OnLineModel.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/onconnettion/OnLineModel.java new file mode 100644 index 0000000..b4987cd --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/onconnettion/OnLineModel.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.message.model.websocket.onconnettion; + +import com.yunzhupaas.message.model.websocket.model.MessageModel; +import lombok.Data; + +import java.io.Serializable; + +/** + * 用户在线推送模型 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-07-10 + */ +@Data +public class OnLineModel extends MessageModel implements Serializable { + + /** + * 在线用户 + */ + private String userId; + + public OnLineModel(String method, String userId) { + super.method = method; + this.userId = userId; + } +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/receivemessage/ReceiveMessageModel.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/receivemessage/ReceiveMessageModel.java new file mode 100644 index 0000000..f7e5bd8 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/receivemessage/ReceiveMessageModel.java @@ -0,0 +1,40 @@ +package com.yunzhupaas.message.model.websocket.receivemessage; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.yunzhupaas.message.model.websocket.model.MessageModel; +import lombok.Data; + +import java.io.Serializable; + +/** + * 接受消息模型 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-07-12 + */ +@Data +public class ReceiveMessageModel extends MessageModel implements Serializable { + + private String formUserId; + + private Long dateTime; + + private String headIcon; + + private Long latestDate; + + private String realName; + + private String account; + + private String messageType; + + private Object formMessage; + + @JsonIgnore + private String userId; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/receivemessage/ReceiveMessageVO.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/receivemessage/ReceiveMessageVO.java new file mode 100644 index 0000000..c8f27aa --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/receivemessage/ReceiveMessageVO.java @@ -0,0 +1,36 @@ +package com.yunzhupaas.message.model.websocket.receivemessage; + +import com.yunzhupaas.message.model.websocket.model.MessageModel; +import lombok.Data; + +import java.io.Serializable; + +/** + * 返回接受消息模型 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-07-13 + */ +@Data +public class ReceiveMessageVO extends MessageModel implements Serializable { + + private String formUserId; + + private Long dateTime; + + private String headIcon; + + private Long latestDate; + + private String realName; + + private String account; + + private String messageType; + + private Object formMessage; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/savafile/ImageMessageModel.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/savafile/ImageMessageModel.java new file mode 100644 index 0000000..68e8f7a --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/savafile/ImageMessageModel.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.message.model.websocket.savafile; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 图片消息模型 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-07-12 + */ +@Data +public class ImageMessageModel extends MessageTypeModel implements Serializable { + + private String width; + + private String height; + + public ImageMessageModel(String width, String height, String path) { + this.width = width; + this.height = height; + super.path = path; + } + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/savafile/MessageTypeModel.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/savafile/MessageTypeModel.java new file mode 100644 index 0000000..b7790ec --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/savafile/MessageTypeModel.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.message.model.websocket.savafile; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 图片和语音共有属性 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-07-12 + */ +@Data +public class MessageTypeModel implements Serializable { + + protected String path; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/savafile/VoiceMessageModel.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/savafile/VoiceMessageModel.java new file mode 100644 index 0000000..a6a9123 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/savafile/VoiceMessageModel.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.message.model.websocket.savafile; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 语音消息模型 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-07-12 + */ +@Data +public class VoiceMessageModel extends MessageTypeModel implements Serializable { + + private String length; + + public VoiceMessageModel(String length, String path) { + this.length = length; + super.path = path; + } + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/savamessage/SavaMessageModel.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/savamessage/SavaMessageModel.java new file mode 100644 index 0000000..2d62079 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/model/websocket/savamessage/SavaMessageModel.java @@ -0,0 +1,46 @@ +package com.yunzhupaas.message.model.websocket.savamessage; + +import com.alibaba.fastjson.annotation.JSONField; +import com.yunzhupaas.message.model.websocket.model.MessageModel; +import lombok.Data; + +import java.io.Serializable; + +/** + * 保存消息模型 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-07-12 + */ +@Data +public class SavaMessageModel extends MessageModel implements Serializable { + + @JSONField(name = "UserId") + private String userId; + + private String toUserId; + + private Long dateTime; + + private String headIcon; + + private Long latestDate; + + private String realName; + + private String account; + + private String toAccount; + + private String toRealName; + + private String toHeadIcon; + + private String messageType; + + private Object toMessage; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/Base64Util.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/Base64Util.java new file mode 100644 index 0000000..97f69fa --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/Base64Util.java @@ -0,0 +1,42 @@ +package com.yunzhupaas.message.util; + +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.context.SpringContext; +import org.apache.commons.codec.binary.Base64; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/16 8:47 + */ +public class Base64Util { + + private static ConfigValueUtil configValueUtil = SpringContext.getBean(ConfigValueUtil.class); + + + /** + * 把文件转化为base64. + * + * @param filePath 源文件路径 + */ + public static String fileToBase64(String filePath) { + if (!StringUtil.isEmpty(filePath)) { + try { + byte[] bytes = Files.readAllBytes(Paths.get(filePath)); + return Base64.encodeBase64String(bytes); + } catch (IOException e) { + e.printStackTrace(); + } + } + return null; + } + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/ConnectionType.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/ConnectionType.java new file mode 100644 index 0000000..b3d8981 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/ConnectionType.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.message.util; + +/** + * Websocket连接类型 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-07-12 + */ +public class ConnectionType { + + /** + * 建立连接 + */ + public static final String CONNECTION_ONCONNECTION = "OnConnection"; + + /** + * 发型消息 + */ + public static final String CONNECTION_SENDMESSAGE = "SendMessage"; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/EmailUtil.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/EmailUtil.java new file mode 100644 index 0000000..bde8f5c --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/EmailUtil.java @@ -0,0 +1,95 @@ +package com.yunzhupaas.message.util; + +import com.alibaba.fastjson.JSONObject; +import com.yunzhupaas.message.model.message.EmailModel; + +import jakarta.mail.MessagingException; +import jakarta.mail.Session; +import jakarta.mail.Transport; +import jakarta.mail.internet.InternetAddress; +import jakarta.mail.internet.MimeMessage; +import java.io.UnsupportedEncodingException; +import java.util.Properties; + +/** + * 邮件类 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021/4/20 14:52 + */ +public class EmailUtil { + public static boolean isEmail(String email){ + String EMAIL_REGEX = "^[\\w-_\\.+]*[\\w-_\\.]\\@([\\w]+\\.)+[\\w]+[\\w]$"; + Boolean b = email.matches(EMAIL_REGEX); + return b; + } + + public static JSONObject sendMail(EmailModel emailModel) { + JSONObject retMsg = new JSONObject(); + // 邮件发送人 + String from = emailModel.getEmailAccount(); + // 邮件接收人的邮件地址 + String to = emailModel.getEmailToUsers(); + + //定义Properties对象,设置环境信息 + Properties props = System.getProperties(); + + // 设置邮件服务器的地址 + // 指定的smtp服务器 + props.setProperty("mail.smtp.host", emailModel.getEmailSmtpHost()); + props.setProperty("mail.smtp.auth", "true"); + //ssl安全链接 + props.setProperty("mail.smtp.ssl.enable", emailModel.getEmailSsl()); + //设置发送邮件使用的协议 + props.setProperty("mail.transport.protocol", "smtp"); + if("587".equals(emailModel.getEmailSmtpPort())){ + props .put("mail.smtp.starttls.enable", "true"); + } + //创建Session对象,session对象表示整个邮件的环境信息 + Session session = Session.getInstance(props); + //设置输出调试信息 + session.setDebug(true); + try { + // Message的实例对象表示一封电子邮件 + MimeMessage message = new MimeMessage(session); + // 设置发件人的地址 + message.setFrom(new InternetAddress(from,emailModel.getEmailSenderName(),"UTF-8")); + // 设置收件人信息 + InternetAddress[] sendTo = InternetAddress.parse(to); + message.setRecipients(MimeMessage.RecipientType.TO, sendTo); + + // 设置主题 + message.setSubject(emailModel.getEmailTitle()); + // 设置邮件的文本内容 + message.setContent((emailModel.getEmailContent()),"text/html;charset=utf-8"); + + // 设置附件 + //message.setDataHandler(dh); + + // 获取发送邮件的对象 + Transport transport=session.getTransport(); + // 连接邮件服务器 + transport.connect(emailModel.getEmailSmtpHost(),Integer.parseInt(emailModel.getEmailSmtpPort()), emailModel.getEmailAccount(), emailModel.getEmailPassword()); + // 发送消息 + transport.sendMessage(message,sendTo); + + transport.close(); + + retMsg.put("code",true); + retMsg.put("error",""); + return retMsg; + +// return true; + } catch (MessagingException | UnsupportedEncodingException e) { + retMsg.put("code",false); + retMsg.put("error",e.toString()); + return retMsg; +// e.printStackTrace(); +// return false; + } + } +} + + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/MessageChannelType.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/MessageChannelType.java new file mode 100644 index 0000000..cce0f10 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/MessageChannelType.java @@ -0,0 +1,44 @@ +package com.yunzhupaas.message.util; + +/** + * 接收消息通道类型 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-07-10 + */ +public class MessageChannelType { + + /** + * 工作流 + */ + public static final String CHANNEL_WORKFLOW = "workFlow"; + + /** + * 连接上时推送未读消息 + */ + public static final String CHANNEL_INITMESSAGE = "initMessage"; + + /** + * 发送消息 + */ + public static final String CHANNEL_SENDMESSAGE = "sendMessage"; + + /** + * 在线推送提醒 + */ + public static final String CHANNEL_ONLINE = "Online"; + + /** + * 接受消息 + */ + public static final String CHANNEL_RECEIVEMESSAGE = "receiveMessage"; + + /** + * 关闭连接 + */ + public static final String CHANNEL_OFFLINE = "Offline"; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/MessageParameterEnum.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/MessageParameterEnum.java new file mode 100644 index 0000000..4faf2ad --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/MessageParameterEnum.java @@ -0,0 +1,38 @@ +package com.yunzhupaas.message.util; + +/** + * 获取消息参数 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-07-10 + */ +public enum MessageParameterEnum { + + /** + * 接收者ID + */ + PARAMETER_TOUSERID("toUserId"), + PARAMETER_MESSAGETYPE("messageType"), + PARAMETER_MESSAGECONTENT("messageContent"), + PARAMETER_TOKEN("token"), + PARAMETER_METHOD("method"), + PARAMETER_MOBILEDEVICE("mobileDevice"), + ; + + private String value; + + MessageParameterEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/MyBatisPrimaryBase.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/MyBatisPrimaryBase.java new file mode 100644 index 0000000..69d1463 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/MyBatisPrimaryBase.java @@ -0,0 +1,90 @@ +package com.yunzhupaas.model; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.DataException; + +import java.lang.reflect.Field; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; + +/** + * 联合主键 + * + * 门户管理单条数据,可以由平台、门户ID、系统ID 三种数据定位 + * 它们组合成门户管理的联合主键,此类将其看成一个主键来配合QueryWrapper使用 + * + * @author 云筑产品开发平台组 + * @version v3.4.8 + * @copyrignt 深圳市乐程软件有限公司 + * @date 2023-04-20 + */ +public abstract class MyBatisPrimaryBase { + + { + ParameterizedType parameterizedType = (ParameterizedType) this.getClass().getGenericSuperclass(); + Type[] actualTypeArguments = parameterizedType.getActualTypeArguments(); + Class clz = (Class)actualTypeArguments[0]; + try { + entity = clz.getDeclaredConstructor().newInstance(); + } catch (Exception ignore) {} + } + + @Schema(description = "查询器") + protected QueryWrapper queryWrapper = new QueryWrapper<>(); + + private T entity; + + @Schema(description = "获取处理后的查询器") + public QueryWrapper getQuery(){ + try{ + for (Field field : this.getClass().getDeclaredFields()) { + try{ + TableField annotation = entity.getClass().getDeclaredField(field.getName()).getAnnotation(TableField.class); + String columnName; + if(annotation != null) { + columnName = annotation.value(); + }else if(field.getName().equalsIgnoreCase("id")) { + columnName = "F_Id"; + }else if(field.getName().equalsIgnoreCase("creatorId")){ + columnName = "F_Creator_Id"; + }else { + columnName = field.getName(); + } + field.setAccessible(true); + Object value = field.get(this); + if(value != null) queryWrapper.eq(columnName, value); + }catch (Exception ignore){} + } + }catch (Exception ignore){} + return queryWrapper; + } + + @Schema(description = "获取实例") + public T getEntity() throws Exception { + checkEntity(); + for (Field field : this.getClass().getDeclaredFields()) { + for (Field entityField : entity.getClass().getDeclaredFields()) { + if(entityField.getName().equals(field.getName())){ + entityField.setAccessible(true); + field.setAccessible(true); + entityField.set(entity, field.get(this)); + } + } + } + return entity; + } + + private void checkEntity() throws Exception{ + for (Field field : this.getClass().getFields()) { + Object o = field.get(this); + if(o == null){ + throw new DataException(MsgCode.DB011.get(field.getName())); + } + } + } + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/OnlineUserModel.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/OnlineUserModel.java new file mode 100644 index 0000000..316da1b --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/OnlineUserModel.java @@ -0,0 +1,50 @@ +package com.yunzhupaas.message.util; + +import lombok.Data; + +import jakarta.websocket.Session; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/16 10:51 + */ +@Data +public class OnlineUserModel { + /** + * 连接Id + */ + private String connectionId; + /** + * 用户Id + */ + private String userId; + /** + * 租户Id + */ + private String tenantId; + + public String getTenantId() { + return tenantId = tenantId == null ? "" : tenantId; + } + + /** + * 移动端 + */ + private Boolean isMobileDevice; + /** + * token + */ + private String token; + /** + * session + */ + private Session webSocket; + /** + * session + */ + private String systemId; +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/OnlineUserProvider.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/OnlineUserProvider.java new file mode 100644 index 0000000..38b9599 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/OnlineUserProvider.java @@ -0,0 +1,157 @@ +package com.yunzhupaas.message.util; + +import cn.dev33.satoken.stp.StpUtil; +import com.alibaba.fastjson.JSONObject; +import com.yunzhupaas.consts.AuthConsts; +import com.yunzhupaas.util.UserProvider; +import lombok.extern.slf4j.Slf4j; +import org.springframework.util.ObjectUtils; + +import jakarta.websocket.Session; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +import static com.yunzhupaas.consts.AuthConsts.TOKEN_PREFIX; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/16 10:51 + */ +@Slf4j +public class OnlineUserProvider { + + /** + * 在线用户 + */ + private static final List onlineUserList = new ArrayList<>(); + + public static List getOnlineUserList() { + return OnlineUserProvider.onlineUserList; + } + + + public static void addModel(OnlineUserModel model){ + synchronized (onlineUserList) { + OnlineUserProvider.onlineUserList.add(model); + } + } + + public static void removeModel(OnlineUserModel onlineUserModel){ + synchronized (onlineUserList) { + onlineUserList.remove(onlineUserModel); + } + } + + + + // =================== Websocket相关操作 =================== + + /** + * 根据Token精准推送Websocket 登出消息 + * @param token + */ + public static void removeWebSocketByToken(String... token) { + List tokens = Arrays.stream(token).map(t -> t.contains(AuthConsts.TOKEN_PREFIX) ? t : TOKEN_PREFIX + " " + t).collect(Collectors.toList()); + //清除websocket登录状态 + List users = OnlineUserProvider.getOnlineUserList().stream().filter(t -> tokens.contains(t.getToken())).collect(Collectors.toList()); + if (!ObjectUtils.isEmpty(users)) { + for (OnlineUserModel user : users) { + OnlineUserProvider.logoutWS(user, null); + //先移除对象, 并推送下线信息, 避免网络原因导致就用户未断开 新用户连不上WebSocket + OnlineUserProvider.removeModel(user); + //通知所有在线,有用户离线 + for (OnlineUserModel item : OnlineUserProvider.getOnlineUserList().stream().filter(t -> !Objects.equals(user.getUserId(), t.getUserId()) && !Objects.equals(user.getTenantId(),t.getTenantId())).collect(Collectors.toList())) { + if (!item.getUserId().equals(user.getUserId())) { + JSONObject obj = new JSONObject(); + obj.put("method", "Offline"); + //推送给前端 + OnlineUserProvider.sendMessage(item, obj); + + } + } + } + } + } + + /** + * 根据用户ID 推送全部Websocket 登出消息 + * @param userId + */ + public static void removeWebSocketByUser(String userId) { + List tokens = StpUtil.getTokenValueListByLoginId(UserProvider.splicingLoginId(userId)); + removeWebSocketByToken(tokens.toArray(new String[tokens.size()])); + } + + /** + * 发送用户退出消息 + * @param session + */ + public static void logoutWS(OnlineUserModel onlineUserModel, Session session) { + JSONObject obj = new JSONObject(); + obj.put("method", "logout"); + obj.put("token", onlineUserModel.getToken()); + if(onlineUserModel != null) { + sendMessage(onlineUserModel, obj); + }else{ + sendMessage(session, obj); + } + } + + + /** + * 发送关闭WebSocket消息, 前端不在重连 + * @param session + */ + public static void closeFrontWs(OnlineUserModel onlineUserModel, Session session) { + JSONObject obj = new JSONObject(); + obj.put("method", "closeSocket"); + if(onlineUserModel != null) { + sendMessage(onlineUserModel, obj); + }else{ + sendMessage(session, obj); + } + } + + + public static void sendMessage(OnlineUserModel onlineUserModel, Object message){ + Session session = onlineUserModel.getWebSocket(); + synchronized (session) { + + try { + if (session.isOpen()) { + session.getAsyncRemote().sendText(JSONObject.toJSONString(message)); + }else{ + log.debug("WS未打开: {}, {}, {}, {}, {}", onlineUserModel.getTenantId(), session.getId(), onlineUserModel.getUserId(), onlineUserModel.getToken(), message); + try{ + session.close(); + }catch (Exception ee){ + } + finally { + OnlineUserProvider.removeModel(onlineUserModel); + } + } + }catch (Exception e){ + log.debug(String.format("WS消息发送失败: %s, %s, %s, %s, %s", onlineUserModel.getTenantId(), session.getId(), onlineUserModel.getUserId(), onlineUserModel.getToken(), message), e); + } + } + } + + public static void sendMessage(Session session, Object message){ + OnlineUserModel onlineUserModel = OnlineUserProvider.getOnlineUserList().stream().filter(t -> t.getConnectionId().equals(session.getId())).findFirst().orElse(null); + if(onlineUserModel == null){ + onlineUserModel = new OnlineUserModel(); + onlineUserModel.setWebSocket(session); + } + synchronized (session) { + sendMessage(onlineUserModel, message); + } + } + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/QyWebChatUtil.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/QyWebChatUtil.java new file mode 100644 index 0000000..ef0f385 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/QyWebChatUtil.java @@ -0,0 +1,92 @@ +package com.yunzhupaas.message.util; + +import com.alibaba.fastjson.JSONObject; +import com.yunzhupaas.util.wxutil.HttpUtil; + +/** + * 企业微信的接口类 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021/4/21 8:20 + */ +public class QyWebChatUtil { + + /** + * 获取企业微信TOKEN的接口路径 + */ + public static final String TOKEN = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=%s&corpsecret=%s"; + + /** + * 往企业微信发送消息的接口路径 + */ + public static final String SEND_MESSAGE = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=%s"; + + + /** + * 获取接口访问凭证 + */ + public static JSONObject getAccessToken(String corpId, String corpSecret) { + JSONObject retMsg = new JSONObject(); + JSONObject rstObj = HttpUtil.httpRequest(String.format(TOKEN,corpId, corpSecret), "GET", null); +// JSONObject rstObj = HttpUtil.httpRequest(QyApi.getTokenUrl(corpId, corpSecret), "GET", null); + return rstObj; + } + + + /** + * 发送消息 20210416 Add By GongXishan + * 不抛出异常,返回Json + */ + public static JSONObject sendMessage(String message, String accessToken){ + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + JSONObject rstObj = HttpUtil.httpRequest(String.format(SEND_MESSAGE, accessToken), "POST", message); +// JSONObject rstObj = HttpUtil.httpRequest(QyApi.sendMessage(accessToken), "POST", message); + if (HttpUtil.isWxError(rstObj)) { + codeFlag = false; + errorMsg = rstObj.toString(); + } + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + return retMsg; + } + + + /** + * 向企业微信发送信息 + * @param corpId + * @param corpSecret + * @param agentId + * @param toUserId + * @param contents + * @return + */ + public static JSONObject sendWxMessage(String corpId, String corpSecret, String agentId, String toUserId, String contents) { + JSONObject retMsg = null; + JSONObject message = null; + JSONObject tokenObject = null; + JSONObject content = null; + + message = new JSONObject(); + message.put("touser", toUserId); + message.put("agentid", agentId); + content = new JSONObject(); + content.put("content", contents); + message.put("text", content); + message.put("msgtype", "text"); + tokenObject = getAccessToken(corpId, corpSecret); + if(tokenObject.getString("access_token")!=null && !"".equals(tokenObject.getString("access_token"))){ + retMsg = sendMessage(message.toJSONString(), tokenObject.getString("access_token")); + }else + { + retMsg.put("code",false); + retMsg.put("error","access_token值为空,不能发送信息!"); + } + return retMsg; + } + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/SendMessageTypeEnum.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/SendMessageTypeEnum.java new file mode 100644 index 0000000..4266ebb --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/SendMessageTypeEnum.java @@ -0,0 +1,44 @@ +package com.yunzhupaas.message.util; + +/** + * 消息类型 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-07-10 + */ +public enum SendMessageTypeEnum { + + /** + * 文本消息 + */ + MESSAGE_TEXT("text"), + /** + * 语音消息 + */ + MESSAGE_VOICE("voice"), + /** + * 图片消息 + */ + MESSAGE_IMAGE("image"); + + SendMessageTypeEnum() { + } + + private String message; + + SendMessageTypeEnum(String message) { + this.message = message; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/SynThirdConsts.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/SynThirdConsts.java new file mode 100644 index 0000000..f3342ee --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/SynThirdConsts.java @@ -0,0 +1,71 @@ +package com.yunzhupaas.message.util; + +/** + * 第三方工具实体类 + * + * @author YUNZHUPAAS + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021/4/27 8:44 + */ +public class SynThirdConsts { + /** + * 第三方工具类型(1:企业微信;2:钉钉) + * 改为 + * 第三方工具类型(1:本地到企业微信;11:企业微信到本地;2:本地到钉钉;22:钉钉到本地) + */ + public static final String THIRD_TYPE_QY = "1"; + + public static final String THIRD_TYPE_QY_To_Sys = "11"; + /** + * 本地到钉钉 + */ + public static final String THIRD_TYPE_DING = "2"; + /** + * 钉钉到本地 + */ + public static final String THIRD_TYPE_DING_To_Sys = "22"; + + /** + * 数据类型(1:组织(公司与部门);2:用户) + */ + public static final String DATA_TYPE_ORG = "1"; + public static final String DATA_TYPE_USER = "2"; + + /** + * 对象操作类型(add:创建;upd:修改) + */ + public static final String OBJECT_OP_ADD = "add"; + public static final String OBJECT_OP_UPD = "upd"; + + /** + * 本系统组织对象类型(company:公司;department:部门) + */ + public static final String OBJECT_TYPE_COMPANY = "company"; + public static final String OBJECT_TYPE_DEPARTMENT = "department"; + + /** + * 同步方向类型(1:本系统同步到第三方;2:第三方同步到本系统) + */ + public static final Integer SYN_SYSTEM_TO_THIRD = 1; + public static final Integer SYN_THIRD_TO_SYSTEM = 2; + + /** + * 同步状态值(0:未同步;1:同步成功;2:同步失败) + */ + public static final Integer SYN_STATE_NO = 0; + public static final Integer SYN_STATE_OK = 1; + public static final Integer SYN_STATE_FAIL = 2; + + /** + * 企业微信的部门根节点ID + */ + public static String QY_ROOT_DEPT_ID = "1"; + + /** + * 钉钉的部门根节点ID + */ + public static Long DING_ROOT_DEPT_ID = 1L; + +} diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/SynThirdTotal.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/SynThirdTotal.java new file mode 100644 index 0000000..0c26ccf --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/SynThirdTotal.java @@ -0,0 +1,50 @@ +package com.yunzhupaas.message.util; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * 同步统计信息模型 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021/5/10 11:21 + */ +@Data +public class SynThirdTotal { + /** + * 同步类型 + */ + @Schema(description = "同步类型") + private String synType; + /** + * 记录总数 + */ + @Schema(description = "记录总数") + private Integer recordTotal; + /** + * 同步成功记录数 + */ + @Schema(description = "同步成功记录数") + private Long synSuccessCount; + /** + * 同步失败记录数 + */ + @Schema(description = "同步失败记录数") + private Long synFailCount; + /** + * 未同步记录数 + */ + @Schema(description = "未同步记录数") + private Long unSynCount; + /** + * 最后同步时间 + */ + @Schema(description = "最后同步时间") + private Date synDate; + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/WebHookUtil.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/WebHookUtil.java new file mode 100644 index 0000000..4f74728 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/WebHookUtil.java @@ -0,0 +1,405 @@ +package com.yunzhupaas.message.util; + +import cn.hutool.http.HttpUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.yunzhupaas.util.DateUtil; +import com.yunzhupaas.util.StringUtil; +import okhttp3.*; +import org.apache.http.HttpResponse; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.util.EntityUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.net.URL; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.util.*; + +public class WebHookUtil { + /** + * post请求以及参数是json + * + * @param url + * @param jsonParams + * @return + */ + public static JSONObject doPostForJson(String url, String jsonParams) { + CloseableHttpClient httpClient = HttpClients.createDefault(); + JSONObject jsonObject = null; + HttpPost httpPost = new HttpPost(url); + RequestConfig requestConfig = RequestConfig.custom(). + setConnectTimeout(180 * 1000).setConnectionRequestTimeout(180 * 1000) + .setSocketTimeout(180 * 1000).setRedirectsEnabled(true).build(); + httpPost.setConfig(requestConfig); + httpPost.setHeader("Content-Type", "application/json"); + try { + httpPost.setEntity(new StringEntity(jsonParams, ContentType.create("application/json", "utf-8"))); + System.out.println("request parameters" + EntityUtils.toString(httpPost.getEntity())); + System.out.println("httpPost:" + httpPost); + HttpResponse response = httpClient.execute(httpPost); + if (response != null && response.getStatusLine().getStatusCode() == 200) { + String result = EntityUtils.toString(response.getEntity()); + System.out.println("result:" + result); + jsonObject = JSONObject.parseObject(result); + return jsonObject; + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (null != httpClient) { + try { + httpClient.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + return jsonObject; + } + } + + /** + * 基础验证 + * @param url webhook地址 + * @param msgList 消息内容 + */ + public static void sendMsgBasic(String url,List msgList, String userName,String password) { + //飞书机器人url 通过webhook将自定义服务的消息推送至飞书 + String content = userName + ":" + password; + String token = "Basic " + Base64.getEncoder().encodeToString(content.getBytes(StandardCharsets.UTF_8)); + Map params = new LinkedHashMap<>(); + params.put("msg_type", "text"); + Map contentMap = new HashMap<>(); + params.put("content", contentMap); + + StringBuilder stringBuilder = new StringBuilder(); + msgList.forEach(e -> { + stringBuilder.append(e + "\n"); + }); + + contentMap.put("text", stringBuilder.toString()); + + doPostForJsonObject(url, JSON.toJSONString(params),token); + } + + + /** + * post请求以及参数是json + * + * @param url + * @param jsonParams + * @return + */ + public static JSONObject doPostForJsonObject(String url, String jsonParams,String token) { + CloseableHttpClient httpClient = HttpClients.createDefault(); + JSONObject jsonObject = null; + HttpPost httpPost = new HttpPost(url); + RequestConfig requestConfig = RequestConfig.custom(). + setConnectTimeout(180 * 1000).setConnectionRequestTimeout(180 * 1000) + .setSocketTimeout(180 * 1000).setRedirectsEnabled(true).build(); + httpPost.setConfig(requestConfig); + httpPost.setHeader("Content-Type", "application/json"); + httpPost.setHeader("Authorization", token); + try { + httpPost.setEntity(new StringEntity(jsonParams, ContentType.create("application/json", "utf-8"))); + System.out.println("request parameters" + EntityUtils.toString(httpPost.getEntity())); + System.out.println("httpPost:" + httpPost); + HttpResponse response = httpClient.execute(httpPost); + if (response != null && response.getStatusLine().getStatusCode() == 200) { + String result = EntityUtils.toString(response.getEntity()); + System.out.println("result:" + result); + jsonObject = JSONObject.parseObject(result); + return jsonObject; + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (null != httpClient) { + try { + httpClient.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + return jsonObject; + } + } + + /** + * 把timestamp+"\n"+密钥当做签名字符串并计算签名 + * @param secret bearer令牌 + * @param timestamp 当前时间的时间戳格式 + * @return + * @throws NoSuchAlgorithmException + * @throws InvalidKeyException + */ + private static String GenSign(String secret, Long timestamp) throws NoSuchAlgorithmException, InvalidKeyException { + //把timestamp+"\n"+密钥当做签名字符串 + String stringToSign = timestamp + "\n" + secret; + + //使用HmacSHA256算法计算签名 + Mac mac = Mac.getInstance("HmacSHA256"); + mac.init(new SecretKeySpec(secret.getBytes(StandardCharsets.UTF_8), "HmacSHA256")); + byte[] signData = mac.doFinal(stringToSign.getBytes(StandardCharsets.UTF_8)); + return new String(Base64.getEncoder().encode(signData)); + } + + /** + * 对接飞书机器人发送消息(webhook),bearer令牌类型 + * @param url 飞书机器人webhook的值 + * @param msgList 消息内容 + * @param Secret bearer令牌 + * @throws NoSuchAlgorithmException + * @throws InvalidKeyException + */ + public static void sendMsg(String url, List msgList, String Secret) throws NoSuchAlgorithmException, InvalidKeyException { + //飞书机器人url 通过webhook和密钥将自定义服务的消息推送至飞书 + Map params = new LinkedHashMap<>(); + Long timestamp = DateUtil.getTime(DateUtil.getNowDate()); + String sign = GenSign(Secret,timestamp); + params.put("msg_type", "text"); + params.put("timestamp",timestamp); + params.put("sign",sign); + Map contentMap = new HashMap<>(); + params.put("content", contentMap); + + StringBuilder stringBuilder = new StringBuilder(); + msgList.forEach(e -> { + stringBuilder.append(e + "\n"); + }); + + contentMap.put("text", stringBuilder.toString()); + + + doPostForJson(url, JSON.toJSONString(params)); + } + + /** + * 对接飞书机器人发送消息(webhook),无bearer令牌 + * @param url 飞书机器人webhook的值 + * @param msgList 消息内容 + */ + public static void sendMsgNoSecret(String url,List msgList) { + //飞书机器人url 通过webhook将自定义服务的消息推送至飞书 + Map params = new LinkedHashMap<>(); + params.put("msg_type", "text"); + Map contentMap = new HashMap<>(); + params.put("content", contentMap); + + StringBuilder stringBuilder = new StringBuilder(); + msgList.forEach(e -> { + stringBuilder.append(e + "\n"); + }); + + contentMap.put("text", stringBuilder.toString()); + + doPostForJson(url, JSON.toJSONString(params)); + } + + + private static Logger logger = LoggerFactory.getLogger(WebHookUtil.class); + + /** + * 发送POST请求,参数是Map, contentType=x-www-form-urlencoded + * + * @param url + * @param mapParam + * @return + */ + public static String sendPostByMap(String url, Map mapParam) { + Map headParam = new HashMap(); + headParam.put("Content-type", "application/json;charset=UTF-8"); + return sendPost(url, mapParam, headParam); + } + + /** + * 向指定 URL 发送POST方法的请求 + * + * @param url 发送请求的 URL + * @param param 请求参数, + * @return 所代表远程资源的响应结果 + */ + public static String sendPost(String url, Map param, Map headParam) { + PrintWriter out = null; + BufferedReader in = null; + String result = ""; + try { + URL realUrl = new URL(url); + // 打开和URL之间的连接 + URLConnection conn = realUrl.openConnection(); + // 设置通用的请求属性 请求头 + conn.setRequestProperty("accept", "*/*"); + conn.setRequestProperty("connection", "Keep-Alive"); + conn.setRequestProperty("user-agent", + "Fiddler"); + + if (headParam != null) { + for (Map.Entry entry : headParam.entrySet()) { + conn.setRequestProperty(entry.getKey(), entry.getValue()); + } + } + // 发送POST请求必须设置如下两行 + conn.setDoOutput(true); + conn.setDoInput(true); + // 获取URLConnection对象对应的输出流 + out = new PrintWriter(conn.getOutputStream()); + // 发送请求参数 + out.print(JSON.toJSONString(param)); + // flush输出流的缓冲 + out.flush(); + // 定义BufferedReader输入流来读取URL的响应 + in = new BufferedReader( + new InputStreamReader(conn.getInputStream())); + String line; + while ((line = in.readLine()) != null) { + result += line; + } + } catch (Exception e) { + logger.info("发送 POST 请求出现异常!" + e); + e.printStackTrace(); + } + //使用finally块来关闭输出流、输入流 + finally { + try { + if (out != null) { + out.close(); + } + if (in != null) { + in.close(); + } + } catch (IOException ex) { + ex.printStackTrace(); + } + } + return result; + } + + + + + /** + * 发送文字消息 + * + * @param msg 需要发送的消息 + * @return + * @throws Exception + */ + public static String sendTextMsg(String msg){ + JSONObject text = new JSONObject(); + text.put("content", msg); + JSONObject reqBody = new JSONObject(); + reqBody.put("msgtype", "text"); + reqBody.put("text", text); + reqBody.put("safe", 0); + + return reqBody.toString(); + } + + + /** + * 对接企业微信机器人发送消息(webhook) + * @content:要发送的消息 + * WECHAT_GROUP:机器人的webhook + */ + public static JSONObject callWeChatBot(String url,String content){ + OkHttpClient client = new OkHttpClient() + .newBuilder() + .build(); + MediaType mediaType = MediaType.parse("application/json"); + content = sendTextMsg(content); + RequestBody body = RequestBody.create(content,mediaType); + Request request = new Request.Builder() + .url(url) + .method("POST", body) + .addHeader("Content-Type", "application/json") + .build(); + String result = ""; + try (Response response = client.newCall(request).execute()){ + result = response.body().string(); + } catch (IOException e) { + e.printStackTrace(); + } + + return JSONObject.parseObject(result); + } + + + /** + * 对接钉钉机器人发送消息(webhook) + * @param url 钉钉上获取到的webhook的值 + * @param msg 发送的消息内容 + */ + public static JSONObject sendDDMessage(String url,String msg) { + //钉钉的webhook + //请求的JSON数据,这里用map在工具类里转成json格式 + Map json = new HashMap(); + Map text = new HashMap(); + json.put("msgtype", "text"); + text.put("content", msg); + json.put("text", text); + //发送post请求 + String response = WebHookUtil.sendPostByMap(url, json); + return JSONObject.parseObject(response); + } + + /** + * 通过加签方式调用钉钉机器人发送消息给所有人 + */ + public static JSONObject sendDingDing(String url,String Secret,String content) { + + try { + //钉钉机器人地址(配置机器人的webhook) + Long timestamp = System.currentTimeMillis(); + String sign = GenSign(Secret,timestamp); + String stringToSign = timestamp + "\n" + Secret; + String dingUrl = url + "×tamp=" + timestamp + "&sign=" + URLEncoder.encode(sign, "UTF-8"); + + //是否通知所有人 + boolean isAtAll = true; + //通知具体人的手机号码列表 +// List mobileList = Lists.newArrayList(); + //mobileList.add("+86-159*******"); + + + //消息内容 + Map contentMap = Maps.newHashMap(); + contentMap.put("content", content); + //通知人 + Map atMap = Maps.newHashMap(); + //1.是否通知所有人 + atMap.put("isAtAll", isAtAll); + //2.通知具体人的手机号码列表 +// atMap.put("atMobiles", mobileList); + + Map reqMap = Maps.newHashMap(); + reqMap.put("msgtype", "text"); + reqMap.put("text", contentMap); + reqMap.put("at", atMap); + //推送消息(http请求) + String result = sendPostByMap(dingUrl, reqMap); + return JSONObject.parseObject(result); + }catch (Exception e){ + e.printStackTrace(); + } + return null; + } + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/YunzhupaasMessageUtil.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/YunzhupaasMessageUtil.java new file mode 100644 index 0000000..b9dc832 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/YunzhupaasMessageUtil.java @@ -0,0 +1,41 @@ +package com.yunzhupaas.message.util; + +import com.yunzhupaas.message.entity.MessageEntity; +import com.yunzhupaas.message.entity.MessageReceiveEntity; +import com.yunzhupaas.util.RandomUtil; + +import java.util.Date; + +/** + * 消息实体类 + * + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021/4/22 9:06 + */ +public class YunzhupaasMessageUtil { + public static MessageEntity setMessageEntity(String userId, String title, String bodyText, Integer recType) { + MessageEntity entity = new MessageEntity(); + entity.setTitle(title); + entity.setBodyText(bodyText); + entity.setId(RandomUtil.uuId()); + // entity.setType(recType); + entity.setCreatorUserId(userId); + entity.setCreatorTime(new Date()); + entity.setLastModifyTime(entity.getCreatorTime()); + entity.setLastModifyUserId(entity.getCreatorUserId()); + return entity; + } + + public static MessageReceiveEntity setMessageReceiveEntity(String toUserId, String title, Integer sendType) { + MessageReceiveEntity entity = new MessageReceiveEntity(); + entity.setId(RandomUtil.uuId()); + entity.setUserId(toUserId); + entity.setIsRead(0); + entity.setType(sendType); + entity.setFlowType(1); + entity.setTitle(title); + return entity; + } +} diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/unipush/UinPush.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/unipush/UinPush.java new file mode 100644 index 0000000..853964c --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/unipush/UinPush.java @@ -0,0 +1,27 @@ +package com.yunzhupaas.message.util.unipush; + +import com.yunzhupaas.config.ConfigValueUtil; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.List; + + +@Component +@Slf4j +public class UinPush { + @Autowired + private ConfigValueUtil configValueUtil; + + public void sendUniPush(List cidList, String title, String content, String type, String text){ + if(cidList !=null && cidList.size()>0 ) { + String cid = StringUtils.join(cidList,","); + String url = configValueUtil.getAppPushUrl() + "?clientId=" + cid + "&title=" + title + "&content=" + content + "&text=" + text + "&create=true"; + cn.hutool.http.HttpUtil.get(url); + } + } + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/weixingzh/WXGZHWebChatUtil.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/weixingzh/WXGZHWebChatUtil.java new file mode 100644 index 0000000..6fa61d1 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/weixingzh/WXGZHWebChatUtil.java @@ -0,0 +1,383 @@ +package com.yunzhupaas.message.util.weixingzh; + +import com.alibaba.fastjson.JSONObject; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.wxutil.HttpUtil; +import lombok.extern.slf4j.Slf4j; +import org.dom4j.Document; +import org.dom4j.DocumentException; +import org.dom4j.DocumentHelper; +import org.dom4j.Element; +import org.dom4j.io.SAXReader; + +import jakarta.servlet.http.HttpServletRequest; +import java.io.InputStream; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.*; + +/** + * 微信的接口类 + */ +@Slf4j +public class WXGZHWebChatUtil { + + /** + * api + */ + public static final String API_DEFAULT_HOST_URL = "https://api.weixin.qq.com"; + + /** + * mq + */ + public static final String MP_DEFAULT_HOST_URL = "https://mp.weixin.qq.com"; + + /** + * open + */ + public static final String OPEN_DEFAULT_HOST_URL = "https://open.weixin.qq.com"; + + /** + * 获取接口访问凭证 + * + * @param appID + * @param appsecret + * @return 数据格式 + * { + * "access_token": "token", + * "expires_in": 7200 + * } + */ + public static String getAccessToken(String appID, String appsecret) { + String requestUrl = API_DEFAULT_HOST_URL + "/cgi-bin/token?grant_type=client_credential&appid=" + appID + + "&secret=" + appsecret; + JSONObject rstObj = HttpUtil.httpRequest(requestUrl, "GET", null); + String token = null; + if (rstObj.containsKey("access_token")) { + token = rstObj.getString("access_token"); + } + return token; + } + + /** + * 获取用户列表 + * + * @param accessToken token + * @param nextOpenId 第一个拉取的OPENID,不填默认从头开始拉取,一次只能拉取100个用户,最后一个用户openId需要放进来拉取接下来的数据 + * @return 数据格式 + * { + * "total": 2, + * "count": 2, + * "data": { + * "openid": [ + * "oD09N5rLh6juzOPA55C3YTo-hYJk", + * "oD09N5jXQ47rNed4oyAlqQz9X348" + * ] + * }, + * "next_openid": "oD09N5jXQ47rNed4oyAlqQz9X348" + * } + */ + public static JSONObject getUsetList(String accessToken, String nextOpenId) { + String requestUrl = API_DEFAULT_HOST_URL + "/cgi-bin/user/get?access_token=" + accessToken + "&next_openid=" + + nextOpenId; + JSONObject rstObj = HttpUtil.httpRequest(requestUrl, "GET", null); + return rstObj; + } + + /** + * 获取用户信息 + * + * @param accessToken token + * @param openid openid + * @return 数据格式 + * { + * "subscribe": 1, + * "openid": "o6FJX1tay8i-431nidzispv2xrhs", + * "nickname": "", + * "sex": 0, + * "language": "zh_CN", + * "city": "", + * "province": "", + * "country": "", + * "headimgurl": "", + * "subscribe_time": 1648562407, + * "unionid": "oear46TQmAj0UZmM3jMYVYU1rS8o", + * "remark": "", + * "groupid": 0, + * "tagid_list": [ ], + * "subscribe_scene": "ADD_SCENE_QR_CODE", + * "qr_scene": 0, + * "qr_scene_str": "" + * } + */ + public static JSONObject getUsetInfo(String accessToken, String openid) { + String requestUrl = API_DEFAULT_HOST_URL + "/cgi-bin/user/info?access_token=" + accessToken + "&openid=" + + openid; + JSONObject rstObj = HttpUtil.httpRequest(requestUrl, "GET", null); + return rstObj; + } + + /** + * 返回消息模板列表 + * + * @param accessToken + * @return + */ + public static JSONObject getMessageList(String accessToken) { + String requestUrl = API_DEFAULT_HOST_URL + "/cgi-bin/template/get_all_private_template?access_token=" + + accessToken; + JSONObject rstObj = HttpUtil.httpRequest(requestUrl, "GET", null); + return rstObj; + } + + /** + * 发送消息 + * + * @param accessToken + * @return + */ + public static JSONObject sendMessage(String accessToken, String message) { + + String messageUrl = API_DEFAULT_HOST_URL + "/cgi-bin/message/template/send?access_token=" + accessToken; + + JSONObject rst = new JSONObject(); + log.info("传递微信公众号参数" + message.toString()); + + JSONObject rstMessageObj = HttpUtil.httpRequest(messageUrl, "POST", message.toString()); + log.info("接收微信公众号参数" + rstMessageObj.toString()); + + boolean codeFlag = true; + if (Integer.parseInt(rstMessageObj.get("errcode").toString()) != 0) { + codeFlag = false; + } + rst.put("code", codeFlag); + rst.put("error", rstMessageObj.get("errmsg").toString()); + return rst; + } + + /** + * 发送消息--关注发送消息模板 + * + * @param accessToken + * @return + */ + public static JSONObject sendMessageByGZ(String accessToken, String touser) { + + String messageUrl = API_DEFAULT_HOST_URL + "/cgi-bin/message/template/send?access_token=" + accessToken; + + JSONObject message = new JSONObject(); + JSONObject content = new JSONObject(); + JSONObject first = new JSONObject(); + JSONObject rst = new JSONObject(); + + message.put("touser", touser); + message.put("template_id", "qfrvB432USum5H2E1fipzpR8nhGgcS8Ullw-ImTScUQ"); + Random r = new Random(); + message.put("client_msg_id", "MSG_" + r.nextInt(99999999)); + + first.put("value", + "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx184aaa643b114a92&redirect_uri=http%3A%2F%2Facg53k.natappfree.cc&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"); + first.put("color", "#173177"); + + content.put("first", first); + + message.put("data", content); + System.out.println(message.toString()); + + JSONObject rstMessageObj = HttpUtil.httpRequest(messageUrl, "POST", message.toString()); + System.out.println(rstMessageObj); + + boolean codeFlag = true; + if (Integer.parseInt(rstMessageObj.get("errcode").toString()) != 0) { + codeFlag = false; + } + rst.put("code", codeFlag); + rst.put("error", rstMessageObj.get("errmsg").toString()); + System.out.println("a"); + return rst; + } + + /** + * 获取接口访问凭证 + * + * @return 数据格式 + * { + * "access_token": "token", + * "expires_in": 7200 + * } + */ + public static String getQRCodeTiket(String accessToken, String userId) { + String requestUrl = API_DEFAULT_HOST_URL + "/cgi-bin/qrcode/create?access_token=" + accessToken; + String a = "{\"action_name\": \"QR_LIMIT_SCENE\", \"action_info\": {\"scene\": {\"scene_id\": " + userId + + "}}}"; + JSONObject rstObj = HttpUtil.httpRequest(requestUrl, "GET", null); + String token = null; + if (rstObj.containsKey("access_token")) { + token = rstObj.getString("access_token"); + } + return token; + } + + /** + * 参数排序 + * + * @param token + * @param timestamp + * @param nonce + * @return + */ + public static String sort(String token, String timestamp, String nonce) { + String[] strArray = { token, timestamp, nonce }; + Arrays.sort(strArray); + StringBuilder sb = new StringBuilder(); + for (String str : strArray) { + sb.append(str); + } + return sb.toString(); + } + + /** + * 字符串进行shal加密 + * + * @param str + * @return + */ + public static String shal(String str) { + try { + MessageDigest digest = MessageDigest.getInstance("SHA-1"); + digest.update(str.getBytes()); + byte messageDigest[] = digest.digest(); + + StringBuffer hexString = new StringBuffer();// 字节数组转换为十六进制数 + for (int i = 0; i < messageDigest.length; i++) { + String shaHex = Integer.toHexString(messageDigest[i] & 0xFF); + if (shaHex.length() < 2) { + hexString.append(0); + } + hexString.append(shaHex); + } + return hexString.toString(); + } catch (NoSuchAlgorithmException e) { + e.printStackTrace(); + } + return ""; + } + + /** + * @description 将xml字符串转换成map + * @param xml + * @return Map + */ + public static Map xmlToMap(String xml) { + Map map = new HashMap(); + Document doc = null; + try { + doc = DocumentHelper.parseText(xml); // 将字符串转为XML + Element rootElt = doc.getRootElement(); // 获取根节点 + List list = rootElt.elements();// 获取根节点下所有节点 + for (Element element : list) { // 遍历节点 + map.put(element.getName(), element.getText()); // 节点的name为map的key,text为map的value + } + } catch (DocumentException e) { + e.printStackTrace(); + } catch (Exception e) { + e.printStackTrace(); + } + return map; + } + + /** + * dom4j解析 xmL转换为map + * + * @param request + * @return + * @throws Exception + */ + public static Map parseXml(HttpServletRequest request) throws Exception { + // 将解析结果存储在HashMap中 + Map map = new HashMap(); + // 从request中取得输入流 + InputStream inputstream = request.getInputStream(); + // 读取输入流 + SAXReader reader = new SAXReader(); + reader.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); + // reader.setFeature("http://xml.org/sax/features/external-general-entities", + // false); + // reader.setFeature("http://xml.org/sax/features/external-parameter-entities", + // false); + // reader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", + // false); + org.dom4j.Document document = reader.read(inputstream); + // 得到kmL根元素 + org.dom4j.Element root = document.getRootElement(); + // 得到根元素的所有子节点 + List elementList = root.elements(); + // 遍历所有子节点 + for (org.dom4j.Element e : elementList) { + map.put(e.getName(), e.getText()); + } + // 释放资源 + inputstream.close(); + inputstream = null; + return map; + } + + /** + * 生成xml消息 + * + * @param encrypt 加密后的消息密文 + * @param signature 安全签名 + * @param timestamp 时间戳 + * @param nonce 随机字符串 + * @return 生成的xml字符串 + */ + public static String generate(String encrypt, String signature, String timestamp, String nonce) { + + String format = "\n" + "\n" + + "\n" + + "%3$s\n" + "\n" + ""; + return String.format(format, encrypt, signature, timestamp, nonce); + + } + + /** + * 消息json组装 + */ + public static String messageJson(String templateId, String openId, String xcxAppId, String pagepath, + Map parameterMap, String title, String type, String link) { + + String color = "#173177"; + TreeMap> params = new TreeMap<>(); + WxTemplateMsg wxTemplateMsg = new WxTemplateMsg(); + for (String key : parameterMap.keySet()) { + String field = key; + String fieldValue = String.valueOf(parameterMap.get(key)); + field = field.replace("{{", ""); + field = field.replace(".DATA}}", ""); + // 根据具体模板参数组装 + params.put(field, WxTemplateMsg.item(fieldValue, color)); + } + // 消息标题 + if (title != null && !title.isEmpty()) { + params.put("title", WxTemplateMsg.item(title, color)); + } + + // 模版ID + wxTemplateMsg.setTemplate_id(templateId); + // openId + wxTemplateMsg.setTouser(openId); + // 关键字赋值 + wxTemplateMsg.setData(params); + if (!"1".equals(type)) { + wxTemplateMsg.setUrl(link); + } else { + // 跳转小程序 + wxTemplateMsg.setMiniprogram(WxTemplateMsg.miniprogramData(xcxAppId, pagepath)); + wxTemplateMsg.setUrl(""); + } + String data = JsonUtil.getObjectToString(wxTemplateMsg); + log.info("微信公众号消息参数封装" + data); + return data; + } + +} diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/weixingzh/WxTemplateMsg.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/weixingzh/WxTemplateMsg.java new file mode 100644 index 0000000..60a6ba0 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/weixingzh/WxTemplateMsg.java @@ -0,0 +1,65 @@ +package com.yunzhupaas.message.util.weixingzh; + +import com.alibaba.fastjson.JSONObject; +import lombok.Data; + +import java.util.TreeMap; + +@Data +public class WxTemplateMsg { + + /** + * 接收者openId + */ + private String touser; + /** + * 模板ID + */ + private String template_id; + + /** + * 防重入id。对于同一个openid + client_msg_id, 只发送一条消息,10分钟有效,超过10分钟不保证效果。若无防重入需求,可不填 + */ +// private String client_msg_id; + /** + * 模板跳转链接 + */ + private String url; + + /** + * 跳转app + */ + private JSONObject miniprogram; + + // "miniprogram":{ 未加入 + // "appid":"xiaochengxuappid12345", + // "pagepath":"index?foo=bar" + // }, + + /** + * data数据 + */ + private TreeMap> data; + + /** + * 参数 + * + * @param value 值 + * @param color 颜色 可不填 + * @return params + */ + public static TreeMap item(String value, String color) { + TreeMap params = new TreeMap(); + params.put("value", value); + params.put("color", color); + return params; + } + + public static JSONObject miniprogramData(String appid,String pagepath){ + JSONObject jsonObject = new JSONObject(); + jsonObject.put("appid",appid); + jsonObject.put("pagepath",pagepath); + return jsonObject; + } +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/weixingzh/aes/AesException.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/weixingzh/aes/AesException.java new file mode 100644 index 0000000..86b0f5b --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/weixingzh/aes/AesException.java @@ -0,0 +1,60 @@ +package com.yunzhupaas.message.util.weixingzh.aes; + +@SuppressWarnings("serial") +public class AesException extends Exception { + + public final static int OK = 0; + public final static int ValidateSignatureError = -40001; + public final static int ParseXmlError = -40002; + public final static int ComputeSignatureError = -40003; + public final static int IllegalAesKey = -40004; + public final static int ValidateAppidError = -40005; + public final static int EncryptAESError = -40006; + public final static int DecryptAESError = -40007; + public final static int IllegalBuffer = -40008; + //public final static int EncodeBase64Error = -40009; + //public final static int DecodeBase64Error = -40010; + //public final static int GenReturnXmlError = -40011; + + private int code; + + private static String getMessage(int code) { + switch (code) { + case ValidateSignatureError: + return "签名验证错误"; + case ParseXmlError: + return "xml解析失败"; + case ComputeSignatureError: + return "sha加密生成签名失败"; + case IllegalAesKey: + return "SymmetricKey非法"; + case ValidateAppidError: + return "appid校验失败"; + case EncryptAESError: + return "aes加密失败"; + case DecryptAESError: + return "aes解密失败"; + case IllegalBuffer: + return "解密后得到的buffer非法"; +// case EncodeBase64Error: +// return "base64加密错误"; +// case DecodeBase64Error: +// return "base64解密错误"; +// case GenReturnXmlError: +// return "xml生成失败"; + default: + return null; // cannot be + } + } + + public int getCode() { + return code; + } + + AesException(int code) { + super(getMessage(code)); + this.code = code; + } + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/weixingzh/aes/ByteGroup.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/weixingzh/aes/ByteGroup.java new file mode 100644 index 0000000..be1ab9d --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/weixingzh/aes/ByteGroup.java @@ -0,0 +1,27 @@ +package com.yunzhupaas.message.util.weixingzh.aes; + +import java.util.ArrayList; + +class ByteGroup { + ArrayList byteContainer = new ArrayList(); + + public byte[] toBytes() { + byte[] bytes = new byte[byteContainer.size()]; + for (int i = 0; i < byteContainer.size(); i++) { + bytes[i] = byteContainer.get(i); + } + return bytes; + } + + public ByteGroup addBytes(byte[] bytes) { + for (byte b : bytes) { + byteContainer.add(b); + } + return this; + } + + public int size() { + return byteContainer.size(); + } +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/weixingzh/aes/PKCS7Encoder.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/weixingzh/aes/PKCS7Encoder.java new file mode 100644 index 0000000..bce4c95 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/weixingzh/aes/PKCS7Encoder.java @@ -0,0 +1,68 @@ +/** + * 对公众平台发送给公众账号的消息加解密示例代码. + * + * @copyright Copyright (c) 1998-2014 Tencent Inc. + */ + +// ------------------------------------------------------------------------ + +package com.yunzhupaas.message.util.weixingzh.aes; + +import java.nio.charset.Charset; +import java.util.Arrays; + +/** + * 提供基于PKCS7算法的加解密接口. + */ +class PKCS7Encoder { + static Charset CHARSET = Charset.forName("utf-8"); + static int BLOCK_SIZE = 32; + + /** + * 获得对明文进行补位填充的字节. + * + * @param count 需要进行填充补位操作的明文字节个数 + * @return 补齐用的字节数组 + */ + static byte[] encode(int count) { + // 计算需要填充的位数 + int amountToPad = BLOCK_SIZE - (count % BLOCK_SIZE); + if (amountToPad == 0) { + amountToPad = BLOCK_SIZE; + } + // 获得补位所用的字符 + char padChr = chr(amountToPad); + String tmp = new String(); + for (int index = 0; index < amountToPad; index++) { + tmp += padChr; + } + return tmp.getBytes(CHARSET); + } + + /** + * 删除解密后明文的补位字符 + * + * @param decrypted 解密后的明文 + * @return 删除补位字符后的明文 + */ + static byte[] decode(byte[] decrypted) { + int pad = (int) decrypted[decrypted.length - 1]; + if (pad < 1 || pad > 32) { + pad = 0; + } + return Arrays.copyOfRange(decrypted, 0, decrypted.length - pad); + } + + /** + * 将数字转化成ASCII码对应的字符,用于对明文进行补码 + * + * @param a 需要转化的数字 + * @return 转化得到的字符 + */ + static char chr(int a) { + byte target = (byte) (a & 0xFF); + return (char) target; + } + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/weixingzh/aes/SHA1.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/weixingzh/aes/SHA1.java new file mode 100644 index 0000000..f4fd725 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/weixingzh/aes/SHA1.java @@ -0,0 +1,61 @@ +/** + * 对公众平台发送给公众账号的消息加解密示例代码. + * + * @copyright Copyright (c) 1998-2014 Tencent Inc. + */ + +// ------------------------------------------------------------------------ + +package com.yunzhupaas.message.util.weixingzh.aes; + +import java.security.MessageDigest; +import java.util.Arrays; + +/** + * SHA1 class + * + * 计算公众平台的消息签名接口. + */ +class SHA1 { + + /** + * 用SHA1算法生成安全签名 + * @param token 票据 + * @param timestamp 时间戳 + * @param nonce 随机字符串 + * @param encrypt 密文 + * @return 安全签名 + * @throws AesException + */ + public static String getSHA1(String token, String timestamp, String nonce, String encrypt) throws AesException { + try { + String[] array = new String[] { token, timestamp, nonce, encrypt }; + StringBuffer sb = new StringBuffer(); + // 字符串排序 + Arrays.sort(array); + for (int i = 0; i < 4; i++) { + sb.append(array[i]); + } + String str = sb.toString(); + // SHA1签名生成 + MessageDigest md = MessageDigest.getInstance("SHA-1"); + md.update(str.getBytes()); + byte[] digest = md.digest(); + + StringBuffer hexstr = new StringBuffer(); + String shaHex = ""; + for (int i = 0; i < digest.length; i++) { + shaHex = Integer.toHexString(digest[i] & 0xFF); + if (shaHex.length() < 2) { + hexstr.append(0); + } + hexstr.append(shaHex); + } + return hexstr.toString(); + } catch (Exception e) { + e.printStackTrace(); + throw new AesException(AesException.ComputeSignatureError); + } + } +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/weixingzh/aes/WXBizMsgCrypt.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/weixingzh/aes/WXBizMsgCrypt.java new file mode 100644 index 0000000..a762ad6 --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/weixingzh/aes/WXBizMsgCrypt.java @@ -0,0 +1,288 @@ +/** + * 对公众平台发送给公众账号的消息加解密示例代码. + * + * @copyright Copyright (c) 1998-2014 Tencent Inc. + */ + +// ------------------------------------------------------------------------ + +/** + * 针对org.apache.commons.codec.binary.Base64, + * 需要导入架包commons-codec-1.9(或commons-codec-1.8等其他版本) + * 官方下载地址:http://commons.apache.org/proper/commons-codec/download_codec.cgi + */ +package com.yunzhupaas.message.util.weixingzh.aes; + +import java.nio.charset.Charset; +import java.util.Arrays; +import java.util.Random; + +import javax.crypto.Cipher; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; + +import org.apache.commons.codec.binary.Base64; + +/** + * 提供接收和推送给公众平台消息的加解密接口(UTF8编码的字符串). + *
    + *
  1. 第三方回复加密消息给公众平台
  2. + *
  3. 第三方收到公众平台发送的消息,验证消息的安全性,并对消息进行解密。
  4. + *
+ * 说明:异常java.security.InvalidKeyException:illegal Key Size的解决方案 + *
    + *
  1. 在官方网站下载JCE无限制权限策略文件(JDK7的下载地址: + * http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html
  2. + *
  3. 下载后解压,可以看到local_policy.jar和US_export_policy.jar以及readme.txt
  4. + *
  5. 如果安装了JRE,将两个jar文件放到%JRE_HOME%\lib\security目录下覆盖原来的文件
  6. + *
  7. 如果安装了JDK,将两个jar文件放到%JDK_HOME%\jre\lib\security目录下覆盖原来文件
  8. + *
+ */ +public class WXBizMsgCrypt { + static Charset CHARSET = Charset.forName("utf-8"); + Base64 base64 = new Base64(); + byte[] aesKey; + String token; + String appId; + + /** + * 构造函数 + * @param token 公众平台上,开发者设置的token + * @param encodingAesKey 公众平台上,开发者设置的EncodingAESKey + * @param appId 公众平台appid + * + * @throws AesException 执行失败,请查看该异常的错误码和具体的错误信息 + */ + public WXBizMsgCrypt(String token, String encodingAesKey, String appId) throws AesException { + if (encodingAesKey.length() != 43) { + throw new AesException(AesException.IllegalAesKey); + } + + this.token = token; + this.appId = appId; + aesKey = Base64.decodeBase64(encodingAesKey + "="); + } + + // 生成4个字节的网络字节序 + byte[] getNetworkBytesOrder(int sourceNumber) { + byte[] orderBytes = new byte[4]; + orderBytes[3] = (byte) (sourceNumber & 0xFF); + orderBytes[2] = (byte) (sourceNumber >> 8 & 0xFF); + orderBytes[1] = (byte) (sourceNumber >> 16 & 0xFF); + orderBytes[0] = (byte) (sourceNumber >> 24 & 0xFF); + return orderBytes; + } + + // 还原4个字节的网络字节序 + int recoverNetworkBytesOrder(byte[] orderBytes) { + int sourceNumber = 0; + for (int i = 0; i < 4; i++) { + sourceNumber <<= 8; + sourceNumber |= orderBytes[i] & 0xff; + } + return sourceNumber; + } + + // 随机生成16位字符串 + String getRandomStr() { + String base = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + Random random = new Random(); + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < 16; i++) { + int number = random.nextInt(base.length()); + sb.append(base.charAt(number)); + } + return sb.toString(); + } + + /** + * 对明文进行加密. + * + * @param text 需要加密的明文 + * @return 加密后base64编码的字符串 + * @throws AesException aes加密失败 + */ + String encrypt(String randomStr, String text) throws AesException { + ByteGroup byteCollector = new ByteGroup(); + byte[] randomStrBytes = randomStr.getBytes(CHARSET); + byte[] textBytes = text.getBytes(CHARSET); + byte[] networkBytesOrder = getNetworkBytesOrder(textBytes.length); + byte[] appidBytes = appId.getBytes(CHARSET); + + // randomStr + networkBytesOrder + text + appid + byteCollector.addBytes(randomStrBytes); + byteCollector.addBytes(networkBytesOrder); + byteCollector.addBytes(textBytes); + byteCollector.addBytes(appidBytes); + + // ... + pad: 使用自定义的填充方式对明文进行补位填充 + byte[] padBytes = PKCS7Encoder.encode(byteCollector.size()); + byteCollector.addBytes(padBytes); + + // 获得最终的字节流, 未加密 + byte[] unencrypted = byteCollector.toBytes(); + + try { + // 设置加密模式为AES的CBC模式 + Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding"); + SecretKeySpec keySpec = new SecretKeySpec(aesKey, "AES"); + IvParameterSpec iv = new IvParameterSpec(aesKey, 0, 16); + cipher.init(Cipher.ENCRYPT_MODE, keySpec, iv); + + // 加密 + byte[] encrypted = cipher.doFinal(unencrypted); + + // 使用BASE64对加密后的字符串进行编码 + String base64Encrypted = base64.encodeToString(encrypted); + + return base64Encrypted; + } catch (Exception e) { + e.printStackTrace(); + throw new AesException(AesException.EncryptAESError); + } + } + + /** + * 对密文进行解密. + * + * @param text 需要解密的密文 + * @return 解密得到的明文 + * @throws AesException aes解密失败 + */ + String decrypt(String text) throws AesException { + byte[] original; + try { + // 设置解密模式为AES的CBC模式 + Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding"); + SecretKeySpec key_spec = new SecretKeySpec(aesKey, "AES"); + IvParameterSpec iv = new IvParameterSpec(Arrays.copyOfRange(aesKey, 0, 16)); + cipher.init(Cipher.DECRYPT_MODE, key_spec, iv); + + // 使用BASE64对密文进行解码 + byte[] encrypted = Base64.decodeBase64(text); + + // 解密 + original = cipher.doFinal(encrypted); + } catch (Exception e) { + e.printStackTrace(); + throw new AesException(AesException.DecryptAESError); + } + + String xmlContent, from_appid; + try { + // 去除补位字符 + byte[] bytes = PKCS7Encoder.decode(original); + + // 分离16位随机字符串,网络字节序和AppId + byte[] networkOrder = Arrays.copyOfRange(bytes, 16, 20); + + int xmlLength = recoverNetworkBytesOrder(networkOrder); + + xmlContent = new String(Arrays.copyOfRange(bytes, 20, 20 + xmlLength), CHARSET); + from_appid = new String(Arrays.copyOfRange(bytes, 20 + xmlLength, bytes.length), + CHARSET); + } catch (Exception e) { + e.printStackTrace(); + throw new AesException(AesException.IllegalBuffer); + } + + // appid不相同的情况 + if (!from_appid.equals(appId)) { + throw new AesException(AesException.ValidateAppidError); + } + return xmlContent; + + } + + /** + * 将公众平台回复用户的消息加密打包. + *
    + *
  1. 对要发送的消息进行AES-CBC加密
  2. + *
  3. 生成安全签名
  4. + *
  5. 将消息密文和安全签名打包成xml格式
  6. + *
+ * + * @param replyMsg 公众平台待回复用户的消息,xml格式的字符串 + * @param timeStamp 时间戳,可以自己生成,也可以用URL参数的timestamp + * @param nonce 随机串,可以自己生成,也可以用URL参数的nonce + * + * @return 加密后的可以直接回复用户的密文,包括msg_signature, timestamp, nonce, encrypt的xml格式的字符串 + * @throws AesException 执行失败,请查看该异常的错误码和具体的错误信息 + */ + public String encryptMsg(String replyMsg, String timeStamp, String nonce) throws AesException { + // 加密 + String encrypt = encrypt(getRandomStr(), replyMsg); + + // 生成安全签名 + if (timeStamp == "") { + timeStamp = Long.toString(System.currentTimeMillis()); + } + + String signature = SHA1.getSHA1(token, timeStamp, nonce, encrypt); + + // System.out.println("发送给平台的签名是: " + signature[1].toString()); + // 生成发送的xml + String result = XMLParse.generate(encrypt, signature, timeStamp, nonce); + return result; + } + + /** + * 检验消息的真实性,并且获取解密后的明文. + *
    + *
  1. 利用收到的密文生成安全签名,进行签名验证
  2. + *
  3. 若验证通过,则提取xml中的加密消息
  4. + *
  5. 对消息进行解密
  6. + *
+ * + * @param msgSignature 签名串,对应URL参数的msg_signature + * @param timeStamp 时间戳,对应URL参数的timestamp + * @param nonce 随机串,对应URL参数的nonce + * @param postData 密文,对应POST请求的数据 + * + * @return 解密后的原文 + * @throws AesException 执行失败,请查看该异常的错误码和具体的错误信息 + */ + public String decryptMsg(String msgSignature, String timeStamp, String nonce, String postData) + throws AesException { + + // 密钥,公众账号的app secret + // 提取密文 + Object[] encrypt = XMLParse.extract(postData); + + // 验证安全签名 + String signature = SHA1.getSHA1(token, timeStamp, nonce, encrypt[1].toString()); + + // 和URL中的签名比较是否相等 + if (!signature.equals(msgSignature)) { + throw new AesException(AesException.ValidateSignatureError); + } + + // 解密 + String result = decrypt(encrypt[1].toString()); + return result; + } + + /** + * 验证URL + * @param msgSignature 签名串,对应URL参数的msg_signature + * @param timeStamp 时间戳,对应URL参数的timestamp + * @param nonce 随机串,对应URL参数的nonce + * @param echoStr 随机串,对应URL参数的echostr + * + * @return 解密之后的echostr + * @throws AesException 执行失败,请查看该异常的错误码和具体的错误信息 + */ + public String verifyUrl(String msgSignature, String timeStamp, String nonce, String echoStr) + throws AesException { + String signature = SHA1.getSHA1(token, timeStamp, nonce, echoStr); + + if (!signature.equals(msgSignature)) { + throw new AesException(AesException.ValidateSignatureError); + } + + String result = decrypt(echoStr); + return result; + } + +} + diff --git a/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/weixingzh/aes/XMLParse.java b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/weixingzh/aes/XMLParse.java new file mode 100644 index 0000000..40a1fbc --- /dev/null +++ b/yunzhupaas-message/yunzhupaas-message-entity/src/main/java/com/yunzhupaas/message/util/weixingzh/aes/XMLParse.java @@ -0,0 +1,73 @@ +/** + * 对公众平台发送给公众账号的消息加解密示例代码. + * + * @copyright Copyright (c) 1998-2014 Tencent Inc. + */ + +// ------------------------------------------------------------------------ + +package com.yunzhupaas.message.util.weixingzh.aes; + +import java.io.StringReader; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; + +/** + * XMLParse class + * + * 提供提取消息格式中的密文及生成回复消息格式的接口. + */ +class XMLParse { + + /** + * 提取出xml数据包中的加密消息 + * @param xmltext 待提取的xml字符串 + * @return 提取出的加密消息字符串 + * @throws AesException + */ + public static Object[] extract(String xmltext) throws AesException { + Object[] result = new Object[3]; + try { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + StringReader sr = new StringReader(xmltext); + InputSource is = new InputSource(sr); + Document document = db.parse(is); + + Element root = document.getDocumentElement(); + NodeList nodelist1 = root.getElementsByTagName("Encrypt"); + NodeList nodelist2 = root.getElementsByTagName("ToUserName"); + result[0] = 0; + result[1] = nodelist1.item(0).getTextContent(); + result[2] = nodelist2.item(0).getTextContent(); + return result; + } catch (Exception e) { + e.printStackTrace(); + throw new AesException(AesException.ParseXmlError); + } + } + + /** + * 生成xml消息 + * @param encrypt 加密后的消息密文 + * @param signature 安全签名 + * @param timestamp 时间戳 + * @param nonce 随机字符串 + * @return 生成的xml字符串 + */ + public static String generate(String encrypt, String signature, String timestamp, String nonce) { + + String format = "\n" + "\n" + + "\n" + + "%3$s\n" + "\n" + ""; + return String.format(format, encrypt, signature, timestamp, nonce); + + } +} + diff --git a/yunzhupaas-oauth/pom.xml b/yunzhupaas-oauth/pom.xml new file mode 100644 index 0000000..bca6a49 --- /dev/null +++ b/yunzhupaas-oauth/pom.xml @@ -0,0 +1,22 @@ + + + + yunzhupaas-java-boot + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-oauth + pom + + yunzhupaas-oauth-api + yunzhupaas-oauth-biz + yunzhupaas-oauth-controller + yunzhupaas-oauth-entity + + + + diff --git a/yunzhupaas-oauth/yunzhupaas-oauth-api/pom.xml b/yunzhupaas-oauth/yunzhupaas-oauth-api/pom.xml new file mode 100644 index 0000000..2b49d6d --- /dev/null +++ b/yunzhupaas-oauth/yunzhupaas-oauth-api/pom.xml @@ -0,0 +1,22 @@ + + + + yunzhupaas-oauth + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-oauth-api + + + + com.yunzhupaas + yunzhupaas-oauth-entity + ${project.version} + + + + diff --git a/yunzhupaas-oauth/yunzhupaas-oauth-api/src/main/java/com/yunzhupaas/service/AuthService.java b/yunzhupaas-oauth/yunzhupaas-oauth-api/src/main/java/com/yunzhupaas/service/AuthService.java new file mode 100644 index 0000000..f69a6ed --- /dev/null +++ b/yunzhupaas-oauth/yunzhupaas-oauth-api/src/main/java/com/yunzhupaas/service/AuthService.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.service; + +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.exception.LoginException; +import com.yunzhupaas.model.LoginVO; + +import java.util.Map; + +public interface AuthService { + ActionResult login(Map parameters) throws LoginException; + + ActionResult kickoutByToken(String... tokens); + + ActionResult kickoutByUserId(String userId, String tenantId); +} + diff --git a/yunzhupaas-oauth/yunzhupaas-oauth-api/src/main/java/com/yunzhupaas/util/AuthUtil.java b/yunzhupaas-oauth/yunzhupaas-oauth-api/src/main/java/com/yunzhupaas/util/AuthUtil.java new file mode 100644 index 0000000..de698f4 --- /dev/null +++ b/yunzhupaas-oauth/yunzhupaas-oauth-api/src/main/java/com/yunzhupaas/util/AuthUtil.java @@ -0,0 +1,95 @@ +package com.yunzhupaas.util; + +import com.google.common.collect.ImmutableMap; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.exception.LoginException; +import com.yunzhupaas.model.LoginVO; +import com.yunzhupaas.service.AuthService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.Map; +import java.util.Optional; + +/** + * 内部登录、退出用户工具 + */ +@Slf4j +@Component +public class AuthUtil { + + public static AuthService authApi; + + @Autowired + public void setAuthApi(AuthService authApi) { + AuthUtil.authApi = authApi; + } + + /** + * 登录临时用户 + * 此用户已经登录将返回现有用户Token + * 未登录将直接使用用户ID进行免密登录返回Token + * + * @param userId 用户ID + * @param tenantId 租户ID + * @return + */ + public static String loginTempUser(String userId, String tenantId){ + return loginTempUser(userId, tenantId, false); + } + + /** + * 登录临时用户 + * 此用户已经登录将返回现有用户Token + * 未登录将直接使用用户ID进行免密登录返回Token + * + * @param userId 用户ID + * @param tenantId 租户ID + * @param limited 是否是限制型临时用户(无法登录主系统前端) + * @return + */ + public static String loginTempUser(String userId, String tenantId, boolean limited){ + Map loginInfo = ImmutableMap.of( + "grant_type", "tempuser", + "token", UserProvider.getInnerAuthToken(), + "userId", userId, + "tenantId", Optional.ofNullable(tenantId).orElse(StringUtil.NULLSTR), + "limited", String.valueOf(limited)); + String errMsg; + ActionResult result = authApi.login(loginInfo); + if(Constants.SUCCESS.equals(result.getCode())){ + return result.getData().getToken(); + } + log.error("登录临时用户失败: {}", result.getMsg()); + throw new LoginException(result.getMsg()); + } + + /** + * 踢出用户, 用户将收到Websocket下线通知 + * 执行流程:认证服务退出用户->用户踢出监听->消息服务发送Websocket推送退出消息 + * @param tokens + */ + public static void kickoutByToken(String... tokens){ + authApi.kickoutByToken(tokens); + } + + /** + * 踢出用户, 用户将收到Websocket下线通知 + * 执行流程:认证服务退出用户->用户踢出监听->消息服务发送Websocket推送退出消息 + * @param userId + */ + public static void kickoutByUserId(String userId){ + String tenantId = TenantHolder.getDatasourceId(); + if(tenantId == null) { + UserInfo userInfo = UserProvider.getUser(); + if (userInfo.getUserId() == null) { + throw new RuntimeException("请设置UserInfo"); + } + tenantId = userInfo.getTenantId(); + } + authApi.kickoutByUserId(userId, tenantId); + } +} + diff --git a/yunzhupaas-oauth/yunzhupaas-oauth-biz/pom.xml b/yunzhupaas-oauth/yunzhupaas-oauth-biz/pom.xml new file mode 100644 index 0000000..fb35caf --- /dev/null +++ b/yunzhupaas-oauth/yunzhupaas-oauth-biz/pom.xml @@ -0,0 +1,77 @@ + + + + yunzhupaas-oauth + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-oauth-biz + + + + + org.projectlombok + lombok + + + com.yunzhupaas + yunzhupaas-oauth-entity + ${project.version} + compile + + + com.yunzhupaas + yunzhupaas-system-biz + ${project.version} + compile + + + com.yunzhupaas + yunzhupaas-common-all + ${project.version} + compile + + + com.yunzhupaas + yunzhupaas-exception + ${project.version} + compile + + + com.nimbusds + nimbus-jose-jwt + + + org.apache.commons + commons-pool2 + + + com.yunzhupaas + yunzhupaas-message-biz + ${project.version} + + + com.yunzhupaas + yunzhupaas-permission-controller + ${project.version} + + + com.yunzhupaas + yunzhupaas-visualdev-portal-biz + ${project.version} + + + + org.springframework.boot + spring-boot-starter-data-redis + + + com.yunzhupaas + yunzhupaas-common-security + + + diff --git a/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/granter/ImplicitTokenGranter.java b/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/granter/ImplicitTokenGranter.java new file mode 100644 index 0000000..ad5e28e --- /dev/null +++ b/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/granter/ImplicitTokenGranter.java @@ -0,0 +1,213 @@ +package com.yunzhupaas.granter; + +import cn.dev33.satoken.context.SaHolder; +import cn.dev33.satoken.context.model.SaRequest; +import cn.hutool.core.collection.CollectionUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.config.YunzhupaasOauthConfig; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.consts.AuthConsts; +import com.yunzhupaas.consts.LoginTicketStatus; +import com.yunzhupaas.exception.LoginException; +import com.yunzhupaas.model.BaseSystemInfo; +import com.yunzhupaas.model.LoginTicketModel; +import com.yunzhupaas.model.SocialUnbindModel; +import com.yunzhupaas.permission.controller.SocialsUserController; +import com.yunzhupaas.permission.model.socails.SocialsUserInfo; +import com.yunzhupaas.permission.util.implicit.ImplicitLoginUtil; +import com.yunzhupaas.util.ServletUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.TicketUtil; +import com.yunzhupaas.util.UserProvider; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.Map; + +import static com.yunzhupaas.granter.ImplicitTokenGranter.GRANT_TYPE; + +@Slf4j +@Component(GRANT_TYPE) +public class ImplicitTokenGranter extends AbstractTokenGranter { + + public static final String GRANT_TYPE = "implicit"; + public static final Integer ORDER = 5; + private static final String URL_LOGIN = "/Login/implicit/**"; + + @Autowired + private ImplicitLoginUtil implicitLoginUtil; + + @Autowired + private SocialsUserController socialsUserApi; + + @Autowired + private YunzhupaasOauthConfig oauthConfig; + + public ImplicitTokenGranter() { + super(URL_LOGIN); + } + + protected String getGrantType() { + return GRANT_TYPE; + } + + public ActionResult logout() { + return super.logout(); + } + + public int getOrder() { + return ORDER; + } + + @Override + protected void loginSuccess(UserInfo userInfo, BaseSystemInfo baseSystemInfo) { + } + + @Override + protected void loginFailure(UserInfo userInfo, BaseSystemInfo baseSystemInfo, Exception e) { + super.loginFailure(userInfo, baseSystemInfo, e); + } + + @Override + protected String getUserDetailKey() { + return AuthConsts.USERDETAIL_USER_ID; + } + + public ActionResult granter(Map map) throws LoginException { + SaRequest req = SaHolder.getRequest(); + String code = req.getParam("code"); + String source = req.getParam("source"); + String userAgent = ServletUtil.getUserAgent(); + if (userAgent.contains("wxwork")) { + source = "wechat_enterprise"; + } + if (userAgent.contains("DingTalk")) { + source = "dingtalk"; + } + // 授权回调,登录接口,重定向携带token的首页 + if (StringUtil.isEmpty(source)) { + return ActionResult.fail(MsgCode.OA028.get()); + } + // 跳js页面,直接调用授权链接 + if (StringUtil.isEmpty(code)) { + String authLink = implicitLoginUtil.getAuthLink(source); + SaHolder.getResponse().redirect(authLink); + return null; + } + String uuid = implicitLoginUtil.loginByCode(source, code, null); + // uuid登录 + return this.loginByUuid(source, uuid); + } + + /** + * 通过第三方用户id登录 + * + * @param source + * @param uuid + * @return + * @throws LoginException + */ + protected ActionResult loginByUuid(String source, String uuid) throws LoginException { + boolean isApp = "APP".equalsIgnoreCase(UserProvider.getDeviceForAgent().getDevice()); + String url = isApp ? configValueUtil.getAppDomain() : configValueUtil.getFrontDomain(); + SocialsUserInfo socialsUserInfo = socialsUserApi.getUserInfo(source, uuid, null); + if (configValueUtil.isMultiTenancy()) { + if (socialsUserInfo == null || CollectionUtil.isEmpty(socialsUserInfo.getTenantUserInfo())) { + // 未绑定写入缓存 + LoginTicketModel ticketModel = (new LoginTicketModel()) + .setStatus(LoginTicketStatus.UnBindMes.getStatus()) + .setTicketTimeout(System.currentTimeMillis() + oauthConfig.getTicketTimeout() * 1000); + createdTicketState(ticketModel, url, isApp); + return ActionResult.success(); + } + if (socialsUserInfo.getTenantUserInfo().size() == 1) { + UserInfo userInfo = socialsUserInfo.getUserInfo(); + // 切换租户 + switchTenant(userInfo); + // 获取系统配置 + BaseSystemInfo baseSystemInfo = getSysconfig(userInfo); + // 登录账号 + String token = super.loginAccount(userInfo, baseSystemInfo); + // 返回登录信息 + String redirectUrl = url + "/sso" + "?token=" + token; + if (isApp) { + redirectUrl = url + "/pages/login/sso-redirect" + "?token=" + token; + } + SaHolder.getResponse().redirect(redirectUrl); + return ActionResult.success(); + } else { + // 多租户信息写入ticket缓存 + JSONArray tenantUserInfo = socialsUserInfo.getTenantUserInfo(); + LoginTicketModel ticketModel = (new LoginTicketModel()) + .setStatus(LoginTicketStatus.Multitenancy.getStatus()).setValue(tenantUserInfo.toJSONString()) + .setTicketTimeout(System.currentTimeMillis() + oauthConfig.getTicketTimeout() * 1000); + createdTicketState(ticketModel, url, isApp); + return ActionResult.success(); + } + } else { + if (socialsUserInfo == null || socialsUserInfo.getUserInfo() == null) { + // 未绑定写入缓存 + LoginTicketModel ticketModel = (new LoginTicketModel()) + .setStatus(LoginTicketStatus.UnBindMes.getStatus()) + .setTicketTimeout(System.currentTimeMillis() + oauthConfig.getTicketTimeout() * 1000); + createdTicketState(ticketModel, url, isApp); + return ActionResult.success(); + } + UserInfo userInfo = socialsUserInfo.getUserInfo(); + // 切换租户 + switchTenant(userInfo); + // 获取系统配置 + BaseSystemInfo baseSystemInfo = getSysconfig(userInfo); + // 登录账号 + String token = super.loginAccount(userInfo, baseSystemInfo); + String redirectUrl = url + "/sso" + "?token=" + token; + if (isApp) { + redirectUrl = url + "/pages/login/sso-redirect" + "?token=" + token; + } + SaHolder.getResponse().redirect(redirectUrl); + return ActionResult.success(); + } + } + + /** + * 创建票据 + * + * @param loginTicketModel + * @param url + * @param isApp + * @return + */ + private String createdTicketState(LoginTicketModel loginTicketModel, String url, boolean isApp) { + String ticket = TicketUtil.createTicket(loginTicketModel, oauthConfig.getTicketTimeout()); + String MultitenancyUrl = url + "/login?YUNZHUPAAS_TICKET=" + ticket; + if (isApp) { + MultitenancyUrl = url + "/pages/login/index?YUNZHUPAAS_TICKET=" + ticket; + } + SaHolder.getResponse().redirect(MultitenancyUrl); + return ticket; + } + + /** + * 未绑定-更新票据缓存 + * + * @param socialType + * @param socialUnionid + * @param socialName + * @return + */ + protected LoginTicketModel updateTicketUnbind(String socialType, String socialUnionid, String socialName) { + LoginTicketModel loginTicketModel = null; + SocialUnbindModel obj = new SocialUnbindModel(socialType, socialUnionid, socialName); + String ticket = this.getYunzhupaasTicket(); + if (!ticket.isEmpty()) { + loginTicketModel = (new LoginTicketModel()).setStatus(LoginTicketStatus.UnBind.getStatus()) + .setValue(JSONObject.toJSONString(obj)); + TicketUtil.updateTicket(ticket, loginTicketModel, (Long) 300L); + } + return loginTicketModel; + } +} diff --git a/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/granter/PasswordTokenGranter.java b/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/granter/PasswordTokenGranter.java new file mode 100644 index 0000000..b7cd7ad --- /dev/null +++ b/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/granter/PasswordTokenGranter.java @@ -0,0 +1,283 @@ +package com.yunzhupaas.granter; + +import cn.dev33.satoken.context.SaHolder; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.consts.AuthConsts; +import com.yunzhupaas.consts.DeviceType; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.exception.LoginException; +import com.yunzhupaas.message.entity.UserDeviceEntity; +import com.yunzhupaas.message.service.UserDeviceService; +import com.yunzhupaas.model.*; +import com.yunzhupaas.model.tenant.TenantVO; +import com.yunzhupaas.permission.controller.SocialsUserController; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.Date; +import java.util.Map; +import java.util.Objects; + +import static com.yunzhupaas.granter.PasswordTokenGranter.GRANT_TYPE; +import static com.yunzhupaas.util.Constants.ADMIN_KEY; + +/** + * 账号密码认证 + * + * @author 云筑产品开发平台组 + * @user N + * @copyright 深圳市乐程软件有限公司 + * @date 2024/9/17 22:13 + */ +@Slf4j +@Component(GRANT_TYPE) +public class PasswordTokenGranter extends AbstractTokenGranter { + + public static final String GRANT_TYPE = "password"; + public static final Integer ORDER = 1; + private static final String URL_LOGIN = ""; + + public PasswordTokenGranter() { + super(URL_LOGIN); + } + + public PasswordTokenGranter(String authenticationUrl) { + super(authenticationUrl); + } + + @Autowired + private UserService userApi; + + @Autowired + private UserDetailsServiceBuilder userDetailsServiceBuilder; + + @Autowired + private SocialsUserController socialsUserApi; + + @Autowired + private UserDeviceService userDeviceService; + + @Override + public ActionResult granter(Map loginParameters) throws LoginException { + LoginForm loginForm = JsonUtil.getJsonToBean(loginParameters, LoginForm.class); + UserInfo userInfo = UserProvider.getUser(); + // 切换租户 + switchTenant(userInfo); + // 获取系统配置 + BaseSystemInfo baseSystemInfo = getSysconfig(userInfo); + // 预检信息 + preAuthenticate(loginForm, userInfo, baseSystemInfo); + // 登录账号 + super.loginAccount(userInfo, baseSystemInfo); + // 返回登录信息 + LoginVO loginResult = getLoginVo(userInfo); + return ActionResult.success(loginResult); + } + + @Override + public int getOrder() { + return ORDER; + } + + /** + * 可重写实现邮箱、短信、TOTP验证 + * + * @param loginForm + * @param sysConfigInfo + * @throws LoginException + */ + protected void preAuthenticate(LoginForm loginForm, UserInfo userInfo, BaseSystemInfo sysConfigInfo) + throws LoginException { + // 验证密码 + UserEntity userEntity = userDetailsServiceBuilder.getUserDetailService(AuthConsts.USERDETAIL_ACCOUNT) + .loadUserEntity(userInfo); + userInfo.setUserId(userEntity.getId()); + userInfo.setUserName(userEntity.getRealName()); + UserProvider.setLocalLoginUser(userInfo); + // 判断是否开启验证码 + if (Objects.nonNull(sysConfigInfo) && "1".equals(String.valueOf(sysConfigInfo.getEnableVerificationCode()))) { + // 验证验证码 + String timestamp = String.valueOf(redisUtil.getString(loginForm.getTimestamp())); + if (StringUtil.isEmpty(timestamp)) { + throw new LoginException(MsgCode.LOG107.get()); + } + if (!loginForm.getCode().equalsIgnoreCase(timestamp)) { + throw new LoginException(MsgCode.LOG104.get()); + } + } + try { + authenticate(loginForm, userEntity, sysConfigInfo); + } catch (Exception e) { + authenticateFailure(userEntity, sysConfigInfo); + throw e; + } + LoginHolder.setUserEntity(userEntity); + } + + protected void authenticate(LoginForm loginForm, UserEntity userEntity, BaseSystemInfo systemInfo) + throws LoginException { + authenticateLock(userEntity, systemInfo); + authenticatePassword(loginForm, userEntity, systemInfo); + } + + protected void authenticateLock(UserEntity userEntity, BaseSystemInfo systemInfo) throws LoginException { + // 判断当前账号是否被锁定 + Integer lockMark = userEntity.getEnabledMark(); + if (Objects.nonNull(lockMark) && lockMark == 2) { + // 获取解锁时间 + Date unlockTime = userEntity.getUnlockTime(); + // 账号锁定 + if (systemInfo.getLockType() == 1 || Objects.isNull(unlockTime)) { + throw new LoginException(MsgCode.LOG012.get()); + } + // 延迟登陆锁定 + long millis = System.currentTimeMillis(); + if (unlockTime.getTime() > millis) { + // 转成分钟 + int time = (int) ((unlockTime.getTime() - millis) / (1000 * 60)); + throw new LoginException(MsgCode.LOG108.get(time + 1)); + } else if (unlockTime.getTime() < millis + && userEntity.getLogErrorCount() >= systemInfo.getPasswordErrorsNumber()) { + // 已经接触错误时间锁定的话就重置错误次数 + userEntity.setLogErrorCount(0); + userEntity.setEnabledMark(1); + userApi.updateById(userEntity); + } + } + } + + protected void authenticatePassword(LoginForm loginForm, UserEntity userEntity, BaseSystemInfo systemInfo) + throws LoginException { + String inputPwd = loginForm.getPassword(); + try { + // 前端md5后进行aes加密 + inputPwd = DesUtil.aesOrDecode(inputPwd, false, true); + } catch (Exception e) { + log.error(MsgCode.OA013.get() + ":{}", inputPwd, e); + inputPwd = ""; + } + if (!userEntity.getPassword() + .equals(Md5Util.getStringMd5(inputPwd + userEntity.getSecretkey().toLowerCase()))) { + throw new LoginException(MsgCode.LOG101.get()); + } + } + + protected void authenticateFailure(UserEntity entity, BaseSystemInfo sysConfigInfo) { + if (entity != null) { + // 超级管理员特权,不会锁定 + if (!ADMIN_KEY.equals(entity.getAccount())) { + // 判断是否需要锁定账号,哪种锁定方式 + // 大于2则判断有效 + Integer errorsNumber = sysConfigInfo.getPasswordErrorsNumber(); + // 判断是否开启 + if (errorsNumber != null && errorsNumber > 2) { + // 加入错误次数 + Integer errorCount = entity.getLogErrorCount() != null ? entity.getLogErrorCount() + 1 : 1; + entity.setLogErrorCount(errorCount); + Integer lockType = sysConfigInfo.getLockType(); + if (errorCount >= errorsNumber) { + entity.setEnabledMark(2); + // 如果是延时锁定 + if (Objects.nonNull(lockType) && lockType == 2) { + Integer lockTime = sysConfigInfo.getLockTime(); + Date date = new Date((System.currentTimeMillis() + (lockTime * 60 * 1000))); + entity.setUnlockTime(date); + } + } + if (lockType == 1) { + entity.setUnlockTime(null); + } + userApi.updateById(entity); + } + } + } + } + + @Override + protected void preLogin(UserInfo userInfo, BaseSystemInfo baseSystemInfo) throws LoginException { + + } + + @Override + protected void loginSuccess(UserInfo userInfo, BaseSystemInfo baseSystemInfo) { + super.loginSuccess(userInfo, baseSystemInfo); + // 登录成功绑定第三方 + if (SaHolder.getRequest().hasParam(AuthConsts.PARAMS_YUNZHUPAAS_TICKET)) { + String ticket = SaHolder.getRequest().getParam(AuthConsts.PARAMS_YUNZHUPAAS_TICKET); + LoginTicketModel ticketModel = TicketUtil.parseTicket(ticket); + if (ticketModel != null) { + SocialUnbindModel jsonToBean = JsonUtil.getJsonToBean(ticketModel.getValue(), SocialUnbindModel.class); + if (jsonToBean != null) { + socialsUserApi.loginAutoBinding(jsonToBean.getSocialType(), jsonToBean.getSocialUnionid(), + jsonToBean.getSocialName(), + userInfo.getUserId(), userInfo.getTenantId()); + } + } + } + if (SaHolder.getRequest().hasParam(AuthConsts.Client_Id)) { + String Client_Id = SaHolder.getRequest().getParam(AuthConsts.Client_Id); + if (StringUtil.isNotBlank(Client_Id) && !"null".equals(Client_Id)) { + UserDeviceEntity userDeviceEntity = userDeviceService.getInfoByClientId(Client_Id); + if (userDeviceEntity != null) { + userDeviceEntity.setUserId(userInfo.getUserId()); + userDeviceEntity.setLastModifyTime(DateUtil.getNowDate()); + userDeviceEntity.setLastModifyUserId(userInfo.getUserId()); + userDeviceService.update(userDeviceEntity.getId(), userDeviceEntity); + } else { + userDeviceEntity = new UserDeviceEntity(); + userDeviceEntity.setId(RandomUtil.uuId()); + userDeviceEntity.setUserId(userInfo.getUserId()); + userDeviceEntity.setClientId(Client_Id); + userDeviceEntity.setCreatorTime(DateUtil.getNowDate()); + userDeviceEntity.setCreatorUserId(userInfo.getUserId()); + userDeviceService.create(userDeviceEntity); + } + } + } + } + + protected LoginVO getLoginVo(UserInfo userInfo) { + LoginVO loginVO = new LoginVO(); + loginVO.setTheme(userInfo.getTheme()); + loginVO.setToken(userInfo.getToken()); + if (configValueUtil.isMultiTenancy()) { + // 删除卫翎信息 + TenantVO tenantVO = TenantDataSourceUtil.getCacheTenantInfo(userInfo.getTenantId()); + if (tenantVO != null && tenantVO.getWl_qrcode() != null) { + loginVO.setWl_qrcode(tenantVO.getWl_qrcode()); + tenantVO.setWl_qrcode(null); + TenantDataSourceUtil.setTenantInfo(tenantVO); + } + } + return loginVO; + } + + @Override + public ActionResult logout() { + UserInfo userInfo = UserProvider.getUser(); + if (userInfo.getUserId() != null) { + if ("1".equals(String.valueOf(loginService.getBaseSystemConfig(userInfo.getTenantId()).getSingleLogin()))) { + UserProvider.logoutByUserId(userInfo.getUserId(), DeviceType.valueOf(userInfo.getLoginDevice())); + } else { + UserProvider.logoutByToken(userInfo.getToken()); + } + } + return ActionResult.success(MsgCode.OA014.get()); + } + + @Override + protected String getGrantType() { + return GRANT_TYPE; + } + + @Override + protected String getUserDetailKey() { + return AuthConsts.USERDETAIL_ACCOUNT; + } +} diff --git a/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/granter/ScanCodeTokenGranter.java b/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/granter/ScanCodeTokenGranter.java new file mode 100644 index 0000000..f6bcdaf --- /dev/null +++ b/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/granter/ScanCodeTokenGranter.java @@ -0,0 +1,97 @@ +package com.yunzhupaas.granter; + +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.consts.AuthConsts; +import com.yunzhupaas.consts.DeviceType; +import com.yunzhupaas.exception.LoginException; +import com.yunzhupaas.model.BaseSystemInfo; +import com.yunzhupaas.model.LoginVO; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.Map; + +import static com.yunzhupaas.granter.ScanCodeTokenGranter.GRANT_TYPE; + +@Slf4j +@Component(GRANT_TYPE) +public class ScanCodeTokenGranter extends AbstractTokenGranter { + + public static final String GRANT_TYPE = "scancode"; + public static final Integer ORDER = 5; + private static final String URL_LOGIN = ""; + @Autowired + protected ConfigValueUtil configValueUtil; + + public ScanCodeTokenGranter() { + super(URL_LOGIN); + } + + /** + * @param loginParameters {userId, tenantId} + * @return + * @throws LoginException + */ + @Override + public ActionResult granter(Map loginParameters) throws LoginException { + String token = loginParameters.get("token"); + // 验证token是否有效 + UserInfo userInfo = UserProvider.getUser(token); + if (configValueUtil.isMultiTenancy()){ + userInfo.setUserAccount(userInfo.getTenantId()+"@"+userInfo.getUserAccount()); + } + //切换租户 + switchTenant(userInfo); + //获取系统配置 + BaseSystemInfo baseSystemInfo = getSysconfig(userInfo); + //登录账号 + super.loginAccount(userInfo, baseSystemInfo); + //返回登录信息 + LoginVO loginResult = getLoginVo(userInfo); + return ActionResult.success(loginResult); + } + + @Override + public int getOrder() { + return ORDER; + } + + + protected LoginVO getLoginVo(UserInfo userInfo) { + LoginVO loginVO = new LoginVO(); + loginVO.setTheme(userInfo.getTheme()); + loginVO.setToken(userInfo.getToken()); + return loginVO; + } + + @Override + public ActionResult logout() { + UserInfo userInfo = UserProvider.getUser(); + if (userInfo.getUserId() != null) { + if ("1".equals(String.valueOf(loginService.getBaseSystemConfig(userInfo.getTenantId()).getSingleLogin()))) { + UserProvider.logoutByUserId(userInfo.getUserId(), DeviceType.valueOf(userInfo.getLoginDevice())); + } else { + UserProvider.logoutByToken(userInfo.getToken()); + } + } + return ActionResult.success(MsgCode.OA014.get()); + } + + @Override + protected String getGrantType() { + return GRANT_TYPE; + } + + @Override + protected String getUserDetailKey() { + return AuthConsts.USERDETAIL_USER_ID; + } + +} + diff --git a/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/granter/SocialsTokenGranter.java b/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/granter/SocialsTokenGranter.java new file mode 100644 index 0000000..155da89 --- /dev/null +++ b/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/granter/SocialsTokenGranter.java @@ -0,0 +1,289 @@ +package com.yunzhupaas.granter; + +import cn.dev33.satoken.context.SaHolder; +import cn.dev33.satoken.context.model.SaRequest; +import cn.dev33.satoken.stp.StpUtil; +import cn.dev33.satoken.util.SaFoxUtil; +import cn.hutool.core.collection.CollectionUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.consts.AuthConsts; +import com.yunzhupaas.consts.LoginTicketStatus; +import com.yunzhupaas.exception.LoginException; +import com.yunzhupaas.model.BaseSystemInfo; +import com.yunzhupaas.model.LoginTicketModel; +import com.yunzhupaas.model.SocialUnbindModel; +import com.yunzhupaas.model.LoginVO; +import com.yunzhupaas.permission.controller.SocialsUserController; +import com.yunzhupaas.permission.model.socails.SocialsUserInfo; +import com.yunzhupaas.service.impl.UserDetailsByUserIdServiceImpl; +import com.yunzhupaas.util.ServletUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.TicketUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import jakarta.servlet.http.HttpServletResponse; +import java.io.PrintWriter; +import java.util.Map; + +import static com.yunzhupaas.granter.SocialsTokenGranter.GRANT_TYPE; + +@Slf4j +@Component(GRANT_TYPE) +public class SocialsTokenGranter extends AbstractTokenGranter { + + public static final String GRANT_TYPE = "socials"; + public static final Integer ORDER = 5; + private static final String URL_LOGIN = "/Login/socials/**"; + + @Autowired + private SocialsUserController socialsUserApi; + + public SocialsTokenGranter() { + super(URL_LOGIN); + } + + protected String getGrantType() { + return GRANT_TYPE; + } + + public ActionResult granter(Map map) throws LoginException { + SaRequest req = SaHolder.getRequest(); + String code = req.getParam("code"); + String state = req.getParam("state"); + String source = req.getParam("source"); + String uuid = req.getParam("uuid"); + if (StringUtil.isEmpty(code)) { + code = req.getParam("authCode") != null ? req.getParam("authCode") : req.getParam("auth_code"); + } + // 是否是微信qq唤醒或者小程序登录 + if (StringUtil.isNotEmpty(uuid)) { + try { + return loginByCode(source, code, null, uuid, null); + } catch (Exception e) { + // 更新登录结果 + outError(e.getMessage()); + } + } + + if (StringUtil.isEmpty(req.getParam(AuthConsts.PARAMS_YUNZHUPAAS_TICKET))) { + // 租户列表登陆标识 + boolean tenantLogin = StringUtil.isEmpty(req.getParam("tenantLogin")) ? false + : req.getParam("tenantLogin").equals("true") ? true : false; + // 租户列表点击登录调用 + if (!tenantLogin) { + // 绑定 + socialsBinding(req, code, state, source); + return null; + } else {// 租户列表点击登录 + LoginVO loginVO = tenantLogin(req); + return ActionResult.success(MsgCode.OA015.get(), loginVO); + } + } else { + // 票据登陆 + if (!isValidYunzhupaasTicket()) { + outError(MsgCode.OA016.get()); + return null; + } + // 接受CODE 进行登录 + if (SaFoxUtil.isNotEmpty(code)) { + try { + String socialName = req.getParam("socialName"); + ActionResult actionResult = loginByCode(source, code, state, null, socialName); + if (400 == actionResult.getCode() || "wechat_applets".equals(req.getParam("source"))) { + return actionResult; + } + return null; + } catch (Exception e) { + // 更新登录结果 + outError(e.getMessage()); + } + return null; + } + return null; + } + + } + + /** + * 租户列表登录 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/9/21 + */ + private LoginVO tenantLogin(SaRequest req) throws LoginException { + String userId = req.getParam("userId"); + String account = req.getParam("account"); + String tenantId = req.getParam("tenantId"); + UserInfo userInfo = new UserInfo(); + userInfo.setUserId(userId); + userInfo.setTenantId(tenantId); + userInfo.setUserAccount(tenantId + "@" + account); + // 切换租户 + switchTenant(userInfo); + // 获取系统配置 + BaseSystemInfo baseSystemInfo = getSysconfig(userInfo); + // 登录账号 + super.loginAccount(userInfo, baseSystemInfo); + // 返回登录信息 + LoginVO loginVo = getLoginVo(userInfo); + return loginVo; + } + + /** + * 第三方绑定 + */ + private void socialsBinding(SaRequest req, String code, String state, String source) { + String userId = req.getParam("userId"); + String tenantId = req.getParam("tenantId"); + PrintWriter out = null; + try { + HttpServletResponse response = ServletUtil.getResponse(); + response.setCharacterEncoding("utf-8"); + response.setHeader("content-type", "text/html;charset=utf-8"); + out = response.getWriter(); + JSONObject binding = socialsUserApi.binding(source, userId, tenantId, code, state); + out.print( + ""); + out.close(); + } catch (Exception e) { + + } + } + + public ActionResult logout() { + return super.logout(); + } + + public int getOrder() { + return ORDER; + } + + @Override + protected void loginSuccess(UserInfo userInfo, BaseSystemInfo baseSystemInfo) { + } + + @Override + protected void loginFailure(UserInfo userInfo, BaseSystemInfo baseSystemInfo, Exception e) { + super.loginFailure(userInfo, baseSystemInfo, e); + } + + protected void outError(String message) { + updateTicketError(message); + } + + @Override + protected String getUserDetailKey() { + return AuthConsts.USERDETAIL_USER_ID; + } + + protected LoginTicketModel updateTicketUnbind(String socialType, String socialUnionid, String socialName) { + LoginTicketModel loginTicketModel = null; + SocialUnbindModel obj = new SocialUnbindModel(socialType, socialUnionid, socialName); + String ticket = this.getYunzhupaasTicket(); + if (!ticket.isEmpty()) { + loginTicketModel = (new LoginTicketModel()).setStatus(LoginTicketStatus.UnBind.getStatus()) + .setValue(JSONObject.toJSONString(obj)); + TicketUtil.updateTicket(ticket, loginTicketModel, (Long) 300L); + } + return loginTicketModel; + } + + protected LoginTicketModel updateTicketMultitenancy(JSONArray jsonArray) { + LoginTicketModel loginTicketModel = null; + String ticket = this.getYunzhupaasTicket(); + if (!ticket.isEmpty()) { + loginTicketModel = (new LoginTicketModel()).setStatus(LoginTicketStatus.Multitenancy.getStatus()) + .setValue(jsonArray.toJSONString()); + TicketUtil.updateTicket(ticket, loginTicketModel, (Long) null); + } + return loginTicketModel; + } + + protected LoginTicketModel updateTicketSuccessReturn(UserInfo userInfo) { + LoginTicketModel loginTicketModel = null; + String ticket = getYunzhupaasTicket(); + if (!ticket.isEmpty()) { + loginTicketModel = new LoginTicketModel() + .setStatus(LoginTicketStatus.Success.getStatus()) + .setValue(StpUtil.getTokenValueNotCut()) + .setTheme(userInfo.getTheme()); + TicketUtil.updateTicket(ticket, loginTicketModel, null); + } + return loginTicketModel; + } + + protected LoginVO getLoginVo(UserInfo userInfo) { + LoginVO loginVO = new LoginVO(); + loginVO.setTheme(userInfo.getTheme()); + loginVO.setToken(userInfo.getToken()); + return loginVO; + } + + /** + * 小程序登录微信授权 + * app微信,qq唤醒 + * + * @param code + * @throws LoginException + */ + protected ActionResult loginByCode(String source, String code, String state, String uuid, String socialName) + throws LoginException { + log.debug("Auth2 Code: {}", code); + SocialsUserInfo socialsUserInfo = null; + if (StringUtil.isNotEmpty(code)) { + socialsUserInfo = socialsUserApi.getSocialsUserInfo(source, code, state); + } else if (StringUtil.isNotEmpty(uuid)) {// 微信和qq唤醒 + socialsUserInfo = socialsUserApi.getUserInfo(source, uuid, state); + if (StringUtil.isEmpty(socialsUserInfo.getSocialName()) && StringUtil.isNotEmpty(socialName)) { + socialsUserInfo.setSocialName(socialName);// 小程序名称前端传递 + } + } + if (configValueUtil.isMultiTenancy()) { + if (socialsUserInfo == null || CollectionUtil.isEmpty(socialsUserInfo.getTenantUserInfo())) { + updateTicketUnbind(source, socialsUserInfo.getSocialUnionid(), socialsUserInfo.getSocialName());// 第三方未绑定账号! + return ActionResult.fail(MsgCode.OA017.get()); + } + if (socialsUserInfo.getTenantUserInfo().size() == 1) { + UserInfo userInfo = socialsUserInfo.getUserInfo(); + // 切换租户 + switchTenant(userInfo); + // 获取系统配置 + BaseSystemInfo baseSystemInfo = getSysconfig(userInfo); + // 登录账号 + super.loginAccount(userInfo, baseSystemInfo); + // 返回登录信息 + LoginTicketModel loginTicketModel = updateTicketSuccessReturn(userInfo); + return ActionResult.success(loginTicketModel); + } else { + JSONArray tenantUserInfo = socialsUserInfo.getTenantUserInfo(); + LoginTicketModel loginTicketModel = updateTicketMultitenancy(tenantUserInfo); + return ActionResult.success(loginTicketModel); + } + } else { + if (socialsUserInfo == null || socialsUserInfo.getUserInfo() == null) { + updateTicketUnbind(source, socialsUserInfo.getSocialUnionid(), socialsUserInfo.getSocialName());// 第三方未绑定账号! + return ActionResult.fail(MsgCode.OA017.get()); + } + UserInfo userInfo = socialsUserInfo.getUserInfo(); + // 切换租户 + switchTenant(userInfo); + // 获取系统配置 + BaseSystemInfo baseSystemInfo = getSysconfig(userInfo); + // 登录账号 + super.loginAccount(userInfo, baseSystemInfo); + LoginTicketModel loginTicketModel = updateTicketSuccessReturn(userInfo); + return ActionResult.success(loginTicketModel); + } + } +} diff --git a/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/granter/TempUserTokenGranter.java b/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/granter/TempUserTokenGranter.java new file mode 100644 index 0000000..ab56f75 --- /dev/null +++ b/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/granter/TempUserTokenGranter.java @@ -0,0 +1,141 @@ +package com.yunzhupaas.granter; + +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.consts.AuthConsts; +import com.yunzhupaas.consts.DeviceType; +import com.yunzhupaas.exception.LoginException; +import com.yunzhupaas.model.BaseSystemInfo; +import com.yunzhupaas.model.LoginVO; +import com.yunzhupaas.util.UserProvider; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +import java.util.Arrays; +import java.util.Map; + +import static com.yunzhupaas.granter.TempUserTokenGranter.GRANT_TYPE; + + +/** + * 临时用户认证 + * @user N + * @author 云筑产品开发平台组 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/9/16 21:25 + */ +@Slf4j +@Component(GRANT_TYPE) +public class TempUserTokenGranter extends AbstractTokenGranter{ + + public static final String GRANT_TYPE = "tempuser"; + public static final Integer ORDER = 4; + private static final String URL_LOGIN = ""; + + + public TempUserTokenGranter(){ + super(URL_LOGIN); + } + + + /** + * + * @param loginParameters {userId, tenantId} + * @return + * @throws LoginException + */ + @Override + public ActionResult granter(Map loginParameters) throws LoginException { + String token = loginParameters.get("token"); + //验证是否由内部发起 + if(!UserProvider.isValidInnerToken(token)){ + throw new LoginException(MsgCode.OA018.get()); + } + String userId = loginParameters.get("userId"); + String tenantId = loginParameters.get("tenantId"); + boolean limited = Boolean.valueOf(loginParameters.get("limited")); + String device = limited?DeviceType.TEMPUSERLIMITED.getDevice():DeviceType.TEMPUSER.getDevice(); + //尝试获取已经登录的用户信息 + UserInfo userInfo; + if(limited){ + //只获取限制类型的TOKEN + userInfo = UserProvider.getUser(userId, tenantId, Arrays.asList(DeviceType.TEMPUSERLIMITED.getDevice()), null); + }else{ + //排除限制类型的TOKEN + userInfo = UserProvider.getUser(userId, tenantId, null, Arrays.asList(DeviceType.TEMPUSERLIMITED.getDevice())); + } + if(userInfo.getUserId() != null){ + return ActionResult.success(getLoginVo(userInfo)); + } + userInfo = UserProvider.getUser(); + userInfo.setUserAccount(tenantId); + userInfo.setUserId(userId); + //切换租户 + switchTenant(userInfo); + //获取系统配置 + BaseSystemInfo baseSystemInfo = getSysconfig(userInfo); + //先设置用户类型 + userInfo.setLoginDevice(device); + //登录账号 + super.loginAccount(userInfo, baseSystemInfo); + //返回登录信息 + LoginVO loginResult = getLoginVo(userInfo); + return ActionResult.success(loginResult); + } + + @Override + public int getOrder() { + return ORDER; + } + + + @Override + protected void preLogin(UserInfo userInfo, BaseSystemInfo baseSystemInfo) throws LoginException { + + } + + @Override + protected void login(UserInfo userInfo, BaseSystemInfo baseSystemInfo) throws LoginException { + UserProvider.loginNoRequest(userInfo, this.getLoginModel(userInfo, baseSystemInfo)); + } + + @Override + protected void loginSuccess(UserInfo userInfo, BaseSystemInfo baseSystemInfo) { + super.loginSuccess(userInfo, baseSystemInfo); + + } + + @Override + protected DeviceType getDeviceType() { + return DeviceType.TEMPUSER; + } + + protected LoginVO getLoginVo(UserInfo userInfo){ + LoginVO loginVO = new LoginVO(); + loginVO.setTheme(userInfo.getTheme()); + loginVO.setToken(userInfo.getToken()); + return loginVO; + } + + @Override + public ActionResult logout() { + //非临时用户不注销 + UserInfo userInfo = UserProvider.getUser(); + if(UserProvider.isTempUser(userInfo)){ + UserProvider.logoutByToken(userInfo.getToken()); + } + return ActionResult.success(MsgCode.OA014.get()); + } + + @Override + protected String getGrantType() { + return GRANT_TYPE; + } + + @Override + protected String getUserDetailKey() { + return AuthConsts.USERDETAIL_USER_ID; + } +} + diff --git a/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/granter/YunzhupaasOfficialTokenGranter.java b/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/granter/YunzhupaasOfficialTokenGranter.java new file mode 100644 index 0000000..1c9af37 --- /dev/null +++ b/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/granter/YunzhupaasOfficialTokenGranter.java @@ -0,0 +1,85 @@ +package com.yunzhupaas.granter; + +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.consts.AuthConsts; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.exception.LoginException; +import com.yunzhupaas.model.BaseSystemInfo; +import com.yunzhupaas.model.LoginForm; +import com.yunzhupaas.model.LoginVO; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.LoginHolder; +import com.yunzhupaas.util.UserProvider; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.Map; + +import static com.yunzhupaas.granter.YunzhupaasOfficialTokenGranter.GRANT_TYPE; + +/** + * YUNZHUPAAS官网专用短信认证 + * + * @author 云筑产品开发平台组 + * @user N + * @copyright 深圳市乐程软件有限公司 + * @date 2024/9/17 22:13 + */ +@Slf4j +@Component(GRANT_TYPE) +public class YunzhupaasOfficialTokenGranter extends PasswordTokenGranter { + + public static final String GRANT_TYPE = "official"; + + @Autowired + private UserDetailsServiceBuilder userDetailsServiceBuilder; + + @Override + public ActionResult granter(Map loginParameters) throws LoginException { + LoginForm loginForm = JsonUtil.getJsonToBean(loginParameters, LoginForm.class); + // 校验短信验证码 + TenantDataSourceUtil.checkOfficialSmsCode(loginForm.getAccount(), loginForm.getCode(), 1); + + UserInfo userInfo = UserProvider.getUser(); + // 切换租户 + switchTenant(userInfo); + // 获取系统配置 + BaseSystemInfo baseSystemInfo = getSysconfig(userInfo); + // 预检信息 + preAuthenticate(loginForm, userInfo, baseSystemInfo); + // 登录账号 + super.loginAccount(userInfo, baseSystemInfo); + // 返回登录信息 + LoginVO loginResult = getLoginVo(userInfo); + return ActionResult.success(loginResult); + } + + /** + * 可重写实现邮箱、短信、TOTP验证 + * + * @param loginForm + * @param sysConfigInfo + * @throws LoginException + */ + protected void preAuthenticate(LoginForm loginForm, UserInfo userInfo, BaseSystemInfo sysConfigInfo) + throws LoginException { + // 验证密码 + UserEntity userEntity = userDetailsServiceBuilder.getUserDetailService(AuthConsts.USERDETAIL_ACCOUNT) + .loadUserEntity(userInfo); + try { + authenticateLock(userEntity, sysConfigInfo); + } catch (Exception e) { + authenticateFailure(userEntity, sysConfigInfo); + throw e; + } + LoginHolder.setUserEntity(userEntity); + } + + @Override + protected String getGrantType() { + return GRANT_TYPE; + } +} diff --git a/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/listener/InterfacePermissionListener.java b/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/listener/InterfacePermissionListener.java new file mode 100644 index 0000000..0cd80f9 --- /dev/null +++ b/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/listener/InterfacePermissionListener.java @@ -0,0 +1,213 @@ +package com.yunzhupaas.listener; + +import cn.dev33.satoken.stp.StpUtil; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.lock.LockInfo; +import com.baomidou.lock.LockTemplate; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.model.module.ModuleModel; +import com.yunzhupaas.constant.EventConst; +import com.yunzhupaas.event.ProjectEventListener; +import com.yunzhupaas.module.ProjectEventInstance; +import com.yunzhupaas.permission.entity.RoleEntity; +import com.yunzhupaas.permission.model.authorize.AuthorizeVO; +import com.yunzhupaas.permission.service.RoleService; +import com.yunzhupaas.permissions.PermissionInterfaceImpl; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import com.yunzhupaas.workflow.service.TemplateApi; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.*; +import java.util.stream.Collectors; + +import static com.yunzhupaas.util.Constants.ADMIN_KEY; + +/** + * 接口权限初始化 + */ +@Slf4j +@Component +public class InterfacePermissionListener { + + @Autowired + private RoleService roleApi; + @Autowired + private LockTemplate lockTemplate; + @Autowired + private TemplateApi templateApi; + + @ProjectEventListener(channel = EventConst.EVENT_INIT_LOGIN_PERMISSION) + public void initPermission(ProjectEventInstance eventInstance) { + UserInfo userInfo = UserProvider.getUser(); + //远程事件 +// AuthorizeVO authorizeVO = ((JSONObject)eventInstance.getSource()).toJavaObject(AuthorizeVO.class); + //本地事件 + AuthorizeVO authorizeVO = (AuthorizeVO) eventInstance.getSource(); + initSecurityAuthorities(authorizeVO, userInfo); + } + + + /** + * 初始化接口鉴权用的账号权限 + * 本接口插入权限缓存, SaInterfaceImpl中框架鉴权时动态调用获取权限列表 + * + * @param authorizeModel + * @param userInfo + */ + private void initSecurityAuthorities(AuthorizeVO authorizeModel, UserInfo userInfo) { + //接口权限 + Set authorityList = new HashSet<>(); + Set roleAuthorityList = new HashSet<>(); + Map moduleModelMap = new LinkedHashMap<>(); + Map flowFormMap = new HashMap<>(); + Map allFlowFormMap = templateApi.getFlowFormMap(); + + Map>> columnsMap = new HashMap<>(); + Map>> formMap = new HashMap<>(); + for (ModuleModel moduleModel : authorizeModel.getModuleList()) { + // 添加菜单权限 + // 添加菜单ID, 代码生成用 + authorityList.add(moduleModel.getId()); + // 添加菜单编码 + authorityList.add(moduleModel.getEnCode()); + moduleModelMap.put(moduleModel.getId(), moduleModel); + //功能菜单 3:功能菜单, 9: 流程菜单 + if (moduleModel.getType() == 3 || moduleModel.getType() == 9 || moduleModel.getType() == 10) { + JSONObject propertyJSON = JSONObject.parseObject(Optional.of(moduleModel.getPropertyJson()).orElse("{}")); + //{"iconBackgroundColor":"","isTree":0,"moduleId":"395851986114733317"} + String moduleId = propertyJSON.getString("moduleId"); + if (!StringUtil.isEmpty(moduleId)) { + authorityList.add(moduleId); + // 流程菜单 拥有流程菜单权限, 直接赋予流程下第一个表单的权限 + if (moduleModel.getType() == 9) { + // 表单编码 + String formId = flowFormMap.get(moduleId); + if (formId == null) { + formId = allFlowFormMap.get(moduleId); + } + if (StringUtil.isNotEmpty(formId)) { + flowFormMap.put(moduleId, formId); + authorityList.add(formId); + } else { + log.error("初始化流程菜单权限失败, 流程表单不存在:" + moduleModel.getFullName()); + } + } + } + } + } + //按钮权限 菜单编码::按钮编码 + authorizeModel.getButtonList().forEach(t -> { + ModuleModel m = moduleModelMap.get(t.getModuleId()); + if (m != null) { + authorityList.add(m.getEnCode() + "::" + t.getEnCode()); + //功能菜单的按钮权限 3:功能菜单, 9: 流程菜单 + if (m.getType() == 3 || m.getType() == 9) { + JSONObject propertyJSON = JSONObject.parseObject(Optional.of(m.getPropertyJson()).orElse("{}")); + //{"iconBackgroundColor":"","isTree":0,"moduleId":"395851986114733317"} + String moduleId = propertyJSON.getString("moduleId"); + if (!StringUtil.isEmpty(moduleId)) { + authorityList.add(moduleId + "::" + t.getEnCode()); + // 流程菜单, 直接赋予流程下第一个表单的对应流程按钮权限 + if (m.getType() == 9) { + // 表单编码 + String formId = flowFormMap.get(moduleId); + if (StringUtil.isNotEmpty(formId)) { + authorityList.add(formId + "::" + t.getEnCode()); + } + } + } + } + } + }); + //列表权限 菜单编码::列表编码 + authorizeModel.getColumnList().forEach(t -> { + ModuleModel m = moduleModelMap.get(t.getModuleId()); + if (m != null) { + authorityList.add(m.getEnCode() + "::" + t.getEnCode()); + } + List> list; + if (columnsMap.get(t.getModuleId()) == null) { + list = new ArrayList<>(); + list.add(JsonUtil.entityToMap(t)); + columnsMap.put(t.getModuleId(), list); + } else { + list = columnsMap.get(t.getModuleId()); + list.add(JsonUtil.entityToMap(t)); + columnsMap.put(t.getModuleId(), list); + } + }); + //表单权限 菜单编码::表单编码 + authorizeModel.getFormsList().forEach(t -> { + ModuleModel m = moduleModelMap.get(t.getModuleId()); + if (m != null) { + authorityList.add(m.getEnCode() + "::" + t.getEnCode()); + } + List> list; + if (formMap.get(t.getModuleId()) == null) { + list = new ArrayList<>(); + list.add(JsonUtil.entityToMap(t)); + formMap.put(t.getModuleId(), list); + } else { + list = formMap.get(t.getModuleId()); + list.add(JsonUtil.entityToMap(t)); + formMap.put(t.getModuleId(), list); + } + }); + + if (userInfo.getRoleIds() != null && !userInfo.getRoleIds().isEmpty() || userInfo.getIsAdministrator()) { + List roles; + if (userInfo.getIsAdministrator()) { + roles = roleApi.getList(false); + } else { + roles = roleApi.getListByIds(userInfo.getRoleIds(), null, false); + } + roleAuthorityList = roles.stream().filter(r -> r.getEnabledMark().equals(1)).map(r -> "ROLE_" + r.getEnCode()).collect(Collectors.toSet()); + + } + + //管理员都是用同一个缓存, 普通账号使用账号名, + //权限列表:authorize_:租户_authorize_authorize_(admin|账号) + //角色列表:authorize_:租户_authorize_role_(admin|账号) + String account = userInfo.getIsAdministrator() ? ADMIN_KEY : userInfo.getUserId(); + LockInfo lockInstance = null; + try { + if (!authorityList.isEmpty() || !roleAuthorityList.isEmpty()) { + String loginId = UserProvider.splicingLoginId(account); + // 等待其他服务初始化权限完毕 +// lockInstance = lockTemplate.lock(RedisConst.REDIS_LOCK4J_PREFIX + ModuleName.OAUTH_SERVER_NAME + loginId, 10000L, 10000L); +// if(lockInstance != null) { + if (!authorityList.isEmpty()) { + // 添加旧权限 + authorityList.addAll(StpUtil.getPermissionList(loginId)); + PermissionInterfaceImpl.setAuthorityList(account, authorityList, null); + } + if (!roleAuthorityList.isEmpty()) { + // 添加旧权限 + roleAuthorityList.addAll(StpUtil.getRoleList(loginId)); + PermissionInterfaceImpl.setRoleList(account, roleAuthorityList, null); + } + + if (!columnsMap.isEmpty()) { + PermissionInterfaceImpl.setColumnMap(account, columnsMap, null); + } + + if (!formMap.isEmpty()) { + PermissionInterfaceImpl.setFormMap(account, formMap, null); + } + +// } + } + } catch (Exception e) { + log.error("初始化接口权限失败", e); + } finally { +// if(lockInstance != null) { +// lockTemplate.releaseLock(lockInstance); +// } + } + } +} + diff --git a/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/listener/LoginListener.java b/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/listener/LoginListener.java new file mode 100644 index 0000000..566e052 --- /dev/null +++ b/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/listener/LoginListener.java @@ -0,0 +1,88 @@ +package com.yunzhupaas.listener; + +import cn.dev33.satoken.listener.SaTokenListenerForSimple; +import cn.dev33.satoken.stp.SaLoginModel; +import cn.dev33.satoken.stp.StpUtil; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.consts.DeviceType; +import com.yunzhupaas.message.service.MessageService; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.service.LogService; +import com.yunzhupaas.util.DateUtil; +import com.yunzhupaas.util.IpUtil; +import com.yunzhupaas.util.LoginHolder; +import com.yunzhupaas.util.UserProvider; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + + +/** + * + * @author 云筑产品开发平台组 + * @copyright 深圳市乐程软件有限公司 + */ +@Slf4j +@Component +public class LoginListener extends SaTokenListenerForSimple { + + + @Autowired + private MessageService messageApi; + @Autowired + private UserService userApi; + + @Override + public void doLogin(String loginType, Object loginId, String tokenValue, SaLoginModel loginModel) { + println( MsgCode.OA001.get()+":{}, "+MsgCode.OA002.get()+":{}, "+MsgCode.OA003.get()+":{}", loginId, loginType, tokenValue); + UserInfo userInfo = UserProvider.getUser(); + //临时用户登录不记录 + if(!UserProvider.isTempUser(userInfo)) { + + UserEntity entity = LoginHolder.getUserEntity(); + entity.setLogErrorCount(0); + entity.setUnlockTime(null); + entity.setEnabledMark(1); + entity.setPrevLogIp(IpUtil.getIpAddr()); + entity.setPrevLogTime(DateUtil.getNowDate()); + entity.setLastLogIp(IpUtil.getIpAddr()); + entity.setLastLogTime(DateUtil.getNowDate()); + entity.setLogSuccessCount(entity.getLogSuccessCount() != null ? entity.getLogSuccessCount() + 1 : 1); + + userApi.updateById(entity); + } + } + + @Override + public void doLogout(String loginType, Object loginId, String tokenValue) { + println(MsgCode.OA004.get()+":{}, "+MsgCode.OA002.get()+":{}, "+MsgCode.OA003.get()+":{}", loginId, loginType, tokenValue); + } + + @Override + public void doKickout(String loginType, Object loginId, String tokenValue) { + println(MsgCode.OA005.get()+":{}, "+MsgCode.OA002.get()+":{}, "+MsgCode.OA003.get()+":{}", loginId, loginType, tokenValue); + messageApi.logoutWebsocketByToken(tokenValue, null); + //删除用户信息缓存, 保留Token状态记录等待自动过期, 如果用户不在线下次打开浏览器会提示被踢下线 + StpUtil.getTokenSessionByToken(tokenValue).logout(); + } + + @Override + public void doReplaced(String loginType, Object loginId, String tokenValue) { + println(MsgCode.OA006.get()+":{}, "+MsgCode.OA002.get()+":{}, "+MsgCode.OA003.get()+":{}", loginId, loginType, tokenValue); + messageApi.logoutWebsocketByToken(tokenValue, null); + StpUtil.getTokenSessionByToken(tokenValue).logout(); + } + + /** + * 打印指定字符串 + * @param str 字符串 + */ + public void println(String str, Object... params) { + if(log.isDebugEnabled()) { + log.debug(str, params); + } + } +} + diff --git a/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/listener/YunzhupaasListener.java b/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/listener/YunzhupaasListener.java new file mode 100644 index 0000000..5a6676d --- /dev/null +++ b/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/listener/YunzhupaasListener.java @@ -0,0 +1,30 @@ +package com.yunzhupaas.listener; + +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.util.RedisUtil; +import com.yunzhupaas.util.context.SpringContext; +import org.springframework.context.ApplicationListener; +import org.springframework.context.event.ContextRefreshedEvent; +import org.springframework.stereotype.Component; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/16 8:49 + */ +@Component +public class YunzhupaasListener implements ApplicationListener { + + private ConfigValueUtil configValueUtil; + + @Override + public void onApplicationEvent(ContextRefreshedEvent event) { + configValueUtil = SpringContext.getBean(ConfigValueUtil.class); + if ("false".equals(configValueUtil.getTestVersion())) { + RedisUtil redisUtil = SpringContext.getBean(RedisUtil.class); + redisUtil.removeAll(); + } + } +} diff --git a/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/service/impl/AuthServiceImpl.java b/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/service/impl/AuthServiceImpl.java new file mode 100644 index 0000000..f384f91 --- /dev/null +++ b/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/service/impl/AuthServiceImpl.java @@ -0,0 +1,109 @@ +package com.yunzhupaas.service.impl; + +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.LoginException; +import com.yunzhupaas.exception.TenantDatabaseException; +import com.yunzhupaas.exception.TenantInvalidException; +import com.yunzhupaas.granter.TokenGranter; +import com.yunzhupaas.granter.TokenGranterBuilder; +import com.yunzhupaas.model.LoginVO; +import com.yunzhupaas.service.AuthService; +import com.yunzhupaas.service.LogService; +import com.yunzhupaas.util.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Map; + +/** + * 登录与退出服务 其他服务调用 + */ +@Service +@Slf4j +public class AuthServiceImpl implements AuthService { + + @Autowired + private TokenGranterBuilder tokenGranterBuilder; + @Autowired + private LogService logApi; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private RedisUtil redisUtil; + + /** + * 登录 + * @param parameters {grant_type} + * @return + * @throws LoginException + */ + @Override + public ActionResult login(Map parameters) throws LoginException{ + long millis = System.currentTimeMillis(); + TokenGranter tokenGranter = tokenGranterBuilder.getGranter(parameters.getOrDefault("grant_type", "")); + ActionResult result; + UserInfo userInfo = new UserInfo(); + try { + String account = parameters.get("account"); + userInfo.setUserAccount(account); + UserProvider.setLocalLoginUser(userInfo); + result = tokenGranter.granter(parameters); + //写入日志 + if (userInfo.getUserId() != null && !UserProvider.isTempUser(userInfo)) { + logApi.writeLogAsync(userInfo.getUserId(), userInfo.getUserName() + "/" + userInfo.getUserAccount(), MsgCode.OA015.get(), (System.currentTimeMillis() - millis)); + } + } catch (TenantDatabaseException tdex){ + throw tdex; + } catch (Exception e){ + if(!(e instanceof LoginException || e instanceof TenantInvalidException)){ + String msg = e.getMessage(); + if(msg == null){ + msg = MsgCode.OA007.get(); + } + log.error(MsgCode.OA007.get()+", Account: {}, Error: {}", parameters.getOrDefault("account", ""), e.getMessage(), e); + throw new LoginException(msg); + } + String userName = StringUtil.isNotEmpty(userInfo.getUserName()) ? userInfo.getUserName()+"/"+userInfo.getUserAccount() : userInfo.getUserAccount(); + logApi.writeLogAsync(userInfo.getUserId(), userName, e.getMessage(), userInfo, 0, null, (System.currentTimeMillis()-millis)); + throw e; + }finally{ + LoginHolder.clearUserEntity(); + TenantProvider.clearBaseSystemIfo(); + // 请求之后就删除验证码 不论结果 + String imgCode = parameters.get("timestamp"); + if(StringUtil.isNotEmpty(imgCode)) { + redisUtil.remove(imgCode); + } + } + return result; + } + + + /** + * 踢出用户, 用户将收到Websocket下线通知 + * 执行流程:认证服务退出用户->用户踢出监听->消息服务发送Websocket推送退出消息 + * @param tokens + */ + @Override + public ActionResult kickoutByToken(String... tokens){ + UserProvider.kickoutByToken(tokens); + return ActionResult.success(); + } + + /** + * 踢出用户, 用户将收到Websocket下线通知 + * 执行流程:认证服务退出用户->用户踢出监听->消息服务发送Websocket推送退出消息 + * @param userId + * @param tenantId + */ + @Override + public ActionResult kickoutByUserId(String userId, String tenantId){ + UserProvider.kickoutByUserId(userId, tenantId); + return ActionResult.success(); + } +} + diff --git a/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/service/impl/LoginServiceImpl.java b/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/service/impl/LoginServiceImpl.java new file mode 100644 index 0000000..552b165 --- /dev/null +++ b/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/service/impl/LoginServiceImpl.java @@ -0,0 +1,1056 @@ +package com.yunzhupaas.service.impl; + +import cn.hutool.core.net.url.UrlBuilder; +import cn.hutool.core.util.BooleanUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.http.useragent.UserAgent; +import cn.hutool.http.useragent.UserAgentUtil; +import com.alibaba.fastjson.JSONObject; +import com.google.common.collect.ImmutableList; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.*; +import com.yunzhupaas.base.model.base.SystemBaeModel; +import com.yunzhupaas.base.model.button.ButtonModel; +import com.yunzhupaas.base.model.column.ColumnModel; +import com.yunzhupaas.base.model.form.ModuleFormModel; +import com.yunzhupaas.base.model.module.ModuleModel; +import com.yunzhupaas.base.model.resource.ResourceModel; +import com.yunzhupaas.base.service.*; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.EventConst; +import com.yunzhupaas.constant.YunzhupaasConst; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.constant.PermissionConst; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.exception.TenantDatabaseException; +import com.yunzhupaas.message.entity.MessageTemplateConfigEntity; +import com.yunzhupaas.message.service.MessageService; +import com.yunzhupaas.message.service.MessageTemplateConfigService; +import com.yunzhupaas.model.BaseSystemInfo; +import com.yunzhupaas.model.BuildUserCommonInfoModel; +import com.yunzhupaas.model.tenant.TenantAuthorizeModel; +import com.yunzhupaas.model.tenant.TenantVO; +import com.yunzhupaas.module.ProjectEventBuilder; +import com.yunzhupaas.permission.entity.SignEntity; +import com.yunzhupaas.portal.constant.PortalConst; +import com.yunzhupaas.portal.service.PortalDataService; +import com.yunzhupaas.exception.LoginException; +import com.yunzhupaas.granter.UserDetailsServiceBuilder; +import com.yunzhupaas.model.login.*; +import com.yunzhupaas.permission.entity.*; +import com.yunzhupaas.permission.model.authorize.AuthorizeVO; +import com.yunzhupaas.permission.service.*; +import com.yunzhupaas.permissions.PermissionInterfaceImpl; +import com.yunzhupaas.portal.service.PortalService; +import com.yunzhupaas.properties.SecurityProperties; +import com.yunzhupaas.service.LoginService; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.context.RequestContext; +import com.yunzhupaas.util.treeutil.ListToTreeUtil; +import com.yunzhupaas.util.treeutil.SumTree; +import com.yunzhupaas.util.treeutil.newtreeutil.TreeDotUtils; +import com.yunzhupaas.util.LoginHolder; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +import static com.yunzhupaas.util.Constants.ADMIN_KEY; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(...) + * @date 2024/3/16 + */ +@Slf4j +@Service +public class LoginServiceImpl implements LoginService { + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private SecurityProperties securityProperties; + + @Autowired + private UserService userApi; + @Autowired + private UserRelationService userRelationApi; + @Autowired + private OrganizeService organizeApi; + @Autowired + private PositionService positionApi; + @Autowired + private RoleService roleApi; + @Autowired + private GroupService groupApi; + @Autowired + private AuthorizeService authorizeApi; + @Autowired + private SysconfigService sysconfigApi; + @Autowired + private PortalService portalApi; + @Autowired + private PortalDataService portalDataService; + @Autowired + private RedisUtil redisUtil; + @Autowired + private CacheKeyUtil cacheKeyUtil; + @Autowired + private OrganizeRelationService organizeRelationApi; + @Autowired + private SystemService systemApi; + @Autowired + private UserDetailsServiceBuilder userDetailsServiceBuilder; + @Autowired + private SignService signService; + @Autowired + private MessageTemplateConfigService messageTemplateApi; + @Autowired + private MessageService sentMessageApi; + @Autowired + private OrganizeAdministratorService organizeAdminTratorApi; + @Autowired + private ModuleService moduleApi; + @Autowired + private PermissionGroupService permissionGroupApi; + @Autowired + private ModuleButtonService buttonApi; + @Autowired + private ModuleColumnService columnApi; + @Autowired + private ModuleFormService formApi; + @Autowired + private ModuleDataAuthorizeSchemeService dataAuthorizeSchemeApi; + + @Override + public UserInfo getTenantAccount(UserInfo userInfo) throws LoginException { + String tenantId = null; + if (configValueUtil.isMultiTenancy()) { + String[] tenantAccount = userInfo.getUserAccount().split("\\@"); + if (tenantAccount.length == 1) { + // 只输入账号, 1:配置的二级域名下只输入账号, 2:主域名下输入了租户号 + String referer = ServletUtil.getHeader("Referer"); + if (StringUtil.isNotEmpty(referer)) { + String remoteHost = UrlBuilder.of(referer).getHost(); + String apiHost = UrlBuilder.of(RequestContext.isOrignPc() ? configValueUtil.getFrontDomain() + : configValueUtil.getAppDomain()).getHost(); + if (!ObjectUtil.equals(remoteHost, apiHost) + && remoteHost.endsWith(apiHost)) { + // 二级域名访问, 输入的是账号 + tenantId = remoteHost.split("\\.")[0]; + userInfo.setUserAccount(tenantAccount[0]); + } + } + if (tenantId == null) { + // 主域名访问, 输入的是租户号 + tenantId = tenantAccount[0]; + userInfo.setUserAccount(ADMIN_KEY); + } + } else { + // 租户号@账号 + tenantId = tenantAccount[0]; + userInfo.setUserAccount(tenantAccount[1]); + } + if (StringUtil.isEmpty(tenantId) || tenantAccount.length > 2 + || StringUtil.isEmpty(userInfo.getUserAccount())) { + throw new LoginException(MsgCode.LOG102.get()); + } + TenantVO tenantVO = TenantDataSourceUtil.getRemoteTenantInfo(tenantId); + TenantDataSourceUtil.switchTenant(tenantId, tenantVO); + // 切换成租户库 + userInfo.setTenantId(tenantId); + userInfo.setTenantDbConnectionString(tenantVO.getDbName()); + userInfo.setTenantDbType(tenantVO.getType()); + // 查库测试 + BaseSystemInfo baseSystemInfo = null; + try { + baseSystemInfo = getBaseSystemConfig(userInfo.getTenantId()); + } catch (Exception e) { + log.error("登录获取系统配置失败: {}", e.getMessage()); + } + if (baseSystemInfo == null || baseSystemInfo.getSingleLogin() == null) { + throw new TenantDatabaseException(); + } + } + return userInfo; + } + + @Override + public UserInfo userInfo(UserInfo userInfo, BaseSystemInfo sysConfigInfo) throws LoginException { + // 获取账号信息 + UserEntity userEntity = LoginHolder.getUserEntity(); + if (userEntity == null) { + userEntity = userDetailsServiceBuilder.getUserDetailService(userInfo.getUserDetailKey()) + .loadUserEntity(userInfo); + LoginHolder.setUserEntity(userEntity); + } + + checkUser(userEntity, userInfo, sysConfigInfo); + + userInfo.setUserId(userEntity.getId()); + userInfo.setUserAccount(userEntity.getAccount()); + userInfo.setUserName(userEntity.getRealName()); + userInfo.setUserIcon(userEntity.getHeadIcon()); + userInfo.setTheme(userEntity.getTheme()); + userInfo.setOrganizeId(userEntity.getOrganizeId()); + userInfo.setPortalId(userEntity.getPortalId()); + userInfo.setMobilePhone(userEntity.getMobilePhone()); + userInfo.setEmail(userEntity.getEmail()); + userInfo.setEnabledMark(userEntity.getEnabledMark()); + userInfo.setCreateTime(userEntity.getCreatorTime()); + userInfo.setUserGender(userEntity.getGender()); + userInfo.setIsAdministrator(BooleanUtil.toBoolean(String.valueOf((userEntity.getIsAdministrator())))); + if (!ADMIN_KEY.equals(userInfo.getUserAccount())) { + if (ObjectUtil.isNotEmpty(userEntity.getStanding())) { + userInfo.setIsAdministrator(Objects.equals(userEntity.getStanding(), 1)); + } + } + // 添加过期时间 + String time = sysConfigInfo.getTokenTimeout(); + if (StringUtil.isNotEmpty(time)) { + Integer minu = Integer.valueOf(time); + userInfo.setOverdueTime(DateUtil.dateAddMinutes(null, minu)); + userInfo.setTokenTimeout(minu); + } + + String ipAddr = IpUtil.getIpAddr(); + userInfo.setLoginIpAddress(ipAddr); + userInfo.setLoginIpAddressName(IpUtil.getIpCity(ipAddr)); + userInfo.setLoginTime(DateUtil.getmmNow()); + UserAgent userAgent = UserAgentUtil.parse(ServletUtil.getUserAgent()); + if (userAgent != null) { + userInfo.setLoginPlatForm(userAgent.getPlatform().getName() + " " + userAgent.getOsVersion()); + userInfo.setBrowser(userAgent.getBrowser().getName() + " " + userAgent.getVersion()); + } + userInfo.setPrevLoginTime(userEntity.getPrevLogTime()); + userInfo.setPrevLoginIpAddress(userEntity.getPrevLogIp()); + userInfo.setPrevLoginIpAddressName(IpUtil.getIpCity(userEntity.getPrevLogIp())); + // 生成id + String token = RandomUtil.uuId(); + userInfo.setId(cacheKeyUtil.getLoginToken(userInfo.getTenantId()) + token); + + createUserOnline(userInfo); + return userInfo; + } + + @Override + public void updatePasswordMessage() { + UserInfo userInfo = UserProvider.getUser(); + UserEntity userEntity = userApi.getInfo(userInfo.getUserId()); + BaseSystemInfo baseSystemInfo = sysconfigApi.getSysInfo(); + if (baseSystemInfo.getPasswordIsUpdatedRegularly() == 1) { + Date changePasswordDate = userEntity.getCreatorTime(); + if (userEntity.getChangePasswordDate() != null) { + changePasswordDate = userEntity.getChangePasswordDate(); + } + // 当前时间 + Date nowDate = DateUtil.getNowDate(); + // 更新周期 + Integer updateCycle = baseSystemInfo.getUpdateCycle(); + // 提前N天提醒 + Integer updateInAdvance = baseSystemInfo.getUpdateInAdvance(); + Integer day = DateUtil.getDiffDays(changePasswordDate, nowDate); + if (day >= (updateCycle - updateInAdvance)) { + MessageTemplateConfigEntity entity = messageTemplateApi.getInfoByEnCode("XTXXTX001", "1"); + if (entity != null) { + List toUserIds = new ArrayList<>(); + toUserIds.add(userInfo.getUserId()); + sentMessageApi.sentMessage(toUserIds, entity.getTitle(), entity.getContent(), userInfo, + Integer.parseInt(entity.getMessageSource()), Integer.parseInt(entity.getMessageType())); + } + } + } + } + + /** + * 创建用户在线信息 + * + * @param userInfo + */ + private void createUserOnline(UserInfo userInfo) { + String userId = userInfo.getUserId(); + // long time= DateUtil.getTime(userInfo.getOverdueTime()) - DateUtil.getTime(new + // Date()); + + String authorize = String.valueOf(redisUtil.getString(cacheKeyUtil.getUserAuthorize() + userId)); + // String loginOnlineKey=cacheKeyUtil.getLoginOnline() + userId; + redisUtil.remove(authorize); + // 记录Token + // redisUtil.insert(userInfo.getId(), userInfo,time); + // 记录在线 + if (ServletUtil.getIsMobileDevice()) { + // redisUtil.insert(cacheKeyUtil.getMobileLoginOnline() + userId, + // userInfo.getId(), time); + // 记录移动设备CID,用于消息推送 + if (ServletUtil.getHeader("clientId") != null) { + String clientId = ServletUtil.getHeader("clientId"); + Map map = new HashMap<>(16); + map.put(userInfo.getUserId(), clientId); + redisUtil.insert(cacheKeyUtil.getMobileDeviceList(), map); + } + } else { + // redisUtil.insert(loginOnlineKey, userInfo.getId(), time); + } + } + + private UserCommonInfoVO data(BuildUserCommonInfoModel buildUserCommonInfoModel) { + UserInfo userInfo = buildUserCommonInfoModel.getUserInfo(); + String type = buildUserCommonInfoModel.getType(); + // 公司Id + // List list = organizeApi.getList(false); + UserEntity userEntity = buildUserCommonInfoModel.getUserEntity(); + userInfo.setManagerId(userInfo.getManagerId()); + boolean b = userInfo.getIsAdministrator(); + if (StringUtil.isEmpty(userEntity.getSystemId())) { + SystemEntity systemEntity = buildUserCommonInfoModel.getMainSystemEntity(); + userInfo.setSystemId(systemEntity.getId()); + userEntity.setSystemId(systemEntity.getId()); + } + if (StringUtil.isEmpty(userEntity.getAppSystemId())) { + SystemEntity systemEntity = buildUserCommonInfoModel.getWorkSystemEntity(); + userInfo.setAppSystemId(systemEntity.getId()); + userEntity.setAppSystemId(systemEntity.getId()); + } + this.userInfo(userInfo, userInfo.getUserId(), b, userEntity, buildUserCommonInfoModel.getSystemId()); + // userInfo.setSubOrganizeIds(this.getSubOrganizeIds(list, + // userInfo.getOrganizeId(), b)); + List subordinateIdsList = userApi.getListByManagerId(userInfo.getUserId(), null).stream() + .map(UserEntity::getId).collect(Collectors.toList()); + userInfo.setSubordinateIds(subordinateIdsList); + userInfo.setLoginTime(DateUtil.getmmNow()); + // if (StringUtil.isNotEmpty(userInfo.getId())) { + // redisUtil.insert(userInfo.getId(), userInfo, + // DateUtil.getTime(userInfo.getOverdueTime()) - DateUtil.getTime(new Date())); + // } + BaseSystemInfo baseSystemInfo = buildUserCommonInfoModel.getBaseSystemInfo(); + UserCommonInfoVO infoVO = JsonUtil.getJsonToBean(genUserInfo(userInfo, baseSystemInfo), UserCommonInfoVO.class); + infoVO.setGroupIds(userInfo.getGroupIds()); + infoVO.setGroupNames(userInfo.getGroupNames()); + // 角色数组 + infoVO.setRoleIds(userInfo.getRoleIds()); + // 最后一次修改密码时间 + infoVO.setChangePasswordDate(userEntity.getChangePasswordDate()); + // 角色名称 + StringBuilder roleName = new StringBuilder(); + for (RoleEntity entity : roleApi.getListByIds(userInfo.getRoleIds(), null, false)) { + roleName.append("," + entity.getFullName()); + } + if (roleName.length() > 0) { + infoVO.setRoleName(roleName.toString().replaceFirst(",", "")); + } + // 主管 + UserEntity info = userApi.getInfo(userEntity.getManagerId()); + if (info != null) { + infoVO.setManager(info.getRealName() + "/" + info.getAccount()); + } + // 手机 + infoVO.setMobilePhone(userEntity.getMobilePhone()); + // 邮箱 + infoVO.setEmail(userEntity.getEmail()); + // 生日 + infoVO.setBirthday(userEntity.getBirthday() != null ? userEntity.getBirthday().getTime() : null); + // 姓名 + infoVO.setUserName(userEntity.getRealName()); + // 组织 + OrganizeEntity organizeEntity = organizeApi.getInfo(userInfo.getOrganizeId()); + String organizeName = null; + String departmentId = null; + String departmentName = null; + List departmentIdList = null; + String organizeId = null; + if (organizeEntity != null) { + if (PermissionConst.DEPARTMENT.equals(organizeEntity.getCategory())) { + organizeName = organizeEntity.getFullName(); + organizeId = organizeEntity.getId(); + } + if (StringUtil.isNotEmpty(organizeEntity.getOrganizeIdTree())) { + String[] split = organizeEntity.getOrganizeIdTree().split(","); + departmentId = split.length > 0 ? split[split.length - 1] : ""; + departmentIdList = split.length > 0 ? Arrays.asList(split) : new ArrayList<>(); + departmentName = organizeApi.getFullNameByOrgIdTree(null, organizeEntity.getOrganizeIdTree(), "/"); + } + } + userInfo.setOrganize(departmentName); + infoVO.setOrganizeName(departmentName); + infoVO.setOrganizeId(departmentId); + infoVO.setOrganizeIdList(departmentIdList == null ? new ArrayList<>() : departmentIdList); + // 部门id + infoVO.setDepartmentId(organizeId); + // 部门名称 + infoVO.setDepartmentName(organizeName); + infoVO.setIsAdministrator(BooleanUtil.toBoolean(String.valueOf(userEntity.getIsAdministrator()))); + if (!ADMIN_KEY.equals(userEntity.getAccount())) { + if (ObjectUtil.isNotEmpty(userEntity.getStanding())) { + userInfo.setIsAdministrator(Objects.equals(userEntity.getStanding(), 1)); + infoVO.setIsAdministrator(Objects.equals(userEntity.getStanding(), 1)); + } + } + return infoVO; + } + + public UserEntity checkUser(UserEntity userEntity, UserInfo userInfo, BaseSystemInfo sysConfigInfo) + throws LoginException { + if (userEntity == null) { + throw new LoginException(MsgCode.LOG101.get()); + } + // 判断是否组织、岗位、角色、部门主管是否为空,为空则抛出异常 + // 判断是否为管理员,是否为Admin(Admin为最高账号,不受限制) + if (!ADMIN_KEY.equals(userEntity.getAccount()) || userEntity.getIsAdministrator() != 1) { + // 组织id为空则直接抛出异常 + if (StringUtil.isEmpty(userEntity.getOrganizeId())) { + throw new LoginException(MsgCode.LOG004.get()); + } + } + if (userEntity.getIsAdministrator() == 0) { + if (userEntity.getEnabledMark() == null) { + throw new LoginException(MsgCode.LOG005.get()); + } + if (userEntity.getEnabledMark() == 0) { + throw new LoginException(MsgCode.LOG006.get()); + } + } + if (userEntity.getDeleteMark() != null && userEntity.getDeleteMark() == 1) { + throw new LoginException(MsgCode.LOG007.get()); + } + // 安全验证 + String ipAddr = IpUtil.getIpAddr(); + userInfo.setLoginIpAddress(IpUtil.getIpAddr()); + // 判断白名单 + if (!ADMIN_KEY.equals(userEntity.getAccount()) && "1".equals(sysConfigInfo.getWhitelistSwitch())) { + List ipList = Arrays.asList(sysConfigInfo.getWhitelistIp().split(",")); + if (!ipList.contains(ipAddr)) { + throw new LoginException(MsgCode.LOG010.get()); + } + } + // 判断用户所属的角色是否被禁用 + if (userEntity.getIsAdministrator() == 0 && + organizeAdminTratorApi.getInfoByUserId(userEntity.getId()).size() == 0) { + List permissionGroupByUserIdAndTenantId = permissionGroupApi + .getPermissionGroupByUserId(userEntity.getId(), null, false, null); + if (permissionGroupByUserIdAndTenantId.size() == 0) { + throw new LoginException(MsgCode.OA009.get()); + } + // 如果只有组织权限的话就切换到有权限的组织 + String organizeIdByUserIdAndTenantId = permissionGroupApi.getPermissionGroupByUserId(userEntity.getId()); + if (StringUtil.isNotEmpty(organizeIdByUserIdAndTenantId)) { + userEntity.setOrganizeId(organizeIdByUserIdAndTenantId); + } + } + // 判断当前账号是否被锁定 + Integer lockMark = userEntity.getEnabledMark(); + if (Objects.nonNull(lockMark) && lockMark == 2) { + // 获取解锁时间 + Date unlockTime = userEntity.getUnlockTime(); + // 账号锁定 + if (sysConfigInfo.getLockType() == 1 || Objects.isNull(unlockTime)) { + throw new LoginException(MsgCode.LOG012.get()); + } + // 延迟登陆锁定 + long millis = System.currentTimeMillis(); + // 系统设置的错误次数 + int passwordErrorsNumber = sysConfigInfo.getPasswordErrorsNumber() != null + ? sysConfigInfo.getPasswordErrorsNumber() + : 0; + // 用户登录错误次数 + int logErrorCount = userEntity.getLogErrorCount() != null ? userEntity.getLogErrorCount() : 0; + if (unlockTime.getTime() > millis) { + // 转成分钟 + int time = (int) ((unlockTime.getTime() - millis) / (1000 * 60)); + throw new LoginException(MsgCode.LOG108.get(time + 1)); + } else if (unlockTime.getTime() < millis && logErrorCount >= passwordErrorsNumber) { + // 已经接触错误时间锁定的话就重置错误次数 + userEntity.setLogErrorCount(0); + userEntity.setEnabledMark(1); + userApi.updateById(userEntity); + } + } + return userEntity; + } + + /** + * 获取用户登陆信息 + * + * @return + */ + @Override + public PcUserVO getCurrentUser(String type, String systemCode) { + List standingList = new ArrayList() { + { + add(3); + } + }; + UserInfo userInfo = UserProvider.getUser(); + SystemEntity mainSystemEntity = systemApi.getInfoByEnCode(YunzhupaasConst.MAIN_SYSTEM_CODE); + SystemEntity workSystemEntity = systemApi.getInfoByEnCode(YunzhupaasConst.WORK_SYSTEM_CODE); + UserEntity userEntity = userApi.getInfo(userInfo.getUserId()); + if (userEntity == null) { + return null; + } + SystemEntity systemCodeEntity = systemApi.getInfoByEnCode(systemCode); + if (StringUtil.isNotEmpty(systemCode)) { + userInfo.setSystemCode(systemCode); + if ("App".equals(type)) { + throw new LoginException(MsgCode.OA010.get()); + } + if (systemCodeEntity == null) { + UserProvider.logout(); + throw new LoginException(MsgCode.OA011.get()); + } else if (ObjectUtil.equal(systemCodeEntity.getEnabledMark(), 0)) { + UserProvider.logout(); + throw new LoginException(MsgCode.OA012.get()); + } + } + + BaseSystemInfo baseSystemInfo = sysconfigApi.getSysInfo(); + List userStanding = authorizeApi.getUserStanding(false, userEntity.getId()); + for (UserSystemVO systemVO : userStanding) { + int stand = StringUtil.isEmpty(systemVO.getId()) ? 3 : Integer.parseInt(systemVO.getId()); + if (ObjectUtil.isEmpty(userEntity.getStanding())) { + userEntity.setStanding(stand); + } + if (ObjectUtil.isEmpty(userEntity.getAppStanding())) { + userEntity.setAppStanding(stand); + } + } + BuildUserCommonInfoModel buildUserCommonInfoModel = new BuildUserCommonInfoModel(userInfo, mainSystemEntity, + workSystemEntity, userEntity, baseSystemInfo, + Optional.ofNullable(systemCodeEntity).isPresent() ? systemCodeEntity.getId() : null, type); + UserCommonInfoVO infoVO = this.data(buildUserCommonInfoModel); + AuthorizeVO authorizeModel = authorizeApi.getAuthorize(false, false, true); // this.getAuthorize(false, + // singletonOrg) + List systemList = authorizeModel.getSystemList(); + // 从分管中获取菜单 + List standing = authorizeApi.getUserStanding(true, userEntity.getId()).stream() + .filter(t -> "2".equals(t.getId())).collect(Collectors.toList()); + List listByUserId1 = organizeAdminTratorApi + .getOrganizeAdministratorEntity(userInfo.getUserId(), PermissionConst.MODULE, false); + List moduleAuthorize = new ArrayList<>(); + List moduleUrlAddressAuthorize = new ArrayList<>(); + if (configValueUtil.isMultiTenancy()) { + TenantAuthorizeModel tenantAuthorizeModel = TenantDataSourceUtil + .getCacheModuleAuthorize(userInfo.getTenantId()); + moduleAuthorize = tenantAuthorizeModel.getModuleIdList(); + moduleUrlAddressAuthorize = tenantAuthorizeModel.getUrlAddressList(); + } + List moduleEntities = moduleApi.getModuleByIds( + listByUserId1.stream().map(OrganizeAdministratorEntity::getOrganizeId).collect(Collectors.toList()), + moduleAuthorize, moduleUrlAddressAuthorize, false); + List moduleJsonToList = new ArrayList<>(); + if ("App".equals(type)) { + List appSystemList = systemList.stream() + .filter(t -> !mainSystemEntity.getId().equals(t.getId())).collect(Collectors.toList()); + List appModuleList = moduleEntities.stream() + .filter(t -> !mainSystemEntity.getId().equals(t.getSystemId())).collect(Collectors.toList()); + boolean appStanding = standing.stream().filter(t -> t.isCurrentStanding()).count() > 0; + systemList.retainAll(appSystemList); + if (appStanding) { + moduleEntities.retainAll(appModuleList); + moduleJsonToList.addAll(JsonUtil.getJsonToList(moduleEntities, ModuleModel.class)); + } + } else { + if (moduleEntities.size() > 0) { + boolean pcStanding = standing.stream().filter(t -> t.isCurrentStanding()).count() > 0; + if (pcStanding) { + SystemBaeModel systemBaeModel = JsonUtil.getJsonToBean(mainSystemEntity, SystemBaeModel.class); + systemList.add(systemBaeModel); + systemList = systemList.stream().distinct().collect(Collectors.toList()); + moduleJsonToList.addAll(JsonUtil.getJsonToList(moduleEntities, ModuleModel.class)); + } + } + } + if (standing.size() > 0) { + standingList.add(2); + } + + // 获取菜单权限 + List moduleList = authorizeModel.getModuleList(); + moduleList.addAll(moduleJsonToList); + moduleList = moduleList.stream().distinct().collect(Collectors.toList()); + + authorizeModel.setModuleList(moduleList); + List moduleList1 = new ArrayList<>(); + List menuList = moduleList.stream().filter(t -> type.equals(t.getCategory())) + .sorted(Comparator.comparing(ModuleModel::getSortCode)).collect(Collectors.toList()); + moduleList1.addAll(moduleList); + + // 岗位 + /* + * List posiList = Arrays.asList(userInfo.getPositionIds()); + * List positionList = positionApi.getPositionName(posiList, + * false); + * List positionVO = new ArrayList<>(); + * for (PositionEntity positionEntity : positionList) { + * UserPositionVO userPositionVO = new UserPositionVO(); + * userPositionVO.setName(positionEntity.getFullName()); + * userPositionVO.setId(positionEntity.getId()); + * positionVO.add(userPositionVO); + * } + */ + List models = new ArrayList<>(); + + // 按钮等权限增加分级管理的 + // 按钮 + List buttonList = authorizeModel.getButtonList(); + List buttonByModuleId = buttonApi + .getListByModuleIds(moduleJsonToList.stream().map(ModuleModel::getId).collect(Collectors.toList())); + List buttonJsonToList = JsonUtil.getJsonToList(buttonByModuleId, ButtonModel.class); + buttonList.addAll(buttonJsonToList); + buttonList = buttonList.stream().distinct().collect(Collectors.toList()); + // 列表 + List columnList = authorizeModel.getColumnList(); + List columnByModuleId = columnApi + .getListByModuleId(moduleJsonToList.stream().map(ModuleModel::getId).collect(Collectors.toList())); + List columnJsonToList = JsonUtil.getJsonToList(columnByModuleId, ColumnModel.class); + columnList.addAll(columnJsonToList); + columnList = columnList.stream().distinct().collect(Collectors.toList()); + // 表单 + List formsList = authorizeModel.getFormsList(); + List formByModuleId = formApi + .getListByModuleId(moduleJsonToList.stream().map(ModuleModel::getId).collect(Collectors.toList())); + List formJsonToList = JsonUtil.getJsonToList(formByModuleId, ModuleFormModel.class); + formsList.addAll(formJsonToList); + formsList = formsList.stream().distinct().collect(Collectors.toList()); + // 数据 + List resourceList = authorizeModel.getResourceList(); + List resourceByModuleId = dataAuthorizeSchemeApi + .getListByModuleId(moduleJsonToList.stream().map(ModuleModel::getId).collect(Collectors.toList())); + List resourceJsonToList = JsonUtil.getJsonToList(resourceByModuleId, ResourceModel.class); + resourceList.addAll(resourceJsonToList); + resourceList = resourceList.stream().distinct().collect(Collectors.toList()); + authorizeModel.setButtonList(buttonList); + authorizeModel.setColumnList(columnList); + authorizeModel.setFormsList(formsList); + authorizeModel.setResourceList(resourceList); + for (ModuleModel moduleModel : menuList) { + PermissionModel model = new PermissionModel(); + model.setModelId(moduleModel.getId()); + model.setModuleName(moduleModel.getFullName()); + + List buttonModels = authorizeModel.getButtonList().stream() + .filter(t -> moduleModel.getId().equals(t.getModuleId())).collect(Collectors.toList()); + List columnModels = authorizeModel.getColumnList().stream() + .filter(t -> moduleModel.getId().equals(t.getModuleId())).collect(Collectors.toList()); + List resourceModels = authorizeModel.getResourceList().stream() + .filter(t -> moduleModel.getId().equals(t.getModuleId())).collect(Collectors.toList()); + List moduleFormModels = authorizeModel.getFormsList().stream() + .filter(t -> moduleModel.getId().equals(t.getModuleId())).collect(Collectors.toList()); + model.setButton(JsonUtil.getJsonToList(buttonModels, PermissionVO.class)); + model.setColumn(JsonUtil.getJsonToList(columnModels, PermissionVO.class)); + model.setResource(JsonUtil.getJsonToList(resourceModels, PermissionVO.class)); + model.setForm(JsonUtil.getJsonToList(moduleFormModels, PermissionVO.class)); + if (moduleModel.getType() != 1) { + models.add(model); + } + } + // 岗位 + List relationList = userRelationApi.getListByUserId(userEntity.getId(), + PermissionConst.POSITION); + List positionIds = relationList.stream().map(UserRelationEntity::getObjectId) + .collect(Collectors.toList()); + List positionName = positionApi.getPositionName(positionIds, false).stream() + .filter(t -> t.getEnabledMark() != null && t.getEnabledMark() == 1).collect(Collectors.toList()); + List positionIdVO = new ArrayList<>(); + positionName.forEach(t -> { + if (!t.getOrganizeId().equals(userEntity.getOrganizeId())) { + return; + } + UserPositionVO userPositionVO = new UserPositionVO(); + userPositionVO.setId(t.getId()); + userPositionVO.setName(t.getFullName()); + positionIdVO.add(userPositionVO); + }); + infoVO.setPositionIds(positionIdVO); + PositionEntity positionEntity = positionName.stream().filter(t -> t.getId().equals(userEntity.getPositionId())) + .findFirst().orElse(null); + infoVO.setPositionId(positionEntity != null ? positionEntity.getId() : ""); + infoVO.setPositionName(positionEntity != null ? positionEntity.getFullName() : ""); + // 获取签名信息 + SignEntity signEntity = signService.getDefaultByUserId(userEntity.getId()); + infoVO.setSignImg(signEntity != null ? signEntity.getSignImg() : ""); + infoVO.setSignId(signEntity != null ? signEntity.getId() : ""); + + SystemInfo jsonToBean = JsonUtil.getJsonToBean(baseSystemInfo, SystemInfo.class); + jsonToBean.setYunzhupaasDomain(configValueUtil.getApiDomain()); + + // 构建菜单树 + if (StringUtil.isNotEmpty(systemCode)) { + systemList = systemList.stream().filter(t -> systemCode.equals(t.getEnCode())).collect(Collectors.toList()); + moduleList1 = moduleList1.stream().filter(t -> systemCodeEntity.getId().equals(t.getSystemId())) + .collect(Collectors.toList()); + } + List menuSelectVOS = buildModule(systemList, moduleList1, type, userEntity, infoVO, systemCode, + baseSystemInfo); + List children = new ArrayList<>(); + AllMenuSelectVO allMenuSelectVO = null; + if ("App".equals(type)) { + allMenuSelectVO = menuSelectVOS.stream().filter(t -> userEntity.getAppSystemId().equals(t.getId())) + .findFirst().orElse(null); + } else { + if (StringUtil.isNotEmpty(systemCode)) { + allMenuSelectVO = menuSelectVOS.stream().filter(t -> systemCode.equals(t.getEnCode())).findFirst() + .orElse(null); + } else { + allMenuSelectVO = menuSelectVOS.stream().filter(t -> userEntity.getSystemId().equals(t.getId())) + .findFirst().orElse(null); + } + } + if (allMenuSelectVO != null && allMenuSelectVO.getChildren() != null) { + children = allMenuSelectVO.getChildren(); + children.forEach(t -> t.setParentId("-1")); + } + if ("App".equals(type)) { + infoVO.setAppSystemId(userEntity.getAppSystemId()); + userInfo.setAppSystemId(userEntity.getAppSystemId()); + } else { + userInfo.setSystemId(userEntity.getSystemId()); + if (StringUtil.isNotEmpty(systemCode)) { + infoVO.setSystemId(systemCodeEntity.getId()); + } else { + infoVO.setSystemId(userEntity.getSystemId()); + } + } + if (BooleanUtil.toBoolean(String.valueOf((userEntity.getIsAdministrator())))) { + standingList.add(1); + } + Integer min = standingList.stream().min(Integer::compareTo).get(); + if (ADMIN_KEY.equals(userInfo.getUserAccount())) { + standingList = new ArrayList<>(); + } + // 设置身份模型 + List standingListVO = new ArrayList<>(); + standingList.forEach(t -> { + UserSystemVO standingVO = new UserSystemVO(); + standingVO.setId(t + ""); + String name = ""; + if (Objects.equals(t, 1)) { + name = MsgCode.OA025.get(); + } else if (Objects.equals(t, 2)) { + name = MsgCode.OA026.get(); + } else if (Objects.equals(t, 3)) { + name = MsgCode.OA027.get(); + } + standingVO.setName(name); + Integer stand = "Web".equals(type) ? userEntity.getStanding() : userEntity.getAppStanding(); + standingVO.setCurrentStanding( + ObjectUtil.isNotEmpty(stand) ? Objects.equals(stand, t) : Objects.equals(t, min)); + standingListVO.add(standingVO); + }); + infoVO.setStandingList(standingListVO); + + // 设置系统模型 + List jsonToList1 = new ArrayList<>(); + systemList.forEach(t -> { + UserSystemVO systemVO = new UserSystemVO(); + systemVO.setId(t.getId()); + systemVO.setName(t.getFullName()); + systemVO.setIcon(t.getIcon()); + if ("App".equals(type) && userInfo.getAppSystemId().equals(t.getId())) { + systemVO.setCurrentSystem(true); + } else if ("Web".equals(type) && userInfo.getSystemId().equals(t.getId())) { + systemVO.setCurrentSystem(true); + } + systemVO.setEnCode(t.getEnCode()); + jsonToList1.add(systemVO); + }); + infoVO.setSystemIds(jsonToList1); + userInfo.setSystemIds(systemList.stream().map(SystemBaeModel::getId).collect(Collectors.toList())); + SystemBaeModel systemBaeModel = systemList.stream().filter(t -> userInfo.getSystemId().equals(t.getId())) + .findFirst().orElse(null); + if (systemBaeModel != null + // && systemEntity.getIsMain() != null && systemEntity.getIsMain() != 1 + ) { + if (StringUtil.isNotEmpty(systemBaeModel.getNavigationIcon())) { + jsonToBean.setNavigationIcon(systemBaeModel.getNavigationIcon()); + } + } + PcUserVO userVO = new PcUserVO(children, models, infoVO, jsonToBean); + // userVO.setMenuList(menuList); + // userVO.setPermissionList(models); + userVO.getUserInfo().setHeadIcon(UploaderUtil.uploaderImg(userInfo.getUserIcon())); + // 更新userInfo对象 + if (StringUtil.isNotEmpty(userInfo.getId())) { + UserProvider.setLoginUser(userInfo); + UserProvider.setLocalLoginUser(userInfo); + } + // 门户Web + try { + String defaultPortalId = portalDataService.getCurrentDefault(PortalConst.WEB); + infoVO.setPortalId(defaultPortalId); + } catch (Exception e) { + infoVO.setPortalId(""); + e.printStackTrace(); + } + // 门户App + try { + String defaultAppPortalId = portalDataService.getCurrentDefault(PortalConst.APP); + infoVO.setAppPortalId(defaultAppPortalId); + } catch (Exception e) { + infoVO.setAppPortalId(""); + e.printStackTrace(); + } + + // 初始化接口权限 + if (securityProperties.isEnablePreAuth()) { + // 清空旧权限 + String account = userInfo.getIsAdministrator() ? ADMIN_KEY : userInfo.getUserId(); + PermissionInterfaceImpl.setAuthorityList(account, Collections.EMPTY_SET, null); + PermissionInterfaceImpl.setRoleList(account, Collections.EMPTY_SET, null); + // 如需使用远程事件, 改用publish + PublishEventUtil.publishLocalEvent( + new ProjectEventBuilder(EventConst.EVENT_INIT_LOGIN_PERMISSION, authorizeModel).setAsync(false)); + } + return userVO; + } + + @Override + public BaseSystemInfo getBaseSystemConfig(String tenantId) { + if (tenantId != null) { + TenantDataSourceUtil.switchTenant(tenantId); + } + return sysconfigApi.getSysInfo(); + } + + private List buildModule(List systemList, List moduleList, + String type, UserEntity entity, UserCommonInfoVO infoVO, String systemCode, BaseSystemInfo baseSystemInfo) { + boolean enabledFow = false; + if (configValueUtil.isMultiTenancy()) { + TenantAuthorizeModel tenantAuthorizeModel = TenantDataSourceUtil + .getCacheModuleAuthorize(UserProvider.getUser().getTenantId()); + List cacheModuleAuthorize = tenantAuthorizeModel.getModuleIdList(); + if (cacheModuleAuthorize != null) { + enabledFow = !cacheModuleAuthorize.contains("-999"); + } + } else { + enabledFow = true; + } + // 获取所有菜单树(区分Web、APP) + moduleList = moduleList.stream().filter(t -> type.equals(t.getCategory())) + .sorted(Comparator.comparing(ModuleModel::getSortCode)).collect(Collectors.toList()); + String systemId = "Web".equals(type) ? entity.getSystemId() : entity.getAppSystemId(); + int stand = "Web".equals(type) ? entity.getStanding() : entity.getAppStanding(); + boolean isAddModuleCode = true; + if (Objects.equals(stand, 2)) { + List organizeAdministratorEntity = organizeAdminTratorApi + .getOrganizeAdministratorEntity(entity.getId(), null); + List list = ImmutableList.of(PermissionConst.MODULE, PermissionConst.SYSTEM); + isAddModuleCode = organizeAdministratorEntity.stream().filter(t -> list.contains(t.getOrganizeType())) + .count() > 0; + } + List moduleCode = new ArrayList<>(YunzhupaasConst.MODULE_CODE); + if (!Objects.equals(baseSystemInfo.getFlowSign(), 1)) { + moduleCode.remove(YunzhupaasConst.WORK_FLOWSIGN); + } + if (!Objects.equals(baseSystemInfo.getFlowTodo(), 1)) { + moduleCode.remove(YunzhupaasConst.WORK_FLOWTODO); + } + if (isAddModuleCode) { + List listByEnCode = moduleApi.getListByEnCode(moduleCode); + SystemBaeModel systemBaeModel = systemList.stream().filter(t -> t.getId().equals(systemId)).findFirst() + .orElse(null); + // 当前有协同,无需切换,直接放入协同菜单 + if (systemBaeModel != null && (enabledFow && Objects.equals(systemBaeModel.getWorkflowEnabled(), 1))) { + List jsonToList = JsonUtil.getJsonToList(listByEnCode, ModuleModel.class); + jsonToList.forEach(t -> { + if ("-1".equals(t.getParentId())) { + t.setSortCode(-999L); + t.setParentId(systemId); + } + }); + moduleList.addAll(jsonToList); + infoVO.setWorkflowEnabled(1); + } else if (systemBaeModel == null || !enabledFow || (Objects.equals(systemBaeModel.getWorkflowEnabled(), 0) + && moduleList.stream().noneMatch(t -> t.getSystemId().equals(systemId)))) { + // 当前无协同,需切换,优先找开启协同的 + String currentSystemId = ""; + if (moduleList.stream().filter(t -> t.getSystemId().equals(systemId)).count() == 0) { + for (SystemBaeModel baeModel : systemList) { + if (Objects.equals(baeModel.getWorkflowEnabled(), 1)) { + currentSystemId = baeModel.getId(); + break; + } + } + if (StringUtil.isNotEmpty(currentSystemId) && enabledFow) { + List jsonToList = JsonUtil.getJsonToList(listByEnCode, ModuleModel.class); + String finalCurrentSystemId = currentSystemId; + jsonToList.forEach(t -> { + if ("-1".equals(t.getParentId())) { + t.setSortCode(-999L); + t.setParentId(finalCurrentSystemId); + } + }); + moduleList.addAll(jsonToList); + infoVO.setWorkflowEnabled(1); + } + // 都未开启协同,找有菜单的 + if (infoVO.getWorkflowEnabled() == 0 && moduleList.size() > 0) { + currentSystemId = moduleList.get(0).getSystemId(); + } + UserEntity user = new UserEntity(); + user.setId(entity.getId()); + if ("Web".equals(type)) { + entity.setSystemId(currentSystemId); + user.setSystemId(currentSystemId); + } else { + entity.setAppSystemId(currentSystemId); + user.setAppSystemId(currentSystemId); + } + if (StringUtil.isEmpty(systemCode)) { + userApi.updateById(user); + } + } + } + } + + moduleList = moduleList.stream().sorted(Comparator.comparing(ModuleModel::getSortCode)) + .collect(Collectors.toList()); + List list = JsonUtil.getJsonToList(moduleList, AllUserMenuModel.class); + list.forEach(t -> { + if ("-1".equals(t.getParentId())) { + t.setParentId(t.getSystemId()); + } + }); + List jsonToList = JsonUtil.getJsonToList(systemList, AllUserMenuModel.class); + jsonToList.forEach(t -> { + t.setType(0); + t.setParentId("-1"); + }); + list.addAll(jsonToList); + List> menuList = TreeDotUtils.convertListToTreeDotFilter(list); + List menuvo = JsonUtil.getJsonToList(menuList, AllMenuSelectVO.class); + return menuvo; + } + + /** + * 获取下属机构 + * + * @param data + * @param organizeId + * @param isAdmin + * @return + */ + private String[] getSubOrganizeIds(List data, String organizeId, boolean isAdmin) { + if (!isAdmin) { + data = JsonUtil.getJsonToList(ListToTreeUtil.treeWhere(organizeId, data), OrganizeEntity.class); + } + return data.stream().map(SuperBaseEntity.SuperIBaseEntity::getId).toArray(String[]::new); + } + + /** + * 赋值 + * + * @param userInfo + * @param userId + * @param isAdmin + */ + private void userInfo(UserInfo userInfo, String userId, boolean isAdmin, UserEntity userEntity, String systemId) { + // 得到用户和组织的关系 + List data = userRelationApi.getListByUserIdAndObjType(userId, PermissionConst.ORGANIZE); + // 组织id + String organizeId = ""; + String departmentId = ""; + List roleId = new ArrayList<>(); + // 判断当前组织是否有权限 + if (organizeRelationApi.checkBasePermission(userEntity.getId(), userEntity.getOrganizeId(), systemId) + .size() == 0) { + if (!data.isEmpty()) { + // 得到组织id + organizeId = organizeRelationApi.autoGetMajorOrganizeId(userId, + data.stream().map(UserRelationEntity::getObjectId).collect(Collectors.toList()), + userEntity.getOrganizeId(), systemId); + } + } else { + // 如果有权限 + organizeId = userEntity.getOrganizeId(); + // if (isAdmin) { + // roleId = data.stream().map(t -> + // t.getObjectId()).collect(Collectors.toList()); + // } + } + // 获取用户的角色 + List listByObjectId = userRelationApi.getListByUserId(userInfo.getUserId(), + PermissionConst.ROLE); + // 判断哪个角色是当前组织下的 + List collect = listByObjectId.stream().filter(t -> StringUtil.isNotEmpty(t.getObjectId())) + .map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + // 如果有全局的角色则先赋值给权限集合 + for (String roleIds : collect) { + // 得到角色 + RoleEntity info = roleApi.getInfo(roleIds); + if (info != null && "1".equals(String.valueOf(info.getGlobalMark()))) { + roleId.add(info.getId()); + continue; + } + // 判断哪些角色是当前组织的 + Boolean exist = organizeRelationApi.existByRoleIdAndOrgId(roleIds, organizeId); + if (exist) { + roleId.add(roleIds); + } + } + // 获取分组 + List groupRelationByUserId = userRelationApi.getListByUserId(userInfo.getUserId(), + PermissionConst.GROUP); + List groupIds = groupRelationByUserId.stream().map(UserRelationEntity::getObjectId) + .collect(Collectors.toList()); + List groupName = groupApi.getListByIds(groupIds, true); + userInfo.setGroupIds(groupName.stream().map(GroupEntity::getId).collect(Collectors.toList())); + userInfo.setGroupNames(groupName.stream().map(GroupEntity::getFullName).collect(Collectors.toList())); + // // 赋值岗位 + // List positionList = data.stream().filter(m -> + // "Position".equals(m.getObjectType())).map(t -> + // t.getObjectId()).collect(Collectors.toList()); + // Set id = new LinkedHashSet<>(); + // String[] position = StringUtil.isNotEmpty(userEntity.getPositionId()) ? + // userEntity.getPositionId().split(",") : new String[]{}; + // List positions = positionList.stream().filter(t -> + // Arrays.asList(position).contains(t)).collect(Collectors.toList()); + // id.addAll(positions); + // id.addAll(positionList); + // String[] positionId = id.toArray(new String[id.size()]); + // 部门处理 + OrganizeEntity info = organizeApi.getInfo(organizeId); + if (info != null && Objects.equals(info.getCategory(), PermissionConst.DEPARTMENT)) { + departmentId = organizeId; + } + userInfo.setOrganizeId(organizeId); + userInfo.setDepartmentId(departmentId); + userInfo.setRoleIds(roleId); + userInfo.setPositionIds(new String[] { userEntity.getPositionId() }); + // 处理userInfo + userInfo.setSystemId(userEntity.getSystemId()); + userInfo.setAppSystemId(userEntity.getAppSystemId()); + // 修改用户信息 + userEntity.setOrganizeId(organizeId); + userEntity.setPositionId( + organizeRelationApi.autoGetMajorPositionId(userId, organizeId, userEntity.getPositionId())); + userApi.updateById(userEntity); + } + + /** + * 登录信息 + * + * @param userInfo 回话信息 + * @param systemInfo 系统信息 + * @return + */ + private Map genUserInfo(UserInfo userInfo, BaseSystemInfo systemInfo) { + Map dictionary = new HashMap<>(16); + dictionary.put("userId", userInfo.getUserId()); + dictionary.put("userAccount", userInfo.getUserAccount()); + dictionary.put("userName", userInfo.getUserName()); + dictionary.put("icon", userInfo.getUserIcon()); + dictionary.put("portalId", userInfo.getPortalId()); + dictionary.put("gender", userInfo.getUserGender()); + dictionary.put("organizeId", userInfo.getOrganizeId()); + dictionary.put("prevLogin", systemInfo.getLastLoginTimeSwitch() == 1 ? 1 : 0); + dictionary.put("prevLoginTime", userInfo.getPrevLoginTime()); + dictionary.put("prevLoginIPAddress", userInfo.getPrevLoginIpAddress()); + dictionary.put("prevLoginIPAddressName", userInfo.getPrevLoginIpAddressName()); + dictionary.put("serviceDirectory", configValueUtil.getServiceDirectoryPath()); + dictionary.put("webDirectory", configValueUtil.getCodeAreasName()); + dictionary.put("isAdministrator", userInfo.getIsAdministrator()); + return dictionary; + } + +} diff --git a/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/service/impl/UserDetailsByUserAccountServiceImpl.java b/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/service/impl/UserDetailsByUserAccountServiceImpl.java new file mode 100644 index 0000000..2a98338 --- /dev/null +++ b/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/service/impl/UserDetailsByUserAccountServiceImpl.java @@ -0,0 +1,38 @@ +package com.yunzhupaas.service.impl; + +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.consts.AuthConsts; +import com.yunzhupaas.exception.LoginException; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.service.UserDetailService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 默认使用用户名获取用户信息 + */ +@Service(AuthConsts.USERDETAIL_ACCOUNT) +public class UserDetailsByUserAccountServiceImpl implements UserDetailService { + + @Autowired + private UserService userApi; + + @Override + public UserEntity loadUserEntity(UserInfo userInfo) throws LoginException { + UserEntity userEntity = userApi.getUserByAccount(userInfo.getUserAccount()); + if (userEntity == null) { + throw new LoginException(MsgCode.LOG101.get()); + } + return userEntity; + } + + + @Override + public int getOrder() { + return Integer.MAX_VALUE; + } + +} + diff --git a/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/service/impl/UserDetailsByUserIdServiceImpl.java b/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/service/impl/UserDetailsByUserIdServiceImpl.java new file mode 100644 index 0000000..f08126b --- /dev/null +++ b/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/service/impl/UserDetailsByUserIdServiceImpl.java @@ -0,0 +1,40 @@ +package com.yunzhupaas.service.impl; + +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.consts.AuthConsts; +import com.yunzhupaas.exception.LoginException; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.service.UserDetailService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +/** + * 使用用户ID获取用户信息 + */ +@Service(AuthConsts.USERDETAIL_USER_ID) +public class UserDetailsByUserIdServiceImpl implements UserDetailService { + + private static final Integer ORDER = 1; + + @Autowired + private UserService userApi; + + @Override + public UserEntity loadUserEntity(UserInfo userInfo) throws LoginException { + UserEntity userEntity = userApi.getInfo(userInfo.getUserId()); + if (userEntity == null) { + throw new LoginException(MsgCode.LOG101.get()); + } + return userEntity; + } + + @Override + public int getOrder() { + return ORDER; + } + +} + diff --git a/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/util/LoginHolder.java b/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/util/LoginHolder.java new file mode 100644 index 0000000..413ad0a --- /dev/null +++ b/yunzhupaas-oauth/yunzhupaas-oauth-biz/src/main/java/com/yunzhupaas/util/LoginHolder.java @@ -0,0 +1,28 @@ +package com.yunzhupaas.util; + +import com.yunzhupaas.permission.entity.UserEntity; + + +/** + * + * @author 云筑产品开发平台组 + * @copyright 深圳市乐程软件有限公司 + */ +public class LoginHolder { + + + private static final ThreadLocal USER_CACHE = new ThreadLocal<>(); + + public static UserEntity getUserEntity(){ + return USER_CACHE.get(); + } + + public static void setUserEntity(UserEntity userEntity){ + USER_CACHE.set(userEntity); + } + + public static void clearUserEntity(){ + USER_CACHE.remove(); + } +} + diff --git a/yunzhupaas-oauth/yunzhupaas-oauth-controller/pom.xml b/yunzhupaas-oauth/yunzhupaas-oauth-controller/pom.xml new file mode 100644 index 0000000..d5ee05a --- /dev/null +++ b/yunzhupaas-oauth/yunzhupaas-oauth-controller/pom.xml @@ -0,0 +1,22 @@ + + + + yunzhupaas-oauth + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-oauth-controller + + + + com.yunzhupaas + yunzhupaas-oauth-biz + ${project.version} + compile + + + diff --git a/yunzhupaas-oauth/yunzhupaas-oauth-controller/src/main/java/com/yunzhupaas/controller/LoginController.java b/yunzhupaas-oauth/yunzhupaas-oauth-controller/src/main/java/com/yunzhupaas/controller/LoginController.java new file mode 100644 index 0000000..1f3bd07 --- /dev/null +++ b/yunzhupaas-oauth/yunzhupaas-oauth-controller/src/main/java/com/yunzhupaas/controller/LoginController.java @@ -0,0 +1,524 @@ +package com.yunzhupaas.controller; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.text.StrPool; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.service.SysconfigService; +import com.yunzhupaas.config.YunzhupaasOauthConfig; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.consts.AuthConsts; +import com.yunzhupaas.consts.DeviceType; +import com.yunzhupaas.consts.LoginTicketStatus; +import com.yunzhupaas.consts.ScanCodeTicketStatus; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.granter.TokenGranter; +import com.yunzhupaas.granter.TokenGranterBuilder; +import com.yunzhupaas.granter.UserDetailsServiceBuilder; +import com.yunzhupaas.model.*; +import com.yunzhupaas.model.login.MeInfoVO; +import com.yunzhupaas.model.login.UserSystemVO; +import com.yunzhupaas.model.logout.LogoutResultModel; +import com.yunzhupaas.permission.controller.SocialsUserController; +import com.yunzhupaas.permission.model.socails.SocialsUserVo; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.service.AuthService; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.service.LogService; +import com.yunzhupaas.util.NoDataSourceBind; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.model.login.PcUserVO; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.exception.LoginException; +import com.yunzhupaas.service.LoginService; +import com.yunzhupaas.util.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +import static com.yunzhupaas.consts.AuthConsts.PARAMS_YUNZHUPAAS_TICKET; + +/** + * 登录控制器 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +@Tag(name = "登陆数据", description = "oauth") +@Slf4j +@RestController +@RequestMapping("/api/oauth") +public class LoginController { + + @Autowired + private UserService userApi; + @Autowired + private LoginService loginService; + @Autowired + private AuthService authService; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private YunzhupaasOauthConfig oauthConfig; + @Autowired + private SysconfigService sysConfigApi; + @Autowired + private RedisUtil redisUtil; + @Autowired + private TokenGranterBuilder tokenGranterBuilder; + @Autowired + private SocialsUserController socialsUserApi; + @Autowired + private UserDetailsServiceBuilder userDetailsServiceBuilder; + @Autowired + private LogService logApi; + + /** + * 登陆 + * + * @param parameters 登录参数 + * @return + * @throws LoginException 登录异常 + */ + @NoDataSourceBind + @Operation(summary = "登陆") + @Parameters({ + @Parameter(name = "parameters", description = "登录参数", required = true) + }) + @RequestMapping(value = "/Login/**", method = { RequestMethod.GET, RequestMethod.POST }) + public ActionResult login(@RequestParam Map parameters) throws LoginException { + return authService.login(parameters); + } + + /** + * 验证密码 + * + * @param loginForm 登录模型 + * @return + * @throws LoginException 登录异常 + */ + @Operation(summary = "锁屏解锁登录") + @Parameters({ + @Parameter(name = "loginForm", description = "登录模型", required = true) + }) + @PostMapping("/LockScreen") + public ActionResult lockScreen(@RequestBody LoginForm loginForm) throws LoginException { + UserEntity userEntity = userApi.getUserByAccount(loginForm.getAccount()); + if (userEntity == null) { + UserInfo userInfo = UserProvider.getUser(); + if (userInfo.getUserId() != null) { + UserProvider.logoutByUserId(userInfo.getUserId()); + } + throw new LoginException(MsgCode.FA001.get()); + } + if (!Md5Util.getStringMd5(loginForm.getPassword().toLowerCase() + userEntity.getSecretkey().toLowerCase()) + .equals(userEntity.getPassword())) { + throw new LoginException(MsgCode.OA020.get()); + } + return ActionResult.success(MsgCode.SU005.get()); + } + + /** + * 登录注销 + * + * @param grandtype 登录类型 + * @return + */ + @NoDataSourceBind + @Operation(summary = "退出") + @Parameters({ + @Parameter(name = "grandtype", description = "登录类型", required = true) + }) + @RequestMapping(value = { "/Logout", "/Logout/{grandtype}" }, method = { RequestMethod.GET, RequestMethod.POST }) + public ActionResult logout( + @PathVariable(value = "grandtype", required = false) String grandtype) { + long millis = System.currentTimeMillis(); + TokenGranter tokenGranter = tokenGranterBuilder.getGranterByLogin(grandtype); + if (tokenGranter != null) { + UserInfo userInfo = UserProvider.getUser(); + logApi.writeLogAsync(userInfo.getUserId(), userInfo.getUserName() + "/" + userInfo.getUserAccount(), "退出登录", + userInfo, 1, 1, (System.currentTimeMillis() - millis)); + return tokenGranter.logout(); + } + return ActionResult.success(); + } + + /** + * 踢出指定用户, 推送Websocket用户被强制下线 + * + * @param tokens token集合 + * @param userId 租户id + * @param tenantId 租户id + */ + @NoDataSourceBind + @Operation(summary = "踢出指定用户") + @Parameters({ + @Parameter(name = "tokens", description = "token集合"), + @Parameter(name = "userId", description = "租户id"), + @Parameter(name = "tenantId", description = "租户id"), + }) + @PostMapping(value = { "/KickoutToken" }) + public void kickoutByToken(@RequestParam(value = "tokens", required = false) String[] tokens, + @RequestParam(name = "userId", required = false) String userId, + @RequestParam(name = "tenantId", required = false) String tenantId) { + if (StringUtil.isNotEmpty(tokens)) { + authService.kickoutByToken(tokens); + } else { + authService.kickoutByUserId(userId, tenantId); + } + } + + /** + * 获取用户登录信息 + * + * @param type Web/App + * @return + * @throws LoginException 登录异常 + */ + @Operation(summary = "获取用户登录信息") + @Parameters({ + @Parameter(name = "type", description = "Web/App") + }) + @GetMapping("/CurrentUser") + public ActionResult currentUser(String type, String systemCode) throws LoginException { + if (StringUtil.isEmpty(type)) { + type = "Web"; + } else { + type = "App"; + } + UserInfo userInfo = UserProvider.getUser(); + if (DeviceType.TEMPUSERLIMITED.getDevice().equals(userInfo.getLoginDevice())) { + throw new LoginException(MsgCode.OA022.get()); + } + PcUserVO pcUserVO = loginService.getCurrentUser(type, systemCode); + if (pcUserVO == null) { + throw new LoginException(MsgCode.LOG001.get()); + } + if (pcUserVO.getMenuList().isEmpty() && StringUtil.isEmpty(systemCode)) { + List standingList = pcUserVO.getUserInfo().getStandingList(); + for (int i = standingList.size() - 1; i >= 0; i--) { + UserSystemVO systemVO = standingList.get(i); + if (!systemVO.isCurrentStanding()) { + UserEntity user = new UserEntity(); + user.setId(userInfo.getUserId()); + if ("Web".equals(type)) { + user.setStanding(Integer.parseInt(systemVO.getId())); + } else { + user.setAppStanding(Integer.parseInt(systemVO.getId())); + } + boolean update = userApi.updateById(user); + if (update) { + pcUserVO = loginService.getCurrentUser(type, systemCode); + } + if (!pcUserVO.getMenuList().isEmpty()) + break; + } + } + } + if (pcUserVO.getMenuList().isEmpty()) { + UserProvider.logout(); + } + return ActionResult.success(pcUserVO); + } + + /** + * 修改密码信息发送 + * + */ + @Operation(summary = "修改密码信息发送") + @PostMapping("/updatePasswordMessage") + public ActionResult updatePasswordMessage() { + loginService.updatePasswordMessage(); + return ActionResult.success(); + } + + /** + * 图形验证码 + * + * @param codeLength 验证码长度 + * @param timestamp 验证码标识 + */ + @NoDataSourceBind() + @Operation(summary = "图形验证码") + @Parameters({ + @Parameter(name = "codeLength", description = "验证码长度", required = true), + @Parameter(name = "timestamp", description = "验证码标识", required = true) + }) + @GetMapping("/ImageCode/{codeLength}/{timestamp}") + public void imageCode(@PathVariable("codeLength") Integer codeLength, @PathVariable("timestamp") String timestamp) { + DownUtil.downCode(codeLength); + redisUtil.insert(timestamp, ServletUtil.getSession().getAttribute(CodeUtil.RANDOMCODEKEY), 300); + } + + /** + * 注销用户 + * + * @return + */ + @Operation(summary = "注销用户") + @PostMapping("/logoutCurrentUser") + public ActionResult logoutCurrentUser() { + UserInfo userInfo = UserProvider.getUser(); + if (userInfo.getIsAdministrator() != null && UserProvider.getUser().getIsAdministrator()) { + return ActionResult.fail(MsgCode.OA023.get()); + } + if (userInfo.getIsAdministrator() != null) { + if (!userInfo.getIsAdministrator()) { + userApi.delete(userApi.getInfo(userInfo.getUserId())); + UserProvider.kickoutByUserId(userInfo.getUserId(), userInfo.getTenantId()); + } + } + return ActionResult.success(MsgCode.SU005.get()); + } + + /** + * 判断是否需要验证码 + * + * @param account 账号 + */ + @NoDataSourceBind() + @Operation(summary = "判断是否需要验证码") + @Parameters({ + @Parameter(name = "account", description = "账号", required = true) + }) + @GetMapping("/getConfig/{account}") + public ActionResult check(@PathVariable("account") String account) throws LoginException { + LoginModel loginModel = new LoginModel(); + if (configValueUtil.isMultiTenancy()) { + LoginForm loginForm = new LoginForm(); + loginForm.setAccount(account); + UserInfo userInfo = new UserInfo(); + userInfo.setUserAccount(loginForm.getAccount()); + userInfo = loginService.getTenantAccount(userInfo); + } + // 获取配置 + BaseSystemInfo sysConfigInfo = sysConfigApi.getSysInfo(); + // 是否开启验证码 + if (Objects.nonNull(sysConfigInfo) && "1".equals(String.valueOf(sysConfigInfo.getEnableVerificationCode()))) { + loginModel.setEnableVerificationCode(1); + Integer verificationCodeNumber = sysConfigInfo.getVerificationCodeNumber(); + loginModel.setVerificationCodeNumber(verificationCodeNumber == null ? 4 : verificationCodeNumber); + return ActionResult.success(loginModel); + } + loginModel.setEnableVerificationCode(0); + return ActionResult.success(loginModel); + } + + /** + * 获取登录配置, 是否需要跳转、第三方登录信息 + * + * @return {re} + * @throws LoginException 登录异常 + */ + @NoDataSourceBind() + @Operation(summary = "获取登录配置") + @GetMapping("/getLoginConfig") + public ActionResult getLoginConfig() { + LoginConfigModel loginConfigModel = new LoginConfigModel(); + if (oauthConfig.getSsoEnabled()) { + String url = oauthConfig.getLoginPath() + StrPool.SLASH + oauthConfig.getDefaultSSO(); + loginConfigModel.setRedirect(true); + loginConfigModel.setUrl(url); + loginConfigModel.setTicketParams(PARAMS_YUNZHUPAAS_TICKET); + } else { + // 追加第三方登录配置 + List loginList = socialsUserApi.getLoginList(PARAMS_YUNZHUPAAS_TICKET.toUpperCase()); + if (CollectionUtil.isNotEmpty(loginList)) { + loginConfigModel.setSocialsList(loginList); + loginConfigModel.setRedirect(false); + loginConfigModel.setTicketParams(PARAMS_YUNZHUPAAS_TICKET); + } + } + return ActionResult.success(loginConfigModel); + } + + /** + * 获取登录票据 + * + * @return {msg:有效期, data:票据} + */ + @NoDataSourceBind() + @Operation(summary = "获取登录票据") + @GetMapping("/getTicket") + public ActionResult getTicket() { + LoginTicketModel ticketModel = new LoginTicketModel(); + ticketModel.setTicketTimeout(System.currentTimeMillis() + oauthConfig.getTicketTimeout() * 1000); + String ticket = TicketUtil.createTicket(ticketModel, oauthConfig.getTicketTimeout()); + return ActionResult.success(ticketModel.getTicketTimeout().toString(), ticket); + } + + /** + * 检测票据登录状态 + * + * @return {re} + * @throws LoginException + */ + @NoDataSourceBind() + @Operation(summary = "获取登录状态") + @GetMapping("/getTicketStatus/{ticket}") + public ActionResult getTicketStatus(@PathVariable("ticket") String ticket) { + LoginTicketModel ticketModel = TicketUtil.parseTicket(ticket); + if (ticketModel == null) { + ticketModel = new LoginTicketModel().setStatus(LoginTicketStatus.Invalid.getStatus()).setValue("票据失效!"); + } else { + if (ticketModel.getStatus() != LoginTicketStatus.UnLogin.getStatus() + && ticketModel.getStatus() != LoginTicketStatus.UnBind.getStatus()) { + TicketUtil.deleteTicket(ticket); + } + } + return ActionResult.success(ticketModel); + } + + /** + * 官网重置密码专用 + * + * @return + */ + @NoDataSourceBind() + @Operation(summary = "官网重置密码专用") + @GetMapping("/resetOfficialPassword/{mobile}/{code}") + public ActionResult resetOfficialPassword(@PathVariable("mobile") String mobile, @PathVariable("code") String code) + throws LoginException { + // 校验验证码 + TenantDataSourceUtil.checkOfficialSmsCode(mobile, code, 2); + // 切换租户 + LoginForm loginForm = new LoginForm(); + loginForm.setAccount(mobile); + UserInfo userInfo = new UserInfo(); + userInfo.setUserAccount(loginForm.getAccount()); + try { + userInfo = loginService.getTenantAccount(userInfo); + } catch (Exception e) { + return ActionResult.fail(MsgCode.LOG105.get()); + } + + // 重置密码 123456 + UserEntity userEntity = userDetailsServiceBuilder.getUserDetailService(AuthConsts.USERDETAIL_ACCOUNT) + .loadUserEntity(userInfo); + userEntity.setPassword("e10adc3949ba59abbe56e057f20f883e"); + userEntity.setPassword( + Md5Util.getStringMd5(userEntity.getPassword().toLowerCase() + userEntity.getSecretkey().toLowerCase())); + boolean result = userApi.updateById(userEntity); + if (result) { + return ActionResult.success(MsgCode.LOG205.get()); + } else { + return ActionResult.fail(MsgCode.LOG206.get()); + } + } + + /** + * 生成扫码凭证 + * + * @return + */ + @NoDataSourceBind() + @Operation(summary = "生成扫码凭证") + @GetMapping("/codeCertificate") + public ActionResult codeCertificate() throws LoginException { + ScanCodeLoginConfigModel ticketModel = new ScanCodeLoginConfigModel(); + ticketModel.setTicketTimeout(System.currentTimeMillis() + configValueUtil.getCodeCertificateTimeout() * 1000); + String ticket = TicketUtil.createTicket(ticketModel, configValueUtil.getCodeCertificateTimeout()); + return ActionResult.success(ticketModel.getTicketTimeout().toString(), ticket); + } + + /** + * 获取扫码凭证状态 + * + * @param ticket + * @return + * @throws LoginException + */ + @NoDataSourceBind() + @Operation(summary = "获取扫码凭证状态") + @GetMapping("/codeCertificateStatus/{ticket}") + public ActionResult codeCertificateStatus(@PathVariable("ticket") String ticket) throws LoginException { + ScanCodeLoginConfigModel ticketModel = TicketUtil.parseTicket(ticket); + if (ticketModel == null) { + ticketModel = new ScanCodeLoginConfigModel(); + ticketModel.setStatus(ScanCodeTicketStatus.Invalid.getStatus()); + } + return ActionResult.success(ticketModel); + } + + /** + * 确认登录 + * + * @param ticket + * @return + * @throws LoginException + */ + @NoDataSourceBind() + @Operation(summary = "确认登录") + @GetMapping("/confirmLogin/{ticket}") + public ActionResult confirmLogin(@PathVariable("ticket") String ticket) throws LoginException { + ScanCodeLoginConfigModel ticketModel = TicketUtil.parseTicket(ticket); + if (ticketModel == null || !Objects.equals(ticketModel.getStatus(), 1)) { + ticketModel = new ScanCodeLoginConfigModel(); + ticketModel.setStatus(ScanCodeTicketStatus.Invalid.getStatus()); + return ActionResult.success(ticketModel); + } + ticketModel.setStatus(ScanCodeTicketStatus.Success.getStatus()); + Map parameters = new HashMap<>(); + parameters.put("grant_type", "scancode"); + parameters.put("token", UserProvider.getToken()); + ticketModel.setValue(authService.login(parameters).getData().getToken()); + TicketUtil.updateTicket(ticket, ticketModel, null); + return ActionResult.success(ticketModel); + } + + /** + * 更改扫码凭证状态 + * + * @param ticket + * @return + * @throws LoginException + */ + @NoDataSourceBind() + @Operation(summary = "更改扫码凭证状态") + @GetMapping("/setCodeCertificateStatus/{ticket}/{status}") + public ActionResult setCodeCertificateStatus(@PathVariable("ticket") String ticket, + @PathVariable("status") Integer status) throws LoginException { + ScanCodeLoginConfigModel ticketModel = TicketUtil.parseTicket(ticket); + if (ticketModel == null) { + ticketModel = new ScanCodeLoginConfigModel(); + ticketModel.setStatus(ScanCodeTicketStatus.Invalid.getStatus()); + } else { + ticketModel.setStatus(status); + } + ticketModel.setTicketTimeout(System.currentTimeMillis() + configValueUtil.getCodeCertificateTimeout() * 1000); + TicketUtil.updateTicket(ticket, ticketModel, configValueUtil.getCodeCertificateTimeout()); + return ActionResult.success(ticketModel); + } + + /** + * 获取用户登录信息 + * + * @return + * @throws LoginException 登录异常 + */ + @Operation(summary = "获取用户基本信息") + @GetMapping("/me") + public ActionResult me() throws LoginException { + UserInfo userInfo = UserProvider.getUser(); + MeInfoVO meInfoVO = new MeInfoVO() + .setUserName(userInfo.getUserName()) + .setUserId(userInfo.getUserId()) + .setUserAccount(userInfo.getUserAccount()) + .setTenantId(userInfo.getTenantId()); + return ActionResult.success(meInfoVO); + } + + public static void main(String[] args) { + System.out.println(Md5Util.getStringMd5("123456" + "26916bdf390242c9b0ac7ec1442a329e".toLowerCase())); + } +} diff --git a/yunzhupaas-oauth/yunzhupaas-oauth-entity/pom.xml b/yunzhupaas-oauth/yunzhupaas-oauth-entity/pom.xml new file mode 100644 index 0000000..49f5519 --- /dev/null +++ b/yunzhupaas-oauth/yunzhupaas-oauth-entity/pom.xml @@ -0,0 +1,32 @@ + + + + yunzhupaas-oauth + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-oauth-entity + + + + com.yunzhupaas + yunzhupaas-common-all + ${project.version} + compile + + + com.yunzhupaas + yunzhupaas-system-entity + ${project.version} + + + com.yunzhupaas + yunzhupaas-permission-entity + ${project.version} + + + diff --git a/yunzhupaas-oauth/yunzhupaas-oauth-entity/src/main/java/com/yunzhupaas/entity/TenantEntity.java b/yunzhupaas-oauth/yunzhupaas-oauth-entity/src/main/java/com/yunzhupaas/entity/TenantEntity.java new file mode 100644 index 0000000..82fb179 --- /dev/null +++ b/yunzhupaas-oauth/yunzhupaas-oauth-entity/src/main/java/com/yunzhupaas/entity/TenantEntity.java @@ -0,0 +1,52 @@ +package com.yunzhupaas; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * + * baseTenant + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2020-12-17 16:09:07 + */ +@Data +@TableName("base_tenant") +public class TenantEntity extends SuperExtendEntity.SuperExtendDEEntity { + + @TableField("f_en_code") + private String enCode; + + @TableField("f_full_name") + private String fullName; + + @TableField("f_company_name") + private String comPanyName; + + @TableField("f_expires_time") + private Date expiresTime; + + @TableField("f_db_name") + private String dbName; + + @TableField("f_ip_address") + private String ipAddress; + + @TableField("f_ip_address_name") + private String ipAddressName; + + @TableField("f_source_website") + private String sourceWebsite; + + /** + * 数据模式 + */ + @TableField("f_data_schema") + private Integer dataSchema; +} + diff --git a/yunzhupaas-oauth/yunzhupaas-oauth-entity/src/main/java/com/yunzhupaas/entity/TenantlogEntity.java b/yunzhupaas-oauth/yunzhupaas-oauth-entity/src/main/java/com/yunzhupaas/entity/TenantlogEntity.java new file mode 100644 index 0000000..1b1099f --- /dev/null +++ b/yunzhupaas-oauth/yunzhupaas-oauth-entity/src/main/java/com/yunzhupaas/entity/TenantlogEntity.java @@ -0,0 +1,83 @@ +package com.yunzhupaas.entity; + +import com.alibaba.fastjson.annotation.JSONField; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * 租户日志 + * + * @author 云筑产品开发平台组 + * @version v5.2.7 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Data +@TableName("base_tenantlog") +public class TenantlogEntity { + + /** + * 自然主键 + */ + @TableId("F_ID") + @JSONField(name = "F_Id") + private String fId; + + /** + * 租户主键 + */ + @TableField("F_TENANTID") + @JSONField(name = "F_TenantId") + private String fTenantid; + + /** + * 登录账户 + */ + @TableField("F_LOGINACCOUNT") + @JSONField(name = "F_LoginAccount") + private String fLoginaccount; + + /** + * IP地址 + */ + @TableField("F_LOGINIPADDRESS") + @JSONField(name = "F_LoginIPAddress") + private String fLoginipaddress; + + /** + * IP所在城市 + */ + @TableField("F_LOGINIPADDRESSNAME") + @JSONField(name = "F_LoginIPAddressName") + private String fLoginipaddressname; + + /** + * 来源网站 + */ + @TableField("F_LOGINSOURCEWEBSITE") + @JSONField(name = "F_LoginSourceWebsite") + private String fLoginsourcewebsite; + /** + * 登录时间 + */ + @TableField("F_LOGINTIME") + @JSONField(name = "F_LoginTime") + private String fLogintime; + + /** + * 描述 + */ + @TableField("F_DESCRIPTION") + @JSONField(name = "F_Description") + private String fDescription; + + /** + * 租户id + */ + @TableField("F_TENANTID") + private String tenantId; + +} + diff --git a/yunzhupaas-oauth/yunzhupaas-oauth-entity/src/main/java/com/yunzhupaas/model/BuildUserCommonInfoModel.java b/yunzhupaas-oauth/yunzhupaas-oauth-entity/src/main/java/com/yunzhupaas/model/BuildUserCommonInfoModel.java new file mode 100644 index 0000000..bd196b4 --- /dev/null +++ b/yunzhupaas-oauth/yunzhupaas-oauth-entity/src/main/java/com/yunzhupaas/model/BuildUserCommonInfoModel.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.model; + +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.SystemEntity; +import com.yunzhupaas.permission.entity.UserEntity; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class BuildUserCommonInfoModel implements Serializable { + + private UserInfo userInfo; + private SystemEntity mainSystemEntity; + private SystemEntity workSystemEntity; + private UserEntity userEntity; + private BaseSystemInfo baseSystemInfo; + private String systemId; + private String type; + +} + diff --git a/yunzhupaas-oauth/yunzhupaas-oauth-entity/src/main/java/com/yunzhupaas/model/LoginConfigModel.java b/yunzhupaas-oauth/yunzhupaas-oauth-entity/src/main/java/com/yunzhupaas/model/LoginConfigModel.java new file mode 100644 index 0000000..985332b --- /dev/null +++ b/yunzhupaas-oauth/yunzhupaas-oauth-entity/src/main/java/com/yunzhupaas/model/LoginConfigModel.java @@ -0,0 +1,46 @@ +package com.yunzhupaas.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + + +/** + * + * 通用登录配置 + * 是否跳转 + * 第三方登录配置 + * @author 云筑产品开发平台组 + * @copyright 深圳市乐程软件有限公司 + */ +@Data +public class LoginConfigModel { + + /** + * 是否跳转 + */ + @Schema(description = "是否跳转") + private boolean redirect = false; + + /** + * 跳转URL地址 + */ + @Schema(description = "跳转URL地址") + private String url; + + /** + * 跳转登录轮询票据参数名称 + */ + @Schema(description = "跳转登录轮询票据") + private String ticketParams; + + + /** + * 第三方登录列表 + */ + @Schema(description = "第三方登录列表") + List socialsList; + +} + diff --git a/yunzhupaas-oauth/yunzhupaas-oauth-entity/src/main/java/com/yunzhupaas/model/LoginModel.java b/yunzhupaas-oauth/yunzhupaas-oauth-entity/src/main/java/com/yunzhupaas/model/LoginModel.java new file mode 100644 index 0000000..acc4608 --- /dev/null +++ b/yunzhupaas-oauth/yunzhupaas-oauth-entity/src/main/java/com/yunzhupaas/model/LoginModel.java @@ -0,0 +1,44 @@ +package com.yunzhupaas.model; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 登陆判断是否需要验证码 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-12-31 + */ +@Data +public class LoginModel implements Serializable { + + /** + * 是否开启验证码 + */ + private Integer enableVerificationCode; + + /** + * 验证码位数 + */ + private Integer verificationCodeNumber; + + public Integer getEnableVerificationCode() { + return enableVerificationCode; + } + + public void setEnableVerificationCode(Integer enableVerificationCode) { + this.enableVerificationCode = enableVerificationCode; + } + + public Integer getVerificationCodeNumber() { + return verificationCodeNumber; + } + + public void setVerificationCodeNumber(Integer verificationCodeNumber) { + this.verificationCodeNumber = verificationCodeNumber; + } +} + diff --git a/yunzhupaas-oauth/yunzhupaas-oauth-entity/src/main/java/com/yunzhupaas/model/LoginVO.java b/yunzhupaas-oauth/yunzhupaas-oauth-entity/src/main/java/com/yunzhupaas/model/LoginVO.java new file mode 100644 index 0000000..2b98ccb --- /dev/null +++ b/yunzhupaas-oauth/yunzhupaas-oauth-entity/src/main/java/com/yunzhupaas/model/LoginVO.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Map; + +@Data +//@Builder +public class LoginVO { + @Schema(description = "token") + private String token; + @Schema(description = "主题") + private String theme; + + /** + * 卫翎信息 官网专用 + */ + private Map wl_qrcode; +} + diff --git a/yunzhupaas-oauth/yunzhupaas-oauth-entity/src/main/java/com/yunzhupaas/model/SocialUnbindModel.java b/yunzhupaas-oauth/yunzhupaas-oauth-entity/src/main/java/com/yunzhupaas/model/SocialUnbindModel.java new file mode 100644 index 0000000..3feb85f --- /dev/null +++ b/yunzhupaas-oauth/yunzhupaas-oauth-entity/src/main/java/com/yunzhupaas/model/SocialUnbindModel.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.model; + +import lombok.AllArgsConstructor; +import lombok.Data; + +/** + * 第三方未绑定模型 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/9/19 15:06:31 + */ +@Data +@AllArgsConstructor +public class SocialUnbindModel { + String socialType; + String socialUnionid; + String socialName; +} + diff --git a/yunzhupaas-oauth/yunzhupaas-oauth-entity/src/main/java/com/yunzhupaas/model/UserLogForm.java b/yunzhupaas-oauth/yunzhupaas-oauth-entity/src/main/java/com/yunzhupaas/model/UserLogForm.java new file mode 100644 index 0000000..3732d93 --- /dev/null +++ b/yunzhupaas-oauth/yunzhupaas-oauth-entity/src/main/java/com/yunzhupaas/model/UserLogForm.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class UserLogForm extends Pagination implements Serializable { + @Schema(description = "开始时间") + private String startTime; + @Schema(description = "结束时间") + private String endTime; + @Schema(description = "分类") + private int category; + @Schema(description = "是否登录成功标志") + private Integer loginMark; + @Schema(description = "登录类型") + private Integer loginType; +} + diff --git a/yunzhupaas-pcm/pom.xml b/yunzhupaas-pcm/pom.xml new file mode 100644 index 0000000..03f0706 --- /dev/null +++ b/yunzhupaas-pcm/pom.xml @@ -0,0 +1,50 @@ + + + + yunzhupaas-java-boot + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-pcm + pom + + yunzhupaas-pcm-entity + yunzhupaas-pcm-biz + yunzhupaas-pcm-controller + + + + + org.apache.poi + poi + 4.1.2 + + + org.apache.xmlbeans + xmlbeans + 3.1.0 + + + + org.apache.poi + poi-ooxml + 4.1.2 + + + org.apache.poi + poi-ooxml-schemas + 4.1.2 + + + + org.apache.poi + poi-scratchpad + 4.1.2 + + + + diff --git a/yunzhupaas-pcm/yunzhupaas-pcm-biz/pom.xml b/yunzhupaas-pcm/yunzhupaas-pcm-biz/pom.xml new file mode 100644 index 0000000..e566099 --- /dev/null +++ b/yunzhupaas-pcm/yunzhupaas-pcm-biz/pom.xml @@ -0,0 +1,31 @@ + + + + yunzhupaas-pcm + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-pcm-biz + + + + com.yunzhupaas + yunzhupaas-pcm-entity + ${project.version} + + + + + com.yunzhupaas + yunzhupaas-generater-base + 5.2.0-RELEASE + + + + + + diff --git a/yunzhupaas-pcm/yunzhupaas-pcm-controller/pom.xml b/yunzhupaas-pcm/yunzhupaas-pcm-controller/pom.xml new file mode 100644 index 0000000..bbdc54d --- /dev/null +++ b/yunzhupaas-pcm/yunzhupaas-pcm-controller/pom.xml @@ -0,0 +1,23 @@ + + + + yunzhupaas-pcm + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-pcm-controller + + + + com.yunzhupaas + yunzhupaas-pcm-biz + ${project.version} + + + + + diff --git a/yunzhupaas-pcm/yunzhupaas-pcm-entity/pom.xml b/yunzhupaas-pcm/yunzhupaas-pcm-entity/pom.xml new file mode 100644 index 0000000..7d55402 --- /dev/null +++ b/yunzhupaas-pcm/yunzhupaas-pcm-entity/pom.xml @@ -0,0 +1,22 @@ + + + + yunzhupaas-pcm + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-pcm-entity + + + + com.yunzhupaas + yunzhupaas-common-all + ${project.version} + + + + diff --git a/yunzhupaas-permission/pom.xml b/yunzhupaas-permission/pom.xml new file mode 100644 index 0000000..c070e29 --- /dev/null +++ b/yunzhupaas-permission/pom.xml @@ -0,0 +1,21 @@ + + + + yunzhupaas-java-boot + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-permission + pom + + yunzhupaas-permission-entity + yunzhupaas-permission-biz + yunzhupaas-permission-controller + + + + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/pom.xml b/yunzhupaas-permission/yunzhupaas-permission-biz/pom.xml new file mode 100644 index 0000000..657579b --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/pom.xml @@ -0,0 +1,51 @@ + + + + yunzhupaas-permission + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-permission-biz + + + + com.yunzhupaas + yunzhupaas-provider + ${project.version} + + + + me.zhyd.oauth + JustAuth + + + com.yunzhupaas + yunzhupaas-common-connector + + + cn.afterturn + easypoi-base + + + validation-api + javax.validation + + + + + com.yunzhupaas + yunzhupaas-oauth-api + ${project.version} + + + com.yunzhupaas + yunzhupaas-system-biz + ${project.version} + + + + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/constant/AuthorizeConst.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/constant/AuthorizeConst.java new file mode 100644 index 0000000..620307d --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/constant/AuthorizeConst.java @@ -0,0 +1,66 @@ +package com.yunzhupaas.permission.constant; + +/** + * 类功能 + * + * @author 云筑产品开发平台组 + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/2/14 + */ +public class AuthorizeConst { + + public final static String USER = "User"; + /** + * 岗位 权限标识 + */ + public final static String POSITION = "Position"; + /** + * 角色 权限标识 + */ + public final static String ROLE = "Role"; + /** + * 按钮 权限标识 + */ + public final static String BUTTON = "button"; + /** + * 菜单 权限标识 + */ + public final static String MODULE = "module"; + /** + * 列表 权限标识 + */ + public final static String COLUMN = "column"; + /** + * 数据 权限标识 + */ + public final static String RESOURCE = "resource"; + /** + * 表单 权限标识 + */ + public final static String FROM = "form"; + /** + * 系统、子系统 + */ + public final static String SYSTEM = "system"; + /** + * 数据 权限标识 + */ + public final static String AUTHORIZE_PORTAL_MANAGE = "portalManage"; + /** + * 流程 权限标识 + */ + public final static String FLOW = "flow"; + /** + * 打印 权限标识 + */ + public final static String PRINT = "print"; + /** + * + * 权限标识集合 + */ + public final static String[] TYPES = {USER, POSITION, ROLE, BUTTON, MODULE, COLUMN, RESOURCE, FROM}; + + public final static String DATE_PICKER = "datePicker"; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/AuthorizeMapper.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/AuthorizeMapper.java new file mode 100644 index 0000000..6ac4b62 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/AuthorizeMapper.java @@ -0,0 +1,47 @@ +package com.yunzhupaas.permission.mapper; + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.base.model.base.SystemBaeModel; +import com.yunzhupaas.base.model.form.ModuleFormModel; +import com.yunzhupaas.permission.entity.AuthorizeEntity; +import com.yunzhupaas.base.model.button.ButtonModel; +import com.yunzhupaas.base.model.column.ColumnModel; +import com.yunzhupaas.base.model.module.ModuleModel; +import com.yunzhupaas.base.model.resource.ResourceModel; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:27 + */ +public interface AuthorizeMapper extends SuperMapper { + + + List findModule(@Param("objectId") List objectId, @Param("systemId") List systemId, @Param("moduleAuthorize") List moduleAuthorize, @Param("moduleUrlAddressAuthorize") List moduleUrlAddressAuthorize, @Param("mark") Integer mark,@Param("moduleCode") List moduleCode); + + List findButton(@Param("objectId") List objectId); + + List findColumn(@Param("objectId") List objectId); + + List findResource(@Param("objectId") List objectId); + + List findForms(@Param("objectId") List objectId); + + List findSystem(@Param("objectId") List objectId, @Param("enCode") String enCode, @Param("moduleAuthorize") List moduleAuthorize, @Param("mark") Integer mark); + + List findButtonAdmin(@Param("mark") Integer mark); + + List findColumnAdmin(@Param("mark") Integer mark); + + List findResourceAdmin(@Param("mark") Integer mark); + + List findFormsAdmin(@Param("mark") Integer mark); + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/ColumnsPurviewMapper.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/ColumnsPurviewMapper.java new file mode 100644 index 0000000..d985949 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/ColumnsPurviewMapper.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.permission.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.permission.entity.ColumnsPurviewEntity; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/3/15 9:41 + */ +public interface ColumnsPurviewMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/GroupMapper.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/GroupMapper.java new file mode 100644 index 0000000..42f434a --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/GroupMapper.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.permission.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.permission.entity.GroupEntity; + +/** + * 分组管理Mapper + * + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/3/10 17:56 + */ +public interface GroupMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/OrganizeAdminIsTratorMapper.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/OrganizeAdminIsTratorMapper.java new file mode 100644 index 0000000..21d0928 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/OrganizeAdminIsTratorMapper.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.permission.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.permission.entity.OrganizeAdministratorEntity; + +/** + * + * 机构分级管理员 + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public interface OrganizeAdminIsTratorMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/OrganizeMapper.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/OrganizeMapper.java new file mode 100644 index 0000000..72942c7 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/OrganizeMapper.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.permission.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.permission.entity.OrganizeEntity; + + +/** + * 组织机构 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public interface OrganizeMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/OrganizeRelationMapper.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/OrganizeRelationMapper.java new file mode 100644 index 0000000..deea9d6 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/OrganizeRelationMapper.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.permission.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.permission.entity.OrganizeRelationEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 组织关系 Mapper 接口 + *

+ * + * @author + * @since 2022-01-19 + */ +public interface OrganizeRelationMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/PermissionGroupMapper.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/PermissionGroupMapper.java new file mode 100644 index 0000000..617f315 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/PermissionGroupMapper.java @@ -0,0 +1,8 @@ +package com.yunzhupaas.permission.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.permission.entity.PermissionGroupEntity; + +public interface PermissionGroupMapper extends SuperMapper { +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/PositionMapper.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/PositionMapper.java new file mode 100644 index 0000000..46689a9 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/PositionMapper.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.permission.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.permission.entity.PositionEntity; + +/** + * 岗位信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public interface PositionMapper extends SuperMapper { +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/RoleMapper.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/RoleMapper.java new file mode 100644 index 0000000..cb3cd90 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/RoleMapper.java @@ -0,0 +1,37 @@ +package com.yunzhupaas.permission.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.permission.entity.RoleEntity; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 系统角色 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public interface RoleMapper extends SuperMapper { + + /** + * 通过组织id获取用户信息 + * + * @param orgIdList + * @return + */ + List query(@Param("orgIdList") List orgIdList, @Param("keyword") String keyword, @Param("globalMark") Integer globalMark, @Param("enabledMark") Integer enabledMark); + + /** + * 通过组织id获取用户信息 + * + * @param + * @param orgIdList + * @return + */ + Long count(@Param("orgIdList") List orgIdList, @Param("keyword") String keyword, @Param("globalMark") Integer globalMark, @Param("enabledMark") Integer enabledMark); + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/SocialsUserMapper.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/SocialsUserMapper.java new file mode 100644 index 0000000..bc44219 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/SocialsUserMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.permission.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.permission.entity.SocialsUserEntity; + +/** + * 流程设计 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/7/14 9:49:19 + */ +public interface SocialsUserMapper extends SuperMapper { +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/UserMapper.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/UserMapper.java new file mode 100644 index 0000000..a761ade --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/UserMapper.java @@ -0,0 +1,43 @@ +package com.yunzhupaas.permission.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.permission.entity.UserEntity; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + + +/** + * 用户信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public interface UserMapper extends SuperMapper { + /** + * 获取用户id + * @return + */ + List getListId(); + + /** + * 通过组织id获取用户信息 + * + * @param orgIdList + * @param gender + * @return + */ + List query(@Param("orgIdList") List orgIdList, @Param("account") String account, @Param("dbSchema") String dbSchema, @Param("enabledMark") Integer enabledMark, @Param("gender") String gender); + + /** + * 通过组织id获取用户信息 + * + * @param orgIdList + * @param gender + * @return + */ + Long count(@Param("orgIdList") List orgIdList, @Param("account") String account, @Param("dbSchema") String dbSchema, @Param("enabledMark") Integer enabledMark, @Param("gender") String gender); +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/UserOldPasswordMapper.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/UserOldPasswordMapper.java new file mode 100644 index 0000000..dfdc2cb --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/UserOldPasswordMapper.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.permission.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.permission.entity.UserOldPasswordEntity; + + +/** + * 组织机构 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +public interface UserOldPasswordMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/UserRelationMapper.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/UserRelationMapper.java new file mode 100644 index 0000000..2c69931 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/mapper/UserRelationMapper.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.permission.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.permission.entity.UserRelationEntity; + + +/** + * 用户关系 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public interface UserRelationMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/rest/PullUserUtil.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/rest/PullUserUtil.java new file mode 100644 index 0000000..f4a7636 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/rest/PullUserUtil.java @@ -0,0 +1,46 @@ +package com.yunzhupaas.permission.rest; + +import com.yunzhupaas.permission.connector.HttpRequestUserInfoService; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.util.JsonUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.Map; + +/** + * 推送工具类 + * + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/7/28 20:56 + */ +@Slf4j +@Component +public class PullUserUtil { + + + private static HttpRequestUserInfoService httpRequestUserInfoService; + + public PullUserUtil(@Autowired(required = false) HttpRequestUserInfoService httpRequestUserInfoService){ + PullUserUtil.httpRequestUserInfoService = httpRequestUserInfoService; + } + + /** + * 推送到 + * + * @param userEntity + * @param method + * @param tenantId + */ + public static void syncUser(UserEntity userEntity, String method, String tenantId) { + if (httpRequestUserInfoService != null) { + Map map = JsonUtil.entityToMap(userEntity); + httpRequestUserInfoService.syncUserInfo(map, method, tenantId); + } + } + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/ColumnsPurviewService.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/ColumnsPurviewService.java new file mode 100644 index 0000000..32052bd --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/ColumnsPurviewService.java @@ -0,0 +1,34 @@ +package com.yunzhupaas.permission.service; + +import com.yunzhupaas.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import com.yunzhupaas.permission.entity.ColumnsPurviewEntity; + +/** + * 模块列表权限业务类 + * + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/3/15 9:39 + */ +public interface ColumnsPurviewService extends SuperService { + + /** + * 通过moduleId获取列表权限 + * + * @param moduleId + * @return + */ + ColumnsPurviewEntity getInfo(String moduleId); + + /** + * 判断是保存还是编辑 + * + * @param moduleId + * @param entity + * @return + */ + boolean update(String moduleId, ColumnsPurviewEntity entity); +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/SocialsUserService.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/SocialsUserService.java new file mode 100644 index 0000000..45f0a0e --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/SocialsUserService.java @@ -0,0 +1,52 @@ +package com.yunzhupaas.permission.service; + +import com.yunzhupaas.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import com.yunzhupaas.permission.entity.SocialsUserEntity; + +import java.util.List; + +/** + * 流程设计 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/7/14 9:33:16 + */ +public interface SocialsUserService extends SuperService { + /** + * 查询用户授权列表 + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/7/14 + */ + List getListByUserId(String userId); + + /** + * 查询用户授权列表 + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/7/14 + */ + List getUserIfnoBySocialIdAndType(String socialId,String socialType); + + /** + * 查询用户授权列表 + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/7/14 + */ + List getListByUserIdAndSource(String userId,String socialType); + + /** + * 根据第三方账号账号类型和id获取用户第三方绑定信息 + * @param socialId 第三方账号id + * @return + */ + SocialsUserEntity getInfoBySocialId(String socialId,String socialType); +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/UserOldPasswordService.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/UserOldPasswordService.java new file mode 100644 index 0000000..0c18d98 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/UserOldPasswordService.java @@ -0,0 +1,33 @@ +package com.yunzhupaas.permission.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.permission.entity.UserOldPasswordEntity; + +import java.util.List; + +/** + * 用户信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public interface UserOldPasswordService extends SuperService { + + /** + * 列表 + * + * @return + */ + List getList(String userId); + + /** + * 创建 + * + * @param entity 实体对象 + */ + Boolean create(UserOldPasswordEntity entity); + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/AuthorizeServiceImpl.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/AuthorizeServiceImpl.java new file mode 100644 index 0000000..243e775 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/AuthorizeServiceImpl.java @@ -0,0 +1,840 @@ +package com.yunzhupaas.permission.service.impl; + +import cn.hutool.core.text.StrPool; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.*; +import com.yunzhupaas.base.model.base.SystemBaeModel; +import com.yunzhupaas.base.model.button.ButtonModel; +import com.yunzhupaas.base.model.column.ColumnModel; +import com.yunzhupaas.base.model.form.ModuleFormModel; +import com.yunzhupaas.base.model.module.ModuleModel; +import com.yunzhupaas.base.model.portalManage.PortalManagePageDO; +import com.yunzhupaas.base.model.portalManage.PortalModel; +import com.yunzhupaas.base.model.portalManage.SavePortalAuthModel; +import com.yunzhupaas.base.model.resource.ResourceModel; +import com.yunzhupaas.base.service.*; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.YunzhupaasConst; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.constant.PermissionConst; +import com.yunzhupaas.consts.DeviceType; +import com.yunzhupaas.database.model.dto.PrepSqlDTO; +import com.yunzhupaas.database.model.superQuery.SuperJsonModel; +import com.yunzhupaas.database.model.superQuery.SuperQueryJsonModel; +import com.yunzhupaas.database.sql.util.SqlFrameFastUtil; +import com.yunzhupaas.database.util.DataSourceUtil; +import com.yunzhupaas.database.util.DbTypeUtil; +import com.yunzhupaas.database.util.JdbcUtil; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.emnus.SearchMethodEnum; +import com.yunzhupaas.model.login.UserSystemVO; +import com.yunzhupaas.model.tenant.TenantAuthorizeModel; +import com.yunzhupaas.model.visualJson.FieLdsModel; +import com.yunzhupaas.model.visualJson.config.ConfigModel; +import com.yunzhupaas.permission.constant.AuthorizeConst; +import com.yunzhupaas.permission.entity.AuthorizeEntity; +import com.yunzhupaas.permission.entity.OrganizeAdministratorEntity; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.entity.UserRelationEntity; +import com.yunzhupaas.permission.mapper.AuthorizeMapper; +import com.yunzhupaas.permission.model.authorize.*; +import com.yunzhupaas.permission.service.*; +import com.yunzhupaas.util.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * 操作权限 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +@Slf4j +@Service +public class AuthorizeServiceImpl extends SuperServiceImpl + implements AuthorizeService { + + @Autowired + private UserRelationService userRelationService; + @Autowired + private DataSourceUtil dataSourceUtils; + @Autowired + private CacheKeyUtil cacheKeyUtil; + @Autowired + private RedisUtil redisUtil; + @Autowired + private UserService userService; + @Autowired + private OrganizeService organizeService; + @Autowired + private OrganizeAdministratorService organizeAdminIsTratorService; + @Autowired + private SystemService systemApi; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private PermissionGroupService permissionGroupService; + @Autowired + private ModuleService moduleApi; + @Autowired + private ModuleButtonService buttonApi; + @Autowired + private ModuleColumnService columnApi; + @Autowired + private ModuleFormService formApi; + @Autowired + private ModuleDataAuthorizeSchemeService dataAuthorizeSchemeApi; + @Autowired + private PortalManageService portalManageApi; + + @Override + public AuthorizeVO getAuthorize(boolean isCache, boolean singletonOrg) { + return getAuthorize(isCache, singletonOrg, false); + } + + @Override + public AuthorizeVO getAuthorize(boolean isCache, boolean singletonOrg, boolean isMainSystem) { + UserInfo userInfo = UserProvider.getUser(); + List standingAll = getUserStanding(false, userInfo.getUserId()); + boolean isAdmin = standingAll.stream().filter(t -> "1".equals(t.getId()) || "2".equals(t.getId())).count() > 0; + List userStanding = standingAll.stream().filter(t -> "2".equals(t.getId())) + .collect(Collectors.toList()); + int stand = isAdmin ? 1 : userStanding.size() > 0 ? 2 : 3; + return getAuthorize(userInfo, singletonOrg, stand, isMainSystem); + } + + @Override + public void getPortal(List systemList, List portalList, Long dateTime, + List collect) { + Map systemBaeModelMap = systemList.stream() + .collect(Collectors.toMap(SystemEntity::getId, Function.identity())); + List systemIds = systemList.stream().map(SystemEntity::getId).collect(Collectors.toList()); + List portalManagePageDOS = portalManageApi.selectPortalBySystemIds(systemIds, collect); + if (portalManagePageDOS.size() == 0) { + return; + } + Map> systemIdAndPortalMap = portalManagePageDOS.stream() + .collect(Collectors.groupingBy(PortalManagePageDO::getSystemId)); + if (systemIdAndPortalMap != null) { + systemIdAndPortalMap.keySet().forEach(t -> { + if (Optional.ofNullable(systemBaeModelMap.get(t)).isPresent()) { + PortalModel systemModel = JsonUtil.getJsonToBean(systemBaeModelMap.get(t), PortalModel.class); + systemModel.setParentId("-1"); + portalList.add(systemModel); + Map platFormId = new HashMap<>(); + List portalManagePageDOList = systemIdAndPortalMap.get(t); + Map> platFormMap = portalManagePageDOList.stream() + .collect(Collectors.groupingBy(PortalManagePageDO::getPlatform)); + List web = platFormMap.get("Web"); + List app = platFormMap.get("App"); + if (web != null && web.size() > 0) { + PortalModel platForm = new PortalModel(); + platForm.setId(systemModel.getId() + "1"); + platForm.setParentId(systemModel.getId()); + platForm.setFullName("WEB门户"); + platForm.setIcon("icon-ym icon-ym-pc"); + platForm.setSortCode(0L); + platForm.setCreatorTime(dateTime); + platFormId.put("Web", platForm.getId()); + portalList.add(platForm); + } + if (app != null && app.size() > 0) { + PortalModel platForm = new PortalModel(); + platForm.setId(systemModel.getId() + "2"); + platForm.setParentId(systemModel.getId()); + platForm.setFullName("APP门户"); + platForm.setIcon("icon-ym icon-ym-mobile"); + platForm.setSortCode(0L); + platForm.setCreatorTime(dateTime); + platFormId.put("App", platForm.getId()); + portalList.add(platForm); + } + portalManagePageDOList.forEach(pageDO -> { + // if (!categoryList.contains(pageDO.getCategoryId())) { + // categoryList.add(pageDO.getCategoryId()); + // PortalModel categoryModel = new PortalModel(); + // categoryModel.setId(pageDO.getCategoryId()); + // categoryModel.setParentId(platFormId.get(pageDO.getPlatform())); + // categoryModel.setFullName(pageDO.getCategoryName()); + // categoryModel.setOnlyId(RandomUtil.uuId()); + // list.add(categoryModel); + // } + PortalModel model = JsonUtil.getJsonToBean(pageDO, PortalModel.class); + // model.setParentId(pageDO.getCategoryId()); + model.setParentId(platFormId.get(pageDO.getPlatform())); + model.setFullName(pageDO.getPortalName()); + portalList.add(model); + }); + } + }); + } + } + + @Override + @DSTransactional + public void saveItemAuth(SavePortalAuthModel portalAuthModel) { + List ids = portalAuthModel.getIds(); + String id = portalAuthModel.getId(); + String type = portalAuthModel.getType(); + String userId = UserProvider.getLoginUserId(); + // 原始授权角色 + List list = new ArrayList<>(); + for (int i = 0; i < ids.size(); i++) { + AuthorizeEntity authorizeEntity = new AuthorizeEntity(); + authorizeEntity.setId(RandomUtil.uuId()); + authorizeEntity.setItemType(type); + authorizeEntity.setItemId(ids.get(i)); + authorizeEntity.setObjectType(AuthorizeConst.ROLE); + authorizeEntity.setObjectId(id); + authorizeEntity.setSortCode((long) i); + authorizeEntity.setCreatorTime(new Date()); + authorizeEntity.setCreatorUserId(userId); + list.add(authorizeEntity); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AuthorizeEntity::getItemType, type); + queryWrapper.lambda().eq(AuthorizeEntity::getObjectId, id); + this.remove(queryWrapper); + list.forEach(this::save); + } + + @Override + @DSTransactional + public void saveObjectAuth(SavePortalAuthModel portalAuthModel) { + List ids = portalAuthModel.getIds(); + String id = portalAuthModel.getId(); + String type = portalAuthModel.getType(); + String userId = UserProvider.getLoginUserId(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AuthorizeEntity::getItemType, type); + queryWrapper.lambda().eq(AuthorizeEntity::getItemId, id); + this.remove(queryWrapper); + + List portalSystem = new ArrayList<>(); + boolean isPortal = AuthorizeConst.AUTHORIZE_PORTAL_MANAGE.equals(type); + if (isPortal && !ids.isEmpty() && StringUtil.isNotEmpty(portalAuthModel.getSystemId())) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(AuthorizeEntity::getItemType, AuthorizeConst.SYSTEM); + wrapper.lambda().eq(AuthorizeEntity::getItemId, portalAuthModel.getSystemId()); + wrapper.lambda().in(AuthorizeEntity::getObjectId, ids); + portalSystem.addAll(this.list(wrapper)); + } + // 原始授权角色 + List list = new ArrayList<>(); + for (int i = 0; i < ids.size(); i++) { + String objectId = ids.get(i); + AuthorizeEntity authorizeEntity = new AuthorizeEntity(); + authorizeEntity.setId(RandomUtil.uuId()); + authorizeEntity.setItemType(type); + authorizeEntity.setObjectId(objectId); + authorizeEntity.setObjectType(AuthorizeConst.ROLE); + authorizeEntity.setItemId(id); + authorizeEntity.setSortCode((long) i); + authorizeEntity.setCreatorTime(new Date()); + authorizeEntity.setCreatorUserId(userId); + list.add(authorizeEntity); + if (isPortal && StringUtil.isNotEmpty(portalAuthModel.getSystemId())) { + boolean portalCount = portalSystem.stream().filter(t -> Objects.equals(t.getObjectId(), objectId)) + .count() == 0; + if (portalCount) { + AuthorizeEntity systemAuthorize = new AuthorizeEntity(); + systemAuthorize.setId(RandomUtil.uuId()); + systemAuthorize.setItemType(AuthorizeConst.SYSTEM); + systemAuthorize.setObjectId(ids.get(i)); + systemAuthorize.setObjectType(AuthorizeConst.ROLE); + systemAuthorize.setItemId(portalAuthModel.getSystemId()); + systemAuthorize.setSortCode(0l); + systemAuthorize.setCreatorTime(new Date()); + systemAuthorize.setCreatorUserId(userId); + list.add(systemAuthorize); + } + } + } + list.forEach(this::save); + } + + @Override + public List getAuthorizeByItem(String itemType, String itemId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AuthorizeEntity::getItemType, itemType); + queryWrapper.lambda().eq(AuthorizeEntity::getItemId, itemId); + return this.list(queryWrapper); + } + + @Override + public AuthorizeVO getAuthorizeByUser(boolean singletonOrg) { + AuthorizeVO authorizeModel = this.getAuthorize(false, singletonOrg); + return authorizeModel; + } + + @Override + public AuthorizeVO getMainSystemAuthorize(List moduleIds, List moduleAuthorize, + List moduleUrlAddressAuthorize, boolean singletonOrg) { + SystemEntity systemEntity = systemApi.getInfoByEnCode(YunzhupaasConst.MAIN_SYSTEM_CODE); + if (systemEntity == null || moduleAuthorize.contains(systemEntity.getId())) { + return new AuthorizeVO(); + } + SystemBaeModel systemBaeModel = JsonUtil.getJsonToBean(systemEntity, SystemBaeModel.class); + List moduleList = new ArrayList<>(); + if (moduleIds.size() > 0) { + moduleList = moduleApi.getModuleByIds(moduleIds, moduleAuthorize, moduleUrlAddressAuthorize, singletonOrg); + } else { + moduleList = moduleApi.getMainModule(moduleAuthorize, moduleUrlAddressAuthorize, singletonOrg); + } + List moduleModelList = JsonUtil.getJsonToList(moduleList, ModuleModel.class); + List buttonByModuleId = buttonApi + .getListByModuleIds(moduleModelList.stream().map(ModuleModel::getId).collect(Collectors.toList())); + List buttonJsonToList = JsonUtil.getJsonToList(buttonByModuleId, ButtonModel.class); + + List columnByModuleId = columnApi + .getListByModuleId(moduleModelList.stream().map(ModuleModel::getId).collect(Collectors.toList())); + List columnJsonToList = JsonUtil.getJsonToList(columnByModuleId, ColumnModel.class); + + List resourceByModuleId = dataAuthorizeSchemeApi + .getListByModuleId(moduleModelList.stream().map(ModuleModel::getId).collect(Collectors.toList())); + List resourceJsonToList = JsonUtil.getJsonToList(resourceByModuleId, ResourceModel.class); + + List formByModuleId = formApi + .getListByModuleId(moduleModelList.stream().map(ModuleModel::getId).collect(Collectors.toList())); + List formJsonToList = JsonUtil.getJsonToList(formByModuleId, ModuleFormModel.class); + + return new AuthorizeVO(moduleModelList, buttonJsonToList, columnJsonToList, resourceJsonToList, formJsonToList, + Collections.singletonList(systemBaeModel)); + } + + @Override + public List getListByRoleIdsAndItemType(List roleIds, String itemType) { + if (roleIds.size() == 0) { + return Collections.EMPTY_LIST; + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AuthorizeEntity::getItemType, itemType); + queryWrapper.lambda().in(AuthorizeEntity::getObjectId, roleIds); + return this.list(queryWrapper); + } + + @Override + public void save(String objectId, AuthorizeDataUpForm authorizeList) { + SaveBatchForm form = JsonUtil.getJsonToBean(authorizeList, SaveBatchForm.class); + form.setRoleIds(new String[] { objectId }); + this.saveBatch(form, false); + } + + @Override + public void saveBatch(SaveBatchForm saveBatchForm, boolean isBatch) { + try { + UserInfo userInfo = UserProvider.getUser(); + + List objectList = new ArrayList<>(); + List authorizeList = new ArrayList<>(); + // 设置权限归属对象 + setEntity(saveBatchForm.getUserIds(), AuthorizeConst.USER, objectList, true); + setEntity(saveBatchForm.getPositionIds(), AuthorizeConst.POSITION, objectList, true); + setEntity(saveBatchForm.getRoleIds(), AuthorizeConst.ROLE, objectList, true); + // setEntity(saveBatchForm.getSystemIds(), AuthorizeConst.SYSTEM, objectList, + // true); + // 设置权限模块 + setEntity(saveBatchForm.getButton(), AuthorizeConst.BUTTON, authorizeList, false); + setEntity(saveBatchForm.getModule(), AuthorizeConst.MODULE, authorizeList, false); + setEntity(saveBatchForm.getColumn(), AuthorizeConst.COLUMN, authorizeList, false); + setEntity(saveBatchForm.getResource(), AuthorizeConst.RESOURCE, authorizeList, false); + setEntity(saveBatchForm.getForm(), AuthorizeConst.FROM, authorizeList, false); + setEntity(saveBatchForm.getSystemIds(), AuthorizeConst.SYSTEM, authorizeList, false); + + // 移除权限缓存 + this.removeAuthByUserOrMenu(null, Arrays.asList(saveBatchForm.getModule())); + + // 删除角色相关信息 + List objectIdAll = objectList.stream().map(AuthorizeEntity::getObjectId) + .collect(Collectors.toList()); + userService.delCurRoleUser(MsgCode.PS010.get(), objectIdAll); + if (!isBatch) { + String ids = String.join(",", objectIdAll); + JdbcUtil.creUpDe(new PrepSqlDTO( + XSSEscape.escapeEmpty(SqlFrameFastUtil.AUTHOR_DEL.replace("{authorizeIds}", ids))) + .withConn(dataSourceUtils, null)); + } + + // 插入数据 + String sql = DbTypeUtil.checkOracle(dataSourceUtils) || DbTypeUtil.checkPostgre(dataSourceUtils) + ? SqlFrameFastUtil.INSERT_AUTHORIZE2 + : SqlFrameFastUtil.INSERT_AUTHORIZE; + + String column_key = StringUtil.EMPTY, column_plceholder = StringUtil.EMPTY, + column_value = TenantDataSourceUtil.getTenantColumn(); + if (StringUtil.isNotEmpty(column_value)) { + column_key = StrPool.COMMA + configValueUtil.getMultiTenantColumn(); + column_plceholder = ",?"; + } + sql = sql.replace("%COLUMN_KEY%", column_key).replace("%COLUMN_PLACEHOLDER%", column_plceholder); + PrepSqlDTO dto = new PrepSqlDTO(sql).withConn(dataSourceUtils, null); + for (int i = 0; i < objectList.size(); i++) { + for (AuthorizeEntity entityItem : authorizeList) { + List data = new LinkedList<>(); + data.add(RandomUtil.uuId()); + data.add(entityItem.getItemType()); + data.add(entityItem.getItemId()); + data.add(objectList.get(i).getObjectType()); + data.add(objectList.get(i).getObjectId()); + data.add(i); + data.add(DateUtil.getNow()); + data.add(userInfo.getUserId()); + if (StringUtil.isNotEmpty(column_value)) { + data.add(column_value); + } + dto.addMultiData(data); + } + } + JdbcUtil.creUpDeBatchOneSql(dto); + } catch (Exception e) { + e.printStackTrace(); + log.error("权限报错:" + e.getMessage()); + } + } + + /** + * 权限 + */ + private void setEntity(String[] ids, String type, List entityList, Boolean objectFlag) { + if (ids != null) { + for (String id : ids) { + AuthorizeEntity entity = new AuthorizeEntity(); + if (objectFlag) { + entity.setObjectType(type); + entity.setObjectId(id); + } else { + entity.setItemType(type); + entity.setItemId(id); + } + entityList.add(entity); + } + } + } + + @Override + public List getListByUserId(boolean isAdmin, String userId) { + if (!isAdmin) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(UserRelationEntity::getUserId, userId); + List list = userRelationService.list(queryWrapper); + List userRelationList = list.stream().map(u -> u.getObjectId()).collect(Collectors.toList()); + userRelationList.add(userId); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().in(AuthorizeEntity::getObjectId, userRelationList); + return this.list(wrapper); + } else { + return new ArrayList<>(); + } + } + + @Override + public List getListByObjectId(List objectId) { + if (objectId.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(AuthorizeEntity::getObjectId, objectId); + return this.list(queryWrapper); + } + + @Override + public Boolean existAuthorize(String roleId, String systemId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AuthorizeEntity::getObjectId, roleId); + if (StringUtil.isNotEmpty(systemId)) { + queryWrapper.lambda().eq(AuthorizeEntity::getItemId, systemId); + queryWrapper.lambda().eq(AuthorizeEntity::getItemType, AuthorizeConst.SYSTEM); + } + return this.count(queryWrapper) > 0; + } + + @Override + public List getListByRoleId(String roleId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AuthorizeEntity::getObjectId, roleId); + return this.list(queryWrapper); + } + + @Override + public List getListByObjectId(String objectId, String itemType) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AuthorizeEntity::getObjectId, objectId); + queryWrapper.lambda().eq(AuthorizeEntity::getItemType, itemType); + return this.list(queryWrapper); + } + + @Override + public List getListByObjectAndItem(String itemId, String objectType) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AuthorizeEntity::getObjectType, objectType).eq(AuthorizeEntity::getItemId, itemId); + return this.list(queryWrapper); + } + + @Override + public List getListByObjectAndItemIdAndType(String itemId, String itemType) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AuthorizeEntity::getItemType, itemType).eq(AuthorizeEntity::getItemId, itemId); + return this.list(queryWrapper); + } + + @Override + public List getUserStanding(boolean isLogin, String userId) { + return getUserStanding(isLogin, userId, null); + } + + @Override + public List getUserStanding(boolean isLogin, String userId, String loginDevice) { + UserInfo userInfo = UserProvider.getUser(); + List systemVOS = new ArrayList<>(); + UserEntity info = userService.getInfo(userId); + String device = StringUtil.isNotEmpty(loginDevice) ? loginDevice : userInfo.getLoginDevice(); + if (DeviceType.PC.getDevice().equals(device)) { + if (ObjectUtil.isNotEmpty(info.getStanding())) { + UserSystemVO vo = new UserSystemVO(); + vo.setId(info.getStanding() + ""); + vo.setCurrentStanding(true); + systemVOS.add(vo); + } + } else { + if (ObjectUtil.isNotEmpty(info.getAppStanding())) { + UserSystemVO vo = new UserSystemVO(); + vo.setId(info.getAppStanding() + ""); + vo.setCurrentStanding(true); + systemVOS.add(vo); + } + } + List infoByUserId = organizeAdminIsTratorService.getInfoByUserId(userId); + if (isLogin) { + if (infoByUserId.size() > 0) { + UserSystemVO vo = new UserSystemVO(); + vo.setId("2"); + systemVOS.add(vo); + } + } else { + if (systemVOS.size() == 0) { + if (Objects.equals(info.getIsAdministrator(), 1)) { + UserSystemVO vo = new UserSystemVO(); + vo.setId("1"); + systemVOS.add(vo); + } else if (infoByUserId.size() > 0) { + UserSystemVO vo = new UserSystemVO(); + vo.setId("2"); + systemVOS.add(vo); + } else { + UserSystemVO vo = new UserSystemVO(); + vo.setId("3"); + systemVOS.add(vo); + } + } + } + return systemVOS; + } + + @Override + public AuthorizeVO getAuthorize(UserInfo userInfo, boolean singletonOrg, Integer stand, boolean isMainSystem) { + List moduleList = new ArrayList<>(); + List buttonList = new ArrayList<>(); + List columnList = new ArrayList<>(); + List resourceList = new ArrayList<>(); + List formsList = new ArrayList<>(); + List systemList = new ArrayList<>(); + List organizeAdministratorEntity = new ArrayList<>(); + boolean isAdmin = userInfo.getIsAdministrator(); + if (ObjectUtil.isNotEmpty(stand)) { + isAdmin = Objects.equals(stand, 1); + if (Objects.equals(stand, 2)) { + organizeAdministratorEntity.addAll(organizeAdminIsTratorService.getInfoByUserId(userInfo.getUserId())); + } + } + SystemEntity entity = systemApi.getInfoByEnCode(YunzhupaasConst.MAIN_SYSTEM_CODE); + List moduleAuthorize = new ArrayList<>(); + List moduleUrlAddressAuthorize = new ArrayList<>(); + if (configValueUtil.isMultiTenancy()) { + TenantAuthorizeModel tenantAuthorizeModel = TenantDataSourceUtil + .getCacheModuleAuthorize(userInfo.getTenantId()); + moduleAuthorize = tenantAuthorizeModel.getModuleIdList(); + moduleUrlAddressAuthorize = tenantAuthorizeModel.getUrlAddressList(); + } + // 开发平台权限获取 + AuthorizeVO mainSystemAuthorize = new AuthorizeVO(); + if (isMainSystem) { + if (isAdmin || organizeAdministratorEntity.size() > 0) { + List mainModuleId = new ArrayList<>(); + List moduleId = organizeAdministratorEntity.stream() + .filter(t -> PermissionConst.MODULE.equals(t.getOrganizeType())) + .map(OrganizeAdministratorEntity::getOrganizeId).collect(Collectors.toList()); + mainModuleId.addAll(moduleId); + if (organizeAdministratorEntity.size() > 0) { + mainModuleId.add(YunzhupaasConst.MAIN_SYSTEM_CODE); + } + AuthorizeVO mainAuthorize = this.getMainSystemAuthorize(mainModuleId, moduleAuthorize, + moduleUrlAddressAuthorize, singletonOrg); + mainSystemAuthorize.setModuleList(mainAuthorize.getModuleList()); + mainSystemAuthorize.setButtonList(mainAuthorize.getButtonList()); + mainSystemAuthorize.setColumnList(mainAuthorize.getColumnList()); + mainSystemAuthorize.setResourceList(mainAuthorize.getResourceList()); + mainSystemAuthorize.setFormsList(mainAuthorize.getFormsList()); + if ((organizeAdministratorEntity.size() > 0 && moduleId.size() > 0) || isAdmin) { + mainSystemAuthorize.setSystemList(mainAuthorize.getSystemList()); + } + } + } + if (!isAdmin) { + if (organizeAdministratorEntity.size() > 0) { + List systemId = organizeAdministratorEntity.stream() + .filter(t -> PermissionConst.SYSTEM.equals(t.getOrganizeType())) + .map(OrganizeAdministratorEntity::getOrganizeId).collect(Collectors.toList()); + List systemEntities = systemApi.getListByIds(systemId, moduleAuthorize); + List systemJsonToList = JsonUtil.getJsonToList(systemEntities, SystemBaeModel.class); + systemList.addAll(systemJsonToList); + List systemIds = systemJsonToList.stream().map(SystemBaeModel::getId) + .collect(Collectors.toList()); + List moduleBySystemIds = moduleApi.getModuleBySystemIds(systemIds, moduleAuthorize, + moduleUrlAddressAuthorize); + List moduleJsonToList = JsonUtil.getJsonToList(moduleBySystemIds, ModuleModel.class); + moduleList.addAll(moduleJsonToList); + List buttonByModuleId = buttonApi.getListByModuleIds( + moduleJsonToList.stream().map(ModuleModel::getId).collect(Collectors.toList())); + List buttonJsonToList = JsonUtil.getJsonToList(buttonByModuleId, ButtonModel.class); + buttonList.addAll(buttonJsonToList); + List columnByModuleId = columnApi.getListByModuleId( + moduleJsonToList.stream().map(ModuleModel::getId).collect(Collectors.toList())); + List columnJsonToList = JsonUtil.getJsonToList(columnByModuleId, ColumnModel.class); + columnList.addAll(columnJsonToList); + List resourceByModuleId = dataAuthorizeSchemeApi.getListByModuleId( + moduleJsonToList.stream().map(ModuleModel::getId).collect(Collectors.toList())); + List resourceJsonToList = JsonUtil.getJsonToList(resourceByModuleId, + ResourceModel.class); + resourceList.addAll(resourceJsonToList); + List formByModuleId = formApi.getListByModuleId( + moduleJsonToList.stream().map(ModuleModel::getId).collect(Collectors.toList())); + List formJsonToList = JsonUtil.getJsonToList(formByModuleId, ModuleFormModel.class); + formsList.addAll(formJsonToList); + } else { + List roleIdList = new ArrayList<>(); + permissionGroupService + .getPermissionGroupByUserId(userInfo.getUserId(), userInfo.getOrganizeId(), true, null) + .forEach(t -> { + roleIdList.add(t.getId()); + }); + List authorizeList = new ArrayList<>(); + if (roleIdList.size() > 0) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().in(AuthorizeEntity::getObjectId, roleIdList); + authorizeList = this.list(wrapper); + } + // 应用 + List systemId = authorizeList.stream() + .filter(t -> AuthorizeConst.SYSTEM.equals(t.getItemType())).map(AuthorizeEntity::getItemId) + .collect(Collectors.toList()); + systemId.remove(entity.getId()); + if (systemId.size() > 0) { + List systemAdmin = systemApi.getListByIds(systemId, moduleAuthorize); + systemList = JsonUtil.getJsonToList(systemAdmin, SystemBaeModel.class); + systemId = systemAdmin.stream().map(SystemEntity::getId).collect(Collectors.toList()); + } + // 菜单 无开发平台 + List moduleId = authorizeList.stream() + .filter(t -> AuthorizeConst.MODULE.equals(t.getItemType())).map(AuthorizeEntity::getItemId) + .collect(Collectors.toList()); + if (moduleId.size() > 0 && systemId.size() > 0) { + moduleList = this.baseMapper.findModule(moduleId, systemId, moduleAuthorize, + moduleUrlAddressAuthorize, singletonOrg ? 0 : 1, YunzhupaasConst.MODULE_CODE); + } + // 按钮 + List buttonId = authorizeList.stream() + .filter(t -> AuthorizeConst.BUTTON.equals(t.getItemType())).map(AuthorizeEntity::getItemId) + .collect(Collectors.toList()); + if (buttonId.size() > 0) { + buttonList = this.baseMapper.findButton(buttonId); + } + // 列表 + List columnId = authorizeList.stream() + .filter(t -> AuthorizeConst.COLUMN.equals(t.getItemType())).map(AuthorizeEntity::getItemId) + .collect(Collectors.toList()); + if (columnId.size() > 0) { + columnList = this.baseMapper.findColumn(columnId); + } + // 数据 + List resourceId = authorizeList.stream() + .filter(t -> AuthorizeConst.RESOURCE.equals(t.getItemType())).map(AuthorizeEntity::getItemId) + .collect(Collectors.toList()); + if (resourceId.size() > 0) { + resourceList = this.baseMapper.findResource(resourceId); + } + // 表单 + List formId = authorizeList.stream().filter(t -> AuthorizeConst.FROM.equals(t.getItemType())) + .map(AuthorizeEntity::getItemId).collect(Collectors.toList()); + if (formId.size() > 0) { + formsList = this.baseMapper.findForms(formId); + } + } + } else { + buttonList = this.baseMapper.findButtonAdmin(1); + columnList = this.baseMapper.findColumnAdmin(1); + resourceList = this.baseMapper.findResourceAdmin(1); + formsList = this.baseMapper.findFormsAdmin(1); + List systemAdmin = systemApi.findSystemAdmin(singletonOrg ? 0 : 1, + YunzhupaasConst.MAIN_SYSTEM_CODE, moduleAuthorize); + systemList = JsonUtil.getJsonToList(systemAdmin, SystemBaeModel.class); + List systemId = systemList.stream().map(SystemBaeModel::getId).collect(Collectors.toList()); + List moduleAdmin = moduleApi.findModuleAdmin(singletonOrg ? 0 : 1, entity.getId(), + moduleAuthorize, moduleUrlAddressAuthorize); + moduleList = JsonUtil.getJsonToList(moduleAdmin, ModuleModel.class).stream() + .filter(t -> systemId.contains(t.getSystemId())).collect(Collectors.toList()); + } + systemList.addAll(mainSystemAuthorize.getSystemList()); + moduleList.addAll(mainSystemAuthorize.getModuleList()); + buttonList.addAll(mainSystemAuthorize.getButtonList()); + columnList.addAll(mainSystemAuthorize.getColumnList()); + resourceList.addAll(mainSystemAuthorize.getResourceList()); + formsList.addAll(mainSystemAuthorize.getFormsList()); + return new AuthorizeVO(moduleList, buttonList, columnList, resourceList, formsList, systemList); + } + + @Override + @DS("") + public List getConditionSql(String moduleId) { + List list = new ArrayList<>(); + UserInfo userInfo = UserProvider.getUser(); + String reidsKey = cacheKeyUtil.getUserAuthorize() + moduleId + "_" + userInfo.getUserId(); + long time = 60 * 5; + if (redisUtil.exists(reidsKey)) { + return JsonUtil.getJsonToList(redisUtil.getString(reidsKey).toString(), SuperJsonModel.class); + } + + AuthorizeVO model = this.getAuthorizeByUser(false); + if (model == null) { + redisUtil.insert(reidsKey, JsonUtil.getObjectToString(new ArrayList<>()), time); + return new ArrayList<>(); + } + List resourceListAll = model.getResourceList().stream() + .filter(m -> m.getModuleId().equals(moduleId)).collect(Collectors.toList()); + // 先遍历一次 查找其中有没有全部方案 + boolean isAll = resourceListAll.stream().filter(item -> "yunzhupaas_alldata".equals(item.getEnCode()) + || item.getEnCode().startsWith("yunzhupaas_alldata")).count() > 0; + // 未分配权限方案 + if (isAll || userInfo.getIsAdministrator()) { + SuperJsonModel superJsonModel = new SuperJsonModel(); + list.add(superJsonModel); + redisUtil.insert(reidsKey, JsonUtil.getObjectToString(list), time); + return list; + } + Map> authorizeMap = resourceListAll.stream() + .filter(t -> StringUtil.isNotEmpty(t.getObjectId())) + .collect(Collectors.groupingBy(ma -> ma.getObjectId())); + int num = 0; + // 方案 + for (String key : authorizeMap.keySet()) { + List resourceList = authorizeMap.get(key); + boolean authorizeLogic = num == 0; + for (ResourceModel item : resourceList) { + String matchLogic = StringUtil.isNotEmpty(item.getMatchLogic()) ? item.getMatchLogic() + : SearchMethodEnum.And.getSymbol(); + List conditionList = new ArrayList<>(); + List conditionModelList = JsonUtil.getJsonToList(item.getConditionJson(), + ConditionModel.class); + // 分组 + for (ConditionModel conditionModel : conditionModelList) { + String logic = conditionModel.getLogic(); + List groupList = new ArrayList<>(); + // 条件 + for (ConditionModel.ConditionItemModel fieldItem : conditionModel.getGroups()) { + SearchMethodEnum itemMethod = SearchMethodEnum.getSearchMethod(fieldItem.getOp()); + String itemField = fieldItem.getField(); + String table = fieldItem.getBindTable(); + if (itemField.contains(".") && itemField.split("\\.").length == 2) { + table = itemField.split("\\.")[0]; + itemField = itemField.split("\\.")[1]; + } + String bindTable = table; + String vModel = itemField; + String fileId = ""; + FieLdsModel fieLdsModel = new FieLdsModel(); + ConfigModel config = new ConfigModel(); + String yunzhupaasKey = fieldItem.getConditionText(); + if (AuthorizeConditionEnum.CURRENTTIME.getCondition().equals(yunzhupaasKey)) { + yunzhupaasKey = AuthorizeConst.DATE_PICKER; + } + switch (fieldItem.getFieldRule()) { + case "1": + fileId = "yunzhupaas_" + bindTable + "_yunzhupaas_" + vModel; + break; + case "2": + fileId = fieldItem.getChildTableKey() + "-" + vModel; + break; + default: + fileId = vModel; + break; + } + + config.setYunzhupaasKey(yunzhupaasKey); + config.setTableName(bindTable); + fieLdsModel.setConfig(config); + fieLdsModel.setSymbol(itemMethod.getSymbol()); + fieLdsModel.setVModel(vModel); + fieLdsModel.setId(fileId); + fieLdsModel.setFieldValue(fieldItem.getValue()); + groupList.add(fieLdsModel); + } + // 搜索条件 + SuperQueryJsonModel queryJsonModel = new SuperQueryJsonModel(); + queryJsonModel.setGroups(groupList); + queryJsonModel.setLogic(logic); + conditionList.add(queryJsonModel); + } + if (conditionList.size() > 0) { + SuperJsonModel superJsonModel = new SuperJsonModel(); + superJsonModel.setMatchLogic(matchLogic); + superJsonModel.setConditionList(conditionList); + superJsonModel.setAuthorizeLogic(authorizeLogic); + list.add(superJsonModel); + } + } + num += list.size() > 0 ? 1 : 0; + } + redisUtil.insert(reidsKey, JsonUtil.getObjectToString(list), time); + return list; + } + + @Override + public void removeAuthByUserOrMenu(List userIds, List menuIds) { + userIds = userIds == null ? new ArrayList<>() : userIds; + menuIds = menuIds == null ? new ArrayList<>() : menuIds; + Set allKeys = redisUtil.getAllKeys(); + for (String cacheKey : allKeys) { + for (String user : userIds) { + if (cacheKey.startsWith(cacheKeyUtil.getUserAuthorize()) && cacheKey.contains(user)) { + redisUtil.remove(cacheKey); + } + } + for (String menuId : menuIds) { + if (cacheKey.startsWith(cacheKeyUtil.getUserAuthorize()) && cacheKey.contains(menuId)) { + redisUtil.remove(cacheKey); + } + } + } + } + + @Override + public boolean getUserCurrentStanding(String userId, Integer standType) { + if (UserProvider.getUser() == null || UserProvider.getUser().getUserId() == null) + return false; + List userStanding = this.getUserStanding(false, UserProvider.getUser().getUserId()); + if (standType != null && userStanding.stream().anyMatch(t -> standType.toString().equals(t.getId()))) { + return true; + } + return false; + } +} diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/ColumnsPurviewServiceImpl.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/ColumnsPurviewServiceImpl.java new file mode 100644 index 0000000..b11e580 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/ColumnsPurviewServiceImpl.java @@ -0,0 +1,51 @@ +package com.yunzhupaas.permission.service.impl; + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yunzhupaas.permission.entity.ColumnsPurviewEntity; +import com.yunzhupaas.permission.mapper.ColumnsPurviewMapper; +import com.yunzhupaas.permission.service.ColumnsPurviewService; +import com.yunzhupaas.util.DateUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 模块列表权限业务实现类 + * + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/3/15 9:40 + */ +@Service +public class ColumnsPurviewServiceImpl extends SuperServiceImpl implements ColumnsPurviewService { + + @Override + public ColumnsPurviewEntity getInfo(String moduleId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ColumnsPurviewEntity::getModuleId, moduleId); + return this.getOne(queryWrapper); + } + + @Override + public boolean update(String moduleId, ColumnsPurviewEntity entity) { + ColumnsPurviewEntity entitys = getInfo(moduleId); + // id不存在则是保存 + if (entitys == null) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + return this.save(entity); + } else { + // 修改 + entity.setId(entitys.getId()); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + entity.setLastModifyTime(DateUtil.getNowDate()); + } + return this.saveOrUpdate(entity); + } + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/GroupServiceImpl.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/GroupServiceImpl.java new file mode 100644 index 0000000..d2ec9da --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/GroupServiceImpl.java @@ -0,0 +1,168 @@ +package com.yunzhupaas.permission.service.impl; + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yunzhupaas.permission.entity.GroupEntity; +import com.yunzhupaas.permission.entity.PositionEntity; +import com.yunzhupaas.permission.mapper.GroupMapper; +import com.yunzhupaas.permission.model.usergroup.PaginationGroup; +import com.yunzhupaas.permission.service.GroupService; +import com.yunzhupaas.util.DateUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 分组管理业务类实现类 + * + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/3/10 18:00 + */ +@Service +public class GroupServiceImpl extends SuperServiceImpl implements GroupService { + + + @Override + public List getList(PaginationGroup pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + // 定义变量判断是否需要使用修改时间倒序 + boolean flag = false; + // 判断关键字 + String keyword = pagination.getKeyword(); + if (StringUtil.isNotEmpty(keyword)) { + flag = true; + queryWrapper.lambda().and( + t -> t.like(GroupEntity::getFullName, keyword) + .or().like(GroupEntity::getEnCode, keyword) + .or().like(GroupEntity::getDescription, keyword) + ); + } + if (pagination.getEnabledMark() != null) { + queryWrapper.lambda().eq(GroupEntity::getEnabledMark, pagination.getEnabledMark()); + } + if (StringUtil.isNotEmpty(pagination.getType())) { + flag = true; + queryWrapper.lambda().eq(GroupEntity::getType, pagination.getType()); + } + // 获取列表 + queryWrapper.lambda().orderByAsc(GroupEntity::getSortCode).orderByDesc(GroupEntity::getCreatorTime); + if (flag) { + queryWrapper.lambda().orderByDesc(GroupEntity::getLastModifyTime); + } + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage iPage = this.page(page, queryWrapper); + return pagination.setData(iPage.getRecords(), iPage.getTotal()); + } + + @Override + public List list() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(GroupEntity::getEnabledMark, 1); + queryWrapper.lambda().orderByAsc(GroupEntity::getSortCode).orderByDesc(GroupEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public Map getGroupMap() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(GroupEntity::getId,GroupEntity::getFullName); + return this.list(queryWrapper).stream().collect(Collectors.toMap(GroupEntity::getId,GroupEntity::getFullName)); + } + + @Override + public Map getGroupEncodeMap() { + return getGroupEncodeMap(false); + } + @Override + public Map getGroupEncodeMap(boolean enabledMark) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if(enabledMark){ + queryWrapper.lambda().eq(GroupEntity::getEnabledMark,1); + } + queryWrapper.lambda().select(GroupEntity::getId,GroupEntity::getFullName,GroupEntity::getEnCode); + return this.list(queryWrapper).stream().collect(Collectors.toMap(group->group.getFullName() + "/" + group.getEnCode(),GroupEntity::getId)); + } + + @Override + public GroupEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(GroupEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public GroupEntity getInfo(String fullName,String enCode) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(GroupEntity::getFullName, fullName); + queryWrapper.lambda().eq(GroupEntity::getEnCode, enCode); + return this.getOne(queryWrapper); + } + + @Override + public void crete(GroupEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + entity.setCreatorTime(DateUtil.getNowDate()); + this.save(entity); + } + + @Override + public Boolean update(String id, GroupEntity entity) { + entity.setId(id); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + entity.setLastModifyTime(DateUtil.getNowDate()); + return this.updateById(entity); + } + + @Override + public void delete(GroupEntity entity) { + this.removeById(entity.getId()); + } + + @Override + public Boolean isExistByFullName(String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(GroupEntity::getFullName, fullName); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(GroupEntity::getId, id); + } + return this.count(queryWrapper) > 0; + } + + @Override + public Boolean isExistByEnCode(String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(GroupEntity::getEnCode, enCode); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(GroupEntity::getId, id); + } + return this.count(queryWrapper) > 0; + } + + @Override + public List getListByIds(List list, Boolean filterEnabledMark) { + if (list.isEmpty()) { + return Collections.EMPTY_LIST; + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(GroupEntity::getId, list); + if (filterEnabledMark) { + queryWrapper.lambda().eq(GroupEntity::getEnabledMark, 1); + } + return this.list(queryWrapper); + } + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/OrganizeAdministratorServiceImpl.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/OrganizeAdministratorServiceImpl.java new file mode 100644 index 0000000..e0a1ddd --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/OrganizeAdministratorServiceImpl.java @@ -0,0 +1,533 @@ +package com.yunzhupaas.permission.service.impl; + +import cn.hutool.core.text.StrPool; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import com.yunzhupaas.base.entity.ModuleEntity; +import com.yunzhupaas.base.entity.SystemEntity; +import com.yunzhupaas.base.service.DbLinkService; +import com.yunzhupaas.base.service.ModuleService; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.service.SystemService; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.YunzhupaasConst; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.database.model.dto.PrepSqlDTO; +import com.yunzhupaas.database.sql.util.SqlFrameFastUtil; +import com.yunzhupaas.database.util.DataSourceUtil; +import com.yunzhupaas.constant.PermissionConst; +import com.yunzhupaas.database.util.DbTypeUtil; +import com.yunzhupaas.database.util.JdbcUtil; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.model.login.UserSystemVO; +import com.yunzhupaas.model.tenant.TenantAuthorizeModel; +import com.yunzhupaas.permission.entity.OrganizeAdministratorEntity; +import com.yunzhupaas.permission.entity.OrganizeEntity; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.entity.UserRelationEntity; +import com.yunzhupaas.permission.mapper.OrganizeAdminIsTratorMapper; +import com.yunzhupaas.permission.model.organizeadministrator.OrganizeAdministratorListVo; +import com.yunzhupaas.permission.model.organizeadministrator.OrganizeAdministratorModel; +import com.yunzhupaas.permission.service.*; +import com.yunzhupaas.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 机构分级管理员 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +@Service +public class OrganizeAdministratorServiceImpl + extends SuperServiceImpl + implements OrganizeAdministratorService { + + @Autowired + private OrganizeService organizeService; + @Autowired + private UserService userService; + @Autowired + private UserRelationService userRelationService; + @Autowired + private DbLinkService dbLinkService; + @Autowired + private SystemService systemApi; + @Autowired + private ModuleService moduleApi; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private AuthorizeService authorizeService; + @Autowired + private DataSourceUtil dataSourceUtils; + + @Override + public OrganizeAdministratorEntity getOne(String userId, String organizeId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeAdministratorEntity::getUserId, userId); + queryWrapper.lambda().eq(OrganizeAdministratorEntity::getOrganizeId, organizeId); + // 排序 + queryWrapper.lambda().orderByAsc(OrganizeAdministratorEntity::getSortCode) + .orderByDesc(OrganizeAdministratorEntity::getCreatorTime); + return this.getOne(queryWrapper); + } + + @Override + public List getOrganizeAdministratorEntity(String userId) { + return getOrganizeAdministratorEntity(userId, PermissionConst.ORGANIZE, false); + } + + @Override + public List getOrganizeAdministratorEntity(String userId, String type, + boolean filterMain) { + List list = new ArrayList<>(); + UserEntity entity1 = userService.getInfo(userId); + List userStanding = authorizeService.getUserStanding(false, entity1.getId()); + boolean isAdmin = userStanding.stream().filter(t -> "1".equals(t.getId())).count() > 0; + // 查询非组织权限 + if ((entity1 != null && isAdmin) && !PermissionConst.ORGANIZE.equals(type)) { + List collect = new ArrayList<>(); + List moduleAuthorize = new ArrayList<>(); + List moduleUrlAddressAuthorize = new ArrayList<>(); + if (configValueUtil.isMultiTenancy()) { + TenantAuthorizeModel tenantAuthorizeModel = TenantDataSourceUtil + .getCacheModuleAuthorize(UserProvider.getUser().getTenantId()); + moduleAuthorize = tenantAuthorizeModel.getModuleIdList(); + moduleUrlAddressAuthorize = tenantAuthorizeModel.getUrlAddressList(); + } + if (PermissionConst.SYSTEM.equals(type)) { + collect = systemApi.getList(null, false, false, filterMain, false, moduleAuthorize).stream() + .map(SystemEntity::getId).collect(Collectors.toList()); + } else if (PermissionConst.MODULE.equals(type)) { + collect = moduleApi.getList(false, moduleAuthorize, moduleUrlAddressAuthorize).stream() + .map(ModuleEntity::getId).collect(Collectors.toList()); + } + for (String t : collect) { + OrganizeAdministratorEntity entity = new OrganizeAdministratorEntity(); + entity.setOrganizeId(t); + entity.setId(RandomUtil.uuId()); + entity.setOrganizeType(type); + entity.setUserId(userId); + list.add(entity); + } + return list; + } + // 组织权限 + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (PermissionConst.ORGANIZE.equals(type)) { + queryWrapper.lambda().isNull(OrganizeAdministratorEntity::getOrganizeType); + } else if (StringUtil.isNotEmpty(type)) { + queryWrapper.lambda().eq(OrganizeAdministratorEntity::getOrganizeType, type); + } + queryWrapper.lambda().eq(OrganizeAdministratorEntity::getUserId, userId); + // 排序 + queryWrapper.lambda().orderByAsc(OrganizeAdministratorEntity::getSortCode) + .orderByDesc(OrganizeAdministratorEntity::getCreatorTime); + list = this.list(queryWrapper); + return list; + } + + @Override + public List getOrganizeAdministratorEntity(String userId, String type) { + // 组织权限 + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (PermissionConst.ORGANIZE.equals(type)) { + queryWrapper.lambda().isNull(OrganizeAdministratorEntity::getOrganizeType); + } else if (StringUtil.isNotEmpty(type)) { + queryWrapper.lambda().eq(OrganizeAdministratorEntity::getOrganizeType, type); + } + queryWrapper.lambda().eq(OrganizeAdministratorEntity::getUserId, userId); + // 排序 + queryWrapper.lambda().orderByAsc(OrganizeAdministratorEntity::getSortCode) + .orderByDesc(OrganizeAdministratorEntity::getCreatorTime); + List list = this.list(queryWrapper); + return list; + } + + @Override + @Transactional + public void create(OrganizeAdministratorEntity entity) { + // 判断是新建还是删除 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeAdministratorEntity::getOrganizeId, entity.getOrganizeId()); + queryWrapper.lambda().eq(OrganizeAdministratorEntity::getUserId, entity.getUserId()); + // 查出数据是否重复 + OrganizeAdministratorEntity administratorEntity = this.getOne(queryWrapper); + if (administratorEntity == null) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(UserProvider.getLoginUserId()); + entity.setCreatorTime(new Date()); + } else { + entity.setId(administratorEntity.getId()); + entity.setCreatorUserId(UserProvider.getLoginUserId()); + entity.setLastModifyTime(new Date()); + } + this.saveOrUpdate(entity); + } + + @Override + public void createList(List list, String userId) { + // QueryWrapper queryWrapper = new + // QueryWrapper<>(); + // queryWrapper.lambda().eq(OrganizeAdministratorEntity::getUserId,userId); + // queryWrapper.lambda().select(OrganizeAdministratorEntity::getCreatorTime); + // IPage list1 = this.page(new Page<>(1, 1), + // queryWrapper); + // boolean isData = !list1.getRecords().isEmpty() && + // ObjectUtil.isNotEmpty(list1.getRecords().get(0).getCreatorTime()); + // Date creatorTime = isData?list1.getRecords().get(0).getCreatorTime():new + // Date(); + // this.remove(queryWrapper); + // for (OrganizeAdministratorEntity entity : list) { + // entity.setCreatorTime(creatorTime); + // this.save(entity); + // } + // userService.delCurUser(MsgCode.PS010.get(), ImmutableList.of(userId),2); + try { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeAdministratorEntity::getUserId, userId); + Page page = new Page<>(1, 1); + IPage list1 = this.page(page, queryWrapper); + boolean isData = !list1.getRecords().isEmpty() + && ObjectUtil.isNotEmpty(list1.getRecords().get(0).getCreatorTime()); + String now = isData ? DateUtil.dateFormat(list1.getRecords().get(0).getCreatorTime()) : DateUtil.getNow(); + JdbcUtil.creUpDe(new PrepSqlDTO( + XSSEscape.escapeEmpty(SqlFrameFastUtil.ADMINISTRATOR_DEL.replace("{userId}", userId))) + .withConn(dataSourceUtils, null)); + String sql = DbTypeUtil.checkOracle(dataSourceUtils) || DbTypeUtil.checkPostgre(dataSourceUtils) + ? SqlFrameFastUtil.INSERT_ADMINISTRATOR2 + : SqlFrameFastUtil.INSERT_ADMINISTRATOR; + String column_key = StringUtil.EMPTY, column_plceholder = StringUtil.EMPTY, + column_value = TenantDataSourceUtil.getTenantColumn(); + if (StringUtil.isNotEmpty(column_value)) { + column_key = StrPool.COMMA + configValueUtil.getMultiTenantColumn(); + column_plceholder = ",?"; + } + sql = sql.replace("%COLUMN_KEY%", column_key).replace("%COLUMN_PLACEHOLDER%", column_plceholder); + PrepSqlDTO dto = new PrepSqlDTO(sql).withConn(dataSourceUtils, null); + + for (OrganizeAdministratorEntity entity : list) { + List data = new LinkedList<>(); + data.add(RandomUtil.uuId()); + data.add(userId); + data.add(entity.getOrganizeId()); + data.add(entity.getOrganizeType()); + data.add(entity.getThisLayerAdd()); + data.add(entity.getThisLayerEdit()); + data.add(entity.getThisLayerDelete()); + data.add(entity.getSubLayerAdd()); + data.add(entity.getSubLayerEdit()); + data.add(entity.getSubLayerDelete()); + data.add(entity.getThisLayerSelect()); + data.add(entity.getSubLayerSelect()); + data.add(entity.getManagerGroup()); + data.add(now); + data.add(UserProvider.getLoginUserId()); + data.add(1); + if (StringUtil.isNotEmpty(column_value)) { + data.add(column_value); + } + dto.addMultiData(data); + } + JdbcUtil.creUpDeBatchOneSql(dto); + userService.delCurUser(MsgCode.PS010.get(), ImmutableList.of(userId), 2); + } catch (Exception e) { + e.printStackTrace(); + log.error("分级报错:" + e.getMessage()); + } + } + + @Override + public boolean update(String organizeId, OrganizeAdministratorEntity entity) { + entity.setId(entity.getId()); + entity.setLastModifyTime(DateUtil.getNowDate()); + entity.setLastModifyUserId(UserProvider.getLoginUserId()); + return this.updateById(entity); + } + + @Override + public boolean deleteByUserId(String userId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeAdministratorEntity::getUserId, userId); + boolean remove = this.remove(queryWrapper); + userService.delCurUser(MsgCode.PS010.get(), ImmutableList.of(userId), 2); + userService.updateStand(ImmutableList.of(userId), 2); + return remove; + } + + @Override + public List getInfoByUserId(String userId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeAdministratorEntity::getUserId, userId); + queryWrapper.lambda().eq(OrganizeAdministratorEntity::getEnabledMark, 1); + return this.list(queryWrapper); + } + + @Override + public OrganizeAdministratorEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeAdministratorEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void delete(OrganizeAdministratorEntity entity) { + this.removeById(entity.getId()); + } + + @Override + public String getManagerGroupByUserId(String userId) { + if (StringUtil.isEmpty(userId)) { + return null; + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeAdministratorEntity::getUserId, userId); + List list = this.list(queryWrapper); + return list.size() > 0 ? list.get(0).getManagerGroup() : null; + } + + @Override + public OrganizeAdministratorEntity getInfoByOrganizeId(String organizeId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeAdministratorEntity::getOrganizeId, organizeId); + return this.getOne(queryWrapper); + } + + @Override + public List getListByOrganizeId(List organizeIdList) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(OrganizeAdministratorEntity::getOrganizeId, organizeIdList); + return this.list(queryWrapper); + } + + @Override + public List getList(Pagination pagination) { + List list = getOrganizeAdministratorEntity(UserProvider.getLoginUserId(), + PermissionConst.ORGANIZE, false); + Map orgIdNameMaps = organizeService.getInfoList(); + List organizeIdList; + Map orgMaps = organizeService.getOrgMaps(null, true, null); + // 存放所有的有资格管理的组织id + if (UserProvider.getUser().getIsAdministrator()) { + organizeIdList = new ArrayList<>(orgMaps.keySet()); + } else { + Set orgId = new HashSet<>(16); + // 判断自己是哪些组织的管理员 + list.stream().forEach(t -> { + if (t != null) { + // t.getThisLayerAdd() == 1 || t.getThisLayerEdit() == 1 || + // t.getThisLayerDelete() == 1 || + // (StringUtil.isNotEmpty(String.valueOf(t.getSubLayerSelect())) && + // t.getThisLayerSelect() == 1) + if (t.getSubLayerSelect() != null && t.getThisLayerSelect() == 1) { + orgId.add(t.getOrganizeId()); + } + // t.getSubLayerAdd() == 1 || t.getSubLayerEdit() == 1 || t.getSubLayerDelete() + // == 1 || (StringUtil.isNotEmpty(String.valueOf(t.getSubLayerSelect())) && + // t.getSubLayerSelect() == 1) + if (t.getSubLayerSelect() != null && t.getSubLayerSelect() == 1) { + List underOrganizations = organizeService.getUnderOrganizations(t.getOrganizeId(), + true); + orgId.addAll(underOrganizations); + } + } + }); + organizeIdList = new ArrayList<>(orgId); + } + if (organizeIdList.size() < 1) { + organizeIdList.add(""); + } + List jsonToList = new ArrayList<>(); + List> organizeList = Lists.partition(organizeIdList, 1000); + List userId = new ArrayList<>(); + for (List objectId : organizeList) { + userId.addAll(userRelationService.getListByOrgId(objectId).stream().map(UserRelationEntity::getUserId) + .collect(Collectors.toList())); + } + userId.remove(UserProvider.getUser().getUserId()); + if (userId.isEmpty()) { + return jsonToList; + } + + QueryWrapper userWrapper = new QueryWrapper<>(); + userWrapper.lambda().select(UserEntity::getId, UserEntity::getAccount, UserEntity::getRealName, + UserEntity::getGender, UserEntity::getMobilePhone); + userWrapper.lambda().in(UserEntity::getId, userId); + userWrapper.lambda().eq(UserEntity::getEnabledMark, 1); + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + userWrapper.lambda().and( + t -> t.like(UserEntity::getRealName, pagination.getKeyword()) + .or().like(UserEntity::getAccount, pagination.getKeyword()) + .or().like(UserEntity::getMobilePhone, pagination.getKeyword())); + } + List userList = userService.list(userWrapper); + if (userList.isEmpty()) { + return jsonToList; + } + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().isNotNull(OrganizeAdministratorEntity::getManagerGroup); + queryWrapper.lambda().select(OrganizeAdministratorEntity::getUserId, + OrganizeAdministratorEntity::getCreatorTime, OrganizeAdministratorEntity::getManagerGroup); + queryWrapper.lambda().in(OrganizeAdministratorEntity::getUserId, + userList.stream().map(UserEntity::getId).collect(Collectors.toList())); + queryWrapper.lambda().orderByDesc(OrganizeAdministratorEntity::getCreatorTime); + List entityList = this.list(queryWrapper); + + List ids = new ArrayList<>(); + for (OrganizeAdministratorEntity entity : entityList) { + if (!ids.contains(entity.getUserId())) { + ids.add(entity.getUserId()); + } + } + + List listPage = PageUtil.getListPage((int) pagination.getCurrentPage(), (int) pagination.getPageSize(), ids); + if (!listPage.isEmpty()) { + List organizeAdminList = entityList.stream() + .filter(t -> listPage.contains(t.getUserId())).distinct() + .sorted(Comparator.comparing(OrganizeAdministratorEntity::getCreatorTime).reversed()) + .collect(Collectors.toList()); + for (OrganizeAdministratorEntity entity : organizeAdminList) { + UserEntity info = userList.stream().filter(t -> t.getId().equals(entity.getUserId())).findFirst() + .orElse(null); + if (info != null) { + OrganizeAdministratorListVo vo = JsonUtil.getJsonToBean(info, OrganizeAdministratorListVo.class); + // 所属组织 + List orgRelationByUserId = userRelationService + .getAllOrgRelationByUserId(entity.getUserId()); + StringBuilder orgName = new StringBuilder(); + orgRelationByUserId.stream().forEach(or -> { + OrganizeEntity organizeEntity = orgMaps.get(or.getObjectId()); + if (organizeEntity != null && StringUtil.isNotEmpty(organizeEntity.getOrganizeIdTree())) { + String fullNameByOrgIdTree = organizeService.getFullNameByOrgIdTree(orgIdNameMaps, + organizeEntity.getOrganizeIdTree(), "/"); + orgName.append("," + fullNameByOrgIdTree); + } + }); + // 组织名称 + String org = orgName.length() > 0 ? orgName.toString().replaceFirst(",", "") : ""; + vo.setOrganizeId(org); + vo.setManagerGroup(entity.getManagerGroup()); + vo.setCreatorTime(entity.getCreatorTime().getTime()); + jsonToList.add(vo); + } + } + } + return pagination.setData(jsonToList, ids.size()); + } + + @Override + public List getOrganizeUserList(String type) { + if (UserProvider.getUser().getIsAdministrator()) { + return organizeService.getList(true).stream().map(OrganizeEntity::getId).collect(Collectors.toList()); + } + List list = getOrganizeAdministratorEntity(UserProvider.getLoginUserId()); + Set orgId = new HashSet<>(16); + // 判断自己是哪些组织的管理员 + list.stream().forEach(t -> { + if (t != null) { + if (t.getSubLayerSelect() != null && t.getThisLayerSelect() == 1) { + orgId.add(t.getOrganizeId()); + } + if (t.getSubLayerSelect() != null && t.getSubLayerSelect() == 1) { + List underOrganizations = organizeService.getUnderOrganizations(t.getOrganizeId(), true); + orgId.addAll(underOrganizations); + } + } + }); + List orgIds = new ArrayList<>(orgId); + if (YunzhupaasConst.CURRENT_ORG_SUB.equals(type)) { + return orgIds; + } + List userList = userRelationService.getListByObjectIdAll(orgIds).stream() + .map(UserRelationEntity::getUserId).collect(Collectors.toList()); + return userList; + } + + @Override + public List getListByAuthorize() { + // 通过权限转树 + List listss = getOrganizeAdministratorEntity(UserProvider.getLoginUserId()); + Set orgIds = new HashSet<>(16); + // 判断自己是哪些组织的管理员 + listss.stream().forEach(t -> { + if (t != null) { + if (t.getThisLayerSelect() != null && t.getThisLayerSelect() == 1) { + orgIds.add(t.getOrganizeId()); + } + if (t.getSubLayerSelect() != null && t.getSubLayerSelect() == 1) { + List underOrganizations = organizeService.getUnderOrganizations(t.getOrganizeId(), true); + orgIds.addAll(underOrganizations); + } + } + }); + List list1 = new ArrayList<>(orgIds); + // 得到所有有权限的组织 + List organizeName = organizeService.getOrganizeName(list1); + return organizeName; + } + + @Override + public OrganizeAdministratorModel getOrganizeAdministratorList() { + // 通过权限转树 + List list = getOrganizeAdministratorEntity(UserProvider.getUser().getUserId()); + List addList = new ArrayList<>(); + List editList = new ArrayList<>(); + List deleteList = new ArrayList<>(); + List selectList = new ArrayList<>(); + // 判断自己是哪些组织的管理员 + list.forEach(t -> { + if (t != null) { + // 查询 + if (t.getThisLayerSelect() != null && t.getThisLayerSelect() == 1) { + selectList.add(t.getOrganizeId()); + // 修改 + if (t.getThisLayerEdit() != null && t.getThisLayerEdit() == 1) { + editList.add(t.getOrganizeId()); + } + // 删除 + if (t.getThisLayerDelete() != null && t.getThisLayerDelete() == 1) { + deleteList.add(t.getOrganizeId()); + } + // 新增 + if (t.getThisLayerAdd() != null && t.getThisLayerAdd() == 1) { + addList.add(t.getOrganizeId()); + } + } + // 查询 + if (t.getSubLayerSelect() != null && t.getSubLayerSelect() == 1) { + List underOrganizations = organizeService.getUnderOrganizations(t.getOrganizeId(), false); + selectList.addAll(underOrganizations); + // 修改 + if (t.getSubLayerEdit() != null && t.getSubLayerEdit() == 1) { + editList.addAll(underOrganizations); + } + // 删除 + if (t.getSubLayerDelete() != null && t.getSubLayerDelete() == 1) { + deleteList.addAll(underOrganizations); + } + // 新增 + if (t.getSubLayerAdd() != null && t.getSubLayerAdd() == 1) { + addList.addAll(underOrganizations); + } + } + } + }); + OrganizeAdministratorModel model = new OrganizeAdministratorModel(addList, editList, deleteList, selectList); + return model; + } + +} diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/OrganizeRelationServiceImpl.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/OrganizeRelationServiceImpl.java new file mode 100644 index 0000000..0cab77a --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/OrganizeRelationServiceImpl.java @@ -0,0 +1,362 @@ +package com.yunzhupaas.permission.service.impl; + +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.constant.YunzhupaasConst; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.constant.PermissionConst; +import com.yunzhupaas.permission.entity.*; +import com.yunzhupaas.permission.mapper.OrganizeRelationMapper; +import com.yunzhupaas.permission.model.organize.OrganizeConditionModel; +import com.yunzhupaas.permission.model.organize.OrganizeModel; +import com.yunzhupaas.permission.service.*; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +/** + *

+ * 组织关系 服务实现类 + *

+ * + * @author + * @since 2022-01-19 + */ +@Service +public class OrganizeRelationServiceImpl extends SuperServiceImpl + implements OrganizeRelationService { + + @Autowired + RoleService roleService; + @Autowired + PositionService positionService; + @Autowired + UserRelationService userRelationService; + @Autowired + UserService userService; + @Autowired + AuthorizeService authorizeService; + @Autowired + OrganizeService organizeService; + @Autowired + OrganizeAdministratorService organizeAdministratorService; + @Autowired + PermissionGroupService permissionGroupService; + + @Override + public List getRelationListByOrganizeId(List organizeIds) { + if (organizeIds.isEmpty()) { + return Collections.EMPTY_LIST; + } + QueryWrapper query = new QueryWrapper<>(); + query.lambda().in(OrganizeRelationEntity::getOrganizeId, organizeIds); + query.lambda().orderByDesc(OrganizeRelationEntity::getCreatorTime); + return this.list(query); + } + + @Override + public List getRelationListByOrganizeId(List organizeIds, String objectType) { + QueryWrapper query = new QueryWrapper<>(); + // 查询组织关系表集合 + if (StringUtil.isNotEmpty(objectType)) { + query.lambda().eq(OrganizeRelationEntity::getObjectType, objectType); + } + if (organizeIds.size() > 0) { + query.lambda().in(OrganizeRelationEntity::getOrganizeId, organizeIds); + } else { + organizeIds.add(""); + query.lambda().in(OrganizeRelationEntity::getOrganizeId, organizeIds); + } + query.lambda().orderByDesc(OrganizeRelationEntity::getCreatorTime); + return this.list(query); + } + + @Override + public List getPositionListByOrganizeId(List organizeIds) { + if (organizeIds.size() > 0) { + QueryWrapper query = new QueryWrapper<>(); + // 查询组织关系表集合 + query.lambda().eq(OrganizeRelationEntity::getObjectType, PermissionConst.POSITION); + query.lambda().in(OrganizeRelationEntity::getOrganizeId, organizeIds); + query.lambda().orderByDesc(OrganizeRelationEntity::getCreatorTime); + return this.list(query).stream().map(OrganizeRelationEntity::getObjectId).collect(Collectors.toList()); + } + return new ArrayList<>(); + } + + @Override + public List getRelationListByRoleId(String roleId) { + QueryWrapper query = new QueryWrapper<>(); + // 查询组织关系表集合 + query.lambda().eq(OrganizeRelationEntity::getObjectType, PermissionConst.ROLE); + query.lambda().in(OrganizeRelationEntity::getObjectId, roleId); + query.lambda().orderByDesc(OrganizeRelationEntity::getCreatorTime); + return this.list(query); + } + + @Override + public List getRelationListByRoleIdList(List roleId) { + QueryWrapper query = new QueryWrapper<>(); + // 查询组织关系表集合 + query.lambda().eq(OrganizeRelationEntity::getObjectType, PermissionConst.ROLE); + query.lambda().in(OrganizeRelationEntity::getObjectId, roleId); + query.lambda().orderByDesc(OrganizeRelationEntity::getCreatorTime); + return this.list(query); + } + + @Override + public List getRelationListByObjectIdAndType(String objectType, String objectId) { + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(OrganizeRelationEntity::getObjectId, objectId); + query.lambda().eq(OrganizeRelationEntity::getObjectType, objectType); + return this.list(query); + } + + @Override + public Boolean existByRoleIdAndOrgId(String roleId, String organizeId) { + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(OrganizeRelationEntity::getObjectType, PermissionConst.ROLE); + query.lambda().in(OrganizeRelationEntity::getObjectId, roleId); + query.lambda().in(OrganizeRelationEntity::getOrganizeId, organizeId); + return count(query) > 0; + } + + @Override + public Boolean existByObjTypeAndOrgId(String objectType, String organizeId) { + return existByObjAndOrgId(objectType, null, organizeId); + } + + @Override + public Boolean existByObjAndOrgId(String objectType, String objId, String organizeId) { + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(OrganizeRelationEntity::getObjectType, objectType); + if (StringUtil.isNotEmpty(objId)) { + query.lambda().eq(OrganizeRelationEntity::getObjectId, objId); + } + query.lambda().in(OrganizeRelationEntity::getOrganizeId, organizeId); + return count(query) > 0; + } + + @Override + public List getRelationListByType(String objectType) { + QueryWrapper query = new QueryWrapper<>(); + // 查询组织关系表集合 + query.lambda().eq(OrganizeRelationEntity::getObjectType, objectType); + query.lambda().orderByDesc(OrganizeRelationEntity::getCreatorTime); + return this.list(query); + } + + @Override + public List getListByTypeAndOrgId(String objectType, String orgId) { + QueryWrapper query = new QueryWrapper<>(); + // 查询组织关系表集合 + query.lambda().eq(OrganizeRelationEntity::getObjectType, objectType) + .eq(OrganizeRelationEntity::getOrganizeId, orgId); + return this.list(query); + } + + @Override + public Boolean deleteAllByRoleId(String roleId) { + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(OrganizeRelationEntity::getObjectType, PermissionConst.ROLE); + query.lambda().eq(OrganizeRelationEntity::getObjectId, roleId); + return this.remove(query); + } + + /* ========================== 自动切换岗位,组织相关 ============================== */ + + @Override + public String autoGetMajorPositionId(String userId, String currentMajorOrgId, String currentMajorPosId) { + // 属于该该组织底下的岗位 + List positionList = positionService.getListByOrgIdAndUserId(currentMajorOrgId, userId); + if (positionList.size() > 0) { + // 默认岗位是否在此组织内,若存在不做切换 + if (positionList.stream().anyMatch(p -> p.getId().equals(currentMajorPosId))) { + return currentMajorPosId; + } else { + // 默认第一个岗位 + return positionList.get(0).getId(); + } + } + return ""; + } + + @Override + public String autoGetMajorOrganizeId(String userId, List userAllOrgIds, String currentMajorOrgId, + String systemId) { + if (userAllOrgIds.size() > 0) { + if (userAllOrgIds.contains(currentMajorOrgId) + && checkBasePermission(userId, currentMajorOrgId, systemId).size() > 0) { + // 保持原默认组织不切换 + return currentMajorOrgId; + } else { + // 去除原本默认组织ID + List selectOrgIds = userAllOrgIds.stream().filter(usi -> !usi.equals(currentMajorOrgId)) + .collect(Collectors.toList()); + // 若不存在,强制切换有基本登录权限的角色 + for (String orgId : selectOrgIds) { + if (this.checkBasePermission(userId, orgId, systemId).size() > 0) { + // 这个组织ID底下角色存在基础登录权限 + return orgId; + } + } + } + // 随机赋值一个 + return userAllOrgIds.get(0); + } else { + return ""; + } + } + + /* == 自动key.equals == */ + + @Override + public void autoSetOrganize(List allUpdateUserIds) { + if (allUpdateUserIds.size() > 0) { + for (UserEntity userEntity : userService.listByIds(allUpdateUserIds)) { + String useId = userEntity.getId(); + String majorOrgId = userEntity.getOrganizeId(); + List orgList = userRelationService.getListByObjectType(useId, PermissionConst.ORGANIZE) + .stream().map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + String changeOrgId = this.autoGetMajorOrganizeId(useId, orgList, majorOrgId, null); + if (!changeOrgId.equals(majorOrgId)) { + // 切换默认组织 + UserEntity updateUserEntity = new UserEntity(); + updateUserEntity.setId(useId); + updateUserEntity.setOrganizeId(changeOrgId); + userService.updateById(updateUserEntity); + } + } + } + } + + @Override + public void autoSetPosition(List allUpdateUserIds) { + if (allUpdateUserIds.size() > 0) { + for (UserEntity user : userService.listByIds(allUpdateUserIds)) { + String majorPosId = user.getPositionId(); + String changePositionId = this.autoGetMajorPositionId(user.getId(), user.getOrganizeId(), majorPosId); + if (!changePositionId.equals(majorPosId)) { + UserEntity updateUser = new UserEntity(); + updateUser.setId(user.getId()); + updateUser.setPositionId(changePositionId); + userService.updateById(updateUser); + } + } + } + } + + /* ===================== 权限判断 ======================= */ + + @Override + public List checkBasePermission(String userId, String orgId, String systemId) { + List permissionGroupByUserId = permissionGroupService.getPermissionGroupByUserId(userId, + orgId, false, systemId); + return permissionGroupByUserId; + } + + @Override + public List getOrgIds(List departIds, String type) { + List idList = new ArrayList<>(16); + // 获取所有组织 + if (departIds.size() > 0) { + List collect = departIds.stream().filter(YunzhupaasConst.SYSTEM_PARAM.keySet()::contains) + .collect(Collectors.toList()); + String organizeId = UserProvider.getUser().getOrganizeId(); + collect.forEach(t -> { + if (YunzhupaasConst.CURRENT_ORG.equals(t) || YunzhupaasConst.CURRENT_ORG_TYPE.equals(t)) { + idList.add(organizeId + "--" + com.yunzhupaas.constant.PermissionConst.COMPANY); + idList.add(organizeId); + } else if (YunzhupaasConst.CURRENT_ORG_SUB.equals(t) + || YunzhupaasConst.CURRENT_ORG_SUB_TYPE.equals(t)) { + List underOrganizations = organizeService.getUnderOrganizations(organizeId, true); + underOrganizations.add(organizeId); + underOrganizations.forEach(orgId -> { + idList.add(orgId + "--" + com.yunzhupaas.constant.PermissionConst.COMPANY); + idList.add(orgId); + }); + } else if (YunzhupaasConst.CURRENT_GRADE.equals(t) || YunzhupaasConst.CURRENT_GRADE_TYPE.equals(t)) { + List organizeUserList = organizeAdministratorService + .getOrganizeUserList(YunzhupaasConst.CURRENT_ORG_SUB); + organizeUserList.forEach(orgId -> { + idList.add(orgId + "--" + com.yunzhupaas.constant.PermissionConst.COMPANY); + idList.add(orgId); + }); + } + }); + departIds.removeAll(collect); + idList.addAll(departIds); + for (String departId : departIds) { + String[] split = departId.split("--"); + if (split.length == 1 || split.length == 0) { + continue; + } + if (split.length > 1) { + if (com.yunzhupaas.constant.PermissionConst.ORGANIZE.equals(split[1])) { + departId = split[0]; + } + if (com.yunzhupaas.constant.PermissionConst.DEPARTMENT.equals(split[1])) { + departId = split[0]; + } + } + if (!com.yunzhupaas.constant.PermissionConst.ROLE.equals(type)) { + List underOrganizations = organizeService.getUnderOrganizations(departId, true); + if (underOrganizations.size() > 0) { + idList.addAll(underOrganizations); + idList.add(organizeId); + } + } + } + } + return idList.stream().distinct().collect(Collectors.toList()); + } + + @Override + public List getOrgIdsList(OrganizeConditionModel organizeConditionModel) { + List ids = new ArrayList<>(); + List orgIds = getOrgIds(organizeConditionModel.getDepartIds(), null); + Map orgIdNameMaps = Optional.ofNullable(organizeConditionModel.getOrgIdNameMaps()) + .orElse(organizeService.getInfoList()); + orgIds.forEach(t -> ids.add(t.split("--")[0])); + List listAll = organizeService.getListAll(ids, organizeConditionModel.getKeyword()); + List organizeList = JsonUtil.getJsonToList(listAll, OrganizeModel.class); + organizeList.forEach(t -> { + t.setIcon("department".equals(t.getType()) ? "icon-ym icon-ym-tree-department1" + : "icon-ym icon-ym-tree-organization3"); + t.setLastFullName(t.getFullName()); + if (StringUtil.isNotEmpty(t.getOrganizeIdTree())) { + t.setOrganizeIds(Arrays.asList(t.getOrganizeIdTree().split(","))); + t.setOrganize(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, t.getOrganizeIdTree(), "/")); + String[] split = t.getOrganizeIdTree().split(","); + List list = Arrays.asList(split); + Collections.reverse(list); + for (int i = 1; i < list.size(); i++) { + String orgId = list.get(i); + List collect1 = organizeList.stream().filter(tt -> orgId.equals(tt.getId())) + .collect(Collectors.toList()); + if (collect1.size() > 0) { + String[] split1 = StringUtil.isNotEmpty(t.getOrganizeIdTree()) + ? t.getOrganizeIdTree().split(orgId) + : new String[0]; + if (split1.length > 0) { + t.setFullName(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, split1[1], "/")); + } + t.setOrganize( + organizeService.getFullNameByOrgIdTree(orgIdNameMaps, t.getOrganizeIdTree(), "/")); + t.setParentId(orgId); + break; + } + } + } + }); + return organizeList; + } + +} diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/OrganizeServiceImpl.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/OrganizeServiceImpl.java new file mode 100644 index 0000000..8b161ad --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/OrganizeServiceImpl.java @@ -0,0 +1,1276 @@ +package com.yunzhupaas.permission.service.impl; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.google.common.collect.ImmutableMap; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.service.DictionaryDataService; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.constant.YunzhupaasConst; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.constant.PermissionConst; +import com.yunzhupaas.message.service.SynThirdDingTalkService; +import com.yunzhupaas.message.service.SynThirdQyService; +import com.yunzhupaas.permission.entity.OrganizeAdministratorEntity; +import com.yunzhupaas.permission.entity.OrganizeEntity; +import com.yunzhupaas.permission.entity.PositionEntity; +import com.yunzhupaas.permission.mapper.OrganizeMapper; +import com.yunzhupaas.permission.model.authorize.AuthorizeConditionEnum; +import com.yunzhupaas.permission.model.organize.OrganizeConditionModel; +import com.yunzhupaas.permission.model.organize.OrganizeModel; +import com.yunzhupaas.permission.model.organize.PaginationOrganize; +import com.yunzhupaas.permission.service.*; +import com.yunzhupaas.permission.util.PermissionUtil; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.enums.DictionaryDataEnum; +import com.yunzhupaas.util.treeutil.SumTree; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 组织机构 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +@Service +public class OrganizeServiceImpl extends SuperServiceImpl implements OrganizeService { + + @Autowired + private PositionService positionService; + @Autowired + private CacheKeyUtil cacheKeyUtil; + @Autowired + private UserService userService; + @Autowired + private RedisUtil redisUtil; + @Autowired + private UserRelationService userRelationService; + @Autowired + private OrganizeRelationService organizeRelationService; + @Autowired + private SynThirdQyService synThirdQyService; + @Autowired + private SynThirdDingTalkService synThirdDingTalkService; + @Autowired + private OrganizeAdministratorService organizeAdministratorService; + @Autowired + private DictionaryDataService dictionaryDataService; + + @Override + public List getListAll(List idAll, String keyWord) { + // 定义变量判断是否需要使用修改时间倒序 + boolean flag = false; + List list = new ArrayList<>(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(keyWord)) { + flag = true; + queryWrapper.lambda().and( + t -> t.like(OrganizeEntity::getFullName, keyWord) + .or().like(OrganizeEntity::getEnCode, keyWord)); + } + // 排序 + queryWrapper.lambda().orderByAsc(OrganizeEntity::getSortCode) + .orderByDesc(OrganizeEntity::getCreatorTime); + if (flag) { + queryWrapper.lambda().orderByDesc(OrganizeEntity::getLastModifyTime); + } + if (idAll.size() > 0) { + queryWrapper.lambda().in(OrganizeEntity::getId, idAll); + list = this.list(queryWrapper); + } + return list; + } + + @Override + public List getDepsByParentId(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeEntity::getParentId, id); + queryWrapper.lambda().eq(OrganizeEntity::getCategory, PermissionConst.DEPARTMENT); + queryWrapper.lambda().orderByAsc(OrganizeEntity::getSortCode) + .orderByDesc(OrganizeEntity::getCreatorTime); + List list = this.list(queryWrapper); + return list; + } + + @Override + public List getList(boolean filterEnabledMark) { + return getList(null, filterEnabledMark); + } + + @Override + public List getListByEnabledMark(Boolean enable) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (enable) { + queryWrapper.lambda().eq(OrganizeEntity::getEnabledMark, 1); + } + Map orgMaps = getBaseOrgMaps(queryWrapper, ImmutableMap.of( + OrganizeEntity::getSortCode, true, + OrganizeEntity::getCreatorTime, false), null, false); + + // Map entityList = new LinkedHashMap<>(); + // if (StringUtil.isNotEmpty(keyword)) { + // getParentOrganize(orgMaps, orgMaps, entityList); + // orgMaps.clear(); + // orgMaps = entityList; + // } + return new LinkedList<>(orgMaps.values()); + } + + @Override + public OrganizeEntity getInfoByFullName(String fullName) { + if (StringUtil.isEmpty(fullName)) { + return null; + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeEntity::getFullName, fullName); + List list = this.list(queryWrapper); + return list.size() > 0 ? list.get(0) : null; + } + + @Override + public List getList(String keyword, boolean filterEnabledMark) { + return new LinkedList<>(getOrgMaps(keyword, filterEnabledMark, null).values()); + } + + /** + * 获取组织信息 + * + * @return OrgId, OrgEntity + */ + @Override + public Map getOrgMapsAll(SFunction... columns) { + return getOrgMaps(null, false, null, columns); + } + + /** + * 获取组织信息 + * + * @param keyword + * @param filterEnabledMark + * @param type + * @return OrgId, OrgEntity + */ + @Override + public Map getOrgMaps(String keyword, boolean filterEnabledMark, String type, + SFunction... columns) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(keyword)) { + queryWrapper.lambda().and( + t -> t.like(OrganizeEntity::getFullName, keyword) + .or().like(OrganizeEntity::getEnCode, keyword.toLowerCase())); + } + if (filterEnabledMark) { + queryWrapper.lambda().eq(OrganizeEntity::getEnabledMark, 1); + } + if (StringUtil.isNotEmpty(type)) { + queryWrapper.lambda().eq(OrganizeEntity::getCategory, type); + } + Map orgMaps = getBaseOrgMaps(queryWrapper, ImmutableMap.of( + OrganizeEntity::getSortCode, true, + OrganizeEntity::getCreatorTime, false), null, false); + + Map entityList = new LinkedHashMap<>(); + if (StringUtil.isNotEmpty(keyword)) { + getParentOrganize(orgMaps, orgMaps, entityList); + orgMaps.clear(); + orgMaps = entityList; + } + return orgMaps; + } + + /** + * 组织基础过滤 + * + * @param queryWrapper + * @param orderBy Map + * @param groupBy Column + * @param columns query + * @return + */ + public Map getBaseOrgMaps(QueryWrapper queryWrapper, + Map, Boolean> orderBy, List> groupBy, + boolean bigColumnHas, SFunction... columns) { + if (queryWrapper == null) { + queryWrapper = new QueryWrapper<>(); + } + LambdaQueryWrapper lambdaQueryWrapper = queryWrapper.lambda(); + + List> columnList; + List> bigColumnList = null; + // 没有指定查询字段就返回全部字段 + if (columns == null || columns.length == 0) { + columnList = Arrays.asList(OrganizeEntity::getId, OrganizeEntity::getParentId, OrganizeEntity::getCategory, + OrganizeEntity::getEnCode, OrganizeEntity::getFullName, OrganizeEntity::getManagerId, + OrganizeEntity::getSortCode, OrganizeEntity::getEnabledMark, OrganizeEntity::getOrganizeIdTree, + OrganizeEntity::getCreatorTime, OrganizeEntity::getCreatorUserId, OrganizeEntity::getLastModifyTime, + OrganizeEntity::getLastModifyUserId, OrganizeEntity::getDeleteMark, OrganizeEntity::getDeleteTime, + OrganizeEntity::getDeleteUserId, OrganizeEntity::getTenantId); + // 把长文本字段分开查询, 默认带有排序, 数据量大的情况长文本字段参与排序速度非常慢 + if (bigColumnHas) { + bigColumnList = Arrays.asList( + OrganizeEntity::getId, + OrganizeEntity::getDescription, + OrganizeEntity::getPropertyJson); + } + } else { + columnList = new ArrayList<>(Arrays.asList(columns)); + // 指定字段中没有ID, 强制添加ID字段 + if (!columnList.contains((SFunction) OrganizeEntity::getId)) { + columnList.add(OrganizeEntity::getId); + } + } + lambdaQueryWrapper.select(columnList); + QueryWrapper bigColumnQuery = null; + if (bigColumnList != null) { + // 获取大字段不参与排序 + bigColumnQuery = queryWrapper.clone(); + } + // 排序 + if (orderBy != null && !orderBy.isEmpty()) { + orderBy.forEach((k, v) -> { + lambdaQueryWrapper.orderBy(true, v, k); + }); + } + // 分组 + if (groupBy != null && !groupBy.isEmpty()) { + lambdaQueryWrapper.groupBy(groupBy); + } + List list = this.list(queryWrapper); + + Map orgMaps = new LinkedHashMap<>(list.size(), 1); + list.forEach(t -> orgMaps.put(t.getId(), t)); + + if (bigColumnList != null) { + // 获取大字段数据 + bigColumnQuery.lambda().select(bigColumnList); + List listBigFields = this.list(bigColumnQuery); + listBigFields.forEach(t -> { + OrganizeEntity organizeEntity = orgMaps.get(t.getId()); + if (organizeEntity != null) { + organizeEntity.setPropertyJson(t.getPropertyJson()); + organizeEntity.setDescription(t.getDescription()); + } + }); + } + return orgMaps; + } + + /** + * 获取父级集合 + * + * @param list 需要遍历的集合 + * @param entityList 结果集 + */ + private void getParentOrganize(Map list, Map searchList, + Map entityList) { + Map list1 = new LinkedHashMap<>(); + searchList.forEach((id, entity) -> { + entityList.put(id, entity); + OrganizeEntity info = list.get(id); + if (info == null) { + info = getInfo(id); + } + if (Objects.nonNull(info)) { + if (StringUtil.isNotEmpty(info.getParentId()) && !"-1".equals(info.getParentId())) { + OrganizeEntity organizeEntity = list.get(info.getParentId()); + if (organizeEntity == null) { + organizeEntity = getInfo(info.getParentId()); + } + if (organizeEntity != null) { + list1.put(organizeEntity.getId(), organizeEntity); + getParentOrganize(list, list1, entityList); + } + } else if (StringUtil.isNotEmpty(info.getParentId()) && "-1".equals(info.getParentId())) { + entityList.put(id, info); + } + } + }); + } + + @Override + public List getOrgEntityList(List idList, Boolean enable) { + if (!idList.isEmpty()) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(OrganizeEntity::getId, idList); + if (enable) { + queryWrapper.lambda().eq(OrganizeEntity::getEnabledMark, 1); + } + // queryWrapper.lambda().select(OrganizeEntity::getId, + // OrganizeEntity::getFullName); + return this.list(queryWrapper); + } + return Collections.EMPTY_LIST; + } + + @Override + public List getOrgEntityList(Set idList) { + if (idList.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(OrganizeEntity::getId, OrganizeEntity::getFullName).in(OrganizeEntity::getId, + idList); + List list = this.list(queryWrapper); + return list; + } + return new ArrayList<>(); + } + + @Override + public Map getOrgMap() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(OrganizeEntity::getId, OrganizeEntity::getFullName); + List list = this.list(queryWrapper); + return list.stream().collect(Collectors.toMap(OrganizeEntity::getId, OrganizeEntity::getFullName)); + } + + @Override + public Map getOrgEncodeAndName(String type) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(OrganizeEntity::getId, OrganizeEntity::getFullName, OrganizeEntity::getEnCode); + queryWrapper.lambda().eq(OrganizeEntity::getCategory, type); + List list = this.list(queryWrapper); + return list.stream().collect( + Collectors.toMap(o -> o.getFullName() + "/" + o.getEnCode(), OrganizeEntity::getId, (v1, v2) -> v2)); + } + + @Override + public Map getOrgNameAndId(String type) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(OrganizeEntity::getId, OrganizeEntity::getFullName); + if (StringUtil.isNotEmpty(type)) { + queryWrapper.lambda().eq(OrganizeEntity::getCategory, type); + } + List list = this.list(queryWrapper); + Map allOrgMap = new HashMap<>(); + for (OrganizeEntity entity : list) { + allOrgMap.put(entity.getFullName(), entity.getId()); + } + return allOrgMap; + } + + @Override + public List getOrgRedisList() { + if (redisUtil.exists(cacheKeyUtil.getOrganizeList())) { + return JsonUtil.getJsonToList(redisUtil.getString(cacheKeyUtil.getOrganizeList()).toString(), + OrganizeEntity.class); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeEntity::getEnabledMark, 1); + + List list = this.list(queryWrapper); + if (list.size() > 0) { + redisUtil.insert(cacheKeyUtil.getOrganizeList(), JsonUtil.getObjectToString(list), 300); + } + return list; + } + + @Override + public OrganizeEntity getInfo(String id) { + return this.getById(id); + } + + @Override + public OrganizeEntity getByFullName(String fullName) { + OrganizeEntity organizeEntity = new OrganizeEntity(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeEntity::getFullName, fullName); + queryWrapper.lambda().select(OrganizeEntity::getId); + List list = this.list(queryWrapper); + if (list.size() > 0) { + organizeEntity = list.get(0); + } + return organizeEntity; + } + + @Override + public OrganizeEntity getByFullName(String fullName, String category, String enCode) { + OrganizeEntity organizeEntity = new OrganizeEntity(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeEntity::getFullName, fullName); + queryWrapper.lambda().eq(OrganizeEntity::getCategory, category); + queryWrapper.lambda().eq(OrganizeEntity::getEnCode, enCode); + queryWrapper.lambda().select(OrganizeEntity::getId); + List list = this.list(queryWrapper); + if (list.size() > 0) { + organizeEntity = list.get(0); + } + return organizeEntity; + } + + @Override + public boolean isExistByFullName(OrganizeEntity entity, boolean isCheck, boolean isFilter) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeEntity::getFullName, entity.getFullName()); + if (!isCheck) { + if (isFilter) { + queryWrapper.lambda().ne(OrganizeEntity::getId, entity.getId()); + } + List entityList = this.list(queryWrapper); + if (entityList.size() > 0) { + for (OrganizeEntity organizeEntity : entityList) { + if (organizeEntity != null && organizeEntity.getParentId().equals(entity.getParentId()) + && organizeEntity.getCategory().equals(entity.getCategory())) { + return true; + } + } + } + return false; + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public void getOrganizeIdTree(String organizeId, List organizeParentIdList) { + OrganizeEntity entity = getInfo(organizeId); + if (entity != null) { + organizeParentIdList.add(entity.getId()); + if (StringUtil.isNotEmpty(entity.getParentId())) { + getOrganizeIdTree(entity.getParentId(), organizeParentIdList); + } + } + } + + @Override + public void getOrganizeId(String organizeId, List organizeList) { + OrganizeEntity entity = getInfo(organizeId); + if (entity != null) { + organizeList.add(entity); + if (StringUtil.isNotEmpty(entity.getParentId())) { + getOrganizeId(entity.getParentId(), organizeList); + } + } + } + + @Override + public boolean isExistByEnCode(String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeEntity::getEnCode, enCode); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(OrganizeEntity::getId, id); + } + return this.count(queryWrapper) > 0; + } + + @Override + public void create(OrganizeEntity entity) { + if (StringUtil.isEmpty(entity.getId())) { + entity.setId(RandomUtil.uuId()); + } + + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + // 拼上当前组织id + String organizeIdTree = StringUtil.isNotEmpty(entity.getOrganizeIdTree()) ? entity.getOrganizeIdTree() + "," + : ""; + entity.setOrganizeIdTree(organizeIdTree + entity.getId()); + if (!UserProvider.getUser().getIsAdministrator()) { + // 当前用户创建的组织要赋予权限 + OrganizeAdministratorEntity organizeAdministratorEntity = new OrganizeAdministratorEntity(); + organizeAdministratorEntity.setUserId(UserProvider.getUser().getUserId()); + organizeAdministratorEntity.setOrganizeId(entity.getId()); + organizeAdministratorEntity.setThisLayerAdd(1); + organizeAdministratorEntity.setThisLayerEdit(1); + organizeAdministratorEntity.setThisLayerDelete(1); + organizeAdministratorEntity.setThisLayerSelect(1); + organizeAdministratorEntity.setSubLayerAdd(0); + organizeAdministratorEntity.setSubLayerEdit(0); + organizeAdministratorEntity.setSubLayerDelete(0); + organizeAdministratorEntity.setSubLayerSelect(0); + organizeAdministratorService.create(organizeAdministratorEntity); + } + this.save(entity); + redisUtil.remove(cacheKeyUtil.getOrganizeInfoList()); + } + + @Override + public boolean update(String id, OrganizeEntity entity) { + entity.setId(id); + entity.setLastModifyTime(DateUtil.getNowDate()); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + // 拼上当前组织id + String organizeIdTree = StringUtil.isNotEmpty(entity.getOrganizeIdTree()) ? entity.getOrganizeIdTree() + "," + : ""; + entity.setOrganizeIdTree(organizeIdTree + entity.getId()); + // 判断父级是否变化 + OrganizeEntity info = getInfo(id); + boolean updateById = this.updateById(entity); + if (info != null && !entity.getParentId().equals(info.getParentId())) { + // 子集和父级都需要修改父级树 + update(entity, info.getCategory()); + } + redisUtil.remove(cacheKeyUtil.getOrganizeInfoList()); + return updateById; + } + + @Override + public void update(OrganizeEntity entity, String category) { + // 查询子级 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeEntity::getParentId, entity.getId()); + if (PermissionConst.COMPANY.equals(category)) { + queryWrapper.lambda().eq(OrganizeEntity::getCategory, PermissionConst.COMPANY); + } else { + queryWrapper.lambda().eq(OrganizeEntity::getCategory, PermissionConst.DEPARTMENT); + } + List list = this.list(queryWrapper); + // 递归修改子组织的父级id字段 + for (OrganizeEntity organizeEntity : list) { + List list1 = new ArrayList<>(); + getOrganizeIdTree(organizeEntity.getId(), list1); + // 倒叙排放 + Collections.reverse(list1); + StringBuilder organizeIdTree = new StringBuilder(); + for (String organizeParentId : list1) { + organizeIdTree.append("," + organizeParentId); + } + String organizeParentIdTree = organizeIdTree.toString(); + if (StringUtil.isNotEmpty(organizeParentIdTree)) { + organizeParentIdTree = organizeParentIdTree.replaceFirst(",", ""); + } + organizeEntity.setOrganizeIdTree(organizeParentIdTree); + this.updateById(organizeEntity); + redisUtil.remove(cacheKeyUtil.getOrganizeInfoList()); + } + } + + @Override + public ActionResult delete(String orgId) { + String flag = this.allowDelete(orgId); + if (flag == null) { + OrganizeEntity organizeEntity = this.getInfo(orgId); + if (organizeEntity != null) { + this.removeById(orgId); + redisUtil.remove(cacheKeyUtil.getOrganizeInfoList()); + ThreadPoolExecutorUtil.getExecutor().execute(() -> { + try { + // 删除部门后判断是否需要同步到企业微信 + synThirdQyService.deleteDepartmentSysToQy(false, orgId, ""); + // 删除部门后判断是否需要同步到钉钉 + synThirdDingTalkService.deleteDepartmentSysToDing(false, orgId, ""); + } catch (Exception e) { + log.error("删除部门后同步失败到企业微信或钉钉失败,异常:" + e.getMessage()); + } + }); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } else { + return ActionResult.fail(MsgCode.PS001.get(flag)); + } + } + + @Override + @DSTransactional + public boolean first(String id) { + boolean isOk = false; + // 获取要上移的那条数据的信息 + OrganizeEntity upEntity = this.getById(id); + Long upSortCode = upEntity.getSortCode() == null ? 0 : upEntity.getSortCode(); + // 查询上几条记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .lt(OrganizeEntity::getSortCode, upSortCode) + .eq(OrganizeEntity::getParentId, upEntity.getParentId()) + .orderByDesc(OrganizeEntity::getSortCode); + List downEntity = this.list(queryWrapper); + if (downEntity.size() > 0) { + // 交换两条记录的sort值 + Long temp = upEntity.getSortCode(); + upEntity.setSortCode(downEntity.get(0).getSortCode()); + downEntity.get(0).setSortCode(temp); + this.updateById(downEntity.get(0)); + this.updateById(upEntity); + isOk = true; + } + return isOk; + } + + @Override + @DSTransactional + public boolean next(String id) { + boolean isOk = false; + // 获取要下移的那条数据的信息 + OrganizeEntity downEntity = this.getById(id); + Long upSortCode = downEntity.getSortCode() == null ? 0 : downEntity.getSortCode(); + // 查询下几条记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .gt(OrganizeEntity::getSortCode, upSortCode) + .eq(OrganizeEntity::getParentId, downEntity.getParentId()) + .orderByAsc(OrganizeEntity::getSortCode); + List upEntity = this.list(queryWrapper); + if (upEntity.size() > 0) { + // 交换两条记录的sort值 + Long temp = downEntity.getSortCode(); + downEntity.setSortCode(upEntity.get(0).getSortCode()); + upEntity.get(0).setSortCode(temp); + this.updateById(upEntity.get(0)); + this.updateById(downEntity); + isOk = true; + } + return isOk; + } + + @Override + public String allowDelete(String orgId) { + // 组织底下是否有组织 + List list = getListByParentId(orgId); + if (Objects.nonNull(list) && list.size() > 0) { + return MsgCode.PS003.get(); + } + // 组织底下是否有岗位 + List list1 = positionService.getListByOrganizeId(Collections.singletonList(orgId), false); + if (Objects.nonNull(list1) && list1.size() > 0) { + return MsgCode.PS004.get(); + } + // 组织底下是否有用户 + if (userRelationService.existByObj(PermissionConst.ORGANIZE, orgId)) { + return MsgCode.PS005.get(); + } + // 组织底下是否有角色 + if (organizeRelationService.existByObjTypeAndOrgId(PermissionConst.ROLE, orgId)) { + return MsgCode.PS006.get(); + } + return null; + } + + @Override + public List getOrganizeName(List id) { + List list = new ArrayList<>(); + if (id.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(OrganizeEntity::getId, id); + queryWrapper.lambda().orderByAsc(OrganizeEntity::getSortCode).orderByDesc(OrganizeEntity::getCreatorTime); + list = this.list(queryWrapper); + } + return list; + } + + @Override + public Map getOrganizeName(List id, String keyword, boolean filterEnabledMark, + String type) { + Map list = Collections.EMPTY_MAP; + if (id.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(OrganizeEntity::getId, id); + if (StringUtil.isNotEmpty(keyword)) { + queryWrapper.lambda().and( + t -> t.like(OrganizeEntity::getFullName, keyword) + .or().like(OrganizeEntity::getEnCode, keyword)); + } + if (StringUtil.isNotEmpty(type)) { + queryWrapper.lambda().eq(OrganizeEntity::getCategory, type); + } + if (filterEnabledMark) { + queryWrapper.lambda().eq(OrganizeEntity::getEnabledMark, 1); + } + list = getBaseOrgMaps(queryWrapper, ImmutableMap.of( + OrganizeEntity::getSortCode, true, + OrganizeEntity::getCreatorTime, false), null, false); + // Map orgList = new LinkedHashMap<>(id.size(), 1); + // orgMaps.values().forEach(t -> { + // if (StringUtil.isNotEmpty(t.getOrganizeIdTree())) { + // String[] split = t.getOrganizeIdTree().split(","); + // for (String orgId : split) { + // if (id.contains(orgId) && !orgList.containsKey(orgId)) { + // OrganizeEntity entity = orgMaps.get(orgId); + // if(entity == null){ + // entity = getInfo(orgId); + // } + // if (entity != null) { + // orgList.put(orgId, entity); + // } + // } + // } + // } + // }); + // list = orgList; + } + return list; + } + + @Override + public List getOrganizeNameSort(List id) { + List list = new ArrayList<>(); + for (String orgId : id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeEntity::getId, orgId); + queryWrapper.lambda().select(OrganizeEntity::getFullName); + OrganizeEntity entity = this.getOne(queryWrapper); + if (entity != null) { + list.add(entity); + } + } + return list; + } + + @Override + public List getOrganize(String organizeParentId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeEntity::getParentId, organizeParentId); + queryWrapper.lambda().select(OrganizeEntity::getId); + List list = this.list(queryWrapper).stream().map(t -> t.getId()).collect(Collectors.toList()); + return list; + } + + @Override + public List getOrganizeByOraParentId(String organizeParentId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeEntity::getParentId, organizeParentId); + // queryWrapper.lambda().select(OrganizeEntity::getId); + List list = this.list(queryWrapper); + return list.stream().map(t -> t.getId()).collect(Collectors.toList()); + } + + @Override + public List getUnderOrganizations(String organizeId, boolean filterEnabledMark) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (filterEnabledMark) { + queryWrapper.lambda().eq(OrganizeEntity::getEnabledMark, 1); + } + queryWrapper.lambda().ne(OrganizeEntity::getId, organizeId); + queryWrapper.lambda().like(OrganizeEntity::getOrganizeIdTree, organizeId); + queryWrapper.lambda().select(OrganizeEntity::getId); + return this.list(queryWrapper).stream().map(OrganizeEntity::getId).collect(Collectors.toList()); + } + + @Override + public List getUnderOrganizationss(String organizeId) { + List totalIds = this.getUnderOrganizations(organizeId, false); + if (!UserProvider.getUser().getIsAdministrator()) { + // 得到有权限的组织 + List collect = organizeAdministratorService.getListByAuthorize().stream().map(OrganizeEntity::getId) + .collect(Collectors.toList()); + totalIds = totalIds.stream().filter(t -> collect.contains(t)).collect(Collectors.toList()); + } + return totalIds; + } + + @Override + public List getListByFullName(String fullName) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeEntity::getFullName, fullName); + return this.list(queryWrapper); + } + + @Override + public List getListByParentId(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeEntity::getParentId, id); + return this.list(queryWrapper); + } + + @Override + public List getAllOrgByUserId(String userId) { + List ids = new ArrayList<>(); + userRelationService.getAllOrgRelationByUserId(userId).forEach(r -> { + ids.add(r.getObjectId()); + }); + return this.listByIds(ids); + } + + @Override + public String getFullNameByOrgIdTree(Map idNameMaps, String orgIdTree, String regex) { + if (idNameMaps == null || idNameMaps.isEmpty()) { + idNameMaps = this.getInfoList(); + } + String fullName = ""; + if (StringUtil.isNotEmpty(orgIdTree)) { + String[] split = orgIdTree.split(","); + StringBuilder orgName = new StringBuilder(); + String tmpName; + for (String orgId : split) { + if (StringUtil.isEmpty(orgIdTree)) { + continue; + } + if ((tmpName = idNameMaps.get(orgId)) != null) { + orgName.append(regex).append(tmpName); + } + } + if (orgName.length() > 0) { + fullName = orgName.toString().replaceFirst(regex, ""); + } + } + return fullName; + } + + @Override + public String getOrganizeIdTree(OrganizeEntity entity) { + List list = new ArrayList<>(); + this.getOrganizeIdTree(entity.getParentId(), list); + // 倒叙排放 + Collections.reverse(list); + StringBuilder organizeIdTree = new StringBuilder(); + for (String organizeParentId : list) { + organizeIdTree.append("," + organizeParentId); + } + String organizeParentIdTree = organizeIdTree.toString(); + if (StringUtil.isNotEmpty(organizeParentIdTree)) { + organizeParentIdTree = organizeParentIdTree.replaceFirst(",", ""); + } + return organizeParentIdTree; + } + + @Override + public List getOrganizeByParentId(String parentId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeEntity::getParentId, parentId); + return this.list(queryWrapper); + } + + @Override + public List getAllChild(String id) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(OrganizeEntity::getEnabledMark, 1).like(OrganizeEntity::getOrganizeIdTree, id); + return this.list(wrapper); + } + + @Override + public List getDepartmentAll(String organizeId) { + OrganizeEntity organizeCompany = getOrganizeCompany(organizeId); + if (null == organizeCompany) { + return new ArrayList<>(); + } + String id = organizeCompany.getId(); + List organizeList = new ArrayList<>(); + organizeList.add(organizeCompany); + List organizeEntityList = getListByParentId(id).stream() + .filter(t -> !PermissionConst.COMPANY.equals(t.getCategory())).collect(Collectors.toList()); + for (OrganizeEntity entity : organizeEntityList) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(OrganizeEntity::getEnabledMark, 1).like(OrganizeEntity::getOrganizeIdTree, + entity.getId()); + organizeList.addAll(this.list(wrapper)); + } + return organizeList; + } + + @Override + public OrganizeEntity getOrganizeCompany(String organizeId) { + OrganizeEntity entity = getInfo(organizeId); + return (entity != null && !PermissionConst.COMPANY.equals(entity.getCategory())) + ? getOrganizeCompany(entity.getParentId()) + : entity; + } + + @Override + public void getOrganizeDepartmentAll(String organizeId, List organizeList) { + List organizeEntityList = getListByParentId(organizeId); + for (OrganizeEntity entity : organizeEntityList) { + if (!PermissionConst.COMPANY.equals(entity.getCategory())) { + organizeList.add(entity); + getOrganizeDepartmentAll(entity.getId(), organizeList); + } + } + } + + @Override + public List getOrgIdTree(OrganizeEntity entity) { + List orgIds = new ArrayList<>(); + if (entity != null) { + String organizeIdTree = entity.getOrganizeIdTree(); + if (StringUtil.isNotEmpty(organizeIdTree)) { + String[] split = organizeIdTree.split(","); + for (String orgId : split) { + orgIds.add(orgId); + } + } + } + return orgIds; + } + + @Override + public List upWardRecursion(List orgIDs, String orgID) { + this.getOrgIDs(orgIDs, orgID); + return orgIDs; + } + + @Override + public Map getInfoList() { + if (redisUtil.exists(cacheKeyUtil.getOrganizeInfoList())) { + return new HashMap<>(redisUtil.getMap(cacheKeyUtil.getOrganizeInfoList())); + } else { + Map orgs = getOrgMaps(null, false, null, OrganizeEntity::getFullName); + Map infoMap = new LinkedHashMap<>(orgs.size(), 1); + orgs.forEach((k, v) -> infoMap.put(k, v.getFullName())); + redisUtil.insert(cacheKeyUtil.getOrganizeInfoList(), infoMap); + return infoMap; + } + } + + @Override + public List getListById(Boolean enable) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (enable) { + queryWrapper.lambda().eq(OrganizeEntity::getEnabledMark, 1); + } + return this.list(queryWrapper); + } + + @Override + public OrganizeEntity getInfoByParentId(String parentId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(OrganizeEntity::getParentId, parentId); + return this.getOne(queryWrapper); + } + + private void getOrgIDs(List orgIDs, String orgID) { + OrganizeEntity info = this.getInfo(orgID); + if (info != null) { + this.getOrgIDs(orgIDs, info.getParentId()); + orgIDs.add(info.getId()); + } + } + + /** + * 查询给定的条件是否有默认当前登录者的默认部门值 + * + * @param organizeConditionModel + * @return + */ + @Override + public String getDefaultCurrentValueDepartmentId(OrganizeConditionModel organizeConditionModel) { + UserInfo userInfo = UserProvider.getUser(); + int currentFinded = 0; + if (organizeConditionModel.getDepartIds() != null && !organizeConditionModel.getDepartIds().isEmpty() + && organizeConditionModel.getDepartIds().contains(userInfo.getOrganizeId())) { + currentFinded = 1; + } + if (currentFinded == 0 && organizeConditionModel.getDepartIds() != null + && !organizeConditionModel.getDepartIds().isEmpty()) { + List idList = new ArrayList<>(16); + // 获取所有组织 + if (organizeConditionModel.getDepartIds().size() > 0) { + idList.addAll(organizeConditionModel.getDepartIds()); + organizeConditionModel.getDepartIds().forEach(t -> { + List underOrganizations = getUnderOrganizations(t, false); + if (underOrganizations.size() > 0) { + idList.addAll(underOrganizations); + } + }); + } + Map orgIdNameMaps = this.getInfoList(); + List listAll = getListAll(idList, organizeConditionModel.getKeyword()); + List organizeList = JsonUtil.getJsonToList(listAll, OrganizeModel.class); + List collect = organizeList.stream().map(SumTree::getParentId).collect(Collectors.toList()); + List noParentId = organizeList.stream() + .filter(t -> !collect.contains(t.getId()) && !"-1".equals(t.getParentId())) + .collect(Collectors.toList()); + noParentId.forEach(t -> { + if (StringUtil.isNotEmpty(t.getOrganizeIdTree())) { + String[] split = t.getOrganizeIdTree().split(","); + List list = Arrays.asList(split); + Collections.reverse(list); + for (int i = 1; i < list.size(); i++) { + String orgId = list.get(i); + List collect1 = organizeList.stream().filter(tt -> orgId.equals(tt.getId())) + .collect(Collectors.toList()); + if (collect1.size() > 0) { + String[] split1 = StringUtil.isNotEmpty(t.getOrganizeIdTree()) + ? t.getOrganizeIdTree().split(orgId) + : new String[0]; + if (split1.length > 0) { + t.setFullName(getFullNameByOrgIdTree(orgIdNameMaps, split1[1], "/")); + } + t.setParentId(orgId); + break; + } + } + } + }); + + List orgLIdList = organizeList.stream().map(OrganizeModel::getId).collect(Collectors.toList()); + if (orgLIdList != null && !orgLIdList.isEmpty() && orgLIdList.contains(userInfo.getOrganizeId())) { + currentFinded = 1; + } + } + return (currentFinded == 1) ? userInfo.getOrganizeId() : ""; + } + + @Override + public Map getAllOrgsTreeName() { + Map map = new HashMap<>(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + List list = this.list(queryWrapper); + Map collect = list.stream() + .collect(Collectors.toMap(OrganizeEntity::getId, OrganizeEntity::getFullName)); + for (OrganizeEntity org : list) { + String organizeIdTree = org.getOrganizeIdTree(); + if (StringUtil.isEmpty(organizeIdTree)) { + organizeIdTree = org.getId(); + } + String[] split = organizeIdTree.split(","); + StringJoiner names = new StringJoiner("/"); + for (String id : split) { + names.add(collect.get(id)); + } + map.put(organizeIdTree, names.toString()); + } + return map; + } + + @Override + public Map getAllOrgsTreeName(boolean enabledMark) { + Map map = new HashMap<>(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (enabledMark) { + queryWrapper.lambda().eq(OrganizeEntity::getEnabledMark, 1); + } + List list = this.list(queryWrapper); + Map collect = list.stream() + .collect(Collectors.toMap(OrganizeEntity::getId, OrganizeEntity::getFullName)); + for (OrganizeEntity org : list) { + String organizeIdTree = org.getOrganizeIdTree(); + if (StringUtil.isEmpty(organizeIdTree)) { + organizeIdTree = org.getId(); + } + String[] split = organizeIdTree.split(","); + StringJoiner names = new StringJoiner("/"); + for (String id : split) { + names.add(collect.get(id)); + } + map.put(organizeIdTree, names.toString()); + } + return map; + } + + @Override + public List getPageList(List orgIds, PaginationOrganize pagination, + boolean filterEnabledMark) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + queryWrapper.lambda().and(t -> t.like(OrganizeEntity::getFullName, pagination.getKeyword()) + .or().like(OrganizeEntity::getEnCode, pagination.getKeyword())); + } + if (StringUtil.isNotEmpty(pagination.getType())) { + queryWrapper.lambda().eq(OrganizeEntity::getCategory, pagination.getType()); + } + if (!orgIds.isEmpty()) { + queryWrapper.lambda().in(OrganizeEntity::getId, orgIds); + } + if (filterEnabledMark) { + queryWrapper.lambda().eq(OrganizeEntity::getEnabledMark, 1); + } + queryWrapper.lambda().orderByAsc(OrganizeEntity::getSortCode); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage iPage = this.page(page, queryWrapper); + return pagination.setData(iPage.getRecords(), iPage.getTotal()); + } + + @Override + public List> getOrgTreeList(String category, String keyword) { + Map list = Collections.EMPTY_MAP; + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (!UserProvider.getUser().getIsAdministrator()) { + // 通过权限转树 + List listss = organizeAdministratorService + .getOrganizeAdministratorEntity(UserProvider.getUser().getUserId()); + Set orgIds = new HashSet<>(16); + // 判断自己是哪些组织的管理员 + listss.stream().forEach(t -> { + if (t != null) { + if (t.getThisLayerSelect() != null && t.getThisLayerSelect() == 1) { + orgIds.add(t.getOrganizeId()); + } + if (t.getSubLayerSelect() != null && t.getSubLayerSelect() == 1) { + List underOrganizations = this.getUnderOrganizations(t.getOrganizeId(), true); + orgIds.addAll(underOrganizations); + } + } + }); + List list1 = new ArrayList<>(orgIds); + if (list1.size() > 0) { + queryWrapper.lambda().in(OrganizeEntity::getId, list1); + } else { + return new ArrayList<>(); + } + } + if (StringUtil.isNotEmpty(category)) { + queryWrapper.lambda().eq(OrganizeEntity::getCategory, category); + } + if (StringUtil.isNotEmpty(keyword)) { + queryWrapper.lambda().and(t -> t.like(OrganizeEntity::getFullName, keyword) + .or().like(OrganizeEntity::getEnCode, keyword)); + } + queryWrapper.lambda().eq(OrganizeEntity::getEnabledMark, 1); + list = getBaseOrgMaps(queryWrapper, ImmutableMap.of( + OrganizeEntity::getSortCode, true, + OrganizeEntity::getCreatorTime, false), null, true); + + List> finalModels = new ArrayList<>(); + // 类型 + Map typeMap = new HashMap() { + { + put(PermissionConst.COMPANY, "公司"); + put(PermissionConst.DEPARTMENT, "部门"); + } + }; + // 企业性质 + List enList = dictionaryDataService + .getByTypeCodeEnable(DictionaryDataEnum.ENTERPRISE_NATURE.getDictionaryTypeId()); + Map enMap = enList.stream() + .collect(Collectors.toMap(DictionaryDataEntity::getId, DictionaryDataEntity::getFullName)); + // 行业类别 + List itList = dictionaryDataService + .getByTypeCodeEnable(DictionaryDataEnum.INDUSTRY_TYPE.getDictionaryTypeId()); + Map itMap = itList.stream() + .collect(Collectors.toMap(DictionaryDataEntity::getId, DictionaryDataEntity::getFullName)); + + List allManagerId = new ArrayList<>(); + Map orgMapsModel = this.getInfoList(); + Map finalList = list; + list.values().forEach(t -> { + Map obj = JsonUtil.entityToMap(t); + String propertyJson = t.getPropertyJson(); + if (StringUtil.isNotEmpty(propertyJson)) { + Map propertyMap = JsonUtil.stringToMap(propertyJson); + if (ObjectUtil.isNotEmpty(propertyMap)) { + if (propertyMap.get("enterpriseNature") != null) { + String enterpriseNature = propertyMap.get("enterpriseNature").toString(); + propertyMap.put("enterpriseNature", enMap.get(enterpriseNature)); + } + if (propertyMap.get("industry") != null) { + String enterpriseNature = propertyMap.get("industry").toString(); + propertyMap.put("industry", itMap.get(enterpriseNature)); + } + obj.putAll(propertyMap); + } + } + String organizeIdTree = t.getOrganizeIdTree(); + if (StringUtil.isNotEmpty(organizeIdTree)) { + List split = Arrays.asList(t.getOrganizeIdTree().split(",")); + Collections.reverse(split); + for (String orgId : split) { + if (!orgId.equals(t.getId())) { + OrganizeEntity organizeEntity = finalList.get(orgId); + if (organizeEntity != null) { + obj.put("parentId", organizeEntity.getId()); + break; + } + } + } + String allName = this.getFullNameByOrgIdTree(orgMapsModel, organizeIdTree, "/"); + // 父级名称 + if (allName.contains("/")) { + String parentId = allName.substring(0, allName.lastIndexOf("/")); + obj.put("parentName", parentId); + } + } + if (StringUtil.isNotEmpty(t.getCategory())) { + obj.put("category", typeMap.get(t.getCategory())); + } + if (StringUtil.isNotEmpty(t.getManagerId())) { + allManagerId.add(t.getManagerId()); + } + finalModels.add(obj); + }); + List> treeObj = PermissionUtil.getTreeObj(finalModels, "parentId", "id"); + List> realList = PermissionUtil.getListFromTree(treeObj); + Map userMap = userService.getUserName(allManagerId, true).stream().collect(HashMap::new, + (k, v) -> k.put(v.getId(), v.getRealName() + "/" + v.getAccount()), HashMap::putAll); + // 数据转换 + realList.stream().forEach(t -> { + if (t.get("managerId") != null) { + t.put("managerId", userMap.get(t.get("managerId").toString())); + } + if (t.get("parentName") != null) { + t.put("parentId", t.get("parentName")); + } else { + t.put("parentId", ""); + } + if (t.get("foundedTime") != null && StringUtil.isNotEmpty(t.get("foundedTime").toString())) { + t.put("foundedTime", DateUtil.daFormat(Long.parseLong(t.get("foundedTime").toString()))); + } + }); + return realList; + } + + @Override + public String[] myOrgArray() { + List> orgTreeList = this.getOrgTreeList(null, null); + String[] organizeId = orgTreeList.stream().map(t -> { + if (t.get("parentName") != null) { + return t.get("parentName") + "/" + t.get("fullName"); + } else { + return t.get("fullName"); + } + }).toArray(String[]::new); + return organizeId; + } + + @Override + public String getUserTreeOrgStr(AuthorizeConditionEnum conditionType) { + String res = ""; + UserInfo userInfo = UserProvider.getUser(); + String orgId = userInfo.getOrganizeId(); + if (StringUtil.isNotEmpty(userInfo.getDepartmentId())) { + orgId = userInfo.getDepartmentId(); + } + switch (conditionType) { + case ORGANIZE:// 当前组织 + List orgIds = new ArrayList<>(); + orgIds.add(orgId); + List> orgAllPathList = getOrgAllPathList(orgIds); + res = CollectionUtil.isNotEmpty(orgAllPathList) ? JsonUtil.getObjectToString(orgAllPathList.get(0)) + : ""; + break; + case ORGANIZEANDUNDER: // 当前组织及子组织 + List underOrganizations = this.getUnderOrganizations(orgId, false); + underOrganizations.add(orgId); + res = getOrgAllPath(underOrganizations); + break; + case BRANCHMANAGEORG:// 当前分管组织 + List orgManageIds = organizeAdministratorService + .getOrganizeUserList(YunzhupaasConst.CURRENT_ORG_SUB); + res = getOrgAllPath(orgManageIds); + break; + } + return res; + } + + /** + * 获取组织全路径 + * + * @param allIdList 组织id列表。 + * @return + */ + private String getOrgAllPath(List allIdList) { + List> orgAllPathList = getOrgAllPathList(allIdList); + return JsonUtil.getObjectToString(orgAllPathList); + } + + /** + * 获取组织全路径 + * + * @param allIdList 组织id列表。 + * @return + */ + private List> getOrgAllPathList(List allIdList) { + List> resOrg = new ArrayList<>(); + for (String itemOrg : allIdList) { + OrganizeEntity organizeEntity = this.getInfo(itemOrg); + if (organizeEntity != null) { + if (StringUtil.isNotEmpty(organizeEntity.getOrganizeIdTree())) { + String[] split = organizeEntity.getOrganizeIdTree().split(","); + if (split.length > 0) { + resOrg.add(Arrays.asList(split)); + } + } + } + } + return resOrg; + } + +} diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/PermissionGroupServiceImpl.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/PermissionGroupServiceImpl.java new file mode 100644 index 0000000..37a1670 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/PermissionGroupServiceImpl.java @@ -0,0 +1,590 @@ +package com.yunzhupaas.permission.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.constant.PermissionConst; +import com.yunzhupaas.message.util.SynThirdConsts; +import com.yunzhupaas.permission.constant.AuthorizeConst; +import com.yunzhupaas.permission.entity.*; +import com.yunzhupaas.permission.mapper.PermissionGroupMapper; +import com.yunzhupaas.permission.model.permissiongroup.PaginationPermissionGroup; +import com.yunzhupaas.permission.service.*; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.type.AuthorizeType; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +@Service +public class PermissionGroupServiceImpl extends SuperServiceImpl implements PermissionGroupService { + + @Autowired + private UserService userService; + @Autowired + private UserRelationService userRelationService; + @Autowired + private OrganizeRelationService organizeRelationService; + @Autowired + private RoleService roleService; + @Autowired + private PositionService positionService; + @Autowired + private GroupService groupService; + @Autowired + private AuthorizeService authorizeService; + @Autowired + private OrganizeService organizeService; + + @Override + public List list(PaginationPermissionGroup pagination) { + boolean flag = false; + QueryWrapper queryWrapper = new QueryWrapper<>(); + String keyword = pagination.getKeyword(); + if (StringUtil.isNotEmpty(keyword)) { + flag = true; + queryWrapper.lambda().and( + t -> t.like(PermissionGroupEntity::getFullName, keyword) + .or().like(PermissionGroupEntity::getEnCode, keyword) + .or().like(PermissionGroupEntity::getDescription, keyword) + ); + } + if (pagination.getEnabledMark() != null) { + queryWrapper.lambda().eq(PermissionGroupEntity::getEnabledMark, pagination.getEnabledMark()); + } + queryWrapper.lambda().orderByAsc(PermissionGroupEntity::getSortCode).orderByDesc(PermissionGroupEntity::getCreatorTime); + if (flag) { + queryWrapper.lambda().orderByDesc(PermissionGroupEntity::getLastModifyTime); + } + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage iPage = this.page(page, queryWrapper); + return pagination.setData(iPage.getRecords(), iPage.getTotal()); + } + + @Override + public List list(boolean filterEnabledMark, List ids) { + if (ids != null && ids.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (filterEnabledMark) { + queryWrapper.lambda().eq(PermissionGroupEntity::getEnabledMark, 1); + } + if (ids != null && ids.size() > 0) { + queryWrapper.lambda().in(PermissionGroupEntity::getId, ids); + } + return this.list(queryWrapper); + } + + @Override + public PermissionGroupEntity info(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(PermissionGroupEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public boolean create(PermissionGroupEntity entity) { + entity.setId(RandomUtil.uuId()); + return this.save(entity); + } + + @Override + public boolean update(String id, PermissionGroupEntity entity) { + entity.setId(id); + return this.updateById(entity); + } + + @Override + public boolean delete(PermissionGroupEntity entity) { + return this.removeById(entity); + } + + @Override + public boolean isExistByFullName(String id, PermissionGroupEntity entity) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(PermissionGroupEntity::getFullName, entity.getFullName()); + if (StringUtil.isNotEmpty(id)) { + queryWrapper.lambda().ne(PermissionGroupEntity::getId, id); + } + return this.count(queryWrapper) > 0; + } + + @Override + public boolean isExistByEnCode(String id, PermissionGroupEntity entity) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(PermissionGroupEntity::getEnCode, entity.getEnCode()); + if (StringUtil.isNotEmpty(id)) { + queryWrapper.lambda().ne(PermissionGroupEntity::getId, id); + } + return this.count(queryWrapper) > 0; + } + + @Override + public PermissionGroupEntity permissionMember(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(PermissionGroupEntity::getId, id); + queryWrapper.lambda().select(PermissionGroupEntity::getId, PermissionGroupEntity::getPermissionMember); + return this.getOne(queryWrapper); + } + + @Override + public List getPermissionGroupByUserId(String userId, String organizeId, boolean singletonOrg, String systemId) { + List list = new ArrayList<>(); + // 用户本身有没有权限 + UserEntity userEntity = userService.getInfo(userId); + if (userEntity == null) { + return list; + } + List allGroupList = this.list(true, null).stream().filter(t -> Objects.equals(0,t.getType())).collect(Collectors.toList()); + allGroupList.forEach(permissionGroupEntity -> { + if (authorizeService.existAuthorize(permissionGroupEntity.getId(), systemId)) { + list.add(permissionGroupEntity); + } + }); + List permissionGroupEntities = this.list(true, null).stream().filter(t -> StringUtil.isNotEmpty(t.getPermissionMember())).collect(Collectors.toList()); + String finalUserId = userId + "--" + PermissionConst.USER; + List collect = permissionGroupEntities.stream().filter(entity -> entity.getPermissionMember().contains(finalUserId)).collect(Collectors.toList()); + collect.forEach(permissionGroupEntity -> { + if (authorizeService.existAuthorize(permissionGroupEntity.getId(), systemId)) { + list.add(permissionGroupEntity); + } + }); + // 用户关系表 + List listByUserId = userRelationService.getListByUserId(userEntity.getId()).stream().filter(r -> StringUtil.isNotEmpty(r.getObjectId())).collect(Collectors.toList()); + // 分组有没有权限 + List groupIds = new ArrayList<>(); + List groupId = listByUserId.stream().filter(t -> PermissionConst.GROUP.equals(t.getObjectType())) + .map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + List groupName = groupService.getListByIds(groupId, true) + .stream().map(GroupEntity::getId).collect(Collectors.toList()); + groupName.forEach(t -> groupIds.add(t + "--group")); + for (String id : groupIds) { + List collect1 = permissionGroupEntities.stream().filter(entity -> entity.getPermissionMember().contains(id)).collect(Collectors.toList()); + collect1.forEach(permissionGroupEntity -> { + if (authorizeService.existAuthorize(permissionGroupEntity.getId(), systemId)) { + list.add(permissionGroupEntity); + } + }); + } + // 全局角色如果有权限 + List roleAllList = listByUserId.stream().filter(t -> PermissionConst.ROLE.equals(t.getObjectType())) + .map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + List globalList = roleService.getGlobalList(roleAllList) + .stream().map(RoleEntity::getId).collect(Collectors.toList()); + for (String id : globalList) { + List collect1 = permissionGroupEntities.stream() + .filter(entity -> entity.getPermissionMember().contains(id + "--role")).collect(Collectors.toList()); + collect1.forEach(permissionGroupEntity -> { + if (authorizeService.existAuthorize(permissionGroupEntity.getId(), systemId)) { + list.add(permissionGroupEntity); + } + }); + } + + // 组织有权限 + List organizeIds = new ArrayList<>(); + List orgIds = new ArrayList<>(); + if(list.size() > 0) { + // 当前组织及组织下岗位、角色权限组 + organizeIds.add(userEntity.getOrganizeId()); + } else { + // 此情况下不找 + if (StringUtil.isNotEmpty(organizeId)) { + organizeIds.add(organizeId); + } else { + // 找到一个有权限的组织、岗位、角色 + List listByObjectType = userRelationService.getListByObjectType(userId, PermissionConst.ORGANIZE); + List collect2 = listByObjectType.stream().map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + organizeIds.addAll(collect2); + organizeIds.add(userEntity.getOrganizeId()); + } + } + // 拼上后缀 + if (organizeIds.size() > 0) { + List collect1 = new ArrayList<>(); + collect1.addAll(organizeService.getOrgEntityList(organizeIds, true) + .stream().map(OrganizeEntity::getId).collect(Collectors.toList())); + orgIds.addAll(collect1); + collect1.forEach(t -> { + orgIds.add(t + "--" + PermissionConst.COMPANY); + orgIds.add(t + "--" + PermissionConst.DEPARTMENT); + }); + } + List relationListByOrganizeId = organizeRelationService.getRelationListByOrganizeId(organizeIds); + List orgList = new ArrayList<>(); + List listByOrganizeId = positionService.getListByOrganizeId(orgIds, false); + for (String oId : orgIds) { + List collect1 = permissionGroupEntities.stream().filter(entity -> entity.getPermissionMember().contains(oId)).collect(Collectors.toList()); + collect1.forEach(permissionGroupEntity -> { + if (authorizeService.existAuthorize(permissionGroupEntity.getId(), systemId)) { + orgList.add(permissionGroupEntity); + } + }); + + // 判断该组织下的岗位是否有权限 + List positionListByTypeAndOrgId = listByOrganizeId.stream().filter(t -> t.getOrganizeId().equals(oId)) + .map(PositionEntity::getId).collect(Collectors.toList()); + List positionId = listByUserId.stream().filter(t -> PermissionConst.POSITION.equals(t.getObjectType())) + .map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + List containsPosition = positionListByTypeAndOrgId.stream().filter(positionId::contains).collect(Collectors.toList()); + List positionName = positionService.getPositionName(containsPosition, true) + .stream().map(PositionEntity::getId).collect(Collectors.toList()); + for (String id : positionName) { + List collect2 = permissionGroupEntities.stream().filter(entity -> entity.getPermissionMember().contains(id + "--position")).collect(Collectors.toList()); + collect2.forEach(permissionGroupEntity -> { + if (authorizeService.existAuthorize(permissionGroupEntity.getId(), systemId)) { + orgList.add(permissionGroupEntity); + } + }); + } + // 判断该组织下的角色是否有权限 + List roleListByTypeAndOrgId = relationListByOrganizeId.stream().filter(t -> PermissionConst.ROLE.equals(t.getObjectType())) + .map(OrganizeRelationEntity::getObjectId).collect(Collectors.toList()); + List roleId = listByUserId.stream().filter(t -> PermissionConst.ROLE.equals(t.getObjectType())) + .map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + List roleName = roleService.getListByIds(roleId, null, true) + .stream().filter(t -> t.getGlobalMark() != 1).collect(Collectors.toList()); + List containsRole = roleName.stream().filter(t -> roleListByTypeAndOrgId.contains(t.getId())).collect(Collectors.toList()) + .stream().map(RoleEntity::getId).collect(Collectors.toList());; + for (String id : containsRole) { + List collect2 = permissionGroupEntities.stream().filter(entity -> entity.getPermissionMember().contains(id + "--role")).collect(Collectors.toList()); + collect2.forEach(permissionGroupEntity -> { + if (authorizeService.existAuthorize(permissionGroupEntity.getId(), systemId)) { + orgList.add(permissionGroupEntity); + } + }); + } + if (orgList.size() > 0) { + if (!singletonOrg) { + break; + } + } + } + list.addAll(orgList); + return list; + } + + @Override + public String getPermissionGroupByUserId(String userId) { + // 用户本身有没有权限 + UserEntity userEntity = userService.getInfo(userId); + if (userEntity == null) { + return ""; + } + List allGroupList = this.list(true, null).stream().filter(t -> Objects.equals(0,t.getType())).collect(Collectors.toList()); + for (PermissionGroupEntity permissionGroupEntity : allGroupList) { + if (authorizeService.existAuthorize(permissionGroupEntity.getId(), null)) { + return ""; + } + } + List permissionGroupEntities = this.list(true, null).stream().filter(t -> StringUtil.isNotEmpty(t.getPermissionMember())).collect(Collectors.toList()); + String finalUserId = userId + "--" + PermissionConst.USER; + List collect = permissionGroupEntities.stream().filter(entity -> entity.getPermissionMember().contains(finalUserId)).collect(Collectors.toList()); + for (PermissionGroupEntity permissionGroupEntity : collect) { + if (authorizeService.existAuthorize(permissionGroupEntity.getId(), null)) { + return ""; + } + } + // 用户关系表 + List listByUserId = userRelationService.getListByUserId(userEntity.getId()); + // 分组有没有权限 + List groupIds = new ArrayList<>(); + List groupId = listByUserId.stream().filter(t -> PermissionConst.GROUP.equals(t.getObjectType())) + .map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + List groupName = groupService.getListByIds(groupId, true) + .stream().map(GroupEntity::getId).collect(Collectors.toList()); + groupName.forEach(t -> groupIds.add(t + "--group")); + for (String id : groupIds) { + List collect1 = permissionGroupEntities.stream().filter(entity -> entity.getPermissionMember().contains(id)).collect(Collectors.toList()); + for (PermissionGroupEntity permissionGroupEntity : collect1) { + if (authorizeService.existAuthorize(permissionGroupEntity.getId(), null)) { + return ""; + } + } + } + // 全局角色如果有权限 + List roleAllList = listByUserId.stream().filter(t -> PermissionConst.ROLE.equals(t.getObjectType())) + .map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + List globalList = roleService.getGlobalList(roleAllList) + .stream().map(RoleEntity::getId).collect(Collectors.toList()); + for (String id : globalList) { + List collect1 = permissionGroupEntities.stream() + .filter(entity -> entity.getPermissionMember().contains(id + "--role")).collect(Collectors.toList()); + for (PermissionGroupEntity permissionGroupEntity : collect1) { + if (authorizeService.existAuthorize(permissionGroupEntity.getId(), null)) { + return ""; + } + } + } + + // 组织有权限 + List orgIds = new ArrayList<>(); + List listByObjectType = userRelationService.getListByObjectType(userId, PermissionConst.ORGANIZE); + List collect2 = new ArrayList<>(); + collect2.add(userEntity.getOrganizeId()); + collect2.addAll(listByObjectType.stream().map(UserRelationEntity::getObjectId).collect(Collectors.toList())); + orgIds.addAll(collect2); + collect2.forEach(t -> { + orgIds.add(t + "--" + PermissionConst.COMPANY); + orgIds.add(t + "--" + PermissionConst.DEPARTMENT); + }); + List relationListByOrganizeId = organizeRelationService.getRelationListByOrganizeId(collect2); + List listByOrganizeId = positionService.getListByOrganizeId(orgIds, false); + for (String orgId : orgIds) { + List collect1 = permissionGroupEntities.stream().filter(entity -> entity.getPermissionMember().contains(orgId)).collect(Collectors.toList()); + for (PermissionGroupEntity permissionGroupEntity : collect1) { + if (authorizeService.existAuthorize(permissionGroupEntity.getId(), null)) { + return orgId.split("--")[0]; + } + } + // 判断该组织下的岗位是否有权限 + List positionListByTypeAndOrgId = listByOrganizeId.stream().filter(t -> t.getOrganizeId().equals(orgId)) + .map(PositionEntity::getId).collect(Collectors.toList()); + List positionId = listByUserId.stream().filter(t -> PermissionConst.POSITION.equals(t.getObjectType())) + .map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + List containsPosition = positionListByTypeAndOrgId.stream().filter(positionId::contains).collect(Collectors.toList()); + List positionName = positionService.getPositionName(containsPosition, true) + .stream().map(PositionEntity::getId).collect(Collectors.toList()); + for (String id : positionName) { + List collect3 = permissionGroupEntities.stream().filter(entity -> entity.getPermissionMember().contains(id + "--position")).collect(Collectors.toList()); + for (PermissionGroupEntity permissionGroupEntity : collect3) { + if (authorizeService.existAuthorize(permissionGroupEntity.getId(), null)) { + return orgId.split("--")[0]; + } + } + } + // 判断该组织下的角色是否有权限 + List roleListByTypeAndOrgId = relationListByOrganizeId.stream().filter(t -> PermissionConst.ROLE.equals(t.getObjectType())) + .map(OrganizeRelationEntity::getObjectId).collect(Collectors.toList()); + List roleId = listByUserId.stream().filter(t -> PermissionConst.ROLE.equals(t.getObjectType())) + .map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + List roleName = roleService.getListByIds(roleId, null, true) + .stream().filter(t -> t.getGlobalMark() != 1).collect(Collectors.toList()); + List containsRole = roleName.stream().filter(t -> roleListByTypeAndOrgId.contains(t.getId())).collect(Collectors.toList()) + .stream().map(RoleEntity::getId).collect(Collectors.toList());; + for (String id : containsRole) { + List collect3 = permissionGroupEntities.stream().filter(entity -> entity.getPermissionMember().contains(id + "--role")).collect(Collectors.toList()); + for (PermissionGroupEntity permissionGroupEntity : collect3) { + if (authorizeService.existAuthorize(permissionGroupEntity.getId(), null)) { + return orgId.split("--")[0]; + } + } + } + } + return ""; + } + + @Override + public String getOrgIdByUserIdAndSystemId(String userId, String systemId) { + // 用户本身有没有权限 + UserEntity userEntity = userService.getInfo(userId); + if (userEntity == null) { + return ""; + } + // 判断有这个应用的权限组有哪些 + List collect = authorizeService.getListByObjectAndItemIdAndType(systemId, PermissionConst.SYSTEM).stream().map(AuthorizeEntity::getObjectId).collect(Collectors.toList()); + List list = this.list(true, collect).stream().filter(t -> StringUtil.isNotEmpty(t.getPermissionMember())).collect(Collectors.toList()); + List allGroupList = this.list(true, collect).stream().filter(t -> Objects.equals(0,t.getType())).collect(Collectors.toList()); + if(allGroupList.size()>0){ + return ""; + } + + List objectIds = new ArrayList<>(); + objectIds.add(userId + "--" + PermissionConst.USER); + // 用户关系 + List listByUserId = userRelationService.getListByUserId(userEntity.getId()) + .stream().filter(t -> userId.equals(t.getUserId())).collect(Collectors.toList()); + // 分组 + List groupId = listByUserId.stream().filter(t -> PermissionConst.GROUP.equals(t.getObjectType())).map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + List groupName = groupService.getListByIds(groupId, true) + .stream().map(GroupEntity::getId).collect(Collectors.toList()); + groupName.forEach(t -> { + objectIds.add(t + "--group"); + }); + // 角色 + List roleAllList = listByUserId.stream().filter(t -> PermissionConst.ROLE.equals(t.getObjectType())).map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + List globalList = roleService.getGlobalList(roleAllList) + .stream().map(RoleEntity::getId).collect(Collectors.toList()); + globalList.forEach(t -> { + objectIds.add(t + "--role"); + }); + for (String objectId : objectIds) { + List collect1 = list.stream().filter(t -> t.getPermissionMember().contains(objectId)).collect(Collectors.toList()); + if (collect1.size() > 0) { + return ""; + } + } + // 组织 + List orgIds = listByUserId.stream().filter(t -> PermissionConst.ORGANIZE.equals(t.getObjectType())).map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + List orgEntityList = organizeService.getOrgEntityList(orgIds, true); + List listByOrganizeId = positionService.getListByOrganizeId(orgIds, false); + List relationListByOrganizeId = organizeRelationService.getRelationListByOrganizeId(orgEntityList.stream().map(OrganizeEntity::getId).collect(Collectors.toList())); + for (OrganizeEntity organizeEntity : orgEntityList) { + List collect1 = list.stream().filter(entity -> entity.getPermissionMember().contains(organizeEntity.getId())).collect(Collectors.toList()); + if (collect1.size() > 0) { + return organizeEntity.getId(); + } + // 角色 + List roleListByTypeAndOrgId = relationListByOrganizeId.stream().filter(t -> PermissionConst.ROLE.equals(t.getObjectType())) + .map(OrganizeRelationEntity::getObjectId).collect(Collectors.toList()); + List roleId = listByUserId.stream().filter(t -> PermissionConst.ROLE.equals(t.getObjectType())) + .map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + List roleName = roleService.getListByIds(roleId, null, true) + .stream().filter(t -> t.getGlobalMark() != 1).collect(Collectors.toList()); + List containsRole = roleName.stream().filter(t -> roleListByTypeAndOrgId.contains(t.getId())).collect(Collectors.toList()) + .stream().map(RoleEntity::getId).collect(Collectors.toList()); + for (String containsId : containsRole) { + if (list.stream().anyMatch(entity -> entity.getPermissionMember().contains(containsId))) { + return organizeEntity.getId(); + } + } + // 岗位 + List positionListByTypeAndOrgId = listByOrganizeId.stream().filter(t -> t.getOrganizeId().equals(organizeEntity.getId())) + .map(PositionEntity::getId).collect(Collectors.toList()); + List positionId = listByUserId.stream().filter(t -> PermissionConst.POSITION.equals(t.getObjectType())) + .map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + List containsPosition = positionListByTypeAndOrgId.stream().filter(positionId::contains).collect(Collectors.toList()); + List positionName = positionService.getPositionName(containsPosition, true) + .stream().map(PositionEntity::getId).collect(Collectors.toList()); + for (String containsId : positionName) { + if (list.stream().anyMatch(entity -> entity.getPermissionMember().contains(containsId))) { + return organizeEntity.getId(); + } + } + } + return ""; + } + + @Override + public List getPermissionGroupAllByUserId(String userId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().like(PermissionGroupEntity::getPermissionMember, userId); + queryWrapper.lambda().eq(PermissionGroupEntity::getEnabledMark, 1); + return this.list(queryWrapper); +// UserEntity userEntity = userService.getInfo(userId); +// // 通过用户id获取相关的组织、部门、岗位、角色、分组 +// if (userEntity == null) { +// return new ArrayList<>(); +// } +// if (userEntity.getIsAdministrator() == 1) { +// return this.list(true, null); +// } +// Set objIds = new HashSet<>(); +// +// // 用户与组织关系 +// List orgIds = new ArrayList<>(); +// List orgId = userRelationService.getListByObjectType(userEntity.getId(), PermissionConst.ORGANIZE).stream().map(UserRelationEntity::getObjectId).collect(Collectors.toList()); +// orgId.forEach(t -> orgIds.add(t + "--" + PermissionConst.ORGANIZE)); +// // 用户与岗位关系 +// List positionIds = new ArrayList<>(); +// List positionId = userRelationService.getListByObjectType(userEntity.getId(), PermissionConst.POSITION).stream().map(UserRelationEntity::getObjectId).collect(Collectors.toList()); +// positionId.forEach(t -> positionIds.add(t + "--" + PermissionConst.POSITION)); +// // 用户与角色关系 +// List roleIds = new ArrayList<>(); +// List roleId = userRelationService.getListByObjectType(userEntity.getId(), PermissionConst.ROLE).stream().map(UserRelationEntity::getObjectId).collect(Collectors.toList()); +// roleId.forEach(t -> roleIds.add(t + "--" + PermissionConst.ROLE)); +// // 用户与跟分组关系 +// List groupIds = new ArrayList<>(); +// List groupId = userRelationService.getListByObjectType(userEntity.getId(), PermissionConst.GROUP).stream().map(UserRelationEntity::getObjectId).collect(Collectors.toList()); +// groupId.forEach(t -> groupIds.add(t + "--" + PermissionConst.GROUP)); +// +// objIds.addAll(orgIds); +// objIds.addAll(positionIds); +// objIds.addAll(roleIds); +// objIds.addAll(groupIds); +// +// Set permissionGroupIds = new HashSet<>(); +// +// List permissionGroupEntities = this.list(true, null); +// objIds.forEach(objId -> { +// List collect = permissionGroupEntities.stream().filter(entity -> entity.getPermissionMember().contains(objId)).collect(Collectors.toList()); +// if (collect.size() > 0) { +// permissionGroupIds.addAll(collect.stream().map(PermissionGroupEntity::getId).collect(Collectors.toList())); +// } +// }); +// return this.list(true, new ArrayList<>(permissionGroupIds)); + } + + @Override + @Transactional + public boolean updateByUser(String fromId, String toId, List permissionList) { + if (StringUtil.isEmpty(fromId)) { + return false; + } + String fromIds = fromId + "--" + PermissionConst.USER; + List permissionGroupAllByUserId = this.getPermissionGroupAllByUserId(fromId); + permissionGroupAllByUserId.forEach(t -> { + if (permissionList.contains(t.getId())) { + t.setPermissionMember(StringUtil.isNotEmpty(t.getPermissionMember()) ? t.getPermissionMember().replaceAll(fromIds, toId + "--" + PermissionConst.USER) : ""); + this.updateById(t); + } + }); + return true; + } + + @Override + public List getPermissionGroupByModuleId(String moduleId) { + // 获取到菜单和权限组的关系 + List authorizeEntityList = authorizeService.getListByObjectAndItem(moduleId, AuthorizeType.MODULE); + // 获取权限组信息 + List list = this.list(true, + authorizeEntityList.stream().map(AuthorizeEntity::getObjectId).collect(Collectors.toList())); + return list; + } + + @Override + public List list(List ids) { + if (ids.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(PermissionGroupEntity::getId, ids); + return this.list(queryWrapper); + } + + @Override + public List getPermissionGroupByObjectId(String objectId, String objectType) { + List permissionGroupEntities = this.list(true, null).stream().filter(t -> StringUtil.isNotEmpty(t.getPermissionMember())).collect(Collectors.toList()); + String id = objectId + "--" + objectType; + List idList = new ArrayList<>(); + idList.add(id); + if (AuthorizeConst.USER.equalsIgnoreCase(objectType)) { + List allOrgRelationByUserId = userRelationService.getListByObjectType(objectId,null); + for (UserRelationEntity item : allOrgRelationByUserId) { + String oType = item.getObjectType(); + if (PermissionConst.ORGANIZE.equals(oType)) { + oType = PermissionConst.COMPANY; + idList.add(item.getObjectId() + "--" + PermissionConst.DEPARTMENT); + } + idList.add(item.getObjectId() + "--" + oType.toLowerCase()); + } + } + List collect = permissionGroupEntities.stream().filter(entity -> { + boolean hashOperations = false; + for (String s : idList) { + if (entity.getPermissionMember().contains(s)) { + hashOperations = true; + break; + } + } + return hashOperations; + }).collect(Collectors.toList()); + List allGroupList = this.list(true, null).stream().filter(t -> Objects.equals(0,t.getType())).collect(Collectors.toList()); + for (PermissionGroupEntity entity : allGroupList) { + if(!collect.contains(entity)) { + collect.add(entity); + } + } + return collect; + } + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/PositionServiceImpl.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/PositionServiceImpl.java new file mode 100644 index 0000000..f3c1d13 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/PositionServiceImpl.java @@ -0,0 +1,484 @@ +package com.yunzhupaas.permission.service.impl; + +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.service.DictionaryDataService; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.constant.PermissionConst; +import com.yunzhupaas.permission.entity.*; +import com.yunzhupaas.permission.model.permission.PermissionModel; +import com.yunzhupaas.permission.model.position.PaginationPosition; +import com.yunzhupaas.permission.mapper.PositionMapper; +import com.yunzhupaas.permission.service.*; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.JsonUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import org.springframework.web.bind.annotation.RequestBody; + +import jakarta.validation.Valid; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 岗位信息 + * + * @copyright 深圳市乐程软件有限公司 + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @date 2024-09-26 上午9:18 + */ +@Service +public class PositionServiceImpl extends SuperServiceImpl implements PositionService { + + @Autowired + private AuthorizeService authorizeService; + @Autowired + private UserRelationService userRelationService; + @Autowired + private RedisUtil redisUtil; + @Autowired + private CacheKeyUtil cacheKeyUtil; + @Autowired + private OrganizeRelationService organizeRelationService; + @Autowired + private OrganizeService organizeService; + @Autowired + private OrganizeAdministratorService organizeAdministratorService; + @Autowired + private DictionaryDataService dictionaryDataService; + + @Override + public List getList(boolean filterEnabledMark) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (filterEnabledMark) { + queryWrapper.lambda().eq(PositionEntity::getEnabledMark, 1); + } + queryWrapper.lambda().orderByAsc(PositionEntity::getSortCode).orderByDesc(PositionEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getPosList(List idList) { + if (idList.size()>0){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(PositionEntity::getId,idList).select(PositionEntity::getId,PositionEntity::getFullName, PositionEntity::getEnabledMark); + return this.list(queryWrapper); + } + return new ArrayList<>(); + } + + @Override + public List getPosList(Set idList) { + if (idList.size()>0){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().orderByAsc(PositionEntity::getSortCode).orderByDesc(PositionEntity::getCreatorTime); + queryWrapper.lambda().select(PositionEntity::getId,PositionEntity::getFullName).in(PositionEntity::getId,idList); + return this.list(queryWrapper); + } + return new ArrayList<>(); + } + + @Override + public Map getPosMap() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(PositionEntity::getId,PositionEntity::getFullName); + return this.list(queryWrapper).stream().collect(Collectors.toMap(PositionEntity::getId,PositionEntity::getFullName,(p1, p2) -> p1)); + } + + @Override + public Map getPosEncodeAndName() { + return getPosEncodeAndName(false); + } + + @Override + public Map getPosEncodeAndName(boolean enabledMark) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if(enabledMark){ + queryWrapper.lambda().eq(PositionEntity::getEnabledMark,1); + } + queryWrapper.lambda().select(PositionEntity::getId,PositionEntity::getFullName,PositionEntity::getEnCode); + return this.list(queryWrapper).stream().collect(Collectors.toMap(p->p.getFullName() + "/" + p.getEnCode(),PositionEntity::getId,(p1, p2) -> p1)); + } + + + @Override + public List getPosRedisList() { + if(redisUtil.exists(cacheKeyUtil.getPositionList())){ + return JsonUtil.getJsonToList(redisUtil.getString(cacheKeyUtil.getPositionList()).toString(),PositionEntity.class); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(PositionEntity::getEnabledMark,1); + + List list=this.list(queryWrapper); + if(list.size()>0){ + redisUtil.insert(cacheKeyUtil.getPositionList(), JsonUtil.getObjectToString(list),300); + } + return list; + } + + @Override + public List getList(PaginationPosition paginationPosition) { + // 需要查询哪些组织 + List orgIds = new ArrayList<>(); + // 所有有权限的组织 + Set orgId = new HashSet<>(16); + if (!UserProvider.getUser().getIsAdministrator()) { + // 通过权限转树 + List listss = organizeAdministratorService.getOrganizeAdministratorEntity(UserProvider.getUser().getUserId()); + // 判断自己是哪些组织的管理员 + listss.forEach(t -> { + if (t != null) { + if (t.getThisLayerSelect() != null && t.getThisLayerSelect() == 1) { + orgId.add(t.getOrganizeId()); + } + if (t.getSubLayerSelect() != null && t.getSubLayerSelect() == 1) { + List underOrganizations = organizeService.getUnderOrganizations(t.getOrganizeId(), false); + orgId.addAll(underOrganizations); + } + } + }); + } else { + orgId.addAll(organizeService.getOrgMapsAll(OrganizeEntity::getId).keySet()); + } + if (orgId.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(paginationPosition.getKeyword())) { + queryWrapper.lambda().and( + t -> t.like(PositionEntity::getFullName, paginationPosition.getKeyword()) + .or().like(PositionEntity::getEnCode, paginationPosition.getKeyword()) + ); + } + if (paginationPosition.getEnabledMark() != null) { + queryWrapper.lambda().eq(PositionEntity::getEnabledMark, paginationPosition.getEnabledMark()); + } + if (StringUtil.isNotEmpty(paginationPosition.getEnCode())) { + queryWrapper.lambda().eq(PositionEntity::getType, paginationPosition.getEnCode()); + } + if (StringUtil.isNotEmpty(paginationPosition.getOrganizeId())) { + List underOrganizations = organizeService.getUnderOrganizations(paginationPosition.getOrganizeId(), false); + // 判断哪些组织时有权限的 + List collect = underOrganizations.stream().filter(orgId::contains).collect(Collectors.toList()); + orgIds.add(paginationPosition.getOrganizeId()); + orgIds.addAll(collect); + orgIds.add(paginationPosition.getOrganizeId()); + queryWrapper.lambda().in(PositionEntity::getOrganizeId, orgIds); + } else { + queryWrapper.lambda().in(PositionEntity::getOrganizeId, orgId); + } + long count = this.count(queryWrapper); + queryWrapper.lambda().select(PositionEntity::getId, PositionEntity::getEnCode, PositionEntity::getCreatorTime, + PositionEntity::getOrganizeId, PositionEntity::getEnabledMark, PositionEntity::getFullName, + PositionEntity::getSortCode, PositionEntity::getType, PositionEntity::getDescription); + queryWrapper.lambda().orderByAsc(PositionEntity::getSortCode).orderByDesc(PositionEntity::getCreatorTime); + + if(Objects.equals(paginationPosition.getDataType(),1)){ + return list(queryWrapper); + } + Page page = new Page<>(paginationPosition.getCurrentPage(), paginationPosition.getPageSize(), count, false); + page.setOptimizeCountSql(false); + IPage iPage = this.page(page, queryWrapper); + return paginationPosition.setData(iPage.getRecords(), page.getTotal()); + } + + @Override + public List getListByUserId(String userId) { + QueryWrapper query = new QueryWrapper<>(); + List ids = new ArrayList<>(); + userRelationService.getListByObjectType(userId, PermissionConst.POSITION).forEach(r->{ + ids.add(r.getObjectId()); + }); + if(ids.size() > 0){ + query.lambda().in(PositionEntity::getId, ids); + return this.list(query); + }else { + return new ArrayList<>(); + } + } + + @Override + public PositionEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(PositionEntity::getId,id); + return this.getOne(queryWrapper); + } + + @Override + public PositionEntity getByFullName(String fullName) { + PositionEntity positionEntity = new PositionEntity(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(PositionEntity::getFullName, fullName); + queryWrapper.lambda().select(PositionEntity::getId); + List list = this.list(queryWrapper); + if (list.size() > 0) { + positionEntity = list.get(0); + } + return positionEntity; + } + + @Override + public PositionEntity getByFullName(String fullName,String encode) { + PositionEntity positionEntity = new PositionEntity(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(PositionEntity::getFullName, fullName); + queryWrapper.lambda().eq(PositionEntity::getEnCode, encode); + queryWrapper.lambda().select(PositionEntity::getId); + List list = this.list(queryWrapper); + if (list.size() > 0) { + positionEntity = list.get(0); + } + return positionEntity; + } + + @Override + public boolean isExistByFullName(PositionEntity entity, boolean isFilter) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if(entity != null) { + queryWrapper.lambda().eq(PositionEntity::getFullName, entity.getFullName()); + } + //是否需要过滤 + if (isFilter) { + queryWrapper.lambda().ne(PositionEntity::getId, entity.getId()); + } + List entityList = this.list(queryWrapper); + for (PositionEntity positionEntity : entityList) { + //如果组织id相同则代表已存在 + if (entity != null && entity.getOrganizeId().equals(positionEntity.getOrganizeId())){ + return true; + } + } + return false; + } + + @Override + public boolean isExistByEnCode(PositionEntity entity, boolean isFilter) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if(entity != null){ + queryWrapper.lambda().eq(PositionEntity::getEnCode, entity.getEnCode()); + if (isFilter) { + queryWrapper.lambda().ne(PositionEntity::getId, entity.getId()); + } + } + List entityList = this.list(queryWrapper); +// for (PositionEntity positionEntity : entityList) { +// //如果组织id相同则代表已存在 +// if (entity != null && entity.getOrganizeId().equals(positionEntity.getOrganizeId())){ +// return true; +// } +// } + return entityList.size() > 0; + } + + @Override + public void create(PositionEntity entity) { + if (StringUtil.isEmpty(entity.getId())) { + entity.setId(RandomUtil.uuId()); + } + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + this.save(entity); + } + + @Override + public boolean update(String id, PositionEntity entity) { + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + return this.updateById(entity); + } + + @Override + @DSTransactional + public void delete(PositionEntity entity) { + this.removeById(entity.getId()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserRelationEntity::getObjectId,entity.getId()); + userRelationService.remove(queryWrapper); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(AuthorizeEntity::getObjectId,entity.getId()); + authorizeService.remove(wrapper); + } + + @Override + @DSTransactional + public boolean first(String id) { + boolean isOk = false; + //获取要上移的那条数据的信息 + PositionEntity upEntity = this.getById(id); + Long upSortCode = upEntity.getSortCode() == null ? 0 : upEntity.getSortCode(); + //查询上几条记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .lt(PositionEntity::getSortCode, upSortCode) + .eq(PositionEntity::getOrganizeId,upEntity.getOrganizeId()) + .orderByDesc(PositionEntity::getSortCode); + List downEntity = this.list(queryWrapper); + if(downEntity.size()>0){ + //交换两条记录的sort值 + Long temp = upEntity.getSortCode(); + upEntity.setSortCode(downEntity.get(0).getSortCode()); + downEntity.get(0).setSortCode(temp); + this.updateById(downEntity.get(0)); + this.updateById(upEntity); + isOk = true; + } + return isOk; + } + + @Override + @DSTransactional + public boolean next(String id) { + boolean isOk = false; + //获取要下移的那条数据的信息 + PositionEntity downEntity = this.getById(id); + Long upSortCode = downEntity.getSortCode() == null ? 0 : downEntity.getSortCode(); + //查询下几条记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .gt(PositionEntity::getSortCode, upSortCode) + .eq(PositionEntity::getOrganizeId,downEntity.getOrganizeId()) + .orderByAsc(PositionEntity::getSortCode); + List upEntity = this.list(queryWrapper); + if(upEntity.size()>0){ + //交换两条记录的sort值 + Long temp = downEntity.getSortCode(); + downEntity.setSortCode(upEntity.get(0).getSortCode()); + upEntity.get(0).setSortCode(temp); + this.updateById(upEntity.get(0)); + this.updateById(downEntity); + isOk = true; + } + return isOk; + } + + @Override + public List getPositionName(List id, boolean filterEnabledMark) { + List roleList = new ArrayList<>(); + if (id.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(PositionEntity::getId, id); + roleList = this.list(queryWrapper); + } + return roleList; + } + + @Override + public List getPositionName(List id, String keyword) { + List roleList = new ArrayList<>(); + if (id.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(PositionEntity::getId, id); + //关键字(名称、编码) + if (!StringUtil.isEmpty(keyword)) { + queryWrapper.lambda().and( + t->t.like(PositionEntity::getFullName,keyword) + .or().like(PositionEntity::getEnCode,keyword) + ); + } + roleList = this.list(queryWrapper); + } + return roleList; + } + + @Override + public List getListByOrganizeId(List organizeIds, boolean enabledMark) { + if (organizeIds.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(PositionEntity::getOrganizeId, organizeIds); + if (enabledMark) { + queryWrapper.lambda().eq(PositionEntity::getEnabledMark, 1); + } + queryWrapper.lambda().orderByAsc(PositionEntity::getSortCode).orderByDesc(PositionEntity::getCreatorTime); +// queryWrapper.lambda().select(PositionEntity::getId, PositionEntity::getFullName); + return this.list(queryWrapper); + } + + @Override + public List getListByOrgIdAndUserId(String organizeId, String userId) { + // 用户绑定的所有岗位 + List positionIds = userRelationService.getListByUserIdAndObjType(userId, PermissionConst.POSITION).stream() + .map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + if(positionIds.size() > 0){ + List positionEntities = this.listByIds(positionIds); + return positionEntities.stream().filter(p-> p.getOrganizeId().equals(organizeId)).collect(Collectors.toList()); + }else { + return new ArrayList<>(); + } + } + + @Override + public List getListByFullName(String fullName, String enCode) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(PositionEntity::getFullName, fullName).eq(PositionEntity::getEnCode, enCode); + return this.list(queryWrapper); + } + + @Override + public List getCurPositionsByOrgId(String orgId) { + String userId = UserProvider.getUser().getUserId(); + List userRelations = userRelationService.getListByObjectType(userId, PermissionConst.POSITION); + List positions = new ArrayList<>(); + userRelations.forEach(ur->{ + PositionEntity entity = this.getInfo(ur.getObjectId()); + if(entity.getOrganizeId().equals(orgId)){ + positions.add(entity); + } + }); + return positions; + } + + @Override + public List getList(List idList, Pagination pagination, boolean isPage) { + if (idList.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(PositionEntity::getId, idList); + queryWrapper.lambda().eq(PositionEntity::getEnabledMark, 1); + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + queryWrapper.lambda().and( + t -> t.like(PositionEntity::getFullName, pagination.getKeyword()) + .or().like(PositionEntity::getEnCode, pagination.getKeyword()) + ); + } + if(isPage) { + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage iPage = this.page(page, queryWrapper); + return pagination.setData(iPage.getRecords(), iPage.getTotal()); + }else { + return list(queryWrapper); + } + } + return Collections.emptyList(); + } + + @Override + public List getListByOrganizeIds(List organizeIds, boolean needCode, boolean enabledMark) { + List permissionList = new LinkedList<>(); + for (String organizeId : organizeIds) { + OrganizeEntity info = organizeService.getInfo(organizeId); + if (info != null) { + PermissionModel parentModel = new PermissionModel(); + List list = this.getListByOrganizeId(Collections.singletonList(organizeId), enabledMark); + list.stream().forEach(t->{ + if(needCode){ + t.setFullName(t.getFullName()+"/"+t.getEnCode()); + } + }); + List positionModels = JsonUtil.getJsonToList(list, PermissionModel.class); + parentModel.setChildren(positionModels); + parentModel.setHasChildren(true); + parentModel.setFullName(info.getFullName()); + parentModel.setId(info.getId()); + permissionList.add(parentModel); + } + } + return permissionList; + } +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/RoleServiceImpl.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/RoleServiceImpl.java new file mode 100644 index 0000000..15626ae --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/RoleServiceImpl.java @@ -0,0 +1,524 @@ +package com.yunzhupaas.permission.service.impl; + +import com.github.pagehelper.page.PageMethod; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.github.pagehelper.page.PageMethod; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.constant.PermissionConst; +import com.yunzhupaas.permission.entity.*; +import com.yunzhupaas.permission.mapper.RoleMapper; +import com.yunzhupaas.permission.model.role.RoleModel; +import com.yunzhupaas.permission.model.role.RolePagination; +import com.yunzhupaas.permission.service.*; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import com.yunzhupaas.util.treeutil.SumTree; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 系统角色 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +@Service +public class RoleServiceImpl extends SuperServiceImpl implements RoleService { + + @Autowired + private UserService userService; + @Autowired + private RoleService roleService; + @Autowired + private UserRelationService userRelationService; + @Autowired + private AuthorizeService authorizeService; + @Autowired + private OrganizeRelationService organizeRelationService; + @Autowired + private OrganizeService organizeService; + @Autowired + private OrganizeAdministratorService organizeAdministratorService; + + @Override + public List getList(boolean filterEnabledMark) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (filterEnabledMark) { + queryWrapper.lambda().eq(RoleEntity::getEnabledMark, 1); + } + queryWrapper.lambda().orderByAsc(RoleEntity::getSortCode).orderByDesc(RoleEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getList(RolePagination pagination, Integer globalMark) { + // 需要查询哪些组织 + List orgIds = new ArrayList<>(); + // 所有有权限的组织 + Set orgId = new HashSet<>(16); + if (!UserProvider.getUser().getIsAdministrator()) { + // 通过权限转树 + List listss = organizeAdministratorService.getOrganizeAdministratorEntity(UserProvider.getUser().getUserId()); + // 判断自己是哪些组织的管理员 + listss.forEach(t -> { + if (t != null) { + if (t.getThisLayerSelect() != null && t.getThisLayerSelect() == 1) { + orgId.add(t.getOrganizeId()); + } + if (t.getSubLayerSelect() != null && t.getSubLayerSelect() == 1) { + List underOrganizations = organizeService.getUnderOrganizations(t.getOrganizeId(), false); + orgId.addAll(underOrganizations); + } + } + }); + } else { + orgId.addAll(organizeService.getOrgMapsAll(OrganizeEntity::getId).keySet()); + } + + if (!StringUtil.isEmpty(pagination.getOrganizeId())) { + List underOrganizations = organizeService.getUnderOrganizations(pagination.getOrganizeId(), false); + // 判断哪些组织时有权限的 + List collect = underOrganizations.stream().filter(orgId::contains).collect(Collectors.toList()); + orgIds.add(pagination.getOrganizeId()); + orgIds.addAll(collect); + orgIds.add(pagination.getOrganizeId()); + } else { + if (orgId.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + queryWrapper.lambda().and( + t -> t.like(RoleEntity::getFullName, pagination.getKeyword()) + .or().like(RoleEntity::getEnCode, pagination.getKeyword()) + ); + } + if (globalMark > -1) { + queryWrapper.lambda().eq(RoleEntity::getGlobalMark, globalMark); + } + if (!UserProvider.getUser().getIsAdministrator()) { + queryWrapper.lambda().ne(RoleEntity::getGlobalMark, 1); + List collect = organizeRelationService.getRelationListByOrganizeId(new ArrayList<>(orgId), PermissionConst.ROLE).stream().map(OrganizeRelationEntity::getObjectId).collect(Collectors.toList()); + if (collect.size() == 0) { + collect.add(""); + } + queryWrapper.lambda().in(RoleEntity::getId, collect); + } + if (pagination.getEnabledMark() != null) { + queryWrapper.lambda().eq(RoleEntity::getEnabledMark, pagination.getEnabledMark()); + } + if(Objects.equals(pagination.getDataType(),1)){ + queryWrapper.lambda().orderByAsc(RoleEntity::getSortCode).orderByDesc(RoleEntity::getCreatorTime); + return this.list(queryWrapper); + } + long count = this.count(queryWrapper); + queryWrapper.lambda().orderByAsc(RoleEntity::getSortCode).orderByDesc(RoleEntity::getCreatorTime); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize(), count, false); + page.setOptimizeCountSql(false); + IPage iPage = this.page(page, queryWrapper); + return pagination.setData(iPage.getRecords(), page.getTotal()); + } + + String keyword = ""; + if (!StringUtil.isEmpty(pagination.getKeyword())) { + keyword = "%" + pagination.getKeyword() + "%"; + } + PageHelper.startPage((int) pagination.getCurrentPage(), (int) pagination.getPageSize(), false); + PageMethod.getLocalPage().keepOrderBy(true); + List query = this.baseMapper.query(orgIds, keyword, globalMark, pagination.getEnabledMark()); + Long count = this.baseMapper.count(orgIds, keyword, globalMark, pagination.getEnabledMark()); + PageInfo pageInfo = new PageInfo(query); + // 赋值分页参数 + pagination.setTotal(count); + pagination.setCurrentPage(pageInfo.getPageNum()); + pagination.setPageSize(pageInfo.getPageSize()); + if (pageInfo.getList() != null && pageInfo.getList().size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(RoleEntity::getId, pageInfo.getList()); + queryWrapper.lambda().orderByAsc(RoleEntity::getSortCode).orderByDesc(RoleEntity::getCreatorTime); + return this.list(queryWrapper); + } + return new ArrayList<>(); + } + + @Override + public List getListByUserId(String userId) { + QueryWrapper query = new QueryWrapper<>(); + List roleRelations = userRelationService.getListByObjectType(userId, PermissionConst.ROLE).stream() + .map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + if (roleRelations.size() > 0) { + query.lambda().in(RoleEntity::getId, roleRelations); + return this.list(query); + } else { + return new ArrayList<>(); + } + } + + @Override + public List getListByUserIdAndOrgId(String userId, String orgId) { + return getListByUserId(userId).stream() + .filter(role -> organizeRelationService.existByRoleIdAndOrgId(role.getId(), orgId)) + .collect(Collectors.toList()); + } + + @Override + public List getRoleIdsByCurrentUser() { + UserEntity userEntity = userService.getInfo(UserProvider.getUser().getUserId()); + return getAllRoleIdsByUserIdAndOrgId(userEntity.getId(), userEntity.getOrganizeId()); + } + + @Override + public List getRoleIdsByCurrentUser(String orgId) { + UserEntity userEntity = userService.getInfo(UserProvider.getUser().getUserId()); + return getAllRoleIdsByUserIdAndOrgId(userEntity.getId(), orgId); + } + + @Override + public List getAllRoleIdsByUserIdAndOrgId(String userId, String orgId) { + // 用户当前组织下的角色 + List roleIds = getListByUserIdAndOrgId(userId, orgId).stream() + .map(RoleEntity::getId).collect(Collectors.toList()); + // 用户绑定的全局角色 + List globalRoleIds = userRelationService.getListByUserIdAndObjType(userId, PermissionConst.ROLE).stream() + .map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + globalRoleIds = roleService.getListByIds(globalRoleIds, null, false).stream().filter(r -> r.getGlobalMark() != null && r.getGlobalMark() == 1) + .map(RoleEntity::getId).collect(Collectors.toList()); + roleIds.addAll(globalRoleIds); + return roleIds.stream().distinct().collect(Collectors.toList()); + } + + @Override + public RoleEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(RoleEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public Boolean isExistByFullName(String fullName, String id, Integer globalMark) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(RoleEntity::getFullName, fullName); + queryWrapper.lambda().eq(RoleEntity::getGlobalMark, globalMark); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(RoleEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public Boolean isExistByEnCode(String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(RoleEntity::getEnCode, enCode); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(RoleEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public Boolean update(String id, RoleEntity entity) { + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + return this.updateById(entity); + } + + @Override + public void create(RoleEntity entity) { + if (StringUtil.isEmpty(entity.getId())) { + entity.setId(RandomUtil.uuId()); + } + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + this.save(entity); + } + + @Override + @Transactional + public void delete(RoleEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AuthorizeEntity::getObjectId, entity.getId()); + authorizeService.remove(queryWrapper); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(UserRelationEntity::getObjectId, entity.getId()); + userRelationService.remove(wrapper); + } + } + + @Override + public List getListByIds(List id, String keyword, boolean filterEnabledMark) { + List roleList = new ArrayList<>(); + if (id.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(RoleEntity::getId, id); + if (filterEnabledMark) { + queryWrapper.lambda().eq(RoleEntity::getEnabledMark, 1); + } + if (StringUtil.isNotEmpty(keyword)) { + queryWrapper.lambda().and( + t -> t.like(RoleEntity::getFullName, keyword) + .or().like(RoleEntity::getEnCode, keyword) + ); + } + roleList = this.list(queryWrapper); + } + return roleList; + } + + @Override + public List getSwaptListByIds(Set roleIds) { + if (roleIds.size() > 0) { + QueryWrapper roleWrapper = new QueryWrapper<>(); + roleWrapper.lambda().select(RoleEntity::getFullName, RoleEntity::getId).in(RoleEntity::getId, roleIds); + List list = roleService.list(roleWrapper); + return list; + } + return new ArrayList<>(); + } + + @Override + public Map getRoleMap() { + QueryWrapper roleWrapper = new QueryWrapper<>(); + roleWrapper.lambda().select(RoleEntity::getFullName, RoleEntity::getId); + List list = roleService.list(roleWrapper); + return list.stream().collect(Collectors.toMap(RoleEntity::getId, RoleEntity::getFullName)); + } + + @Override + public Map getRoleNameAndIdMap() { + return getRoleNameAndIdMap(false); + } + + @Override + public Map getRoleNameAndIdMap(boolean enabledMark) { + QueryWrapper roleWrapper = new QueryWrapper<>(); + if(enabledMark){ + roleWrapper.lambda().eq(RoleEntity::getEnabledMark, 1); + } + List list = roleService.list(roleWrapper); + Map roleNameMap = new HashMap<>(); + list.stream().forEach(role -> roleNameMap.put(role.getFullName() + "/" + role.getEnCode(), role.getId())); + return roleNameMap; + } + + @Override + public RoleEntity getInfoByFullName(String fullName) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(RoleEntity::getFullName, fullName); + return this.getOne(queryWrapper); + } + + @Override + public RoleEntity getInfoByFullName(String fullName, String enCode) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(RoleEntity::getFullName, fullName); + queryWrapper.lambda().eq(RoleEntity::getEnCode, enCode); + return this.getOne(queryWrapper); + } + + @Override + public List getGlobalList() { + return getGlobalList(true); + } + + @Override + public List getGlobalList(boolean enabledMark) { + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(RoleEntity::getGlobalMark, 1); + if(enabledMark){ + query.lambda().eq(RoleEntity::getEnabledMark, 1); + } + return this.list(query); + } + + @Override + public List getGlobalList(List ids) { + if (ids.isEmpty()) { + return Collections.EMPTY_LIST; + } + QueryWrapper query = new QueryWrapper<>(); + query.lambda().in(RoleEntity::getId, ids); + query.lambda().eq(RoleEntity::getGlobalMark, 1).eq(RoleEntity::getEnabledMark, 1); + return this.list(query); + } + + @Override + public Boolean existCurRoleByOrgId(String orgId) { + List roleRelationList = userRelationService + .getListByObjectType(UserProvider.getUser().getUserId(), PermissionConst.ROLE); + for (UserRelationEntity userRelationEntity : roleRelationList) { + if (organizeRelationService.existByRoleIdAndOrgId(userRelationEntity.getObjectId(), orgId)) { + return true; + } + } + return false; + } + + @Override + public List getCurRolesByOrgId(String orgId) { + String userId = UserProvider.getUser().getUserId(); + List userRelations = userRelationService.getListByObjectType(userId, PermissionConst.ROLE); + List roles = new ArrayList<>(); + userRelations.forEach(ur -> { + // 获取全局角色 + RoleEntity roleEntity = this.getInfo(ur.getObjectId()); + if (roleEntity != null && roleEntity.getGlobalMark() != null && roleEntity.getGlobalMark() == 1 && roleEntity.getEnabledMark() == 1) { + roles.add(roleEntity); + } else { + organizeRelationService.getRelationListByRoleId(ur.getObjectId()).forEach(or -> { + if (roleEntity.getEnabledMark() == 1 && or.getOrganizeId().equals(orgId)) { + roles.add(roleEntity); + } + }); + } + }); + return roles; + } + + @Override + public List getRolesByOrgId(String orgId) { + List ids = new ArrayList<>(); + organizeRelationService.getListByTypeAndOrgId(PermissionConst.ROLE, orgId).forEach(o -> { + ids.add(o.getObjectId()); + }); + QueryWrapper query = new QueryWrapper<>(); + if (ids.size() > 0) { + query.lambda().in(RoleEntity::getId, ids); + return this.list(query); + } else { + return new ArrayList<>(); + } + } + + @Override + public String getBindInfo(String roleId, List reduceOrgIds) { + if (reduceOrgIds.size() > 0) { + StringBuilder info = new StringBuilder(); + RoleEntity roleEntity = this.getInfo(roleId); + List bingUserByRoleList = userRelationService.getListByObjectId(roleId, PermissionConst.ROLE); + if (bingUserByRoleList.size() < 1) { + return null; + } + info.append("已绑定用户:"); + boolean bindFlag = false; + for (UserRelationEntity bingUser : bingUserByRoleList) { + String userId = bingUser.getUserId(); + if (roleEntity.getGlobalMark() == 1) { + UserEntity user = userService.getInfo(userId); + info.append("[ ").append(user.getRealName()).append("/").append(user.getAccount()).append(" ] "); + bindFlag = true; + } else { + // 这个用户所绑定的组织 + List bingUserByOrg = userRelationService.getListByObjectType(userId, PermissionConst.ORGANIZE); + for (UserRelationEntity bingOrg : bingUserByOrg) { + String orgId = bingOrg.getObjectId(); + if (reduceOrgIds.contains(orgId)) { + OrganizeEntity org = organizeService.getInfo(orgId); + UserEntity user = userService.getInfo(bingOrg.getUserId()); + info.append("[").append(org.getFullName()).append(":用户(").append(user.getRealName()).append(")]; "); + bindFlag = true; + } + } + } + } + + if (bindFlag) { + return info.toString(); + } else { + return null; + } + } else { + return null; + } + } + + @Override + public List getList(List idList, Pagination pagination, boolean filterEnabledMark) { + if (idList.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(RoleEntity::getId, idList); + if (filterEnabledMark) { + queryWrapper.lambda().eq(RoleEntity::getEnabledMark, 1); + } + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + queryWrapper.lambda().and( + t -> t.like(RoleEntity::getFullName, pagination.getKeyword()) + .or().like(RoleEntity::getEnCode, pagination.getKeyword()) + ); + } + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage iPage = this.page(page, queryWrapper); + return pagination.setData(iPage.getRecords(), iPage.getTotal()); + } + return Collections.emptyList(); + } + + @Override + public List getListByOrganizeIds(List organizeIds, boolean needCode, boolean enabledMark) { + List modelAll = new ArrayList<>(); + + for (String organizeId : organizeIds) { + OrganizeEntity organizeEntity = organizeService.getInfo(organizeId); + if (organizeEntity != null) { + RoleModel organizeModel = JsonUtil.getJsonToBean(organizeEntity, RoleModel.class); + List roleRelations = organizeRelationService.getListByTypeAndOrgId(PermissionConst.ROLE, organizeId); + List> roleList = new ArrayList<>(); + for (OrganizeRelationEntity roleRelation : roleRelations) { + RoleEntity roleEntity = roleService.getInfo(roleRelation.getObjectId()); + if (roleEntity == null || (enabledMark && roleEntity.getEnabledMark() != 1)) { + continue; + } + // 非全局 + if (roleEntity.getGlobalMark() == 0) { + RoleModel roleModel = JsonUtil.getJsonToBean(roleEntity, RoleModel.class); + String fullName = roleEntity.getFullName(); + if (needCode) { + fullName += "/" + roleEntity.getEnCode(); + } + roleModel.setFullName(fullName); + roleModel.setHasChildren(false); + roleList.add(roleModel); + } + } + organizeModel.setHasChildren(true); + organizeModel.setChildren(roleList); + modelAll.add(organizeModel); + } + } + + // 获取全局角色 + List> models = new ArrayList<>(); + roleService.getGlobalList(enabledMark).forEach(r -> { + RoleModel jsonToBean = JsonUtil.getJsonToBean(r, RoleModel.class); + String fullName = r.getFullName(); + if (needCode) { + fullName += "/" + r.getEnCode(); + } + jsonToBean.setFullName(fullName); + models.add(jsonToBean); + }); + RoleModel modelGlobal = new RoleModel(); + modelGlobal.setFullName("全局"); + modelGlobal.setHasChildren(true); + modelGlobal.setId("0"); + modelGlobal.setChildren(models); + modelAll.add(modelGlobal); + return modelAll; + } +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/SocialsUserServiceImpl.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/SocialsUserServiceImpl.java new file mode 100644 index 0000000..3f0b083 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/SocialsUserServiceImpl.java @@ -0,0 +1,55 @@ +package com.yunzhupaas.permission.service.impl; + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yunzhupaas.permission.entity.SocialsUserEntity; +import com.yunzhupaas.permission.mapper.SocialsUserMapper; +import com.yunzhupaas.permission.service.SocialsUserService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 流程设计 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/7/14 9:33:16 + */ +@Service +public class SocialsUserServiceImpl extends SuperServiceImpl implements SocialsUserService { + @Override + public List getListByUserId(String userId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SocialsUserEntity::getUserId,userId); + return this.list(queryWrapper); + } + + @Override + public List getUserIfnoBySocialIdAndType(String socialId, String socialType) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SocialsUserEntity::getSocialId,socialId); + queryWrapper.lambda().eq(SocialsUserEntity::getSocialType,socialType); + return this.list(queryWrapper); + } + + @Override + public List getListByUserIdAndSource(String userId, String socialType) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SocialsUserEntity::getUserId,userId); + queryWrapper.lambda().eq(SocialsUserEntity::getSocialType,socialType); + return this.list(queryWrapper); + } + + @Override + public SocialsUserEntity getInfoBySocialId(String socialId,String socialType){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SocialsUserEntity::getSocialId,socialId); + queryWrapper.lambda().eq(SocialsUserEntity::getSocialType,socialType); + return this.getOne(queryWrapper); + } + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/UserInfoServiceImpl.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/UserInfoServiceImpl.java new file mode 100644 index 0000000..4f577eb --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/UserInfoServiceImpl.java @@ -0,0 +1,77 @@ +package com.yunzhupaas.permission.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.permission.connector.UserInfoService; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.Md5Util; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Map; + +/** + * 用户信息保存 + * + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/7/28 14:38 + */ +@Service +public class UserInfoServiceImpl implements UserInfoService { + + @Autowired + private UserService userService; + + @Override + public Boolean create(Map map) { + UserEntity entity = JsonUtil.getJsonToBean(map, UserEntity.class); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserEntity::getAccount, entity.getAccount()); + UserEntity entity1 = userService.getOne(queryWrapper); + if (entity1 != null) { + entity.setId(entity1.getId()); + if(StringUtil.isNotEmpty(entity.getPassword())) { + entity.setPassword(Md5Util.getStringMd5(Md5Util.getStringMd5(entity.getPassword()) + entity1.getSecretkey().toLowerCase())); + } + return userService.updateById(entity); + } else { + if (StringUtil.isEmpty(entity.getId())) { + String userId = RandomUtil.uuId(); + entity.setId(userId); + } + entity.setSecretkey(RandomUtil.uuId()); + entity.setPassword(Md5Util.getStringMd5(Md5Util.getStringMd5(entity.getPassword()) + entity.getSecretkey().toLowerCase())); + entity.setIsAdministrator(0); + return userService.save(entity); + } + } + + @Override + public Boolean update(Map map) { + return create(map); + } + + @Override + public Boolean delete(Map map) { + UserEntity entity = JsonUtil.getJsonToBean(map, UserEntity.class); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserEntity::getAccount, entity.getAccount()); + UserEntity entity1 = userService.getOne(queryWrapper); + if (entity1 != null) { + entity.setId(entity1.getId()); + } + return userService.removeById(entity.getId()); + } + + @Override + public Map getInfo(String id) { + UserEntity entity = userService.getInfo(id); + return JsonUtil.entityToMap(entity); + } +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/UserOldPasswordServiceImpl.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/UserOldPasswordServiceImpl.java new file mode 100644 index 0000000..e2d0a64 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/UserOldPasswordServiceImpl.java @@ -0,0 +1,47 @@ +package com.yunzhupaas.permission.service.impl; + +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.permission.entity.UserOldPasswordEntity; +import com.yunzhupaas.permission.mapper.UserOldPasswordMapper; +import com.yunzhupaas.permission.service.UserOldPasswordService; +import com.yunzhupaas.permission.service.UserRelationService; +import com.yunzhupaas.util.DateUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 用户信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +@Service +@DSTransactional +public class UserOldPasswordServiceImpl extends SuperServiceImpl implements UserOldPasswordService { + + @Override + public List getList(String userId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserOldPasswordEntity::getUserId,userId); + queryWrapper.lambda().orderByDesc(UserOldPasswordEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public Boolean create(UserOldPasswordEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorTime(DateUtil.getNowDate()); + this.save(entity); + return true; + } + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/UserRelationServiceImpl.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/UserRelationServiceImpl.java new file mode 100644 index 0000000..3938001 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/UserRelationServiceImpl.java @@ -0,0 +1,379 @@ +package com.yunzhupaas.permission.service.impl; + +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.constant.PermissionConst; +import com.yunzhupaas.message.entity.SynThirdInfoEntity; +import com.yunzhupaas.message.service.SynThirdInfoService; +import com.yunzhupaas.message.util.SynThirdConsts; +import com.yunzhupaas.permission.entity.PermissionEntityBase; +import com.yunzhupaas.permission.entity.PositionEntity; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.entity.UserRelationEntity; +import com.yunzhupaas.permission.mapper.UserRelationMapper; +import com.yunzhupaas.permission.model.permission.PermissionModel; +import com.yunzhupaas.permission.model.userrelation.UserRelationForm; +import com.yunzhupaas.permission.service.*; +import com.yunzhupaas.permission.util.PermissionUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.stream.Collectors; + +import static com.yunzhupaas.util.Constants.ADMIN_KEY; + +/** + * 用户关系 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +@Service +public class UserRelationServiceImpl extends SuperServiceImpl implements UserRelationService { + + @Autowired + private UserService userService; + @Autowired + private PositionService positionService; + @Autowired + private OrganizeService organizeService; + @Autowired + private OrganizeRelationService organizeRelationService; + @Autowired + private UserRelationService userRelationService; + @Autowired + private SynThirdInfoService synThirdInfoService; + + @Override + public List getListByUserId(String userId) { + return getListByUserIdAll(Collections.singletonList(userId)); + } + + @Override + public List getListByUserIdAndObjType(String userId, String objectType) { + QueryWrapper query = new QueryWrapper<>(); + query.lambda().in(UserRelationEntity::getUserId, userId); + query.lambda().in(UserRelationEntity::getObjectType, objectType); + query.lambda().orderByAsc(UserRelationEntity::getSortCode).orderByDesc(UserRelationEntity::getCreatorTime); + return this.list(query); + } + + @Override + public List getListByUserIdAll(List userId) { + if (userId.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(UserRelationEntity::getUserId, userId); + return this.list(queryWrapper); + } + return new ArrayList<>(); + } + + @Override + public List getListByObjectId(String objectId) { + return getListByObjectId(objectId, null); + } + + @Override + public List getListByObjectType(String objectType) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserRelationEntity::getObjectType, objectType); + return this.list(queryWrapper); + } + + @Override + public List getListByObjectId(String objectId, String objectType) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserRelationEntity::getObjectId, objectId); + if(objectType != null){ + queryWrapper.lambda().eq(UserRelationEntity::getObjectType, objectType); + } + queryWrapper.lambda().orderByAsc(UserRelationEntity::getSortCode).orderByDesc(UserRelationEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getListByObjectIdAll(List objectId) { + List list = new ArrayList<>(); + if (objectId.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(UserRelationEntity::getObjectId, objectId); + list = this.list(queryWrapper); + } + return list; + } + + @Override + public void deleteAllByObjId(String objId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserRelationEntity::getObjectId, objId); + this.remove(queryWrapper); + } + + @Override + public void deleteAllByUserId(String userId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserRelationEntity::getUserId, userId); + queryWrapper.lambda().ne(UserRelationEntity::getObjectType, PermissionConst.GROUP); + userRelationService.remove(queryWrapper); + } + + @Override + public void createByList(List userRelationEntityList) { + userRelationEntityList.forEach(t -> { + this.save(t); + }); + } + + @Override + public UserRelationEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserRelationEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + @DSTransactional + public void save(String objectId, List entitys) { + List existList = this.getListByObjectId(objectId); + List relationList = new ArrayList<>(); + for (int i = 0; i < entitys.size(); i++) { + UserRelationEntity entity = entitys.get(i); + entity.setId(RandomUtil.uuId()); + entity.setSortCode(Long.parseLong(i + "")); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + if (existList.stream().filter(t -> t.getUserId().equals(entity.getUserId())).count() == 0) { + relationList.add(entity); + } + } + for (UserRelationEntity entity : relationList) { + this.save(entity); + } + } + + @Override + public void save(List list) { + for (UserRelationEntity entity : list) { + this.save(entity); + } + } + + @Override + @DSTransactional + public void delete(String[] ids) { + for (String item : ids) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserRelationEntity::getId, item); + this.remove(queryWrapper); + } + } + + + @Override + @DSTransactional + public void saveObjectId(String objectId, UserRelationForm userRelationForm) { + // 修改前的岗位绑定人员ID + List beforeUserIds = userRelationService.getListByObjectId(objectId) + .stream().map(UserRelationEntity::getUserId).collect(Collectors.toList()); + //清除原有成员数据 + deleteAllByObjId(objectId); + UserInfo userInfo = UserProvider.getUser(); + List list = new ArrayList<>(); + int i = 0; + for (String userId : userRelationForm.getUserIds()) { + UserRelationEntity entity = new UserRelationEntity(); + entity.setId(RandomUtil.uuId()); + entity.setSortCode(Long.parseLong(i + "")); + entity.setObjectId(objectId); + entity.setObjectType(userRelationForm.getObjectType()); + entity.setCreatorUserId(userInfo.getUserId()); + entity.setUserId(userId); + list.add(entity); + i++; + } + save(objectId, list); + + // 并集:所有未修改的人员 + List unUpdateUserId = beforeUserIds.stream().filter(b-> userRelationForm.getUserIds() + .contains(b)).collect(Collectors.toList()); + // 差集:所有修改过的人员(包括:删除此岗位、添加此岗位的人员) + beforeUserIds.addAll(userRelationForm.getUserIds()); + List allUpdateIds = beforeUserIds.stream().filter(u-> !unUpdateUserId.contains(u)) + .collect(Collectors.toList()); + + if (PermissionConst.POSITION.equals(userRelationForm.getObjectType())) { + // 自动切换岗位 + organizeRelationService.autoSetPosition(allUpdateIds); + } + userService.delCurUser(MsgCode.PS010.get(), allUpdateIds,3); + } + + @Override + public List getRelationByUserIds(List userIds) { + if (userIds.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper query = new QueryWrapper<>(); + query.lambda().in(UserRelationEntity::getUserId, userIds); + query.lambda().eq(UserRelationEntity::getObjectType, PermissionConst.ORGANIZE); + return this.list(query); + } + + @Override + public List getListByObjectType(String userId, String objectType) { + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(UserRelationEntity::getUserId, userId); + if (StringUtil.isNotEmpty(objectType)) { + query.lambda().eq(UserRelationEntity::getObjectType, objectType); + } + query.lambda().orderByAsc(UserRelationEntity::getSortCode).orderByDesc(UserRelationEntity::getCreatorTime); + return this.list(query); + } + + @Override + public List getAllOrgRelationByUserId(String userId){ + return this.getListByObjectType(userId,PermissionConst.ORGANIZE); + } + + @Override + public List getObjectVoList(String objectType) { + String userId = UserProvider.getUser().getUserId(); + UserEntity userEntity = userService.getInfo(userId); + String majorOrgId = UserProvider.getUser().getOrganizeId(); + + // 组装对应组织/岗位/角色对象 + switch (objectType) { + case PermissionConst.ORGANIZE: + // 使用in查询减少数据库查询次数 + List ids = new ArrayList<>(); + this.getListByObjectType(userId, objectType).forEach(r -> ids.add(r.getObjectId())); + List permissionModels = setModel(organizeService.getOrgEntityList(ids, false), majorOrgId); + permissionModels.forEach(p->p.setFullName(PermissionUtil.getLinkInfoByOrgId(p.getId(), organizeService, false))); + return permissionModels; + case PermissionConst.POSITION: + // 岗位遵循一对多关系 + List positionList = positionService.getListByUserId(userId); + if (positionList.size() > 0) { + return setModel(positionList.stream().filter(p -> p.getOrganizeId().equals(majorOrgId)) + .collect(Collectors.toList()), userEntity.getPositionId()); + } + default: + return new ArrayList<>(); + } + } + + /** + * 设置返回模型 + * + * @param permissionList + * @param majorId + */ + private List setModel (List permissionList, String majorId){ + List voList = new ArrayList<>(); + permissionList.forEach(p -> { + PermissionModel model = new PermissionModel(); + if (p.getId().equals(majorId)) { + model.setIsDefault(true); + } else { + model.setIsDefault(false); + } + model.setFullName(p.getFullName()); + model.setId(p.getId()); + model.setFullName(p.getFullName()); + voList.add(model); + }); + return voList; + } + + @Override + public Boolean existByObj(String objectType, String objectId) { + QueryWrapper query = new QueryWrapper<>(); + query.lambda() + .eq(UserRelationEntity::getObjectType, objectType) + .eq(UserRelationEntity::getObjectId, objectId); + return this.count(query) > 0; + } + + @Override + public List getListByRoleId(String roleId) { + List list = new ArrayList<>(); + organizeRelationService.getRelationListByRoleId(roleId).forEach(o->{ + QueryWrapper query = new QueryWrapper<>(); + query.lambda() + .eq(UserRelationEntity::getObjectType, PermissionConst.ORGANIZE) + .eq(UserRelationEntity::getObjectId, o.getOrganizeId()); + list.addAll(this.list(query)); + }); + return list; + } + + @Override + public List getListByUserId(String userId, String objectType) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserRelationEntity::getUserId, userId); + queryWrapper.lambda().eq(UserRelationEntity::getObjectType, objectType); + return this.list(queryWrapper); + } + + @Override + public List getListByOrgId(List orgIdList) { + if (orgIdList.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserRelationEntity::getObjectType, PermissionConst.ORGANIZE).in(UserRelationEntity::getObjectId, orgIdList); + return this.list(queryWrapper); + } + return new ArrayList<>(); + } + + @Override + public void syncDingUserRelation(String sysObjId, List deptIdList) { + List list = new ArrayList<>(); + UserRelationEntity entity = null; + // 查询对应的中间表,获取到对应的本地组织id + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().in(SynThirdInfoEntity::getThirdObjId,deptIdList); + wrapper.lambda().eq(SynThirdInfoEntity::getThirdType, SynThirdConsts.THIRD_TYPE_DING_To_Sys); + List synThirdInfoLists = synThirdInfoService.getBaseMapper().selectList(wrapper); + HashMap map = new HashMap<>(); + for (SynThirdInfoEntity obj : synThirdInfoLists) { + map.put(obj.getThirdObjId(),obj.getSysObjId()); + } + // 已经存在的数据 + List collect = deptIdList.stream().map(t -> String.valueOf(t)).collect(Collectors.toList()); + QueryWrapper relationWrapper = new QueryWrapper<>(); + relationWrapper.lambda().in(UserRelationEntity::getObjectId,collect); + relationWrapper.lambda().eq(UserRelationEntity::getObjectType,"Organize"); + relationWrapper.lambda().eq(UserRelationEntity::getUserId,sysObjId); + List userRelationEntities = this.getBaseMapper().selectList(relationWrapper); + List deleteIdS = userRelationEntities.stream().map(t -> t.getId()).collect(Collectors.toList()); + this.removeByIds(deleteIdS); + + UserEntity adminAccount = userService.getUserByAccount(ADMIN_KEY); + String adminId = adminAccount == null ? null : adminAccount.getId(); + for (Long id : deptIdList) { + String objectId = String.valueOf(id); + entity= new UserRelationEntity(); + entity.setId(RandomUtil.uuId()); + entity.setObjectId(map.get(objectId)); + entity.setCreatorUserId(adminId); + entity.setSortCode(0L); + entity.setUserId(sysObjId); + entity.setObjectType("Organize"); + list.add(entity); + } + this.saveBatch(list); + } + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/UserServiceImpl.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/UserServiceImpl.java new file mode 100644 index 0000000..9818d4d --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/service/impl/UserServiceImpl.java @@ -0,0 +1,2272 @@ +package com.yunzhupaas.permission.service.impl; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.page.PageMethod; +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import com.yunzhupaas.base.service.SuperServiceImpl; +import cn.afterturn.easypoi.excel.ExcelExportUtil; +import cn.afterturn.easypoi.excel.entity.ExportParams; +import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; +import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; +import cn.xuyanwu.spring.file.storage.FileInfo; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.service.DictionaryDataService; +import com.yunzhupaas.base.service.SysconfigService; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.YunzhupaasConst; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.constant.PermissionConst; +import com.yunzhupaas.consts.AuthConsts; +import com.yunzhupaas.consts.DeviceType; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.message.util.OnlineUserModel; +import com.yunzhupaas.message.util.OnlineUserProvider; +import com.yunzhupaas.model.BaseSystemInfo; +import com.yunzhupaas.model.login.UserSystemVO; +import com.yunzhupaas.model.tenant.TenantVO; +import com.yunzhupaas.permission.model.user.UserIdListVo; +import com.yunzhupaas.permission.model.user.vo.*; +import com.yunzhupaas.database.source.DbBase; +import com.yunzhupaas.database.util.DataSourceUtil; +import com.yunzhupaas.permission.entity.*; +import com.yunzhupaas.permission.mapper.UserMapper; +import com.yunzhupaas.permission.model.user.mod.UserImportModel; +import com.yunzhupaas.permission.model.user.page.PaginationUser; +import com.yunzhupaas.util.ExcelUtil; +import com.yunzhupaas.permission.service.*; +import com.yunzhupaas.util.*; +import lombok.Cleanup; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.Workbook; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import org.springframework.util.ObjectUtils; +import org.springframework.web.multipart.MultipartFile; + +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.stream.Collectors; + +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.permission.model.user.mod.UserConditionModel; + +import static com.yunzhupaas.consts.AuthConsts.TOKEN_PREFIX; +import static com.yunzhupaas.util.Constants.ADMIN_KEY; + +/** + * 用户信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +@Service +public class UserServiceImpl extends SuperServiceImpl implements UserService { + + @Autowired + private UserRelationService userRelationService; + @Autowired + private RedisUtil redisUtil; + @Autowired + private OrganizeService organizeService; + @Autowired + private PositionService positionService; + @Autowired + private RoleService roleService; + @Autowired + private CacheKeyUtil cacheKeyUtil; + @Autowired + private DataSourceUtil dataSourceUtil; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private DictionaryDataService dictionaryDataService; + @Autowired + private OrganizeRelationService organizeRelationService; + @Autowired + private AuthorizeService authorizeService; + @Autowired + private UserMapper userMapper; + @Autowired + private SysconfigService sysconfigApi; + @Autowired + private OrganizeAdministratorService organizeAdministratorService; + @Autowired + private UserOldPasswordService userOldPasswordService; + @Autowired + private GroupService groupService; + @Autowired + private PermissionGroupService permissionGroupService; + + @Override + public List getList(boolean filterEnabledMark) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (filterEnabledMark) { + queryWrapper.lambda().eq(UserEntity::getEnabledMark, 1); + } + queryWrapper.lambda().orderByAsc(UserEntity::getSortCode).orderByDesc(UserEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getUserNameList(List idList) { + if (idList.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(UserEntity::getId, UserEntity::getRealName, UserEntity::getEnabledMark) + .in(UserEntity::getId, idList); + return this.list(queryWrapper); + } + return new ArrayList<>(); + } + + @Override + public List getUserNameList(Set idList) { + if (idList.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(UserEntity::getId, UserEntity::getRealName, UserEntity::getAccount) + .in(UserEntity::getId, idList); + return this.list(queryWrapper); + } + return new ArrayList<>(); + } + + @Override + public Map getUserMap() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(UserEntity::getId, UserEntity::getRealName, UserEntity::getAccount); + Map userMap = new HashMap<>(); + this.list(queryWrapper).stream() + .forEach(user -> userMap.put(user.getId(), user.getRealName() + "/" + user.getAccount())); + return userMap; + } + + @Override + public Map getUserNameAndIdMap() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(UserEntity::getId, UserEntity::getRealName, UserEntity::getAccount); + Map userMap = new HashMap<>(); + this.list(queryWrapper).stream() + .forEach(user -> userMap.put(user.getRealName() + "/" + user.getAccount(), user.getId())); + return userMap; + } + + @Override + public Map getUserNameAndIdMap(boolean enabledMark) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (enabledMark) { + queryWrapper.lambda().eq(UserEntity::getEnabledMark, 1); + } + queryWrapper.lambda().select(UserEntity::getId, UserEntity::getRealName, UserEntity::getAccount); + Map userMap = new HashMap<>(); + this.list(queryWrapper).stream() + .forEach(user -> userMap.put(user.getRealName() + "/" + user.getAccount(), user.getId())); + return userMap; + } + + @Override + public UserEntity getByRealName(String realName) { + UserEntity userEntity = new UserEntity(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserEntity::getRealName, realName); + queryWrapper.lambda().select(UserEntity::getId); + List list = this.list(queryWrapper); + if (list.size() > 0) { + userEntity = list.get(0); + } + return userEntity; + } + + @Override + public UserEntity getByRealName(String realName, String account) { + UserEntity userEntity = new UserEntity(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserEntity::getRealName, realName); + queryWrapper.lambda().eq(UserEntity::getAccount, account); + queryWrapper.lambda().select(UserEntity::getId); + List list = this.list(queryWrapper); + if (list.size() > 0) { + userEntity = list.get(0); + } + return userEntity; + } + + @Override + public List getAdminList() { + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(UserEntity::getIsAdministrator, 1); + query.lambda().orderByAsc(UserEntity::getSortCode).orderByDesc(UserEntity::getCreatorTime); + return list(query); + } + + @Override + public List getList(PaginationUser pagination, String organizeId, Boolean flag, Boolean filter, + Integer enabledMark, String gender) { + // 定义变量判断是否需要使用修改时间倒序 + boolean filterLastTime = false; + String userId = UserProvider.getUser().getUserId(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (flag) { + queryWrapper.lambda().ne(UserEntity::getId, userId); + } + if (filter) { + queryWrapper.lambda().ne(UserEntity::getAccount, ADMIN_KEY); + } + // 组织机构 + if (!StringUtil.isEmpty(organizeId)) { + List orgIdList = organizeService.getUnderOrganizationss(organizeId); + orgIdList.add(organizeId); + PageHelper.startPage((int) pagination.getCurrentPage(), (int) pagination.getPageSize(), false); + // 组织数量很多时解析SQL很慢, COUNT不解析SQL不去除ORDERBY + PageMethod.getLocalPage().keepOrderBy(true); + // 用户id + List query = new ArrayList<>(16); + String dbSchema = null; + // 判断是否为多租户 + if (configValueUtil.isMultiTenancy() && DbBase.DM.equalsIgnoreCase(dataSourceUtil.getDbType())) { + dbSchema = dataSourceUtil.getDbSchema(); + } + String keyword = null; + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + keyword = "%" + pagination.getKeyword() + "%"; + } + query = userMapper.query(orgIdList, keyword, dbSchema, enabledMark, gender); + Long count = this.baseMapper.count(orgIdList, keyword, dbSchema, enabledMark, gender); + PageInfo pageInfo = new PageInfo(query); + // 赋值分页参数 + pagination.setTotal(count); + pagination.setCurrentPage(pageInfo.getPageNum()); + pagination.setPageSize(pageInfo.getPageSize()); + if (pageInfo.getList().size() > 0) { + // 存放返回结果 + QueryWrapper queryWrapper1 = new QueryWrapper<>(); + List> lists = Lists.partition(query, 1000); + queryWrapper1.lambda().and(t -> { + for (List id : lists) { + t.or().in(UserEntity::getId, id); + } + }); + queryWrapper1.lambda().orderByAsc(UserEntity::getSortCode).orderByDesc(UserEntity::getCreatorTime); + List entityList = getBaseMapper().selectList(queryWrapper1); + return entityList; + } else { + return new ArrayList<>(); + } + } + if (!UserProvider.getUser().getIsAdministrator()) { + // 通过权限转树 + List listss = organizeAdministratorService + .getOrganizeAdministratorEntity(UserProvider.getUser().getUserId()); + Set orgIds = new HashSet<>(16); + // 判断自己是哪些组织的管理员 + listss.stream().forEach(t -> { + if (t != null) { + if (t.getThisLayerSelect() != null && t.getThisLayerSelect() == 1) { + orgIds.add(t.getOrganizeId()); + } + if (t.getSubLayerSelect() != null && t.getSubLayerSelect() == 1) { + List underOrganizations = organizeService.getUnderOrganizations(t.getOrganizeId(), + false); + orgIds.addAll(underOrganizations); + } + } + }); + List list1 = new ArrayList<>(orgIds); + // 得到所有有权限的组织 + List organizeName = new ArrayList<>( + organizeService.getOrganizeName(list1, null, false, null).values()); + // 用户关系表得到所有的人 + List collect = organizeName.stream().map(OrganizeEntity::getId).collect(Collectors.toList()); + List listByObjectIdAll = userRelationService.getListByOrgId(collect); + List collect1 = listByObjectIdAll.stream().map(UserRelationEntity::getUserId).distinct() + .collect(Collectors.toList()); + return getUserNames(collect1, pagination, false, ObjectUtil.equal(enabledMark, 1)); + } + // 关键字(账户、姓名、手机) + if (!StringUtil.isEmpty(pagination.getKeyword())) { + filterLastTime = true; + queryWrapper.lambda().and( + t -> t.like(UserEntity::getAccount, pagination.getKeyword()) + .or().like(UserEntity::getRealName, pagination.getKeyword()) + .or().like(UserEntity::getMobilePhone, pagination.getKeyword())); + } + if (enabledMark != null) { + queryWrapper.lambda().eq(UserEntity::getEnabledMark, enabledMark); + } + if (StringUtil.isNotEmpty(gender)) { + queryWrapper.lambda().eq(UserEntity::getGender, gender); + } + // 不分页 + if (Objects.equals(pagination.getDataType(), 1)) { + queryWrapper.lambda().orderByAsc(UserEntity::getSortCode).orderByDesc(UserEntity::getCreatorTime); + if (filterLastTime) { + queryWrapper.lambda().orderByDesc(UserEntity::getLastModifyTime); + } + return this.list(queryWrapper); + } + // 分页 + // 排序 + long count = this.count(queryWrapper); + queryWrapper.lambda().select(UserEntity::getId); + queryWrapper.lambda().orderByAsc(UserEntity::getSortCode).orderByDesc(UserEntity::getCreatorTime); + if (filterLastTime) { + queryWrapper.lambda().orderByDesc(UserEntity::getLastModifyTime); + } + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize(), count, false); + page.setOptimizeCountSql(false); + IPage iPage = this.page(page, queryWrapper); + if (!iPage.getRecords().isEmpty()) { + List ids = iPage.getRecords().stream().map(m -> m.getId()).collect(Collectors.toList()); + queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(UserEntity::getId, ids); + queryWrapper.lambda().orderByAsc(UserEntity::getSortCode).orderByDesc(UserEntity::getCreatorTime); + if (filterLastTime) { + queryWrapper.lambda().orderByDesc(UserEntity::getLastModifyTime); + } + iPage.setRecords(this.list(queryWrapper)); + } + return pagination.setData(iPage.getRecords(), iPage.getTotal()); + } + + @Override + public List getList(Pagination pagination, Boolean filterCurrentUser) { + // 定义变量判断是否需要使用修改时间倒序 + boolean filterLastTime = false; + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (filterCurrentUser) { + String userId = UserProvider.getUser().getUserId(); + queryWrapper.lambda().ne(UserEntity::getId, userId); + } + queryWrapper.lambda().ne(UserEntity::getEnabledMark, 0); + // 关键字(账户、姓名、手机) + if (!StringUtil.isEmpty(pagination.getKeyword())) { + filterLastTime = true; + queryWrapper.lambda().and( + t -> t.like(UserEntity::getAccount, pagination.getKeyword()) + .or().like(UserEntity::getRealName, pagination.getKeyword()) + .or().like(UserEntity::getMobilePhone, pagination.getKeyword())); + } + // 排序 + queryWrapper.lambda().orderByAsc(UserEntity::getSortCode).orderByDesc(UserEntity::getCreatorTime); + if (filterLastTime) { + queryWrapper.lambda().orderByDesc(UserEntity::getLastModifyTime); + } + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage iPage = this.page(page, queryWrapper); + return pagination.setData(iPage.getRecords(), iPage.getTotal()); + } + + @Override + public List getUserPage(Pagination pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().ne(UserEntity::getEnabledMark, 0); + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + // 通过关键字查询 + queryWrapper.lambda().and( + t -> t.like(UserEntity::getAccount, pagination) + .or().like(UserEntity::getRealName, pagination) + .or().like(UserEntity::getMobilePhone, pagination)); + } + queryWrapper.lambda().ne(UserEntity::getEnabledMark, 0); + queryWrapper.lambda().select(UserEntity::getId, UserEntity::getAccount, UserEntity::getRealName, + UserEntity::getGender, UserEntity::getEnabledMark); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage iPage = this.page(page, queryWrapper); + return iPage.getRecords(); + } + + @Override + public List getListByOrganizeId(String organizeId, String keyword) { + List userIds = userRelationService.getListByObjectId(organizeId, PermissionConst.ORGANIZE).stream() + .map(UserRelationEntity::getUserId).collect(Collectors.toList()); + if (userIds.size() > 0) { + QueryWrapper query = new QueryWrapper<>(); + if (userIds.size() > 0) { + query.lambda().in(UserEntity::getId, userIds); + } + // 通过关键字查询 + if (StringUtil.isNotEmpty(keyword)) { + query.lambda().and( + t -> t.like(UserEntity::getAccount, keyword) + .or().like(UserEntity::getRealName, keyword)); + } + // 只查询正常的用户 + query.lambda().ne(UserEntity::getEnabledMark, 0); + query.lambda().orderByAsc(UserEntity::getSortCode).orderByDesc(UserEntity::getCreatorTime); + return this.list(query); + } + return new ArrayList<>(0); + } + + @Override + public List getListByManagerId(String managerId, String keyword) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserEntity::getManagerId, managerId); + // 通过关键字查询 + if (StringUtil.isNotEmpty(keyword)) { + queryWrapper.lambda().and( + t -> t.like(UserEntity::getAccount, keyword) + .or().like(UserEntity::getRealName, keyword)); + } + // 只查询正常的用户 + queryWrapper.lambda().eq(UserEntity::getEnabledMark, 1); + queryWrapper.lambda().orderByAsc(UserEntity::getSortCode).orderByDesc(UserEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public UserEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserEntity::getId, String.valueOf(id)); + return this.getOne(queryWrapper); + } + + @Override + public UserEntity getUserByAccount(String account) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserEntity::getAccount, account); + return this.getOne(queryWrapper); + } + + @Override + public UserEntity getUserByMobile(String mobile) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserEntity::getMobilePhone, mobile); + return this.getOne(queryWrapper); + } + + @Override + public Boolean setAdminListByIds(List adminIds) { + // 将所有的管理员取消 + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(UserEntity::getIsAdministrator, 1); + // admin不允许移除管理员 + query.lambda().ne(UserEntity::getAccount, ADMIN_KEY); + List list1 = this.list(query); + for (UserEntity entity : list1) { + entity.setIsAdministrator(0); + this.updateById(entity); + } + // 重新赋值管理员 + List list = new ArrayList<>(); + adminIds.stream().forEach(adminId -> { + UserEntity userEntity = new UserEntity(); + userEntity.setId(adminId); + userEntity.setIsAdministrator(1); + // admin无需添加 + if (!ADMIN_KEY.equals(userEntity.getAccount())) { + list.add(userEntity); + } + }); + List adminList = list1.stream().map(UserEntity::getId).collect(Collectors.toList()); + adminList.removeAll(list.stream().map(UserEntity::getId).collect(Collectors.toList())); + delCurUser(MsgCode.PS010.get(), adminList, 1); + updateStand(adminList, 1); + return this.updateBatchById(list); + } + + @Override + public boolean isExistByAccount(String account) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserEntity::getAccount, account); + List list = this.list(queryWrapper); + if (CollectionUtil.isNotEmpty(list)) { + return true; + } + return false; + } + + @Override + @DSTransactional + public Boolean create(UserEntity entity) throws Exception { + beforeCheck(); + if (StringUtil.isNotEmpty(entity.getGroupId()) && entity.getGroupId().contains(",")) { + entity.setGroupId(null); + } + // 添加用户 初始化 + String userId = RandomUtil.uuId(); + if (StringUtil.isNotEmpty(entity.getId())) { + userId = entity.getId(); + } + BaseSystemInfo sysInfo = sysconfigApi.getSysInfo(); + entity.setPassword(Md5Util.getStringMd5(sysInfo.getNewUserDefaultPassword())); + entity.setId(userId); + if (StringUtil.isEmpty(entity.getAccount())) { + throw new DataException(MsgCode.PS007.get()); + } + if (StringUtil.isEmpty(entity.getRealName())) { + throw new DataException(MsgCode.PS008.get()); + } + // 获取头像 + String oldHeadIcon = entity.getHeadIcon(); + if (StringUtil.isEmpty(oldHeadIcon)) { + entity.setHeadIcon("001.png"); + } else { + // 获取头像 + String[] headIcon = oldHeadIcon.split("/"); + if (headIcon.length > 0) { + entity.setHeadIcon(headIcon[headIcon.length - 1]); + } + } + entity.setSecretkey(RandomUtil.uuId()); + entity.setPassword( + Md5Util.getStringMd5(entity.getPassword().toLowerCase() + entity.getSecretkey().toLowerCase())); + entity.setIsAdministrator(0); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + saveOrUpdateCommon(userId, entity); + this.save(entity); + return true; + } + + /** + * 验证是否还有额度 + */ + public void beforeCheck() { + String tenantId = UserProvider.getUser().getTenantId(); + // 开启多租住的 + if (StringUtil.isNotEmpty(tenantId)) { + TenantVO cacheTenantInfo = TenantDataSourceUtil.getCacheTenantInfo(tenantId); + long count = this.count(); + if (cacheTenantInfo.getAccountNum() != 0 && cacheTenantInfo.getAccountNum() < count) { + throw new DataException(MsgCode.PS009.get()); + } + } + } + + @Override + @DSTransactional + public Boolean update(String userId, UserEntity entity) throws Exception { + // 更新用户 + entity.setId(userId); + if (StringUtil.isEmpty(entity.getAccount())) { + throw new DataException(MsgCode.PS007.get()); + } + if (StringUtil.isEmpty(entity.getRealName())) { + throw new DataException(MsgCode.PS008.get()); + } + // 获取头像 + String oldHeadIcon = entity.getHeadIcon(); + if (StringUtil.isEmpty(oldHeadIcon)) { + entity.setHeadIcon("001.png"); + } + entity.setLastModifyTime(DateUtil.getNowDate()); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + // 获取头像 + String[] headIcon = entity.getHeadIcon().split("/"); + if (headIcon.length > 0) { + entity.setHeadIcon(headIcon[headIcon.length - 1]); + } + saveOrUpdateCommon(userId, entity); + if (StringUtil.isNotEmpty(entity.getGroupId()) && entity.getGroupId().contains(",")) { + entity.setGroupId(null); + } + this.updateById(entity); + return true; + } + + private Boolean saveOrUpdateCommon(String userId, UserEntity entity) { + List userAllOrgIds = Arrays.asList(entity.getOrganizeId().split(",")); + List userAllPosIds = StringUtil.isNotEmpty(entity.getPositionId()) + ? Arrays.asList(entity.getPositionId().split(",")) + : new ArrayList<>(); + List userAllRoleIds = StringUtil.isNotEmpty(entity.getRoleId()) + ? Arrays.asList(entity.getRoleId().split(",")) + : new ArrayList<>(); + + // 更新用户关系(组织/岗位/角色) + List relationList = new ArrayList<>(); + setUserRelation(relationList, PermissionConst.ORGANIZE, userAllOrgIds, entity); + setUserRelation(relationList, PermissionConst.POSITION, userAllPosIds, entity); + setUserRelation(relationList, PermissionConst.ROLE, userAllRoleIds, entity); + if (userId != null) { + // 删除用户关联 + userRelationService.deleteAllByUserId(userId); + } + if (relationList.size() > 0) { + userRelationService.saveBatch(relationList); + } + + /* ========== 自动设置带有权限的默认组织、自动设置默认岗位 ========== */ + String majorOrgId = ""; + String majorPosId = "0"; + UserEntity userEntity = this.getInfo(userId); + if (userEntity != null) { + // 原本的主岗、主组织 + majorOrgId = userEntity.getOrganizeId(); + majorPosId = userEntity.getOrganizeId(); + } + majorOrgId = organizeRelationService.autoGetMajorOrganizeId(userId, userAllOrgIds, majorOrgId, null); + entity.setOrganizeId(majorOrgId); + if (userAllPosIds.size() > 0) { + entity.setPositionId(organizeRelationService.autoGetMajorPositionId(userId, majorOrgId, majorPosId)); + } else { + entity.setPositionId(""); + } + entity.setQuickQuery(PinYinUtil.getFirstSpell(entity.getRealName())); + // 清理获取所有用户的redis缓存 + redisUtil.remove(cacheKeyUtil.getAllUser()); + return true; + } + + /** + * 设置用户关联对象 + */ + private void setUserRelation(List relationList, String objectType, List ids, + UserEntity userEntity) { + for (String id : ids) { + UserRelationEntity relationEntity = new UserRelationEntity(); + relationEntity.setId(RandomUtil.uuId()); + relationEntity.setObjectType(objectType); + relationEntity.setObjectId(id); + relationEntity.setUserId(userEntity.getId()); + relationEntity.setCreatorTime(userEntity.getCreatorTime()); + relationEntity.setCreatorUserId(userEntity.getCreatorUserId()); + relationList.add(relationEntity); + } + } + + @Override + @DSTransactional + public void delete(UserEntity entity) { + this.removeById(entity.getId()); + // 删除用户关联 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserRelationEntity::getUserId, entity.getId()); + userRelationService.remove(queryWrapper); + } + + @Override + public void updatePassword(UserEntity entity) { + entity.setSecretkey(RandomUtil.uuId()); + entity.setPassword( + Md5Util.getStringMd5(entity.getPassword().toLowerCase() + entity.getSecretkey().toLowerCase())); + entity.setChangePasswordDate(DateUtil.getNowDate()); + this.updateById(entity); + + // 加入到旧密码记录表 + UserOldPasswordEntity userOldPasswordEntity = new UserOldPasswordEntity(); + userOldPasswordEntity.setOldPassword(entity.getPassword()); + userOldPasswordEntity.setSecretkey(entity.getSecretkey()); + userOldPasswordEntity.setUserId(entity.getId()); + userOldPasswordEntity.setAccount(entity.getAccount()); + userOldPasswordService.create(userOldPasswordEntity); + } + + @Override + public List getUserName(List id) { + return getUserName(id, false); + } + + /** + * 查询用户名称 + * + * @param id 主键值 + * @return + */ + @Override + public List getUserName(List id, boolean filterEnabledMark) { + List list = new ArrayList<>(); + // 达梦数据库无法null值入参 + id.removeAll(Collections.singleton(null)); + if (id.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(UserEntity::getId, id); + if (filterEnabledMark) { + queryWrapper.lambda().ne(UserEntity::getEnabledMark, 0); + } + list = this.list(queryWrapper); + } + return list; + } + + @Override + public List getListByUserIds(List id) { + List list = new ArrayList<>(); + // 达梦数据库无法null值入参 + id.removeAll(Collections.singleton(null)); + if (id.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(UserEntity::getId, id); + queryWrapper.lambda().ne(UserEntity::getEnabledMark, 0); + list = this.list(queryWrapper); + } + return list; + } + + @Override + public List getUserList(List id) { + List list = new ArrayList<>(); + // 达梦数据库无法null值入参 + id.removeAll(Collections.singleton(null)); + if (id.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(UserEntity::getId, id); + queryWrapper.lambda().eq(UserEntity::getEnabledMark, 0); + queryWrapper.lambda().select(UserEntity::getId); + list = this.list(queryWrapper); + } + return list; + } + + @Override + public UserEntity getUserEntity(String account) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(UserEntity::getAccount, account); + return this.baseMapper.selectOne(queryWrapper); + } + + @Override + public List getListId() { + return this.baseMapper.getListId(); + } + + @Override + public void update(UserEntity entity, String type) { + UpdateWrapper wrapper = new UpdateWrapper<>(); + if ("Position".equals(type)) { + wrapper.lambda().set(UserEntity::getPositionId, entity.getPositionId()); + } else { + wrapper.lambda().set(UserEntity::getRoleId, entity.getRoleId()); + } + wrapper.lambda().eq(UserEntity::getId, entity.getId()); + this.update(wrapper); + } + + @Override + public void updateLastTime(UserEntity entity, String type) { + UpdateWrapper wrapper = new UpdateWrapper<>(); + if ("Position".equals(type)) { + wrapper.lambda().set(UserEntity::getPositionId, entity.getPositionId()); + } else { + wrapper.lambda().set(UserEntity::getRoleId, entity.getRoleId()); + } + wrapper.lambda().set(UserEntity::getLastModifyTime, new Date()); + wrapper.lambda().set(UserEntity::getLastModifyUserId, entity.getLastModifyUserId()); + wrapper.lambda().eq(UserEntity::getId, entity.getId()); + this.update(wrapper); + } + + @Override + public boolean isSubordinate(String id, String managerId) { + int num = 0; + return recursionSubordinates(id, managerId, num); + } + + @Override + public DownloadVO exportExcel(String dataType, String selectKey, PaginationUser pagination) { + List entityList = new ArrayList<>(); + if ("0".equals(dataType)) { + entityList = getList(pagination, pagination.getOrganizeId(), false, true, null, null); + } else if ("1".equals(dataType)) { + entityList = getList(false); + } + List modeList = new ArrayList<>(); + Map orgMaps = null; + // 长度超过300代表是全部数据 + if (entityList.size() > 300) { + orgMaps = organizeService.getOrgMaps(null, true, null); + } + // 得到民族集合 + List dataServiceList = dictionaryDataService.getListByTypeDataCode("Nation"); + Map dataServiceMap = dataServiceList.stream() + .filter(t -> ObjectUtil.equal(t.getEnabledMark(), 1)) + .collect(Collectors.toMap(DictionaryDataEntity::getId, DictionaryDataEntity::getFullName)); + // 得到证件类型 + List dataServiceList1 = dictionaryDataService.getListByTypeDataCode("certificateType"); + Map dataServiceMap1 = dataServiceList1.stream() + .filter(t -> ObjectUtil.equal(t.getEnabledMark(), 1)) + .collect(Collectors.toMap(DictionaryDataEntity::getId, DictionaryDataEntity::getFullName)); + // 得到文化程度 + List dataServiceList2 = dictionaryDataService.getListByTypeDataCode("Education"); + Map dataServiceMap2 = dataServiceList2.stream() + .filter(t -> ObjectUtil.equal(t.getEnabledMark(), 1)) + .collect(Collectors.toMap(DictionaryDataEntity::getId, DictionaryDataEntity::getFullName)); + // 得到职级 + List dataServiceList3 = dictionaryDataService.getListByTypeDataCode("Rank"); + Map dataServiceMap3 = dataServiceList3.stream() + .filter(t -> ObjectUtil.equal(t.getEnabledMark(), 1)) + .collect(Collectors.toMap(DictionaryDataEntity::getId, DictionaryDataEntity::getFullName)); + // 得到性别 + List dataServiceList4 = dictionaryDataService.getListByTypeDataCode("sex"); + Map dataServiceMap4 = dataServiceList4.stream() + .filter(t -> ObjectUtil.equal(t.getEnabledMark(), 1)) + .collect(Collectors.toMap(DictionaryDataEntity::getEnCode, DictionaryDataEntity::getFullName)); + for (UserEntity entity : entityList) { + UserExportVO model = new UserExportVO(); + model.setAccount(entity.getAccount()); + model.setRealName(entity.getRealName()); + // 组织 + // 定义多组织集合 + StringJoiner stringJoiner = new StringJoiner(";"); + // 获取该用户的所有组织关系 + List allOrgRelationByUserId = userRelationService + .getAllOrgRelationByUserId(entity.getId()); + Map orgIdNameMaps = organizeService.getInfoList(); + for (UserRelationEntity userRelationEntity : allOrgRelationByUserId) { + String id = userRelationEntity.getObjectId(); + OrganizeEntity organize = null; + // 得到该组织信息 + if (orgMaps != null) { + organize = orgMaps.get(id); + } else { + organize = organizeService.getInfo(id); + } + // 得到父级id树 + if (organize != null && ObjectUtil.equal(organize.getEnabledMark(), 1) + && StringUtil.isNotEmpty(organize.getOrganizeIdTree())) { + stringJoiner.add( + organizeService.getFullNameByOrgIdTree(orgIdNameMaps, organize.getOrganizeIdTree(), "/")); + } + } + model.setOrganizeId(stringJoiner.toString()); + // 主管 + UserEntity info = getInfo(entity.getManagerId()); + if (Objects.nonNull(info) && StringUtil.isNotEmpty(info.getRealName()) + && StringUtil.isNotEmpty(info.getAccount())) { + model.setManagerId(info.getRealName() + "/" + info.getAccount()); + } + // 岗位 + List listByObjectType = userRelationService.getListByObjectType(entity.getId(), + PermissionConst.POSITION); + StringBuffer positionName = new StringBuffer(); + for (UserRelationEntity userRelationEntity : listByObjectType) { + if (StringUtil.isNotEmpty(userRelationEntity.getObjectId())) { + PositionEntity positionEntity = positionService.getInfo(userRelationEntity.getObjectId()); + if (Objects.nonNull(positionEntity) && ObjectUtil.equal(positionEntity.getEnabledMark(), 1)) { + positionName.append("," + positionEntity.getFullName() + "/" + positionEntity.getEnCode()); + } + } + } + // 判断岗位是否需要导出 + if (positionName.length() > 0) { + model.setPositionId(positionName.toString().replaceFirst(",", "")); + } + + // 角色 + List listByObjectType1 = userRelationService.getListByObjectType(entity.getId(), + PermissionConst.ROLE); + StringBuffer roleName = new StringBuffer(); + for (UserRelationEntity userRelationEntity : listByObjectType1) { + if (StringUtil.isNotEmpty(userRelationEntity.getObjectId())) { + RoleEntity roleEntity = roleService.getInfo(userRelationEntity.getObjectId()); + if (Objects.nonNull(roleEntity) && ObjectUtil.equal(roleEntity.getEnabledMark(), 1)) { + roleName.append("," + roleEntity.getFullName()); + } + } + } + if (roleName.length() > 0) { + model.setRoleId(roleName.toString().replaceFirst(",", "")); + } + + model.setDescription(entity.getDescription()); + // 性别 + if (dataServiceMap4.containsKey(entity.getGender())) { + model.setGender(dataServiceMap4.get(entity.getGender())); + } + // 民族 + if (dataServiceMap.containsKey(entity.getNation())) { + model.setNation(dataServiceMap.get(entity.getNation())); + } + model.setNativePlace(entity.getNativePlace()); + // 证件类型 + if (dataServiceMap1.containsKey(entity.getCertificatesType())) { + model.setCertificatesType(dataServiceMap1.get(entity.getCertificatesType())); + } + model.setCertificatesNumber(entity.getCertificatesNumber()); + // 文化程度 + if (dataServiceMap2.containsKey(entity.getEducation())) { + model.setEducation(dataServiceMap2.get(entity.getEducation())); + } + // 生日 + SimpleDateFormat sf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + if (entity.getBirthday() != null) { + String birthday = sf1.format(entity.getBirthday()); + model.setBirthday(birthday); + } + model.setTelePhone(entity.getTelePhone()); + model.setLandline(entity.getLandline()); + model.setMobilePhone(entity.getMobilePhone()); + model.setEmail(entity.getEmail()); + model.setUrgentContacts(entity.getUrgentContacts()); + model.setUrgentTelePhone(entity.getUrgentTelePhone()); + model.setPostalAddress(entity.getPostalAddress()); + model.setSortCode(entity.getSortCode() == null ? 0 : entity.getSortCode()); + // 设置状态 + if (entity.getEnabledMark() == null) { + model.setEnabledMark("禁用"); + } else { + if (entity.getEnabledMark() == 2) { + model.setEnabledMark("锁定"); + } else if (entity.getEnabledMark() == 1) { + model.setEnabledMark("正常"); + } else { + model.setEnabledMark("禁用"); + } + } + // 入职时间 + if (entity.getEntryDate() != null) { + String entryDate = sf1.format(entity.getEntryDate()); + model.setEntryDate(entryDate); + } + // 职级 + if (dataServiceMap3.containsKey(entity.getRanks())) { + model.setRanks(dataServiceMap3.get(entity.getRanks())); + } + modeList.add(model); + } + return exportUtil(selectKey, "用户信息", modeList, 0); + } + + private DownloadVO exportUtil(String selectKey, String explain, List modeList, int type) { + List list = JsonUtil.listToJsonField(JsonUtil.getJsonToList(modeList, UserExportVO.class)); + if (type == 1) { + list = JsonUtil.listToJsonField(JsonUtil.getJsonToList(modeList, UserExportExceptionVO.class)); + } + List entitys = new ArrayList<>(); + String[] splitData = selectKey.split(","); + if (splitData.length > 0) { + for (int i = 0; i < splitData.length; i++) { + if (splitData[i].equals("account")) { + entitys.add(new ExcelExportEntity("账号", "account")); + } + if (splitData[i].equals("realName")) { + entitys.add(new ExcelExportEntity("姓名", "realName")); + } + if (splitData[i].equals("gender")) { + entitys.add(new ExcelExportEntity("性别", "gender")); + } + if (splitData[i].equals("email")) { + entitys.add(new ExcelExportEntity("电子邮箱", "email")); + } + if (splitData[i].equals("organizeId")) { + entitys.add(new ExcelExportEntity("所属组织", "organizeId")); + } + if (splitData[i].equals("managerId")) { + entitys.add(new ExcelExportEntity("直属主管", "managerId")); + } + if (splitData[i].equals("positionId")) { + entitys.add(new ExcelExportEntity("岗位", "positionId")); + } + if (splitData[i].equals("ranks")) { + entitys.add(new ExcelExportEntity("职级", "ranks")); + } + if (splitData[i].equals("roleId")) { + entitys.add(new ExcelExportEntity("角色", "roleId")); + } + if (splitData[i].equals("sortCode")) { + entitys.add(new ExcelExportEntity("排序", "sortCode")); + } + if (splitData[i].equals("enabledMark")) { + entitys.add(new ExcelExportEntity("状态", "enabledMark")); + } + if (splitData[i].equals("description")) { + entitys.add(new ExcelExportEntity("说明", "description", 25)); + } + if (splitData[i].equals("nation")) { + entitys.add(new ExcelExportEntity("民族", "nation")); + } + if (splitData[i].equals("nativePlace")) { + entitys.add(new ExcelExportEntity("籍贯", "nativePlace")); + } + if (splitData[i].equals("entryDate")) { + entitys.add(new ExcelExportEntity("入职时间", "entryDate")); + } + if (splitData[i].equals("certificatesType")) { + entitys.add(new ExcelExportEntity("证件类型", "certificatesType")); + } + if (splitData[i].equals("certificatesNumber")) { + entitys.add(new ExcelExportEntity("证件号码", "certificatesNumber")); + } + if (splitData[i].equals("education")) { + entitys.add(new ExcelExportEntity("文化程度", "education")); + } + if (splitData[i].equals("birthday")) { + entitys.add(new ExcelExportEntity("出生年月", "birthday")); + } + if (splitData[i].equals("telePhone")) { + entitys.add(new ExcelExportEntity("办公电话", "telePhone")); + } + if (splitData[i].equals("landline")) { + entitys.add(new ExcelExportEntity("办公座机", "landline")); + } + if (splitData[i].equals("mobilePhone")) { + entitys.add(new ExcelExportEntity("手机号码", "mobilePhone")); + } + if (splitData[i].equals("urgentContacts")) { + entitys.add(new ExcelExportEntity("紧急联系", "urgentContacts")); + } + if (splitData[i].equals("urgentTelePhone")) { + entitys.add(new ExcelExportEntity("紧急电话", "urgentTelePhone")); + } + if (splitData[i].equals("postalAddress")) { + entitys.add(new ExcelExportEntity("通讯地址", "postalAddress", 25)); + } + if (splitData[i].equals("errorsInfo")) { + entitys.add(new ExcelExportEntity("异常原因", "errorsInfo", 50)); + } + } + } + ExportParams exportParams = new ExportParams(null, "用户信息"); + exportParams.setType(ExcelType.XSSF); + + DownloadVO vo = DownloadVO.builder().build(); + try { + @Cleanup + Workbook workbook = new HSSFWorkbook(); + if (entitys.size() > 0) { + workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list); + } + String name = explain + DateUtil.dateFormatByPattern(new Date(), "yyyyMMddHHmmss") + ".xlsx"; + MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, name); + String temporaryFilePath = configValueUtil.getTemporaryFilePath(); + FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, name); + vo.setName(fileInfo.getFilename()); + vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + name); + } catch (Exception e) { + log.error("用户信息导出Excel错误:" + e.getMessage()); + } + return vo; + } + + @Override + public Map importPreview(List personList) { + List> dataRow = new ArrayList<>(); + List> columns = new ArrayList<>(); + for (int i = 0; i < personList.size(); i++) { + Map dataRowMap = new HashMap<>(); + UserExportVO model = personList.get(i); + dataRowMap.put("account", model.getAccount()); + dataRowMap.put("realName", model.getRealName()); + dataRowMap.put("organizeId", model.getOrganizeId()); + dataRowMap.put("managerId", model.getManagerId()); + dataRowMap.put("positionId", model.getPositionId()); + dataRowMap.put("roleId", model.getRoleId()); + dataRowMap.put("description", model.getDescription()); + dataRowMap.put("gender", model.getGender()); + dataRowMap.put("nation", model.getNation()); + dataRowMap.put("nativePlace", model.getNativePlace()); + dataRowMap.put("certificatesType", model.getCertificatesType()); + dataRowMap.put("certificatesNumber", model.getCertificatesNumber()); + dataRowMap.put("education", model.getEducation()); + dataRowMap.put("birthday", model.getBirthday()); + dataRowMap.put("telePhone", model.getTelePhone()); + dataRowMap.put("landline", model.getLandline()); + dataRowMap.put("mobilePhone", model.getMobilePhone()); + dataRowMap.put("email", model.getEmail()); + dataRowMap.put("urgentContacts", model.getUrgentContacts()); + dataRowMap.put("urgentTelePhone", model.getUrgentTelePhone()); + dataRowMap.put("postalAddress", model.getPostalAddress()); + dataRowMap.put("sortCode", model.getSortCode()); + dataRowMap.put("enabledMark", model.getEnabledMark()); + dataRowMap.put("entryDate", model.getEntryDate()); + dataRowMap.put("ranks", model.getRanks()); + dataRow.add(dataRowMap); + } + for (int i = 1; i <= personList.size(); i++) { + Map columnsMap = new HashMap<>(); + columnsMap.put("AllowDBNull", true); + columnsMap.put("AutoIncrement", false); + columnsMap.put("AutoIncrementSeed", 0); + columnsMap.put("AutoIncrementStep", 1); + columnsMap.put("Caption", this.getColumns(i)); + columnsMap.put("ColumnMapping", 1); + columnsMap.put("ColumnName", this.getColumns(i)); + columnsMap.put("Container", null); + columnsMap.put("DataType", + "System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"); + columnsMap.put("DateTimeMode", 3); + columnsMap.put("DefaultValue", null); + columnsMap.put("DesignMode", false); + columnsMap.put("Expression", ""); + columnsMap.put("ExtendedProperties", ""); + columnsMap.put("MaxLength", -1); + columnsMap.put("Namespace", ""); + columnsMap.put("Ordinal", 0); + columnsMap.put("Prefix", ""); + columnsMap.put("ReadOnly", false); + columnsMap.put("Site", null); + columnsMap.put("Table", personList); + columnsMap.put("Unique", false); + columns.add(columnsMap); + } + Map map = new HashMap<>(); + map.put("dataRow", dataRow); + map.put("columns", columns); + return map; + } + + @Override + public UserImportVO importData(List dataList) { + // List importModels = new ArrayList<>(16); + List exceptionList = new ArrayList<>(16); + // 得到民族集合 + List dataServiceList = dictionaryDataService.getListByTypeDataCode("Nation"); + BiMap dataServiceMap = HashBiMap.create(dataServiceList.stream() + .collect(Collectors.toMap(DictionaryDataEntity::getId, DictionaryDataEntity::getFullName))); + // 得到证件类型 + List dataServiceList1 = dictionaryDataService.getListByTypeDataCode("certificateType"); + BiMap dataServiceMap1 = HashBiMap.create(dataServiceList1.stream() + .collect(Collectors.toMap(DictionaryDataEntity::getId, DictionaryDataEntity::getFullName))); + // 得到文化程度 + List dataServiceList2 = dictionaryDataService.getListByTypeDataCode("Education"); + BiMap dataServiceMap2 = HashBiMap.create(dataServiceList2.stream() + .collect(Collectors.toMap(DictionaryDataEntity::getId, DictionaryDataEntity::getFullName))); + // 得到职级 + List dataServiceList3 = dictionaryDataService.getListByTypeDataCode("Rank"); + BiMap dataServiceMap3 = HashBiMap.create(dataServiceList3.stream() + .collect(Collectors.toMap(DictionaryDataEntity::getId, DictionaryDataEntity::getFullName))); + // 得到性别 + List dataServiceList4 = dictionaryDataService.getListByTypeDataCode("sex"); + BiMap dataServiceMap4 = HashBiMap.create(dataServiceList4.stream() + .collect(Collectors.toMap(DictionaryDataEntity::getEnCode, DictionaryDataEntity::getFullName))); + // // 去除重复的account + // Map collect = dataList.stream().filter(t -> + // StringUtil.isNotBlank(t.getAccount())).collect(Collectors.groupingBy(t -> + // t.getAccount(), Collectors.counting())); + // List collect1 = collect.entrySet().stream().filter(entry -> + // entry.getValue() > 1).map(entry -> + // entry.getKey()).collect(Collectors.toList()); + // for (String account : collect1) { + // List collect2 = dataList.stream().filter(t -> + // account.equals(t.getAccount())).collect(Collectors.toList()); + // dataList.removeAll(collect2); + // exceptionList.addAll(collect2); + // } + // Map userExportVOMap = + // dataList.stream().collect(Collectors.toMap(UserExportVO::getAccount, + // Function.identity())); + + // 记录成功了几条 + int sum = 0; + // 记录第几条失败 + int num = 0; + for (UserExportVO exportVO : dataList) { + UserImportModel model = new UserImportModel(); + UserExportExceptionVO exceptionVO = JsonUtil.getJsonToBean(exportVO, UserExportExceptionVO.class); + StringJoiner exceptionMsg = new StringJoiner(";"); + // 处理账号 + if (StringUtil.isNotEmpty(exportVO.getAccount())) { + UserEntity userByAccount = getUserByAccount(exportVO.getAccount()); + if (Objects.nonNull(userByAccount)) { + // 账号重复 + exceptionMsg.add("账号已存在"); + } + String regex = "^[a-z0-9A-Z\u4e00-\u9fa5]+$"; + if (!exportVO.getAccount().matches(regex)) { + // 账号重复 + exceptionMsg.add("账户值不能含有特殊符号"); + } + model.setAccount(exportVO.getAccount()); + } else { + // 账号为空 + exceptionMsg.add("账号不能为空"); + } + // 处理姓名 + if (StringUtil.isEmpty(exportVO.getRealName())) { + // 姓名为空 + exceptionMsg.add("姓名不能为空"); + } + model.setRealName(exportVO.getRealName()); + // 处理组织id + String organizeId = exportVO.getOrganizeId(); + if (StringUtil.isEmpty(organizeId)) { + // 判断如果所属组织为空,则为错误数据 + exceptionMsg.add("所属组织不能为空"); + } else { + StringJoiner orgName = new StringJoiner("、"); + // 处理多级组织 + String[] organizeIds = organizeId.split(";"); + // 储存字段 + StringJoiner orgIds = new StringJoiner(","); + // 处理单个组织 + for (String id : organizeIds) { + String[] split = id.split("/"); + // 定义一个标志,当前部门如果不存在则存到错误集合中 + if (split.length > 0) { + for (int i = 0; i < split.length; i++) { + String orgId = split[i]; + OrganizeEntity organizeEntity = organizeService.getInfoByFullName(orgId); + if (organizeEntity != null) { + if (i == split.length - 1) { + orgIds.add(organizeEntity.getId()); + } + } else { + orgName.add(id); + break; + } + } + } + } + if (orgName.length() > 0) { + exceptionMsg.add("找不到该所属组织(" + orgName.toString() + ")"); + } else { + model.setOrganizeId(orgIds.toString()); + } + } + // 处理性别 + if (StringUtil.isEmpty(exportVO.getGender())) { + // 性别为必填项,不给默认为错误,不给默认值 + exceptionMsg.add("性别不能为空"); + } else { + if (dataServiceMap4.containsValue(exportVO.getGender())) { + model.setGender(dataServiceMap4.inverse().get(exportVO.getGender())); + } else { + exceptionMsg.add("找不到该性别"); + } + } + // 处理主管id + String managerId = exportVO.getManagerId(); + if (StringUtil.isNotEmpty(managerId)) { + String[] split1 = managerId.split("/"); + if (split1.length > 0) { + String account = split1[split1.length - 1]; + UserEntity entity = getUserByAccount(account); + if (Objects.nonNull(entity) && StringUtil.isNotEmpty(entity.getAccount())) { + model.setManagerId(entity.getId()); + } + } + } + String tmpOrganizeId = StringUtil.isEmpty(model.getOrganizeId()) ? "" : model.getOrganizeId(); + // 处理岗位id + String positionId = exportVO.getPositionId(); + if (StringUtil.isNotEmpty(positionId)) { + StringBuilder positionIdBuffer = new StringBuilder(); + String[] positionIds = positionId.split(","); + for (String id : positionIds) { + // 岗位名称+编码 + String[] positionName = id.split("/"); + // 无编码无名称代表是无用数据,不予保存 + if (positionName.length > 1) { + // 通过名称和编码获取岗位信息 + List positionEntityList = positionService.getListByFullName(positionName[0], + positionName[1]); + if (positionEntityList != null && positionEntityList.size() > 0) { + PositionEntity positionEntity = positionEntityList.get(0); + String[] split = tmpOrganizeId.split(","); + boolean flag = false; + for (String orgId : split) { + List list = positionService + .getListByOrganizeId(Collections.singletonList(orgId), false); + if (list.stream().anyMatch(t -> t.getId().equals(positionEntity.getId()))) { + flag = true; + break; + } + } + if (flag) { + positionIdBuffer.append("," + positionEntity.getId()); + } + } + } + } + model.setPositionId(positionIdBuffer.toString().replaceFirst(",", "")); + } + // 处理角色id + if (StringUtil.isNotEmpty(exportVO.getRoleId())) { + String[] roleNames = exportVO.getRoleId().split(","); + StringBuilder roleId = new StringBuilder(); + for (String roleName : roleNames) { + RoleEntity roleEntity = roleService.getInfoByFullName(roleName); + if (roleEntity == null) { + continue; + } + // 角色不是全局的情况下 需要验证是否跟组织挂钩 + String[] split = tmpOrganizeId.split(","); + boolean flag = false; + for (String orgId : split) { + if (organizeRelationService.existByRoleIdAndOrgId(roleEntity.getId(), orgId)) { + flag = true; + break; + } + } + if (Objects.nonNull(roleEntity) && (roleEntity.getGlobalMark() == 1 || flag)) { + roleId.append(",").append(roleEntity.getId()); + } + } + model.setRoleId(roleId.toString().replaceFirst(",", "")); + } + model.setDescription(exportVO.getDescription()); + // 处理民族 + if (StringUtil.isNotEmpty(exportVO.getNation())) { + if (dataServiceMap.containsValue(exportVO.getNation())) { + model.setNation(dataServiceMap.inverse().get(exportVO.getNation())); + } + } + model.setNativePlace(exportVO.getNativePlace()); + // 处理证件类型 + if (StringUtil.isNotEmpty(exportVO.getCertificatesType())) { + if (dataServiceMap1.containsValue(exportVO.getCertificatesType())) { + model.setCertificatesType(dataServiceMap1.inverse().get(exportVO.getCertificatesType())); + } + } + model.setCertificatesNumber(exportVO.getCertificatesNumber()); + // 处理文化程度 + if (StringUtil.isNotEmpty(exportVO.getEducation())) { + if (dataServiceMap2.containsValue(exportVO.getEducation())) { + model.setEducation(dataServiceMap2.inverse().get(exportVO.getEducation())); + } + } + // 处理生日 + if (StringUtil.isNotEmpty(exportVO.getBirthday())) { + Date date = DateUtil.stringToDate(exportVO.getBirthday()); + model.setBirthday(date); + } + model.setTelePhone(exportVO.getTelePhone()); + model.setMobilePhone(exportVO.getMobilePhone()); + model.setLandline(exportVO.getLandline()); + model.setEmail(exportVO.getEmail()); + model.setUrgentContacts(exportVO.getUrgentContacts()); + model.setUrgentTelePhone(exportVO.getUrgentTelePhone()); + model.setPostalAddress(exportVO.getPostalAddress()); + model.setSortCode(exportVO.getSortCode() == null ? 0 : exportVO.getSortCode()); + // 入职时间 + if (StringUtil.isNotEmpty(exportVO.getEntryDate())) { + Date date = DateUtil.stringToDate(exportVO.getEntryDate()); + model.setEntryDate(date); + } + // 设置状态 + if ("锁定".equals(exportVO.getEnabledMark())) { + model.setEnabledMark(2); + } else if ("正常".equals(exportVO.getEnabledMark())) { + model.setEnabledMark(1); + } else { + model.setEnabledMark(0); + } + // 处理证件类型 + if (StringUtil.isNotEmpty(exportVO.getRanks())) { + if (dataServiceMap3.containsValue(exportVO.getRanks())) { + model.setRanks(dataServiceMap3.inverse().get(exportVO.getRanks())); + } + } + if (exceptionMsg.length() > 0) { + exceptionVO.setErrorsInfo(exceptionMsg.toString()); + exceptionList.add(exceptionVO); + continue; + } + UserEntity entitys = JsonUtil.getJsonToBean(model, UserEntity.class); + entitys.setHeadIcon("001.png"); + entitys.setPassword("4a7d1ed414474e4033ac29ccb8653d9b"); + try { + create(entitys); + sum++; + } catch (Exception e) { + if (e instanceof DataException) { + exceptionVO.setErrorsInfo(e.getMessage()); + } else { + exceptionVO.setErrorsInfo("数据有误"); + } + exceptionList.add(exceptionVO); + log.error("导入第" + (num + 1) + "条数据失败"); + } + } + UserImportVO vo = new UserImportVO(); + vo.setSnum(sum); + if (exceptionList.size() > 0) { + vo.setResultType(1); + vo.setFailResult(exceptionList); + vo.setFnum(exceptionList.size()); + return vo; + } else { + vo.setResultType(0); + return vo; + } + } + + @Override + public void getOrganizeIdTree(String organizeId, StringBuffer organizeParentIdList) { + OrganizeEntity entity = organizeService.getInfo(organizeId); + if (Objects.nonNull(entity) && StringUtil.isNotEmpty(entity.getParentId())) { + // 记录id + organizeParentIdList.append(organizeId + ","); + getOrganizeIdTree(entity.getParentId(), organizeParentIdList); + } + } + + @Override + public DownloadVO exportExceptionData(List dataList) { + DownloadVO vo = exportUtil( + "account,realName,gender,email,organizeId,managerId,positionId,roleId,sortCode,enabledMark,description,nation," + + + "nativePlace,entryDate,certificatesType,certificatesNumber,education,birthday,telePhone,landline,mobilePhone,urgentContacts," + + + "urgentTelePhone,postalAddress,ranks,errorsInfo", + "错误报告", dataList, 1); + return vo; + } + + @Override + public List getUserName(List id, Pagination pagination) { + List list = new ArrayList<>(); + id.removeAll(Collections.singleton(null)); + if (id.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (!StringUtil.isEmpty(pagination.getKeyword())) { + queryWrapper.lambda().and( + t -> t.like(UserEntity::getRealName, pagination.getKeyword()) + .or().like(UserEntity::getAccount, pagination.getKeyword())); + } + queryWrapper.lambda().in(UserEntity::getId, id); + queryWrapper.lambda().ne(UserEntity::getEnabledMark, 0); + queryWrapper.lambda().select(UserEntity::getId, UserEntity::getRealName, UserEntity::getAccount, + UserEntity::getGender, UserEntity::getHeadIcon, UserEntity::getMobilePhone); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage iPage = this.page(page, queryWrapper); + return pagination.setData(iPage.getRecords(), iPage.getTotal()); + } + return pagination.setData(list, list.size()); + } + + @Override + public List getUserNames(List id, PaginationUser pagination, Boolean flag, + Boolean enabledMark) { + List list = new ArrayList<>(); + id.removeAll(Collections.singleton(null)); + if (id.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (!StringUtil.isEmpty(pagination.getKeyword())) { + queryWrapper.lambda().and( + t -> t.like(UserEntity::getRealName, pagination.getKeyword()) + .or().like(UserEntity::getAccount, pagination.getKeyword()) + .or().like(UserEntity::getMobilePhone, pagination.getKeyword())); + } + List> lists = Lists.partition(id, 1000); + queryWrapper.lambda().and(t -> { + for (List userId : lists) { + t.or().in(UserEntity::getId, userId); + } + }); + if (flag) { + queryWrapper.lambda().ne(UserEntity::getId, UserProvider.getUser().getUserId()); + } + if (enabledMark) { + queryWrapper.lambda().ne(UserEntity::getEnabledMark, 0); + } + if (StringUtil.isNotEmpty(pagination.getGender())) { + queryWrapper.lambda().eq(UserEntity::getGender, pagination.getGender()); + } + queryWrapper.lambda().orderByDesc(UserEntity::getCreatorTime); + // queryWrapper.lambda().select(UserEntity::getId, UserEntity::getRealName, + // UserEntity::getAccount, + // UserEntity::getGender, UserEntity::getMobilePhone); + if (ObjectUtil.isEmpty(pagination) || Objects.equals(pagination.getDataType(), 1)) { + return this.list(queryWrapper); + } + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage iPage = this.page(page, queryWrapper); + return pagination.setData(iPage.getRecords(), iPage.getTotal()); + } + return ObjectUtil.isEmpty(pagination) ? new ArrayList<>() : pagination.setData(list, list.size()); + } + + @Override + public List getListByRoleId(String roleId) { + List list = new ArrayList<>(); + // 根据roleId获取,用户与组织的关联对象集合 + userRelationService.getListByRoleId(roleId).forEach(u -> { + list.add(this.getInfo(u.getUserId())); + }); + return list; + } + + @Override + public List getListByRoleIds(List roleIds) { + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(UserRelationEntity::getObjectType, "role").in(UserRelationEntity::getObjectId, roleIds); + List list = userRelationService.list(query); + if (CollectionUtil.isNotEmpty(list)) { + List userIds = list.stream().map(UserRelationEntity::getUserId).collect(Collectors.toList()); + return listByIds(userIds); + } + return new ArrayList<>(); + } + + @Override + public List getFullNameByIds(List ids) { + List list = new ArrayList<>(); + if (ids != null) { + ids.forEach(selectedId -> { + if (StringUtil.isNotEmpty(selectedId)) { + String[] split = selectedId.split("--"); + // 截取type后获取详情 + if (split.length > 1) { + String type = split[1]; + if (com.yunzhupaas.constant.PermissionConst.COMPANY.equalsIgnoreCase(type) + || com.yunzhupaas.constant.PermissionConst.DEPARTMENT.equalsIgnoreCase(type)) { + OrganizeEntity organizeEntity = organizeService.getInfo(split[0]); + if (organizeEntity != null) { + list.add(organizeEntity.getFullName()); + } + } else if (com.yunzhupaas.constant.PermissionConst.ROLE.equalsIgnoreCase(type)) { + RoleEntity roleEntity = roleService.getInfo(split[0]); + if (roleEntity != null) { + list.add(roleEntity.getFullName()); + } + } else if (com.yunzhupaas.constant.PermissionConst.POSITION.equalsIgnoreCase(type)) { + PositionEntity positionEntity = positionService.getInfo(split[0]); + if (positionEntity != null) { + list.add(positionEntity.getFullName()); + } + } else if (com.yunzhupaas.constant.PermissionConst.GROUP.equalsIgnoreCase(type)) { + GroupEntity groupEntity = groupService.getInfo(split[0]); + if (groupEntity != null) { + list.add(groupEntity.getFullName()); + } + } else if ("user".equalsIgnoreCase(type)) { + UserEntity userEntity = this.getInfo(split[0]); + if (userEntity != null) { + list.add(userEntity.getRealName()); + } + } + } else { + UserEntity userEntity = this.getInfo(split[0]); + if (userEntity != null) { + list.add(userEntity.getRealName()); + } + } + } + }); + } + return list; + } + + @Override + public List selectedByIds(List ids) { + List list = new ArrayList<>(); + if (ids != null) { + Map orgIdNameMaps = organizeService.getInfoList(); + ids.forEach(selectedId -> { + if (StringUtil.isNotEmpty(selectedId)) { + // 判断是否为系统参数 + if (YunzhupaasConst.SYSTEM_PARAM.containsKey(selectedId)) { + UserIdListVo vo = new UserIdListVo(); + vo.setId(selectedId); + vo.setFullName(YunzhupaasConst.SYSTEM_PARAM.get(selectedId)); + } + String[] split = selectedId.split("--"); + // 截取type后获取详情 + if (split.length > 1) { + String type = split[1]; + if (com.yunzhupaas.constant.PermissionConst.COMPANY.equalsIgnoreCase(type) + || com.yunzhupaas.constant.PermissionConst.DEPARTMENT.equalsIgnoreCase(type)) { + OrganizeEntity organizeEntity = organizeService.getInfo(split[0]); + if (organizeEntity != null) { + UserIdListVo vo = JsonUtil.getJsonToBean(organizeEntity, UserIdListVo.class); + if ("department".equals(organizeEntity.getCategory())) { + vo.setIcon("icon-ym icon-ym-tree-department1"); + } else if ("company".equals(organizeEntity.getCategory())) { + vo.setIcon("icon-ym icon-ym-tree-organization3"); + } + vo.setOrganize(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, + organizeEntity.getOrganizeIdTree(), "/")); + vo.setOrganizeIds(organizeService.getOrgIdTree(organizeEntity)); + vo.setType(organizeEntity.getCategory()); + list.add(vo); + } + } else if (com.yunzhupaas.constant.PermissionConst.ROLE.equalsIgnoreCase(type)) { + RoleEntity roleEntity = roleService.getInfo(split[0]); + if (roleEntity != null) { + UserIdListVo vo = JsonUtil.getJsonToBean(roleEntity, UserIdListVo.class); + // 获取角色的所属组织 + List relationListByRoleId = organizeRelationService + .getRelationListByRoleId(vo.getId()); + StringJoiner orgName = new StringJoiner(","); + relationListByRoleId.forEach(organizeRelationEntity -> { + String organizeId = organizeRelationEntity.getOrganizeId(); + OrganizeEntity entity = organizeService.getInfo(organizeId); + if (entity != null) { + String fullNameByOrgIdTree = organizeService + .getFullNameByOrgIdTree(orgIdNameMaps, entity.getOrganizeIdTree(), "/"); + orgName.add(fullNameByOrgIdTree); + } + }); + vo.setOrganize(orgName.toString()); + vo.setType("role"); + vo.setIcon("icon-ym icon-ym-generator-role"); + list.add(vo); + } + } else if (com.yunzhupaas.constant.PermissionConst.POSITION.equalsIgnoreCase(type)) { + PositionEntity positionEntity = positionService.getInfo(split[0]); + if (positionEntity != null) { + UserIdListVo vo = JsonUtil.getJsonToBean(positionEntity, UserIdListVo.class); + OrganizeEntity info = organizeService.getInfo(positionEntity.getOrganizeId()); + if (info != null) { + vo.setOrganize(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, + info.getOrganizeIdTree(), "/")); + } + vo.setType("position"); + vo.setIcon("icon-ym icon-ym-tree-position1"); + list.add(vo); + } + } else if (com.yunzhupaas.constant.PermissionConst.GROUP.equalsIgnoreCase(type)) { + GroupEntity groupEntity = groupService.getInfo(split[0]); + if (groupEntity != null) { + UserIdListVo vo = JsonUtil.getJsonToBean(groupEntity, UserIdListVo.class); + vo.setIcon("icon-ym icon-ym-generator-group1"); + vo.setType("group"); + list.add(vo); + } + } else if ("user".equalsIgnoreCase(type)) { + UserEntity userEntity = this.getInfo(split[0]); + if (userEntity != null) { + UserIdListVo vo = JsonUtil.getJsonToBean(userEntity, UserIdListVo.class); + List listByObjectType = userRelationService.getListByObjectType( + userEntity.getId(), com.yunzhupaas.constant.PermissionConst.ORGANIZE); + StringJoiner orgName = new StringJoiner(","); + listByObjectType.forEach(userRelationEntity -> { + OrganizeEntity info = organizeService.getInfo(userRelationEntity.getObjectId()); + if (info != null) { + String fullNameByOrgIdTree = organizeService + .getFullNameByOrgIdTree(orgIdNameMaps, info.getOrganizeIdTree(), "/"); + orgName.add(fullNameByOrgIdTree); + } + }); + vo.setOrganize(orgName.toString()); + vo.setType("user"); + vo.setHeadIcon(UploaderUtil.uploaderImg(vo.getHeadIcon())); + vo.setFullName(vo.getRealName() + "/" + vo.getAccount()); + list.add(vo); + } + } else { + UserIdListVo vo = new UserIdListVo(); + vo.setId(split[0]); + vo.setFullName(YunzhupaasConst.SYSTEM_PARAM.get(selectedId)); + vo.setType(split[1]); + list.add(vo); + } + } else { + UserEntity userEntity = this.getInfo(split[0]); + if (userEntity != null) { + UserIdListVo vo = JsonUtil.getJsonToBean(userEntity, UserIdListVo.class); + List listByObjectType = userRelationService.getListByObjectType( + userEntity.getId(), com.yunzhupaas.constant.PermissionConst.ORGANIZE); + StringJoiner orgName = new StringJoiner(","); + listByObjectType.forEach(userRelationEntity -> { + OrganizeEntity info = organizeService.getInfo(userRelationEntity.getObjectId()); + if (info != null) { + String fullNameByOrgIdTree = organizeService.getFullNameByOrgIdTree(orgIdNameMaps, + info.getOrganizeIdTree(), "/"); + orgName.add(fullNameByOrgIdTree); + } + }); + vo.setOrganize(orgName.toString()); + vo.setType("user"); + vo.setHeadIcon(UploaderUtil.uploaderImg(vo.getHeadIcon())); + vo.setFullName(vo.getRealName() + "/" + vo.getAccount()); + list.add(vo); + } + } + } + }); + } + return list; + } + + @Override + public Boolean delCurRoleUser(String message, List objectIdAll) { + List list = permissionGroupService.list(objectIdAll).stream() + .filter(t -> Objects.equals(t.getEnabledMark(), 1)).collect(Collectors.toList()); + List member = list.stream().filter(t -> StringUtil.isNotEmpty(t.getPermissionMember())) + .map(PermissionGroupEntity::getPermissionMember).collect(Collectors.toList()); + List userIdList = new ArrayList<>(); + if (list.stream().filter(t -> Objects.equals(t.getType(), 0)).count() > 0) { + userIdList.addAll(getUserMap().keySet()); + } else { + // 判断角色下面的人 + userIdList.addAll(this.getUserIdList(member, null)); + } + delCurUser(message, userIdList, 3); + return true; + } + + @Override + public List getList(List orgIdList, String keyword) { + // 得到用户关系表 + List listByObjectId = userRelationService.getListByOrgId(orgIdList); + if (listByObjectId.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .in(UserEntity::getId, + listByObjectId.stream().map(UserRelationEntity::getUserId).collect(Collectors.toList())) + .and( + t -> t.like(UserEntity::getRealName, keyword) + .or().like(UserEntity::getAccount, keyword)); + return this.list(queryWrapper); + } + + @Override + public List getUserIdList(List userIds, String type) { + Set allUserId = new HashSet<>(userIds); + String organizeId = UserProvider.getUser().getOrganizeId(); + List newUserIds = new ArrayList<>(userIds); + newUserIds.forEach(t -> { + String[] split = t.split(","); + for (String id : split) { + allUserId.add(id); + } + }); + userIds.forEach(userId -> { + // 处理系统参数 + if (YunzhupaasConst.SYSTEM_PARAM.containsKey(userId)) { + if (YunzhupaasConst.CURRENT_GRADE.equals(userId) || YunzhupaasConst.CURRENT_GRADE_TYPE.equals(userId)) { + List organizeUserList = organizeAdministratorService + .getOrganizeUserList(YunzhupaasConst.CURRENT_ORG_SUB); + organizeUserList + .forEach(t -> allUserId.add(t + "--" + com.yunzhupaas.constant.PermissionConst.COMPANY)); + } else { + if (StringUtil.isNotEmpty(organizeId)) { + allUserId.add(organizeId + "--" + com.yunzhupaas.constant.PermissionConst.COMPANY); + } + if (YunzhupaasConst.CURRENT_ORG_SUB.equals(userId) + || YunzhupaasConst.CURRENT_ORG_SUB_TYPE.equals(userId)) { + List underOrganizations = organizeService.getUnderOrganizations(organizeId, true); + underOrganizations.add(organizeId); + underOrganizations.forEach( + t -> allUserId.add(t + "--" + com.yunzhupaas.constant.PermissionConst.COMPANY)); + } + } + } + }); + Set userRelationEntities = new LinkedHashSet<>(); + if (allUserId != null) { + allUserId.forEach(userId -> { + // if (StringUtil.isEmpty(type) || PermissionConst.USER.equals(type)) { + String[] split = userId.split("--"); + if (split.length > 1) { + String orgType = split[1]; + List listByObjectId = new ArrayList<>(16); + if (com.yunzhupaas.constant.PermissionConst.COMPANY.equalsIgnoreCase(orgType) + || com.yunzhupaas.constant.PermissionConst.DEPARTMENT.equalsIgnoreCase(orgType)) { + // // 得到子组织Id + // List orgIds = organizeService.getUnderOrganizations(split[0], true); + // orgIds.add(split[0]); + List orgIds = new ArrayList<>(); + orgIds.add(split[0]); + listByObjectId = userRelationService.getListByOrgId(orgIds).stream() + .map(UserRelationEntity::getUserId).collect(Collectors.toList()); + } else if ("user".equalsIgnoreCase(orgType)) { + userRelationEntities.add(split[0]); + } else { + if (com.yunzhupaas.constant.PermissionConst.ROLE.equalsIgnoreCase(orgType)) { + orgType = com.yunzhupaas.constant.PermissionConst.ROLE; + } else if (com.yunzhupaas.constant.PermissionConst.ORGANIZE.equalsIgnoreCase(orgType)) { + orgType = com.yunzhupaas.constant.PermissionConst.ORGANIZE; + } else if (com.yunzhupaas.constant.PermissionConst.POSITION.equalsIgnoreCase(orgType)) { + orgType = com.yunzhupaas.constant.PermissionConst.POSITION; + } else if (com.yunzhupaas.constant.PermissionConst.GROUP.equalsIgnoreCase(orgType)) { + orgType = com.yunzhupaas.constant.PermissionConst.GROUP; + } + listByObjectId = userRelationService.getListByObjectId(split[0], orgType).stream() + .map(UserRelationEntity::getUserId).collect(Collectors.toList()); + } + userRelationEntities.addAll(listByObjectId); + } else if (split.length > 0) { + userRelationEntities.add(split[0]); + } + // } else { + // String[] split = userId.split("--"); + // if (split.length > 1) { + // String orgType = split[1]; + // if (PermissionConst.ROLE.equals(type)) { + // if (PermissionConst.COMPANY.equalsIgnoreCase(orgType) || + // PermissionConst.DEPARTMENT.equalsIgnoreCase(orgType)) { + // // 得到子组织Id + // List orgIds = organizeService.getUnderOrganizations(split[0], true); + // orgIds.add(split[0]); + // List roleIdsByOrgIds = + // organizeRelationService.getRelationListByOrganizeId(orgIds, + // type).stream().map(OrganizeRelationEntity::getObjectId).collect(Collectors.toList()); + // List roleIds = roleService.getListByIds(roleIdsByOrgIds, null, + // true).stream().map(RoleEntity::getId).collect(Collectors.toList()); + // userRelationEntities.addAll(roleIds); + // } + // } else if (PermissionConst.GROUP.equals(type)) { + // if (PermissionConst.COMPANY.equalsIgnoreCase(orgType) || + // PermissionConst.DEPARTMENT.equalsIgnoreCase(orgType)) { + // // 得到子组织Id + // List orgIds = organizeService.getUnderOrganizations(split[0], true); + // orgIds.add(split[0]); + // List roleIdsByOrgIds = + // organizeRelationService.getRelationListByOrganizeId(orgIds, + // type).stream().map(OrganizeRelationEntity::getObjectId).collect(Collectors.toList()); + // List roleIds = groupService.getListByIds(roleIdsByOrgIds, + // true).stream().map(GroupEntity::getId).collect(Collectors.toList()); + // userRelationEntities.addAll(roleIds); + // } + // } + // } + // } + }); + } + return new ArrayList<>(userRelationEntities); + } + + @Override + public List getObjList(List userIds, Pagination pagination, String type) { + List jsonToList = new ArrayList<>(); + List userRelationEntities = getUserIdList(userIds, type); + if (StringUtil.isEmpty(type) || com.yunzhupaas.constant.PermissionConst.USER.equals(type)) { + // 得到所有的用户id关系 + Map orgIdNameMaps = organizeService.getInfoList(); + PaginationUser paginationUser = JsonUtil.getJsonToBean(pagination, PaginationUser.class); + List userEntityList = getUserNames(userRelationEntities, paginationUser, false, true); + jsonToList = JsonUtil.getJsonToList(userEntityList, UserIdListVo.class); + jsonToList.forEach(userIdListVo -> { + List listByObjectType = userRelationService + .getListByObjectType(userIdListVo.getId(), com.yunzhupaas.constant.PermissionConst.ORGANIZE); + StringJoiner orgName = new StringJoiner(","); + listByObjectType.forEach(userRelationEntity -> { + OrganizeEntity info = organizeService.getInfo(userRelationEntity.getObjectId()); + if (info != null) { + String fullNameByOrgIdTree = organizeService.getFullNameByOrgIdTree(orgIdNameMaps, + info.getOrganizeIdTree(), "/"); + orgName.add(fullNameByOrgIdTree); + } + }); + userIdListVo.setOrganize(orgName.toString()); + userIdListVo.setType("user"); + + userIdListVo.setFullName(userIdListVo.getRealName() + "/" + userIdListVo.getAccount()); + userIdListVo.setHeadIcon(UploaderUtil.uploaderImg(userIdListVo.getHeadIcon())); + }); + } else if (com.yunzhupaas.constant.PermissionConst.ROLE.equals(type)) { + List roleEntityList = roleService.getListByIds(userRelationEntities, null, true); + jsonToList = JsonUtil.getJsonToList(roleEntityList, UserIdListVo.class); + jsonToList.forEach(userIdListVo -> { + userIdListVo.setType("role"); + userIdListVo.setIcon("icon-ym icon-ym-generator-group1"); + }); + } else if (com.yunzhupaas.constant.PermissionConst.GROUP.equals(type)) { + List groupEntityList = groupService.getListByIds(userRelationEntities, true); + jsonToList = JsonUtil.getJsonToList(groupEntityList, UserIdListVo.class); + jsonToList.forEach(userIdListVo -> { + userIdListVo.setType("group"); + userIdListVo.setIcon("icon-ym icon-ym-generator-group1"); + }); + } + return jsonToList; + } + + @Override + public List getListByAuthorize(String organizeId, com.yunzhupaas.base.Page page) { + List jsonToList = new ArrayList<>(16); + List collect0 = organizeAdministratorService.getListByAuthorize().stream().map(OrganizeEntity::getId) + .collect(Collectors.toList()); + // 有权限的组织 + Map orgMaps = organizeService.getOrganizeName(collect0, null, true, null); + Map orgIdNameMaps = organizeService.getInfoList(); + List dataServiceList4 = dictionaryDataService.getListByTypeDataCode("sex"); + Map dataServiceMap4 = dataServiceList4.stream() + .filter(t -> ObjectUtil.equal(t.getEnabledMark(), 1)) + .collect(Collectors.toMap(DictionaryDataEntity::getEnCode, DictionaryDataEntity::getFullName)); + // 判断是否搜索关键字 + if (StringUtil.isNotEmpty(page.getKeyword())) { + // 通过关键字查询 + List list = getList(new ArrayList<>(orgMaps.keySet()), page.getKeyword()); + // 遍历用户给要返回的值插入值 + for (UserEntity entity : list) { + UserByRoleVO vo = new UserByRoleVO(); + vo.setHeadIcon(UploaderUtil.uploaderImg(entity.getHeadIcon())); + vo.setId(entity.getId()); + vo.setFullName(entity.getRealName() + "/" + entity.getAccount()); + vo.setEnabledMark(entity.getEnabledMark()); + vo.setIsLeaf(true); + vo.setHasChildren(false); + vo.setIcon("icon-ym icon-ym-tree-user2"); + vo.setType("user"); + vo.setGender(dataServiceMap4.get(entity.getGender())); + List listByUserId = userRelationService.getListByUserId(entity.getId()).stream() + .filter(t -> t != null && PermissionConst.ORGANIZE.equals(t.getObjectType())) + .collect(Collectors.toList()); + StringBuilder stringBuilder = new StringBuilder(); + listByUserId.forEach(t -> { + OrganizeEntity organizeEntity = orgMaps.get(t.getObjectId()); + if (organizeEntity != null) { + String fullNameByOrgIdTree = organizeService.getFullNameByOrgIdTree(orgIdNameMaps, + organizeEntity.getOrganizeIdTree(), "/"); + if (StringUtil.isNotEmpty(fullNameByOrgIdTree)) { + stringBuilder.append("," + fullNameByOrgIdTree); + } + } + }); + if (stringBuilder.length() > 0) { + vo.setOrganize(stringBuilder.toString().replaceFirst(",", "")); + } + jsonToList.add(vo); + } + return jsonToList; + } + // 获取所有组织 + List collect = new ArrayList<>(orgMaps.values()); + // 判断时候传入组织id + // 如果传入组织id,则取出对应的子集 + if (!"0".equals(organizeId)) { + // 通过组织查询部门及人员 + OrganizeEntity organizeEntity = orgMaps.get(organizeId); + if (organizeEntity != null) { + // 取出子组织 + List collect1 = collect.stream().filter(t -> !t.getId().equals(organizeEntity.getId()) + && t.getOrganizeIdTree().contains(organizeEntity.getId())).collect(Collectors.toList()); + // 判断组织关系中是否有子部门id + List organizeEntities = new ArrayList<>(); + for (OrganizeEntity entity : collect1) { + OrganizeEntity organizeEntity1 = orgMaps.get(entity.getId()); + if (organizeEntity1 != null) { + organizeEntities.add(organizeEntity1); + } + } + // 得到子集的子集 + List collect2 = collect.stream().filter(t -> t.getOrganizeIdTree().contains(organizeId)) + .collect(Collectors.toList()); + // 移除掉上级不是同一个的 + List collect3 = new ArrayList<>(); + collect2.forEach(t -> { + organizeEntities.forEach(oe -> { + if (!oe.getId().equals(t.getId()) && t.getOrganizeIdTree().contains(oe.getId())) { + collect3.add(t); + } + }); + }); + organizeEntities.removeAll(collect3); + + // 取出组织下的人员 + List entityList = getListByOrganizeId(organizeId, null); + for (UserEntity entity : entityList) { + UserByRoleVO vo = new UserByRoleVO(); + vo.setId(entity.getId()); + vo.setHeadIcon(UploaderUtil.uploaderImg(entity.getHeadIcon())); + vo.setFullName(entity.getRealName() + "/" + entity.getAccount()); + vo.setEnabledMark(entity.getEnabledMark()); + vo.setIsLeaf(true); + vo.setHasChildren(false); + vo.setIcon("icon-ym icon-ym-tree-user2"); + vo.setType("user"); + vo.setGender(dataServiceMap4.get(entity.getGender())); + List listByUserId = userRelationService.getListByUserId(entity.getId()).stream() + .filter(t -> t != null && PermissionConst.ORGANIZE.equals(t.getObjectType())) + .collect(Collectors.toList()); + StringJoiner stringJoiner = new StringJoiner(","); + listByUserId.forEach(t -> { + OrganizeEntity organizeEntity1 = orgMaps.get(t.getObjectId()); + if (organizeEntity1 != null) { + String fullNameByOrgIdTree = organizeService.getFullNameByOrgIdTree(orgIdNameMaps, + organizeEntity1.getOrganizeIdTree(), "/"); + if (StringUtil.isNotEmpty(fullNameByOrgIdTree)) { + stringJoiner.add(fullNameByOrgIdTree); + } + } + }); + vo.setOrganize(stringJoiner.toString()); + jsonToList.add(vo); + } + for (OrganizeEntity entitys : organizeEntities) { + UserByRoleVO vo = new UserByRoleVO(); + vo.setId(entitys.getId()); + vo.setType(entitys.getCategory()); + vo.setFullName(entitys.getFullName()); + if ("department".equals(entitys.getCategory())) { + vo.setIcon("icon-ym icon-ym-tree-department1"); + } else { + vo.setIcon("icon-ym icon-ym-tree-organization3"); + } + vo.setHasChildren(true); + vo.setIsLeaf(false); + vo.setEnabledMark(entitys.getEnabledMark()); + if (StringUtil.isNotEmpty(entitys.getOrganizeIdTree())) { + String[] split = entitys.getOrganizeIdTree().split(organizeEntity.getId()); + if (split.length > 1) { + vo.setFullName(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, split[1], "/")); + } + } + jsonToList.add(vo); + } + } + return jsonToList; + } + List list = new ArrayList<>(16); + for (OrganizeEntity organizeEntity : collect) { + if (organizeEntity != null && organizeEntity.getEnabledMark() == 1) { + UserByRoleVO userByRoleVO = new UserByRoleVO(); + userByRoleVO.setId(organizeEntity.getId()); + userByRoleVO.setType(organizeEntity.getCategory()); + if ("department".equals(organizeEntity.getCategory())) { + userByRoleVO.setIcon("icon-ym icon-ym-tree-department1"); + } else { + userByRoleVO.setIcon("icon-ym icon-ym-tree-organization3"); + } + userByRoleVO.setHasChildren(true); + userByRoleVO.setIsLeaf(false); + userByRoleVO.setEnabledMark(organizeEntity.getEnabledMark()); + // 处理断层 + if (StringUtil.isNotEmpty(organizeEntity.getOrganizeIdTree())) { + List list1 = new ArrayList<>(); + String[] split = organizeEntity.getOrganizeIdTree().split(","); + list1 = Arrays.asList(split); + Collections.reverse(list1); + for (String orgId : list1) { + OrganizeEntity organizeEntity1 = orgMaps.get(orgId); + if (organizeEntity1 != null && !organizeEntity1.getId().equals(organizeEntity.getId())) { + // 记录id + list.add(organizeEntity.getId()); + break; + } + } + } + if (!list.contains(organizeEntity.getId())) { + jsonToList.add(userByRoleVO); + } + } + } + jsonToList.forEach(t -> { + OrganizeEntity entity = orgMaps.get(t.getId()); + if (entity != null) { + t.setFullName(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, entity.getOrganizeIdTree(), "/")); + } + t.setParentId(entity.getParentId()); + }); + return jsonToList; + } + + private String getColumns(Integer key) { + Map map = new HashMap<>(); + map.put(1, "账号"); + map.put(2, "姓名"); + map.put(3, "性别"); + map.put(4, "手机"); + map.put(5, "说明"); + map.put(6, "状态"); + map.put(7, "排序"); + map.put(8, "是否管理员"); + map.put(9, "锁定标志"); + map.put(10, "添加时间"); + map.put(11, "部门"); + return map.get(key); + } + + /** + * 判断上级是否直属主管的值是否为我的下属 + * + * @param id + * @param managerId + * @param num + */ + private boolean recursionSubordinates(String id, String managerId, int num) { + UserEntity entity = getInfo(managerId); + num++; + if (entity != null && entity.getId().equals(id)) { + return true; + } + if (num < 10) { + if (entity != null) { + return recursionSubordinates(id, entity.getManagerId(), num); + } + return false; + } else { + return false; + } + } + + /** + * 查询给定的条件是否有默认当前登录者的默认用户值 + * + * @param userConditionModel + * @return + */ + @Override + public String getDefaultCurrentValueUserId(UserConditionModel userConditionModel) { + UserInfo userInfo = UserProvider.getUser(); + int currentFinded = 0; + if (userConditionModel.getUserIds() != null && !userConditionModel.getUserIds().isEmpty() + && userConditionModel.getUserIds().contains(userInfo.getUserId())) { + currentFinded = 1; + } + if (currentFinded == 0 && userConditionModel.getDepartIds() != null + && !userConditionModel.getDepartIds().isEmpty()) { + List orgList = organizeService.getOrgEntityList(userConditionModel.getDepartIds(), true); + List orgLIdList = orgList.stream().map(OrganizeEntity::getId).collect(Collectors.toList()); + if (orgLIdList != null && !orgLIdList.isEmpty()) { + List userIds = userRelationService.getListByObjectIdAll(orgLIdList).stream() + .map(UserRelationEntity::getUserId).collect(Collectors.toList()); + if (userIds != null && !userIds.isEmpty() && userIds.contains(userInfo.getUserId())) { + currentFinded = 1; + } + } + } + if (currentFinded == 0 && userConditionModel.getRoleIds() != null + && !userConditionModel.getRoleIds().isEmpty()) { + List roleList = roleService.getListByIds(userConditionModel.getRoleIds(), null, false); + List roleIdList = roleList.stream().filter(t -> t.getEnabledMark() == 1).map(RoleEntity::getId) + .collect(Collectors.toList()); + if (roleIdList != null && !roleIdList.isEmpty()) { + List userIds = userRelationService.getListByObjectIdAll(roleIdList).stream() + .map(UserRelationEntity::getUserId).collect(Collectors.toList()); + if (userIds != null && !userIds.isEmpty() && userIds.contains(userInfo.getUserId())) { + currentFinded = 1; + } + } + } + if (currentFinded == 0 && userConditionModel.getPositionIds() != null + && !userConditionModel.getPositionIds().isEmpty()) { + List positionList = positionService.getPosList(userConditionModel.getPositionIds()); + List positionIdList = positionList.stream().filter(t -> t.getEnabledMark() == 1) + .map(PositionEntity::getId).collect(Collectors.toList()); + if (positionIdList != null && !positionIdList.isEmpty()) { + List userIds = userRelationService.getListByObjectIdAll(positionIdList).stream() + .map(UserRelationEntity::getUserId).collect(Collectors.toList()); + if (userIds != null && !userIds.isEmpty() && userIds.contains(userInfo.getUserId())) { + currentFinded = 1; + } + } + } + if (currentFinded == 0 && userConditionModel.getGroupIds() != null + && !userConditionModel.getGroupIds().isEmpty()) { + List groupList = groupService.getListByIds(userConditionModel.getGroupIds(), true); + List groupIdList = groupList.stream().map(GroupEntity::getId).collect(Collectors.toList()); + if (groupIdList != null && !groupIdList.isEmpty()) { + List userIds = userRelationService.getListByObjectIdAll(groupIdList).stream() + .map(UserRelationEntity::getUserId).collect(Collectors.toList()); + if (userIds != null && !userIds.isEmpty() && userIds.contains(userInfo.getUserId())) { + currentFinded = 1; + } + } + } + return (currentFinded == 1) ? userInfo.getUserId() : ""; + } + + /** + * 过滤超管和分管,不被退出 + * + * @param listUser + * @return + */ + @Override + public List filterOrgAdministrator(List listUser) { + if (CollectionUtil.isNotEmpty(listUser)) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(UserEntity::getId, UserEntity::getIsAdministrator); + queryWrapper.lambda().in(UserEntity::getId, listUser); + List collect = this.list(queryWrapper).stream().filter(t -> t.getIsAdministrator() == 1) + .map(UserEntity::getId).collect(Collectors.toList()); + QueryWrapper queryWrapper2 = new QueryWrapper<>(); + queryWrapper2.lambda().select(OrganizeAdministratorEntity::getId, OrganizeAdministratorEntity::getUserId); + queryWrapper2.lambda().in(OrganizeAdministratorEntity::getUserId, listUser); + List collect2 = organizeAdministratorService.list(queryWrapper2).stream() + .map(OrganizeAdministratorEntity::getUserId).collect(Collectors.toList()); + listUser = listUser.stream().filter(t -> !collect.contains(t) && !collect2.contains(t)) + .collect(Collectors.toList()); + } + return listUser; + } + + @Override + public List getUserAccount(List ids) { + List list = new ArrayList<>(); + if (!ids.isEmpty()) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(UserEntity::getAccount, ids); + list = this.list(queryWrapper); + } + return list; + } + + @Override + public void updateStand(List ids, int standing) { + List userName = getUserName(new ArrayList<>(ids), false); + for (UserEntity user : userName) { + String positionId = user.getPositionId(); + String organizeId = user.getOrganizeId(); + String id = user.getId(); + if (organizeRelationService.checkBasePermission(id, user.getOrganizeId(), null).size() == 0) { + List userOrgList = userRelationService.getListByUserIdAndObjType(id, + PermissionConst.ORGANIZE); + for (UserRelationEntity entity : userOrgList) { + if (organizeRelationService.checkBasePermission(entity.getUserId(), entity.getObjectId(), null) + .size() > 0) { + organizeId = entity.getObjectId(); + positionId = organizeRelationService.autoGetMajorPositionId(entity.getUserId(), + entity.getObjectId(), user.getPositionId()); + break; + } + } + } + UpdateWrapper wrapper = new UpdateWrapper<>(); + wrapper.lambda().eq(UserEntity::getId, id); + wrapper.lambda().set(UserEntity::getOrganizeId, organizeId); + wrapper.lambda().set(UserEntity::getPositionId, positionId); + update(wrapper); + } + if (!ids.isEmpty()) { + UpdateWrapper pcWrapper = new UpdateWrapper<>(); + pcWrapper.lambda().in(UserEntity::getId, ids); + pcWrapper.lambda().eq(UserEntity::getStanding, standing); + pcWrapper.lambda().set(UserEntity::getStanding, 3); + update(pcWrapper); + UpdateWrapper appWrapper = new UpdateWrapper<>(); + appWrapper.lambda().in(UserEntity::getId, ids); + appWrapper.lambda().eq(UserEntity::getAppStanding, standing); + appWrapper.lambda().set(UserEntity::getAppStanding, 3); + update(appWrapper); + } + } + + @Override + public Boolean delCurUser(String message, List userIds, Integer stand) { + if (userIds.isEmpty()) { + return true; + } + List users = new ArrayList<>(); + List onlineUserList = OnlineUserProvider.getOnlineUserList(); + for (OnlineUserModel onlineUserModel : onlineUserList) { + String type = onlineUserModel.getIsMobileDevice() ? DeviceType.APP.getDevice() : DeviceType.PC.getDevice(); + String userId = onlineUserModel.getUserId(); + if (userIds.contains(userId)) { + List userList = authorizeService.getUserStanding(false, userId, type).stream() + .filter(t -> t.getId().equals(stand + "")).collect(Collectors.toList()); + if (userList.size() > 0) { + users.add(onlineUserModel); + } + } + } + if (!ObjectUtils.isEmpty(users)) { + for (OnlineUserModel user : users) { + JSONObject obj = new JSONObject(); + obj.put("method", "logout"); + obj.put("msg", StringUtil.isEmpty(message) ? MsgCode.PS011.get() : message); + if (user != null) { + OnlineUserProvider.sendMessage(user, obj); + } + // 先移除对象, 并推送下线信息, 避免网络原因导致就用户未断开 新用户连不上WebSocket + OnlineUserProvider.removeModel(user); + // 通知所有在线,有用户离线 + for (OnlineUserModel item : OnlineUserProvider.getOnlineUserList().stream() + .filter(t -> !Objects.equals(user.getUserId(), t.getUserId()) + && !Objects.equals(user.getTenantId(), t.getTenantId())) + .collect(Collectors.toList())) { + if (!item.getUserId().equals(user.getUserId())) { + JSONObject objs = new JSONObject(); + objs.put("method", "logout"); + // 推送给前端 + OnlineUserProvider.sendMessage(item, objs); + } + } + UserProvider.logoutByToken(user.getToken()); + } + } + return true; + } +} diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/PermissionUtil.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/PermissionUtil.java new file mode 100644 index 0000000..97c52f1 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/PermissionUtil.java @@ -0,0 +1,190 @@ +package com.yunzhupaas.permission.util; + +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.permission.entity.OrganizeEntity; +import com.yunzhupaas.permission.service.OrganizeService; +import com.yunzhupaas.util.StringUtil; + +import java.util.*; + +/** + * 类功能 + * + * @author 云筑产品开发平台组 + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/1/27 + */ +public class PermissionUtil { + + /** + * 递归取组织结构id + * + * @param organizeInfo 组织信息集合 + * @param organizeId 组织id + * @param infoType 信息类型 1:id 2:fullName + */ + private static LinkedList getOrganizeInfos(LinkedList organizeInfo, String organizeId, Integer infoType, OrganizeService organizeService) { + OrganizeEntity infoEntity = organizeService.getInfo(organizeId); + if (infoEntity != null) { + organizeInfo.add(infoType.equals(1) ? organizeId : infoEntity.getFullName()); + // -1 为顶级节点 + if (!"-1".equals(infoEntity.getParentId())) { + getOrganizeInfos(organizeInfo, infoEntity.getParentId(), infoType, organizeService); + } else { + // 结束时,进行倒序排列 + Collections.reverse(organizeInfo); + } + } + return organizeInfo; + } + + public static List> getOrgIdsTree(List organizeIds, Integer infoType, OrganizeService organizeService) { + List> organizeIdsTree = new ArrayList<>(); + organizeIds.forEach(id -> { + organizeIdsTree.add(getOrganizeInfos(new LinkedList<>(), id, infoType, organizeService)); + }); + return organizeIdsTree; + } + + /** + * 获取组名连接信息 + * + * @param organizeIds 组织id集合 + * @return 组织链式信息 + */ + public static String getLinkInfoByOrgId(List organizeIds, OrganizeService organizeService) { + StringBuilder organizeInfoVo = new StringBuilder(); + for (String id : organizeIds) { + if (id != null) { + StringBuilder organizeInfo = new StringBuilder(); + for (String name : getOrganizeInfos(new LinkedList<>(), id, 2, organizeService)) { + organizeInfo.append(name).append("/"); + } + // 去除最后一个斜杠 + if (organizeInfo.length() > 0) { + organizeInfo = new StringBuilder(organizeInfo.substring(0, organizeInfo.length() - 1)); + } + organizeInfo.append(","); + organizeInfoVo.append(organizeInfo); + } + } + return organizeInfoVo.toString(); + } + + /** + * 获取组名连接信息 + * + * @param organizeId 组织id + * @return 组织链式信息 + */ + public static String getLinkInfoByOrgId(String organizeId, OrganizeService organizeService) { + return getLinkInfoByOrgId(Collections.singletonList(organizeId), organizeService); + } + + /** + * 去掉尾部的封号 + */ + public static String getLinkInfoByOrgId(String organizeId, OrganizeService organizeService, Boolean separateFlag) { + String linkInfo = getLinkInfoByOrgId(organizeId, organizeService); + if (StringUtil.isEmpty(linkInfo)) { + return linkInfo; + } + if (!separateFlag) { + linkInfo = linkInfo.substring(0, linkInfo.length() - 1); + } + return linkInfo; + } + + public static List getOrgIdsByFormTree(OrganizeService organizeService, List> organizeIdsTree) throws DataException { + List orgIds = new ArrayList<>(); + for (List organizeIds : organizeIdsTree) { + // 组织id数组树最后一个数组最后一个id,是需要储存的id + String organizeId = organizeIds.get(organizeIds.size() - 1); + orgIds.add(organizeId); + } + // 判断每个OrgId的有效性 + int count = organizeService.listByIds(orgIds).size(); + if (count != orgIds.size()) { + throw new DataException(MsgCode.FA026.get()); + } + return orgIds; + } + + /** + * 将树形数据移出 + * + * @param list + * @return + */ + public static List> getListFromTree(List> list) { + List> result = new ArrayList<>(); + for (Map map : list) { + if (map.get("children") != null) { + result.add(map); + List> children = (List>) map.get("children"); + result.addAll(getListFromTree(children)); + } else { + result.add(map); + } + } + return result; + } + + /** + * 递归讲list转换成树形 + * + * @param list + * @param parentField + * @param childField + * @return + */ + public static List> getTreeObj(List> list, String parentField, String childField) { + List> result = new ArrayList<>(list); + for (int i = 0; i < result.size(); i++) { + Map item = result.get(i); + if ((item.get(parentField) != null && !StringUtil.isNotEmpty(item.get(parentField).toString())) || (item.get(parentField) != null && !"[]".equals(item.get(parentField).toString()))) { + if (hasChild(item, result, parentField, childField) && result.size() > 0) { + result.remove(item); + i--; + } + } + } + return result; + } + + /** + * 判断是否有子数据 + * + * @param node + * @param list + * @param parentField + * @param childField + * @return + */ + public static boolean hasChild(Map node, List> list, String parentField, String childField) { + for (int i = 0; i < list.size(); i++) { + Map ele = list.get(i); + if (ele.get(childField).equals(node.get(parentField))) { + if (ele.get("children") == null) { + ele.put("children", new ArrayList<>()); + } + List> children = (List>) ele.get("children"); + children.add(node); + ele.put("children", children); + return true; + } + if (ele.get("children") != null) { + List> children = (List>) ele.get("children"); + if (hasChild(node, children, parentField, childField)) { + return true; + } + } + } + return false; + } + + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/implicit/ImplicitDefaultSource.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/implicit/ImplicitDefaultSource.java new file mode 100644 index 0000000..3101a53 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/implicit/ImplicitDefaultSource.java @@ -0,0 +1,56 @@ +package com.yunzhupaas.permission.util.implicit; + +import me.zhyd.oauth.config.AuthSource; +import me.zhyd.oauth.request.AuthDefaultRequest; +import me.zhyd.oauth.request.AuthDingTalkRequest; + +/** + * 免登陆接口 通用接口 + * + * @author 云筑产品开发平台组 + * @version v5.0.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/5/23 11:09:55 + */ +public enum ImplicitDefaultSource implements AuthSource { + WECHAT_ENTERPRISE { + public String authorize() { + return "https://open.weixin.qq.com/connect/oauth2/authorize"; + } + + public String accessToken() { + return "https://qyapi.weixin.qq.com/cgi-bin/gettoken"; + } + + public String userInfo() { + return "https://qyapi.weixin.qq.com/cgi-bin/auth/getuserinfo"; + } + + public Class getTargetClass() { + return AuthDingTalkRequest.class; + } + }, + DINGTALK { + public String authorize() { + return "https://oapi.dingtalk.com/connect/oauth2/sns_authorize"; + } + + public String accessToken() { + return "https://oapi.dingtalk.com/gettoken"; + + } + + public String userInfo() { + return "https://oapi.dingtalk.com/topapi/v2/user/getuserinfo"; + } + + public Class getTargetClass() { + return AuthDingTalkRequest.class; + } + }, + ; + + private ImplicitDefaultSource() { + } +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/implicit/ImplicitLoginRequest.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/implicit/ImplicitLoginRequest.java new file mode 100644 index 0000000..2e62c2e --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/implicit/ImplicitLoginRequest.java @@ -0,0 +1,30 @@ +package com.yunzhupaas.permission.util.implicit; + +import me.zhyd.oauth.model.AuthCallback; +import me.zhyd.oauth.model.AuthResponse; + +/** + * 免登陆接口 + * + * @author 云筑产品开发平台组 + * @version v5.0.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/5/23 14:09:49 + */ +public interface ImplicitLoginRequest { + + /** + * 获取网页授权链接 + * + * @return + */ + String getAuthLoginLink(); + + /** + * 获取网页授权链接 + * + * @return + */ + AuthResponse getUserId(AuthCallback authCallback); +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/implicit/ImplicitLoginUtil.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/implicit/ImplicitLoginUtil.java new file mode 100644 index 0000000..5ce2546 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/implicit/ImplicitLoginUtil.java @@ -0,0 +1,107 @@ +package com.yunzhupaas.permission.util.implicit; + +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.LoginException; +import com.yunzhupaas.permission.util.implicit.request.ImplicitDingTalkRequest; +import com.yunzhupaas.permission.util.implicit.request.ImplicitQywxRequest; +import com.yunzhupaas.permission.util.socials.AuthCallbackNew; +import com.yunzhupaas.permission.util.socials.SocialsConfig; +import com.yunzhupaas.util.StringUtil; +import me.zhyd.oauth.config.AuthConfig; +import me.zhyd.oauth.enums.AuthResponseStatus; +import me.zhyd.oauth.exception.AuthException; +import me.zhyd.oauth.model.AuthResponse; +import me.zhyd.oauth.model.AuthUser; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.net.URLEncoder; + +/** + * 免登工具类 + * + * @author 云筑产品开发平台组 + * @version v5.0.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/5/23 11:09:26 + */ +@Component +public class ImplicitLoginUtil { + @Autowired + private SocialsConfig socialsConfig; + @Autowired + private ConfigValueUtil configValueUtil; + + public String getAuthLink(String source) { + ImplicitLoginRequest authRequest = this.getAuthRequest(source, null, null); + return authRequest.getAuthLoginLink(); + } + + public String loginByCode(String source, String code, String state) { + //获取第三方请求 + AuthCallbackNew callback = new AuthCallbackNew(); + callback.setAuthCode(code); + callback.setAuth_code(code); + callback.setAuthorization_code(code); + callback.setCode(code); + callback.setState(state); + ImplicitLoginRequest authRequest = this.getAuthRequest(source, null, null); + AuthResponse res = authRequest.getUserId(callback); + if (AuthResponseStatus.FAILURE.getCode() == res.getCode()) { + throw new LoginException("连接失败!"); + } else if (AuthResponseStatus.SUCCESS.getCode() != res.getCode()) { + throw new LoginException("授权失败:" + res.getMsg()); + } + //登录用户第三方id + return getSocialUuid(res); + } + + private String getSocialUuid(AuthResponse res) { + String uuid = res.getData().getUuid(); + if (res.getData().getToken() != null && StringUtil.isNotEmpty(res.getData().getToken().getUnionId())) { + uuid = res.getData().getToken().getUnionId(); + } + return uuid; + } + + /** + * 根据配置信息获取请求对象 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/7/21 + */ + public ImplicitLoginRequest getAuthRequest(String source, String userId, String tenantId) { + ImplicitLoginRequest authRequest = null; + String url = configValueUtil.getApiDomain() + "/api/oauth/Login/implicit"; + SocialsConfig.Config socialConfig; + switch (source.toLowerCase()) { + case "dingtalk": + socialConfig = socialsConfig.getSocialMap().get("dingtalk"); + authRequest = new ImplicitDingTalkRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(URLEncoder.encode(url)) + .build()); + break; + case "wechat_enterprise": + socialConfig = socialsConfig.getSocialMap().get("wechat_enterprise"); + authRequest = new ImplicitQywxRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(URLEncoder.encode(url)) + .agentId(socialConfig.getAgentId()) + .build()); + break; + default: + break; + } + if (null == authRequest) { + throw new AuthException(MsgCode.OA024.get()); + } + return authRequest; + } +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/implicit/request/ImplicitDingTalkRequest.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/implicit/request/ImplicitDingTalkRequest.java new file mode 100644 index 0000000..afa7597 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/implicit/request/ImplicitDingTalkRequest.java @@ -0,0 +1,145 @@ +package com.yunzhupaas.permission.util.implicit.request; + +import com.alibaba.fastjson.JSONObject; +import com.xkcoding.http.support.HttpHeader; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.permission.util.implicit.ImplicitDefaultSource; +import com.yunzhupaas.permission.util.implicit.ImplicitLoginRequest; +import me.zhyd.oauth.config.AuthConfig; +import me.zhyd.oauth.enums.AuthResponseStatus; +import me.zhyd.oauth.enums.AuthUserGender; +import me.zhyd.oauth.exception.AuthException; +import me.zhyd.oauth.log.Log; +import me.zhyd.oauth.model.AuthCallback; +import me.zhyd.oauth.model.AuthResponse; +import me.zhyd.oauth.model.AuthToken; +import me.zhyd.oauth.model.AuthUser; +import me.zhyd.oauth.request.AuthDefaultRequest; +import me.zhyd.oauth.utils.HttpUtils; +import me.zhyd.oauth.utils.StringUtils; +import me.zhyd.oauth.utils.UrlBuilder; +import org.apache.commons.codec.binary.Base64; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import java.net.URLEncoder; +import java.util.Date; + +public class ImplicitDingTalkRequest extends AuthDefaultRequest implements ImplicitLoginRequest { + public ImplicitDingTalkRequest(AuthConfig config) { + super(config, ImplicitDefaultSource.DINGTALK); + } + + @Override + public String getAuthLoginLink() { + return UrlBuilder.fromBaseUrl(this.source.authorize()) + .queryParam("appid", this.config.getClientId()) + .queryParam("redirect_uri", this.config.getRedirectUri()) + .queryParam("response_type", "code") + .queryParam("scope", "snsapi_auth") + .queryParam("state", "STATE") + .build(); + } + + @Override + public AuthResponse getUserId(AuthCallback authCallback) { + try { + AuthToken authToken = AuthToken.builder() + .code(authCallback.getCode()).build(); + AuthUser user = this.getUserByCode(authToken); + return AuthResponse.builder().code(AuthResponseStatus.SUCCESS.getCode()).data(user).build(); + } catch (Exception var4) { + Exception e = var4; + Log.error("Failed to login with oauth authorization.", e); + return this.responseError(e); + } + } + + AuthResponse responseError(Exception e) { + int errorCode = AuthResponseStatus.FAILURE.getCode(); + String errorMsg = e.getMessage(); + if (e instanceof AuthException) { + AuthException authException = (AuthException) e; + errorCode = authException.getErrorCode(); + if (StringUtils.isNotEmpty(authException.getErrorMsg())) { + errorMsg = authException.getErrorMsg(); + } + } + + return AuthResponse.builder().code(errorCode).msg(errorMsg).build(); + } + + @Override + protected AuthToken getAccessToken(AuthCallback authCallback) { + return null; + } + + @Override + protected AuthUser getUserInfo(AuthToken authToken) { + return null; + } + + + /** + * 钉钉签名计算 + * + * @param time + * @return + */ + private String getSignature(long time) { + // 根据timestamp, appSecret计算签名值 + String appSecret = this.config.getClientSecret(); + // 根据timestamp, appSecret计算签名值 + String stringToSign = "" + time; + Mac mac = null; + try { + mac = Mac.getInstance("HmacSHA256"); + mac.init(new SecretKeySpec(appSecret.getBytes("UTF-8"), "HmacSHA256")); + byte[] signatureBytes = mac.doFinal(stringToSign.getBytes("UTF-8")); + String signature = new String(Base64.encodeBase64(signatureBytes)); + if ("".equals(signature)) { + return ""; + } + String encoded = URLEncoder.encode(signature, "UTF-8"); + return encoded.replace("+", "%20").replace("*", "%2A").replace("~", "%7E").replace("/", "%2F"); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + protected String doGetUserByCode(AuthToken authToken) { + long time = new Date().getTime(); + String signature = this.getSignature(time); + String url = UrlBuilder.fromBaseUrl("https://oapi.dingtalk.com/sns/getuserinfo_bycode") + .queryParam("accessKey", this.config.getClientId()) + .queryParam("timestamp", time) + .queryParam("signature", signature) + .build(); + JSONObject map = new JSONObject(); + map.put("tmp_auth_code", authToken.getCode()); + return (new HttpUtils(this.config.getHttpConfig())).post(url, map.toJSONString(), new HttpHeader().add("Content-Type", "application/json")).getBody(); + } + + protected AuthUser getUserByCode(AuthToken authToken) { + String response = this.doGetUserByCode(authToken); + JSONObject object = this.checkResponse(response); + if (object.get("user_info") != null) { + JSONObject userInfo = (JSONObject) object.get("user_info"); + AuthToken token = AuthToken.builder().openId(userInfo.getString("openid")).unionId(userInfo.getString("unionid")).build(); + return AuthUser.builder().rawUserInfo(userInfo).uuid(userInfo.getString("unionid")).nickname(userInfo.getString("nick")) + .username(object.getString("nick")).gender(AuthUserGender.UNKNOWN).source(this.source.toString()).token(token).build(); + } else { + throw new AuthException(MsgCode.OA024.get()); + } + } + + private JSONObject checkResponse(String response) { + JSONObject object = JSONObject.parseObject(response); + if (object.containsKey("errcode") && object.getIntValue("errcode") != 0) { + throw new AuthException(object.getString("errmsg"), this.source); + } else { + return object; + } + } +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/implicit/request/ImplicitQywxRequest.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/implicit/request/ImplicitQywxRequest.java new file mode 100644 index 0000000..fb6563e --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/implicit/request/ImplicitQywxRequest.java @@ -0,0 +1,125 @@ +package com.yunzhupaas.permission.util.implicit.request; + +import com.alibaba.fastjson.JSONObject; +import com.yunzhupaas.permission.util.implicit.ImplicitDefaultSource; +import com.yunzhupaas.permission.util.implicit.ImplicitLoginRequest; +import me.zhyd.oauth.config.AuthConfig; +import me.zhyd.oauth.enums.AuthResponseStatus; +import me.zhyd.oauth.exception.AuthException; +import me.zhyd.oauth.log.Log; +import me.zhyd.oauth.model.AuthCallback; +import me.zhyd.oauth.model.AuthResponse; +import me.zhyd.oauth.model.AuthToken; +import me.zhyd.oauth.model.AuthUser; +import me.zhyd.oauth.request.AuthDefaultRequest; +import me.zhyd.oauth.utils.HttpUtils; +import me.zhyd.oauth.utils.StringUtils; +import me.zhyd.oauth.utils.UrlBuilder; + +public class ImplicitQywxRequest extends AuthDefaultRequest implements ImplicitLoginRequest { + + public ImplicitQywxRequest(AuthConfig config) { + super(config, ImplicitDefaultSource.WECHAT_ENTERPRISE); + } + + @Override + public String getAuthLoginLink() { + return UrlBuilder.fromBaseUrl(this.source.authorize()) + .queryParam("appid", this.config.getClientId()) + .queryParam("redirect_uri", this.config.getRedirectUri()) + .queryParam("response_type", "code") + .queryParam("scope", "snsapi_privateinfo") + .queryParam("agentid", this.config.getAgentId()) + .queryParam("state", "STATE#wechat_redirect") + .build(); + } + + @Override + public AuthResponse getUserId(AuthCallback authCallback) { + try { + this.checkCode(authCallback); + AuthToken authToken = this.getAccessToken(authCallback); + AuthUser user = this.getUserInfo(authToken); + return AuthResponse.builder().code(AuthResponseStatus.SUCCESS.getCode()).data(user).build(); + } catch (Exception var4) { + Exception e = var4; + Log.error("Failed to login with oauth authorization.", e); + return this.responseError(e); + } + } + + AuthResponse responseError(Exception e) { + int errorCode = AuthResponseStatus.FAILURE.getCode(); + String errorMsg = e.getMessage(); + if (e instanceof AuthException) { + AuthException authException = (AuthException) e; + errorCode = authException.getErrorCode(); + if (StringUtils.isNotEmpty(authException.getErrorMsg())) { + errorMsg = authException.getErrorMsg(); + } + } + + return AuthResponse.builder().code(errorCode).msg(errorMsg).build(); + } + + @Override + protected AuthToken getAccessToken(AuthCallback authCallback) { + try { + String response = this.doGetAccessToken(); + JSONObject object = this.checkResponse(response); + AuthToken authToken = AuthToken.builder() + .accessToken(object.getString("access_token")) + .code(authCallback.getCode()) + .expireIn(object.getIntValue("expires_in")).build(); + return authToken; + } catch (Exception var5) { + Exception e = var5; + throw new AuthException("企业微信获取token失败", e); + } + } + + @Override + protected AuthUser getUserInfo(AuthToken authToken) { + String response = this.doGetUserInfo(authToken); + JSONObject object = this.checkResponse(response); + if (!object.containsKey("userid")) { + throw new AuthException(AuthResponseStatus.UNIDENTIFIED_PLATFORM, this.source); + } else { + return AuthUser.builder().rawUserInfo(object).uuid(object.getString("userid")).token(authToken).source(this.source.toString()).build(); + } + } + + protected String doGetAccessToken() { + return (new HttpUtils(this.config.getHttpConfig())).get(this.accessTokenUrl()).getBody(); + } + + protected String accessTokenUrl() { + return UrlBuilder.fromBaseUrl(this.source.accessToken()) + .queryParam("corpid", this.config.getClientId()) + .queryParam("corpsecret", this.config.getClientSecret()) + .build(); + } + + protected String doGetUserInfo(AuthToken authToken) { + return (new HttpUtils(this.config.getHttpConfig())).get(this.userInfoUrl(authToken)).getBody(); + } + + protected String userInfoUrl(AuthToken authToken) { + return UrlBuilder.fromBaseUrl(this.source.userInfo()) + .queryParam("access_token", authToken.getAccessToken()) + .queryParam("code", authToken.getCode()) + .build(); + } + + private JSONObject checkResponse(String response) { + JSONObject object = JSONObject.parseObject(response); + if (object.containsKey("errcode") && object.getIntValue("errcode") != 0) { + throw new AuthException(object.getString("errmsg"), this.source); + } else { + return object; + } + } + + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/socials/AuthCallbackNew.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/socials/AuthCallbackNew.java new file mode 100644 index 0000000..8b8f9b9 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/socials/AuthCallbackNew.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.permission.util.socials; + +import lombok.Data; +import me.zhyd.oauth.model.AuthCallback; + +/** + * 流程设计 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/7/21 17:17:44 + */ +@Data +public class AuthCallbackNew extends AuthCallback { + private String authCode; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/socials/AuthDefaultSourceNew.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/socials/AuthDefaultSourceNew.java new file mode 100644 index 0000000..55459a6 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/socials/AuthDefaultSourceNew.java @@ -0,0 +1,58 @@ +package com.yunzhupaas.permission.util.socials; + +import me.zhyd.oauth.config.AuthSource; +import me.zhyd.oauth.request.AuthDefaultRequest; +import me.zhyd.oauth.request.AuthDingTalkRequest; + +/** + * 流程设计 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/7/15 17:20:40 + */ +public enum AuthDefaultSourceNew implements AuthSource { + DINGTALK_NEW { + public String authorize() { + return "https://login.dingtalk.com/oauth2/auth"; +// return "https://oapi.dingtalk.com/connect/sns_authorize"; + } + + public String accessToken() { + return "https://api.dingtalk.com/v1.0/oauth2/userAccessToken"; +// return "https://oapi.dingtalk.com/gettoken"; + + } + + public String userInfo() { + return "https://api.dingtalk.com/v1.0/contact/users/me"; +// return "https://oapi.dingtalk.com/user/getuserinfo"; + } + + public Class getTargetClass() { + return AuthDingTalkRequest.class; + } + }, + WECHAT_APPLETS { + @Override + public String authorize() { + return null; + } + + @Override + public String accessToken() { + return null; + } + + public String userInfo() { + return "https://api.weixin.qq.com/sns/jscode2session"; + } + public Class getTargetClass() { + return AuthWechatAppletsRequest.class; + } + },; + private AuthDefaultSourceNew() { + } +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/socials/AuthDingTalkNewRequest.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/socials/AuthDingTalkNewRequest.java new file mode 100644 index 0000000..dfcf98b --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/socials/AuthDingTalkNewRequest.java @@ -0,0 +1,125 @@ +package com.yunzhupaas.permission.util.socials; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.xkcoding.http.support.HttpHeader; +import com.yunzhupaas.constant.MsgCode; +import me.zhyd.oauth.cache.AuthStateCache; +import me.zhyd.oauth.config.AuthConfig; +import me.zhyd.oauth.enums.AuthResponseStatus; +import me.zhyd.oauth.enums.AuthUserGender; +import me.zhyd.oauth.exception.AuthException; +import me.zhyd.oauth.log.Log; +import me.zhyd.oauth.model.AuthCallback; +import me.zhyd.oauth.model.AuthResponse; +import me.zhyd.oauth.model.AuthToken; +import me.zhyd.oauth.model.AuthUser; +import me.zhyd.oauth.request.AuthDefaultRequest; +import me.zhyd.oauth.utils.HttpUtils; +import me.zhyd.oauth.utils.StringUtils; +import me.zhyd.oauth.utils.UrlBuilder; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; + +/** + * 流程设计 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/7/15 17:19:14 + */ +public class AuthDingTalkNewRequest extends AuthDefaultRequest { + + public AuthDingTalkNewRequest(AuthConfig config) { + super(config, AuthDefaultSourceNew.DINGTALK_NEW); + } + + public AuthDingTalkNewRequest(AuthConfig config, AuthStateCache authStateCache) { + super(config, AuthDefaultSourceNew.DINGTALK_NEW, authStateCache); + } + + public String authorize(String state) { + String encode = null; + try { + encode = URLEncoder.encode(this.config.getRedirectUri(), "UTF-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + ; + return UrlBuilder.fromBaseUrl(this.source.authorize()).queryParam("response_type", "code").queryParam("client_id", this.config.getClientId()).queryParam("scope", "openid").queryParam("redirect_uri", encode).queryParam("prompt", "consent").build(); + } + + protected AuthToken getAccessToken(AuthCallback authCallback) { + return this.getToken(this.accessTokenUrl(authCallback.getCode()), authCallback); + } + + protected String accessTokenUrl(String code) { + return UrlBuilder.fromBaseUrl(this.source.accessToken()).build(); + } + + public AuthResponse login(AuthCallback authCallback) { + try { + this.checkCode(authCallback); + AuthToken authToken = this.getAccessToken(authCallback); + AuthUser user = this.getUserInfo(authToken); + return AuthResponse.builder().code(AuthResponseStatus.SUCCESS.getCode()).data(user).build(); + } catch (Exception var4) { + Log.error("Failed to login with oauth authorization.", var4); + return this.responseError(var4); + } + } + + AuthResponse responseError(Exception e) { + int errorCode = AuthResponseStatus.FAILURE.getCode(); + String errorMsg = e.getMessage(); + if (e instanceof AuthException) { + AuthException authException = (AuthException) e; + errorCode = authException.getErrorCode(); + if (StringUtils.isNotEmpty(authException.getErrorMsg())) { + errorMsg = authException.getErrorMsg(); + } + } + + return AuthResponse.builder().code(errorCode).msg(errorMsg).build(); + } + + private AuthToken getToken(String accessTokenUrl, AuthCallback authCallback) { + JSONObject map = new JSONObject(); + map.put("clientId", this.config.getClientId()); + map.put("clientSecret", this.config.getClientSecret()); + map.put("code", authCallback.getCode()); + map.put("refreshToken", authCallback.getCode()); + map.put("grantType", "authorization_code"); + String response = (new HttpUtils(this.config.getHttpConfig())).post(accessTokenUrl, map.toJSONString(), new HttpHeader().add("Content-Type", "application/json")).getBody(); + JSONObject accessTokenObject = JSONObject.parseObject(response); + this.checkResponse(accessTokenObject); + return AuthToken.builder().accessToken(accessTokenObject.getString("accessToken")).refreshToken(accessTokenObject.getString("refreshToken")).expireIn(accessTokenObject.getIntValue("expireIn")).openId(accessTokenObject.getString("openid")).build(); + } + + private void checkResponse(JSONObject object) { + if (object.containsKey("errcode")) { + throw new AuthException(object.getIntValue("errcode"), object.getString("errmsg")); + } + } + + protected AuthUser getUserInfo(AuthToken authToken) { + HttpHeader httpHeader = new HttpHeader() + .add("x-acs-dingtalk-access-token", authToken.getAccessToken()) + .add("Content-Type", "application/json"); + String response = (new HttpUtils(this.config.getHttpConfig())).get(this.userInfoUrl(authToken), null, httpHeader, false).getHttpResponse().getBody(); + JSONObject object = JSON.parseObject(response); + if (object.get("unionId") != null) { + AuthToken token = AuthToken.builder().openId(object.getString("openId")).unionId(object.getString("unionId")).build(); + return AuthUser.builder().rawUserInfo(object).uuid(object.getString("unionId")).nickname(object.getString("nick")).username(object.getString("nick")).gender(AuthUserGender.UNKNOWN).source(this.source.toString()).token(token).build(); + } else { + throw new AuthException(MsgCode.OA024.get()); + } + } + + protected String userInfoUrl(AuthToken authToken) { + return UrlBuilder.fromBaseUrl(this.source.userInfo()).build(); + } +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/socials/AuthSocialsUtil.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/socials/AuthSocialsUtil.java new file mode 100644 index 0000000..773aa09 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/socials/AuthSocialsUtil.java @@ -0,0 +1,441 @@ +package com.yunzhupaas.permission.util.socials; + +import com.xkcoding.http.config.HttpConfig; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.util.StringUtil; +import me.zhyd.oauth.config.AuthConfig; +import me.zhyd.oauth.enums.scope.*; +import me.zhyd.oauth.exception.AuthException; +import me.zhyd.oauth.request.*; +import me.zhyd.oauth.utils.AuthScopeUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.net.InetSocketAddress; +import java.net.Proxy; +import java.net.URLEncoder; +import java.util.Arrays; + +/** + * 流程设计 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/7/21 12:00:56 + */ +@Component +public class AuthSocialsUtil { + @Autowired + private SocialsConfig socialsConfig; + @Autowired + private ConfigValueUtil configValueUtil; + + /** + * 根据配置信息获取请求对象 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/7/21 + */ + public AuthRequest getAuthRequest(String source, String userId, boolean isLogin, String ticket, String tenantId) { + AuthRequest authRequest = null; + String addUrlStr = ""; + String urlStr = configValueUtil.getApiDomain() + "/api/oauth/Login/socials?source=" + source; + if (!isLogin) { + urlStr = configValueUtil.getApiDomain() + "/api/oauth/Login/socials?source=" + source; + } + if (StringUtil.isNotEmpty(userId)) { + addUrlStr = "&userId=" + userId; + } + if (StringUtil.isNotEmpty(ticket)) { + addUrlStr = "&yunzhupaas_ticket=" + ticket; + } + if (StringUtil.isNotEmpty(tenantId)) { + addUrlStr += "&tenantId=" + tenantId; + } + String url = urlStr + addUrlStr; + SocialsConfig.Config socialConfig; + switch (source.toLowerCase()) { + //todo 官方登录api调整目前数据问题 + case "dingtalk": + socialConfig = socialsConfig.getSocialMap().get("dingtalk"); + authRequest = new AuthDingTalkNewRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .build()); + break; + //todo 未申请企业 + case "qq": + socialConfig = socialsConfig.getSocialMap().get("qq"); + authRequest = new AuthQqRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .build()); + break; + case "wechat_open": + socialConfig = socialsConfig.getSocialMap().get("wechat_open"); + authRequest = new AuthWeChatOpenRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(URLEncoder.encode(url)) + .build()); + break; + case "github": + socialConfig = socialsConfig.getSocialMap().get("github"); + authRequest = new AuthGithubRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(URLEncoder.encode(url)) + .scopes(AuthScopeUtils.getScopes(AuthGithubScope.values())) + // 针对国外平台配置代理 +// .httpConfig(HttpConfig.builder() +// .timeout(15000) +// .proxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 10080))) +// .build()) + .build()); + break; + case "wechat_enterprise": + socialConfig = socialsConfig.getSocialMap().get("wechat_enterprise"); + authRequest = new AuthWeChatEnterpriseQrcodeRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(URLEncoder.encode(url)) + .agentId(socialConfig.getAgentId()) + .build()); + break; + case "feishu": + socialConfig = socialsConfig.getSocialMap().get("feishu"); + authRequest = new AuthFeishuRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .build()); + break; + case "baidu": + socialConfig = socialsConfig.getSocialMap().get("baidu"); + authRequest = new AuthBaiduRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .scopes(Arrays.asList( + AuthBaiduScope.BASIC.getScope(), + AuthBaiduScope.SUPER_MSG.getScope(), + AuthBaiduScope.NETDISK.getScope() + )) +// .clientId("") +// .clientSecret("") +// .redirectUri("http://localhost:9001/oauth/baidu/callback") + .build()); + break; + case "gitee": + socialConfig = socialsConfig.getSocialMap().get("gitee"); + authRequest = new AuthGiteeRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .scopes(AuthScopeUtils.getScopes(AuthGiteeScope.values())) + .build()); + break; + case "weibo": + socialConfig = socialsConfig.getSocialMap().get("weibo"); + authRequest = new AuthWeiboRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .scopes(Arrays.asList( + AuthWeiboScope.EMAIL.getScope(), + AuthWeiboScope.FRIENDSHIPS_GROUPS_READ.getScope(), + AuthWeiboScope.STATUSES_TO_ME_READ.getScope() + )) + .build()); + break; + case "coding": + socialConfig = socialsConfig.getSocialMap().get("coding"); + authRequest = new AuthCodingRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .domainPrefix("") + .scopes(Arrays.asList( + AuthCodingScope.USER.getScope(), + AuthCodingScope.USER_EMAIL.getScope(), + AuthCodingScope.USER_PHONE.getScope() + )) + .build()); + break; + case "oschina": + socialConfig = socialsConfig.getSocialMap().get("oschina"); + authRequest = new AuthOschinaRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .build()); + break; + case "alipay": + socialConfig = socialsConfig.getSocialMap().get("alipay"); + // 支付宝在创建回调地址时,不允许使用localhost或者127.0.0.1,所以这儿的回调地址使用的局域网内的ip + authRequest = new AuthAlipayRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .alipayPublicKey("") + .build()); + break; + case "csdn": + socialConfig = socialsConfig.getSocialMap().get("csdn"); + authRequest = new AuthCsdnRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .build()); + break; + case "taobao": + socialConfig = socialsConfig.getSocialMap().get("taobao"); + authRequest = new AuthTaobaoRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .build()); + break; + case "google": + socialConfig = socialsConfig.getSocialMap().get("google"); + authRequest = new AuthGoogleRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .scopes(AuthScopeUtils.getScopes(AuthGoogleScope.USER_EMAIL, AuthGoogleScope.USER_PROFILE, AuthGoogleScope.USER_OPENID)) + // 针对国外平台配置代理 + .httpConfig(HttpConfig.builder() + .timeout(15000) + .proxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 10080))) + .build()) + .build()); + break; + case "facebook": + socialConfig = socialsConfig.getSocialMap().get("facebook"); + authRequest = new AuthFacebookRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .scopes(AuthScopeUtils.getScopes(AuthFacebookScope.values())) + // 针对国外平台配置代理 + .httpConfig(HttpConfig.builder() + .timeout(15000) + .proxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 10080))) + .build()) + .build()); + break; + case "douyin": + socialConfig = socialsConfig.getSocialMap().get("douyin"); + authRequest = new AuthDouyinRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .build()); + break; + case "linkedin": + socialConfig = socialsConfig.getSocialMap().get("linkedin"); + authRequest = new AuthLinkedinRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .scopes(null) + .build()); + break; + case "microsoft": + socialConfig = socialsConfig.getSocialMap().get("microsoft"); + authRequest = new AuthMicrosoftRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .scopes(Arrays.asList( + AuthMicrosoftScope.USER_READ.getScope(), + AuthMicrosoftScope.USER_READWRITE.getScope(), + AuthMicrosoftScope.USER_READBASIC_ALL.getScope(), + AuthMicrosoftScope.USER_READ_ALL.getScope(), + AuthMicrosoftScope.USER_READWRITE_ALL.getScope(), + AuthMicrosoftScope.USER_INVITE_ALL.getScope(), + AuthMicrosoftScope.USER_EXPORT_ALL.getScope(), + AuthMicrosoftScope.USER_MANAGEIDENTITIES_ALL.getScope(), + AuthMicrosoftScope.FILES_READ.getScope() + )) + .build()); + break; + case "mi": + socialConfig = socialsConfig.getSocialMap().get("mi"); + authRequest = new AuthMiRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .build()); + break; + case "toutiao": + socialConfig = socialsConfig.getSocialMap().get("toutiao"); + authRequest = new AuthToutiaoRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .build()); + break; + case "teambition": + socialConfig = socialsConfig.getSocialMap().get("teambition"); + authRequest = new AuthTeambitionRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .build()); + break; + case "pinterest": + socialConfig = socialsConfig.getSocialMap().get("pinterest"); + authRequest = new AuthPinterestRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + // 针对国外平台配置代理 + .httpConfig(HttpConfig.builder() + .timeout(15000) + .proxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 10080))) + .build()) + .build()); + break; + case "renren": + socialConfig = socialsConfig.getSocialMap().get("renren"); + authRequest = new AuthRenrenRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .build()); + break; + case "stack_overflow": + socialConfig = socialsConfig.getSocialMap().get("stack_overflow"); + authRequest = new AuthStackOverflowRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .stackOverflowKey("") + .build()); + break; + case "huawei": + socialConfig = socialsConfig.getSocialMap().get("huawei"); + authRequest = new AuthHuaweiRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .scopes(Arrays.asList( + AuthHuaweiScope.BASE_PROFILE.getScope(), + AuthHuaweiScope.MOBILE_NUMBER.getScope(), + AuthHuaweiScope.ACCOUNTLIST.getScope(), + AuthHuaweiScope.SCOPE_DRIVE_FILE.getScope(), + AuthHuaweiScope.SCOPE_DRIVE_APPDATA.getScope() + )) + .build()); + break; + case "kujiale": + socialConfig = socialsConfig.getSocialMap().get("kujiale"); + authRequest = new AuthKujialeRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .build()); + break; + case "gitlab": + socialConfig = socialsConfig.getSocialMap().get("gitlab"); + authRequest = new AuthGitlabRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .scopes(AuthScopeUtils.getScopes(AuthGitlabScope.values())) + .build()); + break; + case "meituan": + socialConfig = socialsConfig.getSocialMap().get("meituan"); + authRequest = new AuthMeituanRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .build()); + break; + case "eleme": + socialConfig = socialsConfig.getSocialMap().get("eleme"); + authRequest = new AuthElemeRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .build()); + break; +// case "mygitlab": +// authRequest = new AuthMyGitlabRequest(AuthConfig.builder() +// .clientId("") +// .clientSecret("") +// .redirectUri("http://127.0.0.1:8443/oauth/callback/mygitlab") +// .build()); +// break; + case "twitter": + socialConfig = socialsConfig.getSocialMap().get("twitter"); + authRequest = new AuthTwitterRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + // 针对国外平台配置代理 + .httpConfig(HttpConfig.builder() + .timeout(15000) + .proxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 10080))) + .build()) + .build()); + break; + case "wechat_mp": + socialConfig = socialsConfig.getSocialMap().get("wechat_mp"); + authRequest = new AuthWeChatMpRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .build()); + break; + case "aliyun": + socialConfig = socialsConfig.getSocialMap().get("aliyun"); + authRequest = new AuthAliyunRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .build()); + break; + case "xmly": + socialConfig = socialsConfig.getSocialMap().get("xmly"); + authRequest = new AuthXmlyRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .build()); + break; + case "wechat_enterprise_web": + socialConfig = socialsConfig.getSocialMap().get("wechat_enterprise_web"); + authRequest = new AuthWeChatEnterpriseWebRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .agentId(socialConfig.getAgentId()) + .build()); + break; + case "wechat_applets": + socialConfig = socialsConfig.getSocialMap().get("wechat_applets"); + authRequest = new AuthWechatAppletsRequest(AuthConfig.builder() + .clientId(socialConfig.getClientId()) + .clientSecret(socialConfig.getClientSecret()) + .redirectUri(url) + .build()); + break; + default: + break; + } + if (null == authRequest) { + throw new AuthException(MsgCode.OA024.get()); + } + return authRequest; + } +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/socials/AuthWechatAppletsRequest.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/socials/AuthWechatAppletsRequest.java new file mode 100644 index 0000000..b3ec96b --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/socials/AuthWechatAppletsRequest.java @@ -0,0 +1,89 @@ +package com.yunzhupaas.permission.util.socials; + +import com.alibaba.fastjson.JSONObject; +import me.zhyd.oauth.cache.AuthStateCache; +import me.zhyd.oauth.config.AuthConfig; +import me.zhyd.oauth.enums.AuthResponseStatus; +import me.zhyd.oauth.exception.AuthException; +import me.zhyd.oauth.log.Log; +import me.zhyd.oauth.model.AuthCallback; +import me.zhyd.oauth.model.AuthResponse; +import me.zhyd.oauth.model.AuthToken; +import me.zhyd.oauth.model.AuthUser; +import me.zhyd.oauth.request.AuthDefaultRequest; +import me.zhyd.oauth.utils.HttpUtils; +import me.zhyd.oauth.utils.StringUtils; +import me.zhyd.oauth.utils.UrlBuilder; + +/** + * 流程设计 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/9/16 12:11:36 + */ +public class AuthWechatAppletsRequest extends AuthDefaultRequest { + public AuthWechatAppletsRequest(AuthConfig config) { + super(config, AuthDefaultSourceNew.WECHAT_APPLETS); + } + + public AuthWechatAppletsRequest(AuthConfig config, AuthStateCache authStateCache) { + super(config, AuthDefaultSourceNew.WECHAT_APPLETS, authStateCache); + } + + @Override + protected AuthToken getAccessToken(AuthCallback authCallback) { + return null; + } + + @Override + protected AuthUser getUserInfo(AuthToken authToken) { + return null; + } + + protected String getuserInfoUrl(AuthCallback authCallback) { + return UrlBuilder.fromBaseUrl(this.source.userInfo()) + .queryParam("appid", this.config.getClientId()) + .queryParam("secret", this.config.getClientSecret()) + .queryParam("js_code",authCallback.getCode()) + .queryParam("grant_type", "authorization_code").build(); + + } + + AuthResponse responseError(Exception e) { + int errorCode = AuthResponseStatus.FAILURE.getCode(); + String errorMsg = e.getMessage(); + if (e instanceof AuthException) { + AuthException authException = (AuthException) e; + errorCode = authException.getErrorCode(); + if (StringUtils.isNotEmpty(authException.getErrorMsg())) { + errorMsg = authException.getErrorMsg(); + } + } + + return AuthResponse.builder().code(errorCode).msg(errorMsg).build(); + } + public AuthResponse login(AuthCallback authCallback) { + try { + AuthUser user = this.getUserUnionid(authCallback); + return AuthResponse.builder().code(AuthResponseStatus.SUCCESS.getCode()).data(user).build(); + } catch (Exception var4) { + Log.error("Failed to login with oauth authorization.", var4); + return this.responseError(var4); + } + } + + protected AuthUser getUserUnionid(AuthCallback authCallback) { + String response = (new HttpUtils(this.config.getHttpConfig())).get(this.getuserInfoUrl(authCallback)).getBody(); + JSONObject object = JSONObject.parseObject(response); + AuthToken authToken=new AuthToken(); + if (object.containsKey("unionid")) { + authToken.setUnionId(object.getString("unionid")); + } + return AuthUser.builder().rawUserInfo(object).token(authToken).source(this.source.toString()).build(); + } + + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/socials/SocialsAuthEnum.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/socials/SocialsAuthEnum.java new file mode 100644 index 0000000..46b1af0 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/socials/SocialsAuthEnum.java @@ -0,0 +1,105 @@ +package com.yunzhupaas.permission.util.socials; + +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +/** + * 单点登录枚举 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/7/14 10:10:30 + */ +public enum SocialsAuthEnum { + WECHAT_OPEN("微信", "/cdn/socials/wechat_open.png", "绑定微信后,用户可通过微信扫码登录YUNZHUPAAS系统。", + "", "v1.1.0", true, "icon-ym icon-ym-logo-wechat"), + QQ("QQ", "/cdn/socials/qq.png", "绑定QQ后,用户可通过QQ扫码登录YUNZHUPAAS系统。", + "", "v1.1.0", true, "icon-ym icon-ym-logo-qq"), + WECHAT_ENTERPRISE("企业微信", "/cdn/socials/wxWork.png", "绑定企业微信后,您可在网页端扫码登录, 在企业微信应用内和小程序免登录, 并能实时接收小程序通知,沟通和协作将更加便捷。", + "", "v1.10.0", true, "icon-ym icon-ym-logo-wxWork"), + DINGTALK("钉钉", "/cdn/socials/dingtalk.png", "绑定阿里钉钉后,您可在网页端扫码登录并能接收相关通知。", + "", "v1.0.1", true, "icon-ym icon-ym-logo-dingding"), + FEISHU("飞书", "/cdn/socials/feishu.png", "绑定飞书后,用户可扫码登录 YUNZHUPAAS。", + "", "1.15.9", true, "icon-ym icon-ym-logo-feishu"), + GITHUB("Github", "/cdn/socials/gitHub.png", "绑定GitHub后,用户可扫码登录 YUNZHUPAAS。", + "", "v1.0.1", true, "icon-ym icon-ym-logo-github"), + GITEE("Gitee", "", "绑定Gitee后,用户可登录 YUNZHUPAAS。", + "", "v1.0.1", false, "icon-ym icon-ym-logo-github"), + ; + + // 平台名 + private final String name; + // 帮助文档 + private final String logo; + // 描述 + private final String describetion; + // 官网api文档 + private final String apiDoc; + // 集成该平台的 版本 + private final String since; + // 首页展示 + private final boolean latest; + // 官网api文档 + private final String icon; + + SocialsAuthEnum(String name, String logo, String describetion, String apiDoc, String since, boolean latest, + String icon) { + this.name = name; + this.logo = logo; + this.describetion = describetion; + this.apiDoc = apiDoc; + this.since = since; + this.latest = latest; + this.icon = icon; + } + + public static List> getPlatformInfos() { + List> list = new LinkedList<>(); + Map map = null; + SocialsAuthEnum[] justAuthPlatformInfos = SocialsAuthEnum.values(); + for (SocialsAuthEnum justAuthPlatformInfo : justAuthPlatformInfos) { + map = new HashMap<>(); + map.put("name", justAuthPlatformInfo.getName()); + map.put("logo", justAuthPlatformInfo.getLogo()); + map.put("describetion", justAuthPlatformInfo.getDescribetion()); + map.put("apiDoc", justAuthPlatformInfo.getApiDoc()); + map.put("since", justAuthPlatformInfo.getSince()); + map.put("enname", justAuthPlatformInfo.name().toLowerCase()); + map.put("isLatest", justAuthPlatformInfo.isLatest()); + map.put("icon", justAuthPlatformInfo.getIcon()); + list.add(map); + } + return list; + } + + public String getIcon() { + return icon; + } + + public String getName() { + return name; + } + + public String getLogo() { + return logo; + } + + public String getDescribetion() { + return describetion; + } + + public String getApiDoc() { + return apiDoc; + } + + public String getSince() { + return since; + } + + public boolean isLatest() { + return latest; + } +} diff --git a/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/socials/SocialsConfig.java b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/socials/SocialsConfig.java new file mode 100644 index 0000000..891fb79 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-biz/src/main/java/com/yunzhupaas/permission/util/socials/SocialsConfig.java @@ -0,0 +1,136 @@ +package com.yunzhupaas.permission.util.socials; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + + +/** + * 流程设计 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/9/6 14:58:23 + */ +@Component +@ConfigurationProperties(prefix = SocialsConfig.PREFIX) +public class SocialsConfig { + public static final String PREFIX = "socials"; + + private boolean socialsEnabled = false; + + private List config; + + private Map socialMap; + + public SocialsConfig() { + } + + public SocialsConfig(List config, Map socialMap) { + this.config = config; + this.socialMap = socialMap; + } + + public boolean isSocialsEnabled() { + return socialsEnabled; + } + + public void setSocialsEnabled(boolean socialsEnabled) { + this.socialsEnabled = socialsEnabled; + } + + public void setConfig(List config) { + this.config = config; + this.socialMap = new HashMap<>(); + config.stream().forEach(item -> { + this.socialMap.put(item.getProvider(), item); + }); + } + + public List getConfig() { + return config; + } + + public Map getSocialMap() { + return socialMap; + } + + public static class Config { + private String provider; + private String clientId; + private String clientSecret; + private String agentId; + + public Config() { + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Config config = (Config) o; + return Objects.equals(provider, config.provider) && Objects.equals(clientId, config.clientId) && Objects.equals(clientSecret, config.clientSecret) && Objects.equals(agentId, config.agentId); + } + + @Override + public int hashCode() { + return Objects.hash(provider, clientId, clientSecret, agentId); + } + + @Override + public String toString() { + return "Config{" + + "provider='" + provider + '\'' + + ", clientId='" + clientId + '\'' + + ", clientSecret='" + clientSecret + '\'' + + ", agentId='" + agentId + '\'' + + '}'; + } + + public String getProvider() { + return provider; + } + + public void setProvider(String provider) { + this.provider = provider; + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getClientSecret() { + return clientSecret; + } + + public void setClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + } + + public String getAgentId() { + return agentId; + } + + public void setAgentId(String agentId) { + this.agentId = agentId; + } + + public Config(String provider, String clientId, String clientSecret, String agentId) { + this.provider = provider; + this.clientId = clientId; + this.clientSecret = clientSecret; + this.agentId = agentId; + } + } + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-controller/pom.xml b/yunzhupaas-permission/yunzhupaas-permission-controller/pom.xml new file mode 100644 index 0000000..d630d1f --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-controller/pom.xml @@ -0,0 +1,32 @@ + + + + yunzhupaas-permission + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-permission-controller + + + + com.yunzhupaas + yunzhupaas-permission-biz + ${project.version} + + + com.yunzhupaas + yunzhupaas-system-biz + ${project.version} + + + com.yunzhupaas + yunzhupaas-exception + ${project.version} + + + + diff --git a/yunzhupaas-permission/yunzhupaas-permission-controller/src/main/java/com/yunzhupaas/permission/controller/AuthorizeController.java b/yunzhupaas-permission/yunzhupaas-permission-controller/src/main/java/com/yunzhupaas/permission/controller/AuthorizeController.java new file mode 100644 index 0000000..0fa86f5 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-controller/src/main/java/com/yunzhupaas/permission/controller/AuthorizeController.java @@ -0,0 +1,1210 @@ +package com.yunzhupaas.permission.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaMode; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.controller.SuperController; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.annotation.OrganizeAdminIsTrator; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.entity.*; +import com.yunzhupaas.base.model.base.SystemBaeModel; +import com.yunzhupaas.base.model.button.ButtonModel; +import com.yunzhupaas.base.model.column.ColumnModel; +import com.yunzhupaas.base.model.form.ModuleFormModel; +import com.yunzhupaas.base.model.module.ModuleModel; +import com.yunzhupaas.base.model.portalManage.*; +import com.yunzhupaas.base.model.print.PaginationPrint; +import com.yunzhupaas.base.model.resource.ResourceModel; +import com.yunzhupaas.base.service.*; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.flowable.entity.TemplateEntity; +import com.yunzhupaas.flowable.model.template.TemplateTreeListVo; +import com.yunzhupaas.model.tenant.TenantAuthorizeModel; +import com.yunzhupaas.permission.constant.AuthorizeConst; +import com.yunzhupaas.permission.entity.*; +import com.yunzhupaas.permission.model.authorize.*; +import com.yunzhupaas.permission.model.columnspurview.ColumnsPurviewUpForm; +import com.yunzhupaas.permission.model.permissiongroup.ViewPermissionsTreeModel; +import com.yunzhupaas.permission.service.*; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.treeutil.SumTree; +import com.yunzhupaas.util.treeutil.newtreeutil.TreeDotUtils; +import com.yunzhupaas.workflow.service.TemplateApi; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * 操作权限 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +@Tag(name = "操作权限", description = "Authorize") +@RestController +@RequestMapping("/api/permission/Authority") +public class AuthorizeController extends SuperController { + + @Autowired + private ModuleService moduleApi; + @Autowired + private ModuleButtonService buttonApi; + @Autowired + private ModuleColumnService columnApi; + @Autowired + private ModuleFormService formApi; + @Autowired + private ModuleDataAuthorizeSchemeService schemeApi; + @Autowired + private AuthorizeService authorizeService; + @Autowired + private ColumnsPurviewService columnsPurviewService; + @Autowired + private PermissionGroupService permissionGroupService; + @Autowired + private SystemService systemApi; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private TemplateApi templateApi; + @Autowired + private PrintDevService printDevService; + @Autowired + private DictionaryDataService dictionaryDataApi; + + + /** + * 权限数据 + * + * @param objectId 对象主键 + * @param dataValuesQuery 权限值 + * @return + */ + @Operation(summary = "获取岗位/角色/用户权限树形结构") + @Parameters({ + @Parameter(name = "objectId", description = "对象主键", required = true), + @Parameter(name = "dataValuesQuery", description = "权限值", required = true) + }) + @SaCheckPermission(value = {"permission.authorize", "permission.role"}, mode = SaMode.OR) + @PostMapping("/Data/{objectId}/Values") + public ActionResult getValuesData(@PathVariable("objectId") String objectId, @RequestBody DataValuesQuery dataValuesQuery) { + AuthorizeVO authorizeModel = authorizeService.getAuthorize(false, false); + List list = authorizeService.list(new QueryWrapper().lambda().eq(AuthorizeEntity::getObjectId, objectId)); + if (!StringUtil.isEmpty(dataValuesQuery.getType())) { + switch (dataValuesQuery.getType()) { + case "system": + AuthorizeDataReturnVO authorizeDataReturnVO = this.system(list, authorizeModel); + return ActionResult.success(authorizeDataReturnVO); + case "module": + List systemId = new ArrayList<>(); + if (!StringUtil.isEmpty(dataValuesQuery.getModuleIds())) { + systemId = Arrays.asList(dataValuesQuery.getModuleIds().split(",")); + } + List moduleList = moduleApi.getList(false, new ArrayList<>(), new ArrayList<>()).stream().filter( + m -> "1".equals(String.valueOf(m.getEnabledMark())) + ).collect(Collectors.toList()); + AuthorizeDataReturnVO dataReturnVO = this.module1(moduleList, list, authorizeModel, systemId); + return ActionResult.success(dataReturnVO); + case "button": + List moduleList1 = moduleApi.getList(false, new ArrayList<>(), new ArrayList<>()).stream().filter( + m -> "1".equals(String.valueOf(m.getEnabledMark())) + ).collect(Collectors.toList()); + //挑选出的list + List selectList1 = new ArrayList<>(); + List selectorSystemList = new ArrayList<>(); + if (!StringUtil.isEmpty(dataValuesQuery.getModuleIds())) { + List moduleId1 = Arrays.asList(dataValuesQuery.getModuleIds().split(",")); + selectList1 = moduleList1.stream().filter(t -> moduleId1.contains(t.getId())).collect(Collectors.toList()); + selectorSystemList = systemApi.getListByIds(moduleId1, null); + } + AuthorizeDataReturnVO dataReturnVo1 = this.moduleButton(selectList1, selectorSystemList, list, authorizeModel); + return ActionResult.success(dataReturnVo1); + + case "column": + List moduleList2 = moduleApi.getList(false, new ArrayList<>(), new ArrayList<>()).stream().filter( + m -> "1".equals(String.valueOf(m.getEnabledMark())) + ).collect(Collectors.toList()); + //挑选出的list + List selectList2 = new ArrayList<>(); + List selectorSystemList1 = new ArrayList<>(); + if (!StringUtil.isEmpty(dataValuesQuery.getModuleIds())) { + List moduleId2 = Arrays.asList(dataValuesQuery.getModuleIds().split(",")); + selectList2 = moduleList2.stream().filter(t -> moduleId2.contains(t.getId())).collect(Collectors.toList()); + selectorSystemList1 = systemApi.getListByIds(moduleId2, null); + } + AuthorizeDataReturnVO dataReturnVo2 = this.moduleColumn(selectList2, selectorSystemList1, list, authorizeModel); + return ActionResult.success(dataReturnVo2); + + case "resource": + List moduleList3 = moduleApi.getList(false, new ArrayList<>(), new ArrayList<>()).stream().filter( + m -> "1".equals(String.valueOf(m.getEnabledMark())) + ).collect(Collectors.toList()); + //挑选出的list + List selectList3 = new ArrayList<>(); + List selectorSystemList2 = new ArrayList<>(); + if (!StringUtil.isEmpty(dataValuesQuery.getModuleIds())) { + List moduleId3 = Arrays.asList(dataValuesQuery.getModuleIds().split(",")); + selectList3 = moduleList3.stream().filter(t -> moduleId3.contains(t.getId())).collect(Collectors.toList()); + selectorSystemList2 = systemApi.getListByIds(moduleId3, null); + } + AuthorizeDataReturnVO dataReturnVo3 = this.resourceData(selectList3, selectorSystemList2, list, authorizeModel); + return ActionResult.success(dataReturnVo3); + + case "form": + List moduleList4 = moduleApi.getList(false, new ArrayList<>(), new ArrayList<>()).stream().filter( + m -> "1".equals(String.valueOf(m.getEnabledMark())) + ).collect(Collectors.toList()); + //挑选出的list + List selectList4 = new ArrayList<>(); + List selectorSystemList3 = new ArrayList<>(); + if (!StringUtil.isEmpty(dataValuesQuery.getModuleIds())) { + List moduleId4 = Arrays.asList(dataValuesQuery.getModuleIds().split(",")); + selectList4 = moduleList4.stream().filter(t -> moduleId4.contains(t.getId())).collect(Collectors.toList()); + selectorSystemList3 = systemApi.getListByIds(moduleId4, null); + } + AuthorizeDataReturnVO dataReturnVo4 = this.moduleForm(selectList4, selectorSystemList3, list, authorizeModel); + return ActionResult.success(dataReturnVo4); + + default: + } + } + return ActionResult.fail(MsgCode.PS012.get()); + } + + /** + * 获取门户权限 + * + * @return + */ + @Operation(summary = "获取门户权限") + @Parameters({ + @Parameter(name = "id", description = "对象主键", required = true) + }) + @SaCheckPermission(value = {"permission.authorize", "permission.role", "onlineDev.visualPortal"}, mode = SaMode.OR) + @GetMapping("/Portal/{id}") + public ActionResult getPortalAuth(@PathVariable("id") String id) { + PortalVO vo = new PortalVO(); + List myPortalList = new ArrayList<>(); + List permissionGroupPortalList = new ArrayList<>(); + // 权限组权限 + List permissionGroupAuthorize = authorizeService.getListByRoleId(id); + List moduleAuthorize = new ArrayList<>(); + if (configValueUtil.isMultiTenancy()) { + TenantAuthorizeModel tenantAuthorizeModel = TenantDataSourceUtil.getCacheModuleAuthorize(UserProvider.getUser().getTenantId()); + moduleAuthorize = tenantAuthorizeModel.getModuleIdList(); + } + List permissionGroupSystemList = systemApi.getListByIds( + permissionGroupAuthorize.stream() + .filter(t -> AuthorizeConst.SYSTEM.equals(t.getItemType())) + .map(AuthorizeEntity::getItemId) + .collect(Collectors.toList()), moduleAuthorize + ); + AuthorizeVO authorize = authorizeService.getAuthorize(false, false); + List permissionGroupSystemIdList = permissionGroupSystemList.stream().map(SystemEntity::getId).collect(Collectors.toList()); + List mySystemList = JsonUtil.getJsonToList(authorize.getSystemList(), SystemEntity.class); + // 我的数据 + mySystemList = mySystemList.stream().filter(t -> permissionGroupSystemIdList.contains(t.getId())).collect(Collectors.toList()); + long dateTime = System.currentTimeMillis(); + authorizeService.getPortal(mySystemList, myPortalList, dateTime, new ArrayList<>()); + // 权限组数据 + authorizeService.getPortal(permissionGroupSystemList, permissionGroupPortalList, dateTime, new ArrayList<>()); + + // 验证他有我没有的 + List noContainsList = permissionGroupPortalList.stream().filter(t -> !myPortalList.contains(t)).map(PortalModel::getId).collect(Collectors.toList()); + + myPortalList.addAll(permissionGroupPortalList); + myPortalList.forEach(t -> { + if (noContainsList.contains(t.getId())) { + t.setDisabled(true); + } + }); + List allId = myPortalList.stream().distinct().map(PortalModel::getId).collect(Collectors.toList()); + List> trees = TreeDotUtils.convertListToTreeDot(myPortalList.stream().sorted(Comparator.comparing(PortalModel::getSortCode).thenComparing(PortalModel::getCreatorTime, Comparator.reverseOrder())).collect(Collectors.toList())); + vo.setList(JsonUtil.getJsonToList(trees, PortalListVO.class)); + vo.setAll(allId); + List collect = permissionGroupAuthorize.stream() + .filter(t -> AuthorizeConst.AUTHORIZE_PORTAL_MANAGE.equals(t.getItemType())) + .map(AuthorizeEntity::getItemId) + .collect(Collectors.toList()); + vo.setIds(permissionGroupPortalList.stream().filter(t -> collect.contains(t.getId())).map(PortalModel::getId).collect(Collectors.toList())); + return ActionResult.success(vo); + } + + /** + * 保存门户权限 + * + * @return + */ + @Operation(summary = "保存门户权限") + @Parameters({ + @Parameter(name = "itemId", description = "对象主键", required = true) + }) + @SaCheckPermission(value = {"permission.authorize", "permission.role", "onlineDev.visualPortal"}, mode = SaMode.OR) + @PostMapping("/Portal/{id}") + public ActionResult savePortalAuth(@PathVariable("id") String id, @RequestBody SavePortalAuthModel model) { + model.setId(id); + model.setType(AuthorizeConst.AUTHORIZE_PORTAL_MANAGE); + authorizeService.saveItemAuth(model); + return ActionResult.success(MsgCode.SU005.get()); + } + + + /** + * 对象数据 + * + * @return + */ + @Operation(summary = "获取功能权限数据") + @Parameters({ + @Parameter(name = "itemId", description = "对象主键", required = true), + @Parameter(name = "objectType", description = "对象类型", required = true) + }) + @SaCheckPermission(value = {"permission.authorize", "permission.role", "onlineDev.visualPortal"}, mode = SaMode.OR) + @GetMapping("/Model/{itemId}/{objectType}") + public ActionResult getObjectAuth(@PathVariable("itemId") String itemId, @PathVariable("objectType") String objectType) { + List authorizeList = authorizeService.getListByObjectAndItem(itemId, objectType); + List ids = authorizeList.stream().map(u -> u.getObjectId()).collect(Collectors.toList()); + AuthorizeItemObjIdsVO vo = new AuthorizeItemObjIdsVO(); + vo.setIds(ids); + return ActionResult.success(vo); + } + + @Operation(summary = "门户管理授权") + @Parameters({ + @Parameter(name = "itemId", description = "对象主键", required = true), + @Parameter(name = "saveAuthForm", description = "保存权限模型", required = true)}) + @PutMapping("/Model/{portalManageId}") + @SaCheckPermission(value = {"permission.authorize", "permission.role"}, mode = SaMode.OR) + public ActionResult savePortalManage(@PathVariable("portalManageId") String portalManageId, @RequestBody SavePortalAuthModel model) { + model.setId(portalManageId); + model.setType(AuthorizeConst.AUTHORIZE_PORTAL_MANAGE); + model.setIds(model.getObjectId()); + authorizeService.saveObjectAuth(model); + return ActionResult.success(MsgCode.SU005.get()); + } + + /** + * 保存 + * + * @param objectId 对象主键 + * @param authorizeDataUpForm 修改权限模型 + * @return + */ + @OrganizeAdminIsTrator + @Operation(summary = "保存权限") + @Parameters({ + @Parameter(name = "objectId", description = "对象主键", required = true), + @Parameter(name = "authorizeDataUpForm", description = "修改权限模型", required = true) + }) + @SaCheckPermission(value = {"permission.authorize", "permission.role"}, mode = SaMode.OR) + @PutMapping("/Data/{objectId}") + public ActionResult save(@PathVariable("objectId") String objectId, @RequestBody AuthorizeDataUpForm authorizeDataUpForm) { + authorizeService.save(objectId, authorizeDataUpForm); + return ActionResult.success(MsgCode.SU005.get()); + } + + /** + * 保存批量 + * + * @param saveBatchForm 批量保存模型 + * @return + */ + @OrganizeAdminIsTrator + @Operation(summary = "批量保存权限") + @Parameters({ + @Parameter(name = "saveBatchForm", description = "批量保存模型", required = true) + }) + @SaCheckPermission(value = {"permission.authorize"}, mode = SaMode.OR) + @PostMapping("/Data/Batch") + public ActionResult saveBatch(@RequestBody SaveBatchForm saveBatchForm) { + authorizeService.saveBatch(saveBatchForm, true); + return ActionResult.success(MsgCode.SU005.get()); + } + + /** + * 获取模块列表展示字段 + * + * @param moduleId 菜单Id + * @return + */ + @Operation(summary = "获取模块列表展示字段") + @Parameters({ + @Parameter(name = "moduleId", description = "菜单id", required = true) + }) + @GetMapping("/GetColumnsByModuleId/{moduleId}") + public ActionResult getColumnsByModuleId(@PathVariable("moduleId") String moduleId) { + ColumnsPurviewEntity entity = columnsPurviewService.getInfo(moduleId); + List> jsonToListMap = null; + if (entity != null) { + jsonToListMap = JsonUtil.getJsonToListMap(entity.getFieldList()); + } + return ActionResult.success(jsonToListMap != null ? jsonToListMap : new ArrayList<>(16)); + } + + /** + * 配置模块列表展示字段 + * + * @param columnsPurviewUpForm 修改模型 + * @return + */ + @Operation(summary = "配置模块列表展示字段") + @Parameters({ + @Parameter(name = "columnsPurviewUpForm", description = "修改模型", required = true) + }) + @PutMapping("/SetColumnsByModuleId") + public ActionResult setColumnsByModuleId(@RequestBody ColumnsPurviewUpForm columnsPurviewUpForm) { + ColumnsPurviewEntity entity = JsonUtil.getJsonToBean(columnsPurviewUpForm, ColumnsPurviewEntity.class); + columnsPurviewService.update(columnsPurviewUpForm.getModuleId(), entity); + return ActionResult.success(MsgCode.SU005.get()); + } + + /** + * 功能权限 + * + * @param authorizeList 已有权限 + * @return + */ + private AuthorizeDataReturnVO system(List authorizeList, AuthorizeVO authorizeModel) { + AuthorizeDataReturnVO vo = new AuthorizeDataReturnVO(); + List systemList = authorizeModel.getSystemList(); + // 哪些是系统的 + List collect = authorizeList.stream().filter(t -> AuthorizeConst.SYSTEM.equals(t.getItemType())).collect(Collectors.toList()); + List systemEntityList = systemApi.getListByIds(collect.stream().map(AuthorizeEntity::getItemId).collect(Collectors.toList()), null); + List authorizeModelList = JsonUtil.getJsonToList(systemEntityList, AuthorizeDataReturnModel.class); + List jsonToList = JsonUtil.getJsonToList(systemList, AuthorizeDataReturnModel.class); + // 取交集并集处理 + List containsList = authorizeModelList.stream().filter(t -> !jsonToList.contains(t)).collect(Collectors.toList()); + List collect1 = containsList.stream().map(AuthorizeDataReturnModel::getId).collect(Collectors.toList()); + collect1.addAll(systemEntityList.stream().map(SystemEntity::getId).collect(Collectors.toList())); + containsList.forEach(t -> t.setDisabled(true)); + jsonToList.addAll(containsList); + vo.setList(jsonToList.stream().sorted(Comparator.comparing(AuthorizeDataReturnModel::getSortCode).thenComparing(AuthorizeDataReturnModel::getCreatorTime, Comparator.reverseOrder())).collect(Collectors.toList())); + vo.setAll(jsonToList.stream().map(AuthorizeDataReturnModel::getId).collect(Collectors.toList())); + vo.setIds(collect1.stream().distinct().collect(Collectors.toList())); + return vo; + } + + + /** + * 功能权限 + * + * @param moduleListAll 所有功能 + * @param authorizeList 已有权限 + * @param authorizeModel 权限集合 + * @param systemId 系统id + * @return + */ + private AuthorizeDataReturnVO module1(List moduleListAll, List authorizeList, AuthorizeVO authorizeModel, List systemId) { + UserInfo userInfo = UserProvider.getUser(); + List moduleAuthorize = new ArrayList<>(); + List moduleUrlAddressAuthorize = new ArrayList<>(); + if (configValueUtil.isMultiTenancy()) { + TenantAuthorizeModel tenantAuthorizeModel = TenantDataSourceUtil.getCacheModuleAuthorize(userInfo.getTenantId()); + moduleAuthorize = tenantAuthorizeModel.getModuleIdList(); + moduleUrlAddressAuthorize = tenantAuthorizeModel.getUrlAddressList(); + } + AuthorizeDataReturnVO vo = new AuthorizeDataReturnVO(); + List moduleList = new ArrayList<>(); + // 权限组本身拥有的菜单 + List authorizeLists = authorizeList.stream().filter(t -> AuthorizeConst.MODULE.equals(t.getItemType())).collect(Collectors.toList()); + List moduleByIds = moduleApi.getModuleByIds(authorizeLists.stream().map(AuthorizeEntity::getItemId).collect(Collectors.toList()), moduleAuthorize, moduleUrlAddressAuthorize, false) + .stream().filter(t -> systemId.contains(t.getSystemId())).collect(Collectors.toList()); + List jsonToList = JsonUtil.getJsonToList(moduleByIds, ModuleModel.class); + // 我的菜单 + List moduleList1 = authorizeModel.getModuleList(); + moduleList1 = moduleList1.stream().filter(t -> systemId.contains(t.getSystemId())).collect(Collectors.toList()); + List collect = moduleList1.stream().map(ModuleModel::getId).collect(Collectors.toList()); + List collect1 = jsonToList.stream().filter(t -> collect.contains(t.getId())).collect(Collectors.toList()); + + List containsList = collect1.stream().map(ModuleModel::getId).collect(Collectors.toList()); +// List collect3 = authorizeList.stream().map(AuthorizeEntity::getItemId).collect(Collectors.toList()); + containsList.addAll(moduleByIds.stream().map(ModuleEntity::getId).collect(Collectors.toList())); + containsList.addAll(systemId); + moduleList.addAll(jsonToList); + moduleList.addAll(moduleList1); + moduleList = moduleList.stream().filter(t -> systemId.contains(t.getSystemId())).distinct().collect(Collectors.toList()); + + List list = new ArrayList<>(moduleList); + // 存放上级菜单id及上级 systemId,id + Map appIds = new HashMap<>(16); + Map webIds = new HashMap<>(16); + long datetime = System.currentTimeMillis(); + moduleList.stream().sorted(Comparator.comparing(ModuleModel::getCategory).reversed()).forEach(t -> { + if ("App".equals(t.getCategory()) && "-1".equals(t.getParentId())) { + if (!appIds.containsKey(t.getSystemId())) { + t.setParentId(t.getSystemId() + "1"); + ModuleModel appData = new ModuleModel(); + appData.setId(t.getSystemId() + "1"); + appData.setSortCode(0L); + appData.setCreatorTime(datetime); + appData.setFullName("APP菜单"); + appData.setIcon("icon-ym icon-ym-mobile"); + appData.setParentId(t.getSystemId()); + appData.setSystemId(t.getSystemId()); + list.add(appData); + appIds.put(t.getSystemId(), appData.getId()); + } else { + t.setParentId(appIds.get(t.getSystemId()) + ""); + } + } else if ("Web".equals(t.getCategory()) && "-1".equals(t.getParentId())) { + if (!webIds.containsKey(t.getSystemId())) { + t.setParentId(t.getSystemId() + "2"); + ModuleModel webData = new ModuleModel(); + webData.setId(t.getSystemId() + "2"); + webData.setSortCode(-1L); + webData.setCreatorTime(datetime); + webData.setFullName("WEB菜单"); + webData.setIcon("icon-ym icon-ym-pc"); + webData.setParentId(t.getSystemId()); + webData.setSystemId(t.getSystemId()); + list.add(webData); + webIds.put(t.getSystemId(), webData.getId()); + } else { + t.setParentId(webIds.get(t.getSystemId()) + ""); + } + } + ModuleModel model = JsonUtil.getJsonToBean(t, ModuleModel.class); + list.add(model); + }); + list.stream().filter(t -> "-1".equals(t.getParentId())).forEach(t -> t.setParentId(t.getSystemId())); + List systemList = systemApi.getListByIds(systemId, null); + List jsonToList1 = JsonUtil.getJsonToList(systemList, ModuleModel.class); + jsonToList1.forEach(t -> { + t.setParentId("-1"); + t.setSystemId(t.getId()); + }); + list.addAll(jsonToList1); + + List mySystemIdList = authorizeModel.getSystemList().stream().map(SystemBaeModel::getId).collect(Collectors.toList()); + List collect2 = list.stream().filter(t -> !mySystemIdList.contains(t.getSystemId())).map(ModuleModel::getId).collect(Collectors.toList()); + List treeList = JsonUtil.getJsonToList(list, AuthorizeDataModel.class); + treeList.forEach(t -> { + if (collect2.contains(t.getId())) { + t.setDisabled(true); + } + }); + treeList = treeList.stream().sorted(Comparator.comparing(AuthorizeDataModel::getSortCode).thenComparing(AuthorizeDataModel::getCreatorTime, Comparator.reverseOrder())).collect(Collectors.toList()); + List> trees = TreeDotUtils.convertListToTreeDot(treeList); + trees = trees.stream().filter(t->"-1".equals(t.getParentId())).collect(Collectors.toList()); + List data = JsonUtil.getJsonToList(trees, AuthorizeDataReturnModel.class); + vo.setAll(list.stream().map(ModuleModel::getId).distinct().collect(Collectors.toList())); + vo.setList(data); + containsList.addAll(collect2); + vo.setIds(containsList.stream().distinct().collect(Collectors.toList())); + return vo; + } + + /** + * 按钮权限 + * + * @param moduleList 功能 + * @param selectorSystemList 应用 + * @param authorizeList 已有权限 + * @param authorizeModel 权限集合 + * @return + */ + AuthorizeDataReturnVO moduleButton(List moduleList, List selectorSystemList, List authorizeList, AuthorizeVO authorizeModel) { + AuthorizeDataReturnVO vo = new AuthorizeDataReturnVO(); + // 树 + List allButtonList = new ArrayList<>(); + // id + List ids = new ArrayList<>(); + List noContainsIds = new ArrayList<>(); + // 转map + Map moduleMap = moduleList.stream().collect(Collectors.toMap(ModuleEntity::getId, Function.identity())); + Set moduleIdIds = moduleMap.keySet(); + Map systemEntityMap = selectorSystemList.stream().collect(Collectors.toMap(SystemEntity::getId, Function.identity())); + Set systemIdIds = systemEntityMap.keySet(); + // 我的菜单权限 + List myButtonList = authorizeModel.getButtonList(); + myButtonList = myButtonList.stream().filter(t -> moduleIdIds.contains(t.getModuleId())).collect(Collectors.toList()); + // 权限组的权限 + List authorizeLists = authorizeList.stream().filter(t -> AuthorizeConst.BUTTON.equals(t.getItemType())).collect(Collectors.toList()); + List buttonByIds = buttonApi.getListByIds(authorizeLists.stream().map(AuthorizeEntity::getItemId).collect(Collectors.toList())) + .stream().filter(t -> moduleIdIds.contains(t.getModuleId())).collect(Collectors.toList()); + List permissionGroupButtonList = JsonUtil.getJsonToList(buttonByIds, ButtonModel.class); + // 将菜单id设置给按钮的上级 + myButtonList.forEach(t -> t.setParentId(t.getModuleId())); + permissionGroupButtonList.forEach(t -> t.setParentId(t.getModuleId())); + // 所有的按钮权限 + allButtonList.addAll(myButtonList); + allButtonList.addAll(permissionGroupButtonList); + // 我的按钮id + List myButtonId = myButtonList.stream().map(ButtonModel::getId).collect(Collectors.toList()); + // 交集 1:1 + List containsButtonList = permissionGroupButtonList.stream().filter(t -> myButtonId.contains(t.getId())).map(ButtonModel::getId).distinct().collect(Collectors.toList()); + // 我没有的 + List noContainsButtonList = permissionGroupButtonList.stream().filter(t -> !containsButtonList.contains(t.getId())).map(ButtonModel::getId).collect(Collectors.toList()); + List collect3 = authorizeList.stream().map(AuthorizeEntity::getItemId).collect(Collectors.toList()); + ids.addAll(collect3); + ids.addAll(containsButtonList); + noContainsIds.addAll(noContainsButtonList); + // 我的菜单 + List myModuleList = authorizeModel.getModuleList(); + // 共有菜单 + List containsModuleList = myModuleList.stream().filter(t -> moduleIdIds.contains(t.getId())).map(ModuleModel::getId).collect(Collectors.toList()); + List myModuleIds = myModuleList.stream().map(ModuleModel::getId).collect(Collectors.toList()); + List noContainsModuleList = moduleIdIds.stream().filter(t -> !myModuleIds.contains(t)).collect(Collectors.toList()); + ids.addAll(containsModuleList); + noContainsIds.addAll(noContainsModuleList); + // 我的应用 + List mySystemList = authorizeModel.getSystemList(); + // 共有应用 + List containsSystemList = mySystemList.stream().filter(t -> systemIdIds.contains(t.getId())).map(SystemBaeModel::getId).collect(Collectors.toList()); + List mySystemIds = mySystemList.stream().map(SystemBaeModel::getId).collect(Collectors.toList()); + List noContainsSystemList = systemIdIds.stream().filter(t -> !mySystemIds.contains(t)).collect(Collectors.toList()); + ids.addAll(containsSystemList); + noContainsIds.addAll(noContainsSystemList); + // 所有按钮权限的上级 + List allModuleIds = allButtonList.stream().map(ButtonModel::getParentId).distinct().collect(Collectors.toList()); + Map allModuleListMap = new HashMap<>(); + // 新建APP菜单上级 + allModuleIds.forEach(t -> { + ModuleEntity entity = moduleMap.get(t); + while (entity != null) { + allModuleListMap.put(entity.getId(), entity); + entity = moduleMap.get(entity.getParentId()); + } + }); + // 存放上级菜单id及上级 systemId,id + Map appIds = new HashMap<>(16); + Map webIds = new HashMap<>(16); + long datetime = System.currentTimeMillis(); + allModuleListMap.values().stream().sorted(Comparator.comparing(ModuleEntity::getCategory).reversed()).forEach(t -> { + if ("App".equals(t.getCategory()) && "-1".equals(t.getParentId())) { + if (!appIds.containsKey(t.getSystemId())) { + t.setParentId(t.getSystemId() + "1"); + ButtonModel appData = new ButtonModel(); + appData.setId(t.getSystemId() + "1"); + appData.setSortCode(0L); + appData.setCreatorTime(datetime); + appData.setFullName("APP菜单"); + appData.setIcon("icon-ym icon-ym-mobile"); + appData.setParentId(t.getSystemId()); + allButtonList.add(appData); + appIds.put(t.getSystemId(), appData.getId()); + } else { + t.setParentId(appIds.get(t.getSystemId()) + ""); + } + } else if ("Web".equals(t.getCategory()) && "-1".equals(t.getParentId())) { + if (!webIds.containsKey(t.getSystemId())) { + t.setParentId(t.getSystemId() + "2"); + ButtonModel webData = new ButtonModel(); + webData.setId(t.getSystemId() + "2"); + webData.setSortCode(-1L); + webData.setCreatorTime(datetime); + webData.setFullName("WEB菜单"); + webData.setIcon("icon-ym icon-ym-pc"); + webData.setParentId(t.getSystemId()); + allButtonList.add(webData); + webIds.put(t.getSystemId(), webData.getId()); + } else { + t.setParentId(webIds.get(t.getSystemId()) + ""); + } + } + ButtonModel model = JsonUtil.getJsonToBean(t, ButtonModel.class); + allButtonList.add(model); + }); + allButtonList.stream().filter(t -> "-1".equals(t.getParentId())).forEach(t -> t.setParentId(t.getSystemId())); + List systemId = allButtonList.stream().filter(t -> StringUtil.isNotEmpty(t.getParentId())).map(ButtonModel::getParentId).collect(Collectors.toList()); + systemId.forEach(t -> { + if (Optional.ofNullable(systemEntityMap.get(t)).isPresent()) { + ButtonModel jsonToBean = JsonUtil.getJsonToBean(systemEntityMap.get(t), ButtonModel.class); + jsonToBean.setParentId("-1"); + allButtonList.add(jsonToBean); + } + }); + + List treeList = JsonUtil.getJsonToList(allButtonList, AuthorizeDataModel.class); + // 处理不可选的 + treeList.forEach(t -> { + if (noContainsIds.contains(t.getId())) { + t.setDisabled(true); + } + }); + treeList = treeList.stream().sorted(Comparator.comparing(AuthorizeDataModel::getSortCode).thenComparing(AuthorizeDataModel::getCreatorTime, Comparator.reverseOrder())).collect(Collectors.toList()); + List> trees = TreeDotUtils.convertListToTreeDot(treeList); + List data = JsonUtil.getJsonToList(trees, AuthorizeDataReturnModel.class); + vo.setAll(allButtonList.stream().map(ButtonModel::getId).distinct().collect(Collectors.toList())); + vo.setList(data); + ids.addAll(noContainsIds); + vo.setIds(authorizeLists.stream().map(AuthorizeEntity::getItemId).distinct().collect(Collectors.toList())); + return vo; + } + + /** + * 列表权限 + * + * @param moduleList 功能 + * @param selectorSystemList 列表 + * @param authorizeList 已有权限 + * @param authorizeModel 权限集合 + * @return + */ + AuthorizeDataReturnVO moduleColumn(List moduleList, List selectorSystemList, List authorizeList, AuthorizeVO authorizeModel) { + AuthorizeDataReturnVO vo = new AuthorizeDataReturnVO(); + // 树 + List allButtonList = new ArrayList<>(); + // id + List ids = new ArrayList<>(); + List noContainsIds = new ArrayList<>(); + // 转map + Map moduleMap = moduleList.stream().collect(Collectors.toMap(ModuleEntity::getId, Function.identity())); + Set moduleIdIds = moduleMap.keySet(); + Map systemEntityMap = selectorSystemList.stream().collect(Collectors.toMap(SystemEntity::getId, Function.identity())); + Set systemIdIds = systemEntityMap.keySet(); + // 我的菜单权限 + List myButtonList = authorizeModel.getColumnList(); + myButtonList = myButtonList.stream().filter(t -> moduleIdIds.contains(t.getModuleId())).collect(Collectors.toList()); + // 权限组的权限 + List authorizeLists = authorizeList.stream().filter(t -> AuthorizeConst.COLUMN.equals(t.getItemType())).collect(Collectors.toList()); + List buttonByIds = columnApi.getListByIds(authorizeLists.stream().map(AuthorizeEntity::getItemId).collect(Collectors.toList())) + .stream().filter(t -> moduleIdIds.contains(t.getModuleId())).collect(Collectors.toList()); + List permissionGroupButtonList = JsonUtil.getJsonToList(buttonByIds, ColumnModel.class); + // 将菜单id设置给按钮的上级 + myButtonList.forEach(t -> t.setParentId(t.getModuleId())); + permissionGroupButtonList.forEach(t -> t.setParentId(t.getModuleId())); + // 所有的按钮权限 + allButtonList.addAll(myButtonList); + allButtonList.addAll(permissionGroupButtonList); + // 我的按钮id + List myButtonId = myButtonList.stream().map(ColumnModel::getId).collect(Collectors.toList()); + // 交集 1:1 + List containsButtonList = permissionGroupButtonList.stream().filter(t -> myButtonId.contains(t.getId())).map(ColumnModel::getId).distinct().collect(Collectors.toList()); + // 我没有的 + List noContainsButtonList = permissionGroupButtonList.stream().filter(t -> !containsButtonList.contains(t.getId())).map(ColumnModel::getId).collect(Collectors.toList()); + List collect3 = authorizeList.stream().map(AuthorizeEntity::getItemId).collect(Collectors.toList()); + ids.addAll(collect3); + ids.addAll(containsButtonList); + noContainsIds.addAll(noContainsButtonList); + // 我的菜单 + List myModuleList = authorizeModel.getModuleList(); + // 共有菜单 + List containsModuleList = myModuleList.stream().filter(t -> moduleIdIds.contains(t.getId())).map(ModuleModel::getId).collect(Collectors.toList()); + List myModuleIds = myModuleList.stream().map(ModuleModel::getId).collect(Collectors.toList()); + List noContainsModuleList = moduleIdIds.stream().filter(t -> !myModuleIds.contains(t)).collect(Collectors.toList()); + ids.addAll(containsModuleList); + noContainsIds.addAll(noContainsModuleList); + // 我的应用 + List mySystemList = authorizeModel.getSystemList(); + // 共有应用 + List containsSystemList = mySystemList.stream().filter(t -> systemIdIds.contains(t.getId())).map(SystemBaeModel::getId).collect(Collectors.toList()); + List mySystemIds = mySystemList.stream().map(SystemBaeModel::getId).collect(Collectors.toList()); + List noContainsSystemList = systemIdIds.stream().filter(t -> !mySystemIds.contains(t)).collect(Collectors.toList()); + ids.addAll(containsSystemList); + noContainsIds.addAll(noContainsSystemList); + // 所有按钮权限的上级 + List allModuleIds = allButtonList.stream().map(ColumnModel::getParentId).distinct().collect(Collectors.toList()); + Map allModuleListMap = new HashMap<>(); + // 新建APP菜单上级 + allModuleIds.forEach(t -> { + ModuleEntity entity = moduleMap.get(t); + while (entity != null) { + allModuleListMap.put(entity.getId(), entity); + entity = moduleMap.get(entity.getParentId()); + } + }); + // 存放上级菜单id及上级 systemId,id + Map appIds = new HashMap<>(16); + Map webIds = new HashMap<>(16); + long datetime = System.currentTimeMillis(); + allModuleListMap.values().stream().sorted(Comparator.comparing(ModuleEntity::getCategory).reversed()).forEach(t -> { + if ("App".equals(t.getCategory()) && "-1".equals(t.getParentId())) { + if (!appIds.containsKey(t.getSystemId())) { + t.setParentId(t.getSystemId() + "1"); + ColumnModel appData = new ColumnModel(); + appData.setId(t.getSystemId() + "1"); + appData.setSortCode(0L); + appData.setCreatorTime(datetime); + appData.setFullName("APP菜单"); + appData.setIcon("icon-ym icon-ym-mobile"); + appData.setParentId(t.getSystemId()); + allButtonList.add(appData); + appIds.put(t.getSystemId(), appData.getId()); + } else { + t.setParentId(appIds.get(t.getSystemId()) + ""); + } + } else if ("Web".equals(t.getCategory()) && "-1".equals(t.getParentId())) { + if (!webIds.containsKey(t.getSystemId())) { + t.setParentId(t.getSystemId() + "2"); + ColumnModel webData = new ColumnModel(); + webData.setId(t.getSystemId() + "2"); + webData.setSortCode(-1L); + webData.setCreatorTime(datetime); + webData.setFullName("WEB菜单"); + webData.setIcon("icon-ym icon-ym-pc"); + webData.setParentId(t.getSystemId()); + allButtonList.add(webData); + webIds.put(t.getSystemId(), webData.getId()); + } else { + t.setParentId(webIds.get(t.getSystemId()) + ""); + } + } + ColumnModel model = JsonUtil.getJsonToBean(t, ColumnModel.class); + allButtonList.add(model); + }); + allButtonList.stream().filter(t -> "-1".equals(t.getParentId())).forEach(t -> t.setParentId(t.getSystemId())); + List systemId = allButtonList.stream().filter(t -> StringUtil.isNotEmpty(t.getParentId())).map(ColumnModel::getParentId).collect(Collectors.toList()); + systemId.forEach(t -> { + if (Optional.ofNullable(systemEntityMap.get(t)).isPresent()) { + ColumnModel jsonToBean = JsonUtil.getJsonToBean(systemEntityMap.get(t), ColumnModel.class); + jsonToBean.setParentId("-1"); + allButtonList.add(jsonToBean); + } + }); + List treeList = JsonUtil.getJsonToList(allButtonList, AuthorizeDataModel.class); + // 处理不可选的 + treeList.forEach(t -> { + if (noContainsIds.contains(t.getId())) { + t.setDisabled(true); + } + }); + treeList = treeList.stream().sorted(Comparator.comparing(AuthorizeDataModel::getSortCode).thenComparing(AuthorizeDataModel::getCreatorTime, Comparator.reverseOrder())).collect(Collectors.toList()); + List> trees = TreeDotUtils.convertListToTreeDot(treeList); + List data = JsonUtil.getJsonToList(trees, AuthorizeDataReturnModel.class); + vo.setAll(allButtonList.stream().map(ColumnModel::getId).distinct().collect(Collectors.toList())); + vo.setList(data); + ids.addAll(noContainsIds); + vo.setIds(authorizeLists.stream().map(AuthorizeEntity::getItemId).distinct().collect(Collectors.toList())); + return vo; + } + + /** + * 表单权限 + * + * @param moduleList 功能 + * @param selectorSystemList 应用列表 + * @param authorizeList 已有权限 + * @param authorizeModel 权限集合 + * @return + */ + AuthorizeDataReturnVO moduleForm(List moduleList, List selectorSystemList, List authorizeList, AuthorizeVO authorizeModel) { + AuthorizeDataReturnVO vo = new AuthorizeDataReturnVO(); + // 树 + List allButtonList = new ArrayList<>(); + // id + List ids = new ArrayList<>(); + List noContainsIds = new ArrayList<>(); + // 转map + Map moduleMap = moduleList.stream().collect(Collectors.toMap(ModuleEntity::getId, Function.identity())); + Set moduleIdIds = moduleMap.keySet(); + Map systemEntityMap = selectorSystemList.stream().collect(Collectors.toMap(SystemEntity::getId, Function.identity())); + Set systemIdIds = systemEntityMap.keySet(); + // 我的菜单权限 + List myButtonList = authorizeModel.getFormsList(); + myButtonList = myButtonList.stream().filter(t -> moduleIdIds.contains(t.getModuleId())).collect(Collectors.toList()); + // 权限组的权限 + List authorizeLists = authorizeList.stream().filter(t -> AuthorizeConst.FROM.equals(t.getItemType())).collect(Collectors.toList()); + List buttonByIds = formApi.getListByIds(authorizeLists.stream().map(AuthorizeEntity::getItemId).collect(Collectors.toList())) + .stream().filter(t -> moduleIdIds.contains(t.getModuleId())).collect(Collectors.toList()); + List permissionGroupButtonList = JsonUtil.getJsonToList(buttonByIds, ModuleFormModel.class); + // 将菜单id设置给按钮的上级 + myButtonList.forEach(t -> t.setParentId(t.getModuleId())); + permissionGroupButtonList.forEach(t -> t.setParentId(t.getModuleId())); + // 所有的按钮权限 + allButtonList.addAll(myButtonList); + allButtonList.addAll(permissionGroupButtonList); + // 我的按钮id + List myButtonId = myButtonList.stream().map(ModuleFormModel::getId).collect(Collectors.toList()); + // 交集 1:1 + List containsButtonList = permissionGroupButtonList.stream().filter(t -> myButtonId.contains(t.getId())).map(ModuleFormModel::getId).distinct().collect(Collectors.toList()); + // 我没有的 + List noContainsButtonList = permissionGroupButtonList.stream().filter(t -> !containsButtonList.contains(t.getId())).map(ModuleFormModel::getId).collect(Collectors.toList()); + List collect3 = authorizeList.stream().map(AuthorizeEntity::getItemId).collect(Collectors.toList()); + ids.addAll(collect3); + ids.addAll(containsButtonList); + noContainsIds.addAll(noContainsButtonList); + // 我的菜单 + List myModuleList = authorizeModel.getModuleList(); + // 共有菜单 + List containsModuleList = myModuleList.stream().filter(t -> moduleIdIds.contains(t.getId())).map(ModuleModel::getId).collect(Collectors.toList()); + List myModuleIds = myModuleList.stream().map(ModuleModel::getId).collect(Collectors.toList()); + List noContainsModuleList = moduleIdIds.stream().filter(t -> !myModuleIds.contains(t)).collect(Collectors.toList()); + ids.addAll(containsModuleList); + noContainsIds.addAll(noContainsModuleList); + // 我的应用 + List mySystemList = authorizeModel.getSystemList(); + // 共有应用 + List containsSystemList = mySystemList.stream().filter(t -> systemIdIds.contains(t.getId())).map(SystemBaeModel::getId).collect(Collectors.toList()); + List mySystemIds = mySystemList.stream().map(SystemBaeModel::getId).collect(Collectors.toList()); + List noContainsSystemList = systemIdIds.stream().filter(t -> !mySystemIds.contains(t)).collect(Collectors.toList()); + ids.addAll(containsSystemList); + noContainsIds.addAll(noContainsSystemList); + // 所有按钮权限的上级 + List allModuleIds = allButtonList.stream().map(ModuleFormModel::getParentId).distinct().collect(Collectors.toList()); + Map allModuleListMap = new HashMap<>(); + // 新建APP菜单上级 + allModuleIds.forEach(t -> { + ModuleEntity entity = moduleMap.get(t); + while (entity != null) { + allModuleListMap.put(entity.getId(), entity); + entity = moduleMap.get(entity.getParentId()); + } + }); + // 存放上级菜单id及上级 systemId,id + Map appIds = new HashMap<>(16); + Map webIds = new HashMap<>(16); + long datetime = System.currentTimeMillis(); + allModuleListMap.values().stream().sorted(Comparator.comparing(ModuleEntity::getCategory).reversed()).forEach(t -> { + if ("App".equals(t.getCategory()) && "-1".equals(t.getParentId())) { + if (!appIds.containsKey(t.getSystemId())) { + t.setParentId(t.getSystemId() + "1"); + ModuleFormModel appData = new ModuleFormModel(); + appData.setId(t.getSystemId() + "1"); + appData.setSortCode(0L); + appData.setCreatorTime(datetime); + appData.setFullName("APP菜单"); + appData.setIcon("icon-ym icon-ym-mobile"); + appData.setParentId(t.getSystemId()); + allButtonList.add(appData); + appIds.put(t.getSystemId(), appData.getId()); + } else { + t.setParentId(appIds.get(t.getSystemId()) + ""); + } + } else if ("Web".equals(t.getCategory()) && "-1".equals(t.getParentId())) { + if (!webIds.containsKey(t.getSystemId())) { + t.setParentId(t.getSystemId() + "2"); + ModuleFormModel webData = new ModuleFormModel(); + webData.setId(t.getSystemId() + "2"); + webData.setSortCode(-1L); + webData.setCreatorTime(datetime); + webData.setFullName("WEB菜单"); + webData.setIcon("icon-ym icon-ym-pc"); + webData.setParentId(t.getSystemId()); + allButtonList.add(webData); + webIds.put(t.getSystemId(), webData.getId()); + } else { + t.setParentId(webIds.get(t.getSystemId()) + ""); + } + } + ModuleFormModel model = JsonUtil.getJsonToBean(t, ModuleFormModel.class); + allButtonList.add(model); + }); + allButtonList.stream().filter(t -> "-1".equals(t.getParentId())).forEach(t -> t.setParentId(t.getSystemId())); + List systemId = allButtonList.stream().filter(t -> StringUtil.isNotEmpty(t.getParentId())).map(ModuleFormModel::getParentId).collect(Collectors.toList()); + systemId.forEach(t -> { + if (Optional.ofNullable(systemEntityMap.get(t)).isPresent()) { + ModuleFormModel jsonToBean = JsonUtil.getJsonToBean(systemEntityMap.get(t), ModuleFormModel.class); + jsonToBean.setParentId("-1"); + allButtonList.add(jsonToBean); + } + }); + List treeList = JsonUtil.getJsonToList(allButtonList, AuthorizeDataModel.class); + // 处理不可选的 + treeList.forEach(t -> { + if (noContainsIds.contains(t.getId())) { + t.setDisabled(true); + } + }); + treeList = treeList.stream().sorted(Comparator.comparing(AuthorizeDataModel::getSortCode).thenComparing(AuthorizeDataModel::getCreatorTime, Comparator.reverseOrder())).collect(Collectors.toList()); + List> trees = TreeDotUtils.convertListToTreeDot(treeList); + List data = JsonUtil.getJsonToList(trees, AuthorizeDataReturnModel.class); + vo.setAll(allButtonList.stream().map(ModuleFormModel::getId).distinct().collect(Collectors.toList())); + vo.setList(data); + ids.addAll(noContainsIds); + vo.setIds(authorizeLists.stream().map(AuthorizeEntity::getItemId).distinct().collect(Collectors.toList())); + return vo; + } + + /** + * 数据权限 + * + * @param moduleList 功能 + * @param selectorSystemList 应用方案 + * @param authorizeList 已有权限 + * @param authorizeModel 权限集合 + * @return + */ + AuthorizeDataReturnVO resourceData(List moduleList, List selectorSystemList, List authorizeList, AuthorizeVO authorizeModel) { + AuthorizeDataReturnVO vo = new AuthorizeDataReturnVO(); + // 树 + List allButtonList = new ArrayList<>(); + // id + List ids = new ArrayList<>(); + List noContainsIds = new ArrayList<>(); + // 转map + Map moduleMap = moduleList.stream().collect(Collectors.toMap(ModuleEntity::getId, Function.identity())); + Set moduleIdIds = moduleMap.keySet(); + Map systemEntityMap = selectorSystemList.stream().collect(Collectors.toMap(SystemEntity::getId, Function.identity())); + Set systemIdIds = systemEntityMap.keySet(); + // 我的菜单权限 + List myButtonList = authorizeModel.getResourceList(); + myButtonList = myButtonList.stream().filter(t -> moduleIdIds.contains(t.getModuleId())).collect(Collectors.toList()); + // 权限组的权限 + List authorizeLists = authorizeList.stream().filter(t -> AuthorizeConst.RESOURCE.equals(t.getItemType())).collect(Collectors.toList()); + List buttonByIds = schemeApi.getListByIds(authorizeLists.stream().map(AuthorizeEntity::getItemId).collect(Collectors.toList())) + .stream().filter(t -> moduleIdIds.contains(t.getModuleId())).collect(Collectors.toList()); + List permissionGroupButtonList = JsonUtil.getJsonToList(buttonByIds, ResourceModel.class); + // 将菜单id设置给按钮的上级 + myButtonList.forEach(t -> t.setParentId(t.getModuleId())); + permissionGroupButtonList.forEach(t -> t.setParentId(t.getModuleId())); + // 所有的按钮权限 + allButtonList.addAll(myButtonList); + allButtonList.addAll(permissionGroupButtonList); + // 我的按钮id + List myButtonId = myButtonList.stream().map(ResourceModel::getId).collect(Collectors.toList()); + // 交集 1:1 + List containsButtonList = permissionGroupButtonList.stream().filter(t -> myButtonId.contains(t.getId())).map(ResourceModel::getId).distinct().collect(Collectors.toList()); + // 我没有的 + List noContainsButtonList = permissionGroupButtonList.stream().filter(t -> !containsButtonList.contains(t.getId())).map(ResourceModel::getId).collect(Collectors.toList()); + List collect3 = authorizeList.stream().map(AuthorizeEntity::getItemId).collect(Collectors.toList()); + ids.addAll(collect3); + ids.addAll(containsButtonList); + noContainsIds.addAll(noContainsButtonList); + // 我的菜单 + List myModuleList = authorizeModel.getModuleList(); + // 共有菜单 + List containsModuleList = myModuleList.stream().filter(t -> moduleIdIds.contains(t.getId())).map(ModuleModel::getId).collect(Collectors.toList()); + List myModuleIds = myModuleList.stream().map(ModuleModel::getId).collect(Collectors.toList()); + List noContainsModuleList = moduleIdIds.stream().filter(t -> !myModuleIds.contains(t)).collect(Collectors.toList()); + ids.addAll(containsModuleList); + noContainsIds.addAll(noContainsModuleList); + // 我的应用 + List mySystemList = authorizeModel.getSystemList(); + // 共有应用 + List containsSystemList = mySystemList.stream().filter(t -> systemIdIds.contains(t.getId())).map(SystemBaeModel::getId).collect(Collectors.toList()); + List mySystemIds = mySystemList.stream().map(SystemBaeModel::getId).collect(Collectors.toList()); + List noContainsSystemList = systemIdIds.stream().filter(t -> !mySystemIds.contains(t)).collect(Collectors.toList()); + ids.addAll(containsSystemList); + noContainsIds.addAll(noContainsSystemList); + // 所有按钮权限的上级 + List allModuleIds = allButtonList.stream().map(ResourceModel::getParentId).distinct().collect(Collectors.toList()); + Map allModuleListMap = new HashMap<>(); + // 新建APP菜单上级 + allModuleIds.forEach(t -> { + ModuleEntity entity = moduleMap.get(t); + while (entity != null) { + allModuleListMap.put(entity.getId(), entity); + entity = moduleMap.get(entity.getParentId()); + } + }); + // 存放上级菜单id及上级 systemId,id + Map appIds = new HashMap<>(16); + Map webIds = new HashMap<>(16); + long datetime = System.currentTimeMillis(); + allModuleListMap.values().stream().sorted(Comparator.comparing(ModuleEntity::getCategory).reversed()).forEach(t -> { + if ("App".equals(t.getCategory()) && "-1".equals(t.getParentId())) { + if (!appIds.containsKey(t.getSystemId())) { + t.setParentId(t.getSystemId() + "1"); + ResourceModel appData = new ResourceModel(); + appData.setId(t.getSystemId() + "1"); + appData.setSortCode(0L); + appData.setCreatorTime(datetime); + appData.setFullName("APP菜单"); + appData.setIcon("icon-ym icon-ym-mobile"); + appData.setParentId(t.getSystemId()); + allButtonList.add(appData); + appIds.put(t.getSystemId(), appData.getId()); + } else { + t.setParentId(appIds.get(t.getSystemId()) + ""); + } + } else if ("Web".equals(t.getCategory()) && "-1".equals(t.getParentId())) { + if (!webIds.containsKey(t.getSystemId())) { + t.setParentId(t.getSystemId() + "2"); + ResourceModel webData = new ResourceModel(); + webData.setId(t.getSystemId() + "2"); + webData.setSortCode(-1L); + webData.setCreatorTime(datetime); + webData.setFullName("WEB菜单"); + webData.setIcon("icon-ym icon-ym-pc"); + webData.setParentId(t.getSystemId()); + allButtonList.add(webData); + webIds.put(t.getSystemId(), webData.getId()); + } else { + t.setParentId(webIds.get(t.getSystemId()) + ""); + } + } + ResourceModel model = JsonUtil.getJsonToBean(t, ResourceModel.class); + allButtonList.add(model); + }); + allButtonList.stream().filter(t -> "-1".equals(t.getParentId())).forEach(t -> t.setParentId(t.getSystemId())); + List systemId = allButtonList.stream().filter(t -> StringUtil.isNotEmpty(t.getParentId())).map(ResourceModel::getParentId).collect(Collectors.toList()); + systemId.forEach(t -> { + if (Optional.ofNullable(systemEntityMap.get(t)).isPresent()) { + ResourceModel jsonToBean = JsonUtil.getJsonToBean(systemEntityMap.get(t), ResourceModel.class); + jsonToBean.setParentId("-1"); + allButtonList.add(jsonToBean); + } + }); + List treeList = JsonUtil.getJsonToList(allButtonList, AuthorizeDataModel.class); + // 处理不可选的 + treeList.forEach(t -> { + if (noContainsIds.contains(t.getId())) { + t.setDisabled(true); + } + }); + treeList = treeList.stream().sorted(Comparator.comparing(AuthorizeDataModel::getSortCode).thenComparing(AuthorizeDataModel::getCreatorTime, Comparator.reverseOrder())).collect(Collectors.toList()); + List> trees = TreeDotUtils.convertListToTreeDot(treeList); + List data = JsonUtil.getJsonToList(trees, AuthorizeDataReturnModel.class); + vo.setAll(allButtonList.stream().map(ResourceModel::getId).distinct().collect(Collectors.toList())); + vo.setList(data); + ids.addAll(noContainsIds); + vo.setIds(authorizeLists.stream().map(AuthorizeEntity::getItemId).distinct().collect(Collectors.toList())); + return vo; + } + + /** + * 查看流程权限组 + * + * @param id 主键 + * @return + */ + @Operation(summary = "查看流程权限组") + @Parameter(name = "id", description = "主键", required = true) + @GetMapping("/GroupFlow/{id}") + public ActionResult> groupFlow(@PathVariable("id") String id) { + List data = permissionGroupService.list(true, null); + List objectId = data.stream().map(PermissionGroupEntity::getId).collect(Collectors.toList()); + List groupId = authorizeService.getListByRoleIdsAndItemType(objectId, AuthorizeConst.FLOW).stream().filter(t -> t.getItemId().equals(id)).map(AuthorizeEntity::getObjectId).collect(Collectors.toList()); + List groupList = data.stream().filter(t -> groupId.contains(t.getId())).map(PermissionGroupEntity::getId).collect(Collectors.toList()); + ListVO listVO = new ListVO<>(); + listVO.setList(groupList); + return ActionResult.success(listVO); + } + + /** + * 保存流程权限 + * + * @return + */ + @Operation(summary = "保存流程权限") + @Parameters({ + @Parameter(name = "id", description = "对象主键", required = true) + }) + @PostMapping("/GroupFlow/{id}") + public ActionResult groupFlow(@PathVariable("id") String id, @RequestBody SavePortalAuthModel model) { + model.setId(id); + model.setType(AuthorizeConst.FLOW); + authorizeService.saveObjectAuth(model); + return ActionResult.success(MsgCode.SU005.get()); + } + + /** + * 保存流程权限 + * + * @return + */ + @Operation(summary = "保存流程权限") + @Parameters({ + @Parameter(name = "id", description = "对象主键", required = true) + }) + @PostMapping("/Flow/{id}") + public ActionResult saveFlowAuth(@PathVariable("id") String id, @RequestBody SavePortalAuthModel model) { + model.setId(id); + model.setType(AuthorizeConst.FLOW); + authorizeService.saveItemAuth(model); + return ActionResult.success(MsgCode.SU005.get()); + } + + /** + * 获取流程权限 + * + * @return + */ + @Operation(summary = "获取流程权限") + @Parameters({ + @Parameter(name = "id", description = "对象主键", required = true) + }) + @GetMapping("/Flow/{id}") + public ActionResult getFlowAuth(@PathVariable("id") String id) { + PortalVO vo = new PortalVO(); + List treeList = templateApi.treeListWithPower(); + List idAll = new ArrayList<>(); + idList(treeList, idAll); + // 权限组权限 + List authorizePortalManage = authorizeService.getListByObjectId(id, AuthorizeConst.FLOW); + List ids = authorizePortalManage.stream().map(AuthorizeEntity::getItemId).collect(Collectors.toList()); + vo.setAll(idAll); + vo.setIds(ids); + vo.setList(JsonUtil.getJsonToList(treeList, PortalListVO.class)); + return ActionResult.success(vo); + } + + private void idList(List list, List idAll) { + for (TemplateTreeListVo vo : list) { + idAll.add(vo.getId()); + vo.setDisabled(false); + if (vo.getChildren() != null) { + idList(vo.getChildren(), idAll); + } + } + } + + /** + * 保存打印权限 + * + * @return + */ + @Operation(summary = "保存打印权限") + @Parameters({ + @Parameter(name = "id", description = "对象主键", required = true) + }) + @PostMapping("/Print/{id}") + public ActionResult savePrintAuth(@PathVariable("id") String id, @RequestBody SavePortalAuthModel model) { + model.setId(id); + model.setType(AuthorizeConst.PRINT); + authorizeService.saveItemAuth(model); + return ActionResult.success(MsgCode.SU005.get()); + } + + /** + * 获取打印权限 + * + * @return + */ + @Operation(summary = "获取打印权限") + @Parameters({ + @Parameter(name = "id", description = "对象主键", required = true) + }) + @GetMapping("/Print/{id}") + public ActionResult getPrintAuth(@PathVariable("id") String id) { + PortalVO vo = new PortalVO(); + PaginationPrint paginationPrint = new PaginationPrint(); + paginationPrint.setDataType(1); + paginationPrint.setVisibleType(2); + List list = printDevService.getWorkSelector(paginationPrint); + List idAll = new ArrayList<>(); + List category = list.stream().map(PrintDevEntity::getCategory).collect(Collectors.toList()); + List dictionName = dictionaryDataApi.getDictionName(category); + List treeList = new ArrayList<>(); + for (DictionaryDataEntity dict : dictionName) { + TemplateTreeListVo tree = JsonUtil.getJsonToBean(dict, TemplateTreeListVo.class); + idAll.add(dict.getId()); + List childList = list.stream() + .filter(e -> dict.getId().equals(e.getCategory())) + .sorted(Comparator.comparing(PrintDevEntity::getSortCode).thenComparing(PrintDevEntity::getCreatorTime, Comparator.reverseOrder())).collect(Collectors.toList()); + if (childList.size() > 0) { + List childListAll = new ArrayList<>(); + for (PrintDevEntity entity : childList) { + TemplateTreeListVo user = JsonUtil.getJsonToBean(entity, TemplateTreeListVo.class); + idAll.add(entity.getId()); + childListAll.add(user); + } + tree.setChildren(childListAll); + treeList.add(tree); + } + } + // 权限组权限 + List authorizePortalManage = authorizeService.getListByObjectId(id, AuthorizeConst.PRINT); + List ids = authorizePortalManage.stream().map(AuthorizeEntity::getItemId).collect(Collectors.toList()); + vo.setAll(idAll); + vo.setIds(ids); + vo.setList(JsonUtil.getJsonToList(treeList, PortalListVO.class)); + return ActionResult.success(vo); + } + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-controller/src/main/java/com/yunzhupaas/permission/controller/GroupController.java b/yunzhupaas-permission/yunzhupaas-permission-controller/src/main/java/com/yunzhupaas/permission/controller/GroupController.java new file mode 100644 index 0000000..f7e9d8e --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-controller/src/main/java/com/yunzhupaas/permission/controller/GroupController.java @@ -0,0 +1,269 @@ +package com.yunzhupaas.permission.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import com.yunzhupaas.base.controller.SuperController; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.service.DictionaryDataService; +import com.yunzhupaas.base.service.DictionaryTypeService; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.constant.PermissionConst; +import com.yunzhupaas.permission.entity.GroupEntity; +import com.yunzhupaas.permission.entity.UserRelationEntity; +import com.yunzhupaas.permission.model.user.mod.UserIdModel; +import com.yunzhupaas.permission.model.usergroup.*; +import com.yunzhupaas.permission.service.GroupService; +import com.yunzhupaas.permission.service.UserRelationService; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.enums.DictionaryDataEnum; +import com.yunzhupaas.util.treeutil.SumTree; +import com.yunzhupaas.util.treeutil.newtreeutil.TreeDotUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; +import java.util.ArrayList; +import java.util.List; + +/** + * 分组管理控制器 + * + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/3/10 17:57 + */ +@RestController +@Tag(name = "分组管理", description = "UserGroupController") +@RequestMapping("/api/permission/Group") +public class GroupController extends SuperController { + + @Autowired + private GroupService userGroupService; + @Autowired + private DictionaryDataService dictionaryDataApi; + @Autowired + private DictionaryTypeService dictionaryTypeApi; + @Autowired + private UserRelationService userRelationService; + + /** + * 获取分组管理列表 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "获取分组管理列表") + @SaCheckPermission(value = {"permission.group"}) + @GetMapping + public ActionResult> list(PaginationGroup pagination) { + List list = userGroupService.getList(pagination); + List jsonToList = JsonUtil.getJsonToList(list, GroupPaginationVO.class); + // 通过数据字典获取类型 + List dictionaryDataEntities = dictionaryDataApi.getList(dictionaryTypeApi.getInfoByEnCode(DictionaryDataEnum.PERMISSION_GROUP.getDictionaryTypeId()).getId()); + for (GroupPaginationVO userGroupPaginationVO : jsonToList) { + DictionaryDataEntity dictionaryDataEntity = dictionaryDataEntities.stream().filter(t -> t.getId().equals(userGroupPaginationVO.getType())).findFirst().orElse(null); + userGroupPaginationVO.setType(dictionaryDataEntity != null ? dictionaryDataEntity.getFullName() : userGroupPaginationVO.getId()); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(jsonToList, paginationVO); + } + + /** + * 获取分组管理下拉框 + * @return + */ + @Operation(summary = "获取分组管理下拉框") + @GetMapping("/Selector") + public ActionResult> selector() { + List tree = new ArrayList<>(); + List data = userGroupService.list(); + List dataEntityList = dictionaryDataApi.getList(dictionaryTypeApi.getInfoByEnCode(DictionaryDataEnum.PERMISSION_GROUP.getDictionaryTypeId()).getId()); + // 获取分组管理外层菜单 + for (DictionaryDataEntity dictionaryDataEntity : dataEntityList) { + GroupTreeModel firstModel = JsonUtil.getJsonToBean(dictionaryDataEntity, GroupTreeModel.class); + firstModel.setId(dictionaryDataEntity.getId()); + firstModel.setType("0"); + long num = data.stream().filter(t -> t.getType().equals(dictionaryDataEntity.getId())).count(); + firstModel.setNum(num); + if (num > 0) { + tree.add(firstModel); + } + } + for (GroupEntity entity : data) { + GroupTreeModel treeModel = JsonUtil.getJsonToBean(entity, GroupTreeModel.class); + treeModel.setType("group"); + treeModel.setParentId(entity.getType()); + treeModel.setIcon("icon-ym icon-ym-generator-group1"); + treeModel.setId(entity.getId()); + DictionaryDataEntity dataEntity = dictionaryDataApi.getInfo(entity.getType()); + if (dataEntity != null) { + tree.add(treeModel); + } + } + List> sumTrees = TreeDotUtils.convertListToTreeDot(tree); + List list = JsonUtil.getJsonToList(sumTrees, GroupSelectorVO.class); + ListVO vo = new ListVO<>(); + vo.setList(list); + return ActionResult.success(list); + } + + /** + * 自定义范围获取分组下拉框 + * + * @param idModel 岗位选择模型 + * @return + */ + @Operation(summary = "自定义范围获取分组下拉框") + @Parameters({ + @Parameter(name = "positionConditionModel", description = "岗位选择模型", required = true) + }) + @PostMapping("/GroupCondition") + public ActionResult> positionCondition(@RequestBody UserIdModel idModel) { + List data = userGroupService.getListByIds(idModel.getIds(), true); + List tree = new ArrayList<>(); + List dataEntityList = dictionaryDataApi.getListByTypeDataCode(DictionaryDataEnum.PERMISSION_GROUP.getDictionaryTypeId()); + // 获取分组管理外层菜单 + for (DictionaryDataEntity dictionaryDataEntity : dataEntityList) { + GroupTreeModel firstModel = JsonUtil.getJsonToBean(dictionaryDataEntity, GroupTreeModel.class); + firstModel.setId(dictionaryDataEntity.getId()); + firstModel.setType("0"); + long num = data.stream().filter(t -> t.getType().equals(dictionaryDataEntity.getId())).count(); + firstModel.setNum(num); + if (num > 0) { + tree.add(firstModel); + } + } + for (GroupEntity entity : data) { + GroupTreeModel treeModel = JsonUtil.getJsonToBean(entity, GroupTreeModel.class); + treeModel.setType("group"); + treeModel.setParentId(entity.getType()); + treeModel.setIcon("icon-ym icon-ym-generator-group1"); + treeModel.setId(entity.getId()); + DictionaryDataEntity dataEntity = dictionaryDataApi.getInfo(entity.getType()); + if (dataEntity != null) { + tree.add(treeModel); + } + } + List> sumTrees = TreeDotUtils.convertListToTreeDot(tree); + List list = JsonUtil.getJsonToList(sumTrees, GroupSelectorVO.class); + ListVO vo = new ListVO<>(); + vo.setList(list); + return ActionResult.success(vo); + } + + /** + * 信息 + * + * @param id 主键 + * @return + */ + @Operation(summary = "信息") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission(value = {"permission.group"}) + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) { + GroupEntity entity = userGroupService.getInfo(id); + GroupInfoVO vo = JsonUtil.getJsonToBean(entity, GroupInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 创建 + * + * @param userGroupCrForm 新建模型 + * @return + */ + @Operation(summary = "创建") + @Parameters({ + @Parameter(name = "userGroupCrForm", description = "新建模型", required = true) + }) + @SaCheckPermission(value = {"permission.group"}) + @PostMapping + public ActionResult create(@RequestBody @Valid GroupCrForm userGroupCrForm) { + GroupEntity entity = JsonUtil.getJsonToBean(userGroupCrForm, GroupEntity.class); + // 判断名称是否重复 + if (userGroupService.isExistByFullName(entity.getFullName(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + // 判断编码是否重复 + if (userGroupService.isExistByEnCode(entity.getEnCode(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + userGroupService.crete(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 更新 + * + * @param id 主键 + * @param userGroupUpForm 修改模型 + * @return + */ + @Operation(summary = "更新") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "userGroupUpForm", description = "修改模型", required = true) + }) + @SaCheckPermission(value = {"permission.group"}) + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid GroupUpForm userGroupUpForm) { + GroupEntity groupEntity = userGroupService.getInfo(id); + if (groupEntity == null) { + return ActionResult.fail(MsgCode.FA013.get()); + } + if ((groupEntity.getEnabledMark() == 1 && userGroupUpForm.getEnabledMark() == 0) + && userRelationService.getListByObjectId(id, PermissionConst.GROUP).size() > 0) { + return ActionResult.fail(MsgCode.FA030.get()); + } + GroupEntity entity = JsonUtil.getJsonToBean(userGroupUpForm, GroupEntity.class); + // 判断名称是否重复 + if (userGroupService.isExistByFullName(entity.getFullName(), id)) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + // 判断编码是否重复 + if (userGroupService.isExistByEnCode(entity.getEnCode(), id)) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + userGroupService.update(id, entity); + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission(value = {"permission.group"}) + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + GroupEntity entity = userGroupService.getInfo(id); + if (entity == null) { + return ActionResult.fail(MsgCode.FA003.get()); + } + List bingUserByRoleList = userRelationService.getListByObjectId(id, PermissionConst.GROUP); + if (bingUserByRoleList.size() > 0) { + return ActionResult.fail(MsgCode.FA024.get()); + } + userGroupService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-controller/src/main/java/com/yunzhupaas/permission/controller/OrganizeAdministratorController.java b/yunzhupaas-permission/yunzhupaas-permission-controller/src/main/java/com/yunzhupaas/permission/controller/OrganizeAdministratorController.java new file mode 100644 index 0000000..89e22b4 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-controller/src/main/java/com/yunzhupaas/permission/controller/OrganizeAdministratorController.java @@ -0,0 +1,1169 @@ +package com.yunzhupaas.permission.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.util.ObjectUtil; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import com.yunzhupaas.base.controller.SuperController; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.entity.ModuleEntity; +import com.yunzhupaas.base.entity.SystemEntity; +import com.yunzhupaas.base.service.DictionaryDataService; +import com.yunzhupaas.base.service.ModuleService; +import com.yunzhupaas.base.service.SystemService; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.YunzhupaasConst; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.constant.PermissionConst; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.model.tenant.TenantAuthorizeModel; +import com.yunzhupaas.permission.entity.OrganizeAdministratorEntity; +import com.yunzhupaas.permission.entity.OrganizeEntity; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.model.organizeadministrator.*; +import com.yunzhupaas.permission.service.OrganizeAdministratorService; +import com.yunzhupaas.permission.service.OrganizeService; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.treeutil.SumTree; +import com.yunzhupaas.util.treeutil.newtreeutil.TreeDotUtils; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +import static com.yunzhupaas.util.Constants.ADMIN_KEY; + +/** + * 机构分级管理员 + * + * @author YUNZHUPAAS + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021-08-30 10:30:04 + */ +@Tag(name = "机构分级管理员", description = "organizeAdminIsTrator") +@Slf4j +@RestController +@RequestMapping("/api/permission/organizeAdminIsTrator") +public class OrganizeAdministratorController + extends SuperController { + + @Autowired + private OrganizeAdministratorService organizeAdminIsTratorService; + @Autowired + private OrganizeService organizeService; + @Autowired + private SystemService systemApi; + @Autowired + private ModuleService moduleApi; + @Autowired + private UserService userService; + @Autowired + private DictionaryDataService dictionaryDataApi; + @Autowired + private ConfigValueUtil configValueUtil; + + /** + * 获取分级管理员列表 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "获取分级管理员列表") + @SaCheckPermission(value = { "permission.grade" }) + @GetMapping + public ActionResult> list(Pagination pagination) { + List list = organizeAdminIsTratorService.getList(pagination); + List dataServiceList4 = dictionaryDataApi.getListByTypeDataCode("sex"); + Map dataServiceMap4 = dataServiceList4.stream() + .filter(t -> ObjectUtil.equal(t.getEnabledMark(), 1)) + .collect(Collectors.toMap(DictionaryDataEntity::getEnCode, DictionaryDataEntity::getFullName)); + list.forEach(t -> t.setGender(dataServiceMap4.get(t.getGender()))); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(list, paginationVO); + } + + /** + * 保存分级管理员 + * + * @param organizeAdminIsTratorCrForm 新建模型 + * @return + */ + @Operation(summary = "保存分级管理员") + @Parameters({ + @Parameter(name = "organizeAdminIsTratorCrForm", description = "新建模型", required = true) + }) + @SaCheckPermission(value = { "permission.grade" }) + @PostMapping + public ActionResult save(@RequestBody @Valid OrganizeAdminIsTratorCrForm organizeAdminIsTratorCrForm) { + String userId = organizeAdminIsTratorCrForm.getUserId(); + if (UserProvider.getLoginUserId().equals(userId)) { + return ActionResult.fail(MsgCode.PS017.get()); + } + List list = new ArrayList<>(16); + // 递归得到所有的数组 + String managerGroup = organizeAdminIsTratorCrForm.getManagerGroup(); + List orgAdminModel = organizeList(organizeAdminIsTratorCrForm); + getOrganizeAdminIsTratorModel(list, orgAdminModel, managerGroup); + List jsonToList = JsonUtil.getJsonToList(list, OrganizeAdministratorEntity.class); + // 处理应用 + List systemIds = organizeAdminIsTratorCrForm.getSystemIds(); + systemIds.forEach(t -> { + OrganizeAdministratorEntity entity = new OrganizeAdministratorEntity(); + entity.setOrganizeType(PermissionConst.SYSTEM); + entity.setOrganizeId(t); + entity.setThisLayerSelect(1); + entity.setManagerGroup(organizeAdminIsTratorCrForm.getManagerGroup()); + jsonToList.add(entity); + }); + // 处理菜单 + List moduleIds = organizeAdminIsTratorCrForm.getModuleIds(); + moduleIds.forEach(t -> { + OrganizeAdministratorEntity entity = new OrganizeAdministratorEntity(); + entity.setOrganizeType(PermissionConst.MODULE); + entity.setOrganizeId(t); + entity.setThisLayerSelect(1); + entity.setManagerGroup(organizeAdminIsTratorCrForm.getManagerGroup()); + jsonToList.add(entity); + }); + organizeAdminIsTratorService.createList(jsonToList, userId); + return ActionResult.success(MsgCode.SU002.get()); + } + + /** + * 获取 + * + * @param list + * @param jsonToList + */ + private void getOrganizeAdminIsTratorModel(List list, + List jsonToList, String managerGroup) { + if (jsonToList != null) { + jsonToList.forEach(t -> { + OrganizeAdministratorCrModel vo = JsonUtil.getJsonToBean(t, OrganizeAdministratorCrModel.class); + vo.setChildren(null); + if (vo.getThisLayerSelect() != null && (vo.getThisLayerSelect() == 2 || vo.getThisLayerSelect() == 1)) { + vo.setThisLayerSelect(1); + if (vo.getThisLayerAdd() != null && (vo.getThisLayerAdd() == 2 || vo.getThisLayerAdd() == 1)) { + vo.setThisLayerAdd(1); + } + if (vo.getThisLayerEdit() != null && (vo.getThisLayerEdit() == 2 || vo.getThisLayerEdit() == 1)) { + vo.setThisLayerEdit(1); + } + if (vo.getThisLayerDelete() != null + && (vo.getThisLayerDelete() == 2 || vo.getThisLayerDelete() == 1)) { + vo.setThisLayerDelete(1); + } + } else if (vo.getThisLayerSelect() == null || vo.getThisLayerSelect() == 0 + || vo.getThisLayerSelect() == 3) { + vo.setThisLayerSelect(0); + vo.setThisLayerAdd(0); + vo.setThisLayerEdit(0); + vo.setThisLayerDelete(0); + } + if (vo.getSubLayerSelect() != null && (vo.getSubLayerSelect() == 2 || vo.getSubLayerSelect() == 1)) { + vo.setSubLayerSelect(1); + if (vo.getSubLayerAdd() != null && (vo.getSubLayerAdd() == 2 || vo.getSubLayerAdd() == 1)) { + vo.setSubLayerAdd(1); + } + if (vo.getSubLayerEdit() != null && (vo.getSubLayerEdit() == 2 || vo.getSubLayerEdit() == 1)) { + vo.setSubLayerEdit(1); + } + if (vo.getSubLayerDelete() != null + && (vo.getSubLayerDelete() == 2 || vo.getSubLayerDelete() == 1)) { + vo.setSubLayerDelete(1); + } + } else if (vo.getSubLayerSelect() == null || vo.getSubLayerSelect() == 0 + || vo.getSubLayerSelect() == 3) { + vo.setSubLayerSelect(0); + vo.setSubLayerAdd(0); + vo.setSubLayerEdit(0); + vo.setSubLayerDelete(0); + } + vo.setManagerGroup(managerGroup); + list.add(vo); + getOrganizeAdminIsTratorModel(list, t.getChildren(), managerGroup); + }); + } + } + + /** + * 删除二级管理员 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "删除二级管理员") + @Parameters({ + @Parameter(name = "id", description = "用户id", required = true) + }) + @SaCheckPermission(value = { "permission.grade" }) + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + organizeAdminIsTratorService.deleteByUserId(id); + return ActionResult.success(MsgCode.SU003.get()); + } + + /** + * 获取组织下拉框列表 + * + * @param userId 用户id + * @return + */ + @Operation(summary = "获取组织下拉框列表") + @SaCheckPermission(value = { "permission.grade" }) + @GetMapping("/Selector") + public ActionResult getSelector(String userId) { + if (StringUtil.isNotEmpty(userId)) { + if (userId.equals(UserProvider.getLoginUserId())) { + return ActionResult.fail(MsgCode.PS015.get()); + } + UserEntity userEntity = userService.getInfo(userId); + if (userEntity != null && ADMIN_KEY.equals(userEntity.getAccount())) { + return ActionResult.fail(MsgCode.PS016.get()); + } + } + OrganizeAdministratorSelectedVO vo = selectedVO(userId, "-1"); + return ActionResult.success(vo); + } + + private void parentIdInList(List modulePermissionList, Set tempModule, + List allModuleSelectorVOList, ModuleSelectorModel moduleSelectorModel, + ModuleSelectorModel moduleSelectorModels) { + ModuleSelectorModel finalModuleSelectorModel = moduleSelectorModel; + moduleSelectorModel = modulePermissionList.stream() + .filter(t -> finalModuleSelectorModel.getParentId().equals(t.getId())).findFirst().orElse(null); + // !null return ==1 return + if (moduleSelectorModel != null && moduleSelectorModel.getType() == 1) { + tempModule.add(moduleSelectorModel); + moduleSelectorModels.setParentId(moduleSelectorModel.getId()); + return; + } + moduleSelectorModel = allModuleSelectorVOList.stream() + .filter(t -> finalModuleSelectorModel.getParentId().equals(t.getId())).findFirst().orElse(null); + if (moduleSelectorModel == null) { + return; + } + parentIdInList(modulePermissionList, tempModule, allModuleSelectorVOList, moduleSelectorModel, + moduleSelectorModels); + } + + /** + * 获取组织下拉框列表 + * + * @param userId 用户id + * @return + */ + @Operation(summary = "获取组织下拉框列表") + @SaCheckPermission(value = { "permission.grade" }) + @GetMapping("/organizeSelector") + public ActionResult organizeSelector(String userId) { + if (StringUtil.isNotEmpty(userId)) { + if (userId.equals(UserProvider.getLoginUserId())) { + return ActionResult.fail(MsgCode.PS015.get()); + } + UserEntity userEntity = userService.getInfo(userId); + if (userEntity != null && ADMIN_KEY.equals(userEntity.getAccount())) { + return ActionResult.fail(MsgCode.PS016.get()); + } + } + OrganizeAdministratorSelectedVO vo = selectedVO(userId, null); + return ActionResult.success(vo); + } + + /** + * 获取组织下拉框列表 + * + * @param userId 用户id + * @return + */ + @Operation(summary = "获取组织下拉框列表") + @SaCheckPermission(value = { "permission.grade" }) + @GetMapping("/SelectAsyncList/{id}") + public ActionResult> selectAsyncList(@PathVariable("id") String id, + String userId) { + List vo = new ArrayList<>(); + if (StringUtil.isEmpty(userId)) { + return ActionResult.success(vo); + } + if (StringUtil.isNotEmpty(userId)) { + if (userId.equals(UserProvider.getLoginUserId())) { + return ActionResult.fail(MsgCode.PS015.get()); + } + UserEntity userEntity = userService.getInfo(userId); + if (userEntity != null && ADMIN_KEY.equals(userEntity.getAccount())) { + return ActionResult.fail(MsgCode.PS016.get()); + } + } + vo.addAll(organizeAdministrator(userId, id)); + return ActionResult.success(vo); + } + + private List organizeAdministrator(String userId, String organizeId) { + // 存储组织集合 + Map orgMaps = organizeService.getOrgMaps(null, false, null); + // 获取所有组织 + List selectorModels = JsonUtil.getJsonToList(orgMaps.values(), + OrganizeAdministratorSelectorModel.class); + boolean isAdministrator = UserProvider.getUser().getIsAdministrator(); + if (isAdministrator) { + selectorModels.forEach(t -> { + // 设置组织id + t.setOrganizeId(t.getId()); + t.setThisLayerAdd(0); + t.setThisLayerEdit(0); + t.setThisLayerDelete(0); + t.setThisLayerSelect(0); + t.setSubLayerAdd(0); + t.setSubLayerEdit(0); + t.setSubLayerDelete(0); + t.setSubLayerSelect(0); + }); + } else { + List organizeAdministratorEntity = organizeAdminIsTratorService + .getOrganizeAdministratorEntity(UserProvider.getLoginUserId(), PermissionConst.ORGANIZE, false); + // 当前用户分级管理权限 + Map thisOrganizeMap = organizeAdministratorEntity.stream() + .collect(Collectors.toMap(OrganizeAdministratorEntity::getOrganizeId, Function.identity())); + List organizeAdministratorEntitys = new ArrayList<>( + organizeAdministratorEntity); + // 处理子组织权限 + organizeAdministratorEntitys.forEach(t -> { + if (t.getSubLayerSelect() != null && t.getSubLayerSelect() == 1) { + // 得到组织id + List underOrganizations = orgMaps.values().stream() + .filter(tt -> tt.getOrganizeIdTree().contains(t.getOrganizeId())).map(OrganizeEntity::getId) + .collect(Collectors.toList()); + // organizeService.getUnderOrganizations(t.getOrganizeId(), false); + underOrganizations.forEach(uo -> { + OrganizeAdministratorEntity organizeAdministratorEntity1 = thisOrganizeMap.get(uo); + if (organizeAdministratorEntity1 != null) { + organizeAdministratorEntity1.setThisLayerSelect(1); + organizeAdministratorEntity1.setSubLayerSelect(1); + if (t.getSubLayerAdd() != null && t.getSubLayerAdd() == 1) { + organizeAdministratorEntity1.setThisLayerAdd(1); + organizeAdministratorEntity1.setSubLayerAdd(1); + } + if (t.getSubLayerEdit() != null && t.getSubLayerEdit() == 1) { + organizeAdministratorEntity1.setThisLayerEdit(1); + organizeAdministratorEntity1.setSubLayerEdit(1); + } + if (t.getSubLayerDelete() != null && t.getSubLayerDelete() == 1) { + organizeAdministratorEntity1.setThisLayerDelete(1); + organizeAdministratorEntity1.setSubLayerDelete(1); + } + } + }); + } + }); + + List selectorModelss = new ArrayList<>(16); + selectorModels.forEach(t -> { + // 设置组织id + t.setOrganizeId(t.getId()); + OrganizeAdministratorEntity administratorEntity = thisOrganizeMap.get(t.getOrganizeId()); + if (administratorEntity != null) { + boolean flag = false; + if (administratorEntity.getThisLayerSelect() != null + && administratorEntity.getThisLayerSelect() == 1) { + t.setThisLayerSelect(0); + flag = true; + if (administratorEntity.getThisLayerAdd() == 1) { + t.setThisLayerAdd(0); + } + if (administratorEntity.getThisLayerEdit() == 1) { + t.setThisLayerEdit(0); + } + if (administratorEntity.getThisLayerDelete() == 1) { + t.setThisLayerDelete(0); + } + } + if (administratorEntity.getSubLayerSelect() != null + && administratorEntity.getSubLayerSelect() == 1) { + t.setSubLayerSelect(0); + flag = true; + if (administratorEntity.getSubLayerAdd() != null && administratorEntity.getSubLayerAdd() == 1) { + t.setSubLayerAdd(0); + } + if (administratorEntity.getSubLayerEdit() != null + && administratorEntity.getSubLayerEdit() == 1) { + t.setSubLayerEdit(0); + } + if (administratorEntity.getSubLayerDelete() != null + && administratorEntity.getSubLayerDelete() == 1) { + t.setSubLayerDelete(0); + } + } + if (flag) { + selectorModelss.add(t); + } + } + }); + selectorModels = selectorModelss; + } + + Map modelMap = selectorModels.stream() + .collect(Collectors.toMap(OrganizeAdministratorSelectorModel::getOrganizeId, Function.identity())); + // 判断是否为空 + if (StringUtil.isNotEmpty(userId)) { + List organizeAdministratorEntity = organizeAdminIsTratorService + .getOrganizeAdministratorEntity(userId, PermissionConst.ORGANIZE, false); + // 处理子组织字段 + Map hisOrganizeMap = organizeAdministratorEntity.stream() + .collect(Collectors.toMap(OrganizeAdministratorEntity::getOrganizeId, Function.identity())); + List finalSelectorModels3 = selectorModels; + hisOrganizeMap.values().forEach(t -> { + if (!isAdministrator) { + if (t.getSubLayerSelect() != null && t.getSubLayerSelect() == 1) { + // 得到组织id + List underOrganizations = orgMaps.values().stream() + .filter(tt -> tt.getOrganizeIdTree().contains(t.getOrganizeId())) + .map(OrganizeEntity::getId).collect(Collectors.toList()); + // organizeService.getUnderOrganizations(t.getOrganizeId(), false); + // 将同样的组织id的数据先处理好 + List collect1 = modelMap.values().stream() + .filter(fsm -> underOrganizations.contains(fsm.getOrganizeId())) + .collect(Collectors.toList()); + collect1.forEach(cl -> { + OrganizeAdministratorSelectorModel organizeAdministratorSelectorModel = modelMap + .get(cl.getOrganizeId()); + if (organizeAdministratorSelectorModel != null) { + if (organizeAdministratorSelectorModel.getThisLayerSelect() != null + && organizeAdministratorSelectorModel.getThisLayerSelect() == 0) { + organizeAdministratorSelectorModel.setThisLayerSelect(0); + } else { + organizeAdministratorSelectorModel.setThisLayerSelect(3); + } + if (organizeAdministratorSelectorModel.getSubLayerSelect() != null + && organizeAdministratorSelectorModel.getSubLayerSelect() == 0) { + organizeAdministratorSelectorModel.setSubLayerSelect(0); + } else { + organizeAdministratorSelectorModel.setSubLayerSelect(3); + } + } + }); + // 当前模型包含组织id + List collect = underOrganizations.stream() + .filter(uo -> !modelMap.values().stream() + .map(OrganizeAdministratorSelectorModel::getOrganizeId) + .collect(Collectors.toList()).contains(uo)) + .collect(Collectors.toList()); + collect.forEach(cl -> { + OrganizeAdministratorEntity organizeAdministratorEntity1 = hisOrganizeMap.get(cl); + if (organizeAdministratorEntity1 != null) { + OrganizeEntity info = orgMaps.get(organizeAdministratorEntity1.getOrganizeId()); + OrganizeAdministratorSelectorModel organizeAdministratorSelectorModel = JsonUtil + .getJsonToBean(info, OrganizeAdministratorSelectorModel.class); + organizeAdministratorSelectorModel + .setOrganizeId(organizeAdministratorEntity1.getOrganizeId()); + organizeAdministratorSelectorModel.setThisLayerSelect(3); + organizeAdministratorSelectorModel.setSubLayerSelect(3); + finalSelectorModels3.add(organizeAdministratorSelectorModel); + } + }); + } + } + }); + Map selectorModelMap = selectorModels.stream() + .collect(Collectors.toMap(OrganizeAdministratorSelectorModel::getOrganizeId, Function.identity())); + List finalSelectorModels1 = new ArrayList<>(selectorModels); + hisOrganizeMap.values().forEach(t -> { + // 我没有他有时,需要判断此组织是否跟我所管理的组织相同,不同则需要放进去 + OrganizeAdministratorSelectorModel organizeAdministratorSelectorModel = selectorModelMap + .get(t.getOrganizeId()); + if (organizeAdministratorSelectorModel == null) { + boolean flag = false; + if (t.getThisLayerSelect() != null) { + if (t.getThisLayerSelect() == 1) { + t.setThisLayerSelect(2); + flag = true; + if (flag && t.getThisLayerAdd() != null && t.getThisLayerAdd() == 1) { + t.setThisLayerAdd(2); + } else if (t.getThisLayerAdd() != null) { + t.setThisLayerAdd(null); + } + if (flag && t.getThisLayerEdit() != null && t.getThisLayerEdit() == 1) { + t.setThisLayerEdit(2); + } else if (t.getThisLayerEdit() != null) { + t.setThisLayerEdit(null); + } + if (flag && t.getThisLayerDelete() != null && t.getThisLayerDelete() == 1) { + t.setThisLayerDelete(2); + } else if (t.getThisLayerDelete() != null) { + t.setThisLayerDelete(null); + } + } else { + t.setThisLayerSelect(null); + t.setThisLayerAdd(null); + t.setThisLayerEdit(null); + t.setThisLayerDelete(null); + } + } + boolean flag1 = false; + if (t.getSubLayerSelect() != null) { + if (t.getSubLayerSelect() == 1) { + t.setSubLayerSelect(2); + flag1 = true; + if (flag1 && t.getSubLayerAdd() != null && t.getSubLayerAdd() == 1) { + t.setSubLayerAdd(2); + } else if (t.getSubLayerAdd() != null) { + t.setSubLayerAdd(null); + } + if (flag1 && t.getSubLayerEdit() != null && t.getSubLayerEdit() == 1) { + t.setSubLayerEdit(2); + } else if (t.getSubLayerEdit() != null) { + t.setSubLayerEdit(null); + } + if (flag1 && t.getSubLayerDelete() != null && t.getSubLayerDelete() == 1) { + t.setSubLayerDelete(2); + } else if (t.getSubLayerDelete() != null) { + t.setSubLayerDelete(null); + } + } else { + t.setSubLayerSelect(null); + t.setSubLayerAdd(null); + t.setSubLayerEdit(null); + t.setSubLayerDelete(null); + } + } + if (flag || flag1) { + OrganizeAdministratorSelectorModel jsonToBean = JsonUtil.getJsonToBean(t, + OrganizeAdministratorSelectorModel.class); + OrganizeEntity info = orgMaps.get(t.getOrganizeId()); + if (info != null) { + jsonToBean.setParentId(info.getParentId()); + jsonToBean.setId(info.getId()); + jsonToBean.setCategory(info.getCategory()); + jsonToBean.setIcon(PermissionConst.COMPANY.equals(info.getCategory()) + ? "icon-ym icon-ym-tree-organization3" + : "icon-ym icon-ym-tree-department1"); + jsonToBean.setOrganizeId(t.getOrganizeId()); + jsonToBean.setOrganizeIdTree(info.getOrganizeIdTree()); + jsonToBean.setFullName(info.getFullName()); + finalSelectorModels1.add(jsonToBean); + } + } + } + }); + hisOrganizeMap.values().forEach(t -> { + finalSelectorModels1.forEach(fs -> { + if (t.getOrganizeId().equals(fs.getOrganizeId())) { + // 本层添加 + if (fs.getThisLayerAdd() != null) { + if (fs.getThisLayerAdd() == 0) { + if (t.getThisLayerAdd() != null) { + if (t.getThisLayerAdd() == 1) { + fs.setThisLayerAdd(1); + } else { + fs.setThisLayerAdd(0); + } + } + } else if (fs.getThisLayerAdd() == 3) { + if (t.getThisLayerAdd() != null) { + if (t.getThisLayerAdd() == 1) { + fs.setThisLayerAdd(1); + } else { + fs.setThisLayerAdd(3); + } + } + } else { + if (t.getThisLayerAdd() != null) { + if (t.getThisLayerAdd() == 1) { + if (isAdministrator) { + fs.setThisLayerAdd(1); + } else { + fs.setThisLayerAdd(2); + } + } + } + } + } else { + if (t.getThisLayerAdd() != null) { + if (t.getThisLayerAdd() == 1) { + if (isAdministrator) { + fs.setThisLayerAdd(1); + } else { + fs.setThisLayerAdd(2); + } + } + } + } + // 本层编辑 + if (fs.getThisLayerEdit() != null) { + if (fs.getThisLayerEdit() == 0) { + if (t.getThisLayerEdit() != null) { + if (t.getThisLayerEdit() == 1) { + fs.setThisLayerEdit(1); + } else { + fs.setThisLayerEdit(0); + } + } + } else if (fs.getThisLayerEdit() == 3) { + if (t.getThisLayerEdit() != null) { + if (t.getThisLayerEdit() == 1) { + fs.setThisLayerEdit(1); + } else { + fs.setThisLayerEdit(3); + } + } + } else { + if (t.getThisLayerEdit() != null) { + if (t.getThisLayerEdit() == 1) { + if (isAdministrator) { + fs.setThisLayerEdit(1); + } else { + fs.setThisLayerEdit(2); + } + } + } + } + } else { + if (t.getThisLayerEdit() != null) { + if (t.getThisLayerEdit() == 1) { + if (isAdministrator) { + fs.setThisLayerEdit(1); + } else { + fs.setThisLayerEdit(2); + } + } + } + } + // 本层删除 + if (fs.getThisLayerDelete() != null) { + if (fs.getThisLayerDelete() == 0) { + if (t.getThisLayerDelete() != null) { + if (t.getThisLayerDelete() == 1) { + fs.setThisLayerDelete(1); + } else { + fs.setThisLayerDelete(0); + } + } + } else if (fs.getThisLayerDelete() == 3) { + if (t.getThisLayerDelete() != null) { + if (t.getThisLayerDelete() == 1) { + fs.setThisLayerDelete(1); + } else { + fs.setThisLayerDelete(3); + } + } + } else { + if (t.getThisLayerDelete() != null) { + if (t.getThisLayerDelete() == 1) { + if (isAdministrator) { + fs.setThisLayerDelete(1); + } else { + fs.setThisLayerDelete(2); + } + } + } + } + } else { + if (t.getThisLayerDelete() != null) { + if (t.getThisLayerDelete() == 1) { + if (isAdministrator) { + fs.setThisLayerDelete(1); + } else { + fs.setThisLayerDelete(2); + } + } + } + } + // 本层查看 + if (fs.getThisLayerSelect() != null) { + if (fs.getThisLayerSelect() == 0) { + if (t.getThisLayerSelect() != null) { + if (t.getThisLayerSelect() == 1) { + fs.setThisLayerSelect(1); + } else { + fs.setThisLayerSelect(0); + } + } + } else if (fs.getThisLayerSelect() == 3) { + if (t.getThisLayerSelect() != null) { + if (t.getThisLayerSelect() == 1) { + fs.setThisLayerSelect(1); + } else { + fs.setThisLayerSelect(3); + } + } + } else { + if (t.getThisLayerSelect() != null) { + if (t.getThisLayerSelect() == 1) { + if (isAdministrator) { + fs.setThisLayerSelect(1); + } else { + fs.setThisLayerSelect(2); + } + } + } + } + } else { + if (t.getThisLayerSelect() != null) { + if (t.getThisLayerSelect() == 1) { + if (isAdministrator) { + fs.setThisLayerSelect(1); + } else { + fs.setThisLayerSelect(2); + } + } + } + } + // 子层添加 + if (fs.getSubLayerAdd() != null) { + if (fs.getSubLayerAdd() == 0) { + if (t.getSubLayerAdd() != null) { + if (t.getSubLayerAdd() == 1) { + fs.setSubLayerAdd(1); + } else { + fs.setSubLayerAdd(0); + } + } + } else if (fs.getSubLayerAdd() == 3) { + if (t.getSubLayerAdd() != null) { + if (t.getSubLayerAdd() == 1) { + fs.setSubLayerAdd(1); + } else { + fs.setSubLayerAdd(3); + } + } + } else { + if (t.getSubLayerAdd() != null) { + if (t.getSubLayerAdd() == 1) { + if (isAdministrator) { + fs.setSubLayerAdd(1); + } else { + fs.setSubLayerAdd(2); + } + } + } + } + } else { + if (t.getSubLayerAdd() != null) { + if (t.getSubLayerAdd() == 1) { + if (isAdministrator) { + fs.setSubLayerAdd(1); + } else { + fs.setSubLayerAdd(2); + } + } + } + } + + if (fs.getSubLayerEdit() != null) { + if (fs.getSubLayerEdit() == 0) { + if (t.getSubLayerEdit() != null) { + if (t.getSubLayerEdit() == 1) { + fs.setSubLayerEdit(1); + } else { + fs.setSubLayerEdit(0); + } + } + } else if (fs.getSubLayerEdit() == 3) { + if (t.getSubLayerEdit() != null) { + if (t.getSubLayerEdit() == 1) { + fs.setSubLayerEdit(1); + } else { + fs.setSubLayerEdit(3); + } + } + } else { + if (t.getSubLayerEdit() != null) { + if (t.getSubLayerEdit() == 1) { + if (isAdministrator) { + fs.setSubLayerEdit(1); + } else { + fs.setSubLayerEdit(2); + } + } + } + } + } else { + if (t.getSubLayerEdit() != null) { + if (t.getSubLayerEdit() == 1) { + if (isAdministrator) { + fs.setSubLayerEdit(1); + } else { + fs.setSubLayerEdit(2); + } + } + } + } + + if (fs.getSubLayerDelete() != null) { + if (fs.getSubLayerDelete() == 0) { + if (t.getSubLayerDelete() != null) { + if (t.getSubLayerDelete() == 1) { + fs.setSubLayerDelete(1); + } else { + fs.setSubLayerDelete(0); + } + } + } else if (fs.getSubLayerDelete() == 3) { + if (t.getSubLayerDelete() != null) { + if (t.getSubLayerDelete() == 1) { + fs.setSubLayerDelete(1); + } else { + fs.setSubLayerDelete(3); + } + } + } else { + if (t.getSubLayerDelete() != null) { + if (t.getSubLayerDelete() == 1) { + if (isAdministrator) { + fs.setSubLayerDelete(1); + } else { + fs.setSubLayerDelete(2); + } + } + } + } + } else { + if (t.getSubLayerDelete() != null) { + if (t.getSubLayerDelete() == 1) { + if (isAdministrator) { + fs.setSubLayerDelete(1); + } else { + fs.setSubLayerDelete(2); + } + } + } + } + + if (fs.getSubLayerSelect() != null) { + if (fs.getSubLayerSelect() == 0) { + if (t.getSubLayerSelect() != null) { + if (t.getSubLayerSelect() == 1) { + fs.setSubLayerSelect(1); + } else { + fs.setSubLayerSelect(0); + } + } + } else if (fs.getSubLayerSelect() == 3) { + if (t.getSubLayerSelect() != null) { + if (t.getSubLayerSelect() == 1) { + fs.setSubLayerSelect(1); + } else { + fs.setSubLayerSelect(3); + } + } + } else { + if (t.getSubLayerSelect() != null) { + if (t.getSubLayerSelect() == 1) { + if (isAdministrator) { + fs.setSubLayerSelect(1); + } else { + fs.setSubLayerSelect(2); + } + } + } + } + } else { + if (t.getSubLayerSelect() != null) { + if (t.getSubLayerSelect() == 1) { + if (isAdministrator) { + fs.setSubLayerSelect(1); + } else { + fs.setSubLayerSelect(2); + } + } + } + } + + } + }); + }); + selectorModels = finalSelectorModels1; + } + + // 判断断层有没有上下级关系 + Map selectorModelMap = selectorModels.stream() + .collect(Collectors.toMap(OrganizeAdministratorSelectorModel::getId, Function.identity())); + + Map orgIdNameMaps = organizeService.getInfoList(); + selectorModels.forEach(t -> { + if (StringUtil.isNotEmpty(t.getOrganizeIdTree())) { + List list1 = new ArrayList<>(); + String[] split = t.getOrganizeIdTree().split(","); + list1 = Arrays.asList(split); + Collections.reverse(list1); + for (String orgId : list1) { + OrganizeAdministratorSelectorModel organizeEntity1 = selectorModelMap.get(orgId); + if (organizeEntity1 != null && !organizeEntity1.getId().equals(t.getId())) { + t.setParentId(organizeEntity1.getId()); + String[] split1 = t.getOrganizeIdTree().split(organizeEntity1.getId()); + if (split1.length > 1) { + t.setFullName(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, split1[1], "/")); + } + break; + } + } + } + }); + selectorModels.forEach(t -> t.setIcon("company".equals(t.getCategory()) ? "icon-ym icon-ym-tree-organization3" + : "icon-ym icon-ym-tree-department1")); + List listVO = new ArrayList<>(); + if (!"-1".equals(organizeId)) { + if ("0".equals(organizeId)) { + List> trees = TreeDotUtils + .convertListToTreeDot(selectorModels); + List organizeList = JsonUtil.getJsonToList(trees, + OrganizeAdministratorSelectorVO.class); + for (OrganizeAdministratorSelectorVO selectorVO : organizeList) { + OrganizeAdministratorSelectorVO vo = JsonUtil.getJsonToBean(selectorVO, + OrganizeAdministratorSelectorVO.class); + vo.setHasChildren(true); + vo.setIsLeaf(false); + vo.setChildren(new ArrayList<>()); + listVO.add(vo); + } + } else { + List organizeList = selectorModels.stream() + .filter(t -> t.getParentId().equals(organizeId)).collect(Collectors.toList()); + for (OrganizeAdministratorSelectorModel selectorVO : organizeList) { + OrganizeAdministratorSelectorVO vo = JsonUtil.getJsonToBean(selectorVO, + OrganizeAdministratorSelectorVO.class); + vo.setHasChildren(true); + vo.setIsLeaf(false); + vo.setChildren(new ArrayList<>()); + listVO.add(vo); + } + } + } else { + listVO.addAll(JsonUtil.getJsonToList(selectorModels, OrganizeAdministratorSelectorVO.class)); + } + return listVO; + } + + private List organizeList(OrganizeAdminIsTratorCrForm form) { + List listVO = new ArrayList<>(); + List list = new ArrayList<>(); + organizeList(list, form.getOrgAdminModel()); + listVO.addAll(list); + List organizeId = list.stream().map(OrganizeAdministratorCrModel::getOrganizeId) + .collect(Collectors.toList()); + List selectorList = JsonUtil + .getJsonToList(organizeAdministrator(form.getUserId(), "-1"), OrganizeAdministratorCrModel.class); + listVO.addAll(selectorList.stream().filter(t -> !organizeId.contains(t.getOrganizeId())) + .collect(Collectors.toList())); + return listVO; + } + + private void organizeList(List list, List jsonList) { + if (jsonList != null) { + for (OrganizeAdministratorCrModel model : jsonList) { + OrganizeAdministratorCrModel vo = JsonUtil.getJsonToBean(model, OrganizeAdministratorCrModel.class); + vo.setChildren(null); + list.add(vo); + organizeList(list, model.getChildren()); + } + } + } + + private OrganizeAdministratorSelectedVO selectedVO(String userId, String id) { + OrganizeAdministratorSelectedVO vo = new OrganizeAdministratorSelectedVO(); + if (StringUtil.isEmpty(userId)) { + return vo; + } + // 租户权限 + List moduleAuthorize = new ArrayList<>(); + List moduleUrlAddressAuthorize = new ArrayList<>(); + if (configValueUtil.isMultiTenancy()) { + TenantAuthorizeModel tenantAuthorizeModel = TenantDataSourceUtil + .getCacheModuleAuthorize(UserProvider.getUser().getTenantId()); + moduleAuthorize = tenantAuthorizeModel.getModuleIdList(); + moduleUrlAddressAuthorize = tenantAuthorizeModel.getUrlAddressList(); + } + List systemPermissionList = new ArrayList<>(); + List moduleVOPermissionList = new ArrayList<>(); + List modulePermissionList = new ArrayList<>(); + List moduleSelectedList = new ArrayList<>(); + List systemSelectedList = new ArrayList<>(); + // 获取应用列表 + List list = systemApi.getList(null, false, true, true, false, new ArrayList<>()); + List systemSelectorVOList = JsonUtil.getJsonToList(list, SystemSelectorVO.class); + systemSelectorVOList.forEach(t -> t.setIsPermission(0)); + // 菜单 + SystemEntity mainSystem = systemApi.getInfoByEnCode(YunzhupaasConst.MAIN_SYSTEM_CODE); + List mainModule = moduleApi.getMainModule(moduleAuthorize, moduleUrlAddressAuthorize, false); + List allModule = new ArrayList<>(mainModule); + List moduleSelectorVOList = JsonUtil.getJsonToList(mainModule, ModuleSelectorModel.class); + List allModuleSelectorVOList = JsonUtil.getJsonToList(allModule, + ModuleSelectorModel.class); + + boolean isAdministrator = UserProvider.getUser().getIsAdministrator(); + if (isAdministrator) { + moduleSelectorVOList.forEach(t -> t.setIsPermission(0)); + } else { + List moduleOrganizeAdministratorEntity = organizeAdminIsTratorService + .getOrganizeAdministratorEntity(UserProvider.getLoginUserId(), PermissionConst.MODULE, false); + List moduleIds = moduleOrganizeAdministratorEntity.stream() + .map(OrganizeAdministratorEntity::getOrganizeId).collect(Collectors.toList()); + List moduleByIds = moduleApi.getModuleByIds(moduleIds, null, null, false); + moduleSelectorVOList = JsonUtil.getJsonToList(moduleByIds, ModuleSelectorModel.class); + + // List systemOrganizeAdministratorEntity = + // organizeAdminIsTratorService.getOrganizeAdministratorEntity(UserProvider.getLoginUserId(), + // true, PermissionConst.SYSTEM); + } + // 判断是否为空 + if (StringUtil.isNotEmpty(userId)) { + // 系统 + List systemOrganizeAdministratorEntity = organizeAdminIsTratorService + .getOrganizeAdministratorEntity(userId, PermissionConst.SYSTEM); + List systemPermissionIds = systemOrganizeAdministratorEntity.stream() + .map(OrganizeAdministratorEntity::getOrganizeId).collect(Collectors.toList()); + List collect = systemSelectorVOList.stream().map(SystemSelectorVO::getId) + .collect(Collectors.toList()); + List systemList = new ArrayList<>(); + systemList.addAll(systemPermissionIds); + systemList.addAll(collect); + // 交集 1 + List collect1 = systemPermissionIds.stream().filter(collect::contains).collect(Collectors.toList()); + systemList = systemList.stream().distinct().collect(Collectors.toList()); + // 去掉交集后 + systemList.removeAll(collect1); + // 我有他没有 0 + List collect2 = collect.stream().filter(systemList::contains).collect(Collectors.toList()); + // 他有我没有 2 + List collect3 = systemPermissionIds.stream().filter(systemList::contains) + .collect(Collectors.toList()); + List listByIds1 = systemApi.getListByIds(collect1, null); + List systemSelectorVOList1 = JsonUtil.getJsonToList(listByIds1, SystemSelectorVO.class); + systemSelectorVOList1.forEach(t -> t.setIsPermission(1)); + List listByIds2 = systemApi.getListByIds(collect2, null); + List systemSelectorVOList2 = JsonUtil.getJsonToList(listByIds2, SystemSelectorVO.class); + systemSelectorVOList2.forEach(t -> t.setIsPermission(0)); + List listByIds3 = systemApi.getListByIds(collect3, null); + List systemSelectorVOList3 = JsonUtil.getJsonToList(listByIds3, SystemSelectorVO.class); + systemSelectorVOList3.forEach(t -> { + t.setIsPermission(2); + t.setDisabled(true); + }); + systemSelectedList + .addAll(systemSelectorVOList1.stream().map(SystemSelectorVO::getId).collect(Collectors.toList())); + systemSelectedList + .addAll(systemSelectorVOList3.stream().map(SystemSelectorVO::getId).collect(Collectors.toList())); + + systemPermissionList.addAll(systemSelectorVOList1); + systemPermissionList.addAll(systemSelectorVOList2); + systemPermissionList.addAll(systemSelectorVOList3); + systemPermissionList = systemPermissionList.stream() + .sorted(Comparator.comparing(SystemSelectorVO::getSortCode) + .thenComparing(Comparator.comparing(SystemSelectorVO::getCreatorTime).reversed())) + .collect(Collectors.toList()); + + // 菜单 + List moduleOrganizeAdministratorEntity = organizeAdminIsTratorService + .getOrganizeAdministratorEntity(userId, PermissionConst.MODULE); + List modulePermissionIds = moduleOrganizeAdministratorEntity.stream() + .map(OrganizeAdministratorEntity::getOrganizeId).collect(Collectors.toList()); + List moduleCollect = moduleSelectorVOList.stream().map(ModuleSelectorModel::getId) + .collect(Collectors.toList()); + List moduleList = new ArrayList<>(); + moduleList.addAll(modulePermissionIds); + moduleList.addAll(moduleCollect); + // 交集 1 + List moduleCollect1 = modulePermissionIds.stream().filter(moduleCollect::contains) + .collect(Collectors.toList()); + moduleList = moduleList.stream().distinct().collect(Collectors.toList()); + // 去掉交集后 + moduleList.removeAll(moduleCollect1); + // 我有他没有 0 + List moduleCollect2 = moduleCollect.stream().filter(moduleList::contains) + .collect(Collectors.toList()); + // 他有我没有 2 + List moduleCollect3 = modulePermissionIds.stream().filter(moduleList::contains) + .collect(Collectors.toList()); + List moduleListByIds1 = moduleApi.getModuleByIds(moduleCollect1, moduleAuthorize, + moduleUrlAddressAuthorize, false); + List moduleSelectorVOList1 = JsonUtil.getJsonToList(moduleListByIds1, + ModuleSelectorModel.class); + moduleSelectorVOList1.forEach(t -> t.setIsPermission(1)); + List moduleListByIds2 = moduleApi.getModuleByIds(moduleCollect2, moduleAuthorize, + moduleUrlAddressAuthorize, false); + List moduleSelectorVOList2 = JsonUtil.getJsonToList(moduleListByIds2, + ModuleSelectorModel.class); + moduleSelectorVOList2.forEach(t -> t.setIsPermission(0)); + List moduleListByIds3 = moduleApi.getModuleByIds(moduleCollect3, moduleAuthorize, + moduleUrlAddressAuthorize, false); + List moduleSelectorVOList3 = JsonUtil.getJsonToList(moduleListByIds3, + ModuleSelectorModel.class); + moduleSelectorVOList3.forEach(t -> { + t.setIsPermission(2); + t.setDisabled(true); + }); + modulePermissionList.addAll(moduleSelectorVOList1); + modulePermissionList.addAll(moduleSelectorVOList2); + modulePermissionList.addAll(moduleSelectorVOList3); + Set tempModule = new HashSet<>(modulePermissionList); + // 处理上级 + List finalModulePermissionList = modulePermissionList; + modulePermissionList.forEach(t -> { + // 判断上级是否存在,不存在的话取出放入总权限列表 + parentIdInList(finalModulePermissionList, tempModule, allModuleSelectorVOList, t, t); + }); + modulePermissionList = new ArrayList<>(tempModule); + modulePermissionList.forEach(t -> { + if ("-1".equals(t.getParentId())) { + t.setParentId(t.getSystemId()); + } + }); + // 加入主系统 + ModuleSelectorModel jsonToBean = JsonUtil.getJsonToBean(mainSystem, ModuleSelectorModel.class); + if (moduleSelectorVOList1.stream().anyMatch(t -> t.getId().equals(jsonToBean.getId()))) { + jsonToBean.setIsPermission(1); + } else if (moduleSelectorVOList2.stream().anyMatch(t -> t.getId().equals(jsonToBean.getId()))) { + jsonToBean.setIsPermission(0); + } else if (moduleSelectorVOList3.stream().anyMatch(t -> t.getId().equals(jsonToBean.getId()))) { + jsonToBean.setIsPermission(2); + jsonToBean.setDisabled(true); + } + moduleSelectedList.addAll( + moduleSelectorVOList1.stream().map(ModuleSelectorModel::getId).collect(Collectors.toList())); + moduleSelectedList.addAll( + moduleSelectorVOList3.stream().map(ModuleSelectorModel::getId).collect(Collectors.toList())); + + jsonToBean.setType(0); + jsonToBean.setParentId("-1"); + modulePermissionList.add(jsonToBean); + modulePermissionList = modulePermissionList.stream() + .sorted(Comparator.comparing(ModuleSelectorModel::getSortCode) + .thenComparing(Comparator.comparing(ModuleSelectorModel::getCreatorTime).reversed())) + .collect(Collectors.toList()); + List> menuList = TreeDotUtils.convertListToTreeDotFilter(modulePermissionList); + moduleVOPermissionList = JsonUtil.getJsonToList(menuList, ModuleSelectorVO.class); + } + vo.setSystemPermissionList(systemPermissionList); + vo.setModulePermissionList(moduleVOPermissionList); + vo.setSystemIds(systemSelectedList); + vo.setModuleIds(moduleSelectedList); + vo.setManagerGroup(organizeAdminIsTratorService.getManagerGroupByUserId(userId)); + if (StringUtil.isNotEmpty(id)) { + List selectorModels = JsonUtil + .getJsonToList(organizeAdministrator(userId, "-1"), OrganizeAdministratorSelectorModel.class); + List> trees = TreeDotUtils.convertListToTreeDot(selectorModels, + "-1"); + List listVO = JsonUtil.getJsonToList(trees, + OrganizeAdministratorSelectorVO.class); + Map orgIdNameMaps = organizeService.getInfoList(); + listVO.forEach(t -> { + t.setFullName(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, t.getOrganizeIdTree(), "/")); + }); + vo.setOrgAdminList(listVO); + } + return vo; + } + +} diff --git a/yunzhupaas-permission/yunzhupaas-permission-controller/src/main/java/com/yunzhupaas/permission/controller/OrganizeController.java b/yunzhupaas-permission/yunzhupaas-permission-controller/src/main/java/com/yunzhupaas/permission/controller/OrganizeController.java new file mode 100644 index 0000000..b06f1f4 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-controller/src/main/java/com/yunzhupaas/permission/controller/OrganizeController.java @@ -0,0 +1,1630 @@ +package com.yunzhupaas.permission.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaMode; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.TypeReference; +import com.alibaba.fastjson.parser.Feature; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.annotation.OrganizePermission; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.service.DictionaryDataService; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.constant.PermissionConst; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.message.service.SynThirdDingTalkService; +import com.yunzhupaas.message.service.SynThirdQyService; +import com.yunzhupaas.model.ExcelColumnAttr; +import com.yunzhupaas.model.ExcelImportForm; +import com.yunzhupaas.model.ExcelImportVO; +import com.yunzhupaas.model.ExcelModel; +import com.yunzhupaas.permission.constant.OrgColumnMap; +import com.yunzhupaas.permission.entity.OrganizeAdministratorEntity; +import com.yunzhupaas.permission.entity.OrganizeEntity; +import com.yunzhupaas.permission.model.organize.*; +import com.yunzhupaas.permission.model.user.UserIdListVo; +import com.yunzhupaas.permission.model.user.mod.UserIdModel; +import com.yunzhupaas.permission.model.position.PaginationPosition; +import com.yunzhupaas.permission.service.OrganizeAdministratorService; +import com.yunzhupaas.permission.service.OrganizeRelationService; +import com.yunzhupaas.permission.service.OrganizeService; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.base.util.ExcelTool; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.enums.DictionaryDataEnum; +import com.yunzhupaas.util.treeutil.ListToTreeUtil; +import com.yunzhupaas.util.treeutil.SumTree; +import com.yunzhupaas.util.treeutil.newtreeutil.TreeDotUtils; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; +import java.io.IOException; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 组织机构 + * 组织架构:公司》部门》岗位》用户 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +@Tag(name = "组织管理", description = "Organize") +@RestController +@RequestMapping("/api/permission/Organize") +@Slf4j +public class OrganizeController extends SuperController { + + @Autowired + private OrganizeService organizeService; + @Autowired + private UserService userService; + @Autowired + private SynThirdQyService synThirdQyService; + @Autowired + private SynThirdDingTalkService synThirdDingTalkService; + @Autowired + private OrganizeAdministratorService organizeAdministratorService; + @Autowired + private OrganizeRelationService organizeRelationService; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private DictionaryDataService dictionaryDataApi; + + //---------------------------组织管理-------------------------------------------- + + /** + * 获取组织列表 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "获取组织列表") + @SaCheckPermission(value = {"permission.organize", "permission.position", "permission.user", "permission.role"}, mode = SaMode.OR) + @GetMapping + public ActionResult> getList(PaginationOrganize pagination) { + // 获取所有组织 + Map orgMaps; + if (!UserProvider.getUser().getIsAdministrator()) { + // 通过权限转树 + List listss = organizeAdministratorService.getOrganizeAdministratorEntity(UserProvider.getUser().getUserId()); + Set orgIds = new HashSet<>(16); + // 判断自己是哪些组织的管理员 + listss.stream().forEach(t -> { + if (t != null) { + if (t.getThisLayerSelect() != null && t.getThisLayerSelect() == 1) { + orgIds.add(t.getOrganizeId()); + } + if (t.getSubLayerSelect() != null && t.getSubLayerSelect() == 1) { + List underOrganizations = organizeService.getUnderOrganizations(t.getOrganizeId(), Objects.equals(pagination.getEnabledMark(), 1)); + orgIds.addAll(underOrganizations); + } + } + }); + List list1 = new ArrayList<>(orgIds); + // 得到所有有权限的组织 + orgMaps = organizeService.getOrganizeName(list1, pagination.getKeyword(), Objects.equals(pagination.getEnabledMark(), 1), pagination.getType()); + } else { + orgMaps = organizeService.getOrgMaps(pagination.getKeyword(), Objects.equals(pagination.getEnabledMark(), 1), pagination.getType()); + } + Map orgMapsModel = JSONObject.parseObject(JSONObject.toJSONString(orgMaps), new TypeReference>() { + }, new Feature[0]); + ; + + Map orgIdNameMaps = organizeService.getInfoList(); + orgMapsModel.values().forEach(t -> { + if (PermissionConst.COMPANY.equals(t.getType())) { + t.setIcon("icon-ym icon-ym-tree-organization3"); + } else { + t.setIcon("icon-ym icon-ym-tree-department1"); + } + // 处理断层 + if (StringUtil.isNotEmpty(t.getOrganizeIdTree())) { + String[] split = t.getOrganizeIdTree().split(","); + List list1 = Arrays.asList(split); + Collections.reverse(list1); + for (String orgId : list1) { + if (!orgId.equals(t.getId())) { + OrganizeModel organizeEntity1 = orgMapsModel.get(orgId); + if (organizeEntity1 != null) { + t.setParentId(organizeEntity1.getId()); + String[] split1 = t.getOrganizeIdTree().split(organizeEntity1.getId()); + if (split1.length > 1) { + t.setFullName(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, split1[1], "/")); + } + break; + } + } + } + } + }); + List> trees = TreeDotUtils.convertMapsToTreeDot(orgMapsModel); + List listVO = JsonUtil.getJsonToList(trees, OrganizeListVO.class); + listVO.forEach(t -> { + t.setFullName(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, t.getOrganizeIdTree(), "/")); + }); + ListVO vo = new ListVO<>(); + vo.setList(listVO); + return ActionResult.success(vo); + } + + /** + * 获取组织下拉框列表 + * + * @param pagination 分页模型 + * @param id 主键 + * @return + */ + @Operation(summary = "获取组织下拉框列表") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @GetMapping("/Selector/{id}") + public ActionResult> getSelector(Pagination pagination, @PathVariable("id") String id) { + List allList = new LinkedList<>(organizeService.getOrgMaps(pagination.getKeyword(), true, null).values()); + if (!"0".equals(id)) { + allList.remove(organizeService.getInfo(id)); + } + List dataAll = allList; + List list = JsonUtil.getJsonToList(ListToTreeUtil.treeWhere(allList, dataAll), OrganizeEntity.class); + list = list.stream().filter(t -> "company".equals(t.getCategory())).collect(Collectors.toList()); + List models = JsonUtil.getJsonToList(list, OrganizeModel.class); + for (OrganizeModel model : models) { + model.setIcon("icon-ym icon-ym-tree-organization3"); + } + Map orgIdNameMaps = organizeService.getInfoList(); + models.forEach(t -> { + t.setOrganize(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, t.getOrganizeIdTree(), "/")); + if (StringUtil.isNotEmpty(t.getOrganizeIdTree())) { + String[] split = t.getOrganizeIdTree().split(","); + if (split.length > 0) { + t.setOrganizeIds(Arrays.asList(split)); + } else { + t.setOrganizeIds(new ArrayList<>()); + } + } + }); + + List modelAll = new ArrayList<>(); + modelAll.addAll(models); + List> trees = TreeDotUtils.convertListToTreeDotFilter(modelAll); + List listVO = JsonUtil.getJsonToList(trees, OrganizeSelectorVO.class); + ListVO vo = new ListVO(); + vo.setList(listVO); + return ActionResult.success(vo); + } + + /** + * 获取组织下拉框列表 + * + * @param pagination 分页模型 + * @param id 主键 + * @return + */ + @Operation(summary = "获取组织下拉框列表") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @GetMapping("/SelectorByAuth/{id}") + public ActionResult> getSelectorByAuth(Pagination pagination, @PathVariable("id") String id) { + List allList = new LinkedList<>(organizeService.getOrgMaps(pagination.getKeyword(), true, null).values()); + allList = allList.stream().filter(t -> "company".equals(t.getCategory())).collect(Collectors.toList()); + OrganizeEntity entity = organizeService.getInfo(id); + List dataAll = allList; + + List list = JsonUtil.getJsonToList(ListToTreeUtil.treeWhere(allList, dataAll), OrganizeEntity.class); + + List models = JsonUtil.getJsonToList(list, OrganizeByAuthModel.class); + + Map orgIdNameMaps = organizeService.getInfoList(); + if (!UserProvider.getUser().getIsAdministrator()) { + // 通过权限转树 + List listss = organizeAdministratorService.getOrganizeAdministratorEntity(UserProvider.getUser().getUserId()); + Set orgIds = new HashSet<>(16); + // 判断自己是哪些组织的管理员 + listss.stream().forEach(t -> { + if (t != null) { + if (t.getThisLayerSelect() != null && t.getThisLayerSelect() == 1) { + orgIds.add(t.getOrganizeId()); + } + if (t.getSubLayerSelect() != null && t.getSubLayerSelect() == 1) { + List underOrganizations = organizeService.getUnderOrganizations(t.getOrganizeId(), false); + orgIds.addAll(underOrganizations); + } + } + }); + List list1 = new ArrayList<>(orgIds); + // 得到所有有权限的组织 + List organizeName = organizeService.getOrganizeName(list1); + organizeName = organizeName.stream().filter(t -> PermissionConst.COMPANY.equals(t.getCategory())).collect(Collectors.toList()); + models = JsonUtil.getJsonToList(organizeName, OrganizeByAuthModel.class); + } + + // 判断当前编辑的权限时候是否有上级 + if (entity != null) { + if (models.stream().filter(t -> t.getId().equals(entity.getParentId())).findFirst().orElse(null) == null) { + OrganizeEntity info = organizeService.getInfo(entity.getParentId()); + if (info != null) { + OrganizeByAuthModel jsonToBean = JsonUtil.getJsonToBean(info, OrganizeByAuthModel.class); + jsonToBean.setDisabled(true); + models.add(jsonToBean); + } + } + } + List finalModels = models; + models.forEach(t -> { + if (PermissionConst.COMPANY.equals(t.getType())) { + t.setIcon("icon-ym icon-ym-tree-organization3"); + } else { + t.setIcon("icon-ym icon-ym-tree-department1"); + } + // 处理断层 + if (StringUtil.isNotEmpty(t.getOrganizeIdTree())) { + String[] split = t.getOrganizeIdTree().split(","); + List list1 = Arrays.asList(split); + t.setOrganizeIds(list1); + t.setOrganize(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, t.getOrganizeIdTree(), "/")); + List list2 = new ArrayList<>(list1); + Collections.reverse(list2); + for (String orgId : list2) { + OrganizeModel organizeEntity1 = finalModels.stream().filter(organizeEntity -> organizeEntity.getId().equals(orgId)).findFirst().orElse(null); + if (organizeEntity1 != null && !organizeEntity1.getId().equals(t.getId())) { + t.setParentId(organizeEntity1.getId()); + String[] split1 = t.getOrganizeIdTree().split(organizeEntity1.getId()); + if (split1.length > 1) { + t.setFullName(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, split1[1], "/")); + } + break; + } + } + } + }); + List> trees = TreeDotUtils.convertListToTreeDot(models); + List listVO = JsonUtil.getJsonToList(trees, OrganizeSelectorByAuthVO.class); + listVO.forEach(t -> { + t.setFullName(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, t.getOrganizeIdTree(), "/")); + }); + ListVO vo = new ListVO<>(); + vo.setList(listVO); + return ActionResult.success(vo); + } + + /** + * 通过部门id获取部门下拉框下拉框 + * + * @return + */ + @Operation(summary = "通过部门id获取部门下拉框") + @Parameters({ + @Parameter(name = "organizeConditionModel", description = "组织id模型", required = true) + }) + @PostMapping("/OrganizeCondition") + public ActionResult> organizeCondition(@RequestBody OrganizeConditionModel organizeConditionModel) { + Map orgIdNameMaps = organizeService.getInfoList(); + organizeConditionModel.setOrgIdNameMaps(orgIdNameMaps); + List organizeList = organizeRelationService.getOrgIdsList(organizeConditionModel); + List> trees = TreeDotUtils.convertListToTreeDot(organizeList); + List listVO = JsonUtil.getJsonToList(trees, OrganizeListVO.class); + listVO.forEach(t -> { + t.setFullName(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, t.getOrganizeIdTree(), "/")); + }); + ListVO vo = new ListVO<>(); + vo.setList(listVO); + return ActionResult.success(vo); + } + + /** + * 组织树形 + * + * @return + */ + @Operation(summary = "获取组织/公司树形") + @GetMapping("/Tree") + public ActionResult> tree() { + List list = new LinkedList<>(organizeService.getOrgMaps(null, true, null).values()); + list = list.stream().filter(t -> "company".equals(t.getCategory())).collect(Collectors.toList()); + List models = JsonUtil.getJsonToList(list, OrganizeModel.class); + for (OrganizeModel model : models) { + model.setIcon("icon-ym icon-ym-tree-organization3"); + } + List> trees = TreeDotUtils.convertListToTreeDot(models); + List listVO = JsonUtil.getJsonToList(trees, OrganizeTreeVO.class); + //将子节点全部删除 + Iterator iterator = listVO.iterator(); + while (iterator.hasNext()) { + OrganizeTreeVO orananizeTreeVO = iterator.next(); + if (!"-1".equals(orananizeTreeVO.getParentId())) { + iterator.remove(); + } + } + ListVO vo = new ListVO(); + vo.setList(listVO); + return ActionResult.success(vo); + } + + /** + * 获取组织信息 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "获取组织信息") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission(value = {"permission.organize"}) + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) throws DataException { + OrganizeEntity entity = organizeService.getInfo(id); + OrganizeInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, OrganizeInfoVO.class); + if (StringUtil.isNotEmpty(entity.getOrganizeIdTree())) { + String replace = entity.getOrganizeIdTree().replace(entity.getId(), ""); + if (StringUtil.isNotEmpty(replace) && !",".equals(replace)) { + vo.setOrganizeIdTree(Arrays.asList(replace.split(","))); + } else { + vo.setOrganizeIdTree(Arrays.asList(new String[]{"-1"})); + } + } + return ActionResult.success(vo); + } + + + /** + * 新建组织 + * + * @param organizeCrForm 新建模型 + * @return + */ + @OrganizePermission + @Operation(summary = "新建组织") + @Parameters({ + @Parameter(name = "organizeCrForm", description = "新建模型", required = true) + }) + @SaCheckPermission(value = {"permission.organize"}) + @PostMapping + public ActionResult create(@RequestBody @Valid OrganizeCrForm organizeCrForm) { + OrganizeEntity entity = JsonUtil.getJsonToBean(organizeCrForm, OrganizeEntity.class); + entity.setCategory("company"); + if (organizeService.isExistByFullName(entity, false, false)) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (organizeService.isExistByEnCode(entity.getEnCode(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + + // 通过组织id获取父级组织 + String organizeIdTree = organizeService.getOrganizeIdTree(entity); + entity.setOrganizeIdTree(organizeIdTree); + + organizeService.create(entity); + ThreadPoolExecutorUtil.getExecutor().execute(() -> { + try { + //创建组织后判断是否需要同步到企业微信 + synThirdQyService.createDepartmentSysToQy(false, entity, ""); + //创建组织后判断是否需要同步到钉钉 + synThirdDingTalkService.createDepartmentSysToDing(false, entity, ""); + } catch (Exception e) { + log.error("创建组织后同步失败到企业微信或钉钉失败,异常:" + e.getMessage()); + } + }); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 更新组织 + * + * @param id 主键值 + * @param organizeUpForm 实体对象 + * @return + */ + @OrganizePermission + @Operation(summary = "更新组织") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true), + @Parameter(name = "organizeUpForm", description = "实体对象", required = true) + }) + @SaCheckPermission(value = {"permission.organize"}) + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid OrganizeUpForm organizeUpForm) { + List synList = new ArrayList<>(); + OrganizeEntity entity = JsonUtil.getJsonToBean(organizeUpForm, OrganizeEntity.class); + OrganizeEntity info = organizeService.getInfo(organizeUpForm.getParentId()); + if (id.equals(entity.getParentId()) || (info != null && info.getOrganizeIdTree() != null && info.getOrganizeIdTree().contains(id))) { + return ActionResult.fail(MsgCode.PS013.get()); + } + entity.setId(id); + entity.setCategory("company"); + if (organizeService.isExistByFullName(entity, false, true)) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (organizeService.isExistByEnCode(entity.getEnCode(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + // 通过组织id获取父级组织 + String organizeIdTree = organizeService.getOrganizeIdTree(entity); + entity.setOrganizeIdTree(organizeIdTree); + boolean flag = organizeService.update(id, entity); + synList.add(entity); + + // 得到所有子组织或部门id + if (info != null && info.getParentId() != null && !entity.getParentId().equals(info.getParentId())) { + List underOrganizations = organizeService.getUnderOrganizations(id, false); + underOrganizations.forEach(t -> { + OrganizeEntity info1 = organizeService.getInfo(t); + if (StringUtil.isNotEmpty(info1.getOrganizeIdTree())) { + String organizeIdTrees = organizeService.getOrganizeIdTree(info1); + info1.setOrganizeIdTree(organizeIdTrees); + organizeService.update(info1.getId(), info1); + synList.add(info1); + } + }); + } + ThreadPoolExecutorUtil.getExecutor().execute(() -> { + synList.forEach(t -> { + try { + //修改组织后判断是否需要同步到企业微信 + synThirdQyService.updateDepartmentSysToQy(false, t, ""); + //修改组织后判断是否需要同步到钉钉 + synThirdDingTalkService.updateDepartmentSysToDing(false, t, ""); + } catch (Exception e) { + log.error("修改组织后同步失败到企业微信或钉钉失败,异常:" + e.getMessage()); + } + }); + }); + if (!flag) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除组织 + * + * @param orgId 组织主键 + * @return + */ + @OrganizePermission + @Operation(summary = "删除组织") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission(value = {"permission.organize"}) + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String orgId) { + return organizeService.delete(orgId); + } + + /** + * 删除部门 + * + * @param orgId 部门主键 + * @return + */ + @OrganizePermission + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission(value = {"permission.organize"}) + @Operation(summary = "删除部门") + @DeleteMapping("/Department/{id}") + public ActionResult deleteDepartment(@PathVariable("id") String orgId) { + return organizeService.delete(orgId); + } + + /** + * 更新组织状态 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "更新组织状态") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission(value = {"permission.organize"}) + @PutMapping("/{id}/Actions/State") + public ActionResult update(@PathVariable("id") String id) { + OrganizeEntity organizeEntity = organizeService.getInfo(id); + if (organizeEntity != null) { + if ("1".equals(String.valueOf(organizeEntity.getEnabledMark()))) { + organizeEntity.setEnabledMark(0); + } else { + organizeEntity.setEnabledMark(1); + } + organizeService.update(organizeEntity.getId(), organizeEntity); + return ActionResult.success(MsgCode.SU004.get()); + } + return ActionResult.success(MsgCode.FA002.get()); + } + + /** + * 获取部门下拉框列表 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取部门下拉框列表") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @GetMapping("/Department/Selector/{id}") + public ActionResult> getListDepartment(@PathVariable("id") String id) { + List data = new LinkedList<>(organizeService.getOrgMaps(null, true, null).values()); + if (!"0".equals(id)) { + data.remove(organizeService.getInfo(id)); + } + List models = JsonUtil.getJsonToList(data, OrganizeModel.class); + for (OrganizeModel model : models) { + if ("department".equals(model.getType())) { + model.setIcon("icon-ym icon-ym-tree-department1"); + } else if ("company".equals(model.getType())) { + model.setIcon("icon-ym icon-ym-tree-organization3"); + } + } + + Map orgIdNameMaps = organizeService.getInfoList(); + models.forEach(t -> { + t.setOrganize(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, t.getOrganizeIdTree(), "/")); + if (StringUtil.isNotEmpty(t.getOrganizeIdTree())) { + String[] split = t.getOrganizeIdTree().split(","); + if (split.length > 0) { + t.setOrganizeIds(Arrays.asList(split)); + } else { + t.setOrganizeIds(new ArrayList<>()); + } + } + }); + + List> trees = TreeDotUtils.convertListToTreeDotFilter(models); + List listVO = JsonUtil.getJsonToList(trees, OrganizeDepartSelectorListVO.class); + ListVO vo = new ListVO(); + vo.setList(listVO); + return ActionResult.success(vo); + } + + /** + * 获取部门下拉框列表 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取部门下拉框列表") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @GetMapping("/Department/SelectorByAuth/{id}") + public ActionResult> getDepartmentSelectorByAuth(@PathVariable("id") String id) { + Map orgMaps; + OrganizeEntity entity = organizeService.getInfo(id); + + if (!UserProvider.getUser().getIsAdministrator()) { + // 通过权限转树 + List listss = organizeAdministratorService.getOrganizeAdministratorEntity(UserProvider.getUser().getUserId()); + Set orgIds = new HashSet<>(16); + // 判断自己是哪些组织的管理员 + listss.stream().forEach(t -> { + if (t != null) { + if (t.getThisLayerSelect() != null && t.getThisLayerSelect() == 1) { + orgIds.add(t.getOrganizeId()); + } + if (t.getSubLayerSelect() != null && t.getSubLayerSelect() == 1) { + List underOrganizations = organizeService.getUnderOrganizations(t.getOrganizeId(), false); + orgIds.addAll(underOrganizations); + } + } + }); + List list1 = new ArrayList<>(orgIds); + orgMaps = organizeService.getOrganizeName(list1, null, true, null); + } else { + orgMaps = organizeService.getOrgMaps(null, true, null); + } + Map orgMapsModel = JSONObject.parseObject(JSONObject.toJSONString(orgMaps), new TypeReference>() {}, new Feature[0]);; + if (!"0".equals(id)) { + orgMapsModel.remove(id); + } + Map orgIdNameMaps = organizeService.getInfoList(); + // 判断当前编辑的权限时候是否有上级 + if (entity != null) { + if (orgMapsModel.values().stream().filter(t -> t.getId().equals(entity.getParentId())).findFirst().orElse(null) == null) { + OrganizeEntity info = organizeService.getInfo(entity.getParentId()); + if (info != null) { + OrganizeByAuthModel jsonToBean = JsonUtil.getJsonToBean(info, OrganizeByAuthModel.class); + jsonToBean.setDisabled(true); + orgMapsModel.put(info.getId(), jsonToBean); + } + } + } + orgMapsModel.values().forEach(t -> { + if (PermissionConst.COMPANY.equals(t.getType())) { + t.setIcon("icon-ym icon-ym-tree-organization3"); + } else { + t.setIcon("icon-ym icon-ym-tree-department1"); + } + // 处理断层 + if (StringUtil.isNotEmpty(t.getOrganizeIdTree())) { + List list1 = new ArrayList<>(); + String[] split = t.getOrganizeIdTree().split(","); + list1 = Arrays.asList(split); + List list = new ArrayList<>(16); + list1.forEach(orgId -> { + if (StringUtil.isNotEmpty(orgId)) { + list.add(orgId); + } + }); + t.setOrganizeIds(list); + t.setOrganize(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, t.getOrganizeIdTree(), "/")); + Collections.reverse(list1); + for (String orgId : list1) { + OrganizeModel organizeEntity1 = orgMapsModel.get(orgId); + if (organizeEntity1 != null && !organizeEntity1.getId().equals(t.getId())) { + t.setParentId(organizeEntity1.getId()); + String[] split1 = t.getOrganizeIdTree().split(organizeEntity1.getId()); + if (split1.length > 1) { + t.setFullName(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, split1[1], "/")); + } + break; + } + } + } + }); + List> trees = TreeDotUtils.convertMapsToTreeDot(orgMapsModel); + List listVO = JsonUtil.getJsonToList(trees, OrganizeSelectorByAuthVO.class); + listVO.forEach(t -> { + t.setFullName(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, t.getOrganizeIdTree(), "/")); + }); + ListVO vo = new ListVO(); + vo.setList(listVO); + return ActionResult.success(vo); + } + + /** + * 新建部门 + * + * @param organizeDepartCrForm 新建模型 + * @return + */ + @OrganizePermission + @Operation(summary = "新建部门") + @Parameters({ + @Parameter(name = "organizeDepartCrForm", description = "新建模型", required = true) + }) + @SaCheckPermission(value = {"permission.organize"}) + @PostMapping("/Department") + public ActionResult createDepartment(@RequestBody @Valid OrganizeDepartCrForm organizeDepartCrForm) { + OrganizeEntity entity = JsonUtil.getJsonToBean(organizeDepartCrForm, OrganizeEntity.class); + entity.setCategory("department"); + //判断同一个父级下是否含有同一个名称 + if (organizeService.isExistByFullName(entity, false, false)) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + //判断同一个父级下是否含有同一个编码 + if (organizeService.isExistByEnCode(entity.getEnCode(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + + // 通过组织id获取父级组织 + String organizeIdTree = organizeService.getOrganizeIdTree(entity); + entity.setOrganizeIdTree(organizeIdTree); + + organizeService.create(entity); + ThreadPoolExecutorUtil.getExecutor().execute(() -> { + try { + //创建部门后判断是否需要同步到企业微信 + synThirdQyService.createDepartmentSysToQy(false, entity, ""); + //创建部门后判断是否需要同步到钉钉 + synThirdDingTalkService.createDepartmentSysToDing(false, entity, ""); + } catch (Exception e) { + log.error("创建部门后同步失败到企业微信或钉钉失败,异常:" + e.getMessage()); + } + }); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 更新部门 + * + * @param id 主键值 + * @param oraganizeDepartUpForm 修改模型 + * @return + */ + @OrganizePermission + @Operation(summary = "更新部门") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true), + @Parameter(name = "oraganizeDepartUpForm", description = "修改模型", required = true) + }) + @SaCheckPermission(value = {"permission.organize"}) + @PutMapping("/Department/{id}") + public ActionResult updateDepartment(@PathVariable("id") String id, @RequestBody @Valid OrganizeDepartUpForm oraganizeDepartUpForm) { + List synList = new ArrayList<>(); + OrganizeEntity entity = JsonUtil.getJsonToBean(oraganizeDepartUpForm, OrganizeEntity.class); + OrganizeEntity info = organizeService.getInfo(oraganizeDepartUpForm.getParentId()); + if (id.equals(entity.getParentId()) || (info != null && info.getOrganizeIdTree() != null && info.getOrganizeIdTree().contains(id))) { + return ActionResult.fail(MsgCode.PS013.get()); + } + entity.setId(id); + entity.setCategory("department"); + //判断同一个父级下是否含有同一个名称 + if (organizeService.isExistByFullName(entity, false, true)) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + //判断同一个父级下是否含有同一个编码 + if (organizeService.isExistByEnCode(entity.getEnCode(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + // 通过组织id获取父级组织 + String organizeIdTree = organizeService.getOrganizeIdTree(entity); + entity.setOrganizeIdTree(organizeIdTree); + boolean flag = organizeService.update(id, entity); + synList.add(entity); + + // 得到所有子组织或部门id + if (info.getParentId() != null && !entity.getParentId().equals(info.getParentId())) { + List underOrganizations = organizeService.getUnderOrganizations(id, false); + underOrganizations.forEach(t -> { + OrganizeEntity info1 = organizeService.getInfo(t); + if (StringUtil.isNotEmpty(info1.getOrganizeIdTree())) { + String organizeIdTrees = organizeService.getOrganizeIdTree(info1); + info1.setOrganizeIdTree(organizeIdTrees); + organizeService.update(info1.getId(), info1); + synList.add(info1); + } + }); + } + + ThreadPoolExecutorUtil.getExecutor().execute(() -> { + synList.forEach(t -> { + try { + //修改部门后判断是否需要同步到企业微信 + synThirdQyService.updateDepartmentSysToQy(false, organizeService.getInfo(id), ""); + //修改部门后判断是否需要同步到钉钉 + synThirdDingTalkService.updateDepartmentSysToDing(false, organizeService.getInfo(id), ""); + } catch (Exception e) { + log.error("修改部门后同步失败到企业微信或钉钉失败,异常:" + e.getMessage()); + } + }); + }); + if (flag == false) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 更新部门状态 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "更新部门状态") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission(value = {"permission.organize"}) + @PutMapping("/Department/{id}/Actions/State") + public ActionResult updateDepartment(@PathVariable("id") String id) { + OrganizeEntity organizeEntity = organizeService.getInfo(id); + if (organizeEntity != null) { + if ("1".equals(String.valueOf(organizeEntity.getEnabledMark()))) { + organizeEntity.setEnabledMark(0); + } else { + organizeEntity.setEnabledMark(1); + } + organizeService.update(organizeEntity.getId(), organizeEntity); + return ActionResult.success(MsgCode.SU004.get()); + } + return ActionResult.fail(MsgCode.FA002.get()); + } + + /** + * 获取部门信息 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "获取部门信息") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission(value = {"permission.organize"}) + @GetMapping("/Department/{id}") + public ActionResult infoDepartment(@PathVariable("id") String id) throws DataException { + OrganizeEntity entity = organizeService.getInfo(id); + OrganizeDepartInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, OrganizeDepartInfoVO.class); + List list = new ArrayList<>(); + if (StringUtil.isNotEmpty(entity.getOrganizeIdTree())) { + String[] split = entity.getOrganizeIdTree().split(","); + if (split.length > 1) { + for (int i = 0; i < split.length - 1; i++) { + list.add(split[i]); + } + } + } + vo.setOrganizeIdTree(list); + return ActionResult.success(vo); + } + + /** + * 获取默认当前值部门ID + * + * @param organizeConditionModel 参数 + * @return 执行结构 + * @throws DataException ignore + */ + @Operation(summary = "获取默认当前值部门ID") + @Parameters({ + @Parameter(name = "organizeConditionModel", description = "参数", required = true) + }) + @PostMapping("/getDefaultCurrentValueDepartmentId") + public ActionResult getDefaultCurrentValueDepartmentId(@RequestBody OrganizeConditionModel organizeConditionModel) throws DataException { + String departmentId = organizeService.getDefaultCurrentValueDepartmentId(organizeConditionModel); + Map dataMap = new HashMap(); + dataMap.put("departmentId", departmentId); + return ActionResult.success(MsgCode.SU005.get(), dataMap); + } + + // -----临时调用 + + /** + * 获取组织列表 + * + * @param id 主键 + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "获取组织列表") + @SaCheckPermission(value = {"permission.organize", "permission.position", "permission.user", "permission.role"}, mode = SaMode.OR) + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @GetMapping("/AsyncList/{id}") + public ActionResult getList(@PathVariable("id") String id, PaginationOrganize pagination) { + boolean filterEnabledMark = false; + boolean isKeyWord = StringUtil.isNotEmpty(pagination.getKeyword()); + List listVO = organizeList(pagination, id, filterEnabledMark); + ListVO vo = new ListVO(); + vo.setList(listVO); + if(!isKeyWord){ + return ActionResult.success(vo); + } + PaginationVO jsonToBean = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(listVO, jsonToBean); +// ListVO vo = new ListVO<>(); +// // 获取所有组织 +// Map orgMaps; +// if (!UserProvider.getUser().getIsAdministrator()) { +// // 通过权限转树 +// List listss = organizeAdministratorService.getOrganizeAdministratorEntity(UserProvider.getUser().getUserId()); +// Set orgIds = new HashSet<>(16); +// // 判断自己是哪些组织的管理员 +// listss.stream().forEach(t -> { +// if (t != null) { +// if (t.getThisLayerSelect() != null && t.getThisLayerSelect() == 1) { +// orgIds.add(t.getOrganizeId()); +// } +// if (t.getSubLayerSelect() != null && t.getSubLayerSelect() == 1) { +// List underOrganizations = organizeService.getUnderOrganizations(t.getOrganizeId(), false); +// orgIds.addAll(underOrganizations); +// } +// } +// }); +// List list1 = new ArrayList<>(orgIds); +// // 得到所有有权限的组织 +// orgMaps = organizeService.getOrganizeName(list1, null, false, null); +// } else { +// orgMaps = organizeService.getOrgMaps(null, false, null); +// } +// Map orgIdNameMaps = organizeService.getInfoList(); +// List organizeEntityList = new ArrayList<>(); +// OrganizeEntity parentEntity = null; +// if ("0".equals(id)) { +// parentEntity = organizeService.getInfoByParentId("-1"); +// OrganizeEntity organizeEntity = orgMaps.get(parentEntity.getId()); +// if (organizeEntity != null) { +// organizeEntityList.add(organizeEntity); +// } +// } else { +// parentEntity = organizeService.getInfo(id); +// } +// // 判断是否有顶级组织权限 +// if (organizeEntityList.size() == 0) { +// List temOrganizeEntityList = new ArrayList<>(); +// temOrganizeEntityList.add(parentEntity); +// getParentEntity(orgMaps, temOrganizeEntityList, organizeEntityList); +// } +// if (organizeEntityList.size() == 0) { +// vo.setList(new ArrayList<>()); +// return ActionResult.success(vo); +// } +// List voList = JsonUtil.getJsonToList(organizeEntityList, OrganizeListVO.class); +// voList.forEach(t -> { +// if (PermissionConst.COMPANY.equals(t.getType())) { +// t.setIcon("icon-ym icon-ym-tree-organization3"); +// } else { +// t.setIcon("icon-ym icon-ym-tree-department1"); +// } +// t.setHasChildren(true); +// // 处理断层 +// if (StringUtil.isNotEmpty(t.getOrganizeIdTree())) { +// String[] split = t.getOrganizeIdTree().split(","); +// List list1 = Arrays.asList(split); +// Collections.reverse(list1); +// for (String orgId : list1) { +// if (!orgId.equals(t.getId())) { +// OrganizeEntity organizeEntity1 = orgMaps.get(orgId); +// if (organizeEntity1 != null) { +// t.setParentId(organizeEntity1.getId()); +// String[] split1 = t.getOrganizeIdTree().split(organizeEntity1.getId()); +// if (split1.length > 1) { +// t.setFullName(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, split1[1], "/")); +// } +// break; +// } +// } +// } +// } +// }); +// vo.setList(voList); +// return ActionResult.success(vo); + } + + private void getParentEntity(Map orgMaps, + List temOrganizeEntityList, + List organizeEntityList) { + List temOrganizeEntityList1 = new ArrayList<>(); + // 判断是否有顶级组织权限 + if (organizeEntityList.size() == 0) { + temOrganizeEntityList.forEach(t -> { + List organizeByParentId = organizeService.getOrganizeByParentId(t.getId()); + temOrganizeEntityList1.addAll(organizeByParentId); + organizeByParentId.forEach(organizeEntity -> { + OrganizeEntity organizeEntity1 = orgMaps.get(organizeEntity.getId()); + if (organizeEntity1 != null) { + organizeEntityList.add(organizeEntity1); + } + }); + }); + } + if (organizeEntityList.size() == 0 && temOrganizeEntityList1.size() > 0) { + getParentEntity(orgMaps, temOrganizeEntityList1, organizeEntityList); + } + } + + /** + * 获取列表 + * + * @param pagination 分页模型 + * @param id 主键 + * @return + */ + @Operation(summary = "获取列表") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @GetMapping("/Department/SelectAsyncList/{id}") + public ActionResult getSelectAsyncList(@PathVariable("id") String id,PaginationOrganize pagination) { + boolean isKeyWord = StringUtil.isNotEmpty(pagination.getKeyword()); + List listVO = organizeList(pagination, id); + ListVO vo = new ListVO(); + vo.setList(listVO); + if(!isKeyWord){ + return ActionResult.success(vo); + } + PaginationVO jsonToBean = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(listVO, jsonToBean); + } + + /** + * 获取列表 + * + * @param pagination 分页模型 + * @param id 主键 + * @return + */ + @Operation(summary = "获取列表") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @GetMapping("/SelectAsyncList/{id}") + public ActionResult selectAsyncList(@PathVariable("id") String id,PaginationOrganize pagination) { + boolean isKeyWord = StringUtil.isNotEmpty(pagination.getKeyword()); + pagination.setType("company"); + List listVO = organizeList(pagination, id); + ListVO vo = new ListVO(); + vo.setList(listVO); + if(!isKeyWord){ + return ActionResult.success(vo); + } + PaginationVO jsonToBean = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(listVO, jsonToBean); + } + + /** + * 获取列表 + * + * @param pagination 分页模型 + * @param id 主键 + * @return + */ + @Operation(summary = "获取列表") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @GetMapping("/SelectAsyncByAuth/{id}") + public ActionResult selectAsyncByAuth(@PathVariable("id") String id,PaginationOrganize pagination) { + boolean filterEnabledMark = true; + boolean isKeyWord = StringUtil.isNotEmpty(pagination.getKeyword()); + pagination.setType("company"); + List listVO = organizeList(pagination, id, filterEnabledMark); + ListVO vo = new ListVO(); + vo.setList(listVO); + if(!isKeyWord){ + return ActionResult.success(vo); + } + PaginationVO jsonToBean = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(listVO, jsonToBean); + } + + /** + * 获取列表 + * + * @param pagination 分页模型 + * @param id 主键 + * @return + */ + @Operation(summary = "获取列表") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @GetMapping("/Department/SelectAsyncByAuth/{id}") + public ActionResult selectAsyncByAuthDepartment(@PathVariable("id") String id,PaginationOrganize pagination) { + boolean filterEnabledMark = true; + boolean isKeyWord = StringUtil.isNotEmpty(pagination.getKeyword()); + List listVO = organizeList(pagination, id, filterEnabledMark); + ListVO vo = new ListVO(); + vo.setList(listVO); + if(!isKeyWord){ + return ActionResult.success(vo); + } + PaginationVO jsonToBean = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(listVO, jsonToBean); + } + + /** + * 获取选中值 + * + * @return ignore + */ + @Operation(summary = "获取选中值") + @Parameters({ + @Parameter(name = "userIdModel", description = "id", required = true) + }) + @PostMapping("/SelectedList") + public ActionResult> SelectedList(@RequestBody UserIdModel userIdModel) { + List ids = new ArrayList<>(); + for(String id : userIdModel.getIds()){ + ids.add(id+"--"+PermissionConst.COMPANY); + } + List list = userService.selectedByIds(ids); + ListVO listVO = new ListVO<>(); + listVO.setList(list); + return ActionResult.success(listVO); + } + + + private List organizeList(boolean filterEnabledMark){ + List orgIds = new ArrayList<>(); + if (!UserProvider.getUser().getIsAdministrator()) { + // 通过权限转树 + List listss = organizeAdministratorService.getOrganizeAdministratorEntity(UserProvider.getUser().getUserId()); + // 判断自己是哪些组织的管理员 + listss.stream().forEach(t -> { + if (t != null) { + if (t.getThisLayerSelect() != null && t.getThisLayerSelect() == 1) { + orgIds.add(t.getOrganizeId()); + } + if (t.getSubLayerSelect() != null && t.getSubLayerSelect() == 1) { + List underOrganizations = organizeService.getUnderOrganizations(t.getOrganizeId(), filterEnabledMark); + orgIds.addAll(underOrganizations); + } + } + }); + orgIds.add("com.yunzhupaas"); + } + return orgIds; + } + + private List organizeList(PaginationOrganize pagination, String id, boolean filterEnabledMark){ + Map orgIdNameMaps = organizeService.getInfoList(); + List listVO = new ArrayList<>(); + boolean isKeyWord = StringUtil.isNotEmpty(pagination.getKeyword()); + List orgIds = organizeList(filterEnabledMark); + if(isKeyWord) { + List list = organizeService.getPageList(orgIds,pagination,filterEnabledMark); + for (OrganizeEntity entity : list) { + OrganizeSelectorVO vo = JsonUtil.getJsonToBean(entity,OrganizeSelectorVO.class); + vo.setIcon(PermissionConst.COMPANY.equals(entity.getCategory()) ? "icon-ym icon-ym-tree-organization3" : "icon-ym icon-ym-tree-department1"); + vo.setHasChildren(false); + vo.setOrganize(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, entity.getOrganizeIdTree(), "/")); + vo.setOrganizeIds(organizeService.getOrgIdTree(entity)); + listVO.add(vo); + } + }else { + Map orgMaps = ObjectUtil.isNotEmpty(orgIds)? organizeService.getOrganizeName(orgIds, null, filterEnabledMark, pagination.getType()) :organizeService.getOrgMaps(null, filterEnabledMark, pagination.getType()); + Map orgMapsModel = JSONObject.parseObject(JSONObject.toJSONString(orgMaps), new TypeReference>() {}, new Feature[0]); + orgMapsModel.values().forEach(vo -> { + vo.setIcon(PermissionConst.COMPANY.equals(vo.getType()) ? "icon-ym icon-ym-tree-organization3" : "icon-ym icon-ym-tree-department1"); + vo.setHasChildren(true); + // 处理断层 + if (StringUtil.isNotEmpty(vo.getOrganizeIdTree())) { + String[] split = vo.getOrganizeIdTree().split(","); + List list1 = Arrays.asList(split); + Collections.reverse(list1); + for (String orgId : list1) { + if(!orgId.equals(vo.getId())) { + OrganizeModel organizeEntity1 = orgMapsModel.get(orgId); + if (organizeEntity1 != null) { + vo.setParentId(organizeEntity1.getId()); + String[] split1 = vo.getOrganizeIdTree().split(organizeEntity1.getId()); + if (split1.length > 1) { + vo.setFullName(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, split1[1], "/")); + } + break; + } + } + } + } + }); + if ("0".equals(id)) { + List> trees = TreeDotUtils.convertMapsToTreeDot(orgMapsModel); + listVO.addAll(JsonUtil.getJsonToList(trees, OrganizeSelectorVO.class)); + listVO.forEach(vo -> { + vo.setFullName(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, vo.getOrganizeIdTree(), "/")); + vo.setOrganize(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, vo.getOrganizeIdTree(), "/")); + vo.setOrganizeIds(Arrays.asList(vo.getOrganizeIdTree().split(","))); + vo.setHasChildren(true); + vo.setIsLeaf(false); + vo.setChildren(new ArrayList<>()); + }); + } else { + List organizeList = orgMapsModel.values().stream().filter(t -> t.getParentId().equals(id)).collect(Collectors.toList()); + List jsonToList = JsonUtil.getJsonToList(organizeList, OrganizeSelectorVO.class); + for (OrganizeSelectorVO vo : jsonToList) { + vo.setOrganizeIds(Arrays.asList(vo.getOrganizeIdTree().split(","))); + vo.setOrganize(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, vo.getOrganizeIdTree(), "/")); + vo.setHasChildren(true); + vo.setIsLeaf(false); + vo.setChildren(new ArrayList<>()); + } + listVO.addAll(jsonToList); + } + } + return listVO; + } + + private List organizeList(PaginationOrganize pagination, String id){ + Map orgIdNameMaps = organizeService.getInfoList(); + List listVO = new ArrayList<>(); + boolean isKeyWord = StringUtil.isNotEmpty(pagination.getKeyword()); + List list = new ArrayList<>(); + if(isKeyWord) { + list.addAll(organizeService.getPageList(new ArrayList<>(), pagination, true)); + }else { + String parentId = "0".equals(id)?"-1":id; + List parentList = organizeService.getListByParentId(parentId); + if(StringUtil.isNotEmpty(pagination.getType())) { + list = list.stream().filter(t->t.getCategory().equals(pagination.getType())).collect(Collectors.toList()); + } + list.addAll(parentList); + } + for (OrganizeEntity entity : list) { + OrganizeSelectorVO vo = JsonUtil.getJsonToBean(entity, OrganizeSelectorVO.class); + vo.setIcon(PermissionConst.COMPANY.equals(entity.getCategory()) ? "icon-ym icon-ym-tree-organization3" : "icon-ym icon-ym-tree-department1"); + vo.setHasChildren(true); + vo.setIsLeaf(false); + vo.setChildren(new ArrayList<>()); + vo.setOrganize(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, entity.getOrganizeIdTree(), "/")); + vo.setOrganizeIds(organizeService.getOrgIdTree(entity)); + listVO.add(vo); + } + return listVO; + } + + + + // -------------------导入导出-------------------- + + @Operation(summary = "模板下载") + @SaCheckPermission("permission.position") + @GetMapping("/TemplateDownload") + public ActionResult TemplateDownload() { + OrgColumnMap columnMap = new OrgColumnMap(); + String excelName = columnMap.getExcelName(); + Map keyMap = columnMap.getColumnByType(0); + keyMap.remove("parentId"); + List models = columnMap.getFieldsModel(false, 0); + List> list = columnMap.getDefaultList(); + Map optionMap = getOptionMap(); + ExcelModel excelModel = ExcelModel.builder().models(models).selectKey(new ArrayList<>(keyMap.keySet())).optionMap(optionMap).build(); + DownloadVO vo = ExcelTool.getImportTemplate(configValueUtil.getTemporaryFilePath(), excelName, keyMap, list, excelModel); + return ActionResult.success(vo); + } + + + @Operation(summary = "上传导入Excel") + @SaCheckPermission("permission.position") + @PostMapping("/Uploader") + public ActionResult Uploader() { + return ExcelTool.uploader(); + } + + @Operation(summary = "导入预览") + @SaCheckPermission("permission.position") + @GetMapping("/ImportPreview") + public ActionResult> ImportPreview(String fileName) throws Exception { + // 导入字段 + OrgColumnMap columnMap = new OrgColumnMap(); + Map keyMap = columnMap.getColumnByType(0); + keyMap.remove("parentId"); + Map headAndDataMap = ExcelTool.importPreview(configValueUtil.getTemporaryFilePath(), fileName, keyMap); + return ActionResult.success(headAndDataMap); + } + + @Operation(summary = "导出异常报告") + @SaCheckPermission("permission.position") + @PostMapping("/ExportExceptionData") + public ActionResult ExportExceptionData(@RequestBody ExcelImportForm visualImportModel) { + String temporaryFilePath = configValueUtil.getTemporaryFilePath(); + List> dataList = visualImportModel.getList(); + OrgColumnMap columnMap = new OrgColumnMap(); + String excelName = columnMap.getExcelName(); + Map keyMap = columnMap.getColumnByType(0); + keyMap.remove("parentId"); + List models = columnMap.getFieldsModel(true, 0); + ExcelModel excelModel = ExcelModel.builder().optionMap(getOptionMap()).models(models).build(); + DownloadVO vo = ExcelTool.exportExceptionReport(temporaryFilePath, excelName, keyMap, dataList, excelModel); + return ActionResult.success(vo); + } + + @Operation(summary = "导入数据") + @SaCheckPermission("permission.position") + @PostMapping("/ImportData") + public ActionResult ImportData(@RequestBody ExcelImportForm visualImportModel) throws Exception { + List> listData = new ArrayList<>(); + List> headerRow = new ArrayList<>(); + if (visualImportModel.isType()){ + ActionResult result = ImportPreview(visualImportModel.getFileName()); + if (result == null){ + throw new Exception(MsgCode.FA018.get()); + } + if (result.getCode() != 200){ + throw new Exception(result.getMsg()); + } + if (result.getData() instanceof Map){ + Map data = (Map) result.getData(); + listData = (List>) data.get("dataRow"); + headerRow = (List>) data.get("headerRow"); + } + }else { + listData = visualImportModel.getList(); + } + List addList = new ArrayList<>(); + List> failList = new ArrayList<>(); + // 对数据做校验 + this.validateImportData(listData, addList, failList); + + //正常数据插入 + for (OrganizeEntity each : addList) { + organizeService.create(each); + } + ExcelImportVO importModel = new ExcelImportVO(); + importModel.setSnum(addList.size()); + importModel.setFnum(failList.size()); + importModel.setResultType(failList.size() > 0 ? 1 : 0); + importModel.setFailResult(failList); + importModel.setHeaderRow(headerRow); + return ActionResult.success(importModel); + } + + @Operation(summary = "导出Excel") + @SaCheckPermission("permission.position") + @GetMapping("/ExportData") + public ActionResult ExportData(PaginationPosition pagination) throws IOException { + if (StringUtil.isEmpty(pagination.getSelectKey())) { + return ActionResult.fail(MsgCode.IMP011.get()); + } + String[] keys = pagination.getSelectKey(); + //获取数据 + String type = Objects.equals(pagination.getDataType(), 0) ? "" : Objects.equals(pagination.getDataType(), 1) ? PermissionConst.COMPANY : PermissionConst.DEPARTMENT; + //获取当前用户的所有可见组织 + List> realList = organizeService.getOrgTreeList(type, pagination.getKeyword()); + + //获取字段 + OrgColumnMap columnMap = new OrgColumnMap(); + String excelName = columnMap.getExcelName(); + Map keyMap = columnMap.getColumnByType(pagination.getDataType()); + List models = columnMap.getFieldsModel(true, pagination.getDataType()); + ExcelModel excelModel = ExcelModel.builder().models(models).selectKey(Arrays.asList(keys)).build(); + DownloadVO vo = ExcelTool.creatModelExcel(configValueUtil.getTemporaryFilePath(), excelName, keyMap, realList, excelModel); + return ActionResult.success(vo); + } + + /** + * 字段验证 + * + * @param listData + * @param addList + * @param failList + */ + private void validateImportData(List> listData, List addList, List> failList) { + OrgColumnMap columnMap = new OrgColumnMap(); + Map keyMap = columnMap.getColumnByType(0); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().isNull(OrganizeEntity::getDeleteMark); + queryWrapper.lambda().orderByAsc(OrganizeEntity::getSortCode).orderByDesc(OrganizeEntity::getCreatorTime); + List allOrg = organizeService.list(queryWrapper); + Map allOrgsTreeName = organizeService.getAllOrgsTreeName(); + Map userNameMap = userService.getUserNameAndIdMap(); + + List enList = dictionaryDataApi.getListByTypeDataCode(DictionaryDataEnum.ENTERPRISE_NATURE.getDictionaryTypeId()); + Map enMap = enList.stream().collect(Collectors.toMap(DictionaryDataEntity::getFullName, DictionaryDataEntity::getId)); + List itList = dictionaryDataApi.getListByTypeDataCode(DictionaryDataEnum.INDUSTRY_TYPE.getDictionaryTypeId()); + Map itMap = itList.stream().collect(Collectors.toMap(DictionaryDataEntity::getFullName, DictionaryDataEntity::getId)); + + Map newOrgTreeNameAndId = new HashMap<>(); + for (int i = 0, len = listData.size(); i < len; i++) { + Map eachMap = listData.get(i); + Map realMap = JsonUtil.getJsonToBean(eachMap, Map.class); + StringJoiner errInfo = new StringJoiner(","); + String category = ""; + if (eachMap.get("category") != null && StringUtil.isNotEmpty(eachMap.get("category").toString())) { + if ("公司".equals(eachMap.get("category").toString())) { + category = PermissionConst.COMPANY; + } else if ("部门".equals(eachMap.get("category").toString())) { + category = PermissionConst.DEPARTMENT; + } else { + errInfo.add("找不到该类型值"); + } + } else { + errInfo.add("类型" + "不能为空"); + } + if (errInfo.length() > 0) { + eachMap.put("errorsInfo", errInfo.toString()); + failList.add(eachMap); + continue; + } + realMap.put("category", category); + boolean isOrg = PermissionConst.COMPANY.equals(category) ? true : false; + + for (String column : keyMap.keySet()) { + Object valueObj = eachMap.get(column); + String value = valueObj == null ? null : String.valueOf(valueObj); + String columnName = keyMap.get(column); + String thisCategory = isOrg ? PermissionConst.COMPANY : PermissionConst.DEPARTMENT; + String preName = ""; +// String preName = eachMap.get("category").toString(); + switch (column) { + case "fullName": + if (StringUtil.isEmpty(value)) { + errInfo.add(preName + columnName + "不能为空"); + break; + } + if (value.length() > 50) { + errInfo.add(preName + columnName + "值超出最多输入字符限制"); + break; + } + if (!value.contains("/")) { + errInfo.add("顶级公司已存在"); + break; + } + int index = value.lastIndexOf("/"); + String parentName = value.substring(0, index); + String fullName = value.substring(index + 1); + + //库里寻找上级 + String parentId = ""; + String organizeIdTree = ""; + //部门下不能创建公司报错后跳出双重循环 + List orgIds = new ArrayList<>(); + for (String key : allOrgsTreeName.keySet()) { + String name = allOrgsTreeName.get(key).toString(); + if (name.equals(parentName)) { + String substring = key.lastIndexOf(",") > 0 ? key.substring(key.lastIndexOf(",") + 1) : key; + orgIds.add(substring); + } + } + if (orgIds.size() == 2) { + OrganizeEntity thisOrg = organizeService.getById(orgIds.get(0)); + if (!PermissionConst.COMPANY.equals(thisOrg.getCategory())) { + thisOrg = organizeService.getById(orgIds.get(1)); + } + parentId = thisOrg.getId(); + organizeIdTree = thisOrg.getOrganizeIdTree(); + } else if (orgIds.size() == 1) { + OrganizeEntity thisOrg = organizeService.getById(orgIds.get(0)); + if (isOrg && !PermissionConst.COMPANY.equals(thisOrg.getCategory())) { + errInfo.add("部门下不能创建公司"); + break; + } + parentId = thisOrg.getId(); + organizeIdTree = thisOrg.getOrganizeIdTree(); + } else { + errInfo.add("找不到该所属组织"); + break; + } + //当前导入excel里寻找上级 + if (newOrgTreeNameAndId.containsKey(parentName)) { + organizeIdTree = newOrgTreeNameAndId.get(parentName); + List list = Arrays.asList(organizeIdTree.split(",")); + parentId = list.get(list.size() - 1); + } + if (StringUtil.isEmpty(parentId)) { + errInfo.add("找不到该所属组织"); + break; + } + //库里重复 + long fullNameCount = allOrg.stream().filter(t -> t.getFullName().equals(fullName) && thisCategory.equals(t.getCategory())).count(); + if (fullNameCount > 0) { + errInfo.add(preName + columnName + "值已存在"); + break; + } + //表格内重复 + fullNameCount = addList.stream().filter(t -> t.getFullName().equals(fullName) && thisCategory.equals(t.getCategory())).count(); + if (fullNameCount > 0) { + errInfo.add(preName + columnName + "值已存在"); + break; + } + realMap.put("parentId", parentId); + realMap.put("organizeIdTree", organizeIdTree); + realMap.put("fullName", fullName); + break; + case "enCode": + if (StringUtil.isEmpty(value)) { + errInfo.add(preName + columnName + "不能为空"); + } + if (value.length() > 50) { + errInfo.add(preName + columnName + "值超出最多输入字符限制"); + } + if (!RegexUtils.checkEnCode(value)) { + errInfo.add(columnName + "只能输入英文、数字和小数点且小数点不能放在首尾"); + } + //库里重复 + long enCodeCount = allOrg.stream().filter(t -> t.getEnCode().equals(value)).count(); + if (enCodeCount > 0) { + errInfo.add(preName + columnName + "值已存在"); + break; + } + //表格内重复 + enCodeCount = addList.stream().filter(t -> t.getEnCode().equals(value)).count(); + if (enCodeCount > 0) { + errInfo.add(preName + columnName + "值已存在"); + break; + } + break; + case "enterpriseNature": + //公司性质 + if (StringUtil.isNotEmpty(value) && isOrg) { + if (enMap.containsKey(valueObj.toString())) { + realMap.put("enterpriseNature", enMap.get(value)); + } else { + errInfo.add("找不到该" + columnName + "值"); + } + } + break; + case "industry": + //所属行业 + if (StringUtil.isNotEmpty(value) && isOrg) { + if (itMap.containsKey(valueObj.toString())) { + realMap.put("industry", itMap.get(value)); + } else { + errInfo.add("找不到该" + columnName + "值"); + } + } + break; + case "foundedTime": + if (StringUtil.isNotEmpty(value) && isOrg) { + Date date = DateUtil.stringToDates(value); + if (date == null) { + errInfo.add(columnName + "值不正确"); + break; + } + realMap.put("foundedTime", date); + } + break; + case "managerId": + if (StringUtil.isNotEmpty(value) && !isOrg) { + if (userNameMap.containsKey(value)) { + realMap.put("managerId", userNameMap.get(value)); + } else { + errInfo.add("找不到该" + columnName); + } + } + if (isOrg) { + realMap.put("managerId", null); + } + break; + case "sortCode": + if (StringUtil.isEmpty(value)) { + realMap.put("sortCode", 0); + break; + } + Long numValue = 0l; + try { + numValue = Long.parseLong(value); + } catch (Exception e) { + errInfo.add(columnName + "值不正确"); + break; + } + if (numValue < 0) { + errInfo.add(columnName + "值不能小于0"); + break; + } + if (numValue > 1000000) { + errInfo.add(columnName + "值不能大于999999"); + break; + } + break; + default: + break; + } + + } + if (errInfo.length() == 0) { + OrganizeEntity organizeEntity = JsonUtil.getJsonToBean(realMap, OrganizeEntity.class); + organizeEntity.setCreatorTime(new Date()); + String uuid = RandomUtil.uuId(); + organizeEntity.setId(uuid); + organizeEntity.setOrganizeIdTree(organizeEntity.getOrganizeIdTree().replace("/", ",")); + newOrgTreeNameAndId.put(eachMap.get("fullName").toString(), organizeEntity.getOrganizeIdTree() + "," + uuid); + if (isOrg) { + OrganizeCrModel propJson = JsonUtil.getJsonToBean(realMap, OrganizeCrModel.class); + organizeEntity.setPropertyJson(JSONObject.toJSONString(propJson)); + } + addList.add(organizeEntity); + } else { + eachMap.put("errorsInfo", errInfo.toString()); + failList.add(eachMap); + } + } + } + + /** + * 获取下拉框 + * + * @return + */ + private Map getOptionMap() { + Map optionMap = new HashMap<>(); + //类型 + String[] typeMap = new String[]{"公司", "部门"}; + optionMap.put("category", typeMap); + //企业性质 + List enList = dictionaryDataApi.getByTypeCodeEnable(DictionaryDataEnum.ENTERPRISE_NATURE.getDictionaryTypeId()); + String[] enterpriseNature = enList.stream().map(DictionaryDataEntity::getFullName).toArray(String[]::new); + optionMap.put("enterpriseNature", enterpriseNature); + //行业类别 + List itList = dictionaryDataApi.getByTypeCodeEnable(DictionaryDataEnum.INDUSTRY_TYPE.getDictionaryTypeId()); + String[] industry = itList.stream().map(DictionaryDataEntity::getFullName).toArray(String[]::new); + optionMap.put("industry", industry); + return optionMap; + } + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-controller/src/main/java/com/yunzhupaas/permission/controller/PermissionGroupController.java b/yunzhupaas-permission/yunzhupaas-permission-controller/src/main/java/com/yunzhupaas/permission/controller/PermissionGroupController.java new file mode 100644 index 0000000..8af2be1 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-controller/src/main/java/com/yunzhupaas/permission/controller/PermissionGroupController.java @@ -0,0 +1,719 @@ +package com.yunzhupaas.permission.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.util.ObjectUtil; +import com.google.common.collect.ImmutableList; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.base.entity.*; +import com.yunzhupaas.base.model.portalManage.PortalModel; +import com.yunzhupaas.base.model.print.PaginationPrint; +import com.yunzhupaas.base.model.print.PrintDevTreeModel; +import com.yunzhupaas.base.model.vo.PrintDevVO; +import com.yunzhupaas.base.service.*; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.constant.PermissionConst; +import com.yunzhupaas.flowable.entity.TemplateEntity; +import com.yunzhupaas.flowable.model.template.TemplateTreeListVo; +import com.yunzhupaas.model.FlowWorkModel; +import com.yunzhupaas.permission.constant.AuthorizeConst; +import com.yunzhupaas.permission.entity.*; +import com.yunzhupaas.permission.model.permissiongroup.*; +import com.yunzhupaas.permission.model.user.UserIdListVo; +import com.yunzhupaas.permission.model.user.mod.UserIdModel; +import com.yunzhupaas.permission.service.*; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.treeutil.SumTree; +import com.yunzhupaas.util.treeutil.newtreeutil.TreeDotUtils; +import com.yunzhupaas.workflow.service.TemplateApi; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; + +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +@RestController +@Tag(name = "权限组控制器", description = "PermissionGroup") +@RequestMapping("/api/permission/PermissionGroup") +public class PermissionGroupController extends SuperController { + + @Autowired + private PermissionGroupService permissionGroupService; + @Autowired + private UserService userService; + @Autowired + private AuthorizeService authorizeService; + @Autowired + private ModuleButtonService buttonApi; + @Autowired + private ModuleColumnService columnApi; + @Autowired + private ModuleFormService formApi; + @Autowired + private ModuleDataAuthorizeSchemeService schemeApi; + @Autowired + private SystemService systemApi; + @Autowired + private ModuleService moduleApi; + @Autowired + private OrganizeService organizeService; + @Autowired + private PositionService positionService; + @Autowired + private RoleService roleService; + @Autowired + private GroupService groupService; + @Autowired + private TemplateApi templateApi; + @Autowired + private DictionaryDataService dictionaryDataApi; + @Autowired + private PrintDevService printDevApi; + + /** + * 列表 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "列表") + @SaCheckPermission("permission.authorize") + @GetMapping + public ActionResult> list(PaginationPermissionGroup pagination) { + List data = permissionGroupService.list(pagination); + List list = JsonUtil.getJsonToList(data, PermissionGroupListVO.class); + list.forEach(t -> { + String permissionMember = t.getPermissionMember(); + if (StringUtil.isEmpty(permissionMember)) { + t.setPermissionMember(""); + return; + } + List fullNameByIds = userService.getFullNameByIds(Arrays.asList(permissionMember.split(","))); + StringJoiner stringJoiner = new StringJoiner(","); + fullNameByIds.forEach(stringJoiner::add); + t.setPermissionMember(stringJoiner.toString()); + }); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(list, paginationVO); + } + + /** + * 下拉选择 + * + * @return + */ + @Operation(summary = "下拉框") + @SaCheckPermission("permission.authorize") + @GetMapping("/Selector") + public ActionResult> list() { + List data = permissionGroupService.list(true, null); + List list = JsonUtil.getJsonToList(data, FlowWorkModel.class); + list.forEach(t -> t.setIcon("icon-ym icon-ym-authGroup")); + ListVO listVO = new ListVO<>(); + listVO.setList(list); + return ActionResult.success(listVO); + } + + /** + * 查看权限成员 + * + * @param id 主键 + * @return + */ + @Operation(summary = "权限成员") + @SaCheckPermission("permission.authorize") + @Parameter(name = "id", description = "主键", required = true) + @GetMapping("/PermissionMember/{id}") + public ActionResult> permissionMember(@PathVariable("id") String id) { + PermissionGroupEntity entity = permissionGroupService.permissionMember(id); + if (entity == null) { + return ActionResult.fail(MsgCode.FA003.get()); + } + ListVO listVO = new ListVO<>(); + List list = new ArrayList<>(); + if (StringUtil.isEmpty(entity.getPermissionMember())) { + listVO.setList(list); + return ActionResult.success(listVO); + } + List ids = Arrays.asList(entity.getPermissionMember().split(",")).stream().distinct().collect(Collectors.toList()); + list = userService.selectedByIds(ids); + listVO.setList(list); + return ActionResult.success(listVO); + } + + /** + * 保存权限成员 + * + * @param id 主键 + * @param userIdModel 用户id模型 + * @return + */ + @Operation(summary = "保存权限成员") + @SaCheckPermission("permission.authorize") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "userIdModel", description = "用户id模型", required = true) + }) + @PostMapping("/PermissionMember/{id}") + public ActionResult> savePermissionMember(@PathVariable("id") String id, @RequestBody UserIdModel userIdModel) { + PermissionGroupEntity entity = permissionGroupService.info(id); + if (entity == null) { + return ActionResult.fail(MsgCode.FA003.get()); + } + //删除退出的用户 + List oldPermission = StringUtil.isNotEmpty(entity.getPermissionMember()) ? Arrays.asList(entity.getPermissionMember().split(",")) : new ArrayList<>(); +// List permission = userIdModel.getIds(); +// List allUpdateIds = oldPermission.stream().filter(t->!permission.contains(t)).collect(Collectors.toList()); + List deleteUser = userService.getUserIdList(oldPermission, null); + //保存新的用户 + StringJoiner stringJoiner = new StringJoiner(","); + List userId = userIdModel.getIds(); + userId.forEach(t -> { + stringJoiner.add(t); + }); + entity.setPermissionMember(stringJoiner.toString()); + // 修改前的用户 + List member = permissionGroupService.list(Collections.singletonList(id)) + .stream().filter(t -> StringUtil.isNotEmpty(t.getPermissionMember())).map(PermissionGroupEntity::getPermissionMember).collect(Collectors.toList()); + // 新的用户 + member.addAll(userId); + member = member.stream().distinct().collect(Collectors.toList()); + List userIdList = userService.getUserIdList(member, null); + permissionGroupService.update(id, entity); + userService.delCurRoleUser(MsgCode.PS010.get(), Collections.singletonList(id)); + //移除权限缓存 + authorizeService.removeAuthByUserOrMenu(deleteUser, null); + return ActionResult.success(MsgCode.SU002.get()); + } + + /** + * 详情 + * + * @param id 主键 + * @return + */ + @Operation(summary = "详情") + @SaCheckPermission("permission.authorize") + @Parameter(name = "id", description = "主键", required = true) + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) { + PermissionGroupEntity entity = permissionGroupService.info(id); + if (entity == null) { + return ActionResult.fail(MsgCode.FA003.get()); + } + PermissionGroupModel model = JsonUtil.getJsonToBean(entity, PermissionGroupModel.class); + return ActionResult.success(model); + } + + /** + * 新建 + * + * @param model 模型 + * @return + */ + @Operation(summary = "新建") + @SaCheckPermission("permission.authorize") + @Parameter(name = "id", description = "模型", required = true) + @PostMapping + public ActionResult crete(@RequestBody PermissionGroupModel model) { + PermissionGroupEntity entity = JsonUtil.getJsonToBean(model, PermissionGroupEntity.class); + if (permissionGroupService.isExistByFullName(entity.getId(), entity)) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (permissionGroupService.isExistByEnCode(entity.getId(), entity)) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + permissionGroupService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 修改 + * + * @param id 主键 + * @param model 模型 + * @return + */ + @Operation(summary = "修改") + @SaCheckPermission("permission.authorize") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "model", description = "模型", required = true) + }) + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody PermissionGroupModel model) { + PermissionGroupEntity entity = JsonUtil.getJsonToBean(model, PermissionGroupEntity.class); + if (permissionGroupService.isExistByFullName(id, entity)) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (permissionGroupService.isExistByEnCode(id, entity)) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + userService.delCurRoleUser(MsgCode.PS010.get(), Collections.singletonList(id)); + permissionGroupService.update(id, entity); + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除") + @SaCheckPermission("permission.authorize") + @Parameter(name = "id", description = "主键", required = true) + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + PermissionGroupEntity entity = permissionGroupService.info(id); + if (entity == null) { + return ActionResult.fail(MsgCode.FA003.get()); + } + userService.delCurRoleUser(MsgCode.PS010.get(), ImmutableList.of(id)); + permissionGroupService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + + /** + * 复制 + * + * @param id 主键 + * @return + */ + @Operation(summary = "复制") + @SaCheckPermission("permission.authorize") + @Parameter(name = "id", description = "主键", required = true) + @PostMapping("/{id}/Actions/Copy") + @Transactional + public ActionResult copy(@PathVariable("id") String id) { + PermissionGroupEntity entity = permissionGroupService.info(id); + if (entity == null) { + return ActionResult.fail(MsgCode.FA004.get()); + } + String copyNum = UUID.randomUUID().toString().substring(0, 5); + entity.setFullName(entity.getFullName() + ".副本" + copyNum); + if (entity.getFullName().length() > 50) return ActionResult.fail(MsgCode.COPY001.get()); + entity.setEnCode(entity.getEnCode() + copyNum); + entity.setId(RandomUtil.uuId()); + entity.setEnabledMark(0); + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(UserProvider.getLoginUserId()); + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + permissionGroupService.save(entity); + // 赋值权限表 + List listByObjectId = authorizeService.getListByObjectId(Collections.singletonList(id)); + listByObjectId.forEach(t -> { + t.setId(RandomUtil.uuId()); + t.setObjectId(entity.getId()); + }); + authorizeService.saveBatch(listByObjectId); + return ActionResult.success(MsgCode.SU007.get()); + } + + + /** + * 获取菜单权限返回权限组 + * + * @param model 模型 + * @return ignore + */ + @Operation(summary = "获取菜单权限返回权限组") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @GetMapping("/getPermissionGroup") + public ActionResult> getPermissionGroup(ViewPermissionsModel model) { + String objectType = model.getObjectType(); + String id = model.getId(); + if (checkDataById(id, objectType)) { + return ActionResult.fail(MsgCode.FA001.get()); + } + Map map = new HashMap<>(2); + int type = 0; // 0未开启权限,1有 + List list = new ArrayList<>(); + List permissionGroupByUserId = permissionGroupService.getPermissionGroupByObjectId(id, objectType); +// List roleId = permissionGroupByUserId.stream().map(PermissionGroupEntity::getId).collect(Collectors.toList()); +// List authorizeByItem = authorizeService.getListByObjectId(roleId); + list = JsonUtil.getJsonToList(permissionGroupByUserId, FlowWorkModel.class); + list.forEach(t -> t.setIcon("icon-ym icon-ym-authGroup")); + if (list.size() > 0) { + type = 1; + } else { + type = 2; + } + map.put("list", list); + map.put("type", type); + return ActionResult.success(map); + } + + /** + * 通过权限组id获取相关权限 + * + * @param model 模型 + * @return ignore + */ + @Operation(summary = "通过权限组id获取相关权限") + @Parameters({ + @Parameter(name = "id", description = "权限组id", required = true) + }) + @GetMapping("/getPermission") + public ActionResult> getPermission(ViewPermissionsModel model) { + String objectType = model.getObjectType(); + String id = model.getId(); + String permissionId = model.getPermissionId(); + if (StringUtil.isEmpty(permissionId)) { + return ActionResult.fail(MsgCode.FA001.get()); + } + // 获取当前菜单开启了哪些权限 + if (checkDataById(id, objectType)) { + return ActionResult.fail(MsgCode.FA001.get()); + } + PermissionGroupEntity permissionGroupEntity = permissionGroupService.info(permissionId); + if (permissionGroupEntity == null) { + return ActionResult.fail(MsgCode.FA001.get()); + } + String itemType = model.getItemType(); + // 权限组的权限 + List authList = authorizeService.getListByObjectId(Collections.singletonList(permissionId)); + List list = new ArrayList<>(); + if (AuthorizeConst.SYSTEM.equals(itemType)) { + list = this.system(authList, itemType); + } else if (AuthorizeConst.MODULE.equals(itemType)) { + list = this.module(authList, itemType); + } else if (AuthorizeConst.BUTTON.equals(itemType)) { + list = this.button(authList, itemType); + } else if (AuthorizeConst.COLUMN.equals(itemType)) { + list = this.column(authList, itemType); + } else if (AuthorizeConst.FROM.equals(itemType)) { + list = this.form(authList, itemType); + } else if (AuthorizeConst.RESOURCE.equals(itemType)) { + list = this.resources(authList, itemType); + } else if (AuthorizeConst.AUTHORIZE_PORTAL_MANAGE.equals(itemType)) { + list = this.portal(authList, itemType); + } else if (AuthorizeConst.FLOW.equals(itemType)) { + list = this.flow(authList, itemType); + } else if (AuthorizeConst.PRINT.equals(itemType)) { + list = this.print(authList, itemType); + } + list = list.stream().sorted(Comparator.comparing(ViewPermissionsTreeModel::getSortCode, Comparator.nullsLast(Comparator.naturalOrder())).thenComparing(ViewPermissionsTreeModel::getCreatorTime, Comparator.nullsLast(Comparator.reverseOrder()))).collect(Collectors.toList()); + List> sumTrees = TreeDotUtils.convertListToTreeDot(list); + List jsonToList = JsonUtil.getJsonToList(sumTrees, ViewPermissionsVO.class); + return ActionResult.success(jsonToList); + } + + /** + * 返回所有系统信息 + * + * @param authList + * @param itemType + * @return + */ + private List system(List authList, String itemType) { + List ids = authList.stream().filter(t -> itemType.equals(t.getItemType())).map(AuthorizeEntity::getItemId).collect(Collectors.toList()); + return JsonUtil.getJsonToList(systemApi.getListByIds(ids, null), ViewPermissionsTreeModel.class); + } + + /** + * 返回所有菜单信息 + * + * @param authList + * @param itemType + * @return + */ + private List module(List authList, String itemType) { + List systemList = this.system(authList, AuthorizeConst.SYSTEM); + systemList.forEach(systemEntity -> systemEntity.setParentId("-1")); + List ids = authList.stream().filter(t -> itemType.equals(t.getItemType())).map(AuthorizeEntity::getItemId).collect(Collectors.toList()); + List moduleByIds = moduleApi.getModuleByIds(ids, null, null, false); + Map> systemGroupMap = moduleByIds.stream().collect(Collectors.groupingBy(ModuleEntity::getSystemId)); + List categoryList = new ArrayList<>(); + Date datetime = new Date(); + if (systemGroupMap != null) { + ids.forEach(systemId -> { + List moduleEntities = systemGroupMap.get(systemId); + if (moduleEntities != null && moduleEntities.size() > 0) { + Map> categoryMap = moduleEntities.stream().collect(Collectors.groupingBy(ModuleEntity::getCategory)); + if (categoryMap != null) { + List webModuleList = categoryMap.get("Web"); + if (webModuleList != null && webModuleList.size() > 0) { + ModuleEntity entity = new ModuleEntity(); + entity.setParentId(webModuleList.get(0).getSystemId()); + entity.setId(webModuleList.get(0).getSystemId() + "1"); + entity.setFullName("WEB菜单"); + entity.setIcon("icon-ym icon-ym-pc"); + entity.setSortCode(-1L); + entity.setCreatorTime(datetime); + categoryList.add(entity); + } + List appModuleList = categoryMap.get("App"); + if (appModuleList != null && appModuleList.size() > 0) { + ModuleEntity entity = new ModuleEntity(); + entity.setParentId(appModuleList.get(0).getSystemId()); + entity.setId(appModuleList.get(0).getSystemId() + "2"); + entity.setFullName("APP菜单"); + entity.setIcon("icon-ym icon-ym-mobile"); + entity.setSortCode(0L); + entity.setCreatorTime(datetime); + categoryList.add(entity); + } + } + } + }); + } + moduleByIds.addAll(categoryList); + moduleByIds.forEach(t -> { + if ("-1".equals(t.getParentId())) { + if ("Web".equals(t.getCategory())) { + t.setParentId(t.getSystemId() + "1"); + } else { + t.setParentId(t.getSystemId() + "2"); + } + } + }); + List moduleList = JsonUtil.getJsonToList(moduleByIds, ViewPermissionsTreeModel.class); + List systemId = moduleByIds.stream().map(ModuleEntity::getSystemId).distinct().collect(Collectors.toList()); + List collect = systemList.stream().filter(t -> systemId.contains(t.getId())).collect(Collectors.toList()); + moduleList.addAll(collect); + return moduleList; + } + + /** + * 返回所有按钮权限信息 + * + * @param authList + * @param itemType + * @return + */ + private List button(List authList, String itemType) { + List module = this.module(authList, AuthorizeConst.MODULE); + List ids = authList.stream().filter(t -> itemType.equals(t.getItemType())).map(AuthorizeEntity::getItemId).collect(Collectors.toList()); + List listByIds = buttonApi.getListByIds(ids); + listByIds.forEach(t -> t.setParentId(t.getModuleId())); + List moduleList = JsonUtil.getJsonToList(listByIds, ViewPermissionsTreeModel.class); + Map moduleModel = module.stream().collect(Collectors.toMap(ViewPermissionsTreeModel::getId, Function.identity())); + // 上级菜单id + List moduleIds = listByIds.stream().map(ModuleButtonEntity::getModuleId).distinct().collect(Collectors.toList()); + moduleIds.forEach(t -> { + ViewPermissionsTreeModel viewPermissionsTreeModel = moduleModel.get(t); + moduleList.add(viewPermissionsTreeModel); + getParentModule(moduleModel, viewPermissionsTreeModel.getParentId(), moduleList); + }); + return moduleList; + } + + /** + * 返回所有列表权限信息 + * + * @param authList + * @param itemType + * @return + */ + private List column(List authList, String itemType) { + List module = this.module(authList, AuthorizeConst.MODULE); + List ids = authList.stream().filter(t -> itemType.equals(t.getItemType())).map(AuthorizeEntity::getItemId).collect(Collectors.toList()); + List listByIds = columnApi.getListByIds(ids); + listByIds.forEach(t -> t.setParentId(t.getModuleId())); + List moduleList = JsonUtil.getJsonToList(listByIds, ViewPermissionsTreeModel.class); + Map moduleModel = module.stream().collect(Collectors.toMap(ViewPermissionsTreeModel::getId, Function.identity())); + // 上级菜单id + List moduleIds = listByIds.stream().map(ModuleColumnEntity::getModuleId).distinct().collect(Collectors.toList()); + moduleIds.forEach(t -> { + ViewPermissionsTreeModel viewPermissionsTreeModel = moduleModel.get(t); + moduleList.add(viewPermissionsTreeModel); + getParentModule(moduleModel, viewPermissionsTreeModel.getParentId(), moduleList); + }); + return moduleList; + } + + /** + * 返回所有表单权限信息 + * + * @param authList + * @param itemType + * @return + */ + private List form(List authList, String itemType) { + List module = this.module(authList, AuthorizeConst.MODULE); + List ids = authList.stream().filter(t -> itemType.equals(t.getItemType())).map(AuthorizeEntity::getItemId).collect(Collectors.toList()); + List listByIds = formApi.getListByIds(ids); + listByIds.forEach(t -> t.setParentId(t.getModuleId())); + List moduleList = JsonUtil.getJsonToList(listByIds, ViewPermissionsTreeModel.class); + Map moduleModel = module.stream().collect(Collectors.toMap(ViewPermissionsTreeModel::getId, Function.identity())); + // 上级菜单id + List moduleIds = listByIds.stream().map(ModuleFormEntity::getModuleId).distinct().collect(Collectors.toList()); + moduleIds.forEach(t -> { + ViewPermissionsTreeModel viewPermissionsTreeModel = moduleModel.get(t); + moduleList.add(viewPermissionsTreeModel); + getParentModule(moduleModel, viewPermissionsTreeModel.getParentId(), moduleList); + }); + return moduleList; + } + + /** + * 返回所有数据权限信息 + * + * @param authList + * @param itemType + * @return + */ + private List resources(List authList, String itemType) { + List module = this.module(authList, AuthorizeConst.MODULE); + List ids = authList.stream().filter(t -> itemType.equals(t.getItemType())).map(AuthorizeEntity::getItemId).collect(Collectors.toList()); + List listByIds = schemeApi.getListByIds(ids); + List moduleList = JsonUtil.getJsonToList(listByIds, ViewPermissionsTreeModel.class); + moduleList.forEach(t -> t.setParentId(t.getModuleId())); + Map moduleModel = module.stream().collect(Collectors.toMap(ViewPermissionsTreeModel::getId, Function.identity())); + // 上级菜单id + List moduleIds = listByIds.stream().map(ModuleDataAuthorizeSchemeEntity::getModuleId).distinct().collect(Collectors.toList()); + moduleIds.forEach(t -> { + ViewPermissionsTreeModel viewPermissionsTreeModel = moduleModel.get(t); + moduleList.add(viewPermissionsTreeModel); + getParentModule(moduleModel, viewPermissionsTreeModel.getParentId(), moduleList); + }); + return moduleList; + } + + private List portal(List authList, String itemType) { + List ids = authList.stream().filter(t -> AuthorizeConst.SYSTEM.equals(t.getItemType())).map(AuthorizeEntity::getItemId).collect(Collectors.toList()); + List myPortalList = new ArrayList<>(); + List mySystemList = systemApi.getListByIds(ids, null); + List collect = authList.stream().filter(t -> itemType.equals(t.getItemType())).map(AuthorizeEntity::getItemId).collect(Collectors.toList()); + if (ObjectUtil.isEmpty(collect)) { + return new ArrayList<>(); + } + authorizeService.getPortal(mySystemList, myPortalList, System.currentTimeMillis(), collect); + return JsonUtil.getJsonToList(myPortalList.stream().sorted(Comparator.comparing(PortalModel::getSortCode).thenComparing(PortalModel::getCreatorTime).reversed()).collect(Collectors.toList()), ViewPermissionsTreeModel.class); + } + + private List flow(List authList, String itemType) { + List listVO = new ArrayList<>(); + List authorizeList = authList.stream().filter(t -> itemType.equals(t.getItemType())).collect(Collectors.toList()); + List itemId = authorizeList.stream().map(AuthorizeEntity::getItemId).distinct().collect(Collectors.toList()); + if (itemId.isEmpty()) { + return listVO; + } + List list = templateApi.getListByFlowIds(itemId); + List category = list.stream().map(TemplateEntity::getCategory).collect(Collectors.toList()); + List dictionName = dictionaryDataApi.getDictionName(category); + List childListAll = new ArrayList<>(); + Long date = System.currentTimeMillis(); + for (DictionaryDataEntity dict : dictionName) { + ViewPermissionsTreeModel vo = JsonUtil.getJsonToBean(dict, ViewPermissionsTreeModel.class); + vo.setSortCode(0L); + vo.setCreatorTime(date); + List childList = list.stream() + .filter(e -> dict.getId().equals(e.getCategory())) + .sorted(Comparator.comparing(TemplateEntity::getSortCode).thenComparing(TemplateEntity::getCreatorTime, Comparator.reverseOrder())).collect(Collectors.toList()); + if (childList.size() > 0) { + listVO.add(vo); + for (TemplateEntity entity : childList) { + ViewPermissionsTreeModel user = JsonUtil.getJsonToBean(entity, ViewPermissionsTreeModel.class); + user.setParentId(dict.getId()); + childListAll.add(user); + } + } + } + listVO.addAll(childListAll); + return listVO; + } + + private List print(List authList, String itemType) { + List listVO = new ArrayList<>(); + List authorizeList = authList.stream().filter(t -> itemType.equals(t.getItemType())).collect(Collectors.toList()); + List itemId = authorizeList.stream().map(AuthorizeEntity::getItemId).distinct().collect(Collectors.toList()); + if (itemId.isEmpty()) { + return listVO; + } + List list = printDevApi.getWorkSelector(itemId); + List category = list.stream().map(PrintDevEntity::getCategory).collect(Collectors.toList()); + List dictionName = dictionaryDataApi.getDictionName(category); + List childListAll = new ArrayList<>(); + Long date = System.currentTimeMillis(); + for (DictionaryDataEntity dict : dictionName) { + ViewPermissionsTreeModel vo = JsonUtil.getJsonToBean(dict, ViewPermissionsTreeModel.class); + vo.setSortCode(0L); + vo.setCreatorTime(date); + List childList = list.stream() + .filter(e -> dict.getId().equals(e.getCategory())) + .sorted(Comparator.comparing(PrintDevEntity::getSortCode).thenComparing(PrintDevEntity::getCreatorTime, Comparator.reverseOrder())).collect(Collectors.toList()); + if (childList.size() > 0) { + listVO.add(vo); + for (PrintDevEntity entity : childList) { + ViewPermissionsTreeModel user = JsonUtil.getJsonToBean(entity, ViewPermissionsTreeModel.class); + user.setParentId(dict.getId()); + childListAll.add(user); + } + } + } + listVO.addAll(childListAll); + return listVO; + } + + /** + * 获取上级菜单 + * + * @param moduleModel + * @param parentId + * @param moduleList + */ + private void getParentModule(Map moduleModel, String parentId, List moduleList) { + if (!"-1".equals(parentId)) { + if (moduleModel.get(parentId) != null) { + moduleList.add(moduleModel.get(parentId)); + this.getParentModule(moduleModel, moduleModel.get(parentId).getParentId(), moduleList); + } + } + } + + /** + * 验证对象数据是否存在 + * + * @param id + * @param objectType + * @return + */ + private boolean checkDataById(String id, String objectType) { + if (PermissionConst.COMPANY.equals(objectType) || PermissionConst.DEPARTMENT.equals(objectType)) { + // 获取当前菜单开启了哪些权限 + OrganizeEntity entity = organizeService.getInfo(id); + if (entity == null) { + return true; + } + } else if ("position".equals(objectType)) { + PositionEntity entity = positionService.getInfo(id); + if (entity == null) { + return true; + } + } else if ("user".equals(objectType)) { + UserEntity entity = userService.getInfo(id); + if (entity == null) { + return true; + } + } else if ("role".equals(objectType)) { + RoleEntity entity = roleService.getInfo(id); + if (entity == null) { + return true; + } + } else if ("group".equals(objectType)) { + GroupEntity entity = groupService.getInfo(id); + if (entity == null) { + return true; + } + } else { + return true; + } + return false; + } + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-controller/src/main/java/com/yunzhupaas/permission/controller/PositionController.java b/yunzhupaas-permission/yunzhupaas-permission-controller/src/main/java/com/yunzhupaas/permission/controller/PositionController.java new file mode 100644 index 0000000..8eb5ff0 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-controller/src/main/java/com/yunzhupaas/permission/controller/PositionController.java @@ -0,0 +1,976 @@ +package com.yunzhupaas.permission.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import com.alibaba.fastjson.JSONArray; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.annotation.PositionPermission; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.service.DictionaryDataService; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.constant.PermissionConst; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.model.ExcelColumnAttr; +import com.yunzhupaas.model.ExcelImportForm; +import com.yunzhupaas.model.ExcelImportVO; +import com.yunzhupaas.model.ExcelModel; +import com.yunzhupaas.permission.constant.PosColumnMap; +import com.yunzhupaas.permission.entity.*; +import com.yunzhupaas.permission.model.check.CheckResult; +import com.yunzhupaas.permission.model.permission.PermissionModel; +import com.yunzhupaas.permission.model.position.*; +import com.yunzhupaas.permission.model.user.UserIdListVo; +import com.yunzhupaas.permission.model.user.mod.UserIdModel; +import com.yunzhupaas.permission.service.*; +import com.yunzhupaas.base.util.ExcelTool; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.enums.DictionaryDataEnum; +import com.yunzhupaas.util.treeutil.ListToTreeUtil; +import com.yunzhupaas.util.treeutil.SumTree; +import com.yunzhupaas.util.treeutil.newtreeutil.TreeDotUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; +import java.io.IOException; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 岗位信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +@Tag(name = "岗位管理", description = "Position") +@RestController +@RequestMapping("/api/permission/Position") +public class PositionController extends SuperController { + @Autowired + private UserRelationService userRelationService; + @Autowired + private UserService userService; + @Autowired + private PositionService positionService; + @Autowired + private OrganizeService organizeService; + @Autowired + private DictionaryDataService dictionaryDataApi; + @Autowired + private OrganizeRelationService organizeRelationService; + @Autowired + private ConfigValueUtil configValueUtil; + + /** + * 获取岗位管理信息列表 + * + * @param paginationPosition 分页模型 + * @return + */ + @Operation(summary = "获取岗位列表(分页)") + @SaCheckPermission("permission.position") + @GetMapping + public ActionResult> list(PaginationPosition paginationPosition) { + List dictionaryDataEntities = dictionaryDataApi.getListByTypeDataCode(DictionaryDataEnum.POSITION_TYPE.getDictionaryTypeId()); + if (StringUtil.isNotEmpty(paginationPosition.getType())) { + DictionaryDataEntity dictionaryDataEntity = dictionaryDataEntities.stream().filter(t -> paginationPosition.getType().equals(t.getId())).findFirst().orElse(null); + if (dictionaryDataEntity != null) { + paginationPosition.setEnCode(dictionaryDataEntity.getEnCode()); + } + } + List data = positionService.getList(paginationPosition); + //添加部门信息,部门映射到organizeId + List voList = JsonUtil.getJsonToList(data, PositionListVO.class); + List collect = data.stream().map(PositionEntity::getOrganizeId).collect(Collectors.toList()); + List list = organizeService.getOrgEntityList(collect, true); + //添加部门信息 + Map orgIdNameMaps = organizeService.getInfoList(); + for (PositionListVO entity1 : voList) { + OrganizeEntity entity = list.stream().filter(t -> t.getId().equals(entity1.getOrganizeId())).findFirst().orElse(new OrganizeEntity()); + if (entity1.getOrganizeId().equals(entity.getId())) { + entity1.setDepartment(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, entity.getOrganizeIdTree(), "/")); + } + } + //将type成中文名 + for (PositionListVO entity1 : voList) { + dictionaryDataEntities.stream().filter(t -> t.getEnCode().equals(entity1.getType())).findFirst().ifPresent(entity -> entity1.setType(entity.getFullName())); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(paginationPosition, PaginationVO.class); + return ActionResult.page(voList, paginationVO); + } + + /** + * 列表 + * + * @return + */ + @Operation(summary = "列表") + @GetMapping("/All") + public ActionResult> listAll() { + List list = positionService.getList(true); + List vos = JsonUtil.getJsonToList(list, PositionListAllVO.class); + ListVO vo = new ListVO<>(); + vo.setList(vos); + return ActionResult.success(vo); + } + + /** + * 树形(机构+岗位) + * + * @return + */ + @Operation(summary = "获取岗位下拉列表(公司+部门+岗位)") + @GetMapping("/Selector") + public ActionResult> selector() { + List list1 = positionService.getList(true); + Map orgMaps = organizeService.getOrgMaps(null, false, null); + Map orgIdNameMaps = organizeService.getInfoList(); + List list2 = new ArrayList<>(orgMaps.values()); + ; + List posList = new ArrayList<>(); + for (PositionEntity entity : list1) { + PosOrgModel posOrgModel = JsonUtil.getJsonToBean(entity, PosOrgModel.class); + String organizeId = entity.getOrganizeId(); + posOrgModel.setParentId(organizeId); + posOrgModel.setType("position"); + posOrgModel.setIcon("icon-ym icon-ym-tree-position1"); + OrganizeEntity organizeEntity = orgMaps.get(organizeId); + if (organizeEntity != null) { + posOrgModel.setOrganize(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, organizeEntity.getOrganizeIdTree(), "/")); + posOrgModel.setOrganizeIds(organizeService.getOrgIdTree(organizeEntity)); + } else { + posOrgModel.setOrganizeIds(new ArrayList<>()); + } + posList.add(posOrgModel); + } + List orgList = JsonUtil.getJsonToList(list2, PosOrgModel.class); + for (PosOrgModel entity1 : orgList) { + if ("department".equals(entity1.getType())) { + entity1.setIcon("icon-ym icon-ym-tree-department1"); + } else if ("company".equals(entity1.getType())) { + entity1.setIcon("icon-ym icon-ym-tree-organization3"); + } + OrganizeEntity organizeEntity = orgMaps.get(entity1.getId()); + if (organizeEntity != null) { + entity1.setOrganize(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, organizeEntity.getOrganizeIdTree(), "/")); + entity1.setOrganizeIds(organizeService.getOrgIdTree(organizeEntity)); + } else { + entity1.setOrganizeIds(new ArrayList<>()); + } + entity1.setOrganizeIds(new ArrayList<>()); + } + JSONArray objects = ListToTreeUtil.treeWhere(posList, orgList); + List jsonToList = JsonUtil.getJsonToList(objects, PosOrgModel.class); + + List list = new ArrayList<>(16); + // 得到角色的值 + List collect = jsonToList.stream().filter(t -> "position".equals(t.getType())).sorted(Comparator.comparing(PosOrgModel::getSortCode)).collect(Collectors.toList()); + list.addAll(collect); + jsonToList.removeAll(collect); + List collect1 = jsonToList.stream().sorted(Comparator.comparing(PosOrgModel::getSortCode).thenComparing(PosOrgModel::getCreatorTime, Comparator.reverseOrder())).collect(Collectors.toList()); + list.addAll(collect1); + + List> trees = TreeDotUtils.convertListToTreeDot(list); + List jsonToList1 = JsonUtil.getJsonToList(trees, PositionSelectorVO.class); + ListVO vo = new ListVO(); + vo.setList(jsonToList1); + return ActionResult.success(vo); + } + + /** + * 通过部门、岗位获取岗位下拉框 + * + * @param idModel 岗位选择模型 + * @return + */ + @Operation(summary = "通过部门、岗位获取岗位下拉框") + @Parameters({ + @Parameter(name = "positionConditionModel", description = "岗位选择模型", required = true) + }) + @PostMapping("/PositionCondition") + public ActionResult> positionCondition(@RequestBody UserIdModel idModel) { + // 定义返回对象 + List modelList = new ArrayList<>(); + + List list = organizeRelationService.getOrgIds(idModel.getIds(), null); + List lists = new ArrayList<>(); + list.forEach(t -> lists.add(t.split("--")[0])); + list = lists; + List collect = positionService.getListByOrganizeId(list, false).stream().map(PositionEntity::getId).collect(Collectors.toList()); + collect.addAll(list); + List positionName = positionService.getPositionName(collect, null); + positionName = positionName.stream().filter(t -> "1".equals(String.valueOf(t.getEnabledMark()))).collect(Collectors.toList()); + + Map orgMaps = organizeService.getOrganizeName(positionName.stream().map(PositionEntity::getOrganizeId).collect(Collectors.toList()), null, false, null); + Map orgIdNameMaps = organizeService.getInfoList(); + + List posOrgModels = new ArrayList<>(16); + positionName.forEach(t -> { + PosOrgConditionModel posOrgModel = JsonUtil.getJsonToBean(t, PosOrgConditionModel.class); + OrganizeEntity entity = orgMaps.get(t.getOrganizeId()); + if (entity != null) { + posOrgModel.setOrganizeId(entity.getId()); + posOrgModel.setParentId(entity.getId()); + if (StringUtil.isNotEmpty(entity.getOrganizeIdTree())) { + posOrgModel.setOrganize(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, entity.getOrganizeIdTree(), "/")); + } + } + posOrgModel.setType("position"); + posOrgModel.setIcon("icon-ym icon-ym-tree-position1"); + posOrgModels.add(posOrgModel); + }); + + // 处理组织 + orgMaps.values().forEach(org -> { + PosOrgConditionModel orgVo = JsonUtil.getJsonToBean(org, PosOrgConditionModel.class); + if ("department".equals(orgVo.getType())) { + orgVo.setIcon("icon-ym icon-ym-tree-department1"); + } else if ("company".equals(orgVo.getType())) { + orgVo.setIcon("icon-ym icon-ym-tree-organization3"); + } + // 处理断层 + if (StringUtil.isNotEmpty(org.getOrganizeIdTree())) { + List list1 = new ArrayList<>(); + String[] split = org.getOrganizeIdTree().split(","); + list1 = Arrays.asList(split); + Collections.reverse(list1); + for (String orgId : list1) { + OrganizeEntity organizeEntity1 = orgMaps.get(orgId); + if (organizeEntity1 != null && !organizeEntity1.getId().equals(orgVo.getId())) { + orgVo.setParentId(organizeEntity1.getId()); + String[] split1 = org.getOrganizeIdTree().split(organizeEntity1.getId()); + if (split1.length > 1) { + orgVo.setFullName(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, split1[1], "/")); + } + break; + } + } + } + posOrgModels.add(orgVo); + }); + + List> trees = TreeDotUtils.convertListToTreeDot(posOrgModels); + List positionSelectorVO = JsonUtil.getJsonToList(trees, PositionSelectorVO.class); + // 处理数据 + positionSelectorVO.forEach(t -> { + if (!"position".equals(t.getType())) { + t.setFullName(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, t.getOrganizeIdTree(), "/")); + } + }); + modelList.addAll(positionSelectorVO); + ListVO vo = new ListVO(); + vo.setList(modelList); + return ActionResult.success(vo); + } + + /** + * 通过组织id获取岗位列表 + * + * @param organizeId 主键值 + * @return + */ + @Operation(summary = "通过组织id获取岗位列表") + @Parameters({ + @Parameter(name = "organizeId", description = "主键值", required = true) + }) + @SaCheckPermission("permission.position") + @GetMapping("/getList/{organizeId}") + public ActionResult> getListByOrganizeId(@PathVariable("organizeId") String organizeId) { + List list = positionService.getListByOrganizeId(Collections.singletonList(organizeId), false); + List jsonToList = JsonUtil.getJsonToList(list, PositionVo.class); + return ActionResult.success(jsonToList); + } + + /** + * 获取岗位管理信息 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "获取岗位管理信息") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("permission.position") + @GetMapping("/{id}") + public ActionResult getInfo(@PathVariable("id") String id) throws DataException { + PositionEntity entity = positionService.getInfo(id); + PositionInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, PositionInfoVO.class); + String organizeId = entity.getOrganizeId(); + OrganizeEntity organizeEntity = organizeService.getInfo(organizeId); + vo.setOrganizeIdTree(StringUtil.isNotEmpty(organizeEntity.getOrganizeIdTree()) ? Arrays.asList(organizeEntity.getOrganizeIdTree().split(",")) : new ArrayList<>()); + return ActionResult.success(vo); + } + + + /** + * 新建岗位管理 + * + * @param positionCrForm 实体对象 + * @return + */ + @PositionPermission + @Operation(summary = "新建岗位管理") + @Parameters({ + @Parameter(name = "positionCrForm", description = "实体对象", required = true) + }) + @SaCheckPermission("permission.position") + @PostMapping + public ActionResult create(@RequestBody @Valid PositionCrForm positionCrForm) { + PositionEntity entity = JsonUtil.getJsonToBean(positionCrForm, PositionEntity.class); + if (positionService.isExistByFullName(entity, false)) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (positionService.isExistByEnCode(entity, false)) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + // 设置岗位id + entity.setId(RandomUtil.uuId()); +// createOrganizeRoleRelation(entity.getOrganizeId(), entity.getId()); + positionService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 更新岗位管理 + * + * @param id 主键值 + * @param positionUpForm 实体对象 + * @return + */ + @PositionPermission + @Operation(summary = "更新岗位管理") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true), + @Parameter(name = "positionUpForm", description = "实体对象", required = true) + }) + @SaCheckPermission("permission.position") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid PositionUpForm positionUpForm) { + PositionEntity positionEntity = positionService.getInfo(id); + if (positionEntity == null) { + return ActionResult.fail(MsgCode.FA003.get()); + } + // 当岗位绑定用户不让其更改 + if (userRelationService.existByObj(PermissionConst.POSITION, id)) { + if (!positionService.getInfo(id).getOrganizeId().equals(positionUpForm.getOrganizeId())) { + return ActionResult.fail(MsgCode.FA023.get()); + } + if (positionUpForm.getEnabledMark() == 0 && positionEntity.getEnabledMark() == 1) { + return ActionResult.fail(MsgCode.FA030.get()); + } + } + PositionEntity entity = JsonUtil.getJsonToBean(positionUpForm, PositionEntity.class); + entity.setId(id); + if (positionService.isExistByFullName(entity, true)) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (positionService.isExistByEnCode(entity, true)) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } +// createOrganizeRoleRelation(entity.getOrganizeId(), id); + boolean flag = positionService.update(id, entity); + if (flag == false) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除岗位管理 + * + * @param id 主键值 + * @return + */ + @PositionPermission + @Operation(summary = "删除岗位管理") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("permission.position") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + // 当岗位绑定用户不让其更改 + if (userRelationService.existByObj(PermissionConst.POSITION, id)) { + return ActionResult.fail(MsgCode.FA024.get()); + } + PositionEntity entity = positionService.getInfo(id); + if (entity != null) { + List userRelList = userRelationService.getListByObjectId(id); + if (userRelList.size() > 0) { + return ActionResult.fail(MsgCode.FA024.get()); + } + for (UserRelationEntity entity1 : userRelList) { + UserEntity entity2 = userService.getById(entity1.getUserId()); + if (entity2 != null) { + String newPositionId = entity2.getPositionId().replace(id, ""); + if (entity2.getPositionId().contains(id)) { + if (newPositionId.length() != 0 && newPositionId.substring(0, 1).equals(",")) { + entity2.setPositionId(newPositionId.substring(1)); + } else if (newPositionId.length() != 0) { + entity2.setPositionId(newPositionId.replace(",,", ",")); + } + } + } + } + userRelationService.deleteAllByObjId(id); + + // 删除岗位与组织之间的关联数据 + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(OrganizeRelationEntity::getObjectType, PermissionConst.POSITION); + query.lambda().eq(OrganizeRelationEntity::getObjectId, id); + organizeRelationService.remove(query); + + positionService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + /** + * 更新菜单状态 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "更新菜单状态") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("permission.position") + @PutMapping("/{id}/Actions/State") + public ActionResult upState(@PathVariable("id") String id) { + PositionEntity entity = positionService.getInfo(id); + if (entity != null) { + if (entity.getEnabledMark() == null || "1".equals(String.valueOf(entity.getEnabledMark()))) { + entity.setEnabledMark(0); + } else { + entity.setEnabledMark(1); + } + positionService.update(id, entity); + return ActionResult.success(MsgCode.SU004.get()); + } + return ActionResult.fail(MsgCode.FA001.get()); + } + + /** + * 通过组织id获取岗位列表 + * + * @param organizeIds 组织id数组 + * @return 岗位列表 + */ + @Operation(summary = "获取岗位列表通过组织id数组") + @Parameters({ + @Parameter(name = "organizeIds", description = "组织id数组", required = true) + }) + @SaCheckPermission("permission.position") + @PostMapping("/getListByOrgIds") + public ActionResult> getListByOrganizeIds(@RequestBody @Valid Map> organizeIds) { + List PositionModelAll = new LinkedList<>(); + if (organizeIds.get("organizeIds") != null) { + List ids = organizeIds.get("organizeIds"); + PositionModelAll = positionService.getListByOrganizeIds(ids, false,true); + } + ListVO vo = new ListVO(); + vo.setList(PositionModelAll); + return ActionResult.success(vo); + } + + /** + * 添加组织角色关联关系 + * + * @param organizeId 组织id + * @param positionId 岗位id + */ + private void createOrganizeRoleRelation(String organizeId, String positionId) { + // 清除之前的关联关系 + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(OrganizeRelationEntity::getObjectType, PermissionConst.POSITION); + query.lambda().eq(OrganizeRelationEntity::getObjectId, positionId); + organizeRelationService.remove(query); + // 添加与组织的关联关系 + OrganizeRelationEntity organizeRelationEntity = new OrganizeRelationEntity(); + organizeRelationEntity.setId(RandomUtil.uuId()); + organizeRelationEntity.setOrganizeId(organizeId); + organizeRelationEntity.setObjectType(PermissionConst.POSITION); + organizeRelationEntity.setObjectId(positionId); + organizeRelationService.save(organizeRelationEntity); + } + + /** + * 获取列表 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取列表") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @GetMapping("/SelectAsyncList/{id}") + public ActionResult selectAsyncList(@PathVariable("id") String id,PaginationPosition pagination) { + List listVO = new ArrayList<>(); + Map orgIdNameMaps = organizeService.getInfoList(); + Map orgMaps = organizeService.getOrgMaps(null, true, null); + List organizeList = organizeRelationService.getRelationListByType(PermissionConst.POSITION); + boolean isKeyWord = StringUtil.isNotEmpty(pagination.getKeyword()); + if(isKeyWord) { + List objectId = organizeList.stream().map(OrganizeRelationEntity::getObjectId).collect(Collectors.toList()); + List list = positionService.getList(objectId, pagination, true); + for (PositionEntity entity : list) { + PositionSelectorVO vo =new PositionSelectorVO(); + vo.setId(entity.getId()); + vo.setFullName(entity.getFullName()); + vo.setType("position"); + vo.setIcon("icon-ym icon-ym-tree-position1"); + vo.setHasChildren(false); + vo.setOnlyId(UUID.randomUUID().toString()); + List relationList = organizeList.stream().filter(t -> t.getObjectId().equals(entity.getId())).collect(Collectors.toList()); + StringJoiner orgName = new StringJoiner(","); + List organizeId = new ArrayList<>(); + relationList.forEach(organizeRelationEntity -> { + OrganizeEntity organizeEntity = organizeService.getInfo(organizeRelationEntity.getOrganizeId()); + if (organizeEntity != null) { + String fullNameByOrgIdTree = organizeService.getFullNameByOrgIdTree(orgIdNameMaps, organizeEntity.getOrganizeIdTree(), "/"); + orgName.add(fullNameByOrgIdTree); + organizeId.addAll(organizeService.getOrgIdTree(organizeEntity)); + } + }); + vo.setOrganize(orgName.toString()); + vo.setOrganizeIds(organizeId); + listVO.add(vo); + } + }else { + if (!"0".equals(id)) { + List objectId = organizeList.stream().filter(t -> t.getOrganizeId().equals(id)).map(OrganizeRelationEntity::getObjectId).collect(Collectors.toList()); + List list = positionService.getList(objectId, pagination, false); + for (PositionEntity entity : list) { + PositionSelectorVO vo =JsonUtil.getJsonToBean(entity,PositionSelectorVO.class); + vo.setType("position"); + vo.setIcon("icon-ym icon-ym-tree-position1"); + vo.setHasChildren(false); + vo.setOnlyId(UUID.randomUUID().toString()); + OrganizeRelationEntity relationEntity = organizeList.stream().filter(t -> t.getOrganizeId().equals(id)).findFirst().orElse(null); + List organizeId = new ArrayList<>(); + if(relationEntity!=null){ + OrganizeEntity organizeEntity = orgMaps.get(relationEntity.getOrganizeId()); + if(organizeEntity!=null){ + vo.setOrganize(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, organizeEntity.getOrganizeIdTree(), "/")); + organizeId.addAll(organizeService.getOrgIdTree(organizeEntity)); + } + } + vo.setOrganizeIds(organizeId); + listVO.add(vo); + } + //单个组织 + List collect = new ArrayList<>(orgMaps.values()); + OrganizeEntity organizeEntity = orgMaps.get(id); + if(organizeEntity!=null){ + List collect1 = collect.stream().filter(t -> t.getParentId().equals(organizeEntity.getId())).collect(Collectors.toList()); + for (OrganizeEntity entity : collect1) { + PositionSelectorVO vo = JsonUtil.getJsonToBean(entity, PositionSelectorVO.class); + vo.setIcon("company".equals(entity.getCategory()) ? "icon-ym icon-ym-tree-organization3" : "icon-ym icon-ym-tree-department1"); + vo.setOrganize(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, entity.getOrganizeIdTree(), "/")); + vo.setOrganizeIds(organizeService.getOrgIdTree(entity)); + vo.setHasChildren(true); + listVO.add(vo); + } + } + } else { + List list = new ArrayList<>(orgMaps.values()).stream().filter(t->"-1".equals(t.getParentId()) && Objects.equals(t.getEnabledMark(),1)).collect(Collectors.toList()); + for (OrganizeEntity entity : list) { + PositionSelectorVO vo =JsonUtil.getJsonToBean(entity,PositionSelectorVO.class); + vo.setType(entity.getCategory()); + vo.setIcon("company".equals(entity.getCategory()) ? "icon-ym icon-ym-tree-organization3" : "icon-ym icon-ym-tree-department1"); + vo.setOnlyId(UUID.randomUUID().toString()); + vo.setOrganize(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, entity.getOrganizeIdTree(), "/")); + vo.setOrganizeIds(organizeService.getOrgIdTree(entity)); + vo.setHasChildren(true); + listVO.add(vo); + } + } + } + ListVO vo = new ListVO(); + vo.setList(listVO); + if(!isKeyWord){ + return ActionResult.success(vo); + } + PaginationVO jsonToBean = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(listVO, jsonToBean); + } + + /** + * 获取选中值 + * + * @return ignore + */ + @Operation(summary = "获取选中值") + @Parameters({ + @Parameter(name = "userIdModel", description = "id", required = true) + }) + @PostMapping("/SelectedList") + public ActionResult> SelectedList(@RequestBody UserIdModel userIdModel) { + List ids = new ArrayList<>(); + for(String id : userIdModel.getIds()){ + ids.add(id+"--"+PermissionConst.POSITION); + } + List list = userService.selectedByIds(ids); + ListVO listVO = new ListVO<>(); + listVO.setList(list); + return ActionResult.success(listVO); + } + + /** + * 模板下载 + * + * @return + */ + @Operation(summary = "模板下载") + @SaCheckPermission("permission.position") + @GetMapping("/TemplateDownload") + public ActionResult TemplateDownload() { + PosColumnMap columnMap = new PosColumnMap(); + String excelName = columnMap.getExcelName(); + Map keyMap = columnMap.getColumnByType(0); + List models = columnMap.getFieldsModel(false); + List> list = columnMap.getDefaultList(); + Map optionMap = getOptionMap(); + ExcelModel excelModel = ExcelModel.builder().models(models).selectKey(new ArrayList<>(keyMap.keySet())).optionMap(optionMap).build(); + DownloadVO vo = ExcelTool.getImportTemplate(configValueUtil.getTemporaryFilePath(), excelName, keyMap, list, excelModel); + return ActionResult.success(vo); + } + + /** + * 上传Excel + * + * @return + */ + @Operation(summary = "上传导入Excel") + @SaCheckPermission("permission.position") + @PostMapping("/Uploader") + public ActionResult Uploader() { + return ExcelTool.uploader(); + } + + /** + * 导入预览 + * + * @return + */ + @Operation(summary = "导入预览") + @SaCheckPermission("permission.position") + @GetMapping("/ImportPreview") + public ActionResult> ImportPreview(String fileName) throws Exception { + // 导入字段 + PosColumnMap columnMap = new PosColumnMap(); + Map keyMap = columnMap.getColumnByType(0); + Map headAndDataMap = ExcelTool.importPreview(configValueUtil.getTemporaryFilePath(), fileName, keyMap); + return ActionResult.success(headAndDataMap); + } + + /** + * 导出异常报告 + * + * @return + */ + @Operation(summary = "导出异常报告") + @SaCheckPermission("permission.position") + @PostMapping("/ExportExceptionData") + public ActionResult ExportExceptionData(@RequestBody ExcelImportForm visualImportModel) { + String temporaryFilePath = configValueUtil.getTemporaryFilePath(); + List> dataList = visualImportModel.getList(); + PosColumnMap columnMap = new PosColumnMap(); + String excelName = columnMap.getExcelName(); + Map keyMap = columnMap.getColumnByType(0); + List models = columnMap.getFieldsModel(true); + ExcelModel excelModel = ExcelModel.builder().optionMap(getOptionMap()).models(models).build(); + DownloadVO vo = ExcelTool.exportExceptionReport(temporaryFilePath, excelName, keyMap, dataList, excelModel); + return ActionResult.success(vo); + } + + /** + * 导入数据 + * + * @return + */ + @Operation(summary = "导入数据") + @SaCheckPermission("permission.position") + @PostMapping("/ImportData") + public ActionResult ImportData(@RequestBody ExcelImportForm visualImportModel) throws Exception { + List> listData = new ArrayList<>(); + List> headerRow = new ArrayList<>(); + if (visualImportModel.isType()){ + ActionResult result = ImportPreview(visualImportModel.getFileName()); + if (result == null){ + throw new Exception(MsgCode.FA018.get()); + } + if (result.getCode() != 200){ + throw new Exception(result.getMsg()); + } + if (result.getData() instanceof Map){ + Map data = (Map) result.getData(); + listData = (List>) data.get("dataRow"); + headerRow = (List>) data.get("headerRow"); + } + }else { + listData = visualImportModel.getList(); + } + List addList = new ArrayList(); + List> failList = new ArrayList<>(); + // 对数据做校验 + this.validateImportData(listData, addList, failList); + + //正常数据插入 + for (PositionEntity each : addList) { + positionService.create(each); + } + ExcelImportVO importModel = new ExcelImportVO(); + importModel.setSnum(addList.size()); + importModel.setFnum(failList.size()); + importModel.setResultType(failList.size() > 0 ? 1 : 0); + importModel.setFailResult(failList); + importModel.setHeaderRow(headerRow); + return ActionResult.success(importModel); + } + + /** + * 导出Excel + * + * @return + */ + @Operation(summary = "导出Excel") + @SaCheckPermission("permission.position") + @GetMapping("/ExportData") + public ActionResult ExportData(PaginationPosition paginationPosition) throws IOException { + if (StringUtil.isEmpty(paginationPosition.getSelectKey())) { + return ActionResult.fail(MsgCode.IMP011.get()); + } + List dictionaryDataEntities = dictionaryDataApi.getListByTypeDataCode(DictionaryDataEnum.POSITION_TYPE.getDictionaryTypeId()); + if (StringUtil.isNotEmpty(paginationPosition.getType())) { + DictionaryDataEntity dictionaryDataEntity = dictionaryDataEntities.stream().filter(t -> paginationPosition.getType().equals(t.getId())).findFirst().orElse(null); + if (dictionaryDataEntity != null) { + paginationPosition.setEnCode(dictionaryDataEntity.getEnCode()); + } + } + List dataList = positionService.getList(paginationPosition); + //组织部门 + List collect = dataList.stream().map(PositionEntity::getOrganizeId).collect(Collectors.toList()); + List list = organizeService.getOrgEntityList(collect, true); + Map orgIdNameMaps = organizeService.getInfoList(); + + List> realList = new ArrayList<>(); + for (PositionEntity entity : dataList) { + Map positionMap = JsonUtil.entityToMap(entity); + //组织 + OrganizeEntity organizeEntity = list.stream().filter(t -> t.getId().equals(entity.getOrganizeId())).findFirst().orElse(new OrganizeEntity()); + if (entity.getOrganizeId().equals(organizeEntity.getId())) { + positionMap.put("organizeId", organizeService.getFullNameByOrgIdTree(orgIdNameMaps, organizeEntity.getOrganizeIdTree(), "/")); + } + //岗位类型 + DictionaryDataEntity dictionaryDataEntity = dictionaryDataEntities.stream().filter(t -> t.getEnCode().equals(entity.getType()) && "1".equals(String.valueOf(t.getEnabledMark())) && t.getDeleteMark() == null).findFirst().orElse(null); + if (dictionaryDataEntity != null) { + positionMap.put("type", dictionaryDataEntity.getFullName()); + } else { + positionMap.put("type", ""); + } + positionMap.put("enabledMark", "1".equals(String.valueOf(entity.getEnabledMark())) ? "启用" : "禁用"); + realList.add(positionMap); + } + String[] keys = !StringUtil.isEmpty(paginationPosition.getSelectKey()) ? paginationPosition.getSelectKey() : new String[0]; + PosColumnMap posColumnMap = new PosColumnMap(); + String excelName = posColumnMap.getExcelName(); + List models = posColumnMap.getFieldsModel(false); + Map keyMap = posColumnMap.getColumnByType(null); + ExcelModel excelModel = ExcelModel.builder().selectKey(Arrays.asList(keys)).models(models).optionMap(null).build(); + DownloadVO vo = ExcelTool.creatModelExcel(configValueUtil.getTemporaryFilePath(), excelName, keyMap, realList, excelModel); + return ActionResult.success(vo); + } + + private void validateImportData(List> listData, List addList, List> failList) { + PosColumnMap columnMap = new PosColumnMap(); + Map keyMap = columnMap.getColumnByType(0); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().isNull(PositionEntity::getDeleteMark); + queryWrapper.lambda().orderByAsc(PositionEntity::getSortCode).orderByDesc(PositionEntity::getCreatorTime); + List allPositionList = positionService.list(queryWrapper); + List typeDictionaryList = dictionaryDataApi.getListByTypeDataCode(DictionaryDataEnum.POSITION_TYPE.getDictionaryTypeId()); + Map allOrgsTreeName = organizeService.getAllOrgsTreeName(); + for (int i = 0, len = listData.size(); i < len; i++) { + Map eachMap = listData.get(i); + Map realMap = JsonUtil.getJsonToBean(eachMap, Map.class); + StringJoiner errInfo = new StringJoiner(","); + boolean checkOrganizeIdPass = false; + for (String column : keyMap.keySet()) { + Object valueObj = eachMap.get(column); + String value = valueObj == null ? null : String.valueOf(valueObj); + String columnName = keyMap.get(column); + switch (column) { + case "organizeId": + if (StringUtil.isEmpty(value)) { + errInfo.add(columnName + "不能为空"); + break; + } + CheckResult organizeIdCheckResult = checkOrganizeId(value, allOrgsTreeName); + if (!organizeIdCheckResult.isPass()) { + errInfo.add("找不到该所属组织"); + break; + } + realMap.put("organizeId", organizeIdCheckResult.getValue()); + checkOrganizeIdPass = true; + break; + case "fullName": + if (StringUtil.isEmpty(value)) { + errInfo.add(columnName + "不能为空"); + break; + } + if (value.length() > 50) { + errInfo.add(columnName + "值超出最多输入字符限制"); + } + //值不能含有特殊符号 + if (!RegexUtils.checkSpecoalSymbols(value)) { + errInfo.add(columnName + "值不能含有特殊符号"); + } + //组织不通过 + if (!checkOrganizeIdPass) { + break; + } + String thisOrganizeId = (String) realMap.get("organizeId"); + //库里重复 + long fullNameCount = allPositionList.stream().filter(t -> t.getOrganizeId().equals(thisOrganizeId) && t.getFullName().equals(value)).count(); + if (fullNameCount > 0) { + errInfo.add(columnName + "值已存在"); + break; + } + //表格内重复 + fullNameCount = addList.stream().filter(t -> t.getOrganizeId().equals(thisOrganizeId) && t.getFullName().equals(value)).count(); + if (fullNameCount > 0) { + errInfo.add(columnName + "值已存在"); + break; + } + break; + case "enCode": + if (StringUtil.isEmpty(value)) { + errInfo.add(columnName + "不能为空"); + break; + } + if (value.length() > 50) { + errInfo.add(columnName + "值超出最多输入字符限制"); + } + if(!RegexUtils.checkEnCode(value)){ + errInfo.add(columnName + "只能输入英文、数字和小数点且小数点不能放在首尾"); + } + //库里重复 + long enCodeCount = allPositionList.stream().filter(t -> t.getEnCode().equals(value)).count(); + if (enCodeCount > 0) { + errInfo.add(columnName + "值已存在"); + break; + } + //表格内重复 + enCodeCount = addList.stream().filter(t -> t.getEnCode().equals(value)).count(); + if (enCodeCount > 0) { + errInfo.add(columnName + "值已存在"); + break; + } + break; + case "type": + if (StringUtil.isEmpty(value)) { + errInfo.add(columnName + "不能为空"); + break; + } + DictionaryDataEntity typeDictionary = typeDictionaryList.stream().filter(t -> t.getFullName().equals(value)).findFirst().orElse(null); + if (typeDictionary == null) { + errInfo.add("找不到该" + columnName + "值"); + break; + } + realMap.put("type", typeDictionary.getEnCode()); + break; + case "sortCode": + if (StringUtil.isEmpty(value)) { + realMap.put("sortCode", 0); + break; + } + Long numValue = 0l; + try { + numValue = Long.parseLong(value); + } catch (Exception e) { + errInfo.add(columnName + "值不正确"); + break; + } + if (numValue < 0) { + errInfo.add(columnName + "值不能小于0"); + break; + } + if (numValue > 1000000) { + errInfo.add(columnName + "值不能大于999999"); + break; + } + break; + case "enabledMark": + if (StringUtil.isEmpty(value)) { + errInfo.add(columnName + "不能为空"); + break; + } + if ("启用".equals(value)) { + realMap.put("enabledMark", 1); + } else if ("禁用".equals(value)) { + realMap.put("enabledMark", 0); + } else { + errInfo.add(columnName + "值不正确"); + } + break; + default: + break; + } + + } + if (errInfo.length() == 0) { + PositionEntity positionEntity = JsonUtil.getJsonToBean(realMap, PositionEntity.class); + positionEntity.setCreatorTime(new Date()); + addList.add(positionEntity); + } else { + eachMap.put("errorsInfo", errInfo.toString()); + failList.add(eachMap); + } + } + } + + private CheckResult checkOrganizeId(String organizeName, Map allOrgsTreeName) { + for (String key : allOrgsTreeName.keySet()) { + Object o = allOrgsTreeName.get(key); + if (organizeName.equals(o.toString())) { + String[] split = key.split(","); + return new CheckResult(true, null, split[split.length - 1]); + } + } + return new CheckResult(false, "所属组织不正确", null); + } + + /** + * 获取下拉框 + * + * @return + */ + private Map getOptionMap() { + Map optionMap = new HashMap<>(); + //岗位类型 + List typeList = dictionaryDataApi.getByTypeCodeEnable(DictionaryDataEnum.POSITION_TYPE.getDictionaryTypeId()); + String[] type = typeList.stream().map(DictionaryDataEntity::getFullName).toArray(String[]::new); + optionMap.put("type", type); + //状态 + optionMap.put("enabledMark", new String[]{"启用", "禁用"}); + return optionMap; + } +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-controller/src/main/java/com/yunzhupaas/permission/controller/RoleController.java b/yunzhupaas-permission/yunzhupaas-permission-controller/src/main/java/com/yunzhupaas/permission/controller/RoleController.java new file mode 100644 index 0000000..6e9a26c --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-controller/src/main/java/com/yunzhupaas/permission/controller/RoleController.java @@ -0,0 +1,1141 @@ +package com.yunzhupaas.permission.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import com.alibaba.fastjson.JSONArray; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.annotation.RolePermission; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.YunzhupaasConst; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.constant.PermissionConst; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.model.ExcelColumnAttr; +import com.yunzhupaas.model.ExcelImportForm; +import com.yunzhupaas.model.ExcelImportVO; +import com.yunzhupaas.model.ExcelModel; +import com.yunzhupaas.permission.constant.RoleColumnMap; +import com.yunzhupaas.permission.entity.*; +import com.yunzhupaas.permission.model.check.CheckResult; +import com.yunzhupaas.permission.model.position.PosOrgConditionModel; +import com.yunzhupaas.permission.model.position.PositionSelectorVO; +import com.yunzhupaas.permission.model.role.*; +import com.yunzhupaas.permission.model.user.mod.UserIdModel; +import com.yunzhupaas.permission.service.*; +import com.yunzhupaas.base.util.ExcelTool; +import com.yunzhupaas.permission.util.PermissionUtil; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.treeutil.ListToTreeUtil; +import com.yunzhupaas.util.treeutil.SumTree; +import com.yunzhupaas.util.treeutil.newtreeutil.TreeDotUtils2; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; +import java.io.IOException; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 角色管理 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +@Tag(name = "角色管理", description = "Role") +@RestController +@RequestMapping("/api/permission/Role") +public class RoleController extends SuperController { + + @Autowired + private RoleService roleService; + @Autowired + private UserService userService; + @Autowired + private UserRelationService userRelationService; + @Autowired + private OrganizeRelationService organizeRelationService; + @Autowired + private OrganizeService organizeService; + @Autowired + private OrganizeAdministratorService organizeAdministratorService; + @Autowired + private ConfigValueUtil configValueUtil; + + /** + * 获取角色列表 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "获取角色列表") + @SaCheckPermission("permission.role") + @GetMapping + public ActionResult list(RolePagination pagination) { + // null:全部显示 0:全局 + int globalMark; + if (pagination.getType() != null) { + globalMark = pagination.getType(); + } else { + if ("0".equals(pagination.getOrganizeId())) { + // 显示全局 + globalMark = 1; + } else if ("".equals(pagination.getOrganizeId())) { + // 全部显示 + globalMark = -1; + } else { + // 显示组织内 + globalMark = 0; + } + } + List list = roleService.getList(pagination, globalMark); + List listVO = new ArrayList<>(); + for (RoleEntity entity : list) { + // 角色类型展示 + RoleListVO vo = JsonUtil.getJsonToBean(entity, RoleListVO.class); + if (entity.getGlobalMark() != null && entity.getGlobalMark().equals(1)) { + vo.setType("全局"); + } else { + vo.setType("组织"); + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(OrganizeRelationEntity::getObjectType, PermissionConst.ROLE); + query.lambda().eq(OrganizeRelationEntity::getObjectId, entity.getId()); + List ids = new ArrayList<>(); + for (OrganizeRelationEntity relation : organizeRelationService.list(query)) { + ids.add(relation.getOrganizeId()); + } + String orgInfos = PermissionUtil.getLinkInfoByOrgId(ids, organizeService); + if (orgInfos.length() > 0) { + vo.setOrganizeInfo(orgInfos.substring(0, orgInfos.length() - 1)); + } else { + vo.setOrganizeInfo(""); + } + + } + listVO.add(vo); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(listVO, paginationVO); + } + + /** + * 角色下拉框列表 + * + * @return + */ + @Operation(summary = "角色下拉框列表") + @GetMapping("/Selector") + public ActionResult> listAll() { + List list1 = roleService.getList(true); + Map orgMaps = organizeService.getOrgMaps(null, false, null); + + List roleModels = new ArrayList<>(); + List modelList = new ArrayList<>(); + + // 全局展示 + RoleSelectorVO globalParent = new RoleSelectorVO(); + String globalParentId = "1"; + globalParent.setFullName("全局"); + globalParent.setId("1"); + globalParent.setId(globalParentId); + globalParent.setOnlyId("organizeList_0"); + globalParent.setIcon("icon-ym icon-ym-global-role"); + List globalModelList = JsonUtil.getJsonToList(roleService.getGlobalList(), + RoleSelectorVO.class); + globalModelList.forEach(g -> { + g.setType("role"); + g.setOnlyId(UUID.randomUUID().toString()); + g.setParentId(globalParentId); + g.setIcon("icon-ym icon-ym-generator-role"); + }); + globalParent.setHasChildren(globalModelList.size() > 0); + globalParent.setChildren(globalModelList); + globalParent.setIsLeaf(false); + globalParent.setIcon("icon-ym icon-ym-global-role"); + + Map orgIdNameMaps = organizeService.getInfoList(); + List relationListByObjectIdAndType = organizeRelationService + .getRelationListByType(PermissionConst.ROLE); + for (RoleEntity roleEntity : list1) { + if (roleEntity.getEnabledMark() == 0) { + continue; + } + List relationListByObjectIdAndTypes = relationListByObjectIdAndType.stream() + .filter(t -> roleEntity.getId().equals(t.getObjectId())).collect(Collectors.toList()); + for (OrganizeRelationEntity entity : relationListByObjectIdAndTypes) { + RoleModel roleVo = JsonUtil.getJsonToBean(roleEntity, RoleModel.class); + // 必须加这个标识,不然前端会报错 + roleVo.setType("role"); + roleVo.setOnlyId(UUID.randomUUID().toString()); + String organizeId = entity.getOrganizeId(); + roleVo.setParentId(organizeId); + roleVo.setIcon("icon-ym icon-ym-generator-role"); + OrganizeEntity organizeEntity = orgMaps.get(organizeId); + if (organizeEntity != null) { + roleVo.setOrganize(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, + organizeEntity.getOrganizeIdTree(), "/")); + roleVo.setOrganizeIds(organizeService.getOrgIdTree(organizeEntity)); + } else { + roleVo.setOrganizeIds(new ArrayList<>()); + } + roleModels.add(roleVo); + } + } + List orgList = new ArrayList<>(16); + orgMaps.values().stream().forEach(org -> { + RoleModel orgVo = JsonUtil.getJsonToBean(org, RoleModel.class); + orgVo.setType(org.getCategory()); + orgVo.setIcon(StringUtil.isNotEmpty(org.getCategory()) + ? "company".equals(org.getCategory()) ? "icon-ym icon-ym-tree-organization3" + : "icon-ym icon-ym-tree-department1" + : ""); + orgVo.setOnlyId(UUID.randomUUID().toString()); + OrganizeEntity organizeEntity = orgMaps.get(orgVo.getId()); + if (organizeEntity != null) { + orgVo.setOrganize( + organizeService.getFullNameByOrgIdTree(orgIdNameMaps, organizeEntity.getOrganizeIdTree(), "/")); + orgVo.setOrganizeIds(organizeService.getOrgIdTree(organizeEntity)); + } else { + orgVo.setOrganizeIds(new ArrayList<>()); + } + orgList.add(orgVo); + }); + + JSONArray objects = ListToTreeUtil.treeWhere(roleModels, orgList); + List jsonToList = JsonUtil.getJsonToList(objects, RoleModel.class); + + List list = new ArrayList<>(16); + // 得到角色的值 + List collect = jsonToList.stream().filter(t -> "role".equals(t.getType())) + .sorted(Comparator.comparing(RoleModel::getSortCode)).collect(Collectors.toList()); + list.addAll(collect); + jsonToList.removeAll(collect); + List collect1 = jsonToList.stream().sorted(Comparator.comparing(RoleModel::getSortCode) + .thenComparing(RoleModel::getCreatorTime, Comparator.reverseOrder())).collect(Collectors.toList()); + list.addAll(collect1); + + List> trees = TreeDotUtils2.convertListToTreeDot(list); + modelList.addAll(JsonUtil.getJsonToList(trees, RoleSelectorVO.class)); + modelList.add(globalParent); + ListVO vo = new ListVO(); + vo.setList(modelList); + return ActionResult.success(vo); + } + + /** + * 分级管理下角色下拉框列表 + * + * @return + */ + @Operation(summary = "分级管理下角色下拉框列表") + @GetMapping("/SelectorByPermission") + public ActionResult> roleListAll() { + boolean isAdministrator = UserProvider.getUser().getIsAdministrator(); + List list1 = new ArrayList<>(16); + List list2 = organizeService.getList(false); + + List orgIdList = list2.stream().map(OrganizeEntity::getId).collect(Collectors.toList()); + + List roleModels = new ArrayList<>(); + List modelList = new ArrayList<>(); + + if (!isAdministrator) { + Set set = new HashSet<>(16); + // 获取用户分级管理的权限 + List organizeAdministratorEntity = organizeAdministratorService + .getOrganizeAdministratorEntity(UserProvider.getLoginUserId()); + organizeAdministratorEntity.stream().forEach(t -> { + // 如果有本层编辑权限 + if ("1".equals(String.valueOf(t.getThisLayerEdit()))) { + set.add(t.getOrganizeId()); + } + if ("1".equals(String.valueOf(t.getSubLayerEdit()))) { + // 如果有子层编辑权限 + List underOrganizations = organizeService.getUnderOrganizations(t.getOrganizeId(), false); + set.addAll(underOrganizations); + } + }); + List finalOrganizeEntities = new ArrayList<>(16); + set.forEach(t -> { + OrganizeEntity entity = organizeService.getInfo(t); + if (entity != null) { + finalOrganizeEntities.add(entity); + } + }); + orgIdList = new ArrayList<>(set); + List relationListByOrganizeId = organizeRelationService.getRelationListByOrganizeId( + finalOrganizeEntities.stream().map(OrganizeEntity::getId).collect(Collectors.toList())); + list1 = roleService.getListByIds( + relationListByOrganizeId.stream().filter(t -> PermissionConst.ROLE.equals(t.getObjectType())) + .map(OrganizeRelationEntity::getObjectId).collect(Collectors.toList()), + null, false); + } else { + list1 = roleService.getList(false); + } + list1 = list1.stream().filter(t -> t != null && t.getEnabledMark() != null && t.getEnabledMark() == 1) + .collect(Collectors.toList()); + for (RoleEntity roleEntity : list1) { + List relationListByObjectIdAndType = organizeRelationService + .getRelationListByObjectIdAndType(PermissionConst.ROLE, roleEntity.getId()); + for (OrganizeRelationEntity entity : relationListByObjectIdAndType) { + if (!orgIdList.contains(entity.getOrganizeId())) { + continue; + } + RoleModel roleVo = JsonUtil.getJsonToBean(roleEntity, RoleModel.class); + // 必须加这个标识,不然前端会报错 + roleVo.setType("role"); + roleVo.setOnlyId(UUID.randomUUID().toString()); + roleVo.setParentId(entity.getOrganizeId()); + roleModels.add(roleVo); + } + } + List orgList = new ArrayList<>(16); + list2.stream().forEach(org -> { + RoleModel orgVo = JsonUtil.getJsonToBean(org, RoleModel.class); + orgVo.setType(org.getCategory()); + orgVo.setIcon(StringUtil.isNotEmpty(org.getCategory()) + ? "company".equals(org.getCategory()) ? "icon-ym icon-ym-tree-organization3" + : "icon-ym icon-ym-tree-department1" + : ""); + orgVo.setOnlyId(UUID.randomUUID().toString()); + orgList.add(orgVo); + }); + JSONArray objects = ListToTreeUtil.treeWhere(roleModels, orgList); + List jsonToList = JsonUtil.getJsonToList(objects, RoleModel.class); + + List list = new ArrayList<>(16); + // 得到角色的值 + List collect = jsonToList.stream().filter(t -> "role".equals(t.getType())) + .sorted(Comparator.comparing(RoleModel::getSortCode)).collect(Collectors.toList()); + list.addAll(collect); + jsonToList.removeAll(collect); + List collect1 = jsonToList.stream().sorted(Comparator.comparing(RoleModel::getSortCode) + .thenComparing(RoleModel::getCreatorTime, Comparator.reverseOrder())).collect(Collectors.toList()); + list.addAll(collect1); + + List> trees = TreeDotUtils2.convertListToTreeDot(list); + // trees.removeAll(trees.stream().filter(t->!"-1".equals(t.getParentId())).collect(Collectors.toList())); + modelList.addAll(JsonUtil.getJsonToList(trees, RoleSelectorVO.class)); + + // 如果是管理员需要展示全局角色 + if (isAdministrator) { + // 全局展示 + RoleSelectorVO globalParent = new RoleSelectorVO(); + String globalParentId = "1"; + globalParent.setFullName("全局"); + globalParent.setId("1"); + globalParent.setId(globalParentId); + globalParent.setOnlyId("organizeList_0"); + List globalModelList = JsonUtil.getJsonToList(roleService.getGlobalList(), + RoleSelectorVO.class); + globalModelList.forEach(g -> { + g.setType("role"); + g.setOnlyId(UUID.randomUUID().toString()); + g.setParentId(globalParentId); + }); + globalParent.setHasChildren(globalModelList.size() > 0); + globalParent.setChildren(globalModelList); + globalParent.setIsLeaf(false); + globalParent.setIcon("icon-ym icon-ym-global-role"); + modelList.add(globalParent); + } + ListVO vo = new ListVO(); + vo.setList(modelList); + return ActionResult.success(vo); + } + + /** + * 获取角色信息 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "获取角色信息") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("permission.role") + @GetMapping("/{id}") + public ActionResult getInfo(@PathVariable("id") String id) throws DataException { + RoleEntity entity = roleService.getInfo(id); + RoleInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, RoleInfoVO.class); + // 通过组织角色关联表获取组织 + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(OrganizeRelationEntity::getObjectType, PermissionConst.ROLE); + query.lambda().eq(OrganizeRelationEntity::getObjectId, id); + + List ids = new ArrayList<>(); + organizeRelationService.list(query).forEach(relation -> { + ids.add(relation.getOrganizeId()); + }); + vo.setOrganizeIdsTree(PermissionUtil.getOrgIdsTree(ids, 1, organizeService)); + return ActionResult.success(vo); + } + + /** + * 新建角色 + * + * @param roleCrForm 角色模型 + * @return + */ + @RolePermission + @Operation(summary = "新建角色") + @Parameters({ + @Parameter(name = "roleCrForm", description = "角色模型", required = true) + }) + @SaCheckPermission("permission.role") + @PostMapping + @Transactional + public ActionResult create(@RequestBody @Valid RoleCrForm roleCrForm) { + RoleEntity entity = JsonUtil.getJsonToBean(roleCrForm, RoleEntity.class); + if (roleService.isExistByFullName(roleCrForm.getFullName(), entity.getId(), roleCrForm.getGlobalMark())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (roleService.isExistByEnCode(roleCrForm.getEnCode(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + + // 角色的类型是啥,放organizeId,全局角色设置 + String roleId = RandomUtil.uuId(); + entity.setId(roleId); + createOrganizeRoleRelation(roleCrForm.getOrganizeIdsTree(), roleId, roleCrForm.getGlobalMark()); + roleService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 更新角色 + * + * @param id 主键值 + * @param roleUpForm roleUpForm + * @return + */ + @RolePermission + @Operation(summary = "更新角色") + @Parameters({ + @Parameter(name = "roleUpForm", description = "角色模型", required = true), + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("permission.role") + @PutMapping("/{id}") + @Transactional + public ActionResult update(@RequestBody @Valid RoleUpForm roleUpForm, @PathVariable("id") String id) + throws DataException { + // 如果角色下面有用户则不允许修改角色类型和所属组织 + RoleEntity entity0 = roleService.getInfo(id); + // 组织关系 + List relationListByRoleId = organizeRelationService.getRelationListByRoleId(id); + // 得到组织id + if (entity0 != null) { + List bingUserByRoleList = userRelationService.getListByObjectId(id, + PermissionConst.ROLE); + if (bingUserByRoleList.size() > 0) { + // 修改角色类型 + if (!entity0.getGlobalMark().equals(roleUpForm.getGlobalMark())) { + return ActionResult.fail(MsgCode.FA023.get()); + } + // 如果是修改状态的话 + if (!entity0.getEnabledMark().equals(roleUpForm.getEnabledMark())) { + return ActionResult.fail(MsgCode.FA030.get()); + } + + } + } + + if (roleUpForm.getGlobalMark() != 1) { + List beforeOrgIds = relationListByRoleId.stream().map(OrganizeRelationEntity::getOrganizeId) + .collect(Collectors.toList()); + List updateOrgIds = PermissionUtil.getOrgIdsByFormTree(organizeService, + roleUpForm.getOrganizeIdsTree()); + // 并集:所有未修改的ID + List unUpdateOrgIds = beforeOrgIds.stream().filter(updateOrgIds::contains) + .collect(Collectors.toList()); + // 差集:减少的ID + beforeOrgIds.removeAll(unUpdateOrgIds); + + // 当角色绑定用户不让其更改角色所属组织 + String info = roleService.getBindInfo(id, beforeOrgIds); + if (info != null) { + return ActionResult.fail(MsgCode.FA023.get()); + } + } + + RoleEntity entity = JsonUtil.getJsonToBean(roleUpForm, RoleEntity.class); + if (roleService.isExistByFullName(roleUpForm.getFullName(), id, roleUpForm.getGlobalMark())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (roleService.isExistByEnCode(roleUpForm.getEnCode(), id)) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + boolean flag = roleService.update(id, entity); + if (!flag) { + return ActionResult.fail(MsgCode.FA002.get()); + } + createOrganizeRoleRelation(roleUpForm.getOrganizeIdsTree(), id, roleUpForm.getGlobalMark()); + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 添加组织角色关联关系 + */ + private Boolean createOrganizeRoleRelation(List> organizeIdsTree, String roleId, Integer globalMark) { + // 清除之前的关联关系 + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(OrganizeRelationEntity::getObjectType, PermissionConst.ROLE); + query.lambda().eq(OrganizeRelationEntity::getObjectId, roleId); + organizeRelationService.remove(query); + // globalMark等于0时,为组织角色 + if (globalMark.equals(0)) { + List relationList = new ArrayList<>(); + for (List organizeIds : organizeIdsTree) { + // 组织id数组树最后一个数组最后一个id,是需要储存的id + String organizeId = organizeIds.get(organizeIds.size() - 1); + // 添加与组织的关联关系 + OrganizeRelationEntity organizeRelationEntity = new OrganizeRelationEntity(); + organizeRelationEntity.setId(RandomUtil.uuId()); + organizeRelationEntity.setOrganizeId(organizeId); + organizeRelationEntity.setObjectType(PermissionConst.ROLE); + organizeRelationEntity.setObjectId(roleId); + relationList.add(organizeRelationEntity); + } + organizeRelationService.saveBatch(relationList); + } + return true; + } + + /** + * 删除角色 + * + * @param id 主键值 + * @return + */ + @RolePermission + @Operation(summary = "删除角色") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("permission.role") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + // 当角色绑定用户不让其删除 + if (userRelationService.existByObj(PermissionConst.ROLE, id)) { + return ActionResult.fail(MsgCode.FA024.get()); + } + RoleEntity entity = roleService.getInfo(id); + if (entity != null) { + List userRelList = userRelationService.getListByObjectId(id); + if (userRelList.size() > 0) { + return ActionResult.fail(MsgCode.FA024.get()); + } + for (UserRelationEntity entity1 : userRelList) { + UserEntity entity2 = userService.getById(entity1.getUserId()); + if (entity2 != null) { + String newRoleId = entity2.getRoleId().replace(id, ""); + if (entity2.getRoleId().contains(id)) { + if (newRoleId.length() != 0 && newRoleId.substring(0, 1).equals(",")) { + entity2.setRoleId(newRoleId.substring(1)); + } else if (newRoleId.length() != 0) { + entity2.setRoleId(newRoleId.replace(",,", ",")); + } + } + } + } + // 删除所有用户角色关联 + userRelationService.deleteAllByObjId(id); + // 删除所有组织角色关联 + organizeRelationService.deleteAllByRoleId(id); + roleService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + /** + * 更新角色状态 + * + * @param id 主键值 + * @return + */ + @RolePermission + @Operation(summary = "更新角色状态") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("permission.role") + @PutMapping("/{id}/Actions/State") + public ActionResult disable(@PathVariable("id") String id) { + RoleEntity entity = roleService.getInfo(id); + if (entity != null) { + if ("1".equals(String.valueOf(entity.getEnabledMark()))) { + entity.setEnabledMark(0); + } else { + entity.setEnabledMark(1); + } + roleService.update(id, entity); + return ActionResult.success(MsgCode.SU005.get()); + } + return ActionResult.fail(MsgCode.FA007.get()); + } + + /** + * 通过组织id获取岗位列表 + * + * @param organizeIds 组织id数组 + * @return 角色列表 + */ + @Operation(summary = "获取角色列表通过组织id数组") + @Parameters({ + @Parameter(name = "organizeIds", description = "组织id数组", required = true) + }) + @SaCheckPermission("permission.user") + @PostMapping("/getListByOrgIds") + public ActionResult> getListByOrganizeIds( + @RequestBody @Valid Map> organizeIds) { + List modelAll = new ArrayList<>(); + if (organizeIds.get("organizeIds") != null) { + List ids = organizeIds.get("organizeIds"); + modelAll = roleService.getListByOrganizeIds(ids, false, true); + } + + ListVO vo = new ListVO<>(); + vo.setList(modelAll); + return ActionResult.success(vo); + } + + /** + * 获取角色下拉框 + * + * @param idModel 岗位选择模型 + * @return + */ + @Operation(summary = "获取角色下拉框") + @Parameters({ + @Parameter(name = "idModel", description = "ids", required = true) + }) + @PostMapping("/RoleCondition") + public ActionResult> roleCondition(@RequestBody UserIdModel idModel) { + // 所有组织跟角色关联关系 + List relationListByType = organizeRelationService + .getRelationListByType(PermissionConst.ROLE); + + // 定义返回对象 + List modelList = new ArrayList<>(); + List roleIds = idModel.getIds(); + List lists = organizeRelationService.getOrgIds(roleIds, PermissionConst.ROLE); + List list = new ArrayList<>(lists); + List roleIdList = new ArrayList<>(); + lists.forEach(t -> { + List collect = relationListByType.stream() + .filter(relationEntity -> relationEntity.getOrganizeId().equals(t)).collect(Collectors.toList()); + collect.forEach(relationEntity -> roleIdList.add(relationEntity.getObjectId())); + List collect1 = relationListByType.stream() + .filter(relationEntity -> relationEntity.getObjectId().equals(t)).collect(Collectors.toList()); + list.addAll(collect1.stream().map(OrganizeRelationEntity::getOrganizeId).collect(Collectors.toList())); + }); + roleIds.addAll(roleIdList); + + // 全局 + if (UserProvider.getUser().getIsAdministrator() && (idModel.getIds().contains(YunzhupaasConst.CURRENT_GRADE) + || idModel.getIds().contains(YunzhupaasConst.CURRENT_GRADE_TYPE))) { + roleIds.addAll(roleService.getGlobalList().stream().map(RoleEntity::getId).collect(Collectors.toList())); + } + + roleIds = roleIds.stream().distinct().collect(Collectors.toList()); + List roleEntityList = roleService.getListByIds(roleIds, null, true); + List posOrgModels = new ArrayList<>(16); + roleEntityList.forEach(t -> { + if (t.getGlobalMark() != null && t.getGlobalMark() == 1) { + PosOrgConditionModel posOrgModel = JsonUtil.getJsonToBean(t, PosOrgConditionModel.class); + posOrgModel.setType("role"); + posOrgModel.setIcon("icon-ym icon-ym-generator-role"); + posOrgModel.setParentId("1"); + posOrgModel.setOnlyId(RandomUtil.uuId()); + posOrgModels.add(posOrgModel); + } else { + // 得到所有的组织id + List orgIds = relationListByType.stream() + .filter(relationEntity -> relationEntity.getObjectId().equals(t.getId())) + .map(OrganizeRelationEntity::getOrganizeId).collect(Collectors.toList()); + orgIds.forEach(orgId -> { + if (orgIds.size() > 1) { + if (!list.contains(orgId)) { + return; + } + } + PosOrgConditionModel posOrgModel = JsonUtil.getJsonToBean(t, PosOrgConditionModel.class); + posOrgModel.setType("role"); + posOrgModel.setIcon("icon-ym icon-ym-generator-role"); + posOrgModel.setParentId(orgId); + posOrgModel.setOrganizeId(orgId); + posOrgModel.setOnlyId(RandomUtil.uuId()); + posOrgModels.add(posOrgModel); + }); + } + }); + Map orgIdNameMaps = organizeService.getInfoList(); + // 取出所有所属组织 + List orgIds = posOrgModels.stream().filter(t -> StringUtil.isNotEmpty(t.getOrganizeId())) + .map(PosOrgConditionModel::getOrganizeId).collect(Collectors.toList()); + List orgEntityList = organizeService.getOrgEntityList(orgIds, true); + orgEntityList.forEach(orgEntity -> { + PosOrgConditionModel posOrgModel = JsonUtil.getJsonToBean(orgEntity, PosOrgConditionModel.class); + if ("department".equals(orgEntity.getCategory())) { + posOrgModel.setIcon("icon-ym icon-ym-tree-department1"); + } else if ("company".equals(orgEntity.getCategory())) { + posOrgModel.setIcon("icon-ym icon-ym-tree-organization3"); + } + // 处理断层 + if (StringUtil.isNotEmpty(orgEntity.getOrganizeIdTree())) { + List list1 = new ArrayList<>(); + String[] split = orgEntity.getOrganizeIdTree().split(","); + list1 = Arrays.asList(split); + Collections.reverse(list1); + for (String orgId : list1) { + OrganizeEntity organizeEntity1 = orgEntityList.stream() + .filter(organizeEntity -> organizeEntity.getId().equals(orgId)).findFirst().orElse(null); + if (organizeEntity1 != null && !organizeEntity1.getId().equals(posOrgModel.getId())) { + posOrgModel.setParentId(organizeEntity1.getId()); + String[] split1 = orgEntity.getOrganizeIdTree().split(organizeEntity1.getId()); + if (split1.length > 1) { + posOrgModel + .setFullName(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, split1[1], "/")); + } + break; + } + } + } + posOrgModel.setOnlyId(RandomUtil.uuId()); + posOrgModels.add(posOrgModel); + }); + + if (posOrgModels.stream().anyMatch(posOrgConditionModel -> "1".equals(posOrgConditionModel.getParentId()))) { + PosOrgConditionModel globalModel = new PosOrgConditionModel(); + globalModel.setId("1"); + globalModel.setParentId("-1"); + globalModel.setFullName("全局"); + globalModel.setIcon("icon-ym icon-ym-global-role"); + globalModel.setOnlyId("organizeList_0"); + posOrgModels.add(globalModel); + } + List> trees = TreeDotUtils2.convertListToTreeDot(posOrgModels); + List positionSelectorVO = JsonUtil.getJsonToList(trees, PositionSelectorVO.class); + // 处理数据 + positionSelectorVO.forEach(t -> { + if (!"0".equals(t.getId()) && !"1".equals(t.getId()) && !"role".equals(t.getType())) { + t.setFullName(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, t.getOrganizeIdTree(), "/")); + } + }); + modelList.addAll(positionSelectorVO); + + ListVO vo = new ListVO(); + vo.setList(modelList); + return ActionResult.success(vo); + } + + /** + * 模板下载 + * + * @return + */ + @Operation(summary = "模板下载") + @SaCheckPermission("permission.role") + @GetMapping("/TemplateDownload") + public ActionResult TemplateDownload() { + RoleColumnMap columnMap = new RoleColumnMap(); + String excelName = columnMap.getExcelName(); + Map keyMap = columnMap.getColumnByType(0); + List models = columnMap.getFieldsModel(false); + List> list = columnMap.getDefaultList(); + Map optionMap = getOptionMap(); + ExcelModel excelModel = ExcelModel.builder().models(models).selectKey(new ArrayList<>(keyMap.keySet())) + .optionMap(optionMap).build(); + DownloadVO vo = ExcelTool.getImportTemplate(configValueUtil.getTemporaryFilePath(), excelName, keyMap, list, + excelModel); + return ActionResult.success(vo); + } + + /** + * 上传Excel + * + * @return + */ + @Operation(summary = "上传导入Excel") + @SaCheckPermission("permission.role") + @PostMapping("/Uploader") + public ActionResult Uploader() { + return ExcelTool.uploader(); + } + + /** + * 导入预览 + * + * @return + */ + @Operation(summary = "导入预览") + @SaCheckPermission("permission.role") + @GetMapping("/ImportPreview") + public ActionResult> ImportPreview(String fileName) throws Exception { + // 导入字段 + RoleColumnMap columnMap = new RoleColumnMap(); + Map keyMap = columnMap.getColumnByType(0); + Map headAndDataMap = ExcelTool.importPreview(configValueUtil.getTemporaryFilePath(), fileName, + keyMap); + return ActionResult.success(headAndDataMap); + } + + /** + * 导出异常报告 + * + * @return + */ + @Operation(summary = "导出异常报告") + @SaCheckPermission("permission.role") + @PostMapping("/ExportExceptionData") + public ActionResult ExportExceptionData(@RequestBody ExcelImportForm visualImportModel) { + String temporaryFilePath = configValueUtil.getTemporaryFilePath(); + List> dataList = visualImportModel.getList(); + RoleColumnMap columnMap = new RoleColumnMap(); + String excelName = columnMap.getExcelName(); + Map keyMap = columnMap.getColumnByType(0); + List models = columnMap.getFieldsModel(true); + ExcelModel excelModel = ExcelModel.builder().optionMap(getOptionMap()).models(models).build(); + DownloadVO vo = ExcelTool.exportExceptionReport(temporaryFilePath, excelName, keyMap, dataList, excelModel); + return ActionResult.success(vo); + } + + /** + * 导入数据 + * + * @return + */ + @Operation(summary = "导入数据") + @SaCheckPermission("permission.role") + @PostMapping("/ImportData") + public ActionResult ImportData(@RequestBody ExcelImportForm visualImportModel) throws Exception { + List> listData = new ArrayList<>(); + List> headerRow = new ArrayList<>(); + if (visualImportModel.isType()) { + ActionResult result = ImportPreview(visualImportModel.getFileName()); + if (result == null) { + throw new Exception(MsgCode.FA018.get()); + } + if (result.getCode() != 200) { + throw new Exception(result.getMsg()); + } + if (result.getData() instanceof Map) { + Map data = (Map) result.getData(); + listData = (List>) data.get("dataRow"); + headerRow = (List>) data.get("headerRow"); + } + } else { + listData = visualImportModel.getList(); + } + List addList = new ArrayList(); + List> failList = new ArrayList<>(); + Map>> addOrganizeIdMap = new HashMap<>(); + // 对数据做校验 + this.validateImportData(listData, addList, addOrganizeIdMap, failList); + + // 正常数据插入 + for (RoleEntity each : addList) { + roleService.create(each); + List> organizeIdList = addOrganizeIdMap.get(each.getId()); + if (organizeIdList != null && !organizeIdList.isEmpty()) { + this.createOrganizeRoleRelation(organizeIdList, each.getId(), each.getGlobalMark()); + } + } + ExcelImportVO importModel = new ExcelImportVO(); + importModel.setSnum(addList.size()); + importModel.setFnum(failList.size()); + importModel.setResultType(failList.size() > 0 ? 1 : 0); + importModel.setFailResult(failList); + importModel.setHeaderRow(headerRow); + return ActionResult.success(importModel); + } + + private void validateImportData(List> listData, List addList, + Map>> addOrganizeIdMap, List> failList) { + RoleColumnMap columnMap = new RoleColumnMap(); + Map keyMap = columnMap.getColumnByType(0); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().isNull(RoleEntity::getDeleteMark); + queryWrapper.lambda().orderByAsc(RoleEntity::getSortCode).orderByDesc(RoleEntity::getCreatorTime); + List allPositionList = roleService.list(queryWrapper); + Map allOrgsTreeName = organizeService.getAllOrgsTreeName(); + for (int i = 0, len = listData.size(); i < len; i++) { + Map eachMap = listData.get(i); + Map realMap = JsonUtil.getJsonToBean(eachMap, Map.class); + StringJoiner errInfo = new StringJoiner(","); + int globalMark = "组织".equals(eachMap.get("globalMark")) ? 0 : 1; + List> organizeIdList = null; + for (String column : keyMap.keySet()) { + Object valueObj = eachMap.get(column); + String value = valueObj == null ? null : String.valueOf(valueObj); + String columnName = keyMap.get(column); + + switch (column) { + case "fullName": + if (StringUtil.isEmpty(value)) { + errInfo.add(columnName + "不能为空"); + break; + } + if (value.length() > 50) { + errInfo.add(columnName + "值超出最多输入字符限制"); + } + // 值不能含有特殊符号 + if (!RegexUtils.checkSpecoalSymbols(value)) { + errInfo.add(columnName + "值不能含有特殊符号"); + } + // 库里重复 + int finalGlobalMark = globalMark; + long fullNameCount = allPositionList.stream() + .filter(t -> t.getFullName().equals(value) && t.getGlobalMark().equals(finalGlobalMark)) + .count(); + if (fullNameCount > 0) { + errInfo.add(columnName + "值已存在"); + break; + } + // 表格内重复 + fullNameCount = addList.stream() + .filter(t -> t.getFullName().equals(value) && t.getGlobalMark().equals(finalGlobalMark)) + .count(); + if (fullNameCount > 0) { + errInfo.add(columnName + "值已存在"); + break; + } + break; + case "enCode": + if (StringUtil.isEmpty(value)) { + errInfo.add(columnName + "不能为空"); + break; + } + if (value.length() > 50) { + errInfo.add(columnName + "值超出最多输入字符限制"); + } + if (!RegexUtils.checkEnCode(value)) { + errInfo.add(columnName + "只能输入英文、数字和小数点且小数点不能放在首尾"); + } + // 库里重复 + long enCodeCount = allPositionList.stream().filter(t -> t.getEnCode().equals(value)).count(); + if (enCodeCount > 0) { + errInfo.add(columnName + "值已存在"); + break; + } + // 表格内重复 + enCodeCount = addList.stream().filter(t -> t.getEnCode().equals(value)).count(); + if (enCodeCount > 0) { + errInfo.add(columnName + "值已存在"); + break; + } + break; + case "globalMark": + if (StringUtil.isEmpty(value)) { + errInfo.add(columnName + "不能为空"); + break; + } + if ("全局".equals(value)) { + globalMark = 1; + } else if ("组织".equals(value)) { + globalMark = 0; + } else { + errInfo.add(columnName + "值不正确"); + break; + } + realMap.put("globalMark", globalMark); + break; + case "organizeId": + if (globalMark == 0) { + if (StringUtil.isEmpty(value)) { + errInfo.add("所属组织" + "不能为空"); + break; + } + } + if (globalMark == 1) { + realMap.put("organizeId", null); + break; + } + if (StringUtil.isEmpty(value)) { + break; + } + CheckResult organizeIdCheckResult = this.checkOrganizes(value, allOrgsTreeName); + if (!organizeIdCheckResult.isPass()) { + errInfo.add(organizeIdCheckResult.getErrorMsg()); + break; + } + organizeIdList = (List>) organizeIdCheckResult.getValue(); + break; + case "sortCode": + if (StringUtil.isEmpty(value)) { + realMap.put("sortCode", 0); + break; + } + Long numValue = 0l; + try { + numValue = Long.parseLong(value); + } catch (Exception e) { + errInfo.add(columnName + "值不正确"); + break; + } + if (numValue < 0) { + errInfo.add(columnName + "值不能小于0"); + break; + } + if (numValue > 1000000) { + errInfo.add(columnName + "值不能大于999999"); + break; + } + break; + case "enabledMark": + if (StringUtil.isEmpty(value)) { + errInfo.add(columnName + "不能为空"); + break; + } + if ("启用".equals(value)) { + realMap.put("enabledMark", 1); + } else if ("禁用".equals(value)) { + realMap.put("enabledMark", 0); + } else { + errInfo.add(columnName + "值不正确"); + } + break; + default: + break; + } + + } + if (errInfo.length() == 0) { + RoleEntity roleEntity = JsonUtil.getJsonToBean(realMap, RoleEntity.class); + roleEntity.setCreatorTime(new Date()); + roleEntity.setId(RandomUtil.uuId()); + addList.add(roleEntity); + if (organizeIdList != null && !organizeIdList.isEmpty() && roleEntity.getGlobalMark() == 0) { + addOrganizeIdMap.put(roleEntity.getId(), organizeIdList); + } + } else { + eachMap.put("errorsInfo", errInfo.toString()); + failList.add(eachMap); + } + } + } + + /** + * 导出Excel + * + * @return + */ + @Operation(summary = "导出Excel") + @SaCheckPermission("permission.role") + @GetMapping("/ExportData") + public ActionResult ExportData(RolePagination pagination) throws IOException { + if (StringUtil.isEmpty(pagination.getSelectKey())) { + return ActionResult.fail(MsgCode.IMP011.get()); + } + // null:全部显示 0:全局 + int globalMark; + if (pagination.getType() != null) { + globalMark = pagination.getType(); + } else { + if ("0".equals(pagination.getOrganizeId())) { + // 显示全局 + globalMark = 1; + } else if ("".equals(pagination.getOrganizeId())) { + // 全部显示 + globalMark = -1; + } else { + // 显示组织内 + globalMark = 0; + } + } + List list = roleService.getList(pagination, globalMark); + + // todo 导出数据 + List> realList = new ArrayList<>(); + for (RoleEntity entity : list) { + Map roleMap = JsonUtil.entityToMap(entity); + if (entity.getGlobalMark() != null && entity.getGlobalMark().equals(1)) { + roleMap.put("globalMark", "全局"); + roleMap.put("organizeId", ""); + } else { + roleMap.put("globalMark", "组织"); + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(OrganizeRelationEntity::getObjectType, PermissionConst.ROLE); + query.lambda().eq(OrganizeRelationEntity::getObjectId, entity.getId()); + List ids = new ArrayList<>(); + for (OrganizeRelationEntity relation : organizeRelationService.list(query)) { + ids.add(relation.getOrganizeId()); + } + String orgInfos = PermissionUtil.getLinkInfoByOrgId(ids, organizeService); + if (orgInfos.length() > 0) { + roleMap.put("organizeId", orgInfos.substring(0, orgInfos.length() - 1)); + } else { + roleMap.put("organizeId", ""); + } + } + roleMap.put("enabledMark", "1".equals(String.valueOf(entity.getEnabledMark())) ? "启用" : "禁用"); + realList.add(roleMap); + } + String[] keys = !StringUtil.isEmpty(pagination.getSelectKey()) ? pagination.getSelectKey() : new String[0]; + RoleColumnMap posColumnMap = new RoleColumnMap(); + String excelName = posColumnMap.getExcelName(); + List models = posColumnMap.getFieldsModel(false); + Map keyMap = posColumnMap.getColumnByType(null); + Map optionMap = new HashMap<>(); + ExcelModel excelModel = ExcelModel.builder().selectKey(Arrays.asList(keys)).models(models).optionMap(optionMap) + .build(); + DownloadVO vo = ExcelTool.creatModelExcel(configValueUtil.getTemporaryFilePath(), excelName, keyMap, realList, + excelModel); + return ActionResult.success(vo); + } + + private CheckResult checkOrganizes(String organizeNames, Map allOrgsTreeName) { + String[] organizeNameArray = organizeNames.split(","); + List errorOrganizeNameList = new ArrayList<>(); + List> successOrganizeIdList = new ArrayList<>(); + for (String organizeName : organizeNameArray) { + String organizeId = null; + boolean find = false; + for (String key : allOrgsTreeName.keySet()) { + Object o = allOrgsTreeName.get(key); + if (organizeName.equals(o.toString())) { + find = true; + successOrganizeIdList.add(Arrays.asList(key.split(","))); + break; + } + } + if (!find) { + errorOrganizeNameList.add(organizeName); + } + } + if (errorOrganizeNameList.isEmpty()) { + return new CheckResult(true, null, successOrganizeIdList); + } else if (organizeNameArray.length == 1) { + return new CheckResult(false, "找不到该所属组织", null); + } else { + return new CheckResult(false, "找不到该所属组织(" + String.join("、", errorOrganizeNameList) + ")", null); + } + } + + /** + * 获取下拉框 + * + * @return + */ + private Map getOptionMap() { + Map optionMap = new HashMap<>(); + // 角色类型 + optionMap.put("globalMark", new String[] { "全局", "组织" }); + optionMap.put("enabledMark", new String[] { "启用", "禁用" }); + return optionMap; + } +} diff --git a/yunzhupaas-permission/yunzhupaas-permission-controller/src/main/java/com/yunzhupaas/permission/controller/SocialsUserController.java b/yunzhupaas-permission/yunzhupaas-permission-controller/src/main/java/com/yunzhupaas/permission/controller/SocialsUserController.java new file mode 100644 index 0000000..1b683c3 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-controller/src/main/java/com/yunzhupaas/permission/controller/SocialsUserController.java @@ -0,0 +1,434 @@ +package com.yunzhupaas.permission.controller; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import com.yunzhupaas.base.controller.SuperController; +import cn.hutool.core.collection.CollectionUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.annotation.UserPermission; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.util.NoDataSourceBind; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.exception.LoginException; +import com.yunzhupaas.permission.entity.SocialsUserEntity; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.model.socails.SocialsUserInfo; +import com.yunzhupaas.permission.model.socails.SocialsUserModel; +import com.yunzhupaas.permission.model.socails.SocialsUserVo; +import com.yunzhupaas.permission.service.SocialsUserService; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.permission.util.socials.AuthCallbackNew; +import com.yunzhupaas.permission.util.socials.AuthSocialsUtil; +import com.yunzhupaas.permission.util.socials.SocialsAuthEnum; +import com.yunzhupaas.permission.util.socials.SocialsConfig; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RedisUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import com.yunzhupaas.util.wxutil.HttpUtil; +import lombok.extern.slf4j.Slf4j; +import me.zhyd.oauth.enums.AuthResponseStatus; +import me.zhyd.oauth.model.AuthResponse; +import me.zhyd.oauth.model.AuthUser; +import me.zhyd.oauth.request.AuthRequest; +import me.zhyd.oauth.utils.AuthStateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * 单点登录 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/7/14 10:48:00 + */ +@Tag(name = "第三方登录和绑定", description = "Socials") +@RestController +@RequestMapping("/api/permission/socials") +@Slf4j +public class SocialsUserController extends SuperController { + @Autowired + private SocialsUserService socialsUserService; + @Autowired + private AuthSocialsUtil authSocialsUtil; + @Autowired + private UserService userService; + @Autowired + private SocialsConfig socialsConfig; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private RedisUtil redisUtil; + + /** + * 获取用户列表 + * + * @param + * @return ignore + */ + @Operation(summary = "获取用户授权列表") + @Parameters({ + @Parameter(name = "userId", description = "用户id") + }) + @GetMapping + public ActionResult> getList(@RequestParam(value = "userId", required = false) String userId) { + if (StringUtil.isEmpty(userId)) { + userId = UserProvider.getUser().getUserId(); + } + List> platformInfos = SocialsAuthEnum.getPlatformInfos(); + String s = JSONArray.toJSONString(platformInfos); + List socialsUserVos = JsonUtil.getJsonToList(s, SocialsUserVo.class); + List config = socialsConfig.getConfig(); + List res = new ArrayList<>(); + if (config == null) { + return ActionResult.fail(MsgCode.PS019.get()); + } + config.stream().forEach(item -> { + socialsUserVos.stream().forEach(item2 -> { + if (item2.getEnname().toLowerCase().equals(item.getProvider())) { + res.add(item2); + } + }); + }); + //查询绑定信息 + List listByUserId = socialsUserService.getListByUserId(userId); + List listModel = JsonUtil.getJsonToList(listByUserId, SocialsUserModel.class); + res.stream().forEach(item -> { + listModel.stream().forEach(item2 -> { + if (item.getEnname().equals(item2.getSocialType())) item.setEntity(item2); + }); + }); + return ActionResult.success(res); + } + + /** + * 绑定:重定向第三方登录页面 + * + * @return ignore + */ + @Operation(summary = "重定向第三方登录页面") + @Parameters({ + @Parameter(name = "source", description = "地址", required = true) + }) + @GetMapping("/render/{source}") + @ResponseBody + public ActionResult render(@PathVariable String source) { + AuthRequest authRequest = authSocialsUtil.getAuthRequest(source, UserProvider.getUser().getUserId(), false, null, UserProvider.getUser().getTenantId()); + String authorizeUrl = authRequest.authorize(AuthStateUtils.createState()); + return ActionResult.success(authorizeUrl); + } + + + /** + * 设置租户库 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/9/8 + */ + private boolean setTenantData(String tenantId, UserInfo userInfo) { + try{ + TenantDataSourceUtil.switchTenant(tenantId); + }catch (Exception e){ + return false; + } + return true; + } + + /** + * 解绑 + * + * @param userId 用户id + * @param id 主键 + * @return ignore + */ + @UserPermission + @Operation(summary = "解绑") + @Parameters({ + @Parameter(name = "userId", description = "用户id"), + @Parameter(name = "id", description = "主键", required = true) + }) + @DeleteMapping("/{id}") + public ActionResult deleteSocials(@RequestParam(value = "userId",required = false)String userId,@PathVariable("id") String id) { + SocialsUserEntity byId = socialsUserService.getById(id); + UserInfo userInfo = UserProvider.getUser(); + boolean b = socialsUserService.removeById(id); + if (b) { + //多租户开启-解除绑定 + if (configValueUtil.isMultiTenancy()) { + String param = "?userId=" + byId.getUserId() + "&tenantId=" + userInfo.getTenantId() + "&socialsType=" + byId.getSocialType(); + JSONObject object = HttpUtil.httpRequest(configValueUtil.getMultiTenancyUrl() + "socials" + param, "DELETE", null); + if (object == null || "500".equals(object.get("code").toString()) || "400".equals(object.getString("code"))) { + return ActionResult.fail(MsgCode.PS018.get()); + } + } + return ActionResult.success(MsgCode.SU005.get()); + } + return ActionResult.fail(MsgCode.PS018.get()); + } + + + @GetMapping("/list") + @NoDataSourceBind + public List getLoginList(@RequestParam("ticket") String ticket) { + if (!socialsConfig.isSocialsEnabled()) return null; + List> platformInfos = SocialsAuthEnum.getPlatformInfos(); + String s = JSONArray.toJSONString(platformInfos); + List socialsUserVos = JsonUtil.getJsonToList(s, SocialsUserVo.class); + List config = socialsConfig.getConfig(); + List res = new ArrayList<>(); + config.stream().forEach(item -> { + socialsUserVos.stream().forEach(item2 -> { + if (item2.getEnname().toLowerCase().equals(item.getProvider())) { + AuthRequest authRequest = authSocialsUtil.getAuthRequest(item2.getEnname(), null, true, ticket, null); + String authorizeUrl = authRequest.authorize(AuthStateUtils.createState()); + item2.setRenderUrl(authorizeUrl); + res.add(item2); + } + }); + }); + return res; + } + + @GetMapping("/getSocialsUserInfo") + @NoDataSourceBind + public SocialsUserInfo getSocialsUserInfo(@RequestParam("source") String source, @RequestParam("code") String code, + @RequestParam(value = "state", required = false) String state) throws LoginException { + //获取第三方请求 + AuthCallbackNew callback = setAuthCallback(code, state); + AuthRequest authRequest = authSocialsUtil.getAuthRequest(source, null, false, null, null); + AuthResponse res = authRequest.login(callback); + if(AuthResponseStatus.FAILURE.getCode()==res.getCode()){ + throw new LoginException("连接失败!"); + }else if(AuthResponseStatus.SUCCESS.getCode()!=res.getCode()){ + throw new LoginException("授权失败:"+res.getMsg()); + } + //登录用户第三方id + String uuid = getSocialUuid(res); + String socialName=StringUtil.isNotEmpty(res.getData().getUsername())?res.getData().getUsername():res.getData().getNickname(); + SocialsUserInfo socialsUserInfo = getUserInfo(source, uuid, socialName); + return socialsUserInfo; + } + + /** + * 获取用户绑定信息列表 + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/9/20 + */ + @NoDataSourceBind + public SocialsUserInfo getUserInfo(String source, String uuid, String socialName) throws LoginException { + SocialsUserInfo socialsUserInfo=new SocialsUserInfo(); + UserInfo userInfo=new UserInfo(); + //查询租户绑定 + if ("wechat_applets".equals(source)) { + source = "wechat_open"; + } + if (configValueUtil.isMultiTenancy()) { + JSONObject object = HttpUtil.httpRequest(configValueUtil.getMultiTenancyUrl() + "socials/list?socialsId=" + uuid, "GET", null); + if (object == null || "500".equals(object.get("code").toString()) || "400".equals(object.getString("code"))) { + throw new LoginException("租户绑定信息查询错误!"); + } + if ("200".equals(object.get("code").toString())) { + JSONArray data = JSONArray.parseArray(object.get("data").toString()); + int size = data.size(); + System.out.println(size); + if (data == null || data.size() == 0) { + socialsUserInfo.setSocialUnionid(uuid); + socialsUserInfo.setSocialName(socialName); + return socialsUserInfo; + } else if (data.size() == 1) { + //租户开启时-切换租户库 + JSONObject oneUser = (JSONObject) data.get(0); + setTenantData(oneUser.get("tenantId").toString(), userInfo); + List list = socialsUserService.getUserIfnoBySocialIdAndType(uuid, source); + if (CollectionUtil.isEmpty(list)) { + throw new LoginException("第三方未绑定账号!"); + } + UserEntity infoById = userService.getInfo(list.get(0).getUserId()); + userInfo = JsonUtil.getJsonToBean(infoById, UserInfo.class); + userInfo.setUserId(infoById.getId()); + userInfo.setUserAccount(oneUser.get("tenantId").toString() + "@" + infoById.getAccount()); + socialsUserInfo.setTenantUserInfo(data); + socialsUserInfo.setUserInfo(userInfo); + } else { + socialsUserInfo.setTenantUserInfo(data); + } + } + } else {//非多租户 + //查询绑定 + List list = socialsUserService.getUserIfnoBySocialIdAndType(uuid, source); + if (CollectionUtil.isNotEmpty(list)) { + UserEntity infoById = userService.getInfo(list.get(0).getUserId()); + userInfo = JsonUtil.getJsonToBean(infoById, UserInfo.class); + userInfo.setUserId(infoById.getId()); + userInfo.setUserAccount(infoById.getAccount()); + socialsUserInfo.setUserInfo(userInfo); + } else { + socialsUserInfo.setSocialUnionid(uuid); + socialsUserInfo.setSocialName(socialName); + } + } + return socialsUserInfo; + } + + /** + * 绑定 + * + * @return ignore + */ + @GetMapping("/callback") + @ResponseBody + @NoDataSourceBind + public JSONObject binding(@RequestParam("source") String source, + @RequestParam(value = "userId", required = false) String userId, + @RequestParam(value = "tenantId", required = false) String tenantId, + @RequestParam(value = "code", required = false) String code, + @RequestParam(value = "state", required = false) String state) { + log.info("进入callback:" + source + " callback params:"); + //获取第三方请求 + AuthCallbackNew callback = setAuthCallback(code, state); + //租户开启时-切换租户库 + if (configValueUtil.isMultiTenancy()) { + boolean b = setTenantData(tenantId, new UserInfo()); + if (!b) { + return resultJson(201, "查询租户信息错误!"); + } + + } + //获取第三方请求 + AuthRequest authRequest = authSocialsUtil.getAuthRequest(source, userId, false, null, null); + AuthResponse res = authRequest.login(callback); + log.info(JSONObject.toJSONString(res)); + if (res.ok()) { + String uuid = getSocialUuid(res); + List userIfnoBySocialIdAndType = socialsUserService.getUserIfnoBySocialIdAndType(uuid, source); + if (CollectionUtil.isNotEmpty(userIfnoBySocialIdAndType)) { + UserEntity info = userService.getInfo(userIfnoBySocialIdAndType.get(0).getUserId()); + return resultJson(201, "当前账户已被" + info.getRealName() + "/" + info.getAccount() + "绑定,不能重复绑定"); + } + SocialsUserEntity socialsUserEntity = new SocialsUserEntity(); + socialsUserEntity.setUserId(userId); + socialsUserEntity.setSocialType(source); + socialsUserEntity.setSocialName(res.getData().getUsername()); + socialsUserEntity.setSocialId(uuid); + socialsUserEntity.setCreatorTime(new Date()); + boolean save = socialsUserService.save(socialsUserEntity); + + //租户开启时-添加租户库绑定数据 + if (configValueUtil.isMultiTenancy() && save) { + JSONObject params = (JSONObject) JSONObject.toJSON(socialsUserEntity); + UserEntity info = userService.getInfo(userId); + params.put("tenantId", tenantId); + params.put("account", info.getAccount()); + params.put("accountName", info.getRealName() + "/" + info.getAccount()); + JSONObject object = HttpUtil.httpRequest(configValueUtil.getMultiTenancyUrl() + "socials", "POST", params.toJSONString()); + if (object == null || "500".equals(object.get("code").toString()) || "400".equals(object.getString("code"))) { + return resultJson(201, "用户租户绑定错误!"); + } + } + return resultJson(200, "绑定成功!"); + + } + return resultJson(201, "第三方回调失败!"); + } + + /** + * 设置第三方code state参数 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/9/8 + */ + private AuthCallbackNew setAuthCallback(String code, String state) { + AuthCallbackNew callback = new AuthCallbackNew(); + callback.setAuthCode(code); + callback.setAuth_code(code); + callback.setAuthorization_code(code); + callback.setCode(code); + callback.setState(state); + return callback; + } + + /** + * 返回json + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/9/8 + */ + private JSONObject resultJson(int code, String message) { + JSONObject jsonObject = new JSONObject(); + jsonObject.put("code", code); + jsonObject.put("message", message); + return jsonObject; + } + private String getSocialUuid(AuthResponse res) { + String uuid = res.getData().getUuid(); + if (res.getData().getToken() != null && StringUtil.isNotEmpty(res.getData().getToken().getUnionId())) { + uuid = res.getData().getToken().getUnionId(); + } + return uuid; + } + + /** + * 绑定 + * + * @return ignore + */ + @GetMapping("/loginbind") + @ResponseBody + @NoDataSourceBind + public void loginAutoBinding(@RequestParam("socialType") String socialType, + @RequestParam("socialUnionid") String socialUnionid, + @RequestParam("socialName") String socialName, + @RequestParam("userId") String userId, + @RequestParam(value = "tenantId", required = false) String tenantId) { + //查询租户绑定 + if ("wechat_applets".equals(socialType)) { + socialType = "wechat_open"; + } + //租户开启时-切换租户库 + if (configValueUtil.isMultiTenancy()) { + setTenantData(tenantId, new UserInfo()); + } + List list = socialsUserService.getListByUserIdAndSource(userId, socialType); + if(CollectionUtil.isNotEmpty(list)){//账号已绑定该第三方其他账号,则不绑定 + return; + } + SocialsUserEntity socialsUserEntity = new SocialsUserEntity(); + socialsUserEntity.setUserId(userId); + socialsUserEntity.setSocialType(socialType); + socialsUserEntity.setSocialName(socialName); + socialsUserEntity.setSocialId(socialUnionid); + socialsUserEntity.setCreatorTime(new Date()); + boolean save = socialsUserService.save(socialsUserEntity); + //租户开启时-添加租户库绑定数据 + if (configValueUtil.isMultiTenancy() && save) { + JSONObject params = (JSONObject) JSONObject.toJSON(socialsUserEntity); + UserEntity info = userService.getInfo(userId); + params.put("tenantId", tenantId); + params.put("account", info.getAccount()); + params.put("accountName", info.getRealName() + "/" + info.getAccount()); + JSONObject object = HttpUtil.httpRequest(configValueUtil.getMultiTenancyUrl() + "socials", "POST", params.toJSONString()); + + } + } +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-controller/src/main/java/com/yunzhupaas/permission/controller/UserController.java b/yunzhupaas-permission/yunzhupaas-permission-controller/src/main/java/com/yunzhupaas/permission/controller/UserController.java new file mode 100644 index 0000000..695ab7c --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-controller/src/main/java/com/yunzhupaas/permission/controller/UserController.java @@ -0,0 +1,2151 @@ +package com.yunzhupaas.permission.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.collection.CollectionUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.google.common.collect.ImmutableList; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.annotation.UserPermission; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.Page; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.service.DictionaryDataService; +import com.yunzhupaas.base.service.SysconfigService; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.constant.PermissionConst; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.flowable.enums.ExtraRuleEnum; +import com.yunzhupaas.message.service.SynThirdDingTalkService; +import com.yunzhupaas.message.service.SynThirdQyService; +import com.yunzhupaas.model.*; +import com.yunzhupaas.model.tenant.AdminInfoVO; +import com.yunzhupaas.model.tenant.TenantReSetPasswordForm; +import com.yunzhupaas.model.tenant.TenantVO; +import com.yunzhupaas.permission.constant.UserColumnMap; +import com.yunzhupaas.permission.entity.*; +import com.yunzhupaas.permission.model.check.CheckResult; +import com.yunzhupaas.permission.model.permission.PermissionModel; +import com.yunzhupaas.permission.model.role.RoleModel; +import com.yunzhupaas.permission.model.user.UserIdListVo; +import com.yunzhupaas.permission.model.user.WorkHandoverModel; +import com.yunzhupaas.permission.model.user.form.UserCrForm; +import com.yunzhupaas.permission.model.user.form.UserResetPasswordForm; +import com.yunzhupaas.permission.model.user.form.UserUpForm; +import com.yunzhupaas.permission.model.user.mod.*; +import com.yunzhupaas.permission.model.user.page.PageUser; +import com.yunzhupaas.permission.model.user.page.PaginationUser; +import com.yunzhupaas.permission.model.user.vo.*; +import com.yunzhupaas.permission.rest.PullUserUtil; +import com.yunzhupaas.permission.service.*; +import com.yunzhupaas.base.util.ExcelTool; +import com.yunzhupaas.permission.util.PermissionUtil; +import com.yunzhupaas.service.AuthService; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.enums.DictionaryDataEnum; +import com.yunzhupaas.util.treeutil.SumTree; +import com.yunzhupaas.util.treeutil.newtreeutil.TreeDotUtils; +import com.yunzhupaas.workflow.service.TemplateApi; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; + +import java.io.IOException; +import java.util.*; +import java.util.stream.Collectors; + +import static com.yunzhupaas.util.Constants.ADMIN_KEY; + +/** + * 用户管理 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +@Tag(name = "用户管理", description = "Users") +@Slf4j +@RestController +@RequestMapping("/api/permission/Users") +public class UserController extends SuperController { + + @Autowired + private CacheKeyUtil cacheKeyUtil; + @Autowired + private SynThirdQyService synThirdQyService; + @Autowired + private SynThirdDingTalkService synThirdDingTalkService; + @Autowired + private UserService userService; + @Autowired + private OrganizeService organizeService; + @Autowired + private RedisUtil redisUtil; + @Autowired + private UserRelationService userRelationService; + @Autowired + private RoleService roleService; + @Autowired + private OrganizeRelationService organizeRelationService; + @Autowired + private PermissionGroupService permissionGroupService; + @Autowired + private PositionService positionService; + @Autowired + private GroupService groupService; + @Autowired + private TemplateApi templateApi; + + @Autowired + private AuthService authService; + @Autowired + private DictionaryDataService dictionaryDataApi; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private SysconfigService sysconfigApi; + + /** + * 获取用户列表 + * + * @param pagination 分页参数 + * @return ignore + */ + @Operation(summary = "获取用户列表") + @GetMapping + public ActionResult> getList(PaginationUser pagination) { + List userList = userService.getList(pagination, pagination.getOrganizeId(), false, true, pagination.getEnabledMark(), pagination.getGender()); + List list = new ArrayList<>(); + // 得到性别 + List dataServiceList4 = dictionaryDataApi.getListByTypeDataCode("sex"); + Map dataServiceMap4 = dataServiceList4.stream().collect(Collectors.toMap(DictionaryDataEntity::getEnCode, DictionaryDataEntity::getFullName)); + Map orgIdNameMaps = organizeService.getInfoList(); + for (UserEntity userEntity : userList) { + UserListVO userVO = JsonUtil.getJsonToBean(userEntity, UserListVO.class); + userVO.setHandoverMark(userEntity.getHandoverMark() == null ? 0 : userEntity.getHandoverMark()); + userVO.setHeadIcon(UploaderUtil.uploaderImg(userVO.getHeadIcon())); + // 时间小于当前时间则判断已解锁 + if (userVO.getEnabledMark() != null && userVO.getEnabledMark() != 0) { + if (Objects.nonNull(userEntity.getUnlockTime()) && userEntity.getUnlockTime().getTime() > System.currentTimeMillis()) { + userVO.setEnabledMark(2); + } else if (Objects.nonNull(userEntity.getUnlockTime()) && userEntity.getUnlockTime().getTime() < System.currentTimeMillis()) { + userVO.setEnabledMark(1); + } + } + List orgRelationByUserId = userRelationService.getAllOrgRelationByUserId(userEntity.getId()); + // 储存组织id信息 + StringJoiner stringJoiner = new StringJoiner(","); + for (UserRelationEntity userRelationEntity : orgRelationByUserId) { + // 获取组织id详情 + OrganizeEntity entity = organizeService.getInfo(userRelationEntity.getObjectId()); + if (entity != null) { + // 获取到组织树 + String organizeIdTree = entity.getOrganizeIdTree(); + if (StringUtil.isNotEmpty(organizeIdTree)) { + stringJoiner.add(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, organizeIdTree, "/")); + } + } + } + userVO.setGender(dataServiceMap4.get(userEntity.getGender())); + userVO.setOrganize(stringJoiner.toString()); + list.add(userVO); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(list, paginationVO); + } + + /** + * 获取用户列表 + * + * @return ignore + */ + @Operation(summary = "获取所有用户列表") + @GetMapping("/All") + public ActionResult> getAllUsers(PaginationUser pagination) { + List list = userService.getList(pagination, null, false, false, null, null); + List user = JsonUtil.getJsonToList(list, UserAllVO.class); + ListVO vo = new ListVO<>(); + vo.setList(user); + return ActionResult.success(vo); + } + + /** + * IM通讯获取用户接口 + * + * @param pagination 分页参数 + * @return ignore + */ + @Operation(summary = "IM通讯获取用户") + @GetMapping("/ImUser") + public ActionResult> getAllImUserUsers(Pagination pagination) { + List data = userService.getList(pagination, true); + List list = new ArrayList<>(); + Map orgMaps = organizeService.getOrganizeName(data.stream().map(t -> t.getOrganizeId()).collect(Collectors.toList()), null, false, null); + for (UserEntity entity : data) { + ImUserListVo user = JsonUtil.getJsonToBean(entity, ImUserListVo.class); + OrganizeEntity organize = orgMaps.get(entity.getOrganizeId()); + user.setDepartment(organize != null ? organize.getFullName() : ""); + user.setHeadIcon(UploaderUtil.uploaderImg(entity.getHeadIcon())); + list.add(user); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(list, paginationVO); + } + + /** + * 获取用户下拉框列表 + * + * @return ignore + */ + @Operation(summary = "获取用户下拉框列表") + @GetMapping("/Selector") + public ActionResult> selector() { + Map orgMaps = organizeService.getOrgMaps(null, true, null); + List organizeData = new ArrayList<>(orgMaps.values()); + List userData = userService.getList(true); + List treeList = JsonUtil.getJsonToList(organizeData, UserSelectorModel.class); + for (UserSelectorModel entity1 : treeList) { + if ("department".equals(entity1.getType())) { + entity1.setIcon("icon-ym icon-ym-tree-department1"); + } else if ("company".equals(entity1.getType())) { + entity1.setIcon("icon-ym icon-ym-tree-organization3"); + } + } + for (UserEntity entity : userData) { + UserSelectorModel treeModel = new UserSelectorModel(); + treeModel.setId(entity.getId()); + treeModel.setParentId(entity.getOrganizeId()); + treeModel.setFullName(entity.getRealName() + "/" + entity.getAccount()); + treeModel.setType("user"); + treeModel.setIcon("icon-ym icon-ym-tree-user2"); + treeList.add(treeModel); + } + List> trees = TreeDotUtils.convertListToTreeDot(treeList); + List listvo = JsonUtil.getJsonToList(trees, UserSelectorVO.class); + List entities = organizeData.stream().filter( + t -> "-1".equals(t.getParentId()) + ).collect(Collectors.toList()); + Iterator iterator = listvo.iterator(); + while (iterator.hasNext()) { + UserSelectorVO userSelectorVO = iterator.next(); + for (OrganizeEntity entity : entities) { + if (entity.getId().equals(userSelectorVO.getParentId())) { + iterator.remove();//使用迭代器的删除方法删除 + } + } + } + ListVO vo = new ListVO<>(); + vo.setList(listvo); + return ActionResult.success(vo); + } + + /** + * 通过部门、岗位、用户、角色、分组id获取用户列表 + * + * @param userConditionModel 用户选择模型 + * @return + */ + @Operation(summary = "通过部门、岗位、用户、角色、分组id获取用户列表") + @Parameters({ + @Parameter(name = "userConditionModel", description = "用户选择模型", required = true) + }) + @PostMapping("/UserCondition") + public ActionResult userCondition(@RequestBody UserConditionModel userConditionModel) { + List list = new ArrayList<>(16); + if (userConditionModel.getDepartIds() != null) { + list.addAll(userConditionModel.getDepartIds()); + } + if (userConditionModel.getRoleIds() != null) { + list.addAll(userConditionModel.getRoleIds()); + } + if (userConditionModel.getPositionIds() != null) { + list.addAll(userConditionModel.getPositionIds()); + } + if (userConditionModel.getGroupIds() != null) { + list.addAll(userConditionModel.getGroupIds()); + } + if (list.size() == 0) { + list = userRelationService.getListByObjectType(userConditionModel.getType()).stream().map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + if (PermissionConst.GROUP.equals(userConditionModel.getType())) { + List groupList = groupService.getListByIds(list, true); + list = groupList.stream().map(GroupEntity::getId).collect(Collectors.toList()); + } + if (PermissionConst.ORGANIZE.equals(userConditionModel.getType())) { + List orgList = organizeService.getOrgEntityList(list, true); + list = orgList.stream().map(OrganizeEntity::getId).collect(Collectors.toList()); + } + if (PermissionConst.ROLE.equals(userConditionModel.getType())) { + List roleList = roleService.getListByIds(list, null, false); + list = roleList.stream().filter(t -> t.getEnabledMark() == 1).map(RoleEntity::getId).collect(Collectors.toList()); + } + if (PermissionConst.POSITION.equals(userConditionModel.getType())) { + List positionList = positionService.getPosList(list); + list = positionList.stream().filter(t -> t.getEnabledMark() == 1).map(PositionEntity::getId).collect(Collectors.toList()); + } + } + List collect = userRelationService.getListByObjectIdAll(list).stream().map(UserRelationEntity::getUserId).collect(Collectors.toList()); + if (userConditionModel.getUserIds() != null) { + collect.addAll(userConditionModel.getUserIds()); + } + collect = collect.stream().distinct().collect(Collectors.toList()); + List userName = userService.getUserName(collect, userConditionModel.getPagination()); + List jsonToList = JsonUtil.getJsonToList(userName, UserIdListVo.class); + Map orgIdNameMaps = organizeService.getInfoList(); + jsonToList.forEach(t -> { + t.setHeadIcon(UploaderUtil.uploaderImg(t.getHeadIcon())); + t.setFullName(t.getRealName() + "/" + t.getAccount()); + List listByUserId = userRelationService.getListByUserId(t.getId(), PermissionConst.ORGANIZE); + List orgId = listByUserId.stream().map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + List organizeName = new ArrayList<>(organizeService.getOrganizeName(orgId, null, false, null).values()); + StringBuilder stringBuilder = new StringBuilder(); + organizeName.forEach(org -> { + if (StringUtil.isNotEmpty(org.getOrganizeIdTree())) { + String fullNameByOrgIdTree = organizeService.getFullNameByOrgIdTree(orgIdNameMaps, org.getOrganizeIdTree(), "/"); + stringBuilder.append(","); + stringBuilder.append(fullNameByOrgIdTree); + } + }); + if (stringBuilder.length() > 0) { + t.setOrganize(stringBuilder.toString().replaceFirst(",", "")); + } + }); + PaginationVO paginationVO = JsonUtil.getJsonToBean(userConditionModel.getPagination(), PaginationVO.class); + return ActionResult.page(jsonToList, paginationVO); + } + + /** + * 获取用户下拉框列表 + * + * @param organizeIdForm 组织id + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "获取用户下拉框列表") + @Parameters({ + @Parameter(name = "organizeId", description = "组织id", required = true), + @Parameter(name = "pagination", description = "分页模型", required = true) + }) + @PostMapping("/ImUser/Selector/{organizeId}") + public ActionResult imUserSelector(@PathVariable("organizeId") String organizeIdForm, @RequestBody Pagination pagination) { + String organizeId = XSSEscape.escape(organizeIdForm); + List jsonToList = new ArrayList<>(); + Map orgIdNameMaps = organizeService.getInfoList(); + Map orgMaps = organizeService.getOrgMaps(null, true, null); + //判断是否搜索关键字 + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + //通过关键字查询 + List list = userService.getList(pagination, false); + //遍历用户给要返回的值插入值 + for (UserEntity entity : list) { + UserSelectorVO vo = JsonUtil.getJsonToBean(entity, UserSelectorVO.class); + vo.setParentId(entity.getOrganizeId()); + vo.setFullName(entity.getRealName() + "/" + entity.getAccount()); + vo.setType("user"); + vo.setIcon("icon-ym icon-ym-tree-user2"); + vo.setHeadIcon(UploaderUtil.uploaderImg(vo.getHeadIcon())); + List listByUserId = userRelationService.getListByUserId(entity.getId()).stream().filter(t -> t != null && PermissionConst.ORGANIZE.equals(t.getObjectType())).collect(Collectors.toList()); + StringJoiner stringJoiner = new StringJoiner(","); + listByUserId.forEach(t -> { + OrganizeEntity organizeEntity = orgMaps.get(t.getObjectId()); + if (organizeEntity != null) { + String fullNameByOrgIdTree = organizeService.getFullNameByOrgIdTree(orgIdNameMaps, organizeEntity.getOrganizeIdTree(), "/"); + if (StringUtil.isNotEmpty(fullNameByOrgIdTree)) { + stringJoiner.add(fullNameByOrgIdTree); + } + } + }); + vo.setOrganize(stringJoiner.toString()); + vo.setHasChildren(false); + vo.setIsLeaf(true); + jsonToList.add(vo); + } + PaginationVO jsonToBean = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(jsonToList, jsonToBean); + } + //获取所有组织 + List collect = new ArrayList<>(orgMaps.values()); + //判断时候传入组织id + //如果传入组织id,则取出对应的子集 + if (!"0".equals(organizeId)) { + //通过组织查询部门及人员 + //单个组织 + OrganizeEntity organizeEntity = orgMaps.get(organizeId); + if (organizeEntity != null) { + //取出组织下的部门 + List collect1 = collect.stream().filter(t -> t.getParentId().equals(organizeEntity.getId())).collect(Collectors.toList()); + for (OrganizeEntity entitys : collect1) { + UserSelectorVO vo = JsonUtil.getJsonToBean(entitys, UserSelectorVO.class); + if ("department".equals(entitys.getCategory())) { + vo.setIcon("icon-ym icon-ym-tree-department1"); + } else if ("company".equals(entitys.getCategory())) { + vo.setIcon("icon-ym icon-ym-tree-organization3"); + } + vo.setOrganize(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, entitys.getOrganizeIdTree(), "/")); + // 判断组织下是否有人 + jsonToList.add(vo); + vo.setHasChildren(true); + vo.setIsLeaf(false); + } + //取出组织下的人员 + List entityList = userService.getListByOrganizeId(organizeId, null); + for (UserEntity entity : entityList) { + if ("0".equals(String.valueOf(entity.getEnabledMark()))) { + continue; + } + UserSelectorVO vo = JsonUtil.getJsonToBean(entity, UserSelectorVO.class); + vo.setParentId(organizeId); + vo.setFullName(entity.getRealName() + "/" + entity.getAccount()); + vo.setType("user"); + vo.setIcon("icon-ym icon-ym-tree-user2"); + List listByUserId = userRelationService.getListByUserId(entity.getId()).stream().filter(t -> t != null && PermissionConst.ORGANIZE.equals(t.getObjectType())).collect(Collectors.toList()); + StringBuilder stringBuilder = new StringBuilder(); + listByUserId.forEach(t -> { + OrganizeEntity organizeEntity1 = orgMaps.get(t.getObjectId()); + if (organizeEntity1 != null) { + String fullNameByOrgIdTree = organizeService.getFullNameByOrgIdTree(orgIdNameMaps, organizeEntity1.getOrganizeIdTree(), "/"); + if (StringUtil.isNotEmpty(fullNameByOrgIdTree)) { + stringBuilder.append("," + fullNameByOrgIdTree); + } + } + }); + if (stringBuilder.length() > 0) { + vo.setOrganize(stringBuilder.toString().replaceFirst(",", "")); + } + vo.setHeadIcon(UploaderUtil.uploaderImg(vo.getHeadIcon())); + vo.setHasChildren(false); + vo.setIsLeaf(true); + jsonToList.add(vo); + } + } + ListVO vo = new ListVO<>(); + vo.setList(jsonToList); + return ActionResult.success(vo); + } + + //如果没有组织id,则取出所有组织 + jsonToList = JsonUtil.getJsonToList(collect.stream().filter(t -> "-1".equals(t.getParentId())).collect(Collectors.toList()), UserSelectorVO.class); + //添加图标 + for (UserSelectorVO userSelectorVO : jsonToList) { + userSelectorVO.setIcon("icon-ym icon-ym-tree-organization3"); + userSelectorVO.setHasChildren(true); + userSelectorVO.setIsLeaf(false); + userSelectorVO.setOrganize(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, orgMaps.get(userSelectorVO.getId()).getOrganizeIdTree(), "/")); + } + ListVO vo = new ListVO<>(); + vo.setList(jsonToList); + return ActionResult.success(vo); + } + + /** + * 获取用户下拉框列表 + * + * @param organizeId 组织id + * @param page 关键字 + * @return + */ + @Operation(summary = "获取用户下拉框列表") + @Parameters({ + @Parameter(name = "organizeId", description = "组织id", required = true), + @Parameter(name = "page", description = "关键字", required = true) + }) + @SaCheckPermission("permission.grade") + @PostMapping("/GetListByAuthorize/{organizeId}") + public ActionResult> getListByAuthorize(@PathVariable("organizeId") String organizeId, @RequestBody Page page) { + List jsonToList = userService.getListByAuthorize(organizeId, page); + ListVO listVO = new ListVO(); + listVO.setList(jsonToList); + return ActionResult.success(listVO); + } + + /** + * 获取用户信息 + * + * @param id 用户id + * @return ignore + */ + @Operation(summary = "获取用户信息") + @Parameters({ + @Parameter(name = "id", description = "用户id", required = true) + }) + @SaCheckPermission("permission.user") + @GetMapping("/{id}") + public ActionResult getInfo(@PathVariable("id") String id) throws DataException { + UserEntity entity = userService.getInfo(id); + if (entity == null) { + return ActionResult.fail(MsgCode.FA001.get()); + } + + QueryWrapper roleQuery = new QueryWrapper<>(); + roleQuery.lambda().eq(UserRelationEntity::getUserId, id); + roleQuery.lambda().eq(UserRelationEntity::getObjectType, PermissionConst.ROLE); + List roleIdList = new ArrayList<>(); + for (UserRelationEntity ure : userRelationService.list(roleQuery)) { + roleIdList.add(ure.getObjectId()); + } + + entity.setHeadIcon(UploaderUtil.uploaderImg(entity.getHeadIcon())); + // 得到组织树 + UserInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, UserInfoVO.class); + vo.setRoleId(String.join(",", roleIdList)); + + + // 获取组织id数组 + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(UserRelationEntity::getUserId, id); + query.lambda().eq(UserRelationEntity::getObjectType, PermissionConst.ORGANIZE); + List organizeIds = new ArrayList<>(); + userRelationService.list(query).forEach(u -> { + organizeIds.add(u.getObjectId()); + }); + + // 岗位装配 + QueryWrapper positionQuery = new QueryWrapper<>(); + positionQuery.lambda().eq(UserRelationEntity::getUserId, id); + positionQuery.lambda().eq(UserRelationEntity::getObjectType, PermissionConst.POSITION); + String positionIds = ""; + for (UserRelationEntity ure : userRelationService.list(positionQuery)) { + PositionEntity info = positionService.getInfo(ure.getObjectId()); + if (info != null) { + positionIds = positionIds + "," + ure.getObjectId(); + } + } + if (positionIds.length() > 0) { + vo.setPositionId(positionIds.substring(1)); + } else { + vo.setPositionId(null); + } + // 设置分组id + List listByObjectType = userRelationService.getListByObjectType(entity.getId(), PermissionConst.GROUP); + StringBuilder groupId = new StringBuilder(); + listByObjectType.stream().forEach(t -> groupId.append("," + t.getObjectId())); + if (groupId.length() > 0) { + vo.setGroupId(groupId.toString().replaceFirst(",", "")); + } + vo.setOrganizeIdTree(PermissionUtil.getOrgIdsTree(organizeIds, 1, organizeService)); + return ActionResult.success(vo); + } + + /** + * 新建用户 + * + * @param userCrForm 表单参数 + */ + @UserPermission + @Operation(summary = "新建用户") + @Parameters({ + @Parameter(name = "userCrForm", description = "表单参数", required = true) + }) + @SaCheckPermission("permission.user") + @PostMapping + public ActionResult create(@RequestBody @Valid UserCrForm userCrForm) throws Exception { + UserEntity entity = JsonUtil.getJsonToBean(userCrForm, UserEntity.class); + if (userService.isExistByAccount(userCrForm.getAccount())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (StringUtil.isEmpty(entity.getGender())) { + return ActionResult.fail(MsgCode.PS020.get()); + } + userService.create(entity); + ThreadPoolExecutorUtil.getExecutor().execute(() -> { + try { + //添加用户之后判断是否需要同步到企业微信 + synThirdQyService.createUserSysToQy(false, entity, ""); + //添加用户之后判断是否需要同步到钉钉 + synThirdDingTalkService.createUserSysToDing(false, entity, ""); + } catch (Exception e) { + log.error("添加用户之后同步失败到企业微信或钉钉失败,异常:" + e.getMessage()); + } + }); + String catchKey = cacheKeyUtil.getAllUser(); + if (redisUtil.exists(catchKey)) { + redisUtil.remove(catchKey); + } + BaseSystemInfo sysInfo = sysconfigApi.getSysInfo(); + entity.setPassword(sysInfo.getNewUserDefaultPassword()); + PullUserUtil.syncUser(entity, "create", UserProvider.getUser().getTenantId()); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 修改用户 + * + * @param userUpForm 表单参数 + * @param id 主键值 + */ + @UserPermission + @Operation(summary = "修改用户") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true), + @Parameter(name = "userUpForm", description = "表单参数", required = true) + }) + @SaCheckPermission("permission.user") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid UserUpForm userUpForm) throws Exception { + UserEntity entity = JsonUtil.getJsonToBean(userUpForm, UserEntity.class); + if (StringUtil.isEmpty(entity.getGender())) { + return ActionResult.fail(MsgCode.PS020.get()); + } + //将禁用的id加进数据 + UserEntity originUser = userService.getInfo(id); + UserInfoVO infoVO = this.getInfo(id).getData(); + // 如果是管理员的话 + if ("1".equals(String.valueOf(originUser.getIsAdministrator()))) { + UserInfo operatorUser = UserProvider.getUser(); + // 管理员可以修改自己,但是无法修改其他管理员 + if (operatorUser.getIsAdministrator()) { + if (originUser.getEnabledMark() != 0 && entity.getEnabledMark() == 0) { + return ActionResult.fail(MsgCode.PS021.get()); + } + if (!ADMIN_KEY.equals(userService.getInfo(operatorUser.getUserId()).getAccount())) { + if (!operatorUser.getUserId().equals(id)) { + return ActionResult.fail(MsgCode.PS022.get()); + } + } + } else { + return ActionResult.fail(MsgCode.PS023.get()); + } + } + //直属主管不能是自己 + if (id.equals(userUpForm.getManagerId())) { + return ActionResult.fail(MsgCode.PS024.get()); + } + if (!originUser.getAccount().equals(entity.getAccount())) { + if (userService.isExistByAccount(entity.getAccount())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + } + // 验证是否有十级,验证是否是自己的下属 + boolean subordinate = userService.isSubordinate(id, userUpForm.getManagerId()); + if (subordinate) { + return ActionResult.fail(MsgCode.PS025.get()); + } + // 如果账号被锁定 + if ("2".equals(String.valueOf(entity.getEnabledMark()))) { + entity.setUnlockTime(null); + entity.setLogErrorCount(0); + } + // 如果原来是锁定,现在不锁定,则置空错误次数 + if (originUser.getEnabledMark() == 2 && entity.getEnabledMark() == 1) { + entity.setUnlockTime(null); + entity.setLogErrorCount(0); + } + boolean flag = userService.update(id, entity); + ThreadPoolExecutorUtil.getExecutor().execute(() -> { + try { + //修改用户之后判断是否需要同步到企业微信 + synThirdQyService.updateUserSysToQy(false, entity, ""); + //修改用户之后判断是否需要同步到钉钉 + synThirdDingTalkService.updateUserSysToDing(false, entity, ""); + } catch (Exception e) { + log.error("修改用户之后同步失败到企业微信或钉钉失败,异常:" + e.getMessage()); + } + }); + if (!flag) { + return ActionResult.fail(MsgCode.FA002.get()); + } + // 删除在线的用户 +// if (needSignOut(id, userUpForm, infoVO)) { + userService.delCurUser(MsgCode.PS030.get(), ImmutableList.of(id),3); +// } + PullUserUtil.syncUser(entity, "update", UserProvider.getUser().getTenantId()); + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 修改用户【组织】【岗位】【角色】时 + * 需要退出登录的判断 + * + * @param id + * @param userUpForm + * @param infoVO + * @return + */ + private boolean needSignOut(String id, UserUpForm userUpForm, UserInfoVO infoVO) { + StringJoiner organizeIds = new StringJoiner(","); + List> organizeIdTree = infoVO.getOrganizeIdTree(); + for (LinkedList ids : organizeIdTree) { + if (ids.size() > 0) { + organizeIds.add(ids.get(ids.size() - 1)); + } + } + return !Objects.equals(organizeIds.toString(), userUpForm.getOrganizeId()) || !Objects.equals(infoVO.getPositionId(), userUpForm.getPositionId()) + || !Objects.equals(infoVO.getRoleId(), userUpForm.getRoleId()); + } + + /** + * 删除用户 + * + * @param id 主键值 + * @return ignore + */ + @UserPermission + @Operation(summary = "删除用户") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("permission.user") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + UserEntity entity = userService.getInfo(id); + if (entity != null) { + if ("1".equals(String.valueOf(entity.getIsAdministrator()))) { + return ActionResult.fail(MsgCode.PS026.get()); + } + //判断是否是部门主管 + if (organizeService.getList(false).stream().filter(t -> id.equals(t.getManagerId())).collect(Collectors.toList()).size() > 0) { + return ActionResult.fail(MsgCode.PS027.get()); + } + // 有下属不允许删除 +// if (userService.getListByManagerId(id, null).size() > 0) { +// return ActionResult.fail(MsgCode.PS028.get()); +// } + String tenantId = StringUtil.isEmpty(UserProvider.getUser().getTenantId()) ? "" : UserProvider.getUser().getTenantId(); + String catchKey = tenantId + "allUser"; + if (redisUtil.exists(catchKey)) { + redisUtil.remove(catchKey); + } + userService.delete(entity); + ThreadPoolExecutorUtil.getExecutor().execute(() -> { + try { + //删除用户之后判断是否需要同步到企业微信 + synThirdQyService.deleteUserSysToQy(false, id, ""); + //删除用户之后判断是否需要同步到钉钉 + synThirdDingTalkService.deleteUserSysToDing(false, id, ""); + } catch (Exception e) { + log.error("删除用户之后同步失败到企业微信或钉钉失败,异常:" + e.getMessage()); + } + }); + userService.delCurUser(MsgCode.PS030.get(), ImmutableList.of(entity.getId()),null); + PullUserUtil.syncUser(entity, "delete", UserProvider.getUser().getTenantId()); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + + /** + * 修改用户密码 + * + * @param id 主键 + * @param userResetPasswordForm 修改密码模型 + * @return ignore + */ + @UserPermission + @Operation(summary = "修改用户密码") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true), + @Parameter(name = "userResetPasswordForm", description = "修改密码模型", required = true) + }) + @SaCheckPermission("permission.user") + @PostMapping("/{id}/Actions/ResetPassword") + public ActionResult modifyPassword(@PathVariable("id") String id, @RequestBody @Valid UserResetPasswordForm userResetPasswordForm) { + UserEntity entity = userService.getInfo(id); + if (entity != null) { + entity.setPassword(userResetPasswordForm.getUserPassword()); + userService.updatePassword(entity); + userService.delCurUser(MsgCode.PS010.get(), ImmutableList.of(entity.getId()),null); + entity.setPassword(userResetPasswordForm.getUserPassword()); + PullUserUtil.syncUser(entity, "modifyPassword", UserProvider.getUser().getTenantId()); + return ActionResult.success(MsgCode.SU005.get()); + } + return ActionResult.success(MsgCode.FA001.get()); + } + + /** + * 更新用户状态 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "更新用户状态") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("permission.user") + @PutMapping("/{id}/Actions/State") + public ActionResult disable(@PathVariable("id") String id) throws Exception { + UserEntity entity = userService.getInfo(id); + if (entity != null) { + if ("1".equals(String.valueOf(entity.getIsAdministrator()))) { + return ActionResult.fail(MsgCode.PS029.get()); + } + if (entity.getEnabledMark() != null) { + if ("1".equals(String.valueOf(entity.getEnabledMark()))) { + entity.setEnabledMark(0); + userService.delCurUser(null, ImmutableList.of(entity.getId()),null); + userService.update(id, entity); + } else { + entity.setEnabledMark(1); + userService.update(id, entity); + } + } else { + entity.setEnabledMark(1); + userService.update(id, entity); + } + return ActionResult.success(MsgCode.SU005.get()); + } + return ActionResult.success(MsgCode.FA001.get()); + } + + /** + * 解除锁定 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "解除锁定") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("permission.user") + @PutMapping("/{id}/Actions/unlock") + public ActionResult unlock(@PathVariable("id") String id) throws Exception { + UserEntity entity = userService.getInfo(id); + if (entity != null) { + // 状态变成正常 + entity.setEnabledMark(1); + entity.setUnlockTime(null); + entity.setLogErrorCount(0); + entity.setId(id); + userService.updateById(entity); + return ActionResult.success(MsgCode.SU005.get()); + } + return ActionResult.success(MsgCode.FA001.get()); + } + + /** + * 获取用户基本信息 + * + * @param userIdModel 用户id + * @return ignore + */ + @Operation(summary = "获取用户基本信息") + @Parameters({ + @Parameter(name = "userIdModel", description = "用户id", required = true) + }) + @PostMapping("/getUserList") + public ActionResult> getUserList(@RequestBody UserIdModel userIdModel) { + List userName = userService.getUserName(userIdModel.getIds(), true); + List list = JsonUtil.getJsonToList(userName, UserIdListVo.class); + List listByUserIds = userRelationService.getRelationByUserIds(list.stream().map(UserIdListVo::getId).collect(Collectors.toList())); + Map orgIdNameMaps = organizeService.getInfoList(); + for (UserIdListVo entity : list) { + if (entity == null) { + break; + } + entity.setFullName(entity.getRealName() + "/" + entity.getAccount()); + List listByUserId = listByUserIds.stream().filter(t -> t.getUserId().equals(entity.getId())).collect(Collectors.toList()); + StringBuilder stringBuilder = new StringBuilder(); + List orgEntityList = organizeService.getOrgEntityList(listByUserId.stream().map(UserRelationEntity::getObjectId).collect(Collectors.toList()), false); + listByUserId.forEach(t -> { + OrganizeEntity organizeEntity = orgEntityList.stream().filter(org -> org.getId().equals(t.getObjectId())).findFirst().orElse(null); + if (organizeEntity != null) { + String fullNameByOrgIdTree = organizeService.getFullNameByOrgIdTree(orgIdNameMaps, organizeEntity.getOrganizeIdTree(), "/"); + if (StringUtil.isNotEmpty(fullNameByOrgIdTree)) { + stringBuilder.append("," + fullNameByOrgIdTree); + } + } + }); + if (stringBuilder.length() > 0) { + entity.setOrganize(stringBuilder.toString().replaceFirst(",", "")); + } + entity.setHeadIcon(UploaderUtil.uploaderImg(entity.getHeadIcon())); + } + ListVO listVO = new ListVO<>(); + listVO.setList(list); + return ActionResult.success(listVO); + } + + /** + * 获取选中组织、岗位、角色、用户基本信息 + * + * @param userIdModel 用户id + * @return ignore + */ + @Operation(summary = "获取选中组织、岗位、角色、用户基本信息") + @Parameters({ + @Parameter(name = "userIdModel", description = "用户id", required = true) + }) + @PostMapping("/getSelectedList") + public ActionResult> getSelectedList(@RequestBody UserIdModel userIdModel) { + List ids = userIdModel.getIds(); + List list = userService.selectedByIds(ids); + ListVO listVO = new ListVO<>(); + listVO.setList(list); + return ActionResult.success(listVO); + } + + + /** + * 获取用户基本信息 + * + * @param userIdModel 用户id + * @return ignore + */ + @Operation(summary = "获取选中用户基本信息") + @Parameters({ + @Parameter(name = "userIdModel", description = "用户id", required = true) + }) + @PostMapping("/getSelectedUserList") + public ActionResult> getSelectedUserList(@RequestBody UserIdModelByPage userIdModel) { + List jsonToList = userService.getObjList(userIdModel.getIds(), userIdModel.getPagination(), null); + PaginationVO paginationVO = JsonUtil.getJsonToBean(userIdModel.getPagination(), PaginationVO.class); + return ActionResult.page(jsonToList, paginationVO); + } + + /** + * 获取组织下的人员 + * + * @param page 页面信息 + * @return ignore + */ + @Operation(summary = "获取组织下的人员") + @GetMapping("/getOrganization") + public ActionResult> getOrganization(PageUser page) { + String departmentId = page.getOrganizeId(); + // 判断是否获取当前组织下的人员 + if ("0".equals(departmentId)) { + departmentId = UserProvider.getUser().getDepartmentId(); + // 为空则取组织id + if (StringUtil.isEmpty(departmentId)) { + departmentId = UserProvider.getUser().getOrganizeId(); + } + } + Map orgMaps = organizeService.getOrgMaps(null, true, null); + List list = userService.getListByOrganizeId(departmentId, page.getKeyword()); + List jsonToList = JsonUtil.getJsonToList(list, UserIdListVo.class); + Map orgIdNameMaps = organizeService.getInfoList(); + List listByObjectType = userRelationService.getListByObjectType(PermissionConst.ORGANIZE); + jsonToList.forEach(t -> { + t.setRealName(t.getRealName() + "/" + t.getAccount()); + t.setFullName(t.getRealName()); + List collect = listByObjectType.stream().filter(userRelationEntity -> userRelationEntity.getUserId().equals(t.getId())).map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + StringJoiner stringJoiner = new StringJoiner(","); + collect.forEach(objectId -> { + OrganizeEntity organizeEntity = orgMaps.get(objectId); + if (organizeEntity != null) { + String fullNameByOrgIdTree = organizeService.getFullNameByOrgIdTree(orgIdNameMaps, organizeEntity.getOrganizeIdTree(), "/"); + if (StringUtil.isNotEmpty(fullNameByOrgIdTree)) { + stringJoiner.add(fullNameByOrgIdTree); + } + } + }); + t.setOrganize(stringJoiner.toString()); + t.setHeadIcon(UploaderUtil.uploaderImg(t.getHeadIcon())); + }); + return ActionResult.success(jsonToList); + } + + /** + * 获取人员,委托选人接口 + * + * @param type 范围类型 + * @param pagination 参数 + */ + @Operation(summary = "获取人员") + @GetMapping("/ReceiveUserList") + public ActionResult receiveUserList(@RequestParam("type") Integer type, Pagination pagination) { + UserInfo userInfo = UserProvider.getUser(); + UserEntity user = userService.getInfo(userInfo.getUserId()); + List userId = new ArrayList<>(); + switch (ExtraRuleEnum.getByCode(type)) { + case organize: + // 委托范围为同一部门,但委托人的所属组织是公司,无需选人 + OrganizeEntity organize = organizeService.getInfo(user.getOrganizeId()); + if (null != organize && Objects.equals(organize.getCategory(), PermissionConst.DEPARTMENT)) { + List orgIds = ImmutableList.of(user.getOrganizeId()); + userId.addAll(userRelationService.getListByObjectIdAll(orgIds).stream().map(UserRelationEntity::getUserId).collect(Collectors.toList())); + } + break; + case position: + List positionIds = ImmutableList.of(user.getPositionId()); + userId.addAll(userRelationService.getListByObjectIdAll(positionIds).stream().map(UserRelationEntity::getUserId).collect(Collectors.toList())); + break; + case department: + List organizeIds = organizeService.getDepartmentAll(user.getOrganizeId()).stream().map(OrganizeEntity::getId).collect(Collectors.toList()); + userId.addAll(userRelationService.getListByObjectIdAll(organizeIds).stream().map(UserRelationEntity::getUserId).collect(Collectors.toList())); + break; + } + List list = userService.getUserName(userId, pagination); + Map orgMaps = organizeService.getOrgMaps(null, true, null); + List jsonToList = JsonUtil.getJsonToList(list, UserIdListVo.class); + Map orgIdNameMaps = organizeService.getInfoList(); + List listByObjectType = userRelationService.getListByObjectType(PermissionConst.ORGANIZE); + jsonToList.forEach(t -> { + t.setRealName(t.getRealName() + "/" + t.getAccount()); + t.setFullName(t.getRealName()); + List collect = listByObjectType.stream().filter(userRelationEntity -> userRelationEntity.getUserId().equals(t.getId())).map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + StringJoiner stringJoiner = new StringJoiner(","); + collect.forEach(objectId -> { + OrganizeEntity organizeEntity = orgMaps.get(objectId); + if (organizeEntity != null) { + String fullNameByOrgIdTree = organizeService.getFullNameByOrgIdTree(orgIdNameMaps, organizeEntity.getOrganizeIdTree(), "/"); + if (StringUtil.isNotEmpty(fullNameByOrgIdTree)) { + stringJoiner.add(fullNameByOrgIdTree); + } + } + }); + t.setOrganize(stringJoiner.toString()); + t.setHeadIcon(UploaderUtil.uploaderImg(t.getHeadIcon())); + }); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(jsonToList, paginationVO); + } + + /** + * 获取岗位人员 + * + * @param page 页面信息 + * @return ignore + */ + @Operation(summary = "获取岗位人员") + @GetMapping("/GetUsersByPositionId") + public ActionResult> getUsersByPositionId(UsersByPositionModel page) { + List list = new ArrayList<>(1); + String keyword = page.getKeyword(); + // 岗位id + String positionId = page.getPositionId(); + // 得到关联的组织id + PositionEntity positionEntity = positionService.getInfo(positionId); +// List relationListByObjectIdAndType = organizeRelationService.getRelationListByObjectIdAndType(PermissionConst.POSITION, positionId); + if (positionEntity != null) { + UserByRoleVO vo = new UserByRoleVO(); + String organizeId = positionEntity.getOrganizeId(); + // 得到组织信息 + OrganizeEntity organizeEntity = organizeService.getInfo(organizeId); + if (Objects.nonNull(organizeEntity)) { + vo.setId(organizeEntity.getId()); + vo.setType(organizeEntity.getCategory()); + if ("department".equals(organizeEntity.getCategory())) { + vo.setIcon("icon-ym icon-ym-tree-department1"); + } else { + vo.setIcon("icon-ym icon-ym-tree-organization3"); + } + vo.setEnabledMark(organizeEntity.getEnabledMark()); + Map orgIdNameMaps = organizeService.getInfoList(); + // 组装组织名称 + String orgName = organizeService.getFullNameByOrgIdTree(orgIdNameMaps, organizeEntity.getOrganizeIdTree(), "/"); + vo.setFullName(orgName); + // 赋予子集 + List userByRoleVOS = new ArrayList<>(16); + List lists = userService.getListByOrganizeId(organizeEntity.getId(), keyword); + if (lists.size() > 0) { + vo.setHasChildren(true); + vo.setIsLeaf(false); + lists.stream().forEach(t -> { + UserByRoleVO userByRoleVO = new UserByRoleVO(); + userByRoleVO.setParentId(organizeEntity.getId()); + userByRoleVO.setId(t.getId()); + userByRoleVO.setFullName(t.getRealName() + "/" + t.getAccount()); + userByRoleVO.setEnabledMark(t.getEnabledMark()); + userByRoleVO.setHeadIcon(UploaderUtil.uploaderImg(t.getHeadIcon())); + userByRoleVO.setOrganize(organizeService.getFullNameByOrgIdTree(orgIdNameMaps, organizeEntity.getOrganizeIdTree(), "/")); + userByRoleVO.setIsLeaf(true); + userByRoleVO.setHasChildren(false); + userByRoleVO.setIcon("icon-ym icon-ym-tree-user2"); + userByRoleVO.setType("user"); + userByRoleVOS.add(userByRoleVO); + }); + vo.setChildren(userByRoleVOS); + } else { + vo.setHasChildren(false); + vo.setIsLeaf(true); + vo.setChildren(new ArrayList<>()); + } + list.add(vo); + } + } + return ActionResult.success(list); + } + + /** + * 角色成员弹窗 + * + * @param model 页面信息 + * @return ignore + */ + @Operation(summary = "角色成员弹窗") + @SaCheckPermission("permission.role") + @GetMapping("/GetUsersByRoleOrgId") + public ActionResult> getUsersByRoleOrgId(UserByRoleModel model) { + List jsonToList = new ArrayList<>(16); + // 得到组织关系 + List relationListByRoleId = organizeRelationService.getRelationListByRoleId(model.getRoleId()); + // 得到组织信息 + List orgEntityList = organizeService.getOrgEntityList(relationListByRoleId.stream().map(OrganizeRelationEntity::getOrganizeId).collect(Collectors.toList()), true); + Map orgIdNameMaps = organizeService.getInfoList(); + //判断是否搜索关键字 + if (StringUtil.isNotEmpty(model.getKeyword())) { + //通过关键字查询 + List list = userService.getList(orgEntityList.stream().map(OrganizeEntity::getId).collect(Collectors.toList()), model.getKeyword()); + List listByUserIds = userRelationService.getRelationByUserIds(list.stream().map(UserEntity::getId).collect(Collectors.toList())); + //遍历用户给要返回的值插入值 + for (UserEntity entity : list) { + UserByRoleVO vo = new UserByRoleVO(); + vo.setId(entity.getId()); + vo.setFullName(entity.getRealName() + "/" + entity.getAccount()); + vo.setEnabledMark(entity.getEnabledMark()); + vo.setIsLeaf(true); + vo.setHeadIcon(UploaderUtil.uploaderImg(entity.getHeadIcon())); + List listByUserId = listByUserIds.stream().filter(t -> t.getUserId().equals(entity.getId())).collect(Collectors.toList()); + StringBuilder stringBuilder = new StringBuilder(); + List orgEntityLists = organizeService.getOrgEntityList(listByUserId.stream().map(UserRelationEntity::getObjectId).collect(Collectors.toList()), false); + listByUserId.forEach(t -> { + OrganizeEntity orgEntity = orgEntityLists.stream().filter(org -> org.getId().equals(t.getObjectId())).findFirst().orElse(null); + if (orgEntity != null) { + String fullNameByOrgIdTree = organizeService.getFullNameByOrgIdTree(orgIdNameMaps, orgEntity.getOrganizeIdTree(), "/"); + if (StringUtil.isNotEmpty(fullNameByOrgIdTree)) { + stringBuilder.append("," + fullNameByOrgIdTree); + } + } + }); + if (stringBuilder.length() > 0) { + vo.setOrganize(stringBuilder.toString().replaceFirst(",", "")); + } + vo.setHasChildren(false); + vo.setIcon("icon-ym icon-ym-tree-user2"); + vo.setType("user"); + jsonToList.add(vo); + } + return ActionResult.success(jsonToList); + } + //获取所有组织 + List collect = organizeService.getList(false).stream().filter(t -> t.getEnabledMark() == 1).collect(Collectors.toList()); + //判断时候传入组织id + //如果传入组织id,则取出对应的子集 + if (!"0".equals(model.getOrganizeId())) { + //通过组织查询部门及人员 + //单个组织 + List list = collect.stream().filter(t -> model.getOrganizeId().equals(t.getId())).collect(Collectors.toList()); + if (list.size() > 0) { + //获取组织信息 + OrganizeEntity organizeEntity = list.get(0); + //取出组织下的部门 + List collect1 = collect.stream().filter(t -> t.getParentId().equals(organizeEntity.getId())).collect(Collectors.toList()); + // 判断组织关系中是否有子部门id + List organizeEntities = new ArrayList<>(); + for (OrganizeEntity entity : collect1) { + List collect2 = relationListByRoleId.stream().filter(t -> entity.getId().equals(t.getOrganizeId())).collect(Collectors.toList()); + collect2.stream().forEach(t -> { + if (StringUtil.isNotEmpty(t.getOrganizeId())) { + organizeEntities.add(organizeService.getInfo(t.getOrganizeId())); + } + }); + } + // 其他不是子集的直接显示 + List collect2 = relationListByRoleId.stream() + .filter(item -> !organizeEntities.stream().map(e -> e.getId()) + .collect(Collectors.toList()).contains(item.getOrganizeId())) + .collect(Collectors.toList()); + // 移除掉上级不是同一个的 + List collect3 = collect2.stream().filter(t -> !organizeService.getInfo(t.getOrganizeId()).getOrganizeIdTree().contains(model.getOrganizeId())).collect(Collectors.toList()); + collect2.removeAll(collect3); + List collect4 = collect2.stream().filter(t -> !t.getOrganizeId().equals(model.getOrganizeId())).collect(Collectors.toList()); + List collect5 = collect.stream().filter(x -> collect4.stream().map(OrganizeRelationEntity::getOrganizeId).collect(Collectors.toList()).contains(x.getId())).collect(Collectors.toList()); + List organizeEntities1 = new ArrayList<>(collect5); + // 不是子集的对比子集的 + for (OrganizeEntity entity : collect5) { + for (OrganizeEntity organizeEntity1 : organizeEntities) { + if (entity.getOrganizeIdTree().contains(organizeEntity1.getId())) { + organizeEntities1.remove(entity); + } + } + } + + //取出组织下的人员 + List entityList = userService.getListByOrganizeId(model.getOrganizeId(), null); + List listByUserIds = userRelationService.getRelationByUserIds(entityList.stream().map(UserEntity::getId).collect(Collectors.toList())); + for (UserEntity entity : entityList) { + UserByRoleVO vo = new UserByRoleVO(); + vo.setId(entity.getId()); + vo.setFullName(entity.getRealName() + "/" + entity.getAccount()); + vo.setEnabledMark(entity.getEnabledMark()); + vo.setIsLeaf(true); + vo.setHasChildren(false); + vo.setIcon("icon-ym icon-ym-tree-user2"); + vo.setType("user"); + vo.setHeadIcon(UploaderUtil.uploaderImg(entity.getHeadIcon())); + List listByUserId = listByUserIds.stream().filter(t -> t.getUserId().equals(entity.getId())).collect(Collectors.toList()); + StringBuilder stringBuilder = new StringBuilder(); + List orgEntityLists = organizeService.getOrgEntityList(listByUserId.stream().map(UserRelationEntity::getObjectId).collect(Collectors.toList()), false); + listByUserId.forEach(t -> { + OrganizeEntity orgEntity = orgEntityLists.stream().filter(org -> org.getId().equals(t.getObjectId())).findFirst().orElse(null); + if (orgEntity != null) { + String fullNameByOrgIdTree = organizeService.getFullNameByOrgIdTree(orgIdNameMaps, orgEntity.getOrganizeIdTree(), "/"); + if (StringUtil.isNotEmpty(fullNameByOrgIdTree)) { + stringBuilder.append("," + fullNameByOrgIdTree); + } + } + }); + if (stringBuilder.length() > 0) { + vo.setOrganize(stringBuilder.toString().replaceFirst(",", "")); + } + jsonToList.add(vo); + } + // 处理子集断层 + List organizeEntities2 = new ArrayList<>(collect5); + for (OrganizeEntity entity : organizeEntities2) { + List collect6 = organizeEntities2.stream().filter(t -> !entity.getId().equals(t.getId()) && t.getOrganizeIdTree().contains(entity.getOrganizeIdTree())).collect(Collectors.toList()); + organizeEntities1.removeAll(collect6); + } + for (OrganizeEntity entity : organizeEntities1) { + StringBuffer stringBuffer = new StringBuffer(); + String[] split = entity.getOrganizeIdTree().split(","); + List list1 = Arrays.asList(split); + List list2 = new ArrayList<>(list1); + int indexOf = list2.indexOf(model.getOrganizeId()); + while (indexOf >= 0) { + list2.remove(indexOf); + indexOf--; + } + StringBuffer organizeIdTree = new StringBuffer(); + for (String parentId : list2) { + OrganizeEntity organizes = organizeService.getInfo(parentId); + if (Objects.nonNull(organizes) && StringUtil.isNotEmpty(organizes.getFullName())) { + organizeIdTree.append("/" + organizes.getFullName()); + } + } + String toString = organizeIdTree.toString(); + if (StringUtil.isNotEmpty(toString)) { + String organizeId = toString.replaceFirst("/", ""); + stringBuffer.append("," + organizeId); + } + UserByRoleVO userByRoleVO = new UserByRoleVO(); + userByRoleVO.setId(entity.getId()); + userByRoleVO.setType(entity.getCategory()); + userByRoleVO.setFullName(stringBuffer.toString().replace(",", "")); + if ("department".equals(entity.getCategory())) { + userByRoleVO.setIcon("icon-ym icon-ym-tree-department1"); + } else { + userByRoleVO.setIcon("icon-ym icon-ym-tree-organization3"); + } + userByRoleVO.setHasChildren(true); + userByRoleVO.setIsLeaf(false); + userByRoleVO.setEnabledMark(entity.getEnabledMark()); + jsonToList.add(userByRoleVO); + } + for (OrganizeEntity entitys : organizeEntities) { + UserByRoleVO vo = new UserByRoleVO(); + vo.setId(entitys.getId()); + vo.setType(entitys.getCategory()); + vo.setFullName(entitys.getFullName()); + if ("department".equals(entitys.getCategory())) { + vo.setIcon("icon-ym icon-ym-tree-department1"); + } else { + vo.setIcon("icon-ym icon-ym-tree-organization3"); + } + vo.setHasChildren(true); + vo.setIsLeaf(false); + vo.setEnabledMark(entitys.getEnabledMark()); + jsonToList.add(vo); + } + } + return ActionResult.success(jsonToList); + } + + // 判断是否有父级 + Set set = new HashSet<>(16); + for (OrganizeEntity entity : orgEntityList) { + List collect1 = orgEntityList.stream().filter(t -> !entity.getId().equals(t.getId()) && entity.getOrganizeIdTree().contains(t.getOrganizeIdTree())).collect(Collectors.toList()); + set.addAll(collect1); + } + List list = new ArrayList<>(set); + // 从list中一处已经有的 + List list1 = new ArrayList<>(list); + for (OrganizeEntity organizeEntity : list) { + List collect1 = list.stream().filter(t -> !organizeEntity.getId().equals(t.getId()) && t.getOrganizeIdTree().contains(organizeEntity.getId())).collect(Collectors.toList()); + list1.removeAll(collect1); + } + list = list1; + // 纯断层的 + List list2 = new ArrayList<>(orgEntityList); + for (OrganizeEntity organizeEntity : orgEntityList) { + if (list.stream().filter(t -> organizeEntity.getOrganizeIdTree().contains(t.getId())).count() > 0) { + list2.remove(organizeEntity); + } + } + list.addAll(list2); + for (OrganizeEntity organizeEntity : list) { + if (organizeEntity != null && organizeEntity.getEnabledMark() == 1) { + UserByRoleVO userByRoleVO = new UserByRoleVO(); + userByRoleVO.setId(organizeEntity.getId()); + userByRoleVO.setType(organizeEntity.getCategory()); + String orgName = organizeService.getFullNameByOrgIdTree(orgIdNameMaps, organizeEntity.getOrganizeIdTree(), "/"); + userByRoleVO.setFullName(orgName); + if ("department".equals(organizeEntity.getCategory())) { + userByRoleVO.setIcon("icon-ym icon-ym-tree-department1"); + } else { + userByRoleVO.setIcon("icon-ym icon-ym-tree-organization3"); + } + userByRoleVO.setHasChildren(true); + userByRoleVO.setIsLeaf(false); + userByRoleVO.setEnabledMark(organizeEntity.getEnabledMark()); + jsonToList.add(userByRoleVO); + } + } + return ActionResult.success(jsonToList); + } + + /** + * 获取我的下属(不取子集) + * + * @param page 页面信息 + * @return ignore + */ + @Operation(summary = "获取我的下属(不取子集)") + @Parameters({ + @Parameter(name = "page", description = "关键字", required = true) + }) + @PostMapping("/getSubordinates") + public ActionResult> getSubordinates(@RequestBody Page page) { + Map orgMaps = organizeService.getOrgMaps(null, false, null); + List list = userService.getListByManagerId(UserProvider.getUser().getUserId(), page.getKeyword()); + List jsonToList = JsonUtil.getJsonToList(list, UserIdListVo.class); + Map orgIdNameMaps = organizeService.getInfoList(); + jsonToList.forEach(t -> { + t.setRealName(t.getRealName() + "/" + t.getAccount()); + t.setFullName(t.getRealName()); + List listByUserId = userRelationService.getListByUserId(t.getId()).stream().filter(ur -> PermissionConst.ORGANIZE.equals(ur.getObjectType())).collect(Collectors.toList()); + StringJoiner stringJoiner = new StringJoiner(","); + listByUserId.forEach(tt -> { + OrganizeEntity organizeEntity = orgMaps.get(tt.getObjectId()); + if (organizeEntity != null) { + String fullNameByOrgIdTree = organizeService.getFullNameByOrgIdTree(orgIdNameMaps, organizeEntity.getOrganizeIdTree(), "/"); + if (StringUtil.isNotEmpty(fullNameByOrgIdTree)) { + stringJoiner.add(fullNameByOrgIdTree); + } + } + }); + t.setOrganize(stringJoiner.toString()); + t.setHeadIcon(UploaderUtil.uploaderImg(t.getHeadIcon())); + }); + return ActionResult.success(jsonToList); + } + + /** + * 根据角色ID获取所属组织的所有成员 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "根据角色ID获取所有成员") + @SaCheckPermission("permission.role") + @GetMapping("/getUsersByRoleId") + public ActionResult getUsersByRoleId(PaginationUser pagination) { + List userList = new ArrayList<>(); + if (roleService.getInfo(pagination.getRoleId()).getGlobalMark() == 1) { + userList.addAll(userService.getList(pagination, null, false, false, null, null)); + } else { + // 根据roleId获取所有组织 + userService.getListByRoleId(pagination.getRoleId()).forEach(u -> { + userList.add(userService.getInfo(u.getId())); + }); + } + // 去重 + List afterUserList = userList.stream().distinct().collect(Collectors.toList()); + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + afterUserList = afterUserList.stream().filter(t -> t.getRealName().contains(pagination.getKeyword()) || t.getAccount().contains(pagination.getKeyword())).collect(Collectors.toList()); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(afterUserList, paginationVO); + } + + /** + * 获取默认当前值用户ID + * + * @param userConditionModel 参数 + * @return 执行结构 + * @throws DataException ignore + */ + @Operation(summary = "获取默认当前值用户ID") + @Parameters({ + @Parameter(name = "userConditionModel", description = "参数", required = true) + }) + @PostMapping("/getDefaultCurrentValueUserId") + public ActionResult getDefaultCurrentValueUserId(@RequestBody UserConditionModel userConditionModel) throws DataException { + String userId = userService.getDefaultCurrentValueUserId(userConditionModel); + Map dataMap = new HashMap(); + dataMap.put("userId", userId); + return ActionResult.success(MsgCode.SU022.get(), dataMap); + } + + /** + * 工作交接 + * + * @param workHandoverModel 模型 + * @return 执行结构 + */ + @Operation(summary = "工作交接") + @SaCheckPermission("permission.user") + @Parameters({ + @Parameter(name = "workHandoverModel", description = "模型", required = true) + }) + @PostMapping("/workHandover") + public ActionResult workHandover(@RequestBody @Valid WorkHandoverModel workHandoverModel) { + // 开始交接就禁用用户 + UserEntity entity = userService.getInfo(workHandoverModel.getFromId()); + UserEntity entitys = userService.getInfo(workHandoverModel.getToId()); + if (entity == null || entitys == null) { + return ActionResult.fail(MsgCode.FA001.get()); + } + if (workHandoverModel.getFromId().equals(workHandoverModel.getToId())) { + return ActionResult.fail(MsgCode.PS035.get()); + } + if(ADMIN_KEY.equals(entitys.getAccount())){ + return ActionResult.fail(MsgCode.PS034.get()); + } + try { + boolean flag = templateApi.flowWork(workHandoverModel); + if (!flag) { + return ActionResult.fail(MsgCode.FA101.get()); + } + permissionGroupService.updateByUser(workHandoverModel.getFromId(), workHandoverModel.getToId(), workHandoverModel.getPermissionList()); + entity.setHandoverMark(1); + return ActionResult.success(MsgCode.PS033.get()); + } finally { + userService.updateById(entity); + } + } + + /** + * 获取用户工作详情 + * + * @return 执行结构 + */ + @Operation(summary = "获取用户工作详情") + @SaCheckPermission("permission.user") + @Parameters({ + @Parameter(name = "userId", description = "主键", required = true) + }) + @GetMapping("/getWorkByUser") + public ActionResult getWorkByUser(@RequestParam("fromId") String fromId) { + FlowWorkListVO flowWorkListVO = templateApi.flowWork(fromId); + if (flowWorkListVO == null) { + log.error("用户:" + UserProvider.getLoginUserId() + ",待办事宜及负责流程获取失败"); + flowWorkListVO = new FlowWorkListVO(); + } + List permissionGroupByUserId = permissionGroupService.getPermissionGroupAllByUserId(fromId); + List jsonToList = JsonUtil.getJsonToList(permissionGroupByUserId, FlowWorkModel.class); + jsonToList.forEach(t -> t.setIcon("icon-ym icon-ym-authGroup")); + flowWorkListVO.setPermission(jsonToList); + return ActionResult.success(flowWorkListVO); + } + + + // ----------------------------- 多租户调用 + + /** + * 重置管理员密码 + * + * @param userResetPasswordForm 修改密码模型 + * @return ignore + */ + @UserPermission + @Operation(summary = "重置管理员密码") + @Parameters({ + @Parameter(name = "userResetPasswordForm", description = "修改密码模型", required = true) + }) + @PutMapping("/Tenant/ResetPassword") + @NoDataSourceBind + public ActionResult resetPassword(@RequestBody @Valid TenantReSetPasswordForm userResetPasswordForm) { + if (configValueUtil.isMultiTenancy()) { + TenantDataSourceUtil.switchTenant(userResetPasswordForm.getTenantId()); + } + UserEntity entity = userService.getUserByAccount(ADMIN_KEY); + if (entity != null) { + entity.setPassword(userResetPasswordForm.getUserPassword()); + userService.updatePassword(entity); + userService.delCurUser(MsgCode.PS010.get(), ImmutableList.of(entity.getId()),null); + entity.setPassword(userResetPasswordForm.getUserPassword()); + PullUserUtil.syncUser(entity, "modifyPassword", userResetPasswordForm.getTenantId()); + return ActionResult.success(MsgCode.SU005.get()); + } + return ActionResult.fail(MsgCode.FA001.get()); + } + + /** + * 获取用户信息 + * + * @param tenantId 租户号 + * @return ignore + */ + @Operation(summary = "获取用户信息") + @Parameters({ + @Parameter(name = "tenantId", description = "租户号", required = true) + }) + @NoDataSourceBind + @GetMapping("/Tenant/AdminInfo") + public AdminInfoVO adminInfo(@RequestParam("tenantId") String tenantId) throws DataException { + if (configValueUtil.isMultiTenancy()) { + TenantDataSourceUtil.switchTenant(tenantId); + } + UserEntity entity = userService.getUserByAccount(ADMIN_KEY); + AdminInfoVO adminInfoVO = JsonUtil.getJsonToBean(entity, AdminInfoVO.class); + return adminInfoVO; + } + + /** + * 修改管理员信息 + * + * @param adminInfoVO 模型 + * @return ignore + */ + @Operation(summary = "修改管理员信息") + @Parameters({ + @Parameter(name = "adminInfoVO", description = "模型", required = true) + }) + @NoDataSourceBind + @PutMapping("/Tenant/UpdateAdminInfo") + public ActionResult adminInfo(@RequestBody AdminInfoVO adminInfoVO) throws DataException { + if (configValueUtil.isMultiTenancy()) { + TenantDataSourceUtil.switchTenant(adminInfoVO.getTenantId()); + } + UserEntity entity = userService.getUserByAccount(ADMIN_KEY); + if (entity == null) { + return ActionResult.fail(MsgCode.FA001.get()); + } + entity.setRealName(adminInfoVO.getRealName()); + entity.setMobilePhone(adminInfoVO.getMobilePhone()); + entity.setEmail(adminInfoVO.getEmail()); + userService.updateById(entity); + ThreadPoolExecutorUtil.getExecutor().execute(() -> { + try { + //修改用户之后判断是否需要同步到企业微信 + synThirdQyService.updateUserSysToQy(false, entity, ""); + //修改用户之后判断是否需要同步到钉钉 + synThirdDingTalkService.updateUserSysToDing(false, entity, ""); + } catch (Exception e) { + log.error("修改用户之后同步失败到企业微信或钉钉失败,异常:" + e.getMessage()); + } + }); + // 删除在线的用户 + PullUserUtil.syncUser(entity, "update", adminInfoVO.getTenantId()); + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 移除租户账号在线用户 + * + * @param tenantId 租户号 + * @return ignore + */ + @Operation(summary = "移除租户账号在线用户") + @Parameters({ + @Parameter(name = "tenantId", description = "租户号", required = true) + }) + @NoDataSourceBind + @GetMapping("/Tenant/RemoveOnlineByTenantId") + public void removeOnlineByTenantId(@RequestParam("tenantId") String tenantId) throws DataException { + List tokenList = new ArrayList<>(); + List tokens = UserProvider.getLoginUserListToken(); + tokens.forEach(token -> { + UserInfo userInfo = UserProvider.getUser(token); + if (tenantId.equals(userInfo.getTenantId())) { + tokenList.add(token); + } + }); + authService.kickoutByToken(tokenList.toArray(new String[0])); + } + + //--------------------以下导入导出----- + + @Operation(summary = "模板下载") + @SaCheckPermission("permission.user") + @GetMapping("/TemplateDownload") + public ActionResult TemplateDownload() { + UserColumnMap columnMap = new UserColumnMap(); + String excelName = columnMap.getExcelName(); + Map keyMap = columnMap.getColumnByType(0); + List models = columnMap.getFieldsModel(false); + List> list = columnMap.getDefaultList(); + Map optionMap = getOptionMap(); + ExcelModel excelModel = ExcelModel.builder().models(models).selectKey(new ArrayList<>(keyMap.keySet())).optionMap(optionMap).build(); + DownloadVO vo = ExcelTool.getImportTemplate(configValueUtil.getTemporaryFilePath(), excelName, keyMap, list, excelModel); + return ActionResult.success(vo); + } + + @Operation(summary = "上传导入Excel") + @SaCheckPermission("permission.user") + @PostMapping("/Uploader") + public ActionResult Uploader() { + return ExcelTool.uploader(); + } + + @Operation(summary = "导入预览") + @SaCheckPermission("permission.user") + @GetMapping("/ImportPreview") + public ActionResult> ImportPreview(String fileName) throws Exception { + // 导入字段 + UserColumnMap columnMap = new UserColumnMap(); + Map keyMap = columnMap.getColumnByType(0); + Map headAndDataMap = ExcelTool.importPreview(configValueUtil.getTemporaryFilePath(), fileName, keyMap); + return ActionResult.success(headAndDataMap); + } + + /** + * 导出异常报告 + * + * @return + */ + @Operation(summary = "导出异常报告") + @SaCheckPermission("permission.user") + @PostMapping("/ExportExceptionData") + public ActionResult ExportExceptionData(@RequestBody ExcelImportForm visualImportModel) { + String temporaryFilePath = configValueUtil.getTemporaryFilePath(); + List> dataList = visualImportModel.getList(); + UserColumnMap columnMap = new UserColumnMap(); + String excelName = columnMap.getExcelName(); + Map keyMap = columnMap.getColumnByType(0); + List models = columnMap.getFieldsModel(true); + ExcelModel excelModel = ExcelModel.builder().optionMap(getOptionMap()).models(models).build(); + DownloadVO vo = ExcelTool.exportExceptionReport(temporaryFilePath, excelName, keyMap, dataList, excelModel); + return ActionResult.success(vo); + } + + /** + * 导入数据 + * + * @return + */ + @Operation(summary = "导入数据") + @SaCheckPermission("permission.user") + @PostMapping("/ImportData") + public ActionResult ImportData(@RequestBody ExcelImportForm visualImportModel) throws Exception { + List> listData = new ArrayList<>(); + List> headerRow = new ArrayList<>(); + if (visualImportModel.isType()){ + ActionResult result = ImportPreview(visualImportModel.getFileName()); + if (result == null){ + throw new Exception(MsgCode.FA018.get()); + } + if (result.getCode() != 200){ + throw new Exception(result.getMsg()); + } + if (result.getData() instanceof Map){ + Map data = (Map) result.getData(); + listData = (List>) data.get("dataRow"); + headerRow = (List>) data.get("headerRow"); + } + }else { + listData = visualImportModel.getList(); + } + List addList = new ArrayList<>(); + List> failList = new ArrayList<>(); + // 对数据做校验 + this.validateImportData(listData, addList, failList); + + //正常数据插入 + for (UserEntity each : addList) { + userService.create(each); + } + ExcelImportVO importModel = new ExcelImportVO(); + importModel.setSnum(addList.size()); + importModel.setFnum(failList.size()); + importModel.setResultType(failList.size() > 0 ? 1 : 0); + importModel.setFailResult(failList); + importModel.setHeaderRow(headerRow); + return ActionResult.success(importModel); + } + + /** + * 导出Excel + * + * @return + */ + @Operation(summary = "导出Excel") + @SaCheckPermission("permission.user") + @GetMapping("/ExportData") + public ActionResult ExportData(PaginationUser pagination) throws IOException { + if (StringUtil.isEmpty(pagination.getSelectKey())) { + return ActionResult.fail(MsgCode.IMP011.get()); + } + + List list = userService.getList(pagination, null, false, false, null, null); + Map roleIdAndNameMap = roleService.getRoleNameAndIdMap(true).entrySet().stream().collect(Collectors.toMap(Map.Entry::getValue, Map.Entry::getKey)); + Map posIdAndName = positionService.getPosEncodeAndName(true).entrySet().stream().collect(Collectors.toMap(Map.Entry::getValue, Map.Entry::getKey)); + Map groupEncodeMap = groupService.getGroupEncodeMap(true).entrySet().stream().collect(Collectors.toMap(Map.Entry::getValue, Map.Entry::getKey)); + Map orgMap = organizeService.getAllOrgsTreeName(true); + Map userNameMap = userService.getUserNameAndIdMap(true).entrySet().stream().collect(Collectors.toMap(Map.Entry::getValue, Map.Entry::getKey)); + //性别 + Map sexMap = dictionaryDataApi.getByTypeCodeEnable(DictionaryDataEnum.SEX_TYPE.getDictionaryTypeId()) + .stream().collect(Collectors.toMap(DictionaryDataEntity::getEnCode, DictionaryDataEntity::getFullName)); + //职级 + Map ranksMap = dictionaryDataApi.getByTypeCodeEnable(DictionaryDataEnum.RANK.getDictionaryTypeId()) + .stream().collect(Collectors.toMap(DictionaryDataEntity::getId, DictionaryDataEntity::getFullName)); + //民族 + Map nationMap = dictionaryDataApi.getByTypeCodeEnable(DictionaryDataEnum.NATION.getDictionaryTypeId()) + .stream().collect(Collectors.toMap(DictionaryDataEntity::getId, DictionaryDataEntity::getFullName)); + //证件类型 + Map certificatesTypeMap = dictionaryDataApi.getByTypeCodeEnable(DictionaryDataEnum.CERTIFICATE_TYPE.getDictionaryTypeId()) + .stream().collect(Collectors.toMap(DictionaryDataEntity::getId, DictionaryDataEntity::getFullName)); + //文化程度 + Map educationMap = dictionaryDataApi.getByTypeCodeEnable(DictionaryDataEnum.EDUCATION.getDictionaryTypeId()) + .stream().collect(Collectors.toMap(DictionaryDataEntity::getId, DictionaryDataEntity::getFullName)); + + List> realList = new ArrayList<>(); + for (UserEntity entity : list) { + //获取角色 + QueryWrapper roleQuery = new QueryWrapper<>(); + roleQuery.lambda().eq(UserRelationEntity::getUserId, entity.getId()); + roleQuery.lambda().eq(UserRelationEntity::getObjectType, PermissionConst.ROLE); + List roleIdList = new ArrayList<>(); + for (UserRelationEntity ure : userRelationService.list(roleQuery)) { + if(StringUtil.isNotEmpty(roleIdAndNameMap.get(ure.getObjectId()))){ + roleIdList.add(roleIdAndNameMap.get(ure.getObjectId())); + } + } + entity.setHeadIcon(UploaderUtil.uploaderImg(entity.getHeadIcon())); + entity.setRoleId(String.join(",", roleIdList)); + + // 组织 + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(UserRelationEntity::getUserId, entity.getId()); + query.lambda().eq(UserRelationEntity::getObjectType, PermissionConst.ORGANIZE); + List organizeIds = new ArrayList<>(); + userRelationService.list(query).forEach(u -> { + for (String orgIds : orgMap.keySet()) { + if (orgIds.endsWith(u.getObjectId())) { + organizeIds.add(orgMap.get(orgIds).toString()); + } + } + }); + entity.setOrganizeId(String.join(",", organizeIds)); + + // 岗位装配 + QueryWrapper positionQuery = new QueryWrapper<>(); + positionQuery.lambda().eq(UserRelationEntity::getUserId, entity.getId()); + positionQuery.lambda().eq(UserRelationEntity::getObjectType, PermissionConst.POSITION); + List positionIds = new ArrayList<>(); + for (UserRelationEntity ure : userRelationService.list(positionQuery)) { + if (posIdAndName.containsKey(ure.getObjectId())) { + positionIds.add(posIdAndName.get(ure.getObjectId())); + } + } + entity.setPositionId(String.join(",", positionIds)); + + // 设置分组id + List listByObjectType = userRelationService.getListByObjectType(entity.getId(), PermissionConst.GROUP); + List groupIds = new ArrayList<>(); + for (UserRelationEntity item : listByObjectType) { + if (groupEncodeMap.containsKey(item.getObjectId())) { + groupIds.add(groupEncodeMap.get(item.getObjectId())); + } + } + entity.setManagerId(userNameMap.get(entity.getManagerId())); + //性别 + entity.setGender(sexMap.get(entity.getGender())); + entity.setRanks(ranksMap.get(entity.getRanks())); + entity.setNation(nationMap.get(entity.getNation())); + entity.setCertificatesType(certificatesTypeMap.get(entity.getCertificatesType())); + entity.setEducation(educationMap.get(entity.getEducation())); + + entity.setGroupId(String.join(",", groupIds)); + Map obj = JsonUtil.entityToMap(entity); + if (obj.get("enabledMark") != null) { + String stateName = ""; + if (Objects.equals(obj.get("enabledMark"), 0)) { + stateName = "禁用"; + } else if (Objects.equals(obj.get("enabledMark"), 1)) { + stateName = "启用"; + } else if (Objects.equals(obj.get("enabledMark"), 2)) { + stateName = "锁定"; + } + obj.put("enabledMark", stateName); + } + if (obj.get("birthday") != null) { + obj.put("birthday", DateUtil.daFormat(Long.parseLong(obj.get("birthday").toString()))); + } + if (obj.get("entryDate") != null) { + obj.put("entryDate", DateUtil.daFormat(Long.parseLong(obj.get("entryDate").toString()))); + } + realList.add(obj); + } + //todo 数据 + String[] keys = !StringUtil.isEmpty(pagination.getSelectKey()) ? pagination.getSelectKey() : new String[0]; + UserColumnMap columnMap = new UserColumnMap(); + String excelName = columnMap.getExcelName(); + List models = columnMap.getFieldsModel(false); + Map keyMap = columnMap.getColumnByType(null); + ExcelModel excelModel = ExcelModel.builder().selectKey(Arrays.asList(keys)).models(models).build(); + DownloadVO vo = ExcelTool.creatModelExcel(configValueUtil.getTemporaryFilePath(), excelName, keyMap, realList, excelModel); + return ActionResult.success(vo); + } + + /** + * 导入验证 + * + * @param listData + * @param addList + * @param failList + */ + private void validateImportData(List> listData, List addList, List> failList) { + UserColumnMap columnMap = new UserColumnMap(); + Map keyMap = columnMap.getColumnByType(0); + List sexList = dictionaryDataApi.getListByTypeDataCode(DictionaryDataEnum.SEX_TYPE.getDictionaryTypeId()); + Map genderMap = sexList.stream().collect(Collectors.toMap(DictionaryDataEntity::getFullName, DictionaryDataEntity::getEnCode)); + List rankList = dictionaryDataApi.getListByTypeDataCode(DictionaryDataEnum.RANK.getDictionaryTypeId()); + Map ranksMap = rankList.stream().collect(Collectors.toMap(DictionaryDataEntity::getFullName, DictionaryDataEntity::getId)); + List nationList = dictionaryDataApi.getListByTypeDataCode(DictionaryDataEnum.NATION.getDictionaryTypeId()); + Map nationMap = nationList.stream().collect(Collectors.toMap(DictionaryDataEntity::getFullName, DictionaryDataEntity::getId)); + List certificateList = dictionaryDataApi.getListByTypeDataCode(DictionaryDataEnum.CERTIFICATE_TYPE.getDictionaryTypeId()); + Map certificateMap = certificateList.stream().collect(Collectors.toMap(DictionaryDataEntity::getFullName, DictionaryDataEntity::getId)); + List educationList = dictionaryDataApi.getListByTypeDataCode(DictionaryDataEnum.EDUCATION.getDictionaryTypeId()); + Map educationMap = educationList.stream().collect(Collectors.toMap(DictionaryDataEntity::getFullName, DictionaryDataEntity::getId)); + Map allOrgsTreeName = organizeService.getAllOrgsTreeName(); + Map userNameMap = userService.getUserNameAndIdMap(); + + for (int i = 0, len = listData.size(); i < len; i++) { + Map eachMap = listData.get(i); + Map realMap = JsonUtil.getJsonToBean(eachMap, Map.class); + StringJoiner errInfo = new StringJoiner(","); + + // 开启多租住的-判断用户额度 + String tenantId = UserProvider.getUser().getTenantId(); + if (StringUtil.isNotEmpty(tenantId)) { + TenantVO cacheTenantInfo = TenantDataSourceUtil.getCacheTenantInfo(tenantId); + long count = userService.count() + addList.size(); + if (cacheTenantInfo.getAccountNum() != 0 && cacheTenantInfo.getAccountNum() < count) { + eachMap.put("errorsInfo", MsgCode.PS009.get()); + failList.add(eachMap); + continue; + } + } + + //组织多选id,用于查询角色和岗位 + StringJoiner organizeIds = new StringJoiner(","); + for (String column : keyMap.keySet()) { + Object valueObj = eachMap.get(column); + String value = valueObj == null ? null : String.valueOf(valueObj); + String columnName = keyMap.get(column); + switch (column) { + case "gender": + if (StringUtil.isEmpty(value)) { + errInfo.add(columnName + "不能为空"); + break; + } + if (genderMap.containsKey(valueObj.toString())) { + realMap.put("gender", genderMap.get(value)); + } else { + errInfo.add("找不到该" + columnName + "值"); + } + break; + case "ranks": + if (StringUtil.isNotEmpty(value)) { + if (ranksMap.containsKey(valueObj.toString())) { + realMap.put("ranks", ranksMap.get(value)); + } else { + errInfo.add("找不到该" + columnName + "值"); + } + } + break; + case "nation": + if (StringUtil.isNotEmpty(value)) { + if (nationMap.containsKey(valueObj.toString())) { + realMap.put("nation", nationMap.get(value)); + } else { + errInfo.add("找不到该" + columnName + "值"); + } + } + break; + case "certificatesType": + if (StringUtil.isNotEmpty(value)) { + if (certificateMap.containsKey(valueObj.toString())) { + realMap.put("certificatesType", certificateMap.get(value)); + } else { + errInfo.add("找不到该" + columnName + "值"); + } + } + break; + case "education": + if (StringUtil.isNotEmpty(value)) { + if (educationMap.containsKey(valueObj.toString())) { + realMap.put("education", educationMap.get(value)); + } else { + errInfo.add("找不到该" + columnName + "值"); + } + } + break; + case "account": + //账号 + if (StringUtil.isEmpty(value)) { + errInfo.add(columnName + "不能为空"); + break; + } + if (value.length() > 50) { + errInfo.add(columnName + "值超出最多输入字符限制"); + } + //值不能含有特殊符号 + if (!RegexUtils.checkSpecoalSymbols(value)) { + errInfo.add(columnName + "值不能含有特殊符号"); + } + //库里重复 + if (userService.isExistByAccount(value)) { + errInfo.add(columnName + "值已存在"); + break; + } + //表格内重复 + long enCodeCount = addList.stream().filter(t -> t.getAccount().equals(value)).count(); + if (enCodeCount > 0) { + errInfo.add(columnName + "值已存在"); + break; + } + break; + case "realName": + if (StringUtil.isEmpty(value)) { + errInfo.add(columnName + "不能为空"); + break; + } + if (value.length() > 50) { + errInfo.add(columnName + "值超出最多输入字符限制"); + } + //值不能含有特殊符号 + if (!RegexUtils.checkSpecoalSymbols(value)) { + errInfo.add(columnName + "值不能含有特殊符号"); + } + break; + case "organizeId": + if (StringUtil.isEmpty(value)) { + errInfo.add(columnName + "不能为空"); + break; + } + List orgList = Arrays.asList(value.split(",")); + List orgErrList = new ArrayList<>(); + for (String orgName : orgList) { + CheckResult organizeIdCheckResult = checkOrganizeId(orgName, allOrgsTreeName); + if (!organizeIdCheckResult.isPass()) { + orgErrList.add(orgName); + } else { + organizeIds.add(organizeIdCheckResult.getValue().toString()); + } + } + if (orgErrList.size() > 1) { + errInfo.add("找不到该所属组织(" + String.join("、", orgErrList) + ")"); + break; + } else if (orgErrList.size() == 1) { + errInfo.add("找不到该所属组织"); + break; + } + realMap.put("organizeId", organizeIds.toString()); + break; + case "positionId": + if (StringUtil.isNotEmpty(value)) { + List list = Arrays.asList(organizeIds.toString().split(",")); + List listByOrganizeIds = StringUtil.isEmpty(organizeIds.toString()) ? new ArrayList<>() + : positionService.getListByOrganizeIds(list, true,false); + Map positionMap = new HashMap<>(); + for (PermissionModel item : listByOrganizeIds) { + if (CollectionUtil.isNotEmpty(item.getChildren())) { + List children = item.getChildren(); + for (Object obj : children) { + PermissionModel model = (PermissionModel) obj; + positionMap.put(model.getFullName(), model.getId()); + } + } + } + StringJoiner posIds = new StringJoiner(","); + List posErrList = new ArrayList<>(); + List listName = Arrays.asList(value.split(",")); + for (String item : listName) { + if (positionMap.containsKey(item)) { + posIds.add(positionMap.get(item)); + } else { + posErrList.add(item); + } + } + if(posErrList.size()>0){ + if (listName.size() > 1) { + errInfo.add("找不到该所属组织的" + columnName + "(" + String.join("、", posErrList) + ")"); + break; + } else if (listName.size() == 1) { + errInfo.add("找不到该所属组织的" + columnName); + break; + } + } + if (StringUtil.isNotEmpty(posIds.toString())) { + realMap.put("positionId", posIds.toString()); + break; + } + break; + } + break; + case "roleId": + if (StringUtil.isNotEmpty(value)) { + List list = Arrays.asList(organizeIds.toString().split(",")); + List listByOrganizeIds = StringUtil.isEmpty(organizeIds.toString()) ? new ArrayList<>() + : roleService.getListByOrganizeIds(list, true,false); + Map roleMap = new HashMap<>(); + for (RoleModel item : listByOrganizeIds) { + if (CollectionUtil.isNotEmpty(item.getChildren())) { + List children = item.getChildren(); + for (Object obj : children) { + RoleModel model = (RoleModel) obj; + roleMap.put(model.getFullName(), model.getId()); + } + } + } + StringJoiner roleIds = new StringJoiner(","); + List roleErrList = new ArrayList<>(); + List listName = Arrays.asList(value.split(",")); + for (String item : listName) { + if (roleMap.containsKey(item)) { + roleIds.add(roleMap.get(item)); + } else { + roleErrList.add(item); + } + } + if(roleErrList.size()>0){ + if (listName.size() > 1) { + errInfo.add("找不到该" + columnName + "(" + String.join("、", roleErrList) + ")"); + break; + } else if (listName.size() == 1) { + errInfo.add("找不到该" + columnName); + break; + } + } + if (StringUtil.isNotEmpty(roleIds.toString())) { + realMap.put("roleId", roleIds.toString()); + break; + } + break; + } + break; + case "managerId": + if (StringUtil.isNotEmpty(value)) { + if (userNameMap.containsKey(value)) { + realMap.put("managerId", userNameMap.get(value)); + } else { + errInfo.add("找不到该" + columnName); + } + } + break; + case "entryDate": + if (StringUtil.isNotEmpty(value)) { + Date date = DateUtil.checkDate(value,"yyyy-MM-dd"); + if (date == null) { + errInfo.add(columnName + "值不正确"); + break; + } + realMap.put("entryDate", date); + } + break; + case "birthday": + if (StringUtil.isNotEmpty(value)) { + Date date = DateUtil.checkDate(value,"yyyy-MM-dd"); + if (date == null) { + errInfo.add(columnName + "值不正确"); + break; + } + realMap.put("birthday", date); + } + break; + case "sortCode": + if (StringUtil.isEmpty(value)) { + realMap.put("sortCode", 0); + break; + } + Long numValue = 0l; + try { + numValue = Long.parseLong(value); + } catch (Exception e) { + errInfo.add(columnName + "值不正确"); + break; + } + if (numValue < 0) { + errInfo.add(columnName + "值不能小于0"); + break; + } + if (numValue > 1000000) { + errInfo.add(columnName + "值不能大于999999"); + break; + } + break; + case "enabledMark": + if (StringUtil.isEmpty(value)) { + errInfo.add(columnName + "不能为空"); + break; + } + if ("启用".equals(value)) { + realMap.put("enabledMark", 1); + } else if ("禁用".equals(value)) { + realMap.put("enabledMark", 0); + } else if ("锁定".equals(value)) { + realMap.put("enabledMark", 2); + } else { + errInfo.add("找不到该" + columnName + "值"); + } + break; + default: + break; + } + + } + + if (errInfo.length() == 0) { + UserEntity entity = JsonUtil.getJsonToBean(realMap, UserEntity.class); + entity.setCreatorTime(new Date()); + addList.add(entity); + } else { + eachMap.put("errorsInfo", errInfo.toString()); + failList.add(eachMap); + } + } + } + + private CheckResult checkOrganizeId(String organizeName, Map allOrgsTreeName) { + for (String key : allOrgsTreeName.keySet()) { + Object o = allOrgsTreeName.get(key); + if (organizeName.equals(o.toString())) { + String[] split = key.split(","); + return new CheckResult(true, null, split[split.length - 1]); + } + } + return new CheckResult(false, "所属组织不正确", null); + } + + /** + * 获取下拉框 + * + * @return + */ + private Map getOptionMap() { + Map optionMap = new HashMap<>(); + //性别 + List sexList = dictionaryDataApi.getByTypeCodeEnable(DictionaryDataEnum.SEX_TYPE.getDictionaryTypeId()); + String[] gender = sexList.stream().map(DictionaryDataEntity::getFullName).toArray(String[]::new); + optionMap.put("gender", gender); + //职级 + List ranksList = dictionaryDataApi.getByTypeCodeEnable(DictionaryDataEnum.RANK.getDictionaryTypeId()); + String[] ranks = ranksList.stream().map(DictionaryDataEntity::getFullName).toArray(String[]::new); + optionMap.put("ranks", ranks); + //状态 + optionMap.put("enabledMark", new String[]{"启用", "禁用", "锁定"}); + //民族 + List nationList = dictionaryDataApi.getByTypeCodeEnable(DictionaryDataEnum.NATION.getDictionaryTypeId()); + String[] nation = nationList.stream().map(DictionaryDataEntity::getFullName).toArray(String[]::new); + optionMap.put("nation", nation); + //证件类型 + List certificatesTypeList = dictionaryDataApi.getByTypeCodeEnable(DictionaryDataEnum.CERTIFICATE_TYPE.getDictionaryTypeId()); + String[] certificatesType = certificatesTypeList.stream().map(DictionaryDataEntity::getFullName).toArray(String[]::new); + optionMap.put("certificatesType", certificatesType); + //文化程度 + List educationList = dictionaryDataApi.getByTypeCodeEnable(DictionaryDataEnum.EDUCATION.getDictionaryTypeId()); + String[] education = educationList.stream().map(DictionaryDataEntity::getFullName).toArray(String[]::new); + optionMap.put("education", education); + return optionMap; + } +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-controller/src/main/java/com/yunzhupaas/permission/controller/UserRelationController.java b/yunzhupaas-permission/yunzhupaas-permission-controller/src/main/java/com/yunzhupaas/permission/controller/UserRelationController.java new file mode 100644 index 0000000..796177a --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-controller/src/main/java/com/yunzhupaas/permission/controller/UserRelationController.java @@ -0,0 +1,104 @@ +package com.yunzhupaas.permission.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaMode; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import com.yunzhupaas.base.controller.SuperController; +import cn.hutool.core.util.ArrayUtil; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.annotation.UserPermission; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.constant.PermissionConst; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.entity.UserRelationEntity; +import com.yunzhupaas.permission.model.userrelation.UserRelationForm; +import com.yunzhupaas.permission.model.userrelation.UserRelationIdsVO; +import com.yunzhupaas.permission.service.UserRelationService; +import com.yunzhupaas.permission.service.UserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 用户关系 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +@Tag(name = "用户关系", description = "UserRelation") +@RestController +@RequestMapping("/api/permission/UserRelation") +public class UserRelationController extends SuperController { + + @Autowired + private UserRelationService userRelationService; + @Autowired + private UserService userService; + + /** + * 列表 + * + * @param objectId 对象主键 + * @return + */ + @Operation(summary = "获取岗位/角色/门户成员列表ids") + @Parameters({ + @Parameter(name = "objectId", description = "对象主键", required = true) + }) + @SaCheckPermission(value = {"permission.authorize", "permission.position", "permission.role"}, mode = SaMode.OR) + @GetMapping("/{objectId}") + public ActionResult listTree(@PathVariable("objectId") String objectId) { + List data = userRelationService.getListByObjectId(objectId); + List ids = new ArrayList<>(); + for (UserRelationEntity entity : data) { + ids.add(entity.getUserId()); + } + UserRelationIdsVO vo = new UserRelationIdsVO(); + vo.setIds(ids); + return ActionResult.success(vo); + } + + /** + * 保存 + * + * @param objectId 对象主键 + * @param userRelationForm 页面数据 + * @return + */ + @UserPermission + @Operation(summary = "添加岗位或角色成员") + @Parameters({ + @Parameter(name = "objectId", description = "对象主键", required = true), + @Parameter(name = "userRelationForm", description = "页面数据", required = true) + }) + @SaCheckPermission(value = {"permission.authorize", "permission.position", "permission.role"}, mode = SaMode.OR) + @PostMapping("/{objectId}") + public ActionResult save(@PathVariable("objectId") String objectId, @RequestBody UserRelationForm userRelationForm) { + List userIds = new ArrayList<>(); + // 得到禁用的id + List listByObjectId = userRelationService.getListByObjectId(objectId, userRelationForm.getObjectType()); + List collect = listByObjectId.stream().map(UserRelationEntity::getUserId).collect(Collectors.toList()); + //删除的用户 + List collect1 = collect.stream().filter(t -> !userRelationForm.getUserIds().contains(t)).collect(Collectors.toList()); + //添加的用户 + List collect2 = userRelationForm.getUserIds().stream().filter(t -> !collect.contains(t)).collect(Collectors.toList()); + userIds.addAll(collect1); + userIds.addAll(collect2); + Set set = new HashSet<>(userRelationForm.getUserIds()); + set.addAll(userService.getUserList(collect).stream().map(UserEntity::getId).collect(Collectors.toList())); + List list = new ArrayList<>(set); + userRelationForm.setUserIds(list); + userRelationService.saveObjectId(objectId,userRelationForm); + return ActionResult.success(MsgCode.SU002.get()); + } + +} + + diff --git a/yunzhupaas-permission/yunzhupaas-permission-controller/src/main/java/com/yunzhupaas/permission/controller/UserSettingController.java b/yunzhupaas-permission/yunzhupaas-permission-controller/src/main/java/com/yunzhupaas/permission/controller/UserSettingController.java new file mode 100644 index 0000000..eb152bf --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-controller/src/main/java/com/yunzhupaas/permission/controller/UserSettingController.java @@ -0,0 +1,1188 @@ +package com.yunzhupaas.permission.controller; + + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.http.HttpRequest; +import cn.hutool.http.HttpResponse; +import com.alibaba.fastjson.JSON; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.ActionResultCode; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.entity.PrintDevEntity; +import com.yunzhupaas.base.entity.SystemEntity; +import com.yunzhupaas.base.model.base.SystemBaeModel; +import com.yunzhupaas.base.model.form.ModuleFormModel; +import com.yunzhupaas.base.model.portalManage.PortalManagePage; +import com.yunzhupaas.base.model.portalManage.PortalManagePageDO; +import com.yunzhupaas.base.model.portalManage.PortalModel; +import com.yunzhupaas.base.model.print.PaginationPrint; +import com.yunzhupaas.base.model.print.PrintDevTreeModel; +import com.yunzhupaas.base.model.sign.SignForm; +import com.yunzhupaas.base.model.sign.SignListVO; +import com.yunzhupaas.base.model.vo.PrintDevVO; +import com.yunzhupaas.base.service.*; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.constant.PermissionConst; +import com.yunzhupaas.consts.DeviceType; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.entity.LogEntity; +import com.yunzhupaas.flowable.entity.TemplateEntity; +import com.yunzhupaas.flowable.model.template.TemplateTreeListVo; +import com.yunzhupaas.model.PaginationLogModel; +import com.yunzhupaas.model.UserLogVO; +import com.yunzhupaas.model.tenant.TenantAuthorizeModel; +import com.yunzhupaas.permission.constant.AuthorizeConst; +import com.yunzhupaas.permission.entity.*; +import com.yunzhupaas.base.model.button.ButtonModel; +import com.yunzhupaas.base.model.column.ColumnModel; +import com.yunzhupaas.base.model.module.ModuleModel; +import com.yunzhupaas.base.model.resource.ResourceModel; +import com.yunzhupaas.permission.model.authorize.AuthorizeModel; +import com.yunzhupaas.permission.model.authorize.AuthorizeVO; +import com.yunzhupaas.permission.model.permission.PermissionModel; +import com.yunzhupaas.permission.model.user.form.*; +import com.yunzhupaas.permission.model.user.mod.UserAuthorizeModel; +import com.yunzhupaas.permission.model.user.vo.UserAuthorizeVO; +import com.yunzhupaas.permission.model.user.vo.UserBaseInfoVO; +import com.yunzhupaas.permission.model.user.vo.UserSubordinateVO; +import com.yunzhupaas.permission.rest.PullUserUtil; +import com.yunzhupaas.permission.service.*; +import com.yunzhupaas.permission.util.PermissionUtil; +import com.yunzhupaas.service.LogService; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.treeutil.ListToTreeUtil; +import com.yunzhupaas.util.treeutil.SumTree; +import com.yunzhupaas.util.treeutil.newtreeutil.TreeDotUtils; +import com.yunzhupaas.workflow.service.TemplateApi; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; + +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 个人资料 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +@Tag(name = "个人资料", description = "CurrentUsersInfo") +@RestController +@RequestMapping("/api/permission/Users/Current") +@Slf4j +public class UserSettingController { + + @Autowired + private UserService userService; + @Autowired + private AuthorizeService authorizeService; + @Autowired + private LogService logService; + @Autowired + private RedisUtil redisUtil; + @Autowired + private RoleService roleService; + @Autowired + private PositionService positionService; + @Autowired + private OrganizeService organizeService; + @Autowired + private CacheKeyUtil cacheKeyUtil; + @Autowired + private UserRelationService userRelationService; + @Autowired + private OrganizeRelationService organizeRelationService; + @Autowired + private SystemService systemService; + @Autowired + private SignService signService; + @Autowired + private SysconfigService sysConfigApi; + @Autowired + private UserOldPasswordService userOldPasswordService; + @Autowired + private OrganizeAdministratorService organizeAdministratorService; + @Autowired + private PermissionGroupService permissionGroupService; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private DictionaryDataService dictionaryDataApi; + @Autowired + private TemplateApi templateApi; + @Autowired + private PortalManageService portalManageApi; + @Autowired + private PrintDevService printDevApi; + + /** + * 我的信息 + * + * @return + */ + @Operation(summary = "个人资料") + @GetMapping("/BaseInfo") + public ActionResult get() { + UserInfo userInfo = UserProvider.getUser(); + UserEntity userEntity = userService.getInfo(userInfo.getUserId()); + + String catchKey = cacheKeyUtil.getAllUser(); + if (redisUtil.exists(catchKey)) { + redisUtil.remove(catchKey); + } + + UserBaseInfoVO vo = JsonUtil.getJsonToBean(userEntity, UserBaseInfoVO.class); + + + if (StringUtil.isNotEmpty(userEntity.getManagerId())) { + UserEntity menager = userService.getInfo(userEntity.getManagerId()); + vo.setManager(menager != null && !ObjectUtil.equal(menager.getEnabledMark(), 0) ? menager.getRealName() + "/" + menager.getAccount() : ""); + } + + //设置语言和主题 + vo.setLanguage(userEntity.getLanguage() != null ? userEntity.getLanguage() : "zh-CN"); + vo.setTheme(userEntity.getTheme() != null ? userEntity.getTheme() : "W-001"); + + // 获取组织 + vo.setOrganize(PermissionUtil.getLinkInfoByOrgId(userInfo.getOrganizeId(), organizeService, false)); + + // 获取角色 + if (StringUtil.isNotEmpty(userInfo.getOrganizeId())) { + vo.setRoleId(roleService.getCurRolesByOrgId(userInfo.getOrganizeId()).stream() + .map(PermissionEntityBase::getFullName).collect(Collectors.joining(","))); + } + + // 获取主要岗位 + List positionEntityList = positionService.getListByOrgIdAndUserId(userInfo.getOrganizeId(), userEntity.getId()); + if (positionEntityList.size() > 0) { + List fullNames = positionEntityList.stream().map(PositionEntity::getFullName).collect(Collectors.toList()); + vo.setPosition(String.join(",", fullNames)); + } + + // 获取用户 + if (StringUtil.isNotEmpty(userInfo.getTenantId())) { + vo.setAccount(userInfo.getTenantId() + "@" + vo.getAccount()); + } + + // 获取用户头像 + if (!StringUtil.isEmpty(userInfo.getUserIcon())) { + vo.setAvatar(UploaderUtil.uploaderImg(userInfo.getUserIcon())); + } + vo.setBirthday(userEntity.getBirthday() != null ? userEntity.getBirthday().getTime() : null); + DictionaryDataEntity dictionaryDataEntity3 = dictionaryDataApi.getInfo(userEntity.getRanks()); + vo.setRanks(dictionaryDataEntity3 != null && ObjectUtil.equal(dictionaryDataEntity3.getEnabledMark(), 1) ? dictionaryDataEntity3.getFullName() : null); + // 多租户 + String tenantId = UserProvider.getUser().getTenantId(); + Map headers = Collections.EMPTY_MAP; + try { + String ip = IpUtil.getIpAddr(); + if (StringUtil.isNotEmpty(ip) && !Objects.equals("127.0.0.1", ip)) { + headers = ImmutableMap.of("X-Forwarded-For", ip); + } + } catch (Exception e) { + } + if (StringUtil.isNotEmpty(tenantId)) { + vo.setIsTenant(true); + try (HttpResponse execute = HttpRequest.get(configValueUtil.getMultiTenancyUrl() + "GetTenantInfo/" + tenantId) + .addHeaders(headers) + .execute()) { + vo.setCurrentTenantInfo(JSON.parseObject(execute.body())); + } catch (Exception e) { + log.error("获取远端多租户信息失败: {}", e.getMessage()); + } + } + return ActionResult.success(vo); + } + + @Operation(summary = "获取用户信息(报表使用)") + @GetMapping("/ReportUserInfo") + public Map reportUserInfo() { + UserInfo userInfo = UserProvider.getUser(); + Map map = new HashMap<>(); + map.put("userId", userInfo.getUserId()); + map.put("departmentId", userInfo.getDepartmentId()); + map.put("organizeId", userInfo.getOrganizeId()); + map.put("positionId", userInfo.getPositionIds().length > 0 ? userInfo.getPositionIds()[0] : ""); + map.put("roleId", userInfo.getRoleIds().size() > 0 ? userInfo.getRoleIds().get(0) : ""); + map.put("managerId", userInfo.getManagerId()); + return map; + } + + @Operation(summary = "获取用户信息(AI大模型使用)") + @GetMapping("/AigcUserInfo") + public Map aigcUserInfo() { + UserInfo userInfo = UserProvider.getUser(); + Map map = new HashMap<>(); + map.put("id", userInfo.getUserId()); + map.put("tenantId", StringUtil.isEmpty(userInfo.getTenantId()) ? "0" : userInfo.getTenantId()); + map.put("username", userInfo.getUserAccount()); + map.put("realName", userInfo.getUserName()); + map.put("sex", userInfo.getUserGender()); + map.put("phone", userInfo.getMobilePhone()); + map.put("email", userInfo.getEmail()); + map.put("avatar", userInfo.getUserIcon()); + map.put("status", String.valueOf(userInfo.getEnabledMark() == 1)); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSX"); + map.put("createTime", sdf.format(userInfo.getCreateTime())); + return map; + } + + /** + * 递归找他的上级 + */ + public void getOrganizeName(List OrganizeList, String OrganizeId, StringBuilder organizeName) { + List OrganizeList2 = OrganizeList.stream().filter(t -> t.getId().equals(OrganizeId)).collect(Collectors.toList()); + if (OrganizeList2.size() > 0) { + for (OrganizeEntity organizeEntity : OrganizeList2) { + if ("-1".equals(organizeEntity.getParentId())) { + //父级为-1时候退出 + organizeName.append(organizeEntity.getFullName()); + } else { + organizeName.append(organizeEntity.getFullName() + "/"); + } + } + for (OrganizeEntity orgSub : OrganizeList2) { + getOrganizeName(OrganizeList, orgSub.getParentId(), organizeName); + } + } + } + + + /** + * 我的权限 + * + * @return + */ + @Operation(summary = "系统权限") + @GetMapping("/Authorize") + public ActionResult getList() { + List authorizeList = new ArrayList<>(); + //系统权限 + AuthorizeVO authorizeModel = authorizeService.getAuthorize(false,false,true); + //赋值图标 + Map moduleMap = this.moduleList(authorizeModel.getModuleList()); + UserInfo userInfo = UserProvider.getUser(); + if (StringUtil.isEmpty(userInfo.getSystemId())) { + return ActionResult.success(new UserAuthorizeVO()); + } + List moduleList = authorizeModel.getModuleList(); + moduleList = moduleList.stream().filter(t -> t != null && StringUtil.isNotEmpty(t.getSystemId()) && t.getSystemId().equals(userInfo.getSystemId())).collect(Collectors.toList()); + moduleList.forEach(t -> { + if (t.getParentId().equals(t.getSystemId())) { + t.setParentId("-1"); + } + }); + + UserAuthorizeVO vo = UserAuthorizeVO.builder() + .button(this.moduleButton(moduleList, authorizeModel.getButtonList(), authorizeList, moduleMap)) + .column(this.moduleColumn(moduleList, authorizeModel.getColumnList(), authorizeList, moduleMap)) + .form(this.moduleForm(moduleList, authorizeModel.getFormsList(), authorizeList, moduleMap)) + .resource(this.resourceData(moduleList, authorizeModel.getResourceList(), authorizeList, moduleMap)) + .module(this.module(moduleList, authorizeList)) + .flow(this.flow(authorizeList)) + .print(this.print(authorizeList)) + .portal(this.portal(authorizeModel.getSystemList())).build(); + return ActionResult.success(vo); + } + + /** + * 系统日志 + * + * @param pagination 页面参数 + * @return + */ + @Operation(summary = "系统日志") + @GetMapping("/SystemLog") + public ActionResult> getLogList(PaginationLogModel pagination) { + List data = logService.getList(pagination.getCategory(), pagination); + List loginLogVOList = JsonUtil.getJsonToList(data, UserLogVO.class); + for (int i = 0; i < loginLogVOList.size(); i++) { + loginLogVOList.get(i).setAbstracts(data.get(i).getDescription()); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(loginLogVOList, paginationVO); + } + + /** + * 修改用户资料 + * + * @param userInfoForm 页面参数 + * @return + */ + @Operation(summary = "修改用户资料") + @Parameters({ + @Parameter(name = "userInfoForm", description = "页面参数", required = true) + }) + @PutMapping("/BaseInfo") + public ActionResult updateInfo(@RequestBody UserInfoForm userInfoForm) throws Exception { + UserEntity userEntity = userService.getInfo(UserProvider.getUser().getUserId()); + userEntity.setBirthday(userInfoForm.getBirthday() == null ? null : new Date(userInfoForm.getBirthday())); + userEntity.setCertificatesNumber(userInfoForm.getCertificatesNumber()); + userEntity.setCertificatesType(userInfoForm.getCertificatesType()); + userEntity.setEducation(userInfoForm.getEducation()); + userEntity.setEmail(userInfoForm.getEmail()); + userEntity.setGender(userInfoForm.getGender()); + userEntity.setLandline(userInfoForm.getLandline()); + userEntity.setMobilePhone(userInfoForm.getMobilePhone()); + userEntity.setNation(userInfoForm.getNation()); + userEntity.setNativePlace(userInfoForm.getNativePlace()); + userEntity.setPostalAddress(userInfoForm.getPostalAddress()); + userEntity.setRealName(userInfoForm.getRealName()); + userEntity.setSignature(userInfoForm.getSignature()); + userEntity.setTelePhone(userInfoForm.getTelePhone()); + userEntity.setUrgentContacts(userInfoForm.getUrgentContacts()); + userEntity.setUrgentTelePhone(userInfoForm.getUrgentTelePhone()); + userService.updateById(userEntity); + return ActionResult.success(MsgCode.SU002.get()); + } + + /** + * 修改用户密码 + * + * @param userModifyPasswordForm 用户修改密码表单 + * @return + */ + @Operation(summary = "修改用户密码") + @Parameters({ + @Parameter(name = "userModifyPasswordForm", description = "用户修改密码表单", required = true) + }) + @PostMapping("/Actions/ModifyPassword") + public ActionResult modifyPassword(@RequestBody @Valid UserModifyPasswordForm userModifyPasswordForm) { + UserEntity userEntity = userService.getInfo(UserProvider.getUser().getUserId()); + if (userEntity != null) { +// if ("1".equals(String.valueOf(userEntity.getIsAdministrator()))) { +// return ActionResult.fail("无法修改管理员账户"); +// } + String timestamp = String.valueOf(redisUtil.getString(userModifyPasswordForm.getTimestamp())); + if (!userModifyPasswordForm.getCode().equalsIgnoreCase(timestamp)) { + return ActionResult.fail(MsgCode.LOG104.get()); + } + if (!Md5Util.getStringMd5((userModifyPasswordForm.getOldPassword().toLowerCase() + userEntity.getSecretkey().toLowerCase())).equals(userEntity.getPassword())) { + return ActionResult.fail(MsgCode.LOG201.get()); + } + //禁用旧密码 + String disableOldPassword = sysConfigApi.getValueByKey("disableOldPassword"); + if (disableOldPassword.equals("1")) { + String disableTheNumberOfOldPasswords = sysConfigApi.getValueByKey("disableTheNumberOfOldPasswords"); + List userOldPasswordList = userOldPasswordService.getList(UserProvider.getLoginUserId()); + userOldPasswordList = userOldPasswordList.stream().limit(Long.valueOf(disableTheNumberOfOldPasswords)).collect(Collectors.toList()); + for (UserOldPasswordEntity userOldPassword : userOldPasswordList) { + String newPassword = Md5Util.getStringMd5(userModifyPasswordForm.getPassword().toLowerCase() + userOldPassword.getSecretkey().toLowerCase()); + if (userOldPassword.getOldPassword().equals(newPassword)) { + return ActionResult.fail(MsgCode.LOG204.get()); + } + } + } + userEntity.setPassword(userModifyPasswordForm.getPassword()); + userService.updatePassword(userEntity); + UserProvider.logoutByUserId(userEntity.getId()); + userEntity.setPassword(userModifyPasswordForm.getPassword()); + PullUserUtil.syncUser(userEntity, "modifyPassword", UserProvider.getUser().getTenantId()); + return ActionResult.success(MsgCode.LOG202.get()); + } + return ActionResult.fail(MsgCode.LOG203.get()); + + } + + /** + * 我的下属 + * + * @param id 主键 + * @return + */ + @Operation(summary = "我的下属") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @GetMapping("/Subordinate/{id}") + public ActionResult> getSubordinate(@PathVariable("id") String id) { + List userName = new ArrayList<>(16); + List list = new ArrayList<>(); + if ("0".equals(id)) { + if (Objects.isNull(UserProvider.getUser()) || StringUtil.isEmpty(UserProvider.getUser().getUserId())) { + return ActionResult.success(list); + } + userName.add(userService.getInfo(UserProvider.getUser().getUserId())); + } else { + userName = new ArrayList<>(userService.getListByManagerId(id, null)); + } + List department = userName.stream().map(t -> t.getOrganizeId()).collect(Collectors.toList()); + List departmentList = organizeService.getOrganizeName(department); + for (UserEntity user : userName) { + String departName = departmentList.stream().filter( + t -> String.valueOf(user.getOrganizeId()).equals(String.valueOf(t.getId())) + ).findFirst().orElse(new OrganizeEntity()).getFullName(); + PositionEntity entity = null; + if (StringUtil.isNotEmpty(user.getPositionId())) { + String[] split = user.getPositionId().split(","); + for (String positionId : split) { + entity = positionService.getInfo(positionId); + if (Objects.nonNull(entity)) { + break; + } + } + } + UserSubordinateVO subordinateVO = UserSubordinateVO.builder() + .id(user.getId()) + .avatar(UploaderUtil.uploaderImg(user.getHeadIcon())) + .department(departName) + .userName(user.getRealName() + "/" + user.getAccount()) + .position(entity != null ? entity.getFullName() : null) + .isLeaf(false).build(); + list.add(subordinateVO); + } + return ActionResult.success(list); + } + + /** + * 修改系统主题 + * + * @param userThemeForm 主题模板 + * @return + */ + @Operation(summary = "修改系统主题") + @Parameters({ + @Parameter(name = "userThemeForm", description = "主题模板", required = true) + }) + @PutMapping("/SystemTheme") + public ActionResult updateTheme(@RequestBody @Valid UserThemeForm userThemeForm) { + UserEntity entity = JsonUtil.getJsonToBean(userThemeForm, UserEntity.class); + entity.setId(UserProvider.getUser().getUserId()); + userService.updateById(entity); + return ActionResult.success(MsgCode.SU016.get()); + } + + /** + * 修改头像 + * + * @param name 名称 + * @return + */ + @Operation(summary = "修改头像") + @Parameters({ + @Parameter(name = "name", description = "名称", required = true) + }) + @PutMapping("/Avatar/{name}") + public ActionResult updateAvatar(@PathVariable("name") String name) throws Exception { + UserInfo userInfo = UserProvider.getUser(); + UserEntity userEntity = userService.getInfo(userInfo.getUserId()); + userEntity.setHeadIcon(name); + userService.update(userEntity.getId(), userEntity); + if (!StringUtil.isEmpty(userInfo.getId())) { + userInfo.setUserIcon(name); + //redisUtil.insert(userInfo.getId(), userInfo, DateUtil.getTime(userInfo.getOverdueTime()) - DateUtil.getTime(new Date())); + UserProvider.setLoginUser(userInfo); + UserProvider.setLocalLoginUser(userInfo); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 修改系统语言 + * + * @param userLanguageForm 修改语言模型 + * @return + */ + @Operation(summary = "修改系统语言") + @Parameters({ + @Parameter(name = "userLanguageForm", description = "修改语言模型", required = true) + }) + @PutMapping("/SystemLanguage") + public ActionResult updateLanguage(@RequestBody @Valid UserLanguageForm userLanguageForm) { + UserEntity userEntity = userService.getInfo(UserProvider.getUser().getUserId()); + userEntity.setLanguage(userLanguageForm.getLanguage()); + userService.updateById(userEntity); + return ActionResult.success(MsgCode.SU016.get()); + } + + + /** + * 赋值图标 + * + * @param moduleList + * @return + */ + private Map moduleList(List moduleList) { + Map auth = new HashMap<>(16); + for (ModuleModel module : moduleList) { + auth.put(module.getId(), module); + module.setIcon(module.getIcon()); + } + return auth; + } + + /** + * 功能权限 + * + * @param moduleList 功能 + * @param authorizeLiat 权限集合 + * @return + */ + private List module(List moduleList, List authorizeLiat) { + List appId = moduleList.stream().filter(t -> "App".equals(t.getCategory())).map(t -> t.getId()).collect(Collectors.toList()); + List treeList = JsonUtil.getJsonToList(moduleList, AuthorizeModel.class); + treeList = treeList.stream().sorted(Comparator.comparing(AuthorizeModel::getSortCode).thenComparing(AuthorizeModel::getCreatorTime, Comparator.reverseOrder())).collect(Collectors.toList()); + List> trees = TreeDotUtils.convertListToTreeDot(treeList, "-1"); + List vo = JsonUtil.getJsonToList(trees, UserAuthorizeModel.class); + List dataList = new LinkedList<>(); + List webChildList = new LinkedList<>(); + List appChildList = new LinkedList<>(); + for (UserAuthorizeModel model : vo) { + if (appId.contains(model.getId())) { + appChildList.add(model); + } else { + webChildList.add(model); + } + } + if (webChildList.size() > 0) { + UserAuthorizeModel webData = new UserAuthorizeModel(); + webData.setId("1"); + webData.setFullName("WEB菜单"); + webData.setIcon("icon-ym icon-ym-pc"); + webData.setChildren(webChildList); + dataList.add(webData); + } + if (appChildList.size() > 0) { + UserAuthorizeModel appData = new UserAuthorizeModel(); + appData.setId("2"); + appData.setFullName("APP菜单"); + appData.setIcon("icon-ym icon-ym-mobile"); + appData.setChildren(appChildList); + dataList.add(appData); + } + return dataList; + } + + /** + * 按钮权限 + * + * @param moduleList 功能 + * @param moduleButtonList 按钮 + * @param authorizeLiat 权限集合 + * @return + */ + private List moduleButton(List moduleList, List moduleButtonList, List authorizeLiat, Map moduleMap) { + List treeList = new ArrayList<>(); + Set moduleModeId = new HashSet<>(); + //获取按钮的菜单id + for (ButtonModel buttonModel : moduleButtonList) { + moduleModeId.add(buttonModel.getModuleId()); + AuthorizeModel treeModel = new AuthorizeModel(); + treeModel.setId(buttonModel.getId()); + treeModel.setFullName(buttonModel.getFullName()); + treeModel.setParentId(buttonModel.getModuleId()); + treeModel.setIcon(buttonModel.getIcon()); + treeModel.setCreatorTime(buttonModel.getCreatorTimes()); + treeList.add(treeModel); + } + List buttonList = moduleList.stream().filter(t -> moduleModeId.contains(t.getId())).collect(Collectors.toList()); + List moduleListAll = JsonUtil.getJsonToList(ListToTreeUtil.treeWhere(buttonList, moduleList), AuthorizeModel.class); + treeList.addAll(moduleListAll); + treeList = treeList.stream().sorted(Comparator.comparing(AuthorizeModel::getSortCode).thenComparing(AuthorizeModel::getCreatorTime, Comparator.reverseOrder())).collect(Collectors.toList()); + List> trees = TreeDotUtils.convertListToTreeDot(treeList, "-1"); + //组装菜单树 + List appId = moduleList.stream().filter(t -> "App".equals(t.getCategory())).map(t -> t.getId()).collect(Collectors.toList()); + List data = JsonUtil.getJsonToList(trees, UserAuthorizeModel.class); + List dataList = new LinkedList<>(); + List webChildList = new LinkedList<>(); + List appChildList = new LinkedList<>(); + for (UserAuthorizeModel model : data) { + if (appId.contains(model.getId())) { + appChildList.add(model); + } else { + webChildList.add(model); + } + } + if (webChildList.size() > 0) { + UserAuthorizeModel webData = new UserAuthorizeModel(); + webData.setId("1"); + webData.setFullName("WEB菜单"); + webData.setIcon("icon-ym icon-ym-pc"); + webData.setChildren(webChildList); + dataList.add(webData); + } + if (appChildList.size() > 0) { + UserAuthorizeModel appData = new UserAuthorizeModel(); + appData.setId("2"); + appData.setFullName("APP菜单"); + appData.setIcon("icon-ym icon-ym-mobile"); + appData.setChildren(appChildList); + dataList.add(appData); + } + return dataList; + } + + /** + * 列表权限 + * + * @param moduleList 功能 + * @param moduleColumnList 列表 + * @param authorizeLiat 权限集合 + * @return + */ + private List moduleColumn(List moduleList, List moduleColumnList, List authorizeLiat, Map moduleMap) { + List treeList = new ArrayList<>(); + List moduleModeId = new ArrayList<>(); + //获取按钮的菜单id + for (ColumnModel columnModel : moduleColumnList) { + moduleModeId.add(columnModel.getModuleId()); + AuthorizeModel treeModel = new AuthorizeModel(); + treeModel.setId(columnModel.getId()); + treeModel.setFullName(columnModel.getFullName()); + treeModel.setParentId(columnModel.getModuleId()); + treeModel.setIcon("fa fa-tags column"); + treeModel.setCreatorTime(columnModel.getCreatorTimes()); + treeList.add(treeModel); + } + List buttonList = moduleList.stream().filter(t -> moduleModeId.contains(t.getId())).collect(Collectors.toList()); + List moduleListAll = JsonUtil.getJsonToList(ListToTreeUtil.treeWhere(buttonList, moduleList), AuthorizeModel.class); + treeList.addAll(moduleListAll); + treeList = treeList.stream().sorted(Comparator.comparing(AuthorizeModel::getSortCode).thenComparing(AuthorizeModel::getCreatorTime, Comparator.reverseOrder())).collect(Collectors.toList()); + List> trees = TreeDotUtils.convertListToTreeDot(treeList, "-1"); + //组装菜单树 + List appId = moduleList.stream().filter(t -> "App".equals(t.getCategory())).map(t -> t.getId()).collect(Collectors.toList()); + List data = JsonUtil.getJsonToList(trees, UserAuthorizeModel.class); + List dataList = new LinkedList<>(); + List webChildList = new LinkedList<>(); + List appChildList = new LinkedList<>(); + for (UserAuthorizeModel model : data) { + if (appId.contains(model.getId())) { + appChildList.add(model); + } else { + webChildList.add(model); + } + } + if (webChildList.size() > 0) { + UserAuthorizeModel webData = new UserAuthorizeModel(); + webData.setId("1"); + webData.setFullName("WEB菜单"); + webData.setIcon("icon-ym icon-ym-pc"); + webData.setChildren(webChildList); + dataList.add(webData); + } + if (appChildList.size() > 0) { + UserAuthorizeModel appData = new UserAuthorizeModel(); + appData.setId("2"); + appData.setFullName("APP菜单"); + appData.setIcon("icon-ym icon-ym-mobile"); + appData.setChildren(appChildList); + dataList.add(appData); + } + return dataList; + } + + /** + * 表单权限 + * + * @param moduleList 功能 + * @param moduleFormList 表单 + * @param authorizeLiat 权限集合 + * @return ignore + */ + private List moduleForm(List moduleList, List moduleFormList, List authorizeLiat, Map moduleMap) { + List treeList = new ArrayList<>(); + List moduleModeId = new ArrayList<>(); + //获取按钮的菜单id + for (ModuleFormModel formModel : moduleFormList) { + moduleModeId.add(formModel.getModuleId()); + AuthorizeModel treeModel = new AuthorizeModel(); + treeModel.setId(formModel.getId()); + treeModel.setFullName(formModel.getFullName()); + treeModel.setParentId(formModel.getModuleId()); + treeModel.setIcon("fa fa-binoculars resource"); + treeModel.setCreatorTime(formModel.getCreatorTimes()); + treeList.add(treeModel); + } + List buttonList = moduleList.stream().filter(t -> moduleModeId.contains(t.getId())).collect(Collectors.toList()); + List moduleListAll = JsonUtil.getJsonToList(ListToTreeUtil.treeWhere(buttonList, moduleList), AuthorizeModel.class); + treeList.addAll(moduleListAll); + treeList = treeList.stream().sorted(Comparator.comparing(AuthorizeModel::getSortCode).thenComparing(AuthorizeModel::getCreatorTime, Comparator.reverseOrder())).collect(Collectors.toList()); + List> trees = TreeDotUtils.convertListToTreeDot(treeList, "-1"); + //组装菜单树 + List appId = moduleList.stream().filter(t -> "App".equals(t.getCategory())).map(t -> t.getId()).collect(Collectors.toList()); + List data = JsonUtil.getJsonToList(trees, UserAuthorizeModel.class); + List dataList = new LinkedList<>(); + List webChildList = new LinkedList<>(); + List appChildList = new LinkedList<>(); + for (UserAuthorizeModel model : data) { + if (appId.contains(model.getId())) { + appChildList.add(model); + } else { + webChildList.add(model); + } + } + if (webChildList.size() > 0) { + UserAuthorizeModel webData = new UserAuthorizeModel(); + webData.setId("1"); + webData.setFullName("WEB菜单"); + webData.setIcon("icon-ym icon-ym-pc"); + webData.setChildren(webChildList); + dataList.add(webData); + } + if (appChildList.size() > 0) { + UserAuthorizeModel appData = new UserAuthorizeModel(); + appData.setId("2"); + appData.setFullName("APP菜单"); + appData.setIcon("icon-ym icon-ym-mobile"); + appData.setChildren(appChildList); + dataList.add(appData); + } + return dataList; + } + + /** + * 数据权限 + * + * @param moduleList 功能 + * @param moduleResourceList 资源 + * @param authorizeLiat 权限集合 + * @return ignore + */ + private List resourceData(List moduleList, List moduleResourceList, List authorizeLiat, Map moduleMap) { + List treeList = new ArrayList<>(); + List moduleModeId = new ArrayList<>(); + //获取按钮的菜单id + for (ResourceModel resourceModel : moduleResourceList) { + moduleModeId.add(resourceModel.getModuleId()); + AuthorizeModel treeModel = new AuthorizeModel(); + treeModel.setId(resourceModel.getId()); + treeModel.setFullName(resourceModel.getFullName()); + treeModel.setParentId(resourceModel.getModuleId()); + treeModel.setIcon("fa fa-binoculars resource"); + treeModel.setCreatorTime(resourceModel.getCreatorTimes()); + treeList.add(treeModel); + } + List buttonList = moduleList.stream().filter(t -> moduleModeId.contains(t.getId())).collect(Collectors.toList()); + List moduleListAll = JsonUtil.getJsonToList(ListToTreeUtil.treeWhere(buttonList, moduleList), AuthorizeModel.class); + treeList.addAll(moduleListAll); + treeList = treeList.stream().sorted(Comparator.comparing(AuthorizeModel::getSortCode).thenComparing(AuthorizeModel::getCreatorTime, Comparator.reverseOrder())).collect(Collectors.toList()); + List> trees = TreeDotUtils.convertListToTreeDot(treeList, "-1"); + //组装菜单树 + List appId = moduleList.stream().filter(t -> "App".equals(t.getCategory())).map(t -> t.getId()).collect(Collectors.toList()); + List data = JsonUtil.getJsonToList(trees, UserAuthorizeModel.class); + List dataList = new LinkedList<>(); + List webChildList = new LinkedList<>(); + List appChildList = new LinkedList<>(); + for (UserAuthorizeModel model : data) { + if (appId.contains(model.getId())) { + appChildList.add(model); + } else { + webChildList.add(model); + } + } + if (webChildList.size() > 0) { + UserAuthorizeModel webData = new UserAuthorizeModel(); + webData.setId("1"); + webData.setFullName("WEB菜单"); + webData.setIcon("icon-ym icon-ym-pc"); + webData.setChildren(webChildList); + dataList.add(webData); + } + if (appChildList.size() > 0) { + UserAuthorizeModel appData = new UserAuthorizeModel(); + appData.setId("2"); + appData.setFullName("APP菜单"); + appData.setIcon("icon-ym icon-ym-mobile"); + appData.setChildren(appChildList); + dataList.add(appData); + } + return dataList; + } + + /** + * 门户权限 + * + * @param systemBaeModelList + * @return + */ + private List portal(List systemBaeModelList) { + List myPortalList = new ArrayList<>(); + List mySystemList = JsonUtil.getJsonToList(systemBaeModelList, SystemEntity.class); + SystemEntity systemEntity = mySystemList.stream().filter(t -> t.getId().equals(UserProvider.getUser().getSystemId())).findFirst().orElse(null); + List roleIdList = new ArrayList<>(); + permissionGroupService.getPermissionGroupByUserId(UserProvider.getLoginUserId(), null, true, null).forEach(t -> { + roleIdList.add(t.getId()); + }); + List collect = authorizeService.getListByRoleIdsAndItemType(roleIdList, AuthorizeConst.AUTHORIZE_PORTAL_MANAGE).stream().map(AuthorizeEntity::getItemId).collect(Collectors.toList()); + //管理员查看全部 + PortalManagePage page = new PortalManagePage(); + page.setEnabledMark(1); + page.setSystemId(UserProvider.getUser().getSystemId()); + page.setState(0); + List portalIdList = portalManageApi.getSelectList(page).stream().map(PortalManagePageDO::getId).collect(Collectors.toList()); + if (UserProvider.getUser().getIsAdministrator()) { + collect.addAll(portalIdList); + } + authorizeService.getPortal(systemEntity == null ? new ArrayList<>() : Collections.singletonList(systemEntity), myPortalList, System.currentTimeMillis(), collect.size() > 0 ? collect : null); + myPortalList.remove(JsonUtil.getJsonToBean(systemEntity, PortalModel.class)); + List> trees = TreeDotUtils.convertListToTreeDot(myPortalList); + trees.forEach(t -> { + if (t.getParentId().startsWith(systemEntity.getId())) { + t.setParentId("-1"); + } + }); + return JsonUtil.getJsonToList(trees, UserAuthorizeModel.class); + } + + /** + * 权限 + * + * @return + */ + private List flow(List authorizeLiat) { + UserInfo user = UserProvider.getUser(); + List itemId = new ArrayList<>(); + boolean isFlowAll = authorizeService.getUserStanding(false, user.getUserId()).stream().filter(t -> !"3".equals(t.getId())).count() > 0; + if (isFlowAll) { + List treeListVoList = templateApi.treeListWithPower(); + for (TemplateTreeListVo treeListVo : treeListVoList) { + itemId.add(treeListVo.getId()); + if (ObjectUtil.isNotEmpty(treeListVo.getChildren())) { + for (TemplateTreeListVo child : treeListVo.getChildren()) { + itemId.add(child.getId()); + } + } + } + } else { + List roleIdList = new ArrayList<>(); + permissionGroupService.getPermissionGroupByUserId(UserProvider.getLoginUserId(), null, true, null).forEach(t -> { + roleIdList.add(t.getId()); + }); + itemId = authorizeService.getListByRoleIdsAndItemType(roleIdList, AuthorizeConst.FLOW).stream().map(AuthorizeEntity::getItemId).collect(Collectors.toList()); + } + List listVO = new ArrayList<>(); + if (itemId.size() > 0) { + List list = templateApi.getListByFlowIds(itemId); + List category = list.stream().map(TemplateEntity::getCategory).collect(Collectors.toList()); + List dictionName = dictionaryDataApi.getDictionName(category); + for (DictionaryDataEntity dict : dictionName) { + UserAuthorizeModel vo = JsonUtil.getJsonToBean(dict, UserAuthorizeModel.class); + List childList = list.stream() + .filter(e -> dict.getId().equals(e.getCategory())) + .sorted(Comparator.comparing(TemplateEntity::getSortCode).thenComparing(TemplateEntity::getCreatorTime, Comparator.reverseOrder())).collect(Collectors.toList()); + if (childList.size() > 0) { + vo.setChildren(JsonUtil.getJsonToList(childList, UserAuthorizeModel.class)); + listVO.add(vo); + } + } + } + return listVO; + } + + /** + * 权限 + * + * @return + */ + private List print(List authorizeLiat) { + UserInfo user = UserProvider.getUser(); + List itemId = new ArrayList<>(); + if (!authorizeService.getUserCurrentStanding(user.getUserId(), 3)) { + PaginationPrint paginationPrint = new PaginationPrint(); + paginationPrint.setDataType(1); + paginationPrint.setVisibleType(2); + List list = printDevApi.getWorkSelector(paginationPrint); + itemId.addAll(list.stream().map(PrintDevEntity::getId).collect(Collectors.toList())); + } else { + List roleIdList = new ArrayList<>(); + permissionGroupService.getPermissionGroupByUserId(UserProvider.getLoginUserId(), null, true, null).forEach(t -> { + roleIdList.add(t.getId()); + }); + itemId = authorizeService.getListByRoleIdsAndItemType(roleIdList, AuthorizeConst.PRINT).stream().map(AuthorizeEntity::getItemId).collect(Collectors.toList()); + } + List listVO = new ArrayList<>(); + if (itemId.size() > 0) { + List list = printDevApi.getWorkSelector(itemId); + List category = list.stream().map(PrintDevEntity::getCategory).collect(Collectors.toList()); + List dictionName = dictionaryDataApi.getDictionName(category); + for (DictionaryDataEntity dict : dictionName) { + UserAuthorizeModel vo = JsonUtil.getJsonToBean(dict, UserAuthorizeModel.class); + List childList = list.stream() + .filter(e -> dict.getId().equals(e.getCategory())) + .sorted(Comparator.comparing(PrintDevEntity::getSortCode).thenComparing(PrintDevEntity::getCreatorTime, Comparator.reverseOrder())).collect(Collectors.toList()); + if (childList.size() > 0) { + vo.setChildren(JsonUtil.getJsonToList(childList, UserAuthorizeModel.class)); + listVO.add(vo); + } + } + } + return listVO; + } + + /** + * 设置主要组织、主要岗位(角色当前不做) + * + * @param userSettingForm 页面参数 + * @return + */ + @Operation(summary = "设置主要组织、主要岗位(角色当前不做)") + @Parameters({ + @Parameter(name = "userSettingForm", description = "页面参数", required = true) + }) + @PutMapping("/major") + public ActionResult defaultOrganize(@RequestBody UserSettingForm userSettingForm) { + UserInfo userInfo = UserProvider.getUser(); + UserEntity userEntity = userService.getInfo(userInfo.getUserId()); + if (userEntity == null) { + return ActionResult.fail(ActionResultCode.SessionOverdue.getCode(), ActionResultCode.SessionOverdue.getMessage()); + } + UserEntity updateUser = new UserEntity(); + switch (userSettingForm.getMajorType()) { + case PermissionConst.ORGANIZE: + String orgId = userSettingForm.getMajorId(); + // 对角色权限进行验证 + List permissionGroupEntities = organizeRelationService.checkBasePermission(userEntity.getId(), orgId, null); + if (organizeRelationService.checkBasePermission(userEntity.getId(), orgId, null).size() == 0) { + return ActionResult.fail(MsgCode.FA025.get()); + } + updateUser.setOrganizeId(orgId); + // 只取菜单和系统 + List listByObjectId = authorizeService.getListByObjectId(permissionGroupEntities.stream().map(PermissionGroupEntity::getId).collect(Collectors.toList())); + listByObjectId = listByObjectId.stream().filter(t -> AuthorizeConst.SYSTEM.equals(t.getItemType()) || AuthorizeConst.MODULE.equals(t.getItemType())).collect(Collectors.toList()); + List listByIds = systemService.getListByIds(listByObjectId.stream().map(AuthorizeEntity::getItemId).collect(Collectors.toList()), null); + // 判断systemCode是否未空 + if (StringUtil.isNotEmpty(userInfo.getSystemCode()) && listByIds.stream().map(SystemEntity::getEnCode).noneMatch(t -> t.equals(userInfo.getSystemCode()))) { + return ActionResult.fail(MsgCode.PS032.get()); + } + // 组织的权限没有当前系统 + if (listByIds.size() > 0) { + if (userSettingForm.getMenuType() != null && userSettingForm.getMenuType() == 1) { + if (!listByIds.contains(userEntity.getAppSystemId())) { + updateUser.setAppSystemId(listByIds.get(0).getId()); + } + } else { + if (!listByIds.contains(userEntity.getSystemId())) + updateUser.setSystemId(listByIds.get(0).getId()); + } + } + // 岗位自动切换 + updateUser.setPositionId(organizeRelationService.autoGetMajorPositionId(userEntity.getId(), orgId, userEntity.getPortalId())); + break; + case PermissionConst.POSITION: + updateUser.setPositionId(userSettingForm.getMajorId()); + break; + case PermissionConst.SYSTEM: + SystemEntity systemEntity = systemService.getInfo(userSettingForm.getMajorId()); + if (systemEntity == null) { + return ActionResult.fail(MsgCode.PS031.get()); + } + if (systemEntity.getEnabledMark() == 0) { + return ActionResult.fail(MsgCode.PS014.get()); + } + // 获取的时候判断 + List moduleList = authorizeService.getAuthorize(false,false,true).getModuleList() + .stream().filter(t -> StringUtil.isNotEmpty(t.getSystemId()) && t.getSystemId().equals(userSettingForm.getMajorId())).collect(Collectors.toList()); + Map> map = moduleList.stream().collect(Collectors.groupingBy(t -> { + if ("Web".equals(t.getCategory())) { + return "Web"; + } else { + return "App"; + } + })); + List webModule = map.containsKey("Web") ? map.get("Web") : new ArrayList<>(); + List appModule = map.containsKey("App") ? map.get("App") : new ArrayList<>(); + boolean workFlowEnabled = systemEntity.getWorkflowEnabled() != null && systemEntity.getWorkflowEnabled() == 0; + if (Objects.equals(userSettingForm.getMenuType(), 1)) { + if (appModule.size() == 0 && workFlowEnabled) { + return ActionResult.fail(MsgCode.FA027.get()); + } + } else if (webModule.size() == 0 && workFlowEnabled) { + return ActionResult.fail(MsgCode.FA027.get()); + } + if (userSettingForm.getMenuType() != null && userSettingForm.getMenuType() == 1) { + updateUser.setAppSystemId(userSettingForm.getMajorId()); + } else { + updateUser.setSystemId(userSettingForm.getMajorId()); + } + updateUser.setId(userEntity.getId()); + // 切换组织 + String orgIdByUserIdAndSystemId = permissionGroupService.getOrgIdByUserIdAndSystemId(userEntity.getId(), userSettingForm.getMajorId()); + if (StringUtil.isNotEmpty(orgIdByUserIdAndSystemId)) { + updateUser.setOrganizeId(orgIdByUserIdAndSystemId); + } + userService.updateById(updateUser); + return ActionResult.success(MsgCode.SU005.get()); + case PermissionConst.STAND: + switch (userSettingForm.getMajorId()) { + case "1": + if (!Objects.equals(userEntity.getIsAdministrator(), 1)) { + return ActionResult.fail(MsgCode.FA052.get()); + } + break; + case "2": + case "3": + AuthorizeVO authorize = authorizeService.getAuthorize(UserProvider.getUser(), false, Integer.valueOf(userSettingForm.getMajorId()), true); + boolean isOrganize = Objects.equals(userSettingForm.getMajorId(), "2"); + List list = new ArrayList<>(); + if (isOrganize) { + List infoByUserId = organizeAdministratorService.getInfoByUserId(userEntity.getId()); + if (infoByUserId.isEmpty()) { + return ActionResult.fail(MsgCode.FA052.get()); + } + List orgList = ImmutableList.of(PermissionConst.SYSTEM, PermissionConst.MODULE); + list.addAll(infoByUserId.stream().filter(t -> orgList.contains(t.getOrganizeType())).collect(Collectors.toList())); + } + boolean isPC = DeviceType.PC.getDevice().equals(userInfo.getLoginDevice()); + String category = isPC ? "Web" : "App"; + Map> moduleMap = authorize.getModuleList().stream().filter(t -> category.equals(t.getCategory())).collect(Collectors.groupingBy(ModuleModel::getSystemId)); + boolean isAnyModule = false; + boolean enabledFow = list.size() > 0 || !isOrganize; + if (configValueUtil.isMultiTenancy() && enabledFow) { + TenantAuthorizeModel tenantAuthorizeModel = TenantDataSourceUtil.getCacheModuleAuthorize(UserProvider.getUser().getTenantId()); + List cacheModuleAuthorize = tenantAuthorizeModel.getModuleIdList(); + if (cacheModuleAuthorize != null) { + enabledFow = !cacheModuleAuthorize.contains("-999"); + } + } + for (SystemBaeModel systemBaeModel : authorize.getSystemList()) { + String systemId = systemBaeModel.getId(); + isAnyModule = ObjectUtil.isNotEmpty(moduleMap.get(systemId)) || (enabledFow && Objects.equals(systemBaeModel.getWorkflowEnabled(), 1)); + if (isAnyModule) { + break; + } + } + if (!isAnyModule) return ActionResult.fail(MsgCode.FA052.get()); + if (Objects.equals(userSettingForm.getMajorId(), 3)) { + //普通用户组织下没有权限 改到有权限的组织 + userService.updateStand(ImmutableList.of(userEntity.getId()), 3); + } + break; + } + if (DeviceType.PC.getDevice().equals(userInfo.getLoginDevice())) { + updateUser.setStanding(Integer.valueOf(userSettingForm.getMajorId())); + } else { + updateUser.setAppStanding(Integer.valueOf(userSettingForm.getMajorId())); + } + break; + default: + break; + } + updateUser.setId(userEntity.getId()); + userService.updateById(updateUser); + authorizeService.removeAuthByUserOrMenu(Arrays.asList(userInfo.getUserId()), null); + return ActionResult.success(MsgCode.SU016.get()); + } + + @Operation(summary = "获取当前用户所有组织") + @GetMapping("/getUserOrganizes") + public ActionResult> getUserOrganizes() { + return ActionResult.success(userRelationService.getObjectVoList(PermissionConst.ORGANIZE)); + } + + @Operation(summary = "获取当前用户当前组织底下所有岗位") + @GetMapping("/getUserPositions") + public ActionResult> getUserPositions() { + return ActionResult.success(userRelationService.getObjectVoList(PermissionConst.POSITION)); + } + + + @Operation(summary = "获取当前用户所有角色") + @GetMapping("/getUserRoles") + public ActionResult> getUserRoles() { + return ActionResult.success(userRelationService.getObjectVoList(PermissionConst.ROLE)); + } + + /*= different =*/ + + /** + * 修改app常用 + * + * @param userAppDataForm 页面参数 + * @return + */ + @Operation(summary = "修改app常用数据") + @Parameter(name = "userAppDataForm", description = "页面参数", required = true) + @PutMapping("/SystemAppData") + public ActionResult updateAppData(@RequestBody @Valid UserAppDataForm userAppDataForm) { + UserInfo userInfo = UserProvider.getUser(); + UserEntity entity = userService.getInfo(userInfo.getUserId()); + entity.setPropertyJson(userAppDataForm.getData()); + userService.updateById(entity); + return ActionResult.success(MsgCode.SU016.get()); + } + + + /** + * 列表 + * + * @return ignore + */ + @Operation(summary = "获取个性签名列表") + @GetMapping("/SignImg") + public ActionResult getListSignImg() { + List list = signService.getList(); + List data = JsonUtil.getJsonToList(list, SignListVO.class); + return ActionResult.success(data); + } + + + /** + * 新建 + * + * @param signForm 实体对象 + * @return ignore + */ + @Operation(summary = "添加个性签名") + @Parameter(name = "signForm", description = "实体对象", required = true) + @PostMapping("/SignImg") + public ActionResult create(@RequestBody @Valid SignForm signForm) { + SignEntity entity = JsonUtil.getJsonToBean(signForm, SignEntity.class); + boolean b = signService.create(entity); + if (b) { + return ActionResult.success(MsgCode.SU001.get()); + } + return ActionResult.fail(MsgCode.SU001.get()); + } + + /** + * 删除 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "删除个性签名") + @Parameter(name = "id", description = "主键值", required = true) + @DeleteMapping("/{id}/SignImg") + public ActionResult delete(@PathVariable("id") String id) { + boolean delete = signService.delete(id); + if (delete) { + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.SU003.get()); + } + + /** + * 设置默认 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "设置默认") + @Parameter(name = "id", description = "主键值", required = true) + @PutMapping("/{id}/SignImg") + public ActionResult uptateDefault(@PathVariable("id") String id) { + boolean b = signService.updateDefault(id); + if (b) { + return ActionResult.success(MsgCode.SU004.get()); + } + return ActionResult.fail(MsgCode.SU004.get()); + } +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/pom.xml b/yunzhupaas-permission/yunzhupaas-permission-entity/pom.xml new file mode 100644 index 0000000..7fff08b --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/pom.xml @@ -0,0 +1,31 @@ + + + + yunzhupaas-permission + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-permission-entity + + + + com.yunzhupaas + yunzhupaas-common-all + ${project.version} + + + com.yunzhupaas + yunzhupaas-system-entity + ${project.version} + + + org.mybatis.dynamic-sql + mybatis-dynamic-sql + + + + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/constant/OrgColumnMap.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/constant/OrgColumnMap.java new file mode 100644 index 0000000..ec7d7dd --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/constant/OrgColumnMap.java @@ -0,0 +1,132 @@ +package com.yunzhupaas.permission.constant; + +import com.yunzhupaas.model.ExcelColumnAttr; +import org.apache.poi.ss.usermodel.IndexedColors; + +import java.util.*; + +public class OrgColumnMap { + + String excelName = "组织信息"; + /** + * 全部字段 + */ + private Map allKeyMap = new LinkedHashMap() {{ + put("parentId", "所属组织"); + put("fullName", "名称"); + put("enCode", "编码"); + }}; + /** + * 组织map + */ + private Map orgMap = new LinkedHashMap() {{ + put("category", "类型"); + put("parentId", "上级公司"); + put("fullName", "公司名称"); + put("enCode", "公司编码"); + put("shortName", "公司简称"); + put("enterpriseNature", "公司性质"); + put("industry", "所属行业"); + put("foundedTime", "成立时间"); + put("telePhone", "公司电话"); + put("fax", "公司传真"); + put("webSite", "公司主页"); + put("address", "公司地址"); + put("managerName", "公司法人"); + put("managerTelePhone", "联系电话"); + put("managerMobilePhone", "联系手机"); + put("manageEmail", "联系邮箱"); + put("bankName", "开户银行"); + put("bankAccount", "银行账户"); + put("businessscope", "经营范围"); + put("managerId", "部门主管"); + put("sortCode", "排序"); + put("description", "说明"); + }}; + /** + * 部门map + */ + private Map depMap = new LinkedHashMap() {{ + put("category", "类型"); + put("parentId", "所属组织"); + put("fullName", "部门名称"); + put("enCode", "部门编码"); + put("managerId", "部门主管"); + put("sortCode", "排序"); + put("description", "说明"); + }}; + + /** + * 根据类型获取excel表头字段 + * + * @param type + * @return + */ + public Map getColumnByType(Integer type) { + Map map = new LinkedHashMap(); + switch (type) { + case 2: + map = new LinkedHashMap(depMap); + break; + case 1: + map = new LinkedHashMap(orgMap); + map.remove("managerId"); + break; + default: + map = new LinkedHashMap(orgMap); + map.putAll(allKeyMap); + break; + } + return map; + } + + public String getExcelName() { + return excelName; + } + + + public List getFieldsModel(boolean isError, Integer type) { + List models = new ArrayList<>(); + //异常原因 + if (isError) { + ExcelColumnAttr attr = new ExcelColumnAttr().builder() + .key("errorsInfo") + .name("异常原因") + .build(); + models.add(attr); + } + List requirelist = Arrays.asList("category", "fullName", "enCode"); + // 遍历添加属性 + Map keyMap = getColumnByType(type); + + for (String key : keyMap.keySet()) { + ExcelColumnAttr attr = ExcelColumnAttr.builder() + .key(key) + .name(keyMap.get(key)) + .build(); + if (requirelist.contains(key)) { + attr.setRequire(true); + attr.setFontColor(IndexedColors.RED.getIndex()); + } + models.add(attr); + } + return models; + } + + /** + * 获取默认值 + */ + public List> getDefaultList() { + Map orgMapDemo = new HashMap<>(); + orgMapDemo.put("fullName", "公司名称/公司名称1"); + orgMapDemo.put("foundedTime", "yyy-MM-dd"); + Map depMapDemo = new HashMap<>(); + depMapDemo.put("fullName", "公司名称/公司名称1/部门名称"); + depMapDemo.put("managerId", "姓名/账号"); + List> list = new ArrayList<>(); + list.add(orgMapDemo); + list.add(depMapDemo); + return list; + } +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/constant/PosColumnMap.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/constant/PosColumnMap.java new file mode 100644 index 0000000..c722eeb --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/constant/PosColumnMap.java @@ -0,0 +1,78 @@ +package com.yunzhupaas.permission.constant; + +import com.yunzhupaas.model.ExcelColumnAttr; +import org.apache.poi.ss.usermodel.IndexedColors; + +import java.util.*; + +public class PosColumnMap { + + String excelName = "岗位信息"; + + Map keyMap = new LinkedHashMap() {{ + put("organizeId", "所属组织"); + put("fullName", "岗位名称"); + put("enCode", "岗位编码"); + put("type", "岗位类型"); + put("enabledMark", "状态"); + put("sortCode", "排序"); + put("description", "说明"); + }}; + + /** + * 表格名称 + * + * @return + */ + public String getExcelName() { + return excelName; + } + + /** + * 根据类型获取excel表头字段 + * + * @param type + * @return + */ + public Map getColumnByType(Integer type) { + return keyMap; + } + + /** + * 获取字段列表 + * + * @param isError + * @return + */ + public List getFieldsModel(boolean isError) { + List models = new ArrayList<>(); + //异常原因 + if (isError) { + ExcelColumnAttr attr = ExcelColumnAttr.builder().key("errorsInfo").name("异常原因").build(); + models.add(attr); + } + List requireFields = Arrays.asList("organizeId", "fullName", "enCode", "type", "enabledMark"); + for (String key : keyMap.keySet()) { + ExcelColumnAttr attr = ExcelColumnAttr.builder().key(key).name(keyMap.get(key)).build(); + if (requireFields.contains(key)) { + attr.setRequire(true); + attr.setFontColor(IndexedColors.RED.getIndex()); + } + models.add(attr); + } + return models; + } + + /** + * 获取默认值 + */ + public List> getDefaultList() { + List> list = new ArrayList<>(); + Map map = new HashMap<>(); + //所属组织 + map.put("organizeId", "公司名称/公司名称1/部门名称"); + list.add(map); + return list; + } +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/constant/RoleColumnMap.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/constant/RoleColumnMap.java new file mode 100644 index 0000000..4a31be3 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/constant/RoleColumnMap.java @@ -0,0 +1,78 @@ +package com.yunzhupaas.permission.constant; + +import com.yunzhupaas.model.ExcelColumnAttr; +import org.apache.poi.ss.usermodel.IndexedColors; + +import java.util.*; + +public class RoleColumnMap { + + String excelName = "角色信息"; + + Map keyMap = new LinkedHashMap() {{ + put("fullName", "角色名称"); + put("enCode", "角色编码"); + put("globalMark", "角色类型"); + put("organizeId", "所属组织"); + put("enabledMark", "状态"); + put("sortCode", "排序"); + put("description", "说明"); + }}; + + /** + * 表格名称 + * + * @return + */ + public String getExcelName() { + return excelName; + } + + /** + * 根据类型获取excel表头字段 + * + * @param type + * @return + */ + public Map getColumnByType(Integer type) { + return keyMap; + } + + /** + * 获取字段列表 + * + * @param isError + * @return + */ + public List getFieldsModel(boolean isError) { + List models = new ArrayList<>(); + //异常原因 + if (isError) { + ExcelColumnAttr attr = ExcelColumnAttr.builder().key("errorsInfo").name("异常原因").build(); + models.add(attr); + } + List requireFields = Arrays.asList("fullName", "enCode", "globalMark", "enabledMark"); + for (String key : keyMap.keySet()) { + ExcelColumnAttr attr = ExcelColumnAttr.builder().key(key).name(keyMap.get(key)).build(); + if (requireFields.contains(key)) { + attr.setRequire(true); + attr.setFontColor(IndexedColors.RED.getIndex()); + } + models.add(attr); + } + return models; + } + + /** + * 获取默认值 + */ + public List> getDefaultList() { + List> list = new ArrayList<>(); + Map map = new HashMap<>(); + map.put("organizeId", "公司名称/公司名称1/部门名称"); + list.add(map); + return list; + } + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/constant/UserColumnMap.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/constant/UserColumnMap.java new file mode 100644 index 0000000..f5c8a6a --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/constant/UserColumnMap.java @@ -0,0 +1,101 @@ +package com.yunzhupaas.permission.constant; + +import com.yunzhupaas.model.ExcelColumnAttr; +import org.apache.poi.ss.usermodel.IndexedColors; + +import java.util.*; + +public class UserColumnMap { + + String excelName = "用户信息"; + + Map keyMap = new LinkedHashMap() {{ + put("account", "账户"); + put("realName", "姓名"); + put("gender", "性别"); + put("email", "电子邮箱"); + put("organizeId", "所属组织"); + put("managerId", "直属主管"); + put("positionId", "岗位"); + put("ranks", "职级"); + put("roleId", "角色"); + put("nation", "民族"); + put("nativePlace", "籍贯"); + put("entryDate", "入职时间"); + put("certificatesType", "证件类型"); + put("certificatesNumber", "证件号码"); + put("education", "文化程度"); + put("birthday", "出生年月"); + put("telePhone", "办公电话"); + put("landline", "办公座机"); + put("mobilePhone", "手机号码"); + put("urgentContacts", "紧急联系"); + put("urgentTelePhone", "紧急电话"); + put("postalAddress", "通讯地址"); + + put("enabledMark", "状态"); + put("sortCode", "排序"); + put("description", "说明"); + }}; + + /** + * 表格名称 + * + * @return + */ + public String getExcelName() { + return excelName; + } + + /** + * 根据类型获取excel表头字段 + * + * @param type + * @return + */ + public Map getColumnByType(Integer type) { + return keyMap; + } + + /** + * 获取字段列表 + * + * @param isError + * @return + */ + public List getFieldsModel(boolean isError) { + List models = new ArrayList<>(); + //异常原因 + if (isError) { + ExcelColumnAttr attr = ExcelColumnAttr.builder().key("errorsInfo").name("异常原因").build(); + models.add(attr); + } + List requireFields = Arrays.asList("account", "realName", "gender", "organizeId", "enabledMark"); + for (String key : keyMap.keySet()) { + ExcelColumnAttr attr = ExcelColumnAttr.builder().key(key).name(keyMap.get(key)).build(); + if (requireFields.contains(key)) { + attr.setRequire(true); + attr.setFontColor(IndexedColors.RED.getIndex()); + } + models.add(attr); + } + return models; + } + + /** + * 获取默认值 + */ + public List> getDefaultList() { + List> list = new ArrayList<>(); + Map map = new HashMap<>(); + map.put("organizeId", "公司名称/公司名称1/部门名称,公司名称/公司名称1/部门名称1"); + map.put("managerId", "姓名/账号"); + map.put("positionId", "岗位名称/岗位编码,岗位名称1/岗位编码1"); + map.put("roleId", "角色名称/角色编码,角色名称1/角色编码1"); + map.put("entryDate", "yyyy-MM-dd"); + map.put("birthday", "yyyy-MM-dd"); + list.add(map); + return list; + } +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/AuthorizeEntity.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/AuthorizeEntity.java new file mode 100644 index 0000000..483d8dd --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/AuthorizeEntity.java @@ -0,0 +1,46 @@ +package com.yunzhupaas.permission.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * 操作权限 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright YUNZHUPAAS信息技AuthorizeController术有限公司 + * @date 2024-09-26 上午9:18 + */ +@Data +@TableName("base_authorize") +public class AuthorizeEntity extends SuperExtendEntity { + + /** + * 项目类型 + */ + @TableField("f_item_type") + private String itemType; + + /** + * 项目主键 + */ + @TableField("f_item_id") + private String itemId; + + /** + * 对象类型 + */ + @TableField("f_object_type") + private String objectType; + + /** + * 对象主键 + */ + @TableField("f_object_id") + private String objectId; + +} diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/ColumnsPurviewEntity.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/ColumnsPurviewEntity.java new file mode 100644 index 0000000..99ae438 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/ColumnsPurviewEntity.java @@ -0,0 +1,34 @@ +package com.yunzhupaas.permission.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * 模块列表权限 + * + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/3/15 9:20 + */ +@Data +@TableName("base_columns_purview") +public class ColumnsPurviewEntity extends SuperExtendEntity.SuperExtendEnabledEntity { + + /** + * 列表字段数组 + */ + @TableField("f_field_list") + private String fieldList; + /** + * 模块ID + */ + @TableField("f_module_id") + private String moduleId; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/GroupEntity.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/GroupEntity.java new file mode 100644 index 0000000..b11b131 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/GroupEntity.java @@ -0,0 +1,44 @@ +package com.yunzhupaas.permission.entity; + +import com.yunzhupaas.base.entity.SuperExtendEntity; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * 分组管理 + * + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/3/10 17:53 + */ +@Data +@TableName("base_group") +public class GroupEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 名称 + */ + @TableField("f_full_name") + private String fullName; + + /** + * 编码 + */ + @TableField("f_en_code") + private String enCode; + + /** + * 类型 + */ + @TableField("f_category") + private String type; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/OrganizeAdministratorEntity.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/OrganizeAdministratorEntity.java new file mode 100644 index 0000000..a6cdfa9 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/OrganizeAdministratorEntity.java @@ -0,0 +1,97 @@ +package com.yunzhupaas.permission.entity; + +import com.yunzhupaas.base.entity.SuperExtendEntity; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * + * 机构分级管理员 + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +@Data +@TableName("base_organize_administrator") +public class OrganizeAdministratorEntity extends SuperExtendEntity.SuperExtendDEEntity { + /** + * 用户主键 + */ + @TableField("F_USER_ID") + private String userId; + + /** + * 机构主键 + */ + @TableField("F_ORGANIZE_ID") + private String organizeId; + + /** + * 机构类型 + */ + @TableField("F_ORGANIZE_TYPE") + private String organizeType; + + /** + * 本层添加 + */ + @TableField("F_THIS_LAYER_ADD") + private Integer thisLayerAdd; + + /** + * 本层编辑 + */ + @TableField("F_THIS_LAYER_EDIT") + private Integer thisLayerEdit; + + /** + * 本层删除 + */ + @TableField("F_THIS_LAYER_DELETE") + private Integer thisLayerDelete; + + /** + * 子层添加 + */ + @TableField("F_SUB_LAYER_ADD") + private Integer subLayerAdd; + + /** + * 子层编辑 + */ + @TableField("F_SUB_LAYER_EDIT") + private Integer subLayerEdit; + + /** + * 子层删除 + */ + @TableField("F_SUB_LAYER_DELETE") + private Integer subLayerDelete; + + /** + * 本层查看 + */ + @TableField("F_THIS_LAYER_SELECT") + private Integer thisLayerSelect; + + /** + * 子层查看 + */ + @TableField("F_SUB_LAYER_SELECT") + private Integer subLayerSelect; + + /** + * 管理组 + */ + @TableField("F_MANAGER_GROUP") + private String managerGroup; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/OrganizeEntity.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/OrganizeEntity.java new file mode 100644 index 0000000..ce0bc32 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/OrganizeEntity.java @@ -0,0 +1,61 @@ +package com.yunzhupaas.permission.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 组织机构 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +@Data +@TableName("base_organize") +public class OrganizeEntity extends PermissionEntityBase{ + /** + * 机构上级 + */ + @TableField("F_PARENT_ID") + private String parentId; + + /** + * 机构分类 + */ + @TableField("F_CATEGORY") + private String category; + + /** + * 机构编号 + */ + @TableField("F_EN_CODE") + private String enCode; + + /** + * 机构名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + + /** + * 机构主管 + */ + @TableField("F_MANAGER_ID") + private String managerId; + + /** + * 扩展属性 + */ + @TableField("F_PROPERTY_JSON") + private String propertyJson; + + /** + * 父级组织 + */ + @TableField("F_ORGANIZE_ID_TREE") + private String organizeIdTree; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/OrganizeRelationEntity.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/OrganizeRelationEntity.java new file mode 100644 index 0000000..4b90d84 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/OrganizeRelationEntity.java @@ -0,0 +1,47 @@ +package com.yunzhupaas.permission.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.util.Date; + + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +/** + *

+ * 组织关系 + *

+ * + * @author + * @since 2022-01-19 + */ +@Data +@TableName("base_organize_relation") +@Schema(description = "OrganizeRelation对象", name = "组织关系") +public class OrganizeRelationEntity extends SuperExtendEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 组织主键 + */ + @TableField("F_ORGANIZE_ID") + private String organizeId; + + /** + * 对象类型(角色:role) + */ + @TableField("F_OBJECT_TYPE") + private String objectType; + + /** + * 对象主键 + */ + @TableField("F_OBJECT_ID") + private String objectId; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/PermissionEntityBase.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/PermissionEntityBase.java new file mode 100644 index 0000000..9264308 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/PermissionEntityBase.java @@ -0,0 +1,42 @@ +package com.yunzhupaas.permission.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * 类功能 + * + * @author 云筑产品开发平台组 + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/1/27 + */ +@Data +public class PermissionEntityBase extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 名称 + */ + @TableField("f_full_name") + private String fullName; + + /** + * 编码 + */ + @TableField("f_en_code") + private String enCode; + + /** + * 扩展属性 + */ + @TableField("f_property_json") + private String propertyJson; + +} + + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/PermissionGroupEntity.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/PermissionGroupEntity.java new file mode 100644 index 0000000..7aa5c34 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/PermissionGroupEntity.java @@ -0,0 +1,37 @@ +package com.yunzhupaas.permission.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +@Data +@TableName("base_permission_group") +public class PermissionGroupEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 名称 + */ + @TableField("f_full_name") + private String fullName; + + /** + * 编码 + */ + @TableField("F_en_code") + private String enCode; + + /** + * 权限成员 + */ + @TableField("F_permission_member") + private String permissionMember; + + /** + * 权限类型 1.自定义 0.全部 + */ + @TableField("F_type") + private Integer type; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/PositionEntity.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/PositionEntity.java new file mode 100644 index 0000000..5cc737b --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/PositionEntity.java @@ -0,0 +1,36 @@ +package com.yunzhupaas.permission.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * 岗位信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +@Data +@TableName("base_position") +public class PositionEntity extends PermissionEntityBase{ + + /** + * 岗位类型 + */ + @TableField("F_TYPE") + private String type; + + /** + * 机构主键 + */ + @TableField("F_ORGANIZE_ID") + private String organizeId; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/RoleEntity.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/RoleEntity.java new file mode 100644 index 0000000..cf5f3f4 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/RoleEntity.java @@ -0,0 +1,40 @@ +package com.yunzhupaas.permission.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * 系统角色 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +@Data +@TableName("base_role") +public class RoleEntity extends PermissionEntityBase{ + + /** + * 角色类型 + */ + @TableField("F_TYPE") + private String type; + + + + /** + * 全局标识 + */ + @TableField("F_GLOBAL_MARK") + private Integer globalMark; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/SignEntity.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/SignEntity.java new file mode 100644 index 0000000..4bae094 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/SignEntity.java @@ -0,0 +1,35 @@ +package com.yunzhupaas.permission.entity; + +import com.yunzhupaas.base.entity.SuperEntity; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * 个人签名 + * + * @author 云筑产品开发平台组 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/28 + */ +@Data +@TableName("base_sign_img") +public class SignEntity extends SuperEntity { + + /** + * 签名图片 + */ + @TableField("F_SIGN_IMG") + private String signImg; + + /** + * 是否默认 + */ + @TableField("F_IS_DEFAULT") + private Integer isDefault; +} + + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/SocialsUserEntity.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/SocialsUserEntity.java new file mode 100644 index 0000000..684bbc3 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/SocialsUserEntity.java @@ -0,0 +1,47 @@ +package com.yunzhupaas.permission.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * 流程设计 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/7/14 9:28:32 + */ +@Data +@TableName("base_socials_users") +public class SocialsUserEntity extends SuperExtendEntity { + + /** + * 用户id + */ + @TableField("F_USER_ID") + private String userId; + + /** + * 第三方类型 + */ + @TableField("F_SOCIAL_TYPE") + private String socialType; + + /** + * 第三方账号id + */ + @TableField("F_SOCIAL_ID") + private String socialId; + + /** + * 第三方账号 + */ + @TableField("F_SOCIAL_NAME") + private String socialName; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/UserEntity.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/UserEntity.java new file mode 100644 index 0000000..ce7cf8d --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/UserEntity.java @@ -0,0 +1,346 @@ +package com.yunzhupaas.permission.entity; + +import com.yunzhupaas.base.entity.SuperExtendEntity; +import com.baomidou.mybatisplus.annotation.*; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * 用户信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +@Data +@TableName("base_user") +public class UserEntity extends SuperExtendEntity.SuperExtendDEEntity { + /** + * 账户 + */ + @TableField("F_ACCOUNT") + private String account; + + /** + * 姓名 + */ + @TableField("F_REAL_NAME") + private String realName; + + /** + * 快速查询 + */ + @TableField("F_QUICK_QUERY") + private String quickQuery; + + /** + * 呢称 + */ + @TableField("F_NICK_NAME") + private String nickName; + + /** + * 头像 + */ + @TableField("F_HEAD_ICON") + private String headIcon; + + /** + * 性别 + */ + @TableField("F_GENDER") + private String gender; + + /** + * 生日 + */ + @TableField("F_BIRTHDAY") + private Date birthday; + + /** + * 手机 + */ + @TableField("F_MOBILE_PHONE") + private String mobilePhone; + + /** + * 电话 + */ + @TableField("F_TELE_PHONE") + private String telePhone; + + /** + * 有效标志(0-禁用,1-启用) + */ + @TableField("F_ENABLED_MARK") + private Integer enabledMark; + + /** + * F_Landline + */ + @TableField("F_LANDLINE") + private String landline; + + /** + * 邮箱 + */ + @TableField("F_EMAIL") + private String email; + + /** + * 民族 + */ + @TableField("F_NATION") + private String nation; + + /** + * 籍贯 + */ + @TableField("F_NATIVE_PLACE") + private String nativePlace; + + /** + * 入职日期 + */ + @TableField(value = "F_ENTRY_DATE") + private Date entryDate; + + /** + * 证件类型 + */ + @TableField("F_CERTIFICATES_TYPE") + private String certificatesType; + + /** + * 证件号码 + */ + @TableField("F_CERTIFICATES_NUMBER") + private String certificatesNumber; + + /** + * 文化程度 + */ + @TableField("F_EDUCATION") + private String education; + + /** + * F_UrgentContacts + */ + @TableField("F_URGENT_CONTACTS") + private String urgentContacts; + + /** + * 紧急电话 + */ + @TableField("F_URGENT_TELE_PHONE") + private String urgentTelePhone; + + /** + * 通讯地址 + */ + @TableField("F_POSTAL_ADDRESS") + private String postalAddress; + + /** + * 自我介绍 + */ + @TableField("F_SIGNATURE") + private String signature; + + /** + * 密码 + */ + @TableField("F_PASSWORD") + private String password; + + /** + * 秘钥 + */ + @TableField("F_SECRETKEY") + private String secretkey; + + /** + * 创建时间 + */ + @TableField("F_CREATOR_TIME") + private Date creatorTime; + + /** + * 首次登录时间 + */ + @TableField("F_FIRST_LOG_TIME") + private Date firstLogTime; + + /** + * 首次登录IP + */ + @TableField("F_FIRST_LOG_IP") + private String firstLogIp; + + /** + * 前次登录时间 + */ + @TableField("F_PREV_LOG_TIME") + private Date prevLogTime; + + /** + * 前次登录IP + */ + @TableField("F_PREV_LOG_IP") + private String prevLogIp; + + /** + * 最后登录时间 + */ + @TableField("F_LAST_LOG_TIME") + private Date lastLogTime; + + /** + * 最后登录IP + */ + @TableField("F_LAST_LOG_IP") + private String lastLogIp; + + /** + * 登录成功次数 + */ + @TableField("F_LOG_SUCCESS_COUNT") + private Integer logSuccessCount; + + /** + * 登录错误次数 + */ + @TableField("F_LOG_ERROR_COUNT") + private Integer logErrorCount; + + /** + * 最后修改密码时间 + */ + @TableField("F_CHANGE_PASSWORD_DATE") + private Date changePasswordDate; + + /** + * 系统语言 + */ + @TableField("F_LANGUAGE") + private String language; + + /** + * 系统样式 + */ + @TableField("F_THEME") + private String theme; + + /** + * 常用菜单 + */ + @TableField("F_COMMON_MENU") + private String commonMenu; + + /** + * 是否管理员 + */ + @TableField("F_IS_ADMINISTRATOR") + private Integer isAdministrator; + + /** + * 扩展属性 + */ + @TableField("F_PROPERTY_JSON") + private String propertyJson; + + /** + * 主管主键 + */ + @TableField("F_MANAGER_ID") + private String managerId; + + /** + * 组织主键 + */ + @TableField("F_ORGANIZE_ID") + private String organizeId; + + /** + * 岗位主键 + */ + @TableField("F_POSITION_ID") + private String positionId; + + /** + * 角色主键 + */ + @TableField("F_ROLE_ID") + private String roleId; + + /** + * 门户主键 + */ + @TableField("F_PORTAL_ID") + private String portalId; + + /** + * 是否锁定 + */ + @TableField("F_LOCK_MARK") + private Integer lockMark; + + /** + * 解锁时间 + */ + @TableField(value = "F_UNLOCK_TIME",updateStrategy = FieldStrategy.IGNORED) + private Date unlockTime; + + /** + * 分组id + */ + @TableField("F_GROUP_ID") + private String groupId; + + /** + * 系统id + */ + @TableField("F_SYSTEM_ID") + private String systemId; + + /** + * App系统id + */ + @TableField("F_APP_SYSTEM_ID") + private String appSystemId; + + /** + * 钉钉工号 + */ + @TableField("F_DING_JOB_NUMBER") + private String dingJobNumber; + + /** + * 交接状态 + */ + @TableField("f_handover_mark") + private Integer handoverMark; + + /** + * 职级 + */ + @TableField("f_rank") + private String ranks; + + /** + * 身份 + */ + @TableField("F_STANDING") + private Integer standing; + + /** + * 身份 + */ + @TableField("F_APP_STANDING") + private Integer appStanding; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/UserOldPasswordEntity.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/UserOldPasswordEntity.java new file mode 100644 index 0000000..9a2b06e --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/UserOldPasswordEntity.java @@ -0,0 +1,48 @@ +package com.yunzhupaas.permission.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * 用户信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +@Data +@TableName(value = "base_user_old_password") +public class UserOldPasswordEntity extends SuperExtendEntity { + + /** + * userid + */ + @TableField("F_USER_ID") + private String userId; + + /** + * 账户 + */ + @TableField("F_ACCOUNT") + private String account; + + /** + * 旧密码 + */ + @TableField("F_OLD_PASSWORD") + private String oldPassword; + + /** + * 秘钥 + */ + @TableField("F_SECRETKEY") + private String secretkey; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/UserRelationEntity.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/UserRelationEntity.java new file mode 100644 index 0000000..6047116 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/entity/UserRelationEntity.java @@ -0,0 +1,41 @@ +package com.yunzhupaas.permission.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * 用户关系 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +@Data +@TableName("base_user_relation") +public class UserRelationEntity extends SuperExtendEntity { + + /** + * 用户主键 + */ + @TableField("F_USER_ID") + private String userId; + + /** + * 对象类型 + */ + @TableField("F_OBJECT_TYPE") + private String objectType; + + /** + * 对象主键 + */ + @TableField("F_OBJECT_ID") + private String objectId; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/AuthorizeConditionEnum.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/AuthorizeConditionEnum.java new file mode 100644 index 0000000..28e8c31 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/AuthorizeConditionEnum.java @@ -0,0 +1,103 @@ +package com.yunzhupaas.permission.model.authorize; + +import com.yunzhupaas.constant.DataInterfaceVarConst; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; + +/** + * 数据权限过滤条件字段 + * + * @author 云筑产品开发平台组 + * @version V3.2 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/10/9 + */ +public enum AuthorizeConditionEnum { + /** + * 表单主键 + */ + FORMID(DataInterfaceVarConst.FORM_ID, "表单主键"), + /** + * 当前用户 + */ + USER(DataInterfaceVarConst.USER, "当前用户"), + /** + * 当前用户及下属 + */ + USERANDUNDER(DataInterfaceVarConst.USERANDSUB, "当前用户及下属"), + /** + * 当前组织 + */ + ORGANIZE(DataInterfaceVarConst.ORG, "当前组织"), + /** + * 当前组织及子组织 + */ + ORGANIZEANDUNDER(DataInterfaceVarConst.ORGANDSUB, "当前组织及子组织"), + /** + * 当前分管组织 + */ + BRANCHMANAGEORG(DataInterfaceVarConst.CHARORG, "当前分管组织"), + /** + * 当前岗位 + */ + POSITIONID(DataInterfaceVarConst.POSITIONID, "当前岗位"), + /** + * 当前部门 + */ + DEPID(DataInterfaceVarConst.DEPID, "当前部门"), + /** + * 当前部门及下级部门 + */ + DEPANDSUBORDINATES(DataInterfaceVarConst.DEPANDSUBORDINATES, "当前部门及下级部门"), + /** + * 当前时间 + */ + CURRENTTIME(DataInterfaceVarConst.CURRENTTIME, "当前时间"), + /** + * 任意文本 + */ + TEXT(YunzhupaasKeyConsts.COM_INPUT, "任意文本"), + DATATIME(YunzhupaasKeyConsts.DATE, "日期选择"), + INPUTNUMBER(YunzhupaasKeyConsts.NUM_INPUT, "数字输入"), + COMSELECT(YunzhupaasKeyConsts.COMSELECT, "组织选择"), + DEPSELECT(YunzhupaasKeyConsts.DEPSELECT, "部门选择"), + POSSELECT(YunzhupaasKeyConsts.POSSELECT, "岗位选择"), + ROLESELECT(YunzhupaasKeyConsts.ROLESELECT, "角色选择"), + GROUPSELECT(YunzhupaasKeyConsts.GROUPSELECT, "分组选择"), + USERSELECT(YunzhupaasKeyConsts.USERSELECT, "用户选择"), + + ; + + private String condition; + private String message; + + AuthorizeConditionEnum(String condition, String message) { + this.condition = condition; + this.message = message; + } + + public String getCondition() { + return condition; + } + + public void setCondition(String condition) { + this.condition = condition; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public static AuthorizeConditionEnum getByMessage(String condition) { + for (AuthorizeConditionEnum status : AuthorizeConditionEnum.values()) { + if (status.getCondition().equals(condition)) { + return status; + } + } + return null; + } + +} diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/AuthorizeConditionModel.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/AuthorizeConditionModel.java new file mode 100644 index 0000000..ab473fb --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/AuthorizeConditionModel.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.permission.model.authorize; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class AuthorizeConditionModel{ + private QueryWrapper obj; + private String moduleId; + private String tableName; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/AuthorizeDataModel.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/AuthorizeDataModel.java new file mode 100644 index 0000000..3230684 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/AuthorizeDataModel.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.permission.model.authorize; + +import com.yunzhupaas.util.treeutil.SumTree; +import lombok.Data; + +import java.util.Date; + +/** + * 数据权限 + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:04 + */ +@Data +public class AuthorizeDataModel extends SumTree { + private String id; + private String fullName; + private String icon; + private Boolean showcheck; + private Integer checkstate; + private String title; + private String moduleId; + private String type; + private Date creatorTime; + private String category; + private boolean disabled; + private Long sortCode=9999L; + private String systemId; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/AuthorizeDataReturnModel.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/AuthorizeDataReturnModel.java new file mode 100644 index 0000000..6d253f9 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/AuthorizeDataReturnModel.java @@ -0,0 +1,28 @@ +package com.yunzhupaas.permission.model.authorize; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Data; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:26 + */ +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +public class AuthorizeDataReturnModel { + private String id; + private String fullName; + private String icon; + private String type; + private Long sortCode=999L; + private String category; + private boolean disabled; + private Long creatorTime; + private List children; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/AuthorizeDataReturnVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/AuthorizeDataReturnVO.java new file mode 100644 index 0000000..15fcc0f --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/AuthorizeDataReturnVO.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.permission.model.authorize; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:27 + */ +@Data +public class AuthorizeDataReturnVO { + @Schema(description = "权限模型集合") + List list; + @Schema(description = "id集合") + List ids; + //all字段里面不包括菜单id + @Schema(description = "所有的id") + List all; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/AuthorizeDataUpForm.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/AuthorizeDataUpForm.java new file mode 100644 index 0000000..536ac22 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/AuthorizeDataUpForm.java @@ -0,0 +1,34 @@ +package com.yunzhupaas.permission.model.authorize; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:27 + */ +@Data +public class AuthorizeDataUpForm { + @Schema(description = "对象类型") + private String objectType; + + @Schema(description = "按钮id") + private String[] button; + @Schema(description = "列表id") + private String[] column; + @Schema(description = "菜单id") + private String[] module; + @Schema(description = "数据权限方案id") + private String[] resource; + @Schema(description = "表单id") + private String[] form; + + + @Schema(description = "系统id") + private String[] systemIds; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/AuthorizeDataVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/AuthorizeDataVO.java new file mode 100644 index 0000000..18902f1 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/AuthorizeDataVO.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.permission.model.authorize; + +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:27 + */ +@Data +public class AuthorizeDataVO { + private AuthorizeDataReturnVO module; + private AuthorizeDataReturnVO button; + private AuthorizeDataReturnVO column; + private AuthorizeDataReturnVO resource; + private AuthorizeDataReturnVO form; + private AuthorizeDataReturnVO system; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/AuthorizeDataValuesVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/AuthorizeDataValuesVO.java new file mode 100644 index 0000000..03a73d0 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/AuthorizeDataValuesVO.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.permission.model.authorize; + +import lombok.Data; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:27 + */ +@Data +public class AuthorizeDataValuesVO { + List list; + List ids; + List all; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/AuthorizeItemObjIdsVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/AuthorizeItemObjIdsVO.java new file mode 100644 index 0000000..65ddd2d --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/AuthorizeItemObjIdsVO.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.permission.model.authorize; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:27 + */ +@Data +public class AuthorizeItemObjIdsVO { + @Schema(description = "id集合") + private List ids; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/AuthorizeModel.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/AuthorizeModel.java new file mode 100644 index 0000000..663d925 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/AuthorizeModel.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.permission.model.authorize; + +import com.yunzhupaas.util.treeutil.SumTree; +import lombok.Data; + +import java.util.Date; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:27 + */ +@Data +public class AuthorizeModel extends SumTree { + private String id; + private String fullName; + private String icon; + + private Date creatorTime; + private long sortCode; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/AuthorizeVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/AuthorizeVO.java new file mode 100644 index 0000000..25a7d51 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/AuthorizeVO.java @@ -0,0 +1,69 @@ +package com.yunzhupaas.permission.model.authorize; + +import com.yunzhupaas.base.model.base.SystemBaeModel; +import com.yunzhupaas.base.model.button.ButtonModel; +import com.yunzhupaas.base.model.column.ColumnModel; +import com.yunzhupaas.base.model.form.ModuleFormModel; +import com.yunzhupaas.base.model.module.ModuleModel; +import com.yunzhupaas.base.model.resource.ResourceModel; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:29 + */ +@Data +public class AuthorizeVO { + // 菜单 +// private List menuList; + + /** + * 功能 + */ + private List moduleList = new ArrayList<>(); + + /** + * 按钮 + */ + private List buttonList = new ArrayList<>(); + + /** + * 视图 + */ + private List columnList = new ArrayList<>(); + + /** + * 资源 + */ + private List resourceList = new ArrayList<>(); + + /** + * 表单 + */ + private List formsList = new ArrayList<>(); + + /** + * 系统 + */ + private List systemList = new ArrayList<>(); + + public AuthorizeVO(List moduleList, List buttonList, List columnList, List resourceList, List formsList, List systemList) { +// this.menuList = menuList; + this.moduleList = moduleList; + this.buttonList = buttonList; + this.columnList = columnList; + this.resourceList = resourceList; + this.formsList = formsList; + this.systemList = systemList; + } + + public AuthorizeVO() { + } +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/ConditionModel.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/ConditionModel.java new file mode 100644 index 0000000..cb19469 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/ConditionModel.java @@ -0,0 +1,35 @@ +package com.yunzhupaas.permission.model.authorize; + +import lombok.Data; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class ConditionModel { + private String logic; + private List groups; + + /** + * 数据权限条件字段 + */ + @Data + public class ConditionItemModel{ + private String id; + private String field; + private String type; + private String op; + private String value; + private String fieldRule; + private String bindTable; + private String conditionText; + private String childTableKey; + } +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/DataValuesQuery.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/DataValuesQuery.java new file mode 100644 index 0000000..4a0f787 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/DataValuesQuery.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.permission.model.authorize; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class DataValuesQuery { + + @Schema(description = "类型") + private String type; + @Schema(description = "菜单id集合") + private String moduleIds; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/OnlineDynamicSqlModel.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/OnlineDynamicSqlModel.java new file mode 100644 index 0000000..4528fbb --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/OnlineDynamicSqlModel.java @@ -0,0 +1,46 @@ +package com.yunzhupaas.permission.model.authorize; + +import lombok.Data; +import org.mybatis.dynamic.sql.BasicColumn; +import org.mybatis.dynamic.sql.SqlColumn; +import org.mybatis.dynamic.sql.SqlTable; + +import java.util.List; +import java.util.Map; + +/** + * + * dynamicSql模型 + * @author 云筑产品开发平台组 + * @version V3.4.4 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2022/9/27 + */ +@Data +public class OnlineDynamicSqlModel { + private List columns; + private SqlTable sqlTable; + private String tableName; + private boolean isMain; + private String foreign; + private String relationKey; + + public OnlineDynamicSqlModel(){ + + } + + public OnlineDynamicSqlModel(SqlTable sqlTable, List sqlColumns) { + this.sqlTable = sqlTable; + this.columns = sqlColumns; + this.isMain = true; + } + + public OnlineDynamicSqlModel(SqlTable sqlTable, List sqlColumns,String foreign,String relationKey, boolean b) { + this.sqlTable = sqlTable; + this.columns = sqlColumns; + this.foreign = foreign; + this.relationKey = relationKey; + this.isMain = b; + } +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/ResourceVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/ResourceVO.java new file mode 100644 index 0000000..0b8b55b --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/ResourceVO.java @@ -0,0 +1,28 @@ +package com.yunzhupaas.permission.model.authorize; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class ResourceVO { + @Schema(description = "资源主键") + private String id; + @Schema(description = "资源名称") + private String fullName; + @Schema(description = "资源编码") + private String enCode; + @Schema(description = "条件规则") + private String conditionJson; + @Schema(description = "规则描述") + private String conditionText; + @Schema(description = "功能主键") + private String moduleId; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/SaveBatchForm.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/SaveBatchForm.java new file mode 100644 index 0000000..5d815cf --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/authorize/SaveBatchForm.java @@ -0,0 +1,35 @@ +package com.yunzhupaas.permission.model.authorize; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class SaveBatchForm { + @Schema(description = "角色id集合") + private String[] roleIds; + @Schema(description = "岗位id集合") + private String[] positionIds; + @Schema(description = "用户id集合") + private String[] userIds; + @Schema(description = "菜单id集合") + private String[] module; + @Schema(description = "按钮id集合") + private String[] button; + @Schema(description = "列表id集合") + private String[] column; + @Schema(description = "数据权限方案id集合") + private String[] resource; + @Schema(description = "表单id集合") + private String[] form; + + @Schema(description = "系统id集合") + private String[] systemIds; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/check/CheckResult.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/check/CheckResult.java new file mode 100644 index 0000000..431c25c --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/check/CheckResult.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.permission.model.check; + +import lombok.Data; + +@Data +public class CheckResult { + + private boolean pass = true; + + private String errorMsg; + + private Object value; + + public CheckResult(boolean pass, String errorMsg, Object value) { + this.pass = pass; + this.errorMsg = errorMsg; + this.value = value; + } + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/columnspurview/ColumnsPurviewUpForm.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/columnspurview/ColumnsPurviewUpForm.java new file mode 100644 index 0000000..f4e953c --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/columnspurview/ColumnsPurviewUpForm.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.permission.model.columnspurview; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import jakarta.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 列表权限修改模型 + * + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/3/15 9:59 + */ +@Data +public class ColumnsPurviewUpForm implements Serializable { + @Schema(description = "列表字段数组") + private String fieldList; + @Schema(description = "模块ID") + @NotBlank(message = "操作模块不能为空") + private String moduleId; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeByAuthModel.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeByAuthModel.java new file mode 100644 index 0000000..6d613c9 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeByAuthModel.java @@ -0,0 +1,14 @@ +package com.yunzhupaas.permission.model.organize; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +@Data +public class OrganizeByAuthModel extends OrganizeModel { + + @Schema(description = "是否可选") + private Boolean disabled = false; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeConditionModel.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeConditionModel.java new file mode 100644 index 0000000..2dc8429 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeConditionModel.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.permission.model.organize; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Page; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/6/8 14:05 + */ +@Data +public class OrganizeConditionModel extends Page implements Serializable { + + @Schema(description = "部门id集合") + private List departIds; + + private Map orgIdNameMaps; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeCrForm.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeCrForm.java new file mode 100644 index 0000000..a6b9890 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeCrForm.java @@ -0,0 +1,33 @@ +package com.yunzhupaas.permission.model.organize; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class OrganizeCrForm { + + @NotBlank(message = "公司上级不能为空") + private String parentId; + @NotBlank(message = "公司名称不能为空") + private String fullName; + @NotBlank(message = "公司编码不能为空") + private String enCode; + private String description; + @NotNull(message = "公司状态不能为空") + private Integer enabledMark; + private OrganizeCrModel propertyJson; + @Schema(description = "排序") + private Long sortCode; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeCrModel.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeCrModel.java new file mode 100644 index 0000000..95a9e85 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeCrModel.java @@ -0,0 +1,39 @@ +package com.yunzhupaas.permission.model.organize; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import jakarta.validation.constraints.NotBlank; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class OrganizeCrModel { + @NotBlank(message = "必填") + @Schema(description = "公司简称") + private String shortName; + private String webSite; + @NotBlank(message = "必填") + @Schema(description = "所属行业") + private String industry; + private Long foundedTime; + private String address; + private String managerName; + private String managerTelePhone; + private String managerMobilePhone; + private String manageEmail; + private String bankName; + private String bankAccount; + private String businessscope; + @NotBlank(message = "必填") + @Schema(description = "公司性质") + private String enterpriseNature; + private String fax; + private String telePhone; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeDepartCrForm.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeDepartCrForm.java new file mode 100644 index 0000000..7c858e7 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeDepartCrForm.java @@ -0,0 +1,34 @@ +package com.yunzhupaas.permission.model.organize; + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import jakarta.validation.constraints.NotBlank; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class OrganizeDepartCrForm { + + private String managerId; + @NotBlank(message = "必填") + @Schema(description = "上级ID") + private String parentId; + @NotBlank(message = "必填") + @Schema(description = "部门名称") + private String fullName; + @NotBlank(message = "必填") + @Schema(description = "部门编码") + private String enCode; + @Schema(description = "状态") + private int enabledMark; + private String description; + @Schema(description = "排序") + private Long sortCode; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeDepartInfoVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeDepartInfoVO.java new file mode 100644 index 0000000..4209fa8 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeDepartInfoVO.java @@ -0,0 +1,38 @@ +package com.yunzhupaas.permission.model.organize; + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class OrganizeDepartInfoVO { + @Schema(description = "主键") + private String id; + @Schema(description = "父主键") + private String parentId; + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "状态") + private Integer enabledMark; + @Schema(description = "备注") + private String description; + @Schema(description = "主管id") + private String managerId; + @Schema(description = "排序码") + private Long sortCode; + + @Schema(description = "组织id树") + private List organizeIdTree; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeDepartListVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeDepartListVO.java new file mode 100644 index 0000000..00f9509 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeDepartListVO.java @@ -0,0 +1,40 @@ +package com.yunzhupaas.permission.model.organize; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class OrganizeDepartListVO { + @Schema(description = "主键") + private String id; + @Schema(description = "父主键") + private String parentId; + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "备注") + private String description; + @Schema(description = "创建时间") + private Long creatorTime; + @Schema(description = "部门经理") + private String manager; + @Schema(description = "状态") + private Integer enabledMark; + @Schema(description = "是否有下级菜单") + private Boolean hasChildren; + @Schema(description = "下级菜单列表") + private List children; + @Schema(description = "排序") + private Long sortCode; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeDepartSelectorByAuthListVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeDepartSelectorByAuthListVO.java new file mode 100644 index 0000000..d129edd --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeDepartSelectorByAuthListVO.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.permission.model.organize; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/6/28 9:35 + */ +@Data +public class OrganizeDepartSelectorByAuthListVO extends OrganizeDepartSelectorListVO implements Serializable { + + @Schema(description = "是否可选") + private Boolean disabled = false; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeDepartSelectorListVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeDepartSelectorListVO.java new file mode 100644 index 0000000..014644a --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeDepartSelectorListVO.java @@ -0,0 +1,39 @@ +package com.yunzhupaas.permission.model.organize; + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:17 + */ +@Data +public class OrganizeDepartSelectorListVO { + @Schema(description = "主键") + private String id; + @Schema(description = "父主键") + private String parentId; + @Schema(description = "名称") + private String fullName; + @Schema(description = "图标") + private String icon; + @Schema(description = "是否有下级菜单") + private Boolean hasChildren = true; + @Schema(description = "状态") + private Integer enabledMark; + @Schema(description = "下级菜单列表") + private List children; + @JSONField(name="category") + private String type; + private String organize; + + @Schema(description = "组织id树") + private List organizeIds; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeDepartUpForm.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeDepartUpForm.java new file mode 100644 index 0000000..b8dcea4 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeDepartUpForm.java @@ -0,0 +1,15 @@ +package com.yunzhupaas.permission.model.organize; + +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class OrganizeDepartUpForm extends OrganizeDepartCrForm { +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeInfoVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeInfoVO.java new file mode 100644 index 0000000..86c4238 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeInfoVO.java @@ -0,0 +1,38 @@ +package com.yunzhupaas.permission.model.organize; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.permission.model.permission.PermissionVoBase; +import lombok.Data; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class OrganizeInfoVO extends PermissionVoBase { + @Schema(description = "主键") + private String id; + @Schema(description = "父主键") + private String parentId; + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "状态") + private Integer enabledMark; + @Schema(description = "备注") + private String description; + @Schema(description = "扩展属性") + private String propertyJson; + @Schema(description = "排序") + private Long sortCode; + + @Schema(description = "组织id树") + private List organizeIdTree; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeListVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeListVO.java new file mode 100644 index 0000000..a072f5d --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeListVO.java @@ -0,0 +1,54 @@ +package com.yunzhupaas.permission.model.organize; + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:15 + */ +@Data +public class OrganizeListVO { + @Schema(description = "主键") + private String id; + @Schema(description = "父主键") + private String parentId; + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "备注") + private String description; + @Schema(description = "状态") + private Integer enabledMark; + private Long creatorTime; + @Schema(description = "是否有下级菜单") + private Boolean hasChildren; + @Schema(description = "下级菜单列表") + private List children; + @Schema(description = "排序") + private Long sortCode; + private String organizeIdTree; + @Schema(description = "") + private Boolean isLeaf; + @JSONField(name="category") + private String type; + + @Schema(description = "图标") + private String icon; + + @Schema(description = "修改用户") + private String lastFullName; + + private String organize; + + @Schema(description ="组织id树") + private List organizeIds; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeModel.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeModel.java new file mode 100644 index 0000000..d881b54 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeModel.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.permission.model.organize; + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.util.treeutil.SumTree; +import lombok.Data; + +import java.util.List; + + +@Data +public class OrganizeModel extends SumTree { + private String fullName; + private String enCode; + private Long creatorTime; + private String manager; + private String description; + private int enabledMark; + private String icon; + @JSONField(name="category") + private String type; + private long sortCode; + private String organizeIdTree; + private String organize; + + @Schema(description = "组织id树") + private List organizeIds; + + private String lastFullName; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeSelectorByAuthVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeSelectorByAuthVO.java new file mode 100644 index 0000000..e5a3072 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeSelectorByAuthVO.java @@ -0,0 +1,44 @@ +package com.yunzhupaas.permission.model.organize; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 组织树模型 + * + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/6/28 9:10 + */ +@Data +public class OrganizeSelectorByAuthVO implements Serializable { + + @Schema(description = "是否可选") + private Boolean disabled = false; + @Schema(description = "主键") + private String id; + @Schema(description = "父主键") + private String parentId; + @Schema(description = "名称") + private String fullName; + @Schema(description = "图标") + private String icon; + @Schema(description = "是否可用") + private Integer enabledMark; + @Schema(description = "是否有下级菜单") + private Boolean hasChildren; + @Schema(description = "下级菜单列表") + private List children; + private String organizeIdTree; + + private String organize; + + @Schema(description = "组织id树") + private List organizeIds; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeSelectorVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeSelectorVO.java new file mode 100644 index 0000000..e28e26b --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeSelectorVO.java @@ -0,0 +1,57 @@ +package com.yunzhupaas.permission.model.organize; + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class OrganizeSelectorVO { + @Schema(description = "主键") + private String id; + @Schema(description = "父主键") + private String parentId; + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "备注") + private String description; + @Schema(description = "图标") + private String icon; + @Schema(description = "是否可用") + private Integer enabledMark; + @Schema(description = "是否有下级菜单") + private Boolean hasChildren; + @Schema(description = "下级菜单列表") + private List children; + @Schema(description = "") + private Boolean isLeaf; + @JSONField(name="category") + private String type; + + private Long creatorTime; + @Schema(description = "排序") + private Long sortCode; + @Schema(description = "组织id树名称") + private String organizeIdTree; + + @Schema(description = "修改用户") + private String lastFullName; + + @Schema(description = "组织id") + private String organize; + + @Schema(description = "组织id树") + private List organizeIds; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeTreeVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeTreeVO.java new file mode 100644 index 0000000..ffe0cd1 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeTreeVO.java @@ -0,0 +1,30 @@ +package com.yunzhupaas.permission.model.organize; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class OrganizeTreeVO { + @Schema(description = "主键") + private String id; + @Schema(description = "父主键") + private String parentId; + @Schema(description = "名称") + private String fullName; + @Schema(description = "图标") + private String icon; + @Schema(description = "是否有下级菜单") + private Boolean hasChildren; + @Schema(description = "下级菜单列表") + private List children; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeUpForm.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeUpForm.java new file mode 100644 index 0000000..1100bcd --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/OrganizeUpForm.java @@ -0,0 +1,15 @@ +package com.yunzhupaas.permission.model.organize; + +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class OrganizeUpForm extends OrganizeCrForm { +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/PaginationOrganize.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/PaginationOrganize.java new file mode 100644 index 0000000..2c41107 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organize/PaginationOrganize.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.permission.model.organize; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import lombok.Data; + +@Data +public class PaginationOrganize extends Pagination { + + @Schema(description = "状态") + private Integer enabledMark; + + private String type; + + /** 查询key */ + private String[] selectKey; + /** 功能id */ + private String moduleId; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organizeadministrator/ModuleSelectorModel.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organizeadministrator/ModuleSelectorModel.java new file mode 100644 index 0000000..510b66c --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organizeadministrator/ModuleSelectorModel.java @@ -0,0 +1,41 @@ +package com.yunzhupaas.permission.model.organizeadministrator; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.util.treeutil.SumTree; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class ModuleSelectorModel extends SumTree implements Serializable { + private String id; + private String fullName; + private String enCode; + private String parentId; + private String icon; + private Integer type; + private Long sortCode; + private String category; + private String propertyJson; + + private String systemId; + private Boolean hasModule; + + @Schema(description = "是否有权限") + private Integer isPermission; + + private boolean disabled; + + private long creatorTime; + +// private String description; +// private Boolean isData; +// private Integer enabledMark; +// private String urlAddress; +// private String linkTarget; +// private Integer isButtonAuthorize; +// private Integer isColumnAuthorize; +// private Integer isDataAuthorize; +// private Integer isFormAuthorize; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organizeadministrator/ModuleSelectorVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organizeadministrator/ModuleSelectorVO.java new file mode 100644 index 0000000..32fc906 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organizeadministrator/ModuleSelectorVO.java @@ -0,0 +1,35 @@ +package com.yunzhupaas.permission.model.organizeadministrator; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class ModuleSelectorVO implements Serializable { + + private String id; + private String fullName; + private String enCode; + private String parentId; + private String icon; + private Integer type; + private Long sortCode; + private String category; + private String propertyJson; + + private String systemId; + private Boolean hasModule; + + @Schema(description ="是否有下级菜单") + private Boolean hasChildren; + @Schema(description ="下级菜单列表") + private List children; + + @Schema(description = "是否有权限") + private Integer isPermission; + + private boolean disabled; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organizeadministrator/OrganizeAdminIsTratorCrForm.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organizeadministrator/OrganizeAdminIsTratorCrForm.java new file mode 100644 index 0000000..8382dac --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organizeadministrator/OrganizeAdminIsTratorCrForm.java @@ -0,0 +1,43 @@ +package com.yunzhupaas.permission.model.organizeadministrator; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import jakarta.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * 机构分级管理员 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +@Data +public class OrganizeAdminIsTratorCrForm implements Serializable { + + /** + * 用户主键 + **/ + @Schema(description = "用户主键") + @NotBlank(message = "管理员不能为空") + private String userId; + + /** + * 分级管理员模型集合 + */ + @Schema(description = "分级管理员模型集合") + private List orgAdminModel; + + + @Schema(description = "菜单集合") + private List moduleIds; + @Schema(description = "应用集合") + private List systemIds; + @Schema(description = "管理组") + private String managerGroup; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organizeadministrator/OrganizeAdministratorCrModel.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organizeadministrator/OrganizeAdministratorCrModel.java new file mode 100644 index 0000000..8a0736f --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organizeadministrator/OrganizeAdministratorCrModel.java @@ -0,0 +1,46 @@ +package com.yunzhupaas.permission.model.organizeadministrator; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/6/6 14:50 + */ +@Data +public class OrganizeAdministratorCrModel implements Serializable { + @Schema(description = "主键") + private String organizeId; + @Schema(description = "名称") + private String fullName; + @Schema(description = "图标") + private String icon; + @Schema(description = "") + private Boolean isLeaf; + @Schema(description = "是否有下级菜单") + private Boolean hasChildren; + private String parentId; + + private Integer thisLayerAdd = 0; + private Integer thisLayerEdit = 0; + private Integer thisLayerDelete = 0; + private Integer thisLayerSelect = 0; + private Integer subLayerAdd = 0; + private Integer subLayerEdit = 0; + private Integer subLayerDelete = 0; + private Integer subLayerSelect = 0; + private String organizeIdTree; + @JsonIgnore + private String category; + @Schema(description = "管理组") + private String managerGroup; + + private List children; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organizeadministrator/OrganizeAdministratorListVo.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organizeadministrator/OrganizeAdministratorListVo.java new file mode 100644 index 0000000..f2e3b6e --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organizeadministrator/OrganizeAdministratorListVo.java @@ -0,0 +1,36 @@ +package com.yunzhupaas.permission.model.organizeadministrator; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * 组织关系表模型 + * + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/5/30 9:23 + */ +@Data +public class OrganizeAdministratorListVo implements Serializable { + @Schema(description = "主键") + private String id; + @Schema(description = "账号") + private String account; + @Schema(description = "真实姓名") + private String realName; + @Schema(description = "性别") + private String gender; + @Schema(description = "手机号") + private String mobilePhone; + @Schema(description = "组织id") + private String organizeId; + @Schema(description = "创建时间") + private Long creatorTime; + @Schema(description = "管理组") + private String managerGroup; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organizeadministrator/OrganizeAdministratorModel.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organizeadministrator/OrganizeAdministratorModel.java new file mode 100644 index 0000000..e0bafa8 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organizeadministrator/OrganizeAdministratorModel.java @@ -0,0 +1,28 @@ +package com.yunzhupaas.permission.model.organizeadministrator; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.ArrayList; +import java.util.List; + +/** + * 组织管理模型 + * + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/5/30 17:42 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class OrganizeAdministratorModel { + + private List addList = new ArrayList<>(); + private List editList = new ArrayList<>(); + private List deleteList = new ArrayList<>(); + private List selectList = new ArrayList<>(); +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organizeadministrator/OrganizeAdministratorSelectedVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organizeadministrator/OrganizeAdministratorSelectedVO.java new file mode 100644 index 0000000..89afefa --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organizeadministrator/OrganizeAdministratorSelectedVO.java @@ -0,0 +1,32 @@ +package com.yunzhupaas.permission.model.organizeadministrator; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +@Data +public class OrganizeAdministratorSelectedVO implements Serializable { + + @Schema(description = "组织权限集合") + private List orgAdminList = new ArrayList<>(); + + @Schema(description = "应用权限集合") + private List systemPermissionList = new ArrayList<>(); + + @Schema(description = "菜单权限集合") + private List modulePermissionList = new ArrayList<>(); + + @Schema(description = "有菜单权限集合") + private List moduleIds = new ArrayList<>(); + + @Schema(description = "有应用权限集合") + private List systemIds = new ArrayList<>(); + + @Schema(description = "管理组") + private String managerGroup; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organizeadministrator/OrganizeAdministratorSelectorModel.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organizeadministrator/OrganizeAdministratorSelectorModel.java new file mode 100644 index 0000000..fe12fc5 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organizeadministrator/OrganizeAdministratorSelectorModel.java @@ -0,0 +1,43 @@ +package com.yunzhupaas.permission.model.organizeadministrator; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.util.treeutil.SumTree; +import lombok.Data; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/6/6 10:16 + */ +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +public class OrganizeAdministratorSelectorModel extends SumTree { + @Schema(description = "组织主键") + private String organizeId; + @Schema(description = "名称") + private String fullName; + @Schema(description = "图标") + private String icon; + /** + * 0 可编辑 + * 1 已勾选 + * 2 已勾选不可编辑 + */ + private Integer thisLayerAdd; + private Integer thisLayerEdit; + private Integer thisLayerDelete; + private Integer thisLayerSelect; + private Integer subLayerAdd; + private Integer subLayerEdit; + private Integer subLayerDelete; + private Integer subLayerSelect; + private String organizeIdTree; + @Schema(description = "") + private Boolean isLeaf; + @JsonIgnore + private String category; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organizeadministrator/OrganizeAdministratorSelectorVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organizeadministrator/OrganizeAdministratorSelectorVO.java new file mode 100644 index 0000000..83bf84b --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organizeadministrator/OrganizeAdministratorSelectorVO.java @@ -0,0 +1,48 @@ +package com.yunzhupaas.permission.model.organizeadministrator; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +public class OrganizeAdministratorSelectorVO implements Serializable { + @Schema(description = "主键") + private String organizeId; + @Schema(description = "名称") + private String fullName; + @Schema(description = "图标") + private String icon; + @Schema(description = "") + private Boolean isLeaf; + @Schema(description = "是否有下级菜单") + private Boolean hasChildren; + private String parentId; + + private Integer thisLayerAdd; + private Integer thisLayerEdit; + private Integer thisLayerDelete; + private Integer thisLayerSelect; + private Integer subLayerAdd; + private Integer subLayerEdit; + private Integer subLayerDelete; + private Integer subLayerSelect; + private String organizeIdTree; + @JsonIgnore + private String category; + private String id; + + private List children; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organizeadministrator/SystemSelectorVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organizeadministrator/SystemSelectorVO.java new file mode 100644 index 0000000..429d56a --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/organizeadministrator/SystemSelectorVO.java @@ -0,0 +1,34 @@ +package com.yunzhupaas.permission.model.organizeadministrator; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class SystemSelectorVO implements Serializable { + + @Schema(description = "主键") + private String id; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "编码") + private String enCode; + + @Schema(description = "图标") + private String icon; + + @Schema(description = "是否有权限") + private Integer isPermission; + + + private boolean disabled; + + private long sortCode; + + private long creatorTime; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/permission/PermissionModel.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/permission/PermissionModel.java new file mode 100644 index 0000000..53bc211 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/permission/PermissionModel.java @@ -0,0 +1,27 @@ +package com.yunzhupaas.permission.model.permission; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.util.treeutil.SumTree; +import lombok.Data; + + +/** + * 个人信息设置 我的组织/我的岗位/(我的角色:暂无) + * + * @author 云筑产品开发平台组 + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/1/25 + */ +@Data +public class PermissionModel extends SumTree { + + @Schema(description = "名称") + private String fullName; + @Schema(description = "id") + private String id; + @Schema(description = "是否为默认") + private Boolean isDefault; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/permission/PermissionVoBase.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/permission/PermissionVoBase.java new file mode 100644 index 0000000..1dbfb70 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/permission/PermissionVoBase.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.permission.model.permission; + +import lombok.Data; + +/** + * 可设置主要归属 + * + * @author 云筑产品开发平台组 + * @version V3.3.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class PermissionVoBase { + + public Boolean majorMark; + + + + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/permissiongroup/PaginationPermissionGroup.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/permissiongroup/PaginationPermissionGroup.java new file mode 100644 index 0000000..8dc0ebc --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/permissiongroup/PaginationPermissionGroup.java @@ -0,0 +1,14 @@ +package com.yunzhupaas.permission.model.permissiongroup; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class PaginationPermissionGroup extends Pagination implements Serializable { + @Schema(description = "状态") + private Integer enabledMark; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/permissiongroup/PermissionGroupListVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/permissiongroup/PermissionGroupListVO.java new file mode 100644 index 0000000..5c5c69c --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/permissiongroup/PermissionGroupListVO.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.permission.model.permissiongroup; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class PermissionGroupListVO implements Serializable { + @Schema(description = "主键") + private String id; + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "排序") + private Long sortCode; + @Schema(description = "说明") + private String description; + @Schema(description = "状态") + private Integer enabledMark; + @Schema(description = "权限成员") + private String permissionMember; + @Schema(description = "类型") + private Integer type; + @Schema(description = "创建时间") + private Long creatorTime; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/permissiongroup/PermissionGroupModel.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/permissiongroup/PermissionGroupModel.java new file mode 100644 index 0000000..c591824 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/permissiongroup/PermissionGroupModel.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.permission.model.permissiongroup; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +@Data +@Schema(description = "模型") +public class PermissionGroupModel implements Serializable { + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "排序") + private Long sortCode; + @Schema(description = "状态") + private Integer enabledMark; + @Schema(description = "说明") + private String description; + @Schema(description = "类型") + private Integer type; + @Schema(description = "主键") + private String id; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/permissiongroup/ViewPermissionsModel.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/permissiongroup/ViewPermissionsModel.java new file mode 100644 index 0000000..663c22d --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/permissiongroup/ViewPermissionsModel.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.permission.model.permissiongroup; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import jakarta.validation.constraints.NotNull; +import java.io.Serializable; + +@Data +public class ViewPermissionsModel implements Serializable { + @NotNull(message = "对象主键不能为空") + @Schema(description = "对象id") + private String id; + @Schema(description = "权限组id") + private String permissionId; + @NotNull(message = "对象类型不能为空") + @Schema(description = "对象类型") + private String objectType; + @Schema(description = "权限类型") + private String itemType; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/permissiongroup/ViewPermissionsTreeModel.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/permissiongroup/ViewPermissionsTreeModel.java new file mode 100644 index 0000000..5b3a172 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/permissiongroup/ViewPermissionsTreeModel.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.permission.model.permissiongroup; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.util.treeutil.SumTree; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class ViewPermissionsTreeModel extends SumTree implements Serializable { + @Schema(description = "名称") + private String fullName; + @Schema(description = "图标") + private String icon; + private String moduleId; + private Long creatorTime; + private Long sortCode; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/permissiongroup/ViewPermissionsVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/permissiongroup/ViewPermissionsVO.java new file mode 100644 index 0000000..54b2dfd --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/permissiongroup/ViewPermissionsVO.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.permission.model.permissiongroup; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class ViewPermissionsVO implements Serializable { + @Schema(description = "主键") + private String id; + @Schema(description = "名称") + private String fullName; + @Schema(description = "图标") + private String icon; + @Schema(description = "下级菜单列表") + private List children; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/portalManage/AuthorizePortalManagePrimary.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/portalManage/AuthorizePortalManagePrimary.java new file mode 100644 index 0000000..5506ea5 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/portalManage/AuthorizePortalManagePrimary.java @@ -0,0 +1,46 @@ +package com.yunzhupaas.permission.model.portalManage; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.MyBatisPrimaryBase; +import com.yunzhupaas.permission.entity.AuthorizeEntity; +import lombok.Data; + +/** + * 类功能 + * + * @author 云筑产品开发平台组 + * @version v3.4.8 + * @copyrignt 深圳市乐程软件有限公司 + * @date 2023-04-20 + */ +@Data +public class AuthorizePortalManagePrimary extends MyBatisPrimaryBase { + + @Schema(description = "权限类型") + private final String objectType = "role"; + + @Schema(description = "条目类型") + private final String itemType = "portalManage"; + + @Schema(description = "角色Id") + private String roleId; + + @Schema(description = "门户管理Id") + private String portalManageId; + + public AuthorizePortalManagePrimary(String roleId, String portalManageId){ + this.roleId = roleId; + this.portalManageId = portalManageId; + } + + public QueryWrapper getQuery(){ + queryWrapper.lambda().eq(AuthorizeEntity::getObjectType, objectType); + queryWrapper.lambda().eq(AuthorizeEntity::getItemType, itemType); + if(this.roleId != null) queryWrapper.lambda().eq(AuthorizeEntity::getObjectId, roleId); + if(this.portalManageId != null) queryWrapper.lambda().eq(AuthorizeEntity::getItemId, portalManageId); + return queryWrapper; + } + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/position/PaginationPosition.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/position/PaginationPosition.java new file mode 100644 index 0000000..09b578d --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/position/PaginationPosition.java @@ -0,0 +1,34 @@ +package com.yunzhupaas.permission.model.position; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class PaginationPosition extends Pagination { + @Schema(description = "组织id") + private String organizeId; + @Schema(description = "状态") + private Integer enabledMark; + @Schema(description = "类型") + private String type; + @JsonIgnore + private String enCode; + + /** 查询key */ + private String[] selectKey; + /** 功能id */ + private String moduleId; + + @Schema(description = "导出类型:0-公司和部门,1-公司,2-部门") + private Integer dataType = 0; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/position/PosOrgConditionModel.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/position/PosOrgConditionModel.java new file mode 100644 index 0000000..692ad3c --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/position/PosOrgConditionModel.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.permission.model.position; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class PosOrgConditionModel extends PosOrgModel { + + private String organizeIdTree; + + private String organizeId; + + @Schema(description ="前端解析唯一标识") + private String onlyId; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/position/PosOrgModel.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/position/PosOrgModel.java new file mode 100644 index 0000000..46d683f --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/position/PosOrgModel.java @@ -0,0 +1,38 @@ +package com.yunzhupaas.permission.model.position; + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.util.treeutil.SumTree; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class PosOrgModel extends SumTree { + + @Schema(description = "名称") + private String fullName; + @Schema(description = "状态") + private Integer enabledMark; + @JSONField(name = "category") + private String type; + @Schema(description = "图标") + private String icon; + @Schema(description = "排序") + private String sortCode; + @Schema(description = "创建时间") + private Date creatorTime; + + + private String organize; + @Schema(description = "组织id树") + private List organizeIds; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/position/PositionConditionSelectorVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/position/PositionConditionSelectorVO.java new file mode 100644 index 0000000..37de7cb --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/position/PositionConditionSelectorVO.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.permission.model.position; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class PositionConditionSelectorVO extends PositionSelectorVO implements Serializable { + + @Schema(description = "组织id树") + @JsonIgnore + private String organizeIdTree; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/position/PositionCrForm.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/position/PositionCrForm.java new file mode 100644 index 0000000..27580be --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/position/PositionCrForm.java @@ -0,0 +1,38 @@ +package com.yunzhupaas.permission.model.position; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import jakarta.validation.constraints.NotBlank; + +import jakarta.validation.constraints.NotNull; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class PositionCrForm { + @NotBlank(message = "必填") + @Schema(description = "岗位编码") + private String enCode; + @NotBlank(message = "必填") + @Schema(description = "所属部门(id)") + private String organizeId; + @NotNull(message = "必填") + @Schema(description = "岗位状态") + private Integer enabledMark; + @NotBlank(message = "必填") + @Schema(description = "岗位名称") + private String fullName; + + private String description; + @NotNull(message = "必填") + @Schema(description = "岗位类型(id)") + private String type; + @Schema(description = "排序") + private Long sortCode; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/position/PositionInfoVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/position/PositionInfoVO.java new file mode 100644 index 0000000..1fb0757 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/position/PositionInfoVO.java @@ -0,0 +1,40 @@ +package com.yunzhupaas.permission.model.position; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.permission.model.permission.PermissionVoBase; +import lombok.Data; + +import java.util.LinkedList; +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class PositionInfoVO extends PermissionVoBase { + @Schema(description = "id") + private String id; + @Schema(description = "上级id") + private String organizeId; + @Schema(description = "岗位名称") + private String fullName; + @Schema(description = "岗位编码") + private String enCode; + @Schema(description = "岗位类型") + private String type; + @Schema(description = "岗位状态") + private Integer enabledMark; + @Schema(description = "岗位说明") + private String description; + @Schema(description = "排序") + private Long sortCode; + + @Schema(description = "组织id树") + private List organizeIdTree; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/position/PositionListAllVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/position/PositionListAllVO.java new file mode 100644 index 0000000..79b3789 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/position/PositionListAllVO.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.permission.model.position; + +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class PositionListAllVO { + private String id; + private String enCode; + private String fullName; + private String organizeId; + private String type; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/position/PositionListVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/position/PositionListVO.java new file mode 100644 index 0000000..aa7cbd8 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/position/PositionListVO.java @@ -0,0 +1,37 @@ +package com.yunzhupaas.permission.model.position; + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class PositionListVO { + @Schema(description = "主键") + private String id; + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "分类") + private String type; + @Schema(description = "创建时间") + private Long creatorTime; + @Schema(description = "说明") + private String description; + @Schema(description = "部门") + private String department; + @Schema(description = "有效标志") + private Integer enabledMark; + @Schema(description = "排序") + private Long sortCode; + @Schema(description = "组织id") + private String organizeId; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/position/PositionSelectorVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/position/PositionSelectorVO.java new file mode 100644 index 0000000..05b08a2 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/position/PositionSelectorVO.java @@ -0,0 +1,41 @@ +package com.yunzhupaas.permission.model.position; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class PositionSelectorVO { + private String id; + @Schema(description ="父级ID") + private String parentId; + @Schema(description ="名称") + private String fullName; + @Schema(description ="是否有下级菜单") + private boolean hasChildren = true; + @Schema(description ="状态") + private Integer enabledMark; + @Schema(description ="下级菜单列表") + private List children = new ArrayList<>(); + @JSONField(name="category") + private String type; + @Schema(description ="图标") + private String icon; + + + private String organize; + @Schema(description ="组织id树") + private List organizeIds; + + @Schema(description = "组织id树") + @JsonIgnore + private String organizeIdTree; + + @Schema(description ="前端解析唯一标识") + private String onlyId; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/position/PositionUpForm.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/position/PositionUpForm.java new file mode 100644 index 0000000..44c360d --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/position/PositionUpForm.java @@ -0,0 +1,15 @@ +package com.yunzhupaas.permission.model.position; + +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class PositionUpForm extends PositionCrForm{ +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/position/PositionVo.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/position/PositionVo.java new file mode 100644 index 0000000..19fc389 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/position/PositionVo.java @@ -0,0 +1,23 @@ +package com.yunzhupaas.permission.model.position; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * 通过组织id获取岗位列表 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-12-21 + */ +@Data +public class PositionVo implements Serializable { + private String id; + + @Schema(description = "名称") + private String fullName; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/role/RoleCrForm.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/role/RoleCrForm.java new file mode 100644 index 0000000..659fed2 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/role/RoleCrForm.java @@ -0,0 +1,38 @@ +package com.yunzhupaas.permission.model.role; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import jakarta.validation.constraints.NotBlank; + +import jakarta.validation.constraints.NotNull; +import java.util.List; +import java.util.Map; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class RoleCrForm { + @NotBlank(message = "必填") + @Schema(description = "角色名称") + private String fullName; + @NotBlank(message = "必填") + @Schema(description = "角色编号") + private String enCode; + @NotNull(message = "必填") + @Schema(description = "组织id集合") + private List> organizeIdsTree; + @Schema(description = "是否全局(1:是,0:否)") + private Integer globalMark; + @NotNull(message = "必填") + @Schema(description = "状态") + private int enabledMark; + private String description; + @Schema(description = "排序") + private long sortCode; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/role/RoleInfoVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/role/RoleInfoVO.java new file mode 100644 index 0000000..a6f636f --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/role/RoleInfoVO.java @@ -0,0 +1,41 @@ +package com.yunzhupaas.permission.model.role; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.permission.model.permission.PermissionVoBase; +import lombok.Data; + +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class RoleInfoVO extends PermissionVoBase { + @Schema(description = "主键") + private String id; + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "组织id数组树") + private List> organizeIdsTree; + @Schema(description = "全局标识") + private Integer globalMark; + @Schema(description = "类型") + private String type; + @Schema(description = "状态") + private Integer enabledMark; + @Schema(description = "备注") + private String description; + @Schema(description = "排序") + private Long sortCode; + + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/role/RoleListVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/role/RoleListVO.java new file mode 100644 index 0000000..46f4729 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/role/RoleListVO.java @@ -0,0 +1,35 @@ +package com.yunzhupaas.permission.model.role; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class RoleListVO { + @Schema(description = "主键") + private String id; + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "角色类型") + private String type; + @Schema(description = "所属组织") + private String organizeInfo; + @Schema(description = "备注") + private String description; + @Schema(description = "状态") + private Integer enabledMark; + private Long creatorTime; + @Schema(description = "排序") + private Long sortCode; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/role/RoleModel.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/role/RoleModel.java new file mode 100644 index 0000000..95a223b --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/role/RoleModel.java @@ -0,0 +1,46 @@ +package com.yunzhupaas.permission.model.role; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.util.treeutil.SumTree; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class RoleModel extends SumTree { + + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "角色类型") + private String type; + @Schema(description = "备注") + private String description; + @Schema(description = "状态") + private Integer enabledMark; + @Schema(description = "创建时间") + private Date creatorTime; + @Schema(description = "排序") + private Long sortCode; + @Schema(description = "数量") + private Long num; + @Schema(description = "前端解析唯一标识") + private String onlyId; + @Schema(description = "图标") + private String icon; + + + private String organize; + @Schema(description = "组织id树") + private List organizeIds; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/role/RolePagination.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/role/RolePagination.java new file mode 100644 index 0000000..92719b6 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/role/RolePagination.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.permission.model.role; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import lombok.Data; + +@Data +public class RolePagination extends Pagination { + private String organizeId; + @Schema(description = "状态") + private Integer enabledMark; + @Schema(description = "类型") + private Integer type; + /** 查询key */ + private String[] selectKey; + /** 功能id */ + private String moduleId; + + /** 查询过滤:0-当前页面,1-全部数据 */ + private Integer dataType; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/role/RoleSelectorVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/role/RoleSelectorVO.java new file mode 100644 index 0000000..2fca617 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/role/RoleSelectorVO.java @@ -0,0 +1,44 @@ +package com.yunzhupaas.permission.model.role; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class RoleSelectorVO { + + @Schema(description = "ID") + private String id; + @Schema(description = "名称") + private String fullName; + @Schema(description = "类型") + private String type; + @Schema(description = "数量") + private Long num; + @Schema(description = "前端解析唯一标识") + private String onlyId; + @Schema(description = "父节点ID") + private String parentId; + @Schema(description = "子类对象集合") + private List children; + @Schema(description = "是否含有子类对象集合") + private Boolean hasChildren; + @Schema(description = "") + private Boolean isLeaf; + @Schema(description = "图标") + private String icon; + + + private String organize; + @Schema(description = "组织id树") + private List organizeIds; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/role/RoleUpForm.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/role/RoleUpForm.java new file mode 100644 index 0000000..fe448f7 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/role/RoleUpForm.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.permission.model.role; + +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class RoleUpForm extends RoleCrForm { + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/socails/SocialsUserInfo.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/socails/SocialsUserInfo.java new file mode 100644 index 0000000..44c3a12 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/socails/SocialsUserInfo.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.permission.model.socails; + +import com.alibaba.fastjson.JSONArray; +import com.yunzhupaas.base.UserInfo; +import lombok.Data; + +/** + * 流程设计 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/9/8 11:33:59 + */ +@Data +public class SocialsUserInfo { + UserInfo userInfo; + JSONArray tenantUserInfo; + String socialUnionid; + String socialName; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/socails/SocialsUserModel.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/socails/SocialsUserModel.java new file mode 100644 index 0000000..b41ee91 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/socails/SocialsUserModel.java @@ -0,0 +1,49 @@ +package com.yunzhupaas.permission.model.socails; + +import lombok.Data; + +import java.util.Date; + +/** + * 流程设计 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/7/14 11:02:42 + */ +@Data +public class SocialsUserModel { + /** + * 主键 + */ + private String id; + /** + * 系统用户id + */ + private String userId; + /** + * 第三方类型 + */ + private String socialType; + + /** + * 第三方uuid + */ + private String socialId; + /** + * 第三方账号 + */ + private String socialName; + + /** + * 创建时间 + */ + private Date creatorTime; + + /** + * 描述 + */ + private String description; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/socails/SocialsUserVo.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/socails/SocialsUserVo.java new file mode 100644 index 0000000..4391fa3 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/socails/SocialsUserVo.java @@ -0,0 +1,43 @@ +package com.yunzhupaas.permission.model.socails; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 第三方信息 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/7/14 11:00:30 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@Schema(description = "第三方信息") +public class SocialsUserVo { + @Schema(description = "类型") + private String enname; + @Schema(description = "名称") + private String name; + @Schema(description = "描述") + private String describetion; + @Schema(description = "版本") + private String since; + @Schema(description = "logo") + private String logo; + @Schema(description = "官网api文档") + private String apiDoc; + @Schema(description = "是否首页展示") + private boolean isLatest; + @Schema(description = "图标") + private String icon; + @Schema(description = "绑定对象") + private SocialsUserModel entity; + @Schema(description = "获取登录地址") + private String renderUrl; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/UserIdListVo.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/UserIdListVo.java new file mode 100644 index 0000000..b5d6675 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/UserIdListVo.java @@ -0,0 +1,52 @@ +package com.yunzhupaas.permission.model.user; +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.permission.model.user.vo.UserBaseVO; +import lombok.Data; + +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-05-29 + */ +@Data +public class UserIdListVo extends UserBaseVO { + + /** + * 前端协议字段,以后将改回realName + */ + @Schema(description = "名称") + private String fullName; + + @Schema(description = "头像") + private String headIcon; + + @Schema(description = "性别") + private String gender; + + @Schema(description = "手机号") + private String mobilePhone; + + @Schema(description = "组织") + private String organize; + + @Schema(description = "图标") + private String icon; + + @Schema(description = "类型") + private String type; + + + @Schema(description ="组织id树") + private List organizeIds; + + @JsonIgnore + @Schema(description = "类型") + private Integer enabledMark; + + private Integer isAdministrator; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/UserLogForm.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/UserLogForm.java new file mode 100644 index 0000000..5778aa3 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/UserLogForm.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.permission.model.user; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class UserLogForm extends Pagination implements Serializable { + @Schema(description = "开始时间") + private String startTime; + @Schema(description = "结束时间") + private String endTime; + @Schema(description = "分类") + private int category; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/WorkHandoverModel.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/WorkHandoverModel.java new file mode 100644 index 0000000..9218590 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/WorkHandoverModel.java @@ -0,0 +1,23 @@ +package com.yunzhupaas.permission.model.user; + +import lombok.Data; + +import jakarta.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +@Data +public class WorkHandoverModel implements Serializable { + @NotNull(message = "工作移交人不能为空") + private String fromId; + @NotNull(message = "工作交接人不能为空") + private String toId; + private List waitList = new ArrayList<>(); + private List flowTaskList = new ArrayList<>(); + private List chargeList = new ArrayList<>(); + private List flowList = new ArrayList<>(); + private List circulateList = new ArrayList<>(); + private List permissionList = new ArrayList<>(); +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/form/UserAppDataForm.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/form/UserAppDataForm.java new file mode 100644 index 0000000..356bed6 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/form/UserAppDataForm.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.permission.model.user.form; + +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/5/14 8:47 + */ +@Data +public class UserAppDataForm { + private String data; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/form/UserCrForm.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/form/UserCrForm.java new file mode 100644 index 0000000..f37e1ce --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/form/UserCrForm.java @@ -0,0 +1,101 @@ +package com.yunzhupaas.permission.model.user.form; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import jakarta.validation.constraints.NotBlank; + +import jakarta.validation.constraints.NotNull; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class UserCrForm { + + @Schema(description = "账户") + private String account; + + @Schema(description = "户名") + private String realName; + + @NotBlank(message = "必填") + @Schema(description = "部门") + private String organizeId; + + @Schema(description = "主管") + private String managerId; + + @Schema(description = "岗位") + private String positionId; + + @Schema(description = "角色") + private String roleId; + + private String description; + + @NotNull(message = "性别不能为空") + @Schema(description = "性别") + private String gender; + + @Schema(description = "民族") + private String nation; + + @Schema(description = "籍贯") + private String nativePlace; + + @Schema(description = "证件类型") + private String certificatesType; + + @Schema(description = "证件号码") + private String certificatesNumber; + + @Schema(description = "文化程度") + private String education; + + @Schema(description = "生日") + private String birthday; + + @Schema(description = "电话") + private String telePhone; + + @Schema(description = "Landline") + private String landline; + + @Schema(description = "手机") + private String mobilePhone; + + @Schema(description = "邮箱") + private String email; + + @Schema(description = "UrgentContacts") + private String urgentContacts; + + @Schema(description = "紧急电话") + private String urgentTelePhone; + + @Schema(description = "通讯地址") + private String postalAddress; + + @Schema(description = "头像") + private String headIcon; + + @Schema(description = "排序") + private Long sortCode; + + @Schema(description = "入职日期") + private Long entryDate; + + @Schema(description = "状态") + private Integer enabledMark; + + @Schema(description = "分组id") + private String groupId; + + @Schema(description = "职级") + private String ranks; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/form/UserInfoForm.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/form/UserInfoForm.java new file mode 100644 index 0000000..a47edca --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/form/UserInfoForm.java @@ -0,0 +1,32 @@ +package com.yunzhupaas.permission.model.user.form; + +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class UserInfoForm { + private String signature; + private String gender; + private String nation; + private String nativePlace; + private String entryDate; + private String certificatesType; + private String certificatesNumber; + private String education; + private Long birthday; + private String telePhone; + private String landline; + private String mobilePhone; + private String email; + private String urgentContacts; + private String urgentTelePhone; + private String postalAddress; + private String realName; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/form/UserLanguageForm.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/form/UserLanguageForm.java new file mode 100644 index 0000000..b663762 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/form/UserLanguageForm.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.permission.model.user.form; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import jakarta.validation.constraints.NotBlank; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class UserLanguageForm { + @NotBlank(message = "必填") + @Schema(description = "语言代码") + private String language; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/form/UserModifyPasswordForm.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/form/UserModifyPasswordForm.java new file mode 100644 index 0000000..3e16074 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/form/UserModifyPasswordForm.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.permission.model.user.form; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import jakarta.validation.constraints.NotBlank; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class UserModifyPasswordForm { + @NotBlank(message = "必填") + @Schema(description = "旧密码,需要 MD5 加密后传输") + private String oldPassword; + @NotBlank(message = "必填") + @Schema(description = "新密码") + private String password; + @NotBlank(message = "必填") + @Schema(description = "验证码") + private String code; + @NotBlank(message = "必填") + @Schema(description = "验证码标识") + private String timestamp; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/form/UserPasswordForm.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/form/UserPasswordForm.java new file mode 100644 index 0000000..c3b670a --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/form/UserPasswordForm.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.permission.model.user.form; + +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class UserPasswordForm { + private String oldPassword; + private String password; + private String code; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/form/UserResetPasswordForm.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/form/UserResetPasswordForm.java new file mode 100644 index 0000000..7f452b9 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/form/UserResetPasswordForm.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.permission.model.user.form; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import jakarta.validation.constraints.NotBlank; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class UserResetPasswordForm { + @NotBlank(message = "必填") + @Schema(description = "用户id") + private String id; + @NotBlank(message = "必填") + @Schema(description = "新密码,需要 MD5 加密后传输") + private String userPassword; + @NotBlank(message = "必填") + @Schema(description = "重复新密码") + private String validatePassword; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/form/UserSettingForm.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/form/UserSettingForm.java new file mode 100644 index 0000000..25c0dfd --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/form/UserSettingForm.java @@ -0,0 +1,27 @@ +package com.yunzhupaas.permission.model.user.form; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.apache.ibatis.annotations.Param; + +/** + * 类功能 + * + * @author 云筑产品开发平台组 + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/1/28 + */ +@Data +public class UserSettingForm { + + @Schema(description = "主要类型") + private String majorType; + @Schema(description = "主要Id") + private String majorId; + + @Schema(description = "菜单类型") + private Integer menuType; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/form/UserThemeForm.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/form/UserThemeForm.java new file mode 100644 index 0000000..7026a6d --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/form/UserThemeForm.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.permission.model.user.form; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import jakarta.validation.constraints.NotBlank; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class UserThemeForm { + @NotBlank(message = "必填") + @Schema(description = "系统主题") + private String theme; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/form/UserUpAdminForm.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/form/UserUpAdminForm.java new file mode 100644 index 0000000..4890285 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/form/UserUpAdminForm.java @@ -0,0 +1,23 @@ +package com.yunzhupaas.permission.model.user.form; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * 超级管理员设置表单参数 + * + * @author 云筑产品开发平台组 + * @version V3.3.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/2/23 + */ +@Data +public class UserUpAdminForm { + + @Schema(description = "超级管理id集合") + List adminIds; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/form/UserUpForm.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/form/UserUpForm.java new file mode 100644 index 0000000..3388552 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/form/UserUpForm.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.permission.model.user.form; + +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class UserUpForm extends UserCrForm { + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/mod/UserAllModel.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/mod/UserAllModel.java new file mode 100644 index 0000000..82db886 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/mod/UserAllModel.java @@ -0,0 +1,34 @@ +package com.yunzhupaas.permission.model.user.mod; + +import com.yunzhupaas.util.treeutil.SumTree; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class UserAllModel extends SumTree { + private String id; + private String account; + private String gender; + private String realName; + private String headIcon; + private String department; + private String departmentId; + private String organizeId; + private String organize; + private String roleId; + private String roleName; + private String positionId; + private String positionName; + private String managerId; + private String managerName; + private String quickQuery; + private String portalId; + private Integer isAdministrator; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/mod/UserAuthorizeModel.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/mod/UserAuthorizeModel.java new file mode 100644 index 0000000..3104505 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/mod/UserAuthorizeModel.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.permission.model.user.mod; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class UserAuthorizeModel { + @Schema(description = "主键") + private String id; + @Schema(description = "名称") + private String fullName; + @Schema(description = "图标") + private String icon; + @Schema(description = "下级菜单列表") + private List children; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/mod/UserByRoleModel.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/mod/UserByRoleModel.java new file mode 100644 index 0000000..a6c307d --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/mod/UserByRoleModel.java @@ -0,0 +1,35 @@ +package com.yunzhupaas.permission.model.user.mod; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/4/14 15:45 + */ +@Data +public class UserByRoleModel implements Serializable { + /** + * 关键字 + */ + @Schema(description = "关键字") + private String keyword; + + /** + * 组织id + */ + @Schema(description = "组织id") + private String organizeId; + + /** + * 角色id + */ + @Schema(description = "角色id") + private String roleId; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/mod/UserConditionModel.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/mod/UserConditionModel.java new file mode 100644 index 0000000..c80aba3 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/mod/UserConditionModel.java @@ -0,0 +1,59 @@ +package com.yunzhupaas.permission.model.user.mod; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/6/6 17:33 + */ +@Data +public class UserConditionModel implements Serializable { + + /** + * 部门id + */ + @Schema(description = "部门id") + private List departIds; + + /** + * 岗位id + */ + @Schema(description = "岗位id") + private List positionIds; + + /** + * 用户id + */ + @Schema(description = "用户id") + private List userIds; + + /** + * 角色Id + */ + @Schema(description = "角色Id") + private List roleIds; + + /** + * 分组Id + */ + @Schema(description = "分组Id") + private List groupIds; + + /** + * 类型 + */ + @Schema(description = "类型") + private String type; + + @Schema(description = "分页参数") + private Pagination pagination; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/mod/UserIdModel.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/mod/UserIdModel.java new file mode 100644 index 0000000..4628bd5 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/mod/UserIdModel.java @@ -0,0 +1,41 @@ +package com.yunzhupaas.permission.model.user.mod; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-05-29 + */ +@Data +public class UserIdModel { + /** + * 用户id集合 + */ + @Schema(description = "用户id集合") + private Object ids; + + public List getIds() { + List ids = new ArrayList<>(16); + if (this.ids != null) { + if (this.ids instanceof List) { + List list = (List) this.ids; + Object object = list.size() > 0 ? list.get(0) : null; + if (Objects.nonNull(object) && object instanceof String) { + ids.addAll(list); + } + } else { + String userIds = (String) this.ids; + ids.add(userIds); + } + } + return ids; + } +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/mod/UserIdModelByPage.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/mod/UserIdModelByPage.java new file mode 100644 index 0000000..6954f7d --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/mod/UserIdModelByPage.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.permission.model.user.mod; +import com.yunzhupaas.base.Pagination; +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.permission.model.user.mod.UserIdModel; +import lombok.Data; + +@Data +public class UserIdModelByPage extends UserIdModel { + + @Schema(description = "分页参数") + private Pagination pagination; + + @Schema(description = "类型") + private String type; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/mod/UserImportModel.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/mod/UserImportModel.java new file mode 100644 index 0000000..8ed730c --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/mod/UserImportModel.java @@ -0,0 +1,67 @@ +package com.yunzhupaas.permission.model.user.mod; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 导入模型 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-12-20 + */ +@Data +public class UserImportModel implements Serializable { + private String account; + + private String realName; + + private String organizeId; + + private String managerId; + + private String positionId; + + private String roleId; + + private String description; + + private String gender; + + private String nation; + + private String nativePlace; + + private String certificatesType; + + private String certificatesNumber; + + private String education; + + private Date birthday; + + private String telePhone; + + private String landline; + + private String mobilePhone; + + private String email; + + private String urgentContacts; + + private String urgentTelePhone; + + private String postalAddress; + + private Long sortCode; + + private Date entryDate; + + private Integer enabledMark; + private String ranks; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/mod/UserSelectorModel.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/mod/UserSelectorModel.java new file mode 100644 index 0000000..ec4d2b5 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/mod/UserSelectorModel.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.permission.model.user.mod; + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.util.treeutil.SumTree; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class UserSelectorModel extends SumTree { + @JSONField(name="category") + private String type; + private String fullName; + @Schema(description = "状态") + private Integer enabledMark; + @Schema(description = "图标") + private String icon; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/mod/UserUpModel.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/mod/UserUpModel.java new file mode 100644 index 0000000..e5c8ff2 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/mod/UserUpModel.java @@ -0,0 +1,27 @@ +package com.yunzhupaas.permission.model.user.mod; + +import com.yunzhupaas.permission.entity.UserEntity; +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-11-23 + */ +@Data +public class UserUpModel { + + private Integer num; + + private UserEntity entity; + + public UserUpModel() { + } + + public UserUpModel(Integer num, UserEntity entity) { + this.num = num; + this.entity = entity; + } +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/mod/UsersByPositionModel.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/mod/UsersByPositionModel.java new file mode 100644 index 0000000..caad536 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/mod/UsersByPositionModel.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.permission.model.user.mod; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Page; +import lombok.Data; + +/** + * 获取岗位成员 + * + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/4/28 14:44 + */ +@Data +public class UsersByPositionModel extends Page { + @Schema(description = "岗位id") + private String positionId; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/page/PageUser.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/page/PageUser.java new file mode 100644 index 0000000..57a2bfa --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/page/PageUser.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.permission.model.user.page; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Page; +import lombok.Data; + +import java.io.Serializable; + +/** + * 通过组织id或关键字查询 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-01-13 + */ +@Data +public class PageUser extends Page implements Serializable { + @Schema(description = "组织id") + private String organizeId; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/page/PaginationUser.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/page/PaginationUser.java new file mode 100644 index 0000000..cf52c07 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/page/PaginationUser.java @@ -0,0 +1,34 @@ +package com.yunzhupaas.permission.model.user.page; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class PaginationUser extends Pagination { + + @Schema(description = "组织id") + private String organizeId; + + @Schema(description = "角色id") + private String roleId; + @Schema(description = "状态") + private Integer enabledMark; + @Schema(description = "性别") + private String gender; + + /** 查询key */ + private String[] selectKey; + /** 功能id */ + private String moduleId; + /** 当前页面还是全部数据 */ + private Integer dataType; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/ImUserListVo.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/ImUserListVo.java new file mode 100644 index 0000000..03c62ea --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/ImUserListVo.java @@ -0,0 +1,23 @@ +package com.yunzhupaas.permission.model.user.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * IM获取用户接口 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-05-29 + */ +@Data +public class ImUserListVo extends UserBaseVO{ + + @Schema(description = "用户头像") + private String headIcon; + @Schema(description = "部门") + private String department; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserAdminVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserAdminVO.java new file mode 100644 index 0000000..6cd5468 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserAdminVO.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.permission.model.user.vo; + +import lombok.Data; + +/** + * 超级管理员显示对象 + * + * @author 云筑产品开发平台组 + * @version V3.3.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/2/23 + */ +@Data +public class UserAdminVO extends UserBaseVO{ + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserAllVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserAllVO.java new file mode 100644 index 0000000..a26d265 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserAllVO.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.permission.model.user.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class UserAllVO extends UserBaseVO{ + + @Schema(description = "用户头像") + private String headIcon; + @Schema(description = "性别(1,男。2女)") + private String gender; + @Schema(description = "快速搜索") + private String quickQuery; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserAuthorizeVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserAuthorizeVO.java new file mode 100644 index 0000000..86c5e93 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserAuthorizeVO.java @@ -0,0 +1,32 @@ +package com.yunzhupaas.permission.model.user.vo; + +import com.yunzhupaas.permission.model.user.mod.UserAuthorizeModel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class UserAuthorizeVO { + private List button; + private List column; + private List module; + private List resource; + private List form; + private List portal; + private List flow; + private List print; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserBaseInfoVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserBaseInfoVO.java new file mode 100644 index 0000000..883adca --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserBaseInfoVO.java @@ -0,0 +1,84 @@ +package com.yunzhupaas.permission.model.user.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class UserBaseInfoVO { + @Schema(description = "主键") + private String id; + @Schema(description = "账户") + private String account; + @Schema(description = "户名") + private String realName; + @Schema(description = "部门") + private String organize; + @Schema(description = "公司名称") + private String company; + @Schema(description = "岗位") + private String position; + @Schema(description = "主管") + private String manager; + @Schema(description = "角色") + private String roleId; + @Schema(description = "注册时间") + private Long creatorTime; + @Schema(description = "上次登录时间") + private Long prevLogTime; + @Schema(description = "自我介绍") + private String signature; + @Schema(description = "性别") + private String gender; + @Schema(description = "民族") + private String nation; + @Schema(description = "籍贯") + private String nativePlace; + @Schema(description = "入职时间") + private Long entryDate; + @Schema(description = "证件类型") + private String certificatesType; + @Schema(description = "证件号码") + private String certificatesNumber; + @Schema(description = "学历") + private String education; + @Schema(description = "出生年月") + private Long birthday; + @Schema(description = "办公电话") + private String telePhone; + @Schema(description = "办公座机") + private String landline; + @Schema(description = "手机号码") + private String mobilePhone; + @Schema(description = "电子邮箱") + private String email; + @Schema(description = "紧急联系人") + private String urgentContacts; + @Schema(description = "紧急联系人电话") + private String urgentTelePhone; + @Schema(description = "通信地址") + private String postalAddress; + @Schema(description = "用户头像") + private String avatar; + @Schema(description = "主题") + private String theme; + @Schema(description = "语言") + private String language; + + @Schema(description = "职级") + private String ranks; + + @Schema(description = "是否多租户") + private Boolean isTenant = false; + + @Schema(description = "多租户信息") + private Object currentTenantInfo; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserBaseVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserBaseVO.java new file mode 100644 index 0000000..93c2d0d --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserBaseVO.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.permission.model.user.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 用户视图对象基类 + * + * @author 云筑产品开发平台组 + * @version V3.3.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/2/23 + */ +@Data +public class UserBaseVO { + + @Schema(description = "主键") + private String id; + @Schema(description = "账号") + private String account; + @Schema(description = "名称") + private String realName; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserByRoleVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserByRoleVO.java new file mode 100644 index 0000000..6dec6f0 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserByRoleVO.java @@ -0,0 +1,46 @@ +package com.yunzhupaas.permission.model.user.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/4/14 15:49 + */ +@Data +public class UserByRoleVO implements Serializable { + @Schema(description = "主键") + private String id; + @Schema(description = "有效标志") + private Integer enabledMark; + @Schema(description = "名称") + private String fullName; + @Schema(description = "类型") + private String type; + @Schema(description = "头像") + private String headIcon; + + @Schema(description = "是否含有子类对象集合") + private Boolean hasChildren; + @Schema(description = "是否含有子类对象集合反值") + private Boolean isLeaf; + @Schema(description = "图标") + private String icon; + @Schema(description = "父节点ID") + private String parentId; + @Schema(description = "数量") + private Long num; + @Schema(description = "组织") + private String organize; + @Schema(description = "性别") + private String gender; + + @Schema(description = "子类对象集合") + private List children; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserExportExceptionVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserExportExceptionVO.java new file mode 100644 index 0000000..21d647c --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserExportExceptionVO.java @@ -0,0 +1,90 @@ +package com.yunzhupaas.permission.model.user.vo; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-12-18 + */ +@Data +public class UserExportExceptionVO implements Serializable { + @Excel(name = "账号", isImportField = "true") + private String account; + @Excel(name = "姓名", isImportField = "true") + private String realName; + /** + * 性别 + */ + @Excel(name = "性别", isImportField = "true") + private String gender; + @Excel(name = "电子邮箱", isImportField = "true") + private String email; + /** + * 组织 + */ + @Excel(name = "所属组织", isImportField = "true") + private String organizeId; + /** + * 主管 + */ + @Excel(name = "直属主管", isImportField = "true") + private String managerId; + /** + * 岗位 + */ + @Excel(name = "岗位", isImportField = "true") + private String positionId; + /** + * 角色 + */ + @Excel(name = "角色", isImportField = "true") + private String roleId; + @Excel(name = "排序", isImportField = "true") + private Long sortCode; + @Excel(name = "状态", isImportField = "true") + private String enabledMark; + @Excel(name = "说明", isImportField = "true") + private String description; + @Excel(name = "民族", isImportField = "true") + private String nation; + @Excel(name = "籍贯", isImportField = "true") + private String nativePlace; + /** + * 入职时间 + */ + @Excel(name = "入职时间", isImportField = "true") + private String entryDate; + @Excel(name = "证件类型", isImportField = "true") + private String certificatesType; + @Excel(name = "证件号码", isImportField = "true") + private String certificatesNumber; + @Excel(name = "文化程度", isImportField = "true") + private String education; + @Excel(name = "出生年月", isImportField = "true") + private String birthday; + @Excel(name = "办公电话", isImportField = "true") + private String telePhone; + @Excel(name = "办公座机", isImportField = "true") + private String landline; + @Excel(name = "手机号码", isImportField = "true") + private String mobilePhone; + @Excel(name = "紧急联系", isImportField = "true") + private String urgentContacts; + @Excel(name = "紧急电话", isImportField = "true") + private String urgentTelePhone; + @Excel(name = "通讯地址", isImportField = "true") + private String postalAddress; + @Excel(name = "职级", isImportField = "true") + private String ranks; + @Excel(name = "异常原因") + private String errorsInfo; + + private List list; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserExportVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserExportVO.java new file mode 100644 index 0000000..445e462 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserExportVO.java @@ -0,0 +1,88 @@ +package com.yunzhupaas.permission.model.user.vo; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-12-18 + */ +@Data +public class UserExportVO implements Serializable { + @Excel(name = "账号", isImportField = "true") + private String account; + @Excel(name = "姓名", isImportField = "true") + private String realName; + /** + * 性别 + */ + @Excel(name = "性别", isImportField = "true") + private String gender; + @Excel(name = "电子邮箱", isImportField = "true") + private String email; + /** + * 组织 + */ + @Excel(name = "所属组织", isImportField = "true") + private String organizeId; + /** + * 主管 + */ + @Excel(name = "直属主管", isImportField = "true") + private String managerId; + /** + * 岗位 + */ + @Excel(name = "岗位", isImportField = "true") + private String positionId; + /** + * 角色 + */ + @Excel(name = "角色", isImportField = "true") + private String roleId; + @Excel(name = "排序", isImportField = "true") + private Long sortCode; + @Excel(name = "状态", isImportField = "true") + private String enabledMark; + @Excel(name = "说明", isImportField = "true") + private String description; + @Excel(name = "民族", isImportField = "true") + private String nation; + @Excel(name = "籍贯", isImportField = "true") + private String nativePlace; + /** + * 入职时间 + */ + @Excel(name = "入职时间", isImportField = "true") + private String entryDate; + @Excel(name = "证件类型", isImportField = "true") + private String certificatesType; + @Excel(name = "证件号码", isImportField = "true") + private String certificatesNumber; + @Excel(name = "文化程度", isImportField = "true") + private String education; + @Excel(name = "出生年月", isImportField = "true") + private String birthday; + @Excel(name = "办公电话", isImportField = "true") + private String telePhone; + @Excel(name = "办公座机", isImportField = "true") + private String landline; + @Excel(name = "手机号码", isImportField = "true") + private String mobilePhone; + @Excel(name = "紧急联系", isImportField = "true") + private String urgentContacts; + @Excel(name = "紧急电话", isImportField = "true") + private String urgentTelePhone; + @Excel(name = "通讯地址", isImportField = "true") + private String postalAddress; + @Excel(name = "职级", isImportField = "true") + private String ranks; + + private List list; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserImportVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserImportVO.java new file mode 100644 index 0000000..2be884a --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserImportVO.java @@ -0,0 +1,39 @@ +package com.yunzhupaas.permission.model.user.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-12-18 + */ +@Data +public class UserImportVO implements Serializable { + /** + * 导入成功条数 + */ + @Schema(description = "导入成功条数") + private int snum; + /** + * 导入失败条数 + */ + @Schema(description = "导入失败条数") + private int fnum; + /** + * 导入结果状态(0,成功 1,失败) + */ + @Schema(description = "导入结果状态(0,成功 1,失败)") + private int resultType; + /** + * 失败结果 + */ + @Schema(description = "失败结果") + private List failResult; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserInfoVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserInfoVO.java new file mode 100644 index 0000000..c68fd2b --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserInfoVO.java @@ -0,0 +1,79 @@ +package com.yunzhupaas.permission.model.user.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.LinkedList; +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class UserInfoVO { + + @Schema(description = "id") + private String id; + @Schema(description = "账户") + private String account; + @Schema(description = "户名") + private String realName; + @Schema(description = "部门id") + private String organizeId; + @Schema(description = "组织id树") + private List> organizeIdTree; + @Schema(description = "主管id") + private String managerId; + @Schema(description = "岗位id") + private String positionId; + @Schema(description = "角色id") + private String roleId; + @Schema(description = "备注") + private String description; + @Schema(description = "性别") + private String gender; + @Schema(description = "民族") + private String nation; + @Schema(description = "籍贯") + private String nativePlace; + @Schema(description = "入职时间") + private Long entryDate; + @Schema(description = "证件类型") + private String certificatesType; + @Schema(description = "证件号码") + private String certificatesNumber; + @Schema(description = "学历") + private String education; + @Schema(description = "出生年月") + private Long birthday; + @Schema(description = "办公电话") + private String telePhone; + @Schema(description = "办公座机") + private String landline; + @Schema(description = "手机号码") + private String mobilePhone; + @Schema(description = "电子邮箱") + private String email; + @Schema(description = "紧急联系人") + private String urgentContacts; + @Schema(description = "紧急联系人电话") + private String urgentTelePhone; + @Schema(description = "通信地址") + private String postalAddress; + @Schema(description = "用户头像") + private String headIcon; + @Schema(description = "状态") + private Integer enabledMark; + @Schema(description = "排序") + private Long sortCode; + @Schema(description = "分组id") + private String groupId; + @Schema(description = "职级") + private String ranks; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserListVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserListVO.java new file mode 100644 index 0000000..6fe5cd8 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserListVO.java @@ -0,0 +1,42 @@ +package com.yunzhupaas.permission.model.user.vo; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class UserListVO { + @Schema(description ="主键") + private String id; + @Schema(description ="账号") + private String account; + @Schema(description ="姓名") + private String realName; + @Schema(description ="性别") + private String gender; + @Schema(description ="手机") + private String mobilePhone; + @Schema(description ="部门") + private String organize; + @Schema(description ="说明") + private String description; + @Schema(description ="状态") + private Integer enabledMark; + @Schema(description ="添加时间",example = "1") + private Long creatorTime; + @Schema(description ="排序") + private Long sortCode; + @Schema(description ="锁定标志") + private Integer lockMark; + @Schema(description ="交接状态") + private Integer handoverMark; + private Integer isAdministrator; + @Schema(description = "头像") + private String headIcon; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserSelectorVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserSelectorVO.java new file mode 100644 index 0000000..f554c1e --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserSelectorVO.java @@ -0,0 +1,40 @@ +package com.yunzhupaas.permission.model.user.vo; + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class UserSelectorVO { + @Schema(description = "主键") + private String id; + @Schema(description = "父主键") + private String parentId; + @Schema(description = "名称") + private String fullName; + @Schema(description = "是否有子节点") + private Boolean hasChildren; + @Schema(description = "状态") + private Integer enabledMark; + @Schema(description = "子节点") + private List children; + @JSONField(name="category") + private String type; + @Schema(description = "图标") + private String icon; + private Boolean isLeaf; + private String headIcon; + private String organize; + private String gender; + private Integer isAdministrator; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserSubordinateVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserSubordinateVO.java new file mode 100644 index 0000000..a2858c4 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/user/vo/UserSubordinateVO.java @@ -0,0 +1,30 @@ +package com.yunzhupaas.permission.model.user.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Builder; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +@Builder +public class UserSubordinateVO { + private String id; + @Schema(description = "头像") + private String avatar; + @Schema(description = "用户名") + private String userName; + @Schema(description = "部门") + private String department; + @Schema(description = "岗位") + private String position; + + @Schema(description = "是否显示下级按钮") + private Boolean isLeaf; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/usergroup/GroupCrForm.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/usergroup/GroupCrForm.java new file mode 100644 index 0000000..c02ba6b --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/usergroup/GroupCrForm.java @@ -0,0 +1,55 @@ +package com.yunzhupaas.permission.model.usergroup; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import jakarta.validation.constraints.NotBlank; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/3/11 9:28 + */ +@Data +public class GroupCrForm { + /** + * 名称 + **/ + @Schema(description = "名称") + @NotBlank(message = "名称不能为空") + private String fullName; + + /** + * 编码 + **/ + @Schema(description = "编码") + @NotBlank(message = "编码不能为空") + private String enCode; + + /** + * 说明 + **/ + @Schema(description = "说明") + private String description; + + /** + * 类型 + **/ + @Schema(description = "类型") + @NotBlank(message = "类型不能为空") + private String type; + + /** + * 排序 + **/ + @Schema(description = "排序") + private String sortCode; + + /** + * 状态 + **/ + @Schema(description = "状态") + private Integer enabledMark; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/usergroup/GroupInfoVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/usergroup/GroupInfoVO.java new file mode 100644 index 0000000..543a167 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/usergroup/GroupInfoVO.java @@ -0,0 +1,55 @@ +package com.yunzhupaas.permission.model.usergroup; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/3/11 9:21 + */ +@Data +public class GroupInfoVO implements Serializable { + /** + * 主键 + **/ + @Schema(description = "主键") + private String id; + + /** + * 名称 + **/ + @Schema(description = "名称") + private String fullName; + + /** + * 编码 + **/ + @Schema(description = "编码") + private String enCode; + + /** + * 说明 + **/ + @Schema(description = "说明") + private String description; + + /** + * 类型 + **/ + @Schema(description = "类型") + private String type; + + /** + * 排序 + **/ + @Schema(description = "排序") + private String sortCode; + + @Schema(description = "状态") + private Integer enabledMark; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/usergroup/GroupPaginationVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/usergroup/GroupPaginationVO.java new file mode 100644 index 0000000..ab1351b --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/usergroup/GroupPaginationVO.java @@ -0,0 +1,36 @@ +package com.yunzhupaas.permission.model.usergroup; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 用户分组管理列表返回 + * + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/3/11 8:58 + */ +@Data +public class GroupPaginationVO implements Serializable { + @Schema(description = "主键") + private String id; + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "类型") + private String type; + @Schema(description = "说明") + private String description; + @Schema(description = "排序码") + private Long sortCode; + @Schema(description = "创建时间") + private Long creatorTime; + @Schema(description = "创建时间") + private Integer enabledMark; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/usergroup/GroupSelectorVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/usergroup/GroupSelectorVO.java new file mode 100644 index 0000000..3af6468 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/usergroup/GroupSelectorVO.java @@ -0,0 +1,43 @@ +package com.yunzhupaas.permission.model.usergroup; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/3/11 10:39 + */ +@Data +public class GroupSelectorVO implements Serializable { + + @Schema(description = "主键") + private String id; + @Schema(description = "名称") + private String fullName; + /** + * 子集个数 + */ + @Schema(description = "子集个数") + private Long num; + /** + * 子集 + */ + @Schema(description = "子集") + private List children; + @Schema(description = "父级id") + private String parentId; + @Schema(description = "类型") + private String type; + + @Schema(description = "有线标志") + private Integer enabledMark; + + @Schema(description = "按钮") + private String icon; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/usergroup/GroupTreeModel.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/usergroup/GroupTreeModel.java new file mode 100644 index 0000000..e819b93 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/usergroup/GroupTreeModel.java @@ -0,0 +1,23 @@ +package com.yunzhupaas.permission.model.usergroup; + +import com.yunzhupaas.util.treeutil.SumTree; +import lombok.Data; + +/** + * 转树模型 + * + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/3/11 11:18 + */ +@Data +public class GroupTreeModel extends SumTree { + private String fullName; + private String type; + private Long num; + + private Integer enabledMark; + private String icon; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/usergroup/GroupUpForm.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/usergroup/GroupUpForm.java new file mode 100644 index 0000000..2ed6fdd --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/usergroup/GroupUpForm.java @@ -0,0 +1,58 @@ +package com.yunzhupaas.permission.model.usergroup; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import jakarta.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/3/11 9:34 + */ +@Data +public class GroupUpForm implements Serializable { + + /** + * 名称 + **/ + @Schema(description = "名称") + @NotBlank(message = "名称不能为空") + private String fullName; + + /** + * 编码 + **/ + @Schema(description = "编码") + @NotBlank(message = "编码不能为空") + private String enCode; + + /** + * 说明 + **/ + @Schema(description = "说明") + private String description; + + /** + * 类型 + **/ + @Schema(description = "类型") + @NotBlank(message = "类型不能为空") + private String type; + + /** + * 排序 + **/ + @Schema(description = "排序") + private String sortCode; + + /** + * 状态 + **/ + @Schema(description = "状态") + private Integer enabledMark; + +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/usergroup/PaginationGroup.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/usergroup/PaginationGroup.java new file mode 100644 index 0000000..4cb1a79 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/usergroup/PaginationGroup.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.permission.model.usergroup; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import lombok.Data; + +import java.io.Serializable; + +/** + * 用户分组管理列表返回 + * + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/3/11 8:58 + */ +@Data +public class PaginationGroup extends Pagination implements Serializable { + @Schema(description = "状态") + private Integer enabledMark; + @Schema(description = "类型") + private String type; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/userrelation/UserRelationDel.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/userrelation/UserRelationDel.java new file mode 100644 index 0000000..51c7796 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/userrelation/UserRelationDel.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.permission.model.userrelation; + +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class UserRelationDel { + private String[] ids; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/userrelation/UserRelationForm.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/userrelation/UserRelationForm.java new file mode 100644 index 0000000..aa1df71 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/userrelation/UserRelationForm.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.permission.model.userrelation; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class UserRelationForm { + @Schema(description = "对象类型") + private String objectType; + @Schema(description = "用户id") + private List userIds; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/userrelation/UserRelationIdsVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/userrelation/UserRelationIdsVO.java new file mode 100644 index 0000000..cbb9b17 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/userrelation/UserRelationIdsVO.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.permission.model.userrelation; + +import lombok.Data; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class UserRelationIdsVO { + List ids; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/userrelation/UserRelationListVO.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/userrelation/UserRelationListVO.java new file mode 100644 index 0000000..fc3ab61 --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/userrelation/UserRelationListVO.java @@ -0,0 +1,32 @@ +package com.yunzhupaas.permission.model.userrelation; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class UserRelationListVO { + @Schema(description = "id") + private String id; + @Schema(description = "成员id") + private String userId; + @Schema(description = "用户id") + private String account; + @Schema(description = "用户真实姓名") + private String realName; + @Schema(description = "性别") + private String gender; + @Schema(description = "所属公司") + private String organize; + @Schema(description = "所属部门") + private String department; + @Schema(description = "添加时间(时间戳)") + private Long creatorTime; +} + diff --git a/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/userrelation/UserRelationTreeModel.java b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/userrelation/UserRelationTreeModel.java new file mode 100644 index 0000000..5b41b4e --- /dev/null +++ b/yunzhupaas-permission/yunzhupaas-permission-entity/src/main/java/com/yunzhupaas/permission/model/userrelation/UserRelationTreeModel.java @@ -0,0 +1,27 @@ +package com.yunzhupaas.permission.model.userrelation; + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.util.treeutil.SumTree; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class UserRelationTreeModel extends SumTree{ + + @Schema(description = "主键") + private String id; + @Schema(description = "名称") + private String fullName; + @Schema(description = "是否有子节点") + private Boolean hasChildren; + @JSONField(name="category") + private String type; +} + diff --git a/yunzhupaas-public/yunzhupaas-common-all/pom.xml b/yunzhupaas-public/yunzhupaas-common-all/pom.xml new file mode 100644 index 0000000..351a546 --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-common-all/pom.xml @@ -0,0 +1,61 @@ + + + + yunzhupaas-java-boot + com.yunzhupaas + 5.2.0-RELEASE + ../../pom.xml + + 4.0.0 + + yunzhupaas-common-all + + + + com.yunzhupaas + yunzhupaas-common-database + + + + com.yunzhupaas + yunzhupaas-common-swagger + + + + com.yunzhupaas + yunzhupaas-common-file + + + com.yunzhupaas + yunzhupaas-file-core-starter + 5.2.0-RELEASE + + + com.yunzhupaas + yunzhupaas-common-office + + + com.yunzhupaas + yunzhupaas-common-event + + + + + + boot3 + + [17,) + + + + com.yunzhupaas + yunzhupaas-common-office-v3 + ${project.version} + + + + + + diff --git a/yunzhupaas-public/yunzhupaas-common-all/src/main/java/com/yunzhupaas/model/AppDataInfoModel.java b/yunzhupaas-public/yunzhupaas-common-all/src/main/java/com/yunzhupaas/model/AppDataInfoModel.java new file mode 100644 index 0000000..3d8bc4f --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-common-all/src/main/java/com/yunzhupaas/model/AppDataInfoModel.java @@ -0,0 +1,69 @@ +package com.yunzhupaas.model; + +import lombok.Data; + +import java.util.Date; + +@Data +public class AppDataInfoModel { + /** + * 单据主键 + */ + private String id; + + /** + * 对象类型 + */ + private String objectType; + + /** + * 对象主键 + */ + private String objectId; + + /** + * 数据 + */ + private String objectData; + + /** + * 描述 + */ + private String description; + + /** + * 有效标志 + */ + private Integer enabledMark; + + /** + * 创建时间 + */ + private Date creatorTime; + + /** + * 创建用户 + */ + private String creatorUserId; + + /** + * 删除时间 + */ + private Date deleteTime; + + /** + * 删除用户 + */ + private String deleteUserId; + + /** + * 删除标志 + */ + private Integer deleteMark; + + /** + * 关联系统id + */ + private String systemId; +} + diff --git a/yunzhupaas-public/yunzhupaas-common-all/src/main/java/com/yunzhupaas/model/AppObjectDataModel.java b/yunzhupaas-public/yunzhupaas-common-all/src/main/java/com/yunzhupaas/model/AppObjectDataModel.java new file mode 100644 index 0000000..66e8a52 --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-common-all/src/main/java/com/yunzhupaas/model/AppObjectDataModel.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.model; + +import lombok.Data; + +@Data +public class AppObjectDataModel { + + private String id; + private boolean hasChildren; + private String fullName; + private String icon; + private String urlAddress; + private String parentId; + private Integer type; + private String propertyJson; + private boolean isData; + private String children; + private String iconBackground; + private String moduleId; + +} + diff --git a/yunzhupaas-public/yunzhupaas-common-all/src/main/java/com/yunzhupaas/model/LoginForm.java b/yunzhupaas-public/yunzhupaas-common-all/src/main/java/com/yunzhupaas/model/LoginForm.java new file mode 100644 index 0000000..edd591b --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-common-all/src/main/java/com/yunzhupaas/model/LoginForm.java @@ -0,0 +1,48 @@ +package com.yunzhupaas.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/16 8:49 + */ +@Data +public class LoginForm { + @Schema(description = "账号") + private String account; + @Schema(description = "密码") + private String password; + + /** + * 登录类型 + */ + @Schema(description = "登录类型") + private String grantType; + /** + * 验证码标识 + */ + @Schema(description = "验证码标识") + private String timestamp; + /** + * 来源类型 + */ + private String origin; + /** + * 验证码 + */ + @Schema(description = "验证码") + private String code; + + public LoginForm() { + } + + public LoginForm(String account, String password) { + this.account = account; + this.password = password; + } +} + diff --git a/yunzhupaas-public/yunzhupaas-common-all/src/main/java/com/yunzhupaas/model/app/AppMenuModel.java b/yunzhupaas-public/yunzhupaas-common-all/src/main/java/com/yunzhupaas/model/app/AppMenuModel.java new file mode 100644 index 0000000..e714b8c --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-common-all/src/main/java/com/yunzhupaas/model/app/AppMenuModel.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.model.app; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class AppMenuModel { + @Schema(description = "扩展字段") + private String propertyJson; + @Schema(description = "菜单编码") + private String enCode; + @Schema(description = "菜单名称") + private String fullName; + @Schema(description = "图标") + private String icon; + @Schema(description = "主键id") + private String id; + @Schema(description = "链接地址") + private String urlAddress; + +} + diff --git a/yunzhupaas-public/yunzhupaas-generater-base/pom.xml b/yunzhupaas-public/yunzhupaas-generater-base/pom.xml new file mode 100644 index 0000000..f802f5d --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-generater-base/pom.xml @@ -0,0 +1,28 @@ + + + 4.0.0 + + com.yunzhupaas + yunzhupaas-java-boot + 5.2.0-RELEASE + ../../pom.xml + + + yunzhupaas-generater-base + + + + com.yunzhupaas + yunzhupaas-provider + ${project.version} + + + com.yunzhupaas + yunzhupaas-visualdev-onlinedev-biz + ${project.version} + + + + diff --git a/yunzhupaas-public/yunzhupaas-generater-base/src/main/java/com/yunzhupaas/model/FieLdsModelExcel.java b/yunzhupaas-public/yunzhupaas-generater-base/src/main/java/com/yunzhupaas/model/FieLdsModelExcel.java new file mode 100644 index 0000000..264c493 --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-generater-base/src/main/java/com/yunzhupaas/model/FieLdsModelExcel.java @@ -0,0 +1,15 @@ +package com.yunzhupaas.model; + +import java.lang.annotation.*; + +@Documented +@Target({ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +public @interface FieLdsModelExcel { + + String fieLdsModel() default "{}"; + + String type() default "mast"; + +} + diff --git a/yunzhupaas-public/yunzhupaas-generater-base/src/main/java/com/yunzhupaas/model/GeneraterSwapModel.java b/yunzhupaas-public/yunzhupaas-generater-base/src/main/java/com/yunzhupaas/model/GeneraterSwapModel.java new file mode 100644 index 0000000..9f021d4 --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-generater-base/src/main/java/com/yunzhupaas/model/GeneraterSwapModel.java @@ -0,0 +1,32 @@ +package com.yunzhupaas.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@Schema(description="子表条件组合模型") +public class GeneraterSwapModel { + @Schema(description = "表单json") + private String formDataStr; + @Schema(description = "表列表") + private String tableList; + @Schema(description = "子表名称") + private String childTable; + @Schema(description = "菜单id") + private String menuId; + @Schema(description = "查询条件json") + private String queryJson; + @Schema(description = "高级查询条件json") + private String superQueryJson; + @Schema(description = "pc列表") + private String columnData; + @Schema(description = "app列表") + private String appColumnData; +} + diff --git a/yunzhupaas-public/yunzhupaas-generater-base/src/main/java/com/yunzhupaas/model/QueryAllModel.java b/yunzhupaas-public/yunzhupaas-generater-base/src/main/java/com/yunzhupaas/model/QueryAllModel.java new file mode 100644 index 0000000..bb28400 --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-generater-base/src/main/java/com/yunzhupaas/model/QueryAllModel.java @@ -0,0 +1,39 @@ +package com.yunzhupaas.model; + +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.yunzhupaas.database.model.superQuery.SuperJsonModel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.poi.ss.formula.functions.T; + +import java.util.List; +import java.util.Map; +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class QueryAllModel { + private MPJLambdaWrapper wrapper; + private Map classMap; + /** + * 数据过滤 + */ + private String ruleJson; + /** + * 高级查询 + */ + private String superJson; + /** + * 数据权限-通过菜单id查询 + */ + private String moduleId; + private String dbLink; + private String dbType; + /** + * 所有分组都放进来统一处理 + */ + private List> queryList; +} + diff --git a/yunzhupaas-public/yunzhupaas-generater-base/src/main/java/com/yunzhupaas/model/QueryModel.java b/yunzhupaas-public/yunzhupaas-generater-base/src/main/java/com/yunzhupaas/model/QueryModel.java new file mode 100644 index 0000000..e3f93a8 --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-generater-base/src/main/java/com/yunzhupaas/model/QueryModel.java @@ -0,0 +1,30 @@ +package com.yunzhupaas.model; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class QueryModel { + private QueryWrapper obj; + private Class entity; + private String queryJson; + private String moduleId; + private String dbLink; + private String dbType; + + public QueryModel(QueryWrapper obj, Class entity, String queryJsonOrModuleId, String dbLink) { + this.obj = obj; + this.entity = entity; + this.queryJson = queryJsonOrModuleId; + this.moduleId = queryJsonOrModuleId; + this.dbLink = dbLink; + } + +} + diff --git a/yunzhupaas-public/yunzhupaas-generater-base/src/main/java/com/yunzhupaas/util/GenUtil.java b/yunzhupaas-public/yunzhupaas-generater-base/src/main/java/com/yunzhupaas/util/GenUtil.java new file mode 100644 index 0000000..02a9e10 --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-generater-base/src/main/java/com/yunzhupaas/util/GenUtil.java @@ -0,0 +1,502 @@ +package com.yunzhupaas.util; + +import cn.hutool.json.JSONUtil; +import com.alibaba.fastjson.JSONArray; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import lombok.Data; +import org.apache.commons.lang3.StringUtils; + +import java.math.BigDecimal; +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Data +public class GenUtil { + /** + * 字段说明 + */ + private String fieldName; + /** + * 运算符 + */ + private String operator; + /** + * 逻辑拼接符号 + */ + private String logic; + /** + * 组件标识 + */ + private String yunzhupaasKey; + /** + * 字段key + */ + private String field; + /** + * 自定义的值 + */ + private String fieldValue; + /** + * 自定义的值2 + */ + private String fieldValue2; + + private List selectIgnore; + + /** + * 数据库类型 + */ + private String dbType; + /** + * 日期格式 + */ + private String format; + /** + * 数字精度 + */ + private String precision; + + + /** + * @param wrapper wrapper对象 + * @param fieldDb 数据库字段名实际包括前缀 + * @return + */ + public QueryWrapper solveValue(QueryWrapper wrapper, String fieldDb) { + MyType myType = myControl(yunzhupaasKey); + if ("||".equals(logic)) { + wrapper.or(); + } + if (fieldValue == null) { + fieldValue = ""; + } + try { + ArrayList splitKey = new ArrayList() {{ + add(YunzhupaasKeyConsts.DATE); + add(YunzhupaasKeyConsts.TIME); + add(YunzhupaasKeyConsts.NUM_INPUT); + add(YunzhupaasKeyConsts.CREATETIME); + add(YunzhupaasKeyConsts.MODIFYTIME); + }}; + if (splitKey.contains(yunzhupaasKey) && "between".equals(operator)) { + List data = JsonUtil.getJsonToList(fieldValue, String.class); + fieldValue = data.get(0); + fieldValue2 = data.get(1); + } + + + selectIgnore = new ArrayList() {{ + add(YunzhupaasKeyConsts.COMSELECT); + add(YunzhupaasKeyConsts.ADDRESS); + add(YunzhupaasKeyConsts.CASCADER); + add(YunzhupaasKeyConsts.CHECKBOX); + add(YunzhupaasKeyConsts.DEPSELECT); + }}; + + myType.judge(wrapper, fieldDb); + return wrapper; + } catch (Exception e) { + return wrapper; + } + + } + + /** + * 判断控件的所属类型 + * + * @param yunzhupaasKey 控件标识 + * @return 控件类型 + */ + public MyType myControl(String yunzhupaasKey) { + MyType myType = null; + switch (yunzhupaasKey) { + /** 基础 */ + case YunzhupaasKeyConsts.COM_INPUT: + case YunzhupaasKeyConsts.TEXTAREA: + case YunzhupaasKeyConsts.BILLRULE: + case YunzhupaasKeyConsts.POPUPTABLESELECT: + case YunzhupaasKeyConsts.RELATIONFORM: + case YunzhupaasKeyConsts.RELATIONFORM_ATTR: + case YunzhupaasKeyConsts.POPUPSELECT: + case YunzhupaasKeyConsts.POPUPSELECT_ATTR: + myType = new BasicControl(); + break; + // 数字类型 + case YunzhupaasKeyConsts.CALCULATE: + case YunzhupaasKeyConsts.NUM_INPUT: + myType = new NumControl(); + break; + // 日期类型 + case YunzhupaasKeyConsts.DATE: + case YunzhupaasKeyConsts.CREATETIME: + case YunzhupaasKeyConsts.MODIFYTIME: + myType = new DateControl(); + break; + // 时间类型 + case YunzhupaasKeyConsts.TIME: + myType = new TimeControl(); + break; + // 下拉类型 + default: + myType = new SelectControl(); + } + return myType; + } + + public void getNullWrapper(QueryWrapper wrapper, String fieldDb) { + if ("||".equals(logic)) { + wrapper.or(t -> { + t.isNull(fieldDb); + t.or().eq(fieldDb, ""); + t.or().eq(fieldDb, "[]"); + }); + } else { + wrapper.and(t -> { + t.isNull(fieldDb); + t.or().eq(fieldDb, ""); + t.or().eq(fieldDb, "[]"); + }); + } + } + + private void getNotNullWrapper(QueryWrapper wrapper, String fieldDb) { + if ("||".equals(logic)) { + wrapper.or(t -> { + t.isNotNull(fieldDb); + t.ne(fieldDb, ""); + t.ne(fieldDb, "[]"); + }); + } else { + wrapper.and(t -> { + t.isNotNull(fieldDb); + t.ne(fieldDb, ""); + t.ne(fieldDb, "[]"); + }); + } + } + + /** + * 基础类型 + */ + class BasicControl extends MyType { + + @Override + void judge(QueryWrapper wrapper, String fieldDb) { + switch (operator) { + case "null": + getNullWrapper(wrapper, fieldDb); + break; + case "notNull": + getNotNullWrapper(wrapper, fieldDb); + break; + case "==": + wrapper.eq(fieldDb, fieldValue); + break; + case "<>": + wrapper.ne(fieldDb, fieldValue); + break; + case "like": + wrapper.like(fieldDb, fieldValue); + break; + case "notLike": + wrapper.notLike(fieldDb, fieldValue); + break; + + } + } + } + + class NumControl extends MyType { + + + @Override + void judge(QueryWrapper wrapper, String fieldDb) { + BigDecimal num1 = new BigDecimal(fieldValue); + BigDecimal num2 = null; + if (fieldValue2 != null) { + num2 = new BigDecimal(fieldValue2); + } + // 精度处理 + String fieldPrecisionValue; + String fieldPrecisionValue2; + if (StringUtils.isNotBlank(precision)) { + String yunzhupaasNum = "0." + StringUtils.repeat("0", Integer.parseInt(precision)); + DecimalFormat numFormat = new DecimalFormat(yunzhupaasNum); + fieldPrecisionValue = numFormat.format(new BigDecimal(fieldValue)); + num1 = new BigDecimal(fieldPrecisionValue); + if (fieldValue2 != null) { + fieldPrecisionValue2 = numFormat.format(new BigDecimal(fieldValue2)); + num2 = new BigDecimal(fieldPrecisionValue2); + } + } + + switch (operator) { + case "null": + getNullWrapper(wrapper, fieldDb); + break; + case "notNull": + getNotNullWrapper(wrapper, fieldDb); + break; + case "==": + wrapper.eq(fieldDb, num1); + break; + case "<>": + wrapper.ne(fieldDb, num1); + break; + case ">": + wrapper.gt(fieldDb, num1); + + break; + case "<": + wrapper.lt(fieldDb, num1); + break; + case ">=": + wrapper.ge(fieldDb, num1); + break; + case "<=": + wrapper.le(fieldDb, num1); + break; + case "between": + wrapper.between(fieldDb, num1, num2); + break; + } + } + } + + class DateControl extends MyType { + @Override + void judge(QueryWrapper wrapper, String fieldDb) { + + Long time = null; + Long time2 = null; + Date date = new Date(); + Date date2 = new Date(); + if (StringUtils.isNoneBlank(fieldValue)) { + time = Long.valueOf(fieldValue); + date = new Date(time); + } + if (StringUtils.isNoneBlank(fieldValue2)) { + time2 = Long.valueOf(fieldValue2); + // 日期类型的要加上当天的23:59:59 + if (YunzhupaasKeyConsts.DATE.equals(yunzhupaasKey)) { + date2 = new Date(time2 + 60 * 60 * 24 * 1000 - 1000); + } else { + date2 = new Date(time2); + } + + } + + switch (operator) { + case "null": + getNullWrapper(wrapper, fieldDb); + break; + case "notNull": + getNotNullWrapper(wrapper, fieldDb); + break; + case "==": + if (YunzhupaasKeyConsts.DATE.equals(yunzhupaasKey)) { + wrapper.between(fieldDb, date, new Date(time + 60 * 60 * 24 * 1000)); + } else { + wrapper.eq(fieldDb, date); + } + + break; + case "<>": + wrapper.ne(fieldDb, date); + break; + case ">": + wrapper.gt(fieldDb, date); + break; + case "<": + wrapper.lt(fieldDb, date); + break; + case ">=": + wrapper.ge(fieldDb, date); + break; + case "<=": + wrapper.le(fieldDb, date); + break; + case "between": + wrapper.between(fieldDb, date, date2); + break; + } + } + + + } + + class TimeControl extends MyType { + @Override + void judge(QueryWrapper wrapper, String fieldDb) { + switch (operator) { + case "null": + getNullWrapper(wrapper, fieldDb); + + break; + case "notNull": + getNotNullWrapper(wrapper, fieldDb); + break; + case "==": + wrapper.eq(fieldDb, fieldValue); + break; + case "<>": + wrapper.ne(fieldDb, fieldValue); + break; + case ">": + wrapper.gt(fieldDb, fieldValue); + break; + case "<": + wrapper.lt(fieldDb, fieldValue); + break; + case ">=": + wrapper.ge(fieldDb, fieldValue); + break; + case "<=": + wrapper.le(fieldDb, fieldValue); + break; + case "between": + wrapper.between(fieldDb, fieldValue, fieldValue2); + break; + } + } + } + private ArrayList solveListValue(String fieldValue) { + ArrayList result = new ArrayList<>(); + try { + List list = JsonUtil.getJsonToList(fieldValue, List.class); + for (List listSub : list) { + result.add(JSONArray.toJSONString(listSub)); + // 组织选择需要取最后每个数组最后一个 + String value = (String)listSub.get(listSub.size() - 1); + result.add(value); + } + + }catch (Exception e){ + List list = JsonUtil.getJsonToList(fieldValue, String.class); + result.add(JSONArray.toJSONString(list)); + String value = list.get(list.size() - 1); + result.add(value); + } + return result; + } + /** + * 下拉控件类型 + */ + class SelectControl extends MyType { + + @Override + void judge(QueryWrapper wrapper, String fieldDb) { + List list = solveListValue(fieldValue); + if (StringUtils.isNoneBlank(fieldValue) && fieldValue.charAt(0) == '[' && !selectIgnore.contains(yunzhupaasKey)) { + list = JSONUtil.toList(fieldValue, String.class); + } + if (selectIgnore.contains(yunzhupaasKey) && StringUtils.isBlank(fieldValue)) { + fieldValue = "[]"; + } + + switch (operator) { + case "null": + getNullWrapper(wrapper, fieldDb); + + break; + case "notNull": + getNotNullWrapper(wrapper, fieldDb); + break; + case "==": + wrapper.eq(fieldDb, fieldValue); + break; + case "<>": + wrapper.ne(fieldDb, fieldValue); + break; + case "like": + wrapper.like(fieldDb, fieldValue); + break; + case "notLike": + wrapper.notLike(fieldDb, fieldValue); + break; + case "in": + if (list.size() > 0) { + List finalList = list; + if ("||".equals(logic)) { + wrapper.or(t -> { + if (finalList.size() > 0) { + for (int i = 0; i < finalList.size(); i++) { + String value = finalList.get(i); + if (i == 0) { + t.like(fieldDb, value); + } else { + t.or().like(fieldDb, value); + } + } + } + }); + } else { + wrapper.and(t -> { + if (finalList.size() > 0) { + for (int i = 0; i < finalList.size(); i++) { + String value = finalList.get(i); + if (i == 0) { + t.like(fieldDb, value); + } else { + t.or().like(fieldDb, value); + } + } + } + }); + } + if(YunzhupaasKeyConsts.CASCADER.equals(yunzhupaasKey) || YunzhupaasKeyConsts.COMSELECT.equals(yunzhupaasKey) || YunzhupaasKeyConsts.ADDRESS.equals(yunzhupaasKey)){ + getNotNullWrapper(wrapper,fieldDb); + } + + } + break; + case "notIn": + if (list.size() > 0) { + List finalList1 = list; + if ("||".equals(logic)) { + wrapper.or(t -> { + if (finalList1.size() > 0) { + for (int i = 0; i < finalList1.size(); i++) { + String value = finalList1.get(i); + if (i == 0) { + t.notLike(fieldDb, value); + } else { + t.notLike(fieldDb, value); + } + + } + } + }); + } else { + wrapper.and(t -> { + if (finalList1.size() > 0) { + for (int i = 0; i < finalList1.size(); i++) { + String value = finalList1.get(i); + if (i == 0) { + t.notLike(fieldDb, value); + } else { + t.notLike(fieldDb, value); + } + + } + } + }); + } + if(YunzhupaasKeyConsts.CASCADER.equals(yunzhupaasKey) || YunzhupaasKeyConsts.COMSELECT.equals(yunzhupaasKey) || YunzhupaasKeyConsts.ADDRESS.equals(yunzhupaasKey)){ + getNotNullWrapper(wrapper,fieldDb); + } + + } + break; + } + } + } + + abstract class MyType { + abstract void judge(QueryWrapper wrapper, String fieldDb); + } +} + diff --git a/yunzhupaas-public/yunzhupaas-generater-base/src/main/java/com/yunzhupaas/util/GeneraterSwapUtil.java b/yunzhupaas-public/yunzhupaas-generater-base/src/main/java/com/yunzhupaas/util/GeneraterSwapUtil.java new file mode 100644 index 0000000..525fc68 --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-generater-base/src/main/java/com/yunzhupaas/util/GeneraterSwapUtil.java @@ -0,0 +1,2570 @@ +package com.yunzhupaas.util; + +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.yunzhupaas.annotation.YunzhupaasField; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.*; +import com.yunzhupaas.base.model.ColumnDataModel; +import com.yunzhupaas.base.model.OnlineImport.ExcelImportModel; +import com.yunzhupaas.base.model.OnlineImport.ImportDataModel; +import com.yunzhupaas.base.model.OnlineImport.ImportFormCheckUniqueModel; +import com.yunzhupaas.base.model.OnlineImport.VisualdevModelDataInfoVO; +import com.yunzhupaas.base.model.datainterface.DataInterfaceActionVo; +import com.yunzhupaas.base.model.datainterface.DataInterfaceModel; +import com.yunzhupaas.base.model.datainterface.DataInterfacePage; +import com.yunzhupaas.base.model.filter.RuleInfo; +import com.yunzhupaas.base.service.*; +import com.yunzhupaas.base.util.*; +import com.yunzhupaas.base.util.common.DataControlUtils; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.constant.PermissionConst; +import com.yunzhupaas.database.model.entity.DbLinkEntity; +import com.yunzhupaas.database.model.superQuery.ConditionJsonModel; +import com.yunzhupaas.database.model.superQuery.SuperJsonModel; +import com.yunzhupaas.database.model.superQuery.SuperQueryConditionModel; +import com.yunzhupaas.database.model.superQuery.SuperQueryJsonModel; +import com.yunzhupaas.database.util.ConnUtil; +import com.yunzhupaas.database.util.DynamicDataSourceUtil; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.TaskEntity; +import com.yunzhupaas.flowable.entity.TemplateJsonEntity; +import com.yunzhupaas.model.ExcelModel; +import com.yunzhupaas.model.OnlineDevData; +import com.yunzhupaas.model.QueryAllModel; +import com.yunzhupaas.model.visualJson.FieLdsModel; +import com.yunzhupaas.model.visualJson.FormDataModel; +import com.yunzhupaas.model.visualJson.TableModel; +import com.yunzhupaas.model.visualJson.TemplateJsonModel; +import com.yunzhupaas.model.visualJson.config.ConfigModel; +import com.yunzhupaas.model.visualJson.config.RuleConfig; +import com.yunzhupaas.onlinedev.model.OnlineDevEnum.CacheKeyEnum; +import com.yunzhupaas.onlinedev.model.PaginationModelExport; +import com.yunzhupaas.onlinedev.model.VisualErrInfo; +import com.yunzhupaas.onlinedev.service.VisualDevInfoService; +import com.yunzhupaas.onlinedev.service.VisualdevModelDataService; +import com.yunzhupaas.onlinedev.util.onlineDevUtil.OnlineDevListUtils; +import com.yunzhupaas.onlinedev.util.onlineDevUtil.OnlineProductSqlUtils; +import com.yunzhupaas.onlinedev.util.onlineDevUtil.OnlinePublicUtils; +import com.yunzhupaas.onlinedev.util.onlineDevUtil.OnlineSwapDataUtils; +import com.yunzhupaas.permission.entity.*; +import com.yunzhupaas.permission.service.*; +import com.yunzhupaas.util.context.RequestContext; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import com.yunzhupaas.workflow.service.TaskApi; +import com.yunzhupaas.workflow.service.TemplateApi; +import lombok.Cleanup; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.io.IOException; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; +import java.math.BigDecimal; +import java.sql.Connection; +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.stream.Collectors; + +import static com.yunzhupaas.util.Constants.ADMIN_KEY; + +/** + * 数据转换(代码生成器用) + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/3/16 + */ +@Component +public class GeneraterSwapUtil { + + @Autowired + private OrganizeService organizeService; + + @Autowired + private FilterService filterService; + + @Autowired + private PositionService positionService; + + @Autowired + private UserService userService; + + @Autowired + private VisualdevService visualdevService; + + @Autowired + private VisualDevInfoService visualDevInfoService; + + @Autowired + private DataInterfaceService dataInterfaceService; + + @Autowired + private VisualdevModelDataService visualdevModelDataService; + + @Autowired + private ProvinceService provinceService; + + @Autowired + private DictionaryDataService dictionaryDataService; + + @Autowired + private BillRuleService billRuleService; + + @Autowired + private VisualBillUtil visualBillUtil; + + @Autowired + private GroupService groupService; + + @Autowired + private RoleService roleService; + + @Autowired + private DbLinkService dbLinkService; + + @Autowired + private UserRelationService userRelationService; + + @Autowired + private FlowFormDataUtil flowFormDataUtil; + + @Autowired + private DbLinkService dblinkService; + + @Autowired + private OnlineSwapDataUtils swapDataUtils; + + @Autowired + private RedisUtil redisUtil; + + @Autowired + private AuthorizeService authorizeService; + + @Autowired + private ModuleService moduleService; + + // 以下新的流程api + @Autowired + private TaskApi taskApi; + + @Autowired + private TemplateApi templateApi; + @Autowired + private FormCheckUtils formCheckUtils; + + public final String regEx = "[\\[\\]\"]"; + + private static long DEFAULT_CACHE_TIME = 60 * 5; + + /** + * 日期时间戳字符串转换 + * + * @param date + * @param format + * @return + */ + public String dateSwap(String date, String format) { + if (StringUtil.isNotEmpty(date)) { + DateTimeFormatter ftf = DateTimeFormatter.ofPattern(format); + if (date.contains(",")) { + String[] dates = date.split(","); + long time1 = Long.parseLong(dates[0]); + long time2 = Long.parseLong(dates[1]); + String value1 = ftf + .format(LocalDateTime.ofInstant(Instant.ofEpochMilli(time1), ZoneId.systemDefault())); + String value2 = ftf + .format(LocalDateTime.ofInstant(Instant.ofEpochMilli(time2), ZoneId.systemDefault())); + return value1 + "至" + value2; + } + long time = Long.parseLong(date); + String value = ftf.format(LocalDateTime.ofInstant(Instant.ofEpochMilli(time), ZoneId.systemDefault())); + return value; + } + return date; + } + + /** + * 行政区划转换 + * + * @param data + * @return + */ + public String provinceData(String data, Map localCache) { + Map proMap = new HashMap<>(); + if (localCache != null && localCache.containsKey("__pro_map")) { + proMap = (Map) localCache.get("__pro_map"); + } + if (StringUtil.isNotEmpty(data)) { + try { + if (data.contains("[[")) { + List addList = new ArrayList<>(); + String[][] provinceDataS = JsonUtil.getJsonToBean(data, String[][].class); + for (String[] AddressData : provinceDataS) { + List provList = new ArrayList(Arrays.asList(AddressData)); + List nameList = new ArrayList<>(); + if (localCache != null) { + for (String info : provList) { + nameList.add(proMap.get(info)); + } + } else { + List proList = provinceService.getProList(provList); + for (ProvinceEntity info : proList) { + nameList.add(info.getFullName()); + } + } + addList.add(String.join("/", nameList)); + } + return String.join(";", addList); + } else if (data.contains("[")) { + List provList = JsonUtil.getJsonToList(data, String.class); + List nameList = new ArrayList<>(); + if (localCache != null) { + for (String info : provList) { + nameList.add(proMap.get(info)); + } + } else { + List proList = provinceService.getProList(provList); + for (ProvinceEntity info : proList) { + nameList.add(info.getFullName()); + } + } + return String.join("/", nameList); + } else { + String[] strs = data.split(","); + List provList = new ArrayList(Arrays.asList(strs)); + List proNameList = new ArrayList<>(); + if (localCache != null) { + for (String info : provList) { + proNameList.add(proMap.get(info)); + } + } else { + List proList = provinceService.getProList(provList); + for (ProvinceEntity info : proList) { + proNameList.add(info.getFullName()); + } + } + return String.join("/", proNameList); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + return ""; + } + + public Map localCache() { + // 公共数据 + String dsName = Optional.ofNullable(TenantHolder.getDatasourceId()).orElse(""); + Map localCache = new HashMap<>(); + if (!localCache.containsKey("__pro_map")) { + // 省市区 + Map proMap = redisUtil.getMap(String.format("%s-%s-%d", dsName, "province", 1)); + List> proMapList = new ArrayList<>(); + if (proMap.size() == 0) { + // 分级存储 + for (int i = 1; i <= 4; i++) { + String redisKey = String.format("%s-%s-%d", dsName, "province", i); + if (!redisUtil.exists(redisKey)) { + List provinceEntityList = provinceService.getProListBytype(String.valueOf(i)); + Map provinceMap = new HashMap<>(16); + if (provinceEntityList != null) { + provinceEntityList.stream().forEach(p -> provinceMap.put(p.getId(), p.getFullName())); + } + proMapList.add(provinceMap); + // 区划基本不修改 不做是否缓存判断 + redisUtil.insert(redisKey, provinceMap, RedisUtil.CAHCEWEEK); + } + } + } else { + for (int i = 1; i <= 4; i++) { + proMapList.add(redisUtil.getMap(String.format("%s-%s-%d", dsName, "province", i))); + } + } + + Map proMapr = new HashMap<>(); + proMapList.forEach(item -> proMapr.putAll(item)); + localCache.put("__pro_map", proMapr); + } + return localCache; + } + + /** + * 公司部门id转名称 + * + * @param value + * @return + */ + public String comSelectValue(String value, String showLevel) { + if (StringUtil.isNotEmpty(String.valueOf(value))) { + OrganizeEntity organizeEntity = organizeService.getInfo(String.valueOf(value)); + if ("all".equals(showLevel)) { + List organizeListAll = organizeService.getList(false); + String[] organizeTreeId = StringUtil.isNotEmpty(organizeEntity.getOrganizeIdTree()) + ? organizeEntity.getOrganizeIdTree().split(",") + : new String[] {}; + List organizeTreeList = Arrays.asList(organizeTreeId).stream().filter(t -> !t.isEmpty()) + .collect(Collectors.toList()); + StringJoiner joiner = new StringJoiner("/"); + for (int i = 0; i < organizeTreeList.size(); i++) { + String id = organizeTreeList.get(i); + OrganizeEntity entity = organizeListAll.stream().filter(t -> t.getId().equals(id)).findFirst() + .orElse(null); + if (entity != null) { + joiner.add(entity.getFullName()); + } + } + value = joiner.toString(); + } else { + if (organizeEntity != null) { + if (organizeEntity.getCategory().equals("company")) { + return " "; + } + value = organizeEntity.getFullName(); + } + } + } else { + value = " "; + } + return value; + } + + /** + * 公司部门id转名称(多选) + * + * @param ids + * @return + */ + public String comSelectValues(String ids, Boolean mul) { + List comValueList = new ArrayList<>(); + if (StringUtil.isEmpty(ids)) { + return null; + } + String Separator = mul ? "," : "/"; + if (ids.contains("[[")) { + String[][] idArrays = JsonUtil.getJsonToBean(ids, String[][].class); + for (String[] array : idArrays) { + List idList = new ArrayList<>(); + for (String s : array) { + OrganizeEntity info = organizeService.getInfo(s); + idList.add(Objects.nonNull(info) ? info.getFullName() : s); + } + String orgCom = idList.stream().collect(Collectors.joining("/")); + comValueList.add(orgCom); + } + return comValueList.stream().collect(Collectors.joining(";")); + } else if (ids.contains("[")) { + List idList = JsonUtil.getJsonToList(ids, String.class); + List nameList = new ArrayList<>(); + for (String orgId : idList) { + OrganizeEntity info = organizeService.getInfo(orgId); + nameList.add(Objects.nonNull(info) ? info.getFullName() : orgId); + } + return nameList.stream().collect(Collectors.joining(Separator)); + } else { + ids = ids.replaceAll("\"", ""); + String[] idList = ids.split(","); + if (idList.length > 0) { + List comSelectList = new ArrayList<>(); + for (String id : idList) { + OrganizeEntity organizeEntity = organizeService.getInfo(id); + if (organizeEntity != null) { + comSelectList.add(organizeEntity.getFullName()); + } + } + return String.join(",", comSelectList); + } + } + return null; + } + + /** + * 岗位id转名称 + * + * @param id + * @return + */ + public String posSelectValue(String id) { + if (StringUtil.isNotEmpty(id)) { + PositionEntity positionApiInfo = positionService.getInfo(id); + if (ObjectUtil.isNotEmpty(positionApiInfo)) { + return positionApiInfo.getFullName(); + } + return id; + } + return " "; + } + + /** + * 岗位id转名称(多选) + * + * @param ids + * @return + */ + public String posSelectValues(String ids) { + if (StringUtil.isEmpty(ids)) { + return ""; + } + List posList = new ArrayList<>(); + if (ids.contains("[")) { + List idList = JsonUtil.getJsonToList(ids, String.class); + List nameList = new ArrayList<>(); + for (String orgId : idList) { + PositionEntity info = positionService.getInfo(orgId); + nameList.add(Objects.nonNull(info) ? info.getFullName() : orgId); + } + posList = nameList; + } else { + String[] idList = ids.split(","); + if (idList.length > 0) { + for (String id : idList) { + PositionEntity positionEntity = positionService.getInfo(id); + if (ObjectUtil.isNotEmpty(positionEntity)) { + posList.add(positionEntity.getFullName()); + } + } + } + } + return String.join(",", posList); + } + + /** + * 用户id转名称 + * + * @param id + * @return + */ + public String userSelectValue(String id) { + if (StringUtil.isNotEmpty(id)) { + UserEntity userEntity = userService.getInfo(id); + if (ObjectUtil.isNotEmpty(userEntity)) { + return userEntity.getRealName() + "/" + userEntity.getAccount(); + } + return id; + } + return ""; + } + + /** + * 用户id转名称(多选) + * + * @param ids + * @return + */ + public String userSelectValues(String ids) { + // 公共数据 + String dsName = Optional.ofNullable(TenantHolder.getDatasourceId()).orElse(""); + // 人员 + String redisKey = dsName + CacheKeyEnum.USER.getName(); + Map userMap; + if (redisUtil.exists(redisKey)) { + userMap = redisUtil.getMap(redisKey); + userMap = Optional.ofNullable(userMap).orElse(new HashMap<>(20)); + } else { + userMap = userService.getUserMap(); + redisUtil.insert(redisKey, userMap, DEFAULT_CACHE_TIME); + } + + if (StringUtil.isEmpty(ids)) { + return ids; + } + if (ids.contains("[")) { + List nameList = new ArrayList<>(); + List jsonToList = JsonUtil.getJsonToList(ids, String.class); + for (String userId : jsonToList) { + nameList.add(Objects.nonNull(userMap.get(userId)) ? userMap.get(userId).toString() : userId); + } + return String.join(";", nameList); + } else { + List userInfoList = new ArrayList<>(); + String[] idList = ids.split(","); + if (idList.length > 0) { + for (String userId : idList) { + userInfoList.add(Objects.nonNull(userMap.get(userId)) ? userMap.get(userId).toString() : userId); + } + } + return String.join("-", userInfoList); + } + } + + /** + * 用户组件id转名称(多选) + * + * @param ids + * @return + */ + public String usersSelectValues(String ids) { + if (StringUtil.isEmpty(ids)) { + return ids; + } + List dataNoSwapInMethod = OnlinePublicUtils.getDataNoSwapInMethod(ids); + StringJoiner valueJoin = new StringJoiner(","); + for (String data : dataNoSwapInMethod) { + String id = data.contains("--") ? data.substring(0, data.lastIndexOf("--")) : data; + String type = data.contains("--") ? data.substring(data.lastIndexOf("--") + 2) : ""; + switch (type) { + case "role": + RoleEntity roleEntity = roleService.getInfo(id); + if (roleEntity != null) { + valueJoin.add(roleEntity.getFullName()); + } else { + valueJoin.add(data); + } + break; + case "position": + PositionEntity positionEntity = positionService.getInfo(id); + if (positionEntity != null) { + valueJoin.add(positionEntity.getFullName()); + } else { + valueJoin.add(data); + } + break; + case "company": + case "department": + OrganizeEntity organizeEntity = organizeService.getInfo(id); + if (organizeEntity != null) { + valueJoin.add(organizeEntity.getFullName()); + } else { + valueJoin.add(data); + } + break; + case "group": + GroupEntity groupEntity = groupService.getInfo(id); + if (groupEntity != null) { + valueJoin.add(groupEntity.getFullName()); + } else { + valueJoin.add(data); + } + break; + case "user": + default: + UserEntity userEntity = userService.getInfo(id); + if (userEntity != null) { + valueJoin.add(userEntity.getRealName() + "/" + userEntity.getAccount()); + } else { + valueJoin.add(data); + } + break; + } + } + return valueJoin.toString(); + } + + /** + * 开关 + * + * @param data + * @return + */ + public String switchSelectValue(String data, String activeTxt, String inactiveTxt) { + if (StringUtil.isNotEmpty(data)) { + if (data.equals("0") || data.equals("false")) { + return inactiveTxt; + } else if (data.equals("1") || data.equals("true")) { + return activeTxt; + } else { + return data; + } + } + return null; + } + + public VisualdevEntity visualdevEntity(String id) { + return visualdevService.getInfo(id); + } + + /** + * 关联表单数据转换 + * + * @param vmodel + * @param value + * @param modelId + * @return + */ + public String swapRelationFormValue(String vmodel, String value, String modelId, Map formDataMaps) { + if (StringUtil.isEmpty(value)) { + return ""; + } + try { + VisualdevModelDataInfoVO infoVO = null; + VisualdevEntity entity = visualdevService.getInfo(modelId); + if (!StringUtil.isEmpty(entity.getVisualTables()) + && !OnlineDevData.TABLE_CONST.equals(entity.getVisualTables())) { + infoVO = visualDevInfoService.getDetailsDataInfo(value, entity); + } else { + infoVO = visualdevModelDataService.infoDataChange(value, entity); + } + if (infoVO != null) { + Map formDataMap = infoVO.getData() != null ? JsonUtil.stringToMap(infoVO.getData()) + : new HashMap<>(); + if (formDataMap.size() > 0) { + formDataMaps.putAll(formDataMap); + formDataMap = OnlinePublicUtils.mapKeyToLower(formDataMap); + value = String.valueOf(formDataMap.get(vmodel.toLowerCase())); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return value; + } + + /** + * 弹窗 + * + * @param interfaceId + * @param propsValue + * @param relationField + * @param dataValue + * @return + */ + public String getPopupSelectValue(String interfaceId, String propsValue, String relationField, String dataValue, + Map dataMaps, String json, int num, Map dataAll) { + if (StringUtil.isEmpty(interfaceId)) { + return null; + } + List list = JsonUtil.getJsonToList(json, TemplateJsonModel.class); + Map infoMap = new HashMap<>(); + List listParam = new ArrayList<>(); + for (TemplateJsonModel templateJsonModel : list) { + DataInterfaceModel dataInterfaceModel = JsonUtil.getJsonToBean(templateJsonModel, DataInterfaceModel.class); + String defaultV = ""; + if (StringUtil.isNotEmpty(templateJsonModel.getRelationField())) { + String[] mastTable = templateJsonModel.getRelationField().split("_yunzhupaas_"); + String[] child = templateJsonModel.getRelationField().split("-"); + if (mastTable.length > 1) { + if (dataAll.get(mastTable[0]) instanceof Map) { + Map mastTableData = (Map) dataAll.get(mastTable[0]); + infoMap.put(templateJsonModel.getField(), String.valueOf(mastTableData.get(mastTable[1]))); + defaultV = String.valueOf(mastTableData.get(mastTable[1])); + } + } else if (child.length > 1) { + if (dataAll.get(child[0]) instanceof List) { + List> chidList = (List>) dataAll.get(child[0]); + for (int i = 0; i < chidList.size(); i++) { + Map objectMap = chidList.get(i); + if (i == num) { + infoMap.put(templateJsonModel.getField(), String.valueOf(objectMap.get(child[1]))); + defaultV = String.valueOf(objectMap.get(child[1])); + } + } + } + } else { + infoMap.put(templateJsonModel.getField(), + String.valueOf(dataAll.get(templateJsonModel.getRelationField()))); + defaultV = String.valueOf(String.valueOf(dataAll.get(templateJsonModel.getRelationField()))); + } + } + dataInterfaceModel.setDefaultValue(defaultV); + listParam.add(dataInterfaceModel); + } + if (StringUtil.isNotEmpty(dataValue)) { + // Object data = dataInterfaceService.infoToId(interfaceId, null, + // infoMap).getData(); + // List> dataInterfaceDataList; + // if (data instanceof ActionResult) { + // ActionResult actionVo = (ActionResult) data; + // dataInterfaceDataList = (List>) actionVo.getData(); + // } else { + // dataInterfaceDataList = (List>) data; + // } + DataInterfacePage dataInterfacePage = new DataInterfacePage(); + dataInterfacePage.setParamList(listParam); + dataInterfacePage.setInterfaceId(interfaceId); + List ids = new ArrayList<>(); + if (dataValue.startsWith("[")) { + ids = JsonUtil.getJsonToList(dataValue, String.class); + } else { + ids.add(dataValue); + } + dataInterfacePage.setIds(ids); + dataInterfacePage.setPropsValue(propsValue); + dataInterfacePage.setRelationField(relationField); + List> dataInterfaceDataList = dataInterfaceService.infoToInfo(interfaceId, + dataInterfacePage); + if (dataValue.contains("[")) { + List valueList = JsonUtil.getJsonToList(dataValue, String.class); + List swapValue = new ArrayList<>(); + for (String va : valueList) { + dataInterfaceDataList.stream().filter(map -> map.get(propsValue).equals(va)).forEach( + modelMap -> swapValue.add(String.valueOf(modelMap.get(relationField)))); + } + return swapValue.stream().collect(Collectors.joining(",")); + } + if (dataInterfaceDataList != null) { + Map dataMap = dataInterfaceDataList.stream() + .filter(d -> d.get(propsValue).equals(dataValue)).findFirst().orElse(null); + if (dataMap != null) { + dataMaps.putAll(dataMap); + return String.valueOf(dataMap.get(relationField)); + } + } + return null; + } else { + return null; + } + } + + /** + * 弹窗 + * + * @param interfaceId + * @param propsValue + * @param relationField + * @param dataValue + * @return + */ + public String getPopupSelectValue(String interfaceId, String propsValue, String relationField, String dataValue, + Map dataMaps) { + if (StringUtil.isEmpty(interfaceId)) { + return null; + } + if (StringUtil.isNotEmpty(dataValue)) { + Object data = dataInterfaceService.infoToId(interfaceId, null, null).getData(); + List> dataInterfaceDataList; + if (data instanceof ActionResult) { + ActionResult actionVo = (ActionResult) data; + dataInterfaceDataList = (List>) actionVo.getData(); + } else { + dataInterfaceDataList = (List>) data; + } + if (dataValue.contains("[")) { + List valueList = JsonUtil.getJsonToList(dataValue, String.class); + List swapValue = new ArrayList<>(); + for (String va : valueList) { + dataInterfaceDataList.stream().filter(map -> map.get(propsValue).equals(va)).forEach( + modelMap -> swapValue.add(String.valueOf(modelMap.get(relationField)))); + } + return swapValue.stream().collect(Collectors.joining(",")); + } + Map dataMap = dataInterfaceDataList.stream() + .filter(d -> d.get(propsValue).equals(dataValue)).findFirst().orElse(null); + if (dataMap != null) { + dataMaps.putAll(dataMap); + return String.valueOf(dataMap.get(relationField)); + } + return null; + } else { + return null; + } + } + + public String getFileNameInJson(String fileJson) { + if (StringUtil.isNotEmpty(fileJson) && !"null".equals(fileJson)) { + return fileJson; + } + return ""; + } + + /** + * 获取数据字典数据 + * + * @param feild + * @return + */ + public String getDicName(String feild, String dictionaryTypeId) { + if (StringUtil.isNotEmpty(feild)) { + // 去除中括号以及双引号 + feild = feild.replaceAll(regEx, ""); + // 判断多选框 + String[] feilds = feild.split(","); + if (feilds.length > 1) { + StringBuilder feildsValue = new StringBuilder(); + DictionaryDataEntity dictionaryDataEntity; + for (String feil : feilds) { + dictionaryDataEntity = dictionaryDataService.getSwapInfo(feil, dictionaryTypeId); + if (dictionaryDataEntity != null) { + feildsValue.append(dictionaryDataEntity.getFullName() + ","); + } else { + feildsValue.append(feil + ","); + } + } + String finalValue; + if (StringUtil.isEmpty(feildsValue) || feildsValue.equals("")) { + finalValue = feildsValue.toString(); + } else { + finalValue = feildsValue.substring(0, feildsValue.length() - 1); + } + return finalValue; + } + DictionaryDataEntity dictionaryDataentity = dictionaryDataService.getSwapInfo(feild, dictionaryTypeId); + if (dictionaryDataentity != null) { + return dictionaryDataentity.getFullName(); + } + return feild; + } + if (StringUtil.isNotEmpty(feild)) { + List dicList = dictionaryDataService.getDicList(dictionaryTypeId); + } + return feild; + } + + /** + * 获取数据字典数据- + * + * @param feild + * @param keyName id或encode + * @return + */ + public String getDicName(String feild, String dictionaryTypeId, String keyName, boolean isMultiple, + String separator) { + Object dataConversion = ""; + String redisKey = dictionaryTypeId + "-" + feild + "-" + keyName; + if (StringUtil.isNotEmpty(feild)) { + List dicList; + if (redisUtil.exists(redisKey)) { + List tmpList = redisUtil.get(redisKey, 0, -1); + dicList = JsonUtil.getJsonToList(tmpList, DictionaryDataEntity.class); + } else { + dicList = dictionaryDataService.getDicList(dictionaryTypeId); + redisUtil.insert(redisKey, dicList, DEFAULT_CACHE_TIME); + } + Map idMap = new HashMap<>(dicList.size()); + Map enCodeMap = new HashMap<>(dicList.size()); + for (DictionaryDataEntity dd : dicList) { + idMap.put(dd.getId(), dd.getFullName()); + enCodeMap.put(dd.getEnCode(), dd.getFullName()); + } + if (StringUtil.isNotEmpty(separator)) { + separator = "/"; + } + if ("enCode".equals(keyName)) { + dataConversion = FormPublicUtils.getDataConversion(enCodeMap, feild, isMultiple, separator); + } else { + dataConversion = FormPublicUtils.getDataConversion(idMap, feild, isMultiple, separator); + } + } + return dataConversion.toString(); + } + + /** + * 获取远端数据 + * + * @param urlId + * @param label + * @param value + * @param feildValue + * @return + * @throws IOException + */ + public String getDynName(String urlId, String label, String value, String feildValue, String json, int num, + Map dataAll) { + List list = JsonUtil.getJsonToList(json, TemplateJsonModel.class); + Map infoMap = list.size() > 0 ? new HashMap<>() : null; + for (TemplateJsonModel templateJsonModel : list) { + if (StringUtil.isNotEmpty(templateJsonModel.getRelationField())) { + String[] mastTable = templateJsonModel.getRelationField().split("_yunzhupaas_"); + String[] child = templateJsonModel.getRelationField().split("-"); + if (mastTable.length > 1) { + if (dataAll.get(mastTable[0]) instanceof Map) { + Map mastTableData = (Map) dataAll.get(mastTable[0]); + infoMap.put(templateJsonModel.getField(), String.valueOf(mastTableData.get(mastTable[1]))); + } + } else if (child.length > 1) { + if (dataAll.get(child[0]) instanceof List) { + List> chidList = (List>) dataAll.get(child[0]); + for (int i = 0; i < chidList.size(); i++) { + Map objectMap = chidList.get(i); + if (i == num) { + infoMap.put(templateJsonModel.getField(), String.valueOf(objectMap.get(child[1]))); + } + } + } + } else { + infoMap.put(templateJsonModel.getField(), + String.valueOf(dataAll.get(templateJsonModel.getRelationField()))); + } + } + } + if (StringUtil.isNotEmpty(feildValue)) { + // 去除中括号以及双引号 + feildValue = feildValue.replaceAll(regEx, ""); + // 获取远端数据 + Map a = new HashMap<>(); + ActionResult object = dataInterfaceService.infoToId(urlId, null, infoMap); + if (object.getData() != null && object.getData() instanceof DataInterfaceActionVo) { + DataInterfaceActionVo vo = (DataInterfaceActionVo) object.getData(); + List> dataList = (List>) vo.getData(); + // 判断是否多选 + String[] feildValues = feildValue.split(","); + if (feildValues.length > 0) { + // 转换的真实值 + StringBuilder feildVa = new StringBuilder(); + for (String feild : feildValues) { + for (Map data : dataList) { + if (String.valueOf(data.get(value)).equals(feild)) { + feildVa.append(data.get(label) + ","); + } + } + } + String finalValue; + if (StringUtil.isEmpty(feildVa) || feildVa.equals("")) { + finalValue = feildVa.toString(); + } else { + finalValue = feildVa.substring(0, feildVa.length() - 1); + } + return finalValue; + } + for (Map data : dataList) { + if (feildValue.equals(String.valueOf(data.get(value)))) { + return data.get(label).toString(); + } + return feildValue; + } + } + return feildValue; + } + return feildValue; + } + + /** + * 获取远端数据 + * + * @param urlId + * @param name + * @param id + * @param children + * @param feildValue + * @return + */ + public String getDynName(String urlId, String name, String id, String children, String feildValue, boolean mul) { + List result = new ArrayList<>(); + String sep = ","; + if (mul) { + sep = "/"; + } + if (StringUtil.isNotEmpty(feildValue)) { + Map a = new HashMap<>(); + ActionResult object = dataInterfaceService.infoToId(urlId, null, null); + List> dataList = (List>) object.getData(); + // if (actionVo.getData() instanceof List) { + // dataList = (List>) actionVo.getData(); + // } + JSONArray dataAll = JsonUtil.getListToJsonArray(dataList); + List> list = new ArrayList<>(); + treeToList(id, name, children, dataAll, list); + String value = feildValue.replaceAll("\\[", "").replaceAll("\\]", ""); + Map resultMap = new HashMap<>(); + list.stream().forEach(t -> { + resultMap.put(String.valueOf(t.get(id)), String.valueOf(t.get(name))); + }); + + if (feildValue.startsWith("[[")) { + String[][] fv = JsonUtil.getJsonToBean(feildValue, String[][].class); + StringJoiner f1 = new StringJoiner(","); + for (String[] f : fv) { + StringJoiner v1 = new StringJoiner("/"); + for (String v : f) { + v1.add(resultMap.get(v)); + } + f1.add(v1.toString()); + } + return f1.toString(); + } else if (feildValue.startsWith("[")) { + List fvs = JsonUtil.getJsonToList(feildValue, String.class); + return fvs.stream().map(m -> resultMap.get(m)).collect(Collectors.joining(sep)); + } else { + return resultMap.get(feildValue); + } + } + return feildValue; + } + + /** + * 获取远端数据 + * + * @param urlId + * @param name + * @param id + * @param children + * @param feildValue + * @param mul 是否多选 + * @param isFullPath 全路径 + * @return + */ + public String getDynName(String urlId, String name, String id, String children, String feildValue, boolean mul, + boolean isFullPath, String json, int num, Map dataAll1) { + List list = JsonUtil.getJsonToList(json, TemplateJsonModel.class); + Map infoMap = list.size() > 0 ? new HashMap<>() : null; + for (TemplateJsonModel templateJsonModel : list) { + if (StringUtil.isNotEmpty(templateJsonModel.getRelationField())) { + String[] mastTable = templateJsonModel.getRelationField().split("_yunzhupaas_"); + String[] child = templateJsonModel.getRelationField().split("-"); + if (mastTable.length > 1) { + if (dataAll1.get(mastTable[0]) instanceof Map) { + Map mastTableData = (Map) dataAll1.get(mastTable[0]); + infoMap.put(templateJsonModel.getField(), String.valueOf(mastTableData.get(mastTable[1]))); + } + } else if (child.length > 1) { + if (dataAll1.get(child[0]) instanceof List) { + List> chidList = (List>) dataAll1.get(child[0]); + for (int i = 0; i < chidList.size(); i++) { + Map objectMap = chidList.get(i); + if (i == num) { + infoMap.put(templateJsonModel.getField(), String.valueOf(objectMap.get(child[1]))); + } + } + } + } else { + infoMap.put(templateJsonModel.getField(), + String.valueOf(dataAll1.get(templateJsonModel.getRelationField()))); + } + } + } + + if (StringUtil.isNotEmpty(feildValue)) { + Map a = new HashMap<>(); + ActionResult data = dataInterfaceService.infoToId(urlId, null, infoMap); + List> dataList = (List>) data.getData(); + JSONArray dataAll = JsonUtil.getListToJsonArray(dataList); + List> datalist = new ArrayList<>(); + treeToList(id, name, children, dataAll, datalist); + String value = feildValue.replaceAll("\\[", "").replaceAll("\\]", ""); + Map resultMap = new HashMap<>(); + datalist.stream().forEach(t -> { + resultMap.put(String.valueOf(t.get(id)), String.valueOf(t.get(name))); + }); + Object dataConversion = FormPublicUtils.getDataConversion(resultMap, feildValue, mul, "/"); + feildValue = String.valueOf(dataConversion); + } + return feildValue; + } + + /** + * 树转成list + **/ + private void treeToList(String id, String fullName, String children, JSONArray data, + List> result) { + if (data != null) { + for (int i = 0; i < data.size(); i++) { + JSONObject ob = data.getJSONObject(i); + Map tree = new HashMap<>(16); + tree.put(id, String.valueOf(ob.get(id))); + tree.put(fullName, String.valueOf(ob.get(fullName))); + result.add(tree); + if (ob.get(children) != null) { + JSONArray childArray = ob.getJSONArray(children); + treeToList(id, fullName, children, childArray, result); + } + } + } + } + + /** + * 生成单据规则 + * + * @param encode + * @param isCache + * @return + * @throws DataException + */ + @DS("") + public String getBillNumber(String encode, Boolean isCache) throws DataException { + return billRuleService.getBillNumber(encode, isCache); + } + + /** + * 生成单据规则方法2(表单内单据配置) + * + * @param visualId 功能id + * @param ruleId 规则id + * @param ruleJson 规则josn + * @param obj 表单数据(联动用) + * @return + * @throws DataException + */ + @DS("") + public String getBillNumber2(String visualId, String ruleId, String ruleJson, Object obj) throws DataException { + Map dataMap = JsonUtil.entityToMap(obj); + FieLdsModel fieLdsModel = new FieLdsModel(); + ConfigModel config = new ConfigModel(); + config.setRuleType(2); + config.setYunzhupaasKey(YunzhupaasKeyConsts.BILLRULE); + config.setFormId(ruleId); + RuleConfig ruleConfig = JsonUtil.getJsonToBean(ruleJson, RuleConfig.class); + config.setRuleConfig(ruleConfig); + fieLdsModel.setConfig(config); + Object billNumber = visualBillUtil.getBillNumber(visualId, fieLdsModel, dataMap, null); + return billNumber.toString(); + } + + /** + * 功能流程 获取可视化实体 + * + * @param visualId + * @return + */ + public VisualdevEntity getVisualEntity(String visualId) { + VisualdevEntity info = visualdevService.getInfo(visualId); + if (info != null) { + return info; + } + return new VisualdevEntity(); + } + + @DS("") + public UserEntity getUser(String userId) { + return userService.getInfo(userId); + } + + public String getGroupSelect(String groupIds) { + if (StringUtil.isEmpty(groupIds)) { + return groupIds; + } + List swapList = new ArrayList<>(); + if (groupIds.contains("[")) { + List groups = JsonUtil.getJsonToList(groupIds, String.class); + for (String g : groups) { + GroupEntity info = groupService.getInfo(g); + String s = info != null ? info.getFullName() : ""; + swapList.add(s); + } + } else { + GroupEntity info = groupService.getInfo(groupIds); + swapList.add(info != null ? info.getFullName() : ""); + } + return swapList.stream().collect(Collectors.joining(",")); + } + + public String getRoleSelect(String roleIds) { + if (StringUtil.isEmpty(roleIds)) { + return roleIds; + } + List swapList = new ArrayList<>(); + if (roleIds.contains("[")) { + List groups = JsonUtil.getJsonToList(roleIds, String.class); + for (String g : groups) { + RoleEntity info = roleService.getInfo(g); + String s = info != null ? info.getFullName() : ""; + swapList.add(s); + } + } else { + RoleEntity info = roleService.getInfo(roleIds); + swapList.add(info != null ? info.getFullName() : ""); + } + return swapList.stream().collect(Collectors.joining(",")); + } + + /** + * 高级查询 + * + * @param conditionModel + * @param entity + * @param num + * @return + */ + public Integer getCondition(SuperQueryConditionModel conditionModel, Object entity, int num) { + QueryWrapper queryWrapper = conditionModel.getObj(); + List queryConditionModels = conditionModel.getConditionList(); + String op = conditionModel.getMatchLogic(); + String tableName = conditionModel.getTableName(); + List useCondition = new ArrayList<>(); + for (ConditionJsonModel queryConditionModel : queryConditionModels) { + if (queryConditionModel.getTableName().equalsIgnoreCase(tableName)) { + if (queryConditionModel.getField().contains("yunzhupaas")) { + String child = queryConditionModel.getField(); + String s1 = child.substring(child.lastIndexOf("yunzhupaas_")).replace("yunzhupaas_", ""); + queryConditionModel.setField(s1); + } + if (queryConditionModel.getField().startsWith("tableField")) { + String child = queryConditionModel.getField(); + String s1 = child.substring(child.indexOf("-") + 1); + queryConditionModel.setField(s1); + } + useCondition.add(queryConditionModel); + } + } + + if (queryConditionModels.size() < 1 || useCondition.size() < 1) { + return num; + } + if (useCondition.size() > 0) { + num += 1; + } + // 处理控件 转换为有效值 + for (ConditionJsonModel queryConditionModel : useCondition) { + String yunzhupaasKey = queryConditionModel.getYunzhupaasKey(); + String fieldValue = queryConditionModel.getFieldValue(); + if (StringUtil.isEmpty(fieldValue)) { + if (yunzhupaasKey.equals(YunzhupaasKeyConsts.CASCADER) + || yunzhupaasKey.equals(YunzhupaasKeyConsts.CHECKBOX) + || yunzhupaasKey.equals(YunzhupaasKeyConsts.COMSELECT) + || yunzhupaasKey.equals(YunzhupaasKeyConsts.ADDRESS)) { + queryConditionModel.setFieldValue("[]"); + } else { + queryConditionModel.setFieldValue(""); + } + if (queryConditionModel.getSymbol().equals("like")) { + queryConditionModel.setSymbol("=="); + } else if (queryConditionModel.getSymbol().equals("notLike")) { + queryConditionModel.setSymbol("<>"); + } + } + if (yunzhupaasKey.equals(YunzhupaasKeyConsts.DATE)) { + String startTime = ""; + if (StringUtil.isNotEmpty(fieldValue)) { + Long o1 = Long.valueOf(fieldValue); + startTime = DateUtil.daFormatHHMMSS(o1); + } + queryConditionModel.setFieldValue(startTime); + } else if (yunzhupaasKey.equals(YunzhupaasKeyConsts.CREATETIME) + || yunzhupaasKey.equals(YunzhupaasKeyConsts.MODIFYTIME)) { + String startTime = ""; + if (StringUtil.isNotEmpty(fieldValue)) { + Long o1 = Long.valueOf(fieldValue); + startTime = DateUtil.daFormatHHMMSS(o1); + } + queryConditionModel.setFieldValue(startTime); + } + } + // 反射获取数据库实际字段 + Class aClass = entity.getClass(); + + queryWrapper.and(tw -> { + for (ConditionJsonModel conditionJsonModel : useCondition) { + String conditionField = conditionJsonModel.getField(); + String yunzhupaasKey = conditionJsonModel.getYunzhupaasKey(); + Field declaredField = null; + try { + declaredField = aClass.getDeclaredField(conditionField); + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } + declaredField.setAccessible(true); + String field = declaredField.getAnnotation(TableField.class).value(); + String fieldValue = conditionJsonModel.getFieldValue(); + String symbol = conditionJsonModel.getSymbol(); + if ("AND".equalsIgnoreCase(op)) { + if (symbol.equals("==")) { + tw.and(qw -> { + List multYunzhupaas = new ArrayList() { + { + add(YunzhupaasKeyConsts.CASCADER); + add(YunzhupaasKeyConsts.COMSELECT); + add(YunzhupaasKeyConsts.ADDRESS); + add(YunzhupaasKeyConsts.SELECT); + add(YunzhupaasKeyConsts.TREESELECT); + } + }; + if (YunzhupaasKeyConsts.CHECKBOX.equals(yunzhupaasKey) + || (multYunzhupaas.contains(yunzhupaasKey) + && conditionJsonModel.isFormMultiple())) { + // todo 多选,高级查询只选一个,需要拼成数组查询,其他控件目前没发现,后续添加至此 + String eavalue = ""; + if (fieldValue.contains("[")) { + eavalue = "[" + fieldValue + "]"; + } else { + JSONArray jarr = new JSONArray(); + jarr.add(fieldValue); + eavalue = jarr.toJSONString(); + } + qw.eq(field, eavalue); + } else if (!yunzhupaasKey.equals(YunzhupaasKeyConsts.NUM_INPUT) + && !yunzhupaasKey.equals(YunzhupaasKeyConsts.CALCULATE)) { + qw.eq(field, fieldValue); + } else { + if (StringUtil.isNotEmpty(fieldValue)) { + qw.eq(field, fieldValue); + } + } + if (StringUtil.isEmpty(fieldValue)) { + qw.or( + ew -> ew.isNull(field)); + } + }); + } else if (symbol.equals(">=")) { + tw.ge(field, fieldValue); + } else if (symbol.equals("<=")) { + tw.and(ew -> { + ew.le(field, fieldValue); + ew.and( + qw -> qw.ne(field, "")); + }); + } else if (symbol.equals(">")) { + tw.gt(field, fieldValue); + } else if (symbol.equals("<")) { + tw.and(ew -> { + ew.lt(field, fieldValue); + ew.and( + qw -> qw.ne(field, "")); + }); + } else if (symbol.equals("<>")) { + tw.and(ew -> { + ew.ne(field, fieldValue); + if (StringUtil.isNotEmpty(fieldValue)) { + ew.or( + qw -> qw.isNull(field)); + } else { + ew.and( + qw -> qw.isNotNull(field)); + } + }); + } else if (symbol.equals("like")) { + tw.and(ew -> { + if (StringUtil.isNotEmpty(fieldValue)) { + ew.like(field, fieldValue); + } else { + ew.isNull(field); + } + }); + } else if (symbol.equals("notLike")) { + tw.and(ew -> { + if (StringUtil.isNotEmpty(fieldValue)) { + ew.notLike(field, fieldValue); + ew.or( + qw -> qw.isNull(field)); + } else { + ew.isNotNull(field); + } + }); + } + } else { + if (symbol.equals("==")) { + tw.or( + qw -> qw.eq(field, fieldValue)); + } else if (symbol.equals(">=")) { + tw.or( + qw -> qw.ge(field, fieldValue)); + } else if (symbol.equals("<=")) { + tw.or( + qw -> qw.le(field, fieldValue)); + } else if (symbol.equals(">")) { + tw.or( + qw -> qw.gt(field, fieldValue)); + } else if (symbol.equals("<")) { + tw.or( + qw -> qw.lt(field, fieldValue)); + } else if (symbol.equals("<>")) { + tw.or( + qw -> qw.ne(field, fieldValue)); + if (StringUtil.isNotEmpty(fieldValue)) { + tw.or( + qw -> qw.isNull(field)); + } + } else if (symbol.equals("like")) { + if (StringUtil.isNotEmpty(fieldValue)) { + tw.or( + qw -> qw.like(field, fieldValue)); + } else { + tw.or( + qw -> qw.isNull(field)); + } + } else if (symbol.equals("notLike")) { + if (StringUtil.isNotEmpty(fieldValue)) { + tw.or( + qw -> qw.notLike(field, fieldValue)); + tw.or( + qw -> qw.isNull(field)); + } else { + tw.or( + qw -> qw.isNotNull(field)); + } + } + } + } + }); + return num; + } + + /** + * 取主表交集 + * + * @param lists + * @return + */ + public List getIntersection(List> lists) { + if (lists == null || lists.size() == 0) { + return new ArrayList<>(); + } + ArrayList> arrayList = new ArrayList<>(lists); + for (int i = 0; i < arrayList.size(); i++) { + List list = arrayList.get(i); + if (list == null || list.size() == 0) { + return new ArrayList<>(); + } + } + List intersection = arrayList.get(0); + for (int i = 0; i < arrayList.size(); i++) { + List list = arrayList.get(i); + intersection.retainAll(arrayList.get(i)); + } + return intersection; + } + + public Map putCache(Map localCache) { + // 读取系统控件 所需编码 id + Map depMap = organizeService.getOrgEncodeAndName("department"); + localCache.put("_dep_map", depMap); + Map comMap = organizeService.getOrgNameAndId(""); + localCache.put("_com_map", comMap); + Map posMap = positionService.getPosEncodeAndName(); + localCache.put("_pos_map", posMap); + Map userMap = userService.getUserNameAndIdMap(); + localCache.put("_user_map", userMap); + Map roleMap = roleService.getRoleNameAndIdMap(); + localCache.put("_role_map", roleMap); + Map groupMap = groupService.getGroupEncodeMap(); + localCache.put("_group_map", groupMap); + return localCache; + } + + /** + * 时间是否在范围内 + * + * @param yunzhupaasField + * @param parse + * @return + */ + private boolean timeInRange(YunzhupaasField yunzhupaasField, Date parse) { + boolean flag = true; + if (StringUtil.isNotEmpty(yunzhupaasField.startTime())) { + Long startTime = Long.parseLong(yunzhupaasField.startTime()); + flag = parse.after(new Date(startTime)); + } + if (flag && StringUtil.isNotEmpty(yunzhupaasField.endTime())) { + Long endTime = Long.parseLong(yunzhupaasField.endTime()); + flag = parse.before(new Date(endTime)); + } + return flag; + } + + private List checkOptionsControl(boolean multiple, Map insMap, String vModel, String label, + Map cacheMap, List valueList, StringJoiner errInfo) { + boolean error = false; + if (!multiple) { + // 非多选填入多选值 + if (valueList.size() > 1) { + error = true; + errInfo.add(label + "非多选"); + } + } + List dataList = new ArrayList<>(); + if (!error) { + boolean errorHapen = false; + for (String va : valueList) { + Object vo = cacheMap.get(va); + if (vo == null) { + errorHapen = true; + } else { + dataList.add(vo.toString()); + } + + } + if (errorHapen) { + errInfo.add(label + "值不正确"); + } else { + insMap.put(vModel, !multiple ? dataList.get(0) : JsonUtil.getObjectToString(dataList)); + } + } + return dataList; + } + + /** + * 递归查询 + * + * @param label + * @param value + * @param Children + * @param data + * @param options + */ + public static void getOptions(String label, String value, String Children, JSONArray data, + List> options) { + for (int i = 0; i < data.size(); i++) { + JSONObject ob = data.getJSONObject(i); + Map tree = new HashMap<>(16); + tree.put(value, String.valueOf(ob.get(value))); + tree.put(label, String.valueOf(ob.get(label))); + options.add(tree); + if (ob.get(Children) != null) { + JSONArray childrenArray = ob.getJSONArray(Children); + getOptions(label, value, Children, childrenArray, options); + } + } + } + + /** + * 获取用户主件查询条件 + * + * @param value + * @return + */ + public List usersSelectQuery(String value) { + List userSList = new ArrayList<>(); + String userValue = value.substring(0, value.indexOf("--")); + UserEntity userEntity = userService.getInfo(userValue); + if (userEntity != null) { + // 在用户关系表中取出 + List groupRel = Optional + .ofNullable(userRelationService.getListByObjectType(userValue, PermissionConst.GROUP)) + .orElse(new ArrayList<>()); + List orgRel = Optional + .ofNullable(userRelationService.getListByObjectType(userValue, PermissionConst.ORGANIZE)) + .orElse(new ArrayList<>()); + List posRel = Optional + .ofNullable(userRelationService.getListByObjectType(userValue, PermissionConst.POSITION)) + .orElse(new ArrayList<>()); + List roleRel = Optional + .ofNullable(userRelationService.getListByObjectType(userValue, PermissionConst.ROLE)) + .orElse(new ArrayList<>()); + + if (groupRel.size() > 0) { + for (UserRelationEntity split : groupRel) { + userSList.add(split.getObjectId()); + } + } + if (StringUtil.isNotEmpty(userEntity.getOrganizeId())) { + // 向上递归 查出所有上级组织 + List allUpOrgIDs = new ArrayList<>(); + organizeService.upWardRecursion(allUpOrgIDs, userEntity.getOrganizeId()); + for (String orgID : allUpOrgIDs) { + userSList.add(orgID); + } + } + if (posRel.size() > 0) { + for (UserRelationEntity split : posRel) { + userSList.add(split.getObjectId()); + } + } + if (roleRel.size() > 0) { + for (UserRelationEntity split : roleRel) { + userSList.add(split.getObjectId()); + } + } + return userSList; + } else { + return null; + } + } + + /** + * 获取用户主件查询条件(多选) + * + * @param values + * @return + */ + public List usersSelectQuery(List values) { + List userSList = new ArrayList<>(); + for (String value : values) { + String userValue = value.substring(0, value.indexOf("--")); + UserEntity userEntity = userService.getInfo(userValue); + if (userEntity != null) { + // 在用户关系表中取出 + List groupRel = Optional + .ofNullable(userRelationService.getListByObjectType(userValue, PermissionConst.GROUP)) + .orElse(new ArrayList<>()); + List orgRel = Optional + .ofNullable(userRelationService.getListByObjectType(userValue, PermissionConst.ORGANIZE)) + .orElse(new ArrayList<>()); + List posRel = Optional + .ofNullable(userRelationService.getListByObjectType(userValue, PermissionConst.POSITION)) + .orElse(new ArrayList<>()); + List roleRel = Optional + .ofNullable(userRelationService.getListByObjectType(userValue, PermissionConst.ROLE)) + .orElse(new ArrayList<>()); + + if (groupRel.size() > 0) { + for (UserRelationEntity split : groupRel) { + userSList.add(split.getObjectId()); + } + } + if (StringUtil.isNotEmpty(userEntity.getOrganizeId())) { + // 向上递归 查出所有上级组织 + List allUpOrgIDs = new ArrayList<>(); + organizeService.upWardRecursion(allUpOrgIDs, userEntity.getOrganizeId()); + for (String orgID : allUpOrgIDs) { + userSList.add(orgID); + } + } + if (posRel.size() > 0) { + for (UserRelationEntity split : posRel) { + userSList.add(split.getObjectId()); + } + } + if (roleRel.size() > 0) { + for (UserRelationEntity split : roleRel) { + userSList.add(split.getObjectId()); + } + } + } + } + return userSList; + } + + @DS("") + public List getFilterCondition(String id) { + return filterService.getCondition(id); + } + + public static List convertToList(Object obj) { + return OnlineSwapDataUtils.convertToList(obj); + } + + public static String convertValueToString(String obj, boolean mult, boolean isOrg) { + return OnlineSwapDataUtils.convertValueToString(obj, mult, isOrg); + } + + /** + * 获取数据连接 + * + * @param dbLink + * @return + */ + public DbLinkEntity getDataSource(String dbLink) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DbLinkEntity::getFullName, dbLink); + return dblinkService.getOne(queryWrapper); + } + + /** + * 静态数据转换 + * + * @param param 需要转换的值 + * @param options 静态数据模型 + * @param key label key-value编码对应 + * @param multiple 是否多选 + * @return 转换后的值 + */ + public static String selectStaitcSwap(String param, String options, String key, String label, boolean multiple) { + List textList = new ArrayList<>(); + List optionsList = JsonUtil.getJsonToList(options, Map.class); + if (multiple) { + List jsonToList = JsonUtil.getJsonToList(param, String.class); + for (String list1 : jsonToList) { + if (list1.contains("[")) { + List textList2 = new ArrayList<>(); + List jsonToList2 = JsonUtil.getJsonToList(list1, String.class); + for (String str : jsonToList2) { + textList2.add(loop(optionsList, str, key, label)); + } + textList.add(String.join("/", textList2)); + } else { + textList.add(loop(optionsList, list1, key, label)); + } + } + } else { + if (param.contains("[")) { + List textList2 = new ArrayList<>(); + List jsonToList = JsonUtil.getJsonToList(param, String.class); + for (String str : jsonToList) { + textList2.add(loop(optionsList, str, key, label)); + } + textList.add(String.join("/", textList2)); + } else { + textList.add(loop(optionsList, param, key, label)); + } + } + return String.join(",", textList); + } + + public static String loop(List options, String oneData, String key, String label) { + for (int i = 0; i < options.size(); i++) { + if (options.get(i).get(key).equals(oneData)) { + return options.get(i).get(label).toString(); + } else if (options.get(i).get("children") != null) { + List children = JsonUtil.getJsonToList(options.get(i).get("children"), Map.class); + String loop = loop(children, oneData, key, label); + if (loop != null) { + return loop; + } + } + } + return null; + } + + /** + * 功能表单获取流程信息-导入绑定多流程的第一个 + * + * @param formId + * @return + * @throws WorkFlowException + */ + public String getFlowTempJsonId(String formId) throws WorkFlowException { + String flowTemjsonId = ""; + // todo 功能表单获取流程信息调整取流程id位置变化 + // if (form == null || StringUtil.isEmpty(form.getFlowId())) { + // throw new WorkFlowException("该功能未配置流程不可用"); + // } + // FlowTemplateInfoVO vo = flowTemplateService.info(form.getFlowId()); + // if (vo == null || StringUtil.isEmpty(vo.getFlowTemplateJson()) || + // "[]".equals(vo.getFlowTemplateJson())) { + // throw new WorkFlowException("流程未设计!"); + // } + // List collect = + // JsonUtil.getJsonToList(vo.getFlowTemplateJson(), FlowJsonModel.class); + // flowTemjsonId = collect.get(0).getId(); + return flowTemjsonId; + } + + /** + * 输入时表单时间字段根据格式转换去尾巴 + * + * @param form + */ + public static void swapDatetime(Object form) { + Field[] declaredFields = form.getClass().getDeclaredFields(); + for (Field f : declaredFields) { + try { + // 副表处理 + if (f.getType().getName().startsWith("com.yunzhupaas.model")) { + if (!f.isAccessible()) { + f.setAccessible(true); + } + Object o = f.get(form); + if (o == null) { + continue; + } + swapDatetime(o); + f.set(form, o); + continue; + } + // 子表处理 + if (List.class.isAssignableFrom(f.getType())) { + Type type = f.getGenericType(); + if (type instanceof ParameterizedType) { + if (!f.isAccessible()) { + f.setAccessible(true); + } + List list = getList(f, f.get(form)); + for (Object o : list) { + swapDatetime(o); + } + if (list.size() > 0) { + f.set(form, list); + } + } + continue; + } + // 主表处理 + if (f.getAnnotation(YunzhupaasField.class) == null) + continue; + YunzhupaasField annotation = f.getAnnotation(YunzhupaasField.class); + if (!"date".equals(annotation.yunzhupaasKey()) || StringUtil.isEmpty(annotation.format())) + continue; + String format = annotation.format(); + f.setAccessible(true); + if (f.get(form) != null && Long.parseLong(String.valueOf(f.get(form))) > 0) { + Date date = new Date(Long.parseLong(String.valueOf(f.get(form)))); + String completionStr = ""; + switch (format) { + case "yyyy": + completionStr = "-01-01 00:00:00"; + break; + case "yyyy-MM": + completionStr = "-01 00:00:00"; + break; + case "yyyy-MM-dd": + completionStr = " 00:00:00"; + break; + case "yyyy-MM-dd HH": + completionStr = ":00:00"; + break; + case "yyyy-MM-dd HH:mm": + completionStr = ":00"; + break; + default: + break; + } + String datestr = DateUtil.dateToString(date, format); + long time = DateUtil.stringToDate(datestr + completionStr).getTime(); + f.set(form, String.valueOf(time)); + } + + } catch (Exception e) { + e.printStackTrace(); + } + } + + } + + public static List getList(Field field, Object object) { + List resultList = new ArrayList<>(); + if (object != null) { + try { + Class clzz = object.getClass(); + // 反射调用获取到list的size方法来获取到集合的大小 + Method sizeMethod = clzz.getDeclaredMethod("size"); + if (!sizeMethod.isAccessible()) { + sizeMethod.setAccessible(true); + } + // 集合长度 + int size = (int) sizeMethod.invoke(object); + // 循环遍历获取到数据 + for (int i = 0; i < size; i++) { + // 反射获取到list的get方法 + Method getMethod = clzz.getDeclaredMethod("get", int.class); + // 调用get方法获取数据 + if (!getMethod.isAccessible()) { + getMethod.setAccessible(true); + } + Object invoke = getMethod.invoke(object, i); + resultList.add(invoke); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + return resultList; + + } + + /** + * 小数转换带上0 + * + * @param decimalValue + */ + public static String getDecimalStr(Object decimalValue) { + if (Objects.isNull(decimalValue)) { + return ""; + } + if (decimalValue instanceof BigDecimal) { + BigDecimal bd = (BigDecimal) decimalValue; + return bd.toPlainString(); + } + return String.valueOf(decimalValue); + } + + /** + * 获取当前组织完整路径 + * + * @param orgId + * @return + */ + public String getCurrentOrgIds(String orgId, String showLevel) { + return flowFormDataUtil.getCurrentOrgIds(orgId, showLevel); + } + + /** + * 获取当前组织名称(all-显示组织名,else 显示部门名) + * + * @param value + * @param showLevel + * @return + */ + public String getCurrentOrganizeName(Object value, String showLevel) { + return flowFormDataUtil.getCurrentOrganizeName(value, showLevel); + } + + /* ****************以下vue3转换信息****************** */ + + /** + * 通过副表名取副表数据map + * + * @param data + * @param tableName + */ + public static Map getMastTabelData(Object data, String tableName) { + Map map = JsonUtil.entityToMap(data); + Map mapRes = new HashMap<>(); + for (String key : map.keySet()) { + String[] yunzhupaas_s = key.split("_yunzhupaas_"); + if (yunzhupaas_s.length == 2 && yunzhupaas_s[0].contains(tableName)) { + mapRes.put(yunzhupaas_s[1], map.get(key)); + } + } + return mapRes; + } + + /** + * List数据转换 + * + * @param realList + * @param formDataStr + * @return + */ + public List> swapDataList(List> realList, String formDataStr, + String columnDataStr, String moduleId, boolean inlineEdit) { + FormDataModel formDataModel = JsonUtil.getJsonToBean(formDataStr, FormDataModel.class); + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnDataStr, ColumnDataModel.class); + List fieLdsModels = JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class); + List fields = new ArrayList<>(); + VisualUtils.recursionFields(fieLdsModels, fields); + // 树形-添加父级字段+_id + if (OnlineDevData.COLUMNTYPE_FIVE.equals(columnDataModel.getType())) { + realList.forEach(item -> { + item.put(columnDataModel.getParentField() + "_id", item.get(columnDataModel.getParentField())); + }); + } + // 数据转换 + realList = swapDataUtils.getSwapList(realList, fields, moduleId, inlineEdit); + return realList; + } + + /** + * 列表补充流程状态 + * + * @param realList + * @throws WorkFlowException + */ + @DS("") + public void getFlowStatus(List> realList) throws WorkFlowException { + swapDataUtils.getFlowStatus(realList); + } + + /** + * List数据转树形和分组 + * + * @param realList + * @param columnDataStr + * @return + */ + public List> swapDataList(List> realList, String columnDataStr, + String subField) { + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnDataStr, ColumnDataModel.class); + // 判断数据是否分组 + if (OnlineDevData.COLUMNTYPE_THREE.equals(columnDataModel.getType())) { + realList = OnlineDevListUtils.groupData(realList, columnDataModel); + } + // 树形列表 + if (OnlineDevData.COLUMNTYPE_FIVE.equals(columnDataModel.getType())) { + columnDataModel.setSubField(subField); + realList = OnlineDevListUtils.treeListData(realList, columnDataModel); + } + return realList; + } + + /** + * 编辑form数据转换 + * + * @param dataMap + * @param formDataStr + * @return + */ + public Map swapDataForm(Map dataMap, String formDataStr, + Map tableField, Map tableRename) { + FormDataModel formDataModel = JsonUtil.getJsonToBean(formDataStr, FormDataModel.class); + List fieLdsModels = JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class); + List fields = new ArrayList<>(); + VisualUtils.recursionFields(fieLdsModels, fields); + // 是流程添加流程相关字段 + swapDataUtils.getFLowFields(dataMap); + // 数据转换 + return this.swapDataForm(dataMap, fields, null, tableField, tableRename); + } + + private Map swapDataForm(Map dataMap, List fields, + Map mainMap, Map tableField, Map tableRename) { + if (dataMap == null || dataMap.isEmpty()) + return new HashMap<>(); + for (FieLdsModel item : fields) { + String yunzhupaasKey = item.getConfig().getYunzhupaasKey(); + String vModel = item.getVModel(); + String dataType = item.getConfig().getDataType(); + Boolean isMultiple = Objects.nonNull(item.getMultiple()) ? item.getMultiple() : false; + + // 获取原字段数据 + FormPublicUtils.relationGetYunzhupaasId(dataMap, yunzhupaasKey, dataMap.get(vModel), vModel); + + List systemConditions = new ArrayList() { + { + add(YunzhupaasKeyConsts.CURRORGANIZE); + add(YunzhupaasKeyConsts.CURRDEPT); + add(YunzhupaasKeyConsts.CURRPOSITION); + } + }; + // 多选二维数组 + List multTow = new ArrayList() { + { + add(YunzhupaasKeyConsts.CASCADER); + add(YunzhupaasKeyConsts.CHECKBOX); + add(YunzhupaasKeyConsts.ADDRESS); + add(YunzhupaasKeyConsts.COMSELECT); + } + }; + // 一维维数组 + List multOne = new ArrayList() { + { + add(YunzhupaasKeyConsts.CHECKBOX); + } + }; + List nullIsList = new ArrayList() { + { + add(YunzhupaasKeyConsts.UPLOADFZ); + add(YunzhupaasKeyConsts.UPLOADIMG); + } + }; + if (Objects.nonNull(dataMap.get(vModel))) { + if (multTow.contains(yunzhupaasKey) && isMultiple) { + // 二维数据转换 + dataMap.replace(vModel, JSONObject.parseArray(dataMap.get(vModel).toString(), List.class)); + } else if (multTow.contains(yunzhupaasKey) || isMultiple || multOne.contains(yunzhupaasKey)) { + // 一维数据转换 + dataMap.replace(vModel, JSONObject.parseArray(dataMap.get(vModel).toString(), String.class)); + } + } else if (!YunzhupaasKeyConsts.CHILD_TABLE.equals(yunzhupaasKey)) { + if (systemConditions.contains(yunzhupaasKey)) { + dataMap.put(vModel, " "); + } + if (nullIsList.contains(yunzhupaasKey)) { + dataMap.put(vModel, Collections.emptyList()); + } + continue; + } + switch (yunzhupaasKey) { + case YunzhupaasKeyConsts.RATE: + case YunzhupaasKeyConsts.SLIDER: + BigDecimal value = new BigDecimal(0); + if (dataMap.get(vModel) != null) { + value = new BigDecimal(dataMap.get(vModel).toString()); + } + dataMap.put(vModel, value); + break; + case YunzhupaasKeyConsts.SWITCH: + dataMap.put(vModel, + dataMap.get(vModel) != null ? Integer.parseInt(String.valueOf(dataMap.get(vModel))) : null); + break; + case YunzhupaasKeyConsts.DATE: + Long dateTime = DateTimeFormatConstant.getDateObjToLong(dataMap.get(vModel)); + dataMap.put(vModel, dateTime != null ? dateTime : dataMap.get(vModel)); + break; + // 编辑是的系统控件转换 + case YunzhupaasKeyConsts.CURRORGANIZE: + case YunzhupaasKeyConsts.CURRDEPT: + dataMap.put(vModel, this.getCurrentOrganizeName(dataMap.get(vModel), item.getShowLevel())); + break; + case YunzhupaasKeyConsts.CREATEUSER: + case YunzhupaasKeyConsts.MODIFYUSER: + UserEntity userEntity = userService.getInfo(String.valueOf(dataMap.get(vModel))); + String userValue = Objects.nonNull(userEntity) ? userEntity.getAccount().equalsIgnoreCase(ADMIN_KEY) + ? "管理员/" + ADMIN_KEY + : userEntity.getRealName() + "/" + userEntity.getAccount() + : String.valueOf(dataMap.get(vModel)); + dataMap.put(vModel, userValue); + break; + case YunzhupaasKeyConsts.CURRPOSITION: + PositionEntity positionEntity = positionService.getInfo(String.valueOf(dataMap.get(vModel))); + dataMap.put(vModel, Objects.nonNull(positionEntity) ? positionEntity.getFullName() : " "); + break; + case YunzhupaasKeyConsts.CREATETIME: + case YunzhupaasKeyConsts.MODIFYTIME: + if (ObjectUtil.isNotEmpty(dataMap.get(vModel))) { + Long dateLong = Long.parseLong(String.valueOf(dataMap.get(vModel))); + String dateStr = DateUtil.dateFormat(new Date(dateLong)); + dataMap.put(vModel, dateStr); + } + break; + case YunzhupaasKeyConsts.UPLOADFZ: + case YunzhupaasKeyConsts.UPLOADIMG: + // 数据传递-乱塞有bug强行置空 + if (ObjectUtil.isNotEmpty(dataMap.get(vModel))) { + List> fileList = new ArrayList<>(); + try { + fileList = JsonUtil.getJsonToListMap(dataMap.get(vModel).toString()); + } catch (Exception e) { + e.printStackTrace(); + } + dataMap.put(vModel, fileList); + } + break; + case YunzhupaasKeyConsts.CHILD_TABLE: + List childrens = item.getConfig().getChildren(); + String childTableRename = ""; + try { + childTableRename = tableRename.get(tableField.get(vModel)); + } catch (Exception e) { + } + if (StringUtil.isNotEmpty(childTableRename)) { + vModel = childTableRename + "List"; + } + vModel = DataControlUtils.initialLowercase(vModel); + List> childList = (List>) dataMap.get(vModel); + if (CollectionUtils.isEmpty(childList)) + break; + for (int i = 0; i < childList.size(); i++) { + Map childMap = childList.get(i); + childList.set(i, this.swapDataForm(childMap, childrens, dataMap, tableField, tableRename)); + } + dataMap.put(vModel, childList); + break; + default: + dataMap.put(vModel, dataMap.get(vModel)); + break; + } + } + return dataMap; + } + + /** + * 详情Detail数据转换 + * + * @param map + * @param formDataStr + * @return + */ + public Map swapDataDetail(Map map, String formDataStr, String moduleId, + boolean inlineEdit) { + FormDataModel formDataModel = JsonUtil.getJsonToBean(formDataStr, FormDataModel.class); + List fieLdsModels = JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class); + List fields = new ArrayList<>(); + VisualUtils.recursionFields(fieLdsModels, fields); + // 数据转换 + if (map != null) { + Map finalMap = map; + List> realList = new ArrayList() { + { + add(finalMap); + } + }; + realList = swapDataUtils.getSwapInfo(realList, fields, moduleId, inlineEdit, null); + map = realList.get(0); + } + return map; + } + + /** + * 导入数据 + */ + public ExcelImportModel importData(String formData, List> dataList, + ImportFormCheckUniqueModel uniqueModel, Map table, String tableListStr) + throws WorkFlowException { + ExcelImportModel importModel = new ExcelImportModel(); + Map localCache = swapDataUtils.getlocalCache(); + List> failResult = new ArrayList<>(); + FormDataModel formDataModel = JsonUtil.getJsonToBean(formData, FormDataModel.class); + List fieLdsModels = JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class); + List fields = new ArrayList<>(); + VisualUtils.recursionFields(fieLdsModels, fields); + uniqueModel.setMain(true); + uniqueModel.setPrimaryKeyPolicy(formDataModel.getPrimaryKeyPolicy()); + uniqueModel.setLogicalDelete(formDataModel.getLogicalDelete()); + uniqueModel.setMain(true); + uniqueModel.setTableModelList(JsonUtil.getJsonToList(tableListStr, TableModel.class)); + DbLinkEntity linkEntity = dblinkService.getInfo(uniqueModel.getDbLinkId()); + uniqueModel.setLinkEntity(linkEntity); + + // 流程表单导入,传流程小id查询,查询各个版本flowIds用于过滤数据 + String mainFlowID = null; + if (StringUtil.isNotEmpty(uniqueModel.getFlowId())) { + List flowVersionIds = templateApi.getFlowIdsByTemplate(uniqueModel.getFlowId()); + uniqueModel.setFlowId(uniqueModel.getFlowId()); + uniqueModel.setFlowIdList( + flowVersionIds.stream().map(TemplateJsonEntity::getId).distinct().collect(Collectors.toList())); + mainFlowID = flowVersionIds.stream().filter(t -> Objects.equals(t.getState(), 1)).findFirst() + .orElse(new TemplateJsonEntity()).getId(); + } + try { + for (int i = 0, len = dataList.size(); i < len; i++) { + Map data = dataList.get(i); + // 导入时默认第一个流程 + data.put(FlowFormConstant.FLOWID, mainFlowID); + data.put(TableFeildsEnum.FLOWID.getField(), mainFlowID); + Map resultMap = new HashMap<>(data); + StringJoiner errInfo = new StringJoiner(","); + Map errorMap = new HashMap<>(data); + + List errList = swapDataUtils.checkExcelData(fields, data, localCache, resultMap, errorMap, + uniqueModel); + // 业务主键判断--导入新增或者跟新 + VisualErrInfo visualErrInfo; + try { + DynamicDataSourceUtil.switchToDataSource(linkEntity); + visualErrInfo = formCheckUtils.checkBusinessKey(fields, resultMap, uniqueModel.getTableModelList(), + formDataModel, null); + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + + if (uniqueModel.isUpdate()) { + if (ObjectUtil.isNotEmpty(visualErrInfo) && StringUtil.isNotEmpty(visualErrInfo.getId())) { + uniqueModel.setId(visualErrInfo.getId()); + // 判断流程是否已发起 + if (StringUtil.isNotEmpty(visualErrInfo.getFlowTaskId())) { + String finalTaskId = visualErrInfo.getFlowTaskId(); + List flowIdList = new ArrayList<>(); + flowIdList.add(finalTaskId); + List tasks = taskApi.getInfosSubmit(flowIdList.toArray(new String[] {}), + TaskEntity::getStatus, TaskEntity::getId); + if (tasks.size() > 0) { + boolean errorMsg = tasks.stream().filter(t -> Objects.equals(t.getStatus(), 0)) + .count() == 0; + String msg = "已发起流程,导入失败"; + if (errorMsg) { + errorMap.put("errorsInfo", msg); + failResult.add(errorMap); + continue; + } + } + } + } else { + String excelHas = formCheckUtils.checkBusinessKeyExcel(formDataModel, resultMap, uniqueModel); + if (StringUtil.isNotEmpty(excelHas)) { + continue; + } + } + } else { + if (ObjectUtil.isNotEmpty(visualErrInfo) && StringUtil.isNotEmpty(visualErrInfo.getErrMsg())) { + errorMap.put("errorsInfo", visualErrInfo.getErrMsg()); + failResult.add(errorMap); + continue; + } + String excelHas = formCheckUtils.checkBusinessKeyExcel(formDataModel, resultMap, uniqueModel); + if (StringUtil.isNotEmpty(excelHas)) { + errorMap.put("errorsInfo", excelHas); + failResult.add(errorMap); + continue; + } + } + swapDataUtils.checkUnique(fields, data, errList, uniqueModel); + + errList.stream().forEach(t -> { + if (StringUtil.isNotEmpty(t)) { + errInfo.add(t); + } + }); + if (errInfo.length() > 0) { + errorMap.put("errorsInfo", errInfo.toString()); + failResult.add(errorMap); + } else { + List importDataModel = uniqueModel.getImportDataModel(); + ImportDataModel model = new ImportDataModel(); + model.setId(uniqueModel.getId()); + Map> map = new HashMap<>(16); + Map tableMap = new HashMap<>(16); + for (Object key : resultMap.keySet().toArray()) { + if (table.get(key) != null) { + tableMap.put(table.get(key) + "List", resultMap.remove(key)); + } + } + resultMap.putAll(map); + resultMap.putAll(tableMap); + model.setResultData(resultMap); + importDataModel.add(model); + } + } + } catch (Exception e) { + e.printStackTrace(); + throw new WorkFlowException("导入异常!"); + } + importModel.setFnum(failResult.size()); + importModel.setSnum(dataList.size() - failResult.size()); + importModel.setResultType(failResult.size() > 0 ? 1 : 0); + importModel.setFailResult(failResult); + return importModel; + } + + /** + * vue3获取数据过滤方案列表 + * + * @param columnStr + * @param appColumnStr + * @return + */ + public List getFilterRules(String columnStr, String appColumnStr) { + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnStr, ColumnDataModel.class); + ColumnDataModel appColumnDataModel = JsonUtil.getJsonToBean(appColumnStr, ColumnDataModel.class); + List ruleList = JsonUtil.getJsonToList(columnDataModel.getRuleList().getConditionList(), Map.class); + List appRuleList = JsonUtil.getJsonToList(appColumnDataModel.getRuleList().getConditionList(), Map.class); + boolean isPc = RequestContext.isOrignPc(); + List res = JsonUtil.getJsonToList(ruleList, RuleInfo.class); + if (!isPc) { + res = JsonUtil.getJsonToList(appRuleList, RuleInfo.class); + } + return res; + } + + public QueryWrapper wrapperHandle(String columnStr, String appColumnStr, QueryWrapper wrapper, Class aClass, + String type, String tableName) { + try { + // 避免空and + wrapper.apply(" 1=1 "); + List ruleInfos = getFilterRules(columnStr, appColumnStr); + for (RuleInfo info : ruleInfos) { + String field = info.getField(); + if ("main".equals(type) && field.contains("-")) { + continue; + } + if ("main".equals(type) && field.contains("_yunzhupaas_")) { + continue; + } + if ("sub".equals(type) && !field.contains("-")) { + continue; + } + if ("sub-yunzhupaas".equals(type) && !field.contains("_yunzhupaas_")) { + continue; + } + String fieldName = field; + String table = ""; + if (field.contains("-")) { + fieldName = field.split("-")[1]; + if (!tableName.equals(field.split("-")[0])) { + continue; + } + } + if (field.contains("_yunzhupaas_")) { + fieldName = field.split("_yunzhupaas_")[1]; + table = field.split("_yunzhupaas_")[0]; + table = table.replace("yunzhupaas_", ""); + } + if ("sub-yunzhupaas".equals(type) && !tableName.equals(table)) { + continue; + } + Field declaredField = aClass.getDeclaredField(fieldName); + declaredField.setAccessible(true); + String fieldDb = declaredField.getAnnotation(TableField.class).value(); + GenUtil genUtil = JsonUtil.getJsonToBean(info, GenUtil.class); + genUtil.setOperator(info.getOperator()); + genUtil.solveValue(wrapper, fieldDb); + } + return wrapper; + } catch (Exception e) { + return wrapper; + } + } + + /** + * 是否只有主表过滤 + * + * @param columnStr + * @param appColumnStr + * @return + */ + public boolean onlyMainFilter(String columnStr, String appColumnStr) { + List ruleInfos = getFilterRules(columnStr, appColumnStr); + for (RuleInfo info : ruleInfos) { + if (info.getField().contains("_yunzhupaas_") || info.getField().contains("-")) { + return false; + } + } + return true; + } + + /** + * 输入时表单时间字段根据格式转换去尾巴 + * + * @param formDataStr 表单属性json + * @param obj 数据 + */ + public static String swapDatetime(String formDataStr, Object obj, Map tableRename) { + FormDataModel formDataModel = JsonUtil.getJsonToBean(formDataStr, FormDataModel.class); + List fieLdsModels = JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class); + Map map = JsonUtil.entityToMap(obj); + for (String tabelRealName : tableRename.keySet()) { + String reName = DataControlUtils.initialLowercase(tableRename.get(tabelRealName)); + map.put(tabelRealName + "List", map.get(reName + "List")); + } + OnlineSwapDataUtils.swapDatetime(fieLdsModels, map); + for (String tabelRealName : tableRename.keySet()) { + if (map.get(tabelRealName + "List") != null) { + String reName = DataControlUtils.initialLowercase(tableRename.get(tabelRealName)); + JSONArray listToJsonArray = JsonUtil.getListToJsonArray((List) map.get(tabelRealName + "List")); + map.replace(reName + "List", listToJsonArray); + } + } + return JsonUtil.getObjectToString(map); + } + + /** + * 三种搜索条件组合查询 + * + * @param queryAllModel + * @return + */ + @DS("") + public MPJLambdaWrapper getConditionAllTable(QueryAllModel queryAllModel) { + UserInfo userInfo = UserProvider.getUser(); + try { + DbLinkEntity linkEntity = queryAllModel.getDbLink() != null ? getDataSource(queryAllModel.getDbLink()) + : null; + DynamicDataSourceUtil.switchToDataSource(linkEntity); + @Cleanup + Connection connection = ConnUtil.getConnOrDefault(linkEntity); + queryAllModel.setDbType(connection.getMetaData().getDatabaseProductName().trim()); + } catch (Exception e) { + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + + Map systemParam = OnlineProductSqlUtils.getSystemParam(); + MPJLambdaWrapper wrapper = queryAllModel.getWrapper(); + List> superList = new ArrayList<>(); + + // 高级查询 + String superQuery = queryAllModel.getSuperJson(); + if (StringUtil.isNotEmpty(superQuery)) { + List list = new ArrayList<>(); + SuperJsonModel jsonToBean = JsonUtil.getJsonToBean(queryAllModel.getSuperJson(), SuperJsonModel.class); + list.add(jsonToBean); + superList.add(list); + } + // 数据过滤 + String ruleQuery = queryAllModel.getRuleJson(); + if (StringUtil.isNotEmpty(ruleQuery)) { + List list = new ArrayList<>(); + SuperJsonModel jsonToBean = JsonUtil.getJsonToBean(queryAllModel.getRuleJson(), SuperJsonModel.class); + list.add(jsonToBean); + superList.add(list); + } + // 数据权限 不为空有开启权限(存在多权限--权限方案之间用or,和其他条件之间用and) + if (queryAllModel.getModuleId() != null) { + if (!userInfo.getIsAdministrator() && !authorizeService.getUserCurrentStanding(userInfo.getUserId(), 2)) { + List authorizeListAll = authorizeService.getConditionSql(queryAllModel.getModuleId()); + if (authorizeListAll.size() > 0) { + superList.add(authorizeListAll); + } else { + return null; + } + } + } + // 系统参数替换 + for (List superJsonModels : superList) { + for (SuperJsonModel superJsonModel : superJsonModels) { + for (SuperQueryJsonModel superQueryJsonModel : superJsonModel.getConditionList()) { + for (FieLdsModel fieLdsModel : superQueryJsonModel.getGroups()) { + OnlineProductSqlUtils.replaceSystemParam(systemParam, fieLdsModel); + } + } + } + } + QueryUtil queryUtil = new QueryUtil(); + queryAllModel.setQueryList(superList); + queryUtil.queryList(queryAllModel); + return wrapper; + } + + /** + * 视图代码生成数据接口调用在线开发 + * + * @param interfaceId + * @param interfaceParam + * @return + */ + @DS("") + public PageListVO getInterfaceData(String interfaceId, String interfaceParam, Object pagination, String columnData, + boolean isPc) { + VisualdevReleaseEntity visualdevEntity = new VisualdevReleaseEntity(); + visualdevEntity.setInterfaceId(interfaceId); + visualdevEntity.setInterfaceParam(interfaceParam); + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class); + PaginationModelExport jsonToBean = JsonUtil.getJsonToBean(pagination, PaginationModelExport.class); + jsonToBean.setQueryJson(JsonUtil.getObjectToString(pagination)); + List> interfaceData = swapDataUtils.getInterfaceData(visualdevEntity, jsonToBean, + columnDataModel); + if (isPc && columnDataModel.getType() == 3) { + // 分组和树形的树形数据转换 + interfaceData = this.swapDataList(interfaceData, columnData, null); + } + // 返回对象 + PageListVO vo = new PageListVO(); + vo.setList(interfaceData); + PaginationVO page = JsonUtil.getJsonToBean(jsonToBean, PaginationVO.class); + vo.setPagination(page); + return vo; + } + + @DS("") + public DownloadVO exportInterfaceData(String interfaceId, String interfaceParam, Object pagination, + String columnData) { + VisualdevReleaseEntity visualdevEntity = new VisualdevReleaseEntity(); + visualdevEntity.setInterfaceId(interfaceId); + visualdevEntity.setInterfaceParam(interfaceParam); + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class); + PaginationModelExport jsonToBean = JsonUtil.getJsonToBean(pagination, PaginationModelExport.class); + jsonToBean.setQueryJson(JsonUtil.getObjectToString(pagination)); + List> realList = swapDataUtils.getInterfaceData(visualdevEntity, jsonToBean, + columnDataModel); + + ModuleEntity menuInfo = moduleService.getInfo(jsonToBean.getMenuId()); + String[] keys = jsonToBean.getSelectKey(); + List selectIds = Arrays.asList(jsonToBean.getSelectIds()); + realList = "2".equals(jsonToBean.getDataType()) ? realList.stream() + .filter(t -> selectIds.contains(t.get(columnDataModel.getViewKey()))).collect(Collectors.toList()) + : realList; + DownloadVO vo = VisualUtils.createModelExcelApiData(columnData, realList, Arrays.asList(keys), "表单信息", + menuInfo.getFullName(), new ExcelModel()); + return vo; + } + + /** + * 根据菜单ID获取菜单名称 + * + * @param menuId + * @return + */ + @DS("") + public String getMenuName(String menuId) { + String name = ""; + if (StringUtil.isNotEmpty(menuId)) { + ModuleEntity menuInfo = moduleService.getInfo(menuId); + if (menuInfo != null && StringUtil.isNotEmpty(menuInfo.getFullName())) { + name = menuInfo.getFullName(); + } + } + return name; + } + + /** + * 根据表单获取所有字段 + * + * @param formJson + * @return + */ + @DS("") + public ExcelModel getExcelParams(String formJson, List selectKey) { + return swapDataUtils.getDefaultValue(formJson, selectKey); + } + + // 以下新的流程api + + /** + * 获取流程版本列表 + * + * @param templateId + * @return + */ + @DS("") + public List getFlowIds(String templateId) { + List flowIds = new ArrayList<>(); + if (StringUtil.isNotEmpty(templateId)) { + flowIds.addAll(templateApi.getFlowIdsByTemplateId(templateId)); + if (CollectionUtils.isNotEmpty(flowIds)) { + return flowIds; + } + String templateByVersionId = templateApi.getTemplateByVersionId(templateId); + if (StringUtil.isNotEmpty(templateByVersionId)) { + flowIds.addAll(templateApi.getFlowIdsByTemplateId(templateByVersionId)); + } + } + if (CollectionUtils.isEmpty(flowIds)) { + flowIds.add("noFlowVer"); + } + return flowIds; + } + + /** + * 删除流程任务 + * + * @param flowTaskId + * @return + */ + @DS("") + public String deleteFlowTask(String flowTaskId) { + String errMsg = ""; + TaskEntity taskEntity = taskApi.getInfoSubmit(flowTaskId, TaskEntity::getId, TaskEntity::getParentId, + TaskEntity::getFullName, TaskEntity::getStatus); + if (taskEntity != null) { + try { + taskApi.delete(taskEntity); + } catch (Exception e) { + errMsg = e.getMessage(); + } + } + + return errMsg; + } +} diff --git a/yunzhupaas-public/yunzhupaas-generater-base/src/main/java/com/yunzhupaas/util/QueryUtil.java b/yunzhupaas-public/yunzhupaas-generater-base/src/main/java/com/yunzhupaas/util/QueryUtil.java new file mode 100644 index 0000000..34d9de3 --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-generater-base/src/main/java/com/yunzhupaas/util/QueryUtil.java @@ -0,0 +1,284 @@ +package com.yunzhupaas.util; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.annotation.TableField; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.yunzhupaas.database.model.superQuery.SuperJsonModel; +import com.yunzhupaas.database.model.superQuery.SuperQueryJsonModel; +import com.yunzhupaas.emnus.SearchMethodEnum; +import com.yunzhupaas.model.QueryAllModel; +import com.yunzhupaas.model.visualJson.FieLdsModel; +import com.yunzhupaas.model.visualJson.config.ConfigModel; +import com.yunzhupaas.onlinedev.util.onlineDevUtil.OnlineProductSqlUtils; +import lombok.Data; +import org.apache.poi.ss.formula.functions.T; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +@Data +public class QueryUtil { + + /** + * 运算符 + */ + private SearchMethodEnum symbol; + /** + * 逻辑拼接符号 + */ + private boolean and; + /** + * 组件标识 + */ + private String yunzhupaasKey; + /** + * 字段key + */ + private String vModel; + /** + * 自定义的值 + */ + private Object fieldValue; + /** + * 自定义的值2 + */ + private Object fieldValueTwo; + /** + * 实体对象 + */ + private Map classMap; + /** + * 数据库类型 + */ + private String dbType; + + private Boolean isSqlServer = false; + + private List dataList = new ArrayList<>(); + + public MPJLambdaWrapper queryList(QueryAllModel queryAllModel) { + MPJLambdaWrapper wrapper = queryAllModel.getWrapper(); + classMap = queryAllModel.getClassMap(); + dbType = queryAllModel.getDbType(); + isSqlServer = "Microsoft SQL Server".equalsIgnoreCase(dbType); + List> superJsonModelList = queryAllModel.getQueryList(); + for (List list : superJsonModelList) { + boolean flag = false; + for (SuperJsonModel superJsonModel : list) { + if (superJsonModel.getConditionList().size() > 0) { + for (SuperQueryJsonModel item : superJsonModel.getConditionList()) { + if (item.getGroups().size() > 0) { + flag = true; + } + } + } + } + if (list.size() > 0 && flag) { + wrapper.and(gw -> { + for (SuperJsonModel superJsonModel : list) { + String matchLogic = superJsonModel.getMatchLogic(); + Boolean authorizeLogic = superJsonModel.getAuthorizeLogic(); + boolean isAddMatchLogic = SearchMethodEnum.And.getSymbol().equalsIgnoreCase(matchLogic); + List conditionList = superJsonModel.getConditionList(); + if (conditionList.size() == 0) + continue; + // 参数值转换 + OnlineProductSqlUtils.superList(conditionList, true); + if (authorizeLogic) { + gw.and(tw -> { + queryWrapperList(tw, conditionList, isAddMatchLogic); + }); + } else { + gw.or(tw -> { + queryWrapperList(tw, conditionList, isAddMatchLogic); + }); + } + } + }); + } + } + return wrapper; + } + + private void queryWrapperList(MPJLambdaWrapper tw, List conditionList, + boolean isAddMatchLogic) { + for (SuperQueryJsonModel superQueryJsonModel : conditionList) { + String logic = superQueryJsonModel.getLogic(); + and = SearchMethodEnum.And.getSymbol().equalsIgnoreCase(logic); + List queryList = superQueryJsonModel.getGroups(); + if (queryList.size() > 0) { + queryWrapper(tw, queryList, isAddMatchLogic); + } + } + } + + private void queryWrapper(MPJLambdaWrapper tw, List queryListAll, boolean isAnd) { + if (isAnd) { + tw.and(qw -> { + query(qw, queryListAll); + }); + } else { + tw.or(qw -> { + query(qw, queryListAll); + }); + } + } + + private void query(MPJLambdaWrapper qw, List queryListAll) { + for (FieLdsModel fieLdsModel : queryListAll) { + List queryList = new ArrayList() { + { + add(fieLdsModel); + } + }; + if (and) { + qw.and(ew -> { + fieldsModel(ew, queryList); + }); + } else { + qw.or(ew -> { + fieldsModel(ew, queryList); + }); + } + } + } + + private void fieldsModel(MPJLambdaWrapper wrapper, List queryList) { + for (FieLdsModel fieLdsModel : queryList) { + ConfigModel config = fieLdsModel.getConfig(); + yunzhupaasKey = config.getYunzhupaasKey(); + symbol = SearchMethodEnum.getSearchMethod(fieLdsModel.getSymbol()); + vModel = fieLdsModel.getVModel(); + if (!and) { + wrapper.or(); + } + String table = ObjectUtil.isNotEmpty(config.getRelationTable()) ? config.getRelationTable() + : config.getTableName(); + Class tClass = classMap.get(table); + try { + Field declaredField = null; + Field[] declaredFields = tClass.getDeclaredFields(); + for (Field item : declaredFields) { + String tableFieldName = item.getAnnotation(TableField.class) == null ? "" + : item.getAnnotation(TableField.class).value(); + if (vModel.equalsIgnoreCase(tableFieldName) || item.getName().equals(vModel)) { + declaredField = item; + break; + } + } + declaredField.setAccessible(true); + vModel = table + "." + declaredField.getAnnotation(TableField.class).value(); + } catch (Exception e) { + e.printStackTrace(); + } + fieldValue = fieLdsModel.getFieldValueOne(); + fieldValueTwo = fieLdsModel.getFieldValueTwo(); + dataList = fieLdsModel.getDataList(); + getSymbolWrapper(wrapper); + } + } + + private void getNullWrapper(MPJLambdaWrapper wrapper) { + if (!and) { + wrapper.or(t -> t.isNull(vModel)); + } else { + wrapper.and(t -> t.isNull(vModel)); + } + } + + private void getNotNullWrapper(MPJLambdaWrapper wrapper) { + if (!and) { + wrapper.or(t -> t.isNotNull(vModel)); + } else { + wrapper.and(t -> t.isNotNull(vModel)); + } + } + + private void getInWrapper(MPJLambdaWrapper wrapper) { + if (!and) { + wrapper.or(qw -> { + for (String id : dataList) { + if (isSqlServer) { + id = String.valueOf(id).replaceAll("\\[", "[[]"); + } + switch (symbol) { + case Included: + qw.or().like(vModel, id); + break; + default: + qw.notLike(vModel, id); + break; + } + } + }); + } else { + wrapper.and(qw -> { + for (String id : dataList) { + if (isSqlServer) { + id = String.valueOf(id).replaceAll("\\[", "[[]"); + } + switch (symbol) { + case Included: + qw.or().like(vModel, id); + break; + default: + qw.notLike(vModel, id); + break; + } + } + }); + } + } + + private void getSymbolWrapper(MPJLambdaWrapper wrapper) { + switch (symbol) { + case IsNull: + getNullWrapper(wrapper); + break; + case IsNotNull: + getNotNullWrapper(wrapper); + break; + case Equal: + wrapper.eq(vModel, fieldValue); + break; + case NotEqual: + wrapper.ne(vModel, fieldValue); + break; + case GreaterThan: + wrapper.gt(vModel, fieldValue); + break; + case LessThan: + wrapper.lt(vModel, fieldValue); + break; + case GreaterThanOrEqual: + wrapper.ge(vModel, fieldValue); + break; + case LessThanOrEqual: + wrapper.le(vModel, fieldValue); + break; + case Like: + if (isSqlServer) { + fieldValue = String.valueOf(fieldValue).replaceAll("\\[", "[[]"); + } + wrapper.like(vModel, fieldValue); + break; + case NotLike: + if (isSqlServer) { + fieldValue = String.valueOf(fieldValue).replaceAll("\\[", "[[]"); + } + wrapper.notLike(vModel, fieldValue); + break; + case Included: + case NotIncluded: + getInWrapper(wrapper); + break; + case Between: + wrapper.between(vModel, fieldValue, fieldValueTwo); + break; + default: + break; + } + } +} diff --git a/yunzhupaas-public/yunzhupaas-provider/pom.xml b/yunzhupaas-public/yunzhupaas-provider/pom.xml new file mode 100644 index 0000000..7c37fac --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/pom.xml @@ -0,0 +1,69 @@ + + + + yunzhupaas-java-boot + com.yunzhupaas + 5.2.0-RELEASE + ../../pom.xml + + 4.0.0 + + yunzhupaas-provider + + + + com.yunzhupaas + yunzhupaas-common-all + ${project.version} + + + + com.yunzhupaas + yunzhupaas-permission-entity + ${project.version} + + + com.yunzhupaas + yunzhupaas-system-entity + ${project.version} + + + com.yunzhupaas + yunzhupaas-message-entity + ${project.version} + + + org.bouncycastle + bcpkix-jdk18on + + + com.yunzhupaas + yunzhupaas-flowable-entity + ${project.version} + + + com.yunzhupaas + yunzhupaas-extend-entity + ${project.version} + + + com.yunzhupaas + yunzhupaas-visualdev-base-entity + ${project.version} + + + com.yunzhupaas + yunzhupaas-visualdev-onlinedev-entity + ${project.version} + + + com.yunzhupaas + yunzhupaas-common-sms + + + + + + diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/base/service/DictionaryDataService.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/base/service/DictionaryDataService.java new file mode 100644 index 0000000..41f12f8 --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/base/service/DictionaryDataService.java @@ -0,0 +1,172 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.model.dictionarytype.DictionaryExportModel; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.exception.DataException; + +import java.util.List; + +/** + * 字典数据 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface DictionaryDataService extends SuperService { + + /** + * 列表 + * + * @param dictionaryTypeId 字段分类id + * @param enable 是否只看有效 + * @return ignore + */ + List getList(String dictionaryTypeId, Boolean enable); + + /** + * 列表 + * + * @param dictionaryTypeId 类别主键 + * @return ignore + */ + List getList(String dictionaryTypeId); + /** + * 列表 + * + * @param dictionaryTypeId 类别主键(在线开发数据转换) + * @return ignore + */ + List getDicList(String dictionaryTypeId); + /** + * 列表 + * + * @param dictionaryTypeId 类别主键(在线开发数据转换) + * @return ignore + */ + List geDicList(String dictionaryTypeId); + /** + * 列表 + * + * @param parentId 父级id + * @return ignore + */ + Boolean isExistSubset(String parentId); + + /** + * 信息 + * + * @param id 主键值 + * @return ignore + */ + DictionaryDataEntity getInfo(String id); + + /** + * 代码生成器数据字典转换 + * @param value encode 或者 id + * @param dictionaryTypeId 类别 + * @return + */ + DictionaryDataEntity getSwapInfo(String value,String dictionaryTypeId); + /** + * 验证名称 + * + * @param dictionaryTypeId 类别主键 + * @param fullName 名称 + * @param id 主键值 + * @return ignore + */ + boolean isExistByFullName(String dictionaryTypeId, String fullName, String id); + + /** + * 验证编码 + * + * @param dictionaryTypeId 类别主键 + * @param enCode 编码 + * @param id 主键值 + * @return ignore + */ + boolean isExistByEnCode(String dictionaryTypeId, String enCode, String id); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(DictionaryDataEntity entity); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(DictionaryDataEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return ignore + */ + boolean update(String id, DictionaryDataEntity entity); + + /** + * 上移 + * + * @param id 主键值 + * @return ignore + */ + boolean first(String id); + + /** + * 下移 + * + * @param id 主键值 + * @return ignore + */ + boolean next(String id); + + /** + * 获取名称 + * + * @param id 主键id集合 + * @return ignore + */ + List getDictionName(List id); + + /** + * 导出数据 + * + * @param id 主键 + * @return DownloadVO + */ + DownloadVO exportData(String id); + + /** + * 导入数据 + * + * @param exportModel ignore + * @param type 类型 + * @return ignore + * @throws DataException ignore + */ + ActionResult importData(DictionaryExportModel exportModel, Integer type) throws DataException; + + /** + * 根据字典分类获取 字典信息列表 + * @param typeCode + * @return + */ + List getListByTypeDataCode(String typeCode); + /** + * 获取启用字典列表 + * @param typeCode + * @return + */ + List getByTypeCodeEnable(String typeCode); +} + diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/base/service/ModuleButtonService.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/base/service/ModuleButtonService.java new file mode 100644 index 0000000..3b8eb5e --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/base/service/ModuleButtonService.java @@ -0,0 +1,127 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.entity.ModuleButtonEntity; + +import java.util.List; + +/** + * 按钮权限 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface ModuleButtonService extends SuperService { + + /** + * 列表 + * + * @return ignore + */ + List getList(); + + /** + * 列表 + * + * @return ignore + */ + List getEnabledMarkList(String enabledMark); + + /** + * 列表 + * + * @param moduleId 功能主键 + * @return ignore + */ + List getListByModuleIds(String moduleId); + + /** + * 列表(带关键字的) + * + * @param moduleId 功能主键 + * @param pagination 分页参数 + * @return ignore + */ + List getListByModuleIds(String moduleId, Pagination pagination); + + /** + * 信息 + * + * @param id 主键值 + * @return ignore + */ + ModuleButtonEntity getInfo(String id); + + /** + * 信息 + * + * @param id 主键值 + * @param moduleId + * @return ignore + */ + ModuleButtonEntity getInfo(String id, String moduleId); + + /** + * 验证名称 + * + * @param moduleId 功能主键 + * @param fullName 名称 + * @param id 主键值 + * @return ignore + */ + boolean isExistByFullName(String moduleId, String fullName, String id); + + /** + * 验证编码 + * + * @param moduleId 功能主键 + * @param enCode 编码 + * @param id 主键值 + * @return ignore + */ + boolean isExistByEnCode(String moduleId, String enCode, String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(ModuleButtonEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return ignore + */ + boolean update(String id, ModuleButtonEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(ModuleButtonEntity entity); + + /** + * 通过moduleIds获取按钮权限 + * + * @param ids + * @return + */ + List getListByModuleIds(List ids); + + /** + * 通过moduleIds获取按钮权限 + * + * @param ids + * @return + */ + List getListByIds(List ids); +} + diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/base/service/ModuleColumnService.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/base/service/ModuleColumnService.java new file mode 100644 index 0000000..146148d --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/base/service/ModuleColumnService.java @@ -0,0 +1,157 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.entity.ModuleButtonEntity; +import com.yunzhupaas.base.entity.ModuleColumnEntity; + +import java.util.List; + +/** + * 列表权限 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ + +public interface ModuleColumnService extends SuperService { + + /** + * 列表 + * + * @return ignore + */ + List getList(); + + /** + * 列表 + * + * @return ignore + */ + List getEnabledMarkList(String enabledMark); + + /** + * 列表 + * + * @param moduleId 功能主键 + * @param pagination 分页参数 + * @return ignore + */ + List getList(String moduleId, Pagination pagination); + + /** + * 列表 + * + * @param moduleId 功能主键 + * @return ignore + */ + List getList(String moduleId); + + /** + * 列表 + * + * @param bindTable 绑定表格Id + * @return ignore + */ + List getListByBindTable(String bindTable); + + /** + * 信息 + * + * @param id 主键值 + * @return ignore + */ + ModuleColumnEntity getInfo(String id); + + /** + * 通过id和菜单id获取详情 + * + * @param id 主键值 + * @param moduleId + * @return + */ + ModuleColumnEntity getInfo(String id, String moduleId); + + /** + * 验证名称 + * + * @param moduleId 功能主键 + * @param fullName 名称 + * @param id 主键值 + * @return ignore + */ + boolean isExistByFullName(String moduleId, String fullName, String id); + + /** + * 验证编码 + * + * @param moduleId 功能主键 + * @param enCode 编码 + * @param id 主键值 + * @return ignore + */ + boolean isExistByEnCode(String moduleId, String enCode, String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(ModuleColumnEntity entity); + + /** + * 创建 + * + * @param entitys 实体对象 + */ + void create(List entitys); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + */ + boolean update(String id, ModuleColumnEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(ModuleColumnEntity entity); + + /** + * 上移 + * + * @param id 主键值 + */ + boolean first(String id); + + /** + * 下移 + * + * @param id 主键值 + */ + boolean next(String id); + + /** + * 通过moduleIds获取权限 + * + * @param ids + * @return + */ + List getListByModuleId(List ids); + + /** + * 通过moduleIds获取权限 + * + * @param ids + * @return + */ + List getListByIds(List ids); +} + diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/base/service/ModuleDataAuthorizeSchemeService.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/base/service/ModuleDataAuthorizeSchemeService.java new file mode 100644 index 0000000..9d19a11 --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/base/service/ModuleDataAuthorizeSchemeService.java @@ -0,0 +1,111 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import com.yunzhupaas.base.entity.ModuleDataAuthorizeSchemeEntity; + +import java.util.List; + +/** + * 数据权限方案 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface ModuleDataAuthorizeSchemeService extends SuperService { + + /** + * 列表 + * + * @return ignore + */ + List getList(); + + /** + * 列表 + * + * @return ignore + */ + List getEnabledMarkList(String enabledMark); + + /** + * 列表 + * + * @param moduleId 功能主键 + * @return ignore + */ + List getList(String moduleId); + + /** + * 信息 + * + * @param id 主键值 + * @return ignore + */ + ModuleDataAuthorizeSchemeEntity getInfo(String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(ModuleDataAuthorizeSchemeEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return ignore + */ + boolean update(String id, ModuleDataAuthorizeSchemeEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(ModuleDataAuthorizeSchemeEntity entity); + + /** + * 判断名称是否重复 + * @param id + * @param fullName + * @return + */ + Boolean isExistByFullName(String id, String fullName, String moduleId); + + /** + * 判断名称是否重复 + * @param id + * @param enCode + * @return + */ + Boolean isExistByEnCode(String id, String enCode, String moduleId); + + /** + * 是否存在全部数据 + * @param moduleId + * @return + */ + Boolean isExistAllData(String moduleId); + + /** + * 通过moduleIds获取权限 + * + * @param ids + * @return + */ + List getListByModuleId(List ids); + + /** + * 通过moduleIds获取权限 + * + * @param ids + * @return + */ + List getListByIds(List ids); +} + diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/base/service/ModuleFormService.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/base/service/ModuleFormService.java new file mode 100644 index 0000000..1a89c5c --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/base/service/ModuleFormService.java @@ -0,0 +1,134 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.entity.ModuleFormEntity; + +import java.util.List; + +/** + * 表单权限 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-14 + */ +public interface ModuleFormService extends SuperService { + + /** + * 列表 + * + * @return ignore + */ + List getList(); + + /** + * 列表 + * + * @return ignore + */ + List getEnabledMarkList(String enabledMark); + + /** + * 列表 + * + * @param moduleId 功能主键 + * @param pagination 分页参数 + * @return ignore + */ + List getList(String moduleId, Pagination pagination); + + /** + * 列表 + * + * @param moduleId 功能主键 + * @return ignore + */ + List getList(String moduleId); + + /** + * 信息 + * + * @param id 主键值 + * @return ignore + */ + ModuleFormEntity getInfo(String id); + + /** + * 信息 + * + * @param id 主键值 + * @param moduleId + * @return ignore + */ + ModuleFormEntity getInfo(String id, String moduleId); + + /** + * 验证名称 + * + * @param moduleId 功能主键 + * @param fullName 名称 + * @param id 主键值 + * @return ignore + */ + boolean isExistByFullName(String moduleId, String fullName, String id); + + /** + * 验证编码 + * + * @param moduleId 功能主键 + * @param enCode 编码 + * @param id 主键值 + * @return ignore + */ + boolean isExistByEnCode(String moduleId, String enCode, String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(ModuleFormEntity entity); + + /** + * 创建 + * + * @param entitys 实体对象 + */ + void create(List entitys); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return ignore + */ + boolean update(String id, ModuleFormEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(ModuleFormEntity entity); + + /** + * 通过moduleIds获取权限 + * + * @param ids + * @return + */ + List getListByModuleId(List ids); + + /** + * 通过moduleIds获取权限 + * + * @param ids + * @return + */ + List getListByIds(List ids); +} + diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/base/service/ModuleService.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/base/service/ModuleService.java new file mode 100644 index 0000000..376d547 --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/base/service/ModuleService.java @@ -0,0 +1,258 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.entity.ModuleEntity; +import com.yunzhupaas.base.model.module.*; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.exception.DataException; + +import java.util.List; +import java.util.Map; + +/** + * 系统功能 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface ModuleService extends SuperService { + + /** + * 列表 + * + * @param filterFlowWork + * @param moduleAuthorize + * @param moduleUrlAddressAuthorize + * @return ignore + */ + List getList(boolean filterFlowWork, List moduleAuthorize, List moduleUrlAddressAuthorize); + + /** + * 列表 + * + * @return ignore + */ + List getList(); + + /** + * 列表 + * + * @param systemId 系统id + * @param category + * @param keyword + * @param parentId + * @param release + * @return ignore + */ + List getList(String systemId, String category, String keyword, Integer type, Integer enabledMark, String parentId, boolean release); + + /** + * 通过id获取子菜单 + * + * @param id 主键 + * @return ignore + */ + List getList(String id); + + /** + * 信息 + * + * @param id 主键值 + * @return ignore + */ + ModuleEntity getInfo(String id); + + /** + * 信息 + * + * @param id 主键值 + * @return ignore + */ + ModuleEntity getInfo(String id, String systemId); + + /** + * 信息 + * + * @param fullName 主键值 + * @return ignore + */ + List getInfoByFullName(String fullName, String systemId); + + /** + * 信息 + * + * @param id 主键值 + * @return ignore + */ + ModuleEntity getInfo(String id, String systemId, String parentId); + + /** + * 验证名称 + * + * @param entity ignore + * @param category 分类 + * @param systemId 分类 + * @return ignore + */ + boolean isExistByFullName(ModuleEntity entity, String category, String systemId); + + /** + * 验证编码 + * + * @param entity 实体 + * @param category 分类 + * @param systemId 分类 + * @return ignore + */ + boolean isExistByEnCode(ModuleEntity entity, String category, String systemId); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(ModuleEntity entity); + + /** + * 删除 + * + * @param systemId 实体对象 + */ + void deleteBySystemId(String systemId); + + + /** + * 删除权限(同步菜单 不处理数据权限) + * + * @param entity 实体对象 + */ + void deleteModule(ModuleEntity entity); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(ModuleEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return ignore + */ + boolean update(String id, ModuleEntity entity); + + /** + * 导出数据 + * + * @param id 主键 + * @return DownloadVO ignore + */ + DownloadVO exportData(String id); + + /** + * 导入数据 + * + * @param exportModel 导出模型 + * @param type + * @return ignore + * @throws DataException ignore + */ + ActionResult importData(ModuleExportModel exportModel, Integer type) throws DataException; + + /** + * 功能设计发布功能自动创建app pc菜单 + * + * @return + */ + List getModuleList(String visualId); + + /** + * 通过系统id获取菜单 + * + * @param ids + * @param moduleAuthorize + * @param moduleUrlAddressAuthorize + * @return + */ + List getModuleBySystemIds(List ids, List moduleAuthorize, List moduleUrlAddressAuthorize); + + /** + * 获取门户发布的菜单 + * + * @param portalIds + * @return + */ + List getModuleByPortal(List portalIds); + + /** + * 获取开发平台下的菜单 + * + * @param moduleAuthorize + * @param moduleUrlAddressAuthorize + * @param singletonOrg + * @return + */ + List getMainModule(List moduleAuthorize, List moduleUrlAddressAuthorize, boolean singletonOrg); + + List getModuleByIds(List moduleIds, List moduleAuthorize, List moduleUrlAddressAuthorize, boolean singletonOrg); + + /** + * 通过ids获取系统菜单 + * + * @param enCodeList + * @return + */ + List getListByEnCode(List enCodeList); + + /** + * @param mark + * @param id + * @param moduleAuthorize + * @param moduleUrlAddressAuthorize + * @return + */ + List findModuleAdmin(int mark, String id, List moduleAuthorize, List moduleUrlAddressAuthorize); + + void getParentModule(List data, Map moduleEntityMap); + + /** + * 通过urlAddressList找id + * + * @param ids + * @param urlAddressList + * @return + */ + List getListByUrlAddress(List ids, List urlAddressList); + + /** + * 功能发布app pc菜单名称列表 + * + * @return + */ + ModuleNameVO getModuleNameList(String visualId); + + /** + * 获取表单关联的菜单数据列表 + * + * @param page + * @return ignore + */ + List getFormMenuList(ModulePagination page); + + + /** + * 获取应用菜单列表 + * + * @param type 3代表表单 + * @param webType 页面类型(1、纯表单,2、表单加列表,4、数据视图) + * @param categorys 菜单类型(web,app) + * @return + */ + List getSystemMenu(Integer type, List webType, List categorys); +} + diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/base/service/ScheduleNewApi.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/base/service/ScheduleNewApi.java new file mode 100644 index 0000000..309888d --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/base/service/ScheduleNewApi.java @@ -0,0 +1,15 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.model.schedule.ScheduleNewCrForm; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/18 9:57 + */ +public interface ScheduleNewApi { + ActionResult create(ScheduleNewCrForm scheduleCrForm); +} diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/base/service/SystemConfigApi.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/base/service/SystemConfigApi.java new file mode 100644 index 0000000..2006b98 --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/base/service/SystemConfigApi.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.model.systemconfig.SysConfigModel; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/8/28 10:36 + */ +public interface SystemConfigApi { + /** + * 列表 + */ + ActionResult list(); +} diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/base/service/SystemService.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/base/service/SystemService.java new file mode 100644 index 0000000..866d0ee --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/base/service/SystemService.java @@ -0,0 +1,121 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.entity.SystemEntity; + +import java.util.List; + +/** + * 系统 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface SystemService extends SuperService { + + /** + * 获取列表 + * @return + */ + List getList(); + + /** + * 获取系统列表 + * + * @param keyword + * @param filterMain + * @param isList + * @param moduleAuthorize + * @return + */ + List getList(String keyword, Boolean filterEnableMark, boolean verifyAuth, Boolean filterMain, boolean isList, List moduleAuthorize); + + /** + * 获取详情 + * + * @param id + * @return + */ + SystemEntity getInfo(String id); + + /** + * 判断系统名称是否重复 + * + * @param id + * @param fullName + * @return + */ + Boolean isExistFullName(String id, String fullName); + + /** + * 判断系统编码是否重复 + * + * @param id + * @param enCode + * @return + */ + Boolean isExistEnCode(String id, String enCode); + + /** + * 新建 + * + * @param entity + * @return + */ + Boolean create(SystemEntity entity); + + /** + * 新建 + * + * @param entity + * @return + */ + Boolean update(String id, SystemEntity entity); + + /** + * 删除 + * + * @param id + * @return + */ + Boolean delete(String id); + + /** + * + * 通过id获取系统列表 + * + * @param list + * @param moduleAuthorize + * @return + */ + List getListByIds(List list, List moduleAuthorize); + + /** + * 通过编码获取系统信息 + * + * @param enCode + * @return + */ + SystemEntity getInfoByEnCode(String enCode); + + /** + * 获取 + * + * @param mark + * @param mainSystemCode + * @param moduleAuthorize + * @return + */ + List findSystemAdmin(int mark, String mainSystemCode, List moduleAuthorize); + + /** + * 获取 + * + * @param mark + * @param mainSystemCode + * @return + */ + List findSystemAdmin(int mark, String mainSystemCode); +} + diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/extend/service/DocumentApi.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/extend/service/DocumentApi.java new file mode 100644 index 0000000..dd63dae --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/extend/service/DocumentApi.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.extend.service; + +import com.yunzhupaas.model.document.FlowFileModel; + +import java.util.List; +import java.util.Map; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/6/20 16:14 + */ +public interface DocumentApi { + /** + * 判断是否存在归档文件 + * + * @param taskId 流程任务主键 + */ + Boolean checkFlowFile(String taskId); + + /** + * 获取归档文件 + * + * @param model 参数 + */ + List> getFlowFile(FlowFileModel model); +} diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/AccountConfigService.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/AccountConfigService.java new file mode 100644 index 0000000..faded52 --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/AccountConfigService.java @@ -0,0 +1,93 @@ +package com.yunzhupaas.message.service; + +import com.yunzhupaas.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; + + +import java.util.*; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.message.entity.AccountConfigEntity; +import com.yunzhupaas.message.model.accountconfig.*; + +/** + * 账号配置功能 + * 版本: V3.2.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2022-08-18 + */ +public interface AccountConfigService extends SuperService { + + + List getList(AccountConfigPagination accountConfigPagination); + + List getTypeList(AccountConfigPagination accountConfigPagination, String dataType); + + + AccountConfigEntity getInfo(String id); + + void delete(AccountConfigEntity entity); + + void create(AccountConfigEntity entity); + + boolean update(String id, AccountConfigEntity entity); + + /** + * + * @param type 配置类型 1:站内信,2:邮件,3:短信,4:钉钉,5:企业微信,6:webhook + * @return + */ + List getListByType(String type); + + /** + * 验证名称 + * + * @param fullName 名称 + * @param id 主键值 + * @return ignore + */ + boolean isExistByFullName(String fullName, String id); + + /** + * 验证编码 + * + * @param enCode 编码 + * @param id 主键值 + * @return ignore + */ + boolean isExistByEnCode(String enCode, String id,String type); + + /** + * 账号配置导入 + * + * @param entity 实体对象 + * @return ignore + * @throws DataException ignore + */ + ActionResult ImportData(AccountConfigEntity entity) throws DataException; + +// 子表方法 + + //列表子表数据方法 + + //验证表单 + boolean checkForm(AccountConfigForm form, int i,String type,String id); + + /** + * 验证微信公众号原始id唯一性 + * @param gzhId 微信公众号原始id + * @param i + * @param type + * @param id + * @return + */ + boolean checkGzhId(String gzhId, int i,String type,String id); + + AccountConfigEntity getInfoByType(String appKey, String type); + + AccountConfigEntity getInfoByEnCode(String enCode,String type); +} + diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/MessageMonitorService.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/MessageMonitorService.java new file mode 100644 index 0000000..2ffa073 --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/MessageMonitorService.java @@ -0,0 +1,55 @@ +package com.yunzhupaas.message.service; + + +import com.yunzhupaas.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.*; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.message.entity.MessageMonitorEntity; +import com.yunzhupaas.message.model.messagemonitor.*; + +/** + * 消息监控 + * 版本: V3.2.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2022-08-22 + */ +public interface MessageMonitorService extends SuperService { + + + List getList(MessageMonitorPagination messageMonitorPagination); + + List getTypeList(MessageMonitorPagination messageMonitorPagination, String dataType); + + + MessageMonitorEntity getInfo(String id); + + void delete(MessageMonitorEntity entity); + + void create(MessageMonitorEntity entity); + + boolean update(String id, MessageMonitorEntity entity); + +// 子表方法 + + //列表子表数据方法 + + //验证表单 + boolean checkForm(MessageMonitorForm form, int i); + + + String userSelectValues(String ids); + + /** + * 删除 + * @param ids + * @return + */ + boolean delete(String[] ids); + + void emptyMonitor(); +} + diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/MessageService.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/MessageService.java new file mode 100644 index 0000000..fb4bfb2 --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/MessageService.java @@ -0,0 +1,228 @@ +package com.yunzhupaas.message.service; + + +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.MessageTemplateEntity; +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.message.entity.MessageEntity; +import com.yunzhupaas.message.entity.MessageReceiveEntity; +import com.yunzhupaas.message.model.NoticePagination; +import com.yunzhupaas.message.model.SentMessageForm; +import com.yunzhupaas.message.model.message.NoticeVO; +import com.yunzhupaas.message.model.message.PaginationMessage; + +import java.util.List; +import java.util.Map; + +/** + * 消息实例 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface MessageService extends SuperService { + + /** + * 列表(通知公告) + * + * @param pagination + * @return + */ + List getNoticeList(NoticePagination pagination); + + /** + * 列表(通知公告) + * + * @return + */ + List getNoticeList(); + + /** + * 列表(通知公告) + * 门户专用 + * + * @return + */ + List getDashboardNoticeList(List typeList); + + + /** + * 获取全部数据 + * + * @param pagination + * @param type 类别 + * @return + */ + List getMessageList3(Pagination pagination, Integer type, String user, Integer isRead); + + /** + * 获取消息列表(可选字段) + * + * @param pagination + * @return + */ + List getMessageColumnList(PaginationMessage pagination, SFunction... columns); + + /** + * 列表(通知公告/系统消息/私信消息) + * + * @param pagination + * @return + */ + List getMessageList(Pagination pagination); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + MessageEntity getInfo(String id); + + /** + * 默认消息 + * + * @param type 类别:1-通知公告/2-系统消息 + * @return + */ + MessageEntity getInfoDefault(int type); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(MessageEntity entity); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(MessageEntity entity); + + /** + * 更新 + * + * @param entity 实体对象 + */ + boolean update(String id, MessageEntity entity); + + /** + * 消息已读(单条) + * + * @param messageId 消息主键 + */ + MessageReceiveEntity messageRead(String messageId); + + /** + * 消息已读(全部) + */ + void messageRead(List idList); + + /** + * 删除记录 + * + * @param messageIds 消息Id + */ + void deleteRecord(List messageIds); + + /** + * 获取消息未读数量 + * + * @param userId 用户主键 + * @return + */ + int getUnreadCount(String userId, Integer type); + + /** + * 发送公告 + * + * @param toUserIds 发送用户 + * @param entity 消息信息 + */ + boolean sentNotice(List toUserIds, MessageEntity entity); + + /** + * 发送消息 + * + * @param toUserIds 发送用户 + * @param title 标题 + */ + void sentMessage(List toUserIds, String title); + + /** + * 发送消息 + * + * @param toUserIds 发送用户 + * @param title 标题 + * @param bodyText 内容 + */ + void sentMessage(List toUserIds, String title, String bodyText); + + /** + * 发送消息 + * + * @param toUserIds 发送用户 + * @param title 标题 + * @param bodyText 内容 + * @param contentMsg 站内信息 + */ + void sentMessage(List toUserIds, String title, String bodyText, Map contentMsg, UserInfo userInfo); + + /** + * 发送消息 + * + * @param toUserIds 发送用户 + * @param title 标题 + * @param bodyText 内容 + */ + void sentMessage(List toUserIds, String title, String bodyText, UserInfo userInfo, Integer source, Integer type); + + /** + * 发送消息 + * + * @param toUserIds 发送用户 + * @param title 标题 + * @param bodyText 内容 + * @param testMessage 是否为测试消息 + */ + void sentMessage(List toUserIds, String title, String bodyText, UserInfo userInfo, Integer source, Integer type, boolean testMessage); + + /** + * 发送消息 + * + * @param toUserIds 发送用户 + * @param entity 消息实体 + * @param content 内容 + */ + void sentFlowMessage(List toUserIds, MessageTemplateEntity entity, String content); + + /** + * 退出在线的WebSocket 可选参数 + * + * @param token Token 精准退出用户 + * @param userId 退出用户的全部会话 + */ + void logoutWebsocketByToken(String token, String userId); + + /** + * 日程发送消息 + */ + List sentScheduleMessage(SentMessageForm sentMessageForm, String type); + + + /** + * 通过过期时间刷新状态 + * + * @return + */ + Boolean updateEnabledMark(); + + List getNoticeList(List list); +} + diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/MessageTemplateConfigService.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/MessageTemplateConfigService.java new file mode 100644 index 0000000..91d63a1 --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/MessageTemplateConfigService.java @@ -0,0 +1,96 @@ +package com.yunzhupaas.message.service; + + +import com.yunzhupaas.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.*; + +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.message.entity.MessageTemplateConfigEntity; +import com.yunzhupaas.message.entity.SmsFieldEntity; +import com.yunzhupaas.message.entity.TemplateParamEntity; +import com.yunzhupaas.message.model.messagetemplateconfig.*; + +/** + * 消息模板(新) + * 版本: V3.2.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2022-08-18 + */ +public interface MessageTemplateConfigService extends SuperService { + + + List getList(MessageTemplateConfigPagination MessageTemplateConfigPagination); + + List getTypeList(MessageTemplateConfigPagination MessageTemplateConfigPagination, String dataType); + + + MessageTemplateConfigEntity getInfo(String id); + + MessageTemplateConfigEntity getInfoByEnCode(String enCode,String messageType); + + void delete(MessageTemplateConfigEntity entity); + + void create(MessageTemplateConfigEntity entity); + + boolean update(String id, MessageTemplateConfigEntity entity); + + // 子表方法 + List getTemplateParamList(String id, MessageTemplateConfigPagination MessageTemplateConfigPagination); + + List getTemplateParamList(String id); + + List getSmsFieldList(String id, MessageTemplateConfigPagination MessageTemplateConfigPagination); + + List getSmsFieldList(String id); + + //列表子表数据方法 + + //验证表单 + boolean checkForm(MessageTemplateConfigForm form, int i,String id); + + /** + * 验证名称 + * + * @param fullName 名称 + * @param id 主键值 + * @return ignore + */ + boolean isExistByFullName(String fullName, String id); + + /** + * 验证编码 + * + * @param enCode 编码 + * @param id 主键值 + * @return ignore + */ + boolean isExistByEnCode(String enCode, String id); + + /** + * 消息模板导入 + * + * @param entity 实体对象 + * @return ignore + * @throws DataException ignore + */ + ActionResult ImportData(MessageTemplateConfigEntity entity) throws DataException; + +// /** +// * 获取模板被引用的参数(用json格式存储参数数据) +// * @param id 模板id +// * @return +// */ +// List getParamJson(String id); + + /** + * 获取模板被引用的参数(消息模板参数数据用子表保存) + * @param id 模板id + * @return + */ + List getParamJson(String id); +} + diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/MessagereceiveService.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/MessagereceiveService.java new file mode 100644 index 0000000..8eefb7a --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/MessagereceiveService.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.message.service; + + +import com.yunzhupaas.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import com.yunzhupaas.message.entity.MessageReceiveEntity; + +/** + * 消息接收 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface MessagereceiveService extends SuperService { + +} + diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/SendConfigTemplateService.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/SendConfigTemplateService.java new file mode 100644 index 0000000..9a8b36c --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/SendConfigTemplateService.java @@ -0,0 +1,41 @@ +package com.yunzhupaas.message.service; + + +import com.yunzhupaas.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; + + +import java.util.*; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.message.entity.SendConfigTemplateEntity; +import com.yunzhupaas.message.entity.TemplateParamEntity; +import com.yunzhupaas.message.model.sendmessageconfig.SendMessageConfigPagination; + +/** + * 消息发送配置 + * 版本: V3.2.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2022-08-19 + */ +public interface SendConfigTemplateService extends SuperService { + + QueryWrapper getChild(SendMessageConfigPagination pagination, QueryWrapper sendConfigTemplateQueryWrapper); + + SendConfigTemplateEntity getInfo(String id); + + List getDetailListByParentId(String id); + + /** + * 根据消息发送配置id获取启用的配置模板 + * @param id + * @return + */ + List getConfigTemplateListByConfigId(String id); + + boolean isUsedAccount(String accountId); + + boolean isUsedTemplate(String templateId); +} + diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/SendMessageConfigService.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/SendMessageConfigService.java new file mode 100644 index 0000000..747fe5c --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/SendMessageConfigService.java @@ -0,0 +1,110 @@ +package com.yunzhupaas.message.service; + +import com.yunzhupaas.base.service.SuperService; + +import java.util.*; + +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.message.entity.SendConfigTemplateEntity; +import com.yunzhupaas.message.entity.SendMessageConfigEntity; +import com.yunzhupaas.message.model.sendmessageconfig.*; + +/** + * 消息发送配置 + * 版本: V3.2.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2022-08-19 + */ +public interface SendMessageConfigService extends SuperService { + + + List getList(SendMessageConfigPagination sendMessageConfigPagination, String dataType); + + /** + * 获取列表 + * + * @return + */ + List getSelectorList(SendMessageConfigPagination sendMessageConfigPagination); + + + SendMessageConfigEntity getInfo(String id); + + SendMessageConfigEntity getInfoByEnCode(String enCode); + + SendMessageConfigEntity getSysConfig(String enCode,String type); + + void delete(SendMessageConfigEntity entity); + + void create(SendMessageConfigEntity entity); + + boolean update(String id, SendMessageConfigEntity entity); + + // 子表方法 + List getSendConfigTemplateList(String id, SendMessageConfigPagination sendMessageConfigPagination); + + List getSendConfigTemplateList(String id); + + //列表子表数据方法 + + //验证表单 + boolean checkForm(SendMessageConfigForm form, int i,String id); + + /** + * 验证名称 + * + * @param fullName 名称 + * @param id 主键值 + * @return ignore + */ + boolean isExistByFullName(String fullName, String id); + + /** + * 验证编码 + * + * @param enCode 编码 + * @param id 主键值 + * @return ignore + */ + boolean isExistByEnCode(String enCode, String id); + + /** + * 消息发送配置导入 + * + * @param entity 实体对象 + * @return ignore + * @throws DataException ignore + */ + ActionResult ImportData(SendMessageConfigEntity entity) throws DataException; + + List getList(List idList); + + /** + * 更新配置被调用id(usedId) + * @param id + * @param idList + */ + void updateUsed(String id,List idList); + + /** + * 删除配置被调用id(usedId) + * @param id + * @param sendConfigIdList + */ + void removeUsed(String id,List sendConfigIdList); + + /** + * 差集(基于常规解法)优化解法1 适用于中等数据量 + * 求List1中有的但是List2中没有的元素 + * 空间换时间降低时间复杂度 + * 时间复杂度O(Max(list1.size(),list2.size())) + */ + List subList(List list1, List list2); + + boolean idUsed(String id); + + +} + diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/ShortLinkService.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/ShortLinkService.java new file mode 100644 index 0000000..4bb8731 --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/ShortLinkService.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.message.service; + +import com.yunzhupaas.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.*; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.message.entity.ShortLinkEntity; +import com.yunzhupaas.message.entity.SmsFieldEntity; +import com.yunzhupaas.message.model.messagetemplateconfig.*; + +/** + * + * 消息模板(新) + * 版本: V3.2.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2022-08-18 + */ +public interface ShortLinkService extends SuperService { + + String shortLink (String link); + + ShortLinkEntity getInfoByLink(String link); +} + diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/SmsFieldService.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/SmsFieldService.java new file mode 100644 index 0000000..e53a697 --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/SmsFieldService.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.message.service; + +import com.yunzhupaas.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.*; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.message.entity.SmsFieldEntity; +import com.yunzhupaas.message.model.messagetemplateconfig.*; + +/** + * + * 消息模板(新) + * 版本: V3.2.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2022-08-18 + */ +public interface SmsFieldService extends SuperService { + + QueryWrapper getChild(MessageTemplateConfigPagination pagination, QueryWrapper smsFieldQueryWrapper); + + SmsFieldEntity getInfo(String id); + + List getDetailListByParentId(String id); + + List getParamList(String id,List params); + + Map getParamMap(String templateId,Map map); +} + diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/SynThirdDingTalkService.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/SynThirdDingTalkService.java new file mode 100644 index 0000000..c2659af --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/SynThirdDingTalkService.java @@ -0,0 +1,245 @@ +package com.yunzhupaas.message.service; + +import com.alibaba.fastjson.JSONObject; +import com.dingtalk.api.response.OapiV2UserListResponse; +import com.yunzhupaas.message.model.message.DingTalkDeptModel; +import com.yunzhupaas.message.model.message.DingTalkUserModel; +import com.yunzhupaas.model.BaseSystemInfo; +import com.yunzhupaas.permission.entity.OrganizeEntity; +import com.yunzhupaas.permission.entity.UserEntity; + +import java.text.ParseException; +import java.util.List; + +/** + * 钉钉组织-部门-用户的同步业务 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021/5/7 8:42 + */ +public interface SynThirdDingTalkService { + + /** + * 获取钉钉的配置信息 + * @return + */ + BaseSystemInfo getDingTalkConfig(); + + + //------------------------------------本系统同步公司、部门到钉钉------------------------------------- + + /** + * 本地同步单个公司或部门到钉钉(供调用) + * 带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param dingDeptListPara 单条执行时为null + * @return + */ +// JSONObject createDepartmentSysToDing(boolean isBatch, OrganizeEntity deptEntity, List dingDeptListPara); + + + /** + * 本地更新单个公司或部门到钉钉(供调用) + * 带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param dingDeptListPara 单条执行时为null + * @return + */ +// JSONObject updateDepartmentSysToDing(boolean isBatch, OrganizeEntity deptEntity, List dingDeptListPara); + + + /** + * 本地删除单个公司或部门,同步到钉钉(供调用) + * 带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param id 本系统的公司或部门ID + * @param dingDeptListPara 单条执行时为null + * @return + */ +// JSONObject deleteDepartmentSysToDing(boolean isBatch, String id, List dingDeptListPara); + + + + /** + * 本地同步单个公司或部门到钉钉(供调用) + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param accessToken (单条调用时为空) + * @return + */ + JSONObject createDepartmentSysToDing(boolean isBatch, OrganizeEntity deptEntity,String accessToken); + + + /** + * 本地更新单个公司或部门到钉钉(供调用) + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param accessToken (单条调用时为空) + * @return + */ + JSONObject updateDepartmentSysToDing(boolean isBatch, OrganizeEntity deptEntity,String accessToken); + + + /** + * 本地删除单个公司或部门,同步到钉钉(供调用) + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param id 本系统的公司或部门ID + * @param accessToken (单条调用时为空) + * @return + */ + JSONObject deleteDepartmentSysToDing(boolean isBatch, String id,String accessToken); + + + + //------------------------------------本系统同步用户到钉钉------------------------------------- + + /** + * 本地用户创建同步到钉钉的用户(单个) + * 带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param userEntity + * @param dingDeptListPara 单条执行时为null + * @param dingUserListPara 单条执行时为null + * @return + */ +// JSONObject createUserSysToDing(boolean isBatch, UserEntity userEntity, List dingDeptListPara, +// List dingUserListPara) throws ParseException; + + + /** + * 本地更新用户信息或部门到钉钉的成员用户(单个) + * 带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param userEntity + * @param dingDeptListPara 单条执行时为null + * @param dingUserListPara 单条执行时为null + * @return + */ +// JSONObject updateUserSysToDing(boolean isBatch, UserEntity userEntity, List dingDeptListPara, +// List dingUserListPara) throws ParseException; + + + /** + * 本地删除单个用户,同步到钉钉用户 + * 带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param id 本系统的公司或部门ID + * @param dingDeptListPara 单条执行时为null + * @param dingUserListPara 单条执行时为null + * @return + */ +// JSONObject deleteUserSysToDing(boolean isBatch, String id, List dingDeptListPara, +// List dingUserListPara); + + + + /** + * 本地用户创建同步到钉钉的用户(单个) + * 不带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param userEntity + * @param accessToken (单条调用时为空) + * @return + */ + JSONObject createUserSysToDing(boolean isBatch, UserEntity userEntity,String accessToken) throws ParseException; + + + /** + * 本地更新用户信息或部门到钉钉的成员用户(单个) + * 不带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param userEntity + * @param accessToken (单条调用时为空) + * @return + */ + JSONObject updateUserSysToDing(boolean isBatch, UserEntity userEntity,String accessToken) throws ParseException; + + + /** + * 本地删除单个用户,同步到钉钉用户 + * 不带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * @param isBatch 是否批量(批量不受开关限制) + * @param id 本系统的公司或部门ID + * @param accessToken (单条调用时为空) + * @return + */ + JSONObject deleteUserSysToDing(boolean isBatch, String id,String accessToken); + + //------------------------------------钉钉同步公司、部门到本系统20220330------------------------------------- + + /** + * 钉钉同步单个公司或部门到本地(供调用) + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20220331 + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param accessToken (单条调用时为空) + * @return + */ + JSONObject createDepartmentDingToSys(boolean isBatch, DingTalkDeptModel deptEntity,String accessToken); + + /** + * 本地更新单个公司或部门到钉钉(供调用) + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20220331 + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param accessToken (单条调用时为空) + * @return + */ + JSONObject updateDepartmentDingToSys(boolean isBatch, DingTalkDeptModel deptEntity,String accessToken); + + /** + * 本地删除单个公司或部门,同步到钉钉(供调用) + * 不带错误定位判断的功能代码,只获取调用接口的返回信息 20220331 + * @param isBatch 是否批量(批量不受开关限制) + * @param id 第三方的公司或部门ID + * @return + */ + JSONObject deleteDepartmentDingToSys(boolean isBatch, String id); + + //------------------------------------钉钉同步用户到本系统20220331------------------------------------- + + + /** + * 本地用户创建同步到钉钉的用户(单个) + * 不带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20220331 + * @param isBatch 是否批量(批量不受开关限制) + * @param dingUserModel + * @param accessToken (单条调用时为空) + * @return + */ + JSONObject createUserDingToSys(boolean isBatch, OapiV2UserListResponse.ListUserResponse dingUserModel, String accessToken) throws Exception; + + + /** + * 本地更新用户信息或部门到钉钉的成员用户(单个) + * 不带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20220331 + * @param isBatch 是否批量(批量不受开关限制) + * @param userEntity + * @param accessToken (单条调用时为空) + * @return + */ + JSONObject updateUserDingToSys(boolean isBatch, UserEntity userEntity,String accessToken) throws ParseException; + + + /** + * 本地删除用户、中间表 + * 不带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20220331 + * @param isBatch 是否批量(批量不受开关限制) + * @param id 钉钉的用户ID + * @return + */ + JSONObject deleteUserDingToSys(boolean isBatch, String id) throws Exception; + + JSONObject updateUserDingToSystem(boolean isBatch, OapiV2UserListResponse.ListUserResponse dingUserModel) throws Exception; + + void deleteSyncByBothWay(String thirdTypeDing, String id); + +} + diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/SynThirdInfoService.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/SynThirdInfoService.java new file mode 100644 index 0000000..833e3fe --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/SynThirdInfoService.java @@ -0,0 +1,83 @@ +package com.yunzhupaas.message.service; + +import com.yunzhupaas.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import com.yunzhupaas.message.entity.SynThirdInfoEntity; +import com.yunzhupaas.message.util.SynThirdTotal; + +import java.util.List; + +/** + * 第三方工具的公司-部门-用户同步表模型 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021/4/23 17:29 + */ +public interface SynThirdInfoService extends SuperService { + + /** + * 获取指定第三方工具、指定数据类型的数据列表 + * @param thirdType + * @param dataType + * @return + */ + List getList(String thirdType,String dataType); + + /** + * 获取同步的详细信息 + * @param id + * @return + */ + SynThirdInfoEntity getInfo(String id); + + void create(SynThirdInfoEntity entity); + + boolean update(String id,SynThirdInfoEntity entity); + + void delete(SynThirdInfoEntity entity); + + /** + * 获取指定第三方工具、指定数据类型、对象ID的同步信息 + * @param thirdType + * @param dataType + * @param id + * @return + */ + SynThirdInfoEntity getInfoBySysObjId(String thirdType,String dataType,String id); + + /** + * 获取指定第三方工具、指定数据类型的同步统计信息 + * @param thirdType + * @param dataType + * @return + */ + SynThirdTotal getSynTotal(String thirdType,String dataType); + + /** + * + * @param thirdToSysType + * @param dataTypeOrg + * @param SysToThirdType + * @return + */ + List syncThirdInfoByType(String thirdToSysType, String dataTypeOrg, String SysToThirdType); + + boolean getBySysObjId(String id); + + String getSysByThird(String valueOf); + + void initBaseDept(Long dingRootDeptId, String access_token, String thirdType); + + /** + * 获取指定第三方工具、指定数据类型、第三方对象ID的同步信息 20220331 + * @param thirdType + * @param dataType + * @param thirdObjId + * @return + */ + SynThirdInfoEntity getInfoByThirdObjId(String thirdType,String dataType,String thirdObjId); + +} + diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/SynThirdQyService.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/SynThirdQyService.java new file mode 100644 index 0000000..9d26146 --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/SynThirdQyService.java @@ -0,0 +1,125 @@ +package com.yunzhupaas.message.service; + +import com.alibaba.fastjson.JSONObject; +import com.dingtalk.api.response.OapiV2UserListResponse; +import com.yunzhupaas.exception.WxErrorException; +import com.yunzhupaas.message.model.message.DingTalkDeptModel; +import com.yunzhupaas.message.model.message.QyWebChatDeptModel; +import com.yunzhupaas.message.model.message.QyWebChatUserModel; +import com.yunzhupaas.model.BaseSystemInfo; +import com.yunzhupaas.permission.entity.OrganizeEntity; +import com.yunzhupaas.permission.entity.UserEntity; + +/** + * 本系统的公司、部门、用户与企业微信的同步 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021/4/27 11:12 + */ +public interface SynThirdQyService { + + /** + * 获取企业微信的配置信息 + * @return + */ + BaseSystemInfo getQyhConfig(); + + //------------------------------------本系统同步公司、部门到企业微信------------------------------------- + + /** + * 本地同步单个公司或部门到企业微信(供调用) + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param accessToken (单条调用时为空) + * @return + * @throws WxErrorException + */ + JSONObject createDepartmentSysToQy(boolean isBatch, OrganizeEntity deptEntity,String accessToken) throws WxErrorException; + + /** + * 本地更新单个公司或部门到企业微信(供调用) + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param accessToken (单条调用时为空) + * @return + * @throws WxErrorException + */ + JSONObject updateDepartmentSysToQy(boolean isBatch, OrganizeEntity deptEntity,String accessToken) throws WxErrorException; + + /** + * 本地删除单个公司或部门,同步到企业微信(供调用) + * @param isBatch 是否批量(批量不受开关限制) + * @param id 本系统的公司或部门ID + * @param accessToken (单条调用时为空) + * @return + * @throws WxErrorException + */ + JSONObject deleteDepartmentSysToQy(boolean isBatch, String id,String accessToken) throws WxErrorException; + + + //------------------------------------本系统同步用户到企业微信------------------------------------- + + /** + * 本地用户创建同步到企业微信的成员(单个) + * @param isBatch 是否批量(批量不受开关限制) + * @param userEntity + * @param accessToken (单条调用时为空) + * @return + * @throws WxErrorException + */ + JSONObject createUserSysToQy(boolean isBatch, UserEntity userEntity,String accessToken) throws WxErrorException; + + /** + * 本地更新用户信息或部门到企业微信的成员信息(单个) + * @param isBatch 是否批量(批量不受开关限制) + * @param userEntity + * @param accessToken (单条调用时为空) + * @return + * @throws WxErrorException + */ + JSONObject updateUserSysToQy(boolean isBatch, UserEntity userEntity,String accessToken) throws WxErrorException; + + /** + * 本地删除单个用户,同步到企业微信成员 + * @param isBatch 是否批量(批量不受开关限制) + * @param id 本系统的公司或部门ID + * @param accessToken (单条调用时为空) + * @return + * @throws WxErrorException + */ + JSONObject deleteUserSysToQy(boolean isBatch, String id,String accessToken) throws WxErrorException; + + //------------------------------------企业微信同步公司、部门到本系统20220613------------------------------------- + + /** + * 企业微信同步公司或部门到本地(供调用) + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param accessToken (单条调用时为空) + * @return + */ + JSONObject createDepartmentQyToSys(boolean isBatch, QyWebChatDeptModel deptEntity, String accessToken); + + /** + * 企业微信同步更新公司或部门到本地(供调用) + * @param isBatch 是否批量(批量不受开关限制) + * @param deptEntity + * @param accessToken (单条调用时为空) + * @return + */ + JSONObject updateDepartmentQyToSys(boolean isBatch, QyWebChatDeptModel deptEntity,String accessToken); + + /** + * 企业微信往本地同步用户 + * @param isBatch 是否批量(批量不受开关限制) + * @param qyWebChatUserModel + * @return + */ + JSONObject createUserQyToSys(boolean isBatch, QyWebChatUserModel qyWebChatUserModel,String access_token)throws Exception; + + JSONObject updateUserQyToSystem(boolean isBatch, QyWebChatUserModel qyWebChatUserModel,String access_token) throws Exception; + +} + diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/TemplateParamService.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/TemplateParamService.java new file mode 100644 index 0000000..089387b --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/TemplateParamService.java @@ -0,0 +1,28 @@ +package com.yunzhupaas.message.service; + +import com.yunzhupaas.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; + +import com.yunzhupaas.message.entity.TemplateParamEntity; +import com.yunzhupaas.message.model.messagetemplateconfig.*; +import java.util.*; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +/** + * + * 消息模板(新) + * 版本: V3.2.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2022-08-18 + */ +public interface TemplateParamService extends SuperService { + + QueryWrapper getChild(MessageTemplateConfigPagination pagination, QueryWrapper templateParamQueryWrapper); + + TemplateParamEntity getInfo(String id); + + List getDetailListByParentId(String id); + + List getParamList(String id,List params); +} + diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/WechatUserService.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/WechatUserService.java new file mode 100644 index 0000000..27c2c0b --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/message/service/WechatUserService.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.message.service; + +import com.yunzhupaas.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.*; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.message.entity.WechatUserEntity; + +/** + * + * 消息模板(新) + * 版本: V3.2.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2022-08-18 + */ +public interface WechatUserService extends SuperService { + + WechatUserEntity getInfoByGzhId(String userId,String gzhId); + + void create(WechatUserEntity entity); + + boolean update(String id, WechatUserEntity entity); + + void delete(WechatUserEntity entity); + +} + diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/permission/service/AuthorizeService.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/permission/service/AuthorizeService.java new file mode 100644 index 0000000..f3d528d --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/permission/service/AuthorizeService.java @@ -0,0 +1,161 @@ +package com.yunzhupaas.permission.service; + +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.SystemEntity; +import com.yunzhupaas.base.model.portalManage.PortalModel; +import com.yunzhupaas.base.model.portalManage.SavePortalAuthModel; +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.database.model.superQuery.SuperJsonModel; +import com.yunzhupaas.model.login.UserSystemVO; +import com.yunzhupaas.permission.entity.AuthorizeEntity; +import com.yunzhupaas.permission.model.authorize.AuthorizeDataUpForm; +import com.yunzhupaas.permission.model.authorize.AuthorizeVO; +import com.yunzhupaas.permission.model.authorize.SaveBatchForm; + +import java.util.List; + +/** + * 操作权限 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public interface AuthorizeService extends SuperService { + + + /** + * 获取权限(菜单、按钮、列表) + * + * @param isCache 是否存在redis + * @param singletonOrg + * @return + */ + AuthorizeVO getAuthorize(boolean isCache, boolean singletonOrg); + + /** + * 获取权限(菜单、按钮、列表) + * + * @param isCache 是否存在redis + * @param singletonOrg + * @return + */ + AuthorizeVO getAuthorize(boolean isCache, boolean singletonOrg, boolean isMainSystem); + + /** + * 创建 + * + * @param objectId 对象主键 + * @param authorizeList 实体对象 + */ + void save(String objectId, AuthorizeDataUpForm authorizeList); + + /** + * 创建 + * + * @param saveBatchForm 对象主键 + */ + void saveBatch(SaveBatchForm saveBatchForm, boolean isBatch); + + /** + * 根据用户id获取列表 + * + * @param isAdmin 是否管理员 + * @param userId 用户主键 + * @return + */ + List getListByUserId(boolean isAdmin, String userId); + + /** + * 根据对象Id获取列表 + * + * @param objectId 对象主键 + * @return + */ + List getListByObjectId(List objectId); + + /** + * 判断当前角色是否有权限 + * + * @param roleId + * @param systemId + * @return + */ + Boolean existAuthorize(String roleId, String systemId); + + /** + * 判断当前角色是否有权限 + * + * @param roleId + * @return + */ + List getListByRoleId(String roleId); + + /** + * 根据对象Id获取列表 + * + * @param objectId 对象主键 + * @param itemType 对象主键 + * @return + */ + List getListByObjectId(String objectId, String itemType); + + /** + * 根据对象Id获取列表 + * + * @param objectType 对象主键 + * @return + */ + List getListByObjectAndItem(String itemId, String objectType); + + /** + * 根据对象Id获取列表 + * + * @param itemId 对象主键 + * @param itemType 对象类型 + * @return + */ + List getListByObjectAndItemIdAndType(String itemId, String itemType); + + void getPortal(List systemList, List portalList, Long dateTime, List collect); + + void saveItemAuth(SavePortalAuthModel portalAuthModel); + + void saveObjectAuth(SavePortalAuthModel portalAuthModel); + + List getConditionSql(String moduleId); + + /** + * 通过Item获取权限列表 + * + * @param itemType + * @param itemId + * @return + */ + List getAuthorizeByItem(String itemType, String itemId); + + AuthorizeVO getAuthorizeByUser(boolean singletonOrg); + + AuthorizeVO getMainSystemAuthorize(List moduleIds, List moduleAuthorize, List moduleUrlAddressAuthorize, boolean singletonOrg); + + List getListByRoleIdsAndItemType(List roleIds, String itemType); + + List getUserStanding(boolean isLogin, String userId); + + List getUserStanding(boolean isLogin, String userId, String loginDevice); + + AuthorizeVO getAuthorize(UserInfo userInfo, boolean singletonOrg, Integer stand, boolean isMainSystem); + + void removeAuthByUserOrMenu(List userIds, List menuIds); + + /** + * 获取用户当前身份 + * + * @param userId 用户id + * @param standType 身份类型:1-超级管理员,2-管理员,3普通用户 + * @return + */ + boolean getUserCurrentStanding(String userId, Integer standType); +} + diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/permission/service/GroupService.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/permission/service/GroupService.java new file mode 100644 index 0000000..0f5cfea --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/permission/service/GroupService.java @@ -0,0 +1,110 @@ +package com.yunzhupaas.permission.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.permission.entity.GroupEntity; +import com.yunzhupaas.permission.model.usergroup.PaginationGroup; + +import java.util.List; +import java.util.Map; + +/** + * 用户管理业务层 + * + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/3/10 17:59 + */ +public interface GroupService extends SuperService { + + /** + * 获取用户列表 + * + * @param pagination 关键字 + * @return + */ + List getList(PaginationGroup pagination); + + /** + * 获取所有格分组信息 + * + * @return + */ + List list(); + + Map getGroupMap(); + + /** + * fullName/encode,id + * @return + */ + Map getGroupEncodeMap(); + + Map getGroupEncodeMap(boolean enabledMark); + + /** + * 获取用户详情 + * + * @param id + * @return + */ + GroupEntity getInfo(String id); + + /** + * 获取分组详情 + * + * @param fullName + * @param encode + * @return + */ + GroupEntity getInfo(String fullName, String encode); + + /** + * 添加 + * + * @param entity + */ + void crete(GroupEntity entity); + + /** + * 修改 + * + * @param id + * @param entity + */ + Boolean update(String id, GroupEntity entity); + + /** + * 删除 + * + * @param entity + */ + void delete(GroupEntity entity); + + /** + * 判断名称是否重复 + * + * @param fullName + * @param id + * @return + */ + Boolean isExistByFullName(String fullName, String id); + + /** + * 判断编码是否重复 + * + * @param enCode + * @param id + * @return + */ + Boolean isExistByEnCode(String enCode, String id); + + /** + * 通过分组id获取分组集合 + * + * @param list + * @return + */ + List getListByIds(List list, Boolean filter); +} + diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/permission/service/OrganizeAdministratorService.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/permission/service/OrganizeAdministratorService.java new file mode 100644 index 0000000..1cf2160 --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/permission/service/OrganizeAdministratorService.java @@ -0,0 +1,139 @@ +package com.yunzhupaas.permission.service; + + +import com.yunzhupaas.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.permission.entity.OrganizeAdministratorEntity; +import com.yunzhupaas.permission.entity.OrganizeEntity; +import com.yunzhupaas.permission.model.organizeadministrator.OrganizeAdministratorListVo; +import com.yunzhupaas.permission.model.organizeadministrator.OrganizeAdministratorModel; + +import java.util.List; + +/** + * + * 机构分级管理员 + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public interface OrganizeAdministratorService extends SuperService { + + + + /** + * 获取 机构分级管理员信息 + * @param userId + * @param organizeId + * @return + */ + OrganizeAdministratorEntity getOne(String userId, String organizeId); + + /** + * 根据userId获取列表 + * @param userId + * @return + */ + List getOrganizeAdministratorEntity(String userId); + + /** + * 根据userId获取列表 + * @param userId + * @param type 分管对象类型 PermissionConst.ORGANIZE、PermissionConst.SYSTEM {@link com.yunzhupaas.constant.PermissionConst} + * @param filterMain + * @return + */ + List getOrganizeAdministratorEntity(String userId, String type, boolean filterMain); + + /** + * 根据userId获取列表 + * @param userId + * @param type 分管对象类型 PermissionConst.ORGANIZE、PermissionConst.SYSTEM {@link com.yunzhupaas.constant.PermissionConst} + * @return + */ + List getOrganizeAdministratorEntity(String userId, String type); + + /** + * 新建 + * @param entity 实体对象 + */ + void create(OrganizeAdministratorEntity entity); + + /** + * 新建 + * @param list + */ + void createList(List list, String userId); + + /** + * 更新 + * @param id 主键值 + * @param entity 实体对象 + */ + boolean update(String id, OrganizeAdministratorEntity entity); + + /** + * 删除 + * @param userId 用户id + */ + boolean deleteByUserId(String userId); + + /** + * 删除 + * @param entity 实体对象 + */ + void delete(OrganizeAdministratorEntity entity); + + /** + * 通过UserId获取权限组名称 + * + * @param userId 主键值 + * @return + */ + String getManagerGroupByUserId(String userId); + + /** + * 获取 OrganizeAdminIsTratorEntity 信息 + * @param userId 主键值 + * @return + */ + List getInfoByUserId(String userId); + + /** + * 获取 OrganizeAdminIsTratorEntity 信息 + * @param id 主键值 + * @return + */ + OrganizeAdministratorEntity getInfo(String id); + + /** + * 获取 OrganizeAdminIsTratorEntity 信息 + * @param organizeId 机构主键值 + * @return + */ + OrganizeAdministratorEntity getInfoByOrganizeId(String organizeId); + + /** + * 获取 OrganizeAdminIsTratorEntity 列表 + * @param organizeIdList 机构主键值 + * @return + */ + List getListByOrganizeId(List organizeIdList); + + /** + * 获取二级管理员列表 + * + * @param pagination 分页参数 + * @return + */ + List getList(Pagination pagination); + + List getOrganizeUserList(String type); + + List getListByAuthorize(); + + OrganizeAdministratorModel getOrganizeAdministratorList(); +} + diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/permission/service/OrganizeRelationService.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/permission/service/OrganizeRelationService.java new file mode 100644 index 0000000..0220127 --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/permission/service/OrganizeRelationService.java @@ -0,0 +1,148 @@ +package com.yunzhupaas.permission.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.permission.entity.OrganizeRelationEntity; +import com.yunzhupaas.permission.entity.PermissionGroupEntity; +import com.yunzhupaas.permission.model.organize.OrganizeConditionModel; +import com.yunzhupaas.permission.model.organize.OrganizeModel; + +import java.util.List; + +/** + *

+ * 组织关系 服务类 + *

+ * + * @author + * @since 2022-01-19 + */ +public interface OrganizeRelationService extends SuperService { + + /** + * 获取组织关联对象 + * + * @param organizeIds 组织id集合 + */ + List getRelationListByOrganizeId(List organizeIds); + + /** + * 获取组织关联对象 + * + * @param organizeIds 组织id集合 + */ + List getRelationListByOrganizeId(List organizeIds, String objectType); + + /** + * 获取组织关联对象 + * + * @param organizeIds 组织id集合 + */ + List getPositionListByOrganizeId(List organizeIds); + + /** + * 获取组织角色关联对象 + * + * @param roleId 角色ID + * @return 关联对象集合 + */ + List getRelationListByRoleId(String roleId); + + /** + * 获取组织角色关联对象 + * + * @param roleId 角色ID + * @return 关联对象集合 + */ + List getRelationListByRoleIdList(List roleId); + + /** + * 通过对象id获取组织关系 + * + * @param objectType 关系 + * @param objectId 对象id + * @return 关联对象集合 + */ + List getRelationListByObjectIdAndType(String objectType, String objectId); + + /** + * 是否存在组织角色关联关系 + * @param roleId + * @param organizeId + * @return + */ + Boolean existByRoleIdAndOrgId(String roleId, String organizeId); + + Boolean existByObjTypeAndOrgId(String objectType, String organizeId); + + Boolean existByObjAndOrgId(String objectType, String objId , String organizeId); + + /** + * 获取关联对象根据类型 + * + * @return 关联对象集合 + */ + List getRelationListByType(String objectType); + + List getListByTypeAndOrgId(String objectType,String orgId); + + Boolean deleteAllByRoleId(String roleId); + + /*================ 切换组织后 -> 自动切换岗位 ===============*/ + + /** + * 自动获取当前组织下的默认岗位 + * @param userId 用户ID + * @param changeToMajorOrgId 切换组织ID + * @param currentMajorPosId 原本的岗位ID + * @return 岗位ID + */ + String autoGetMajorPositionId(String userId, String changeToMajorOrgId, String currentMajorPosId); + + /** + * 自动获取有权限的组织ID + * @param userId 用户ID + * @param orgIds 组织ID集合 + * @param currentMajorOrgId 当前默认组织ID + * @param systemId + * @return 组织ID + */ + String autoGetMajorOrganizeId(String userId, List orgIds, String currentMajorOrgId, String systemId); + + /** + * 自动切换有权限的 + * @param userIds 用户ID集合 + */ + void autoSetOrganize(List userIds); + + /** + * 自动切换岗位 + * @param userIds 用户ID集合 + */ + void autoSetPosition(List userIds); + + /** + * 检查组织是否有权限 + * @param userId 用户ID + * @param orgId 组织ID + * @param systemId + * @return true:存在 + */ + List checkBasePermission(String userId, String orgId, String systemId); + + /** + * 通过组织id获取组织关系 + * + * @param departIds + * @param type + * @return + */ + List getOrgIds(List departIds, String type); + + /** + * 通过组织id获取组织关系 + * @return + */ + List getOrgIdsList(OrganizeConditionModel organizeConditionModel); + +} + diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/permission/service/OrganizeService.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/permission/service/OrganizeService.java new file mode 100644 index 0000000..ad05563 --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/permission/service/OrganizeService.java @@ -0,0 +1,448 @@ +package com.yunzhupaas.permission.service; + +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.permission.entity.OrganizeEntity; +import com.yunzhupaas.permission.model.authorize.AuthorizeConditionEnum; +import com.yunzhupaas.permission.model.organize.OrganizeConditionModel; +import com.yunzhupaas.permission.model.organize.PaginationOrganize; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * 组织机构 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public interface OrganizeService extends SuperService { + + /** + * 列表 + * + * @return + */ + List getListAll(List idAll, String keyWord); + + /** + * 列表 + * + * @return + */ + List getDepsByParentId(String id); + + /** + * 列表 + * + * @param filterEnabledMark + * @return + */ + List getList(boolean filterEnabledMark); + + /** + * 列表 + * + * @return + */ + List getList(String keyword, boolean filterEnabledMark); + + /** + * 获取组织信息 + * + * @param keyword + * @param filterEnabledMark + * @param type + * @return OrgId, OrgEntity + */ + Map getOrgMaps(String keyword, boolean filterEnabledMark, String type, SFunction... columns); + + /** + * 获取组织信息 + * + * @return OrgId, OrgEntity + */ + Map getOrgMapsAll(SFunction... columns); + + /** + * 列表(有效的组织) + * + * @return + */ + List getListByEnabledMark(Boolean enable); + + /** + * 列表 + * + * @param fullName 组织名称 + * @return + */ + OrganizeEntity getInfoByFullName(String fullName); + + /** + * 获取部门名列表 + * + * @return + */ + List getOrgEntityList(List idList, Boolean enable); + + /** + * 获取部门名列表(在线开发转换数据使用) + * + * @return + */ + List getOrgEntityList(Set idList); + + /** + * 全部组织(id : name) + * + * @return + */ + Map getOrgMap(); + + /** + * 全部组织(Encode/name : id) + * + * @param type + * @return + */ + Map getOrgEncodeAndName(String type); + + /** + * 全部组织(name : id) + * + * @param type + * @return + */ + Map getOrgNameAndId(String type); + + /** + * 获取redis存储的部门信息 + * + * @return + */ + List getOrgRedisList(); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + OrganizeEntity getInfo(String id); + + /** + * 通过名称查询id + * + * @param fullName 名称 + * @return + */ + OrganizeEntity getByFullName(String fullName); + + /** + * 通过名称 组织类型 查询id + * + * @param fullName 名称 + * @param category 类别 + * @param enCode 编码 + * @return + */ + OrganizeEntity getByFullName(String fullName, String category, String enCode); + + /** + * 验证名称 + * + * @param entity + * @param isCheck 组织名称是否不分级判断 + * @param isFilter 是否需要过滤id + * @return + */ + boolean isExistByFullName(OrganizeEntity entity, boolean isCheck, boolean isFilter); + + /** + * 获取父级id + * + * @param organizeId 组织id + * @param organizeParentIdList 父级id集合 + */ + void getOrganizeIdTree(String organizeId, List organizeParentIdList); + + /** + * 获取父级id + * + * @param organizeId 组织id + * @param organizeParentIdList 父级id集合 + */ + void getOrganizeId(String organizeId, List organizeParentIdList); + + /** + * 验证编码 + * + * @param enCode + * @param id + * @return + */ + boolean isExistByEnCode(String enCode, String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(OrganizeEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + */ + boolean update(String id, OrganizeEntity entity); + + /** + * 通过父级id修改父级组织树 + * + * @param entity + * @param category + */ + void update(OrganizeEntity entity, String category); + + /** + * 删除 + * + * @param orgId 实体对象 + */ + ActionResult delete(String orgId); + + /** + * 上移 + * + * @param id 主键值 + */ + boolean first(String id); + + /** + * 下移 + * + * @param id 主键值 + */ + boolean next(String id); + + /** + * 判断是否允许删除 + * + * @param orgId 主键值 + * @return + */ + String allowDelete(String orgId); + + /** + * 获取名称 + * + * @return + */ + List getOrganizeName(List id); + + /** + * 获取名称 + * + * @return + */ + Map getOrganizeName(List id, String keyword, boolean filterEnabledMark, String type); + + /** + * 获取名称 + * + * @return + */ + List getOrganizeNameSort(List id); + + /** + * @param organizeParentId 父id + * @return List 接收子结构 + */ + List getOrganize(String organizeParentId); + + /** + * @param organizeParentId 父id + * @return List 接收子结构 + */ + List getOrganizeByOraParentId(String organizeParentId); + + /** + * 获取所有当前用户的组织及子组织 + * + * @param organizeId + * @param filterEnabledMark + * @return + */ + List getUnderOrganizations(String organizeId, boolean filterEnabledMark); + + /** + * 获取所有当前用户的组织及子组织 (有分级权限验证) + * + * @param organizeId + * @return + */ + List getUnderOrganizationss(String organizeId); + + /** + * 通过名称获取组织列表 + * + * @param fullName + * @return + */ + List getListByFullName(String fullName); + + /** + * 通过id判断是否有子集 + * + * @param id 主键 + * @return + */ + List getListByParentId(String id); + + /** + * 获取用户所有所在组织 + * + * @return 组织对象集合 + */ + List getAllOrgByUserId(String userId); + + /** + * 通过组织id树获取名称 + * + * @param idNameMaps 预先获取的组织ID名称映射 + * @param orgIdTree 组织id树 + * @param regex 分隔符 + * @return 组织对象集合 + */ + String getFullNameByOrgIdTree(Map idNameMaps, String orgIdTree, String regex); + + /** + * 获取父级组织id + * + * @param entity + * @return + */ + String getOrganizeIdTree(OrganizeEntity entity); + + /** + * 获取顶级组织 + * + * @param parentId + * @return + */ + List getOrganizeByParentId(String parentId); + + /** + * 获取子级 + * + * @param id 组织id + */ + List getAllChild(String id); + + /** + * 查询用户的所属公司下的部门 + * + * @return + */ + List getDepartmentAll(String organizeId); + + /** + * 获取所在公司 + * + * @param organizeId + * @return + */ + OrganizeEntity getOrganizeCompany(String organizeId); + + /** + * 获取所在公司下部门 + * + * @return + */ + void getOrganizeDepartmentAll(String organize, List list); + + /** + * 获取组织id树 + * + * @param entity + * @return + */ + List getOrgIdTree(OrganizeEntity entity); + + /** + * 向上递归取组织id + * + * @param orgID + * @return + */ + List upWardRecursion(List orgIDs, String orgID); + + /** + * 查询给定的条件是否有默认当前登录者的默认部门值 + * + * @param organizeConditionModel + * @return + */ + String getDefaultCurrentValueDepartmentId(OrganizeConditionModel organizeConditionModel); + + /** + * 获取名称及id组成map + * + * @return + */ + Map getInfoList(); + + /** + * 列表(有效的组织) + * + * @return + */ + List getListById(Boolean enable); + + /** + * 获取顶级组织 + * + * @param parentId + * @return + */ + OrganizeEntity getInfoByParentId(String parentId); + + /** + * 获取所有组织全路径名称 + * + * @return + */ + Map getAllOrgsTreeName(); + + Map getAllOrgsTreeName(boolean enabledMark); + + /** + * 列表 + * + * @return + */ + List getPageList(List orgIds, PaginationOrganize pagination, boolean filterEnabledMark); + + /** + * 获取当前用户可见组织列表 + */ + List> getOrgTreeList(String category, String keyword); + + /** + * 获取当前用户的组织数组 + */ + String[] myOrgArray(); + + /** + * 获取当前用户的组织数组 + */ + String getUserTreeOrgStr(AuthorizeConditionEnum conditionType); +} + diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/permission/service/PermissionGroupService.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/permission/service/PermissionGroupService.java new file mode 100644 index 0000000..0045452 --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/permission/service/PermissionGroupService.java @@ -0,0 +1,149 @@ +package com.yunzhupaas.permission.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.permission.entity.PermissionGroupEntity; +import com.yunzhupaas.permission.model.permissiongroup.PaginationPermissionGroup; + +import java.util.List; + +public interface PermissionGroupService extends SuperService { + + /** + * 列表 + * @param pagination + * @return + */ + List list(PaginationPermissionGroup pagination); + + /** + * 列表 + * @param filterEnabledMark + * @param ids + * @return + */ + List list(boolean filterEnabledMark, List ids); + + /** + * 详情 + * @param id + * @return + */ + PermissionGroupEntity info(String id); + + /** + * 新建 + * @param entity + * @return + */ + boolean create(PermissionGroupEntity entity); + + /** + * 修改 + * @param id 主键 + * @param entity 实体 + * @return + */ + boolean update(String id, PermissionGroupEntity entity); + + /** + * 删除 + * @param entity 实体 + * @return + */ + boolean delete(PermissionGroupEntity entity); + + /** + * 验证名称是否重复 + * @param id + * @param entity + */ + boolean isExistByFullName(String id, PermissionGroupEntity entity); + + /** + * 验证编码是否重复 + * @param id + * @param entity + */ + boolean isExistByEnCode(String id, PermissionGroupEntity entity); + + /** + * 获取权限成员 + * + * @param id 主键 + * @return + */ + PermissionGroupEntity permissionMember(String id); + + /** + * 获取权限成员 + * + * @param userId 用户主键 + * @param orgId + * @param singletonOrg + * @param systemId + * @return + */ + List getPermissionGroupByUserId(String userId, String orgId, boolean singletonOrg, String systemId); + + /** + * 获取权限成员 + * + * @param userId 用户主键 + * @return + */ + String getPermissionGroupByUserId(String userId); + + /** + * 获取权限成员 + * + * @param userId 用户主键 + * @param systemId 应用主键 + * @return + */ + String getOrgIdByUserIdAndSystemId(String userId, String systemId); + + /** + * 通过用户id获取当前权限组(只查用户) + * + * @param userId 用户主键 + * @return + */ + List getPermissionGroupAllByUserId(String userId); + + /** + * 替换权限 + * + * @param fromId + * @param toId + * @param permissionList + * @return + */ + boolean updateByUser(String fromId, String toId, List permissionList); + + /** + * 通过菜单获取权限组 + * + * @param moduleId 菜单id + * @return + */ + List getPermissionGroupByModuleId(String moduleId); + + /** + * 通过ids获取权限组列表 + * + * @param ids + * @return + */ + List list(List ids); + + + /** + * 通过对象id获取当前权限组 + * + * @param objectId 对象主键 + * @param objectType 对象类型 + * @return + */ + List getPermissionGroupByObjectId(String objectId, String objectType); +} + diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/permission/service/PositionService.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/permission/service/PositionService.java new file mode 100644 index 0000000..a9936d0 --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/permission/service/PositionService.java @@ -0,0 +1,213 @@ +package com.yunzhupaas.permission.service; + + +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.permission.entity.PositionEntity; +import com.yunzhupaas.permission.model.permission.PermissionModel; +import com.yunzhupaas.permission.model.position.PaginationPosition; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * 岗位信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public interface PositionService extends SuperService { + + /** + * 列表 + * + * @return + * @param filterEnabledMark + */ + List getList(boolean filterEnabledMark); + + /** + * 岗位名列表(在线开发) + * + * @param idList + * @return + */ + List getPosList(List idList); + + + /** + * 岗位名列表(在线开发) + * + * @param idList + * @return + */ + List getPosList(Set idList); + + Map getPosMap(); + + Map getPosEncodeAndName(); + + Map getPosEncodeAndName(boolean enabledMark); + /** + * 获取redis存储的岗位信息 + * + * @return + */ + List getPosRedisList(); + + /** + * 列表 + * + * @param paginationPosition 条件 + * @return + */ + List getList(PaginationPosition paginationPosition); + + /** + * 列表 + * + * @param userId 用户主键 + * @return + */ + List getListByUserId(String userId); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + PositionEntity getInfo(String id); + + /** + * 通过名称查询id + * + * @param fullName 名称 + * @return + */ + PositionEntity getByFullName(String fullName); + + /** + * 通过名称查询id + * + * @param fullName 名称 + * @return + */ + PositionEntity getByFullName(String fullName,String encode); + + /** + * 验证名称 + * + * @param entity + * @param isFilter 是否过滤 + * @return + */ + boolean isExistByFullName(PositionEntity entity, boolean isFilter); + + /** + * 验证编码 + * + * @param entity + * @param isFilter 是否过滤 + * @return + */ + boolean isExistByEnCode(PositionEntity entity, boolean isFilter); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(PositionEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + */ + boolean update(String id, PositionEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(PositionEntity entity); + + /** + * 上移 + * + * @param id 主键值 + */ + boolean first(String id); + + /** + * 下移 + * + * @param id 主键值 + */ + boolean next(String id); + + /** + * 获取名称 + * + * @return + */ + List getPositionName(List id, boolean filterEnabledMark); + + /** + * 获取名称 + * + * @return + */ + List getPositionName(List id, String keyword); + + /** + * 获取岗位列表 + * + * @param organizeIds 组织id + * @param enabledMark + * @return + */ + List getListByOrganizeId(List organizeIds, boolean enabledMark); + + /** + * 获取用户组织底下所有的岗位 + * @param organizeId + * @param userId + * @return + */ + List getListByOrgIdAndUserId(String organizeId, String userId); + + /** + * 通过名称获取岗位列表 + * + * @param fullName 岗位名称 + * @param enCode 编码 + * @return + */ + List getListByFullName(String fullName, String enCode); + + List getCurPositionsByOrgId(String orgId); + + /** + * 根据id集合 + * + * @param idList ID集合 + * @param isPage + */ + List getList(List idList, Pagination pagination, boolean isPage); + + /** + * 根据组织列表获取 + * @param organizeIds + * @return + */ + List getListByOrganizeIds(List organizeIds, boolean needCode, boolean enabledMark); + +} + diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/permission/service/RoleService.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/permission/service/RoleService.java new file mode 100644 index 0000000..4b08893 --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/permission/service/RoleService.java @@ -0,0 +1,234 @@ +package com.yunzhupaas.permission.service; + +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.permission.entity.RoleEntity; +import com.yunzhupaas.permission.model.role.RoleModel; +import com.yunzhupaas.permission.model.role.RolePagination; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * 系统角色 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public interface RoleService extends SuperService { + + /*============================= get接口 ================================*/ + + /** + * 列表 + * + * @param filterEnabledMark + * @return 角色对象集合 + */ + List getList(boolean filterEnabledMark); + + /** + * 获取全局角色集合 + * + * @return 角色对象集合 + */ + List getGlobalList(); + List getGlobalList(boolean enabledMark); + + /** + * 获取全局角色集合 + * + * @return 角色对象集合 + */ + List getGlobalList(List ids); + + /** + * 列表 + * + * @param userId 用户ID + * @return 角色对象集合 + */ + List getListByUserId(String userId); + + /** + * 组织底下所有角色 + * + * @param userId + * @return + */ + List getListByUserIdAndOrgId(String userId, String orgId); + + /** + * 当前用户拥有的所有角色集合 + */ + List getRoleIdsByCurrentUser(); + + /** + * 当前用户拥有的所有角色集合 + */ + List getRoleIdsByCurrentUser(String orgId); + + /** + * 获取用户组织底下,及全局的 + * + * @param userId + * @param orgId + * @return + */ + List getAllRoleIdsByUserIdAndOrgId(String userId, String orgId); + + /** + * 信息 + * + * @param roleId 角色ID + * @return 角色对象 + */ + RoleEntity getInfo(String roleId); + + /** + * 根据id集合返回角色对象集合 + * + * @param roleIds 角色ID集合 + * @param keyword + * @param filterEnabledMark + * @return 角色对象集合 + */ + List getListByIds(List roleIds, String keyword, boolean filterEnabledMark); + + /** + * 根据id集合返回角色对象集合 + * + * @param roleIds 角色ID集合 + * @return 角色对象集合 + */ + List getSwaptListByIds(Set roleIds); + + Map getRoleMap(); + + + /** + * 角色编码/name.id + * + * @return + */ + Map getRoleNameAndIdMap(); + + Map getRoleNameAndIdMap(boolean enabledMark); + + /** + * 获取角色实体 + * + * @param fullName 角色名称 + * @return 角色对象 + */ + RoleEntity getInfoByFullName(String fullName); + + /** + * 获取角色实体 + * + * @param fullName 角色名称 + * @return 角色对象 + */ + RoleEntity getInfoByFullName(String fullName, String enCode); + + /** + * 获取当前用户的默认组织下的所有角色集合 + * + * @param orgId 组织ID + * @return 角色对象集合 + */ + List getCurRolesByOrgId(String orgId); + + /** + * 获取组织下的所有角色 + * + * @param orgId 组织ID + * @return 角色对象集合 + */ + List getRolesByOrgId(String orgId); + + String getBindInfo(String roleId, List reduceOrgIds); + + /** + * 列表 + * + * @param page 条件 + */ + List getList(RolePagination page, Integer globalMark); + + /*============================ exist存在判断接口 =================================*/ + + /** + * 验证名称 + * + * @param fullName 名称 + * @param id 主键值 + */ + Boolean isExistByFullName(String fullName, String id, Integer globalMark); + + /** + * 验证编码 + * + * @param enCode 编码 + * @param id 主键值 + */ + Boolean isExistByEnCode(String enCode, String id); + + /** + * 判断当前组织下是否存在角色 + * + * @param orgId 组织ID + */ + Boolean existCurRoleByOrgId(String orgId); + + /*============================ 存在判断接口 =================================*/ + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(RoleEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + */ + Boolean update(String id, RoleEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(RoleEntity entity); + + /** + * 根据id集合 + * + * @param idList ID集合 + * @param filterEnabledMark + */ + List getList(List idList, Pagination pagination, boolean filterEnabledMark); + + + + + + + /** + * 根据组织获取角色列表 + * + * @param organizeIds + * @param needCode + * @return + */ + List getListByOrganizeIds(List organizeIds, boolean needCode, boolean enabledMark); + +} + diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/permission/service/UserRelationService.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/permission/service/UserRelationService.java new file mode 100644 index 0000000..5779017 --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/permission/service/UserRelationService.java @@ -0,0 +1,188 @@ +package com.yunzhupaas.permission.service; + +import com.yunzhupaas.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import com.yunzhupaas.permission.entity.UserRelationEntity; +import com.yunzhupaas.permission.model.permission.PermissionModel; +import com.yunzhupaas.permission.model.permission.PermissionVoBase; +import com.yunzhupaas.permission.model.userrelation.UserRelationForm; + +import java.util.List; + +/** + * 用户关系 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public interface UserRelationService extends SuperService { + + /** + * 根据用户主键获取列表 + * + * @param userId 用户主键 + * @return + */ + List getListByUserId(String userId); + + List getListByUserIdAndObjType(String userId, String objectType); + /** + * 根据用户主键获取列表 + * + * @param userId 用户主键 + * @return + */ + List getListByUserIdAll(List userId); + + /** + * 根据对象主键获取列表 + * + * @param objectId 对象主键 + * @return + */ + List getListByObjectId(String objectId); + + /** + * 根据对象主键获取列表 + * + * @param objectType + * @return + */ + List getListByObjectType(String objectType); + + List getListByObjectId(String objectId, String objectType); + + /** + * 根据对象主键获取列表 + * + * @param objectId 对象主键 + * @return + */ + List getListByObjectIdAll(List objectId); + + /** + * 根据对象主键删除数据 + * + * @param objId 对象主键 + * @return + */ + void deleteAllByObjId(String objId); + + /** + * 删除用户所有的关联关系 + * @param userId 用户ID + */ + void deleteAllByUserId(String userId); + + /** + * 保存用户关系 + * @param userRelationEntityList 用户关系集合 + */ + void createByList(List userRelationEntityList); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + UserRelationEntity getInfo(String id); + + /** + * 创建 + * + * @param objectId 对象主键 + * @param entitys 实体对象 + */ + void save(String objectId, List entitys); + + /** + * 创建 + * + * @param list 实体对象 + */ + void save(List list); + + /** + * 删除 + * + * @param ids 主键值 + */ + void delete(String[] ids); + + /** + * 添加岗位、分组、角色成员 + */ + void saveObjectId(String objectId, UserRelationForm userRelationForm); + + /** + * 通过用户id查询用户组织关系 + * + * @param userIds + */ + List getRelationByUserIds(List userIds); + + /** + * 获取用户组织/岗位/角色集合 + * @param userId + * @return + */ + List getListByObjectType(String userId, String objectType); + + /** + * 获取用户所有组织关系 + * + * @param userId 用户id + * @return 组织关系集合 + */ + List getAllOrgRelationByUserId(String userId); + + /** + * 获取个人信息页面用户组织/岗位/角色集合 + * + * @param objectType 归属类型 + */ + List getObjectVoList(String objectType); + + /** + * 判断岗位/角色与用户是否存在关联关系 + * + * @param objectType 类型 + * @param objectId 岗位/角色ID + * @return 存在判断 + */ + Boolean existByObj(String objectType, String objectId); + + /** + * 获取用户组织关联关系,通过组织ID + */ + List getListByRoleId(String roleId); + + + /** + * 根据用户id获取关系 + * + * @param userId 用户主键 + * @param objectType 类型 + * @return + */ + List getListByUserId(String userId, String objectType); + + /** + * 判断组织下有哪些人 + * + * @param orgIdList 组织id + * @return + */ + List getListByOrgId(List orgIdList); + + /** + * 把钉钉用户的组织关联生成 + * @param sysObjId + * @param deptIdList + */ + void syncDingUserRelation(String sysObjId, List deptIdList); +} + diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/permission/service/UserService.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/permission/service/UserService.java new file mode 100644 index 0000000..9a208b1 --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/permission/service/UserService.java @@ -0,0 +1,419 @@ +package com.yunzhupaas.permission.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.base.Page; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.model.user.UserIdListVo; +import com.yunzhupaas.permission.model.user.mod.UserConditionModel; +import com.yunzhupaas.permission.model.user.page.PaginationUser; +import com.yunzhupaas.permission.model.user.vo.UserByRoleVO; +import com.yunzhupaas.permission.model.user.vo.UserExportExceptionVO; +import com.yunzhupaas.permission.model.user.vo.UserExportVO; +import com.yunzhupaas.permission.model.user.vo.UserImportVO; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * 用户信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public interface UserService extends SuperService { + + /*======================get接口========================*/ + + List getAdminList(); + + /** + * 列表 + * + * @param pagination 条件 + * @param enabledMark + * @param gender + * @return + */ + List getList(PaginationUser pagination, String organizeId, Boolean flag, Boolean filter, Integer enabledMark, String gender); + + /** + * 列表 + * + * @param pagination 条件 + * @param filterCurrentUser + * @return + */ + List getList(Pagination pagination, Boolean filterCurrentUser); + + /** + * 通过关键字查询 + * + * @param pagination + * @return + */ + List getUserPage(Pagination pagination); + + /** + * 通过组织id获取用户列表 + * + * @param organizeId 组织id + * @param keyword 关键字 + * @return + */ + List getListByOrganizeId(String organizeId, String keyword); + + /** + * 列表 + * + * @return + * @param enabledMark + */ + List getList(boolean enabledMark); + + /** + * 用户名列表(在线开发) + * + * @param idList + * @return + */ + List getUserNameList(List idList); + + /** + * 用户名列表(在线开发) + * + * @param idList + * @return + */ + List getUserNameList(Set idList); + + + /** + * (id : name/account) + * @return + */ + Map getUserMap(); + + + /** + * ( name/account: id) + * @return + */ + Map getUserNameAndIdMap(); + + Map getUserNameAndIdMap(boolean enabledMark); + + /** + * 通过名称查询id + * + * @return + */ + UserEntity getByRealName(String realName); + + + /** + * 通过名称查询id + * + * @return + */ + UserEntity getByRealName(String realName,String account); + + /** + * 列表 + * + * @param managerId 主管Id + * @param keyword 关键字 + * @return + */ + List getListByManagerId(String managerId, String keyword); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + UserEntity getInfo(String id); + + /** + * 信息 + * + * @param account 账户 + * @return + */ + UserEntity getUserByAccount(String account); + /** + * 信息 + * + * @param mobile 手机号码 + * @return + */ + UserEntity getUserByMobile(String mobile); + + /*==============================================*/ + + Boolean setAdminListByIds(List adminIds); + + /** + * 验证账户 + * + * @param account 账户 + * @return + */ + boolean isExistByAccount(String account); + + /** + * 创建 + * + * @param entity 实体对象 + */ + Boolean create(UserEntity entity) throws Exception; + + /** + * 判断用户额度 + */ + void beforeCheck(); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + */ + Boolean update(String id, UserEntity entity) throws Exception; + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(UserEntity entity); + + /** + * 修改密码 + * + * @param entity 实体对象 + */ + void updatePassword(UserEntity entity); + + /** + * 查询用户名称 + * + * @param id 主键值 + * @return + */ + List getUserName(List id); + + /** + * 查询用户名称 + * + * @param id 主键值 + * @return + */ + List getUserName(List id, boolean filterEnabledMark); + + /** + * 查询用户名称 + * + * @param id 主键值 + * @return + */ + List getListByUserIds(List id); + + /** + * 查询出分页被禁用的账号 + * + * @param id 主键值 + * @return + */ + List getUserList(List id); + + /** + * 通过account返回user实体 + * + * @param account 账户 + * @return + */ + UserEntity getUserEntity(String account); + + /** + * 获取用户id + * + * @return + */ + List getListId(); + + /** + * 添加岗位或角色成员 + * + * @param entity + */ + void update(UserEntity entity, String type); + + /** + * 添加岗位或角色成员 + * + * @param entity + */ + void updateLastTime(UserEntity entity, String type); + + /** + * 判断是否为自己的下属 + * + * @param id + * @param managerId + * @return + */ + boolean isSubordinate(String id, String managerId); + + /** + * 导出Excel + * + * @param dataType + * @param selectKey + * @param pagination + * @return + */ + DownloadVO exportExcel(String dataType, String selectKey, PaginationUser pagination); + + /** + * 导入预览 + * + * @param personList + * @return + */ + Map importPreview(List personList); + + /** + * 导入数据 + * + * @param dataList 数据源 + */ + UserImportVO importData(List dataList); + + /** + * 通过组织id获取上级id集合 + * + * @param organizeId + * @param organizeParentIdList + */ + void getOrganizeIdTree(String organizeId, StringBuffer organizeParentIdList); + + /** + * 导出错误报告 + * + * @param dataList + * @return + */ + DownloadVO exportExceptionData(List dataList); + + /** + * 候选人分页查询 + * + * @param id + * @param pagination + * @return + */ + List getUserName(List id, Pagination pagination); + + /** + * 候选人分页查询 + * + * @param id + * @param pagination + * @param flag 是否过滤自己 + * @return + */ + List getUserNames(List id, PaginationUser pagination, Boolean flag, Boolean enabledMark); + + /** + * 根据角色ID获取所在组织下的所有成员 + * @param roleId 角色ID + * @return + */ + List getListByRoleId(String roleId); + + + /** + * 删除在线的角色用户 + */ + Boolean delCurRoleUser(String message,List objectIdAll); + + + /** + * 获取用户信息 + * + * + * @param orgIdList + * @param keyword + * @return + */ + List getList(List orgIdList, String keyword); + + /** + * 得到用户关系 + * + * @param userIds + * @param type + * @return + */ + List getUserIdList(List userIds, String type); + + /** + * 得到用户关系 + * + * @param userIds + * @return + */ + List getObjList(List userIds, Pagination pagination, String type); + + /** + * 获取用户下拉框列表 + */ + List getListByAuthorize(String organizeId, Page page); + + /** + * 查询给定的条件是否有默认当前登录者的默认用户值 + * @param userConditionModel + * @return + */ + String getDefaultCurrentValueUserId(UserConditionModel userConditionModel); + + List getListByRoleIds(List roleIds); + + /** + * 通过ids转换数据 + * + * @param ids + * @return + */ + List getFullNameByIds(List ids); + + /** + * 通过ids返回相应的数据 + * + * @param ids + * @return + */ + List selectedByIds(List ids); + + List filterOrgAdministrator(List listUser); + + List getUserAccount(List ids); + + void updateStand(List ids,int standing); + + /** + * 删除在线用户 + * + * @param message + * @param userIds 用户IDs + * @return 执行结果 + */ + Boolean delCurUser(String message, List userIds, Integer stand); +} + diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/visual/service/VisualdevApi.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/visual/service/VisualdevApi.java new file mode 100644 index 0000000..0c9992e --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/visual/service/VisualdevApi.java @@ -0,0 +1,86 @@ +package com.yunzhupaas.visual.service; + +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.model.VisualDevJsonModel; +import com.yunzhupaas.base.model.flow.DataModel; +import com.yunzhupaas.base.model.flow.FlowFormDataModel; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.onlinedev.model.PaginationModel; +import com.yunzhupaas.base.model.OnlineImport.VisualdevModelDataInfoVO; +import com.yunzhupaas.onlinedev.model.VisualParamModel; + +import java.util.List; +import java.util.Map; + +public interface VisualdevApi { + /** + * 流程表单数据保存 + * + * @param flowFormDataModel + * @throws WorkFlowException + */ + ActionResult saveOrUpdate(FlowFormDataModel flowFormDataModel); + + /** + * 流程表单数据删除 + * + * @param formId + * @param id + * @return + * @throws Exception + */ + boolean delete(String formId, String id); + + /** + * 流程表单数据详情 + * + * @param formId + * @param id + * @return + */ + ActionResult info(String formId, String id); + + /** + * 流程表单配置 + * + * @param formId + * @return + */ + VisualdevEntity getFormConfig(String formId); + + /** + * 表单列表 + * + * @param formIds 表单主键集合 + * @return + */ + List getFormConfigList(List formIds); + + /** + * 流程关联表单(一流程多表单) + * + * @param flowId + * @param formIds + */ + void saveFlowIdByFormIds(String flowId, List formIds); + + VisualdevEntity getReleaseInfo(String formId); + + List> getListWithTableList(VisualDevJsonModel visualDevJsonModel, PaginationModel pagination, UserInfo userInfo); + + VisualdevModelDataInfoVO getEditDataInfo(String id, VisualdevEntity visualdevEntity); + + DataModel visualCreate(VisualParamModel model) throws Exception; + + DataModel visualUpdate(VisualParamModel model) throws Exception; + + void visualDelete(VisualParamModel model) throws Exception; + + /** + * 根据表名和规则删除功能表单数据 + */ + void deleteByTableName(FlowFormDataModel model) throws Exception; +} + diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/workflow/service/TaskApi.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/workflow/service/TaskApi.java new file mode 100644 index 0000000..caab448 --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/workflow/service/TaskApi.java @@ -0,0 +1,118 @@ +package com.yunzhupaas.workflow.service; + +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.DelegateEntity; +import com.yunzhupaas.flowable.entity.RecordEntity; +import com.yunzhupaas.flowable.entity.TaskEntity; +import com.yunzhupaas.flowable.model.operator.OperatorVo; +import com.yunzhupaas.flowable.model.task.FileModel; +import com.yunzhupaas.flowable.model.task.FlowModel; +import com.yunzhupaas.flowable.model.task.TaskPagination; + +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/28 14:35 + */ +public interface TaskApi { + /** + * 获取归档所需的信息 + * + * @param taskId 任务主键 + */ + FileModel getFileModel(String taskId) throws WorkFlowException; + + /** + * 信息 + * + * @param id 主键值 + * @param columns 指定获取的列数据 + */ + TaskEntity getInfoSubmit(String id, SFunction... columns); + + /** + * 信息 + * + * @param ids 主键值 + * @param columns 指定获取的列数据 + */ + List getInfosSubmit(String[] ids, SFunction... columns); + + /** + * 删除 + * + * @param taskEntity 任务实体 + */ + void delete(TaskEntity taskEntity) throws Exception; + + /** + * 发起流程 + * + * @param flowModel + * @throws Exception + */ + void saveOrSubmit(FlowModel flowModel) throws Exception; + + /** + * 根据任务主键获取记录集合 + * + * @param taskId 任务主键 + */ + List getRecordList(String taskId); + + /** + * 更新归档状态 + * + * @param taskId 任务主键 + */ + void updateIsFile(String taskId); + + /** + * 在办 + * + * @param pagination 分页参数 + */ + List getWaitList(TaskPagination pagination); + + /** + * 已办 + * + * @param pagination 分页参数 + */ + List getTrialList(TaskPagination pagination); + + /** + * 抄送 + * + * @param pagination 分页参数 + */ + List getCirculateList(TaskPagination pagination); + + /** + * 委托列表 + */ + List getDelegateList(); + + /** + * 判断是否存在未签收的经办 + */ + Boolean checkSign(); + + /** + * 判断是否存在未办理的经办 + */ + Boolean checkTodo(); + + /** + * 发起流程 + * + * @param flowModel 参数(templateId、userIds、formDataList) + */ + ActionResult launchFlow(FlowModel flowModel); +} diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/workflow/service/TemplateApi.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/workflow/service/TemplateApi.java new file mode 100644 index 0000000..c386a2b --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/workflow/service/TemplateApi.java @@ -0,0 +1,100 @@ +package com.yunzhupaas.workflow.service; + +import com.yunzhupaas.flowable.entity.TemplateEntity; +import com.yunzhupaas.flowable.entity.TemplateJsonEntity; +import com.yunzhupaas.flowable.model.template.FlowByFormModel; +import com.yunzhupaas.flowable.model.template.TemplateTreeListVo; +import com.yunzhupaas.model.FlowWorkListVO; +import com.yunzhupaas.permission.model.user.WorkHandoverModel; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; + +import java.util.List; +import java.util.Map; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/5/28 15:37 + */ +public interface TemplateApi { + /** + * 根据表单主键获取流程 + * + * @param formId 表单主键 + * @param start 是否仅查询开始节点关联的表单 + */ + FlowByFormModel getFlowByFormId(String formId, Boolean start); + + /** + * 流程模板获取发起节点表单id + * + * @param templateId + * @return + */ + String getFormByFlowId(String templateId); + + /** + * 根据流程主键获取版本主键集合 + * + * @param templateId 流程主键(大id) + */ + List getFlowIdsByTemplateId(String templateId); + + /** + * 根据流程主键获取版本主键集合 + * + * @param templateId 流程主键(大id) + */ + List getFlowIdsByTemplate(String templateId); + + /** + * 根据流程版本获取流程基本信息 + * + * @param flowId + * @return + */ + List getListByFlowIds(List flowId); + + /** + * 获取流程权限 + * + * @return + */ + List treeListWithPower(); + + /** + * 离职交接 + * + * @param fromId + * @return + */ + FlowWorkListVO flowWork(String fromId); + + /** + * 离职交接 + * + * @param workHandoverModel + * @return + */ + boolean flowWork(WorkHandoverModel workHandoverModel); + + /** + * 获取启用的流程版本的表单集合 + */ + List getFormList(); + + /** + * 根据流程版本id获取流程模板id + * + * @param flowId 流程模板主键 + */ + String getTemplateByVersionId(@RequestParam("flowId") String flowId); + + /** + * 获取流程templateId和表单formId组成的map + */ + Map getFlowFormMap(); +} diff --git a/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/workflow/service/TriggerApi.java b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/workflow/service/TriggerApi.java new file mode 100644 index 0000000..f79381f --- /dev/null +++ b/yunzhupaas-public/yunzhupaas-provider/src/main/java/com/yunzhupaas/workflow/service/TriggerApi.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.workflow.service; + +import com.yunzhupaas.flowable.model.trigger.TriggerDataFo; +import com.yunzhupaas.flowable.model.trigger.TriggerDataModel; + +import java.util.List; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/9/19 14:40 + */ +public interface TriggerApi { + + List getTriggerDataModel(TriggerDataFo fo); +} diff --git a/yunzhupaas-scheduletask/pom.xml b/yunzhupaas-scheduletask/pom.xml new file mode 100644 index 0000000..7901be9 --- /dev/null +++ b/yunzhupaas-scheduletask/pom.xml @@ -0,0 +1,20 @@ + + + + yunzhupaas-java-boot + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-scheduletask + pom + + yunzhupaas-scheduletask-controller + yunzhupaas-scheduletask-biz + + + + diff --git a/yunzhupaas-scheduletask/yunzhupaas-scheduletask-biz/pom.xml b/yunzhupaas-scheduletask/yunzhupaas-scheduletask-biz/pom.xml new file mode 100644 index 0000000..d4810bb --- /dev/null +++ b/yunzhupaas-scheduletask/yunzhupaas-scheduletask-biz/pom.xml @@ -0,0 +1,32 @@ + + + + yunzhupaas-scheduletask + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-scheduletask-biz + + + + com.yunzhupaas + yunzhupaas-common-all + ${project.version} + + + com.yunzhupaas + yunzhupaas-common-scheduletask + ${project.version} + + + com.yunzhupaas + yunzhupaas-system-biz + ${project.version} + + + + diff --git a/yunzhupaas-scheduletask/yunzhupaas-scheduletask-biz/src/main/java/com/yunzhupaas/scheduletask/task/ScheduleTaskHandler.java b/yunzhupaas-scheduletask/yunzhupaas-scheduletask-biz/src/main/java/com/yunzhupaas/scheduletask/task/ScheduleTaskHandler.java new file mode 100644 index 0000000..ea62475 --- /dev/null +++ b/yunzhupaas-scheduletask/yunzhupaas-scheduletask-biz/src/main/java/com/yunzhupaas/scheduletask/task/ScheduleTaskHandler.java @@ -0,0 +1,152 @@ +package com.yunzhupaas.scheduletask.task; + +import com.xxl.job.core.context.XxlJobHelper; +import com.xxl.job.core.handler.annotation.XxlJob; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.DataInterfaceEntity; +import com.yunzhupaas.base.service.DataInterfaceService; +import com.yunzhupaas.base.service.DbLinkService; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.emnus.TemplateEnum; +import com.yunzhupaas.exception.TenantInvalidException; +import com.yunzhupaas.model.visualJson.TemplateJsonModel; +import com.yunzhupaas.scheduletask.entity.TimeTaskEntity; +import com.yunzhupaas.scheduletask.model.ContentNewModel; +import com.yunzhupaas.scheduletask.model.UpdateTaskModel; +import com.yunzhupaas.scheduletask.rest.RestScheduleTaskUtil; +import com.yunzhupaas.util.AuthUtil; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Api和数据接口使用 + * + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/3/23 9:25 + */ +@Slf4j +@Component +public class ScheduleTaskHandler { + + @Autowired + private DataInterfaceService dataInterfaceService; + @Autowired + private DbLinkService dbLinkService; + + @XxlJob("defaultHandler") + public void defaultHandler() { + // 获取参数 + String param = XxlJobHelper.getJobParam(); + // 转换成模型 + TimeTaskEntity entity = JsonUtil.getJsonToBean(param, TimeTaskEntity.class); + ContentNewModel model = JsonUtil.getJsonToBean(param, ContentNewModel.class); + String tenantId = StringUtil.isNotEmpty(model.getUserInfo().getTenantId()) ? model.getUserInfo().getTenantId() : ""; + String userId = StringUtil.isNotEmpty(model.getUserInfo().getUserId()) ? model.getUserInfo().getUserId() : ""; + String token = AuthUtil.loginTempUser(userId, tenantId, true); + + // 切换租户 + UserInfo userInfo = model.getUserInfo(); + // 切换数据源 + if (userInfo != null && StringUtil.isNotEmpty(userInfo.getTenantId())) { + try { + TenantDataSourceUtil.switchTenant(userInfo.getTenantId()); + }catch (TenantInvalidException e){ + // 租户无效 禁用任务 + log.error("ScheduleTaskHandler, 租户无效, 禁用任务:{}", userInfo.getTenantId()); + entity = RestScheduleTaskUtil.getInfo(entity.getId(), model.getUserInfo()); + entity.setEnabledMark(0); + UpdateTaskModel updateTaskModel = new UpdateTaskModel(); + updateTaskModel.setEntity(entity); + updateTaskModel.setUserInfo(model.getUserInfo()); + RestScheduleTaskUtil.updateTask(updateTaskModel); + } + } + // 如果是http + if ("1".equals(entity.getExecuteType())) { + Boolean callHttp = callHttp(model, token); +// if (callHttp) { +// XxlJobHelper.handleResult(ReturnT.SUCCESS_CODE, "调用成功"); +// } else { +// XxlJobHelper.handleResult(ReturnT.FAIL_CODE, "调用失败"); +// } + } else if ("2".equals(entity.getExecuteType())) { + boolean callSql = callSql(model, token); +// if ( callSql) { +// XxlJobHelper.handleResult(ReturnT.SUCCESS_CODE, "调用成功"); +// } else { +// XxlJobHelper.handleResult(ReturnT.FAIL_CODE, "调用失败"); +// } + } + } + + // ---------------START callSQL + + /** + * 调用SQL + * + * @param model 系统调度参数 + */ + private boolean callSql(ContentNewModel model, String token) { + try { + // 得到数据接口信息 + String tenantId = StringUtil.isNotEmpty(model.getUserInfo().getTenantId()) ? model.getUserInfo().getTenantId() : "0"; + DataInterfaceEntity entity = dataInterfaceService.getInfo(model.getInterfaceId()); + if (entity != null) { + Map map = null; + if (model.getParameter() != null && model.getParameter().size() > 0) { + map = new HashMap<>(16); + for (TemplateJsonModel parameterModel : model.getParameter()) { + String value = Objects.equals(parameterModel.getSourceType(), TemplateEnum.Empty.getCode()) ? "" : parameterModel.getRelationField(); + map.put(parameterModel.getField(), value); + } + } + dataInterfaceService.infoToId(entity.getId(), tenantId, map, token, null, null, null, null); + } + } catch (Exception e) { + e.printStackTrace(); + } + return false; + } + + // ---------------START callHttp + + /** + * HTTP调用 + * + * @param model 系统调度参数 + * @return + */ + private Boolean callHttp(ContentNewModel model, String token) { + try { + // 得到数据接口信息 + String tenantId = StringUtil.isNotEmpty(model.getUserInfo().getTenantId()) ? model.getUserInfo().getTenantId() : "0"; + DataInterfaceEntity entity = dataInterfaceService.getInfo(model.getInterfaceId()); + if (entity != null) { + Map map = null; + if (model.getParameter() != null && model.getParameter().size() > 0) { + map = new HashMap<>(16); + for (TemplateJsonModel parameterModel : model.getParameter()) { + String value = Objects.equals(parameterModel.getSourceType(), TemplateEnum.Empty.getCode()) ? "" : parameterModel.getRelationField(); + map.put(parameterModel.getField(), value); + } + } + dataInterfaceService.infoToId(entity.getId(), tenantId, map, token, null, null, null, null); + } + } catch (Exception e) { + e.printStackTrace(); + } + return false; + } + + +} + diff --git a/yunzhupaas-scheduletask/yunzhupaas-scheduletask-controller/pom.xml b/yunzhupaas-scheduletask/yunzhupaas-scheduletask-controller/pom.xml new file mode 100644 index 0000000..a9cabca --- /dev/null +++ b/yunzhupaas-scheduletask/yunzhupaas-scheduletask-controller/pom.xml @@ -0,0 +1,22 @@ + + + + yunzhupaas-scheduletask + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-scheduletask-controller + + + + com.yunzhupaas + yunzhupaas-scheduletask-biz + ${project.version} + + + + diff --git a/yunzhupaas-scheduletask/yunzhupaas-scheduletask-controller/src/main/java/com/yunzhupaas/scheduletask/controller/TimeTaskController.java b/yunzhupaas-scheduletask/yunzhupaas-scheduletask-controller/src/main/java/com/yunzhupaas/scheduletask/controller/TimeTaskController.java new file mode 100644 index 0000000..b9027e4 --- /dev/null +++ b/yunzhupaas-scheduletask/yunzhupaas-scheduletask-controller/src/main/java/com/yunzhupaas/scheduletask/controller/TimeTaskController.java @@ -0,0 +1,186 @@ +package com.yunzhupaas.scheduletask.controller; + +import com.alibaba.fastjson.JSONObject; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.scheduletask.entity.HandlerNameEntity; +import com.yunzhupaas.scheduletask.entity.TimeTaskEntity; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.scheduletask.model.*; +import com.yunzhupaas.scheduletask.rest.RestScheduleTaskUtil; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.JsonUtilEx; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; +import java.util.ArrayList; +import java.util.List; + +/** + * 任务调度 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Tag(name = "任务调度", description = "TimeTask") +@RestController +@RequestMapping("/api/scheduletask") +public class TimeTaskController { + + + + /** + * 获取任务调度列表 + * + * @param pagination + * @return + */ + @Operation(summary = "获取任务调度列表") + @GetMapping + public JSONObject list(Pagination pagination) { + UserInfo userInfo = UserProvider.getUser(); + return RestScheduleTaskUtil.getList(pagination, userInfo); + } + + /** + * 获取本地任务列表 + * + * @return + */ + @Operation(summary = "获取任务调度列表") + @GetMapping("/TaskMethods") + public ActionResult> taskMethods() { + List list = new ArrayList<>(16); + // 获取所有handlerName + List handlerNameEntities = RestScheduleTaskUtil.getHandlerList(); + for (HandlerNameEntity entity : handlerNameEntities) { + TaskMethodsVO taskMethodsVO = new TaskMethodsVO(); + taskMethodsVO.setId(entity.getId()); + taskMethodsVO.setFullName(entity.getHandlerName()); + list.add(taskMethodsVO); + } + return ActionResult.success(list); + } + + /** + * 获取任务调度日志列表 + * + * @param pagination + * @param taskId 任务Id + * @return + */ + @Operation(summary = "获取任务调度日志列表") + @GetMapping("/{id}/TaskLog") + public JSONObject list(@PathVariable("id") String taskId, TaskPage pagination) { + return RestScheduleTaskUtil.getLogList(taskId, UserProvider.getUser(), pagination); + } + + /** + * 获取任务调度信息 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "获取任务调度信息") + @GetMapping("/Info/{id}") + public ActionResult info(@PathVariable("id") String id) throws DataException { + TimeTaskEntity entity = RestScheduleTaskUtil.getInfo(id, UserProvider.getUser()); + TaskInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, TaskInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 新建任务调度 + * + * @param taskCrForm + * @return + */ + @Operation(summary = "新建任务调度") + @PostMapping + public ActionResult create(@RequestBody @Valid TaskCrForm taskCrForm) { + taskCrForm.setUserInfo(UserProvider.getUser()); + JSONObject jsonObject = RestScheduleTaskUtil.create(taskCrForm); + return JsonUtil.getJsonToBean(jsonObject, ActionResult.class); + } + + /** + * 修改任务调度 + * + * @param id 主键值 + * @param taskUpForm + * @return + */ + @Operation(summary = "修改任务调度") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid TaskUpForm taskUpForm) { + taskUpForm.setUserInfo(UserProvider.getUser()); + JSONObject jsonObject = RestScheduleTaskUtil.update(id, taskUpForm); + return JsonUtil.getJsonToBean(jsonObject, ActionResult.class); + } + + /** + * 删除任务 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "删除任务") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + JSONObject jsonObject = RestScheduleTaskUtil.delete(id, UserProvider.getUser()); + return JsonUtil.getJsonToBean(jsonObject, ActionResult.class); + } + + /** + * 停止任务调度 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "停止任务调度") + @PutMapping("/{id}/Actions/Stop") + public ActionResult stop(@PathVariable("id") String id) { + UpdateTaskModel updateTaskModel = new UpdateTaskModel(); + TimeTaskEntity entity = RestScheduleTaskUtil.getInfo(id, UserProvider.getUser()); + if (entity != null) { + entity.setEnabledMark(0); + entity.setRunCount(entity.getRunCount()); + updateTaskModel.setEntity(entity); + updateTaskModel.setUserInfo(UserProvider.getUser()); + RestScheduleTaskUtil.updateTask(updateTaskModel); + return ActionResult.success(MsgCode.SU005.get()); + } + return ActionResult.fail(MsgCode.SC001.get()); + } + + /** + * 启动任务调度 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "启动任务调度") + @PutMapping("/{id}/Actions/Enable") + public ActionResult enable(@PathVariable("id") String id) { + UpdateTaskModel updateTaskModel = new UpdateTaskModel(); + TimeTaskEntity entity = RestScheduleTaskUtil.getInfo(id, UserProvider.getUser()); + if (entity != null) { + entity.setEnabledMark(1); + updateTaskModel.setEntity(entity); + updateTaskModel.setUserInfo(UserProvider.getUser()); + RestScheduleTaskUtil.updateTask(updateTaskModel); + return ActionResult.success(MsgCode.SU005.get()); + } + return ActionResult.fail(MsgCode.SC001.get()); + } + +} + diff --git a/yunzhupaas-system/pom.xml b/yunzhupaas-system/pom.xml new file mode 100644 index 0000000..e189ca9 --- /dev/null +++ b/yunzhupaas-system/pom.xml @@ -0,0 +1,50 @@ + + + + yunzhupaas-java-boot + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-system + pom + + yunzhupaas-system-entity + yunzhupaas-system-biz + yunzhupaas-system-controller + + + + + org.apache.poi + poi + 4.1.2 + + + org.apache.xmlbeans + xmlbeans + 3.1.0 + + + + org.apache.poi + poi-ooxml + 4.1.2 + + + org.apache.poi + poi-ooxml-schemas + 4.1.2 + + + + org.apache.poi + poi-scratchpad + 4.1.2 + + + + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/pom.xml b/yunzhupaas-system/yunzhupaas-system-biz/pom.xml new file mode 100644 index 0000000..44c4ec2 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/pom.xml @@ -0,0 +1,60 @@ + + + + yunzhupaas-system + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-system-biz + + + + com.yunzhupaas + yunzhupaas-provider + ${project.version} + + + com.yunzhupaas + yunzhupaas-oauth-api + ${project.version} + + + com.yunzhupaas + yunzhupaas-message-entity + ${project.version} + + + com.github.oshi + oshi-core + + + + com.baomidou + mybatis-plus-generator + + + com.baomidou + mybatis-plus-core + + + + + + com.github.vertical-blank + sql-formatter + + + + com.yunzhupaas + yunzhupaas-common-ai + + + + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/AdvancedQueryMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/AdvancedQueryMapper.java new file mode 100644 index 0000000..9eb7c59 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/AdvancedQueryMapper.java @@ -0,0 +1,9 @@ +package com.yunzhupaas.base.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.entity.AdvancedQueryEntity; + +public interface AdvancedQueryMapper extends SuperMapper { +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/AiChatMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/AiChatMapper.java new file mode 100644 index 0000000..7cf2116 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/AiChatMapper.java @@ -0,0 +1,13 @@ +package com.yunzhupaas.base.mapper; + +import com.yunzhupaas.base.entity.AiChatEntity; + +/** + * @author 云筑产品开发平台组 + * @version v5.2.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2025/2/20 17:33:21 + */ +public interface AiChatMapper extends SuperMapper { +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/AiHistoryMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/AiHistoryMapper.java new file mode 100644 index 0000000..12044e7 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/AiHistoryMapper.java @@ -0,0 +1,13 @@ +package com.yunzhupaas.base.mapper; + +import com.yunzhupaas.base.entity.AiHistoryEntity; + +/** + * @author 云筑产品开发平台组 + * @version v5.2.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2025/2/20 17:33:21 + */ +public interface AiHistoryMapper extends SuperMapper { +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/BaseComFieldsMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/BaseComFieldsMapper.java new file mode 100644 index 0000000..2ec4150 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/BaseComFieldsMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.base.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.entity.ComFieldsEntity; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:28 + */ +public interface BaseComFieldsMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/BaseLangMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/BaseLangMapper.java new file mode 100644 index 0000000..aa5f8ab --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/BaseLangMapper.java @@ -0,0 +1,14 @@ +package com.yunzhupaas.base.mapper; + +import com.yunzhupaas.base.entity.BaseLangEntity; + +/** + * @author 云筑产品开发平台组 + * @version v5.0.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/20 10:02:18 + */ +public interface BaseLangMapper extends SuperMapper { +} + + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/BillRuleMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/BillRuleMapper.java new file mode 100644 index 0000000..d614506 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/BillRuleMapper.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.base.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.entity.BillRuleEntity; + + +/** + * 单据规则 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface BillRuleMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/CommonWordsMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/CommonWordsMapper.java new file mode 100644 index 0000000..f4ba7ac --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/CommonWordsMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.base.mapper; + + +import com.yunzhupaas.base.entity.CommonWordsEntity; + +/** + * 审批常用语 + * + * @author 云筑产品开发平台组 + * @version v3.4.6 + * @copyrignt 深圳市乐程软件有限公司 + * @date 2023-01-06 + */ +public interface CommonWordsMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/DataInterfaceLogMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/DataInterfaceLogMapper.java new file mode 100644 index 0000000..b7b03a4 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/DataInterfaceLogMapper.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.base.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.entity.DataInterfaceLogEntity; + +/** + * 数据接口调用日志 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-06-03 + */ +public interface DataInterfaceLogMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/DataInterfaceMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/DataInterfaceMapper.java new file mode 100644 index 0000000..8ea53c6 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/DataInterfaceMapper.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.base.mapper; + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.entity.DataInterfaceEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:30 + */ +@Mapper +public interface DataInterfaceMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/DataInterfaceUserMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/DataInterfaceUserMapper.java new file mode 100644 index 0000000..92ac70c --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/DataInterfaceUserMapper.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.base.mapper; + + +import com.yunzhupaas.base.entity.DataInterfaceEntity; +import com.yunzhupaas.base.entity.DataInterfaceUserEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * @author 云筑产品开发平台组 + * @version V3.4.7 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/9/20 9:22 + */ +@Mapper +public interface DataInterfaceUserMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/DataInterfaceVariateMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/DataInterfaceVariateMapper.java new file mode 100644 index 0000000..4e81c43 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/DataInterfaceVariateMapper.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.base.mapper; + +import com.yunzhupaas.base.entity.DataInterfaceVariateEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 数据接口 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-03-23 + */ +@Mapper +public interface DataInterfaceVariateMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/DataMapMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/DataMapMapper.java new file mode 100644 index 0000000..8d4283e --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/DataMapMapper.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.base.mapper; + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.entity.VisualDataMapEntity; + +/** + * + * 大屏地图 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public interface DataMapMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/DataSetMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/DataSetMapper.java new file mode 100644 index 0000000..e3e0cf5 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/DataSetMapper.java @@ -0,0 +1,14 @@ +package com.yunzhupaas.base.mapper; + +import com.yunzhupaas.base.entity.DataSetEntity; + +/** + * @author 云筑产品开发平台组 + * @version v5.0.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/5/7 9:15:22 + */ +public interface DataSetMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/DbLinkMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/DbLinkMapper.java new file mode 100644 index 0000000..d328fac --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/DbLinkMapper.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.base.mapper; + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.database.model.entity.DbLinkEntity; + +/** + * 数据连接 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface DbLinkMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/DbTableMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/DbTableMapper.java new file mode 100644 index 0000000..40e4cbc --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/DbTableMapper.java @@ -0,0 +1,14 @@ +package com.yunzhupaas.base.mapper; + +/** + * 数据管理 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface DbTableMapper { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/DictionaryDataMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/DictionaryDataMapper.java new file mode 100644 index 0000000..122d09a --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/DictionaryDataMapper.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.base.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.entity.DictionaryDataEntity; + + +/** + * 字典数据 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface DictionaryDataMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/DictionaryTypeMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/DictionaryTypeMapper.java new file mode 100644 index 0000000..5fcd1d9 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/DictionaryTypeMapper.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.base.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.entity.DictionaryTypeEntity; + + +/** + * 字典分类 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface DictionaryTypeMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/InterfaceOauthMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/InterfaceOauthMapper.java new file mode 100644 index 0000000..09bcd44 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/InterfaceOauthMapper.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.base.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.entity.InterfaceOauthEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 接口认证 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/8 9:51 + */ +@Mapper +public interface InterfaceOauthMapper extends SuperMapper { +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/MessageTemplateMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/MessageTemplateMapper.java new file mode 100644 index 0000000..94fd071 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/MessageTemplateMapper.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.base.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.entity.MessageTemplateEntity; + +/** + * 消息模板 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年12月8日17:40:37 + */ +public interface MessageTemplateMapper extends SuperMapper { + +} + + + + + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ModuleButtonMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ModuleButtonMapper.java new file mode 100644 index 0000000..c9b654a --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ModuleButtonMapper.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.base.mapper; + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.entity.ModuleButtonEntity; + +/** + * 按钮权限 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface ModuleButtonMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ModuleColumnMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ModuleColumnMapper.java new file mode 100644 index 0000000..b6531cc --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ModuleColumnMapper.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.base.mapper; + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.entity.ModuleColumnEntity; + +/** + * 列表权限 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface ModuleColumnMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ModuleDataAuthorizeLinkDataMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ModuleDataAuthorizeLinkDataMapper.java new file mode 100644 index 0000000..0580b63 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ModuleDataAuthorizeLinkDataMapper.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.base.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.entity.ModuleDataAuthorizeLinkEntity; +import com.yunzhupaas.base.entity.ModuleDataAuthorizeSchemeEntity; + + +/** + * 数据权限方案 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface ModuleDataAuthorizeLinkDataMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ModuleDataAuthorizeMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ModuleDataAuthorizeMapper.java new file mode 100644 index 0000000..fd429f8 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ModuleDataAuthorizeMapper.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.base.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.entity.ModuleDataAuthorizeEntity; + + +/** + * 数据权限配置 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface ModuleDataAuthorizeMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ModuleDataAuthorizeSchemeMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ModuleDataAuthorizeSchemeMapper.java new file mode 100644 index 0000000..e5cdf59 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ModuleDataAuthorizeSchemeMapper.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.base.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.entity.ModuleDataAuthorizeSchemeEntity; + + +/** + * 数据权限方案 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface ModuleDataAuthorizeSchemeMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ModuleDataMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ModuleDataMapper.java new file mode 100644 index 0000000..e163fc5 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ModuleDataMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.base.mapper; + +import com.yunzhupaas.base.entity.ModuleDataEntity; + + +/** + * 单据规则 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface ModuleDataMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ModuleFormMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ModuleFormMapper.java new file mode 100644 index 0000000..55ade0d --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ModuleFormMapper.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.base.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.entity.ModuleFormEntity; + + +/** + * 表单权限 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface ModuleFormMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ModuleMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ModuleMapper.java new file mode 100644 index 0000000..0a6ead6 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ModuleMapper.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.base.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.entity.ModuleEntity; + + +/** + * 系统功能 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface ModuleMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/PortalManageMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/PortalManageMapper.java new file mode 100644 index 0000000..bb38da3 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/PortalManageMapper.java @@ -0,0 +1,35 @@ +package com.yunzhupaas.base.mapper; + +import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO; +import com.yunzhupaas.base.entity.PortalManageEntity; +import com.yunzhupaas.base.model.portalManage.PortalManagePage; +import com.yunzhupaas.base.model.portalManage.PortalManagePageDO; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +/** + * 虎门管理 + * + * @author 云筑产品开发平台组 + * @version V3.4.6 + * @copyright 深圳市乐程软件有限公司 + * @date 2023.02.17 + */ +public interface PortalManageMapper extends SuperMapper { + + @Select("SELECT f_full_name FROM base_portal WHERE F_Id = #{portalId}") + String getPortalFullName(String portalId); + + @Select("SELECT f_category FROM base_portal WHERE F_Id = #{portalId}") + String getPortalCategoryId(String portalId); + + PageDTO selectPortalManageDoPage(PageDTO page, @Param("pmPage") PortalManagePage pmPage); + + List selectPortalManageDoList(@Param("pmPage") PortalManagePage pmPage); + + List selectPortalBySystemIds(@Param("systemIds") List systemIds, @Param("collect") List collect); + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/PrintDevMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/PrintDevMapper.java new file mode 100644 index 0000000..7c66ba8 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/PrintDevMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.base.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.base.entity.PrintDevEntity; + +/** + * 打印模板-mapper + * + * @author 云筑产品开发平台组 YY + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-30 + */ +public interface PrintDevMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/PrintLogMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/PrintLogMapper.java new file mode 100644 index 0000000..c252c72 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/PrintLogMapper.java @@ -0,0 +1,12 @@ +package com.yunzhupaas.base.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.base.entity.PrintLogEntity; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Repository; + +@Mapper +@Repository +public interface PrintLogMapper extends SuperMapper { +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/PrintVersionMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/PrintVersionMapper.java new file mode 100644 index 0000000..10c39b9 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/PrintVersionMapper.java @@ -0,0 +1,14 @@ +package com.yunzhupaas.base.mapper; + +import com.yunzhupaas.base.entity.PrintVersionEntity; + +/** + * @author 云筑产品开发平台组 + * @version v5.0.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/5/6 14:07:21 + */ +public interface PrintVersionMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ProvinceAtlasMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ProvinceAtlasMapper.java new file mode 100644 index 0000000..f52b130 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ProvinceAtlasMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.base.mapper; + +import com.yunzhupaas.base.entity.ProvinceAtlasEntity; + + +/** + * 行政区划-地图 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2023/09/27 + */ +public interface ProvinceAtlasMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ProvinceMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ProvinceMapper.java new file mode 100644 index 0000000..57c3531 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ProvinceMapper.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.base.mapper; + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.entity.ProvinceEntity; + +/** + * 行政区划 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface ProvinceMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ScheduleLogMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ScheduleLogMapper.java new file mode 100644 index 0000000..eca52e9 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ScheduleLogMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.base.mapper; + + +import com.yunzhupaas.base.entity.ScheduleLogEntity; + +/** + * 单据规则 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2023/09/27 + */ +public interface ScheduleLogMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ScheduleNewMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ScheduleNewMapper.java new file mode 100644 index 0000000..e3400a1 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ScheduleNewMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.base.mapper; + + +import com.yunzhupaas.base.entity.ScheduleNewEntity; + +/** + * 单据规则 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2023/09/27 + */ +public interface ScheduleNewMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ScheduleNewUserMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ScheduleNewUserMapper.java new file mode 100644 index 0000000..d62fd95 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/ScheduleNewUserMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.base.mapper; + + +import com.yunzhupaas.base.entity.ScheduleNewUserEntity; + +/** + * 单据规则 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2023/09/27 + */ +public interface ScheduleNewUserMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/SignMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/SignMapper.java new file mode 100644 index 0000000..5a588a3 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/SignMapper.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.base.mapper; + +import com.yunzhupaas.permission.entity.SignEntity; + + +/** + * 个人签名 + * + * @author 云筑产品开发平台组 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/28 + */ +public interface SignMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/SignatureMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/SignatureMapper.java new file mode 100644 index 0000000..6143dc3 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/SignatureMapper.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.base.mapper; + +import com.yunzhupaas.base.entity.SignatureEntity; + + +/** + * 电子签章 + * + * @author 云筑产品开发平台组 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/28 + */ +public interface SignatureMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/SignatureUserMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/SignatureUserMapper.java new file mode 100644 index 0000000..faf631b --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/SignatureUserMapper.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.base.mapper; + +import com.yunzhupaas.base.entity.SignatureUserEntity; + + +/** + * 电子签章 + * + * @author 云筑产品开发平台组 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/28 + */ +public interface SignatureUserMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/SmsTemplateMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/SmsTemplateMapper.java new file mode 100644 index 0000000..74900a6 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/SmsTemplateMapper.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.base.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.entity.SmsTemplateEntity; + +/** +* @author Administrator +* @description 针对表【base_sms_template】的数据库操作Mapper +* @createDate 2021-12-09 10:12:52 +* @Entity generator.domain.SmsTemplate +*/ +public interface SmsTemplateMapper extends SuperMapper { + +} + + + + + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/SysconfigMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/SysconfigMapper.java new file mode 100644 index 0000000..ef43ede --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/SysconfigMapper.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.base.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.entity.SysConfigEntity; + + +/** + * 系统配置 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface SysconfigMapper extends SuperMapper { + + int deleteFig(); + + int deleteMpFig(); + + int deleteQyhFig(); +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/SystemMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/SystemMapper.java new file mode 100644 index 0000000..2023141 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/SystemMapper.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.base.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.entity.SystemEntity; + + +/** + * 系统 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface SystemMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/VisualKitMapper.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/VisualKitMapper.java new file mode 100644 index 0000000..7e4c9ad --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/mapper/VisualKitMapper.java @@ -0,0 +1,15 @@ +package com.yunzhupaas.base.mapper; + +import com.yunzhupaas.base.entity.VisualKitEntity; + +/** + * 表单套件 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/8/22 11:03:36 + */ +public interface VisualKitMapper extends SuperMapper { +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/AdvancedQueryService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/AdvancedQueryService.java new file mode 100644 index 0000000..748d47d --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/AdvancedQueryService.java @@ -0,0 +1,27 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.AdvancedQueryEntity; + +import java.util.List; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2022/5/30 + */ + +public interface AdvancedQueryService extends SuperService { + + void create(AdvancedQueryEntity advancedQueryEntity); + + AdvancedQueryEntity getInfo(String id,String userId); + + List getList(String moduleId, UserInfo userInfo); +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/AiChatService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/AiChatService.java new file mode 100644 index 0000000..a52a603 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/AiChatService.java @@ -0,0 +1,50 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.entity.AiChatEntity; +import com.yunzhupaas.base.model.ai.AiChatVo; +import com.yunzhupaas.base.model.ai.AiForm; +import com.yunzhupaas.base.model.ai.AiHisVo; + +import java.util.List; + +/** + * ai会话服务 + * + * @author 云筑产品开发平台组 + * @version v5.2.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/12/2 10:10:10 + */ +public interface AiChatService extends SuperService { + + /** + * ai对话发送 + * + * @param keyword + */ + String send(String keyword); + + /** + * ai会话列表 + */ + List historyList(); + + /** + * ai会话记录 + */ + List historyGet(String id); + + /** + * 会话记录保存 + */ + String historySave(AiForm form); + + /** + * 删除ai会话记录 + * + * @param id + */ + void delete(String id); + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/AiHistoryService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/AiHistoryService.java new file mode 100644 index 0000000..7249c34 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/AiHistoryService.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.entity.AiHistoryEntity; + +/** + * ai会话记录服务 + * + * @author 云筑产品开发平台组 + * @version v5.2.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/12/2 10:10:10 + */ +public interface AiHistoryService extends SuperService { + + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/BaseLangService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/BaseLangService.java new file mode 100644 index 0000000..cb6a29e --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/BaseLangService.java @@ -0,0 +1,60 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.entity.BaseLangEntity; +import com.yunzhupaas.base.model.language.BaseLangForm; +import com.yunzhupaas.base.model.language.BaseLangListVO; +import com.yunzhupaas.base.model.language.BaseLangPage; + +import java.util.List; +import java.util.Locale; + +/** + * @author 云筑产品开发平台组 + * @version v5.0.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/4/28 16:05:49 + */ +public interface BaseLangService extends SuperService { + /** + * 标记翻译列表(使用时) + * + * @param pagination + * @return + */ + BaseLangListVO getList(Pagination pagination); + + /** + * 标记翻译列表(管理页面) + * + * @param pagination + * @return + */ + BaseLangListVO list(BaseLangPage pagination); + + void create(BaseLangForm form); + + void update(BaseLangForm form); + + BaseLangForm getInfo(String groupId); + + void delete(String groupId); + + /** + * 存在则更新,不存在则新增 + * + * @param list + */ + void importSaveOrUpdate(List list); + + /** + * 获取语种json + * + * @param locale + * @return + */ + String getLanguageJson(Locale locale); + + List getServerLang(Locale locale); +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/BillRuleService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/BillRuleService.java new file mode 100644 index 0000000..a219cb3 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/BillRuleService.java @@ -0,0 +1,147 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.model.billrule.BillRulePagination; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.entity.BillRuleEntity; +import com.yunzhupaas.exception.DataException; + +import java.util.List; + +/** + * 单据规则 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface BillRuleService extends SuperService { + + /** + * 列表 + * + * @param pagination 条件 + * @return 单据规则列表 + */ + List getList(BillRulePagination pagination); + + /** + * 列表 + * + * @return 单据规则集合 + */ + List getList(); + + /** + * 信息 + * + * @param id 主键值 + * @return 单据规则 + */ + BillRuleEntity getInfo(String id); + + /** + * 验证名称 + * + * @param fullName 名称 + * @param id 主键值 + * @return ignore + */ + boolean isExistByFullName(String fullName, String id); + + /** + * 验证编码 + * + * @param enCode 编码 + * @param id 主键值 + * @return ignore + */ + boolean isExistByEnCode(String enCode, String id); + + /** + * 获取流水号 + * + * @param enCode 流水编码 + * @return ignore + * @throws DataException ignore + */ + String getNumber(String enCode) throws DataException; + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(BillRuleEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return ignore + */ + boolean update(String id, BillRuleEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(BillRuleEntity entity); + + /** + * 上移 + * + * @param id 主键值 + * @return ignore + */ + boolean first(String id); + + /** + * 下移 + * + * @param id 主键值 + * @return ignore + */ + boolean next(String id); + + /** + * 获取单据流水号 + * + * @param enCode 流水编码 + * @param isCache 是否缓存:每个用户会自动占用一个流水号,这个刷新页面也不会跳号 + * @return ignore + * @throws DataException ignore + */ + String getBillNumber(String enCode, boolean isCache) throws DataException; + + /** + * 使用单据流水号(注意:必须是缓存的单据才可以调用这个方法,否则无效) + * + * @param enCode 流水编码 + */ + void useBillNumber(String enCode); + + /** + * 单据规则导入 + * + * @param entity 实体对象 + * @param type + * @return ignore + * @throws DataException ignore + */ + ActionResult ImportData(BillRuleEntity entity, Integer type) throws DataException; + + + /** + * + * + * @param pagination 根据业务条件 + * @return 单据规则列表 + */ + List getListByCategory(String id,Pagination pagination); + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/ComFieldsService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/ComFieldsService.java new file mode 100644 index 0000000..8cf5bf6 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/ComFieldsService.java @@ -0,0 +1,66 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import com.yunzhupaas.base.entity.ComFieldsEntity; + +import java.util.List; + +/** + * 常用字段 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +public interface ComFieldsService extends SuperService { + + /** + * 获取常用字段列表 + * + * @return ignore + */ + List getList(); + + /** + * 获取常用字段 + * + * @param id 主键 + * @return ignore + */ + ComFieldsEntity getInfo(String id); + + /** + * 创建常用字段 + * + * @param entity 实体 + */ + void create(ComFieldsEntity entity); + + /** + * 修改常用字段 + * + * @param id 主键 + * @param entity 实体 + * @return ignore + */ + boolean update(String id, ComFieldsEntity entity); + + /** + * 验证名称 + * + * @param fullName 名称 + * @param id 主键值 + * @return ignore + */ + boolean isExistByFullName(String fullName, String id); + + /** + * 删除常用字段 + * + * @param entity 实体 + */ + void delete(ComFieldsEntity entity); +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/CommonWordsService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/CommonWordsService.java new file mode 100644 index 0000000..3befdda --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/CommonWordsService.java @@ -0,0 +1,60 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.entity.CommonWordsEntity; +import com.yunzhupaas.base.model.commonword.ComWordsPagination; + +import java.util.List; + +/** + * 审批常用语 Service + * + * @author 云筑产品开发平台组 + * @version v3.4.6 + * @copyrignt 深圳市乐程软件有限公司 + * @date 2023-01-06 + */ +public interface CommonWordsService extends SuperService { + + /** + * 系统常用语列表 + * + * @param comWordsPagination 页面对象 + * @return 打印实体类 + */ + List getSysList(ComWordsPagination comWordsPagination, Boolean currentSysFlag); + + /** + * 个人常用语列表 + * + * @param type 类型 + * @return 集合 + */ + List getListModel(String type); + + /** + * 系统是否被使用 + * + * @param systemId 系统ID + * @return 返回判断 + */ + Boolean existSystem(String systemId); + + /** + * 常用语判重 + * + * @param id 原id + * @param commonWordsText 常用语 + * @return 返回判断 + */ + Boolean existCommonWord(String id, String commonWordsText, Integer commonWordsType); + + /** + * 添加常用语次数 + * + * @param commonWordsText 常用语 + * @return 返回判断 + */ + void addCommonWordsNum(String commonWordsText); + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/DataInterfaceLogService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/DataInterfaceLogService.java new file mode 100644 index 0000000..ee1ea08 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/DataInterfaceLogService.java @@ -0,0 +1,55 @@ +package com.yunzhupaas.base.service; + + +import com.yunzhupaas.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.entity.DataInterfaceLogEntity; +import com.yunzhupaas.base.model.InterfaceOauth.PaginationIntrfaceLog; + +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +public interface DataInterfaceLogService extends SuperService { + + /** + * 添加日志 + * + * @param dateInterfaceId 接口Id + * @param invokWasteTime 执行时间 + */ + void create(String dateInterfaceId, Integer invokWasteTime); + /** + * 通过权限判断添加日志 + * + * @param dateInterfaceId 接口Id + * @param invokWasteTime 执行时间 + */ + void create(String dateInterfaceId, Integer invokWasteTime,String appId,String invokType); + + /** + * 获取调用日志列表 + * + * @param invokId 接口id + * @param pagination 分页参数 + * @return ignore + */ + List getList(String invokId, Pagination pagination); + + + /** + * 获取调用日志列表(多id) + * + * @param invokIds 接口ids + * @param pagination 分页参数 + * @return ignore + */ + List getListByIds(String appId,List invokIds, PaginationIntrfaceLog pagination); + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/DataInterfaceService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/DataInterfaceService.java new file mode 100644 index 0000000..fdda521 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/DataInterfaceService.java @@ -0,0 +1,188 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.DataInterfaceEntity; +import com.yunzhupaas.base.model.datainterface.*; +import com.yunzhupaas.exception.DataException; + +import java.util.List; +import java.util.Map; + +/** + * 数据接口业务层 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-03-23 + */ +public interface DataInterfaceService extends SuperService { + /** + * 获取接口列表(分页) + * + * @param pagination 分页参数 + * @return ignore + */ + List getList(PaginationDataInterface pagination, Integer isSelector); + + /** + * 分页下拉框选择列表 + * + * @param pagination + * @return + */ + List getList(PaginationDataInterfaceSelector pagination); + + /** + * 通过ids获取列表 + * + * @param ids + * @return + */ + List getList(List ids); + + /** + * 获取接口列表下拉框 + * + * @return ignore + * @param filterPage + */ + List getList(boolean filterPage); + + /** + * 获取接口数据 + * + * @param id 主键 + * @return ignore + */ + DataInterfaceEntity getInfo(String id); + + /** + * 添加数据接口 + * + * @param entity 实体 + */ + void create(DataInterfaceEntity entity); + + /** + * 修改接口 + * + * @param entity 实体 + * @param id 主键 + * @return 实体 + * @throws DataException ignore + */ + boolean update(DataInterfaceEntity entity, String id) throws DataException; + + /** + * 删除接口 + * + * @param entity 实体 + */ + void delete(DataInterfaceEntity entity); + + /** + * 判断接口名称是否重复 + * + * @param fullName 名称 + * @param id 主键 + * @return ignore + */ + boolean isExistByFullNameOrEnCode(String id, String fullName, String enCode); + + /** + * 获取接口分页数据 + * + * @param id 主键 + * @param page 分页参数 + * @return ignore + */ + ActionResult infoToIdPageList(String id, DataInterfacePage page); + + /** + * 获取接口详情数据 + * + * @param id 主键 + * @param page 分页参数 + * @return ignore + */ + List> infoToInfo(String id, DataInterfacePage page); + + /** + * 访问接口路径的应用认证 + * + * @param id 主键 + * @param tenantId 租户encode + * @param model 需要替换的参数 + * @return ignore + */ + ActionResult infoToIdNew(String id, String tenantId, DataInterfaceActionModel model); + + /** + * 检查参数 + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/14 + */ + DataInterfaceActionModel checkParams(Map map); + + /** + * 访问接口路径 + * + * @param id 主键 + * @param tenantId 租户encode + * @param map 需要替换的参数 + * @return ignore + */ + ActionResult infoToId(String id, String tenantId, Map map); + + /** + * 任务调度使用 + * @param id 主键 + * @param tenantId 租户encode + * @param map 需要替换的参数 + * @param token token + * @return + */ + ActionResult infoToId(String id, String tenantId, Map map, String token, String appId, String invokType, Pagination pagination, Map showMap); + + + /** + * 按sourceType替换数据接口参数 + * @param listJson + * @param map + */ + void paramSourceTypeReplaceValue(List listJson, Map map); + + /** + * 获取系统参数值 + * @param templateJsonModel + * @return + */ + String getSystemFieldValue(DataInterfaceModel templateJsonModel); + + /** + * 处理系统参数 + * + * @param sql + * @return + */ + Map systemParameterOne(String sql, UserInfo userInfo); + + /** + * 自定义参数替换 + * + * @param parameterJson 参数配置 + * @param sql sql + * @param map 参数 + * @param systemParameter 参数集合 + */ + String customizationParameter(String parameterJson, String sql, Map map, + Map systemParameter); + + String getHandleArraysSql(String sql, List values, Map systemParameter); +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/DataInterfaceUserService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/DataInterfaceUserService.java new file mode 100644 index 0000000..4d82ba1 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/DataInterfaceUserService.java @@ -0,0 +1,41 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.entity.DataInterfaceUserEntity; +import com.yunzhupaas.base.model.InterfaceOauth.InterfaceUserForm; + +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version V3.4.7 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/9/20 9:22 + */ +public interface DataInterfaceUserService extends SuperService { + + /** + * 授权用户 + * + * @param interfaceUserForm + */ + void saveUserList(InterfaceUserForm interfaceUserForm); + + /** + * 根据认证接口id查询授权用户列表 + * + * @param oauthId + * @return + */ + List select(String oauthId); + + /** + * 通过用户密钥获取用户token + * + * @param oauthId + * @param userKey + * @return + */ + String getInterfaceUserToken(String tenantId, String oauthId, String userKey); + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/DataInterfaceVariateService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/DataInterfaceVariateService.java new file mode 100644 index 0000000..b9f2290 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/DataInterfaceVariateService.java @@ -0,0 +1,84 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.Page; +import com.yunzhupaas.base.entity.DataInterfaceVariateEntity; + +import java.util.List; +import java.util.Map; + +/** + * 数据接口业务层 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-03-23 + */ +public interface DataInterfaceVariateService extends SuperService { + + /** + * 列表 + * @param id + * @param page + * @return + */ + List getList(String id, Page page); + + /** + * 详情 + * + * @param id + * @return + */ + DataInterfaceVariateEntity getInfo(String id); + + /** + * 判断名称是否重复 + * + * @param entity + * @return + */ + boolean isExistByFullName(DataInterfaceVariateEntity entity); + + /** + * 添加 + * + * @param entity + * @return + */ + boolean create(DataInterfaceVariateEntity entity); + + /** + * 修改 + * + * @param entity + * @return + */ + boolean update(DataInterfaceVariateEntity entity); + + /** + * 删除 + * + * @param entity + * @return + */ + boolean delete(DataInterfaceVariateEntity entity); + + /** + * 通过id获取列表 + * + * @param ids + * @return + */ + List getListByIds(List ids); + + boolean update(Map map, List variateEntities); + + /** + * 通过名称获取变量 + * + * @param fullName + */ + DataInterfaceVariateEntity getInfoByFullName(String fullName); +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/DataMapService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/DataMapService.java new file mode 100644 index 0000000..448a302 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/DataMapService.java @@ -0,0 +1,85 @@ +package com.yunzhupaas.base.service; + + +import com.yunzhupaas.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.entity.VisualDataMapEntity; + +import java.util.List; + +/** + * 大屏地图 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public interface DataMapService extends SuperService { + + /** + * 获取大屏列表(分页) + * + * @param pagination 分页参数 + * @return ignore + */ + List getList(Pagination pagination); + + /** + * 获取大屏列表 + * + * @return ignore + */ + List getList(); + + /** + * 获取大屏基本信息 + * + * @param id 主键 + * @return ignore + */ + VisualDataMapEntity getInfo(String id); + + /** + * 新增 + * + * @param entity 实体 + */ + void create(VisualDataMapEntity entity); + + /** + * 修改 + * + * @param id 主键 + * @param entity 实体 + * @return ignore + */ + boolean update(String id, VisualDataMapEntity entity); + + /** + * 删除 + * + * @param entity 实体 + */ + void delete(VisualDataMapEntity entity); + + /** + * 验证名称 + * + * @param fullName 名称 + * @param id 主键值 + * @return ignore + */ + boolean isExistByFullName(String fullName, String id); + + /** + * 验证编码 + * + * @param enCode 编码 + * @param id 主键值 + * @return ignore + */ + boolean isExistByEnCode(String enCode, String id); +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/DataSetService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/DataSetService.java new file mode 100644 index 0000000..9d09e40 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/DataSetService.java @@ -0,0 +1,78 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.entity.DataSetEntity; +import com.yunzhupaas.base.model.dataset.*; +import com.yunzhupaas.util.treeutil.SumTree; + +import java.util.List; +import java.util.Map; + +/** + * 数据集合 + * + * @author 云筑产品开发平台组 + * @version v5.0.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/5/7 9:15:47 + */ +public interface DataSetService extends SuperService { + /** + * 获取关键数据集列表 + * + * @param pagination + * @return + */ + List getList(DataSetPagination pagination); + + /** + * 创建数据集 + * + * @param form + */ + void create(List form, String ObjectType, String ObjectId); + + /** + * 获取表字段结构 + * + * @param item 数据集对象 + * @return 打印树形模型 + * @throws Exception ignore + */ + SumTree getTabFieldStruct(DataSetEntity item) throws Exception; + + /** + * 根据sql获取数据 + * + * @param entity + * @param params + * @param outIsMap 输出接口是map(否则输出list) + * @return + */ + Map getDataMapOrList(DataSetEntity entity, Map params, String formId, boolean outIsMap); + + /** + * 拼接sql + * + * @param query + * @return + */ + Map getDataList(DataSetQuery query); + + /** + * 数据预览 + * + * @param dataSetForm + * @return + */ + DataSetViewInfo getPreviewData(DataSetForm dataSetForm); + + + /** + * 接口数据预览 + * + * @param dataSetForm + * @return + */ + DataSetViewInfo getPreviewDataInterface(DataSetForm dataSetForm); +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/DbLinkService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/DbLinkService.java new file mode 100644 index 0000000..3adda1f --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/DbLinkService.java @@ -0,0 +1,113 @@ +package com.yunzhupaas.base.service; + + +import com.yunzhupaas.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import com.yunzhupaas.base.model.dblink.PaginationDbLink; +import com.yunzhupaas.database.model.dto.DbConnDTO; +import com.yunzhupaas.database.model.entity.DbLinkEntity; +import com.yunzhupaas.exception.DataException; + +import java.util.List; + +/** + * 数据连接 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface DbLinkService extends SuperService { + + /** + * 列表 + * + * @return ignore + */ + List getList(); + + /** + * 列表关键字查询 + * + * @param pagination 数据连接分页 + * @return ignore + */ + List getList(PaginationDbLink pagination); + + /** + * 信息 + * + * @param id 主键 + * @return ignore + */ + DbLinkEntity getInfo(String id); + + /** + * 验证名称 + * + * @param fullName 名称 + * @param id 主键值 + * @return ignore + */ + boolean isExistByFullName(String fullName, String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(DbLinkEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return ignore + */ + boolean update(String id, DbLinkEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(DbLinkEntity entity); + + /** + * 上移 + * + * @param id 主键值 + * @return ignore + */ + boolean first(String id); + + /** + * 下移 + * + * @param id 主键值 + * @return ignore + */ + boolean next(String id); + + /** + * 测试连接 + * + * @param entity 实体对象 + * @return ignore + * @throws DataException ignore + */ + boolean testDbConnection(DbLinkEntity entity) throws Exception; + + /** + * 获取动态数据源 + * + * @param dbLinkId 数据连接ID + * @return 动态数据库源 + * @throws DataException ignore + */ + DbLinkEntity getResource(String dbLinkId) throws Exception; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/DbSyncService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/DbSyncService.java new file mode 100644 index 0000000..9498eb4 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/DbSyncService.java @@ -0,0 +1,60 @@ +package com.yunzhupaas.base.service; + +import java.util.List; +import java.util.Map; + +/** + * 数据同步 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface DbSyncService { + + /** + * 数据表同步验证 + * + * @param dbLinkIdFrom 数据库连接From + * @param dbLinkIdTo 数据库连接To + * @param table 表名 + * @return 1:初始库表中没有数据 + * 2:目标库中该表不存在,是否在目标库中创建该表,并同步数据? + * 3:目标表存在数据,是否自动清除并同步数据? + * 0:同步成功 + * -1:请检查,同一数据库下无法同步数据 + * @throws Exception ignore + */ + Integer executeCheck(String dbLinkIdFrom, String dbLinkIdTo, Map convertRuleMap, String table) throws Exception; + + + /** + * 同步表执行 + * + * @param dbLinkIdFrom 数据库连接From + * @param dbLinkIdTo 数据库连接To + * @param table 表名 + * @throws Exception ignore + */ + void execute(String dbLinkIdFrom, String dbLinkIdTo, Map convertRuleMap, String table) throws Exception; + + /** + * 批量执行 + * + * @param dbLinkIdFrom 数据库连接From + * @param dbLinkIdTo 数据库连接To + * @param tableList 表名 + * @throws Exception ignore + */ + Map executeBatch(String dbLinkIdFrom, String dbLinkIdTo, Map convertRuleMap, List tableList) ; + + /** + * 打印初始脚本 + * + * @param printType dbInit:初始脚本、dbStruct:表结构、dbData:数据、tenant:多租户 + */ + Map printDbInit(String dbLinkIdFrom, String dbTypeTo, List tableList, Map convertRuleMap, String printType) throws Exception; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/DbTableService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/DbTableService.java new file mode 100644 index 0000000..b4916ec --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/DbTableService.java @@ -0,0 +1,169 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.Page; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.database.model.dbfield.DbFieldModel; +import com.yunzhupaas.database.model.dbtable.DbTableFieldModel; +import com.yunzhupaas.database.model.page.DbTableDataForm; +import com.yunzhupaas.exception.DataException; + +import java.util.List; +import java.util.Map; + +/** + * 数据管理 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface DbTableService { + + /** + * 1:表列表 + * + * @param dbLinkId 连接Id + * @param methodName + * @return 表集合信息 + * @throws DataException ignore + */ + List getList(String dbLinkId, String methodName) throws Exception; + + /** + * 1:表列表 + * + * @param dbLinkId 连接Id + * @param page 关键字 + * @return 表集合信息 + * @throws DataException ignore + */ + List getListPage(String dbLinkId, Page page) throws Exception; + + /** + * 1:表列表 + * + * @param dbLinkId 连接Id + * @return 表集合信息 + * @throws DataException ignore + */ + List getListPage(String dbLinkId, Pagination pagination) throws Exception; + + + /** + * 2:单表信息 + * + * @param dbLinkId 连接Id + * @return 表集合信息 + * @throws DataException ignore + */ + DbTableFieldModel getTable(String dbLinkId, String table) throws Exception; + + /** + * 3:表字段 + * + * @param dbLinkId 连接Id + * @param table 表名 + * @return 字段集合信息 + * @throws DataException ignore + */ + List getFieldList(String dbLinkId, String table) throws Exception; + + /** + * 4:表数据 + * + * @param dbTableDataForm 分页 + * @param dbLinkId 连接Id + * @param table 表名 + * @return 表数据集合 + * @throws Exception ignore + */ + List> getData(DbTableDataForm dbTableDataForm, String dbLinkId, String table) throws Exception; + + /** + * 5:校验:表名重名 + * + * @param dbLinkId 连接Id + * @return 重名标识 + * @throws Exception ignore + */ + boolean isExistTable(String dbLinkId, String table) throws Exception; + + /** + * 6:删除存在表 + * + * @param dbLinkId 连接ID + * @param table 删除表 + */ + boolean dropExistsTable(String dbLinkId, String table) throws Exception; + + /** + * 7:删除表 + * + * @param dbLinkId 连接Id + * @param table 表名 + * @throws DataException ignore + */ + void delete(String dbLinkId, String table) throws Exception; + + /** + * 删除全部表(慎用) + * @param dbLinkId 连接Id + */ + void deleteAllTable(String dbLinkId, String dbType) throws Exception; + + /** + * 8:创建表 + * + * @param dbTableFieldModel 前端创表表单信息 + * @return 执行状态(1:成功;0:重名) + * @throws DataException ignore + */ + int createTable(DbTableFieldModel dbTableFieldModel) throws Exception; + + /** + * 9:获取表模型 + * @param dbLinkId 数据连接ID + * @param tableName 表名 + * @return 表模板 + * @throws Exception ignore + */ + DbTableFieldModel getDbTableModel(String dbLinkId, String tableName) throws Exception; + + /** + * 10:修改表 + * + * @param dbTableFieldModel 修改表参数对象 + * @throws DataException ignore + */ + void update(DbTableFieldModel dbTableFieldModel) throws Exception; + + /** + * 11:添加字段 + * @param dbTableFieldModel 数据表字段模型 + * @throws DataException ignore + */ + void addField(DbTableFieldModel dbTableFieldModel) throws Exception; + + /** + * 12:获取表数据行数 + * + * @param dbLinkId 数据连接Id + * @param table 表名 + * @return 数据行数 + * @throws DataException ignore + */ + int getSum(String dbLinkId, String table) throws Exception; + + /** + * 13:获取动态数据源 + * + * @param dbLinkId 数据连接ID + * @return 动态数据库源 + * @throws DataException ignore + */ +// DbConnDTO getResource(String dbLinkId) throws DataException; + +} + + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/DictionaryTypeService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/DictionaryTypeService.java new file mode 100644 index 0000000..9ee48fe --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/DictionaryTypeService.java @@ -0,0 +1,100 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import com.yunzhupaas.base.entity.DictionaryTypeEntity; + +import java.util.List; + +/** + * 字典分类 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface DictionaryTypeService extends SuperService { + + /** + * 列表 + * + * @return ignore + */ + List getList(); + + /** + * 信息 + * + * @param enCode 代码 + * @return ignore + */ + DictionaryTypeEntity getInfoByEnCode(String enCode); + + /** + * 信息 + * + * @param id 主键值 + * @return ignore + */ + DictionaryTypeEntity getInfo(String id); + + /** + * 验证名称 + * + * @param fullName 名称 + * @param id 主键值 + * @return ignore + */ + boolean isExistByFullName(String fullName, String id); + + /** + * 验证编码 + * + * @param enCode 编码 + * @param id 主键值 + * @return ignore + */ + boolean isExistByEnCode(String enCode, String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(DictionaryTypeEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return ignore + */ + boolean update(String id, DictionaryTypeEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + * @return ignore + */ + boolean delete(DictionaryTypeEntity entity); + + /** + * 上移 + * + * @param id 主键值 + * @return ignore + */ + boolean first(String id); + + /** + * 下移 + * + * @param id 主键值 + * @return ignore + */ + boolean next(String id); +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/InterfaceOauthService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/InterfaceOauthService.java new file mode 100644 index 0000000..b159884 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/InterfaceOauthService.java @@ -0,0 +1,87 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import com.yunzhupaas.base.entity.InterfaceOauthEntity; +import com.yunzhupaas.base.model.InterfaceOauth.PaginationOauth; +import com.yunzhupaas.exception.DataException; + +import java.util.List; + +/** + * 接口认证服务 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/8 9:26 + */ +public interface InterfaceOauthService extends SuperService { + + /** + * 判断接口认证名称是否重复 + * + * @param appName 名称 + * @param id 主键 + * @return ignore + */ + boolean isExistByAppName(String appName, String id); + + /** + * 判断appId是否重复 + * + * @param appId 名称 + * @param id 主键 + * @return ignore + */ + boolean isExistByAppId(String appId, String id); + + + /** + * 获取接口列表(分页) + * + * @param pagination 分页参数 + * @return ignore + */ + List getList(PaginationOauth pagination); + + /** + * 获取接口认证数据 + * + * @param id 主键 + * @return ignore + */ + InterfaceOauthEntity getInfo(String id); + + /** + * 添加接口认证数据 + * + * @param entity 实体 + */ + void create(InterfaceOauthEntity entity); + /** + * 修改接口 + * + * @param entity 实体 + * @param id 主键 + * @return 实体 + * @throws DataException ignore + */ + boolean update(InterfaceOauthEntity entity, String id) throws DataException; + + /** + * 删除接口 + * + * @param entity 实体 + */ + void delete(InterfaceOauthEntity entity); + + /** + * 获取接口认证数据 + * + * @param appId 主键 + * @return ignore + */ + InterfaceOauthEntity getInfoByAppId(String appId); +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/MessageTemplateService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/MessageTemplateService.java new file mode 100644 index 0000000..36e4e2e --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/MessageTemplateService.java @@ -0,0 +1,84 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.entity.MessageTemplateEntity; + +import java.util.List; + +/** + * 消息模板表 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年12月8日17:40:37 + */ +public interface MessageTemplateService extends SuperService { + + /** + * 列表(无分页) + * + * @return + */ + List getList(); + + /** + * 列表 + * + * @param pagination 条件 + * @return 单据规则列表 + */ + List getList(Pagination pagination, Boolean filter); + + /** + * 信息 + * + * @param id 主键值 + * @return 单据规则 + */ + MessageTemplateEntity getInfo(String id); + + /** + * 创建 + * + * @param entity 实体 + */ + void create(MessageTemplateEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return ignore + */ + boolean update(String id, MessageTemplateEntity entity); + + /** + * 删除 + * + * @param entity 实体 + */ + void delete(MessageTemplateEntity entity); + + /** + * 验证名称 + * + * @param fullName 名称 + * @param id 主键值 + * @return ignore + */ + boolean isExistByFullName(String fullName, String id); + + /** + * 验证编码 + * + * @param enCode 编码 + * @param id 主键值 + * @return ignore + */ + boolean isExistByEnCode(String enCode, String id); +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/ModuleDataAuthorizeLinkDataService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/ModuleDataAuthorizeLinkDataService.java new file mode 100644 index 0000000..82f5397 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/ModuleDataAuthorizeLinkDataService.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import com.yunzhupaas.base.entity.ModuleDataAuthorizeLinkEntity; + + +/** + * 数据权限配置 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface ModuleDataAuthorizeLinkDataService extends SuperService { + /** + * 根据菜单id获取数据连接 + * @param menuId + * @return + */ + ModuleDataAuthorizeLinkEntity getLinkDataEntityByMenuId(String menuId,Integer type); + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/ModuleDataAuthorizeService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/ModuleDataAuthorizeService.java new file mode 100644 index 0000000..e2dc4cc --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/ModuleDataAuthorizeService.java @@ -0,0 +1,85 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import com.yunzhupaas.base.entity.ModuleDataAuthorizeEntity; + +import java.util.List; + +/** + * 数据权限配置 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface ModuleDataAuthorizeService extends SuperService { + + /** + * 列表 + * + * @return ignore + */ + List getList(); + + /** + * 列表 + * + * @param moduleId 功能主键 + * @return ignore + */ + List getList(String moduleId); + + /** + * 信息 + * + * @param id 主键值 + * @return ignore + */ + ModuleDataAuthorizeEntity getInfo(String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(ModuleDataAuthorizeEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return ignore + */ + boolean update(String id, ModuleDataAuthorizeEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(ModuleDataAuthorizeEntity entity); + + /** + * 验证编码是否重复 + * + * @param moduleId + * @param enCode + * @param id + * @return + */ + boolean isExistByEnCode(String moduleId, String enCode, String id); + + /** + * 验证名称是否重复 + * + * @param moduleId + * @param fullName + * @param id + * @return + */ + boolean isExistByFullName(String moduleId, String fullName, String id); +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/ModuleDataService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/ModuleDataService.java new file mode 100644 index 0000000..f70c6dd --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/ModuleDataService.java @@ -0,0 +1,72 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.Page; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.entity.ModuleDataEntity; +import com.yunzhupaas.model.login.AllMenuSelectVO; + +import java.util.List; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2024/5/6 上午10:48 + */ +public interface ModuleDataService extends SuperService { + + /** + * 列表 + * + * @return + */ + List getList(String category, Page page); + + /** + * 创建 + * + */ + void create(String moduleId); + + /** + * 信息 + * + * @param ObjectId 对象主键 + * @return + */ + ModuleDataEntity getInfo(String ObjectId); + + /** + * 验证名称 + * + * @param objectId 对象主键 + * @return + */ + boolean isExistByObjectId(String objectId); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(ModuleDataEntity entity); + + /** + * 删除 + * + */ + void delete(String objectId); + + /** + * app菜单 + * @return + */ + List getDataList(Page page); + + /** + * app常用菜单详情 + * @return + */ + List getAppDataList(Pagination pagination); +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/PortalManageService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/PortalManageService.java new file mode 100644 index 0000000..e90fbef --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/PortalManageService.java @@ -0,0 +1,40 @@ +package com.yunzhupaas.base.service; + + +import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO; +import com.yunzhupaas.base.entity.PortalManageEntity; +import com.yunzhupaas.base.model.portalManage.PortalManagePage; +import com.yunzhupaas.base.model.portalManage.PortalManagePageDO; +import com.yunzhupaas.base.model.portalManage.PortalManagePrimary; +import com.yunzhupaas.base.model.portalManage.PortalManageVO; + +import java.util.List; + +/** + *

+ * 门户管理 服务类 + *

+ * + * @author + * @since 2023-02-16 + */ +public interface PortalManageService extends SuperService { + + void checkCreUp(PortalManageEntity portalManageEntity) throws Exception; + + PortalManageVO convertVO(PortalManageEntity entity); + + List getList(PortalManagePrimary primary); + + List getListByEnable(PortalManagePrimary primary); + + PageDTO getPage(PortalManagePage portalPagination); + + List getSelectList(PortalManagePage pmPage); + + List selectPortalBySystemIds(List systemIds, List collect); + + void createBatch(List primaryLit) throws Exception; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/PrintDevService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/PrintDevService.java new file mode 100644 index 0000000..d65a76d --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/PrintDevService.java @@ -0,0 +1,124 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.entity.OperatorRecordEntity; +import com.yunzhupaas.base.entity.PrintDevEntity; +import com.yunzhupaas.base.model.print.*; +import com.yunzhupaas.base.model.vo.PrintDevVO; + +import java.util.List; +import java.util.Map; + +/** + * 打印模板-服务类 + * + * @author 云筑产品开发平台组 YY + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-30 + */ +public interface PrintDevService extends SuperService { + + /** + * 列表 + * + * @return 打印实体类 + */ + List getList(PaginationPrint paginationPrint); + + /** + * 创建 + */ + void create(PrintDevFormDTO dto); + + /** + * 获取详情 + * + * @return PrintDevInfoVO + */ + PrintDevInfoVO getVersionInfo(String versionId); + + /** + * 保存或者发布 通过type:0-保存,1-发布 + * + * @param form + */ + void saveOrRelease(PrintDevUpForm form); + + /** + * 获取打印模板对象树形模型(selector) + * + * @param category 打印模板类型 + * @return 打印模型树 + * @throws Exception 字典分类不存在BUG + */ + List getTreeModel(String category); + + /** + * 新增更新校验 + * + * @param printDevEntity 打印模板对象 + * @param fullNameCheck 重名校验开关 + * @param encodeCheck 重码校验开关 + */ + void creUpdateCheck(PrintDevEntity printDevEntity, Boolean fullNameCheck, Boolean encodeCheck); + + /** + * 查询打印列表 + * + * @param ids + * @return + */ + List getPrintTemplateOptions(List ids); + + /** + * 导入打印模板 + * + * @param infoVO + * @param type + * @return + */ + String importData(PrintDevInfoVO infoVO, Integer type); + + /** + * 获取流程经办记录集合 + * + * @param taskId 任务ID + * @return 经办记录集合 + */ + List getFlowTaskOperatorRecordList(String taskId); + + /** + * 根据sql获取数据 + * + * @param templateId 打印模板id + * @param formId 表达数据id + * @param params 参数 + * @return + */ + Map getDataMap(String templateId, String formId, String flwoTaskId, Map params); + + /** + * 复制打印模板 + * + * @param templateId 打印模板id + * @return + */ + void copyPrintdev(String templateId); + + /** + * 获取打印业务列表 + * + * @param pagination + * @return + */ + List getWorkSelector(PaginationPrint pagination); + + /** + * 获取打印业务列表 + * + * @return 打印模型树 + */ + List getWorkSelector(List id); + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/PrintLogService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/PrintLogService.java new file mode 100644 index 0000000..6044b03 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/PrintLogService.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.PaginationTime; +import com.yunzhupaas.base.model.vo.PrintLogVO; +import com.yunzhupaas.base.entity.PrintLogEntity; + +import java.util.List; + + +public interface PrintLogService extends SuperService { + /** + * 列表 + * @param printId + * @param page + * @return + */ + List list(String printId, PaginationTime page); +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/PrintVersionService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/PrintVersionService.java new file mode 100644 index 0000000..46e8914 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/PrintVersionService.java @@ -0,0 +1,46 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.entity.PrintVersionEntity; +import com.yunzhupaas.base.model.print.PrintDevFormDTO; + +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version v5.0.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/5/6 14:06:40 + */ +public interface PrintVersionService extends SuperService { + + /** + * 创建版本 + * + * @param dto + */ + void create(PrintDevFormDTO dto); + + /** + * 获取版本列表 + * + * @param templateId + * @return + */ + List getList(String templateId); + + /** + * 复制版本(点击新增打印版本) + * + * @param versionId + */ + String copyVersion(String versionId); + + /** + * 根据打印id删除版本 + * + * @param templateId + * @return + */ + void removeByTemplateId(String templateId); +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/ProvinceAtlasService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/ProvinceAtlasService.java new file mode 100644 index 0000000..1fcbece --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/ProvinceAtlasService.java @@ -0,0 +1,23 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.entity.ProvinceAtlasEntity; + +import java.util.List; + +/** + * 行政区划 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2023/09/27 + */ +public interface ProvinceAtlasService extends SuperService { + + List getList(); + + List getListByPid(String pid); + + ProvinceAtlasEntity findOneByCode(String code); +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/ProvinceService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/ProvinceService.java new file mode 100644 index 0000000..0e91e44 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/ProvinceService.java @@ -0,0 +1,144 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.model.province.PaginationProvince; +import com.yunzhupaas.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import com.yunzhupaas.base.Page; +import com.yunzhupaas.base.entity.ProvinceEntity; + +import java.util.List; + +/** + * 行政区划 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface ProvinceService extends SuperService { + + + /** + * 验证名称 + * + * @param fullName 名称 + * @param id 主键值 + * @return ignore + */ + boolean isExistByFullName(String fullName, String id); + + /** + * 验证编码 + * + * @param enCode 编码 + * @param id 主键值 + * @return ignore + */ + boolean isExistByEnCode(String enCode, String id); + + /** + * 普通列表 + * + * @param parentId 节点Id + * @return ignore + */ + List getList(String parentId); + + /** + * 普通列表 + * + * @param parentId 节点Id + * @param page + * @return ignore + */ + List getList(String parentId, PaginationProvince page); + + /** + * 普通列表 + * + * @return ignore + */ + List getAllList(); + + + /** + * 省市区单条数据集合(代码生成器) + * @param ProIdList 省市区id集合 + * @return + */ + List getProList(List ProIdList); + + /** + * 地域名列表(在线开发) + * + * @return ignore + */ + List getProListBytype(String type); + + /** + * 信息 + * + * @param id 主键值 + * @return ignore + */ + ProvinceEntity getInfo(String id); + + /** + * 信息 + * + * @param fullName + * @param parentId + * @return ignore + */ + ProvinceEntity getInfo(String fullName,List parentId); + + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(ProvinceEntity entity); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(ProvinceEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return ignore + */ + boolean update(String id, ProvinceEntity entity); + + /** + * 上移 + * + * @param id 主键值 + * @return ignore + */ + boolean first(String id); + + /** + * 下移 + * + * @param id 主键值 + * @return ignore + */ + boolean next(String id); + + /** + * 获取行政规划列表 + * + * @param list 数组 + * @return ignore + */ + List infoList(List list); +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/ScheduleLogService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/ScheduleLogService.java new file mode 100644 index 0000000..a688c2d --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/ScheduleLogService.java @@ -0,0 +1,52 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.entity.ScheduleLogEntity; + +import java.util.List; + +/** + * 日程 + * + * @author 云筑产品开发平台组 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + */ +public interface ScheduleLogService extends SuperService { + + /** + * 列表 + * + * @return + */ + List getListAll(List scheduleIdList); + + /** + * 信息 + * + * @param id 主键值 + * @return 单据规则 + */ + ScheduleLogEntity getInfo(String id); + + /** + * 创建 + * + * @param entity 实体 + */ + void create(ScheduleLogEntity entity); + + /** + * 删除 + * @param scheduleIdList + */ + void delete(List scheduleIdList,String operationType); + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return ignore + */ + boolean update(String id, ScheduleLogEntity entity); + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/ScheduleNewService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/ScheduleNewService.java new file mode 100644 index 0000000..1d5015c --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/ScheduleNewService.java @@ -0,0 +1,110 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.entity.ScheduleNewEntity; +import com.yunzhupaas.base.model.schedule.ScheduleDetailModel; +import com.yunzhupaas.base.model.schedule.ScheduleJobModel; +import com.yunzhupaas.base.model.schedule.ScheduleNewTime; +import com.yunzhupaas.exception.WorkFlowException; + +import java.util.Date; +import java.util.List; + +/** + * 日程 + * + * @author 云筑产品开发平台组 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + */ +public interface ScheduleNewService extends SuperService { + + /** + * 列表 + * + * @return + */ + List getList(ScheduleNewTime scheduleNewTime); + + /** + * 列表 + * + * @return + */ + List getList(String groupId, Date date); + + /** + * 列表 + * + * @return + */ + List getStartDayList(String groupId, Date date); + + /** + * 列表 + * + * @return + */ + List getListAll(Date date); + + /** + * 信息 + * + * @param id 主键值 + * @return 单据规则 + */ + ScheduleNewEntity getInfo(String id); + + /** + * 信息 + * + * @return 单据规则 + */ + List getGroupList(ScheduleDetailModel detailModel); + + /** + * 创建 + * + * @param entity 实体 + * @param operationType 1.新增 2.修改 + */ + void create(ScheduleNewEntity entity, List toUserIds, String groupId, String operationType,List idList) throws WorkFlowException; + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @param type 1.此日程 2.此日程及后续 3.所有日程 + * @return ignore + */ + boolean update(String id, ScheduleNewEntity entity, List toUserIds, String type) throws WorkFlowException; + + /** + * 删除 + * + * @param idList + */ + void deleteScheduleList(List idList); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + */ + boolean update(String id, ScheduleNewEntity entity); + + /** + * 删除 + * + * @param entity 实体 + * @param type 1.此日程 2.此日程及后续 3.所有日程 + */ + void delete(ScheduleNewEntity entity, String type); + + /** + * 发送重复提醒 + * @param scheduleJobModel + */ + void scheduleMessage(ScheduleJobModel scheduleJobModel); +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/ScheduleNewUserService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/ScheduleNewUserService.java new file mode 100644 index 0000000..cedfae4 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/ScheduleNewUserService.java @@ -0,0 +1,48 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.entity.ScheduleNewUserEntity; + +import java.util.List; + +/** + * 日程 + * + * @author 云筑产品开发平台组 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + */ +public interface ScheduleNewUserService extends SuperService { + + /** + * 列表 + * + * @return + */ + List getList(String scheduleId,Integer type); + + /** + * 列表 + * + * @return + */ + List getList(); + + /** + * 创建 + * + * @param entity 实体 + */ + void create(ScheduleNewUserEntity entity); + + /** + * 删除 + * + */ + void deleteByScheduleId(List scheduleIdList); + + /** + * 删除 + * + */ + void deleteByUserId(List scheduleIdList); +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/SignService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/SignService.java new file mode 100644 index 0000000..4e27442 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/SignService.java @@ -0,0 +1,51 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.permission.entity.SignEntity; + + +import java.util.List; + +/** + * 个人签名 + * + * @author 云筑产品开发平台组 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/28 + */ +public interface SignService extends SuperService { + + + /** + * 列表 + * + * @return 个人签名集合 + */ + List getList(); + + + + + + /** + * 创建 + * + * @param entity 实体对象 + */ + boolean create(SignEntity entity); + + + + /** + * 删除 + * + */ + boolean delete(String id); + + + boolean updateDefault(String id); + + + //获取默认 + SignEntity getDefaultByUserId(String id); +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/SignatureService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/SignatureService.java new file mode 100644 index 0000000..a7d9309 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/SignatureService.java @@ -0,0 +1,79 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.entity.SignatureEntity; +import com.yunzhupaas.base.model.signature.*; + +import java.util.List; + +/** + * 电子签章 + * + * @author 云筑产品开发平台组 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/28 + */ +public interface SignatureService extends SuperService { + + /** + * 列表 + * + * @return 电子签章集合 + */ + List getList(PaginationSignature pagination); + + /** + * 下拉框 + * @return + */ + List getList(); + + /** + * 通过主键id集合获取有权限的电子签章列表 + * @param model + * @return + */ + List getListByIds(SignatureListByIdsModel model); + + SignatureEntity getInfoById(String id); + + SignatureInfoVO getInfo(String id); + + /** + * 验证名称 + * + * @param fullName 名称 + * @param id 主键值 + * @return ignore + */ + boolean isExistByFullName(String fullName, String id); + + /** + * 验证编码 + * + * @param enCode 编码 + * @param id 主键值 + * @return ignore + */ + boolean isExistByEnCode(String enCode, String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(SignatureEntity entity,List userIds); + + /** + * 修改 + * + * @param signatureUpForm 实体对象 + */ + boolean update(String id, SignatureUpForm signatureUpForm); + + /** + * 删除 + * + */ + boolean delete(String id); +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/SignatureUserService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/SignatureUserService.java new file mode 100644 index 0000000..5214a5c --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/SignatureUserService.java @@ -0,0 +1,51 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.entity.SignatureUserEntity; + +import java.util.List; + +/** + * 电子签章 + * + * @author 云筑产品开发平台组 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/28 + */ +public interface SignatureUserService extends SuperService { + + /** + * 列表 + * + * @return + */ + List getList(List signatureId,List userId); + + /** + * 列表 + * + * @return + */ + List getList(String signatureId); + + /** + * 通过userId获取列表 + * + * @param userId + * @return + */ + List getListByUserId(String userId); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(SignatureUserEntity entity); + + /** + * 删除 + * + */ + void delete(String signatureId); +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/SmsTemplateService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/SmsTemplateService.java new file mode 100644 index 0000000..97dcb51 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/SmsTemplateService.java @@ -0,0 +1,89 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import com.yunzhupaas.base.Page; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.entity.SmsTemplateEntity; +import com.yunzhupaas.base.SmsModel; + +import java.util.List; + +/** + * @author Administrator + * @description 针对表【base_sms_template】的数据库操作Service + * @createDate 2021-12-09 10:12:52 + */ +public interface SmsTemplateService extends SuperService { + + /** + * 列表(不分页) + * + * @return + */ + List getList(String keyword); + + /** + * 列表 + * + * @param pagination 条件 + * @return 单据规则列表 + */ + List getList(Pagination pagination); + + /** + * 信息 + * + * @param id 主键值 + * @return 单据规则 + */ + SmsTemplateEntity getInfo(String id); + + /** + * 创建 + * + * @param entity 实体 + */ + void create(SmsTemplateEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return ignore + */ + boolean update(String id, SmsTemplateEntity entity); + + /** + * 删除 + * + * @param entity 实体 + */ + void delete(SmsTemplateEntity entity); + + /** + * 判断模板编号是否重复 + * + * @param templateName + * @param id + * @return + */ + boolean isExistByTemplateName(String templateName, String id); + + /** + * 判断模板编号是否重复 + * + * @param enCode + * @param id + * @return + */ + boolean isExistByEnCode(String enCode, String id); + + /** + * 获取短信配置 + * @return + */ + SmsModel getSmsConfig(); +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/SysconfigService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/SysconfigService.java new file mode 100644 index 0000000..6d4fafb --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/SysconfigService.java @@ -0,0 +1,80 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.service.SuperService; +import com.baomidou.mybatisplus.extension.service.IService; +import com.yunzhupaas.base.entity.EmailConfigEntity; +import com.yunzhupaas.base.entity.SysConfigEntity; +import com.yunzhupaas.model.BaseSystemInfo; + +import java.util.List; + +/** + * 系统配置 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface SysconfigService extends SuperService { + + /** + * 列表 + * + * @param type 类型 + * @return ignore + */ + List getList(String type); + + /** + * 信息 + * + * @return ignore + */ + BaseSystemInfo getWeChatInfo(); + + /** + * 获取系统配置信息 + * + * @return ignore + */ + BaseSystemInfo getSysInfo(); + + /** + * 保存系统配置 + * + * @param entitys 实体对象 + */ + void save(List entitys); + + /** + * 保存公众号配置 + * + * @param entitys 实体对象 + * @return ignore + */ + boolean saveMp(List entitys); + + /** + * 保存企业号配置 + * + * @param entitys 实体对象 + */ + void saveQyh(List entitys); + + /** + * 邮箱验证 + * + * @param configEntity ignore + * @return ignore + */ + String checkLogin(EmailConfigEntity configEntity); + + /** + * 根据key获取value + * @param keyStr + * @return + */ + String getValueByKey(String keyStr); +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/UserOnlineService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/UserOnlineService.java new file mode 100644 index 0000000..969df23 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/UserOnlineService.java @@ -0,0 +1,34 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.Page; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.message.model.UserOnlineModel; + +import java.util.List; + +/** + * 在线用户 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public interface UserOnlineService { + + /** + * 列表 + * + * @param page 分页参数 + * @return ignore + */ + List getList(Pagination page); + + /** + * 删除 + * + * @param tokens 主键值 + */ + void delete(String... tokens); +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/VisualKitService.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/VisualKitService.java new file mode 100644 index 0000000..02855d0 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/VisualKitService.java @@ -0,0 +1,70 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.entity.VisualKitEntity; +import com.yunzhupaas.base.model.visualkit.KitPagination; +import com.yunzhupaas.base.model.visualkit.KitTreeVo; +import com.yunzhupaas.base.model.visualkit.VisualKitForm; +import com.yunzhupaas.base.model.visualkit.VisualKitInfoVo; +import com.yunzhupaas.base.vo.ListVO; + +import java.util.List; + +/** + * 表单套件 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/8/22 11:10:30 + */ +public interface VisualKitService extends SuperService { + /** + * 列表查询 + * + * @param page + * @return + */ + List getList(KitPagination page); + + /** + * 名称编码是否重复 + * + * @param visualKitEntity + * @param fullNameCheck + * @param encodeCheck + */ + void saveCheck(VisualKitEntity visualKitEntity, Boolean fullNameCheck, Boolean encodeCheck); + + /** + * 创建 + * + * @param form + */ + void create(VisualKitForm form); + + /** + * 修改 + * + * @param id + * @param form + */ + boolean update(String id, VisualKitForm form); + + List selectorList(); + + /** + * 复制 + * + * @param id + */ + void actionsCopy(String id); + + /** + * 导入套件 + * + * @param entity + * @param type + */ + String importData(VisualKitEntity entity, Integer type); +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/AdvancedQueryServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/AdvancedQueryServiceImpl.java new file mode 100644 index 0000000..d2ca133 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/AdvancedQueryServiceImpl.java @@ -0,0 +1,50 @@ +package com.yunzhupaas.base.service.impl; + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.AdvancedQueryEntity; +import com.yunzhupaas.base.entity.ModuleDataAuthorizeSchemeEntity; +import com.yunzhupaas.base.mapper.AdvancedQueryMapper; +import com.yunzhupaas.base.service.AdvancedQueryService; +import com.yunzhupaas.util.RandomUtil; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Optional; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2022/5/30 + */ +@Service +public class AdvancedQueryServiceImpl extends SuperServiceImpl implements AdvancedQueryService { + @Override + public void create(AdvancedQueryEntity advancedQueryEntity) { + String mainId = Optional.ofNullable(advancedQueryEntity.getId()).orElse(RandomUtil.uuId()); + advancedQueryEntity.setId(mainId); + this.save(advancedQueryEntity); + } + + @Override + public AdvancedQueryEntity getInfo(String id,String userId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AdvancedQueryEntity::getId, id).eq(AdvancedQueryEntity::getCreatorUserId, userId); + return this.getOne(queryWrapper); + } + + @Override + public List getList(String moduleId, UserInfo userInfo) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AdvancedQueryEntity::getModuleId, moduleId).eq(AdvancedQueryEntity::getCreatorUserId, userInfo.getUserId()); + List list = this.list(queryWrapper); + return list; + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/AiChatServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/AiChatServiceImpl.java new file mode 100644 index 0000000..dcbe210 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/AiChatServiceImpl.java @@ -0,0 +1,164 @@ +package com.yunzhupaas.base.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.unfbx.chatgpt.entity.chat.BaseMessage; +import com.unfbx.chatgpt.entity.chat.Message; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.AiChatEntity; +import com.yunzhupaas.base.entity.AiHistoryEntity; +import com.yunzhupaas.base.mapper.AiChatMapper; +import com.yunzhupaas.base.model.ai.AiChatVo; +import com.yunzhupaas.base.model.ai.AiForm; +import com.yunzhupaas.base.model.ai.AiHisVo; +import com.yunzhupaas.base.service.AiChatService; +import com.yunzhupaas.base.service.AiHistoryService; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.service.OpenAiService; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * ai会话服务 + * + * @author 云筑产品开发平台组 + * @version v5.2.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/12/2 10:05:25 + */ +@Service +public class AiChatServiceImpl extends SuperServiceImpl implements AiChatService { + @Autowired + private OpenAiService openAiService; + + @Autowired + private AiHistoryService aiHistoryService; + + @Override + public String send(String keyword) { + if ("YUNZHUPAAS是什么".equals(keyword)) { + return "YUNZHUPAAS 是一款基于 Java 的低代码开发平台,旨在简化企业级应用的开发流程。以下是其核心特点:" + + "1. 低代码开发:\n" + + "提供可视化界面,通过拖拽组件和配置参数快速构建应用,减少代码编写。\n" + + "自动生成前后端代码,提升开发效率。\n" + + "2. 功能丰富:\n" + + "包含表单设计、流程引擎、报表工具等模块,满足企业多样化需求。\n" + + "支持移动端开发,便于创建跨平台应用。\n" + + "3. 灵活扩展:\n" + + "支持二次开发,允许根据需求深度定制。\n" + + "提供丰富的 API 接口,便于与其他系统集成。\n" + + "4. 国产化支持:\n" + + "兼容国产操作系统和数据库,适合国内企业使用。\n" + + "总结:YUNZHUPAAS 通过低代码方式简化开发流程,提供丰富的功能和灵活的扩展性,适合快速构建企业级应用。"; + } + if ("YUNZHUPAAS的性能特点".equals(keyword)) { + return "YUNZHUPAAS 作为低代码开发平台,其性能特点主要体现在以下几个方面:\n" + + "1. 高效开发:\n" + + "可视化开发: 通过拖拽组件和配置参数,快速构建应用,减少代码编写。\n" + + "代码生成: 自动生成前后端代码,提升开发效率。\n" + + "模块化设计: 提供丰富的功能模块,避免重复开发。\n" + + "2. 高稳定性:\n" + + "标准化开发: 统一的开发框架和规范,提升代码质量。\n" + + "持续更新: 平台不断更新,提供最新技术支持。\n" + + "3. 高扩展性:\n" + + "支持二次开发: 可根据需求进行深度定制。\n" + + "丰富接口: 提供多种接口,便于与其他系统集成。\n" + + "多环境部署: 支持多种部署方式,适应不同场景。\n" + + "4. 高性能:\n" + + "优化架构: 采用高性能架构,确保应用流畅运行。\n" + + "缓存机制: 内置缓存机制,提升数据访问速度。\n" + + "负载均衡: 支持负载均衡,有效应对高并发。\n" + + "5. 高安全性:\n" + + "权限控制: 提供细粒度的权限管理,保障数据安全。\n" + + "数据加密: 支持数据加密传输和存储。\n" + + "安全审计: 提供操作日志和审计功能,便于追踪问题。\n" + + "总结: YUNZHUPAAS 在开发效率、稳定性、扩展性、性能及安全性方面表现优异,适合快速构建高性能的企业级应用。"; + } + if ("YUNZHUPAAS支持哪些数据库".equals(keyword)) { + return "YUNZHUPAAS 作为一款低代码开发平台,支持多种数据库,具体支持的数据库类型可能因版本和配置而异,但通常包括以下几类:\n" + + "1. 关系型数据库 (SQL):\n" + + "MySQL: 开源、流行的关系型数据库。\n" + + "PostgreSQL: 功能强大、开源的关系型数据库。\n" + + "Oracle: 商业级关系型数据库。\n" + + "SQL Server: 微软开发的关系型数据库。\n" + + "达梦数据库 (DM): 国产关系型数据库。\n" + + "人大金仓数据库 (KingbaseES): 国产关系型数据库。\n" + + "2. 非关系型数据库 (NoSQL):\n" + + "MongoDB: 文档型数据库,适合存储非结构化数据。\n" + + "Redis: 内存数据库,常用于缓存和消息队列。\n" + + "3. 国产数据库:\n" + + "达梦数据库 (DM)\n" + + "人大金仓数据库 (KingbaseES)\n" + + "总结: YUNZHUPAAS 支持多种数据库,包括主流的关系型数据库、非关系型数据库以及国产数据库,用户可根据需求选择合适的数据库。建议参考官方文档或咨询技术支持以获取最新的数据库支持信息。"; + } + // if(!AiLimitUtil.tryAcquire(UserProvider.getUser().getUserId())){ + // return MsgCode.SYS182.get(); + // } + Message sysMessage = Message.builder().role(BaseMessage.Role.USER).content(keyword).build(); + return openAiService.completion(sysMessage); + } + + @Override + public List historyList() { + // 当前用户信息 + UserInfo userInfo = UserProvider.getUser(); + QueryWrapper queryWrapper = new QueryWrapper(); + queryWrapper.lambda().eq(AiChatEntity::getCreatorUserId, userInfo.getUserId()); + queryWrapper.lambda().orderByDesc(AiChatEntity::getCreatorTime); + List list = this.list(queryWrapper); + List listVo = JsonUtil.getJsonToList(list, AiChatVo.class); + return listVo; + } + + @Override + public List historyGet(String id) { + QueryWrapper queryWrapper = new QueryWrapper(); + queryWrapper.lambda().eq(AiHistoryEntity::getChatId, id); + List list = aiHistoryService.list(queryWrapper); + List listVo = JsonUtil.getJsonToList(list, AiHisVo.class); + return listVo; + } + + @Override + public String historySave(AiForm form) { + String chatId = form.getId(); + AiChatEntity chatEntity; + if (StringUtil.isNotEmpty(chatId)) { + chatEntity = this.getById(chatId); + } else { + chatEntity = new AiChatEntity(); + chatId = RandomUtil.uuId(); + chatEntity.setId(chatId); + } + if (StringUtil.isNotEmpty(form.getFullName())) { + chatEntity.setFullName(form.getFullName()); + } + this.saveOrUpdate(chatEntity); + List data = form.getData(); + if (CollectionUtils.isNotEmpty(data)) { + AiHisVo last = data.get(data.size() - 1); + if (StringUtil.isEmpty(last.getId())) { + AiHistoryEntity entity = JsonUtil.getJsonToBean(last, AiHistoryEntity.class); + entity.setId(RandomUtil.uuId()); + entity.setChatId(chatId); + aiHistoryService.save(entity); + } + } + return chatId; + } + + @Override + public void delete(String id) { + + this.removeById(id); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AiHistoryEntity::getChatId, id); + aiHistoryService.remove(queryWrapper); + } +} diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/AiHistoryServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/AiHistoryServiceImpl.java new file mode 100644 index 0000000..da82482 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/AiHistoryServiceImpl.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.base.service.impl; + +import com.yunzhupaas.base.entity.AiHistoryEntity; +import com.yunzhupaas.base.mapper.AiHistoryMapper; +import com.yunzhupaas.base.service.AiHistoryService; +import com.yunzhupaas.base.service.SuperServiceImpl; +import org.springframework.stereotype.Service; + +/** + * ai会话记录服务 + * + * @author 云筑产品开发平台组 + * @version v5.2.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/12/2 10:05:25 + */ +@Service +public class AiHistoryServiceImpl extends SuperServiceImpl implements AiHistoryService { + + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/BaseLangServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/BaseLangServiceImpl.java new file mode 100644 index 0000000..e660fcd --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/BaseLangServiceImpl.java @@ -0,0 +1,617 @@ +package com.yunzhupaas.base.service.impl; + +import cn.hutool.cache.CacheUtil; +import cn.hutool.cache.impl.TimedCache; +import cn.hutool.core.bean.BeanUtil; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.entity.BaseLangEntity; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.mapper.BaseLangMapper; +import com.yunzhupaas.base.model.language.BaseLangForm; +import com.yunzhupaas.base.model.language.BaseLangListVO; +import com.yunzhupaas.base.model.language.BaseLangPage; +import com.yunzhupaas.base.service.BaseLangService; +import com.yunzhupaas.base.service.DictionaryDataService; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.ConfigConst; +import com.yunzhupaas.constant.GlobalConst; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.consts.ProjectEventConst; +import com.yunzhupaas.event.ProjectEventListener; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.i18n.config.I18nProperties; +import com.yunzhupaas.i18n.constant.I18nConst; +import com.yunzhupaas.module.ProjectEventBuilder; +import com.yunzhupaas.module.ProjectEventInstance; +import com.yunzhupaas.util.*; +import lombok.Cleanup; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.io.File; +import java.io.FileInputStream; +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.locks.ReentrantLock; +import java.util.stream.Collectors; + +/** + * 多语言 + * + * @author 云筑产品开发平台组 + * @version v5.0.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/4/28 16:05:49 + */ +@Service +public class BaseLangServiceImpl extends SuperServiceImpl implements BaseLangService { + + @Autowired + private ConfigValueUtil configValueUtil; + + @Autowired + private DictionaryDataService dictionaryDataApi; + + + @Autowired + private RedisUtil redisUtil; + + @Autowired + private I18nProperties i18nProperties; + + // 未使用的情况下, 默认48小时失效, 使用后重新计算缓存时效 租户/语种/前端json + private TimedCache> tenantMessageProperties = CacheUtil.newTimedCache(48 * 60 * 60000L); + // 租户语言加载锁 + private final ConcurrentHashMap lockMap = new ConcurrentHashMap<>(); + + @Override + public BaseLangListVO getList(Pagination pagination) { + List langTypeList = dictionaryDataApi.getListByTypeDataCode(ConfigConst.BASE_LANGUAGE); + String path = FileUploadUtils.getLocalBasePath() + configValueUtil.getBaseLanguagePath(); + List> tableHead = new ArrayList<>(); + List> list = new ArrayList<>(); + List> resList = new ArrayList<>(); + tableHead.add(new HashMap() {{ + put("prop", "code"); + put("label", "翻译标记"); + }}); + //不同语言的转换map + Map> langKeyMap = new HashMap<>(); + + for (DictionaryDataEntity item : langTypeList) { + tableHead.add(new HashMap() {{ + put("prop", item.getEnCode()); + put("label", item.getFullName()); + }}); + String filePath = path + "java/" + item.getEnCode() + ".json"; + LinkedHashMap resMap = new LinkedHashMap<>(); + try { + File file = new File(filePath); + @Cleanup FileInputStream fileInputStream = new FileInputStream(file); + LinkedHashMap jsonObject = JSONObject.parseObject(fileInputStream, LinkedHashMap.class); + this.parseMap(jsonObject, resMap, null); + } catch (Exception e) { + e.printStackTrace(); + } + langKeyMap.put(item.getEnCode(), resMap); + } + + + for (DictionaryDataEntity item : langTypeList) { + LinkedHashMap eachMap = langKeyMap.get(item.getEnCode()); + for (String key : eachMap.keySet()) { + Map map = list.stream().filter(t -> t.get("code").equals(key)).findFirst().orElse(null); + if (map != null) { + map.put(item.getEnCode(), eachMap.get(key)); + } else { + map = new HashMap<>(); + map.put("code", key); + map.put(item.getEnCode(), eachMap.get(key)); + list.add(map); + } + } + } + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + list = list.stream().filter(t -> { + for (String tkey : t.keySet()) { + if (t.get(tkey).contains(pagination.getKeyword())) return true; + } + return false; + }).collect(Collectors.toList()); + } + + //假分页 + if (CollectionUtils.isNotEmpty(list)) { + List>> partition = Lists.partition(list, (int) pagination.getPageSize()); + int i = (int) pagination.getCurrentPage() - 1; + resList = partition.size() > i ? partition.get(i) : Collections.emptyList(); + pagination.setTotal(list.size()); + } + + BaseLangListVO vo = new BaseLangListVO(); + PaginationVO page = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + vo.setList(resList); + vo.setTableHead(tableHead); + vo.setPagination(page); + return vo; + } + + /** + * 多层map,解析成单层key,value + * + * @param sourMap + * @param resMap + * @param supKey + */ + public void parseMap(LinkedHashMap sourMap, LinkedHashMap resMap, String supKey) { + for (String key : sourMap.keySet()) { + if (sourMap.get(key).toString().startsWith("{") && sourMap.get(key).toString().endsWith("}")) { + LinkedHashMap childSourMap = JSONObject.parseObject(sourMap.get(key).toString(), LinkedHashMap.class); + String newSupKey = key; + if (StringUtil.isNotEmpty(supKey)) { + newSupKey = supKey + "." + key; + } + this.parseMap(childSourMap, resMap, newSupKey); + } else { + String value = sourMap.get(key).toString(); + if (supKey != null) { + String skey = supKey + "." + key; + resMap.put(skey, value); + } else { + String skey = key; + resMap.put(skey, value); + } + } + } + } + + /** + * 根据不同语种查询列表最大列表 + * + * @param pagination + * @param langTypeList + * @param idList + * @return + */ + private IPage getList(BaseLangPage pagination, List langTypeList, List idList) { + IPage listRes = null; + for (DictionaryDataEntity item : langTypeList) { + String enCode = item.getEnCode(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(BaseLangEntity::getLanguage, enCode); + if (CollectionUtils.isNotEmpty(idList)) { + queryWrapper.lambda().in(BaseLangEntity::getId, idList); + } + if (Objects.nonNull(pagination.getType())) { + queryWrapper.lambda().eq(BaseLangEntity::getType, pagination.getType()); + } + queryWrapper.lambda().orderByDesc(BaseLangEntity::getCreatorTime); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage list = this.page(page, queryWrapper); + if (listRes == null) { + listRes = list; + } else { + if (listRes.getTotal() < list.getTotal()) { + listRes = list; + } + } + } + return listRes; + } + + @Override + public BaseLangListVO list(BaseLangPage pagination) { + List langTypeList = dictionaryDataApi.getListByTypeDataCode(ConfigConst.BASE_LANGUAGE); + List> tableHead = new ArrayList<>(); + tableHead.add(new HashMap() {{ + put("prop", "code"); + put("label", "翻译标记"); + }}); + for (DictionaryDataEntity item : langTypeList) { + tableHead.add(new HashMap() {{ + put("prop", item.getEnCode()); + put("label", item.getFullName()); + }}); + } + String keyword = pagination.getKeyword(); + List idList = new ArrayList<>(); + if (StringUtil.isNotEmpty(keyword)) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().and(t -> t.like(BaseLangEntity::getEnCode, keyword) + .or().like(BaseLangEntity::getFullName, keyword)); + List list = list(queryWrapper); + if (CollectionUtils.isEmpty(list)) { + return new BaseLangListVO(new ArrayList<>(), tableHead, pagination); + } else { + idList = list.stream().map(BaseLangEntity::getId).collect(Collectors.toList()); + } + } + IPage list = getList(pagination, langTypeList, idList); + List baseLangEntities = pagination.setData(list.getRecords(), list.getTotal()); + + List> resList = new ArrayList<>(); + for (BaseLangEntity item : baseLangEntities) { + String groupId = item.getGroupId(); + Map resMap = new LinkedHashMap<>(); + List byGroupId = this.getByGroupId(item.getGroupId()); + resMap.put("id", groupId); + resMap.put("code", item.getEnCode()); + resMap.put("typeName", Objects.equals(item.getType(), 0) ? "客户端" : "服务端"); + for (BaseLangEntity entity : byGroupId) { + resMap.put(entity.getLanguage(), entity.getFullName()); + } + resList.add(resMap); + } + + BaseLangListVO vo = new BaseLangListVO(); + PaginationVO pagevo = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + vo.setList(resList); + vo.setTableHead(tableHead); + vo.setPagination(pagevo); + return vo; + } + + @Override + public void create(BaseLangForm form) { + List byEnode = this.getByEnodeLang(form.getEnCode(), null); + if (CollectionUtils.isNotEmpty(byEnode)) { + throw new DataException(MsgCode.SYS051.get()); + } + Map map = form.getMap(); + boolean atLeastOne = false; + if (MapUtils.isNotEmpty(map)) { + atLeastOne = map.values().stream().anyMatch(v -> v != null && !v.trim().isEmpty()); + } + if (!atLeastOne) { + throw new DataException(MsgCode.SYS052.get()); + } + String groupId = RandomUtil.uuId(); + for (String key : map.keySet()) { + BaseLangEntity entity = JsonUtil.getJsonToBean(form, BaseLangEntity.class); + entity.setGroupId(groupId); + entity.setLanguage(key); + entity.setFullName(map.get(key)); + saveEntity(entity); + } + this.createReids(form.getType()); + } + + @Override + public void update(BaseLangForm form) { + List langList = getByGroupId(form.getId()); + if (CollectionUtils.isEmpty(langList)) { + throw new DataException(MsgCode.FA002.get()); + } + List byEnodeLang = getByEnodeLang(form.getEnCode(), null); + List hasLang = byEnodeLang.stream().filter(t -> !t.getGroupId().equals(form.getId())).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(hasLang)) { + throw new DataException(MsgCode.SYS051.get()); + } + + Map map = form.getMap(); + boolean atLeastOne = false; + if (MapUtils.isNotEmpty(map)) { + atLeastOne = map.values().stream().anyMatch(v -> v != null && !v.trim().isEmpty()); + } + if (!atLeastOne) { + throw new DataException(MsgCode.SYS052.get()); + } + List keyList = new ArrayList<>(map.keySet()); + String groupId = ""; + List deleteList = new ArrayList<>(); + for (BaseLangEntity t : langList) { + if (!keyList.contains(t.getLanguage())) { + deleteList.add(t); + } + groupId = t.getGroupId(); + } + //删除移除的 + if (CollectionUtils.isNotEmpty(deleteList)) { + this.removeBatchByIds(deleteList.stream().map(BaseLangEntity::getId).collect(Collectors.toList())); + } + + for (String key : keyList) { + BaseLangEntity entity = langList.stream().filter(t -> key.equals(t.getLanguage())).findFirst().orElse(new BaseLangEntity()); + if (StringUtil.isNotEmpty(entity.getId())) { + entity.setEnCode(form.getEnCode()); + entity.setType(form.getType()); + entity.setFullName(map.get(key)); + entity.setLastModifyTime(DateUtil.getNowDate()); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + this.updateById(entity); + } else { + entity.setId(RandomUtil.uuId()); + entity.setGroupId(groupId); + entity.setEnCode(form.getEnCode()); + entity.setType(form.getType()); + entity.setLanguage(key); + entity.setFullName(map.get(key)); + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + this.save(entity); + } + } + this.createReids(form.getType()); + } + + @Override + public BaseLangForm getInfo(String groupId) { + List byEnodeLang = getByGroupId(groupId); + BaseLangForm form = new BaseLangForm(); + form.setId(groupId); + LinkedHashMap map = new LinkedHashMap<>(); + for (BaseLangEntity entity : byEnodeLang) { + form.setEnCode(entity.getEnCode()); + form.setType(entity.getType()); + map.put(entity.getLanguage(), entity.getFullName()); + } + form.setMap(map); + return form; + } + + @Override + public void delete(String groupId) { + List byGroupId = getByGroupId(groupId); + Integer type = byGroupId.get(0).getType(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(BaseLangEntity::getGroupId, groupId); + this.remove(queryWrapper); + this.createReids(type); + } + + @Override + public void importSaveOrUpdate(List list) { + Map enCodeGroupId = new HashMap<>(); + boolean hasFront = false; + boolean hasServer = false; + for (BaseLangEntity item : list) { + if (Objects.equals(item.getType(), 0)) { + hasFront = true; + } + if (Objects.equals(item.getType(), 1) || Objects.equals(item.getType(), 2)) { + hasServer = true; + } + List byEnodeLang = getByEnodeLang(item.getEnCode(), null); + String groupId = RandomUtil.uuId(); + if (CollectionUtils.isNotEmpty(byEnodeLang)) { + groupId = byEnodeLang.get(0).getGroupId(); + if (!enCodeGroupId.containsKey(byEnodeLang.get(0).getEnCode())) { + enCodeGroupId.put(item.getEnCode(), groupId); + } + BaseLangEntity entity = byEnodeLang.stream().filter(t -> t.getLanguage().equals(item.getLanguage())).findFirst().orElse(null); + if (entity != null) { + boolean modify = false; + if(!Objects.equals(entity.getType(), item.getType())) { + entity.setType(item.getType()); + modify = true; + } + if(!Objects.equals(entity.getFullName(), item.getFullName())) { + entity.setFullName(item.getFullName()); + modify = true; + } + if(modify) { + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + this.updateById(entity); + } + } else { + entity = JsonUtil.getJsonToBean(item, BaseLangEntity.class); + entity.setGroupId(groupId); + saveEntity(entity); + } + } else { + if (enCodeGroupId.containsKey(item.getEnCode())) { + groupId = enCodeGroupId.get(item.getEnCode()); + } else { + enCodeGroupId.put(item.getEnCode(), groupId); + } + BaseLangEntity entity = BeanUtil.copyProperties(item, BaseLangEntity.class); + entity.setGroupId(groupId); + saveEntity(entity); + } + } + if (hasFront) { + this.createReids(0); + } + if (hasServer) { + this.createReids(1); + } + } + + private void saveEntity(BaseLangEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + this.save(entity); + } + + /** + * 根据翻译标记和语种获取数据 + * + * @param enCode + * @param language + * @return + */ + private List getByEnodeLang(String enCode, String language) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(enCode)) { + queryWrapper.lambda().eq(BaseLangEntity::getEnCode, enCode); + } + if (StringUtil.isNotEmpty(language)) { + queryWrapper.lambda().eq(BaseLangEntity::getLanguage, language); + } + return this.list(queryWrapper); + } + + /** + * 根据翻译标记id获取数据 + * + * @param groupId + * @return + */ + private List getByGroupId(String groupId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(BaseLangEntity::getGroupId, groupId); + queryWrapper.lambda().orderByAsc(BaseLangEntity::getSortCode).orderByAsc(BaseLangEntity::getCreatorTime); + return this.list(queryWrapper); + } + + /** + * 创建修改添加缓存触发 + * + * @param type + */ + private void createReids(Integer type) { + String tenantId = GlobalConst.DEFAULT_TENANT_VALUE; + if (configValueUtil.isMultiTenancy()) { + tenantId = TenantHolder.getDatasourceId(); + } + String cacheType = I18nConst.CACHE_KEY_FRONT; + if (Objects.equals(type, 1)) { + cacheType = I18nConst.CACHE_KEY_SERVER; + } + String redisKey = cacheType + tenantId; + PublishEventUtil.publish(new ProjectEventBuilder(redisKey, System.currentTimeMillis()).setMessageModel(ProjectEventConst.EVENT_PUBLISH_MODEL_BROADCASTING)); + } + + /** + * 组装语种json + * + * @param language + * @return + */ + private String makeLanguageJson(String language) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(BaseLangEntity::getLanguage, language); + queryWrapper.lambda().eq(BaseLangEntity::getType, 0); + JSONObject json = new JSONObject(); + List list = list(queryWrapper); + for (BaseLangEntity baseLangEntity : list) { +// 不需要组装成对象。(组装成对象父级key如果被存储信息了转换json对象有问题) +// addJsonTree(baseLangEntity.getEnCode(), json, baseLangEntity.getFullName()); + json.put(baseLangEntity.getEnCode(), baseLangEntity.getFullName()); + } + return json.toJSONString(); + } + + /** + * 递归添加属性 + * + * @param enCode + * @param json + * @param fullName + */ + private void addJsonTree(String enCode, JSONObject json, String fullName) { + if (enCode.contains(".")) { + String one = enCode.substring(0, enCode.indexOf(".")); + String two = enCode.substring(enCode.indexOf(".") + 1); + JSONObject towJson = new JSONObject(); + if (json.containsKey(one)) { + towJson = (JSONObject) json.get(one); + } + addJsonTree(two, towJson, fullName); + json.put(one, towJson); + } else { + if (!json.containsKey(enCode)) { + json.put(enCode, fullName); + } + } + } + + /** + * 监听缓存修改语种信息 + * + * @param redisEvent + */ + @ProjectEventListener(channelRegex = I18nConst.CACHE_KEY_FRONT + ".*") + public void onRedisKeySetEvent(ProjectEventInstance redisEvent) { + String key = redisEvent.getChannel(); + // 获取多租户编码 + key = key.substring(I18nConst.CACHE_KEY_FRONT.length()); + tenantMessageProperties.remove(key); + } + + /** + * 初始化语种 + * + * @param tenantId + * @param locale + */ + public void loadTenantMessage(String tenantId, Locale locale) { + String languageJson = this.makeLanguageJson(locale.toLanguageTag()); + Map tenantLangJson = tenantMessageProperties.get(tenantId); + if (tenantLangJson == null) { + tenantLangJson = new HashMap<>(); + tenantMessageProperties.put(tenantId, tenantLangJson); + } + tenantLangJson.put(locale.toLanguageTag(), languageJson); + } + + /** + * 前端获取语种json + * + * @param locale 语种 + * @return + */ + @Override + public String getLanguageJson(Locale locale) { + // 默认租户或者当前租户 + String tenantId = GlobalConst.DEFAULT_TENANT_VALUE; + if (configValueUtil.isMultiTenancy()) { + tenantId = TenantHolder.getDatasourceId(); + } + // 开启租户未获取到租户 不进行翻译获取 + if (tenantId != null) { + String language; + // 租户配置中的语言配置 + String languageTag = locale.toLanguageTag(); + if (!tenantMessageProperties.containsKey(tenantId) || !tenantMessageProperties.get(tenantId).containsKey(languageTag)) { + // 租户其他线程正在加载多语言则直接返回 + ReentrantLock lock = lockMap.computeIfAbsent(tenantId, k -> new ReentrantLock()); + boolean isLock = false; + try { + // 如果其他线程正在处理租户翻译则最多等待十秒钟 + isLock = lock.tryLock(5L, TimeUnit.SECONDS); + if (isLock) { + if (!tenantMessageProperties.containsKey(tenantId) || !tenantMessageProperties.get(tenantId).containsKey(languageTag)) { + loadTenantMessage(tenantId, locale); + } + } + } catch (InterruptedException e) { + } finally { + if (isLock) { + lock.unlock(); + } + } + } + language = tenantMessageProperties.get(tenantId).get(languageTag); + // 语言不存在翻译配置, 强制返回默认配置语言, 已经是默认语言无法处理 + if ((language == null || "{}".equals(language)) && !Objects.equals(locale.toLanguageTag(), i18nProperties.getDefaultLanguage())) { + return getLanguageJson(Locale.forLanguageTag(i18nProperties.getDefaultLanguage())); + } + return language; + } + return null; + } + + @Override + public List getServerLang(Locale locale) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(BaseLangEntity::getLanguage, locale.toLanguageTag()); + List type = ImmutableList.of(0, 1); + queryWrapper.lambda().in(BaseLangEntity::getType, type); + return list(queryWrapper); + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/BillRuleServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/BillRuleServiceImpl.java new file mode 100644 index 0000000..e1656f0 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/BillRuleServiceImpl.java @@ -0,0 +1,360 @@ +package com.yunzhupaas.base.service.impl; + + +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.ObjectUtil; +import com.yunzhupaas.base.model.billrule.BillRulePagination; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.entity.BillRuleEntity; +import com.yunzhupaas.base.mapper.BillRuleMapper; +import com.yunzhupaas.base.service.BillRuleService; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; + +/** + * 单据规则 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Service +public class BillRuleServiceImpl extends SuperServiceImpl implements BillRuleService { + + @Autowired + private RedisUtil redisUtil; + + @Override + public List getList(BillRulePagination pagination) { + // 定义变量判断是否需要使用修改时间倒序 + boolean flag = false; + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (!StringUtil.isEmpty(pagination.getKeyword())) { + flag = true; + queryWrapper.lambda().and( + t -> t.like(BillRuleEntity::getFullName, pagination.getKeyword()) + .or().like(BillRuleEntity::getEnCode, pagination.getKeyword()) + ); + } + if (!StringUtil.isEmpty(pagination.getCategoryId())) { + flag = true; + queryWrapper.lambda().and( + t -> t.like(BillRuleEntity::getCategory, pagination.getCategoryId()) + ); + } + if (pagination.getEnabledMark() != null) { + flag = true; + queryWrapper.lambda().eq(BillRuleEntity::getEnabledMark, pagination.getEnabledMark()); + } + // 排序 + queryWrapper.lambda().orderByAsc(BillRuleEntity::getSortCode).orderByDesc(BillRuleEntity::getCreatorTime); + if (flag) { + queryWrapper.lambda().orderByDesc(BillRuleEntity::getLastModifyTime); + } + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage userPage = this.page(page, queryWrapper); + return pagination.setData(userPage.getRecords(), page.getTotal()); + } + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(BillRuleEntity::getEnabledMark, 1); + // 排序 + queryWrapper.lambda().orderByAsc(BillRuleEntity::getSortCode).orderByDesc(BillRuleEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public BillRuleEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(BillRuleEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public boolean isExistByFullName(String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(BillRuleEntity::getFullName, fullName); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(BillRuleEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public boolean isExistByEnCode(String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(BillRuleEntity::getEnCode, enCode); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(BillRuleEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + @DSTransactional + public String getNumber(String enCode) throws DataException { + StringBuilder strNumber = new StringBuilder(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(BillRuleEntity::getEnCode, enCode); + BillRuleEntity entity = this.getOne(queryWrapper); + if (entity != null) { + Integer startNumber = StringUtil.isEmpty(entity.getStartNumber()) ? 0 : Integer.parseInt(entity.getStartNumber()); + //拼接单据编码 + strNumber.append(StringUtil.isNotEmpty(entity.getPrefix()) ? entity.getPrefix() : ""); + if (ObjectUtil.equal(entity.getType(), 2)) { + // 随机数编号 + if (ObjectUtil.equal(entity.getRandomType(), 1)) { + strNumber.append(cn.hutool.core.util.RandomUtil.randomNumbers(entity.getRandomDigit())); + } else { + strNumber.append(cn.hutool.core.util.RandomUtil.randomStringUpper(entity.getRandomDigit())); + } + } else if (ObjectUtil.equal(entity.getType(), 3)) { + // UUID + strNumber.append(IdUtil.randomUUID().toUpperCase()); + } else { + // 时间格式 + String dateFor = entity.getDateFormat(); + String dateForValue = "no"; + switch (dateFor) { + case "YYYY": + dateForValue = "yyyy"; + break; + case "YYYYMM": + dateForValue = "yyyyMM"; + break; + case "YYYYMMDD": + dateForValue = "yyyyMMdd"; + break; + case "YYYYMMDDHH": + dateForValue = "yyyyMMddHH"; + break; + case "YYYYMMDDHHmm": + dateForValue = "yyyyMMddHHmm"; + break; + case "YYYYMMDDHHmmss": + dateForValue = "yyyyMMddHHmmss"; + break; + case "YYYYMMDDHHmmssSSS": + dateForValue = "yyyyMMddHHmmssSSS"; + break; + } + //处理隔天流水号归0 + if (entity.getOutputNumber() != null) { + String serialDate = ""; + entity.setThisNumber(entity.getThisNumber() + 1); + if (!"no".equals(dateForValue)) { + String thisDate = DateUtil.dateNow(dateForValue); + int suffixLength = entity.getSuffix() != null ? entity.getSuffix().length() : 0; + try{ + serialDate= entity.getOutputNumber().substring((entity.getOutputNumber().length() - dateForValue.length() - entity.getDigit() - suffixLength), (entity.getOutputNumber().length() - entity.getDigit() - suffixLength)); + }catch (Exception e){ + } + if (!serialDate.equals(thisDate)) { + entity.setThisNumber(0); + } + } + } else { + entity.setThisNumber(0); + } + if (!"no".equals(dateForValue)) { + strNumber.append(DateUtil.dateNow(dateForValue)); + } + strNumber.append(PadUtil.padRight(String.valueOf(startNumber + entity.getThisNumber()), entity.getDigit(), '0')); + } + strNumber.append(StringUtil.isNotEmpty(entity.getSuffix()) ? entity.getSuffix() : ""); + //更新流水号 + entity.setOutputNumber(strNumber.toString()); + this.updateById(entity); + } else { + throw new DataException("单据规则不存在"); + } + return strNumber.toString(); + } + + @Override + public void create(BillRuleEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + this.save(entity); + } + + @Override + public boolean update(String id, BillRuleEntity entity) { + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + return this.updateById(entity); + } + + @Override + public void delete(BillRuleEntity entity) { + this.removeById(entity.getId()); + } + + @Override + @DSTransactional + public boolean first(String id) { + boolean isOk = false; + //获取要上移的那条数据的信息 + BillRuleEntity upEntity = this.getById(id); + Long upSortCode = upEntity.getSortCode() == null ? 0 : upEntity.getSortCode(); + //查询上几条记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .lt(BillRuleEntity::getSortCode, upSortCode) + .orderByDesc(BillRuleEntity::getSortCode); + List downEntity = this.list(queryWrapper); + if (downEntity.size() > 0) { + //交换两条记录的sort值 + Long temp = upEntity.getSortCode(); + upEntity.setSortCode(downEntity.get(0).getSortCode()); + downEntity.get(0).setSortCode(temp); + this.updateById(downEntity.get(0)); + this.updateById(upEntity); + isOk = true; + } + return isOk; + } + + @Override + @DSTransactional + public boolean next(String id) { + boolean isOk = false; + //获取要下移的那条数据的信息 + BillRuleEntity downEntity = this.getById(id); + Long upSortCode = downEntity.getSortCode() == null ? 0 : downEntity.getSortCode(); + //查询下几条记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .gt(BillRuleEntity::getSortCode, upSortCode) + .orderByAsc(BillRuleEntity::getSortCode); + List upEntity = this.list(queryWrapper); + if (upEntity.size() > 0) { + //交换两条记录的sort值 + Long temp = downEntity.getSortCode(); + downEntity.setSortCode(upEntity.get(0).getSortCode()); + upEntity.get(0).setSortCode(temp); + this.updateById(upEntity.get(0)); + this.updateById(downEntity); + isOk = true; + } + return isOk; + } + + @Override + public String getBillNumber(String enCode, boolean isCache) throws DataException { + String strNumber; + String tenantId = !StringUtil.isEmpty(UserProvider.getUser().getTenantId()) ? UserProvider.getUser().getTenantId() : ""; + if (isCache) { + String cacheKey = tenantId + UserProvider.getUser().getUserId() + enCode; + if (!redisUtil.exists(cacheKey)) { + strNumber = this.getNumber(enCode); + redisUtil.insert(cacheKey, strNumber); + } else { + strNumber = String.valueOf(redisUtil.getString(cacheKey)); + } + } else { + strNumber = this.getNumber(enCode); + } + return strNumber; + } + + @Override + public void useBillNumber(String enCode) { + String cacheKey = UserProvider.getUser().getTenantId() + UserProvider.getUser().getUserId() + enCode; + redisUtil.remove(cacheKey); + } + + @Override + @Transactional + public ActionResult ImportData(BillRuleEntity entity, Integer type) throws DataException { + if (entity != null) { + StringJoiner stringJoiner = new StringJoiner("、"); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(BillRuleEntity::getId, entity.getId()); + if (this.count(queryWrapper) > 0) { + if (Objects.equals(type, 0)) { + stringJoiner.add("ID"); + } else { + entity.setId(RandomUtil.uuId()); + } + } + queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(BillRuleEntity::getEnCode, entity.getEnCode()); + if (this.count(queryWrapper) > 0) { + stringJoiner.add("编码"); + } + queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(BillRuleEntity::getFullName, entity.getFullName()); + if (this.count(queryWrapper) > 0) { + stringJoiner.add("名称"); + } + if (stringJoiner.length() > 0 && ObjectUtil.equal(type, 1)) { + String copyNum = UUID.randomUUID().toString().substring(0, 5); + entity.setFullName(entity.getFullName() + ".副本" + copyNum); + entity.setEnCode(entity.getEnCode() + copyNum); + } else if (ObjectUtil.equal(type, 0) && stringJoiner.length() > 0) { + return ActionResult.fail(stringJoiner.toString() + "重复"); + } + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(UserProvider.getLoginUserId()); + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + try { + this.setIgnoreLogicDelete().removeById(entity); + entity.setEnabledMark(0); + entity.setThisNumber(null); + entity.setOutputNumber(null); + this.setIgnoreLogicDelete().saveOrUpdate(entity); + } catch (Exception e) { + throw new DataException(MsgCode.IMP003.get()); + }finally { + this.clearIgnoreLogicDelete(); + } + return ActionResult.success(MsgCode.IMP001.get()); + } + return ActionResult.fail(MsgCode.IMP004.get()); + } + @Override + public List getListByCategory(String id,Pagination pagination) { + // 定义变量判断是否需要使用修改时间倒序 + boolean flag = false; + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (!StringUtil.isEmpty(pagination.getKeyword())) { + flag = true; + queryWrapper.lambda().and( + t -> t.like(BillRuleEntity::getFullName, pagination.getKeyword()) + .or().like(BillRuleEntity::getEnCode, pagination.getKeyword()) + ); + } + if (!StringUtil.isEmpty(id)) { + flag = true; + queryWrapper.lambda().eq(BillRuleEntity::getCategory, id); + } + queryWrapper.lambda().eq(BillRuleEntity::getEnabledMark, 1); + // 排序 + queryWrapper.lambda().orderByAsc(BillRuleEntity::getSortCode).orderByDesc(BillRuleEntity::getCreatorTime); + if (flag) { + queryWrapper.lambda().orderByDesc(BillRuleEntity::getLastModifyTime); + } + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage userPage = this.page(page, queryWrapper); + return pagination.setData(userPage.getRecords(), page.getTotal()); + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ComFieldsServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ComFieldsServiceImpl.java new file mode 100644 index 0000000..9e28117 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ComFieldsServiceImpl.java @@ -0,0 +1,81 @@ +package com.yunzhupaas.base.service.impl; + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yunzhupaas.base.entity.ComFieldsEntity; +import com.yunzhupaas.base.mapper.BaseComFieldsMapper; +import com.yunzhupaas.base.service.ComFieldsService; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Service +public class ComFieldsServiceImpl extends SuperServiceImpl implements ComFieldsService { + + + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().orderByAsc(ComFieldsEntity::getSortCode).orderByDesc(ComFieldsEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public ComFieldsEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ComFieldsEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public boolean isExistByFullName(String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ComFieldsEntity::getFieldName, fullName); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(ComFieldsEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + + + @Override + public void create(ComFieldsEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + entity.setEnabledMark(1); + this.save(entity); + } + + @Override + public boolean update(String id, ComFieldsEntity entity) { + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + return this.updateById(entity); + } + + @Override + public void delete(ComFieldsEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/CommonWordsServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/CommonWordsServiceImpl.java new file mode 100644 index 0000000..548ead2 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/CommonWordsServiceImpl.java @@ -0,0 +1,135 @@ +package com.yunzhupaas.base.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yunzhupaas.base.entity.CommonWordsEntity; +import com.yunzhupaas.base.entity.SystemEntity; +import com.yunzhupaas.base.mapper.CommonWordsMapper; +import com.yunzhupaas.base.model.commonword.ComWordsPagination; +import com.yunzhupaas.base.service.CommonWordsService; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.base.service.SystemService; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + + +/** + * 审批常用语 ServiceImpl + * + * @author 云筑产品开发平台组 + * @version v3.4.6 + * @copyrignt 深圳市乐程软件有限公司 + * @date 2023-01-06 + */ +@Service +public class CommonWordsServiceImpl extends SuperServiceImpl implements CommonWordsService { + + + @Autowired + private SystemService systemService; + + + @Override + public List getSysList(ComWordsPagination comWordsPagination, Boolean currentSysFlag) { + QueryWrapper sysQuery = new QueryWrapper<>(); + // 匹配 + QueryWrapper query = new QueryWrapper<>(); + if (Objects.nonNull(comWordsPagination.getCommonWordsType())) { + query.lambda().eq(CommonWordsEntity::getCommonWordsType, comWordsPagination.getCommonWordsType()); + if (Objects.equals(comWordsPagination.getCommonWordsType(), 1)) { + query.lambda().eq(CommonWordsEntity::getCreatorUserId, UserProvider.getUser().getUserId()); + } + } + +// if(currentSysFlag) query.lambda().like(CommonWordsEntity::getSystemIds, UserProvider.getUser().getSystemId()); + if (StringUtil.isNotEmpty(comWordsPagination.getKeyword())) { + sysQuery.lambda().like(SystemEntity::getFullName, comWordsPagination.getKeyword()); + List ids = systemService.list(sysQuery).stream().map(SystemEntity::getId).collect(Collectors.toList()); + query.lambda().and(t -> { + // 应用名称 + for (String id : ids) { + t.like(CommonWordsEntity::getSystemIds, id).or(); + } + t.like(CommonWordsEntity::getCommonWordsText, comWordsPagination.getKeyword()); // 常用语 + }); + } + if (comWordsPagination.getEnabledMark() != null) { + query.lambda().eq(CommonWordsEntity::getEnabledMark, comWordsPagination.getEnabledMark()); + } + // 排序 + if(Objects.equals(comWordsPagination.getCommonWordsType(),1)){ + query.lambda().orderByDesc(CommonWordsEntity::getUsesNum); + } + query.lambda().orderByAsc(CommonWordsEntity::getSortCode).orderByDesc(CommonWordsEntity::getCreatorTime); + Page page = this.page(comWordsPagination.getPage(), query); + comWordsPagination.setTotal(page.getTotal()); + return page.getRecords(); + } + + @Override + public List getListModel(String type) { + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(CommonWordsEntity::getEnabledMark, 1) + .and(t -> + t.and(t2 -> t2.eq(CommonWordsEntity::getCreatorUserId, UserProvider.getUser().getUserId()).or().eq(CommonWordsEntity::getCommonWordsType, 0)) + ); + // 排序 + query.lambda() + .orderByDesc(CommonWordsEntity::getCommonWordsType) + .orderByDesc(CommonWordsEntity::getUsesNum) + .orderByAsc(CommonWordsEntity::getSortCode) + .orderByDesc(CommonWordsEntity::getCreatorTime); + return this.list(query); + } + + @Override + public Boolean existSystem(String systemId) { + QueryWrapper query = new QueryWrapper<>(); + query.lambda().like(CommonWordsEntity::getSystemIds, systemId); + return count(query) > 0; + } + + @Override + public Boolean existCommonWord(String id, String commonWordsText, Integer commonWordsType) { + QueryWrapper query = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(id)) { + query.lambda().ne(CommonWordsEntity::getId, id); + } + if (ObjectUtil.isNotEmpty(commonWordsType)) { + if (Objects.equals(commonWordsType, 1)) { + query.lambda().and(t -> + t.eq(CommonWordsEntity::getCreatorUserId, UserProvider.getUser().getUserId()).or().eq(CommonWordsEntity::getCommonWordsType, 0) + ); + } else { + query.lambda().eq(CommonWordsEntity::getCommonWordsType, commonWordsType); + } + } + query.lambda().eq(CommonWordsEntity::getCommonWordsText, commonWordsText); + return count(query) > 0; + } + + @Override + public void addCommonWordsNum(String commonWordsText) { + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(CommonWordsEntity::getCommonWordsText, commonWordsText); + query.lambda().eq(CommonWordsEntity::getCreatorUserId, UserProvider.getUser().getUserId()); + query.lambda().eq(CommonWordsEntity::getCommonWordsType, 1); + List list = list(query); + if (list.size() > 0) { + for (CommonWordsEntity item : list) { + long num = item.getUsesNum() == null ? 0 : item.getUsesNum(); + item.setUsesNum(num + 1); + this.updateById(item); + } + } + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/DataInterfaceLogServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/DataInterfaceLogServiceImpl.java new file mode 100644 index 0000000..3e2ab46 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/DataInterfaceLogServiceImpl.java @@ -0,0 +1,105 @@ +package com.yunzhupaas.base.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.github.yulichang.toolkit.JoinWrappers; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.yunzhupaas.base.entity.DataInterfaceEntity; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.entity.DataInterfaceLogEntity; +import com.yunzhupaas.base.mapper.DataInterfaceLogMapper; +import com.yunzhupaas.base.model.InterfaceOauth.PaginationIntrfaceLog; +import com.yunzhupaas.base.service.DataInterfaceLogService; +import com.yunzhupaas.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-06-03 + */ +@Service +public class DataInterfaceLogServiceImpl extends SuperServiceImpl implements DataInterfaceLogService { + + @Override + public void create(String dateInterfaceId, Integer invokWasteTime) { + DataInterfaceLogEntity entity = new DataInterfaceLogEntity(); + entity.setId(RandomUtil.uuId()); + entity.setInvokTime(DateUtil.getNowDate()); + entity.setUserId(UserProvider.getUser().getUserId()); + entity.setInvokId(dateInterfaceId); + entity.setInvokIp(IpUtil.getIpAddr()); + entity.setInvokType("GET"); + entity.setInvokDevice(ServletUtil.getUserAgent()); + entity.setInvokWasteTime(invokWasteTime); + this.save(entity); + } + @Override + public void create(String dateInterfaceId, Integer invokWasteTime,String appId,String invokType) { + DataInterfaceLogEntity entity = new DataInterfaceLogEntity(); + entity.setId(RandomUtil.uuId()); + entity.setInvokTime(DateUtil.getNowDate()); + entity.setUserId(UserProvider.getUser().getUserId()); + entity.setInvokId(dateInterfaceId); + entity.setInvokIp(IpUtil.getIpAddr()); + entity.setInvokType(invokType); + entity.setInvokDevice(ServletUtil.getUserAgent()); + entity.setInvokWasteTime(invokWasteTime); + entity.setOauthAppId(appId); + this.save(entity); + } + + @Override + public List getList(String invokId, Pagination pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DataInterfaceLogEntity::getInvokId, invokId).orderByDesc(DataInterfaceLogEntity::getInvokTime); + if (StringUtil.isNotEmpty(pagination.getKeyword())){ + queryWrapper.lambda().and( + t->t.like(DataInterfaceLogEntity::getUserId, pagination.getKeyword()) + .or().like(DataInterfaceLogEntity::getInvokIp, pagination.getKeyword()) + .or().like(DataInterfaceLogEntity::getInvokDevice, pagination.getKeyword()) + .or().like(DataInterfaceLogEntity::getInvokType, pagination.getKeyword()) + ); + } + // 排序 + queryWrapper.lambda().orderByDesc(DataInterfaceLogEntity::getInvokTime); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage iPage = this.page(page, queryWrapper); + return pagination.setData(iPage.getRecords(), page.getTotal()); + } + + @Override + public List getListByIds(String appId,List invokIds, PaginationIntrfaceLog pagination) { + MPJLambdaWrapper queryWrapper = JoinWrappers + .lambda(DataInterfaceLogEntity.class) + .leftJoin(DataInterfaceEntity.class,DataInterfaceEntity::getId,DataInterfaceLogEntity::getInvokId); + queryWrapper.eq(DataInterfaceLogEntity::getOauthAppId,appId); + queryWrapper.in(DataInterfaceLogEntity::getInvokId, invokIds); + if (StringUtil.isNotEmpty(pagination.getKeyword())){ + queryWrapper.and( + t->t.like(DataInterfaceEntity::getEnCode, pagination.getKeyword()) + .or().like(DataInterfaceEntity::getFullName, pagination.getKeyword()) + ); + } + //日期范围(近7天、近1月、近3月、自定义) + if (ObjectUtil.isNotEmpty(pagination.getStartTime()) && ObjectUtil.isNotEmpty(pagination.getEndTime())) { + queryWrapper.between(DataInterfaceLogEntity::getInvokTime, new Date(pagination.getStartTime()), new Date(pagination.getEndTime())); + } + // 排序 + queryWrapper.orderByDesc(DataInterfaceLogEntity::getInvokTime); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage iPage = this.selectJoinListPage(page, DataInterfaceLogEntity.class,queryWrapper); + return pagination.setData(iPage.getRecords(), page.getTotal()); + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/DataInterfaceServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/DataInterfaceServiceImpl.java new file mode 100644 index 0000000..646d91b --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/DataInterfaceServiceImpl.java @@ -0,0 +1,1557 @@ +package com.yunzhupaas.base.service.impl; + +import cn.dev33.satoken.context.SaHolder; +import cn.hutool.core.util.BooleanUtil; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.entity.DataInterfaceVariateEntity; +import com.yunzhupaas.base.service.*; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.ActionResultCode; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.DataInterfaceEntity; +import com.yunzhupaas.base.entity.InterfaceOauthEntity; +import com.yunzhupaas.base.mapper.DataInterfaceMapper; +import com.yunzhupaas.base.model.datainterface.*; +import com.yunzhupaas.base.util.DataInterfaceParamUtil; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.YunzhupaasConst; +import com.yunzhupaas.constant.DataInterfaceVarConst; +import com.yunzhupaas.permission.model.authorize.AuthorizeConditionEnum; +import com.yunzhupaas.permission.service.OrganizeAdministratorService; +import com.yunzhupaas.permission.service.OrganizeService; +import com.yunzhupaas.util.JScriptUtil; +import com.yunzhupaas.base.util.interfaceUtil.InterfaceUtil; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.database.model.dto.PrepSqlDTO; +import com.yunzhupaas.database.util.DataSourceUtil; +import com.yunzhupaas.database.util.JdbcUtil; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.wxutil.HttpUtil; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.script.ScriptException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.text.SimpleDateFormat; +import java.time.LocalDateTime; +import java.time.ZoneOffset; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Service +@Slf4j +public class DataInterfaceServiceImpl extends SuperServiceImpl + implements DataInterfaceService { + @Autowired + private DbLinkService dblinkService; + @Autowired + private DataSourceUtil dataSourceUtils; + @Autowired + private DataInterfaceLogService dataInterfaceLogService; + @Autowired + private DataInterfaceVariateService dataInterfaceVariateService; + @Autowired + private InterfaceOauthService interfaceOauthService; + @Autowired + private OrganizeService organizeApi; + + @Autowired + private OrganizeAdministratorService organizeAdminTratorApi; + @Autowired + private DataInterfaceUserService dataInterfaceUserService; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private DataInterfaceVariateService variateService; + + @Override + public List getList(PaginationDataInterface pagination, Integer isSelector) { + // 定义变量判断是否需要使用修改时间倒序 + boolean flag = false; + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (ObjectUtil.isNotEmpty(pagination.getEnabledMark())) { + queryWrapper.lambda().eq(DataInterfaceEntity::getEnabledMark, pagination.getEnabledMark()); + } + // 关键字 + if (!StringUtil.isEmpty(pagination.getKeyword())) { + flag = true; + queryWrapper.lambda().and( + t -> t.like(DataInterfaceEntity::getFullName, pagination.getKeyword()) + .or().like(DataInterfaceEntity::getEnCode, pagination.getKeyword())); + } + // 是否分页 + if (pagination.getHasPage() != null && pagination.getHasPage() == 0) { + queryWrapper.lambda().eq(DataInterfaceEntity::getHasPage, pagination.getHasPage()); + } + if (isSelector == 1) { + queryWrapper.lambda().eq(DataInterfaceEntity::getIsPostPosition, 0); + if (ObjectUtil.isEmpty(pagination.getEnabledMark())) { + queryWrapper.lambda().eq(DataInterfaceEntity::getEnabledMark, 1); + } + } + // 分类 + queryWrapper.lambda().eq(DataInterfaceEntity::getCategory, pagination.getCategory()); + // 类型 + String type = pagination.getType(); + if (StringUtil.isNotEmpty(type)) { + if (type.contains(",")) { + List collect = Arrays.stream(type.split(",")).map(Integer::valueOf) + .collect(Collectors.toList()); + queryWrapper.lambda().in(DataInterfaceEntity::getType, collect); + } else { + queryWrapper.lambda().eq(DataInterfaceEntity::getType, Integer.valueOf(type)); + } + } + // 排序 + queryWrapper.lambda().orderByAsc(DataInterfaceEntity::getSortCode) + .orderByDesc(DataInterfaceEntity::getCreatorTime); + if (flag) { + queryWrapper.lambda().orderByDesc(DataInterfaceEntity::getLastModifyTime); + } + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage iPage = this.page(page, queryWrapper); + return pagination.setData(iPage.getRecords(), iPage.getTotal()); + } + + @Override + public List getList(PaginationDataInterfaceSelector pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (ObjectUtil.equal(pagination.getSourceType(), 1)) { + queryWrapper.lambda() + .and(t -> t.ne(DataInterfaceEntity::getType, 1).ne(DataInterfaceEntity::getHasPage, 1) + .ne(DataInterfaceEntity::getIsPostPosition, 1) + .or(tt -> tt.eq(DataInterfaceEntity::getType, 1).eq(DataInterfaceEntity::getAction, 3) + .ne(DataInterfaceEntity::getHasPage, 1) + .ne(DataInterfaceEntity::getIsPostPosition, 1))); + } else if (ObjectUtil.equal(pagination.getSourceType(), 2)) { + queryWrapper.lambda() + .and(t -> t.ne(DataInterfaceEntity::getType, 1).ne(DataInterfaceEntity::getIsPostPosition, 1) + .or(tt -> tt.eq(DataInterfaceEntity::getType, 1).eq(DataInterfaceEntity::getAction, 3) + .ne(DataInterfaceEntity::getIsPostPosition, 1))); + } else if (ObjectUtil.equal(pagination.getSourceType(), 3)) { + queryWrapper.lambda() + .and(t -> t.ne(DataInterfaceEntity::getType, 1).ne(DataInterfaceEntity::getHasPage, 1) + .ne(DataInterfaceEntity::getIsPostPosition, 1) + .or(tt -> tt.eq(DataInterfaceEntity::getType, 1).ne(DataInterfaceEntity::getAction, 3) + .ne(DataInterfaceEntity::getHasPage, 1) + .ne(DataInterfaceEntity::getIsPostPosition, 1))); + } + // 类型 + String type = pagination.getType(); + if (StringUtil.isNotEmpty(type)) { + if (type.contains(",")) { + List collect = Arrays.stream(type.split(",")).map(Integer::valueOf) + .collect(Collectors.toList()); + queryWrapper.lambda().in(DataInterfaceEntity::getType, collect); + } else { + queryWrapper.lambda().eq(DataInterfaceEntity::getType, Integer.valueOf(type)); + } + } + // 分类 + queryWrapper.lambda().eq(DataInterfaceEntity::getCategory, pagination.getCategory()); + queryWrapper.lambda().eq(DataInterfaceEntity::getEnabledMark, 1); + // 关键字查询 + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + queryWrapper.lambda().and(t -> { + t.like(DataInterfaceEntity::getFullName, pagination.getKeyword()).or(); + t.like(DataInterfaceEntity::getEnCode, pagination.getKeyword()); + }); + } + // 排序 + queryWrapper.lambda().orderByAsc(DataInterfaceEntity::getSortCode) + .orderByDesc(DataInterfaceEntity::getCreatorTime); + queryWrapper.lambda().orderByDesc(DataInterfaceEntity::getLastModifyTime); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage iPage = this.page(page, queryWrapper); + return pagination.setData(iPage.getRecords(), iPage.getTotal()); + } + + @Override + public List getList(boolean filterPage) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (filterPage) { + queryWrapper.lambda().ne(DataInterfaceEntity::getHasPage, 1); + } + queryWrapper.lambda().eq(DataInterfaceEntity::getEnabledMark, 1) + .orderByAsc(DataInterfaceEntity::getSortCode) + .orderByDesc(DataInterfaceEntity::getCreatorTime); + return baseMapper.selectList(queryWrapper); + } + + @Override + public DataInterfaceEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DataInterfaceEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(DataInterfaceEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + entity.setCreatorTime(DateUtil.getNowDate()); + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + this.setIgnoreLogicDelete().saveOrUpdate(entity); + this.clearIgnoreLogicDelete(); + } + + @Override + public boolean update(DataInterfaceEntity entity, String id) throws DataException { + entity.setId(id); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + entity.setLastModifyTime(DateUtil.getNowDate()); + return this.updateById(entity); + } + + @Override + public void delete(DataInterfaceEntity entity) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(DataInterfaceVariateEntity::getInterfaceId, entity.getId()); + dataInterfaceVariateService.remove(wrapper); + this.removeById(entity.getId()); + } + + @Override + public boolean isExistByFullNameOrEnCode(String id, String fullName, String enCode) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(fullName)) { + queryWrapper.lambda().eq(DataInterfaceEntity::getFullName, fullName); + } + if (StringUtil.isNotEmpty(enCode)) { + queryWrapper.lambda().eq(DataInterfaceEntity::getEnCode, enCode); + } + if (StringUtil.isNotEmpty(id)) { + queryWrapper.lambda().ne(DataInterfaceEntity::getId, id); + } + return this.count(queryWrapper) > 0; + } + + @Override + public ActionResult infoToIdPageList(String id, DataInterfacePage page) { + DataInterfaceEntity entity = this.getInfo(id); + if (entity == null) { + return ActionResult.page(new ArrayList<>(), JsonUtil.getJsonToBean(new Pagination(), PaginationVO.class)); + } + if (entity.getHasPage() == 1) { + Map map = null; + if (page.getParamList() != null) { + map = new HashMap<>(); + List jsonToList = JsonUtil.getJsonToList(page.getParamList(), + DataInterfaceModel.class); + this.paramSourceTypeReplaceValue(jsonToList, map); + // for (DataInterfaceModel dataInterfaceModel : jsonToList) { + // String defaultValue = dataInterfaceModel.getDefaultValue(); + // map.put(dataInterfaceModel.getField(), defaultValue); + // } + } + Pagination pagination = new Pagination(); + pagination.setPageSize(page.getPageSize()); + pagination.setCurrentPage(page.getCurrentPage()); + pagination.setKeyword(page.getKeyword()); + return infoToId(id, null, map, null, null, null, pagination, null); + } else { + String dataProcessing = null; + if (StringUtil.isNotEmpty(entity.getDataJsJson())) { + dataProcessing = entity.getDataJsJson(); + } + List> dataList = new ArrayList<>(); + int total = 0; + Map map = null; + if (page.getParamList() != null) { + map = new HashMap<>(); + List jsonToList = JsonUtil.getJsonToList(page.getParamList(), + DataInterfaceModel.class); + this.paramSourceTypeReplaceValue(jsonToList, map); + // for (DataInterfaceModel dataInterfaceModel : jsonToList) { + // String defaultValue = dataInterfaceModel.getDefaultValue(); + // map.put(dataInterfaceModel.getField(), defaultValue); + // } + } + ActionResult result = infoToId(id, null, map); + if (result.getData() != null) { + if (result.getData() instanceof List) { + dataList = (List>) result.getData(); + } + } + // if (StringUtil.isNotEmpty(page.getKeyword()) && + // StringUtil.isNotEmpty(page.getRelationField())) { + // dataList = dataList.stream().filter(t -> + // String.valueOf(t.get(page.getRelationField())).contains(page.getKeyword())).collect(Collectors.toList()); + // } + PaginationVO pagination = new PaginationVO(); + page.setTotal(dataList.size()); + if (StringUtil.isNotEmpty(page.getKeyword()) && StringUtil.isNotEmpty(page.getColumnOptions())) { + String[] colOptions = page.getColumnOptions().split(","); + dataList = dataList.stream().filter(t -> { + boolean isFit = false; + for (String c : colOptions) { + if (String.valueOf(t.get(c)).contains(page.getKeyword())) { + isFit = true; + break; + } + } + return isFit; + }).collect(Collectors.toList()); + } + page.setTotal(dataList.size()); + dataList = PageUtil.getListPage((int) page.getCurrentPage(), (int) page.getPageSize(), dataList); + pagination = JsonUtil.getJsonToBean(page, PaginationVO.class); + return ActionResult.page(dataList, pagination, dataProcessing); + } + } + + @Override + public List> infoToInfo(String id, DataInterfacePage page) { + List> list = new ArrayList<>(); + Map map = null; + DataInterfaceEntity entity = this.getInfo(id); + if (entity == null) { + return new ArrayList<>(); + } + try { + if (entity.getHasPage() == 1) { + if (page.getParamList() != null) { + map = new HashMap<>(); + List jsonToList = JsonUtil.getJsonToList(page.getParamList(), + DataInterfaceModel.class); + this.paramSourceTypeReplaceValue(jsonToList, map); + // for (DataInterfaceModel dataInterfaceModel : jsonToList) { + // String defaultValue = dataInterfaceModel.getDefaultValue(); + // map.put(dataInterfaceModel.getField(), defaultValue); + // } + } + Map showMap = new HashMap<>(); + if (page.getIds() instanceof List) { + List ids = (List) page.getIds(); + Map finalMap = map; + ids.forEach(t -> { + showMap.put(page.getPropsValue(), t); + ActionResult result = infoToId(id, null, finalMap, null, null, null, null, showMap); + if (result.getData() instanceof Map) { + Map objectMap = (Map) result.getData(); + if (objectMap.size() > 0) { + List mapList = JsonUtil.getJsonToList(objectMap.get("list"), Map.class); + if (mapList != null && mapList.size() > 0) { + list.add(mapList.get(0)); + } else { + list.add(objectMap); + } + } + } else if (result.getData() instanceof List) { + List list1 = (List) result.getData(); + if (list1.size() > 0) { + list.add(list1.get(0)); + } + } else { + + } + }); + } + } else { + if (page.getIds() != null) { + Map dataMap = new HashMap<>(); + if (page.getParamList() != null) { + map = new HashMap<>(); + List jsonToList = JsonUtil.getJsonToList(page.getParamList(), + DataInterfaceModel.class); + this.paramSourceTypeReplaceValue(jsonToList, map); + // for (DataInterfaceModel dataInterfaceModel : jsonToList) { + // map.put(dataInterfaceModel.getField(), dataInterfaceModel.getDefaultValue()); + // } + } + ActionResult result = infoToId(id, null, map); + List> dataList = new ArrayList<>(); + if (result.getData() instanceof List) { + dataList = (List>) result.getData(); + List ids = (List) page.getIds(); + List> finalDataList = dataList; + ids.forEach(t -> { + list.add(finalDataList.stream().filter(data -> t.equals(data.get(page.getPropsValue()))) + .findFirst().orElse(new HashMap<>())); + }); + } + } + } + } catch (Exception e) { + e.printStackTrace(); + return list; + } + return list; + } + + @Override + public ActionResult infoToId(String id, String tenantId, Map map) { + return infoToId(id, tenantId, map, null, null, null, null, null); + } + + @Override + public ActionResult infoToId(String id, String tenantId, Map map, String token, String appId, + String invokType, Pagination pagination, Map showMap) { + DataInterfaceEntity entity = this.getInfo(id); + if (entity == null) { + return ActionResult.success(new ArrayList<>()); + } + // 开始调用的时间 + LocalDateTime dateTime = LocalDateTime.now(); + // 调用时间 + int invokWasteTime = 0; + // 有设置默认值的直接赋值 + replaceDefaultVale(entity.getParameterJson(), map); + // 验证参数必填或类型 + String checkRequestParams = checkRequestParams(entity.getParameterJson(), map, null); + if (StringUtil.isNotEmpty(checkRequestParams)) { + return ActionResult.fail(checkRequestParams); + } + Object callJs = null; + try { + + if (pagination == null) { + pagination = new Pagination(); + } + + // 数据配置 + String dataConfigJson = entity.getDataConfigJson(); + DataConfigJsonModel configJsonModel = JsonUtil.getJsonToBean(dataConfigJson, DataConfigJsonModel.class); + // 如果是静态数据 + if (entity.getType() == 2) { + String staticData = configJsonModel.getStaticData(); + Object object = callStaticData(staticData); + handlePostVariate(entity, object); + return ActionResult.success(object); + } else if (entity.getType() == 3) { + // HTTP调用或HTTPS调用 + JSONObject jsonObject = new JSONObject(); + if (showMap == null) { + if (entity.getHasPage() == 0) { + pagination = null; + } + // HTTP调用或HTTPS调用 + jsonObject = callHTTP(map, token, pagination, null, configJsonModel.getApiData()); + } else { + String echoJson = entity.getDataEchoJson(); + DataConfigJsonModel echoJsonModel = JsonUtil.getJsonToBean(echoJson, DataConfigJsonModel.class); + jsonObject = callHTTP(map, token, null, showMap, echoJsonModel.getApiData()); + } + if (Objects.nonNull(jsonObject) && "1".equals(jsonObject.get("errorCode"))) { + return ActionResult.fail(MsgCode.SYS121.get()); + } + // 判断返回参数长度和key是否跟内置的一致 + if (jsonObject == null) { + return ActionResult.fail(MsgCode.SYS122.get()); + } + handlePostVariate(entity, jsonObject); + Object js = JScriptUtil.callJs(entity.getDataExceptionJson(), + jsonObject.get("data") == null ? new ArrayList<>() : jsonObject.get("data")); + if ((js instanceof Boolean && !BooleanUtil.toBoolean(String.valueOf(js)))) { + // 继续执行接口 + if (showMap == null) { + // 处理变量 + handlerVariate(configJsonModel.getApiData()); + jsonObject = callHTTP(map, token, pagination, null, configJsonModel.getApiData()); + } else { + String echoJson = entity.getDataEchoJson(); + DataConfigJsonModel echoJsonModel = JsonUtil.getJsonToBean(echoJson, DataConfigJsonModel.class); + // 处理变量 + handlerVariate(echoJsonModel.getApiData()); + jsonObject = callHTTP(map, token, null, showMap, echoJsonModel.getApiData()); + } + } + if (isInternal(jsonObject)) { + callJs = JScriptUtil.callJs(entity.getDataJsJson(), + jsonObject.get("data") == null ? new ArrayList<>() : jsonObject.get("data")); + } else { + callJs = JScriptUtil.callJs(entity.getDataJsJson(), jsonObject); + } + } else if (entity.getType() == 1) { + UserInfo oldUser = null; + if (token != null) { + oldUser = UserProvider.getUser(); + UserInfo userInfo = UserProvider.getUser(token); + UserProvider.setLocalLoginUser(userInfo); + } + try { + if (showMap == null) { + List> sqlMapList = executeSql(entity, 0, map, pagination, null, + configJsonModel.getSqlData()); + handlePostVariate(entity, sqlMapList); + + if (entity.getHasPage() == 1) { + DataConfigJsonModel pageJsonModel = JsonUtil.getJsonToBean(entity.getDataConfigJson(), + DataConfigJsonModel.class); + List> maps = executeSql(entity, 1, map, pagination, null, + pageJsonModel.getSqlData()); + if (maps.get(0) != null) { + pagination.setTotal( + Long.parseLong(String.valueOf(maps.get(0).values().iterator().next()))); + } + + Map obj = new HashMap<>(); + obj.put("list", sqlMapList); + obj.put("pagination", JsonUtil.getJsonToBean(pagination, PaginationVO.class)); + callJs = JScriptUtil.callJs(entity.getDataJsJson(), obj); + return ActionResult.success(callJs); + } else { + callJs = JScriptUtil.callJs(entity.getDataJsJson(), + sqlMapList == null ? new ArrayList<>() : sqlMapList); + } + } else { + DataConfigJsonModel echoJsonModel = JsonUtil.getJsonToBean(entity.getDataEchoJson(), + DataConfigJsonModel.class); + List> sqlMapList = executeSql(entity, 2, map, pagination, showMap, + echoJsonModel.getSqlData()); + if (entity.getHasPage() == 1) { + DataConfigJsonModel pageJsonModel = JsonUtil.getJsonToBean(entity.getDataConfigJson(), + DataConfigJsonModel.class); + List> maps = executeSql(entity, 1, map, pagination, null, + pageJsonModel.getSqlData()); + if (maps.get(0) != null) { + pagination.setTotal( + Long.parseLong(String.valueOf(maps.get(0).values().iterator().next()))); + } + + Map obj = new HashMap<>(); + obj.put("list", sqlMapList); + obj.put("pagination", JsonUtil.getJsonToBean(pagination, PaginationVO.class)); + callJs = JScriptUtil.callJs(entity.getDataJsJson(), obj); + return ActionResult.success(callJs); + } else { + callJs = JScriptUtil.callJs(entity.getDataJsJson(), + sqlMapList == null || sqlMapList.size() == 0 ? new ArrayList<>() + : sqlMapList.get(0)); + + } + } + } finally { + if (oldUser != null) { + UserProvider.setLocalLoginUser(oldUser); + } + } + } + if (callJs instanceof Exception) { + return ActionResult.success(MsgCode.SYS123.get(((Exception) callJs).getMessage())); + } + return ActionResult.success(callJs); + } catch (Exception e) { + log.error("错误提示:" + e.getMessage()); + // 本地调试时打印出问题 + e.printStackTrace(); + return ActionResult.fail(MsgCode.SYS122.get()); + } finally { + // 调用时间 + invokWasteTime = invokTime(dateTime); + // 添加调用日志 + dataInterfaceLogService.create(id, invokWasteTime, appId, invokType); + } + } + + /** + * 预览时赋值变量 + * + * @param entity + * @param object + */ + private void handlePostVariate(DataInterfaceEntity entity, Object object) { + // 如果是鉴权的话,需要赋值value + if (entity.getIsPostPosition() == 1) { + List list = dataInterfaceVariateService.getList(entity.getId(), null); + list.forEach(t -> { + try { + Object o; + if (object instanceof JSONObject && isInternal((JSONObject) object)) { + o = JScriptUtil.callJs(t.getExpression(), ((JSONObject) object).get("data")); + } else { + o = JScriptUtil.callJs(t.getExpression(), object); + } + if (o != null) { + t.setValue(o.toString()); + dataInterfaceVariateService.update(t); + } + } catch (ScriptException e) { + + } + }); + } + } + + @Override + public List getList(List ids) { + if (ids.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(DataInterfaceEntity::getId, ids); + return this.list(queryWrapper); + } + + /** + * 处理静态数据 + * + * @param staticData + * @return + */ + private Object callStaticData(String staticData) { + Object obj; + try { + Object parse = JSON.parse(staticData); + if (parse instanceof JSONArray) { + obj = JsonUtil.getJsonToListMap(staticData); + } else { + obj = JsonUtil.stringToMap(staticData); + } + } catch (Exception e) { + obj = staticData; + } + if (ObjectUtils.isEmpty(obj)) { + return new ArrayList<>(); + } + return obj; + } + + /** + * 有设置默认值的直接赋值 + * + * @param parameterJson + * @param map + */ + private void replaceDefaultVale(String parameterJson, Map map) { + List dataInterfaceModelList = JsonUtil.getJsonToList(parameterJson, + DataInterfaceModel.class); + if (ObjectUtils.isNotEmpty(dataInterfaceModelList)) { + if (map == null) { + map = new HashMap<>(16); + } + for (DataInterfaceModel dataInterfaceModel : dataInterfaceModelList) { + String field = dataInterfaceModel.getField(); + String defaultValue = dataInterfaceModel.getDefaultValue(); + String dataType = dataInterfaceModel.getDataType(); + if (!map.containsKey(field) || StringUtil.isEmpty(map.get(field))) { + map.put(field, defaultValue == null ? "" : defaultValue); + } + // if (dataType.equals("int") && StringUtil.isEmpty(map.get(field))) { + // map.put(field, "0"); + // } + } + } + } + + /** + * 判断是不是内部接口 + * + * @param jsonObject + * @return + */ + private boolean isInternal(JSONObject jsonObject) { + if (jsonObject != null) { + if (jsonObject.size() == 3 && jsonObject.get("code") != null && jsonObject.get("msg") != null + && jsonObject.get("data") != null) { + return true; + } + } + return false; + } + + /** + * 检查参数是够必填或类型是否正确 + * + * @param parameterJson + * @param map + * @param sql 预留参数 + */ + private String checkRequestParams(String parameterJson, Map map, String sql) { + if (map == null || StringUtil.isEmpty(parameterJson)) { + return ""; + } + StringBuilder message = new StringBuilder(); + List dataInterfaceModelList = JsonUtil.getJsonToList(parameterJson, + DataInterfaceModel.class); + dataInterfaceModelList.stream().anyMatch(model -> { + // 验证是否必填 + if (model.getRequired() == 1) { + String value = map.get(model.getField()); + if (StringUtil.isEmpty(value)) { + message.append(model.getField()).append("不能为空"); + } + } + if (message.length() == 0) { + // 验证类型 + if (model.getDataType() != null) { + String value = map.get(model.getField()); + // 判断是整形 + if (StringUtil.isNotEmpty(value) && "int".equals(model.getDataType())) { + try { + Integer.parseInt(value); + } catch (Exception e) { + message.append(model.getField()).append("类型必须为整型"); + } + } else if (StringUtil.isNotEmpty(value) && "datetime".equals(model.getDataType())) { + try { + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + map.put(model.getField(), DateUtil.dateFormat(formatter.parse(value))); + } catch (Exception e) { + try { + map.put(model.getField(), DateUtil.dateFormat(new Date(Long.valueOf(value)))); + } catch (Exception ex) { + message.append(model.getField() + "类型必须为日期时间型"); + } + } + } else if (StringUtil.isNotEmpty(value) && "decimal".equals(model.getDataType())) { + try { + Double.valueOf(value); + } catch (Exception e) { + message.append(model.getField()).append("类型必须为浮点型"); + } + } + } + } + return message.length() > 0; + }); + return message.toString(); + } + + @Override + public ActionResult infoToIdNew(String id, String tenantId, DataInterfaceActionModel model) { + // 鉴权验证 + // 获取token + String authorSignature = ServletUtil.getRequest().getHeader(Constants.AUTHORIZATION); + String[] authorSignatureArr = authorSignature.split(":"); + if (authorSignatureArr.length != 3) { + return ActionResult.fail(ActionResultCode.ValidateError.getMessage()); + } + String appId = authorSignatureArr[0]; + String author = authorSignatureArr[2]; + Map map = model.getMap(); + String interfaceUserToken = null; + InterfaceOauthEntity infoByAppId = interfaceOauthService.getInfoByAppId(appId); + // 未提供app相关,接口认证失效,接口不在授权列表时无权访问 + if (infoByAppId == null || infoByAppId.getEnabledMark() == 0 + || !infoByAppId.getDataInterfaceIds().contains(id)) { + return ActionResult.fail(MsgCode.FA021.get()); + } + if (infoByAppId.getVerifySignature() == 1) {// 验证开启 + try { + // 验证请求有效期1分钟内 + String ymdateStr = ServletUtil.getRequest().getHeader(InterfaceUtil.YMDATE); + Date ymdate = new Date(Long.parseLong(ymdateStr)); + Date time = DateUtil.dateAddMinutes(ymdate, 1); + if (DateUtil.getNowDate().after(time)) { + return ActionResult.fail(MsgCode.SYS124.get()); + } + // 验证签名有效性 + boolean flag = InterfaceUtil.verifySignature(infoByAppId.getAppSecret(), author); + if (!flag) { + return ActionResult.fail(ActionResultCode.ValidateError.getMessage()); + } + } catch (Exception e) { + e.printStackTrace(); + return ActionResult.fail(ActionResultCode.ValidateError.getMessage()); + } + } else {// 验证未开启,直接使用秘钥进行验证 + if (!infoByAppId.getAppSecret().equals(author)) { + return ActionResult.fail(MsgCode.SYS125.get()); + } + } + // 验证使用期限 + Date usefulLife = infoByAppId.getUsefulLife(); + if (infoByAppId.getUsefulLife() != null && usefulLife.before(DateUtil.getNowDate())) {// 空值无限期 + return ActionResult.fail(MsgCode.SYS126.get()); + } + try { + // 用户秘钥获取token + interfaceUserToken = dataInterfaceUserService.getInterfaceUserToken(model.getTenantId(), + infoByAppId.getId(), ServletUtil.getRequest().getHeader(InterfaceUtil.USERKEY)); + } catch (Exception e) { + return ActionResult.fail(e.getMessage()); + } + // 黑白名单验证 + String ipwhiteList = StringUtil.isNotEmpty(infoByAppId.getWhiteList()) ? infoByAppId.getWhiteList() : "";// ip白名单 + String ipwhiteBlackList = StringUtil.isNotEmpty(infoByAppId.getBlackList()) ? infoByAppId.getBlackList() : "";// ip黑名单 + String ipAddr = IpUtil.getIpAddr(); + if (StringUtil.isNotEmpty(ipwhiteList) && !ipwhiteList.contains(ipAddr)) {// 不属于白名单 + return ActionResult.fail(MsgCode.LOG010.get()); + } + // if (StringUtil.isNotEmpty(ipwhiteBlackList) && + // ipwhiteBlackList.contains(ipAddr)) {//属于黑名单 + // return ActionResult.fail(ActionResultCode.ValidateError.getMessage()); + // } + // 以下调用接口 + return infoToId(id, null, map, interfaceUserToken, infoByAppId.getAppId(), model.getInvokType(), null, null); + } + + @Override + public DataInterfaceActionModel checkParams(Map map) { + String ymDate = ServletUtil.getRequest().getHeader(InterfaceUtil.YMDATE); + String authorSignature = ServletUtil.getRequest().getHeader(Constants.AUTHORIZATION); + if (StringUtils.isEmpty(ymDate)) { + throw new RuntimeException("header参数:YmDate未传值"); + } + if (StringUtils.isEmpty(authorSignature)) { + throw new RuntimeException("header参数:" + Constants.AUTHORIZATION + "未传值"); + } + DataInterfaceActionModel entity = new DataInterfaceActionModel(); + // 判断是否多租户,取参数tenantId + if (InterfaceUtil.checkParam(map, "tenantId")) { + entity.setTenantId(map.get("tenantId")); + } + String tenantId = SaHolder.getRequest().getParam("tenantId"); + if (StringUtil.isNotEmpty(tenantId)) { + entity.setTenantId(tenantId); + } + entity.setMap(map); + return entity; + } + + /** + * 执行SQL + * + * @param entity + * @param sqlType + * @param map + * @return + * @throws DataException + */ + private List> executeSql(DataInterfaceEntity entity, int sqlType, Map map, + Pagination pagination, Map showMap, + SqlDateModel sqlDateModel) throws Exception { + Map mapData = new HashMap<>(); + if (map != null) { + for (String key : map.keySet()) { + mapData.put(key, map.get(key)); + } + } + DataSourceUtil linkEntity = dblinkService.getInfo(sqlDateModel.getDbLinkId()); + String sql = sqlDateModel.getSql(); + if (entity.getHasPage() == 1) { + if (sqlType == 1) { + DataConfigJsonModel dataConfigJsonModel = JsonUtil.getJsonToBean(entity.getDataCountJson(), + DataConfigJsonModel.class); + if (dataConfigJsonModel != null) { + SqlDateModel countSqlDateModel = JsonUtil.getJsonToBean(dataConfigJsonModel.getSqlData(), + SqlDateModel.class); + sql = countSqlDateModel.getSql(); + } + } else if (sqlType == 2) { + DataConfigJsonModel dataConfigJsonModel = JsonUtil.getJsonToBean(entity.getDataEchoJson(), + DataConfigJsonModel.class); + if (dataConfigJsonModel != null) { + SqlDateModel countSqlDateModel = JsonUtil.getJsonToBean(dataConfigJsonModel.getSqlData(), + SqlDateModel.class); + sql = countSqlDateModel.getSql(); + } + } + } + UserInfo userInfo = UserProvider.getUser(); + if (linkEntity == null) { + linkEntity = dataSourceUtils; + } + // 系统内置参数替换 + Map systemParameter = systemParameter(sql, userInfo, pagination, showMap); + // 自定义参数替换 + sql = customizationParameter(entity.getParameterJson(), sql, mapData, systemParameter); + + // 处理SQL + List values = new ArrayList<>(systemParameter.size()); + // 参数替换为占位符 + sql = getHandleArraysSql(sql, values, systemParameter); + if (showMap != null) { + sql = sql.replace(DataInterfaceVarConst.SHOWKEY, showMap.keySet().iterator().next()); + } + + // 封装sql---视图查询 -重新封装sql + if (StringUtil.isNotEmpty(sql) && Objects.nonNull(map) + && StringUtil.isNotEmpty(map.get("searchSqlStr")) && Objects.equals(entity.getAction(), 3)) { + if (sql.trim().endsWith(";")) { + sql = sql.trim(); + sql = sql.substring(0, sql.length() - 1); + } + sql = "select * from (" + sql + ") t where " + map.get("searchSqlStr"); + } + // 封装sql结束--- + + log.info("当前执行SQL:" + sql); + if (entity.getHasPage() == 1 && (sql.contains(";") && sql.trim().indexOf(";") != sql.trim().length() - 1)) { + return null; + } + if (entity.getAction() != null && entity.getAction() != 3) { + JdbcUtil.creUpDe(new PrepSqlDTO(sql, values).withConn(linkEntity, null)); + return null; + } + String objectToString = JsonUtil.getObjectToStringAsDate( + JdbcUtil.queryList(new PrepSqlDTO(sql, values).withConn(linkEntity, null)).setIsAlias(true).get()); + return JsonUtil.getJsonToListMap(objectToString); + } + + /** + * 自定义参数替换 + * + * @param parameterJson 参数配置 + * @param sql sql + * @param map 参数 + * @param systemParameter 参数集合 + */ + @Override + public String customizationParameter(String parameterJson, String sql, Map map, + Map systemParameter) { + List dataInterfaceModelList = StringUtil.isNotEmpty(parameterJson) + ? JsonUtil.getJsonToList(parameterJson, DataInterfaceModel.class) + : new ArrayList<>(); + if (StringUtil.isNotEmpty(sql) && Objects.nonNull(map)) { + Map placeholderMap = new HashMap<>(); + for (String key : map.keySet()) { + // 验证参数key对比 + Object tmpValue = map.get(key); + if (tmpValue != null) { + // 参数前方 上个参数后方的语句中是否有 in + String sqlarr1 = sql.split("\\{" + key + "\\}")[0]; + String[] sqlarr2 = sqlarr1.split("\\}"); + String sql1 = sqlarr2.length > 1 ? sqlarr2[sqlarr2.length - 1] : sqlarr2[0]; + boolean isInSql = sql1.toLowerCase().contains(" in "); + List valueList = new ArrayList<>(); + if (isInSql) { + valueList = Arrays.asList(String.valueOf(tmpValue).split(",")); + } else { + valueList.add(tmpValue); + } + String placeholder = "?"; + for (int i = 1; i < valueList.size(); i++) { + placeholder += ",?"; + } + String finalSql = sql; + valueList.forEach(t -> { + Object b = t; + for (DataInterfaceModel model : dataInterfaceModelList) { + if (model.getField().equals(key) && model.getDataType() != null) { + // 判断是整形 + if ("int".equals(model.getDataType())) { + b = ObjectUtil.isNull(t) ? null : Integer.parseInt(String.valueOf(t)); + } else if ("decimal".equals(model.getDataType())) { + b = ObjectUtil.isNull(t) ? null : Double.valueOf(String.valueOf(t)); + } else if ("datetime".equals(model.getDataType()) && ObjectUtil.isNull(t)) { + b = null; + } + } + } + DataInterfaceParamUtil.getParamModel(systemParameter, finalSql, "{" + key + "}", b); + }); + placeholderMap.put(key, placeholder); + } else { + DataInterfaceParamUtil.getParamModel(systemParameter, sql, "{" + key + "}", null); + placeholderMap.put(key, "?"); + } + } + for (String key : placeholderMap.keySet()) { + sql = sql.replaceAll("\\{" + key + "}", placeholderMap.get(key)); + } + } + return sql; + } + + /** + * 参数替换为占位符 + * + * @param sql + * @param values + * @param systemParameter + * @return + */ + public String getHandleArraysSql(String sql, List values, + Map systemParameter) { + if (StringUtil.isNotEmpty(sql)) { + for (Double aDouble : systemParameter.keySet()) { + Object value = systemParameter.get(aDouble).getValue(); + values.add(value); + } + for (Double aDouble : systemParameter.keySet()) { + DataInterfaceMarkModel dataInterfaceMarkModel = systemParameter.get(aDouble); + if (DataInterfaceVarConst.ORGANDSUB.equals(dataInterfaceMarkModel.getMarkName())) { + if (dataInterfaceMarkModel.getValue() instanceof List) { + List list = (List) dataInterfaceMarkModel.getValue(); + String placeholder = "?"; + int index = 0; + boolean addOrSet = false; + for (Object obj : list) { + if (!addOrSet) { + // 得到下标 + int i = values.indexOf(dataInterfaceMarkModel.getValue()); + values.set(i, obj); + addOrSet = true; + index = i++; + } else { + placeholder += ",?"; + values.add(index, obj); + } + } + sql = sql.replaceAll(DataInterfaceVarConst.ORGANDSUB, placeholder); + } + } + if (DataInterfaceVarConst.USERANDSUB.equals(dataInterfaceMarkModel.getMarkName())) { + if (dataInterfaceMarkModel.getValue() instanceof List) { + List list = (List) dataInterfaceMarkModel.getValue(); + String placeholder = "?"; + int index = 0; + boolean addOrSet = false; + for (Object obj : list) { + if (!addOrSet) { + // 得到下标 + int i = values.indexOf(dataInterfaceMarkModel.getValue()); + values.set(i, obj); + addOrSet = true; + index = i++; + } else { + placeholder += ",?"; + values.add(index, obj); + } + } + sql = sql.replaceAll(DataInterfaceVarConst.USERANDSUB, placeholder); + } + } + if (DataInterfaceVarConst.CHARORG.equals(dataInterfaceMarkModel.getMarkName())) { + if (dataInterfaceMarkModel.getValue() instanceof List) { + List list = (List) dataInterfaceMarkModel.getValue(); + String placeholder = "?"; + int index = 0; + boolean addOrSet = false; + for (Object obj : list) { + if (!addOrSet) { + // 得到下标 + int i = values.indexOf(dataInterfaceMarkModel.getValue()); + values.set(i, obj); + addOrSet = true; + index = i++; + } else { + placeholder += ",?"; + values.add(index, obj); + } + } + sql = sql.replaceAll(DataInterfaceVarConst.CHARORG, placeholder); + } + } + } + sql = sql.replaceAll(DataInterfaceVarConst.USER, "?"); + sql = sql.replaceAll(DataInterfaceVarConst.ORG, "?"); + sql = sql.replaceAll(DataInterfaceVarConst.KEYWORD, "?"); + sql = sql.replaceAll(DataInterfaceVarConst.OFFSETSIZE, "?"); + sql = sql.replaceAll(DataInterfaceVarConst.PAGESIZE, "?"); + // sql = sql.replaceAll(DataInterfaceVarEnum.SHOWKEY, "?"); + sql = sql.replaceAll(DataInterfaceVarConst.SHOWVALUE, "?"); + sql = sql.replaceAll(DataInterfaceVarConst.ID, "?"); + sql = sql.replaceAll(DataInterfaceVarConst.ID_LOT, "?"); + sql = sql.replaceAll(DataInterfaceVarConst.FORM_ID, "?"); + } + return sql; + } + + /** + * HTTP调用 + * + * @return get + */ + private JSONObject callHTTP(Map map, + String token, Pagination pagination, Map showMap, + ApiDateModel apiDateModel) throws UnsupportedEncodingException { + JSONObject get = new JSONObject(); + String path = apiDateModel.getUrl(); + // 请求方法 + String requestMethod = apiDateModel.getMethod() == 1 ? "GET" : "POST"; + // 获取请求头参数 + List header = apiDateModel.getHeader(); + // 自定义参数 + List query = apiDateModel.getQuery(); + String body = apiDateModel.getBody(); + int bodyType = apiDateModel.getBodyType() == 1 ? 0 + : apiDateModel.getBodyType() == null ? 0 : apiDateModel.getBodyType(); + // Post请求拼接参数 + JSONObject jsonObject = null; + List jsonObjects1 = null; + // 判断是否为http或https + if (StringUtil.isNotEmpty(path) && path.startsWith("/")) { + path = configValueUtil.getApiDomain() + path; + if (StringUtil.isEmpty(token)) { + token = UserProvider.getUser().getToken(); + } + } else { + token = null; + } + if (path.startsWith("http")) { + String showKey = null; + Object showValue = null; + if (showMap != null) { + if (showMap.size() > 0) { + showKey = showMap.keySet().iterator().next(); + showValue = showMap.values().iterator().next(); + } + } + // 替换url上的回显参数 + path = path.replace("{" + DataInterfaceVarConst.SHOWKEY.replaceAll("@", "") + "}", + showKey != null ? showKey : ""); + path = path.replace("{" + DataInterfaceVarConst.SHOWVALUE.replaceAll("@", "") + "}", + showValue != null ? URLEncoder.encode(String.valueOf(showValue), "UTF-8") : ""); + // 请求参数解析 + if (query != null) { + // 判断是否为get,get从url上拼接 + path += !path.contains("?") ? "?" : "&"; + for (HeadModel headModel : query) { + if ("1".equals(headModel.getSource())) { + String value = map == null || StringUtil.isEmpty(headModel.getDefaultValue()) + || StringUtil.isEmpty(map.get(headModel.getDefaultValue())) + ? "" + : map.get(headModel.getDefaultValue()); + path += headModel.getField() + "=" + URLEncoder.encode(value, "UTF-8") + "&"; + } + if ("2".equals(headModel.getSource())) { + DataInterfaceVariateEntity variateEntity = dataInterfaceVariateService + .getInfo(headModel.getDefaultValue()); + path += headModel.getField() + "=" + variateEntity.getValue() + "&"; + } + if ("3".equals(headModel.getSource())) { + path += headModel.getField() + "=" + URLEncoder.encode( + StringUtil.isNotEmpty(headModel.getDefaultValue()) ? headModel.getDefaultValue() : "" + // .replaceAll("'", "") + , "UTF-8") + "&"; + } + // 分页参数 + if ("4".equals(headModel.getSource())) { + Map map1 = JsonUtil.entityToMap(pagination); + + Object urlValue = map1.get(headModel.getDefaultValue()); + if (urlValue instanceof String && ObjectUtil.isNotNull(urlValue)) { + path += headModel.getField() + "=" + URLEncoder.encode(String.valueOf(urlValue), "UTF-8") + + "&"; + } else { + path += headModel.getField() + "=" + urlValue + "&"; + } + } + // 回显参数 + if ("5".equals(headModel.getSource())) { + if (DataInterfaceVarConst.SHOWKEY.equals(headModel.getDefaultValue())) { + if (showKey != null) { + path += headModel.getField() + "=" + URLEncoder.encode(showKey, "UTF-8") + "&"; + } + } else { + if (showValue != null) { + path += headModel.getField() + "=" + + URLEncoder.encode(String.valueOf(showValue), "UTF-8") + "&"; + } else { + path += headModel.getField() + "&"; + } + } + } + } + } + + String jsonObjects = ""; + if (bodyType == 1 || bodyType == 2) { + StringJoiner bodyParam = new StringJoiner("&"); + List bodyJson = JsonUtil.getJsonToList(body, HeadModel.class); + for (HeadModel headModel : bodyJson) { + if ("1".equals(headModel.getSource())) { + String value = map == null || StringUtil.isEmpty(headModel.getDefaultValue()) + || StringUtil.isEmpty(map.get(headModel.getDefaultValue())) + ? "" + : map.get(headModel.getDefaultValue()); + bodyParam.add(headModel.getField() + "=" + URLEncoder.encode(value, "UTF-8")); + } + if ("2".equals(headModel.getSource())) { + DataInterfaceVariateEntity variateEntity = dataInterfaceVariateService + .getInfo(headModel.getDefaultValue()); + bodyParam.add(headModel.getField() + "=" + variateEntity.getValue()); + } + if ("3".equals(headModel.getSource())) { + bodyParam.add(headModel.getField() + "=" + headModel.getDefaultValue()); + } + } + jsonObjects += bodyParam.toString(); + } else if (bodyType == 3 || bodyType == 4) { + // 优先替换变量 + Pattern compile = Pattern.compile("\\{@\\w+}"); + Matcher matcher = compile.matcher(body); + while (matcher.find()) { + // 得到参数 + String group = matcher.group(); + String variate = group.replace("{", "").replace("}", "").replace("@", ""); + DataInterfaceVariateEntity dataInterfaceVariateEntity = dataInterfaceVariateService + .getInfoByFullName(variate); + if (dataInterfaceVariateEntity != null) { + body = body.replace(group, dataInterfaceVariateEntity.getValue()); + } + } + Pattern compile1 = Pattern.compile("\\{\\w+}"); + Matcher matcher1 = compile1.matcher(body); + while (matcher1.find()) { + // 得到参数 + String group = matcher1.group(); + String param = group.replace("{", "").replace("}", ""); + String value = map != null ? map.get(param) : null; + if (pagination != null && DataInterfaceVarConst.KEYWORD.equals("@" + param)) { + value = pagination.getKeyword(); + } + if (pagination != null && DataInterfaceVarConst.CURRENTPAGE.equals("@" + param)) { + value = pagination.getCurrentPage() + ""; + } + if (pagination != null && DataInterfaceVarConst.PAGESIZE.equals("@" + param)) { + value = pagination.getPageSize() + ""; + } + body = body.replace(group, value); + } + jsonObjects = body; + } + + if (jsonObject == null && jsonObjects1 != null) { + jsonObjects = jsonObjects1.toString(); + } else { + jsonObjects = StringUtil.isEmpty(jsonObjects) + ? jsonObject != null && jsonObject.size() > 0 ? jsonObject.toJSONString() : null + : jsonObjects; + } + if (apiDateModel.getMethod() == 1) { + jsonObjects = ""; + } + JSONObject headerJson = new JSONObject(); + // 请求头 + for (HeadModel headModel : header) { + if ("1".equals(headModel.getSource())) { + if (map != null && map.containsKey(headModel.getDefaultValue())) { + String value = map.get(headModel.getDefaultValue()); + headerJson.put(headModel.getField(), value + // .replaceAll("'", "") + ); + } else { + headerJson.put(headModel.getField(), map.get(headModel.getDefaultValue())); + } + } + if ("2".equals(headModel.getSource())) { + DataInterfaceVariateEntity variateEntity = dataInterfaceVariateService + .getInfo(headModel.getDefaultValue()); + headerJson.put(headModel.getField(), variateEntity.getValue()); + } + if ("3".equals(headModel.getSource())) { + headerJson.put(headModel.getField(), headModel.getDefaultValue()); + } + // 分页参数 + if ("4".equals(headModel.getSource())) { + Map map1 = JsonUtil.entityToMap(pagination); + + Object urlValue = map1.get(headModel.getDefaultValue()); + headerJson.put(headModel.getField(), urlValue); + } + // 回显参数 + if ("5".equals(headModel.getSource())) { + if (DataInterfaceVarConst.SHOWKEY.equals(headModel.getDefaultValue())) { + headerJson.put(headModel.getField(), showKey); + } else { + headerJson.put(headModel.getField(), showValue); + } + } + } + get = HttpUtil.httpRequest(path, requestMethod, jsonObjects, token, + headerJson.size() > 0 ? JsonUtil.getObjectToString(headerJson) : null, String.valueOf(bodyType)); + return get; + } else { + get.put("errorCode", "1"); + return get; + } + } + + /** + * 处理变量 + * + * @param apiDateModel + */ + public void handlerVariate(ApiDateModel apiDateModel) { + Set variate = new HashSet<>(); + // 获取请求头参数 + List header = apiDateModel.getHeader(); + header.forEach(headModel -> { + if ("2".equals(headModel.getSource())) { + variate.add(headModel.getDefaultValue()); + } + }); + // 自定义参数 + List query = apiDateModel.getQuery(); + query.forEach(headModel -> { + if ("2".equals(headModel.getSource())) { + variate.add(headModel.getDefaultValue()); + } + }); + if (ObjectUtil.equal(apiDateModel.getBodyType(), 1) || ObjectUtil.equal(apiDateModel.getBodyType(), 2)) { + List bodyJson = JsonUtil.getJsonToList(apiDateModel.getBody(), HeadModel.class); + if (bodyJson != null) { + bodyJson.forEach(headModel -> { + if ("2".equals(headModel.getSource())) { + variate.add(headModel.getDefaultValue()); + } + }); + } + } + List variateEntities = dataInterfaceVariateService + .getListByIds(new ArrayList<>(variate)); + List collect = variateEntities.stream().map(DataInterfaceVariateEntity::getInterfaceId).distinct() + .collect(Collectors.toList()); + List list = this.getList(collect); + Map results = new HashMap<>(); + Map updates = new HashMap<>(); + list.forEach(t -> { + try { + DataConfigJsonModel dataConfigJsonModel = JsonUtil.getJsonToBean(t.getDataConfigJson(), + DataConfigJsonModel.class); + JSONObject jsonObject = callHTTP(null, UserProvider.getToken(), new Pagination(), null, + JsonUtil.getJsonToBean(dataConfigJsonModel.getApiData(), ApiDateModel.class)); + if (Objects.nonNull(jsonObject) && "1".equals(jsonObject.get("errorCode"))) { + log.error("接口暂只支持HTTP和HTTPS方式"); + return; + } + // 判断返回参数长度和key是否跟内置的一致 + if (jsonObject == null) { + log.error("接口请求失败"); + return; + } + if (isInternal(jsonObject)) { + results.put(t.getId(), JScriptUtil.callJs(t.getDataJsJson(), + jsonObject.get("data") == null ? new ArrayList<>() : jsonObject.get("data"))); + } else { + results.put(t.getId(), JScriptUtil.callJs(t.getDataJsJson(), jsonObject)); + } + } catch (Exception e) { + e.printStackTrace(); + } + }); + variateEntities.forEach(t -> { + if (results.containsKey(t.getInterfaceId())) { + try { + updates.put(t.getId(), + String.valueOf(JScriptUtil.callJs(t.getExpression(), results.get(t.getInterfaceId())))); + } catch (ScriptException e) { + throw new RuntimeException(e); + } + } + }); + dataInterfaceVariateService.update(updates, variateEntities); + } + + /** + * 处理系统参数 + * + * @param sql + * @return + */ + private Map systemParameter(String sql, UserInfo userInfo, Pagination pagination, + Map showMap) { + Map paramValue = new TreeMap<>(); + paramValue.putAll(systemParameterOne(sql, userInfo)); + // 关键字 + if (sql.contains(DataInterfaceVarConst.KEYWORD)) { + DataInterfaceParamUtil.getParamModel(paramValue, sql, DataInterfaceVarConst.KEYWORD, + pagination.getKeyword()); + } + // 当前页数 + if (sql.contains(DataInterfaceVarConst.OFFSETSIZE)) { + DataInterfaceParamUtil.getParamModel(paramValue, sql, DataInterfaceVarConst.OFFSETSIZE, + pagination.getPageSize() * (pagination.getCurrentPage() - 1)); + } + // 每页行数 + if (sql.contains(DataInterfaceVarConst.PAGESIZE)) { + DataInterfaceParamUtil.getParamModel(paramValue, sql, DataInterfaceVarConst.PAGESIZE, + pagination.getPageSize()); + } + // 每页行数 + if (sql.contains(DataInterfaceVarConst.SHOWVALUE)) { + DataInterfaceParamUtil.getParamModel(paramValue, sql, DataInterfaceVarConst.SHOWVALUE, + showMap.values().iterator().next()); + } + return paramValue; + } + + /** + * 处理系统参数 + * + * @param sql + * @param userInfo + * @return + */ + public Map systemParameterOne(String sql, UserInfo userInfo) { + Map paramValue = new TreeMap<>(); + if (sql.contains(DataInterfaceVarConst.ID_LOT)) { + DataInterfaceParamUtil.getParamModel(paramValue, sql, DataInterfaceVarConst.ID_LOT, null); + } + // 生成雪花id + if (sql.contains(DataInterfaceVarConst.ID)) { + DataInterfaceParamUtil.getParamModel(paramValue, sql, DataInterfaceVarConst.ID, RandomUtil.uuId()); + } + // 当前用户 + if (hasCurrentUser(sql)) { + String userId = userInfo.getUserId(); + DataInterfaceParamUtil.getParamModel(paramValue, sql, DataInterfaceVarConst.USER, userId); + } + // 当前用户及下属 + if (sql.contains(DataInterfaceVarConst.USERANDSUB)) { + List subOrganizeIds = new ArrayList<>(); + if (userInfo.getSubordinateIds().size() > 0) { + subOrganizeIds = userInfo.getSubordinateIds(); + } + subOrganizeIds.add(userInfo.getUserId()); + DataInterfaceParamUtil.getParamModel(paramValue, sql, DataInterfaceVarConst.USERANDSUB, subOrganizeIds); + } + // 当前组织 + if (sql.contains(DataInterfaceVarConst.ORG)) { + String orgId = userInfo.getOrganizeId(); + if (StringUtil.isNotEmpty(userInfo.getDepartmentId())) { + orgId = userInfo.getDepartmentId(); + } + DataInterfaceParamUtil.getParamModel(paramValue, sql, DataInterfaceVarConst.ORG, orgId); + } + // 当前组织及子组织 + if (sql.contains(DataInterfaceVarConst.ORGANDSUB)) { + String orgId = userInfo.getOrganizeId(); + if (StringUtil.isNotEmpty(userInfo.getDepartmentId())) { + orgId = userInfo.getDepartmentId(); + } + List underOrganizations = organizeApi.getUnderOrganizations(orgId, false); + underOrganizations.add(orgId); + DataInterfaceParamUtil.getParamModel(paramValue, sql, DataInterfaceVarConst.ORGANDSUB, underOrganizations); + } + // 当前分管组织 + if (sql.contains(DataInterfaceVarConst.CHARORG) && StringUtil.isNotEmpty(userInfo.getUserId())) { + List orgIds = organizeAdminTratorApi.getOrganizeUserList(YunzhupaasConst.CURRENT_ORG_SUB); + DataInterfaceParamUtil.getParamModel(paramValue, sql, DataInterfaceVarConst.CHARORG, orgIds); + } + return paramValue; + } + + /** + * 是否包含当前用户 + * (当前用户及下属key包含当前用户key,constains判断不准确) + * + * @param str + * @return + */ + public static boolean hasCurrentUser(String str) { + int index = 0; + int count = 0; + while ((index = str.indexOf(DataInterfaceVarConst.USERANDSUB, index)) != -1) { + count++; + index += DataInterfaceVarConst.USERANDSUB.length(); + } + int index2 = 0; + int count2 = 0; + while ((index2 = str.indexOf(DataInterfaceVarConst.USER, index2)) != -1) { + count2++; + index2 += DataInterfaceVarConst.USER.length(); + } + return count != count2; + } + + /** + * 计算执行时间 + * + * @param dateTime + * @return + */ + public int invokTime(LocalDateTime dateTime) { + // 调用时间 + int invokWasteTime = Integer + .valueOf((int) (System.currentTimeMillis() - dateTime.toInstant(ZoneOffset.of("+8")).toEpochMilli())); + return invokWasteTime; + } + + /** + * 按sourceType替换数据接口参数 + * + * @param listJson + * @param map + */ + @Override + public void paramSourceTypeReplaceValue(List listJson, Map map) { + + for (DataInterfaceModel item : listJson) { + if (item.getSourceType() != null) { + switch (item.getSourceType()) { + case 1:// 字段 + map.put(item.getField(), item.getDefaultValue()); + break; + case 2:// 自定义 + map.put(item.getField(), item.getRelationField()); + break; + case 3:// 为空 + map.put(item.getField(), ""); + break; + case 4:// 系统参数 + map.put(item.getField(), this.getSystemFieldValue(item)); + break; + default: + map.put(item.getField(), item.getDefaultValue()); + break; + } + } else { + map.put(item.getField(), item.getDefaultValue()); + } + } + } + + /** + * 获取系统参数值 + * + * @param templateJsonModel + * @return + */ + @Override + public String getSystemFieldValue(DataInterfaceModel templateJsonModel) { + String relationField = templateJsonModel.getRelationField(); + UserInfo userInfo = UserProvider.getUser(); + String dataValue; + if (AuthorizeConditionEnum.FORMID.getCondition().equals(relationField)) { + dataValue = String.valueOf(templateJsonModel.getDefaultValue()); + } else if (AuthorizeConditionEnum.USER.getCondition().equals(relationField)) { + dataValue = userInfo.getUserId(); + } else if (AuthorizeConditionEnum.USERANDUNDER.getCondition().equals(relationField)) { + List subOrganizeIds = new ArrayList<>(); + if (userInfo.getSubordinateIds().size() > 0) { + subOrganizeIds = userInfo.getSubordinateIds(); + } + subOrganizeIds.add(userInfo.getUserId()); + dataValue = subOrganizeIds.stream().collect(Collectors.joining(",")); + } else if (AuthorizeConditionEnum.ORGANIZE.getCondition().equals(relationField)) { + String orgId1 = userInfo.getOrganizeId(); + if (StringUtil.isNotEmpty(userInfo.getDepartmentId())) { + orgId1 = userInfo.getDepartmentId(); + } + dataValue = orgId1; + } else if (AuthorizeConditionEnum.ORGANIZEANDUNDER.getCondition().equals(relationField)) { + String orgId1 = userInfo.getOrganizeId(); + if (StringUtil.isNotEmpty(userInfo.getDepartmentId())) { + orgId1 = userInfo.getDepartmentId(); + } + List underOrganizations = organizeApi.getUnderOrganizations(orgId1, false); + underOrganizations.add(orgId1); + dataValue = underOrganizations.stream().collect(Collectors.joining(",")); + } else if (AuthorizeConditionEnum.BRANCHMANAGEORG.getCondition().equals(relationField)) { + List orgIds1 = organizeAdminTratorApi.getOrganizeUserList(YunzhupaasConst.CURRENT_ORG_SUB); + dataValue = orgIds1.stream().collect(Collectors.joining(",")); + } else { + dataValue = templateJsonModel.getDefaultValue(); + } + return dataValue; + } + +} diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/DataInterfaceUserServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/DataInterfaceUserServiceImpl.java new file mode 100644 index 0000000..9ecf1ed --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/DataInterfaceUserServiceImpl.java @@ -0,0 +1,87 @@ +package com.yunzhupaas.base.service.impl; + +import cn.hutool.core.collection.CollectionUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.entity.DataInterfaceUserEntity; +import com.yunzhupaas.base.mapper.DataInterfaceUserMapper; +import com.yunzhupaas.base.model.InterfaceOauth.InterfaceUserForm; +import com.yunzhupaas.base.service.DataInterfaceUserService; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * @author 云筑产品开发平台组 + * @version V3.4.7 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/9/20 9:22 + */ +@Service +@Slf4j +public class DataInterfaceUserServiceImpl extends SuperServiceImpl implements DataInterfaceUserService { + + @Autowired + protected AuthUtil authUtil; + + @Override + public void saveUserList(InterfaceUserForm interfaceUserForm) { + if (interfaceUserForm.getUserIds() != null) { + List userList = interfaceUserForm.getUserIds(); + List select = this.select(interfaceUserForm.getInterfaceIdentId()); + List dbList = select.stream().map(DataInterfaceUserEntity::getUserId).collect(Collectors.toList()); + + List saveList = userList.stream().filter(t -> !dbList.contains(t)).collect(Collectors.toList()); + List updateList = select.stream().filter(t -> userList.contains(t.getUserId())).collect(Collectors.toList()); + List deleteList = select.stream().filter(t -> !userList.contains(t.getUserId())).collect(Collectors.toList()); + + for (String userId : saveList) { + DataInterfaceUserEntity entity = new DataInterfaceUserEntity(); + entity.setId(RandomUtil.uuId()); + entity.setUserKey(RandomUtil.uuId().substring(2)); + entity.setOauthId(interfaceUserForm.getInterfaceIdentId()); + entity.setUserId(userId); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + entity.setCreatorTime(DateUtil.getNowDate()); + this.save(entity); + } + for (DataInterfaceUserEntity updateE : updateList) { + this.updateById(updateE); + } + for (DataInterfaceUserEntity deleteE : deleteList) { + this.removeById(deleteE.getId()); + } + } + } + + @Override + public List select(String oauthId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DataInterfaceUserEntity::getOauthId, oauthId); + return this.list(queryWrapper); + } + + @Override + public String getInterfaceUserToken(String tenantId, String oauthId, String userKey) { + List select = this.select(oauthId); + if (CollectionUtil.isEmpty(select)) { + return null; + } + if (StringUtil.isEmpty(userKey)) { + throw new RuntimeException("未填写UserKey,请确认"); + } + DataInterfaceUserEntity entity = select.stream().filter(item -> item.getUserKey().equals(userKey)).findFirst().orElse(null); + if (entity == null) { + throw new RuntimeException("UserKey不匹配,请填写正确的UserKey"); + } + + String token = authUtil.loginTempUser(entity.getUserId(), tenantId, true); + return token; + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/DataInterfaceVariateServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/DataInterfaceVariateServiceImpl.java new file mode 100644 index 0000000..3c16861 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/DataInterfaceVariateServiceImpl.java @@ -0,0 +1,97 @@ +package com.yunzhupaas.base.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.Page; +import com.yunzhupaas.base.entity.DataInterfaceVariateEntity; +import com.yunzhupaas.base.mapper.DataInterfaceVariateMapper; +import com.yunzhupaas.base.service.DataInterfaceVariateService; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.util.*; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +@Service +public class DataInterfaceVariateServiceImpl extends SuperServiceImpl implements DataInterfaceVariateService { + + @Override + public List getList(String id, Page page) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().orderByDesc(DataInterfaceVariateEntity::getCreatorTime); + if (StringUtil.isNotEmpty(id)) { + queryWrapper.lambda().eq(DataInterfaceVariateEntity::getInterfaceId, id); + } + if (page != null && StringUtil.isNotEmpty(page.getKeyword())) { + queryWrapper.lambda().like(DataInterfaceVariateEntity::getFullName, page.getKeyword()); +// queryWrapper.lambda().orderByDesc(DataInterfaceVariateEntity::getLastModifyTime); + } + return this.list(queryWrapper); + } + + @Override + public DataInterfaceVariateEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DataInterfaceVariateEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public boolean isExistByFullName(DataInterfaceVariateEntity entity) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(entity.getId())) { + queryWrapper.lambda().ne(DataInterfaceVariateEntity::getId, entity.getId()); + } + queryWrapper.lambda().eq(DataInterfaceVariateEntity::getFullName, entity.getFullName()); + return this.count(queryWrapper) > 0; + } + + @Override + public boolean create(DataInterfaceVariateEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(UserProvider.getLoginUserId()); + entity.setCreatorTime(DateUtil.getNowDate()); + return this.save(entity); + } + + @Override + public boolean update(DataInterfaceVariateEntity entity) { + return this.updateById(entity); + } + + @Override + public boolean delete(DataInterfaceVariateEntity entity) { + return this.removeById(entity); + } + + @Override + public List getListByIds(List ids) { + if (ids.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(DataInterfaceVariateEntity::getId, ids); + return this.list(queryWrapper); + } + + @Override + public boolean update(Map map, List variateEntities) { + if (map == null || map.size() == 0) { + return true; + } + variateEntities.forEach(t -> { + t.setValue(map.get(t.getId())); + }); + return this.updateBatchById(variateEntities); + } + + @Override + public DataInterfaceVariateEntity getInfoByFullName(String fullName) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DataInterfaceVariateEntity::getFullName, fullName); + return this.getOne(queryWrapper); + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/DataMapServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/DataMapServiceImpl.java new file mode 100644 index 0000000..017833b --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/DataMapServiceImpl.java @@ -0,0 +1,118 @@ +package com.yunzhupaas.base.service.impl; + + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.entity.VisualDataMapEntity; +import com.yunzhupaas.base.mapper.DataMapMapper; +import com.yunzhupaas.base.service.DataMapService; +import com.yunzhupaas.util.DateUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 大屏地图 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +@Service +public class DataMapServiceImpl extends SuperServiceImpl implements DataMapService { + + + + @Override + public List getList(Pagination pagination) { + // 定义变量判断是否需要使用修改时间倒序 + boolean flag = false; + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + flag = true; + queryWrapper.lambda().and( + t -> t.like(VisualDataMapEntity::getFullName, pagination.getKeyword()) + .or().like(VisualDataMapEntity::getEnCode, pagination.getKeyword()) + ); + } + //排序 + queryWrapper.lambda().orderByAsc(VisualDataMapEntity::getSortCode) + .orderByDesc(VisualDataMapEntity::getCreatorTime); + if (flag) { + queryWrapper.lambda().orderByDesc(VisualDataMapEntity::getLastModifyTime); + } + Page page = new Page(pagination.getCurrentPage(), pagination.getPageSize()); + IPage iPages = this.page(page, queryWrapper); + return pagination.setData(iPages.getRecords(), page.getTotal()); + } + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().orderByDesc(VisualDataMapEntity::getSortCode) + .orderByDesc(VisualDataMapEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public VisualDataMapEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualDataMapEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(VisualDataMapEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorTime(DateUtil.getNowDate()); + entity.setCreatorUser(UserProvider.getUser().getUserId()); + entity.setEnabledMark(1); + this.save(entity); + } + + @Override + public boolean update(String id, VisualDataMapEntity entity) { + entity.setId(id); + entity.setLastModifyTime(DateUtil.getNowDate()); + entity.setLastModifyUser(UserProvider.getUser().getUserId()); + return this.updateById(entity); + } + + @Override + public void delete(VisualDataMapEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + + @Override + public boolean isExistByFullName(String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualDataMapEntity::getFullName, fullName); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(VisualDataMapEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public boolean isExistByEnCode(String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualDataMapEntity::getEnCode, enCode); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(VisualDataMapEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/DataSetServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/DataSetServiceImpl.java new file mode 100644 index 0000000..9282dd3 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/DataSetServiceImpl.java @@ -0,0 +1,1182 @@ +package com.yunzhupaas.base.service.impl; + +import cn.hutool.core.date.LocalDateTimeUtil; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONArray; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.github.pagehelper.PageHelper; +import com.github.vertical_blank.sqlformatter.SqlFormatter; +import com.google.common.collect.ImmutableList; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.ActionResultCode; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.DataInterfaceEntity; +import com.yunzhupaas.base.entity.DataSetEntity; +import com.yunzhupaas.base.mapper.DataSetMapper; +import com.yunzhupaas.base.model.datainterface.*; +import com.yunzhupaas.base.model.dataset.*; +import com.yunzhupaas.base.service.DataInterfaceService; +import com.yunzhupaas.base.service.DataSetService; +import com.yunzhupaas.base.service.DbLinkService; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.base.util.DataInterfaceParamUtil; +import com.yunzhupaas.base.util.dataSet.DataSetConfigUtil; +import com.yunzhupaas.constant.*; +import com.yunzhupaas.database.model.dbfield.DbFieldModel; +import com.yunzhupaas.database.model.dbfield.JdbcColumnModel; +import com.yunzhupaas.database.model.dto.PrepSqlDTO; +import com.yunzhupaas.database.model.entity.DbLinkEntity; +import com.yunzhupaas.database.source.DbBase; +import com.yunzhupaas.database.sql.util.SqlFastUtil; +import com.yunzhupaas.database.util.ConnUtil; +import com.yunzhupaas.database.util.DbTypeUtil; +import com.yunzhupaas.database.util.DynamicDataSourceUtil; +import com.yunzhupaas.database.util.JdbcUtil; +import com.yunzhupaas.emnus.DsJoinTypeEnum; +import com.yunzhupaas.emnus.SearchMethodEnum; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.model.visualJson.FieLdsModel; +import com.yunzhupaas.model.visualJson.config.ConfigModel; +import com.yunzhupaas.permission.entity.OrganizeEntity; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.entity.UserRelationEntity; +import com.yunzhupaas.permission.service.OrganizeAdministratorService; +import com.yunzhupaas.permission.service.OrganizeService; +import com.yunzhupaas.permission.service.UserRelationService; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.treeutil.SumTree; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import lombok.Cleanup; +import lombok.SneakyThrows; +import oracle.sql.TIMESTAMP; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.ibatis.exceptions.PersistenceException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.io.Reader; +import java.math.BigDecimal; +import java.sql.Clob; +import java.sql.Connection; +import java.sql.SQLSyntaxErrorException; +import java.sql.Timestamp; +import java.time.LocalDateTime; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 数据集合 + * + * @author 云筑产品开发平台组 + * @version v5.0.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/5/6 14:07:11 + */ +@Service +public class DataSetServiceImpl extends SuperServiceImpl implements DataSetService { + + @Autowired + private OrganizeService organizeApi; + @Autowired + private UserService userApi; + @Autowired + private UserRelationService userRelationApi; + @Autowired + private OrganizeAdministratorService organizeAdminTratorApi; + @Autowired + private DbLinkService dbLinkService; + @Autowired + private DataInterfaceService dataInterfaceService; + + @Override + public List getList(DataSetPagination pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + queryWrapper.lambda().like(DataSetEntity::getFullName, pagination.getKeyword()); + } + if (StringUtil.isNotEmpty(pagination.getObjectType())) { + queryWrapper.lambda().eq(DataSetEntity::getObjectType, pagination.getObjectType()); + } + if (StringUtil.isNotEmpty(pagination.getObjectId())) { + queryWrapper.lambda().eq(DataSetEntity::getObjectId, pagination.getObjectId()); + } + queryWrapper.lambda().orderByAsc(DataSetEntity::getCreatorTime); + return list(queryWrapper); + } + + @Override + public void create(List listSet, String ObjectType, String ObjectId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DataSetEntity::getObjectType, ObjectType); + queryWrapper.lambda().eq(DataSetEntity::getObjectId, ObjectId); + List list = list(queryWrapper); + if (CollectionUtils.isNotEmpty(listSet)) { + List nameList = listSet.stream().map(DataSetForm::getFullName).distinct() + .collect(Collectors.toList()); + if (listSet.size() != nameList.size()) { + throw new DataException(MsgCode.SYS046.get()); + } + List collect = listSet.stream().map(DataSetForm::getId).collect(Collectors.toList()); + for (DataSetEntity entity : list) { + if (!collect.contains(entity.getId())) { + this.removeById(entity.getId()); + } + } + for (DataSetForm item : listSet) { + item.setObjectType(ObjectType); + item.setObjectId(ObjectId); + DataSetEntity entity = JsonUtil.getJsonToBean(item, DataSetEntity.class); + if (StringUtil.isNotEmpty(item.getId()) && this.getById(item.getId()) != null) { + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + entity.setLastModifyTime(new Date()); + } else { + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + entity.setCreatorTime(new Date()); + } + this.setIgnoreLogicDelete().removeById(entity.getId()); + this.setIgnoreLogicDelete().saveOrUpdate(entity); + this.clearIgnoreLogicDelete(); + } + } else { + this.remove(queryWrapper); + } + } + + @FunctionalInterface + private interface MultiConsumer { + void accept(T t, S s, U u); + } + + @Override + @DSTransactional + public SumTree getTabFieldStruct(DataSetEntity item) throws Exception { + // 配置式 + if (Objects.equals(item.getType(), 3)) { + return getInterfaceFields(item); + } + // 配置式 + if (Objects.equals(item.getType(), 2)) { + return getConfigureSQL(item); + } + // SQL语句 + TableTreeModel printTable = new TableTreeModel(); + if (StringUtil.isNotEmpty( + ParameterUtil.checkContainsSensitive(item.getDataConfigJson(), DbSensitiveConstant.PRINT_SENSITIVE))) { + throw new DataException(MsgCode.SYS047.get()); + } + MultiConsumer>, DbLinkEntity> consumer = (dataSetEntity, dataList, + dbLinkEntity) -> { + Set tableNameSet = new HashSet<>(); + String parentId = dataSetEntity.getId(); + String headTable = dataSetEntity.getFullName(); + printTable.setId(parentId); + printTable.setChildren(treeSetField(tableNameSet, dbLinkEntity, dataList.get(0), parentId)); + printTable.setFullName(headTable); + printTable.setParentId("struct"); + }; + sqlCommon(item, consumer, new HashMap<>(), true); + return printTable; + } + + public List> treeSetField(Set tableNameSet, DbLinkEntity dbLinkEntity, + List dbJdbcModelList, String parentId) { + List> list = new ArrayList<>(); + for (Map mapOne : getFieldMap(dbLinkEntity, dbJdbcModelList, tableNameSet)) { + TableTreeModel fieldModel = new TableTreeModel(); + fieldModel.setId(mapOne.get("field")); + fieldModel.setFullName(mapOne.get("fieldName")); + fieldModel.setLabel(mapOne.get("comment")); + fieldModel.setParentId(parentId); + list.add(fieldModel); + } + return list; + } + + private List> getFieldMap(DbLinkEntity dbLinkEntity, List dbJdbcModelList, + Set tableNameSet) { + List> mapList = new ArrayList<>(); + // JdbcTableModel tableComment = null; + Map> tableFiledsMap = new HashMap<>(); + if (CollectionUtils.isNotEmpty(dbJdbcModelList)) { + // 部分数据库,无法从元数据中查出表、字段注释,比如Oracle + // tableComment = PrintDevUtil.getColumnComment(dbLinkEntity, + // dbJdbcModelList.get(0).getTable()); + try { + for (JdbcColumnModel jdbcColumnModel : dbJdbcModelList) { + if (StringUtil.isNotBlank(jdbcColumnModel.getTable()) + && !tableFiledsMap.containsKey(jdbcColumnModel.getTable())) { + tableFiledsMap.put(jdbcColumnModel.getTable(), + SqlFastUtil.getFieldList(dbLinkEntity, jdbcColumnModel.getTable())); + } + } + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + for (JdbcColumnModel model : dbJdbcModelList) { + // 获取表名 + Map map = new HashMap<>(); + String tableInfo = model.getTable(); + String fieldInfo = model.getField(); + String comment = ""; + List dbFieldModels = tableFiledsMap.get(tableInfo); + if (CollectionUtils.isNotEmpty(dbFieldModels)) { + String columnComment = ""; + for (DbFieldModel column : dbFieldModels) { + if (column.getField().equalsIgnoreCase(fieldInfo)) { + columnComment = column.getFieldName(); + } + } + fieldInfo = fieldInfo + " (" + columnComment + ")"; + comment = columnComment; + } + tableNameSet.add(tableInfo); // 表名 + map.put("fieldName", fieldInfo);// 表字段 + map.put("field", model.getLabel()); + map.put("comment", comment); + mapList.add(map); + } + return mapList; + } + + public void sqlCommon(DataSetEntity dataSetEntity, + MultiConsumer>, DbLinkEntity> consumer, + Map params, boolean isFieldStruct) throws Exception { + DbLinkEntity dbLinkEntity = dbLinkService.getResource(dataSetEntity.getDbLinkId()); + // 转换json + List values = new ArrayList<>(); + String sql = replaceSql(dataSetEntity.getDataConfigJson(), dataSetEntity.getParameterJson(), params, values); + + List> dataList; + String addition; + try { + if (DbTypeUtil.checkOracle(dbLinkEntity)) { + addition = "SELECT major.* FROM\n" + + "\t(SELECT 1 from dual) temp\n" + + "LEFT JOIN \n" + + " \t({sql}) major\n" + + "ON \n" + + "\t1 = 1"; + } else { + addition = "SELECT major.* FROM\n" + + "\t(SELECT 1 AS tempColumn) AS temp\n" + + "LEFT JOIN \n" + + " \t({sql}) AS major\n" + + "ON \n" + + "\t1 = 1"; + } + boolean isFunction = StringUtil.isNotEmpty(sql) && sql.toLowerCase().startsWith("call");// 判断是否存储过程 + // isFieldStruct 获取结构时才走sql替换 + sql = isFunction || !isFieldStruct ? sql : addition.replace("{sql}", sql); + dataList = JdbcUtil.queryJdbcColumns(new PrepSqlDTO(sql, values).withConn(dbLinkEntity)).get(); + if (dataList.size() == 0) { + dataList = (JdbcUtil.queryJdbcColumns(new PrepSqlDTO(sql, values).withConn(dbLinkEntity)) + .setIsValue(false).get()); + } + } catch (Exception e) { + throw new DataException(MsgCode.PRI007.get()); + } + if (dataList.size() == 0) { + throw new DataException(MsgCode.PRI004.get()); + } + consumer.accept(dataSetEntity, dataList, dbLinkEntity); + } + + @SneakyThrows + @Override + @DSTransactional + public Map getDataMapOrList(DataSetEntity entity, Map params, String formId, + boolean outIsMap) { + Map printDataMap = new HashMap<>(); + DataSetForm dataSetForm = JsonUtil.getJsonToBean(entity, DataSetForm.class); + dataSetForm.setFormId(formId); + // 数据接口 + if (Objects.equals(entity.getType(), 3)) { + try { + dataSetForm.setNoPage(true); + DataSetViewInfo previewDataInterface = getPreviewDataInterface(dataSetForm); + if (outIsMap) { + printDataMap.put(entity.getFullName(), previewDataInterface.getPreviewData().get(0)); + } else { + printDataMap.put(entity.getFullName(), previewDataInterface.getPreviewData()); + } + } catch (Exception e) { + e.printStackTrace(); + } + return printDataMap; + } + // 配置式 获取数据 + if (Objects.equals(entity.getType(), 2)) { + dataSetForm.setNoPage(true); + List> previewData = getPreviewData(dataSetForm).getPreviewData(); + if (outIsMap) { + printDataMap.put(entity.getFullName(), previewData.get(0)); + } else { + printDataMap.put(entity.getFullName(), previewData); + } + return printDataMap; + } + // sql语句获取数据 + try { + MultiConsumer>, DbLinkEntity> consumer = (dataSetEntity, dataList, + dbLinkEntity) -> { + List> lists = swapData(dataList); + if (outIsMap) { + printDataMap.put(dataSetEntity.getFullName(), lists.get(0)); + } else { + printDataMap.put(dataSetEntity.getFullName(), lists); + } + }; + params.put("@formId", formId); + sqlCommon(entity, consumer, params, false); + } catch (Exception e) { + e.printStackTrace(); + // throw new Exception(e.getMessage()); + } + return printDataMap; + } + + @Override + public Map getDataList(DataSetQuery query) { + Map dataMapOrList = new HashMap<>(); + List queryList = StringUtil.isNotEmpty(query.getQueryList()) + ? JsonUtil.getJsonToList(query.getQueryList(), FieLdsModel.class) + : new ArrayList<>(); + List dataSetList = getList(new DataSetPagination(query.getType(), query.getId())); + Map queryMap = query.getMap() != null ? query.getMap() : new HashMap<>(); + Map> queryData = new HashMap<>(); + for (String key : queryMap.keySet()) { + String vModel = key.replace("-", "."); + String[] name = key.split("-"); + String model = name[0]; + Map fieLdsModelMap = queryData.get(model) != null ? queryData.get(model) + : new HashMap<>(); + FieLdsModel fieLdsModel = queryList.stream().filter(t -> Objects.equals(t.getVModel(), vModel)).findFirst() + .orElse(null); + if (fieLdsModel != null) { + fieLdsModelMap.put(key, fieLdsModel); + } + queryData.put(model, fieLdsModelMap); + } + for (DataSetEntity item : dataSetList) { + Map map = new HashMap<>(); + Map fieLdMap = queryData.get(item.getFullName()) != null + ? queryData.get(item.getFullName()) + : new HashMap<>(); + boolean isInterfaceSql = true; + if (Objects.equals(item.getType(), 2)) { + DataSetForm dataSetForm = JsonUtil.getJsonToBean(item, DataSetForm.class); + dataSetForm.setFormId(query.getFormId()); + String previewSqlText = getPreviewData(dataSetForm).getPreviewSqlText(); + item.setDataConfigJson(previewSqlText); + item.setType(1); + } + if (Objects.equals(item.getType(), 3)) { + DataInterfaceEntity info = dataInterfaceService.getInfo(item.getInterfaceId()); + isInterfaceSql = info != null && Objects.equals(info.getType(), 1); + if (info != null && Objects.equals(info.getType(), 1)) { + if (StringUtil.isNotEmpty(item.getParameterJson())) { + List jsonToList = JsonUtil.getJsonToList(item.getParameterJson(), + DataInterfaceModel.class); + Map dataMap = new HashMap<>(); + dataInterfaceService.paramSourceTypeReplaceValue(jsonToList, dataMap); + map.putAll(dataMap); + } + DataConfigJsonModel configJsonModel = JsonUtil.getJsonToBean(info.getDataConfigJson(), + DataConfigJsonModel.class); + SqlDateModel countSqlDateModel = JsonUtil.getJsonToBean(configJsonModel.getSqlData(), + SqlDateModel.class); + item.setDbLinkId(countSqlDateModel.getDbLinkId()); + item.setDataConfigJson(countSqlDateModel.getSql()); + item.setType(1); + } + } + + // sql语句 + if (Objects.equals(item.getType(), 1)) { + if (fieLdMap.size() > 0) { + int num = 0; + String sql = item.getDataConfigJson(); + DataSetEntity queryEntity = new DataSetEntity(); + queryEntity.setDataConfigJson("select * from (" + sql + ") t where 1=1 "); + queryEntity.setDbLinkId(item.getDbLinkId()); + for (String key : fieLdMap.keySet()) { + FieLdsModel fieLdsModel = fieLdMap.get(key); + if (fieLdsModel != null) { + String[] name = key.split("-"); + String model = name.length > 1 ? name[1] : name[0]; + keyJson(fieLdsModel, model, queryMap.get(key)); + num = value(fieLdsModel, queryEntity, model, num, map); + } + } + item.setDataConfigJson(queryEntity.getDataConfigJson()); + } + } + Map dataList = new HashMap<>(); + Map dataMapOrList1 = getDataMapOrList(item, map, null, false); + for (String key : dataMapOrList1.keySet()) { + try { + List> data = (List>) dataMapOrList1.get(key); + List queryCondition = new ArrayList<>(fieLdMap.values()); + List> interfaceData = new ArrayList<>(); + if (queryCondition.size() > 0 && !isInterfaceSql) { + for (Map dataMap : data) { + boolean hasExtra = mapCompar(queryCondition, dataMap); + if (hasExtra) { + interfaceData.add(dataMap); + } + } + dataList.put(key, interfaceData); + } else { + dataList.put(key, data); + } + } catch (Exception e) { + } + } + dataMapOrList.putAll(dataList); + } + return dataMapOrList; + } + + private List> swapData(List> dbJdbcModelList) { + List> mapList = new ArrayList<>(); + for (List mods : dbJdbcModelList) { + Map map = new HashMap<>(16); + for (JdbcColumnModel mod : mods) { + Object value = mod.getValue(); + if (value != null) { + value = swapCulomn(value, mod); + } else { + value = ""; + } + map.put(mod.getLabel(), value); + } + mapList.add(map); + } + return mapList; + } + + private String replaceSql(String sql, String paramJson, Map params, List values) { + Map map = new HashMap<>(); + for (String key : params.keySet()) { + map.put(key, params.get(key)); + } + // 系统内置参数替换 + Map systemParameter = dataInterfaceService.systemParameterOne(sql, + UserProvider.getUser()); + if (sql.contains(DataInterfaceVarConst.FORM_ID)) { + DataInterfaceParamUtil.getParamModel(systemParameter, sql, DataInterfaceVarConst.FORM_ID, + params.get(DataInterfaceVarConst.FORM_ID)); + } + // 自定义参数替换 + sql = dataInterfaceService.customizationParameter(paramJson, sql, map, systemParameter); + // 参数替换为占位符 + sql = dataInterfaceService.getHandleArraysSql(sql, values, systemParameter); + return sql; + } + + private Object swapCulomn(Object obj, JdbcColumnModel mod) { + // if (mod.getDataType().equalsIgnoreCase("decimal")) { + // assert obj instanceof BigDecimal; + // return ((BigDecimal) obj).toPlainString(); + // } + if (obj instanceof Clob) { + Clob clob = (Clob) obj; + StringBuilder sb = new StringBuilder(); + // 获取CLOB字段的内容长度 + int length = 0; + // 以流的形式读取CLOB字段的内容 + try (Reader reader = clob.getCharacterStream()) { + length = (int) clob.length(); + char[] buffer = new char[length]; + int bytesRead; + // 逐个字符读取并添加到字符串构建器中 + while ((bytesRead = reader.read(buffer)) != -1) { + sb.append(buffer, 0, bytesRead); + } + } catch (Exception e) { + e.printStackTrace(); + } + if (StringUtil.isNotEmpty(sb.toString())) { + return sb.toString(); + } + } else if (obj instanceof LocalDateTime || obj instanceof Timestamp || obj instanceof TIMESTAMP) { + LocalDateTime dateTime = null; + if (obj instanceof LocalDateTime) { + dateTime = (LocalDateTime) obj; + } else if (obj instanceof Timestamp) { + dateTime = ((Timestamp) obj).toLocalDateTime(); + } else { + dateTime = LocalDateTimeUtil.of(cn.hutool.core.date.DateUtil.parse(obj.toString())); + } + return dateTime != null ? new Date(DateUtil.localDateTime2Millis(dateTime)) : obj; + } + return obj; + } + + private void keyJson(FieLdsModel fieLdsModel, String key, Object object) { + convertUserSelectData(fieLdsModel); + // 封装查询 + ConfigModel config = fieLdsModel.getConfig(); + Integer searchType = fieLdsModel.getSearchType(); + config.setYunzhupaasKey(fieLdsModel.getType()); + String yunzhupaasKey = config.getYunzhupaasKey(); + // 模糊搜索 + boolean isMultiple = fieLdsModel.getSearchMultiple() || fieLdsModel.getMultiple(); + List type = YunzhupaasKeyConsts.SelectIgnore; + // 文本框搜索 + List base = YunzhupaasKeyConsts.BaseSelect; + if (isMultiple || type.contains(yunzhupaasKey)) { + if (object instanceof String) { + object = ImmutableList.of(object); + } + searchType = 4; + } + if (base.contains(yunzhupaasKey) && searchType == 3) { + searchType = 2; + } + String symbol = searchType == 1 ? SearchMethodEnum.Equal.getSymbol() + : searchType == 3 ? SearchMethodEnum.Between.getSymbol() + : searchType == 2 ? SearchMethodEnum.Like.getSymbol() : SearchMethodEnum.Included.getSymbol(); + fieLdsModel.setSymbol(symbol); + if (object instanceof List) { + fieLdsModel.setFieldValue(JsonUtil.getObjectToString(object)); + } else { + fieLdsModel.setFieldValue(String.valueOf(object)); + } + + // 封装数据 + List dateControl = YunzhupaasKeyConsts.DateSelect; + dateControl.add("date"); + List numControl = YunzhupaasKeyConsts.NumSelect; + List dataList = new ArrayList<>(); + String value = fieLdsModel.getFieldValue(); + Object fieldValue = fieLdsModel.getFieldValue(); + Object fieldValueTwo = fieLdsModel.getFieldValue(); + if (fieLdsModel.getFieldValue() == null) { + fieldValue = ""; + } + List controlList = new ArrayList() { + { + addAll(numControl); + addAll(dateControl); + add(YunzhupaasKeyConsts.TIME); + add("time"); + } + }; + // 处理数据 + if (controlList.contains(yunzhupaasKey) && StringUtil.isNotEmpty(value) + && !SearchMethodEnum.Like.getSymbol().equals(fieLdsModel.getSymbol())) { + int num = 0; + List data = new ArrayList<>(); + try { + data.addAll(JsonUtil.getJsonToList(value, String.class)); + } catch (Exception e) { + data.add(value); + data.add(value); + } + String valueOne = data.get(0); + String valueTwo = data.get(1); + // 数字 + if (numControl.contains(yunzhupaasKey)) { + fieldValue = valueOne != null ? new BigDecimal(valueOne) : valueOne; + fieldValueTwo = valueTwo != null ? new BigDecimal(valueTwo) : valueTwo; + num++; + } + // 日期 + if (dateControl.contains(yunzhupaasKey)) { + fieldValue = new Date(); + fieldValueTwo = new Date(); + if (ObjectUtil.isNotEmpty(valueOne)) { + fieldValue = new Date(Long.valueOf(valueOne)); + } + if (ObjectUtil.isNotEmpty(valueTwo)) { + fieldValueTwo = new Date(Long.valueOf(valueTwo)); + } + num++; + } + if (num == 0) { + fieldValue = valueOne; + fieldValueTwo = valueTwo; + } + } + List idList = new ArrayList<>(); + try { + List> list = JsonUtil.getJsonToBean(value, List.class); + Set dataAll = new HashSet<>(); + for (int i = 0; i < list.size(); i++) { + List list1 = new ArrayList<>(); + for (int k = 0; k < list.get(i).size(); k++) { + list1.add(list.get(i).get(k)); + idList.add(list.get(i).get(list.get(i).size() - 1)); + } + dataAll.add(JSONArray.toJSONString(list1)); + } + dataList = new ArrayList<>(dataAll); + } catch (Exception e) { + try { + Set dataAll = new HashSet<>(); + List list = JsonUtil.getJsonToList(value, String.class); + List mast = new ArrayList() { + { + add(YunzhupaasKeyConsts.CASCADER); + add(YunzhupaasKeyConsts.ADDRESS); + add(YunzhupaasKeyConsts.COMSELECT); + add(YunzhupaasKeyConsts.CURRORGANIZE); + } + }; + if (mast.contains(yunzhupaasKey)) { + dataAll.add(JSONArray.toJSONString(list)); + } else { + for (int k = 0; k < list.size(); k++) { + String data = list.get(k); + dataAll.add(data); + } + } + if (list.size() > 0) { + idList.add(list.get(list.size() - 1)); + } + dataList.addAll(new ArrayList<>(dataAll)); + } catch (Exception e1) { + idList.add(value); + dataList.add(value); + } + } + boolean isIncludeSubordinate = fieLdsModel.getIsIncludeSubordinate(); + if (isIncludeSubordinate) { + switch (yunzhupaasKey) { + case YunzhupaasKeyConsts.COMSELECT: + for (String org : idList) { + // 获取子组织 + List underOrganizations = organizeApi.getUnderOrganizations(org, false); + // 获取组织全路径 + for (String itemOrg : underOrganizations) { + OrganizeEntity organizeEntity = organizeApi.getInfo(itemOrg); + if (organizeEntity != null) { + if (StringUtil.isNotEmpty(organizeEntity.getOrganizeIdTree())) { + String[] split = organizeEntity.getOrganizeIdTree().split(","); + if (split.length > 0) { + dataList.add(JSONArray.toJSONString(Arrays.asList(split))); + } + } + } + } + } + break; + case YunzhupaasKeyConsts.USERSELECT: + for (String userId : idList) { + // 获取下属用户 + List underOrganizations = userApi.getListByManagerId(userId, null); + List collect = underOrganizations.stream().map(UserEntity::getId) + .collect(Collectors.toList()); + dataList.addAll(collect); + } + break; + case YunzhupaasKeyConsts.DEPSELECT: + for (String org : idList) { + // 获取子部门 + List underOrganizations = organizeApi.getUnderOrganizations(org, false); + dataList.addAll(underOrganizations); + } + break; + } + } + if (dataList.size() == 0) { + dataList.add("yunzhupaasNullList"); + } + fieLdsModel.setVModel(key); + fieLdsModel.setFieldValueOne(fieldValue); + fieLdsModel.setFieldValueTwo(fieldValueTwo); + fieLdsModel.setDataList(dataList); + } + + private void convertUserSelectData(FieLdsModel fieLdsModel) { + List symbolList = ImmutableList.of(SearchMethodEnum.Equal.getSymbol(), + SearchMethodEnum.NotEqual.getSymbol()); + String yunzhupaasKey = fieLdsModel.getConfig().getYunzhupaasKey(); + String fieldValue = fieLdsModel.getFieldValue(); + String symbol = fieLdsModel.getSymbol(); + if (StringUtil.isNotEmpty(fieldValue) && YunzhupaasKeyConsts.CUSTOMUSERSELECT.equals(yunzhupaasKey)) { + if (!symbolList.contains(symbol)) { + List dataValues = new ArrayList<>(); + List values = new ArrayList<>(); + try { + values = JsonUtil.getJsonToList(fieldValue, String.class); + } catch (Exception e) { + } + dataValues.addAll(values); + for (String userVal : values) { + String userValue = userVal.substring(0, userVal.indexOf("--")); + UserEntity userEntity = userApi.getInfo(userValue); + if (userEntity != null) { + dataValues.add(userValue); + // 在用户关系表中取出 + List groupRel = Optional + .ofNullable(userRelationApi.getListByUserId(userValue, PermissionConst.GROUP)) + .orElse(new ArrayList<>()); + List orgRel = Optional + .ofNullable(userRelationApi.getListByUserId(userValue, PermissionConst.ORGANIZE)) + .orElse(new ArrayList<>()); + List posRel = Optional + .ofNullable(userRelationApi.getListByUserId(userValue, PermissionConst.POSITION)) + .orElse(new ArrayList<>()); + List roleRel = Optional + .ofNullable(userRelationApi.getListByUserId(userValue, PermissionConst.ROLE)) + .orElse(new ArrayList<>()); + if (groupRel.size() > 0) { + for (UserRelationEntity split : groupRel) { + dataValues.add(split.getObjectId()); + } + } + if (StringUtil.isNotEmpty(userEntity.getOrganizeId())) { + // 向上递归 查出所有上级组织 + List allUpOrgIDs = new ArrayList<>(); + organizeApi.upWardRecursion(allUpOrgIDs, userEntity.getOrganizeId()); + for (String orgID : allUpOrgIDs) { + dataValues.add(orgID); + } + } + if (posRel.size() > 0) { + for (UserRelationEntity split : posRel) { + dataValues.add(split.getObjectId()); + } + } + if (roleRel.size() > 0) { + for (UserRelationEntity split : roleRel) { + dataValues.add(split.getObjectId()); + } + } + } + } + fieLdsModel.setFieldValue(JsonUtil.getObjectToString(dataValues)); + } + } + } + + private Integer value(FieLdsModel fieLdsModel, DataSetEntity queryEntity, String key, int num, + Map map) { + try { + DbLinkEntity linkEntity = dbLinkService.getResource(queryEntity.getDbLinkId()); + @Cleanup + Connection connection = ConnUtil.getConnOrDefault(linkEntity); + String dbType = connection.getMetaData().getDatabaseProductName().trim(); + boolean isSqlServer = "Microsoft SQL Server".equalsIgnoreCase(dbType); + SearchMethodEnum symbol = SearchMethodEnum.getSearchMethod(fieLdsModel.getSymbol()); + String querySql = queryEntity.getDataConfigJson(); + String sql = "{" + key + num + "} "; + Object fieldValue = fieLdsModel.getFieldValueOne(); + Object fieldValueTwo = fieLdsModel.getFieldValueTwo(); + switch (symbol) { + case IsNull: + querySql += "AND " + key + " IS NULL "; + break; + case IsNotNull: + querySql += "AND " + key + " IS NOT NULL "; + break; + case Equal: + querySql += "AND " + key + " = " + sql; + map.put(key + num, fieldValue); + num++; + break; + case NotEqual: + querySql += "AND " + key + " <> " + sql; + map.put(key + num, fieldValue); + num++; + break; + case GreaterThan: + querySql += "AND " + key + " > " + sql; + map.put(key + num, fieldValue); + num++; + break; + case LessThan: + querySql += "AND " + key + " < " + sql; + map.put(key + num, fieldValue); + num++; + break; + case GreaterThanOrEqual: + querySql += "AND " + key + " >= " + sql; + map.put(key + num, fieldValue); + num++; + break; + case LessThanOrEqual: + querySql += "AND " + key + " <= " + sql; + map.put(key + num, fieldValue); + num++; + break; + case Like: + querySql += "AND " + key + " LIKE " + sql; + if (isSqlServer) { + fieldValue = String.valueOf(fieldValue).replaceAll("\\[", "[[]"); + } + map.put(key + num, "%" + fieldValue + "%"); + num++; + break; + case NotLike: + querySql += "AND " + key + " NOT LIKE " + sql; + if (isSqlServer) { + fieldValue = String.valueOf(fieldValue).replaceAll("\\[", "[[]"); + } + map.put(key + num, "%" + fieldValue + "%"); + num++; + break; + case Between: + querySql += "AND " + key + " BETWEEN " + sql; + map.put(key + num, fieldValue); + num++; + String two = "{" + key + num + "} "; + querySql += " AND " + two; + map.put(key + num, fieldValueTwo); + num++; + break; + case Included: + case NotIncluded: + List dataList = fieLdsModel.getDataList(); + querySql += "AND ( "; + for (int i = 0; i < dataList.size(); i++) { + String value = dataList.get(i); + if (isSqlServer) { + value = String.valueOf(value).replaceAll("\\[", "[[]"); + } + boolean isLast = i == dataList.size() - 1; + switch (symbol) { + case Included: + querySql += key + " LIKE {" + key + num + "} "; + querySql += isLast ? "" : " OR "; + map.put(key + num, "%" + value + "%"); + break; + default: + querySql += key + " NOT LIKE {" + key + num + "} "; + querySql += isLast ? "" : " AND "; + map.put(key + num, "%" + value + "%"); + break; + } + num++; + } + querySql += " ) "; + break; + } + queryEntity.setDataConfigJson(querySql); + } catch (Exception e) { + e.getMessage(); + } + return num; + } + + /** + * 获取配置式字段 + * + * @param item + * @return + */ + private TableTreeModel getConfigureSQL(DataSetEntity item) { + TableTreeModel printTable = new TableTreeModel(); + String parentId = item.getId(); + String headTable = item.getFullName(); + + String dbType = null; + try { + DbLinkEntity linkEntity = dbLinkService.getResource(item.getDbLinkId()); + @Cleanup + Connection connection = ConnUtil.getConnOrDefault(linkEntity); + dbType = DbTypeUtil.getDbEncodeByProductName(connection.getMetaData().getDatabaseProductName().trim()); + } catch (Exception e) { + e.printStackTrace(); + } + List dsConfigModels = DataSetConfigUtil.analyzeJson(item.getVisualConfigJson(), dbType); + + List listDF = new ArrayList<>(); + DataSetConfigUtil.getAllFields(dsConfigModels, listDF); + + List> list = new ArrayList<>(); + for (DsConfigFields configFields : listDF) { + TableTreeModel fieldModel = new TableTreeModel(); + String fieldAlias = configFields.getFieldAlias(); + String filed; + String fieldName; + if (StringUtil.isNotEmpty(fieldAlias)) { + filed = fieldAlias; + fieldName = configFields.getFieldName().replace(configFields.getField(), fieldAlias); + } else { + filed = configFields.getField(); + fieldName = configFields.getFieldName(); + } + fieldModel.setId(filed); + fieldModel.setFullName(fieldName); + fieldModel.setLabel(fieldName); + list.add(fieldModel); + } + printTable.setId(parentId); + printTable.setChildren(list); + printTable.setFullName(headTable); + printTable.setParentId("struct"); + return printTable; + } + + @Override + public DataSetViewInfo getPreviewData(DataSetForm dataSetForm) { + DataSetViewInfo dataSetViewInfo = new DataSetViewInfo(); + Map systemParam = this.getSystemParam( + dataSetForm.getVisualConfigJson() + dataSetForm.getFilterConfigJson(), dataSetForm.getFormId()); + try { + DbLinkEntity linkEntity = dbLinkService.getResource(dataSetForm.getDbLinkId()); + DynamicDataSourceUtil.switchToDataSource(linkEntity); + + @Cleanup + Connection connection = ConnUtil.getConnOrDefault(linkEntity); + String dbType = DbTypeUtil + .getDbEncodeByProductName(connection.getMetaData().getDatabaseProductName().trim()); + List values = new ArrayList<>(); + List dsConfigModels = DataSetConfigUtil.analyzeJson(dataSetForm.getVisualConfigJson(), + dbType); + + // 字段配置 + List listDF = new ArrayList<>(); + DataSetConfigUtil.getAllFields(dsConfigModels, listDF); + List> previewColumns = new ArrayList<>(); + for (DsConfigFields configFields : listDF) { + Map map = new HashMap<>(); + String fieldAlias = configFields.getFieldAlias(); + String filed; + String fieldName; + if (StringUtil.isNotEmpty(fieldAlias)) { + filed = fieldAlias; + fieldName = configFields.getFieldName().replace(configFields.getField(), fieldAlias); + } else { + filed = configFields.getField(); + fieldName = configFields.getFieldName(); + } + map.put("title", filed); + map.put("label", fieldName); + previewColumns.add(map); + } + + String sql = DataSetConfigUtil.assembleSql(dsConfigModels, + DsParamModel.builder().dbType(dbType).values(values).systemParam(systemParam) + .filterConfigJson(dataSetForm.getFilterConfigJson()).build()); + + if (DbBase.MYSQL.equals(dbType) && sql.contains(DsJoinTypeEnum.FULL_JOIN.getCode())) { + throw new DataException(MsgCode.SYS129.get()); + } + + Object[] valueArr = new Object[values.size()]; + for (int i = 0; i < values.size(); i++) { + if (values.get(i) instanceof String) { + valueArr[i] = "'" + values.get(i) + "'"; + } else { + valueArr[i] = values.get(i); + } + } + String replace = sql.replace("?", "%s"); + String sqlValue = String.format(replace, valueArr); + String formatSql = SqlFormatter.format(sqlValue); + + if (!dataSetForm.isNoPage()) { + PageHelper.startPage(1, 20, false); + } + String objectToString = JsonUtil.getObjectToStringAsDate( + JdbcUtil.queryList(new PrepSqlDTO(sql, values).withConn(linkEntity, null)).setIsAlias(true).get()); + List> data = JsonUtil.getJsonToListMap(objectToString); + + dataSetViewInfo.setPreviewSqlText(formatSql); + dataSetViewInfo.setPreviewData(data); + dataSetViewInfo.setPreviewColumns(previewColumns); + } catch (DataException dataE) { + throw new DataException(dataE.getMessage()); + } catch (SQLSyntaxErrorException | PersistenceException sqlE) { + throw new DataException(MsgCode.PRI007.get()); + } catch (Exception e) { + e.printStackTrace(); + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + return dataSetViewInfo; + } + + /** + * 获取系统参数 + * + * @return + */ + public Map getSystemParam(String str, String formId) { + Map map = new HashMap<>(); + UserInfo userInfo = UserProvider.getUser(); + + map.put(DataInterfaceVarConst.FORM_ID, ObjectUtil.isNotEmpty(formId) ? formId : DataInterfaceVarConst.FORM_ID); + + // 当前用户 + String userId = userInfo.getUserId(); + map.put(DataInterfaceVarConst.USER, userId); + + // 当前用户及下属 + List subOrganizeIds = new ArrayList<>(); + if (userInfo.getSubordinateIds().size() > 0) { + subOrganizeIds = userInfo.getSubordinateIds(); + } + subOrganizeIds.add(userInfo.getUserId()); + map.put(DataInterfaceVarConst.USERANDSUB, subOrganizeIds); + + // 当前组织 + String orgId = userInfo.getOrganizeId(); + if (StringUtil.isNotEmpty(userInfo.getDepartmentId())) { + orgId = userInfo.getDepartmentId(); + } + map.put(DataInterfaceVarConst.ORG, orgId); + + // 当前组织及子组织 + if (str.contains(DataInterfaceVarConst.ORGANDSUB)) { + List underOrganizations = organizeApi.getUnderOrganizations(orgId, false); + underOrganizations.add(orgId); + map.put(DataInterfaceVarConst.ORGANDSUB, underOrganizations); + } + + // 当前分管组织 + if (str.contains(DataInterfaceVarConst.CHARORG)) { + List orgIds = organizeAdminTratorApi.getOrganizeUserList(YunzhupaasConst.CURRENT_ORG_SUB); + map.put(DataInterfaceVarConst.CHARORG, orgIds); + } + return map; + } + + /** + * 数据接口获取字段列表 + * + * @param item + * @return + */ + private TableTreeModel getInterfaceFields(DataSetEntity item) { + TableTreeModel printTable = new TableTreeModel(); + String parentId = item.getId(); + String headTable = item.getFullName(); + + DataInterfaceEntity info = dataInterfaceService.getInfo(item.getInterfaceId()); + if (info == null) { + throw new DataException(MsgCode.FM001.get()); + } + String fieldJson = info.getFieldJson(); + + if (StringUtil.isEmpty(fieldJson) || "[]".equals(fieldJson)) { + throw new DataException(MsgCode.SYS133.get()); + } + + List fieldList = JsonUtil.getJsonToList(fieldJson, FieldModel.class); + List> list = new ArrayList<>(); + for (FieldModel configFields : fieldList) { + TableTreeModel fieldModel = new TableTreeModel(); + fieldModel.setId(configFields.getDefaultValue()); + fieldModel.setFullName(configFields.getDefaultValue() + "(" + configFields.getField() + ")"); + fieldModel.setLabel(configFields.getField()); + list.add(fieldModel); + } + printTable.setId(parentId); + printTable.setChildren(list); + printTable.setFullName(headTable); + printTable.setParentId("struct"); + return printTable; + } + + @Override + public DataSetViewInfo getPreviewDataInterface(DataSetForm dataSetForm) { + DataSetViewInfo dataSetViewInfo = new DataSetViewInfo(); + DataInterfaceEntity info = dataInterfaceService.getInfo(dataSetForm.getInterfaceId()); + if (info == null) { + throw new DataException(MsgCode.FM001.get()); + } + String fieldJson = info.getFieldJson(); + + if (StringUtil.isEmpty(fieldJson) || "[]".equals(fieldJson)) { + throw new DataException(MsgCode.SYS133.get()); + } + List fieldList = JsonUtil.getJsonToList(fieldJson, FieldModel.class); + List> previewColumns = new ArrayList<>(); + for (FieldModel configFields : fieldList) { + Map map = new HashMap<>(); + map.put("title", configFields.getDefaultValue()); + map.put("label", configFields.getField()); + previewColumns.add(map); + } + List> data = new ArrayList<>(); + try { + HashMap paramMap = new HashMap<>(16); + if (StringUtil.isNotEmpty(dataSetForm.getParameterJson())) { + List jsonToList = JsonUtil.getJsonToList(dataSetForm.getParameterJson(), + DataInterfaceModel.class); + jsonToList.stream().forEach(t -> { + if (Objects.equals(t.getSourceType(), 4) + && DataInterfaceVarConst.FORM_ID.equals(t.getRelationField())) { + t.setDefaultValue(dataSetForm.getFormId()); + } + }); + dataInterfaceService.paramSourceTypeReplaceValue(jsonToList, paramMap); + } + ActionResult actionResult = dataInterfaceService.infoToId(dataSetForm.getInterfaceId(), null, paramMap); + if (ActionResultCode.Success.getCode().equals(actionResult.getCode())) { + data = (List>) actionResult.getData(); + } + if (!dataSetForm.isNoPage()) { + if (data.size() > 20) { + data = new ArrayList<>(data.subList(0, 20)); + } + } + } catch (Exception e) { + e.printStackTrace(); + throw new DataException(MsgCode.FA037.get()); + } + dataSetViewInfo.setPreviewData(data); + dataSetViewInfo.setPreviewColumns(previewColumns); + return dataSetViewInfo; + } + + public static boolean mapCompar(List searchList, Map hashMap2) { + boolean isChange = false; + for (FieLdsModel item : searchList) { + String realValue = hashMap2.get(item.getVModel()) == null ? "" : (String) hashMap2.get(item.getVModel()); + switch (item.getSearchType()) { + case 2: + if (realValue.indexOf(item.getFieldValue()) >= 0) { + isChange = true; + } + break; + case 3:// between + List longList = new ArrayList() { + { + add(YunzhupaasKeyConsts.NUM_INPUT); + add(YunzhupaasKeyConsts.DATE); + } + }; + if (longList.contains(item.getConfig().getYunzhupaasKey())) { + Long valueLong = Long.parseLong(realValue); + Long valueLongOne = (Long) item.getFieldValueOne(); + Long valueLongTwo = (Long) item.getFieldValueTwo(); + if (valueLong >= valueLongOne && valueLong <= valueLongTwo) { + isChange = true; + } + } else { + String valueLongOne = (String) item.getFieldValueOne(); + String valueLongTwo = (String) item.getFieldValueTwo(); + if (realValue.compareTo(valueLongOne) >= 0 && realValue.compareTo(valueLongTwo) <= 0) { + isChange = true; + } + } + break; + case 4:// 包含 + List dataList = item.getDataList(); + for (String value : dataList) { + isChange = value.indexOf(realValue) >= 0; + } + if (isChange) { + return true; + } + break; + default:// 1,其他条件都按等于查询 + isChange = item.getFieldValue().equals(realValue); + break; + } + } + return isChange; + } + +} diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/DbLinkServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/DbLinkServiceImpl.java new file mode 100644 index 0000000..ab63814 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/DbLinkServiceImpl.java @@ -0,0 +1,229 @@ +package com.yunzhupaas.base.service.impl; + + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yunzhupaas.base.model.dblink.PaginationDbLink; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.database.model.dto.PrepSqlDTO; +import com.yunzhupaas.database.model.entity.DbLinkEntity; +import com.yunzhupaas.base.mapper.DbLinkMapper; +import com.yunzhupaas.base.service.DbLinkService; +import com.yunzhupaas.database.source.DbBase; +import com.yunzhupaas.database.util.*; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.TenantHolder; +import lombok.Cleanup; +import org.apache.commons.lang3.math.NumberUtils; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; + +import java.sql.Connection; +import java.util.Date; +import java.util.List; + +/** + * 数据连接 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Service +public class DbLinkServiceImpl extends SuperServiceImpl implements DbLinkService, InitializingBean { + + @Autowired + private DbLinkService dblinkService; + @Autowired + private DataSourceUtil dataSourceUtils; + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().orderByAsc(DbLinkEntity::getSortCode) + .orderByDesc(DbLinkEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getList(PaginationDbLink pagination) { + // 定义变量判断是否需要使用修改时间倒序 + boolean flag = false; + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + flag = true; + queryWrapper.lambda().and( + t -> t.like(DbLinkEntity::getFullName, pagination.getKeyword()) + .or().like(DbLinkEntity::getHost, pagination.getKeyword()) + ); + } + if (StringUtil.isNotEmpty(pagination.getDbType())) { + flag = true; + queryWrapper.lambda().eq(DbLinkEntity::getDbType, pagination.getDbType()); + } + queryWrapper.lambda().orderByAsc(DbLinkEntity::getSortCode) + .orderByDesc(DbLinkEntity::getCreatorTime); + if (flag) { + queryWrapper.lambda().orderByDesc(DbLinkEntity::getLastModifyTime); + } + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage iPage = this.page(page, queryWrapper); + return pagination.setData(iPage.getRecords(), page.getTotal()); + } + + @Override + public DbLinkEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DbLinkEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public boolean isExistByFullName(String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DbLinkEntity::getFullName, fullName); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(DbLinkEntity::getId, id); + } + return this.count(queryWrapper) > 0; + } + + @Override + public void create(DbLinkEntity entity) { + entity.setId(RandomUtil.uuId()); + this.save(entity); + } + + @Override + public boolean update(String id, DbLinkEntity entity) { + entity.setId(id); + return this.updateById(entity); + } + + @Override + public void delete(DbLinkEntity entity) { + this.removeById(entity.getId()); + } + + @Override + @DSTransactional + public boolean first(String id) { + boolean isOk = false; + //获取要上移的那条数据的信息 + DbLinkEntity upEntity = this.getById(id); + Long upSortCode = upEntity.getSortCode() == null ? 0 : upEntity.getSortCode(); + //查询上几条记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .lt(DbLinkEntity::getSortCode, upSortCode) + .orderByDesc(DbLinkEntity::getSortCode); + List downEntity = this.list(queryWrapper); + if (downEntity.size() > 0) { + //交换两条记录的sort值 + Long temp = upEntity.getSortCode(); + upEntity.setSortCode(downEntity.get(0).getSortCode()); + downEntity.get(0).setSortCode(temp); + this.updateById(downEntity.get(0)); + this.updateById(upEntity); + isOk = true; + } + return isOk; + } + + @Override + @DSTransactional + public boolean next(String id) { + boolean isOk = false; + //获取要下移的那条数据的信息 + DbLinkEntity downEntity = this.getById(id); + Long upSortCode = downEntity.getSortCode() == null ? 0 : downEntity.getSortCode(); + //查询下几条记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .gt(DbLinkEntity::getSortCode, upSortCode) + .orderByAsc(DbLinkEntity::getSortCode); + List upEntity = this.list(queryWrapper); + if (upEntity.size() > 0) { + //交换两条记录的sort值 + Long temp = downEntity.getSortCode(); + downEntity.setSortCode(upEntity.get(0).getSortCode()); + downEntity.setLastModifyTime(new Date()); + upEntity.get(0).setSortCode(temp); + this.updateById(upEntity.get(0)); + this.updateById(downEntity); + isOk = true; + } + return isOk; + } + + @Override + public boolean testDbConnection(DbLinkEntity entity) { + //判断字典数据类型编码是否错误,大小写不敏感 + DbBase db = DbTypeUtil.getDb(entity); + if(db == null){ + throw new DataException(MsgCode.DB001.get()); + } + try{ + @Cleanup Connection conn = ConnUtil.getConn(entity.getUserName(), entity.getPassword(), ConnUtil.getUrl(entity)); + return conn != null; + }catch (Exception e){ + e.printStackTrace(); + } + return false; + } + + /** + * 设置数据源 + * @param dbLinkId 数据连接id + * @throws DataException ignore + */ + @Override + public DbLinkEntity getResource(String dbLinkId) throws Exception { + DbLinkEntity dbLinkEntity = new DbLinkEntity(); + //多租户是否开启 + if("0".equals(dbLinkId)){ + if(TenantDataSourceUtil.isTenantAssignDataSource()){ + // 默认数据库, 租户管理指定租户数据源 + dbLinkEntity = TenantDataSourceUtil.getTenantAssignDataSource(TenantHolder.getDatasourceId()).toDbLink(new DbLinkEntity()); + dbLinkEntity.setId("0"); + }else { + // 默认数据库查询,从配置获取数据源信息 + BeanUtils.copyProperties(dataSourceUtils, dbLinkEntity); + dbLinkEntity.setId("0"); + // 是系统默认的多租户 + TenantDataSourceUtil.initDataSourceTenantDbName(dbLinkEntity); + } + }else { + try { + DynamicDataSourceUtil.switchToDataSource(null); + dbLinkEntity = dblinkService.getInfo(dbLinkId); + }finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + } + // 添加并且切换数据源 + return dbLinkEntity; + } + + @Override + public void afterPropertiesSet(){ + PrepSqlDTO.DB_LINK_FUN = (dbLinkId)-> { + try { + return (DbLinkEntity) getResource(dbLinkId); + } catch (Exception e) { + e.printStackTrace(); + } + return null; + }; + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/DbSyncServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/DbSyncServiceImpl.java new file mode 100644 index 0000000..1abf20d --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/DbSyncServiceImpl.java @@ -0,0 +1,344 @@ +package com.yunzhupaas.base.service.impl; + + +import cn.hutool.core.collection.CollectionUtil; +import com.alibaba.druid.proxy.jdbc.NClobProxyImpl; +import com.yunzhupaas.base.service.DbLinkService; +import com.yunzhupaas.base.service.DbSyncService; +import com.yunzhupaas.base.service.DbTableService; +import com.yunzhupaas.constant.TableFieldsNameConst; +import com.yunzhupaas.database.datatype.model.DtModelDTO; +import com.yunzhupaas.database.datatype.sync.util.DtSyncUtil; +import com.yunzhupaas.database.model.dbfield.DbFieldModel; +import com.yunzhupaas.database.model.dbfield.JdbcColumnModel; +import com.yunzhupaas.database.model.dbtable.DbTableFieldModel; +import com.yunzhupaas.database.model.dbtable.JdbcTableModel; +import com.yunzhupaas.database.model.dto.PrepSqlDTO; +import com.yunzhupaas.database.model.entity.DbLinkEntity; +import com.yunzhupaas.database.source.DbBase; +import com.yunzhupaas.database.sql.enums.base.SqlComEnum; +import com.yunzhupaas.database.sql.model.SqlPrintHandler; +import com.yunzhupaas.database.sql.param.FormatSqlDM; +import com.yunzhupaas.database.sql.param.FormatSqlKingbaseES; +import com.yunzhupaas.database.sql.param.FormatSqlMySQL; +import com.yunzhupaas.database.sql.param.FormatSqlOracle; +import com.yunzhupaas.database.sql.util.SqlFastUtil; +import com.yunzhupaas.database.util.DataSourceUtil; +import com.yunzhupaas.database.util.DbTypeUtil; +import com.yunzhupaas.database.util.JdbcUtil; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.exception.DataTypeException; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * 数据同步 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Slf4j +@Service +public class DbSyncServiceImpl implements DbSyncService { + + @Autowired + private DbLinkService dblinkService; + @Autowired + private DbTableService dbTableService; + @Autowired + private SqlPrintHandler sqlPrintHandler; + @Autowired + private DataSourceUtil dataSourceUtil; + + + private static Properties props; + + static { + Properties props = new Properties(); + props.setProperty("remarks", "true"); //设置可以获取remarks信息 + props.setProperty("useInformationSchema", "true");//设置可以获取tables remarks信息 + DbSyncServiceImpl.props = props; + } + + @Override + public Integer executeCheck(String fromId, String toId, Map convertRuleMap, String table) throws Exception { + DbLinkEntity dbLinkFrom; + DbLinkEntity dbLinkTo; + if("0".equals(fromId)){ + dbLinkFrom = dataSourceUtil.init(); + }else { + dbLinkFrom = DbLinkEntity.newInstance(fromId); + } + if("0".equals(toId)){ + dbLinkTo = dataSourceUtil.init(); + }else { + dbLinkTo = DbLinkEntity.newInstance(toId); + } + //验证一(同库无法同步数据) + if (fromId.equals(toId) || + (Objects.equals(dbLinkFrom.getHost(), dbLinkTo.getHost()) && + (Objects.equals(dbLinkFrom.getPort(), dbLinkTo.getPort()) && + (Objects.equals(dbLinkFrom.getDbName(), dbLinkTo.getDbName()) + )))){ + if(DbBase.ORACLE.equals(dbLinkFrom.getDbType()) || DbBase.DM.equals(dbLinkFrom.getDbType())){ + if(dbLinkFrom.getUserName().equals(dbLinkTo.getUserName())){ + return -1; + } + }else { + return -1; + } + } + //验证二(表存在) + if (dbTableService.isExistTable(toId, table)) { + //验证三(验证表数据) + if (SqlFastUtil.tableDataExist(toId, table)) { + //被同步表存在数据 + return 3; + } + } + // 表不存在 + if (!dbTableService.isExistTable(toId, table)) { + return 2; + } + return 0; + } + + @Override + public void execute(String dbLinkIdFrom, String dbLinkIdTo, Map convertRuleMap, String table) throws Exception { + executeTableCommon(dbLinkIdFrom, dbLinkIdTo, convertRuleMap, table); + } + + @Override + public Map executeBatch(String dbLinkIdFrom, String dbLinkIdTo, Map convertRuleMap, List tableList) { + Map messageMap = new HashMap<>(16); + for (int i = 0; i < tableList.size(); i++) { + String table = tableList.get(i); + int total = tableList.size(); + try{ + executeTableCommon(dbLinkIdFrom, dbLinkIdTo, convertRuleMap, table); + messageMap.put(table, 1); + log.info("表:(" + table + ")同步成功!" + "(" + (i + 1) + "/" + total + ")"); + }catch (Exception e){ + e.printStackTrace(); + messageMap.put(table, 0); + log.info("表:(" + table + ")同步失败!" + "(" + (i + 1) + "/" + total + ")"); + } + } + return messageMap; + } + + /** + * 【主要】同步建表操作 + */ + public void executeTableCommon(String fromLinkId, String toLinkId, Map convertRuleMap, String table) throws Exception { + sqlPrintHandler.tableInfo(table); + DbLinkEntity dbLinkFrom = dblinkService.getResource(fromLinkId); + DbLinkEntity dbLinkTo = dblinkService.getResource(toLinkId); + // 1、删除To表 + try{ + // 2、创建To表 + DbTableFieldModel tableMod = convertFileDataType(dbTableService.getDbTableModel(fromLinkId, table), convertRuleMap, dbLinkFrom.getDbType(), dbLinkTo.getDbType()); + if(!sqlPrintHandler.getPrintFlag()) SqlFastUtil.dropTable(dbLinkTo, table); + SqlFastUtil.creTable(dbLinkTo, tableMod); + // 3、同步数据 From -> To + SqlFastUtil.batchInsert(table, dbLinkTo, getInsertMapList(dbLinkFrom, dbLinkTo.getDbType(), table)); + }catch (Exception ignore){ + ignore.printStackTrace(); + } + } + + /** + * 打印初始脚本 + * + * @param dbLinkIdFrom 数据连接ID + * @param printType dbInit:初始脚本、dbStruct:表结构、dbData:数据、tenant:多租户 + */ + public Map printDbInit(String dbLinkIdFrom, String dbTypeTo, List tableList, Map convertRuleMap, String printType) throws Exception { + DbLinkEntity dbLinkEntity = DbLinkEntity.newInstance(dbLinkIdFrom); + if(CollectionUtil.isEmpty(tableList)){ + tableList = SqlFastUtil.getTableList(dbLinkEntity).stream().map(DbTableFieldModel::getTable).collect(Collectors.toList()); + } + List tableNameList = new ArrayList<>(); + Map messageMap = new HashMap<>(16); + for (int i = 0; i < tableList.size(); i++) { + String table = tableList.get(i); + sqlPrintHandler.tableInfo(table); + tableNameList.add(table); + DbTableFieldModel dbTableFieldModel; + if(true){ + // 方式一:通过JDBC查询表字段信息 + dbTableFieldModel = convertFileDataType(new JdbcTableModel(dbLinkEntity, table).convertDbTableFieldModel(), convertRuleMap, dbLinkEntity.getDbType(), dbTypeTo); + }else { + // 方式二:通过SQL语句获取的表字段信息 + dbTableFieldModel = convertFileDataType(dbTableService.getDbTableModel(dbLinkIdFrom, table), convertRuleMap, dbLinkEntity.getDbType(), dbTypeTo); + } + List> tableData = getInsertMapList(dbLinkEntity, dbTypeTo, table); + DbLinkEntity dbLink = new DbLinkEntity(dbTypeTo); + try{ + switch (printType){ + case "dbInit": + case "dbNull": +// SqlFastUtil.dropTable(dbLink, table); + SqlFastUtil.creTable(dbLink, dbTableFieldModel); + SqlFastUtil.batchInsert(table, dbLink, tableData); + break; + case "tenantCre": + if(DbBase.POSTGRE_SQL.equals(dbTypeTo) || DbBase.KINGBASE_ES.equals(dbTypeTo)){ +// dbTableFieldModel.setTable("${dbName}." + dbTableFieldModel.getTable()); + } else if (DbBase.ORACLE.equals(dbTypeTo) ){ +// dbTableFieldModel.setTable("{schema}." + dbTableFieldModel.getTable()); + } + case "dbStruct": +// SqlFastUtil.dropTable(dbLink, table); + SqlFastUtil.creTable(dbLink, dbTableFieldModel); + break; + case "dbData": + SqlFastUtil.batchInsert(table, dbLink, tableData); + break; + } + messageMap.put(table, 1); + log.info("表:(" + table + ")同步成功!" + "(" + (i + 1) + "/" + tableList.size() + ")"); + }catch (Exception e){ + e.printStackTrace(); + messageMap.put(table, 0); + log.info("表:(" + table + ")同步失败!" + "(" + (i + 1) + "/" + tableList.size() + ")"); + } + } + if(printType.equals("tenantCreNoTab") || printType.equals("tenantCre")){ + sqlPrintHandler.append("\n\n").append(creTenant(tableNameList, dbTypeTo)); + } + return messageMap; + } + + /** + * 多租户创库 + */ + public static String creTenant(List tableNameList, String dbEncode){ + List ignoreTables = Arrays.asList("undo_log"); + StringBuilder insertTenant = new StringBuilder(); + for (String table : tableNameList) { + if(ignoreTables.contains(table.toLowerCase())){ + continue; + } + String intoTable = table; + String fromTable = "${dbName}." + table; + switch (dbEncode){ + case DbBase.SQL_SERVER: + fromTable = "${dbName}.dbo." + table; + break; +// case DbBase.POSTGRE_SQL: +// intoTable = "${dbName}." + table; +// fromTable = "\"public\"." + table; +// break; + case DbBase.ORACLE: +// intoTable = "{schema}." + table; + fromTable = "{initSchema}." + table; + break; + case DbBase.DM: + case DbBase.KINGBASE_ES: + case DbBase.MYSQL: + } + insertTenant.append("INSERT INTO ").append(intoTable).append(" SELECT * FROM ").append(fromTable) + .append(" where ").append(TableFieldsNameConst.F_TENANT_ID).append(" = '0'").append(";").append("\n"); + } + return insertTenant.toString(); + } + + /** + * 获取插入数据map + */ + public List> getInsertMapList(DbLinkEntity dbLinkFrom, String toDbType, String table) throws Exception { + List> modelList = JdbcUtil.queryJdbcColumns(new PrepSqlDTO(SqlComEnum.SELECT_TABLE.getOutSql(table)).withConn(dbLinkFrom)).get(); + List> insertMapList = new ArrayList<>(); + for (List jdbcColumnModels : modelList) { + Map map = new HashMap<>(); + for (JdbcColumnModel jdbcColumnModel : jdbcColumnModels) { + map.put(jdbcColumnModel.getField(), checkValue(jdbcColumnModel, dbLinkFrom.getDbType())); + FormatSqlOracle.nullValue(toDbType, jdbcColumnModel, map); // Oracle空串处理 + FormatSqlKingbaseES.nullValue(toDbType, jdbcColumnModel, map); // KingbaseES空串处理 + } + insertMapList.add(map); + } + return insertMapList; + } + + // 不同数据库之间,特殊数据类型与值校验 + private Object checkValue(JdbcColumnModel model, String dbType) throws Exception { + Function checkVal = (dataType) -> + model.getDataType().equalsIgnoreCase(dataType) && model.getValue() != null; + switch (dbType){ + case DbBase.MYSQL: + /* MySQL设置tinyint类型且长度为1时,JDBC读取时会变成BIT类型,java类型为Boolean类型。 + 1:true , 0:false */ + if(checkVal.apply("BIT")) return String.valueOf(model.getValue()); + case DbBase.ORACLE: + if(checkVal.apply("NCLOB")) return String.valueOf(model.getValue()); + return FormatSqlOracle.timestamp(model.getValue()); + case DbBase.SQL_SERVER: + case DbBase.KINGBASE_ES: + case DbBase.DM: + if(checkVal.apply("CLOB")){ + if(model.getValue() instanceof NClobProxyImpl) FormatSqlDM.getClob((NClobProxyImpl)(model.getValue())); + } + case DbBase.POSTGRE_SQL: + // TODO 等待补充 + default: + return model.getValue(); + } + } + + /** + * 【处理字段类型】 + */ + private DbTableFieldModel convertFileDataType(DbTableFieldModel dbTableFieldModel, Map convertRuleMap, + String fromDbEncode, String toDbEncode) throws Exception { + String table = dbTableFieldModel.getTable(); + List fields = dbTableFieldModel.getDbFieldModelList(); + // 规则Map里的(默认)去除 + if(convertRuleMap != null){ + convertRuleMap.forEach((key, val) ->{ + convertRuleMap.put(key, val.replace(" (默认)", "")); + }); + } + for (DbFieldModel field : fields) { + try { + // 设置转换数据类型 + field.getDtModelDTO().setConvertTargetDtEnum(DtSyncUtil.getToCovert(fromDbEncode, toDbEncode, field.getDataType(), convertRuleMap)); + if(toDbEncode.equals(DbBase.MYSQL)){ + FormatSqlMySQL.checkMysqlFieldPrimary(field, table); + } + }catch (DataException d){ + System.out.println("表_" + table + ":" + d.getMessage()); + DataException dataException = new DataException("目前还未支持数据类型" + toDbEncode + "." + table + "(" + field.getDataType() + ")"); + dataException.printStackTrace(); + // 类型寻找失败转换成字符串 + field.setDataType(DtModelDTO.getStringFixedDt(toDbEncode)); + throw dataException; + }catch (Exception e) { + e.printStackTrace(); + if(e instanceof DataTypeException){ + throw e; + } + log.info(e.getMessage()); + } + } + return dbTableFieldModel; + } + + + + + + + + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/DbTableServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/DbTableServiceImpl.java new file mode 100644 index 0000000..fbcc2d7 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/DbTableServiceImpl.java @@ -0,0 +1,341 @@ +package com.yunzhupaas.base.service.impl; + +import com.google.common.collect.ImmutableMap; +import com.yunzhupaas.base.Page; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.service.DbLinkService; +import com.yunzhupaas.base.service.DbTableService; +import com.yunzhupaas.base.util.dbutil.TableUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.database.datatype.db.DtDMEnum; +import com.yunzhupaas.database.datatype.db.interfaces.DtInterface; +import com.yunzhupaas.database.datatype.viewshow.ViewDataTypeEnum; +import com.yunzhupaas.database.datatype.viewshow.constant.DtViewConst; +import com.yunzhupaas.database.enums.DbAliasEnum; +import com.yunzhupaas.database.model.dbfield.DbFieldModel; +import com.yunzhupaas.database.model.dbtable.DbTableFieldModel; +import com.yunzhupaas.database.model.dto.PrepSqlDTO; +import com.yunzhupaas.database.model.entity.DbLinkEntity; +import com.yunzhupaas.database.model.page.DbTableDataForm; +import com.yunzhupaas.database.model.page.JdbcPageMod; +import com.yunzhupaas.database.source.DbBase; +import com.yunzhupaas.database.source.impl.DbPostgre; +import com.yunzhupaas.database.sql.enums.base.SqlComEnum; +import com.yunzhupaas.database.sql.util.SqlFastUtil; +import com.yunzhupaas.database.sql.util.SqlFrameUtil; +import com.yunzhupaas.database.util.DbTypeUtil; +import com.yunzhupaas.database.util.JdbcUtil; +import com.yunzhupaas.database.util.NotTenantPluginHolder; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.util.StringUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.stream.Collectors; + +/** + * 数据管理 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Slf4j +@Service +public class DbTableServiceImpl implements DbTableService { + + @Autowired + private DbLinkService dblinkService; + @Autowired + private DbTableService dbTableService; + + @Override + public List getList(String dbLinkId, String methodName) throws Exception { + DbLinkEntity dbLinkEntity = dblinkService.getResource(dbLinkId); + return SqlFastUtil.getTableList(dbLinkEntity, methodName); + } + + @Override + public List getListPage(String dbLinkId, Page page) throws Exception { + List list = getList(dbLinkId, DbAliasEnum.TABLE_TYPE.getAlias()); + if(StringUtil.isNotEmpty(page.getKeyword())){ + // 过滤不符条件的元素 + String keyWord = SqlFrameUtil.keyWordTrim(page.getKeyword()).toLowerCase(); + list = list.stream().filter(t-> + (StringUtil.isNotEmpty(t.getComment()) && t.getComment().toLowerCase().contains(keyWord)) + || t.getTable().toLowerCase().contains(keyWord) + ).collect(Collectors.toList()); + } + return list; + } + + @Override + public List getListPage(String dbLinkId, Pagination pagination) throws Exception { + List list = getList(dbLinkId, null); + if(StringUtil.isNotEmpty(pagination.getKeyword())){ + // 过滤不符条件的元素 + String keyWord = SqlFrameUtil.keyWordTrim(pagination.getKeyword()).toLowerCase(); + list = list.stream().filter(t-> + (StringUtil.isNotEmpty(t.getComment()) && t.getComment().toLowerCase().contains(keyWord)) + || t.getTable().toLowerCase().contains(keyWord) + ).collect(Collectors.toList()); + } + long beginIndex = (pagination.getCurrentPage() -1) * pagination.getPageSize(); + long endIndex = beginIndex + pagination.getPageSize(); + List listVO = new ArrayList<>(); + for (int i = 0; i < list.size(); i++) { + if(beginIndex <= i && i < endIndex){ + listVO.add(list.get(i)); + } + } + pagination.setTotal(list.size()); + return listVO; + } + + @Override + public DbTableFieldModel getTable(String dbLinkId, String table) throws Exception { + DbLinkEntity dbLinkEntity = dblinkService.getResource(dbLinkId); + DbTableFieldModel dbTableFieldModel = SqlFastUtil.getTable(dbLinkEntity, table); + dbTableFieldModel.setHasTableData(getSum(dbLinkId, table) > 0); + return dbTableFieldModel; + } + + @Override + public List getFieldList(String dbLinkId, String table) throws Exception { + DbLinkEntity dbLinkEntity = dblinkService.getResource(dbLinkId); + return SqlFastUtil.getFieldList(dbLinkEntity, table); + } + + @Override + public boolean isExistTable(String dbLinkId, String table) throws Exception { + DbLinkEntity dbLinkEntity = dblinkService.getResource(dbLinkId); + return SqlFastUtil.isExistTable(dbLinkEntity, table); + } + + @Override + public boolean dropExistsTable(String dbLinkId, String table) throws Exception { + DbLinkEntity dbLinkEntity = dblinkService.getResource(dbLinkId); + if(isExistTable(dbLinkId, table)){ + return SqlFastUtil.dropTable(dbLinkEntity, table); + } + return true; + } + + @Override + public List> getData(DbTableDataForm dbTableDataForm, String dbLinkId, String table) throws Exception { + DbLinkEntity dbLinkEntity = dblinkService.getResource(dbLinkId); + JdbcPageMod result = new JdbcPageMod(); + String orderKey = dbTableDataForm.getField(); + // 防止SQL注入 + String finalOrderKey = orderKey; + if(getFieldList(dbLinkId, table).stream().noneMatch(field -> field.getField().equals(finalOrderKey))){ + throw new DataException("排序字段不存在"); + } + if (dbLinkEntity != null) { + List dataList = new ArrayList<>(); + if(DbTypeUtil.checkPostgre(dbLinkEntity)){ + table = DbPostgre.getTable(table); + orderKey = DbPostgre.getTable(orderKey); +// String schema = dbLinkEntity.getDbSchema(); +// if(StringUtil.isNotEmpty(schema)){ +// table = schema + "." + table; +// } + } + StringBuilder sql = new StringBuilder(SqlComEnum.SELECT_TABLE.getOutSql(table)); + //模糊查询 + if (!StringUtil.isEmpty(dbTableDataForm.getKeyword()) && !StringUtil.isEmpty(orderKey)) { + sql.append(" where " + orderKey + " like ?"); + dataList.add("%" + SqlFrameUtil.keyWordTrim(dbTableDataForm.getKeyword()) + "%"); + } + result = JdbcUtil.queryPage( + new PrepSqlDTO(sql.toString(), dataList).withConn(dbLinkEntity), + checkOrderKey(orderKey, dbLinkId, table, dbLinkEntity.getDbType()), + (int) dbTableDataForm.getCurrentPage(), + (int) dbTableDataForm.getPageSize()) + .setIsLowerCase(true).setIsAlias(true).get(); + } + dbTableDataForm.setTotal(result.getTotalRecord()); + return (List>)result.getDataList(); + } + + private String checkOrderKey(String orderKey, String dbLinkId, String table, String dbEncode){ + try { + if(DbBase.DM.equals(dbEncode)){ + List fieldList = getFieldList(dbLinkId, table); + Optional first = fieldList.stream().filter(field -> field.getField().equals(orderKey)).findFirst(); + if(first.isPresent()){ + String dataType = first.get().getDataType(); + if(dataType.equals(DtDMEnum.CLOB.getDataType()) || dataType.equals(DtDMEnum.TEXT.getDataType())){ +// throw new Exception("无法使用CLOB、TEXT作为字段排序条件"); + Optional first1 = fieldList.stream().filter(field -> field.getField().toLowerCase().contains("id")).findFirst(); + if(first1.isPresent()){ + return first1.get().getField(); + } + + } + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return orderKey; + } + + @Override + public int getSum(String dbLinkId,String table)throws Exception { + DbLinkEntity dbLinkEntity = dblinkService.getResource(dbLinkId); + return SqlFastUtil.getSum(dbLinkEntity, table); + } + + /**=====================增删改========================**/ + + @Override + public void delete(String dbLinkId, String table) throws Exception { + // 校验 + checkTab(table, dbLinkId, 1); + SqlFastUtil.dropTable(dblinkService.getResource(dbLinkId), table); + } + + @Override + public void deleteAllTable(String dbLinkId, String dbType) throws Exception { + DbLinkEntity dbLinkEntity = dblinkService.getResource(dbLinkId); + if(!dbLinkEntity.getDbType().equals(dbType)) throw new Exception("数据库类型不符"); + for (DbTableFieldModel dbTableFieldModel : SqlFastUtil.getTableList(dbLinkEntity)) { + SqlFastUtil.dropTable(dbLinkEntity, dbTableFieldModel.getTable()); + } + } + + @Override + public int createTable(DbTableFieldModel dbTableFieldModel) throws Exception { + DbLinkEntity dbLinkEntity = dblinkService.getResource(dbTableFieldModel.getDbLinkId()); + // 数据库编码查询校验 (打印模板校验) + String opeDb = dbLinkEntity.getDbType(); + String creDb = dbTableFieldModel.getDbEncode(); + if(StringUtil.isNotEmpty(creDb) && !creDb.equals(opeDb)){ + throw new DataException(MsgCode.DB008.get() + ":" + creDb + " -> " + opeDb); + } + // 表重名判断 + if (isExistTable(dbTableFieldModel.getDbLinkId(), dbTableFieldModel.getTable())) { + return 0; + } + // 表主键检验 + checkPrimary(dbTableFieldModel.getDbFieldModelList(), dbLinkEntity.getDbType()); + // 创建表 + SqlFastUtil.creTable(dbLinkEntity, dbTableFieldModel); + return 1; + } + + @Override + public void update(DbTableFieldModel dbTableFieldModel) throws Exception { + // 校验 + checkTab(dbTableFieldModel.getUpdateOldTable(), dbTableFieldModel.getDbLinkId(), 2); + DbLinkEntity dbLinkEntity = dblinkService.getResource(dbTableFieldModel.getDbLinkId()); + //临时表名 + String oldTable = dbTableFieldModel.getUpdateOldTable(); + String newTable = dbTableFieldModel.getUpdateNewTable(); + String tempTabName = "Temp_" + TableUtil.getStringRandom(5); + // 第一步:创建新表 (成功则删除旧表,失败则回滚) + checkPrimary(dbTableFieldModel.getDbFieldModelList(), dbLinkEntity.getDbType()); + SqlFastUtil.creTable(dbLinkEntity, + new DbTableFieldModel( + tempTabName, + dbTableFieldModel.getComment(), + dbTableFieldModel.getDbFieldModelList() + )); + // 第二步:删除旧表 + SqlFastUtil.dropTable(dbLinkEntity, oldTable); + // 第三步:新表改名 + SqlFastUtil.reTableName(dbLinkEntity, tempTabName, newTable); + } + + @Override + public void addField(DbTableFieldModel dbTableFieldModel) throws Exception { + DbLinkEntity dbLinkEntity = dblinkService.getResource(dbTableFieldModel.getDbLinkId()); + SqlFastUtil.addField(dbLinkEntity, dbTableFieldModel.getUpdateNewTable(), dbTableFieldModel.getDbFieldModelList()); + } + + @Override + public DbTableFieldModel getDbTableModel(String dbLinkId, String tableName)throws Exception { + NotTenantPluginHolder.setNotSwitchFlag(); + DbTableFieldModel dbTableModel = getList(dbLinkId, null).stream().filter(m -> m.getTable().equals(tableName)).findFirst().orElse(null); + if(dbTableModel != null){ + dbTableModel.setDbFieldModelList(getFieldList(dbLinkId, tableName)); + return dbTableModel; + }else { + throw new DataException("请在数据库中添加对应的数据表"); + } + } + + /* ================复用代码================== */ + + /** + * 校验表可操作 + * + * @param table 表 + * @param dbLinkId 数据连接ID + * @param type 1:删除 2:编辑 + * @throws Exception 错误信息 + */ + private void checkTab(String table, String dbLinkId, Integer type) throws Exception { + if (TableUtil.checkByoTable(table)) throw new DataException(type == 1 ? MsgCode.DB101.get() : MsgCode.DB102.get()); + if (getSum(dbLinkId, table) > 0) throw new DataException(type == 1 ? MsgCode.DB201.get() : MsgCode.DB202.get()); + } + + /** + * 检查主键 + * @param tableFieldList 表字段集合 + * @throws DataException ignore + */ + private void checkPrimary(List tableFieldList, String dbEncode) throws Exception { + // 默认主键为字符串类型 + // 主键会自动添加"非空"限制,所以不用做判断。(为空不加语句,且数据库默认字段可为空) + int autoIncrementNum = 0; + for(DbFieldModel field : tableFieldList) { + if(field.getIsAutoIncrement() != null && field.getIsAutoIncrement()){ + field.setNullSign("NOT NULL"); + // 一张表最多只有一个自增主键,且此字段必须为primary key或者unique key。 + autoIncrementNum += 1; + if(autoIncrementNum > 1){ + throw new DataException("一张表最多只运行有一个自增主键"); + } + if(!(field.getDataType().equals(DtViewConst.INT) || field.getDataType().equals(DtViewConst.BIGINT))){ + throw new DataException("自增字段类型必须为数字类型"); + } + if(!field.getIsPrimaryKey()){ + throw new DataException("自增字段类型必须为主键"); + } + }else { + if (field.getIsPrimaryKey()) { + field.setNullSign("NOT NULL"); + Method method = ViewDataTypeEnum.class.getMethod("getDt" + dbEncode + "Enum"); + Map allowDtMap = ImmutableMap.of( + ViewDataTypeEnum.VARCHAR, DtViewConst.VARCHAR, + ViewDataTypeEnum.INT, DtViewConst.INT, + ViewDataTypeEnum.BIGINT, DtViewConst.BIGINT + ); + boolean primaryFlag = false; + for (Map.Entry mapEntity : allowDtMap.entrySet()) { + DtInterface primaryVarcharEnum = (DtInterface)(method.invoke(mapEntity.getKey())); + boolean enumFlag = field.getDataType().equalsIgnoreCase(primaryVarcharEnum.getDataType()); + boolean viewFlag = field.getDataType().equalsIgnoreCase(mapEntity.getValue()); + if(enumFlag || viewFlag){ + primaryFlag = true; + } + } + if(!primaryFlag){ + throw new DataException("主键必须为字符串或整型、长整型"); + } + } + } + } + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/DictionaryDataServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/DictionaryDataServiceImpl.java new file mode 100644 index 0000000..5cca110 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/DictionaryDataServiceImpl.java @@ -0,0 +1,414 @@ +package com.yunzhupaas.base.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.entity.DictionaryTypeEntity; +import com.yunzhupaas.base.mapper.DictionaryDataMapper; +import com.yunzhupaas.base.model.dictionarydata.DictionaryDataExportModel; +import com.yunzhupaas.base.model.dictionarytype.DictionaryExportModel; +import com.yunzhupaas.base.service.DictionaryDataService; +import com.yunzhupaas.base.service.DictionaryTypeService; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.util.*; +import com.yunzhupaas.emnus.ModuleTypeEnum; +import com.yunzhupaas.util.FileExport; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import org.springframework.transaction.interceptor.TransactionAspectSupport; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 字典数据 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Service +public class DictionaryDataServiceImpl extends SuperServiceImpl implements DictionaryDataService { + + + @Autowired + private DictionaryTypeService dictionaryTypeService; + @Autowired + private FileExport fileExport; + @Autowired + private ConfigValueUtil configValueUtil; + + @Override + public List getList(String dictionaryTypeId, Boolean enable) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DictionaryDataEntity::getDictionaryTypeId, dictionaryTypeId); + if (enable) { + queryWrapper.lambda().eq(DictionaryDataEntity::getEnabledMark, 1); + } + queryWrapper.lambda().orderByAsc(DictionaryDataEntity::getSortCode).orderByDesc(DictionaryDataEntity::getCreatorTime).orderByDesc(DictionaryDataEntity::getLastModifyTime); + return this.list(queryWrapper); + } + + @Override + public List getList(String dictionaryTypeId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DictionaryDataEntity::getDictionaryTypeId, dictionaryTypeId); + queryWrapper.lambda().orderByAsc(DictionaryDataEntity::getSortCode) + .orderByDesc(DictionaryDataEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getDicList(String dictionaryTypeId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().and( + t -> t.eq(DictionaryDataEntity::getDictionaryTypeId, dictionaryTypeId) + .or().eq(DictionaryDataEntity::getEnCode, dictionaryTypeId) + ); + queryWrapper.lambda().select(DictionaryDataEntity::getId, DictionaryDataEntity::getFullName, DictionaryDataEntity::getEnCode); + return this.list(queryWrapper); + } + + @Override + public List geDicList(String dictionaryTypeId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().and( + t -> t.eq(DictionaryDataEntity::getDictionaryTypeId, dictionaryTypeId) + .or().eq(DictionaryDataEntity::getEnCode, dictionaryTypeId) + ); + queryWrapper.lambda().select(DictionaryDataEntity::getId, DictionaryDataEntity::getFullName, DictionaryDataEntity::getEnabledMark); + return this.list(queryWrapper); + } + + @Override + public Boolean isExistSubset(String parentId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DictionaryDataEntity::getParentId, parentId); + return this.list(queryWrapper).size() > 0; + } + + @Override + public DictionaryDataEntity getInfo(String id) { + if (id == null) { + return null; + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DictionaryDataEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public DictionaryDataEntity getSwapInfo(String value, String dictionaryTypeId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DictionaryDataEntity::getDictionaryTypeId, dictionaryTypeId).and( + t -> t.eq(DictionaryDataEntity::getId, value) + .or().eq(DictionaryDataEntity::getEnCode, value) + ); + return this.getOne(queryWrapper); + } + + @Override + public boolean isExistByFullName(String dictionaryTypeId, String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DictionaryDataEntity::getFullName, fullName).eq(DictionaryDataEntity::getDictionaryTypeId, dictionaryTypeId); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(DictionaryDataEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public boolean isExistByEnCode(String dictionaryTypeId, String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DictionaryDataEntity::getEnCode, enCode).eq(DictionaryDataEntity::getDictionaryTypeId, dictionaryTypeId); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(DictionaryDataEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public void delete(DictionaryDataEntity entity) { + this.removeById(entity.getId()); + } + + @Override + public void create(DictionaryDataEntity entity) { + //判断id是否为空,为空则为新建 + if (StringUtil.isEmpty(entity.getId())) { + entity.setId(RandomUtil.uuId()); + entity.setSimpleSpelling(PinYinUtil.getFirstSpell(entity.getFullName()).toUpperCase()); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + } + this.save(entity); + } + + @Override + public boolean update(String id, DictionaryDataEntity entity) { + entity.setId(id); + entity.setLastModifyTime(DateUtil.getNowDate()); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + return this.updateById(entity); + } + + @Override + public boolean first(String id) { + boolean isOk = false; + //获取要上移的那条数据的信息 + DictionaryDataEntity upEntity = this.getById(id); + Long upSortCode = upEntity.getSortCode() == null ? 0 : upEntity.getSortCode(); + //查询上几条记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .eq(DictionaryDataEntity::getDictionaryTypeId, upEntity.getDictionaryTypeId()) + .eq(DictionaryDataEntity::getParentId, upEntity.getParentId()) + .lt(DictionaryDataEntity::getSortCode, upSortCode) + .orderByDesc(DictionaryDataEntity::getSortCode); + List downEntity = this.list(queryWrapper); + if (downEntity.size() > 0) { + //交换两条记录的sort值 + Long temp = upEntity.getSortCode(); + upEntity.setSortCode(downEntity.get(0).getSortCode()); + downEntity.get(0).setSortCode(temp); + updateById(downEntity.get(0)); + updateById(upEntity); + isOk = true; + } + return isOk; + } + + @Override + public boolean next(String id) { + boolean isOk = false; + //获取要下移的那条数据的信息 + DictionaryDataEntity downEntity = this.getById(id); + Long upSortCode = downEntity.getSortCode() == null ? 0 : downEntity.getSortCode(); + //查询下几条记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .eq(DictionaryDataEntity::getDictionaryTypeId, downEntity.getDictionaryTypeId()) + .eq(DictionaryDataEntity::getParentId, downEntity.getParentId()) + .gt(DictionaryDataEntity::getSortCode, upSortCode) + .orderByAsc(DictionaryDataEntity::getSortCode); + List upEntity = this.list(queryWrapper); + if (upEntity.size() > 0) { + //交换两条记录的sort值 + Long temp = downEntity.getSortCode(); + downEntity.setSortCode(upEntity.get(0).getSortCode()); + upEntity.get(0).setSortCode(temp); + updateById(upEntity.get(0)); + updateById(downEntity); + isOk = true; + } + return isOk; + } + + @Override + public List getDictionName(List id) { + List dictionList = new ArrayList<>(); + if (id != null && id.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().and( + t -> t.in(DictionaryDataEntity::getEnCode, id) + .or().in(DictionaryDataEntity::getId, id) + ); + queryWrapper.lambda().orderByAsc(DictionaryDataEntity::getParentId); + dictionList = this.list(queryWrapper); + } + return dictionList; + } + + @Override + public DownloadVO exportData(String id) { + //获取数据分类字段详情 + DictionaryTypeEntity typeEntity = dictionaryTypeService.getInfo(id); + if (typeEntity == null) { + throw new DataException(MsgCode.FA001.get()); + } + DictionaryExportModel exportModel = new DictionaryExportModel(); + //递归子分类 + List typeList = new ArrayList<>(); + List typeEntityList = dictionaryTypeService.getList(); + typeList.add(typeEntity); + getDictionaryTypeEntitySet(typeEntity, typeList, typeEntityList); + List collect = typeList.stream().distinct().collect(Collectors.toList()); + //判断是否有子分类 + if (collect.size() > 0) { + exportModel.setList(collect); + } + //获取该类型下的数据 + List modelList = new ArrayList<>(); + for (DictionaryTypeEntity dictionaryTypeEntity : exportModel.getList()) { + List entityList = getList(dictionaryTypeEntity.getId()); + for (DictionaryDataEntity dictionaryDataEntity : entityList) { + DictionaryDataExportModel dataExportModel = JsonUtil.getJsonToBean(dictionaryDataEntity, DictionaryDataExportModel.class); + modelList.add(dataExportModel); + } + } + exportModel.setModelList(modelList); + //导出文件 + DownloadVO downloadVO = fileExport.exportFile(exportModel, configValueUtil.getTemporaryFilePath(), typeEntity.getFullName(), ModuleTypeEnum.SYSTEM_DICTIONARYDATA.getTableName()); + return downloadVO; + } + + /** + * 递归字典分类 + * + * @param dictionaryTypeEntity 数据字典类型实体 + */ + private void getDictionaryTypeEntitySet(DictionaryTypeEntity dictionaryTypeEntity, List set, List typeEntityList) { + //是否含有子分类 + List collect = typeEntityList.stream().filter(t -> dictionaryTypeEntity.getId().equals(t.getParentId())).collect(Collectors.toList()); + if (collect.size() > 0) { + for (DictionaryTypeEntity typeEntity : collect) { + set.add(typeEntity); + getDictionaryTypeEntitySet(typeEntity, set, typeEntityList); + } + } + } + + @Override + @DSTransactional + public ActionResult importData(DictionaryExportModel exportModel, Integer type) throws DataException { + try { + StringBuilder message = new StringBuilder(); + StringJoiner exceptionMessage = new StringJoiner("、"); + List list = JsonUtil.getJsonToList(exportModel.getList(), DictionaryTypeEntity.class); + List entityList = JsonUtil.getJsonToList(exportModel.getModelList(), DictionaryDataEntity.class); + //遍历插入分类 + StringJoiner IDMessage = new StringJoiner("、"); + StringJoiner fullNameMessage = new StringJoiner("、"); + StringJoiner enCodeMessage = new StringJoiner("、"); + Map idFor = new HashMap<>(); + for (DictionaryTypeEntity entity : list) { + String copyNum = UUID.randomUUID().toString().substring(0, 5); + if (dictionaryTypeService.getInfo(entity.getId()) != null) { + IDMessage.add(entity.getId()); + } + if (dictionaryTypeService.isExistByFullName(entity.getFullName(), null)) { + fullNameMessage.add(entity.getFullName()); + } + if (dictionaryTypeService.isExistByEnCode(entity.getEnCode(), null)) { + enCodeMessage.add(entity.getEnCode()); + } + if ((IDMessage.length() > 0 || fullNameMessage.length() > 0 || enCodeMessage.length() > 0)) { + if (ObjectUtil.equal(type, 1)) { + entity.setFullName(entity.getFullName() + ".副本" + copyNum); + entity.setEnCode(entity.getEnCode() + copyNum); + String oldId = entity.getId(); + entity.setId(RandomUtil.uuId()); + dictionaryTypeService.setIgnoreLogicDelete().removeById(entity); + if (Optional.ofNullable(idFor.get(entity.getParentId())).isPresent()) { + entity.setParentId(idFor.get(entity.getParentId())); + } + dictionaryTypeService.setIgnoreLogicDelete().saveOrUpdate(entity); + idFor.put(oldId, entity.getId()); + } + } else { + dictionaryTypeService.setIgnoreLogicDelete().removeById(entity); + dictionaryTypeService.setIgnoreLogicDelete().saveOrUpdate(entity); + } + } + if (IDMessage.length() > 0) { + exceptionMessage.add("ID(" + IDMessage.toString() + ")重复"); + } + if (enCodeMessage.length() > 0) { + exceptionMessage.add("编码(" + IDMessage.toString() + ")重复"); + } + if (fullNameMessage.length() > 0) { + exceptionMessage.add("名称(" + IDMessage.toString() + ")重复"); + } + if (exceptionMessage.length() > 0) { + message.append(exceptionMessage.toString()).append(";"); + exceptionMessage = new StringJoiner("、"); + IDMessage = new StringJoiner("、"); + fullNameMessage = new StringJoiner("、"); + enCodeMessage = new StringJoiner("、"); + } + for (DictionaryDataEntity entity1 : entityList) { + String copyNum = UUID.randomUUID().toString().substring(0, 5); + if (this.getInfo(entity1.getId()) != null) { + IDMessage.add(entity1.getId()); + } + if (this.isExistByFullName(entity1.getDictionaryTypeId(), entity1.getFullName(), null)) { + fullNameMessage.add(entity1.getFullName()); + } + if (this.isExistByEnCode(entity1.getDictionaryTypeId(), entity1.getEnCode(), null)) { + enCodeMessage.add(entity1.getEnCode()); + } + if (ObjectUtil.equal(type, 1)) { + entity1.setId(RandomUtil.uuId()); + if (Optional.ofNullable(idFor.get(entity1.getDictionaryTypeId())).isPresent()) { + entity1.setDictionaryTypeId(idFor.get(entity1.getDictionaryTypeId())); + } + if (this.isExistByFullName(entity1.getDictionaryTypeId(), entity1.getFullName(), null) + || this.isExistByEnCode(entity1.getDictionaryTypeId(), entity1.getEnCode(), null)) { + entity1.setFullName(entity1.getFullName() + ".副本" + copyNum); + entity1.setEnCode(entity1.getEnCode() + copyNum); + } + this.setIgnoreLogicDelete().saveOrUpdate(entity1); + } else if (IDMessage.length() == 0 && fullNameMessage.length() == 0 && enCodeMessage.length() == 0) { + this.setIgnoreLogicDelete().removeById(entity1); + this.setIgnoreLogicDelete().saveOrUpdate(entity1); + } + } + if (IDMessage.length() > 0) { + exceptionMessage.add("ID(" + IDMessage.toString() + ")重复"); + } + if (enCodeMessage.length() > 0) { + exceptionMessage.add("编码(" + enCodeMessage.toString() + ")重复"); + } + if (fullNameMessage.length() > 0) { + exceptionMessage.add("名称(" + fullNameMessage.toString() + ")重复"); + } + if (exceptionMessage.length() > 0) { + message.append("modelList:" + exceptionMessage.toString() + ";"); + } + if (ObjectUtil.equal(type, 0) && message.length() > 0) { + return ActionResult.fail(message.toString().substring(0, message.lastIndexOf(";"))); + } + return ActionResult.success(MsgCode.IMP001.get()); + } catch (Exception e) { + //手动回滚事务 + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + throw new DataException(e.getMessage()); + } finally { + this.clearIgnoreLogicDelete(); + dictionaryTypeService.clearIgnoreLogicDelete(); + this.clearIgnoreLogicDelete(); + } + } + + @Override + public List getListByTypeDataCode(String typeCode) { + DictionaryTypeEntity dictionaryTypeEntity = dictionaryTypeService.getInfoByEnCode(typeCode); + List list = new ArrayList<>(); + if (dictionaryTypeEntity != null) { + list = this.getList(dictionaryTypeEntity.getId()); + } + return list; + } + + @Override + public List getByTypeCodeEnable(String typeCode) { + DictionaryTypeEntity dictionaryTypeEntity = dictionaryTypeService.getInfoByEnCode(typeCode); + List list = new ArrayList<>(); + if (dictionaryTypeEntity != null) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DictionaryDataEntity::getDictionaryTypeId, dictionaryTypeEntity.getId()); + queryWrapper.lambda().eq(DictionaryDataEntity::getEnabledMark, 1); + queryWrapper.lambda().orderByAsc(DictionaryDataEntity::getSortCode) + .orderByDesc(DictionaryDataEntity::getCreatorTime); + list= this.list(queryWrapper); + } + return list; + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/DictionaryTypeServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/DictionaryTypeServiceImpl.java new file mode 100644 index 0000000..1b7ea8d --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/DictionaryTypeServiceImpl.java @@ -0,0 +1,162 @@ +package com.yunzhupaas.base.service.impl; + + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yunzhupaas.base.entity.DictionaryTypeEntity; +import com.yunzhupaas.base.mapper.DictionaryTypeMapper; +import com.yunzhupaas.base.service.DictionaryDataService; +import com.yunzhupaas.base.service.DictionaryTypeService; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; + +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 字典分类 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Service +public class DictionaryTypeServiceImpl extends SuperServiceImpl implements DictionaryTypeService { + + + @Autowired + private DictionaryDataService dictionaryDataService; + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().orderByAsc(DictionaryTypeEntity::getSortCode) + .orderByDesc(DictionaryTypeEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public DictionaryTypeEntity getInfoByEnCode(String enCode) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DictionaryTypeEntity::getEnCode, enCode); + return this.getOne(queryWrapper); + } + + @Override + public DictionaryTypeEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DictionaryTypeEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public boolean isExistByFullName(String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DictionaryTypeEntity::getFullName, fullName); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(DictionaryTypeEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public boolean isExistByEnCode(String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DictionaryTypeEntity::getEnCode, enCode); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(DictionaryTypeEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public void create(DictionaryTypeEntity entity) { + //判断id是否为空,为空则为新建 + if (StringUtil.isEmpty(entity.getId())){ + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + } + this.save(entity); + } + + @Override + public boolean update(String id, DictionaryTypeEntity entity) { + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + return this.updateById(entity); + } + + @Override + public boolean delete(DictionaryTypeEntity entity) { + List dictionaryTypeEntityList = list().stream().filter(t -> entity.getId().equals(t.getParentId())).collect(Collectors.toList()); + //没有子分类的时候才能删 + if (dictionaryTypeEntityList.size() == 0) { + if (dictionaryDataService.getList(entity.getId()).size() == 0){ + this.removeById(entity.getId()); + return true; + } + } + return false; + } + + @Override + @DSTransactional + public boolean first(String id) { + boolean isOk = false; + //获取要上移的那条数据的信息 + DictionaryTypeEntity upEntity = this.getById(id); + Long upSortCode = upEntity.getSortCode() == null ? 0 : upEntity.getSortCode(); + //查询上几条记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .lt(DictionaryTypeEntity::getSortCode, upSortCode) + .eq(DictionaryTypeEntity::getParentId, upEntity.getParentId()) + .orderByDesc(DictionaryTypeEntity::getSortCode); + List downEntity = this.list(queryWrapper); + if (downEntity.size() > 0) { + //交换两条记录的sort值 + Long temp = upEntity.getSortCode(); + upEntity.setSortCode(downEntity.get(0).getSortCode()); + downEntity.get(0).setSortCode(temp); + this.updateById(downEntity.get(0)); + this.updateById(upEntity); + isOk = true; + } + return isOk; + } + + @Override + @DSTransactional + public boolean next(String id) { + boolean isOk = false; + //获取要下移的那条数据的信息 + DictionaryTypeEntity downEntity = this.getById(id); + Long upSortCode = downEntity.getSortCode() == null ? 0 : downEntity.getSortCode(); + //查询下几条记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .gt(DictionaryTypeEntity::getSortCode, upSortCode) + .eq(DictionaryTypeEntity::getParentId, downEntity.getParentId()) + .orderByAsc(DictionaryTypeEntity::getSortCode); + List upEntity = this.list(queryWrapper); + if (upEntity.size() > 0) { + //交换两条记录的sort值 + Long temp = downEntity.getSortCode(); + downEntity.setSortCode(upEntity.get(0).getSortCode()); + upEntity.get(0).setSortCode(temp); + updateById(upEntity.get(0)); + updateById(downEntity); + isOk = true; + } + return isOk; + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/InterfaceOauthServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/InterfaceOauthServiceImpl.java new file mode 100644 index 0000000..0c069ec --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/InterfaceOauthServiceImpl.java @@ -0,0 +1,118 @@ +package com.yunzhupaas.base.service.impl; + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yunzhupaas.base.entity.InterfaceOauthEntity; +import com.yunzhupaas.base.mapper.InterfaceOauthMapper; +import com.yunzhupaas.base.model.InterfaceOauth.PaginationOauth; +import com.yunzhupaas.base.service.InterfaceOauthService; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.util.DateUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 接口认证服务 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/8 9:50 + */ +@Service +public class InterfaceOauthServiceImpl extends SuperServiceImpl implements InterfaceOauthService { + + + + + @Override + public boolean isExistByAppName(String appName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(InterfaceOauthEntity::getAppName, appName); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(InterfaceOauthEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public boolean isExistByAppId(String appId, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(InterfaceOauthEntity::getAppId, appId); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(InterfaceOauthEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public List getList(PaginationOauth pagination) { + boolean flag = false; + QueryWrapper queryWrapper = new QueryWrapper<>(); + //查询关键字 + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + flag = true; + queryWrapper.lambda().and( + t -> t.like(InterfaceOauthEntity::getAppId, pagination.getKeyword()) + .or().like(InterfaceOauthEntity::getAppName, pagination.getKeyword()) + ); + } + if (pagination.getEnabledMark() != null) { + queryWrapper.lambda().eq(InterfaceOauthEntity::getEnabledMark, pagination.getEnabledMark()); + } + //排序 + queryWrapper.lambda().orderByAsc(InterfaceOauthEntity::getSortCode) + .orderByDesc(InterfaceOauthEntity::getCreatorTime); + if (flag) { + queryWrapper.lambda().orderByDesc(InterfaceOauthEntity::getLastModifyTime); + } + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage iPage = this.page(page, queryWrapper); + return pagination.setData(iPage.getRecords(), iPage.getTotal()); + } + + @Override + public InterfaceOauthEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(InterfaceOauthEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(InterfaceOauthEntity entity) { + if (entity.getId() == null) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + entity.setCreatorTime(DateUtil.getNowDate()); + } + this.save(entity); + } + + @Override + public boolean update(InterfaceOauthEntity entity, String id) throws DataException { + entity.setId(id); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + entity.setLastModifyTime(DateUtil.getNowDate()); + return this.updateById(entity); + } + + @Override + public void delete(InterfaceOauthEntity entity) { + this.removeById(entity.getId()); + } + + @Override + public InterfaceOauthEntity getInfoByAppId(String appId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(InterfaceOauthEntity::getAppId, appId); + return this.getOne(queryWrapper); + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/MessageTemplateServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/MessageTemplateServiceImpl.java new file mode 100644 index 0000000..399569f --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/MessageTemplateServiceImpl.java @@ -0,0 +1,116 @@ +package com.yunzhupaas.base.service.impl; + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.entity.MessageTemplateEntity; +import com.yunzhupaas.base.mapper.MessageTemplateMapper; +import com.yunzhupaas.base.service.MessageTemplateService; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; + +import java.util.Date; +import java.util.List; + +/** + * 消息模板 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年12月8日17:40:37 + */ +@Service +public class MessageTemplateServiceImpl extends SuperServiceImpl implements MessageTemplateService { + + + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(MessageTemplateEntity::getEnabledMark, 1); + queryWrapper.lambda().orderByDesc(MessageTemplateEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getList(Pagination pagination, Boolean filter) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (!StringUtil.isEmpty(pagination.getKeyword())) { + queryWrapper.lambda().and( + t -> t.like(MessageTemplateEntity::getFullName, pagination.getKeyword()) + .or().like(MessageTemplateEntity::getTitle, pagination.getKeyword()) + .or().like(MessageTemplateEntity::getEnCode, pagination.getKeyword()) + ); + } + if (filter) { + queryWrapper.lambda().eq(MessageTemplateEntity::getEnabledMark, 1); + } + queryWrapper.lambda().orderByDesc(MessageTemplateEntity::getCreatorTime); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage userPage = this.page(page, queryWrapper); + return pagination.setData(userPage.getRecords(), page.getTotal()); + } + + @Override + public MessageTemplateEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(MessageTemplateEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + @DSTransactional + public void create(MessageTemplateEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + this.save(entity); + } + + @Override + @DSTransactional + public boolean update(String id, MessageTemplateEntity entity) { + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + return this.updateById(entity); + } + + @Override + public void delete(MessageTemplateEntity entity) { + this.removeById(entity.getId()); + } + + @Override + public boolean isExistByFullName(String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(MessageTemplateEntity::getFullName, fullName); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(MessageTemplateEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public boolean isExistByEnCode(String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(MessageTemplateEntity::getEnCode, enCode); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(MessageTemplateEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + +} + + + + + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ModuleButtonServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ModuleButtonServiceImpl.java new file mode 100644 index 0000000..91c30c8 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ModuleButtonServiceImpl.java @@ -0,0 +1,169 @@ +package com.yunzhupaas.base.service.impl; + + +import com.google.common.collect.Lists; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.entity.ModuleButtonEntity; +import com.yunzhupaas.base.mapper.ModuleButtonMapper; +import com.yunzhupaas.base.service.ModuleButtonService; +import com.yunzhupaas.util.DateUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * 按钮权限 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Service +public class ModuleButtonServiceImpl extends SuperServiceImpl implements ModuleButtonService { + + + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + // 排序 + queryWrapper.lambda().orderByAsc(ModuleButtonEntity::getSortCode) + .orderByDesc(ModuleButtonEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getEnabledMarkList(String enabledMark) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleButtonEntity::getEnabledMark,enabledMark); + // 排序 + queryWrapper.lambda().orderByAsc(ModuleButtonEntity::getSortCode) + .orderByDesc(ModuleButtonEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getListByModuleIds(String moduleId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleButtonEntity::getModuleId, moduleId); + // 排序 + queryWrapper.lambda().orderByAsc(ModuleButtonEntity::getSortCode) + .orderByDesc(ModuleButtonEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getListByModuleIds(String moduleId, Pagination pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleButtonEntity::getModuleId, moduleId); + //关键字查询 + if(!StringUtil.isEmpty(pagination.getKeyword())){ + queryWrapper.lambda().and( + t->t.like(ModuleButtonEntity::getFullName,pagination.getKeyword()) + .or().like(ModuleButtonEntity::getEnCode,pagination.getKeyword()) + ); + } + // 排序 + queryWrapper.lambda().orderByAsc(ModuleButtonEntity::getSortCode) + .orderByDesc(ModuleButtonEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public ModuleButtonEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleButtonEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public ModuleButtonEntity getInfo(String id, String moduleId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleButtonEntity::getId, id); + queryWrapper.lambda().eq(ModuleButtonEntity::getModuleId, moduleId); + return this.getOne(queryWrapper); + } + + @Override + public boolean isExistByFullName(String moduleId, String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleButtonEntity::getFullName, fullName).eq(ModuleButtonEntity::getModuleId, moduleId); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(ModuleButtonEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public boolean isExistByEnCode(String moduleId, String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleButtonEntity::getEnCode, enCode); + if(moduleId!=null){ + queryWrapper.lambda().eq(ModuleButtonEntity::getModuleId, moduleId); + } + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(ModuleButtonEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public void create(ModuleButtonEntity entity) { + entity.setId(RandomUtil.uuId()); + this.save(entity); + } + + @Override + public boolean update(String id, ModuleButtonEntity entity) { + entity.setId(id); + entity.setLastModifyTime(DateUtil.getNowDate()); + return this.updateById(entity); + } + + @Override + public void delete(ModuleButtonEntity entity) { + this.removeById(entity.getId()); + } + + @Override + public List getListByModuleIds(List ids) { + if (ids.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + List> lists = Lists.partition(ids, 1000); + for (List list : lists) { + queryWrapper.lambda().or().in(ModuleButtonEntity::getModuleId, list); + } + queryWrapper.lambda().eq(ModuleButtonEntity::getEnabledMark, 1); + queryWrapper.lambda().orderByAsc(ModuleButtonEntity::getSortCode).orderByDesc(ModuleButtonEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getListByIds(List ids) { + if (ids.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + List> lists = Lists.partition(ids, 1000); + for (List list : lists) { + queryWrapper.lambda().or().in(ModuleButtonEntity::getId, list); + } + queryWrapper.lambda().eq(ModuleButtonEntity::getEnabledMark, 1); + return this.list(queryWrapper); + } + + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ModuleColumnServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ModuleColumnServiceImpl.java new file mode 100644 index 0000000..6036753 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ModuleColumnServiceImpl.java @@ -0,0 +1,246 @@ +package com.yunzhupaas.base.service.impl; + + +import com.google.common.collect.Lists; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.entity.ModuleButtonEntity; +import com.yunzhupaas.base.entity.ModuleColumnEntity; +import com.yunzhupaas.base.mapper.ModuleColumnMapper; +import com.yunzhupaas.base.service.ModuleColumnService; +import com.yunzhupaas.util.DateUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 列表权限 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Service +public class ModuleColumnServiceImpl extends SuperServiceImpl implements ModuleColumnService { + + + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + // 排序 + queryWrapper.lambda().orderByAsc(ModuleColumnEntity::getSortCode) + .orderByDesc(ModuleColumnEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getEnabledMarkList(String enabledMark) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleColumnEntity::getEnabledMark, enabledMark); + // 排序 + queryWrapper.lambda().orderByAsc(ModuleColumnEntity::getSortCode) + .orderByDesc(ModuleColumnEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getList(String moduleId, Pagination pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleColumnEntity::getModuleId, moduleId); + if (!StringUtil.isEmpty(pagination.getKeyword())) { + queryWrapper.lambda().and( + t -> t.like(ModuleColumnEntity::getEnCode, pagination.getKeyword()).or().like(ModuleColumnEntity::getFullName, pagination.getKeyword()) + ); + } + // 排序 + queryWrapper.lambda().orderByAsc(ModuleColumnEntity::getSortCode) + .orderByDesc(ModuleColumnEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getList(String moduleId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleColumnEntity::getModuleId, moduleId); + // 排序 + queryWrapper.lambda().orderByAsc(ModuleColumnEntity::getSortCode) + .orderByDesc(ModuleColumnEntity::getCreatorTime); + return this.list(queryWrapper); + } + + + @Override + public List getListByBindTable(String bindTable) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleColumnEntity::getBindTable, bindTable); + // 排序 + queryWrapper.lambda().orderByAsc(ModuleColumnEntity::getSortCode) + .orderByDesc(ModuleColumnEntity::getCreatorTime); + List list = this.list(queryWrapper); + return list; + } + + @Override + public ModuleColumnEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleColumnEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public ModuleColumnEntity getInfo(String id, String moduleId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleColumnEntity::getId, id); + queryWrapper.lambda().eq(ModuleColumnEntity::getModuleId, moduleId); + return this.getOne(queryWrapper); + } + + @Override + public boolean isExistByFullName(String moduleId, String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleColumnEntity::getFullName, fullName).eq(ModuleColumnEntity::getModuleId, moduleId); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(ModuleColumnEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public boolean isExistByEnCode(String moduleId, String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleColumnEntity::getEnCode, enCode).eq(ModuleColumnEntity::getModuleId, moduleId); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(ModuleColumnEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public void create(ModuleColumnEntity entity) { + entity.setSortCode(entity.getSortCode()); + entity.setId(RandomUtil.uuId()); + this.save(entity); + } + + @Override + @DSTransactional + public void create(List entitys) { + Long sortCode = RandomUtil.parses(); + String userId = UserProvider.getUser().getUserId(); + for (ModuleColumnEntity entity : entitys) { + entity.setId(RandomUtil.uuId()); + entity.setSortCode(sortCode++); + entity.setEnabledMark("1".equals(String.valueOf(entity.getEnabledMark())) ? 0 : 1); + entity.setCreatorUserId(userId); + this.save(entity); + } + } + + @Override + public boolean update(String id, ModuleColumnEntity entity) { + entity.setId(id); + entity.setLastModifyTime(DateUtil.getNowDate()); + return this.updateById(entity); + } + + @Override + public void delete(ModuleColumnEntity entity) { + this.removeById(entity.getId()); + } + + @Override + @DSTransactional + public boolean first(String id) { + boolean isOk = false; + //获取要上移的那条数据的信息 + ModuleColumnEntity upEntity = this.getById(id); + Long upSortCode = upEntity.getSortCode() == null ? 0 : upEntity.getSortCode(); + //查询上几条记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .eq(ModuleColumnEntity::getModuleId, upEntity.getModuleId()) + .eq(ModuleColumnEntity::getBindTable, upEntity.getBindTable()) + .lt(ModuleColumnEntity::getSortCode, upSortCode) + .orderByDesc(ModuleColumnEntity::getSortCode); + List downEntity = this.list(queryWrapper); + if (downEntity.size() > 0) { + //交换两条记录的sort值 + Long temp = upEntity.getSortCode(); + upEntity.setSortCode(downEntity.get(0).getSortCode()); + downEntity.get(0).setSortCode(temp); + this.updateById(downEntity.get(0)); + this.updateById(upEntity); + isOk = true; + } + return isOk; + } + + @Override + @DSTransactional + public boolean next(String id) { + boolean isOk = false; + //获取要下移的那条数据的信息 + ModuleColumnEntity downEntity = this.getById(id); + Long upSortCode = downEntity.getSortCode() == null ? 0 : downEntity.getSortCode(); + //查询下几条记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .eq(ModuleColumnEntity::getModuleId, downEntity.getModuleId()) + .eq(ModuleColumnEntity::getBindTable, downEntity.getBindTable()) + .gt(ModuleColumnEntity::getSortCode, upSortCode) + .orderByAsc(ModuleColumnEntity::getSortCode); + List upEntity = this.list(queryWrapper); + if (upEntity.size() > 0) { + //交换两条记录的sort值 + Long temp = downEntity.getSortCode(); + downEntity.setSortCode(upEntity.get(0).getSortCode()); + upEntity.get(0).setSortCode(temp); + this.updateById(upEntity.get(0)); + this.updateById(downEntity); + isOk = true; + } + return isOk; + } + + @Override + public List getListByModuleId(List ids) { + if (ids.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + List> lists = Lists.partition(ids, 1000); + for (List list : lists) { + queryWrapper.lambda().or().in(ModuleColumnEntity::getModuleId, list); + } + queryWrapper.lambda().eq(ModuleColumnEntity::getEnabledMark, 1); + queryWrapper.lambda().orderByAsc(ModuleColumnEntity::getSortCode).orderByDesc(ModuleColumnEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getListByIds(List ids) { + if (ids.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + List> lists = Lists.partition(ids, 1000); + for (List list : lists) { + queryWrapper.lambda().or().in(ModuleColumnEntity::getId, list); + } + queryWrapper.lambda().eq(ModuleColumnEntity::getEnabledMark, 1); + return this.list(queryWrapper); + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ModuleDataAuthorizeLinkDataServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ModuleDataAuthorizeLinkDataServiceImpl.java new file mode 100644 index 0000000..ef9fbbf --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ModuleDataAuthorizeLinkDataServiceImpl.java @@ -0,0 +1,36 @@ +package com.yunzhupaas.base.service.impl; + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yunzhupaas.base.entity.ModuleDataAuthorizeLinkEntity; +import com.yunzhupaas.base.mapper.ModuleDataAuthorizeLinkDataMapper; +import com.yunzhupaas.base.service.ModuleDataAuthorizeLinkDataService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 数据权限方案 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Service +public class ModuleDataAuthorizeLinkDataServiceImpl extends SuperServiceImpl implements ModuleDataAuthorizeLinkDataService { + + + @Override + public ModuleDataAuthorizeLinkEntity getLinkDataEntityByMenuId(String menuId,Integer type) { + QueryWrapper linkEntityQueryWrapper = new QueryWrapper<>(); + linkEntityQueryWrapper.lambda().eq(ModuleDataAuthorizeLinkEntity::getModuleId,menuId).eq(ModuleDataAuthorizeLinkEntity::getDataType,type); + List list = this.list(linkEntityQueryWrapper); + if (list.size()>0){ + return list.get(0); + } + return new ModuleDataAuthorizeLinkEntity(); + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ModuleDataAuthorizeSchemeServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ModuleDataAuthorizeSchemeServiceImpl.java new file mode 100644 index 0000000..4d40843 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ModuleDataAuthorizeSchemeServiceImpl.java @@ -0,0 +1,150 @@ +package com.yunzhupaas.base.service.impl; + + +import com.google.common.collect.Lists; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yunzhupaas.base.entity.ModuleColumnEntity; +import com.yunzhupaas.base.entity.ModuleDataAuthorizeSchemeEntity; +import com.yunzhupaas.base.mapper.ModuleDataAuthorizeSchemeMapper; +import com.yunzhupaas.base.service.ModuleDataAuthorizeSchemeService; +import com.yunzhupaas.util.DateUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * 数据权限方案 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Service +public class ModuleDataAuthorizeSchemeServiceImpl extends SuperServiceImpl implements ModuleDataAuthorizeSchemeService { + + + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + // 排序 + queryWrapper.lambda().orderByDesc(ModuleDataAuthorizeSchemeEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getEnabledMarkList(String enabledMark) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleDataAuthorizeSchemeEntity::getEnabledMark, enabledMark); + // 排序 + queryWrapper.lambda().orderByDesc(ModuleDataAuthorizeSchemeEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getList(String moduleId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleDataAuthorizeSchemeEntity::getModuleId, moduleId); + // 排序 + queryWrapper.lambda().orderByDesc(ModuleDataAuthorizeSchemeEntity::getCreatorTime); + // 排序 + return this.list(queryWrapper); + } + + @Override + public ModuleDataAuthorizeSchemeEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleDataAuthorizeSchemeEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(ModuleDataAuthorizeSchemeEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setEnabledMark(1); + entity.setSortCode(RandomUtil.parses()); + this.save(entity); + } + + @Override + public boolean update(String id, ModuleDataAuthorizeSchemeEntity entity) { + entity.setId(id); + entity.setEnabledMark(1); + entity.setLastModifyTime(DateUtil.getNowDate()); + return this.updateById(entity); + } + + @Override + public void delete(ModuleDataAuthorizeSchemeEntity entity) { + this.removeById(entity.getId()); + } + + @Override + public Boolean isExistByFullName(String id, String fullName, String moduleId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleDataAuthorizeSchemeEntity::getModuleId, moduleId); + queryWrapper.lambda().eq(ModuleDataAuthorizeSchemeEntity::getFullName, fullName); + if (StringUtil.isNotEmpty(id)) { + queryWrapper.lambda().ne(ModuleDataAuthorizeSchemeEntity::getId, id); + } + return this.count(queryWrapper) > 0; + } + + @Override + public Boolean isExistByEnCode(String id, String enCode, String moduleId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleDataAuthorizeSchemeEntity::getModuleId, moduleId); + queryWrapper.lambda().eq(ModuleDataAuthorizeSchemeEntity::getEnCode, enCode); + if (StringUtil.isNotEmpty(id)) { + queryWrapper.lambda().ne(ModuleDataAuthorizeSchemeEntity::getId, id); + } + return this.count(queryWrapper) > 0; + } + + @Override + public Boolean isExistAllData(String moduleId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleDataAuthorizeSchemeEntity::getModuleId, moduleId); + queryWrapper.lambda().eq(ModuleDataAuthorizeSchemeEntity::getAllData, 1); + return this.count(queryWrapper) > 0; + } + + @Override + public List getListByModuleId(List ids) { + if (ids.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + List> lists = Lists.partition(ids, 1000); + for (List list : lists) { + queryWrapper.lambda().or().in(ModuleDataAuthorizeSchemeEntity::getModuleId, list); + } + queryWrapper.lambda().eq(ModuleDataAuthorizeSchemeEntity::getEnabledMark, 1); + queryWrapper.lambda().orderByAsc(ModuleDataAuthorizeSchemeEntity::getSortCode).orderByDesc(ModuleDataAuthorizeSchemeEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getListByIds(List ids) { + if (ids.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + List> lists = Lists.partition(ids, 1000); + for (List list : lists) { + queryWrapper.lambda().or().in(ModuleDataAuthorizeSchemeEntity::getId, list); + } + queryWrapper.lambda().eq(ModuleDataAuthorizeSchemeEntity::getEnabledMark, 1); + return this.list(queryWrapper); + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ModuleDataAuthorizeServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ModuleDataAuthorizeServiceImpl.java new file mode 100644 index 0000000..3b12f59 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ModuleDataAuthorizeServiceImpl.java @@ -0,0 +1,95 @@ +package com.yunzhupaas.base.service.impl; + + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yunzhupaas.base.entity.ModuleDataAuthorizeEntity; +import com.yunzhupaas.base.mapper.ModuleDataAuthorizeMapper; +import com.yunzhupaas.base.service.ModuleDataAuthorizeService; +import com.yunzhupaas.util.DateUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 数据权限配置 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Service +public class ModuleDataAuthorizeServiceImpl extends SuperServiceImpl implements ModuleDataAuthorizeService { + + + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + // 排序 + queryWrapper.lambda().orderByDesc(ModuleDataAuthorizeEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getList(String moduleId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleDataAuthorizeEntity::getModuleId, moduleId); + // 排序 + queryWrapper.lambda().orderByDesc(ModuleDataAuthorizeEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public ModuleDataAuthorizeEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleDataAuthorizeEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(ModuleDataAuthorizeEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setEnabledMark(1); + entity.setSortCode(RandomUtil.parses()); + this.save(entity); + } + + @Override + public boolean update(String id, ModuleDataAuthorizeEntity entity) { + entity.setId(id); + entity.setEnabledMark(1); + entity.setLastModifyTime(DateUtil.getNowDate()); + return this.updateById(entity); + } + + @Override + public void delete(ModuleDataAuthorizeEntity entity) { + this.removeById(entity.getId()); + } + + @Override + public boolean isExistByEnCode(String moduleId, String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleDataAuthorizeEntity::getModuleId, moduleId); + queryWrapper.lambda().eq(ModuleDataAuthorizeEntity::getEnCode, enCode); + return this.count(queryWrapper) > 0; + } + + @Override + public boolean isExistByFullName(String moduleId, String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleDataAuthorizeEntity::getModuleId, moduleId); + queryWrapper.lambda().eq(ModuleDataAuthorizeEntity::getFullName, fullName); + return this.count(queryWrapper) > 0; + } + + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ModuleDataServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ModuleDataServiceImpl.java new file mode 100644 index 0000000..cd2de2b --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ModuleDataServiceImpl.java @@ -0,0 +1,241 @@ +package com.yunzhupaas.base.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.Page; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.ModuleDataEntity; +import com.yunzhupaas.base.entity.SystemEntity; +import com.yunzhupaas.base.mapper.ModuleDataMapper; +import com.yunzhupaas.base.model.module.ModuleModel; +import com.yunzhupaas.base.service.ModuleDataService; +import com.yunzhupaas.base.service.ModuleService; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.base.service.SystemService; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.YunzhupaasConst; +import com.yunzhupaas.consts.DeviceType; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.model.UserMenuModel; +import com.yunzhupaas.model.login.AllMenuSelectVO; +import com.yunzhupaas.model.tenant.TenantAuthorizeModel; +import com.yunzhupaas.permission.model.authorize.AuthorizeVO; +import com.yunzhupaas.permission.service.AuthorizeService; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import com.yunzhupaas.util.treeutil.ListToTreeUtil; +import com.yunzhupaas.util.treeutil.SumTree; +import com.yunzhupaas.util.treeutil.newtreeutil.TreeDotUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2022/5/30 + */ +@Service +public class ModuleDataServiceImpl extends SuperServiceImpl + implements ModuleDataService { + + @Autowired + private ModuleService moduleService; + @Autowired + private SystemService systemService; + @Autowired + private AuthorizeService authorizeApi; + @Autowired + private ConfigValueUtil configValueUtil; + + @Override + public List getList(String category, Page page) { + List moduleModels = menuList(category).stream().filter(t -> category.equals(t.getCategory())) + .collect(Collectors.toList()); + if (StringUtil.isNotEmpty(page.getKeyword())) { + moduleModels = moduleModels.stream().filter(t -> t.getFullName().contains(page.getKeyword())) + .collect(Collectors.toList()); + } + List moduleId = moduleModels.stream().map(ModuleModel::getId).collect(Collectors.toList()); + if (moduleId.size() == 0) { + return new ArrayList<>(); + } + UserInfo userInfo = UserProvider.getUser(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleDataEntity::getCreatorUserId, userInfo.getUserId()); + queryWrapper.lambda().eq(ModuleDataEntity::getModuleType, category); + queryWrapper.lambda().in(ModuleDataEntity::getModuleId, moduleId); + return this.list(queryWrapper); + } + + @Override + public void create(String moduleId) { + UserInfo userInfo = UserProvider.getUser(); + boolean pc = DeviceType.PC.getDevice().equals(userInfo.getLoginDevice()); + ModuleDataEntity entity = new ModuleDataEntity(); + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(userInfo.getUserId()); + entity.setCreatorTime(new Date()); + entity.setEnabledMark(1); + entity.setModuleId(moduleId); + entity.setSystemId(pc ? userInfo.getSystemId() : userInfo.getAppSystemId()); + entity.setModuleType(pc ? "Web" : "App"); + this.save(entity); + } + + @Override + public ModuleDataEntity getInfo(String ObjectId) { + UserInfo userInfo = UserProvider.getUser(); + boolean pc = DeviceType.PC.getDevice().equals(userInfo.getLoginDevice()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleDataEntity::getModuleId, ObjectId).eq(ModuleDataEntity::getCreatorUserId, + userInfo.getUserId()); + queryWrapper.lambda().eq(ModuleDataEntity::getModuleType, pc ? "Web" : "App"); + return this.getOne(queryWrapper); + } + + @Override + public boolean isExistByObjectId(String moduleId) { + UserInfo userInfo = UserProvider.getUser(); + boolean pc = DeviceType.PC.getDevice().equals(userInfo.getLoginDevice()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleDataEntity::getModuleId, moduleId) + .eq(ModuleDataEntity::getModuleType, pc ? "Web" : "App") + .eq(ModuleDataEntity::getCreatorUserId, userInfo.getUserId()); + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public void delete(ModuleDataEntity entity) { + this.removeById(entity.getId()); + } + + @Override + public void delete(String moduleId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleDataEntity::getModuleId, moduleId); + this.remove(queryWrapper); + } + + @Override + public List getDataList(Page page) { + List idAll = getList("App", new Page()).stream().map(ModuleDataEntity::getModuleId) + .collect(Collectors.toList()); + List menuListAll = menuList(); + List menuList = menuListAll; + if (StringUtil.isNotEmpty(page.getKeyword())) { + menuList = menuList.stream().filter(t -> t.getFullName().contains(page.getKeyword())) + .collect(Collectors.toList()); + } + List list = JsonUtil.getJsonToList(ListToTreeUtil.treeWhere(menuList, menuListAll), + UserMenuModel.class); + for (UserMenuModel model : list) { + model.setIsData(idAll.contains(model.getId())); + } + List modelList = modelList(list); + List> menuAll = TreeDotUtils.convertListToTreeDot(modelList, "-1"); + List data = JsonUtil.getJsonToList(menuAll, AllMenuSelectVO.class); + return data; + } + + @Override + public List getAppDataList(Pagination pagination) { + List listVO = new LinkedList<>(); + List idAll = getList("App", new Page()).stream().map(ModuleDataEntity::getModuleId) + .collect(Collectors.toList()); + List moduleModels = menuList(); + List appData = moduleModels.stream().filter(t -> idAll.contains(t.getId())) + .collect(Collectors.toList()); + String keyword = pagination.getKeyword(); + if (StringUtil.isNotEmpty(keyword)) { + appData = appData.stream().filter(t -> t.getFullName().contains(keyword)).collect(Collectors.toList()); + } + if (appData.size() == 0) { + return new ArrayList<>(); + } + List list = JsonUtil.getJsonToList(ListToTreeUtil.treeWhere(appData, moduleModels), + UserMenuModel.class); + List modelList = modelList(list); + List> menuAll = TreeDotUtils.convertListToTreeDot(modelList); + listVO.addAll(JsonUtil.getJsonToList(menuAll, AllMenuSelectVO.class)); + return listVO; + } + + private List modelList(List list) { + List lists = list.stream().filter(t -> "-1".equals(t.getParentId())) + .collect(Collectors.toList()); + List modelList = new ArrayList<>(); + for (UserMenuModel userMenuModel : lists) { + List idList = new ArrayList<>(); + String id = userMenuModel.getId(); + parentList(list, id, idList); + List collect = list.stream().filter(t -> idList.contains(t.getId())) + .collect(Collectors.toList()); + for (UserMenuModel menuModel : collect) { + menuModel.setParentId(id); + } + modelList.addAll(collect); + modelList.add(userMenuModel); + } + return modelList; + } + + private void parentList(List list, String parentId, List idList) { + List menuList = list.stream().filter(t -> parentId.equals(t.getParentId())) + .collect(Collectors.toList()); + for (UserMenuModel menu : menuList) { + List collect = list.stream().filter(t -> t.getParentId().equals(menu.getId())) + .collect(Collectors.toList()); + idList.addAll(collect.stream().filter(t -> !Objects.equals(t.getType(), 1)).map(UserMenuModel::getId) + .collect(Collectors.toList())); + if (collect.size() > 0) { + parentList(list, menu.getId(), idList); + } + if (!Objects.equals(menu.getType(), 1)) { + idList.add(menu.getId()); + } + } + } + + private List menuList() { + String appSystemId = UserProvider.getUser().getAppSystemId(); + AuthorizeVO authorizeModel = authorizeApi.getAuthorizeByUser(false); + List menuList = authorizeModel.getModuleList().stream() + .filter(t -> "App".equals(t.getCategory()) && t.getSystemId().equals(appSystemId)) + .collect(Collectors.toList()); + return menuList; + } + + private List menuList(String category) { + String systemId = "Web".equals(category) ? UserProvider.getUser().getSystemId() + : UserProvider.getUser().getAppSystemId(); + AuthorizeVO authorizeModel = authorizeApi.getAuthorizeByUser(true); + boolean enabledFow = true; + // 获取应用 + if (configValueUtil.isMultiTenancy()) { + TenantAuthorizeModel tenantAuthorizeModel = TenantDataSourceUtil + .getCacheModuleAuthorize(UserProvider.getUser().getTenantId()); + List cacheModuleAuthorize = tenantAuthorizeModel.getModuleIdList(); + if (cacheModuleAuthorize != null) { + enabledFow = !cacheModuleAuthorize.contains("-999"); + } + } + SystemEntity info = systemService.getInfo(systemId); + List menuList = authorizeModel.getModuleList().stream() + .filter(t -> category.equals(t.getCategory()) && t.getSystemId().equals(systemId)) + .collect(Collectors.toList()); + if (info != null && enabledFow && Objects.equals(info.getWorkflowEnabled(), 1)) { + menuList.addAll(JsonUtil.getJsonToList(moduleService.getListByEnCode(YunzhupaasConst.MODULE_CODE), + ModuleModel.class)); + } + return menuList; + } + +} diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ModuleFormServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ModuleFormServiceImpl.java new file mode 100644 index 0000000..c796fae --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ModuleFormServiceImpl.java @@ -0,0 +1,179 @@ +package com.yunzhupaas.base.service.impl; + +import com.google.common.collect.Lists; +import com.yunzhupaas.base.entity.ModuleDataAuthorizeSchemeEntity; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.entity.ModuleFormEntity; +import com.yunzhupaas.base.mapper.ModuleFormMapper; +import com.yunzhupaas.base.service.ModuleFormService; +import com.yunzhupaas.util.DateUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * 表单权限 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Service +public class ModuleFormServiceImpl extends SuperServiceImpl implements ModuleFormService { + + + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + // 排序 + queryWrapper.lambda().orderByAsc(ModuleFormEntity::getSortCode) + .orderByDesc(ModuleFormEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getEnabledMarkList(String enabledMark) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleFormEntity::getEnabledMark,enabledMark); + // 排序 + queryWrapper.lambda().orderByAsc(ModuleFormEntity::getSortCode) + .orderByDesc(ModuleFormEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getList(String moduleId, Pagination pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleFormEntity::getModuleId, moduleId); + if(!StringUtil.isEmpty(pagination.getKeyword())){ + queryWrapper.lambda().and( + t-> t.like(ModuleFormEntity::getEnCode,pagination.getKeyword()).or().like(ModuleFormEntity::getFullName,pagination.getKeyword()) + ); + } + // 排序 + queryWrapper.lambda().orderByAsc(ModuleFormEntity::getSortCode) + .orderByDesc(ModuleFormEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getList(String moduleId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleFormEntity::getModuleId, moduleId); + // 排序 + queryWrapper.lambda().orderByAsc(ModuleFormEntity::getSortCode) + .orderByDesc(ModuleFormEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public ModuleFormEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleFormEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public ModuleFormEntity getInfo(String id, String moduleId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleFormEntity::getId, id); + queryWrapper.lambda().eq(ModuleFormEntity::getModuleId, moduleId); + return this.getOne(queryWrapper); + } + + @Override + public boolean isExistByFullName(String moduleId, String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleFormEntity::getFullName, fullName).eq(ModuleFormEntity::getModuleId, moduleId); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(ModuleFormEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public boolean isExistByEnCode(String moduleId, String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleFormEntity::getEnCode, enCode).eq(ModuleFormEntity::getModuleId, moduleId); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(ModuleFormEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public void create(ModuleFormEntity entity) { + entity.setId(RandomUtil.uuId()); + this.save(entity); + } + + @Override + @DSTransactional + public void create(List entitys) { + Long sortCode = RandomUtil.parses(); + String userId = UserProvider.getUser().getUserId(); + for (ModuleFormEntity entity : entitys) { + entity.setId(RandomUtil.uuId()); + entity.setSortCode(sortCode++); + entity.setEnabledMark("1".equals(String.valueOf(entity.getEnabledMark()))?0:1); + entity.setCreatorUserId(userId); + this.save(entity); + } + } + + @Override + public boolean update(String id, ModuleFormEntity entity) { + entity.setId(id); + entity.setLastModifyTime(DateUtil.getNowDate()); + return this.updateById(entity); + } + + @Override + public void delete(ModuleFormEntity entity) { + this.removeById(entity.getId()); + } + + @Override + public List getListByModuleId(List ids) { + if (ids.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + List> lists = Lists.partition(ids, 1000); + for (List list : lists) { + queryWrapper.lambda().or().in(ModuleFormEntity::getModuleId, list); + } + queryWrapper.lambda().eq(ModuleFormEntity::getEnabledMark, 1); + queryWrapper.lambda().orderByAsc(ModuleFormEntity::getSortCode).orderByDesc(ModuleFormEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getListByIds(List ids) { + if (ids.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + List> lists = Lists.partition(ids, 1000); + for (List list : lists) { + queryWrapper.lambda().or().in(ModuleFormEntity::getId, list); + } + queryWrapper.lambda().eq(ModuleFormEntity::getEnabledMark, 1); + return this.list(queryWrapper); + } + + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ModuleServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ModuleServiceImpl.java new file mode 100644 index 0000000..0233ce9 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ModuleServiceImpl.java @@ -0,0 +1,955 @@ +package com.yunzhupaas.base.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.github.yulichang.toolkit.JoinWrappers; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.entity.*; +import com.yunzhupaas.base.mapper.ModuleMapper; +import com.yunzhupaas.base.model.module.*; +import com.yunzhupaas.base.service.*; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.YunzhupaasConst; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.database.util.DbTypeUtil; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.emnus.ModuleTypeEnum; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.model.tenant.TenantAuthorizeModel; +import com.yunzhupaas.permission.model.authorize.AuthorizeVO; +import com.yunzhupaas.permission.service.AuthorizeService; +import com.yunzhupaas.util.*; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.interceptor.TransactionAspectSupport; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 系统功能 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Service +public class ModuleServiceImpl extends SuperServiceImpl implements ModuleService { + + @Autowired + private ModuleButtonService moduleButtonService; + @Autowired + private ModuleColumnService moduleColumnService; + @Autowired + private ModuleDataAuthorizeService moduleDataAuthorizeService; + @Autowired + private ModuleButtonService buttonService; + @Autowired + private ModuleColumnService columnService; + @Autowired + private ModuleFormService formService; + @Autowired + private ModuleDataAuthorizeSchemeService schemeService; + @Autowired + private ModuleDataAuthorizeService authorizeService; + @Autowired + private FileExport fileExport; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private SystemService systemService; + @Autowired + private AuthorizeService authorizeApi; + @Autowired + private DbLinkService dbLinkService; + @Autowired + private ModuleDataService moduleDataService; + + @Override + public List getList(boolean filterFlowWork, List moduleAuthorize, + List moduleUrlAddressAuthorize) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().orderByAsc(ModuleEntity::getSortCode) + .orderByDesc(ModuleEntity::getCreatorTime); + // 移除工作流程菜单 + if (filterFlowWork) { + List moduleCode = YunzhupaasConst.MODULE_CODE; + queryWrapper.lambda().notIn(ModuleEntity::getEnCode, moduleCode); + } + if (moduleAuthorize.size() > 0) { + queryWrapper.lambda().notIn(ModuleEntity::getId, moduleAuthorize); + } + if (moduleUrlAddressAuthorize.size() > 0) { + queryWrapper.lambda().and(t -> t.notIn(ModuleEntity::getUrlAddress, moduleUrlAddressAuthorize).or() + .isNull(ModuleEntity::getUrlAddress)); + } + return this.list(queryWrapper); + } + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().isNotNull(ModuleEntity::getUrlAddress); + try { + if (!DbTypeUtil.checkOracle(dbLinkService.getResource("0"))) { + queryWrapper.lambda().ne(ModuleEntity::getUrlAddress, ""); + } + } catch (Exception e) { + e.printStackTrace(); + } + queryWrapper.lambda().orderByAsc(ModuleEntity::getSortCode) + .orderByDesc(ModuleEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getList(String systemId, String category, String keyword, Integer type, + Integer enabledMark, String parentId, boolean release) { + // 定义变量判断是否需要使用修改时间倒序 + boolean flag = false; + QueryWrapper queryWrapper = new QueryWrapper<>(); + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(SystemEntity::getEnCode, YunzhupaasConst.MAIN_SYSTEM_CODE); + query.lambda().select(SystemEntity::getId); + SystemEntity systemEntity = systemService.getOne(query); + if ("0".equals(systemId) && release) { + queryWrapper.lambda().eq(ModuleEntity::getCategory, "Web"); + queryWrapper.lambda().eq(ModuleEntity::getSystemId, systemEntity.getId()); + queryWrapper.lambda().select(ModuleEntity::getId); + List workModuleIds = this.list(queryWrapper).stream().map(ModuleEntity::getId) + .collect(Collectors.toList()); + // 重新定义一个查询对象 + queryWrapper = new QueryWrapper<>(); + if (!workModuleIds.isEmpty()) { + queryWrapper.lambda().notIn(ModuleEntity::getId, workModuleIds); + } + } + // 如果是主系统且不是管理员菜单需要去分级里面获取 + AuthorizeVO authorize = authorizeApi.getAuthorizeByUser(true); + List collect = new ArrayList<>(); + // 根据系统id获取功能 + if (!"0".equals(systemId)) { + collect = authorize.getModuleList().stream().filter(t -> t.getSystemId().equals(systemId)) + .map(ModuleModel::getId).collect(Collectors.toList()); + } else { + collect = authorize.getModuleList().stream().map(ModuleModel::getId).distinct() + .collect(Collectors.toList()); + } + collect.add(""); + List> lists = Lists.partition(collect, 1000); + queryWrapper.lambda().and(t -> { + for (List list : lists) { + t.in(ModuleEntity::getId, list).or(); + } + }); + if (!StringUtil.isEmpty(category)) { + queryWrapper.lambda().eq(ModuleEntity::getCategory, category); + } + if (!StringUtil.isEmpty(keyword)) { + flag = true; + queryWrapper.lambda().and(t -> t.like(ModuleEntity::getFullName, keyword) + .or().like(ModuleEntity::getEnCode, keyword) + .or().like(ModuleEntity::getUrlAddress, keyword)); + } + if (type != null) { + flag = true; + queryWrapper.lambda().eq(ModuleEntity::getType, type); + } + if (enabledMark != null) { + flag = true; + queryWrapper.lambda().eq(ModuleEntity::getEnabledMark, enabledMark); + } + if (StringUtil.isNotEmpty(parentId)) { + queryWrapper.lambda().eq(ModuleEntity::getParentId, parentId); + } + queryWrapper.lambda().orderByAsc(ModuleEntity::getSortCode) + .orderByDesc(ModuleEntity::getCreatorTime); + if (flag) { + queryWrapper.lambda().orderByDesc(ModuleEntity::getLastModifyTime); + } + // 移除工作流程菜单 + List moduleCode = YunzhupaasConst.MODULE_CODE; + queryWrapper.lambda().notIn(ModuleEntity::getEnCode, moduleCode); + return this.list(queryWrapper); + } + + @Override + public List getList(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleEntity::getParentId, id); + queryWrapper.lambda().orderByAsc(ModuleEntity::getSortCode) + .orderByDesc(ModuleEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public ModuleEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public ModuleEntity getInfo(String id, String systemId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleEntity::getId, id); + queryWrapper.lambda().eq(ModuleEntity::getSystemId, systemId); + return this.getOne(queryWrapper); + } + + @Override + public List getInfoByFullName(String fullName, String systemId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleEntity::getFullName, fullName); + queryWrapper.lambda().eq(ModuleEntity::getSystemId, systemId); + return this.list(queryWrapper); + } + + @Override + public ModuleEntity getInfo(String id, String systemId, String parentId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleEntity::getId, id); + queryWrapper.lambda().eq(ModuleEntity::getSystemId, systemId); + queryWrapper.lambda().eq(ModuleEntity::getParentId, parentId); + return this.getOne(queryWrapper); + } + + @Override + public boolean isExistByFullName(ModuleEntity entity, String category, String systemId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleEntity::getFullName, entity.getFullName()).eq(ModuleEntity::getCategory, + category); + if (!StringUtil.isEmpty(entity.getId())) { + queryWrapper.lambda().ne(ModuleEntity::getId, entity.getId()); + } + queryWrapper.lambda().eq(ModuleEntity::getParentId, entity.getParentId()); + // 通过系统id查询 + queryWrapper.lambda().eq(ModuleEntity::getSystemId, systemId); + + List entityList = this.list(queryWrapper); + if (entityList.size() > 0) { + return true; + } + return false; + } + + @Override + public boolean isExistByEnCode(ModuleEntity entity, String category, String systemId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleEntity::getEnCode, entity.getEnCode()).eq(ModuleEntity::getCategory, category); + if (!StringUtil.isEmpty(entity.getId())) { + queryWrapper.lambda().ne(ModuleEntity::getId, entity.getId()); + } + + List entityList = this.list(queryWrapper); + if (entityList.size() > 0) { + return true; + } else { + return false; + } + } + + @DSTransactional + @Override + public void delete(ModuleEntity entity) { + this.removeById(entity.getId()); + QueryWrapper buttonWrapper = new QueryWrapper<>(); + buttonWrapper.lambda().eq(ModuleButtonEntity::getModuleId, entity.getId()); + moduleButtonService.remove(buttonWrapper); + QueryWrapper columnWrapper = new QueryWrapper<>(); + columnWrapper.lambda().eq(ModuleColumnEntity::getModuleId, entity.getId()); + moduleColumnService.remove(columnWrapper); + QueryWrapper dataWrapper = new QueryWrapper<>(); + dataWrapper.lambda().eq(ModuleDataAuthorizeEntity::getModuleId, entity.getId()); + moduleDataAuthorizeService.remove(dataWrapper); + QueryWrapper formWrapper = new QueryWrapper<>(); + formWrapper.lambda().eq(ModuleFormEntity::getModuleId, entity.getId()); + formService.remove(formWrapper); + QueryWrapper schemeWrapper = new QueryWrapper<>(); + schemeWrapper.lambda().eq(ModuleDataAuthorizeSchemeEntity::getModuleId, entity.getId()); + schemeService.remove(schemeWrapper); + QueryWrapper moduleDataWrapper = new QueryWrapper<>(); + moduleDataWrapper.lambda().eq(ModuleDataEntity::getModuleId, entity.getId()); + moduleDataService.remove(moduleDataWrapper); + } + + @Override + public void deleteBySystemId(String systemId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleEntity::getSystemId, systemId); + this.remove(queryWrapper); + } + + @DSTransactional + @Override + public void deleteModule(ModuleEntity entity) { + QueryWrapper buttonWrapper = new QueryWrapper<>(); + buttonWrapper.lambda().eq(ModuleButtonEntity::getModuleId, entity.getId()); + moduleButtonService.remove(buttonWrapper); + QueryWrapper columnWrapper = new QueryWrapper<>(); + columnWrapper.lambda().eq(ModuleColumnEntity::getModuleId, entity.getId()); + moduleColumnService.remove(columnWrapper); + QueryWrapper formWrapper = new QueryWrapper<>(); + formWrapper.lambda().eq(ModuleFormEntity::getModuleId, entity.getId()); + formService.remove(formWrapper); + } + + @DSTransactional + @Override + public void create(ModuleEntity entity) { + // boolean flag = false; + // if (entity.getId() == null) { + entity.setId(RandomUtil.uuId()); + // flag = true; + // } + this.save(entity); + // 添加默认按钮 + if ("3".equals(String.valueOf(entity.getType()))) { + // Map propJsonMap= + // JSONUtil.StringToMap(entity.getPropertyJson()); + // if(propJsonMap!=null){ + // VisualdevEntity visualdevEntity + // =visualdevService.getInfo(propJsonMap.get("moduleId").toString()); + // //去除模板中的F_ + // visualdevEntity= VisualUtil.delFKey(visualdevEntity); + // if(visualdevEntity!=null){ + // List btnData =new ArrayList<>(); + // Map + // column=JSONUtil.StringToMap(visualdevEntity.getColumnData()); + // if(column.get("columnBtnsList")!=null){ + // btnData.addAll(JSONUtil.getJsonToList(JSONUtil.getJsonToListMap(column.get("columnBtnsList").toString()),BtnData.class)); + // } + // if(column.get("btnsList")!=null){ + // btnData.addAll(JSONUtil.getJsonToList(JSONUtil.getJsonToListMap(column.get("btnsList").toString()),BtnData.class)); + // } + // if(btnData.size()>0){ + // for(BtnData btn:btnData){ + // ModuleButtonEntity moduleButtonEntity=new ModuleButtonEntity(); + // moduleButtonEntity.setId(RandomUtil.uuId()); + // moduleButtonEntity.setParentId("-1"); + // moduleButtonEntity.setFullName(btn.getLabel()); + // moduleButtonEntity.setEnCode("btn_"+btn.getValue()); + // moduleButtonEntity.setSortCode(0L); + // moduleButtonEntity.setModuleId(entity.getId()); + // moduleButtonEntity.setEnabledMark(1); + // moduleButtonEntity.setIcon(btn.getIcon()); + // moduleButtonService.save(moduleButtonEntity); + // } + // } + // List indexGridField6Models =new ArrayList<>(); + // if(column.get("columnList")!=null){ + // indexGridField6Models.addAll(JSONUtil.getJsonToList(JSONUtil.getJsonToListMap(column.get("columnList").toString()),IndexGridField6Model.class)); + // if(indexGridField6Models.size()>0){ + // for(IndexGridField6Model field6Model:indexGridField6Models){ + // ModuleColumnEntity moduleColumnEntity=new ModuleColumnEntity(); + // moduleColumnEntity.setId(RandomUtil.uuId()); + // moduleColumnEntity.setParentId("-1"); + // moduleColumnEntity.setFullName(field6Model.getLabel()); + // moduleColumnEntity.setEnCode(field6Model.getProp()); + // moduleColumnEntity.setSortCode(0L); + // moduleColumnEntity.setModuleId(entity.getId()); + // moduleColumnEntity.setEnabledMark(1); + // moduleColumnService.save(moduleColumnEntity); + // } + // } + // } + // } + // } + } else if ("4".equals(String.valueOf(entity.getType()))) { + for (int i = 0; i < 3; i++) { + String fullName = "新增"; + String value = "add"; + String icon = "el-icon-plus"; + if (i == 1) { + fullName = "编辑"; + value = "edit"; + icon = "el-icon-edit"; + } + if (i == 2) { + fullName = "删除"; + value = "remove"; + icon = "el-icon-delete"; + } + ModuleButtonEntity moduleButtonEntity = new ModuleButtonEntity(); + moduleButtonEntity.setId(RandomUtil.uuId()); + moduleButtonEntity.setParentId("-1"); + moduleButtonEntity.setFullName(fullName); + moduleButtonEntity.setEnCode("btn_" + value); + moduleButtonEntity.setSortCode(0L); + moduleButtonEntity.setModuleId(entity.getId()); + moduleButtonEntity.setEnabledMark(1); + moduleButtonEntity.setIcon(icon); + moduleButtonService.save(moduleButtonEntity); + } + + } + } + + @Override + public boolean update(String id, ModuleEntity entity) { + entity.setId(id); + entity.setLastModifyTime(DateUtil.getNowDate()); + return this.updateById(entity); + } + + @Override + public DownloadVO exportData(String id) { + // 获取信息转model + ModuleEntity moduleEntity = getInfo(id); + List buttonServiceList = buttonService.getListByModuleIds(id); + List columnServiceList = columnService.getList(id); + List schemeServiceList = schemeService.getList(id); + List authorizeServiceList = authorizeService.getList(id); + List formList = formService.getList(id); + ModuleExportModel exportModel = new ModuleExportModel(); + exportModel.setModuleEntity(moduleEntity); + exportModel.setButtonEntityList(buttonServiceList); + exportModel.setColumnEntityList(columnServiceList); + exportModel.setFormEntityList(formList); + exportModel.setSchemeEntityList(schemeServiceList); + exportModel.setAuthorizeEntityList(authorizeServiceList); + // 导出文件 + DownloadVO downloadVO = fileExport.exportFile(exportModel, configValueUtil.getTemporaryFilePath(), + moduleEntity.getFullName(), ModuleTypeEnum.SYSTEM_MODULE.getTableName()); + return downloadVO; + } + + @Override + @DSTransactional + public ActionResult importData(ModuleExportModel exportModel, Integer type) throws DataException { + try { + boolean isAdd = ObjectUtil.equal(type, 1); + StringBuilder message = new StringBuilder(); + ModuleEntity moduleEntity = exportModel.getModuleEntity(); + StringJoiner stringJoiner = new StringJoiner("、"); + if (getInfo(moduleEntity.getId()) != null) { + stringJoiner.add("ID"); + } + String id = moduleEntity.getId(); + moduleEntity.setId(null); + if (isExistByEnCode(moduleEntity, moduleEntity.getCategory(), moduleEntity.getSystemId())) { + stringJoiner.add("编码"); + } + if (isExistByFullName(moduleEntity, moduleEntity.getCategory(), moduleEntity.getSystemId())) { + stringJoiner.add("名称"); + } + moduleEntity.setId(id); + if (stringJoiner.length() > 0) { + if (isAdd) { + String copyNum = UUID.randomUUID().toString().substring(0, 5); + moduleEntity.setFullName(moduleEntity.getFullName() + ".副本" + copyNum); + moduleEntity.setEnCode(moduleEntity.getEnCode() + copyNum); + moduleEntity.setId(RandomUtil.uuId()); + this.setIgnoreLogicDelete().removeById(moduleEntity); + this.setIgnoreLogicDelete().saveOrUpdate(moduleEntity); + } + } else { + this.setIgnoreLogicDelete().removeById(moduleEntity); + this.setIgnoreLogicDelete().saveOrUpdate(moduleEntity); + } + if (stringJoiner.length() > 0) { + message.append(stringJoiner.toString()).append("重复;"); + } + StringJoiner exceptionMessage = new StringJoiner("、"); + StringJoiner IDMessage = new StringJoiner("、"); + StringJoiner fullNameMessage = new StringJoiner("、"); + StringJoiner enCodeMessage = new StringJoiner("、"); + // 按钮 + List buttonEntityList = JsonUtil.getJsonToList(exportModel.getButtonEntityList(), + ModuleButtonEntity.class); + // 新ID映射 + Map idConvert = new HashMap<>(buttonEntityList.size(), 1); + if (isAdd) { + buttonEntityList.forEach(button -> idConvert.put(button.getId(), RandomUtil.uuId())); + } + for (ModuleButtonEntity buttonEntity : buttonEntityList) { + if (buttonService.getInfo(buttonEntity.getId()) != null) { + IDMessage.add(buttonEntity.getId()); + } + if (buttonService.isExistByFullName(moduleEntity.getId(), buttonEntity.getFullName(), null)) { + fullNameMessage.add(buttonEntity.getFullName()); + } + if (buttonService.isExistByEnCode(moduleEntity.getId(), buttonEntity.getEnCode(), null)) { + enCodeMessage.add(buttonEntity.getEnCode()); + } + if (isAdd) { + buttonEntity.setId(idConvert.get(buttonEntity.getId())); + buttonEntity.setModuleId(moduleEntity.getId()); + if (idConvert.containsKey(buttonEntity.getParentId())) { + buttonEntity.setParentId(idConvert.get(buttonEntity.getParentId())); + } + if (fullNameMessage.length() > 0 || enCodeMessage.length() > 0) { + String copyNum = UUID.randomUUID().toString().substring(0, 5); + buttonEntity.setFullName(buttonEntity.getFullName() + ".副本" + copyNum); + buttonEntity.setEnCode(buttonEntity.getEnCode() + copyNum); + } + buttonService.setIgnoreLogicDelete().saveOrUpdate(buttonEntity); + } else if (IDMessage.length() == 0 && fullNameMessage.length() == 0 && enCodeMessage.length() == 0) { + buttonService.setIgnoreLogicDelete().removeById(buttonEntity); + buttonEntity.setModuleId(moduleEntity.getId()); + buttonService.setIgnoreLogicDelete().saveOrUpdate(buttonEntity); + } + } + tmpMessage("buttonEntityList:", message, exceptionMessage, IDMessage, fullNameMessage, enCodeMessage); + // 列表 + List columnEntityList = JsonUtil.getJsonToList(exportModel.getColumnEntityList(), + ModuleColumnEntity.class); + for (ModuleColumnEntity columnEntity : columnEntityList) { + if (columnService.getInfo(columnEntity.getId()) != null) { + IDMessage.add(columnEntity.getId()); + } + if (columnService.isExistByFullName(moduleEntity.getId(), columnEntity.getFullName(), null)) { + fullNameMessage.add(columnEntity.getFullName()); + } + if (columnService.isExistByEnCode(moduleEntity.getId(), columnEntity.getEnCode(), null)) { + enCodeMessage.add(columnEntity.getEnCode()); + } + if (isAdd) { + columnEntity.setId(RandomUtil.uuId()); + columnEntity.setModuleId(moduleEntity.getId()); + if (fullNameMessage.length() > 0 || enCodeMessage.length() > 0) { + String copyNum = UUID.randomUUID().toString().substring(0, 5); + columnEntity.setFullName(columnEntity.getFullName() + ".副本" + copyNum); + columnEntity.setEnCode(columnEntity.getEnCode() + copyNum); + } + columnService.setIgnoreLogicDelete().saveOrUpdate(columnEntity); + } else if (IDMessage.length() == 0 && fullNameMessage.length() == 0 && enCodeMessage.length() == 0) { + columnService.setIgnoreLogicDelete().removeById(columnEntity); + columnEntity.setModuleId(moduleEntity.getId()); + columnService.setIgnoreLogicDelete().saveOrUpdate(columnEntity); + } + } + tmpMessage("columnEntityList:", message, exceptionMessage, IDMessage, fullNameMessage, enCodeMessage); + // 表单 + List formEntityList = JsonUtil.getJsonToList(exportModel.getFormEntityList(), + ModuleFormEntity.class); + for (ModuleFormEntity formEntity : formEntityList) { + if (formService.getInfo(formEntity.getId()) != null) { + IDMessage.add(formEntity.getId()); + } + if (formService.isExistByFullName(moduleEntity.getId(), formEntity.getFullName(), null)) { + fullNameMessage.add(formEntity.getFullName()); + } + if (formService.isExistByEnCode(moduleEntity.getId(), formEntity.getEnCode(), null)) { + enCodeMessage.add(formEntity.getEnCode()); + } + if (isAdd) { + formEntity.setId(RandomUtil.uuId()); + formEntity.setModuleId(moduleEntity.getId()); + if (fullNameMessage.length() > 0 || enCodeMessage.length() > 0) { + String copyNum = UUID.randomUUID().toString().substring(0, 5); + formEntity.setFullName(formEntity.getFullName() + ".副本" + copyNum); + formEntity.setEnCode(formEntity.getEnCode() + copyNum); + } + formService.setIgnoreLogicDelete().saveOrUpdate(formEntity); + } else if (IDMessage.length() == 0 && fullNameMessage.length() == 0 && enCodeMessage.length() == 0) { + formService.setIgnoreLogicDelete().removeById(formEntity); + formEntity.setModuleId(moduleEntity.getId()); + formService.setIgnoreLogicDelete().saveOrUpdate(formEntity); + } + } + tmpMessage("formEntityList:", message, exceptionMessage, IDMessage, fullNameMessage, enCodeMessage); + // 数据权限 + Map authorizeId = new HashMap<>(16); + List authorizeEntityList = JsonUtil + .getJsonToList(exportModel.getAuthorizeEntityList(), ModuleDataAuthorizeEntity.class); + for (ModuleDataAuthorizeEntity authorizeEntity : authorizeEntityList) { + if (authorizeService.getInfo(authorizeEntity.getId()) != null) { + IDMessage.add(authorizeEntity.getId()); + } + if (authorizeService.isExistByFullName(moduleEntity.getId(), authorizeEntity.getFullName(), null)) { + fullNameMessage.add(authorizeEntity.getFullName()); + } + if (authorizeService.isExistByEnCode(moduleEntity.getId(), authorizeEntity.getEnCode(), null)) { + enCodeMessage.add(authorizeEntity.getEnCode()); + } + if (isAdd) { + authorizeEntity.setId(RandomUtil.uuId()); + authorizeEntity.setModuleId(moduleEntity.getId()); + if (fullNameMessage.length() > 0 || enCodeMessage.length() > 0) { + String copyNum = UUID.randomUUID().toString().substring(0, 5); + authorizeEntity.setFullName(authorizeEntity.getFullName() + ".副本" + copyNum); + authorizeEntity.setEnCode(authorizeEntity.getEnCode() + copyNum); + } + authorizeService.setIgnoreLogicDelete().saveOrUpdate(authorizeEntity); + authorizeId.put(authorizeEntity.getId(), authorizeEntity.getId()); + } else if (IDMessage.length() == 0 && fullNameMessage.length() == 0 && enCodeMessage.length() == 0) { + authorizeService.setIgnoreLogicDelete().removeById(authorizeEntity); + authorizeEntity.setModuleId(moduleEntity.getId()); + authorizeService.setIgnoreLogicDelete().saveOrUpdate(authorizeEntity); + } + } + tmpMessage("authorizeEntityList:", message, exceptionMessage, IDMessage, fullNameMessage, enCodeMessage); + // 数据权限方案 + List schemeEntityList = JsonUtil + .getJsonToList(exportModel.getSchemeEntityList(), ModuleDataAuthorizeSchemeEntity.class); + for (ModuleDataAuthorizeSchemeEntity schemeEntity : schemeEntityList) { + if (schemeService.getInfo(schemeEntity.getId()) != null) { + IDMessage.add(schemeEntity.getId()); + } + if (schemeService.isExistByFullName(null, schemeEntity.getFullName(), moduleEntity.getId())) { + fullNameMessage.add(schemeEntity.getFullName()); + } + if (schemeService.isExistByEnCode(null, schemeEntity.getEnCode(), moduleEntity.getId())) { + enCodeMessage.add(schemeEntity.getEnCode()); + } + if (isAdd) { + schemeEntity.setId(RandomUtil.uuId()); + schemeEntity.setModuleId(moduleEntity.getId()); + String conditionJson = schemeEntity.getConditionJson(); + if (StringUtil.isNotEmpty(conditionJson)) { + for (String oldId : authorizeId.keySet()) { + conditionJson = conditionJson.replaceAll(oldId, authorizeId.get(oldId)); + } + } + if (fullNameMessage.length() > 0 || enCodeMessage.length() > 0) { + String copyNum = UUID.randomUUID().toString().substring(0, 5); + schemeEntity.setFullName(schemeEntity.getFullName() + ".副本" + copyNum); + schemeEntity.setEnCode(schemeEntity.getEnCode() + copyNum); + } + schemeService.setIgnoreLogicDelete().saveOrUpdate(schemeEntity); + } else if (IDMessage.length() == 0 && fullNameMessage.length() == 0 && enCodeMessage.length() == 0) { + schemeService.setIgnoreLogicDelete().removeById(schemeEntity); + schemeEntity.setModuleId(moduleEntity.getId()); + schemeService.setIgnoreLogicDelete().saveOrUpdate(schemeEntity); + } + } + tmpMessage("schemeEntityList:", message, exceptionMessage, IDMessage, fullNameMessage, enCodeMessage); + if (ObjectUtil.equal(type, 0) && message.length() > 0) { + return ActionResult.fail(message.toString().substring(0, message.lastIndexOf(";"))); + } + return ActionResult.success(MsgCode.IMP001.get()); + } catch (Exception e) { + e.printStackTrace(); + // 手动回滚事务 + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + throw new DataException(e.getMessage()); + } finally { + this.clearIgnoreLogicDelete(); + buttonService.clearIgnoreLogicDelete(); + columnService.clearIgnoreLogicDelete(); + formService.clearIgnoreLogicDelete(); + authorizeService.clearIgnoreLogicDelete(); + schemeService.clearIgnoreLogicDelete(); + } + } + + private void tmpMessage(String moduleType, StringBuilder message, StringJoiner exceptionMessage, + StringJoiner IDMessage, StringJoiner fullNameMessage, StringJoiner enCodeMessage) { + if (IDMessage.length() > 0) { + exceptionMessage.add("ID(" + IDMessage.toString() + ")重复"); + } + if (enCodeMessage.length() > 0) { + exceptionMessage.add("编码(" + enCodeMessage.toString() + ")重复"); + } + if (fullNameMessage.length() > 0) { + exceptionMessage.add("名称(" + fullNameMessage.toString() + ")重复"); + } + if (exceptionMessage.length() > 0) { + message.append(moduleType + exceptionMessage.toString()).append(";"); + exceptionMessage = new StringJoiner("、"); + IDMessage = new StringJoiner("、"); + fullNameMessage = new StringJoiner("、"); + enCodeMessage = new StringJoiner("、"); + } + } + + @Override + @DSTransactional + public List getModuleList(String visualId) { + QueryWrapper moduleWrapper = new QueryWrapper<>(); + moduleWrapper.lambda().eq(ModuleEntity::getModuleId, visualId).or().like(ModuleEntity::getPropertyJson, + visualId); + return this.list(moduleWrapper); + } + + @Override + public List getModuleBySystemIds(List ids, List moduleAuthorize, + List moduleUrlAddressAuthorize) { + if (ids.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (moduleAuthorize != null && moduleAuthorize.size() > 0) { + queryWrapper.lambda().notIn(ModuleEntity::getId, ids); + } + if (moduleUrlAddressAuthorize != null && moduleUrlAddressAuthorize.size() > 0) { + queryWrapper.lambda().and(t -> t.notIn(ModuleEntity::getUrlAddress, moduleUrlAddressAuthorize).or() + .isNull(ModuleEntity::getUrlAddress)); + } + queryWrapper.lambda().in(ModuleEntity::getSystemId, ids); + queryWrapper.lambda().notIn(ModuleEntity::getEnCode, YunzhupaasConst.MODULE_CODE); + queryWrapper.lambda().eq(ModuleEntity::getEnabledMark, 1); + queryWrapper.lambda().orderByAsc(ModuleEntity::getSortCode).orderByDesc(ModuleEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getModuleByPortal(List portalIds) { + if (portalIds.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(ModuleEntity::getModuleId, portalIds); + return this.list(queryWrapper); + } + + @Override + public List getMainModule(List moduleAuthorize, List moduleUrlAddressAuthorize, + boolean singletonOrg) { + SystemEntity mainSystem = systemService.getInfoByEnCode(YunzhupaasConst.MAIN_SYSTEM_CODE); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ModuleEntity::getSystemId, mainSystem.getId()); + if (!singletonOrg) { + queryWrapper.lambda().eq(ModuleEntity::getEnabledMark, 1); + } + // 移除工作流程菜单 + List moduleCode = YunzhupaasConst.MODULE_CODE; + if (moduleAuthorize != null && moduleAuthorize.size() > 0) { + queryWrapper.lambda().notIn(ModuleEntity::getId, moduleAuthorize); + } + if (moduleUrlAddressAuthorize != null && moduleUrlAddressAuthorize.size() > 0) { + queryWrapper.lambda().and(t -> t.notIn(ModuleEntity::getUrlAddress, moduleUrlAddressAuthorize).or() + .isNull(ModuleEntity::getUrlAddress)); + } + queryWrapper.lambda().notIn(ModuleEntity::getEnCode, moduleCode); + queryWrapper.lambda().orderByAsc(ModuleEntity::getSortCode).orderByDesc(ModuleEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getModuleByIds(List ids, List moduleAuthorize, + List moduleUrlAddressAuthorize, boolean singletonOrg) { + if (ids.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + List> lists = Lists.partition(ids, 1000); + queryWrapper.lambda().and(t -> { + for (List list : lists) { + t.in(ModuleEntity::getId, list).or(); + } + }); + if (moduleAuthorize != null && moduleAuthorize.size() > 0) { + queryWrapper.lambda().notIn(ModuleEntity::getId, moduleAuthorize); + } + if (moduleUrlAddressAuthorize != null && moduleUrlAddressAuthorize.size() > 0) { + queryWrapper.lambda().and(t -> t.notIn(ModuleEntity::getUrlAddress, moduleUrlAddressAuthorize).or() + .isNull(ModuleEntity::getUrlAddress)); + } + // 移除工作流程菜单 + List moduleCode = YunzhupaasConst.MODULE_CODE; + queryWrapper.lambda().notIn(ModuleEntity::getEnCode, moduleCode); + if (!singletonOrg) { + queryWrapper.lambda().eq(ModuleEntity::getEnabledMark, 1); + } + queryWrapper.lambda().orderByAsc(ModuleEntity::getSortCode).orderByDesc(ModuleEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getListByEnCode(List enCodeList) { + if (enCodeList.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(ModuleEntity::getEnCode, enCodeList); + queryWrapper.lambda().eq(ModuleEntity::getEnabledMark, 1); + return this.list(queryWrapper); + } + + @Override + public List findModuleAdmin(int mark, String id, List moduleAuthorize, + List moduleUrlAddressAuthorize) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().notIn(ModuleEntity::getEnCode, YunzhupaasConst.MODULE_CODE); + if (StringUtil.isNotEmpty(id)) { + queryWrapper.lambda().ne(ModuleEntity::getId, id); + } + if (mark == 1) { + queryWrapper.lambda().eq(ModuleEntity::getEnabledMark, mark); + } + if (moduleAuthorize != null && moduleAuthorize.size() > 0) { + queryWrapper.lambda().notIn(ModuleEntity::getId, moduleAuthorize); + } + if (moduleUrlAddressAuthorize != null && moduleUrlAddressAuthorize.size() > 0) { + queryWrapper.lambda().and(t -> t.notIn(ModuleEntity::getUrlAddress, moduleUrlAddressAuthorize).or() + .isNull(ModuleEntity::getUrlAddress)); + } + queryWrapper.lambda().orderByAsc(ModuleEntity::getSortCode).orderByDesc(ModuleEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public void getParentModule(List data, Map moduleEntityMap) { + data.forEach(t -> { + ModuleEntity moduleEntity = t; + while (moduleEntity != null) { + if (!moduleEntityMap.containsKey(moduleEntity.getId())) { + moduleEntityMap.put(moduleEntity.getId(), moduleEntity); + } + moduleEntity = this.getInfo(moduleEntity.getParentId()); + } + }); + } + + @Override + public List getListByUrlAddress(List ids, List urlAddressList) { + urlAddressList = urlAddressList.stream().filter(StringUtil::isNotEmpty).collect(Collectors.toList()); + if (ids.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(ModuleEntity::getId, ids); + if (urlAddressList.size() > 0) { + queryWrapper.lambda().or().in(ModuleEntity::getUrlAddress, urlAddressList); + } + List moduleCode = YunzhupaasConst.MODULE_CODE; + queryWrapper.lambda().notIn(ModuleEntity::getEnCode, moduleCode); + return this.list(queryWrapper); + } + + @Override + public ModuleNameVO getModuleNameList(String visualId) { + ModuleNameVO moduleNameVO = new ModuleNameVO(); + List moduleList = this.getModuleList(visualId); + QueryWrapper moduleWrapper = new QueryWrapper<>(); + // moduleWrapper.s(ModuleEntity::getId,ModuleEntity::getParentId,ModuleEntity::getSystemId,ModuleEntity::getFullName); + List listAll = this.list(moduleWrapper); + if (moduleList.size() > 0) { + List pcList = moduleList.stream() + .filter(module -> "web".equalsIgnoreCase(module.getCategory())).collect(Collectors.toList()); + List appList = moduleList.stream() + .filter(module -> "app".equalsIgnoreCase(module.getCategory())).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(pcList)) { + moduleNameVO.setPcIds(pcList.stream().map(ModuleEntity::getId).collect(Collectors.toList())); + StringJoiner joiner = new StringJoiner(";"); + for (ModuleEntity moduleEntity : pcList) { + List aa = new ArrayList<>(); + getName(moduleEntity.getId(), listAll, aa); + Collections.reverse(aa); + joiner.add(aa.stream().collect(Collectors.joining("/"))); + moduleNameVO.setPcNames(joiner.toString()); + } + } + if (CollectionUtils.isNotEmpty(appList)) { + moduleNameVO.setAppIds(appList.stream().map(ModuleEntity::getId).collect(Collectors.toList())); + StringJoiner joiner = new StringJoiner(";"); + for (ModuleEntity moduleEntity : appList) { + List aa = new ArrayList<>(); + getName(moduleEntity.getId(), listAll, aa); + Collections.reverse(aa); + joiner.add(aa.stream().collect(Collectors.joining("/"))); + moduleNameVO.setAppNames(joiner.toString()); + } + } + } + return moduleNameVO; + } + + private void getName(String id, List listAll, List str) { + for (ModuleEntity item : listAll) { + if (item.getId().equals(id)) { + str.add(item.getFullName()); + if (StringUtil.isNotEmpty(item.getParentId())) { + if (Objects.equals("-1", item.getParentId())) { + SystemEntity info = systemService.getInfo(item.getSystemId()); + if (info != null) { + str.add(info.getFullName()); + } + } else { + getName(item.getParentId(), listAll, str); + } + } + } + } + } + + @Override + public List getFormMenuList(ModulePagination pagination) { + MPJLambdaWrapper wrapper = JoinWrappers.lambda(ModuleEntity.class); + wrapper.selectAs(ModuleEntity::getId, ModuleSelectorVo::getId); + wrapper.selectAs(ModuleEntity::getPropertyJson, ModuleSelectorVo::getPropertyJson); + wrapper.selectAs(ModuleEntity::getFullName, ModuleSelectorVo::getFullName); + wrapper.selectAs(ModuleEntity::getEnCode, ModuleSelectorVo::getEnCode); + wrapper.selectAs(ModuleEntity::getType, ModuleSelectorVo::getType); + wrapper.selectAs(SystemEntity::getFullName, ModuleSelectorVo::getSystemName); + wrapper.leftJoin(SystemEntity.class, SystemEntity::getId, ModuleEntity::getSystemId); + wrapper.eq(ModuleEntity::getEnabledMark, 1); + List typeList = ImmutableList.of(3, 9); + wrapper.in(ModuleEntity::getType, typeList); + wrapper.eq(ModuleEntity::getCategory, "Web"); + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + wrapper.and(t -> { + t.like(SystemEntity::getFullName, pagination.getKeyword()).or(); + t.like(ModuleEntity::getFullName, pagination.getKeyword()).or(); + t.like(ModuleEntity::getEnCode, pagination.getKeyword()).or(); + }); + } + if (ObjectUtil.isNotEmpty(pagination.getSystemId())) { + wrapper.eq(SystemEntity::getId, pagination.getSystemId()); + } + // 过滤掉开发平台 + wrapper.ne(SystemEntity::getEnCode, YunzhupaasConst.MAIN_SYSTEM_CODE); + wrapper.orderByDesc(ModuleEntity::getCreatorTime); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + Page data = this.selectJoinListPage(page, ModuleSelectorVo.class, wrapper); + return pagination.setData(data.getRecords(), page.getTotal()); + } + + /** + * 获取应用菜单列表 + * + * @return + */ + @Override + public List getSystemMenu(Integer type, List webType, List categorys) { + List moduleAuthorize = new ArrayList<>(); + List moduleUrlAddressAuthorize = new ArrayList<>(); + if (configValueUtil.isMultiTenancy()) { + TenantAuthorizeModel tenantAuthorizeModel = TenantDataSourceUtil + .getCacheModuleAuthorize(UserProvider.getUser().getTenantId()); + moduleAuthorize = tenantAuthorizeModel.getModuleIdList(); + moduleUrlAddressAuthorize = tenantAuthorizeModel.getUrlAddressList(); + } + List systemList = systemService.getList(null, false, false, true, false, moduleAuthorize); + List menuList = this.getList(false, moduleAuthorize, moduleUrlAddressAuthorize); + // 菜单根据系统分组 + Map> menuGroup = menuList.stream() + .collect(Collectors.groupingBy(ma -> ma.getSystemId())); + + List menuvo = new ArrayList<>(); + for (SystemEntity systemEntity : systemList) { + MenuSelectAllVO systemVo = JsonUtil.getJsonToBean(systemEntity, MenuSelectAllVO.class); + List moduleEntityList = menuGroup.get(systemEntity.getId()); + boolean hasChildren = false; + if (CollectionUtils.isNotEmpty(moduleEntityList)) { + List menuVoList = new ArrayList<>(); + for (ModuleEntity item : moduleEntityList) { + String propertyJson = item.getPropertyJson(); + PropertyJsonModel pjm = JsonUtil.getJsonToBean(propertyJson, PropertyJsonModel.class); + if (Objects.equals(type, item.getType()) && webType.contains(pjm.getWebType()) + && categorys.contains(item.getCategory().toLowerCase())) { + menuVoList.add(JsonUtil.getJsonToBean(item, MenuSelectAllVO.class)); + } + } + if (CollectionUtils.isNotEmpty(menuVoList)) { + hasChildren = true; + systemVo.setHasChildren(hasChildren); + systemVo.setChildren(menuVoList); + } + } + if (hasChildren) + menuvo.add(systemVo); + } + return menuvo; + } +} diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/PortalManageServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/PortalManageServiceImpl.java new file mode 100644 index 0000000..531eed1 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/PortalManageServiceImpl.java @@ -0,0 +1,148 @@ +package com.yunzhupaas.base.service.impl; + +import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.entity.PortalManageEntity; +import com.yunzhupaas.base.entity.SystemEntity; +import com.yunzhupaas.base.mapper.PortalManageMapper; +import com.yunzhupaas.base.model.portalManage.PortalManagePage; +import com.yunzhupaas.base.model.portalManage.PortalManagePageDO; +import com.yunzhupaas.base.model.portalManage.PortalManagePrimary; +import com.yunzhupaas.base.model.portalManage.PortalManageVO; +import com.yunzhupaas.base.service.DictionaryDataService; +import com.yunzhupaas.base.service.PortalManageService; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.base.service.SystemService; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.StringUtil; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + + +/** + *

+ * 门户管理 服务实现类 + *

+ * + * @author + * @since 2023-02-16 + */ +@Service +public class PortalManageServiceImpl extends SuperServiceImpl implements PortalManageService { + + @Autowired + private UserService userService; + @Autowired + private PortalManageMapper portalManageMapper; + @Autowired + private DictionaryDataService dictionaryDataService; + @Autowired + private SystemService systemService; + + @Override + public void checkCreUp(PortalManageEntity creUpEntity) throws Exception{ + // 当ID为空时,为添加方法 + PortalManagePrimary primary = new PortalManagePrimary( + creUpEntity.getPlatform(), + creUpEntity.getPortalId(), + creUpEntity.getSystemId()); + if(creUpEntity.getId() == null){ + if(count(primary.getQuery()) > 0) throw new Exception("此系统与平台下门户已存在"); + } +// if(creUpEntity.getHomePageMark() == 1) { +// primary.getQuery().lambda().eq(PortalManageEntity::getEnabledMark, 1); +// PortalManageEntity one = getOne(primary.getQuery()); +// if(one != null && !one.getId().equals(creUpEntity.getId())){ +// throw new Exception("已存在默认首页,不允许被保存"); +// } +// } + } + + @Override + public PortalManageVO convertVO(PortalManageEntity entity){ + PortalManageVO vo = new PortalManageVO(); + BeanUtils.copyProperties(entity, vo); + vo.setId(entity.getId()); // 父类id声明泛型,会拷贝失败 + // 创建人 + UserEntity creatorUser = userService.getInfo(entity.getCreatorUserId()); + vo.setCreatorUser(creatorUser != null ? creatorUser.getRealName() + "/" + creatorUser.getAccount() : entity.getCreatorUserId()); + // 修改人 + UserEntity lastModifyUser = userService.getInfo(entity.getCreatorUserId()); + vo.setLastModifyUser(lastModifyUser != null ? lastModifyUser.getRealName() + "/" + lastModifyUser.getAccount() : ""); + // 门户名称 + vo.setFullName(portalManageMapper.getPortalFullName(entity.getPortalId())); + String categoryId = portalManageMapper.getPortalCategoryId(entity.getPortalId()); + DictionaryDataEntity dicInfo = dictionaryDataService.getInfo(portalManageMapper.getPortalCategoryId(entity.getPortalId())); + String categoryName = dicInfo==null ?"":dicInfo.getFullName(); + vo.setCategoryId(categoryId); + vo.setCategoryName(categoryName); + + vo.setPlatform(entity.getPlatform()); + vo.setSystemId(entity.getSystemId()); + return vo; + } + + @Override + public List getList(PortalManagePrimary primary) { + return list(primary.getQuery()).stream().map(this::convertVO).collect(Collectors.toList()); + } + + @Override + public List getListByEnable(PortalManagePrimary primary) { + primary.getQuery().lambda().eq(PortalManageEntity::getEnabledMark, 1); + return getList(primary); + } + + @Override + public PageDTO getPage(PortalManagePage pmPage) { + String keyword = pmPage.getKeyword(); + if (StringUtil.isNotEmpty(keyword)) { + pmPage.setKeyword("%" + keyword + "%"); + } + PageDTO pageDto = portalManageMapper.selectPortalManageDoPage(pmPage.getPageDto(), pmPage); + pmPage.setTotal(pageDto.getTotal()); + return pageDto; + } + + @Override + public List getSelectList(PortalManagePage pmPage) { + List list = portalManageMapper.selectPortalManageDoList(pmPage); + return list; + } + + @Override + public List selectPortalBySystemIds(List systemIds, List collect) { + if (collect == null) { + return new ArrayList<>(); + } + if (systemIds.size() == 0) { + systemIds.add(""); + } + return portalManageMapper.selectPortalBySystemIds(systemIds, collect); + } + + @Override + public void createBatch(List primaryLit) throws Exception { + List list = new ArrayList<>(); + for (PortalManagePrimary primary : primaryLit) { + if(list(primary.getQuery()).size() < 1){ + PortalManageEntity entity = primary.getEntity(); + SystemEntity info = systemService.getInfo(entity.getSystemId()); + if(info == null){ + throw new WorkFlowException("找不到该应用"); + } + list.add(primary.getEntity()); + } + } + saveBatch(list); + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/PrintDevServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/PrintDevServiceImpl.java new file mode 100644 index 0000000..9b75d31 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/PrintDevServiceImpl.java @@ -0,0 +1,504 @@ +package com.yunzhupaas.base.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.*; +import com.yunzhupaas.base.mapper.PrintDevMapper; +import com.yunzhupaas.base.model.dataset.DataSetForm; +import com.yunzhupaas.base.model.dataset.DataSetInfo; +import com.yunzhupaas.base.model.dataset.DataSetPagination; +import com.yunzhupaas.base.model.dataset.TableTreeModel; +import com.yunzhupaas.base.model.print.*; +import com.yunzhupaas.base.model.vo.PrintDevVO; +import com.yunzhupaas.base.service.*; +import com.yunzhupaas.base.util.dataSet.DataSetSwapUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.emnus.DataSetTypeEnum; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.flowable.entity.RecordEntity; +import com.yunzhupaas.model.login.UserSystemVO; +import com.yunzhupaas.permission.entity.AuthorizeEntity; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.AuthorizeService; +import com.yunzhupaas.permission.service.PermissionGroupService; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import com.yunzhupaas.util.enums.DictionaryDataEnum; +import com.yunzhupaas.util.treeutil.SumTree; +import com.yunzhupaas.util.treeutil.newtreeutil.TreeDotUtils; +import com.yunzhupaas.workflow.service.TaskApi; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 打印模板-服务实现类 + * + * @author 云筑产品开发平台组 YY + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-30 + */ +@Service +public class PrintDevServiceImpl extends SuperServiceImpl implements PrintDevService { + + @Autowired + private PrintVersionService printVersionService; + + @Autowired + private DictionaryDataService dictionaryDataService; + @Autowired + private DictionaryTypeService dictionaryTypeService; + @Autowired + private UserService userService; + @Autowired + private DataSetService dataSetService; + @Autowired + private TaskApi taskApi; + @Autowired + private DataSetSwapUtil dataSetSwapUtil; + @Autowired + private AuthorizeService authorizeService; + @Autowired + private PermissionGroupService permissionGroupService; + @Autowired + private DataInterfaceService dataInterfaceService; + + @Override + public List getList(PaginationPrint paginationPrint) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(paginationPrint.getKeyword())) { + queryWrapper.lambda().and( + t -> t.like(PrintDevEntity::getFullName, paginationPrint.getKeyword()) + .or().like(PrintDevEntity::getEnCode, paginationPrint.getKeyword()) + ); + } + if (StringUtil.isNotEmpty(paginationPrint.getCategory())) { + queryWrapper.lambda().eq(PrintDevEntity::getCategory, paginationPrint.getCategory()); + } + if (paginationPrint.getState() != null) { + queryWrapper.lambda().eq(PrintDevEntity::getState, paginationPrint.getState()); + } + + queryWrapper.lambda().orderByAsc(PrintDevEntity::getSortCode).orderByDesc(PrintDevEntity::getCreatorTime); + Page page = new Page<>(paginationPrint.getCurrentPage(), paginationPrint.getPageSize()); + IPage iPage = this.page(page, queryWrapper); + return paginationPrint.setData(iPage.getRecords(), page.getTotal()); + } + + @Override + public void create(PrintDevFormDTO dto) { + PrintDevEntity entity = JsonUtil.getJsonToBean(dto, PrintDevEntity.class); + UserInfo userInfo = UserProvider.getUser(); + // 校验 + this.creUpdateCheck(entity, true, true); + String id = StringUtil.isNotEmpty(entity.getId()) ? entity.getId() : RandomUtil.uuId(); + entity.setId(id); + entity.setState(0); + entity.setCreatorUserId(userInfo.getUserId()); + entity.setCreatorTime(new Date()); + entity.setLastModifyUserId(null); + entity.setLastModifyTime(null); + this.setIgnoreLogicDelete().removeById(entity.getId()); + this.setIgnoreLogicDelete().saveOrUpdate(entity); + this.clearIgnoreLogicDelete(); + dto.setId(id); + List list = printVersionService.getList(id); + if (CollectionUtils.isEmpty(list)) { + printVersionService.create(dto); + } + } + + @Override + public PrintDevInfoVO getVersionInfo(String versionId) { + PrintVersionEntity versionEntity = printVersionService.getById(versionId); + PrintDevEntity entity = this.getById(versionEntity.getTemplateId()); + PrintDevInfoVO vo = JsonUtil.getJsonToBean(entity, PrintDevInfoVO.class); + vo.setVersionId(versionId); + vo.setPrintTemplate(versionEntity.getPrintTemplate()); + vo.setConvertConfig(versionEntity.getConvertConfig()); + List list = dataSetService.getList(new DataSetPagination(DataSetTypeEnum.PRINT_VER.getCode(), versionId)); + List dataSetInfoList = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(list)) { + for (DataSetEntity item : list) { + DataSetInfo bean = JsonUtil.getJsonToBean(item, DataSetInfo.class); + try { + SumTree printTableFields = dataSetService.getTabFieldStruct(item); + bean.setChildren(printTableFields.getChildren()); + dataSetInfoList.add(bean); + } catch (Exception e) { + e.printStackTrace(); + } + if (Objects.equals(item.getType(), 3)) { + DataInterfaceEntity info = dataInterfaceService.getInfo(item.getInterfaceId()); + if (info != null) { + bean.setTreePropsName(info.getFullName()); + } + } + } + } + vo.setDataSetList(dataSetInfoList); + return vo; + } + + @Override + @Transactional + public void saveOrRelease(PrintDevUpForm form) { + PrintDevEntity entity = this.getById(form.getId()); + PrintVersionEntity versionNew = printVersionService.getById(form.getVersionId()); + //已归档 + boolean isDossier = false; + if (Objects.equals(versionNew.getState(), 2) || Objects.equals(versionNew.getState(), 1)) { + isDossier = !isDossier; + } + //发布 + if (Objects.equals(form.getType(), 1)) { + //修改版本状态 + if (StringUtil.isNotEmpty(form.getVersionId())) { + PrintVersionEntity info = printVersionService.getList(form.getId()).stream().filter(t -> Objects.equals(t.getState(), 1)).findFirst().orElse(null); + if (info != null) { + // 变更归档状态,排序码 + info.setSortCode(0L); + info.setState(2); + printVersionService.updateById(info); + } + versionNew.setState(1); + versionNew.setSortCode(1L); + //已发布 + if (Objects.equals(entity.getState(), 0)) { + entity.setState(1); + } + } + } + //已归档不修改设计内容和数据集内容 + if (!isDossier) { + versionNew.setPrintTemplate(form.getPrintTemplate()); + versionNew.setConvertConfig(form.getConvertConfig()); + //数据集创建 + String versionId = versionNew.getId(); + List dataSetList = form.getDataSetList() != null ? form.getDataSetList() : new ArrayList<>(); + dataSetService.create(dataSetList, DataSetTypeEnum.PRINT_VER.getCode(), versionId); + } + printVersionService.updateById(versionNew); + + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + this.updateById(entity); + } + + + @Override + public List getTreeModel(String category) { + QueryWrapper query = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(category)) { + query.lambda().eq(PrintDevEntity::getCategory, category); + } + query.lambda().eq(PrintDevEntity::getState, 1); + + //不是通用 + query.lambda().and(t -> t.eq(PrintDevEntity::getCommonUse, 0).or().isNull(PrintDevEntity::getCommonUse)); + + query.lambda().orderByAsc(PrintDevEntity::getSortCode).orderByDesc(PrintDevEntity::getCreatorTime); + List printEntityList = this.list(query); + return setTreeModel(printEntityList); + } + + private List setTreeModel(List printEntityList) { + //数据字典缺失 + DictionaryTypeEntity DictionaryType = dictionaryTypeService.getInfoByEnCode(DictionaryDataEnum.SYSTEM_PRINTDEV.getDictionaryTypeId()); + if (DictionaryType == null) { + throw new DataException(MsgCode.PRI002.get()); + } + List dicDataList = dictionaryDataService. + getList(DictionaryType.getId()); + List modelAll = new LinkedList<>(); + //设置树形主节点(不显示没有子集的) + for (DictionaryDataEntity dicEntity : dicDataList) { + PrintDevTreeModel model = new PrintDevTreeModel(); + model.setFullName(dicEntity.getFullName()); + model.setId(dicEntity.getId()); + Long num = printEntityList.stream().filter(t -> t.getCategory().equals(dicEntity.getId())).count(); + //编码底下存在的子节点总数 + if (num > 0) { + model.setNum(Integer.parseInt(num.toString())); + modelAll.add(model); + } + } + List userId = new ArrayList<>(); + printEntityList.forEach(t -> { + userId.add(t.getCreatorUserId()); + if (StringUtil.isNotEmpty(t.getLastModifyUserId())) { + userId.add(t.getLastModifyUserId()); + } + }); + List userList = userService.getUserName(userId); + //设置子节点分支 + for (PrintDevEntity printEntity : printEntityList) { + DictionaryDataEntity dicDataEntity = dicDataList.stream() + .filter(t -> t.getId().equals(printEntity.getCategory())).findFirst().orElse(null); + //如果字典存在则装入容器 + PrintDevTreeModel model = JsonUtil.getJsonToBean(printEntity, PrintDevTreeModel.class); + if (dicDataEntity != null) { + //创建者 + UserEntity creatorUser = userList.stream().filter(t -> t.getId().equals(model.getCreatorUser())).findFirst().orElse(null); + model.setCreatorUser(creatorUser != null ? creatorUser.getRealName() + "/" + creatorUser.getAccount() : ""); + //修改人 + UserEntity lastmodifyuser = userList.stream().filter(t -> t.getId().equals(model.getLastModifyUser())).findFirst().orElse(null); + model.setLastModifyUser(lastmodifyuser != null ? lastmodifyuser.getRealName() + "/" + lastmodifyuser.getAccount() : ""); + + model.setParentId(dicDataEntity.getId()); + modelAll.add(model); + } + } + List> trees = TreeDotUtils.convertListToTreeDot(modelAll); + List list = JsonUtil.getJsonToList(trees, PrintDevVO.class); + return list; + } + + @Override + public void creUpdateCheck(PrintDevEntity printDevEntity, Boolean fullNameCheck, Boolean encodeCheck) { + String fullName = printDevEntity.getFullName(); + String encode = printDevEntity.getEnCode(); + // 名称长度验证 + if (fullName.length() > 80) { + throw new DataException(MsgCode.EXIST005.get()); + } + QueryWrapper query = new QueryWrapper<>(); + //重名验证 + if (fullNameCheck) { + query.lambda().eq(PrintDevEntity::getFullName, fullName); + if (this.list(query).size() > 0) { + throw new DataException(MsgCode.EXIST003.get()); + } + } + //编码验证 + if (encodeCheck) { + query.clear(); + query.lambda().eq(PrintDevEntity::getEnCode, encode); + if (this.list(query).size() > 0) { + throw new DataException(MsgCode.EXIST002.get()); + } + } + } + + @Override + public List getPrintTemplateOptions(List ids) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().in(PrintDevEntity::getId, ids); + List list = this.list(wrapper); + List options = JsonUtil.getJsonToList(list, PrintOption.class); + return options; + } + + + @Override + @Transactional + public String importData(PrintDevInfoVO infoVO, Integer type) { + PrintDevEntity entity = JsonUtil.getJsonToBean(infoVO, PrintDevEntity.class); + StringJoiner stringJoiner = new StringJoiner("、"); + //id为空切名称不存在时 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(PrintDevEntity::getId, entity.getId()); + if (this.getById(infoVO.getId()) != null) { + if (Objects.equals(type, 0)) { + stringJoiner.add("ID"); + } else { + entity.setId(RandomUtil.uuId()); + } + } + queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(PrintDevEntity::getEnCode, entity.getEnCode()); + if (this.count(queryWrapper) > 0) { + stringJoiner.add(MsgCode.IMP009.get()); + } + queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(PrintDevEntity::getFullName, entity.getFullName()); + if (this.count(queryWrapper) > 0) { + stringJoiner.add(MsgCode.IMP008.get()); + } + if (stringJoiner.length() > 0 && ObjectUtil.equal(type, 1)) { + String copyNum = UUID.randomUUID().toString().substring(0, 5); + entity.setFullName(entity.getFullName() + ".副本" + copyNum); + entity.setEnCode(entity.getEnCode() + copyNum); + } else if (ObjectUtil.equal(type, 0) && stringJoiner.length() > 0) { + return stringJoiner.toString() + MsgCode.IMP007.get(); + } + entity.setState(0); + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(UserProvider.getLoginUserId()); + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + this.setIgnoreLogicDelete().removeById(entity); + this.setIgnoreLogicDelete().saveOrUpdate(entity); + this.clearIgnoreLogicDelete(); + //版本添加 + PrintVersionEntity versionEntity = new PrintVersionEntity(); + String versionId = RandomUtil.uuId(); + versionEntity.setId(versionId); + versionEntity.setTemplateId(entity.getId()); + versionEntity.setCreatorUserId(UserProvider.getUser().getUserId()); + versionEntity.setCreatorTime(new Date()); + versionEntity.setPrintTemplate(infoVO.getPrintTemplate()); + versionEntity.setConvertConfig(infoVO.getConvertConfig()); + versionEntity.setVersion(1); + versionEntity.setState(0); + versionEntity.setSortCode(0l); + printVersionService.save(versionEntity); + //数据集创建 + List dataSetList = infoVO.getDataSetList() != null ? JsonUtil.getJsonToList(infoVO.getDataSetList(), DataSetForm.class) : new ArrayList<>(); + dataSetList.stream().forEach(t -> t.setId(null)); + dataSetService.create(dataSetList, DataSetTypeEnum.PRINT_VER.getCode(), versionId); + return ""; + } + + + @Override + public List getFlowTaskOperatorRecordList(String taskId) { + List operatorRecordList = new ArrayList<>(); + if (StringUtil.isEmpty(taskId)) { + return operatorRecordList; + } + try { + // TODO 不同库之间的表名大小写问题 +// String sql = "SELECT * FROM workflow_record WHERE f_task_id = ? ORDER BY f_handle_time"; +// operatorRecordList = JdbcUtil.queryCustomMods(new PrepSqlDTO(sql, taskId).withConn(dataSourceUtil, null), OperatorRecordEntity.class); + List recordList = taskApi.getRecordList(taskId); + operatorRecordList = JsonUtil.getJsonToList(recordList, OperatorRecordEntity.class); + //已办人员 + operatorRecordList.forEach(or -> { +// or.setHandleTime(or.getHandleTimeOrigin().getTime()); + UserEntity userEntity = userService.getInfo(or.getHandleId()); + or.setUserName(userEntity != null ? userEntity.getRealName() + "/" + userEntity.getAccount() : ""); + or.setHandleStatus(or.getHandleType()); + }); + } catch (Exception e) { + e.getMessage(); + } + return operatorRecordList; + } + + @Override + public Map getDataMap(String templateId, String formId, String flwoTaskId, Map params) { + List versionList = printVersionService.getList(templateId); + if (CollectionUtils.isEmpty(versionList)) { + throw new DataException(MsgCode.PRI001.get()); + } + //启用中的版本 + PrintVersionEntity startVersion = versionList.get(0); + Map dataMap = new HashMap<>(16); + dataMap.put("printTemplate", startVersion.getPrintTemplate()); + String convertConfig = startVersion.getConvertConfig(); + dataMap.put("convertConfig", startVersion.getConvertConfig()); + + List operatorRecordList = this.getFlowTaskOperatorRecordList(flwoTaskId); + dataMap.put("operatorRecordList", operatorRecordList); + + Map printData = new HashMap<>(16); + List list = dataSetService.getList(new DataSetPagination(DataSetTypeEnum.PRINT_VER.getCode(), startVersion.getId())); + for (DataSetEntity item : list) { + Map dataMapOrList = dataSetService.getDataMapOrList(item, params, formId, false); + dataSetSwapUtil.swapData(templateId, convertConfig, dataMapOrList); + printData.putAll(dataMapOrList); + } + dataMap.put("printData", printData); + return dataMap; + } + + @Override + public void copyPrintdev(String templateId) { + PrintDevEntity entity = this.getById(templateId); + String copyNum = UUID.randomUUID().toString().substring(0, 5); + String fullName = entity.getFullName() + ".副本" + copyNum; + if (fullName.length() > 50) { + throw new DataException(MsgCode.PRI006.get()); + } + PrintDevFormDTO form = JsonUtil.getJsonToBean(entity, PrintDevFormDTO.class); + form.setId(RandomUtil.uuId()); + form.setFullName(fullName); + form.setEnCode(entity.getEnCode() + copyNum); + + List list = printVersionService.getList(templateId); + if (CollectionUtils.isNotEmpty(list)) { + PrintVersionEntity versionEntity = list.get(0); + form.setPrintTemplate(versionEntity.getPrintTemplate()); + form.setConvertConfig(versionEntity.getConvertConfig()); + List dst = dataSetService.getList(new DataSetPagination(DataSetTypeEnum.PRINT_VER.getCode(), versionEntity.getId())); + List dataSetFormList = new ArrayList<>(); + for (DataSetEntity item : dst) { + DataSetForm dataSetForm = JsonUtil.getJsonToBean(item, DataSetForm.class); + dataSetForm.setId(null); + dataSetFormList.add(dataSetForm); + } + form.setDataSetList(dataSetFormList); + } + this.create(form); + } + + @Override + public List getWorkSelector(PaginationPrint pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + queryWrapper.lambda().and( + t -> t.like(PrintDevEntity::getFullName, pagination.getKeyword()) + .or().like(PrintDevEntity::getEnCode, pagination.getKeyword()) + ); + } + if (StringUtil.isNotEmpty(pagination.getCategory())) { + queryWrapper.lambda().eq(PrintDevEntity::getCategory, pagination.getCategory()); + } + + //是发布 + queryWrapper.lambda().eq(PrintDevEntity::getState, 1); + //是通用 + queryWrapper.lambda().eq(PrintDevEntity::getCommonUse, 1); + + if (Objects.nonNull(pagination.getVisibleType())) { + queryWrapper.lambda().eq(PrintDevEntity::getVisibleType, pagination.getVisibleType()); + } else { + //权限判断 + if(authorizeService.getUserCurrentStanding(UserProvider.getUser().getUserId(),3)) { + List authList = new ArrayList<>(); + List roleIdList = new ArrayList<>(); + permissionGroupService.getPermissionGroupByUserId(UserProvider.getLoginUserId(), null, true, null).forEach(t -> { + roleIdList.add(t.getId()); + }); + authList.addAll(authorizeService.getListByRoleIdsAndItemType(roleIdList, "print").stream().map(AuthorizeEntity::getItemId).collect(Collectors.toList())); + queryWrapper.lambda().and( + t -> t.eq(PrintDevEntity::getVisibleType, 1).or().in(!authList.isEmpty(), PrintDevEntity::getId, authList) + ); + } + } + + queryWrapper.lambda().orderByAsc(PrintDevEntity::getSortCode).orderByDesc(PrintDevEntity::getCreatorTime); + if (Objects.equals(pagination.getDataType(), 1)) { + return this.list(queryWrapper); + } + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage iPage = this.page(page, queryWrapper); + return pagination.setData(iPage.getRecords(), page.getTotal()); + } + + @Override + public List getWorkSelector(List id) { + List list = new ArrayList<>(); + if(ObjectUtil.isNotEmpty(id)){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(PrintDevEntity::getId,id); + queryWrapper.lambda().orderByAsc(PrintDevEntity::getSortCode).orderByDesc(PrintDevEntity::getCreatorTime); + list = this.list(queryWrapper); + } + return list; + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/PrintLogServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/PrintLogServiceImpl.java new file mode 100644 index 0000000..a6f6073 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/PrintLogServiceImpl.java @@ -0,0 +1,48 @@ +package com.yunzhupaas.base.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.yunzhupaas.base.PaginationTime; +import com.yunzhupaas.base.entity.PrintLogEntity; +import com.yunzhupaas.base.mapper.PrintLogMapper; +import com.yunzhupaas.base.model.vo.PrintLogVO; +import com.yunzhupaas.base.service.PrintLogService; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.permission.entity.UserEntity; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +@Service +public class PrintLogServiceImpl extends SuperServiceImpl implements PrintLogService { + + @Override + public List list(String printId, PaginationTime paginationTime) { + MPJLambdaWrapper wrapper = new MPJLambdaWrapper<>(PrintLogEntity.class) + .leftJoin(UserEntity.class, UserEntity::getId, PrintLogEntity::getCreatorUserId) + .selectAll(PrintLogEntity.class) + .select(UserEntity::getAccount, UserEntity::getRealName) + .selectAs(PrintLogEntity::getCreatorTime, PrintLogVO::getCreatorTime); + if (!ObjectUtil.isEmpty(paginationTime.getStartTime()) && !ObjectUtil.isEmpty(paginationTime.getEndTime())) { + wrapper.between(PrintLogEntity::getCreatorTime, new Date(paginationTime.getStartTime()), new Date(paginationTime.getEndTime())); + } + if (!ObjectUtil.isEmpty(printId)) { + wrapper.eq(PrintLogEntity::getPrintId, printId); + } + if (!ObjectUtil.isEmpty(paginationTime.getKeyword())) { + wrapper.and( + t -> t.like(UserEntity::getRealName, paginationTime.getKeyword()) + .or().like(UserEntity::getAccount, paginationTime.getKeyword()) + .or().like(PrintLogEntity::getPrintTitle, paginationTime.getKeyword()) + ); + } + Page page = new Page<>(paginationTime.getCurrentPage(), paginationTime.getPageSize()); + IPage userPage = this.selectJoinListPage(page, PrintLogVO.class, wrapper); + List printLogModels = paginationTime.setData(userPage.getRecords(), page.getTotal()); + return printLogModels; + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/PrintVersionServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/PrintVersionServiceImpl.java new file mode 100644 index 0000000..4bf17ea --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/PrintVersionServiceImpl.java @@ -0,0 +1,114 @@ +package com.yunzhupaas.base.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.entity.DataSetEntity; +import com.yunzhupaas.base.entity.PrintVersionEntity; +import com.yunzhupaas.base.mapper.PrintVersionMapper; +import com.yunzhupaas.base.model.dataset.DataSetForm; +import com.yunzhupaas.base.model.dataset.DataSetPagination; +import com.yunzhupaas.base.model.print.PrintDevFormDTO; +import com.yunzhupaas.base.service.DataSetService; +import com.yunzhupaas.base.service.PrintVersionService; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.emnus.DataSetTypeEnum; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.Date; +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version v5.0.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/5/6 14:07:11 + */ +@Service +public class PrintVersionServiceImpl extends SuperServiceImpl implements PrintVersionService { + + + + @Autowired + private DataSetService dataSetService; + + @Override + @Transactional + public void create(PrintDevFormDTO dto) { + String versionId = RandomUtil.uuId(); + PrintVersionEntity entity = new PrintVersionEntity(); + entity.setId(versionId); + entity.setTemplateId(dto.getId()); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + entity.setCreatorTime(new Date()); + entity.setPrintTemplate(dto.getPrintTemplate()); + entity.setConvertConfig(dto.getConvertConfig()); + List verList = getList(entity.getId()); + int version = verList.stream().map(PrintVersionEntity::getVersion).max(Comparator.naturalOrder()).orElse(0) + 1; + entity.setVersion(version); + entity.setState(0); + entity.setSortCode(0l); + this.setIgnoreLogicDelete().removeById(entity.getId()); + this.setIgnoreLogicDelete().saveOrUpdate(entity); + this.clearIgnoreLogicDelete(); + //数据集创建 + List dataSetList = dto.getDataSetList() != null ? dto.getDataSetList() : new ArrayList<>(); + dataSetService.create(dataSetList, DataSetTypeEnum.PRINT_VER.getCode(), versionId); + } + + @Override + public List getList(String templateId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(PrintVersionEntity::getTemplateId, templateId); + queryWrapper.lambda().orderByDesc(PrintVersionEntity::getSortCode).orderByAsc(PrintVersionEntity::getState); + return this.list(queryWrapper); + } + + @Override + public String copyVersion(String versionId) { + PrintVersionEntity entity = this.getById(versionId); + PrintVersionEntity versionEntity = BeanUtil.copyProperties(entity, PrintVersionEntity.class); + String newVersionId = RandomUtil.uuId(); + versionEntity.setId(newVersionId); + List verList = getList(entity.getTemplateId()); + int version = verList.stream().map(PrintVersionEntity::getVersion).max(Comparator.naturalOrder()).orElse(0) + 1; + versionEntity.setVersion(version); + versionEntity.setState(0); + versionEntity.setSortCode(0l); + versionEntity.setCreatorTime(new Date()); + versionEntity.setCreatorUserId(UserProvider.getUser().getUserId()); + versionEntity.setLastModifyTime(null); + versionEntity.setLastModifyUserId(null); + List dataSetList = dataSetService.getList(new DataSetPagination(DataSetTypeEnum.PRINT_VER.getCode(), versionId)); + for (DataSetEntity item : dataSetList) { + item.setId(RandomUtil.uuId()); + item.setObjectType(DataSetTypeEnum.PRINT_VER.getCode()); + item.setObjectId(newVersionId); + item.setCreatorTime(new Date()); + item.setCreatorUserId(UserProvider.getUser().getUserId()); + item.setLastModifyTime(null); + item.setLastModifyUserId(null); + dataSetService.save(item); + } + this.save(versionEntity); + return newVersionId; + } + + @Override + public void removeByTemplateId(String templateId) { + List list = this.getList(templateId); + for(PrintVersionEntity item :list){ + QueryWrapper dataSetWrapper = new QueryWrapper<>(); + dataSetWrapper.lambda().eq(DataSetEntity::getObjectType, DataSetTypeEnum.PRINT_VER.getCode()); + dataSetWrapper.lambda().eq(DataSetEntity::getObjectId, templateId); + dataSetService.remove(dataSetWrapper); + this.removeById(item); + } + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ProvinceAtlasServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ProvinceAtlasServiceImpl.java new file mode 100644 index 0000000..918926b --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ProvinceAtlasServiceImpl.java @@ -0,0 +1,51 @@ +package com.yunzhupaas.base.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.entity.ProvinceAtlasEntity; +import com.yunzhupaas.base.mapper.ProvinceAtlasMapper; +import com.yunzhupaas.base.service.ProvinceAtlasService; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.util.StringUtil; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 行政区划 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2023/09/27 + */ +@Service +public class ProvinceAtlasServiceImpl extends SuperServiceImpl implements ProvinceAtlasService { + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ProvinceAtlasEntity::getEnabledMark, 1); + return this.list(queryWrapper); + } + + @Override + public List getListByPid(String pid) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(pid)) { + queryWrapper.lambda().eq(ProvinceAtlasEntity::getParentId, pid); + }else{ + queryWrapper.lambda().eq(ProvinceAtlasEntity::getParentId, "-1"); + } + queryWrapper.lambda().eq(ProvinceAtlasEntity::getEnabledMark, 1); + return this.list(queryWrapper); + } + + @Override + public ProvinceAtlasEntity findOneByCode(String code) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ProvinceAtlasEntity::getEnCode, code); + queryWrapper.lambda().eq(ProvinceAtlasEntity::getEnabledMark, 1); + return this.getOne(queryWrapper); + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ProvinceServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ProvinceServiceImpl.java new file mode 100644 index 0000000..94befc9 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ProvinceServiceImpl.java @@ -0,0 +1,222 @@ +package com.yunzhupaas.base.service.impl; + + +import com.yunzhupaas.base.model.province.PaginationProvince; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yunzhupaas.base.Page; +import com.yunzhupaas.base.entity.ProvinceEntity; +import com.yunzhupaas.base.mapper.ProvinceMapper; +import com.yunzhupaas.base.service.ProvinceService; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import org.springframework.util.ObjectUtils; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Objects; + +/** + * 行政区划 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Service +public class ProvinceServiceImpl extends SuperServiceImpl implements ProvinceService { + + + + @Override + public boolean isExistByFullName(String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ProvinceEntity::getFullName, fullName); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(ProvinceEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public boolean isExistByEnCode(String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ProvinceEntity::getEnCode, enCode); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(ProvinceEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public List getList(String parentId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ProvinceEntity::getParentId, parentId); + // 排序 + queryWrapper.lambda().orderByDesc(ProvinceEntity::getCreatorTime); + return this.list(queryWrapper); + } + + + @Override + public List getList(String parentId, PaginationProvince page) { + // 定义变量判断是否需要使用修改时间倒序 + boolean flag = false; + QueryWrapper queryWrapper = new QueryWrapper<>(); + // 模糊查询 + if (Objects.nonNull(page) && StringUtil.isNotEmpty(page.getKeyword())) { + flag = true; + queryWrapper.lambda().and( + t->t.like(ProvinceEntity::getFullName, page.getKeyword()).or() + .like(ProvinceEntity::getEnCode, page.getKeyword()) + ); + } + if (page.getEnabledMark() != null) { + queryWrapper.lambda().eq(ProvinceEntity::getEnabledMark, page.getEnabledMark()); + } + queryWrapper.lambda().eq(ProvinceEntity::getParentId, parentId); + // 排序 + queryWrapper.lambda().orderByAsc(ProvinceEntity::getSortCode).orderByDesc(ProvinceEntity::getCreatorTime); + if (flag) { + queryWrapper.lambda().orderByDesc(ProvinceEntity::getLastModifyTime); + } + return this.list(queryWrapper); + } + + @Override + public List getAllList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().orderByDesc(ProvinceEntity::getSortCode).orderByAsc(ProvinceEntity::getCreatorTime); + + return this.list(queryWrapper); + } + + @Override + public List getProListBytype(String type) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(ProvinceEntity::getId,ProvinceEntity::getFullName).eq(ProvinceEntity::getType,type); + return this.list(queryWrapper); + } + + @Override + public List getProList(List ProIdList) { + if (ProIdList.size()>0){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(ProvinceEntity::getId,ProvinceEntity::getFullName).in(ProvinceEntity::getId,ProIdList); + return this.list(queryWrapper); + } + return new ArrayList<>(); + } + + + @Override + public ProvinceEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ProvinceEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public ProvinceEntity getInfo(String fullName,List parentId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ProvinceEntity::getFullName, fullName); + if (parentId.size() > 0) { + queryWrapper.lambda().in(ProvinceEntity::getParentId, parentId); + } + return this.getOne(queryWrapper); + } + + + @Override + public void delete(ProvinceEntity entity) { + this.removeById(entity.getId()); + } + + @Override + public void create(ProvinceEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + this.save(entity); + } + + @Override + public boolean update(String id, ProvinceEntity entity) { + + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + return this.updateById(entity); + } + + @Override + @DSTransactional + public boolean first(String id) { + boolean isOk = false; + //获取要上移的那条数据的信息 + ProvinceEntity upEntity = this.getById(id); + Long upSortCode = upEntity.getSortCode() == null ? 0 : upEntity.getSortCode(); + //查询上几条记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .lt(ProvinceEntity::getSortCode, upSortCode) + .eq(ProvinceEntity::getParentId, upEntity.getParentId()) + .orderByDesc(ProvinceEntity::getSortCode); + List downEntity = this.list(queryWrapper); + if (downEntity.size() > 0) { + //交换两条记录的sort值 + Long temp = upEntity.getSortCode(); + upEntity.setSortCode(downEntity.get(0).getSortCode()); + downEntity.get(0).setSortCode(temp); + updateById(downEntity.get(0)); + updateById(upEntity); + isOk = true; + } + return isOk; + } + + @Override + @DSTransactional + public boolean next(String id) { + boolean isOk = false; + //获取要下移的那条数据的信息 + ProvinceEntity downEntity = this.getById(id); + Long upSortCode = downEntity.getSortCode() == null ? 0 : downEntity.getSortCode(); + //查询下几条记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .gt(ProvinceEntity::getSortCode, upSortCode) + .eq(ProvinceEntity::getParentId, downEntity.getParentId()) + .orderByAsc(ProvinceEntity::getSortCode); + List upEntity = this.list(queryWrapper); + if (upEntity.size() > 0) { + //交换两条记录的sort值 + Long temp = downEntity.getSortCode(); + downEntity.setSortCode(upEntity.get(0).getSortCode()); + upEntity.get(0).setSortCode(temp); + updateById(upEntity.get(0)); + updateById(downEntity); + isOk = true; + } + return isOk; + } + + @Override + public List infoList(List lists) { + List list =new ArrayList<>(); + if(!ObjectUtils.isEmpty(lists)){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(ProvinceEntity::getId, lists); + list = this.list(queryWrapper); + } + return list; + + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ScheduleLogServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ScheduleLogServiceImpl.java new file mode 100644 index 0000000..43d6eb9 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ScheduleLogServiceImpl.java @@ -0,0 +1,76 @@ +package com.yunzhupaas.base.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.ScheduleLogEntity; +import com.yunzhupaas.base.mapper.ScheduleLogMapper; +import com.yunzhupaas.base.service.ScheduleLogService; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * 日程 + * + * @author 云筑产品开发平台组 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + */ +@Service +public class ScheduleLogServiceImpl extends SuperServiceImpl implements ScheduleLogService { + + + + + @Override + public List getListAll(List scheduleIdList) { + List list = new ArrayList<>(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + if(scheduleIdList.size()>0){ + queryWrapper.lambda().in(ScheduleLogEntity::getScheduleId,scheduleIdList); + queryWrapper.lambda().orderByDesc(ScheduleLogEntity::getCreatorTime); + list = this.list(queryWrapper); + } + return list; + } + + @Override + public ScheduleLogEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ScheduleLogEntity::getId,id); + return this.getOne(queryWrapper); + } + + @Override + public void create(ScheduleLogEntity entity) { + UserInfo userInfo = UserProvider.getUser(); + entity.setId(RandomUtil.uuId()); + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(userInfo.getUserId()); + this.save(entity); + } + + @Override + public void delete(List scheduleIdList, String operationType) { + List listAll = getListAll(scheduleIdList); + for (ScheduleLogEntity scheduleLogEntity : listAll) { + scheduleLogEntity.setOperationType(operationType); + create(scheduleLogEntity); + } + } + + @Override + public boolean update(String id, ScheduleLogEntity entity) { + entity.setId(id); + boolean flag = this.updateById(entity); + return flag; + } + + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ScheduleNewServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ScheduleNewServiceImpl.java new file mode 100644 index 0000000..060972c --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ScheduleNewServiceImpl.java @@ -0,0 +1,499 @@ +package com.yunzhupaas.base.service.impl; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.ScheduleLogEntity; +import com.yunzhupaas.base.entity.ScheduleNewEntity; +import com.yunzhupaas.base.entity.ScheduleNewUserEntity; +import com.yunzhupaas.base.mapper.ScheduleNewMapper; +import com.yunzhupaas.base.model.schedule.ScheduleDetailModel; +import com.yunzhupaas.base.model.schedule.ScheduleJobModel; +import com.yunzhupaas.base.model.schedule.ScheduleNewTime; +import com.yunzhupaas.base.service.ScheduleLogService; +import com.yunzhupaas.base.service.ScheduleNewService; +import com.yunzhupaas.base.service.ScheduleNewUserService; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.base.util.SentMessageUtil; +import com.yunzhupaas.base.util.job.ScheduleJobUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.message.model.SentMessageForm; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 日程 + * + * @author 云筑产品开发平台组 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + */ +@Service +public class ScheduleNewServiceImpl extends SuperServiceImpl implements ScheduleNewService { + + @Autowired + private ScheduleLogService scheduleLogService; + + @Autowired + private SentMessageUtil sentMessageUtil; + @Autowired + private UserService userService; + @Autowired + private RedisUtil redisUtil; + @Autowired + private ScheduleNewUserService scheduleNewUserService; + @Autowired + private ScheduleJobUtil scheduleJobUtil; + + @Override + public List getList(ScheduleNewTime scheduleNewTime) { + List scheduleId = scheduleNewUserService.getList().stream().map(ScheduleNewUserEntity::getScheduleId).collect(Collectors.toList()); + if (scheduleId.size() == 0) { + return new ArrayList<>(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(ScheduleNewEntity::getId, scheduleId); + queryWrapper.lambda().orderByDesc(ScheduleNewEntity::getAllDay); + queryWrapper.lambda().orderByAsc(ScheduleNewEntity::getStartDay); + queryWrapper.lambda().orderByAsc(ScheduleNewEntity::getEndDay); + queryWrapper.lambda().orderByDesc(ScheduleNewEntity::getCreatorTime); + List result = this.list(queryWrapper); + return result; + } + + @Override + public List getList(String groupId, Date date) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(groupId)) { + queryWrapper.lambda().eq(ScheduleNewEntity::getGroupId, groupId); + } + if (ObjectUtil.isNotEmpty(date)) { + queryWrapper.lambda().ge(ScheduleNewEntity::getStartDay, date); + } + return this.list(queryWrapper); + } + + @Override + public List getStartDayList(String groupId, Date date) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(groupId)) { + queryWrapper.lambda().eq(ScheduleNewEntity::getGroupId, groupId); + } + if (ObjectUtil.isNotEmpty(date)) { + queryWrapper.lambda().le(ScheduleNewEntity::getStartDay, date); + } + queryWrapper.lambda().orderByDesc(ScheduleNewEntity::getStartDay); + return this.list(queryWrapper); + } + + + @Override + public List getListAll(Date date) { + if (date == null) { + date = new Date(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + Integer seconds = 10; + Date end = DateUtil.dateAddSeconds(date, seconds); + Date start = DateUtil.dateAddSeconds(date, -seconds); + queryWrapper.lambda().between(ScheduleNewEntity::getPushTime, start, end); + return this.list(queryWrapper); + } + + @Override + public ScheduleNewEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ScheduleNewEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public List getGroupList(ScheduleDetailModel detailModel) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + String id = detailModel.getId(); + String groupId = detailModel.getGroupId(); + if (StringUtil.isNotEmpty(id)) { + queryWrapper.lambda().eq(ScheduleNewEntity::getId, id); + } else { + queryWrapper.lambda().eq(ScheduleNewEntity::getGroupId, groupId); + } + queryWrapper.lambda().orderByAsc(ScheduleNewEntity::getStartDay); + return this.list(queryWrapper); + } + + @Override + @DSTransactional + public void create(ScheduleNewEntity entity, List toUserIds, String groupId, String operationType, List idList) throws WorkFlowException { + UserInfo userInfo = UserProvider.getUser(); + if (StringUtil.isEmpty(entity.getCreatorUserId())) { + entity.setCreatorUserId(userInfo.getUserId()); + } + boolean isUser = toUserIds.contains(entity.getCreatorUserId()); + if (!isUser) { + toUserIds.add(entity.getCreatorUserId()); + } + time(entity); + long time = entity.getEndDay().getTime() - entity.getStartDay().getTime(); + //间隔时间 + List dataList = new ArrayList<>(); + List listAll = new ArrayList<>(); + DateUtil.getNextDate(0, String.valueOf(entity.getRepetition()), entity.getStartDay(), entity.getRepeatTime(), dataList); + if (CollectionUtil.isEmpty(dataList)) { + throw new WorkFlowException(MsgCode.SYS132.get()); + } + for (Date date : dataList) { + ScheduleNewEntity scheduleEntity = JsonUtil.getJsonToBean(entity, ScheduleNewEntity.class); + scheduleEntity.setStartDay(date); + scheduleEntity.setEndDay(new Date(date.getTime() + time)); + if (!Objects.equals(scheduleEntity.getReminderTime(), -2)) { + boolean isAllDay = Objects.equals(scheduleEntity.getAllDay(), 1); + if (isAllDay) { + int oneMinutes = 8 * 60; + int twoMinutes = 9 * 60; + int threeMinutes = 10 * 60; + int day = 1440; + Integer reminderTime = scheduleEntity.getReminderTime(); + switch (reminderTime) { + case 4: + case 5: + case 6: + oneMinutes = oneMinutes - day; + twoMinutes = twoMinutes - day; + threeMinutes = threeMinutes - day; + break; + case 7: + case 8: + case 9: + oneMinutes = oneMinutes - day * 2; + twoMinutes = twoMinutes - day * 2; + threeMinutes = threeMinutes - day * 2; + break; + case 10: + case 11: + case 12: + oneMinutes = oneMinutes - day * 7; + twoMinutes = twoMinutes - day * 7; + threeMinutes = threeMinutes - day * 7; + break; + default: + break; + } + List oneList = new ArrayList() {{ + add(1); + add(4); + add(7); + add(10); + }}; + List twoList = new ArrayList() {{ + add(2); + add(5); + add(8); + add(11); + }}; + List threeList = new ArrayList() {{ + add(3); + add(6); + add(9); + add(12); + }}; + Integer pushTime = 0; + if (oneList.contains(reminderTime)) { + pushTime = oneMinutes; + } else if (twoList.contains(reminderTime)) { + pushTime = twoMinutes; + } else if (threeList.contains(reminderTime)) { + pushTime = threeMinutes; + } + scheduleEntity.setPushTime(DateUtil.dateAddMinutes(scheduleEntity.getStartDay(), pushTime)); + } else { + Integer reminderTime = scheduleEntity.getReminderTime() > 0 ? scheduleEntity.getReminderTime() : 0; + scheduleEntity.setPushTime(DateUtil.dateAddMinutes(scheduleEntity.getStartDay(), -reminderTime)); + } + } + listAll.add(scheduleEntity); + } + List scheduleJobList = new ArrayList<>(); + String id = ""; + for (int i = 0; i < listAll.size(); i++) { + String randomId = idList.size() > 0 && idList.size() - 1 >= i ? idList.get(i) : RandomUtil.uuId(); + if (StringUtil.isEmpty(id)) { + id = randomId; + } + ScheduleNewEntity scheduleEntity = listAll.get(i); + scheduleEntity.setId(randomId); + scheduleEntity.setCreatorTime(new Date()); + scheduleEntity.setCreatorUserId(entity.getCreatorUserId()); + scheduleEntity.setGroupId(groupId); + scheduleEntity.setEnabledMark(1); + this.saveOrUpdate(scheduleEntity); + for (String toUserId : toUserIds) { + ScheduleNewUserEntity userEntity = new ScheduleNewUserEntity(); + userEntity.setScheduleId(scheduleEntity.getId()); + userEntity.setToUserId(toUserId); + userEntity.setEnabledMark(1); + userEntity.setType(!isUser && entity.getCreatorUserId().equals(toUserId) ? 1 : 2); + scheduleNewUserService.create(userEntity); + } + boolean isTime = ObjectUtil.isNotEmpty(scheduleEntity.getPushTime()) && scheduleEntity.getPushTime().getTime() >= System.currentTimeMillis(); + ScheduleJobModel jobModel = new ScheduleJobModel(); + jobModel.setId(scheduleEntity.getId()); + jobModel.setScheduleTime(scheduleEntity.getPushTime()); + jobModel.setUserInfo(userInfo); + jobModel.setUserList(toUserIds); + if (isTime) { + scheduleJobList.add(jobModel); + } + //操作日志 + ScheduleLogEntity logEntity = JsonUtil.getJsonToBean(entity, ScheduleLogEntity.class); + logEntity.setOperationType(operationType); + logEntity.setUserId(JsonUtil.getObjectToString(toUserIds)); + logEntity.setScheduleId(scheduleEntity.getId()); + scheduleLogService.create(logEntity); + } + if ("1".equals(operationType)) { + ScheduleDetailModel model = new ScheduleDetailModel(); + model.setGroupId(groupId); + model.setId(id); + model.setType("2"); + UserInfo info = JsonUtil.getJsonToBean(userInfo, UserInfo.class); + UserEntity user = userService.getInfo(entity.getCreatorUserId()); + if (null != user) { + info.setUserId(user.getId()); + info.setUserName(user.getRealName()); + info.setUserAccount(user.getAccount()); + } + if (StringUtil.isNotBlank(id)) { + msg(toUserIds, info, model, entity, "PZXTRC001", "2"); + } + } + //推送任务调度 + job(scheduleJobList); + } + + @Override + @DSTransactional + public boolean update(String id, ScheduleNewEntity entity, List toUserIds, String type) throws WorkFlowException { + UserInfo userInfo = UserProvider.getUser(); + ScheduleNewEntity info = getInfo(id); + boolean flag = false; + String groupId = RandomUtil.uuId(); + if (info != null) { + //删除一个还是多个 + String delGroupId = info.getGroupId(); + Date startDay = "2".equals(type) ? info.getStartDay() : null; + List deleteList = "1".equals(type) ? new ArrayList() {{ + add(info); + }} : getList(delGroupId, startDay); + repeat(type, info); + updateStartDay(delGroupId, type, startDay); + List scheduleIdList = deleteList.stream().map(ScheduleNewEntity::getId).collect(Collectors.toList()); + deleteScheduleList(scheduleIdList); + create(entity, toUserIds, groupId, "2", scheduleIdList); + ScheduleDetailModel detailModel = new ScheduleDetailModel(); + detailModel.setGroupId(groupId); + List groupList = getGroupList(detailModel); + ScheduleDetailModel model = new ScheduleDetailModel(); + model.setGroupId(groupId); + model.setId(groupList.size() > 0 ? groupList.get(0).getId() : id); + model.setType("2"); + entity.setSend(""); + msg(toUserIds, userInfo, model, entity, "PZXTRC002", "2"); + flag = true; + } + return flag; + } + + + @Override + @DSTransactional + public void deleteScheduleList(List idList) { + if (idList.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(ScheduleNewEntity::getId, idList); + this.setIgnoreLogicDelete().remove(queryWrapper); + this.clearIgnoreLogicDelete(); + scheduleNewUserService.deleteByScheduleId(idList); + scheduleLogService.delete(idList, "3"); + } + } + + @Override + public boolean update(String id, ScheduleNewEntity entity) { + entity.setId(id); + return updateById(entity); + } + + @Override + @DSTransactional + public void delete(ScheduleNewEntity entity, String type) { + if (entity != null) { + UserInfo userInfo = UserProvider.getUser(); + String userId = userInfo.getUserId(); + String groupId = entity.getGroupId(); + String delGroupId = entity.getGroupId(); + Date startDay = "2".equals(type) ? entity.getStartDay() : null; + List deleteList = "1".equals(type) ? new ArrayList() {{ + add(entity); + }} : getList(delGroupId, startDay); + List scheduleIdList = deleteList.stream().map(ScheduleNewEntity::getId).collect(Collectors.toList()); + if (entity.getCreatorUserId().equals(userId)) { + repeat(type, entity); + List toUserIds = scheduleNewUserService.getList(entity.getId(), null).stream().map(ScheduleNewUserEntity::getToUserId).collect(Collectors.toList()); + deleteScheduleList(scheduleIdList); + ScheduleDetailModel model = new ScheduleDetailModel(); + model.setGroupId(groupId); + model.setId(entity.getId()); + model.setType("3"); + entity.setSend(""); + msg(toUserIds, userInfo, model, entity, "PZXTRC003", "2"); + } else { + //操作日志 + scheduleLogService.delete(scheduleIdList, "4"); + scheduleNewUserService.deleteByUserId(scheduleIdList); +// ScheduleDetailModel model = new ScheduleDetailModel(); +// model.setGroupId(groupId); +// model.setId(entity.getId()); +// model.setType("3"); +// List toUserIds = new ArrayList(){{{{add(userId);}}}}; +// msg(toUserIds, userInfo, model, entity, "PZXTRC003" , "2"); + } + } + } + + @Override + public void scheduleMessage(ScheduleJobModel scheduleModel) { + ScheduleNewEntity info = getInfo(scheduleModel.getId()); + if (info != null) { + List listAll = new ArrayList<>(); + listAll.add(info); + for (ScheduleNewEntity entity : listAll) { + UserInfo userInfo = scheduleModel.getUserInfo(); + UserEntity userEntity = userService.getInfo(entity.getCreatorUserId()); + List toUserIds = scheduleNewUserService.getList(entity.getId(), null).stream().map(ScheduleNewUserEntity::getToUserId).collect(Collectors.toList()); + ScheduleDetailModel model = new ScheduleDetailModel(); + model.setGroupId(entity.getGroupId()); + model.setId(entity.getId()); + if (userEntity != null) { + userInfo.setUserId(userEntity.getId()); + userInfo.setUserName(userEntity.getRealName()); + } + model.setType("1"); + msg(toUserIds, userInfo, model, entity, "PZXTRC001", "2"); + } + } + } + + private void time(ScheduleNewEntity entity) { + // 判断是否全天 + if (entity.getAllDay() != 1) { + String startDate = DateUtil.dateToString(entity.getStartDay(), "yyyy-MM-dd") + " " + entity.getStartTime() + ":00"; + Date star = DateUtil.stringToDate(startDate); + entity.setStartDay(star); + if (entity.getDuration() != -1) { + Date end = DateUtil.dateAddMinutes(entity.getStartDay(), entity.getDuration()); + entity.setEndDay(end); + } else { + String endDate = DateUtil.dateToString(entity.getEndDay(), "yyyy-MM-dd") + " " + entity.getEndTime() + ":00"; + Date end = DateUtil.stringToDate(endDate); + entity.setEndDay(end); + } + } else { + String startDate = DateUtil.dateToString(entity.getStartDay(), "yyyy-MM-dd") + " " + "00:00:00"; + Date star = DateUtil.stringToDate(startDate); + entity.setStartDay(star); + entity.setStartTime("00:00"); + String endDate = DateUtil.dateToString(entity.getEndDay(), "yyyy-MM-dd") + " " + "23:59:59"; + Date end = DateUtil.stringToDate(endDate); + entity.setEndDay(end); + entity.setEndTime("23:59"); + } + Date repeatTime = entity.getRepeatTime(); + if (repeatTime != null) { + String repeat = DateUtil.dateToString(repeatTime, "yyyy-MM-dd") + " " + "23:59:59"; + Date repeatDate = DateUtil.stringToDate(repeat); + entity.setRepeatTime(repeatDate); + } + } + + private void msg(List toUserIds, UserInfo userInfo, ScheduleDetailModel model, ScheduleNewEntity entity, String templateId, String type) { + Map parameterMap = new HashMap<>(); + parameterMap.put("@Title", entity.getTitle()); + parameterMap.put("@CreatorUserName", userInfo.getUserName() + "/" + userInfo.getUserAccount()); + parameterMap.put("@SendTime", DateUtil.getNow().substring(11)); + parameterMap.put("@Content", StringUtil.isNotEmpty(entity.getContent()) ? entity.getContent() : ""); + parameterMap.put("@StartDate", DateUtil.daFormat(entity.getStartDay())); + parameterMap.put("@StartTime", entity.getStartTime()); + parameterMap.put("@EndDate", DateUtil.daFormat(entity.getEndDay())); + parameterMap.put("@EndTime", entity.getEndTime()); + parameterMap.put("Title", entity.getTitle()); + parameterMap.put("CreatorUserName", userInfo.getUserName()); + parameterMap.put("Content", StringUtil.isNotEmpty(entity.getContent()) ? entity.getContent() : ""); + parameterMap.put("StartDate", DateUtil.daFormat(entity.getStartDay())); + parameterMap.put("StartTime", entity.getStartTime()); + parameterMap.put("EndDate", DateUtil.daFormat(entity.getEndDay())); + parameterMap.put("EndTime", entity.getEndTime()); + SentMessageForm sentMessageForm = new SentMessageForm(); + sentMessageForm.setToUserIds(toUserIds); + sentMessageForm.setUserInfo(userInfo); + sentMessageForm.setParameterMap(parameterMap); + sentMessageForm.setTitle(entity.getTitle()); + sentMessageForm.setTemplateId(StringUtil.isNotEmpty(entity.getSend()) ? entity.getSend() : templateId); + sentMessageForm.setContent(JsonUtil.getObjectToString(model)); + Map contentMsg = JsonUtil.entityToMaps(model); + sentMessageForm.setContentMsg(contentMsg); + sentMessageForm.setId(model.getId()); + sentMessageForm.setType(4); + sentMessageUtil.sendDelegateMsg(sentMessageForm); + } + + private void job(List scheduleJobList) { + scheduleJobUtil.insertRedis(scheduleJobList, redisUtil); + } + + private void updateStartDay(String groupId, String type, Date startDay) { + if ("2".equals(type)) { + Date startData = DateUtil.stringToDate(DateUtil.dateToString(startDay, "yyyy-MM-dd") + " " + "00:00:00"); + List startDayList = getStartDayList(groupId, startData); + if (startDayList.size() > 0) { + Date start = startDayList.get(0).getStartDay(); + for (ScheduleNewEntity entity : startDayList) { + Date repeatTime = entity.getRepeatTime(); + if (repeatTime != null) { + String repeat = DateUtil.dateToString(start, "yyyy-MM-dd") + " " + "23:59:59"; + Date repeatDate = DateUtil.stringToDate(repeat); + entity.setRepeatTime(repeatDate); + update(entity.getId(), entity); + } + } + } + } + } + + private void repeat(String type, ScheduleNewEntity info) { + Date repeat = info.getRepeatTime(); + String groupId = info.getGroupId(); + List typeList = new ArrayList() {{ + add("2"); + }}; + if (typeList.contains(type) && ObjectUtil.isNotEmpty(repeat)) { + List list = getList(groupId, null); + List collect = list.stream().filter(t -> t.getStartDay().getTime() < info.getStartDay().getTime()).sorted(Comparator.comparing(ScheduleNewEntity::getStartDay).reversed()).collect(Collectors.toList()); + for (int i = 0; i < collect.size(); i++) { + ScheduleNewEntity scheduleNewEntity = collect.get(i); + String dateString = DateUtil.getDateString(collect.get(0).getStartDay(), "yyyy-MM-dd") + " 23:59:59"; + Date repeatTime = DateUtil.stringToDate(dateString); + scheduleNewEntity.setRepeatTime(repeatTime); + update(scheduleNewEntity.getId(), scheduleNewEntity); + } + } + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ScheduleNewUserServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ScheduleNewUserServiceImpl.java new file mode 100644 index 0000000..b4465ea --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/ScheduleNewUserServiceImpl.java @@ -0,0 +1,79 @@ +package com.yunzhupaas.base.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.ScheduleNewUserEntity; +import com.yunzhupaas.base.mapper.ScheduleNewUserMapper; +import com.yunzhupaas.base.service.ScheduleNewUserService; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 日程 + * + * @author 云筑产品开发平台组 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + */ +@Service +public class ScheduleNewUserServiceImpl extends SuperServiceImpl implements ScheduleNewUserService { + + + + + @Override + public List getList(String scheduleId,Integer type) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ScheduleNewUserEntity::getScheduleId, scheduleId); + if(ObjectUtil.isNotEmpty(type)){ + queryWrapper.lambda().eq(ScheduleNewUserEntity::getType, type); + } + return this.list(queryWrapper); + } + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ScheduleNewUserEntity::getToUserId, UserProvider.getUser().getUserId()); + queryWrapper.lambda().eq(ScheduleNewUserEntity::getEnabledMark, 1); + return this.list(queryWrapper); + } + + @Override + public void create(ScheduleNewUserEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + this.save(entity); + } + + @Override + @DSTransactional + public void deleteByScheduleId(List scheduleIdList) { + if (scheduleIdList.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(ScheduleNewUserEntity::getScheduleId, scheduleIdList); + this.remove(queryWrapper); + } + } + + @Override + public void deleteByUserId(List scheduleIdList) { + UserInfo userInfo = UserProvider.getUser(); + if (scheduleIdList.size() > 0) { + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.lambda().eq(ScheduleNewUserEntity::getToUserId, userInfo.getUserId()); + updateWrapper.lambda().in(ScheduleNewUserEntity::getScheduleId, scheduleIdList); + updateWrapper.lambda().set(ScheduleNewUserEntity::getEnabledMark, 0); + this.update(updateWrapper); + } + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/SignServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/SignServiceImpl.java new file mode 100644 index 0000000..6059832 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/SignServiceImpl.java @@ -0,0 +1,93 @@ +package com.yunzhupaas.base.service.impl; + + +import com.yunzhupaas.base.mapper.SignMapper; +import com.yunzhupaas.base.service.SignService; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.permission.entity.SignEntity; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 个人签名 + * + * @author 云筑产品开发平台组 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/28 + */ +@Service +public class SignServiceImpl extends SuperServiceImpl implements SignService { + + + + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SignEntity::getCreatorUserId, UserProvider.getUser().getUserId()) + .orderByDesc(SignEntity::getCreatorTime); + + return this.list(queryWrapper); + } + + + @Override + public boolean create(SignEntity entity) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SignEntity::getIsDefault, 1) + .eq(SignEntity::getCreatorUserId, UserProvider.getUser().getUserId()); + SignEntity signEntity = this.getOne(queryWrapper); + if (entity.getIsDefault() == 0) { + if (signEntity == null) { + entity.setIsDefault(1); + } + } else { + if (signEntity != null) { + signEntity.setIsDefault(0); + this.updateById(signEntity); + } + } + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + return this.save(entity); + } + + + @Override + public boolean delete(String id) { + return this.removeById(id); + } + + + @Override + public boolean updateDefault(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SignEntity::getIsDefault, 1).eq(SignEntity::getCreatorUserId, UserProvider.getUser().getUserId()); + SignEntity signEntity = this.getOne(queryWrapper); + if (signEntity != null) { + signEntity.setIsDefault(0); + this.updateById(signEntity); + } + SignEntity entity = this.getById(id); + if (entity != null) { + entity.setIsDefault(1); + return this.updateById(entity); + } + return false; + } + + + @Override + public SignEntity getDefaultByUserId(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SignEntity::getIsDefault, 1).eq(SignEntity::getCreatorUserId, id); + return this.getOne(queryWrapper); + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/SignatureServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/SignatureServiceImpl.java new file mode 100644 index 0000000..917a563 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/SignatureServiceImpl.java @@ -0,0 +1,186 @@ +package com.yunzhupaas.base.service.impl; + + +import cn.hutool.core.collection.CollectionUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.yunzhupaas.base.entity.SignatureEntity; +import com.yunzhupaas.base.entity.SignatureUserEntity; +import com.yunzhupaas.base.mapper.SignatureMapper; +import com.yunzhupaas.base.model.signature.*; +import com.yunzhupaas.base.service.SignatureService; +import com.yunzhupaas.base.service.SignatureUserService; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.stream.Collectors; + +/** + * 电子签章 + * + * @author 云筑产品开发平台组 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/28 + */ +@Service +public class SignatureServiceImpl extends SuperServiceImpl implements SignatureService { + + @Autowired + private SignatureUserService signatureUserService; + + @Override + public List getList(PaginationSignature pagination) { + List list = null; + // 有没有授权人 + if (StringUtil.isNotEmpty(pagination.getUserId())) { + list = signatureUserService.getListByUserId(pagination.getUserId()).stream().map(SignatureUserEntity::getSignatureId).collect(Collectors.toList()); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + // 不为空需要in + if (list != null && list.size() > 0) { + queryWrapper.lambda().in(SignatureEntity::getId, list); + } + queryWrapper.lambda().and(StringUtil.isNotEmpty(pagination.getKeyword()), t -> t.like(SignatureEntity::getFullName, pagination.getKeyword()).or().like(SignatureEntity::getEnCode, pagination.getKeyword())); + queryWrapper.lambda().orderByAsc(SignatureEntity::getSortCode).orderByDesc(SignatureEntity::getCreatorTime); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage iPage = this.page(page, queryWrapper); + List signatureEntities = pagination.setData(iPage.getRecords(), iPage.getTotal()); + List voList = JsonUtil.getJsonToList(signatureEntities, SignatureListVO.class); + if (voList.size() > 0) { + MPJLambdaWrapper wrapper = new MPJLambdaWrapper<>(SignatureUserEntity.class) + .select(SignatureUserEntity::getSignatureId) + .leftJoin(UserEntity.class, UserEntity::getId, SignatureUserEntity::getUserId) + .select(UserEntity::getId, UserEntity::getAccount, UserEntity::getRealName); + wrapper.in(SignatureUserEntity::getSignatureId, voList.stream().map(SignatureListVO::getId).collect(Collectors.toList())); + List innerUserModels = signatureUserService.selectJoinList(InnerUserModel.class, wrapper); + Map> collect = innerUserModels.stream().collect(Collectors.groupingBy(InnerUserModel::getSignatureId)); + voList.forEach(t -> { + List userModels = collect.get(t.getId()); + if (userModels != null) { + StringJoiner userNames = new StringJoiner(";"); + for (InnerUserModel userModel : userModels) { + StringJoiner userName = new StringJoiner("/"); + userName.add(userModel.getRealName()); + userName.add(userModel.getAccount()); + userNames.add(userName.toString()); + } + t.setUserIds(userNames.toString()); + } + }); + } + return voList; + } + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + return this.list(queryWrapper); + } + + @Override + public List getListByIds(SignatureListByIdsModel model) { + if (CollectionUtil.isEmpty(model.getIds())) { + return new ArrayList<>(); + } + MPJLambdaWrapper wrapper = new MPJLambdaWrapper<>(SignatureEntity.class) + .select(SignatureEntity::getId, SignatureEntity::getEnCode, SignatureEntity::getFullName, SignatureEntity::getIcon) + .leftJoin(SignatureUserEntity.class, SignatureUserEntity::getSignatureId, SignatureEntity::getId) + .select(SignatureUserEntity::getSignatureId, SignatureUserEntity::getUserId) + .selectCollection(SignatureUserEntity.class, SignatureSelectorListVO::getSignatureUserList, map -> map + .result(SignatureUserEntity::getSignatureId) + .result(SignatureUserEntity::getUserId)); + // ids + wrapper.in(CollectionUtil.isNotEmpty(model.getIds()), SignatureEntity::getId, model.getIds()); + // 是否有权限 + wrapper.eq(StringUtil.isNotEmpty(UserProvider.getLoginUserId()), SignatureUserEntity::getUserId, UserProvider.getLoginUserId()); + wrapper.orderByAsc(SignatureEntity::getSortCode).orderByDesc(SignatureEntity::getCreatorTime); + return this.selectJoinList(SignatureSelectorListVO.class, wrapper); + } + + @Override + public SignatureEntity getInfoById(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SignatureEntity::getId, id); + queryWrapper.lambda().orderByAsc(SignatureEntity::getSortCode).orderByDesc(SignatureEntity::getCreatorTime); + return this.getOne(queryWrapper); + } + + @Override + public SignatureInfoVO getInfo(String id) { + SignatureEntity entity = this.getInfoById(id); + if (entity == null) { + return null; + } + SignatureInfoVO vo = JsonUtil.getJsonToBean(entity, SignatureInfoVO.class); + List list = signatureUserService.getList(entity.getId()); + vo.setUserIds(list.stream().map(SignatureUserEntity::getUserId).collect(Collectors.toList())); + return vo; + } + + @Override + public boolean isExistByFullName(String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SignatureEntity::getFullName, fullName); + if (StringUtil.isNotEmpty(id)) { + queryWrapper.lambda().ne(SignatureEntity::getId, id); + } + return this.count(queryWrapper) > 0; + } + + @Override + public boolean isExistByEnCode(String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SignatureEntity::getEnCode, enCode); + if (StringUtil.isNotEmpty(id)) { + queryWrapper.lambda().ne(SignatureEntity::getId, id); + } + return this.count(queryWrapper) > 0; + } + + @Override + @Transactional + public void create(SignatureEntity entity, List userIds) { + entity.setId(RandomUtil.uuId()); + for (String userId : userIds) { + SignatureUserEntity signatureUserEntity = new SignatureUserEntity(); + signatureUserEntity.setSignatureId(entity.getId()); + signatureUserEntity.setUserId(userId); + signatureUserService.create(signatureUserEntity); + } + this.save(entity); + } + + @Override + @Transactional + public boolean update(String id, SignatureUpForm signatureUpForm) { + SignatureEntity signatureEntity = JsonUtil.getJsonToBean(signatureUpForm, SignatureEntity.class); + signatureEntity.setId(id); + signatureUserService.delete(id); + for (String userId : signatureUpForm.getUserIds()) { + SignatureUserEntity signatureUserEntity = new SignatureUserEntity(); + signatureUserEntity.setSignatureId(id); + signatureUserEntity.setUserId(userId); + signatureUserService.create(signatureUserEntity); + } + return this.updateById(signatureEntity); + } + + @Override + public boolean delete(String id) { + return this.removeById(id); + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/SignatureUserServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/SignatureUserServiceImpl.java new file mode 100644 index 0000000..0bbab48 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/SignatureUserServiceImpl.java @@ -0,0 +1,64 @@ +package com.yunzhupaas.base.service.impl; + + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.entity.SignatureUserEntity; +import com.yunzhupaas.base.mapper.SignatureUserMapper; +import com.yunzhupaas.base.service.SignatureUserService; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.util.RandomUtil; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 电子签章 + * + * @author 云筑产品开发平台组 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/28 + */ +@Service +public class SignatureUserServiceImpl extends SuperServiceImpl implements SignatureUserService { + + @Override + public List getList(List signatureId, List userId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (ObjectUtil.isNotEmpty(signatureId)) { + queryWrapper.lambda().in(SignatureUserEntity::getSignatureId, signatureId); + } + if (ObjectUtil.isNotEmpty(userId)) { + queryWrapper.lambda().in(SignatureUserEntity::getUserId, userId); + } + return this.list(queryWrapper); + } + + @Override + public List getList(String signatureId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SignatureUserEntity::getSignatureId, signatureId); + return this.list(queryWrapper); + } + + @Override + public List getListByUserId(String userId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SignatureUserEntity::getUserId, userId); + return this.list(queryWrapper); + } + + @Override + public void create(SignatureUserEntity entity) { + entity.setId(RandomUtil.uuId()); + this.save(entity); + } + + @Override + public void delete(String signatureId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SignatureUserEntity::getSignatureId, signatureId); + this.remove(queryWrapper); + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/SmsTemplateServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/SmsTemplateServiceImpl.java new file mode 100644 index 0000000..eae0697 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/SmsTemplateServiceImpl.java @@ -0,0 +1,134 @@ +package com.yunzhupaas.base.service.impl; + +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.entity.SmsTemplateEntity; +import com.yunzhupaas.base.entity.SysConfigEntity; +import com.yunzhupaas.base.mapper.SmsTemplateMapper; +import com.yunzhupaas.base.SmsModel; +import com.yunzhupaas.base.service.SmsTemplateService; +import com.yunzhupaas.base.service.SysconfigService; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** +* @author Administrator +* @description 针对表【base_sms_template】的数据库操作Service实现 +* @createDate 2021-12-09 10:12:52 +*/ +@Service +public class SmsTemplateServiceImpl extends SuperServiceImpl implements SmsTemplateService { + + + @Autowired + private SysconfigService sysconfigService; + + @Override + public List getList(String keyword) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SmsTemplateEntity::getEnabledMark, 1); + if (!StringUtil.isEmpty(keyword)) { + queryWrapper.lambda().and( + t -> t.like(SmsTemplateEntity::getTemplateId, keyword) + .or().like(SmsTemplateEntity::getFullName, keyword) + .or().like(SmsTemplateEntity::getEnCode, keyword) + ); + } + queryWrapper.lambda().orderByDesc(SmsTemplateEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getList(Pagination pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (!StringUtil.isEmpty(pagination.getKeyword())) { + queryWrapper.lambda().and( + t -> t.like(SmsTemplateEntity::getTemplateId, pagination.getKeyword()) + .or().like(SmsTemplateEntity::getFullName, pagination.getKeyword()) + .or().like(SmsTemplateEntity::getEnCode, pagination.getKeyword()) + ); + } + queryWrapper.lambda().orderByDesc(SmsTemplateEntity::getCreatorTime); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage userPage = this.page(page, queryWrapper); + return pagination.setData(userPage.getRecords(), page.getTotal()); + } + + @Override + public SmsTemplateEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SmsTemplateEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(SmsTemplateEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + this.save(entity); + } + + @Override + public boolean update(String id, SmsTemplateEntity entity) { + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + return this.updateById(entity); + } + + @Override + public void delete(SmsTemplateEntity entity) { + this.removeById(entity.getId()); + } + + @Override + public boolean isExistByTemplateName(String templateName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SmsTemplateEntity::getFullName, templateName); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(SmsTemplateEntity::getId, id); + } + return this.count(queryWrapper) > 0; + } + + @Override + public boolean isExistByEnCode(String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SmsTemplateEntity::getEnCode, enCode); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(SmsTemplateEntity::getId, id); + } + return this.count(queryWrapper) > 0; + } + + @Override + public SmsModel getSmsConfig() { + // 得到系统配置 + List configList = sysconfigService.getList("SysConfig"); + Map objModel = new HashMap<>(16); + for (SysConfigEntity entity : configList) { + objModel.put(entity.getFkey(), entity.getValue()); + } + SmsModel smsModel = JsonUtil.getJsonToBean(objModel, SmsModel.class); + return smsModel; + } + +} + + + + + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/SysconfigServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/SysconfigServiceImpl.java new file mode 100644 index 0000000..0f6c735 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/SysconfigServiceImpl.java @@ -0,0 +1,154 @@ +package com.yunzhupaas.base.service.impl; + + +import com.yunzhupaas.base.model.MailAccount; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yunzhupaas.base.entity.EmailConfigEntity; +import com.yunzhupaas.base.entity.SysConfigEntity; +import com.yunzhupaas.base.mapper.SysconfigMapper; +import com.yunzhupaas.base.service.SysconfigService; +import com.yunzhupaas.model.BaseSystemInfo; +import com.yunzhupaas.base.util.*; +import com.yunzhupaas.util.CacheKeyUtil; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RedisUtil; +import com.yunzhupaas.util.context.SpringContext; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 系统配置 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Service +public class SysconfigServiceImpl extends SuperServiceImpl implements SysconfigService { + + @Autowired + private RedisUtil redisUtil; + @Autowired + private CacheKeyUtil cacheKeyUtil; + @Autowired + private Pop3Util pop3Util; + + @Override + public List getList(String type) { + List list =new ArrayList<>(); + if("WeChat".equals(type)){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + list = this.list(queryWrapper).stream().filter(t->"QYHConfig".equals(t.getCategory())||"MPConfig".equals(t.getCategory())).collect(Collectors.toList()); + } + if("SysConfig".equals(type)){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + list = this.list(queryWrapper).stream().filter(t->!"QYHConfig".equals(t.getCategory())&&!"MPConfig".equals(t.getCategory())).collect(Collectors.toList()); + } + return list; + } + + @Override + public BaseSystemInfo getWeChatInfo() { + Map objModel = new HashMap<>(16); + List list = this.getList("WeChat"); + for (SysConfigEntity entity : list) { + objModel.put(entity.getFkey(), entity.getValue()); + } + BaseSystemInfo baseSystemInfo = JsonUtil.getJsonToBean(objModel, BaseSystemInfo.class); + return baseSystemInfo; + } + @Override + public BaseSystemInfo getSysInfo() { + Map objModel = new HashMap<>(16); + List list = this.getList("SysConfig"); + for (SysConfigEntity entity : list) { + objModel.put(entity.getFkey(), entity.getValue()); + } + BaseSystemInfo baseSystemInfo = JsonUtil.getJsonToBean(objModel, BaseSystemInfo.class); + return baseSystemInfo; + } + + @Override + @DSTransactional + public void save(List entitys) { + String cacheKey = cacheKeyUtil.getSystemInfo(); + redisUtil.remove(cacheKey); + this.baseMapper.deleteFig(); + for (SysConfigEntity entity: entitys) { + entity.setCategory("SysConfig"); + this.baseMapper.insert(entity); + } + } + @Override + @DSTransactional + public boolean saveMp(List entitys){ + String cacheKey = cacheKeyUtil.getWechatConfig(); + int flag=0; + redisUtil.remove(cacheKey); + this.baseMapper.deleteMpFig(); + for (SysConfigEntity entity: entitys) { + entity.setCategory("MPConfig"); + if(this.baseMapper.insert(entity)>0){ + flag++; + } + } + if(entitys.size()==flag){ + return true; + } + return false; + } + @Override + @DSTransactional + public void saveQyh(List entitys){ + String cacheKey = cacheKeyUtil.getWechatConfig(); + redisUtil.remove(cacheKey); + this.baseMapper.deleteQyhFig(); + for (SysConfigEntity entity: entitys) { + entity.setCategory("QYHConfig"); + this.baseMapper.insert(entity); + } + } + + @Override + public String checkLogin(EmailConfigEntity configEntity) { + MailAccount mailAccount = new MailAccount(); + mailAccount.setAccount(configEntity.getAccount()); + mailAccount.setPassword(configEntity.getPassword()); + mailAccount.setPop3Host(configEntity.getPop3Host()); + mailAccount.setPop3Port(configEntity.getPop3Port()); + mailAccount.setSmtpHost(configEntity.getSmtpHost()); + mailAccount.setSmtpPort(configEntity.getSmtpPort()); + if ("1".equals(String.valueOf(configEntity.getEmailSsl()))) { + mailAccount.setSsl(true); + } else { + mailAccount.setSsl(false); + } + if (mailAccount.getSmtpHost() != null) { + return SmtpUtil.checkConnected(mailAccount); + } + if (mailAccount.getPop3Host() != null) { + return pop3Util.checkConnected(mailAccount); + } + return "false"; + } + + @Override + public String getValueByKey(String keyStr) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SysConfigEntity::getFkey,keyStr); + SysConfigEntity sysConfigEntity = getOne(queryWrapper); + return sysConfigEntity.getValue(); + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/SystemServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/SystemServiceImpl.java new file mode 100644 index 0000000..5f814c7 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/SystemServiceImpl.java @@ -0,0 +1,211 @@ +package com.yunzhupaas.base.service.impl; + +import com.yunzhupaas.base.model.base.SystemBaeModel; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.entity.*; +import com.yunzhupaas.base.mapper.SystemMapper; +import com.yunzhupaas.base.service.*; +import com.yunzhupaas.constant.YunzhupaasConst; +import com.yunzhupaas.constant.PermissionConst; +import com.yunzhupaas.permission.entity.OrganizeAdministratorEntity; +import com.yunzhupaas.permission.service.AuthorizeService; +import com.yunzhupaas.permission.service.OrganizeAdministratorService; +import com.yunzhupaas.permission.service.PermissionGroupService; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 系统 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Service +public class SystemServiceImpl extends SuperServiceImpl implements SystemService { + + @Autowired + private ModuleService moduleService; + @Autowired + private AuthorizeService authorizeApi; + @Autowired + private OrganizeAdministratorService organizeAdminTratorApi; + @Autowired + private PermissionGroupService permissionGroupApi; + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().orderByAsc(SystemEntity::getSortCode) + .orderByDesc(SystemEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List getList(String keyword, Boolean filterEnableMark, boolean verifyAuth, Boolean filterMain, + boolean isList, List moduleAuthorize) { + List systemIds = new ArrayList<>(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + // 是否为列表,特殊处理 + if (isList) { + systemIds.addAll(authorizeApi.getAuthorizeByUser(true).getSystemList().stream().map(SystemBaeModel::getId) + .collect(Collectors.toList())); + } + if (StringUtil.isNotEmpty(keyword)) { + queryWrapper.lambda() + .and(t -> t.like(SystemEntity::getFullName, keyword).or().like(SystemEntity::getEnCode, keyword) + .or().like(SystemEntity::getDescription, keyword)); + } + if (filterEnableMark == null) { + queryWrapper.lambda().eq(SystemEntity::getEnabledMark, 0); + } else if (filterEnableMark) { + queryWrapper.lambda().eq(SystemEntity::getEnabledMark, 1); + } + if (verifyAuth) { + List systemList = authorizeApi.getAuthorizeByUser(false).getSystemList() + .stream().map(SystemBaeModel::getId).collect(Collectors.toList()); + if (systemList.size() == 0) { + return new ArrayList<>(); + } + systemIds.addAll(systemList); + queryWrapper.lambda().in(SystemEntity::getId, systemIds); + } + // 过滤掉开发平台 + if (filterMain != null && filterMain) { + queryWrapper.lambda().ne(SystemEntity::getEnCode, YunzhupaasConst.MAIN_SYSTEM_CODE); + } + if (moduleAuthorize.size() > 0) { + queryWrapper.lambda().notIn(SystemEntity::getId, moduleAuthorize); + } + queryWrapper.lambda().orderByAsc(SystemEntity::getSortCode).orderByDesc(SystemEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public SystemEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SystemEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public Boolean isExistFullName(String id, String fullName) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SystemEntity::getFullName, fullName); + if (StringUtil.isNotEmpty(id)) { + queryWrapper.lambda().ne(SystemEntity::getId, id); + } + return this.count(queryWrapper) > 0; + } + + @Override + public Boolean isExistEnCode(String id, String enCode) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SystemEntity::getEnCode, enCode); + if (StringUtil.isNotEmpty(id)) { + queryWrapper.lambda().ne(SystemEntity::getId, id); + } + return this.count(queryWrapper) > 0; + } + + @Override + @Transactional + public Boolean create(SystemEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setIsMain(0); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + entity.setCreatorTime(new Date()); + boolean save = this.save(entity); + if (!UserProvider.getUser().getIsAdministrator() && save) { + // 当前用户创建的组织要赋予权限 + OrganizeAdministratorEntity organizeAdministratorEntity = new OrganizeAdministratorEntity(); + organizeAdministratorEntity.setUserId(UserProvider.getUser().getUserId()); + organizeAdministratorEntity.setOrganizeId(entity.getId()); + organizeAdministratorEntity.setOrganizeType(PermissionConst.SYSTEM); + organizeAdminTratorApi.save(organizeAdministratorEntity); + } + return save; + } + + @Override + @Transactional + public Boolean update(String id, SystemEntity entity) { + entity.setId(id); + if (entity.getIsMain() == null) { + entity.setIsMain(0); + } + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + entity.setLastModifyTime(new Date()); + return this.updateById(entity); + } + + @Override + @Transactional + public Boolean delete(String id) { + moduleService.deleteBySystemId(id); + return this.removeById(id); + } + + @Override + public List getListByIds(List list, List moduleAuthorize) { + List systemList = new ArrayList<>(16); + if (list.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (moduleAuthorize != null && moduleAuthorize.size() > 0) { + queryWrapper.lambda().notIn(SystemEntity::getId, moduleAuthorize); + } + queryWrapper.lambda().in(SystemEntity::getId, list); + queryWrapper.lambda().eq(SystemEntity::getEnabledMark, 1); + queryWrapper.lambda().orderByAsc(SystemEntity::getSortCode).orderByDesc(SystemEntity::getCreatorTime); + return this.list(queryWrapper); + } + return systemList; + } + + @Override + public SystemEntity getInfoByEnCode(String enCode) { + if (StringUtil.isEmpty(enCode)) { + return null; + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SystemEntity::getEnCode, enCode); + return this.getOne(queryWrapper); + } + + @Override + public List findSystemAdmin(int mark, String mainSystemCode, List moduleAuthorize) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (mark == 1) { + queryWrapper.lambda().eq(SystemEntity::getEnabledMark, mark) + .ne(SystemEntity::getEnCode, mainSystemCode); + } + if (moduleAuthorize != null && moduleAuthorize.size() > 0) { + queryWrapper.lambda().notIn(SystemEntity::getId, moduleAuthorize); + } + queryWrapper.lambda().orderByAsc(SystemEntity::getSortCode).orderByDesc(SystemEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public List findSystemAdmin(int mark, String mainSystemCode) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (mark == 1) { + queryWrapper.lambda().eq(SystemEntity::getEnabledMark, mark) + .ne(SystemEntity::getEnCode, mainSystemCode); + } + queryWrapper.lambda().orderByAsc(SystemEntity::getSortCode).orderByDesc(SystemEntity::getCreatorTime); + return this.list(queryWrapper); + } + +} diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/UserOnlineServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/UserOnlineServiceImpl.java new file mode 100644 index 0000000..56ca677 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/UserOnlineServiceImpl.java @@ -0,0 +1,76 @@ +package com.yunzhupaas.base.service.impl; + + +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.service.UserOnlineService; +import com.yunzhupaas.message.model.UserOnlineModel; +import com.yunzhupaas.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 在线用户 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +@Service +public class UserOnlineServiceImpl implements UserOnlineService { + + @Autowired + private RedisUtil redisUtil; + + @Autowired + private CacheKeyUtil cacheKeyUtil; + + @Override + public List getList(Pagination page) { + List userOnlineList = new ArrayList<>(); + List tokens = UserProvider.getLoginUserListToken(); + for (String token : tokens) { + UserInfo userInfo = UserProvider.getUser(token); + if(userInfo.getId() != null){ + if(UserProvider.isTempUser(userInfo)){ + //临时用户不显示 + continue; + } + UserOnlineModel userOnlineModel = new UserOnlineModel(); + userOnlineModel.setUserId(userInfo.getUserId()); + userOnlineModel.setUserName((userInfo.getUserName()) + "/" + userInfo.getUserAccount()); + userOnlineModel.setLoginIPAddress(userInfo.getLoginIpAddress()); + userOnlineModel.setLoginAddress(userInfo.getLoginIpAddressName()); + userOnlineModel.setOrganize(userInfo.getOrganize()); + userOnlineModel.setLoginTime(userInfo.getLoginTime()); + userOnlineModel.setTenantId(userInfo.getTenantId()); + userOnlineModel.setToken(token); + userOnlineModel.setDevice(userInfo.getLoginDevice()); + userOnlineModel.setLoginBrowser(userInfo.getBrowser()); + userOnlineModel.setLoginSystem(userInfo.getLoginPlatForm()); + userOnlineList.add(userOnlineModel); + } + } + String tenantId =UserProvider.getUser().getTenantId(); + userOnlineList = userOnlineList.stream().filter(t -> String.valueOf(t.getTenantId()).equals(String.valueOf(tenantId))).collect(Collectors.toList()); + if(!StringUtil.isEmpty(page.getKeyword())){ + userOnlineList=userOnlineList.stream().filter(t->t.getUserName().contains(page.getKeyword())).collect(Collectors.toList()); + } + userOnlineList.sort(Comparator.comparing(UserOnlineModel::getLoginTime).reversed()); + page.setTotal(userOnlineList.size()); + userOnlineList = PageUtil.getListPage((int) page.getCurrentPage(), (int) page.getPageSize(), userOnlineList); + return userOnlineList; + } + + @Override + public void delete(String... token) { + AuthUtil.kickoutByToken(token); + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/VisualKitServiceImpl.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/VisualKitServiceImpl.java new file mode 100644 index 0000000..d3c717d --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/service/impl/VisualKitServiceImpl.java @@ -0,0 +1,258 @@ +package com.yunzhupaas.base.service.impl; + + +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.entity.VisualKitEntity; +import com.yunzhupaas.base.mapper.VisualKitMapper; +import com.yunzhupaas.base.model.visualkit.KitPagination; +import com.yunzhupaas.base.model.visualkit.KitTreeVo; +import com.yunzhupaas.base.model.visualkit.VisualKitForm; +import com.yunzhupaas.base.service.DictionaryDataService; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.base.service.VisualKitService; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import com.yunzhupaas.util.enums.DictionaryDataEnum; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 表单套件 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/8/22 11:11:35 + */ +@Service +public class VisualKitServiceImpl extends SuperServiceImpl implements VisualKitService { + + + @Autowired + private DictionaryDataService dictionaryDataService; + + @Override + public List getList(KitPagination pagination) { + // 定义变量判断是否需要使用修改时间倒序 + boolean flag = false; + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(VisualKitEntity::getId, VisualKitEntity::getFullName, VisualKitEntity::getEnCode, VisualKitEntity::getCategory, + VisualKitEntity::getIcon, VisualKitEntity::getCreatorUserId, VisualKitEntity::getCreatorTime, VisualKitEntity::getLastModifyTime, + VisualKitEntity::getSortCode, VisualKitEntity::getEnabledMark); + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + flag = true; + queryWrapper.lambda().and(t -> t.like(VisualKitEntity::getFullName, pagination.getKeyword()) + .or().like(VisualKitEntity::getEnCode, pagination.getKeyword()) + ); + } + + if (StringUtil.isNotEmpty(pagination.getCategory())) { + flag = true; + queryWrapper.lambda().eq(VisualKitEntity::getCategory, pagination.getCategory()); + } + + if (pagination.getEnabledMark() != null) { + flag = true; + queryWrapper.lambda().eq(VisualKitEntity::getEnabledMark, pagination.getEnabledMark()); + } + + //排序 + queryWrapper.lambda().orderByAsc(VisualKitEntity::getSortCode) + .orderByDesc(VisualKitEntity::getCreatorTime); + if (flag) { + queryWrapper.lambda().orderByDesc(VisualKitEntity::getLastModifyTime); + } + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage iPage = this.page(page, queryWrapper); + return pagination.setData(iPage.getRecords(), iPage.getTotal()); + } + + @Override + public void saveCheck(VisualKitEntity visualKitEntity, Boolean fullNameCheck, Boolean encodeCheck) { + String fullName = visualKitEntity.getFullName(); + String encode = visualKitEntity.getEnCode(); + // 名称长度验证 + if (fullName.length() > 80) { + throw new DataException(MsgCode.EXIST005.get()); + } + QueryWrapper query = new QueryWrapper<>(); + //重名验证 + if (fullNameCheck) { + query.lambda().eq(VisualKitEntity::getFullName, fullName); + if (this.list(query).size() > 0) { + throw new DataException(MsgCode.EXIST001.get()); + } + } + //编码验证 + if (encodeCheck) { + query.clear(); + query.lambda().eq(VisualKitEntity::getEnCode, encode); + if (this.list(query).size() > 0) { + throw new DataException(MsgCode.EXIST002.get()); + } + } + } + + @Override + public void create(VisualKitForm form) { + clearFormDataTable(form); + VisualKitEntity entity = JsonUtil.getJsonToBean(form, VisualKitEntity.class); + this.saveCheck(entity, true, true); + if (StringUtil.isEmpty(form.getId())) { + entity.setId(RandomUtil.uuId()); + } + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + entity.setCreatorTime(new Date()); + this.save(entity); + form.setId(entity.getId()); + } + + @Override + public boolean update(String id, VisualKitForm form) { + clearFormDataTable(form); + VisualKitEntity entity = JsonUtil.getJsonToBean(form, VisualKitEntity.class); + VisualKitEntity byId = this.getById(id); + this.saveCheck(entity, !byId.getFullName().equals(form.getFullName()), !byId.getEnCode().equals(form.getEnCode())); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + entity.setLastModifyTime(new Date()); + return this.updateById(entity); + } + + @Override + public List selectorList() { + List typeList = dictionaryDataService.getListByTypeDataCode(DictionaryDataEnum.VISUALDEV.getDictionaryTypeId()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualKitEntity::getEnabledMark, 1); + queryWrapper.lambda().orderByAsc(VisualKitEntity::getSortCode) + .orderByDesc(VisualKitEntity::getCreatorTime); + List list = this.list(queryWrapper); + Map> collect = list.stream().collect(Collectors.groupingBy(VisualKitEntity::getCategory)); + List resList = new ArrayList<>(); + for (String key : collect.keySet()) { + DictionaryDataEntity dataEntity = typeList.stream().filter(t -> t.getId().equals(key)).findFirst().orElse(new DictionaryDataEntity()); + KitTreeVo kitTreeVo = new KitTreeVo(); + kitTreeVo.setId(key); + kitTreeVo.setFullName(dataEntity.getFullName()); + kitTreeVo.setEnCode(dataEntity.getEnCode()); + kitTreeVo.setHasChildren(true); + List visualKitEntities = collect.get(key); + List jsonToList = JsonUtil.getJsonToList(visualKitEntities, KitTreeVo.class); + jsonToList.forEach(t -> { + t.setParentId(key); + }); + kitTreeVo.setChildren(jsonToList); + resList.add(kitTreeVo); + } + return resList; + } + + @Override + public void actionsCopy(String id) { + VisualKitEntity entity = this.getById(id); + String copyNum = UUID.randomUUID().toString().substring(0, 5); + String fullName = entity.getFullName() + ".副本" + copyNum; + if (fullName.length() > 80) { + throw new DataException(MsgCode.PRI006.get()); + } + VisualKitForm form = JsonUtil.getJsonToBean(entity, VisualKitForm.class); + form.setId(RandomUtil.uuId()); + form.setFullName(fullName); + form.setEnCode(entity.getEnCode() + copyNum); + form.setEnabledMark(0); + this.create(form); + } + + @Override + public String importData(VisualKitEntity entity, Integer type) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + StringJoiner stringJoiner = new StringJoiner("、"); + if (this.getById(entity.getId()) != null) { + if (Objects.equals(type, 0)) { + stringJoiner.add("ID"); + } else { + entity.setId(RandomUtil.uuId()); + } + } + queryWrapper.clear(); + queryWrapper.lambda().eq(VisualKitEntity::getEnCode, entity.getEnCode()); + if (this.count(queryWrapper) > 0) { + stringJoiner.add(MsgCode.IMP009.get()); + } + queryWrapper.clear(); + queryWrapper.lambda().eq(VisualKitEntity::getFullName, entity.getFullName()); + if (this.count(queryWrapper) > 0) { + stringJoiner.add(MsgCode.IMP008.get()); + } + if (stringJoiner.length() > 0 && ObjectUtil.equal(type, 1)) { + String copyNum = UUID.randomUUID().toString().substring(0, 5); + entity.setFullName(entity.getFullName() + ".副本" + copyNum); + entity.setEnCode(entity.getEnCode() + copyNum); + } else if (ObjectUtil.equal(type, 0) && stringJoiner.length() > 0) { + return stringJoiner.toString() + MsgCode.IMP007.get(); + } + entity.setEnabledMark(0); + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(UserProvider.getLoginUserId()); + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + this.save(entity); + return ""; + } + + /** + * 清空formdata内的表信息 + * + * @param form + */ + private void clearFormDataTable(VisualKitForm form) { + Map formMap = JsonUtil.stringToMap(form.getFormData()); + JSONArray formJsonArray = JsonUtil.getJsonToJsonArray(String.valueOf(formMap.get("fields"))); + this.recuClearTable(formJsonArray); + formMap.put("fields", formJsonArray); + form.setFormData(JsonUtil.getObjectToString(formMap)); + } + + /** + * 递归清除 + * + * @param formJsonArray + */ + private void recuClearTable(JSONArray formJsonArray) { + for (Object o : formJsonArray) { + JSONObject jsonObject = (JSONObject) o; + JSONObject config = jsonObject.getJSONObject("__config__"); + boolean hasChange = false; + if (ObjectUtil.isNotEmpty(config.get("tableName"))) { + config.put("tableName", ""); + hasChange = true; + } + if (ObjectUtil.isNotEmpty(config.get("relationTable"))) { + config.put("relationTable", ""); + hasChange = true; + } + JSONArray childArray = config.getJSONArray("children"); + if (ObjectUtil.isNotEmpty(childArray)) { + this.recuClearTable(childArray); + config.put("children", childArray); + hasChange = true; + } + if (hasChange) { + jsonObject.put("__config__", config); + } + } + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/AnnotationType.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/AnnotationType.java new file mode 100644 index 0000000..8885485 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/AnnotationType.java @@ -0,0 +1,33 @@ +package com.yunzhupaas.base.util; + +import lombok.Data; + +/** + * 数据接口支持注解类型 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Data +public class AnnotationType { + /** + * USER 当前登陆者id + */ + public static final String USER = "@user"; + /** + * 当前登陆者部门id + */ + public static final String DEPARTMENT = "@department"; + /** + * 当前登陆者组织id + */ + public static final String ORGANIZE = "@organize"; + /** + * 当前登录者岗位id + */ + public static final String POSTION = "@postion"; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/ClassUtil.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/ClassUtil.java new file mode 100644 index 0000000..7bd1f16 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/ClassUtil.java @@ -0,0 +1,63 @@ +package com.yunzhupaas.base.util; + + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.lang.reflect.Field; +import java.util.HashMap; +import java.util.Set; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +public class ClassUtil { + + private static void getProxyPojoValue(Object object, Set key1){ + String id = null; + // 返回参数 + HashMap hashMap = new HashMap<>(16); + for (String s : key1) { + Field[] fields = object.getClass().getDeclaredFields(); + for (Field field : fields) { + field.setAccessible(true); + + // 获取表名 + TableName table = object.getClass().getAnnotation(TableName.class); + if (table != null) { + String tableName = table.value(); + hashMap.putIfAbsent("tableName", tableName); + } + // 获取主键id + if (id == null) { + boolean isIdField = field.isAnnotationPresent(TableId.class); + if (isIdField) { + TableField tableField = field.getAnnotation(TableField.class); + if (s.toLowerCase().equals(field.getName().toLowerCase())) { + String tableId = tableField.value(); + hashMap.put(s,tableId); + id = tableId; + } + } + } + + // 获取字段的值 + boolean isTableField = field.isAnnotationPresent(TableField.class); + if (isTableField) { + TableField tableField = field.getAnnotation(TableField.class); + if (s.toLowerCase().equals(field.getName().toLowerCase())) { + String fieldValue = tableField.value(); + hashMap.put(s,fieldValue); + } + } + } + } + System.out.println(hashMap); + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/DataInterfaceParamUtil.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/DataInterfaceParamUtil.java new file mode 100644 index 0000000..a8282fd --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/DataInterfaceParamUtil.java @@ -0,0 +1,44 @@ +package com.yunzhupaas.base.util; + + +import com.yunzhupaas.base.model.datainterface.DataInterfaceMarkModel; +import com.yunzhupaas.constant.DataInterfaceVarConst; +import com.yunzhupaas.util.RandomUtil; + +import java.util.Map; + +public class DataInterfaceParamUtil { + + /** + * 获取指定字符串所在的位置及应该赋予的值 + * + * @param map 位置、值 + * @param str 字符串 + * @param specifyString 指定字符串 + * @param value 值 + * @return + */ + public static Map getParamModel(Map map, String str, String specifyString, Object value) { + int frontLength = 0; + while (str.contains(specifyString)) { + int index = str.indexOf(specifyString); + boolean flag = false; + Double aDouble = Double.valueOf(index + frontLength + 1); + while (!flag) { + if (map.containsKey(aDouble)) { + aDouble += 0.0001; + } else { + if (specifyString.equals(DataInterfaceVarConst.ID_LOT)) { + value = RandomUtil.uuId(); + } + map.put(aDouble, new DataInterfaceMarkModel(specifyString, value)); + flag = true; + } + } + frontLength += (index + specifyString.length()); + str = str.substring(index + specifyString.length()); + } + return map; + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/ExcelTool.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/ExcelTool.java new file mode 100644 index 0000000..8f238da --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/ExcelTool.java @@ -0,0 +1,337 @@ +package com.yunzhupaas.base.util; + +import cn.afterturn.easypoi.excel.ExcelExportUtil; +import cn.afterturn.easypoi.excel.entity.ExportParams; +import cn.afterturn.easypoi.excel.entity.ImportParams; +import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; +import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; +import cn.xuyanwu.spring.file.storage.FileInfo; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.excel.ExcelExportStyler; +import com.yunzhupaas.excel.ExcelHelper; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.model.ExcelModel; +import com.yunzhupaas.model.ExcelViewFieldModel; +import com.yunzhupaas.util.DateUtil; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.context.SpringContext; +import lombok.Cleanup; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.*; +import org.apache.poi.ss.util.CellRangeAddress; +import org.apache.poi.ss.util.CellRangeAddressList; +import org.apache.poi.xssf.usermodel.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 系统模块得导入导出公共方法 + * + * @author 云筑产品开发平台组 + * @version v5.0.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/5/31 13:50:52 + */ +public class ExcelTool { + + private static ConfigValueUtil configValueUtil = SpringContext.getBean(ConfigValueUtil.class); + + public static ActionResult uploader() { + List list = UpUtil.getFileAll(); + MultipartFile file = list.get(0); + if (file.getOriginalFilename().endsWith(".xlsx") || file.getOriginalFilename().endsWith(".xls")) { + String filePath = XSSEscape.escape(configValueUtil.getTemporaryFilePath()); + String fileName = XSSEscape.escape(RandomUtil.uuId() + "." + UpUtil.getFileType(file)); + //上传文件 + FileInfo fileInfo = FileUploadUtils.uploadFile(file, filePath, fileName); + DownloadVO vo = DownloadVO.builder().build(); + vo.setName(fileInfo.getFilename()); + return ActionResult.success(vo); + } else { + return ActionResult.fail(MsgCode.ETD110.get()); + } + } + + public static DownloadVO getImportTemplate(String temporaryFilePath, String templateName, Map keyMap, List> list, ExcelModel excelModel) { + DownloadVO vo = DownloadVO.builder().build(); + //主表对象 + List entitys = new ArrayList<>(); + //以下添加字段 + for (String key : keyMap.keySet()) { + String name = keyMap.get(key); + entitys.add(new ExcelExportEntity(name + "(" + key + ")", key)); + } + + ExportParams exportParams = new ExportParams(null, templateName); + exportParams.setType(ExcelType.XSSF); + try { + @Cleanup Workbook workbook = new HSSFWorkbook(); + if (entitys.size() > 0) { + if (list.size() == 0) { + list.add(new HashMap<>()); + } + ExcelHelper helper = new ExcelHelper(); + exportParams.setStyle(ExcelExportStyler.class); + workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list); + helper.init(workbook, exportParams, entitys, excelModel); + helper.doPreHandle(); + helper.doPostHandle(); + } + + String fileName = templateName + "导入模板" + ".xls"; + MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName); + + multipartFile = setTopTitle(excelModel, multipartFile, fileName); + + FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName); + vo.setName(fileInfo.getFilename()); + vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName); + } catch (Exception e) { + e.printStackTrace(); + } + return vo; + } + + /** + * 设置表头(翻译标记用。) + * + * @param excelModel + * @param multipartFile + * @param fileName + * @return + * @throws IOException + */ + private static MultipartFile setTopTitle(ExcelModel excelModel, MultipartFile multipartFile, String fileName) throws IOException { + if (excelModel.isHasHeader()) { + InputStream inputStream = multipartFile.getInputStream(); + @Cleanup XSSFWorkbook workbook2 = new XSSFWorkbook(inputStream); + XSSFSheet sheetAt = workbook2.getSheetAt(0); + short lastCellNum = sheetAt.getRow(0).getLastCellNum(); + sheetAt.shiftRows(0, 1, 1); + XSSFRow row = sheetAt.createRow(0); + XSSFCell cell = row.createCell(0); + //样式设置 + CellStyle style = workbook2.createCellStyle(); + style.setAlignment(HorizontalAlignment.LEFT); + style.setVerticalAlignment(VerticalAlignment.TOP); + style.setWrapText(true); + cell.setCellStyle(style); + //行高设置 + row.setHeightInPoints(54); + + Font font = workbook2.createFont(); + font.setColor(IndexedColors.BLACK.getIndex()); + font.setBold(true); + XSSFRichTextString textString = new XSSFRichTextString("填写说明:\n" + + "(1)翻译标记命名规则:只能输入字母、数字、点、横线和下划线,且以字母开头;\n" + + "(2)翻译标记全局唯一,不可重复;\n" + + "(3)翻译语言必须填写一项;"); + + textString.applyFont(0, 5, font); + cell.setCellValue(textString); + + //合并单元格 + sheetAt.addMergedRegionUnsafe(new CellRangeAddress(0, 0, 0, lastCellNum - 1)); + + //冻结行下移 + sheetAt.createFreezePane(0, 2); + //校验规则下移 + List dataValidations = sheetAt.getDataValidations(); + List dvNew = new ArrayList<>(); + for (DataValidation dataValidation : dataValidations) { + DataValidationConstraint constraint = dataValidation.getValidationConstraint(); + CellRangeAddressList regions = dataValidation.getRegions(); + CellRangeAddress crd = regions.getCellRangeAddresses()[0]; + CellRangeAddressList cellRangeAddressList = new CellRangeAddressList(crd.getFirstRow() + 1, crd.getLastRow() + 1, crd.getFirstColumn(), crd.getLastColumn()); + DataValidationHelper helper = sheetAt.getDataValidationHelper(); + dvNew.add(helper.createValidation(constraint, cellRangeAddressList)); + } + sheetAt.getCTWorksheet().unsetDataValidations(); + for (DataValidation item : dvNew) { + sheetAt.addValidationData(item); + } + multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook2, fileName); + } + return multipartFile; + } + + public static List getImportExcelExportEntityList(boolean isError, Map keyMap) { + List entitys = new ArrayList<>(); + if (isError) { + entitys.add(new ExcelExportEntity("异常原因(errorsInfo)", "errorsInfo")); + } + for (String key : keyMap.keySet()) { + String name = keyMap.get(key); + entitys.add(new ExcelExportEntity(name + "(" + key + ")", key)); + } + return entitys; + } + + + /** + * 导出表格方法 + * + * @param temporaryFilePath + * @param sheetName excel名称 + * @param keyMap 字段key-name + * @param list 数据 + * @param excelModel 表格参数 + * @return + */ + public static DownloadVO creatModelExcel(String temporaryFilePath, String sheetName, Map keyMap, List> list, ExcelModel excelModel) { + List keys = excelModel.getSelectKey(); + DownloadVO vo = DownloadVO.builder().build(); + List entitys = new ArrayList<>(); + for (String key : keys) { + String name = keyMap.get(key); + entitys.add(new ExcelExportEntity(name, key)); + } + ExportParams exportParams = new ExportParams(null, "表单信息"); + exportParams.setStyle(ExcelExportStyler.class); + exportParams.setType(ExcelType.XSSF); + try { + @Cleanup Workbook workbook = new HSSFWorkbook(); + if (entitys.size() > 0) { + //去除空数据 + List> dataList = new ArrayList<>(); + for (Map map : list) { + int i = 0; + for (String key : keys) { + Object o = map.get(key); + if (o != null) { + i++; + } + } + if (i > 0) { + dataList.add(map); + } + } + if (dataList.size() == 0) { + dataList.add(new HashMap<>()); + } + workbook = ExcelExportUtil.exportExcel(exportParams, entitys, dataList); + ExcelHelper helper = new ExcelHelper(); + helper.init(workbook, exportParams, entitys, excelModel); + helper.doPreHandle(); + helper.doPostHandle(); + } + String fileName = sheetName + "_" + DateUtil.dateNow("yyyyMMddHHmmss") + ".xls"; + MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName); + + FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName); + vo.setName(fileInfo.getFilename()); + vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName); + } catch (Exception e) { + e.printStackTrace(); + } + return vo; + } + + + public static DownloadVO exportExceptionReport(String temporaryFilePath, String menuFullName, Map keyMap, List> dataList, ExcelModel excelModel) { + DownloadVO vo = DownloadVO.builder().build(); + try { + List entitys = ExcelTool.getImportExcelExportEntityList(true, keyMap); + @Cleanup Workbook workbook = new HSSFWorkbook(); + ExportParams exportParams = new ExportParams(null, "错误报告"); + exportParams.setFreezeCol(1); + exportParams.setType(ExcelType.XSSF); + exportParams.setStyle(ExcelExportStyler.class); + workbook = ExcelExportUtil.exportExcel(exportParams, entitys, dataList); + ExcelHelper helper = new ExcelHelper(); + helper.init(workbook, exportParams, entitys, excelModel); + helper.doPreHandle(); + helper.doPostHandle(); + + String fileName = menuFullName + "导入模板错误报告_" + DateUtil.dateNow("yyyyMMddHHmmss") + ".xls"; + MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName); + + FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName); + vo.setName(fileInfo.getFilename()); + vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName); + } catch (Exception e) { + e.printStackTrace(); + } + return vo; + } + + public static Map importPreview(String temporaryFilePath, String fileName, Map keyMap) { + return importPreview(temporaryFilePath, fileName, keyMap, 0, 1); + } + + public static Map importPreview(String temporaryFilePath, String fileName, Map keyMap, Integer titleIndex, Integer headerRows) { + Map headAndDataMap = new HashMap<>(2); + String filePath = FileUploadUtils.getLocalBasePath() + temporaryFilePath; + FileUploadUtils.downLocal(temporaryFilePath, filePath, fileName); + File temporary = new File(XSSEscape.escapePath(filePath + fileName)); + ImportParams params = new ImportParams(); + params.setTitleRows(titleIndex); + params.setHeadRows(headerRows); + params.setNeedVerify(true); + List columns = new ArrayList<>(); + for (String key : keyMap.keySet()) { + columns.add(new ExcelViewFieldModel(key, keyMap.get(key))); + } + List> jsonToList; + List excelDataList; + try { + jsonToList = JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(columns)); + InputStream inputStream = ExcelUtil.solveOrginTitle(temporary, titleIndex, headerRows); + excelDataList = ExcelUtil.importExcelByInputStream(inputStream, titleIndex, headerRows, Map.class); + } catch (Exception e) { + e.printStackTrace(); + throw new DataException(MsgCode.VS407.get()); + } + List> resultList = getResultList(excelDataList, new ArrayList<>(keyMap.keySet())); + if (resultList.size() > 1000) { + throw new DataException(MsgCode.ETD117.get()); + } + headAndDataMap.put("dataRow", resultList); + headAndDataMap.put("headerRow", jsonToList); + return headAndDataMap; + } + + /** + * key字段处理 + * + * @param excelDataList + * @param selectKey + * @return + */ + public static List> getResultList(List excelDataList, List selectKey) { + List> allDataList = new ArrayList<>(); + for (int z = 0; z < excelDataList.size(); z++) { + Map dataMap = new HashMap<>(16); + Map m = excelDataList.get(z); + List excelEntrySet = new ArrayList<>(m.entrySet()); + //取出的数据最后一行 不带行标签 + int resultsize = z == excelDataList.size() - 1 ? excelEntrySet.size() : m.containsKey("excelRowNum") ? excelEntrySet.size() - 1 : excelEntrySet.size(); + if (resultsize < selectKey.size()) { + throw new DataException(MsgCode.VS407.get()); + } + for (int e = 0; e < resultsize; e++) { + Map.Entry o = (Map.Entry) excelEntrySet.get(e); + String entryKey = o.getKey().toString(); + String substring = entryKey.substring(entryKey.lastIndexOf("(") + 1, entryKey.lastIndexOf(")")); + boolean contains = selectKey.contains(substring); + if (!contains) { + throw new DataException(MsgCode.VS407.get()); + } + dataMap.put(substring, o.getValue()); + } + allDataList.add(dataMap); + } + return allDataList; + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/FileManageUtil.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/FileManageUtil.java new file mode 100644 index 0000000..a9ac7ed --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/FileManageUtil.java @@ -0,0 +1,71 @@ +package com.yunzhupaas.base.util; + +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.model.FileModel; +import com.yunzhupaas.util.FileUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Component +public class FileManageUtil { + + @Autowired + private ConfigValueUtil configValueUtil; + + // 添加附件:将临时文件夹的文件拷贝到正式文件夹里面 + + /** + * 添加附件:将临时文件夹的文件拷贝到正式文件夹里面 + * @param data list集合 + */ + public void createFile(List data) { + if (data != null && data.size() > 0) { + String temporaryFilePath = configValueUtil.getTemporaryFilePath(); + String systemFilePath = configValueUtil.getSystemFilePath(); + for (FileModel item : data) { + FileUtil.copyFile(temporaryFilePath + item.getFileId(), systemFilePath + item.getFileId()); + } + } + } + + /** + * 更新附件 + * @param data list集合 + */ + public void updateFile(List data) { + if (data != null && data.size() > 0) { + String temporaryFilePath = configValueUtil.getTemporaryFilePath(); + String systemFilePath = configValueUtil.getSystemFilePath(); + for (FileModel item : data) { + if ("add".equals(item.getFileType())) { + FileUtil.copyFile(temporaryFilePath + item.getFileId(), systemFilePath + item.getFileId()); + } else if ("delete".equals(item.getFileType())) { + FileUtil.deleteFile(systemFilePath + item.getFileId()); + } + } + } + } + + /** + * 删除附件 + * @param data list集合 + */ + public void deleteFile(List data) { + if (data != null && data.size() > 0) { + String systemFilePath = configValueUtil.getSystemFilePath(); + for (FileModel item : data) { + FileUtil.deleteFile(systemFilePath + item.getFileId()); + } + } + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/MonitorUtil.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/MonitorUtil.java new file mode 100644 index 0000000..ba28f69 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/MonitorUtil.java @@ -0,0 +1,199 @@ +package com.yunzhupaas.base.util; + +import cn.hutool.core.date.BetweenFormatter; +import cn.hutool.core.date.DateUtil; +import com.yunzhupaas.base.model.monitor.*; +import com.yunzhupaas.util.IpUtil; +import lombok.Data; +import oshi.SystemInfo; +import oshi.hardware.CentralProcessor; +import oshi.hardware.GlobalMemory; +import oshi.hardware.HardwareAbstractionLayer; +import oshi.software.os.FileSystem; +import oshi.software.os.OSFileStore; +import oshi.software.os.OperatingSystem; +import oshi.util.FormatUtil; +import oshi.util.Util; + +import java.lang.management.ManagementFactory; +import java.net.InetAddress; +import java.net.NetworkInterface; +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.Enumeration; +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class MonitorUtil { + + private static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat("0.00"); + private CpuModel cpu = null; + private DiskModel disk = null; + private MemoryModel memory = null; + private SwapModel swap = null; + private SystemModel system = null; + + public MonitorUtil() { + SystemInfo si = new SystemInfo(); + OperatingSystem os = si.getOperatingSystem(); + HardwareAbstractionLayer hal = si.getHardware(); + this.cpu = getCpuInfo(hal.getProcessor()); + this.memory = getMemoryInfo(hal.getMemory()); + this.disk = getDiskInfo(os); + this.system = getSystemInfo(os); + this.swap = getSwapInfo(hal.getMemory()); + } + + /** + * 获取磁盘信息 + * + * @return / + */ + private DiskModel getDiskInfo(OperatingSystem os) { + DiskModel diskInfo = new DiskModel(); + FileSystem fileSystem = os.getFileSystem(); + List fsArray = fileSystem.getFileStores(); + long total = 0L; + long available = 0L; + long used = 0L; + for (OSFileStore fs : fsArray) { + total += fs.getTotalSpace(); + available += fs.getUsableSpace(); + } + used = total - available; + diskInfo.setTotal(FormatUtil.formatBytes(total)); + diskInfo.setAvailable(FormatUtil.formatBytes(available)); + diskInfo.setUsed(FormatUtil.formatBytes(used)); + diskInfo.setUsageRate(DECIMAL_FORMAT.format(used / (double) total * 100)); + return diskInfo; + } + + /** + * 获取交换区信息 + * + * @param memory / + * @return / + */ + private SwapModel getSwapInfo(GlobalMemory memory) { + SwapModel swapInfo = new SwapModel(); + swapInfo.setTotal(FormatUtil.formatBytes(memory.getVirtualMemory().getSwapTotal())); + swapInfo.setAvailable(FormatUtil.formatBytes(memory.getVirtualMemory().getSwapTotal() - memory.getVirtualMemory().getSwapUsed())); + swapInfo.setUsageRate(DECIMAL_FORMAT.format(memory.getVirtualMemory().getSwapUsed() / (double) memory.getVirtualMemory().getSwapTotal() * 100)); + swapInfo.setUsed(FormatUtil.formatBytes(memory.getVirtualMemory().getSwapUsed())); + return swapInfo; + } + + /** + * 获取内存信息 + * + * @param memory / + * @return / + */ + private MemoryModel getMemoryInfo(GlobalMemory memory) { + MemoryModel memoryInfo = new MemoryModel(); + memoryInfo.setTotal(FormatUtil.formatBytes(memory.getTotal())); + memoryInfo.setAvailable(FormatUtil.formatBytes(memory.getAvailable())); + memoryInfo.setUsed(FormatUtil.formatBytes(memory.getTotal() - memory.getAvailable())); + memoryInfo.setUsageRate(DECIMAL_FORMAT.format((memory.getTotal() - memory.getAvailable()) / (double) memory.getTotal() * 100)); + return memoryInfo; + } + + /** + * 获取Cpu相关信息 + * + * @param processor / + * @return / + */ + private CpuModel getCpuInfo(CentralProcessor processor) { + CpuModel cpuInfo = new CpuModel(); + cpuInfo.setName(processor.getProcessorIdentifier().getName()); + cpuInfo.setPackageName(processor.getPhysicalPackageCount() + "个物理CPU"); + cpuInfo.setCore(processor.getPhysicalProcessorCount() + "个物理核心"); + cpuInfo.setCoreNumber(processor.getPhysicalProcessorCount()); + cpuInfo.setLogic(processor.getLogicalProcessorCount() + "个逻辑CPU"); + // CPU信息 + long[] prevTicks = processor.getSystemCpuLoadTicks(); + // 等待1秒... + Util.sleep(1000); + long[] ticks = processor.getSystemCpuLoadTicks(); + long user = ticks[CentralProcessor.TickType.USER.getIndex()] - prevTicks[CentralProcessor.TickType.USER.getIndex()]; + long nice = ticks[CentralProcessor.TickType.NICE.getIndex()] - prevTicks[CentralProcessor.TickType.NICE.getIndex()]; + long sys = ticks[CentralProcessor.TickType.SYSTEM.getIndex()] - prevTicks[CentralProcessor.TickType.SYSTEM.getIndex()]; + long idle = ticks[CentralProcessor.TickType.IDLE.getIndex()] - prevTicks[CentralProcessor.TickType.IDLE.getIndex()]; + long iowait = ticks[CentralProcessor.TickType.IOWAIT.getIndex()] - prevTicks[CentralProcessor.TickType.IOWAIT.getIndex()]; + long irq = ticks[CentralProcessor.TickType.IRQ.getIndex()] - prevTicks[CentralProcessor.TickType.IRQ.getIndex()]; + long softirq = ticks[CentralProcessor.TickType.SOFTIRQ.getIndex()] - prevTicks[CentralProcessor.TickType.SOFTIRQ.getIndex()]; + long steal = ticks[CentralProcessor.TickType.STEAL.getIndex()] - prevTicks[CentralProcessor.TickType.STEAL.getIndex()]; + long totalCpu = user + nice + sys + idle + iowait + irq + softirq + steal; + cpuInfo.setUsed(DECIMAL_FORMAT.format(100d * user / totalCpu + 100d * sys / totalCpu)); + cpuInfo.setIdle(DECIMAL_FORMAT.format(100d * idle / totalCpu)); + return cpuInfo; + } + + /** + * 获取系统相关信息,系统、运行天数、系统IP + * + * @param + * @return / + */ + private SystemModel getSystemInfo(OperatingSystem operatingSystem) { + SystemModel systemInfo = new SystemModel(); + String osName = System.getProperty("os.name"); + String os = osName; + if(osName.contains("Linux")){ + os = operatingSystem.toString(); + } + // jvm 运行时间 + long time = ManagementFactory.getRuntimeMXBean().getStartTime(); + Date date = new Date(time); + // 计算项目运行时间 + String formatBetween = DateUtil.formatBetween(date, new Date(), BetweenFormatter.Level.HOUR); + // 系统信息 + systemInfo.setOs(os); + systemInfo.setDay(formatBetween); + systemInfo.setIp(getLocalhostIp()); + return systemInfo; + } + + /** + *

获取当前服务器所有符合条件的网络地址

+ * + * @return List 网络地址列表 + * @throws Exception 默认异常 + */ + private static String getLocalhostIp() { + List result = new ArrayList<>(); + try { + // 遍历所有的网络接口 + for (Enumeration networkInterfaces = NetworkInterface.getNetworkInterfaces(); networkInterfaces.hasMoreElements(); ) { + NetworkInterface ni = (NetworkInterface) networkInterfaces.nextElement(); + // 在所有的接口下再遍历IP + for (Enumeration addresses = ni.getInetAddresses(); addresses.hasMoreElements(); ) { + InetAddress address = (InetAddress) addresses.nextElement(); + //排除LoopbackAddress、SiteLocalAddress、LinkLocalAddress、MulticastAddress类型的IP地址 + if (!address.isLoopbackAddress() + /*&& !inetAddr.isSiteLocalAddress()*/ + && !address.isLinkLocalAddress() && !address.isMulticastAddress()) { + String hostAddress = address.getHostAddress(); + result.add(hostAddress); + } + } + } + }catch (Exception e) { + + } + String ip = String.join(",",result); + return ip; + } + + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/OptimizeUtil.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/OptimizeUtil.java new file mode 100644 index 0000000..34589e5 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/OptimizeUtil.java @@ -0,0 +1,54 @@ +package com.yunzhupaas.base.util; + + +import java.util.Arrays; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +public class OptimizeUtil { + + /** + * 允许文件类型 + * + * @param fileType 文件所有类型 + * @param fileExtension 当前文件类型 + * @return + */ + public static boolean fileType(String fileType, String fileExtension) { + String[] allowExtension = fileType.split(","); + return Arrays.asList(allowExtension).contains(fileExtension.toLowerCase()); + } + + /** + * 允许图片类型 + * + * @param imageType 图片所有类型 + * @param fileExtension 当前图片类型 + * @return + */ + public static boolean imageType(String imageType, String fileExtension) { + String[] allowExtension = imageType.split(","); + return Arrays.asList(allowExtension).contains(fileExtension.toLowerCase()); + } + + /** + * 允许上传大小 + * + * @param fileSize 文件大小 + * @param maxSize 最大的文件 + * @return + */ + public static boolean fileSize(Long fileSize, int maxSize) { + if (fileSize > maxSize) { + return true; + } + return false; + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/Pop3Util.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/Pop3Util.java new file mode 100644 index 0000000..83cd5a5 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/Pop3Util.java @@ -0,0 +1,528 @@ +package com.yunzhupaas.base.util; + +import com.yunzhupaas.base.model.MailAccount; +import com.yunzhupaas.base.model.MailFile; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.base.entity.EmailReceiveEntity; +import com.yunzhupaas.util.DateUtil; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RandomUtil; +import lombok.Cleanup; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import jakarta.mail.*; +import jakarta.mail.internet.InternetAddress; +import jakarta.mail.internet.MimeMessage; +import jakarta.mail.internet.MimeMultipart; +import jakarta.mail.internet.MimeUtility; +import java.io.*; +import java.text.SimpleDateFormat; +import java.util.*; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Slf4j +@Component +public class Pop3Util { + + @Autowired + private ConfigValueUtil configValueUtil; + + /** + * 邮箱验证 + * + * @param mailAccount + * @return + */ + public String checkConnected(MailAccount mailAccount) { + try { + Properties props = getProperties(mailAccount.getSsl()); + Session session = getSession(props); + @Cleanup Store store = getStore(session, mailAccount); + return "true"; + } catch (Exception e) { + log.error(e.getMessage()); + return e.getMessage(); + } + } + + /** + * 接收邮件 + */ + public Map popMail(MailAccount mailAccount) { + List entity = new ArrayList<>(); + Map map = new HashMap<>(16); + try { + Properties props = getProperties(mailAccount.getSsl()); + Session session = getSession(props); + @Cleanup Store store = getStore(session, mailAccount); + @Cleanup Folder folder = getFolder(store); + int receiveCount = folder.getMessageCount(); + Message[] messages = folder.getMessages(); + entity = parseMessage(messages); + map.put("receiveCount", receiveCount); + map.put("mailList", entity); + return map; + } catch (Exception e) { + log.error(e.getMessage()); + } + return map; + } + + /** + * 删除邮件 + * + * @param mailAccount + * @param mid + */ + public void deleteMessage(MailAccount mailAccount, String mid) { + try { + Properties props = getProperties(false); + Session session = getSession(props); + @Cleanup Store store = getStore(session, mailAccount); + @Cleanup Folder folder = getFolder(store); + Message[] messages = folder.getMessages(); + deleteMessage(messages, mid); + } catch (Exception e) { + log.error(e.getMessage()); + } + } + + /** + * 获取Properties + * + * @param ssl + */ + private Properties getProperties(boolean ssl) { + Properties props = new Properties(); + props.setProperty("mail.store.protocol", "pop3"); + props.setProperty("mail.pop3.auth", "true"); + // 设置连接超时时间 + props.put("mail.pop3.connectiontimeout", "35000"); + // 设置读取超时时间 + props.put("mail.pop3.timeout", "10000"); + // 设置写入超时时间 + props.put("mail.pop3.writetimeout", "10000"); + if (ssl) { + props.put("mail.pop3.ssl.enable", "true"); + props.put("mail.pop3.socketFactory.fallback", "false"); + props.setProperty( "mail.pop3.socketFactory.class", "javax.net.ssl.SSLSocketFactory"); + } + return props; + } + + /** + * 获取Session + * + * @param props + */ + private Session getSession(Properties props) { + Session session = Session.getInstance(props); + session.setDebug(true); + return session; + } + + /** + * 获取Store + */ + private Store getStore(Session session, MailAccount mailAccount) throws Exception { + Store store = session.getStore(); + store.connect(mailAccount.getPop3Host(), mailAccount.getPop3Port(), mailAccount.getAccount(), mailAccount.getPassword()); + return store; + } + + /** + * 获取Folder + */ + private Folder getFolder(Store store) throws Exception { + Folder folder = store.getFolder("INBOX"); + folder.open(Folder.READ_ONLY); + return folder; + } + + /** + * 解析邮件 + * + * @param messages 要解析的邮件列表 + */ + private List parseMessage(Message... messages) throws MessagingException, IOException { + List receiveEntity = new ArrayList<>(); + if (messages == null || messages.length < 1) { + throw new MessagingException("未找到要解析的邮件!"); + } + List mailFiles = new ArrayList<>(); + String mailfiles = ""; + for (int i = 0, count = messages.length; i < count; i++) { + MimeMessage msg = (MimeMessage) messages[i]; + mailfiles = null; + boolean isContainerAttachment = isContainAttachment(msg); + if (isContainerAttachment) { + //保存附件 + mailFiles = saveAttachment(msg, configValueUtil.getEmailFilePath()); + mailfiles = JsonUtil.getObjectToString(mailFiles); + }else { + mailfiles="[]"; + } + StringBuilder content = new StringBuilder(30); + getMailTextContent(msg, content); + EmailReceiveEntity entity = new EmailReceiveEntity(); + entity.setId(RandomUtil.uuId()); + entity.setMAccount(getReceiveAddress(msg, null)); + entity.setMID(getMessageId(msg)); + if(getFrom(msg)==null){ + entity.setSender("00000"); + entity.setSenderName("匿名"); + }else { + entity.setSender(getFrom(msg).split("_")[0]); + entity.setSenderName(getFrom(msg).split("_")[1]); + } + entity.setSubject(getSubject(msg)); + entity.setBodyText(content.toString()); + entity.setAttachment(mailfiles); + entity.setFdate(msg.getSentDate()); + entity.setIsRead(0); + receiveEntity.add(entity); + } + return receiveEntity; + } + + /** + * 解析邮件 + * + * @param messages 要解析的邮件列表 + */ + private void deleteMessage(Message[] messages, String mid) throws MessagingException { + if (messages == null || messages.length < 1) { + throw new MessagingException("未找到要解析的邮件!"); + } + for (int i = 0; i < messages.length; i++) { + Message message = messages[i]; + MimeMessage msg = (MimeMessage) messages[i]; + if (deleteMessageId(msg, mid)) { + message.setFlag(Flags.Flag.DELETED, true); + } + } + } + + /** + * 判断mid是否一致 + * + * @param msg + * @param mid + * @return + * @throws MessagingException + */ + private boolean deleteMessageId(MimeMessage msg, String mid) throws MessagingException { + String messageId = msg.getMessageID(); + messageId = messageId.replace("<", ""); + messageId = messageId.replace(">", ""); + if (messageId.equals(mid)) { + return true; + } + return false; + } + + /** + * 获得邮件主题 + * + * @param msg 邮件内容 + * @return 解码后的邮件主题 + */ + private String getSubject(MimeMessage msg) throws UnsupportedEncodingException, MessagingException { + return MimeUtility.decodeText(msg.getSubject()); + } + + /** + * 获得邮件发件人 + * + * @param msg 邮件内容 + * @return 姓名 + * @throws MessagingException + * @throws UnsupportedEncodingException + */ + private String getFrom(MimeMessage msg) throws MessagingException, UnsupportedEncodingException { + String from = ""; + Address[] froms = msg.getFrom(); + InternetAddress address = (InternetAddress) froms[0]; + String person = address.getPersonal(); + if (person != null) { + person = MimeUtility.decodeText(person) + " "; + } else { + person = ""; + } + from = person + "_" + address.getAddress(); + return from; + } + + /** + * 获取邮件的id + */ + private String getMessageId(MimeMessage msg) throws MessagingException { + String messageId = msg.getMessageID(); + messageId = messageId.replace("<", ""); + messageId = messageId.replace(">", ""); + return messageId; + } + + /** + * 根据收件人类型,获取邮件收件人、抄送和密送地址。如果收件人类型为空,则获得所有的收件人 + *

Message.RecipientType.TO 收件人

+ *

Message.RecipientType.CC 抄送

+ *

Message.RecipientType.BCC 密送

+ * + * @param msg 邮件内容 + * @param type 收件人类型 + * @return 收件人1 <邮件地址1>, 收件人2 <邮件地址2>, ... + * @throws MessagingException + */ + private String getReceiveAddress(MimeMessage msg, Message.RecipientType type) throws MessagingException { + StringBuilder receiveAddress = new StringBuilder(); + Address[] addresss = null; + if (type == null) { + addresss = msg.getAllRecipients(); + } else { + addresss = msg.getRecipients(type); + } + if (addresss == null || addresss.length < 1) { + return null; + } + for (Address address : addresss) { + InternetAddress internetAddress = (InternetAddress) address; + receiveAddress.append(internetAddress.toUnicodeString()).append(","); + } + //删除最后一个逗号 + receiveAddress.deleteCharAt(receiveAddress.length() - 1); + return receiveAddress.toString(); + } + + /** + * 获得邮件发送时间 + * + * @param msg 邮件内容 + * @return yyyy年mm月dd日 星期X HH:mm + * @throws MessagingException + */ + private String getSentDate(MimeMessage msg, String pattern) throws MessagingException { + Date receivedDate = msg.getSentDate(); + if (receivedDate == null) { + return ""; + } + if (pattern == null || "".equals(pattern)) { + pattern = "yyyy年MM月dd日 E HH:mm "; + } + return new SimpleDateFormat(pattern).format(receivedDate); + } + + /** + * 判断邮件中是否包含附件 + * + * @return 邮件中存在附件返回true,不存在返回false + * @throws MessagingException + * @throws IOException + */ + private boolean isContainAttachment(Part part) throws MessagingException, IOException { + boolean flag = false; + if (part.isMimeType("multipart/*")) { + MimeMultipart multipart = (MimeMultipart) part.getContent(); + int partCount = multipart.getCount(); + for (int i = 0; i < partCount; i++) { + BodyPart bodyPart = multipart.getBodyPart(i); + String disp = bodyPart.getDisposition(); + if (disp != null && (disp.equalsIgnoreCase(Part.ATTACHMENT) || disp.equalsIgnoreCase(Part.INLINE))) { + flag = true; + } else if (bodyPart.isMimeType("multipart/*")) { + flag = isContainAttachment(bodyPart); + } else { + String contentType = bodyPart.getContentType(); + if (contentType.contains("application")) { + flag = true; + } + if (contentType.contains("name")) { + flag = true; + } + } + if (flag) { + break; + } + } + } else if (part.isMimeType("message/rfc822")) { + flag = isContainAttachment((Part) part.getContent()); + } + return flag; + } + + /** + * 判断邮件是否已读 + * + * @param msg 邮件内容 + * @return 如果邮件已读返回true, 否则返回false + * @throws MessagingException + */ + private boolean isSeen(MimeMessage msg) throws MessagingException { + return msg.getFlags().contains(Flags.Flag.SEEN); + } + + /** + * 判断邮件是否需要阅读回执 + * + * @param msg 邮件内容 + * @return 需要回执返回true, 否则返回false + * @throws MessagingException + */ + private boolean isReplySign(MimeMessage msg) throws MessagingException { + boolean replySign = false; + String[] headers = msg.getHeader("Disposition-Notification-To"); + if (headers != null) { + replySign = true; + } + return replySign; + } + + /** + * 获得邮件的优先级 + * + * @param msg 邮件内容 + * @return 1(High):紧急 3:普通(Normal) 5:低(Low) + * @throws MessagingException + */ + private String getPriority(MimeMessage msg) throws MessagingException { + String priority = "普通"; + String[] headers = msg.getHeader("X-Priority"); + if (headers != null) { + String headerPriority = headers[0]; + if (headerPriority.indexOf("1") != -1 || headerPriority.indexOf("High") != -1) { + priority = "紧急"; + } else if (headerPriority.indexOf("5") != -1 || headerPriority.indexOf("Low") != -1) { + priority = "低"; + } else { + priority = "普通"; + } + } + return priority; + } + + /** + * 获得邮件文本内容 + * + * @param part 邮件体 + * @param content 存储邮件文本内容的字符串 + * @throws MessagingException + * @throws IOException + */ + private void getMailTextContent(Part part, StringBuilder content) throws MessagingException, IOException { + boolean isContainTextAttach = part.getContentType().indexOf("name") > 0; + if (part.isMimeType("text/html") && !isContainTextAttach) { + content.append(part.getContent().toString()); + } else if (part.isMimeType("message/rfc822")) { + getMailTextContent((Part) part.getContent(), content); + } else if (part.isMimeType("multipart/*")) { + Multipart multipart = (Multipart) part.getContent(); + int partCount = multipart.getCount(); + for (int i = 0; i < partCount; i++) { + BodyPart bodyPart = multipart.getBodyPart(i); + getMailTextContent(bodyPart, content); + } + } + } + + /** + * 保存附件 + * + * @param part 邮件中多个组合体中的其中一个组合体 + * @param destDir 附件保存目录 + * @throws UnsupportedEncodingException + * @throws MessagingException + * @throws FileNotFoundException + * @throws IOException + */ + private List saveAttachment(Part part, String destDir) throws UnsupportedEncodingException, MessagingException, + FileNotFoundException, IOException { + List mailFiles = new ArrayList<>(); + if (part.isMimeType("multipart/*")) { + Multipart multipart = (Multipart) part.getContent(); + int partCount = multipart.getCount(); + for (int i = 0; i < partCount; i++) { + BodyPart bodyPart = multipart.getBodyPart(i); + String disp = bodyPart.getDisposition(); + if (disp != null && (disp.equalsIgnoreCase(Part.ATTACHMENT) || disp.equalsIgnoreCase(Part.INLINE))) { + MailFile mailFile = new MailFile(); + @Cleanup InputStream is = bodyPart.getInputStream(); + //解决附件中文乱码 + String fileName=MimeUtility.decodeText(bodyPart.getFileName()); + String fileType=fileName.split("\\.")[1]; + + mailFile.setFileId(RandomUtil.uuId()+"."+fileType); + saveFile(is, destDir, decodeText(mailFile.getFileId())); + File file = new File(destDir + decodeText(fileName)); + mailFile.setFileName(fileName); + mailFile.setFileSize(String.valueOf(file.length())); + mailFile.setFileState("-1"); + mailFile.setFileTime(DateUtil.getNow()); + mailFiles.add(mailFile); + } else if (bodyPart.isMimeType("multipart/*")) { + saveAttachment(bodyPart, destDir); + } else { + String contentType = bodyPart.getContentType(); + if (contentType.indexOf("name") != -1 || contentType.indexOf("application") != -1) { + saveFile(bodyPart.getInputStream(), destDir, decodeText(bodyPart.getFileName())); + File file = new File(destDir + decodeText(bodyPart.getFileName())); + MailFile mailFile = new MailFile(); + mailFile.setFileId(RandomUtil.uuId()); + mailFile.setFileName(file.getName()); + mailFile.setFileSize(String.valueOf(file.length())); + mailFile.setFileState("-1"); + mailFile.setFileTime(DateUtil.getNow()); + mailFiles.add(mailFile); + } + } + } + } else if (part.isMimeType("message/rfc822")) { + saveAttachment((Part) part.getContent(), destDir); + } + return mailFiles; + } + + /** + * 读取输入流中的数据保存至指定目录 + * + * @param is 输入流 + * @param fileName 文件名 + * @param destDir 文件存储目录 + * @throws FileNotFoundException + * @throws IOException + */ + private void saveFile(InputStream is, String destDir, String fileName) + throws FileNotFoundException, IOException { + @Cleanup BufferedInputStream bis = new BufferedInputStream(is); + @Cleanup FileOutputStream fileOutputStream = new FileOutputStream(new File(destDir + fileName)); + @Cleanup BufferedOutputStream bos = new BufferedOutputStream(fileOutputStream); + int len = -1; + while ((len = bis.read()) != -1) { + bos.write(len); + bos.flush(); + } + } + + /** + * 文本解码 + * + * @param encodeText 解码MimeUtility.encodeText(String text)方法编码后的文本 + * @return 解码后的文本 + * @throws UnsupportedEncodingException + */ + private String decodeText(String encodeText) throws UnsupportedEncodingException { + if (encodeText == null || "".equals(encodeText)) { + return ""; + } else { + return MimeUtility.decodeText(encodeText); + } + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/SentMessageUtil.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/SentMessageUtil.java new file mode 100644 index 0000000..8742e95 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/SentMessageUtil.java @@ -0,0 +1,1413 @@ +package com.yunzhupaas.base.util; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.http.HttpRequest; +import cn.hutool.http.Method; +import com.alibaba.fastjson.JSONObject; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.SysConfigEntity; +import com.yunzhupaas.base.service.SysconfigService; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.flowable.model.trigger.TriggerModel; +import com.yunzhupaas.message.entity.*; +import com.yunzhupaas.message.enums.MessageTypeEnum; +import com.yunzhupaas.message.model.WxgzhMessageModel; +import com.yunzhupaas.message.model.message.DingTalkModel; +import com.yunzhupaas.message.model.message.EmailModel; +import com.yunzhupaas.message.model.SentMessageForm; +import com.yunzhupaas.base.SmsModel; +import com.yunzhupaas.message.service.*; +import com.yunzhupaas.message.util.*; +import com.yunzhupaas.message.util.weixingzh.WXGZHWebChatUtil; +import com.yunzhupaas.model.BaseSystemInfo; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.message.SmsUtil; +import com.yunzhupaas.util.third.DingTalkUtil; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.text.StringSubstitutor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.nio.charset.StandardCharsets; +import java.util.*; +import java.util.regex.Pattern; + +/** + * 消息实体类 + * + * @版本: V3.2.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021/4/22 9:06 + */ +@Component +@Slf4j +public class SentMessageUtil { + + @Autowired + private UserService userService; + @Autowired + private SysconfigService sysconfigService; + @Autowired + private MessageService messageService; + @Autowired + private SynThirdInfoService synThirdInfoService; + + @Autowired + private SendMessageConfigService sendMessageConfigService; + + @Autowired + private SendConfigTemplateService sendConfigTemplateService; + + @Autowired + private AccountConfigService accountConfigService; + + @Autowired + private MessageTemplateConfigService messageTemplateConfigService; + @Autowired + private MessageMonitorService messageMonitorService; + @Autowired + private SmsFieldService smsFieldService; + @Autowired + private ShortLinkService shortLinkService; + @Autowired + private WechatUserService wechatUserService; + @Autowired + protected AuthUtil authUtil; + @Autowired + private ConfigValueUtil configValueUtil; + + /** + * 发送消息 + * + * @param sentMessageForm + */ + public void sendMessage(SentMessageForm sentMessageForm) { + List toUserIdsList = sentMessageForm.getToUserIds(); + // 模板id + String templateId = sentMessageForm.getTemplateId(); + // 参数 + Map parameterMap = sentMessageForm.getParameterMap(); + UserInfo userInfo = sentMessageForm.getUserInfo(); + boolean flag = true; + if (!(toUserIdsList != null && toUserIdsList.size() > 0)) { + log.error("接收人员为空"); + flag = false; + } + if (StringUtil.isEmpty(templateId)) { + log.error("模板Id为空"); + flag = false; + } + if (flag) { + // 获取发送配置详情 + // MessageTemplateEntity entity = messageTemplateService.getInfo(templateId); + SendMessageConfigEntity entity = sendMessageConfigService.getInfoByEnCode(templateId); + if (entity != null) { + templateId = entity.getId(); + } else { + entity = sendMessageConfigService.getInfo(templateId); + } + if (entity != null) { + List list = sendConfigTemplateService.getDetailListByParentId(templateId); + if (list != null && list.size() > 0) { + for (SendConfigTemplateEntity entity1 : list) { + if (parameterMap.get(entity1.getId() + "@Title") == null) { + parameterMap.put(entity1.getId() + "@Title", sentMessageForm.getTitle()); + } + if (parameterMap.get(entity1.getId() + "@CreatorUserName") == null || StringUtil + .isEmpty(String.valueOf(parameterMap.get(entity1.getId() + "@CreatorUserName")))) { + parameterMap.put(entity1.getId() + "@CreatorUserName", + sentMessageForm.getUserInfo().getUserName()); + } + if (parameterMap.get(entity1.getId() + "@SendTime") == null || StringUtil + .isEmpty(String.valueOf(parameterMap.get(entity1.getId() + "@SendTime")))) { + parameterMap.put(entity1.getId() + "@SendTime", DateUtil.getNow().substring(11)); + } + if (parameterMap.get(entity1.getId() + "@FlowLink") == null) { + parameterMap.put(entity1.getId() + "@FlowLink", ""); + } + if ("1".equals(String.valueOf(entity1.getEnabledMark()))) { + String sendType = entity1.getMessageType(); + MessageTypeEnum typeEnum = MessageTypeEnum.getByCode(sendType); + Map contentMsg = sentMessageForm.getContentMsg(); + switch (typeEnum) { + case SysMessage: + // 站内消息、 + for (String toUserId : toUserIdsList) { + List toUser = new ArrayList<>(); + String content = sentMessageForm.getContent(); + MessageTemplateConfigEntity templateConfigEntity = messageTemplateConfigService + .getInfo(entity1.getTemplateId()); + String title = sentMessageForm.getTitle(); + String appLink = ""; + if (templateConfigEntity != null) { + title = templateConfigEntity.getTitle(); + String msg = contentMsg.get(toUserId) != null ? contentMsg.get(toUserId) + : "{}"; + byte[] bytes = msg.getBytes(StandardCharsets.UTF_8); + String encode = Base64.getEncoder().encodeToString(bytes); + // 流程审批页面链接地址 + // 流程审批页面链接地址 + String pcLink = "/workFlowDetail?config=" + encode; + appLink = "/pages/workFlow/flowBefore/index?config=" + encode; + // 转换为短链 + String shortLink = shortLinkService.shortLink( + pcLink + toUserId + templateConfigEntity.getMessageType()); + shortLink = getShortLink(pcLink, toUserId, shortLink, + templateConfigEntity.getMessageType()); + String link = configValueUtil.getApiDomain() + "/api/message/ShortLink/" + + shortLink; + if (StringUtil.isNotBlank(userInfo.getTenantId())) { + link = link + "/" + userInfo.getTenantId(); + } + if (title.contains("{@FlowLink}")) { + title = title.replace("{@FlowLink}", link + " "); + // 链接数据保存 + this.saveShortLink(pcLink, appLink, shortLink, userInfo, toUserId, msg); + } + Map msgMap = new HashMap<>(); + msgMap = getParamMap(entity1.getId(), parameterMap); + if (StringUtil.isNotEmpty(title)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(msgMap, "{", + "}"); + title = strSubstitutor.replace(title); + } + } + toUser.add(toUserId); + messageService.sentMessage(toUser, title, content, contentMsg, userInfo); + // 消息监控写入 + MessageMonitorEntity monitorEntity = new MessageMonitorEntity(); + monitorEntity.setId(RandomUtil.uuId()); + monitorEntity.setReceiveUser(JsonUtil.getObjectToString(toUser)); + monitorEntity.setSendTime(DateUtil.getNowDate()); + monitorEntity.setCreatorTime(DateUtil.getNowDate()); + monitorEntity.setCreatorUserId(userInfo.getUserId()); + createMessageMonitor(monitorEntity, templateConfigEntity, null, null, userInfo, + toUser, title); + messageMonitorService.create(monitorEntity); + } + String url = configValueUtil.getApiDomain() + "/api/workflow/trigger/MsgExecute"; + TriggerModel model = new TriggerModel(); + model.setUserInfo(userInfo); + model.setId(entity1.getTemplateId()); + HttpRequest request = HttpRequest.of(url).method(Method.POST) + .body(JsonUtil.getObjectToString(model)); + request.header(Constants.AUTHORIZATION, userInfo.getToken()); + request.execute().body(); + break; + case SmsMessage: + // 发送短信 + sendSms(toUserIdsList, userInfo, entity1, parameterMap, contentMsg); + break; + case MailMessage: + // 邮件 + SendMail(toUserIdsList, userInfo, sendType, entity1, parameterMap, contentMsg); + break; + case QyMessage: + // 企业微信 + JSONObject jsonObject = SendQyWebChat(toUserIdsList, userInfo, sendType, entity1, + parameterMap, contentMsg); + if (!(Boolean) jsonObject.get("code")) { + log.error("发送企业微信消息失败,错误:" + jsonObject.get("error")); + } + break; + case DingMessage: + // 钉钉 + JSONObject jsonObject1 = SendDingTalk(toUserIdsList, userInfo, sendType, entity1, + parameterMap, contentMsg); + if (!(Boolean) jsonObject1.get("code")) { + log.error("发送企业微信消息失败,错误:" + jsonObject1.get("error")); + } + break; + case WebHookMessage: + // webhook + SendWebHook(sendType, userInfo, entity1, parameterMap, new HashMap<>()); + break; + case WechatMessage: + // 微信公众号 + SendWXGzhChat(toUserIdsList, userInfo, sendType, entity1, contentMsg, parameterMap); + break; + default: + break; + } + } + } + } + } else { + for (String toUserId : toUserIdsList) { + List toUser = new ArrayList<>(); + toUser.add(toUserId); + String content = sentMessageForm.getContent(); + Map contentMsg = sentMessageForm.getContentMsg(); + String title = sentMessageForm.getTitle(); + messageService.sentMessage(toUser, title, content, contentMsg, userInfo); + // 消息监控写入 + MessageMonitorEntity monitorEntity = new MessageMonitorEntity(); + monitorEntity.setId(RandomUtil.uuId()); + monitorEntity.setReceiveUser(JsonUtil.getObjectToString(toUser)); + monitorEntity.setSendTime(DateUtil.getNowDate()); + monitorEntity.setCreatorTime(DateUtil.getNowDate()); + monitorEntity.setCreatorUserId(userInfo.getUserId()); + monitorEntity.setMessageType("1"); + createMessageMonitor(monitorEntity, null, null, null, userInfo, toUser, title); + messageMonitorService.create(monitorEntity); + } + } + } + } + + public void SendWebHook(String sendType, UserInfo userInfo, SendConfigTemplateEntity entity, + Map parameterMap, Map contentMsg) { + MessageTemplateConfigEntity msgTemEntity = messageTemplateConfigService.getInfo(entity.getTemplateId()); + AccountConfigEntity accountEntity = accountConfigService.getInfo(entity.getAccountConfigId()); + MessageMonitorEntity monitorEntity = new MessageMonitorEntity(); + monitorEntity.setId(RandomUtil.uuId()); + monitorEntity.setSendTime(DateUtil.getNowDate()); + monitorEntity.setCreatorTime(DateUtil.getNowDate()); + monitorEntity.setCreatorUserId(userInfo.getUserId()); + String content = msgTemEntity.getContent(); + // 获取消息模板参数 + parameterMap = getParamMap(entity.getId(), parameterMap); + // 替换参数 + if (StringUtil.isNotEmpty(content)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(parameterMap, "{", "}"); + content = strSubstitutor.replace(content); + } + String title = msgTemEntity.getTitle(); + if (StringUtil.isNotEmpty(title)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(parameterMap, "{", "}"); + title = strSubstitutor.replace(title); + } + title = systemParam(parameterMap, contentMsg, title, userInfo); + content = systemParam(parameterMap, contentMsg, content, userInfo); + if (entity != null) { + if (accountEntity != null) { + // 创建消息监控 + monitorEntity = createMessageMonitor(monitorEntity, msgTemEntity, accountEntity, content, userInfo, + null, title); + messageMonitorService.create(monitorEntity); + switch (accountEntity.getWebhookType()) { + case 1: + // 钉钉 + if (Objects.equals(1, accountEntity.getApproveType())) { + WebHookUtil.sendDDMessage(accountEntity.getWebhookAddress(), content); + } else if (Objects.equals(2, accountEntity.getApproveType())) { + WebHookUtil.sendDingDing(accountEntity.getWebhookAddress(), accountEntity.getBearer(), + content); + } + break; + case 2: + if (Objects.equals(1, accountEntity.getApproveType())) { + WebHookUtil.callWeChatBot(accountEntity.getWebhookAddress(), content); + } + break; + default: + break; + } + } else { + monitorEntity = createMessageMonitor(monitorEntity, msgTemEntity, null, content, userInfo, null, title); + messageMonitorService.create(monitorEntity); + } + } else { + monitorEntity = createMessageMonitor(monitorEntity, msgTemEntity, null, content, userInfo, null, title); + messageMonitorService.create(monitorEntity); + } + } + + /** + * 发送企业微信消息 + * + * @param toUserIdsList + * @param userInfo + * @param sendType + * @param entity + * @param parameterMap + * @return + */ + public JSONObject SendQyWebChat(List toUserIdsList, UserInfo userInfo, String sendType, + SendConfigTemplateEntity entity, Map parameterMap, Map contentMsg) { + MessageTemplateConfigEntity msgTemEntity = messageTemplateConfigService.getInfo(entity.getTemplateId()); + + JSONObject retJson = new JSONObject(); + boolean code = true; + StringBuilder error = new StringBuilder(); + // 获取接收人员的企业微信号、创建消息用户实体 + for (String userId : toUserIdsList) { + error = new StringBuilder(); + MessageMonitorEntity monitorEntity = new MessageMonitorEntity(); + monitorEntity.setId(RandomUtil.uuId()); + monitorEntity.setSendTime(DateUtil.getNowDate()); + monitorEntity.setCreatorTime(DateUtil.getNowDate()); + monitorEntity.setCreatorUserId(userInfo.getUserId()); + if (StringUtil.isEmpty(userId)) { + code = false; + error = error.append(";").append("接收人为空!"); + messageMonitorService.create(monitorEntity); + continue; + } + monitorEntity.setReceiveUser(userId); + UserEntity userEntity = userService.getInfo(userId); + if (ObjectUtil.isEmpty(userEntity)) { + code = false; + error = error.append(";").append("用户不存在!"); + messageMonitorService.create(monitorEntity); + continue; + } + if (msgTemEntity != null) { + // 获取消息模板参数 + Map msgMap = getParamMap(entity.getId(), parameterMap); + // 替换参数 + String content = msgTemEntity.getContent(); + String msg = contentMsg.get(userId) != null ? contentMsg.get(userId) : "{}"; + byte[] bytes = msg.getBytes(StandardCharsets.UTF_8); + String encode = Base64.getEncoder().encodeToString(bytes); + // 流程审批页面链接地址 + String pcLink = "/workFlowDetail?config=" + encode; + String appLink = "/pages/workFlow/flowBefore/index?config=" + encode; + // 转换为短链 + String shortLink = shortLinkService.shortLink(pcLink + userId + msgTemEntity.getMessageType()); + shortLink = getShortLink(pcLink, userId, shortLink, msgTemEntity.getMessageType()); + String msgTC = msgTemEntity.getTitle() + msgTemEntity.getContent(); + if (StringUtil.isNotBlank(msgTC)) { + if (msgTC.contains("{@FlowLink}")) { + // 链接数据保存 + this.saveShortLink(pcLink, appLink, shortLink, userInfo, userId, msg); + } + } + String link = configValueUtil.getApiDomain() + "/api/message/ShortLink/" + shortLink; + if (StringUtil.isNotBlank(userInfo.getTenantId())) { + link = link + "/" + userInfo.getTenantId(); + } + if (StringUtil.isNotEmpty(content)) { + if (content.contains("{@FlowLink}")) { + content = content.replace("{@FlowLink}", link + " "); + } + StringSubstitutor strSubstitutor = new StringSubstitutor(msgMap, "{", "}"); + content = strSubstitutor.replace(content); + } + + // 替换参数 + String title = msgTemEntity.getTitle(); + if (StringUtil.isNotEmpty(title)) { + if (title.contains("{@FlowLink}")) { + title = title.replace("{@FlowLink}", link + " "); + } + StringSubstitutor strSubstitutor = new StringSubstitutor(msgMap, "{", "}"); + title = strSubstitutor.replace(title); + } + title = systemParam(parameterMap, contentMsg, title, userInfo); + content = systemParam(parameterMap, contentMsg, content, userInfo); + monitorEntity.setTitle(title); + monitorEntity.setContent(content); + // 获取系统配置 + Map objModel = getSystemConfig(); + BaseSystemInfo config = JsonUtil.getJsonToBean(objModel, BaseSystemInfo.class); + String corpId = config.getQyhCorpId(); + String agentId = config.getQyhAgentId(); + // 获取的应用的Secret值(某个修复导致俩个秘钥反了,只能反正修复了) + String corpSecret = config.getQyhCorpSecret(); + String wxUserId = ""; + StringBuilder toWxUserId = new StringBuilder(); + String toUserIdAll = ""; + StringBuilder nullUserInfo = new StringBuilder(); + List messageReceiveList = new ArrayList<>(); + + // 相关参数验证 + if (StringUtil.isEmpty(corpId)) { + log.error("企业ID为空"); + code = false; + error = error.append(";").append(userEntity.getRealName() + ":企业ID为空!"); + messageMonitorService.create(monitorEntity); + continue; + } + if (StringUtil.isEmpty(corpSecret)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":Secret为空!"); + messageMonitorService.create(monitorEntity); + continue; + } + if (StringUtil.isEmpty(agentId)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":AgentId为空!"); + messageMonitorService.create(monitorEntity); + continue; + } + if (StringUtil.isEmpty(content)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":内容为空!"); + messageMonitorService.create(monitorEntity); + continue; + } + // 创建消息实体 + MessageEntity messageEntity = YunzhupaasMessageUtil.setMessageEntity(userInfo.getUserId(), content, + null, Integer.parseInt(sendType)); + // 创建消息监控 + monitorEntity = createMessageMonitor(monitorEntity, msgTemEntity, null, content, userInfo, null, title); + // 获取接收人员的企业微信号、创建消息用户实体 + // for (String userId : toUserIdsList) { + wxUserId = ""; + // 从同步表获取对应的企业微信ID + SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId("1", "2", userId); + if (synThirdInfoEntity == null) { + synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId("11", "2", userId); + } + if (synThirdInfoEntity != null) { + wxUserId = synThirdInfoEntity.getThirdObjId(); + } + if (StringUtil.isEmpty(wxUserId)) { + nullUserInfo = nullUserInfo.append(",").append(userId); + } else { + toWxUserId = toWxUserId.append("|").append(wxUserId); + } + messageReceiveList + .add(YunzhupaasMessageUtil.setMessageReceiveEntity(userId, title, Integer.valueOf(sendType))); + // } + + // 处理企业微信号信息串并验证 + toUserIdAll = toWxUserId.toString(); + if (StringUtil.isNotEmpty(toUserIdAll)) { + toUserIdAll = toUserIdAll.substring(1); + } + if (StringUtil.isEmpty(toUserIdAll)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":接收人对应的企业微信号全部为空!"); + messageMonitorService.create(monitorEntity); + continue; + } + // 发送企业信息信息 + retJson = QyWebChatUtil.sendWxMessage(corpId, corpSecret, agentId, toUserIdAll, content); + if (!retJson.getBoolean("code")) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":" + retJson.get("error")); + messageMonitorService.create(monitorEntity); + continue; + } + // 批量发送企业信息信息 + // retJson = QyWebChatUtil.sendWxMessage(corpId, corpSecret, agentId, + // toUserIdAll, content); + // messageMonitorService.create(monitorEntity); + // if (!retJson.getBoolean("code")) { + // return retJson; + // } + + // 企业微信号为空的信息写入备注 + if (StringUtil.isNotEmpty(nullUserInfo.toString())) { + messageEntity.setExcerpt(nullUserInfo.substring(1) + "对应的企业微信号为空"); + } + messageMonitorService.create(monitorEntity); + continue; + } else { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":消息模板数据不存在!"); + messageMonitorService.create(monitorEntity); + continue; + } + } + if (code) { + retJson.put("code", true); + retJson.put("error", MsgCode.SU012.get()); + } else { + String msg = error.toString(); + if (StringUtil.isNotBlank(msg)) { + msg = msg.substring(1); + } + retJson.put("code", false); + retJson.put("error", msg); + } + return retJson; + } + + /** + * List toUserIdsList, UserInfo userInfo, String sendType, + * MessageTemplateEntity entity, Map parameterMap + * + * @param toUserIdsList + * @param userInfo + * @param sendType + * @param entity + * @param parameterMap + * @return + */ + public JSONObject SendDingTalk(List toUserIdsList, UserInfo userInfo, String sendType, + SendConfigTemplateEntity entity, Map parameterMap, Map contentMsg) { + MessageTemplateConfigEntity msgTemEntity = messageTemplateConfigService.getInfo(entity.getTemplateId()); + + boolean code = true; + StringBuilder error = new StringBuilder(); + JSONObject retJson = new JSONObject(); + for (String userId : toUserIdsList) { + error = new StringBuilder(); + // 消息监控 + MessageMonitorEntity monitorEntity = new MessageMonitorEntity(); + monitorEntity.setId(RandomUtil.uuId()); + monitorEntity.setSendTime(DateUtil.getNowDate()); + monitorEntity.setCreatorTime(DateUtil.getNowDate()); + monitorEntity.setCreatorUserId(userInfo.getUserId()); + monitorEntity.setReceiveUser(userId); + if (StringUtil.isEmpty(userId)) { + code = false; + error = error.append(";").append("接收人为空!"); + messageMonitorService.create(monitorEntity); + continue; + } + UserEntity userEntity = userService.getInfo(userId); + if (ObjectUtil.isEmpty(userEntity)) { + code = false; + error = error.append(";").append("用户不存在!"); + messageMonitorService.create(monitorEntity); + continue; + } + if (msgTemEntity != null) { + String content = msgTemEntity.getContent(); + // 获取消息模板参数 + Map msgMap = getParamMap(entity.getId(), parameterMap); + // 转换链接 + String msg = contentMsg.get(userId) != null ? contentMsg.get(userId) : "{}"; + byte[] bytes = msg.getBytes(StandardCharsets.UTF_8); + String encode = Base64.getEncoder().encodeToString(bytes); + // 流程审批页面链接地址 + String pcLink = "/workFlowDetail?config=" + encode; + String appLink = "/pages/workFlow/flowBefore/index?config=" + encode; + // 转换为短链 + String shortLink = shortLinkService.shortLink(pcLink + userId + msgTemEntity.getMessageType()); + shortLink = getShortLink(pcLink, userId, shortLink, msgTemEntity.getMessageType()); + String msgTC = msgTemEntity.getTitle() + msgTemEntity.getContent(); + if (StringUtil.isNotBlank(msgTC)) { + if (msgTC.contains("{@FlowLink}")) { + // 链接数据保存 + this.saveShortLink(pcLink, appLink, shortLink, userInfo, userId, msg); + } + } + String link = configValueUtil.getApiDomain() + "/api/message/ShortLink/" + shortLink; + if (StringUtil.isNotBlank(userInfo.getTenantId())) { + link = link + "/" + userInfo.getTenantId(); + } + if (StringUtil.isNotEmpty(content)) { + if (content.contains("{@FlowLink}")) { + content = content.replace("{@FlowLink}", link + " "); + } + StringSubstitutor strSubstitutor = new StringSubstitutor(msgMap, "{", "}"); + content = strSubstitutor.replace(content); + } + // 替换参数 + String title = msgTemEntity.getTitle(); + if (StringUtil.isNotEmpty(title)) { + if (title.contains("{@FlowLink}")) { + title = title.replace("{@FlowLink}", link + " "); + } + StringSubstitutor strSubstitutor = new StringSubstitutor(msgMap, "{", "}"); + title = strSubstitutor.replace(title); + } + + title = systemParam(parameterMap, contentMsg, title, userInfo); + content = systemParam(parameterMap, contentMsg, content, userInfo); + monitorEntity.setTitle(title); + monitorEntity.setContent(content); + + Map objModel = getSystemConfig(); + DingTalkModel dingTalkModel = JsonUtil.getJsonToBean(objModel, DingTalkModel.class); + String appKey = dingTalkModel.getDingSynAppKey(); + String appSecret = dingTalkModel.getDingSynAppSecret(); + String agentId = dingTalkModel.getDingAgentId(); + String dingUserId = ""; + StringBuilder toDingUserId = new StringBuilder(); + String toUserIdAll = ""; + StringBuilder nullUserInfo = new StringBuilder(); + List messageReceiveList = new ArrayList<>(); + + // 相关参数验证 + if (StringUtil.isEmpty(appKey)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":AppKey为空!"); + messageMonitorService.create(monitorEntity); + continue; + } + if (StringUtil.isEmpty(appSecret)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":AppSecret为空!"); + messageMonitorService.create(monitorEntity); + continue; + } + if (StringUtil.isEmpty(agentId)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":AgentId为空!"); + messageMonitorService.create(monitorEntity); + continue; + } + if (StringUtil.isEmpty(content)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":AgentId为空!"); + messageMonitorService.create(monitorEntity); + continue; + } + // 创建消息实体 + MessageEntity messageEntity = YunzhupaasMessageUtil.setMessageEntity(userInfo.getUserId(), content, + null, Integer.parseInt(sendType)); + // 创建消息监控 + monitorEntity = createMessageMonitor(monitorEntity, msgTemEntity, null, content, userInfo, null, title); + // 获取接收人员的钉钉号、创建消息用户实体 + // for (String userId : toUserIdsList) { + dingUserId = ""; + dingUserId = ""; + // 从同步表获取对应用户的钉钉ID + SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId("2", "2", userId); + if (synThirdInfoEntity == null) { + synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId("22", "2", userId); + } + if (synThirdInfoEntity != null) { + dingUserId = synThirdInfoEntity.getThirdObjId(); + } + if (StringUtil.isEmpty(dingUserId)) { + nullUserInfo = nullUserInfo.append(",").append(userId); + } else { + toDingUserId = toDingUserId.append(",").append(dingUserId); + } + messageReceiveList + .add(YunzhupaasMessageUtil.setMessageReceiveEntity(userId, title, Integer.valueOf(sendType))); + + // 处理接收人员的钉钉号信息串并验证 + toUserIdAll = toDingUserId.toString(); + if (StringUtil.isNotEmpty(toUserIdAll)) { + toUserIdAll = toUserIdAll.substring(1); + } + if (StringUtil.isEmpty(toUserIdAll)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":接收人对应的钉钉号为空!"); + messageMonitorService.create(monitorEntity); + continue; + } + // 发送钉钉信息 + retJson = DingTalkUtil.sendDingMessage(appKey, appSecret, agentId, toUserIdAll, content); + if (!retJson.getBoolean("code")) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":" + retJson.get("error")); + messageMonitorService.create(monitorEntity); + continue; + } + + // 钉钉号为空的信息写入备注 + if (StringUtil.isNotEmpty(nullUserInfo.toString())) { + messageEntity.setExcerpt(nullUserInfo.toString().substring(1) + "对应的钉钉号为空"); + } + messageMonitorService.create(monitorEntity); + continue; + } else { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":消息模板数据不存在"); + messageMonitorService.create(monitorEntity); + continue; + } + } + if (code) { + retJson.put("code", true); + retJson.put("error", MsgCode.SU012.get()); + } else { + String msg = error.toString(); + if (StringUtil.isNotBlank(msg)) { + msg = msg.substring(1); + } + retJson.put("code", false); + retJson.put("error", msg); + } + return retJson; + } + + /** + * 发送邮件 + * + * @param toUserIdsList + * @param userInfo + * @param sendType + * @param entity + * @param parameterMap + * @return + */ + public List SendMail(List toUserIdsList, UserInfo userInfo, String sendType, + SendConfigTemplateEntity entity, Map parameterMap, Map contentMsg) { + List errList = new ArrayList<>(); + MessageTemplateConfigEntity msgTemEntity = messageTemplateConfigService.getInfo(entity.getTemplateId()); + AccountConfigEntity accountEntity = accountConfigService.getInfo(entity.getAccountConfigId()); + for (String userId : toUserIdsList) { + // 消息监控 + MessageMonitorEntity monitorEntity = new MessageMonitorEntity(); + monitorEntity.setId(RandomUtil.uuId()); + monitorEntity.setReceiveUser(JsonUtil.getObjectToString(toUserIdsList)); + monitorEntity.setSendTime(DateUtil.getNowDate()); + monitorEntity.setCreatorTime(DateUtil.getNowDate()); + monitorEntity.setCreatorUserId(userInfo.getUserId()); + if (StringUtil.isEmpty(userId)) { + log.error("接收人为空"); + messageMonitorService.create(monitorEntity); + errList.add("接收人为空"); + continue; + } + monitorEntity.setReceiveUser(userId); + UserEntity userEntity = userService.getInfo(userId); + if (msgTemEntity != null) { + String msg = contentMsg.get(userId) != null ? contentMsg.get(userId) : "{}"; + byte[] bytes = msg.getBytes(StandardCharsets.UTF_8); + String encode = Base64.getEncoder().encodeToString(bytes); + // 流程审批页面链接地址 + String pcLink = "/workFlowDetail?config=" + encode; + String appLink = "/pages/workFlow/flowBefore/index?config=" + encode; + // 转换为短链 + String shortLink = shortLinkService.shortLink(pcLink + userId + msgTemEntity.getMessageType()); + shortLink = getShortLink(pcLink, userId, shortLink, msgTemEntity.getMessageType()); + String msgTC = msgTemEntity.getTitle() + msgTemEntity.getContent(); + if (StringUtil.isNotBlank(msgTC)) { + if (msgTC.contains("{@FlowLink}")) { + // 链接数据保存 + this.saveShortLink(pcLink, appLink, shortLink, userInfo, userId, msg); + } + } + String link = configValueUtil.getApiDomain() + "/api/message/ShortLink/" + shortLink; + if (StringUtil.isNotBlank(userInfo.getTenantId())) { + link = link + "/" + userInfo.getTenantId(); + } + Map msgMap = getParamMap(entity.getId(), parameterMap); + // 设置邮件标题 + String title = msgTemEntity.getTitle(); + if (title.contains("{@FlowLink}")) { + title = title.replace("{@FlowLink}", link + " "); + } + if (StringUtil.isNotEmpty(title)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(msgMap, "{", "}"); + title = strSubstitutor.replace(title); + } + // 设置邮件内容 + String content = msgTemEntity.getContent(); + if (content.contains("{@FlowLink}")) { + content = content.replace("{@FlowLink}", link + " "); + } + // 获取消息模板参数 + if (StringUtil.isNotEmpty(content)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(msgMap, "{", "}"); + content = strSubstitutor.replace(content); + } + title = systemParam(parameterMap, contentMsg, title, userInfo); + content = systemParam(parameterMap, contentMsg, content, userInfo); + monitorEntity.setTitle(title); + monitorEntity.setContent(content); + if (accountEntity != null) { + // 获取系统配置 + Map objModel = new HashMap<>(); + objModel.put("emailSmtpHost", accountEntity.getSmtpServer()); + objModel.put("emailSmtpPort", accountEntity.getSmtpPort().toString()); + objModel.put("emailSenderName", accountEntity.getAddressorName()); + objModel.put("emailAccount", accountEntity.getSmtpUser()); + objModel.put("emailPassword", accountEntity.getSmtpPassword()); + objModel.put("emailSsl", accountEntity.getSslLink().equals(1) ? "true" : "false"); + + EmailModel emailModel = JsonUtil.getJsonToBean(objModel, EmailModel.class); + StringBuilder nullUserInfo = new StringBuilder(); + List messageReceiveList = new ArrayList<>(); + StringBuilder toUserMail = new StringBuilder(); + String userEmailAll = ""; + String userEmail = ""; + String userName = ""; + + // 相关参数验证 + if (StringUtil.isEmpty(emailModel.getEmailSmtpHost())) { + log.error("SMTP服务为空"); + messageMonitorService.create(monitorEntity); + errList.add("SMTP服务为空"); + continue; + } else if (StringUtil.isEmpty(emailModel.getEmailSmtpPort())) { + log.error("SMTP端口为空"); + messageMonitorService.create(monitorEntity); + errList.add("SMTP端口为空"); + continue; + } else if (StringUtil.isEmpty(emailModel.getEmailAccount())) { + log.error("发件人邮箱为空"); + messageMonitorService.create(monitorEntity); + errList.add("发件人邮箱为空"); + continue; + } else if (StringUtil.isEmpty(emailModel.getEmailPassword())) { + log.error("发件人密码为空"); + messageMonitorService.create(monitorEntity); + errList.add("发件人密码为空"); + continue; + } else { + // 设置邮件标题 + emailModel.setEmailTitle(title); + // 设置邮件内容 + emailModel.setEmailContent(content); + + // 创建消息实体 + MessageEntity messageEntity = YunzhupaasMessageUtil.setMessageEntity(userInfo.getUserId(), + title, emailModel.getEmailContent(), Integer.parseInt(sendType)); + // 创建消息监控 + monitorEntity = createMessageMonitor(monitorEntity, msgTemEntity, accountEntity, content, + userInfo, null, title); + // 获取收件人的邮箱地址、创建消息用户实体 + // for (String userId : toUserIdsList) { + if (userEntity != null) { + userEmail = StringUtil.isEmpty(userEntity.getEmail()) ? "" : userEntity.getEmail(); + userName = userEntity.getRealName(); + } + if (userEmail != null && !"".equals(userEmail)) { + if (EmailUtil.isEmail(userEmail)) { + toUserMail = toUserMail.append(",").append(userName).append("<").append(userEmail) + .append(">"); + } + } else { + nullUserInfo = nullUserInfo.append(",").append(userId); + } + messageReceiveList.add(YunzhupaasMessageUtil.setMessageReceiveEntity(userId, title, + Integer.parseInt(sendType))); + // } + + // 处理接收人员的邮箱信息串并验证 + userEmailAll = toUserMail.toString(); + if (StringUtil.isNotEmpty(userEmailAll)) { + userEmailAll = userEmailAll.substring(1); + } + if (StringUtil.isEmpty(userEmailAll)) { + log.error("接收人对应的邮箱格式错误"); + messageMonitorService.create(monitorEntity); + errList.add("接收人对应的邮箱格式错误"); + continue; + } else { + // 设置接收人员 + emailModel.setEmailToUsers(userEmailAll); + // 发送邮件 + JSONObject retJson = EmailUtil.sendMail(emailModel); + messageMonitorService.create(monitorEntity); + if (!retJson.getBoolean("code")) { + log.error("发送失败"); + errList.add("发送失败"); + continue; + } else { + // 邮箱地址为空的信息写入备注 + if (StringUtil.isNotEmpty(nullUserInfo.toString())) { + messageEntity.setExcerpt(nullUserInfo.substring(1) + "对应的邮箱为空"); + } + continue; + // 写入系统的消息表、消息用户表 + } + } + } + } + continue; + } + continue; + } + return errList; + } + + /** + * 发送短信 + * + * @param toUserIdsList + * @param entity + * @param parameterMap + * @return + */ + public List sendSms(List toUserIdsList, UserInfo userInfo, SendConfigTemplateEntity entity, + Map parameterMap, Map contentMsg) { + List errList = new ArrayList<>(); + // 获取短信配置 + AccountConfigEntity accountEntity = accountConfigService.getInfo(entity.getAccountConfigId()); + // 获取消息模板详情 + MessageTemplateConfigEntity msgTemEntity = messageTemplateConfigService.getInfo(entity.getTemplateId()); + // // 得到参数详情列表 + // List detailListByParentId = + // templateParamService.getDetailListByParentId(msgTemEntity.getId()); + // detailListByParentId.forEach(t-> { + // + // }); + for (String toUserId : toUserIdsList) { + // 消息监控 + MessageMonitorEntity monitorEntity = new MessageMonitorEntity(); + monitorEntity.setId(RandomUtil.uuId()); + monitorEntity.setSendTime(DateUtil.getNowDate()); + monitorEntity.setCreatorTime(DateUtil.getNowDate()); + monitorEntity.setCreatorUserId(userInfo.getUserId()); + monitorEntity.setReceiveUser(toUserId); + String msg = contentMsg.get(toUserId) != null ? contentMsg.get(toUserId) : "{}"; + byte[] bytes = msg.getBytes(StandardCharsets.UTF_8); + String encode = Base64.getEncoder().encodeToString(bytes); + // 流程审批页面链接地址 + // 流程审批页面链接地址 + String pcLink = "/workFlowDetail?config=" + encode; + String appLink = "/pages/workFlow/flowBefore/index?config=" + encode; + // 转换为短链 + String shortLink = shortLinkService.shortLink(pcLink + toUserId + msgTemEntity.getMessageType()); + shortLink = getShortLink(pcLink, toUserId, shortLink, msgTemEntity.getMessageType()); + // 发送给用户的链接 + String link = configValueUtil.getApiDomain() + "/api/message/ShortLink/" + shortLink; + if (StringUtil.isNotBlank(userInfo.getTenantId())) { + link = link + "/" + userInfo.getTenantId(); + } + // 转换为短链 + + if (accountEntity != null) { + monitorEntity.setAccountId(accountEntity.getId()); + // 账号配置——短信 + Map objModel = new HashMap<>(16); + objModel.put("aliAccessKey", accountEntity.getAppId()); + objModel.put("aliSecret", accountEntity.getAppSecret()); + objModel.put("tencentSecretId", accountEntity.getAppId()); + objModel.put("tencentSecretKey", accountEntity.getAppSecret()); + objModel.put("tencentAppId", accountEntity.getSdkAppId()); + objModel.put("tencentAppKey", accountEntity.getAppKey()); + SmsModel smsConfig = JsonUtil.getJsonToBean(objModel, SmsModel.class); + int company = accountEntity.getChannel(); + // 组装接受用户 + StringBuffer toUserIdList = new StringBuffer(); + // for (String toUserId : toUserIdsList) { + UserEntity userEntity = userService.getInfo(toUserId); + if (isPhone(userEntity.getMobilePhone())) { + toUserIdList.append(userEntity.getMobilePhone() + ","); + } + // } + // 获取消息模板参数 + Map msgMap = getParamMap(entity.getId(), parameterMap); + // if(parameterMap.containsKey("@flowLink")){ + // parameterMap.put("@flowLink",link); + // } + // 短信参数 + Map smsMap = new HashMap<>(); + if (entity != null) { + smsMap = smsFieldService.getParamMap(entity.getTemplateId(), msgMap); + if (ObjectUtil.isNotEmpty(smsMap)) { + if (smsMap.containsValue("@FlowLink")) { + // 链接数据保存 + this.saveShortLink(pcLink, appLink, shortLink, userInfo, toUserId, msg); + for (String key : smsMap.keySet()) { + if (smsMap.get(key).equals("@FlowLink")) { + smsMap.put(key, link + " "); + } + } + } + } + } + // if(smsMap.containsKey("title")) { + // smsMap.keySet().removeIf(k -> k.equals("title")); + // } + if (msgTemEntity != null) { + monitorEntity.setMessageTemplateId(msgTemEntity.getId()); + String endPoint = ""; + if (Objects.equals(1, accountEntity.getChannel())) { + endPoint = accountEntity.getEndPoint(); + } else if (Objects.equals(2, accountEntity.getChannel())) { + endPoint = accountEntity.getZoneName(); + } + String content = SmsUtil.querySmsTemplateContent(company, smsConfig, endPoint, + accountEntity.getZoneParam(), msgTemEntity.getTemplateCode()); + if (StringUtil.isNotBlank(content) && !"null".equals(content)) { + if (ObjectUtil.isNotEmpty(smsMap) && !"null".equals(smsMap)) { + if (Objects.equals(1, accountEntity.getChannel())) { + if (content.contains("${")) { + for (String key : smsMap.keySet()) { + content = content.replace("${" + key + "}", smsMap.get(key).toString()); + } + } + } else if (Objects.equals(2, accountEntity.getChannel())) { + if (content.contains("{")) { + for (String key : smsMap.keySet()) { + content = content.replace("{" + key + "}", smsMap.get(key).toString()); + } + } + } + } + } + // 创建消息监控 + monitorEntity = createMessageMonitor(monitorEntity, msgTemEntity, accountEntity, content, userInfo, + null, null); + if (StringUtil.isEmpty(toUserIdList)) { + log.error("全部接收人对应的手机号码格式错误"); + messageMonitorService.create(monitorEntity); + errList.add("全部接收人对应的手机号码格式错误"); + continue; + } + SmsUtil.sentSms(company, smsConfig, endPoint, accountEntity.getZoneParam(), toUserIdList.toString(), + accountEntity.getSmsSignature(), msgTemEntity.getTemplateCode(), smsMap); + messageMonitorService.create(monitorEntity); + continue; + } else { + log.error("消息模板数据不存在"); + messageMonitorService.create(monitorEntity); + errList.add("消息模板数据不存在"); + continue; + } + } else { + log.error("账号配置数据不存在"); + messageMonitorService.create(monitorEntity); + errList.add("账号配置数据不存在"); + continue; + } + } + return errList; + } + + /** + * 发送微信公众号消息 + * + * @param toUserIdsList + * @param userInfo + * @param sendType + * @param entity + * @param parameterMap + * @return + */ + public JSONObject SendWXGzhChat(List toUserIdsList, UserInfo userInfo, String sendType, + SendConfigTemplateEntity entity, Map contentMsg, Map parameterMap) { + // 获取短信配置 + AccountConfigEntity accountEntity = accountConfigService.getInfo(entity.getAccountConfigId()); + // 获取消息模板详情 + MessageTemplateConfigEntity msgTemEntity = messageTemplateConfigService.getInfo(entity.getTemplateId()); + // 消息监控 + JSONObject retJson = new JSONObject(); + boolean code = true; + StringBuilder error = new StringBuilder(); + for (String userId : toUserIdsList) { + MessageMonitorEntity monitorEntity = new MessageMonitorEntity(); + monitorEntity.setId(RandomUtil.uuId()); + monitorEntity.setSendTime(DateUtil.getNowDate()); + monitorEntity.setCreatorTime(DateUtil.getNowDate()); + monitorEntity.setCreatorUserId(userInfo.getUserId()); + error = new StringBuilder(); + if (StringUtil.isEmpty(userId)) { + code = false; + error = error.append(";").append("接收人为空!"); + messageMonitorService.create(monitorEntity); + continue; + } + UserEntity userEntity = userService.getById(userId); + if (ObjectUtil.isEmpty(userEntity)) { + code = false; + error = error.append(";").append("用户不存在!"); + messageMonitorService.create(monitorEntity); + continue; + } + monitorEntity.setReceiveUser(userId); + + if (ObjectUtil.isEmpty(msgTemEntity)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":消息模板数据不存在!"); + messageMonitorService.create(monitorEntity); + continue; + } + monitorEntity.setMessageTemplateId(msgTemEntity.getId()); + String content = msgTemEntity.getContent(); + String templateKId = msgTemEntity.getTemplateCode(); + if (ObjectUtil.isEmpty(accountEntity)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":公众号账号配置数据不存在!"); + messageMonitorService.create(monitorEntity); + continue; + } + monitorEntity.setAccountId(accountEntity.getId()); + // 创建消息监控 + monitorEntity = createMessageMonitor(monitorEntity, msgTemEntity, accountEntity, content, userInfo, + toUserIdsList, null); + // 获取系统配置 + String appId = accountEntity.getAppId(); + String appsecret = accountEntity.getAppSecret(); + String wxxcxAppId = msgTemEntity.getXcxAppId(); + String type = msgTemEntity.getWxSkip(); + + String title = ""; + // 获取消息模板参数 + Map msgMap = getParamMap(entity.getId(), parameterMap); + // if(parameterMap.containsKey("@flowLink")){ + // parameterMap.put("@flowLink",link); + // } + // 微信公众号参数 + Map smsMap = new HashMap<>(); + if (entity != null) { + smsMap = smsFieldService.getParamMap(entity.getTemplateId(), msgMap); + } + if (smsMap.containsKey("title")) { + title = smsMap.get("title").toString(); + smsMap.keySet().removeIf(k -> k.equals("title")); + } + monitorEntity.setTitle(title); + // 相关参数验证 + if (StringUtil.isEmpty(templateKId)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":微信公众号模板id未创建!"); + messageMonitorService.create(monitorEntity); + continue; + } + if (StringUtil.isEmpty(appId)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":公众号appid为空为空!"); + messageMonitorService.create(monitorEntity); + continue; + } + if (StringUtil.isEmpty(appsecret)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":公众号appsecret为空为空!"); + messageMonitorService.create(monitorEntity); + continue; + } + // 获取微信公众号的token + String token = WXGZHWebChatUtil.getAccessToken(appId, appsecret); + if (StringUtil.isEmpty(token)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":获取微信公众号token失败!"); + messageMonitorService.create(monitorEntity); + continue; + } + // 微信公众号发送消息 + String msg = contentMsg.get(userId) != null ? contentMsg.get(userId) : "{}"; + byte[] bytes = msg.getBytes(StandardCharsets.UTF_8); + String encode = Base64.getEncoder().encodeToString(bytes); + // 流程审批页面链接地址 + String pcLink = "/workFlowDetail?config=" + encode; + String appLink = "/pages/workFlow/flowBefore/index?config=" + encode; + // 转换为短链 + String shortLink = shortLinkService.shortLink(pcLink + userId + msgTemEntity.getMessageType()); + shortLink = getShortLink(pcLink, userId, shortLink, msgTemEntity.getMessageType()); + if (!"1".equals(type)) { + // 链接数据保存 + this.saveShortLink(pcLink, appLink, shortLink, userInfo, userId, msg); + } + String link = configValueUtil.getApiDomain() + "/api/message/ShortLink/" + shortLink; + if (StringUtil.isNotBlank(userInfo.getTenantId())) { + link = link + "/" + userInfo.getTenantId(); + } + if (ObjectUtil.isNotEmpty(smsMap)) { + for (String key : smsMap.keySet()) { + if (smsMap.get(key).equals("@FlowLink")) { + smsMap.put(key, link); + } + } + } else { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":公众号模板参数为空!"); + messageMonitorService.create(monitorEntity); + continue; + } + WechatUserEntity wechatUserEntity = wechatUserService.getInfoByGzhId(userId, accountEntity.getAppKey()); + if (wechatUserEntity != null) { + if (StringUtil.isNotBlank(wechatUserEntity.getOpenId())) { + String openid = wechatUserEntity.getOpenId(); + String apptoken = authUtil.loginTempUser(userId, userInfo.getTenantId()); + String pagepath = "/pages/workFlow/flowBefore/index?config=" + encode + "&token=" + apptoken; + if (ObjectUtil.isNotEmpty(smsMap)) { + // 参数封装 + String message = WXGZHWebChatUtil.messageJson(templateKId, openid, wxxcxAppId, pagepath, smsMap, + title, type, link); + // 发送信息 + retJson = WXGZHWebChatUtil.sendMessage(token, message); + } + JSONObject rstObj = WXGZHWebChatUtil.getMessageList(token); + List wxgzhMessageModelList = JsonUtil.getJsonToList(rstObj.get("template_list"), + WxgzhMessageModel.class); + WxgzhMessageModel messageModel = wxgzhMessageModelList.stream() + .filter(t -> t.getTemplateId().equals(templateKId)).findFirst().orElse(null); + if (ObjectUtil.isNotEmpty(messageModel)) { + content = messageModel.getContent(); + if (StringUtil.isNotBlank(content) && !"null".equals(content)) { + if (ObjectUtil.isNotEmpty(smsMap) && !"null".equals(smsMap)) { + if (content.contains(".DATA}")) { + for (String key : smsMap.keySet()) { + content = content.replace(key, smsMap.get(key).toString()); + } + } + } + } + } + if (!retJson.getBoolean("code")) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":" + retJson.get("error")); + messageMonitorService.create(monitorEntity); + continue; + } + messageMonitorService.create(monitorEntity); + continue; + + } else { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":" + "账号未绑定公众号"); + messageMonitorService.create(monitorEntity); + continue; + } + } else { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":" + "账号未绑定公众号"); + messageMonitorService.create(monitorEntity); + continue; + } + } + if (code) { + retJson.put("code", true); + retJson.put("error", MsgCode.SU012.get()); + } else { + String msg = error.toString(); + if (StringUtil.isNotBlank(msg)) { + msg = msg.substring(1); + } + retJson.put("code", false); + retJson.put("error", msg); + } + return retJson; + } + + /** + * 获取系统配置 + */ + private Map getSystemConfig() { + // 获取系统配置 + List configList = sysconfigService.getList("SysConfig"); + Map objModel = new HashMap<>(16); + for (SysConfigEntity entity : configList) { + objModel.put(entity.getFkey(), entity.getValue()); + } + return objModel; + } + + private Map getParamMap(String templateId, Map paramMap) { + Map map = new HashMap<>(); + for (String key : paramMap.keySet()) { + if (key.contains(templateId)) { + map.put(key.substring(templateId.length()), paramMap.get(key)); + } + } + return map; + } + + private MessageMonitorEntity createMessageMonitor(MessageMonitorEntity monitorEntity, + MessageTemplateConfigEntity msgTemEntity, AccountConfigEntity accountEntity, String content, + UserInfo userInfo, List toUserIdsList, String title) { + if (msgTemEntity != null) { + monitorEntity.setMessageTemplateId(msgTemEntity.getId()); + monitorEntity.setMessageSource(msgTemEntity.getMessageSource()); + if (StringUtil.isNotBlank(title)) { + monitorEntity.setTitle(title); + } else { + monitorEntity.setTitle(msgTemEntity.getTitle()); + } + monitorEntity.setMessageType(msgTemEntity.getMessageType()); + if ("6".equals(msgTemEntity.getMessageType()) && accountEntity != null) { + monitorEntity.setReceiveUser(accountEntity.getWebhookAddress()); + } else { + if (toUserIdsList != null && toUserIdsList.size() > 0) { + monitorEntity.setReceiveUser(JsonUtil.getObjectToString(toUserIdsList)); + } + } + } else { + if (StringUtil.isNotBlank(title)) { + monitorEntity.setTitle(title); + } + monitorEntity.setMessageType("1"); + } + if (accountEntity != null) { + monitorEntity.setAccountId(accountEntity.getId()); + monitorEntity.setAccountCode(accountEntity.getEnCode()); + monitorEntity.setAccountName(accountEntity.getFullName()); + } + monitorEntity.setContent(content); + return monitorEntity; + } + + private String getShortLink(String pcLink, String userId, String shortLink, String type) { + if (StringUtil.isNotBlank(shortLink)) { + ShortLinkEntity entity = shortLinkService.getInfoByLink(shortLink); + if (entity != null) { + if (pcLink.equals(entity.getRealPcLink())) { + return shortLink; + } else { + shortLink = shortLinkService.shortLink(pcLink + userId + type); + return getShortLink(pcLink, userId, shortLink, type); + } + } else { + return shortLink; + } + } else { + shortLink = shortLinkService.shortLink(pcLink + userId + type); + return getShortLink(pcLink, userId, shortLink, type); + } + } + + private void saveShortLink(String pcLink, String appLink, String shortLink, UserInfo userInfo, String userId, + String bodyText) { + ShortLinkEntity shortLinkEntity = shortLinkService.getInfoByLink(shortLink); + if (shortLinkEntity == null) { + ShortLinkEntity entity = new ShortLinkEntity(); + Map sysConfig = getSystemConfig(); + String linkTime = sysConfig.get("linkTime"); + Integer isClick = 0; + if (StringUtil.isNotBlank(sysConfig.get("isClick")) && !"null".equals(sysConfig.get("isClick"))) { + isClick = Integer.parseInt(sysConfig.get("isClick")); + } + int unClickNum = 20; + if (StringUtil.isNotBlank(sysConfig.get("unClickNum")) && !"null".equals(sysConfig.get("unClickNum"))) { + unClickNum = Integer.parseInt(sysConfig.get("unClickNum")); + } + entity.setId(RandomUtil.uuId()); + entity.setRealPcLink(pcLink); + entity.setRealAppLink(appLink); + entity.setShortLink(shortLink); + entity.setBodyText(bodyText); + // entity.setTenantId(userInfo.getTenantId()); + entity.setUserId(userId); + entity.setIsUsed(isClick); + entity.setUnableNum(unClickNum); + entity.setClickNum(0); + if (StringUtil.isNotEmpty(linkTime)) { + Date unableTime = getUnableTime(linkTime); + entity.setUnableTime(unableTime); + } else { + entity.setUnableTime(DateUtil.dateAddHours(DateUtil.getNowDate(), 24)); + } + entity.setCreatorTime(DateUtil.getNowDate()); + entity.setCreatorUserId(userInfo.getUserId()); + shortLinkService.save(entity); + } + } + + private Date getUnableTime(String linkTime) { + Double time = Double.parseDouble(linkTime); + int second = Double.valueOf(time * 60 * 60).intValue(); + Date unableTime = DateUtil.dateAddSeconds(DateUtil.getNowDate(), second); + return unableTime; + } + + public static boolean isPhone(String phone) { + if (StringUtil.isNotBlank(phone) && !"null".equals(phone)) { + return Pattern.matches("^1[3-9]\\d{9}$", phone); + } + return false; + } + + public List sendDelegateMsg(SentMessageForm sentMessageForm) { + return messageService.sentScheduleMessage(sentMessageForm, ""); + } + + /** + * 系统参数替换 + * + * @param parameterMap + * @param contentMsg + * @param title + * @param userInfo + * @return + */ + private String systemParam(Map parameterMap, Map contentMsg, String title, + UserInfo userInfo) { + if (parameterMap.isEmpty()) { + return title = title + .replaceAll("\\{@Title}", contentMsg.get("Title") != null ? contentMsg.get("Title") : "") + .replaceAll("\\{@CreatorUserName}", userInfo.getUserName()) + .replaceAll("\\{@SendTime}", DateUtil.getNow().substring(11)) + .replaceAll("\\{@Content}", contentMsg.get("Content") != null ? contentMsg.get("Content") : "") + .replaceAll("\\{@Remark}", contentMsg.get("Remark") != null ? contentMsg.get("Remark") : "") + .replaceAll("\\{@StartDate}", + contentMsg.get("StartDate") != null ? contentMsg.get("StartDate") : "") + .replaceAll("\\{@StartTime}", + contentMsg.get("StartTime") != null ? contentMsg.get("StartTime") : "") + .replaceAll("\\{@EndDate}", contentMsg.get("EndDate") != null ? contentMsg.get("EndDate") : "") + .replaceAll("\\{@FlowLink}", "") + .replaceAll("\\{@EndTime}", contentMsg.get("EndTime") != null ? contentMsg.get("EndTime") : ""); + } + return title; + } + +} diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/SmtpUtil.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/SmtpUtil.java new file mode 100644 index 0000000..c969921 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/SmtpUtil.java @@ -0,0 +1,168 @@ +package com.yunzhupaas.base.util; + +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.yunzhupaas.base.model.MailAccount; +import com.yunzhupaas.base.model.MailFile; +import com.yunzhupaas.base.model.MailModel; +import lombok.Cleanup; +import lombok.extern.slf4j.Slf4j; +import org.springframework.mail.javamail.JavaMailSenderImpl; +import org.springframework.mail.javamail.MimeMessageHelper; + +import jakarta.mail.Session; +import jakarta.mail.Transport; +import jakarta.mail.internet.MimeMessage; +import java.io.File; +import java.util.Properties; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Slf4j +public class SmtpUtil { + + private String host = null; + private Integer port = null; + private String username = null; + private String password = null; + private String emailform = null; + private String timeout = "2500"; + private String personal = null; + private JavaMailSenderImpl mailSender = null; + + + /** + * 邮箱验证 + * + * @param mailAccount + * @return + */ + public static String checkConnected(MailAccount mailAccount) { + try { + Properties props = getProperties(mailAccount.getSsl()); + Session session = getSession(props); + @Cleanup Transport transport = getTransport(session, mailAccount); + return "true"; + } catch (Exception e) { + log.error(e.getMessage()); + return e.getMessage(); + } + } + + /** + * 获取Session + * + * @param props + */ + private static Session getSession(Properties props) { + Session session = Session.getInstance(props); + session.setDebug(true); + return session; + } + + /** + * 获取Properties + * + * @param ssl + */ + private static Properties getProperties(boolean ssl) { + Properties props = new Properties(); + props.setProperty("mail.transport.protocol", "smtp"); + props.setProperty("mail.smtp.auth", "true"); + props.setProperty("mail.smtp.timeout", "2500"); + // 设置接收超时时间 + props.put("mail.smtp.connectiontimeout", "5000"); + // 设置写入超时时间 + props.put("mail.smtp.writetimeout", "25000"); + if (ssl) { + props.put("mail.smtp.ssl.enable", "true"); + props.put("mail.smtp.socketFactory.fallback", "false"); + props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory"); + } + return props; + } + + /** + * 获取Transport + */ + private static Transport getTransport(Session session, MailAccount mailAccount) throws Exception { + Transport transport = session.getTransport(); + transport.connect(mailAccount.getSmtpHost(), mailAccount.getSmtpPort(), mailAccount.getAccount(), mailAccount.getPassword()); + return transport; + } + + /** + * springboot发送邮件 + * @param mailAccount + */ + public SmtpUtil(MailAccount mailAccount) { + host = mailAccount.getSmtpHost(); + port = mailAccount.getSmtpPort(); + username = mailAccount.getAccount(); + password = mailAccount.getPassword(); + emailform = mailAccount.getAccount(); + personal = mailAccount.getAccountName(); + mailSender = createMailSender(); + } + + /** + * 邮件发送器 + * + * @return 配置好的工具 + */ + private JavaMailSenderImpl createMailSender() { + JavaMailSenderImpl sender = new JavaMailSenderImpl(); + sender.setHost(host); + sender.setPort(port); + sender.setUsername(username); + sender.setPassword(password); + sender.setDefaultEncoding(Constants.UTF_8); + Properties props = new Properties(); + props.setProperty("mail.smtp.auth", "true"); + props.setProperty("mail.smtp.timeout", timeout); + // 设置接收超时时间 + props.put("mail.smtp.connectiontimeout", "5000"); + // 设置写入超时时间 + props.put("mail.smtp.writetimeout", "25000"); + props.setProperty("mail.smtp.starttls.enable", "true"); + props.setProperty("mail.smtp.starttls.required", "true"); + props.setProperty("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory"); + sender.setJavaMailProperties(props); + return sender; + } + + /** + * 发送邮件 + * + * @param mailModel 邮件实体 + * @throws Exception 异常 + */ + public void sendMail(String type, String path, MailModel mailModel) throws Exception { + MimeMessage mimeMessage = mailSender.createMimeMessage(); + MimeMessageHelper messageHelper = new MimeMessageHelper(mimeMessage, true, Constants.UTF_8); + messageHelper.setFrom(emailform,mailModel.getFromName()); + messageHelper.setTo(mailModel.getRecipient()); + if (mailModel.getBcc() != null) { + messageHelper.setBcc(mailModel.getBcc()); + } + if (mailModel.getCc() != null) { + messageHelper.setCc(mailModel.getCc()); + } + messageHelper.setSubject(mailModel.getSubject()); + messageHelper.setText(mailModel.getBodyText(), true); + if (mailModel.getAttachment().size() > 0) { + for (MailFile mailFile : mailModel.getAttachment()) { +// UploadUtil.downToLocal(type, mailFile.getFileId(), FileTypeEnum.MAIL, path); + File file = new File(path + mailFile.getFileId()); + String fileName = mailFile.getFileId(); + messageHelper.addAttachment(fileName, file); + } + } + mailSender.send(mimeMessage); + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/SourceUtil.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/SourceUtil.java new file mode 100644 index 0000000..117e258 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/SourceUtil.java @@ -0,0 +1,96 @@ +package com.yunzhupaas.base.util; + +import com.baomidou.mybatisplus.annotation.DbType; +import com.baomidou.mybatisplus.generator.config.DataSourceConfig; +import com.baomidou.mybatisplus.generator.config.converts.MySqlTypeConvert; +import com.baomidou.mybatisplus.generator.config.querys.MySqlQuery; +import com.baomidou.mybatisplus.generator.config.querys.PostgreSqlQuery; +import com.baomidou.mybatisplus.generator.keywords.MySqlKeyWordsHandler; +import com.baomidou.mybatisplus.generator.query.SQLQuery; +import com.yunzhupaas.database.model.entity.DbLinkEntity; +import com.yunzhupaas.database.source.DbBase; +import com.yunzhupaas.database.source.impl.DbPostgre; +import com.yunzhupaas.database.util.*; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.TenantHolder; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +public class SourceUtil { + + public static DataSourceConfig dbConfig(String dbName, DataSourceUtil linkEntity) { + DbType mpDbType; + String userName; + String password; + String dbSchema; + String url; + if (linkEntity == null) { + if(TenantDataSourceUtil.isTenantAssignDataSource()){ + linkEntity = TenantDataSourceUtil.getTenantAssignDataSource(TenantHolder.getDatasourceId()).toDbLink(new DbLinkEntity()); + }else{ + linkEntity = DynamicDataSourceUtil.dataSourceUtil.init(); + } + if (!"KingbaseES".equals(linkEntity.getDbType()) && !"PostgreSQL".equals(linkEntity.getDbType()) && StringUtil.isNotEmpty(dbName)) { + linkEntity.setDbName(dbName); + } + } + try { + DbBase dbBase = DbTypeUtil.getDb(linkEntity); + mpDbType = dbBase.getMpDbType(); + userName = linkEntity.getUserName(); + password = linkEntity.getPassword(); + dbSchema = linkEntity.getDbSchema(); + + // oracle 默认 schema = username + if (StringUtil.isEmpty(dbSchema) && ( + mpDbType.getDb().equalsIgnoreCase(DbType.ORACLE.getDb()) + || mpDbType.getDb().equalsIgnoreCase(DbType.KINGBASE_ES.getDb()) + || mpDbType.getDb().equalsIgnoreCase(DbType.DM.getDb()) + )) { + dbSchema = linkEntity.getUserName(); + if(StringUtil.isNotEmpty(dbName)){ + dbSchema = dbName; + } + } + //postgre默认 public + if (mpDbType.getDb().equalsIgnoreCase(DbType.POSTGRE_SQL.getDb())) { + if (StringUtil.isNotEmpty(dbName)) { + dbSchema = dbName; + } else if (StringUtil.isNotEmpty(linkEntity.getDbSchema())) { + dbSchema = linkEntity.getDbSchema(); + } else { + dbSchema = DbPostgre.DEF_SCHEMA; + } + } + //兼容 SQL_SERVER 默认dbo模式 + if (StringUtil.isEmpty(dbSchema) && mpDbType.getDb().equalsIgnoreCase(DbType.SQL_SERVER.getDb())) { + dbSchema = "dbo"; + } + url = ConnUtil.getUrl(linkEntity); + DataSourceConfig dsc =new DataSourceConfig.Builder(url,userName,password) + .schema(dbSchema) + .keyWordsHandler(new MySqlKeyWordsHandler()) + .build(); + return dsc; + } catch (Exception e) { + e.getStackTrace(); + } + return null; + } + + static class MyPostgreSqlQuery extends PostgreSqlQuery { + + @Override + public String tableFieldsSql() { + return "SELECT A.attname AS name,format_type (A.atttypid,A.atttypmod) AS type,col_description (A.attrelid,A.attnum) AS comment,\n" + + "(CASE WHEN (SELECT COUNT (*) FROM pg_constraint AS PC WHERE PC.conrelid = C.oid AND A.attnum = PC.conkey[1] AND PC.contype = 'p') > 0 THEN 'PRI' ELSE '' END) AS key \n" + + "FROM pg_class AS C,pg_attribute AS A WHERE A.attrelid='%s'::regclass AND A.attrelid= C.oid AND A.attnum> 0 AND NOT A.attisdropped ORDER BY A.attnum"; + } + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/SynDingTalkUtil.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/SynDingTalkUtil.java new file mode 100644 index 0000000..5c79ecf --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/SynDingTalkUtil.java @@ -0,0 +1,581 @@ +package com.yunzhupaas.base.util; + +import com.alibaba.fastjson.JSONObject; +import com.dingtalk.api.DefaultDingTalkClient; +import com.dingtalk.api.DingTalkClient; +import com.dingtalk.api.request.*; +import com.dingtalk.api.response.*; +import com.taobao.api.ApiException; +import com.yunzhupaas.message.model.message.DingTalkDeptModel; +import com.yunzhupaas.message.model.message.DingTalkUserModel; +import com.yunzhupaas.message.model.message.OraganizeListVO; +import com.yunzhupaas.permission.entity.OrganizeEntity; +import com.yunzhupaas.util.StringUtil; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +/** + * 同步到企业微信的接口 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021/4/30 17:11 + */ +public class SynDingTalkUtil { + + /** + * token 接口 + */ + public static final String TOKEN = "https://oapi.dingtalk.com/gettoken"; + + //--------------------------------------------部门-------------------------------------- + + /** + * 创建部门 + */ + public static final String CREATE_DEPARTMENT = "https://oapi.dingtalk.com/topapi/v2/department/create"; + + /** + * 更新部门 + */ + public static final String UPDATE_DEPARTMENT = "https://oapi.dingtalk.com/topapi/v2/department/update"; + + /** + * 删除部门 + */ + public static final String DELETE_DEPARTMENT = "https://oapi.dingtalk.com/topapi/v2/department/delete"; + + /** + * 获取部门列表 + */ + public static final String GET_DEPARTMENT_LIST = "https://oapi.dingtalk.com/topapi/v2/department/listsub"; + + /** + * 获取单个部门信息 + */ + public static final String GET_DEPARTMENT_INFO = "https://oapi.dingtalk.com/topapi/v2/department/get"; + + + //-------------------------------------------用户----------------------------------------------------- + + /** + * 创建用户 + */ + public static final String CREATE_USER = "https://oapi.dingtalk.com/topapi/v2/user/create"; + + /** + * 更新用户 + */ + public static final String UPDATE_USER = "https://oapi.dingtalk.com/topapi/v2/user/update"; + + /** + * 删除用户 + */ + public static final String DELETE_USER = "https://oapi.dingtalk.com/topapi/v2/user/delete"; + + /** + * 获取用户列表(返回精简的员工信息列表) + */ + public static final String GET_USER_LIST = "https://oapi.dingtalk.com/topapi/user/listsimple"; + + /** + * 获取用户列表(返回详细的员工信息列表) + */ + public static final String GET_USER_DETAIL_LIST = "https://oapi.dingtalk.com/topapi/v2/user/list"; + + /** + * 获取单个成员信息 + */ + public static final String GET_SINGLE_USER = "https://oapi.dingtalk.com/topapi/v2/user/get"; + + + + /** + * 获取接口访问凭证 + */ + public static JSONObject getAccessToken(String corpId, String corpSecret){ + JSONObject retMsg = new JSONObject(); + retMsg.put("code",true); + try{ + DingTalkClient client = new DefaultDingTalkClient(TOKEN); + OapiGettokenRequest req = new OapiGettokenRequest(); + req.setAppkey(corpId); + req.setAppsecret(corpSecret); + req.setHttpMethod("GET"); + OapiGettokenResponse rsp = client.execute(req); + retMsg.put("access_token", rsp.getAccessToken()); + if (!rsp.isSuccess()) { + retMsg.put("code", false); + retMsg.put("access_token", ""); + } + } catch (ApiException e) { + retMsg.put("code", false); + retMsg.put("access_token", ""); + } + + return retMsg; + } + + //------------------------------------接口:部门管理的增删改查------------------------------------- + + /** + * 创建钉钉部门接口 + * @param deptModel + * @param accessToken + * @return + */ + public static JSONObject createDepartment(DingTalkDeptModel deptModel, String accessToken) { + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + String deptId = "0"; + try { + DingTalkClient client = new DefaultDingTalkClient(CREATE_DEPARTMENT); + OapiV2DepartmentCreateRequest req = new OapiV2DepartmentCreateRequest(); + req.setParentId(deptModel.getParentId()); + req.setName(deptModel.getName()); + req.setOrder(deptModel.getOrder()); + req.setCreateDeptGroup(deptModel.getCreateDeptGroup()); + req.setSourceIdentifier(deptModel.getSourceIdentifier()); + OapiV2DepartmentCreateResponse rsp = client.execute(req, accessToken); + if (rsp.isSuccess()) { + codeFlag = true; + JSONObject bodyObject = JSONObject.parseObject(rsp.getBody()); + bodyObject = JSONObject.parseObject(bodyObject.getString("result")); + deptId = bodyObject.getLong("dept_id").toString(); + }else{ + codeFlag = false; + errorMsg = rsp.getErrmsg(); + } + } catch (ApiException e) { + codeFlag = false; + errorMsg = e.toString(); + } + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + retMsg.put("retDeptId",deptId); + return retMsg; + } + + /** + * 更新钉钉部门接口 + * @param deptModel + * @param accessToken + * @return + */ + public static JSONObject updateDepartment(DingTalkDeptModel deptModel, String accessToken) { + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + try { + DingTalkClient client = new DefaultDingTalkClient(UPDATE_DEPARTMENT); + OapiV2DepartmentUpdateRequest req = new OapiV2DepartmentUpdateRequest(); + req.setDeptId(deptModel.getDeptId()); + req.setParentId(deptModel.getParentId()); + req.setOrder(deptModel.getOrder()); + req.setName(deptModel.getName()); + // 设置部门主管,先建部门、再建设用户、再更新部门主管 + if(StringUtil.isNotEmpty(deptModel.getDeptManagerUseridList())){ + req.setDeptManagerUseridList(deptModel.getDeptManagerUseridList()); + } + OapiV2DepartmentUpdateResponse rsp = client.execute(req, accessToken); + if (!rsp.isSuccess()) { + codeFlag = false; + errorMsg = rsp.getErrmsg(); + } + } catch (ApiException e) { + codeFlag = false; + errorMsg = e.toString(); + } + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + return retMsg; + } + + /** + * 删除钉钉部门接口 + * @param id + * @param accessToken + * @return + */ + public static JSONObject deleteDepartment(Long id, String accessToken){ + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + + try { + DingTalkClient client = new DefaultDingTalkClient(DELETE_DEPARTMENT); + OapiV2DepartmentDeleteRequest req = new OapiV2DepartmentDeleteRequest(); + req.setDeptId(id); + OapiV2DepartmentDeleteResponse rsp = client.execute(req, accessToken); + if (!rsp.isSuccess()) { + codeFlag = false; + errorMsg = rsp.getErrmsg(); + } + } catch (ApiException e) { + codeFlag = false; + errorMsg = e.toString(); + } + + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + + return retMsg; + } + + /** + * 获取钉钉部门列表信息接口(一次只能获取下一级部门,不能多级查询) + * @param id + * @param accessToken + * @return + */ + public static JSONObject getDepartmentList(Long id, String accessToken){ + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + List departmentAllList = new ArrayList<>(); + + retMsg = getDepartmentListSub(id,accessToken,departmentAllList); + if(!retMsg.getBoolean("code")){ + codeFlag = false; + errorMsg = "获取钉钉所有部门列表失败"; + } + + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + retMsg.put("department",departmentAllList); + + return retMsg; + } + + /** + * 递归获取部门信息列表 + * @param id + * @param accessToken + * @param departmentAllList + * @return + */ + public static JSONObject getDepartmentListSub(Long id, String accessToken, List departmentAllList){ + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + List departmentList = new ArrayList<>(); + + try { + DingTalkClient client = new DefaultDingTalkClient(GET_DEPARTMENT_LIST); + OapiV2DepartmentListsubRequest req = new OapiV2DepartmentListsubRequest(); + req.setDeptId(id); + OapiV2DepartmentListsubResponse rsp = client.execute(req, accessToken); + if (!rsp.isSuccess()) { + retMsg.put("code",false); + retMsg.put("error",rsp.getErrmsg()); + return retMsg; + }else{ + departmentList = rsp.getResult(); + if(departmentList.size()>0){ + for(OapiV2DepartmentListsubResponse.DeptBaseResponse deptEntity : departmentList){ + departmentAllList.add(deptEntity); + retMsg = getDepartmentListSub(deptEntity.getDeptId(),accessToken,departmentAllList); + if(!retMsg.getBoolean("code")){ + codeFlag = false; + errorMsg = rsp.getErrmsg(); + break; + } + } + } + } + } catch (ApiException e) { + codeFlag = false; + errorMsg = e.toString(); + } + + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + + return retMsg; + } + + /** + * 获取指定的钉钉部门信息接口 + * @param deptId + * @param accessToken + * @return + */ + public static JSONObject getDepartmentInfo(Long deptId, String accessToken){ + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + OapiV2DepartmentGetResponse.DeptGetResponse departmentInfo = new OapiV2DepartmentGetResponse.DeptGetResponse(); + + try { + DingTalkClient client = new DefaultDingTalkClient(GET_DEPARTMENT_INFO); + OapiV2DepartmentGetRequest req = new OapiV2DepartmentGetRequest(); + req.setDeptId(deptId); + OapiV2DepartmentGetResponse rsp = client.execute(req, accessToken); + if (!rsp.isSuccess()) { + codeFlag = false; + errorMsg = rsp.getErrmsg(); + }else{ + departmentInfo = rsp.getResult(); + } + } catch (ApiException e) { + codeFlag = false; + errorMsg = e.toString(); + } + + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + retMsg.put("departmentInfo",departmentInfo); + + return retMsg; + } + + + //------------------------------------接口:用户管理的增删改查------------------------------------- + + /** + * 创建钉钉用户信息接口 + * @param userModel + * @param accessToken + * @return + */ + public static JSONObject createUser(DingTalkUserModel userModel, String accessToken){ + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + + try { + DingTalkClient client = new DefaultDingTalkClient(CREATE_USER); + OapiV2UserCreateRequest req = new OapiV2UserCreateRequest(); + req.setUserid(userModel.getUserid()); + req.setName(userModel.getName()); + req.setMobile(userModel.getMobile()); + req.setTelephone(userModel.getTelephone()); + req.setJobNumber(userModel.getJobNumber()); + req.setTitle(userModel.getTitle()); + req.setEmail(userModel.getEmail()); + req.setWorkPlace(userModel.getWorkPlace()); + req.setDeptIdList(userModel.getDeptIdList()); + req.setHiredDate(userModel.getHiredDate()); + // 以下属性未设置 + // hide_mobile org_email extension senior_mode login_email + // exclusive_account exclusive_account_type login_id init_password + + OapiV2UserCreateResponse rsp = client.execute(req, accessToken); + if (!rsp.isSuccess()) { + codeFlag = false; + errorMsg = rsp.getErrmsg(); + } + } catch (ApiException e) { + codeFlag = false; + errorMsg = e.toString(); + } + + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + return retMsg; + } + + + /** + * 更新钉钉用户信息接口 + * @param userModel + * @param accessToken + * @return + */ + public static JSONObject updateUser(DingTalkUserModel userModel, String accessToken){ + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + + try { + DingTalkClient client = new DefaultDingTalkClient(UPDATE_USER); + OapiV2UserUpdateRequest req = new OapiV2UserUpdateRequest(); + req.setUserid(userModel.getUserid()); + req.setName(userModel.getName()); + req.setMobile(userModel.getMobile()); + req.setTelephone(userModel.getTelephone()); + req.setJobNumber(userModel.getJobNumber()); + req.setTitle(userModel.getTitle()); + req.setEmail(userModel.getEmail()); + req.setWorkPlace(userModel.getWorkPlace()); + req.setDeptIdList(userModel.getDeptIdList()); + req.setHiredDate(userModel.getHiredDate()); + // 以下属性未设置 + // hide_mobile org_email extension senior_mode login_email + // exclusive_account exclusive_account_type login_id init_password + + OapiV2UserUpdateResponse rsp = client.execute(req, accessToken); + if (!rsp.isSuccess()) { + codeFlag = false; + errorMsg = rsp.getErrmsg(); + } + } catch (ApiException e) { + codeFlag = false; + errorMsg = e.toString(); + } + + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + return retMsg; + } + + /** + * 删除钉钉用户信息接口 + * @param userId + * @param accessToken + * @return + */ + public static JSONObject deleteUser(String userId, String accessToken){ + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + + try { + DingTalkClient client = new DefaultDingTalkClient(DELETE_USER); + OapiV2UserDeleteRequest req = new OapiV2UserDeleteRequest(); + req.setUserid(userId); + OapiV2UserDeleteResponse rsp = client.execute(req, accessToken); + if (!rsp.isSuccess()) { + codeFlag = false; + errorMsg = rsp.getErrmsg(); + } + } catch (ApiException e) { + codeFlag = false; + errorMsg = e.toString(); + } + + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + return retMsg; + } + + public static JSONObject getUserDingList(List departmentList, String accessToken){ + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + List userAllList = new ArrayList<>(); + + // 钉钉限制每页记录数:不超过100 +// retMsg = getUserListSub(1L,0L,100L,accessToken,userAllList); +// if(!retMsg.getBoolean("code")){ +// codeFlag = false; +// errorMsg = "获取钉钉所有用户列表失败"; +// } + + if(departmentList.size()>0 ){ + for(String deptId : departmentList){ + retMsg = getUserListSub(Long.parseLong(deptId),0L,100L,accessToken,userAllList); + if(!retMsg.getBoolean("code")){ + codeFlag = false; + errorMsg = "获取钉钉所有用户列表失败"; + break; + } + } + } + + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + retMsg.put("userlist",userAllList); + return retMsg; + } + + + public static JSONObject getUserList(List departmentList, String accessToken){ + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + List userAllList = new ArrayList<>(); + + // 钉钉限制每页记录数:不超过100 + retMsg = getUserListSub(1L,0L,100L,accessToken,userAllList); + if(!retMsg.getBoolean("code")){ + codeFlag = false; + errorMsg = "获取钉钉所有用户列表失败"; + } + + if(departmentList.size()>0 && retMsg.getBoolean("code")){ + for(DingTalkDeptModel deptEntity : departmentList){ + retMsg = getUserListSub(deptEntity.getDeptId(),0L,100L,accessToken,userAllList); + if(!retMsg.getBoolean("code")){ + codeFlag = false; + errorMsg = "获取钉钉所有用户列表失败"; + break; + } + } + } + + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + retMsg.put("userlist",userAllList); + return retMsg; + } + + public static JSONObject getUserListSub(Long deptId, Long cursor, Long size, String accessToken, + List userAllList){ + JSONObject retMsg = new JSONObject(); + List userList = new ArrayList<>(); + OapiV2UserListResponse.PageResult pageResult = new OapiV2UserListResponse.PageResult(); + + try { + DingTalkClient client = new DefaultDingTalkClient(GET_USER_DETAIL_LIST); + OapiV2UserListRequest req = new OapiV2UserListRequest(); + req.setDeptId(deptId); + req.setCursor(cursor); + req.setSize(size); + OapiV2UserListResponse rsp = client.execute(req, accessToken); + if(rsp.isSuccess()){ + pageResult = rsp.getResult(); + userList = pageResult.getList(); + for(OapiV2UserListResponse.ListUserResponse userEntity : userList){ + userAllList.add(userEntity); + } + if(pageResult.getHasMore()){ + retMsg = getUserListSub(deptId,pageResult.getNextCursor(),size,accessToken,userAllList); + if(!retMsg.getBoolean("code")){ + retMsg.put("code",false); + retMsg.put("error",rsp.getErrmsg()); + return retMsg; + } + } + } + } catch (ApiException e) { + retMsg.put("code",false); + retMsg.put("error",e.toString()); + return retMsg; + } + + retMsg.put("code",true); + retMsg.put("error",""); + return retMsg; + } + + + + /** + * 按目录树结构数据转化为列表 + * @param selectorVO + * @param organizeList + * @param listByOrder + */ + public static void getOrganizeTreeToList(OraganizeListVO selectorVO, Map organizeList, List listByOrder){ + if(selectorVO.isHasChildren()) { + List voChildren = selectorVO.getChildren(); + Iterator iterator = voChildren.iterator(); + while (iterator.hasNext()) { + OraganizeListVO organizeSelectorVO = iterator.next(); + OrganizeEntity entity = organizeList.get(organizeSelectorVO.getId()); + listByOrder.add(entity); + if (organizeSelectorVO.isHasChildren()) { + getOrganizeTreeToList(organizeSelectorVO, organizeList, listByOrder); + } + } + } + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/SynQyWebChatUtil.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/SynQyWebChatUtil.java new file mode 100644 index 0000000..b13b47d --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/SynQyWebChatUtil.java @@ -0,0 +1,459 @@ +package com.yunzhupaas.base.util; + +import com.alibaba.fastjson.JSONObject; +import com.yunzhupaas.exception.WxErrorException; +import com.yunzhupaas.message.model.message.OraganizeListVO; +import com.yunzhupaas.permission.entity.OrganizeEntity; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.wxutil.HttpUtil; + +import java.util.*; + +/** + * 同步到企业微信的接口 + * + * @版本: V3.1.0 + * @版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @作者: 云筑产品开发平台组 + * @日期: 2021/4/21 8:20 + */ +public class SynQyWebChatUtil { + /** + * token 接口 + */ + public static final String TOKEN = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=%s&corpsecret=%s"; + + //--------------------------------------------部门-------------------------------------- + + /** + * 创建部门 + */ + public static final String CREATE_DEPARTMENT = "https://qyapi.weixin.qq.com/cgi-bin/department/create?access_token=%s"; + + /** + * 更新部门 + */ + public static final String UPDATE_DEPARTMENT = "https://qyapi.weixin.qq.com/cgi-bin/department/update?access_token=%s"; + + /** + * 删除部门 + */ + public static final String DELETE_DEPARTMENT = "https://qyapi.weixin.qq.com/cgi-bin/department/delete?access_token=%s&id=%s"; + + /** + * 获取部门列表 + */ + public static final String GET_DEPARTMENT_LIST = "https://qyapi.weixin.qq.com/cgi-bin/department/list?access_token=%s&id=%s"; + + public static final String GET_DEPARTMENT_SIMPLELIST = "https://qyapi.weixin.qq.com/cgi-bin/department/simplelist?access_token=%s&id=%s"; + + //-------------------------------------------用户----------------------------------------------------- + + /** + * 创建用户 + */ + public static final String CREATE_USER = "https://qyapi.weixin.qq.com/cgi-bin/user/create?access_token=%s"; + + /** + * 更新用户 + */ + public static final String UPDATE_USER = "https://qyapi.weixin.qq.com/cgi-bin/user/update?access_token=%s"; + + /** + * 删除用户 + */ + public static final String DELETE_USER = "https://qyapi.weixin.qq.com/cgi-bin/user/delete?access_token=%s&userid=%s"; + + /** + * 获取用户列表(返回精简的员工信息列表) + */ + public static final String GET_USER_LIST = "https://qyapi.weixin.qq.com/cgi-bin/user/simplelist?access_token=%s&department_id=%s&fetch_child=%s"; + + /** + * 获取用户列表(返回详细的员工信息列表) + */ + public static final String GET_USER_DETAIL_LIST = "https://qyapi.weixin.qq.com/cgi-bin/user/list?access_token=%s&department_id=%s&fetch_child=%s"; + + /** + * 获取单个成员信息 + */ + public static final String GET_SINGLE_USER = "https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token=%s&userid=%s"; + + /** + * 自建获取单个成员信息 + */ + public static final String GET_LINKEDCORP_USER = "https://qyapi.weixin.qq.com/cgi-bin/linkedcorp/user/get?access_token=%s"; + + + //-------------------------------------上传--------------------------------------------------- + + /** + * 上传素材 + */ + public static final String MEDIA_UPLOAD = "https://qyapi.weixin.qq.com/cgi-bin/media/upload?access_token=%s&type=%s"; + + //-------------------------------------消息-------------------------------------------------- + + /** + * 发送消息 + */ + public static final String SEND_MESSAGE = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=%s"; + + + /** + * 获取接口访问凭证 + */ + public static JSONObject getAccessToken(String corpId, String corpSecret) { + JSONObject rstObj = HttpUtil.httpRequest(String.format(TOKEN,corpId, corpSecret), "GET", null); + rstObj.put("code",true); + if (HttpUtil.isWxError(rstObj)) { + rstObj.put("code",false); + rstObj.put("access_token",""); + } + return rstObj; + } + + /** + * 发送消息 20210416 Add By GongXishan + * 不抛出异常,返回Json + */ + public static JSONObject sendMessage(String message, String accessToken){ + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + JSONObject rstObj = HttpUtil.httpRequest(String.format(SEND_MESSAGE, accessToken), "POST", message); + if (HttpUtil.isWxError(rstObj)) { + codeFlag = false; + errorMsg = rstObj.toString(); + } + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + return retMsg; + } + + + /** + * 向企业微信发送信息 + * @param corpId + * @param corpSecret + * @param agentId + * @param toUserId + * @param contents + * @return + */ + public static JSONObject sendWxMessage(String corpId, String corpSecret, String agentId, String toUserId, String contents) { + JSONObject retMsg = null; + JSONObject message = null; + JSONObject tokenObject = null; + JSONObject content = null; + + message = new JSONObject(); + message.put("touser", toUserId); + message.put("agentid", agentId); + content = new JSONObject(); + content.put("content", contents); + message.put("text", content); + message.put("msgtype", "text"); + tokenObject = getAccessToken(corpId, corpSecret); + if(tokenObject.getString("access_token")!=null && !"".equals(tokenObject.getString("access_token"))){ + retMsg = sendMessage(message.toJSONString(), tokenObject.getString("access_token")); + }else + { + retMsg.put("code",false); + retMsg.put("error","access_token值为空,不能发送信息!"); + } + return retMsg; + } + + //------------------------------------企业微信接口:部门管理的增删改查------------------------------------- + + /** + * 创建部门 + * @param department json数据格式 + * @param accessToken + * @return + * @throws WxErrorException + */ + public static JSONObject createDepartment(String department, String accessToken) throws WxErrorException { + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + String qyDeptId = "0"; + JSONObject rstObj = HttpUtil.httpRequest(String.format(CREATE_DEPARTMENT, accessToken), "POST", department); + if (HttpUtil.isWxError(rstObj)) { + codeFlag = false; + errorMsg = rstObj.toString(); + }else{ + codeFlag = true; + qyDeptId = rstObj.getInteger("id").toString(); + } + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + retMsg.put("retDeptId",qyDeptId); + return retMsg; + } + + /** + * 更新部门 + * @param department json数据格式 + * @param accessToken + * @return + * @throws WxErrorException + */ + public static JSONObject updateDepartment(String department, String accessToken) throws WxErrorException { + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + JSONObject rstObj = HttpUtil.httpRequest(String.format(UPDATE_DEPARTMENT, accessToken), "POST", department); + if (HttpUtil.isWxError(rstObj)) { + codeFlag = false; + errorMsg = rstObj.toString(); + } + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + + return retMsg; + } + + /** + * 删除部门 + * @param id 部门ID + * @param accessToken + * @return + * @throws WxErrorException + */ + public static JSONObject deleteDepartment(String id, String accessToken) throws WxErrorException { + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + JSONObject rstObj = HttpUtil.httpRequest(String.format(DELETE_DEPARTMENT, accessToken, id), "GET", null); + if (HttpUtil.isWxError(rstObj)) { + codeFlag = false; + errorMsg = rstObj.toString(); + } + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + + return retMsg; + } + + /** + * 部门列表 + * @param id 根部门ID + * @param accessToken + * @return + * @throws WxErrorException + */ + public static JSONObject getDepartmentList(String id, String accessToken) throws WxErrorException { + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + String departmentStr = ""; + JSONObject rstObj = HttpUtil.httpRequest(String.format(GET_DEPARTMENT_LIST, accessToken, id), "GET", null); + if (HttpUtil.isWxError(rstObj)) { + codeFlag = false; + errorMsg = rstObj.toString(); + }else{ + departmentStr = rstObj.getString("department"); + } + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + retMsg.put("department",departmentStr); + return retMsg; + } + + //------------------------------------------企业微信接口:用户管理的增删改查-------------------------------------------- + + /** + * 创建用户 + * @param user json数据格式 + * @param accessToken + * @return + * @throws WxErrorException + */ + public static JSONObject createUser(String user, String accessToken) throws WxErrorException { + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + JSONObject rstObj = HttpUtil.httpRequest(String.format(CREATE_USER, accessToken), "POST", user); + if (HttpUtil.isWxError(rstObj)) { + codeFlag = false; + errorMsg = rstObj.toString(); + } + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + return retMsg; + } + + /** + * 更新用户 + * @param user json数据格式 + * @param accessToken + * @return + * @throws WxErrorException + */ + public static JSONObject updateUser(String user, String accessToken) throws WxErrorException { + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + JSONObject rstObj = HttpUtil.httpRequest(String.format(UPDATE_USER, accessToken), "POST", user); + if (HttpUtil.isWxError(rstObj)) { + codeFlag = false; + errorMsg = rstObj.toString(); + } + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + return retMsg; + } + + /** + * 删除用户 + * @param id 用户ID + * @param accessToken + * @return + * @throws WxErrorException + */ + public static JSONObject deleteUser(String id, String accessToken) throws WxErrorException { + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + JSONObject rstObj = HttpUtil.httpRequest(String.format(DELETE_USER, accessToken, id), "GET", null); + if (HttpUtil.isWxError(rstObj)) { + codeFlag = false; + errorMsg = rstObj.toString(); + } + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + return retMsg; + } + + /** + * 获取单个成员信息 + * @param id 企业微信成员ID + * @param accessToken + * @return + * @throws WxErrorException + */ + public static JSONObject getUserById(String id, String accessToken) throws WxErrorException { + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + String userInfo = ""; + JSONObject rstObj = HttpUtil.httpRequest(String.format(GET_SINGLE_USER, accessToken, id), "GET", null); + if (HttpUtil.isWxError(rstObj)) { + codeFlag = false; + errorMsg = rstObj.toString(); + }else{ + userInfo = rstObj.toJSONString(); + } + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + retMsg.put("userinfo",userInfo); + return retMsg; + } + + /** + * 自建应用获取单个成员信息 + * @param id 企业微信成员ID + * @param accessToken + * @return + * @throws WxErrorException + */ + public static JSONObject getLinkedcorpUserById(String id, String accessToken) throws WxErrorException { + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + String userInfo = ""; + JSONObject userObject = new JSONObject(); + userObject.put("userid",id); + JSONObject rstObj = HttpUtil.httpRequest(String.format(GET_LINKEDCORP_USER, accessToken), "POST", JsonUtil.getObjectToString(userObject)); + if (HttpUtil.isWxError(rstObj)) { + codeFlag = false; + errorMsg = rstObj.toString(); + }else{ + userInfo = rstObj.getJSONObject("user_info").toJSONString(); + } + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + retMsg.put("userinfo",userInfo); + return retMsg; + } + + + /** + * 获取用户列表(返回精简的成员信息) + * @param id + * @param isGetChild 1-递归获取,0-只获取本部门 + * @param accessToken + * GET_USER_LIST + * @return + * @throws WxErrorException + */ + public static JSONObject getUserList(String id, String isGetChild, String accessToken) throws WxErrorException { + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + List> userList = new ArrayList<>(); + JSONObject rstObj = HttpUtil.httpRequest(String.format(GET_USER_DETAIL_LIST, accessToken, id,isGetChild), "GET", null); + if (HttpUtil.isWxError(rstObj)) { + codeFlag = false; + errorMsg = rstObj.toString(); + }else{ + userList = JsonUtil.getJsonToList(rstObj.getJSONArray("userlist")); + } + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + retMsg.put("userlist",userList); + return retMsg; + } + + /** + * 获取用户列表(返回详细的成员信息) + * @param id + * @param isGetChild 1-递归获取,0-只获取本部门 + * @param accessToken + * @return + * @throws WxErrorException + */ + public static JSONObject getUserDetailList(String id, String isGetChild, String accessToken) throws WxErrorException { + JSONObject retMsg = new JSONObject(); + boolean codeFlag = true; + String errorMsg = ""; + String userList = ""; + JSONObject rstObj = HttpUtil.httpRequest(String.format(GET_USER_DETAIL_LIST, accessToken, id,isGetChild), "GET", null); + if (HttpUtil.isWxError(rstObj)) { + codeFlag = false; + errorMsg = rstObj.toString(); + }else{ + userList = rstObj.getString("userlist"); + } + retMsg.put("code",codeFlag); + retMsg.put("error",errorMsg); + retMsg.put("userlist",userList); + return retMsg; + } + + + /** + * 按目录树结构数据转化为列表 + * @param selectorVO + * @param organizeList + * @param listByOrder + */ + public static void getOrganizeTreeToList(OraganizeListVO selectorVO, Map organizeList, List listByOrder){ + if(selectorVO.isHasChildren()) { + List voChildren = selectorVO.getChildren(); + Iterator iterator = voChildren.iterator(); + while (iterator.hasNext()) { + OraganizeListVO organizeSelectorVO = iterator.next(); + OrganizeEntity entity = organizeList.get(organizeSelectorVO.getId()); + listByOrder.add(entity); + if (organizeSelectorVO.isHasChildren()) { + getOrganizeTreeToList(organizeSelectorVO, organizeList, listByOrder); + } + } + } + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/TestSendConfigUtil.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/TestSendConfigUtil.java new file mode 100644 index 0000000..6adf8d6 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/TestSendConfigUtil.java @@ -0,0 +1,1108 @@ +package com.yunzhupaas.base.util; + +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONObject; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.MessageTemplateEntity; +import com.yunzhupaas.base.entity.SmsTemplateEntity; +import com.yunzhupaas.base.entity.SysConfigEntity; +import com.yunzhupaas.base.SmsModel; +import com.yunzhupaas.base.service.MessageTemplateService; +import com.yunzhupaas.base.service.SmsTemplateService; +import com.yunzhupaas.base.service.SysconfigService; +import com.yunzhupaas.util.message.SmsUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.message.entity.*; +import com.yunzhupaas.message.enums.MessageTypeEnum; +import com.yunzhupaas.message.model.WxgzhMessageModel; +import com.yunzhupaas.message.model.message.DingTalkModel; +import com.yunzhupaas.message.model.message.EmailModel; +import com.yunzhupaas.message.model.messagetemplateconfig.TemplateParamModel; +import com.yunzhupaas.message.model.sendmessageconfig.SendConfigTemplateModel; +import com.yunzhupaas.message.service.*; +import com.yunzhupaas.message.util.*; +import com.yunzhupaas.message.util.weixingzh.WXGZHWebChatUtil; +import com.yunzhupaas.model.BaseSystemInfo; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.third.DingTalkUtil; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.text.StringSubstitutor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.*; +import java.util.regex.Pattern; + +@Component +@Slf4j +public class TestSendConfigUtil { + + @Autowired + private UserService userService; + + @Autowired + private SysconfigService sysconfigService; + @Autowired + private MessageService messageService; + @Autowired + private MessagereceiveService messagereceiveService; + @Autowired + private SynThirdInfoService synThirdInfoService; + + @Autowired + private MessageTemplateService messageTemplateService; + @Autowired + private SmsTemplateService smsTemplateService; + @Autowired + private MessageTemplateConfigService messageTemplateConfigService; + + @Autowired + private TemplateParamService templateParamService; + @Autowired + private SmsFieldService smsFieldService; + @Autowired + private AccountConfigService accountConfigService; + @Autowired + private MessageMonitorService messageMonitorService; + @Autowired + private WechatUserService wechatUserService; + + /** + * 测试发送配置 + */ + public String sendMessage(SendConfigTemplateModel model, UserInfo userInfo) { + List toUserIdsList = model.getToUser(); + // 模板id + String templateId = model.getTemplateId(); + // 参数 + Map parameterMap = new HashMap<>(); + List paramModelList = JsonUtil.getJsonToList(model.getParamJson(), + TemplateParamModel.class); + if (paramModelList != null && paramModelList.size() > 0) { + for (TemplateParamModel paramModel : paramModelList) { + parameterMap.put(paramModel.getField(), paramModel.getValue()); + } + } + boolean flag = true; + if (!"webhook".equals(model.getMessageType())) { + if (!(toUserIdsList != null && toUserIdsList.size() > 0)) { + log.error("接收人员为空"); + flag = false; + } + } + if (StringUtil.isEmpty(templateId)) { + log.error("模板Id为空"); + flag = false; + } + if (flag) { + // 获取消息模板详情 + MessageTemplateConfigEntity entity = messageTemplateConfigService.getInfo(templateId); + // 替换参数 + String content = entity.getContent(); + // 替换参数 + if (StringUtil.isNotEmpty(content)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(parameterMap, "{", "}"); + content = strSubstitutor.replace(content); + } + if (entity != null) { + MessageTypeEnum typeEnum = MessageTypeEnum.getByCode(entity.getMessageType()); + String sendType = entity.getMessageType(); + switch (typeEnum) { + case SysMessage: + // 站内消息 + String title = entity.getTitle(); + if (StringUtil.isNotEmpty(title)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(parameterMap, "{", "}"); + title = strSubstitutor.replace(title); + } + MessageTemplateConfigEntity msgTemEntity = messageTemplateConfigService + .getInfo(model.getTemplateId()); + Integer source = Integer.parseInt(msgTemEntity.getMessageSource()); + Integer type = Integer.parseInt(msgTemEntity.getMessageType()); + messageService.sentMessage(toUserIdsList, title, content, userInfo, source, type, true); + if ("1".equals(msgTemEntity.getMessageSource())) { + content = null; + } + // MessageMonitorEntity monitorEntity = createSysMessageMonitor(msgTemEntity, + // content, userInfo, toUser, title); + // messageMonitorService.create(monitorEntity); + break; + case SmsMessage: + // 发送短信 + JSONObject jsonObject1 = sendSms(toUserIdsList, model, parameterMap); + if (!(Boolean) jsonObject1.get("code")) { + return "发送短信消息失败,错误:" + jsonObject1.get("error"); + } + break; + case MailMessage: + // 邮件 + JSONObject jsonObject2 = SendMail(toUserIdsList, userInfo, sendType, model, parameterMap); + if (!(Boolean) jsonObject2.get("code")) { + return "发送邮件消息失败,错误:" + jsonObject2.get("error"); + } + break; + case QyMessage: + // 企业微信 + JSONObject jsonObject3 = SendQyWebChat(toUserIdsList, userInfo, sendType, model, parameterMap); + if (!(Boolean) jsonObject3.get("code")) { + return "发送企业微信消息失败,错误:" + jsonObject3.get("error"); + } + break; + case DingMessage: + // 钉钉 + JSONObject jsonObject4 = SendDingTalk(toUserIdsList, userInfo, sendType, model, parameterMap); + if (!(Boolean) jsonObject4.get("code")) { + return "发送钉钉消息失败,错误:" + jsonObject4.get("error"); + } + break; + case WebHookMessage: + // webhook + JSONObject jsonObject5 = SendWebHook(sendType, userInfo, model, parameterMap); + if (!(Boolean) jsonObject5.get("code")) { + return "发送webhook消息失败,错误:" + jsonObject5.get("error"); + } + break; + case WechatMessage: + // 微信公众号 + JSONObject jsonObject6 = SendWXGzhChat(toUserIdsList, userInfo, sendType, model, parameterMap); + if (!(Boolean) jsonObject6.get("code")) { + return "发送微信公众号消息失败,错误:" + jsonObject6.get("error"); + } + break; + default: + break; + } + } + } + return null; + } + + private JSONObject SendWebHook(String sendType, UserInfo userInfo, SendConfigTemplateModel model, + Map parameterMap) { + MessageTemplateConfigEntity entity = messageTemplateConfigService.getInfo(model.getTemplateId()); + String content = entity.getContent(); + JSONObject retJson = new JSONObject(); + MessageMonitorEntity monitorEntity = new MessageMonitorEntity(); + monitorEntity.setId(RandomUtil.uuId()); + monitorEntity.setSendTime(DateUtil.getNowDate()); + monitorEntity.setCreatorTime(DateUtil.getNowDate()); + monitorEntity.setCreatorUserId(userInfo.getUserId()); + + // 替换参数 + if (StringUtil.isNotEmpty(content)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(parameterMap, "{", "}"); + content = strSubstitutor.replace(content); + } + AccountConfigEntity entity1 = accountConfigService.getInfo(model.getAccountConfigId()); + if (entity != null) { + // 消息监控-消息模板写入 + monitorEntity.setMessageType(entity.getMessageType()); + monitorEntity.setMessageTemplateId(entity.getId()); + String title = entity.getTitle(); + if (StringUtil.isNotEmpty(title)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(parameterMap, "{", "}"); + title = strSubstitutor.replace(title); + } + monitorEntity.setTitle(title); + monitorEntity.setReceiveUser(entity1.getWebhookAddress()); + monitorEntity.setContent(content); + monitorEntity.setMessageSource(entity.getMessageSource()); + if (entity1 != null) { + // 消息监控-账号配置写入 + monitorEntity.setAccountId(entity1.getId()); + monitorEntity.setAccountCode(entity1.getEnCode()); + monitorEntity.setAccountName(entity1.getFullName()); + switch (entity1.getWebhookType()) { + case 1: + // 钉钉 + if (Objects.equals(1, entity1.getApproveType())) { + JSONObject result = WebHookUtil.sendDDMessage(entity1.getWebhookAddress(), content); + messageMonitorService.create(monitorEntity); + if (ObjectUtil.isNotEmpty(result)) { + if (!"0".equals(result.get("errcode").toString())) { + retJson.put("code", false); + retJson.put("error", result.get("errmsg")); + return retJson; + } + } else { + retJson.put("code", false); + retJson.put("error", "webhook账号地址配置错误!"); + return retJson; + } + } else if (Objects.equals(2, entity1.getApproveType())) { + JSONObject result = WebHookUtil.sendDingDing(entity1.getWebhookAddress(), + entity1.getBearer(), content); + messageMonitorService.create(monitorEntity); + if (ObjectUtil.isNotEmpty(result)) { + if (!"0".equals(result.get("errcode").toString())) { + retJson.put("code", false); + retJson.put("error", result.get("errmsg")); + return retJson; + } + } else { + retJson.put("code", false); + retJson.put("error", "webhook账号地址配置错误!"); + return retJson; + } + } + break; + case 2: + if (Objects.equals(1, entity1.getApproveType())) { + JSONObject result = WebHookUtil.callWeChatBot(entity1.getWebhookAddress(), content); + messageMonitorService.create(monitorEntity); + if (!"0".equals(result.get("errcode").toString())) { + retJson.put("code", false); + retJson.put("error", result.get("errmsg")); + return retJson; + } + } + break; + default: + break; + } + } else { + retJson.put("code", false); + retJson.put("error", "账号配置数据不存在!"); + messageMonitorService.create(monitorEntity); + return retJson; + } + } else { + retJson.put("code", false); + retJson.put("error", "消息模板数据不存在!"); + messageMonitorService.create(monitorEntity); + return retJson; + } + retJson.put("code", true); + retJson.put("error", MsgCode.SU012.get()); + return retJson; + } + + /** + * 发送企业微信消息 + * + * @param toUserIdsList + * @param userInfo + * @param sendType + * @param parameterMap + * @return + */ + private JSONObject SendQyWebChat(List toUserIdsList, UserInfo userInfo, String sendType, + SendConfigTemplateModel model, Map parameterMap) { + JSONObject retJson = new JSONObject(); + boolean code = true; + StringBuilder error = new StringBuilder(); + MessageTemplateConfigEntity entity = messageTemplateConfigService.getInfo(model.getTemplateId()); + + // 创建消息监控 + MessageMonitorEntity monitorEntity = new MessageMonitorEntity(); + monitorEntity.setId(RandomUtil.uuId()); + monitorEntity.setSendTime(DateUtil.getNowDate()); + monitorEntity.setReceiveUser(JsonUtil.getObjectToString(toUserIdsList)); + monitorEntity.setCreatorTime(DateUtil.getNowDate()); + monitorEntity.setCreatorUserId(userInfo.getUserId()); + // 消息监控-消息模板写入 + monitorEntity.setMessageType(entity.getMessageType()); + monitorEntity.setMessageSource(entity.getMessageSource()); + monitorEntity.setMessageTemplateId(entity.getId()); + + String content = entity.getContent(); + // 替换参数 + if (StringUtil.isNotEmpty(content)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(parameterMap, "{", "}"); + content = strSubstitutor.replace(content); + } + + String title = entity.getTitle(); + if (StringUtil.isNotEmpty(title)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(parameterMap, "{", "}"); + title = strSubstitutor.replace(title); + } + monitorEntity.setTitle(title); + monitorEntity.setContent(content); + for (String userId : toUserIdsList) { + UserEntity userEntity = userService.getInfo(userId); + if (entity != null) { + // 获取系统配置 + Map objModel = getSystemConfig(); + BaseSystemInfo config = JsonUtil.getJsonToBean(objModel, BaseSystemInfo.class); + String corpId = config.getQyhCorpId(); + String agentId = config.getQyhAgentId(); + // 获取的应用的Secret值(某个修复导致俩个秘钥反了,只能反正修复了) + String corpSecret = config.getQyhCorpSecret(); + + String wxUserId = ""; + StringBuilder toWxUserId = new StringBuilder(); + String toUserIdAll = ""; + StringBuilder nullUserInfo = new StringBuilder(); + List messageReceiveList = new ArrayList<>(); + + // 相关参数验证 + if (StringUtil.isEmpty(corpId)) { + log.error("企业ID为空"); + code = false; + error = error.append(";").append(userEntity.getRealName() + ":企业ID为空!"); + continue; + } + if (StringUtil.isEmpty(corpSecret)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":凭证密钥为空!"); + continue; + } + if (StringUtil.isEmpty(agentId)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":企业微信应用凭证为空!"); + continue; + } + if (StringUtil.isEmpty(content)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":内容为空!"); + continue; + } + if (StringUtil.isEmpty(userId)) { + code = false; + error = error.append(";").append("接收人为空!"); + continue; + } + // 创建消息实体 + MessageEntity messageEntity = YunzhupaasMessageUtil.setMessageEntity(userInfo.getUserId(), content, + null, Integer.parseInt(sendType)); + + // 获取接收人员的企业微信号、创建消息用户实体 + wxUserId = ""; + // 从同步表获取对应的企业微信ID + SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId("1", "2", userId); + if (synThirdInfoEntity == null) { + synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId("11", "2", userId); + } + if (synThirdInfoEntity != null) { + wxUserId = synThirdInfoEntity.getThirdObjId(); + } + if (StringUtil.isEmpty(wxUserId)) { + nullUserInfo = nullUserInfo.append(",").append(userId); + } else { + toWxUserId = toWxUserId.append("|").append(wxUserId); + } + messageReceiveList + .add(YunzhupaasMessageUtil.setMessageReceiveEntity(userId, title, Integer.valueOf(sendType))); + + // 处理企业微信号信息串并验证 + toUserIdAll = toWxUserId.toString(); + if (StringUtil.isNotEmpty(toUserIdAll)) { + toUserIdAll = toUserIdAll.substring(1); + } + if (StringUtil.isEmpty(toUserIdAll)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":接收人对应的企业微信号全部为空!"); + continue; + } + + // 批量发送企业信息信息 + retJson = QyWebChatUtil.sendWxMessage(corpId, corpSecret, agentId, toUserIdAll, content); + if (!retJson.getBoolean("code")) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":" + retJson.get("error")); + continue; + } + + // 企业微信号为空的信息写入备注 + if (StringUtil.isNotEmpty(nullUserInfo.toString())) { + messageEntity.setExcerpt(nullUserInfo.substring(1) + "对应的企业微信号为空"); + } + continue; + } else { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":消息模板数据不存在!"); + continue; + } + } + messageMonitorService.create(monitorEntity); + if (code) { + retJson.put("code", true); + retJson.put("error", MsgCode.SU012.get()); + } else { + String msg = error.toString(); + msg = msg.substring(1); + retJson.put("code", false); + retJson.put("error", msg); + } + return retJson; + } + + /** + * List toUserIdsList, UserInfo userInfo, String sendType, + * MessageTemplateEntity entity, Map parameterMap + * + * @param toUserIdsList + * @param userInfo + * @param sendType + * @param parameterMap + * @return + */ + private JSONObject SendDingTalk(List toUserIdsList, UserInfo userInfo, String sendType, + SendConfigTemplateModel model, Map parameterMap) { + JSONObject retJson = new JSONObject(); + boolean code = true; + StringBuilder error = new StringBuilder(); + // 创建消息监控 + MessageTemplateConfigEntity entity = messageTemplateConfigService.getInfo(model.getTemplateId()); + + MessageMonitorEntity monitorEntity = new MessageMonitorEntity(); + monitorEntity.setId(RandomUtil.uuId()); + monitorEntity.setSendTime(DateUtil.getNowDate()); + monitorEntity.setReceiveUser(JsonUtil.getObjectToString(toUserIdsList)); + monitorEntity.setCreatorTime(DateUtil.getNowDate()); + monitorEntity.setCreatorUserId(userInfo.getUserId()); + // 消息监控-消息模板写入 + monitorEntity.setMessageType(entity.getMessageType()); + monitorEntity.setMessageSource(entity.getMessageSource()); + monitorEntity.setMessageTemplateId(entity.getId()); + + String content = entity.getContent(); + // 替换参数 + if (StringUtil.isNotEmpty(content)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(parameterMap, "{", "}"); + content = strSubstitutor.replace(content); + } + + String title = entity.getTitle(); + if (StringUtil.isNotEmpty(title)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(parameterMap, "{", "}"); + title = strSubstitutor.replace(title); + } + monitorEntity.setTitle(title); + monitorEntity.setContent(content); + for (String userId : toUserIdsList) { + UserEntity userEntity = userService.getInfo(userId); + if (entity != null) { + // 获取系统配置 + Map objModel = getSystemConfig(); + DingTalkModel dingTalkModel = JsonUtil.getJsonToBean(objModel, DingTalkModel.class); + String appKey = dingTalkModel.getDingSynAppKey(); + String appSecret = dingTalkModel.getDingSynAppSecret(); + String agentId = dingTalkModel.getDingAgentId(); + String dingUserId = ""; + StringBuilder toDingUserId = new StringBuilder(); + String toUserIdAll = ""; + StringBuilder nullUserInfo = new StringBuilder(); + List messageReceiveList = new ArrayList<>(); + + // 相关参数验证 + if (StringUtil.isEmpty(appKey)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":AppKey为空!"); + continue; + } + if (StringUtil.isEmpty(appSecret)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":AppSecret为空!"); + continue; + } + if (StringUtil.isEmpty(agentId)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":AgentId为空!"); + continue; + } + if (StringUtil.isEmpty(content)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":内容为空!"); + continue; + } + if (StringUtil.isEmpty(userId)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":接收人为空!"); + continue; + } + + // 创建消息实体 + MessageEntity messageEntity = YunzhupaasMessageUtil.setMessageEntity(userInfo.getUserId(), content, + null, Integer.parseInt(sendType)); + + // 获取接收人员的钉钉号、创建消息用户实体 + dingUserId = ""; + // 从同步表获取对应用户的钉钉ID + SynThirdInfoEntity synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId("2", "2", userId); + if (synThirdInfoEntity == null) { + synThirdInfoEntity = synThirdInfoService.getInfoBySysObjId("22", "2", userId); + } + if (synThirdInfoEntity != null) { + dingUserId = synThirdInfoEntity.getThirdObjId(); + } + if (StringUtil.isEmpty(dingUserId)) { + nullUserInfo = nullUserInfo.append(",").append(userId); + } else { + toDingUserId = toDingUserId.append(",").append(dingUserId); + } + messageReceiveList + .add(YunzhupaasMessageUtil.setMessageReceiveEntity(userId, title, Integer.valueOf(sendType))); + + // 处理接收人员的钉钉号信息串并验证 + toUserIdAll = toDingUserId.toString(); + if (StringUtil.isNotEmpty(toUserIdAll)) { + toUserIdAll = toUserIdAll.substring(1); + } + if (StringUtil.isEmpty(toUserIdAll)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":接收人对应的钉钉号为空!"); + continue; + } + + // 批量发送钉钉信息 + retJson = DingTalkUtil.sendDingMessage(appKey, appSecret, agentId, toUserIdAll, content); + if (!retJson.getBoolean("code")) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":" + retJson.get("error")); + continue; + } + + // 钉钉号为空的信息写入备注 + if (StringUtil.isNotEmpty(nullUserInfo.toString())) { + messageEntity.setExcerpt(nullUserInfo.toString().substring(1) + "对应的钉钉号为空!"); + } + continue; + } else { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":消息模板数据不存在!"); + continue; + } + } + messageMonitorService.create(monitorEntity); + if (code) { + retJson.put("code", true); + retJson.put("error", MsgCode.SU012.get()); + } else { + String msg = error.toString(); + msg = msg.substring(1); + retJson.put("code", false); + retJson.put("error", msg); + } + return retJson; + } + + /** + * 发送邮件 + * + * @param toUserIdsList + * @param userInfo + * @param sendType + * @param parameterMap + * @return + */ + private JSONObject SendMail(List toUserIdsList, UserInfo userInfo, String sendType, + SendConfigTemplateModel model, Map parameterMap) { + JSONObject retJson = new JSONObject(); + boolean code = true; + StringBuilder error = new StringBuilder(); + // 创建消息监控 + MessageTemplateConfigEntity entity = messageTemplateConfigService.getInfo(model.getTemplateId()); + AccountConfigEntity entity1 = accountConfigService.getInfo(model.getAccountConfigId()); + MessageMonitorEntity monitorEntity = new MessageMonitorEntity(); + monitorEntity.setId(RandomUtil.uuId()); + monitorEntity.setSendTime(DateUtil.getNowDate()); + monitorEntity.setReceiveUser(JsonUtil.getObjectToString(toUserIdsList)); + monitorEntity.setCreatorTime(DateUtil.getNowDate()); + monitorEntity.setCreatorUserId(userInfo.getUserId()); + // 消息监控-消息模板写入 + monitorEntity.setMessageType(entity.getMessageType()); + monitorEntity.setMessageSource(entity.getMessageSource()); + monitorEntity.setMessageTemplateId(entity.getId()); + // 消息监控-账号配置写入 + monitorEntity.setAccountId(entity1.getId()); + monitorEntity.setAccountCode(entity1.getEnCode()); + monitorEntity.setAccountName(entity1.getFullName()); + String content = entity.getContent(); + // 替换参数 + if (StringUtil.isNotEmpty(content)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(parameterMap, "{", "}"); + content = strSubstitutor.replace(content); + } + + String title = entity.getTitle(); + if (StringUtil.isNotEmpty(title)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(parameterMap, "{", "}"); + title = strSubstitutor.replace(title); + } + monitorEntity.setTitle(title); + monitorEntity.setContent(content); + for (String userId : toUserIdsList) { + UserEntity userEntity = userService.getInfo(userId); + if (userEntity != null) { + if (entity != null) { + if (entity1 != null) { + + Map objModel = new HashMap<>(); + objModel.put("emailSmtpHost", entity1.getSmtpServer()); + objModel.put("emailSmtpPort", entity1.getSmtpPort().toString()); + objModel.put("emailSenderName", entity1.getAddressorName()); + objModel.put("emailAccount", entity1.getSmtpUser()); + objModel.put("emailPassword", entity1.getSmtpPassword()); + objModel.put("emailSsl", entity1.getSslLink().equals(1) ? "true" : "false"); + + EmailModel emailModel = JsonUtil.getJsonToBean(objModel, EmailModel.class); + StringBuilder nullUserInfo = new StringBuilder(); + List messageReceiveList = new ArrayList<>(); + StringBuilder toUserMail = new StringBuilder(); + String userEmailAll = ""; + String userEmail = ""; + String userName = ""; + + // 相关参数验证 + if (StringUtil.isEmpty(emailModel.getEmailSmtpHost())) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":SMTP服务为空!"); + continue; + } else if (StringUtil.isEmpty(emailModel.getEmailSmtpPort())) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":SMTP端口为空!"); + continue; + } else if (StringUtil.isEmpty(emailModel.getEmailAccount())) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":发件人邮箱为空!"); + continue; + } else if (StringUtil.isEmpty(emailModel.getEmailPassword())) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":发件人密码为空!"); + continue; + } else if (StringUtil.isEmpty(userId)) { + code = false; + error = error.append(";").append("接收人为空!"); + continue; + } else { + // 设置邮件标题 + emailModel.setEmailTitle(title); + // 设置邮件内容 + emailModel.setEmailContent(content); + + // 创建消息实体 + MessageEntity messageEntity = YunzhupaasMessageUtil.setMessageEntity(userInfo.getUserId(), + emailModel.getEmailTitle(), emailModel.getEmailContent(), + Integer.parseInt(sendType)); + + // 获取收件人的邮箱地址、创建消息用户实体 + if (userEntity != null) { + userEmail = StringUtil.isEmpty(userEntity.getEmail()) ? "" : userEntity.getEmail(); + userName = userEntity.getRealName(); + } + if (userEmail != null && !"".equals(userEmail)) { + if (EmailUtil.isEmail(userEmail)) { + toUserMail = toUserMail.append(",").append(userName).append("<").append(userEmail) + .append(">"); + } + } else { + nullUserInfo = nullUserInfo.append(",").append(userId); + } + messageReceiveList.add(YunzhupaasMessageUtil.setMessageReceiveEntity(userId, title, + Integer.valueOf(sendType))); + + // 处理接收人员的邮箱信息串并验证 + userEmailAll = toUserMail.toString(); + if (StringUtil.isNotEmpty(userEmailAll)) { + userEmailAll = userEmailAll.substring(1); + } + if (StringUtil.isEmpty(userEmailAll)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":接收人为空!"); + continue; + } else { + // 设置接收人员 + emailModel.setEmailToUsers(userEmailAll); + // 发送邮件 + retJson = EmailUtil.sendMail(emailModel); + if (!retJson.getBoolean("code")) { + code = false; + error = error.append(";") + .append(userEntity.getRealName() + ":" + retJson.get("error")); + continue; + } else { + // 邮箱地址为空的信息写入备注 + if (StringUtil.isNotEmpty(nullUserInfo.toString())) { + messageEntity.setExcerpt(nullUserInfo.substring(1) + "对应的邮箱为空"); + } + continue; + // 写入系统的消息表、消息用户表 + } + } + } + } else { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":账号配置数据不存在!"); + continue; + } + } else { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":消息模板数据不存在!"); + continue; + } + } + } + messageMonitorService.create(monitorEntity); + if (code) { + retJson.put("code", true); + retJson.put("error", MsgCode.SU012.get()); + } else { + String msg = error.toString(); + msg = msg.substring(1); + retJson.put("code", false); + retJson.put("error", msg); + } + return retJson; + } + + /** + * 发送短信 + * + * @param toUserIdsList + * @param parameterMap + * @return + */ + private JSONObject sendSms(List toUserIdsList, SendConfigTemplateModel model, + Map parameterMap) { + UserInfo userInfo = UserProvider.getUser(); + JSONObject retJson = new JSONObject(); + boolean code = true; + StringBuilder error = new StringBuilder(); + + // 创建消息监控 + MessageTemplateConfigEntity entity = messageTemplateConfigService.getInfo(model.getTemplateId()); + AccountConfigEntity entity1 = accountConfigService.getInfo(model.getAccountConfigId()); + MessageMonitorEntity monitorEntity = new MessageMonitorEntity(); + monitorEntity.setId(RandomUtil.uuId()); + monitorEntity.setSendTime(DateUtil.getNowDate()); + monitorEntity.setReceiveUser(JsonUtil.getObjectToString(toUserIdsList)); + monitorEntity.setCreatorTime(DateUtil.getNowDate()); + monitorEntity.setCreatorUserId(userInfo.getUserId()); + // 消息监控-消息模板写入 + monitorEntity.setMessageType(entity.getMessageType()); + monitorEntity.setMessageSource(entity.getMessageSource()); + monitorEntity.setMessageTemplateId(entity.getId()); + // 消息监控-账号配置写入 + monitorEntity.setAccountId(entity1.getId()); + monitorEntity.setAccountCode(entity1.getEnCode()); + monitorEntity.setAccountName(entity1.getFullName()); + String content = entity.getContent(); + // 替换参数 + if (StringUtil.isNotEmpty(content)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(parameterMap, "{", "}"); + content = strSubstitutor.replace(content); + } + + String title = entity.getTitle(); + if (StringUtil.isNotEmpty(title)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(parameterMap, "{", "}"); + title = strSubstitutor.replace(title); + } + monitorEntity.setTitle(title); + monitorEntity.setContent(content); + for (String userId : toUserIdsList) { + UserEntity userEntity = userService.getInfo(userId); + if (entity != null) { + if (entity1 != null) { + // 账号配置——短信 + Map objModel = new HashMap<>(16); + objModel.put("aliAccessKey", entity1.getAppId()); + objModel.put("aliSecret", entity1.getAppSecret()); + objModel.put("tencentSecretId", entity1.getAppId()); + objModel.put("tencentSecretKey", entity1.getAppSecret()); + objModel.put("tencentAppId", entity1.getSdkAppId()); + objModel.put("tencentAppKey", entity1.getAppKey()); + SmsModel smsConfig = JsonUtil.getJsonToBean(objModel, SmsModel.class); + int company = entity1.getChannel(); + // 组装接受用户 + StringBuffer toUserIdList = new StringBuffer(); + + if (isPhone(userEntity.getMobilePhone())) { + toUserIdList.append(userEntity.getMobilePhone() + ","); + } + // 短信参数 + Map smsMap = new HashMap<>(); + if (entity != null) { + smsMap = smsFieldService.getParamMap(entity.getId(), parameterMap); + } else { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":消息模板数据不存在!"); + continue; + } + // 发送短信 + String endPoint = ""; + if (Objects.equals(1, entity1.getChannel())) { + endPoint = entity1.getEndPoint(); + } else if (Objects.equals(2, entity1.getChannel())) { + endPoint = entity1.getZoneName(); + } + content = SmsUtil.querySmsTemplateContent(company, smsConfig, endPoint, entity1.getZoneParam(), + entity.getTemplateCode()); + if (StringUtil.isNotBlank(content) && !"null".equals(content)) { + if (Objects.equals(1, entity1.getChannel())) { + if (content.contains("${")) { + for (String key : smsMap.keySet()) { + if (StringUtil.isNotBlank(String.valueOf(smsMap.get(key))) + && smsMap.get(key) != null) { + String v = String.valueOf(smsMap.get(key)); + content = content.replace("${" + key + "}", smsMap.get(key).toString()); + } + } + } + } else if (Objects.equals(2, entity1.getChannel())) { + if (content.contains("{")) { + for (String key : smsMap.keySet()) { + if (StringUtil.isNotBlank(String.valueOf(smsMap.get(key))) + && smsMap.get(key) != null) { + content = content.replace("{" + key + "}", smsMap.get(key).toString()); + } + } + } + } + } + monitorEntity.setContent(content); + if (StringUtil.isEmpty(toUserIdList)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":手机号码格式错误!"); + continue; + } + String result = SmsUtil.sentSms(company, smsConfig, endPoint, entity1.getZoneParam(), + toUserIdList.toString(), entity1.getSmsSignature(), entity.getTemplateCode(), smsMap); + if (!"Ok".equalsIgnoreCase(result)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":" + result); + continue; + } + continue; + } else { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":账号配置数据不存在!"); + continue; + } + } else { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":消息模板数据不存在!"); + continue; + } + } + messageMonitorService.create(monitorEntity); + if (code) { + retJson.put("code", true); + retJson.put("error", MsgCode.SU012.get()); + } else { + String msg = error.toString(); + msg = msg.substring(1); + retJson.put("code", false); + retJson.put("error", msg); + } + return retJson; + } + + /** + * 发送微信公众号消息 + * + * @param toUserIdsList + * @param userInfo + * @param sendType + * @param parameterMap + * @return + */ + public JSONObject SendWXGzhChat(List toUserIdsList, UserInfo userInfo, String sendType, + SendConfigTemplateModel model, Map parameterMap) { + JSONObject retJson = new JSONObject(); + boolean code = true; + StringBuilder error = new StringBuilder(); + // 创建消息监控 + MessageTemplateConfigEntity entity = messageTemplateConfigService.getInfo(model.getTemplateId()); + AccountConfigEntity entity1 = accountConfigService.getInfo(model.getAccountConfigId()); + MessageMonitorEntity monitorEntity = new MessageMonitorEntity(); + monitorEntity.setId(RandomUtil.uuId()); + monitorEntity.setSendTime(DateUtil.getNowDate()); + monitorEntity.setReceiveUser(JsonUtil.getObjectToString(toUserIdsList)); + monitorEntity.setCreatorTime(DateUtil.getNowDate()); + monitorEntity.setCreatorUserId(userInfo.getUserId()); + // 消息监控-消息模板写入 + monitorEntity.setMessageType(entity.getMessageType()); + monitorEntity.setMessageSource(entity.getMessageSource()); + monitorEntity.setMessageTemplateId(entity.getId()); + // 消息监控-账号配置写入 + monitorEntity.setAccountId(entity1.getId()); + monitorEntity.setAccountCode(entity1.getEnCode()); + monitorEntity.setAccountName(entity1.getFullName()); + String content = entity.getContent(); + // 替换参数 + if (StringUtil.isNotEmpty(content)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(parameterMap, "{", "}"); + content = strSubstitutor.replace(content); + } + + String title = entity.getTitle(); + if (StringUtil.isNotEmpty(title)) { + StringSubstitutor strSubstitutor = new StringSubstitutor(parameterMap, "{", "}"); + title = strSubstitutor.replace(title); + } + monitorEntity.setTitle(title); + monitorEntity.setContent(content); + for (String userId : toUserIdsList) { + if (StringUtil.isEmpty(userId)) { + code = false; + error = error.append(";").append("接收人为空!"); + continue; + } + UserEntity userEntity = userService.getById(userId); + AccountConfigEntity accountEntity = accountConfigService.getInfo(model.getAccountConfigId()); + // 获取消息模板详情 + MessageTemplateConfigEntity msgTemEntity = messageTemplateConfigService.getInfo(model.getTemplateId()); + if (msgTemEntity != null) { + String templateKId = msgTemEntity.getTemplateCode(); + // 微信公众号参数 + Map smsMap = new HashMap<>(); + if (model != null) { + smsMap = smsFieldService.getParamMap(model.getTemplateId(), parameterMap); + } + if (smsMap.containsKey("title")) { + title = smsMap.get("title").toString(); + smsMap.keySet().removeIf(k -> k.equals("title")); + } + monitorEntity.setTitle(title); + if (ObjectUtil.isNotEmpty(accountEntity)) { + // 获取系统配置 + String appId = accountEntity.getAppId(); + String appsecret = accountEntity.getAppSecret(); + String wxxcxAppId = msgTemEntity.getXcxAppId(); + String type = msgTemEntity.getWxSkip(); + + // 相关参数验证 + if (StringUtil.isEmpty(templateKId)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":微信公众号模板id未创建!"); + messageMonitorService.create(monitorEntity); + continue; + } + if (StringUtil.isEmpty(appId)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":公众号appid为空为空!"); + messageMonitorService.create(monitorEntity); + continue; + } + if (StringUtil.isEmpty(appsecret)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":公众号appsecret为空为空!"); + messageMonitorService.create(monitorEntity); + continue; + } + // 获取微信公众号的token + String token = WXGZHWebChatUtil.getAccessToken(appId, appsecret); + if (StringUtil.isEmpty(token)) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":获取微信公众号token失败!"); + messageMonitorService.create(monitorEntity); + continue; + } + // 微信公众号发送消息 + // 获取用户在对应微信公众号上的openid + WechatUserEntity wechatUserEntity = wechatUserService.getInfoByGzhId(userId, + accountEntity.getAppKey()); + if (wechatUserEntity != null) { + if (StringUtil.isNotBlank(wechatUserEntity.getOpenId())) { + String openid = wechatUserEntity.getOpenId(); + String pagepath = "pages/login/index?tag=1&flowId="; + // 参数封装 + String message = WXGZHWebChatUtil.messageJson(templateKId, openid, wxxcxAppId, pagepath, + smsMap, title, "2", null); + // 发送信息 + retJson = WXGZHWebChatUtil.sendMessage(token, message); + JSONObject rstObj = WXGZHWebChatUtil.getMessageList(token); + List wxgzhMessageModelList = JsonUtil + .getJsonToList(rstObj.get("template_list"), WxgzhMessageModel.class); + WxgzhMessageModel messageModel = wxgzhMessageModelList.stream() + .filter(t -> t.getTemplateId().equals(templateKId)).findFirst().orElse(null); + if (ObjectUtil.isNotEmpty(messageModel)) { + content = messageModel.getContent(); + if (StringUtil.isNotBlank(content) && !"null".equals(content)) { + if (ObjectUtil.isNotEmpty(smsMap) && !"null".equals(smsMap)) { + if (content.contains(".DATA}")) { + for (String key : smsMap.keySet()) { + content = content.replace(key, smsMap.get(key).toString()); + } + } + } + } + } + // 创建消息监控 + monitorEntity.setContent(content); + if (!retJson.getBoolean("code")) { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":" + retJson.get("error")); + messageMonitorService.create(monitorEntity); + continue; + } + messageMonitorService.create(monitorEntity); + continue; + } else { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":" + "账号未绑定公众号!"); + messageMonitorService.create(monitorEntity); + continue; + } + } else { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":" + "账号未绑定公众号!"); + messageMonitorService.create(monitorEntity); + continue; + } + } else { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":账号配置数据不存在!"); + messageMonitorService.create(monitorEntity); + continue; + } + } else { + code = false; + error = error.append(";").append(userEntity.getRealName() + ":消息模板数据不存在!"); + messageMonitorService.create(monitorEntity); + continue; + } + } + if (code) { + retJson.put("code", true); + retJson.put("error", MsgCode.SU012.get()); + } else { + String msg = error.toString(); + msg = msg.substring(1); + retJson.put("code", false); + retJson.put("error", msg); + } + return retJson; + } + + /** + * 获取系统配置 + */ + private Map getSystemConfig() { + // 获取系统配置 + List configList = sysconfigService.getList("SysConfig"); + Map objModel = new HashMap<>(16); + for (SysConfigEntity entity : configList) { + objModel.put(entity.getFkey(), entity.getValue()); + } + return objModel; + } + + private MessageMonitorEntity createSysMessageMonitor(MessageTemplateConfigEntity msgTemEntity, String content, + UserInfo userInfo, List toUserIdsList, String title) { + MessageMonitorEntity monitorEntity = new MessageMonitorEntity(); + monitorEntity.setId(RandomUtil.uuId()); + monitorEntity.setMessageType(msgTemEntity.getMessageType()); + monitorEntity.setMessageSource(msgTemEntity.getMessageSource()); + monitorEntity.setSendTime(DateUtil.getNowDate()); + monitorEntity.setMessageTemplateId(msgTemEntity.getId()); + monitorEntity.setTitle(title); + monitorEntity.setReceiveUser(JsonUtil.getObjectToString(toUserIdsList)); + monitorEntity.setContent(content); + monitorEntity.setCreatorTime(DateUtil.getNowDate()); + monitorEntity.setCreatorUserId(userInfo.getUserId()); + return monitorEntity; + } + + public static boolean isPhone(String phone) { + if (StringUtil.isNotBlank(phone) && !"null".equals(phone)) { + return Pattern.matches("^1[3-9]\\d{9}$", phone); + } + return false; + } +} diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/dataSet/DataSetConfigUtil.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/dataSet/DataSetConfigUtil.java new file mode 100644 index 0000000..9e80422 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/dataSet/DataSetConfigUtil.java @@ -0,0 +1,557 @@ +package com.yunzhupaas.base.util.dataSet; + +import com.yunzhupaas.base.model.dataset.*; +import com.yunzhupaas.constant.DsKeyConst; +import com.yunzhupaas.database.model.superQuery.SuperQueryJsonModel; +import com.yunzhupaas.database.source.DbBase; +import com.yunzhupaas.database.util.DbTypeUtil; +import com.yunzhupaas.emnus.DsJoinTypeEnum; +import com.yunzhupaas.emnus.SearchMethodEnum; +import com.yunzhupaas.model.visualJson.FieLdsModel; +import com.yunzhupaas.util.DateUtil; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; +import org.apache.commons.collections4.CollectionUtils; + +import java.util.*; + +/** + * 配置式工具类 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/9/9 17:34:11 + */ +public class DataSetConfigUtil { + // 字段别名 + public static final String FIELD_RENAME = "%s.%s AS %s "; + // 普通查询 + public static final String SELECT_FROM = "SELECT %s FROM %s"; + // 最基础的查询别名 + public static final String SELECT_UNIT = "(SELECT %s FROM %s) %s"; + // 基础的上级查询 + public static final String SELECT_UPPER = "(%s) %s"; + public static final String SELECT_BRACKET = "(%s)"; + + public static final String SIGN_EMPTY = ""; + public static final String SIGN_BLANK = " "; + public static final String SIGN_COMMA = ","; + public static final String SIGN_EQUALS = " = "; + public static final String SIGN_ON = " ON "; + public static final String SIGN_AND = " AND "; + public static final String SIGN_WHERE = " WHERE "; + public static final String SIGN_OR = " OR "; + public static final String SIGN_UNDERLINE = "_"; + public static final String SIGN_BAR = "-"; + public static final String SIGN_PER = "%"; + public static final String SIGN_BETWEEN = " BETWEEN "; + public static final String SIGN_NULL = " IS NULL "; + public static final String SIGN_NOT_NULL = " IS NOT NULL "; + public static final String SIGN_NEQ = " <> "; + public static final String SIGN_GREATER = " > "; + public static final String SIGN_LESS = " < "; + public static final String SIGN_GREATER_EQ = " >= "; + public static final String SIGN_LESS_EQ = " <= "; + public static final String SIGN_LIKE = " LIKE "; + public static final String SIGN_NOT_LIKE = " NOT LIKE "; + public static final String SIGN_YUNZHUPAASNULLLIST = "yunzhupaasNullList"; + public static final String SIGN_QUESTION = "?"; + public static final String SIGN_TAMESTAMP = "TO_TIMESTAMP(?,'yyyy-mm-dd hh24:mi:ss')"; + + /** + * 递归获取全部字段 + * + * @param configList + * @param list + */ + public static void getAllFields(List configList, List list) { + if (configList == null || CollectionUtils.isEmpty(configList)) + return; + for (DsConfigModel item : configList) { + if (item.getFieldList() != null && item.getFieldList().size() > 0) { + list.addAll(item.getFieldList()); + } + getAllFields(item.getChildren(), list); + } + } + + /** + * 单表查询字段别名 + * + * @param list + * @return + */ + public static String getTableFieldsAlias(List list, boolean onlyField) { + if (list == null || CollectionUtils.isEmpty(list)) + return SIGN_EMPTY; + StringJoiner result = new StringJoiner(SIGN_COMMA); + for (DsConfigFields item : list) { + String tableAlias = item.getTable(); + String fieldAlias = item.getFieldAlias(); + String field = item.getField(); + if (StringUtil.isNotEmpty(fieldAlias)) { + if (onlyField) { + // 只有别名字段 + result.add(fieldAlias); + } else { + // 表名.字段 AS 别名 + result.add(String.format(FIELD_RENAME, tableAlias, field, fieldAlias)); + } + } else { + // 只有原字段 + result.add(field); + } + } + return result.toString(); + } + + /** + * 解析json + * + * @param configListJson + * @return + */ + public static List analyzeJson(String configListJson, String dbType) { + List configList = JsonUtil.getJsonToList(configListJson, DsConfigModel.class); + if (CollectionUtils.isEmpty(configList)) { + return new ArrayList<>(); + } + // 单个表不别名 + if (CollectionUtils.isEmpty(configList.get(0).getChildren())) { + return configList; + } + + int startIndex = 0; + + // 别名小写 + if (DbTypeUtil.needToLowerCase(dbType)) { + startIndex = 32; + } + analyzeDsConfigModel(configList, startIndex); + return configList; + } + + /** + * 递归解析json + * + * @param configList + * @param letterNum + */ + private static void analyzeDsConfigModel(List configList, int letterNum) { + if (CollectionUtils.isNotEmpty(configList)) { + for (DsConfigModel configModel : configList) { + String tableLetter = getLetter(letterNum) + SIGN_UNDERLINE; + String tableAlias = tableLetter + configModel.getTable(); + configModel.setTableAlias(tableAlias); + // 子表配置 + List children = configModel.getChildren(); + if (CollectionUtils.isNotEmpty(children)) { + letterNum++; + analyzeDsConfigModel(children, letterNum); + } + // 字段别名设置 + List fieldList = configModel.getFieldList(); + if (CollectionUtils.isNotEmpty(fieldList)) { + for (DsConfigFields field : fieldList) { + field.setFieldAlias(tableLetter + field.getField()); + field.setTable(configModel.getTable()); + } + } + letterNum++; + } + } + } + + /** + * 组装sql + * + * @param configList + * @return + */ + public static String assembleSql(List configList, DsParamModel dsParamModel) { + String sql = ""; + if (CollectionUtils.isEmpty(configList)) { + return null; + } + List listDF = new ArrayList<>(); + DataSetConfigUtil.getAllFields(configList, listDF); + + String fieldsAlias = getTableFieldsAlias(listDF, true); + + DsConfigModel configModel = configList.get(0); + + StringBuilder result = new StringBuilder(); + // 递归组装 + if (CollectionUtils.isNotEmpty(configModel.getChildren())) { + StringBuilder childStr = new StringBuilder(); + DataSetConfigUtil.recurAssSql(configModel, childStr, dsParamModel); + result.append(childStr); + } else { + String where = DataSetConfigUtil.recurAssWhere(configModel, dsParamModel, false); + String tableAndWhere = configModel.getTable() + (StringUtil.isNotEmpty(where) ? SIGN_WHERE + where : ""); + result.append(String.format(SELECT_FROM, fieldsAlias, tableAndWhere)); + } + sql = result.toString(); + // 组装最外层过滤 + if (StringUtil.isNotEmpty(dsParamModel.getFilterConfigJson())) { + DsConfigModel relationModel = JsonUtil.getJsonToBean(dsParamModel.getFilterConfigJson(), + DsConfigModel.class); + if (CollectionUtils.isNotEmpty(relationModel.getRuleList())) { + StringBuilder filterResult = new StringBuilder(); + String filterTable = StringUtil.isNotEmpty(configModel.getTableAlias()) ? configModel.getTableAlias() + : configModel.getTable(); + filterResult + .append(String.format(SELECT_FROM, fieldsAlias, String.format(SELECT_UPPER, sql, filterTable))); + relationModel.setTable(configModel.getTable()); + relationModel.setFieldList(configModel.getFieldList()); + relationModel.setChildren(configModel.getChildren()); + String recurAssWhere = recurAssWhere(relationModel, dsParamModel, true); + if (StringUtil.isNotEmpty(recurAssWhere)) { + filterResult.append(SIGN_WHERE); + filterResult.append(recurAssWhere); + } + sql = filterResult.toString(); + } + } + return sql; + } + + /** + * 递归组装 + * + * @param configModel + * @param result + * @return + */ + private static void recurAssSql(DsConfigModel configModel, StringBuilder result, DsParamModel dsParamModel) { + List children = configModel.getChildren(); + // 递归获取全部字段 + List listDF = new ArrayList<>(); + DataSetConfigUtil.getAllFields(new ArrayList() { + { + add(configModel); + } + }, listDF); + String tableAlias = configModel.getTableAlias(); + String table = configModel.getTable(); + + List fieldList = configModel.getFieldList(); + String mainFields = DataSetConfigUtil.getTableFieldsAlias(fieldList, false); + + // 当前查询条件 + String where = DataSetConfigUtil.recurAssWhere(configModel, dsParamModel, false); + String tableAndWhere = table + (StringUtil.isNotEmpty(where) ? SIGN_WHERE + where : ""); + // 查询当前表语句 - 有子表往里塞,没有直接抛出 + String tableSelect = String.format(SELECT_UNIT, mainFields, tableAndWhere, tableAlias); + if (CollectionUtils.isNotEmpty(children)) { + // 查询结果集 + String allFields = DataSetConfigUtil.getTableFieldsAlias(listDF, true); + StringBuilder childBuilder = new StringBuilder(); + + // 查询主表字段 + childBuilder.append(tableSelect); + // 查询连表 + for (DsConfigModel item : children) { + DsRelationConfig relationConfig = item.getRelationConfig(); + List fieldItem = item.getFieldList(); + String codeByType = DsJoinTypeEnum.getCodeByType(relationConfig.getType()); + childBuilder.append(SIGN_BLANK); + childBuilder.append(codeByType); + StringBuilder itemBuilder = new StringBuilder(); + DataSetConfigUtil.recurAssSql(item, itemBuilder, dsParamModel); + if (CollectionUtils.isNotEmpty(item.getChildren())) { + childBuilder.append(String.format(SELECT_UPPER, itemBuilder, item.getTableAlias())); + } else { + childBuilder.append(itemBuilder); + } + // 关联关系拼接-必须有关联关系 + List relationList = relationConfig.getRelationList(); + childBuilder.append(SIGN_ON); + StringJoiner relationJoiner = new StringJoiner(SIGN_AND); + for (DsRelationModel relationModel : relationList) { + DsConfigFields pFields = fieldList.stream() + .filter(t -> t.getField().equals(relationModel.getPField())).findFirst().orElse(null); + DsConfigFields cFields = fieldItem.stream() + .filter(t -> t.getField().equals(relationModel.getField())).findFirst().orElse(null); + relationJoiner.add(pFields.getFieldAlias() + SIGN_EQUALS + cFields.getFieldAlias()); + } + childBuilder.append(relationJoiner); + } + // 拼接所有表的关联关系 + StringJoiner relationWhereJoiner = new StringJoiner(SIGN_AND); + for (DsConfigModel item : children) { + DsRelationConfig relationConfig = item.getRelationConfig(); + // 连表条件拼接 + DsConfigModel relationModel = new DsConfigModel(); + relationModel.setTable(table); + relationModel.setFieldList(fieldList); + relationModel.setChildren(children); + relationModel.setMatchLogic(relationConfig.getMatchLogic()); + relationModel.setRuleList(relationConfig.getRuleList()); + String relationWhere = DataSetConfigUtil.recurAssWhere(relationModel, dsParamModel, true); + if (StringUtil.isNotEmpty(relationWhere)) { + relationWhereJoiner.add(relationWhere); + } + } + if (relationWhereJoiner.length() > 0) { + childBuilder.append(SIGN_WHERE); + childBuilder.append(relationWhereJoiner); + } + result.append(String.format(SELECT_FROM, allFields, childBuilder)); + } else { + result.append(tableSelect); + } + + } + + /** + * 组装where条件 + * + * @param configModel + * @param dsParamModel + * @param fieldAlias + * @return + */ + public static String recurAssWhere(DsConfigModel configModel, DsParamModel dsParamModel, boolean fieldAlias) { + List fieldList = configModel.getFieldList(); + Map> fieldsMap = new HashMap<>(); + fieldsMap.put(configModel.getTable(), fieldList); + List children = configModel.getChildren(); + for (DsConfigModel child : children) { + fieldsMap.put(child.getTable(), child.getFieldList()); + } + String matchLogic = SearchMethodEnum.And.getSymbol().equals(configModel.getMatchLogic()) ? SIGN_AND : SIGN_OR; + List ruleList = configModel.getRuleList(); + StringJoiner matchJoiner = new StringJoiner(matchLogic); + int m = 0; + if (CollectionUtils.isNotEmpty(ruleList)) { + for (SuperQueryJsonModel ruleModel : ruleList) { + String logic = SearchMethodEnum.And.getSymbol().equals(ruleModel.getLogic()) ? SIGN_AND : SIGN_OR; + StringJoiner logicJoiner = new StringJoiner(logic); + List groups = ruleModel.getGroups(); + int n = 0; + for (FieLdsModel fieLdsModel : groups) { + DsConfigFields configFields = null; + String thisField; + if (fieLdsModel.getField().contains(SIGN_BAR)) { + String thisTable = fieLdsModel.getField().split(SIGN_BAR)[0]; + thisField = fieLdsModel.getField().split(SIGN_BAR)[1]; + List dsConfigFields = fieldsMap.get(thisTable); + if (CollectionUtils.isNotEmpty(dsConfigFields)) { + configFields = dsConfigFields.stream().filter(t -> t.getField().equals(thisField)) + .findFirst().orElse(null); + } + } else { + thisField = fieLdsModel.getField(); + configFields = fieldList.stream().filter(t -> t.getField().equals(thisField)).findFirst() + .orElse(null); + } + if (configFields != null && StringUtil.isNotEmpty(configFields.getFieldAlias())) { + fieLdsModel.setFieldAlias(configFields.getFieldAlias()); + } else { + fieLdsModel.setFieldAlias(thisField); + } + String condition = getCondition(fieLdsModel, dsParamModel, fieldAlias); + logicJoiner.add(condition); + n++; + } + if (logicJoiner.length() > 0) { + String logicSql = logicJoiner.toString(); + if (n > 1) { + logicSql = String.format(SELECT_BRACKET, logicSql); + } + matchJoiner.add(logicSql); + m++; + } + + } + } + if (matchJoiner.length() > 0) { + String matchSql = matchJoiner.toString(); + if (m > 1) { + matchSql = String.format(SELECT_BRACKET, matchSql); + } + return matchSql; + } + return ""; + } + + /** + * 拼接条件 + * + * @param fieLdsModel + * @param dsParamModel + * @param fieldAlias + * @return + */ + public static String getCondition(FieLdsModel fieLdsModel, DsParamModel dsParamModel, boolean fieldAlias) { + List values = dsParamModel.getValues(); + String dbType = dsParamModel.getDbType(); + boolean isOracleOrPostgre = DbBase.ORACLE.equalsIgnoreCase(dbType) + || DbBase.POSTGRE_SQL.equalsIgnoreCase(dbType); + boolean isSqlServer = DbBase.SQL_SERVER.equalsIgnoreCase(dbType); + String field = fieldAlias ? fieLdsModel.getFieldAlias() : fieLdsModel.getField(); + String dataType = fieLdsModel.getDataType(); + SearchMethodEnum symbol = SearchMethodEnum.getSearchMethod(fieLdsModel.getSymbol()); + + String mark = SIGN_QUESTION; + if (DsKeyConst.DateSelect.contains(dataType) && isOracleOrPostgre) { + mark = SIGN_TAMESTAMP; + } + // 获取条件值 + swapValue(fieLdsModel, dsParamModel); + Object fieldValueOne = fieLdsModel.getFieldValueOne(); + Object fieldValueTwo = fieLdsModel.getFieldValueTwo(); + if (isSqlServer && fieldValueOne instanceof String) { + fieldValueOne = String.valueOf(fieldValueOne).replaceAll("\\[", "[[]"); + } + + StringBuilder sqlBuilder = new StringBuilder(); + switch (symbol) { + case IsNull: + sqlBuilder.append(field + SIGN_NULL); + break; + case IsNotNull: + sqlBuilder.append(field + SIGN_NOT_NULL); + break; + case Equal: + sqlBuilder.append(field + SIGN_EQUALS + mark); + values.add(fieldValueOne); + break; + case NotEqual: + sqlBuilder.append(field + SIGN_NEQ + mark); + values.add(fieldValueOne); + break; + case GreaterThan: + sqlBuilder.append(field + SIGN_GREATER + mark); + values.add(fieldValueOne); + break; + case LessThan: + sqlBuilder.append(field + SIGN_LESS + mark); + values.add(fieldValueOne); + break; + case GreaterThanOrEqual: + sqlBuilder.append(field + SIGN_GREATER_EQ + mark); + values.add(fieldValueOne); + break; + case LessThanOrEqual: + sqlBuilder.append(field + SIGN_LESS_EQ + mark); + values.add(fieldValueOne); + break; + case Like: + sqlBuilder.append(field + SIGN_LIKE + mark); + values.add(SIGN_PER + fieldValueOne + SIGN_PER); + break; + case NotLike: + sqlBuilder.append(field + SIGN_NOT_LIKE + mark); + values.add(SIGN_PER + fieldValueOne + SIGN_PER); + break; + case Between: + sqlBuilder.append(field + SIGN_BETWEEN + mark + SIGN_AND + mark); + values.add(fieldValueOne); + values.add(fieldValueTwo); + break; + case Included: + case NotIncluded: + List dataList = new ArrayList<>(); + if (fieldValueOne instanceof List) { + dataList.addAll((List) fieldValueOne); + } else { + if (fieldValueOne != null) { + dataList.add(fieldValueOne.toString()); + } else { + dataList.add(SIGN_YUNZHUPAASNULLLIST); + } + } + StringJoiner innerJoiner = new StringJoiner(SIGN_OR); + for (int i = 0; i < dataList.size(); i++) { + switch (symbol) { + case Included: + innerJoiner.add(field + SIGN_LIKE + mark); + values.add(SIGN_PER + dataList.get(i) + SIGN_PER); + break; + default: + innerJoiner.add(field + SIGN_NOT_LIKE + mark); + values.add(SIGN_PER + dataList.get(i) + SIGN_PER); + break; + } + } + sqlBuilder.append(String.format(SELECT_BRACKET, innerJoiner)); + break; + } + return sqlBuilder.toString(); + } + + /** + * 值转换 + * + * @param fieLdsModel + * @param dsParamModel + */ + public static void swapValue(FieLdsModel fieLdsModel, DsParamModel dsParamModel) { + Map systemParam = dsParamModel.getSystemParam(); + String fieldValue = fieLdsModel.getFieldValue(); + String dataType = fieLdsModel.getDataType(); + + String valueOne = null; + String valueTwo = null; + Object fieldValueOne = fieldValue; + Object fieldValueTwo = fieldValue; + String fieldValueType = fieLdsModel.getFieldValueType(); + List data = new ArrayList<>(); + if (DsKeyConst.BetweenSelect.contains(dataType)) { + try { + data.addAll(JsonUtil.getJsonToList(fieldValue, String.class)); + if (data.size() == 0) + return; + if (data.size() == 1) + data.add(data.get(0)); + } catch (Exception e) { + data.add(fieldValue); + data.add(fieldValue); + } + valueOne = data.get(0); + valueTwo = data.get(1); + } + switch (dataType) { + case DsKeyConst.DOUBLE: + fieldValueOne = valueOne != null ? new Double(valueOne) : valueOne; + fieldValueTwo = valueTwo != null ? new Double(valueTwo) : valueTwo; + break; + case DsKeyConst.BIGINT: + fieldValueOne = valueOne != null ? new Long(valueOne) : valueOne; + fieldValueTwo = valueTwo != null ? new Long(valueTwo) : valueTwo; + break; + case DsKeyConst.DATE: + case DsKeyConst.TIME: + if (valueOne != null) { + fieldValueOne = DateUtil.dateFormat(new Date(Long.valueOf(valueOne))); + } + + if (valueTwo != null) { + fieldValueTwo = DateUtil.dateFormat(new Date(Long.valueOf(valueTwo))); + } + break; + default: + // TEXT 1-自定义,2-系统参数 + if (Objects.equals(fieldValueType, "2")) { + fieldValueOne = systemParam.get(fieldValue); + } + break; + } + fieLdsModel.setFieldValueOne(fieldValueOne); + fieLdsModel.setFieldValueTwo(fieldValueTwo); + } + + /** + * asc码获取字母 + * + * @param letterNum + * @return + */ + public static String getLetter(int letterNum) { + char letter = (char) (65 + letterNum); + return String.valueOf(letter); + } +} diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/dataSet/DataSetConstant.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/dataSet/DataSetConstant.java new file mode 100644 index 0000000..36594ea --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/dataSet/DataSetConstant.java @@ -0,0 +1,57 @@ +package com.yunzhupaas.base.util.dataSet; + +public class DataSetConstant { + /** + * 枚举(静态数据和字典) + */ + public static final String KEY_SELECT = "select"; + /** + * 日期(5种格式) + */ + public static final String KEY_DATE = "date"; + /** + * 时间 + */ + public static final String KEY_TIME = "time"; + /** + * 组织 + */ + public static final String KEY_ORG = "organize"; + /** + * 部门 + */ + public static final String KEY_DEP = "department"; + /** + * 岗位 + */ + public static final String KEY_POS = "position"; + /** + * 用户 + */ + public static final String KEY_USER = "user"; + /** + * 角色 + */ + public static final String KEY_ROLE = "role"; + /** + * 分组 + */ + public static final String KEY_GROUP = "group"; + /** + * 数字 + */ + public static final String KEY_NUMBER = "number"; + /** + * 地址 + */ + public static final String KEY_ADDRESS = "address"; + /** + * 用户选择 + */ + public static final String KEY_USERS = "users"; + /** + * 定位 + */ + public static final String KEY_LOCATION = "location"; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/dataSet/DataSetExecutor.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/dataSet/DataSetExecutor.java new file mode 100644 index 0000000..e75c89c --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/dataSet/DataSetExecutor.java @@ -0,0 +1,320 @@ +package com.yunzhupaas.base.util.dataSet; + +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.model.dataset.DataSetConfig; +import com.yunzhupaas.base.model.dataset.DataSetOptions; +import com.yunzhupaas.base.model.dataset.DataSetSwapModel; +import com.yunzhupaas.base.service.DictionaryDataService; +import com.yunzhupaas.permission.service.*; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.data.DataSourceContextHolder; +import com.yunzhupaas.util.visiual.DataTypeConst; +import lombok.Data; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.MapUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.*; +import java.util.concurrent.CountDownLatch; +import java.util.stream.Collectors; + +/** + * 数据集数据转换多线程 + * + * @author 云筑产品开发平台组 + * @version v5.0.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/7/15 16:45:09 + */ +@Slf4j +@Component +public class DataSetExecutor { + @Autowired + private RedisUtil redisUtil; + @Autowired + private UserService userApi; + @Autowired + private OrganizeService organizeApi; + @Autowired + private PositionService positionApi; + @Autowired + private RoleService roleApi; + @Autowired + private GroupService groupApi; + @Autowired + private DictionaryDataService dictionaryDataApi; + + + private String tenantId = ""; + private static long DEFAULT_CACHE_TIME = 60 * 5; + + + /** + * 添加多线程 + */ + public void executorRedis(Map localCache, String printId, List swapList, Map map) { + tenantId = Optional.ofNullable(DataSourceContextHolder.getDatasourceId()).orElse(""); + Map listExecutor = new HashMap<>(); + if (MapUtils.isNotEmpty(map)) { + for (String key : map.keySet()) { + if (Objects.isNull(map.get(key))) continue; + List> list = (List>) map.get(key); + boolean needOrg = false, needDep = false, needPos = false, needUser = false, needRole = false, needGroup = false; + for (Map item : list) { + for (DataSetSwapModel model : swapList) { + String field = model.getField(); + String type = model.getType(); + if(StringUtil.isEmpty(field) || StringUtil.isEmpty(type)) continue; + String[] fields = field.split("\\."); + + DataSetConfig config = model.getConfig(); + if (!key.equals(fields[0]) || item.get(fields[1]) == null || "".equals(item.get(fields[1]))) { + continue; + } + String redisKey; + switch (type) { + case DataSetConstant.KEY_ORG: + needOrg = true; + break; + case DataSetConstant.KEY_DEP: + needDep = true; + break; + case DataSetConstant.KEY_POS: + needPos = true; + break; + case DataSetConstant.KEY_USER: + needUser = true; + break; + case DataSetConstant.KEY_ROLE: + needRole = true; + break; + case DataSetConstant.KEY_GROUP: + needGroup = true; + break; + case DataSetConstant.KEY_USERS: + needOrg = true; + needDep = true; + needPos = true; + needUser = true; + needRole = true; + needGroup = true; + break; + case DataSetConstant.KEY_SELECT: + if (DataTypeConst.STATIC.equals(config.getDataType())) { + redisKey = String.format("%s-%s-%s", printId, field, DataTypeConst.STATIC); + if (!localCache.containsKey(redisKey)) { + listExecutor.putIfAbsent(redisKey, new OateSetExParam(redisKey, DataSetConstant.KEY_SELECT, null, config)); + } + } + if (DataTypeConst.DICTIONARY.equals(config.getDataType())) { + redisKey = String.format("%s-%s-%s", tenantId, DataTypeConst.DICTIONARY, model.getConfig().getDictionaryType()); + if (!localCache.containsKey(redisKey)) { + listExecutor.putIfAbsent(redisKey, new OateSetExParam(redisKey, DataSetConstant.KEY_SELECT, null, config)); + } + } + needGroup = true; + break; + default: + break; + } + } + } + //添加系统缓存 + Map reidsKeyMap = new LinkedHashMap<>(); + if (needOrg) reidsKeyMap.put(tenantId + CacheKeyUtil.SYS_ORG_Tree, DataSetConstant.KEY_ORG); + if (needDep) reidsKeyMap.put(tenantId + CacheKeyUtil.SYS_DEP, DataSetConstant.KEY_DEP); + if (needPos) reidsKeyMap.put(tenantId + CacheKeyUtil.SYS_POS, DataSetConstant.KEY_POS); + if (needUser) reidsKeyMap.put(tenantId + CacheKeyUtil.SYS_USER, DataSetConstant.KEY_USER); + if (needRole) reidsKeyMap.put(tenantId + CacheKeyUtil.SYS_ROLE, DataSetConstant.KEY_ROLE); + if (needGroup) reidsKeyMap.put(tenantId + CacheKeyUtil.SYS_GROUP, DataSetConstant.KEY_GROUP); + for (String redisKey : reidsKeyMap.keySet()) { + if (!localCache.containsKey(redisKey)) { + listExecutor.putIfAbsent(redisKey, new OateSetExParam(redisKey, reidsKeyMap.get(redisKey), null, null)); + } + } + } + + //执行多线程方法 + if (!listExecutor.isEmpty()) { + this.execute(localCache, listExecutor); + } + } + } + + /** + * 执行多线程 + */ + private void execute(Map localCache, Map listExecutor) { + CountDownLatch countDownLatch = new CountDownLatch(listExecutor.size()); + for (String key : listExecutor.keySet()) { + OateSetExParam item = listExecutor.get(key); + String redisKey = item.getRedisKey(); + ThreadPoolExecutorUtil.getExecutor().execute(() -> { + try { + switch (item.getType()) { + case DataSetConstant.KEY_USER: + //人员 + Map userMap; + if (redisUtil.exists(redisKey)) { + userMap = redisUtil.getMap(redisKey); + userMap = Optional.ofNullable(userMap).orElse(new HashMap<>(20)); + } else { + userMap = userApi.getUserMap(); + if (DataSetSwapUtil.NEEDCACHE_SYS) { + redisUtil.insert(redisKey, userMap, DEFAULT_CACHE_TIME); + } + } + localCache.put(CacheKeyUtil.SYS_USER, userMap); + break; + case DataSetConstant.KEY_ORG: + Map orgMap; + if (redisUtil.exists(redisKey)) { + orgMap = redisUtil.getMap(redisKey); + orgMap = Optional.ofNullable(orgMap).orElse(new HashMap<>(20)); + } else { + orgMap = organizeApi.getAllOrgsTreeName(); + if (DataSetSwapUtil.NEEDCACHE_SYS) { + redisUtil.insert(redisKey, orgMap, DEFAULT_CACHE_TIME); + } + } + localCache.put(CacheKeyUtil.SYS_ORG_Tree, orgMap); + break; + case DataSetConstant.KEY_DEP: + Map depMap; + if (redisUtil.exists(redisKey)) { + depMap = redisUtil.getMap(redisKey); + depMap = Optional.ofNullable(depMap).orElse(new HashMap<>(20)); + } else { + depMap = organizeApi.getOrgMap(); + if (DataSetSwapUtil.NEEDCACHE_SYS) { + redisUtil.insert(redisKey, depMap, DEFAULT_CACHE_TIME); + } + } + localCache.put(CacheKeyUtil.SYS_DEP, depMap); + break; + case DataSetConstant.KEY_POS: + Map posMap; + if (redisUtil.exists(redisKey)) { + posMap = redisUtil.getMap(redisKey); + posMap = Optional.ofNullable(posMap).orElse(new HashMap<>(20)); + } else { + posMap = positionApi.getPosMap(); + if (DataSetSwapUtil.NEEDCACHE_SYS) { + redisUtil.insert(redisKey, posMap, DEFAULT_CACHE_TIME); + } + } + localCache.put(CacheKeyUtil.SYS_POS, posMap); + break; + case DataSetConstant.KEY_ROLE: + Map roleMap; + if (redisUtil.exists(redisKey)) { + roleMap = redisUtil.getMap(redisKey); + roleMap = Optional.ofNullable(roleMap).orElse(new HashMap<>(20)); + } else { + roleMap = roleApi.getRoleMap(); + if (DataSetSwapUtil.NEEDCACHE_SYS) { + redisUtil.insert(redisKey, roleMap, DEFAULT_CACHE_TIME); + } + } + localCache.put(CacheKeyUtil.SYS_ROLE, roleMap); + break; + case DataSetConstant.KEY_GROUP: + Map groupMap; + if (redisUtil.exists(redisKey)) { + groupMap = redisUtil.getMap(redisKey); + groupMap = Optional.ofNullable(groupMap).orElse(new HashMap<>(20)); + } else { + groupMap = groupApi.getGroupMap(); + if (DataSetSwapUtil.NEEDCACHE_SYS) { + redisUtil.insert(redisKey, groupMap, DEFAULT_CACHE_TIME); + } + } + localCache.put(CacheKeyUtil.SYS_GROUP, groupMap); + break; + + case DataSetConstant.KEY_SELECT: + DataSetConfig config = (DataSetConfig) item.getParam(); + Map selectMap = new HashMap<>(16); + List> options = new ArrayList<>(); + //静态数据 + if (DataTypeConst.STATIC.equals(config.getDataType())) { + if (!localCache.containsKey(redisKey)) { + if (!redisUtil.exists(redisKey)) { + if (config.getOptions() != null) { + List configOptions = config.getOptions(); + for (DataSetOptions dso : configOptions) { + selectMap.put(dso.getId(), dso.getFullName()); + } + } + redisUtil.insert(redisKey, selectMap, DEFAULT_CACHE_TIME); + localCache.put(redisKey, selectMap); + } else { + localCache.put(redisKey, redisUtil.getMap(redisKey)); + } + } + } + + //数据字典 + if (DataTypeConst.DICTIONARY.equals(config.getDataType())) { + if (!localCache.containsKey(redisKey)) { + if (!redisUtil.exists(redisKey)) { + List list = dictionaryDataApi.getDicList(config.getDictionaryType()); + options = list.stream().map(dic -> { + Map dictionaryMap = new HashMap<>(16); + dictionaryMap.put("id", dic.getId()); + dictionaryMap.put("enCode", dic.getEnCode()); + dictionaryMap.put("fullName", dic.getFullName()); + return dictionaryMap; + }).collect(Collectors.toList()); + String dictionaryData = JsonUtil.getObjectToString(options); + redisUtil.insert(redisKey, dictionaryData, DEFAULT_CACHE_TIME); + localCache.put(redisKey, options); + } else { + String dictionaryStringData = redisUtil.getString(redisKey).toString(); + localCache.put(redisKey, JsonUtil.getJsonToListMap(dictionaryStringData)); + } + } + } + break; + default: + + break; + } + } catch (Exception e) { + log.error("线程执行错误:" + e.getMessage()); +// e.printStackTrace(); + } finally { + //每执行一次数值减少一 + countDownLatch.countDown(); + //也可以给await()设置超时时间,如果超过300s(也可以是时,分)则不再等待,直接执行下面代码。 + //countDownLatch.await(300,TimeUnit.SECONDS); + } + }); + } + + try { + //等待计数器归零 + countDownLatch.await(); + } catch (InterruptedException e) { + log.error("线程计数错误:" + e.getMessage()); +// e.printStackTrace(); + } + } +} + +@Data +class OateSetExParam { + private String redisKey; + private String type; + private String interfaceId; + private Object param; + + public OateSetExParam(String redisKey, String type, String interfaceId, Object param) { + this.redisKey = redisKey; + this.type = type; + this.interfaceId = interfaceId; + this.param = param; + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/dataSet/DataSetSwapUtil.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/dataSet/DataSetSwapUtil.java new file mode 100644 index 0000000..8fb741a --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/dataSet/DataSetSwapUtil.java @@ -0,0 +1,436 @@ +package com.yunzhupaas.base.util.dataSet; + +import cn.hutool.core.date.LocalDateTimeUtil; +import cn.hutool.core.util.ObjectUtil; +import com.yunzhupaas.base.entity.ProvinceEntity; +import com.yunzhupaas.base.model.dataset.DataSetConfig; +import com.yunzhupaas.base.model.dataset.DataSetSwapModel; +import com.yunzhupaas.base.service.ProvinceService; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.visiual.DataTypeConst; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.math.BigDecimal; +import java.sql.Timestamp; +import java.text.DecimalFormat; +import java.time.LocalDateTime; +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.stream.Collectors; + +/** + * 数据集转换工具 + * + * @author 云筑产品开发平台组 + * @version v5.0.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/7/15 11:08:03 + */ +@Component +public class DataSetSwapUtil { + @Autowired + private DataSetExecutor dataSetExecutor; + @Autowired + private ProvinceService provinceService; + + //缓存系统权限数据, 组织、部门、岗位、分组、角色、用户 + public final static boolean NEEDCACHE_SYS = true; + + /** + * 数据转换 + * + * @param printId + * @param convertConfig + * @param map + */ + public void swapData(String printId, String convertConfig, Map map) { + List modelList = JsonUtil.getJsonToList(convertConfig, DataSetSwapModel.class); + modelList = CollectionUtils.isEmpty(modelList) ? new ArrayList<>() : modelList; + Map localCache = new ConcurrentHashMap<>(); + //初始化缓存 + dataSetExecutor.executorRedis(localCache, printId, modelList, map); + swapData(localCache, printId, modelList, map); + } + + private void swapData(Map localCache, String printId, List swapList, Map map) { + + Map orgMap = (Map) localCache.get(CacheKeyUtil.SYS_ORG_Tree); + Map depMap = (Map) localCache.get(CacheKeyUtil.SYS_DEP); + Map posMap = (Map) localCache.get(CacheKeyUtil.SYS_POS); + Map userMap = (Map) localCache.get(CacheKeyUtil.SYS_USER); + Map roleMap = (Map) localCache.get(CacheKeyUtil.SYS_ROLE); + Map groupMap = (Map) localCache.get(CacheKeyUtil.SYS_GROUP); + String tenantId = Optional.ofNullable(TenantHolder.getDatasourceId()).orElse(""); + + if (MapUtils.isNotEmpty(map)) { + for (String key : map.keySet()) { + if (Objects.isNull(map.get(key))) continue; + List> list = (List>) map.get(key); + DataClob.swapClob(list); + for (Map item : list) { + for (DataSetSwapModel model : swapList) { + String field = model.getField(); + String type = model.getType(); + if(StringUtil.isEmpty(field) || StringUtil.isEmpty(type)) continue; + + DataSetConfig config = model.getConfig(); + + String[] fields = field.split("\\."); + if (fields.length != 2) continue; + String dataSetName = fields[0]; + String filedKey = fields[1]; + Object value = item.get(filedKey); + if (!key.equals(dataSetName) || value == null || "".equals(value.toString().trim())) continue; + + String resultStr = ""; + String redisKey; + switch (type) { + case DataSetConstant.KEY_ORG: + item.put(filedKey, getListDataSwap(orgMap, value, true)); + break; + case DataSetConstant.KEY_DEP: + item.put(filedKey, getListDataSwap(depMap, value, false)); + break; + case DataSetConstant.KEY_POS: + item.put(filedKey, getListDataSwap(posMap, value, false)); + break; + case DataSetConstant.KEY_USER: + item.put(filedKey, getListDataSwap(userMap, value, false)); + break; + case DataSetConstant.KEY_ROLE: + item.put(filedKey, getListDataSwap(roleMap, value, false)); + break; + case DataSetConstant.KEY_GROUP: + item.put(filedKey, getListDataSwap(groupMap, value, false)); + break; + case DataSetConstant.KEY_DATE: + item.put(filedKey, getDateOrTime(value,config,false)); + break; + case DataSetConstant.KEY_TIME: + item.put(filedKey, getDateOrTime(value,config,true)); + break; + case DataSetConstant.KEY_SELECT: + if (DataTypeConst.STATIC.equals(config.getDataType())) { + redisKey = String.format("%s-%s-%s", printId, field, DataTypeConst.STATIC); + if (localCache.containsKey(redisKey)) { + Map selectMap = (Map) localCache.get(redisKey); + resultStr = getListDataSwap(selectMap, value, false); + item.put(filedKey, resultStr); + } + } + if (DataTypeConst.DICTIONARY.equals(config.getDataType())) { + redisKey = String.format("%s-%s-%s", tenantId, DataTypeConst.DICTIONARY, model.getConfig().getDictionaryType()); + if (localCache.containsKey(redisKey)) { + List> options = (List>) localCache.get(redisKey); + String propsValue = config.getPropsValue(); + Map selectMap = new HashMap<>(); + options.stream().forEach(o -> selectMap.put(String.valueOf(o.get(propsValue)), o.get("fullName"))); + resultStr = getListDataSwap(selectMap, value, false); + item.put(filedKey, resultStr); + } + } + break; + case DataSetConstant.KEY_NUMBER: + item.put(filedKey,getNumber(value,config)); + break; + case DataSetConstant.KEY_ADDRESS: + item.put(filedKey, getAddressStr(value)); + break; + case DataSetConstant.KEY_USERS: + try { + List dataNoSwapInMethod = getDataNoSwapInMethod(value); + StringJoiner valueJoin = new StringJoiner(","); + for (String data : dataNoSwapInMethod) { + String id = data.contains("--") ? data.substring(0, data.lastIndexOf("--")) : data; + String selecttype = data.contains("--") ? data.substring(data.lastIndexOf("--") + 2) : ""; + Map cacheMap; + switch (selecttype) { + case "role": + cacheMap = roleMap; + break; + case "position": + cacheMap = posMap; + break; + case "company": + case "department": + cacheMap = depMap; + break; + case "group": + cacheMap = groupMap; + break; + case "user": + default: + cacheMap = userMap; + break; + } + valueJoin.add(Optional.ofNullable(cacheMap.get(id)).orElse("").toString()); + } + item.put(filedKey, valueJoin.toString()); + } catch (Exception e) { + } + break; + case DataSetConstant.KEY_LOCATION: + try { + Map omap = JsonUtil.stringToMap(String.valueOf(value)); + resultStr = omap.get("fullAddress") != null ? omap.get("fullAddress").toString() : ""; + item.put(filedKey, resultStr); + } catch (Exception e) { + } + break; + default: + break; + } + } + } + + } + } + + } + + /** + * 多级控件转换 + * + * @param redis + * @param value + * @param isOrg 是否组织 + * @return + */ + public static String getListDataSwap(Map redis, Object value, Boolean isOrg) { + if (MapUtils.isEmpty(redis)) { + return String.valueOf(value); + } + Object dataValue; + try { + List list = JsonUtil.getJsonToList(String.valueOf(value), List.class); + StringJoiner joiner = new StringJoiner(","); + for (List listChild : list) { + if (isOrg) { + String join = StringUtil.join(listChild, ","); + String value1 = redis.get(String.valueOf(join)) != null ? String.valueOf(redis.get(String.valueOf(join))) : ""; + joiner.add(value1); + } else { + StringJoiner aa = new StringJoiner("/"); + for (Object object : listChild) { + String value1 = redis.get(String.valueOf(object)) != null ? String.valueOf(redis.get(String.valueOf(object))) : ""; + if (StringUtil.isNotEmpty(value1)) { + aa.add(value1); + } + } + joiner.add(aa.toString()); + } + } + dataValue = joiner.toString(); + } catch (Exception e) { + try { + List list = JsonUtil.getJsonToList(String.valueOf(value), String.class); + String separator = ","; + StringJoiner joiner = new StringJoiner(separator); + if (isOrg) { + String join = StringUtil.join(list, ","); + String value1 = redis.get(String.valueOf(join)) != null ? String.valueOf(redis.get(String.valueOf(join))) : ""; + joiner.add(value1); + } else { + for (Object listChild : list) { + String value1 = redis.get(String.valueOf(listChild)) != null ? String.valueOf(redis.get(String.valueOf(listChild))) : ""; + if (StringUtil.isNotEmpty(value1)) { + joiner.add(value1); + } + } + } + dataValue = joiner.toString(); + } catch (Exception e1) { + dataValue = redis.get(String.valueOf(value)) != null ? String.valueOf(redis.get(String.valueOf(value))) : ""; + if (isOrg && StringUtil.isEmpty(dataValue.toString())) { + for (String k : redis.keySet()) { + if (k.endsWith(String.valueOf(value))) { + dataValue = String.valueOf(redis.get(k)); + } + } + } + } + } + return StringUtil.isNotEmpty(dataValue.toString()) ? dataValue.toString() : value.toString(); + } + + /** + * 日期和时间控件转换 + * + * @param value + * @return + */ + public static String getDateOrTime(Object value, DataSetConfig config, Boolean isTime) { + List list = new ArrayList<>(); + if (value instanceof List) { + list.addAll((List) value); + } else { + list.add(value); + } + StringJoiner joiner = new StringJoiner("~"); + for (Object object : list) { + if (isTime) { + joiner.add(object + ""); + } else { + Long time = getDateObjToLong(object); + joiner.add(DateUtil.dateToString(new Date(time), config.getFormat())); + } + } + return joiner.toString(); + } + + /** + * 日期和时间控件转换 + * + * @param value + * @return + */ + public static String getNumber(Object value, DataSetConfig config) { + List list = new ArrayList<>(); + if (value instanceof List) { + list.addAll((List) value); + } else { + list.add(value); + } + StringJoiner joiner = new StringJoiner("~"); + for (Object object : list) { + String resultStr = ""; + try { + BigDecimal bd = new BigDecimal(String.valueOf(object)); + resultStr = bd.toPlainString(); + Integer precision = config.getPrecision(); + if (precision == 0 && resultStr.contains(".")) { + resultStr = resultStr.split("\\.")[0]; + } else if (precision > 0) { + String formatZ = "000000000000000"; + String format = formatZ.substring(0, precision); + DecimalFormat decimalFormat = new DecimalFormat("0." + format); + resultStr = decimalFormat.format(bd); + } + + if (config.isThousands()) { + resultStr = thousandsFormat(resultStr); + } + joiner.add(resultStr); + } catch (Exception e) { + } + } + return joiner.toString(); + } + + /** + * 时间转换兼容 + * + * @param dateObj + * @return + */ + public static Long getDateObjToLong(Object dateObj) { + LocalDateTime dateTime = null; + if (ObjectUtil.isNotEmpty(dateObj)) { + if (dateObj instanceof LocalDateTime) { + dateTime = (LocalDateTime) dateObj; + } else if (dateObj instanceof Timestamp) { + dateTime = ((Timestamp) dateObj).toLocalDateTime(); + } else if (dateObj instanceof Long) { + dateTime = LocalDateTimeUtil.of(new Date(Long.parseLong(dateObj.toString()))); + } else { + dateTime = LocalDateTimeUtil.of(cn.hutool.core.date.DateUtil.parse(dateObj.toString())); + } + } + return dateTime != null ? DateUtil.localDateTime2Millis(dateTime) : null; + } + + /** + * 获取地址名称 + * + * @param value + * @return + */ + private String getAddressStr(Object value) { + String addressStr = String.valueOf(value); + try { + List list = JsonUtil.getJsonToList(String.valueOf(value), List.class); + StringJoiner joiner1 = new StringJoiner(","); + List proDataS = new ArrayList<>(); + list.stream().forEach(t -> proDataS.addAll(t)); + Map provinceNames = provinceService.getProList(proDataS).stream().collect(Collectors.toMap(ProvinceEntity::getId, ProvinceEntity::getFullName + , (k1, k2) -> k2 + , () -> new LinkedHashMap<>(proDataS.size(), 1.0F))); + + for (List addressList : list) { + StringJoiner joiner2 = new StringJoiner("/"); + for (String addressId : addressList) { + String name = provinceNames.getOrDefault(addressId, ""); + joiner2.add(name); + } + joiner1.add(joiner2.toString()); + } + addressStr = joiner1.toString(); + } catch (Exception e) { + try { + List addressList = JsonUtil.getJsonToList(String.valueOf(value), String.class); + Map provinceNames = provinceService.getProList(addressList).stream().collect(Collectors.toMap(ProvinceEntity::getId, ProvinceEntity::getFullName + , (k1, k2) -> k2 + , () -> new LinkedHashMap<>(addressList.size(), 1.0F))); + StringJoiner joiner2 = new StringJoiner("/"); + for (String addressId : addressList) { + String name = provinceNames.getOrDefault(addressId, ""); + joiner2.add(name); + } + addressStr = joiner2.toString(); + } catch (Exception e1) { + List addressList = new ArrayList<>(); + addressList.add(String.valueOf(value)); + Map provinceNames = provinceService.getProList(addressList).stream().collect(Collectors.toMap(ProvinceEntity::getId, ProvinceEntity::getFullName + , (k1, k2) -> k2 + , () -> new LinkedHashMap<>(addressList.size(), 1.0F))); + if (MapUtils.isNotEmpty(provinceNames)) { + addressStr = provinceNames.get(String.valueOf(value)); + } + } + } + return addressStr; + } + + /** + * 千位符展示 + * + * @param str + * @return + */ + public static String thousandsFormat(String str) { + String regex = "(\\d)(?=(\\d{3})+$)"; + String replacement = "$1,"; + if (str.contains(".")) { + String[] arr = str.split("\\."); + arr[0] = arr[0].replaceAll(regex, replacement); + return String.join(".", arr); + } + return str.replaceAll(regex, replacement); + } + + /** + * 用户组件-获取数据 + * + * @param modelData + * @return + */ + public static List getDataNoSwapInMethod(Object modelData) { + List dataValueList = new ArrayList<>(); + if (String.valueOf(modelData).startsWith("[")) { + List modelDataList = JsonUtil.getJsonToList(String.valueOf(modelData), String.class); + dataValueList = modelDataList; + } else { + String[] modelDatas = String.valueOf(modelData).split(","); + for (int i = 0; i < modelDatas.length; i++) { + dataValueList.add(modelDatas[i]); + } + } + return dataValueList; + } + + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/dbutil/TableUtil.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/dbutil/TableUtil.java new file mode 100644 index 0000000..7ad43e5 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/dbutil/TableUtil.java @@ -0,0 +1,61 @@ +package com.yunzhupaas.base.util.dbutil; + +import com.yunzhupaas.database.constant.DbConst; + +import java.util.Random; + +/** + * 表字段相关工具类 + * + * @author 云筑产品开发平台组 + * @version V3.3 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-06-08 + */ +public class TableUtil { + + + /** + * 随机生成包含大小写字母及数字的字符串 + * + * @param length + * @return + */ + public static String getStringRandom(int length) { + String val = ""; + Random random = new Random(); + //参数length,表示生成几位随机数 + for (int i = 0; i < length; i++) { + String charOrNum = random.nextInt(2) % 2 == 0 ? "char" : "num"; + //输出字母还是数字 + if ("char".equalsIgnoreCase(charOrNum)) { + //输出是大写字母还是小写字母 + int temp = random.nextInt(2) % 2 == 0 ? 65 : 97; + val += (char) (random.nextInt(26) + temp); + } else if ("num".equalsIgnoreCase(charOrNum)) { + val += String.valueOf(random.nextInt(10)); + } + } + return val; + } + + /** + * 检测自带表 + * + * @param tableName 表明 + * @return ignore + */ + public static Boolean checkByoTable(String tableName) { + String[] tables = DbConst.BYO_TABLE.split(","); + boolean exists; + for (String table : tables) { + exists = tableName.toLowerCase().equals(table); + if (exists) { + return true; + } + } + return false; + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/interfaceUtil/InterfaceUtil.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/interfaceUtil/InterfaceUtil.java new file mode 100644 index 0000000..139c331 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/interfaceUtil/InterfaceUtil.java @@ -0,0 +1,133 @@ +package com.yunzhupaas.base.util.interfaceUtil; + +import cn.hutool.core.collection.CollectionUtil; +import com.yunzhupaas.util.DateUtil; +import com.yunzhupaas.util.ServletUtil; +import com.yunzhupaas.util.StringUtil; +import org.apache.commons.codec.binary.Base64; +import org.apache.commons.codec.binary.Hex; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.util.*; + +/** + * 接口工具类 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/13 10:38 + */ +public class InterfaceUtil { + public static final String ALGORITH_FORMAC = "HmacSHA256"; + public static final String HOST = "Host"; + public static final String YMDATE = "YmDate"; + public static final String CONTENT_TYPE = " Content-Type"; + public static final String CHARSET_NAME = "utf-8"; + public static final String USERKEY = "UserKey"; + + /** + * 验证签名 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/14 + */ + public static boolean verifySignature(String secret, String author) throws NoSuchAlgorithmException, InvalidKeyException, UnsupportedEncodingException { + String method = ServletUtil.getRequest().getMethod(); + String url = ServletUtil.getRequest().getRequestURI(); + String ymdate = ServletUtil.getRequest().getHeader(YMDATE); + String host = ServletUtil.getRequest().getHeader(HOST); + String source = new StringBuilder() + .append(method).append('\n') + .append(url).append('\n') + .append(ymdate).append('\n') + .append(host).append('\n').toString(); + Mac mac = Mac.getInstance(ALGORITH_FORMAC); + SecretKeySpec secretKeySpec = new SecretKeySpec(Base64.decodeBase64(secret), ALGORITH_FORMAC); + mac.init(secretKeySpec); + String signature = Hex.encodeHexString(mac.doFinal(source.getBytes(CHARSET_NAME))); + if (author.equals(signature)) { + return true; + } + return false; + } + + /** + * map转 name=value&name=value格式 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/14 + */ + public static String createLinkStringByGet(Map params) throws UnsupportedEncodingException { + List keys = new ArrayList(params.keySet()); + Collections.sort(keys); + String prestr = ""; + for (int i = 0; i < keys.size(); i++) { + String key = keys.get(i); + String value = params.get(key); + value = URLEncoder.encode(value, "UTF-8"); + if (i == keys.size() - 1) {//拼接时,不包括最后一个&字符 + prestr = prestr + key + "=" + value; + } else { + prestr = prestr + key + "=" + value + "&"; + } + } + return prestr; + } + + /** + * 判断map内有没有指定key的值 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/14 + */ + public static boolean checkParam(Map map, String str) { + if (CollectionUtil.isEmpty(map)) { + return false; + } + if (StringUtil.isEmpty(str)) { + return false; + } + if (map.get(str) != null && StringUtil.isNotEmpty(map.get(str))) { + return true; + } + return false; + } + + // + public static Map getAuthorization(String intefaceId, String appId, String appSecret, Map map) { + Map resultMap = new HashMap<>(); + try { + String method = ServletUtil.getRequest().getMethod(); + String url = "/api/system/DataInterface/" + intefaceId + "/Actions/Response"; + String ymdate = "" + DateUtil.getNowDate().getTime(); + String host = ServletUtil.getRequest().getHeader(HOST); + String source = new StringBuilder() + .append(method).append('\n') + .append(url).append('\n') + .append(ymdate).append('\n') + .append(host).append('\n').toString(); + Mac mac = Mac.getInstance(ALGORITH_FORMAC); + SecretKeySpec secretKeySpec = new SecretKeySpec(Base64.decodeBase64(appSecret), ALGORITH_FORMAC); + mac.init(secretKeySpec); + String signature = Hex.encodeHexString(mac.doFinal(source.getBytes(CHARSET_NAME))); + resultMap.put("YmDate", ymdate); + resultMap.put("Authorization", appId + "::" + signature); + return resultMap; + } catch (Exception e) { + } + return resultMap; + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/job/Schedule.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/job/Schedule.java new file mode 100644 index 0000000..6d337df --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/job/Schedule.java @@ -0,0 +1,68 @@ +package com.yunzhupaas.base.util.job; + +import cn.hutool.core.util.ObjectUtil; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.ScheduleNewEntity; +import com.yunzhupaas.base.model.schedule.ScheduleJobModel; +import com.yunzhupaas.base.service.ScheduleNewService; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.exception.TenantInvalidException; +import com.yunzhupaas.util.RedisUtil; +import com.yunzhupaas.util.StringUtil; +import lombok.extern.slf4j.Slf4j; +import org.quartz.DisallowConcurrentExecution; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.scheduling.quartz.QuartzJobBean; + +import java.util.List; +import java.util.concurrent.TimeUnit; + +@Slf4j +@DisallowConcurrentExecution +public class Schedule extends QuartzJobBean { + + @Autowired + private RedisUtil redisUtil; + @Autowired + private ScheduleNewService scheduleNewService; + @Autowired + private RedisTemplate redisTemplate; + @Autowired + private ScheduleJobUtil scheduleJobUtil; + @Autowired + private ConfigValueUtil configValueUtil; + + @Override + protected void executeInternal(JobExecutionContext context) throws JobExecutionException { + List listRedis = scheduleJobUtil.getListRedis(redisUtil); + for (ScheduleJobModel jobModel : listRedis) { + String id = jobModel.getId(); + boolean useSuccess = redisTemplate.opsForValue().setIfAbsent(ScheduleJobUtil.WORKTIMEOUT_REDIS_KEY + "_key:" + id, System.currentTimeMillis(), 100, TimeUnit.SECONDS); + if (!useSuccess) continue; + UserInfo userInfo = jobModel.getUserInfo(); + if (configValueUtil.isMultiTenancy()) { + try { + TenantDataSourceUtil.switchTenant(userInfo.getTenantId()); + }catch (TenantInvalidException e){ + // 租户无效 删除任务 + log.error("Schedule, 租户无效, 删除任务:{}", userInfo.getTenantId()); + redisUtil.removeHash(ScheduleJobUtil.WORKTIMEOUT_REDIS_KEY, id); + } + } + ScheduleNewEntity info = scheduleNewService.getInfo(id); + boolean msg = info != null && System.currentTimeMillis() >= jobModel.getScheduleTime().getTime(); + if (msg) { + scheduleNewService.scheduleMessage(jobModel); + } + boolean delete = (ObjectUtil.isNull(info) || msg); + if (delete) { + redisUtil.removeHash(ScheduleJobUtil.WORKTIMEOUT_REDIS_KEY, id); + } + } + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/job/ScheduleConfig.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/job/ScheduleConfig.java new file mode 100644 index 0000000..2e5149a --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/job/ScheduleConfig.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.base.util.job; + +import org.quartz.*; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class ScheduleConfig { + + @Bean + public JobDetail scheduleJobDetail() { + JobDetail JobDetail = JobBuilder.newJob(Schedule.class) + .storeDurably() //必须调用该方法,添加任务 + .build(); + return JobDetail; + } + + @Bean + public Trigger scheduleTrigger() { + CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule("0 0/5 * * * ?"); + Trigger trigger = TriggerBuilder.newTrigger() + .forJob(scheduleJobDetail()) + .withSchedule(cronScheduleBuilder) //对触发器配置任务 + .build(); + return trigger; + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/job/ScheduleJobUtil.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/job/ScheduleJobUtil.java new file mode 100644 index 0000000..f6f2d56 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/job/ScheduleJobUtil.java @@ -0,0 +1,86 @@ +package com.yunzhupaas.base.util.job; + +import com.yunzhupaas.base.model.schedule.ScheduleJobModel; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RedisUtil; +import com.yunzhupaas.util.StringUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.DependsOn; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * 流程设计 + * + * @author 云筑产品开发平台组 + * @version V3.3.0 flowable + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/15 17:37 + */ +@Component +@Slf4j +@DependsOn("threadPoolTaskExecutor") +public class ScheduleJobUtil { + /** + * 缓存key + */ + public static final String WORKTIMEOUT_REDIS_KEY = "idgenerator_Schedule"; + + @Autowired + private RedisUtil redisUtil; + @Autowired + private ConfigValueUtil configValueUtil; + + + /** + * 将数据放入缓存 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/2 + */ + public void insertRedis(List scheduleJobList, RedisUtil redisUtil) { + for (ScheduleJobModel jobModel : scheduleJobList) { + String id = jobModel.getId(); + String objectToString = JsonUtil.getObjectToString(jobModel); + redisUtil.insertHash(WORKTIMEOUT_REDIS_KEY, id, objectToString); + } + } + + /** + * 定时器取用数据调用创建方法 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/2 + */ + public List getListRedis(RedisUtil redisUtil) { + List scheduleJobList = new ArrayList<>(); + if (redisUtil.exists(WORKTIMEOUT_REDIS_KEY)) { + Map map = redisUtil.getMap(WORKTIMEOUT_REDIS_KEY); + for (String object : map.keySet()) { + if (map.get(object) instanceof String) { + ScheduleJobModel scheduleJobModel = JsonUtil.getJsonToBean(String.valueOf(map.get(object)), ScheduleJobModel.class); + if(StringUtil.isNotEmpty(scheduleJobModel.getId())) { + scheduleJobList.add(scheduleJobModel); + }else { + redisUtil.removeHash(WORKTIMEOUT_REDIS_KEY,object); + } + }else { + redisUtil.removeHash(WORKTIMEOUT_REDIS_KEY,object); + } + } + } + return scheduleJobList; + } + + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/visualUtil/PubulishUtil.java b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/visualUtil/PubulishUtil.java new file mode 100644 index 0000000..d9a16e5 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-biz/src/main/java/com/yunzhupaas/base/util/visualUtil/PubulishUtil.java @@ -0,0 +1,591 @@ +package com.yunzhupaas.base.util.visualUtil; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollectionUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.google.common.collect.ImmutableMap; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.*; +import com.yunzhupaas.base.model.module.PropertyJsonModel; +import com.yunzhupaas.base.model.online.AuthFlieds; +import com.yunzhupaas.base.model.online.PerColModels; +import com.yunzhupaas.base.model.online.VisualMenuModel; +import com.yunzhupaas.base.service.*; +import com.yunzhupaas.emnus.SearchMethodEnum; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.permission.model.authorize.AuthorizeConditionEnum; +import com.yunzhupaas.permission.model.authorize.ConditionModel; +import com.yunzhupaas.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 功能发布 + * + * @author 云筑产品开发平台组 + * @version V3.4 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/4/7 + */ +@Component +public class PubulishUtil { + + @Autowired + private ModuleService moduleService; + @Autowired + private ModuleButtonService moduleButtonService; + @Autowired + private ModuleColumnService moduleColumnService; + @Autowired + private ModuleFormService moduleFormService; + @Autowired + private ModuleDataAuthorizeService moduleDataAuthorizeService; + @Autowired + private ModuleDataAuthorizeSchemeService moduleDataAuthorizeSchemeService; + @Autowired + private SystemService systemService; + + /** + * 功能类型 + */ + private final static Integer Type = 3; + + /** + * pc父级菜单 默认 + */ + private static final String pcCate = "功能示例"; + + + /** + * app父级菜单 默认 + */ + private static final String appCate = "移动应用"; + + /** + * pc端分类 + */ + private static final String pcCategory = "Web"; + + /** + * app端分类 + */ + private static final String appCategory = "App"; + + /** + * pc父级菜单id 默认 + */ + private String parentId; + + /** + * app父级菜单id + */ + private String appParentId; + + /** + * 图标 + */ + private final static String icon = "icon-ym icon-ym-webForm"; + + private final static List symbol = new ArrayList() {{ + add("@userId"); + add("@organizeId"); + }}; + + private final static Map pcAddress = ImmutableMap.of(3, "model", 8, "portal", 10, "report"); + + public void publishMenu(VisualMenuModel visualMenuModel) throws WorkFlowException { + UserInfo userInfo = UserProvider.getUser(); + + List moduleList = moduleService.getModuleList(visualMenuModel.getId()); + + ModuleEntity moduleEntity = new ModuleEntity(); + PerColModels pcPerCols = visualMenuModel.getPcPerCols() != null ? visualMenuModel.getPcPerCols() : new PerColModels(); + PerColModels appPerCols = visualMenuModel.getAppPerCols() != null ? visualMenuModel.getAppPerCols() : new PerColModels(); + + moduleEntity.setCategory(pcCategory); + + moduleEntity.setFullName(visualMenuModel.getFullName()); + moduleEntity.setEnCode(visualMenuModel.getEncode()); + moduleEntity.setIcon(icon); + moduleEntity.setType(visualMenuModel.getType()); + moduleEntity.setModuleId(visualMenuModel.getId()); + PropertyJsonModel jsonModel = new PropertyJsonModel(); + jsonModel.setModuleId(visualMenuModel.getId()); + jsonModel.setIconBackgroundColor(""); + jsonModel.setIsTree(0); + jsonModel.setWebType(visualMenuModel.getWebType()); + moduleEntity.setPropertyJson(JsonUtil.getObjectToString(jsonModel)); + moduleEntity.setSortCode((999L)); + moduleEntity.setEnabledMark(1); + moduleEntity.setIsButtonAuthorize(1); + moduleEntity.setIsColumnAuthorize(1); + moduleEntity.setIsDataAuthorize(1); + moduleEntity.setIsFormAuthorize(1); + moduleEntity.setCreatorTime(DateUtil.getNowDate()); + moduleEntity.setCreatorUserId(userInfo.getUserId()); + String address = pcAddress.get(visualMenuModel.getType()); + moduleEntity.setUrlAddress(address + "/" + visualMenuModel.getEncode()); + + if (1 == visualMenuModel.getPc()) { + List pcModuleList = moduleList.stream().filter(module -> pcCategory.equals(module.getCategory())).collect(Collectors.toList()); + //是否生成过菜单 + if (pcModuleList.size() > 0) { + for (ModuleEntity entity : pcModuleList) { + //变更权限 + if (pcPerCols != null) alterPer(entity, pcPerCols); + //更新菜单 + entity.setPropertyJson(JsonUtil.getObjectToString(jsonModel)); + moduleService.update(entity.getId(), entity); + } + } + + this.createMenu(moduleEntity, visualMenuModel, pcPerCols,true); + } + Map appAddress = ImmutableMap.of(3, "dynamicModel", 8, "visualPortal"); + moduleEntity.setCategory(appCategory); + String portalAddress = appAddress.get(visualMenuModel.getType()); + moduleEntity.setUrlAddress("/pages/apply/" + portalAddress + "/index?id=" + visualMenuModel.getId()); + if (1 == visualMenuModel.getApp()) { + List appModuleList = moduleList.stream().filter(module -> appCategory.equals(module.getCategory())).collect(Collectors.toList()); + if (appModuleList.size() > 0) { + for (ModuleEntity entity : appModuleList) { + //变更权限 + if (appPerCols != null) alterPer(entity, appPerCols); + //更新菜单 + entity.setPropertyJson(JsonUtil.getObjectToString(jsonModel)); + moduleService.update(entity.getId(), entity); + } + } + + this.createMenu(moduleEntity, visualMenuModel, appPerCols,false); + } + } + + /** + * 创建菜单验证 + * + * @param moduleEntity + * @return + */ + private void createMenu(ModuleEntity moduleEntity,VisualMenuModel visualMenuModel,PerColModels perCols,Boolean isPc) throws WorkFlowException { + List list=new ArrayList<>(); + List parentIds; + if(isPc){ + parentIds = visualMenuModel.getPcModuleParentId(); + }else{ + parentIds = visualMenuModel.getAppModuleParentId(); + } + //创建菜单 + String fullName = moduleEntity.getFullName(); + String enCode = moduleEntity.getEnCode(); + List moduleList = moduleService.getModuleList(visualMenuModel.getId()); + if(CollectionUtil.isEmpty(parentIds) && CollectionUtil.isEmpty(moduleList)){ + throw new WorkFlowException("上级不能为空"); + } + for(String pid:parentIds){ + ModuleEntity saveEnt = BeanUtil.copyProperties(moduleEntity, ModuleEntity.class); + saveEnt.setId(RandomUtil.uuId()); + String copyNum = UUID.randomUUID().toString().substring(0, 5); + ModuleEntity pInfo = moduleService.getInfo(pid); + //查询不到菜单说明上级是系统 + if(pInfo!=null){ + saveEnt.setParentId(pid); + saveEnt.setSystemId(pInfo.getSystemId()); + }else{ + SystemEntity info = systemService.getInfo(pid); + if(info == null){ + throw new WorkFlowException("找不到该上级"); + } + saveEnt.setParentId("-1"); + saveEnt.setSystemId(pid); + } + saveEnt.setFullName(fullName); + saveEnt.setEnCode(enCode + copyNum); + if(isPc){ + String address = pcAddress.get(visualMenuModel.getType()); + saveEnt.setUrlAddress(address + "/" + saveEnt.getEnCode()); + } + if (moduleService.isExistByFullName(saveEnt, saveEnt.getCategory(), saveEnt.getSystemId())) { + throw new WorkFlowException("名称重复"); + } + if (moduleService.isExistByEnCode(saveEnt, saveEnt.getCategory(), saveEnt.getSystemId())) { + throw new WorkFlowException("编码重复"); + } + if (perCols != null) batchCreatePermissions(perCols, saveEnt.getId()); + list.add(saveEnt); + } + moduleService.saveBatch(list); + } + + private void batchCreatePermissions(PerColModels perColModels, String moduleId) { + + List buttonPermission = Objects.nonNull(perColModels.getButtonPermission()) ? perColModels.getButtonPermission() : new ArrayList<>(); + List formPermission = Objects.nonNull(perColModels.getFormPermission()) ? perColModels.getFormPermission() : new ArrayList<>(); + List listPermission = Objects.nonNull(perColModels.getListPermission()) ? perColModels.getListPermission() : new ArrayList<>(); + List dataPermission = Objects.nonNull(perColModels.getDataPermission()) ? perColModels.getDataPermission() : new ArrayList<>(); + List dataPermissionScheme = Objects.nonNull(perColModels.getDataPermissionScheme()) ? perColModels.getDataPermissionScheme() : new ArrayList<>(); + + //按钮 + List buttonEntities = buttonPermission.stream().map(button -> { + ModuleButtonEntity buttonEntity = new ModuleButtonEntity(); + buttonEntity.setEnabledMark(button.getStatus() ? 1 : 0); + buttonEntity.setEnCode(button.getEncode()); + buttonEntity.setFullName(button.getFullName()); + buttonEntity.setParentId("-1"); + buttonEntity.setModuleId(moduleId); + buttonEntity.setSortCode(0L); + return buttonEntity; + }).collect(Collectors.toList()); + + //表单权限 + List moduleFormEntities = formPermission.stream().map(form -> { + ModuleFormEntity formEntity = new ModuleFormEntity(); + formEntity.setBindTable(form.getBindTableName()); + formEntity.setEnabledMark(form.getStatus() ? 1 : 0); + formEntity.setEnCode(form.getEncode()); + formEntity.setFullName(form.getFullName()); + formEntity.setParentId("-1"); + formEntity.setModuleId(moduleId); + formEntity.setFieldRule(form.getRule()); + formEntity.setChildTableKey(form.getChildTableKey()); + formEntity.setSortCode(0L); + return formEntity; + }).collect(Collectors.toList()); + + //列表 + List moduleColumnEntities = listPermission.stream().map(list -> { + ModuleColumnEntity moduleColumnEntity = new ModuleColumnEntity(); + moduleColumnEntity.setBindTable(list.getBindTableName()); + moduleColumnEntity.setEnabledMark(list.getStatus() ? 1 : 0); + moduleColumnEntity.setEnCode(list.getEncode()); + moduleColumnEntity.setFullName(list.getFullName()); + moduleColumnEntity.setParentId("-1"); + moduleColumnEntity.setModuleId(moduleId); + moduleColumnEntity.setSortCode(0L); + moduleColumnEntity.setChildTableKey(list.getChildTableKey()); + moduleColumnEntity.setFieldRule(list.getRule()); + return moduleColumnEntity; + }).collect(Collectors.toList()); + + List moduleDataEntities = new ArrayList<>(); + + + //数据权限 + for (AuthFlieds authFlieds : dataPermission) { + ModuleDataAuthorizeEntity authorizeEntity = new ModuleDataAuthorizeEntity(); + authorizeEntity.setBindTable(authFlieds.getBindTableName()); + authorizeEntity.setConditionSymbol(symbol.contains(authFlieds.getAuthCondition()) ? SearchMethodEnum.Equal.getSymbol() : SearchMethodEnum.Included.getSymbol()); + authorizeEntity.setId(RandomUtil.uuId()); + authorizeEntity.setDescription("同步菜单自动生成"); + authorizeEntity.setEnCode(authFlieds.getEncode()); + authorizeEntity.setFieldRule(authFlieds.getRule()); + authorizeEntity.setFullName(authFlieds.getFullName()); + authorizeEntity.setModuleId(moduleId); + authorizeEntity.setType("varchar"); + authorizeEntity.setConditionText(authFlieds.getAuthCondition()); + authorizeEntity.setEnabledMark(1); + authorizeEntity.setSortCode(-9527l); + moduleDataEntities.add(authorizeEntity); + } + + for (ModuleButtonEntity btn : buttonEntities) { + moduleButtonService.create(btn); + } + for (ModuleFormEntity formEntity : moduleFormEntities) { + moduleFormService.create(formEntity); + } + for (ModuleColumnEntity moduleColumnEntity : moduleColumnEntities) { + moduleColumnService.create(moduleColumnEntity); + } + for (ModuleDataAuthorizeEntity authorizeEntity : moduleDataEntities) { + moduleDataAuthorizeService.save(authorizeEntity); + } + + //方案 + for (ModuleDataAuthorizeSchemeEntity moduleDataAuthorizeEntity : dataPermissionScheme) { + moduleDataAuthorizeEntity.setId(RandomUtil.uuId()); + moduleDataAuthorizeEntity.setModuleId(moduleId); + //字段是数据库现有字段,那生成的方案里面的id必须是字段id + List dataAuthorizeEntityList = moduleDataAuthorizeService.getList(moduleId); + for (ModuleDataAuthorizeEntity auth : dataAuthorizeEntityList) { + if (moduleDataAuthorizeEntity.getDescription().equals(auth.getFieldRule() + "_" + auth.getEnCode() + "_" + auth.getConditionSymbol()) + && Objects.equals(-9527l, moduleDataAuthorizeEntity.getSortCode())) { + String conditionJson = moduleDataAuthorizeEntity.getConditionJson(); + List listc = JsonUtil.getJsonToList(conditionJson, ConditionModel.class); + ConditionModel.ConditionItemModel conditionItemModel = listc.get(0).getGroups().get(0); + conditionItemModel.setId(auth.getId()); + moduleDataAuthorizeEntity.setConditionJson(JsonUtil.getObjectToString(listc)); + } + } + moduleDataAuthorizeSchemeService.save(moduleDataAuthorizeEntity); + } + + //创建全部数据方案 + if (Objects.nonNull(perColModels.getDataPermission())) { + Boolean exist = moduleDataAuthorizeSchemeService.isExistAllData(moduleId); + if (!exist) { + ModuleDataAuthorizeSchemeEntity moduleDataAuthorizeSchemeEntity = new ModuleDataAuthorizeSchemeEntity(); + moduleDataAuthorizeSchemeEntity.setFullName("全部数据"); + moduleDataAuthorizeSchemeEntity.setEnCode("yunzhupaas_alldata"); + moduleDataAuthorizeSchemeEntity.setAllData(1); + moduleDataAuthorizeSchemeEntity.setModuleId(moduleId); + moduleDataAuthorizeSchemeService.create(moduleDataAuthorizeSchemeEntity); + } + } + } + + private void getModuleParentId() { + QueryWrapper moduleWrapper = new QueryWrapper<>(); + moduleWrapper.lambda().eq(ModuleEntity::getFullName, pcCate).eq(ModuleEntity::getCategory, pcCategory); + ModuleEntity pcModule = moduleService.getOne(moduleWrapper); + if (pcModule != null) { + this.setParentId(pcModule.getId()); + } + QueryWrapper appWrapper = new QueryWrapper<>(); + appWrapper.lambda().eq(ModuleEntity::getFullName, appCate).eq(ModuleEntity::getCategory, appCategory); + ModuleEntity appModule = moduleService.getOne(appWrapper); + if (appModule != null) { + this.setAppParentId(appModule.getId()); + } + } + + /** + * 自动变更权限 + * + * @param entity + * @param perColModelSour + * @return + */ + private void alterPer(ModuleEntity entity, PerColModels perColModelSour) { + String moduleMainId = entity.getId(); + PerColModels perColModel =BeanUtil.copyProperties(perColModelSour,PerColModels.class); + PerColModels perColModels = new PerColModels(); + //列表 + if (perColModel.getListPermission() != null) { + Map colMap = new HashMap<>(); + List columnEntities = moduleColumnService.getList(moduleMainId); + columnEntities.stream().forEach(col -> colMap.put(col.getEnCode(), col.getId())); + List listPermission = perColModel.getListPermission() != null ? perColModel.getListPermission() : new ArrayList<>(); + + //只变更状态 + List authColList = intersectList1(listPermission, colMap); + Map stateMap = new HashMap<>(); + authColList.stream().forEach(auth -> stateMap.put(auth.getEncode(), auth.getStatus())); + for (ModuleColumnEntity columnEntity : columnEntities) { + if (Objects.nonNull(stateMap.get(columnEntity.getEnCode()))) { + columnEntity.setEnabledMark(stateMap.get(columnEntity.getEnCode()) ? 1 : 0); + moduleColumnService.update(columnEntity.getId(), columnEntity); + } + } + //新增 + List authColCreList = intersectList2(listPermission, authColList); + perColModels.setListPermission(authColCreList); + //删除 +// Map colDataMap = intersectList3(colMap, authColList); +// List colEnties = columnEntities.stream().filter(col -> colDataMap.get(col.getEnCode()) != null).collect(Collectors.toList()); +// for (ModuleColumnEntity moduleColumnEntity : colEnties) { +// moduleColumnService.delete(moduleColumnEntity); +// } + } + + //表单 + if (perColModel.getFormPermission() != null) { + Map formMap = new HashMap<>(); + List formEntities = moduleFormService.getList(moduleMainId); + formEntities.stream().forEach(form -> formMap.put(form.getEnCode(), form.getId())); + List formPermission = perColModel.getFormPermission() != null ? perColModel.getFormPermission() : new ArrayList<>(); + List authFormList = intersectList1(formPermission, formMap); + + Map stateFMap = new HashMap<>(); + authFormList.stream().forEach(auth -> stateFMap.put(auth.getEncode(), auth.getStatus())); + for (ModuleFormEntity formEntity : formEntities) { + if (Objects.nonNull(stateFMap.get(formEntity.getEnCode()))) { + formEntity.setEnabledMark(stateFMap.get(formEntity.getEnCode()) ? 1 : 0); + moduleFormService.update(formEntity.getId(), formEntity); + } + } + + List authFormCreList = intersectList2(formPermission, authFormList); + perColModels.setFormPermission(authFormCreList); +// Map formDataMap = intersectList3(formMap, authFormList); +// List formEnties = formEntities.stream().filter(form -> formDataMap.get(form.getEnCode()) != null).collect(Collectors.toList()); +// for (ModuleFormEntity formEntity : formEnties) { +// moduleFormService.delete(formEntity); +// } + } + //按钮权限 + if (perColModel.getButtonPermission() != null) { + Map btnMap = new HashMap<>(); + List buttonEntities = moduleButtonService.getListByModuleIds(moduleMainId); + buttonEntities.stream().forEach(btn -> btnMap.put(btn.getEnCode(), btn.getId())); + List buttonPermission = perColModel.getButtonPermission() != null ? perColModel.getButtonPermission() : new ArrayList<>(); + List authBtnList = intersectList1(buttonPermission, btnMap); + Map stateBMap = new HashMap<>(); + + authBtnList.stream().forEach(auth -> stateBMap.put(auth.getEncode(), auth.getStatus())); + for (ModuleButtonEntity btnEntity : buttonEntities) { + if (Objects.nonNull(stateBMap.get(btnEntity.getEnCode()))) { + btnEntity.setEnabledMark(stateBMap.get(btnEntity.getEnCode()) ? 1 : 0); + moduleButtonService.update(btnEntity.getId(), btnEntity); + } + } + + List authBtnCreList = intersectList2(buttonPermission, authBtnList); +// Map btnDataMap = intersectList3(btnMap, authBtnList); +// List btnEnties = buttonEntities.stream().filter(btn -> btnDataMap.get(btn.getEnCode()) != null).collect(Collectors.toList()); +// for (ModuleButtonEntity buttonEntity : btnEnties) { +// moduleButtonService.delete(buttonEntity); +// } + + perColModels.setButtonPermission(authBtnCreList); + } + + //表单权限字段 + if (perColModel.getDataPermission() != null) { + List dataAuthorizeEntityList = moduleDataAuthorizeService.getList(moduleMainId); + List dataPermission = perColModel.getDataPermission() != null ? perColModel.getDataPermission() : new ArrayList<>(); + List dataPermissionList = new ArrayList<>(dataPermission); + //交集 + List authDataList = new ArrayList<>(); + for (AuthFlieds authFlieds : dataPermission) { + for (ModuleDataAuthorizeEntity authorizeEntity : dataAuthorizeEntityList) { + String conditions = symbol.contains(authFlieds.getAuthCondition()) ? SearchMethodEnum.Equal.getSymbol() : SearchMethodEnum.Included.getSymbol(); + if (authorizeEntity.getConditionText().equalsIgnoreCase(authFlieds.getAuthCondition()) + && authorizeEntity.getConditionSymbol().equalsIgnoreCase(conditions) + && authorizeEntity.getEnCode().equalsIgnoreCase(authFlieds.getEncode())) { + authDataList.add(authFlieds); + } + } + } + List authDataCreList = intersectList2(dataPermission, authDataList); + //需要删除 + List collect = dataPermissionList.stream().map(AuthFlieds::getEncode).collect(Collectors.toList()); + List dataEntities = new ArrayList<>(); + if (dataAuthorizeEntityList.size() > 0) { + for (ModuleDataAuthorizeEntity item : dataAuthorizeEntityList) { + if (!collect.contains(item.getEnCode()) && Objects.equals(-9527l, item.getSortCode())) { + if((symbol.contains(item.getConditionText()) && SearchMethodEnum.Equal.getSymbol().equals(item.getConditionSymbol())) + ||(!symbol.contains(item.getConditionText()) && SearchMethodEnum.Included.getSymbol().equals(item.getConditionSymbol()))){ + //需要移除的权限 + dataEntities.add(item); + } + } + } + } + for (ModuleDataAuthorizeEntity dataEntity : dataEntities) { + moduleDataAuthorizeService.delete(dataEntity); + } + perColModels.setDataPermission(authDataCreList); + } + //表单权限方案 + if (perColModel.getDataPermissionScheme() != null) { + //交集 + List togetherList = new ArrayList<>(); + List dataAuthorizeSchemeList = moduleDataAuthorizeSchemeService.getList(moduleMainId); + List dataPermissionScheme = perColModel.getDataPermissionScheme(); + List dataPermissionSchemeClone = new ArrayList<>(dataPermissionScheme); + + for (ModuleDataAuthorizeSchemeEntity authFlieds : dataPermissionScheme) { + for (ModuleDataAuthorizeSchemeEntity schemeEntity : dataAuthorizeSchemeList) { + if (schemeEntity.getConditionJson() == null) { + continue; + } + if (Objects.equals(-9527l, schemeEntity.getSortCode()) && schemeEntity.getConditionText().contains(authFlieds.getConditionText())) { + togetherList.add(authFlieds); + } + } + } + + //需要新增 dataPermissionScheme + dataPermissionScheme.removeAll(togetherList); + + //需要删除 + List collect = dataPermissionSchemeClone.stream().map(ModuleDataAuthorizeSchemeEntity::getDescription).collect(Collectors.toList()); + List deleteSchemeList = new ArrayList<>(); + if (dataAuthorizeSchemeList.size() > 0) { + for (ModuleDataAuthorizeSchemeEntity item : dataAuthorizeSchemeList) { + if (!collect.contains(item.getDescription()) && Objects.equals(-9527l, item.getSortCode())) { + //需要移除的权限方案 + deleteSchemeList.add(item); + } + } + } + + for (ModuleDataAuthorizeSchemeEntity scheme : deleteSchemeList) { + moduleDataAuthorizeSchemeService.delete(scheme); + } + ; + perColModels.setDataPermissionScheme(new ArrayList<>(dataPermissionScheme)); + } + + //新增的权限 + batchCreatePermissions(perColModels, moduleMainId); + + } + + + /** + * 取交集 (不需要变动的数据) + * + * @param authFlieds 新提交过来的 + * @param databaseMap 数据库存在数据 + * @return + */ + private List intersectList1(List authFlieds, Map databaseMap) { + List lastList = new LinkedList<>(); + for (AuthFlieds authFlied : authFlieds) { + if (databaseMap.containsKey(authFlied.getEncode())) { + lastList.add(authFlied); + } + } + return lastList; + } + + /** + * 求差集 (需要新增的数据) create + * + * @param auth1 新提交过来的 + * @param auth2 与数据库的交集 + * @return + */ + private List intersectList2(List auth1, List auth2) { + auth1.removeAll(auth2); + return auth1; + } + + /** + * 求差集 (需要变更的数据) delete + * + * @param databaseMap 数据库已存在的数据 + * @param auth2 与数据库的交集 + * @return + */ + private Map intersectList3(Map databaseMap, List auth2) { + Map changeMap = new HashMap<>(); + changeMap.putAll(databaseMap); + for (AuthFlieds authFlieds : auth2) { + if (databaseMap.get(authFlieds.getEncode()) != null) { + changeMap.remove(authFlieds.getEncode()); + } + } + return changeMap; + } + + public void setParentId(String parentId) { + this.parentId = parentId; + } + + public void setAppParentId(String appParentId) { + this.appParentId = appParentId; + } + + + public void publishPortalMenu(VisualMenuModel visualMenuModel) { + + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/pom.xml b/yunzhupaas-system/yunzhupaas-system-controller/pom.xml new file mode 100644 index 0000000..6b34171 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/pom.xml @@ -0,0 +1,27 @@ + + + + yunzhupaas-system + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-system-controller + + + + com.yunzhupaas + yunzhupaas-system-biz + ${project.version} + + + com.yunzhupaas + yunzhupaas-visualdev-base-entity + ${project.version} + + + + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/AdvancedQueryController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/AdvancedQueryController.java new file mode 100644 index 0000000..3a8d6f4 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/AdvancedQueryController.java @@ -0,0 +1,139 @@ +package com.yunzhupaas.base.controller; + +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import com.yunzhupaas.base.controller.SuperController; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.AdvancedQueryEntity; +import com.yunzhupaas.base.model.advancedquery.AdvancedQueryListVO; +import com.yunzhupaas.base.model.advancedquery.AdvancedQuerySchemeForm; +import com.yunzhupaas.base.service.AdvancedQueryService; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.JsonUtilEx; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; +import java.util.List; + +/** + * 高级查询方案管理 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2022/5/30 + */ +@Tag(name = "高级查询方案管理", description = "AdvancedQuery") +@RestController +@RequestMapping("/api/system/AdvancedQuery") +public class AdvancedQueryController extends SuperController { + + @Autowired + private AdvancedQueryService queryService; + + /** + * 新建 + * + * @param advancedQuerySchemeForm 实体对象 + * @return + */ + @Operation(summary = "新建方案") + @Parameters({ + @Parameter(name = "advancedQuerySchemeForm", description = "实体对象", required = true) + }) + @PostMapping + public ActionResult create(@RequestBody @Valid AdvancedQuerySchemeForm advancedQuerySchemeForm) { + AdvancedQueryEntity entity = JsonUtil.getJsonToBean(advancedQuerySchemeForm, AdvancedQueryEntity.class); + queryService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 修改方案 + * + * @param id 主键 + * @param advancedQuerySchemeForm 实体对象 + * @return + */ + @Operation(summary = "修改方案") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "advancedQuerySchemeForm", description = "实体对象", required = true) + }) + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid AdvancedQuerySchemeForm advancedQuerySchemeForm) { + AdvancedQueryEntity entity = JsonUtil.getJsonToBean(advancedQuerySchemeForm, AdvancedQueryEntity.class); + entity.setId(id); + queryService.updateById(entity); + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "删除方案") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + UserInfo userInfo = UserProvider.getUser(); + AdvancedQueryEntity entity = queryService.getInfo(id,userInfo.getUserId()); + if (entity != null) { + queryService.removeById(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + /** + * 列表 + * + * @param moduleId 功能主键 + * @return ignore + */ + @Operation(summary = "方案列表") + @Parameters({ + @Parameter(name = "moduleId", description = "功能主键", required = true) + }) + @GetMapping("/{moduleId}/List") + public ActionResult> list(@PathVariable("moduleId") String moduleId) { + UserInfo userInfo = UserProvider.getUser(); + List data = queryService.getList(moduleId,userInfo); + List list = JsonUtil.getJsonToList(data, AdvancedQueryListVO.class); + ListVO vo = new ListVO<>(); + vo.setList(list); + return ActionResult.success(vo); + } + /** + * 信息 + * + * @param id 主键值 + * @return ignore + * @throws DataException ignore + */ + @Operation(summary = "获取方案信息") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) throws DataException { + UserInfo userInfo = UserProvider.getUser(); + AdvancedQueryEntity entity = queryService.getInfo(id,userInfo.getUserId()); + AdvancedQuerySchemeForm vo = JsonUtilEx.getJsonToBeanEx(entity, AdvancedQuerySchemeForm.class); + return ActionResult.success(vo); + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/AiChatController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/AiChatController.java new file mode 100644 index 0000000..31c60d1 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/AiChatController.java @@ -0,0 +1,79 @@ +package com.yunzhupaas.base.controller; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.entity.AiChatEntity; +import com.yunzhupaas.base.model.ai.AiChatVo; +import com.yunzhupaas.base.model.ai.AiForm; +import com.yunzhupaas.base.model.ai.AiHisVo; +import com.yunzhupaas.base.model.ai.AiParam; +import com.yunzhupaas.base.service.AiChatService; +import com.yunzhupaas.constant.MsgCode; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@Tag(name = "AI助手", description = "Aichat") +@RestController +@RequestMapping("/api/system/Aichat") +public class AiChatController { + @Autowired + private AiChatService aiChatService; + + //ai助手接口 + @Operation(summary = "发送对话") + @Parameters({ + @Parameter(name = "param", description = "对话内容参数"), + }) + @PostMapping("/send") + public ActionResult send(@RequestBody AiParam param) { + String content = aiChatService.send(param.getKeyword()); + return ActionResult.success(MsgCode.SU000.get(), content); + } + + @Operation(summary = "ai会话列表") + @GetMapping("/history/list") + public ActionResult historyList() { + List listVo = aiChatService.historyList(); + return ActionResult.success(listVo); + } + + @Operation(summary = "ai会话记录") + @Parameters({ + @Parameter(name = "id", description = "会话id"), + }) + @GetMapping("/history/get/{id}") + public ActionResult historyGet(@PathVariable("id") String id) { + List listVo = aiChatService.historyGet(id); + return ActionResult.success(listVo); + } + + @Operation(summary = "保存历史记录") + @Parameters({ + @Parameter(name = "form", description = "会话信息表单"), + }) + @PostMapping("/history/save") + public ActionResult historySave(@RequestBody AiForm form) { + String chatId = aiChatService.historySave(form); + return ActionResult.success(MsgCode.SU002.get(), chatId); + } + + @Operation(summary = "删除ai会话") + @Parameters({ + @Parameter(name = "form", description = "删除ai会话"), + }) + @DeleteMapping("/history/delete/{id}") + public ActionResult historyDelete(@PathVariable("id") String id) { + AiChatEntity byId = aiChatService.getById(id); + if (byId != null) { + aiChatService.delete(id); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/AreaController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/AreaController.java new file mode 100644 index 0000000..9b32021 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/AreaController.java @@ -0,0 +1,286 @@ +package com.yunzhupaas.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.Page; +import com.yunzhupaas.base.service.ProvinceService; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.base.entity.ProvinceEntity; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.base.model.province.*; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.JsonUtilEx; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.treeutil.ListToTreeUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 行政区划 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Tag(name = "行政区划", description = "Area") +@RestController +@RequestMapping("/api/system/Area") +public class AreaController extends SuperController { + + @Autowired + private ProvinceService provinceService; + + /** + * 列表(异步加载) + * + * @param nodeId 节点主键 + * @param page 关键字 + * @return + */ + @Operation(summary = "列表(异步加载)") + @Parameters({ + @Parameter(name = "nodeId", description = "节点主键", required = true) + }) + @SaCheckPermission("system.area") + @GetMapping("/{nodeId}") + public ActionResult> list(@PathVariable("nodeId") String nodeId, PaginationProvince page) { + List data = provinceService.getList(nodeId, page); + List dataAll = data; + List result = JsonUtil.getJsonToList(ListToTreeUtil.treeWhere(data, dataAll), ProvinceEntity.class); + List treeList = JsonUtil.getJsonToList(result, ProvinceListVO.class); + int i = 0; + for (ProvinceListVO entity : treeList) { + boolean childNode = provinceService.getList(entity.getId()).size() <= 0; + ProvinceListVO provinceListVO = JsonUtil.getJsonToBean(entity, ProvinceListVO.class); + provinceListVO.setIsLeaf(childNode); + provinceListVO.setHasChildren(!childNode); + treeList.set(i, provinceListVO); + i++; + } + ListVO vo = new ListVO<>(); + vo.setList(treeList); + return ActionResult.success(vo); + } + + /** + * 获取行政区划下拉框数据 + * + * @param id 主键 + * @param ids 主键集合 + * @return + */ + @Operation(summary = "获取行政区划下拉框数据") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "ids", description = "主键集合", required = true) + }) + @GetMapping("/{id}/Selector/{ids}") + public ActionResult> selectList(@PathVariable("id") String id, @PathVariable("ids") String ids) { + List data = provinceService.getList(id); + data = data.stream().filter(t -> t.getEnabledMark() == 1).collect(Collectors.toList()); + if (!"0".equals(ids)) { + //排除子集 + filterData(data, new ArrayList<>(Arrays.asList(new String[]{ids}))); + } + List treeList = JsonUtil.getJsonToList(data, ProvinceSelectListVO.class); + int i = 0; + for (ProvinceSelectListVO entity : treeList) { +// boolean childNode = provinceService.getList(entity.getId()).size() <= 0; + ProvinceSelectListVO provinceListVO = JsonUtil.getJsonToBean(entity, ProvinceSelectListVO.class); + provinceListVO.setIsLeaf(false); + treeList.set(i, provinceListVO); + i++; + } + ListVO vo = new ListVO<>(); + vo.setList(treeList); + return ActionResult.success(vo); + } + + /** + * 递归排除子集 + * + * @param data 普通列表 + * @param id ignore + */ + private void filterData(List data, List id) { + List collect = null; + //获取子集信息 + for (String ids : id) { + collect = data.stream().filter(t -> ids.equals(t.getParentId())).collect(Collectors.toList()); + data.removeAll(collect); + } + //递归移除子集的子集 + if(collect != null){ + if (collect.size() > 0) { + filterData(data, collect.stream().map(t -> t.getId()).collect(Collectors.toList())); + } + } + } + + /** + * 信息 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "获取行政区划信息") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("system.area") + @GetMapping("/{id}/Info") + public ActionResult info(@PathVariable("id") String id) throws DataException { + ProvinceEntity entity = provinceService.getInfo(id); + ProvinceInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, ProvinceInfoVO.class); + if (!"-1".equals(entity.getParentId())) { + ProvinceEntity parent = provinceService.getInfo(entity.getParentId()); + vo.setParentName(parent.getFullName()); + } + return ActionResult.success(vo); + } + + /** + * 新建 + * + * @param provinceCrForm 实体对象 + * @return ignore + */ + @Operation(summary = "添加行政区划") + @Parameters({ + @Parameter(name = "provinceCrForm", description = "实体对象", required = true) + }) + @SaCheckPermission("system.area") + @PostMapping + public ActionResult create(@RequestBody @Valid ProvinceCrForm provinceCrForm) { + ProvinceEntity entity = JsonUtil.getJsonToBean(provinceCrForm, ProvinceEntity.class); + if (provinceService.isExistByEnCode(provinceCrForm.getEnCode(), entity.getId())) { + return ActionResult.fail(MsgCode.SYS001.get()); + } + if (StringUtil.isEmpty(provinceCrForm.getParentId())) { + entity.setParentId("-1"); + } + if (entity.getParentId().equals("-1")) { + entity.setType("1"); + } else { + ProvinceEntity info = provinceService.getInfo(entity.getParentId()); + int type = info!=null? Integer.valueOf(info.getType()) + 1 : 1; + entity.setType(String.valueOf(type)); + } + provinceService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 更新 + * + * @param id 主键值 + * @param provinceUpForm ignore + * @return ignore + */ + @Operation(summary = "修改行政区划") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true), + @Parameter(name = "provinceUpForm", description = "实体对象", required = true) + }) + @SaCheckPermission("system.area") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid ProvinceUpForm provinceUpForm) { + ProvinceEntity entity = JsonUtil.getJsonToBean(provinceUpForm, ProvinceEntity.class); + if (provinceService.isExistByEnCode(provinceUpForm.getEnCode(), id)) { + return ActionResult.fail(MsgCode.SYS001.get()); + } + boolean flag = provinceService.update(id, entity); + if (!flag) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "删除") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.area") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + if (provinceService.getList(id).size() == 0) { + ProvinceEntity entity = provinceService.getInfo(id); + if (entity != null) { + provinceService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } else { + return ActionResult.fail(MsgCode.SYS002.get()); + } + } + + /** + * 更新行政区划状态 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "更新行政区划状态") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.area") + @PutMapping("/{id}/Actions/State") + public ActionResult upState(@PathVariable("id") String id) { + ProvinceEntity entity = provinceService.getInfo(id); + if (entity.getEnabledMark() == null || "1".equals(String.valueOf(entity.getEnabledMark()))) { + entity.setEnabledMark(0); + } else { + entity.setEnabledMark(1); + } + boolean flag = provinceService.update(id, entity); + if (!flag) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 行政区划id转名称 + * + * @param model 二维数组 + * @return ignore + */ + @Operation(summary = "行政区划id转名称") + @Parameters({ + @Parameter(name = "model", description = "二维数组", required = true) + }) + @PostMapping("/GetAreaByIds") + public ActionResult getAreaByIds(@RequestBody AreaModel model) { + // 返回给前端的list + List> list = new LinkedList<>(); + for (List idList : model.getIdsList()) { + List proList = provinceService.getProList(idList); + List collect = proList.stream().map(ProvinceEntity::getFullName).collect(Collectors.toList()); + list.add(collect); + } + return ActionResult.success(list); + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/BaseLangController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/BaseLangController.java new file mode 100644 index 0000000..b21b02b --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/BaseLangController.java @@ -0,0 +1,253 @@ +package com.yunzhupaas.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaMode; +import cn.hutool.core.bean.BeanUtil; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.entity.BaseLangEntity; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.model.language.*; +import com.yunzhupaas.base.service.BaseLangService; +import com.yunzhupaas.base.service.DictionaryDataService; +import com.yunzhupaas.base.util.ExcelTool; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.ConfigConst; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.model.ExcelColumnAttr; +import com.yunzhupaas.model.ExcelImportVO; +import com.yunzhupaas.model.ExcelModel; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RegexUtils; +import com.yunzhupaas.util.StringUtil; +import org.apache.commons.collections4.MapUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.*; + +/** + * 多语言管理 + * + * @author 云筑产品开发平台组 + * @version v5.0.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/4/28 11:26:57 + */ +@Tag(name = "多语言配置", description = "BaseLang") +@RestController +@RequestMapping("/api/system/BaseLang") +public class BaseLangController { + + @Autowired + private BaseLangService baseLangService; + + @Autowired + private ConfigValueUtil configValueUtil; + + @Autowired + private DictionaryDataService dictionaryDataApi; + + @Operation(summary = "标记翻译列表") + @GetMapping("/List") + public ActionResult getList(Pagination pagination) { +// pagination.setPageSize(100000); + BaseLangListVO list = baseLangService.getList(pagination); +// List list1 = list.getList(); +// for(Object o : list1) { +// Map stringObjectMap = JsonUtil.entityToMap(o); +// LinkedHashMap map = new LinkedHashMap<>(); +// map.put("zh-CN",stringObjectMap.get("zh_CN").toString()); +// map.put("zh-TW",stringObjectMap.get("zh_TW").toString()); +// map.put("en",stringObjectMap.get("en").toString()); +// BaseLangForm form =new BaseLangForm(); +// form.setType(0); +// form.setEnCode(stringObjectMap.get("code").toString()); +// form.setMap(map); +// baseLangService.create(form); +// } + return ActionResult.success(list); + } + + @Operation(summary = "标记翻译列表") + @SaCheckPermission("system.language") + @GetMapping() + public ActionResult list(BaseLangPage pagination) { + BaseLangListVO list = baseLangService.list(pagination); + return ActionResult.success(list); + } + + @Operation(summary = "创建") + @Parameters({ + @Parameter(name = "form", description = "多语言表单对象", required = true) + }) + @SaCheckPermission(value = {"system.language", "onlineDev.webDesign"}, mode = SaMode.OR) + @PostMapping() + public ActionResult create(@RequestBody @Valid BaseLangForm form) { + if (RegexUtils.checkEnCode2(form.getEnCode())) { + ActionResult.fail(MsgCode.SYS050.get()); + } + baseLangService.create(form); + return ActionResult.success(MsgCode.SU001.get()); + } + + @Operation(summary = "修改") + @Parameters({ + @Parameter(name = "form", description = "多语言表单对象", required = true) + }) + @SaCheckPermission("system.language") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid BaseLangForm form) { + if (RegexUtils.checkEnCode2(form.getEnCode())) { + ActionResult.fail(MsgCode.SYS050.get()); + } + form.setId(id); + baseLangService.update(form); + return ActionResult.success(MsgCode.SU004.get()); + } + + @Operation(summary = "详情") + @Parameters({ + @Parameter(name = "enCode", description = "翻译标记", required = true) + }) + @SaCheckPermission("system.language") + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) { + BaseLangForm info = baseLangService.getInfo(id); + return ActionResult.success(info); + } + + @Operation(summary = "删除") + @Parameters({ + @Parameter(name = "id", description = "翻译标记", required = true) + }) + @SaCheckPermission("system.language") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + baseLangService.delete(id); + return ActionResult.success(); + } + + @Operation(summary = "获取语种json") + @Parameters({ + @Parameter(name = "language", description = "语种编码", required = true) + }) + @GetMapping("/LangJson") + public ActionResult LangJson(Locale locale) { + if (locale == null || StringUtil.isEmpty(locale.toLanguageTag()) || "und".equals(locale.toLanguageTag())) { + locale = Locale.SIMPLIFIED_CHINESE; + } + String languageJson = baseLangService.getLanguageJson(locale); + return ActionResult.success(MsgCode.SU000.get(), languageJson); + } + + @Operation(summary = "获取语种json") + @Parameters({ + @Parameter(name = "language", description = "语种编码", required = true) + }) + @GetMapping("/ServerLang") + public ActionResult> getServerLang(Locale locale) { + List serverLang = baseLangService.getServerLang(locale); + List list = JsonUtil.getJsonToList(serverLang, BaseLangVo.class); + return ActionResult.success(list); + } + + //++++++++++++++++++++++++++++++++++以下导入导出接口++++++++++++++++++++++++++++++++++++++++++ + + @Operation(summary = "模板下载") + @SaCheckPermission("system.language") + @GetMapping("/TemplateDownload") + public ActionResult TemplateDownload() { + BaseLangColumn columnMap = new BaseLangColumn(getDicLangMap()); + String excelName = columnMap.getExcelName(); + Map keyMap = columnMap.getColumnByType(0); + List models = columnMap.getFieldsModel(false); + List> list = columnMap.getDefaultList(); + Map optionMap = new HashMap<>(); + optionMap.put("type", new String[]{"客户端", "服务端"}); + + ExcelModel excelModel = ExcelModel.builder().models(models).selectKey(new ArrayList<>(keyMap.keySet())).optionMap(optionMap).hasHeader(true).build(); + DownloadVO vo = ExcelTool.getImportTemplate(configValueUtil.getTemporaryFilePath(), excelName, keyMap, list, excelModel); + return ActionResult.success(vo); + } + + /** + * 从字典获取语言map + * + * @return + */ + private Map getDicLangMap() { + List langTypeList = dictionaryDataApi.getListByTypeDataCode(ConfigConst.BASE_LANGUAGE); + Map collect = new LinkedHashMap<>(); + langTypeList.forEach(t -> collect.put(t.getEnCode(), t.getFullName())); + return collect; + } + + @Operation(summary = "上传导入Excel") + @SaCheckPermission("system.language") + @PostMapping("/Uploader") + public ActionResult Uploader() { + return ExcelTool.uploader(); + } + + @Operation(summary = "导入数据") + @SaCheckPermission("system.language") + @PostMapping("/ImportData") + public ActionResult ImportData(@RequestBody BaseLangModel model) { + // 导入字段 + BaseLangColumn columnMap = new BaseLangColumn(getDicLangMap()); + Map keyMap = columnMap.getColumnByType(0); + Map headAndDataMap = ExcelTool.importPreview(configValueUtil.getTemporaryFilePath(), model.getFileName(), keyMap,1,1); + List> listData = (List>) headAndDataMap.get("dataRow"); + List addList = new ArrayList<>(); + List> failList = new ArrayList<>(); + // 对数据做校验 (处理) + this.validateImportData(listData, addList, failList); + //写入数据 + baseLangService.importSaveOrUpdate(addList); + return ActionResult.success(MsgCode.IMP001.get()); + } + + public void validateImportData(List> listData, List addList, List> failList) { + List langTypeList = dictionaryDataApi.getListByTypeDataCode(ConfigConst.BASE_LANGUAGE); + for (Map map : listData) { + if (MapUtils.isNotEmpty(map) && map.get("enCode")!=null && StringUtil.isNotBlank(map.get("enCode").toString()) && RegexUtils.checkEnCode2(map.get("enCode").toString())) { + BaseLangEntity baseLangEntity = new BaseLangEntity(); + baseLangEntity.setEnCode(map.get("enCode").toString()); + Integer type = 0; + if (map.get("type") != null && StringUtil.isNotBlank(map.get("type").toString())) { + type = "服务端".equals(map.get("type").toString()) ? 1 : 0; + } + baseLangEntity.setType(type); + boolean allNull = true; + List thisList =new ArrayList<>(); + for (DictionaryDataEntity item : langTypeList) { + String enCode = item.getEnCode(); + String fullName = ""; + if (map.get(enCode) != null) { + fullName = map.get(enCode).toString(); + } + if(StringUtil.isNotBlank(fullName)){ + allNull = false; + } + baseLangEntity.setLanguage(enCode); + baseLangEntity.setFullName(fullName); + BaseLangEntity entity = BeanUtil.copyProperties(baseLangEntity, BaseLangEntity.class); + thisList.add(entity); + } + if(!allNull){ + addList.addAll(thisList); + } + } else { + failList.add(map); + } + } + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/BillRuleController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/BillRuleController.java new file mode 100644 index 0000000..058a24a --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/BillRuleController.java @@ -0,0 +1,327 @@ +package com.yunzhupaas.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.util.ObjectUtil; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.annotation.HandleLog; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.model.billrule.*; +import com.yunzhupaas.base.service.DictionaryDataService; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.base.service.BillRuleService; +import com.yunzhupaas.base.entity.BillRuleEntity; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.*; +import com.yunzhupaas.emnus.ModuleTypeEnum; +import com.yunzhupaas.util.DataFileExport; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import jakarta.validation.Valid; +import java.util.ArrayList; +import java.util.List; + +/** + * 单据规则 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Tag(name = "单据规则", description = "BillRule") +@RestController +@RequestMapping("/api/system/BillRule") +public class BillRuleController extends SuperController { + + @Autowired + private DataFileExport fileExport; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private BillRuleService billRuleService; + @Autowired + private UserService userService; + @Autowired + private DictionaryDataService dictionaryDataService; + /** + * 列表 + * + * @param pagination 分页参数 + * @return ignore + */ + @HandleLog(moduleName = "单据规则", requestMethod = "查询") + @Operation(summary = "获取单据规则列表(带分页)") + @SaCheckPermission("system.billRule") + @GetMapping + public ActionResult> list(BillRulePagination pagination) { + List list = billRuleService.getList(pagination); + List listVO = new ArrayList<>(); + list.forEach(entity->{ + BillRuleListVO vo = JsonUtil.getJsonToBean(entity, BillRuleListVO.class); + if(StringUtil.isNotEmpty(entity.getCategory())){ + DictionaryDataEntity dataEntity = dictionaryDataService.getInfo(entity.getCategory()); + vo.setCategory(dataEntity != null ? dataEntity.getFullName() : null); + } + + UserEntity userEntity = userService.getInfo(entity.getCreatorUserId()); + if(userEntity != null){ + vo.setCreatorUser(userEntity.getRealName() + "/" + userEntity.getAccount()); + } + listVO.add(vo); + }); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(listVO, paginationVO); + } + + /** + * 列表 + * + * @return ignore + */ + @HandleLog(moduleName = "单据规则", requestMethod = "查询") + @Operation(summary = "获取单据规则下拉框") + @GetMapping("/Selector") + public ActionResult selectList(BillRulePagination pagination) { + List list = billRuleService.getListByCategory(pagination.getCategoryId(),pagination); + List listVO = new ArrayList<>(); + list.forEach(entity->{ + BillRuleListVO vo = JsonUtil.getJsonToBean(entity, BillRuleListVO.class); + if(StringUtil.isNotEmpty(entity.getCategory())){ + DictionaryDataEntity dataEntity = dictionaryDataService.getInfo(entity.getCategory()); + vo.setCategory(dataEntity != null ? dataEntity.getFullName() : null); + } + + UserEntity userEntity = userService.getInfo(entity.getCreatorUserId()); + if(userEntity != null){ + vo.setCreatorUser(userEntity.getRealName() + "/" + userEntity.getAccount()); + } + listVO.add(vo); + }); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(listVO, paginationVO); + } + + + /** + * 更新组织状态 + * + * @param id 主键值 + * @return ignore + */ + @HandleLog(moduleName = "单据规则", requestMethod = "修改") + @Operation(summary = "更新单据规则状态") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.billRule") + @PutMapping("/{id}/Actions/State") + public ActionResult update(@PathVariable("id") String id) { + BillRuleEntity entity = billRuleService.getInfo(id); + if (entity != null) { + if ("1".equals(String.valueOf(entity.getEnabledMark()))) { + entity.setEnabledMark(0); + } else { + entity.setEnabledMark(1); + } + billRuleService.update(entity.getId(), entity); + return ActionResult.success(MsgCode.SU004.get()); + } + return ActionResult.fail(MsgCode.FA002.get()); + } + + /** + * 信息 + * + * @param id 主键值 + * @return ignore + */ + @HandleLog(moduleName = "单据规则", requestMethod = "查询") + @Operation(summary = "获取单据规则信息") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.billRule") + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) throws DataException { + BillRuleEntity entity = billRuleService.getInfo(id); + BillRuleInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, BillRuleInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 获取单据流水号 + * + * @param enCode 参数编码 + * @return ignore + */ + @HandleLog(moduleName = "单据规则", requestMethod = "查询") + @Operation(summary = "获取单据流水号(工作流调用)") + @Parameters({ + @Parameter(name = "enCode", description = "参数编码", required = true) + }) + @GetMapping("/BillNumber/{enCode}") + public ActionResult getBillNumber(@PathVariable("enCode") String enCode) throws DataException { + String data = billRuleService.getBillNumber(enCode, false); + return ActionResult.success(MsgCode.SU019.get(), data); + } + + /** + * 新建 + * + * @param billRuleCrForm 实体对象 + * @return ignore + */ + @HandleLog(moduleName = "单据规则", requestMethod = "新增") + @Operation(summary = "添加单据规则") + @Parameters({ + @Parameter(name = "billRuleCrForm", description = "实体对象", required = true) + }) + @SaCheckPermission("system.billRule") + @PostMapping + public ActionResult create(@RequestBody @Valid BillRuleCrForm billRuleCrForm) { + + BillRuleEntity entity = JsonUtil.getJsonToBean(billRuleCrForm, BillRuleEntity.class); + if (billRuleService.isExistByFullName(entity.getFullName(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (billRuleService.isExistByEnCode(entity.getEnCode(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + billRuleService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 更新 + * + * @param billRuleUpForm 实体对象 + * @param id 主键值 + * @return ignore + */ + @HandleLog(moduleName = "单据规则", requestMethod = "修改") + @Operation(summary = "修改单据规则") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true), + @Parameter(name = "billRuleUpForm", description = "实体对象", required = true) + }) + @SaCheckPermission("system.billRule") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody BillRuleUpForm billRuleUpForm) { + BillRuleEntity entity = JsonUtil.getJsonToBean(billRuleUpForm, BillRuleEntity.class); + if (billRuleService.isExistByFullName(entity.getFullName(), id)) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (billRuleService.isExistByEnCode(entity.getEnCode(), id)) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + // 单据生成规则有改变则重新生成流水 + BillRuleEntity billRuleEntity = billRuleService.getInfo(id); + if (entity.getType() == 1 && ( + (StringUtil.isNotEmpty(billRuleEntity.getPrefix()) && StringUtil.isNotEmpty(entity.getPrefix()) && + !ObjectUtil.equal(billRuleEntity.getPrefix().length(), entity.getPrefix().length())) || + (StringUtil.isNotEmpty(billRuleEntity.getSuffix()) && StringUtil.isNotEmpty(entity.getSuffix()) && + !ObjectUtil.equal(billRuleEntity.getSuffix().length(), entity.getSuffix().length())) || + !ObjectUtil.equal(billRuleEntity.getDigit(), entity.getDigit()) || + !ObjectUtil.equal(billRuleEntity.getDateFormat(), entity.getDateFormat()) + ) + ) { + entity.setOutputNumber(null); + entity.setThisNumber(null); + }else { + entity.setOutputNumber(billRuleEntity.getOutputNumber()); + entity.setThisNumber(billRuleEntity.getThisNumber()); + } + boolean flag = billRuleService.update(id, entity); + if (!flag) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除 + * + * @param id 主键值 + * @return ignore + */ + @HandleLog(moduleName = "单据规则", requestMethod = "删除") + @Operation(summary = "删除单据规则") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.billRule") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + BillRuleEntity entity = billRuleService.getInfo(id); + if (entity != null) { + if (!StringUtil.isEmpty(entity.getOutputNumber())) { + return ActionResult.fail(MsgCode.SYS003.get()); + } else { + billRuleService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + /** + * 导出单据规则 + * + * @param id 打印模板id + * @return ignore + */ + @HandleLog(moduleName = "单据规则", requestMethod = "导出") + @Operation(summary = "导出") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.billRule") + @GetMapping("/{id}/Actions/Export") + public ActionResult export(@PathVariable String id) { + BillRuleEntity entity = billRuleService.getInfo(id); + //导出文件 + DownloadVO downloadVO = fileExport.exportFile(entity, configValueUtil.getTemporaryFilePath(), entity.getFullName(), ModuleTypeEnum.SYSTEM_BILLRULE.getTableName()); + return ActionResult.success(downloadVO); + } + + /** + * 导入单据规则 + * + * @param multipartFile 备份json文件 + * @param type 0/1 跳过/追加 + * @return 执行结果标识 + */ + @HandleLog(moduleName = "单据规则", requestMethod = "导入") + @Operation(summary = "导入") + @SaCheckPermission("system.billRule") + @PostMapping(value = "/Actions/Import", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ActionResult importData(@RequestPart("file") MultipartFile multipartFile, + @RequestParam("type") Integer type) throws DataException { + //判断是否为.json结尾 + if (FileUtil.existsSuffix(multipartFile, ModuleTypeEnum.SYSTEM_BILLRULE.getTableName())) { + return ActionResult.fail(MsgCode.IMP002.get()); + } + try { + String fileContent = FileUtil.getFileContent(multipartFile); + BillRuleEntity entity = JsonUtil.getJsonToBean(fileContent, BillRuleEntity.class); + return billRuleService.ImportData(entity, type); + } catch (Exception e) { + throw new DataException(MsgCode.IMP004.get()); + } + + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/CacheManageController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/CacheManageController.java new file mode 100644 index 0000000..73da9d5 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/CacheManageController.java @@ -0,0 +1,144 @@ +package com.yunzhupaas.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.util.ObjectUtil; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.Page; +import com.yunzhupaas.base.model.cachemanage.PaginationCacheManage; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.base.model.cachemanage.CacheManageInfoVO; +import com.yunzhupaas.base.model.cachemanage.CacheManageListVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 缓存管理 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Tag(name = "缓存管理", description = "CacheManage") +@RestController +@RequestMapping("/api/system/CacheManage") +public class CacheManageController { + + @Autowired + private RedisUtil redisUtil; + + + /** + * 获取缓存列表 + * + * @param page 分页参数 + * @return ignore + */ + @Operation(summary = "获取缓存列表") + @SaCheckPermission("system.cache") + @GetMapping + public ActionResult> getList(PaginationCacheManage page) { + String tenantId = UserProvider.getUser().getTenantId(); + List list = new ArrayList<>(); + Set data = redisUtil.getAllKeys(); + for (String key : data) { + try { + if (!StringUtil.isEmpty(tenantId) && key.contains(tenantId)) { + CacheManageListVO model = new CacheManageListVO(); + model.setName(key); + model.setCacheSize(String.valueOf(redisUtil.getString(key)).getBytes().length); + model.setOverdueTime(new Date((DateUtil.getTime(new Date()) + redisUtil.getLiveTime(key)) * 1000).getTime()); + list.add(model); + } else if (StringUtil.isEmpty(tenantId)) { + CacheManageListVO model = new CacheManageListVO(); + model.setName(key); + model.setCacheSize(String.valueOf(redisUtil.getString(key)).getBytes().length); + model.setOverdueTime(new Date((DateUtil.getTime(new Date()) + redisUtil.getLiveTime(key)) * 1000).getTime()); + list.add(model); + } + }catch (Exception e){ + } + } + list = list.stream().sorted(Comparator.comparing(CacheManageListVO::getOverdueTime)).collect(Collectors.toList()); + if (StringUtil.isNotEmpty(page.getKeyword())) { + list = list.stream().filter(t -> t.getName().contains(page.getKeyword())).collect(Collectors.toList()); + } + if (ObjectUtil.isNotNull(page.getOverdueStartTime()) && ObjectUtil.isNotNull(page.getOverdueEndTime())) { + list = list.stream().filter(t -> t.getOverdueTime() >= page.getOverdueStartTime() && t.getOverdueTime() <= page.getOverdueEndTime()).collect(Collectors.toList()); + } + ListVO vo = new ListVO<>(); + vo.setList(list); + return ActionResult.success(vo); + } + + /** + * 获取缓存信息 + * + * @param name 主键值 + * @return ignore + */ + @Operation(summary = "获取缓存信息") + @Parameter(name = "name", description = "主键值", required = true) + @SaCheckPermission("system.cache") + @GetMapping("/{name}") + public ActionResult info(@PathVariable("name") String name) { + name = XSSEscape.escape(name); + String json = String.valueOf(redisUtil.getString(name)); + CacheManageInfoVO vo = new CacheManageInfoVO(); + vo.setName(name); + vo.setValue(json); + return ActionResult.success(vo); + } + + /** + * 清空所有缓存 + * + * @return ignore + */ + @Operation(summary = "清空所有缓存") + @SaCheckPermission("system.cache") + @PostMapping("/Actions/ClearAll") + public ActionResult clearAll() { + String tenantId = UserProvider.getUser().getTenantId(); + if ("".equals(tenantId)) { + Set keys = redisUtil.getAllKeys(); + for (String key : keys) { + redisUtil.remove(key); + } + } else { + Set data = redisUtil.getAllKeys(); + String clientKey = UserProvider.getToken(); + System.out.println(clientKey); + for (String key : data) { + if (key.contains(tenantId)) { + redisUtil.remove(key); + } + } + } + return ActionResult.success(MsgCode.SYS004.get()); + } + + /** + * 清空单个缓存 + * + * @param name 主键值 + * @return ignore + */ + @Operation(summary = "清空单个缓存") + @Parameter(name = "name", description = "主键值", required = true) + @SaCheckPermission("system.cache") + @DeleteMapping("/{name}") + public ActionResult clear(@PathVariable("name") String name) { + redisUtil.remove(name); + return ActionResult.success(MsgCode.SYS004.get()); + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/ComFieldsController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/ComFieldsController.java new file mode 100644 index 0000000..a77f416 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/ComFieldsController.java @@ -0,0 +1,155 @@ +package com.yunzhupaas.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import com.yunzhupaas.base.controller.SuperController; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.service.ComFieldsService; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.base.entity.ComFieldsEntity; +import com.yunzhupaas.constant.GenerateConstant; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.base.model.comfields.ComFieldsCrForm; +import com.yunzhupaas.base.model.comfields.ComFieldsInfoVO; +import com.yunzhupaas.base.model.comfields.ComFieldsListVO; +import com.yunzhupaas.base.model.comfields.ComFieldsUpForm; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.JsonUtilEx; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; + +import java.util.ArrayList; +import java.util.List; + +/** + * 常用字段 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Tag(name = "常用字段", description = "CommonFields") +@RestController +@RequestMapping("/api/system/CommonFields") +public class ComFieldsController extends SuperController { + + @Autowired + private ComFieldsService comFieldsService; + + /** + * 获取常用字段列表 + * + * @return ignore + */ + @Operation(summary = "获取常用字段列表") + @SaCheckPermission("systemData.dataModel") + @GetMapping + public ActionResult> list() { + List data = comFieldsService.getList(); + List list = JsonUtil.getJsonToList(data, ComFieldsListVO.class); + ListVO vo = new ListVO<>(); + vo.setList(list); + return ActionResult.success(vo); + } + + /** + * 获取常用字段 + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "获取常用字段") + @Parameter(name = "id", description = "主键", required = true) + @SaCheckPermission("systemData.dataModel") + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) throws DataException { + ComFieldsEntity entity = comFieldsService.getInfo(id); + ComFieldsInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, ComFieldsInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 新增常用字段 + * + * @param comFieldsCrForm 新增常用字段模型 + * @return ignore + */ + @Operation(summary = "添加常用字段") + @Parameter(name = "comFieldsCrForm", description = "新建模型", required = true) + @SaCheckPermission("systemData.dataModel") + @PostMapping + public ActionResult create(@RequestBody @Valid ComFieldsCrForm comFieldsCrForm) { + ComFieldsEntity entity = JsonUtil.getJsonToBean(comFieldsCrForm, ComFieldsEntity.class); + List javaSql = new ArrayList<>(); + javaSql.addAll(GenerateConstant.JAVA_KEYWORD); + javaSql.addAll(GenerateConstant.SQL_KEYWORD); + if(javaSql.contains(entity.getField())){ + return ActionResult.fail(MsgCode.SYS128.get("列名" + entity.getField())); + } + if (comFieldsService.isExistByFullName(entity.getField(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + comFieldsService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 修改常用字段 + * + * @param id 主键 + * @param comFieldsUpForm 修改常用字段模型 + * @return ignore + */ + @Operation(summary = "修改常用字段") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "comFieldsUpForm", description = "修改模型", required = true) + }) + @SaCheckPermission("systemData.dataModel") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid ComFieldsUpForm comFieldsUpForm) { + ComFieldsEntity entity = JsonUtil.getJsonToBean(comFieldsUpForm, ComFieldsEntity.class); + List javaSql = new ArrayList<>(); + javaSql.addAll(GenerateConstant.JAVA_KEYWORD); + javaSql.addAll(GenerateConstant.SQL_KEYWORD); + if(javaSql.contains(entity.getField())){ + return ActionResult.fail(MsgCode.SYS128.get("列名" + entity.getField())); + } + if (comFieldsService.isExistByFullName(entity.getField(), id)) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + boolean flag = comFieldsService.update(id, entity); + if (!flag) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除常用字段 + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "删除常用字段") + @Parameter(name = "id", description = "主键", required = true) + @SaCheckPermission("systemData.dataModel") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + ComFieldsEntity entity = comFieldsService.getInfo(id); + if (entity != null) { + comFieldsService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } +} + + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/CommonWordsController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/CommonWordsController.java new file mode 100644 index 0000000..146f554 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/CommonWordsController.java @@ -0,0 +1,194 @@ +package com.yunzhupaas.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaMode; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.entity.CommonWordsEntity; +import com.yunzhupaas.base.entity.SystemEntity; +import com.yunzhupaas.base.model.commonword.ComWordsPagination; +import com.yunzhupaas.base.model.commonword.CommonWordsForm; +import com.yunzhupaas.base.model.commonword.CommonWordsVO; +import com.yunzhupaas.base.service.CommonWordsService; +import com.yunzhupaas.base.service.SystemService; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 常用语控制类 + * + * @author 云筑产品开发平台组 + * @version v3.4.6 + * @copyrignt 深圳市乐程软件有限公司 + * @date 2023-01-06 + */ +@Tag(name = "审批常用语", description = "commonWords") +@RestController +@RequestMapping("/api/system/CommonWords") +public class CommonWordsController extends SuperController { + + @Autowired + private CommonWordsService commonWordsService; + @Autowired + private SystemService systemService; + + + /** + * 列表 + * + * @param comWordsPagination 页面参数对象 + * @return 列表结果集 + */ + @Operation(summary = "当前系统应用列表") + @GetMapping() + public ActionResult> getList(ComWordsPagination comWordsPagination) { + List entityList = commonWordsService.getSysList(comWordsPagination, false); + List voList = JsonUtil.getJsonToList(entityList, CommonWordsVO.class); + formatSystemNames(voList); + return ActionResult.page(voList, JsonUtil.getJsonToBean(comWordsPagination, PaginationVO.class)); + } + + /** + * 获取信息 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取信息") + @Parameter(name = "id", description = "主键", required = true) + @GetMapping("/{id}") + public ActionResult getInfo(@PathVariable String id) { + CommonWordsEntity entity = commonWordsService.getById(id); + if (StringUtil.isNotEmpty(entity.getSystemIds())) { + String[] sysIds = entity.getSystemIds().split(","); + List ids = new ArrayList<>(); + for (String sysId : sysIds) { + if (!StringUtil.isEmpty(sysId)) { + SystemEntity systemEntity = systemService.getInfo(sysId); + if (systemEntity != null && systemEntity.getEnabledMark() == 1) { + ids.add(sysId); + } + } + } + if (ids.size() > 0) { + entity.setSystemIds(StringUtil.join(ids, ",")); + } else { + entity.setSystemIds(null); + } + } + CommonWordsVO vo = JsonUtil.getJsonToBean(entity, CommonWordsVO.class); + return ActionResult.success(vo); + } + + /** + * 下拉列表 + * + * @return + */ + @Operation(summary = "下拉列表") + @GetMapping("/Selector") + public ActionResult> getSelect(String type) { + List voList = JsonUtil.getJsonToList(commonWordsService.getListModel(type), CommonWordsVO.class); + formatSystemNames(voList); + return ActionResult.success(new ListVO<>(voList)); + } + + /** + * 新建 + * + * @param commonWordsForm 实体模型 + * @return + */ + @Operation(summary = "新建") + @Parameter(name = "commonWordsForm", description = "实体模型", required = true) + @PostMapping("") + public ActionResult create(@RequestBody CommonWordsForm commonWordsForm) { + if (commonWordsService.existCommonWord(null, commonWordsForm.getCommonWordsText(), commonWordsForm.getCommonWordsType())) { + return ActionResult.fail(MsgCode.SYS105.get()); + } + CommonWordsEntity entity = JsonUtil.getJsonToBean(commonWordsForm, CommonWordsEntity.class); + entity.setId(RandomUtil.uuId()); + entity.setUsesNum(0l); + commonWordsService.save(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 修改 + * + * @param commonWordsForm 实体模型 + * @return + */ + @Operation(summary = "修改") + @Parameters({ + @Parameter(name = "commonWordsForm", description = "实体模型", required = true) + }) + @PutMapping("/{id}") + public ActionResult update(@RequestBody CommonWordsForm commonWordsForm) { + if (commonWordsService.existCommonWord(commonWordsForm.getId(), commonWordsForm.getCommonWordsText(), commonWordsForm.getCommonWordsType())) { + return ActionResult.fail(MsgCode.SYS105.get()); + } + CommonWordsEntity entity = JsonUtil.getJsonToBean(commonWordsForm, CommonWordsEntity.class); + entity.setId(commonWordsForm.getId()); + commonWordsService.updateById(entity); + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除") + @SaCheckPermission("commonWords") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable String id) { + //对象存在判断 + if (commonWordsService.getById(id) != null) { + commonWordsService.removeById(id); + return ActionResult.success(MsgCode.SU003.get()); + } else { + return ActionResult.fail(MsgCode.FA003.get()); + } + } + + @Operation(summary = "常用语使用") + @Parameters({ + @Parameter(name = "commonWordsForm", description = "实体模型") + }) + @PostMapping("/UsesNum") + public ActionResult addCommonWordsNum(@RequestBody CommonWordsForm commonWordsForm) { + commonWordsService.addCommonWordsNum(commonWordsForm.getCommonWordsText()); + return ActionResult.success(MsgCode.SU000.get()); + } + + private void formatSystemNames(List voList) { + voList.forEach(vo -> { + if (StringUtil.isNotEmpty(vo.getSystemIds())) { + List sysNameList = systemService.getListByIds(vo.getSystemIds(), null).stream() + .map(SystemEntity::getFullName).collect(Collectors.toList()); + vo.setSystemNames(StringUtil.join(sysNameList, ",")); + } + }); + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/DataInterfaceController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/DataInterfaceController.java new file mode 100644 index 0000000..b48840c --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/DataInterfaceController.java @@ -0,0 +1,648 @@ +package com.yunzhupaas.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.serializer.SerializerFeature; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.*; +import com.yunzhupaas.base.entity.DataInterfaceEntity; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.entity.InterfaceOauthEntity; +import com.yunzhupaas.base.model.datainterface.*; +import com.yunzhupaas.base.service.DataInterfaceService; +import com.yunzhupaas.base.service.DictionaryDataService; +import com.yunzhupaas.base.service.DictionaryTypeService; +import com.yunzhupaas.base.service.InterfaceOauthService; +import com.yunzhupaas.base.util.interfaceUtil.InterfaceUtil; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.constant.DbSensitiveConstant; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.emnus.ModuleTypeEnum; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.database.util.*; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.enums.DictionaryDataEnum; +import com.yunzhupaas.util.treeutil.SumTree; +import com.yunzhupaas.util.treeutil.TreeDotUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import jakarta.validation.Valid; +import java.util.*; + +/** + * 数据接口 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-03-15 10:29 + */ +@Tag(name = "数据接口", description = "DataInterface") +@RestController +@RequestMapping(value = "/api/system/DataInterface") +public class DataInterfaceController extends SuperController { + @Autowired + private DataInterfaceService dataInterfaceService; + @Autowired + private DictionaryDataService dictionaryDataService; + @Autowired + private DictionaryTypeService dictionaryTypeService; + + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private InterfaceOauthService interfaceOauthService; + @Autowired + private DataFileExport fileExport; + + /** + * 获取接口列表(分页) + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "获取接口列表(分页)") + @SaCheckPermission("systemData.dataInterface") + @GetMapping + public ActionResult> getList(PaginationDataInterface pagination) { + List data = dataInterfaceService.getList(pagination, 0); + List list = JsonUtil.getJsonToList(data, DataInterfaceListVO.class); + // 添加tenantId字段 + for (DataInterfaceListVO vo : list) { + // 类别转换 + if ("1".equals(vo.getType())) { + vo.setType("SQL操作"); + } else if ("2".equals(vo.getType())) { + vo.setType("静态数据"); + } else if ("3".equals(vo.getType())) { + vo.setType("API操作"); + } + if (StringUtil.isNotEmpty(UserProvider.getUser().getTenantId())) { + vo.setTenantId(UserProvider.getUser().getTenantId()); + } + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(list, paginationVO); + } + + /** + * 获取接口列表(工作流选择时调用) + * + * @param pagination 分页参数 + * @return ignore + */ + @Operation(summary = "获取接口列表(工作流选择时调用)") + @GetMapping("/getList") + public ActionResult> getLists(PaginationDataInterfaceSelector pagination) { + List data = dataInterfaceService.getList(pagination); + List list = JsonUtil.getJsonToList(data, DataInterfaceGetListVO.class); + for (DataInterfaceGetListVO vo : list) { + // 类别转换 + if ("1".equals(vo.getType())) { + vo.setType("SQL操作"); + } else if ("2".equals(vo.getType())) { + vo.setType("静态数据"); + } else if ("3".equals(vo.getType())) { + vo.setType("API操作"); + } + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(list, paginationVO); + } + + /** + * 获取接口列表下拉框 + * + * @return + */ + @Operation(summary = "获取接口列表下拉框") + @GetMapping("/Selector") + public ActionResult> getSelector() { + List tree = new ArrayList<>(); + List data = dataInterfaceService.getList(false); + List dataEntityList = dictionaryDataService.getList(dictionaryTypeService.getInfoByEnCode(DictionaryDataEnum.SYSTEM_DATAINTERFACE.getDictionaryTypeId()).getId()); + // 获取数据接口外层菜单 + for (DictionaryDataEntity dictionaryDataEntity : dataEntityList) { + DataInterfaceTreeModel firstModel = JsonUtil.getJsonToBean(dictionaryDataEntity, DataInterfaceTreeModel.class); + firstModel.setId(dictionaryDataEntity.getId()); + firstModel.setCategory("0"); + long num = data.stream().filter(t -> t.getCategory().equals(dictionaryDataEntity.getId())).count(); + if (num > 0) { + tree.add(firstModel); + } + } + for (DataInterfaceEntity entity : data) { + DataInterfaceTreeModel treeModel = JsonUtil.getJsonToBean(entity, DataInterfaceTreeModel.class); + treeModel.setCategory("1"); + treeModel.setParentId(entity.getCategory()); + treeModel.setId(entity.getId()); + DictionaryDataEntity dataEntity = dictionaryDataService.getInfo(entity.getCategory()); + if (dataEntity != null) { + tree.add(treeModel); + } + } + List> sumTrees = TreeDotUtils.convertListToTreeDot(tree); + List list = JsonUtil.getJsonToList(sumTrees, DataInterfaceTreeVO.class); + ListVO vo = new ListVO<>(); + vo.setList(list); + return ActionResult.success(list); + } + + /** + * 获取接口参数列表下拉框 + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "获取接口参数列表下拉框") + @Parameter(name = "id", description = "主键", required = true) + @SaCheckPermission("systemData.dataInterface") + @GetMapping("/GetParam/{id}") + public ActionResult> getSelector(@PathVariable("id") String id) { + DataInterfaceEntity entity = dataInterfaceService.getInfo(id); + if (entity!=null) { + String parameterJson = entity.getParameterJson(); + List jsonToList = JsonUtil.getJsonToList(parameterJson, DataInterfaceModel.class); + return ActionResult.success(jsonToList == null ? new ArrayList<>() : jsonToList); + } + return ActionResult.fail(MsgCode.FA001.get()); + } + + /** + * 获取接口数据 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取接口数据") + @Parameter(name = "id", description = "主键", required = true) + @SaCheckPermission("systemData.dataInterface") + @GetMapping("/{id}") + public ActionResult getInfo(@PathVariable("id") String id) throws DataException { + DataInterfaceEntity entity = dataInterfaceService.getInfo(id); + DataInterfaceVo vo = JsonUtil.getJsonToBean(entity, DataInterfaceVo.class); + return ActionResult.success(vo); + } + + /** + * 添加接口 + * + * @param dataInterfaceCrForm 实体模型 + * @return + */ + @Operation(summary = "添加接口") + @Parameter(name = "dataInterfaceCrForm", description = "实体模型", required = true) + @SaCheckPermission("systemData.dataInterface") + @PostMapping + public ActionResult create(@RequestBody @Valid DataInterfaceCrForm dataInterfaceCrForm) throws DataException { + DataInterfaceEntity entity = JsonUtil.getJsonToBean(dataInterfaceCrForm, DataInterfaceEntity.class); + // 判断是否有敏感字 + String containsSensitive = containsSensitive(entity); + if (StringUtil.isNotEmpty(containsSensitive)) { + return ActionResult.fail(MsgCode.SYS006.get(containsSensitive)); + } + if (dataInterfaceService.isExistByFullNameOrEnCode(entity.getId(), entity.getFullName(), null)) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (dataInterfaceService.isExistByFullNameOrEnCode(entity.getId(), null, entity.getEnCode())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + dataInterfaceService.create(entity); + return ActionResult.success(MsgCode.SYS005.get()); + } + + /** + * 判断是否有敏感字 + * + * @param entity + * @return + */ + private String containsSensitive(DataInterfaceEntity entity) { + // 判断是否有敏感字 + if (entity.getType() == 1 && (entity.getAction() != null && entity.getAction() == 3)) { + DataConfigJsonModel dataConfigJsonModel = JsonUtil.getJsonToBean(entity.getDataConfigJson(), DataConfigJsonModel.class); + String sql = dataConfigJsonModel.getSqlData().getSql(); + if (StringUtil.isNotEmpty(sql)) { + return ParameterUtil.checkContainsSensitive(sql, DbSensitiveConstant.SENSITIVE); + } + } + return ""; + } + + /** + * 修改接口 + * + * @param dataInterfaceUpForm 实体模型 + * @param id 主键 + * @return + */ + @Operation(summary = "修改接口") + @Parameters({ + @Parameter(name = "dataInterfaceUpForm", description = "实体模型", required = true), + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("systemData.dataInterface") + @PutMapping("/{id}") + public ActionResult update(@RequestBody @Valid DataInterfaceUpForm dataInterfaceUpForm, @PathVariable("id") String id) throws DataException { + DataInterfaceEntity entity = JsonUtilEx.getJsonToBeanEx(dataInterfaceUpForm, DataInterfaceEntity.class); + // 判断是否有敏感字 + String containsSensitive = containsSensitive(entity); + if (StringUtil.isNotEmpty(containsSensitive)) { + return ActionResult.fail(MsgCode.SYS006.get(containsSensitive)); + } + if (dataInterfaceService.isExistByFullNameOrEnCode(id, entity.getFullName(), null)) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (dataInterfaceService.isExistByFullNameOrEnCode(id, null, entity.getEnCode())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + boolean flag = dataInterfaceService.update(entity, id); + if (!flag) { + return ActionResult.fail(MsgCode.FA001.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除接口 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除接口") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("systemData.dataInterface") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable String id) { + DataInterfaceEntity entity = dataInterfaceService.getInfo(id); + if (entity != null) { + dataInterfaceService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA001.get()); + } + + /** + * 更新接口状态 + * + * @param id 主键 + * @return + */ + @Operation(summary = "更新接口状态") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("systemData.dataInterface") + @PutMapping("/{id}/Actions/State") + public ActionResult update(@PathVariable("id") String id) throws DataException { + DataInterfaceEntity entity = dataInterfaceService.getInfo(id); + if (entity != null) { + if (entity.getEnabledMark() == 0) { + entity.setEnabledMark(1); + } else { + entity.setEnabledMark(0); + } + dataInterfaceService.update(entity, id); + return ActionResult.success(MsgCode.SU014.get()); + } + return ActionResult.fail(MsgCode.FA001.get()); + } + + /** + * 获取接口分页数据 + * + * @param id 主键 + * @param page 分页参数 + * @return + */ + @Operation(summary = "获取接口分页数据") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "page", description = "分页参数", required = true) + }) + @PostMapping("/{id}/Actions/List") + public ActionResult infoToIdPageList(@PathVariable("id") String id, @RequestBody DataInterfacePage page) { + ActionResult result = dataInterfaceService.infoToIdPageList(id, page); + return result; + } + + /** + * 获取接口详情数据 + * + * @param id 主键 + * @param page 分页参数 + * @return + */ + @Operation(summary = "获取接口详情数据") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "page", description = "分页参数", required = true) + }) + @PostMapping("/{id}/Actions/InfoByIds") + public ActionResult>> infoByIds(@PathVariable("id") String id, @RequestBody DataInterfacePage page) { + List> data = dataInterfaceService.infoToInfo(id, page); + return ActionResult.success(data); + } + + /** + * 测试接口 + * + * @param id 主键 + * @param objectMap 参数、参数值对象 + * @return + */ + @Operation(summary = "测试接口") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "objectMap", description = "参数、参数值对象") + }) + @PostMapping("/{id}/Actions/Preview") + @NoDataSourceBind + public ActionResult callPreview(@PathVariable("id") String id, @RequestBody(required = false) Map objectMap) { + DataInterfaceParamModel model = JsonUtil.getJsonToBean(objectMap, DataInterfaceParamModel.class); + Map map = null; + if (model != null) { + if (configValueUtil.isMultiTenancy()) { + //切换成租户库 + try{ + TenantDataSourceUtil.switchTenant(model.getTenantId()); + }catch (Exception e){ + return ActionResult.fail(ActionResultCode.SessionOverdue.getMessage()); + } + } + if (model.getParamList() != null && model.getParamList().size() > 0) { + map = new HashMap<>(16); + List jsonToList = JsonUtil.getJsonToList(model.getParamList(), DataInterfaceModel.class); + dataInterfaceService.paramSourceTypeReplaceValue(jsonToList, map); + } + } + ActionResult actionResult = dataInterfaceService.infoToId(id, null, map); + if (actionResult.getCode() == 200) { + actionResult.setMsg(MsgCode.SYS007.get()); + } + return actionResult; + } + + /** + * 访问接口GET + * + * @param id 主键 + * @param map 参数、参数值对象 + * @return + */ + @Operation(summary = "访问接口GET") + @GetMapping("/{id}/Actions/Response") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "map", description = "参数、参数值对象") + }) + @NoDataSourceBind + public ActionResult getResponse(@PathVariable("id") String id,@RequestParam(required = false) Map map) { + DataInterfaceActionModel entity; + try{ + entity= dataInterfaceService.checkParams(map); + entity.setInvokType("GET"); + }catch (Exception e){ + return ActionResult.fail(e.getMessage()); + } + String name = null; + if (configValueUtil.isMultiTenancy()) { + //切换成租户库 + try{ + TenantDataSourceUtil.switchTenant(entity.getTenantId()); + }catch (Exception e){ + return ActionResult.fail(ActionResultCode.SessionOverdue.getMessage()); + } + } + return dataInterfaceService.infoToIdNew(id, name, entity); + } + + /** + * 访问接口POST + * + * @param id 主键 + * @param map 参数、参数值对象 + * @return + */ + @Operation(summary = "访问接口POST") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "map", description = "参数、参数值对象") + }) + @PostMapping("/{id}/Actions/Response") + @NoDataSourceBind + public ActionResult postResponse(@PathVariable("id") String id, @RequestBody(required = false) Map map) { + DataInterfaceActionModel entity; + try{ + entity= dataInterfaceService.checkParams(map); + entity.setInvokType("POST"); + }catch (Exception e){ + return ActionResult.fail(e.getMessage()); + } + String name = null; + if (configValueUtil.isMultiTenancy()) { + //切换成租户库 + try{ + TenantDataSourceUtil.switchTenant(entity.getTenantId()); + }catch (Exception e){ + return ActionResult.fail(ActionResultCode.SessionOverdue.getMessage()); + } + } + return dataInterfaceService.infoToIdNew(id, name, entity); + } + + /** + * 外部接口获取authorization + * + * @param appId 应用id + * @param intefaceId 接口id + * @param map 参数、参数值对象 + * @return + */ + @Operation(summary = "外部接口获取authorization") + @Parameters({ + @Parameter(name = "appId", description = "应用id", required = true), + @Parameter(name = "intefaceId", description = "接口id"), + @Parameter(name = "map", description = "参数、参数值对象") + }) + @PostMapping("/Actions/GetAuth") + @NoDataSourceBind + public ActionResult getAuthorization(@RequestParam("appId") String appId,@RequestParam("intefaceId") String intefaceId, @RequestBody(required = false) Map map) { + InterfaceOauthEntity infoByAppId = interfaceOauthService.getInfoByAppId(appId); + if(infoByAppId==null){ + return ActionResult.fail(MsgCode.SYS127.get()); + } + Map authorization = InterfaceUtil.getAuthorization(intefaceId,appId,infoByAppId.getAppSecret(), map); + return ActionResult.success(MsgCode.SU005.get(),authorization); + } + + /** + * 数据接口导出功能 + * + * @param id 接口id + */ + @Operation(summary = "导出数据接口数据") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("systemData.dataInterface") + @GetMapping("/{id}/Actions/Export") + public ActionResult exportFile(@PathVariable("id") String id) { + DataInterfaceEntity entity = dataInterfaceService.getInfo(id); + //导出文件 + DownloadVO downloadVO = fileExport.exportFile(entity, configValueUtil.getTemporaryFilePath(), entity.getFullName(), ModuleTypeEnum.SYSTEM_DATAINTEFASE.getTableName()); + return ActionResult.success(downloadVO); + } + + /** + * 数据接口导入功能 + * + * @param multipartFile + * @return + * @throws DataException + */ + @Operation(summary = "数据接口导入功能") + @SaCheckPermission("systemData.dataInterface") + @PostMapping(value = "/Actions/Import", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ActionResult importFile(@RequestPart("file") MultipartFile multipartFile, + @RequestParam("type") Integer type) throws DataException { + //判断是否为.json结尾 + if (FileUtil.existsSuffix(multipartFile, ModuleTypeEnum.SYSTEM_DATAINTEFASE.getTableName())) { + return ActionResult.fail(MsgCode.IMP002.get()); + } + try { + //读取文件内容 + String fileContent = FileUtil.getFileContent(multipartFile); + DataInterfaceEntity entity = JsonUtil.getJsonToBean(fileContent, DataInterfaceEntity.class); + // 验证数据是否正常 + if (dictionaryDataService.getInfo(entity.getCategory()) == null) { + return ActionResult.fail(MsgCode.IMP004.get()); + } + StringJoiner stringJoiner = new StringJoiner("、"); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DataInterfaceEntity::getId, entity.getId()); + if (dataInterfaceService.count(queryWrapper) > 0) { + if (Objects.equals(type, 0)) { + stringJoiner.add("ID"); + } else { + entity.setId(RandomUtil.uuId()); + } + } + queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DataInterfaceEntity::getEnCode, entity.getEnCode()); + if (dataInterfaceService.count(queryWrapper) > 0) { + stringJoiner.add(MsgCode.IMP009.get()); + } + queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DataInterfaceEntity::getFullName, entity.getFullName()); + if (dataInterfaceService.count(queryWrapper) > 0) { + stringJoiner.add(MsgCode.IMP008.get()); + } + if (stringJoiner.length() > 0 && ObjectUtil.equal(type, 1)) { + String copyNum = UUID.randomUUID().toString().substring(0, 5); + entity.setFullName(entity.getFullName() + ".副本" + copyNum); + entity.setEnCode(entity.getEnCode() + copyNum); + } else if (ObjectUtil.equal(type, 0) && stringJoiner.length() > 0) { + return ActionResult.fail(stringJoiner.toString() + MsgCode.IMP007.get()); + } + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(UserProvider.getLoginUserId()); + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + try { + dataInterfaceService.setIgnoreLogicDelete().removeById(entity); + entity.setEnabledMark(0); + dataInterfaceService.setIgnoreLogicDelete().saveOrUpdate(entity); + } catch (Exception e) { + throw new DataException(MsgCode.IMP003.get()); + }finally { + dataInterfaceService.clearIgnoreLogicDelete(); + } + return ActionResult.success(MsgCode.IMP001.get()); + } catch (Exception e) { + return ActionResult.fail(MsgCode.IMP004.get()); + } + } + + + /** + * 获取接口字段 + * + * @param id 主键 + * @param objectMap 参数、参数值 + * @return + */ + @Operation(summary = "获取接口字段") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "objectMap", description = "参数、参数值") + }) + @PostMapping("/{id}/Actions/GetFields") + public ActionResult getFields(@PathVariable("id") String id, @RequestBody(required = false) Map objectMap) { + DataInterfacePage model = JsonUtil.getJsonToBean(objectMap, DataInterfacePage.class); + ActionResult actionResult = dataInterfaceService.infoToIdPageList(id, model); + if (actionResult.getCode() == 200) { + try{ + Object data = actionResult.getData(); + if (data instanceof List) { + List> list=(List)data; + List listKey=new ArrayList(); + for(String key:list.get(0).keySet()){ + listKey.add(key); + } + actionResult.setData(listKey); + }else{ + Map map=JsonUtil.stringToMap(JSONObject.toJSONString(data, SerializerFeature.WriteMapNullValue)); + List> list=(List)map.get("list"); + List listKey=new ArrayList(); + for(String key:list.get(0).keySet()){ + listKey.add(key); + } + actionResult.setData(listKey); + } + }catch (Exception e){ + return ActionResult.fail(MsgCode.SYS008.get()); + } + } + return actionResult; + } + /** + * 复制数据接口 + * + * @param id 数据接口ID + * @return 执行结构 + * @throws DataException ignore + */ + @Operation(summary = "复制数据接口") + @Parameters({ + @Parameter(name = "id", description = "数据接口ID", required = true) + }) + @SaCheckPermission("systemData.dataInterface") + @PostMapping("/{id}/Actions/Copy") + public ActionResult Copy(@PathVariable("id") String id) throws DataException { + String copyNum = UUID.randomUUID().toString().substring(0, 5); + DataInterfaceEntity entity = dataInterfaceService.getInfo(id); + entity.setFullName(entity.getFullName() + ".副本" + copyNum); + if(entity.getFullName().length() > 50) return ActionResult.fail(MsgCode.COPY001.get()); + entity.setEnCode(entity.getEnCode() + copyNum); + entity.setEnabledMark(0); + dataInterfaceService.create(entity); + return ActionResult.success(MsgCode.SU007.get()); + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/DataInterfaceLogController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/DataInterfaceLogController.java new file mode 100644 index 0000000..13c677c --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/DataInterfaceLogController.java @@ -0,0 +1,69 @@ +package com.yunzhupaas.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.entity.DataInterfaceLogEntity; +import com.yunzhupaas.base.model.datainterface.DataInterfaceLogVO; +import com.yunzhupaas.base.service.DataInterfaceLogService; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.JsonUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * 数据接口调用日志控制器 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-06-03 + */ +@Tag(description = "DataInterfaceLog", name = "数据接口调用日志") +@RestController +@RequestMapping("/api/system/DataInterfaceLog") +public class DataInterfaceLogController extends SuperController { + @Autowired + private DataInterfaceLogService dataInterfaceLogService; + @Autowired + private UserService userService; + + /** + * 获取数据接口调用日志列表 + * + * @param id 主键 + * @param pagination 分页参数 + * @return ignore + */ + @Operation(summary = "获取数据接口调用日志列表") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("systemData.dataInterface") + @GetMapping("{id}") + public ActionResult> getList(@PathVariable("id") String id, Pagination pagination) { + List list = dataInterfaceLogService.getList(id, pagination); + List voList = JsonUtil.getJsonToList(list, DataInterfaceLogVO.class); + for (DataInterfaceLogVO vo : voList) { + UserEntity entity = userService.getInfo(vo.getUserId()); + if (entity != null) { + vo.setUserId(entity.getRealName() + "/" + entity.getAccount()); + } + } + PaginationVO vo = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(voList, vo); + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/DataInterfaceVariateController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/DataInterfaceVariateController.java new file mode 100644 index 0000000..84031cc --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/DataInterfaceVariateController.java @@ -0,0 +1,272 @@ +package com.yunzhupaas.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.Page; +import com.yunzhupaas.base.entity.DataInterfaceEntity; +import com.yunzhupaas.base.entity.DataInterfaceVariateEntity; +import com.yunzhupaas.base.model.datainterfacevariate.DataInterfaceVariateListVO; +import com.yunzhupaas.base.model.datainterfacevariate.DataInterfaceVariateModel; +import com.yunzhupaas.base.model.datainterfacevariate.DataInterfaceVariateSelectorVO; +import com.yunzhupaas.base.model.datainterfacevariate.DataInterfaceVariateVO; +import com.yunzhupaas.base.service.DataInterfaceService; +import com.yunzhupaas.base.service.DataInterfaceVariateService; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.emnus.ModuleTypeEnum; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; +import java.util.stream.Collectors; + +/** + * 数据接口变量 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-03-15 10:29 + */ +@Tag(name = "数据接口变量", description = "DataInterfaceVariate") +@RestController +@RequestMapping(value = "/api/system/DataInterfaceVariate") +public class DataInterfaceVariateController { + + @Autowired + private DataInterfaceVariateService dataInterfaceVariateService; + @Autowired + private UserService userApi; + @Autowired + private DataInterfaceService dataInterfaceService; + @Autowired + private DataFileExport fileExport; + @Autowired + private ConfigValueUtil configValueUtil; + + /** + * 获取数据接口变量 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取数据接口变量") + @SaCheckPermission("systemData.dataInterface") + @Parameter(name = "id", description = "自然主键") + @GetMapping("/{id}") + public ActionResult> list(@PathVariable("id") String id, Page page) { + List list = new ArrayList<>(); + List data = dataInterfaceVariateService.getList(id, page); + data.forEach(t -> { + DataInterfaceVariateListVO vo = new DataInterfaceVariateListVO(); + vo.setId(t.getId()); + vo.setInterfaceId(t.getInterfaceId()); + vo.setFullName(t.getFullName()); + vo.setValue(t.getValue()); + vo.setCreatorTime(t.getCreatorTime() != null ? t.getCreatorTime().getTime() : null); + vo.setLastModifyTime(t.getLastModifyTime() != null ? t.getLastModifyTime().getTime() : null); + UserEntity userEntity = userApi.getInfo(t.getCreatorUserId()); + vo.setCreatorUser(userEntity != null ? userEntity.getRealName() + "/" + userEntity.getAccount() : null); + list.add(vo); + }); + ListVO listVO = new ListVO<>(); + listVO.setList(list); + return ActionResult.success(listVO); + } + + /** + * 下拉列表 + * + * @return + */ + @Operation(summary = "下拉列表") + @SaCheckPermission("systemData.dataInterface") + @GetMapping("/Selector") + public ActionResult> selector() { + List data = dataInterfaceVariateService.getList(null, null); + List list = dataInterfaceService.getList(data.stream().map(DataInterfaceVariateEntity::getInterfaceId).collect(Collectors.toList())); + List jsonToList = JsonUtil.getJsonToList(list, DataInterfaceVariateSelectorVO.class); + jsonToList.forEach(t -> { + t.setParentId("-1"); + t.setType(0); + }); + jsonToList.forEach(t -> { + List collect = data.stream().filter(variateEntity -> t.getId().equals(variateEntity.getInterfaceId())).collect(Collectors.toList()); + List selectorVOS = JsonUtil.getJsonToList(collect, DataInterfaceVariateSelectorVO.class); + selectorVOS.forEach(selectorVO -> { + selectorVO.setParentId(t.getId()); + selectorVO.setType(1); + }); + t.setChildren(selectorVOS); + }); + return ActionResult.success(jsonToList); + } + + /** + * 详情 + * + * @param id 主键 + * @return + */ + @Operation(summary = "详情") + @SaCheckPermission("systemData.dataInterface") + @Parameter(name = "id", description = "自然主键") + @GetMapping("/{id}/Info") + public ActionResult info(@PathVariable("id") String id) { + DataInterfaceVariateEntity entity = dataInterfaceVariateService.getInfo(id); + DataInterfaceVariateVO vo = JsonUtil.getJsonToBean(entity, DataInterfaceVariateVO.class); + return ActionResult.success(vo); + } + + /** + * 导出 + * + * @param id 自然主键 + * @return + */ + @Operation(summary = "导出") + @SaCheckPermission("systemData.dataInterface") + @Parameter(name = "id", description = "自然主键") + @GetMapping("/{id}/Actions/Export") + public ActionResult export(@PathVariable("id") String id) { + DataInterfaceVariateEntity entity = dataInterfaceVariateService.getInfo(id); + DownloadVO downloadVO = fileExport.exportFile(entity, configValueUtil.getTemporaryFilePath(), entity.getFullName(), ModuleTypeEnum.SYSTEM_DATAINTEFASE_VARIATE.getTableName()); + return ActionResult.success(downloadVO); + } + + /** + * 添加 + * + * @param dataInterfaceVariateModel 模型 + * @return + */ + @Operation(summary = "添加") + @SaCheckPermission("systemData.dataInterface") + @Parameter(name = "dataInterfaceVariateModel", description = "模型") + @PostMapping + public ActionResult create(@RequestBody DataInterfaceVariateModel dataInterfaceVariateModel) { + DataInterfaceVariateEntity entity = JsonUtil.getJsonToBean(dataInterfaceVariateModel, DataInterfaceVariateEntity.class); + if (entity.getFullName().contains("@")) { + return ActionResult.fail(MsgCode.SYS009.get()); + } + if (dataInterfaceVariateService.isExistByFullName(entity)) { + return ActionResult.fail(MsgCode.SYS010.get()); + } + dataInterfaceVariateService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 修改 + * + * @param id 自然主键 + * @param dataInterfaceVariateModel 模型 + * @return + */ + @Operation(summary = "修改") + @SaCheckPermission("systemData.dataInterface") + @Parameters({ + @Parameter(name = "id", description = "自然主键"), + @Parameter(name = "dataInterfaceVariateModel", description = "模型") + }) + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody DataInterfaceVariateModel dataInterfaceVariateModel) { + DataInterfaceVariateEntity entity = JsonUtil.getJsonToBean(dataInterfaceVariateModel, DataInterfaceVariateEntity.class); + if (entity.getFullName().contains("@")) { + return ActionResult.fail(MsgCode.SYS009.get()); + } + entity.setId(id); + if (dataInterfaceVariateService.isExistByFullName(entity)) { + return ActionResult.fail(MsgCode.SYS010.get()); + } + dataInterfaceVariateService.update(entity); + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除 + * + * @param id 自然主键 + * @return + */ + @Operation(summary = "删除") + @SaCheckPermission("systemData.dataInterface") + @Parameters({ + @Parameter(name = "id", description = "自然主键") + }) + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + DataInterfaceVariateEntity entity = dataInterfaceVariateService.getInfo(id); + if (entity == null) { + return ActionResult.fail(MsgCode.FA001.get()); + } + dataInterfaceVariateService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + + /** + * 导入 + * + * @param multipartFile 文件 + * @return + */ + @Operation(summary = "导入") + @SaCheckPermission("systemData.dataInterface") + @PostMapping(value = "/Actions/Import", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ActionResult delete(@RequestPart("file") MultipartFile multipartFile) { + //判断是否为.json结尾 + if (FileUtil.existsSuffix(multipartFile, ModuleTypeEnum.SYSTEM_DATAINTEFASE_VARIATE.getTableName())) { + return ActionResult.fail(MsgCode.IMP002.get()); + } + //读取文件内容 + String fileContent = FileUtil.getFileContent(multipartFile); + try { + DataInterfaceVariateEntity entity = JsonUtil.getJsonToBean(fileContent, DataInterfaceVariateEntity.class); + if (dataInterfaceVariateService.getInfo(entity.getId()) == null && + !dataInterfaceVariateService.isExistByFullName(entity)) { + dataInterfaceVariateService.create(entity); + return ActionResult.success(MsgCode.IMP001.get()); + } + } catch (Exception e) { + throw new DataException(MsgCode.IMP004.get()); + } + return ActionResult.fail(MsgCode.IMP003.get()); + } + + /** + * 复制 + * + * @param id 自然主键 + * @return + */ + @Operation(summary = "复制") + @SaCheckPermission("systemData.dataInterface") + @Parameter(name = "id", description = "自然主键", required = true) + @PostMapping("/{id}/Actions/Copy") + public ActionResult copy(@PathVariable("id") String id) { + String copyNum = UUID.randomUUID().toString().substring(0, 5); + DataInterfaceVariateEntity entity = dataInterfaceVariateService.getInfo(id); + entity.setFullName(entity.getFullName() + ".副本" + copyNum); + if(entity.getFullName().length() > 50) return ActionResult.fail(MsgCode.COPY001.get()); + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + dataInterfaceVariateService.create(entity); + return ActionResult.success(MsgCode.SU007.get()); + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/DataSetController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/DataSetController.java new file mode 100644 index 0000000..eb017c6 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/DataSetController.java @@ -0,0 +1,287 @@ +package com.yunzhupaas.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaMode; +import cn.dev33.satoken.stp.StpUtil; +import cn.hutool.core.util.ObjectUtil; +import com.google.common.collect.ImmutableList; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.entity.DataInterfaceEntity; +import com.yunzhupaas.base.entity.DataSetEntity; +import com.yunzhupaas.base.model.datainterface.DataInterfaceModel; +import com.yunzhupaas.base.model.dataset.*; +import com.yunzhupaas.base.service.DataInterfaceService; +import com.yunzhupaas.base.service.DataSetService; +import com.yunzhupaas.base.util.dataSet.DataSetConstant; +import com.yunzhupaas.base.util.dataSet.DataSetSwapUtil; +import com.yunzhupaas.constant.DataInterfaceVarConst; +import com.yunzhupaas.constant.DbSensitiveConstant; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.model.visualJson.FieLdsModel; +import com.yunzhupaas.model.visualJson.config.ConfigModel; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.ParameterUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.treeutil.SumTree; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.*; + +/** + * 数据集控制器 + * + * @author 云筑产品开发平台组 + * @version v5.0.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/5/7 10:09:18 + */ +@Tag(name = "数据集", description = "DataSet") +@RestController +@RequestMapping("/api/system/DataSet") +public class DataSetController { + + @Autowired + private DataSetService dataSetService; + @Autowired + private DataSetSwapUtil dataSetSwapUtil; + @Autowired + private DataInterfaceService dataInterfaceService; + + @Operation(summary = "列表") + @SaCheckPermission(value = { "onlineDev.printDev", "onlineDev.report" }, mode = SaMode.OR) + @GetMapping + public ActionResult>> list(DataSetPagination pagination) throws Exception { + List list = dataSetService.getList(pagination); + List> res = new ArrayList<>(); + for (DataSetEntity item : list) { + if (StringUtil.isNotEmpty(ParameterUtil.checkContainsSensitive(item.getDataConfigJson(), + DbSensitiveConstant.PRINT_SENSITIVE))) { + return ActionResult.fail(MsgCode.SYS047.get()); + } + // if (!item.getDataConfigJson().contains("@formId")) { + // return ActionResult.fail(MsgCode.SYS048.get()); + // } + SumTree printTableFields = dataSetService.getTabFieldStruct(item); + res.add(printTableFields); + } + return ActionResult.success(res); + } + + @Operation(summary = "获取字段") + @SaCheckPermission(value = { "onlineDev.printDev", "onlineDev.report" }, mode = SaMode.OR) + @PostMapping("/fields") + public ActionResult>> getOneFields(@RequestBody DataSetForm form) throws Exception { + DataSetEntity item = JsonUtil.getJsonToBean(form, DataSetEntity.class); + SumTree printTableFields = dataSetService.getTabFieldStruct(item); + return ActionResult.success(printTableFields.getChildren()); + } + + @Operation(summary = "获取数据") + @PostMapping("/Data") + public ActionResult getData(@RequestBody DataSetQuery query) { + String moduleId = query.getModuleId(); + StpUtil.checkPermissionOr(moduleId, "onlineDev.report"); + Map dataMapOrList = dataSetService.getDataList(query); + String id = query.getId(); + String convertConfig = query.getConvertConfig(); + Map>> resultData = new HashMap<>(); + dataSetSwapUtil.swapData(id, convertConfig, dataMapOrList); + for (String key : dataMapOrList.keySet()) { + if (dataMapOrList.get(key) instanceof List) { + List> list = (List>) dataMapOrList.get(key); + resultData.put(key, list); + } + } + return ActionResult.success(resultData); + } + + @Operation(summary = "参数转换") + @PostMapping("/parameterData") + public ActionResult getParameterData(@RequestBody DataSetQuery query) { + String moduleId = query.getModuleId(); + StpUtil.checkPermissionOr(moduleId, "onlineDev.report"); + Map queryMap = query.getMap() != null ? query.getMap() : new HashMap<>(); + List queryList = StringUtil.isNotEmpty(query.getQueryList()) + ? JsonUtil.getJsonToList(query.getQueryList(), FieLdsModel.class) + : new ArrayList<>(); + Map> dataMap = new HashMap<>(); + List systemId = ImmutableList.of( + DataInterfaceVarConst.USER, DataInterfaceVarConst.USERANDSUB, DataInterfaceVarConst.ORG, + DataInterfaceVarConst.ORGANDSUB, DataInterfaceVarConst.CHARORG, DataInterfaceVarConst.ID); + List convertList = new ArrayList<>(); + List dataInterfaceList = new ArrayList<>(); + for (String id : systemId) { + DataInterfaceModel model = new DataInterfaceModel(); + model.setField(id); + model.setSourceType(4); + model.setRelationField(id); + model.setDefaultValue( + StringUtil.isNotEmpty(query.getSnowFlakeId()) ? query.getSnowFlakeId() : RandomUtil.uuId()); + dataInterfaceList.add(model); + DataSetSwapModel swapModel = new DataSetSwapModel(); + switch (id) { + case DataInterfaceVarConst.USER: + case DataInterfaceVarConst.USERANDSUB: + swapModel.setType(DataSetConstant.KEY_USER); + break; + case DataInterfaceVarConst.ORGANDSUB: + case DataInterfaceVarConst.CHARORG: + case DataInterfaceVarConst.ORG: + swapModel.setType(DataSetConstant.KEY_DEP); + default: + break; + } + swapModel.setField(id + "." + id); + swapModel.setConfig(new DataSetConfig()); + convertList.add(swapModel); + } + Map paramSystemMap = new HashMap<>(); + dataInterfaceService.paramSourceTypeReplaceValue(dataInterfaceList, paramSystemMap); + for (String key : paramSystemMap.keySet()) { + String value = paramSystemMap.get(key); + Object systemValue = Objects.equals(DataInterfaceVarConst.ID, key) ? value + : JsonUtil.getObjectToString(value.split(",")); + Map systemMap = new HashMap<>(); + systemMap.put(key, systemValue); + dataMap.put(key, systemMap); + } + for (String key : queryMap.keySet()) { + String vModel = key.replace("-", "."); + String[] name = key.split("-"); + FieLdsModel fieLdsModel = queryList.stream().filter(t -> Objects.equals(t.getVModel(), vModel)).findFirst() + .orElse(null); + if (fieLdsModel != null) { + // 转换配置 + ConfigModel config = fieLdsModel.getConfig(); + String type = fieLdsModel.getType(); + DataSetConfig dataSetConfig = new DataSetConfig(); + dataSetConfig.setDataType(config.getDataType()); + dataSetConfig.setOptions(JsonUtil.getJsonToList(config.getOptions(), DataSetOptions.class)); + dataSetConfig.setDictionaryType(config.getDictionaryType()); + dataSetConfig.setPropsValue(config.getPropsValue()); + dataSetConfig.setFormat(config.getFormat()); + Object value = queryMap.get(key); + switch (type) { + case YunzhupaasKeyConsts.NUM_INPUT: + type = DataSetConstant.KEY_NUMBER; + break; + case YunzhupaasKeyConsts.COMSELECT: + type = DataSetConstant.KEY_ORG; + if (value instanceof List) { + value = JsonUtil.getObjectToString(value); + } + break; + case YunzhupaasKeyConsts.DEPSELECT: + type = DataSetConstant.KEY_DEP; + if (value instanceof List) { + value = JsonUtil.getObjectToString(value); + } + break; + case YunzhupaasKeyConsts.ROLESELECT: + type = DataSetConstant.KEY_ROLE; + if (value instanceof List) { + value = JsonUtil.getObjectToString(value); + } + break; + case YunzhupaasKeyConsts.POSSELECT: + type = DataSetConstant.KEY_POS; + if (value instanceof List) { + value = JsonUtil.getObjectToString(value); + } + break; + case YunzhupaasKeyConsts.USERSELECT: + type = DataSetConstant.KEY_USERS; + if (value instanceof List) { + value = JsonUtil.getObjectToString(value); + } + break; + case YunzhupaasKeyConsts.GROUPSELECT: + type = DataSetConstant.KEY_GROUP; + if (value instanceof List) { + value = JsonUtil.getObjectToString(value); + } + break; + } + + DataSetSwapModel swapModel = new DataSetSwapModel(); + swapModel.setType(type); + swapModel.setField(fieLdsModel.getVModel()); + swapModel.setConfig(dataSetConfig); + convertList.add(swapModel); + // 数据 + String model = name[0]; + Map map = dataMap.get(model) != null ? dataMap.get(model) : new HashMap<>(); + map.put(name[1], value); + dataMap.put(model, map); + } + } + String convertConfig = JsonUtil.getObjectToString(convertList); + Map dataMapOrList = new HashMap<>(); + for (String key : dataMap.keySet()) { + List> dataList = new ArrayList<>(); + dataList.add(dataMap.get(key)); + dataMapOrList.put(key, dataList); + } + dataSetSwapUtil.swapData(RandomUtil.uuId(), convertConfig, dataMapOrList); + return ActionResult.success(dataMap); + } + + @Operation(summary = "列表") + @SaCheckPermission(value = { "onlineDev.printDev", "onlineDev.report" }, mode = SaMode.OR) + @GetMapping("/getList") + public ActionResult> getList(DataSetPagination pagination) { + List list = dataSetService.getList(pagination); + List dataSetInfoList = new ArrayList<>(); + if (ObjectUtil.isNotEmpty(list)) { + for (DataSetEntity item : list) { + DataSetInfo bean = JsonUtil.getJsonToBean(item, DataSetInfo.class); + try { + SumTree printTableFields = dataSetService.getTabFieldStruct(item); + bean.setChildren(printTableFields.getChildren()); + dataSetInfoList.add(bean); + } catch (Exception e) { + e.printStackTrace(); + } + if (Objects.equals(item.getType(), 3)) { + DataInterfaceEntity info = dataInterfaceService.getInfo(item.getInterfaceId()); + if (info != null) { + bean.setTreePropsName(info.getFullName()); + } + } + } + } + return ActionResult.success(dataSetInfoList); + } + + @Operation(summary = "批量保存") + @Parameters({ + @Parameter(name = "form", description = "数据集表单") + }) + @SaCheckPermission(value = { "onlineDev.printDev", "onlineDev.report" }, mode = SaMode.OR) + @PostMapping("/save") + public ActionResult saveList(@RequestBody DataForm form) { + List list = form.getList() != null ? form.getList() : new ArrayList<>(); + dataSetService.create(JsonUtil.getJsonToList(list, DataSetForm.class), form.getObjectType(), + form.getObjectId()); + return ActionResult.success(MsgCode.SU002.get()); + } + + @Operation(summary = "数据预览") + @SaCheckPermission(value = { "onlineDev.printDev", "onlineDev.report" }, mode = SaMode.OR) + @PostMapping("/getPreviewData") + public ActionResult getPreviewData(@RequestBody DataSetForm dataSetForm) { + if (Objects.equals(dataSetForm.getType(), 3)) { + DataSetViewInfo info = dataSetService.getPreviewDataInterface(dataSetForm); + return ActionResult.success(info); + } + DataSetViewInfo info = dataSetService.getPreviewData(dataSetForm); + return ActionResult.success(info); + } +} diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/DbLinkController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/DbLinkController.java new file mode 100644 index 0000000..29f3718 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/DbLinkController.java @@ -0,0 +1,277 @@ +package com.yunzhupaas.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import com.yunzhupaas.base.controller.SuperController; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.entity.SuperBaseEntity; +import com.yunzhupaas.base.model.dblink.*; +import com.yunzhupaas.base.service.DbLinkService; +import com.yunzhupaas.base.service.DictionaryDataService; +import com.yunzhupaas.base.service.DictionaryTypeService; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.database.model.entity.DbLinkEntity; +import com.yunzhupaas.database.util.DataSourceUtil; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.XSSEscape; +import com.yunzhupaas.util.enums.DictionaryDataEnum; +import com.yunzhupaas.util.treeutil.SumTree; +import com.yunzhupaas.util.treeutil.newtreeutil.TreeDotUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 数据连接 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Tag(name = "数据连接", description = "DataSource") +@RestController +@RequestMapping("/api/system/DataSource") +public class DbLinkController extends SuperController { + + @Autowired + private DbLinkService dblinkService; + @Autowired + private UserService userService; + @Autowired + private DictionaryDataService dictionaryDataService; + @Autowired + private DictionaryTypeService dictionaryTypeService; + @Autowired + private DataSourceUtil dataSourceUtil; + + /** + * 列表 + * + * @param type 类型 + * @return + */ + @GetMapping("/Selector") + @Operation(summary = "获取数据连接下拉框列表") + public ActionResult> selectorList(String type) { + List modelAll = new LinkedList<>(); + List dbLinkList = dblinkService.getList(); + List dictionaryDataList = dictionaryDataService.getList(dictionaryTypeService.getInfoByEnCode(DictionaryDataEnum.SYSTEM_DBLINK.getDictionaryTypeId()).getId()); + // 1、连接中字典目录 + for (DictionaryDataEntity entity : dictionaryDataList) { + long num = dbLinkList.stream().filter(t -> t.getDbType().equals(entity.getEnCode())).count(); + if (num > 0){ + DbLinkModel model = new DbLinkModel(); + model.setNum(num); + model.setFullName(entity.getFullName()); + model.setParentId("-1"); + model.setId(entity.getId()); + modelAll.add(model); + } + } + // 2、字典中的连接集合 + for (DbLinkEntity entity : dbLinkList) { + dictionaryDataList.stream().filter(t -> t.getEnCode().equals(entity.getDbType())).findFirst().ifPresent((dataEntity)->{ + DbLinkModel model = JsonUtil.getJsonToBean(entity, DbLinkModel.class); + model.setParentId(dataEntity.getId()); + modelAll.add(model); + }); + } + List> trees = TreeDotUtils.convertListToTreeDot(modelAll.stream().sorted(Comparator.comparing(DbLinkModel::getFullName)).collect(Collectors.toList())); + List list = new ArrayList<>(); + // type为空时返回默认库 + if(type == null){ + DbLinkListVO dbLink = new DbLinkListVO(); + dbLink.setFullName("默认数据库"); + dbLink.setId("0"); + dbLink.setDbType(dataSourceUtil.getDbType()); + DbLinkSelectorListVO defaultDb = new DbLinkSelectorListVO(); + defaultDb.setFullName(""); + defaultDb.setChildren(Collections.singletonList(dbLink)); + list.add(defaultDb); + } + list.addAll(JsonUtil.getJsonToList(trees, DbLinkSelectorListVO.class)); + return ActionResult.success(new ListVO<>(list)); + } + + /** + * 2:列表 + * + * @param page 关键字 + * @return ignore + */ + @GetMapping + @Operation(summary = "获取数据连接列表") + public ActionResult> getList(PaginationDbLink page) { + List data = dblinkService.getList(page); + List userId = data.stream().map(SuperBaseEntity.SuperCBaseEntity::getCreatorUserId).collect(Collectors.toList()); + List lastUserId = data.stream().map(SuperBaseEntity.SuperCUBaseEntity::getLastModifyUserId).collect(Collectors.toList()); + List userEntities = userService.getUserName(userId); + List lastUserIdEntities = userService.getUserName(lastUserId); + List typeList = dictionaryDataService.getList(dictionaryTypeService.getInfoByEnCode(DictionaryDataEnum.SYSTEM_DBLINK.getDictionaryTypeId()).getId()); + List jsonToList = JsonUtil.getJsonToList(data, DbLinkListVO.class); + for (DbLinkListVO vo : jsonToList) { + //存在类型的字典对象 + DictionaryDataEntity dataEntity = typeList.stream().filter(t -> t.getEnCode().equals(vo.getDbType())).findFirst().orElse(null); + if (dataEntity != null) { + vo.setDbType(dataEntity.getFullName()); + } else { + vo.setDbType(""); + } + //创建者 + UserEntity creatorUser = userEntities.stream().filter(t -> t.getId().equals(vo.getCreatorUser())).findFirst().orElse(null); + vo.setCreatorUser(creatorUser != null ? creatorUser.getRealName() + "/" + creatorUser.getAccount() : vo.getCreatorUser()); + //修改人 + UserEntity lastModifyUser = lastUserIdEntities.stream().filter(t -> t.getId().equals(vo.getLastModifyUser())).findFirst().orElse(null); + vo.setLastModifyUser(lastModifyUser != null ? lastModifyUser.getRealName() + "/" + lastModifyUser.getAccount() : vo.getLastModifyUser()); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(page, PaginationVO.class); + return ActionResult.page(jsonToList , paginationVO); + } + + /** + * 列表分组 + * + * @param page 查询条件 + * @return 数据源分组列表 + */ + @GetMapping("/getGroup") + @Operation(summary = "获取数据连接列表") + public ActionResult>> getGroup(PaginationDbLink page) { + ActionResult> result = getList(page); + List voList = result.getData().getList(); + // host分组 + Set hostSet = voList.stream().sorted(Comparator.comparing(DbLinkListVO::getHost)) + .map(DbLinkListVO::getHost).collect(Collectors.toSet()); + List> groupList = new ArrayList<>(); + for (String host : hostSet) { + Map groupMap = new HashMap<>(); + groupMap.put("host", host); + groupMap.put("options", voList.stream().filter(vo->vo.getHost().equals(host)).toArray()); + groupList.add(groupMap); + } + return ActionResult.success(groupList); + } + + /** + * 3:单条数据连接 + * + * @param id 主键 + * @return ignore + * @throws DataException ignore + */ + @GetMapping("/{id}") + @Operation(summary = "获取数据连接") + @Parameters({ + @Parameter(name = "id", description = "主键") + }) + @SaCheckPermission("systemData.dataSource") + public ActionResult get(@PathVariable("id") String id) throws DataException { + return ActionResult.success(new DbLinkInfoVO().getDbLinkInfoVO(dblinkService.getInfo(XSSEscape.escape(id)))); + } + + /** + * 4:新建数据连接 + * + * @param dbLinkCreUpForm 新建数据连接表单对象 + * @return ignore + */ + @PostMapping + @Operation(summary = "添加数据连接") + @Parameters({ + @Parameter(name = "dbLinkCreUpForm", description = "新建数据连接表单对象", required = true) + }) + @SaCheckPermission("systemData.dataSource") + public ActionResult create(@RequestBody @Valid DbLinkCreUpForm dbLinkCreUpForm) { + DbLinkEntity entity = dbLinkCreUpForm.getDbLinkEntity(dbLinkCreUpForm); + if (dblinkService.isExistByFullName(entity.getFullName(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + dblinkService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 5:更新数据连接 + * + * @param id 主键 + * @param dbLinkCreUpForm dto实体 + * @return ignore + */ + @PutMapping("/{id}") + @Operation(summary = "修改数据连接") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "dbLinkCreUpForm", description = "新建数据连接表单对象", required = true) + }) + @SaCheckPermission("systemData.dataSource") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid DbLinkCreUpForm dbLinkCreUpForm) { + id = XSSEscape.escape(id); + DbLinkEntity entity = dbLinkCreUpForm.getDbLinkEntity(dbLinkCreUpForm); + if (dblinkService.isExistByFullName(entity.getFullName(), id)) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (!dblinkService.update(id, entity)) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 6:删除 + * + * @param id 主键 + * @return ignore + */ + @DeleteMapping("/{id}") + @Operation(summary = "删除数据连接") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("systemData.dataSource") + public ActionResult delete(@PathVariable("id") String id) { + DbLinkEntity entity = dblinkService.getInfo(id); + if (entity != null) { + dblinkService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + /** + * 7:测试连接 + * + * @param dbLinkBaseForm 数据连接参数 + * @return ignore + * @throws DataException ignore + */ + @PostMapping("/Actions/Test") + @Operation(summary = "测试连接") + @Parameters({ + @Parameter(name = "dbLinkBaseForm", description = "数据连接参数", required = true) + }) + @SaCheckPermission("systemData.dataSource") + public ActionResult test(@RequestBody DbLinkBaseForm dbLinkBaseForm) throws Exception { + boolean data = dblinkService.testDbConnection(dbLinkBaseForm.getDbLinkEntity(dbLinkBaseForm)); + if (data) { + return ActionResult.success(MsgCode.DB301.get()); + } else { + return ActionResult.fail(MsgCode.DB302.get()); + } + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/DbSyncController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/DbSyncController.java new file mode 100644 index 0000000..8c10bda --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/DbSyncController.java @@ -0,0 +1,291 @@ +package com.yunzhupaas.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import com.alibaba.fastjson.JSONObject; +import com.google.common.collect.ImmutableMap; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.model.dbsync.DbSyncForm; +import com.yunzhupaas.base.model.dbsync.DbSyncPrintForm; +import com.yunzhupaas.base.model.dbsync.DbSyncVo; +import com.yunzhupaas.base.service.DbLinkService; +import com.yunzhupaas.base.service.DbSyncService; +import com.yunzhupaas.base.service.DbTableService; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.database.datatype.db.interfaces.DtInterface; +import com.yunzhupaas.database.datatype.sync.util.DtSyncUtil; +import com.yunzhupaas.database.model.dbfield.DbFieldModel; +import com.yunzhupaas.database.model.dto.PrepSqlDTO; +import com.yunzhupaas.database.model.entity.DbLinkEntity; +import com.yunzhupaas.database.source.impl.DbOracle; +import com.yunzhupaas.database.sql.model.SqlPrintHandler; +import com.yunzhupaas.database.sql.param.FormatSqlOracle; +import com.yunzhupaas.database.sql.util.SqlFastUtil; +import com.yunzhupaas.database.util.DataSourceUtil; +import com.yunzhupaas.util.XSSEscape; +import lombok.Cleanup; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.io.File; +import java.sql.Connection; +import java.util.*; + +/** + * 数据同步 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Tag(name = "数据同步", description = "DataSync") +@RestController +@RequestMapping("/api/system/DataSync") +public class DbSyncController { + + @Autowired + private DbSyncService dbSyncService; + @Autowired + private DbLinkService dblinkService; + @Autowired + private DbTableService dbTableService; + @Autowired + private SqlPrintHandler sqlPrintHandler; + @Autowired + private DataSourceUtil dataSourceUtil; + + /** + * 验证连接 + * + * @param dbSyncForm 页面参数 + * @return + * @throws Exception + */ + @PostMapping("Actions/checkDbLink") + @Parameters({ + @Parameter(name = "dbSyncForm", description = "页面参数", required = true) + }) + @SaCheckPermission("systemData.dataSync") + @Operation(summary = "验证连接") + public ActionResult checkDbLink(@RequestBody DbSyncForm dbSyncForm) throws Exception { + String fromDbType; + String toDbType; + DbSyncVo vo = new DbSyncVo(); + try { + DbLinkEntity dbLinkEntity = dblinkService.getResource(dbSyncForm.getDbConnectionFrom()); + DbLinkEntity dbLinkEntity1 = dblinkService.getResource(dbSyncForm.getDbConnectionTo()); + fromDbType = dbLinkEntity.getDbType(); + toDbType = dbLinkEntity1.getDbType(); + @Cleanup Connection conn = PrepSqlDTO.getConn(dbLinkEntity); + @Cleanup Connection conn1 = PrepSqlDTO.getConn(dbLinkEntity1); + if (conn.getMetaData().getURL().equals(conn1.getMetaData().getURL())) { + return ActionResult.fail(MsgCode.SYS011.get()); + } + vo.setCheckDbFlag(true); + vo.setTableList(SqlFastUtil.getTableList(dbLinkEntity, null)); + // 字段类型全部对应关系 + Map> ruleMap = getConvertRules(fromDbType, toDbType).getData(); + Map defaultRuleMap = getDefaultRules(fromDbType, toDbType).getData(); + // 默认类型置顶 + for (String key : defaultRuleMap.keySet()) { + List list = ruleMap.get(key); + if(list != null){ + String rule = defaultRuleMap.get(key); + list.remove(rule); + list.add(0, rule + " (默认)"); + ruleMap.put(key, list); + } + } + vo.setConvertRuleMap(ruleMap); + }catch (Exception e){ + return ActionResult.fail(MsgCode.DB302.get()); + } + return ActionResult.success(vo); + } + + /** + * 执行数据同步 + * + * @param dbSyncForm 数据同步参数 + * @return ignore + * @throws Exception ignore + */ + @PostMapping + @Operation(summary = "数据同步校验") + @Parameters({ + @Parameter(name = "dbSyncForm", description = "页面参数", required = true) + }) + @SaCheckPermission("systemData.dataSync") + public ActionResult checkExecute(@RequestBody DbSyncForm dbSyncForm) throws Exception { + int status; + try { + status = dbSyncService.executeCheck(dbSyncForm.getDbConnectionFrom(), dbSyncForm.getDbConnectionTo(), dbSyncForm.getConvertRuleMap(), dbSyncForm.getDbTable()); + } catch (Exception e) { + e.printStackTrace(); + return ActionResult.fail(e.getMessage()); + } + if (status == -1) { + return ActionResult.fail(MsgCode.SYS012.get()); + } + return ActionResult.success(status); + } + + /** + * 执行数据同步 + * + * @param dbSyncForm 数据同步参数 + * @return ignore + * @throws Exception ignore + */ + @PostMapping("Actions/Execute") + @Operation(summary = "执行数据同步") + @Parameters({ + @Parameter(name = "dbSyncForm", description = "页面参数", required = true) + }) + @SaCheckPermission("systemData.dataSync") + public ActionResult execute(@RequestBody DbSyncForm dbSyncForm) { + try{ + dbSyncService.execute(dbSyncForm.getDbConnectionFrom(), dbSyncForm.getDbConnectionTo(), dbSyncForm.getConvertRuleMap(), dbSyncForm.getDbTable()); + }catch (Exception e){ + e.printStackTrace(); + return ActionResult.fail(MsgCode.SYS013.get(e.getMessage())); + } + return ActionResult.success(MsgCode.SU005.get()); + } + + /** + * 批量执行数据同步 + * + * @param dbSyncForm 数据同步参数 + * @return ignore + * @throws Exception ignore + */ + @PostMapping("Actions/batchExecute") + @Operation(summary = "批量执行数据同步") + @Parameters({ + @Parameter(name = "dbSyncForm", description = "页面参数", required = true) + }) + @SaCheckPermission("systemData.dataSync") + public ActionResult> executeBatch(@RequestBody DbSyncForm dbSyncForm) { + Map result = dbSyncService.executeBatch(dbSyncForm.getDbConnectionFrom(), dbSyncForm.getDbConnectionTo(), dbSyncForm.getConvertRuleMap(), dbSyncForm.getDbTableList()); + return ActionResult.success(MsgCode.SU005.get(), result); + } + + /** + * 获取数据类型默认转换规则 + * 一对一 + * @param fromDbType 被转换数据库类型 + * @param toDbType 转换数据库类型 + * @return 转换规则 + * @throws Exception 未找到数库 + */ + @GetMapping("Actions/getDefaultRules") + @SaCheckPermission("systemData.dataSync") + @Operation(summary = "获取一对一数据类型默认转换规则") + public static ActionResult> getDefaultRules(String fromDbType, String toDbType) throws Exception{ + Map map = new LinkedHashMap<>(); + for (DtInterface dtInterface : DtInterface.getClz(fromDbType).getEnumConstants()) { + DtInterface toFixCovert = DtSyncUtil.getToFixCovert(dtInterface, toDbType); + if(toFixCovert != null){ + map.put(dtInterface.getDataType(), toFixCovert.getDataType()); + } + } + return ActionResult.success(map); + } + + /** + * 获取数据类型转换规则 + * 一对多 + * @param fromDbType 被转换数据库类型 + * @param toDbType 转换数据库类型 + * @return 转换规则 + * @throws Exception 未找到数库 + */ + @GetMapping("Actions/getConvertRules") + @SaCheckPermission("systemData.dataSync") + @Operation(summary = "获取一对多数据类型转换规则") + public static ActionResult>> getConvertRules(String fromDbType, String toDbType) throws Exception{ + Map> map = new LinkedHashMap<>(); + for (DtInterface dtInterface : DtInterface.getClz(fromDbType).getEnumConstants()) { + List list = new LinkedList<>(); + DtInterface[] allConverts = DtSyncUtil.getAllConverts(dtInterface, toDbType); + if(allConverts != null){ + for (DtInterface allConvert : allConverts) { + list.add(allConvert.getDataType()); + } + map.put(dtInterface.getDataType(), list); + } + } + return ActionResult.success(map); + } + + /* ===================================== SQL转换项目 ======================================= */ + + /** + * 打印转换SQL + * + * @param form 参数表单 + */ + @PostMapping("Actions/print") + @Operation(summary = "打印同步表") + public ActionResult print(@RequestBody DbSyncPrintForm form) throws Exception{ + PrintFunction func = ()-> dbSyncService.printDbInit(form.getDbLinkFrom(), form.getDbTypeTo(), + form.getDbTableList(), form.getConvertRuleMap(), form.getPrintType()); + return ActionResult.success(printCommon(form, form.getPrintType(), func)); + } + + @FunctionalInterface + public interface PrintFunction { + Object execute() throws Exception; + } + + private Object printCommon(DbSyncPrintForm form, String printType, PrintFunction func) throws Exception { + String filePath = XSSEscape.escapePath(form.getOutPath()); + sqlPrintHandler.start(filePath, true, true, true, form.getDbTypeTo()); + sqlPrintHandler.setFileName(form.getOutFileName()); + Object obj = func.execute(); + sqlPrintHandler.print(); + sqlPrintHandler.close(); +// SqlPrintHandler.openDirectory(new File(filePath).getPath()); + return obj; + } + + /** + * 数据类型转换 + * + * @param dataType 数据类型 例如:varchar(50) + * @param fromDbEncode 源数据库类型 + * @param toDbEncode 目标数据库类型 + */ + @GetMapping("getConvertDataType") + @Operation(summary = "数据类型转换") + public String getConvertDataType(String dataType, String dtLength, String fromDbEncode, String toDbEncode) throws Exception{ + DbFieldModel dbFieldModel = new DbFieldModel(); + dbFieldModel.setLength(dtLength); + DtInterface toFixCovert = DtSyncUtil.getToFixCovert(DtInterface.newInstanceByDt(dataType, fromDbEncode), toDbEncode); + dbFieldModel.setDataType(toFixCovert.getDataType()); + return dbFieldModel.formatDataTypeByView(toDbEncode); + } + + @PostMapping("formatOracleValue") + @Operation(summary = "格式化SQL语句中的Oracle值") + public String getConvertDataType(@RequestBody String data) throws Exception{ + Map json = JSONObject.parseObject(data).getInnerMap(); + // 指定F_Id为主键 + Map dataMap = JSONObject.parseObject(json.get("dataMap").toString()).getInnerMap(); + // 特殊处理:存在值超过2000的字符 + StringBuilder valStrBuilder = new StringBuilder(); + String context = FormatSqlOracle.clobExecute(DbOracle.ORACLE, json.get("valueStr"), + json.get("table").toString(), json.get("column").toString(), dataMap, valStrBuilder).toString(); + return valStrBuilder.toString(); + } + + + + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/DbTableController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/DbTableController.java new file mode 100644 index 0000000..b385eda --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/DbTableController.java @@ -0,0 +1,471 @@ +package com.yunzhupaas.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import com.alibaba.fastjson.JSONObject; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.Page; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.entity.PrintDevEntity; +import com.yunzhupaas.base.model.dbtable.dto.DbTableFieldDTO; +import com.yunzhupaas.base.model.dbtable.form.DbFieldForm; +import com.yunzhupaas.base.model.dbtable.vo.DbFieldVO; +import com.yunzhupaas.base.model.dbtable.vo.DbTableInfoVO; +import com.yunzhupaas.base.model.dbtable.vo.DbTableListVO; +import com.yunzhupaas.base.service.DbLinkService; +import com.yunzhupaas.base.service.DbTableService; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.GenerateConstant; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.database.datatype.model.DtModelDTO; +import com.yunzhupaas.database.model.dbfield.DbFieldModel; +import com.yunzhupaas.database.model.dbtable.DbTableFieldModel; +import com.yunzhupaas.database.model.entity.DbLinkEntity; +import com.yunzhupaas.database.model.page.DbTableDataForm; +import com.yunzhupaas.database.sql.util.SqlFastUtil; +import com.yunzhupaas.emnus.ModuleTypeEnum; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.util.*; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +/** + * 数据建模 + * N:方法说明 - 微服务同步使用 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Tag(name = "数据建模", description = "DataModel") +@RestController +@RequestMapping("/api/system/DataModel") +@Slf4j +public class DbTableController { + + @Autowired + private DbTableService dbTableService; + @Autowired + private FileExport fileExport; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private DbLinkService dblinkService; + + /** + * 1:列表 + * + * @param id 连接id + * @param pagination 关键词 + * @return 数据库表列表 + * @throws DataException ignore + */ + @Operation(summary = "获取数据库表列表") + @Parameters({ + @Parameter(name = "id", description = "连接id", required = true) + }) + @GetMapping("/{id}/Tables") + public ActionResult> getList(@PathVariable("id") String id, Pagination pagination) throws Exception { + try { + List tableList = dbTableService.getListPage(XSSEscape.escape(id), pagination); + return ActionResult.success(new DbTableListVO<>(tableList, JsonUtil.getJsonToBean(pagination, PaginationVO.class))); + } catch (Exception e) { + log.error("获取表列表失败", e); + throw new DataException(MsgCode.DB302.get()); + } + } + + /** + * 1:列表 + * + * @param id 连接id + * @param page 关键字 + * @return 数据库表列表 + * @throws DataException ignore + */ + @Operation(summary = "获取数据库表列表") + @Parameters({ + @Parameter(name = "id", description = "连接id", required = true) + }) + @GetMapping("/{id}/TableAll") + public ActionResult> getList(@PathVariable("id") String id, Page page) throws Exception { + List tableList = dbTableService.getListPage(XSSEscape.escape(id), page); + ListVO list = new ListVO<>(); + list.setList(tableList); + return ActionResult.success(list); + } + + /** + * 2:预览数据库表 + * + * @param dbTableDataForm 查询条件 + * @param linkId 接Id + * @param tableName 表名 + * @return 数据库表 + * @throws Exception ignore + */ + @Operation(summary = "预览数据库表") + @Parameters({ + @Parameter(name = "linkId", description = "数据连接ID", required = true), + @Parameter(name = "tableName", description = "表名", required = true) + }) + @SaCheckPermission("systemData.dataModel") + @GetMapping("/{linkId}/Table/{tableName}/Preview") + public ActionResult>> data(DbTableDataForm dbTableDataForm, @PathVariable("linkId") String linkId, @PathVariable("tableName") String tableName) throws Exception { + String escape = XSSEscape.escape(linkId); + String escapeTableName = XSSEscape.escape(tableName); + List> data = dbTableService.getData(dbTableDataForm, escape, escapeTableName); + PaginationVO paginationVO = JsonUtilEx.getJsonToBeanEx(dbTableDataForm, PaginationVO.class); + return ActionResult.page(JsonUtil.getJsonToListMap(JsonUtil.getObjectToStringAsDate(data)), paginationVO); + } + + /** + * 3:列表 + * + * @param linkId 数据连接ID + * @param tableName 表名 + * @return 列表 + * @throws DataException ignore + */ + @GetMapping("/{linkId}/Tables/{tableName}/Fields/Selector") + @Operation(summary = "获取数据库表字段下拉框列表") + @Parameters({ + @Parameter(name = "linkId", description = "数据连接ID", required = true), + @Parameter(name = "tableName", description = "表名", required = true) + }) + public ActionResult> selectorList(@PathVariable("linkId") String linkId, @PathVariable("tableName") String tableName) throws Exception { + List data = dbTableService.getFieldList(linkId, tableName); + List vos = JsonUtil.getJsonToList(data, DbFieldVO.class); + ListVO vo = new ListVO<>(); + vo.setList(vos); + return ActionResult.success(vo); + } + + /** + * 4:字段列表 + * + * @param linkId 连接Id + * @param tableName 表名 + * @param type 类型 + * @return 段列表 + * @throws DataException ignore + */ + @Operation(summary = "获取数据库表字段列表") + @Parameters({ + @Parameter(name = "linkId", description = "数据连接ID", required = true), + @Parameter(name = "tableName", description = "表名", required = true), + @Parameter(name = "type", description = "类型") + }) + @GetMapping("/{linkId}/Tables/{tableName}/Fields") + public ActionResult> fieldList(@PathVariable("linkId") String linkId, @PathVariable("tableName") String tableName, String type) throws Exception { + List data; + try { + data = dbTableService.getFieldList(linkId, tableName); + } catch (Exception e) { + log.error("获取表字段列表失败", e); + return ActionResult.fail(MsgCode.DB302.get()); + } + if (CollectionUtils.isEmpty(data)) { + return ActionResult.fail(MsgCode.DB018.get()); + } + List voList = data.stream().map(DbFieldVO::new).collect(Collectors.toList()); +//返回数据库原字段 +// for (DbFieldVO vo : voList) { +// String columnName = vo.getField(); +// if ("1".equals(type)) { +// String name = vo.getField().toLowerCase(); +// name = name.startsWith("f_")? name.substring(2) : name; +// vo.setField(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, name)); +// } +// vo.setColumnName(columnName); +// } + ListVO vo = new ListVO<>(); + vo.setList(voList); + return ActionResult.success(vo); + } + + /** + * 5:编辑显示 - 表、字段信息 + * + * @param dbLinkId 连接Id + * @param tableName 表名 + * @return 表、字段信息 + * @throws DataException ignore + */ + @Operation(summary = "获取表及表字段信息") + @Parameters({ + @Parameter(name = "dbLinkId", description = "数据连接ID", required = true), + @Parameter(name = "tableName", description = "表名", required = true) + }) + @SaCheckPermission("systemData.dataModel") + @GetMapping("/{dbLinkId}/Table/{tableName}") + public ActionResult get(@PathVariable("dbLinkId") String dbLinkId, @PathVariable("tableName") String tableName) throws Exception { + return ActionResult.success(new DbTableInfoVO(dbTableService.getTable(dbLinkId, tableName), dbTableService.getFieldList(dbLinkId, tableName))); + } + + + /** + * 验证表名字段名是否系统关键字 + * + * @param dbTableFieldDTO + * @return + */ + private static String checkName(DbTableFieldDTO dbTableFieldDTO, Integer index) { + List javaSql = new ArrayList<>(); + javaSql.addAll(GenerateConstant.JAVA_KEYWORD); + javaSql.addAll(GenerateConstant.SQL_KEYWORD); + if (javaSql.contains(dbTableFieldDTO.getTableInfo().getNewTable().toLowerCase())) { + return "表名称" + dbTableFieldDTO.getTableInfo().getNewTable(); + } + if (dbTableFieldDTO.getTableFieldList() != null && dbTableFieldDTO.getTableFieldList().size() > 0) { + StringJoiner sj = new StringJoiner(","); + for (int n = 0; n < dbTableFieldDTO.getTableFieldList().size(); n++) { + DbFieldForm item = dbTableFieldDTO.getTableFieldList().get(n); + if (javaSql.contains(item.getField().toLowerCase())) { +// sj.add("第" + (index + n + 1) + "行列名" + item.getField()); + sj.add("列名" + item.getField()); + } + } + if (StringUtil.isNotEmpty(sj.toString())) { + return sj.toString(); + } + } + return ""; + } + + /** + * 6:新建表 + * + * @param linkId 连接Id + * @return 执行结果 + * @throws DataException ignore + */ + @Operation(summary = "新建") + @Parameters({ + @Parameter(name = "linkId", description = "数据连接ID", required = true), + @Parameter(name = "dbTableFieldDTO", description = "建表参数对象", required = true) + }) + @SaCheckPermission("systemData.dataModel") + @PostMapping("{linkId}/Table") + public ActionResult create(@PathVariable("linkId") String linkId, @RequestBody @Valid DbTableFieldDTO dbTableFieldDTO) throws Exception { + try { + String err = this.checkName(dbTableFieldDTO, 0); + if (StringUtil.isNotEmpty(err)) { + return ActionResult.fail(MsgCode.SYS128.get(err)); + } + int status = dbTableService.createTable(dbTableFieldDTO.getCreDbTableModel(linkId)); + if (status == 1) { + return ActionResult.success(MsgCode.SU001.get()); + } else if (status == 0) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } else { + return ActionResult.fail(MsgCode.DB019.get()); + } + } catch (Exception e) { + return ActionResult.fail(e.getMessage()); + } + } + + /** + * 7:更新 + * + * @param linkId 连接Id + * @return 执行结果 + * @throws DataException ignore + */ + @Operation(summary = "更新") + @Parameters({ + @Parameter(name = "linkId", description = "数据连接ID", required = true), + @Parameter(name = "dbTableFieldDTO", description = "建表参数对象", required = true) + }) + @SaCheckPermission("systemData.dataModel") + @PutMapping("/{linkId}/Table") + public ActionResult update(@PathVariable("linkId") String linkId, @RequestBody @Valid DbTableFieldDTO dbTableFieldDTO) throws Exception { + String err = this.checkName(dbTableFieldDTO, 0); + if (StringUtil.isNotEmpty(err)) { + return ActionResult.fail(MsgCode.SYS128.get(err)); + } + DbTableFieldModel dbTableModel = dbTableFieldDTO.getUpDbTableModel(linkId); + // 当修改表名时,验证是否与其他表名重名 + if (!dbTableModel.getUpdateNewTable().equals(dbTableModel.getUpdateOldTable())) { + if (dbTableService.isExistTable(linkId, dbTableModel.getUpdateNewTable())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + } + try { + dbTableService.update(dbTableModel); + return ActionResult.success(MsgCode.SU004.get()); + } catch (Exception e) { + return ActionResult.fail(e.getMessage()); + } + } + + /** + * 8:更新 + * + * @param linkId 连接Id + * @return 执行结果 + * @throws DataException ignore + */ + @Operation(summary = "添加字段") + @Parameters({ + @Parameter(name = "linkId", description = "数据连接ID", required = true), + @Parameter(name = "dbTableFieldDTO", description = "建表参数对象", required = true) + }) + @SaCheckPermission("systemData.dataModel") + @PutMapping("/{linkId}/addFields") + public ActionResult addField(@PathVariable("linkId") String linkId, @RequestBody @Valid DbTableFieldDTO dbTableFieldDTO) throws Exception { + int size = 0; +// try { +// DbLinkEntity dbLinkEntity = dblinkService.getResource(linkId); +// List fieldList = SqlFastUtil.getFieldList(dbLinkEntity, dbTableFieldDTO.getTableInfo().getTable()); +// size = fieldList.size(); +// } catch (Exception e) { +// } + + String err = this.checkName(dbTableFieldDTO, size); + if (StringUtil.isNotEmpty(err)) { + return ActionResult.fail(MsgCode.SYS128.get(err)); + } + DbTableFieldModel dbTableModel = dbTableFieldDTO.getUpDbTableModel(linkId); + dbTableService.addField(dbTableModel); + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 9:删除 + * + * @param linkId 连接Id + * @param tableName 表名 + * @return 执行结果 + * @throws DataException ignore + */ + @Operation(summary = "删除") + @Parameters({ + @Parameter(name = "linkId", description = "数据连接ID", required = true), + @Parameter(name = "tableName", description = "表名", required = true) + }) + @SaCheckPermission("systemData.dataModel") + @DeleteMapping("/{linkId}/Table/{tableName}") + public ActionResult delete(@PathVariable("linkId") String linkId, @PathVariable("tableName") String tableName) throws Exception { + dbTableService.delete(linkId, tableName); + return ActionResult.success(MsgCode.SU003.get()); + } + + /** + * 删除全部表(慎用) + * + * @param linkId 连接Id + * @return 执行结果 + * @throws DataException ignore + */ + @Operation(summary = "删除全部表") + @Parameters({ + @Parameter(name = "linkId", description = "数据连接ID", required = true), + }) + @SaCheckPermission("systemData.dataModel") + @DeleteMapping("/{linkId}/deleteAllTable") + public ActionResult deleteAllTable(@PathVariable("linkId") String linkId, String dbType) throws Exception { + dbTableService.deleteAllTable(linkId, dbType); + return ActionResult.success(MsgCode.SU003.get()); + } + + /** + * 10:导入 + * + * @param linkId 连接id + * @param multipartFile 文件 + * @return 执行结果 + * @throws DataException ignore + */ + @Operation(summary = "导入") + @Parameters({ + @Parameter(name = "linkId", description = "数据连接ID", required = true), + }) + @SaCheckPermission("systemData.dataModel") + @PostMapping(value = "/{linkId}/Actions/Import", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ActionResult> importData(@PathVariable String linkId, @RequestPart("file") MultipartFile multipartFile) throws Exception { + //判断是否为.json结尾 + if (FileUtil.existsSuffix(multipartFile, ModuleTypeEnum.SYSTEM_DBTABLE.getTableName())) { + return ActionResult.fail(MsgCode.IMP002.get()); + } + // 读取文件内容 + String fileContent = FileUtil.getFileContent(multipartFile); + DbTableFieldModel dbTableFieldModel = JSONObject.parseObject(fileContent, DbTableFieldModel.class); + + // 数据类型长度解析(enum枚举无法Json化) + for (DbFieldModel dbFieldModel : dbTableFieldModel.getDbFieldModelList()) { + String formatDataType = dbFieldModel.getLength(); + String dataType = ""; + String dtLength = ""; + if (formatDataType.contains("(")) { + Matcher matcher = Pattern.compile("(.+)\\((.*)\\)").matcher(formatDataType); + if (matcher.find()) { + dataType = matcher.group(1).trim(); + dtLength = matcher.group(2).trim(); + } + } else { + dataType = formatDataType.trim(); + } + dbFieldModel.setDtModelDTO(new DtModelDTO(dataType, dtLength, dbTableFieldModel.getDbEncode(), false) + .setConvertType(DtModelDTO.DB_VAL)); + } + + dbTableFieldModel.setDbLinkId(linkId); + int i = dbTableService.createTable(dbTableFieldModel); + if (i == 1) { + return ActionResult.success(MsgCode.IMP001.get()); + } else { + return ActionResult.fail(MsgCode.DB007.get()); + } + } + + /** + * 11:导出 + * + * @param tableName 表明 + * @param linkId 连接id + * @return 执行结果 + */ + @Operation(summary = "导出") + @Parameters({ + @Parameter(name = "tableName", description = "表明", required = true), + @Parameter(name = "linkId", description = "连接id", required = true) + }) + @SaCheckPermission("systemData.dataModel") + @GetMapping("/{linkId}/Table/{tableName}/Actions/Export") + public ActionResult export(@PathVariable String tableName, @PathVariable String linkId) throws Exception { + DbTableFieldModel dbTable = dbTableService.getDbTableModel(linkId, tableName); + dbTable.getDbFieldModelList().forEach(dbField -> { + dbField.setLength(dbField.getDtModelDTO().convert().formatDataType()); + dbField.setDtModelDTO(null); + }); + //导出文件 + DownloadVO downloadVO = fileExport.exportFile(dbTable, configValueUtil.getTemporaryFilePath(), + dbTable.getTable() + "_", ModuleTypeEnum.SYSTEM_DBTABLE.getTableName()); + return ActionResult.success(downloadVO); + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/DictionaryDataController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/DictionaryDataController.java new file mode 100644 index 0000000..72f32d1 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/DictionaryDataController.java @@ -0,0 +1,441 @@ +package com.yunzhupaas.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.model.dictionarytype.DictionaryExportModel; +import com.yunzhupaas.base.service.DictionaryDataService; +import com.yunzhupaas.base.service.DictionaryTypeService; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.entity.DictionaryTypeEntity; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.base.model.dictionarydata.*; +import com.yunzhupaas.base.model.dictionarytype.DictionaryTypeSelectModel; +import com.yunzhupaas.base.model.dictionarytype.DictionaryTypeSelectVO; +import com.yunzhupaas.util.FileUtil; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.JsonUtilEx; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.emnus.ModuleTypeEnum; +import com.yunzhupaas.util.treeutil.ListToTreeUtil; +import com.yunzhupaas.util.treeutil.SumTree; +import com.yunzhupaas.util.treeutil.newtreeutil.TreeDotUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import jakarta.validation.Valid; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 字典数据 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Tag(name = "数据字典", description = "DictionaryData") +@RestController +@RequestMapping("/api/system/DictionaryData") +public class DictionaryDataController extends SuperController { + + @Autowired + private DictionaryDataService dictionaryDataService; + @Autowired + private DictionaryTypeService dictionaryTypeService; + @Autowired + private ConfigValueUtil configValueUtil; + + /** + * 获取数据字典列表 + * + * @param dictionaryTypeId 数据字典id + * @param pageDictionaryData 分页参数 + * @return ignore + */ + @Operation(summary = "获取数据字典列表") + @Parameters({ + @Parameter(name = "dictionaryTypeId", description = "数据分类id", required = true) + }) + @GetMapping("/{dictionaryTypeId}") + public ActionResult bindDictionary(@PathVariable("dictionaryTypeId") String dictionaryTypeId, PageDictionaryData pageDictionaryData) { + List data = dictionaryDataService.getList(dictionaryTypeId); + List dataAll = data; + if (StringUtil.isNotEmpty(pageDictionaryData.getKeyword())) { + data = data.stream().filter(t -> t.getFullName().contains(pageDictionaryData.getKeyword()) || t.getEnCode().contains(pageDictionaryData.getKeyword())).collect(Collectors.toList()); + } + if (pageDictionaryData.getIsTree() != null && "1".equals(pageDictionaryData.getIsTree())) { + List treeData = JsonUtil.getJsonToList(ListToTreeUtil.treeWhere(data, dataAll), DictionaryDataEntity.class); + List voListVO = JsonUtil.getJsonToList(treeData, DictionaryDataModel.class); + List> sumTrees = TreeDotUtils.convertListToTreeDot(voListVO); + List list = JsonUtil.getJsonToList(sumTrees, DictionaryDataListVO.class); + ListVO treeVo = new ListVO<>(); + treeVo.setList(list); + return ActionResult.success(treeVo); + } + List voListVO = JsonUtil.getJsonToList(data, DictionaryDataModel.class); + ListVO treeVo = new ListVO<>(); + treeVo.setList(voListVO); + return ActionResult.success(treeVo); + } + + + /** + * 获取数据字典列表 + * + * @return ignore + */ + @Operation(summary = "获取数据字典列表(分类+内容)") + @GetMapping("/All") + public ActionResult>> allBindDictionary() { + List dictionaryTypeList = dictionaryTypeService.getList(); + List> list = new ArrayList<>(); + for (DictionaryTypeEntity dictionaryTypeEntity : dictionaryTypeList) { + List childNodeList = dictionaryDataService.getList(dictionaryTypeEntity.getId(), true); + if (dictionaryTypeEntity.getIsTree().compareTo(1) == 0) { + List> selectList = new ArrayList<>(); + for (DictionaryDataEntity item : childNodeList) { + Map ht = new HashMap<>(16); + ht.put("fullName", item.getFullName()); + ht.put("enCode", item.getEnCode()); + ht.put("id", item.getId()); + ht.put("parentId", item.getParentId()); + selectList.add(ht); + } + List jsonToList = JsonUtil.getJsonToList(selectList, DictionaryDataAllModel.class); + //==============转换树 + List> list1 = TreeDotUtils.convertListToTreeDot(jsonToList); + List list2 = JsonUtil.getJsonToList(list1, DictionaryDataAllVO.class); + //============== + Map htItem = new HashMap<>(16); + htItem.put("id", dictionaryTypeEntity.getId()); + htItem.put("enCode", dictionaryTypeEntity.getEnCode()); + htItem.put("dictionaryList", list2); + htItem.put("isTree", 1); + list.add(htItem); + } else { + List> selectList = new ArrayList<>(); + for (DictionaryDataEntity item : childNodeList) { + Map ht = new HashMap<>(16); + ht.put("enCode", item.getEnCode()); + ht.put("id", item.getId()); + ht.put("fullName", item.getFullName()); + selectList.add(ht); + } + Map htItem = new HashMap<>(16); + htItem.put("id", dictionaryTypeEntity.getId()); + htItem.put("enCode", dictionaryTypeEntity.getEnCode()); + htItem.put("dictionaryList", selectList); + htItem.put("isTree", 0); + list.add(htItem); + } + } + ListVO> vo = new ListVO<>(); + vo.setList(list); + return ActionResult.success(vo); + } + + + /** + * 获取数据字典下拉框数据 + * + * @param dictionaryTypeId 类别主键 + * @param isTree 是否为树 + * @param id 主键 + * @return ignore + */ + @Operation(summary = "获取数据字典分类下拉框数据") + @Parameters({ + @Parameter(name = "dictionaryTypeId", description = "数据分类id", required = true), + @Parameter(name = "isTree", description = "是否树形"), + @Parameter(name = "id", description = "主键", required = true) + }) + @GetMapping("{dictionaryTypeId}/Selector/{id}") + public ActionResult> treeView(@PathVariable("dictionaryTypeId") String dictionaryTypeId, String isTree, @PathVariable("id") String id) { + DictionaryTypeEntity typeEntity = dictionaryTypeService.getInfo(dictionaryTypeId); + List treeList = new ArrayList<>(); + DictionaryDataModel treeViewModel = new DictionaryDataModel(); + treeViewModel.setId("0"); + treeViewModel.setFullName(typeEntity.getFullName()); + treeViewModel.setParentId("-1"); + treeViewModel.setIcon("fa fa-tags"); + treeList.add(treeViewModel); + if ("1".equals(isTree)) { + List data = dictionaryDataService.getList(dictionaryTypeId).stream().filter(t -> "1".equals(String.valueOf(t.getEnabledMark()))).collect(Collectors.toList()); + //过滤子集 + if (!"0".equals(id)) { + data.remove(dictionaryDataService.getInfo(id)); + } + for (DictionaryDataEntity entity : data) { + DictionaryDataModel treeModel = new DictionaryDataModel(); + treeModel.setId(entity.getId()); + treeModel.setFullName(entity.getFullName()); + treeModel.setParentId("-1".equals(entity.getParentId()) ? entity.getDictionaryTypeId() : entity.getParentId()); + treeList.add(treeModel); + } + } + List> sumTrees = TreeDotUtils.convertListToTreeDotFilter(treeList); + List list = JsonUtil.getJsonToList(sumTrees, DictionaryDataSelectVO.class); + ListVO treeVo = new ListVO<>(); + treeVo.setList(list); + return ActionResult.success(treeVo); + } + + /** + * 获取字典分类 + * + * @param dictionaryTypeId 分类id、分类编码 + * @return ignore + */ + @Operation(summary = "获取某个字典数据下拉框列表") + @Parameters({ + @Parameter(name = "dictionaryTypeId", description = "数据分类id", required = true) + }) + @GetMapping("/{dictionaryTypeId}/Data/Selector") + public ActionResult> selectorOneTreeView(@PathVariable("dictionaryTypeId") String dictionaryTypeId) { + List data = dictionaryDataService.getList(dictionaryTypeId, true); + if(data.isEmpty()){ + DictionaryTypeEntity typeEntity = dictionaryTypeService.getInfoByEnCode(dictionaryTypeId); + if(typeEntity != null){ + data = dictionaryDataService.getList(typeEntity.getId(), true); + } + + } + List voListVO = JsonUtil.getJsonToList(data, DictionaryTypeSelectModel.class); + List> sumTrees = TreeDotUtils.convertListToTreeDot(voListVO); + List list = JsonUtil.getJsonToList(sumTrees, DictionaryTypeSelectVO.class); + ListVO vo = new ListVO<>(); + vo.setList(list); + return ActionResult.success(vo); + } + + /** + * 获取数据字典信息 + * + * @param id 主键 + * @return ignore + * @throws DataException ignore + */ + @Operation(summary = "获取数据字典信息") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @GetMapping("/{id}/Info") + public ActionResult info(@PathVariable("id") String id) throws DataException { + DictionaryDataEntity entity = dictionaryDataService.getInfo(id); + DictionaryDataInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, DictionaryDataInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 重复验证(名称) + * + * @param dictionaryTypeId 类别主键 + * @param fullName 名称 + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "(待定)重复验证(名称)") + @GetMapping("/IsExistByFullName") + public ActionResult isExistByFullName(String dictionaryTypeId, String fullName, String id) { + boolean data = dictionaryDataService.isExistByFullName(dictionaryTypeId, fullName, id); + return ActionResult.success(data); + } + + /** + * 重复验证(编码) + * + * @param dictionaryTypeId 类别主键 + * @param enCode 编码 + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "(待定)重复验证(编码)") + @GetMapping("/IsExistByEnCode") + public ActionResult isExistByEnCode(String dictionaryTypeId, String enCode, String id) { + boolean data = dictionaryDataService.isExistByEnCode(dictionaryTypeId, enCode, id); + return ActionResult.success(data); + } + + + /** + * 添加数据字典 + * + * @param dictionaryDataCrForm 实体对象 + * @return ignore + */ + @Operation(summary = "添加数据字典") + @Parameters({ + @Parameter(name = "dictionaryDataCrForm", description = "实体对象", required = true) + }) + @SaCheckPermission("systemData.dictionary") + @PostMapping + public ActionResult create(@RequestBody @Valid DictionaryDataCrForm dictionaryDataCrForm) { + DictionaryDataEntity entity = JsonUtil.getJsonToBean(dictionaryDataCrForm, DictionaryDataEntity.class); + if (dictionaryDataService.isExistByFullName(entity.getDictionaryTypeId(), entity.getFullName(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (dictionaryDataService.isExistByEnCode(entity.getDictionaryTypeId(), entity.getEnCode(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + dictionaryDataService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 修改数据字典 + * + * @param id 主键值 + * @param dictionaryDataUpForm 实体对象 + * @return ignore + */ + @Operation(summary = "修改数据字典") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true), + @Parameter(name = "dictionaryDataUpForm", description = "实体对象", required = true) + }) + @SaCheckPermission("systemData.dictionary") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid DictionaryDataUpForm dictionaryDataUpForm) { + DictionaryDataEntity entity = JsonUtil.getJsonToBean(dictionaryDataUpForm, DictionaryDataEntity.class); + if (dictionaryDataService.isExistByFullName(entity.getDictionaryTypeId(), entity.getFullName(), id)) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (dictionaryDataService.isExistByEnCode(entity.getDictionaryTypeId(), entity.getEnCode(), id)) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + boolean flag = dictionaryDataService.update(id, entity); + if (!flag) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + + } + + /** + * 删除数据字典 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "删除数据字典") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("systemData.dictionary") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + DictionaryDataEntity entity = dictionaryDataService.getInfo(id); + if (entity != null) { + if (dictionaryDataService.isExistSubset(entity.getId())) { + return ActionResult.fail(MsgCode.SYS014.get()); + } + dictionaryDataService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + /** + * 更新字典状态 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "更新字典状态") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("systemData.dictionary") + @PutMapping("/{id}/Actions/State") + public ActionResult update(@PathVariable("id") String id) { + DictionaryDataEntity entity = dictionaryDataService.getInfo(id); + if (entity != null) { + if ("1".equals(String.valueOf(entity.getEnabledMark()))) { + entity.setEnabledMark(0); + } else { + entity.setEnabledMark(1); + } + boolean flag = dictionaryDataService.update(entity.getId(), entity); + if (!flag) { + return ActionResult.success(MsgCode.FA002.get()); + } + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 数据字典导出功能 + * + * @param id 接口id + * @return ignore + */ + @Operation(summary = "导出数据字典数据") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("systemData.dictionary") + @GetMapping("/{id}/Actions/Export") + public ActionResult exportFile(@PathVariable("id") String id) { + DownloadVO downloadVO = dictionaryDataService.exportData(id); + return ActionResult.success(downloadVO); + } + + /** + * 数据字典导入功能 + * + * @param multipartFile 文件 + * @return ignore + * @throws DataException ignore + */ + @Operation(summary = "数据字典导入功能") + @SaCheckPermission("systemData.dictionary") + @PostMapping(value = "/Actions/Import", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ActionResult importFile(@RequestPart("file") MultipartFile multipartFile, + @RequestParam("type") Integer type) throws DataException { + //判断是否为.json结尾 + if (FileUtil.existsSuffix(multipartFile, ModuleTypeEnum.SYSTEM_DICTIONARYDATA.getTableName())) { + return ActionResult.fail(MsgCode.IMP002.get()); + } + try { + //获取文件内容 + String fileContent = FileUtil.getFileContent(multipartFile); + DictionaryExportModel exportModel = JsonUtil.getJsonToBean(fileContent, DictionaryExportModel.class); + List list = exportModel.getList(); + //父级分类id不存在的话,直接抛出异常 + //如果分类只有一个 + if (list.size() == 1 && !"-1".equals(list.get(0).getParentId()) && dictionaryTypeService.getInfo(list.get(0).getParentId()) == null) { + return ActionResult.fail(MsgCode.IMP010.get()); + } + //如果有多个需要验证分类是否存在 + if (list.stream().filter(t -> "-1".equals(t.getParentId())).count() < 1) { + boolean exist = false; + for (DictionaryTypeEntity dictionaryTypeEntity : list) { + //判断父级是否存在 + if (dictionaryTypeService.getInfo(dictionaryTypeEntity.getParentId()) != null) { + exist = true; + } + } + if (!exist) { + return ActionResult.fail(MsgCode.IMP010.get()); + } + } + //判断数据是否存在 + return dictionaryDataService.importData(exportModel, type); + } catch (Exception e) { + throw new DataException(MsgCode.IMP004.get()); + } + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/DictionaryTypeController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/DictionaryTypeController.java new file mode 100644 index 0000000..98a4687 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/DictionaryTypeController.java @@ -0,0 +1,266 @@ +package com.yunzhupaas.base.controller; + + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import com.yunzhupaas.base.Page; +import com.yunzhupaas.base.controller.SuperController; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.base.model.dictionarytype.*; +import com.yunzhupaas.base.entity.DictionaryTypeEntity; +import com.yunzhupaas.base.service.DictionaryTypeService; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.treeutil.SumTree; +import com.yunzhupaas.util.treeutil.TreeDotUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 字典分类 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2023/09/27 + */ +@Tag(name = "数据字典分类", description = "DictionaryType") +@RestController +@RequestMapping("/api/system/DictionaryType") +public class DictionaryTypeController extends SuperController { + + @Autowired + private DictionaryTypeService dictionaryTypeService; + + /** + * 获取字典分类 + * + * @return + */ + @Operation(summary = "获取字典分类") + @GetMapping + public ActionResult> list() { + List data = dictionaryTypeService.getList(); + List voListVO = JsonUtil.getJsonToList(data, DictionaryTypeModel.class); + voListVO.forEach(vo -> { + if (StringUtil.isNotEmpty(vo.getCategory()) && "1".equals(vo.getCategory()) && "-1".equals(vo.getParentId())) { + vo.setCategory("系统"); + vo.setParentId("1"); + } else if (StringUtil.isNotEmpty(vo.getCategory()) && "0".equals(vo.getCategory()) && "-1".equals(vo.getParentId())) { + vo.setCategory("业务"); + vo.setParentId("0"); + } + }); + List> sumTrees = TreeDotUtils.convertListToTreeDot(voListVO); + List list = JsonUtil.getJsonToList(sumTrees, DictionaryTypeListVO.class); + + DictionaryTypeListVO parentVO = new DictionaryTypeListVO(); + parentVO.setFullName("系统字典"); + parentVO.setChildren(new ArrayList<>()); + parentVO.setId("1"); + DictionaryTypeListVO parentVO1 = new DictionaryTypeListVO(); + parentVO1.setFullName("业务字典"); + parentVO1.setChildren(new ArrayList<>()); + parentVO1.setId("0"); + + list.forEach(vo -> { + if ("系统".equals(vo.getCategory())) { + List children = parentVO.getChildren(); + children.add(vo); + parentVO.setHasChildren(true); + }else { + List children = parentVO1.getChildren(); + children.add(vo); + parentVO1.setHasChildren(true); + } + }); + List listVo = new ArrayList<>(); + listVo.add(parentVO1); + listVo.add(parentVO); + + ListVO vo = new ListVO<>(); + vo.setList(listVo); + return ActionResult.success(vo); + } + + + /** + * 获取字典分类 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取所有字典分类下拉框列表") + @Parameter(name = "id", description = "主键", required = true) + @GetMapping("/Selector/{id}") + public ActionResult> selectorTreeView(@PathVariable("id") String id) { + List data = dictionaryTypeService.getList(); + if (!"0".equals(id)) { + data.remove(dictionaryTypeService.getInfo(id)); + } + List voListVO = JsonUtil.getJsonToList(data, DictionaryTypeModel.class); + voListVO.forEach(vo -> { + if (StringUtil.isNotEmpty(vo.getCategory()) && "1".equals(vo.getCategory()) && "-1".equals(vo.getParentId())) { + vo.setCategory("系统"); + vo.setParentId("1"); + } else if (StringUtil.isNotEmpty(vo.getCategory()) && "0".equals(vo.getCategory()) && "-1".equals(vo.getParentId())) { + vo.setCategory("业务"); + vo.setParentId("0"); + } + }); + List> sumTrees = TreeDotUtils.convertListToTreeDot(voListVO); + List list = JsonUtil.getJsonToList(sumTrees, DictionaryTypeListVO.class); + + DictionaryTypeListVO parentVO = new DictionaryTypeListVO(); + parentVO.setFullName("系统字典"); + parentVO.setChildren(new ArrayList<>()); + parentVO.setId("1"); + DictionaryTypeListVO parentVO1 = new DictionaryTypeListVO(); + parentVO1.setFullName("业务字典"); + parentVO1.setChildren(new ArrayList<>()); + parentVO1.setId("0"); + + list.forEach(vo -> { + if ("系统".equals(vo.getCategory())) { + List children = parentVO.getChildren(); + children.add(vo); + parentVO.setHasChildren(true); + }else { + List children = parentVO1.getChildren(); + children.add(vo); + parentVO1.setHasChildren(true); + } + }); + List listVo = new ArrayList<>(); + listVo.add(parentVO1); + listVo.add(parentVO); + + ListVO vo = new ListVO<>(); + vo.setList(listVo); + return ActionResult.success(vo); + } + + /** + * 获取字典分类信息 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "获取字典分类信息") + @Parameter(name = "id", description = "主键", required = true) + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) throws DataException { + DictionaryTypeEntity entity = dictionaryTypeService.getInfo(id); + if ("-1".equals(entity.getParentId())) { + entity.setParentId(String.valueOf(entity.getCategory())); + } + DictionaryTypeInfoVO vo = JsonUtil.getJsonToBeanEx(entity, DictionaryTypeInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 添加字典分类 + * + * @param dictionaryTypeCrForm 实体对象 + * @return + */ + @Operation(summary = "添加字典分类") + @Parameter(name = "dictionaryTypeCrForm", description = "实体对象", required = true) + @SaCheckPermission("systemData.dictionary") + @PostMapping + public ActionResult create(@RequestBody @Valid DictionaryTypeCrForm dictionaryTypeCrForm) { + DictionaryTypeEntity entity = JsonUtil.getJsonToBean(dictionaryTypeCrForm, DictionaryTypeEntity.class); + if ("0".equals(entity.getParentId()) || "1".equals(entity.getParentId())) { + entity.setCategory(Integer.parseInt(entity.getParentId())); + entity.setParentId("-1"); + } else { + DictionaryTypeEntity entity1 = dictionaryTypeService.getInfo(dictionaryTypeCrForm.getParentId()); + entity.setCategory(entity1.getCategory()); + } + if (dictionaryTypeService.isExistByFullName(entity.getFullName(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (dictionaryTypeService.isExistByEnCode(entity.getEnCode(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + dictionaryTypeService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 修改字典分类 + * + * @param dictionaryTypeUpForm 实体对象 + * @param id 主键值 + * @return + */ + @Operation(summary = "修改字典分类") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true), + @Parameter(name = "dictionaryTypeUpForm", description = "实体对象", required = true) + }) + @SaCheckPermission("systemData.dictionary") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid DictionaryTypeUpForm dictionaryTypeUpForm) { + DictionaryTypeEntity entity = JsonUtil.getJsonToBean(dictionaryTypeUpForm, DictionaryTypeEntity.class); + if ("0".equals(entity.getParentId()) || "1".equals(entity.getParentId())) { + entity.setCategory(Integer.parseInt(entity.getParentId())); + entity.setParentId("-1"); + } else { + DictionaryTypeEntity entity1 = dictionaryTypeService.getInfo(dictionaryTypeUpForm.getParentId()); + entity.setCategory(entity1.getCategory()); + } + if (dictionaryTypeService.isExistByFullName(entity.getFullName(), id)) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (dictionaryTypeService.isExistByEnCode(entity.getEnCode(), id)) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + boolean flag = dictionaryTypeService.update(id, entity); + if (!flag) { + return ActionResult.success(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除字典分类 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "删除字典分类") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("systemData.dictionary") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + DictionaryTypeEntity entity = dictionaryTypeService.getInfo(id); + if (entity != null) { + boolean isOk = dictionaryTypeService.delete(entity); + if (isOk) { + return ActionResult.success(MsgCode.SU003.get()); + } else { + return ActionResult.fail(MsgCode.SYS014.get()); + } + } + return ActionResult.fail(MsgCode.FA003.get()); + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/InterfaceOauthController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/InterfaceOauthController.java new file mode 100644 index 0000000..0a6bf16 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/InterfaceOauthController.java @@ -0,0 +1,299 @@ +package com.yunzhupaas.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.entity.DataInterfaceEntity; +import com.yunzhupaas.base.entity.DataInterfaceLogEntity; +import com.yunzhupaas.base.entity.DataInterfaceUserEntity; +import com.yunzhupaas.base.entity.InterfaceOauthEntity; +import com.yunzhupaas.base.model.InterfaceOauth.*; +import com.yunzhupaas.base.model.datainterface.DataInterfaceVo; +import com.yunzhupaas.base.service.DataInterfaceLogService; +import com.yunzhupaas.base.service.DataInterfaceService; +import com.yunzhupaas.base.service.DataInterfaceUserService; +import com.yunzhupaas.base.service.InterfaceOauthService; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; + + +/** + * 接口认证控制器 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/8 + */ +@Tag(name = "接口认证", description = "interfaceoauth") +@RestController +@RequestMapping(value = "/api/system/InterfaceOauth") +public class InterfaceOauthController extends SuperController { + @Autowired + private DataInterfaceService dataInterfaceService; + @Autowired + private DataInterfaceLogService dataInterfaceLogService; + + @Autowired + private InterfaceOauthService interfaceOauthService; + + @Autowired + private UserService userService; + + + + @Autowired + private DataInterfaceUserService dataInterfaceUserService; + + + /** + * 获取接口认证列表(分页) + * + * @param pagination 分页参数 + * @return ignore + */ + @Operation(summary = "获取接口认证列表(分页)") + @SaCheckPermission("systemData.interfaceAuth") + @GetMapping + public ActionResult> getList(PaginationOauth pagination) { + List data = interfaceOauthService.getList(pagination); + List jsonToList = JsonUtil.getJsonToList(data, InterfaceIdentListVo.class); + jsonToList.forEach(item -> { + if (StringUtil.isNotEmpty(UserProvider.getUser().getTenantId())) { + item.setTenantId(UserProvider.getUser().getTenantId()); + } + if (item.getCreatorUserId() != null) { + item.setCreatorUser(userService.getInfo(item.getCreatorUserId()).getRealName()); + } + }); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(jsonToList, paginationVO); + } + + /** + * 添加接口认证 + * + * @param interfaceIdentForm 添加接口认证模型 + * @return ignore + */ + @Operation(summary = "添加接口认证") + @Parameter(name = "interfaceIdentForm", description = "添加接口认证模型", required = true) + @SaCheckPermission("systemData.interfaceAuth") + @PostMapping + public ActionResult create(@RequestBody @Valid InterfaceIdentForm interfaceIdentForm) { + InterfaceOauthEntity entity = JsonUtil.getJsonToBean(interfaceIdentForm, InterfaceOauthEntity.class); + if (interfaceOauthService.isExistByAppName(entity.getAppName(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (interfaceOauthService.isExistByAppId(entity.getAppId(), entity.getId())) { + return ActionResult.fail("AppId" +MsgCode.EXIST103.get()); + } + interfaceOauthService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + + /** + * 修改接口认证 + * + * @param interfaceIdentForm 添加接口认证模型 + * @return ignore + */ + @Operation(summary = "修改接口认证") + @Parameters({ + @Parameter(name = "interfaceIdentForm", description = "添加接口认证模型", required = true), + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("systemData.interfaceAuth") + @PutMapping("/{id}") + public ActionResult update(@RequestBody @Valid InterfaceIdentForm interfaceIdentForm, @PathVariable("id") String id) throws DataException { + InterfaceOauthEntity entity = JsonUtil.getJsonToBean(interfaceIdentForm, InterfaceOauthEntity.class); + if (interfaceOauthService.isExistByAppName(entity.getAppName(), id)) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (interfaceOauthService.isExistByAppId(entity.getAppId(), id)) { + return ActionResult.fail("AppId" +MsgCode.EXIST103.get()); + } + boolean flag = interfaceOauthService.update(entity, id); + if (flag == false) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除接口认证 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除接口") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("systemData.interfaceAuth") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable String id) { + InterfaceOauthEntity entity = interfaceOauthService.getInfo(id); + if (entity != null) { + interfaceOauthService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + /** + * 获取秘钥 + * + * @return + */ + @Operation(summary = "获取接口认证密钥") + @SaCheckPermission("systemData.interfaceAuth") + @GetMapping("/getAppSecret") + public ActionResult getAppSecret() { + String uuid = UUID.randomUUID().toString().replace("-", ""); + return ActionResult.success(MsgCode.SU019.get(), uuid); + } + + + /** + * 保存綁定认证接口 + * + * @return + */ + @Operation(summary = "保存綁定认证接口") + @Parameters({ + @Parameter(name = "identInterfaceListModel", description = "授权接口列表模型", required = true) + }) + @SaCheckPermission("systemData.interfaceAuth") + @PostMapping("/saveInterfaceList") + public ActionResult getInterfaceList(@RequestBody IdentInterfaceListModel identInterfaceListModel) { + InterfaceOauthEntity entity = new InterfaceOauthEntity(); + entity.setId(identInterfaceListModel.getInterfaceIdentId()); + entity.setDataInterfaceIds(identInterfaceListModel.getDataInterfaceIds()); + boolean b = interfaceOauthService.updateById(entity); + if (b) { + return ActionResult.success(MsgCode.SU002.get()); + } + return ActionResult.success(MsgCode.FA101.get()); + } + + /** + * 获取接口授权绑定接口列表 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取认证基础信息及接口列表") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("systemData.interfaceAuth") + @GetMapping("/{id}") + public ActionResult getInterfaceList(@PathVariable("id") String id) { + InterfaceOauthEntity entity = interfaceOauthService.getInfo(id); + InterfaceIdentVo bean = JsonUtil.getJsonToBean(entity, InterfaceIdentVo.class); + if (StringUtils.isNotEmpty(bean.getDataInterfaceIds())) { + List listDataInterfaceVo = new ArrayList<>(); + List list = dataInterfaceService.getList(false); + list.forEach(item -> { + if (bean.getDataInterfaceIds().contains(item.getId())) { + DataInterfaceVo dataInterfaceVo = JsonUtil.getJsonToBean(item, DataInterfaceVo.class); + listDataInterfaceVo.add(dataInterfaceVo); + } + }); + bean.setList(listDataInterfaceVo); + } + + //添加授权用户信息 + List listIuv =new ArrayList<>(); + List select = dataInterfaceUserService.select(id); + for(DataInterfaceUserEntity diue:select){ + String userId = diue.getUserId(); + UserEntity info = userService.getInfo(userId); + InterfaceUserVo iuv=new InterfaceUserVo(); + iuv.setUserId(userId); + iuv.setUserKey(diue.getUserKey()); + iuv.setUserName(info.getRealName()+"/"+info.getAccount()); + listIuv.add(iuv); + } + bean.setUserList(listIuv); + return ActionResult.success(MsgCode.SU019.get(), bean); + } + + /** + * 获取日志列表 + * + * @param id 主键 + * @param paginationIntrfaceLog 分页参数 + * @return + */ + @Operation(summary = "获取日志列表") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("systemData.interfaceAuth") + @GetMapping("/dataInterfaceLog/{id}") + public ActionResult> getInterfaceList(@PathVariable("id") String id,PaginationIntrfaceLog paginationIntrfaceLog) { + InterfaceOauthEntity entity = interfaceOauthService.getInfo(id); + List voList = null; + PaginationVO vo = null; + if (entity!=null&&StringUtils.isNotEmpty(entity.getDataInterfaceIds())) { + String dataInterfaceIds = entity.getDataInterfaceIds(); + String[] split = dataInterfaceIds.split(","); + List list = Arrays.asList(split); + List listByIds = dataInterfaceLogService.getListByIds(entity.getAppId(),list, paginationIntrfaceLog); + voList = JsonUtil.getJsonToList(listByIds, IdentDataInterfaceLogVO.class); + List listDataInt = dataInterfaceService.getList(false); + for (IdentDataInterfaceLogVO invo : voList) { + if (StringUtil.isNotEmpty(UserProvider.getUser().getTenantId())) { + invo.setTenantId(UserProvider.getUser().getTenantId()); + } + //绑定用户 + UserEntity userEntity = userService.getInfo(invo.getUserId()); + if (userEntity != null) { + invo.setUserId(userEntity.getRealName() + "/" + userEntity.getAccount()); + } + //绑定接口基础数据 + listDataInt.forEach(item -> { + if (invo.getInvokId().contains(item.getId())) { + DataInterfaceVo dataInterfaceVo = JsonUtil.getJsonToBean(item, DataInterfaceVo.class); + invo.setFullName(dataInterfaceVo.getFullName()); + invo.setEnCode(dataInterfaceVo.getEnCode()); + } + }); + } + vo = JsonUtil.getJsonToBean(paginationIntrfaceLog, PaginationVO.class); + + } + return ActionResult.page(voList, vo); + } + + + @Operation(summary = "授权用户") + @SaCheckPermission("systemData.interfaceAuth") + @PostMapping("/SaveUserList") + public ActionResult saveUserList(@RequestBody InterfaceUserForm interfaceUserForm) { + dataInterfaceUserService.saveUserList(interfaceUserForm); + return ActionResult.success(MsgCode.SU002.get()); + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/LocationController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/LocationController.java new file mode 100644 index 0000000..a8b3862 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/LocationController.java @@ -0,0 +1,138 @@ +package com.yunzhupaas.base.controller; + +import com.alibaba.fastjson.JSONObject; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.model.province.MapParams; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.util.NoDataSourceBind; +import com.yunzhupaas.util.ServletUtil; +import com.yunzhupaas.util.wxutil.HttpUtil; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.imageio.ImageIO; +import jakarta.servlet.http.HttpServletResponse; +import java.awt.image.BufferedImage; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.HttpURLConnection; +import java.net.URL; + +@Tag(name = "定位转发接口", description = "location") +@RestController +@RequestMapping("/api/system/Location") +public class LocationController { + + @Operation(summary = "查询附近数据") + @GetMapping("/around") + @NoDataSourceBind + public ActionResult getAroundList(MapParams params) { + JSONObject rstObj; + String url = "https://restapi.amap.com/v3/place/around?key=" + params.getKey() + "&location=" + params.getLocation() + + "&radius=" + params.getRadius() + "&offset=" + params.getOffset() + "&page=" + params.getPage(); + try { + rstObj = HttpUtil.httpRequest(url, "GET", null); + } catch (Exception e) { + return ActionResult.fail(MsgCode.SYS023.get()); + } + if (rstObj == null) { + return ActionResult.fail(MsgCode.SYS024.get()); + } + return ActionResult.success(rstObj); + } + + @Operation(summary = "根据关键字查询附近数据") + @GetMapping("/text") + @NoDataSourceBind + public ActionResult getTextList(MapParams params) { + JSONObject rstObj; + String url = "https://restapi.amap.com/v3/place/text?key=" + params.getKey() + "&keywords=" + params.getKeywords() + + "&radius=" + params.getRadius() + "&offset=" + params.getOffset() + "&page=" + params.getPage(); + try { + rstObj = HttpUtil.httpRequest(url, "GET", null); + } catch (Exception e) { + return ActionResult.fail(MsgCode.SYS023.get()); + } + if (rstObj == null) { + return ActionResult.fail(MsgCode.SYS024.get()); + } + return ActionResult.success(rstObj); + } + + @Operation(summary = "输入提示") + @GetMapping("/inputtips") + @NoDataSourceBind + public ActionResult getInputTips(MapParams params) { + JSONObject rstObj; + String url = "https://restapi.amap.com/v3/assistant/inputtips?key=" + params.getKey() + "&keywords=" + params.getKeywords(); + try { + rstObj = HttpUtil.httpRequest(url, "GET", null); + } catch (Exception e) { + return ActionResult.fail(MsgCode.SYS023.get()); + } + if (rstObj == null) { + return ActionResult.fail(MsgCode.SYS024.get()); + } + return ActionResult.success(rstObj); + } + + @Operation(summary = "定位图片") + @GetMapping("/staticmap") + @NoDataSourceBind + public void staticmap(MapParams params) { + String requestUrl = "https://restapi.amap.com/v3/staticmap?location=" + params.getLocation() + "&zoom=" + params.getZoom() + "&size=" + + params.getSize() + "&key=" + params.getKey(); + try { + URL url = new URL(requestUrl); + HttpURLConnection conn = (HttpURLConnection) url.openConnection(); + conn.setDoOutput(true); + conn.setDoInput(true); + conn.setUseCaches(false); + conn.setRequestMethod("GET"); + conn.setConnectTimeout(50000); + conn.setReadTimeout(60000); + conn.setRequestProperty("Content-Type", "image/png"); + InputStream ins = null; + OutputStream os = null; + try { + ins = conn.getInputStream(); + HttpServletResponse response = ServletUtil.getResponse(); + BufferedImage image = ImageIO.read(ins); + os = response.getOutputStream(); + if (image != null) { + ImageIO.write(image, "png", os); + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + conn.disconnect(); + os.flush(); + os.close(); + ins.close(); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + @Operation(summary = "经纬度转地址") + @GetMapping("/regeo") + @NoDataSourceBind + public ActionResult regeo(MapParams params) { + JSONObject rstObj; + String url = "https://restapi.amap.com/v3/geocode/regeo?key=" + params.getKey() + "&&location=" + params.getLocation(); + try { + rstObj = HttpUtil.httpRequest(url, "GET", null); + } catch (Exception e) { + return ActionResult.fail(MsgCode.SYS023.get()); + } + if (rstObj == null) { + return ActionResult.fail(MsgCode.SYS024.get()); + } + return ActionResult.success(rstObj); + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/MessageTemplateController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/MessageTemplateController.java new file mode 100644 index 0000000..56c6094 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/MessageTemplateController.java @@ -0,0 +1,271 @@ +package com.yunzhupaas.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.entity.MessageTemplateEntity; +import com.yunzhupaas.base.entity.SmsTemplateEntity; +import com.yunzhupaas.base.model.messagetemplate.*; +import com.yunzhupaas.base.SmsModel; +import com.yunzhupaas.base.service.MessageTemplateService; +import com.yunzhupaas.base.service.SmsTemplateService; +import com.yunzhupaas.util.message.SmsUtil; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.JsonUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; +import java.util.List; +import java.util.Map; + +/** + * 消息模板控制类 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-12-08 + */ +@Tag(description = "BaseMessageTemplateController", name = "消息模板控制类") +@RestController +@RequestMapping("/api/system/MessageTemplate") +public class MessageTemplateController extends SuperController { + + @Autowired + private MessageTemplateService messageTemplateService; + @Autowired + private SmsTemplateService smsTemplateService; + @Autowired + private UserService userService; + + /** + * 消息模板列表 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "消息模板列表") + @SaCheckPermission("msgTemplate") + @GetMapping + public ActionResult> list(Pagination pagination) { + List list = messageTemplateService.getList(pagination, false); + List listVO = JsonUtil.getJsonToList(list, MessageTemplateListVO.class); + for (MessageTemplateListVO messageTemplateListVO : listVO) { + StringBuilder noticeMethod = new StringBuilder(); + if (messageTemplateListVO.getIsDingTalk() == 1) { + noticeMethod.append("、阿里钉钉"); + } + if (messageTemplateListVO.getIsEmail() == 1) { + noticeMethod.append("、电子邮箱"); + } + if (messageTemplateListVO.getIsSms() == 1) { + noticeMethod.append("、短信"); + } + if (messageTemplateListVO.getIsStationLetter() == 1) { + noticeMethod.append("、站内信"); + } + if (messageTemplateListVO.getIsWecom() == 1) { + noticeMethod.append("、企业微信"); + } + if (noticeMethod.length() > 0) { + messageTemplateListVO.setNoticeMethod(noticeMethod.toString().replaceFirst("、", "")); + } + if ("1".equals(messageTemplateListVO.getCategory())) { + messageTemplateListVO.setCategory("普通"); + } else if ("2".equals(messageTemplateListVO.getCategory())) { + messageTemplateListVO.setCategory("重要"); + } else if ("3".equals(messageTemplateListVO.getCategory())) { + messageTemplateListVO.setCategory("紧急"); + } + UserEntity entity = userService.getInfo(messageTemplateListVO.getCreatorUserId()); + messageTemplateListVO.setCreatorUser(entity!= null ? entity.getRealName() + "/" + entity.getAccount() : null); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(listVO, paginationVO); + } + + /** + * 消息模板下拉框 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "消息模板下拉框") + @GetMapping("/Selector") + public ActionResult selector(Pagination pagination) { + List list = messageTemplateService.getList(pagination, true); + for (MessageTemplateEntity entity : list) { + if ("1".equals(entity.getCategory())) { + entity.setCategory("普通"); + } else if ("2".equals(entity.getCategory())) { + entity.setCategory("重要"); + } else if ("3".equals(entity.getCategory())) { + entity.setCategory("紧急"); + } + } + List listVO = JsonUtil.getJsonToList(list, MessageTemplateSelector.class); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(listVO, paginationVO); + } + + /** + * 获取消息模板 + * + * @param id + * @return + */ + @Operation(summary = "获取消息模板") + @Parameter(name = "id", description = "主键", required = true) + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) { + MessageTemplateEntity entity = messageTemplateService.getInfo(id); + MessageTemplateVO vo = JsonUtil.getJsonToBean(entity, MessageTemplateVO.class); + SmsTemplateEntity info = smsTemplateService.getInfo(vo.getSmsId()); + vo.setSmsTemplateName(info != null ? info.getFullName() : null); + return ActionResult.success(vo); + } + + /** + * 获取消息模板参数 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取消息模板参数") + @Parameter(name = "id", description = "主键", required = true) + @GetMapping("/getTemplate/{id}") + public ActionResult getParameter(@PathVariable("id") String id) { + MessageTemplateEntity entity = messageTemplateService.getInfo(id); + if (entity == null) { + return ActionResult.fail(MsgCode.SYS015.get()); + } + // 获取参数 + String templateJson = entity.getTemplateJson(); + Map map = JsonUtil.stringToMap(templateJson); + // 如果是短信,获取短信模板参数 + if (entity.getIsSms() == 1) { + SmsModel smsModel = smsTemplateService.getSmsConfig(); + String smsId = entity.getSmsId(); + SmsTemplateEntity info = smsTemplateService.getInfo(smsId); + List list = SmsUtil.querySmsTemplateRequest(info.getCompany(), smsModel, info.getEndpoint(), info.getRegion(), info.getTemplateId()); + for (String key : list) { + map.put(key, null); + } + } + return ActionResult.success(map); + } + + /** + * 新建 + * + * @param messageTemplateCrForm 新建消息模板 + * @return + */ + @Operation(summary = "新建") + @Parameter(name = "messageTemplateCrForm", description = "新建消息模板", required = true) + @SaCheckPermission("msgTemplate") + @PostMapping + public ActionResult create(@RequestBody @Valid MessageTemplateCrForm messageTemplateCrForm) { + MessageTemplateEntity entity = JsonUtil.getJsonToBean(messageTemplateCrForm, MessageTemplateEntity.class); + if (messageTemplateService.isExistByFullName(entity.getFullName(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (messageTemplateService.isExistByEnCode(entity.getEnCode(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + messageTemplateService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 修改 + * + * @param id 主键 + * @param messageTemplateUpForm 修改消息模板 + * @return + */ + @Operation(summary = "修改") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "messageTemplateUpForm", description = "修改消息模板", required = true) + }) + @SaCheckPermission("msgTemplate") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid MessageTemplateUpForm messageTemplateUpForm) { + MessageTemplateEntity entity = JsonUtil.getJsonToBean(messageTemplateUpForm, MessageTemplateEntity.class); + if (entity != null) { + if (messageTemplateService.isExistByFullName(entity.getFullName(), id)) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (messageTemplateService.isExistByEnCode(entity.getEnCode(), id)) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + boolean flag = messageTemplateService.update(id, entity); + if (!flag) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + return ActionResult.fail(MsgCode.FA002.get()); + } + + /** + * 删除 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("msgTemplate") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + MessageTemplateEntity entity = messageTemplateService.getInfo(id); + if (entity == null) { + return ActionResult.fail(MsgCode.FA003.get()); + } + messageTemplateService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + + /** + * 修改状态 + * + * @param id 主键 + * @return + */ + @Operation(summary = "修改状态") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("msgTemplate") + @PutMapping("/{id}/Actions/State") + public ActionResult update(@PathVariable("id") String id) { + MessageTemplateEntity entity = messageTemplateService.getInfo(id); + if (entity != null) { + if (entity.getEnabledMark() == 0) { + entity.setEnabledMark(1); + } else { + entity.setEnabledMark(0); + } + boolean flag = messageTemplateService.update(id, entity); + if (!flag) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + return ActionResult.success(MsgCode.FA002.get()); + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/ModuleButtonController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/ModuleButtonController.java new file mode 100644 index 0000000..bdb676c --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/ModuleButtonController.java @@ -0,0 +1,206 @@ +package com.yunzhupaas.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.service.ModuleButtonService; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.base.entity.ModuleButtonEntity; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.base.model.button.*; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.JsonUtilEx; +import com.yunzhupaas.util.treeutil.SumTree; +import com.yunzhupaas.util.treeutil.newtreeutil.TreeDotUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 按钮权限 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Tag(name = "按钮权限", description = "ModuleButton") +@RestController +@RequestMapping("/api/system/ModuleButton") +public class ModuleButtonController extends SuperController { + + @Autowired + private ModuleButtonService moduleButtonService; + + /** + * 按钮按钮权限列表 + * + * @param menuId 功能主键 + * @param pagination 分页参数 + * @return ignore + */ + @Operation(summary = "获取按钮权限列表") + @Parameters({ + @Parameter(name = "menuId", description = "功能主键", required = true) + }) + @SaCheckPermission("system.menu") + @GetMapping("/{menuId}/List") + public ActionResult list(@PathVariable("menuId") String menuId, Pagination pagination) { + List data = moduleButtonService.getListByModuleIds(menuId, pagination); + List treeList = JsonUtil.getJsonToList(data, ButtonTreeListModel.class); + List> sumTrees = TreeDotUtils.convertListToTreeDot(treeList); + if (data.size() > sumTrees.size()) { + List list = JsonUtil.getJsonToList(sumTrees, ButtonTreeListVO.class); + ListVO treeVo = new ListVO<>(); + treeVo.setList(list); + return ActionResult.success(treeVo); + } + List list = JsonUtil.getJsonToList(treeList, ButtonListVO.class); + ListVO treeVo1 = new ListVO<>(); + treeVo1.setList(list); + return ActionResult.success(treeVo1); + } + + + /** + * 按钮按钮权限列表 + * + * @param menuId 功能主键 + * @return ignore + */ + @Operation(summary = "获取按钮权限下拉框") + @Parameters({ + @Parameter(name = "menuId", description = "功能主键", required = true) + }) + @GetMapping("/{menuId}/Selector") + public ActionResult> selectList(@PathVariable("menuId") String menuId) { + List data = moduleButtonService.getListByModuleIds(menuId); + List treeList = JsonUtil.getJsonToList(data, ButtonTreeListModel.class); + List> sumTrees = TreeDotUtils.convertListToTreeDot(treeList); + List list = JsonUtil.getJsonToList(sumTrees, ButtonTreeListVO.class); + ListVO treeVo = new ListVO<>(); + treeVo.setList(list); + return ActionResult.success(treeVo); + } + + + /** + * 获取按钮权限信息 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "获取按钮权限信息") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.menu") + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) throws DataException { + ModuleButtonEntity entity = moduleButtonService.getInfo(id); + ModuleButtonInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, ModuleButtonInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 新建按钮权限 + * + * @param moduleButtonCrForm 实体对象 + * @return ignore + */ + @Operation(summary = "新建按钮权限") + @Parameters({ + @Parameter(name = "moduleButtonCrForm", description = "实体对象", required = true) + }) + @SaCheckPermission("system.menu") + @PostMapping + public ActionResult create(@RequestBody ModuleButtonCrForm moduleButtonCrForm) { + ModuleButtonEntity entity = JsonUtil.getJsonToBean(moduleButtonCrForm, ModuleButtonEntity.class); + if (moduleButtonService.isExistByEnCode(entity.getModuleId(), entity.getEnCode(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + moduleButtonService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 更新按钮权限 + * + * @param id 主键值 + * @param moduleButtonUpForm 更新参数 + * @return ignore + */ + @Operation(summary = "更新按钮权限") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true), + @Parameter(name = "moduleButtonUpForm", description = "实体对象", required = true) + }) + @SaCheckPermission("system.menu") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody ModuleButtonUpForm moduleButtonUpForm) { + ModuleButtonEntity entity = JsonUtil.getJsonToBean(moduleButtonUpForm, ModuleButtonEntity.class); + if (moduleButtonService.isExistByEnCode(entity.getModuleId(), entity.getEnCode(), id)) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + boolean flag = moduleButtonService.update(id, entity); + if (flag == false) { + return ActionResult.success(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除按钮权限 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "删除按钮权限") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.menu") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + ModuleButtonEntity entity = moduleButtonService.getInfo(id); + if (entity != null) { + moduleButtonService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + /** + * 更新菜单状态 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "更新菜单状态") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.menu") + @PutMapping("/{id}/Actions/State") + public ActionResult upState(@PathVariable("id") String id) { + ModuleButtonEntity entity = moduleButtonService.getInfo(id); + if (entity.getEnabledMark() == null || "1".equals(String.valueOf(entity.getEnabledMark()))) { + entity.setEnabledMark(0); + } else { + entity.setEnabledMark(1); + } + boolean flag = moduleButtonService.update(id, entity); + if (!flag) { + return ActionResult.success(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/ModuleColumnController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/ModuleColumnController.java new file mode 100644 index 0000000..dd9c5c0 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/ModuleColumnController.java @@ -0,0 +1,409 @@ +package com.yunzhupaas.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.entity.ModuleEntity; +import com.yunzhupaas.base.model.ColumnDataModel; +import com.yunzhupaas.base.model.Template6.ColumnListField; +import com.yunzhupaas.base.model.module.PropertyJsonModel; +import com.yunzhupaas.base.service.ModuleColumnService; +import com.yunzhupaas.base.service.ModuleService; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.base.entity.ModuleColumnEntity; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.base.model.column.*; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.JsonUtilEx; +import com.yunzhupaas.util.ReflectionUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.context.SpringContext; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; +import java.util.*; + +/** + * 列表权限 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Tag(name = "列表权限", description = "ModuleColumn") +@Validated +@RestController +@RequestMapping("/api/system/ModuleColumn") +public class ModuleColumnController extends SuperController { + + @Autowired + private ModuleColumnService moduleColumnService; + @Autowired + private ModuleService moduleService; + + /** + * 获取列表权限信息列表 + * + * @param moduleId 功能主键 + * @param pagination 分页参数 + * @return ignore + */ + @Operation(summary = "获取列表权限列表") + @Parameters({ + @Parameter(name = "moduleId", description = "功能主键", required = true) + }) + @SaCheckPermission("system.menu") + @GetMapping("/{moduleId}/Fields") + public ActionResult> getList(@PathVariable("moduleId") String moduleId, + Pagination pagination) { + List list = moduleColumnService.getList(moduleId, pagination); + List voList = JsonUtil.getJsonToList(list, ColumnListVO.class); + voList.stream().forEach(t -> { + String enCode = t.getEnCode(); + if (StringUtil.isNotEmpty(enCode)) { + if (enCode.contains("-")) { + enCode = enCode.substring(enCode.indexOf("-") + 1); + } + t.setEnCode(enCode.replace("yunzhupaas_" + t.getBindTable() + "_yunzhupaas_", "")); + } + }); + ListVO vo = new ListVO<>(); + vo.setList(voList); + return ActionResult.success(vo); + } + + /** + * 菜单列表权限 + * + * @param moduleId 功能主键 + * @return ignore + */ + @Operation(summary = "菜单列表权限") + @Parameters({ + @Parameter(name = "moduleId", description = "功能主键", required = true) + }) + @SaCheckPermission("system.menu") + @GetMapping("/{moduleId}/FieldList") + public ActionResult>> fieldList(@PathVariable("moduleId") String moduleId) { + List> list = new ArrayList<>(); + // 得到菜单id + ModuleEntity entity = moduleService.getInfo(moduleId); + if (entity != null) { + PropertyJsonModel model = JsonUtil.getJsonToBean(entity.getPropertyJson(), PropertyJsonModel.class); + if (model == null) { + model = new PropertyJsonModel(); + } + // 得到bean + Object bean = SpringContext.getBean("visualdevServiceImpl"); + Object method = ReflectionUtil.invokeMethod(bean, "getInfo", new Class[] { String.class }, + new Object[] { model.getModuleId() }); + Map map = JsonUtil.entityToMap(method); + boolean isPc = entity.getCategory().equalsIgnoreCase("web"); + if (map != null) { + Object columnData = isPc ? map.get("columnData") : map.get("appColumnData"); + if (Objects.nonNull(columnData)) { + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData.toString(), + ColumnDataModel.class); + List columnListFields = JsonUtil + .getJsonToList(columnDataModel.getDefaultColumnList(), ColumnListField.class); + if (Objects.nonNull(columnListFields)) { + columnListFields.stream().forEach(col -> { + Map dataMap = new HashMap<>(); + dataMap.put("field", col.getProp()); + dataMap.put("fieldName", col.getLabel()); + list.add(dataMap); + }); + } + } + } + } + + // if (map != null && map.containsKey("formData")) { + // // 需要排除的key + // String[] filterKey = new String[]{"PsdInput", "colorPicker", "rate", + // "slider", "divider", + // "uploadImg", "uploadFz", "editor", "YUNZHUPAASText", "relationFormAttr", + // "popupAttr", "groupTitle"}; + // List filterKeyList = Arrays.asList(filterKey); + // FormDataModel formDataModel = + // JsonUtil.getJsonToBean(String.valueOf(map.get("formData")), + // FormDataModel.class); + // List fieLdsModelList = + // JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class); + // RecursionForm recursionForm = new RecursionForm(); + // recursionForm.setList(fieLdsModelList); + // recursionForm.setTableModelList(JsonUtil.getJsonToList(String.valueOf(map.get("tables")), + // TableModel.class)); + // List formAllModel = new ArrayList<>(); + // FormCloumnUtil.recursionForm(recursionForm, formAllModel); + // for (FormAllModel allModel : formAllModel) { + // if (FormEnum.mast.getMessage().equals(allModel.getYunzhupaasKey())) { + // FormColumnModel formColumnModel = allModel.getFormColumnModel(); + // FieLdsModel fieLdsModel = formColumnModel.getFieLdsModel(); + // long count = filterKeyList.stream().filter(t -> fieLdsModel != null && + // fieLdsModel.getConfig()!=null && + // t.equals(fieLdsModel.getConfig().getYunzhupaasKey())).count(); + // if (count < 1) { + // if (fieLdsModel != null && StringUtil.isNotEmpty(fieLdsModel.getVModel())) { + // Map map1 = new HashedMap<>(); + // map1.put("field", fieLdsModel.getVModel()); + // map1.put("fieldName", fieLdsModel.getConfig().getLabel()); + // list.add(map1); + // } + // } + // } else if + // (FormEnum.mastTable.getMessage().equals(allModel.getYunzhupaasKey())) { + // FormMastTableModel formColumnModel = allModel.getFormMastTableModel(); + // FieLdsModel fieLdsModel = formColumnModel.getMastTable().getFieLdsModel(); + // long count = filterKeyList.stream().filter(t -> fieLdsModel != null && + // fieLdsModel.getConfig() != null && + // t.equals(fieLdsModel.getConfig().getYunzhupaasKey())).count(); + // if (count < 1) { + // if (fieLdsModel != null && StringUtil.isNotEmpty(fieLdsModel.getVModel())) { + // Map map1 = new HashedMap<>(); + // map1.put("field", fieLdsModel.getVModel()); + // map1.put("fieldName", fieLdsModel.getConfig().getLabel()); + // list.add(map1); + // } + // } + // } + // + ///// 后面会用到 + //// else if (FormEnum.table.getMessage().equals(allModel.getYunzhupaasKey())) { + //// FormColumnTableModel childList = allModel.getChildList(); + //// List childList1 = childList.getChildList(); + //// for (FormColumnModel formColumnModel : childList1) { + //// FieLdsModel fieLdsModel = formColumnModel.getFieLdsModel(); + //// if (StringUtil.isNotEmpty(fieLdsModel.getVModel())) { + //// Map map1 = new HashedMap<>(); + //// map1.put("field", fieLdsModel.getVModel()); + //// map1.put("fieldName", fieLdsModel.getConfig().getLabel()); + //// list.add(map1); + //// } + //// } + //// } + ///// + // } + // } + return ActionResult.success(list); + } + + /** + * 获取列表权限信息 + * + * @param id 主键值 + * @return ignore + * @throws DataException ignore + */ + @Operation(summary = "获取列表权限信息") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) throws DataException { + ModuleColumnEntity entity = moduleColumnService.getInfo(id); + String enCode = entity.getEnCode(); + if (StringUtil.isNotEmpty(enCode)) { + if (enCode.contains("-") && entity.getFieldRule() == 2) { + enCode = enCode.substring(enCode.indexOf("-") + 1); + entity.setEnCode(enCode); + } + if (Objects.equals(entity.getFieldRule(), 1) && entity.getBindTable() != null) { + entity.setEnCode(enCode.replace("yunzhupaas_" + entity.getBindTable() + "_yunzhupaas_", "")); + } + } + ModuleColumnInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, ModuleColumnInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 新建列表权限 + * + * @param moduleColumnCrForm 实体对象 + * @return ignore + */ + @Operation(summary = "新建列表权限") + @Parameters({ + @Parameter(name = "moduleColumnCrForm", description = "实体对象", required = true) + }) + @SaCheckPermission("system.menu") + @PostMapping + public ActionResult create(@RequestBody @Valid ModuleColumnCrForm moduleColumnCrForm) { + ModuleEntity moduleEntity = moduleService.getInfo(moduleColumnCrForm.getModuleId()); + ModuleColumnEntity entity = JsonUtil.getJsonToBean(moduleColumnCrForm, ModuleColumnEntity.class); + + if (moduleEntity != null) { + PropertyJsonModel model = JsonUtil.getJsonToBean(moduleEntity.getPropertyJson(), PropertyJsonModel.class); + if (model == null) { + model = new PropertyJsonModel(); + } + if (entity.getFieldRule() == 1 && StringUtil.isNotEmpty(moduleColumnCrForm.getBindTable())) { + String enCode = "yunzhupaas_" + moduleColumnCrForm.getBindTable() + "_yunzhupaas_" + entity.getEnCode(); + entity.setEnCode(enCode); + } + + if (entity.getFieldRule() == 2 && StringUtil.isNotEmpty(moduleColumnCrForm.getChildTableKey())) { + // 得到bean + // Object bean = SpringContext.getBean("visualdevServiceImpl"); + // Object method = ReflectionUtil.invokeMethod(bean, "getTableNameToKey", new + // Class[]{String.class}, new Object[]{model.getModuleId()}); + // Map map = JsonUtil.entityToMap(method); + // + // String enCode = map.get(moduleColumnCrForm.getBindTable().toLowerCase()) + + // "-" + entity.getEnCode(); + String enCode = moduleColumnCrForm.getChildTableKey() + "-" + entity.getEnCode(); + entity.setEnCode(enCode); + } + } + if (moduleColumnService.isExistByEnCode(entity.getModuleId(), entity.getEnCode(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + moduleColumnService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 更新列表权限 + * + * @param id 主键值 + * @param moduleColumnUpForm 实体对象 + * @return ignore + */ + @Operation(summary = "更新列表权限") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true), + @Parameter(name = "moduleColumnUpForm", description = "实体对象", required = true) + }) + @SaCheckPermission("system.menu") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, + @RequestBody @Valid ModuleColumnUpForm moduleColumnUpForm) { + ModuleEntity moduleEntity = moduleService.getInfo(moduleColumnUpForm.getModuleId()); + ModuleColumnEntity entity = JsonUtil.getJsonToBean(moduleColumnUpForm, ModuleColumnEntity.class); + if (moduleEntity != null) { + PropertyJsonModel model = JsonUtil.getJsonToBean(moduleEntity.getPropertyJson(), PropertyJsonModel.class); + if (model == null) { + model = new PropertyJsonModel(); + } + if (entity.getFieldRule() == 1 && StringUtil.isNotEmpty(moduleColumnUpForm.getBindTable())) { + String enCode = "yunzhupaas_" + moduleColumnUpForm.getBindTable() + "_yunzhupaas_" + entity.getEnCode(); + entity.setEnCode(enCode); + } + + if (entity.getFieldRule() == 2 && StringUtil.isNotEmpty(moduleColumnUpForm.getChildTableKey())) { + // // 得到bean + // Object bean = SpringContext.getBean("visualdevServiceImpl"); + // Object method = ReflectionUtil.invokeMethod(bean, "getTableNameToKey", new + // Class[]{String.class}, new Object[]{model.getModuleId()}); + // Map map = JsonUtil.entityToMap(method); + + // String enCode = map.get(moduleColumnUpForm.getBindTable().toLowerCase()) + + // "-" + entity.getEnCode(); + String enCode = moduleColumnUpForm.getChildTableKey() + "-" + entity.getEnCode(); + entity.setEnCode(enCode); + } + } + if (moduleColumnService.isExistByEnCode(entity.getModuleId(), entity.getEnCode(), id)) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + boolean flag = moduleColumnService.update(id, entity); + if (!flag) { + return ActionResult.success(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除列表权限 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "删除列表权限") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.menu") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + ModuleColumnEntity entity = moduleColumnService.getInfo(id); + if (entity != null) { + moduleColumnService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + /** + * 更新列表权限状态 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "更新列表权限状态") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.menu") + @PutMapping("/{id}/Actions/State") + public ActionResult upState(@PathVariable("id") String id) { + ModuleColumnEntity entity = moduleColumnService.getInfo(id); + if (entity.getEnabledMark() == null || "1".equals(String.valueOf(entity.getEnabledMark()))) { + entity.setEnabledMark(0); + } else { + entity.setEnabledMark(1); + } + boolean flag = moduleColumnService.update(id, entity); + if (!flag) { + return ActionResult.success(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 批量新建 + * + * @param columnBatchForm 权限模型 + * @return ignore + */ + @Operation(summary = "批量新建列表权限") + @Parameters({ + @Parameter(name = "columnBatchForm", description = "权限模型", required = true) + }) + @SaCheckPermission("system.menu") + @PostMapping("/Actions/Batch") + public ActionResult batchCreate(@RequestBody @Valid ColumnBatchForm columnBatchForm) { + List entitys = columnBatchForm.getColumnJson() != null + ? JsonUtil.getJsonToList(columnBatchForm.getColumnJson(), ModuleColumnEntity.class) + : new ArrayList<>(); + List name = new ArrayList<>(); + for (ModuleColumnEntity entity : entitys) { + entity.setModuleId(columnBatchForm.getModuleId()); + if (entity.getFieldRule() == 1) { + String enCode = "yunzhupaas_" + entity.getBindTable() + "_yunzhupaas_" + entity.getEnCode(); + entity.setEnCode(enCode); + } + if (entity.getFieldRule() == 2) { + String enCode = entity.getChildTableKey() + "-" + entity.getEnCode(); + entity.setEnCode(enCode); + } + if (moduleColumnService.isExistByEnCode(entity.getModuleId(), entity.getEnCode(), null)) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + if (name.contains(entity.getEnCode())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + name.add(entity.getEnCode()); + } + moduleColumnService.create(entitys); + return ActionResult.success(MsgCode.SU001.get()); + } +} diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/ModuleController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/ModuleController.java new file mode 100644 index 0000000..e2c5757 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/ModuleController.java @@ -0,0 +1,954 @@ +package com.yunzhupaas.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.util.ObjectUtil; +import com.google.common.collect.ImmutableList; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import com.yunzhupaas.base.entity.*; +import com.yunzhupaas.base.model.online.VisualMenuModel; +import com.yunzhupaas.base.service.*; +import com.yunzhupaas.base.util.visualUtil.PubulishUtil; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.YunzhupaasConst; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.base.model.module.MenuSelectVO; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.model.AppDataInfoModel; +import com.yunzhupaas.model.AppObjectDataModel; +import com.yunzhupaas.model.FlowWorkModel; +import com.yunzhupaas.model.UserMenuModel; +import com.yunzhupaas.model.tenant.*; +import com.yunzhupaas.permission.entity.AuthorizeEntity; +import com.yunzhupaas.permission.entity.PermissionGroupEntity; +import com.yunzhupaas.permission.model.user.UserIdListVo; +import com.yunzhupaas.permission.service.AuthorizeService; +import com.yunzhupaas.permission.service.PermissionGroupService; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.*; +import com.yunzhupaas.exception.DataException; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.model.module.*; +import com.yunzhupaas.util.context.SpringContext; +import com.yunzhupaas.emnus.ModuleTypeEnum; +import com.yunzhupaas.util.treeutil.ListToTreeUtil; +import com.yunzhupaas.util.treeutil.SumTree; +import com.yunzhupaas.util.treeutil.TreeViewModel; +import com.yunzhupaas.util.treeutil.newtreeutil.TreeDotUtils; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.util.type.AuthorizeType; +import com.yunzhupaas.workflow.service.TemplateApi; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import jakarta.validation.Valid; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * 系统功能 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Tag(name = "系统菜单", description = "menu") +@RestController +@RequestMapping("/api/system/Menu") +public class ModuleController extends SuperController { + + @Autowired + private ModuleService moduleService; + @Autowired + private RedisUtil redisUtil; + @Autowired + private CacheKeyUtil cacheKeyUtil; + + @Autowired + private SystemService systemService; + @Autowired + private PermissionGroupService permissionGroupApi; + @Autowired + private ModuleButtonService buttonService; + @Autowired + private ModuleColumnService columnService; + @Autowired + private ModuleFormService formService; + @Autowired + private ModuleDataAuthorizeSchemeService dataAuthorizeSchemeService; + @Autowired + private AuthorizeService authorizeApi; + @Autowired + private UserService userApi; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private TemplateApi templateApi; + @Autowired + private PubulishUtil pubulishUtil; + + /** + * 获取菜单列表 + * + * @param systemId 系统id + * @param paginationMenu 分页参数 + * @return ignore + */ + @Operation(summary = "获取菜单列表") + @Parameters({ + @Parameter(name = "systemId", description = "系统id", required = true) + }) + @GetMapping("/ModuleBySystem/{systemId}") + public ActionResult> list(@PathVariable("systemId") String systemId, + PaginationMenu paginationMenu) { + List data = moduleService.getList(systemId, paginationMenu.getCategory(), + paginationMenu.getKeyword(), paginationMenu.getType(), paginationMenu.getEnabledMark(), null, false); + // 递归查上级 + Map moduleEntityMap = data.stream() + .collect(Collectors.toMap(ModuleEntity::getId, Function.identity())); + if (StringUtil.isNotEmpty(paginationMenu.getKeyword())) { + moduleService.getParentModule(data, moduleEntityMap); + } + List list = JsonUtil.getJsonToList(moduleEntityMap.values(), UserMenuModel.class); + list = list.stream() + .sorted(Comparator + .comparing(UserMenuModel::getSortCode, Comparator.nullsLast(Comparator.naturalOrder())) + .thenComparing(UserMenuModel::getCreatorTime, Comparator.nullsLast(Comparator.reverseOrder()))) + .collect(Collectors.toList()); + List> menuList = TreeDotUtils.convertListToTreeDot(list); + List menuvo = JsonUtil.getJsonToList(menuList, MenuListVO.class); + ListVO vo = new ListVO(); + vo.setList(menuvo); + return ActionResult.success(vo); + } + + /** + * 获取菜单列表(下拉框) + * + * @param category 分类 + * @param id 主键 + * @return ignore + */ + @Operation(summary = "获取菜单列表(下拉框)") + @Parameters({ + @Parameter(name = "category", description = "分类"), + @Parameter(name = "id", description = "主键", required = true) + }) + @GetMapping("/Selector/{id}") + public ActionResult> treeView(String category, @PathVariable("id") String id) { + String systemId = "App".equals(category) ? UserProvider.getUser().getAppSystemId() + : UserProvider.getUser().getSystemId(); + List data = moduleService.getList(systemId, category, null, 1, 1, null, false); + if (!"0".equals(id)) { + data.remove(moduleService.getInfo(id)); + } + List list = JsonUtil.getJsonToList(data, UserMenuModel.class); + List> menuList = TreeDotUtils.convertListToTreeDotFilter(list); + List menuvo = JsonUtil.getJsonToList(menuList, MenuSelectVO.class); + ListVO vo = new ListVO(); + vo.setList(menuvo); + return ActionResult.success(vo); + } + + /** + * 获取开发平台菜单 + * + * @return ignore + */ + @Operation(summary = "获取开发平台菜单") + @GetMapping("/SystemSelector") + public ActionResult> mainSystemSelector() { + SystemEntity mainSystem = systemService.getInfoByEnCode(YunzhupaasConst.MAIN_SYSTEM_CODE); + List data = moduleService.getList(mainSystem.getId(), null, null, null, 1, null, false); + List list = JsonUtil.getJsonToList(data, UserMenuModel.class); + list.forEach(t -> { + if ("-1".equals(t.getParentId())) { + t.setParentId(t.getSystemId()); + } + }); + UserMenuModel userMenuModel = JsonUtil.getJsonToBean(mainSystem, UserMenuModel.class); + userMenuModel.setType(0); + userMenuModel.setParentId("-1"); + list.add(userMenuModel); + List> menuList = TreeDotUtils.convertListToTreeDotFilter(list); + List menuvo = JsonUtil.getJsonToList(menuList, MenuSelectVO.class); + ListVO vo = new ListVO(); + vo.setList(menuvo); + return ActionResult.success(vo); + } + + /** + * 通过系统id获取菜单列表(下拉框) + * + * @param category 分类 + * @param id 主键 + * @return ignore + */ + @Operation(summary = "通过系统id获取菜单列表(下拉框)") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "systemId", description = "系统主键", required = true), + @Parameter(name = "enabledMark", description = "查询类型:null-全部,0-禁用,1-启用", required = false) + }) + @GetMapping("/Selector/{id}/{systemId}") + public ActionResult> treeView(@PathVariable("id") String id, + @PathVariable("systemId") String systemId, + @RequestParam("category") String category, + @RequestParam(value = "enabledMark", required = false) Integer enabledMark) { + List data = moduleService.getList(systemId, category, null, 1, enabledMark, null, true); + if (!"0".equals(id)) { + data.remove(moduleService.getInfo(id)); + } + List list = JsonUtil.getJsonToList(data, UserMenuModel.class); + if ("0".equals(systemId)) { + List moduleAuthorize = new ArrayList<>(); + if (configValueUtil.isMultiTenancy()) { + TenantAuthorizeModel tenantAuthorizeModel = TenantDataSourceUtil + .getCacheModuleAuthorize(UserProvider.getUser().getTenantId()); + moduleAuthorize = tenantAuthorizeModel.getModuleIdList(); + } + List list1 = systemService.getList(null, true, false, true, false, moduleAuthorize); + list.forEach(t -> { + if ("-1".equals(t.getParentId())) { + t.setParentId(t.getSystemId()); + } + }); + List jsonToList = JsonUtil.getJsonToList(list1, UserMenuModel.class); + jsonToList.forEach(t -> { + t.setType(0); + t.setParentId("-1"); + }); + list.addAll(jsonToList); + } + List> menuList = TreeDotUtils.convertListToTreeDotFilter(list); + List menuvo = JsonUtil.getJsonToList(menuList, MenuSelectAllVO.class); + ListVO vo = new ListVO(); + vo.setList(menuvo); + return ActionResult.success(vo); + } + + /** + * 通过系统id获取菜单列表(下拉框) + * + * @param category 分类 + * @return ignore + */ + @Operation(summary = "通过系统id获取菜单列表(下拉框)") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "systemId", description = "系统主键", required = true) + }) + @GetMapping("/SelectorFilter/{visualId}") + public ActionResult> SelectorFilter(String category, + @PathVariable("visualId") String visualId) { + List data = moduleService.getList("0", category, null, 1, 1, null, true); + List moduleList = moduleService.getModuleList(visualId); + List moduleIds = new ArrayList<>(); + List systemIds = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(moduleList)) { + for (ModuleEntity item : moduleList) { + if ("-1".equals(item.getParentId())) { + systemIds.add(item.getSystemId()); + } else { + moduleIds.add(item.getParentId()); + } + } + } + List list = JsonUtil.getJsonToList(data, UserMenuModel.class); + + List moduleAuthorize = new ArrayList<>(); + if (configValueUtil.isMultiTenancy()) { + TenantAuthorizeModel tenantAuthorizeModel = TenantDataSourceUtil + .getCacheModuleAuthorize(UserProvider.getUser().getTenantId()); + moduleAuthorize = tenantAuthorizeModel.getModuleIdList(); + } + List list1 = systemService.getList(null, true, false, true, false, moduleAuthorize); + list.forEach(t -> { + if ("-1".equals(t.getParentId())) { + t.setParentId(t.getSystemId()); + } + }); + List jsonToList = JsonUtil.getJsonToList(list1, UserMenuModel.class); + jsonToList.forEach(t -> { + t.setType(0); + t.setParentId("-1"); + }); + list.addAll(jsonToList); + for (UserMenuModel userMenuModel : list) { + if (moduleIds.contains(userMenuModel.getId()) || systemIds.contains(userMenuModel.getId())) { + userMenuModel.setDisabled(true); + } + } + List> menuList = TreeDotUtils.convertListToTreeDotFilter(list); + List menuvo = JsonUtil.getJsonToList(menuList, MenuSelectAllVO.class); + ListVO vo = new ListVO(); + vo.setList(menuvo); + return ActionResult.success(vo); + } + + /** + * 获取菜单权限返回权限组 + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "获取菜单权限返回权限组") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @GetMapping("/getPermissionGroup/{id}") + public ActionResult> getPermissionGroup(@PathVariable("id") String id) { + Map map = new HashMap<>(2); + int type = 0; // 0未开启权限,1有 + List list = new ArrayList<>(); + // 获取当前菜单开启了哪些权限 + ModuleEntity entity = moduleService.getInfo(id); + if (entity == null) { + return ActionResult.fail(MsgCode.FA001.get()); + } + // 权限是否被绑定,是否有权限 + List buttonList = buttonService.getListByModuleIds(id); + List columnList = columnService.getList(id); + List formList = formService.getList(id); + List dataAuthorizeList = dataAuthorizeSchemeService.getList(id); + if (buttonList.size() > 0 || columnList.size() > 0 || formList.size() > 0 || dataAuthorizeList.size() > 0) { + List authorizeByItem = authorizeApi.getAuthorizeByItem(AuthorizeType.MODULE, + entity.getId()); + List collect = authorizeByItem.stream().map(AuthorizeEntity::getObjectId) + .collect(Collectors.toList()); + List permissionGroupByUserId = permissionGroupApi.list(collect); + list = JsonUtil.getJsonToList(permissionGroupByUserId, FlowWorkModel.class); + list.forEach(t -> t.setIcon("icon-ym icon-ym-authGroup")); + if (list.size() > 0) { + type = 1; + } else { + type = 2; + } + } + map.put("list", list); + map.put("type", type); + return ActionResult.success(map); + } + + /** + * 通过权限组id获取相关权限 + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "通过权限组id获取相关权限") + @Parameters({ + @Parameter(name = "id", description = "权限组id", required = true) + }) + @GetMapping("/getPermission/{id}/{permissionId}") + public ActionResult getPermission(@PathVariable("id") String id, + @PathVariable("permissionId") String permissionId) { + // 获取当前菜单开启了哪些权限 + ModuleEntity entity = moduleService.getInfo(id); + if (entity == null) { + return ActionResult.fail(MsgCode.FA001.get()); + } + PermissionGroupEntity permissionGroupEntity = permissionGroupApi.info(permissionId); + if (permissionGroupEntity == null) { + return ActionResult.fail(MsgCode.FA001.get()); + } + // 权限组的权限 + List authList = authorizeApi.getListByObjectId(Collections.singletonList(permissionId)); + + ModulePermissionVO modulePermissionVO = new ModulePermissionVO(); + + ModulePermissionModel permissionMemberModel = new ModulePermissionModel(); + permissionMemberModel.setFullName("权限成员"); + permissionMemberModel.setType(1); + List permissionMember = new ArrayList<>(); + if (StringUtil.isNotEmpty(permissionGroupEntity.getPermissionMember())) { + List userIdListVos = userApi + .selectedByIds(Arrays.asList(permissionGroupEntity.getPermissionMember().split(","))); + permissionMember = JsonUtil.getJsonToList(userIdListVos, + ModulePermissionModel.ModulePermissionBaseModel.class); + } + permissionMemberModel.setList(permissionMember); + modulePermissionVO.setPermissionMember(permissionMemberModel); + + ModulePermissionModel moduleButtonPermissionModel = new ModulePermissionModel(); + moduleButtonPermissionModel.setFullName("按钮权限"); + List buttonList = buttonService.getListByModuleIds(id); + if (buttonList.size() > 0) { + int type = 2; + List collect = buttonList.stream() + .filter(t -> authList.stream().map(AuthorizeEntity::getItemId).collect(Collectors.toList()) + .contains(t.getId())) + .collect(Collectors.toList()); + List buttonPermissionList = JsonUtil.getJsonToList(collect, + ModulePermissionModel.ModulePermissionBaseModel.class); + moduleButtonPermissionModel.setList(buttonPermissionList); + if (buttonPermissionList.size() > 0) { + type = 1; + } + moduleButtonPermissionModel.setType(type); + } + modulePermissionVO.setButtonAuthorize(moduleButtonPermissionModel); + + ModulePermissionModel moduleColumnPermissionModel = new ModulePermissionModel(); + moduleColumnPermissionModel.setFullName("列表权限"); + List columnList = columnService.getList(id); + if (columnList.size() > 0) { + int type = 2; + List collect = columnList.stream() + .filter(t -> authList.stream().map(AuthorizeEntity::getItemId).collect(Collectors.toList()) + .contains(t.getId())) + .collect(Collectors.toList()); + List buttonPermissionList = JsonUtil.getJsonToList(collect, + ModulePermissionModel.ModulePermissionBaseModel.class); + moduleColumnPermissionModel.setList(buttonPermissionList); + if (buttonPermissionList.size() > 0) { + type = 1; + } + moduleColumnPermissionModel.setType(type); + } + modulePermissionVO.setColumnAuthorize(moduleColumnPermissionModel); + + ModulePermissionModel moduleFromPermissionModel = new ModulePermissionModel(); + moduleFromPermissionModel.setFullName("表单权限"); + List formList = formService.getList(id); + if (formList.size() > 0) { + int type = 2; + List collect = formList.stream() + .filter(t -> authList.stream().map(AuthorizeEntity::getItemId).collect(Collectors.toList()) + .contains(t.getId())) + .collect(Collectors.toList()); + List buttonPermissionList = JsonUtil.getJsonToList(collect, + ModulePermissionModel.ModulePermissionBaseModel.class); + moduleFromPermissionModel.setList(buttonPermissionList); + if (buttonPermissionList.size() > 0) { + type = 1; + } + moduleFromPermissionModel.setType(type); + } + modulePermissionVO.setFormAuthorize(moduleFromPermissionModel); + + ModulePermissionModel moduleDataPermissionModel = new ModulePermissionModel(); + moduleDataPermissionModel.setFullName("数据权限"); + List dataAuthorizeList = dataAuthorizeSchemeService.getList(id); + if (dataAuthorizeList.size() > 0) { + int type = 2; + List collect = dataAuthorizeList.stream() + .filter(t -> authList.stream().map(AuthorizeEntity::getItemId).collect(Collectors.toList()) + .contains(t.getId())) + .collect(Collectors.toList()); + List buttonPermissionList = JsonUtil.getJsonToList(collect, + ModulePermissionModel.ModulePermissionBaseModel.class); + moduleDataPermissionModel.setList(buttonPermissionList); + if (buttonPermissionList.size() > 0) { + type = 1; + } + moduleDataPermissionModel.setType(type); + } + modulePermissionVO.setDataAuthorize(moduleDataPermissionModel); + + return ActionResult.success(modulePermissionVO); + } + + /** + * 获取菜单列表(下拉框) + * + * @param category 分类 + * @return ignore + */ + @Operation(summary = "获取菜单列表下拉框") + @GetMapping("/Selector/All") + public ActionResult> menuSelect(String category) { + List data = moduleService.getList("0", category, null, null, 1, null, false); + List list = JsonUtil.getJsonToList(data, UserMenuModel.class); + List moduleAuthorize = new ArrayList<>(); + if (configValueUtil.isMultiTenancy()) { + TenantAuthorizeModel tenantAuthorizeModel = TenantDataSourceUtil + .getCacheModuleAuthorize(UserProvider.getUser().getTenantId()); + moduleAuthorize = tenantAuthorizeModel.getModuleIdList(); + } + List list1 = systemService.getList(null, true, false, false, false, moduleAuthorize); + list.forEach(t -> { + t.setHasModule(!"1".equals(String.valueOf(t.getType()))); + if ("-1".equals(t.getParentId())) { + t.setParentId(t.getSystemId()); + } + }); + List jsonToList = JsonUtil.getJsonToList(list1, UserMenuModel.class); + jsonToList.forEach(t -> { + t.setType(0); + t.setHasModule(false); + t.setParentId("-1"); + }); + list.addAll(jsonToList); + List> menuList = TreeDotUtils.convertListToTreeDotFilter(list); + List menuvo = JsonUtil.getJsonToList(menuList, MenuSelectAllVO.class); + ListVO vo = new ListVO(); + vo.setList(menuvo); + return ActionResult.success(vo); + } + + /** + * 系统功能类别树形 + * + * @return ignore + */ + @Operation(summary = "系统功能类别树形") + @GetMapping("/{systemId}/TreeView") + public ActionResult treeView(@PathVariable("systemId") String systemId) { + List moduleList = moduleService.getList(systemId, null, null, null, null, "0", true); + List treeList = new ArrayList<>(); + TreeViewModel treeViewModel = new TreeViewModel(); + treeViewModel.setId("apply"); + treeViewModel.setText("软件开发平台"); + treeViewModel.setParentId("0"); + treeViewModel.setImg("fa fa-windows apply"); + treeList.add(treeViewModel); + for (ModuleEntity entity : moduleList) { + TreeViewModel treeModel = new TreeViewModel(); + treeModel.setId(entity.getId()); + treeModel.setText(entity.getFullName()); + treeModel.setParentId("apply"); + treeModel.setImg("fa fa-tags"); + treeList.add(treeModel); + } + return ActionResult.success(ListToTreeUtil.toTreeView(treeList)); + } + + /** + * 获取菜单信息 + * + * @param id 主键值 + * @return ignore + * @throws DataException ignore + */ + @Operation(summary = "获取菜单信息") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.menu") + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) throws DataException { + ModuleEntity entity = moduleService.getInfo(id); + ModuleInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, ModuleInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 新建系统功能 + * + * @param moduleCrForm 实体对象 + * @return ignore + */ + @Operation(summary = "新建系统功能") + @Parameters({ + @Parameter(name = "moduleCrForm", description = "实体对象", required = true) + }) + @SaCheckPermission("system.menu") + @PostMapping + public ActionResult create(@RequestBody @Valid ModuleCrForm moduleCrForm) { + ModuleEntity entity = JsonUtil.getJsonToBean(moduleCrForm, ModuleEntity.class); + if (entity.getUrlAddress() != null) { + entity.setUrlAddress(entity.getUrlAddress().trim()); + } + if (moduleService.isExistByFullName(entity, moduleCrForm.getCategory(), moduleCrForm.getSystemId())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (moduleService.isExistByEnCode(entity, moduleCrForm.getCategory(), moduleCrForm.getSystemId())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + moduleService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 更新系统功能 + * + * @param id 主键值 + * @param moduleUpForm 实体对象 + * @return ignore + */ + @Operation(summary = "更新系统功能") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true), + @Parameter(name = "moduleUpForm", description = "实体对象", required = true) + }) + @SaCheckPermission("system.menu") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid ModuleUpForm moduleUpForm) { + ModuleEntity entity = JsonUtil.getJsonToBean(moduleUpForm, ModuleEntity.class); + // 判断如果是目录则不能修改类型 + ModuleEntity moduleEntity = moduleService.getInfo(id); + if (moduleEntity != null && moduleEntity.getType() == 1 && entity.getType() != 1 + && moduleService.getList(moduleEntity.getId()).size() > 0) { + return ActionResult.fail(MsgCode.SYS016.get()); + } + entity.setId(id); + if (entity.getUrlAddress() != null) { + entity.setUrlAddress(entity.getUrlAddress().trim()); + } + if (moduleService.isExistByFullName(entity, moduleUpForm.getCategory(), moduleUpForm.getSystemId())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (moduleService.isExistByEnCode(entity, moduleUpForm.getCategory(), moduleUpForm.getSystemId())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + boolean flag = moduleService.update(id, entity); + if (!flag) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除系统功能 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "删除系统功能") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.menu") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + ModuleEntity entity = moduleService.getInfo(id); + if (entity != null) { + List list = moduleService.getList(false, new ArrayList<>(), new ArrayList<>()).stream() + .filter(t -> t.getParentId().equals(entity.getId())).collect(Collectors.toList()); + if (list.size() > 0) { + return ActionResult.fail(MsgCode.SYS017.get()); + } + moduleService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + /** + * 更新菜单状态 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "更新菜单状态") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.menu") + @PutMapping("/{id}/Actions/State") + public ActionResult upState(@PathVariable("id") String id) { + ModuleEntity entity = moduleService.getInfo(id); + if (entity != null) { + if (entity.getEnabledMark() == null || "1".equals(String.valueOf(entity.getEnabledMark()))) { + entity.setEnabledMark(0); + } else { + entity.setEnabledMark(1); + } + moduleService.update(id, entity); + // 清除redis权限 + String cacheKey = cacheKeyUtil.getUserAuthorize() + UserProvider.getUser().getUserId(); + if (redisUtil.exists(cacheKey)) { + redisUtil.remove(cacheKey); + } + return ActionResult.success(MsgCode.SU004.get()); + } + return ActionResult.fail(MsgCode.FA002.get()); + } + + /** + * 系统菜单导出功能 + * + * @param id 接口id + * @return ignore + */ + @Operation(summary = "导出系统菜单数据") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.menu") + @GetMapping("/{id}/Actions/Export") + public ActionResult exportFile(@PathVariable("id") String id) { + DownloadVO downloadVO = moduleService.exportData(id); + return ActionResult.success(downloadVO); + } + + /** + * 系统菜单导入功能 + * + * @param systemId 系统id + * @param multipartFile 文件 + * @param parentId 父级id + * @param category 分类 + * @return ignore + */ + @Operation(summary = "系统菜单导入功能") + @Parameters({ + @Parameter(name = "systemId", description = "系统id", required = true), + }) + @SaCheckPermission("system.menu") + @PostMapping(value = "/{systemId}/Actions/Import", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ActionResult importFile(@PathVariable("systemId") String systemId, + @RequestPart("file") MultipartFile multipartFile, + @RequestParam("parentId") String parentId, + @RequestParam("category") String category, + @RequestParam("type") Integer type) throws DataException { + // 判断是否为.bm结尾 + if (FileUtil.existsSuffix(multipartFile, ModuleTypeEnum.SYSTEM_MODULE.getTableName())) { + return ActionResult.fail(MsgCode.IMP002.get()); + } + try { + // 读取文件内容 + String fileContent = FileUtil.getFileContent(multipartFile); + // 转model后导入 + ModuleExportModel exportModel = JsonUtil.getJsonToBean(fileContent, ModuleExportModel.class); + ModuleEntity moduleEntity = exportModel.getModuleEntity(); + if (!category.equals(moduleEntity.getCategory())) { + return ActionResult.fail(MsgCode.SYS018.get(category.toUpperCase())); + } + if ("App".equals(moduleEntity.getCategory()) && "-1".equals(parentId)) { + return ActionResult.fail(MsgCode.SYS019.get()); + } + // 设置系统id然后重新赋值 + moduleEntity.setSystemId(systemId); + moduleEntity.setParentId(parentId); + // 清空同步菜单记录 避免重复 + moduleEntity.setModuleId(null); + moduleEntity.setCreatorTime(new Date()); + // String enCode = moduleEntity.getEnCode(); + // moduleEntity.setEnCode(moduleEntity.getEnCode() + "_" + + // RandomUtil.getRandomCode()); + // if (moduleEntity.getType() == 3) { + // moduleEntity.setUrlAddress(moduleEntity.getUrlAddress().replace(enCode, + // moduleEntity.getEnCode())); + // } + exportModel.setModuleEntity(moduleEntity); + return moduleService.importData(exportModel, type); + } catch (Exception e) { + throw new DataException(MsgCode.IMP004.get()); + } + } + + // ------------------多租户调用 + /** + * 通过租户id获取菜单 + * + * @param tenantMenuModel 模型 + * @return ignore + */ + @Operation(summary = "通过租户id获取菜单") + @Parameters({ + @Parameter(name = "tenantMenuModel", description = "模型", required = true) + }) + @NoDataSourceBind + @PostMapping("/Tenant/Menu") + public TenantMenuVO menu(@RequestBody TenantMenuModel tenantMenuModel) throws DataException { + if (configValueUtil.isMultiTenancy()) { + TenantDataSourceUtil.switchTenant(tenantMenuModel.getTenantId()); + } + List systemEntityList = systemService.getList(); + List ids = new ArrayList<>(); + if (Objects.nonNull(tenantMenuModel.getIds())) { + ids = tenantMenuModel.getIds(); + } + List urlAddressList = new ArrayList<>(); + if (Objects.nonNull(tenantMenuModel.getIds())) { + urlAddressList = tenantMenuModel.getUrlAddressList(); + } + List moduleEntityList = moduleService.getList(true, new ArrayList<>(), new ArrayList<>()); + TenantMenuVO module = module(systemEntityList, moduleEntityList, ids, urlAddressList); + return module; + } + + /** + * 功能权限 + * + * @param moduleEntityList 所有菜单 + * @param systemEntityList 所有应用 + * @return + */ + private TenantMenuVO module(List systemEntityList, List moduleEntityList, + List ids, List urlAddressList) { + TenantMenuVO vo = new TenantMenuVO(); + // 转树前所有数据 + List moduleAllList = new ArrayList<>(); + List systemList = JsonUtil.getJsonToList(systemEntityList, TenantMenuTreeModel.class); + systemList.forEach(t -> t.setParentId("-1")); + moduleAllList.addAll(systemList); + Map> moduleMap = moduleEntityList.stream().collect(Collectors.groupingBy(t -> { + if ("Web".equals(t.getCategory())) { + return "Web"; + } else { + return "App"; + } + })); + List webModuleList = moduleMap.get("Web") == null ? new ArrayList<>() : moduleMap.get("Web"); + List appModuleList = moduleMap.get("App") == null ? new ArrayList<>() : moduleMap.get("App"); + Map appModuleMap = appModuleList.stream() + .collect(Collectors.toMap(ModuleEntity::getId, Function.identity())); + Map webIds = new HashMap<>(16); + List temWebList = webModuleList.stream().filter(t -> "-1".equals(t.getParentId())) + .collect(Collectors.toList()); + temWebList.stream().filter(t -> "-1".equals(t.getParentId())).forEach(t -> { + if (!webIds.containsKey(t.getSystemId())) { + ModuleEntity webData = new ModuleEntity(); + webData.setId(t.getSystemId() + "1"); + t.setParentId(webData.getId()); + webData.setFullName("WEB菜单"); + webData.setIcon("icon-ym icon-ym-pc"); + webData.setParentId(t.getSystemId()); + webData.setSystemId(t.getSystemId()); + webModuleList.add(webData); + webIds.put(t.getSystemId(), webData.getId()); + } else { + t.setParentId(webIds.get(t.getSystemId()) + ""); + } + }); + List webReturnModuleList = JsonUtil.getJsonToList(webModuleList, + TenantMenuTreeModel.class); + moduleAllList.addAll(webReturnModuleList); + // 处理App菜单 + List temList = appModuleList.stream() + .filter(t -> "-1".equals(t.getParentId()) && !YunzhupaasConst.MAIN_SYSTEM_CODE.equals(t.getEnCode())) + .collect(Collectors.toList()); + Map appIds = new HashMap<>(16); + for (ModuleEntity appModuleEntity : temList) { + if (StringUtil.isEmpty(appIds.get(appModuleEntity.getSystemId()))) { + ModuleEntity appData = new ModuleEntity(); + appData.setId(appModuleEntity.getSystemId() + appModuleEntity.getSystemId() + "2"); + appModuleEntity.setParentId(appData.getId()); + appData.setFullName("APP菜单"); + appData.setIcon("icon-ym icon-ym-mobile"); + appData.setParentId(appModuleEntity.getSystemId()); + appData.setSystemId(appModuleEntity.getSystemId()); + appModuleList.add(appData); + appIds.put(appModuleEntity.getSystemId(), appData.getId()); + } else { + appModuleList.remove(appModuleEntity); + ModuleEntity entity = appModuleMap.get(appModuleEntity.getId()); + entity.setParentId(appIds.get(appModuleEntity.getSystemId())); + appModuleList.add(entity); + } + } + List appReturnModuleList = JsonUtil.getJsonToList(appModuleList, + TenantMenuTreeModel.class); + moduleAllList.addAll(appReturnModuleList); + List> sumTrees = TreeDotUtils.convertListToTreeDot(moduleAllList); + List data = new ArrayList<>(); + TenantMenuTreeReturnModel workFlowEnabled = new TenantMenuTreeReturnModel(); + workFlowEnabled.setId("-999"); + workFlowEnabled.setFullName("协同办公"); + data.add(workFlowEnabled); + data.addAll(JsonUtil.getJsonToList(sumTrees, TenantMenuTreeReturnModel.class)); + vo.setList(data); + List allId = moduleAllList.stream().map(TenantMenuTreeModel::getId).collect(Collectors.toList()); + allId.add(workFlowEnabled.getId()); + vo.setAll(allId); + List ids0 = moduleService.getListByUrlAddress(ids, urlAddressList).stream().map(ModuleEntity::getId) + .collect(Collectors.toList()); + List selectorIds = allId.stream().filter(t -> !ids0.contains(t)).collect(Collectors.toList()); + if (ids.contains("-999")) { + selectorIds.remove("-999"); + } + vo.setIds(selectorIds); + return vo; + } + + /** + * 通过租户id及菜单id获取菜单 + * + * @param tenantMenuModel 模型 + * @return ignore + */ + @Operation(summary = "通过租户id及菜单id获取菜单") + @Parameters({ + @Parameter(name = "tenantMenuModel", description = "模型", required = true) + }) + @NoDataSourceBind + @PostMapping("/Tenant/MenuByIds") + public Map MenuByIds(@RequestBody TenantMenuModel tenantMenuModel) throws DataException { + if (configValueUtil.isMultiTenancy()) { + TenantDataSourceUtil.switchTenant(tenantMenuModel.getTenantId()); + } + List list = moduleService.getList(); + return list.stream().collect(Collectors.toMap(ModuleEntity::getId, ModuleEntity::getUrlAddress)); + } + + /** + * 获取在线开发“表单”和“流程”类型的菜单数据 + */ + @Operation(summary = "菜单获取表单列表") + @GetMapping("/Selector/Form") + @Parameters({ + @Parameter(name = "systemId", description = "系统id", required = false), + }) + public ActionResult getFormList(ModulePagination pagination) { + List list = moduleService.getFormMenuList(pagination); + list.stream().forEach(t -> { + t.setTypeName(Objects.equals(t.getType(), 3) ? "表单" : "流程"); + PropertyJsonModel model = JsonUtil.getJsonToBean(t.getPropertyJson(), PropertyJsonModel.class); + if (Objects.equals(t.getType(), 3)) { + t.setFormId(model.getModuleId()); + } else { + t.setFlowId(model.getModuleId()); + t.setFormId(templateApi.getFormByFlowId(model.getModuleId())); + } + }); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(list, paginationVO); + } + + /** + * 报表发布菜单 + * + * @return ignore + */ + @Operation(summary = "报表发布菜单") + @Parameters({ + @Parameter(name = "menuModel", description = "模型", required = true) + }) + @PostMapping("/saveReportMenu") + public ActionResult saveReportMenu(@RequestBody VisualMenuModel menuModel) { + try { + pubulishUtil.publishMenu(menuModel); + return ActionResult.success(); + } catch (WorkFlowException e) { + return ActionResult.fail(e.getMessage()); + } + } + + /** + * 报表发布菜单 + * + * @return ignore + */ + @Operation(summary = "获取报表发布菜单") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @PostMapping("/getReportMenu") + public ActionResult getReportMenu(@RequestBody VisualMenuModel menuModel) { + ModuleNameVO moduleNameVO = moduleService.getModuleNameList(menuModel.getId()); + return ActionResult.success(moduleNameVO); + } + + /** + * 获取系统菜单列表(下拉树形) + */ + @Operation(summary = "获取系统菜单列表(下拉树形)") + @GetMapping("/getSystemMenu") + public ActionResult> getSystemMenu() { + List systemMenu = moduleService.getSystemMenu(3, Arrays.asList(2, 4), Arrays.asList("web")); + return ActionResult.success(systemMenu); + } +} diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/ModuleDataAuthorizeController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/ModuleDataAuthorizeController.java new file mode 100644 index 0000000..d801b45 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/ModuleDataAuthorizeController.java @@ -0,0 +1,315 @@ +package com.yunzhupaas.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import com.yunzhupaas.base.controller.SuperController; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.entity.ModuleDataAuthorizeSchemeEntity; +import com.yunzhupaas.base.entity.ModuleEntity; +import com.yunzhupaas.base.model.module.PropertyJsonModel; +import com.yunzhupaas.base.service.ModuleDataAuthorizeSchemeService; +import com.yunzhupaas.base.service.ModuleDataAuthorizeService; +import com.yunzhupaas.base.service.ModuleService; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.base.entity.ModuleDataAuthorizeEntity; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.emnus.SearchMethodEnum; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.base.model.moduledataauthorize.DataAuthorizeCrForm; +import com.yunzhupaas.base.model.moduledataauthorize.DataAuthorizeInfoVO; +import com.yunzhupaas.base.model.moduledataauthorize.DataAuthorizeListVO; +import com.yunzhupaas.base.model.moduledataauthorize.DataAuthorizeUpForm; +import com.yunzhupaas.model.*; +import com.yunzhupaas.model.visualJson.FieLdsModel; +import com.yunzhupaas.model.visualJson.FormCloumnUtil; +import com.yunzhupaas.model.visualJson.FormDataModel; +import com.yunzhupaas.model.visualJson.TableModel; +import com.yunzhupaas.model.visualJson.analysis.*; +import com.yunzhupaas.permission.model.authorize.AuthorizeConditionEnum; +import com.yunzhupaas.permission.model.authorize.ConditionModel; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.JsonUtilEx; +import com.yunzhupaas.util.ReflectionUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.context.SpringContext; +import org.apache.commons.collections4.map.HashedMap; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; + +/** + * 数据权限配置 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Tag(name = "数据权限字段管理", description = "ModuleDataAuthorize") +@RestController +@RequestMapping("/api/system/ModuleDataAuthorize") +public class ModuleDataAuthorizeController + extends SuperController { + + @Autowired + private ModuleDataAuthorizeService dataAuthorizeService; + @Autowired + private ModuleDataAuthorizeSchemeService dataAuthorizeSchemeService; + @Autowired + private ModuleService moduleService; + + /** + * 获取数据权限配置信息列表 + * + * @param moduleId 功能主键 + * @return ignore + */ + @Operation(summary = "获取字段列表") + @Parameters({ + @Parameter(name = "moduleId", description = "功能主键", required = true) + }) + @SaCheckPermission("system.menu") + @GetMapping("/{moduleId}/List") + public ActionResult> list(@PathVariable("moduleId") String moduleId) { + List data = dataAuthorizeService.getList(moduleId); + List list = JsonUtil.getJsonToList(data, DataAuthorizeListVO.class); + list.stream().forEach(t -> { + String conditionSymbol = StringUtil.isNotEmpty(t.getConditionSymbol()) ? t.getConditionSymbol() : ""; + StringJoiner symbolJoiner = new StringJoiner(","); + String[] symbolSplit = conditionSymbol.split(","); + for (String id : symbolSplit) { + SearchMethodEnum itemMethod = SearchMethodEnum.getSearchMethod(id); + if (itemMethod != null) { + symbolJoiner.add(itemMethod.getMessage()); + } + } + t.setConditionText(StringUtil.isNotEmpty(t.getConditionText()) ? t.getConditionText() : ""); + StringJoiner textJoiner = new StringJoiner(","); + String conditionText = StringUtil.isNotEmpty(t.getConditionText()) ? t.getConditionText() : ""; + String[] textSplit = conditionText.split(","); + for (String id : textSplit) { + AuthorizeConditionEnum itemMethod = AuthorizeConditionEnum.getByMessage(id); + if (itemMethod != null) { + textJoiner.add(itemMethod.getMessage()); + } + } + t.setConditionSymbolName(symbolJoiner.toString()); + t.setConditionName(textJoiner.toString()); + if (StringUtil.isNotEmpty(t.getBindTable())) { + t.setEnCode( + StringUtil.isNotEmpty(t.getEnCode()) ? t.getEnCode().replace(t.getBindTable() + ".", "") : ""); + } + }); + + ListVO vo = new ListVO<>(); + vo.setList(list); + return ActionResult.success(vo); + } + + /** + * 菜单数据权限 + * + * @param moduleId 功能主键 + * @return ignore + */ + @Operation(summary = "菜单数据权限") + @Parameters({ + @Parameter(name = "moduleId", description = "功能主键", required = true) + }) + @SaCheckPermission("system.menu") + @GetMapping("/{moduleId}/FieldList") + public ActionResult>> fieldList(@PathVariable("moduleId") String moduleId) { + List> list = new ArrayList<>(); + // 得到菜单id + ModuleEntity entity = moduleService.getInfo(moduleId); + PropertyJsonModel model = JsonUtil.getJsonToBean(entity.getPropertyJson(), PropertyJsonModel.class); + if (model == null) { + model = new PropertyJsonModel(); + } + // 得到bean + Object bean = SpringContext.getBean("visualdevServiceImpl"); + Object method = ReflectionUtil.invokeMethod(bean, "getInfo", new Class[] { String.class }, + new Object[] { model.getModuleId() }); + Map map = JsonUtil.entityToMap(method); + if (map != null && map.containsKey("formData")) { + FormDataModel formDataModel = JsonUtil.getJsonToBean(String.valueOf(map.get("formData")), + FormDataModel.class); + List fieLdsModelList = JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class); + RecursionForm recursionForm = new RecursionForm(); + recursionForm.setList(fieLdsModelList); + recursionForm + .setTableModelList(JsonUtil.getJsonToList(String.valueOf(map.get("tables")), TableModel.class)); + List formAllModel = new ArrayList<>(); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + for (FormAllModel allModel : formAllModel) { + if (FormEnum.table.getMessage().equals(allModel.getYunzhupaasKey())) { + FormColumnTableModel childList = allModel.getChildList(); + List childList1 = childList.getChildList(); + for (FormColumnModel formColumnModel : childList1) { + FieLdsModel fieLdsModel = formColumnModel.getFieLdsModel(); + if (StringUtil.isNotEmpty(fieLdsModel.getVModel())) { + Map map1 = new HashedMap<>(); + map1.put("field", fieLdsModel.getVModel()); + map1.put("fieldName", fieLdsModel.getConfig().getLabel()); + list.add(map1); + } + } + } else if (FormEnum.mast.getMessage().equals(allModel.getYunzhupaasKey())) { + FormColumnModel formColumnModel = allModel.getFormColumnModel(); + FieLdsModel fieLdsModel = formColumnModel.getFieLdsModel(); + if (StringUtil.isNotEmpty(fieLdsModel.getVModel())) { + Map map1 = new HashedMap<>(); + map1.put("field", fieLdsModel.getVModel()); + map1.put("fieldName", fieLdsModel.getConfig().getLabel()); + list.add(map1); + } + } else if (FormEnum.mastTable.getMessage().equals(allModel.getYunzhupaasKey())) { + FormMastTableModel formColumnModel = allModel.getFormMastTableModel(); + FieLdsModel fieLdsModel = formColumnModel.getMastTable().getFieLdsModel(); + if (StringUtil.isNotEmpty(fieLdsModel.getVModel())) { + Map map1 = new HashedMap<>(); + map1.put("field", fieLdsModel.getVModel()); + map1.put("fieldName", fieLdsModel.getConfig().getLabel()); + list.add(map1); + } + } + } + } + return ActionResult.success(list); + } + + /** + * 获取数据权限配置信息 + * + * @param id 主键值 + * @return ignore + * @throws DataException ignore + */ + @Operation(summary = "获取数据权限配置信息") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.menu") + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) throws DataException { + ModuleDataAuthorizeEntity entity = dataAuthorizeService.getInfo(id); + ModuleEntity moduleEntity = moduleService.getInfo(entity.getModuleId()); + if (moduleEntity != null && StringUtil.isNotEmpty(entity.getBindTable())) { + entity.setEnCode(StringUtil.isNotEmpty(entity.getEnCode()) + ? entity.getEnCode().replace(entity.getBindTable() + ".", "") + : ""); + } + DataAuthorizeInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, DataAuthorizeInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 新建数据权限配置 + * + * @param dataAuthorizeCrForm 实体对象 + * @return ignore + */ + @Operation(summary = "新建数据权限配置") + @Parameters({ + @Parameter(name = "dataAuthorizeCrForm", description = "实体对象", required = true) + }) + @SaCheckPermission("system.menu") + @PostMapping + public ActionResult create(@RequestBody @Valid DataAuthorizeCrForm dataAuthorizeCrForm) { + ModuleEntity moduleEntity = moduleService.getInfo(dataAuthorizeCrForm.getModuleId()); + ModuleDataAuthorizeEntity entity = JsonUtil.getJsonToBean(dataAuthorizeCrForm, ModuleDataAuthorizeEntity.class); + entity.setPropertyJson(dataAuthorizeCrForm.getChildTableKey()); + if (moduleEntity != null && moduleEntity.getType() == 3 && entity.getFieldRule() != 0 + && StringUtil.isNotEmpty(entity.getBindTable())) { + String enCode = entity.getBindTable() + "." + entity.getEnCode(); + entity.setEnCode(enCode); + } + dataAuthorizeService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 更新数据权限配置 + * + * @param id 主键值 + * @param dataAuthorizeUpForm 实体对象 + * @return ignore + */ + @Operation(summary = "更新数据权限配置") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true), + @Parameter(name = "dataAuthorizeUpForm", description = "实体对象", required = true) + }) + @SaCheckPermission("system.menu") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, + @RequestBody @Valid DataAuthorizeUpForm dataAuthorizeUpForm) { + ModuleEntity moduleEntity = moduleService.getInfo(dataAuthorizeUpForm.getModuleId()); + ModuleDataAuthorizeEntity entity = JsonUtil.getJsonToBean(dataAuthorizeUpForm, ModuleDataAuthorizeEntity.class); + if (moduleEntity != null && moduleEntity.getType() == 3 && entity.getFieldRule() == 1 + && StringUtil.isNotEmpty(entity.getBindTable())) { + String enCode = entity.getBindTable() + "." + entity.getEnCode(); + entity.setEnCode(enCode); + } + entity.setPropertyJson(dataAuthorizeUpForm.getChildTableKey()); + boolean flag = dataAuthorizeService.update(id, entity); + if (!flag) { + return ActionResult.success(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除数据权限配置 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "删除数据权限配置") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.menu") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + ModuleDataAuthorizeEntity entity = dataAuthorizeService.getInfo(id); + // 菜单id + String moduleId = entity.getModuleId(); + // 该菜单下的数据权限方案 + List list = dataAuthorizeSchemeService.getList(moduleId); + + String schemeName = null; + for (ModuleDataAuthorizeSchemeEntity schemeEntity : list) { + List conditionModels = JsonUtil.getJsonToList(schemeEntity.getConditionJson(), + ConditionModel.class); + if (conditionModels != null) { + for (ConditionModel conditionModel : conditionModels) { + List groups = conditionModel.getGroups(); + for (ConditionModel.ConditionItemModel conditionItemModel : groups) { + if (conditionItemModel.getField().equalsIgnoreCase(entity.getEnCode())) { + schemeName = schemeEntity.getFullName(); + break; + } + } + } + } + } + if (StringUtil.isNotEmpty(schemeName)) { + return ActionResult.fail(MsgCode.SYS020.get(schemeName)); + } + if (entity != null) { + dataAuthorizeService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + +} diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/ModuleDataAuthorizeLinkController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/ModuleDataAuthorizeLinkController.java new file mode 100644 index 0000000..91cf4ec --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/ModuleDataAuthorizeLinkController.java @@ -0,0 +1,187 @@ +package com.yunzhupaas.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.util.ObjectUtil; +import com.google.common.base.CaseFormat; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.entity.ModuleDataAuthorizeLinkEntity; +import com.yunzhupaas.base.entity.ModuleEntity; +import com.yunzhupaas.base.model.dbtable.vo.DbFieldVO; +import com.yunzhupaas.base.model.module.PropertyJsonModel; +import com.yunzhupaas.base.model.moduledataauthorize.DataAuthorizeLinkForm; +import com.yunzhupaas.base.model.moduledataauthorize.DataAuthorizeTableNameVO; +import com.yunzhupaas.base.service.DbTableService; +import com.yunzhupaas.base.service.ModuleDataAuthorizeLinkDataService; +import com.yunzhupaas.base.service.ModuleService; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.database.model.dbfield.DbFieldModel; +import com.yunzhupaas.model.visualJson.TableModel; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.context.SpringContext; +import com.yunzhupaas.workflow.service.TemplateApi; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 数据权限字段管理 数据连接 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/6/7 + */ +@Tag(name = "数据权限字段管理数据连接" , description = "ModuleDataAuthorizeLink") +@RestController +@RequestMapping("/api/system/ModuleDataAuthorizeLink") +public class ModuleDataAuthorizeLinkController { + + @Autowired + private ModuleDataAuthorizeLinkDataService linkDataService; + @Autowired + private ModuleService moduleService; + @Autowired + private DbTableService dbTableService; + @Autowired + private TemplateApi templateApi; + + /** + * 页面参数 + * + * @param linkForm 页面参数 + * @return + */ + @Operation(summary = "保存编辑数据连接") + @Parameters({ + @Parameter(name = "linkForm", description = "页面参数", required = true) + }) + @SaCheckPermission("system.menu") + @PostMapping("/saveLinkData") + public ActionResult saveLinkData(@RequestBody @Valid DataAuthorizeLinkForm linkForm) { + ModuleDataAuthorizeLinkEntity linkDataEntity = JsonUtil.getJsonToBean(linkForm, ModuleDataAuthorizeLinkEntity.class); + if (StringUtil.isEmpty(linkDataEntity.getId())) { + linkDataEntity.setId(RandomUtil.uuId()); + linkDataService.save(linkDataEntity); + return ActionResult.success(MsgCode.SU002.get()); + } else { + linkDataService.updateById(linkDataEntity); + return ActionResult.success(MsgCode.SU004.get()); + } + } + + /** + * 获取表名 + * + * @param menuId 菜单id + * @param type 分类 + * @return + */ + @Operation(summary = "获取表名") + @Parameters({ + @Parameter(name = "menuId", description = "菜单id", required = true), + @Parameter(name = "type", description = "分类", required = true) + }) + @SaCheckPermission("system.menu") + @GetMapping("/getVisualTables/{menuId}/{type}") + public ActionResult getVisualTables(@PathVariable("menuId") String menuId, @PathVariable("type") Integer type) { + ModuleEntity info = moduleService.getInfo(menuId); + DataAuthorizeTableNameVO vo = null; + if (ObjectUtil.isNotNull(info)) { + PropertyJsonModel model = JsonUtil.getJsonToBean(info.getPropertyJson(), PropertyJsonModel.class); + if (model == null) { + model = new PropertyJsonModel(); + } + //功能 + if (info.getType() == 3 || info.getType() ==9) { + String formId = model.getModuleId(); + if(info.getType()==9){ + formId = templateApi.getFormByFlowId(model.getModuleId()); + } + // 得到bean + Object bean = SpringContext.getBean("visualdevServiceImpl"); + Object method = ReflectionUtil.invokeMethod(bean, "getInfo" , new Class[]{String.class}, new Object[]{formId}); + Map map = JsonUtil.entityToMap(method); + if (map != null) { + List tables = JsonUtil.getJsonToList(String.valueOf(map.get("tables")), TableModel.class); + List collect = tables.stream().map(t -> t.getTable()).collect(Collectors.toList()); + vo = DataAuthorizeTableNameVO.builder().linkTables(collect).linkId(String.valueOf(map.get("dbLinkId"))).build(); + } + } else { + ModuleDataAuthorizeLinkEntity linkDataEntity = linkDataService.getLinkDataEntityByMenuId(menuId,type); + String linkTables = linkDataEntity.getLinkTables(); + List tables = StringUtil.isNotEmpty(linkTables) ? Arrays.asList(linkTables.split(",")) : new ArrayList<>(); + vo = DataAuthorizeTableNameVO.builder().linkTables(tables).linkId(linkDataEntity.getLinkId()).build(); + } + } + return ActionResult.success(vo); + } + + /** + * 数据连接信息 + * + * @param menudId 菜单id + * @param type 分类 + * @return + */ + @Operation(summary = "数据连接信息") + @Parameters({ + @Parameter(name = "menudId", description = "菜单id", required = true), + @Parameter(name = "type", description = "分类", required = true) + }) + @SaCheckPermission("system.menu") + @GetMapping("/getInfo/{menudId}/{type}") + public ActionResult getInfo(@PathVariable("menudId") String menudId,@PathVariable("type") Integer type) { + ModuleDataAuthorizeLinkEntity linkDataEntity = linkDataService.getLinkDataEntityByMenuId(menudId,type); + DataAuthorizeLinkForm linkForm = JsonUtil.getJsonToBean(linkDataEntity, DataAuthorizeLinkForm.class); + return ActionResult.success(linkForm); + } + + /** + * 表名获取数据表字段 + * + * @param linkId 连接id + * @param tableName 表名 + * @param menuType 菜单类型 + * @param dataType 数据类型 + * @param pagination 分页模型 + * @return + * @throws Exception + */ + @Operation(summary = "表名获取数据表字段") + @Parameters({ + @Parameter(name = "linkId", description = "连接id", required = true), + @Parameter(name = "tableName", description = "表名", required = true), + @Parameter(name = "menuType", description = "菜单类型", required = true), + @Parameter(name = "dataType", description = "数据类型", required = true) + }) + @SaCheckPermission("system.menu") + @GetMapping("/{linkId}/Tables/{tableName}/Fields/{menuType}/{dataType}") + public ActionResult getTableInfoByTableName(@PathVariable("linkId") String linkId, @PathVariable("tableName") String tableName, @PathVariable("menuType") Integer menuType,@PathVariable("dataType") Integer dataType, Pagination pagination) throws Exception { + List data = dbTableService.getFieldList(linkId, tableName); + List vos = JsonUtil.getJsonToList(data, DbFieldVO.class); + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + vos = vos.stream().filter(vo -> { + boolean ensure; + String fieldName = vo.getFieldName(); + fieldName = Optional.ofNullable(fieldName).orElse(""); + ensure = fieldName.toLowerCase().contains(pagination.getKeyword().toLowerCase()) || vo.getField().toLowerCase().contains(pagination.getKeyword().toLowerCase()); + return ensure; + }).collect(Collectors.toList()); + } + List listPage = PageUtil.getListPage((int) pagination.getCurrentPage(), (int) pagination.getPageSize(), vos); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + paginationVO.setTotal(vos.size()); + return ActionResult.page(listPage,paginationVO); + } +} + + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/ModuleDataAuthorizeSchemeController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/ModuleDataAuthorizeSchemeController.java new file mode 100644 index 0000000..c0fc325 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/ModuleDataAuthorizeSchemeController.java @@ -0,0 +1,170 @@ +package com.yunzhupaas.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import com.yunzhupaas.base.controller.SuperController; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.service.ModuleDataAuthorizeSchemeService; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.base.entity.ModuleDataAuthorizeSchemeEntity; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.base.model.moduledataauthorizescheme.DataAuthorizeSchemeCrForm; +import com.yunzhupaas.base.model.moduledataauthorizescheme.DataAuthorizeSchemeInfoVO; +import com.yunzhupaas.base.model.moduledataauthorizescheme.DataAuthorizeSchemeListVO; +import com.yunzhupaas.base.model.moduledataauthorizescheme.DataAuthorizeSchemeUpForm; +import com.yunzhupaas.permission.service.AuthorizeService; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.JsonUtilEx; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; +import java.util.ArrayList; +import java.util.List; + +/** + * 数据权限方案 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Tag(name = "数据权限方案", description = "ModuleDataAuthorizeScheme") +@RestController +@RequestMapping("/api/system/ModuleDataAuthorizeScheme") +public class ModuleDataAuthorizeSchemeController extends SuperController { + + @Autowired + private ModuleDataAuthorizeSchemeService schemeService; + + @Autowired + private AuthorizeService authorizeService; + + /** + * 列表 + * + * @param moduleId 功能主键 + * @return ignore + */ + @Operation(summary = "方案列表") + @Parameters({ + @Parameter(name = "moduleId", description = "功能主键", required = true) + }) + @GetMapping("/{moduleId}/List") + public ActionResult> list(@PathVariable("moduleId") String moduleId) { + List data = schemeService.getList(moduleId); + List list = JsonUtil.getJsonToList(data, DataAuthorizeSchemeListVO.class); + ListVO vo = new ListVO<>(); + vo.setList(list); + return ActionResult.success(vo); + } + + /** + * 信息 + * + * @param id 主键值 + * @return ignore + * @throws DataException ignore + */ + @Operation(summary = "获取方案信息") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.menu") + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) throws DataException { + ModuleDataAuthorizeSchemeEntity entity = schemeService.getInfo(id); + DataAuthorizeSchemeInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, DataAuthorizeSchemeInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 新建 + * + * @param dataAuthorizeSchemeCrForm 实体对象 + * @return ignore + */ + @Operation(summary = "新建方案") + @Parameters({ + @Parameter(name = "dataAuthorizeSchemeCrForm", description = "实体对象", required = true) + }) + @SaCheckPermission("system.menu") + @PostMapping + public ActionResult create(@RequestBody @Valid DataAuthorizeSchemeCrForm dataAuthorizeSchemeCrForm) { + ModuleDataAuthorizeSchemeEntity entity = JsonUtil.getJsonToBean(dataAuthorizeSchemeCrForm, ModuleDataAuthorizeSchemeEntity.class); + // 判断fullName是否重复 + if (schemeService.isExistByFullName(entity.getId(), entity.getFullName(), entity.getModuleId())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + // 判断encode是否重复 + if (schemeService.isExistByEnCode(entity.getId(), entity.getEnCode(), entity.getModuleId())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + schemeService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 更新 + * + * @param id 主键值 + * @param dataAuthorizeSchemeUpForm 实体对象 + * @return ignore + */ + @Operation(summary = "更新方案") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true), + @Parameter(name = "dataAuthorizeSchemeUpForm", description = "实体对象", required = true) + }) + @SaCheckPermission("system.menu") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid DataAuthorizeSchemeUpForm dataAuthorizeSchemeUpForm) { + ModuleDataAuthorizeSchemeEntity entity = JsonUtil.getJsonToBean(dataAuthorizeSchemeUpForm, ModuleDataAuthorizeSchemeEntity.class); + // 判断encode是否重复 + if ("1".equals(String.valueOf(entity.getAllData()))) { + return ActionResult.fail(MsgCode.SYS021.get()); + } + // 判断fullName是否重复 + if (schemeService.isExistByFullName(id, entity.getFullName(), entity.getModuleId())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + // 判断encode是否重复 + if (schemeService.isExistByEnCode(id, entity.getEnCode(), entity.getModuleId())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + boolean flag = schemeService.update(id, entity); + if (!flag) { + return ActionResult.success(MsgCode.FA002.get()); + } + authorizeService.removeAuthByUserOrMenu(null, new ArrayList(){{add(dataAuthorizeSchemeUpForm.getModuleId());}}); + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除 + * + * @param id 主键值 + * @return ignore + */ + @Operation(summary = "删除方案") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.menu") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + ModuleDataAuthorizeSchemeEntity entity = schemeService.getInfo(id); + if (entity != null) { + schemeService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/ModuleDataController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/ModuleDataController.java new file mode 100644 index 0000000..f18109c --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/ModuleDataController.java @@ -0,0 +1,132 @@ +package com.yunzhupaas.base.controller; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.Page; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.ModuleDataEntity; +import com.yunzhupaas.base.entity.ModuleEntity; +import com.yunzhupaas.base.service.ModuleDataService; +import com.yunzhupaas.base.service.ModuleService; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.consts.DeviceType; +import com.yunzhupaas.model.login.AllMenuSelectVO; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2024/5/6 上午11:19 + */ +@Tag(name = "常用菜单", description = "data") +@RestController +@RequestMapping("/api/system/MenuData") +public class ModuleDataController extends SuperController { + + @Autowired + private ModuleService moduleService; + @Autowired + private ModuleDataService moduleDataService; + + /** + * 常用菜单 + * + * @return ignore + */ + @Operation(summary = "常用菜单") + @GetMapping + public ActionResult> getDataList(Page page) { + UserInfo user = UserProvider.getUser(); + String category = DeviceType.PC.getDevice().equals(user.getLoginDevice())?"Web":"App"; + List list = moduleDataService.getList(category,page); + List listVO = new ArrayList<>(); + for (ModuleDataEntity entity : list) { + ModuleEntity info = moduleService.getInfo(entity.getModuleId()); + if(info != null && Objects.equals(info.getEnabledMark(),1)) { + AllMenuSelectVO vo = JsonUtil.getJsonToBean(info, AllMenuSelectVO.class); + vo.setHasChildren(false); + listVO.add(vo); + } + } + ListVO vo = new ListVO(); + vo.setList(listVO); + return ActionResult.success(vo); + } + + /** + * 新建 + * + * @return + */ + @PostMapping("/{id}") + @Operation(summary = "新建") + public ActionResult create(@PathVariable("id") String id) { + if (moduleDataService.isExistByObjectId(id)) { + return ActionResult.fail(MsgCode.FA036.get()); + } + moduleDataService.create(id); + return ActionResult.success(MsgCode.SU016.get()); + } + + /** + * 删除 + * + * @return + */ + @Operation(summary = "删除") + @DeleteMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult delete(@PathVariable("id") String id) { + ModuleDataEntity entity = moduleDataService.getInfo(id); + if (entity != null) { + moduleDataService.delete(entity); + return ActionResult.success(MsgCode.SU021.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + /** + * app常用菜单 + * + * @return + */ + @Operation(summary = "app常用菜单") + @GetMapping("/getDataList") + public ActionResult> getAllList(Page page) { + List list = moduleDataService.getDataList(page); + ListVO listVO = new ListVO(); + listVO.setList(list); + return ActionResult.success(listVO); + } + + /** + * app常用详情 + * + * @return + */ + @Operation(summary = "app常用详情") + @GetMapping("/getAppDataList") + public ActionResult> getAppDataList(Pagination pagination) { + List list = moduleDataService.getAppDataList(pagination); + ListVO listVO = new ListVO(); + listVO.setList(list); + return ActionResult.success(listVO); + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/ModuleFormController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/ModuleFormController.java new file mode 100644 index 0000000..5b79725 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/ModuleFormController.java @@ -0,0 +1,361 @@ +package com.yunzhupaas.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import com.yunzhupaas.base.controller.SuperController; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.entity.ModuleEntity; +import com.yunzhupaas.base.entity.ModuleFormEntity; +import com.yunzhupaas.base.model.form.*; +import com.yunzhupaas.base.model.module.PropertyJsonModel; +import com.yunzhupaas.base.service.ModuleFormService; +import com.yunzhupaas.base.service.ModuleService; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.model.*; +import com.yunzhupaas.model.visualJson.FieLdsModel; +import com.yunzhupaas.model.visualJson.FormCloumnUtil; +import com.yunzhupaas.model.visualJson.FormDataModel; +import com.yunzhupaas.model.visualJson.TableModel; +import com.yunzhupaas.model.visualJson.analysis.*; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.JsonUtilEx; +import com.yunzhupaas.util.ReflectionUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.context.SpringContext; +import org.apache.commons.collections4.map.HashedMap; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 表单权限 + * 版本: V3.1.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2021-09-14 + */ +@Tag(name = "表单权限", description = "ModuleForm") +@RestController +@RequestMapping("/api/system/ModuleForm") +public class ModuleFormController extends SuperController { + + @Autowired + private ModuleFormService moduleFormService; + @Autowired + private ModuleService moduleService; + + /** + * 获取表单权限列表 + * + * @param moduleId 功能主键 + * @param pagination 分页参数 + * @return ignore + */ + @Operation(summary = "获取表单权限列表") + @Parameters({ + @Parameter(name = "moduleId", description = "功能主键", required = true) + }) + @SaCheckPermission("system.menu") + @GetMapping("/{moduleId}/Fields") + public ActionResult> getList(@PathVariable("moduleId") String moduleId, + Pagination pagination) { + List list = moduleFormService.getList(moduleId, pagination); + List voList = JsonUtil.getJsonToList(list, ModuleFormListVO.class); + voList.stream().forEach(t -> { + String enCode = t.getEnCode(); + if (StringUtil.isNotEmpty(enCode)) { + if (enCode.contains("-")) { + enCode = enCode.substring(enCode.indexOf("-") + 1); + } + t.setEnCode(enCode.replace("yunzhupaas_" + t.getBindTable() + "_yunzhupaas_", "")); + } + }); + ListVO vo = new ListVO<>(); + vo.setList(voList); + return ActionResult.success(vo); + } + + /** + * 菜单数据权限 + * + * @param moduleId 功能主键 + * @return ignore + */ + @Operation(summary = "菜单数据权限") + @Parameters({ + @Parameter(name = "moduleId", description = "功能主键", required = true) + }) + @SaCheckPermission("system.menu") + @GetMapping("/{moduleId}/FieldList") + public ActionResult>> fieldList(@PathVariable("moduleId") String moduleId) { + List> list = new ArrayList<>(); + // 得到菜单id + ModuleEntity entity = moduleService.getInfo(moduleId); + PropertyJsonModel model = JsonUtil.getJsonToBean(entity.getPropertyJson(), PropertyJsonModel.class); + if (model == null) { + model = new PropertyJsonModel(); + } + // 得到bean + Object bean = SpringContext.getBean("visualdevServiceImpl"); + Object method = ReflectionUtil.invokeMethod(bean, "getInfo", new Class[] { String.class }, + new Object[] { model.getModuleId() }); + Map map = JsonUtil.entityToMap(method); + if (map != null && map.containsKey("formData")) { + FormDataModel formDataModel = JsonUtil.getJsonToBean(String.valueOf(map.get("formData")), + FormDataModel.class); + List fieLdsModelList = JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class); + RecursionForm recursionForm = new RecursionForm(); + recursionForm.setList(fieLdsModelList); + recursionForm + .setTableModelList(JsonUtil.getJsonToList(String.valueOf(map.get("tables")), TableModel.class)); + List formAllModel = new ArrayList<>(); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + for (FormAllModel allModel : formAllModel) { + if (FormEnum.table.getMessage().equals(allModel.getYunzhupaasKey())) { + FormColumnTableModel childList = allModel.getChildList(); + Map map1 = new HashedMap<>(); + map1.put("field", childList.getTableModel()); + map1.put("fieldName", childList.getLabel()); + list.add(map1); + } else if (FormEnum.mast.getMessage().equals(allModel.getYunzhupaasKey())) { + FormColumnModel formColumnModel = allModel.getFormColumnModel(); + FieLdsModel fieLdsModel = formColumnModel.getFieLdsModel(); + if (StringUtil.isNotEmpty(fieLdsModel.getVModel())) { + Map map1 = new HashedMap<>(); + map1.put("field", fieLdsModel.getVModel()); + map1.put("fieldName", fieLdsModel.getConfig().getLabel()); + list.add(map1); + } + } else if (FormEnum.mastTable.getMessage().equals(allModel.getYunzhupaasKey())) { + FormMastTableModel formColumnModel = allModel.getFormMastTableModel(); + FieLdsModel fieLdsModel = formColumnModel.getMastTable().getFieLdsModel(); + if (StringUtil.isNotEmpty(fieLdsModel.getVModel())) { + Map map1 = new HashedMap<>(); + map1.put("field", fieLdsModel.getVModel()); + map1.put("fieldName", fieLdsModel.getConfig().getLabel()); + list.add(map1); + } + } + } + } + return ActionResult.success(list); + } + + /** + * 获取表单权限信息 + * + * @param id 主键值 + * @return ignore + * @throws DataException ignore + */ + @Operation(summary = "获取表单权限信息") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) throws DataException { + ModuleFormEntity entity = moduleFormService.getInfo(id); + String enCode = entity.getEnCode(); + if (StringUtil.isNotEmpty(enCode)) { + if (enCode.contains("-") && entity.getFieldRule() == 2) { + enCode = enCode.substring(enCode.indexOf("-") + 1); + entity.setEnCode(enCode); + } + if (entity.getFieldRule() == 1 && entity.getBindTable() != null) { + entity.setEnCode(enCode.replace("yunzhupaas_" + entity.getBindTable() + "_yunzhupaas_", "")); + } + } + ModuleFormInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, ModuleFormInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 新建表单权限 + * + * @param moduleFormCrForm 实体对象 + * @return ignore + */ + @Operation(summary = "新建表单权限") + @Parameters({ + @Parameter(name = "moduleFormCrForm", description = "实体对象", required = true) + }) + @SaCheckPermission("system.menu") + @PostMapping + public ActionResult create(@RequestBody @Valid ModuleFormCrForm moduleFormCrForm) { + ModuleEntity moduleEntity = moduleService.getInfo(moduleFormCrForm.getModuleId()); + ModuleFormEntity entity = JsonUtil.getJsonToBean(moduleFormCrForm, ModuleFormEntity.class); + + if (moduleEntity != null) { + PropertyJsonModel model = JsonUtil.getJsonToBean(moduleEntity.getPropertyJson(), PropertyJsonModel.class); + if (model == null) { + model = new PropertyJsonModel(); + } + if (entity.getFieldRule() == 1 && StringUtil.isNotEmpty(moduleFormCrForm.getBindTable())) { + String enCode = "yunzhupaas_" + moduleFormCrForm.getBindTable() + "_yunzhupaas_" + entity.getEnCode(); + entity.setEnCode(enCode); + } + + if (entity.getFieldRule() == 2 && StringUtil.isNotEmpty(moduleFormCrForm.getChildTableKey())) { + // 得到bean + // Object bean = SpringContext.getBean("visualdevServiceImpl"); + // Object method = ReflectionUtil.invokeMethod(bean, "getTableNameToKey", new + // Class[]{String.class}, new Object[]{model.getModuleId()}); + // Map map = JsonUtil.entityToMap(method); + // + // String enCode = map.get(moduleFormCrForm.getBindTable().toLowerCase()) + "-" + // + entity.getEnCode(); + String enCode = moduleFormCrForm.getChildTableKey() + "-" + entity.getEnCode(); + entity.setEnCode(enCode); + } + } + if (moduleFormService.isExistByEnCode(entity.getModuleId(), entity.getEnCode(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + moduleFormService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 更新表单权限 + * + * @param id 主键值 + * @param moduleFormUpForm 实体对象 + * @return ignore + */ + @Operation(summary = "更新表单权限") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true), + @Parameter(name = "moduleFormUpForm", description = "实体对象", required = true) + }) + @SaCheckPermission("system.menu") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid ModuleFormUpForm moduleFormUpForm) { + ModuleEntity moduleEntity = moduleService.getInfo(moduleFormUpForm.getModuleId()); + ModuleFormEntity entity = JsonUtil.getJsonToBean(moduleFormUpForm, ModuleFormEntity.class); + if (moduleEntity != null) { + PropertyJsonModel model = JsonUtil.getJsonToBean(moduleEntity.getPropertyJson(), PropertyJsonModel.class); + if (model == null) { + model = new PropertyJsonModel(); + } + if (entity.getFieldRule() == 1 && StringUtil.isNotEmpty(moduleFormUpForm.getBindTable())) { + String enCode = "yunzhupaas_" + moduleFormUpForm.getBindTable() + "_yunzhupaas_" + entity.getEnCode(); + entity.setEnCode(enCode); + } + + if (entity.getFieldRule() == 2 && StringUtil.isNotEmpty(moduleFormUpForm.getChildTableKey())) { + // // 得到bean + // Object bean = SpringContext.getBean("visualdevServiceImpl"); + // Object method = ReflectionUtil.invokeMethod(bean, "getTableNameToKey", new + // Class[]{String.class}, new Object[]{model.getModuleId()}); + // Map map = JsonUtil.entityToMap(method); + // + // String enCode = map.get(moduleFormUpForm.getBindTable().toLowerCase()) + "-" + // + entity.getEnCode(); + String enCode = moduleFormUpForm.getChildTableKey() + "-" + entity.getEnCode(); + entity.setEnCode(enCode); + } + } + if (moduleFormService.isExistByEnCode(entity.getModuleId(), entity.getEnCode(), id)) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + boolean flag = moduleFormService.update(id, entity); + if (!flag) { + return ActionResult.success(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除表单权限 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "删除表单权限") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.menu") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + ModuleFormEntity entity = moduleFormService.getInfo(id); + if (entity != null) { + moduleFormService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + /** + * 批量新建 + * + * @param formBatchForm 批量表单模型 + * @return + */ + @Operation(summary = "批量新建表单权限") + @Parameters({ + @Parameter(name = "formBatchForm", description = "批量表单模型", required = true) + }) + @SaCheckPermission("system.menu") + @PostMapping("/Actions/Batch") + public ActionResult batchCreate(@RequestBody @Valid FormBatchForm formBatchForm) { + List entitys = formBatchForm.getFormJson() != null + ? JsonUtil.getJsonToList(formBatchForm.getFormJson(), ModuleFormEntity.class) + : new ArrayList<>(); + List name = new ArrayList<>(); + for (ModuleFormEntity entity : entitys) { + if (entity.getFieldRule() == 1) { + String enCode = "yunzhupaas_" + entity.getBindTable() + "_yunzhupaas_" + entity.getEnCode(); + entity.setEnCode(enCode); + } + if (entity.getFieldRule() == 2) { + String enCode = entity.getChildTableKey() + "-" + entity.getEnCode(); + entity.setEnCode(enCode); + } + entity.setModuleId(formBatchForm.getModuleId()); + if (moduleFormService.isExistByEnCode(entity.getModuleId(), entity.getEnCode(), null)) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + if (name.contains(entity.getEnCode())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + name.add(entity.getEnCode()); + } + moduleFormService.create(entitys); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 更新表单权限状态 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "更新表单权限状态") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @SaCheckPermission("system.menu") + @PutMapping("/{id}/Actions/State") + public ActionResult upState(@PathVariable("id") String id) { + ModuleFormEntity entity = moduleFormService.getInfo(id); + entity.setEnabledMark("1".equals(String.valueOf(entity.getEnabledMark())) ? 0 : 1); + boolean flag = moduleFormService.update(id, entity); + if (!flag) { + return ActionResult.success(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + +} diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/MonitorController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/MonitorController.java new file mode 100644 index 0000000..67fd9c6 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/MonitorController.java @@ -0,0 +1,43 @@ +package com.yunzhupaas.base.controller; + + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.model.monitor.MonitorListVO; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.base.util.MonitorUtil; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 系统监控 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Tag(name = "系统监控", description = "Monitor") +@RestController +@RequestMapping("/api/system/Monitor") +public class MonitorController { + + /** + * 系统监控 + * + * @return ignore + */ + @Operation(summary = "系统监控") + @SaCheckPermission("system.monitor") + @GetMapping + public ActionResult list() { + MonitorUtil monitorUtil = new MonitorUtil(); + MonitorListVO vo = JsonUtil.getJsonToBean(monitorUtil, MonitorListVO.class); + vo.setTime(System.currentTimeMillis()); + return ActionResult.success(vo); + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/PortalManageController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/PortalManageController.java new file mode 100644 index 0000000..87736fb --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/PortalManageController.java @@ -0,0 +1,97 @@ +package com.yunzhupaas.base.controller; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.entity.PortalManageEntity; +import com.yunzhupaas.base.model.portalManage.*; +import com.yunzhupaas.base.service.PortalManageService; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.constant.MsgCode; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 门户管理 + * + * @author 云筑产品开发平台组 + * @version v3.4.6 + * @copyrignt 深圳市乐程软件有限公司 + * @date 2023-02-16 + */ +@Slf4j +@RestController +@Tag(name = "门户管理", description = "PortalManage") +@RequestMapping("/api/system/PortalManage") +public class PortalManageController extends SuperController { + + @Autowired + PortalManageService portalManageService; +// @Autowired +// PortalService portalApi; +// @Autowired +// private AuthorizeService authorizeService; + + @Operation(summary = "新增") + @PostMapping + public ActionResult create(@RequestBody @Valid PortalManageCreForm portalManageForm) { + PortalManageEntity entity = portalManageForm.convertEntity(); + try { + portalManageService.checkCreUp(entity); + } catch (Exception e) { + return ActionResult.fail(e.getMessage()); + } + portalManageService.save(entity); + return ActionResult.success(MsgCode.SU018.get()); + } + + @Operation(summary = "删除") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable String id) { + boolean flag = portalManageService.removeById(id); + if(flag){ + // 删除绑定的所有权限 +// authorizeService.remove(new AuthorizePortalManagePrimary(null, id).getQuery()); + return ActionResult.success(MsgCode.SU003.get()); + } else { + return ActionResult.fail(MsgCode.FA003.get()); + } + } + + @Operation(summary = "编辑") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid PortalManageUpForm portalManageUpForm){ + PortalManageEntity update = portalManageUpForm.convertEntity(); + try { + portalManageService.checkCreUp(update); + } catch (Exception e) { + return ActionResult.fail(e.getMessage()); + } + portalManageService.updateById(update); + return ActionResult.success(MsgCode.SU004.get()); + } + + @Operation(summary = "查看") + @GetMapping("/{id}") + public ActionResult getOne(@PathVariable("id") String id) { + PortalManageEntity entity = portalManageService.getById(id); + return ActionResult.success(portalManageService.convertVO(entity)); + } + + @Operation(summary = "列表") + @GetMapping("/list/{systemId}") + public ActionResult> getPage(@PathVariable("systemId") String systemId, PortalManagePage pmPage) { + pmPage.setSystemId(systemId); + return ActionResult.page( + portalManageService.getPage(pmPage).getRecords() + .stream().map(PortalManagePageDO::convert).collect(Collectors.toList()), + pmPage.getPaginationVO()); + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/PrintDevController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/PrintDevController.java new file mode 100644 index 0000000..a96c913 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/PrintDevController.java @@ -0,0 +1,389 @@ +package com.yunzhupaas.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.entity.PrintDevEntity; +import com.yunzhupaas.base.entity.PrintVersionEntity; +import com.yunzhupaas.base.model.print.*; +import com.yunzhupaas.base.model.query.PrintDevDataQuery; +import com.yunzhupaas.base.model.query.PrintDevParam; +import com.yunzhupaas.base.model.vo.PrintDevListVO; +import com.yunzhupaas.base.model.vo.PrintDevVO; +import com.yunzhupaas.base.service.DictionaryDataService; +import com.yunzhupaas.base.service.PrintDevService; +import com.yunzhupaas.base.service.PrintVersionService; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.emnus.ModuleTypeEnum; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.enums.DictionaryDataEnum; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 打印模板 -控制器 + * + * @author 云筑产品开发平台组 + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-30 + */ +@Tag(name = "打印模板", description = "print") +@RestController +@RequestMapping("/api/system/printDev") +public class PrintDevController { + + @Autowired + private PrintDevService printDevService; + @Autowired + private PrintVersionService versionService; + @Autowired + private FileExport fileExport; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private DictionaryDataService dictionaryDataService; + @Autowired + private UserService userService; + + @Operation(summary = "列表") + @SaCheckPermission("onlineDev.printDev") + @GetMapping + public ActionResult list(PaginationPrint paginationPrint) { + List list = printDevService.getList(paginationPrint); + List userId = list.stream().map(t -> t.getCreatorUserId()).collect(Collectors.toList()); + List lastUserId = list.stream().map(t -> t.getLastModifyUserId()).collect(Collectors.toList()); + lastUserId.removeAll(Collections.singleton(null)); + List userEntities = userService.getUserName(userId); + List lastUserIdEntities = userService.getUserName(lastUserId); + List typeList = dictionaryDataService.getListByTypeDataCode(DictionaryDataEnum.SYSTEM_PRINTDEV.getDictionaryTypeId()); + List listVOS = new ArrayList<>(); + for (PrintDevEntity entity : list) { + PrintDevListVO vo = JsonUtil.getJsonToBean(entity, PrintDevListVO.class); + DictionaryDataEntity dataEntity = typeList.stream().filter(t -> t.getId().equals(entity.getCategory())).findFirst().orElse(null); + if (dataEntity != null) { + vo.setCategory(dataEntity.getFullName()); + } else { + vo.setCategory(""); + } + //创建者 + UserEntity creatorUser = userEntities.stream().filter(t -> t.getId().equals(entity.getCreatorUserId())).findFirst().orElse(null); + vo.setCreatorUser(creatorUser != null ? creatorUser.getRealName() + "/" + creatorUser.getAccount() : entity.getCreatorUserId()); + //修改人 + UserEntity lastModifyUser = lastUserIdEntities.stream().filter(t -> t.getId().equals(entity.getLastModifyUserId())).findFirst().orElse(null); + vo.setLastModifyUser(lastModifyUser != null ? lastModifyUser.getRealName() + "/" + lastModifyUser.getAccount() : entity.getLastModifyUserId()); + listVOS.add(vo); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(paginationPrint, PaginationVO.class); + return ActionResult.page(listVOS, paginationVO); + } + + /*============模板增删改==============*/ + + @Operation(summary = "新增") + @Parameters({ + @Parameter(name = "printDevForm", description = "打印模板数据传输对象") + }) + @SaCheckPermission("onlineDev.printDev") + @PostMapping + public ActionResult create(@RequestBody @Valid PrintDevFormDTO printDevForm) { + printDevService.create(printDevForm); + return ActionResult.success(MsgCode.SU001.get(), printDevForm.getId()); + } + + @Operation(summary = "详情") + @Parameters({ + @Parameter(name = "id", description = "打印模板id") + }) + @SaCheckPermission("onlineDev.printDev") + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) { + PrintDevEntity byId = printDevService.getById(id); + PrintDevInfoVO vo = JsonUtil.getJsonToBean(byId, PrintDevInfoVO.class); + return ActionResult.success(vo); + } + + @Operation(summary = "更新") + @PutMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "form", description = "流程模型", required = true), + }) + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid PrintDevFormDTO printDevForm) throws WorkFlowException { + PrintDevEntity printDevEntity = JsonUtil.getJsonToBean(printDevForm, PrintDevEntity.class); + PrintDevEntity originEntity = printDevService.getById(id); + printDevService.creUpdateCheck(printDevEntity, + !originEntity.getFullName().equals(printDevForm.getFullName()), + !originEntity.getEnCode().equals(printDevForm.getEnCode())); + printDevEntity.setId(id); + printDevService.updateById(printDevEntity); + return ActionResult.success(MsgCode.SU004.get()); + } + + @Operation(summary = "删除") + @Parameters({ + @Parameter(name = "id", description = "打印模板id") + }) + @SaCheckPermission("onlineDev.printDev") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable String id) { + //对象存在判断 + if (printDevService.getById(id) != null) { + printDevService.removeById(id); + versionService.removeByTemplateId(id); + return ActionResult.success(MsgCode.SU003.get()); + } else { + return ActionResult.fail(MsgCode.FA003.get()); + } + } + + /*============版本增删改==============*/ + @Operation(summary = "版本详情") + @Parameters({ + @Parameter(name = "versionId", description = "打印版本id") + }) + @SaCheckPermission("onlineDev.printDev") + @GetMapping("/Info/{versionId}") + public ActionResult versionInfo(@PathVariable String versionId) { + PrintDevInfoVO info = printDevService.getVersionInfo(versionId); + return ActionResult.success(info); + } + + @Operation(summary = "版本新增") + @Parameters({ + @Parameter(name = "versionId", description = "打印版本id") + }) + @SaCheckPermission("onlineDev.printDev") + @PostMapping("/Info/{versionId}") + public ActionResult copyVersion(@PathVariable String versionId) { + String newVersionId = versionService.copyVersion(versionId); + return ActionResult.success(MsgCode.SU005.get(), newVersionId); + } + + @Operation(summary = "版本删除") + @Parameters({ + @Parameter(name = "versionId", description = "打印版本id") + }) + @SaCheckPermission("onlineDev.printDev") + @DeleteMapping("/Info/{versionId}") + public ActionResult deleteVersion(@PathVariable String versionId) { + PrintVersionEntity byId = versionService.getById(versionId); + if (byId != null) { + List list = versionService.getList(byId.getTemplateId()); + if (list.size() == 1) { + return ActionResult.fail(MsgCode.SYS043.get()); + } + if (Objects.equals(byId.getState(), 1)) { + return ActionResult.fail(MsgCode.SYS044.get()); + } + if (Objects.equals(byId.getState(), 2)) { + return ActionResult.fail(MsgCode.SYS045.get()); + } + versionService.removeById(versionId); + } + return ActionResult.success(MsgCode.SU003.get()); + } + + @Operation(summary = "版本列表") + @Parameters({ + @Parameter(name = "id", description = "打印模板id") + }) + @SaCheckPermission("onlineDev.printDev") + @GetMapping("/Version/{id}") + public ActionResult> versionList(@PathVariable String id) { + List list = versionService.getList(id); + List listVO = new ArrayList<>(); + for (PrintVersionEntity jsonEntity : list) { + PrintVersionListVO vo = JsonUtil.getJsonToBean(jsonEntity, PrintVersionListVO.class); + vo.setFullName("打印版本V" + vo.getVersion()); + listVO.add(vo); + } + return ActionResult.success(listVO); + } + + //***********************************动作start + @Operation(summary = "保存或者发布") + @Parameters({ + @Parameter(name = "printDevForm", description = "打印模板数据传输对象") + }) + @SaCheckPermission("onlineDev.printDev") + @PostMapping("/Save") + public ActionResult saveOrRelease(@RequestBody @Valid PrintDevUpForm form) { + printDevService.saveOrRelease(form); + if (Objects.equals(form.getType(), 1)) { + return ActionResult.success(MsgCode.SU011.get()); + } + return ActionResult.success(MsgCode.SU002.get()); + } + + @Operation(summary = "复制") + @Parameters({ + @Parameter(name = "id", description = "打印模板id") + }) + @SaCheckPermission("onlineDev.printDev") + @PostMapping("/{id}/Actions/Copy") + public ActionResult> copy(@PathVariable String id) { + printDevService.copyPrintdev(id); + return ActionResult.success(MsgCode.SU007.get()); + } + + @Operation(summary = "导出") + @Parameters({ + @Parameter(name = "id", description = "打印模板id") + }) + @SaCheckPermission("onlineDev.printDev") + @GetMapping("/{id}/Actions/Export") + public ActionResult export(@PathVariable String id) { + PrintDevEntity entity = printDevService.getById(id); + List list = versionService.getList(id); + if (CollectionUtils.isEmpty(list)) { + return ActionResult.fail(MsgCode.FA001.get()); + } + PrintDevInfoVO info = printDevService.getVersionInfo(list.get(0).getId()); + //导出文件 + DownloadVO downloadVO = fileExport.exportFile(info, configValueUtil.getTemporaryFilePath(), entity.getFullName(), ModuleTypeEnum.SYSTEM_PRINT.getTableName()); + return ActionResult.success(downloadVO); + } + + @Operation(summary = "导入") + @SaCheckPermission("onlineDev.printDev") + @PostMapping(value = "/Actions/Import", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ActionResult> importData(@RequestPart("file") MultipartFile multipartFile, + @RequestParam("type") Integer type) throws DataException { + //判断是否为.json结尾 + if (FileUtil.existsSuffix(multipartFile, ModuleTypeEnum.SYSTEM_PRINT.getTableName())) { + return ActionResult.fail(MsgCode.IMP002.get()); + } + //读取文件内容 + String fileContent = FileUtil.getFileContent(multipartFile); + PrintDevInfoVO infVo = JsonUtil.getJsonToBean(fileContent, PrintDevInfoVO.class); + String str = printDevService.importData(infVo, type); + if (StringUtil.isNotEmpty(str)) { + return ActionResult.fail(str); + } + return ActionResult.success(MsgCode.IMP001.get()); + } + //***********************************动作end + + /** + * 下拉列表 + * + * @return 返回列表数据 + */ + @Operation(summary = "下拉列表") + @GetMapping("/Selector") + public ActionResult> selectorList(String category) throws Exception { + ListVO vo = new ListVO<>(); + vo.setList(printDevService.getTreeModel(category)); + return ActionResult.success(vo); + } + + @Operation(summary = "Sql数据获取") + @PostMapping("/BatchData") + public ActionResult getBatchData(@RequestBody PrintDevDataQuery query) { + String id = XSSEscape.escape(query.getId()); + PrintDevEntity entity = printDevService.getById(id); + if (entity == null) { + return ActionResult.fail(MsgCode.PRI001.get()); + } + ArrayList list = new ArrayList<>(); + if (query.getFormInfo() != null && query.getFormInfo().size() > 0) { + List flowTaskInfo = query.getFormInfo(); + for (PrintDevParam rid : flowTaskInfo) { + String oneId = ""; + String flowTaskId = ""; + if (Objects.nonNull(rid.getFormId())) { + oneId = XSSEscape.escape(rid.getFormId().toString()); + } + if (Objects.nonNull(rid.getFlowTaskId())) { + flowTaskId = XSSEscape.escape(rid.getFlowTaskId().toString()); + } + Map dataMap = printDevService.getDataMap(id, oneId, flowTaskId, query.getMap()); + dataMap.put("fullName", entity.getFullName()); + list.add(dataMap); + } + return ActionResult.success(list); + } + return ActionResult.success(list); + } + + /** + * 查询打印列表 + * + * @param ids + * @return + */ + @Operation(summary = "查询打印列表") + @Parameters({ + @Parameter(name = "ids", description = "主键集合") + }) + @PostMapping("getListById") + public List getListById(@RequestBody List ids) { + return printDevService.getPrintTemplateOptions(ids); + } + + @Operation(summary = "查询打印列表") + @Parameters({ + @Parameter(name = "data", description = "打印模板-数查询对象") + }) + @PostMapping("getListOptions") + public ActionResult getListOptions(@RequestBody PrintDevDataQuery data) { + List ids = data.getIds(); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().in(PrintDevEntity::getId, ids); + List list = printDevService.getBaseMapper().selectList(wrapper); + List options = JsonUtil.getJsonToList(list, PrintOption.class); + return ActionResult.success(options); + } + + //新增 + + @Operation(summary = "列表预览") + @Parameters({ + @Parameter(name = "id", description = "打印模板id") + }) + @SaCheckPermission("onlineDev.printDev") + @GetMapping("/{id}/Actions/Preview") + public ActionResult previewInfo(@PathVariable("id") String id) { + List list = versionService.getList(id); + if (CollectionUtils.isEmpty(list)) { + return ActionResult.fail(MsgCode.FA001.get()); + } + PrintDevInfoVO info = printDevService.getVersionInfo(list.get(0).getId()); + PrintDevInfoVO vo = JsonUtil.getJsonToBean(info, PrintDevInfoVO.class); + return ActionResult.success(vo); + } + + @Operation(summary = "打印模板业务列表") + @GetMapping("/WorkSelector") + public ActionResult> getWorkSelector(PaginationPrint pagination) { + List list = printDevService.getWorkSelector(pagination); + List listVO = JsonUtil.getJsonToList(list, PrintDevListVO.class); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(listVO, paginationVO); + } + + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/PrintLogController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/PrintLogController.java new file mode 100644 index 0000000..7c8a24d --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/PrintLogController.java @@ -0,0 +1,81 @@ +package com.yunzhupaas.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.PaginationTime; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.model.vo.PrintLogVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import cn.hutool.core.bean.BeanUtil; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.entity.PrintLogEntity; +import com.yunzhupaas.base.service.PrintLogService; +import org.springframework.validation.annotation.Validated; +import com.yunzhupaas.base.model.printlog.PrintLogInfo; +import org.springframework.web.bind.annotation.*; + +import java.util.*; + +@Tag(name = "打印模板日志", description = "PrintLogController") +@RestController +@RequestMapping("/api/system/printLog") +public class PrintLogController { + @Autowired + private PrintLogService printLogService; + + + + @Autowired + private UserService userService; + + /** + * 获取列表 + * + * @param page 分页模型 + * @return + */ + @Operation(summary = "获取列表") + @Parameters({ + @Parameter(name = "id", description = "打印模板ID", required = true) + }) + @SaCheckPermission("system.printDev") + @GetMapping("/{id}") + public ActionResult list(@PathVariable("id") String printId, PaginationTime page) { + List list = printLogService.list(printId, page); + PaginationVO paginationVO = JsonUtil.getJsonToBean(page, PaginationVO.class); + return ActionResult.page(list, paginationVO); + } + + /** + * 保存信息 + * + * @param info 实体对象 + * @return + */ + @Operation(summary = "保存信息") + @Parameters({ + @Parameter(name = "info", description = "实体对象", required = true) + }) + @SaCheckPermission("system.printDev") + @PostMapping("save") + public ActionResult save(@RequestBody @Validated PrintLogInfo info) { + PrintLogEntity printLogEntity = BeanUtil.copyProperties(info, PrintLogEntity.class); + UserInfo userInfo = UserProvider.getUser(); + + printLogEntity.setId(RandomUtil.uuId()); + printLogEntity.setCreatorTime(new Date()); + printLogEntity.setCreatorUserId(userInfo.getUserId()); + printLogService.save(printLogEntity); + return ActionResult.success(MsgCode.SU002); + } + + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/ProvinceAtlasController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/ProvinceAtlasController.java new file mode 100644 index 0000000..9696575 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/ProvinceAtlasController.java @@ -0,0 +1,213 @@ +package com.yunzhupaas.base.controller; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.google.common.base.Joiner; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.entity.ProvinceAtlasEntity; +import com.yunzhupaas.base.model.province.AtlasJsonModel; +import com.yunzhupaas.base.model.province.MapParams; +import com.yunzhupaas.base.model.province.ProvinceListTreeVO; +import com.yunzhupaas.base.service.ProvinceAtlasService; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.NoDataSourceBind; +import com.yunzhupaas.util.ServletUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.wxutil.HttpUtil; +import net.sourceforge.pinyin4j.PinyinHelper; +import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; +import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat; +import net.sourceforge.pinyin4j.format.HanyuPinyinToneType; +import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.imageio.ImageIO; +import jakarta.servlet.http.HttpServletResponse; +import java.awt.image.BufferedImage; +import java.io.InputStream; +import java.io.OutputStream; +import java.math.BigDecimal; +import java.net.HttpURLConnection; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; + +/** + * 行政区划-地图 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/1/29 10:41:25 + */ +@Tag(name = "行政区划-地图", description = "atlas") +@RestController +@RequestMapping("/api/system/atlas") +public class ProvinceAtlasController extends SuperController { + + @Autowired + private ProvinceAtlasService provinceAtlasService; + public static final String ATLAS_URL = "https://geo.datav.aliyun.com/areas_v3/bound/geojson?code="; + + //树形递归 + private static boolean addChild(ProvinceListTreeVO node, List list) { + for (int i = 0; i < list.size(); i++) { + ProvinceListTreeVO n = list.get(i); + if (n.getId().equals(node.getParentId())) { + if (n.getChildren() == null) { + n.setChildren(new ArrayList<>()); + } + List children = n.getChildren(); + children.add(node); + n.setChildren(children); + return true; + } + if (n.getChildren() != null && n.getChildren().size() > 0) { + List children = n.getChildren(); + if (addChild(node, children)) { + return true; + } + } + + } + return false; + } + + /** + * 获取所有列表 + * + * @return ignore + */ + @Operation(summary = "获取所有列表") + @GetMapping + public ActionResult> list() { + List list = provinceAtlasService.getList(); + List listVOS = JsonUtil.getJsonToList(list, ProvinceListTreeVO.class); + listVOS.forEach(item -> { + if( StringUtil.isNotEmpty(item.getAtlasCenter())){ + String[] split = item.getAtlasCenter().split(","); + item.setCenterLong(new BigDecimal(split[0])); + item.setCenterLat(new BigDecimal(split[1])); + } + }); + for (int i = 0; i < listVOS.size(); i++) { + ProvinceListTreeVO item = listVOS.get(i); + if (!StringUtil.isEmpty(item.getParentId())) { + if (addChild(item, listVOS) && listVOS.size() > 0) { + listVOS.remove(item); + i--; + } + } + } + return ActionResult.success(listVOS); + } + + /** + * 获取列表 + * + * @param pid 主键 + * @return + */ + @Operation(summary = "获取列表") + @Parameters({ + @Parameter(name = "pid", description = "主键", required = true) + }) + @GetMapping("/list/{pid}") + public ActionResult> getListByPid(@PathVariable("pid") String pid) { + List list = provinceAtlasService.getListByPid(pid); + List listVOS = JsonUtil.getJsonToList(list, ProvinceListTreeVO.class); + return ActionResult.success(listVOS); + } + + /** + * 获取地图json + * + * @param code 编码 + * @return + */ + @Operation(summary = "获取地图json") + @Parameters({ + @Parameter(name = "code", description = "编码", required = true) + }) + @GetMapping("/geojson") + public ActionResult geojson(@RequestParam("code") String code) { + ProvinceAtlasEntity oneByCode = provinceAtlasService.findOneByCode(code); + if(oneByCode == null){ + return ActionResult.fail(MsgCode.SYS022.get()); + } + List listByPid = provinceAtlasService.getListByPid(oneByCode.getId()); + String url = ATLAS_URL + code; + if (CollectionUtils.isNotEmpty(listByPid)) { + url += "_full"; + } + JSONObject rstObj; + try { + rstObj = HttpUtil.httpRequest(url, "GET", null); + } catch (Exception e) { + return ActionResult.fail(MsgCode.SYS023.get()); + } + if (rstObj == null) { + return ActionResult.fail(MsgCode.SYS024.get()); + } + return ActionResult.success(rstObj); + } + + /** + * 同步行政区划信息 + * + * @return + */ + @Operation(summary = "同步行政区划信息") + @GetMapping("/crePy") + public ActionResult crePy() { + List list = provinceAtlasService.list(); + for (ProvinceAtlasEntity p : list) { + + String url = ATLAS_URL + p.getId(); + JSONObject rstObj; + try { + rstObj = HttpUtil.httpRequest(url, "GET", null); + if (rstObj == null) { + provinceAtlasService.removeById(p); + } else { + //将获取到的信息写入表 + AtlasJsonModel jsonToBean = JsonUtil.getJsonToBean(rstObj, AtlasJsonModel.class); + List center = jsonToBean.getFeatures().get(0).getProperties().getCenter(); + p.setAtlasCenter(Joiner.on(",").join(center)); + //生成拼音 +// String getpy = getpy(p.getFullName()); +// p.setQuickQuery(getpy); + provinceAtlasService.updateById(p); + } + } catch (Exception e) { + e.printStackTrace(); + return ActionResult.fail(MsgCode.SYS023.get()); + } + } + return ActionResult.success(); + } + + private String getpy(String name) { + HanyuPinyinOutputFormat outputFormat = new HanyuPinyinOutputFormat(); + outputFormat.setCaseType(HanyuPinyinCaseType.LOWERCASE); + outputFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE); + StringBuilder result = new StringBuilder(); + char[] charArray = name.toCharArray(); + for (char c : charArray) { + try { + String[] pinyinArray = PinyinHelper.toHanyuPinyinStringArray(c, outputFormat); + result.append(pinyinArray[0]); + } catch (BadHanyuPinyinOutputFormatCombination e) { + e.printStackTrace(); + } + } + return result.toString(); + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/ScheduleNewController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/ScheduleNewController.java new file mode 100644 index 0000000..be90a64 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/ScheduleNewController.java @@ -0,0 +1,282 @@ +package com.yunzhupaas.base.controller; + +import cn.hutool.core.bean.BeanUtil; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.entity.ScheduleNewEntity; +import com.yunzhupaas.base.entity.ScheduleNewUserEntity; +import com.yunzhupaas.base.model.schedule.*; +import com.yunzhupaas.base.service.DictionaryDataService; +import com.yunzhupaas.base.service.ScheduleNewApi; +import com.yunzhupaas.base.service.ScheduleNewService; +import com.yunzhupaas.base.service.ScheduleNewUserService; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.message.entity.SendMessageConfigEntity; +import com.yunzhupaas.message.service.SendMessageConfigService; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.DateUtil; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 日程 + * + * @author 云筑产品开发平台组 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + */ +@Tag(name = "日程", description = "Schedule") +@RestController +@RequestMapping("/api/system/Schedule") +public class ScheduleNewController extends SuperController implements ScheduleNewApi { + + + @Autowired + private UserService userService; + @Autowired + private SendMessageConfigService messageTemplateConfigService; + @Autowired + private DictionaryDataService dictionaryDataService; + @Autowired + private ScheduleNewService scheduleNewService; + @Autowired + private ScheduleNewUserService scheduleNewUserService; + + /** + * 获取日程安排列表 + * + * @param scheduleNewTime 分页模型 + * @return + */ + @Operation(summary = "获取日程安排列表") + @GetMapping + public ActionResult> list(ScheduleNewTime scheduleNewTime) { + List list = scheduleNewService.getList(scheduleNewTime); + Date start = DateUtil.stringToDates(scheduleNewTime.getStartTime()); + Date end = DateUtil.stringToDates(scheduleNewTime.getEndTime()); + List dataAll = DateUtil.getAllDays(start, end); + List result = new ArrayList<>(); + if (list.size() > 0) { + for (Date date : dataAll) { + for (ScheduleNewEntity entity : list) { + Date startDay = DateUtil.stringToDates(DateUtil.daFormat(entity.getStartDay())); + Date endDay = DateUtil.stringToDates(DateUtil.daFormat(entity.getEndDay())); + if(DateUtil.isEffectiveDate(date,startDay,endDay)){ + result.add(entity); + } + } + } + } + for (ScheduleNewEntity item : result) { + ScheduleNewEntity entity = BeanUtil.copyProperties(item, ScheduleNewEntity.class); + if (entity.getAllDay() == 1) { + entity.setEndDay(DateUtil.dateAddSeconds(entity.getEndDay(), 1)); + } + } + List vo = JsonUtil.getJsonToList(result, ScheduleNewListVO.class); + ListVO listVO = new ListVO(); + listVO.setList(vo); + return ActionResult.success(listVO); + } + + /** + * 获取日程安排列表 + * + * @param scheduleNewTime 分页模型 + * @return + */ + @Operation(summary = "获取日程安排列表") + @GetMapping("/AppList") + public ActionResult selectList(ScheduleNewTime scheduleNewTime) { + Map signMap = new HashMap<>(16); + List list = scheduleNewService.getList(scheduleNewTime); + Date start = DateUtil.stringToDates(scheduleNewTime.getStartTime()); + Date end = DateUtil.stringToDates(scheduleNewTime.getEndTime()); + List dateList = new ArrayList() {{ + add(start); + add(end); + }}; + if(StringUtils.isNotEmpty(scheduleNewTime.getDateTime())){ + dateList.add(DateUtil.strToDate(scheduleNewTime.getDateTime())); + } + Date minDate = dateList.stream().min(Date::compareTo).get(); + Date maxDate = dateList.stream().max(Date::compareTo).get(); + List dataAll = DateUtil.getAllDays(minDate, maxDate); + ScheduleNewAppListVO vo = new ScheduleNewAppListVO(); + String pattern = "yyyyMMdd"; + String dateTime = StringUtils.isEmpty(scheduleNewTime.getDateTime()) ? DateUtil.dateNow(pattern) : scheduleNewTime.getDateTime().replaceAll("-", ""); + List todayList = new ArrayList<>(); + for (Date date : dataAll) { + String time = DateUtil.dateToString(date, pattern); + List result = new ArrayList<>(); + for (ScheduleNewEntity entity : list) { + Date startDay = DateUtil.stringToDates(DateUtil.daFormat(entity.getStartDay())); + Date endDay = DateUtil.stringToDates(DateUtil.daFormat(entity.getEndDay())); + if(DateUtil.isEffectiveDate(date,startDay,endDay)){ + result.add(entity); + } + } + signMap.put(time, result.size()); + if(time.equals(dateTime)){ + todayList.addAll(result); + } + } + vo.setSignList(signMap); + vo.setTodayList(JsonUtil.getJsonToList(todayList, ScheduleNewListVO.class)); + return ActionResult.success(vo); + } + + /** + * 信息 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取日程安排信息") + @GetMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult info(@PathVariable("id") String id) { + ScheduleNewEntity entity = scheduleNewService.getInfo(id); + ScheduleNewInfoVO vo = JsonUtil.getJsonToBean(entity, ScheduleNewInfoVO.class); + if (vo != null) { + SendMessageConfigEntity config = StringUtil.isNotEmpty(vo.getSend()) ? messageTemplateConfigService.getInfo(vo.getSend()) : null; + vo.setSendName(config!=null?config.getFullName():""); + List toUserIds = scheduleNewUserService.getList(entity.getId(),2).stream().map(ScheduleNewUserEntity::getToUserId).collect(Collectors.toList()); + vo.setToUserIds(toUserIds); + return ActionResult.success(vo); + } + return ActionResult.fail(MsgCode.FA001.get()); + } + + /** + * 信息 + * + * @param detailModel 查询模型 + * @return + */ + @Operation(summary = "获取日程安排信息") + @GetMapping("/detail") + public ActionResult detail(ScheduleDetailModel detailModel) { + List groupList = scheduleNewService.getGroupList(detailModel); + ScheduleNewEntity entity = groupList.size() > 0 ? groupList.get(0) : null; + boolean isVO = entity != null; + if (isVO) { + ScheduleNewDetailInfoVO vo = JsonUtil.getJsonToBean(entity, ScheduleNewDetailInfoVO.class); + DictionaryDataEntity info = dictionaryDataService.getInfo(entity.getCategory()); + vo.setCategory(info != null ? info.getFullName() : ""); + vo.setUrgent("1".equals(vo.getUrgent()) ? "普通" : "2".equals(vo.getUrgent()) ? "重要" : "紧急"); + UserEntity infoById = userService.getInfo(vo.getCreatorUserId()); + vo.setCreatorUserId(infoById != null ? infoById.getRealName() + "/" + infoById.getAccount() : ""); + List toUserIds = scheduleNewUserService.getList(entity.getId(),2).stream().map(ScheduleNewUserEntity::getToUserId).collect(Collectors.toList()); + List userName = userService.getUserName(toUserIds); + StringJoiner joiner = new StringJoiner(","); + for (UserEntity userEntity : userName) { + joiner.add(userEntity.getRealName() + "/" + userEntity.getAccount()); + } + vo.setToUserIds(joiner.toString()); + return ActionResult.success(vo); + } + return ActionResult.fail(MsgCode.SYS042.get()); + } + + /** + * 新建 + * + * @param scheduleCrForm 日程模型 + * @return + */ + @Operation(summary = "新建日程安排") + @PostMapping + @Parameters({ + @Parameter(name = "scheduleCrForm", description = "日程模型",required = true), + }) + public ActionResult create(@RequestBody @Valid ScheduleNewCrForm scheduleCrForm) { + if (scheduleCrForm.paramCheck()) { + return ActionResult.fail(scheduleCrForm.getErrMsg()); + } + ScheduleNewEntity entity = JsonUtil.getJsonToBean(scheduleCrForm, ScheduleNewEntity.class); + try { + scheduleNewService.create(entity, scheduleCrForm.getToUserIds(), RandomUtil.uuId(),"1",new ArrayList<>()); + } catch (Exception e) { + e.printStackTrace(); + return ActionResult.fail(e.getMessage()); + } + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 更新 + * + * @param id 主键 + * @param scheduleUpForm 日程模型 + * @param type 1.此日程 2.此日程及后续 3.所有日程 + * @return + */ + @Operation(summary = "更新日程安排") + @PutMapping("/{id}/{type}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "scheduleUpForm", description = "日程模型", required = true), + @Parameter(name = "type", description = "类型", required = true), + }) + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid ScheduleNewUpForm scheduleUpForm, @PathVariable("type") String type) { + if("1".equals(type)){ + scheduleUpForm.setRepeatTime(null); + scheduleUpForm.setRepetition(1); + } + if (scheduleUpForm.paramCheck()) { + return ActionResult.fail(scheduleUpForm.getErrMsg()); + } + ScheduleNewEntity entity = JsonUtil.getJsonToBean(scheduleUpForm, ScheduleNewEntity.class); + boolean flag = false; + try { + flag = scheduleNewService.update(id, entity, scheduleUpForm.getToUserIds(), type); + } catch (Exception e) { + e.printStackTrace(); + return ActionResult.fail(e.getMessage()); + } + if (flag == false) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除 + * + * @param id 主键 + * @param type 1.此日程 2.此日程及后续 3.所有日程 + * @return + */ + @Operation(summary = "删除日程安排") + @DeleteMapping("/{id}/{type}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "type", description = "类型", required = true), + }) + public ActionResult delete(@PathVariable("id") String id, @PathVariable("type") String type) { + ScheduleNewEntity entity = scheduleNewService.getInfo(id); + if (entity != null) { + scheduleNewService.delete(entity, type); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/SignatureController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/SignatureController.java new file mode 100644 index 0000000..5d8f135 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/SignatureController.java @@ -0,0 +1,172 @@ +package com.yunzhupaas.base.controller; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.entity.SignatureEntity; +import com.yunzhupaas.base.model.signature.*; +import com.yunzhupaas.base.service.SignatureService; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.base.model.signature.SignatureListVO; +import com.yunzhupaas.util.JsonUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; +import java.util.*; + +/** + * 电子签章 + * + * @author 云筑产品开发平台组 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + */ +@Tag(name = "电子签章", description = "Signature") +@RestController +@RequestMapping("/api/system/Signature") +public class SignatureController extends SuperController { + + + @Autowired + private SignatureService signatureService; + + /** + * 获取电子签章列表 + * + * @param signaturePage 分页模型 + * @return + */ + @Operation(summary = "获取电子签章列表") + @GetMapping + public ActionResult> list(PaginationSignature signaturePage) { + List list = signatureService.getList(signaturePage); + PaginationVO paginationVO = JsonUtil.getJsonToBean(signaturePage, PaginationVO.class); + return ActionResult.page(list, paginationVO); + } + + /** + * 获取电子签章下拉框 + * + * @return + */ + @Operation(summary = "获取电子签章下拉框") + @GetMapping("/Selector") + public ActionResult> selector() { + List list = signatureService.getList(); + List listVOS = JsonUtil.getJsonToList(list, SignatureSelectorListVO.class); + ListVO vo = new ListVO<>(); + vo.setList(listVOS); + return ActionResult.success(vo); + } + + /** + * 通过主键id集合获取有权限的电子签章列表 + * + * @return + */ + @Operation(summary = "通过主键id集合获取有权限的电子签章列表") + @PostMapping("/ListByIds") + public ActionResult> listByIds(@RequestBody SignatureListByIdsModel model) { + List list = signatureService.getListByIds(model); + ListVO vo = new ListVO<>(); + vo.setList(list); + return ActionResult.success(vo); + } + + /** + * 获取电子签章信息 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取电子签章信息") + @GetMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult info(@PathVariable("id") String id) { + SignatureInfoVO vo = signatureService.getInfo(id); + if (vo == null) { + return ActionResult.fail(MsgCode.FA001.get()); + } + return ActionResult.success(vo); + } + + /** + * 新建电子签章 + * + * @param signatureCrForm model + * @return + */ + @Operation(summary = "新建电子签章") + @PostMapping + @Parameters({ + @Parameter(name = "signatureCrForm", description = "新建电子签章模型", required = true), + }) + public ActionResult create(@RequestBody @Valid SignatureCrForm signatureCrForm) { + SignatureEntity entity = JsonUtil.getJsonToBean(signatureCrForm, SignatureEntity.class); + if (signatureService.isExistByFullName(entity.getFullName(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (signatureService.isExistByEnCode(entity.getEnCode(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + signatureService.create(entity, signatureCrForm.getUserIds()); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 更新电子签章 + * + * @param id 主键 + * @param signatureUpForm 日程模型 + * @return + */ + @Operation(summary = "更新电子签章") + @PutMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "signatureUpForm", description = "更新电子签章模型", required = true), + }) + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid SignatureUpForm signatureUpForm) { + SignatureEntity entity = signatureService.getInfoById(id); + if (entity == null) { + return ActionResult.fail(MsgCode.FA002.get()); + } + if (signatureService.isExistByFullName(signatureUpForm.getFullName(), id)) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (signatureService.isExistByEnCode(signatureUpForm.getEnCode(), id)) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + boolean update = signatureService.update(id, signatureUpForm); + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除电子签章 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除电子签章") + @DeleteMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult delete(@PathVariable("id") String id) { + SignatureEntity entity = signatureService.getInfoById(id); + if (entity == null) { + return ActionResult.fail(MsgCode.FA003.get()); + } + boolean delete = signatureService.delete(id); + return ActionResult.success(MsgCode.SU003.get()); + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/SmsTemplateController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/SmsTemplateController.java new file mode 100644 index 0000000..da9e5d1 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/SmsTemplateController.java @@ -0,0 +1,235 @@ +package com.yunzhupaas.base.controller; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.Page; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.entity.SmsTemplateEntity; +import com.yunzhupaas.base.model.smstemplate.*; +import com.yunzhupaas.base.service.SmsTemplateService; +import com.yunzhupaas.util.message.SmsUtil; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.base.SmsModel; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.util.JsonUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; +import java.util.ArrayList; +import java.util.List; + +/** + * 短信模板控制类 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-12-09 + */ +@Tag(description = "SmsTemplateController", name = "短信模板控制类") +@RestController +@RequestMapping("/api/system/SmsTemplate") +public class SmsTemplateController extends SuperController { + + @Autowired + private SmsTemplateService smsTemplateService; + + /** + * 短信模板列表 + * + * @param pagination + * @return + */ + @Operation(summary = "短信模板列表") + @GetMapping + public ActionResult> list(Pagination pagination) { + List list = smsTemplateService.getList(pagination); + List listVO = JsonUtil.getJsonToList(list, SmsTemplateListVO.class); + for (SmsTemplateListVO smsTemplateListVO : listVO) { + if ("1".equals(smsTemplateListVO.getCompany())) { + smsTemplateListVO.setCompany("阿里"); + } else if ("2".equals(smsTemplateListVO.getCompany())) { + smsTemplateListVO.setCompany("腾讯"); + } + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(listVO, paginationVO); + } + + /** + * 短信模板下拉框 + * + * @return + */ + @Operation(summary = "短信模板下拉框") + @GetMapping("/Selector") + public ActionResult> selector(Page page) { + List list = smsTemplateService.getList(page.getKeyword()); + List jsonToList = JsonUtil.getJsonToList(list, SmsTemplateSelector.class); + for (SmsTemplateSelector smsTemplateSelector : jsonToList) { + if ("1".equals(smsTemplateSelector.getCompany())) { + smsTemplateSelector.setCompany("阿里"); + } else if ("2".equals(smsTemplateSelector.getCompany())) { + smsTemplateSelector.setCompany("腾讯"); + } + } + ListVO listVO = new ListVO<>(); + listVO.setList(jsonToList); + return ActionResult.success(listVO); + } + + /** + * 获取消息模板 + * + * @param id + * @return + */ + @Operation(summary = "获取短信模板") + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) { + SmsTemplateEntity entity = smsTemplateService.getInfo(id); + SmsTemplateVO vo = JsonUtil.getJsonToBean(entity, SmsTemplateVO.class); + return ActionResult.success(vo); + } + + /** + * 新建 + * + * @return + */ + @Operation(summary = "新建") + @PostMapping + public ActionResult create(@RequestBody @Valid SmsTemplateCrForm smsTemplateCrForm) { + SmsTemplateEntity entity = JsonUtil.getJsonToBean(smsTemplateCrForm, SmsTemplateEntity.class); + if (smsTemplateService.isExistByTemplateName(entity.getFullName(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (smsTemplateService.isExistByEnCode(entity.getEnCode(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + smsTemplateService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 修改 + * + * @return + */ + @Operation(summary = "修改") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid SmsTemplateUpForm smsTemplateUpForm) { + SmsTemplateEntity entity = JsonUtil.getJsonToBean(smsTemplateUpForm, SmsTemplateEntity.class); + if (smsTemplateService.isExistByTemplateName(entity.getFullName(), id)) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (smsTemplateService.isExistByEnCode(entity.getEnCode(), id)) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + boolean flag = smsTemplateService.update(id, entity); + if (!flag) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除 + * + * @return + */ + @Operation(summary = "删除") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + SmsTemplateEntity entity = smsTemplateService.getInfo(id); + if (entity == null) { + return ActionResult.fail(MsgCode.FA003.get()); + } + smsTemplateService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + + /** + * 修改状态 + * + * @return + */ + @Operation(summary = "修改状态") + @PutMapping("/{id}/Actions/State") + public ActionResult update(@PathVariable("id") String id) { + SmsTemplateEntity entity = smsTemplateService.getInfo(id); + if (entity != null) { + if (entity.getEnabledMark() == 0) { + entity.setEnabledMark(1); + } else { + entity.setEnabledMark(0); + } + boolean flag = smsTemplateService.update(id, entity); + if (!flag) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + return ActionResult.fail(MsgCode.FA002.get()); + } + + @Operation(summary = "获取模板参数") + @PostMapping("/getTemplate") + public ActionResult testConnect(@RequestBody SmsTemplateCrForm smsTemplateCrForm) { + // 定义返回对象 + List list = null; + if (smsTemplateCrForm != null) { + // 得到短信模型 + SmsModel smsModel = smsTemplateService.getSmsConfig(); + list = SmsUtil.querySmsTemplateRequest(smsTemplateCrForm.getCompany(), smsModel, smsTemplateCrForm.getEndpoint(), smsTemplateCrForm.getRegion(), smsTemplateCrForm.getTemplateId()); + } + if (list == null) { + return ActionResult.fail(MsgCode.SYS015.get()); + } + return ActionResult.success(list); + } + + /** + * 获取指定短信模板参数 + * + * @return + */ + @Operation(summary = "获取指定短信模板参数") + @GetMapping("/getTemplate/{id}") + public ActionResult getTemplateById(@PathVariable("id") String id) { + // 定义返回对象 + List list = new ArrayList<>(); + SmsTemplateEntity entity = smsTemplateService.getInfo(id); + if (entity != null && entity.getCompany() != null) { + // 得到系统配置 + SmsModel smsModel = smsTemplateService.getSmsConfig(); + list = SmsUtil.querySmsTemplateRequest(entity.getCompany(), smsModel, entity.getEndpoint(), entity.getRegion(), entity.getTemplateId()); + } + if (list == null) { + return ActionResult.success(new ArrayList<>()); + } + return ActionResult.success(list); + } + + @Operation(summary = "发送测试短信") + @PostMapping("/testSent") + public ActionResult testSentSms(@RequestBody SmsTemplateCrForm smsTemplateCrForm) { + if (smsTemplateCrForm.getCompany() != null) { + // 得到短信模型 + SmsModel smsModel = smsTemplateService.getSmsConfig(); + // 发送短信 + String sentCode = SmsUtil.sentSms(smsTemplateCrForm.getCompany(), smsModel, smsTemplateCrForm.getEndpoint(), smsTemplateCrForm.getRegion(), smsTemplateCrForm.getPhoneNumbers(), smsTemplateCrForm.getSignContent(), smsTemplateCrForm.getTemplateId(), smsTemplateCrForm.getParameters()); + if ("OK".equalsIgnoreCase(sentCode)) { + return ActionResult.success(MsgCode.SU017.get()); + } + } + return ActionResult.fail(MsgCode.GT103.get()); + } + + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/SynThirdInfoController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/SynThirdInfoController.java new file mode 100644 index 0000000..d41d0b1 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/SynThirdInfoController.java @@ -0,0 +1,888 @@ +package com.yunzhupaas.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import com.yunzhupaas.base.controller.SuperController; +import cn.hutool.core.util.BooleanUtil; +import com.alibaba.fastjson.JSONObject; +import com.dingtalk.api.response.OapiV2DepartmentListsubResponse; +import com.dingtalk.api.response.OapiV2UserListResponse; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.exception.WxErrorException; +import com.yunzhupaas.message.entity.SynThirdInfoEntity; +import com.yunzhupaas.message.model.message.*; +import com.yunzhupaas.message.service.MessageService; +import com.yunzhupaas.message.service.SynThirdDingTalkService; +import com.yunzhupaas.message.service.SynThirdInfoService; +import com.yunzhupaas.message.service.SynThirdQyService; +import com.yunzhupaas.base.util.SynDingTalkUtil; +import com.yunzhupaas.base.util.SynQyWebChatUtil; +import com.yunzhupaas.message.util.SynThirdConsts; +import com.yunzhupaas.message.util.SynThirdTotal; +import com.yunzhupaas.model.BaseSystemInfo; +import com.yunzhupaas.permission.entity.OrganizeEntity; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.model.organize.OrganizeModel; +import com.yunzhupaas.permission.service.OrganizeService; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.treeutil.SumTree; +import com.yunzhupaas.util.treeutil.newtreeutil.TreeDotUtils; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 第三方工具的公司-部门-用户同步表模型 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/4/25 9:30 + */ +@Tag(name = "第三方信息同步", description = "SynThirdInfo") +@RestController +@RequestMapping("/api/system/SynThirdInfo") +@Slf4j +public class SynThirdInfoController extends SuperController { + + @Autowired + private SynThirdInfoService synThirdInfoService; + @Autowired + private SynThirdQyService synThirdQyService; + @Autowired + private SynThirdDingTalkService synThirdDingTalkService; + @Autowired + private OrganizeService organizeService; + @Autowired + private UserService userService; + @Autowired + private RedisUtil redisUtil; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private MessageService messageService; + @Autowired + private CacheKeyUtil cacheKeyUtil; + + /** + * 新增同步表信息 + * + * @param synThirdInfoCrForm 新建模型 + * @return ignore + */ + @Operation(summary = "新增同步表信息") + @Parameters({ + @Parameter(name = "synThirdInfoCrForm", description = "同步信息模型", required = true) + }) + @SaCheckPermission("system.sysConfig") + @PostMapping + @DSTransactional + public ActionResult create(@RequestBody @Valid SynThirdInfoCrForm synThirdInfoCrForm) throws DataException { + UserInfo userInfo = UserProvider.getUser(); + SynThirdInfoEntity entity = JsonUtil.getJsonToBean(synThirdInfoCrForm, SynThirdInfoEntity.class); + entity.setCreatorUserId(userInfo.getUserId()); + entity.setCreatorTime(DateUtil.getNowDate()); + entity.setId(RandomUtil.uuId()); + synThirdInfoService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 获取同步表信息 + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "获取同步表信息") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("system.sysConfig") + @GetMapping("/{id}") + public SynThirdInfoEntity getInfo(@PathVariable("id") String id) { + SynThirdInfoEntity entity = synThirdInfoService.getInfo(id); + return entity; + } + + /** + * 获取指定类型的同步对象 + * + * @param thirdType 1:企业微信 2:钉钉 + * @param dataType 1:公司 2:部门 3:用户 + * @param id dataType对应的对象ID + * @return ignore + */ + @Operation(summary = "获取指定类型的同步对象") + @GetMapping("/getInfoBySysObjId/{thirdType}/{dataType}/{id}") + public SynThirdInfoEntity getInfoBySysObjId(@PathVariable("thirdType") String thirdType, @PathVariable("dataType") String dataType, @PathVariable("id") String id) { + SynThirdInfoEntity entity = synThirdInfoService.getInfoBySysObjId(thirdType, dataType, id); + return entity; + } + + + /** + * 更新同步表信息 + * + * @param id 主键 + * @param synThirdInfoUpForm 修改对象 + * @return ignore + * @throws DataException ignore + */ + @Operation(summary = "更新同步表信息") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "synThirdInfoUpForm", description = "同步模型", required = true) + }) + @SaCheckPermission("system.sysConfig") + @PutMapping("/{id}") + @DSTransactional + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid SynThirdInfoUpForm synThirdInfoUpForm) throws DataException { + SynThirdInfoEntity entity = synThirdInfoService.getInfo(id); + UserInfo userInfo = UserProvider.getUser(); + if (entity != null) { + SynThirdInfoEntity entityUpd = JsonUtil.getJsonToBean(synThirdInfoUpForm, SynThirdInfoEntity.class); + entityUpd.setCreatorUserId(entity.getCreatorUserId()); + entityUpd.setCreatorTime(entity.getCreatorTime()); + entityUpd.setLastModifyUserId(userInfo.getUserId()); + entityUpd.setLastModifyTime(DateUtil.getNowDate()); + synThirdInfoService.update(id, entityUpd); + + return ActionResult.success(MsgCode.SU004.get()); + } else { + return ActionResult.fail(MsgCode.FA002.get()); + } + } + + + /** + * 删除同步表信息 + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "删除同步表信息") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("system.sysConfig") + @DeleteMapping("/{id}") + @DSTransactional + public ActionResult delete(@PathVariable("id") String id) { + SynThirdInfoEntity entity = synThirdInfoService.getInfo(id); + if (entity != null) { + synThirdInfoService.delete(entity); + } + return ActionResult.success(MsgCode.SU003.get()); + } + + + /** + * 获取第三方(如:企业微信、钉钉)的组织与用户同步统计信息 + * + * @param thirdType 第三方类型(1:企业微信;2:钉钉) + * @return ignore + */ + @Operation(summary = "获取第三方(如:企业微信、钉钉)的组织与用户同步统计信息") + @Parameters({ + @Parameter(name = "thirdType", description = "第三方类型(1:企业微信;2:钉钉)", required = true) + }) + @SaCheckPermission("system.sysConfig") + @GetMapping("/getSynThirdTotal/{thirdType}") + public ActionResult> getSynThirdTotal(@PathVariable("thirdType") String thirdType) { + List synTotalList = new ArrayList<>(); + synTotalList.add(synThirdInfoService.getSynTotal(thirdType, SynThirdConsts.DATA_TYPE_ORG)); + synTotalList.add(synThirdInfoService.getSynTotal(thirdType, SynThirdConsts.DATA_TYPE_USER)); + return ActionResult.success(synTotalList); + } + + /** + * 获取第三方(如:企业微信、钉钉)的组织或用户同步统计信息 + * + * @param thirdType 第三方类型(1:企业微信;2:钉钉) + * @param dataType 数据类型(1:组织(公司与部门);2:用户) + * @return ignore + */ + @Operation(summary = "获取第三方(如:企业微信、钉钉)的组织或用户同步统计信息") + @Parameters({ + @Parameter(name = "thirdType", description = "第三方类型(1:企业微信;2:钉钉)", required = true), + @Parameter(name = "dataType", description = "数据类型(1:组织(公司与部门);2:用户)", required = true) + }) + @SaCheckPermission("system.sysConfig") + @GetMapping("/getSynThirdTotal/{thirdType}/{dataType}") + public SynThirdTotal getSynThirdTotal(@PathVariable("thirdType") String thirdType, @PathVariable("dataType") String dataType) { + SynThirdTotal synThirdTotal = synThirdInfoService.getSynTotal(thirdType, dataType); + return synThirdTotal; + } + + //==================================企业微信的公司-部门-用户批量同步到本系统20220609================================== + + /** + * 本地所有组织信息(包含公司和部门)同步到企业微信 + * 不带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * + * @return ignore + * @throws WxErrorException ignore + */ + @Operation(summary = "本地所有组织信息(包含公司和部门)同步到企业微信") + @Parameters({ + @Parameter(name = "type", description = "类型", required = true) + }) + @SaCheckPermission("system.sysConfig") + @GetMapping("/synAllOrganizeSysToQy") + public ActionResult synAllOrganizeSysToQy(@RequestParam("type") String type) throws WxErrorException { + if("1".equals(type)){ + //类型为1走企业微信组织信息同步到本地 + ActionResult actionResult = this.synAllOrganizeQyToSys(); + return actionResult; + } + JSONObject retMsg = new JSONObject(); + BaseSystemInfo config = synThirdQyService.getQyhConfig(); + String corpId = config.getQyhCorpId(); + // 向企业微信插入数据需要另外token(凭证密钥) + String corpSecret = config.getQyhAgentSecret(); + String access_token = ""; + try { + // 获取Token值 + JSONObject tokenObject = SynQyWebChatUtil.getAccessToken(corpId, corpSecret); + if (!tokenObject.getBoolean("code")) { + return ActionResult.fail(MsgCode.SYS025.get()); + } + access_token = tokenObject.getString("access_token"); + + // 获取同步表、部门表的信息 + List synThirdInfoList = synThirdInfoService.getList(SynThirdConsts.THIRD_TYPE_QY, SynThirdConsts.DATA_TYPE_ORG); + Map organizeList = organizeService.getOrgMapsAll(); + + // 部门进行树结构化,固化上下层级序列化 + List organizeModelList = JsonUtil.getJsonToList(organizeList.values(), OrganizeModel.class); + List> trees = TreeDotUtils.convertListToTreeDot(organizeModelList); + List listVO = JsonUtil.getJsonToList(trees, OraganizeListVO.class); + + // 转化成为按上下层级顺序排序的列表数据 + List listByOrder = new ArrayList<>(); + for (OraganizeListVO organizeVo : listVO) { + OrganizeEntity entity = organizeList.get(organizeVo.getId()); + listByOrder.add(entity); + SynQyWebChatUtil.getOrganizeTreeToList(organizeVo, organizeList, listByOrder); + } + + // 根据同步表、公司表进行比较,判断不存的执行删除 + for (SynThirdInfoEntity synThirdInfoEntity : synThirdInfoList) { + if (organizeList.get(synThirdInfoEntity.getSysObjId()) == null) { + //执行删除操作 +// retMsg = synThirdQyService.deleteDepartmentSysToQy(true, synThirdInfoEntity.getSysObjId(), access_token); + } + } + + synThirdInfoList = synThirdInfoService.getList(SynThirdConsts.THIRD_TYPE_QY, SynThirdConsts.DATA_TYPE_ORG); + // 根据公司表、同步表进行比较,决定执行创建、还是更新 + for (OrganizeEntity organizeEntity : listByOrder) { + if (synThirdInfoList.stream().filter(t -> t.getSysObjId().equals(organizeEntity.getId())).count() > 0 ? true : false) { + // 执行更新功能 + retMsg = synThirdQyService.updateDepartmentSysToQy(true, organizeEntity, access_token); + } else { + // 执行创建功能 + retMsg = synThirdQyService.createDepartmentSysToQy(true, organizeEntity, access_token); + } + } + } catch (Exception e) { + ActionResult.fail(e.toString()); + } + //获取结果 + SynThirdTotal synThirdTotal = synThirdInfoService.getSynTotal(SynThirdConsts.THIRD_TYPE_QY, SynThirdConsts.DATA_TYPE_ORG); + return ActionResult.success(synThirdTotal); + } + + + /** + * 本地所有用户信息同步到企业微信 + * 不带第三方错误定位判断的功能代码,只获取调用接口的返回信息 20210604 + * + * @return ignore + * @throws WxErrorException ignore + */ + @Operation(summary = "本地所有用户信息同步到企业微信") + @Parameters({ + @Parameter(name = "type", description = "类型", required = true) + }) + @SaCheckPermission("system.sysConfig") + @GetMapping("/synAllUserSysToQy") + public ActionResult synAllUserSysToQy(@RequestParam("type") String type) throws WxErrorException { + if("1".equals(type)){ + //类型为1走企业微信用户同步到本地 + ActionResult actionResult = this.synAllUserQyToSys(); + return actionResult; + } + JSONObject retMsg = new JSONObject(); + BaseSystemInfo config = synThirdQyService.getQyhConfig(); + String corpId = config.getQyhCorpId(); + // 向企业微信插入数据需要另外token(凭证密钥) + String corpSecret = config.getQyhAgentSecret(); + String access_token = ""; + + try { + // 获取Token值 + JSONObject tokenObject = SynQyWebChatUtil.getAccessToken(corpId, corpSecret); + if (!tokenObject.getBoolean("code")) { + return ActionResult.fail(MsgCode.SYS025.get()); + } + access_token = tokenObject.getString("access_token"); + + // 获取同步表、用户表的信息 + List synThirdInfoList = synThirdInfoService.getList(SynThirdConsts.THIRD_TYPE_QY, SynThirdConsts.DATA_TYPE_USER); + List userList = userService.getList(false); + + // 根据同步表、公司表进行比较,判断不存的执行删除 + for (SynThirdInfoEntity synThirdInfoEntity : synThirdInfoList) { + if (userList.stream().filter(t -> t.getId().equals(synThirdInfoEntity.getSysObjId())).count() == 0 ? true : false) { + //执行删除操作 + retMsg = synThirdQyService.deleteUserSysToQy(true, synThirdInfoEntity.getSysObjId(), access_token); + } + } + + // 根据公司表、同步表进行比较,决定执行创建、还是更新 + for (UserEntity userEntity : userList) { + if (synThirdInfoList.stream().filter(t -> t.getSysObjId().equals(userEntity.getId())).count() == 0 ? true : false) { + // 执行创建功能 + retMsg = synThirdQyService.createUserSysToQy(true, userEntity, access_token); + } else { + // 执行更新功能 + retMsg = synThirdQyService.updateUserSysToQy(true, userEntity, access_token); + } + } + } catch (Exception e) { + ActionResult.fail(e.toString()); + } + + //获取结果 + SynThirdTotal synThirdTotal = synThirdInfoService.getSynTotal(SynThirdConsts.THIRD_TYPE_QY, SynThirdConsts.DATA_TYPE_USER); + return ActionResult.success(synThirdTotal); + } + + //==================================企业微信的公司-部门-用户批量同步到本系统20220609================================== + + /** + * 企业微信所有组织信息(包含公司和部门)同步到本系统 + * + * @return ignore + */ + @Operation(summary = "企业微信所有组织信息(包含公司和部门)同步到本系统") + @SaCheckPermission("system.sysConfig") + @GetMapping("/synAllOrganizeQyToSys") + public ActionResult synAllOrganizeQyToSys() { + // 设置redis的key + String synDing = ""; + UserInfo userInfo = UserProvider.getUser(); + if (configValueUtil.isMultiTenancy()) { + synDing = userInfo.getTenantId() + "_" + userInfo.getUserId() + "_synAllOrganizeQyToSys"; + } else { + synDing = userInfo.getUserId() + "_synAllOrganizeQyToSys"; + } + // 如果redis中存在key说明同步正在进行 + if (redisUtil.exists(synDing)) { + return ActionResult.fail(MsgCode.SYS026.get()); + } + BaseSystemInfo config = synThirdQyService.getQyhConfig(); + + // 获取Token值 + JSONObject tokenObject = SynQyWebChatUtil.getAccessToken(config.getQyhCorpId(), config.getQyhCorpSecret()); + if (!tokenObject.getBoolean("code")) { + return ActionResult.fail(MsgCode.SYS025.get()); + } + + // 异步执行 + String finalSynDing = synDing; + ThreadPoolExecutorUtil.getExecutor().execute(() -> { + String userId = userInfo.getUserId(); + try { + redisUtil.insert(finalSynDing, "true"); + String access_token = tokenObject.getString("access_token"); + + List DingDeptList = new ArrayList<>(); + + List QyDeptAllList = new ArrayList<>(); + + // 获取同步表的信息 + List synThirdInfoList = synThirdInfoService.syncThirdInfoByType(SynThirdConsts.THIRD_TYPE_QY_To_Sys, SynThirdConsts.DATA_TYPE_ORG, SynThirdConsts.THIRD_TYPE_QY); + + // 获取企业微信上的根目录部门(本系统的组织) + String departId = SynThirdConsts.QY_ROOT_DEPT_ID; + + // 获取企业微信上的部门列表 + JSONObject retMsg = SynQyWebChatUtil.getDepartmentList(departId, access_token); + StringBuilder department = new StringBuilder(retMsg.get("department").toString()); + QyDeptAllList = JsonUtil.getJsonToList(department.toString(),QyWebChatDeptModel.class); + + + // 根据同步表、公司表进行比较,判断不存的执行删除 + for (SynThirdInfoEntity synThirdInfoEntity : synThirdInfoList) { + if (QyDeptAllList.stream().filter(t -> String.valueOf(t.getParentid()).equals(synThirdInfoEntity.getThirdObjId())).count() == 0) { +// // 执行删除操作 +// retMsg = synThirdDingTalkService.deleteDepartmentDingToSys(true, synThirdInfoEntity.getThirdObjId()); + } + } + + // 删除后需要重新获取数据 + synThirdInfoList = synThirdInfoService.getList(SynThirdConsts.THIRD_TYPE_QY_To_Sys, SynThirdConsts.DATA_TYPE_ORG); + + // 根据公司表、同步表进行比较,决定执行创建、还是更新 + for (QyWebChatDeptModel qyWebChatDeptModel : QyDeptAllList) { + if (synThirdInfoList.stream().filter(t -> t.getThirdObjId().equals(String.valueOf(qyWebChatDeptModel.getId()))).count() > 0) { + // 执行本地更新功能 + synThirdQyService.updateDepartmentQyToSys(true, qyWebChatDeptModel, access_token); + } else { + // 执行本的创建功能 + synThirdQyService.createDepartmentQyToSys(true, qyWebChatDeptModel, access_token); + } + } + } catch (Exception e) { + log.error(finalSynDing + ",企业微信所有组织信息同步到本系统失败:" + e.getMessage()); + } finally { + redisUtil.remove(finalSynDing); + redisUtil.remove(cacheKeyUtil.getOrganizeList()); + List toUserId = new ArrayList<>(1); + toUserId.add(userId); + messageService.sentMessage(toUserId, "企业微信所有组织信息同步到本系统", "同步完成", userInfo,1,1); + redisUtil.remove(cacheKeyUtil.getOrganizeInfoList()); + } + }); + return ActionResult.success(MsgCode.SYS026.get()); + } + + + /** + * 企业微信所有用户信息同步到本系统 + * + * @return ignore + */ + @Operation(summary = "企业微信所有用户信息同步到本系统") + @SaCheckPermission("system.sysConfig") + @GetMapping("/synAllUserQyToSys") + @Transactional + public ActionResult synAllUserQyToSys() { + // 设置redis的key + String synDing = ""; + UserInfo userInfo = UserProvider.getUser(); + if (configValueUtil.isMultiTenancy()) { + synDing = userInfo.getTenantId() + "_" + userInfo.getUserId() + "_synAllUserQyToSys"; + } else { + synDing = userInfo.getUserId() + "_synAllUserQyToSys"; + } + // 如果redis中存在key说明同步正在进行 + if (redisUtil.exists(synDing)) { + return ActionResult.fail(MsgCode.SYS026.get()); + } + // 获取已同步的部门信息 + List synThirdOrgList = synThirdInfoService.getList(SynThirdConsts.THIRD_TYPE_QY_To_Sys, SynThirdConsts.DATA_TYPE_ORG); + List dingDeptIdList = new ArrayList<>(); + if (synThirdOrgList != null && synThirdOrgList.size() > 0) { + dingDeptIdList = synThirdOrgList.stream().map(SynThirdInfoEntity::getThirdObjId).distinct().collect(Collectors.toList()); + } else { + return ActionResult.fail(MsgCode.SYS027.get()); + } + + // 获取Token值 + BaseSystemInfo config = synThirdQyService.getQyhConfig(); + JSONObject tokenObject = SynQyWebChatUtil.getAccessToken(config.getQyhCorpId(), config.getQyhCorpSecret()); + if (!tokenObject.getBoolean("code")) { + return ActionResult.fail(MsgCode.SYS025.get()); + } + // 异步执行 + List finalDingDeptIdList = dingDeptIdList; + String finalSynDing = synDing; + ThreadPoolExecutorUtil.getExecutor().execute(() -> { + String userId = userInfo.getUserId(); + try { + redisUtil.insert(finalSynDing, "true"); + List dingUserList = new ArrayList<>(); + List qyUserAllList = new ArrayList<>(); + String access_token = tokenObject.getString("access_token"); + + // 获取企业微信的用户列表 + JSONObject retMsg = SynQyWebChatUtil.getUserList("1", "1",access_token); + StringBuilder department = new StringBuilder(retMsg.get("userlist").toString()); + qyUserAllList = JsonUtil.getJsonToList(retMsg.get("userlist"),QyWebChatUserModel.class); + + // 获取同步表、用户表的信息 + List synThirdInfoList = synThirdInfoService.syncThirdInfoByType(SynThirdConsts.THIRD_TYPE_QY_To_Sys, SynThirdConsts.DATA_TYPE_USER, SynThirdConsts.THIRD_TYPE_QY); + + // 根据同步表、公司表进行比较,判断不存的执行删除 + for (SynThirdInfoEntity synThirdInfoEntity : synThirdInfoList) { + // 线上不包含中间表的这条记录 + if (qyUserAllList.stream().filter(t -> t.getUserid().equals(synThirdInfoEntity.getThirdObjId())).count() == 0) { + // 执行删除此条中间表记录 + synThirdDingTalkService.deleteUserDingToSys(true, synThirdInfoEntity.getThirdObjId()); + } + } + // 得到企业微信信息 + List synThirdInfoLists = synThirdInfoService.syncThirdInfoByType(SynThirdConsts.THIRD_TYPE_QY_To_Sys, SynThirdConsts.DATA_TYPE_USER, SynThirdConsts.THIRD_TYPE_QY); + // 根据公司表、同步表进行比较,决定执行创建、还是更新 + for (QyWebChatUserModel qyWebChatUserModel : qyUserAllList) { + if (synThirdInfoList.stream().filter(t -> t.getThirdObjId().equals(qyWebChatUserModel.getUserid())).count() == 0 + && synThirdInfoLists.stream().filter(t -> t.getThirdObjId().equals(qyWebChatUserModel.getUserid())).count() == 0) { + // 执行创建功能 + synThirdQyService.createUserQyToSys(true, qyWebChatUserModel,access_token); + } else { + // 执行更新功能 + synThirdQyService.updateUserQyToSystem(true, qyWebChatUserModel,access_token); + } + } + } catch (Exception e) { + e.printStackTrace(); + log.error(finalSynDing + ",企业微信所有用户信息同步到本系统失败:" + e.getMessage()); + } finally { + redisUtil.remove(finalSynDing); + List toUserId = new ArrayList<>(1); + toUserId.add(userId); + messageService.sentMessage(toUserId, "企业微信所有用户信息同步到本系统", "同步完成", userInfo,1,1); + } + }); + return ActionResult.success(MsgCode.SYS026.get()); + } + + //==================================本系统的公司-部门-用户批量同步到钉钉================================== + + /** + * 本地所有组织信息(包含公司和部门)同步到钉钉 + * 不带第三方错误定位判断的功能代码 20210604 + * + * @return ignore + */ + @Operation(summary = "本地所有组织信息(包含公司和部门)同步到钉钉") + @Parameters({ + @Parameter(name = "type", description = "类型", required = true) + }) + @SaCheckPermission("system.sysConfig") + @GetMapping("/synAllOrganizeSysToDing") + public ActionResult synAllOrganizeSysToDing(@RequestParam("type") String type) { + if("1".equals(type)){ + //类型为1走钉钉组织部门信息同步到本地 + ActionResult actionResult = this.synAllOrganizeDingToSys(); + return actionResult; + } + JSONObject retMsg = new JSONObject(); + BaseSystemInfo config = synThirdDingTalkService.getDingTalkConfig(); + String corpId = config.getDingSynAppKey(); + String corpSecret = config.getDingSynAppSecret(); + + try { + // 获取Token值 + JSONObject tokenObject = SynDingTalkUtil.getAccessToken(corpId, corpSecret); + if (!tokenObject.getBoolean("code")) { + return ActionResult.fail(MsgCode.SYS053.get()); + } + String access_token = tokenObject.getString("access_token"); + + // 获取同步表、部门表的信息 + List synThirdInfoList = synThirdInfoService.getList(SynThirdConsts.THIRD_TYPE_DING, SynThirdConsts.DATA_TYPE_ORG); + Map organizeList = organizeService.getOrgMapsAll(); + + // 部门进行树结构化,固化上下层级序列化 + List organizeModelList = JsonUtil.getJsonToList(organizeList.values(), OrganizeModel.class); + List> trees = TreeDotUtils.convertListToTreeDot(organizeModelList); + List listVO = JsonUtil.getJsonToList(trees, OraganizeListVO.class); + + // 转化成为按上下层级顺序排序的列表数据 + List listByOrder = new ArrayList<>(); + for (OraganizeListVO organizeVo : listVO) { + OrganizeEntity entity = organizeList.get(organizeVo.getId()); + listByOrder.add(entity); + SynDingTalkUtil.getOrganizeTreeToList(organizeVo, organizeList, listByOrder); + } + + // 根据同步表、公司表进行比较,判断不存的执行删除 + for (SynThirdInfoEntity synThirdInfoEntity : synThirdInfoList) { + if (organizeList.get(synThirdInfoEntity.getSysObjId()) == null) { + //执行删除操作 + retMsg = synThirdDingTalkService.deleteDepartmentSysToDing(true, synThirdInfoEntity.getSysObjId(), access_token); + } + } + + synThirdInfoList = synThirdInfoService.getList(SynThirdConsts.THIRD_TYPE_DING, SynThirdConsts.DATA_TYPE_ORG); + // 根据公司表、同步表进行比较,决定执行创建、还是更新 + for (OrganizeEntity organizeEntity : listByOrder) { + if (synThirdInfoList.stream().filter(t -> t.getSysObjId().equals(organizeEntity.getId())).count() > 0 ? true : false) { + // 执行更新功能 + retMsg = synThirdDingTalkService.updateDepartmentSysToDing(true, organizeEntity, access_token); + } else { + // 执行创建功能 + retMsg = synThirdDingTalkService.createDepartmentSysToDing(true, organizeEntity, access_token); + } + } + } catch (Exception e) { + ActionResult.fail(e.toString()); + } + + //获取结果 + SynThirdTotal synThirdTotal = synThirdInfoService.getSynTotal(SynThirdConsts.THIRD_TYPE_DING, SynThirdConsts.DATA_TYPE_ORG); + return ActionResult.success(synThirdTotal); + } + + + /** + * 本地所有用户信息同步到钉钉 + * 不带第三方错误定位判断的功能代码 20210604 + * + * @return ignore + */ + @Operation(summary = "本地所有用户信息同步到钉钉") + @Parameters({ + @Parameter(name = "type", description = "类型", required = true) + }) + @SaCheckPermission("system.sysConfig") + @GetMapping("/synAllUserSysToDing") + public ActionResult synAllUserSysToDing(@RequestParam("type") String type) throws ParseException { + if("1".equals(type)){ + //类型为1走钉钉用户信息同步到本地 + ActionResult actionResult = this.synAllUserDingToSys(); + return actionResult; + } + JSONObject retMsg = new JSONObject(); + BaseSystemInfo config = synThirdDingTalkService.getDingTalkConfig(); + String corpId = config.getDingSynAppKey(); + String corpSecret = config.getDingSynAppSecret(); + + try { + // 获取Token值 + JSONObject tokenObject = SynDingTalkUtil.getAccessToken(corpId, corpSecret); + if (!tokenObject.getBoolean("code")) { + return ActionResult.success(MsgCode.SYS053.get()); + } + String access_token = tokenObject.getString("access_token"); + + // 获取同步表、用户表的信息 + List synThirdInfoList = synThirdInfoService.getList(SynThirdConsts.THIRD_TYPE_DING, SynThirdConsts.DATA_TYPE_USER); + List userList = userService.getList(false); + + // 根据同步表、公司表进行比较,判断不存的执行删除 + for (SynThirdInfoEntity synThirdInfoEntity : synThirdInfoList) { + if (userList.stream().filter(t -> t.getId().equals(synThirdInfoEntity.getSysObjId())).count() == 0 ? true : false) { + // 执行删除操作 + retMsg = synThirdDingTalkService.deleteUserSysToDing(true, synThirdInfoEntity.getSysObjId(), access_token); + } + } + + // 根据公司表、同步表进行比较,决定执行创建、还是更新 + for (UserEntity userEntity : userList) { + if (synThirdInfoList.stream().filter(t -> t.getSysObjId().equals(userEntity.getId())).count() == 0 ? true : false) { + // 执行创建功能 + retMsg = synThirdDingTalkService.createUserSysToDing(true, userEntity, access_token); + } else { + // 执行更新功能 + retMsg = synThirdDingTalkService.updateUserSysToDing(true, userEntity, access_token); + } + } + } catch (Exception e) { + ActionResult.fail(e.toString()); + } + + //获取结果 + SynThirdTotal synThirdTotal = synThirdInfoService.getSynTotal(SynThirdConsts.THIRD_TYPE_DING, SynThirdConsts.DATA_TYPE_USER); + return ActionResult.success(synThirdTotal); + } + + + //==================================钉钉的公司-部门-用户批量同步到本系统20220330================================== + + /** + * 钉钉所有组织信息(包含公司和部门)同步到本系统 + * 不带第三方错误定位判断的功能代码 20220330 + * + * @return ignore + */ + @Operation(summary = "钉钉所有组织信息(包含公司和部门)同步到本系统") + @SaCheckPermission("system.sysConfig") + @GetMapping("/synAllOrganizeDingToSys") + public ActionResult synAllOrganizeDingToSys() { + // 设置redis的key + String synDing = ""; + UserInfo userInfo = UserProvider.getUser(); + if (configValueUtil.isMultiTenancy()) { + synDing = userInfo.getTenantId() + "_" + userInfo.getUserId() + "_synAllOrganizeDingToSys"; + } else { + synDing = userInfo.getUserId() + "_synAllOrganizeDingToSys"; + } + // 如果redis中存在key说明同步正在进行 + if (redisUtil.exists(synDing)) { + return ActionResult.fail(MsgCode.SYS026.get()); + } + BaseSystemInfo config = synThirdDingTalkService.getDingTalkConfig(); + + // 获取Token值 + JSONObject tokenObject = SynDingTalkUtil.getAccessToken(config.getDingSynAppKey(), config.getDingSynAppSecret()); + if (!tokenObject.getBoolean("code")) { + return ActionResult.fail(MsgCode.SYS053.get()); + } + + // 异步执行 + String finalSynDing = synDing; + ThreadPoolExecutorUtil.getExecutor().execute(() -> { + String userId = userInfo.getUserId(); + try { + redisUtil.insert(finalSynDing, "true"); + + List DingDeptList = new ArrayList<>(); + + List DingDeptAllList = new ArrayList<>(); + String access_token = tokenObject.getString("access_token"); + + // 获取同步表的信息 + List synThirdInfoList = synThirdInfoService.syncThirdInfoByType(SynThirdConsts.THIRD_TYPE_DING_To_Sys, SynThirdConsts.DATA_TYPE_ORG, SynThirdConsts.THIRD_TYPE_DING); + + // 获取钉钉上的根目录部门(本系统的组织) + long departId = SynThirdConsts.DING_ROOT_DEPT_ID; + if (StringUtil.isNoneBlank(config.getDingDepartment())) { + departId = Long.parseLong(config.getDingDepartment()); + } + synThirdInfoService.initBaseDept(departId, access_token,SynThirdConsts.THIRD_TYPE_DING_To_Sys); + + // 获取钉钉上的部门列表 + JSONObject retMsg = SynDingTalkUtil.getDepartmentList(departId, access_token); + DingDeptList = (List) retMsg.get("department"); + List dingDeptListVo = JsonUtil.getJsonToList(DingDeptList, DingTalkDeptModel.class); + DingDeptAllList.addAll(dingDeptListVo); + + + // 根据同步表、公司表进行比较,判断不存的执行删除 + for (SynThirdInfoEntity synThirdInfoEntity : synThirdInfoList) { + if (DingDeptAllList.stream().filter(t -> String.valueOf(t.getDeptId()).equals(synThirdInfoEntity.getThirdObjId())).count() == 0) { +// // 执行删除操作 +// retMsg = synThirdDingTalkService.deleteDepartmentDingToSys(true, synThirdInfoEntity.getThirdObjId()); + } + } + + // 删除后需要重新获取数据 + synThirdInfoList = synThirdInfoService.getList(SynThirdConsts.THIRD_TYPE_DING_To_Sys, SynThirdConsts.DATA_TYPE_ORG); + + // 根据公司表、同步表进行比较,决定执行创建、还是更新 + for (DingTalkDeptModel dingDeptEntity : DingDeptAllList) { + if (synThirdInfoList.stream().filter(t -> t.getThirdObjId().equals(String.valueOf(dingDeptEntity.getDeptId()))).count() > 0) { + // 执行本地更新功能 + synThirdDingTalkService.updateDepartmentDingToSys(true, dingDeptEntity, access_token); + } else { + // 执行本的创建功能 + synThirdDingTalkService.createDepartmentDingToSys(true, dingDeptEntity, access_token); + } + } + } catch (Exception e) { + log.error(finalSynDing + ",钉钉所有组织信息同步到本系统失败:" + e.getMessage()); + } finally { + redisUtil.remove(finalSynDing); + redisUtil.remove(cacheKeyUtil.getOrganizeList()); + List toUserId = new ArrayList<>(1); + toUserId.add(userId); + messageService.sentMessage(toUserId, "钉钉所有组织信息同步到本系统", "同步完成", userInfo,1,1); + } + }); + return ActionResult.success(MsgCode.SYS026.get()); + } + + + /** + * 钉钉所有用户信息同步到本系统 + * 不带第三方错误定位判断的功能代码 20210604 + * + * @return ignore + */ + @Operation(summary = "钉钉所有用户信息同步到本系统") + @SaCheckPermission("system.sysConfig") + @GetMapping("/synAllUserDingToSys") + @Transactional + public ActionResult synAllUserDingToSys() { + // 设置redis的key + String synDing = ""; + UserInfo userInfo = UserProvider.getUser(); + if (configValueUtil.isMultiTenancy()) { + synDing = userInfo.getTenantId() + "_" + userInfo.getUserId() + "_synAllUserDingToSys"; + } else { + synDing = userInfo.getUserId() + "_synAllUserDingToSys"; + } + // 如果redis中存在key说明同步正在进行 + if (redisUtil.exists(synDing)) { + return ActionResult.fail(MsgCode.SYS026.get()); + } + // 获取已同步的部门信息 + List synThirdOrgList = synThirdInfoService.getList(SynThirdConsts.THIRD_TYPE_DING_To_Sys, SynThirdConsts.DATA_TYPE_ORG); + List dingDeptIdList = new ArrayList<>(); + if (synThirdOrgList != null && synThirdOrgList.size() > 0) { + dingDeptIdList = synThirdOrgList.stream().map(SynThirdInfoEntity::getThirdObjId).distinct().collect(Collectors.toList()); + } else { + return ActionResult.fail(MsgCode.SYS028.get()); + } + + // 获取Token值 + BaseSystemInfo config = synThirdDingTalkService.getDingTalkConfig(); + JSONObject tokenObject = SynDingTalkUtil.getAccessToken(config.getDingSynAppKey(), config.getDingSynAppSecret()); + if (!tokenObject.getBoolean("code")) { + return ActionResult.fail(MsgCode.SYS053.get()); + } + // 异步执行 + List finalDingDeptIdList = dingDeptIdList; + String finalSynDing = synDing; + ThreadPoolExecutorUtil.getExecutor().execute(() -> { + String userId = userInfo.getUserId(); + try { + redisUtil.insert(finalSynDing, "true"); + List dingUserList = new ArrayList<>(); + String access_token = tokenObject.getString("access_token"); + + // 获取钉钉的用户列表 + JSONObject retMsg = SynDingTalkUtil.getUserDingList(finalDingDeptIdList, access_token); + dingUserList = (List) retMsg.get("userlist"); + + // 获取同步表、用户表的信息 + List synThirdInfoList = synThirdInfoService.syncThirdInfoByType(SynThirdConsts.THIRD_TYPE_DING_To_Sys, SynThirdConsts.DATA_TYPE_USER, SynThirdConsts.THIRD_TYPE_DING); + + // 根据同步表、公司表进行比较,判断不存的执行删除 + for (SynThirdInfoEntity synThirdInfoEntity : synThirdInfoList) { + // 线上不包含中间表的这条记录 + if (dingUserList.stream().filter(t -> t.getUserid().equals(synThirdInfoEntity.getThirdObjId())).count() == 0) { + // 执行删除此条中间表记录 + synThirdDingTalkService.deleteUserDingToSys(true, synThirdInfoEntity.getThirdObjId()); + } + } + // 得到推送钉钉信息 + List synThirdInfoLists = synThirdInfoService.syncThirdInfoByType(SynThirdConsts.THIRD_TYPE_DING, SynThirdConsts.DATA_TYPE_USER, SynThirdConsts.THIRD_TYPE_DING); + // 根据公司表、同步表进行比较,决定执行创建、还是更新 + for (OapiV2UserListResponse.ListUserResponse dingUserModel : dingUserList) { + if (synThirdInfoList.stream().filter(t -> t.getThirdObjId().equals(dingUserModel.getUserid())).count() == 0 + && synThirdInfoLists.stream().filter(t -> t.getThirdObjId().equals(dingUserModel.getUserid())).count() == 0) { + // 执行创建功能 + synThirdDingTalkService.createUserDingToSys(true, dingUserModel, access_token); + } else { + // 执行更新功能 + synThirdDingTalkService.updateUserDingToSystem(true, dingUserModel); + } + } + } catch (Exception e) { + e.printStackTrace(); + log.error(finalSynDing + ",钉钉所有用户信息同步到本系统失败:" + e.getMessage()); + } finally { + redisUtil.remove(finalSynDing); + List toUserId = new ArrayList<>(1); + toUserId.add(userId); + messageService.sentMessage(toUserId, "钉钉所有用户信息同步到本系统", "同步完成", userInfo,1,1); + } + }); + return ActionResult.success(MsgCode.SYS026.get()); + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/SysConfigController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/SysConfigController.java new file mode 100644 index 0000000..2f91b50 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/SysConfigController.java @@ -0,0 +1,249 @@ +package com.yunzhupaas.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.util.ObjectUtil; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import com.yunzhupaas.base.controller.SuperController; +import cn.hutool.json.JSONUtil; +import com.alibaba.fastjson.JSONObject; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.entity.EmailConfigEntity; +import com.yunzhupaas.base.entity.SysConfigEntity; +import com.yunzhupaas.base.model.systemconfig.EmailTestForm; +import com.yunzhupaas.base.model.systemconfig.SysConfigModel; +import com.yunzhupaas.base.service.SysconfigService; +import com.yunzhupaas.base.service.SystemConfigApi; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.message.entity.QyWebChatModel; +import com.yunzhupaas.message.model.message.DingTalkModel; +import com.yunzhupaas.message.util.QyWebChatUtil; +import com.yunzhupaas.permission.model.user.form.UserUpAdminForm; +import com.yunzhupaas.permission.model.user.vo.UserAdminVO; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.third.DingTalkUtil; +import com.yunzhupaas.util.wxutil.HttpUtil; +import com.yunzhupaas.workflow.service.TaskApi; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; +import java.util.*; + +/** + * 系统配置 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Tag(name = "系统配置", description = "SysConfig") +@RestController +@RequestMapping("/api/system/SysConfig") +public class SysConfigController extends SuperController implements SystemConfigApi { + + @Autowired + private SysconfigService sysconfigService; + + @Autowired + private UserService userService; + + @Autowired + private TaskApi taskApi; + + /** + * 列表 + * + * @return ignore + */ + @Operation(summary = "列表") + @GetMapping + @SaCheckPermission("system.sysConfig") + public ActionResult list() { + List list = sysconfigService.getList("SysConfig"); + HashMap map = new HashMap<>(16); + for (SysConfigEntity sys : list) { + map.put(sys.getFkey(), sys.getValue()); + } + SysConfigModel sysConfigModel = JsonUtil.getJsonToBean(map, SysConfigModel.class); + return ActionResult.success(sysConfigModel); + } + + /** + * 保存设置 + * + * @param sysConfigModel 系统配置模型 + * @return ignore + */ + @Operation(summary = "更新系统配置") + @Parameter(name = "sysConfigModel", description = "系统模型", required = true) + @SaCheckPermission("system.sysConfig") + @PutMapping + public ActionResult save(@RequestBody SysConfigModel sysConfigModel) { + if (Objects.nonNull(sysConfigModel.getVerificationCodeNumber())) { + if (sysConfigModel.getVerificationCodeNumber() > 6) { + return ActionResult.fail(MsgCode.SYS029.get()); + } + if (sysConfigModel.getVerificationCodeNumber() < 3) { + return ActionResult.fail(MsgCode.SYS030.get()); + } + } + String flowTodo = sysconfigService.getValueByKey("flowTodo"); + if (ObjectUtil.equals(flowTodo, "1") && ObjectUtil.equals(sysConfigModel.getFlowTodo(), 0)) { + if (taskApi.checkTodo()) { + return ActionResult.fail(MsgCode.WF141.get()); + } + } + String flowSign = sysconfigService.getValueByKey("flowSign"); + if (ObjectUtil.equals(flowSign, "1") && ObjectUtil.equals(sysConfigModel.getFlowSign(), 0)) { + if (taskApi.checkSign()) { + return ActionResult.fail(MsgCode.WF138.get()); + } + } + if (sysConfigModel.getAddSignLevel() > 6 || sysConfigModel.getAddSignLevel() < 1) { + return ActionResult.fail("加签层级的范围不在1-6之间"); + } + List entitys = new ArrayList<>(); + Map map = JsonUtil.entityToMap(sysConfigModel); + map.put("isLog", "1"); + map.put("sysTheme", "1"); + map.put("pageSize", "30"); + map.put("lastLoginTime", 1); + for (Map.Entry entry : map.entrySet()) { + SysConfigEntity entity = new SysConfigEntity(); + entity.setId(RandomUtil.uuId()); + entity.setFkey(entry.getKey()); + entity.setValue(String.valueOf(entry.getValue())); + entitys.add(entity); + } + sysconfigService.save(entitys); + return ActionResult.success(MsgCode.SU005.get()); + } + + /** + * 邮箱账户密码验证 + * + * @param emailTestForm 邮箱测试模型 + * @return ignore + */ + @Operation(summary = "邮箱连接测试") + @Parameter(name = "emailTestForm", description = "邮箱测试模型", required = true) + @SaCheckPermission("system.sysConfig") + @PostMapping("/Email/Test") + public ActionResult checkLogin(@RequestBody EmailTestForm emailTestForm) { + EmailConfigEntity entity = JsonUtil.getJsonToBean(emailTestForm, EmailConfigEntity.class); + entity.setEmailSsl(Integer.valueOf(emailTestForm.getSsl())); + String result = sysconfigService.checkLogin(entity); + if ("true".equals(result)) { + return ActionResult.success(MsgCode.SU017.get()); + } else { + return ActionResult.fail(result); + } + } + + + //=====================================测试企业微信、钉钉的连接===================================== + + /** + * 测试企业微信配置的连接功能 + * + * @param type 0-发送消息,1-同步组织 + * @param qyWebChatModel 企业微信模型 + * @return ignore + */ + @Operation(summary = "测试企业微信配置的连接") + @Parameters({ + @Parameter(name = "type", description = "0-发送消息,1-同步组织", required = true), + @Parameter(name = "qyWebChatModel", description = "企业微信模型", required = true) + }) + @SaCheckPermission("system.sysConfig") + @PostMapping("{type}/testQyWebChatConnect") + public ActionResult testQyWebChatConnect(@PathVariable("type") String type, @RequestBody @Valid QyWebChatModel qyWebChatModel) { + JSONObject retMsg = new JSONObject(); + // 测试发送消息、组织同步的连接 + String corpId = qyWebChatModel.getQyhCorpId(); + String agentSecret = qyWebChatModel.getQyhAgentSecret(); + String corpSecret = qyWebChatModel.getQyhCorpSecret(); + // 测试发送消息的连接 + if ("0".equals(type)) { + retMsg = QyWebChatUtil.getAccessToken(corpId, agentSecret); + if (HttpUtil.isWxError(retMsg)) { + return ActionResult.fail(MsgCode.SYS031.get(retMsg.getString("errmsg"))); + } + return ActionResult.success(MsgCode.SYS032.get()); + } else if ("1".equals(type)) { + retMsg = QyWebChatUtil.getAccessToken(corpId, corpSecret); + if (HttpUtil.isWxError(retMsg)) { + return ActionResult.fail(MsgCode.SYS033.get(retMsg.getString("errmsg"))); + } + return ActionResult.success(MsgCode.SYS034.get()); + } + return ActionResult.fail(MsgCode.SYS035.get()); + } + + /** + * 测试钉钉配置的连接功能 + * + * @param dingTalkModel 钉钉模板 + * @return ignore + */ + @Operation(summary = "测试钉钉配置的连接") + @Parameters({ + @Parameter(name = "dingTalkModel", description = "钉钉模型", required = true) + }) + @SaCheckPermission("system.sysConfig") + @PostMapping("/testDingTalkConnect") + public ActionResult testDingTalkConnect(@RequestBody @Valid DingTalkModel dingTalkModel) { + JSONObject retMsg = new JSONObject(); + // 测试钉钉配置的连接 + String appKey = dingTalkModel.getDingSynAppKey(); + String appSecret = dingTalkModel.getDingSynAppSecret(); + /// +// String agentId = dingTalkModel.getDingAgentId(); + // 测试钉钉的连接 + retMsg = DingTalkUtil.getAccessToken(appKey, appSecret); + if (!retMsg.getBoolean("code")) { + return ActionResult.fail(MsgCode.SYS036.get(retMsg.getString("error"))); + } + + return ActionResult.success(MsgCode.SYS037.get()); + } + + /** + * 获取管理员集合 + * + * @return + */ + @Operation(summary = "获取管理员集合") + @SaCheckPermission("system.sysConfig") + @GetMapping("/getAdminList") + public ActionResult> getAdminList(){ + List admins = JsonUtil.getJsonToList(userService.getAdminList(), UserAdminVO.class); + return ActionResult.success(admins); + } + + /** + * 获取管理员集合 + * + * @param userUpAdminForm 超级管理员设置表单参数 + * @return + */ + @Operation(summary = "获取管理员集合") + @Parameters({ + @Parameter(name = "userUpAdminForm", description = "超级管理员设置表单参数", required = true) + }) + @SaCheckPermission("system.sysConfig") + @PutMapping("/setAdminList") + public ActionResult setAdminList(@RequestBody UserUpAdminForm userUpAdminForm){ + userService.setAdminListByIds(userUpAdminForm.getAdminIds()); + return ActionResult.success(MsgCode.SU004.get()); + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/SystemController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/SystemController.java new file mode 100644 index 0000000..8e4b446 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/SystemController.java @@ -0,0 +1,260 @@ +package com.yunzhupaas.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.util.ObjectUtil; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.entity.ModuleEntity; +import com.yunzhupaas.base.entity.SystemEntity; +import com.yunzhupaas.base.model.base.SystemCrModel; +import com.yunzhupaas.base.model.base.SystemListVO; +import com.yunzhupaas.base.model.base.SystemPageVO; +import com.yunzhupaas.base.model.base.SystemUpModel; +import com.yunzhupaas.base.model.base.SystemVO; +import com.yunzhupaas.base.model.portalManage.PortalManagePage; +import com.yunzhupaas.base.model.portalManage.PortalManagePageDO; +import com.yunzhupaas.base.service.CommonWordsService; +import com.yunzhupaas.base.service.ModuleService; +import com.yunzhupaas.base.service.PortalManageService; +import com.yunzhupaas.base.service.SystemService; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.message.util.OnlineUserModel; +import com.yunzhupaas.message.util.OnlineUserProvider; +import com.yunzhupaas.permission.service.AuthorizeService; +import com.yunzhupaas.permission.service.OrganizeAdministratorService; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 系统控制器 + * + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/6/21 15:33 + */ +@Tag(name = "系统", description = "system") +@RestController +@RequestMapping("/api/system/System") +public class SystemController extends SuperController { + + @Autowired + private SystemService systemService; + @Autowired + private UserService userApi; + + @Autowired + private CommonWordsService commonWordsService; + @Autowired + private OrganizeAdministratorService organizeAdminTratorApi; + @Autowired + private AuthorizeService authorizeApi; + + @Autowired + PortalManageService portalManageService; + @Autowired + private ModuleService moduleService; + + /** + * 获取系统列表 + * + * @param page 关键字 + * @return ignore + */ + @Operation(summary = "获取系统列表") + @SaCheckPermission("system.menu") + @GetMapping + public ActionResult> list(SystemPageVO page) { + Boolean enabledMark = false; + if (ObjectUtil.equal(page.getEnabledMark(), "0")) { + enabledMark = null; + } + if (ObjectUtil.equal(page.getEnabledMark(), "1")) { + enabledMark = true; + } + List list = systemService.getList(page.getKeyword(), enabledMark, true, page.getSelector(), true, new ArrayList<>()); + List jsonToList = JsonUtil.getJsonToList(list, SystemListVO.class); + return ActionResult.success(new ListVO<>(jsonToList)); + } + + /** + * 获取系统详情 + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "获取系统详情") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("system.menu") + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) { + SystemEntity entity = systemService.getInfo(id); + if (entity == null) { + return ActionResult.fail(MsgCode.FA001.get()); + } + SystemVO jsonToBean = JsonUtil.getJsonToBean(entity, SystemVO.class); + return ActionResult.success(jsonToBean); + } + + /** + * 新建系统 + * + * @param systemCrModel 新建模型 + * @return ignore + */ + @Operation(summary = "新建系统") + @Parameters({ + @Parameter(name = "systemCrModel", description = "新建模型", required = true) + }) + @SaCheckPermission("system.menu") + @PostMapping + public ActionResult create(@RequestBody SystemCrModel systemCrModel) { + SystemEntity entity = JsonUtil.getJsonToBean(systemCrModel, SystemEntity.class); + if (systemService.isExistFullName(entity.getId(), entity.getFullName())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (systemService.isExistEnCode(entity.getId(), entity.getEnCode())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + systemService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 修改系统 + * + * @param id 主键 + * @param systemUpModel 修改模型 + * @return ignore + */ + @Operation(summary = "修改系统") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "systemCrModel", description = "修改模型", required = true) + }) + @SaCheckPermission("system.menu") + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody SystemUpModel systemUpModel) { + SystemEntity systemEntity = systemService.getInfo(id); + if (systemEntity == null) { + return ActionResult.fail(MsgCode.FA002.get()); + } + // 主系统不允许禁用 + if (systemEntity.getIsMain() != null && systemEntity.getIsMain() == 1 && systemUpModel.getEnabledMark() == 0) { + if (systemUpModel.getEnabledMark() == 0) { + return ActionResult.fail(MsgCode.SYS101.get()); + } + if (!systemEntity.getEnCode().equals(systemUpModel.getEnCode())) { + return ActionResult.fail(MsgCode.SYS104.get()); + } + } + SystemEntity entity = JsonUtil.getJsonToBean(systemUpModel, SystemEntity.class); + entity.setIsMain(systemEntity.getIsMain()); + if (systemService.isExistFullName(id, entity.getFullName())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (systemService.isExistEnCode(id, entity.getEnCode())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + systemService.update(id, entity); + // 如果禁用了系统,则需要将系统 + if (systemEntity.getEnabledMark() == 1 && entity.getEnabledMark() == 0) { + sentMessage("应用已被禁用,正为您切换应用", systemEntity); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除系统 + * + * @param id 主键 + * @return ignore + */ + @Operation(summary = "删除系统") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @SaCheckPermission("system.menu") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + SystemEntity entity = systemService.getInfo(id); + if (entity == null) { + return ActionResult.fail(MsgCode.FA003.get()); + } + // 查询门户 + PortalManagePage portalManagePage = new PortalManagePage(); + portalManagePage.setSystemId(id); + List portalList = portalManageService.getSelectList(portalManagePage); + // 查询平台下菜单 + List webData = moduleService.getList(id, "web", null, null, null, null, false); + List appData = moduleService.getList(id, "app", null, null, null, null, false); + if((CollectionUtils.isNotEmpty(webData) || CollectionUtils.isNotEmpty(appData) ) && CollectionUtils.isNotEmpty(portalList)){ + return ActionResult.fail(MsgCode.SYS039.get()); + } + if(CollectionUtils.isNotEmpty(webData) || CollectionUtils.isNotEmpty(appData)){ + return ActionResult.fail(MsgCode.SYS040.get()); + } + if(CollectionUtils.isNotEmpty(portalList)){ + return ActionResult.fail(MsgCode.SYS041.get()); + } + + if (entity.getIsMain() != null && entity.getIsMain() == 1) { + return ActionResult.fail(MsgCode.SYS102.get()); + } + // 系统绑定审批常用语时不允许被删除 + if(commonWordsService.existSystem(id)){ + return ActionResult.fail(MsgCode.SYS103.get()); + }else { + systemService.delete(id); + sentMessage("应用已被删除,正为您切换应用", entity); + } + return ActionResult.success(MsgCode.SU003.get()); + } + + private void sentMessage(String message, SystemEntity entity) { + // 如果禁用了系统,则需要将系统 + List onlineUserList = OnlineUserProvider.getOnlineUserList(); + for (OnlineUserModel item : onlineUserList) { + String systemId = item.getSystemId(); + if (entity.getId().equals(systemId)) { + if (item.getWebSocket().isOpen()) { + Map maps = new HashMap<>(1); + maps.put("method", "logout"); + maps.put("msg", "应用已被禁用或删除"); + if (StringUtil.isNotEmpty(UserProvider.getUser().getTenantId())) { + if (UserProvider.getUser().getTenantId().equals(item.getTenantId())) { + item.getWebSocket().getAsyncRemote().sendText(JsonUtil.getObjectToString(maps)); + } + } else { + item.getWebSocket().getAsyncRemote().sendText(JsonUtil.getObjectToString(maps)); + } + } + } + } + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/UserOnlineController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/UserOnlineController.java new file mode 100644 index 0000000..4a01624 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/UserOnlineController.java @@ -0,0 +1,92 @@ +package com.yunzhupaas.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.Page; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.model.online.BatchOnlineModel; +import com.yunzhupaas.base.service.UserOnlineService; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.message.model.UserOnlineModel; +import com.yunzhupaas.message.model.UserOnlineVO; +import com.yunzhupaas.util.JsonUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * 在线用户 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +@Tag(name = "在线用户", description = "Online") +@RestController +@RequestMapping("/api/system/OnlineUser") +public class UserOnlineController { + + @Autowired + private UserOnlineService userOnlineService; + + /** + * 列表 + * + * @param page 分页参数 + * @return ignore + */ + @Operation(summary = "获取在线用户列表") + @SaCheckPermission("permission.userOnline") + @GetMapping + public ActionResult> list(Pagination page) { + List data = userOnlineService.getList(page); + List voList= data.stream().map(online->{ + UserOnlineVO vo = JsonUtil.getJsonToBean(online, UserOnlineVO.class); + vo.setUserId(online.getToken()); + //vo.setUserName(vo.getUserName() + "/" + online.getDevice()); + return vo; + }).collect(Collectors.toList()); + PaginationVO paginationVO = JsonUtil.getJsonToBean(page, PaginationVO.class); + return ActionResult.page(voList, paginationVO); + } + + /** + * 注销 + * + * @param token 主键值 + * @return + */ + @Operation(summary = "强制下线") + @Parameter(name = "token", description = "token", required = true) + @SaCheckPermission("permission.userOnline") + @DeleteMapping("/{token}") + public ActionResult delete(@PathVariable("token") String token) { + userOnlineService.delete(token); + return ActionResult.success(MsgCode.SU005.get()); + } + + /** + * 批量下线用户 + * + * @param model 主键值 + * @return ignore + */ + @Operation(summary = "批量下线用户") + @Parameter(name = "model", description = "在线用户id集合", required = true) + @SaCheckPermission("permission.userOnline") + @DeleteMapping + public ActionResult clear(@RequestBody BatchOnlineModel model) { + userOnlineService.delete(model.getIds()); + return ActionResult.success(MsgCode.SU005.get()); + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/VisualKitController.java b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/VisualKitController.java new file mode 100644 index 0000000..d2009a6 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-controller/src/main/java/com/yunzhupaas/base/controller/VisualKitController.java @@ -0,0 +1,210 @@ +package com.yunzhupaas.base.controller; + + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaMode; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.entity.VisualKitEntity; +import com.yunzhupaas.base.model.print.PrintDevFormDTO; +import com.yunzhupaas.base.model.visualkit.*; +import com.yunzhupaas.base.model.vo.PrintDevVO; +import com.yunzhupaas.base.service.DictionaryDataService; +import com.yunzhupaas.base.service.VisualKitService; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.emnus.ModuleTypeEnum; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.FileExport; +import com.yunzhupaas.util.FileUtil; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.enums.DictionaryDataEnum; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 表单套件 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/8/22 11:17:25 + */ +@Tag(name = "表单套件", description = "VisualKit") +@RestController +@RequestMapping("/api/system/Kit") +public class VisualKitController { + + @Autowired + private VisualKitService visualKitService; + @Autowired + private UserService userService; + @Autowired + private DictionaryDataService dictionaryDataService; + @Autowired + private FileExport fileExport; + @Autowired + private ConfigValueUtil configValueUtil; + + + @Operation(summary = "列表") + @GetMapping + public ActionResult> list(KitPagination page) { + List list = visualKitService.getList(page); + List userId = list.stream().map(t -> t.getCreatorUserId()).collect(Collectors.toList()); + List lastUserId = list.stream().map(t -> t.getLastModifyUserId()).collect(Collectors.toList()); + lastUserId.removeAll(Collections.singleton(null)); + List userEntities = userService.getUserName(userId); + List lastUserIdEntities = userService.getUserName(lastUserId); + List typeList = dictionaryDataService.getListByTypeDataCode(DictionaryDataEnum.VISUALDEV.getDictionaryTypeId()); + List listVOS = new ArrayList<>(); + for (VisualKitEntity entity : list) { + VisualKitVo vo = JsonUtil.getJsonToBean(entity, VisualKitVo.class); + DictionaryDataEntity dataEntity = typeList.stream().filter(t -> t.getId().equals(entity.getCategory())).findFirst().orElse(null); + if (dataEntity != null) { + vo.setCategory(dataEntity.getFullName()); + } else { + vo.setCategory(""); + } + //创建者 + UserEntity creatorUser = userEntities.stream().filter(t -> t.getId().equals(entity.getCreatorUserId())).findFirst().orElse(null); + vo.setCreatorUser(creatorUser != null ? creatorUser.getRealName() + "/" + creatorUser.getAccount() : entity.getCreatorUserId()); + //修改人 + UserEntity lastModifyUser = lastUserIdEntities.stream().filter(t -> t.getId().equals(entity.getLastModifyUserId())).findFirst().orElse(null); + vo.setLastModifyUser(lastModifyUser != null ? lastModifyUser.getRealName() + "/" + lastModifyUser.getAccount() : entity.getLastModifyUserId()); + listVOS.add(vo); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(page, PaginationVO.class); + return ActionResult.page(listVOS, paginationVO); + } + + + @Operation(summary = "新增") + @Parameters({ + @Parameter(name = "VisualKitForm", description = "套件表单信息") + }) + @SaCheckPermission(value = {"system.kit", "onlineDev.webDesign"}, mode = SaMode.OR) + @PostMapping + public ActionResult create(@RequestBody @Valid VisualKitForm form) { + visualKitService.create(form); + return ActionResult.success(MsgCode.SU001.get(), form.getId()); + } + + @Operation(summary = "详情") + @Parameters({ + @Parameter(name = "id", description = "表单条件id") + }) + @SaCheckPermission("system.kit") + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) { + VisualKitEntity byId = visualKitService.getById(id); + VisualKitInfoVo vo = JsonUtil.getJsonToBean(byId, VisualKitInfoVo.class); + return ActionResult.success(vo); + } + + @Operation(summary = "更新") + @PutMapping("/{id}") + @SaCheckPermission("system.kit") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "form", description = "套件表单信息", required = true), + }) + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid VisualKitForm form) throws WorkFlowException { + boolean b = visualKitService.update(id, form); + if (b) { + return ActionResult.success(MsgCode.SU004.get()); + } + return ActionResult.success(MsgCode.FA102.get()); + } + + @Operation(summary = "删除") + @Parameters({ + @Parameter(name = "id", description = "表单条件id") + }) + @SaCheckPermission("system.kit") + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable String id) { + if (visualKitService.getById(id) != null) { + visualKitService.removeById(id); + return ActionResult.success(MsgCode.SU003.get()); + } else { + return ActionResult.fail(MsgCode.FA003.get()); + } + } + + @Operation(summary = "下拉列表") + @GetMapping("/Selector") + public ActionResult> selectorList(){ + List kitTreeVos = visualKitService.selectorList(); + return ActionResult.success(kitTreeVos); + } + + //***************************动作********************* + + @Operation(summary = "复制") + @Parameters({ + @Parameter(name = "id", description = "打印模板id") + }) + @SaCheckPermission("system.kit") + @PostMapping("/{id}/Actions/Copy") + public ActionResult copy(@PathVariable String id) { + visualKitService.actionsCopy(id); + return ActionResult.success(MsgCode.SU007.get()); + } + + @Operation(summary = "导出") + @Parameters({ + @Parameter(name = "id", description = "打印模板id") + }) + @SaCheckPermission("system.kit") + @GetMapping("/{id}/Actions/Export") + public ActionResult export(@PathVariable String id) { + VisualKitEntity entity = visualKitService.getById(id); + //导出文件 + DownloadVO downloadVO = fileExport.exportFile(entity, configValueUtil.getTemporaryFilePath(), entity.getFullName(), ModuleTypeEnum.SYSTEM_KIT.getTableName()); + return ActionResult.success(downloadVO); + } + + @Operation(summary = "导入") + @Parameters({ + @Parameter(name = "type", description = "导入类型:0跳过,1追加") + }) + @SaCheckPermission("system.kit") + @PostMapping(value = "/Actions/Import", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ActionResult importData(@RequestPart("file") MultipartFile multipartFile, + @RequestParam("type") Integer type) throws DataException { + //判断是否为.json结尾 + if (FileUtil.existsSuffix(multipartFile, ModuleTypeEnum.SYSTEM_KIT.getTableName())) { + return ActionResult.fail(MsgCode.IMP002.get()); + } + //读取文件内容 + String fileContent = FileUtil.getFileContent(multipartFile); + VisualKitEntity entity = JsonUtil.getJsonToBean(fileContent, VisualKitEntity.class); + String str = visualKitService.importData(entity, type); + if (StringUtil.isNotEmpty(str)) { + return ActionResult.fail(str); + } + return ActionResult.success(MsgCode.IMP001.get()); + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/pom.xml b/yunzhupaas-system/yunzhupaas-system-entity/pom.xml new file mode 100644 index 0000000..25a330a --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/pom.xml @@ -0,0 +1,22 @@ + + + + yunzhupaas-system + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-system-entity + + + + com.yunzhupaas + yunzhupaas-common-all + ${project.version} + + + + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/AdvancedQueryEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/AdvancedQueryEntity.java new file mode 100644 index 0000000..f89cc68 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/AdvancedQueryEntity.java @@ -0,0 +1,46 @@ +package com.yunzhupaas.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.util.Date; + +/** + * 高级查询 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2022/5/30 + */ +@Data +@TableName("base_advanced_query_scheme") +public class AdvancedQueryEntity extends SuperExtendEntity { + + /** + * 方案名称 + */ + @TableField("f_full_name") + private String fullName; + + /** + * 方案名称 + */ + @TableField("f_match_logic") + private String matchLogic; + + /** + * 条件规则Json + */ + @TableField("f_condition_json") + private String conditionJson; + + /** + * 菜单主键 + */ + @TableField("f_module_id") + private String moduleId; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/AiChatEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/AiChatEntity.java new file mode 100644 index 0000000..96af624 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/AiChatEntity.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version v5.2.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2025/2/20 17:33:31 + */ +@Data +@TableName("base_ai_chat") +public class AiChatEntity extends SuperEntity { + /** + * 会话标题 + */ + @TableField("F_FULL_NAME") + private String fullName; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/AiHistoryEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/AiHistoryEntity.java new file mode 100644 index 0000000..3da29e9 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/AiHistoryEntity.java @@ -0,0 +1,40 @@ +package com.yunzhupaas.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version v5.2.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2025/2/20 17:33:31 + */ +@Data +@TableName("base_ai_history") +public class AiHistoryEntity extends SuperEntity { + /** + * 会话id + */ + @TableField("F_CHAT_ID") + private String chatId; + + /** + * 问题 + */ + @TableField("F_QUESTION_TEXT") + private String questionText; + + /** + * 会话内容 + */ + @TableField("F_CONTENT") + private String content; + + /** + * 类型:0-ai,1-用户 + */ + @TableField("F_TYPE") + private Integer type; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/BaseLangEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/BaseLangEntity.java new file mode 100644 index 0000000..dafca64 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/BaseLangEntity.java @@ -0,0 +1,51 @@ +package com.yunzhupaas.base.entity; + +import com.baomidou.mybatisplus.annotation.FieldStrategy; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author 云筑产品开发平台组 + * @version v5.0.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/20 10:02:18 + */ +@Data +@TableName("base_language") +public class BaseLangEntity extends SuperExtendEntity.SuperExtendDEEntity implements Serializable { + + /** + * 翻译标记id + */ + @TableField("f_group_id") + private String groupId; + + /** + * 翻译标记 + */ + @TableField("f_en_code") + private String enCode; + + /** + * 语种翻译内容 + */ + @TableField("f_full_name") + private String fullName; + + + /** + * 语种 + */ + @TableField("f_language") + private String language; + + /** + * 类别:0-客户端,1-java服务端,2-net服务端, + */ + @TableField("f_type") + private Integer type; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/BillRuleEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/BillRuleEntity.java new file mode 100644 index 0000000..0a5f7a8 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/BillRuleEntity.java @@ -0,0 +1,108 @@ +package com.yunzhupaas.base.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 单据规则 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2023/09/27 + */ +@Data +@TableName("base_bill_rule") +public class BillRuleEntity extends SuperExtendEntity.SuperExtendDEEntity implements Serializable { + + /** + * 单据名称 + */ + @TableField("f_full_name") + private String fullName; + + /** + * 单据编码 + */ + @TableField("f_en_code") + private String enCode; + + /** + * 单据前缀 + */ + @TableField("f_prefix") + private String prefix; + + /** + * 日期格式 + */ + @TableField("f_date_format") + private String dateFormat; + + /** + * 流水位数 + */ + @TableField("f_digit") + private Integer digit; + + /** + * 流水起始 + */ + @TableField("f_start_number") + private String startNumber; + + /** + * 流水范例 + */ + @TableField("f_example") + private String example; + + /** + * 当前流水号 + */ + @TableField(value = "f_this_number", updateStrategy = FieldStrategy.IGNORED) + private Integer thisNumber; + + /** + * 输出流水号 + */ + @TableField(value = "f_output_number",updateStrategy = FieldStrategy.IGNORED) + private String outputNumber; + + /** + * 分类 + */ + @TableField("f_category") + private String category; + + /** + * 方式 1-时间格式,2-随机数编号,3-UUID + */ + @TableField("f_type") + private Integer type; + + /** + * 随机数位数 + */ + @TableField("f_random_digit") + private Integer randomDigit; + + /** + * 随机数类型 + */ + @TableField("f_random_type") + private Integer randomType; + + /** + * 单据后缀 + */ + @TableField("f_suffix") + private String suffix; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ComFieldsEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ComFieldsEntity.java new file mode 100644 index 0000000..f1ff0d5 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ComFieldsEntity.java @@ -0,0 +1,38 @@ +package com.yunzhupaas.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; + +/** + * + * 常用字段表 + * 版本: V3.0.0 + * 版权: 深圳市乐程软件有限公司 + * 作者: 管理员/admin + * 日期: 2020-07-23 09:54 + */ +@Data +@TableName("base_common_fields") +public class ComFieldsEntity extends SuperExtendEntity.SuperExtendDEEntity implements Serializable { + + @TableField("f_field_name") + private String fieldName; + + @TableField("f_field") + private String field; + + @TableField("f_data_type") + private String datatype; + + @TableField("f_data_length") + private String datalength; + + @TableField("f_allow_null") + private Integer allowNull; + +} + + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/CommonWordsEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/CommonWordsEntity.java new file mode 100644 index 0000000..448c3d8 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/CommonWordsEntity.java @@ -0,0 +1,47 @@ +package com.yunzhupaas.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 审批常用语 Entity + * + * @author 云筑产品开发平台组 + * @version v3.4.6 + * @copyrignt 深圳市乐程软件有限公司 + * @date 2023-01-06 + */ +@TableName("base_common_words") +@Schema(description = "CommonWords对象", name = "审批常用语") +@Data +public class CommonWordsEntity extends SuperExtendEntity.SuperExtendEnabledEntity { + + /** + * 应用id + */ + @TableField("f_system_ids") + private String systemIds; + + /** + * 常用语 + */ + @TableField("f_common_words_text") + private String commonWordsText; + + /** + * 常用语类型(0:系统,1:个人) + */ + @TableField("f_common_words_type") + private Integer commonWordsType; + + /** + * 使用次数 + */ + @TableField("f_uses_num") + private Long usesNum; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/DataInterfaceEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/DataInterfaceEntity.java new file mode 100644 index 0000000..a4c4b8f --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/DataInterfaceEntity.java @@ -0,0 +1,101 @@ +package com.yunzhupaas.base.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; + +import java.io.Serializable; + +/** + * 数据接口 + */ +@Data +@TableName("base_data_interface") +public class DataInterfaceEntity extends SuperExtendEntity.SuperExtendDEEntity implements Serializable { + + /** + * 分类 + */ + @TableField("f_category") + private String category; + + /** + * 接口名称 + */ + @TableField("f_full_name") + private String fullName; + + /** + * 接口编码 + */ + @TableField("f_en_code") + private String enCode; + + /** + * 类型(1-sql,2-静态数据,3-api) + */ + @TableField("f_type") + private Integer type; + + /** + * 动作(3-查询) + */ + @TableField("f_action") + private Integer action; + + /** + * 分页(0-禁用,1-启用) + */ + @TableField("f_has_page") + private Integer hasPage; + + /** + * 后置接口(0-否 1-是) + */ + @TableField("f_is_postposition") + private Integer isPostPosition; + + /** + * 数据配置json + */ + @TableField("f_data_config_json") + private String dataConfigJson; + + /** + * 数据统计json + */ + @TableField("f_data_count_json") + private String dataCountJson; + + /** + * 数据回显json + */ + @TableField("f_data_echo_json") + private String dataEchoJson; + + /** + * 异常验证json + */ + @TableField("f_data_exception_json") + private String dataExceptionJson; + + /** + * 数据处理json + */ + @TableField("f_data_js_json") + private String dataJsJson; + + /** + * 参数json + */ + @TableField("f_parameter_json") + private String parameterJson; + + /** + * 字段JSON + */ + @TableField("f_field_json") + private String fieldJson; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/DataInterfaceLogEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/DataInterfaceLogEntity.java new file mode 100644 index 0000000..41216f5 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/DataInterfaceLogEntity.java @@ -0,0 +1,72 @@ +package com.yunzhupaas.base.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 数据接口调用日志 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-06-03 + */ +@Data +@TableName("base_data_interface_log") +public class DataInterfaceLogEntity extends SuperExtendEntity implements Serializable { + + /** + * 调用接口id + */ + @TableField("f_invok_id") + private String invokId; + + /** + * 调用时间 + */ + @TableField(value = "f_invok_time", fill = FieldFill.INSERT) + private Date invokTime; + + /** + * 调用者id + */ + @TableField("f_user_id") + private String userId; + + /** + * 请求ip + */ + @TableField("f_invok_ip") + private String invokIp; + + /** + * 请求设备 + */ + @TableField("f_invok_device") + private String invokDevice; + + /** + * 请求类型 + */ + @TableField("f_invok_type") + private String invokType; + + /** + * 请求耗时 + */ + @TableField("f_invok_waste_time") + private Integer invokWasteTime; + + /** + * 接口授权AppId + */ + @TableField("f_oauth_app_id") + private String oauthAppId; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/DataInterfaceUserEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/DataInterfaceUserEntity.java new file mode 100644 index 0000000..bb774d0 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/DataInterfaceUserEntity.java @@ -0,0 +1,40 @@ +package com.yunzhupaas.base.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.util.Date; + +/** + * @author 云筑产品开发平台组 + * @version V3.4.7 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/9/20 9:22 + */ +@Data +@TableName("base_data_interface_user") +public class DataInterfaceUserEntity extends SuperBaseEntity.SuperCBaseEntity { + /** + * 用户主键 + */ + @TableField("f_user_id") + private String userId; + /** + * 用户密钥 + */ + @TableField("f_user_key") + private String userKey; + /** + * 接口认证主键 + */ + @TableField("f_oauth_id") + private String oauthId; + /** + * 排序 + */ + @TableField("f_sort_code") + private Long sortCode; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/DataInterfaceVariateEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/DataInterfaceVariateEntity.java new file mode 100644 index 0000000..53a9711 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/DataInterfaceVariateEntity.java @@ -0,0 +1,40 @@ +package com.yunzhupaas.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; + +/** + * 数据接口变量 + */ +@Data +@TableName("base_data_interface_variate") +public class DataInterfaceVariateEntity extends SuperExtendEntity implements Serializable { + + /** + * 数据接口id + */ + @TableField("f_interface_id") + private String interfaceId; + + /** + * 变量名 + */ + @TableField("f_full_name") + private String fullName; + + /** + * 表达式 + */ + @TableField("f_expression") + private String expression; + + /** + * 变量值 + */ + @TableField("f_value") + private String value; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/DataSetEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/DataSetEntity.java new file mode 100644 index 0000000..a1d92ff --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/DataSetEntity.java @@ -0,0 +1,86 @@ +package com.yunzhupaas.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * 数据集管理 + * + * @author 云筑产品开发平台组 + * @version v5.0.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/5/6 18:21:15 + */ +@Data +@TableName("base_data_set") +public class DataSetEntity extends SuperExtendEntity { + + /** + * 关联的数据类型 + */ + @TableField("F_OBJECT_TYPE") + private String objectType; + + /** + * 关联的数据id + */ + @TableField("F_OBJECT_ID") + private String objectId; + + /** + * 数据集名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + + /** + * 数据库连接 + */ + @TableField("F_DB_LINK_ID") + private String dbLinkId; + + + /** + * 数据sql语句 + */ + @TableField("F_DATA_CONFIG_JSON") + private String dataConfigJson; + + /** + * 参数json + */ + @TableField("F_PARAMETER_JSON") + private String parameterJson; + + /** + * 字段json + */ + @TableField("F_FIELD_JSON") + private String fieldJson; + + /** + * 类型:1-sql语句,2-配置式 + */ + @TableField("f_type") + private Integer type; + + /** + * 配置json + */ + @TableField("f_visual_config_json") + private String visualConfigJson; + + /** + * 筛选设置json + */ + @TableField("f_filter_config_json") + private String filterConfigJson; + + /** + * 数据接口id + */ + @TableField("f_interface_id") + private String interfaceId; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/DbBackupEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/DbBackupEntity.java new file mode 100644 index 0000000..76ca23b --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/DbBackupEntity.java @@ -0,0 +1,57 @@ +package com.yunzhupaas.base.entity; + +import com.yunzhupaas.base.entity.SuperExtendEntity; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 数据备份 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2023/09/27 + */ +@Data +//@TableName("base_dbbackup") +public class DbBackupEntity extends SuperExtendEntity.SuperExtendDEEntity implements Serializable { + + /** + * 备份库名 + */ + @TableField("F_BACKUPDBNAME") + private String backupDbName; + + /** + * 备份时间 + */ + @TableField("F_BACKUPTIME") + private Date backupTime; + + /** + * 文件名称 + */ + @TableField("F_FILENAME") + private String fileName; + + /** + * 文件大小 + */ + @TableField("F_FILESIZE") + private String fileSize; + + /** + * 文件路径 + */ + @TableField("F_FILEPATH") + private String filePath; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/DictionaryDataEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/DictionaryDataEntity.java new file mode 100644 index 0000000..579e4bd --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/DictionaryDataEntity.java @@ -0,0 +1,63 @@ +package com.yunzhupaas.base.entity; + +import com.yunzhupaas.base.entity.SuperExtendEntity; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 字典数据 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2023/09/27 + */ +@Data +@TableName("base_dictionary_data") +public class DictionaryDataEntity extends SuperExtendEntity.SuperExtendDEEntity implements Serializable { + + /** + * 上级 + */ + @TableField("f_parent_id") + private String parentId; + + /** + * 名称 + */ + @TableField("f_full_name") + private String fullName; + + /** + * 编码 + */ + @TableField("f_en_code") + private String enCode; + + /** + * 拼音 + */ + @TableField("f_simple_spelling") + private String simpleSpelling; + + /** + * 默认 + */ + @TableField("f_is_default") + private Integer isDefault; + + /** + * 类别主键 + */ + @TableField("f_dictionary_type_id") + private String dictionaryTypeId; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/DictionaryTypeEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/DictionaryTypeEntity.java new file mode 100644 index 0000000..b8dab00 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/DictionaryTypeEntity.java @@ -0,0 +1,58 @@ +package com.yunzhupaas.base.entity; + +import com.yunzhupaas.base.entity.SuperExtendEntity; +import com.alibaba.fastjson.annotation.JSONField; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 字典分类 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2023/09/27 + */ +@Data +@TableName("base_dictionary_type") +public class DictionaryTypeEntity extends SuperExtendEntity.SuperExtendDEEntity implements Serializable { + + /** + * 上级 + */ + @TableField("f_parent_id") + private String parentId; + + /** + * 名称 + */ + @TableField("f_full_name") + private String fullName; + + /** + * 编码 + */ + @TableField("f_en_code") + private String enCode; + + /** + * 树形 + */ + @TableField("f_is_tree") + private Integer isTree; + + /** + * 类型 + */ + @TableField("f_type") + private Integer category; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/EmailConfigEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/EmailConfigEntity.java new file mode 100644 index 0000000..a49f649 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/EmailConfigEntity.java @@ -0,0 +1,76 @@ +package com.yunzhupaas.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; + +/** + * 邮件配置 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +@Data +@TableName("ext_email_config") +public class EmailConfigEntity extends SuperExtendEntity.SuperExtendDEEntity implements Serializable { + + /** + * POP3服务 + */ + @TableField("F_POP3_HOST") + private String pop3Host; + + /** + * POP3端口 + */ + @TableField("F_POP3_PORT") + private Integer pop3Port; + + /** + * SMTP服务 + */ + @TableField("F_SMTP_HOST") + private String smtpHost; + + /** + * SMTP端口 + */ + @TableField("F_SMTP_PORT") + private Integer smtpPort; + + /** + * 账户 + */ + @TableField("F_ACCOUNT") + private String account; + + /** + * 密码 + */ + @TableField("F_PASSWORD") + private String password; + + /** + * SSL登录 + */ + @TableField("F_SSL") + private Integer emailSsl=0; + + /** + * 发件人名称 + */ + @TableField("F_SENDER_NAME") + private String senderName; + + /** + * 我的文件夹 + */ + @TableField("F_FOLDER_JSON") + private String folderJson; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/EmailReceiveEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/EmailReceiveEntity.java new file mode 100644 index 0000000..84e9d84 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/EmailReceiveEntity.java @@ -0,0 +1,92 @@ +package com.yunzhupaas.base.entity; + +import com.yunzhupaas.base.entity.SuperExtendEntity; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * 邮件接收 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +@Data +@TableName("ext_email_receive") +public class EmailReceiveEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 类型 + */ + @TableField("F_TYPE") + private Integer type; + + /** + * 邮箱账户 + */ + @TableField(value = "F_MACCOUNT",fill= FieldFill.INSERT) + private String mAccount; + + /** + * F_MID + */ + @TableField("F_MID") + private String mID; + + /** + * 发件人 + */ + @TableField("F_SENDER") + private String sender; + + /** + * 发件人名称 + */ + @TableField("F_SENDER_NAME") + private String senderName; + + /** + * 主题 + */ + @TableField("F_SUBJECT") + private String subject; + + /** + * 正文 + */ + @TableField("F_BODY_TEXT") + private String bodyText; + + /** + * 附件 + */ + @TableField("F_ATTACHMENT") + private String attachment; + + /** + * 阅读 + */ + @TableField("F_READ") + private Integer isRead; + + /** + * F_Date + */ + @TableField("F_DATE") + private Date fdate; + + /** + * 星标 + */ + @TableField("F_STARRED") + private Integer starred; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/InterfaceOauthEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/InterfaceOauthEntity.java new file mode 100644 index 0000000..450b801 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/InterfaceOauthEntity.java @@ -0,0 +1,75 @@ +package com.yunzhupaas.base.entity; + +import com.yunzhupaas.base.entity.SuperExtendEntity; +import com.baomidou.mybatisplus.annotation.FieldStrategy; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 接口认证对象 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/8 9:27 + */ +@Data +@TableName("base_data_interface_oauth") +public class InterfaceOauthEntity extends SuperExtendEntity.SuperExtendDEEntity implements Serializable { + + /** + * 应用id appId + */ + @TableField("f_app_id") + private String appId; + + /** + * 应用名称 + */ + @TableField("f_app_name") + private String appName; + + /** + * 应用秘钥 + */ + @TableField("f_app_secret") + private String appSecret; + + /** + * 验证签名 + */ + @TableField("f_verify_signature") + private Integer verifySignature; + + /** + * 使用期限 + */ + @TableField(value="f_useful_life",updateStrategy = FieldStrategy.IGNORED) + private Date usefulLife; + + /** + * 白名单 + */ + @TableField("f_white_list") + private String whiteList; + + /** + * 黑名单 + */ + @TableField("f_black_list") + private String blackList; + + /** + * 接口id + */ + @TableField("f_data_interface_ids") + private String dataInterfaceIds; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/MessageTemplateEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/MessageTemplateEntity.java new file mode 100644 index 0000000..105afd2 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/MessageTemplateEntity.java @@ -0,0 +1,98 @@ +package com.yunzhupaas.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; + +/** + * 消息模板表 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年12月8日17:40:37 + */ +@Data +@EqualsAndHashCode +@TableName("base_msg_template") +public class MessageTemplateEntity extends SuperExtendEntity.SuperExtendEnabledEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 分类(数据字典) + */ + @TableField(value = "F_CATEGORY") + private String category; + + /** + * 模板名称 + */ + @TableField(value = "F_FULLNAME") + private String fullName; + + /** + * 标题 + */ + @TableField(value = "F_TITLE") + private String title; + + /** + * 是否站内信 + */ + @TableField(value = "F_ISSTATIONLETTER") + private Integer isStationLetter; + + /** + * 是否邮箱 + */ + @TableField(value = "F_ISEMAIL") + private Integer isEmail; + + /** + * 是否企业微信 + */ + @TableField(value = "F_ISWECOM") + private Integer isWecom; + + /** + * 是否钉钉 + */ + @TableField(value = "F_ISDINGTALK") + private Integer isDingTalk; + + /** + * 是否短信 + */ + @TableField(value = "F_ISSMS") + private Integer isSms; + + /** + * 短信模板ID + */ + @TableField(value = "F_SMSID") + private String smsId; + + /** + * 模板参数JSON + */ + @TableField(value = "F_TEMPLATEJSON") + private String templateJson; + + /** + * 内容 + */ + @TableField(value = "F_CONTENT") + private String content; + + /** + * 编码 + */ + @TableField("F_ENCODE") + private String enCode; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ModuleButtonEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ModuleButtonEntity.java new file mode 100644 index 0000000..8760ff6 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ModuleButtonEntity.java @@ -0,0 +1,69 @@ +package com.yunzhupaas.base.entity; + +import com.yunzhupaas.base.entity.SuperExtendEntity; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 按钮权限 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2023/09/27 + */ +@Data +@TableName("base_module_button") +public class ModuleButtonEntity extends SuperExtendEntity.SuperExtendDEEntity implements Serializable { + + /** + * 按钮上级 + */ + @TableField("f_parent_id") + private String parentId; + + /** + * 按钮名称 + */ + @TableField("f_full_name") + private String fullName; + + /** + * 按钮编码 + */ + @TableField("f_en_code") + private String enCode; + + /** + * 按钮图标 + */ + @TableField("f_icon") + private String icon; + + /** + * 请求地址 + */ + @TableField("f_url_address") + private String urlAddress; + + /** + * 扩展属性 + */ + @TableField("f_property_json") + private String propertyJson; + + /** + * 功能主键 + */ + @TableField("f_module_id") + private String moduleId; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ModuleColumnEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ModuleColumnEntity.java new file mode 100644 index 0000000..f114ed8 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ModuleColumnEntity.java @@ -0,0 +1,81 @@ +package com.yunzhupaas.base.entity; + +import com.yunzhupaas.base.entity.SuperExtendEntity; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 列表权限 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2023/09/27 + */ +@Data +@TableName("base_module_column") +public class ModuleColumnEntity extends SuperExtendEntity.SuperExtendDEEntity implements Serializable { + + /** + * 列表上级 + */ + @TableField("f_parent_id") + private String parentId; + + /** + * 列表名称 + */ + @TableField("f_full_name") + private String fullName; + + /** + * 列表编码 + */ + @TableField("f_en_code") + private String enCode; + + /** + * 绑定表格Id + */ + @TableField("f_bind_table") + private String bindTable; + + /** + * 绑定表格描述 + */ + @TableField("f_bind_table_name") + private String bindTableName; + + /** + * 扩展属性 + */ + @TableField("f_property_json") + private String propertyJson; + + /** + * 功能主键 + */ + @TableField("f_module_id") + private String moduleId; + + /** + * 字段规则 主从 + */ + @TableField("f_field_rule") + private Integer fieldRule; + + /** + * 子表规则key + */ + @TableField("f_child_table_key") + private String childTableKey; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ModuleDataAuthorizeEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ModuleDataAuthorizeEntity.java new file mode 100644 index 0000000..327ef0e --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ModuleDataAuthorizeEntity.java @@ -0,0 +1,99 @@ +package com.yunzhupaas.base.entity; + +import com.yunzhupaas.base.entity.SuperExtendEntity; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 数据权限配置 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2023/09/27 + */ +@Data +@TableName("base_module_authorize") +public class ModuleDataAuthorizeEntity extends SuperExtendEntity.SuperExtendDEEntity implements Serializable { + + /** + * 字段名称 + */ + @TableField("f_full_name") + private String fullName; + + /** + * 时间类型 + */ + @TableField("f_format") + private String format; + + /** + * 字段编码 + */ + @TableField("f_en_code") + private String enCode; + + /** + * 字段类型 + */ + @TableField("f_type") + private String type; + + /** + * 条件符号 + */ + @TableField("f_condition_symbol") + private String conditionSymbol; + + /** + * 条件符号Json + */ + @TableField("f_property_json") + private String conditionSymbolJson; + + /** + * 条件内容 + */ + @TableField("f_condition_text") + private String conditionText; + + /** + * 扩展属性 + */ + @TableField("f_property_json") + private String propertyJson; + + /** + * 菜单主键 + */ + @TableField("f_module_id") + private String moduleId; + + /** + * 字段规则 主从 + */ + @TableField("f_field_rule") + private Integer fieldRule; + + /** + * 绑定表格Id + */ + @TableField("f_bind_table") + private String bindTable; + + /** + * 子表规则key + */ + @TableField("f_child_table_key") + private String childTableKey; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ModuleDataAuthorizeLinkEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ModuleDataAuthorizeLinkEntity.java new file mode 100644 index 0000000..42ccfaf --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ModuleDataAuthorizeLinkEntity.java @@ -0,0 +1,42 @@ +package com.yunzhupaas.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/6/7 + */ +@Data +@TableName("base_module_link") +public class ModuleDataAuthorizeLinkEntity extends SuperExtendEntity { + + /** + * 菜单主键 + */ + @TableField("f_module_id") + private String moduleId; + + /** + * 数据源连接 + */ + @TableField("f_link_id") + private String linkId; + + /** + * 连接表名 + */ + @TableField("f_link_tables") + private String linkTables; + + /** + * 权限类型(表单权限,数据权限,列表权限) + */ + @TableField("f_type") + private Integer dataType; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ModuleDataAuthorizeSchemeEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ModuleDataAuthorizeSchemeEntity.java new file mode 100644 index 0000000..257a7d7 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ModuleDataAuthorizeSchemeEntity.java @@ -0,0 +1,69 @@ +package com.yunzhupaas.base.entity; + +import com.yunzhupaas.base.entity.SuperExtendEntity; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 数据权限方案 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2023/09/27 + */ +@Data +@TableName("base_module_scheme") +public class ModuleDataAuthorizeSchemeEntity extends SuperExtendEntity.SuperExtendDEEntity implements Serializable { + + /** + * 方案编码 + */ + @TableField("f_en_code") + private String enCode; + + /** + * 方案名称 + */ + @TableField("f_full_name") + private String fullName; + + /** + * 条件规则Json + */ + @TableField("f_condition_json") + private String conditionJson; + + /** + * 条件规则描述 + */ + @TableField("f_condition_text") + private String conditionText; + + /** + * 功能主键 + */ + @TableField("f_module_id") + private String moduleId; + + /** + * 全部数据标识 + */ + @TableField("f_all_data") + private Integer allData; + + /** + * 分组匹配逻辑 + */ + @TableField("f_match_logic") + private String matchLogic; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ModuleDataEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ModuleDataEntity.java new file mode 100644 index 0000000..f8ab07b --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ModuleDataEntity.java @@ -0,0 +1,38 @@ +package com.yunzhupaas.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2024/5/6 上午10:15 + */ +@Data +@TableName("base_module_data") +public class ModuleDataEntity extends SuperExtendEntity.SuperExtendDEEntity implements Serializable { + + /** + * 功能主键 + */ + @TableField("f_module_id") + private String moduleId; + + /** + * 功能类型 + */ + @TableField("f_module_type") + private String moduleType; + + /** + * 关联系统id + */ + @TableField("f_system_id") + private String systemId; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ModuleEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ModuleEntity.java new file mode 100644 index 0000000..812e67f --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ModuleEntity.java @@ -0,0 +1,114 @@ +package com.yunzhupaas.base.entity; + +import com.yunzhupaas.base.entity.SuperEntity; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 系统功能 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2023/09/27 + */ +@Data +@TableName("base_module") +public class ModuleEntity extends SuperExtendEntity.SuperExtendDEEntity implements Serializable { + + /** + * 功能上级 + */ + @TableField("f_parent_id") + private String parentId; + + /** + * 功能类别 + */ + @TableField("f_type") + private Integer type; + + /** + * 功能名称 + */ + @TableField("f_full_name") + private String fullName; + + /** + * 功能编码 + */ + @TableField("f_en_code") + private String enCode; + + /** + * 功能地址 + */ + @TableField("f_url_address") + private String urlAddress; + + /** + * 按钮权限 + */ + @TableField("f_is_button_authorize") + private Integer isButtonAuthorize; + + /** + * 列表权限 + */ + @TableField("f_is_column_authorize") + private Integer isColumnAuthorize; + + /** + * 数据权限 + */ + @TableField("f_is_data_authorize") + private Integer isDataAuthorize; + + /** + * 表单权限 + */ + @TableField("f_is_form_authorize") + private Integer isFormAuthorize; + + /** + * 扩展属性 + */ + @TableField("f_property_json") + private String propertyJson; + + /** + * 菜单图标 + */ + @TableField("f_icon") + private String icon; + /** + * 链接目标 + */ + @TableField("f_link_target") + private String linkTarget; + /** + * 菜单分类 Web、App + */ + @TableField("f_category") + private String category; + /** + * 关联功能id + */ + @TableField("f_module_id") + private String moduleId; + + /** + * 关联系统id + */ + @TableField("f_system_id") + private String systemId; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ModuleFormEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ModuleFormEntity.java new file mode 100644 index 0000000..cd6801e --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ModuleFormEntity.java @@ -0,0 +1,74 @@ +package com.yunzhupaas.base.entity; + +import com.yunzhupaas.base.entity.SuperExtendEntity; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * + * 表单权限 + * 版本: V3.1.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2021-09-14 + */ +@Data +@TableName("base_module_form") +public class ModuleFormEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 表单上级 + */ + @TableField("f_parent_id") + private String parentId; + + /** + * 表单名称 + */ + @TableField("f_full_name") + private String fullName; + + /** + * 表单编码 + */ + @TableField("f_en_code") + private String enCode; + + /** + * 扩展属性 + */ + @TableField("f_property_json") + private String propertyJson; + + /** + * 功能主键 + */ + @TableField("f_module_id") + private String moduleId; + + /** + * 字段规则 主从 + */ + @TableField("f_field_rule") + private Integer fieldRule; + + /** + * 绑定表格Id + */ + @TableField("f_bind_table") + private String bindTable; + + /** + * 子表规则key + */ + @TableField("f_child_table_key") + private String childTableKey; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/OperatorRecordEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/OperatorRecordEntity.java new file mode 100644 index 0000000..c77d281 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/OperatorRecordEntity.java @@ -0,0 +1,83 @@ +package com.yunzhupaas.base.entity; + +import lombok.Data; + +import java.util.Date; + +/** + * 打印模板-流程经办记录 + * + * @author 云筑产品开发平台组 YY + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-30 + */ +@Data +public class OperatorRecordEntity { + /** + * 节点名称 + */ + private String nodeName; + /** + * 节点编码 + */ + private String nodeCode; + /** + * 节点id + */ + private String nodeId; + /** + * 经办类型 + */ + private Integer handleType; + /** + * 经办人员 + */ + private String handleId; + /** + * 经办时间 + */ + private Date handleTimeOrigin; + /** + * 经办理由 + */ + private String handleOpinion; + /** + * 经办主键 + */ + private String operatorId; + /** + * 任务id + */ + private String taskId; + /** + * 签名图片 + */ + private String signImg; + /** + * 状态,0.进行数据 1.加签数据 3.已办不显示数据 -1.作废 + */ + private Integer status; + /** + * 流转操作人 + */ + private String handleUserId; + /** + * 经办文件 + */ + private String fileList; + + /** + * 经办人员 + */ + private String userName; + /** + * 执行动作 + */ + private Integer handleStatus; + /** + * 经办时间(时间戳) + */ + private Long handleTime; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/PortalManageEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/PortalManageEntity.java new file mode 100644 index 0000000..24fcf92 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/PortalManageEntity.java @@ -0,0 +1,42 @@ +package com.yunzhupaas.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.time.LocalDateTime; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import jakarta.validation.constraints.NotNull; + +/** + *

+ * 门户管理 + *

+ * + * @author + * @since 2023-02-16 + */ +@TableName("base_portal_manage") +@Schema(description = "PortalManage对象") +@Data +public class PortalManageEntity extends SuperExtendEntity.SuperExtendDEEntity { + + @Schema(description = "门户_id") + @TableField("F_PORTAL_ID") + private String portalId; + + @Schema(description = "系统_id") + @TableField("F_SYSTEM_ID") + private String systemId; + + @Schema(description = "平台") + @NotNull(message = "必填") + @TableField("F_PLATFORM") + private String platform; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/PrintDevEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/PrintDevEntity.java new file mode 100644 index 0000000..43354cd --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/PrintDevEntity.java @@ -0,0 +1,71 @@ +package com.yunzhupaas.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 打印模板-实体类 + * + * @author 云筑产品开发平台组 YY + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-30 + */ +@Data +@EqualsAndHashCode +@TableName("base_print_template") +public class PrintDevEntity extends SuperExtendEntity.SuperExtendDescriptionEntity { + + /** + * 名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + + /** + * 编码 + */ + @TableField("F_EN_CODE") + private String enCode; + + /** + * 分类 + */ + @TableField("F_CATEGORY") + private String category; + + + /** + * 状态:0-未发布,1-已发布,2-已修改 + */ + @TableField("F_STATE") + private Integer state; + + + /** + * 通用-将该模板设为通用(0-表单用,1-业务打印模板用) + */ + @TableField("F_COMMON_USE") + private Integer commonUse; + + /** + * 发布范围:1-公开,2-权限设置 + */ + @TableField("F_VISIBLE_TYPE") + private Integer visibleType; + + /** + * 图标 + */ + @TableField("F_ICON") + private String icon; + + /** + * 图标颜色 + */ + @TableField("F_ICON_BACKGROUND") + private String iconBackground; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/PrintLogEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/PrintLogEntity.java new file mode 100644 index 0000000..d654e33 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/PrintLogEntity.java @@ -0,0 +1,34 @@ +package com.yunzhupaas.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.util.Date; + + +@Data +@TableName("base_print_log") +public class PrintLogEntity extends SuperExtendEntity { + + /** + * 打印条数 + */ + @TableField("F_PRINT_NUM") + private Integer printNum; + + /** + * 打印功能名称 + */ + @TableField("F_PRINT_TITLE") + private String printTitle; + + /** + * 模板id + */ + @TableField("F_PRINT_ID") + private String printId; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/PrintVersionEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/PrintVersionEntity.java new file mode 100644 index 0000000..1caa164 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/PrintVersionEntity.java @@ -0,0 +1,51 @@ +package com.yunzhupaas.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 打印模板-实体类 + * + * @author 云筑产品开发平台组 YY + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-30 + */ +@Data +@EqualsAndHashCode +@TableName("base_print_version") +public class PrintVersionEntity extends SuperExtendEntity { + + /** + * 打印模板id + */ + @TableField("F_TEMPLATE_ID") + private String templateId; + + /** + * 打印版本 + */ + @TableField("F_VERSION") + private Integer version; + + /** + * 状态(0.设计中,1.启用中,2.已归档) + */ + @TableField("F_STATE") + private Integer state; + + /** + * 打印模板内容 + */ + @TableField("F_PRINT_TEMPLATE") + private String printTemplate; + + /** + * 转换配置 + */ + @TableField("F_CONVERT_CONFIG") + private String convertConfig; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ProvinceAtlasEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ProvinceAtlasEntity.java new file mode 100644 index 0000000..0163b91 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ProvinceAtlasEntity.java @@ -0,0 +1,69 @@ +package com.yunzhupaas.base.entity; + +import com.yunzhupaas.base.entity.SuperExtendEntity; +import com.alibaba.fastjson.annotation.JSONField; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 行政区划-地图 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2023/09/27m + */ +@Data +@TableName("base_province_atlas") +public class ProvinceAtlasEntity extends SuperExtendEntity.SuperExtendDEEntity implements Serializable { + + /** + * 区域上级 + */ + @TableField("F_PARENT_ID") + private String parentId; + + /** + * 区域编号 + */ + @TableField("F_EN_CODE") + private String enCode; + + /** + * 区域名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + + /** + * 快速查询 + */ + @TableField("F_QUICK_QUERY") + private String quickQuery; + + /** + * 区域类型 + */ + @TableField("F_TYPE") + private String type; + + /** + * 行政区划编码 + */ + @TableField("F_DIVISION_CODE") + private String divisionCode; + + /** + * 中心经纬度 + */ + @TableField("F_ATLAS_CENTER") + private String atlasCenter; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ProvinceEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ProvinceEntity.java new file mode 100644 index 0000000..dbbfb1d --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ProvinceEntity.java @@ -0,0 +1,57 @@ +package com.yunzhupaas.base.entity; + +import com.yunzhupaas.base.entity.SuperExtendEntity; +import com.alibaba.fastjson.annotation.JSONField; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 行政区划 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2023/09/27m + */ +@Data +@TableName("base_province") +public class ProvinceEntity extends SuperExtendEntity.SuperExtendDEEntity implements Serializable { + /** + * 区域上级 + */ + @TableField("F_PARENT_ID") + private String parentId; + + /** + * 区域编号 + */ + @TableField("F_EN_CODE") + private String enCode; + + /** + * 区域名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + + /** + * 快速查询 + */ + @TableField("F_QUICK_QUERY") + private String quickQuery; + + /** + * 区域类型 + */ + @TableField("F_TYPE") + private String type; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ScheduleLogEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ScheduleLogEntity.java new file mode 100644 index 0000000..39ada06 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ScheduleLogEntity.java @@ -0,0 +1,153 @@ +package com.yunzhupaas.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * 日程安排 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +@Data +@TableName("base_schedule_log") +public class ScheduleLogEntity extends SuperExtendEntity.SuperExtendDEEntity { + /** + * 分类 + */ + @TableField("F_CATEGORY") + private String category; + + /** + * 紧急程度 + */ + @TableField("F_URGENT") + private Integer urgent; + + /** + * 标题 + */ + @TableField("F_TITLE") + private String title; + + /** + * 内容 + */ + @TableField("F_CONTENT") + private String content; + + /** + * 全天 + */ + @TableField("F_ALL_DAY") + private Integer allDay; + + /** + * 开始时间 + */ + @TableField("F_START_DAY") + private Date startDay; + + /** + * 开始日期 + */ + @TableField("F_START_TIME") + private String startTime; + + /** + * 结束时间 + */ + @TableField("F_END_DAY") + private Date endDay; + + /** + * 结束日期 + */ + @TableField("F_END_TIME") + private String endTime; + + /** + * 时长 + */ + @TableField("F_DURATION") + private Integer duration; + + /** + * 颜色 + */ + @TableField("F_COLOR") + private String color; + + /** + * 提醒时长 -2不提醒 -1开始 其他是分钟 + */ + @TableField("F_REMINDER_TIME") + private Integer reminderTime; + + /** + * 提醒方式(1-默认 2-自定义) + */ + @TableField("F_REMINDER_TYPE") + private Integer reminderType; + + /** + * 发送配置id + */ + @TableField("F_SEND_CONFIG_ID") + private String send; + + /** + * 发送配置名称 + */ + @TableField("F_SEND_CONFIG_NAME") + private String sendConfigName; + + /** + * 重复提醒 1.不重复 2.每天重复 3.每周重复 4.每月重复 5.每年重复 + */ + @TableField("F_REPETITION") + private Integer repetition; + + /** + * 结束重复 + */ + @TableField("F_REPEAT_TIME") + private Date repeatTime; + + /** + * 推送时间 + */ + @TableField("F_PUSH_TIME") + private Date pushTime; + + /** + * 分组id + */ + @TableField("F_GROUP_ID") + private String groupId; + + /** + * 参与用户 + */ + @TableField("F_USER_ID") + private String userId; + + /** + * 日程id + */ + @TableField("F_SCHEDULE_ID") + private String scheduleId; + + /** + * 操作类型 1.新增 2.修改 3.删除 4.参与人删除 + */ + @TableField("F_OPERATION_TYPE") + private String operationType; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ScheduleNewEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ScheduleNewEntity.java new file mode 100644 index 0000000..b742648 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ScheduleNewEntity.java @@ -0,0 +1,141 @@ +package com.yunzhupaas.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * 日程安排 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +@Data +@TableName("base_schedule") +public class ScheduleNewEntity extends SuperExtendEntity.SuperExtendDEEntity { + /** + * 分类 + */ + @TableField("F_CATEGORY") + private String category; + + /** + * 紧急程度 + */ + @TableField("F_URGENT") + private Integer urgent; + + /** + * 标题 + */ + @TableField("F_TITLE") + private String title; + + /** + * 内容 + */ + @TableField("F_CONTENT") + private String content; + + /** + * 全天 + */ + @TableField("F_ALL_DAY") + private Integer allDay; + + /** + * 开始时间 + */ + @TableField("F_START_DAY") + private Date startDay; + + /** + * 开始日期 + */ + @TableField("F_START_TIME") + private String startTime; + + /** + * 结束时间 + */ + @TableField("F_END_DAY") + private Date endDay; + + /** + * 结束日期 + */ + @TableField("F_END_TIME") + private String endTime; + + /** + * 时长 + */ + @TableField("F_DURATION") + private Integer duration; + + /** + * 颜色 + */ + @TableField("F_COLOR") + private String color; + + /** + * 提醒时长-2不提醒 -1开始 其他是分钟 + */ + @TableField("F_REMINDER_TIME") + private Integer reminderTime; + + /** + * 提醒方式(1-默认 2-自定义) + */ + @TableField("F_REMINDER_TYPE") + private Integer reminderType; + + /** + * 发送配置id + */ + @TableField("F_SEND_CONFIG_ID") + private String send; + + /** + * 发送配置名称 + */ + @TableField("F_SEND_CONFIG_NAME") + private String sendConfigName; + + /** + * 重复提醒1.不重复 2.每天重复 3.每周重复 4.每月重复 5.每年重复 + */ + @TableField("F_REPETITION") + private Integer repetition; + + /** + * 结束重复 + */ + @TableField("F_REPEAT_TIME") + private Date repeatTime; + + /** + * 推送时间 + */ + @TableField("F_PUSH_TIME") + private Date pushTime; + + /** + * 分组id + */ + @TableField("F_GROUP_ID") + private String groupId; + + /** + * 分组id + */ + @TableField("F_FILES") + private String files; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ScheduleNewUserEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ScheduleNewUserEntity.java new file mode 100644 index 0000000..70cd9d1 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/ScheduleNewUserEntity.java @@ -0,0 +1,39 @@ +package com.yunzhupaas.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +/** + * 日程安排 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +@Data +@TableName("base_schedule_user") +public class ScheduleNewUserEntity extends SuperExtendEntity.SuperExtendDEEntity { + /** + * 日程id + */ + @TableField("F_SCHEDULE_ID") + private String scheduleId; + + /** + * 用户id + */ + @TableField("F_TO_USER_ID") + private String toUserId; + + /** + * 类型(1-系统添加 2-用户添加) + */ + @TableField("F_TYPE") + private Integer type; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/SignatureEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/SignatureEntity.java new file mode 100644 index 0000000..4b6cec1 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/SignatureEntity.java @@ -0,0 +1,37 @@ +package com.yunzhupaas.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * 电子签章 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2023/09/27 + */ +@Data +@TableName("base_signature") +public class SignatureEntity extends SuperExtendEntity.SuperExtendDescriptionEntity { + /** + * 名称 + */ + @TableField("f_full_name") + private String fullName; + + /** + * 编码 + */ + @TableField("f_en_code") + private String enCode; + + /** + * 签章 + */ + @TableField("f_icon") + private String icon; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/SignatureUserEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/SignatureUserEntity.java new file mode 100644 index 0000000..4585fa6 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/SignatureUserEntity.java @@ -0,0 +1,33 @@ +package com.yunzhupaas.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * 电子签章 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2023/09/27 + */ +@Data +@TableName("base_signature_user") +public class SignatureUserEntity extends SuperExtendEntity.SuperExtendDescriptionEntity { + /** + * 签章主键 + */ + @TableField("f_signature_id") + private String signatureId; + + /** + * 用户主键 + */ + @TableField("f_user_id") + private String userId; + + + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/SmsTemplateEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/SmsTemplateEntity.java new file mode 100644 index 0000000..b74d2a9 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/SmsTemplateEntity.java @@ -0,0 +1,87 @@ +package com.yunzhupaas.base.entity; + +import com.yunzhupaas.base.entity.SuperEntity; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 短息模板表 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年12月8日17:40:37 + */ +//@TableName("base_sms_template") +@Data +public class SmsTemplateEntity extends SuperEntity implements Serializable { + + /** + * 短信提供商 + */ + @TableField(value = "F_COMPANY") + private Integer company; + + /** + * 应用编号 + */ + @TableField(value = "F_APPID") + private String appId; + + /** + * 签名内容 + */ + @TableField(value = "F_SIGNCONTENT") + private String signContent; + + /** + * 模板编号 + */ + @TableField(value = "F_TEMPLATEID") + private String templateId; + + /** + * 模板名称 + */ + @TableField(value = "F_FULLNAME") + private String fullName; + + /** + * 模板参数JSON + */ + @TableField(value = "F_TEMPLATEJSON") + private String templateJson; + + /** + * 有效标志 + */ + @TableField("F_ENABLEDMARK") + private Integer enabledMark; + + /** + * 编码 + */ + @TableField("F_ENCODE") + private String enCode; + + /** + * endpoint + */ + @TableField("F_ENDPOINT") + private String endpoint; + + /** + * 地域参数 + */ + @TableField("F_REGION") + private String region; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/SysConfigEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/SysConfigEntity.java new file mode 100644 index 0000000..3aec997 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/SysConfigEntity.java @@ -0,0 +1,46 @@ +package com.yunzhupaas.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; + +/** + * 系统配置 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2023/09/27 + */ +@Data +@TableName("base_sys_config") +public class SysConfigEntity extends SuperExtendEntity implements Serializable { + + /** + * 名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + + /** + * 键 + */ + @TableField("F_KEY") + private String fkey; + + /** + * 值 + */ + @TableField("F_VALUE") + private String value; + + /** + * 分类 + */ + @TableField("F_CATEGORY") + private String category; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/SystemEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/SystemEntity.java new file mode 100644 index 0000000..ad3e5ca --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/SystemEntity.java @@ -0,0 +1,73 @@ +package com.yunzhupaas.base.entity; + +import com.yunzhupaas.base.entity.SuperEntity; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * 系统 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Data +@TableName("base_system") +public class SystemEntity extends SuperExtendEntity.SuperExtendDEEntity { + /** + * 系统名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + + /** + * 系统编号 + */ + @TableField("F_EN_CODE") + private String enCode; + + /** + * 系统图标 + */ + @TableField("F_ICON") + private String icon; + + /** + * 是否是主系统(0-不是,1-是) + */ + @TableField("F_IS_MAIN") + private Integer isMain; + + /** + * 扩展属性 + */ + @TableField("F_PROPERTY_JSON") + private String propertyJson; + + /** + * 导航图标 + */ + @TableField("f_navigation_icon") + private String navigationIcon; + + /** + * Logo图标 + */ + @TableField("f_work_logo_icon") + private String workLogoIcon; + + /** + * 已启用工作流 + */ + @TableField("f_workflow_enabled") + private Integer workflowEnabled; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/VisualDataMapEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/VisualDataMapEntity.java new file mode 100644 index 0000000..644d533 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/VisualDataMapEntity.java @@ -0,0 +1,99 @@ +package com.yunzhupaas.base.entity; + +import com.yunzhupaas.base.entity.SuperBaseEntity; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 大屏地图 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-09-26 上午9:18 + */ +@Data +@TableName("visualdata_map") +public class VisualDataMapEntity extends SuperBaseEntity.SuperTBaseEntity implements Serializable { + + /** + * 名称 + */ + @TableField("F_FULLNAME") + private String fullName; + + /** + * 编码 + */ + @TableField("F_ENCODE") + private String enCode; + + /** + * 地图数据 + */ + @TableField("F_Data") + private String data; + + /** + * 排序 + */ + @TableField("F_SORTCODE") + private Long sortCode; + + /** + * 有效标识 + */ + @TableField("F_ENABLEDMARK") + private Integer enabledMark; + + /** + * 创建时间 + */ + @TableField("F_CREATORTIME") + private Date creatorTime; + + /** + * 创建人 + */ + @TableField("F_CREATORUSERID") + private String creatorUser; + + /** + * 修改时间 + */ + @TableField("F_LASTMODIFYTIME") + private Date lastModifyTime; + + /** + * 修改人 + */ + @TableField("F_LASTMODIFYUSERID") + private String lastModifyUser; + + /** + * 删除标志 + */ + @TableField("F_DELETEMARK") + private Integer deleteMark; + + /** + * 删除时间 + */ + @TableField("F_DELETETIME") + private Date deleteTime; + + /** + * 删除人 + */ + @TableField("F_DELETEUSERID") + private String deleteUserId; + +} + + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/VisualKitEntity.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/VisualKitEntity.java new file mode 100644 index 0000000..739e454 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/entity/VisualKitEntity.java @@ -0,0 +1,49 @@ +package com.yunzhupaas.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * 表单套件 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/8/22 10:29:10 + */ +@Data +@TableName("base_visual_kit") +public class VisualKitEntity extends SuperExtendEntity.SuperExtendDEEntity { + /** + * 名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + + /** + * 编码 + */ + @TableField("F_EN_CODE") + private String enCode; + + /** + * 分类(数据字典) + */ + @TableField("F_CATEGORY") + private String category; + + /** + * 图标 + */ + @TableField("F_ICON") + private String icon; + + /** + * 套件设计内容 + */ + @TableField("F_FORM_DATA") + private String formData; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/InterfaceOauth/IdentDataInterfaceLogVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/InterfaceOauth/IdentDataInterfaceLogVO.java new file mode 100644 index 0000000..96f805f --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/InterfaceOauth/IdentDataInterfaceLogVO.java @@ -0,0 +1,57 @@ +package com.yunzhupaas.base.model.InterfaceOauth; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 数据接口调用日志 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-06-10 + */ +@Data +public class IdentDataInterfaceLogVO implements Serializable { + + @Schema(description = "主键") + private String id; + + @Schema(description = "调用id") + private String invokId; + + @Schema(description = "调用时间") + private Date invokTime; + + @Schema(description = "用户id") + private String userId; + + @Schema(description = "调用ip") + private String invokIp; + + @Schema(description = "调用设备") + private String invokDevice; + + @Schema(description = "调用类型") + private String invokType; + + @Schema(description = "调用响应时间") + private Integer invokWasteTime; + + @Schema(description = "租户id") + private String tenantId; + + @Schema(description = "授权码") + private String oauthAppId; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "编码") + private String enCode; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/InterfaceOauth/IdentInterfaceListModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/InterfaceOauth/IdentInterfaceListModel.java new file mode 100644 index 0000000..cfaed68 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/InterfaceOauth/IdentInterfaceListModel.java @@ -0,0 +1,23 @@ +package com.yunzhupaas.base.model.InterfaceOauth; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 授权接口列表 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/9 18:12 + */ +@Data +public class IdentInterfaceListModel { + + @Schema(description = "接口认证id") + private String interfaceIdentId; + + @Schema(description = "接口id") + private String dataInterfaceIds; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/InterfaceOauth/InterfaceIdentForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/InterfaceOauth/InterfaceIdentForm.java new file mode 100644 index 0000000..130590a --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/InterfaceOauth/InterfaceIdentForm.java @@ -0,0 +1,54 @@ +package com.yunzhupaas.base.model.InterfaceOauth; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import jakarta.validation.constraints.NotBlank; +import java.util.Date; + +/** + * 接口认证表单 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/8 9:57 + */ +@Data +public class InterfaceIdentForm { + + @Schema(description = "应用id") + @NotBlank(message = "appId不能为空") + private String appId; + + @Schema(description = "应用名称") + @NotBlank(message = "应用名称不能为空") + private String appName; + + @Schema(description = "应用秘钥") + @NotBlank(message = "appSecret不能为空") + private String appSecret; + + @Schema(description = "验证签名") + private Integer verifySignature; + + @Schema(description = "使用期限") + private Date usefulLife; + + @Schema(description = "白名单") + private String whiteList; + + @Schema(description = "黑名单") + private String blackList; + + @Schema(description = "排序") + private Long sortCode; + + @Schema(description = "状态") + private Integer enabledMark; + + @Schema(description = "说明") + private String description; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/InterfaceOauth/InterfaceIdentListVo.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/InterfaceOauth/InterfaceIdentListVo.java new file mode 100644 index 0000000..98ea37a --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/InterfaceOauth/InterfaceIdentListVo.java @@ -0,0 +1,54 @@ +package com.yunzhupaas.base.model.InterfaceOauth; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * 接口认证列表对象 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/7/6 10:50 + */ +@Data +public class InterfaceIdentListVo { + @Schema(description = "id") + private String id; + + @Schema(description = "应用id") + private String appId; + + @Schema(description = "应用名称") + private String appName; + + @Schema(description = "使用期限") + private Date usefulLife; + + @Schema(description = "创建人id") + private String creatorUserId; + + @Schema(description = "创建人") + private String creatorUser; + + @Schema(description = "创建时间") + private Long creatorTime; + + @Schema(description = "修改时间") + private Long lastModifyTime; + + @Schema(description = "排序") + private Long sortCode; + + @Schema(description = "状态") + private Integer enabledMark; + + @Schema(description = "租户id") + private String tenantId; + + @Schema(description = "绑定接口") + private String dataInterfaceIds; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/InterfaceOauth/InterfaceIdentVo.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/InterfaceOauth/InterfaceIdentVo.java new file mode 100644 index 0000000..475472d --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/InterfaceOauth/InterfaceIdentVo.java @@ -0,0 +1,86 @@ +package com.yunzhupaas.base.model.InterfaceOauth; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.model.datainterface.DataInterfaceVo; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * 接口认证vo + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/8 10:16 + */ +@Data +public class InterfaceIdentVo { + + @Schema(description = "id") + private String id; + + @Schema(description = "应用id") + private String appId; + + @Schema(description = "应用名称") + private String appName; + + @Schema(description = "应用秘钥") + private String appSecret; + + @Schema(description = "验证签名") + private Integer verifySignature; + + @Schema(description = "使用期限") + private Date usefulLife; + + @Schema(description = "白名单") + private String whiteList; + + @Schema(description = "黑名单") + private String blackList; + + @Schema(description = "排序") + private Long sortCode; + + @Schema(description = "状态") + private Integer enabledMark; + + @Schema(description = "说明") + private String description; + + @Schema(description = "创建人id") + private String creatorUserId; + + @Schema(description = "创建人") + private String creatorUser; + + @Schema(description = "创建时间") + private Long creatorTime; + + @Schema(description = "修改人id") + private String lastModifyUserId; + + @Schema(description = "修改人") + private String lastModifyUser; + + @Schema(description = "修改时间") + private Long lastModifyTime; + + /** + * 接口列表 + */ + @Schema(description = "接口列表字符串") + private String dataInterfaceIds; + /** + * 接口列表 + */ + @Schema(description = "接口列表") + private List list; + + @Schema(description = "授权用户列表") + private List userList; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/InterfaceOauth/InterfaceUserForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/InterfaceOauth/InterfaceUserForm.java new file mode 100644 index 0000000..e199980 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/InterfaceOauth/InterfaceUserForm.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.base.model.InterfaceOauth; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * 授权用户表单 + * + * @author 云筑产品开发平台组 + * @version V3.4.7 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/9/20 9:22 + */ +@Data +public class InterfaceUserForm { + + @Schema(description = "接口认证id") + private String interfaceIdentId; + + @Schema(description = "授权用户列表") + private List userIds; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/InterfaceOauth/InterfaceUserVo.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/InterfaceOauth/InterfaceUserVo.java new file mode 100644 index 0000000..1659d5b --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/InterfaceOauth/InterfaceUserVo.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.base.model.InterfaceOauth; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 授权用户展示 + * + * @author 云筑产品开发平台组 + * @version V3.4.7 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/9/20 9:22 + */ +@Data +public class InterfaceUserVo { + + @Schema(description = "用户id") + private String userId; + + @Schema(description = "用户名称") + private String userName; + + @Schema(description = "用户密钥") + private String userKey; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/InterfaceOauth/PaginationIntrfaceLog.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/InterfaceOauth/PaginationIntrfaceLog.java new file mode 100644 index 0000000..4fb5558 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/InterfaceOauth/PaginationIntrfaceLog.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.base.model.InterfaceOauth; + +import com.yunzhupaas.base.PaginationTime; +import lombok.Data; + +/** + * 日志列表查询 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/10 11:24 + */ +@Data +public class PaginationIntrfaceLog extends PaginationTime { + private String keyword; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/InterfaceOauth/PaginationOauth.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/InterfaceOauth/PaginationOauth.java new file mode 100644 index 0000000..6a10e51 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/InterfaceOauth/PaginationOauth.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.base.model.InterfaceOauth; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import lombok.Data; + +/** + * 接口认证查询参数 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/8 10:33 + */ +@Data +public class PaginationOauth extends Pagination { + private String keyword; + @Schema(description = "有效标志") + private Integer enabledMark; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/MailAccount.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/MailAccount.java new file mode 100644 index 0000000..ed7d492 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/MailAccount.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.base.model; + +import lombok.Data; + +@Data +public class MailAccount { + // pop3服务 + private String pop3Host; + // pop3端口 + private int pop3Port; + // smtp服务 + private String smtpHost; + // smtp端口 + private int smtpPort; + // 账户 + private String account; + // 账户名称 + private String accountName; + // 密码 + private String password; + // SSL + private Boolean ssl; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/MailFile.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/MailFile.java new file mode 100644 index 0000000..963d250 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/MailFile.java @@ -0,0 +1,13 @@ +package com.yunzhupaas.base.model; + +import lombok.Data; + +@Data +public class MailFile { + private String fileId; + private String fileName; + private String fileSize; + private String fileTime; + private String fileState; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/MailModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/MailModel.java new file mode 100644 index 0000000..705f379 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/MailModel.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.base.model; + +import lombok.Data; + +import java.time.LocalDateTime; +import java.util.List; + +@Data +public class MailModel { + private String uid; + private String from; + private String fromName; + private String recipient; + private String toName; + private String cc; + private String ccName; + private String bcc; + private String bccName; + private String subject; + private String bodyText; + private List attachment; + private LocalDateTime date; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/advancedquery/AdvancedQueryListVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/advancedquery/AdvancedQueryListVO.java new file mode 100644 index 0000000..7800a90 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/advancedquery/AdvancedQueryListVO.java @@ -0,0 +1,11 @@ +package com.yunzhupaas.base.model.advancedquery; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class AdvancedQueryListVO extends AdvancedQuerySchemeForm{ + @Schema(description = "主键") + private String id; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/advancedquery/AdvancedQuerySchemeForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/advancedquery/AdvancedQuerySchemeForm.java new file mode 100644 index 0000000..986951c --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/advancedquery/AdvancedQuerySchemeForm.java @@ -0,0 +1,32 @@ +package com.yunzhupaas.base.model.advancedquery; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import jakarta.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * + * 高级查询表单 + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2022/5/30 + */ +@Data +public class AdvancedQuerySchemeForm implements Serializable { + @Schema(description = "名称") + @NotBlank(message = "必填") + private String fullName; + @Schema(description = "条件") + @NotBlank(message = "必填") + private String conditionJson; + @Schema(description = "匹配标志") + @NotBlank(message = "必填") + private String matchLogic; + @Schema(description = "菜单id") + @NotBlank(message = "当前菜单不能为空") + private String moduleId; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/ai/AiChatVo.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/ai/AiChatVo.java new file mode 100644 index 0000000..ad8a41e --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/ai/AiChatVo.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.base.model.ai; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version v5.2.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2025/2/20 18:07:04 + */ +@Data +@Schema(description = "ai会话模型") +public class AiChatVo { + @Schema(description = "会话id") + private String id; + @Schema(description = "会话标题") + private String fullName; + @Schema(description = "创建时间") + private Long creatorTime; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/ai/AiForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/ai/AiForm.java new file mode 100644 index 0000000..93c0d03 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/ai/AiForm.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.base.model.ai; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version v5.2.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2025/2/21 9:49:33 + */ +@Data +@Schema(description = "会话id") +public class AiForm { + @Schema(description = "会话id") + private String id; + @Schema(description = "会话标题") + private String fullName; + + @Schema(description = "对话记录列表") + private List data; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/ai/AiHisVo.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/ai/AiHisVo.java new file mode 100644 index 0000000..1d6c322 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/ai/AiHisVo.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.base.model.ai; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version v5.2.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2025/2/21 9:49:27 + */ +@Data +@Schema(description = "对话记录") +public class AiHisVo { + @Schema(description = "记录id") + private String id; + @Schema(description = "问题内容") + private String questionText; + @Schema(description = "对话内容") + private String content; + @Schema(description = "类型:0-ai,1-用户") + private Integer type; + @Schema(description = "创建时间") + private Long creatorTime; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/ai/AiParam.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/ai/AiParam.java new file mode 100644 index 0000000..453a701 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/ai/AiParam.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.base.model.ai; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version v5.2.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2025/2/20 17:18:16 + */ +@Data +@Schema(description = "ai参数模型") +public class AiParam extends Pagination { + @Schema(description = "会话id") + public String id; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/base/SystemBaeModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/base/SystemBaeModel.java new file mode 100644 index 0000000..bfaba8e --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/base/SystemBaeModel.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.base.model.base; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/6/22 14:26 + */ +@Data +public class SystemBaeModel extends SystemCrModel implements Serializable { + + private String id; + private Long creatorTime; + private Date creatorTimes; + + public Long getCreatorTime() { + if (this.creatorTimes != null && this.creatorTime == null) { + return this.getCreatorTimes().getTime(); + } else if (this.creatorTime != null){ + return this.creatorTime; + } + return 0L; + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/base/SystemCrModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/base/SystemCrModel.java new file mode 100644 index 0000000..0baa25b --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/base/SystemCrModel.java @@ -0,0 +1,50 @@ +package com.yunzhupaas.base.model.base; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import jakarta.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/6/21 16:00 + */ +@Data +public class SystemCrModel implements Serializable { + + @Schema(description = "名称") + @NotBlank(message = "系统名称不能为空") + private String fullName; + + @Schema(description = "编码") + @NotBlank(message = "系统编码不能为空") + private String enCode; + + @Schema(description = "图标") + @NotBlank(message = "系统图标不能为空") + private String icon; + + @NotBlank(message = "排序码") + private Long sortCode; + + @NotBlank(message = "有效标志") + private Integer enabledMark; + + @NotBlank(message = "说明") + private String description; + + @NotBlank(message = "扩展属性") + private String propertyJson; + + @Schema(description = "导航图片") + private String navigationIcon; + @Schema(description = "Logo图片") + private String workLogoIcon; + @Schema(description = "已启用工作流") + private Integer workflowEnabled; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/base/SystemListVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/base/SystemListVO.java new file mode 100644 index 0000000..7f7ab72 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/base/SystemListVO.java @@ -0,0 +1,61 @@ +package com.yunzhupaas.base.model.base; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.constant.YunzhupaasConst; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/6/21 15:50 + */ +@Data +public class SystemListVO implements Serializable { + + @Schema(description = "主键") + private String id; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "编码") + private String enCode; + + @Schema(description = "图标") + private String icon; + + @Schema(description = "说明") + private String description; + + @Schema(description = "排序码") + private Long sortCode; + + @Schema(description = "有效标志") + private Integer enabledMark; + + @Schema(description = "扩展属性") + private String propertyJson; + + @Schema(description = "是否主系统") + private Integer isMain; + @Schema(description = "是否为开发平台") + private boolean mainSystem; + @Schema(description = "导航图片") + private String navigationIcon; + @Schema(description = "Logo图片") + private String workLogoIcon; + + @Schema(description = "禁用") + private Boolean disabled = false; + + public boolean isMainSystem() { + if (YunzhupaasConst.MAIN_SYSTEM_CODE.equals(this.getEnCode())) { + return true; + } + return false; + } + +} diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/base/SystemPageVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/base/SystemPageVO.java new file mode 100644 index 0000000..5f1ddb0 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/base/SystemPageVO.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.base.model.base; + +import com.yunzhupaas.base.Page; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 类功能 + * + * @author 云筑产品开发平台组 + * @version v3.4.6 + * @copyrignt 深圳市乐程软件有限公司 + * @date 2023-02-27 + */ +@Data +public class SystemPageVO extends Page { + + private String enabledMark; + + private Boolean selector; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/base/SystemUpModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/base/SystemUpModel.java new file mode 100644 index 0000000..520ea97 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/base/SystemUpModel.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.base.model.base; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/6/21 16:49 + */ +@Data +public class SystemUpModel extends SystemCrModel implements Serializable { +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/base/SystemVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/base/SystemVO.java new file mode 100644 index 0000000..ac1e4d7 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/base/SystemVO.java @@ -0,0 +1,49 @@ +package com.yunzhupaas.base.model.base; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/6/21 15:58 + */ +@Data +public class SystemVO implements Serializable { + + @Schema(description = "主键") + private String id; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "编码") + private String enCode; + + @Schema(description = "图标") + private String icon; + + @Schema(description = "排序码") + private Long sortCode; + + @Schema(description = "有效标志") + private Integer enabledMark; + + @Schema(description = "说明") + private String description; + + @Schema(description = "扩展属性") + private String propertyJson; + + @Schema(description = "导航图片") + private String navigationIcon; + @Schema(description = "Logo图片") + private String workLogoIcon; + @Schema(description = "已启用工作流") + private Integer workflowEnabled; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/billrule/BillRuleCrForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/billrule/BillRuleCrForm.java new file mode 100644 index 0000000..8e7b192 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/billrule/BillRuleCrForm.java @@ -0,0 +1,53 @@ +package com.yunzhupaas.base.model.billrule; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import jakarta.validation.constraints.NotBlank; + +import jakarta.validation.constraints.NotNull; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:28 + */ +@Data +public class BillRuleCrForm { + @NotBlank(message = "必填") + @Schema(description = "业务名称") + private String fullName; + @NotBlank(message = "必填") + @Schema(description = "业务编码") + private String enCode; +// @NotBlank(message = "必填") + @Schema(description = "流水前缀") + private String prefix; +// @NotBlank(message = "必填") + @Schema(description = "流水日期格式") + private String dateFormat; +// @NotNull(message = "必填") + @Schema(description = "流水位数") + private Integer digit; +// @NotBlank(message = "必填") + @Schema(description = "流水起始") + private String startNumber; + @Schema(description = "流水范例") + private String example; + @Schema(description = "状态(0-禁用,1-启用)") + private Integer enabledMark; + @Schema(description = "流水说明") + private String description; + private long sortCode; + private String category; + @Schema(description = "方式 1-时间格式,2-随机数编号,3-UUID") + private Integer type; + @Schema(description = "随机数位数") + private Integer randomDigit; + @Schema(description = "随机数类型") + private Integer randomType; + @Schema(description = "单据后缀") + private String suffix; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/billrule/BillRuleInfoVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/billrule/BillRuleInfoVO.java new file mode 100644 index 0000000..f04b241 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/billrule/BillRuleInfoVO.java @@ -0,0 +1,48 @@ +package com.yunzhupaas.base.model.billrule; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:30 + */ +@Data +public class BillRuleInfoVO { + @Schema(description = "id") + private String id; + @Schema(description = "业务名称") + private String fullName; + @Schema(description = "流水位数") + private String enCode; + @Schema(description = "流水前缀") + private String prefix; + @Schema(description = "流水日期格式") + private String dateFormat; + @Schema(description = "流水位数") + private Integer digit; + @Schema(description = "流水起始") + private String startNumber; + @Schema(description = "流水范例") + private String example; + @Schema(description = "状态(0-禁用,1-启用)") + private Integer enabledMark; + @Schema(description = "流水说明") + private String description; + @Schema(description = "排序码") + private Long sortCode; + @Schema(description = "业务分类") + private String category; + @Schema(description = "方式 1-时间格式,2-随机数编号,3-UUID") + private Integer type; + @Schema(description = "随机数位数") + private Integer randomDigit; + @Schema(description = "随机数类型") + private Integer randomType; + @Schema(description = "单据后缀") + private String suffix; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/billrule/BillRuleListVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/billrule/BillRuleListVO.java new file mode 100644 index 0000000..f2fcd9f --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/billrule/BillRuleListVO.java @@ -0,0 +1,41 @@ +package com.yunzhupaas.base.model.billrule; + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:30 + */ +@Data +public class BillRuleListVO { + + @Schema(description = "id") + private String id; + @Schema(description = "业务名称") + private String fullName; + @Schema(description = "业务编码") + private String enCode; + @Schema(description = "流水起始") + private String startNumber; + @Schema(description = "当前流水号") + private String outputNumber; + @Schema(description = "状态(0-禁用,1-启用)") + private Integer enabledMark; + @Schema(description = "排序码") + private Long sortCode; + @Schema(description = "创建人") + private String creatorUser; + @Schema(description = "创建时间") + private Long creatorTime; + @Schema(description = "最后修改时间") + private Long lastModifyTime; + @Schema(description = "业务分类") + private String category; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/billrule/BillRulePagination.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/billrule/BillRulePagination.java new file mode 100644 index 0000000..cd0aac3 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/billrule/BillRulePagination.java @@ -0,0 +1,15 @@ +package com.yunzhupaas.base.model.billrule; + + +import com.yunzhupaas.base.Pagination; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class BillRulePagination extends Pagination { + @Schema(description = "分类id") + private String categoryId; + @Schema(description = "状态") + private Integer enabledMark; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/billrule/BillRuleUpForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/billrule/BillRuleUpForm.java new file mode 100644 index 0000000..3847450 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/billrule/BillRuleUpForm.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.base.model.billrule; + +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:30 + */ +@Data +public class BillRuleUpForm extends BillRuleCrForm { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/button/ButtonListVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/button/ButtonListVO.java new file mode 100644 index 0000000..7aaa70a --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/button/ButtonListVO.java @@ -0,0 +1,23 @@ +package com.yunzhupaas.base.model.button; + +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class ButtonListVO { + private Long sortCode; + private String id; + private String parentId; + private String fullName; + private String enCode; + private String icon; + private Integer enabledMark; + private String description; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/button/ButtonModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/button/ButtonModel.java new file mode 100644 index 0000000..cac42dc --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/button/ButtonModel.java @@ -0,0 +1,48 @@ +package com.yunzhupaas.base.model.button; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 按钮 + */ +@Data +public class ButtonModel implements Serializable { + private String id; + private String parentId; + private String fullName; + private String enCode; + private String icon; + private String urlAddress; + private String moduleId; + private String systemId; + private Long sortCode=999999L; + private Long creatorTime; + private Date creatorTimes; + + public Long getCreatorTime() { + if (this.creatorTimes != null && this.creatorTime == null) { + return this.getCreatorTimes().getTime(); + } else if (this.creatorTime != null){ + return this.creatorTime; + } + return 0L; + } + + public void setCreatorTimes(Date creatorTimes) { + this.creatorTimes = creatorTimes; + if(creatorTimes != null && this.creatorTime == null){ + this.creatorTime = creatorTimes.getTime(); + } + } + + public void setCreatorTime(Long creatorTime) { + this.creatorTime = creatorTime; + if(creatorTime != null && this.creatorTimes == null){ + this.creatorTimes = new Date(creatorTime); + } + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/button/ButtonTreeListModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/button/ButtonTreeListModel.java new file mode 100644 index 0000000..4ba76a7 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/button/ButtonTreeListModel.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.base.model.button; + + +import com.yunzhupaas.util.treeutil.SumTree; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:30 + */ +@Data +public class ButtonTreeListModel extends SumTree { + private String id; + private String parentId; + private String fullName; + private String enCode; + private String icon; + private Integer enabledMark; + private String description; + private Long sortCode; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/button/ButtonTreeListSelectVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/button/ButtonTreeListSelectVO.java new file mode 100644 index 0000000..4e16ca6 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/button/ButtonTreeListSelectVO.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.base.model.button; + +import lombok.Data; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class ButtonTreeListSelectVO { + private String id; + private String parentId; + private String fullName; + private String icon; + private List children; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/button/ButtonTreeListVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/button/ButtonTreeListVO.java new file mode 100644 index 0000000..85f9fa9 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/button/ButtonTreeListVO.java @@ -0,0 +1,38 @@ +package com.yunzhupaas.base.model.button; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +public class ButtonTreeListVO { + @Schema(description = "排序码") + private Long sortCode; + @Schema(description = "主键") + private String id; + @Schema(description = "父级id") + private String parentId; + @Schema(description = "名称") + private String fullName; + @Schema(description = "图标") + private String icon; + @Schema(description = "编码") + private String enCode; + @Schema(description = "有效标志") + private Integer enabledMark; + @Schema(description = "是否有子集") + private Boolean hasChildren; + @Schema(description = "子集集合") + private List children; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/button/ButtonVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/button/ButtonVO.java new file mode 100644 index 0000000..9f8dc44 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/button/ButtonVO.java @@ -0,0 +1,30 @@ +package com.yunzhupaas.base.model.button; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class ButtonVO { + @Schema(description = "按钮主键") + private String id; + @Schema(description = "按钮上级") + private String parentId; + @Schema(description = "按钮名称") + private String fullName; + @Schema(description = "按钮编码") + private String enCode; + @Schema(description = "按钮图标") + private String icon; + @Schema(description = "请求地址") + private String urlAddress; + @Schema(description = "功能主键") + private String moduleId; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/button/ModuleButtonCrForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/button/ModuleButtonCrForm.java new file mode 100644 index 0000000..6e2d9db --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/button/ModuleButtonCrForm.java @@ -0,0 +1,32 @@ +package com.yunzhupaas.base.model.button; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * @author YUNZHUPAAS + */ +@Data +public class ModuleButtonCrForm { + @Schema(description = "编码") + private String enCode; + + @Schema(description = "有效标志") + private Integer enabledMark; + + @Schema(description = "图标") + private String icon; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "说明") + private String description; + + @Schema(description = "父级id") + private String parentId; + @Schema(description = "菜单id") + private String moduleId; + @Schema(description = "排序码") + private Long sortCode; +} diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/button/ModuleButtonInfoVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/button/ModuleButtonInfoVO.java new file mode 100644 index 0000000..bc82a38 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/button/ModuleButtonInfoVO.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.base.model.button; + +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class ModuleButtonInfoVO { + private String enCode; + private Integer enabledMark; + private String fullName; + private String icon; + private String id; + private String parentId; + private String description; + private String moduleId; + private Long sortCode; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/button/ModuleButtonUpForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/button/ModuleButtonUpForm.java new file mode 100644 index 0000000..d83c71e --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/button/ModuleButtonUpForm.java @@ -0,0 +1,15 @@ +package com.yunzhupaas.base.model.button; + +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class ModuleButtonUpForm extends ModuleButtonCrForm{ +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/cachemanage/CacheManageInfoVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/cachemanage/CacheManageInfoVO.java new file mode 100644 index 0000000..3674965 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/cachemanage/CacheManageInfoVO.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.base.model.cachemanage; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class CacheManageInfoVO { + @Schema(description = "名称") + private String name; + @Schema(description = "值") + private String value; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/cachemanage/CacheManageListVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/cachemanage/CacheManageListVO.java new file mode 100644 index 0000000..8da6cdb --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/cachemanage/CacheManageListVO.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.base.model.cachemanage; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class CacheManageListVO { + @Schema(description = "名称") + private String name; + @Schema(description = "过期时间",example = "1") + private Long overdueTime; + @Schema(description = "大小") + private Integer cacheSize; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/cachemanage/PaginationCacheManage.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/cachemanage/PaginationCacheManage.java new file mode 100644 index 0000000..6f95265 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/cachemanage/PaginationCacheManage.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.base.model.cachemanage; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Page; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023年11月15日19:29:50 + */ +@Data +public class PaginationCacheManage extends Page { + @Schema(description = "开始时间") + private Long overdueStartTime; + @Schema(description = "结束时间") + private Long overdueEndTime; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/column/ColumnBatchForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/column/ColumnBatchForm.java new file mode 100644 index 0000000..dd51d6e --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/column/ColumnBatchForm.java @@ -0,0 +1,32 @@ +package com.yunzhupaas.base.model.column; + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.hibernate.validator.constraints.NotBlank; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class ColumnBatchForm { + @Schema(description = "菜单id") + @NotBlank(message = "必填") + private String moduleId; + @Schema(description = "表名") + private String bindTable; + @Schema(description = "绑定表说明") + private String bindTableName; + @Schema(description = "列JSON") + private Object columnJson; + @Schema(description = "排序码") + private Long sortCode; + @Schema(description = "字段规则") + private Integer fieldRule; + private String childTableKey; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/column/ColumnListVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/column/ColumnListVO.java new file mode 100644 index 0000000..7db481f --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/column/ColumnListVO.java @@ -0,0 +1,28 @@ +package com.yunzhupaas.base.model.column; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class ColumnListVO { + @Schema(description = "主键") + private String id; + @Schema(description = "列表名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "表格") + private String bindTable; + @Schema(description = "是否启用") + private Integer enabledMark; + @Schema(description = "排序码") + private Long sortCode; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/column/ColumnModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/column/ColumnModel.java new file mode 100644 index 0000000..9f8387b --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/column/ColumnModel.java @@ -0,0 +1,49 @@ +package com.yunzhupaas.base.model.column; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 列表 + */ +@Data +public class ColumnModel implements Serializable { + private String id; + private String parentId; + private String fullName; + private String enCode; + private String bindTable; + private String bindTableName; + private String moduleId; + private String icon; + private String systemId; + private Long sortCode=999999L; + private Long creatorTime; + private Date creatorTimes; + + public Long getCreatorTime() { + if (this.creatorTimes != null && this.creatorTime == null) { + return this.getCreatorTimes().getTime(); + } else if (this.creatorTime != null){ + return this.creatorTime; + } + return 0L; + } + + public void setCreatorTimes(Date creatorTimes) { + this.creatorTimes = creatorTimes; + if(creatorTimes != null && this.creatorTime == null){ + this.creatorTime = creatorTimes.getTime(); + } + } + + public void setCreatorTime(Long creatorTime) { + this.creatorTime = creatorTime; + if(creatorTime != null && this.creatorTimes == null){ + this.creatorTimes = new Date(creatorTime); + } + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/column/ModuleColumnCrForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/column/ModuleColumnCrForm.java new file mode 100644 index 0000000..47e857c --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/column/ModuleColumnCrForm.java @@ -0,0 +1,47 @@ +package com.yunzhupaas.base.model.column; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class ModuleColumnCrForm { + @Schema(description = "编码") + private String enCode; + + @Schema(description = "是否启用") + private Integer enabledMark; + + @Schema(description = "列表名称") + private String fullName; + + @Schema(description = "说明") + private String description; + + @Schema(description = "菜单id") + private String moduleId; + + @Schema(description = "表名") + private String bindTable; + + @Schema(description = "绑定表说明") + private String bindTableName; + + @Schema(description = "排序码") + private Long sortCode; + + @Schema(description = "字段规则") + private Integer fieldRule; + + @Schema(description = "表名") + private String tableName; + + private String childTableKey; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/column/ModuleColumnInfoVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/column/ModuleColumnInfoVO.java new file mode 100644 index 0000000..cdce3e9 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/column/ModuleColumnInfoVO.java @@ -0,0 +1,47 @@ +package com.yunzhupaas.base.model.column; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class ModuleColumnInfoVO { + @Schema(description = "是否启用") + private Integer enabledMark; + + @Schema(description = "列表名称") + private String fullName; + + @Schema(description = "说明") + private String description; + + @Schema(description = "编码") + private String enCode; + + @Schema(description = "主键") + private String id; + + @Schema(description = "表名") + private String bindTable; + + @Schema(description = "绑定表说明") + private String bindTableName; + + @Schema(description = "菜单id") + private String moduleId; + + @Schema(description = "排序码") + private Long sortCode; + + @Schema(description = "字段规则") + private Integer fieldRule; + + private String childTableKey = YunzhupaasKeyConsts.CHILD_TABLE_PREFIX; +} diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/column/ModuleColumnUpForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/column/ModuleColumnUpForm.java new file mode 100644 index 0000000..64ea872 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/column/ModuleColumnUpForm.java @@ -0,0 +1,40 @@ +package com.yunzhupaas.base.model.column; + +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class ModuleColumnUpForm { + private String creatorUserId; + + private Integer enabledMark; + + private String fullName; + + private String description; + + private Long sortCode; + + private String enCode; + + private String creatorTime; + + private String moduleId; + + private String bindTable; + + private String bindTableName; + + private Integer fieldRule; + + private String tableName; + + private String childTableKey; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/comfields/ComFieldsCrForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/comfields/ComFieldsCrForm.java new file mode 100644 index 0000000..d7b9927 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/comfields/ComFieldsCrForm.java @@ -0,0 +1,34 @@ +package com.yunzhupaas.base.model.comfields; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import jakarta.validation.constraints.NotBlank; + +import jakarta.validation.constraints.NotNull; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class ComFieldsCrForm { + @Schema(description = "字段名") + @NotBlank(message = "必填") + private String fieldName; + @Schema(description = "字段") + @NotBlank(message = "必填") + private String field; + @Schema(description = "类型") + @NotBlank(message = "必填") + private String dataType; + @Schema(description = "长度") + @NotBlank(message = "必填") + private String dataLength; + @Schema(description = "是否必填") + @NotNull(message = "必填") + private Integer allowNull; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/comfields/ComFieldsInfoVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/comfields/ComFieldsInfoVO.java new file mode 100644 index 0000000..f6031c4 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/comfields/ComFieldsInfoVO.java @@ -0,0 +1,32 @@ +package com.yunzhupaas.base.model.comfields; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.hibernate.validator.constraints.NotBlank; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class ComFieldsInfoVO { + @Schema(description = "主键") + private String id; + @Schema(description = "字段名") + private String fieldName; + @Schema(description = "类型") + private String dataType; + @Schema(description = "字段") + @NotBlank(message = "必填") + private String field; + @Schema(description = "长度") + private String dataLength; + @Schema(description = "是否必填") + private Integer allowNull; + @Schema(description = "创建时间") + private long creatorTime; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/comfields/ComFieldsListVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/comfields/ComFieldsListVO.java new file mode 100644 index 0000000..3166201 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/comfields/ComFieldsListVO.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.base.model.comfields; + +import lombok.Data; +import jakarta.validation.constraints.NotBlank; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class ComFieldsListVO { + private String id; + private String fieldName; + private String dataType; + private String dataLength; + private Integer allowNull; + @NotBlank(message = "必填") + private String field; + private Long creatorTime; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/comfields/ComFieldsUpForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/comfields/ComFieldsUpForm.java new file mode 100644 index 0000000..ff61b6a --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/comfields/ComFieldsUpForm.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.base.model.comfields; + +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class ComFieldsUpForm extends ComFieldsCrForm{ + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/commonword/ComWordsPagination.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/commonword/ComWordsPagination.java new file mode 100644 index 0000000..b4f39a9 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/commonword/ComWordsPagination.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.base.model.commonword; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.entity.CommonWordsEntity; +import lombok.Data; + +/** + * 类功能 + * + * @author 云筑产品开发平台组 + * @version v3.4.6 + * @copyrignt 深圳市乐程软件有限公司 + * @date 2023-01-07 + */ +@Data +public class ComWordsPagination extends Pagination { + + @Schema(description = "状态") + private Integer enabledMark; + + @Schema(description = "类型:0-系统,1-个人") + private Integer commonWordsType; + + public Page getPage(){ + return new Page<>(getCurrentPage(), getPageSize(), getTotal()); + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/commonword/ComWordsTreeModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/commonword/ComWordsTreeModel.java new file mode 100644 index 0000000..dfc3e43 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/commonword/ComWordsTreeModel.java @@ -0,0 +1,65 @@ +package com.yunzhupaas.base.model.commonword; + +import com.yunzhupaas.util.treeutil.SumTree; +import lombok.Data; + +import java.util.List; + +/** + * 类功能 + * + * @author 云筑产品开发平台组 + * @version v3.4.6 + * @copyrignt 深圳市乐程软件有限公司 + * @date 2023-01-09 + */ +@Data +public class ComWordsTreeModel extends SumTree { + + /** + * 分类下模板数量 + */ + private Integer num; + + /** + * 显示名 + */ + private String fullName; + + /** + * 自然主键 + */ + private String id; + + /** + * 应用id + */ + private List systemIds; + + /** + * 应用名称 + */ + private String systemNames; + + /** + * 常用语 + */ + private String commonWordsText; + + /** + * 常用语类型(0:系统,1:个人) + */ + private Integer commonWordsType; + + /** + * 排序 + */ + private Long sortCode; + + /** + * 有效标志 + */ + private Integer enabledMark; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/commonword/CommonWordsForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/commonword/CommonWordsForm.java new file mode 100644 index 0000000..b441d04 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/commonword/CommonWordsForm.java @@ -0,0 +1,40 @@ +package com.yunzhupaas.base.model.commonword; + + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.util.StringUtil; +import lombok.Data; + +import java.util.List; + +/** + * 类功能 + * + * @author 云筑产品开发平台组 + * @version v3.4.6 + * @copyrignt 深圳市乐程软件有限公司 + * @date 2023-01-07 + */ +@Data +@Schema(description = "CommonWordsForm对象", name = "审批常用语表单对象") +public class CommonWordsForm { + + @Schema(description = "常用语Id") + private String id; + @Schema(description = "常用语类型(0:系统,1:个人)") + private Integer commonWordsType; + @Schema(description = "常用语") + private String commonWordsText; + @Schema(description = "应用id集合") + private List systemIds; + @Schema(description = "排序") + private Long sortCode; + @Schema(description = "有效标志") + private Integer enabledMark; + + public String getSystemIds() { + return StringUtil.join(this.systemIds, ","); + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/commonword/CommonWordsVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/commonword/CommonWordsVO.java new file mode 100644 index 0000000..18fd5bd --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/commonword/CommonWordsVO.java @@ -0,0 +1,47 @@ +package com.yunzhupaas.base.model.commonword; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Arrays; +import java.util.List; + +/** + * 审批常用语 Entity + * + * @author 云筑产品开发平台组 + * @version v3.4.6 + * @copyrignt 深圳市乐程软件有限公司 + * @date 2023-01-06 + */ +@Data +@Schema(description = "CommonWords对象", name = "审批常用语") +public class CommonWordsVO implements Serializable { + + @Schema(description = "自然主键") + private String id; + @Schema(description = "应用id") + private List systemIds; + @Schema(description = "应用名称") + private String systemNames; + @Schema(description = "常用语") + private String commonWordsText; + @Schema(description = "常用语类型(0:系统,1:个人)") + private Integer commonWordsType; + @Schema(description = "排序") + private Long sortCode; + @Schema(description = "有效标志") + private Integer enabledMark; + @Schema(description = "使用次数") + private Long usesNum; + + public void setSystemIds(String systemIds) { + if(systemIds != null){ + this.systemIds = Arrays.asList(systemIds.split(",")); + } + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/ApiDateModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/ApiDateModel.java new file mode 100644 index 0000000..7d00872 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/ApiDateModel.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.base.model.datainterface; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class ApiDateModel implements Serializable { + @Schema(description = "请求方式") + private Integer method; + @Schema(description = "URL") + private String url; + @Schema(description = "请求头") + private List header; + private List query; + private String body; + @Schema(description = "body类型") + private Integer bodyType; +// private List extraParameters; +// private String bodyJson; +// private String bodyXml; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataConfigJsonModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataConfigJsonModel.java new file mode 100644 index 0000000..65b6225 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataConfigJsonModel.java @@ -0,0 +1,23 @@ +package com.yunzhupaas.base.model.datainterface; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class DataConfigJsonModel implements Serializable { + /** + * 静态数据 + */ + private String staticData; + /** + * 静态数据 + */ + private SqlDateModel sqlData; + /** + * 静态数据 + */ + private ApiDateModel apiData; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceActionModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceActionModel.java new file mode 100644 index 0000000..70d7e70 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceActionModel.java @@ -0,0 +1,30 @@ +package com.yunzhupaas.base.model.datainterface; + + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Map; + +/** + * 访问接口参数 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/10 16:48 + */ +@Data +@Schema(description="访问接口参数") +public class DataInterfaceActionModel { + @Schema(description = "租户id") + private String tenantId; + @Schema(description = "认证字符串") + private String authString; + @Schema(description = "接口参数") + private Map map; + @Schema(description = "接口类型") + private String invokType; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceActionVo.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceActionVo.java new file mode 100644 index 0000000..46a5ad7 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceActionVo.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.base.model.datainterface; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 数据接口调用返回模型 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-12-24 + */ +@Data +public class DataInterfaceActionVo implements Serializable { + + private Object data; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceCrForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceCrForm.java new file mode 100644 index 0000000..7478813 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceCrForm.java @@ -0,0 +1,50 @@ +package com.yunzhupaas.base.model.datainterface; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import jakarta.validation.constraints.NotNull; + +@Data +public class DataInterfaceCrForm { + @Schema(description ="编码") + @NotNull(message = "接口编码不能为空") + private String enCode; + @Schema(description ="接口名称") + @NotNull(message = "接口名称不能为空") + private String fullName; + @Schema(description ="分类id") + @NotNull(message = "分类id不能为空") + private String category; + @Schema(description ="数据类型") + @NotNull(message = "数据类型不能为空") + private Integer type; + @Schema(description ="是否分页") + private int hasPage; + @Schema(description ="请求方式") + private int action; + @Schema(description ="排序") + private Long sortCode; + @Schema(description ="状态(0-默认,禁用,1-启用)") + private Integer enabledMark; + @Schema(description ="说明备注") + private String description; + @Schema(description ="字段JSON") + private String fieldJson; + @Schema(description ="参数json") + private String parameterJson; + @Schema(description ="后置接口") + private Integer isPostPosition; + @Schema(description ="数据配置json") + private String dataConfigJson; + @Schema(description ="数据统计json") + private String dataCountJson; + @Schema(description ="数据回显json") + private String dataEchoJson; + @Schema(description ="数据处理json") + private String dataJsJson; + @Schema(description ="异常验证json") + private String dataExceptionJson; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceGetListVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceGetListVO.java new file mode 100644 index 0000000..741b8a4 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceGetListVO.java @@ -0,0 +1,39 @@ +package com.yunzhupaas.base.model.datainterface; + + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * 工作流调用弹框时使用 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-12-24 + */ +@Data +public class DataInterfaceGetListVO implements Serializable { + @Schema(description ="主键Id") + private String id; + @Schema(description ="接口名称") + private String fullName; + @Schema(description ="接口类型") + private String type; +// @Schema(description ="类别") +// private String requestMethod; + @Schema(description ="编码") + private String enCode; + @Schema(description ="请求参数") + private String parameterJson; + @Schema(description ="字段JSON") + private String fieldJson; + @Schema(description ="后置接口") + private Integer isPostPosition; + @Schema(description ="是否真分页:0-不分页,1-分页") + private Integer hasPage; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceInvokeModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceInvokeModel.java new file mode 100644 index 0000000..73c06b7 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceInvokeModel.java @@ -0,0 +1,37 @@ +package com.yunzhupaas.base.model.datainterface; + +import com.yunzhupaas.base.Pagination; +import lombok.Data; + +import java.io.Serializable; +import java.util.Map; + +@Data +public class DataInterfaceInvokeModel implements Serializable { + private String id; + private String tenantId; + private Map map; + private String token; + private Pagination pagination; + private Map showMap; + + public DataInterfaceInvokeModel() { + } + + public DataInterfaceInvokeModel(String id, String tenantId, Map map, String token) { + this.id = id; + this.tenantId = tenantId; + this.map = map; + this.token = token; + } + + public DataInterfaceInvokeModel(String id, String tenantId, Map map, String token, Pagination pagination, Map showMap) { + this.id = id; + this.tenantId = tenantId; + this.map = map; + this.token = token; + this.pagination = pagination; + this.showMap = showMap; + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceListVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceListVO.java new file mode 100644 index 0000000..44b4f20 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceListVO.java @@ -0,0 +1,28 @@ +package com.yunzhupaas.base.model.datainterface; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class DataInterfaceListVO { + @Schema(description ="主键Id") + private String id; + @Schema(description ="接口名称") + private String fullName; + @Schema(description ="接口类型") + private String type; + @Schema(description ="编码") + private String enCode; + @Schema(description ="排序") + private Long sortCode; + @Schema(description ="状态(0-默认,禁用,1-启用)") + private Integer enabledMark; + @Schema(description ="创建时间") + private Long creatorTime; + @Schema(description ="tenantId") + private String tenantId; + @Schema(description ="后置接口") + private Integer isPostPosition; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceLogVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceLogVO.java new file mode 100644 index 0000000..8d52fdf --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceLogVO.java @@ -0,0 +1,43 @@ +package com.yunzhupaas.base.model.datainterface; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 数据接口调用日志 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-06-10 + */ +@Data +public class DataInterfaceLogVO implements Serializable { + + @Schema(description = "主键") + private String id; + + @Schema(description = "调用时间") + private Date invokTime; + + @Schema(description = "用户id") + private String userId; + + @Schema(description = "调用ip") + private String invokIp; + + @Schema(description = "调用设备") + private String invokDevice; + + @Schema(description = "调用类型") + private String invokType; + + @Schema(description = "调用响应时间") + private Integer invokWasteTime; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceMarkModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceMarkModel.java new file mode 100644 index 0000000..a40efde --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceMarkModel.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.base.model.datainterface; + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.io.Serializable; + +@Data +@AllArgsConstructor +public class DataInterfaceMarkModel implements Serializable { + + /** + * 标记名称 + */ + private String markName; + + /** + * 值 + */ + private Object value; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceModel.java new file mode 100644 index 0000000..0b50259 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceModel.java @@ -0,0 +1,43 @@ +package com.yunzhupaas.base.model.datainterface; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * 自定义参数模型 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-12-13 + */ +@Data +public class DataInterfaceModel extends ParamModel implements Serializable { + + /** + * 是否为空(0允许,1不允许) + */ + @Schema(description = "是否为空(0允许,1不允许)") + private Integer required; + + /** + * 参数名称 + */ + @Schema(description = "参数名称") + private String parameter; + /** + * 参数来源 + */ + @Schema(description = "参数来源(1-字段,2-自定义,3-为空,4-系统变量)") + private Integer sourceType = 1; + + /** + * 表单字段 + */ + @Schema(description = "表单字段") + private String relationField; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfacePage.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfacePage.java new file mode 100644 index 0000000..45cffc2 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfacePage.java @@ -0,0 +1,43 @@ +package com.yunzhupaas.base.model.datainterface; + + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import lombok.Data; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class DataInterfacePage extends Pagination { + + //远端接口id + @Schema(description = "远端接口id") + private String interfaceId; + //保存字段 + @Schema(description = "保存字段") + private String propsValue; + //查询字段 + @Schema(description = "查询字段") + private String relationField; + //查询字段(多个) + @Schema(description = "查询字段(多个)") + private String columnOptions; + //数据id + @Schema(description = "数据id") + private String id; + + @Schema(description = "id集合") + private Object ids; + + @Schema(description = "参数集合") + private List paramList; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfacePageModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfacePageModel.java new file mode 100644 index 0000000..a8ebb69 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfacePageModel.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.base.model.datainterface; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +@Schema(description = "分页模型") +public class DataInterfacePageModel implements Serializable { + @Schema(description = "总计SQL") + private String countSql; + @Schema(description = "详情SQL") + private String echoSql; + @Schema(description = "详情路径") + private String echoPath; + @Schema(description = "详情方法") + private String echoReqMethod; + @Schema(description = "详情请求参数") + private List echoReqParameters; + @Schema(description = "详情请求头") + private List echoReqHeaders; + @Schema(description = "分页参数") + private List pageParameters; + @Schema(description = "详情参数") + private List echoParameters; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceParamModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceParamModel.java new file mode 100644 index 0000000..3a0245d --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceParamModel.java @@ -0,0 +1,23 @@ +package com.yunzhupaas.base.model.datainterface; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/6/2 18:09 + */ +@Data +public class DataInterfaceParamModel implements Serializable { + + private String tenantId; + + private String origin; + + private List paramList; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceTreeModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceTreeModel.java new file mode 100644 index 0000000..4ae8df6 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceTreeModel.java @@ -0,0 +1,13 @@ +package com.yunzhupaas.base.model.datainterface; + +import com.yunzhupaas.util.treeutil.SumTree; +import lombok.Data; + +@Data +public class DataInterfaceTreeModel extends SumTree { +// private String id; +// private String parentId; + private String fullName; + private String category; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceTreeVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceTreeVO.java new file mode 100644 index 0000000..3ebe49a --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceTreeVO.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.base.model.datainterface; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +@Data +public class DataInterfaceTreeVO { + @Schema(description ="分类Id") + private String category; + @Schema(description ="接口名称") + private String fullName; + @Schema(description ="主键") + private String id; + @Schema(description ="是否有子集") + private Boolean hasChildren; + @Schema(description ="子集集合") + private List children; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceUpForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceUpForm.java new file mode 100644 index 0000000..7244b79 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceUpForm.java @@ -0,0 +1,8 @@ +package com.yunzhupaas.base.model.datainterface; +import lombok.Data; + +@Data +public class DataInterfaceUpForm extends DataInterfaceCrForm { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceVo.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceVo.java new file mode 100644 index 0000000..7e7d1d3 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/DataInterfaceVo.java @@ -0,0 +1,45 @@ +package com.yunzhupaas.base.model.datainterface; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class DataInterfaceVo { + @Schema(description ="主键id") + private String id; + @Schema(description ="编码") + private String enCode; + @Schema(description ="接口名称") + private String fullName; + @Schema(description ="分类id") + private String category; + @Schema(description ="数据类型") + private Integer type; + @Schema(description ="是否分页") + private Integer hasPage; + @Schema(description ="请求方式") + private Integer action; + @Schema(description ="排序") + private Long sortCode; + @Schema(description ="状态(0-默认,禁用,1-启用)") + private Integer enabledMark; + @Schema(description ="说明备注") + private String description; + @Schema(description ="字段JSON") + private String fieldJson; + @Schema(description ="参数json") + private String parameterJson; + @Schema(description ="后置接口") + private Integer isPostPosition; + @Schema(description ="数据配置json") + private String dataConfigJson; + @Schema(description ="数据统计json") + private String dataCountJson; + @Schema(description ="数据回显json") + private String dataEchoJson; + @Schema(description ="数据处理json") + private String dataJsJson; + @Schema(description ="异常验证json") + private String dataExceptionJson; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/ExtraModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/ExtraModel.java new file mode 100644 index 0000000..9a23726 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/ExtraModel.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.base.model.datainterface; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +@Data +@Schema(description = "分页参数模型") +public class ExtraModel implements Serializable { + @Schema(description = "字段名称") + private String fieldName; + @Schema(description = "字段名") + private String field; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/FieldModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/FieldModel.java new file mode 100644 index 0000000..e83dff4 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/FieldModel.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.base.model.datainterface; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.util.JsonUtil; +import lombok.Data; + +import java.io.Serializable; +import java.util.Objects; + +@Data +public class FieldModel implements Serializable { + @Schema(description = "主键") + private String id; + + @Schema(description = "参数名称") + private String field; + + @Schema(description = "默认值") + private String defaultValue; + + public void setDefaultValue(Object defaultValue) { + if (Objects.isNull(defaultValue) || defaultValue.toString().trim().isEmpty()) return; + this.defaultValue = defaultValue.toString(); + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/HeadModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/HeadModel.java new file mode 100644 index 0000000..a357193 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/HeadModel.java @@ -0,0 +1,14 @@ +package com.yunzhupaas.base.model.datainterface; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class HeadModel extends ParamModel implements Serializable { + + @Schema(description = "来源") + private String source; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/PageParamModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/PageParamModel.java new file mode 100644 index 0000000..41e4fbe --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/PageParamModel.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.base.model.datainterface; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +@Data +@Schema(description = "分页参数模型") +public class PageParamModel implements Serializable { + @Schema(description = "字段名称") + private String fieldName; + @Schema(description = "字段名") + private String field; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/PaginationDataInterface.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/PaginationDataInterface.java new file mode 100644 index 0000000..8265fa9 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/PaginationDataInterface.java @@ -0,0 +1,28 @@ +package com.yunzhupaas.base.model.datainterface; + + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import lombok.Data; + +@Data +public class PaginationDataInterface extends Pagination { + @Schema(description = "分类id") + private String category; + /** + * 请求方式 + */ + @Schema(description = "是否分页 0-不分页 1-分页") + private Integer hasPage; + @Schema(description = "有效标志") + private Integer enabledMark; + @Schema(description = "类型") + private String type; + + /** + * 请求方式 + */ + @Schema(description = "请求方式") + private String dataType; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/PaginationDataInterfaceSelector.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/PaginationDataInterfaceSelector.java new file mode 100644 index 0000000..668a1ac --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/PaginationDataInterfaceSelector.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.base.model.datainterface; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class PaginationDataInterfaceSelector extends Pagination implements Serializable { + /** + * 1 鉴权、真分页、SQL的增加、修改、删除类型 + * 2 鉴权、SQL的增加、修改、删除类型 + * 3 鉴权、真分页、SQL的查询类型 + */ + @Schema(description = "来源类型") + private Integer sourceType; + + @Schema(description = "类型") + private String type; + + @Schema(description = "分类id") + private String category; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/ParamModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/ParamModel.java new file mode 100644 index 0000000..72ec88d --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/ParamModel.java @@ -0,0 +1,27 @@ +package com.yunzhupaas.base.model.datainterface; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class ParamModel extends FieldModel implements Serializable { + + @Schema(description = "列说明") + private String fieldName; + + /** + * 参数类型 + * 字符串 + * 整型 + * 日期时间 + * 浮点 + * 长整型 + * 文本 + */ + @Schema(description = "参数类型") + private String dataType; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/SqlDateModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/SqlDateModel.java new file mode 100644 index 0000000..e25e383 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterface/SqlDateModel.java @@ -0,0 +1,15 @@ +package com.yunzhupaas.base.model.datainterface; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class SqlDateModel implements Serializable { + @Schema(description = "连接id") + private String dbLinkId; + @Schema(description = "SQL") + private String sql; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterfacevariate/DataInterfaceVariateListVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterfacevariate/DataInterfaceVariateListVO.java new file mode 100644 index 0000000..aadc751 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterfacevariate/DataInterfaceVariateListVO.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.base.model.datainterfacevariate; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class DataInterfaceVariateListVO implements Serializable { + private String id; + private String interfaceId; + private String fullName; + private String value; + private String creatorUser; + private Long creatorTime; + private Long lastModifyTime; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterfacevariate/DataInterfaceVariateModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterfacevariate/DataInterfaceVariateModel.java new file mode 100644 index 0000000..85116d7 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterfacevariate/DataInterfaceVariateModel.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.base.model.datainterfacevariate; + +import com.yunzhupaas.util.treeutil.SumTree; +import lombok.Data; + +import jakarta.validation.constraints.NotNull; +import java.io.Serializable; + +@Data +public class DataInterfaceVariateModel extends SumTree implements Serializable { + @NotNull(message = "接口id不能为空") + private String interfaceId; + @NotNull(message = "参数名称不能为空") + private String fullName; + private String expression; + private String value; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterfacevariate/DataInterfaceVariateSelectorVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterfacevariate/DataInterfaceVariateSelectorVO.java new file mode 100644 index 0000000..baab983 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterfacevariate/DataInterfaceVariateSelectorVO.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.base.model.datainterfacevariate; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class DataInterfaceVariateSelectorVO implements Serializable { + private String id; + private String fullName; + private String parentId; + private Integer type; + private List children; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterfacevariate/DataInterfaceVariateVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterfacevariate/DataInterfaceVariateVO.java new file mode 100644 index 0000000..7f921d8 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/datainterfacevariate/DataInterfaceVariateVO.java @@ -0,0 +1,12 @@ +package com.yunzhupaas.base.model.datainterfacevariate; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class DataInterfaceVariateVO extends DataInterfaceVariateModel implements Serializable { + private String id; + private Integer isPostPosition; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DataForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DataForm.java new file mode 100644 index 0000000..3e689ff --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DataForm.java @@ -0,0 +1,15 @@ +package com.yunzhupaas.base.model.dataset; + + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class DataForm { + public List list = new ArrayList<>(); + public String objectType; + public String objectId; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DataSetConfig.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DataSetConfig.java new file mode 100644 index 0000000..005694f --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DataSetConfig.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.base.model.dataset; + +import lombok.Data; + +import java.util.List; + +/** + * 数据转换模型 + * + * @author 云筑产品开发平台组 + * @version v5.0.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/7/15 11:42:03 + */ +@Data +public class DataSetConfig { + private String dataType; + private List options; + private String dictionaryType; + private String propsValue; + private String format; + /** + * 精度位数 + */ + private Integer precision = 0; + /** + * 千位符是否开启 + */ + private boolean thousands; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DataSetForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DataSetForm.java new file mode 100644 index 0000000..781af34 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DataSetForm.java @@ -0,0 +1,57 @@ +package com.yunzhupaas.base.model.dataset; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import lombok.Data; + +import java.io.Serializable; + +@Data +@Schema(description = "数据集合表单") +public class DataSetForm implements Serializable { + + @Schema(description = "主键") + private String id; + + @Schema(description = "关联数据类型") + private String objectType; + + @Schema(description = "关联数据类型") + private String objectId; + + @NotBlank + @Schema(description = "数据集名称") + private String fullName; + + @NotBlank + @Schema(description = "数据库连接") + private String dbLinkId; + + @Schema(description = "数据sql语句") + private String dataConfigJson; + + @Schema(description = "参数json") + private String parameterJson; + + @Schema(description = "字段json") + private String fieldJson; + + @Schema(description = "类型:1-sql语句,2-配置式,3-数据接口") + private Integer type; + + @Schema(description = "配置式json") + private String visualConfigJson; + + @Schema(description = "配置式json") + private String filterConfigJson; + + @Schema(description = "是否分页") + private boolean noPage; + + @Schema(description = "数据id") + private String formId; + + @Schema(description = "数据接口id") + private String interfaceId; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DataSetInfo.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DataSetInfo.java new file mode 100644 index 0000000..fedac32 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DataSetInfo.java @@ -0,0 +1,58 @@ +package com.yunzhupaas.base.model.dataset; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import com.yunzhupaas.util.treeutil.SumTree; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +@Schema(description = "数据集合详情") +public class DataSetInfo implements Serializable { + @Schema(description = "主键") + private String id; + + @Schema(description = "关联数据类型") + private String objectType; + + @Schema(description = "关联数据类型") + private String objectId; + + @NotBlank + @Schema(description = "数据集名称") + private String fullName; + + @NotBlank + @Schema(description = "数据库连接") + private String dbLinkId; + + @Schema(description = "数据sql语句") + private String dataConfigJson; + + @Schema(description = "参数json") + private String parameterJson; + + @Schema(description = "字段json") + private String fieldJson; + + @Schema(description = "类型:1-sql语句,2-配置式,3-数据接口") + private Integer type; + + @Schema(description = "配置式json") + private String visualConfigJson; + + @Schema(description = "配置式json") + private String filterConfigJson; + + @Schema(description = "数据接口名称") + private String treePropsName; + + @Schema(description = "数据接口id") + private String interfaceId; + + @Schema(description = "字段信息") + private List> children; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DataSetOptions.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DataSetOptions.java new file mode 100644 index 0000000..640cfa8 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DataSetOptions.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.base.model.dataset; + +import lombok.Data; + +import java.util.List; +import java.util.Map; + +/** + * 数据转换模型 + * + * @author 云筑产品开发平台组 + * @version v5.0.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/7/15 11:42:03 + */ +@Data +public class DataSetOptions { + private String id; + private String fullName; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DataSetPagination.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DataSetPagination.java new file mode 100644 index 0000000..f5098fe --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DataSetPagination.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.base.model.dataset; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @author 云筑产品开发平台组 + * @version v5.0.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/5/7 11:13:03 + */ +@Data +@Schema(description = "数据集列表参数") +@NoArgsConstructor +public class DataSetPagination extends Pagination { + @Schema(description = "数据集数据类型:参考枚举DataSetTypeEnum") + private String objectType; + @Schema(description = "数据集数据id") + private String objectId; + + + public DataSetPagination(String objectType, String objectId) { + this.objectType = objectType; + this.objectId = objectId; + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DataSetQuery.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DataSetQuery.java new file mode 100644 index 0000000..058365b --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DataSetQuery.java @@ -0,0 +1,44 @@ +package com.yunzhupaas.base.model.dataset; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import lombok.Data; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 打印模板-数查询对象 + * + * @author 云筑产品开发平台组 YY + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-30 + */ +@Data +public class DataSetQuery { + + @NotBlank(message = "必填") + @Schema(description = "打印模板id") + private String id; + + @NotBlank(message = "必填") + @Schema(description = "表单id") + private String formId; + + @Schema(description = "数据来源:打印=printVersion,报表=reportVersion") + private String type; + + private String queryList; + + private String convertConfig; + + private String moduleId; + + private String snowFlakeId; + + @Schema(description = "参数map") + private Map map = new HashMap<>(); +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DataSetSwapModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DataSetSwapModel.java new file mode 100644 index 0000000..ae1c387 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DataSetSwapModel.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.base.model.dataset; + +import lombok.Data; + +/** + * 数据转换模型 + * + * @author 云筑产品开发平台组 + * @version v5.0.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/7/15 11:42:06 + */ +@Data +public class DataSetSwapModel { + private String field; + private String type; + private DataSetConfig config; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DataSetViewInfo.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DataSetViewInfo.java new file mode 100644 index 0000000..97d4a18 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DataSetViewInfo.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.base.model.dataset; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; +import java.util.Map; + +/** + * 数据集预览对象 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/9/10 10:52:52 + */ +@Data +@Schema(description = "数据集预览对象") +public class DataSetViewInfo { + @Schema(description = "字段列表") + private List> previewColumns; + + @Schema(description = "数据列表") + private List> previewData; + + @Schema(description = "数据集预览对象") + private String previewSqlText; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DsConfigFields.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DsConfigFields.java new file mode 100644 index 0000000..7e46cdb --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DsConfigFields.java @@ -0,0 +1,38 @@ +package com.yunzhupaas.base.model.dataset; + +import lombok.Data; + +/** + * 配置式字段属性 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/9/9 17:27:00 + */ +@Data +public class DsConfigFields { + /** + * 字段名 + */ + private String field; + /** + * 字段备注 + */ + private String fieldName; + /** + * 字段类型 + */ + private String dataType; + + //一下用于组装sql + /** + * 表名 + */ + private String table; + /** + * 字段别名 + */ + private String fieldAlias; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DsConfigModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DsConfigModel.java new file mode 100644 index 0000000..9878371 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DsConfigModel.java @@ -0,0 +1,59 @@ +package com.yunzhupaas.base.model.dataset; + +import com.yunzhupaas.database.model.superQuery.SuperQueryJsonModel; +import lombok.Data; + +import java.util.List; + +/** + * 数据集配置式属性 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/9/9 17:23:57 + */ +@Data +public class DsConfigModel { + /** + * 父级表名 + */ + private String parentTable; + /** + * 表名 + */ + private String table; + /** + * 表备注 + */ + private String tableName; + /** + * 表别名 + */ + private String tableAlias; + /** + * 字段列表 + */ + private List fieldList; + + /** + * 条件筛选 + */ + private String matchLogic; + + /** + * 条件组 + */ + private List ruleList; + + /** + * 关联关系 + */ + private DsRelationConfig relationConfig; + + /** + * 上级表名 + */ + private List children; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DsParamModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DsParamModel.java new file mode 100644 index 0000000..2b7b494 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DsParamModel.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.base.model.dataset; + +import lombok.Builder; +import lombok.Data; + +import java.util.List; +import java.util.Map; + +/** + * 参数对象 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/9/13 10:12:33 + */ +@Data +@Builder +public class DsParamModel { + + private String dbType; + private Map systemParam; + private List values; + private String filterConfigJson; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DsRelationConfig.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DsRelationConfig.java new file mode 100644 index 0000000..b474262 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DsRelationConfig.java @@ -0,0 +1,36 @@ +package com.yunzhupaas.base.model.dataset; + +import com.yunzhupaas.database.model.superQuery.SuperQueryJsonModel; +import lombok.Data; + +import java.util.List; + +/** + * 连接属性 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/9/9 17:22:53 + */ +@Data +public class DsRelationConfig { + + /** + * 关联关系:1-左连接,2-右连接,3-内连接,4-全连接 + */ + private Integer type; + /** + * 关联字段列表 + */ + private List relationList; + /** + * 条件筛选:且或 + */ + private String matchLogic; + /** + * 条件组 + */ + private List ruleList; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DsRelationModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DsRelationModel.java new file mode 100644 index 0000000..072c87a --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/DsRelationModel.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.base.model.dataset; + +import lombok.Data; + +/** + * 关联字段属性 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/9/9 17:22:21 + */ +@Data +public class DsRelationModel { + /** + * 左表字段 + */ + private String pField; + /** + * 右表字段 + */ + private String field; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/TableTreeModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/TableTreeModel.java new file mode 100644 index 0000000..cbd414d --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dataset/TableTreeModel.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.base.model.dataset; + +import com.yunzhupaas.util.treeutil.SumTree; +import lombok.Data; + +/** + * 类功能 + * + * @author 云筑产品开发平台组 + * @version V3.3 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-07-22 + */ +@Data +public class TableTreeModel extends SumTree { + + private String fullName; + + private String label; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dbbackup/DbBackupListVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dbbackup/DbBackupListVO.java new file mode 100644 index 0000000..29a17bf --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dbbackup/DbBackupListVO.java @@ -0,0 +1,32 @@ +package com.yunzhupaas.base.model.dbbackup; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class DbBackupListVO { + + @Schema(description = "备份主键") + private String id; + + @Schema(description = "文件名称") + private String fileName; + + @Schema(description = "文件大小") + private String fileSize; + + @Schema(description = "创建时间",example = "1") + private Long creatorTime; + + @Schema(description = "文件访问地址") + private String fileUrl; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dblink/DbLinkBaseForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dblink/DbLinkBaseForm.java new file mode 100644 index 0000000..f0c526f --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dblink/DbLinkBaseForm.java @@ -0,0 +1,103 @@ +package com.yunzhupaas.base.model.dblink; + +import cn.hutool.json.JSONUtil; +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.database.model.entity.DbLinkEntity; +import com.yunzhupaas.database.source.impl.DbOracle; +import com.yunzhupaas.util.DesUtil; +import com.yunzhupaas.util.JsonUtil; +import lombok.Data; + +import jakarta.validation.constraints.NotBlank; +import java.util.HashMap; +import java.util.Map; + +/** + * 数据库基础表单对象 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class DbLinkBaseForm { + + /** + * 排序码 + */ + @Schema(description = "排序码") + private long sortCode; + + @Schema(description = "连接名") + @NotBlank(message = "必填") + private String fullName; + + @Schema(description = "数据库类型编码") + @NotBlank(message = "必填") + private String dbType; + + @Schema(description = "用户") + @NotBlank(message = "必填") + private String userName; + + @Schema(description = "数据库名") + private String serviceName; + + @Schema(description = "密码") + @NotBlank(message = "必填") + private String password; + + @Schema(description = "端口") + @NotBlank(message = "必填") + private String port; + + @Schema(description = "ip地址") + @NotBlank(message = "必填") + private String host; + + @Schema(description = "模式") + private String dbSchema; + + @Schema(description = "表空间") + private String tableSpace; + + @Schema(description = "oracle扩展(true:开启,false:关闭)") + private Boolean oracleExtend; + + @Schema(description = "oracle连接类型") + private String oracleLinkType; + + @Schema(description = "oracle服务名") + private String oracleService; + + @Schema(description = "oracle角色") + private String oracleRole; + + + + /** + * 根据表单对象返回连接实体类 + * @param dbLinkBaseForm 连接表单对象 + * @return 连接实体对象 + */ + public DbLinkEntity getDbLinkEntity(DbLinkBaseForm dbLinkBaseForm){ + DbLinkEntity entity = JsonUtil.getJsonToBean(dbLinkBaseForm, DbLinkEntity.class); + entity.setPassword(DesUtil.aesOrDecode(entity.getPassword(), false, true)); + if (dbLinkBaseForm.getOracleExtend() != null && dbLinkBaseForm.getOracleExtend()) { + entity.setOracleExtend(1); + } else { + entity.setOracleExtend(0); + } + entity.setDbTableSpace(dbLinkBaseForm.getTableSpace()); + entity.setDbName(dbLinkBaseForm.getServiceName()); + Map oracleParam = new HashMap<>(16); + oracleParam.put(DbOracle.ORACLE_LINK_TYPE,dbLinkBaseForm.getOracleLinkType()); + oracleParam.put(DbOracle.ORACLE_SERVICE,dbLinkBaseForm.getOracleService()); + oracleParam.put(DbOracle.ORACLE_ROLE,dbLinkBaseForm.getOracleRole()); + entity.setOracleParam(JSONUtil.toJsonStr(oracleParam)); + return entity; + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dblink/DbLinkCreUpForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dblink/DbLinkCreUpForm.java new file mode 100644 index 0000000..48618e6 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dblink/DbLinkCreUpForm.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.base.model.dblink; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import jakarta.validation.constraints.NotNull; + +/** + * 数据连接表单对象 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class DbLinkCreUpForm extends DbLinkBaseForm{ + + @Schema(description = "有效标识") + @NotNull(message = "必填") + private boolean enabledMark; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dblink/DbLinkInfoVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dblink/DbLinkInfoVO.java new file mode 100644 index 0000000..e63003c --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dblink/DbLinkInfoVO.java @@ -0,0 +1,50 @@ +package com.yunzhupaas.base.model.dblink; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.database.model.entity.DbLinkEntity; +import com.yunzhupaas.database.source.impl.DbOracle; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.util.*; +import lombok.Data; + +import java.util.Map; + +/** + * 页面显示对象 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class DbLinkInfoVO extends DbLinkBaseForm { + + /** + * 获取连接页面显示对象 + * @param entity 连接实体对象 + * @return 返回显示对象 + * @throws DataException ignore + */ + public DbLinkInfoVO getDbLinkInfoVO(DbLinkEntity entity) throws DataException { + DbLinkInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, DbLinkInfoVO.class); + vo.setPassword(DesUtil.aesOrDecode(vo.getPassword(), true, true)); + vo.setServiceName(XSSEscape.escape(entity.getDbName())); + vo.setTableSpace(XSSEscape.escape(entity.getDbTableSpace())); + vo.setOracleExtend(entity.getOracleExtend() != null && entity.getOracleExtend() == 1); + if(StringUtil.isNotEmpty(entity.getOracleParam())){ + Map oracleParam = JsonUtil.stringToMap(entity.getOracleParam()); + if(oracleParam.size() > 0){ + vo.setOracleLinkType(oracleParam.get(DbOracle.ORACLE_LINK_TYPE) != null ? oracleParam.get(DbOracle.ORACLE_LINK_TYPE).toString() : null); + vo.setOracleRole(oracleParam.get(DbOracle.ORACLE_ROLE) != null ? oracleParam.get(DbOracle.ORACLE_ROLE).toString() : null); + vo.setOracleService(oracleParam.get(DbOracle.ORACLE_SERVICE) != null ? oracleParam.get(DbOracle.ORACLE_SERVICE).toString() : null); + } + } + return vo; + } + + @Schema(description = "主键") + private String id; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dblink/DbLinkListVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dblink/DbLinkListVO.java new file mode 100644 index 0000000..01c47bc --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dblink/DbLinkListVO.java @@ -0,0 +1,46 @@ +package com.yunzhupaas.base.model.dblink; + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class DbLinkListVO { + @Schema(description = "连接名称") + private String fullName; + @Schema(description = "连接驱动") + private String dbType; + @Schema(description = "主机名称") + private String host; + @Schema(description = "端口") + private String port; + @Schema(description = "创建时间",example = "1") + private Long creatorTime; + @Schema(description = "创建人") + @JSONField(name = "creatorUserId") + private String creatorUser; + @Schema(description = "主键") + private String id; + @Schema(description = "修改时间") + private Long lastModifyTime; + @Schema(description = "修改用户") + @JSONField(name = "lastModifyUserId") + private String lastModifyUser; + @Schema(description = "有效标志") + private Integer enabledMark; + @Schema(description = "排序码") + private Long sortCode; + @Schema(description = "数据库名") + private String dbName; + @Schema(description = "用户名") + private String userName; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dblink/DbLinkModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dblink/DbLinkModel.java new file mode 100644 index 0000000..f2a750c --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dblink/DbLinkModel.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.base.model.dblink; + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.util.treeutil.SumTree; +import lombok.Data; + +@Data +public class DbLinkModel extends SumTree { + private String fullName; + private String dbType; + private String host; + private String port; + private Long creatorTime; + @JSONField(name = "creatorUserId") + private String creatorUser; + private String id; + private Long lastModifyTime; + @JSONField(name = "lastModifyUserId") + private String lastModifyUser; + private Integer enabledMark; + private Long sortCode; + private Long num; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dblink/DbLinkSelectorListVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dblink/DbLinkSelectorListVO.java new file mode 100644 index 0000000..83ec942 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dblink/DbLinkSelectorListVO.java @@ -0,0 +1,47 @@ +package com.yunzhupaas.base.model.dblink; + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class DbLinkSelectorListVO { + @Schema(description = "连接名称") + private String fullName; + @Schema(description = "连接驱动") + private String dbType; + @Schema(description = "主机名称") + private String host; + @Schema(description = "端口") + private String port; + @Schema(description = "创建时间",example = "1") + private Long creatorTime; + @Schema(description = "创建人") + @JSONField(name = "creatorUserId") + private String creatorUser; + @Schema(description = "主键") + private String id; + @Schema(description = "修改时间") + private Long lastModifyTime; + @Schema(description = "修改用户") + @JSONField(name = "lastModifyUserId") + private String lastModifyUser; + @Schema(description = "有效标志") + private Integer enabledMark; + @Schema(description = "排序码") + private Long sortCode; + @Schema(description = "数量") + private Long num; + @Schema(description = "子节点") + private List children; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dblink/PaginationDbLink.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dblink/PaginationDbLink.java new file mode 100644 index 0000000..b2dcc20 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dblink/PaginationDbLink.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.base.model.dblink; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import lombok.Data; + +/** + * 数据连接分页 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-11-20 + */ +@Data +public class PaginationDbLink extends Pagination { + + @Schema(description = "数据库类型") + private String dbType; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dbsync/DbSyncForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dbsync/DbSyncForm.java new file mode 100644 index 0000000..85d9fb2 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dbsync/DbSyncForm.java @@ -0,0 +1,37 @@ +package com.yunzhupaas.base.model.dbsync; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import jakarta.validation.constraints.NotBlank; +import java.util.List; +import java.util.Map; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class DbSyncForm { + @NotBlank(message = "必填") + @Schema(description = "被同步库连接") + private String dbConnectionFrom; + @NotBlank(message = "必填") + @Schema(description = "同步至库连接") + private String dbConnectionTo; + @NotBlank(message = "必填") + @Schema(description = "单个同步表名") + private String dbTable; + @Schema(description = "批量同步表名集合") + private List dbTableList; + @Schema(description = "被转换库名") + private String dbNameFrom; + @Schema(description = "转换库名") + private String dbNameTo; + @Schema(description = "转换规则") + private Map convertRuleMap; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dbsync/DbSyncPrintForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dbsync/DbSyncPrintForm.java new file mode 100644 index 0000000..0ea7ae3 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dbsync/DbSyncPrintForm.java @@ -0,0 +1,43 @@ +package com.yunzhupaas.base.model.dbsync; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.experimental.Accessors; + +import jakarta.validation.constraints.NotBlank; +import java.util.List; +import java.util.Map; + +/** + * 类功能 + * + * @author 云筑产品开发平台组 + * @version v3.4.5 + * @copyrignt 深圳市乐程软件有限公司 + * @date 2023-01-05 + */ +@Data +@Accessors(chain = true) +public class DbSyncPrintForm { + + @NotBlank + @Schema(description = "被同步库连接") + private String dbLinkFrom; + @Schema(description = "同步至库类型") + private String dbTypeTo; + @Schema(description = "批量同步表名集合") + private List dbTableList; + @Schema(description = "转换规则") + private Map convertRuleMap; + @Schema(description = "输出路径") + private String outPath; + @Schema(description = "输出路径") + private String outFileName; + @Schema(description = "打印类型") + private String printType; + @Schema(description = "多表开关") + private Boolean multiTabFlag; + + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dbsync/DbSyncVo.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dbsync/DbSyncVo.java new file mode 100644 index 0000000..0b58998 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dbsync/DbSyncVo.java @@ -0,0 +1,36 @@ +package com.yunzhupaas.base.model.dbsync; + +import com.yunzhupaas.database.model.dbtable.DbTableFieldModel; +import lombok.Data; + +import java.util.List; +import java.util.Map; + +/** + * 类功能 + * + * @author 云筑产品开发平台组 + * @version V3.3 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-06-01 + */ +@Data +public class DbSyncVo { + + /** + * 验证结果 + */ + private Boolean checkDbFlag; + + /** + * 表集合 + */ + private List tableList; + + /** + * 转换规则 + */ + private Map> convertRuleMap; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dbtable/dto/DbTableFieldDTO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dbtable/dto/DbTableFieldDTO.java new file mode 100644 index 0000000..8b58bea --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dbtable/dto/DbTableFieldDTO.java @@ -0,0 +1,90 @@ +package com.yunzhupaas.base.model.dbtable.dto; + +import cn.hutool.core.util.ObjectUtil; +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.model.dbtable.form.DbFieldForm; +import com.yunzhupaas.base.model.dbtable.form.DbTableForm; +import com.yunzhupaas.database.constant.DbAliasConst; +import com.yunzhupaas.database.model.dbfield.DbFieldModel; +import com.yunzhupaas.database.model.dbtable.DbTableFieldModel; +import com.yunzhupaas.exception.DataException; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 建表参数对象 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class DbTableFieldDTO { + + @Schema(description = "表基本信息") + private DbTableForm tableInfo; + + @Schema(description = "字段信息") + private List tableFieldList; + + /** + * 获取表模型 + * + * @param dbLinkId 数据库连接Id + * @return 表模型 + */ + public DbTableFieldModel getCreDbTableModel(String dbLinkId){ + String table = this.getTableInfo().getNewTable(); + return toCommon(table, null, null, dbLinkId); + } + + public DbTableFieldModel getUpDbTableModel(String dbLinkId){ + // 更新时用表 + String oldTable = this.getTableInfo().getTable(); + String newTable = this.getTableInfo().getNewTable(); + return toCommon(null, oldTable, newTable, dbLinkId); + } + + private DbTableFieldModel toCommon(String table, String oldTable, String newTable, String dbLinkId) throws DataException { + DbTableFieldModel dbTableModel = new DbTableFieldModel(); + DbTableForm dbTableForm = this.getTableInfo(); + // 数据连接Id + dbTableModel.setDbLinkId(dbLinkId); + // 创建表名 + dbTableModel.setTable(table); + // 更新时表名 + dbTableModel.setUpdateOldTable(oldTable); + dbTableModel.setUpdateNewTable(newTable); + // 表注释 + dbTableModel.setComment(dbTableForm.getTableName()); + // 表字段集合 + List list = new ArrayList<>(); + for (DbFieldForm dbFieldForm : this.getTableFieldList()) { + // 字段 + DbFieldModel dbFieldModel = new DbFieldModel(); + // 字段名 + dbFieldModel.setField(dbFieldForm.getField()); + // 字段注释 + dbFieldModel.setComment(dbFieldForm.getFieldName()); + // 主键 + dbFieldModel.setIsPrimaryKey(dbFieldForm.getPrimaryKey() == 1); + // 非空 + dbFieldModel.setNullSign(DbAliasConst.ALLOW_NULL.getSign(dbFieldForm.getAllowNull())); + // 数据类型 + dbFieldModel.setLength(dbFieldForm.getDataLength()); + dbFieldModel.setDataType(dbFieldForm.getDataType()); + dbFieldModel.setIsAutoIncrement(ObjectUtil.equal(dbFieldForm.getAutoIncrement(), 1)); + if (dbFieldModel.getIsAutoIncrement() && (!"int".equals(dbFieldForm.getDataType()) && !"bigint".equals(dbFieldForm.getDataType()))) { + throw new DataException("自增长ID字段数据类型必须为整形或长整型"); + } + list.add(dbFieldModel); + } + dbTableModel.setDbFieldModelList(list); + return dbTableModel; + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dbtable/form/DbFieldForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dbtable/form/DbFieldForm.java new file mode 100644 index 0000000..585327e --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dbtable/form/DbFieldForm.java @@ -0,0 +1,59 @@ +package com.yunzhupaas.base.model.dbtable.form; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; + +/** + * 表字段表单信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class DbFieldForm { + + @NotBlank(message = "必填") + @Schema(description = "字段名") + private String field; + + @NotBlank(message = "必填") + @Schema(description = "字段说明") + private String fieldName; + + @NotBlank(message = "必填") + @Schema(description = "数据类型") + private String dataType; + + @NotBlank(message = "必填") + @Schema(description = "数据长度") + private String dataLength; + + @NotNull(message = "必填") + @Schema(description = "允许空") + private Integer allowNull; + + @NotBlank(message = "必填") + @Schema(description = "插入位置") + private String index; + + @Schema(description = "主键") + private Integer primaryKey; + +// @JsonIgnore + @Schema(description = "是否自增 内部使用") + private Integer autoIncrement; + + @Schema(description = "是否自增") + private Integer identity; + + public Integer getAutoIncrement() { + return this.identity; + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dbtable/form/DbTableForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dbtable/form/DbTableForm.java new file mode 100644 index 0000000..a7d3e30 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dbtable/form/DbTableForm.java @@ -0,0 +1,30 @@ +package com.yunzhupaas.base.model.dbtable.form; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import jakarta.validation.constraints.NotBlank; + +/** + * 表信息表单信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class DbTableForm { + + @Schema(description = "表名") + private String table; + + @NotBlank(message = "必填") + @Schema(description = "表说明") + private String tableName; + + @Schema(description = "新表名") + private String newTable; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dbtable/vo/DbFieldVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dbtable/vo/DbFieldVO.java new file mode 100644 index 0000000..1b635a3 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dbtable/vo/DbFieldVO.java @@ -0,0 +1,53 @@ +package com.yunzhupaas.base.model.dbtable.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.database.constant.DbAliasConst; +import com.yunzhupaas.database.datatype.viewshow.constant.DtViewConst; +import com.yunzhupaas.database.model.dbfield.DbFieldModel; +import com.yunzhupaas.util.StringUtil; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +@NoArgsConstructor +public class DbFieldVO { + @Schema(description = "数据库字段名") + private String columnName; + + @Schema(description = "字段名") + private String field; + @Schema(description = "字段说明") + private String fieldName; + @Schema(description = "数据类型") + private String dataType; + @Schema(description = "数据长度") + private String dataLength; + @Schema(description = "主键") + private Integer primaryKey; + @Schema(description = "允空") + private Integer allowNull; + @Schema(description = "自增标识 1:是 0:否") + private Integer autoIncrement; + @Schema(description = "自增标识") + private Integer identity; + + public DbFieldVO(DbFieldModel dbFieldModel){ + this.field = dbFieldModel.getField(); + this.fieldName = dbFieldModel.getComment(); + this.dataType = dbFieldModel.getDataType(); + this.dataLength = StringUtil.isNotEmpty(dbFieldModel.getLength()) ? dbFieldModel.getLength() : DtViewConst.DEFAULT;; + this.primaryKey = DbAliasConst.PRIMARY_KEY.getNum(dbFieldModel.getIsPrimaryKey()); + this.allowNull = DbAliasConst.ALLOW_NULL.getNum(dbFieldModel.getNullSign()); + this.autoIncrement = DbAliasConst.AUTO_INCREMENT.getNum(dbFieldModel.getIsAutoIncrement()); + this.identity = DbAliasConst.AUTO_INCREMENT.getNum(dbFieldModel.getIsAutoIncrement()); + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dbtable/vo/DbTableInfoVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dbtable/vo/DbTableInfoVO.java new file mode 100644 index 0000000..fc04ac2 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dbtable/vo/DbTableInfoVO.java @@ -0,0 +1,43 @@ +package com.yunzhupaas.base.model.dbtable.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.database.model.dbfield.DbFieldModel; +import com.yunzhupaas.database.model.dbtable.DbTableFieldModel; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +@NoArgsConstructor +public class DbTableInfoVO { + + @Schema(description = "表信息") + private DbTableVO tableInfo; + @Schema(description = "字段信息集合") + private List tableFieldList; + @Schema(description = "表是否存在信息") + private Boolean hasTableData; + + public DbTableInfoVO(DbTableFieldModel dbTableModel, List dbFieldModelList){ + if(dbTableModel != null){ + List list = new ArrayList<>(); + for (DbFieldModel dbFieldModel : dbFieldModelList) { + list.add(new DbFieldVO(dbFieldModel)); + } + this.tableFieldList = list; + this.tableInfo = new DbTableVO(dbTableModel); + this.hasTableData = dbTableModel.getHasTableData(); + } + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dbtable/vo/DbTableListVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dbtable/vo/DbTableListVO.java new file mode 100644 index 0000000..22b7b2f --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dbtable/vo/DbTableListVO.java @@ -0,0 +1,32 @@ +package com.yunzhupaas.base.model.dbtable.vo; + +import com.yunzhupaas.base.vo.PaginationVO; +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.util.List; + +/** + * 表列表返回对象 + * + * @author 云筑产品开发平台组 + * @version v3.4.8 + * @copyrignt 深圳市乐程软件有限公司 + * @date 2023-03-16 + */ +@Data +@AllArgsConstructor +public class DbTableListVO { + + /** + * 数据集合 + */ + private List list; + + /** + * 分页信息 + */ + PaginationVO pagination; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dbtable/vo/DbTableVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dbtable/vo/DbTableVO.java new file mode 100644 index 0000000..f02cba6 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dbtable/vo/DbTableVO.java @@ -0,0 +1,34 @@ +package com.yunzhupaas.base.model.dbtable.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.database.model.dbtable.DbTableFieldModel; +import lombok.Data; +import lombok.NoArgsConstructor; + +import jakarta.validation.constraints.NotBlank; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +@NoArgsConstructor +public class DbTableVO { + + @NotBlank(message = "必填") + @Schema(description = "表名") + private String table; + @NotBlank(message = "必填") + @Schema(description = "表注释") + private String tableName; + + public DbTableVO(DbTableFieldModel dbTableFieldModel){ + this.table = dbTableFieldModel.getTable(); + this.tableName = dbTableFieldModel.getComment(); + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarydata/DictionaryDataAllModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarydata/DictionaryDataAllModel.java new file mode 100644 index 0000000..d3a0ad1 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarydata/DictionaryDataAllModel.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.base.model.dictionarydata; + +import com.yunzhupaas.util.treeutil.SumTree; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class DictionaryDataAllModel extends SumTree { + private String fullName; + private String enCode; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarydata/DictionaryDataAllVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarydata/DictionaryDataAllVO.java new file mode 100644 index 0000000..93fbe57 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarydata/DictionaryDataAllVO.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.base.model.dictionarydata; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Data; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +public class DictionaryDataAllVO { + private String id; + private String fullName; + private String parentId; + private String enCode; + private List children; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarydata/DictionaryDataCrForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarydata/DictionaryDataCrForm.java new file mode 100644 index 0000000..61a89fb --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarydata/DictionaryDataCrForm.java @@ -0,0 +1,38 @@ +package com.yunzhupaas.base.model.dictionarydata; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import jakarta.validation.constraints.NotBlank; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class DictionaryDataCrForm { + @NotBlank(message = "必填") + @Schema(description = "项目代码") + private String enCode; + + @Schema(description = "有效标志") + private Integer enabledMark; + + @NotBlank(message = "必填") + @Schema(description = "上级项目名称") + private String fullName; + + @Schema(description = "说明") + private String description; + + @NotBlank(message = "必填") + @Schema(description = "上级id,没有传0") + private String parentId; + @Schema(description = "分类id") + private String dictionaryTypeId; + @Schema(description = "排序码") + private long sortCode; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarydata/DictionaryDataExportModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarydata/DictionaryDataExportModel.java new file mode 100644 index 0000000..6d3948b --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarydata/DictionaryDataExportModel.java @@ -0,0 +1,103 @@ +package com.yunzhupaas.base.model.dictionarydata; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 数据字典数据模板 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-06-11 + */ +@Data +public class DictionaryDataExportModel implements Serializable { + /** + * 主键 + */ + private String id; + + /** + * 上级 + */ + private String parentId; + + /** + * 名称 + */ + private String fullName; + + /** + * 编码 + */ + private String enCode; + + /** + * 拼音 + */ + private String simpleSpelling; + + /** + * 默认 + */ + private Integer isDefault; + + /** + * 描述 + */ + private String description; + + /** + * 排序码 + */ + private Long sortCode; + + /** + * 有效标志 + */ + private Integer enabledMark; + + /** + * 创建时间 + */ + private Date creatorTime; + + /** + * 创建用户 + */ + private String creatorUserId; + + /** + * 修改时间 + */ + private Date lastModifyTime; + + /** + * 修改用户 + */ + private String lastModifyUserId; + + /** + * 删除标志 + */ + private Integer deleteMark; + + /** + * 删除时间 + */ + private Date deleteTime; + + /** + * 删除用户 + */ + private String deleteUserId; + + /** + * 类别主键 + */ + private String dictionaryTypeId; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarydata/DictionaryDataInfoVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarydata/DictionaryDataInfoVO.java new file mode 100644 index 0000000..bc8af2b --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarydata/DictionaryDataInfoVO.java @@ -0,0 +1,32 @@ +package com.yunzhupaas.base.model.dictionarydata; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class DictionaryDataInfoVO { + @Schema(description = "主键") + private String id; + @Schema(description = "父级主键") + private String parentId; + @Schema(description = "说明") + private String description; + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "有效标志") + private Integer enabledMark; + @Schema(description = "分类id") + private String dictionaryTypeId; + @Schema(description = "排序码") + private long sortCode; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarydata/DictionaryDataListTreeVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarydata/DictionaryDataListTreeVO.java new file mode 100644 index 0000000..7d354d3 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarydata/DictionaryDataListTreeVO.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.base.model.dictionarydata; + +import lombok.Data; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class DictionaryDataListTreeVO { + private String id; + private String parentId; + private Boolean hasChildren; + private List children; + private String fullName; + private String enCode; + private Integer enabledMark; + private Long sortCode; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarydata/DictionaryDataListVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarydata/DictionaryDataListVO.java new file mode 100644 index 0000000..61d4263 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarydata/DictionaryDataListVO.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.base.model.dictionarydata; + +import lombok.Data; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class DictionaryDataListVO { + private String id; + private String fullName; + private String enCode; + private Integer enabledMark; + private Boolean hasChildren; + private String parentId; + private List children; + private Long sortCode; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarydata/DictionaryDataModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarydata/DictionaryDataModel.java new file mode 100644 index 0000000..d452590 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarydata/DictionaryDataModel.java @@ -0,0 +1,23 @@ +package com.yunzhupaas.base.model.dictionarydata; + +import com.yunzhupaas.util.treeutil.SumTree; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class DictionaryDataModel extends SumTree { + private String id; + private String parentId; + private String fullName; + private String enCode; + private Integer enabledMark; + private String icon; + private long sortCode; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarydata/DictionaryDataSelectVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarydata/DictionaryDataSelectVO.java new file mode 100644 index 0000000..efa7d93 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarydata/DictionaryDataSelectVO.java @@ -0,0 +1,34 @@ +package com.yunzhupaas.base.model.dictionarydata; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +public class DictionaryDataSelectVO { + @Schema(description = "主键") + private String id; + @Schema(description = "父级主键") + private String parentId; + @Schema(description = "是否有子集") + private Boolean hasChildren; + @Schema(description = "子集集合") + private List children; + @Schema(description = "名称") + private String fullName; + @Schema(description = "图标") + private String icon; + @Schema(description = "分类id") + private String dictionaryTypeId; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarydata/DictionaryDataUpForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarydata/DictionaryDataUpForm.java new file mode 100644 index 0000000..27b139a --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarydata/DictionaryDataUpForm.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.base.model.dictionarydata; + +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class DictionaryDataUpForm extends DictionaryDataCrForm{ + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarydata/PageDictionaryData.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarydata/PageDictionaryData.java new file mode 100644 index 0000000..6f3dc6c --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarydata/PageDictionaryData.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.base.model.dictionarydata; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Page; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class PageDictionaryData extends Page { + @Schema(description = "是否树形") + private String isTree; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarytype/DictionaryExportModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarytype/DictionaryExportModel.java new file mode 100644 index 0000000..f7b9a2d --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarytype/DictionaryExportModel.java @@ -0,0 +1,33 @@ +package com.yunzhupaas.base.model.dictionarytype; + +import com.yunzhupaas.base.entity.DictionaryTypeEntity; +import com.yunzhupaas.base.model.dictionarydata.DictionaryDataExportModel; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 数据字典导入导出模板 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-06-11 + */ +@Data +public class DictionaryExportModel implements Serializable { + + /** + * 字典分类 + */ + private List list = new ArrayList<>(); + + /** + * 数据集合 + */ + private List modelList = new ArrayList<>(); + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarytype/DictionaryTypeCrForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarytype/DictionaryTypeCrForm.java new file mode 100644 index 0000000..93dab3a --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarytype/DictionaryTypeCrForm.java @@ -0,0 +1,37 @@ +package com.yunzhupaas.base.model.dictionarytype; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.hibernate.validator.constraints.NotBlank; + +import jakarta.validation.constraints.NotNull; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class DictionaryTypeCrForm { + @Schema(description = "父级主键") + @org.hibernate.validator.constraints.NotBlank(message = "必填") + private String parentId; + @Schema(description = "名称") + @org.hibernate.validator.constraints.NotBlank(message = "必填") + private String fullName; + @Schema(description = "编码") + @NotBlank(message = "必填") + private String enCode; + @Schema(description = "是否树形") + @NotNull(message = "必填") + private Integer isTree; + @Schema(description = "说明") + private String description; + @Schema(description = "排序码") + private long sortCode; + @Schema(description = "类型") + private Integer category; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarytype/DictionaryTypeInfoVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarytype/DictionaryTypeInfoVO.java new file mode 100644 index 0000000..40a9629 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarytype/DictionaryTypeInfoVO.java @@ -0,0 +1,32 @@ +package com.yunzhupaas.base.model.dictionarytype; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class DictionaryTypeInfoVO { + @Schema(description = "主键") + private String id; + @Schema(description = "父级主键") + private String parentId; + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "是否树形") + private Integer isTree; + @Schema(description = "说明") + private String description; + @Schema(description = "排序码") + private long sortCode; + @Schema(description = "类型") + private Integer category; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarytype/DictionaryTypeListVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarytype/DictionaryTypeListVO.java new file mode 100644 index 0000000..7432edf --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarytype/DictionaryTypeListVO.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.base.model.dictionarytype; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class DictionaryTypeListVO { + @Schema(description = "主键") + private String id; + @Schema(description = "父级id") + private String parentId; + @Schema(description = "是否有下级") + private Boolean hasChildren; + @Schema(description = "是否为树") + private Integer isTree; + @Schema(description = "子集集合") + private List children = new ArrayList<>(); + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "排序码") + private long sortCode; + @Schema(description = "类型") + private String category; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarytype/DictionaryTypeModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarytype/DictionaryTypeModel.java new file mode 100644 index 0000000..e1da660 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarytype/DictionaryTypeModel.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.base.model.dictionarytype; + +import com.yunzhupaas.util.treeutil.SumTree; +import lombok.Data; + +@Data +public class DictionaryTypeModel extends SumTree { + private String id; + private String parentId; + private String fullName; + private Integer isTree; + private String enCode; + private long sortCode; + private String category; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarytype/DictionaryTypeSelectModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarytype/DictionaryTypeSelectModel.java new file mode 100644 index 0000000..e0883d5 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarytype/DictionaryTypeSelectModel.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.base.model.dictionarytype; + +import com.yunzhupaas.util.treeutil.SumTree; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class DictionaryTypeSelectModel extends SumTree { + private String id; + private String parentId; + private String fullName; + private String enCode; + private String sortCode; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarytype/DictionaryTypeSelectVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarytype/DictionaryTypeSelectVO.java new file mode 100644 index 0000000..0ed3b93 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarytype/DictionaryTypeSelectVO.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.base.model.dictionarytype; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class DictionaryTypeSelectVO { + @Schema(description = "主键") + private String id; + @Schema(description = "父级主键") + private String parentId; + @Schema(description = "是否有子集") + private Boolean hasChildren; + @Schema(description = "子集集合") + private List children = new ArrayList<>(); + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarytype/DictionaryTypeUpForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarytype/DictionaryTypeUpForm.java new file mode 100644 index 0000000..595333f --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/dictionarytype/DictionaryTypeUpForm.java @@ -0,0 +1,15 @@ +package com.yunzhupaas.base.model.dictionarytype; + +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class DictionaryTypeUpForm extends DictionaryTypeCrForm { +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/form/FormBatchForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/form/FormBatchForm.java new file mode 100644 index 0000000..8acf246 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/form/FormBatchForm.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.base.model.form; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import jakarta.validation.constraints.NotBlank; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-14 + */ +@Data +public class FormBatchForm { + @Schema(description = "菜单id") + @NotBlank(message = "必填") + private String moduleId; + @Schema(description = "数据") + private Object formJson; + @Schema(description = "排序码") + private Long sortCode; + @Schema(description = "规则") + private Integer fieldRule; + @Schema(description = "绑定表") + private String bindTable; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/form/ModuleFormCrForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/form/ModuleFormCrForm.java new file mode 100644 index 0000000..e3cb044 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/form/ModuleFormCrForm.java @@ -0,0 +1,39 @@ +package com.yunzhupaas.base.model.form; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-14 + */ +@Data +public class ModuleFormCrForm { + + @Schema(description = "编码") + private String enCode; + + @Schema(description = "状态") + private Integer enabledMark; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "备注") + private String description; + + @Schema(description = "菜单id") + private String moduleId; + + @Schema(description = "排序码") + private Long sortCode; + @Schema(description = "规则") + private Integer fieldRule; + @Schema(description = "绑定表") + private String bindTable; + private String childTableKey; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/form/ModuleFormInfoVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/form/ModuleFormInfoVO.java new file mode 100644 index 0000000..6eecca0 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/form/ModuleFormInfoVO.java @@ -0,0 +1,42 @@ +package com.yunzhupaas.base.model.form; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-14 + */ +@Data +public class ModuleFormInfoVO { + + @Schema(description = "主键") + private String id; + + @Schema(description = "编码") + private String enCode; + + @Schema(description = "状态") + private Integer enabledMark; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "备注") + private String description; + + @Schema(description = "菜单id") + private String moduleId; + + @Schema(description = "排序码") + private Long sortCode; + + @Schema(description = "规则") + private Integer fieldRule; + @Schema(description = "绑定表") + private String bindTable; + private String childTableKey = YunzhupaasKeyConsts.CHILD_TABLE_PREFIX; +} diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/form/ModuleFormListVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/form/ModuleFormListVO.java new file mode 100644 index 0000000..c5341ab --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/form/ModuleFormListVO.java @@ -0,0 +1,39 @@ +package com.yunzhupaas.base.model.form; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-14 + */ +@Data +public class ModuleFormListVO { + + @Schema(description = "主键") + private String id; + + @Schema(description = "编码") + private String enCode; + + @Schema(description = "状态") + private Integer enabledMark; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "备注") + private String description; + + @Schema(description = "菜单id") + private String moduleId; + + @Schema(description = "排序码") + private Long sortCode; + @Schema(description = "绑定表") + private String bindTable; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/form/ModuleFormModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/form/ModuleFormModel.java new file mode 100644 index 0000000..f690e41 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/form/ModuleFormModel.java @@ -0,0 +1,49 @@ +package com.yunzhupaas.base.model.form; +import lombok.Data; + +import java.util.Date; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-14 + */ +@Data +public class ModuleFormModel { + private String id; + private String fullName; + private String parentId; + private String enCode; + private String moduleId; + private String icon; + private String systemId; + private Long sortCode=999999L; + private Long creatorTime; + private Date creatorTimes; + + public Long getCreatorTime() { + if (this.creatorTimes != null && this.creatorTime == null) { + return this.getCreatorTimes().getTime(); + } else if (this.creatorTime != null){ + return this.creatorTime; + } + return 0L; + } + + public void setCreatorTimes(Date creatorTimes) { + this.creatorTimes = creatorTimes; + if(creatorTimes != null && this.creatorTime == null){ + this.creatorTime = creatorTimes.getTime(); + } + } + + public void setCreatorTime(Long creatorTime) { + this.creatorTime = creatorTime; + if(creatorTime != null && this.creatorTimes == null){ + this.creatorTimes = new Date(creatorTime); + } + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/form/ModuleFormUpForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/form/ModuleFormUpForm.java new file mode 100644 index 0000000..ee25b78 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/form/ModuleFormUpForm.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.base.model.form; + +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-14 + */ +@Data +public class ModuleFormUpForm extends ModuleFormCrForm{ + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/language/BaseLangColumn.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/language/BaseLangColumn.java new file mode 100644 index 0000000..9bba93d --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/language/BaseLangColumn.java @@ -0,0 +1,84 @@ +package com.yunzhupaas.base.model.language; + +import com.yunzhupaas.model.ExcelColumnAttr; +import org.apache.poi.ss.usermodel.IndexedColors; + +import java.util.*; + +/** + * 多语言导入模型 + * + * @author 云筑产品开发平台组 + * @version v5.0.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/25 15:31:23 + */ +public class BaseLangColumn { + + String excelName = "翻译管理"; + + Map keyMap = new LinkedHashMap() {{ + put("enCode", "翻译标记"); + put("type", "翻译分类"); + }}; + + public BaseLangColumn(Map keyMap) { + this.keyMap.putAll(keyMap); + } + + /** + * 表格名称 + * + * @return + */ + public String getExcelName() { + return excelName; + } + + /** + * 根据类型获取excel表头字段 + * + * @param type + * @return + */ + public Map getColumnByType(Integer type) { + return keyMap; + } + + /** + * 获取字段列表 + * + * @param isError + * @return + */ + public List getFieldsModel(boolean isError) { + List models = new ArrayList<>(); + //异常原因 + if (isError) { + ExcelColumnAttr attr = ExcelColumnAttr.builder().key("errorsInfo").name("异常原因").build(); + models.add(attr); + } + List requireFields = Arrays.asList("enCode"); + for (String key : keyMap.keySet()) { + ExcelColumnAttr attr = ExcelColumnAttr.builder().key(key).name(keyMap.get(key)).build(); + if (requireFields.contains(key)) { + attr.setRequire(true); + attr.setFontColor(IndexedColors.RED.getIndex()); + } + models.add(attr); + } + return models; + } + + /** + * 获取默认值 + */ + public List> getDefaultList() { + List> list = new ArrayList<>(); + Map map = new HashMap<>(); + + list.add(map); + return list; + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/language/BaseLangForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/language/BaseLangForm.java new file mode 100644 index 0000000..792fdda --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/language/BaseLangForm.java @@ -0,0 +1,34 @@ +package com.yunzhupaas.base.model.language; + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import lombok.Data; + +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * @author 云筑产品开发平台组 + * @version v5.0.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/20 10:06:37 + */ +@Data +@Schema(description = "多语言表单") +public class BaseLangForm { + + @Schema(description = "分组id") + private String id; + + @NotBlank + @Schema(description = "翻译标记") + private String enCode; + + @Schema(description = "类别:0-客户端,1-java服务端,2-net服务端,") + private Integer type; + + @Schema(description = "语种") + private LinkedHashMap map; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/language/BaseLangListVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/language/BaseLangListVO.java new file mode 100644 index 0000000..7f4deff --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/language/BaseLangListVO.java @@ -0,0 +1,39 @@ +package com.yunzhupaas.base.model.language; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.util.JsonUtil; +import lombok.Data; +import org.apache.poi.ss.formula.functions.T; + +import java.util.List; +import java.util.Map; + +/** + * 多语言列表实体类 + * + * @author 云筑产品开发平台组 + * @version v5.0.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/4/28 17:16:40 + */ +@Data +@Schema(description = "多语言列表实体类") +public class BaseLangListVO extends PageListVO { + + @Schema(description = "表头") + private List> tableHead; + + public BaseLangListVO() { + + } + + public BaseLangListVO(List list, List> tableHead, Pagination pagination) { + this.setList(list); + this.setTableHead(tableHead); + this.setPagination(JsonUtil.getJsonToBean(pagination, PaginationVO.class)); + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/language/BaseLangModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/language/BaseLangModel.java new file mode 100644 index 0000000..112157d --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/language/BaseLangModel.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.base.model.language; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version v5.0.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/25 15:30:40 + */ +@Data +@Schema(description = "多语言参数模型") +public class BaseLangModel { + + @Schema(description = "文件名称") + private String fileName; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/language/BaseLangPage.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/language/BaseLangPage.java new file mode 100644 index 0000000..d865154 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/language/BaseLangPage.java @@ -0,0 +1,13 @@ +package com.yunzhupaas.base.model.language; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import lombok.Data; + +@Data +@Schema(description = "翻译列表查询参数") +public class BaseLangPage extends Pagination { + @Schema(description = "类型:0-客户端,1-服务端") + private Integer type; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/language/BaseLangVo.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/language/BaseLangVo.java new file mode 100644 index 0000000..707b4cf --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/language/BaseLangVo.java @@ -0,0 +1,23 @@ +package com.yunzhupaas.base.model.language; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version v5.0.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/20 10:06:37 + */ +@Data +@Schema(description = "多语言对象") +public class BaseLangVo { + + @Schema(description = "翻译标记") + private String enCode; + + @Schema(description = "翻译内容") + private String fullName; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/messagetemplate/MessageTemplateCrForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/messagetemplate/MessageTemplateCrForm.java new file mode 100644 index 0000000..16dc427 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/messagetemplate/MessageTemplateCrForm.java @@ -0,0 +1,98 @@ +package com.yunzhupaas.base.model.messagetemplate; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import jakarta.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 新建消息模板 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-12-09 + */ +@Data +public class MessageTemplateCrForm implements Serializable { + /** + * 分类(数据字典) + */ + @Schema(description = "分类") + @NotBlank(message = "消息类型不能为空") + private String category; + + /** + * 模板名称 + */ + @Schema(description = "模板名称") + @NotBlank(message = "模板名称不能为空") + private String fullName; + + /** + * 标题 + */ + @Schema(description = "标题") + @NotBlank(message = "消息标题不能为空") + private String title; + + /** + * 是否站内信 + */ + @Schema(description = "是否站内信") + private Integer isStationLetter; + + /** + * 是否邮箱 + */ + @Schema(description = "是否邮箱") + private Integer isEmail; + + /** + * 是否企业微信 + */ + @Schema(description = "是否企业微信") + private Integer isWecom; + + /** + * 是否钉钉 + */ + @Schema(description = "是否钉钉") + private Integer isDingTalk; + + /** + * 是否短信 + */ + @Schema(description = "是否短信") + private Integer isSms; + + /** + * 短信模板ID + */ + @Schema(description = "短信模板ID") + private String smsId; + + /** + * 模板参数JSON + */ + @Schema(description = "模板参数JSON") + private String templateJson; + + /** + * 内容 + */ + @Schema(description = "内容") + private String content; + + /** + * 有效标志 + */ + @Schema(description = "有效标志") + private Integer enabledMark; + + @Schema(description = "编码") + private String enCode; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/messagetemplate/MessageTemplateListVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/messagetemplate/MessageTemplateListVO.java new file mode 100644 index 0000000..d996b87 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/messagetemplate/MessageTemplateListVO.java @@ -0,0 +1,79 @@ +package com.yunzhupaas.base.model.messagetemplate; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 消息模板 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-12-09 + */ +@Data +public class MessageTemplateListVO implements Serializable { + @Schema(description = "主键") + private String id; + @Schema(description = "消息类型") + private String category; + @Schema(description = "模板名称") + private String fullName; + @Schema(description = "创建人") + private String creatorUser; + @Schema(description = "创建时间") + private Date creatorTime; + @Schema(description = "修改时间") + private Date lastModifyTime; + + /** + * 通知方式 + */ + @Schema(description = "通知方式") + private String noticeMethod; + + /** + * 标题 + */ + @Schema(description = "标题") + private String title; + /** + * 内容 + */ + @Schema(description = "内容") + private String content; + /** + * 有效标志 + */ + @Schema(description = "有效标志") + private Integer enabledMark; + + @Schema(description = "编码") + private String enCode; + + @Schema(description = "是否站内信") + @JsonIgnore + private Integer isStationLetter; + @Schema(description = "是否邮件") + @JsonIgnore + private Integer isEmail; + @Schema(description = "是否微信") + @JsonIgnore + private Integer isWecom; + @Schema(description = "是否钉钉") + @JsonIgnore + private Integer isDingTalk; + @Schema(description = "是否短信") + @JsonIgnore + private Integer isSms; + + @Schema(description = "创建用户") + @JsonIgnore + private String creatorUserId; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/messagetemplate/MessageTemplateSelector.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/messagetemplate/MessageTemplateSelector.java new file mode 100644 index 0000000..4de0114 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/messagetemplate/MessageTemplateSelector.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.base.model.messagetemplate; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-12-11 + */ +@Data +public class MessageTemplateSelector implements Serializable { + @Schema(description = "主键") + private String id; + @Schema(description = "模板名称") + private String fullName; + @Schema(description = "消息类型") + private String category; + @Schema(description = "标题") + private String title; + @Schema(description = "内容") + private String content; + @Schema(description = "模板参数JSON") + private String templateJson; + @Schema(description = "编码") + private String enCode; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/messagetemplate/MessageTemplateUpForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/messagetemplate/MessageTemplateUpForm.java new file mode 100644 index 0000000..d2ffe01 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/messagetemplate/MessageTemplateUpForm.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.base.model.messagetemplate; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 新建消息模板 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-12-09 + */ +@Data +public class MessageTemplateUpForm extends MessageTemplateCrForm implements Serializable { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/messagetemplate/MessageTemplateVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/messagetemplate/MessageTemplateVO.java new file mode 100644 index 0000000..060c267 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/messagetemplate/MessageTemplateVO.java @@ -0,0 +1,99 @@ +package com.yunzhupaas.base.model.messagetemplate; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-12-09 + */ +@Data +public class MessageTemplateVO implements Serializable { + @Schema(description = "主键") + private String id; + /** + * 分类(数据字典) + */ + @Schema(description = "分类") + private String category; + + /** + * 模板名称 + */ + @Schema(description = "模板名称") + private String fullName; + + /** + * 标题 + */ + @Schema(description = "标题") + private String title; + + /** + * 是否站内信 + */ + @Schema(description = "是否站内信") + private Integer isStationLetter; + + /** + * 是否邮箱 + */ + @Schema(description = "是否邮箱") + private Integer isEmail; + + /** + * 是否企业微信 + */ + @Schema(description = "是否企业微信") + private Integer isWecom; + + /** + * 是否钉钉 + */ + @Schema(description = "是否钉钉") + private Integer isDingTalk; + + /** + * 是否短信 + */ + @Schema(description = "是否短信") + private Integer isSms; + + /** + * 短信模板ID + */ + @Schema(description = "短信模板ID") + private String smsId; + + /** + * 模板参数JSON + */ + @Schema(description = "模板参数JSON") + private String templateJson; + + /** + * 内容 + */ + @Schema(description = "内容") + private String content; + + /** + * 有效标志 + */ + @Schema(description = "有效标志") + private Integer enabledMark; + + /** + * 短信模板Id + */ + @Schema(description = "短信模板Id") + private String smsTemplateName; + + @Schema(description = "编码") + private String enCode; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/MenuListVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/MenuListVO.java new file mode 100644 index 0000000..a22fe0a --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/MenuListVO.java @@ -0,0 +1,45 @@ +package com.yunzhupaas.base.model.module; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class MenuListVO { + @Schema(description = "主键") + private String id; + @Schema(description = "是否有下级菜单") + private Boolean hasChildren; + @Schema(description = "上级ID") + private String parentId; + @Schema(description = "状态") + private Integer enabledMark; + @Schema(description = "菜单名称") + private String fullName; + @Schema(description = " 图标") + private String icon; + @Schema(description = "链接地址") + private String urlAddress; + @Schema(description = "菜单类型",example = "1") + private Integer type; + @Schema(description = "下级菜单列表") + private List children; + private Integer isButtonAuthorize; + private Integer isColumnAuthorize; + private Integer isDataAuthorize; + private Integer isFormAuthorize; + private Long sortCode; + + private String systemId; + @Schema(description = "编码") + private String enCode; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/MenuSelectAllVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/MenuSelectAllVO.java new file mode 100644 index 0000000..cfdccf0 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/MenuSelectAllVO.java @@ -0,0 +1,52 @@ +package com.yunzhupaas.base.model.module; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class MenuSelectAllVO { + @Schema(description = "主键") + private String id; + @Schema(description = "是否有下级菜单") + private Boolean hasChildren; + @Schema(description = "上级ID") + private String parentId; + @Schema(description = "状态") + private Integer enabledMark; + @Schema(description = "菜单名称") + private String fullName; + @Schema(description = " 图标") + private String icon; + @Schema(description = "链接地址") + private String urlAddress; + @Schema(description = "菜单类型",example = "1") + private Integer type; + @Schema(description = "下级菜单列表") + private List children; + private Long sortCode; + @Schema(description = "配置") + private String propertyJson; + + @Schema(description = "外链") + private String linkTarget; + @Schema(description = "编码") + private String enCode; + + @Schema(description = "系统id") + private String systemId; + @Schema(description = "是否菜单") + private Boolean hasModule; + + @Schema(description = "是否可选") + private Boolean disabled; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/MenuSelectVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/MenuSelectVO.java new file mode 100644 index 0000000..77a4bc0 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/MenuSelectVO.java @@ -0,0 +1,50 @@ +package com.yunzhupaas.base.model.module; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class MenuSelectVO { + @Schema(description = "主键") + private String id; + @Schema(description = "父主键") + private String parentId; + @Schema(description = "名称") + private String fullName; + @Schema(description = "是否按钮权限") + private Integer isButtonAuthorize; + @Schema(description = "是否列表权限") + private Integer isColumnAuthorize; + @Schema(description = "是否数据权限") + private Integer isDataAuthorize; + @Schema(description = "排序码") + private Long sortCode; + @Schema(description = "图标") + private String icon; + @Schema(description = "是否有下级菜单") + private Boolean hasChildren; + @Schema(description = "下级菜单列表") + private List children; + + @Schema(description = "外链") + private String linkTarget; + @Schema(description = "编码") + private String enCode; + + + @Schema(description = "系统id") + private String systemId; + + @Schema(description = "分类") + private Integer type; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/ModuleCrForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/ModuleCrForm.java new file mode 100644 index 0000000..8039a94 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/ModuleCrForm.java @@ -0,0 +1,51 @@ +package com.yunzhupaas.base.model.module; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class ModuleCrForm { + @Schema(description = "父主键") + private String parentId; + @Schema(description = "名称") + private String fullName; + @Schema(description = "是否按钮权限") + private Integer isButtonAuthorize; + @Schema(description = "是否列表权限") + private Integer isColumnAuthorize; + @Schema(description = "是否数据权限") + private Integer isDataAuthorize; + @Schema(description = "是否表单权限") + private Integer isFormAuthorize; + @Schema(description = "编码") + private String enCode; + @Schema(description = "图标") + private String icon; + @Schema(description = "分类") + private Integer type; + @Schema(description = "URL地址") + private String urlAddress; + @Schema(description = "外链") + private String linkTarget; + @Schema(description = "分类") + private String category; + @Schema(description = "说明") + private String description; + @Schema(description = "有效标志") + private Integer enabledMark; + @Schema(description = "排序码") + private long sortCode; + @Schema(description = "扩展json") + private String propertyJson; + + @Schema(description = "系统id") + private String systemId; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/ModuleExportModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/ModuleExportModel.java new file mode 100644 index 0000000..9d9aad5 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/ModuleExportModel.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.base.model.module; + +import com.yunzhupaas.base.entity.*; +import lombok.Data; + +import java.util.List; + +/** + * 系统菜单导出模型 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-06-17 + */ +@Data +public class ModuleExportModel { + private ModuleEntity moduleEntity; + private List buttonEntityList; + private List columnEntityList; + private List formEntityList; + private List schemeEntityList; + private List authorizeEntityList; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/ModuleInfoVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/ModuleInfoVO.java new file mode 100644 index 0000000..738cb81 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/ModuleInfoVO.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.base.model.module; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class ModuleInfoVO extends ModuleCrForm{ + @Schema(description = "主键") + private String id; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/ModuleModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/ModuleModel.java new file mode 100644 index 0000000..804f995 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/ModuleModel.java @@ -0,0 +1,54 @@ +package com.yunzhupaas.base.model.module; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 功能 + */ +@Data +public class ModuleModel implements Serializable { + private String id; + private String parentId; + private String fullName; + private String icon; + //1-类别、2-页面 + private int type; + private String urlAddress; + private String linkTarget; + private String category; + private String description; + private Long sortCode=999999L; + private String enCode; + private String propertyJson; + + private String systemId; + private Long creatorTime; + private Date creatorTimes; + + public Long getCreatorTime() { + if (this.creatorTimes != null && this.creatorTime == null) { + return this.getCreatorTimes().getTime(); + } else if (this.creatorTime != null){ + return this.creatorTime; + } + return 0L; + } + + public void setCreatorTimes(Date creatorTimes) { + this.creatorTimes = creatorTimes; + if(creatorTimes != null && this.creatorTime == null){ + this.creatorTime = creatorTimes.getTime(); + } + } + + public void setCreatorTime(Long creatorTime) { + this.creatorTime = creatorTime; + if(creatorTime != null && this.creatorTimes == null){ + this.creatorTimes = new Date(creatorTime); + } + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/ModuleNameVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/ModuleNameVO.java new file mode 100644 index 0000000..77623cd --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/ModuleNameVO.java @@ -0,0 +1,14 @@ +package com.yunzhupaas.base.model.module; + +import lombok.Data; + +import java.util.List; + +@Data +public class ModuleNameVO { + private List pcIds; + private List appIds; + private String pcNames; + private String appNames; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/ModulePagination.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/ModulePagination.java new file mode 100644 index 0000000..787e840 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/ModulePagination.java @@ -0,0 +1,13 @@ +package com.yunzhupaas.base.model.module; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import lombok.Data; + +@Data +@Schema( description = "从菜单中获取表单列表参数") +public class ModulePagination extends Pagination { + @Schema( description = "应用id") + private String systemId; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/ModulePermissionModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/ModulePermissionModel.java new file mode 100644 index 0000000..25957fc --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/ModulePermissionModel.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.base.model.module; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class ModulePermissionModel implements Serializable { + + @Schema(description = "名称") + private String fullName; + @Schema(description = "是否有权限 0-未开启 1-有权限 2-无权限") + private int type; + private List list; + + @Data + public static class ModulePermissionBaseModel { + private String id; + private String fullName; + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/ModulePermissionVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/ModulePermissionVO.java new file mode 100644 index 0000000..4a0fd89 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/ModulePermissionVO.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.base.model.module; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class ModulePermissionVO implements Serializable { + + @Schema(description = "按钮权限") + private ModulePermissionModel buttonAuthorize; + @Schema(description = "列表权限") + private ModulePermissionModel columnAuthorize; + @Schema(description = "表单权限") + private ModulePermissionModel formAuthorize; + @Schema(description = "数据权限") + private ModulePermissionModel dataAuthorize; + + @Schema(description = "权限成员") + private ModulePermissionModel permissionMember; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/ModuleSelectorVo.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/ModuleSelectorVo.java new file mode 100644 index 0000000..3f92cd2 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/ModuleSelectorVo.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.base.model.module; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(description = "菜单选择对象") +public class ModuleSelectorVo { + @Schema(description = "菜单id") + private String id; + @Schema(description = "应用名称") + private String systemName; + @Schema(description = "菜单名称") + private String fullName; + @Schema(description = "菜单编码") + private String enCode; + @Schema(description = "类型") + private Integer type; + @Schema(description = "类型名称") + private String typeName; + + @Schema(description = "类型属性信息") + private String propertyJson; + @Schema(description = "表单id") + private String formId; + @Schema(description = "流程id") + private String flowId; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/ModuleUpForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/ModuleUpForm.java new file mode 100644 index 0000000..2110864 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/ModuleUpForm.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.base.model.module; + +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class ModuleUpForm extends ModuleCrForm{ + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/ModuleVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/ModuleVO.java new file mode 100644 index 0000000..b3d4ae2 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/ModuleVO.java @@ -0,0 +1,28 @@ +package com.yunzhupaas.base.model.module; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class ModuleVO { + @Schema(description = "功能主键") + private String id; + @Schema(description = "功能上级") + private String parentId; + @Schema(description = "功能类别【1-类别、2-页面】") + private Integer type; + @Schema(description = "功能名称") + private String fullName; + @Schema(description = "功能编码") + private String enCode; + @Schema(description = "功能地址") + private String urlAddress; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/PaginationMenu.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/PaginationMenu.java new file mode 100644 index 0000000..c2fbaf9 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/PaginationMenu.java @@ -0,0 +1,23 @@ +package com.yunzhupaas.base.model.module; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Page; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class PaginationMenu extends Page { + @Schema(description = "分类") + private String category; + @Schema(description = "状态") + private Integer enabledMark; + @Schema(description = "类型") + private Integer type; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/PropertyJsonModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/PropertyJsonModel.java new file mode 100644 index 0000000..0a1bee3 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/module/PropertyJsonModel.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.base.model.module; + +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class PropertyJsonModel { + private String iconBackgroundColor; + private String moduleId; + private Integer isTree; + /** + * 参考 visualdevEntity + * 页面类型(1、纯表单,2、表单加列表,4、数据视图) + */ + private Integer webType; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/moduledata/DataCrForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/moduledata/DataCrForm.java new file mode 100644 index 0000000..c651fb7 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/moduledata/DataCrForm.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.base.model.moduledata; + + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import lombok.Data; + +/** + * app常用数据 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-07-08 + */ +@Data +@Schema(description = "常用模型") +public class DataCrForm { + @NotBlank(message = "必填") + @Schema(description = "应用主键") + private String objectId; + @Schema(description = "数据") + private String objectData; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/moduledataauthorize/DataAuthorizeCrForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/moduledataauthorize/DataAuthorizeCrForm.java new file mode 100644 index 0000000..57d0a85 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/moduledataauthorize/DataAuthorizeCrForm.java @@ -0,0 +1,42 @@ +package com.yunzhupaas.base.model.moduledataauthorize; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class DataAuthorizeCrForm { + @Schema(description = "名称") + private String fullName; + + @Schema(description = "编码") + private String enCode; + + @Schema(description = "分类") + private String type; + + @Schema(description = "条件") + private String conditionSymbol; + + @Schema(description = "条件文本") + private String conditionText; + + @Schema(description = "说明") + private String description; + + @Schema(description = "菜单id") + private String moduleId; + @Schema(description = "规则") + private Integer fieldRule; + @Schema(description = "绑定表") + private String bindTable; + private String childTableKey; + private String format; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/moduledataauthorize/DataAuthorizeInfoVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/moduledataauthorize/DataAuthorizeInfoVO.java new file mode 100644 index 0000000..0c13e44 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/moduledataauthorize/DataAuthorizeInfoVO.java @@ -0,0 +1,39 @@ +package com.yunzhupaas.base.model.moduledataauthorize; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class DataAuthorizeInfoVO { + + @Schema(description = "主键") + private String id; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "编码") + private String enCode; + + @Schema(description = "分类") + private String type; + + @Schema(description = "条件") + private String conditionSymbol; + + @Schema(description = "条件文本") + private String conditionText; + @Schema(description = "菜单id") + private String moduleId; + + @Schema(description = "说明") + private String description; + @Schema(description = "规则") + private Integer fieldRule; + @Schema(description = "绑定表") + private String bindTable; + private String childTableKey; + private String format; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/moduledataauthorize/DataAuthorizeLinkForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/moduledataauthorize/DataAuthorizeLinkForm.java new file mode 100644 index 0000000..8277e6e --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/moduledataauthorize/DataAuthorizeLinkForm.java @@ -0,0 +1,30 @@ +package com.yunzhupaas.base.model.moduledataauthorize; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import jakarta.validation.constraints.NotBlank; + +/** + * 数据权限 连接表单 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2022/6/7 + */ +@Data +public class DataAuthorizeLinkForm { + @Schema(description = "主键") + private String id; + @Schema(description = "菜单id") + @NotBlank(message = "必填") + private String moduleId; + @Schema(description = "连接id") + private String linkId; + @Schema(description = "连接表") + private String linkTables; + @Schema(description = "数据类型") + private Integer dataType; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/moduledataauthorize/DataAuthorizeListVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/moduledataauthorize/DataAuthorizeListVO.java new file mode 100644 index 0000000..1094b7f --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/moduledataauthorize/DataAuthorizeListVO.java @@ -0,0 +1,46 @@ +package com.yunzhupaas.base.model.moduledataauthorize; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class DataAuthorizeListVO { + + @Schema(description = "主键") + private String id; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "时间格式") + private String format; + + @Schema(description = "编码") + private String enCode; + + @Schema(description = "分类") + private String type; + + @Schema(description = "条件") + private String conditionSymbol; + + @Schema(description = "条件名称") + private String conditionSymbolName; + + @Schema(description = "条件文本") + private String conditionText; + + @Schema(description = "条件") + private String conditionName; + + @Schema(description = "绑定表") + private String bindTable; + + @Schema(description = "规则") + private String fieldRule; + + @Schema(description = "关联字段") + private String childTableKey; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/moduledataauthorize/DataAuthorizeTableNameVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/moduledataauthorize/DataAuthorizeTableNameVO.java new file mode 100644 index 0000000..c35b9e1 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/moduledataauthorize/DataAuthorizeTableNameVO.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.base.model.moduledataauthorize; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Builder; +import lombok.Data; + +import java.util.List; + +@Data +@Builder +public class DataAuthorizeTableNameVO { + @Schema(description = "连接id") + private String linkId; + @Schema(description = "连接表集合") + private List linkTables; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/moduledataauthorize/DataAuthorizeUpForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/moduledataauthorize/DataAuthorizeUpForm.java new file mode 100644 index 0000000..3ce734e --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/moduledataauthorize/DataAuthorizeUpForm.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.base.model.moduledataauthorize; + +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class DataAuthorizeUpForm extends DataAuthorizeCrForm{ + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/moduledataauthorizescheme/DataAuthorizeSchemeCrForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/moduledataauthorizescheme/DataAuthorizeSchemeCrForm.java new file mode 100644 index 0000000..6343310 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/moduledataauthorizescheme/DataAuthorizeSchemeCrForm.java @@ -0,0 +1,36 @@ +package com.yunzhupaas.base.model.moduledataauthorizescheme; +import lombok.Data; + +import jakarta.validation.constraints.NotBlank; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class DataAuthorizeSchemeCrForm { + @NotBlank(message = "方案名称不能为空") + private String fullName; + + private Object conditionJson; + + private String conditionText; + + private String moduleId; + + @NotBlank(message = "方案编码不能为空") + private String enCode; + + /** + * 全部数据标识 + */ + private Integer allData; + /** + * 分组匹配逻辑 + */ + private String matchLogic; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/moduledataauthorizescheme/DataAuthorizeSchemeInfoVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/moduledataauthorizescheme/DataAuthorizeSchemeInfoVO.java new file mode 100644 index 0000000..e191b35 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/moduledataauthorizescheme/DataAuthorizeSchemeInfoVO.java @@ -0,0 +1,37 @@ +package com.yunzhupaas.base.model.moduledataauthorizescheme; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class DataAuthorizeSchemeInfoVO { + + @Schema(description = "主键") + private String id; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "条件文本") + private String conditionText; + + @Schema(description = "条件json") + private String conditionJson; + + @Schema(description = "功能主键") + private String moduleId; + + @Schema(description = "编码") + private String enCode; + + /** + * ȫ�����ݱ�ʶ + */ + @Schema(description = "是否全部数据") + private Integer allData; + + @Schema(description = "分组匹配逻辑") + private String matchLogic; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/moduledataauthorizescheme/DataAuthorizeSchemeListVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/moduledataauthorizescheme/DataAuthorizeSchemeListVO.java new file mode 100644 index 0000000..e59b18b --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/moduledataauthorizescheme/DataAuthorizeSchemeListVO.java @@ -0,0 +1,33 @@ +package com.yunzhupaas.base.model.moduledataauthorizescheme; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author YUNZHUPAAS����ƽ̨�� + * @version V3.1.0 + * @copyright ������Ϣ�������޹�˾ + * @date 2024/3/12 15:31 + */ +@Data +public class DataAuthorizeSchemeListVO { + + @Schema(description = "主键") + private String id; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "条件文本") + private String conditionText; + + @Schema(description = "编码") + private String enCode; + + @Schema(description = "是否全部数据") + private Integer allData; + + @Schema(description = "分组匹配逻辑") + private String matchLogic; +} diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/moduledataauthorizescheme/DataAuthorizeSchemeUpForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/moduledataauthorizescheme/DataAuthorizeSchemeUpForm.java new file mode 100644 index 0000000..892969b --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/moduledataauthorizescheme/DataAuthorizeSchemeUpForm.java @@ -0,0 +1,7 @@ +package com.yunzhupaas.base.model.moduledataauthorizescheme; +import lombok.Data; + +@Data +public class DataAuthorizeSchemeUpForm extends DataAuthorizeSchemeCrForm { +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/monitor/CpuModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/monitor/CpuModel.java new file mode 100644 index 0000000..fe9e455 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/monitor/CpuModel.java @@ -0,0 +1,32 @@ +package com.yunzhupaas.base.model.monitor; + +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class CpuModel { + @Schema(description = "cpu名称") + private String name; + @Schema(description = "物理CPU个数") + @JSONField(name="package") + private String packageName; + @Schema(description = "CPU内核个数") + private String core; + @Schema(description = "内核个数") + private int coreNumber; + @Schema(description = "逻辑CPU个数") + private String logic; + @Schema(description = "CPU已用百分比") + private String used; + @Schema(description = "未用百分比") + private String idle; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/monitor/DiskModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/monitor/DiskModel.java new file mode 100644 index 0000000..3bd402a --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/monitor/DiskModel.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.base.model.monitor; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class DiskModel { + @Schema(description = "硬盘总容量") + private String total; + @Schema(description = "空闲硬盘") + private String available; + @Schema(description = "已使用") + private String used; + @Schema(description = "已使用百分比") + private String usageRate; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/monitor/MemoryModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/monitor/MemoryModel.java new file mode 100644 index 0000000..2be79c4 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/monitor/MemoryModel.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.base.model.monitor; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class MemoryModel { + @Schema(description = "总内存") + private String total; + @Schema(description = "空闲内存") + private String available; + @Schema(description = "已使用") + private String used; + @Schema(description = "已使用百分比") + private String usageRate; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/monitor/MonitorListVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/monitor/MonitorListVO.java new file mode 100644 index 0000000..c4b5908 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/monitor/MonitorListVO.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.base.model.monitor; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class MonitorListVO { + @Schema(description = "系统信息") + private SystemModel system; + @Schema(description = "CPU信息") + private CpuModel cpu; + @Schema(description = "内存信息") + private MemoryModel memory; + @Schema(description = "硬盘信息") + private DiskModel disk; + @Schema(description = "当前时间") + private Long time; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/monitor/SwapModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/monitor/SwapModel.java new file mode 100644 index 0000000..e0e08b5 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/monitor/SwapModel.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.base.model.monitor; + +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class SwapModel { + private String total; + private String available; + private String used; + private String usageRate; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/monitor/SystemModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/monitor/SystemModel.java new file mode 100644 index 0000000..7365017 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/monitor/SystemModel.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.base.model.monitor; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class SystemModel { + @Schema(description = "系统") + private String os; + @Schema(description = "服务器IP") + private String ip; + @Schema(description = "运行时间") + private String day; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/online/AuthFlieds.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/online/AuthFlieds.java new file mode 100644 index 0000000..0731d76 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/online/AuthFlieds.java @@ -0,0 +1,57 @@ +package com.yunzhupaas.base.model.online; + +import lombok.Builder; +import lombok.Data; +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.4 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2022/4/6 + */ +@Data +@Builder +public class AuthFlieds { + + private String id; + /** + * 字段名 + */ + private String fullName; + /** + * 是否启用 + */ + private Boolean status; + + /** + * encode + */ + private String encode; + + /** + * 规则 (0.主表规则 1.副表规则 2.子表规则) + */ + private Integer rule; + + /** + * 控件类型 + */ + private String yunzhupaasKey; + + /** + * 数据权限条件 + */ + private String AuthCondition; + + /** + * 表名 + */ + private String bindTableName; + + /** + * 子表规则key + */ + private String childTableKey; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/online/BatchOnlineModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/online/BatchOnlineModel.java new file mode 100644 index 0000000..0da6c24 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/online/BatchOnlineModel.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.base.model.online; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-12-15 + */ +@Data +public class BatchOnlineModel implements Serializable { + @Schema(description = "id集合") + private String[] ids; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/online/PerColModels.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/online/PerColModels.java new file mode 100644 index 0000000..38afc17 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/online/PerColModels.java @@ -0,0 +1,45 @@ +package com.yunzhupaas.base.model.online; + +import com.yunzhupaas.base.entity.ModuleDataAuthorizeEntity; +import com.yunzhupaas.base.entity.ModuleDataAuthorizeSchemeEntity; +import lombok.Data; + +import java.util.List; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.4 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2022/4/7 + */ +@Data +public class PerColModels { + /** + * 数据权限 + */ + private List dataPermission; + + /** + * 表单权限 + */ + private List formPermission; + + /** + * 列表权限 + */ + private List listPermission; + + /** + * 按钮权限 + */ + private List buttonPermission; + + /** + * 数据权限方案 + */ + private List dataPermissionScheme; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/online/VisualMenuModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/online/VisualMenuModel.java new file mode 100644 index 0000000..305b15b --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/online/VisualMenuModel.java @@ -0,0 +1,62 @@ +package com.yunzhupaas.base.model.online; + +import lombok.Data; + +import java.util.List; + +/** + * 可视化菜单对象 + * + * @author 云筑产品开发平台组 + * @version V3.4 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/4/6 + */ +@Data +public class VisualMenuModel { + /** + * 功能id + */ + private String id; + + /** + * pc 按钮配置 + */ + private PerColModels pcPerCols; + + /** + * app 按钮配置 + */ + private PerColModels appPerCols; + + /** + * 功能名 + */ + private String fullName; + + /** + * 功能编码 + */ + private String encode; + + private Integer pc; + + private Integer app; + + private List pcModuleParentId; + + private List appModuleParentId; + + private String pcSystemId; + + private String appSystemId; + + private Integer type; + + /** + * 参考 visualdevEntity + * 页面类型(1、纯表单,2、表单加列表,4、数据视图) + */ + private Integer webType; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/portalManage/PortalListVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/portalManage/PortalListVO.java new file mode 100644 index 0000000..8458625 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/portalManage/PortalListVO.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.base.model.portalManage; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class PortalListVO implements Serializable { + private String id; + private String parentId; + private String fullName; + private String icon; + private String systemId; + private Boolean hasChildren; + private boolean disabled; + private List children; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/portalManage/PortalManageCreForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/portalManage/PortalManageCreForm.java new file mode 100644 index 0000000..3a74b19 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/portalManage/PortalManageCreForm.java @@ -0,0 +1,58 @@ +package com.yunzhupaas.base.model.portalManage; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.entity.PortalManageEntity; +import com.yunzhupaas.util.RandomUtil; +import lombok.Data; +import org.springframework.beans.BeanUtils; + +import jakarta.validation.constraints.NotNull; + +/** + * 门户管理表单创建对象 + * + * @author 云筑产品开发平台组 + * @version v3.4.6 + * @copyrignt 深圳市乐程软件有限公司 + * @date 2023-02-16 + */ +@Data +public class PortalManageCreForm { + + @Schema(description = "说明") + private String description; + + @Schema(description = "门户_id") +// @NotNull(message = "必填") + private String portalId; + + @Schema(description = "系统_id") +// @NotNull(message = "必填") + private String systemId; + + @Schema(description = "平台") +// @NotNull(message = "必填") + private String platform; + + @Schema(description = "默认首页") +// @NotNull(message = "必填") + private Integer homePageMark; + + @Schema(description = "排序码") +// @NotNull(message = "必填") + private Long sortCode; + + @Schema(description = "有效标志") +// @NotNull(message = "必填") + private Integer enabledMark; + + public PortalManageEntity convertEntity(){ + PortalManageEntity portalManageEntity = new PortalManageEntity(); + BeanUtils.copyProperties(this, portalManageEntity); + portalManageEntity.setPlatform(portalManageEntity.getPlatform()); + portalManageEntity.setId(RandomUtil.uuId()); + return portalManageEntity; + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/portalManage/PortalManagePage.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/portalManage/PortalManagePage.java new file mode 100644 index 0000000..84d2319 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/portalManage/PortalManagePage.java @@ -0,0 +1,48 @@ +package com.yunzhupaas.base.model.portalManage; + +import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO; +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.vo.PaginationVO; +import lombok.Data; + +/** + * 类功能 + * + * @author 云筑产品开发平台组 + * @version v3.4.8 + * @copyrignt 深圳市乐程软件有限公司 + * @date 2023-04-17 + */ +@Data +public class PortalManagePage extends Pagination { + + @Schema(description = "平台") + private String platform; + + @Schema(description = "分类(字典)") + private String category; + + @Schema(description = "系统ID") + private String systemId; + + @Schema(description = "是否禁用") + private Integer enabledMark; + + @Schema(description = "是否禁用") + private Integer state; + + public PageDTO getPageDto(){ + return new PageDTO(getCurrentPage(), getPageSize()); + } + + public PaginationVO getPaginationVO(){ + PaginationVO paginationVO = new PaginationVO(); + paginationVO.setTotal(Long.valueOf(getTotal()).intValue()); + paginationVO.setCurrentPage(getCurrentPage()); + paginationVO.setPageSize(getPageSize()); + return paginationVO; + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/portalManage/PortalManagePageDO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/portalManage/PortalManagePageDO.java new file mode 100644 index 0000000..e774ac4 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/portalManage/PortalManagePageDO.java @@ -0,0 +1,67 @@ +package com.yunzhupaas.base.model.portalManage; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.entity.PortalManageEntity; +import lombok.Data; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; + +import java.util.Date; + + +/** + * 类功能 + * + * @author 云筑产品开发平台组 + * @version v3.4.6 + * @copyrignt 深圳市乐程软件有限公司 + * @date 2023-02-16 + */ +@Data +public class PortalManagePageDO extends PortalManageEntity { + + @Schema(description = "门户管理ID") + private String id; + + @Schema(description = "门户名") + private String portalName; + + @Schema(description = "分类名") + private String categoryName; + + @Schema(description = "分类Id") + private String categoryId; + + @Schema(description = "创建者名") + private String createUserName; + + @Schema(description = "创建时间") + private Date creatorTime; + + @Schema(description = "创建者账号") + private String createUserAccount; + + @Schema(description = "修改者名") + private String modifyUserName; + + @Schema(description = "修改者账号") + private String modifyUserAccount; + + @Schema(description = "最后修改时间") + private Date lastModifyTime; + + public PortalManageVO convert(){ + PortalManageVO vo = new PortalManageVO(); + BeanUtils.copyProperties(this, vo); + // 创建人 + if(StringUtils.isNotEmpty(createUserName)) vo.setCreatorUser(createUserName + "/" + createUserAccount); + // 修改人 + if(StringUtils.isNotEmpty(modifyUserName)) vo.setLastModifyUser(modifyUserName + "/" + modifyUserAccount); + // 门户名称 + vo.setFullName(portalName); + vo.setCategoryName(categoryName); + return vo; + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/portalManage/PortalManagePrimary.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/portalManage/PortalManagePrimary.java new file mode 100644 index 0000000..7227431 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/portalManage/PortalManagePrimary.java @@ -0,0 +1,48 @@ +package com.yunzhupaas.base.model.portalManage; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.MyBatisPrimaryBase; +import com.yunzhupaas.base.entity.PortalManageEntity; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 门户管理联合主键类 + * + * @author 云筑产品开发平台组 + * @version v3.4.8 + * @copyrignt 深圳市乐程软件有限公司 + * @date 2023-04-20 + */ +@Data +@Accessors(chain = true) +@AllArgsConstructor +public class PortalManagePrimary extends MyBatisPrimaryBase { + + @Schema(description = "平台") + private String platform; + + @Schema(description = "门户ID") + private String portalId; + + @Schema(description = "系统ID") + private String systemId; + + public QueryWrapper getQuery(){ + if(this.platform != null) queryWrapper.lambda().eq(PortalManageEntity::getPlatform, platform); + if(this.portalId != null) queryWrapper.lambda().eq(PortalManageEntity::getPortalId, portalId); + if(this.systemId != null) queryWrapper.lambda().eq(PortalManageEntity::getSystemId, systemId); + return queryWrapper; + } + + @Override + public PortalManageEntity getEntity() throws Exception { + PortalManageEntity entity = super.getEntity(); + entity.setSortCode(0L); + return entity; + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/portalManage/PortalManageUpForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/portalManage/PortalManageUpForm.java new file mode 100644 index 0000000..2b3490f --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/portalManage/PortalManageUpForm.java @@ -0,0 +1,55 @@ +package com.yunzhupaas.base.model.portalManage; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.entity.PortalManageEntity; +import lombok.Data; +import org.springframework.beans.BeanUtils; + +import jakarta.validation.constraints.NotNull; + +/** + * 门户管理表单更新对象 + * + * @author 云筑产品开发平台组 + * @version v3.4.6 + * @copyrignt 深圳市乐程软件有限公司 + * @date 2023-02-18 + */ +@Data +public class PortalManageUpForm { + + @Schema(description = "主键_id") + @NotNull(message = "必填") + private String id; + + @Schema(description = "说明") + private String description; + + @Schema(description = "门户_id") + @NotNull(message = "必填") + private String portalId; + + @Schema(description = "默认首页") + private Integer homePageMark; + + @Schema(description = "排序码") + @NotNull(message = "必填") + private Long sortCode; + + @Schema(description = "有效标志") + @NotNull(message = "必填") + private Integer enabledMark; + + @Schema(description = "平台") + @NotNull(message = "必填") + private String platform; + + public PortalManageEntity convertEntity(){ + PortalManageEntity portalManageEntity = new PortalManageEntity(); + BeanUtils.copyProperties(this, portalManageEntity); + portalManageEntity.setPlatform(portalManageEntity.getPlatform()); + return portalManageEntity; + } + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/portalManage/PortalManageVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/portalManage/PortalManageVO.java new file mode 100644 index 0000000..8872bb8 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/portalManage/PortalManageVO.java @@ -0,0 +1,66 @@ +package com.yunzhupaas.base.model.portalManage; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * 类功能 + * + * @author 云筑产品开发平台组 + * @version v3.4.6 + * @copyrignt 深圳市乐程软件有限公司 + * @date 2023-02-16 + */ +@Data +public class PortalManageVO { + + @Schema(description = "主键_id") + private String id; + + @Schema(description = "门户_id") + private String portalId; + + @Schema(description = "分类") + private String categoryId; + + @Schema(description = "分类") + private String categoryName; + + @Schema(description = "平台") + private String platform; + + @Schema(description = "说明") + private String description; + + @Schema(description = "门户名称") + private String fullName; + + @Schema(description = "默认首页") + private Integer homePageMark; + + @Schema(description = "排序码") + private Long sortCode; + + @Schema(description = "有效标志") + private Integer enabledMark; + + @Schema(description = "创建用户") + private String creatorUser; + + @Schema(description = "创建时间") + private Date creatorTime; + + @Schema(description = "最后修改人") + private String lastModifyUser; + + @Schema(description = "最后修改时间") + private Date lastModifyTime; + + @Schema(description = "系统_id") + private String systemId; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/portalManage/PortalModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/portalManage/PortalModel.java new file mode 100644 index 0000000..c85c995 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/portalManage/PortalModel.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.base.model.portalManage; + +import com.yunzhupaas.util.treeutil.SumTree; +import lombok.Data; + +/** + * 按钮 + */ +@Data +public class PortalModel extends SumTree { + private String fullName; + private String icon; + private String systemId; + private boolean disabled; + private Long creatorTime; + private Long sortCode; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/portalManage/PortalPagination.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/portalManage/PortalPagination.java new file mode 100644 index 0000000..0f344de --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/portalManage/PortalPagination.java @@ -0,0 +1,30 @@ +package com.yunzhupaas.base.model.portalManage; + + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-10-21 14:23:30 + */ +@Data +@Schema(description = "查询条件") +public class PortalPagination extends Pagination { + /** + * 分类 + */ + @Schema(description = "分类(字典)") + private String category; + + /** + * 类型(0-门户设计,1-配置路径) + */ + @Schema(description = "类型(0-门户设计,1-配置路径)") + private Integer type; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/portalManage/PortalVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/portalManage/PortalVO.java new file mode 100644 index 0000000..baedcb7 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/portalManage/PortalVO.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.base.model.portalManage; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +@Data +public class PortalVO implements Serializable { + private List list = new ArrayList<>(); + + private List ids = new ArrayList<>(); + + private List all = new ArrayList<>(); +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/portalManage/SavePortalAuthModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/portalManage/SavePortalAuthModel.java new file mode 100644 index 0000000..e63525e --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/portalManage/SavePortalAuthModel.java @@ -0,0 +1,15 @@ +package com.yunzhupaas.base.model.portalManage; + +import lombok.Data; + +import java.util.List; + +@Data +public class SavePortalAuthModel { + private String id; + private List ids; + private String type; + private List objectId; + private String systemId; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/print/PaginationPrint.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/print/PaginationPrint.java new file mode 100644 index 0000000..b7a56b4 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/print/PaginationPrint.java @@ -0,0 +1,27 @@ +package com.yunzhupaas.base.model.print; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-11-20 + */ +@Data +@Schema(description = "打印模板列表参数") +public class PaginationPrint extends Pagination { + @Schema(description = "分类") + private String category; + @Schema(description = "状态") + private Integer state; + + @Schema(description = "是否全部数据:0-分页,1-全部") + private Integer dataType; + + @Schema(description = "权限数据:1-通用,2-权限设置") + private Integer visibleType; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/print/PrintDevFormDTO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/print/PrintDevFormDTO.java new file mode 100644 index 0000000..40343ed --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/print/PrintDevFormDTO.java @@ -0,0 +1,64 @@ +package com.yunzhupaas.base.model.print; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import com.yunzhupaas.base.model.dataset.DataSetForm; +import lombok.Data; + +import java.util.List; + +/** + * 打印模板-数据传输对象 + * + * @author 云筑产品开发平台组 YY + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-30 + */ +@Data +@Schema(description = "打印表单基础信息") +public class PrintDevFormDTO { + + @Schema(description = "主键id") + private String id; + + @NotBlank(message = "打印名称必填") + @Schema(description = "打印名称", required = true) + private String fullName; + + @NotBlank(message = "打印编码必填") + @Schema(description = "打印编码", required = true) + private String enCode; + + @NotBlank(message = "打印分类必填") + @Schema(description = "打印分类", required = true) + private String category; + + @Schema(description = "打印排序") + private Long sortCode; + + @Schema(description = "打印说明") + private String description; + + @Schema(description = "模板内容") + private String printTemplate; + + @Schema(description = "模板内容") + private List dataSetList; + + @Schema(description = "转换配置") + private String convertConfig; + + @Schema(description = "通用-将该模板设为通用(0-表单用,1-业务打印模板用)") + private Integer commonUse; + + @Schema(description = "发布范围:1-公开,2-权限设置") + private Integer visibleType; + + @Schema(description = "图标") + private String icon; + + @Schema(description = "图标颜色") + private String iconBackground; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/print/PrintDevInfoVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/print/PrintDevInfoVO.java new file mode 100644 index 0000000..3546f0c --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/print/PrintDevInfoVO.java @@ -0,0 +1,63 @@ +package com.yunzhupaas.base.model.print; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.model.dataset.DataSetInfo; +import com.yunzhupaas.base.model.dataset.TableTreeModel; +import com.yunzhupaas.util.treeutil.SumTree; +import lombok.Data; + +import java.util.List; + +@Data +@Schema(description = "打印模板详情") +public class PrintDevInfoVO { + + @Schema(description = "模板id") + private String id; + + @Schema(description = "版本id") + private String versionId; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "编码") + private String enCode; + + @Schema(description = "分类") + private String category; + + @Schema(description = "状态:0-未发布,1-已发布,2-已修改") + private Integer state; + + @Schema(description = "模板内容") + private String printTemplate; + + @Schema(description = "转换配置") + private String convertConfig; + + @Schema(description = "通用-将该模板设为通用(0-表单用,1-业务打印模板用)") + private Integer commonUse; + + @Schema(description = "发布范围:1-公开,2-权限设置") + private Integer visibleType; + + @Schema(description = "图标") + private String icon; + + @Schema(description = "图标颜色") + private String iconBackground; + + @Schema(description = "排序") + private Long sortCode; + + @Schema(description = "说明") + private String description; + + @Schema(description = "模板内容") + private List dataSetList; + + @Schema(description = "表字段列表") + private List> fieldList; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/print/PrintDevTreeModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/print/PrintDevTreeModel.java new file mode 100644 index 0000000..23db53c --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/print/PrintDevTreeModel.java @@ -0,0 +1,142 @@ +package com.yunzhupaas.base.model.print; + +import com.alibaba.fastjson.annotation.JSONField; +import com.yunzhupaas.util.treeutil.SumTree; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * 打印模板数树形视图对象 + * + * @author 云筑产品开发平台组 YY + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-30 + */ +@Data +public class PrintDevTreeModel extends SumTree { + + /** + * 分类下模板数量 + */ + private Integer num; + + /** + * 主键_id + */ + private String id; + + /** + * 名称 + */ + private String fullName; + + /** + * 编码 + */ + private String enCode; + + /** + * 分类 + */ + private String category; + + /** + * 类型 + */ + private Integer type; + + /** + * 描述 + */ + private String description; + + /** + * 排序码 + */ + private Integer sortCode; + + /** + * 有效标志 + */ + private Integer enabledMark; + + /** + * 创建时间 + */ + private Long creatorTime; + + /** + * 创建用户_id + */ + @JSONField(name = "creatorUserId") + private String creatorUser; + + /** + * 修改时间 + */ + private Long lastModifyTime; + + /** + * 修改用户_id + */ + @JSONField(name = "lastModifyUserId") + private String lastModifyUser; + + /** + * 删除标志 + */ + private Integer deleteMark; + + /** + * 删除时间 + */ + private LocalDateTime deleteTime; + + /** + * 删除用户_id + */ + private String deleteUserId; + + /** + * 连接数据 _id + */ + private String dbLinkId; + + /** + * sql语句 + */ + private String sqlTemplate; + + /** + * 左侧字段 + */ + private String leftFields; + + /** + * 打印模板 + */ + private String printTemplate; + + /** + * 通用-将该模板设为通用(0-表单用,1-业务打印模板用) + */ + private Integer commonUse; + + /** + * 发布范围:1-公开,2-权限设置 + */ + private Integer visibleType; + + /** + * 图标 + */ + private String icon; + + /** + * 图标颜色 + */ + private String iconBackground; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/print/PrintDevUpForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/print/PrintDevUpForm.java new file mode 100644 index 0000000..8ee6934 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/print/PrintDevUpForm.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.base.model.print; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; +import lombok.Data; + +/** + * 打印模板-数据传输对象 + * + * @author 云筑产品开发平台组 YY + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-30 + */ +@Data +@Schema(description = "打印表单基础信息") +public class PrintDevUpForm extends PrintDevFormDTO { + + @Schema(description = "版本id") + private String versionId; + + @NotNull + @Schema(description = "动作类型:0-保存,1-发布") + private Integer type; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/print/PrintOption.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/print/PrintOption.java new file mode 100644 index 0000000..6fe04aa --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/print/PrintOption.java @@ -0,0 +1,13 @@ +package com.yunzhupaas.base.model.print; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class PrintOption { + @Schema(description = "主键") + private String id; + @Schema(description = "名称") + private String fullName; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/print/PrintVersionListVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/print/PrintVersionListVO.java new file mode 100644 index 0000000..78571cd --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/print/PrintVersionListVO.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.base.model.print; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(description = "打印版本") +public class PrintVersionListVO { + @Schema(description = "状态") + private Integer state; + @Schema(description = "主键") + private String id; + @Schema(description = "名称") + private String fullName; + @Schema(description = "版本") + private String version; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/printlog/PrintLogInfo.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/printlog/PrintLogInfo.java new file mode 100644 index 0000000..f1381ba --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/printlog/PrintLogInfo.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.base.model.printlog; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +@Data +public class PrintLogInfo { + @Schema(description = "主键") + private String id; + @Schema(description = "打印人") + private String printMan; + @Schema(description = "打印时间") + private Date printTime; + @Schema(description = "打印数量") + private Integer printNum; + @Schema(description = "打印标题") + private String printTitle; + @Schema(description = "打印id") + private String printId; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/province/AreaModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/province/AreaModel.java new file mode 100644 index 0000000..32e8995 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/province/AreaModel.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.base.model.province; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-01-05 + */ +@Data +public class AreaModel implements Serializable { + private List> idsList; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/province/AtlasFeaturesModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/province/AtlasFeaturesModel.java new file mode 100644 index 0000000..9d5f970 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/province/AtlasFeaturesModel.java @@ -0,0 +1,11 @@ +package com.yunzhupaas.base.model.province; + +import lombok.Data; + +@Data +public class AtlasFeaturesModel { + private String type; + private AtlasPropModel properties; + private Object geometry; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/province/AtlasJsonModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/province/AtlasJsonModel.java new file mode 100644 index 0000000..c873c19 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/province/AtlasJsonModel.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.base.model.province; + +import lombok.Data; + +import java.util.List; + +/** + * 流程设计 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/2/1 9:48:02 + */ +@Data +public class AtlasJsonModel { + private String type; + private List features; +} + + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/province/AtlasPropModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/province/AtlasPropModel.java new file mode 100644 index 0000000..4021592 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/province/AtlasPropModel.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.base.model.province; + +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +@Data +public class AtlasPropModel { + private Integer adcode; + private String name; + private List center; + private List centroid; + private Integer childrenNum; + private String level; + private List acroutes; + private Object parent; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/province/MapParams.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/province/MapParams.java new file mode 100644 index 0000000..f2c5c21 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/province/MapParams.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.base.model.province; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class MapParams { + @Schema(description = "key") + private String key; + @Schema(description = "location") + private String location; + @Schema(description = "keywords") + private String keywords; + @Schema(description = "radius") + private String radius; + @Schema(description = "offset") + private Integer offset; + @Schema(description = "page") + private Integer page; + @Schema(description = "zoom") + private Integer zoom; + @Schema(description = "size") + private String size; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/province/PaginationProvince.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/province/PaginationProvince.java new file mode 100644 index 0000000..ae69004 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/province/PaginationProvince.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.base.model.province; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Page; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class PaginationProvince extends Page { + + @Schema(description = "状态") + private Integer enabledMark; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/province/ProvinceCrForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/province/ProvinceCrForm.java new file mode 100644 index 0000000..4734504 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/province/ProvinceCrForm.java @@ -0,0 +1,40 @@ +package com.yunzhupaas.base.model.province; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.hibernate.validator.constraints.NotBlank; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class ProvinceCrForm { + @Schema(description = "编码") + @org.hibernate.validator.constraints.NotBlank(message = "必填") + private String enCode; + + @Schema(description = "有效标志") + private Integer enabledMark; + + @Schema(description = "名称") + @org.hibernate.validator.constraints.NotBlank(message = "必填") + private String fullName; + + @Schema(description = "说明") + private String description; + + @Schema(description = "上级id") + @NotBlank(message = "必填") + private String parentId; + + @Schema(description = "分类") + private String type; + + @Schema(description = "排序码") + private long sortCode; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/province/ProvinceInfoVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/province/ProvinceInfoVO.java new file mode 100644 index 0000000..c5b9cf9 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/province/ProvinceInfoVO.java @@ -0,0 +1,41 @@ +package com.yunzhupaas.base.model.province; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class ProvinceInfoVO { + + @Schema(description = "主键") + private String id; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "编码") + private String enCode; + + @Schema(description = "有效标志") + private Integer enabledMark; + + @Schema(description = "说明") + private String description; + + @Schema(description = "分类") + private String type; + + @Schema(description = "上级id") + private String parentId; + @Schema(description = "上级名称") + private String parentName; + @Schema(description = "排序码") + private long sortCode; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/province/ProvinceListTreeVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/province/ProvinceListTreeVO.java new file mode 100644 index 0000000..8866632 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/province/ProvinceListTreeVO.java @@ -0,0 +1,33 @@ +package com.yunzhupaas.base.model.province; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +@Data +public class ProvinceListTreeVO { + @Schema(description = "子集集合") + List children; + @Schema(description = "主键") + private String id; + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "上级id") + private String parentId; + @Schema(description = "有效标志") + private Integer enabledMark; + @Schema(description = "是否有子集相反") + private Boolean isLeaf; + @Schema(description = "是否有子集") + private Boolean hasChildren; + @Schema(description = "排序码") + private long sortCode; + private String atlasCenter; + private BigDecimal centerLong; + private BigDecimal centerLat; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/province/ProvinceListVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/province/ProvinceListVO.java new file mode 100644 index 0000000..d12f431 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/province/ProvinceListVO.java @@ -0,0 +1,34 @@ +package com.yunzhupaas.base.model.province; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class ProvinceListVO { + @Schema(description = "主键") + private String id; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "编码") + private String enCode; + + @Schema(description = "有效标志") + private Integer enabledMark; + @Schema(description = "是否有子集") + private Boolean hasChildren; + + @Schema(description = "是否有子集取反") + private Boolean isLeaf; + @Schema(description = "排序码") + private long sortCode; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/province/ProvinceSelectListVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/province/ProvinceSelectListVO.java new file mode 100644 index 0000000..ef24996 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/province/ProvinceSelectListVO.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.base.model.province; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class ProvinceSelectListVO { + @Schema(description = "主键") + private String id; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "是否显示下级可点击按钮") + private Boolean isLeaf; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/province/ProvinceUpForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/province/ProvinceUpForm.java new file mode 100644 index 0000000..e0b60c1 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/province/ProvinceUpForm.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.base.model.province; + +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class ProvinceUpForm extends ProvinceCrForm { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/query/PrintDevDataQuery.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/query/PrintDevDataQuery.java new file mode 100644 index 0000000..42562c8 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/query/PrintDevDataQuery.java @@ -0,0 +1,38 @@ +package com.yunzhupaas.base.model.query; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import lombok.Data; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 打印模板-数查询对象 + * + * @author 云筑产品开发平台组 YY + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-30 + */ +@Data +@Schema(description = "批量打印参数") +public class PrintDevDataQuery { + + @NotBlank(message = "必填") + @Schema(description = "打印模板id") + private String id; + + @NotBlank(message = "必填") + @Schema(description = "打印列表id") + private List ids; + + @Schema(description = "其他参数") + private Map map = new HashMap<>(); + + @Schema(description = "表单和流程id参数") + private List formInfo = new ArrayList<>(); +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/query/PrintDevFieldsQuery.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/query/PrintDevFieldsQuery.java new file mode 100644 index 0000000..17e6cf7 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/query/PrintDevFieldsQuery.java @@ -0,0 +1,34 @@ +package com.yunzhupaas.base.model.query; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import jakarta.validation.constraints.NotBlank; + +/** + * 打印模板-数查询对象 + * + * @author 云筑产品开发平台组 YY + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-30 + */ +@Data +public class PrintDevFieldsQuery { + + /** + * sql语句 + */ + @NotBlank(message = "必填") + @Schema(description = "sql语句") + private String sqlTemplate; + + /** + * 连接id + */ + @NotBlank(message = "必填") + @Schema(description = "连接id") + private String dbLinkId; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/query/PrintDevParam.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/query/PrintDevParam.java new file mode 100644 index 0000000..49cea1b --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/query/PrintDevParam.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.base.model.query; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import lombok.Data; + +@Data +@Schema(description = "表单和流程id参数") +public class PrintDevParam { + + @NotBlank(message = "必填") + @Schema(description = "表单id") + private String formId; + + @Schema(description = "流程任务id") + private String flowTaskId; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/resource/ResourceModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/resource/ResourceModel.java new file mode 100644 index 0000000..281d6a2 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/resource/ResourceModel.java @@ -0,0 +1,52 @@ +package com.yunzhupaas.base.model.resource; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 资源 + */ +@Data +public class ResourceModel implements Serializable { + private String id; + private String fullName; + private String enCode; + private String conditionJson; + private String conditionText; + private Integer allData; + private String moduleId; + private String matchLogic; + private String objectId; + private String icon; + private String parentId; + private String systemId; + private Long sortCode=999999L; + private Long creatorTime; + private Date creatorTimes; + + public Long getCreatorTime() { + if (this.creatorTimes != null && this.creatorTime == null) { + return this.getCreatorTimes().getTime(); + } else if (this.creatorTime != null){ + return this.creatorTime; + } + return 0L; + } + + public void setCreatorTimes(Date creatorTimes) { + this.creatorTimes = creatorTimes; + if(creatorTimes != null && this.creatorTime == null){ + this.creatorTime = creatorTimes.getTime(); + } + } + + public void setCreatorTime(Long creatorTime) { + this.creatorTime = creatorTime; + if(creatorTime != null && this.creatorTimes == null){ + this.creatorTimes = new Date(creatorTime); + } + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/schedule/ScheduleDetailModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/schedule/ScheduleDetailModel.java new file mode 100644 index 0000000..9ed647a --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/schedule/ScheduleDetailModel.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.base.model.schedule; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ScheduleDetailModel { + @Schema(description ="分组主键") + private String groupId; + @Schema(description ="主键") + private String id; + @Schema(description = "类型") + private String type; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/schedule/ScheduleJobModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/schedule/ScheduleJobModel.java new file mode 100644 index 0000000..e10facd --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/schedule/ScheduleJobModel.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.base.model.schedule; + +import com.yunzhupaas.base.UserInfo; +import lombok.Data; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Data +public class ScheduleJobModel { + private UserInfo userInfo = new UserInfo(); + private Date scheduleTime = new Date(); + private List userList = new ArrayList<>(); + private String id; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/schedule/ScheduleNewAppListVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/schedule/ScheduleNewAppListVO.java new file mode 100644 index 0000000..a35fc7e --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/schedule/ScheduleNewAppListVO.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.base.model.schedule; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Data +public class ScheduleNewAppListVO { + + @Schema(description ="app数量") + private Map signList= new HashMap<>(); + @Schema(description ="当天内容") + private List todayList= new ArrayList<>(); +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/schedule/ScheduleNewCrForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/schedule/ScheduleNewCrForm.java new file mode 100644 index 0000000..cc8a647 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/schedule/ScheduleNewCrForm.java @@ -0,0 +1,87 @@ +package com.yunzhupaas.base.model.schedule; + +import cn.hutool.core.util.ObjectUtil; +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.constant.MsgCode; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * @author 云筑产品开发平台组 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + */ +@Data +public class ScheduleNewCrForm { + + private String category; + + private String urgent = "1"; + + private String title; + + private String content; + + private Integer allDay = 1; + + private Long startDay = System.currentTimeMillis(); + + private String startTime = "00:00"; + + private Long endDay = System.currentTimeMillis(); + + private String endTime = "23:59"; + + private Integer duration = -1; + + private List toUserIds = new ArrayList<>(); + + private String color; + + private Integer reminderTime = -2; + + private Integer reminderType = 1; + + private String send; + + private String sendName; + + private Integer repetition = 1; + + private Long repeatTime; + @Schema(description = "附件") + private String files; + + private String creatorUserId; + + /** + * 错误信息 + */ + private String errMsg = ""; + + /** + * 参数验证 + * + * @return + */ + public boolean paramCheck() { + if (ObjectUtil.isEmpty(category)) { + errMsg = MsgCode.PS012.get(); + return true; + } + if (ObjectUtil.isEmpty(title)) { + errMsg = MsgCode.SYS130.get(); + return true; + } + if (Objects.equals(this.allDay, 1)) { + if (startDay > endDay) { + errMsg = MsgCode.SYS131.get(); + return true; + } + } + return false; + } +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/schedule/ScheduleNewDetailInfoVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/schedule/ScheduleNewDetailInfoVO.java new file mode 100644 index 0000000..30659b6 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/schedule/ScheduleNewDetailInfoVO.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.base.model.schedule; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +/** + * @author 云筑产品开发平台组 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + */ +@Data +public class ScheduleNewDetailInfoVO extends ScheduleNewListVO { + + @Schema(description ="参与人") + private String toUserIds; + @Schema(description ="附件") + private String files; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/schedule/ScheduleNewInfoVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/schedule/ScheduleNewInfoVO.java new file mode 100644 index 0000000..7babad1 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/schedule/ScheduleNewInfoVO.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.base.model.schedule; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + */ +@Data +public class ScheduleNewInfoVO extends ScheduleNewListVO { + + @Schema(description ="参与人") + private List toUserIds; + @Schema(description ="附件") + private String files; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/schedule/ScheduleNewListVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/schedule/ScheduleNewListVO.java new file mode 100644 index 0000000..d0ecdcc --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/schedule/ScheduleNewListVO.java @@ -0,0 +1,71 @@ +package com.yunzhupaas.base.model.schedule; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + */ +@Data +public class ScheduleNewListVO { + @Schema(description ="主键") + private String id; + + @Schema(description ="工作类型") + private String category; + + @Schema(description ="紧急程度") + private String urgent; + + @Schema(description ="标题") + private String title; + + @Schema(description ="内容") + private String content; + + @Schema(description ="是否全天") + private Integer allDay; + + @Schema(description ="开始时间") + private Long startDay; + + @Schema(description ="开始时间") + private String startTime; + + @Schema(description ="结束时间") + private Long endDay; + + @Schema(description ="结束时间") + private String endTime; + + @Schema(description ="时长") + private Integer duration; + + @Schema(description ="颜色") + private String color; + + @Schema(description ="提醒时间") + private Integer reminderTime; + + @Schema(description ="提醒方式") + private Integer reminderType; + + @Schema(description ="发送配置") + private String send; + + @Schema(description ="发送名称") + private String sendName; + + @Schema(description ="重复提醒") + private Integer repetition; + + @Schema(description ="结束重复") + private Long repeatTime; + + @Schema(description ="创建人") + private String creatorUserId; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/schedule/ScheduleNewTime.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/schedule/ScheduleNewTime.java new file mode 100644 index 0000000..7736175 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/schedule/ScheduleNewTime.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.base.model.schedule; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ScheduleNewTime { + @Schema(description = "开始时间") + private String startTime; + @Schema(description = "结束时间") + private String endTime; + @Schema(description = "当前时间") + private String dateTime; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/schedule/ScheduleNewUpForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/schedule/ScheduleNewUpForm.java new file mode 100644 index 0000000..2916083 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/schedule/ScheduleNewUpForm.java @@ -0,0 +1,7 @@ +package com.yunzhupaas.base.model.schedule; +import lombok.Data; + +@Data +public class ScheduleNewUpForm extends ScheduleNewCrForm { +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/sign/SignForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/sign/SignForm.java new file mode 100644 index 0000000..bf3797f --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/sign/SignForm.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.base.model.sign; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import java.util.Date; + +/** + * 个人签名 + * + * @author 云筑产品开发平台组 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/28 + */ +@Data +public class SignForm { + + @Schema(description = "签名图片") + private String signImg; + @Schema(description = "状态") + private Integer isDefault; + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/sign/SignListVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/sign/SignListVO.java new file mode 100644 index 0000000..5b54a46 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/sign/SignListVO.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.base.model.sign; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * 个人签名 + * + * @author 云筑产品开发平台组 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/28 + */ +@Data +public class SignListVO { + @Schema(description = "id") + private String id; + @Schema(description = "签名图片") + private String signImg; + @Schema(description = "是否默认") + private Integer isDefault; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/signature/InnerUserModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/signature/InnerUserModel.java new file mode 100644 index 0000000..4cfd4ac --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/signature/InnerUserModel.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.base.model.signature; + +import lombok.Data; + +@Data +public class InnerUserModel { + public String id; + /** + * 账户 + */ + private String account; + + /** + * 姓名 + */ + private String realName; + /** + * 签章主键 + */ + private String signatureId; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/signature/PaginationSignature.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/signature/PaginationSignature.java new file mode 100644 index 0000000..071134e --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/signature/PaginationSignature.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.base.model.signature; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + */ +@Data +public class PaginationSignature extends Pagination { + @Schema(description = "用户主键") + private String userId; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/signature/SignatureCrForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/signature/SignatureCrForm.java new file mode 100644 index 0000000..f625ded --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/signature/SignatureCrForm.java @@ -0,0 +1,30 @@ +package com.yunzhupaas.base.model.signature; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import jakarta.validation.constraints.NotNull; +import java.util.ArrayList; +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + */ +@Data +public class SignatureCrForm { + + @NotNull(message = "名称不能为空") + @Schema(description ="名称") + private String fullName; + + @NotNull(message = "编码不能为空") + @Schema(description ="编码") + private String enCode; + + @Schema(description ="授权人") + private List userIds = new ArrayList<>(); + + @Schema(description ="签章") + private String icon; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/signature/SignatureInfoVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/signature/SignatureInfoVO.java new file mode 100644 index 0000000..4726a5c --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/signature/SignatureInfoVO.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.base.model.signature; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + */ +@Data +public class SignatureInfoVO { + @Schema(description ="主键") + private String id; + @Schema(description ="名称") + private String fullName; + @Schema(description ="编码") + private String enCode; + @Schema(description ="授权人") + private List userIds; + @Schema(description ="签章") + private String icon; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/signature/SignatureListByIdsModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/signature/SignatureListByIdsModel.java new file mode 100644 index 0000000..5260f67 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/signature/SignatureListByIdsModel.java @@ -0,0 +1,14 @@ +package com.yunzhupaas.base.model.signature; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class SignatureListByIdsModel implements Serializable { + @Schema(description = "主键集合") + private List ids; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/signature/SignatureListVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/signature/SignatureListVO.java new file mode 100644 index 0000000..07ee158 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/signature/SignatureListVO.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.base.model.signature; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +/** + * @author 云筑产品开发平台组 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + */ +@Data +public class SignatureListVO { + + @Schema(description ="主键") + private String id; + @Schema(description ="名称") + private String fullName; + @Schema(description ="编码") + private String enCode; + @Schema(description ="授权人") + private String userIds; + @Schema(description ="创建时间") + private Long creatorTime; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/signature/SignatureSelectorListVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/signature/SignatureSelectorListVO.java new file mode 100644 index 0000000..9cf39d6 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/signature/SignatureSelectorListVO.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.base.model.signature; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +@Data +public class SignatureSelectorListVO implements Serializable { + @Schema(description ="主键") + private String id; + @Schema(description ="名称") + private String fullName; + @Schema(description ="编码") + private String enCode; + @Schema(description ="签章") + private String icon; + @JsonIgnore + private List signatureUserList; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/signature/SignatureUpForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/signature/SignatureUpForm.java new file mode 100644 index 0000000..fc23f7a --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/signature/SignatureUpForm.java @@ -0,0 +1,7 @@ +package com.yunzhupaas.base.model.signature; +import lombok.Data; + +@Data +public class SignatureUpForm extends SignatureCrForm { +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/smstemplate/SmsTemplateCrForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/smstemplate/SmsTemplateCrForm.java new file mode 100644 index 0000000..02a8d5d --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/smstemplate/SmsTemplateCrForm.java @@ -0,0 +1,48 @@ +package com.yunzhupaas.base.model.smstemplate; + +import lombok.Data; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.Map; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-12-09 + */ +@Data +public class SmsTemplateCrForm implements Serializable { + @NotBlank(message = "模板编号不能为空") + private String templateId; + @NotBlank(message = "模板名称不能为空") + private String fullName; + @NotNull(message = "短信厂家不能为空") + private Integer company; + private String appId; + @NotBlank(message = "签名内容不能为空") + private String signContent; + private Integer enabledMark; + /** + * 测试短信接收人 + */ + private String phoneNumbers; + + private Map parameters; + + @NotBlank(message = "模板编码不能为空") + private String enCode; + + /** + * Endpoint + */ + private String endpoint; + + /** + * region + */ + private String region; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/smstemplate/SmsTemplateListVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/smstemplate/SmsTemplateListVO.java new file mode 100644 index 0000000..238ed07 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/smstemplate/SmsTemplateListVO.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.base.model.smstemplate; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 短信列表模型 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-12-09 + */ +@Data +public class SmsTemplateListVO implements Serializable { + private String id; + private String company; + private Integer enabledMark; + private String fullName; + private String enCode; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/smstemplate/SmsTemplateSelector.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/smstemplate/SmsTemplateSelector.java new file mode 100644 index 0000000..ca88d8b --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/smstemplate/SmsTemplateSelector.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.base.model.smstemplate; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-12-11 + */ +@Data +public class SmsTemplateSelector implements Serializable { + private String id; + private String fullName; + private String enCode; + private String company; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/smstemplate/SmsTemplateUpForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/smstemplate/SmsTemplateUpForm.java new file mode 100644 index 0000000..cd8a7b0 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/smstemplate/SmsTemplateUpForm.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.base.model.smstemplate; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-12-09 + */ +@Data +public class SmsTemplateUpForm extends SmsTemplateCrForm implements Serializable { + +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/smstemplate/SmsTemplateVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/smstemplate/SmsTemplateVO.java new file mode 100644 index 0000000..362bff3 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/smstemplate/SmsTemplateVO.java @@ -0,0 +1,28 @@ +package com.yunzhupaas.base.model.smstemplate; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 回显短信模板 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-12-09 + */ +@Data +public class SmsTemplateVO implements Serializable { + private String id; + private String templateId; + private Integer company; + private String signContent; + private Integer enabledMark; + private String fullName; + + private String enCode; + private String endpoint; + private String region; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/systemconfig/EmailTestForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/systemconfig/EmailTestForm.java new file mode 100644 index 0000000..f68ef7a --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/systemconfig/EmailTestForm.java @@ -0,0 +1,37 @@ +package com.yunzhupaas.base.model.systemconfig; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import jakarta.validation.constraints.NotBlank; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class EmailTestForm { + @NotBlank(message = "必填") + @Schema(description = "邮箱地址") + private String account; + @NotBlank(message = "必填") + @Schema(description = "邮箱密码") + private String password; + @NotBlank(message = "必填") + @Schema(description = "POP3服务") + private String pop3Host; + @NotBlank(message = "必填") + @Schema(description = "POP3端口") + private Integer pop3Port; + @NotBlank(message = "必填") + @Schema(description = "SMTP服务") + private String smtpHost; + @NotBlank(message = "必填") + @Schema(description = "SMTP端口") + private Integer smtpPort; + @Schema(description = "ssl登录") + private String ssl ; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/systemconfig/SaveSysConfigForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/systemconfig/SaveSysConfigForm.java new file mode 100644 index 0000000..540acf4 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/systemconfig/SaveSysConfigForm.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.base.model.systemconfig; + +import lombok.Data; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class SaveSysConfigForm { + List configList; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/systemconfig/SysConfigListVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/systemconfig/SysConfigListVO.java new file mode 100644 index 0000000..dd94e98 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/systemconfig/SysConfigListVO.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.base.model.systemconfig; + +import lombok.Data; + +import java.util.List; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class SysConfigListVO { + List list; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/systemconfig/SysConfigModel.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/systemconfig/SysConfigModel.java new file mode 100644 index 0000000..2a943a7 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/systemconfig/SysConfigModel.java @@ -0,0 +1,308 @@ +package com.yunzhupaas.base.model.systemconfig; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/12 15:31 + */ +@Data +public class SysConfigModel { + @NotBlank(message = "必填") + @Schema(description = "系统名称") + private String sysName; + @NotBlank(message = "必填") + @Schema(description = "系统描述") + private String sysDescription; + @NotBlank(message = "必填") + @Schema(description = "系统版本") + private String sysVersion; + @NotBlank(message = "必填") + @Schema(description = "版权信息") + private String copyright; + @NotBlank(message = "必填") + @Schema(description = "公司名称") + private String companyName; + @NotBlank(message = "必填") + @Schema(description = "公司简称") + private String companyCode; + @NotBlank(message = "必填") + @Schema(description = "公司地址") + private String companyAddress; + @NotBlank(message = "必填") + @Schema(description = "公司法人") + private String companyContacts; + @NotBlank(message = "必填") + @Schema(description = "公司电话") + private String companyTelePhone; + @NotBlank(message = "必填") + @Schema(description = "公司邮箱") + private String companyEmail; + + /** + * 登录图标 + */ + @Schema(description = "登录图标") + private String loginIcon; + + /** + * 导航图标 + */ + @Schema(description = "导航图标") + private String navigationIcon; + /** + * logo图标 + */ + @Schema(description = "logo图标") + private String logoIcon; + /** + * App图标 + */ + @Schema(description = "App图标") + private String appIcon; + + /** + * 1--后登陆踢出先登录 + * 2--同时登陆 + */ + @NotBlank(message = "必填") + @Schema(description = "单一登录方式") + private Integer singleLogin; + /** + * 密码错误次数 + */ + @Schema(description = "密码错误次数") + @NotNull(message = "必填") + private Integer passwordErrorsNumber; + /** + * 错误策略 1--账号锁定 2--延时登录 + */ + @Schema(description = "错误策略") + private Integer lockType; + /** + * 延时登录时间 + */ + @Schema(description = "延时登录时间") + private Integer lockTime; + /** + * 是否开启验证码 + */ + @Schema(description = "是否开启验证码") + private Integer enableVerificationCode; + /** + * 验证码位数 + */ + @Schema(description = "验证码位数") + private Integer verificationCodeNumber; + + + @NotBlank(message = "必填") + @Schema(description = "超出登出") + private String tokenTimeout; + @NotBlank(message = "必填") + @Schema(description = "是否开启上次登录提醒") + private Integer lastLoginTimeSwitch; + @NotBlank(message = "必填") + @Schema(description = "是否开启白名单验证") + private Integer whitelistSwitch; + @NotBlank(message = "必填") + @Schema(description = "白名单") + private String whiteListIp; + @NotBlank(message = "必填") + @Schema(description = "POP3服务主机地址") + private String emailPop3Host; + @NotBlank(message = "必填") + @Schema(description = "POP3服务端口") + private String emailPop3Port; + @NotBlank(message = "必填") + @Schema(description = "SMTP服务主机地址") + private String emailSmtpHost; + @NotBlank(message = "必填") + @Schema(description = "邮件显示名称") + private String emailSmtpPort; + @NotBlank(message = "必填") + @Schema(description = "系统名称") + private String emailSenderName; + @NotBlank(message = "必填") + @Schema(description = "邮箱账户") + private String emailAccount; + @NotBlank(message = "必填") + @Schema(description = "邮箱密码") + private String emailPassword; + @NotBlank(message = "必填") + @Schema(description = "是否开启SSL服务登录") + private Integer emailSsl; + + + @NotBlank(message = "必填") + @Schema(description = "授权密钥") + private String registerKey; + private String lastLoginTime; + private String pageSize; + private String sysTheme; + private String isLog; + + // 短信配置 + /** + * 阿里 + */ + private String aliAccessKey; + private String aliSecret; + + /** + * 腾讯 + */ + private String tencentSecretId; + private String tencentSecretKey; + private String tencentAppId; + private String tencentAppKey; + // End 短信配置 + + /** + * 企业微信配置 + */ + /** 发消息 */ + private String qyhCorpId; + private String qyhAgentId; + private String qyhAgentSecret; + /** 同步消息 */ + private String qyhCorpSecret; + private Integer qyhIsSynOrg; + private Integer qyhIsSynUser; + + /** + * 钉钉 发消息 + */ + private String dingSynAppKey; + private String dingSynAppSecret; + private String dingAgentId; + private Integer dingSynIsSynOrg; + private Integer dingSynIsSynUser; + + /** + * 审批链接时效性 + */ + private String linkTime; + + /** + * 链接点击次数 + */ + private Integer isClick; + + /** + * 链接失效次数 + */ + private Integer unClickNum; + + /** 密码策略 */ + /** + * 密码定期更新开关 + */ + private Integer passwordIsUpdatedRegularly; + + /** + * 更新周期 + */ + private Integer updateCycle; + + /** + * 提前N天提醒更新 + */ + private Integer updateInAdvance; + + /** + * 密码强度限制开关 + */ + private Integer passwordStrengthLimit; + + /** + * 最小长度开关 + */ + private Integer passwordLengthMin; + + /** + * 密码最小长度限制 + */ + private Integer passwordLengthMinNumber; + + /** + * 是否包含数字 + */ + private Integer containsNumbers; + + /** + * 是否包含小写字母 + */ + private Integer includeLowercaseLetters; + + /** + * 是否包含大写字母 + */ + private Integer includeUppercaseLetters; + + /** + * 是否包含字符 + */ + private Integer containsCharacters; + + /** + * 是否禁用旧密码开关 + */ + private Integer disableOldPassword; + + /** + * 禁用旧密码个数 + */ + private Integer disableTheNumberOfOldPasswords; + + /** + * 初始密码强制修改开关 + */ + private Integer mandatoryModificationOfInitialPassword; + + @Schema(description = "窗口标题") + private String title; + + @Schema(description = "用户密码") + private String newUserDefaultPassword; + + /** + * 以下日程相关属性添加 + * { id: 'timeGridDay', fullName: '日' }, + * { id: 'timeGridWeek', fullName: '周' }, + * { id: 'dayGridMonth', fullName: '月' }, + */ + @Schema(description = "默认视图") + private String defaultView = "dayGridMonth"; + @Schema(description = "显示农历") + private Boolean showLunarCalendar = false; + @Schema(description = "周第一天") + private Integer firstDay = 0; + @Schema(description = "默认时长") + private Integer duration = 60; + + @Schema(description = "流程签收") + private Integer flowSign = 0; + @Schema(description = "流程办理") + private Integer flowTodo = 0; + /** + * 1:无范围限制 2:同一部门 3:同一岗位 6:同一公司 + */ + @Schema(description = "委托范围") + private Integer delegateScope = 1; + @Schema(description = "委托确认") + private Integer delegateAck = 0; + @Schema(description = "代理范围") + private Integer proxyScope = 1; + @Schema(description = "代理确认") + private Integer proxyAck = 0; + @Schema(description = "加签层级") + private Integer addSignLevel = 1; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/visualkit/KitPagination.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/visualkit/KitPagination.java new file mode 100644 index 0000000..64906e4 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/visualkit/KitPagination.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.base.model.visualkit; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import lombok.Data; + +/** + * 套件查询参数 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/8/22 11:32:15 + */ +@Data +@Schema(description = "套件查询参数") +public class KitPagination extends Pagination { + + @Schema(description = "分类(数据字典)") + private String category; + + @Schema(description = "状态:0-禁用,1-启用") + private Integer enabledMark; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/visualkit/KitTreeVo.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/visualkit/KitTreeVo.java new file mode 100644 index 0000000..49f0568 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/visualkit/KitTreeVo.java @@ -0,0 +1,48 @@ +package com.yunzhupaas.base.model.visualkit; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +@Data +@Schema(description = "套件树形属性") +public class KitTreeVo { + + @Schema(description = "id") + private String id; + + @Schema(description = "parentId") + private String parentId; + + @Schema(description = "是否有子数据") + private boolean hasChildren = false; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "编码") + private String enCode; + + @Schema(description = "分类(数据字典)") + private String category; + + @Schema(description = "图标") + private String icon; + + @Schema(description = "排序") + private Long sortCode; + + @Schema(description = "状态") + private Integer enabledMark; + + @Schema(description = "说明") + private String description; + + @Schema(description = "套件设计内容") + private String formData; + + @Schema(description = "套件设计内容") + private List children; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/visualkit/VisualKitForm.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/visualkit/VisualKitForm.java new file mode 100644 index 0000000..ec5cbdd --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/visualkit/VisualKitForm.java @@ -0,0 +1,50 @@ +package com.yunzhupaas.base.model.visualkit; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import lombok.Data; + +/** + * 套件表单信息 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/8/22 11:50:38 + */ +@Data +@Schema(description = "套件表单信息") +public class VisualKitForm { + + @Schema(description = "id") + private String id; + + @NotBlank + @Schema(description = "名称") + private String fullName; + + @NotBlank + @Schema(description = "编码") + private String enCode; + + @NotBlank + @Schema(description = "分类(数据字典)") + private String category; + + @NotBlank + @Schema(description = "图标") + private String icon; + + @Schema(description = "排序") + private Long sortCode; + + @Schema(description = "状态") + private Integer enabledMark; + + @Schema(description = "说明") + private String description; + + @Schema(description = "套件设计内容") + private String formData; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/visualkit/VisualKitInfoVo.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/visualkit/VisualKitInfoVo.java new file mode 100644 index 0000000..5306777 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/visualkit/VisualKitInfoVo.java @@ -0,0 +1,64 @@ +package com.yunzhupaas.base.model.visualkit; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import lombok.Data; + +/** + * 套件详细信息 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/8/22 11:50:38 + */ +@Data +@Schema(description = "套件详细信息") +public class VisualKitInfoVo { + + @Schema(description = "id") + private String id; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "编码") + private String enCode; + + @Schema(description = "分类(数据字典)") + private String category; + + @Schema(description = "图标") + private String icon; + + @Schema(description = "排序") + private Long sortCode; + + @Schema(description = "状态") + private Integer enabledMark; + + @Schema(description = "说明") + private String description; + + @Schema(description = "套件设计内容") + private String formData; + + @Schema(description = "创建时间") + private Long creatorTime; + + @Schema(description = "创建人") + private String creatorUser; + + @Schema(description = "创建人id") + private String creatorUserId; + + @Schema(description = "修改时间") + private Long lastModifyTime; + + @Schema(description = "修改人") + private String lastModifyUser; + + @Schema(description = "修改人id") + private String lastModifyUserId; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/visualkit/VisualKitVo.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/visualkit/VisualKitVo.java new file mode 100644 index 0000000..c225a0c --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/visualkit/VisualKitVo.java @@ -0,0 +1,57 @@ +package com.yunzhupaas.base.model.visualkit; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 表单套件列表信息 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/8/22 11:20:49 + */ +@Data +@Schema(description = "套件列表信息") +public class VisualKitVo { + + @Schema(description = "id") + private String id; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "编码") + private String enCode; + + @Schema(description = "分类(数据字典)") + private String category; + + @Schema(description = "图标") + private String icon; + + @Schema(description = "创建时间") + private Long creatorTime; + + @Schema(description = "创建人") + private String creatorUser; + + @Schema(description = "创建人id") + private String creatorUserId; + + @Schema(description = "修改时间") + private Long lastModifyTime; + + @Schema(description = "修改人") + private String lastModifyUser; + + @Schema(description = "修改人id") + private String lastModifyUserId; + + @Schema(description = "排序") + private Long sortCode; + + @Schema(description = "状态:0-禁用,1-启用") + private Integer enabledMark; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/vo/PrintDevListVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/vo/PrintDevListVO.java new file mode 100644 index 0000000..45ca384 --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/vo/PrintDevListVO.java @@ -0,0 +1,59 @@ +package com.yunzhupaas.base.model.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 分页列表 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-11-20 + */ +@Data +@Schema(description = "打印列表") +public class PrintDevListVO { + @Schema(description = "主键id") + private String id; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "编码") + private String enCode; + + @Schema(description = "分类") + private String category; + + @Schema(description = "创建人") + private String creatorUser; + + @Schema(description = "创建时间") + private Long creatorTime; + + @Schema(description = "修改人") + private String lastModifyUser; + + @Schema(description = "修改时") + private Long lastModifyTime; + + @Schema(description = "排序") + private Long sortCode; + + @Schema(description = "状态:0-未发布,1-已发布,2-已修改") + private Integer state; + + @Schema(description = "通用-将该模板设为通用(0-表单用,1-业务打印模板用)") + private Integer commonUse; + + @Schema(description = "发布范围:1-公开,2-权限设置") + private Integer visibleType; + + @Schema(description = "图标") + private String icon; + + @Schema(description = "图标颜色") + private String iconBackground; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/vo/PrintDevVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/vo/PrintDevVO.java new file mode 100644 index 0000000..a8bc90d --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/vo/PrintDevVO.java @@ -0,0 +1,145 @@ +package com.yunzhupaas.base.model.vo; + +import com.yunzhupaas.base.model.print.PrintDevTreeModel; +import lombok.Data; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 打印模板数视图对象 + * + * @author 云筑产品开发平台组 YY + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-30 + */ +@Data +public class PrintDevVO { + + /** + * 分类下模板数量 + */ + private Integer num; + + /** + * 主键_id + */ + private String id; + + /** + * 名称 + */ + private String fullName; + + /** + * 编码 + */ + private String encode; + + /** + * 分类 + */ + private String category; + + /** + * 类型 + */ + private Integer type; + + /** + * 描述 + */ + private String description; + + /** + * 排序码 + */ + private Integer sortCode; + + /** + * 有效标志 + */ + private Integer enabledMark; + + /** + * 创建时间 + */ + private LocalDateTime creatorTime; + + /** + * 创建用户_id + */ + private String creatorUserId; + + /** + * 修改时间 + */ + private LocalDateTime lastModifyTime; + + /** + * 修改用户_id + */ + private String lastModifyUserId; + + /** + * 删除标志 + */ + private Integer deleteMark; + + /** + * 删除时间 + */ + private LocalDateTime deleteTime; + + /** + * 删除用户_id + */ + private String deleteUserId; + + /** + * 连接数据 _id + */ + private String dbLinkId; + + /** + * sql语句 + */ + private String sqlTemplate; + + /** + * 左侧字段 + */ + private String leftFields; + + /** + * 打印模板 + */ + private String printTemplate; + + /** + * 通用-将该模板设为通用(0-表单用,1-业务打印模板用) + */ + private Integer commonUse; + + /** + * 发布范围:1-公开,2-权限设置 + */ + private Integer visibleType; + + /** + * 图标 + */ + private String icon; + + /** + * 图标颜色 + */ + private String iconBackground; + + /** + * 子节点 + */ + private List children; +} + diff --git a/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/vo/PrintLogVO.java b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/vo/PrintLogVO.java new file mode 100644 index 0000000..6619cdc --- /dev/null +++ b/yunzhupaas-system/yunzhupaas-system-entity/src/main/java/com/yunzhupaas/base/model/vo/PrintLogVO.java @@ -0,0 +1,68 @@ +package com.yunzhupaas.base.model.vo; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.util.Date; + + +@Data +public class PrintLogVO { + + /** + * 打印人 + */ + private String printMan; + /** + * 打印时间 + */ + private Long printTime; + /** + * 打印条数 + */ + private Integer printNum; + /** + * 打印功能名称 + */ + private String printTitle; + + /** + * 基于哪一个模板 + */ + private String printId; + + /** + * 日志id + */ + @JsonIgnore + private String id; + + /** + * 账号 + */ + @JsonIgnore + private String account; + + /** + * 名称 + */ + @JsonIgnore + private String realName; + /** + * 打印时间 + */ + @JsonIgnore + private Date creatorTime; + + public Long getPrintTime() { + if (this.creatorTime == null) { + return null; + } + return this.creatorTime.getTime(); + } + + public String getPrintMan() { + return this.realName + "/" + this.account; + } +} + diff --git a/yunzhupaas-train/pom.xml b/yunzhupaas-train/pom.xml new file mode 100644 index 0000000..5c14b37 --- /dev/null +++ b/yunzhupaas-train/pom.xml @@ -0,0 +1,20 @@ + + + + yunzhupaas-java-boot + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-train + pom + + yunzhupaas-train-entity + yunzhupaas-train-biz + yunzhupaas-train-controller + + + diff --git a/yunzhupaas-train/yunzhupaas-train-biz/pom.xml b/yunzhupaas-train/yunzhupaas-train-biz/pom.xml new file mode 100644 index 0000000..9f32bc3 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-biz/pom.xml @@ -0,0 +1,27 @@ + + + + yunzhupaas-train + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-train-biz + + + + com.yunzhupaas + yunzhupaas-train-entity + ${project.version} + + + com.yunzhupaas + yunzhupaas-generater-base + ${project.version} + + + + diff --git a/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/mapper/TrainExamRecordsMapper.java b/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/mapper/TrainExamRecordsMapper.java new file mode 100644 index 0000000..a899d92 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/mapper/TrainExamRecordsMapper.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.mapper; + + +import com.yunzhupaas.entity.TrainExamRecordsEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.mapper.SuperMapper; + +/** + * 考试记录 + * 版本: V5.2.0 + * 版权: Copyright @ 2025 + * 作者: 浙江尖峰集团股份有限公司 + * 日期: 2024-11-06 + */ +public interface TrainExamRecordsMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/mapper/TrainLibraryEssayQuestionMapper.java b/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/mapper/TrainLibraryEssayQuestionMapper.java new file mode 100644 index 0000000..1fb8ef7 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/mapper/TrainLibraryEssayQuestionMapper.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.mapper; + + +import com.yunzhupaas.dto.EssayQuestionDTO; +import com.yunzhupaas.entity.TrainLibraryEssayQuestionEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.mapper.SuperMapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 在线考试 + * 版本: V5.2.0 + * 版权: Copyright @ 2025 + * 作者: 浙江尖峰集团股份有限公司 + * 日期: 2024-11-05 + */ +public interface TrainLibraryEssayQuestionMapper extends SuperMapper { + + List getListByParentId(@Param("parentId") String id); + + void updateResult(@Param("items") List essayQuestions); +} + diff --git a/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/mapper/TrainLibraryJudgmentMapper.java b/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/mapper/TrainLibraryJudgmentMapper.java new file mode 100644 index 0000000..a9b4004 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/mapper/TrainLibraryJudgmentMapper.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.mapper; + + +import com.yunzhupaas.entity.TrainLibraryJudgmentEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.mapper.SuperMapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 在线考试 + * 版本: V5.2.0 + * 版权: Copyright @ 2025 + * 作者: 浙江尖峰集团股份有限公司 + * 日期: 2024-11-05 + */ +public interface TrainLibraryJudgmentMapper extends SuperMapper { + + List getListByParentId(@Param("parentId") String id); +} + diff --git a/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/mapper/TrainLibraryMoreMapper.java b/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/mapper/TrainLibraryMoreMapper.java new file mode 100644 index 0000000..8c69b8c --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/mapper/TrainLibraryMoreMapper.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.mapper; + + +import com.yunzhupaas.entity.TrainLibraryMoreEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.mapper.SuperMapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 在线考试 + * 版本: V5.2.0 + * 版权: Copyright @ 2025 + * 作者: 浙江尖峰集团股份有限公司 + * 日期: 2024-11-05 + */ +public interface TrainLibraryMoreMapper extends SuperMapper { + + List getListByParentId(@Param("parentId") String id); +} + diff --git a/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/mapper/TrainLibrarySingleMapper.java b/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/mapper/TrainLibrarySingleMapper.java new file mode 100644 index 0000000..cafdc91 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/mapper/TrainLibrarySingleMapper.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.mapper; + + +import com.yunzhupaas.entity.TrainLibrarySingleEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.mapper.SuperMapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 在线考试 + * 版本: V5.2.0 + * 版权: Copyright @ 2025 + * 作者: 浙江尖峰集团股份有限公司 + * 日期: 2024-11-05 + */ +public interface TrainLibrarySingleMapper extends SuperMapper { + + List getListByParentId(@Param("parentId") String id); +} + diff --git a/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/mapper/TrainTestPaperLibraryMapper.java b/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/mapper/TrainTestPaperLibraryMapper.java new file mode 100644 index 0000000..fd02eaf --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/mapper/TrainTestPaperLibraryMapper.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.mapper; + + +import com.yunzhupaas.entity.TrainExamRecordsEntity; +import com.yunzhupaas.entity.TrainTestPaperLibraryEntity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.mapper.SuperMapper; + +/** + * 在线考试 + * 版本: V5.2.0 + * 版权: Copyright @ 2025 + * 作者: 浙江尖峰集团股份有限公司 + * 日期: 2024-11-05 + */ +public interface TrainTestPaperLibraryMapper extends SuperMapper { + + void saveRecords(TrainExamRecordsEntity recordsEntity); +} + diff --git a/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/service/TrainExamRecordsService.java b/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/service/TrainExamRecordsService.java new file mode 100644 index 0000000..9f0e00b --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/service/TrainExamRecordsService.java @@ -0,0 +1,39 @@ +package com.yunzhupaas.service; + +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.dto.InReadPaperDTO; +import com.yunzhupaas.dto.OutExamRecordsDetailDTO; +import com.yunzhupaas.entity.*; +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.model.trainexamrecords.*; +import java.util.*; + +/** + * 考试记录 + * 版本: V5.2.0 + * 版权: Copyright @ 2025 + * 作者: 浙江尖峰集团股份有限公司 + * 日期: 2024-11-06 + */ +public interface TrainExamRecordsService extends SuperService { + List getList(TrainExamRecordsPagination trainExamRecordsPagination); + + List getTypeList(TrainExamRecordsPagination trainExamRecordsPagination,String dataType); + + TrainExamRecordsEntity getInfo(String id); + + void delete(TrainExamRecordsEntity entity); + + void create(TrainExamRecordsEntity entity); + + boolean update(String id, TrainExamRecordsEntity entity); + + String checkForm(TrainExamRecordsForm form,int i); + + void saveOrUpdate(TrainExamRecordsForm trainExamRecordsForm,String id, boolean isSave) throws Exception; + + ActionResult examRecordsDetail(String id); + + ActionResult readPaper(InReadPaperDTO in); +} + diff --git a/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/service/TrainLibraryEssayQuestionService.java b/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/service/TrainLibraryEssayQuestionService.java new file mode 100644 index 0000000..a4b5790 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/service/TrainLibraryEssayQuestionService.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.service; + +import com.yunzhupaas.dto.EssayQuestionDTO; +import com.yunzhupaas.entity.*; +import com.yunzhupaas.base.service.SuperService; + +import java.util.List; + +/** + * 在线考试 + * 版本: V5.2.0 + * 版权: Copyright @ 2025 + * 作者: 浙江尖峰集团股份有限公司 + * 日期: 2024-11-05 + */ +public interface TrainLibraryEssayQuestionService extends SuperService { + List getListByParentId(String id); + + void updateResult(List essayQuestions); +} + diff --git a/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/service/TrainLibraryJudgmentService.java b/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/service/TrainLibraryJudgmentService.java new file mode 100644 index 0000000..46ccfe6 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/service/TrainLibraryJudgmentService.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.service; + +import com.yunzhupaas.entity.*; +import com.yunzhupaas.base.service.SuperService; + +import java.util.List; + +/** + * 在线考试 + * 版本: V5.2.0 + * 版权: Copyright @ 2025 + * 作者: 浙江尖峰集团股份有限公司 + * 日期: 2024-11-05 + */ +public interface TrainLibraryJudgmentService extends SuperService { + List getListByParentId(String id); +} + diff --git a/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/service/TrainLibraryMoreService.java b/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/service/TrainLibraryMoreService.java new file mode 100644 index 0000000..539a5b1 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/service/TrainLibraryMoreService.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.service; + +import com.yunzhupaas.entity.*; +import com.yunzhupaas.base.service.SuperService; + +import java.util.List; + +/** + * 在线考试 + * 版本: V5.2.0 + * 版权: Copyright @ 2025 + * 作者: 浙江尖峰集团股份有限公司 + * 日期: 2024-11-05 + */ +public interface TrainLibraryMoreService extends SuperService { + List getListByParentId(String id); +} + diff --git a/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/service/TrainLibrarySingleService.java b/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/service/TrainLibrarySingleService.java new file mode 100644 index 0000000..6ab68c4 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/service/TrainLibrarySingleService.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.service; + +import com.yunzhupaas.entity.*; +import com.yunzhupaas.base.service.SuperService; + +import java.util.List; + +/** + * 在线考试 + * 版本: V5.2.0 + * 版权: Copyright @ 2025 + * 作者: 浙江尖峰集团股份有限公司 + * 日期: 2024-11-05 + */ +public interface TrainLibrarySingleService extends SuperService { + List getListByParentId(String id); +} + diff --git a/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/service/TrainTestPaperLibraryService.java b/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/service/TrainTestPaperLibraryService.java new file mode 100644 index 0000000..c266b98 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/service/TrainTestPaperLibraryService.java @@ -0,0 +1,36 @@ +package com.yunzhupaas.service; + +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.dto.OnlineExamSubmitDTO; +import com.yunzhupaas.entity.*; +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.model.traintestpaperlibrary.*; +import java.util.*; + +/** + * 在线考试 + * 版本: V5.2.0 + * 版权: Copyright @ 2025 + * 作者: 浙江尖峰集团股份有限公司 + * 日期: 2024-11-05 + */ +public interface TrainTestPaperLibraryService extends SuperService { + List getList(TrainTestPaperLibraryPagination trainTestPaperLibraryPagination); + + List getTypeList(TrainTestPaperLibraryPagination trainTestPaperLibraryPagination,String dataType); + + TrainTestPaperLibraryEntity getInfo(String id); + + void delete(TrainTestPaperLibraryEntity entity); + + void create(TrainTestPaperLibraryEntity entity); + + boolean update(String id, TrainTestPaperLibraryEntity entity); + + String checkForm(TrainTestPaperLibraryForm form,int i); + + void saveOrUpdate(TrainTestPaperLibraryForm trainTestPaperLibraryForm,String id, boolean isSave) throws Exception; + + ActionResult onlineExamSubmit(OnlineExamSubmitDTO onlineExamSubmitDTO); +} + diff --git a/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/service/impl/TrainExamRecordsServiceImpl.java b/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/service/impl/TrainExamRecordsServiceImpl.java new file mode 100644 index 0000000..03e6c17 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/service/impl/TrainExamRecordsServiceImpl.java @@ -0,0 +1,956 @@ +package com.yunzhupaas.service.impl; + +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.dto.*; +import com.yunzhupaas.entity.*; +import com.yunzhupaas.mapper.TrainExamRecordsMapper; +import com.yunzhupaas.service.*; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yunzhupaas.model.trainexamrecords.*; +import org.springframework.stereotype.Service; +import com.yunzhupaas.base.service.SuperServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import com.yunzhupaas.util.GeneraterSwapUtil; + +import java.sql.Connection; +import java.sql.SQLException; + +import lombok.Cleanup; +import com.yunzhupaas.database.plugins.DynamicSourceGeneratorInterface; +import com.yunzhupaas.database.util.DynamicDataSourceUtil; +import org.apache.commons.collections4.CollectionUtils; +import com.yunzhupaas.i18n.util.I18nUtil; +import com.yunzhupaas.exception.DataException; + +import java.math.BigDecimal; + +import cn.hutool.core.util.ObjectUtil; + +import java.lang.reflect.Field; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +import com.yunzhupaas.base.model.ColumnDataModel; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.transaction.annotation.Transactional; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.github.yulichang.toolkit.JoinWrappers; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.yunzhupaas.model.QueryAllModel; + +import java.text.SimpleDateFormat; + +import com.yunzhupaas.util.*; + +import java.util.*; + +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.permission.entity.UserEntity; +import com.github.pagehelper.PageHelper; + +/** + * 考试记录 + * 版本: V5.2.0 + * 版权: Copyright @ 2025 + * 作者: 浙江尖峰集团股份有限公司 + * 日期: 2024-11-06 + */ +@Service +public class TrainExamRecordsServiceImpl extends SuperServiceImpl + implements TrainExamRecordsService { + @Autowired + private GeneraterSwapUtil generaterSwapUtil; + @Autowired + private TrainExamRecordsService trainExamRecordsService; + @Autowired + private UserProvider userProvider; + @Autowired + private TrainTestPaperLibraryService trainTestPaperLibraryService; + @Autowired + private TrainLibrarySingleService trainLibrarySingleService; + @Autowired + private TrainLibraryMoreService trainLibraryMoreService; + @Autowired + private TrainLibraryJudgmentService trainLibraryJudgmentService; + @Autowired + private TrainLibraryEssayQuestionService trainLibraryEssayQuestionService; + + @Override + public List getList(TrainExamRecordsPagination trainExamRecordsPagination) { + return getTypeList(trainExamRecordsPagination, trainExamRecordsPagination.getDataType()); + } + + /** + * 列表查询 + */ + @Override + public List getTypeList(TrainExamRecordsPagination trainExamRecordsPagination, + String dataType) { + String userId = userProvider.get().getUserId(); + Map tableClassMap = new HashMap<>(); + tableClassMap.put("make_train_exam_records", TrainExamRecordsEntity.class); + tableClassMap.put("make_train_library_essay_question", TrainLibraryEssayQuestionEntity.class); + tableClassMap.put("make_train_library_judgment", TrainLibraryJudgmentEntity.class); + tableClassMap.put("make_train_library_more", TrainLibraryMoreEntity.class); + tableClassMap.put("make_train_library_single", TrainLibrarySingleEntity.class); + + MPJLambdaWrapper wrapper = JoinWrappers + .lambda("make_train_exam_records", TrainExamRecordsEntity.class) + .selectCollection(TrainLibraryEssayQuestionEntity.class, + TrainExamRecordsEntity::getTrainLibraryEssayQuestion) + .leftJoin(TrainLibraryEssayQuestionEntity.class, "make_train_library_essay_question", + TrainLibraryEssayQuestionEntity::getFbankId, TrainExamRecordsEntity::getId) + .selectCollection(TrainLibraryJudgmentEntity.class, TrainExamRecordsEntity::getTrainLibraryJudgment) + .leftJoin(TrainLibraryJudgmentEntity.class, "make_train_library_judgment", + TrainLibraryJudgmentEntity::getFbankId, TrainExamRecordsEntity::getId) + .selectCollection(TrainLibraryMoreEntity.class, TrainExamRecordsEntity::getTrainLibraryMore) + .leftJoin(TrainLibraryMoreEntity.class, "make_train_library_more", TrainLibraryMoreEntity::getFbankId, + TrainExamRecordsEntity::getId) + .selectCollection(TrainLibrarySingleEntity.class, TrainExamRecordsEntity::getTrainLibrarySingle) + .leftJoin(TrainLibrarySingleEntity.class, "make_train_library_single", + TrainLibrarySingleEntity::getFbankId, TrainExamRecordsEntity::getId) + .selectAll(TrainExamRecordsEntity.class); + MPJLambdaWrapper wrapper2 = JoinWrappers + .lambda("make_train_exam_records", TrainExamRecordsEntity.class) + .leftJoin(TrainLibraryEssayQuestionEntity.class, "make_train_library_essay_question", + TrainLibraryEssayQuestionEntity::getFbankId, TrainExamRecordsEntity::getId) + .leftJoin(TrainLibraryJudgmentEntity.class, "make_train_library_judgment", + TrainLibraryJudgmentEntity::getFbankId, TrainExamRecordsEntity::getId) + .leftJoin(TrainLibraryMoreEntity.class, "make_train_library_more", TrainLibraryMoreEntity::getFbankId, + TrainExamRecordsEntity::getId) + .leftJoin(TrainLibrarySingleEntity.class, "make_train_library_single", + TrainLibrarySingleEntity::getFbankId, TrainExamRecordsEntity::getId) + .distinct().select(TrainExamRecordsEntity::getId); + + QueryAllModel queryAllModel = new QueryAllModel(); + queryAllModel.setWrapper(wrapper); + queryAllModel.setClassMap(tableClassMap); + queryAllModel.setDbLink(TrainExamRecordsConstant.DBLINKID); + // 数据过滤 + boolean isPc = ServletUtil.getHeader("yunzhupaas-origin").equals("pc"); + String columnData = !isPc ? TrainExamRecordsConstant.getAppColumnData() + : TrainExamRecordsConstant.getColumnData(); + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class); + String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) + : JsonUtil.getObjectToString(columnDataModel.getRuleList()); + queryAllModel.setRuleJson(ruleJson); + // 高级查询 + boolean hasSuperQuery = true; + if (hasSuperQuery) { + queryAllModel.setSuperJson(trainExamRecordsPagination.getSuperQueryJson()); + } + // 数据权限 + boolean pcPermission = true; + boolean appPermission = false; + if (isPc && pcPermission && !userProvider.get().getIsAdministrator()) { + queryAllModel.setModuleId(trainExamRecordsPagination.getMenuId()); + queryAllModel.setModuleId(trainExamRecordsPagination.getMenuId()); + } + if (!isPc && appPermission && !userProvider.get().getIsAdministrator()) { + queryAllModel.setModuleId(trainExamRecordsPagination.getMenuId()); + } + // 拼接复杂条件 + wrapper = generaterSwapUtil.getConditionAllTable(queryAllModel); + queryAllModel.setWrapper(wrapper2); + wrapper2 = generaterSwapUtil.getConditionAllTable(queryAllModel); + // 其他条件拼接 + otherConditions(trainExamRecordsPagination, wrapper, isPc); + otherConditions(trainExamRecordsPagination, wrapper2, isPc); + + if ("0".equals(dataType)) { + com.github.pagehelper.Page objects = PageHelper.startPage( + (int) trainExamRecordsPagination.getCurrentPage(), (int) trainExamRecordsPagination.getPageSize(), + true); + List userIPage = this.selectJoinList(TrainExamRecordsEntity.class, wrapper2); + List collect = userIPage.stream().map(t -> t.getId()).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(collect)) { + wrapper.in(TrainExamRecordsEntity::getId, collect); + } + List result = this.selectJoinList(TrainExamRecordsEntity.class, wrapper); + return trainExamRecordsPagination.setData(result, objects.getTotal()); + } else { + List list = this.selectJoinList(TrainExamRecordsEntity.class, wrapper); + if ("2".equals(dataType)) { + List selectIds = Arrays.asList(trainExamRecordsPagination.getSelectIds()); + return list.stream().filter(t -> selectIds.contains(t.getId().toString())).collect(Collectors.toList()); + } else { + return list; + } + } + + } + + /** + * 其他条件拼接 + */ + private void otherConditions(TrainExamRecordsPagination trainExamRecordsPagination, + MPJLambdaWrapper wrapper, boolean isPc) { + String databaseName; + try { + @Cleanup + Connection cnn = DynamicDataSourceUtil.getCurrentConnection(); + databaseName = cnn.getMetaData().getDatabaseProductName().trim(); + } catch (SQLException e) { + throw new DataException(e.getMessage()); + } + wrapper.isNull(TrainExamRecordsEntity::getFlowId); + // 关键词 + if (ObjectUtil.isNotEmpty(trainExamRecordsPagination.getYunzhupaasKeyword())) { + } + // 普通查询 + if (isPc) { + if (ObjectUtil.isNotEmpty(trainExamRecordsPagination.getFexaminers())) { + List idList = new ArrayList<>(); + try { + String[][] fexaminers = JsonUtil.getJsonToBean(trainExamRecordsPagination.getFexaminers(), + String[][].class); + for (int i = 0; i < fexaminers.length; i++) { + if (fexaminers[i].length > 0) { + idList.add(JsonUtil.getObjectToString(Arrays.asList(fexaminers[i]))); + } + } + } catch (Exception e1) { + try { + List fexaminers = JsonUtil.getJsonToList(trainExamRecordsPagination.getFexaminers(), + String.class); + if (fexaminers.size() > 0) { + idList.addAll(fexaminers); + } + } catch (Exception e2) { + idList.add(String.valueOf(trainExamRecordsPagination.getFexaminers())); + } + } + wrapper.and(t -> { + idList.forEach(tt -> { + if (StringUtil.isNotEmpty(tt) && "Microsoft SQL Server".equalsIgnoreCase(databaseName)) { + tt = tt.replaceFirst("\\[", "[[]"); + } + t.like(TrainExamRecordsEntity::getFexaminers, tt).or(); + }); + }); + } + + if (ObjectUtil.isNotEmpty(trainExamRecordsPagination.getFresultScore())) { + List FresultScoreList = JsonUtil.getJsonToList(trainExamRecordsPagination.getFresultScore(), + String.class); + for (int i = 0; i < FresultScoreList.size(); i++) { + String id = String.valueOf(FresultScoreList.get(i)); + boolean idAll = StringUtil.isNotEmpty(id) && !id.equals("null"); + if (idAll) { + Object b = new BigDecimal(id); + if (i == 0) { + wrapper.ge(TrainExamRecordsEntity::getFresultScore, b); + } else { + wrapper.le(TrainExamRecordsEntity::getFresultScore, b); + } + } + } + } + + if (ObjectUtil.isNotEmpty(trainExamRecordsPagination.getFfullName())) { + String value = trainExamRecordsPagination.getFfullName() instanceof List + ? JsonUtil.getObjectToString(trainExamRecordsPagination.getFfullName()) + : String.valueOf(trainExamRecordsPagination.getFfullName()); + wrapper.like(TrainExamRecordsEntity::getFfullName, value); + } + + if (ObjectUtil.isNotEmpty(trainExamRecordsPagination.getFsort())) { + List idList = new ArrayList<>(); + try { + String[][] fsort = JsonUtil.getJsonToBean(trainExamRecordsPagination.getFsort(), String[][].class); + for (int i = 0; i < fsort.length; i++) { + if (fsort[i].length > 0) { + idList.add(JsonUtil.getObjectToString(Arrays.asList(fsort[i]))); + } + } + } catch (Exception e1) { + try { + List fsort = JsonUtil.getJsonToList(trainExamRecordsPagination.getFsort(), + String.class); + if (fsort.size() > 0) { + idList.addAll(fsort); + } + } catch (Exception e2) { + idList.add(String.valueOf(trainExamRecordsPagination.getFsort())); + } + } + wrapper.and(t -> { + idList.forEach(tt -> { + if (StringUtil.isNotEmpty(tt) && "Microsoft SQL Server".equalsIgnoreCase(databaseName)) { + tt = tt.replaceFirst("\\[", "[[]"); + } + t.like(TrainExamRecordsEntity::getFsort, tt).or(); + }); + }); + } + + if (ObjectUtil.isNotEmpty(trainExamRecordsPagination.getFcreatorTime())) { + List FcreatorTimeList = JsonUtil.getJsonToList(trainExamRecordsPagination.getFcreatorTime(), + String.class); + for (int i = 0; i < FcreatorTimeList.size(); i++) { + String id = String.valueOf(FcreatorTimeList.get(i)); + boolean idAll = StringUtil.isNotEmpty(id) && !id.equals("null"); + if (idAll) { + Object b = new Date(Long.valueOf(id)); + if (i == 0) { + wrapper.ge(TrainExamRecordsEntity::getFcreatorTime, b); + } else { + wrapper.le(TrainExamRecordsEntity::getFcreatorTime, b); + } + } + } + } + + if (ObjectUtil.isNotEmpty(trainExamRecordsPagination.getFquestionStatus())) { + List idList = new ArrayList<>(); + try { + String[][] fquestionStatus = JsonUtil.getJsonToBean(trainExamRecordsPagination.getFquestionStatus(), + String[][].class); + for (int i = 0; i < fquestionStatus.length; i++) { + if (fquestionStatus[i].length > 0) { + idList.add(JsonUtil.getObjectToString(Arrays.asList(fquestionStatus[i]))); + } + } + } catch (Exception e1) { + try { + List fquestionStatus = JsonUtil + .getJsonToList(trainExamRecordsPagination.getFquestionStatus(), String.class); + if (fquestionStatus.size() > 0) { + idList.addAll(fquestionStatus); + } + } catch (Exception e2) { + idList.add(String.valueOf(trainExamRecordsPagination.getFquestionStatus())); + } + } + wrapper.and(t -> { + idList.forEach(tt -> { + if (StringUtil.isNotEmpty(tt) && "Microsoft SQL Server".equalsIgnoreCase(databaseName)) { + tt = tt.replaceFirst("\\[", "[[]"); + } + t.like(TrainExamRecordsEntity::getFquestionStatus, tt).or(); + }); + }); + } + + } + // 排序 + if (StringUtil.isEmpty(trainExamRecordsPagination.getSidx())) { + wrapper.orderByDesc(TrainExamRecordsEntity::getId); + } else { + try { + String[] split = trainExamRecordsPagination.getSidx().split(","); + for (String sidx : split) { + TrainExamRecordsEntity trainExamRecordsEntity = new TrainExamRecordsEntity(); + String oderTableField = trainExamRecordsEntity.getClass().getAnnotation(TableName.class).value(); + if (sidx.startsWith("-")) { + Field declaredField = trainExamRecordsEntity.getClass().getDeclaredField(sidx.substring(1)); + declaredField.setAccessible(true); + oderTableField = oderTableField + "." + declaredField.getAnnotation(TableField.class).value(); + wrapper.select(oderTableField); + wrapper.orderByDesc(oderTableField); + } else { + Field declaredField = trainExamRecordsEntity.getClass().getDeclaredField(sidx); + declaredField.setAccessible(true); + oderTableField = oderTableField + "." + declaredField.getAnnotation(TableField.class).value(); + wrapper.select(oderTableField); + wrapper.orderByAsc(oderTableField); + } + } + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } + } + } + + @Override + public TrainExamRecordsEntity getInfo(String id) { + MPJLambdaWrapper wrapper = JoinWrappers + .lambda("make_train_exam_records", TrainExamRecordsEntity.class) + .selectCollection(TrainLibraryEssayQuestionEntity.class, + TrainExamRecordsEntity::getTrainLibraryEssayQuestion) + .leftJoin(TrainLibraryEssayQuestionEntity.class, "make_train_library_essay_question", + TrainLibraryEssayQuestionEntity::getFbankId, TrainExamRecordsEntity::getId) + .selectCollection(TrainLibraryJudgmentEntity.class, TrainExamRecordsEntity::getTrainLibraryJudgment) + .leftJoin(TrainLibraryJudgmentEntity.class, "make_train_library_judgment", + TrainLibraryJudgmentEntity::getFbankId, TrainExamRecordsEntity::getId) + .selectCollection(TrainLibraryMoreEntity.class, TrainExamRecordsEntity::getTrainLibraryMore) + .leftJoin(TrainLibraryMoreEntity.class, "make_train_library_more", TrainLibraryMoreEntity::getFbankId, + TrainExamRecordsEntity::getId) + .selectCollection(TrainLibrarySingleEntity.class, TrainExamRecordsEntity::getTrainLibrarySingle) + .leftJoin(TrainLibrarySingleEntity.class, "make_train_library_single", + TrainLibrarySingleEntity::getFbankId, TrainExamRecordsEntity::getId) + .selectAll(TrainExamRecordsEntity.class); + wrapper.and( + t -> t.eq(TrainExamRecordsEntity::getId, id) + .or().eq(TrainExamRecordsEntity::getFlowTaskId, id)); + return this.selectJoinOne(TrainExamRecordsEntity.class, wrapper); + } + + @Override + public void create(TrainExamRecordsEntity entity) { + this.save(entity); + } + + @Override + public boolean update(String id, TrainExamRecordsEntity entity) { + return this.updateById(entity); + } + + @Override + public void delete(TrainExamRecordsEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + + /** + * 验证表单唯一字段,正则,非空 i-0新增-1修改 + */ + @Override + public String checkForm(TrainExamRecordsForm form, int i) { + boolean isUp = StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0"); + Object id = null; + String countRecover = ""; + String fieldTipName = ""; + String canNotNull = I18nUtil.getMessageStr("sys.validate.textRequiredSuffix", "不能为空"); + String canNotRepeated = I18nUtil.getMessageStr("EXIST103", "不能重复"); + if (isUp) { + id = form.getId(); + } + // 主表字段验证 + fieldTipName = "试卷名称"; + if (StringUtil.isEmpty(form.getFfullName())) { + return fieldTipName + canNotNull; + } + fieldTipName = "试题分类"; + fieldTipName = "考试人员"; + fieldTipName = "考试成绩"; + fieldTipName = "总分数"; + fieldTipName = "总题数"; + fieldTipName = "每题分数"; + fieldTipName = "是否存在问答题"; + fieldTipName = "阅卷状态"; + fieldTipName = "创建用户"; + fieldTipName = "完成时间"; + fieldTipName = "修改用户"; + fieldTipName = "修改时间"; + fieldTipName = "所属组织"; + // 子表字段验证 + if (form.getTrainLibrarySingleList() != null) { + + fieldTipName = "单选题" + + "-" + "题目难度"; + + fieldTipName = "单选题" + + "-" + "分类"; + + fieldTipName = "单选题" + + "-" + "题目名称"; + + fieldTipName = "单选题" + + "-" + "解析"; + + fieldTipName = "单选题" + + "-" + "答案"; + + fieldTipName = "单选题" + + "-" + "题目类型"; + + fieldTipName = "单选题" + + "-" + "选项A"; + + fieldTipName = "单选题" + + "-" + "选项B"; + + fieldTipName = "单选题" + + "-" + "选项C"; + + fieldTipName = "单选题" + + "-" + "选项D"; + + fieldTipName = "单选题" + + "-" + "所属组织"; + + fieldTipName = "单选题" + + "-" + "修改时间"; + + fieldTipName = "单选题" + + "-" + "修改用户"; + + fieldTipName = "单选题" + + "-" + "创建时间"; + + fieldTipName = "单选题" + + "-" + "创建用户"; + + } + if (form.getTrainLibraryMoreList() != null) { + + fieldTipName = "多选题" + + "-" + "题目难度"; + + fieldTipName = "多选题" + + "-" + "分类"; + + fieldTipName = "多选题" + + "-" + "题目名称"; + + fieldTipName = "多选题" + + "-" + "解析"; + + fieldTipName = "多选题" + + "-" + "答案"; + + fieldTipName = "多选题" + + "-" + "题目类型"; + + fieldTipName = "多选题" + + "-" + "选项A"; + + fieldTipName = "多选题" + + "-" + "选项B"; + + fieldTipName = "多选题" + + "-" + "选项C"; + + fieldTipName = "多选题" + + "-" + "选项D"; + + fieldTipName = "多选题" + + "-" + "所属组织"; + + fieldTipName = "多选题" + + "-" + "修改时间"; + + fieldTipName = "多选题" + + "-" + "修改用户"; + + fieldTipName = "多选题" + + "-" + "创建时间"; + + fieldTipName = "多选题" + + "-" + "创建用户"; + + } + if (form.getTrainLibraryJudgmentList() != null) { + + fieldTipName = "判断题" + + "-" + "题目难度"; + + fieldTipName = "判断题" + + "-" + "分类"; + + fieldTipName = "判断题" + + "-" + "题目名称"; + + fieldTipName = "判断题" + + "-" + "解析"; + + fieldTipName = "判断题" + + "-" + "答案"; + + fieldTipName = "判断题" + + "-" + "题目类型"; + + fieldTipName = "判断题" + + "-" + "所属组织"; + + fieldTipName = "判断题" + + "-" + "修改时间"; + + fieldTipName = "判断题" + + "-" + "修改用户"; + + fieldTipName = "判断题" + + "-" + "创建时间"; + + fieldTipName = "判断题" + + "-" + "创建用户"; + + } + if (form.getTrainLibraryEssayQuestionList() != null) { + + fieldTipName = "问答题" + + "-" + "题目难度"; + + fieldTipName = "问答题" + + "-" + "分类"; + + fieldTipName = "问答题" + + "-" + "题目名称"; + + fieldTipName = "问答题" + + "-" + "解析"; + + fieldTipName = "问答题" + + "-" + "答案"; + + fieldTipName = "问答题" + + "-" + "题目类型"; + + fieldTipName = "问答题" + + "-" + "所属组织"; + + fieldTipName = "问答题" + + "-" + "修改时间"; + + fieldTipName = "问答题" + + "-" + "修改用户"; + + fieldTipName = "问答题" + + "-" + "创建时间"; + + fieldTipName = "问答题" + + "-" + "创建用户"; + + } + return countRecover; + } + + /** + * 新增修改数据(事务回滚) + * + * @param id + * @param trainExamRecordsForm + * @return + */ + @Override + @Transactional + public void saveOrUpdate(TrainExamRecordsForm trainExamRecordsForm, String id, boolean isSave) throws Exception { + UserInfo userInfo = userProvider.get(); + UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId()); + trainExamRecordsForm = JsonUtil.getJsonToBean( + generaterSwapUtil.swapDatetime(TrainExamRecordsConstant.getFormData(), trainExamRecordsForm, + TrainExamRecordsConstant.TABLERENAMES), + TrainExamRecordsForm.class); + TrainExamRecordsEntity entity = JsonUtil.getJsonToBean(trainExamRecordsForm, TrainExamRecordsEntity.class); + String mainUuid = StringUtil.isEmpty(id) ? RandomUtil.uuId() : id; + if (isSave) { + entity.setFlowTaskId(mainUuid); + entity.setFcreatorUserId(userInfo.getUserId()); + entity.setFcreatorTime(DateUtil.getNowDate()); + entity.setFlastModifyUserId(null); + entity.setFlastModifyTime(null); + entity.setForganizeId(generaterSwapUtil.getCurrentOrgIds(userInfo.getOrganizeId(), "last")); + entity.setId(mainUuid); + } else { + entity.setFcreatorUserId(null); + entity.setFcreatorTime(null); + entity.setFlastModifyUserId(userInfo.getUserId()); + entity.setFlastModifyTime(DateUtil.getNowDate()); + entity.setForganizeId(null); + } + this.saveOrUpdate(entity); + + // TrainLibrarySingle子表数据新增修改 + QueryWrapper TrainLibrarySinglequeryWrapper = new QueryWrapper<>(); + TrainLibrarySinglequeryWrapper.lambda().eq(TrainLibrarySingleEntity::getFbankId, entity.getId()); + if (!isSave && !CollectionUtils.isNotEmpty(trainExamRecordsForm.getTrainLibrarySingleList())) { + trainLibrarySingleService.remove(TrainLibrarySinglequeryWrapper); + } + if (CollectionUtils.isNotEmpty(trainExamRecordsForm.getTrainLibrarySingleList())) { + List tableField103 = JsonUtil + .getJsonToList(trainExamRecordsForm.getTrainLibrarySingleList(), TrainLibrarySingleEntity.class); + // 移除的数据 + List childIds = tableField103.stream().filter(t -> t.getId() != null) + .map(TrainLibrarySingleEntity::getId).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(childIds)) { + TrainLibrarySinglequeryWrapper.lambda().notIn(TrainLibrarySingleEntity::getId, childIds); + } + trainLibrarySingleService.remove(TrainLibrarySinglequeryWrapper); + for (TrainLibrarySingleEntity entitys : tableField103) { + entitys.setFbankId(entity.getId()); + if (isSave || entitys.getId() == null) { + entitys.setForganizeId(generaterSwapUtil.getCurrentOrgIds(userInfo.getOrganizeId(), "last")); + entitys.setFlastModifyTime(null); + entitys.setFlastModifyUserId(null); + entitys.setFcreatorTime(DateUtil.getNowDate()); + entitys.setFcreatorUserId(userInfo.getUserId()); + } else { + entitys.setForganizeId(null); + entitys.setFlastModifyTime(DateUtil.getNowDate()); + entitys.setFlastModifyUserId(userInfo.getUserId()); + entitys.setFcreatorTime(null); + entitys.setFcreatorUserId(null); + } + if (entitys.getId() == null) { + entitys.setId(RandomUtil.uuId()); + } + trainLibrarySingleService.saveOrUpdate(entitys); + } + } + // TrainLibraryMore子表数据新增修改 + QueryWrapper TrainLibraryMorequeryWrapper = new QueryWrapper<>(); + TrainLibraryMorequeryWrapper.lambda().eq(TrainLibraryMoreEntity::getFbankId, entity.getId()); + if (!isSave && !CollectionUtils.isNotEmpty(trainExamRecordsForm.getTrainLibraryMoreList())) { + trainLibraryMoreService.remove(TrainLibraryMorequeryWrapper); + } + if (CollectionUtils.isNotEmpty(trainExamRecordsForm.getTrainLibraryMoreList())) { + List tableField131 = JsonUtil + .getJsonToList(trainExamRecordsForm.getTrainLibraryMoreList(), TrainLibraryMoreEntity.class); + // 移除的数据 + List childIds = tableField131.stream().filter(t -> t.getId() != null) + .map(TrainLibraryMoreEntity::getId).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(childIds)) { + TrainLibraryMorequeryWrapper.lambda().notIn(TrainLibraryMoreEntity::getId, childIds); + } + trainLibraryMoreService.remove(TrainLibraryMorequeryWrapper); + for (TrainLibraryMoreEntity entitys : tableField131) { + entitys.setFbankId(entity.getId()); + if (isSave || entitys.getId() == null) { + entitys.setForganizeId(generaterSwapUtil.getCurrentOrgIds(userInfo.getOrganizeId(), "last")); + entitys.setFlastModifyTime(null); + entitys.setFlastModifyUserId(null); + entitys.setFcreatorTime(DateUtil.getNowDate()); + entitys.setFcreatorUserId(userInfo.getUserId()); + } else { + entitys.setForganizeId(null); + entitys.setFlastModifyTime(DateUtil.getNowDate()); + entitys.setFlastModifyUserId(userInfo.getUserId()); + entitys.setFcreatorTime(null); + entitys.setFcreatorUserId(null); + } + if (entitys.getId() == null) { + entitys.setId(RandomUtil.uuId()); + } + trainLibraryMoreService.saveOrUpdate(entitys); + } + } + // TrainLibraryJudgment子表数据新增修改 + QueryWrapper TrainLibraryJudgmentqueryWrapper = new QueryWrapper<>(); + TrainLibraryJudgmentqueryWrapper.lambda().eq(TrainLibraryJudgmentEntity::getFbankId, entity.getId()); + if (!isSave && !CollectionUtils.isNotEmpty(trainExamRecordsForm.getTrainLibraryJudgmentList())) { + trainLibraryJudgmentService.remove(TrainLibraryJudgmentqueryWrapper); + } + if (CollectionUtils.isNotEmpty(trainExamRecordsForm.getTrainLibraryJudgmentList())) { + List tableField147 = JsonUtil.getJsonToList( + trainExamRecordsForm.getTrainLibraryJudgmentList(), TrainLibraryJudgmentEntity.class); + // 移除的数据 + List childIds = tableField147.stream().filter(t -> t.getId() != null) + .map(TrainLibraryJudgmentEntity::getId).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(childIds)) { + TrainLibraryJudgmentqueryWrapper.lambda().notIn(TrainLibraryJudgmentEntity::getId, childIds); + } + trainLibraryJudgmentService.remove(TrainLibraryJudgmentqueryWrapper); + for (TrainLibraryJudgmentEntity entitys : tableField147) { + entitys.setFbankId(entity.getId()); + if (isSave || entitys.getId() == null) { + entitys.setForganizeId(generaterSwapUtil.getCurrentOrgIds(userInfo.getOrganizeId(), "last")); + entitys.setFlastModifyTime(null); + entitys.setFlastModifyUserId(null); + entitys.setFcreatorTime(DateUtil.getNowDate()); + entitys.setFcreatorUserId(userInfo.getUserId()); + } else { + entitys.setForganizeId(null); + entitys.setFlastModifyTime(DateUtil.getNowDate()); + entitys.setFlastModifyUserId(userInfo.getUserId()); + entitys.setFcreatorTime(null); + entitys.setFcreatorUserId(null); + } + if (entitys.getId() == null) { + entitys.setId(RandomUtil.uuId()); + } + trainLibraryJudgmentService.saveOrUpdate(entitys); + } + } + // TrainLibraryEssayQuestion子表数据新增修改 + QueryWrapper TrainLibraryEssayQuestionqueryWrapper = new QueryWrapper<>(); + TrainLibraryEssayQuestionqueryWrapper.lambda().eq(TrainLibraryEssayQuestionEntity::getFbankId, entity.getId()); + if (!isSave && !CollectionUtils.isNotEmpty(trainExamRecordsForm.getTrainLibraryEssayQuestionList())) { + trainLibraryEssayQuestionService.remove(TrainLibraryEssayQuestionqueryWrapper); + } + if (CollectionUtils.isNotEmpty(trainExamRecordsForm.getTrainLibraryEssayQuestionList())) { + List tableField180 = JsonUtil.getJsonToList( + trainExamRecordsForm.getTrainLibraryEssayQuestionList(), TrainLibraryEssayQuestionEntity.class); + // 移除的数据 + List childIds = tableField180.stream().filter(t -> t.getId() != null) + .map(TrainLibraryEssayQuestionEntity::getId).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(childIds)) { + TrainLibraryEssayQuestionqueryWrapper.lambda().notIn(TrainLibraryEssayQuestionEntity::getId, childIds); + } + trainLibraryEssayQuestionService.remove(TrainLibraryEssayQuestionqueryWrapper); + for (TrainLibraryEssayQuestionEntity entitys : tableField180) { + entitys.setFbankId(entity.getId()); + if (isSave || entitys.getId() == null) { + entitys.setForganizeId(generaterSwapUtil.getCurrentOrgIds(userInfo.getOrganizeId(), "last")); + entitys.setFlastModifyTime(null); + entitys.setFlastModifyUserId(null); + entitys.setFcreatorTime(DateUtil.getNowDate()); + entitys.setFcreatorUserId(userInfo.getUserId()); + } else { + entitys.setForganizeId(null); + entitys.setFlastModifyTime(DateUtil.getNowDate()); + entitys.setFlastModifyUserId(userInfo.getUserId()); + entitys.setFcreatorTime(null); + entitys.setFcreatorUserId(null); + } + if (entitys.getId() == null) { + entitys.setId(RandomUtil.uuId()); + } + trainLibraryEssayQuestionService.saveOrUpdate(entitys); + } + } + } + + @Override + public ActionResult examRecordsDetail(String id) { + OutExamRecordsDetailDTO outDTO = new OutExamRecordsDetailDTO(); + outDTO.setId(id); + TrainExamRecordsEntity recordsEntity = trainExamRecordsService.getInfo(id); + TrainTestPaperLibraryEntity libraryEntity = trainTestPaperLibraryService.getInfo(recordsEntity.getFlibraryId()); + int perQuestion = recordsEntity.getFperQuestion(); + String scoreStr = "(" + perQuestion + ")分"; + // 获取用户答案 + List singleEntities = trainLibrarySingleService.getListByParentId(id); + List moreEntities = trainLibraryMoreService.getListByParentId(id); + List judgmentEntities = trainLibraryJudgmentService.getListByParentId(id); + List essayQuestionEntities = trainLibraryEssayQuestionService + .getListByParentId(id); + + // 单选题 + if (!singleEntities.isEmpty()) { + List realSingleEntities = trainLibrarySingleService + .getListByParentId(recordsEntity.getFlibraryId()); + List singleList = new ArrayList<>(); + for (TrainLibrarySingleEntity singleEntity : singleEntities) { + OutSingleDTO outSingleDTO = new OutSingleDTO(); + // 获取正确答案 + TrainLibrarySingleEntity correctEntity = realSingleEntities.stream() + .filter(entity -> entity.getFfullName().equals(singleEntity.getFfullName())) + .findFirst().orElse(null); + if (correctEntity != null) { + outSingleDTO.setId(singleEntity.getId()) + .setUserAnswer(singleEntity.getFanswer()) + .setCorrectAnswer(correctEntity.getFanswer()) + .setFullName(singleEntity.getFfullName() + scoreStr); + outSingleDTO.setResult(singleEntity.getFanswer().equals(correctEntity.getFanswer()) ? "正确" : "错误"); + } + singleList.add(outSingleDTO); + } + outDTO.setSingleList(singleList); + } + // 多选题 + if (!moreEntities.isEmpty()) { + List realMoreEntities = trainLibraryMoreService + .getListByParentId(recordsEntity.getFlibraryId()); + List multipleList = new ArrayList<>(); + for (TrainLibraryMoreEntity moreEntity : moreEntities) { + OutMultipleDTO outMultipleDTO = new OutMultipleDTO(); + TrainLibraryMoreEntity correctEntity = realMoreEntities.stream() + .filter(entity -> entity.getFfullName().equals(moreEntity.getFfullName())) + .findFirst() + .orElse(null); + if (correctEntity != null) { + outMultipleDTO.setId(moreEntity.getId()) + .setUserAnswer(moreEntity.getFanswer()) + .setCorrectAnswer(correctEntity.getFanswer()) + .setFullName(moreEntity.getFfullName() + scoreStr); + // 判断结果 + List userAnswerList = Arrays + .asList(moreEntity.getFanswer().replace("[", "").replace("]", "").split(",")); + List correctAnswerList = Arrays + .asList(correctEntity.getFanswer().replace("[", "").replace("]", "").split(",")); + // 将 List 转换为 Set 以去除重复项并忽略顺序 + Set userAnswerSet = new HashSet<>(userAnswerList); + Set correctAnswerSet = new HashSet<>(correctAnswerList); + // 比较集合是否相等 + boolean isCorrect = userAnswerSet.equals(correctAnswerSet); + outMultipleDTO.setResult(isCorrect ? "正确" : "错误"); + } + multipleList.add(outMultipleDTO); + } + outDTO.setMultipleList(multipleList); + } + // 判断题 + if (!judgmentEntities.isEmpty()) { + List realJudgmentEntities = trainLibraryJudgmentService + .getListByParentId(recordsEntity.getFlibraryId()); + List judgeList = new ArrayList<>(); + for (TrainLibraryJudgmentEntity judgmentEntity : judgmentEntities) { + OutJudgeDTO outJudgeDTO = new OutJudgeDTO(); + TrainLibraryJudgmentEntity correctEntity = realJudgmentEntities.stream() + .filter(entity -> entity.getFfullName().equals(judgmentEntity.getFfullName())) + .findFirst() + .orElse(null); + if (correctEntity != null) { + outJudgeDTO.setId(judgmentEntity.getId()) + .setUserAnswer(judgmentEntity.getFanswer()) + .setCorrectAnswer(correctEntity.getFanswer()) + .setFullName(judgmentEntity.getFfullName() + scoreStr); + outJudgeDTO.setResult(judgmentEntity.getFanswer().equals(correctEntity.getFanswer()) ? "正确" : "错误"); + } + judgeList.add(outJudgeDTO); + } + outDTO.setJudgeList(judgeList); + } + // 简答题 + if (!essayQuestionEntities.isEmpty()) { + List realEssayQuestionEntities = trainLibraryEssayQuestionService + .getListByParentId(recordsEntity.getFlibraryId()); + List shortAnswerList = new ArrayList<>(); + for (TrainLibraryEssayQuestionEntity essayQuestionEntity : essayQuestionEntities) { + System.out.println("问答题用户答案: " + essayQuestionEntity.getFanswer()); + OutShortAnswerDTO outShortAnswerDTO = new OutShortAnswerDTO(); + TrainLibraryEssayQuestionEntity correctEntity = realEssayQuestionEntities.stream() + .filter(entity -> entity.getFfullName().equals(essayQuestionEntity.getFfullName())) + .findFirst() + .orElse(null); + if (correctEntity != null) { + outShortAnswerDTO.setId(essayQuestionEntity.getId()) + .setUserAnswer(essayQuestionEntity.getFanswer()) + .setCorrectAnswer(correctEntity.getFanswer()) + .setFullName(essayQuestionEntity.getFfullName() + scoreStr); + if (StringUtil.isNotEmpty(essayQuestionEntity.getFresult())) { + outShortAnswerDTO.setResult(essayQuestionEntity.getFresult()); + } else { + outShortAnswerDTO.setResult( + essayQuestionEntity.getFanswer().equals(correctEntity.getFanswer()) ? "正确" : "错误"); + } + System.out.println("正确答案: " + correctEntity.getFanswer()); + } + shortAnswerList.add(outShortAnswerDTO); + } + outDTO.setShortAnswerList(shortAnswerList); + } + + return ActionResult.success("查询成功", outDTO); + } + + @Override + @Transactional + public ActionResult readPaper(InReadPaperDTO in) { + TrainExamRecordsEntity entity = trainExamRecordsService.getInfo(in.getId()); + if (entity == null) { + return ActionResult.fail("记录不存在"); + } + if (entity.getFquestionStatus().equals("已完成")) { + return ActionResult.fail("阅卷已完成,请勿重复阅卷!"); + } + int correctCnt = 0; + int perQuestion = entity.getFperQuestion();// 每题分数 + + List essayQuestions = in.getEssayQuestions(); + for (EssayQuestionDTO dto : essayQuestions) { + if (dto.getResult().equals("正确")) { + correctCnt++; + } + } + int questionScore = correctCnt * perQuestion; + int resultScore = Integer.parseInt(entity.getFresultScore()) + questionScore; + if (resultScore > Integer.parseInt(entity.getFmark())) { + return ActionResult.fail("阅卷失败,最终得分不能超过总分!"); + } + + entity.setFresultScore(String.valueOf(resultScore)).setFquestionStatus("已完成").setFquestionScore(questionScore); + // 修改数据库 + trainLibraryEssayQuestionService.updateResult(in.getEssayQuestions()); + trainExamRecordsService.update(in.getId(), entity); + return ActionResult.success("阅卷成功"); + } +} diff --git a/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/service/impl/TrainLibraryEssayQuestionServiceImpl.java b/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/service/impl/TrainLibraryEssayQuestionServiceImpl.java new file mode 100644 index 0000000..40f92a9 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/service/impl/TrainLibraryEssayQuestionServiceImpl.java @@ -0,0 +1,47 @@ +package com.yunzhupaas.service.impl; + +import com.yunzhupaas.dto.EssayQuestionDTO; +import com.yunzhupaas.entity.*; +import com.yunzhupaas.mapper.TrainLibraryEssayQuestionMapper; +import com.yunzhupaas.service.*; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yunzhupaas.model.traintestpaperlibrary.*; +import org.springframework.stereotype.Service; +import com.yunzhupaas.base.service.SuperServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import com.yunzhupaas.util.GeneraterSwapUtil; +import java.sql.Connection; +import java.sql.SQLException; +import java.util.List; + +import lombok.Cleanup; +import com.yunzhupaas.database.plugins.DynamicSourceGeneratorInterface; +import com.yunzhupaas.database.util.DynamicDataSourceUtil; +import org.apache.commons.collections4.CollectionUtils; +import com.yunzhupaas.i18n.util.I18nUtil; +import com.yunzhupaas.exception.DataException; +/** + * + * 在线考试 + * 版本: V5.2.0 + * 版权: Copyright @ 2025 + * 作者: 浙江尖峰集团股份有限公司 + * 日期: 2024-11-05 + */ +@Service +public class TrainLibraryEssayQuestionServiceImpl extends SuperServiceImpl implements TrainLibraryEssayQuestionService{ + @Autowired + private GeneraterSwapUtil generaterSwapUtil; +@Autowired +private TrainLibraryEssayQuestionMapper mapper; + @Override + public List getListByParentId(String id) { + return mapper.getListByParentId(id); + } + + @Override + public void updateResult(List essayQuestions) { + mapper.updateResult(essayQuestions); + } +} + diff --git a/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/service/impl/TrainLibraryJudgmentServiceImpl.java b/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/service/impl/TrainLibraryJudgmentServiceImpl.java new file mode 100644 index 0000000..e815102 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/service/impl/TrainLibraryJudgmentServiceImpl.java @@ -0,0 +1,43 @@ +package com.yunzhupaas.service.impl; + +import com.yunzhupaas.entity.*; +import com.yunzhupaas.mapper.TrainLibraryJudgmentMapper; +import com.yunzhupaas.service.*; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yunzhupaas.model.traintestpaperlibrary.*; +import org.springframework.stereotype.Service; +import com.yunzhupaas.base.service.SuperServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import com.yunzhupaas.util.GeneraterSwapUtil; + +import java.sql.Connection; +import java.sql.SQLException; +import java.util.List; + +import lombok.Cleanup; +import com.yunzhupaas.database.plugins.DynamicSourceGeneratorInterface; +import com.yunzhupaas.database.util.DynamicDataSourceUtil; +import org.apache.commons.collections4.CollectionUtils; +import com.yunzhupaas.i18n.util.I18nUtil; +import com.yunzhupaas.exception.DataException; + +/** + * 在线考试 + * 版本: V5.2.0 + * 版权: Copyright @ 2025 + * 作者: 浙江尖峰集团股份有限公司 + * 日期: 2024-11-05 + */ +@Service +public class TrainLibraryJudgmentServiceImpl extends SuperServiceImpl implements TrainLibraryJudgmentService { + @Autowired + private GeneraterSwapUtil generaterSwapUtil; + @Autowired + private TrainLibraryJudgmentMapper mapper; + + @Override + public List getListByParentId(String id) { + return mapper.getListByParentId(id); + } +} + diff --git a/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/service/impl/TrainLibraryMoreServiceImpl.java b/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/service/impl/TrainLibraryMoreServiceImpl.java new file mode 100644 index 0000000..2ee477c --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/service/impl/TrainLibraryMoreServiceImpl.java @@ -0,0 +1,43 @@ +package com.yunzhupaas.service.impl; + +import com.yunzhupaas.entity.*; +import com.yunzhupaas.mapper.TrainLibraryMoreMapper; +import com.yunzhupaas.service.*; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yunzhupaas.model.traintestpaperlibrary.*; +import org.springframework.stereotype.Service; +import com.yunzhupaas.base.service.SuperServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import com.yunzhupaas.util.GeneraterSwapUtil; + +import java.sql.Connection; +import java.sql.SQLException; +import java.util.List; + +import lombok.Cleanup; +import com.yunzhupaas.database.plugins.DynamicSourceGeneratorInterface; +import com.yunzhupaas.database.util.DynamicDataSourceUtil; +import org.apache.commons.collections4.CollectionUtils; +import com.yunzhupaas.i18n.util.I18nUtil; +import com.yunzhupaas.exception.DataException; + +/** + * 在线考试 + * 版本: V5.2.0 + * 版权: Copyright @ 2025 + * 作者: 浙江尖峰集团股份有限公司 + * 日期: 2024-11-05 + */ +@Service +public class TrainLibraryMoreServiceImpl extends SuperServiceImpl implements TrainLibraryMoreService { + @Autowired + private GeneraterSwapUtil generaterSwapUtil; + @Autowired + private TrainLibraryMoreMapper mapper; + + @Override + public List getListByParentId(String id) { + return mapper.getListByParentId(id); + } +} + diff --git a/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/service/impl/TrainLibrarySingleServiceImpl.java b/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/service/impl/TrainLibrarySingleServiceImpl.java new file mode 100644 index 0000000..39d0725 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/service/impl/TrainLibrarySingleServiceImpl.java @@ -0,0 +1,43 @@ +package com.yunzhupaas.service.impl; + +import com.yunzhupaas.entity.*; +import com.yunzhupaas.mapper.TrainLibrarySingleMapper; +import com.yunzhupaas.service.*; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yunzhupaas.model.traintestpaperlibrary.*; +import org.springframework.stereotype.Service; +import com.yunzhupaas.base.service.SuperServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import com.yunzhupaas.util.GeneraterSwapUtil; + +import java.sql.Connection; +import java.sql.SQLException; +import java.util.List; + +import lombok.Cleanup; +import com.yunzhupaas.database.plugins.DynamicSourceGeneratorInterface; +import com.yunzhupaas.database.util.DynamicDataSourceUtil; +import org.apache.commons.collections4.CollectionUtils; +import com.yunzhupaas.i18n.util.I18nUtil; +import com.yunzhupaas.exception.DataException; + +/** + * 在线考试 + * 版本: V5.2.0 + * 版权: Copyright @ 2025 + * 作者: 浙江尖峰集团股份有限公司 + * 日期: 2024-11-05 + */ +@Service +public class TrainLibrarySingleServiceImpl extends SuperServiceImpl implements TrainLibrarySingleService { + @Autowired + private GeneraterSwapUtil generaterSwapUtil; + @Autowired + private TrainLibrarySingleMapper mapper; + + @Override + public List getListByParentId(String id) { + return mapper.getListByParentId(id); + } +} + diff --git a/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/service/impl/TrainTestPaperLibraryServiceImpl.java b/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/service/impl/TrainTestPaperLibraryServiceImpl.java new file mode 100644 index 0000000..5555fc4 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-biz/src/main/java/com/yunzhupaas/service/impl/TrainTestPaperLibraryServiceImpl.java @@ -0,0 +1,835 @@ +package com.yunzhupaas.service.impl; + +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.dto.OnlineExamSubmitDTO; +import com.yunzhupaas.entity.*; +import com.yunzhupaas.mapper.TrainTestPaperLibraryMapper; +import com.yunzhupaas.service.*; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yunzhupaas.model.traintestpaperlibrary.*; +import org.springframework.stereotype.Service; +import com.yunzhupaas.base.service.SuperServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import com.yunzhupaas.util.GeneraterSwapUtil; + +import java.sql.Connection; +import java.sql.SQLException; + +import lombok.Cleanup; +import com.yunzhupaas.database.plugins.DynamicSourceGeneratorInterface; +import com.yunzhupaas.database.util.DynamicDataSourceUtil; +import org.apache.commons.collections4.CollectionUtils; +import com.yunzhupaas.i18n.util.I18nUtil; +import com.yunzhupaas.exception.DataException; + +import java.math.BigDecimal; + +import cn.hutool.core.util.ObjectUtil; + +import java.lang.reflect.Field; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +import com.yunzhupaas.base.model.ColumnDataModel; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.transaction.annotation.Transactional; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.github.yulichang.toolkit.JoinWrappers; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.yunzhupaas.model.QueryAllModel; + +import java.text.SimpleDateFormat; + +import com.yunzhupaas.util.*; + +import java.util.*; + +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.permission.entity.UserEntity; +import com.github.pagehelper.PageHelper; + +/** + * 在线考试 + * 版本: V5.2.0 + * 版权: Copyright @ 2025 + * 作者: 浙江尖峰集团股份有限公司 + * 日期: 2024-11-05 + */ +@Service +public class TrainTestPaperLibraryServiceImpl + extends SuperServiceImpl + implements TrainTestPaperLibraryService { + @Autowired + private GeneraterSwapUtil generaterSwapUtil; + @Autowired + private UserProvider userProvider; + @Autowired + private TrainTestPaperLibraryMapper trainTestPaperLibraryMapper; + @Autowired + private TrainLibrarySingleService trainLibrarySingleService; + @Autowired + private TrainLibraryMoreService trainLibraryMoreService; + @Autowired + private TrainLibraryJudgmentService trainLibraryJudgmentService; + @Autowired + private TrainLibraryEssayQuestionService trainLibraryEssayQuestionService; + + @Override + public List getList(TrainTestPaperLibraryPagination trainTestPaperLibraryPagination) { + return getTypeList(trainTestPaperLibraryPagination, trainTestPaperLibraryPagination.getDataType()); + } + + /** + * 列表查询 + */ + @Override + public List getTypeList( + TrainTestPaperLibraryPagination trainTestPaperLibraryPagination, String dataType) { + String userId = userProvider.get().getUserId(); + Map tableClassMap = new HashMap<>(); + tableClassMap.put("make_train_test_paper_library", TrainTestPaperLibraryEntity.class); + tableClassMap.put("make_train_library_essay_question", TrainLibraryEssayQuestionEntity.class); + tableClassMap.put("make_train_library_judgment", TrainLibraryJudgmentEntity.class); + tableClassMap.put("make_train_library_more", TrainLibraryMoreEntity.class); + tableClassMap.put("make_train_library_single", TrainLibrarySingleEntity.class); + + MPJLambdaWrapper wrapper = JoinWrappers + .lambda("make_train_test_paper_library", TrainTestPaperLibraryEntity.class) + .selectCollection(TrainLibraryEssayQuestionEntity.class, + TrainTestPaperLibraryEntity::getTrainLibraryEssayQuestion) + .leftJoin(TrainLibraryEssayQuestionEntity.class, "make_train_library_essay_question", + TrainLibraryEssayQuestionEntity::getFbankId, TrainTestPaperLibraryEntity::getId) + .selectCollection(TrainLibraryJudgmentEntity.class, + TrainTestPaperLibraryEntity::getTrainLibraryJudgment) + .leftJoin(TrainLibraryJudgmentEntity.class, "make_train_library_judgment", + TrainLibraryJudgmentEntity::getFbankId, TrainTestPaperLibraryEntity::getId) + .selectCollection(TrainLibraryMoreEntity.class, TrainTestPaperLibraryEntity::getTrainLibraryMore) + .leftJoin(TrainLibraryMoreEntity.class, "make_train_library_more", TrainLibraryMoreEntity::getFbankId, + TrainTestPaperLibraryEntity::getId) + .selectCollection(TrainLibrarySingleEntity.class, TrainTestPaperLibraryEntity::getTrainLibrarySingle) + .leftJoin(TrainLibrarySingleEntity.class, "make_train_library_single", + TrainLibrarySingleEntity::getFbankId, TrainTestPaperLibraryEntity::getId) + .selectAll(TrainTestPaperLibraryEntity.class); + MPJLambdaWrapper wrapper2 = JoinWrappers + .lambda("make_train_test_paper_library", TrainTestPaperLibraryEntity.class) + .leftJoin(TrainLibraryEssayQuestionEntity.class, "make_train_library_essay_question", + TrainLibraryEssayQuestionEntity::getFbankId, TrainTestPaperLibraryEntity::getId) + .leftJoin(TrainLibraryJudgmentEntity.class, "make_train_library_judgment", + TrainLibraryJudgmentEntity::getFbankId, TrainTestPaperLibraryEntity::getId) + .leftJoin(TrainLibraryMoreEntity.class, "make_train_library_more", TrainLibraryMoreEntity::getFbankId, + TrainTestPaperLibraryEntity::getId) + .leftJoin(TrainLibrarySingleEntity.class, "make_train_library_single", + TrainLibrarySingleEntity::getFbankId, TrainTestPaperLibraryEntity::getId) + .distinct().select(TrainTestPaperLibraryEntity::getId); + + QueryAllModel queryAllModel = new QueryAllModel(); + queryAllModel.setWrapper(wrapper); + queryAllModel.setClassMap(tableClassMap); + queryAllModel.setDbLink(TrainTestPaperLibraryConstant.DBLINKID); + // 数据过滤 + boolean isPc = ServletUtil.getHeader("yunzhupaas-origin").equals("pc"); + String columnData = !isPc ? TrainTestPaperLibraryConstant.getAppColumnData() + : TrainTestPaperLibraryConstant.getColumnData(); + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class); + String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) + : JsonUtil.getObjectToString(columnDataModel.getRuleList()); + queryAllModel.setRuleJson(ruleJson); + // 高级查询 + boolean hasSuperQuery = true; + if (hasSuperQuery) { + queryAllModel.setSuperJson(trainTestPaperLibraryPagination.getSuperQueryJson()); + } + // 数据权限 + boolean pcPermission = true; + boolean appPermission = false; + if (isPc && pcPermission && !userProvider.get().getIsAdministrator()) { + queryAllModel.setModuleId(trainTestPaperLibraryPagination.getMenuId()); + queryAllModel.setModuleId(trainTestPaperLibraryPagination.getMenuId()); + } + if (!isPc && appPermission && !userProvider.get().getIsAdministrator()) { + queryAllModel.setModuleId(trainTestPaperLibraryPagination.getMenuId()); + } + // 拼接复杂条件 + wrapper = generaterSwapUtil.getConditionAllTable(queryAllModel); + queryAllModel.setWrapper(wrapper2); + wrapper2 = generaterSwapUtil.getConditionAllTable(queryAllModel); + // 其他条件拼接 + otherConditions(trainTestPaperLibraryPagination, wrapper, isPc); + otherConditions(trainTestPaperLibraryPagination, wrapper2, isPc); + + if ("0".equals(dataType)) { + com.github.pagehelper.Page objects = PageHelper.startPage( + (int) trainTestPaperLibraryPagination.getCurrentPage(), + (int) trainTestPaperLibraryPagination.getPageSize(), true); + List userIPage = this.selectJoinList(TrainTestPaperLibraryEntity.class, + wrapper2); + List collect = userIPage.stream().map(t -> t.getId()).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(collect)) { + wrapper.in(TrainTestPaperLibraryEntity::getId, collect); + } + List result = this.selectJoinList(TrainTestPaperLibraryEntity.class, wrapper); + return trainTestPaperLibraryPagination.setData(result, objects.getTotal()); + } else { + List list = this.selectJoinList(TrainTestPaperLibraryEntity.class, wrapper); + if ("2".equals(dataType)) { + List selectIds = Arrays.asList(trainTestPaperLibraryPagination.getSelectIds()); + return list.stream().filter(t -> selectIds.contains(t.getId().toString())).collect(Collectors.toList()); + } else { + return list; + } + } + + } + + /** + * 其他条件拼接 + */ + private void otherConditions(TrainTestPaperLibraryPagination trainTestPaperLibraryPagination, + MPJLambdaWrapper wrapper, boolean isPc) { + String databaseName; + try { + @Cleanup + Connection cnn = DynamicDataSourceUtil.getCurrentConnection(); + databaseName = cnn.getMetaData().getDatabaseProductName().trim(); + } catch (SQLException e) { + throw new DataException(e.getMessage()); + } + wrapper.isNull(TrainTestPaperLibraryEntity::getFlowId); + // 关键词 + if (ObjectUtil.isNotEmpty(trainTestPaperLibraryPagination.getYunzhupaasKeyword())) { + } + // 普通查询 + if (isPc) { + if (ObjectUtil.isNotEmpty(trainTestPaperLibraryPagination.getFfullName())) { + String value = trainTestPaperLibraryPagination.getFfullName() instanceof List + ? JsonUtil.getObjectToString(trainTestPaperLibraryPagination.getFfullName()) + : String.valueOf(trainTestPaperLibraryPagination.getFfullName()); + wrapper.like(TrainTestPaperLibraryEntity::getFfullName, value); + } + + if (ObjectUtil.isNotEmpty(trainTestPaperLibraryPagination.getFsort())) { + List idList = new ArrayList<>(); + try { + String[][] fsort = JsonUtil.getJsonToBean(trainTestPaperLibraryPagination.getFsort(), + String[][].class); + for (int i = 0; i < fsort.length; i++) { + if (fsort[i].length > 0) { + idList.add(JsonUtil.getObjectToString(Arrays.asList(fsort[i]))); + } + } + } catch (Exception e1) { + try { + List fsort = JsonUtil.getJsonToList(trainTestPaperLibraryPagination.getFsort(), + String.class); + if (fsort.size() > 0) { + idList.addAll(fsort); + } + } catch (Exception e2) { + idList.add(String.valueOf(trainTestPaperLibraryPagination.getFsort())); + } + } + wrapper.and(t -> { + idList.forEach(tt -> { + if (StringUtil.isNotEmpty(tt) && "Microsoft SQL Server".equalsIgnoreCase(databaseName)) { + tt = tt.replaceFirst("\\[", "[[]"); + } + t.like(TrainTestPaperLibraryEntity::getFsort, tt).or(); + }); + }); + } + + } + // 排序 + if (StringUtil.isEmpty(trainTestPaperLibraryPagination.getSidx())) { + wrapper.orderByDesc(TrainTestPaperLibraryEntity::getId); + } else { + try { + String[] split = trainTestPaperLibraryPagination.getSidx().split(","); + for (String sidx : split) { + TrainTestPaperLibraryEntity trainTestPaperLibraryEntity = new TrainTestPaperLibraryEntity(); + String oderTableField = trainTestPaperLibraryEntity.getClass().getAnnotation(TableName.class) + .value(); + if (sidx.startsWith("-")) { + Field declaredField = trainTestPaperLibraryEntity.getClass() + .getDeclaredField(sidx.substring(1)); + declaredField.setAccessible(true); + oderTableField = oderTableField + "." + declaredField.getAnnotation(TableField.class).value(); + wrapper.select(oderTableField); + wrapper.orderByDesc(oderTableField); + } else { + Field declaredField = trainTestPaperLibraryEntity.getClass().getDeclaredField(sidx); + declaredField.setAccessible(true); + oderTableField = oderTableField + "." + declaredField.getAnnotation(TableField.class).value(); + wrapper.select(oderTableField); + wrapper.orderByAsc(oderTableField); + } + } + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } + } + } + + @Override + public TrainTestPaperLibraryEntity getInfo(String id) { + MPJLambdaWrapper wrapper = JoinWrappers + .lambda("make_train_test_paper_library", TrainTestPaperLibraryEntity.class) + .selectCollection(TrainLibraryEssayQuestionEntity.class, + TrainTestPaperLibraryEntity::getTrainLibraryEssayQuestion) + .leftJoin(TrainLibraryEssayQuestionEntity.class, "make_train_library_essay_question", + TrainLibraryEssayQuestionEntity::getFbankId, TrainTestPaperLibraryEntity::getId) + .selectCollection(TrainLibraryJudgmentEntity.class, + TrainTestPaperLibraryEntity::getTrainLibraryJudgment) + .leftJoin(TrainLibraryJudgmentEntity.class, "make_train_library_judgment", + TrainLibraryJudgmentEntity::getFbankId, TrainTestPaperLibraryEntity::getId) + .selectCollection(TrainLibraryMoreEntity.class, TrainTestPaperLibraryEntity::getTrainLibraryMore) + .leftJoin(TrainLibraryMoreEntity.class, "make_train_library_more", TrainLibraryMoreEntity::getFbankId, + TrainTestPaperLibraryEntity::getId) + .selectCollection(TrainLibrarySingleEntity.class, TrainTestPaperLibraryEntity::getTrainLibrarySingle) + .leftJoin(TrainLibrarySingleEntity.class, "make_train_library_single", + TrainLibrarySingleEntity::getFbankId, TrainTestPaperLibraryEntity::getId) + .selectAll(TrainTestPaperLibraryEntity.class); + wrapper.and( + t -> t.eq(TrainTestPaperLibraryEntity::getId, id) + .or().eq(TrainTestPaperLibraryEntity::getFlowTaskId, id)); + return this.selectJoinOne(TrainTestPaperLibraryEntity.class, wrapper); + } + + @Override + public void create(TrainTestPaperLibraryEntity entity) { + this.save(entity); + } + + @Override + public boolean update(String id, TrainTestPaperLibraryEntity entity) { + return this.updateById(entity); + } + + @Override + public void delete(TrainTestPaperLibraryEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + + /** + * 验证表单唯一字段,正则,非空 i-0新增-1修改 + */ + @Override + public String checkForm(TrainTestPaperLibraryForm form, int i) { + boolean isUp = StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0"); + Object id = null; + String countRecover = ""; + String fieldTipName = ""; + String canNotNull = I18nUtil.getMessageStr("sys.validate.textRequiredSuffix", "不能为空"); + String canNotRepeated = I18nUtil.getMessageStr("EXIST103", "不能重复"); + if (isUp) { + id = form.getId(); + } + // 主表字段验证 + fieldTipName = "试卷名称"; + if (StringUtil.isEmpty(form.getFfullName())) { + return fieldTipName + canNotNull; + } + fieldTipName = "试题分类"; + fieldTipName = "创建用户"; + fieldTipName = "创建时间"; + fieldTipName = "修改用户"; + fieldTipName = "修改时间"; + fieldTipName = "所属组织"; + // 子表字段验证 + if (form.getTrainLibrarySingleList() != null) { + + fieldTipName = "单选题" + + "-" + "题目难度"; + + fieldTipName = "单选题" + + "-" + "分类"; + + fieldTipName = "单选题" + + "-" + "题目名称"; + + fieldTipName = "单选题" + + "-" + "解析"; + + fieldTipName = "单选题" + + "-" + "答案"; + + fieldTipName = "单选题" + + "-" + "题目类型"; + + fieldTipName = "单选题" + + "-" + "选项A"; + + fieldTipName = "单选题" + + "-" + "选项B"; + + fieldTipName = "单选题" + + "-" + "选项C"; + + fieldTipName = "单选题" + + "-" + "选项D"; + + fieldTipName = "单选题" + + "-" + "所属组织"; + + fieldTipName = "单选题" + + "-" + "修改时间"; + + fieldTipName = "单选题" + + "-" + "修改用户"; + + fieldTipName = "单选题" + + "-" + "创建时间"; + + fieldTipName = "单选题" + + "-" + "创建用户"; + + } + if (form.getTrainLibraryMoreList() != null) { + + fieldTipName = "多选题" + + "-" + "题目难度"; + + fieldTipName = "多选题" + + "-" + "分类"; + + fieldTipName = "多选题" + + "-" + "题目名称"; + + fieldTipName = "多选题" + + "-" + "解析"; + + fieldTipName = "多选题" + + "-" + "答案"; + + fieldTipName = "多选题" + + "-" + "题目类型"; + + fieldTipName = "多选题" + + "-" + "选项A"; + + fieldTipName = "多选题" + + "-" + "选项B"; + + fieldTipName = "多选题" + + "-" + "选项C"; + + fieldTipName = "多选题" + + "-" + "选项D"; + + fieldTipName = "多选题" + + "-" + "所属组织"; + + fieldTipName = "多选题" + + "-" + "修改时间"; + + fieldTipName = "多选题" + + "-" + "修改用户"; + + fieldTipName = "多选题" + + "-" + "创建时间"; + + fieldTipName = "多选题" + + "-" + "创建用户"; + + } + if (form.getTrainLibraryJudgmentList() != null) { + + fieldTipName = "判断题" + + "-" + "题目难度"; + + fieldTipName = "判断题" + + "-" + "分类"; + + fieldTipName = "判断题" + + "-" + "题目名称"; + + fieldTipName = "判断题" + + "-" + "解析"; + + fieldTipName = "判断题" + + "-" + "答案"; + + fieldTipName = "判断题" + + "-" + "题目类型"; + + fieldTipName = "判断题" + + "-" + "所属组织"; + + fieldTipName = "判断题" + + "-" + "修改时间"; + + fieldTipName = "判断题" + + "-" + "修改用户"; + + fieldTipName = "判断题" + + "-" + "创建时间"; + + fieldTipName = "判断题" + + "-" + "创建用户"; + + } + if (form.getTrainLibraryEssayQuestionList() != null) { + + fieldTipName = "问答题" + + "-" + "题目难度"; + + fieldTipName = "问答题" + + "-" + "分类"; + + fieldTipName = "问答题" + + "-" + "题目名称"; + + fieldTipName = "问答题" + + "-" + "解析"; + + fieldTipName = "问答题" + + "-" + "答案"; + + fieldTipName = "问答题" + + "-" + "题目类型"; + + fieldTipName = "问答题" + + "-" + "所属组织"; + + fieldTipName = "问答题" + + "-" + "修改时间"; + + fieldTipName = "问答题" + + "-" + "修改用户"; + + fieldTipName = "问答题" + + "-" + "创建时间"; + + fieldTipName = "问答题" + + "-" + "创建用户"; + + } + return countRecover; + } + + /** + * 新增修改数据(事务回滚) + * + * @param id + * @param trainTestPaperLibraryForm + * @return + */ + @Override + @Transactional + public void saveOrUpdate(TrainTestPaperLibraryForm trainTestPaperLibraryForm, String id, boolean isSave) + throws Exception { + UserInfo userInfo = userProvider.get(); + UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId()); + trainTestPaperLibraryForm = JsonUtil.getJsonToBean( + generaterSwapUtil.swapDatetime(TrainTestPaperLibraryConstant.getFormData(), trainTestPaperLibraryForm, + TrainTestPaperLibraryConstant.TABLERENAMES), + TrainTestPaperLibraryForm.class); + TrainTestPaperLibraryEntity entity = JsonUtil.getJsonToBean(trainTestPaperLibraryForm, + TrainTestPaperLibraryEntity.class); + String mainUuid = StringUtil.isEmpty(id) ? RandomUtil.uuId() : id; + if (isSave) { + entity.setFlowTaskId(mainUuid); + entity.setFcreatorUserId(userInfo.getUserId()); + entity.setFcreatorTime(DateUtil.getNowDate()); + entity.setFlastModifyUserId(null); + entity.setFlastModifyTime(null); + entity.setForganizeId(generaterSwapUtil.getCurrentOrgIds(userInfo.getOrganizeId(), "last")); + entity.setId(mainUuid); + } else { + entity.setFcreatorUserId(null); + entity.setFcreatorTime(null); + entity.setFlastModifyUserId(userInfo.getUserId()); + entity.setFlastModifyTime(DateUtil.getNowDate()); + entity.setForganizeId(null); + } + this.saveOrUpdate(entity); + + // TrainLibrarySingle子表数据新增修改 + QueryWrapper TrainLibrarySinglequeryWrapper = new QueryWrapper<>(); + TrainLibrarySinglequeryWrapper.lambda().eq(TrainLibrarySingleEntity::getFbankId, entity.getId()); + if (!isSave && !CollectionUtils.isNotEmpty(trainTestPaperLibraryForm.getTrainLibrarySingleList())) { + trainLibrarySingleService.remove(TrainLibrarySinglequeryWrapper); + } + if (CollectionUtils.isNotEmpty(trainTestPaperLibraryForm.getTrainLibrarySingleList())) { + List tableField103 = JsonUtil.getJsonToList( + trainTestPaperLibraryForm.getTrainLibrarySingleList(), TrainLibrarySingleEntity.class); + // 移除的数据 + List childIds = tableField103.stream().filter(t -> t.getId() != null) + .map(TrainLibrarySingleEntity::getId).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(childIds)) { + TrainLibrarySinglequeryWrapper.lambda().notIn(TrainLibrarySingleEntity::getId, childIds); + } + trainLibrarySingleService.remove(TrainLibrarySinglequeryWrapper); + for (TrainLibrarySingleEntity entitys : tableField103) { + entitys.setFbankId(entity.getId()); + if (isSave || entitys.getId() == null) { + entitys.setForganizeId(generaterSwapUtil.getCurrentOrgIds(userInfo.getOrganizeId(), "last")); + entitys.setFlastModifyTime(null); + entitys.setFlastModifyUserId(null); + entitys.setFcreatorTime(DateUtil.getNowDate()); + entitys.setFcreatorUserId(userInfo.getUserId()); + } else { + entitys.setForganizeId(null); + entitys.setFlastModifyTime(DateUtil.getNowDate()); + entitys.setFlastModifyUserId(userInfo.getUserId()); + entitys.setFcreatorTime(null); + entitys.setFcreatorUserId(null); + } + if (entitys.getId() == null) { + entitys.setId(RandomUtil.uuId()); + } + trainLibrarySingleService.saveOrUpdate(entitys); + } + } + // TrainLibraryMore子表数据新增修改 + QueryWrapper TrainLibraryMorequeryWrapper = new QueryWrapper<>(); + TrainLibraryMorequeryWrapper.lambda().eq(TrainLibraryMoreEntity::getFbankId, entity.getId()); + if (!isSave && !CollectionUtils.isNotEmpty(trainTestPaperLibraryForm.getTrainLibraryMoreList())) { + trainLibraryMoreService.remove(TrainLibraryMorequeryWrapper); + } + if (CollectionUtils.isNotEmpty(trainTestPaperLibraryForm.getTrainLibraryMoreList())) { + List tableField131 = JsonUtil + .getJsonToList(trainTestPaperLibraryForm.getTrainLibraryMoreList(), TrainLibraryMoreEntity.class); + // 移除的数据 + List childIds = tableField131.stream().filter(t -> t.getId() != null) + .map(TrainLibraryMoreEntity::getId).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(childIds)) { + TrainLibraryMorequeryWrapper.lambda().notIn(TrainLibraryMoreEntity::getId, childIds); + } + trainLibraryMoreService.remove(TrainLibraryMorequeryWrapper); + for (TrainLibraryMoreEntity entitys : tableField131) { + entitys.setFbankId(entity.getId()); + if (isSave || entitys.getId() == null) { + entitys.setForganizeId(generaterSwapUtil.getCurrentOrgIds(userInfo.getOrganizeId(), "last")); + entitys.setFlastModifyTime(null); + entitys.setFlastModifyUserId(null); + entitys.setFcreatorTime(DateUtil.getNowDate()); + entitys.setFcreatorUserId(userInfo.getUserId()); + } else { + entitys.setForganizeId(null); + entitys.setFlastModifyTime(DateUtil.getNowDate()); + entitys.setFlastModifyUserId(userInfo.getUserId()); + entitys.setFcreatorTime(null); + entitys.setFcreatorUserId(null); + } + if (entitys.getId() == null) { + entitys.setId(RandomUtil.uuId()); + } + trainLibraryMoreService.saveOrUpdate(entitys); + } + } + // TrainLibraryJudgment子表数据新增修改 + QueryWrapper TrainLibraryJudgmentqueryWrapper = new QueryWrapper<>(); + TrainLibraryJudgmentqueryWrapper.lambda().eq(TrainLibraryJudgmentEntity::getFbankId, entity.getId()); + if (!isSave && !CollectionUtils.isNotEmpty(trainTestPaperLibraryForm.getTrainLibraryJudgmentList())) { + trainLibraryJudgmentService.remove(TrainLibraryJudgmentqueryWrapper); + } + if (CollectionUtils.isNotEmpty(trainTestPaperLibraryForm.getTrainLibraryJudgmentList())) { + List tableField147 = JsonUtil.getJsonToList( + trainTestPaperLibraryForm.getTrainLibraryJudgmentList(), TrainLibraryJudgmentEntity.class); + // 移除的数据 + List childIds = tableField147.stream().filter(t -> t.getId() != null) + .map(TrainLibraryJudgmentEntity::getId).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(childIds)) { + TrainLibraryJudgmentqueryWrapper.lambda().notIn(TrainLibraryJudgmentEntity::getId, childIds); + } + trainLibraryJudgmentService.remove(TrainLibraryJudgmentqueryWrapper); + for (TrainLibraryJudgmentEntity entitys : tableField147) { + entitys.setFbankId(entity.getId()); + if (isSave || entitys.getId() == null) { + entitys.setForganizeId(generaterSwapUtil.getCurrentOrgIds(userInfo.getOrganizeId(), "last")); + entitys.setFlastModifyTime(null); + entitys.setFlastModifyUserId(null); + entitys.setFcreatorTime(DateUtil.getNowDate()); + entitys.setFcreatorUserId(userInfo.getUserId()); + } else { + entitys.setForganizeId(null); + entitys.setFlastModifyTime(DateUtil.getNowDate()); + entitys.setFlastModifyUserId(userInfo.getUserId()); + entitys.setFcreatorTime(null); + entitys.setFcreatorUserId(null); + } + if (entitys.getId() == null) { + entitys.setId(RandomUtil.uuId()); + } + trainLibraryJudgmentService.saveOrUpdate(entitys); + } + } + // TrainLibraryEssayQuestion子表数据新增修改 + QueryWrapper TrainLibraryEssayQuestionqueryWrapper = new QueryWrapper<>(); + TrainLibraryEssayQuestionqueryWrapper.lambda().eq(TrainLibraryEssayQuestionEntity::getFbankId, entity.getId()); + if (!isSave && !CollectionUtils.isNotEmpty(trainTestPaperLibraryForm.getTrainLibraryEssayQuestionList())) { + trainLibraryEssayQuestionService.remove(TrainLibraryEssayQuestionqueryWrapper); + } + if (CollectionUtils.isNotEmpty(trainTestPaperLibraryForm.getTrainLibraryEssayQuestionList())) { + List tableField180 = JsonUtil.getJsonToList( + trainTestPaperLibraryForm.getTrainLibraryEssayQuestionList(), + TrainLibraryEssayQuestionEntity.class); + // 移除的数据 + List childIds = tableField180.stream().filter(t -> t.getId() != null) + .map(TrainLibraryEssayQuestionEntity::getId).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(childIds)) { + TrainLibraryEssayQuestionqueryWrapper.lambda().notIn(TrainLibraryEssayQuestionEntity::getId, childIds); + } + trainLibraryEssayQuestionService.remove(TrainLibraryEssayQuestionqueryWrapper); + for (TrainLibraryEssayQuestionEntity entitys : tableField180) { + entitys.setFbankId(entity.getId()); + if (isSave || entitys.getId() == null) { + entitys.setForganizeId(generaterSwapUtil.getCurrentOrgIds(userInfo.getOrganizeId(), "last")); + entitys.setFlastModifyTime(null); + entitys.setFlastModifyUserId(null); + entitys.setFcreatorTime(DateUtil.getNowDate()); + entitys.setFcreatorUserId(userInfo.getUserId()); + } else { + entitys.setForganizeId(null); + entitys.setFlastModifyTime(DateUtil.getNowDate()); + entitys.setFlastModifyUserId(userInfo.getUserId()); + entitys.setFcreatorTime(null); + entitys.setFcreatorUserId(null); + } + if (entitys.getId() == null) { + entitys.setId(RandomUtil.uuId()); + } + trainLibraryEssayQuestionService.saveOrUpdate(entitys); + } + } + } + + @Override + @Transactional + public ActionResult onlineExamSubmit(OnlineExamSubmitDTO onlineExamSubmitDTO) { + TrainTestPaperLibraryEntity libraryEntity = trainTestPaperLibraryMapper.selectById(onlineExamSubmitDTO.getId()); + TrainExamRecordsEntity recordsEntity = new TrainExamRecordsEntity(); + recordsEntity.setId(RandomUtil.uuId()).setFlibraryId(onlineExamSubmitDTO.getId()) + .setFnumber(libraryEntity.getFnumber()) + .setFexaminers(userProvider.get().getUserId()).setFfullName(libraryEntity.getFfullName()) + .setFsort(libraryEntity.getFsort()).setFmark("100") + .setFquestionFlag("不存在").setFquestionStatus("已完成").setFquestionScore(0) + .setFcreatorTime(DateUtil.getNowDate()).setFcreatorUserId(userProvider.get().getUserId()) + .setForganizeId(userProvider.get().getOrganizeId()); + List singleEntities = onlineExamSubmitDTO.getSingleEntities(); + List moreEntities = onlineExamSubmitDTO.getMoreEntities(); + List judgmentEntities = onlineExamSubmitDTO.getJudgmentEntities(); + List essayQuestionEntities = onlineExamSubmitDTO.getEssayQuestionEntities(); + int totalCount = 0; + int correctCount = 0; + List resultSingleEntities = new ArrayList<>(); + List resultMoreEntities = new ArrayList<>(); + List resultJudgmentEntities = new ArrayList<>(); + List resultEssayQuestionEntities = new ArrayList<>(); + + if (!singleEntities.isEmpty()) { + totalCount += singleEntities.size(); + List realSingleEntities = trainLibrarySingleService + .getListByParentId(onlineExamSubmitDTO.getId()); + for (TrainLibrarySingleEntity singleEntity : singleEntities) { + for (TrainLibrarySingleEntity entity : realSingleEntities) { + if (singleEntity.getId().equals(entity.getId())) { + System.out.println("正确答案: " + entity.getFanswer() + " 用户答案: " + singleEntity.getFanswer()); + if (singleEntity.getFanswer().equals(entity.getFanswer())) { + correctCount++; + } + } + } + singleEntity.setId(RandomUtil.uuId()).setFbankId(recordsEntity.getId()) + .setFfullName(singleEntity.getFfullName()); + resultSingleEntities.add(singleEntity); + } + } + if (!moreEntities.isEmpty()) { + totalCount += moreEntities.size(); + List realMoreEntities = trainLibraryMoreService + .getListByParentId(onlineExamSubmitDTO.getId()); + for (TrainLibraryMoreEntity moreEntity : moreEntities) { + for (TrainLibraryMoreEntity entity : realMoreEntities) { + if (moreEntity.getId().equals(entity.getId())) { + System.out.println("正确答案: " + entity.getFanswer() + " 用户答案: " + moreEntity.getFanswer()); + // 判断结果 + List userAnswerList = Arrays + .asList(moreEntity.getFanswer().replace("[", "").replace("]", "").split(",")); + List correctAnswerList = Arrays + .asList(entity.getFanswer().replace("[", "").replace("]", "").split(",")); + // 将 List 转换为 Set 以去除重复项并忽略顺序 + Set userAnswerSet = new HashSet<>(userAnswerList); + Set correctAnswerSet = new HashSet<>(correctAnswerList); + // 比较集合是否相等 + boolean isCorrect = userAnswerSet.equals(correctAnswerSet); + if (isCorrect) { + correctCount++; + } + } + } + moreEntity.setId(RandomUtil.uuId()).setFbankId(recordsEntity.getId()) + .setFfullName(moreEntity.getFfullName()); + resultMoreEntities.add(moreEntity); + } + } + if (!judgmentEntities.isEmpty()) { + totalCount += judgmentEntities.size(); + List realJudgmentEntities = trainLibraryJudgmentService + .getListByParentId(onlineExamSubmitDTO.getId()); + for (TrainLibraryJudgmentEntity judgmentEntity : judgmentEntities) { + for (TrainLibraryJudgmentEntity entity : realJudgmentEntities) { + if (judgmentEntity.getId().equals(entity.getId())) { + System.out.println("正确答案: " + entity.getFanswer() + " 用户答案: " + judgmentEntity.getFanswer()); + if (judgmentEntity.getFanswer().equals(entity.getFanswer())) { + correctCount++; + } + } + } + judgmentEntity.setId(RandomUtil.uuId()).setFbankId(recordsEntity.getId()) + .setFfullName(judgmentEntity.getFfullName()); + resultJudgmentEntities.add(judgmentEntity); + } + } + if (!essayQuestionEntities.isEmpty()) { + recordsEntity.setFquestionFlag("存在"); + recordsEntity.setFquestionStatus("未完成"); + totalCount += essayQuestionEntities.size(); + // List realEssayQuestionEntities = + // trainLibraryEssayQuestionService.getListByParentId(onlineExamSubmitDTO.getId()); + for (TrainLibraryEssayQuestionEntity essayQuestionEntity : essayQuestionEntities) { + essayQuestionEntity.setId(RandomUtil.uuId()).setFbankId(recordsEntity.getId()) + .setFfullName(essayQuestionEntity.getFfullName()); + resultEssayQuestionEntities.add(essayQuestionEntity); + } + } + if (totalCount > 0) { + // 计算每题的平均得分并四舍五入 + double averageScorePerQuestion = 100.0 / totalCount; + int roundedAverageScorePerQuestion = Math.toIntExact(Math.round(averageScorePerQuestion));// 每题得分 + + int totalScore = roundedAverageScorePerQuestion * totalCount;// 总分 + + recordsEntity.setFmark(String.valueOf(totalScore)); + recordsEntity.setFresultScore(String.valueOf(roundedAverageScorePerQuestion * correctCount)); + recordsEntity.setFperQuestion(roundedAverageScorePerQuestion); + recordsEntity.setFquestionNum(totalCount); + System.out.println("总题数: " + totalCount); + System.out.println("每题得分: " + roundedAverageScorePerQuestion); + System.out.println("总分: " + totalScore); + System.out.println("正确答案数量: " + correctCount); + System.out.println("最终得分: " + roundedAverageScorePerQuestion * correctCount); + + } else { + return ActionResult.fail("提交失败,该试卷中不含题目,请联系相关人员!"); + } + + // TODO 插入考试记录,单选+多选+判断+问答 + trainLibrarySingleService.saveBatch(resultSingleEntities); + trainLibraryMoreService.saveBatch(resultMoreEntities); + trainLibraryJudgmentService.saveBatch(resultJudgmentEntities); + trainLibraryEssayQuestionService.saveBatch(resultEssayQuestionEntities); + trainTestPaperLibraryMapper.saveRecords(recordsEntity); + + return ActionResult.success("提交成功"); + } +} diff --git a/yunzhupaas-train/yunzhupaas-train-controller/pom.xml b/yunzhupaas-train/yunzhupaas-train-controller/pom.xml new file mode 100644 index 0000000..cfd469a --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-controller/pom.xml @@ -0,0 +1,22 @@ + + + + yunzhupaas-train + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-train-controller + + + + com.yunzhupaas + yunzhupaas-train-biz + ${project.version} + + + + diff --git a/yunzhupaas-train/yunzhupaas-train-controller/src/main/java/com/yunzhupaas/controller/TrainExamRecordsController.java b/yunzhupaas-train/yunzhupaas-train-controller/src/main/java/com/yunzhupaas/controller/TrainExamRecordsController.java new file mode 100644 index 0000000..9c7b285 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-controller/src/main/java/com/yunzhupaas/controller/TrainExamRecordsController.java @@ -0,0 +1,352 @@ +package com.yunzhupaas.controller; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.dto.InReadPaperDTO; +import com.yunzhupaas.dto.OutExamRecordsDetailDTO; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.service.*; +import com.yunzhupaas.entity.*; +import com.yunzhupaas.util.*; +import com.yunzhupaas.model.trainexamrecords.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import com.yunzhupaas.flowable.entity.TaskEntity; +import jakarta.validation.Valid; + +import java.util.*; + +import com.yunzhupaas.model.ExcelModel; +import com.yunzhupaas.excel.ExcelExportStyler; +import com.yunzhupaas.excel.ExcelHelper; +import com.yunzhupaas.annotation.YunzhupaasField; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.base.entity.ProvinceEntity; + +import java.io.IOException; +import java.util.stream.Collectors; + +import com.yunzhupaas.flowable.entity.TaskEntity; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.model.visualJson.UploaderTemplateModel; +import com.yunzhupaas.base.util.FormExecelUtils; +import org.springframework.transaction.annotation.Transactional; + +/** + * 考试记录 + * + * @版本: V5.2.0 + * @版权: Copyright @ 2025 + * @作者: 浙江尖峰集团股份有限公司 + * @日期: 2024-11-06 + */ +@Slf4j +@RestController +@Tag(name = "考试记录", description = "train") +@RequestMapping("/api/train/TrainExamRecords") +public class TrainExamRecordsController { + + @Autowired + private GeneraterSwapUtil generaterSwapUtil; + + @Autowired + private UserProvider userProvider; + + @Autowired + private TrainExamRecordsService trainExamRecordsService; + + @Autowired + private TrainLibrarySingleService trainLibrarySingleService; + @Autowired + private TrainLibraryMoreService trainLibraryMoreService; + @Autowired + private TrainLibraryJudgmentService trainLibraryJudgmentService; + @Autowired + private TrainLibraryEssayQuestionService trainLibraryEssayQuestionService; + + /** + * 列表 + * + * @param trainExamRecordsPagination + * @return + */ + @Operation(summary = "获取列表") + @PostMapping("/getList") + public ActionResult list(@RequestBody TrainExamRecordsPagination trainExamRecordsPagination) throws Exception { + List list = trainExamRecordsService.getList(trainExamRecordsPagination); + List> realList = new ArrayList<>(); + for (TrainExamRecordsEntity entity : list) { + Map trainExamRecordsMap = JsonUtil.entityToMap(entity); + trainExamRecordsMap.put("id", trainExamRecordsMap.get("f_id")); + // 副表数据 + // 子表数据 + List trainLibrarySingleList = entity.getTrainLibrarySingle(); + trainExamRecordsMap.put("tableField103", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibrarySingleList))); + trainExamRecordsMap.put("trainLibrarySingleList", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibrarySingleList))); + List trainLibraryMoreList = entity.getTrainLibraryMore(); + trainExamRecordsMap.put("tableField131", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibraryMoreList))); + trainExamRecordsMap.put("trainLibraryMoreList", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibraryMoreList))); + List trainLibraryJudgmentList = entity.getTrainLibraryJudgment(); + trainExamRecordsMap.put("tableField147", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibraryJudgmentList))); + trainExamRecordsMap.put("trainLibraryJudgmentList", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibraryJudgmentList))); + List trainLibraryEssayQuestionList = entity.getTrainLibraryEssayQuestion(); + trainExamRecordsMap.put("tableField180", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibraryEssayQuestionList))); + trainExamRecordsMap.put("trainLibraryEssayQuestionList", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibraryEssayQuestionList))); + realList.add(trainExamRecordsMap); + } + // 数据转换 + boolean isPc = "pc".equals(ServletUtil.getHeader("yunzhupaas-origin")); + realList = generaterSwapUtil.swapDataList(realList, TrainExamRecordsConstant.getFormData(), + TrainExamRecordsConstant.getColumnData(), trainExamRecordsPagination.getModuleId(), + isPc ? false : false); + + // 返回对象 + PageListVO vo = new PageListVO(); + vo.setList(realList); + PaginationVO page = JsonUtil.getJsonToBean(trainExamRecordsPagination, PaginationVO.class); + vo.setPagination(page); + return ActionResult.success(vo); + } + + /** + * 创建 + * + * @param trainExamRecordsForm + * @return + */ + @PostMapping() + @Operation(summary = "创建") + public ActionResult create(@RequestBody @Valid TrainExamRecordsForm trainExamRecordsForm) { + String b = trainExamRecordsService.checkForm(trainExamRecordsForm, 0); + if (StringUtil.isNotEmpty(b)) { + return ActionResult.fail(b); + } + try { + trainExamRecordsService.saveOrUpdate(trainExamRecordsForm, null, true); + } catch (Exception e) { + return ActionResult.fail("新增数据失败"); + } + return ActionResult.success("创建成功"); + } + + /** + * 删除 + * + * @param id + * @return + */ + @Operation(summary = "删除") + @DeleteMapping("/{id}") + @Transactional + public ActionResult delete(@PathVariable("id") String id, + @RequestParam(name = "forceDel", defaultValue = "false") boolean forceDel) throws Exception { + TrainExamRecordsEntity entity = trainExamRecordsService.getInfo(id); + if (entity != null) { + // 主表数据删除 + trainExamRecordsService.delete(entity); + QueryWrapper queryWrapperTrainLibrarySingle = new QueryWrapper<>(); + queryWrapperTrainLibrarySingle.lambda().eq(TrainLibrarySingleEntity::getFbankId, entity.getId()); + // 子表数据删除 + trainLibrarySingleService.remove(queryWrapperTrainLibrarySingle); + QueryWrapper queryWrapperTrainLibraryMore = new QueryWrapper<>(); + queryWrapperTrainLibraryMore.lambda().eq(TrainLibraryMoreEntity::getFbankId, entity.getId()); + // 子表数据删除 + trainLibraryMoreService.remove(queryWrapperTrainLibraryMore); + QueryWrapper queryWrapperTrainLibraryJudgment = new QueryWrapper<>(); + queryWrapperTrainLibraryJudgment.lambda().eq(TrainLibraryJudgmentEntity::getFbankId, entity.getId()); + // 子表数据删除 + trainLibraryJudgmentService.remove(queryWrapperTrainLibraryJudgment); + QueryWrapper queryWrapperTrainLibraryEssayQuestion = new QueryWrapper<>(); + queryWrapperTrainLibraryEssayQuestion.lambda().eq(TrainLibraryEssayQuestionEntity::getFbankId, + entity.getId()); + // 子表数据删除 + trainLibraryEssayQuestionService.remove(queryWrapperTrainLibraryEssayQuestion); + } + return ActionResult.success("删除成功"); + } + + /** + * 批量删除 + * + * @param obj + * @return + */ + @DeleteMapping("/batchRemove") + @Transactional + @Operation(summary = "批量删除") + public ActionResult batchRemove(@RequestBody Object obj) { + Map objectMap = JsonUtil.entityToMap(obj); + List idList = JsonUtil.getJsonToList(objectMap.get("ids"), String.class); + String errInfo = ""; + List successList = new ArrayList<>(); + for (String allId : idList) { + try { + this.delete(allId, false); + successList.add(allId); + } catch (Exception e) { + errInfo = e.getMessage(); + } + } + if (successList.size() == 0 && StringUtil.isNotEmpty(errInfo)) { + return ActionResult.fail(errInfo); + } + return ActionResult.success("删除成功"); + } + + /** + * 编辑 + * + * @param id + * @param trainExamRecordsForm + * @return + */ + @PutMapping("/{id}") + @Operation(summary = "更新") + public ActionResult update(@PathVariable("id") String id, + @RequestBody @Valid TrainExamRecordsForm trainExamRecordsForm, + @RequestParam(value = "isImport", required = false) boolean isImport) { + TrainExamRecordsEntity entity = trainExamRecordsService.getInfo(id); + if (entity != null) { + trainExamRecordsForm.setId(String.valueOf(entity.getId())); + + if (!isImport) { + String b = trainExamRecordsService.checkForm(trainExamRecordsForm, 1); + if (StringUtil.isNotEmpty(b)) { + return ActionResult.fail(b); + } + } + + try { + trainExamRecordsService.saveOrUpdate(trainExamRecordsForm, id, false); + } catch (Exception e) { + return ActionResult.fail("修改数据失败"); + } + return ActionResult.success("更新成功"); + } else { + return ActionResult.fail("更新失败,数据不存在"); + } + } + + /** + * 表单信息(详情页) + * 详情页面使用-转换数据 + * + * @param id + * @return + */ + @Operation(summary = "表单信息(详情页)") + @GetMapping("/detail/{id}") + public ActionResult detailInfo(@PathVariable("id") String id) { + TrainExamRecordsEntity entity = trainExamRecordsService.getInfo(id); + if (entity == null) { + return ActionResult.fail("表单数据不存在!"); + } + Map trainExamRecordsMap = JsonUtil.entityToMap(entity); + trainExamRecordsMap.put("id", trainExamRecordsMap.get("f_id")); + // 副表数据 + // 子表数据 + List trainLibrarySingleList = entity.getTrainLibrarySingle(); + trainExamRecordsMap.put("tableField103", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibrarySingleList))); + trainExamRecordsMap.put("trainLibrarySingleList", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibrarySingleList))); + List trainLibraryMoreList = entity.getTrainLibraryMore(); + trainExamRecordsMap.put("tableField131", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibraryMoreList))); + trainExamRecordsMap.put("trainLibraryMoreList", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibraryMoreList))); + List trainLibraryJudgmentList = entity.getTrainLibraryJudgment(); + trainExamRecordsMap.put("tableField147", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibraryJudgmentList))); + trainExamRecordsMap.put("trainLibraryJudgmentList", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibraryJudgmentList))); + List trainLibraryEssayQuestionList = entity.getTrainLibraryEssayQuestion(); + trainExamRecordsMap.put("tableField180", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibraryEssayQuestionList))); + trainExamRecordsMap.put("trainLibraryEssayQuestionList", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibraryEssayQuestionList))); + boolean isPc = "pc".equals(ServletUtil.getHeader("yunzhupaas-origin")); + trainExamRecordsMap = generaterSwapUtil.swapDataDetail(trainExamRecordsMap, + TrainExamRecordsConstant.getFormData(), "623544962406941445", isPc ? false : false); + // 子表数据 + trainExamRecordsMap.put("trainLibrarySingleList", trainExamRecordsMap.get("tableField103")); + trainExamRecordsMap.put("trainLibraryMoreList", trainExamRecordsMap.get("tableField131")); + trainExamRecordsMap.put("trainLibraryJudgmentList", trainExamRecordsMap.get("tableField147")); + trainExamRecordsMap.put("trainLibraryEssayQuestionList", trainExamRecordsMap.get("tableField180")); + return ActionResult.success(trainExamRecordsMap); + } + + /** + * 获取详情(编辑页) + * 编辑页面使用-不转换数据 + * + * @param id + * @return + */ + @Operation(summary = "信息") + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) { + TrainExamRecordsEntity entity = trainExamRecordsService.getInfo(id); + if (entity == null) { + return ActionResult.fail("表单数据不存在!"); + } + Map trainExamRecordsMap = JsonUtil.entityToMap(entity); + trainExamRecordsMap.put("id", trainExamRecordsMap.get("f_id")); + // 副表数据 + // 子表数据 + List trainLibrarySingleList = entity.getTrainLibrarySingle(); + trainExamRecordsMap.put("tableField103", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibrarySingleList))); + trainExamRecordsMap.put("trainLibrarySingleList", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibrarySingleList))); + List trainLibraryMoreList = entity.getTrainLibraryMore(); + trainExamRecordsMap.put("tableField131", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibraryMoreList))); + trainExamRecordsMap.put("trainLibraryMoreList", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibraryMoreList))); + List trainLibraryJudgmentList = entity.getTrainLibraryJudgment(); + trainExamRecordsMap.put("tableField147", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibraryJudgmentList))); + trainExamRecordsMap.put("trainLibraryJudgmentList", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibraryJudgmentList))); + List trainLibraryEssayQuestionList = entity.getTrainLibraryEssayQuestion(); + trainExamRecordsMap.put("tableField180", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibraryEssayQuestionList))); + trainExamRecordsMap.put("trainLibraryEssayQuestionList", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibraryEssayQuestionList))); + trainExamRecordsMap = generaterSwapUtil.swapDataForm(trainExamRecordsMap, + TrainExamRecordsConstant.getFormData(), TrainExamRecordsConstant.TABLEFIELDKEY, + TrainExamRecordsConstant.TABLERENAMES); + return ActionResult.success(trainExamRecordsMap); + } + + @Operation(summary = "考试记录详情") + @GetMapping("/examRecordsDetail/{id}") + public ActionResult examRecordsDetail(@PathVariable("id") String id) { + return trainExamRecordsService.examRecordsDetail(id); + } + + @Operation(summary = "阅卷") + @PostMapping("/readPaper") + public ActionResult readPaper(@RequestBody InReadPaperDTO in) { + return trainExamRecordsService.readPaper(in); + } + +} diff --git a/yunzhupaas-train/yunzhupaas-train-controller/src/main/java/com/yunzhupaas/controller/TrainTestPaperLibraryController.java b/yunzhupaas-train/yunzhupaas-train-controller/src/main/java/com/yunzhupaas/controller/TrainTestPaperLibraryController.java new file mode 100644 index 0000000..cad8071 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-controller/src/main/java/com/yunzhupaas/controller/TrainTestPaperLibraryController.java @@ -0,0 +1,370 @@ +package com.yunzhupaas.controller; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.dto.OnlineExamSubmitDTO; +import com.yunzhupaas.dto.OutOnlineExamDTO; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.service.*; +import com.yunzhupaas.entity.*; +import com.yunzhupaas.util.*; +import com.yunzhupaas.model.traintestpaperlibrary.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import com.yunzhupaas.flowable.entity.TaskEntity; +import jakarta.validation.Valid; + +import java.util.*; + +import com.yunzhupaas.model.ExcelModel; +import com.yunzhupaas.excel.ExcelExportStyler; +import com.yunzhupaas.excel.ExcelHelper; +import com.yunzhupaas.annotation.YunzhupaasField; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.base.entity.ProvinceEntity; + +import java.io.IOException; +import java.util.stream.Collectors; + +import com.yunzhupaas.flowable.entity.TaskEntity; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.model.visualJson.UploaderTemplateModel; +import com.yunzhupaas.base.util.FormExecelUtils; +import org.springframework.transaction.annotation.Transactional; + +/** + * 在线考试 + * + * @版本: V5.2.0 + * @版权: Copyright @ 2025 + * @作者: 浙江尖峰集团股份有限公司 + * @日期: 2024-11-05 + */ +@Slf4j +@RestController +@Tag(name = "在线考试", description = "train") +@RequestMapping("/api/train/TrainTestPaperLibrary") +public class TrainTestPaperLibraryController { + + @Autowired + private GeneraterSwapUtil generaterSwapUtil; + + @Autowired + private UserProvider userProvider; + + @Autowired + private TrainTestPaperLibraryService trainTestPaperLibraryService; + + @Autowired + private TrainLibrarySingleService trainLibrarySingleService; + @Autowired + private TrainLibraryMoreService trainLibraryMoreService; + @Autowired + private TrainLibraryJudgmentService trainLibraryJudgmentService; + @Autowired + private TrainLibraryEssayQuestionService trainLibraryEssayQuestionService; + + /** + * 列表 + * + * @param trainTestPaperLibraryPagination + * @return + */ + @Operation(summary = "获取列表") + @PostMapping("/getList") + public ActionResult list(@RequestBody TrainTestPaperLibraryPagination trainTestPaperLibraryPagination) + throws Exception { + List list = trainTestPaperLibraryService.getList(trainTestPaperLibraryPagination); + List> realList = new ArrayList<>(); + for (TrainTestPaperLibraryEntity entity : list) { + Map trainTestPaperLibraryMap = JsonUtil.entityToMap(entity); + trainTestPaperLibraryMap.put("id", trainTestPaperLibraryMap.get("f_id")); + // 副表数据 + // 子表数据 + List trainLibrarySingleList = entity.getTrainLibrarySingle(); + trainTestPaperLibraryMap.put("tableField103", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibrarySingleList))); + trainTestPaperLibraryMap.put("trainLibrarySingleList", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibrarySingleList))); + List trainLibraryMoreList = entity.getTrainLibraryMore(); + trainTestPaperLibraryMap.put("tableField131", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibraryMoreList))); + trainTestPaperLibraryMap.put("trainLibraryMoreList", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibraryMoreList))); + List trainLibraryJudgmentList = entity.getTrainLibraryJudgment(); + trainTestPaperLibraryMap.put("tableField147", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibraryJudgmentList))); + trainTestPaperLibraryMap.put("trainLibraryJudgmentList", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibraryJudgmentList))); + List trainLibraryEssayQuestionList = entity.getTrainLibraryEssayQuestion(); + trainTestPaperLibraryMap.put("tableField180", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibraryEssayQuestionList))); + trainTestPaperLibraryMap.put("trainLibraryEssayQuestionList", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibraryEssayQuestionList))); + realList.add(trainTestPaperLibraryMap); + } + // 数据转换 + boolean isPc = "pc".equals(ServletUtil.getHeader("yunzhupaas-origin")); + realList = generaterSwapUtil.swapDataList(realList, TrainTestPaperLibraryConstant.getFormData(), + TrainTestPaperLibraryConstant.getColumnData(), trainTestPaperLibraryPagination.getModuleId(), + isPc ? false : false); + + // 返回对象 + PageListVO vo = new PageListVO(); + vo.setList(realList); + PaginationVO page = JsonUtil.getJsonToBean(trainTestPaperLibraryPagination, PaginationVO.class); + vo.setPagination(page); + return ActionResult.success(vo); + } + + /** + * 创建 + * + * @param trainTestPaperLibraryForm + * @return + */ + @PostMapping() + @Operation(summary = "创建") + public ActionResult create(@RequestBody @Valid TrainTestPaperLibraryForm trainTestPaperLibraryForm) { + String b = trainTestPaperLibraryService.checkForm(trainTestPaperLibraryForm, 0); + if (StringUtil.isNotEmpty(b)) { + return ActionResult.fail(b); + } + try { + trainTestPaperLibraryService.saveOrUpdate(trainTestPaperLibraryForm, null, true); + } catch (Exception e) { + return ActionResult.fail("新增数据失败"); + } + return ActionResult.success("创建成功"); + } + + /** + * 删除 + * + * @param id + * @return + */ + @Operation(summary = "删除") + @DeleteMapping("/{id}") + @Transactional + public ActionResult delete(@PathVariable("id") String id, + @RequestParam(name = "forceDel", defaultValue = "false") boolean forceDel) throws Exception { + TrainTestPaperLibraryEntity entity = trainTestPaperLibraryService.getInfo(id); + if (entity != null) { + // 主表数据删除 + trainTestPaperLibraryService.delete(entity); + QueryWrapper queryWrapperTrainLibrarySingle = new QueryWrapper<>(); + queryWrapperTrainLibrarySingle.lambda().eq(TrainLibrarySingleEntity::getFbankId, entity.getId()); + // 子表数据删除 + trainLibrarySingleService.remove(queryWrapperTrainLibrarySingle); + QueryWrapper queryWrapperTrainLibraryMore = new QueryWrapper<>(); + queryWrapperTrainLibraryMore.lambda().eq(TrainLibraryMoreEntity::getFbankId, entity.getId()); + // 子表数据删除 + trainLibraryMoreService.remove(queryWrapperTrainLibraryMore); + QueryWrapper queryWrapperTrainLibraryJudgment = new QueryWrapper<>(); + queryWrapperTrainLibraryJudgment.lambda().eq(TrainLibraryJudgmentEntity::getFbankId, entity.getId()); + // 子表数据删除 + trainLibraryJudgmentService.remove(queryWrapperTrainLibraryJudgment); + QueryWrapper queryWrapperTrainLibraryEssayQuestion = new QueryWrapper<>(); + queryWrapperTrainLibraryEssayQuestion.lambda().eq(TrainLibraryEssayQuestionEntity::getFbankId, + entity.getId()); + // 子表数据删除 + trainLibraryEssayQuestionService.remove(queryWrapperTrainLibraryEssayQuestion); + } + return ActionResult.success("删除成功"); + } + + /** + * 批量删除 + * + * @param obj + * @return + */ + @DeleteMapping("/batchRemove") + @Transactional + @Operation(summary = "批量删除") + public ActionResult batchRemove(@RequestBody Object obj) { + Map objectMap = JsonUtil.entityToMap(obj); + List idList = JsonUtil.getJsonToList(objectMap.get("ids"), String.class); + String errInfo = ""; + List successList = new ArrayList<>(); + for (String allId : idList) { + try { + this.delete(allId, false); + successList.add(allId); + } catch (Exception e) { + errInfo = e.getMessage(); + } + } + if (successList.size() == 0 && StringUtil.isNotEmpty(errInfo)) { + return ActionResult.fail(errInfo); + } + return ActionResult.success("删除成功"); + } + + /** + * 编辑 + * + * @param id + * @param trainTestPaperLibraryForm + * @return + */ + @PutMapping("/{id}") + @Operation(summary = "更新") + public ActionResult update(@PathVariable("id") String id, + @RequestBody @Valid TrainTestPaperLibraryForm trainTestPaperLibraryForm, + @RequestParam(value = "isImport", required = false) boolean isImport) { + TrainTestPaperLibraryEntity entity = trainTestPaperLibraryService.getInfo(id); + if (entity != null) { + trainTestPaperLibraryForm.setId(String.valueOf(entity.getId())); + + if (!isImport) { + String b = trainTestPaperLibraryService.checkForm(trainTestPaperLibraryForm, 1); + if (StringUtil.isNotEmpty(b)) { + return ActionResult.fail(b); + } + } + + try { + trainTestPaperLibraryService.saveOrUpdate(trainTestPaperLibraryForm, id, false); + } catch (Exception e) { + return ActionResult.fail("修改数据失败"); + } + return ActionResult.success("更新成功"); + } else { + return ActionResult.fail("更新失败,数据不存在"); + } + } + + /** + * 表单信息(详情页) + * 详情页面使用-转换数据 + * + * @param id + * @return + */ + @Operation(summary = "表单信息(详情页)") + @GetMapping("/detail/{id}") + public ActionResult detailInfo(@PathVariable("id") String id) { + TrainTestPaperLibraryEntity entity = trainTestPaperLibraryService.getInfo(id); + if (entity == null) { + return ActionResult.fail("表单数据不存在!"); + } + Map trainTestPaperLibraryMap = JsonUtil.entityToMap(entity); + trainTestPaperLibraryMap.put("id", trainTestPaperLibraryMap.get("f_id")); + // 副表数据 + // 子表数据 + List trainLibrarySingleList = entity.getTrainLibrarySingle(); + trainTestPaperLibraryMap.put("tableField103", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibrarySingleList))); + trainTestPaperLibraryMap.put("trainLibrarySingleList", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibrarySingleList))); + List trainLibraryMoreList = entity.getTrainLibraryMore(); + trainTestPaperLibraryMap.put("tableField131", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibraryMoreList))); + trainTestPaperLibraryMap.put("trainLibraryMoreList", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibraryMoreList))); + List trainLibraryJudgmentList = entity.getTrainLibraryJudgment(); + trainTestPaperLibraryMap.put("tableField147", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibraryJudgmentList))); + trainTestPaperLibraryMap.put("trainLibraryJudgmentList", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibraryJudgmentList))); + List trainLibraryEssayQuestionList = entity.getTrainLibraryEssayQuestion(); + trainTestPaperLibraryMap.put("tableField180", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibraryEssayQuestionList))); + trainTestPaperLibraryMap.put("trainLibraryEssayQuestionList", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibraryEssayQuestionList))); + boolean isPc = "pc".equals(ServletUtil.getHeader("yunzhupaas-origin")); + trainTestPaperLibraryMap = generaterSwapUtil.swapDataDetail(trainTestPaperLibraryMap, + TrainTestPaperLibraryConstant.getFormData(), "623132689079205957", isPc ? false : false); + // 子表数据 + trainTestPaperLibraryMap.put("trainLibrarySingleList", trainTestPaperLibraryMap.get("tableField103")); + trainTestPaperLibraryMap.put("trainLibraryMoreList", trainTestPaperLibraryMap.get("tableField131")); + trainTestPaperLibraryMap.put("trainLibraryJudgmentList", trainTestPaperLibraryMap.get("tableField147")); + trainTestPaperLibraryMap.put("trainLibraryEssayQuestionList", trainTestPaperLibraryMap.get("tableField180")); + return ActionResult.success(trainTestPaperLibraryMap); + } + + /** + * 获取详情(编辑页) + * 编辑页面使用-不转换数据 + * + * @param id + * @return + */ + @Operation(summary = "信息") + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) { + TrainTestPaperLibraryEntity entity = trainTestPaperLibraryService.getInfo(id); + if (entity == null) { + return ActionResult.fail("表单数据不存在!"); + } + Map trainTestPaperLibraryMap = JsonUtil.entityToMap(entity); + trainTestPaperLibraryMap.put("id", trainTestPaperLibraryMap.get("f_id")); + // 副表数据 + // 子表数据 + List trainLibrarySingleList = entity.getTrainLibrarySingle(); + trainTestPaperLibraryMap.put("tableField103", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibrarySingleList))); + trainTestPaperLibraryMap.put("trainLibrarySingleList", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibrarySingleList))); + List trainLibraryMoreList = entity.getTrainLibraryMore(); + trainTestPaperLibraryMap.put("tableField131", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibraryMoreList))); + trainTestPaperLibraryMap.put("trainLibraryMoreList", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibraryMoreList))); + List trainLibraryJudgmentList = entity.getTrainLibraryJudgment(); + trainTestPaperLibraryMap.put("tableField147", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibraryJudgmentList))); + trainTestPaperLibraryMap.put("trainLibraryJudgmentList", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibraryJudgmentList))); + List trainLibraryEssayQuestionList = entity.getTrainLibraryEssayQuestion(); + trainTestPaperLibraryMap.put("tableField180", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibraryEssayQuestionList))); + trainTestPaperLibraryMap.put("trainLibraryEssayQuestionList", + JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(trainLibraryEssayQuestionList))); + trainTestPaperLibraryMap = generaterSwapUtil.swapDataForm(trainTestPaperLibraryMap, + TrainTestPaperLibraryConstant.getFormData(), TrainTestPaperLibraryConstant.TABLEFIELDKEY, + TrainTestPaperLibraryConstant.TABLERENAMES); + return ActionResult.success(trainTestPaperLibraryMap); + } + + @Operation(summary = "在线考试详情") + @GetMapping("/onlineExam/{id}") + public ActionResult getOnlineExam(@PathVariable("id") String id) { + TrainTestPaperLibraryEntity entity = trainTestPaperLibraryService.getInfo(id); + + OutOnlineExamDTO outOnlineExamDTO = new OutOnlineExamDTO(); + outOnlineExamDTO.setId(id).setEndTime(entity.getFendTime()).setStartTime(entity.getFstartTime()) + .setExaminationDuration(entity.getFexaminationDuration()); + List singleEntities = trainLibrarySingleService.getListByParentId(id); + singleEntities.forEach(item -> item.setFanswer(null)); + List moreEntities = trainLibraryMoreService.getListByParentId(id); + moreEntities.forEach(item -> item.setFanswer(null)); + List judgmentEntities = trainLibraryJudgmentService.getListByParentId(id); + judgmentEntities.forEach(item -> item.setFanswer(null)); + List essayQuestionEntities = trainLibraryEssayQuestionService + .getListByParentId(id); + essayQuestionEntities.forEach(item -> item.setFanswer(null)); + outOnlineExamDTO.setSingleEntities(singleEntities) + .setMoreEntities(moreEntities) + .setJudgmentEntities(judgmentEntities) + .setEssayQuestionEntities(essayQuestionEntities); + return ActionResult.success(outOnlineExamDTO); + } + + @Operation(summary = "在线考试提交") + @PostMapping("/onlineExam/submit") + public ActionResult onlineExamSubmit(@RequestBody OnlineExamSubmitDTO onlineExamSubmitDTO) { + return trainTestPaperLibraryService.onlineExamSubmit(onlineExamSubmitDTO); + } +} diff --git a/yunzhupaas-train/yunzhupaas-train-entity/pom.xml b/yunzhupaas-train/yunzhupaas-train-entity/pom.xml new file mode 100644 index 0000000..ddd2426 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/pom.xml @@ -0,0 +1,22 @@ + + + + yunzhupaas-train + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-train-entity + + + + com.yunzhupaas + yunzhupaas-common-all + ${project.version} + + + + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/dto/EssayQuestionDTO.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/dto/EssayQuestionDTO.java new file mode 100644 index 0000000..c0ac06a --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/dto/EssayQuestionDTO.java @@ -0,0 +1,10 @@ +package com.yunzhupaas.dto; + +import lombok.Data; + +@Data +public class EssayQuestionDTO { + private String id; + private String result;//正确 错误 +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/dto/InReadPaperDTO.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/dto/InReadPaperDTO.java new file mode 100644 index 0000000..7fff2ef --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/dto/InReadPaperDTO.java @@ -0,0 +1,12 @@ +package com.yunzhupaas.dto; + +import lombok.Data; + +import java.util.List; + +@Data +public class InReadPaperDTO { + private String id;//考试记录id + private List essayQuestions; +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/dto/OnlineExamSubmitDTO.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/dto/OnlineExamSubmitDTO.java new file mode 100644 index 0000000..e04f273 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/dto/OnlineExamSubmitDTO.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.dto; + +import com.yunzhupaas.entity.TrainLibraryEssayQuestionEntity; +import com.yunzhupaas.entity.TrainLibraryJudgmentEntity; +import com.yunzhupaas.entity.TrainLibraryMoreEntity; +import com.yunzhupaas.entity.TrainLibrarySingleEntity; +import lombok.Data; + +import java.util.List; + +@Data +public class OnlineExamSubmitDTO { + private String id; //在线考试当前行主键id + private List singleEntities; + private List moreEntities; + private List judgmentEntities; + private List essayQuestionEntities; +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/dto/OutExamRecordsDetailDTO.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/dto/OutExamRecordsDetailDTO.java new file mode 100644 index 0000000..fcc823e --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/dto/OutExamRecordsDetailDTO.java @@ -0,0 +1,15 @@ +package com.yunzhupaas.dto; + +import lombok.Data; + +import java.util.List; + +@Data +public class OutExamRecordsDetailDTO { + private String id; + private List singleList; + private List multipleList; + private List judgeList; + private List shortAnswerList; +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/dto/OutJudgeDTO.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/dto/OutJudgeDTO.java new file mode 100644 index 0000000..746c50b --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/dto/OutJudgeDTO.java @@ -0,0 +1,15 @@ +package com.yunzhupaas.dto; + +import lombok.Data; +import lombok.experimental.Accessors; + +@Data +@Accessors(chain = true) +public class OutJudgeDTO { + private String id;//题目主键 + private String fullName;//题目名称 + private String userAnswer;//用户答案 + private String correctAnswer;//正确答案 + private String result;//结果 -- 正确/错误 +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/dto/OutMultipleDTO.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/dto/OutMultipleDTO.java new file mode 100644 index 0000000..af6521b --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/dto/OutMultipleDTO.java @@ -0,0 +1,15 @@ +package com.yunzhupaas.dto; + +import lombok.Data; +import lombok.experimental.Accessors; + +@Data +@Accessors(chain = true) +public class OutMultipleDTO { + private String id;//题目主键 + private String fullName;//题目名称 + private String userAnswer;//用户答案 + private String correctAnswer;//正确答案 + private String result;//结果 -- 正确/错误 +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/dto/OutOnlineExamDTO.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/dto/OutOnlineExamDTO.java new file mode 100644 index 0000000..45206a3 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/dto/OutOnlineExamDTO.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.dto; + +import com.yunzhupaas.entity.TrainLibraryEssayQuestionEntity; +import com.yunzhupaas.entity.TrainLibraryJudgmentEntity; +import com.yunzhupaas.entity.TrainLibraryMoreEntity; +import com.yunzhupaas.entity.TrainLibrarySingleEntity; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.Date; +import java.util.List; + +@Data +@Accessors(chain = true) +public class OutOnlineExamDTO { + private String id; //在线考试当前行主键id + private String examinationDuration; //考试时长(分钟) + private Date startTime;//开始时间 + private Date endTime;//结束时间 + private List singleEntities; + private List moreEntities; + private List judgmentEntities; + private List essayQuestionEntities; +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/dto/OutShortAnswerDTO.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/dto/OutShortAnswerDTO.java new file mode 100644 index 0000000..44e8ebf --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/dto/OutShortAnswerDTO.java @@ -0,0 +1,15 @@ +package com.yunzhupaas.dto; + +import lombok.Data; +import lombok.experimental.Accessors; + +@Data +@Accessors(chain = true) +public class OutShortAnswerDTO { + private String id;//题目主键 + private String fullName;//题目名称 + private String userAnswer;//用户答案 + private String correctAnswer;//正确答案 + private String result;//结果 -- 正确/错误 +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/dto/OutSingleDTO.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/dto/OutSingleDTO.java new file mode 100644 index 0000000..5a77453 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/dto/OutSingleDTO.java @@ -0,0 +1,15 @@ +package com.yunzhupaas.dto; + +import lombok.Data; +import lombok.experimental.Accessors; + +@Data +@Accessors(chain = true) +public class OutSingleDTO { + private String id;//题目主键 + private String fullName;//题目名称 + private String userAnswer;//用户答案 + private String correctAnswer;//正确答案 + private String result;//结果 -- 正确/错误 +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/entity/TrainExamRecordsEntity.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/entity/TrainExamRecordsEntity.java new file mode 100644 index 0000000..55c7ab3 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/entity/TrainExamRecordsEntity.java @@ -0,0 +1,127 @@ +package com.yunzhupaas.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import java.util.Date; +import java.util.List; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.experimental.Accessors; + +/** + * 教育培训-考试记录 + * + * @版本: V5.2.0 + * @版权: Copyright @ 2025 + * @作者: 浙江尖峰集团股份有限公司 + * @日期: 2024-11-06 + */ +@Data +@TableName("make_train_exam_records") +@Accessors(chain = true) +public class TrainExamRecordsEntity { + @TableId(value ="f_id" ) + @JSONField(name = "f_id") + private String id; + @TableField("f_library_id") + @JSONField(name = "f_library_id") + private String flibraryId; + @TableField("f_number") + @JSONField(name = "f_number") + private String fnumber; + @TableField(value = "f_examiners" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_examiners") + private String fexaminers; + @TableField(value = "f_full_name" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_full_name") + private String ffullName; + @TableField(value = "f_sort" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_sort") + private String fsort; + @TableField(value = "f_mark" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_mark") + private String fmark; + @TableField(value = "f_question_num" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_question_num") + private Integer fquestionNum; + @TableField(value = "f_per_question" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_per_question") + private Integer fperQuestion; + @TableField(value = "f_result_score" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_result_score") + private String fresultScore; + @TableField("f_basic_score") + @JSONField(name = "f_basic_score") + private Integer fbasicScore; + @TableField(value = "f_question_flag" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_question_flag") + private String fquestionFlag; + @TableField(value = "f_question_status" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_question_status") + private String fquestionStatus; + @TableField("f_question_score") + @JSONField(name = "f_question_score") + private Integer fquestionScore; + @TableField("f_enabled_mark") + @JSONField(name = "f_enabled_mark") + private Integer fenabledMark; + @TableField("f_sort_code") + @JSONField(name = "f_sort_code") + private Long fsortCode; + @TableField("f_organize_id") + @JSONField(name = "f_organize_id") + private String forganizeId; + @TableField("f_creator_time") + @JSONField(name = "f_creator_time") + private Date fcreatorTime; + @TableField("f_creator_user_id") + @JSONField(name = "f_creator_user_id") + private String fcreatorUserId; + @TableField("f_last_modify_time") + @JSONField(name = "f_last_modify_time") + private Date flastModifyTime; + @TableField("f_last_modify_user_id") + @JSONField(name = "f_last_modify_user_id") + private String flastModifyUserId; + @TableField("f_delete_time") + @JSONField(name = "f_delete_time") + private Date deleteTime; + @TableField("f_delete_user_id") + @JSONField(name = "f_delete_user_id") + private String deleteUserId; + @TableField("f_delete_mark") + @JSONField(name = "f_delete_mark") + private Integer deleteMark; + @TableField(value = "f_tenant_id",fill = FieldFill.INSERT_UPDATE) + @JSONField(name = "f_tenant_id") + private String tenantId; + @TableField("f_flow_id") + @JSONField(name = "f_flow_id") + private String flowId; + @TableField("f_flow_task_id") + @JSONField(name = "f_flow_task_id") + private String flowTaskId; + @TableField("f_start_time") + @JSONField(name = "f_start_time") + private Date fstartTime; + @TableField("f_end_time") + @JSONField(name = "f_end_time") + private Date fendTime; + @TableField(value = "f_examer" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_examer") + private String fexamer; + + @JSONField(name = "trainLibraryEssayQuestion") + @TableField(exist = false) + private List trainLibraryEssayQuestion; + @JSONField(name = "trainLibraryJudgment") + @TableField(exist = false) + private List trainLibraryJudgment; + @JSONField(name = "trainLibraryMore") + @TableField(exist = false) + private List trainLibraryMore; + @JSONField(name = "trainLibrarySingle") + @TableField(exist = false) + private List trainLibrarySingle; +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/entity/TrainLibraryEssayQuestionEntity.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/entity/TrainLibraryEssayQuestionEntity.java new file mode 100644 index 0000000..65c7bcd --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/entity/TrainLibraryEssayQuestionEntity.java @@ -0,0 +1,94 @@ +package com.yunzhupaas.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import java.util.Date; +import java.util.List; +import com.alibaba.fastjson.annotation.JSONField; +import lombok.experimental.Accessors; + +/** + * 教育培训-试卷库-问答题 + * + * @版本: V5.2.0 + * @版权: Copyright @ 2025 + * @作者: 浙江尖峰集团股份有限公司 + * @日期: 2024-11-05 + */ +@Data +@TableName("make_train_library_essay_question") +@Accessors(chain = true) +public class TrainLibraryEssayQuestionEntity { + @TableId(value ="f_id" ) + @JSONField(name = "f_id") + private String id; + @TableField("f_bank_id") + @JSONField(name = "f_bank_id") + private String fbankId; + @TableField(value = "f_difficulty" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_difficulty") + private String fdifficulty; + @TableField(value = "f_sort" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_sort") + private String fsort; + @TableField(value = "f_full_name" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_full_name") + private String ffullName; + @TableField(value = "f_analyze" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_analyze") + private String fanalyze; + @TableField(value = "f_result" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_result") + private String fresult; + @TableField(value = "f_answer" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_answer") + private String fanswer; + @TableField("f_description") + @JSONField(name = "f_description") + private String fdescription; + @TableField("f_enabled_mark") + @JSONField(name = "f_enabled_mark") + private Integer fenabledMark; + @TableField("f_sort_code") + @JSONField(name = "f_sort_code") + private Long fsortCode; + @TableField("f_organize_id") + @JSONField(name = "f_organize_id") + private String forganizeId; + @TableField("f_creator_time") + @JSONField(name = "f_creator_time") + private Date fcreatorTime; + @TableField("f_creator_user_id") + @JSONField(name = "f_creator_user_id") + private String fcreatorUserId; + @TableField("f_last_modify_time") + @JSONField(name = "f_last_modify_time") + private Date flastModifyTime; + @TableField("f_last_modify_user_id") + @JSONField(name = "f_last_modify_user_id") + private String flastModifyUserId; + @TableField("f_delete_time") + @JSONField(name = "f_delete_time") + private Date deleteTime; + @TableField("f_delete_user_id") + @JSONField(name = "f_delete_user_id") + private String deleteUserId; + @TableField("f_delete_mark") + @JSONField(name = "f_delete_mark") + private Integer deleteMark; + @TableField(value = "f_tenant_id",fill = FieldFill.INSERT_UPDATE) + @JSONField(name = "f_tenant_id") + private String tenantId; + @TableField("f_flow_id") + @JSONField(name = "f_flow_id") + private String flowId; + @TableField("f_flow_task_id") + @JSONField(name = "f_flow_task_id") + private String flowTaskId; + @TableField(value = "f_topic_type" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_topic_type") + private String ftopicType; + + +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/entity/TrainLibraryJudgmentEntity.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/entity/TrainLibraryJudgmentEntity.java new file mode 100644 index 0000000..0d09a7d --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/entity/TrainLibraryJudgmentEntity.java @@ -0,0 +1,90 @@ +package com.yunzhupaas.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import java.util.Date; +import java.util.List; +import com.alibaba.fastjson.annotation.JSONField; +import lombok.experimental.Accessors; + +/** + * 教育培训-试卷库-判断题 + * + * @版本: V5.2.0 + * @版权: Copyright @ 2025 + * @作者: 浙江尖峰集团股份有限公司 + * @日期: 2024-11-05 + */ +@Data +@TableName("make_train_library_judgment") +@Accessors(chain = true) +public class TrainLibraryJudgmentEntity { + @TableId(value ="f_id" ) + @JSONField(name = "f_id") + private String id; + @TableField("f_bank_id") + @JSONField(name = "f_bank_id") + private String fbankId; + @TableField(value = "f_difficulty" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_difficulty") + private String fdifficulty; + @TableField(value = "f_sort" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_sort") + private String fsort; + @TableField(value = "f_full_name" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_full_name") + private String ffullName; + @TableField(value = "f_analyze" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_analyze") + private String fanalyze; + @TableField(value = "f_answer" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_answer") + private String fanswer; + @TableField("f_description") + @JSONField(name = "f_description") + private String fdescription; + @TableField("f_enabled_mark") + @JSONField(name = "f_enabled_mark") + private Integer fenabledMark; + @TableField("f_sort_code") + @JSONField(name = "f_sort_code") + private Long fsortCode; + @TableField("f_organize_id") + @JSONField(name = "f_organize_id") + private String forganizeId; + @TableField("f_creator_time") + @JSONField(name = "f_creator_time") + private Date fcreatorTime; + @TableField("f_creator_user_id") + @JSONField(name = "f_creator_user_id") + private String fcreatorUserId; + @TableField("f_last_modify_time") + @JSONField(name = "f_last_modify_time") + private Date flastModifyTime; + @TableField("f_last_modify_user_id") + @JSONField(name = "f_last_modify_user_id") + private String flastModifyUserId; + @TableField("f_delete_time") + @JSONField(name = "f_delete_time") + private Date deleteTime; + @TableField("f_delete_user_id") + @JSONField(name = "f_delete_user_id") + private String deleteUserId; + @TableField("f_delete_mark") + @JSONField(name = "f_delete_mark") + private Integer deleteMark; + @TableField(value = "f_tenant_id",fill = FieldFill.INSERT_UPDATE) + @JSONField(name = "f_tenant_id") + private String tenantId; + @TableField("f_flow_id") + @JSONField(name = "f_flow_id") + private String flowId; + @TableField("f_flow_task_id") + @JSONField(name = "f_flow_task_id") + private String flowTaskId; + @TableField(value = "f_topic_type" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_topic_type") + private String ftopicType; + +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/entity/TrainLibraryMoreEntity.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/entity/TrainLibraryMoreEntity.java new file mode 100644 index 0000000..17500aa --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/entity/TrainLibraryMoreEntity.java @@ -0,0 +1,102 @@ +package com.yunzhupaas.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import java.util.Date; +import java.util.List; +import com.alibaba.fastjson.annotation.JSONField; +import lombok.experimental.Accessors; + +/** + * 教育培训-试卷库-多选题 + * + * @版本: V5.2.0 + * @版权: Copyright @ 2025 + * @作者: 浙江尖峰集团股份有限公司 + * @日期: 2024-11-05 + */ +@Data +@TableName("make_train_library_more") +@Accessors(chain = true) +public class TrainLibraryMoreEntity { + @TableId(value ="f_id" ) + @JSONField(name = "f_id") + private String id; + @TableField("f_bank_id") + @JSONField(name = "f_bank_id") + private String fbankId; + @TableField(value = "f_difficulty" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_difficulty") + private String fdifficulty; + @TableField(value = "f_sort" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_sort") + private String fsort; + @TableField(value = "f_full_name" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_full_name") + private String ffullName; + @TableField(value = "f_options_a" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_options_a") + private String foptionsA; + @TableField(value = "f_options_b" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_options_b") + private String foptionsB; + @TableField(value = "f_options_c" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_options_c") + private String foptionsC; + @TableField(value = "f_options_d" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_options_d") + private String foptionsD; + @TableField(value = "f_analyze" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_analyze") + private String fanalyze; + @TableField(value = "f_answer" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_answer") + private String fanswer; + @TableField("f_description") + @JSONField(name = "f_description") + private String fdescription; + @TableField("f_enabled_mark") + @JSONField(name = "f_enabled_mark") + private Integer fenabledMark; + @TableField("f_sort_code") + @JSONField(name = "f_sort_code") + private Long fsortCode; + @TableField("f_organize_id") + @JSONField(name = "f_organize_id") + private String forganizeId; + @TableField("f_creator_time") + @JSONField(name = "f_creator_time") + private Date fcreatorTime; + @TableField("f_creator_user_id") + @JSONField(name = "f_creator_user_id") + private String fcreatorUserId; + @TableField("f_last_modify_time") + @JSONField(name = "f_last_modify_time") + private Date flastModifyTime; + @TableField("f_last_modify_user_id") + @JSONField(name = "f_last_modify_user_id") + private String flastModifyUserId; + @TableField("f_delete_time") + @JSONField(name = "f_delete_time") + private Date deleteTime; + @TableField("f_delete_user_id") + @JSONField(name = "f_delete_user_id") + private String deleteUserId; + @TableField("f_delete_mark") + @JSONField(name = "f_delete_mark") + private Integer deleteMark; + @TableField(value = "f_tenant_id",fill = FieldFill.INSERT_UPDATE) + @JSONField(name = "f_tenant_id") + private String tenantId; + @TableField("f_flow_id") + @JSONField(name = "f_flow_id") + private String flowId; + @TableField("f_flow_task_id") + @JSONField(name = "f_flow_task_id") + private String flowTaskId; + @TableField(value = "f_topic_type" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_topic_type") + private String ftopicType; + +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/entity/TrainLibrarySingleEntity.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/entity/TrainLibrarySingleEntity.java new file mode 100644 index 0000000..3021ba9 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/entity/TrainLibrarySingleEntity.java @@ -0,0 +1,102 @@ +package com.yunzhupaas.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import java.util.Date; +import java.util.List; +import com.alibaba.fastjson.annotation.JSONField; +import lombok.experimental.Accessors; + +/** + * 教育培训-试卷库-单选题 + * + * @版本: V5.2.0 + * @版权: Copyright @ 2025 + * @作者: 浙江尖峰集团股份有限公司 + * @日期: 2024-11-05 + */ +@Data +@TableName("make_train_library_single") +@Accessors(chain = true) +public class TrainLibrarySingleEntity { + @TableId(value ="f_id" ) + @JSONField(name = "f_id") + private String id; + @TableField("f_bank_id") + @JSONField(name = "f_bank_id") + private String fbankId; + @TableField(value = "f_difficulty" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_difficulty") + private String fdifficulty; + @TableField(value = "f_sort" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_sort") + private String fsort; + @TableField(value = "f_full_name" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_full_name") + private String ffullName; + @TableField(value = "f_options_a" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_options_a") + private String foptionsA; + @TableField(value = "f_options_b" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_options_b") + private String foptionsB; + @TableField(value = "f_options_c" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_options_c") + private String foptionsC; + @TableField(value = "f_options_d" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_options_d") + private String foptionsD; + @TableField(value = "f_analyze" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_analyze") + private String fanalyze; + @TableField(value = "f_answer" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_answer") + private String fanswer; + @TableField(value = "f_topic_type" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_topic_type") + private String ftopicType; + @TableField("f_description") + @JSONField(name = "f_description") + private String fdescription; + @TableField("f_enabled_mark") + @JSONField(name = "f_enabled_mark") + private Integer fenabledMark; + @TableField("f_sort_code") + @JSONField(name = "f_sort_code") + private Long fsortCode; + @TableField("f_organize_id") + @JSONField(name = "f_organize_id") + private String forganizeId; + @TableField("f_creator_time") + @JSONField(name = "f_creator_time") + private Date fcreatorTime; + @TableField("f_creator_user_id") + @JSONField(name = "f_creator_user_id") + private String fcreatorUserId; + @TableField("f_last_modify_time") + @JSONField(name = "f_last_modify_time") + private Date flastModifyTime; + @TableField("f_last_modify_user_id") + @JSONField(name = "f_last_modify_user_id") + private String flastModifyUserId; + @TableField("f_delete_time") + @JSONField(name = "f_delete_time") + private Date deleteTime; + @TableField("f_delete_user_id") + @JSONField(name = "f_delete_user_id") + private String deleteUserId; + @TableField("f_delete_mark") + @JSONField(name = "f_delete_mark") + private Integer deleteMark; + @TableField(value = "f_tenant_id",fill = FieldFill.INSERT_UPDATE) + @JSONField(name = "f_tenant_id") + private String tenantId; + @TableField("f_flow_id") + @JSONField(name = "f_flow_id") + private String flowId; + @TableField("f_flow_task_id") + @JSONField(name = "f_flow_task_id") + private String flowTaskId; + +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/entity/TrainTestPaperLibraryEntity.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/entity/TrainTestPaperLibraryEntity.java new file mode 100644 index 0000000..daded1b --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/entity/TrainTestPaperLibraryEntity.java @@ -0,0 +1,120 @@ +package com.yunzhupaas.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import java.util.Date; +import java.util.List; +import com.alibaba.fastjson.annotation.JSONField; +/** + * 教育培训-试卷库 + * + * @版本: V5.2.0 + * @版权: Copyright @ 2025 + * @作者: 浙江尖峰集团股份有限公司 + * @日期: 2024-11-05 + */ +@Data +@TableName("make_train_test_paper_library") +public class TrainTestPaperLibraryEntity { + @TableId(value ="f_id" ) + @JSONField(name = "f_id") + private String id; + @TableField("f_number") + @JSONField(name = "f_number") + private String fnumber; + @TableField(value = "f_full_name" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_full_name") + private String ffullName; + @TableField(value = "f_sort" , updateStrategy = FieldStrategy.IGNORED) + @JSONField(name = "f_sort") + private String fsort; + @TableField("f_number_of_problems") + @JSONField(name = "f_number_of_problems") + private String fnumberOfProblems; + @TableField("f_mark") + @JSONField(name = "f_mark") + private String fmark; + @TableField("f_examination_title") + @JSONField(name = "f_examination_title") + private String fexaminationTitle; + @TableField("f_examination_time") + @JSONField(name = "f_examination_time") + private Date fexaminationTime; + @TableField("f_examination_duration") + @JSONField(name = "f_examination_duration") + private String fexaminationDuration; + @TableField("f_passing_score") + @JSONField(name = "f_passing_score") + private String fpassingScore; + @TableField("f_training_record") + @JSONField(name = "f_training_record") + private String ftrainingRecord; + @TableField("f_examiners") + @JSONField(name = "f_examiners") + private String fexaminers; + @TableField("f_examer") + @JSONField(name = "f_examer") + private String fexamer; + @TableField("f_description") + @JSONField(name = "f_description") + private String fdescription; + @TableField("f_enabled_mark") + @JSONField(name = "f_enabled_mark") + private Integer fenabledMark; + @TableField("f_sort_code") + @JSONField(name = "f_sort_code") + private Long fsortCode; + @TableField("f_organize_id") + @JSONField(name = "f_organize_id") + private String forganizeId; + @TableField("f_creator_time") + @JSONField(name = "f_creator_time") + private Date fcreatorTime; + @TableField("f_creator_user_id") + @JSONField(name = "f_creator_user_id") + private String fcreatorUserId; + @TableField("f_last_modify_time") + @JSONField(name = "f_last_modify_time") + private Date flastModifyTime; + @TableField("f_last_modify_user_id") + @JSONField(name = "f_last_modify_user_id") + private String flastModifyUserId; + @TableField("f_delete_time") + @JSONField(name = "f_delete_time") + private Date deleteTime; + @TableField("f_delete_user_id") + @JSONField(name = "f_delete_user_id") + private String deleteUserId; + @TableField("f_delete_mark") + @JSONField(name = "f_delete_mark") + private Integer deleteMark; + @TableField(value = "f_tenant_id",fill = FieldFill.INSERT_UPDATE) + @JSONField(name = "f_tenant_id") + private String tenantId; + @TableField("f_flow_id") + @JSONField(name = "f_flow_id") + private String flowId; + @TableField("f_flow_task_id") + @JSONField(name = "f_flow_task_id") + private String flowTaskId; + @TableField("f_start_time") + @JSONField(name = "f_start_time") + private Date fstartTime; + @TableField("f_end_time") + @JSONField(name = "f_end_time") + private Date fendTime; + + @JSONField(name = "trainLibraryEssayQuestion") + @TableField(exist = false) + private List trainLibraryEssayQuestion; + @JSONField(name = "trainLibraryJudgment") + @TableField(exist = false) + private List trainLibraryJudgment; + @JSONField(name = "trainLibraryMore") + @TableField(exist = false) + private List trainLibraryMore; + @JSONField(name = "trainLibrarySingle") + @TableField(exist = false) + private List trainLibrarySingle; +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainExamRecordsConstant.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainExamRecordsConstant.java new file mode 100644 index 0000000..566abed --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainExamRecordsConstant.java @@ -0,0 +1,67 @@ +package com.yunzhupaas.model.trainexamrecords; + +import com.yunzhupaas.util.JsonUtil; +import java.util.*; + +/** + * 考试记录配置json + * + * @版本: V5.2.0 + * @版权: Copyright @ 2025 + * @作者: 浙江尖峰集团股份有限公司 + * @日期: 2024-11-06 + */ +public class TrainExamRecordsConstant { + /** 数据库链接 */ + public static final String DBLINKID = "0"; + /** 表别名 map */ + public static final Map TABLERENAMES = JsonUtil.getJsonToBean( + "{\"make_train_library_essay_question\":\"trainLibraryEssayQuestion\",\"make_train_library_judgment\":\"trainLibraryJudgment\",\"make_train_library_more\":\"trainLibraryMore\",\"make_train_library_single\":\"trainLibrarySingle\",\"make_train_exam_records\":\"trainExamRecords\"}", + Map.class); + /** 子表model map */ + public static final Map TABLEFIELDKEY = JsonUtil.getJsonToBean( + "{\"tableField103\":\"make_train_library_single\",\"tableField147\":\"make_train_library_judgment\",\"tableField131\":\"make_train_library_more\",\"tableField180\":\"make_train_library_essay_question\"}", + Map.class); + + /** 整个表单配置json */ + public static final String getFormData() { + StringBuilder sb = new StringBuilder(); + sb.append( + "{\"popupType\":\"general\",\"idGlobal\":201,\"labelWidth\":100,\"classNames\":[],\"className\":[],\"fullScreenWidth\":\"100%\",\"hasConfirmAndAddBtn\":false,\"cancelButtonTextI18nCode\":\"common.cancelText\",\"labelPosition\":\"right\",\"printId\":\"\",\"labelSuffix\":\"\",\"disabled\":false,\"formModel\":\"dataForm\",\"cancelButtonText\":\"取消\",\"confirmButtonText\":\"确定\",\"hasCancelBtn\":true,\"primaryKeyPolicy\":1,\"hasPrintBtn\":false,\"concurrencyLock\":false,\"classJson\":\"\",\"drawerWidth\":\"600px\",\"confirmButtonTextI18nCode\":\"common.okText\",\"printButtonText\":\"打印\",\"formRef\":\"formRef\",\"gutter\":15,\"logicalDelete\":false,\"size\":\"middle\",\"formRules\":\"rules\",\"generalWidth\":\"1000px\",\"colon\":false,\"hasConfirmBtn\":true,\"formStyle\":\"\",\"printButtonTextI18nCode\":\"common.printText\",\"fields\":[{\"__config__\":{\"formId\":165,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"tab\",\"noShow\":false,\"dragDisabled\":false,\"active\":\"1\",\"className\":[],\"label\":\"标签面板\",\"showLabel\":false,\"renderKey\":1728522357849,\"tableName\":\"make_train_test_paper_library\",\"layout\":\"rowFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-label\",\"children\":[{\"__config__\":{\"formId\":166,\"children\":[{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":101,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"试卷名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728440990975,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_full_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入试卷名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441006127,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":102,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"试题分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"multiple\":false,\"__vModel__\":\"f_sort\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择试题分类\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"}},{\"clearable\":true,\"__config__\":{\"formId\":192,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"usersSelect\",\"defaultValue\":\"\",\"noShow\":true,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"考试人员\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730801443391,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasUsersSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"ableIds\":[],\"multiple\":false,\"__vModel__\":\"f_examiners\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"placeholder\":\"请选择\"},{\"__config__\":{\"formId\":194,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"inputNumber\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"考试成绩\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730801980329,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"controls\":false,\"__vModel__\":\"f_result_score\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"placeholder\":\"请输入\",\"thousands\":false,\"isAmountChinese\":false,\"addonBefore\":\"\",\"addonAfter\":\"\"},{\"__config__\":{\"formId\":196,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"inputNumber\",\"noShow\":true,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"总分数\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730861767471,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"controls\":false,\"__vModel__\":\"f_mark\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"placeholder\":\"请输入\",\"thousands\":false,\"isAmountChinese\":false,\"addonBefore\":\"\",\"addonAfter\":\"\"},{\"__config__\":{\"formId\":197,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"inputNumber\",\"noShow\":true,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"总题数\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730861771690,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"controls\":false,\"__vModel__\":\"f_question_num\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"placeholder\":\"请输入\",\"thousands\":false,\"isAmountChinese\":false,\"addonBefore\":\"\",\"addonAfter\":\"\"},{\"__config__\":{\"formId\":200,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"inputNumber\",\"noShow\":true,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"每题分数\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730861837728,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"controls\":false,\"__vModel__\":\"f_per_question\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"placeholder\":\"请输入\",\"thousands\":false,\"isAmountChinese\":false,\"addonBefore\":\"\",\"addonAfter\":\"\"},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730861812388,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":199,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":true,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"是否存在问答题\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"options\":[{\"fullName\":\"不存在\",\"id\":\"不存在\"},{\"fullName\":\"存在\",\"id\":\"存在\"}],\"multiple\":false,\"__vModel__\":\"f_question_flag\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"}},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730861802965,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":198,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":true,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"阅卷状态\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"options\":[{\"fullName\":\"未完成\",\"id\":\"未完成\"},{\"fullName\":\"已完成\",\"id\":\"已完成\"}],\"multiple\":false,\"__vModel__\":\"f_question_status\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"}},{\"showSummary\":false,\"__config__\":{\"formId\":103,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"table\",\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"单选题\",\"showLabel\":false,\"tableName\":\"make_train_library_single\",\"renderKey\":1728441037497,\"layout\":\"rowFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-table\",\"children\":[{\"filterable\":false,\"clearable\":true,\"__config__\":{\"relationTable\":\"make_train_library_single\",\"defaultValue\":\"\",\"parentVModel\":\"tableField103\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441098390,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":105,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"multiple\":false,\"__vModel__\":\"f_difficulty\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请选择题目难度\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"}},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"relationTable\":\"make_train_library_single\",\"defaultValue\":[],\"parentVModel\":\"tableField103\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728442522193,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":125,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"multiple\":false,\"__vModel__\":\"f_sort\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请选择分类\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"}},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":104,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441048947,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_full_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请输入题目名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":107,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441191118,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_analyze\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请输入解析\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":108,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441208447,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_answer\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":162,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444695088,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_topic_type\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":121,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项A\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441931352,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_a\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":122,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项B\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441943944,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_b\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":123,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项C\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441946965,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_c\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":124,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项D\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441947535,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_d\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"formId\":130,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728443972724,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_organize_id\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"\",\"type\":\"currOrganize\",\"showLevel\":\"last\"},{\"__config__\":{\"formId\":129,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728443972064,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_time\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":128,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728443971712,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_user_id\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":127,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728443971233,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_time\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"\",\"type\":\"currTime\"},{\"__config__\":{\"formId\":126,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728443970860,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_user_id\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"\",\"type\":\"currUser\"}],\"showTitle\":true,\"complexHeaderList\":[],\"tag\":\"YunzhupaasInputTable\",\"componentName\":\"table103\",\"tableAlign\":\"left\",\"span\":24},\"defaultValue\":[],\"footerBtnsList\":[{\"btnIcon\":\"icon-ym icon-ym-btn-add\",\"show\":false,\"label\":\"添加\",\"btnType\":\"primary\",\"value\":\"add\",\"labelI18nCode\":\"common.add1Text\"},{\"btnIcon\":\"icon-ym icon-ym-btn-clearn\",\"showConfirm\":true,\"show\":true,\"label\":\"批量删除\",\"btnType\":\"danger\",\"value\":\"batchRemove\",\"labelI18nCode\":\"common.batchDelText\"},{\"btnIcon\":\"icon-ym icon-ym-btn-add\",\"actionConfig\":{\"popupType\":\"dialog\",\"hasPage\":true,\"modelId\":\"613648638182162565\",\"popupTitle\":\"选择数据\",\"pageSize\":20,\"columnOptions\":[{\"label\":\"题目难度\",\"ifShow\":true,\"value\":\"f_difficulty\"},{\"label\":\"分类\",\"ifShow\":true,\"value\":\"f_sort\"},{\"label\":\"题目名称\",\"ifShow\":true,\"value\":\"f_full_name\"},{\"label\":\"选项A\",\"ifShow\":true,\"value\":\"f_options_a\"},{\"label\":\"选项B\",\"ifShow\":true,\"value\":\"f_options_b\"},{\"label\":\"选项C\",\"ifShow\":true,\"value\":\"f_options_c\"},{\"label\":\"选项D\",\"ifShow\":true,\"value\":\"f_options_d\"},{\"label\":\"解析\",\"ifShow\":true,\"value\":\"f_analyze\"},{\"label\":\"答案\",\"ifShow\":true,\"value\":\"f_answer\"},{\"label\":\"题目类型\",\"ifShow\":true,\"value\":\"f_topic_type\"}],\"interfaceId\":\"\",\"interfaceName\":\"\",\"relationOptions\":[{\"field\":\"f_difficulty\",\"type\":1,\"value\":\"f_difficulty\"},{\"field\":\"f_sort\",\"type\":1,\"value\":\"f_sort\"},{\"field\":\"f_full_name\",\"type\":1,\"value\":\"f_full_name\"},{\"field\":\"f_analyze\",\"type\":1,\"value\":\"f_analyze\"},{\"field\":\"f_topic_type\",\"type\":1,\"value\":\"f_topic_type\"},{\"field\":\"f_options_a\",\"type\":1,\"value\":\"f_options_a\"},{\"field\":\"f_options_b\",\"type\":1,\"value\":\"f_options_b\"},{\"field\":\"f_options_c\",\"type\":1,\"value\":\"f_options_c\"},{\"field\":\"f_options_d\",\"type\":1,\"value\":\"f_options_d\"},{\"field\":\"f_answer\",\"type\":1,\"value\":\"f_answer\"}],\"dataSource\":\"relationForm\",\"templateJson\":[],\"popupWidth\":\"800px\"},\"show\":true,\"label\":\"添加单选题\",\"btnType\":\"primary\",\"value\":\"custom4d8619\",\"labelI18nCode\":\"\"}],\"defaultExpandAll\":true,\"__vModel__\":\"tableField103\",\"layoutType\":\"table\",\"disabled\":false,\"columnBtnsList\":[{\"btnIcon\":\"icon-ym icon-ym-btn-edit\",\"show\":true,\"label\":\"复制\",\"btnType\":\"primary\",\"value\":\"copy\",\"labelI18nCode\":\"common.copyText\"},{\"btnIcon\":\"icon-ym icon-ym-btn-clearn\",\"showConfirm\":true,\"show\":true,\"label\":\"删除\",\"btnType\":\"danger\",\"value\":\"remove\",\"labelI18nCode\":\"common.delText\"}],\"summaryField\":[]},{\"showSummary\":false,\"__config__\":{\"formId\":131,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"table\",\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"多选题\",\"showLabel\":false,\"tableName\":\"make_train_library_more\",\"renderKey\":1728444025497,\"layout\":\"rowFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-table\",\"children\":[{\"filterable\":false,\"clearable\":true,\"__config__\":{\"relationTable\":\"make_train_library_more\",\"defaultValue\":\"\",\"parentVModel\":\"tableField131\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":132,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"multiple\":false,\"__vModel__\":\"f_difficulty\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请选择题目难度\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"}},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"relationTable\":\"make_train_library_more\",\"defaultValue\":[],\"parentVModel\":\"tableField131\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":133,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"multiple\":false,\"__vModel__\":\"f_sort\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请选择分类\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"}},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":134,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_full_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请输入题目名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":135,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_analyze\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请输入解析\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":136,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_answer\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":163,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444726177,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_topic_type\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":137,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项A\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_a\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":138,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项B\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_b\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":139,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项C\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_c\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":140,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项D\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_d\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"formId\":141,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_organize_id\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"\",\"type\":\"currOrganize\",\"showLevel\":\"last\"},{\"__config__\":{\"formId\":142,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_time\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":143,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_user_id\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":144,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_time\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"\",\"type\":\"currTime\"},{\"__config__\":{\"formId\":145,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_user_id\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"\",\"type\":\"currUser\"}],\"showTitle\":true,\"complexHeaderList\":[],\"tag\":\"YunzhupaasInputTable\",\"componentName\":\"table131\",\"tableAlign\":\"left\",\"span\":24},\"defaultValue\":[],\"footerBtnsList\":[{\"btnIcon\":\"icon-ym icon-ym-btn-add\",\"show\":false,\"label\":\"添加\",\"btnType\":\"primary\",\"value\":\"add\",\"labelI18nCode\":\"common.add1Text\"},{\"btnIcon\":\"icon-ym icon-ym-btn-clearn\",\"showConfirm\":true,\"show\":true,\"label\":\"批量删除\",\"btnType\":\"danger\",\"value\":\"batchRemove\",\"labelI18nCode\":\"common.batchDelText\"},{\"btnIcon\":\"icon-ym icon-ym-btn-add\",\"actionConfig\":{\"popupType\":\"dialog\",\"hasPage\":true,\"modelId\":\"613655652367073413\",\"popupTitle\":\"选择数据\",\"pageSize\":20,\"columnOptions\":[{\"label\":\"题目难度\",\"ifShow\":true,\"value\":\"f_difficulty\"},{\"label\":\"题目名称\",\"ifShow\":true,\"value\":\"f_full_name\"},{\"label\":\"解析\",\"ifShow\":true,\"value\":\"f_analyze\"},{\"label\":\"答案\",\"ifShow\":true,\"value\":\"f_answer\"},{\"label\":\"题目类型\",\"ifShow\":true,\"value\":\"f_topic_type\"},{\"label\":\"分类\",\"ifShow\":true,\"value\":\"f_sort\"}],\"interfaceId\":\"\",\"interfaceName\":\"\",\"relationOptions\":[{\"field\":\"f_difficulty\",\"type\":1,\"value\":\"f_difficulty\"},{\"field\":\"f_sort\",\"type\":1,\"value\":\"f_sort\"},{\"field\":\"f_full_name\",\"type\":1,\"value\":\"f_full_name\"},{\"field\":\"f_analyze\",\"type\":1,\"value\":\"f_analyze\"},{\"field\":\"f_topic_type\",\"type\":1,\"value\":\"f_topic_type\"},{\"field\":\"f_options_a\",\"type\":1,\"value\":\"f_options_a\"},{\"field\":\"f_options_b\",\"type\":1,\"value\":\"f_options_b\"},{\"field\":\"f_options_c\",\"type\":1,\"value\":\"f_options_c\"},{\"field\":\"f_options_d\",\"type\":1,\"value\":\"f_options_d\"},{\"field\":\"f_answer\",\"type\":1,\"value\":\"f_answer\"}],\"dataSource\":\"relationForm\",\"templateJson\":[],\"popupWidth\":\"800px\"},\"show\":true,\"label\":\"添加多选题\",\"btnType\":\"primary\",\"value\":\"custom4d8619\",\"labelI18nCode\":\"\"}],\"defaultExpandAll\":true,\"__vModel__\":\"tableField131\",\"layoutType\":\"table\",\"disabled\":false,\"columnBtnsList\":[{\"btnIcon\":\"icon-ym icon-ym-btn-edit\",\"show\":true,\"label\":\"复制\",\"btnType\":\"primary\",\"value\":\"copy\",\"labelI18nCode\":\"common.copyText\"},{\"btnIcon\":\"icon-ym icon-ym-btn-clearn\",\"showConfirm\":true,\"show\":true,\"label\":\"删除\",\"btnType\":\"danger\",\"value\":\"remove\",\"labelI18nCode\":\"common.delText\"}],\"summaryField\":[]},{\"showSummary\":false,\"__config__\":{\"formId\":147,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"table\",\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"判断题\",\"showLabel\":false,\"tableName\":\"make_train_library_judgment\",\"renderKey\":1728444151701,\"layout\":\"rowFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-table\",\"children\":[{\"filterable\":false,\"clearable\":true,\"__config__\":{\"relationTable\":\"make_train_library_judgment\",\"defaultValue\":\"\",\"parentVModel\":\"tableField147\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":148,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"multiple\":false,\"__vModel__\":\"f_difficulty\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请选择题目难度\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"}},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"relationTable\":\"make_train_library_judgment\",\"defaultValue\":[],\"parentVModel\":\"tableField147\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":149,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"multiple\":false,\"__vModel__\":\"f_sort\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请选择分类\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"}},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":150,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_full_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请输入题目名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":151,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_analyze\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请输入解析\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":152,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_answer\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":164,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444750002,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_topic_type\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"formId\":157,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_organize_id\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"\",\"type\":\"currOrganize\",\"showLevel\":\"last\"},{\"__config__\":{\"formId\":158,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_time\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":159,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_user_id\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":160,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_time\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"\",\"type\":\"currTime\"},{\"__config__\":{\"formId\":161,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_user_id\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"\",\"type\":\"currUser\"}],\"showTitle\":true,\"complexHeaderList\":[],\"tag\":\"YunzhupaasInputTable\",\"componentName\":\"table147\",\"tableAlign\":\"left\",\"span\":24},\"defaultValue\":[],\"footerBtnsList\":[{\"btnIcon\":\"icon-ym icon-ym-btn-add\",\"show\":false,\"label\":\"添加\",\"btnType\":\"primary\",\"value\":\"add\",\"labelI18nCode\":\"common.add1Text\"},{\"btnIcon\":\"icon-ym icon-ym-btn-clearn\",\"showConfirm\":true,\"show\":true,\"label\":\"批量删除\",\"btnType\":\"danger\",\"value\":\"batchRemove\",\"labelI18nCode\":\"common.batchDelText\"},{\"btnIcon\":\"icon-ym icon-ym-btn-add\",\"actionConfig\":{\"popupType\":\"dialog\",\"hasPage\":true,\"modelId\":\"613656070291718277\",\"popupTitle\":\"选择数据\",\"pageSize\":20,\"columnOptions\":[{\"label\":\"题目难度\",\"ifShow\":true,\"value\":\"f_difficulty\"},{\"label\":\"题目名称\",\"ifShow\":true,\"value\":\"f_full_name\"},{\"label\":\"解析\",\"ifShow\":true,\"value\":\"f_analyze\"},{\"label\":\"答案\",\"ifShow\":true,\"value\":\"f_answer\"},{\"label\":\"题目类型\",\"ifShow\":true,\"value\":\"f_topic_type\"},{\"label\":\"分类\",\"ifShow\":true,\"value\":\"f_sort\"}],\"interfaceId\":\"\",\"interfaceName\":\"\",\"relationOptions\":[{\"field\":\"f_difficulty\",\"type\":1,\"value\":\"f_difficulty\"},{\"field\":\"f_sort\",\"type\":1,\"value\":\"f_sort\"},{\"field\":\"f_full_name\",\"type\":1,\"value\":\"f_full_name\"},{\"field\":\"f_analyze\",\"type\":1,\"value\":\"f_analyze\"},{\"field\":\"f_topic_type\",\"type\":1,\"value\":\"f_topic_type\"},{\"field\":\"f_answer\",\"type\":1,\"value\":\"f_answer\"}],\"dataSource\":\"relationForm\",\"templateJson\":[],\"popupWidth\":\"800px\"},\"show\":true,\"label\":\"添加判断题\",\"btnType\":\"primary\",\"value\":\"custom4d8619\",\"labelI18nCode\":\"\"}],\"defaultExpandAll\":true,\"__vModel__\":\"tableField147\",\"layoutType\":\"table\",\"disabled\":false,\"columnBtnsList\":[{\"btnIcon\":\"icon-ym icon-ym-btn-edit\",\"show\":true,\"label\":\"复制\",\"btnType\":\"primary\",\"value\":\"copy\",\"labelI18nCode\":\"common.copyText\"},{\"btnIcon\":\"icon-ym icon-ym-btn-clearn\",\"showConfirm\":true,\"show\":true,\"label\":\"删除\",\"btnType\":\"danger\",\"value\":\"remove\",\"labelI18nCode\":\"common.delText\"}],\"summaryField\":[]},{\"showSummary\":false,\"__config__\":{\"formId\":180,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"table\",\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"问答题\",\"showLabel\":false,\"tableName\":\"make_train_library_essay_question\",\"renderKey\":1729132800868,\"layout\":\"rowFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-table\",\"children\":[{\"filterable\":false,\"clearable\":true,\"__config__\":{\"relationTable\":\"make_train_library_essay_question\",\"defaultValue\":\"\",\"parentVModel\":\"tableField180\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":181,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"multiple\":false,\"__vModel__\":\"f_difficulty\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请选择题目难度\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"}},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"relationTable\":\"make_train_library_essay_question\",\"defaultValue\":[],\"parentVModel\":\"tableField180\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":182,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"multiple\":false,\"__vModel__\":\"f_sort\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请选择分类\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"}},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":183,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_full_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请输入题目名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":184,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_analyze\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请输入解析\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":185,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_answer\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":186,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_topic_type\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"formId\":187,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_organize_id\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"\",\"type\":\"currOrganize\",\"showLevel\":\"last\"},{\"__config__\":{\"formId\":188,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_time\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":189,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormIt"); + sb.append( + "em\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_user_id\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":190,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_time\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"\",\"type\":\"currTime\"},{\"__config__\":{\"formId\":191,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_user_id\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"\",\"type\":\"currUser\"}],\"showTitle\":true,\"complexHeaderList\":[],\"tag\":\"YunzhupaasInputTable\",\"componentName\":\"table180\",\"tableAlign\":\"left\",\"span\":24},\"defaultValue\":[],\"footerBtnsList\":[{\"btnIcon\":\"icon-ym icon-ym-btn-add\",\"show\":false,\"label\":\"添加\",\"btnType\":\"primary\",\"value\":\"add\",\"labelI18nCode\":\"common.add1Text\"},{\"btnIcon\":\"icon-ym icon-ym-btn-clearn\",\"showConfirm\":true,\"show\":true,\"label\":\"批量删除\",\"btnType\":\"danger\",\"value\":\"batchRemove\",\"labelI18nCode\":\"common.batchDelText\"},{\"btnIcon\":\"icon-ym icon-ym-btn-add\",\"actionConfig\":{\"popupType\":\"dialog\",\"hasPage\":true,\"modelId\":\"616541963855855749\",\"popupTitle\":\"选择数据\",\"pageSize\":20,\"columnOptions\":[{\"label\":\"题目难度\",\"ifShow\":true,\"value\":\"f_difficulty\"},{\"label\":\"题目名称\",\"ifShow\":true,\"value\":\"f_full_name\"},{\"label\":\"题目类型\",\"ifShow\":true,\"value\":\"f_topic_type\"},{\"label\":\"分类\",\"ifShow\":true,\"value\":\"f_sort\"}],\"interfaceId\":\"\",\"interfaceName\":\"\",\"relationOptions\":[{\"field\":\"f_difficulty\",\"type\":1,\"value\":\"f_difficulty\"},{\"field\":\"f_sort\",\"type\":1,\"value\":\"f_sort\"},{\"field\":\"f_full_name\",\"type\":1,\"value\":\"f_full_name\"},{\"field\":\"f_analyze\",\"type\":1,\"value\":\"f_analyze\"},{\"field\":\"f_topic_type\",\"type\":1,\"value\":\"f_topic_type\"},{\"field\":\"f_answer\",\"type\":1,\"value\":\"f_answer\"}],\"dataSource\":\"relationForm\",\"templateJson\":[],\"popupWidth\":\"800px\"},\"show\":true,\"label\":\"添加问答题\",\"btnType\":\"primary\",\"value\":\"custom4d8619\",\"labelI18nCode\":\"\"}],\"defaultExpandAll\":true,\"__vModel__\":\"tableField180\",\"layoutType\":\"table\",\"disabled\":false,\"columnBtnsList\":[{\"btnIcon\":\"icon-ym icon-ym-btn-edit\",\"show\":true,\"label\":\"复制\",\"btnType\":\"primary\",\"value\":\"copy\",\"labelI18nCode\":\"common.copyText\"},{\"btnIcon\":\"icon-ym icon-ym-btn-clearn\",\"showConfirm\":true,\"show\":true,\"label\":\"删除\",\"btnType\":\"danger\",\"value\":\"remove\",\"labelI18nCode\":\"common.delText\"}],\"summaryField\":[]}],\"yunzhupaasKey\":\"tabItem\",\"renderKey\":1728522357849},\"name\":\"1\",\"title\":\"考试信息\"}],\"tag\":\"ATab\",\"componentName\":\"tab165\",\"span\":24},\"tabPosition\":\"top\",\"type\":\"card\"},{\"__config__\":{\"formId\":174,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728522993760,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_user_id\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"\",\"type\":\"currUser\"},{\"__config__\":{\"formId\":175,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"完成时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728522994736,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_time\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"\",\"type\":\"currTime\"},{\"__config__\":{\"formId\":176,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728522995275,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_user_id\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":179,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728523000852,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_time\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":177,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728522996206,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_organize_id\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"\",\"type\":\"currOrganize\",\"showLevel\":\"last\"},{\"clearable\":true,\"__config__\":{\"formId\":201,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"usersSelect\",\"noShow\":true,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"阅卷人\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1731396046780,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasUsersSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"ableIds\":[],\"multiple\":false,\"__vModel__\":\"f_examer\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"placeholder\":\"请选择\"}],\"span\":24}"); + return sb.toString(); + } + + /** 列表字段配置json */ + public static final String getColumnData() { + StringBuilder sb = new StringBuilder(); + sb.append( + "{\"showSummary\":false,\"treePropsValue\":\"id\",\"columnOptions\":[{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"试卷名称\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":101,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"试卷名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728440990975,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_full_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_full_name\",\"placeholder\":\"请输入试卷名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"试题分类\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441006127,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":102,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"试题分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"f_sort\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_sort\",\"placeholder\":\"请选择试题分类\"},{\"clearable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"考试人员\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"formId\":192,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"usersSelect\",\"defaultValue\":\"\",\"noShow\":true,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"考试人员\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730801443391,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasUsersSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"__vModel__\":\"f_examiners\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"f_examiners\",\"placeholder\":\"请选择\"},{\"controls\":false,\"fullName\":\"考试成绩\",\"fullNameI18nCode\":[\"\"],\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"\",\"__config__\":{\"formId\":194,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"inputNumber\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"考试成绩\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730801980329,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"__vModel__\":\"f_result_score\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"f_result_score\",\"placeholder\":\"请输入\",\"addonBefore\":\"\"},{\"controls\":false,\"fullName\":\"总分数\",\"fullNameI18nCode\":[\"\"],\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"\",\"__config__\":{\"formId\":196,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"inputNumber\",\"noShow\":true,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"总分数\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730861767471,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"__vModel__\":\"f_mark\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"f_mark\",\"placeholder\":\"请输入\",\"addonBefore\":\"\"},{\"controls\":false,\"fullName\":\"总题数\",\"fullNameI18nCode\":[\"\"],\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"\",\"__config__\":{\"formId\":197,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"inputNumber\",\"noShow\":true,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"总题数\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730861771690,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"__vModel__\":\"f_question_num\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"f_question_num\",\"placeholder\":\"请输入\",\"addonBefore\":\"\"},{\"controls\":false,\"fullName\":\"每题分数\",\"fullNameI18nCode\":[\"\"],\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"\",\"__config__\":{\"formId\":200,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"inputNumber\",\"noShow\":true,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"每题分数\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730861837728,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"__vModel__\":\"f_per_question\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"f_per_question\",\"placeholder\":\"请输入\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"是否存在问答题\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730861812388,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":199,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":true,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"是否存在问答题\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"options\":[{\"fullName\":\"不存在\",\"id\":\"不存在\"},{\"fullName\":\"存在\",\"id\":\"存在\"}],\"__vModel__\":\"f_question_flag\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_question_flag\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"阅卷状态\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730861802965,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":198,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":true,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"阅卷状态\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"options\":[{\"fullName\":\"未完成\",\"id\":\"未完成\"},{\"fullName\":\"已完成\",\"id\":\"已完成\"}],\"__vModel__\":\"f_question_status\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_question_status\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"单选题-题目难度\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_single\",\"defaultValue\":\"\",\"parentVModel\":\"tableField103\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441098390,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":105,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"f_difficulty\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField103-f_difficulty\",\"placeholder\":\"请选择题目难度\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"单选题-分类\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_single\",\"defaultValue\":[],\"parentVModel\":\"tableField103\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728442522193,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":125,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"__vModel__\":\"f_sort\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField103-f_sort\",\"placeholder\":\"请选择分类\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单选题-题目名称\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":104,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441048947,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_full_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField103-f_full_name\",\"placeholder\":\"请输入题目名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单选题-解析\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":107,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441191118,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_analyze\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField103-f_analyze\",\"placeholder\":\"请输入解析\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单选题-答案\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":108,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441208447,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_answer\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField103-f_answer\",\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单选题-题目类型\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":162,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444695088,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_topic_type\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField103-f_topic_type\",\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单选题-选项A\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":121,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项A\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441931352,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_a\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField103-f_options_a\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单选题-选项B\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":122,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项B\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441943944,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_b\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField103-f_options_b\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单选题-选项C\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":123,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项C\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441946965,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_c\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField103-f_options_c\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单选题-选项D\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":124,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项D\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441947535,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_d\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField103-f_options_d\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"formId\":130,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728443972724,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_organize_id\",\"fullName\":\"单选题-所属组织\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_organize_id\",\"placeholder\":\"\",\"type\":\"currOrganize\",\"showLevel\":\"last\"},{\"__config__\":{\"formId\":129,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728443972064,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_time\",\"fullName\":\"单选题-修改时间\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_last_modify_time\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":128,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728443971712,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_user_id\",\"fullName\":\"单选题-修改用户\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_last_modify_user_id\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":127,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728443971233,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_time\",\"fullName\":\"单选题-创建时间\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_creator_time\",\"placeholder\":\"\",\"type\":\"currTime\"},{\"__config__\":{\"formId\":126,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728443970860,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_user_id\",\"fullName\":\"单选题-创建用户\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_creator_user_id\",\"placeholder\":\"\",\"type\":\"currUser\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"多选题-题目难度\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_more\",\"defaultValue\":\"\",\"parentVModel\":\"tableField131\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":132,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"f_difficulty\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField131-f_difficulty\",\"placeholder\":\"请选择题目难度\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"多选题-分类\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_more\",\"defaultValue\":[],\"parentVModel\":\"tableField131\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":133,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"__vModel__\":\"f_sort\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField131-f_sort\",\"placeholder\":\"请选择分类\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"多选题-题目名称\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":134,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_full_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField131-f_full_name\",\"placeholder\":\"请输入题目名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"多选题-解析\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":135,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_analyze\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField131-f_analyze\",\"placeholder\":\"请输入解析\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"多选题-答案\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":136,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_answer\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField131-f_answer\",\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"多选题-题目类型\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":163,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444726177,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_topic_type\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField131-f_topic_type\",\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"多选题-选项A\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":137,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项A\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_a\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField131-f_options_a\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"多选题-选项B\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":138,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项B\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_b\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField131-f_options_b\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"多选题-选项C\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":139,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项C\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_c\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField131-f_options_c\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"多选题-选项D\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":140,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项D\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_d\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField131-f_options_d\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"formId\":141,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_organize_id\",\"fullName\":\"多选题-所属组织\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_organize_id\",\"placeholder\":\"\",\"type\":\"currOrganize\",\"showLevel\":\"last\"},{\"__config__\":{\"formId\":142,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_time\",\"fullName\":\"多选题-修改时间\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_last_modify_time\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":143,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_user_id\",\"fullName\":\"多选题-修改用户\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_last_modify_user_id\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":144,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_time\",\"fullName\":\"多选题-创建时间\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_creator_time\",\"placeholder\":\"\",\"type\":\"currTime\"},{\"__config__\":{\"formId\":145,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_user_id\",\"fullName\":\"多选题-创建用户\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_creator_user_id\",\"placeholder\":\"\",\"type\":\"currUser\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"判断题-题目难度\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_judgment\",\"defaultValue\":\"\",\"parentVModel\":\"tableField147\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":148,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"f_difficulty\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField147-f_difficulty\",\"placeholder\":\"请选择题目难度\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"判断题-分类\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_judgment\",\"defaultValue\":[],\"parentVModel\":\"tableField147\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":149,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"__vModel__\":\"f_sort\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField147-f_sort\",\"placeholder\":\"请选择分类\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"判断题-题目名称\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":150,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_full_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField147-f_full_name\",\"placeholder\":\"请输入题目名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"判断题-解析\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":151,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_analyze\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField147-f_analyze\",\"placeholder\":\"请输入解析\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"判断题-答案\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":152,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_answer\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField147-f_answer\",\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"判断题-题目类型\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":164,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444750002,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_topic_type\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField147-f_topic_type\",\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"formId\":157,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_organize_id\",\"fullName\":\"判断题-所属组织\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_organize_id\",\"placeholder\":\"\",\"type\":\"currOrganize\",\"showLevel\":\"last\"},{\"__config__\":{\"formId\":158,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_time\",\"fullName\":\"判断题-修改时间\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_last_modify_time\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":159,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_user_id\",\"fullName\":\"判断题-修改用户\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_last_modify_user_id\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":160,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_time\",\"fullName\":\"判断题-创建时间\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_creator_time\",\"placeholder\":\"\",\"type\":\"currTime\"},{\"__config__\":{\"formId\":161,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_user_id\",\"fullName\":\"判断题-创建用户\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_creator_user_id\",\"placeholder\":\"\",\"type\":\"currUser\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"问答题-题目难度\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_essay_question\",\"defaultValue\":\"\",\"parentVModel\":\"tableField180\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":181,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"f_difficulty\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField180-f_difficulty\",\"placeholder\":\"请选择题目难度\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"问答题-分类\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_essay_question\",\"defaultValue\":[],\"parentVModel\":\"tableField180\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":182,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"__vModel__\":\"f_sort\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField180-f_sort\",\"placeholder\":\"请选择分类\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"问答题-题目名称\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":183,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_full_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField180-f_full_name\",\"placeholder\":\"请输入题目名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"问答题-解析\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":184,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_analyze\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField180-f_analyze\",\"placeholder\":\"请输入解析\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"问答题-答案\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":185,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_answer\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField180-f_answer\",\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"问答题-题目类型\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":186,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_topic_type\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField180-f_topic_type\",\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"formId\":187,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_organize_id\",\"fullName\":\"问答题-所属组织\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_organize_id\",\"placeholder\":\"\",\"type\":\"currOrganize\",\"showLevel\":\"last\"},{\"__config__\":{\"formId\":188,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_time\",\"fullName\":\"问答题-修改时间\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_last_modify_time\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":189,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_user_id\",\"fullName\":\"问答题-修改用户\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_last_modify_user_id\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":190,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_time\",\"fullName\":\"问答题-创建时间\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_creator_time\",\"placeholder\":\"\",\"type\":\"currTime\"},{\"__config__\":{\"formId\":191,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_user_id\",\"fullName\":\"问答题-创建用户\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_creator_user_id\",\"placeholder\":\"\",\"type\":\"currUser\"},{\"__config__\":{\"formId\":174,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728522993760,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_user_id\",\"fullName\":\"创建用户\",\"fullNameI18nCode\":[\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"f_creator_user_id\",\"placeholder\":\"\",\"type\":\"currUser\"},{\"__config__\":{\"formId\":175,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"完成时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728522994736,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_time\",\"fullName\":\"完成时间\",\"fullNameI18nCode\":[\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"f_creator_time\",\"placeholder\":\"\",\"type\":\"currTime\"},{\"__config__\":{\"formId\":176,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728522995275,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_user_id\",\"fullName\":\"修改用户\",\"fullNameI18nCode\":[\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"f_last_modify_user_id\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":179,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728523000852,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_time\",\"fullName\":\"修改时间\",\"fullNameI18nCode\":[\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"f_last_modify_time\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":177,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":"); + sb.append( + "true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728522996206,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_organize_id\",\"fullName\":\"所属组织\",\"fullNameI18nCode\":[\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"f_organize_id\",\"placeholder\":\"\",\"type\":\"currOrganize\",\"showLevel\":\"last\"},{\"clearable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"阅卷人\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"formId\":201,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"usersSelect\",\"noShow\":true,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"阅卷人\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1731396046780,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasUsersSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"__vModel__\":\"f_examer\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"f_examer\",\"placeholder\":\"请选择\"}],\"pageSize\":20,\"type\":1,\"columnBtnsList\":[{\"show\":false,\"icon\":\"icon-ym icon-ym-btn-edit\",\"label\":\"发布考试\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"edit\",\"labelI18nCode\":\"fbks\"},{\"show\":false,\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"删除\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"remove\",\"labelI18nCode\":\"common.delText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-generator-menu\",\"label\":\"详情\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"detail\",\"labelI18nCode\":\"common.detailText\"}],\"treeTitle\":\"左侧标题\",\"defaultColumnList\":[{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":101,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"试卷名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728440990975,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"f_full_name\",\"__vModel__\":\"f_full_name\",\"checked\":true,\"disabled\":false,\"id\":\"f_full_name\",\"placeholder\":\"请输入试卷名称\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"试卷名称\",\"label\":\"试卷名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"select\",\"multiple\":false,\"fullName\":\"试题分类\",\"fullNameI18nCode\":[\"\"],\"label\":\"试题分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441006127,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":102,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"试题分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"f_sort\",\"__vModel__\":\"f_sort\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_sort\",\"placeholder\":\"请选择试题分类\",\"labelI18nCode\":\"\"},{\"clearable\":true,\"yunzhupaasKey\":\"usersSelect\",\"ableIds\":[],\"multiple\":false,\"fullName\":\"考试人员\",\"fullNameI18nCode\":[\"\"],\"label\":\"考试人员\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":192,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"usersSelect\",\"defaultValue\":\"\",\"noShow\":true,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"考试人员\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730801443391,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasUsersSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"f_examiners\",\"__vModel__\":\"f_examiners\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"f_examiners\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"controls\":false,\"yunzhupaasKey\":\"inputNumber\",\"fullName\":\"考试成绩\",\"fullNameI18nCode\":[\"\"],\"label\":\"考试成绩\",\"sortable\":false,\"align\":\"left\",\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"\",\"__config__\":{\"formId\":194,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"inputNumber\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"考试成绩\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730801980329,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"f_result_score\",\"__vModel__\":\"f_result_score\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"f_result_score\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"labelI18nCode\":\"\"},{\"controls\":false,\"yunzhupaasKey\":\"inputNumber\",\"fullName\":\"总分数\",\"fullNameI18nCode\":[\"\"],\"label\":\"总分数\",\"sortable\":false,\"align\":\"left\",\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"\",\"__config__\":{\"formId\":196,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"inputNumber\",\"noShow\":true,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"总分数\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730861767471,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"f_mark\",\"__vModel__\":\"f_mark\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"f_mark\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"labelI18nCode\":\"\"},{\"controls\":false,\"yunzhupaasKey\":\"inputNumber\",\"fullName\":\"总题数\",\"fullNameI18nCode\":[\"\"],\"label\":\"总题数\",\"sortable\":false,\"align\":\"left\",\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"\",\"__config__\":{\"formId\":197,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"inputNumber\",\"noShow\":true,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"总题数\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730861771690,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"f_question_num\",\"__vModel__\":\"f_question_num\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"f_question_num\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"labelI18nCode\":\"\"},{\"controls\":false,\"yunzhupaasKey\":\"inputNumber\",\"fullName\":\"每题分数\",\"fullNameI18nCode\":[\"\"],\"label\":\"每题分数\",\"sortable\":false,\"align\":\"left\",\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"\",\"__config__\":{\"formId\":200,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"inputNumber\",\"noShow\":true,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"每题分数\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730861837728,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"f_per_question\",\"__vModel__\":\"f_per_question\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"f_per_question\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"select\",\"multiple\":false,\"fullName\":\"是否存在问答题\",\"fullNameI18nCode\":[\"\"],\"label\":\"是否存在问答题\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730861812388,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":199,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":true,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"是否存在问答题\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"f_question_flag\",\"options\":[{\"fullName\":\"不存在\",\"id\":\"不存在\"},{\"fullName\":\"存在\",\"id\":\"存在\"}],\"__vModel__\":\"f_question_flag\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_question_flag\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"select\",\"multiple\":false,\"fullName\":\"阅卷状态\",\"fullNameI18nCode\":[\"\"],\"label\":\"阅卷状态\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730861802965,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":198,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":true,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"阅卷状态\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"f_question_status\",\"options\":[{\"fullName\":\"未完成\",\"id\":\"未完成\"},{\"fullName\":\"已完成\",\"id\":\"已完成\"}],\"__vModel__\":\"f_question_status\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_question_status\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"select\",\"multiple\":false,\"fullName\":\"单选题-题目难度\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"单选题-题目难度\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_single\",\"defaultValue\":\"\",\"parentVModel\":\"tableField103\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441098390,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":105,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"tableField103-f_difficulty\",\"__vModel__\":\"f_difficulty\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField103-f_difficulty\",\"placeholder\":\"请选择题目难度\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"cascader\",\"multiple\":false,\"fullName\":\"单选题-分类\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"单选题-分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_single\",\"defaultValue\":[],\"parentVModel\":\"tableField103\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728442522193,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":125,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"tableField103-f_sort\",\"__vModel__\":\"f_sort\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField103-f_sort\",\"placeholder\":\"请选择分类\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":104,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441048947,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField103-f_full_name\",\"__vModel__\":\"f_full_name\",\"checked\":false,\"disabled\":true,\"id\":\"tableField103-f_full_name\",\"placeholder\":\"请输入题目名称\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"单选题-题目名称\",\"label\":\"单选题-题目名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":107,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441191118,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField103-f_analyze\",\"__vModel__\":\"f_analyze\",\"checked\":false,\"disabled\":true,\"id\":\"tableField103-f_analyze\",\"placeholder\":\"请输入解析\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"单选题-解析\",\"label\":\"单选题-解析\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":108,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441208447,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField103-f_answer\",\"__vModel__\":\"f_answer\",\"checked\":false,\"disabled\":true,\"id\":\"tableField103-f_answer\",\"placeholder\":\"请输入题目类型\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"单选题-答案\",\"label\":\"单选题-答案\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":162,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444695088,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField103-f_topic_type\",\"__vModel__\":\"f_topic_type\",\"checked\":false,\"disabled\":true,\"id\":\"tableField103-f_topic_type\",\"placeholder\":\"请输入题目类型\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"单选题-题目类型\",\"label\":\"单选题-题目类型\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":121,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项A\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441931352,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField103-f_options_a\",\"__vModel__\":\"f_options_a\",\"checked\":false,\"disabled\":false,\"id\":\"tableField103-f_options_a\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"单选题-选项A\",\"label\":\"单选题-选项A\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":122,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项B\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441943944,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField103-f_options_b\",\"__vModel__\":\"f_options_b\",\"checked\":false,\"disabled\":false,\"id\":\"tableField103-f_options_b\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"单选题-选项B\",\"label\":\"单选题-选项B\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":123,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项C\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441946965,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField103-f_options_c\",\"__vModel__\":\"f_options_c\",\"checked\":false,\"disabled\":false,\"id\":\"tableField103-f_options_c\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"单选题-选项C\",\"label\":\"单选题-选项C\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":124,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项D\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441947535,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField103-f_options_d\",\"__vModel__\":\"f_options_d\",\"checked\":false,\"disabled\":false,\"id\":\"tableField103-f_options_d\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"单选题-选项D\",\"label\":\"单选题-选项D\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"currOrganize\",\"fullName\":\"单选题-所属组织\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"单选题-所属组织\",\"sortable\":false,\"align\":\"left\",\"type\":\"currOrganize\",\"__config__\":{\"formId\":130,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728443972724,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField103-f_organize_id\",\"__vModel__\":\"f_organize_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_organize_id\",\"placeholder\":\"\",\"showLevel\":\"last\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyTime\",\"fullName\":\"单选题-修改时间\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"单选题-修改时间\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":129,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728443972064,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField103-f_last_modify_time\",\"__vModel__\":\"f_last_modify_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_last_modify_time\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyUser\",\"fullName\":\"单选题-修改用户\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"单选题-修改用户\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":128,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728443971712,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField103-f_last_modify_user_id\",\"__vModel__\":\"f_last_modify_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_last_modify_user_id\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createTime\",\"fullName\":\"单选题-创建时间\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"单选题-创建时间\",\"sortable\":false,\"align\":\"left\",\"type\":\"currTime\",\"__config__\":{\"formId\":127,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728443971233,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField103-f_creator_time\",\"__vModel__\":\"f_creator_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_creator_time\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createUser\",\"fullName\":\"单选题-创建用户\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"单选题-创建用户\",\"sortable\":false,\"align\":\"left\",\"type\":\"currUser\",\"__config__\":{\"formId\":126,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728443970860,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField103-f_creator_user_id\",\"__vModel__\":\"f_creator_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_creator_user_id\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"select\",\"multiple\":false,\"fullName\":\"多选题-题目难度\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"多选题-题目难度\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_more\",\"defaultValue\":\"\",\"parentVModel\":\"tableField131\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":132,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"tableField131-f_difficulty\",\"__vModel__\":\"f_difficulty\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField131-f_difficulty\",\"placeholder\":\"请选择题目难度\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"cascader\",\"multiple\":false,\"fullName\":\"多选题-分类\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"多选题-分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_more\",\"defaultValue\":[],\"parentVModel\":\"tableField131\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":133,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"tableField131-f_sort\",\"__vModel__\":\"f_sort\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField131-f_sort\",\"placeholder\":\"请选择分类\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":134,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField131-f_full_name\",\"__vModel__\":\"f_full_name\",\"checked\":false,\"disabled\":true,\"id\":\"tableField131-f_full_name\",\"placeholder\":\"请输入题目名称\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"多选题-题目名称\",\"label\":\"多选题-题目名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":135,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField131-f_analyze\",\"__vModel__\":\"f_analyze\",\"checked\":false,\"disabled\":true,\"id\":\"tableField131-f_analyze\",\"placeholder\":\"请输入解析\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"多选题-解析\",\"label\":\"多选题-解析\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":136,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField131-f_answer\",\"__vModel__\":\"f_answer\",\"checked\":false,\"disabled\":true,\"id\":\"tableField131-f_answer\",\"placeholder\":\"请输入题目类型\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"多选题-答案\",\"label\":\"多选题-答案\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":163,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444726177,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField131-f_topic_type\",\"__vModel__\":\"f_topic_type\",\"checked\":false,\"disabled\":true,\"id\":\"tableField131-f_topic_type\",\"placeholder\":\"请输入题目类型\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"多选题-题目类型\",\"label\":\"多选题-题目类型\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":137,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项A\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField131-f_options_a\",\"__vModel__\":\"f_options_a\",\"checked\":false,\"disabled\":false,\"id\":\"tableField131-f_options_a\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"多选题-选项A\",\"label\":\"多选题-选项A\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":138,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项B\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField131-f_options_b\",\"__vModel__\":\"f_options_b\",\"checked\":false,\"disabled\":false,\"id\":\"tableField131-f_options_b\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"多选题-选项B\",\"label\":\"多选题-选项B\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":139,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项C\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField131-f_options_c\",\"__vModel__\":\"f_options_c\",\"checked\":false,\"disabled\":false,\"id\":\"tableField131-f_options_c\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"多选题-选项C\",\"label\":\"多选题-选项C\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":140,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项D\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField131-f_options_d\",\"__vModel__\":\"f_options_d\",\"checked\":false,\"disabled\":false,\"id\":\"tableField131-f_options_d\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"多选题-选项D\",\"label\":\"多选题-选项D\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"currOrganize\",\"fullName\":\"多选题-所属组织\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"多选题-所属组织\",\"sortable\":false,\"align\":\"left\",\"type\":\"currOrganize\",\"__config__\":{\"formId\":141,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField131-f_organize_id\",\"__vModel__\":\"f_organize_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_organize_id\",\"placeholder\":\"\",\"showLevel\":\"last\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyTime\",\"fullName\":\"多选题-修改时间\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"多选题-修改时间\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":142,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField131-f_last_modify_time\",\"__vModel__\":\"f_last_modify_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_last_modify_time\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyUser\",\"fullName\":\"多选题-修改用户\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"多选题-修改用户\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":143,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField131-f_last_modify_user_id\",\"__vModel__\":\"f_last_modify_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_last_modify_user_id\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createTime\",\"fullName\":\"多选题-创建时间\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"多选题-创建时间\",\"sortable\":false,\"align\":\"left\",\"type\":\"currTime\",\"__config__\":{\"formId\":144,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField131-f_creator_time\",\"__vModel__\":\"f_creator_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_creator_time\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createUser\",\"fullName\":\"多选题-创建用户\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"多选题-创建用户\",\"sortable\":false,\"align\":\"left\",\"type\":\"currUser\",\"__config__\":{\"formId\":145,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField131-f_creator_user_id\",\"__vModel__\":\"f_creator_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_creator_user_id\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"select\",\"multiple\":false,\"fullName\":\"判断题-题目难度\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"判断题-题目难度\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_judgment\",\"defaultValue\":\"\",\"parentVModel\":\"tableField147\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":148,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"tableField147-f_difficulty\",\"__vModel__\":\"f_difficulty\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField147-f_difficulty\",\"placeholder\":\"请选择题目难度\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"cascader\",\"multiple\":false,\"fullName\":\"判断题-分类\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"判断题-分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_judgment\",\"defaultValue\":[],\"parentVModel\":\"tableField147\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":149,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"tableField147-f_sort\",\"__vModel__\":\"f_sort\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField147-f_sort\",\"placeholder\":\"请选择分类\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":150,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField147-f_full_name\",\"__vModel__\":\"f_full_name\",\"checked\":false,\"disabled\":true,\"id\":\"tableField147-f_full_name\",\"placeholder\":\"请输入题目名称\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"判断题-题目名称\",\"label\":\"判断题-题目名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":151,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField147-f_analyze\",\"__vModel__\":\"f_analyze\",\"checked\":false,\"disabled\":true,\"id\":\"tableField147-f_analyze\",\"placeholder\":\"请输入解析\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"判断题-解析\",\"label\":\"判断题-解析\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":152,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField147-f_answer\",\"__vModel__\":\"f_answer\",\"checked\":false,\"disabled\":true,\"id\":\"tableField147-f_answer\",\"placeholder\":\"请输入题目类型\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"判断题-答案\",\"label\":\"判断题-答案\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":164,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444750002,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField147-f_topic_type\",\"__vModel__\":\"f_topic_type\",\"checked\":false,\"disabled\":true,\"id\":\"tableField147-f_topic_type\",\"placeholder\":\"请输入题目类型\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"判断题-题目类型\",\"label\":\"判断题-题目类型\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"currOrganize\",\"fullName\":\"判断题-所属组织\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"判断题-所属组织\",\"sortable\":false,\"align\":\"left\",\"type\":\"currOrganize\",\"__config__\":{\"formId\":157,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField147-f_organize_id\",\"__vModel__\":\"f_organize_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_organize_id\",\"placeholder\":\"\",\"showLevel\":\"last\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyTime\",\"fullName\":\"判断题-修改时间\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"判断题-修改时间\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":158,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField147-f_last_modify_time\",\"__vModel__\":\"f_last_modify_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_last_modify_time\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyUser\",\"fullName\":\"判断题-修改用户\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"判断题-修改用户\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":159,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField147-f_last_modify_user_id\",\"__vModel__\":\"f_last_modify_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_last_modify_user_id\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createTime\",\"fullName\":\"判断题-创建时间\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"判断题-创建时间\",\"sortable\":false,\"align\":\"left\",\"type\":\"currTime\",\"__config__\":{\"formId\":160,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField147-f_creator_time\",\"__vModel__\":\"f_creator_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_creator_time\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createUser\",\"fullName\":\"判断题-创建用户\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"判断题-创建用户\",\"sortable\":false,\"align\":\"left\",\"type\":\"currUser\",\"__config__\":{\"formId\":161,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField147-f_creator_user_id\",\"__vModel__\":\"f_creator_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_creator_user_id\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"select\",\"multiple\":false,\"fullName\":\"问答题-题目难度\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"问答题-题目难度\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_essay_question\",\"defaultValue\":\"\",\"parentVModel\":\"tableField180\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":181,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"tableField180-f_difficulty\",\"__vModel__\":\"f_difficulty\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField180-f_difficulty\",\"placeholder\":\"请选择题目难度\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"cascader\",\"multiple\":false,\"fullName\":\"问答题-分类\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"问答题-分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_essay_question\",\"defaultValue\":[],\"parentVModel\":\"tableField180\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":182,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"tableField180-f_sort\",\"__vModel__\":\"f_sort\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField180-f_sort\",\"placeholder\":\"请选择分类\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":183,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":["); + sb.append( + "],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField180-f_full_name\",\"__vModel__\":\"f_full_name\",\"checked\":false,\"disabled\":true,\"id\":\"tableField180-f_full_name\",\"placeholder\":\"请输入题目名称\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"问答题-题目名称\",\"label\":\"问答题-题目名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":184,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField180-f_analyze\",\"__vModel__\":\"f_analyze\",\"checked\":false,\"disabled\":true,\"id\":\"tableField180-f_analyze\",\"placeholder\":\"请输入解析\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"问答题-解析\",\"label\":\"问答题-解析\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":185,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField180-f_answer\",\"__vModel__\":\"f_answer\",\"checked\":false,\"disabled\":true,\"id\":\"tableField180-f_answer\",\"placeholder\":\"请输入题目类型\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"问答题-答案\",\"label\":\"问答题-答案\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":186,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField180-f_topic_type\",\"__vModel__\":\"f_topic_type\",\"checked\":false,\"disabled\":true,\"id\":\"tableField180-f_topic_type\",\"placeholder\":\"请输入题目类型\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"问答题-题目类型\",\"label\":\"问答题-题目类型\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"currOrganize\",\"fullName\":\"问答题-所属组织\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"问答题-所属组织\",\"sortable\":false,\"align\":\"left\",\"type\":\"currOrganize\",\"__config__\":{\"formId\":187,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField180-f_organize_id\",\"__vModel__\":\"f_organize_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_organize_id\",\"placeholder\":\"\",\"showLevel\":\"last\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyTime\",\"fullName\":\"问答题-修改时间\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"问答题-修改时间\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":188,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField180-f_last_modify_time\",\"__vModel__\":\"f_last_modify_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_last_modify_time\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyUser\",\"fullName\":\"问答题-修改用户\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"问答题-修改用户\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":189,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField180-f_last_modify_user_id\",\"__vModel__\":\"f_last_modify_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_last_modify_user_id\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createTime\",\"fullName\":\"问答题-创建时间\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"问答题-创建时间\",\"sortable\":false,\"align\":\"left\",\"type\":\"currTime\",\"__config__\":{\"formId\":190,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField180-f_creator_time\",\"__vModel__\":\"f_creator_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_creator_time\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createUser\",\"fullName\":\"问答题-创建用户\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"问答题-创建用户\",\"sortable\":false,\"align\":\"left\",\"type\":\"currUser\",\"__config__\":{\"formId\":191,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField180-f_creator_user_id\",\"__vModel__\":\"f_creator_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_creator_user_id\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createUser\",\"fullName\":\"创建用户\",\"fullNameI18nCode\":[\"\"],\"label\":\"创建用户\",\"sortable\":false,\"align\":\"left\",\"type\":\"currUser\",\"__config__\":{\"formId\":174,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728522993760,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"f_creator_user_id\",\"__vModel__\":\"f_creator_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"f_creator_user_id\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createTime\",\"fullName\":\"完成时间\",\"fullNameI18nCode\":[\"\"],\"label\":\"完成时间\",\"sortable\":false,\"align\":\"left\",\"type\":\"currTime\",\"__config__\":{\"formId\":175,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"完成时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728522994736,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"f_creator_time\",\"__vModel__\":\"f_creator_time\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"f_creator_time\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyUser\",\"fullName\":\"修改用户\",\"fullNameI18nCode\":[\"\"],\"label\":\"修改用户\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":176,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728522995275,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"f_last_modify_user_id\",\"__vModel__\":\"f_last_modify_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"f_last_modify_user_id\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyTime\",\"fullName\":\"修改时间\",\"fullNameI18nCode\":[\"\"],\"label\":\"修改时间\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":179,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728523000852,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"f_last_modify_time\",\"__vModel__\":\"f_last_modify_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"f_last_modify_time\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"currOrganize\",\"fullName\":\"所属组织\",\"fullNameI18nCode\":[\"\"],\"label\":\"所属组织\",\"sortable\":false,\"align\":\"left\",\"type\":\"currOrganize\",\"__config__\":{\"formId\":177,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728522996206,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"f_organize_id\",\"__vModel__\":\"f_organize_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"f_organize_id\",\"placeholder\":\"\",\"showLevel\":\"last\",\"labelI18nCode\":\"\"},{\"clearable\":true,\"yunzhupaasKey\":\"usersSelect\",\"ableIds\":[],\"multiple\":false,\"fullName\":\"阅卷人\",\"fullNameI18nCode\":[\"\"],\"label\":\"阅卷人\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":201,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"usersSelect\",\"noShow\":true,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"阅卷人\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1731396046780,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasUsersSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"f_examer\",\"__vModel__\":\"f_examer\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"f_examer\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"}],\"treeRelationFieldAbleIds\":[],\"treeSyncInterfaceName\":\"\",\"treeSyncTemplateJson\":[],\"treeRelation\":\"\",\"defaultSortConfig\":[],\"tabConfig\":{\"hasAllTab\":true,\"relationField\":\"\",\"on\":false},\"hasSuperQuery\":true,\"treePropsLabel\":\"fullName\",\"groupField\":\"\",\"printIds\":[],\"uploaderTemplateJson\":{},\"hasTreeQuery\":false,\"useFormPermission\":true,\"complexHeaderList\":[],\"useBtnPermission\":true,\"treeSyncType\":0,\"hasPage\":true,\"searchList\":[{\"clearable\":true,\"searchType\":1,\"yunzhupaasKey\":\"usersSelect\",\"ableIds\":[],\"multiple\":false,\"fullName\":\"考试人员\",\"fullNameI18nCode\":[\"\"],\"label\":\"考试人员\",\"__config__\":{\"formId\":192,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"usersSelect\",\"defaultValue\":\"\",\"noShow\":true,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"考试人员\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730801443391,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasUsersSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"f_examiners\",\"__vModel__\":\"f_examiners\",\"searchMultiple\":true,\"isKeyword\":false,\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"f_examiners\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"controls\":false,\"searchType\":3,\"yunzhupaasKey\":\"inputNumber\",\"fullName\":\"考试成绩\",\"fullNameI18nCode\":[\"\"],\"label\":\"考试成绩\",\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"\",\"__config__\":{\"formId\":194,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"inputNumber\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"考试成绩\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730801980329,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"f_result_score\",\"__vModel__\":\"f_result_score\",\"searchMultiple\":false,\"isKeyword\":false,\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"f_result_score\",\"placeholder\":\"请输入\",\"value\":[],\"addonBefore\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"showCount\":false,\"__config__\":{\"formId\":101,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"试卷名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728440990975,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"f_full_name\",\"__vModel__\":\"f_full_name\",\"searchMultiple\":false,\"disabled\":false,\"id\":\"f_full_name\",\"placeholder\":\"请输入试卷名称\",\"addonBefore\":\"\",\"clearable\":true,\"searchType\":2,\"yunzhupaasKey\":\"input\",\"fullName\":\"试卷名称\",\"label\":\"试卷名称\",\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"isKeyword\":false,\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"searchType\":1,\"yunzhupaasKey\":\"select\",\"multiple\":false,\"fullName\":\"试题分类\",\"fullNameI18nCode\":[\"\"],\"label\":\"试题分类\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441006127,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":102,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"试题分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"f_sort\",\"__vModel__\":\"f_sort\",\"searchMultiple\":true,\"isKeyword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_sort\",\"placeholder\":\"请选择试题分类\",\"labelI18nCode\":\"\"},{\"searchType\":3,\"yunzhupaasKey\":\"createTime\",\"fullName\":\"完成时间\",\"fullNameI18nCode\":[\"\"],\"label\":\"完成时间\",\"type\":\"currTime\",\"__config__\":{\"formId\":175,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"完成时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728522994736,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"f_creator_time\",\"__vModel__\":\"f_creator_time\",\"searchMultiple\":false,\"isKeyword\":false,\"style\":{\"width\":\"100%\"},\"id\":\"f_creator_time\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"searchType\":1,\"yunzhupaasKey\":\"select\",\"multiple\":false,\"fullName\":\"阅卷状态\",\"fullNameI18nCode\":[\"\"],\"label\":\"阅卷状态\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730861802965,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":198,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":true,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"阅卷状态\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"f_question_status\",\"options\":[{\"fullName\":\"未完成\",\"id\":\"未完成\"},{\"fullName\":\"已完成\",\"id\":\"已完成\"}],\"__vModel__\":\"f_question_status\",\"searchMultiple\":true,\"isKeyword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_question_status\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"}],\"ruleList\":{\"conditionList\":[],\"matchLogic\":\"and\"},\"childTableStyle\":1,\"treePropsChildren\":\"children\",\"treeRelationFieldSelectType\":\"all\",\"showOverflow\":true,\"treeTemplateJson\":[],\"treeTitleI18nCode\":\"\",\"treePropsName\":\"\",\"useColumnPermission\":false,\"treePropsUrl\":\"\",\"btnsList\":[{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-add\",\"label\":\"新增\",\"value\":\"add\",\"labelI18nCode\":\"common.add2Text\"},{\"show\":false,\"icon\":\"icon-ym icon-ym-btn-download\",\"label\":\"导出\",\"value\":\"download\",\"labelI18nCode\":\"common.exportText\"},{\"show\":false,\"icon\":\"icon-ym icon-ym-btn-upload\",\"label\":\"导入\",\"value\":\"upload\",\"labelI18nCode\":\"common.importText\"},{\"show\":false,\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"批量删除\",\"value\":\"batchRemove\",\"labelI18nCode\":\"common.batchDelText\"},{\"show\":false,\"icon\":\"icon-ym icon-ym-report-icon-preview-printPreview\",\"label\":\"批量打印\",\"value\":\"batchPrint\",\"labelI18nCode\":\"common.batchPrintText\"}],\"useDataPermission\":true,\"columnList\":[{\"clearable\":true,\"yunzhupaasKey\":\"usersSelect\",\"ableIds\":[],\"multiple\":false,\"fullName\":\"考试人员\",\"fullNameI18nCode\":[\"\"],\"label\":\"考试人员\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":192,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"usersSelect\",\"defaultValue\":\"\",\"noShow\":true,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"考试人员\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730801443391,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasUsersSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"f_examiners\",\"__vModel__\":\"f_examiners\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"f_examiners\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":101,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"试卷名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728440990975,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"f_full_name\",\"__vModel__\":\"f_full_name\",\"disabled\":false,\"id\":\"f_full_name\",\"placeholder\":\"请输入试卷名称\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"试卷名称\",\"label\":\"试卷名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"select\",\"multiple\":false,\"fullName\":\"试题分类\",\"fullNameI18nCode\":[\"\"],\"label\":\"试题分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441006127,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":102,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"试题分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"f_sort\",\"__vModel__\":\"f_sort\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_sort\",\"placeholder\":\"请选择试题分类\",\"labelI18nCode\":\"\"},{\"controls\":false,\"yunzhupaasKey\":\"inputNumber\",\"fullName\":\"总分数\",\"fullNameI18nCode\":[\"\"],\"label\":\"总分数\",\"sortable\":false,\"align\":\"left\",\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"\",\"__config__\":{\"formId\":196,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"inputNumber\",\"noShow\":true,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"总分数\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730861767471,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"f_mark\",\"__vModel__\":\"f_mark\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"f_mark\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"labelI18nCode\":\"\"},{\"controls\":false,\"yunzhupaasKey\":\"inputNumber\",\"fullName\":\"考试成绩\",\"fullNameI18nCode\":[\"\"],\"label\":\"考试成绩\",\"sortable\":false,\"align\":\"left\",\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"\",\"__config__\":{\"formId\":194,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"inputNumber\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"考试成绩\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730801980329,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"f_result_score\",\"__vModel__\":\"f_result_score\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"f_result_score\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"select\",\"multiple\":false,\"fullName\":\"阅卷状态\",\"fullNameI18nCode\":[\"\"],\"label\":\"阅卷状态\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730861802965,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":198,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":true,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"阅卷状态\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"f_question_status\",\"options\":[{\"fullName\":\"未完成\",\"id\":\"未完成\"},{\"fullName\":\"已完成\",\"id\":\"已完成\"}],\"__vModel__\":\"f_question_status\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_question_status\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createTime\",\"fullName\":\"完成时间\",\"fullNameI18nCode\":[\"\"],\"label\":\"完成时间\",\"sortable\":false,\"align\":\"left\",\"type\":\"currTime\",\"__config__\":{\"formId\":175,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"完成时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728522994736,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"f_creator_time\",\"__vModel__\":\"f_creator_time\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"f_creator_time\",\"placeholder\":\"\",\"labelI18nCode\":\"\"}],\"summaryField\":[],\"parentField\":\"\",\"treeDataSource\":\"dictionary\",\"treeDictionary\":\"\",\"treeSyncInterfaceId\":\"\",\"customBtnsList\":[]}"); + return sb.toString(); + } + + /** app列表字段配置json */ + public static final String getAppColumnData() { + StringBuilder sb = new StringBuilder(); + sb.append( + "{\"hasPage\":true,\"useColumnPermission\":false,\"searchList\":[],\"btnsList\":[{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-add\",\"label\":\"新增\",\"value\":\"add\",\"labelI18nCode\":\"common.add2Text\"}],\"useDataPermission\":false,\"ruleListApp\":{\"conditionList\":[],\"matchLogic\":\"and\"},\"columnList\":[{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":101,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"试卷名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728440990975,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"f_full_name\",\"__vModel__\":\"f_full_name\",\"disabled\":false,\"id\":\"f_full_name\",\"placeholder\":\"请输入试卷名称\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"试卷名称\",\"label\":\"试卷名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"select\",\"multiple\":false,\"fullName\":\"试题分类\",\"fullNameI18nCode\":[\"\"],\"label\":\"试题分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441006127,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":102,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"试题分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"f_sort\",\"__vModel__\":\"f_sort\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_sort\",\"placeholder\":\"请选择试题分类\",\"labelI18nCode\":\"\"}],\"columnOptions\":[{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"试卷名称\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":101,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"试卷名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728440990975,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_full_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_full_name\",\"placeholder\":\"请输入试卷名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"试题分类\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441006127,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":102,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"试题分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"f_sort\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_sort\",\"placeholder\":\"请选择试题分类\"},{\"clearable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"考试人员\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"formId\":192,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"usersSelect\",\"defaultValue\":\"\",\"noShow\":true,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"考试人员\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730801443391,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasUsersSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"__vModel__\":\"f_examiners\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"f_examiners\",\"placeholder\":\"请选择\"},{\"controls\":false,\"fullName\":\"考试成绩\",\"fullNameI18nCode\":[\"\"],\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"\",\"__config__\":{\"formId\":194,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"inputNumber\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"考试成绩\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730801980329,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"__vModel__\":\"f_result_score\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"f_result_score\",\"placeholder\":\"请输入\",\"addonBefore\":\"\"},{\"controls\":false,\"fullName\":\"总分数\",\"fullNameI18nCode\":[\"\"],\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"\",\"__config__\":{\"formId\":196,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"inputNumber\",\"noShow\":true,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"总分数\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730861767471,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"__vModel__\":\"f_mark\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"f_mark\",\"placeholder\":\"请输入\",\"addonBefore\":\"\"},{\"controls\":false,\"fullName\":\"总题数\",\"fullNameI18nCode\":[\"\"],\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"\",\"__config__\":{\"formId\":197,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"inputNumber\",\"noShow\":true,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"总题数\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730861771690,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"__vModel__\":\"f_question_num\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"f_question_num\",\"placeholder\":\"请输入\",\"addonBefore\":\"\"},{\"controls\":false,\"fullName\":\"每题分数\",\"fullNameI18nCode\":[\"\"],\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"\",\"__config__\":{\"formId\":200,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"inputNumber\",\"noShow\":true,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"每题分数\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730861837728,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"__vModel__\":\"f_per_question\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"f_per_question\",\"placeholder\":\"请输入\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"是否存在问答题\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730861812388,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":199,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":true,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"是否存在问答题\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"options\":[{\"fullName\":\"不存在\",\"id\":\"不存在\"},{\"fullName\":\"存在\",\"id\":\"存在\"}],\"__vModel__\":\"f_question_flag\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_question_flag\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"阅卷状态\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730861802965,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":198,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":true,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"阅卷状态\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"options\":[{\"fullName\":\"未完成\",\"id\":\"未完成\"},{\"fullName\":\"已完成\",\"id\":\"已完成\"}],\"__vModel__\":\"f_question_status\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_question_status\",\"placeholder\":\"请选择\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"单选题-题目难度\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_single\",\"defaultValue\":\"\",\"parentVModel\":\"tableField103\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441098390,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":105,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"f_difficulty\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField103-f_difficulty\",\"placeholder\":\"请选择题目难度\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"单选题-分类\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_single\",\"defaultValue\":[],\"parentVModel\":\"tableField103\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728442522193,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":125,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"__vModel__\":\"f_sort\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField103-f_sort\",\"placeholder\":\"请选择分类\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单选题-题目名称\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":104,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441048947,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_full_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField103-f_full_name\",\"placeholder\":\"请输入题目名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单选题-解析\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":107,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441191118,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_analyze\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField103-f_analyze\",\"placeholder\":\"请输入解析\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单选题-答案\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":108,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441208447,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_answer\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField103-f_answer\",\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单选题-题目类型\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":162,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444695088,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_topic_type\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField103-f_topic_type\",\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单选题-选项A\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":121,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项A\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441931352,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_a\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField103-f_options_a\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单选题-选项B\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":122,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项B\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441943944,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_b\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField103-f_options_b\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单选题-选项C\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":123,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项C\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441946965,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_c\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField103-f_options_c\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单选题-选项D\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":124,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项D\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441947535,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_d\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField103-f_options_d\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"formId\":130,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728443972724,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_organize_id\",\"fullName\":\"单选题-所属组织\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_organize_id\",\"placeholder\":\"\",\"type\":\"currOrganize\",\"showLevel\":\"last\"},{\"__config__\":{\"formId\":129,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728443972064,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_time\",\"fullName\":\"单选题-修改时间\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_last_modify_time\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":128,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728443971712,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_user_id\",\"fullName\":\"单选题-修改用户\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_last_modify_user_id\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":127,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728443971233,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_time\",\"fullName\":\"单选题-创建时间\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_creator_time\",\"placeholder\":\"\",\"type\":\"currTime\"},{\"__config__\":{\"formId\":126,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728443970860,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_user_id\",\"fullName\":\"单选题-创建用户\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_creator_user_id\",\"placeholder\":\"\",\"type\":\"currUser\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"多选题-题目难度\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_more\",\"defaultValue\":\"\",\"parentVModel\":\"tableField131\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":132,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"f_difficulty\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField131-f_difficulty\",\"placeholder\":\"请选择题目难度\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"多选题-分类\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_more\",\"defaultValue\":[],\"parentVModel\":\"tableField131\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":133,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"__vModel__\":\"f_sort\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField131-f_sort\",\"placeholder\":\"请选择分类\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"多选题-题目名称\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":134,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_full_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField131-f_full_name\",\"placeholder\":\"请输入题目名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"多选题-解析\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":135,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_analyze\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField131-f_analyze\",\"placeholder\":\"请输入解析\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"多选题-答案\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":136,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_answer\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField131-f_answer\",\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"多选题-题目类型\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":163,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444726177,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_topic_type\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField131-f_topic_type\",\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"多选题-选项A\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":137,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项A\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_a\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField131-f_options_a\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"多选题-选项B\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":138,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项B\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_b\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField131-f_options_b\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"多选题-选项C\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":139,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项C\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_c\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField131-f_options_c\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"多选题-选项D\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":140,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项D\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_d\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField131-f_options_d\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"formId\":141,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_organize_id\",\"fullName\":\"多选题-所属组织\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_organize_id\",\"placeholder\":\"\",\"type\":\"currOrganize\",\"showLevel\":\"last\"},{\"__config__\":{\"formId\":142,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_time\",\"fullName\":\"多选题-修改时间\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_last_modify_time\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":143,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_user_id\",\"fullName\":\"多选题-修改用户\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_last_modify_user_id\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":144,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_time\",\"fullName\":\"多选题-创建时间\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_creator_time\",\"placeholder\":\"\",\"type\":\"currTime\"},{\"__config__\":{\"formId\":145,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_user_id\",\"fullName\":\"多选题-创建用户\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_creator_user_id\",\"placeholder\":\"\",\"type\":\"currUser\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"判断题-题目难度\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_judgment\",\"defaultValue\":\"\",\"parentVModel\":\"tableField147\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":148,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"f_difficulty\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField147-f_difficulty\",\"placeholder\":\"请选择题目难度\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"判断题-分类\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_judgment\",\"defaultValue\":[],\"parentVModel\":\"tableField147\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":149,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"__vModel__\":\"f_sort\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField147-f_sort\",\"placeholder\":\"请选择分类\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"判断题-题目名称\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":150,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_full_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField147-f_full_name\",\"placeholder\":\"请输入题目名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"判断题-解析\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":151,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_analyze\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField147-f_analyze\",\"placeholder\":\"请输入解析\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"判断题-答案\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":152,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_answer\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField147-f_answer\",\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"判断题-题目类型\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":164,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444750002,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_topic_type\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField147-f_topic_type\",\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"formId\":157,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_organize_id\",\"fullName\":\"判断题-所属组织\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_organize_id\",\"placeholder\":\"\",\"type\":\"currOrganize\",\"showLevel\":\"last\"},{\"__config__\":{\"formId\":158,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_time\",\"fullName\":\"判断题-修改时间\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_last_modify_time\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":159,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_user_id\",\"fullName\":\"判断题-修改用户\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_last_modify_user_id\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":160,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_time\",\"fullName\":\"判断题-创建时间\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_creator_time\",\"placeholder\":\"\",\"type\":\"currTime\"},{\"__config__\":{\"formId\":161,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_user_id\",\"fullName\":\"判断题-创建用户\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_creator_user_id\",\"placeholder\":\"\",\"type\":\"currUser\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"问答题-题目难度\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_essay_question\",\"defaultValue\":\"\",\"parentVModel\":\"tableField180\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":181,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"f_difficulty\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField180-f_difficulty\",\"placeholder\":\"请选择题目难度\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"问答题-分类\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_essay_question\",\"defaultValue\":[],\"parentVModel\":\"tableField180\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":182,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"__vModel__\":\"f_sort\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField180-f_sort\",\"placeholder\":\"请选择分类\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"问答题-题目名称\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":183,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_full_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField180-f_full_name\",\"placeholder\":\"请输入题目名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"问答题-解析\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":184,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_analyze\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField180-f_analyze\",\"placeholder\":\"请输入解析\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"问答题-答案\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":185,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_answer\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField180-f_answer\",\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"问答题-题目类型\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":186,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_topic_type\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField180-f_topic_type\",\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"formId\":187,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_organize_id\",\"fullName\":\"问答题-所属组织\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_organize_id\",\"placeholder\":\"\",\"type\":\"currOrganize\",\"showLevel\":\"last\"},{\"__config__\":{\"formId\":188,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_time\",\"fullName\":\"问答题-修改时间\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_last_modify_time\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":189,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_user_id\",\"fullName\":\"问答题-修改用户\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_last_modify_user_id\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":190,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_time\",\"fullName\":\"问答题-创建时间\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_creator_time\",\"placeholder\":\"\",\"type\":\"currTime\"},{\"__config__\":{\"formId\":191,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_user_id\",\"fullName\":\"问答题-创建用户\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_creator_user_id\",\"placeholder\":\"\",\"type\":\"currUser\"},{\"__config__\":{\"formId\":174,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_"); + sb.append( + "exam_records\",\"renderKey\":1728522993760,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_user_id\",\"fullName\":\"创建用户\",\"fullNameI18nCode\":[\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"f_creator_user_id\",\"placeholder\":\"\",\"type\":\"currUser\"},{\"__config__\":{\"formId\":175,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"完成时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728522994736,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_time\",\"fullName\":\"完成时间\",\"fullNameI18nCode\":[\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"f_creator_time\",\"placeholder\":\"\",\"type\":\"currTime\"},{\"__config__\":{\"formId\":176,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728522995275,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_user_id\",\"fullName\":\"修改用户\",\"fullNameI18nCode\":[\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"f_last_modify_user_id\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":179,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728523000852,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_time\",\"fullName\":\"修改时间\",\"fullNameI18nCode\":[\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"f_last_modify_time\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":177,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728522996206,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_organize_id\",\"fullName\":\"所属组织\",\"fullNameI18nCode\":[\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"f_organize_id\",\"placeholder\":\"\",\"type\":\"currOrganize\",\"showLevel\":\"last\"},{\"clearable\":true,\"ableIds\":[],\"multiple\":false,\"fullName\":\"阅卷人\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"formId\":201,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"usersSelect\",\"noShow\":true,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"阅卷人\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1731396046780,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasUsersSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"__vModel__\":\"f_examer\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"f_examer\",\"placeholder\":\"请选择\"}],\"pageSize\":20,\"defaultSortConfig\":[],\"type\":1,\"columnBtnsList\":[{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-edit\",\"label\":\"编辑\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"edit\",\"labelI18nCode\":\"common.editText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"删除\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"remove\",\"labelI18nCode\":\"common.delText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-generator-menu\",\"label\":\"详情\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"detail\",\"labelI18nCode\":\"common.detailText\"}],\"tabConfig\":{\"hasAllTab\":true,\"relationField\":\"\",\"on\":false},\"hasSuperQuery\":false,\"defaultColumnList\":[{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":101,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"试卷名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728440990975,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"f_full_name\",\"__vModel__\":\"f_full_name\",\"checked\":true,\"disabled\":false,\"id\":\"f_full_name\",\"placeholder\":\"请输入试卷名称\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"试卷名称\",\"label\":\"试卷名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"select\",\"multiple\":false,\"fullName\":\"试题分类\",\"fullNameI18nCode\":[\"\"],\"label\":\"试题分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441006127,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":102,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"试题分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"f_sort\",\"__vModel__\":\"f_sort\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_sort\",\"placeholder\":\"请选择试题分类\",\"labelI18nCode\":\"\"},{\"clearable\":true,\"yunzhupaasKey\":\"usersSelect\",\"ableIds\":[],\"multiple\":false,\"fullName\":\"考试人员\",\"fullNameI18nCode\":[\"\"],\"label\":\"考试人员\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":192,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"usersSelect\",\"defaultValue\":\"\",\"noShow\":true,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"考试人员\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730801443391,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"defaultCurrent\":true,\"tag\":\"YunzhupaasUsersSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"f_examiners\",\"__vModel__\":\"f_examiners\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"f_examiners\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"controls\":false,\"yunzhupaasKey\":\"inputNumber\",\"fullName\":\"考试成绩\",\"fullNameI18nCode\":[\"\"],\"label\":\"考试成绩\",\"sortable\":false,\"align\":\"left\",\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"\",\"__config__\":{\"formId\":194,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"inputNumber\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"考试成绩\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730801980329,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"f_result_score\",\"__vModel__\":\"f_result_score\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"f_result_score\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"labelI18nCode\":\"\"},{\"controls\":false,\"yunzhupaasKey\":\"inputNumber\",\"fullName\":\"总分数\",\"fullNameI18nCode\":[\"\"],\"label\":\"总分数\",\"sortable\":false,\"align\":\"left\",\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"\",\"__config__\":{\"formId\":196,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"inputNumber\",\"noShow\":true,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"总分数\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730861767471,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"f_mark\",\"__vModel__\":\"f_mark\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"f_mark\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"labelI18nCode\":\"\"},{\"controls\":false,\"yunzhupaasKey\":\"inputNumber\",\"fullName\":\"总题数\",\"fullNameI18nCode\":[\"\"],\"label\":\"总题数\",\"sortable\":false,\"align\":\"left\",\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"\",\"__config__\":{\"formId\":197,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"inputNumber\",\"noShow\":true,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"总题数\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730861771690,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"f_question_num\",\"__vModel__\":\"f_question_num\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"f_question_num\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"labelI18nCode\":\"\"},{\"controls\":false,\"yunzhupaasKey\":\"inputNumber\",\"fullName\":\"每题分数\",\"fullNameI18nCode\":[\"\"],\"label\":\"每题分数\",\"sortable\":false,\"align\":\"left\",\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"\",\"__config__\":{\"formId\":200,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"inputNumber\",\"noShow\":true,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"每题分数\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730861837728,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"f_per_question\",\"__vModel__\":\"f_per_question\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"f_per_question\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"select\",\"multiple\":false,\"fullName\":\"是否存在问答题\",\"fullNameI18nCode\":[\"\"],\"label\":\"是否存在问答题\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730861812388,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":199,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":true,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"是否存在问答题\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"f_question_flag\",\"options\":[{\"fullName\":\"不存在\",\"id\":\"不存在\"},{\"fullName\":\"存在\",\"id\":\"存在\"}],\"__vModel__\":\"f_question_flag\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_question_flag\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"select\",\"multiple\":false,\"fullName\":\"阅卷状态\",\"fullNameI18nCode\":[\"\"],\"label\":\"阅卷状态\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"id\"},\"__config__\":{\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1730861802965,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":198,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":true,\"dataType\":\"static\",\"dictionaryType\":\"\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"阅卷状态\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"f_question_status\",\"options\":[{\"fullName\":\"未完成\",\"id\":\"未完成\"},{\"fullName\":\"已完成\",\"id\":\"已完成\"}],\"__vModel__\":\"f_question_status\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_question_status\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"select\",\"multiple\":false,\"fullName\":\"单选题-题目难度\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"单选题-题目难度\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_single\",\"defaultValue\":\"\",\"parentVModel\":\"tableField103\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441098390,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":105,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"tableField103-f_difficulty\",\"__vModel__\":\"f_difficulty\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField103-f_difficulty\",\"placeholder\":\"请选择题目难度\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"cascader\",\"multiple\":false,\"fullName\":\"单选题-分类\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"单选题-分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_single\",\"defaultValue\":[],\"parentVModel\":\"tableField103\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728442522193,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":125,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"tableField103-f_sort\",\"__vModel__\":\"f_sort\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField103-f_sort\",\"placeholder\":\"请选择分类\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":104,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441048947,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField103-f_full_name\",\"__vModel__\":\"f_full_name\",\"checked\":false,\"disabled\":true,\"id\":\"tableField103-f_full_name\",\"placeholder\":\"请输入题目名称\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"单选题-题目名称\",\"label\":\"单选题-题目名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":107,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441191118,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField103-f_analyze\",\"__vModel__\":\"f_analyze\",\"checked\":false,\"disabled\":true,\"id\":\"tableField103-f_analyze\",\"placeholder\":\"请输入解析\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"单选题-解析\",\"label\":\"单选题-解析\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":108,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441208447,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField103-f_answer\",\"__vModel__\":\"f_answer\",\"checked\":false,\"disabled\":true,\"id\":\"tableField103-f_answer\",\"placeholder\":\"请输入题目类型\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"单选题-答案\",\"label\":\"单选题-答案\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":162,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444695088,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField103-f_topic_type\",\"__vModel__\":\"f_topic_type\",\"checked\":false,\"disabled\":true,\"id\":\"tableField103-f_topic_type\",\"placeholder\":\"请输入题目类型\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"单选题-题目类型\",\"label\":\"单选题-题目类型\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":121,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项A\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441931352,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField103-f_options_a\",\"__vModel__\":\"f_options_a\",\"checked\":false,\"disabled\":false,\"id\":\"tableField103-f_options_a\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"单选题-选项A\",\"label\":\"单选题-选项A\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":122,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项B\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441943944,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField103-f_options_b\",\"__vModel__\":\"f_options_b\",\"checked\":false,\"disabled\":false,\"id\":\"tableField103-f_options_b\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"单选题-选项B\",\"label\":\"单选题-选项B\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":123,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项C\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441946965,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField103-f_options_c\",\"__vModel__\":\"f_options_c\",\"checked\":false,\"disabled\":false,\"id\":\"tableField103-f_options_c\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"单选题-选项C\",\"label\":\"单选题-选项C\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":124,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项D\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728441947535,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField103-f_options_d\",\"__vModel__\":\"f_options_d\",\"checked\":false,\"disabled\":false,\"id\":\"tableField103-f_options_d\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"单选题-选项D\",\"label\":\"单选题-选项D\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"currOrganize\",\"fullName\":\"单选题-所属组织\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"单选题-所属组织\",\"sortable\":false,\"align\":\"left\",\"type\":\"currOrganize\",\"__config__\":{\"formId\":130,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728443972724,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField103-f_organize_id\",\"__vModel__\":\"f_organize_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_organize_id\",\"placeholder\":\"\",\"showLevel\":\"last\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyTime\",\"fullName\":\"单选题-修改时间\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"单选题-修改时间\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":129,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728443972064,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField103-f_last_modify_time\",\"__vModel__\":\"f_last_modify_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_last_modify_time\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyUser\",\"fullName\":\"单选题-修改用户\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"单选题-修改用户\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":128,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728443971712,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField103-f_last_modify_user_id\",\"__vModel__\":\"f_last_modify_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_last_modify_user_id\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createTime\",\"fullName\":\"单选题-创建时间\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"单选题-创建时间\",\"sortable\":false,\"align\":\"left\",\"type\":\"currTime\",\"__config__\":{\"formId\":127,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728443971233,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField103-f_creator_time\",\"__vModel__\":\"f_creator_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_creator_time\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createUser\",\"fullName\":\"单选题-创建用户\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"单选题-创建用户\",\"sortable\":false,\"align\":\"left\",\"type\":\"currUser\",\"__config__\":{\"formId\":126,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728443970860,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField103-f_creator_user_id\",\"__vModel__\":\"f_creator_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_creator_user_id\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"select\",\"multiple\":false,\"fullName\":\"多选题-题目难度\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"多选题-题目难度\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_more\",\"defaultValue\":\"\",\"parentVModel\":\"tableField131\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":132,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"tableField131-f_difficulty\",\"__vModel__\":\"f_difficulty\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField131-f_difficulty\",\"placeholder\":\"请选择题目难度\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"cascader\",\"multiple\":false,\"fullName\":\"多选题-分类\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"多选题-分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_more\",\"defaultValue\":[],\"parentVModel\":\"tableField131\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":133,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"tableField131-f_sort\",\"__vModel__\":\"f_sort\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField131-f_sort\",\"placeholder\":\"请选择分类\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":134,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField131-f_full_name\",\"__vModel__\":\"f_full_name\",\"checked\":false,\"disabled\":true,\"id\":\"tableField131-f_full_name\",\"placeholder\":\"请输入题目名称\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"多选题-题目名称\",\"label\":\"多选题-题目名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":135,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField131-f_analyze\",\"__vModel__\":\"f_analyze\",\"checked\":false,\"disabled\":true,\"id\":\"tableField131-f_analyze\",\"placeholder\":\"请输入解析\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"多选题-解析\",\"label\":\"多选题-解析\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":136,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField131-f_answer\",\"__vModel__\":\"f_answer\",\"checked\":false,\"disabled\":true,\"id\":\"tableField131-f_answer\",\"placeholder\":\"请输入题目类型\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"多选题-答案\",\"label\":\"多选题-答案\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":163,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444726177,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField131-f_topic_type\",\"__vModel__\":\"f_topic_type\",\"checked\":false,\"disabled\":true,\"id\":\"tableField131-f_topic_type\",\"placeholder\":\"请输入题目类型\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"多选题-题目类型\",\"label\":\"多选题-题目类型\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":137,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项A\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField131-f_options_a\",\"__vModel__\":\"f_options_a\",\"checked\":false,\"disabled\":false,\"id\":\"tableField131-f_options_a\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"多选题-选项A\",\"label\":\"多选题-选项A\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":138,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项B\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField131-f_options_b\",\"__vModel__\":\"f_options_b\",\"checked\":false,\"disabled\":false,\"id\":\"tableField131-f_options_b\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"多选题-选项B\",\"label\":\"多选题-选项B\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":139,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项C\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField131-f_options_c\",\"__vModel__\":\"f_options_c\",\"checked\":false,\"disabled\":false,\"id\":\"tableField131-f_options_c\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"多选题-选项C\",\"label\":\"多选题-选项C\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":140,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项D\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField131-f_options_d\",\"__vModel__\":\"f_options_d\",\"checked\":false,\"disabled\":false,\"id\":\"tableField131-f_options_d\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"多选题-选项D\",\"label\":\"多选题-选项D\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"currOrganize\",\"fullName\":\"多选题-所属组织\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"多选题-所属组织\",\"sortable\":false,\"align\":\"left\",\"type\":\"currOrganize\",\"__config__\":{\"formId\":141,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField131-f_organize_id\",\"__vModel__\":\"f_organize_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_organize_id\",\"placeholder\":\"\",\"showLevel\":\"last\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyTime\",\"fullName\":\"多选题-修改时间\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"多选题-修改时间\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":142,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField131-f_last_modify_time\",\"__vModel__\":\"f_last_modify_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_last_modify_time\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyUser\",\"fullName\":\"多选题-修改用户\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"多选题-修改用户\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":143,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField131-f_last_modify_user_id\",\"__vModel__\":\"f_last_modify_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_last_modify_user_id\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createTime\",\"fullName\":\"多选题-创建时间\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"多选题-创建时间\",\"sortable\":false,\"align\":\"left\",\"type\":\"currTime\",\"__config__\":{\"formId\":144,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField131-f_creator_time\",\"__vModel__\":\"f_creator_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_creator_time\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createUser\",\"fullName\":\"多选题-创建用户\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"多选题-创建用户\",\"sortable\":false,\"align\":\"left\",\"type\":\"currUser\",\"__config__\":{\"formId\":145,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField131-f_creator_user_id\",\"__vModel__\":\"f_creator_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_creator_user_id\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"select\",\"multiple\":false,\"fullName\":\"判断题-题目难度\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"判断题-题目难度\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_judgment\",\"defaultValue\":\"\",\"parentVModel\":\"tableField147\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":148,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"tableField147-f_difficulty\",\"__vModel__\":\"f_difficulty\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField147-f_difficulty\",\"placeholder\":\"请选择题目难度\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"cascader\",\"multiple\":false,\"fullName\":\"判断题-分类\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"判断题-分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_judgment\",\"defaultValue\":[],\"parentVModel\":\"tableField147\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":149,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"tableField147-f_sort\",\"__vModel__\":\"f_sort\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField147-f_sort\",\"placeholder\":\"请选择分类\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":150,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField147-f_full_name\",\"__vModel__\":\"f_full_name\",\"checked\":false,\"disabled\":true,\"id\":\"tableField147-f_full_name\",\"placeholder\":\"请输入题目名称\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"判断题-题目名称\",\"label\":\"判断题-题目名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":151,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField147-f_analyze\",\"__vModel__\":\"f_analyze\",\"checked\":false,\"disabled\":true,\"id\":\"tableField147-f_analyze\",\"placeholder\":\"请输入解析\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"判断题-解析\",\"label\":\"判断题-解析\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":152,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField147-f_answer\",\"__vModel__\":\"f_answer\",\"checked\":false,\"disabled\":true,\"id\":\"tableField147-f_answer\",\"placeholder\":\"请输入题目类型\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"判断题-答案\",\"label\":\"判断题-答案\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":164,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444750002,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField147-f_topic_type\",\"__vModel__\":\"f_topic_type\",\"checked\":false,\"disabled\":true,\"id\":\"tableField147-f_topic_type\",\"placeholder\":\"请输入题目类型\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"判断题-题目类型\",\"label\":\"判断题-题目类型\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"currOrganize\",\"fullName\":\"判断题-所属组织\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"判断题-所属组织\",\"sortable\":false,\"align\":\"left\",\"type\":\"currOrganize\",\"__config__\":{\"formId\":157,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField147-f_organize_id\",\"__vModel__\":\"f_organize_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_organize_id\",\"placeholder\":\"\",\"showLevel\":\"last\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyTime\",\"fullName\":\"判断题-修改时间\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"判断题-修改时间\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":158,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField147-f_last_modify_time\",\"__vModel__\":\"f_last_modify_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_last_modify_time\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyUser\",\"fullName\":\"判断题-修改用户\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"判断题-修改用户\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":159,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField147-f_last_modify_user_id\",\"__vModel__\":\"f_last_modify_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_last_modify_user_id\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createTime\",\"fullName\":\"判断题-创建时间\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"判断题-创建时间\",\"sortable\":false,\"align\":\"left\",\"type\":\"currTime\",\"__config__\":{\"formId\":160,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField147-f_creator_time\",\"__vModel__\":\"f_creator_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_creator_time\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createUser\",\"fullName\":\"判断题-创建用户\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"判断题-创建用户\",\"sortable\":false,\"align\":\"left\",\"type\":\"currUser\",\"__config__\":{\"formId\":161,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField147-f_creator_user_id\",\"__vModel__\":\"f_creator_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_creator_user_id\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"select\",\"multiple\":false,\"fullName\":\"问答题-题目难度\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"问答题-题目难度\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fu"); + sb.append( + "llName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_essay_question\",\"defaultValue\":\"\",\"parentVModel\":\"tableField180\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":181,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"tableField180-f_difficulty\",\"__vModel__\":\"f_difficulty\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField180-f_difficulty\",\"placeholder\":\"请选择题目难度\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"cascader\",\"multiple\":false,\"fullName\":\"问答题-分类\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"问答题-分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_essay_question\",\"defaultValue\":[],\"parentVModel\":\"tableField180\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":182,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"tableField180-f_sort\",\"__vModel__\":\"f_sort\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField180-f_sort\",\"placeholder\":\"请选择分类\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":183,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField180-f_full_name\",\"__vModel__\":\"f_full_name\",\"checked\":false,\"disabled\":true,\"id\":\"tableField180-f_full_name\",\"placeholder\":\"请输入题目名称\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"问答题-题目名称\",\"label\":\"问答题-题目名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":184,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField180-f_analyze\",\"__vModel__\":\"f_analyze\",\"checked\":false,\"disabled\":true,\"id\":\"tableField180-f_analyze\",\"placeholder\":\"请输入解析\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"问答题-解析\",\"label\":\"问答题-解析\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":185,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField180-f_answer\",\"__vModel__\":\"f_answer\",\"checked\":false,\"disabled\":true,\"id\":\"tableField180-f_answer\",\"placeholder\":\"请输入题目类型\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"问答题-答案\",\"label\":\"问答题-答案\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":186,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField180-f_topic_type\",\"__vModel__\":\"f_topic_type\",\"checked\":false,\"disabled\":true,\"id\":\"tableField180-f_topic_type\",\"placeholder\":\"请输入题目类型\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"问答题-题目类型\",\"label\":\"问答题-题目类型\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"currOrganize\",\"fullName\":\"问答题-所属组织\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"问答题-所属组织\",\"sortable\":false,\"align\":\"left\",\"type\":\"currOrganize\",\"__config__\":{\"formId\":187,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField180-f_organize_id\",\"__vModel__\":\"f_organize_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_organize_id\",\"placeholder\":\"\",\"showLevel\":\"last\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyTime\",\"fullName\":\"问答题-修改时间\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"问答题-修改时间\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":188,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField180-f_last_modify_time\",\"__vModel__\":\"f_last_modify_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_last_modify_time\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyUser\",\"fullName\":\"问答题-修改用户\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"问答题-修改用户\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":189,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField180-f_last_modify_user_id\",\"__vModel__\":\"f_last_modify_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_last_modify_user_id\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createTime\",\"fullName\":\"问答题-创建时间\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"问答题-创建时间\",\"sortable\":false,\"align\":\"left\",\"type\":\"currTime\",\"__config__\":{\"formId\":190,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField180-f_creator_time\",\"__vModel__\":\"f_creator_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_creator_time\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createUser\",\"fullName\":\"问答题-创建用户\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"问答题-创建用户\",\"sortable\":false,\"align\":\"left\",\"type\":\"currUser\",\"__config__\":{\"formId\":191,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField180-f_creator_user_id\",\"__vModel__\":\"f_creator_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_creator_user_id\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createUser\",\"fullName\":\"创建用户\",\"fullNameI18nCode\":[\"\"],\"label\":\"创建用户\",\"sortable\":false,\"align\":\"left\",\"type\":\"currUser\",\"__config__\":{\"formId\":174,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728522993760,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"f_creator_user_id\",\"__vModel__\":\"f_creator_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"f_creator_user_id\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createTime\",\"fullName\":\"完成时间\",\"fullNameI18nCode\":[\"\"],\"label\":\"完成时间\",\"sortable\":false,\"align\":\"left\",\"type\":\"currTime\",\"__config__\":{\"formId\":175,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"完成时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728522994736,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"f_creator_time\",\"__vModel__\":\"f_creator_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"f_creator_time\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyUser\",\"fullName\":\"修改用户\",\"fullNameI18nCode\":[\"\"],\"label\":\"修改用户\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":176,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728522995275,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"f_last_modify_user_id\",\"__vModel__\":\"f_last_modify_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"f_last_modify_user_id\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyTime\",\"fullName\":\"修改时间\",\"fullNameI18nCode\":[\"\"],\"label\":\"修改时间\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":179,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728523000852,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"f_last_modify_time\",\"__vModel__\":\"f_last_modify_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"f_last_modify_time\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"currOrganize\",\"fullName\":\"所属组织\",\"fullNameI18nCode\":[\"\"],\"label\":\"所属组织\",\"sortable\":false,\"align\":\"left\",\"type\":\"currOrganize\",\"__config__\":{\"formId\":177,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1728522996206,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"f_organize_id\",\"__vModel__\":\"f_organize_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"f_organize_id\",\"placeholder\":\"\",\"showLevel\":\"last\",\"labelI18nCode\":\"\"},{\"clearable\":true,\"yunzhupaasKey\":\"usersSelect\",\"ableIds\":[],\"multiple\":false,\"fullName\":\"阅卷人\",\"fullNameI18nCode\":[\"\"],\"label\":\"阅卷人\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":201,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"usersSelect\",\"noShow\":true,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"阅卷人\",\"trigger\":\"change\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_exam_records\",\"renderKey\":1731396046780,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasUsersSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"f_examer\",\"__vModel__\":\"f_examer\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"f_examer\",\"placeholder\":\"请选择\",\"labelI18nCode\":\"\"}],\"showOverflow\":true,\"useFormPermission\":false,\"customBtnsList\":[],\"useBtnPermission\":false}"); + return sb.toString(); + } + + /** 表列表 */ + public static final String getTableList() { + StringBuilder sb = new StringBuilder(); + sb.append( + "[{\"relationField\":\"\",\"relationTable\":\"\",\"table\":\"make_train_exam_records\",\"tableName\":\"教育培训-考试记录\",\"tableField\":\"\",\"typeId\":\"1\",\"fields\":[{\"columnName\":null,\"field\":\"f_id\",\"fieldName\":\"自然主键\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":1,\"allowNull\":0,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_library_id\",\"fieldName\":\"在线考试主键\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_number\",\"fieldName\":\"编号\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_examiners\",\"fieldName\":\"考试人员\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_full_name\",\"fieldName\":\"试卷名称\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_sort\",\"fieldName\":\"试题分类\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_mark\",\"fieldName\":\"总分数\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_question_num\",\"fieldName\":\"总题数\",\"dataType\":\"int\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_per_question\",\"fieldName\":\"每题分数\",\"dataType\":\"int\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_result_score\",\"fieldName\":\"考试成绩\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_basic_score\",\"fieldName\":\"基础题得分\",\"dataType\":\"int\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_question_flag\",\"fieldName\":\"是否存在问答题(不存在,存在)\",\"dataType\":\"varchar\",\"dataLength\":\"20\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_question_status\",\"fieldName\":\"阅卷状态(未完成,已完成)\",\"dataType\":\"varchar\",\"dataLength\":\"20\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_question_score\",\"fieldName\":\"问答题得分\",\"dataType\":\"int\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_enabled_mark\",\"fieldName\":\"有效标志(0-禁用,1-启用)\",\"dataType\":\"int\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_sort_code\",\"fieldName\":\"排序\",\"dataType\":\"bigint\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_organize_id\",\"fieldName\":\"所属组织\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_creator_time\",\"fieldName\":\"创建时间\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_creator_user_id\",\"fieldName\":\"创建用户\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_last_modify_time\",\"fieldName\":\"修改时间\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_last_modify_user_id\",\"fieldName\":\"修改用户\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_delete_time\",\"fieldName\":\"删除时间\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_delete_user_id\",\"fieldName\":\"删除用户\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_delete_mark\",\"fieldName\":\"删除标志\",\"dataType\":\"int\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_tenant_id\",\"fieldName\":\"租户id\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":0,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_flow_id\",\"fieldName\":\"流程id\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_flow_task_id\",\"fieldName\":\"流程任务主键\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_start_time\",\"fieldName\":\"考试开始时间\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_end_time\",\"fieldName\":\"考试结束日期\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_examer\",\"fieldName\":\"阅卷人\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0}]},{\"relationField\":\"f_id\",\"relationTable\":\"make_train_exam_records\",\"table\":\"make_train_library_essay_question\",\"tableName\":\"教育培训-试卷库-问答题\",\"tableField\":\"f_bank_id\",\"typeId\":\"0\",\"fields\":[{\"columnName\":null,\"field\":\"f_id\",\"fieldName\":\"自然主键\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":1,\"allowNull\":0,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_bank_id\",\"fieldName\":\"主表ID\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_difficulty\",\"fieldName\":\"题目难度\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_sort\",\"fieldName\":\"分类\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_full_name\",\"fieldName\":\"题目名称\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_analyze\",\"fieldName\":\"解析\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_result\",\"fieldName\":\"结果(正确/错误)\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_answer\",\"fieldName\":\"答案\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_description\",\"fieldName\":\"描述或说明\",\"dataType\":\"varchar\",\"dataLength\":\"500\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_enabled_mark\",\"fieldName\":\"有效标志(0-禁用,1-启用)\",\"dataType\":\"int\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_sort_code\",\"fieldName\":\"排序\",\"dataType\":\"bigint\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_organize_id\",\"fieldName\":\"所属组织\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_creator_time\",\"fieldName\":\"创建时间\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_creator_user_id\",\"fieldName\":\"创建用户\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_last_modify_time\",\"fieldName\":\"修改时间\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_last_modify_user_id\",\"fieldName\":\"修改用户\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_delete_time\",\"fieldName\":\"删除时间\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_delete_user_id\",\"fieldName\":\"删除用户\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_delete_mark\",\"fieldName\":\"删除标志\",\"dataType\":\"int\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_tenant_id\",\"fieldName\":\"租户id\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":0,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_flow_id\",\"fieldName\":\"流程id\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_flow_task_id\",\"fieldName\":\"流程任务主键\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_topic_type\",\"fieldName\":\"题目类型\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0}]},{\"relationField\":\"f_id\",\"relationTable\":\"make_train_exam_records\",\"table\":\"make_train_library_judgment\",\"tableName\":\"教育培训-试卷库-判断题\",\"tableField\":\"f_bank_id\",\"typeId\":\"0\",\"fields\":[{\"columnName\":null,\"field\":\"f_id\",\"fieldName\":\"自然主键\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":1,\"allowNull\":0,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_bank_id\",\"fieldName\":\"主表ID\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_difficulty\",\"fieldName\":\"题目难度\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_sort\",\"fieldName\":\"分类\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_full_name\",\"fieldName\":\"题目名称\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_analyze\",\"fieldName\":\"解析\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_answer\",\"fieldName\":\"答案\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_description\",\"fieldName\":\"描述或说明\",\"dataType\":\"varchar\",\"dataLength\":\"500\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_enabled_mark\",\"fieldName\":\"有效标志(0-禁用,1-启用)\",\"dataType\":\"int\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_sort_code\",\"fieldName\":\"排序\",\"dataType\":\"bigint\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_organize_id\",\"fieldName\":\"所属组织\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_creator_time\",\"fieldName\":\"创建时间\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_creator_user_id\",\"fieldName\":\"创建用户\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_last_modify_time\",\"fieldName\":\"修改时间\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_last_modify_user_id\",\"fieldName\":\"修改用户\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_delete_time\",\"fieldName\":\"删除时间\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_delete_user_id\",\"fieldName\":\"删除用户\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_delete_mark\",\"fieldName\":\"删除标志\",\"dataType\":\"int\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_tenant_id\",\"fieldName\":\"租户id\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":0,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_flow_id\",\"fieldName\":\"流程id\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_flow_task_id\",\"fieldName\":\"流程任务主键\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_topic_type\",\"fieldName\":\"题目类型\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0}]},{\"relationField\":\"f_id\",\"relationTable\":\"make_train_exam_records\",\"table\":\"make_train_library_more\",\"tableName\":\"教育培训-试卷库-多选题\",\"tableField\":\"f_bank_id\",\"typeId\":\"0\",\"fields\":[{\"columnName\":null,\"field\":\"f_id\",\"fieldName\":\"自然主键\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":1,\"allowNull\":0,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_bank_id\",\"fieldName\":\"主表ID\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_difficulty\",\"fieldName\":\"题目难度\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_sort\",\"fieldName\":\"分类\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_full_name\",\"fieldName\":\"题目名称\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_options_a\",\"fieldName\":\"选项A\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_options_b\",\"fieldName\":\"选项B\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_options_c\",\"fieldName\":\"选项C\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_options_d\",\"fieldName\":\"选项D\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_analyze\",\"fieldName\":\"解析\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_answer\",\"fieldName\":\"答案\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_description\",\"fieldName\":\"描述或说明\",\"dataType\":\"varchar\",\"dataLength\":\"500\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_enabled_mark\",\"fieldName\":\"有效标志(0-禁用,1-启用)\",\"dataType\":\"int\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_sort_code\",\"fieldName\":\"排序\",\"dataType\":\"bigint\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_organize_id\",\"fieldName\":\"所属组织\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_creator_time\",\"fieldName\":\"创建时间\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_creator_user_id\",\"fieldName\":\"创建用户\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_last_modify_time\",\"fieldName\":\"修改时间\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_last_modify_user_id\",\"fieldName\":\"修改用户\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_delete_time\",\"fieldName\":\"删除时间\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_delete_user_id\",\"fieldName\":\"删除用户\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_delete_mark\",\"fieldName\":\"删除标志\",\"dataType\":\"int\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_tenant_id\",\"fieldName\":\"租户id\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":0,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_flow_id\",\"fieldName\":\"流程id\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_flow_task_id\",\"fieldName\":\"流程任务主键\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_topic_type\",\"fieldName\":\"题目类型\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0}]},{\"relationField\":\"f_id\",\"relationTable\":\"make_train_exam_records\",\"table\":\"make_train_library_single\",\"tableName\":\"教育培训-试卷库-单选题\",\"tableField\":\"f_bank_id\",\"typeId\":\"0\",\"fields\":[{\"columnName\":null,\"field\":\"f_id\",\"fieldName\":\"自然主键\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":1,\"allowNull\":0,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_bank_id\",\"fieldName\":\"主表ID\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_difficulty\",\"fieldName\":\"题目难度\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_sort\",\"fieldName\":\"分类\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_full_name\",\"fieldName\":\"题目名称\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_options_a\",\"fieldName\":\"选项A\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_options_b\",\"fieldName\":\"选项B\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_options_c\",\"fieldName\":\"选项C\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_options_d\",\"fieldName\":\"选项D\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_analyze\",\"fieldName\":\"解析\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_answer\",\"fieldName\":\"答案\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_topic_type\",\"fieldName\":\"题目类型\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_description\",\"fieldName\":\"描述或说明\",\"dataType\":\"varchar\",\"dataLength\":\"500\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_enabled_mark\",\"fieldName\":\"有效标志(0-禁用,1-启用)\",\"dataType\":\"int\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_sort_code\",\"fieldName\":\"排序\",\"dataType\":\"bigint\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_organize_id\",\"fieldName\":\"所属组织\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_creator_time\",\"fieldName\":\"创建时间\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_creator_user_id\",\"fieldName\":\"创建用户\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_last_modify_time\",\"fieldName\":\"修改时间\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_last_modify_user_id\",\"fieldName\":\"修改用户\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_delete_time\",\"fieldName\":\"删除时间\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_delete_user_id\",\"fieldName\":\"删除用户\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_delete_mark\",\"fieldName\":\"删除标志\",\"dataType\":\"int\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_tenant_id\",\"fieldName\":\"租户id\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":0,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_flow_id\",\"fieldName\":\"流程id\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_flow_task_id\",\"fieldName\":\"流程任务主键\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0}]}]"); + return sb.toString(); + } +} diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainExamRecordsExcelErrorVO.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainExamRecordsExcelErrorVO.java new file mode 100644 index 0000000..fe03c59 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainExamRecordsExcelErrorVO.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.model.trainexamrecords; + +import lombok.Data; +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.alibaba.fastjson.annotation.JSONField; +/** + * + * 考试记录 + * @版本: V5.2.0 + * @版权: Copyright @ 2025 + * @作者: 浙江尖峰集团股份有限公司 + * @日期: 2024-11-06 + */ +@Data +public class TrainExamRecordsExcelErrorVO extends TrainExamRecordsExcelVO{ + + @Excel(name = "异常原因",orderNum = "-999") + @JSONField(name = "errorsInfo") + private String errorsInfo; +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainExamRecordsExcelVO.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainExamRecordsExcelVO.java new file mode 100644 index 0000000..7d1a41a --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainExamRecordsExcelVO.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.model.trainexamrecords; + +import lombok.Data; +import java.sql.Time; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; +import cn.afterturn.easypoi.excel.annotation.Excel; +import cn.afterturn.easypoi.excel.annotation.ExcelEntity; +import cn.afterturn.easypoi.excel.annotation.ExcelCollection; +import java.math.BigDecimal; +import java.util.List; +/** + * + * 考试记录 + * @版本: V5.2.0 + * @版权: Copyright @ 2025 + * @作者: 浙江尖峰集团股份有限公司 + * @日期: 2024-11-06 + */ +@Data +public class TrainExamRecordsExcelVO{ + +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainExamRecordsForm.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainExamRecordsForm.java new file mode 100644 index 0000000..d94b690 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainExamRecordsForm.java @@ -0,0 +1,119 @@ +package com.yunzhupaas.model.trainexamrecords; + +import lombok.Data; +import java.util.*; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * 考试记录 + * @版本: V5.2.0 + * @版权: Copyright @ 2025 + * @作者: 浙江尖峰集团股份有限公司 + * @日期: 2024-11-06 + */ +@Data +@Schema(description = "表单参数") +public class TrainExamRecordsForm { + /** 主键 */ + @Schema(description = "主键") + @JSONField(name = "f_id") + private String id; + + + /** 试卷名称 **/ + @Schema(description = "试卷名称") + @JsonProperty("f_full_name") + @JSONField(name = "f_full_name") + private String ffullName; + /** 试题分类 **/ + @Schema(description = "试题分类") + @JsonProperty("f_sort") + @JSONField(name = "f_sort") + private Object fsort; + /** 考试人员 **/ + @Schema(description = "考试人员") + @JsonProperty("f_examiners") + @JSONField(name = "f_examiners") + private Object fexaminers; + /** 考试成绩 **/ + @Schema(description = "考试成绩") + @JsonProperty("f_result_score") + @JSONField(name = "f_result_score") + private BigDecimal fresultScore; + /** 总分数 **/ + @Schema(description = "总分数") + @JsonProperty("f_mark") + @JSONField(name = "f_mark") + private BigDecimal fmark; + /** 总题数 **/ + @Schema(description = "总题数") + @JsonProperty("f_question_num") + @JSONField(name = "f_question_num") + private BigDecimal fquestionNum; + /** 每题分数 **/ + @Schema(description = "每题分数") + @JsonProperty("f_per_question") + @JSONField(name = "f_per_question") + private BigDecimal fperQuestion; + /** 是否存在问答题 **/ + @Schema(description = "是否存在问答题") + @JsonProperty("f_question_flag") + @JSONField(name = "f_question_flag") + private Object fquestionFlag; + /** 阅卷状态 **/ + @Schema(description = "阅卷状态") + @JsonProperty("f_question_status") + @JSONField(name = "f_question_status") + private Object fquestionStatus; + /** 创建用户 **/ + @Schema(description = "创建用户") + @JsonProperty("f_creator_user_id") + @JSONField(name = "f_creator_user_id") + private String fcreatorUserId; + /** 完成时间 **/ + @Schema(description = "完成时间") + @JsonProperty("f_creator_time") + @JSONField(name = "f_creator_time") + private String fcreatorTime; + /** 修改用户 **/ + @Schema(description = "修改用户") + @JsonProperty("f_last_modify_user_id") + @JSONField(name = "f_last_modify_user_id") + private String flastModifyUserId; + /** 修改时间 **/ + @Schema(description = "修改时间") + @JsonProperty("f_last_modify_time") + @JSONField(name = "f_last_modify_time") + private String flastModifyTime; + /** 所属组织 **/ + @Schema(description = "所属组织") + @JsonProperty("f_organize_id") + @JSONField(name = "f_organize_id") + private Object forganizeId; + /** 阅卷人 **/ + @Schema(description = "阅卷人") + @JsonProperty("f_examer") + @JSONField(name = "f_examer") + private Object fexamer; + + /** 子表数据 **/ + @Schema(description = "trainLibrarySingle子表数据") + @JsonProperty("trainLibrarySingleList") + private List trainLibrarySingleList; + /** 子表数据 **/ + @Schema(description = "trainLibraryMore子表数据") + @JsonProperty("trainLibraryMoreList") + private List trainLibraryMoreList; + /** 子表数据 **/ + @Schema(description = "trainLibraryJudgment子表数据") + @JsonProperty("trainLibraryJudgmentList") + private List trainLibraryJudgmentList; + /** 子表数据 **/ + @Schema(description = "trainLibraryEssayQuestion子表数据") + @JsonProperty("trainLibraryEssayQuestionList") + private List trainLibraryEssayQuestionList; +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainExamRecordsPagination.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainExamRecordsPagination.java new file mode 100644 index 0000000..4a8e7ac --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainExamRecordsPagination.java @@ -0,0 +1,76 @@ +package com.yunzhupaas.model.trainexamrecords; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import com.yunzhupaas.base.Pagination; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.List; + +/** + * + * 考试记录 + * @版本: V5.2.0 + * @版权: Copyright @ 2025 + * @作者: 浙江尖峰集团股份有限公司 + * @日期: 2024-11-06 + */ +@Data +@Schema(description = "列表查询参数") +public class TrainExamRecordsPagination extends Pagination { + /** 关键词搜索 */ + @Schema(description = "关键词搜索") + private String yunzhupaasKeyword; + /** 查询key */ + @Schema(description = "查询key") + private String[] selectKey; + /** 选中数据数组id */ + @Schema(description = "选中数据数组id") + private String[] selectIds; + /** json */ + @Schema(description = "json") + private String json; + /** 数据类型 0-当前页,1-全部数据 */ + @Schema(description = "数据类型 0-当前页,1-全部数据") + private String dataType; + /** 高级查询 */ + @Schema(description = "高级查询") + private String superQueryJson; + /** 功能id */ + @Schema(description = "功能id") + private String moduleId; + /** 菜单id */ + @Schema(description = "菜单id") + private String menuId; + /** 考试人员 */ + @Schema(description = "考试人员") + @JsonProperty("f_examiners") + @JSONField(name = "fexaminers") + private Object fexaminers; + /** 考试成绩 */ + @Schema(description = "考试成绩") + @JsonProperty("f_result_score") + @JSONField(name = "fresultScore") + private Object fresultScore; + /** 试卷名称 */ + @Schema(description = "试卷名称") + @JsonProperty("f_full_name") + @JSONField(name = "ffullName") + private Object ffullName; + /** 试题分类 */ + @Schema(description = "试题分类") + @JsonProperty("f_sort") + @JSONField(name = "fsort") + private Object fsort; + /** 完成时间 */ + @Schema(description = "完成时间") + @JsonProperty("f_creator_time") + @JSONField(name = "fcreatorTime") + private Object fcreatorTime; + /** 阅卷状态 */ + @Schema(description = "阅卷状态") + @JsonProperty("f_question_status") + @JSONField(name = "fquestionStatus") + private Object fquestionStatus; +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainLibraryEssayQuestionExcelVO.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainLibraryEssayQuestionExcelVO.java new file mode 100644 index 0000000..8537a5f --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainLibraryEssayQuestionExcelVO.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.model.trainexamrecords; + +import lombok.Data; +import java.sql.Time; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; +import cn.afterturn.easypoi.excel.annotation.Excel; +import cn.afterturn.easypoi.excel.annotation.ExcelEntity; +import cn.afterturn.easypoi.excel.annotation.ExcelCollection; +import java.math.BigDecimal; +import java.util.List; +/** + * + * 考试记录 + * @版本: V5.2.0 + * @版权: Copyright @ 2025 + * @作者: 浙江尖峰集团股份有限公司 + * @日期: 2024-11-06 + */ +@Data +public class TrainLibraryEssayQuestionExcelVO{ + +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainLibraryEssayQuestionModel.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainLibraryEssayQuestionModel.java new file mode 100644 index 0000000..9d3e889 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainLibraryEssayQuestionModel.java @@ -0,0 +1,84 @@ +package com.yunzhupaas.model.trainexamrecords; + +import lombok.Data; +import java.util.List; +import java.util.Date; +import java.math.BigDecimal; +import com.alibaba.fastjson.annotation.JSONField; +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * + * 考试记录 + * 版本: V5.2.0 + * 版权: Copyright @ 2025 + * 作者: 浙江尖峰集团股份有限公司 + * 日期: 2024-11-06 + */ +@Data +@Schema(description = "TrainLibraryEssayQuestion子表参数") +public class TrainLibraryEssayQuestionModel { + + /** 子表:TrainLibraryEssayQuestion 主键:f_id **/ + @Schema(description = "主键") + @JsonProperty("f_id") + private String f_id; + /** 题目难度 **/ + @Schema(description = "题目难度") + @JsonProperty("f_difficulty") + @JSONField(name = "f_difficulty") + private Object fdifficulty; + /** 分类 **/ + @Schema(description = "分类") + @JsonProperty("f_sort") + @JSONField(name = "f_sort") + private Object fsort; + /** 题目名称 **/ + @Schema(description = "题目名称") + @JsonProperty("f_full_name") + @JSONField(name = "f_full_name") + private String ffullName; + /** 解析 **/ + @Schema(description = "解析") + @JsonProperty("f_analyze") + @JSONField(name = "f_analyze") + private String fanalyze; + /** 答案 **/ + @Schema(description = "答案") + @JsonProperty("f_answer") + @JSONField(name = "f_answer") + private String fanswer; + /** 题目类型 **/ + @Schema(description = "题目类型") + @JsonProperty("f_topic_type") + @JSONField(name = "f_topic_type") + private String ftopicType; + /** 所属组织 **/ + @Schema(description = "所属组织") + @JsonProperty("f_organize_id") + @JSONField(name = "f_organize_id") + private Object forganizeId; + /** 修改时间 **/ + @Schema(description = "修改时间") + @JsonProperty("f_last_modify_time") + @JSONField(name = "f_last_modify_time") + private String flastModifyTime; + /** 修改用户 **/ + @Schema(description = "修改用户") + @JsonProperty("f_last_modify_user_id") + @JSONField(name = "f_last_modify_user_id") + private String flastModifyUserId; + /** 创建时间 **/ + @Schema(description = "创建时间") + @JsonProperty("f_creator_time") + @JSONField(name = "f_creator_time") + private String fcreatorTime; + /** 创建用户 **/ + @Schema(description = "创建用户") + @JsonProperty("f_creator_user_id") + @JSONField(name = "f_creator_user_id") + private String fcreatorUserId; +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainLibraryJudgmentExcelVO.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainLibraryJudgmentExcelVO.java new file mode 100644 index 0000000..a2b3135 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainLibraryJudgmentExcelVO.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.model.trainexamrecords; + +import lombok.Data; +import java.sql.Time; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; +import cn.afterturn.easypoi.excel.annotation.Excel; +import cn.afterturn.easypoi.excel.annotation.ExcelEntity; +import cn.afterturn.easypoi.excel.annotation.ExcelCollection; +import java.math.BigDecimal; +import java.util.List; +/** + * + * 考试记录 + * @版本: V5.2.0 + * @版权: Copyright @ 2025 + * @作者: 浙江尖峰集团股份有限公司 + * @日期: 2024-11-06 + */ +@Data +public class TrainLibraryJudgmentExcelVO{ + +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainLibraryJudgmentModel.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainLibraryJudgmentModel.java new file mode 100644 index 0000000..0f9a00f --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainLibraryJudgmentModel.java @@ -0,0 +1,84 @@ +package com.yunzhupaas.model.trainexamrecords; + +import lombok.Data; +import java.util.List; +import java.util.Date; +import java.math.BigDecimal; +import com.alibaba.fastjson.annotation.JSONField; +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * + * 考试记录 + * 版本: V5.2.0 + * 版权: Copyright @ 2025 + * 作者: 浙江尖峰集团股份有限公司 + * 日期: 2024-11-06 + */ +@Data +@Schema(description = "TrainLibraryJudgment子表参数") +public class TrainLibraryJudgmentModel { + + /** 子表:TrainLibraryJudgment 主键:f_id **/ + @Schema(description = "主键") + @JsonProperty("f_id") + private String f_id; + /** 题目难度 **/ + @Schema(description = "题目难度") + @JsonProperty("f_difficulty") + @JSONField(name = "f_difficulty") + private Object fdifficulty; + /** 分类 **/ + @Schema(description = "分类") + @JsonProperty("f_sort") + @JSONField(name = "f_sort") + private Object fsort; + /** 题目名称 **/ + @Schema(description = "题目名称") + @JsonProperty("f_full_name") + @JSONField(name = "f_full_name") + private String ffullName; + /** 解析 **/ + @Schema(description = "解析") + @JsonProperty("f_analyze") + @JSONField(name = "f_analyze") + private String fanalyze; + /** 答案 **/ + @Schema(description = "答案") + @JsonProperty("f_answer") + @JSONField(name = "f_answer") + private String fanswer; + /** 题目类型 **/ + @Schema(description = "题目类型") + @JsonProperty("f_topic_type") + @JSONField(name = "f_topic_type") + private String ftopicType; + /** 所属组织 **/ + @Schema(description = "所属组织") + @JsonProperty("f_organize_id") + @JSONField(name = "f_organize_id") + private Object forganizeId; + /** 修改时间 **/ + @Schema(description = "修改时间") + @JsonProperty("f_last_modify_time") + @JSONField(name = "f_last_modify_time") + private String flastModifyTime; + /** 修改用户 **/ + @Schema(description = "修改用户") + @JsonProperty("f_last_modify_user_id") + @JSONField(name = "f_last_modify_user_id") + private String flastModifyUserId; + /** 创建时间 **/ + @Schema(description = "创建时间") + @JsonProperty("f_creator_time") + @JSONField(name = "f_creator_time") + private String fcreatorTime; + /** 创建用户 **/ + @Schema(description = "创建用户") + @JsonProperty("f_creator_user_id") + @JSONField(name = "f_creator_user_id") + private String fcreatorUserId; +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainLibraryMoreExcelVO.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainLibraryMoreExcelVO.java new file mode 100644 index 0000000..61ff4fd --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainLibraryMoreExcelVO.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.model.trainexamrecords; + +import lombok.Data; +import java.sql.Time; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; +import cn.afterturn.easypoi.excel.annotation.Excel; +import cn.afterturn.easypoi.excel.annotation.ExcelEntity; +import cn.afterturn.easypoi.excel.annotation.ExcelCollection; +import java.math.BigDecimal; +import java.util.List; +/** + * + * 考试记录 + * @版本: V5.2.0 + * @版权: Copyright @ 2025 + * @作者: 浙江尖峰集团股份有限公司 + * @日期: 2024-11-06 + */ +@Data +public class TrainLibraryMoreExcelVO{ + +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainLibraryMoreModel.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainLibraryMoreModel.java new file mode 100644 index 0000000..5ed35cc --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainLibraryMoreModel.java @@ -0,0 +1,104 @@ +package com.yunzhupaas.model.trainexamrecords; + +import lombok.Data; +import java.util.List; +import java.util.Date; +import java.math.BigDecimal; +import com.alibaba.fastjson.annotation.JSONField; +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * + * 考试记录 + * 版本: V5.2.0 + * 版权: Copyright @ 2025 + * 作者: 浙江尖峰集团股份有限公司 + * 日期: 2024-11-06 + */ +@Data +@Schema(description = "TrainLibraryMore子表参数") +public class TrainLibraryMoreModel { + + /** 子表:TrainLibraryMore 主键:f_id **/ + @Schema(description = "主键") + @JsonProperty("f_id") + private String f_id; + /** 题目难度 **/ + @Schema(description = "题目难度") + @JsonProperty("f_difficulty") + @JSONField(name = "f_difficulty") + private Object fdifficulty; + /** 分类 **/ + @Schema(description = "分类") + @JsonProperty("f_sort") + @JSONField(name = "f_sort") + private Object fsort; + /** 题目名称 **/ + @Schema(description = "题目名称") + @JsonProperty("f_full_name") + @JSONField(name = "f_full_name") + private String ffullName; + /** 解析 **/ + @Schema(description = "解析") + @JsonProperty("f_analyze") + @JSONField(name = "f_analyze") + private String fanalyze; + /** 答案 **/ + @Schema(description = "答案") + @JsonProperty("f_answer") + @JSONField(name = "f_answer") + private String fanswer; + /** 题目类型 **/ + @Schema(description = "题目类型") + @JsonProperty("f_topic_type") + @JSONField(name = "f_topic_type") + private String ftopicType; + /** 选项A **/ + @Schema(description = "选项A") + @JsonProperty("f_options_a") + @JSONField(name = "f_options_a") + private String foptionsA; + /** 选项B **/ + @Schema(description = "选项B") + @JsonProperty("f_options_b") + @JSONField(name = "f_options_b") + private String foptionsB; + /** 选项C **/ + @Schema(description = "选项C") + @JsonProperty("f_options_c") + @JSONField(name = "f_options_c") + private String foptionsC; + /** 选项D **/ + @Schema(description = "选项D") + @JsonProperty("f_options_d") + @JSONField(name = "f_options_d") + private String foptionsD; + /** 所属组织 **/ + @Schema(description = "所属组织") + @JsonProperty("f_organize_id") + @JSONField(name = "f_organize_id") + private Object forganizeId; + /** 修改时间 **/ + @Schema(description = "修改时间") + @JsonProperty("f_last_modify_time") + @JSONField(name = "f_last_modify_time") + private String flastModifyTime; + /** 修改用户 **/ + @Schema(description = "修改用户") + @JsonProperty("f_last_modify_user_id") + @JSONField(name = "f_last_modify_user_id") + private String flastModifyUserId; + /** 创建时间 **/ + @Schema(description = "创建时间") + @JsonProperty("f_creator_time") + @JSONField(name = "f_creator_time") + private String fcreatorTime; + /** 创建用户 **/ + @Schema(description = "创建用户") + @JsonProperty("f_creator_user_id") + @JSONField(name = "f_creator_user_id") + private String fcreatorUserId; +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainLibrarySingleExcelVO.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainLibrarySingleExcelVO.java new file mode 100644 index 0000000..c2e24b3 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainLibrarySingleExcelVO.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.model.trainexamrecords; + +import lombok.Data; +import java.sql.Time; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; +import cn.afterturn.easypoi.excel.annotation.Excel; +import cn.afterturn.easypoi.excel.annotation.ExcelEntity; +import cn.afterturn.easypoi.excel.annotation.ExcelCollection; +import java.math.BigDecimal; +import java.util.List; +/** + * + * 考试记录 + * @版本: V5.2.0 + * @版权: Copyright @ 2025 + * @作者: 浙江尖峰集团股份有限公司 + * @日期: 2024-11-06 + */ +@Data +public class TrainLibrarySingleExcelVO{ + +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainLibrarySingleModel.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainLibrarySingleModel.java new file mode 100644 index 0000000..4a5188c --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/trainexamrecords/TrainLibrarySingleModel.java @@ -0,0 +1,104 @@ +package com.yunzhupaas.model.trainexamrecords; + +import lombok.Data; +import java.util.List; +import java.util.Date; +import java.math.BigDecimal; +import com.alibaba.fastjson.annotation.JSONField; +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * + * 考试记录 + * 版本: V5.2.0 + * 版权: Copyright @ 2025 + * 作者: 浙江尖峰集团股份有限公司 + * 日期: 2024-11-06 + */ +@Data +@Schema(description = "TrainLibrarySingle子表参数") +public class TrainLibrarySingleModel { + + /** 子表:TrainLibrarySingle 主键:f_id **/ + @Schema(description = "主键") + @JsonProperty("f_id") + private String f_id; + /** 题目难度 **/ + @Schema(description = "题目难度") + @JsonProperty("f_difficulty") + @JSONField(name = "f_difficulty") + private Object fdifficulty; + /** 分类 **/ + @Schema(description = "分类") + @JsonProperty("f_sort") + @JSONField(name = "f_sort") + private Object fsort; + /** 题目名称 **/ + @Schema(description = "题目名称") + @JsonProperty("f_full_name") + @JSONField(name = "f_full_name") + private String ffullName; + /** 解析 **/ + @Schema(description = "解析") + @JsonProperty("f_analyze") + @JSONField(name = "f_analyze") + private String fanalyze; + /** 答案 **/ + @Schema(description = "答案") + @JsonProperty("f_answer") + @JSONField(name = "f_answer") + private String fanswer; + /** 题目类型 **/ + @Schema(description = "题目类型") + @JsonProperty("f_topic_type") + @JSONField(name = "f_topic_type") + private String ftopicType; + /** 选项A **/ + @Schema(description = "选项A") + @JsonProperty("f_options_a") + @JSONField(name = "f_options_a") + private String foptionsA; + /** 选项B **/ + @Schema(description = "选项B") + @JsonProperty("f_options_b") + @JSONField(name = "f_options_b") + private String foptionsB; + /** 选项C **/ + @Schema(description = "选项C") + @JsonProperty("f_options_c") + @JSONField(name = "f_options_c") + private String foptionsC; + /** 选项D **/ + @Schema(description = "选项D") + @JsonProperty("f_options_d") + @JSONField(name = "f_options_d") + private String foptionsD; + /** 所属组织 **/ + @Schema(description = "所属组织") + @JsonProperty("f_organize_id") + @JSONField(name = "f_organize_id") + private Object forganizeId; + /** 修改时间 **/ + @Schema(description = "修改时间") + @JsonProperty("f_last_modify_time") + @JSONField(name = "f_last_modify_time") + private String flastModifyTime; + /** 修改用户 **/ + @Schema(description = "修改用户") + @JsonProperty("f_last_modify_user_id") + @JSONField(name = "f_last_modify_user_id") + private String flastModifyUserId; + /** 创建时间 **/ + @Schema(description = "创建时间") + @JsonProperty("f_creator_time") + @JSONField(name = "f_creator_time") + private String fcreatorTime; + /** 创建用户 **/ + @Schema(description = "创建用户") + @JsonProperty("f_creator_user_id") + @JSONField(name = "f_creator_user_id") + private String fcreatorUserId; +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainLibraryEssayQuestionExcelVO.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainLibraryEssayQuestionExcelVO.java new file mode 100644 index 0000000..5fd0305 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainLibraryEssayQuestionExcelVO.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.model.traintestpaperlibrary; + +import lombok.Data; +import java.sql.Time; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; +import cn.afterturn.easypoi.excel.annotation.Excel; +import cn.afterturn.easypoi.excel.annotation.ExcelEntity; +import cn.afterturn.easypoi.excel.annotation.ExcelCollection; +import java.math.BigDecimal; +import java.util.List; +/** + * + * 在线考试 + * @版本: V5.2.0 + * @版权: Copyright @ 2025 + * @作者: 浙江尖峰集团股份有限公司 + * @日期: 2024-11-05 + */ +@Data +public class TrainLibraryEssayQuestionExcelVO{ + +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainLibraryEssayQuestionModel.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainLibraryEssayQuestionModel.java new file mode 100644 index 0000000..9f08168 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainLibraryEssayQuestionModel.java @@ -0,0 +1,84 @@ +package com.yunzhupaas.model.traintestpaperlibrary; + +import lombok.Data; +import java.util.List; +import java.util.Date; +import java.math.BigDecimal; +import com.alibaba.fastjson.annotation.JSONField; +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * + * 在线考试 + * 版本: V5.2.0 + * 版权: Copyright @ 2025 + * 作者: 浙江尖峰集团股份有限公司 + * 日期: 2024-11-05 + */ +@Data +@Schema(description = "TrainLibraryEssayQuestion子表参数") +public class TrainLibraryEssayQuestionModel { + + /** 子表:TrainLibraryEssayQuestion 主键:f_id **/ + @Schema(description = "主键") + @JsonProperty("f_id") + private String f_id; + /** 题目难度 **/ + @Schema(description = "题目难度") + @JsonProperty("f_difficulty") + @JSONField(name = "f_difficulty") + private Object fdifficulty; + /** 分类 **/ + @Schema(description = "分类") + @JsonProperty("f_sort") + @JSONField(name = "f_sort") + private Object fsort; + /** 题目名称 **/ + @Schema(description = "题目名称") + @JsonProperty("f_full_name") + @JSONField(name = "f_full_name") + private String ffullName; + /** 解析 **/ + @Schema(description = "解析") + @JsonProperty("f_analyze") + @JSONField(name = "f_analyze") + private String fanalyze; + /** 答案 **/ + @Schema(description = "答案") + @JsonProperty("f_answer") + @JSONField(name = "f_answer") + private String fanswer; + /** 题目类型 **/ + @Schema(description = "题目类型") + @JsonProperty("f_topic_type") + @JSONField(name = "f_topic_type") + private String ftopicType; + /** 所属组织 **/ + @Schema(description = "所属组织") + @JsonProperty("f_organize_id") + @JSONField(name = "f_organize_id") + private Object forganizeId; + /** 修改时间 **/ + @Schema(description = "修改时间") + @JsonProperty("f_last_modify_time") + @JSONField(name = "f_last_modify_time") + private String flastModifyTime; + /** 修改用户 **/ + @Schema(description = "修改用户") + @JsonProperty("f_last_modify_user_id") + @JSONField(name = "f_last_modify_user_id") + private String flastModifyUserId; + /** 创建时间 **/ + @Schema(description = "创建时间") + @JsonProperty("f_creator_time") + @JSONField(name = "f_creator_time") + private String fcreatorTime; + /** 创建用户 **/ + @Schema(description = "创建用户") + @JsonProperty("f_creator_user_id") + @JSONField(name = "f_creator_user_id") + private String fcreatorUserId; +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainLibraryJudgmentExcelVO.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainLibraryJudgmentExcelVO.java new file mode 100644 index 0000000..cbf989d --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainLibraryJudgmentExcelVO.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.model.traintestpaperlibrary; + +import lombok.Data; +import java.sql.Time; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; +import cn.afterturn.easypoi.excel.annotation.Excel; +import cn.afterturn.easypoi.excel.annotation.ExcelEntity; +import cn.afterturn.easypoi.excel.annotation.ExcelCollection; +import java.math.BigDecimal; +import java.util.List; +/** + * + * 在线考试 + * @版本: V5.2.0 + * @版权: Copyright @ 2025 + * @作者: 浙江尖峰集团股份有限公司 + * @日期: 2024-11-05 + */ +@Data +public class TrainLibraryJudgmentExcelVO{ + +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainLibraryJudgmentModel.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainLibraryJudgmentModel.java new file mode 100644 index 0000000..770d865 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainLibraryJudgmentModel.java @@ -0,0 +1,84 @@ +package com.yunzhupaas.model.traintestpaperlibrary; + +import lombok.Data; +import java.util.List; +import java.util.Date; +import java.math.BigDecimal; +import com.alibaba.fastjson.annotation.JSONField; +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * + * 在线考试 + * 版本: V5.2.0 + * 版权: Copyright @ 2025 + * 作者: 浙江尖峰集团股份有限公司 + * 日期: 2024-11-05 + */ +@Data +@Schema(description = "TrainLibraryJudgment子表参数") +public class TrainLibraryJudgmentModel { + + /** 子表:TrainLibraryJudgment 主键:f_id **/ + @Schema(description = "主键") + @JsonProperty("f_id") + private String f_id; + /** 题目难度 **/ + @Schema(description = "题目难度") + @JsonProperty("f_difficulty") + @JSONField(name = "f_difficulty") + private Object fdifficulty; + /** 分类 **/ + @Schema(description = "分类") + @JsonProperty("f_sort") + @JSONField(name = "f_sort") + private Object fsort; + /** 题目名称 **/ + @Schema(description = "题目名称") + @JsonProperty("f_full_name") + @JSONField(name = "f_full_name") + private String ffullName; + /** 解析 **/ + @Schema(description = "解析") + @JsonProperty("f_analyze") + @JSONField(name = "f_analyze") + private String fanalyze; + /** 答案 **/ + @Schema(description = "答案") + @JsonProperty("f_answer") + @JSONField(name = "f_answer") + private String fanswer; + /** 题目类型 **/ + @Schema(description = "题目类型") + @JsonProperty("f_topic_type") + @JSONField(name = "f_topic_type") + private String ftopicType; + /** 所属组织 **/ + @Schema(description = "所属组织") + @JsonProperty("f_organize_id") + @JSONField(name = "f_organize_id") + private Object forganizeId; + /** 修改时间 **/ + @Schema(description = "修改时间") + @JsonProperty("f_last_modify_time") + @JSONField(name = "f_last_modify_time") + private String flastModifyTime; + /** 修改用户 **/ + @Schema(description = "修改用户") + @JsonProperty("f_last_modify_user_id") + @JSONField(name = "f_last_modify_user_id") + private String flastModifyUserId; + /** 创建时间 **/ + @Schema(description = "创建时间") + @JsonProperty("f_creator_time") + @JSONField(name = "f_creator_time") + private String fcreatorTime; + /** 创建用户 **/ + @Schema(description = "创建用户") + @JsonProperty("f_creator_user_id") + @JSONField(name = "f_creator_user_id") + private String fcreatorUserId; +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainLibraryMoreExcelVO.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainLibraryMoreExcelVO.java new file mode 100644 index 0000000..d90a71b --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainLibraryMoreExcelVO.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.model.traintestpaperlibrary; + +import lombok.Data; +import java.sql.Time; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; +import cn.afterturn.easypoi.excel.annotation.Excel; +import cn.afterturn.easypoi.excel.annotation.ExcelEntity; +import cn.afterturn.easypoi.excel.annotation.ExcelCollection; +import java.math.BigDecimal; +import java.util.List; +/** + * + * 在线考试 + * @版本: V5.2.0 + * @版权: Copyright @ 2025 + * @作者: 浙江尖峰集团股份有限公司 + * @日期: 2024-11-05 + */ +@Data +public class TrainLibraryMoreExcelVO{ + +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainLibraryMoreModel.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainLibraryMoreModel.java new file mode 100644 index 0000000..a17f524 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainLibraryMoreModel.java @@ -0,0 +1,104 @@ +package com.yunzhupaas.model.traintestpaperlibrary; + +import lombok.Data; +import java.util.List; +import java.util.Date; +import java.math.BigDecimal; +import com.alibaba.fastjson.annotation.JSONField; +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * + * 在线考试 + * 版本: V5.2.0 + * 版权: Copyright @ 2025 + * 作者: 浙江尖峰集团股份有限公司 + * 日期: 2024-11-05 + */ +@Data +@Schema(description = "TrainLibraryMore子表参数") +public class TrainLibraryMoreModel { + + /** 子表:TrainLibraryMore 主键:f_id **/ + @Schema(description = "主键") + @JsonProperty("f_id") + private String f_id; + /** 题目难度 **/ + @Schema(description = "题目难度") + @JsonProperty("f_difficulty") + @JSONField(name = "f_difficulty") + private Object fdifficulty; + /** 分类 **/ + @Schema(description = "分类") + @JsonProperty("f_sort") + @JSONField(name = "f_sort") + private Object fsort; + /** 题目名称 **/ + @Schema(description = "题目名称") + @JsonProperty("f_full_name") + @JSONField(name = "f_full_name") + private String ffullName; + /** 解析 **/ + @Schema(description = "解析") + @JsonProperty("f_analyze") + @JSONField(name = "f_analyze") + private String fanalyze; + /** 答案 **/ + @Schema(description = "答案") + @JsonProperty("f_answer") + @JSONField(name = "f_answer") + private String fanswer; + /** 题目类型 **/ + @Schema(description = "题目类型") + @JsonProperty("f_topic_type") + @JSONField(name = "f_topic_type") + private String ftopicType; + /** 选项A **/ + @Schema(description = "选项A") + @JsonProperty("f_options_a") + @JSONField(name = "f_options_a") + private String foptionsA; + /** 选项B **/ + @Schema(description = "选项B") + @JsonProperty("f_options_b") + @JSONField(name = "f_options_b") + private String foptionsB; + /** 选项C **/ + @Schema(description = "选项C") + @JsonProperty("f_options_c") + @JSONField(name = "f_options_c") + private String foptionsC; + /** 选项D **/ + @Schema(description = "选项D") + @JsonProperty("f_options_d") + @JSONField(name = "f_options_d") + private String foptionsD; + /** 所属组织 **/ + @Schema(description = "所属组织") + @JsonProperty("f_organize_id") + @JSONField(name = "f_organize_id") + private Object forganizeId; + /** 修改时间 **/ + @Schema(description = "修改时间") + @JsonProperty("f_last_modify_time") + @JSONField(name = "f_last_modify_time") + private String flastModifyTime; + /** 修改用户 **/ + @Schema(description = "修改用户") + @JsonProperty("f_last_modify_user_id") + @JSONField(name = "f_last_modify_user_id") + private String flastModifyUserId; + /** 创建时间 **/ + @Schema(description = "创建时间") + @JsonProperty("f_creator_time") + @JSONField(name = "f_creator_time") + private String fcreatorTime; + /** 创建用户 **/ + @Schema(description = "创建用户") + @JsonProperty("f_creator_user_id") + @JSONField(name = "f_creator_user_id") + private String fcreatorUserId; +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainLibrarySingleExcelVO.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainLibrarySingleExcelVO.java new file mode 100644 index 0000000..5ccf896 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainLibrarySingleExcelVO.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.model.traintestpaperlibrary; + +import lombok.Data; +import java.sql.Time; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; +import cn.afterturn.easypoi.excel.annotation.Excel; +import cn.afterturn.easypoi.excel.annotation.ExcelEntity; +import cn.afterturn.easypoi.excel.annotation.ExcelCollection; +import java.math.BigDecimal; +import java.util.List; +/** + * + * 在线考试 + * @版本: V5.2.0 + * @版权: Copyright @ 2025 + * @作者: 浙江尖峰集团股份有限公司 + * @日期: 2024-11-05 + */ +@Data +public class TrainLibrarySingleExcelVO{ + +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainLibrarySingleModel.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainLibrarySingleModel.java new file mode 100644 index 0000000..cb507f9 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainLibrarySingleModel.java @@ -0,0 +1,104 @@ +package com.yunzhupaas.model.traintestpaperlibrary; + +import lombok.Data; +import java.util.List; +import java.util.Date; +import java.math.BigDecimal; +import com.alibaba.fastjson.annotation.JSONField; +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * + * 在线考试 + * 版本: V5.2.0 + * 版权: Copyright @ 2025 + * 作者: 浙江尖峰集团股份有限公司 + * 日期: 2024-11-05 + */ +@Data +@Schema(description = "TrainLibrarySingle子表参数") +public class TrainLibrarySingleModel { + + /** 子表:TrainLibrarySingle 主键:f_id **/ + @Schema(description = "主键") + @JsonProperty("f_id") + private String f_id; + /** 题目难度 **/ + @Schema(description = "题目难度") + @JsonProperty("f_difficulty") + @JSONField(name = "f_difficulty") + private Object fdifficulty; + /** 分类 **/ + @Schema(description = "分类") + @JsonProperty("f_sort") + @JSONField(name = "f_sort") + private Object fsort; + /** 题目名称 **/ + @Schema(description = "题目名称") + @JsonProperty("f_full_name") + @JSONField(name = "f_full_name") + private String ffullName; + /** 解析 **/ + @Schema(description = "解析") + @JsonProperty("f_analyze") + @JSONField(name = "f_analyze") + private String fanalyze; + /** 答案 **/ + @Schema(description = "答案") + @JsonProperty("f_answer") + @JSONField(name = "f_answer") + private String fanswer; + /** 题目类型 **/ + @Schema(description = "题目类型") + @JsonProperty("f_topic_type") + @JSONField(name = "f_topic_type") + private String ftopicType; + /** 选项A **/ + @Schema(description = "选项A") + @JsonProperty("f_options_a") + @JSONField(name = "f_options_a") + private String foptionsA; + /** 选项B **/ + @Schema(description = "选项B") + @JsonProperty("f_options_b") + @JSONField(name = "f_options_b") + private String foptionsB; + /** 选项C **/ + @Schema(description = "选项C") + @JsonProperty("f_options_c") + @JSONField(name = "f_options_c") + private String foptionsC; + /** 选项D **/ + @Schema(description = "选项D") + @JsonProperty("f_options_d") + @JSONField(name = "f_options_d") + private String foptionsD; + /** 所属组织 **/ + @Schema(description = "所属组织") + @JsonProperty("f_organize_id") + @JSONField(name = "f_organize_id") + private Object forganizeId; + /** 修改时间 **/ + @Schema(description = "修改时间") + @JsonProperty("f_last_modify_time") + @JSONField(name = "f_last_modify_time") + private String flastModifyTime; + /** 修改用户 **/ + @Schema(description = "修改用户") + @JsonProperty("f_last_modify_user_id") + @JSONField(name = "f_last_modify_user_id") + private String flastModifyUserId; + /** 创建时间 **/ + @Schema(description = "创建时间") + @JsonProperty("f_creator_time") + @JSONField(name = "f_creator_time") + private String fcreatorTime; + /** 创建用户 **/ + @Schema(description = "创建用户") + @JsonProperty("f_creator_user_id") + @JSONField(name = "f_creator_user_id") + private String fcreatorUserId; +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainTestPaperLibraryConstant.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainTestPaperLibraryConstant.java new file mode 100644 index 0000000..cf6d380 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainTestPaperLibraryConstant.java @@ -0,0 +1,67 @@ +package com.yunzhupaas.model.traintestpaperlibrary; + +import com.yunzhupaas.util.JsonUtil; +import java.util.*; + +/** + * 在线考试配置json + * + * @版本: V5.2.0 + * @版权: Copyright @ 2025 + * @作者: 浙江尖峰集团股份有限公司 + * @日期: 2024-11-05 + */ +public class TrainTestPaperLibraryConstant { + /** 数据库链接 */ + public static final String DBLINKID = "0"; + /** 表别名 map */ + public static final Map TABLERENAMES = JsonUtil.getJsonToBean( + "{\"make_train_library_essay_question\":\"trainLibraryEssayQuestion\",\"make_train_library_judgment\":\"trainLibraryJudgment\",\"make_train_library_more\":\"trainLibraryMore\",\"make_train_library_single\":\"trainLibrarySingle\",\"make_train_test_paper_library\":\"trainTestPaperLibrary\"}", + Map.class); + /** 子表model map */ + public static final Map TABLEFIELDKEY = JsonUtil.getJsonToBean( + "{\"tableField103\":\"make_train_library_single\",\"tableField147\":\"make_train_library_judgment\",\"tableField131\":\"make_train_library_more\",\"tableField180\":\"make_train_library_essay_question\"}", + Map.class); + + /** 整个表单配置json */ + public static final String getFormData() { + StringBuilder sb = new StringBuilder(); + sb.append( + "{\"popupType\":\"general\",\"idGlobal\":191,\"labelWidth\":100,\"classNames\":[],\"className\":[],\"fullScreenWidth\":\"100%\",\"hasConfirmAndAddBtn\":false,\"cancelButtonTextI18nCode\":\"common.cancelText\",\"labelPosition\":\"right\",\"printId\":\"\",\"labelSuffix\":\"\",\"disabled\":false,\"formModel\":\"dataForm\",\"cancelButtonText\":\"取消\",\"confirmButtonText\":\"确定\",\"hasCancelBtn\":true,\"primaryKeyPolicy\":1,\"hasPrintBtn\":false,\"concurrencyLock\":false,\"classJson\":\"\",\"drawerWidth\":\"600px\",\"confirmButtonTextI18nCode\":\"common.okText\",\"printButtonText\":\"打印\",\"formRef\":\"formRef\",\"gutter\":15,\"logicalDelete\":false,\"size\":\"middle\",\"formRules\":\"rules\",\"generalWidth\":\"1000px\",\"colon\":false,\"hasConfirmBtn\":true,\"formStyle\":\"\",\"printButtonTextI18nCode\":\"common.printText\",\"fields\":[{\"__config__\":{\"formId\":165,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"tab\",\"noShow\":false,\"dragDisabled\":false,\"active\":\"1\",\"className\":[],\"label\":\"标签面板\",\"showLabel\":false,\"renderKey\":1728522357849,\"tableName\":\"make_train_test_paper_library\",\"layout\":\"rowFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-label\",\"children\":[{\"__config__\":{\"formId\":166,\"children\":[{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":101,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"试卷名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728440990975,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_full_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入试卷名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441006127,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":102,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"试题分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"multiple\":false,\"__vModel__\":\"f_sort\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请选择试题分类\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"}},{\"showSummary\":false,\"__config__\":{\"formId\":103,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"table\",\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"单选题\",\"showLabel\":false,\"tableName\":\"make_train_library_single\",\"renderKey\":1728441037497,\"layout\":\"rowFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-table\",\"children\":[{\"filterable\":false,\"clearable\":true,\"__config__\":{\"relationTable\":\"make_train_library_single\",\"defaultValue\":\"\",\"parentVModel\":\"tableField103\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441098390,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":105,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"multiple\":false,\"__vModel__\":\"f_difficulty\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请选择题目难度\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"}},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"relationTable\":\"make_train_library_single\",\"defaultValue\":[],\"parentVModel\":\"tableField103\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728442522193,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":125,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"multiple\":false,\"__vModel__\":\"f_sort\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请选择分类\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"}},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":104,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441048947,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_full_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请输入题目名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":107,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441191118,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_analyze\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请输入解析\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":108,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441208447,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_answer\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":162,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444695088,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_topic_type\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":121,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项A\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441931352,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_a\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":122,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项B\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441943944,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_b\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":123,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项C\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441946965,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_c\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":124,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项D\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441947535,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_d\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"formId\":130,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728443972724,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_organize_id\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"\",\"type\":\"currOrganize\",\"showLevel\":\"last\"},{\"__config__\":{\"formId\":129,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728443972064,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_time\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":128,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728443971712,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_user_id\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":127,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728443971233,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_time\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"\",\"type\":\"currTime\"},{\"__config__\":{\"formId\":126,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728443970860,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_user_id\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"\",\"type\":\"currUser\"}],\"showTitle\":true,\"complexHeaderList\":[],\"tag\":\"YunzhupaasInputTable\",\"componentName\":\"table103\",\"tableAlign\":\"left\",\"span\":24},\"defaultValue\":[],\"footerBtnsList\":[{\"btnIcon\":\"icon-ym icon-ym-btn-add\",\"show\":false,\"label\":\"添加\",\"btnType\":\"primary\",\"value\":\"add\",\"labelI18nCode\":\"common.add1Text\"},{\"btnIcon\":\"icon-ym icon-ym-btn-clearn\",\"showConfirm\":true,\"show\":true,\"label\":\"批量删除\",\"btnType\":\"danger\",\"value\":\"batchRemove\",\"labelI18nCode\":\"common.batchDelText\"},{\"btnIcon\":\"icon-ym icon-ym-btn-add\",\"actionConfig\":{\"popupType\":\"dialog\",\"hasPage\":true,\"modelId\":\"613648638182162565\",\"popupTitle\":\"选择数据\",\"pageSize\":20,\"columnOptions\":[{\"label\":\"题目难度\",\"ifShow\":true,\"value\":\"f_difficulty\"},{\"label\":\"分类\",\"ifShow\":true,\"value\":\"f_sort\"},{\"label\":\"题目名称\",\"ifShow\":true,\"value\":\"f_full_name\"},{\"label\":\"选项A\",\"ifShow\":true,\"value\":\"f_options_a\"},{\"label\":\"选项B\",\"ifShow\":true,\"value\":\"f_options_b\"},{\"label\":\"选项C\",\"ifShow\":true,\"value\":\"f_options_c\"},{\"label\":\"选项D\",\"ifShow\":true,\"value\":\"f_options_d\"},{\"label\":\"解析\",\"ifShow\":true,\"value\":\"f_analyze\"},{\"label\":\"答案\",\"ifShow\":true,\"value\":\"f_answer\"},{\"label\":\"题目类型\",\"ifShow\":true,\"value\":\"f_topic_type\"}],\"interfaceId\":\"\",\"interfaceName\":\"\",\"relationOptions\":[{\"field\":\"f_difficulty\",\"type\":1,\"value\":\"f_difficulty\"},{\"field\":\"f_sort\",\"type\":1,\"value\":\"f_sort\"},{\"field\":\"f_full_name\",\"type\":1,\"value\":\"f_full_name\"},{\"field\":\"f_analyze\",\"type\":1,\"value\":\"f_analyze\"},{\"field\":\"f_topic_type\",\"type\":1,\"value\":\"f_topic_type\"},{\"field\":\"f_options_a\",\"type\":1,\"value\":\"f_options_a\"},{\"field\":\"f_options_b\",\"type\":1,\"value\":\"f_options_b\"},{\"field\":\"f_options_c\",\"type\":1,\"value\":\"f_options_c\"},{\"field\":\"f_options_d\",\"type\":1,\"value\":\"f_options_d\"}],\"dataSource\":\"relationForm\",\"templateJson\":[],\"popupWidth\":\"800px\"},\"show\":true,\"label\":\"添加单选题\",\"btnType\":\"primary\",\"value\":\"custom4d8619\",\"labelI18nCode\":\"\"}],\"defaultExpandAll\":true,\"__vModel__\":\"tableField103\",\"layoutType\":\"table\",\"disabled\":false,\"columnBtnsList\":[{\"btnIcon\":\"icon-ym icon-ym-btn-edit\",\"show\":true,\"label\":\"复制\",\"btnType\":\"primary\",\"value\":\"copy\",\"labelI18nCode\":\"common.copyText\"},{\"btnIcon\":\"icon-ym icon-ym-btn-clearn\",\"showConfirm\":true,\"show\":true,\"label\":\"删除\",\"btnType\":\"danger\",\"value\":\"remove\",\"labelI18nCode\":\"common.delText\"}],\"summaryField\":[]},{\"showSummary\":false,\"__config__\":{\"formId\":131,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"table\",\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"多选题\",\"showLabel\":false,\"tableName\":\"make_train_library_more\",\"renderKey\":1728444025497,\"layout\":\"rowFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-table\",\"children\":[{\"filterable\":false,\"clearable\":true,\"__config__\":{\"relationTable\":\"make_train_library_more\",\"defaultValue\":\"\",\"parentVModel\":\"tableField131\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":132,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"multiple\":false,\"__vModel__\":\"f_difficulty\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请选择题目难度\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"}},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"relationTable\":\"make_train_library_more\",\"defaultValue\":[],\"parentVModel\":\"tableField131\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":133,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"multiple\":false,\"__vModel__\":\"f_sort\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请选择分类\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"}},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":134,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_full_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请输入题目名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":135,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_analyze\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请输入解析\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":136,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_answer\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":163,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444726177,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_topic_type\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":137,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项A\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_a\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":138,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项B\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_b\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":139,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项C\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_c\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":140,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项D\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_d\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"formId\":141,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_organize_id\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"\",\"type\":\"currOrganize\",\"showLevel\":\"last\"},{\"__config__\":{\"formId\":142,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_time\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":143,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_user_id\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":144,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_time\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"\",\"type\":\"currTime\"},{\"__config__\":{\"formId\":145,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_user_id\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"\",\"type\":\"currUser\"}],\"showTitle\":true,\"complexHeaderList\":[],\"tag\":\"YunzhupaasInputTable\",\"componentName\":\"table131\",\"tableAlign\":\"left\",\"span\":24},\"defaultValue\":[],\"footerBtnsList\":[{\"btnIcon\":\"icon-ym icon-ym-btn-add\",\"show\":false,\"label\":\"添加\",\"btnType\":\"primary\",\"value\":\"add\",\"labelI18nCode\":\"common.add1Text\"},{\"btnIcon\":\"icon-ym icon-ym-btn-clearn\",\"showConfirm\":true,\"show\":true,\"label\":\"批量删除\",\"btnType\":\"danger\",\"value\":\"batchRemove\",\"labelI18nCode\":\"common.batchDelText\"},{\"btnIcon\":\"icon-ym icon-ym-btn-add\",\"actionConfig\":{\"popupType\":\"dialog\",\"hasPage\":true,\"modelId\":\"613655652367073413\",\"popupTitle\":\"选择数据\",\"pageSize\":20,\"columnOptions\":[{\"label\":\"题目难度\",\"ifShow\":true,\"value\":\"f_difficulty\"},{\"label\":\"题目名称\",\"ifShow\":true,\"value\":\"f_full_name\"},{\"label\":\"解析\",\"ifShow\":true,\"value\":\"f_analyze\"},{\"label\":\"答案\",\"ifShow\":true,\"value\":\"f_answer\"},{\"label\":\"题目类型\",\"ifShow\":true,\"value\":\"f_topic_type\"},{\"label\":\"分类\",\"ifShow\":true,\"value\":\"f_sort\"}],\"interfaceId\":\"\",\"interfaceName\":\"\",\"relationOptions\":[{\"field\":\"f_difficulty\",\"type\":1,\"value\":\"f_difficulty\"},{\"field\":\"f_sort\",\"type\":1,\"value\":\"f_sort\"},{\"field\":\"f_full_name\",\"type\":1,\"value\":\"f_full_name\"},{\"field\":\"f_analyze\",\"type\":1,\"value\":\"f_analyze\"},{\"field\":\"f_topic_type\",\"type\":1,\"value\":\"f_topic_type\"},{\"field\":\"f_options_a\",\"type\":1,\"value\":\"f_options_a\"},{\"field\":\"f_options_b\",\"type\":1,\"value\":\"f_options_b\"},{\"field\":\"f_options_c\",\"type\":1,\"value\":\"f_options_c\"},{\"field\":\"f_options_d\",\"type\":1,\"value\":\"f_options_d\"}],\"dataSource\":\"relationForm\",\"templateJson\":[],\"popupWidth\":\"800px\"},\"show\":true,\"label\":\"添加多选题\",\"btnType\":\"primary\",\"value\":\"custom4d8619\",\"labelI18nCode\":\"\"}],\"defaultExpandAll\":true,\"__vModel__\":\"tableField131\",\"layoutType\":\"table\",\"disabled\":false,\"columnBtnsList\":[{\"btnIcon\":\"icon-ym icon-ym-btn-edit\",\"show\":true,\"label\":\"复制\",\"btnType\":\"primary\",\"value\":\"copy\",\"labelI18nCode\":\"common.copyText\"},{\"btnIcon\":\"icon-ym icon-ym-btn-clearn\",\"showConfirm\":true,\"show\":true,\"label\":\"删除\",\"btnType\":\"danger\",\"value\":\"remove\",\"labelI18nCode\":\"common.delText\"}],\"summaryField\":[]},{\"showSummary\":false,\"__config__\":{\"formId\":147,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"table\",\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"判断题\",\"showLabel\":false,\"tableName\":\"make_train_library_judgment\",\"renderKey\":1728444151701,\"layout\":\"rowFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-table\",\"children\":[{\"filterable\":false,\"clearable\":true,\"__config__\":{\"relationTable\":\"make_train_library_judgment\",\"defaultValue\":\"\",\"parentVModel\":\"tableField147\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":148,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"multiple\":false,\"__vModel__\":\"f_difficulty\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请选择题目难度\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"}},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"relationTable\":\"make_train_library_judgment\",\"defaultValue\":[],\"parentVModel\":\"tableField147\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":149,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"multiple\":false,\"__vModel__\":\"f_sort\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请选择分类\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"}},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":150,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_full_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请输入题目名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":151,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_analyze\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请输入解析\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":152,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_answer\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":164,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444750002,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_topic_type\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"formId\":157,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_organize_id\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"\",\"type\":\"currOrganize\",\"showLevel\":\"last\"},{\"__config__\":{\"formId\":158,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_time\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":159,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_user_id\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":160,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_time\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"\",\"type\":\"currTime\"},{\"__config__\":{\"formId\":161,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_user_id\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"\",\"type\":\"currUser\"}],\"showTitle\":true,\"complexHeaderList\":[],\"tag\":\"YunzhupaasInputTable\",\"componentName\":\"table147\",\"tableAlign\":\"left\",\"span\":24},\"defaultValue\":[],\"footerBtnsList\":[{\"btnIcon\":\"icon-ym icon-ym-btn-add\",\"show\":false,\"label\":\"添加\",\"btnType\":\"primary\",\"value\":\"add\",\"labelI18nCode\":\"common.add1Text\"},{\"btnIcon\":\"icon-ym icon-ym-btn-clearn\",\"showConfirm\":true,\"show\":true,\"label\":\"批量删除\",\"btnType\":\"danger\",\"value\":\"batchRemove\",\"labelI18nCode\":\"common.batchDelText\"},{\"btnIcon\":\"icon-ym icon-ym-btn-add\",\"actionConfig\":{\"popupType\":\"dialog\",\"hasPage\":true,\"modelId\":\"613656070291718277\",\"popupTitle\":\"选择数据\",\"pageSize\":20,\"columnOptions\":[{\"label\":\"题目难度\",\"ifShow\":true,\"value\":\"f_difficulty\"},{\"label\":\"题目名称\",\"ifShow\":true,\"value\":\"f_full_name\"},{\"label\":\"解析\",\"ifShow\":true,\"value\":\"f_analyze\"},{\"label\":\"答案\",\"ifShow\":true,\"value\":\"f_answer\"},{\"label\":\"题目类型\",\"ifShow\":true,\"value\":\"f_topic_type\"},{\"label\":\"分类\",\"ifShow\":true,\"value\":\"f_sort\"}],\"interfaceId\":\"\",\"interfaceName\":\"\",\"relationOptions\":[{\"field\":\"f_difficulty\",\"type\":1,\"value\":\"f_difficulty\"},{\"field\":\"f_sort\",\"type\":1,\"value\":\"f_sort\"},{\"field\":\"f_full_name\",\"type\":1,\"value\":\"f_full_name\"},{\"field\":\"f_analyze\",\"type\":1,\"value\":\"f_analyze\"},{\"field\":\"f_topic_type\",\"type\":1,\"value\":\"f_topic_type\"}],\"dataSource\":\"relationForm\",\"templateJson\":[],\"popupWidth\":\"800px\"},\"show\":true,\"label\":\"添加判断题\",\"btnType\":\"primary\",\"value\":\"custom4d8619\",\"labelI18nCode\":\"\"}],\"defaultExpandAll\":true,\"__vModel__\":\"tableField147\",\"layoutType\":\"table\",\"disabled\":false,\"columnBtnsList\":[{\"btnIcon\":\"icon-ym icon-ym-btn-edit\",\"show\":true,\"label\":\"复制\",\"btnType\":\"primary\",\"value\":\"copy\",\"labelI18nCode\":\"common.copyText\"},{\"btnIcon\":\"icon-ym icon-ym-btn-clearn\",\"showConfirm\":true,\"show\":true,\"label\":\"删除\",\"btnType\":\"danger\",\"value\":\"remove\",\"labelI18nCode\":\"common.delText\"}],\"summaryField\":[]},{\"showSummary\":false,\"__config__\":{\"formId\":180,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"table\",\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"问答题\",\"showLabel\":false,\"tableName\":\"make_train_library_essay_question\",\"renderKey\":1729132800868,\"layout\":\"rowFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-table\",\"children\":[{\"filterable\":false,\"clearable\":true,\"__config__\":{\"relationTable\":\"make_train_library_essay_question\",\"defaultValue\":\"\",\"parentVModel\":\"tableField180\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":181,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"multiple\":false,\"__vModel__\":\"f_difficulty\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请选择题目难度\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"}},{\"filterable\":false,\"clearable\":true,\"__config__\":{\"relationTable\":\"make_train_library_essay_question\",\"defaultValue\":[],\"parentVModel\":\"tableField180\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":182,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"multiple\":false,\"__vModel__\":\"f_sort\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请选择分类\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"}},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":183,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_full_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请输入题目名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":184,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_analyze\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请输入解析\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":185,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_answer\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":186,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_topic_type\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"formId\":187,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_organize_id\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"\",\"type\":\"currOrganize\",\"showLevel\":\"last\"},{\"__config__\":{\"formId\":188,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_time\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":189,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_user_id\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":190,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_time\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"\",\"type\":\"currTime\"},{\"__config__\":{\"formId\":191,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_user_id\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"\",\"type\":\"currUser\"}],\"showTitle\":true,\"complexHeaderList\":[],\"tag\":\"YunzhupaasInputTable\",\"componentName\":\"table180\",\"tableAlign\":\"left\",\"span\":24},\"defaultValue\":[],\"footerBtnsList\":[{\"btnIcon\":\"icon-ym icon-ym-btn-add\",\"show\":false,\"label\":\"添加\",\"btnType\":\"primary\",\"value\":\"add\",\"labelI18nCode\":\"common.add1Text\"},{\"btnIcon\":\"icon-ym icon-ym-btn-clearn\",\"showConfirm\":true,\"show\":true,\"label\":\"批量删除\",\"btnType\":\"danger\",\"value\":\"batchRemove\",\"labelI18nCode\":\"common.batchDelText\"},{\"btnIcon\":\"icon-ym icon-ym-btn-add\",\"actionConfig\":{\"popupType\":\"dialog\",\"hasPage\":true,\"modelId\":\"613656070291718277\",\"popupTitle\":\"选择数据\",\"pageSize\":20,\"columnOptions\":[{\"label\":\"题目难度\",\"ifShow\":true,\"value\":\"f_difficulty\"},{\"label\":\"题目名称\",\"ifShow\":true,\"value\":\"f_full_name\"},{\"label\":\"解析\",\"ifShow\":true,\"value\":\"f_analyze\"},{\"label\":\"答案\",\"ifShow\":true,\"value\":\"f_answer\"},{\"label\":\"题目类型\",\"ifShow\":true,\"value\":\"f_topic_type\"},{\"label\":\"分类\",\"ifShow\":true,\"value\":\"f_sort\"}],\"interfaceId\":\"\",\"interfaceName\":\"\",\"relationOptions\":[{\"field\":\"f_difficulty\",\"type\":1,\"value\":\"f_difficulty\"},{\"field\":\"f_sort\",\"type\":1,\"value\":\"f_sort\"},{\"field\":\"f_full_name\",\"type\":1,\"value\":\"f_full_name\"},{\"field\":\"f_analyze\",\"type\":1,\"value\":\"f_analyze\"},{\"field\":\"f_topic_type\",\"type\":1,\"value\":\"f_topic_type\"}],\"dataSource\":\"relationForm\",\"templateJson\":[],\"popupWidth\":\"800px\"},\"show\":true,\"label\":\"添加判断题\",\"btnType\":\"primary\",\"value\":\"custom4d8619\",\"labelI18nCode\":\"\"}],\"defaultExpandAll\":true,\"__vModel__\":\"tableField180\",\"layoutType\":\"table\",\"disabled\":false,\"columnBtnsList\":[{\"btnIcon\":\"icon-ym icon-ym-btn-edit\",\"show\":true,\"label\":\"复制\",\"btnType\":\"primary\",\"value\":\"copy\",\"labelI18nCode\":\"common.copyText\"},{\"btnIcon\":\"icon-ym icon-ym-btn-clearn\",\"showConfirm\":true,\"show\":true,\"label\":\"删除\",\"btnType\":\"danger\",\"value\":\"remove\",\"labelI18nCode\":\"common.delText\"}],\"summaryField\":[]}],\"yunzhupaasKey\":\"tabItem\",\"renderKey\":1728522357849},\"name\":\"1\",\"title\":\"考试信息\"}],\"tag\":\"ATab\",\"componentName\":\"tab165\",\"span\":24},\"tabPosition\":\"top\",\"type\":\"card\"},{\"__config__\":{\"formId\":174,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522993760,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_user_id\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"\",\"type\":\"currUser\"},{\"__config__\":{\"formId\":175,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522994736,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_time\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"\",\"type\":\"currTime\"},{\"__config__\":{\"formId\":176,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLab"); + sb.append( + "el\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522995275,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_user_id\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":179,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728523000852,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_time\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":177,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522996206,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_organize_id\",\"style\":{\"width\":\"100%\"},\"placeholder\":\"\",\"type\":\"currOrganize\",\"showLevel\":\"last\"}],\"span\":24}"); + return sb.toString(); + } + + /** 列表字段配置json */ + public static final String getColumnData() { + StringBuilder sb = new StringBuilder(); + sb.append( + "{\"showSummary\":false,\"treePropsValue\":\"id\",\"columnOptions\":[{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"试卷名称\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":101,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"试卷名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728440990975,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_full_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_full_name\",\"placeholder\":\"请输入试卷名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"试题分类\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441006127,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":102,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"试题分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"f_sort\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_sort\",\"placeholder\":\"请选择试题分类\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"单选题-题目难度\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_single\",\"defaultValue\":\"\",\"parentVModel\":\"tableField103\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441098390,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":105,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"f_difficulty\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField103-f_difficulty\",\"placeholder\":\"请选择题目难度\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"单选题-分类\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_single\",\"defaultValue\":[],\"parentVModel\":\"tableField103\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728442522193,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":125,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"__vModel__\":\"f_sort\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField103-f_sort\",\"placeholder\":\"请选择分类\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单选题-题目名称\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":104,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441048947,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_full_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField103-f_full_name\",\"placeholder\":\"请输入题目名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单选题-解析\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":107,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441191118,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_analyze\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField103-f_analyze\",\"placeholder\":\"请输入解析\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单选题-答案\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":108,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441208447,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_answer\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField103-f_answer\",\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单选题-题目类型\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":162,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444695088,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_topic_type\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField103-f_topic_type\",\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单选题-选项A\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":121,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项A\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441931352,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_a\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField103-f_options_a\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单选题-选项B\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":122,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项B\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441943944,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_b\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField103-f_options_b\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单选题-选项C\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":123,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项C\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441946965,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_c\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField103-f_options_c\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单选题-选项D\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":124,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项D\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441947535,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_d\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField103-f_options_d\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"formId\":130,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728443972724,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_organize_id\",\"fullName\":\"单选题-所属组织\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_organize_id\",\"placeholder\":\"\",\"type\":\"currOrganize\",\"showLevel\":\"last\"},{\"__config__\":{\"formId\":129,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728443972064,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_time\",\"fullName\":\"单选题-修改时间\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_last_modify_time\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":128,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728443971712,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_user_id\",\"fullName\":\"单选题-修改用户\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_last_modify_user_id\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":127,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728443971233,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_time\",\"fullName\":\"单选题-创建时间\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_creator_time\",\"placeholder\":\"\",\"type\":\"currTime\"},{\"__config__\":{\"formId\":126,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728443970860,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_user_id\",\"fullName\":\"单选题-创建用户\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_creator_user_id\",\"placeholder\":\"\",\"type\":\"currUser\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"多选题-题目难度\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_more\",\"defaultValue\":\"\",\"parentVModel\":\"tableField131\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":132,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"f_difficulty\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField131-f_difficulty\",\"placeholder\":\"请选择题目难度\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"多选题-分类\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_more\",\"defaultValue\":[],\"parentVModel\":\"tableField131\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":133,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"__vModel__\":\"f_sort\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField131-f_sort\",\"placeholder\":\"请选择分类\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"多选题-题目名称\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":134,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_full_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField131-f_full_name\",\"placeholder\":\"请输入题目名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"多选题-解析\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":135,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_analyze\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField131-f_analyze\",\"placeholder\":\"请输入解析\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"多选题-答案\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":136,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_answer\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField131-f_answer\",\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"多选题-题目类型\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":163,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444726177,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_topic_type\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField131-f_topic_type\",\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"多选题-选项A\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":137,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项A\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_a\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField131-f_options_a\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"多选题-选项B\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":138,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项B\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_b\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField131-f_options_b\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"多选题-选项C\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":139,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项C\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_c\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField131-f_options_c\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"多选题-选项D\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":140,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项D\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_d\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField131-f_options_d\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"formId\":141,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_organize_id\",\"fullName\":\"多选题-所属组织\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_organize_id\",\"placeholder\":\"\",\"type\":\"currOrganize\",\"showLevel\":\"last\"},{\"__config__\":{\"formId\":142,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_time\",\"fullName\":\"多选题-修改时间\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_last_modify_time\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":143,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_user_id\",\"fullName\":\"多选题-修改用户\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_last_modify_user_id\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":144,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_time\",\"fullName\":\"多选题-创建时间\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_creator_time\",\"placeholder\":\"\",\"type\":\"currTime\"},{\"__config__\":{\"formId\":145,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_user_id\",\"fullName\":\"多选题-创建用户\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_creator_user_id\",\"placeholder\":\"\",\"type\":\"currUser\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"判断题-题目难度\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_judgment\",\"defaultValue\":\"\",\"parentVModel\":\"tableField147\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":148,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"f_difficulty\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField147-f_difficulty\",\"placeholder\":\"请选择题目难度\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"判断题-分类\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_judgment\",\"defaultValue\":[],\"parentVModel\":\"tableField147\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":149,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"__vModel__\":\"f_sort\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField147-f_sort\",\"placeholder\":\"请选择分类\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"判断题-题目名称\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":150,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_full_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField147-f_full_name\",\"placeholder\":\"请输入题目名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"判断题-解析\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":151,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_analyze\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField147-f_analyze\",\"placeholder\":\"请输入解析\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"判断题-答案\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":152,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_answer\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField147-f_answer\",\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"判断题-题目类型\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":164,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444750002,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_topic_type\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField147-f_topic_type\",\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"formId\":157,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_organize_id\",\"fullName\":\"判断题-所属组织\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_organize_id\",\"placeholder\":\"\",\"type\":\"currOrganize\",\"showLevel\":\"last\"},{\"__config__\":{\"formId\":158,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_time\",\"fullName\":\"判断题-修改时间\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_last_modify_time\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":159,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_user_id\",\"fullName\":\"判断题-修改用户\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_last_modify_user_id\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":160,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_time\",\"fullName\":\"判断题-创建时间\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_creator_time\",\"placeholder\":\"\",\"type\":\"currTime\"},{\"__config__\":{\"formId\":161,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_user_id\",\"fullName\":\"判断题-创建用户\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_creator_user_id\",\"placeholder\":\"\",\"type\":\"currUser\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"问答题-题目难度\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_essay_question\",\"defaultValue\":\"\",\"parentVModel\":\"tableField180\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":181,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"f_difficulty\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField180-f_difficulty\",\"placeholder\":\"请选择题目难度\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"问答题-分类\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_essay_question\",\"defaultValue\":[],\"parentVModel\":\"tableField180\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":182,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"__vModel__\":\"f_sort\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField180-f_sort\",\"placeholder\":\"请选择分类\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"问答题-题目名称\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":183,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_full_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField180-f_full_name\",\"placeholder\":\"请输入题目名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"问答题-解析\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":184,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_analyze\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField180-f_analyze\",\"placeholder\":\"请输入解析\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"问答题-答案\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":185,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_answer\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField180-f_answer\",\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"问答题-题目类型\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":186,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_topic_type\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField180-f_topic_type\",\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"formId\":187,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_organize_id\",\"fullName\":\"问答题-所属组织\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_organize_id\",\"placeholder\":\"\",\"type\":\"currOrganize\",\"showLevel\":\"last\"},{\"__config__\":{\"formId\":188,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_time\",\"fullName\":\"问答题-修改时间\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_last_modify_time\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":189,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_user_id\",\"fullName\":\"问答题-修改用户\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_last_modify_user_id\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":190,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_time\",\"fullName\":\"问答题-创建时间\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_creator_time\",\"placeholder\":\"\",\"type\":\"currTime\"},{\"__config__\":{\"formId\":191,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_user_id\",\"fullName\":\"问答题-创建用户\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_creator_user_id\",\"placeholder\":\"\",\"type\":\"currUser\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"考试名称\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":168,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"考试名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522405114,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_examination_title\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_examination_title\",\"placeholder\":\"请输入考试名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"format\":\"yyyy-MM-dd HH:mm:ss\",\"fullName\":\"考试开始时间\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522473033,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":169,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"datePicker\",\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"考试开始时间\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"f_start_time\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_start_time\",\"placeholder\":\"请选择考试开始时间\"},{\"clearable\":true,\"format\":\"yyyy-MM-dd HH:mm:ss\",\"fullName\":\"考试结束日期\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522792281,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":170,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"datePicker\",\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"考试结束日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"f_end_time\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_end_time\",\"placeholder\":\"请选择考试结束日期\"},{\"controls\":true,\"fullName\":\"考试时长(分钟)\",\"fullNameI18nCode\":[\"\"],\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"\",\"__config__\":{\"formId\":171,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"inputNumber\",\"defaultValue\":45,\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"labelWidth\":140,\"className\":[],\"label\":\"考试时长(分钟)\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522828038,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"min\":45,\"__vModel__\":\"f_examination_duration\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"f_examination_duration\",\"placeholder\":\"请输入考试时长(分钟)\",\"addonBefore\":\"\"},{\"controls\":true,\"fullName\":\"合格分数\",\"fullNameI18nCode\":[\"\"],\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"\",\"__config__\":{\"formId\":172,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"inputNumber\",\"defaultValue\":60,\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"合格分数\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522931371,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"min\":60,\"__vModel__\":\"f_passing_score\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"f_passing_score\",\"placeholder\":\"请输入考试时长(分钟)\",\"addonBefore\":\"\"},{\"ableRelationIds\":[],\"clearable\":true,\"ableIds\":[],\"multiple\":true,\"fullName\":\"考试人员\",\"fullNameI18nCode\":[\"\"],\"relationField\":\"\",\"__config__\":{\"formId\":173,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"userSelect\",\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"考试人员\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522972253,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-user\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasUserSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"f_examiners\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"f_examiners\",\"placeholder\":\"请选择考试人员\"},{\"__config__\":{\"formId\":174,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522993760,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_user_id\",\"fullName\":\"创建用户\",\"fullNameI18nCode\":[\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"f_creator_user_id\",\"placeholder\":\"\",\"type\":\"currUser\"},{\"__config__\":{\"formId\":175,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522994736,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_time\",\"fullName\":\"创建时间\",\"fullNameI18nCode\":[\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"f_creator_time\",\"placeholder\":\"\",\"type\":\"currTime\"},{\"__config__\":{\"formId\":176,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522995275,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_user_id\",\"fullName\":\"修改用户\",\"fullNameI18nCode\":[\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"f_last_modify_user_id\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":179,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728523000852,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_time\",\"fullName\":\"修改时间\",\"fullNameI18nCode\":[\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"f_last_modify_time\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":177,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":17285229"); + sb.append( + "96206,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_organize_id\",\"fullName\":\"所属组织\",\"fullNameI18nCode\":[\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"f_organize_id\",\"placeholder\":\"\",\"type\":\"currOrganize\",\"showLevel\":\"last\"}],\"pageSize\":20,\"type\":1,\"columnBtnsList\":[{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-edit\",\"label\":\"考试\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"edit\",\"labelI18nCode\":\"ks\"},{\"show\":false,\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"删除\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"remove\",\"labelI18nCode\":\"common.delText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-generator-menu\",\"label\":\"详情\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"detail\",\"labelI18nCode\":\"common.detailText\"}],\"treeTitle\":\"左侧标题\",\"defaultColumnList\":[{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":101,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"试卷名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728440990975,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"f_full_name\",\"__vModel__\":\"f_full_name\",\"checked\":true,\"disabled\":false,\"id\":\"f_full_name\",\"placeholder\":\"请输入试卷名称\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"试卷名称\",\"label\":\"试卷名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"select\",\"multiple\":false,\"fullName\":\"试题分类\",\"fullNameI18nCode\":[\"\"],\"label\":\"试题分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441006127,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":102,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"试题分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"f_sort\",\"__vModel__\":\"f_sort\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_sort\",\"placeholder\":\"请选择试题分类\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"select\",\"multiple\":false,\"fullName\":\"单选题-题目难度\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"单选题-题目难度\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_single\",\"defaultValue\":\"\",\"parentVModel\":\"tableField103\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441098390,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":105,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"tableField103-f_difficulty\",\"__vModel__\":\"f_difficulty\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField103-f_difficulty\",\"placeholder\":\"请选择题目难度\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"cascader\",\"multiple\":false,\"fullName\":\"单选题-分类\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"单选题-分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_single\",\"defaultValue\":[],\"parentVModel\":\"tableField103\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728442522193,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":125,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"tableField103-f_sort\",\"__vModel__\":\"f_sort\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField103-f_sort\",\"placeholder\":\"请选择分类\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":104,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441048947,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField103-f_full_name\",\"__vModel__\":\"f_full_name\",\"checked\":false,\"disabled\":true,\"id\":\"tableField103-f_full_name\",\"placeholder\":\"请输入题目名称\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"单选题-题目名称\",\"label\":\"单选题-题目名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":107,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441191118,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField103-f_analyze\",\"__vModel__\":\"f_analyze\",\"checked\":false,\"disabled\":true,\"id\":\"tableField103-f_analyze\",\"placeholder\":\"请输入解析\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"单选题-解析\",\"label\":\"单选题-解析\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":108,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441208447,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField103-f_answer\",\"__vModel__\":\"f_answer\",\"checked\":false,\"disabled\":true,\"id\":\"tableField103-f_answer\",\"placeholder\":\"请输入题目类型\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"单选题-答案\",\"label\":\"单选题-答案\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":162,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444695088,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField103-f_topic_type\",\"__vModel__\":\"f_topic_type\",\"checked\":false,\"disabled\":true,\"id\":\"tableField103-f_topic_type\",\"placeholder\":\"请输入题目类型\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"单选题-题目类型\",\"label\":\"单选题-题目类型\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":121,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项A\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441931352,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField103-f_options_a\",\"__vModel__\":\"f_options_a\",\"checked\":false,\"disabled\":false,\"id\":\"tableField103-f_options_a\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"单选题-选项A\",\"label\":\"单选题-选项A\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":122,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项B\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441943944,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField103-f_options_b\",\"__vModel__\":\"f_options_b\",\"checked\":false,\"disabled\":false,\"id\":\"tableField103-f_options_b\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"单选题-选项B\",\"label\":\"单选题-选项B\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":123,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项C\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441946965,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField103-f_options_c\",\"__vModel__\":\"f_options_c\",\"checked\":false,\"disabled\":false,\"id\":\"tableField103-f_options_c\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"单选题-选项C\",\"label\":\"单选题-选项C\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":124,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项D\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441947535,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField103-f_options_d\",\"__vModel__\":\"f_options_d\",\"checked\":false,\"disabled\":false,\"id\":\"tableField103-f_options_d\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"单选题-选项D\",\"label\":\"单选题-选项D\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"currOrganize\",\"fullName\":\"单选题-所属组织\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"单选题-所属组织\",\"sortable\":false,\"align\":\"left\",\"type\":\"currOrganize\",\"__config__\":{\"formId\":130,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728443972724,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField103-f_organize_id\",\"__vModel__\":\"f_organize_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_organize_id\",\"placeholder\":\"\",\"showLevel\":\"last\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyTime\",\"fullName\":\"单选题-修改时间\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"单选题-修改时间\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":129,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728443972064,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField103-f_last_modify_time\",\"__vModel__\":\"f_last_modify_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_last_modify_time\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyUser\",\"fullName\":\"单选题-修改用户\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"单选题-修改用户\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":128,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728443971712,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField103-f_last_modify_user_id\",\"__vModel__\":\"f_last_modify_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_last_modify_user_id\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createTime\",\"fullName\":\"单选题-创建时间\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"单选题-创建时间\",\"sortable\":false,\"align\":\"left\",\"type\":\"currTime\",\"__config__\":{\"formId\":127,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728443971233,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField103-f_creator_time\",\"__vModel__\":\"f_creator_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_creator_time\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createUser\",\"fullName\":\"单选题-创建用户\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"单选题-创建用户\",\"sortable\":false,\"align\":\"left\",\"type\":\"currUser\",\"__config__\":{\"formId\":126,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728443970860,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField103-f_creator_user_id\",\"__vModel__\":\"f_creator_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_creator_user_id\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"select\",\"multiple\":false,\"fullName\":\"多选题-题目难度\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"多选题-题目难度\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_more\",\"defaultValue\":\"\",\"parentVModel\":\"tableField131\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":132,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"tableField131-f_difficulty\",\"__vModel__\":\"f_difficulty\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField131-f_difficulty\",\"placeholder\":\"请选择题目难度\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"cascader\",\"multiple\":false,\"fullName\":\"多选题-分类\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"多选题-分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_more\",\"defaultValue\":[],\"parentVModel\":\"tableField131\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":133,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"tableField131-f_sort\",\"__vModel__\":\"f_sort\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField131-f_sort\",\"placeholder\":\"请选择分类\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":134,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField131-f_full_name\",\"__vModel__\":\"f_full_name\",\"checked\":false,\"disabled\":true,\"id\":\"tableField131-f_full_name\",\"placeholder\":\"请输入题目名称\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"多选题-题目名称\",\"label\":\"多选题-题目名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":135,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField131-f_analyze\",\"__vModel__\":\"f_analyze\",\"checked\":false,\"disabled\":true,\"id\":\"tableField131-f_analyze\",\"placeholder\":\"请输入解析\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"多选题-解析\",\"label\":\"多选题-解析\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":136,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField131-f_answer\",\"__vModel__\":\"f_answer\",\"checked\":false,\"disabled\":true,\"id\":\"tableField131-f_answer\",\"placeholder\":\"请输入题目类型\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"多选题-答案\",\"label\":\"多选题-答案\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":163,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444726177,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField131-f_topic_type\",\"__vModel__\":\"f_topic_type\",\"checked\":false,\"disabled\":true,\"id\":\"tableField131-f_topic_type\",\"placeholder\":\"请输入题目类型\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"多选题-题目类型\",\"label\":\"多选题-题目类型\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":137,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项A\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField131-f_options_a\",\"__vModel__\":\"f_options_a\",\"checked\":false,\"disabled\":false,\"id\":\"tableField131-f_options_a\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"多选题-选项A\",\"label\":\"多选题-选项A\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":138,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项B\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField131-f_options_b\",\"__vModel__\":\"f_options_b\",\"checked\":false,\"disabled\":false,\"id\":\"tableField131-f_options_b\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"多选题-选项B\",\"label\":\"多选题-选项B\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":139,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项C\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField131-f_options_c\",\"__vModel__\":\"f_options_c\",\"checked\":false,\"disabled\":false,\"id\":\"tableField131-f_options_c\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"多选题-选项C\",\"label\":\"多选题-选项C\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":140,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项D\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField131-f_options_d\",\"__vModel__\":\"f_options_d\",\"checked\":false,\"disabled\":false,\"id\":\"tableField131-f_options_d\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"多选题-选项D\",\"label\":\"多选题-选项D\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"currOrganize\",\"fullName\":\"多选题-所属组织\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"多选题-所属组织\",\"sortable\":false,\"align\":\"left\",\"type\":\"currOrganize\",\"__config__\":{\"formId\":141,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField131-f_organize_id\",\"__vModel__\":\"f_organize_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_organize_id\",\"placeholder\":\"\",\"showLevel\":\"last\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyTime\",\"fullName\":\"多选题-修改时间\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"多选题-修改时间\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":142,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField131-f_last_modify_time\",\"__vModel__\":\"f_last_modify_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_last_modify_time\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyUser\",\"fullName\":\"多选题-修改用户\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"多选题-修改用户\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":143,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField131-f_last_modify_user_id\",\"__vModel__\":\"f_last_modify_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_last_modify_user_id\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createTime\",\"fullName\":\"多选题-创建时间\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"多选题-创建时间\",\"sortable\":false,\"align\":\"left\",\"type\":\"currTime\",\"__config__\":{\"formId\":144,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField131-f_creator_time\",\"__vModel__\":\"f_creator_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_creator_time\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createUser\",\"fullName\":\"多选题-创建用户\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"多选题-创建用户\",\"sortable\":false,\"align\":\"left\",\"type\":\"currUser\",\"__config__\":{\"formId\":145,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField131-f_creator_user_id\",\"__vModel__\":\"f_creator_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_creator_user_id\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"select\",\"multiple\":false,\"fullName\":\"判断题-题目难度\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"判断题-题目难度\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_judgment\",\"defaultValue\":\"\",\"parentVModel\":\"tableField147\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":148,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"tableField147-f_difficulty\",\"__vModel__\":\"f_difficulty\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField147-f_difficulty\",\"placeholder\":\"请选择题目难度\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"cascader\",\"multiple\":false,\"fullName\":\"判断题-分类\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"判断题-分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_judgment\",\"defaultValue\":[],\"parentVModel\":\"tableField147\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":149,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"tableField147-f_sort\",\"__vModel__\":\"f_sort\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField147-f_sort\",\"placeholder\":\"请选择分类\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":150,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField147-f_full_name\",\"__vModel__\":\"f_full_name\",\"checked\":false,\"disabled\":true,\"id\":\"tableField147-f_full_name\",\"placeholder\":\"请输入题目名称\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"判断题-题目名称\",\"label\":\"判断题-题目名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":151,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField147-f_analyze\",\"__vModel__\":\"f_analyze\",\"checked\":false,\"disabled\":true,\"id\":\"tableField147-f_analyze\",\"placeholder\":\"请输入解析\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"判断题-解析\",\"label\":\"判断题-解析\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":152,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField147-f_answer\",\"__vModel__\":\"f_answer\",\"checked\":false,\"disabled\":true,\"id\":\"tableField147-f_answer\",\"placeholder\":\"请输入题目类型\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"判断题-答案\",\"label\":\"判断题-答案\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":164,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444750002,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField147-f_topic_type\",\"__vModel__\":\"f_topic_type\",\"checked\":false,\"disabled\":true,\"id\":\"tableField147-f_topic_type\",\"placeholder\":\"请输入题目类型\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"判断题-题目类型\",\"label\":\"判断题-题目类型\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"currOrganize\",\"fullName\":\"判断题-所属组织\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"判断题-所属组织\",\"sortable\":false,\"align\":\"left\",\"type\":\"currOrganize\",\"__config__\":{\"formId\":157,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField147-f_organize_id\",\"__vModel__\":\"f_organize_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_organize_id\",\"placeholder\":\"\",\"showLevel\":\"last\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyTime\",\"fullName\":\"判断题-修改时间\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"判断题-修改时间\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":158,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField147-f_last_modify_time\",\"__vModel__\":\"f_last_modify_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_last_modify_time\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyUser\",\"fullName\":\"判断题-修改用户\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"判断题-修改用户\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":159,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField147-f_last_modify_user_id\",\"__vModel__\":\"f_last_modify_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_last_modify_user_id\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createTime\",\"fullName\":\"判断题-创建时间\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"判断题-创建时间\",\"sortable\":false,\"align\":\"left\",\"type\":\"currTime\",\"__config__\":{\"formId\":160,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField147-f_creator_time\",\"__vModel__\":\"f_creator_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_creator_time\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createUser\",\"fullName\":\"判断题-创建用户\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"判断题-创建用户\",\"sortable\":false,\"align\":\"left\",\"type\":\"currUser\",\"__config__\":{\"formId\":161,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField147-f_creator_user_id\",\"__vModel__\":\"f_creator_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_creator_user_id\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"select\",\"multiple\":false,\"fullName\":\"问答题-题目难度\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"问答题-题目难度\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_essay_question\",\"defaultValue\":\"\",\"parentVModel\":\"tableField180\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":181,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"tableField180-f_difficulty\",\"__vModel__\":\"f_difficulty\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField180-f_difficulty\",\"placeholder\":\"请选择题目难度\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"cascader\",\"multiple\":false,\"fullName\":\"问答题-分类\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"问答题-分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_essay_question\",\"defaultValue\":[],\"parentVModel\":\"tableField180\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":182,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"tableField180-f_sort\",\"__vModel__\":\"f_sort\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField180-f_sort\",\"placeholder\":\"请选择分类\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":183,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField180-f_full_name\",\"__vModel__\":\"f_full_name\",\"checked\":false,\"disabled\":true,\"id\":\"tableField180-f_full_name\",\"placeholder\":\"请输入题目名称\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"问答题-题目名称\",\"label\":\"问答题-题目名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":184,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField180-f_analyze\",\"__vModel__\":\"f_analyze\",\"checked\":false,\"disabled\":true,\"id\":\"tableField180-f_analyze\",\"placeholder\":\"请输入解析\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"问答题-解析\",\"label\":\"问答题-解析\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":185,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField180-f_answer\",\"__vModel__\":\"f_answer\",\"checked\":false,\"disabled\":true,\"id\":\"tableField180-f_answer\",\"placeholder\":\"请输入题目类型\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"问答题-答案\",\"label\":\"问答题-答案\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":186,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField180-f_topic_type\",\"__vModel__\":\"f_topic_type\",\"checked\":false,\"disabled\":true,\"id\":\"tableField180-f_topic_type\",\"placeholder\":\"请输入题目类型\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"问答题-题目类型\",\"label\":\"问答题-题目类型\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"currOrganize\",\"fullName\":\"问答题-所属组织\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"问答题-所属组织\",\"sortable\":false,\"align\":\"left\",\"type\":\"currOrganize\",\"__config__\":{\"formId\":187,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField180-f_organize_id\",\"__vModel__\":\"f_organize_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_organize_id\",\"placeholder\":\"\",\"showLevel\":\"last\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyTime\",\"fullName\":\"问答题-修改时间\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"问答题-修改时间\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":188,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField180-f_last_modify_time\",\"__vModel__\":\"f_last_modify_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_last_modify_time\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyUser\",\"fullName\":\"问答题-修改用户\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"问答题-修改用户\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":189,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":17"); + sb.append( + "29132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField180-f_last_modify_user_id\",\"__vModel__\":\"f_last_modify_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_last_modify_user_id\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createTime\",\"fullName\":\"问答题-创建时间\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"问答题-创建时间\",\"sortable\":false,\"align\":\"left\",\"type\":\"currTime\",\"__config__\":{\"formId\":190,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField180-f_creator_time\",\"__vModel__\":\"f_creator_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_creator_time\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createUser\",\"fullName\":\"问答题-创建用户\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"问答题-创建用户\",\"sortable\":false,\"align\":\"left\",\"type\":\"currUser\",\"__config__\":{\"formId\":191,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField180-f_creator_user_id\",\"__vModel__\":\"f_creator_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_creator_user_id\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":168,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"考试名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522405114,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"f_examination_title\",\"__vModel__\":\"f_examination_title\",\"checked\":false,\"disabled\":false,\"id\":\"f_examination_title\",\"placeholder\":\"请输入考试名称\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"考试名称\",\"label\":\"考试名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"clearable\":true,\"yunzhupaasKey\":\"datePicker\",\"format\":\"yyyy-MM-dd HH:mm:ss\",\"fullName\":\"考试开始时间\",\"fullNameI18nCode\":[\"\"],\"label\":\"考试开始时间\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522473033,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":169,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"datePicker\",\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"考试开始时间\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"f_start_time\",\"__vModel__\":\"f_start_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_start_time\",\"placeholder\":\"请选择考试开始时间\",\"labelI18nCode\":\"\"},{\"clearable\":true,\"yunzhupaasKey\":\"datePicker\",\"format\":\"yyyy-MM-dd HH:mm:ss\",\"fullName\":\"考试结束日期\",\"fullNameI18nCode\":[\"\"],\"label\":\"考试结束日期\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522792281,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":170,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"datePicker\",\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"考试结束日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"f_end_time\",\"__vModel__\":\"f_end_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_end_time\",\"placeholder\":\"请选择考试结束日期\",\"labelI18nCode\":\"\"},{\"controls\":true,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":171,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"inputNumber\",\"defaultValue\":45,\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"labelWidth\":140,\"className\":[],\"label\":\"考试时长(分钟)\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522828038,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"min\":45,\"prop\":\"f_examination_duration\",\"__vModel__\":\"f_examination_duration\",\"checked\":false,\"disabled\":false,\"id\":\"f_examination_duration\",\"placeholder\":\"请输入考试时长(分钟)\",\"addonBefore\":\"\",\"yunzhupaasKey\":\"inputNumber\",\"fullName\":\"考试时长(分钟)\",\"label\":\"考试时长(分钟)\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"controls\":true,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":172,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"inputNumber\",\"defaultValue\":60,\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"合格分数\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522931371,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"min\":60,\"prop\":\"f_passing_score\",\"__vModel__\":\"f_passing_score\",\"checked\":false,\"disabled\":false,\"id\":\"f_passing_score\",\"placeholder\":\"请输入考试时长(分钟)\",\"addonBefore\":\"\",\"yunzhupaasKey\":\"inputNumber\",\"fullName\":\"合格分数\",\"label\":\"合格分数\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"ableRelationIds\":[],\"clearable\":true,\"yunzhupaasKey\":\"userSelect\",\"ableIds\":[],\"multiple\":true,\"fullName\":\"考试人员\",\"fullNameI18nCode\":[\"\"],\"label\":\"考试人员\",\"sortable\":false,\"align\":\"left\",\"relationField\":\"\",\"__config__\":{\"formId\":173,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"userSelect\",\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"考试人员\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522972253,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-user\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasUserSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"f_examiners\",\"__vModel__\":\"f_examiners\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"f_examiners\",\"placeholder\":\"请选择考试人员\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createUser\",\"fullName\":\"创建用户\",\"fullNameI18nCode\":[\"\"],\"label\":\"创建用户\",\"sortable\":false,\"align\":\"left\",\"type\":\"currUser\",\"__config__\":{\"formId\":174,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522993760,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"f_creator_user_id\",\"__vModel__\":\"f_creator_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"f_creator_user_id\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createTime\",\"fullName\":\"创建时间\",\"fullNameI18nCode\":[\"\"],\"label\":\"创建时间\",\"sortable\":false,\"align\":\"left\",\"type\":\"currTime\",\"__config__\":{\"formId\":175,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522994736,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"f_creator_time\",\"__vModel__\":\"f_creator_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"f_creator_time\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyUser\",\"fullName\":\"修改用户\",\"fullNameI18nCode\":[\"\"],\"label\":\"修改用户\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":176,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522995275,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"f_last_modify_user_id\",\"__vModel__\":\"f_last_modify_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"f_last_modify_user_id\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyTime\",\"fullName\":\"修改时间\",\"fullNameI18nCode\":[\"\"],\"label\":\"修改时间\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":179,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728523000852,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"f_last_modify_time\",\"__vModel__\":\"f_last_modify_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"f_last_modify_time\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"currOrganize\",\"fullName\":\"所属组织\",\"fullNameI18nCode\":[\"\"],\"label\":\"所属组织\",\"sortable\":false,\"align\":\"left\",\"type\":\"currOrganize\",\"__config__\":{\"formId\":177,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522996206,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"f_organize_id\",\"__vModel__\":\"f_organize_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"f_organize_id\",\"placeholder\":\"\",\"showLevel\":\"last\",\"labelI18nCode\":\"\"}],\"treeRelationFieldAbleIds\":[],\"treeSyncInterfaceName\":\"\",\"treeSyncTemplateJson\":[],\"treeRelation\":\"\",\"defaultSortConfig\":[],\"tabConfig\":{\"hasAllTab\":true,\"relationField\":\"\",\"on\":false},\"hasSuperQuery\":true,\"treePropsLabel\":\"fullName\",\"groupField\":\"\",\"printIds\":[],\"uploaderTemplateJson\":{},\"hasTreeQuery\":false,\"useFormPermission\":true,\"complexHeaderList\":[],\"useBtnPermission\":true,\"treeSyncType\":0,\"hasPage\":true,\"searchList\":[{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"showCount\":false,\"__config__\":{\"formId\":101,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"试卷名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728440990975,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"f_full_name\",\"__vModel__\":\"f_full_name\",\"searchMultiple\":false,\"disabled\":false,\"id\":\"f_full_name\",\"placeholder\":\"请输入试卷名称\",\"addonBefore\":\"\",\"clearable\":true,\"searchType\":2,\"yunzhupaasKey\":\"input\",\"fullName\":\"试卷名称\",\"label\":\"试卷名称\",\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"isKeyword\":false,\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"searchType\":1,\"yunzhupaasKey\":\"select\",\"multiple\":false,\"fullName\":\"试题分类\",\"fullNameI18nCode\":[\"\"],\"label\":\"试题分类\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441006127,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":102,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"试题分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"f_sort\",\"__vModel__\":\"f_sort\",\"searchMultiple\":true,\"isKeyword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_sort\",\"placeholder\":\"请选择试题分类\",\"labelI18nCode\":\"\"}],\"ruleList\":{\"conditionList\":[],\"matchLogic\":\"and\"},\"childTableStyle\":1,\"treePropsChildren\":\"children\",\"treeRelationFieldSelectType\":\"all\",\"showOverflow\":true,\"treeTemplateJson\":[],\"treeTitleI18nCode\":\"\",\"treePropsName\":\"\",\"useColumnPermission\":true,\"treePropsUrl\":\"\",\"btnsList\":[{\"show\":false,\"icon\":\"icon-ym icon-ym-btn-add\",\"label\":\"新增\",\"value\":\"add\",\"labelI18nCode\":\"common.add2Text\"},{\"show\":false,\"icon\":\"icon-ym icon-ym-btn-download\",\"label\":\"导出\",\"value\":\"download\",\"labelI18nCode\":\"common.exportText\"},{\"show\":false,\"icon\":\"icon-ym icon-ym-btn-upload\",\"label\":\"导入\",\"value\":\"upload\",\"labelI18nCode\":\"common.importText\"},{\"show\":false,\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"批量删除\",\"value\":\"batchRemove\",\"labelI18nCode\":\"common.batchDelText\"},{\"show\":false,\"icon\":\"icon-ym icon-ym-report-icon-preview-printPreview\",\"label\":\"批量打印\",\"value\":\"batchPrint\",\"labelI18nCode\":\"common.batchPrintText\"}],\"useDataPermission\":true,\"columnList\":[{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":101,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"试卷名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728440990975,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"f_full_name\",\"__vModel__\":\"f_full_name\",\"disabled\":false,\"id\":\"f_full_name\",\"placeholder\":\"请输入试卷名称\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"试卷名称\",\"label\":\"试卷名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"select\",\"multiple\":false,\"fullName\":\"试题分类\",\"fullNameI18nCode\":[\"\"],\"label\":\"试题分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441006127,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":102,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"试题分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"f_sort\",\"__vModel__\":\"f_sort\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_sort\",\"placeholder\":\"请选择试题分类\",\"labelI18nCode\":\"\"}],\"summaryField\":[],\"parentField\":\"\",\"treeDataSource\":\"dictionary\",\"treeDictionary\":\"\",\"treeSyncInterfaceId\":\"\",\"customBtnsList\":[]}"); + return sb.toString(); + } + + /** app列表字段配置json */ + public static final String getAppColumnData() { + StringBuilder sb = new StringBuilder(); + sb.append( + "{\"hasPage\":true,\"useColumnPermission\":false,\"searchList\":[],\"btnsList\":[{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-add\",\"label\":\"新增\",\"value\":\"add\",\"labelI18nCode\":\"common.add2Text\"}],\"useDataPermission\":false,\"ruleListApp\":{\"conditionList\":[],\"matchLogic\":\"and\"},\"columnList\":[{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":101,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"试卷名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728440990975,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"f_full_name\",\"__vModel__\":\"f_full_name\",\"disabled\":false,\"id\":\"f_full_name\",\"placeholder\":\"请输入试卷名称\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"试卷名称\",\"label\":\"试卷名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"select\",\"multiple\":false,\"fullName\":\"试题分类\",\"fullNameI18nCode\":[\"\"],\"label\":\"试题分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441006127,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":102,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"试题分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"f_sort\",\"__vModel__\":\"f_sort\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_sort\",\"placeholder\":\"请选择试题分类\",\"labelI18nCode\":\"\"}],\"columnOptions\":[{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"试卷名称\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":101,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"试卷名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728440990975,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_full_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_full_name\",\"placeholder\":\"请输入试卷名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"试题分类\",\"fullNameI18nCode\":[\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441006127,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":102,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"试题分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"f_sort\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_sort\",\"placeholder\":\"请选择试题分类\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"单选题-题目难度\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_single\",\"defaultValue\":\"\",\"parentVModel\":\"tableField103\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441098390,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":105,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"f_difficulty\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField103-f_difficulty\",\"placeholder\":\"请选择题目难度\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"单选题-分类\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_single\",\"defaultValue\":[],\"parentVModel\":\"tableField103\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728442522193,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":125,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"__vModel__\":\"f_sort\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField103-f_sort\",\"placeholder\":\"请选择分类\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单选题-题目名称\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":104,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441048947,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_full_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField103-f_full_name\",\"placeholder\":\"请输入题目名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单选题-解析\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":107,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441191118,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_analyze\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField103-f_analyze\",\"placeholder\":\"请输入解析\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单选题-答案\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":108,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441208447,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_answer\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField103-f_answer\",\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单选题-题目类型\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":162,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444695088,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_topic_type\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField103-f_topic_type\",\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单选题-选项A\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":121,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项A\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441931352,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_a\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField103-f_options_a\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单选题-选项B\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":122,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项B\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441943944,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_b\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField103-f_options_b\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单选题-选项C\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":123,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项C\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441946965,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_c\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField103-f_options_c\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"单选题-选项D\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":124,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项D\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441947535,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_d\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField103-f_options_d\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"formId\":130,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728443972724,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_organize_id\",\"fullName\":\"单选题-所属组织\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_organize_id\",\"placeholder\":\"\",\"type\":\"currOrganize\",\"showLevel\":\"last\"},{\"__config__\":{\"formId\":129,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728443972064,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_time\",\"fullName\":\"单选题-修改时间\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_last_modify_time\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":128,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728443971712,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_user_id\",\"fullName\":\"单选题-修改用户\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_last_modify_user_id\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":127,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728443971233,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_time\",\"fullName\":\"单选题-创建时间\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_creator_time\",\"placeholder\":\"\",\"type\":\"currTime\"},{\"__config__\":{\"formId\":126,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728443970860,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_user_id\",\"fullName\":\"单选题-创建用户\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_creator_user_id\",\"placeholder\":\"\",\"type\":\"currUser\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"多选题-题目难度\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_more\",\"defaultValue\":\"\",\"parentVModel\":\"tableField131\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":132,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"f_difficulty\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField131-f_difficulty\",\"placeholder\":\"请选择题目难度\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"多选题-分类\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_more\",\"defaultValue\":[],\"parentVModel\":\"tableField131\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":133,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"__vModel__\":\"f_sort\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField131-f_sort\",\"placeholder\":\"请选择分类\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"多选题-题目名称\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":134,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_full_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField131-f_full_name\",\"placeholder\":\"请输入题目名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"多选题-解析\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":135,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_analyze\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField131-f_analyze\",\"placeholder\":\"请输入解析\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"多选题-答案\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":136,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_answer\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField131-f_answer\",\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"多选题-题目类型\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":163,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444726177,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_topic_type\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField131-f_topic_type\",\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"多选题-选项A\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":137,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项A\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_a\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField131-f_options_a\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"多选题-选项B\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":138,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项B\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_b\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField131-f_options_b\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"多选题-选项C\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":139,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项C\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_c\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField131-f_options_c\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"多选题-选项D\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":140,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项D\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_options_d\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"tableField131-f_options_d\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"formId\":141,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_organize_id\",\"fullName\":\"多选题-所属组织\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_organize_id\",\"placeholder\":\"\",\"type\":\"currOrganize\",\"showLevel\":\"last\"},{\"__config__\":{\"formId\":142,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_time\",\"fullName\":\"多选题-修改时间\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_last_modify_time\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":143,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_user_id\",\"fullName\":\"多选题-修改用户\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_last_modify_user_id\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":144,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_time\",\"fullName\":\"多选题-创建时间\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_creator_time\",\"placeholder\":\"\",\"type\":\"currTime\"},{\"__config__\":{\"formId\":145,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_user_id\",\"fullName\":\"多选题-创建用户\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_creator_user_id\",\"placeholder\":\"\",\"type\":\"currUser\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"判断题-题目难度\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_judgment\",\"defaultValue\":\"\",\"parentVModel\":\"tableField147\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":148,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"f_difficulty\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField147-f_difficulty\",\"placeholder\":\"请选择题目难度\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"判断题-分类\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_judgment\",\"defaultValue\":[],\"parentVModel\":\"tableField147\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":149,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"__vModel__\":\"f_sort\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField147-f_sort\",\"placeholder\":\"请选择分类\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"判断题-题目名称\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":150,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_full_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField147-f_full_name\",\"placeholder\":\"请输入题目名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"判断题-解析\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":151,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_analyze\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField147-f_analyze\",\"placeholder\":\"请输入解析\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"判断题-答案\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":152,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_answer\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField147-f_answer\",\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"判断题-题目类型\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":164,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444750002,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_topic_type\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField147-f_topic_type\",\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"formId\":157,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_organize_id\",\"fullName\":\"判断题-所属组织\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_organize_id\",\"placeholder\":\"\",\"type\":\"currOrganize\",\"showLevel\":\"last\"},{\"__config__\":{\"formId\":158,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_time\",\"fullName\":\"判断题-修改时间\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_last_modify_time\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":159,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_user_id\",\"fullName\":\"判断题-修改用户\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_last_modify_user_id\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":160,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_time\",\"fullName\":\"判断题-创建时间\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_creator_time\",\"placeholder\":\"\",\"type\":\"currTime\"},{\"__config__\":{\"formId\":161,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_user_id\",\"fullName\":\"判断题-创建用户\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_creator_user_id\",\"placeholder\":\"\",\"type\":\"currUser\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"问答题-题目难度\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_essay_question\",\"defaultValue\":\"\",\"parentVModel\":\"tableField180\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":181,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"f_difficulty\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField180-f_difficulty\",\"placeholder\":\"请选择题目难度\"},{\"filterable\":false,\"clearable\":true,\"multiple\":false,\"fullName\":\"问答题-分类\",\"fullNameI18nCode\":[\"\",\"\"],\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_essay_question\",\"defaultValue\":[],\"parentVModel\":\"tableField180\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":182,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"__vModel__\":\"f_sort\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField180-f_sort\",\"placeholder\":\"请选择分类\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"问答题-题目名称\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":183,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_full_name\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField180-f_full_name\",\"placeholder\":\"请输入题目名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"问答题-解析\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":184,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_analyze\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField180-f_analyze\",\"placeholder\":\"请输入解析\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"问答题-答案\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":185,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_answer\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField180-f_answer\",\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"问答题-题目类型\",\"fullNameI18nCode\":[\"\",\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":186,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_topic_type\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField180-f_topic_type\",\"placeholder\":\"请输入题目类型\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"__config__\":{\"formId\":187,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_organize_id\",\"fullName\":\"问答题-所属组织\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_organize_id\",\"placeholder\":\"\",\"type\":\"currOrganize\",\"showLevel\":\"last\"},{\"__config__\":{\"formId\":188,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_time\",\"fullName\":\"问答题-修改时间\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_last_modify_time\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":189,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_user_id\",\"fullName\":\"问答题-修改用户\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_last_modify_user_id\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":190,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_time\",\"fullName\":\"问答题-创建时间\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_creator_time\",\"placeholder\":\"\",\"type\":\"currTime\"},{\"__config__\":{\"formId\":191,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_user_id\",\"fullName\":\"问答题-创建用户\",\"fullNameI18nCode\":[\"\",\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_creator_user_id\",\"placeholder\":\"\",\"type\":\"currUser\"},{\"clearable\":true,\"useScan\":false,\"suffixIcon\":\"\",\"fullName\":\"考试名称\",\"fullNameI18nCode\":[\"\"],\"addonAfter\":\"\",\"showCount\":false,\"__config__\":{\"formId\":168,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"考试名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522405114,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"__vModel__\":\"f_examination_title\",\"useMask\":false,\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_examination_title\",\"placeholder\":\"请输入考试名称\",\"prefixIcon\":\"\",\"addonBefore\":\"\"},{\"clearable\":true,\"format\":\"yyyy-MM-dd HH:mm:ss\",\"fullName\":\"考试开始时间\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522473033,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":169,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"datePicker\",\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"考试开始时间\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"f_start_time\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_start_time\",\"placeholder\":\"请选择考试开始时间\"},{\"clearable\":true,\"format\":\"yyyy-MM-dd HH:mm:ss\",\"fullName\":\"考试结束日期\",\"fullNameI18nCode\":[\"\"],\"__config__\":{\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522792281,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":170,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"datePicker\",\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"考试结束日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"f_end_time\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_end_time\",\"placeholder\":\"请选择考试结束日期\"},{\"controls\":true,\"fullName\":\"考试时长(分钟)\",\"fullNameI18nCode\":[\"\"],\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"\",\"__config__\":{\"formId\":171,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"inputNumber\",\"defaultValue\":45,\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"labelWidth\":140,\"className\":[],\"label\":\"考试时长(分钟)\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522828038,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"min\":45,\"__vModel__\":\"f_examination_duration\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"f_examination_duration\",\"placeholder\":\"请输入考试时长(分钟)\",\"addonBefore\":\"\"},{\"controls\":true,\"fullName\":\"合格分数\",\"fullNameI18nCode\":[\"\"],\"thousands\":false,\"isAmountChinese\":false,\"addonAfter\":\"\",\"__config__\":{\"formId\":172,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"inputNumber\",\"defaultValue\":60,\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"合格分数\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522931371,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"min\":60,\"__vModel__\":\"f_passing_score\",\"style\":{\"width\":\"100%\"},\"step\":1,\"disabled\":false,\"id\":\"f_passing_score\",\"placeholder\":\"请输入考试时长(分钟)\",\"addonBefore\":\"\"},{\"ableRelationIds\":[],\"clearable\":true,\"ableIds\":[],\"multiple\":true,\"fullName\":\"考试人员\",\"fullNameI18nCode\":[\"\"],\"relationField\":\"\",\"__config__\":{\"formId\":173,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"userSelect\",\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"考试人员\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522972253,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-user\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasUserSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"__vModel__\":\"f_examiners\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"f_examiners\",\"placeholder\":\"请选择考试人员\"},{\"__config__\":{\"formId\":174,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522993760,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-"); + sb.append( + "generator-founder\",\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_user_id\",\"fullName\":\"创建用户\",\"fullNameI18nCode\":[\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"f_creator_user_id\",\"placeholder\":\"\",\"type\":\"currUser\"},{\"__config__\":{\"formId\":175,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522994736,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_creator_time\",\"fullName\":\"创建时间\",\"fullNameI18nCode\":[\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"f_creator_time\",\"placeholder\":\"\",\"type\":\"currTime\"},{\"__config__\":{\"formId\":176,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522995275,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_user_id\",\"fullName\":\"修改用户\",\"fullNameI18nCode\":[\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"f_last_modify_user_id\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":179,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728523000852,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_last_modify_time\",\"fullName\":\"修改时间\",\"fullNameI18nCode\":[\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"f_last_modify_time\",\"placeholder\":\"系统自动生成\"},{\"__config__\":{\"formId\":177,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522996206,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"__vModel__\":\"f_organize_id\",\"fullName\":\"所属组织\",\"fullNameI18nCode\":[\"\"],\"style\":{\"width\":\"100%\"},\"id\":\"f_organize_id\",\"placeholder\":\"\",\"type\":\"currOrganize\",\"showLevel\":\"last\"}],\"pageSize\":20,\"defaultSortConfig\":[],\"type\":1,\"columnBtnsList\":[{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-edit\",\"label\":\"编辑\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"edit\",\"labelI18nCode\":\"common.editText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"删除\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"remove\",\"labelI18nCode\":\"common.delText\"},{\"show\":true,\"icon\":\"icon-ym icon-ym-generator-menu\",\"label\":\"详情\",\"event\":{\"enableFunc\":\"({ row, rowIndex, onlineUtils }) => {\\r\\n\\r\\n return true \\r\\n}\"},\"value\":\"detail\",\"labelI18nCode\":\"common.detailText\"}],\"tabConfig\":{\"hasAllTab\":true,\"relationField\":\"\",\"on\":false},\"hasSuperQuery\":false,\"defaultColumnList\":[{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":101,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"试卷名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728440990975,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"f_full_name\",\"__vModel__\":\"f_full_name\",\"checked\":true,\"disabled\":false,\"id\":\"f_full_name\",\"placeholder\":\"请输入试卷名称\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"试卷名称\",\"label\":\"试卷名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"select\",\"multiple\":false,\"fullName\":\"试题分类\",\"fullNameI18nCode\":[\"\"],\"label\":\"试题分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"defaultValue\":\"\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441006127,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"tag\":\"YunzhupaasSelect\",\"formId\":102,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"试题分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"f_sort\",\"__vModel__\":\"f_sort\",\"checked\":true,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_sort\",\"placeholder\":\"请选择试题分类\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"select\",\"multiple\":false,\"fullName\":\"单选题-题目难度\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"单选题-题目难度\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_single\",\"defaultValue\":\"\",\"parentVModel\":\"tableField103\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441098390,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":105,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"tableField103-f_difficulty\",\"__vModel__\":\"f_difficulty\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField103-f_difficulty\",\"placeholder\":\"请选择题目难度\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"cascader\",\"multiple\":false,\"fullName\":\"单选题-分类\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"单选题-分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_single\",\"defaultValue\":[],\"parentVModel\":\"tableField103\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728442522193,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":125,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"tableField103-f_sort\",\"__vModel__\":\"f_sort\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField103-f_sort\",\"placeholder\":\"请选择分类\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":104,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441048947,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField103-f_full_name\",\"__vModel__\":\"f_full_name\",\"checked\":false,\"disabled\":true,\"id\":\"tableField103-f_full_name\",\"placeholder\":\"请输入题目名称\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"单选题-题目名称\",\"label\":\"单选题-题目名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":107,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441191118,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField103-f_analyze\",\"__vModel__\":\"f_analyze\",\"checked\":false,\"disabled\":true,\"id\":\"tableField103-f_analyze\",\"placeholder\":\"请输入解析\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"单选题-解析\",\"label\":\"单选题-解析\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":108,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441208447,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField103-f_answer\",\"__vModel__\":\"f_answer\",\"checked\":false,\"disabled\":true,\"id\":\"tableField103-f_answer\",\"placeholder\":\"请输入题目类型\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"单选题-答案\",\"label\":\"单选题-答案\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":162,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444695088,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField103-f_topic_type\",\"__vModel__\":\"f_topic_type\",\"checked\":false,\"disabled\":true,\"id\":\"tableField103-f_topic_type\",\"placeholder\":\"请输入题目类型\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"单选题-题目类型\",\"label\":\"单选题-题目类型\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":121,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项A\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441931352,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField103-f_options_a\",\"__vModel__\":\"f_options_a\",\"checked\":false,\"disabled\":false,\"id\":\"tableField103-f_options_a\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"单选题-选项A\",\"label\":\"单选题-选项A\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":122,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项B\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441943944,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField103-f_options_b\",\"__vModel__\":\"f_options_b\",\"checked\":false,\"disabled\":false,\"id\":\"tableField103-f_options_b\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"单选题-选项B\",\"label\":\"单选题-选项B\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":123,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项C\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441946965,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField103-f_options_c\",\"__vModel__\":\"f_options_c\",\"checked\":false,\"disabled\":false,\"id\":\"tableField103-f_options_c\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"单选题-选项C\",\"label\":\"单选题-选项C\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":124,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项D\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728441947535,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField103-f_options_d\",\"__vModel__\":\"f_options_d\",\"checked\":false,\"disabled\":false,\"id\":\"tableField103-f_options_d\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"单选题-选项D\",\"label\":\"单选题-选项D\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"currOrganize\",\"fullName\":\"单选题-所属组织\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"单选题-所属组织\",\"sortable\":false,\"align\":\"left\",\"type\":\"currOrganize\",\"__config__\":{\"formId\":130,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728443972724,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField103-f_organize_id\",\"__vModel__\":\"f_organize_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_organize_id\",\"placeholder\":\"\",\"showLevel\":\"last\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyTime\",\"fullName\":\"单选题-修改时间\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"单选题-修改时间\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":129,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728443972064,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField103-f_last_modify_time\",\"__vModel__\":\"f_last_modify_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_last_modify_time\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyUser\",\"fullName\":\"单选题-修改用户\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"单选题-修改用户\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":128,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728443971712,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField103-f_last_modify_user_id\",\"__vModel__\":\"f_last_modify_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_last_modify_user_id\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createTime\",\"fullName\":\"单选题-创建时间\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"单选题-创建时间\",\"sortable\":false,\"align\":\"left\",\"type\":\"currTime\",\"__config__\":{\"formId\":127,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728443971233,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField103-f_creator_time\",\"__vModel__\":\"f_creator_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_creator_time\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createUser\",\"fullName\":\"单选题-创建用户\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"单选题-创建用户\",\"sortable\":false,\"align\":\"left\",\"type\":\"currUser\",\"__config__\":{\"formId\":126,\"relationTable\":\"make_train_library_single\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField103\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728443970860,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField103-f_creator_user_id\",\"__vModel__\":\"f_creator_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField103-f_creator_user_id\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"select\",\"multiple\":false,\"fullName\":\"多选题-题目难度\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"多选题-题目难度\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_more\",\"defaultValue\":\"\",\"parentVModel\":\"tableField131\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":132,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"tableField131-f_difficulty\",\"__vModel__\":\"f_difficulty\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField131-f_difficulty\",\"placeholder\":\"请选择题目难度\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"cascader\",\"multiple\":false,\"fullName\":\"多选题-分类\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"多选题-分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_more\",\"defaultValue\":[],\"parentVModel\":\"tableField131\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":133,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"tableField131-f_sort\",\"__vModel__\":\"f_sort\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField131-f_sort\",\"placeholder\":\"请选择分类\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":134,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField131-f_full_name\",\"__vModel__\":\"f_full_name\",\"checked\":false,\"disabled\":true,\"id\":\"tableField131-f_full_name\",\"placeholder\":\"请输入题目名称\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"多选题-题目名称\",\"label\":\"多选题-题目名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":135,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField131-f_analyze\",\"__vModel__\":\"f_analyze\",\"checked\":false,\"disabled\":true,\"id\":\"tableField131-f_analyze\",\"placeholder\":\"请输入解析\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"多选题-解析\",\"label\":\"多选题-解析\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":136,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField131-f_answer\",\"__vModel__\":\"f_answer\",\"checked\":false,\"disabled\":true,\"id\":\"tableField131-f_answer\",\"placeholder\":\"请输入题目类型\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"多选题-答案\",\"label\":\"多选题-答案\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":163,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444726177,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField131-f_topic_type\",\"__vModel__\":\"f_topic_type\",\"checked\":false,\"disabled\":true,\"id\":\"tableField131-f_topic_type\",\"placeholder\":\"请输入题目类型\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"多选题-题目类型\",\"label\":\"多选题-题目类型\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":137,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项A\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField131-f_options_a\",\"__vModel__\":\"f_options_a\",\"checked\":false,\"disabled\":false,\"id\":\"tableField131-f_options_a\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"多选题-选项A\",\"label\":\"多选题-选项A\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":138,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项B\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField131-f_options_b\",\"__vModel__\":\"f_options_b\",\"checked\":false,\"disabled\":false,\"id\":\"tableField131-f_options_b\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"多选题-选项B\",\"label\":\"多选题-选项B\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":139,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项C\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField131-f_options_c\",\"__vModel__\":\"f_options_c\",\"checked\":false,\"disabled\":false,\"id\":\"tableField131-f_options_c\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"多选题-选项C\",\"label\":\"多选题-选项C\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":140,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"选项D\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField131-f_options_d\",\"__vModel__\":\"f_options_d\",\"checked\":false,\"disabled\":false,\"id\":\"tableField131-f_options_d\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"多选题-选项D\",\"label\":\"多选题-选项D\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"currOrganize\",\"fullName\":\"多选题-所属组织\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"多选题-所属组织\",\"sortable\":false,\"align\":\"left\",\"type\":\"currOrganize\",\"__config__\":{\"formId\":141,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField131-f_organize_id\",\"__vModel__\":\"f_organize_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_organize_id\",\"placeholder\":\"\",\"showLevel\":\"last\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyTime\",\"fullName\":\"多选题-修改时间\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"多选题-修改时间\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":142,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField131-f_last_modify_time\",\"__vModel__\":\"f_last_modify_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_last_modify_time\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyUser\",\"fullName\":\"多选题-修改用户\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"多选题-修改用户\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":143,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField131-f_last_modify_user_id\",\"__vModel__\":\"f_last_modify_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_last_modify_user_id\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createTime\",\"fullName\":\"多选题-创建时间\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"多选题-创建时间\",\"sortable\":false,\"align\":\"left\",\"type\":\"currTime\",\"__config__\":{\"formId\":144,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField131-f_creator_time\",\"__vModel__\":\"f_creator_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_creator_time\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createUser\",\"fullName\":\"多选题-创建用户\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"多选题-创建用户\",\"sortable\":false,\"align\":\"left\",\"type\":\"currUser\",\"__config__\":{\"formId\":145,\"relationTable\":\"make_train_library_more\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField131\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444025497,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField131-f_creator_user_id\",\"__vModel__\":\"f_creator_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField131-f_creator_user_id\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"select\",\"multiple\":false,\"fullName\":\"判断题-题目难度\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"判断题-题目难度\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_judgment\",\"defaultValue\":\"\",\"parentVModel\":\"tableField147\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":148,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"tableField147-f_difficulty\",\"__vModel__\":\"f_difficulty\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField147-f_difficulty\",\"placeholder\":\"请选择题目难度\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"cascader\",\"multiple\":false,\"fullName\":\"判断题-分类\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"判断题-分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_judgment\",\"defaultValue\":[],\"parentVModel\":\"tableField147\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":149,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"tableField147-f_sort\",\"__vModel__\":\"f_sort\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField147-f_sort\",\"placeholder\":\"请选择分类\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":150,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField147-f_full_name\",\"__vModel__\":\"f_full_name\",\"checked\":false,\"disabled\":true,\"id\":\"tableField147-f_full_name\",\"placeholder\":\"请输入题目名称\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"判断题-题目名称\",\"label\":\"判断题-题目名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":151,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField147-f_analyze\",\"__vModel__\":\"f_analyze\",\"checked\":false,\"disabled\":true,\"id\":\"tableField147-f_analyze\",\"placeholder\":\"请输入解析\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"判断题-解析\",\"label\":\"判断题-解析\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":152,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField147-f_answer\",\"__vModel__\":\"f_answer\",\"checked\":false,\"disabled\":true,\"id\":\"tableField147-f_answer\",\"placeholder\":\"请输入题目类型\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"判断题-答案\",\"label\":\"判断题-答案\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":164,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField147\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444750002,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField147-f_topic_type\",\"__vModel__\":\"f_topic_type\",\"checked\":false,\"disabled\":true,\"id\":\"tableField147-f_topic_type\",\"placeholder\":\"请输入题目类型\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"判断题-题目类型\",\"label\":\"判断题-题目类型\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"currOrganize\",\"fullName\":\"判断题-所属组织\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"判断题-所属组织\",\"sortable\":false,\"align\":\"left\",\"type\":\"currOrganize\",\"__config__\":{\"formId\":157,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField147-f_organize_id\",\"__vModel__\":\"f_organize_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_organize_id\",\"placeholder\":\"\",\"showLevel\":\"last\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyTime\",\"fullName\":\"判断题-修改时间\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"判断题-修改时间\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":158,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField147-f_last_modify_time\",\"__vModel__\":\"f_last_modify_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_last_modify_time\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyUser\",\"fullName\":\"判断题-修改用户\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"判断题-修改用户\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":159,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField147-f_last_modify_user_id\",\"__vModel__\":\"f_last_modify_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_last_modify_user_id\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createTime\",\"fullName\":\"判断题-创建时间\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"判断题-创建时间\",\"sortable\":false,\"align\":\"left\",\"type\":\"currTime\",\"__config__\":{\"formId\":160,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField147-f_creator_time\",\"__vModel__\":\"f_creator_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_creator_time\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createUser\",\"fullName\":\"判断题-创建用户\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"判断题-创建用户\",\"sortable\":false,\"align\":\"left\",\"type\":\"currUser\",\"__config__\":{\"formId\":161,\"relationTable\":\"make_train_library_judgment\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField147\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728444151701,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField147-f_creator_user_id\",\"__vModel__\":\"f_creator_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField147-f_creator_user_id\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"select\",\"multiple\":false,\"fullName\":\"问答题-题目难度\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"问答题-题目难度\",\"sortable\":false,\"align\":\"left\",\"props\":{\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_essay_question\",\"defaultValue\":\"\",\"parentVModel\":\"tableField180\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"tagIcon\":\"icon-ym icon-ym-generator-select\",\"isSubTable\":true,\"tag\":\"YunzhupaasSelect\",\"formId\":181,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"select\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613305950123589765\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"题目难度\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"tableField180-f_difficulty\",\"__vModel__\":\"f_difficulty\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField180-f_difficulty\",\"placeholder\":\"请选择题目难度\",\"labelI18nCode\":\"\"},{\"filterable\":false,\"clearable\":true,\"yunzhupaasKey\":\"cascader\",\"multiple\":false,\"fullName\":\"问答题-分类\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"问答题-分类\",\"sortable\":false,\"align\":\"left\",\"props\":{\"children\":\"children\",\"label\":\"fullName\",\"value\":\"enCode\"},\"__config__\":{\"relationTable\":\"make_train_library_essay_question\",\"defaultValue\":[],\"parentVModel\":\"tableField180\",\"dragDisabled\":false,\"className\":[],\"propsUrl\":\"\",\"templateJson\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"tagIcon\":\"icon-ym icon-ym-generator-cascader\",\"isSubTable\":true,\"tag\":\"YunzhupaasCascader\",\"formId\":182,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"cascader\",\"noShow\":false,\"dataType\":\"dictionary\",\"dictionaryType\":\"613265030053363845\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"label\":\"分类\",\"trigger\":\"change\",\"layout\":\"colFormItem\",\"useCache\":true,\"propsName\":\"\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"prop\":\"tableField180-f_sort\",\"__vModel__\":\"f_sort\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":true,\"id\":\"tableField180-f_sort\",\"placeholder\":\"请选择分类\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":183,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField180-f_full_name\",\"__vModel__\":\"f_full_name\",\"checked\":false,\"disabled\":true,\"id\":\"tableField180-f_full_name\",\"placeholder\":\"请输入题目名称\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"问答题-题目名称\",\"label\":\"问答题-题目名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":184,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"解析\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField180-f_analyze\",\"__vModel__\":\"f_analyze\",\"checked\":false,\"disabled\":true,\"id\":\"tableField180-f_analyze\",\"placeholder\":\"请输入解析\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"问答题-解析\",\"label\":\"问答题-解析\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":185,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"答案\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField180-f_answer\",\"__vModel__\":\"f_answer\",\"checked\":false,\"disabled\":true,\"id\":\"tableField180-f_answer\",\"placeholder\":\"请输入题目类型\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"问答题-答案\",\"label\":\"问答题-答案\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\",\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":186,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"parentVModel\":\"tableField180\",\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"题目类型\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":24},\"readonly\":false,\"prop\":\"tableField180-f_topic_type\",\"__vModel__\":\"f_topic_type\",\"checked\":false,\"disabled\":true,\"id\":\"tableField180-f_topic_type\",\"placeholder\":\"请输入题目类型\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"问答题-题目类型\",\"label\":\"问答题-题目类型\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suff"); + sb.append( + "ixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"currOrganize\",\"fullName\":\"问答题-所属组织\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"问答题-所属组织\",\"sortable\":false,\"align\":\"left\",\"type\":\"currOrganize\",\"__config__\":{\"formId\":187,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField180-f_organize_id\",\"__vModel__\":\"f_organize_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_organize_id\",\"placeholder\":\"\",\"showLevel\":\"last\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyTime\",\"fullName\":\"问答题-修改时间\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"问答题-修改时间\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":188,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField180-f_last_modify_time\",\"__vModel__\":\"f_last_modify_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_last_modify_time\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyUser\",\"fullName\":\"问答题-修改用户\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"问答题-修改用户\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":189,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"isSubTable\":true,\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField180-f_last_modify_user_id\",\"__vModel__\":\"f_last_modify_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_last_modify_user_id\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createTime\",\"fullName\":\"问答题-创建时间\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"问答题-创建时间\",\"sortable\":false,\"align\":\"left\",\"type\":\"currTime\",\"__config__\":{\"formId\":190,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField180-f_creator_time\",\"__vModel__\":\"f_creator_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_creator_time\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createUser\",\"fullName\":\"问答题-创建用户\",\"fullNameI18nCode\":[\"\",\"\"],\"label\":\"问答题-创建用户\",\"sortable\":false,\"align\":\"left\",\"type\":\"currUser\",\"__config__\":{\"formId\":191,\"relationTable\":\"make_train_library_essay_question\",\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"parentVModel\":\"tableField180\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1729132800868,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"isSubTable\":true,\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"tableField180-f_creator_user_id\",\"__vModel__\":\"f_creator_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"tableField180-f_creator_user_id\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"useScan\":false,\"suffixIcon\":\"\",\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"showCount\":false,\"__config__\":{\"formId\":168,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"考试名称\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522405114,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"tag\":\"YunzhupaasInput\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"readonly\":false,\"prop\":\"f_examination_title\",\"__vModel__\":\"f_examination_title\",\"checked\":false,\"disabled\":false,\"id\":\"f_examination_title\",\"placeholder\":\"请输入考试名称\",\"addonBefore\":\"\",\"clearable\":true,\"yunzhupaasKey\":\"input\",\"fullName\":\"考试名称\",\"label\":\"考试名称\",\"sortable\":false,\"addonAfter\":\"\",\"maskConfig\":{\"prefixType\":1,\"useUnrealMask\":false,\"maskType\":1,\"unrealMaskLength\":1,\"prefixLimit\":0,\"suffixLimit\":0,\"filler\":\"*\",\"prefixSpecifyChar\":\"\",\"suffixType\":1,\"ignoreChar\":\"\",\"suffixSpecifyChar\":\"\"},\"useMask\":false,\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\",\"labelI18nCode\":\"\"},{\"clearable\":true,\"yunzhupaasKey\":\"datePicker\",\"format\":\"yyyy-MM-dd HH:mm:ss\",\"fullName\":\"考试开始时间\",\"fullNameI18nCode\":[\"\"],\"label\":\"考试开始时间\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522473033,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":169,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"datePicker\",\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"考试开始时间\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"f_start_time\",\"__vModel__\":\"f_start_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_start_time\",\"placeholder\":\"请选择考试开始时间\",\"labelI18nCode\":\"\"},{\"clearable\":true,\"yunzhupaasKey\":\"datePicker\",\"format\":\"yyyy-MM-dd HH:mm:ss\",\"fullName\":\"考试结束日期\",\"fullNameI18nCode\":[\"\"],\"label\":\"考试结束日期\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"endRelationField\":\"\",\"dragDisabled\":false,\"className\":[],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522792281,\"tagIcon\":\"icon-ym icon-ym-generator-date\",\"startRelationField\":\"\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasDatePicker\",\"formId\":170,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"datePicker\",\"noShow\":false,\"endTimeTarget\":1,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"startTimeType\":1,\"endTimeRule\":false,\"label\":\"考试结束日期\",\"trigger\":\"change\",\"startTimeRule\":false,\"endTimeType\":1,\"layout\":\"colFormItem\",\"startTimeTarget\":1,\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"f_end_time\",\"__vModel__\":\"f_end_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"f_end_time\",\"placeholder\":\"请选择考试结束日期\",\"labelI18nCode\":\"\"},{\"controls\":true,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":171,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"inputNumber\",\"defaultValue\":45,\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"labelWidth\":140,\"className\":[],\"label\":\"考试时长(分钟)\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522828038,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"min\":45,\"prop\":\"f_examination_duration\",\"__vModel__\":\"f_examination_duration\",\"checked\":false,\"disabled\":false,\"id\":\"f_examination_duration\",\"placeholder\":\"请输入考试时长(分钟)\",\"addonBefore\":\"\",\"yunzhupaasKey\":\"inputNumber\",\"fullName\":\"考试时长(分钟)\",\"label\":\"考试时长(分钟)\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"controls\":true,\"fullNameI18nCode\":[\"\"],\"align\":\"left\",\"isAmountChinese\":false,\"__config__\":{\"formId\":172,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"inputNumber\",\"defaultValue\":60,\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"合格分数\",\"trigger\":[\"blur\",\"change\"],\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522931371,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-number\",\"tag\":\"YunzhupaasInputNumber\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"min\":60,\"prop\":\"f_passing_score\",\"__vModel__\":\"f_passing_score\",\"checked\":false,\"disabled\":false,\"id\":\"f_passing_score\",\"placeholder\":\"请输入考试时长(分钟)\",\"addonBefore\":\"\",\"yunzhupaasKey\":\"inputNumber\",\"fullName\":\"合格分数\",\"label\":\"合格分数\",\"sortable\":false,\"thousands\":false,\"addonAfter\":\"\",\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"step\":1,\"labelI18nCode\":\"\"},{\"ableRelationIds\":[],\"clearable\":true,\"yunzhupaasKey\":\"userSelect\",\"ableIds\":[],\"multiple\":true,\"fullName\":\"考试人员\",\"fullNameI18nCode\":[\"\"],\"label\":\"考试人员\",\"sortable\":false,\"align\":\"left\",\"relationField\":\"\",\"__config__\":{\"formId\":173,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"userSelect\",\"defaultValue\":[],\"noShow\":false,\"tipLabel\":\"\",\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"考试人员\",\"trigger\":\"change\",\"showLabel\":true,\"required\":true,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522972253,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-user\",\"defaultCurrent\":false,\"tag\":\"YunzhupaasUserSelect\",\"regList\":[],\"tableAlign\":\"left\",\"span\":12},\"prop\":\"f_examiners\",\"__vModel__\":\"f_examiners\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"selectType\":\"all\",\"disabled\":false,\"id\":\"f_examiners\",\"placeholder\":\"请选择考试人员\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createUser\",\"fullName\":\"创建用户\",\"fullNameI18nCode\":[\"\"],\"label\":\"创建用户\",\"sortable\":false,\"align\":\"left\",\"type\":\"currUser\",\"__config__\":{\"formId\":174,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createUser\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522993760,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-founder\",\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"f_creator_user_id\",\"__vModel__\":\"f_creator_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"f_creator_user_id\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"createTime\",\"fullName\":\"创建时间\",\"fullNameI18nCode\":[\"\"],\"label\":\"创建时间\",\"sortable\":false,\"align\":\"left\",\"type\":\"currTime\",\"__config__\":{\"formId\":175,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"createTime\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"创建时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522994736,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-createtime\",\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"f_creator_time\",\"__vModel__\":\"f_creator_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"f_creator_time\",\"placeholder\":\"\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyUser\",\"fullName\":\"修改用户\",\"fullNameI18nCode\":[\"\"],\"label\":\"修改用户\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":176,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyUser\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改用户\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522995275,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifier\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"f_last_modify_user_id\",\"__vModel__\":\"f_last_modify_user_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"f_last_modify_user_id\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"modifyTime\",\"fullName\":\"修改时间\",\"fullNameI18nCode\":[\"\"],\"label\":\"修改时间\",\"sortable\":false,\"align\":\"left\",\"__config__\":{\"formId\":179,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"modifyTime\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"修改时间\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728523000852,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-modifytime\",\"tag\":\"YunzhupaasInput\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"f_last_modify_time\",\"__vModel__\":\"f_last_modify_time\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"f_last_modify_time\",\"placeholder\":\"系统自动生成\",\"labelI18nCode\":\"\"},{\"yunzhupaasKey\":\"currOrganize\",\"fullName\":\"所属组织\",\"fullNameI18nCode\":[\"\"],\"label\":\"所属组织\",\"sortable\":false,\"align\":\"left\",\"type\":\"currOrganize\",\"__config__\":{\"formId\":177,\"visibility\":[\"pc\",\"app\"],\"yunzhupaasKey\":\"currOrganize\",\"defaultValue\":\"\",\"noShow\":true,\"tableFixed\":\"none\",\"dragDisabled\":false,\"className\":[],\"label\":\"所属组织\",\"showLabel\":true,\"required\":false,\"tableName\":\"make_train_test_paper_library\",\"renderKey\":1728522996206,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-company\",\"tag\":\"YunzhupaasOpenData\",\"tableAlign\":\"left\",\"span\":24},\"readonly\":true,\"prop\":\"f_organize_id\",\"__vModel__\":\"f_organize_id\",\"checked\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"id\":\"f_organize_id\",\"placeholder\":\"\",\"showLevel\":\"last\",\"labelI18nCode\":\"\"}],\"showOverflow\":true,\"useFormPermission\":false,\"customBtnsList\":[],\"useBtnPermission\":false}"); + return sb.toString(); + } + + /** 表列表 */ + public static final String getTableList() { + StringBuilder sb = new StringBuilder(); + sb.append( + "[{\"relationTable\":\"\",\"tableField\":\"\",\"typeId\":\"1\",\"fields\":[{\"columnName\":null,\"field\":\"f_id\",\"fieldName\":\"自然主键\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":1,\"allowNull\":0,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_number\",\"fieldName\":\"编号\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_full_name\",\"fieldName\":\"试卷名称\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_sort\",\"fieldName\":\"试题分类\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_number_of_problems\",\"fieldName\":\"总题数\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_mark\",\"fieldName\":\"总分数\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_examination_title\",\"fieldName\":\"考试名称\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_examination_time\",\"fieldName\":\"考试时间\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_examination_duration\",\"fieldName\":\"考试时长(分钟)\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_passing_score\",\"fieldName\":\"合格分数\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_training_record\",\"fieldName\":\"培训记录\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_examiners\",\"fieldName\":\"考试人员\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_description\",\"fieldName\":\"描述或说明\",\"dataType\":\"varchar\",\"dataLength\":\"500\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_enabled_mark\",\"fieldName\":\"有效标志(0-禁用,1-启用)\",\"dataType\":\"int\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_sort_code\",\"fieldName\":\"排序\",\"dataType\":\"bigint\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_organize_id\",\"fieldName\":\"所属组织\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_creator_time\",\"fieldName\":\"创建时间\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_creator_user_id\",\"fieldName\":\"创建用户\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_last_modify_time\",\"fieldName\":\"修改时间\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_last_modify_user_id\",\"fieldName\":\"修改用户\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_delete_time\",\"fieldName\":\"删除时间\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_delete_user_id\",\"fieldName\":\"删除用户\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_delete_mark\",\"fieldName\":\"删除标志\",\"dataType\":\"int\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_tenant_id\",\"fieldName\":\"租户id\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":0,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_flow_id\",\"fieldName\":\"流程id\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_flow_task_id\",\"fieldName\":\"流程任务主键\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_start_time\",\"fieldName\":\"考试开始时间\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_end_time\",\"fieldName\":\"考试结束日期\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0}],\"relationField\":\"\",\"table\":\"make_train_test_paper_library\",\"tableName\":\"教育培训-试卷库\"},{\"relationTable\":\"make_train_test_paper_library\",\"tableField\":\"f_bank_id\",\"typeId\":\"0\",\"fields\":[{\"columnName\":null,\"field\":\"f_id\",\"fieldName\":\"自然主键\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":1,\"allowNull\":0,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_bank_id\",\"fieldName\":\"主表ID\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_difficulty\",\"fieldName\":\"题目难度\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_sort\",\"fieldName\":\"分类\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_full_name\",\"fieldName\":\"题目名称\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_analyze\",\"fieldName\":\"解析\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_answer\",\"fieldName\":\"答案\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_description\",\"fieldName\":\"描述或说明\",\"dataType\":\"varchar\",\"dataLength\":\"500\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_enabled_mark\",\"fieldName\":\"有效标志(0-禁用,1-启用)\",\"dataType\":\"int\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_sort_code\",\"fieldName\":\"排序\",\"dataType\":\"bigint\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_organize_id\",\"fieldName\":\"所属组织\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_creator_time\",\"fieldName\":\"创建时间\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_creator_user_id\",\"fieldName\":\"创建用户\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_last_modify_time\",\"fieldName\":\"修改时间\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_last_modify_user_id\",\"fieldName\":\"修改用户\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_delete_time\",\"fieldName\":\"删除时间\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_delete_user_id\",\"fieldName\":\"删除用户\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_delete_mark\",\"fieldName\":\"删除标志\",\"dataType\":\"int\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_tenant_id\",\"fieldName\":\"租户id\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":0,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_flow_id\",\"fieldName\":\"流程id\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_flow_task_id\",\"fieldName\":\"流程任务主键\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_topic_type\",\"fieldName\":\"题目类型\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0}],\"relationField\":\"f_id\",\"table\":\"make_train_library_essay_question\",\"tableName\":\"教育培训-试卷库-问答题\"},{\"relationTable\":\"make_train_test_paper_library\",\"tableField\":\"f_bank_id\",\"typeId\":\"0\",\"fields\":[{\"columnName\":null,\"field\":\"f_id\",\"fieldName\":\"自然主键\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":1,\"allowNull\":0,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_bank_id\",\"fieldName\":\"主表ID\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_difficulty\",\"fieldName\":\"题目难度\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_sort\",\"fieldName\":\"分类\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_full_name\",\"fieldName\":\"题目名称\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_analyze\",\"fieldName\":\"解析\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_answer\",\"fieldName\":\"答案\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_description\",\"fieldName\":\"描述或说明\",\"dataType\":\"varchar\",\"dataLength\":\"500\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_enabled_mark\",\"fieldName\":\"有效标志(0-禁用,1-启用)\",\"dataType\":\"int\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_sort_code\",\"fieldName\":\"排序\",\"dataType\":\"bigint\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_organize_id\",\"fieldName\":\"所属组织\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_creator_time\",\"fieldName\":\"创建时间\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_creator_user_id\",\"fieldName\":\"创建用户\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_last_modify_time\",\"fieldName\":\"修改时间\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_last_modify_user_id\",\"fieldName\":\"修改用户\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_delete_time\",\"fieldName\":\"删除时间\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_delete_user_id\",\"fieldName\":\"删除用户\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_delete_mark\",\"fieldName\":\"删除标志\",\"dataType\":\"int\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_tenant_id\",\"fieldName\":\"租户id\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":0,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_flow_id\",\"fieldName\":\"流程id\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_flow_task_id\",\"fieldName\":\"流程任务主键\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_topic_type\",\"fieldName\":\"题目类型\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0}],\"relationField\":\"f_id\",\"table\":\"make_train_library_judgment\",\"tableName\":\"教育培训-试卷库-判断题\"},{\"relationTable\":\"make_train_test_paper_library\",\"tableField\":\"f_bank_id\",\"typeId\":\"0\",\"fields\":[{\"columnName\":null,\"field\":\"f_id\",\"fieldName\":\"自然主键\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":1,\"allowNull\":0,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_bank_id\",\"fieldName\":\"主表ID\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_difficulty\",\"fieldName\":\"题目难度\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_sort\",\"fieldName\":\"分类\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_full_name\",\"fieldName\":\"题目名称\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_options_a\",\"fieldName\":\"选项A\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_options_b\",\"fieldName\":\"选项B\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_options_c\",\"fieldName\":\"选项C\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_options_d\",\"fieldName\":\"选项D\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_analyze\",\"fieldName\":\"解析\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_answer\",\"fieldName\":\"答案\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_description\",\"fieldName\":\"描述或说明\",\"dataType\":\"varchar\",\"dataLength\":\"500\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_enabled_mark\",\"fieldName\":\"有效标志(0-禁用,1-启用)\",\"dataType\":\"int\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_sort_code\",\"fieldName\":\"排序\",\"dataType\":\"bigint\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_organize_id\",\"fieldName\":\"所属组织\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_creator_time\",\"fieldName\":\"创建时间\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_creator_user_id\",\"fieldName\":\"创建用户\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_last_modify_time\",\"fieldName\":\"修改时间\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_last_modify_user_id\",\"fieldName\":\"修改用户\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_delete_time\",\"fieldName\":\"删除时间\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_delete_user_id\",\"fieldName\":\"删除用户\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_delete_mark\",\"fieldName\":\"删除标志\",\"dataType\":\"int\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_tenant_id\",\"fieldName\":\"租户id\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":0,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_flow_id\",\"fieldName\":\"流程id\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_flow_task_id\",\"fieldName\":\"流程任务主键\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_topic_type\",\"fieldName\":\"题目类型\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0}],\"relationField\":\"f_id\",\"table\":\"make_train_library_more\",\"tableName\":\"教育培训-试卷库-多选题\"},{\"relationTable\":\"make_train_test_paper_library\",\"tableField\":\"f_bank_id\",\"typeId\":\"0\",\"fields\":[{\"columnName\":null,\"field\":\"f_id\",\"fieldName\":\"自然主键\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":1,\"allowNull\":0,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_bank_id\",\"fieldName\":\"主表ID\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_difficulty\",\"fieldName\":\"题目难度\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_sort\",\"fieldName\":\"分类\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_full_name\",\"fieldName\":\"题目名称\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_options_a\",\"fieldName\":\"选项A\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_options_b\",\"fieldName\":\"选项B\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_options_c\",\"fieldName\":\"选项C\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_options_d\",\"fieldName\":\"选项D\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_analyze\",\"fieldName\":\"解析\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_answer\",\"fieldName\":\"答案\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_topic_type\",\"fieldName\":\"题目类型\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_description\",\"fieldName\":\"描述或说明\",\"dataType\":\"varchar\",\"dataLength\":\"500\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_enabled_mark\",\"fieldName\":\"有效标志(0-禁用,1-启用)\",\"dataType\":\"int\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_sort_code\",\"fieldName\":\"排序\",\"dataType\":\"bigint\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_organize_id\",\"fieldName\":\"所属组织\",\"dataType\":\"varchar\",\"dataLength\":\"255\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_creator_time\",\"fieldName\":\"创建时间\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_creator_user_id\",\"fieldName\":\"创建用户\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_last_modify_time\",\"fieldName\":\"修改时间\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_last_modify_user_id\",\"fieldName\":\"修改用户\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_delete_time\",\"fieldName\":\"删除时间\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_delete_user_id\",\"fieldName\":\"删除用户\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_delete_mark\",\"fieldName\":\"删除标志\",\"dataType\":\"int\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_tenant_id\",\"fieldName\":\"租户id\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":0,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_flow_id\",\"fieldName\":\"流程id\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0},{\"columnName\":null,\"field\":\"f_flow_task_id\",\"fieldName\":\"流程任务主键\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0,\"identity\":0}],\"relationField\":\"f_id\",\"table\":\"make_train_library_single\",\"tableName\":\"教育培训-试卷库-单选题\"}]"); + return sb.toString(); + } +} diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainTestPaperLibraryExcelErrorVO.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainTestPaperLibraryExcelErrorVO.java new file mode 100644 index 0000000..5862a78 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainTestPaperLibraryExcelErrorVO.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.model.traintestpaperlibrary; + +import lombok.Data; +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.alibaba.fastjson.annotation.JSONField; +/** + * + * 在线考试 + * @版本: V5.2.0 + * @版权: Copyright @ 2025 + * @作者: 浙江尖峰集团股份有限公司 + * @日期: 2024-11-05 + */ +@Data +public class TrainTestPaperLibraryExcelErrorVO extends TrainTestPaperLibraryExcelVO{ + + @Excel(name = "异常原因",orderNum = "-999") + @JSONField(name = "errorsInfo") + private String errorsInfo; +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainTestPaperLibraryExcelVO.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainTestPaperLibraryExcelVO.java new file mode 100644 index 0000000..8913728 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainTestPaperLibraryExcelVO.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.model.traintestpaperlibrary; + +import lombok.Data; +import java.sql.Time; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; +import cn.afterturn.easypoi.excel.annotation.Excel; +import cn.afterturn.easypoi.excel.annotation.ExcelEntity; +import cn.afterturn.easypoi.excel.annotation.ExcelCollection; +import java.math.BigDecimal; +import java.util.List; +/** + * + * 在线考试 + * @版本: V5.2.0 + * @版权: Copyright @ 2025 + * @作者: 浙江尖峰集团股份有限公司 + * @日期: 2024-11-05 + */ +@Data +public class TrainTestPaperLibraryExcelVO{ + +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainTestPaperLibraryForm.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainTestPaperLibraryForm.java new file mode 100644 index 0000000..3161926 --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainTestPaperLibraryForm.java @@ -0,0 +1,79 @@ +package com.yunzhupaas.model.traintestpaperlibrary; + +import lombok.Data; +import java.util.*; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * 在线考试 + * @版本: V5.2.0 + * @版权: Copyright @ 2025 + * @作者: 浙江尖峰集团股份有限公司 + * @日期: 2024-11-05 + */ +@Data +@Schema(description = "表单参数") +public class TrainTestPaperLibraryForm { + /** 主键 */ + @Schema(description = "主键") + @JSONField(name = "f_id") + private String id; + + + /** 试卷名称 **/ + @Schema(description = "试卷名称") + @JsonProperty("f_full_name") + @JSONField(name = "f_full_name") + private String ffullName; + /** 试题分类 **/ + @Schema(description = "试题分类") + @JsonProperty("f_sort") + @JSONField(name = "f_sort") + private Object fsort; + /** 创建用户 **/ + @Schema(description = "创建用户") + @JsonProperty("f_creator_user_id") + @JSONField(name = "f_creator_user_id") + private String fcreatorUserId; + /** 创建时间 **/ + @Schema(description = "创建时间") + @JsonProperty("f_creator_time") + @JSONField(name = "f_creator_time") + private String fcreatorTime; + /** 修改用户 **/ + @Schema(description = "修改用户") + @JsonProperty("f_last_modify_user_id") + @JSONField(name = "f_last_modify_user_id") + private String flastModifyUserId; + /** 修改时间 **/ + @Schema(description = "修改时间") + @JsonProperty("f_last_modify_time") + @JSONField(name = "f_last_modify_time") + private String flastModifyTime; + /** 所属组织 **/ + @Schema(description = "所属组织") + @JsonProperty("f_organize_id") + @JSONField(name = "f_organize_id") + private Object forganizeId; + + /** 子表数据 **/ + @Schema(description = "trainLibrarySingle子表数据") + @JsonProperty("trainLibrarySingleList") + private List trainLibrarySingleList; + /** 子表数据 **/ + @Schema(description = "trainLibraryMore子表数据") + @JsonProperty("trainLibraryMoreList") + private List trainLibraryMoreList; + /** 子表数据 **/ + @Schema(description = "trainLibraryJudgment子表数据") + @JsonProperty("trainLibraryJudgmentList") + private List trainLibraryJudgmentList; + /** 子表数据 **/ + @Schema(description = "trainLibraryEssayQuestion子表数据") + @JsonProperty("trainLibraryEssayQuestionList") + private List trainLibraryEssayQuestionList; +} + diff --git a/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainTestPaperLibraryPagination.java b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainTestPaperLibraryPagination.java new file mode 100644 index 0000000..6ff093a --- /dev/null +++ b/yunzhupaas-train/yunzhupaas-train-entity/src/main/java/com/yunzhupaas/model/traintestpaperlibrary/TrainTestPaperLibraryPagination.java @@ -0,0 +1,56 @@ +package com.yunzhupaas.model.traintestpaperlibrary; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import com.yunzhupaas.base.Pagination; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.List; + +/** + * + * 在线考试 + * @版本: V5.2.0 + * @版权: Copyright @ 2025 + * @作者: 浙江尖峰集团股份有限公司 + * @日期: 2024-11-05 + */ +@Data +@Schema(description = "列表查询参数") +public class TrainTestPaperLibraryPagination extends Pagination { + /** 关键词搜索 */ + @Schema(description = "关键词搜索") + private String yunzhupaasKeyword; + /** 查询key */ + @Schema(description = "查询key") + private String[] selectKey; + /** 选中数据数组id */ + @Schema(description = "选中数据数组id") + private String[] selectIds; + /** json */ + @Schema(description = "json") + private String json; + /** 数据类型 0-当前页,1-全部数据 */ + @Schema(description = "数据类型 0-当前页,1-全部数据") + private String dataType; + /** 高级查询 */ + @Schema(description = "高级查询") + private String superQueryJson; + /** 功能id */ + @Schema(description = "功能id") + private String moduleId; + /** 菜单id */ + @Schema(description = "菜单id") + private String menuId; + /** 试卷名称 */ + @Schema(description = "试卷名称") + @JsonProperty("f_full_name") + @JSONField(name = "ffullName") + private Object ffullName; + /** 试题分类 */ + @Schema(description = "试题分类") + @JsonProperty("f_sort") + @JSONField(name = "fsort") + private Object fsort; +} + diff --git a/yunzhupaas-visualdata/pom.xml b/yunzhupaas-visualdata/pom.xml new file mode 100644 index 0000000..d317fd8 --- /dev/null +++ b/yunzhupaas-visualdata/pom.xml @@ -0,0 +1,20 @@ + + + + yunzhupaas-java-boot + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-visualdata + pom + + yunzhupaas-visualdata-entity + yunzhupaas-visualdata-biz + yunzhupaas-visualdata-controller + + + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/pom.xml b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/pom.xml new file mode 100644 index 0000000..7f8689c --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/pom.xml @@ -0,0 +1,27 @@ + + + + yunzhupaas-visualdata + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-visualdata-biz + + + + com.yunzhupaas + yunzhupaas-visualdata-entity + ${project.version} + + + + com.squareup.okhttp3 + okhttp + + + + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/mapper/VisualAssetsMapper.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/mapper/VisualAssetsMapper.java new file mode 100644 index 0000000..2757782 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/mapper/VisualAssetsMapper.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.visualdata.mapper; + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.visualdata.entity.VisualAssetsEntity; + +/** + * 静态资源 + * + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023年7月7日 + */ +public interface VisualAssetsMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/mapper/VisualCategoryMapper.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/mapper/VisualCategoryMapper.java new file mode 100644 index 0000000..d1c26bc --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/mapper/VisualCategoryMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.visualdata.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.visualdata.entity.VisualCategoryEntity; + +/** + * 大屏分类 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +public interface VisualCategoryMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/mapper/VisualComponentMapper.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/mapper/VisualComponentMapper.java new file mode 100644 index 0000000..f3fc50a --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/mapper/VisualComponentMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.visualdata.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.visualdata.entity.VisualComponentEntity; + +/** + * 大屏组件库 + * + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023年7月7日 + */ +public interface VisualComponentMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/mapper/VisualConfigMapper.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/mapper/VisualConfigMapper.java new file mode 100644 index 0000000..0bf1073 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/mapper/VisualConfigMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.visualdata.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.visualdata.entity.VisualConfigEntity; + +/** + * 大屏基本配置 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +public interface VisualConfigMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/mapper/VisualDbMapper.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/mapper/VisualDbMapper.java new file mode 100644 index 0000000..7dd1d45 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/mapper/VisualDbMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.visualdata.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.visualdata.entity.VisualDbEntity; + +/** + * 大屏数据源配置 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +public interface VisualDbMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/mapper/VisualGlobMapper.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/mapper/VisualGlobMapper.java new file mode 100644 index 0000000..ab9774d --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/mapper/VisualGlobMapper.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.visualdata.mapper; + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.visualdata.entity.VisualGlobEntity; + +/** + * 全局变量 + * + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023年7月7日 + */ +public interface VisualGlobMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/mapper/VisualMapMapper.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/mapper/VisualMapMapper.java new file mode 100644 index 0000000..01917d6 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/mapper/VisualMapMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.visualdata.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.visualdata.entity.VisualMapEntity; + +/** + * 大屏地图配置 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +public interface VisualMapMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/mapper/VisualMapper.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/mapper/VisualMapper.java new file mode 100644 index 0000000..65825e9 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/mapper/VisualMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.visualdata.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.visualdata.entity.VisualEntity; + +/** + * 大屏基本信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +public interface VisualMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/mapper/VisualRecordMapper.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/mapper/VisualRecordMapper.java new file mode 100644 index 0000000..676e4bd --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/mapper/VisualRecordMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.visualdata.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.visualdata.entity.VisualRecordEntity; + +/** + * 大屏数据集 + * + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023年7月7日 + */ +public interface VisualRecordMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/VisualAssetsService.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/VisualAssetsService.java new file mode 100644 index 0000000..39662d0 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/VisualAssetsService.java @@ -0,0 +1,63 @@ +package com.yunzhupaas.visualdata.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.visualdata.entity.VisualAssetsEntity; +import com.yunzhupaas.visualdata.model.visual.VisualPaginationModel; + +import java.util.List; + +/** + * 静态资源 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +public interface VisualAssetsService extends SuperService { + + /** + * 列表 + * + * @param pagination 条件 + * @return + */ + List getList(VisualPaginationModel pagination); + + /** + * 列表 + * + * @return + */ + List getList(); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + VisualAssetsEntity getInfo(String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(VisualAssetsEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return + */ + boolean update(String id, VisualAssetsEntity entity); + + /** + * 删除 + */ + boolean delete(String id); +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/VisualCategoryService.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/VisualCategoryService.java new file mode 100644 index 0000000..8771318 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/VisualCategoryService.java @@ -0,0 +1,74 @@ +package com.yunzhupaas.visualdata.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.visualdata.entity.VisualCategoryEntity; +import com.yunzhupaas.visualdata.model.VisualPagination; +import com.yunzhupaas.visualdata.model.visual.VisualPaginationModel; + +import java.util.List; + +/** + * 大屏 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +public interface VisualCategoryService extends SuperService { + + /** + * 列表 + * + * @param pagination 条件 + */ + List getList(VisualPaginationModel pagination,boolean isPage); + + /** + * 列表 + * + * @return 大屏分类列表 + */ + List getList(); + + /** + * 验证值 + * + * @param value 名称 + * @param id 主键值 + * @return ignore + */ + boolean isExistByValue(String value, String id); + + /** + * 信息 + * + * @param id 主键值 + * @return ignore + */ + VisualCategoryEntity getInfo(String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(VisualCategoryEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return ignore + */ + boolean update(String id, VisualCategoryEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(VisualCategoryEntity entity); +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/VisualComponentService.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/VisualComponentService.java new file mode 100644 index 0000000..8ba45cf --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/VisualComponentService.java @@ -0,0 +1,65 @@ +package com.yunzhupaas.visualdata.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.visualdata.entity.VisualComponentEntity; +import com.yunzhupaas.visualdata.model.visual.VisualPaginationModel; + +import java.util.List; + +/** + * 大屏组件库 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +public interface VisualComponentService extends SuperService { + + /** + * 列表 + * + * @param pagination 条件 + * @return + */ + List getList(VisualPaginationModel pagination); + + /** + * 列表 + * + * @return + */ + List getList(); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + VisualComponentEntity getInfo(String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(VisualComponentEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return + */ + boolean update(String id, VisualComponentEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(VisualComponentEntity entity); +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/VisualConfigService.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/VisualConfigService.java new file mode 100644 index 0000000..2d85d0e --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/VisualConfigService.java @@ -0,0 +1,56 @@ +package com.yunzhupaas.visualdata.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.visualdata.entity.VisualConfigEntity; + +import java.util.List; + +/** + * 大屏基本配置 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +public interface VisualConfigService extends SuperService { + + /** + * 信息 + * + * @return + */ + List getList(); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + VisualConfigEntity getInfo(String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(VisualConfigEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return + */ + boolean update(String id, VisualConfigEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(VisualConfigEntity entity); +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/VisualDbService.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/VisualDbService.java new file mode 100644 index 0000000..40bc8ce --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/VisualDbService.java @@ -0,0 +1,84 @@ +package com.yunzhupaas.visualdata.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.visualdata.entity.VisualDbEntity; +import com.yunzhupaas.visualdata.model.VisualPagination; +import com.yunzhupaas.visualdata.model.visual.VisualPaginationModel; + +import java.util.List; +import java.util.Map; + +/** + * 大屏数据源配置 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +public interface VisualDbService extends SuperService { + + /** + * 列表 + * + * @param pagination 条件 + * @return + */ + List getList(VisualPaginationModel pagination); + + /** + * 列表 + * + * @return + */ + List getList(); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + VisualDbEntity getInfo(String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(VisualDbEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return + */ + boolean update(String id, VisualDbEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(VisualDbEntity entity); + + /** + * 测试连接 + * + * @param entity 实体对象 + * @return + */ + boolean dbTest(VisualDbEntity entity); + + /** + * 执行sql + * + * @param entity 实体对象 + * @param sql sql + * @return + */ + List> query(VisualDbEntity entity, String sql); +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/VisualGlobService.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/VisualGlobService.java new file mode 100644 index 0000000..89918d8 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/VisualGlobService.java @@ -0,0 +1,65 @@ +package com.yunzhupaas.visualdata.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.visualdata.entity.VisualGlobEntity; +import com.yunzhupaas.visualdata.model.visual.VisualPaginationModel; + +import java.util.List; + +/** + * 大屏组件库 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +public interface VisualGlobService extends SuperService { + + /** + * 列表 + * + * @param pagination 条件 + * @return + */ + List getList(VisualPaginationModel pagination); + + /** + * 列表 + * + * @return + */ + List getList(); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + VisualGlobEntity getInfo(String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(VisualGlobEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return + */ + boolean update(String id, VisualGlobEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(VisualGlobEntity entity); +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/VisualMapService.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/VisualMapService.java new file mode 100644 index 0000000..16fc4d8 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/VisualMapService.java @@ -0,0 +1,74 @@ +package com.yunzhupaas.visualdata.service; + +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.visualdata.entity.VisualMapEntity; +import com.yunzhupaas.visualdata.model.visual.VisualPaginationModel; + +import java.util.List; + +/** + * 大屏地图配置 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +public interface VisualMapService extends SuperService { + + /** + * 列表 + * + * @param pagination 条件 + * @return + */ + List getList(VisualPaginationModel pagination); + + /** + * 列表 + * @param pagination 条件 + * @param columns 筛选字段 + * @return + */ + List getListWithColnums(VisualPaginationModel pagination, SFunction... columns); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + VisualMapEntity getInfo(String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(VisualMapEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return + */ + boolean update(String id, VisualMapEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(VisualMapEntity entity); + + + + /** + * 是否存在夏季 + */ + boolean hasChild(String id); +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/VisualRecordService.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/VisualRecordService.java new file mode 100644 index 0000000..74e4b22 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/VisualRecordService.java @@ -0,0 +1,66 @@ +package com.yunzhupaas.visualdata.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.visualdata.entity.VisualRecordEntity; +import com.yunzhupaas.visualdata.model.VisualPagination; +import com.yunzhupaas.visualdata.model.visual.VisualPaginationModel; + +import java.util.List; + +/** + * 大屏数据集 + * + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023年7月7日 + */ +public interface VisualRecordService extends SuperService { + + /** + * 列表 + * + * @param pagination 条件 + * @return + */ + List getList(VisualPaginationModel pagination); + + /** + * 列表 + * + * @return + */ + List getList(); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + VisualRecordEntity getInfo(String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(VisualRecordEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return + */ + boolean update(String id, VisualRecordEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(VisualRecordEntity entity); +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/VisualService.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/VisualService.java new file mode 100644 index 0000000..f083807 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/VisualService.java @@ -0,0 +1,80 @@ +package com.yunzhupaas.visualdata.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.visualdata.entity.VisualConfigEntity; +import com.yunzhupaas.visualdata.entity.VisualEntity; +import com.yunzhupaas.visualdata.model.visual.VisualPaginationModel; + +import java.util.List; + +/** + * 大屏基本信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +public interface VisualService extends SuperService { + + /** + * 列表 + * + * @param pagination 条件 + * @return + */ + List getList(VisualPaginationModel pagination); + + /** + * 列表 + * + * @return + */ + List getList(); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + VisualEntity getInfo(String id); + + /** + * 创建 + * + * @param entity 实体对象 + * @param configEntity 配置属性 + */ + void create(VisualEntity entity, VisualConfigEntity configEntity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @param configEntity 配置属性 + * @return + */ + boolean update(String id, VisualEntity entity, VisualConfigEntity configEntity); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(VisualEntity entity); + + /** + * 创建 + * + * @param entity 实体对象 + * @param configEntity 配置属性 + * @throws DataException + */ + void createImport(VisualEntity entity, VisualConfigEntity configEntity) throws DataException; + + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/impl/VisualAssetsServiceImpl.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/impl/VisualAssetsServiceImpl.java new file mode 100644 index 0000000..b76632f --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/impl/VisualAssetsServiceImpl.java @@ -0,0 +1,76 @@ +package com.yunzhupaas.visualdata.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.visualdata.entity.VisualAssetsEntity; +import com.yunzhupaas.visualdata.mapper.VisualAssetsMapper; +import com.yunzhupaas.visualdata.model.visual.VisualPaginationModel; +import com.yunzhupaas.visualdata.service.VisualAssetsService; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Objects; + +/** + * 静态资源 + * + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023年7月7日 + */ +@Service +public class VisualAssetsServiceImpl extends SuperServiceImpl implements VisualAssetsService { + + @Override + public List getList(VisualPaginationModel pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if(ObjectUtil.isNotEmpty(pagination.getAssetsName())){ + queryWrapper.lambda().like(VisualAssetsEntity::getAssetsName, pagination.getAssetsName()); + } + Page page = new Page(pagination.getCurrent(), pagination.getSize()); + IPage iPages = this.page(page, queryWrapper); + return pagination.setData(iPages); + } + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + return this.list(queryWrapper); + } + + @Override + public VisualAssetsEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualAssetsEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(VisualAssetsEntity entity) { + entity.setId(RandomUtil.uuId()); + this.save(entity); + } + + @Override + public boolean update(String id, VisualAssetsEntity entity) { + entity.setId(id); + return this.updateById(entity); + } + + @Override + public boolean delete(String id) { + if (StringUtil.isNotEmpty(id)) { + return this.removeById(id); + } + return false; + } + + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/impl/VisualCategoryServiceImpl.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/impl/VisualCategoryServiceImpl.java new file mode 100644 index 0000000..4ac2640 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/impl/VisualCategoryServiceImpl.java @@ -0,0 +1,87 @@ +package com.yunzhupaas.visualdata.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.druid.util.StringUtils; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.visualdata.entity.VisualCategoryEntity; +import com.yunzhupaas.visualdata.mapper.VisualCategoryMapper; +import com.yunzhupaas.visualdata.model.VisualPagination; +import com.yunzhupaas.visualdata.model.visual.VisualPaginationModel; +import com.yunzhupaas.visualdata.service.VisualCategoryService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 大屏分类 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Service +public class VisualCategoryServiceImpl extends SuperServiceImpl implements VisualCategoryService { + + @Override + public List getList(VisualPaginationModel pagination,boolean isPage) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if(ObjectUtil.isNotEmpty(pagination.getCategoryValue())){ + queryWrapper.lambda().like(VisualCategoryEntity::getCategorykey,pagination.getCategoryValue()); + } + queryWrapper.lambda().orderByAsc(VisualCategoryEntity::getCategorykey); + if(isPage){ + Page page = new Page(pagination.getCurrent(), pagination.getSize()); + IPage iPages = this.page(page, queryWrapper); + return pagination.setData(iPages); + } + return this.list(queryWrapper); + } + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + return this.list(queryWrapper); + } + + @Override + public boolean isExistByValue(String value, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualCategoryEntity::getCategoryvalue, value); + if (!StringUtils.isEmpty(id)) { + queryWrapper.lambda().ne(VisualCategoryEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public VisualCategoryEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualCategoryEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(VisualCategoryEntity entity) { + entity.setId(RandomUtil.uuId()); + this.save(entity); + } + + @Override + public boolean update(String id, VisualCategoryEntity entity) { + entity.setId(id); + return this.updateById(entity); + } + + @Override + public void delete(VisualCategoryEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/impl/VisualComponentServiceImpl.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/impl/VisualComponentServiceImpl.java new file mode 100644 index 0000000..917f0c9 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/impl/VisualComponentServiceImpl.java @@ -0,0 +1,74 @@ +package com.yunzhupaas.visualdata.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.visualdata.entity.VisualComponentEntity; +import com.yunzhupaas.visualdata.mapper.VisualComponentMapper; +import com.yunzhupaas.visualdata.model.visual.VisualPaginationModel; +import com.yunzhupaas.visualdata.service.VisualComponentService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 大屏组件库 + * + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023年7月7日 + */ +@Service +public class VisualComponentServiceImpl extends SuperServiceImpl implements VisualComponentService { + + @Override + public List getList(VisualPaginationModel pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if(ObjectUtil.isNotEmpty(pagination.getName())){ + queryWrapper.lambda().like(VisualComponentEntity::getName, pagination.getName()); + } + queryWrapper.lambda().eq(VisualComponentEntity::getType, pagination.getType()); + Page page = new Page(pagination.getCurrent(), pagination.getSize()); + IPage iPages = this.page(page, queryWrapper); + return pagination.setData(iPages); + } + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + return this.list(queryWrapper); + } + + @Override + public VisualComponentEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualComponentEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(VisualComponentEntity entity) { + entity.setId(RandomUtil.uuId()); + this.save(entity); + } + + @Override + public boolean update(String id, VisualComponentEntity entity) { + entity.setId(id); + return this.updateById(entity); + } + + @Override + public void delete(VisualComponentEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/impl/VisualConfigServiceImpl.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/impl/VisualConfigServiceImpl.java new file mode 100644 index 0000000..99614e8 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/impl/VisualConfigServiceImpl.java @@ -0,0 +1,57 @@ +package com.yunzhupaas.visualdata.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.visualdata.entity.VisualConfigEntity; +import com.yunzhupaas.visualdata.mapper.VisualConfigMapper; +import com.yunzhupaas.visualdata.service.VisualConfigService; +import org.springframework.stereotype.Service; + +import java.util.List; + + +/** + * 大屏基本配置 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Service +public class VisualConfigServiceImpl extends SuperServiceImpl implements VisualConfigService { + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + return this.list(queryWrapper); + } + + @Override + public VisualConfigEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualConfigEntity::getVisualId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(VisualConfigEntity entity) { + entity.setId(RandomUtil.uuId()); + this.save(entity); + } + + @Override + public boolean update(String id, VisualConfigEntity entity) { + entity.setId(id); + return this.updateById(entity); + } + + @Override + public void delete(VisualConfigEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/impl/VisualDbServiceImpl.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/impl/VisualDbServiceImpl.java new file mode 100644 index 0000000..c1d96a2 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/impl/VisualDbServiceImpl.java @@ -0,0 +1,115 @@ +package com.yunzhupaas.visualdata.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.database.model.dto.PrepSqlDTO; +import com.yunzhupaas.database.util.ConnUtil; +import com.yunzhupaas.database.util.JdbcUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.UserProvider; +import com.yunzhupaas.visualdata.entity.VisualCategoryEntity; +import com.yunzhupaas.visualdata.entity.VisualDbEntity; +import com.yunzhupaas.visualdata.mapper.VisualDbMapper; +import com.yunzhupaas.visualdata.model.VisualPagination; +import com.yunzhupaas.visualdata.model.visual.VisualPaginationModel; +import com.yunzhupaas.visualdata.service.VisualDbService; +import lombok.Cleanup; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.sql.Connection; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * 大屏数据源配置 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Service +public class VisualDbServiceImpl extends SuperServiceImpl implements VisualDbService { + + + + @Override + public List getList(VisualPaginationModel pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if(ObjectUtil.isNotEmpty(pagination.getName())){ + queryWrapper.lambda().like(VisualDbEntity::getName,pagination.getName()); + } + queryWrapper.lambda().orderByDesc(VisualDbEntity::getCreateTime); + Page page = new Page(pagination.getCurrent(), pagination.getSize()); + IPage iPages = this.page(page, queryWrapper); + return pagination.setData(iPages); + } + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().orderByDesc(VisualDbEntity::getCreateTime); + return this.list(queryWrapper); + } + + @Override + public VisualDbEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualDbEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(VisualDbEntity entity) { + entity.setId(RandomUtil.uuId()); + entity.setCreateTime(new Date()); + entity.setUpdateUser(UserProvider.getLoginUserId()); + this.save(entity); + } + + @Override + public boolean update(String id, VisualDbEntity entity) { + entity.setId(id); + entity.setUpdateTime(new Date()); + entity.setUpdateUser(UserProvider.getLoginUserId()); + return this.updateById(entity); + } + + @Override + public void delete(VisualDbEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + + @Override + public boolean dbTest(VisualDbEntity entity) { + boolean flag = false; + try { + @Cleanup Connection conn = ConnUtil.getConn(entity.getUsername(), entity.getPassword(), entity.getUrl()); + flag = conn != null; + } catch (Exception e) { + log.error(e.getMessage()); + } + return flag; + } + + @Override + public List> query(VisualDbEntity entity, String sql) { + List> data = new ArrayList<>(); + try { + data = JdbcUtil.queryList(new PrepSqlDTO(sql).withConn(entity.getUsername(), entity.getPassword(), entity.getUrl())).setIsLowerCase(true).get(); + }catch (Exception e){ + log.error(e.getMessage()); + } + return data; + } + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/impl/VisualGlobServiceImpl.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/impl/VisualGlobServiceImpl.java new file mode 100644 index 0000000..e18400a --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/impl/VisualGlobServiceImpl.java @@ -0,0 +1,73 @@ +package com.yunzhupaas.visualdata.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.visualdata.entity.VisualGlobEntity; +import com.yunzhupaas.visualdata.mapper.VisualGlobMapper; +import com.yunzhupaas.visualdata.model.visual.VisualPaginationModel; +import com.yunzhupaas.visualdata.service.VisualGlobService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 全局变量 + * + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023年7月7日 + */ +@Service +public class VisualGlobServiceImpl extends SuperServiceImpl implements VisualGlobService { + + @Override + public List getList(VisualPaginationModel pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if(ObjectUtil.isNotEmpty(pagination.getGlobalName())){ + queryWrapper.lambda().like(VisualGlobEntity::getGlobalName, pagination.getGlobalName()); + } + Page page = new Page(pagination.getCurrent(), pagination.getSize()); + IPage iPages = this.page(page, queryWrapper); + return pagination.setData(iPages); + } + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + return this.list(queryWrapper); + } + + @Override + public VisualGlobEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualGlobEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(VisualGlobEntity entity) { + entity.setId(RandomUtil.uuId()); + this.save(entity); + } + + @Override + public boolean update(String id, VisualGlobEntity entity) { + entity.setId(id); + return this.updateById(entity); + } + + @Override + public void delete(VisualGlobEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/impl/VisualMapServiceImpl.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/impl/VisualMapServiceImpl.java new file mode 100644 index 0000000..25c365f --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/impl/VisualMapServiceImpl.java @@ -0,0 +1,112 @@ +package com.yunzhupaas.visualdata.service.impl; + +import cn.hutool.core.text.StrPool; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.visualdata.entity.VisualMapEntity; +import com.yunzhupaas.visualdata.mapper.VisualMapMapper; +import com.yunzhupaas.visualdata.model.visual.VisualPaginationModel; +import com.yunzhupaas.visualdata.service.VisualMapService; +import org.springframework.stereotype.Service; +import org.springframework.util.Assert; + +import java.util.Collections; +import java.util.List; +import java.util.Objects; + +/** + * 大屏地图配置 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Service +public class VisualMapServiceImpl extends SuperServiceImpl implements VisualMapService { + + @Override + public List getList(VisualPaginationModel pagination) { + return getListWithColnums(pagination); + } + + + @Override + public List getListWithColnums(VisualPaginationModel pagination, SFunction... columns) { + if(StringUtil.isEmpty(pagination.getParentId())) { + return Collections.emptyList(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .select(columns) + .eq(VisualMapEntity::getParentId, pagination.getParentId()) + .orderByAsc(VisualMapEntity::getId); + if(ObjectUtil.isNotEmpty(pagination.getName())){ + queryWrapper.lambda().like(VisualMapEntity::getName, pagination.getName()); + } + return this.list(queryWrapper); + } + + @Override + public VisualMapEntity getInfo(String id) { + if(StringUtil.isEmpty(id)) { + return null; + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualMapEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(VisualMapEntity entity) { + entity.setId(RandomUtil.uuId()); + VisualMapEntity parent = getByCode(entity.getCode()); + Assert.isNull(parent, MsgCode.EXIST002::get); + parent = getInfo(entity.getParentId()); + if(parent != null){ + entity.setParentCode(parent.getCode()); + entity.setAncestors(parent.getAncestors() + StrPool.COMMA + parent.getCode()); + } + this.save(entity); + } + + @Override + public boolean update(String id, VisualMapEntity entity) { + VisualMapEntity parent = getByCode(entity.getCode()); + Assert.isTrue(parent == null || Objects.equals(parent.getId(), id), MsgCode.EXIST002::get); + entity.setId(id); + return this.updateById(entity); + } + + @Override + public void delete(VisualMapEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + + @Override + public boolean hasChild(String id) { + if(StringUtil.isEmpty(id)) { + return false; + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualMapEntity::getParentId, id); + return this.exists(queryWrapper); + } + + private VisualMapEntity getByCode(String code){ + if(StringUtil.isNotEmpty(code)){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualMapEntity::getCode, code); + return getBaseMapper().selectOne(queryWrapper); + } + return null; + } +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/impl/VisualRecordServiceImpl.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/impl/VisualRecordServiceImpl.java new file mode 100644 index 0000000..7e6f4b2 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/impl/VisualRecordServiceImpl.java @@ -0,0 +1,74 @@ +package com.yunzhupaas.visualdata.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.visualdata.entity.VisualRecordEntity; +import com.yunzhupaas.visualdata.mapper.VisualRecordMapper; +import com.yunzhupaas.visualdata.model.VisualPagination; +import com.yunzhupaas.visualdata.model.visual.VisualPaginationModel; +import com.yunzhupaas.visualdata.service.VisualRecordService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 大屏数据集 + * + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023年7月7日 + */ +@Service +public class VisualRecordServiceImpl extends SuperServiceImpl implements VisualRecordService { + + @Override + public List getList(VisualPaginationModel pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if(ObjectUtil.isNotEmpty(pagination.getName())){ + queryWrapper.lambda().like(VisualRecordEntity::getName, pagination.getName()); + } + Page page = new Page(pagination.getCurrent(), pagination.getSize()); + IPage iPages = this.page(page, queryWrapper); + return pagination.setData(iPages); + } + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + return this.list(queryWrapper); + } + + @Override + public VisualRecordEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualRecordEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(VisualRecordEntity entity) { + entity.setId(RandomUtil.uuId()); + this.save(entity); + } + + @Override + public boolean update(String id, VisualRecordEntity entity) { + entity.setId(id); + return this.updateById(entity); + } + + @Override + public void delete(VisualRecordEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/impl/VisualServiceImpl.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/impl/VisualServiceImpl.java new file mode 100644 index 0000000..24928dd --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-biz/src/main/java/com/yunzhupaas/visualdata/service/impl/VisualServiceImpl.java @@ -0,0 +1,110 @@ +package com.yunzhupaas.visualdata.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.UserProvider; +import com.yunzhupaas.visualdata.entity.VisualConfigEntity; +import com.yunzhupaas.visualdata.entity.VisualEntity; +import com.yunzhupaas.visualdata.mapper.VisualMapper; +import com.yunzhupaas.visualdata.model.visual.VisualPaginationModel; +import com.yunzhupaas.visualdata.service.VisualConfigService; +import com.yunzhupaas.visualdata.service.VisualService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * 大屏基本信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Service +public class VisualServiceImpl extends SuperServiceImpl implements VisualService { + + + @Autowired + private VisualConfigService configService; + + @Override + public List getList(VisualPaginationModel pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if(ObjectUtil.isNotEmpty(pagination.getTitle())){ + queryWrapper.lambda().like(VisualEntity::getTitle, pagination.getTitle()); + } + queryWrapper.lambda().eq(VisualEntity::getCategory, pagination.getCategory()); + queryWrapper.lambda().orderByDesc(VisualEntity::getCreateTime); + Page page = new Page(pagination.getCurrent(), pagination.getSize()); + IPage iPages = this.page(page, queryWrapper); + return pagination.setData(iPages); + } + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().orderByDesc(VisualEntity::getCreateTime); + return this.list(queryWrapper); + } + + @Override + public VisualEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(VisualEntity entity, VisualConfigEntity configEntity) { + entity.setId(RandomUtil.uuId()); + entity.setCreateTime(new Date()); + entity.setUpdateUser(UserProvider.getLoginUserId()); + entity.setStatus(1); + entity.setIsDeleted(0); + this.save(entity); + configEntity.setVisualId(entity.getId()); + configService.create(configEntity); + } + + @Override + public boolean update(String id, VisualEntity entity, VisualConfigEntity configEntity) { + entity.setId(id); + entity.setUpdateTime(new Date()); + entity.setUpdateUser(UserProvider.getLoginUserId()); + boolean flag = this.updateById(entity); + if (configEntity != null) { + configService.update(configEntity.getId(), configEntity); + } + return flag; + } + + @Override + public void delete(VisualEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + VisualConfigEntity config = configService.getInfo(entity.getId()); + configService.delete(config); + } + } + + @Override + public void createImport(VisualEntity entity, VisualConfigEntity configEntity) throws DataException { + try { + this.save(entity); + configService.create(configEntity); + }catch (Exception e){ + throw new DataException(MsgCode.IMP003.get()); + } + + } +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-controller/pom.xml b/yunzhupaas-visualdata/yunzhupaas-visualdata-controller/pom.xml new file mode 100644 index 0000000..62de764 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-controller/pom.xml @@ -0,0 +1,22 @@ + + + + yunzhupaas-visualdata + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-visualdata-controller + + + + com.yunzhupaas + yunzhupaas-visualdata-biz + ${project.version} + + + + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-controller/src/main/java/com/yunzhupaas/visualdata/controller/VisualAssetsController.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-controller/src/main/java/com/yunzhupaas/visualdata/controller/VisualAssetsController.java new file mode 100644 index 0000000..689f841 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-controller/src/main/java/com/yunzhupaas/visualdata/controller/VisualAssetsController.java @@ -0,0 +1,127 @@ +package com.yunzhupaas.visualdata.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.visualdata.entity.VisualAssetsEntity; +import com.yunzhupaas.visualdata.model.VisualPageVO; +import com.yunzhupaas.visualdata.model.visual.VisualPaginationModel; +import com.yunzhupaas.visualdata.model.visualassets.*; +import com.yunzhupaas.visualdata.service.VisualAssetsService; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 静态资源 + * + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023年7月7日 + */ +@RestController +@Tag(name = "全局变量", description = "assets") +@RequestMapping("/api/blade-visual/assets") +public class VisualAssetsController extends SuperController { + + + /** + * 分页 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "分页") + @GetMapping("/list") + public ActionResult> list(VisualPaginationModel pagination) { + List data = getBaseService().getList(pagination); + List list = JsonUtil.getJsonToList(data, VisualAssetsListVO.class); + VisualPageVO paginationVO = JsonUtil.getJsonToBean(pagination, VisualPageVO.class); + paginationVO.setRecords(list); + return ActionResult.success(paginationVO); + } + + /** + * 详情 + * + * @param id 主键 + * @return + */ + @Operation(summary = "详情") + @GetMapping("/detail") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult info(@RequestParam("id")String id) { + VisualAssetsEntity entity = getBaseService().getInfo(id); + VisualAssetsInfoVO vo = JsonUtil.getJsonToBean(entity, VisualAssetsInfoVO.class); + return ActionResult.success(vo); + } + + + /** + * 新增 + * + * @param recordCrForm 数据模型 + * @return + */ + @Operation(summary = "新增") + @PostMapping("/save") + @Parameters({ + @Parameter(name = "recordCrForm", description = "数据模型",required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult create(@RequestBody VisualAssetsCrForm recordCrForm) { + VisualAssetsEntity entity = JsonUtil.getJsonToBean(recordCrForm, VisualAssetsEntity.class); + getBaseService().create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 修改 + * + * @param recordUpForm 数据模型 + * @return + */ + @Operation(summary = "修改") + @PostMapping("/update") + @Parameters({ + @Parameter(name = "recordUpForm", description = "数据模型",required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult update(@RequestBody VisualAssetsUpForm recordUpForm) { + VisualAssetsEntity entity = JsonUtil.getJsonToBean(recordUpForm, VisualAssetsEntity.class); + getBaseService().update(entity.getId(), entity); + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除 + * + * @param ids 主键 + * @return + */ + @Operation(summary = "删除") + @PostMapping("/remove") + @Parameters({ + @Parameter(name = "ids", description = "主键", required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult delete(String ids) { + if (getBaseService().delete(ids)) { + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-controller/src/main/java/com/yunzhupaas/visualdata/controller/VisualCategoryController.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-controller/src/main/java/com/yunzhupaas/visualdata/controller/VisualCategoryController.java new file mode 100644 index 0000000..bc29365 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-controller/src/main/java/com/yunzhupaas/visualdata/controller/VisualCategoryController.java @@ -0,0 +1,158 @@ +package com.yunzhupaas.visualdata.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.visualdata.entity.VisualCategoryEntity; +import com.yunzhupaas.visualdata.model.VisualPageVO; +import com.yunzhupaas.visualdata.model.VisualPagination; +import com.yunzhupaas.visualdata.model.visual.VisualPaginationModel; +import com.yunzhupaas.visualdata.model.visualcategory.VisualCategoryCrForm; +import com.yunzhupaas.visualdata.model.visualcategory.VisualCategoryInfoVO; +import com.yunzhupaas.visualdata.model.visualcategory.VisualCategoryListVO; +import com.yunzhupaas.visualdata.model.visualcategory.VisualCategoryUpForm; +import com.yunzhupaas.visualdata.service.VisualCategoryService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; +import java.util.List; + +/** + * 大屏分类 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@RestController +@Tag(name = "大屏分类", description = "category") +@RequestMapping("/api/blade-visual/category") +public class VisualCategoryController extends SuperController { + + @Autowired + private VisualCategoryService categoryService; + + /** + * 列表 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "列表") + @GetMapping("/page") + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult> page(VisualPaginationModel pagination) { + List data = categoryService.getList(pagination,true); + List list = JsonUtil.getJsonToList(data, VisualCategoryListVO.class); + VisualPageVO paginationVO = JsonUtil.getJsonToBean(pagination, VisualPageVO.class); + paginationVO.setRecords(list); + return ActionResult.success(paginationVO); + } + + /** + * 列表 + * + * @return + */ + @Operation(summary = "列表") + @GetMapping("/list") + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult> list(VisualPaginationModel pagination) { + List data = categoryService.getList(pagination,false); + List list = JsonUtil.getJsonToList(data, VisualCategoryListVO.class); + return ActionResult.success(list); + } + + /** + * 详情 + * + * @param id 主键 + * @return + */ + @Operation(summary = "详情") + @GetMapping("/detail") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult info(@RequestParam("id") String id) { + VisualCategoryEntity entity = categoryService.getInfo(id); + VisualCategoryInfoVO vo = JsonUtil.getJsonToBean(entity, VisualCategoryInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 新增 + * + * @param categoryCrForm 大屏分类模型 + * @return + */ + @Operation(summary = "新增") + @PostMapping("/save") + @Parameters({ + @Parameter(name = "categoryCrForm", description = "大屏分类模型",required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult create(@RequestBody @Valid VisualCategoryCrForm categoryCrForm) { + VisualCategoryEntity entity = JsonUtil.getJsonToBean(categoryCrForm, VisualCategoryEntity.class); + if (categoryService.isExistByValue(entity.getCategoryvalue(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST003.get()); + } + categoryService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 修改 + * + * @param categoryUpForm 大屏分类模型 + * @return + */ + @Operation(summary = "修改") + @PostMapping("/update") + @Parameters({ + @Parameter(name = "categoryUpForm", description = "大屏分类模型",required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult update(@RequestBody VisualCategoryUpForm categoryUpForm) { + VisualCategoryEntity entity = JsonUtil.getJsonToBean(categoryUpForm, VisualCategoryEntity.class); + if (categoryService.isExistByValue(entity.getCategoryvalue(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST003.get()); + } + boolean flag = categoryService.update(categoryUpForm.getId(), entity); + if (!flag) { + return ActionResult.fail(MsgCode.FA001.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除 + * + * @param ids 主键 + * @return + */ + @Operation(summary = "删除") + @PostMapping("/remove") + @Parameters({ + @Parameter(name = "ids", description = "主键", required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult delete(String ids) { + VisualCategoryEntity entity = categoryService.getInfo(ids); + if (entity != null) { + categoryService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-controller/src/main/java/com/yunzhupaas/visualdata/controller/VisualComponentController.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-controller/src/main/java/com/yunzhupaas/visualdata/controller/VisualComponentController.java new file mode 100644 index 0000000..225663b --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-controller/src/main/java/com/yunzhupaas/visualdata/controller/VisualComponentController.java @@ -0,0 +1,132 @@ +package com.yunzhupaas.visualdata.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.visualdata.entity.VisualComponentEntity; +import com.yunzhupaas.visualdata.model.VisualPageVO; +import com.yunzhupaas.visualdata.model.visual.VisualPaginationModel; +import com.yunzhupaas.visualdata.model.visualcomponent.*; +import com.yunzhupaas.visualdata.service.VisualComponentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 大屏组件库 + * + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023年7月7日 + */ +@RestController +@Tag(name = "大屏组件库配置", description = "component") +@RequestMapping("/api/blade-visual/component") +public class VisualComponentController extends SuperController { + + @Autowired + private VisualComponentService componentService; + + /** + * 分页 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "分页") + @GetMapping("/list") + public ActionResult> list(VisualPaginationModel pagination) { + List data = componentService.getList(pagination); + List list = JsonUtil.getJsonToList(data, VisualComponentListVO.class); + VisualPageVO paginationVO = JsonUtil.getJsonToBean(pagination, VisualPageVO.class); + paginationVO.setRecords(list); + return ActionResult.success(paginationVO); + } + + /** + * 详情 + * + * @param id 主键 + * @return + */ + @Operation(summary = "详情") + @GetMapping("/detail") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult info(@RequestParam("id")String id) { + VisualComponentEntity entity = componentService.getInfo(id); + VisualComponentInfoVO vo = JsonUtil.getJsonToBean(entity, VisualComponentInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 新增 + * + * @param recordCrForm 数据模型 + * @return + */ + @Operation(summary = "新增") + @PostMapping("/save") + @Parameters({ + @Parameter(name = "recordCrForm", description = "数据模型",required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult create(@RequestBody VisualComponentCrForm recordCrForm) { + VisualComponentEntity entity = JsonUtil.getJsonToBean(recordCrForm, VisualComponentEntity.class); + componentService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 修改 + * + * @param recordUpForm 数据模型 + * @return + */ + @Operation(summary = "修改") + @PostMapping("/update") + @Parameters({ + @Parameter(name = "recordUpForm", description = "数据模型",required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult update(@RequestBody VisualComponentUpForm recordUpForm) { + VisualComponentEntity entity = JsonUtil.getJsonToBean(recordUpForm, VisualComponentEntity.class); + componentService.update(entity.getId(), entity); + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除 + * + * @param ids 主键 + * @return + */ + @Operation(summary = "删除") + @PostMapping("/remove") + @Parameters({ + @Parameter(name = "ids", description = "主键", required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult delete(String ids) { + VisualComponentEntity entity = componentService.getInfo(ids); + if (entity != null) { + componentService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-controller/src/main/java/com/yunzhupaas/visualdata/controller/VisualController.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-controller/src/main/java/com/yunzhupaas/visualdata/controller/VisualController.java new file mode 100644 index 0000000..76a4fb5 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-controller/src/main/java/com/yunzhupaas/visualdata/controller/VisualController.java @@ -0,0 +1,439 @@ +package com.yunzhupaas.visualdata.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.http.HttpRequest; +import cn.hutool.http.Method; +import cn.xuyanwu.spring.file.storage.FileInfo; +import com.google.common.base.Joiner; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.FileTypeConstant; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.emnus.ModuleTypeEnum; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.model.FileListVO; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.FileExport; +import com.yunzhupaas.util.FileUploadUtils; +import com.yunzhupaas.visualdata.entity.VisualCategoryEntity; +import com.yunzhupaas.visualdata.entity.VisualConfigEntity; +import com.yunzhupaas.visualdata.entity.VisualEntity; +import com.yunzhupaas.visualdata.enums.VisualImgEnum; +import com.yunzhupaas.visualdata.model.VisualPageVO; +import com.yunzhupaas.visualdata.model.visual.*; +import com.yunzhupaas.visualdata.model.visualcategory.VisualCategoryListVO; +import com.yunzhupaas.visualdata.model.visualconfig.VisualConfigInfoModel; +import com.yunzhupaas.visualdata.model.visualfile.ImageVO; +import com.yunzhupaas.visualdata.service.VisualCategoryService; +import com.yunzhupaas.visualdata.service.VisualConfigService; +import com.yunzhupaas.visualdata.service.VisualService; +import lombok.extern.slf4j.Slf4j; +import okhttp3.Headers; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import jakarta.validation.Valid; +import java.io.IOException; +import java.time.Duration; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 大屏基本信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@RestController +@Tag(name = "大屏基本信息", description = "visual") +@RequestMapping("/api/blade-visual/visual") +@Slf4j +public class VisualController extends SuperController { + + @Autowired + private FileExport fileExport; + @Autowired + private VisualService visualService; + @Autowired + private VisualConfigService configService; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private VisualCategoryService categoryService; + + /** + * 列表 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "分页") + @GetMapping("/list") + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult> list(VisualPaginationModel pagination) { + List data = visualService.getList(pagination); + List list = JsonUtil.getJsonToList(data, VisualListVO.class); + VisualPageVO paginationVO = JsonUtil.getJsonToBean(pagination, VisualPageVO.class); + paginationVO.setRecords(list); + return ActionResult.success(paginationVO); + } + + /** + * 详情 + * + * @param id 主键 + * @return + */ + @Operation(summary = "详情") + @GetMapping("/detail") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult info(@RequestParam("id")String id) { + VisualEntity visual = visualService.getInfo(id); + VisualConfigEntity config = configService.getInfo(id); + VisualInfoVO vo = new VisualInfoVO(); + vo.setVisual(JsonUtil.getJsonToBean(visual, VisualInfoModel.class)); + vo.setConfig(JsonUtil.getJsonToBean(config, VisualConfigInfoModel.class)); + return ActionResult.success(vo); + } + + /** + * 新增 + * + * @param visualCrform 大屏模型 + * @return + */ + @Operation(summary = "新增") + @PostMapping("/save") + @Parameters({ + @Parameter(name = "visualCrform", description = "大屏模型",required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult create(@RequestBody @Valid VisualCrform visualCrform) { + VisualEntity visual = JsonUtil.getJsonToBean(visualCrform.getVisual(), VisualEntity.class); + visual.setBackgroundUrl(VisusalImgUrl.url + configValueUtil.getBiVisualPath() + "bg/bg1.png"); + VisualConfigEntity config = JsonUtil.getJsonToBean(visualCrform.getConfig(), VisualConfigEntity.class); + visualService.create(visual, config); + Map data = new HashMap<>(16); + data.put("id", visual.getId()); + return ActionResult.success(data); + } + + /** + * 修改 + * + * @param categoryUpForm 大屏模型 + * @return + */ + @Operation(summary = "修改") + @PostMapping("/update") + @Parameters({ + @Parameter(name = "categoryUpForm", description = "大屏模型",required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult update(@RequestBody VisualUpform categoryUpForm) { + VisualEntity visual = JsonUtil.getJsonToBean(categoryUpForm.getVisual(), VisualEntity.class); + VisualConfigEntity config = JsonUtil.getJsonToBean(categoryUpForm.getConfig(), VisualConfigEntity.class); + visualService.update(visual.getId(), visual, config); + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除 + * + * @param ids 主键 + * @return + */ + @Operation(summary = "删除") + @PostMapping("/remove") + @Parameters({ + @Parameter(name = "ids", description = "主键", required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult delete(@RequestParam("ids")String ids) { + VisualEntity entity = visualService.getInfo(ids); + if (entity != null) { + visualService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + /** + * 复制 + * + * @param id 主键 + * @return + */ + @Operation(summary = "复制") + @PostMapping("/copy") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult copy(@RequestParam("id")String id) { + VisualEntity entity = visualService.getInfo(id); + VisualConfigEntity config = configService.getInfo(id); + if (entity != null) { + entity.setTitle(entity.getTitle() + "_复制"); + visualService.create(entity, config); + return ActionResult.success(MsgCode.SU005.get(), entity.getId()); + } + return ActionResult.fail(MsgCode.FA001.get()); + } + + /** + * 获取类型 + * + * @return + */ + @Operation(summary = "获取类型") + @GetMapping("/category") + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult> list() { + List data = categoryService.getList(); + List list = JsonUtil.getJsonToList(data, VisualCategoryListVO.class); + return ActionResult.success(list); + } + + /** + * 上传文件 + * + * @param file 文件 + * @param type 类型 + * @return + */ + @NoDataSourceBind() + @Operation(summary = "上传文件") + @Parameters({ + @Parameter(name = "type", description = "类型",required = true), + }) + @PostMapping(value = "/put-file/{type}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ActionResult file(MultipartFile file, @PathVariable("type") String type) { + ImageVO vo = new ImageVO(); + VisualImgEnum imgEnum = VisualImgEnum.getByMessage(type); + if (imgEnum != null) { + String path = imgEnum.getMessage(); + String filePath = configValueUtil.getBiVisualPath() + path + "/"; + String name = RandomUtil.uuId() + "." + UpUtil.getFileType(file); + //上传文件 + FileInfo fileInfo = FileUploadUtils.uploadFile(file, filePath, name); + vo.setOriginalName(fileInfo.getOriginalFilename()); + vo.setLink(VisusalImgUrl.url + fileInfo.getPath() + fileInfo.getFilename()); + vo.setName(VisusalImgUrl.url + fileInfo.getPath() + fileInfo.getFilename()); + } + return ActionResult.success(vo); + } + + /** + * 获取图片列表 + * + * @param type 文件夹 + * @return + */ + @NoDataSourceBind() + @Operation(summary = "获取图片列表") + @GetMapping("/{type}") + @Parameters({ + @Parameter(name = "type", description = "文件夹", required = true), + }) + public ActionResult> getFile(@PathVariable("type") String type) { + List vo = new ArrayList<>(); + VisualImgEnum imgEnum = VisualImgEnum.getByMessage(type); + if (imgEnum != null) { + String path = configValueUtil.getBiVisualPath() + imgEnum.getMessage() + "/"; + List fileList = FileUploadUtils.getFileList(path); + fileList.forEach(fileListVO -> { + ImageVO imageVO = new ImageVO(); + imageVO.setName(fileListVO.getFileName()); + imageVO.setLink(VisusalImgUrl.url + fileListVO.getFileName()); + imageVO.setOriginalName(fileListVO.getFileName()); + vo.add(imageVO); + }); + } + return ActionResult.success(vo); + } + + /** + * 大屏下拉框 + */ + @Operation(summary = "大屏下拉框") + @GetMapping("/Selector") + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult> selector() { + List visualList = visualService.getList(); + List categoryList = categoryService.getList(); + List listVos = new ArrayList<>(); + for (VisualCategoryEntity category : categoryList) { + VisualSelectorVO categoryModel = new VisualSelectorVO(); + categoryModel.setId(category.getCategoryvalue()); + categoryModel.setFullName(category.getCategorykey()); + List visualAll = visualList.stream().filter(t -> t.getCategory().equals(Integer.parseInt(category.getCategoryvalue()))).collect(Collectors.toList()); + if (visualAll.size() > 0) { + List childList = new ArrayList<>(); + for (VisualEntity visual : visualAll) { + VisualSelectorVO visualModel = new VisualSelectorVO(); + visualModel.setId(visual.getId()); + visualModel.setFullName(visual.getTitle()); + visualModel.setChildren(null); + visualModel.setHasChildren(false); + childList.add(visualModel); + } + categoryModel.setHasChildren(true); + categoryModel.setChildren(childList); + listVos.add(categoryModel); + } + } + ListVO vo = new ListVO(); + vo.setList(listVos); + return ActionResult.success(vo); + } + + /** + * 大屏导出 + * + * @param id 主键 + * @return + */ + @Operation(summary = "大屏导出") + @PostMapping("/{id}/Actions/ExportData") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult exportData(@PathVariable("id") String id) { + VisualEntity entity = visualService.getInfo(id); + VisualConfigEntity configEntity = configService.getInfo(id); + VisualModel model = new VisualModel(); + model.setEntity(entity); + model.setConfigEntity(configEntity); + DownloadVO downloadVO = fileExport.exportFile(model, configValueUtil.getTemporaryFilePath(), entity.getTitle(), ModuleTypeEnum.VISUAL_DATA.getTableName()); + return ActionResult.success(downloadVO); + } + + /** + * 大屏导入 + * + * @param multipartFile 文件 + * @return + */ + @Operation(summary = "大屏导入") + @SaCheckPermission("onlineDev.dataScreen") + @PostMapping(value = "/Model/Actions/ImportData", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ActionResult ImportData(MultipartFile multipartFile) throws DataException { + //判断是否为.json结尾 + if (FileUtil.existsSuffix(multipartFile, ModuleTypeEnum.VISUAL_DATA.getTableName())) { + return ActionResult.fail(MsgCode.IMP002.get()); + } + //获取文件内容 + String fileContent = FileUtil.getFileContent(multipartFile); + VisualModel vo = JsonUtil.getJsonToBean(fileContent, VisualModel.class); + visualService.createImport(vo.getEntity(), vo.getConfigEntity()); + return ActionResult.success(MsgCode.SU000.get()); + } + + /** + * 获取API动态数据 + * + * @param apiRequest 大屏模型 + * @return + */ + @Operation(summary = "获取API动态数据") + @PostMapping(value = "/GetApiData") + @Parameters({ + @Parameter(name = "apiRequest", description = "大屏模型",required = true), + }) + public String getApiData(@RequestBody @Valid VisualApiRequest apiRequest) throws IOException { + OkHttpClient client = new OkHttpClient.Builder().callTimeout(Duration.ofSeconds(apiRequest.getTimeout())).build(); + Headers headers; + Request request; + if (!apiRequest.getHeaders().isEmpty()) { + Headers.Builder builder = new Headers.Builder(); + apiRequest.getHeaders().forEach((k, v) -> { + builder.add(k, v); + }); + headers = builder.build(); + } else { + headers = new Headers.Builder().build(); + } + if (apiRequest.getMethod().equalsIgnoreCase("post")) { + request = new Request.Builder().url(apiRequest.getUrl()) + .post(okhttp3.RequestBody.create(okhttp3.MediaType.parse("application/json;charset=utf-8"), apiRequest.getParams().isEmpty() ? "" : JsonUtil.getObjectToString(apiRequest.getParams()))) + .headers(headers) + .build(); + } else { + String params = Joiner.on("&") + .useForNull("") + .withKeyValueSeparator("=") + .join(apiRequest.getParams()); + request = new Request.Builder().url(apiRequest.getUrl() + (apiRequest.getUrl().contains("?") ? "&" : "?") + params) + .get() + .headers(headers) + .build(); + } + return client.newCall(request).execute().body().string(); + } + + + /** + * 获取API动态数据 + * + * @param proxyModel 代理模型 + * @return + */ + @Operation(summary = "获取API动态数据") + @PostMapping(value = "/proxy") + @Parameters({ + @Parameter(name = "proxyModel", description = "代理模型",required = true), + }) + public String getApiData(@RequestBody @Valid VisualProxyModel proxyModel) throws IOException { + Map headers; + boolean isForm = false; + if (!proxyModel.getHeaders().isEmpty()) { + headers = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); + headers.putAll(proxyModel.getHeaders()); + if(headers.containsKey("form")){ + //头部指定当前为form表单 + isForm = true; + } + } else { + headers = new HashMap<>(1, 1); + } + //Header无自定义TOKEN 取当前TOKEN + if(!headers.containsKey("Authorization")){ + String token = UserProvider.getToken(); + if(StringUtil.isNotEmpty(token)){ + headers.put("Authorization", token); + } + } + HttpRequest httpRequest = HttpRequest.of(proxyModel.getUrl()).method(Method.valueOf(proxyModel.getMethod().toUpperCase())).addHeaders(headers); + if(isForm){ + httpRequest.form(proxyModel.getData()); + }else if(proxyModel.getData() != null && !proxyModel.getData().isEmpty()){ + httpRequest.body(JsonUtil.getObjectToString(proxyModel.getData())); + }else { + httpRequest.form(proxyModel.getParams()); + } + try { + return httpRequest.timeout(10000).execute().body(); + } catch (Exception e){ + log.info("接口请求失败 {} {}", proxyModel.getUrl(), e.getMessage()); + throw new DataException(MsgCode.FA037.get()); + } + } +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-controller/src/main/java/com/yunzhupaas/visualdata/controller/VisualDbController.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-controller/src/main/java/com/yunzhupaas/visualdata/controller/VisualDbController.java new file mode 100644 index 0000000..ac673c7 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-controller/src/main/java/com/yunzhupaas/visualdata/controller/VisualDbController.java @@ -0,0 +1,181 @@ +package com.yunzhupaas.visualdata.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.util.DesUtil; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.visualdata.entity.VisualDbEntity; +import com.yunzhupaas.visualdata.model.VisualPageVO; +import com.yunzhupaas.visualdata.model.VisualPagination; +import com.yunzhupaas.visualdata.model.visual.VisualPaginationModel; +import com.yunzhupaas.visualdata.model.visualdb.*; +import com.yunzhupaas.visualdata.service.VisualDbService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * 大屏数据源配置 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@RestController +@Tag(name = "大屏数据源配置", description = "db") +@RequestMapping("/api/blade-visual/db") +public class VisualDbController extends SuperController { + + @Autowired + private VisualDbService dbService; + + /** + * 分页 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "分页") + @GetMapping("/list") + public ActionResult> list(VisualPaginationModel pagination) { + List data = dbService.getList(pagination); + List list = JsonUtil.getJsonToList(data, VisualDbListVO.class); + VisualPageVO paginationVO = JsonUtil.getJsonToBean(pagination, VisualPageVO.class); + paginationVO.setRecords(list); + return ActionResult.success(paginationVO); + } + + /** + * 详情 + * + * @param id 主键 + * @return + */ + @Operation(summary = "详情") + @GetMapping("/detail") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult info(@RequestParam("id")String id) { + VisualDbEntity entity = dbService.getInfo(id); + VisualDbInfoVO vo = JsonUtil.getJsonToBean(entity, VisualDbInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 新增或修改 + * + * @param dbUpForm 数据模型 + * @return + */ + @Operation(summary = "新增或修改") + @PostMapping("/submit") + @Parameters({ + @Parameter(name = "dbUpForm", description = "数据模型",required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult submit(@RequestBody VisualDbUpForm dbUpForm) { + VisualDbEntity entity = JsonUtil.getJsonToBean(dbUpForm, VisualDbEntity.class); + if (StringUtil.isEmpty(entity.getId())) { + dbService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } else { + dbService.update(entity.getId(), entity); + return ActionResult.success(MsgCode.SU004.get()); + } + } + + + /** + * 删除 + * + * @param ids 主键 + * @return + */ + @Operation(summary = "删除") + @PostMapping("/remove") + @Parameters({ + @Parameter(name = "ids", description = "主键", required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult delete(String ids) { + VisualDbEntity entity = dbService.getInfo(ids); + if (entity != null) { + dbService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + /** + * 下拉数据源 + * + * @return + */ + @Operation(summary = "下拉数据源") + @GetMapping("/db-list") + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult> list() { + List data = dbService.getList(); + List list = JsonUtil.getJsonToList(data, VisualDbSelectVO.class); + return ActionResult.success(list); + } + + /** + * 数据源测试连接 + * + * @param dbCrForm 数据源模型 + * @return + */ + @Operation(summary = "数据源测试连接") + @PostMapping("/db-test") + @Parameters({ + @Parameter(name = "dbCrForm", description = "数据源模型",required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult test(@RequestBody VisualDbCrForm dbCrForm) { + VisualDbEntity entity = JsonUtil.getJsonToBean(dbCrForm, VisualDbEntity.class); + entity.setPassword(DesUtil.aesOrDecode(entity.getPassword(), false, true)); + boolean flag = dbService.dbTest(entity); + if (flag) { + return ActionResult.success(MsgCode.DB301.get()); + } + return ActionResult.fail(MsgCode.DB302.get()); + } + + /** + * 动态执行SQL + * + * @param queryForm 数据模型 + * @return + */ + @Operation(summary = "动态执行SQL") + @PostMapping("/dynamic-query") + @Parameters({ + @Parameter(name = "queryForm", description = "数据模型",required = true), + }) + public ActionResult query(@RequestBody VisualDbQueryForm queryForm) { + VisualDbEntity entity = dbService.getInfo(queryForm.getId()); + List> data = new ArrayList<>(); + if (entity != null) { + entity.setPassword(DesUtil.aesOrDecode(entity.getPassword(), false, true)); + queryForm.setSql(DesUtil.aesOrDecode(queryForm.getSql(), false, true)); + data = dbService.query(entity, queryForm.getSql()); + } + return ActionResult.success(data); + } + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-controller/src/main/java/com/yunzhupaas/visualdata/controller/VisualGlobController.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-controller/src/main/java/com/yunzhupaas/visualdata/controller/VisualGlobController.java new file mode 100644 index 0000000..c80d83d --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-controller/src/main/java/com/yunzhupaas/visualdata/controller/VisualGlobController.java @@ -0,0 +1,132 @@ +package com.yunzhupaas.visualdata.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.visualdata.entity.VisualGlobEntity; +import com.yunzhupaas.visualdata.model.VisualPageVO; +import com.yunzhupaas.visualdata.model.visual.VisualPaginationModel; +import com.yunzhupaas.visualdata.model.visualglob.*; +import com.yunzhupaas.visualdata.service.VisualGlobService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 全局变量 + * + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023年7月7日 + */ +@RestController +@Tag(name = "全局变量", description = "glob") +@RequestMapping("/api/blade-visual/visual-global") +public class VisualGlobController extends SuperController { + + @Autowired + private VisualGlobService gloService; + + /** + * 分页 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "分页") + @GetMapping("/list") + public ActionResult> list(VisualPaginationModel pagination) { + List data = gloService.getList(pagination); + List list = JsonUtil.getJsonToList(data, VisualGlobListVO.class); + VisualPageVO paginationVO = JsonUtil.getJsonToBean(pagination, VisualPageVO.class); + paginationVO.setRecords(list); + return ActionResult.success(paginationVO); + } + + /** + * 详情 + * + * @param id 主键 + * @return + */ + @Operation(summary = "详情") + @GetMapping("/detail") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult info(@RequestParam("id")String id) { + VisualGlobEntity entity = gloService.getInfo(id); + VisualGlobInfoVO vo = JsonUtil.getJsonToBean(entity, VisualGlobInfoVO.class); + return ActionResult.success(vo); + } + + + /** + * 新增 + * + * @param recordCrForm 数据模型 + * @return + */ + @Operation(summary = "新增") + @PostMapping("/save") + @Parameters({ + @Parameter(name = "recordCrForm", description = "数据模型",required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult create(@RequestBody VisualGlobCrForm recordCrForm) { + VisualGlobEntity entity = JsonUtil.getJsonToBean(recordCrForm, VisualGlobEntity.class); + gloService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 修改 + * + * @param recordUpForm 数据模型 + * @return + */ + @Operation(summary = "修改") + @PostMapping("/update") + @Parameters({ + @Parameter(name = "recordUpForm", description = "数据模型",required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult update(@RequestBody VisualGlobUpForm recordUpForm) { + VisualGlobEntity entity = JsonUtil.getJsonToBean(recordUpForm, VisualGlobEntity.class); + gloService.update(entity.getId(), entity); + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除 + * + * @param ids 主键 + * @return + */ + @Operation(summary = "删除") + @PostMapping("/remove") + @Parameters({ + @Parameter(name = "ids", description = "主键", required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult delete(String ids) { + VisualGlobEntity entity = gloService.getInfo(ids); + if (entity != null) { + gloService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-controller/src/main/java/com/yunzhupaas/visualdata/controller/VisualMapController.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-controller/src/main/java/com/yunzhupaas/visualdata/controller/VisualMapController.java new file mode 100644 index 0000000..2e37d34 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-controller/src/main/java/com/yunzhupaas/visualdata/controller/VisualMapController.java @@ -0,0 +1,156 @@ +package com.yunzhupaas.visualdata.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.visualdata.entity.VisualMapEntity; +import com.yunzhupaas.visualdata.model.visual.VisualPaginationModel; +import com.yunzhupaas.visualdata.model.visualmap.*; +import com.yunzhupaas.visualdata.service.VisualMapService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.Assert; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +/** + * 大屏地图 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@RestController +@Tag(name = "大屏地图", description = "map") +@RequestMapping("/api/blade-visual/map") +public class VisualMapController extends SuperController { + + @Autowired + private VisualMapService mapService; + + /** + * 分页 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "分页") + @GetMapping("/lazy-list") + public ActionResult> list(VisualPaginationModel pagination) { + List data = mapService.getListWithColnums(pagination, VisualMapEntity::getId, VisualMapEntity::getName + , VisualMapEntity::getCode, VisualMapEntity::getParentCode, VisualMapEntity::getParentId + , VisualMapEntity::getAncestors, VisualMapEntity::getMapLevel); + List list = JsonUtil.getJsonToList(data, VisualMapListVO.class); + VisualMapEntity parent = getBaseService().getInfo(pagination.getParentId()); + list.forEach(m -> { + m.setHasChildren(getBaseService().hasChild(m.getId())); + if(parent != null){ + m.setParentName(parent.getName()); + } + }); + return ActionResult.success(MsgCode.SU005.get(), list); + } + + /** + * 详情 + * + * @param id 主键 + * @return + */ + @Operation(summary = "详情") + @GetMapping("/detail") + public ActionResult info(@RequestParam("id") String id) { + VisualMapEntity entity = mapService.getInfo(id); + VisualMapInfoVO vo = JsonUtil.getJsonToBean(entity, VisualMapInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 新增 + * + * @param mapCrForm 地图模型 + * @return + */ + @Operation(summary = "新增") + @PostMapping("/save") + @Parameters({ + @Parameter(name = "mapCrForm", description = "地图模型", required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult create(@RequestBody VisualMapCrForm mapCrForm) { + VisualMapEntity entity = JsonUtil.getJsonToBean(mapCrForm, VisualMapEntity.class); + mapService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 修改 + * + * @param mapUpForm 地图模型 + * @return + */ + @Operation(summary = "修改") + @PostMapping("/update") + @Parameters({ + @Parameter(name = "mapUpForm", description = "地图模型", required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult update(@RequestBody VisualMapUpForm mapUpForm) { + VisualMapEntity entity = JsonUtil.getJsonToBean(mapUpForm, VisualMapEntity.class); + boolean flag = mapService.update(mapUpForm.getId(), entity); + if (!flag) { + return ActionResult.fail(MsgCode.FA001.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除 + * + * @param ids 主键 + * @return + */ + @Operation(summary = "删除") + @PostMapping("/remove") + @Parameters({ + @Parameter(name = "ids", description = "主键", required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult delete(@RequestParam("ids") String ids) { + VisualMapEntity entity = mapService.getInfo(ids); + if (entity != null) { + mapService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + /** + * 数据详情 + * + * @param id 主键 + * @return + */ + @Operation(summary = "数据详情") + @GetMapping("/data") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public String dataInfo(@RequestParam("id") String id) { + VisualMapEntity entity = mapService.getInfo(id); + Assert.notNull(entity, MsgCode.FA001::get); + return entity.getData(); + } + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-controller/src/main/java/com/yunzhupaas/visualdata/controller/VisualRecordController.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-controller/src/main/java/com/yunzhupaas/visualdata/controller/VisualRecordController.java new file mode 100644 index 0000000..0f7f0f7 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-controller/src/main/java/com/yunzhupaas/visualdata/controller/VisualRecordController.java @@ -0,0 +1,136 @@ +package com.yunzhupaas.visualdata.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.visualdata.entity.VisualRecordEntity; +import com.yunzhupaas.visualdata.model.VisualPageVO; +import com.yunzhupaas.visualdata.model.VisualPagination; +import com.yunzhupaas.visualdata.model.visual.VisualPaginationModel; +import com.yunzhupaas.visualdata.model.visualrecord.VisualRecordCrForm; +import com.yunzhupaas.visualdata.model.visualrecord.VisualRecordInfoVO; +import com.yunzhupaas.visualdata.model.visualrecord.VisualRecordListVO; +import com.yunzhupaas.visualdata.model.visualrecord.VisualRecordUpForm; +import com.yunzhupaas.visualdata.service.VisualRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 大屏数据源配置 + * + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023年7月7日 + */ +@RestController +@Tag(name = "大屏数据集配置", description = "record") +@RequestMapping("/api/blade-visual/record") +public class VisualRecordController extends SuperController { + + @Autowired + private VisualRecordService recordService; + + /** + * 分页 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "分页") + @GetMapping("/list") + public ActionResult> list(VisualPaginationModel pagination) { + List data = recordService.getList(pagination); + List list = JsonUtil.getJsonToList(data, VisualRecordListVO.class); + VisualPageVO paginationVO = JsonUtil.getJsonToBean(pagination, VisualPageVO.class); + paginationVO.setRecords(list); + return ActionResult.success(paginationVO); + } + + /** + * 详情 + * + * @param id 主键 + * @return + */ + @Operation(summary = "详情") + @GetMapping("/detail") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult info(@RequestParam("id")String id) { + VisualRecordEntity entity = recordService.getInfo(id); + VisualRecordInfoVO vo = JsonUtil.getJsonToBean(entity, VisualRecordInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 新增 + * + * @param recordCrForm 数据模型 + * @return + */ + @Operation(summary = "新增") + @PostMapping("/save") + @Parameters({ + @Parameter(name = "recordCrForm", description = "数据模型",required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult create(@RequestBody VisualRecordCrForm recordCrForm) { + VisualRecordEntity entity = JsonUtil.getJsonToBean(recordCrForm, VisualRecordEntity.class); + recordService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 修改 + * + * @param recordUpForm 数据模型 + * @return + */ + @Operation(summary = "修改") + @PostMapping("/update") + @Parameters({ + @Parameter(name = "recordUpForm", description = "数据模型",required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult update(@RequestBody VisualRecordUpForm recordUpForm) { + VisualRecordEntity entity = JsonUtil.getJsonToBean(recordUpForm, VisualRecordEntity.class); + recordService.update(entity.getId(), entity); + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 删除 + * + * @param ids 主键 + * @return + */ + @Operation(summary = "删除") + @PostMapping("/remove") + @Parameters({ + @Parameter(name = "ids", description = "主键", required = true), + }) + @SaCheckPermission("onlineDev.dataScreen") + public ActionResult delete(String ids) { + VisualRecordEntity entity = recordService.getInfo(ids); + if (entity != null) { + recordService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-controller/src/main/java/com/yunzhupaas/visualdata/controller/aop/VisualBindAspect.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-controller/src/main/java/com/yunzhupaas/visualdata/controller/aop/VisualBindAspect.java new file mode 100644 index 0000000..d241842 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-controller/src/main/java/com/yunzhupaas/visualdata/controller/aop/VisualBindAspect.java @@ -0,0 +1,74 @@ +package com.yunzhupaas.visualdata.controller.aop; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-03-26 + */ + +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.util.ServletUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import lombok.extern.slf4j.Slf4j; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 17:12 + */ +@Slf4j +@Aspect +@Component +@Order(1) +public class VisualBindAspect { + + + + @Autowired + private ConfigValueUtil configValueUtil; + + @Pointcut("within(com.yunzhupaas.visualdata.controller.VisualCategoryController || com.yunzhupaas.visualdata.controller.VisualMapController) && (execution(* com.yunzhupaas.*.controller.VisualCategoryController.list(..)) || execution(* com.yunzhupaas.*.controller.VisualMapController.dataInfo(..)))") + public void bindDataSource() { + + } + + /** + * NoDataSourceBind 不需要绑定数据库的注解 + * + * @param pjp + * @return + * @throws Throwable + */ + @Around("bindDataSource()") + public Object doAroundService(ProceedingJoinPoint pjp) throws Throwable { + if (configValueUtil.isMultiTenancy()) { + String jwtToken = ServletUtil.getRequest().getHeader("Authorization"); + if(StringUtil.isEmpty(jwtToken)){ + //兼容旧版大屏前端 + jwtToken = ServletUtil.getRequest().getParameter("token"); + } + UserInfo userInfo = UserProvider.getUser(jwtToken); + if(userInfo.getTenantId() == null){ + throw new RuntimeException("租户信息为空: " + jwtToken); + } + //设置租户 + TenantDataSourceUtil.switchTenant(userInfo.getTenantId()); + } + Object obj = pjp.proceed(); + return obj; + } +} + + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-controller/src/main/java/com/yunzhupaas/visualdata/utils/VisualDataPermissionUtil.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-controller/src/main/java/com/yunzhupaas/visualdata/utils/VisualDataPermissionUtil.java new file mode 100644 index 0000000..9c03fbc --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-controller/src/main/java/com/yunzhupaas/visualdata/utils/VisualDataPermissionUtil.java @@ -0,0 +1,36 @@ +package com.yunzhupaas.visualdata.utils; + +import cn.dev33.satoken.stp.StpUtil; +import com.yunzhupaas.properties.SecurityProperties; +import com.yunzhupaas.util.ServletUtil; +import org.springframework.stereotype.Component; + +import java.util.Map; + +@Component +public class VisualDataPermissionUtil { + + private static SecurityProperties securityProperties; + private static final String[] refererPath = new String[]{"**/DataV/view/{id}", "**/DataV/build/{id}"}; + + public VisualDataPermissionUtil(SecurityProperties securityProperties) { + VisualDataPermissionUtil.securityProperties = securityProperties; + } + + public static void checkByReferer() { + if (securityProperties.isEnablePreAuth()) { + String referer = ServletUtil.getHeader("Referer"); + String id = null; + for (String s : refererPath) { + Map pathVariables = ServletUtil.getPathVariables(s, referer); + id = pathVariables.get("id"); + if (id != null) { + id = id.split("[?]")[0]; + break; + } + } + StpUtil.checkPermissionOr("onlineDev.dataScreen", id); + } + } +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/pom.xml b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/pom.xml new file mode 100644 index 0000000..cfaadbd --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/pom.xml @@ -0,0 +1,29 @@ + + + + yunzhupaas-visualdata + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-visualdata-entity + + + + com.yunzhupaas + yunzhupaas-common-all + ${project.version} + compile + + + + com.yunzhupaas + yunzhupaas-exception + ${project.version} + + + + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/entity/VisualAssetsEntity.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/entity/VisualAssetsEntity.java new file mode 100644 index 0000000..a9fb323 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/entity/VisualAssetsEntity.java @@ -0,0 +1,50 @@ +package com.yunzhupaas.visualdata.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.util.Date; + +/** + * 静态资源 + * + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023年12月28日 + */ +@Data +@TableName("blade_visual_assets") +public class VisualAssetsEntity { + + /** 主键 */ + @TableId("id") + private String id; + + /** 资源名称 */ + @TableField("assetsName") + private String assetsName; + /** 资源大小 1M */ + @TableField("assetsSize") + private String assetsSize; + /** 资源上传时间 */ + @TableField("assetsTime") + private Date assetsTime; + /** 资源后缀名 */ + @TableField("assetsType") + private String assetsType; + /** 资源地址 */ + @TableField("assetsUrl") + private String assetsUrl; + + /** + * 租户id + */ + @TableField(value = "f_tenant_id" , fill = FieldFill.INSERT) + private String tenantId; + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/entity/VisualCategoryEntity.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/entity/VisualCategoryEntity.java new file mode 100644 index 0000000..f4093aa --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/entity/VisualCategoryEntity.java @@ -0,0 +1,43 @@ +package com.yunzhupaas.visualdata.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * 大屏分类 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Data +@TableName("blade_visual_category") +public class VisualCategoryEntity { + /** 主键 */ + @TableId("ID") + private String id; + + /** 分类值 */ + @TableField("CATEGORY_KEY") + private String categorykey; + + /** 分类名称 */ + @TableField("CATEGORY_VALUE") + private String categoryvalue; + + /** 是否删除 */ + @TableField("IS_DELETED") + private Integer isdeleted; + + /** + * 租户id + */ + @TableField(value = "f_tenant_id" , fill = FieldFill.INSERT) + private String tenantId; + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/entity/VisualComponentEntity.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/entity/VisualComponentEntity.java new file mode 100644 index 0000000..f153a15 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/entity/VisualComponentEntity.java @@ -0,0 +1,48 @@ +package com.yunzhupaas.visualdata.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * 大屏组件库 + * + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023年7月7日 + */ +@Data +@TableName("blade_visual_component") +public class VisualComponentEntity { + + /** 主键 */ + @TableId("ID") + private String id; + + /** 组件名称 */ + @TableField("name") + private String name; + + /** 组件内容 */ + @TableField("content") + private String content; + + /** 组件类型 */ + @TableField("type") + private Integer type; + + /** 组件图片 */ + @TableField("img") + private String img; + + /** + * 租户id + */ + @TableField(value = "f_tenant_id" , fill = FieldFill.INSERT) + private String tenantId; + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/entity/VisualConfigEntity.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/entity/VisualConfigEntity.java new file mode 100644 index 0000000..89f7678 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/entity/VisualConfigEntity.java @@ -0,0 +1,43 @@ +package com.yunzhupaas.visualdata.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * 大屏基本配置 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Data +@TableName("blade_visual_config") +public class VisualConfigEntity { + /** 主键 */ + @TableId("ID") + private String id; + + /** 可视化表主键 */ + @TableField("VISUAL_ID") + private String visualId; + + /** 配置json */ + @TableField("DETAIL") + private String detail; + + /** 组件json */ + @TableField("COMPONENT") + private String component; + + /** + * 租户id + */ + @TableField(value = "f_tenant_id" , fill = FieldFill.INSERT) + private String tenantId; + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/entity/VisualDbEntity.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/entity/VisualDbEntity.java new file mode 100644 index 0000000..d167788 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/entity/VisualDbEntity.java @@ -0,0 +1,85 @@ +package com.yunzhupaas.visualdata.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.util.Date; + +/** + * 大屏数据源配置 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Data +@TableName("blade_visual_db") +public class VisualDbEntity { + /** 主键 */ + @TableId("ID") + private String id; + + /** 名称 */ + @TableField("NAME") + private String name; + + /** 驱动类 */ + @TableField("DRIVER_CLASS") + private String driverClass; + + /** 连接地址 */ + @TableField("URL") + private String url; + + /** 用户名 */ + @TableField("USERNAME") + private String username; + + /** 密码 */ + @TableField("PASSWORD") + private String password; + + /** 备注 */ + @TableField("REMARK") + private String remark; + + /** 创建人 */ + @TableField("CREATE_USER") + private String createUser; + + /** 创建部门 */ + @TableField("CREATE_DEPT") + private String createDept; + + /** 创建时间 */ + @TableField("CREATE_TIME") + private Date createTime; + + /** 修改人 */ + @TableField("UPDATE_USER") + private String updateUser; + + /** 修改时间 */ + @TableField("UPDATE_TIME") + private Date updateTime; + + /** 状态 */ + @TableField("STATUS") + private String status; + + /** 是否已删除 */ + @TableField("IS_DELETED") + private String isDeleted; + + /** + * 租户id + */ + @TableField(value = "f_tenant_id" , fill = FieldFill.INSERT) + private String tenantId; + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/entity/VisualEntity.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/entity/VisualEntity.java new file mode 100644 index 0000000..d94993c --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/entity/VisualEntity.java @@ -0,0 +1,77 @@ +package com.yunzhupaas.visualdata.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.util.Date; + +/** + * 大屏基本信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Data +@TableName("blade_visual") +public class VisualEntity { + /** 主键 */ + @TableId("ID") + private String id; + + /** 大屏标题 */ + @TableField("TITLE") + private String title; + + /** 大屏背景 */ + @TableField("BACKGROUND_URL") + private String backgroundUrl; + + /** 大屏类型 */ + @TableField("CATEGORY") + private Integer category; + + /** 发布密码 */ + @TableField("PASSWORD") + private String password; + + /** 创建人 */ + @TableField("CREATE_USER") + private String createUser; + + /** 创建部门 */ + @TableField("CREATE_DEPT") + private String createDept; + + /** 创建时间 */ + @TableField("CREATE_TIME") + private Date createTime; + + /** 修改人 */ + @TableField("UPDATE_USER") + private String updateUser; + + /** 修改时间 */ + @TableField("UPDATE_TIME") + private Date updateTime; + + /** 状态 */ + @TableField("STATUS") + private Integer status; + + /** 是否已删除 */ + @TableField("IS_DELETED") + private Integer isDeleted; + + /** + * 租户id + */ + @TableField(value = "f_tenant_id" , fill = FieldFill.INSERT) + private String tenantId; + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/entity/VisualGlobEntity.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/entity/VisualGlobEntity.java new file mode 100644 index 0000000..d88756d --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/entity/VisualGlobEntity.java @@ -0,0 +1,44 @@ +package com.yunzhupaas.visualdata.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * 全局变量 + * + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023年12月28日 + */ +@Data +@TableName("blade_visual_glob") +public class VisualGlobEntity { + + /** 主键 */ + @TableId("ID") + private String id; + + /** 变量名称 */ + @TableField("globalName") + private String globalName; + + /** 变量Key */ + @TableField("globalKey") + private String globalKey; + + /** 组变量值 */ + @TableField("globalValue") + private String globalValue; + + /** + * 租户id + */ + @TableField(value = "f_tenant_id" , fill = FieldFill.INSERT) + private String tenantId; + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/entity/VisualMapEntity.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/entity/VisualMapEntity.java new file mode 100644 index 0000000..16b6904 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/entity/VisualMapEntity.java @@ -0,0 +1,61 @@ +package com.yunzhupaas.visualdata.entity; + +import com.alibaba.fastjson.annotation.JSONField; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * 大屏地图配置 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Data +@TableName("blade_visual_map") +public class VisualMapEntity { + /** 主键 */ + @TableId("id") + private String id; + + /** 地图名称 */ + @TableField("name") + private String name; + + /** 地图数据 */ + @TableField("data") + private String data; + + /** 地图编码 */ + @TableField("code") + private String code; + + /** 地图级别 0:国家 1:省份 2:城市 3:区县 */ + @TableField("map_level") + @JSONField(name = "level") + private Integer mapLevel; + + /** 上级ID */ + @TableField("parent_id") + private String parentId; + + /** 上级编码 */ + @TableField("parent_code") + private String parentCode; + + /** 祖编码 */ + @TableField("ancestors") + private String ancestors; + + /** + * 租户id + */ + @TableField(value = "f_tenant_id" , fill = FieldFill.INSERT) + private String tenantId; + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/entity/VisualRecordEntity.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/entity/VisualRecordEntity.java new file mode 100644 index 0000000..c6d3658 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/entity/VisualRecordEntity.java @@ -0,0 +1,102 @@ +package com.yunzhupaas.visualdata.entity; + +import com.alibaba.fastjson.annotation.JSONField; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * 大屏数据集 + * + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023年7月7日 + */ +@Data +@TableName("blade_visual_record") +public class VisualRecordEntity { + + /** 主键 */ + @TableId("ID") + private String id; + + /** 名称 */ + @TableField("name") + private String name; + + /** 请求地址 */ + @TableField("url") + private String url; + + /** 数据集类型 */ + @TableField("dataType") + private Integer dataType; + + /** 请求方法 */ + @TableField("dataMethod") + private String dataMethod; + + /** 数据集类型 */ + @TableField("dataHeader") + private String dataHeader; + + /** 请求数据 */ + @TableField("data") + private String data; + + /** 请求参数 */ + @TableField("dataQuery") + private String dataQuery; + + /** 请求参数类型 */ + @TableField("dataQueryType") + private String dataQueryType; + + /** 过滤器 */ + @TableField("dataFormatter") + private String dataFormatter; + + /** 开启跨域 */ + @TableField("proxy") + private Integer proxy; + + /** WebSocket地址 */ + @TableField("wsUrl") + private String wsUrl; + + /** 数据集类型 */ + @TableField("dbsql") + private String dbsql; + + /** 数据集类型 */ + @TableField("fsql") + @JSONField(name = "sql") + private String fsql; + + /** 数据集类型 */ + @TableField("result") + private String result; + + /** + * MTQQ 连接地址 + */ + @TableField("mqttUrl") + private String mqtturl; + + /** + * MQTT 配置 + */ + @TableField("mqttConfig") + private String mqttConfig; + + /** + * 租户id + */ + @TableField(value = "f_tenant_id" , fill = FieldFill.INSERT) + private String tenantId; + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/enums/VisualImgEnum.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/enums/VisualImgEnum.java new file mode 100644 index 0000000..85000fd --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/enums/VisualImgEnum.java @@ -0,0 +1,72 @@ +package com.yunzhupaas.visualdata.enums; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +public enum VisualImgEnum { + /** + * 背景图片 + */ + BG("0", "bg"), + /** + * 图片框 + */ + BORDER("1", "border"), + /** + * 图片 + */ + SOURCE("2", "source"), + /** + * banner + */ + BANNER("3", "banner"), + /** + * banner + */ + BACKGROUND("5", "background"), + /** + * 大屏截图 + */ + SCREENSHOT("4", "screenShot"); + + /** + * 状态码 + */ + private String code; + /** + * 消息 + */ + private String message; + + VisualImgEnum(String code, String message) { + this.code = code; + this.message = message; + } + + public String getCode() { + return code; + } + + public String getMessage() { + return message; + } + + /** + * 判断名称是否存在 + * + * @return boolean + */ + public static VisualImgEnum getByMessage(String type) { + for (VisualImgEnum value : VisualImgEnum.values()) { + if(value.code.contains(type) || value.getMessage().contains(type)){ + return value; + } + } + return null; + } + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/VisualPageVO.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/VisualPageVO.java new file mode 100644 index 0000000..b70b16e --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/VisualPageVO.java @@ -0,0 +1,44 @@ +package com.yunzhupaas.visualdata.model; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Data +public class VisualPageVO { + /** + * 数据 + */ + @Schema(description ="数据") + private List records; + /** + * 当前页 + */ + @Schema(description ="当前页") + private Long current; + /** + * 每页行数 + */ + @Schema(description ="每页行数") + private Long size; + /** + * 总记录数 + */ + @Schema(description ="总记录数") + private Long total; + /** + * 总页数 + */ + @Schema(description ="总页数") + private Long pages; + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/VisualPagination.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/VisualPagination.java new file mode 100644 index 0000000..b248837 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/VisualPagination.java @@ -0,0 +1,38 @@ +package com.yunzhupaas.visualdata.model; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Data +public class VisualPagination { + @Schema(description ="每页条数",example = "10") + private long size=10; + @Schema(description ="当前页数",example = "1") + private long current=1; + @Schema(hidden = true) + private long total; + @Schema(hidden = true) + private long pages; + + public List setData(IPage page) { + this.total = page.getTotal(); + if (this.total > 0) { + this.pages = this.total % this.size == 0 ? this.total / this.size : this.total / this.size + 1; + } else { + this.pages = 0L; + } + return page.getRecords(); + } +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visual/VisualApiRequest.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visual/VisualApiRequest.java new file mode 100644 index 0000000..c2bac26 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visual/VisualApiRequest.java @@ -0,0 +1,33 @@ +package com.yunzhupaas.visualdata.model.visual; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import jakarta.validation.constraints.NotBlank; +import java.util.Collections; +import java.util.Map; + +/** + * 请求Api数据结构 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Data +public class VisualApiRequest { + + @NotBlank + @Schema(description ="路径") + private String url; + @NotBlank + @Schema(description ="每页条数") + private String method; + @Schema(description ="每页条数") + private Map headers = Collections.emptyMap(); + @Schema(description ="每页条数") + private Map params = Collections.emptyMap(); + @Schema(description ="每页条数") + private int timeout = 3; +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visual/VisualCrModel.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visual/VisualCrModel.java new file mode 100644 index 0000000..f3b3b5d --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visual/VisualCrModel.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.visualdata.model.visual; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Data +public class VisualCrModel { + @Schema(description ="标题") + private String title; + @Schema(description ="密码") + private String password; + @Schema(description ="分类") + private String category; +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visual/VisualCrform.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visual/VisualCrform.java new file mode 100644 index 0000000..c4d5ebc --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visual/VisualCrform.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.visualdata.model.visual; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.visualdata.model.visualconfig.VisualConfigCrForm; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Data +public class VisualCrform { + @Schema(description ="大屏基本信息") + private VisualCrModel visual; + @Schema(description ="大屏配置") + private VisualConfigCrForm config; +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visual/VisualInfoModel.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visual/VisualInfoModel.java new file mode 100644 index 0000000..2f1be92 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visual/VisualInfoModel.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.visualdata.model.visual; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Data +public class VisualInfoModel extends VisualCrModel{ + @Schema(description ="背景url") + private String backgroundUrl; + @Schema(description ="主键") + private String id; +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visual/VisualInfoVO.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visual/VisualInfoVO.java new file mode 100644 index 0000000..ac7c91a --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visual/VisualInfoVO.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.visualdata.model.visual; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.visualdata.model.visualconfig.VisualConfigInfoModel; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Data +public class VisualInfoVO { + @Schema(description ="大屏基本信息") + private VisualInfoModel visual; + @Schema(description ="大屏配置") + private VisualConfigInfoModel config; +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visual/VisualListVO.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visual/VisualListVO.java new file mode 100644 index 0000000..db07a9a --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visual/VisualListVO.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.visualdata.model.visual; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Data +public class VisualListVO { + @Schema(description ="背景url") + private String backgroundUrl; + @Schema(description ="标题") + private String title; + @Schema(description ="密码") + private String password; + @Schema(description ="主键") + private String id; + @Schema(description ="发布状态") + private Integer status; + @Schema(description ="分类") + private String category; + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visual/VisualModel.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visual/VisualModel.java new file mode 100644 index 0000000..852f906 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visual/VisualModel.java @@ -0,0 +1,23 @@ +package com.yunzhupaas.visualdata.model.visual; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.visualdata.entity.VisualConfigEntity; +import com.yunzhupaas.visualdata.entity.VisualEntity; +import lombok.Data; + +/** + * 大屏导出 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年7月10日 + */ +@Data +public class VisualModel { + @Schema(description ="大屏基本信息") + private VisualEntity entity; + @Schema(description ="大屏配置信息") + private VisualConfigEntity configEntity; +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visual/VisualPaginationModel.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visual/VisualPaginationModel.java new file mode 100644 index 0000000..de7cd6a --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visual/VisualPaginationModel.java @@ -0,0 +1,35 @@ +package com.yunzhupaas.visualdata.model.visual; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.visualdata.model.VisualPagination; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Data +public class VisualPaginationModel extends VisualPagination { + @Schema(description ="分类") + private Integer category; + @Schema(description ="名称") + private String title; + @Schema(description ="名称") + private String categoryValue; + @Schema(description ="名称") + private String name; + @Schema(description ="名称") + private String globalName; + @Schema(description ="名称") + private String assetsName; + @Schema(description = "组件类型(0,1)") + private Integer type; + @Schema(description ="上级编码") + private String parentId; + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visual/VisualProxyModel.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visual/VisualProxyModel.java new file mode 100644 index 0000000..fcfba8e --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visual/VisualProxyModel.java @@ -0,0 +1,37 @@ +package com.yunzhupaas.visualdata.model.visual; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import jakarta.validation.constraints.NotBlank; +import java.util.Collections; +import java.util.Map; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023年7月7日 + */ +@Data +public class VisualProxyModel { + + @NotBlank + @Schema(description ="路径") + private String url; + @NotBlank + @Schema(description ="请求方式") + private String method; + @Schema(description ="headers") + private Map headers = Collections.emptyMap(); + @Schema(description ="data") + private Map data = null; + @Schema(description ="params") + private Map params = Collections.emptyMap(); + @Schema(description ="每页条数") + private int timeout = 3; + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visual/VisualSelectorVO.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visual/VisualSelectorVO.java new file mode 100644 index 0000000..83dd3df --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visual/VisualSelectorVO.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.visualdata.model.visual; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Data +public class VisualSelectorVO { + @Schema(description ="主键") + private String id; + @Schema(description ="名称") + private String fullName; + @Schema(description ="是否有下级") + private Boolean hasChildren; + @Schema(description ="下级") + private List children; +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visual/VisualUpModel.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visual/VisualUpModel.java new file mode 100644 index 0000000..035c791 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visual/VisualUpModel.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.visualdata.model.visual; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Data +public class VisualUpModel extends VisualCrModel{ + @Schema(description ="背景url") + private String backgroundUrl; + @Schema(description ="发布状态") + private String status; + @Schema(description ="主键") + private String id; +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visual/VisualUpform.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visual/VisualUpform.java new file mode 100644 index 0000000..e595eb3 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visual/VisualUpform.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.visualdata.model.visual; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.visualdata.model.visualconfig.VisualConfigUpForm; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Data +public class VisualUpform { + @Schema(description ="大屏基本信息") + private VisualUpModel visual; + @Schema(description ="大屏配置") + private VisualConfigUpForm config; +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualassets/VisualAssetsCrForm.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualassets/VisualAssetsCrForm.java new file mode 100644 index 0000000..d35adda --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualassets/VisualAssetsCrForm.java @@ -0,0 +1,41 @@ +package com.yunzhupaas.visualdata.model.visualassets; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023年7月7日 + */ +@Data +public class VisualAssetsCrForm { + + + @Schema(description = "主键") + private String id; + + @Schema(description = "资源名称") + private String assetsName; + + @Schema(description = "资源大小") + private String assetsSize; + + @Schema(description = "资源上传时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date assetsTime; + + @Schema(description = "资源后缀名") + private String assetsType; + + @Schema(description = "资源地址") + private String assetsUrl; +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualassets/VisualAssetsInfoVO.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualassets/VisualAssetsInfoVO.java new file mode 100644 index 0000000..84bd659 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualassets/VisualAssetsInfoVO.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.visualdata.model.visualassets; + +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023年7月7日 + */ +@Data +public class VisualAssetsInfoVO extends VisualAssetsCrForm { + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualassets/VisualAssetsListVO.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualassets/VisualAssetsListVO.java new file mode 100644 index 0000000..d4bccd1 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualassets/VisualAssetsListVO.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.visualdata.model.visualassets; + +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023年7月7日 + */ +@Data +public class VisualAssetsListVO extends VisualAssetsCrForm { + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualassets/VisualAssetsUpForm.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualassets/VisualAssetsUpForm.java new file mode 100644 index 0000000..3fe020d --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualassets/VisualAssetsUpForm.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.visualdata.model.visualassets; + +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023年7月7日 + */ +@Data +public class VisualAssetsUpForm extends VisualAssetsCrForm { + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualcategory/VisualCategoryCrForm.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualcategory/VisualCategoryCrForm.java new file mode 100644 index 0000000..d6f5a4a --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualcategory/VisualCategoryCrForm.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.visualdata.model.visualcategory; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Data +public class VisualCategoryCrForm { + @Schema(description ="分类键值") + private String categoryKey; + @Schema(description ="分类名称") + private String categoryValue; + @Schema(description ="是否已删除") + private Integer isDeleted; +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualcategory/VisualCategoryInfoVO.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualcategory/VisualCategoryInfoVO.java new file mode 100644 index 0000000..a11687f --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualcategory/VisualCategoryInfoVO.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.visualdata.model.visualcategory; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Data +public class VisualCategoryInfoVO { + @Schema(description ="分类键值") + private String categoryKey; + @Schema(description ="分类名称") + private String categoryValue; + @Schema(description ="主键") + private String id; + @Schema(description ="是否已删除") + private Integer isDeleted; +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualcategory/VisualCategoryListVO.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualcategory/VisualCategoryListVO.java new file mode 100644 index 0000000..9360484 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualcategory/VisualCategoryListVO.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.visualdata.model.visualcategory; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Data +public class VisualCategoryListVO { + @Schema(description ="分类键值") + private String categoryKey; + @Schema(description ="分类名称") + private String categoryValue; + @Schema(description ="主键") + private String id; + @Schema(description ="是否已删除") + private Integer isDeleted; +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualcategory/VisualCategoryUpForm.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualcategory/VisualCategoryUpForm.java new file mode 100644 index 0000000..7819b19 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualcategory/VisualCategoryUpForm.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.visualdata.model.visualcategory; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Data +public class VisualCategoryUpForm extends VisualCategoryCrForm { + @Schema(description ="主键") + private String id; +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualcomponent/VisualComponentCrForm.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualcomponent/VisualComponentCrForm.java new file mode 100644 index 0000000..e3f45b5 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualcomponent/VisualComponentCrForm.java @@ -0,0 +1,32 @@ +package com.yunzhupaas.visualdata.model.visualcomponent; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023年7月7日 + */ +@Data +public class VisualComponentCrForm { + + + @Schema(description = "主键") + private String id; + + @Schema(description = "主键") + private String name; + + @Schema(description = "组件内容") + private String content; + + @Schema(description = "组件类型") + private Integer type; + + @Schema(description = "组件图片") + private String img; +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualcomponent/VisualComponentInfoVO.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualcomponent/VisualComponentInfoVO.java new file mode 100644 index 0000000..6aed220 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualcomponent/VisualComponentInfoVO.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.visualdata.model.visualcomponent; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023年7月7日 + */ +@Data +public class VisualComponentInfoVO extends VisualComponentCrForm { + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualcomponent/VisualComponentListVO.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualcomponent/VisualComponentListVO.java new file mode 100644 index 0000000..f596db5 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualcomponent/VisualComponentListVO.java @@ -0,0 +1,28 @@ +package com.yunzhupaas.visualdata.model.visualcomponent; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023年7月7日 + */ +@Data +public class VisualComponentListVO { + + @Schema(description = "主键") + private String id; + + @Schema(description = "主键") + private String name; + + @Schema(description = "组件类型") + private String type; + + @Schema(description = "组件图片") + private String img; +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualcomponent/VisualComponentUpForm.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualcomponent/VisualComponentUpForm.java new file mode 100644 index 0000000..eb75388 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualcomponent/VisualComponentUpForm.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.visualdata.model.visualcomponent; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023年7月7日 + */ +@Data +public class VisualComponentUpForm extends VisualComponentCrForm { + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualconfig/VisualConfigCrForm.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualconfig/VisualConfigCrForm.java new file mode 100644 index 0000000..3da569c --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualconfig/VisualConfigCrForm.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.visualdata.model.visualconfig; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Data +public class VisualConfigCrForm { + @Schema(description ="大屏详情") + private String detail; + @Schema(description ="内容") + private String component; +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualconfig/VisualConfigInfoModel.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualconfig/VisualConfigInfoModel.java new file mode 100644 index 0000000..d1ffd09 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualconfig/VisualConfigInfoModel.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.visualdata.model.visualconfig; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Data +public class VisualConfigInfoModel extends VisualConfigCrForm{ + @Schema(description ="大屏配置主键") + private String id; + @Schema(description ="大屏基本主键") + private String visualId; +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualconfig/VisualConfigUpForm.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualconfig/VisualConfigUpForm.java new file mode 100644 index 0000000..fbc70ff --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualconfig/VisualConfigUpForm.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.visualdata.model.visualconfig; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Data +public class VisualConfigUpForm extends VisualConfigCrForm { + @Schema(description ="大屏配置主键") + private String id; + @Schema(description ="大屏基本主键") + private String visualId; +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualdb/VisualDbCrForm.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualdb/VisualDbCrForm.java new file mode 100644 index 0000000..3bfc93e --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualdb/VisualDbCrForm.java @@ -0,0 +1,28 @@ +package com.yunzhupaas.visualdata.model.visualdb; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Data +public class VisualDbCrForm { + @Schema(description ="驱动") + private String driverClass; + @Schema(description ="密码") + private String password; + @Schema(description ="连接") + private String url; + @Schema(description ="用户名") + private String username; + @Schema(description ="名称") + private String name; + @Schema(description ="备注") + private String remark; +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualdb/VisualDbInfoVO.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualdb/VisualDbInfoVO.java new file mode 100644 index 0000000..9282322 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualdb/VisualDbInfoVO.java @@ -0,0 +1,51 @@ +package com.yunzhupaas.visualdata.model.visualdb; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Data +public class VisualDbInfoVO { + /** 主键 */ + @Schema(description ="主键") + private String id; + + /** 名称 */ + @Schema(description ="名称") + private String name; + + /** 驱动类 */ + @Schema(description ="驱动类") + private String driverClass; + + /** 连接地址 */ + @Schema(description ="连接地址") + private String url; + + /** 用户名 */ + @Schema(description ="用户名") + private String username; + + /** 密码 */ + @Schema(description ="密码") + private String password; + + /** 备注 */ + @Schema(description ="备注") + private String remark; + + /** 状态 */ + @Schema(description ="状态") + private String status; + + /** 是否已删除 */ + @Schema(description ="是否已删除") + private String isDeleted; +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualdb/VisualDbListVO.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualdb/VisualDbListVO.java new file mode 100644 index 0000000..c0db12f --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualdb/VisualDbListVO.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.visualdata.model.visualdb; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Data +public class VisualDbListVO { + @Schema(description ="驱动") + private String driverClass; + @Schema(description ="名称") + private String name; + @Schema(description ="用户名") + private String username; + @Schema(description ="连接") + private String url; + @Schema(description ="主键") + private String id; + @Schema(description ="备注") + private String remark; + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualdb/VisualDbQueryForm.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualdb/VisualDbQueryForm.java new file mode 100644 index 0000000..c97f49e --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualdb/VisualDbQueryForm.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.visualdata.model.visualdb; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Data +public class VisualDbQueryForm { + @Schema(description ="主键") + private String id; + @Schema(description ="sql语句") + private String sql; +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualdb/VisualDbSelectVO.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualdb/VisualDbSelectVO.java new file mode 100644 index 0000000..231ff6d --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualdb/VisualDbSelectVO.java @@ -0,0 +1,23 @@ +package com.yunzhupaas.visualdata.model.visualdb; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Data +public class VisualDbSelectVO { + @Schema(description ="驱动") + private String driverClass; + @Schema(description ="名称") + private String name; + @Schema(description ="主键") + private String id; + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualdb/VisualDbUpForm.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualdb/VisualDbUpForm.java new file mode 100644 index 0000000..619b6a9 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualdb/VisualDbUpForm.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.visualdata.model.visualdb; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Data +public class VisualDbUpForm extends VisualDbCrForm{ + @Schema(description ="主键") + private String id; + + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualfile/ImageVO.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualfile/ImageVO.java new file mode 100644 index 0000000..97bdc67 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualfile/ImageVO.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.visualdata.model.visualfile; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Data +public class ImageVO { + @Schema(description ="路径") + private String domain; + @Schema(description ="链接") + private String link; + @Schema(description ="名称") + private String name; + @Schema(description ="名称") + private String originalName; +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualglob/VisualGlobCrForm.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualglob/VisualGlobCrForm.java new file mode 100644 index 0000000..3f26517 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualglob/VisualGlobCrForm.java @@ -0,0 +1,30 @@ +package com.yunzhupaas.visualdata.model.visualglob; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023年7月7日 + */ +@Data +public class VisualGlobCrForm { + + + @Schema(description = "主键") + private String id; + + @Schema(description = "变量名称") + private String globalName; + + @Schema(description = "变量Key") + private String globalKey; + + @Schema(description = "组变量值") + private String globalValue; +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualglob/VisualGlobInfoVO.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualglob/VisualGlobInfoVO.java new file mode 100644 index 0000000..7adcceb --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualglob/VisualGlobInfoVO.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.visualdata.model.visualglob; + +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023年7月7日 + */ +@Data +public class VisualGlobInfoVO extends VisualGlobCrForm { + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualglob/VisualGlobListVO.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualglob/VisualGlobListVO.java new file mode 100644 index 0000000..3f1e017 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualglob/VisualGlobListVO.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.visualdata.model.visualglob; + +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023年7月7日 + */ +@Data +public class VisualGlobListVO extends VisualGlobCrForm { + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualglob/VisualGlobUpForm.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualglob/VisualGlobUpForm.java new file mode 100644 index 0000000..61601a9 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualglob/VisualGlobUpForm.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.visualdata.model.visualglob; + +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023年7月7日 + */ +@Data +public class VisualGlobUpForm extends VisualGlobCrForm { + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualmap/VisualMapCrForm.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualmap/VisualMapCrForm.java new file mode 100644 index 0000000..7ce9fc4 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualmap/VisualMapCrForm.java @@ -0,0 +1,33 @@ +package com.yunzhupaas.visualdata.model.visualmap; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Data +public class VisualMapCrForm { + @Schema(description ="地图名称") + private String name; + @Schema(description ="地图数据") + private String data; + + @Schema(description ="地图编码") + private String code; + + @Schema(description ="地图级别") + private Integer level; + + @Schema(description ="上级ID") + private String parentId; + + @Schema(description ="上级编码") + private String parentCode; + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualmap/VisualMapInfoVO.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualmap/VisualMapInfoVO.java new file mode 100644 index 0000000..1e37af7 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualmap/VisualMapInfoVO.java @@ -0,0 +1,38 @@ +package com.yunzhupaas.visualdata.model.visualmap; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Data +public class VisualMapInfoVO { + @Schema(description ="地图名称") + private String name; + @Schema(description ="地图数据") + private String data; + @Schema(description ="主键") + private String id; + + @Schema(description ="地图编码") + private String code; + + @Schema(description ="地图级别") + private Integer level; + + @Schema(description ="上级ID") + private String parentId; + + @Schema(description ="上级编码") + private String parentCode; + + @Schema(description ="祖编码") + private String ancestors; + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualmap/VisualMapListVO.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualmap/VisualMapListVO.java new file mode 100644 index 0000000..604d570 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualmap/VisualMapListVO.java @@ -0,0 +1,32 @@ +package com.yunzhupaas.visualdata.model.visualmap; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Data +public class VisualMapListVO { + @Schema(description ="地图名称") + private String name; + @Schema(description ="主键") + private String id; + + @Schema(description ="地图编码") + private String code; + + @Schema(description ="地图级别") + private Integer level; + + @Schema(description ="上级名称") + private String parentName; + + @Schema(description ="是否存在下级") + private Boolean hasChildren; +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualmap/VisualMapUpForm.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualmap/VisualMapUpForm.java new file mode 100644 index 0000000..69ea55e --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualmap/VisualMapUpForm.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.visualdata.model.visualmap; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年6月15日 + */ +@Data +public class VisualMapUpForm extends VisualMapCrForm { + @Schema(description ="主键") + private String id; +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualrecord/VisualRecordCrForm.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualrecord/VisualRecordCrForm.java new file mode 100644 index 0000000..06f231b --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualrecord/VisualRecordCrForm.java @@ -0,0 +1,68 @@ +package com.yunzhupaas.visualdata.model.visualrecord; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023年7月7日 + */ +@Data +public class VisualRecordCrForm { + + + @Schema(description = "主键") + private String id; + + @Schema(description = "名称") + private String name; + + @Schema(description = "请求地址") + private String url; + + @Schema(description = "数据集类型") + private Integer dataType; + + @Schema(description = "请求方法") + private String dataMethod; + + @Schema(description = "数据集类型") + private String dataHeader; + + @Schema(description = "请求数据") + private String data; + + @Schema(description = "请求参数") + private String dataQuery; + + @Schema(description = "请求参数类型") + private String dataQueryType; + + @Schema(description = "过滤器") + private String dataFormatter; + + @Schema(description = "开启跨域") + private Boolean proxy; + + @Schema(description = "WebSocket地址") + private String wsUrl; + + @Schema(description = "数据集类型") + private String dbsql; + + @Schema(description = "数据集类型") + private String sql; + + @Schema(description = "MTQQ 连接地址") + private String mqtturl; + + @Schema(description = "MQTT 配置") + private String mqttConfig; + + @Schema(description = "数据集类型") + private String result; +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualrecord/VisualRecordInfoVO.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualrecord/VisualRecordInfoVO.java new file mode 100644 index 0000000..da97a2b --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualrecord/VisualRecordInfoVO.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.visualdata.model.visualrecord; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023年7月7日 + */ +@Data +public class VisualRecordInfoVO extends VisualRecordCrForm { + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualrecord/VisualRecordListVO.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualrecord/VisualRecordListVO.java new file mode 100644 index 0000000..fd25d37 --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualrecord/VisualRecordListVO.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.visualdata.model.visualrecord; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023年7月7日 + */ +@Data +public class VisualRecordListVO { + + @Schema(description = "主键") + private String id; + + @Schema(description = "名称") + private String name; + + @Schema(description = "数据集类型") + private Integer dataType; + +} + diff --git a/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualrecord/VisualRecordUpForm.java b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualrecord/VisualRecordUpForm.java new file mode 100644 index 0000000..6b4f3ce --- /dev/null +++ b/yunzhupaas-visualdata/yunzhupaas-visualdata-entity/src/main/java/com/yunzhupaas/visualdata/model/visualrecord/VisualRecordUpForm.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.visualdata.model.visualrecord; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023年7月7日 + */ +@Data +public class VisualRecordUpForm extends VisualRecordCrForm { + +} + diff --git a/yunzhupaas-visualdev/pom.xml b/yunzhupaas-visualdev/pom.xml new file mode 100644 index 0000000..22235df --- /dev/null +++ b/yunzhupaas-visualdev/pom.xml @@ -0,0 +1,23 @@ + + + + yunzhupaas-java-boot + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-visualdev + pom + + yunzhupaas-visualdev-base + yunzhupaas-visualdev-onlinedev + yunzhupaas-visualdev-generater + yunzhupaas-visualdev-portal + yunzhupaas-visualdev-integrate + + + + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/pom.xml b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/pom.xml new file mode 100644 index 0000000..b87367d --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/pom.xml @@ -0,0 +1,21 @@ + + + + yunzhupaas-visualdev + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-visualdev-base + pom + + yunzhupaas-visualdev-base-entity + yunzhupaas-visualdev-base-biz + yunzhupaas-visualdev-base-controller + + + + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/pom.xml b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/pom.xml new file mode 100644 index 0000000..2a39ec4 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/pom.xml @@ -0,0 +1,52 @@ + + + + yunzhupaas-visualdev-base + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-visualdev-base-biz + + + + com.yunzhupaas + yunzhupaas-visualdev-base-entity + ${project.version} + + + + org.apache.velocity + velocity-engine-core + + + + com.baomidou + mybatis-plus-generator + + + + com.yunzhupaas + yunzhupaas-visualdev-generater-entity + ${project.version} + compile + + + org.mybatis.dynamic-sql + mybatis-dynamic-sql + + + com.yunzhupaas + yunzhupaas-system-biz + ${project.version} + + + com.yunzhupaas + yunzhupaas-common-security + + + + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/mapper/BillNumMapper.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/mapper/BillNumMapper.java new file mode 100644 index 0000000..972fc6c --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/mapper/BillNumMapper.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.base.mapper; + +import com.yunzhupaas.base.entity.BillNumEntity; + +/** + * 单据递增序号 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/9/4 9:26:52 + */ +public interface BillNumMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/mapper/FilterMapper.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/mapper/FilterMapper.java new file mode 100644 index 0000000..13e5670 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/mapper/FilterMapper.java @@ -0,0 +1,12 @@ +package com.yunzhupaas.base.mapper; + +import com.yunzhupaas.base.entity.FilterEntity; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Repository; + +@Mapper +@Repository +public interface FilterMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/mapper/FlowFormDataMapper.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/mapper/FlowFormDataMapper.java new file mode 100644 index 0000000..26f87f0 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/mapper/FlowFormDataMapper.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.base.mapper; + +import org.apache.ibatis.annotations.Mapper; +import org.mybatis.dynamic.sql.util.mybatis3.*; + +/** + * mybatis3 表单mapper对象 + * + * @author 云筑产品开发平台组 + * @version V3.4.5 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2022/9/27 + */ +@Mapper +public interface FlowFormDataMapper extends CommonCountMapper, CommonDeleteMapper, CommonInsertMapper, CommonSelectMapper, + CommonUpdateMapper { +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/mapper/FlowFormRelationMapper.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/mapper/FlowFormRelationMapper.java new file mode 100644 index 0000000..e389372 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/mapper/FlowFormRelationMapper.java @@ -0,0 +1,15 @@ +package com.yunzhupaas.base.mapper; + +import com.yunzhupaas.base.entity.FlowFormRelationEntity; + +/** + * 流程表单关联 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/30 18:00 + */ +public interface FlowFormRelationMapper extends SuperMapper { +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/mapper/VisualAliasMapper.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/mapper/VisualAliasMapper.java new file mode 100644 index 0000000..a2cbe40 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/mapper/VisualAliasMapper.java @@ -0,0 +1,13 @@ +package com.yunzhupaas.base.mapper; + +import com.yunzhupaas.base.entity.VisualAliasEntity; + +/** + * @author 云筑产品开发平台组 + * @version v5.0.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/4/13 14:03:56 + */ +public interface VisualAliasMapper extends SuperMapper { +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/mapper/VisualdevMapper.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/mapper/VisualdevMapper.java new file mode 100644 index 0000000..3c0318a --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/mapper/VisualdevMapper.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.base.mapper; + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.base.entity.VisualdevEntity; + +/** + * + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @author 云筑产品开发平台组 + * @date 2024/3/16 + */ +public interface VisualdevMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/mapper/VisualdevReleaseMapper.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/mapper/VisualdevReleaseMapper.java new file mode 100644 index 0000000..f98185c --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/mapper/VisualdevReleaseMapper.java @@ -0,0 +1,15 @@ +package com.yunzhupaas.base.mapper; + + +import com.yunzhupaas.base.entity.VisualdevReleaseEntity; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/3/16 + */ +public interface VisualdevReleaseMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/mapper/VisualdevShortLinkMapper.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/mapper/VisualdevShortLinkMapper.java new file mode 100644 index 0000000..cbc96d4 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/mapper/VisualdevShortLinkMapper.java @@ -0,0 +1,15 @@ +package com.yunzhupaas.base.mapper; + +import com.yunzhupaas.base.entity.VisualdevShortLinkEntity; + +/** + * 在线表单外链mapper + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/12/30 11:30:09 + */ +public interface VisualdevShortLinkMapper extends SuperMapper { +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/BillNumService.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/BillNumService.java new file mode 100644 index 0000000..95bf26e --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/BillNumService.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.entity.BillNumEntity; + +/** + * 单据递增序号 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/9/4 9:26:33 + */ +public interface BillNumService extends SuperService { + + void saveBillNum(BillNumEntity entity); + + BillNumEntity getBillNum(String ruleId, String visualId, String flowId); + + void removeByRuleId(String ruleId, String visualId, String flowId); +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/FilterService.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/FilterService.java new file mode 100644 index 0000000..77aac4a --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/FilterService.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.base.service; +import com.yunzhupaas.base.entity.FilterEntity; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.model.filter.RuleInfo; +import org.mybatis.dynamic.sql.SqlTable; +import org.mybatis.dynamic.sql.select.QueryExpressionDSL; +import org.mybatis.dynamic.sql.select.SelectModel; + +import java.util.List; +import java.util.Map; + + +public interface FilterService extends SuperService { + void saveRuleList(String moduleId, VisualdevEntity visualdevEntity, Integer app, Integer pc, Map tableMap); + + void updateRuleList(String moduleId, VisualdevEntity columnData, Integer app, Integer pc, Map tableMap); + + + void handleWhereCondition(SqlTable sqlTable, QueryExpressionDSL.QueryExpressionWhereBuilder where, String id, Map subSqlTableMap, String databaseProductName, Map params); + + void handleWhereCondition(SqlTable sqlTable, QueryExpressionDSL.QueryExpressionWhereBuilder where, String id, Map subSqlTableMap, String databaseProductName); + + // 获取过滤配置 + List getCondition(String id); +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/FlowFormRelationService.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/FlowFormRelationService.java new file mode 100644 index 0000000..65ba65f --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/FlowFormRelationService.java @@ -0,0 +1,36 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.entity.FlowFormRelationEntity; + +import java.util.List; + +/** + * 流程表单关联 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/30 18:01 + */ +public interface FlowFormRelationService extends SuperService { + /** + * 根据流程id保存关联表单 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/10/26 + */ + void saveFlowIdByFormIds(String flowId, List formIds); + + /** + * 根据表单id查询是否存在引用 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/10/26 + */ + List getListByFormId(String formId); +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/VisualAiService.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/VisualAiService.java new file mode 100644 index 0000000..f2d8ed6 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/VisualAiService.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.model.ai.VisualAiModel; + +/** + * 在线开发ai接口 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/12/2 10:10:10 + */ +public interface VisualAiService { + + /** + * ai生成表单模板 + * + * @param keyword + */ + VisualAiModel form(String keyword); +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/VisualAliasService.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/VisualAliasService.java new file mode 100644 index 0000000..5c3b213 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/VisualAliasService.java @@ -0,0 +1,67 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.entity.VisualAliasEntity; +import com.yunzhupaas.base.model.VisualAliasForm; +import com.yunzhupaas.base.util.common.AliasModel; +import com.yunzhupaas.model.visualJson.TableModel; + +import java.util.List; +import java.util.Map; + +/** + * @author 云筑产品开发平台组 + * @version v5.0.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/4/13 14:05:19 + */ +public interface VisualAliasService extends SuperService { + + List getList(String visualId); + + /** + * 获取表 别名列表 + * + * @param id + * @return + */ + List getAliasInfo(String id); + + /** + * 保存或者修改表别名列表 + * + * @param id + * @param form + */ + void aliasSave(String id, VisualAliasForm form); + + /** + * 获取全字段别名,系统字段自动驼峰 + * + * @param id + * @return + */ + Map getAllFiledsAlias(String id); + + /** + * 复制命名规范 + * @param visualId + * @param uuid + * @return + */ + void copy(String visualId,String uuid); + + /** + * 复制单个对象 + * @param visualId + * @param copy + * @return + */ + void copyEntity(VisualAliasEntity copy,String visualId); + + /** + * + * @param visualId + */ + void removeByVisualId(String visualId); +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/VisualdevReleaseService.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/VisualdevReleaseService.java new file mode 100644 index 0000000..d4006b9 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/VisualdevReleaseService.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.base.service; + + +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; +import com.yunzhupaas.base.entity.VisualdevReleaseEntity; + +import java.util.List; + + +/** + * + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @author 云筑产品开发平台组 + * @date 2024/3/16 + */ +public interface VisualdevReleaseService extends SuperService { + + long beenReleased(String id); + + List selectorList(); + + List selectByIds(List ids, SFunction... columns); +} + + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/VisualdevService.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/VisualdevService.java new file mode 100644 index 0000000..3f1b23f --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/VisualdevService.java @@ -0,0 +1,81 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.model.PaginationVisualdev; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.model.visualJson.TableFields; + +import java.util.List; +import java.util.Map; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/3/16 + */ +public interface VisualdevService extends SuperService { + + List getList(PaginationVisualdev paginationVisualdev); + + List getPageList(PaginationVisualdev paginationVisualdev); + + List getList(); + + VisualdevEntity getInfo(String id); + + /** + * 获取已发布的版本, 若未发布获取当前版本 + * + * @param id + * @return + */ + VisualdevEntity getReleaseInfo(String id); + + /** + * 获取动态设计子表名和实际库表名的对应 + * + * @param formData + * @return + */ + Map getTableMap(String formData); + + Boolean create(VisualdevEntity entity); + + boolean update(String id, VisualdevEntity entity) throws Exception; + + /** + * 根据encode判断是否有相同值 + * + * @param encode + * @return + */ + Integer getObjByEncode(String encode, Integer type); + + /** + * 根据name判断是否有相同值 + * + * @param name + * @return + */ + Integer getCountByName(String name, Integer type); + + /** + * 无表生成有表 + * + * @param entity + */ + void createTable(VisualdevEntity entity) throws WorkFlowException; + + Boolean getPrimaryDbField(String linkId, String table) throws Exception; + + List selectorList(); + + /** + * 获取关联表单字段列表 + * + * @param entity + */ + List storedFieldList(VisualdevEntity entity); +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/VisualdevShortLinkService.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/VisualdevShortLinkService.java new file mode 100644 index 0000000..05a5a51 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/VisualdevShortLinkService.java @@ -0,0 +1,15 @@ +package com.yunzhupaas.base.service; + +import com.yunzhupaas.base.entity.VisualdevShortLinkEntity; + +/** + * 在线表单外链service + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/12/30 11:30:57 + */ +public interface VisualdevShortLinkService extends SuperService { +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/impl/BillNumServiceImpl.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/impl/BillNumServiceImpl.java new file mode 100644 index 0000000..3c6284f --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/impl/BillNumServiceImpl.java @@ -0,0 +1,63 @@ +package com.yunzhupaas.base.service.impl; + + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.entity.BillNumEntity; +import com.yunzhupaas.base.mapper.BillNumMapper; +import com.yunzhupaas.base.service.BillNumService; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 单据递增序号 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/9/4 9:28:31 + */ +@Service +public class BillNumServiceImpl extends SuperServiceImpl implements BillNumService { + + public void saveBillNum(BillNumEntity entity) { + if (entity.getId() == null) { + entity.setId(RandomUtil.uuId()); + } + this.saveOrUpdate(entity); + } + + public BillNumEntity getBillNum(String ruleId, String visualId, String flowId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(BillNumEntity::getRuleId, ruleId); + queryWrapper.lambda().eq(BillNumEntity::getVisualId, visualId); + if (StringUtil.isNotEmpty(flowId)) { + queryWrapper.lambda().eq(BillNumEntity::getFlowId, flowId); + } else { + queryWrapper.lambda().isNull(BillNumEntity::getFlowId); + } + List list = this.list(queryWrapper); + if (list.size() > 0) { + BillNumEntity billNumEntity = list.stream().findFirst().orElse(null); + return billNumEntity; + } + return null; + } + + @Override + public void removeByRuleId(String ruleId, String visualId, String flowId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(BillNumEntity::getRuleId, ruleId); + queryWrapper.lambda().eq(BillNumEntity::getVisualId, visualId); + if (StringUtil.isNotEmpty(flowId)) { + queryWrapper.lambda().eq(BillNumEntity::getFlowId, flowId); + } else { + queryWrapper.lambda().isNull(BillNumEntity::getFlowId); + } + this.remove(queryWrapper); + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/impl/FilterServiceImpl.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/impl/FilterServiceImpl.java new file mode 100644 index 0000000..4e83454 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/impl/FilterServiceImpl.java @@ -0,0 +1,194 @@ +package com.yunzhupaas.base.service.impl; + +import cn.hutool.json.JSONUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.entity.FilterEntity; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.mapper.FilterMapper; +import com.yunzhupaas.base.model.filter.RuleInfo; +import com.yunzhupaas.base.service.FilterService; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.base.util.OnlineFilterUtil; +import com.yunzhupaas.database.util.DbTypeUtil; +import com.yunzhupaas.database.util.DynamicDataSourceUtil; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.context.RequestContext; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.mybatis.dynamic.sql.AndOrCriteriaGroup; +import org.mybatis.dynamic.sql.DerivedColumn; +import org.mybatis.dynamic.sql.SqlBuilder; +import org.mybatis.dynamic.sql.SqlTable; +import org.mybatis.dynamic.sql.select.QueryExpressionDSL; +import org.mybatis.dynamic.sql.select.SelectModel; +import org.mybatis.dynamic.sql.where.WhereModel; +import org.springframework.stereotype.Service; + +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; + +@Service +public class FilterServiceImpl extends SuperServiceImpl implements FilterService { + + @Override + public void saveRuleList(String moduleId, VisualdevEntity visualdevEntity, Integer app, Integer pc, Map tableMap) { + if (MapUtils.isEmpty(tableMap)) return; + String columnData = visualdevEntity.getColumnData(); + String appColumnData = visualdevEntity.getAppColumnData(); + + if (columnData == null || columnData.length() == 0) { + columnData = "{}"; + } + if (appColumnData == null || appColumnData.length() == 0) { + appColumnData = "{}"; + } + Map config = JsonUtil.getJsonToBean(columnData, Map.class); + String ruleList = JSONUtil.toJsonStr(config.get("ruleList")); + Map configApp = JsonUtil.getJsonToBean(appColumnData, Map.class); + String ruleListApp = JSONUtil.toJsonStr(configApp.get("ruleListApp")); + FilterEntity entity = new FilterEntity(); + entity.setId(RandomUtil.uuId()); + entity.setModuleId(moduleId); + replaceRealValue(app, pc, tableMap, ruleList, ruleListApp, entity); + entity.setCreatorTime(new Date()); + entity.setLastModifyTime(new Date()); + this.save(entity); + } + + @Override + public void updateRuleList(String moduleId, VisualdevEntity visualdevEntity, Integer app, Integer pc, Map tableMap) { + if (MapUtils.isEmpty(tableMap)) return; + String columnData = visualdevEntity.getColumnData(); + String appColumnData = visualdevEntity.getAppColumnData(); + if (columnData == null || columnData.length() == 0) { + columnData = "{}"; + } + if (appColumnData == null || appColumnData.length() == 0) { + appColumnData = "{}"; + } + + Map config = JsonUtil.getJsonToBean(columnData, Map.class); + String ruleList = JSONUtil.toJsonStr(config.get("ruleList")); + Map configApp = JsonUtil.getJsonToBean(appColumnData, Map.class); + String ruleListApp = JSONUtil.toJsonStr(configApp.get("ruleListApp")); + + List list = this.getBaseMapper() + .selectList(new QueryWrapper().lambda().eq(FilterEntity::getModuleId, moduleId)); + if (list == null || list.size() == 0) { + this.saveRuleList(moduleId, visualdevEntity, app, pc, tableMap); + } else { + FilterEntity entity = list.get(0); + replaceRealValue(app, pc, tableMap, ruleList, ruleListApp, entity); + entity.setLastModifyTime(new Date()); + this.updateById(entity); + } + } + + /** + * 把子表的表名换成实际数据库表名 + * + * @param app 是否更新app配置 + * @param pc 是否更新pc配置 + * @param tableMap 虚拟表名和实际表名映射 + * @param ruleList pc配置 + * @param ruleListApp app配置 + * @param entity 更新的数据 + */ + private void replaceRealValue(Integer app, Integer pc, Map tableMap, String ruleList, String ruleListApp, FilterEntity entity) { + if (app == 1 && StringUtils.isNotBlank(ruleListApp)) { + for (String key : tableMap.keySet()) { + ruleListApp = ruleListApp.replaceAll(key, tableMap.get(key)); + } + + entity.setConfigApp(ruleListApp); + } + if (pc == 1 && StringUtils.isNotBlank(ruleList)) { + for (String key : tableMap.keySet()) { + ruleList = ruleList.replaceAll(key, tableMap.get(key)); + } + entity.setConfig(ruleList); + } + } + + + @Override + public void handleWhereCondition(SqlTable sqlTable, QueryExpressionDSL.QueryExpressionWhereBuilder where, String id, Map subSqlTableMap, String databaseProductName, Map params) { + try { + DynamicDataSourceUtil.switchToDataSource(null); + List ruleInfos = this.getCondition(id); + + QueryExpressionDSL.QueryExpressionWhereBuilder whereFilter = SqlBuilder.select(sqlTable.allColumns()).from(sqlTable).where(); + + for (int i = 0; i < ruleInfos.size(); i++) { + RuleInfo info = ruleInfos.get(i); + OnlineFilterUtil genUtil = JsonUtil.getJsonToBean(info, OnlineFilterUtil.class); + genUtil.setDbType(DbTypeUtil.getDbEncodeByProductName(databaseProductName)); + genUtil.setSubSqlTableMap(subSqlTableMap); + genUtil.setParams(params); + genUtil.solveValue(whereFilter, sqlTable); + } + + Method method = whereFilter.getClass().getDeclaredMethod("buildWhereModel"); + method.setAccessible(true); + WhereModel invoke = (WhereModel) method.invoke(whereFilter); + List groupList = invoke.subCriteria(); + where.and(DerivedColumn.of("1"), SqlBuilder.isEqualTo(1), groupList); + + + } catch (Exception ignored) { + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + + } + + /** + * 在线过滤查询 + * + * @param sqlTable + * @param where + * @param id + * @param subSqlTableMap + * @param databaseProductName + */ + @Override + public void handleWhereCondition(SqlTable sqlTable, QueryExpressionDSL.QueryExpressionWhereBuilder where, String id, Map subSqlTableMap, String databaseProductName) { + this.handleWhereCondition(sqlTable, where, id, subSqlTableMap, databaseProductName, null); + } + + /** + * 获取过滤配置 + * + * @param id + * @return + */ + @Override + public List getCondition(String id) { + if (StringUtils.isEmpty(id)) { + return new ArrayList<>(); + } + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(FilterEntity::getModuleId, id); + FilterEntity entity = this.getOne(wrapper); + // 获取app端还是web端 + String config; + boolean isApp = !RequestContext.isOrignPc(); + if (isApp) { + config = entity.getConfigApp(); + } else { + config = entity.getConfig(); + } + + List ruleInfos = new ArrayList<>(); + if (StringUtils.isNoneBlank(config)) { + ruleInfos = JsonUtil.getJsonToList(config, RuleInfo.class); + } + + return ruleInfos; + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/impl/FlowFormRelationServiceImpl.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/impl/FlowFormRelationServiceImpl.java new file mode 100644 index 0000000..49c6413 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/impl/FlowFormRelationServiceImpl.java @@ -0,0 +1,50 @@ +package com.yunzhupaas.base.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.yunzhupaas.base.entity.FlowFormRelationEntity; +import com.yunzhupaas.base.mapper.FlowFormRelationMapper; +import com.yunzhupaas.base.service.FlowFormRelationService; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.util.RandomUtil; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 流程表单关联 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/30 18:01 + */ +@Service +public class FlowFormRelationServiceImpl extends SuperServiceImpl implements FlowFormRelationService { + + @Override + public void saveFlowIdByFormIds(String flowId, List formIds) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowFormRelationEntity::getFlowId, flowId); + List list = this.list(queryWrapper); + this.removeBatchByIds(list); + if (CollectionUtils.isNotEmpty(formIds)) { + for (String formId : formIds) { + FlowFormRelationEntity entity = new FlowFormRelationEntity(); + entity.setFlowId(flowId); + entity.setId(RandomUtil.uuId()); + entity.setFormId(formId); + this.save(entity); + } + } + } + + @Override + public List getListByFormId(String formId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowFormRelationEntity::getFormId, formId); + List list = this.list(queryWrapper); + return list; + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/impl/VisualAiServiceImpl.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/impl/VisualAiServiceImpl.java new file mode 100644 index 0000000..cf2bd2f --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/impl/VisualAiServiceImpl.java @@ -0,0 +1,141 @@ +package com.yunzhupaas.base.service.impl; + +import com.google.common.base.CaseFormat; +import com.yunzhupaas.base.model.ai.VisualAiModel; +import com.yunzhupaas.base.service.VisualAiService; +import com.yunzhupaas.constant.GenerateConstant; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.constants.AiConstants; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.model.ai.AiFormFieldModel; +import com.yunzhupaas.model.ai.AiFormModel; +import com.yunzhupaas.service.OpenAiService; +import com.yunzhupaas.util.AiLimitUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * 在线开发ai实现 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/12/2 10:05:25 + */ +@Service +public class VisualAiServiceImpl implements VisualAiService { + @Autowired + private OpenAiService openAiService; + + @Override + public VisualAiModel form(String keyword) { + if(!AiLimitUtil.tryAcquire(UserProvider.getUser().getUserId())){ + throw new DataException(MsgCode.SYS182.get()); + } + VisualAiModel visualAiModel = new VisualAiModel(); + List aiModelList = new ArrayList<>(); + List list = openAiService.generatorModelVO(keyword); + if (CollectionUtils.isNotEmpty(list)) { + for (int i = 0; i < list.size(); i++) { + AiFormModel aiFormModel = list.get(i); + if (Objects.equals(0, i)) { + String enCode = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, aiFormModel.getTableName()); + visualAiModel.setFullName(aiFormModel.getTableTitle()); + visualAiModel.setEnCode(enCode); + aiFormModel.setIsMain(true); + } else { + aiFormModel.setIsMain(false); + } + List fields = new ArrayList<>(); + List fieldList = aiFormModel.getFields(); + if (CollectionUtils.isNotEmpty(fieldList)) { + int index = 1; + for (int j = 0; j < fieldList.size(); j++) { + AiFormFieldModel aiFormFieldModel = fieldList.get(j); + String fieldName = aiFormFieldModel.getFieldName(); + String yunzhupaasKey = aiFormFieldModel.getFieldComponent(); + if (containsChinese(fieldName) || GenerateConstant.containKeyword(fieldName)) { + String formatIndex = String.format("%03d", index); + String suffix = "_num" + formatIndex; + aiFormFieldModel.setFieldName(yunzhupaasKey + suffix); + index++; + } + List yunzhupaasKeyList = new ArrayList<>(); + for (String s : AiConstants.GEN_MODEL_COMPNENT.split("-")) { + if (StringUtil.isNotBlank(s)) yunzhupaasKeyList.add(s.trim()); + } + if (!yunzhupaasKeyList.contains(yunzhupaasKey)) { + aiFormFieldModel.setFieldComponent(YunzhupaasKeyConsts.COM_INPUT); + } + //子表控件处理 + if (!aiFormModel.getIsMain()) { + //子表不能有单选框,多选框-调整成下拉框 + List childNotRadio = new ArrayList<>(); + childNotRadio.add(YunzhupaasKeyConsts.RADIO); + childNotRadio.add(YunzhupaasKeyConsts.CHECKBOX); + //子表不能有的其他控件 + List childNotOther = new ArrayList<>(); + childNotOther.add(YunzhupaasKeyConsts.TEXTAREA); + childNotOther.add(YunzhupaasKeyConsts.LINK); + childNotOther.add(YunzhupaasKeyConsts.BUTTON); + childNotOther.add(YunzhupaasKeyConsts.ALERT); + childNotOther.add(YunzhupaasKeyConsts.BARCODE); + childNotOther.add(YunzhupaasKeyConsts.QR_CODE); + childNotOther.add(YunzhupaasKeyConsts.EDITOR); + if (childNotRadio.contains(yunzhupaasKey)) { + aiFormFieldModel.setFieldComponent(YunzhupaasKeyConsts.SELECT); + } else if (childNotOther.contains(yunzhupaasKey)) { + aiFormFieldModel.setFieldComponent(YunzhupaasKeyConsts.COM_INPUT); + } + } + + if (containsKeyWord(aiFormFieldModel.getFieldName())) { + fields.add(aiFormFieldModel); + } + } + } + aiFormModel.setFields(fields); + aiModelList.add(aiFormModel); + } + } + visualAiModel.setAiModelList(aiModelList); + return visualAiModel; + } + + /** + * 判断是否包含中文(字段空或者包含中文字段名称重命名) + * + * @param str + * @return + */ + private static boolean containsChinese(String str) { + if (StringUtil.isEmpty(str)) return true; + Pattern pattern = Pattern.compile("[\u4E00-\u9FA5]"); + Matcher matcher = pattern.matcher(str); + return matcher.find(); + } + + /** + * 字段是否包含特定(用于过滤掉不要的字段如:以_fk结尾是外键,本系统内已自动生成外键) + * + * @param str + * @return + */ + private static boolean containsKeyWord(String str) { + if (str.toLowerCase().endsWith("_fk")) { + return false; + } + return true; + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/impl/VisualAliasServiceImpl.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/impl/VisualAliasServiceImpl.java new file mode 100644 index 0000000..2f5a8ee --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/impl/VisualAliasServiceImpl.java @@ -0,0 +1,259 @@ +package com.yunzhupaas.base.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.google.common.base.CaseFormat; +import com.yunzhupaas.base.entity.VisualAliasEntity; +import com.yunzhupaas.base.entity.VisualdevReleaseEntity; +import com.yunzhupaas.base.mapper.VisualAliasMapper; +import com.yunzhupaas.base.model.VisualAliasForm; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.base.service.VisualAliasService; +import com.yunzhupaas.base.service.VisualdevReleaseService; +import com.yunzhupaas.base.util.common.AliasModel; +import com.yunzhupaas.constant.GenerateConstant; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.model.visualJson.TableFields; +import com.yunzhupaas.model.visualJson.TableModel; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author 云筑产品开发平台组 + * @version v5.0.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/4/13 14:05:48 + */ +@Service +public class VisualAliasServiceImpl extends SuperServiceImpl implements VisualAliasService { + @Autowired + private VisualdevReleaseService visualdevReleaseService; + + + @Override + public List getList(String visualId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualAliasEntity::getVisualId, visualId); + return this.list(queryWrapper); + } + + @Override + public List getAliasInfo(String id) { + VisualdevReleaseEntity visualdevEntity = visualdevReleaseService.getById(id); + List tableModels = JsonUtil.getJsonToList(visualdevEntity.getVisualTables(), TableModel.class); + List list = this.getList(id); + for (TableModel tableModel : tableModels) { + tableModel.setComment(tableModel.getTableName()); + VisualAliasEntity tableAlias = list.stream().filter(t -> tableModel.getTable().equals(t.getTableName()) && t.getFieldName() == null).findFirst().orElse(null); + if (tableAlias != null) { + tableModel.setAliasName(tableAlias.getAliasName()); + } + List fields = tableModel.getFields(); + List newFields = fields.stream().filter(t -> !GenerateConstant.SYS_KEYWORD.contains(t.getField().toLowerCase())).collect(Collectors.toList()); + for (TableFields field : newFields) { + VisualAliasEntity fieldAlias = list.stream().filter(t -> tableModel.getTable().equals(t.getTableName()) && t.getFieldName() != null + && field.getField().equals(t.getFieldName())).findFirst().orElse(null); + if (fieldAlias != null) { + field.setAliasName(fieldAlias.getAliasName()); + } + } + tableModel.setFields(newFields); + } + return tableModels; + } + + @Transactional + @Override + public void aliasSave(String id, VisualAliasForm form) { + List tableList = form.getTableList(); + List list = this.getList(id); + List tableNameList = new ArrayList<>(); + List listKeyword = GenerateConstant.getAllKeyWord(); + String regex = "[a-zA-Z_][a-zA-Z0-9_]*"; + for (TableModel tableModel : tableList) { + VisualAliasEntity tableAlias = list.stream().filter(t -> tableModel.getTable().equals(t.getTableName()) && t.getFieldName() == null).findFirst().orElse(null); + if (StringUtil.isNotEmpty(tableModel.getAliasName())) { + if (tableNameList.contains(tableModel.getAliasName())) { + throw new DataException(tableModel.getAliasName() + MsgCode.VS018.get()); + } else { + tableNameList.add(tableModel.getAliasName()); + } + + if (listKeyword.contains(tableModel.getAliasName().toLowerCase())) { + throw new DataException(MsgCode.SYS128.get(tableModel.getTable() + "-" + tableModel.getAliasName())); + } + + if (!tableModel.getAliasName().matches(regex)) { + throw new DataException(MsgCode.VS021.get(tableModel.getTable())); + } + if (twoCharactesUpperCase(tableModel.getAliasName())) { + throw new DataException(MsgCode.VS026.get()); + } + if (tableAlias != null) { + tableAlias.setAliasName(tableModel.getAliasName()); + } else { + tableAlias = new VisualAliasEntity(); + tableAlias.setId(RandomUtil.uuId()); + tableAlias.setVisualId(id); + tableAlias.setTableName(tableModel.getTable()); + tableAlias.setAliasName(tableModel.getAliasName()); + } + this.saveOrUpdate(tableAlias); + } else if (tableAlias != null) { + this.removeById(tableAlias); + } + List fieldNameList = new ArrayList<>(); + for (TableFields field : tableModel.getFields()) { + VisualAliasEntity fieldAlias = list.stream().filter(t -> tableModel.getTable().equals(t.getTableName()) && t.getFieldName() != null + && field.getField().equals(t.getFieldName())).findFirst().orElse(null); + if (StringUtil.isNotEmpty(field.getAliasName())) { + if (listKeyword.contains(field.getAliasName().toLowerCase())) { + throw new DataException(MsgCode.SYS128.get(field.getField() + "-" + field.getAliasName())); + } + if (!field.getAliasName().matches(regex)) { + throw new DataException(MsgCode.VS021.get(field.getField())); + } + if (twoCharactesUpperCase(field.getAliasName())) { + throw new DataException(MsgCode.VS026.get()); + } + if (fieldNameList.contains(field.getAliasName())) { + throw new DataException(field.getAliasName() + MsgCode.VS020.get()); + } else { + fieldNameList.add(field.getAliasName()); + } + if (fieldAlias != null) { + fieldAlias.setAliasName(field.getAliasName()); + } else { + fieldAlias = new VisualAliasEntity(); + fieldAlias.setId(RandomUtil.uuId()); + fieldAlias.setVisualId(id); + fieldAlias.setTableName(tableModel.getTable()); + fieldAlias.setFieldName(field.getField()); + fieldAlias.setAliasName(field.getAliasName()); + } + this.saveOrUpdate(fieldAlias); + } else if (fieldAlias != null) { + this.removeById(fieldAlias); + } + } + } + } + + @Override + public Map getAllFiledsAlias(String id) { + Map tableMap = new HashMap<>(); + VisualdevReleaseEntity visualdevEntity = visualdevReleaseService.getById(id); + List tableModels = JsonUtil.getJsonToList(visualdevEntity.getVisualTables(), TableModel.class); + List list = this.getList(id); + for (TableModel tableModel : tableModels) { + AliasModel aliasModel = new AliasModel(); + aliasModel.setTableName(tableModel.getTable()); + VisualAliasEntity tableAlias = list.stream().filter(t -> tableModel.getTable().equals(t.getTableName()) && t.getFieldName() == null).findFirst().orElse(null); + if (tableAlias != null) { + aliasModel.setAliasName(tableAlias.getAliasName()); + } else { + aliasModel.setAliasName(tableModel.getTable()); + } + List fields = tableModel.getFields(); + Map fieldMap = new HashMap<>(); + for (TableFields field : fields) { + VisualAliasEntity fieldAlias = list.stream().filter(t -> tableModel.getTable().equals(t.getTableName()) && t.getFieldName() != null + && field.getField().equals(t.getFieldName())).findFirst().orElse(null); + if (fieldAlias != null) { + fieldMap.put(field.getField(), fieldAlias.getAliasName()); + } + //系统字段-以驼峰形式给别名 + else if (GenerateConstant.SYS_KEYWORD.contains(field.getField().toLowerCase())) { + String name = field.getField().toLowerCase(); + name = name.startsWith("f_") ? name.substring(2) : name; + String fieldAliasName = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, name); + fieldMap.put(field.getField(), fieldAliasName); + } else { + String name = field.getField(); + String fieldAliasName = twoToLowerCase(name); + fieldMap.put(field.getField(), fieldAliasName); + } + } + aliasModel.setFieldsMap(fieldMap); + tableMap.put(tableModel.getTable(), aliasModel); + } + return tableMap; + } + + @Override + public void copy(String visualId, String uuid) { + List list = this.getList(visualId); + if (CollectionUtils.isNotEmpty(list)) { + for (VisualAliasEntity entity : list) { + VisualAliasEntity copy = BeanUtil.copyProperties(entity, VisualAliasEntity.class); + copyEntity(copy, uuid); + } + } + } + + @Override + public void copyEntity(VisualAliasEntity copy, String visualId) { + copy.setId(RandomUtil.uuId()); + copy.setVisualId(visualId); + copy.setCreatorTime(new Date()); + copy.setCreatorUserId(UserProvider.getUser().getUserId()); + copy.setLastModifyUserId(null); + copy.setLastModifyTime(null); + this.save(copy); + } + + @Override + public void removeByVisualId(String visualId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualAliasEntity::getVisualId, visualId); + this.remove(queryWrapper); + } + + /** + * 判断前两字母是否大写 + * + * @return + */ + public boolean twoCharactesUpperCase(String name) { + if (StringUtil.isEmpty(name)) { + return false; + } + if (name.length() == 1) { + return Character.isUpperCase(name.charAt(0)); + } + if (name.length() >= 2) { + return Character.isUpperCase(name.charAt(0)) || Character.isUpperCase(name.charAt(1)); + } + return false; + } + + /** + * 两字母强制小写前 + * + * @return + */ + public String twoToLowerCase(String name) { + if (StringUtil.isEmpty(name)) { + return name; + } + name = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, name); + if (name.length() <= 2) { + return name.toLowerCase(); + } + if (name.length() > 2) { + return name.substring(0, 2).toLowerCase() + name.substring(2); + } + return name; + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/impl/VisualdevReleaseServiceImpl.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/impl/VisualdevReleaseServiceImpl.java new file mode 100644 index 0000000..ef0f309 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/impl/VisualdevReleaseServiceImpl.java @@ -0,0 +1,58 @@ +package com.yunzhupaas.base.service.impl; + + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; +import com.yunzhupaas.base.entity.VisualdevReleaseEntity; +import com.yunzhupaas.base.mapper.VisualdevReleaseMapper; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.base.service.VisualdevReleaseService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/3/16 + */ +@Service +public class VisualdevReleaseServiceImpl extends SuperServiceImpl implements VisualdevReleaseService { + + @Override + public long beenReleased(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualdevReleaseEntity::getId, id); + return this.count(queryWrapper); + } + + @Override + public List selectorList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select( + VisualdevReleaseEntity::getId, + VisualdevReleaseEntity::getFullName, + VisualdevReleaseEntity::getWebType, + VisualdevReleaseEntity::getType, + VisualdevReleaseEntity::getCategory); + return this.list(queryWrapper); + } + + @Override + public List selectByIds(List ids, SFunction... columns) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (columns != null) { + queryWrapper.lambda().select(columns); + } else { + queryWrapper.lambda().select( + VisualdevReleaseEntity::getId, + VisualdevReleaseEntity::getFullName, + VisualdevReleaseEntity::getWebType, + VisualdevReleaseEntity::getType, + VisualdevReleaseEntity::getCategory); + } + return this.list(queryWrapper); + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/impl/VisualdevServiceImpl.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/impl/VisualdevServiceImpl.java new file mode 100644 index 0000000..34e124b --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/impl/VisualdevServiceImpl.java @@ -0,0 +1,519 @@ +package com.yunzhupaas.base.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONArray; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.google.common.collect.ImmutableList; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.entity.VisualdevReleaseEntity; +import com.yunzhupaas.base.mapper.VisualdevMapper; +import com.yunzhupaas.base.model.PaginationVisualdev; +import com.yunzhupaas.base.model.dbtable.vo.DbFieldVO; +import com.yunzhupaas.base.model.form.VisualTableModel; +import com.yunzhupaas.base.service.*; +import com.yunzhupaas.base.util.ConcurrencyUtils; +import com.yunzhupaas.base.util.VisualDevTableCre; +import com.yunzhupaas.base.util.VisualUtils; +import com.yunzhupaas.constant.YunzhupaasConst; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.database.constant.DbAliasConst; +import com.yunzhupaas.database.model.dbfield.DbFieldModel; +import com.yunzhupaas.database.model.dbfield.base.DbFieldModelBase; +import com.yunzhupaas.database.model.dbtable.DbTableFieldModel; +import com.yunzhupaas.database.model.entity.DbLinkEntity; +import com.yunzhupaas.database.util.DataSourceUtil; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.model.OnlineDevData; +import com.yunzhupaas.model.visualJson.*; +import com.yunzhupaas.model.visualJson.analysis.FormAllModel; +import com.yunzhupaas.model.visualJson.analysis.FormEnum; +import com.yunzhupaas.model.visualJson.analysis.FormMastTableModel; +import com.yunzhupaas.model.visualJson.analysis.RecursionForm; +import com.yunzhupaas.model.visualJson.config.ConfigModel; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import lombok.SneakyThrows; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/3/16 + */ +@Service +public class VisualdevServiceImpl extends SuperServiceImpl + implements VisualdevService { + + @Autowired + private VisualDevTableCre visualDevTableCreUtil; + @Autowired + private ConcurrencyUtils concurrencyUtils; + @Autowired + private DbTableServiceImpl dbTableService; + @Autowired + private DbLinkService dblinkService; + @Autowired + private DataSourceUtil dataSourceUtil; + @Autowired + private FilterService filterService; + @Autowired + private VisualdevReleaseService visualdevReleaseService; + + @Override + public List getList(PaginationVisualdev paginationVisualdev) { + // 定义变量判断是否需要使用修改时间倒序 + boolean flag = false; + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(VisualdevEntity::getId, VisualdevEntity::getCategory, VisualdevEntity::getEnCode, + VisualdevEntity::getFullName, + VisualdevEntity::getCreatorTime, VisualdevEntity::getCreatorUserId, VisualdevEntity::getLastModifyTime, + VisualdevEntity::getLastModifyUserId, + VisualdevEntity::getEnabledMark, VisualdevEntity::getSortCode, VisualdevEntity::getState, + VisualdevEntity::getType, + VisualdevEntity::getWebType, VisualdevEntity::getVisualTables, VisualdevEntity::getPlatformRelease); + + if (!StringUtil.isEmpty(paginationVisualdev.getKeyword())) { + flag = true; + queryWrapper.lambda().and(t -> t.like(VisualdevEntity::getFullName, paginationVisualdev.getKeyword()) + .or().like(VisualdevEntity::getEnCode, paginationVisualdev.getKeyword())); + } + + if (ObjectUtil.isNotEmpty(paginationVisualdev.getType())) { + queryWrapper.lambda().eq(VisualdevEntity::getType, paginationVisualdev.getType()); + } + + if (StringUtil.isNotEmpty(paginationVisualdev.getCategory())) { + flag = true; + queryWrapper.lambda().eq(VisualdevEntity::getCategory, paginationVisualdev.getCategory()); + } + + // ---功能类型查询 + if (paginationVisualdev.getWebType() != null) {// 普通表单 + flag = true; + queryWrapper.lambda().eq(VisualdevEntity::getWebType, paginationVisualdev.getWebType()); + } + + // 状态 + if (StringUtil.isNotEmpty(paginationVisualdev.getIsRelease())) { + flag = true; + List releaseList = Arrays.asList(paginationVisualdev.getIsRelease().split(",")); + if (releaseList.size() > 1) { + List jsonToList = JsonUtil.getJsonToList(releaseList, Integer.class); + queryWrapper.lambda().in(VisualdevEntity::getState, jsonToList); + } else if (releaseList.size() == 1) { + queryWrapper.lambda().eq(VisualdevEntity::getState, paginationVisualdev.getIsRelease()); + } + + } + + // 排序 + queryWrapper.lambda().orderByAsc(VisualdevEntity::getSortCode).orderByDesc(VisualdevEntity::getCreatorTime); + if (flag) { + queryWrapper.lambda().orderByDesc(VisualdevEntity::getLastModifyTime); + } + Page page = new Page<>(paginationVisualdev.getCurrentPage(), + paginationVisualdev.getPageSize()); + IPage userPage = this.page(page, queryWrapper); + return paginationVisualdev.setData(userPage.getRecords(), page.getTotal()); + } + + @Override + public List getPageList(PaginationVisualdev paginationVisualdev) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select( + VisualdevReleaseEntity::getId, + VisualdevReleaseEntity::getFullName, + VisualdevReleaseEntity::getType, + VisualdevReleaseEntity::getEnCode); + // 1-集成助手,查询列表, 2-流程表单查询,纯表单和列表 + if (paginationVisualdev.getWebType() != null) { + List webType = ImmutableList.of(1, 2, 4); + if (Objects.equals(paginationVisualdev.getWebType(), 1)) { + webType = ImmutableList.of(2); + } else if (Objects.equals(paginationVisualdev.getWebType(), 2)) { + webType = ImmutableList.of(1, 2); + } + queryWrapper.lambda().in(VisualdevReleaseEntity::getWebType, webType); + } + if (!StringUtil.isEmpty(paginationVisualdev.getKeyword())) { + queryWrapper.lambda().like(VisualdevReleaseEntity::getFullName, paginationVisualdev.getKeyword()); + } + if (ObjectUtil.isNotEmpty(paginationVisualdev.getType())) { + queryWrapper.lambda().eq(VisualdevReleaseEntity::getType, paginationVisualdev.getType()); + } + if (StringUtil.isNotEmpty(paginationVisualdev.getCategory())) { + queryWrapper.lambda().eq(VisualdevReleaseEntity::getCategory, paginationVisualdev.getCategory()); + } + // 排序 + queryWrapper.lambda().orderByAsc(VisualdevReleaseEntity::getSortCode) + .orderByDesc(VisualdevReleaseEntity::getCreatorTime); + Page page = new Page<>(paginationVisualdev.getCurrentPage(), + paginationVisualdev.getPageSize()); + IPage userPage = visualdevReleaseService.page(page, queryWrapper); + List list = JsonUtil.getJsonToList(userPage.getRecords(), VisualdevEntity.class); + return paginationVisualdev.setData(list, page.getTotal()); + } + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().orderByAsc(VisualdevEntity::getSortCode).orderByDesc(VisualdevEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public VisualdevEntity getInfo(String id) { + if (StringUtil.isBlank(id)) + return null; + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualdevEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public VisualdevEntity getReleaseInfo(String id) { + VisualdevReleaseEntity visualdevReleaseEntity = visualdevReleaseService.getById(id); + VisualdevEntity visualdevEntity = null; + if (visualdevReleaseEntity != null) { + visualdevEntity = JsonUtil.getJsonToBean(visualdevReleaseEntity, VisualdevEntity.class); + } + if (visualdevEntity == null) { + visualdevEntity = getById(id); + } + return visualdevEntity; + } + + @Override + public Map getTableMap(String formData) { + Map tableMap = new HashMap<>(); + if (StringUtil.isEmpty(formData)) { + return tableMap; + } + FormDataModel formDataModel = JsonUtil.getJsonToBean(formData, FormDataModel.class); + String fields = formDataModel.getFields(); + List list = JsonUtil.getJsonToList(fields, FieLdsModel.class); + list.forEach(item -> { + this.solveTableName(item, tableMap); + }); + return tableMap; + } + + private void solveTableName(FieLdsModel item, Map tableMap) { + ConfigModel config = item.getConfig(); + if (config != null) { + List children = config.getChildren(); + if ("table".equals(config.getYunzhupaasKey())) { + if (children != null && children.size() > 0) { + FieLdsModel fieLdsModel = children.get(0); + String parentVModel = item.getVModel(); + String relationTable = fieLdsModel.getConfig().getRelationTable(); + if (StringUtil.isNotBlank(relationTable)) { + tableMap.put(parentVModel, relationTable); + } + } + } + if (children != null) { + children.forEach(item2 -> { + this.solveTableName(item2, tableMap); + }); + } + } + } + + ; + + @Override + @SneakyThrows + public Boolean create(VisualdevEntity entity) { + if (StringUtil.isEmpty(entity.getId())) { + entity.setId(RandomUtil.uuId()); + } + if (OnlineDevData.FORM_TYPE_DEV.equals(entity.getType())) { + FormDataModel formDataModel = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + if (formDataModel != null) { + // 是否开启安全锁 + int primaryKeyPolicy = formDataModel.getPrimaryKeyPolicy(); + + // 判断是否要创表 + List tableModels = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + // 有表 + if (tableModels.size() > 0) { + Map tableMap = this.getTableMap(entity.getFormData()); + // 保存app,pc过滤配置 + filterService.saveRuleList(entity.getId(), entity, 1, 1, tableMap); + + for (TableModel tableModel : tableModels) { + Boolean isAutoIncre = this.getPrimaryDbField(entity.getDbLinkId(), tableModel.getTable()); + // 1:雪花ID 2:自增ID + if (primaryKeyPolicy == 1) { + if (isAutoIncre != null && isAutoIncre) { + throw new WorkFlowException(MsgCode.VS022.get(tableModel.getTable())); + } + } else if (primaryKeyPolicy == 2) { + if (isAutoIncre == null || !isAutoIncre) { + throw new WorkFlowException(MsgCode.VS023.get(tableModel.getTable())); + } + } + } + + try { + String tableJsonMap = addDbFileds(entity.getDbLinkId(), tableModels, formDataModel); + if (StringUtil.isNotEmpty(tableJsonMap)) { + entity.setVisualTables(tableJsonMap); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } + } + + entity.setEnabledMark(0); + entity.setState(0); + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(UserProvider.getLoginUserId()); + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + this.setIgnoreLogicDelete().removeById(entity.getId()); + boolean result = this.setIgnoreLogicDelete().saveOrUpdate(entity); + this.clearIgnoreLogicDelete(); + return result; + } + + /** + * 数据库表,添加字段 + * + * @param dbLinkId 数据链接id + * @param visualTables 表列表 + * @param formDataModel 表单属性 + * @throws Exception + */ + private String addDbFileds(String dbLinkId, List visualTables, FormDataModel formDataModel) + throws Exception { + if (CollectionUtils.isEmpty(visualTables)) + return null; + + List> tableJsonMap = new ArrayList<>(); + Boolean concurrencyLock = formDataModel.getConcurrencyLock(); + Boolean logicalDelete = formDataModel.getLogicalDelete(); + // 在各个表创建多租户字段强 + for (TableModel tableModel : visualTables) { + boolean isMainTable = tableModel.getTypeId().equals("1"); + List dbFieldModelList = dbTableService.getFieldList(dbLinkId, tableModel.getTable()); + List fieldList = JsonUtil.getJsonToList(dbFieldModelList, DbFieldModelBase.class); + List addList = new ArrayList<>(); + DbLinkEntity dbLink = dblinkService.getInfo(dbLinkId); + String type = dbLink != null ? dbLink.getDbType() : dataSourceUtil.getDbType(); + concurrencyUtils.createTenantId(fieldList, type, addList); + if (logicalDelete) { + concurrencyUtils.creDeleteMark(fieldList, type, addList); + } + if (isMainTable && concurrencyLock) { + concurrencyUtils.createVersion(fieldList, type, addList); + } + if (isMainTable) { + // 流程字段强制生成 + concurrencyUtils.createFlowEngine(fieldList, type, addList); + concurrencyUtils.createFlowTaskId(fieldList, type, addList); + } + concurrencyUtils.addFileds(tableModel.getTable(), dbLinkId, addList); + List voList = new ArrayList<>(); + List listAll = new ArrayList<>(); + listAll.addAll(fieldList); + listAll.addAll(addList); + for (DbFieldModelBase item : listAll) { + DbFieldVO tableFields = new DbFieldVO(); + tableFields.setField(item.getField()); + tableFields.setFieldName(item.getComment()); + tableFields.setDataType(item.getDataType()); + tableFields.setDataLength(item.getLength()); + tableFields.setPrimaryKey(DbAliasConst.PRIMARY_KEY.getNum(item.getIsPrimaryKey())); + tableFields.setAllowNull(DbAliasConst.ALLOW_NULL.getNum(item.getNullSign())); + tableFields.setAutoIncrement(DbAliasConst.AUTO_INCREMENT.getNum(item.getIsAutoIncrement())); + tableFields.setIdentity(DbAliasConst.AUTO_INCREMENT.getNum(item.getIsAutoIncrement())); + voList.add(tableFields); + } + Map stringObjectMap = JsonUtil.entityToMap(tableModel); + stringObjectMap.put("fields", voList); + tableJsonMap.add(stringObjectMap); + } + return JsonUtil.getObjectToString(tableJsonMap); + } + + @Override + public boolean update(String id, VisualdevEntity entity) throws Exception { + entity.setId(id); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + if (OnlineDevData.FORM_TYPE_DEV.equals(entity.getType())) { + // 代码生成修改时就要生成字段 + FormDataModel formDataModel = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + if (formDataModel != null) { + int primaryKeyPolicy = formDataModel.getPrimaryKeyPolicy(); + // 判断是否要创表 + List visualTables = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + // 有表 + if (visualTables.size() > 0) { + if (formDataModel != null) { + try { + // 字段强制生成 + String tableJsonMap = addDbFileds(entity.getDbLinkId(), visualTables, formDataModel); + if (StringUtil.isNotEmpty(tableJsonMap)) { + entity.setVisualTables(tableJsonMap); + } + } catch (Exception e) { + e.printStackTrace(); + } + // 判断自增是否匹配 + concurrencyUtils.checkAutoIncrement(primaryKeyPolicy, entity.getDbLinkId(), visualTables); + } + } + } + } + return this.updateById(entity); + } + + @Override + public Integer getObjByEncode(String encode, Integer type) { + QueryWrapper visualWrapper = new QueryWrapper<>(); + visualWrapper.lambda().eq(VisualdevEntity::getEnCode, encode).eq(VisualdevEntity::getType, type); + Integer count = (int) this.count(visualWrapper); + return count; + } + + @Override + public Integer getCountByName(String name, Integer type) { + QueryWrapper visualWrapper = new QueryWrapper<>(); + visualWrapper.lambda().eq(VisualdevEntity::getFullName, name).eq(VisualdevEntity::getType, type); + Integer count = (int) this.count(visualWrapper); + return count; + } + + @Override + public void createTable(VisualdevEntity entity) throws WorkFlowException { + FormDataModel formDataModel = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + // 是否开启安全锁 + Boolean concurrencyLock = formDataModel.getConcurrencyLock(); + int primaryKeyPolicy = formDataModel.getPrimaryKeyPolicy(); + Boolean logicalDelete = formDataModel.getLogicalDelete(); + + Map formMap = JsonUtil.stringToMap(entity.getFormData()); + List list = JsonUtil.getJsonToList(formMap.get("fields"), FieLdsModel.class); + JSONArray formJsonArray = JsonUtil.getJsonToJsonArray(String.valueOf(formMap.get("fields"))); + List visualTables = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + + List formAllModel = new ArrayList<>(); + RecursionForm recursionForm = new RecursionForm(); + recursionForm.setTableModelList(visualTables); + recursionForm.setList(list); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + + String tableName = "mt" + RandomUtil.uuId(); + + String dbLinkId = entity.getDbLinkId(); + VisualTableModel model = new VisualTableModel(formJsonArray, formAllModel, tableName, dbLinkId, + entity.getFullName(), concurrencyLock, primaryKeyPolicy, logicalDelete); + List tableModelList = visualDevTableCreUtil.tableList(model); + formMap.put("fields", formJsonArray); + // 更新 + entity.setFormData(JsonUtil.getObjectToString(formMap)); + entity.setVisualTables(JsonUtil.getObjectToString(tableModelList)); + } + + @Override + public Boolean getPrimaryDbField(String linkId, String table) throws Exception { + DbTableFieldModel dbTableModel = dbTableService.getDbTableModel(linkId, table); + List data = dbTableModel.getDbFieldModelList(); + DbFieldModel dbFieldModel = data.stream().filter(DbFieldModel::getIsPrimaryKey).findFirst().orElse(null); + if (dbFieldModel != null) { + return dbFieldModel.getIsAutoIncrement() != null && dbFieldModel.getIsAutoIncrement(); + } else { + return null; + } + } + + @Override + public List selectorList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select( + VisualdevEntity::getId, + VisualdevEntity::getFullName, + VisualdevEntity::getWebType, + VisualdevEntity::getType, + VisualdevEntity::getCategory); + return this.list(queryWrapper); + } + + @Override + public List storedFieldList(VisualdevEntity entity) { + List resultList = new ArrayList<>(); + if (entity != null) { + // 是否存在关联数据库 + try { + DbLinkEntity linkEntity = null; + if (StringUtil.isNotEmpty(entity.getDbLinkId())) { + linkEntity = dblinkService.getInfo(entity.getDbLinkId()); + } + // 获取主表 + List listTable = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + String mainTable = listTable.stream().filter(t -> "1".equals(t.getTypeId())).findFirst().orElse(null) + .getTable(); + // 获取主键 + String pKeyName = VisualUtils.getpKey(linkEntity, mainTable); + resultList.add(new TableFields(pKeyName, "表单主键")); + FormDataModel formData = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + List formAllModel = new ArrayList<>(); + RecursionForm recursionForm = new RecursionForm(); + recursionForm.setTableModelList(JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class)); + recursionForm.setList(list); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + List mast = formAllModel.stream() + .filter(t -> FormEnum.mast.getMessage().equals(t.getYunzhupaasKey())) + .collect(Collectors.toList()); + // 列表子表数据 + List mastTable = formAllModel.stream() + .filter(t -> FormEnum.mastTable.getMessage().equals(t.getYunzhupaasKey())) + .collect(Collectors.toList()); + for (FormAllModel item : mast) { + FieLdsModel fieLdsModel = item.getFormColumnModel().getFieLdsModel(); + addField(fieLdsModel.getVModel(), fieLdsModel, resultList); + } + for (FormAllModel item : mastTable) { + FormMastTableModel formMastTableModel = item.getFormMastTableModel(); + FieLdsModel fieLdsModel = formMastTableModel.getMastTable().getFieLdsModel(); + addField(formMastTableModel.getVModel(), fieLdsModel, resultList); + } + } catch (Exception e) { + log.error(e.getMessage()); + } + } + return resultList; + } + + /** + * 添加字段(统一过滤条件) + * + * @param realVmodel + * @param fieLdsModel + * @param resultList + */ + private static void addField(String realVmodel, FieLdsModel fieLdsModel, List resultList) { + List list = Arrays.asList(YunzhupaasKeyConsts.COM_INPUT, YunzhupaasKeyConsts.BILLRULE); + if (StringUtil.isNotEmpty(fieLdsModel.getVModel()) + && list.contains(fieLdsModel.getConfig().getYunzhupaasKey())) { + resultList.add(new TableFields(realVmodel + YunzhupaasConst.FIELD_SUFFIX_YUNZHUPAASID, + fieLdsModel.getConfig().getLabel())); + } + } +} diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/impl/VisualdevShortLinkServiceImpl.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/impl/VisualdevShortLinkServiceImpl.java new file mode 100644 index 0000000..30308b4 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/service/impl/VisualdevShortLinkServiceImpl.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.base.service.impl; + +import com.yunzhupaas.base.entity.VisualdevShortLinkEntity; +import com.yunzhupaas.base.mapper.VisualdevShortLinkMapper; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.base.service.VisualdevShortLinkService; +import org.springframework.stereotype.Service; + +/** + * 在线表单外链service实现 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/12/30 11:31:45 + */ +@Service +public class VisualdevShortLinkServiceImpl extends SuperServiceImpl implements VisualdevShortLinkService { +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/ConcurrencyUtils.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/ConcurrencyUtils.java new file mode 100644 index 0000000..e43b93a --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/ConcurrencyUtils.java @@ -0,0 +1,158 @@ +package com.yunzhupaas.base.util; + +import cn.hutool.core.bean.BeanUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.database.model.dbfield.DbFieldModel; +import com.yunzhupaas.database.model.dbfield.base.DbFieldModelBase; +import com.yunzhupaas.database.model.dbtable.DbTableFieldModel; +import com.yunzhupaas.database.source.DbBase; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.model.visualJson.TableModel; +import com.yunzhupaas.util.TableFeildsEnum; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.List; + +@Component +public class ConcurrencyUtils { + + @Autowired + private ServiceBaseUtil serviceUtil; + + /** + * 根据枚举获取字段对象 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2023/1/14 + */ + public static DbFieldModel getDbFieldModel(TableFeildsEnum tableFeildsEnum, boolean isUpperCase, boolean isLowerCase) { + DbFieldModel dbFieldModel = new DbFieldModel(); + BeanUtil.copyProperties(tableFeildsEnum, dbFieldModel); + String field = dbFieldModel.getField(); + field = isUpperCase ? field.toUpperCase() : isLowerCase ? field.toLowerCase() : field; + dbFieldModel.setField(field); + dbFieldModel.setIsPrimaryKey(tableFeildsEnum.getPrimaryKey()); + //设置租户字段默认值 + if (TableFeildsEnum.TENANTID.equals(tableFeildsEnum)) { + dbFieldModel.setDefaultValue("0"); + } + return dbFieldModel; + } + + /** + * 创建锁字段 + * + * @throws Exception + */ + public void createVersion(List fieldList, String type, List addList) { + addFeild(TableFeildsEnum.VERSION, fieldList, type, addList); + } + + /** + * 创建flowTaskId + * + * @throws Exception + */ + public void createFlowTaskId(List fieldList, String type, List addList) { + addFeild(TableFeildsEnum.FLOWTASKID, fieldList, type, addList); + } + + /** + * 创建租户id + * + * @throws Exception + */ + public void createTenantId(List fieldList, String type, List addList) { + addFeild(TableFeildsEnum.TENANTID, fieldList, type, addList); + } + + /** + * 创建删除字段 + * + * @copyright 深圳市乐程软件有限公司 + * @date 2023/1/14 + */ + public void creDeleteMark(List fieldList, String type, List addList) { + addFeild(TableFeildsEnum.DELETEMARK, fieldList, type, addList); + addFeild(TableFeildsEnum.DELETETIME, fieldList, type, addList); + addFeild(TableFeildsEnum.DELETEUSERID, fieldList, type, addList); + } + + /** + * 创建流程引擎id字段 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2023/1/7 + */ + public void createFlowEngine(List fieldList, String type, List addList) { + addFeild(TableFeildsEnum.FLOWID, fieldList, type, addList); + } + + /** + * 新增字段通用方法 + * + * @param tableFeildsEnum + * @throws Exception + */ + private void addFeild(TableFeildsEnum tableFeildsEnum, List fieldList, String type, List fieldOneList) { + boolean isUpperCase = (DbBase.DM.equals(type) || DbBase.ORACLE.equals(type)); + boolean isLowerCase = (DbBase.POSTGRE_SQL.equals(type) || DbBase.KINGBASE_ES.equals(type)); + DbFieldModelBase dbFieldModel = fieldList.stream().filter(f -> f.getField().equalsIgnoreCase(tableFeildsEnum.getField())).findFirst().orElse(null); + boolean hasVersion = dbFieldModel != null; + if (!hasVersion) { + DbFieldModel dbTableModel1 = this.getDbFieldModel(tableFeildsEnum, isUpperCase, isLowerCase); + fieldOneList.add(dbTableModel1); + } + } + + + /** + * 判断表是否是自增id + * + * @param primaryKeyPolicy + * @param dbLinkId + * @param tableList + * @return + * @throws Exception + */ + public boolean checkAutoIncrement(int primaryKeyPolicy, String dbLinkId, List tableList) throws Exception { + boolean isIncre = primaryKeyPolicy == 2; + String strategy = primaryKeyPolicy == 1 ? "[雪花ID]" : "[自增长id]"; + for (TableModel tableModel : tableList) { + List data = serviceUtil.getFieldList(dbLinkId, tableModel.getTable()); + DbFieldModel dbFieldModel = data.stream().filter(DbFieldModel::getIsPrimaryKey).findFirst().orElse(null); + if (dbFieldModel == null) { + throw new WorkFlowException(MsgCode.FM011.get(tableModel.getTable())); + } + if (!isIncre == (dbFieldModel.getIsAutoIncrement() != null && dbFieldModel.getIsAutoIncrement())) { + throw new WorkFlowException(MsgCode.FM012.get(strategy, tableModel.getTable())); + } + } + return true; + } + + /** + * 执行字段添加 + * @param table + * @param linkId + * @param addList + * @throws Exception + */ + public void addFileds(String table, String linkId, List addList) throws Exception { + if (CollectionUtils.isNotEmpty(addList)) { + DbTableFieldModel dbTableFieldModel = new DbTableFieldModel(); + dbTableFieldModel.setDbFieldModelList(addList); + dbTableFieldModel.setUpdateNewTable(table); + dbTableFieldModel.setUpdateOldTable(table); + dbTableFieldModel.setDbLinkId(linkId); + serviceUtil.addField(dbTableFieldModel); + } + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/DateTimeFormatConstant.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/DateTimeFormatConstant.java new file mode 100644 index 0000000..a85c0d6 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/DateTimeFormatConstant.java @@ -0,0 +1,78 @@ +package com.yunzhupaas.base.util; + +import cn.hutool.core.date.LocalDateTimeUtil; +import cn.hutool.core.util.ObjectUtil; +import com.yunzhupaas.util.DateUtil; + +import java.sql.Timestamp; +import java.time.LocalDateTime; +import java.util.Date; + +/** + * 时间格式 常量 + */ +public class DateTimeFormatConstant { + public static String YEAR = "yyyy"; + public static String YEAR_MOnTH = "yyyy-MM"; + public static String YEAR_MOnTH_DATE = "yyyy-MM-dd"; + public static String YEAR_MOnTH_DHM = "yyyy-MM-dd HH:mm"; + public static String YEAR_MOnTH_DHMS = "yyyy-MM-dd HH:mm:ss"; + public static String HOUR_MINUTE = "HH:mm"; + public static String HOUR_MINUTE_SECOND = "HH:mm:ss"; + + /** + * 时间格式忽略大小写 + * + * @param otherFormat + * @return 返回固定格式 + */ + public static String getFormat(String otherFormat) { + if (YEAR.equalsIgnoreCase(otherFormat)) { + return YEAR; + } + if (YEAR_MOnTH.equalsIgnoreCase(otherFormat)) { + return YEAR_MOnTH; + } + if (YEAR_MOnTH_DATE.equalsIgnoreCase(otherFormat)) { + return YEAR_MOnTH_DATE; + } + if (YEAR_MOnTH_DHM.equalsIgnoreCase(otherFormat)) { + return YEAR_MOnTH_DHM; + } + if (YEAR_MOnTH_DHMS.equalsIgnoreCase(otherFormat)) { + return YEAR_MOnTH_DHMS; + } + if (HOUR_MINUTE.equalsIgnoreCase(otherFormat)) { + return HOUR_MINUTE; + } + if (HOUR_MINUTE_SECOND.equalsIgnoreCase(otherFormat)) { + return HOUR_MINUTE_SECOND; + } + return otherFormat; + } + + /** + * 数据库查询时间字段-转换成long + * 不同数据库查询结果的对象不同 + * + * @param dateObj + * @return long + */ + public static Long getDateObjToLong(Object dateObj) { + LocalDateTime dateTime = null; + if (ObjectUtil.isNotEmpty(dateObj)) { + if (dateObj instanceof LocalDateTime) { + dateTime = (LocalDateTime) dateObj; + } else if (dateObj instanceof Timestamp) { + dateTime = ((Timestamp) dateObj).toLocalDateTime(); + } else if (dateObj instanceof Long) { + dateTime = LocalDateTimeUtil.of(new Date(Long.parseLong(dateObj.toString()))); + } else { + dateTime = LocalDateTimeUtil.of(cn.hutool.core.date.DateUtil.parse(dateObj.toString())); + } + } + return dateTime != null ? DateUtil.localDateTime2Millis(dateTime) : null; + } + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/FlowFormDataUtil.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/FlowFormDataUtil.java new file mode 100644 index 0000000..a2d525b --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/FlowFormDataUtil.java @@ -0,0 +1,1772 @@ +package com.yunzhupaas.base.util; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.mapper.FlowFormDataMapper; +import com.yunzhupaas.base.model.ColumnDataModel; +import com.yunzhupaas.base.model.VisualConst; +import com.yunzhupaas.base.model.VisualDevJsonModel; +import com.yunzhupaas.base.model.flow.DataModel; +import com.yunzhupaas.base.model.form.ModuleFormModel; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.database.model.dbtable.JdbcTableModel; +import com.yunzhupaas.database.model.entity.DbLinkEntity; +import com.yunzhupaas.database.util.ConnUtil; +import com.yunzhupaas.database.util.DbTypeUtil; +import com.yunzhupaas.database.util.DynamicDataSourceUtil; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.model.visualJson.*; +import com.yunzhupaas.model.visualJson.analysis.*; +import com.yunzhupaas.onlinedev.model.OnlineInfoModel; +import com.yunzhupaas.permission.entity.OrganizeEntity; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permissions.PermissionInterfaceImpl; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import lombok.Cleanup; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.collections4.map.CaseInsensitiveMap; +import org.mybatis.dynamic.sql.AndOrCriteriaGroup; +import org.mybatis.dynamic.sql.BasicColumn; +import org.mybatis.dynamic.sql.SqlBuilder; +import org.mybatis.dynamic.sql.SqlTable; +import org.mybatis.dynamic.sql.delete.render.DeleteStatementProvider; +import org.mybatis.dynamic.sql.insert.GeneralInsertDSL; +import org.mybatis.dynamic.sql.insert.render.GeneralInsertStatementProvider; +import org.mybatis.dynamic.sql.render.RenderingStrategies; +import org.mybatis.dynamic.sql.select.QueryExpressionDSL; +import org.mybatis.dynamic.sql.select.SelectModel; +import org.mybatis.dynamic.sql.select.render.SelectStatementProvider; +import org.mybatis.dynamic.sql.update.UpdateDSL; +import org.mybatis.dynamic.sql.update.UpdateModel; +import org.mybatis.dynamic.sql.update.render.UpdateStatementProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.math.BigDecimal; +import java.sql.Connection; +import java.sql.SQLException; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.stream.Collectors; + +@Component +@Slf4j +public class FlowFormDataUtil { + + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private ServiceBaseUtil serviceUtil; + @Autowired + private FlowFormDataMapper flowFormDataMapper; + @Autowired + private FormInfoUtils formInfoUtils; + @Autowired + private VisualBillUtil visualBillUtil; + + /** + * 从数据库取表主键 + * + * @param conn + * @param tableName 表名 + * @return + */ + public String getTableKey(Connection conn, String tableName) throws SQLException { + String pKeyName = JdbcTableModel.getPrimaryExculde(conn, tableName, configValueUtil.getMultiTenantColumn()); + if (StringUtil.isEmpty(pKeyName)) { + pKeyName = TableFeildsEnum.FID.getField(); + } + String databaseProductName = conn.getMetaData().getDatabaseProductName().trim(); + if (DbTypeUtil.needToUpperCase(databaseProductName)) { + pKeyName = pKeyName.toUpperCase(); + } + return pKeyName; + } + + /** + * 从配置取主键 + * + * @param tableModel + * @return String + */ + public String getKey(TableModel tableModel, String databaseProductName) { + boolean toUpperCase = false; + if (StringUtil.isNotEmpty(databaseProductName)) { + if (DbTypeUtil.needToUpperCase(databaseProductName)) { + toUpperCase = !toUpperCase; + } + } + String pKeyName = toUpperCase ? TableFeildsEnum.FID.getField().toUpperCase() : TableFeildsEnum.FID.getField(); + if (tableModel != null && tableModel.getFields() != null) { + TableFields tableFields = tableModel.getFields().stream().filter(t -> Objects.equals(t.getPrimaryKey(), 1) + && !t.getField().toLowerCase().contains(TableFeildsEnum.TENANTID.getField())).findFirst() + .orElse(null); + pKeyName = Objects.nonNull(tableFields) ? tableFields.getField() : pKeyName; + } + return pKeyName; + } + + /** + * 获取流程任务id原字段 flowTaskId + * + * @param tableModel + * @param databaseProductName + * @return + */ + public String getFlowTaskId(TableModel tableModel, String databaseProductName) { + boolean toUpperCase = false; + if (StringUtil.isNotEmpty(databaseProductName)) { + if (DbTypeUtil.needToUpperCase(databaseProductName)) { + toUpperCase = !toUpperCase; + } + } + String pKeyName = toUpperCase ? TableFeildsEnum.FLOWTASKID.getField().toUpperCase() + : TableFeildsEnum.FLOWTASKID.getField(); + if (tableModel != null && tableModel.getFields() != null) { + TableFields tableFields = tableModel.getFields().stream() + .filter(t -> t.getField().toLowerCase().contains(TableFeildsEnum.FLOWTASKID.getField())).findFirst() + .orElse(null); + pKeyName = Objects.nonNull(tableFields) ? tableFields.getField() : pKeyName; + } + return pKeyName; + } + + // ---------------------------------------------信息--------------------------------------------- + + /** + * 获取编辑页数据 + * + * @param visualdevEntity + * @param id + * @return + */ + public Map getEditDataInfo(VisualdevEntity visualdevEntity, String id, OnlineInfoModel infoModel) { + Map allDataMap = new HashMap<>(); + + FormDataModel formData = JsonUtil.getJsonToBean(visualdevEntity.getFormData(), FormDataModel.class); + Boolean logicalDelete = formData.getLogicalDelete(); + + // 权限参数 + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(visualdevEntity.getColumnData(), + ColumnDataModel.class); + Boolean needP = false; + List formPerList = new ArrayList<>(); + if (columnDataModel != null && StringUtil.isNotEmpty(infoModel.getMenuId())) { + needP = columnDataModel.getUseFormPermission(); + Map pMap = PermissionInterfaceImpl.getFormMap(); + if (pMap.get(infoModel.getMenuId()) != null) { + formPerList = JsonUtil.getJsonToList(pMap.get(infoModel.getMenuId()), ModuleFormModel.class).stream() + .map(ModuleFormModel::getEnCode).collect(Collectors.toList()); + } + } + + Object mainId = id; + boolean autoIncrement = Objects.equals(formData.getPrimaryKeyPolicy(), 2); + if (autoIncrement) { + mainId = Long.parseLong(id); + } + // 是否开启并发锁 + String version = ""; + if (formData.getConcurrencyLock()) { + // 查询 + version = TableFeildsEnum.VERSION.getField(); + } + + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + List tableModelList = JsonUtil.getJsonToList(visualdevEntity.getVisualTables(), TableModel.class); + RecursionForm recursionForm = new RecursionForm(); + recursionForm.setList(list); + recursionForm.setTableModelList(tableModelList); + List formAllModel = new ArrayList<>(); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + // form的属性 + List mast = formAllModel.stream() + .filter(t -> FormEnum.mast.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + List table = formAllModel.stream() + .filter(t -> FormEnum.table.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + List mastTable = formAllModel.stream() + .filter(t -> FormEnum.mastTable.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + + TableModel mainTable = tableModelList.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + + DbLinkEntity linkEntity = serviceUtil.getDbLink(visualdevEntity.getDbLinkId()); + try { + DynamicDataSourceUtil.switchToDataSource(linkEntity); + @Cleanup + Connection conn = ConnUtil.getConnOrDefault(linkEntity); + String dbType = conn.getMetaData().getDatabaseProductName(); + String pKeyName = this.getKey(mainTable, dbType); + SqlTable mainSqlTable = SqlTable.of(mainTable.getTable()); + + String flowTaskId = this.getFlowTaskId(mainTable, dbType); + + List groupList = new ArrayList<>(); + groupList.add(SqlBuilder.or(mainSqlTable.column(flowTaskId), SqlBuilder.isEqualTo(mainId.toString()))); + + SelectStatementProvider render = SqlBuilder.select(mainSqlTable.allColumns()) + .from(mainSqlTable) + .where(mainSqlTable.column(pKeyName), SqlBuilder.isEqualTo(mainId), groupList) + .build().render(RenderingStrategies.MYBATIS3); + Map mainAllMap = Optional.ofNullable(flowFormDataMapper.selectOneMappedRow(render)) + .orElse(new HashMap<>()); + if (mainAllMap.size() == 0) { + return new HashMap<>(); + } + // 主表 + List mainTableFields = mast.stream() + .filter(m -> StringUtil.isNotEmpty(m.getFormColumnModel().getFieLdsModel().getVModel())) + .map(s -> s.getFormColumnModel().getFieLdsModel().getVModel()).collect(Collectors.toList()); + // 开启权限移除字段 + if (needP) { + if (CollectionUtils.isEmpty(formPerList)) { + mainTableFields = Collections.EMPTY_LIST; + } else { + List newList = new ArrayList<>(); + for (String item : mainTableFields) { + if (formPerList.contains(item)) { + newList.add(item); + } + } + mainTableFields = newList; + } + } + if (StringUtil.isNotEmpty(version)) { + mainTableFields.add(version); + } + mainTableFields.add(pKeyName); + mainTableFields.add(flowTaskId); + List mainTableBasicColumn = mainTableFields.stream() + .map(m -> SqlTable.of(mainTable.getTable()).column(m)).collect(Collectors.toList()); + SelectStatementProvider mainRender = SqlBuilder.select(mainTableBasicColumn) + .from(mainSqlTable) + .where(mainSqlTable.column(pKeyName), SqlBuilder.isEqualTo(mainId), groupList) + .build().render(RenderingStrategies.MYBATIS3); + Map mainMap = flowFormDataMapper.selectOneMappedRow(mainRender); + if (ObjectUtil.isNotEmpty(mainMap)) { + // 转换主表里的数据 + List mainFieldList = mast.stream() + .filter(m -> StringUtil.isNotEmpty(m.getFormColumnModel().getFieLdsModel().getVModel())) + .map(t -> t.getFormColumnModel().getFieLdsModel()).collect(Collectors.toList()); + mainMap = formInfoUtils.swapDataInfoType(mainFieldList, mainMap); + allDataMap.putAll(mainMap); + allDataMap.put(FlowFormConstant.FLOWTASKID, mainMap.get(flowTaskId)); + } + + // 副表 + Map> groupByTableNames = mastTable.stream() + .map(mt -> mt.getFormMastTableModel()).collect(Collectors.groupingBy(ma -> ma.getTable())); + Iterator>> entryIterator = groupByTableNames.entrySet() + .iterator(); + while (entryIterator.hasNext()) { + Map.Entry> next = entryIterator.next(); + String childTableName = next.getKey(); + List childMastTableList = next.getValue(); + // 开启权限移除字段 + if (needP) { + if (CollectionUtils.isEmpty(formPerList)) { + childMastTableList = Collections.EMPTY_LIST; + } else { + List newList = new ArrayList<>(); + for (FormMastTableModel item : childMastTableList) { + if (formPerList.contains(item.getVModel())) { + newList.add(item); + } + } + childMastTableList = newList; + } + } + TableModel childTableModel = tableModelList.stream().filter(t -> t.getTable().equals(childTableName)) + .findFirst().orElse(null); + SqlTable mastSqlTable = SqlTable.of(childTableName); + List mastTableBasicColumn = childMastTableList.stream() + .filter(m -> StringUtil.isNotEmpty(m.getField())) + .map(m -> mastSqlTable.column(m.getField())).collect(Collectors.toList()); + // 添加副表关联字段,不然数据会空没有字段名称 + mastTableBasicColumn.add(mastSqlTable.column(childTableModel.getTableField())); + // 主表主键 + String mainField = childTableModel.getRelationField(); + Object mainValue = new CaseInsensitiveMap(mainAllMap).get(mainField); + // 子表外键 + String childFoIdFiled = childTableModel.getTableField(); + // 外键字段是否varchar转换 + TableFields fogIdField = childTableModel.getFields().stream() + .filter(t -> t.getField().equals(childFoIdFiled)).findFirst().orElse(null); + boolean fogIdTypeString = Objects.nonNull(fogIdField) + ? fogIdField.getDataType().toLowerCase().contains("varchar") + : false; + if (fogIdTypeString) { + mainValue = mainValue.toString(); + } + + QueryExpressionDSL.QueryExpressionWhereBuilder mastWhere = SqlBuilder + .select(mastTableBasicColumn).from(mastSqlTable).where(); + mastWhere.and(mastSqlTable.column(childFoIdFiled), SqlBuilder.isEqualTo(mainValue)); + // 逻辑删除不展示 + if (logicalDelete) { + mastWhere.and(mastSqlTable.column(TableFeildsEnum.DELETEMARK.getField()), SqlBuilder.isNull()); + } + SelectStatementProvider mastRender = mastWhere.build().render(RenderingStrategies.MYBATIS3); + List> childMapList = flowFormDataMapper.selectManyMappedRows(mastRender); + if (CollectionUtils.isNotEmpty(childMapList)) { + Map soloDataMap = childMapList.get(0); + Map renameKeyMap = new HashMap<>(); + for (Map.Entry entry : soloDataMap.entrySet()) { + FormMastTableModel model = childMastTableList.stream() + .filter(child -> child.getField().equalsIgnoreCase(String.valueOf(entry.getKey()))) + .findFirst().orElse(null); + if (model != null) + renameKeyMap.put(model.getVModel(), entry.getValue()); + } + List columnChildFields = childMastTableList.stream() + .map(cl -> cl.getMastTable().getFieLdsModel()).collect(Collectors.toList()); + renameKeyMap = formInfoUtils.swapDataInfoType(columnChildFields, renameKeyMap); + allDataMap.putAll(renameKeyMap); + } + } + + // 设计子表 + Boolean finalNeedP = needP; + List finalFormPerList = formPerList; + table.stream().map(t -> t.getChildList()).forEach( + t1 -> { + try { + String childTableName = t1.getTableName(); + TableModel tableModel = tableModelList.stream() + .filter(tm -> tm.getTable().equals(childTableName)).findFirst().orElse(null); + SqlTable childSqlTable = SqlTable.of(childTableName); + List chilFieldList = t1.getChildList().stream() + .filter(t2 -> StringUtil.isNotEmpty(t2.getFieLdsModel().getVModel())) + .collect(Collectors.toList()); + String tableModelName = t1.getTableModel(); + // 开启权限移除字段 + if (finalNeedP) { + if (CollectionUtils.isEmpty(finalFormPerList)) { + chilFieldList = Collections.EMPTY_LIST; + } else { + List newList = new ArrayList<>(); + for (FormColumnModel item : chilFieldList) { + if (finalFormPerList + .contains(tableModelName + "-" + item.getFieLdsModel().getVModel())) { + newList.add(item); + } + } + chilFieldList = newList; + } + } + List childFields = chilFieldList.stream() + .map(t2 -> childSqlTable.column(t2.getFieLdsModel().getVModel())) + .collect(Collectors.toList()); + childFields.add(childSqlTable.column(tableModel.getTableField())); + String childKeyName = this.getKey(tableModel, dbType); + childFields.add(childSqlTable.column(childKeyName)); + // 主表主键 + String mainField = tableModel.getRelationField(); + Object mainValue = new CaseInsensitiveMap(mainAllMap).get(mainField); + // 子表外键 + String childFoIdFiled = tableModel.getTableField(); + TableFields fogIdField = tableModel.getFields().stream() + .filter(t -> t.getField().equals(childFoIdFiled)).findFirst().orElse(null); + if (VisualConst.DB_INT_ALL.contains(fogIdField.getField().toLowerCase())) { + mainValue = Long.parseLong(String.valueOf(mainValue)); + } + + QueryExpressionDSL.QueryExpressionWhereBuilder childWhere = SqlBuilder + .select(childFields).from(childSqlTable).where(); + childWhere.and(childSqlTable.column(childFoIdFiled), SqlBuilder.isEqualTo(mainValue)); + // 逻辑删除不展示 + if (logicalDelete) { + childWhere.and(childSqlTable.column(TableFeildsEnum.DELETEMARK.getField()), + SqlBuilder.isNull()); + } + SelectStatementProvider childRender = childWhere.build() + .render(RenderingStrategies.MYBATIS3); + List> childMapList = flowFormDataMapper + .selectManyMappedRows(childRender); + if (ObjectUtil.isNotEmpty(childMapList)) { + List childFieldModels = t1.getChildList().stream() + .map(t2 -> t2.getFieLdsModel()).collect(Collectors.toList()); + childMapList = childMapList.stream().map(c1 -> { + try { + return formInfoUtils.swapDataInfoType(childFieldModels, c1); + } catch (Exception e) { + e.printStackTrace(); + } + return c1; + }).collect(Collectors.toList()); + Map childMap = new HashMap<>(1); + childMap.put(t1.getTableModel(), childMapList); + allDataMap.putAll(childMap); + } + } catch (Exception e) { + e.printStackTrace(); + } + }); + for (String key : allDataMap.keySet()) { + if (pKeyName.equalsIgnoreCase(key)) { + allDataMap.put("id", allDataMap.get(key)); + break; + } + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + return allDataMap; + } + + // ---------------------------------------------新增--------------------------------------------- + + /** + * 新增数据处理 + **/ + @DSTransactional + public Map create(DataModel dataModel) throws WorkFlowException { + try { + // 处理好的数据 + Map result = this.createDataList(dataModel); + return result; + } catch (DataException dataException) { + throw new WorkFlowException(dataException.getMessage()); + } catch (Exception e) { + // close + e.printStackTrace(); + log.error("新增异常:{}", e.getMessage()); + throw new WorkFlowException(MsgCode.FA028.get()); + } + } + + /** + * 新增数据 + **/ + public Map createDataList(DataModel dataModel) throws SQLException, DataException { + // 处理好的数据 + Map result = new HashMap<>(16); + List tableModelList = dataModel.getTableModelList(); + List formAllModel = dataModel.getFormAllModel(); + // 有表数据处理 + if (tableModelList.size() > 0) { + DbLinkEntity link = dataModel.getLink(); + DynamicDataSourceUtil.switchToDataSource(link); + try { + @Cleanup + Connection conn = ConnUtil.getConnOrDefault(link); + String dbType = conn.getMetaData().getDatabaseProductName().trim(); + dataModel.setDbType(dbType); + // 主表 + this.createMast(formAllModel, dataModel, result); + // 子表 + this.createTable(formAllModel, dataModel, result); + // 副表 + this.createMastTable(formAllModel, dataModel, result); + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + } else { + // 无表数据处理 + result = this.createAll(dataModel, formAllModel); + } + return result; + } + + /** + * 子表数据 + **/ + private void createTable(List formAllModel, DataModel dataModel, Map result) + throws SQLException { + List tableModelList = dataModel.getTableModelList(); + Map dataNewMap = dataModel.getDataNewMap(); + boolean autoIncrement = Objects.equals(dataModel.getPrimaryKeyPolicy(), 2); + String flowId = ""; + if (dataNewMap.get(FlowFormConstant.FLOWID) != null + && StringUtil.isNotEmpty(dataNewMap.get(FlowFormConstant.FLOWID).toString())) { + flowId = dataNewMap.get(FlowFormConstant.FLOWID).toString(); + } + + UserEntity userEntity = dataModel.getUserEntity(); + // 子表 + List tableForm = formAllModel.stream() + .filter(t -> FormEnum.table.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + Map> childMap = new HashMap<>(); + Map chidTable = new HashMap<>(); + tableForm.stream().forEach(t -> { + FormColumnTableModel childListAll = t.getChildList(); + String tableModel = childListAll.getTableModel(); + List childList = childListAll.getChildList().stream() + .filter(g -> StringUtil.isNotEmpty(g.getFieLdsModel().getVModel())).collect(Collectors.toList()); + childMap.put(tableModel, childList); + String tableName = childListAll.getTableName(); + Optional first = tableModelList.stream().filter(k -> k.getTable().equals(tableName)) + .findFirst(); + if (first.isPresent()) { + TableModel childTable = first.get(); + chidTable.put(tableModel, childTable); + } + }); + for (String key : childMap.keySet()) { + // 子表数据 + List> chidList = dataNewMap.get(key) != null + ? (List>) dataNewMap.get(key) + : new ArrayList<>(); + List formColumnModels = childMap.get(key); + // 子表 + TableModel tableModel = chidTable.get(key); + String table = tableModel.getTable(); + // 子表主键 + String childKeyName = this.getKey(tableModel, dataModel.getDbType()); + + // 子表外键字段 + String foreignKey = tableModel.getTableField(); + TableFields foreignField = tableModel.getFields().stream() + .filter(t -> t.getField().equalsIgnoreCase(foreignKey)).findFirst().orElse(null); + if (foreignField == null) { + throw new SQLException(MsgCode.COD001.get()); + } + // 主表关联字段 + Object foreignValue = dataNewMap.get(tableModel.getRelationField()); + if (VisualConst.DB_INT_ALL.contains(foreignField.getDataType())) { + foreignValue = Long.parseLong(String.valueOf(foreignValue)); + } + + SqlTable sqlTable = SqlTable.of(table); + for (Map objectMap : chidList) { + if (StringUtil.isNotEmpty(flowId)) { + objectMap.put(FlowFormConstant.FLOWID, flowId); + } + GeneralInsertDSL generalInsertDSL = SqlBuilder.insertInto(sqlTable).set(sqlTable.column(foreignKey)) + .toValue(foreignValue); + for (FormColumnModel column : formColumnModels) { + FieLdsModel fieLdsModel = column.getFieLdsModel(); + String childKey = fieLdsModel.getVModel(); + // 表单字段和外键字段重复不写入(写入外键值) + if (Objects.equals(foreignKey, childKey)) { + continue; + } + Object data = objectMap.get(childKey); + String fieldKey = fieLdsModel.getConfig().getParentVModel() + "-" + childKey; + // 流程表单权限 + if (CollectionUtils.isNotEmpty(dataModel.getFlowFormOperates())) { + boolean hasOperate = isHasOperate(dataModel, fieldKey); + if (!hasOperate) { + continue; + } + } else if (dataModel.getNeedPermission()) { + if (CollectionUtil.isNotEmpty(dataModel.getFormPerList())) { + if (!dataModel.getFormPerList().contains(fieldKey)) { + continue; + } + } else { + continue; + } + } + // 处理系统自动生成 + data = this.create(fieLdsModel, data, true, userEntity, dataModel.isLinkOpen()); + data = visualBillUtil.getBillNumber(dataModel.getVisualId(), fieLdsModel, objectMap, data); + getDSL(sqlTable, null, generalInsertDSL, fieLdsModel.getFormat(), childKey, data); + } + if (!autoIncrement) { + generalInsertDSL = generalInsertDSL.set(sqlTable.column(childKeyName)).toValue(RandomUtil.uuId()); + } + // 租户信息 + addTenantId(generalInsertDSL, sqlTable); + + GeneralInsertStatementProvider insertRender = generalInsertDSL.build() + .render(RenderingStrategies.MYBATIS3); + flowFormDataMapper.generalInsert(insertRender); + } + } + } + + /** + * 副表数据 + **/ + private void createMastTable(List formAllModel, DataModel dataModel, Map result) + throws SQLException { + List tableModelList = dataModel.getTableModelList(); + Map dataNewMap = dataModel.getDataNewMap(); + Integer primaryKeyPolicy = dataModel.getPrimaryKeyPolicy(); + + UserEntity userEntity = dataModel.getUserEntity(); + // 副表 + Map> mastTableAll = formAllModel.stream() + .filter(t -> FormEnum.mastTable.getMessage().equals(t.getYunzhupaasKey())) + .collect(Collectors.groupingBy(e -> e.getFormMastTableModel().getTable())); + for (String key : mastTableAll.keySet()) { + Optional first = tableModelList.stream().filter(t -> t.getTable().equals(key)).findFirst(); + if (!first.isPresent()) { + throw new SQLException(MsgCode.COD001.get()); + } + TableModel tableModel = first.get(); + String tableModelTable = tableModel.getTable(); + String childKeyName = this.getKey(tableModel, dataModel.getDbType()); + + // 副表外键字段 + String foreignKey = tableModel.getTableField(); + TableFields foreignField = tableModel.getFields().stream() + .filter(t -> t.getField().equalsIgnoreCase(foreignKey)).findFirst().orElse(null); + if (foreignField == null) { + throw new SQLException(MsgCode.COD001.get()); + } + // 主表关联字段 + Object foreignValue = dataNewMap.get(tableModel.getRelationField()); + if (VisualConst.DB_INT_ALL.contains(foreignField.getDataType())) { + foreignValue = Long.parseLong(String.valueOf(foreignValue)); + } + + List masTableList = mastTableAll.get(key); + SqlTable sqlTable = SqlTable.of(tableModelTable); + GeneralInsertDSL generalInsertDSL = SqlBuilder.insertInto(sqlTable).set(sqlTable.column(foreignKey)) + .toValue(foreignValue); + + for (FormAllModel model : masTableList) { + FormMastTableModel formMastTableModel = model.getFormMastTableModel(); + FormColumnModel mastTable = formMastTableModel.getMastTable(); + FieLdsModel fieLdsModel = mastTable.getFieLdsModel(); + String mostTableKey = fieLdsModel.getVModel(); + String field = formMastTableModel.getField(); + // 表单字段和外键字段重复不写入(写入外键值) + if (StringUtil.isEmpty(mostTableKey) || Objects.equals(foreignKey, field)) { + continue; + } + Object data = dataNewMap.get(mostTableKey); + // 流程表单权限 + if (CollectionUtils.isNotEmpty(dataModel.getFlowFormOperates())) { + boolean hasOperate = isHasOperate(dataModel, mostTableKey); + if (!hasOperate) { + continue; + } + } else if (dataModel.getNeedPermission()) { + if (CollectionUtil.isNotEmpty(dataModel.getFormPerList())) { + if (!dataModel.getFormPerList().contains(mostTableKey)) { + continue; + } + } else { + continue; + } + } + // 处理系统自动生成 + data = this.create(fieLdsModel, data, true, userEntity, dataModel.isLinkOpen()); + data = visualBillUtil.getBillNumber(dataModel.getVisualId(), fieLdsModel, dataNewMap, data); + // 返回值 + result.put(mostTableKey, data); + getDSL(sqlTable, null, generalInsertDSL, fieLdsModel.getFormat(), field, data); + } + // sql主键 + if (primaryKeyPolicy == 1) { + generalInsertDSL = generalInsertDSL.set(sqlTable.column(childKeyName)).toValue(RandomUtil.uuId()); + } + // 租户信息 + addTenantId(generalInsertDSL, sqlTable); + + GeneralInsertStatementProvider insertRender = generalInsertDSL.build().render(RenderingStrategies.MYBATIS3); + flowFormDataMapper.generalInsert(insertRender); + } + } + + /** + * 主表数据 + **/ + private void createMast(List formAllModel, DataModel dataModel, Map result) + throws SQLException { + List tableModelList = dataModel.getTableModelList(); + Map dataNewMap = dataModel.getDataNewMap(); + Object mainId = dataModel.getMainId(); + boolean autoIncrement = Objects.equals(dataModel.getPrimaryKeyPolicy(), 2); + if (autoIncrement) { + mainId = Long.parseLong(dataModel.getMainId()); + } + UserEntity userEntity = dataModel.getUserEntity(); + Optional first = tableModelList.stream().filter(t -> "1".equals(t.getTypeId())).findFirst(); + if (!first.isPresent()) { + throw new SQLException(MsgCode.COD001.get()); + } + TableModel tableModel = first.get(); + String mastTableName = tableModel.getTable(); + List mastForm = formAllModel.stream() + .filter(t -> FormEnum.mast.getMessage().equals(t.getYunzhupaasKey())) + .filter(t -> StringUtil.isNotEmpty(t.getFormColumnModel().getFieLdsModel().getVModel())) + .collect(Collectors.toList()); + // 新增字段 + String keyName = this.getKey(tableModel, dataModel.getDbType()); + + SqlTable sqlTable = SqlTable.of(mastTableName); + String flowTaskId = this.getFlowTaskId(tableModel, dataModel.getDbType()); + GeneralInsertDSL generalInsertDSL = SqlBuilder.insertInto(sqlTable).set(sqlTable.column(keyName)) + .toValue(mainId) + .set(sqlTable.column(flowTaskId)).toValue(mainId.toString()); + if (autoIncrement) { + generalInsertDSL = SqlBuilder.insertInto(sqlTable).set(sqlTable.column(flowTaskId)) + .toValue(mainId.toString()); + } + + for (FormAllModel model : mastForm) { + FieLdsModel fieLdsModel = model.getFormColumnModel().getFieLdsModel(); + String field = fieLdsModel.getVModel(); + Object data = dataNewMap.get(field); + data = data instanceof List ? JsonUtil.getObjectToString(data) : data; + // 流程表单权限 + if (CollectionUtils.isNotEmpty(dataModel.getFlowFormOperates())) { + boolean hasOperate = isHasOperate(dataModel, field); + if (!hasOperate) { + continue; + } + } else if (dataModel.getNeedPermission()) { + if (CollectionUtil.isNotEmpty(dataModel.getFormPerList())) { + if (!dataModel.getFormPerList().contains(field)) { + continue; + } + } else { + continue; + } + } + // 处理系统自动生成 + data = this.create(fieLdsModel, data, true, userEntity, dataModel.isLinkOpen()); + data = visualBillUtil.getBillNumber(dataModel.getVisualId(), fieLdsModel, dataNewMap, data); + if (YunzhupaasKeyConsts.BILLRULE.equals(fieLdsModel.getConfig().getYunzhupaasKey())) + dataNewMap.put(field, data); + getDSL(sqlTable, null, generalInsertDSL, fieLdsModel.getFormat(), field, data); + } + // 判断是否开启锁 + if (dataModel.getConcurrencyLock()) { + generalInsertDSL = generalInsertDSL.set(sqlTable.column(TableFeildsEnum.VERSION.getField())) + .toValue(dataNewMap.get(TableFeildsEnum.VERSION.getField())); + } + // 添加流程引擎信息 + if (dataNewMap.get(FlowFormConstant.FLOWID) != null + && StringUtil.isNotEmpty(dataNewMap.get(FlowFormConstant.FLOWID).toString())) { + generalInsertDSL = generalInsertDSL.set(sqlTable.column(TableFeildsEnum.FLOWID.getField())) + .toValue(dataNewMap.get(FlowFormConstant.FLOWID)); + } + // 租户信息 + addTenantId(generalInsertDSL, sqlTable); + + GeneralInsertStatementProvider insertRender = generalInsertDSL.build().render(RenderingStrategies.MYBATIS3); + flowFormDataMapper.generalInsert(insertRender); + // 设置实际主键id + getRealMainId(dataModel, tableModel, keyName, autoIncrement, mastTableName, mainId); + dataNewMap.put(keyName, dataModel.getMainId()); + } + + /** + * 获取实际主键id + * + * @param dataModel + * @param realIdKey 主表主键 + * @param autoIncrement 自增设置id + * @param mastTableName + * @throws SQLException + */ + private void getRealMainId(DataModel dataModel, TableModel tableModel, String realIdKey, boolean autoIncrement, + String mastTableName, Object flowTaskId) { + if (autoIncrement) { + String flowTaskKey = this.getFlowTaskId(tableModel, dataModel.getDbType()); + List mastFile = new ArrayList<>(); + mastFile.add(flowTaskKey); + mastFile.add(realIdKey); + SqlTable mastSqlTable = SqlTable.of(mastTableName); + SelectStatementProvider mastRender = SqlBuilder + .select(mastFile.stream().map(m -> mastSqlTable.column(m)).collect(Collectors.toList())) + .from(mastSqlTable) + .where(mastSqlTable.column(flowTaskKey), SqlBuilder.isEqualTo(flowTaskId.toString())) + .build().render(RenderingStrategies.MYBATIS3); + Map map = flowFormDataMapper.selectOneMappedRow(mastRender); + dataModel.setMainId(map.get(realIdKey) != null ? map.get(realIdKey).toString() : dataModel.getMainId()); + } + } + + /** + * 新增系统赋值 + **/ + private Object create(FieLdsModel fieLdsModel, Object dataValue, boolean isTable, UserEntity userEntity, + boolean isLink) { + String yunzhupaasKey = fieLdsModel.getConfig().getYunzhupaasKey(); + String rule = fieLdsModel.getConfig().getRule(); + String format = DateTimeFormatConstant.getFormat(fieLdsModel.getFormat()); + Object value = dataValue; + // 外链跳过系统参数生成 + if (isLink) { + List systemAttList = new ArrayList<>(); + systemAttList.add(YunzhupaasKeyConsts.CREATEUSER); + systemAttList.add(YunzhupaasKeyConsts.CURRORGANIZE); + systemAttList.add(YunzhupaasKeyConsts.CURRPOSITION); + systemAttList.add(YunzhupaasKeyConsts.CURRDEPT); + systemAttList.add(YunzhupaasKeyConsts.MODIFYUSER); + if (systemAttList.contains(yunzhupaasKey)) { + return null; + } + } + switch (yunzhupaasKey) { + case YunzhupaasKeyConsts.CREATEUSER: + value = userEntity.getId(); + break; + case YunzhupaasKeyConsts.CREATETIME: + value = new Date(); + break; + case YunzhupaasKeyConsts.CURRORGANIZE: + case YunzhupaasKeyConsts.CURRDEPT: + value = this.getCurrentOrgIds(userEntity.getOrganizeId(), fieLdsModel.getShowLevel()); + break; + case YunzhupaasKeyConsts.MODIFYTIME: + value = null; + break; + case YunzhupaasKeyConsts.MODIFYUSER: + value = null; + break; + case YunzhupaasKeyConsts.CURRPOSITION: + value = userEntity.getPositionId(); + break; + case YunzhupaasKeyConsts.BILLRULE: + if (fieLdsModel.getConfig().getRuleType() == null + || Objects.equals(fieLdsModel.getConfig().getRuleType(), 1)) { + try { + value = serviceUtil.getBillNumber(rule); + } catch (Exception e) { + value = null; + } + } + break; + case YunzhupaasKeyConsts.DATE: + if (isTable) { + try { + if (dataValue == null || "".equals(dataValue)) { + return null; + } + if (dataValue instanceof String) { + try { + SimpleDateFormat formatter = new SimpleDateFormat(format); + value = formatter.parse(dataValue.toString()); + } catch (ParseException var3) { + return null; + } + } else { + value = new Date(Long.valueOf(String.valueOf(dataValue))); + } + } catch (Exception e) { + } + } + break; + case YunzhupaasKeyConsts.NUM_INPUT: + case YunzhupaasKeyConsts.CALCULATE: + if (isTable) { + try { + value = new BigDecimal(String.valueOf(dataValue)); + } catch (Exception e) { + + } + } + break; + default: + if (isTable) { + value = this.valueToNull(value); + } + break; + } + return value; + } + + /** + * 无表插入数据 + **/ + private Map createAll(DataModel dataModel, List formAllModel) { + Map dataNewMap = dataModel.getDataNewMap(); + UserEntity userEntity = dataModel.getUserEntity(); + // 处理好的数据 + Map result = new HashMap<>(16); + List mastForm = formAllModel.stream() + .filter(t -> FormEnum.mast.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + List tableForm = formAllModel.stream() + .filter(t -> FormEnum.table.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + for (String key : dataNewMap.keySet()) { + FormAllModel model = mastForm.stream() + .filter(t -> key.equals(t.getFormColumnModel().getFieLdsModel().getVModel())).findFirst() + .orElse(null); + if (model != null) { + FieLdsModel fieLdsModel = model.getFormColumnModel().getFieLdsModel(); + Object data = dataNewMap.get(key); + // 处理系统自动生成 + data = this.create(fieLdsModel, data, false, userEntity, dataModel.isLinkOpen()); + result.put(key, data); + } else { + FormAllModel childModel = tableForm.stream().filter(t -> key.equals(t.getChildList().getTableModel())) + .findFirst().orElse(null); + if (childModel != null) { + // 子表主键 + List childList = childModel.getChildList().getChildList(); + List> childDataMap = (List>) dataNewMap.get(key); + // 子表处理的数据 + List> childResult = new ArrayList<>(); + for (Map objectMap : childDataMap) { + // 子表单体处理的数据 + Map childOneResult = new HashMap<>(16); + for (String childKey : objectMap.keySet()) { + FormColumnModel columnModel = childList.stream() + .filter(t -> childKey.equals(t.getFieLdsModel().getVModel())).findFirst() + .orElse(null); + if (columnModel != null) { + FieLdsModel fieLdsModel = columnModel.getFieLdsModel(); + Object data = objectMap.get(childKey); + // 处理系统自动生成 + data = this.create(fieLdsModel, data, false, userEntity, dataModel.isLinkOpen()); + childOneResult.put(childKey, data); + } + } + childResult.add(childOneResult); + } + result.put(key, childResult); + } + } + } + return result; + } + + // --------------------------------------------修改 + // ---------------------------------------------------- + + /** + * 修改数据处理 + **/ + @DSTransactional + public Map update(DataModel dataModel) throws WorkFlowException { + try { + // 处理好的数据 + Map result = this.updateDataList(dataModel); + return result; + } catch (Exception e) { + // close + e.printStackTrace(); + log.error("修改异常:{}", e.getMessage()); + throw new WorkFlowException(MsgCode.FA029.get()); + } + } + + /** + * 修改数据 + **/ + public Map updateDataList(DataModel dataModel) throws SQLException, DataException { + // 处理好的数据 + Map result = new HashMap<>(16); + List tableModelList = dataModel.getTableModelList(); + List formAllModel = dataModel.getFormAllModel(); + // 有表数据处理 + if (tableModelList.size() > 0) { + DbLinkEntity link = dataModel.getLink(); + DynamicDataSourceUtil.switchToDataSource(link); + try { + // 系统数据 + @Cleanup + Connection conn = ConnUtil.getConnOrDefault(link); + String dbType = conn.getMetaData().getDatabaseProductName().trim(); + dataModel.setDbType(dbType); + conn.setAutoCommit(false); + // 主表 + this.updateMast(formAllModel, dataModel, conn, result); + // 子表 + this.updateTable(formAllModel, dataModel, conn, result); + // 副表 + this.updateMastTable(formAllModel, dataModel, conn, result); + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + } else { + // 无表数据处理 + result = this.updateAll(dataModel, formAllModel); + } + return result; + } + + /** + * 子表数据 + **/ + private void updateTable(List formAllModel, DataModel dataModel, Connection conn, + Map result) throws SQLException { + Boolean onlyUpdate = dataModel.getOnlyUpdate(); + Boolean logicalDelete = dataModel.getLogicalDelete(); + List tableModelList = dataModel.getTableModelList(); + Map dataNewMap = dataModel.getDataNewMap(); + Map oldMainData = dataModel.getOldMainData(); + if (MapUtils.isEmpty(oldMainData)) { + return; + } + boolean autoIncrement = Objects.equals(dataModel.getPrimaryKeyPolicy(), 2); + String flowId = ""; + if (dataNewMap.get(FlowFormConstant.FLOWID) != null + && StringUtil.isNotEmpty(dataNewMap.get(FlowFormConstant.FLOWID).toString())) { + flowId = dataNewMap.get(FlowFormConstant.FLOWID).toString(); + } + + // 子表 + List tableForm = formAllModel.stream() + .filter(t -> FormEnum.table.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + Map> childMap = new HashMap<>(); + Map chidTable = new HashMap<>(); + tableForm.stream().forEach(t -> { + FormColumnTableModel childListAll = t.getChildList(); + if (!childListAll.getDisabled()) { + String tableModel = childListAll.getTableModel(); + List childList = childListAll.getChildList().stream() + .filter(g -> StringUtil.isNotEmpty(g.getFieLdsModel().getVModel())) + .collect(Collectors.toList()); + childMap.put(tableModel, childList); + String tableName = childListAll.getTableName(); + Optional first = tableModelList.stream().filter(k -> k.getTable().equals(tableName)) + .findFirst(); + if (first.isPresent()) { + TableModel childTable = first.get(); + chidTable.put(tableModel, childTable); + } + } + }); + + for (String key : childMap.keySet()) { + // 子表数据 + List> chidList = dataNewMap.get(key) != null + ? (List>) dataNewMap.get(key) + : new ArrayList<>(); + List formColumnModels = childMap.get(key); + // 子表主键 + TableModel tableModel = chidTable.get(key); + String table = tableModel.getTable(); + SqlTable sqlTable = SqlTable.of(table); + String childPrimary = this.getKey(tableModel, dataModel.getDbType()); + + // 子表表外键字段 + String foreignKey = tableModel.getTableField(); + TableFields foreignField = tableModel.getFields().stream() + .filter(t -> t.getField().equalsIgnoreCase(foreignKey)).findFirst().orElse(null); + if (foreignField == null) { + throw new SQLException(MsgCode.COD001.get()); + } + // 主表关联字段 + Object foreignValue = dataNewMap.get(tableModel.getRelationField()); + Object oldForeignValue = oldMainData.get(tableModel.getRelationField()); + if (VisualConst.DB_INT_ALL.contains(foreignField.getDataType())) { + foreignValue = Long.parseLong(String.valueOf(foreignValue)); + oldForeignValue = Long.parseLong(String.valueOf(oldForeignValue)); + } + + // 查询旧的子表数据 + SelectStatementProvider render = SqlBuilder.select(sqlTable.column(childPrimary)) + .from(sqlTable) + .where(sqlTable.column(foreignKey), SqlBuilder.isEqualTo(oldForeignValue)) + .build().render(RenderingStrategies.MYBATIS3); + List childIdList = flowFormDataMapper.selectManyMappedRows(render).stream() + .map(t -> new CaseInsensitiveMap(t).get(childPrimary)).collect(Collectors.toList()); + List formDataIdList = chidList.stream() + .filter(t -> new CaseInsensitiveMap(t).containsKey(childPrimary)) + .map(t -> new CaseInsensitiveMap(t).get(childPrimary)).collect(Collectors.toList()); + List deleteList = childIdList.stream().filter(t -> { + List jsonToList = JsonUtil.getJsonToList(formDataIdList, String.class); + if (!jsonToList.contains(String.valueOf(t))) { + return true; + } + return false; + }).collect(Collectors.toList()); + + if (CollectionUtils.isNotEmpty(deleteList) && !onlyUpdate) {// 删除子表id数据 + // 是否开启逻辑删除 + if (logicalDelete) { + UpdateDSL updateModelUpdateDSL = SqlBuilder.update(sqlTable); + updateModelUpdateDSL.set(sqlTable.column(TableFeildsEnum.DELETEMARK.getField())).equalTo(1); + updateModelUpdateDSL.set(sqlTable.column(TableFeildsEnum.DELETETIME.getField())) + .equalTo(new Date()); + updateModelUpdateDSL.set(sqlTable.column(TableFeildsEnum.DELETEUSERID.getField())) + .equalTo(UserProvider.getUser().getUserId()); + UpdateStatementProvider updateRender = updateModelUpdateDSL + .where(sqlTable.column(childPrimary), SqlBuilder.isIn(deleteList)) + .build().render(RenderingStrategies.MYBATIS3); + flowFormDataMapper.update(updateRender); + } else { + DeleteStatementProvider deleteRender = SqlBuilder.deleteFrom(sqlTable) + .where(sqlTable.column(childPrimary), SqlBuilder.isIn(deleteList)) + .build().render(RenderingStrategies.MYBATIS3); + flowFormDataMapper.delete(deleteRender); + } + } + + for (Map objectMap : chidList) { + objectMap = new CaseInsensitiveMap(objectMap); + boolean isUpdate = false; + if (CollectionUtil.isNotEmpty(childIdList)) { + List jsonToList = JsonUtil.getJsonToList(childIdList, String.class); + if (objectMap.get(childPrimary) != null + && jsonToList.contains(String.valueOf(objectMap.get(childPrimary)))) { + isUpdate = true; + } + } + if (StringUtil.isNotEmpty(flowId)) { + objectMap.put(FlowFormConstant.FLOWID, flowId); + } + GeneralInsertDSL generalInsertDSL = SqlBuilder.insertInto(sqlTable).set(sqlTable.column(foreignKey)) + .toValue(foreignValue); + UpdateDSL updateModelUpdateDSL = SqlBuilder.update(sqlTable) + .set(sqlTable.column(foreignKey)).equalTo(foreignValue); + for (FormColumnModel column : formColumnModels) { + FieLdsModel fieLdsModel = column.getFieLdsModel(); + String childKey = fieLdsModel.getVModel(); + String yunzhupaaskey = fieLdsModel.getConfig().getYunzhupaasKey(); + Object data = objectMap.get(childKey); + String fieldKey = fieLdsModel.getConfig().getParentVModel() + "-" + childKey; + if (foreignKey.equalsIgnoreCase(childKey)) { + continue; + } + // 流程表单权限 + if (CollectionUtils.isNotEmpty(dataModel.getFlowFormOperates())) { + boolean hasOperate = isHasOperate(dataModel, fieldKey); + if (!hasOperate) { + continue; + } + } else if (dataModel.getNeedPermission()) { + if (CollectionUtil.isNotEmpty(dataModel.getFormPerList())) { + if (!dataModel.getFormPerList().contains(fieldKey)) { + continue; + } + } else { + continue; + } + } + if (isUpdate) { + if (YunzhupaasKeyConsts.CURRORGANIZE.equals(yunzhupaaskey) + || YunzhupaasKeyConsts.CURRPOSITION.equals(yunzhupaaskey) + || YunzhupaasKeyConsts.CREATETIME.equals(yunzhupaaskey) + || YunzhupaasKeyConsts.CREATEUSER.equals(yunzhupaaskey)) { + continue; + } + } else { + if (YunzhupaasKeyConsts.MODIFYUSER.equals(yunzhupaaskey) + || YunzhupaasKeyConsts.MODIFYTIME.equals(yunzhupaaskey)) { + continue; + } + } + // 处理系统自动生成 + data = this.update(fieLdsModel, data, true, objectMap.get(childPrimary) == null); + data = visualBillUtil.getBillNumber(dataModel.getVisualId(), fieLdsModel, objectMap, data); + getDSL(sqlTable, null, generalInsertDSL, fieLdsModel.getFormat(), childKey, data); + getDSL(sqlTable, updateModelUpdateDSL, null, fieLdsModel.getFormat(), childKey, data); + } + + if (isUpdate) {// 修改 + updateModelUpdateDSL.where(sqlTable.column(childPrimary), + SqlBuilder.isEqualTo(objectMap.get(childPrimary))); + UpdateStatementProvider render1 = updateModelUpdateDSL.build().render(RenderingStrategies.MYBATIS3); + flowFormDataMapper.update(render1); + } else {// 新增 + // 添加主键值和外键值 + if (!autoIncrement) { + generalInsertDSL = generalInsertDSL.set(sqlTable.column(childPrimary)) + .toValue(RandomUtil.uuId()); + } + // 租户信息 + addTenantId(generalInsertDSL, sqlTable); + GeneralInsertStatementProvider insertRender = generalInsertDSL.build() + .render(RenderingStrategies.MYBATIS3); + flowFormDataMapper.generalInsert(insertRender); + } + } + } + } + + /** + * 副表数据 + **/ + private void updateMastTable(List formAllModel, DataModel dataModel, Connection conn, + Map result) throws SQLException { + List tableModelList = dataModel.getTableModelList(); + Map dataNewMap = dataModel.getDataNewMap(); + Map oldMainData = dataModel.getOldMainData(); + if (MapUtils.isEmpty(oldMainData)) { + return; + } + + // 副表 + Map> mastTableAll = formAllModel.stream() + .filter(t -> FormEnum.mastTable.getMessage().equals(t.getYunzhupaasKey())) + .collect(Collectors.groupingBy(e -> e.getFormMastTableModel().getTable())); + for (String key : mastTableAll.keySet()) { + List masTableList = mastTableAll.get(key); + // 副表 + Optional first = tableModelList.stream().filter(t -> t.getTable().equals(key)).findFirst(); + if (!first.isPresent()) { + throw new SQLException(MsgCode.COD001.get()); + } + TableModel tableModel = first.get(); + String tableModelTable = tableModel.getTable(); + SqlTable sqlTable = SqlTable.of(tableModelTable); + String childKeyName = this.getKey(tableModel, dataModel.getDbType()); + + // 副表外键字段 + String foreignKey = tableModel.getTableField(); + TableFields foreignField = tableModel.getFields().stream() + .filter(t -> t.getField().equalsIgnoreCase(foreignKey)).findFirst().orElse(null); + if (foreignField == null) { + throw new SQLException(MsgCode.COD001.get()); + } + // 主表关联字段 + Object foreignValue = dataNewMap.get(tableModel.getRelationField()); + Object oldForeignValue = oldMainData.get(tableModel.getRelationField()); + if (VisualConst.DB_INT_ALL.contains(foreignField.getDataType())) { + foreignValue = Long.parseLong(String.valueOf(foreignValue)); + oldForeignValue = Long.parseLong(String.valueOf(oldForeignValue)); + } + + UpdateDSL updateModelUpdateDSL = SqlBuilder.update(sqlTable).set(sqlTable.column(foreignKey)) + .equalTo(foreignValue); + + for (FormAllModel model : masTableList) { + FormMastTableModel formMastTableModel = model.getFormMastTableModel(); + FormColumnModel mastTable = formMastTableModel.getMastTable(); + FieLdsModel fieLdsModel = mastTable.getFieLdsModel(); + String mostTableKey = fieLdsModel.getVModel(); + String yunzhupaaskey = fieLdsModel.getConfig().getYunzhupaasKey(); + Object data = dataNewMap.get(mostTableKey); + String field = formMastTableModel.getField(); + // 外键值写入不覆盖 + if (foreignKey.equalsIgnoreCase(field)) { + continue; + } + // 流程表单权限 + if (CollectionUtils.isNotEmpty(dataModel.getFlowFormOperates())) { + boolean hasOperate = isHasOperate(dataModel, mostTableKey); + if (!hasOperate) { + continue; + } + } else if (dataModel.getNeedPermission()) { + if (CollectionUtil.isNotEmpty(dataModel.getFormPerList())) { + if (!dataModel.getFormPerList().contains(mostTableKey)) { + continue; + } + } else { + continue; + } + } + + if (YunzhupaasKeyConsts.CURRORGANIZE.equals(yunzhupaaskey) + || YunzhupaasKeyConsts.CURRPOSITION.equals(yunzhupaaskey) + || YunzhupaasKeyConsts.CREATETIME.equals(yunzhupaaskey) + || YunzhupaasKeyConsts.CREATEUSER.equals(yunzhupaaskey)) { + continue; + } + // 处理系统自动生成 + data = this.update(fieLdsModel, data, true, false); + data = visualBillUtil.getBillNumber(dataModel.getVisualId(), fieLdsModel, dataNewMap, data); + getDSL(sqlTable, updateModelUpdateDSL, null, fieLdsModel.getFormat(), field, data); + } + + UpdateStatementProvider updateStatementProvider = updateModelUpdateDSL + .where(sqlTable.column(foreignKey), SqlBuilder.isEqualTo(oldForeignValue)) + .build().render(RenderingStrategies.MYBATIS3); + flowFormDataMapper.update(updateStatementProvider); + } + } + + /** + * 主表数据 + **/ + private void updateMast(List formAllModel, DataModel dataModel, Connection conn, + Map result) throws SQLException { + List tableModelList = dataModel.getTableModelList(); + Map dataNewMap = dataModel.getDataNewMap(); + List mastForm = formAllModel.stream() + .filter(t -> FormEnum.mast.getMessage().equals(t.getYunzhupaasKey())).filter( + t -> StringUtil.isNotEmpty(t.getFormColumnModel().getFieLdsModel().getVModel())) + .collect(Collectors.toList()); + + Optional first = tableModelList.stream().filter(t -> "1".equals(t.getTypeId())).findFirst(); + if (!first.isPresent()) { + throw new SQLException(MsgCode.COD001.get()); + } + TableModel tableModel = first.get(); + String mastTableName = tableModel.getTable(); + SqlTable sqlTable = SqlTable.of(mastTableName); + TableFields keyFieldModel = tableModel.getFields().stream().filter(t -> Objects.equals(t.getPrimaryKey(), 1) + && !t.getField().toLowerCase().contains(TableFeildsEnum.TENANTID.getField())).findFirst().orElse(null); + if (keyFieldModel == null) { + throw new SQLException(MsgCode.COD001.get()); + } + String keyName = keyFieldModel.getField(); + + // 设置实际主键id + Object mainId = dataModel.getMainId(); + if (VisualConst.DB_INT_ALL.contains(keyFieldModel.getDataType().toLowerCase())) { + mainId = Long.parseLong(dataModel.getMainId()); + } + dataNewMap.put(keyName, mainId); + + // 查询旧的主表数据(用于确定修改时外键字段信息) + SelectStatementProvider render = SqlBuilder.select(sqlTable.allColumns()) + .from(sqlTable) + .where(sqlTable.column(keyName), SqlBuilder.isEqualTo(mainId)) + .build().render(RenderingStrategies.MYBATIS3); + List> maps = flowFormDataMapper.selectManyMappedRows(render); + if (CollectionUtils.isEmpty(maps)) { + return; + } + dataModel.setOldMainData(maps.get(0)); + + UpdateDSL updateModelUpdateDSL = SqlBuilder.update(sqlTable); + int num = 0; + + for (FormAllModel model : mastForm) { + FieLdsModel fieLdsModel = model.getFormColumnModel().getFieLdsModel(); + String yunzhupaaskey = fieLdsModel.getConfig().getYunzhupaasKey(); + String field = fieLdsModel.getVModel(); + Object data = dataNewMap.get(field); + + // 流程表单权限 + if (CollectionUtils.isNotEmpty(dataModel.getFlowFormOperates())) { + boolean hasOperate = isHasOperate(dataModel, field); + if (!hasOperate) { + continue; + } + } else if (dataModel.getNeedPermission()) { + if (CollectionUtil.isNotEmpty(dataModel.getFormPerList())) { + if (!dataModel.getFormPerList().contains(field)) { + continue; + } + } else { + continue; + } + } + + if (YunzhupaasKeyConsts.CURRORGANIZE.equals(yunzhupaaskey) + || YunzhupaasKeyConsts.CURRPOSITION.equals(yunzhupaaskey) + || YunzhupaasKeyConsts.CREATETIME.equals(yunzhupaaskey) + || YunzhupaasKeyConsts.CREATEUSER.equals(yunzhupaaskey)) { + continue; + } + // 处理系统自动生成 + data = this.update(fieLdsModel, data, true, false); + data = visualBillUtil.getBillNumber(dataModel.getVisualId(), fieLdsModel, dataNewMap, data); + getDSL(sqlTable, updateModelUpdateDSL, null, fieLdsModel.getFormat(), field, data); + num++; + } + // 判断是否开启锁 + if (dataModel.getConcurrencyLock()) { + updateModelUpdateDSL = updateModelUpdateDSL.set(sqlTable.column(TableFeildsEnum.VERSION.getField())) + .equalTo(dataNewMap.get(TableFeildsEnum.VERSION.getField())); + } + + // 添加流程引擎信息 + if (dataNewMap.get(FlowFormConstant.FLOWID) != null + && StringUtil.isNotEmpty(dataNewMap.get(FlowFormConstant.FLOWID).toString())) { + updateModelUpdateDSL = updateModelUpdateDSL.set(sqlTable.column(TableFeildsEnum.FLOWID.getField())) + .equalTo(dataNewMap.get(FlowFormConstant.FLOWID)); + } + + UpdateStatementProvider updateStatementProvider = updateModelUpdateDSL + .where(sqlTable.column(keyName), SqlBuilder.isEqualTo(mainId)) + .build().render(RenderingStrategies.MYBATIS3); + if (num > 0) { + flowFormDataMapper.update(updateStatementProvider); + } + } + + /** + * 修改无表数据 + **/ + private Map updateAll(DataModel dataModel, List formAllModel) { + Map dataNewMap = dataModel.getDataNewMap(); + // 处理好的数据 + Map result = new HashMap<>(16); + // 系统数据 + List mastForm = formAllModel.stream() + .filter(t -> FormEnum.mast.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + List tableForm = formAllModel.stream() + .filter(t -> FormEnum.table.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + for (String key : dataNewMap.keySet()) { + FormAllModel model = mastForm.stream() + .filter(t -> key.equals(t.getFormColumnModel().getFieLdsModel().getVModel())).findFirst() + .orElse(null); + if (model != null) { + FieLdsModel fieLdsModel = model.getFormColumnModel().getFieLdsModel(); + Object data = dataNewMap.get(key); + // 处理系统自动生成 + data = this.update(fieLdsModel, data, false, false); + result.put(key, data); + } else { + FormAllModel childModel = tableForm.stream().filter(t -> key.equals(t.getChildList().getTableModel())) + .findFirst().orElse(null); + if (childModel != null) { + List> childDataMap = (List>) dataNewMap.get(key); + // 子表处理的数据 + List> childResult = new ArrayList<>(); + for (Map objectMap : childDataMap) { + // 子表单体处理的数据 + Map childOneResult = new HashMap<>(16); + for (String childKey : objectMap.keySet()) { + FormColumnModel columnModel = childModel.getChildList().getChildList().stream() + .filter(t -> childKey.equals(t.getFieLdsModel().getVModel())).findFirst() + .orElse(null); + if (columnModel != null) { + FieLdsModel fieLdsModel = columnModel.getFieLdsModel(); + Object data = objectMap.get(childKey); + data = this.update(fieLdsModel, data, false, false); + childOneResult.put(childKey, data); + } + } + childResult.add(childOneResult); + } + result.put(key, childResult); + } + } + } + return result; + } + + /** + * childNeedAdd子表id为空需要生成单据规则(除子表外其他都是false) + * 修改系统赋值 + **/ + private Object update(FieLdsModel fieLdsModel, Object dataValue, boolean isTable, boolean childNeedAdd) { + String yunzhupaasKey = fieLdsModel.getConfig().getYunzhupaasKey(); + String rule = fieLdsModel.getConfig().getRule(); + String format = DateTimeFormatConstant.getFormat(fieLdsModel.getFormat()); + UserInfo userInfo = UserProvider.getUser(); + Object value = dataValue; + switch (yunzhupaasKey) { + case YunzhupaasKeyConsts.CREATEUSER: + value = userInfo.getUserId(); + break; + case YunzhupaasKeyConsts.CREATETIME: + value = new Date(); + break; + case YunzhupaasKeyConsts.CURRORGANIZE: + case YunzhupaasKeyConsts.CURRDEPT: + value = this.getCurrentOrgIds(userInfo.getOrganizeId(), fieLdsModel.getShowLevel()); + break; + case YunzhupaasKeyConsts.MODIFYTIME: + if (!childNeedAdd) { + value = new Date(); + } + break; + case YunzhupaasKeyConsts.MODIFYUSER: + if (!childNeedAdd) { + value = userInfo.getUserId(); + } + break; + case YunzhupaasKeyConsts.CURRPOSITION: + value = userInfo.getPositionIds() != null && userInfo.getPositionIds().length > 0 + ? userInfo.getPositionIds()[0] + : ""; + break; + case YunzhupaasKeyConsts.BILLRULE: + if (Objects.equals(fieLdsModel.getConfig().getRuleType(), 1) + && (childNeedAdd || ObjectUtil.isEmpty(dataValue))) { + try { + value = serviceUtil.getBillNumber(rule); + } catch (Exception e) { + value = null; + } + } + break; + case YunzhupaasKeyConsts.DATE: + if (isTable) { + try { + if (dataValue == null || "".equals(dataValue)) { + return null; + } + if (dataValue instanceof String) { + try { + SimpleDateFormat formatter = new SimpleDateFormat(format); + value = formatter.parse(dataValue.toString()); + } catch (ParseException var3) { + return null; + } + } else { + value = new Date(Long.valueOf(String.valueOf(dataValue))); + } + } catch (Exception e) { + } + } + break; + case YunzhupaasKeyConsts.NUM_INPUT: + case YunzhupaasKeyConsts.CALCULATE: + if (isTable) { + try { + value = new BigDecimal(String.valueOf(dataValue)); + } catch (Exception e) { + + } + } + break; + default: + if (isTable) { + value = this.valueToNull(value); + } + break; + } + return value; + } + + /** + * 删除有表单条数据 + * + * @param id + * @param visualDevJsonModel + * @return + * @throws SQLException + * @throws DataException + */ + @DSTransactional + public boolean deleteTable(String id, VisualDevJsonModel visualDevJsonModel, DbLinkEntity linkEntity) + throws Exception { + Boolean logicalDelete = visualDevJsonModel.getFormData().getLogicalDelete(); + Integer primaryKeyPolicy = visualDevJsonModel.getFormData().getPrimaryKeyPolicy(); + List tableModels = visualDevJsonModel.getVisualTables(); + + List list = JsonUtil.getJsonToList(visualDevJsonModel.getFormData().getFields(), + FieLdsModel.class); + RecursionForm recursionForm = new RecursionForm(list, tableModels); + List formAllModel = new ArrayList<>(); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + List tableForm = formAllModel.stream() + .filter(t -> FormEnum.table.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + Map disableMap = new HashMap<>(); + for (FormAllModel allModel : tableForm) { + disableMap.put(allModel.getChildList().getTableName(), allModel.getChildList().getDisabled()); + } + // 主表 + TableModel mainTableModel = tableModels.stream().filter(t -> "1".equals(t.getTypeId())).findFirst() + .orElse(null); + String mainTable = mainTableModel.getTable(); + DynamicDataSourceUtil.switchToDataSource(linkEntity); + try { + @Cleanup + Connection conn = ConnUtil.getConnOrDefault(linkEntity); + String dbType = conn.getMetaData().getDatabaseProductName().trim(); + String pKeyName = this.getKey(mainTableModel, dbType); + + String flowTaskId = this.getFlowTaskId(mainTableModel, dbType); + List groupList = new ArrayList<>(); + groupList.add(SqlBuilder.or(SqlTable.of(mainTable).column(flowTaskId), SqlBuilder.isEqualTo(id))); + + boolean autoIncrement = Objects.equals(primaryKeyPolicy, 2); + Object selectId = id; + if (autoIncrement) { + selectId = Long.parseLong(id); + } + SelectStatementProvider queryMain = SqlBuilder.select(SqlTable.of(mainTable).allColumns()) + .from(SqlTable.of(mainTable)) + .where(SqlTable.of(mainTable).column(pKeyName), SqlBuilder.isEqualTo(selectId), groupList) + .build().render(RenderingStrategies.MYBATIS3); + Map mainMap = flowFormDataMapper.selectOneMappedRow(queryMain); + + if (MapUtils.isNotEmpty(mainMap)) { + Object realId = mainMap.get(pKeyName); + // 是否开启逻辑删除 + if (logicalDelete) { + SqlTable sqlt = SqlTable.of(mainTable); + UpdateDSL updateModelUpdateDSL = SqlBuilder.update(sqlt); + updateModelUpdateDSL.set(sqlt.column(TableFeildsEnum.DELETEMARK.getField())).equalTo(1); + updateModelUpdateDSL.set(sqlt.column(TableFeildsEnum.DELETETIME.getField())).equalTo(new Date()); + updateModelUpdateDSL.set(sqlt.column(TableFeildsEnum.DELETEUSERID.getField())) + .equalTo(UserProvider.getUser().getUserId()); + UpdateStatementProvider mainUpdate = updateModelUpdateDSL + .where(SqlTable.of(mainTable).column(pKeyName), SqlBuilder.isEqualTo(realId)) + .build().render(RenderingStrategies.MYBATIS3); + flowFormDataMapper.update(mainUpdate); + } else { + DeleteStatementProvider mainDelete = SqlBuilder.deleteFrom(SqlTable.of(mainTable)) + .where(SqlTable.of(mainTable).column(pKeyName), SqlBuilder.isEqualTo(realId)) + .build().render(RenderingStrategies.MYBATIS3); + flowFormDataMapper.delete(mainDelete); + } + + if (tableModels.size() > 1) { + // 去除主表 + tableModels.remove(mainTableModel); + for (TableModel table : tableModels) { + if (CollectionUtil.isNotEmpty(disableMap) && disableMap.get(table.getTable()) != null + && disableMap.get(table.getTable())) { + continue; + } + // 主表关联-字段值 + Object relationFieldValue = mainMap.get(table.getRelationField()); + // 子表字段-key + String tableField = table.getTableField(); + + if (logicalDelete) { + SqlTable sqlt = SqlTable.of(table.getTable()); + UpdateDSL updateModelUpdateDSL = SqlBuilder.update(sqlt); + updateModelUpdateDSL.set(sqlt.column(TableFeildsEnum.DELETEMARK.getField())).equalTo(1); + updateModelUpdateDSL.set(sqlt.column(TableFeildsEnum.DELETETIME.getField())) + .equalTo(new Date()); + updateModelUpdateDSL.set(sqlt.column(TableFeildsEnum.DELETEUSERID.getField())) + .equalTo(UserProvider.getUser().getUserId()); + UpdateStatementProvider mainUpdate = updateModelUpdateDSL + .where(SqlTable.of(table.getTable()).column(tableField), + SqlBuilder.isEqualTo(relationFieldValue)) + .build().render(RenderingStrategies.MYBATIS3); + flowFormDataMapper.update(mainUpdate); + } else { + DeleteStatementProvider childDeleteProvider = SqlBuilder + .deleteFrom(SqlTable.of(table.getTable())) + .where(SqlTable.of(table.getTable()).column(tableField), + SqlBuilder.isEqualTo(relationFieldValue)) + .build().render(RenderingStrategies.MYBATIS3); + flowFormDataMapper.delete(childDeleteProvider); + } + } + } + } + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + return true; + } + + /** + * 获取锁字段信息 + * + * @param table + * @param linkEntity + * @param dataMap + * @param id + * @return + */ + public Boolean getVersion(String table, DbLinkEntity linkEntity, Map dataMap, Object id) { + boolean canUpdate = true; + try { + DynamicDataSourceUtil.switchToDataSource(linkEntity); + @Cleanup + Connection conn = ConnUtil.getConnOrDefault(linkEntity); + String pKeyName = this.getTableKey(conn, table); + SqlTable sqlTable = SqlTable.of(table); + SelectStatementProvider render = SqlBuilder.select(sqlTable.column(TableFeildsEnum.VERSION.getField())) + .from(sqlTable) + .where(sqlTable.column(pKeyName), SqlBuilder.isEqualTo(id)) + .and(sqlTable.column(TableFeildsEnum.VERSION.getField()), + SqlBuilder.isEqualTo(dataMap.get(TableFeildsEnum.VERSION.getField()))) + .build().render(RenderingStrategies.MYBATIS3); + int count = flowFormDataMapper.selectManyMappedRows(render).size(); + canUpdate = count > 0; + } catch (DataException | SQLException e) { + log.error("切换数据源异常"); + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + return canUpdate; + } + + /** + * 添加sql语句 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2023/3/29 + */ + private void getDSL(SqlTable sqlTable, UpdateDSL updateModelUpdateDSL, + GeneralInsertDSL generalInsertDSL, + String format, String field, Object data) { + boolean dataTimestamp = StringUtil.isNotEmpty(format) ? format.length() > 10 : true; + String dateFunc = dataTimestamp ? "to_timestamp" : "to_date"; + if (data == null || StringUtil.isEmpty(data.toString())) { + if (generalInsertDSL != null) { + generalInsertDSL = generalInsertDSL.set(sqlTable.column(field)).toNull(); + } else { + updateModelUpdateDSL = updateModelUpdateDSL.set(sqlTable.column(field)).equalToNull(); + } + } else { + if (generalInsertDSL != null) { + generalInsertDSL = generalInsertDSL.set(sqlTable.column(field)).toValue(data); + } else { + updateModelUpdateDSL = updateModelUpdateDSL.set(sqlTable.column(field)).equalTo(data); + } + } + } + + /** + * 判断数据为空或空数组转换成null + * + * @param value + * @return + */ + private Object valueToNull(Object value) { + if (value instanceof List || value instanceof String[][]) { + List l = (List) value; + if (l.size() > 0) { + value = JsonUtil.getObjectToString(value); + } else { + value = null; + } + } else if (value instanceof CharSequence) { + if (StrUtil.isEmpty((CharSequence) value) || "[]".equals(value)) { + value = null; + } + } + return value; + } + + /** + * 获取当前组织完整路径 + * + * @param orgId + * @return + */ + public String getCurrentOrgIds(String orgId, String showLevel) { + String orgIds = null; + OrganizeEntity organizeEntity = serviceUtil.getOrganizeInfo(orgId); + if (organizeEntity != null) { + if (StringUtil.isNotEmpty(organizeEntity.getOrganizeIdTree())) { + String[] split = organizeEntity.getOrganizeIdTree().split(","); + orgIds = split.length > 0 ? JsonUtil.getObjectToString(Arrays.asList(split)) : null; + } + } + if (!"all".equals(showLevel) && organizeEntity != null && "company".equals(organizeEntity.getCategory())) { + orgIds = null; + } + return orgIds; + } + + /** + * 获取当前组织名称(all-显示组织名,else 显示部门名) + * + * @param value + * @param showLevel + * @return + */ + public String getCurrentOrganizeName(Object value, String showLevel) { + return serviceUtil.getCurrentOrganizeName(value, showLevel); + } + + /** + * 是否有流程表单权限 + * + * @param dataModel + * @param field + * @return false 没有权限(需要跳过) + */ + private boolean isHasOperate(DataModel dataModel, String field) { + boolean hasOperate = true; + for (Map item : dataModel.getFlowFormOperates()) { + if (field.equals(item.get("id")) + && (item.get("write") == null || "false".equals(item.get("write").toString()))) { + hasOperate = false; + } + } + return hasOperate; + } + + /** + * 添加租户信息 + * + * @param generalInsertDSL + * @param sqlTable + */ + private void addTenantId(GeneralInsertDSL generalInsertDSL, SqlTable sqlTable) { + // 租户信息 + String tenantId = TenantDataSourceUtil.getTenantColumn(); + generalInsertDSL.set(sqlTable.column(TableFeildsEnum.TENANTID.getField())).toValue(tenantId); + } +} diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/FlowFormHttpReqUtils.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/FlowFormHttpReqUtils.java new file mode 100644 index 0000000..4d5a075 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/FlowFormHttpReqUtils.java @@ -0,0 +1,121 @@ +package com.yunzhupaas.base.util; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import jakarta.servlet.http.HttpServletRequest; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.ActionResultCode; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.ServletUtil; +import com.yunzhupaas.util.wxutil.HttpUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.HashMap; +import java.util.Map; + +/** + * 流程表单 http请求处理表单 + * + * @author 云筑产品开发平台组 + * @version V3.4.5 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/10/21 + */ +@Component +public class FlowFormHttpReqUtils { + + private static ConfigValueUtil configValueUtil; + + @Autowired + public void setConfigValueUtil(ConfigValueUtil configValueUtil) { + FlowFormHttpReqUtils.configValueUtil = configValueUtil; + } + + public Map info(VisualdevEntity visualdevEntity, String id, String token) { + String requestURL = this.getReqURL(visualdevEntity, id); + JSONObject jsonObject = HttpUtil.httpRequest(requestURL, "GET", null, token); + ActionResult actionResult = JSON.toJavaObject(jsonObject, ActionResult.class); + if (actionResult == null) { + return new HashMap<>(); + } + Object data = actionResult.getData(); + return data != null ? JsonUtil.entityToMap(data) : new HashMap<>(); + } + + public boolean isUpdate(VisualdevEntity visualdevEntity, String id, String token) { + String requestURL = this.getReqURL(visualdevEntity, id); + JSONObject jsonObject = HttpUtil.httpRequest(requestURL, "GET", null, token); + ActionResult actionResult = JSON.toJavaObject(jsonObject, ActionResult.class); + return actionResult != null && actionResult.getData() != null; + } + + public void create(VisualdevEntity visualdevEntity, String id, String token, Map map) throws WorkFlowException { + String requestURL = this.getReqURL(visualdevEntity, id); + map.remove("id"); + JSONObject jsonObject = HttpUtil.httpRequest(requestURL, "POST", JsonUtil.getObjectToString(map), token); + ActionResult actionResult = JSON.toJavaObject(jsonObject, ActionResult.class); + boolean b = actionResult != null && ActionResultCode.Success.getCode().equals(actionResult.getCode()); + if (!b) { + String msg = actionResult != null ? actionResult.getMsg() : MsgCode.FM001.get(); + throw new WorkFlowException(msg); + } + } + + public void update(VisualdevEntity visualdevEntity, String id, String token, Map map) throws WorkFlowException { + String requestURL = this.getReqURL(visualdevEntity, id); + JSONObject jsonObject = HttpUtil.httpRequest(requestURL, "PUT", JsonUtil.getObjectToString(map), token); + ActionResult actionResult = JSON.toJavaObject(jsonObject, ActionResult.class); + boolean b = actionResult != null && ActionResultCode.Success.getCode().equals(actionResult.getCode()); + if (!b) { + String msg = actionResult != null ? actionResult.getMsg() : MsgCode.FM001.get(); + throw new WorkFlowException(msg); + } + } + + public void saveOrUpdate(VisualdevEntity visualdevEntity, String id, String token, Map map) throws WorkFlowException { + boolean update = this.isUpdate(visualdevEntity, id, token); + if (update) { + this.update(visualdevEntity, id, token, map); + } else { + this.create(visualdevEntity, id, token, map); + } + } + + + private String getReqURL(VisualdevEntity visualdevEntity, String id) { + HttpServletRequest request = ServletUtil.getRequest(); + //请求来源 + String requestURL = visualdevEntity.getInterfaceUrl(); + boolean isHttp = requestURL.toLowerCase().startsWith("http"); + if (!isHttp) { + //补全(内部) + requestURL = configValueUtil.getApiDomain() + requestURL; + } + return requestURL + "/" + id; + } + + /** + * 删除数据 + * + * @param visualdevEntity + * @param id + * @param token + * @throws WorkFlowException + */ + public void delete(VisualdevEntity visualdevEntity, String id, String token) throws WorkFlowException { + String requestURL = this.getReqURL(visualdevEntity, id) + "?forceDel=true"; + JSONObject jsonObject = HttpUtil.httpRequest(requestURL, "DELETE", null, token); + ActionResult actionResult = JSON.toJavaObject(jsonObject, ActionResult.class); + boolean b = actionResult != null && ActionResultCode.Success.getCode().equals(actionResult.getCode()); + if (!b) { + String msg = actionResult != null ? actionResult.getMsg() : MsgCode.FM001.get(); + throw new WorkFlowException(msg); + } + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/FormCheckUtils.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/FormCheckUtils.java new file mode 100644 index 0000000..cdb934e --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/FormCheckUtils.java @@ -0,0 +1,482 @@ +package com.yunzhupaas.base.util; + +import cn.hutool.core.util.ObjectUtil; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.mapper.FlowFormDataMapper; +import com.yunzhupaas.base.model.CheckFormModel; +import com.yunzhupaas.base.model.ColumnDataModel; +import com.yunzhupaas.base.model.OnlineImport.ImportDataModel; +import com.yunzhupaas.base.model.OnlineImport.ImportFormCheckUniqueModel; +import com.yunzhupaas.base.model.VisualConst; +import com.yunzhupaas.base.model.form.FormCheckModel; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.database.model.entity.DbLinkEntity; +import com.yunzhupaas.database.util.ConnUtil; +import com.yunzhupaas.database.util.DynamicDataSourceUtil; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.i18n.util.I18nUtil; +import com.yunzhupaas.model.visualJson.FieLdsModel; +import com.yunzhupaas.model.visualJson.FormDataModel; +import com.yunzhupaas.model.visualJson.TableFields; +import com.yunzhupaas.model.visualJson.TableModel; +import com.yunzhupaas.model.visualJson.config.ConfigModel; +import com.yunzhupaas.onlinedev.model.VisualErrInfo; +import com.yunzhupaas.util.FlowFormConstant; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.TableFeildsEnum; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import lombok.Cleanup; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.mybatis.dynamic.sql.AndOrCriteriaGroup; +import org.mybatis.dynamic.sql.BasicColumn; +import org.mybatis.dynamic.sql.SqlBuilder; +import org.mybatis.dynamic.sql.SqlTable; +import org.mybatis.dynamic.sql.render.RenderingStrategies; +import org.mybatis.dynamic.sql.select.QueryExpressionDSL; +import org.mybatis.dynamic.sql.select.SelectModel; +import org.mybatis.dynamic.sql.select.join.EqualTo; +import org.mybatis.dynamic.sql.select.render.SelectStatementProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.sql.Connection; +import java.sql.SQLException; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 验证表单数据 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/5/25 + */ +@Component +public class FormCheckUtils { + public static final List LINK_ALLOW_KEY = Arrays.asList("alert", "card", "collapse", "collapseItem", + "colorPicker", "datePicker", "divider", "editor", + "groupTitle", "iframe", "input", "inputNumber", "link", "location", "rate", "row", "slider", "stepItem", + "steps", "switch", "tab", "tabItem", "table", "tableGrid", + "tableGridTd", "tableGridTr", "text", "textarea", "timePicker"); + @Autowired + private FlowFormDataUtil flowDataUtil; + @Autowired + private FlowFormDataMapper flowFormDataMapper; + + public String checkForm(CheckFormModel checkFormModel) { + List formFieldList = checkFormModel.getFormFieldList(); + Map dataMap = checkFormModel.getDataMap(); + DbLinkEntity linkEntity = checkFormModel.getLinkEntity(); + List tableModelList = checkFormModel.getTableModelList(); + VisualdevEntity visualdevEntity = checkFormModel.getVisualdevEntity(); + String id = checkFormModel.getId(); + Boolean isTransfer = checkFormModel.getIsTransfer(); + + FormDataModel formData = JsonUtil.getJsonToBean(visualdevEntity.getFormData(), FormDataModel.class); + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(visualdevEntity.getColumnData(), + ColumnDataModel.class); + boolean inlineEdit = columnDataModel != null && columnDataModel.getType() != null + && columnDataModel.getType() == 4; + boolean logicalDelete = formData.getLogicalDelete(); + + List fields = new ArrayList<>(); + FormPublicUtils.recursionFieldsExceptChild(fields, formFieldList); + try { + // 切换数据源 + DynamicDataSourceUtil.switchToDataSource(linkEntity); + @Cleanup + Connection conn = ConnUtil.getConnOrDefault(linkEntity); + String dbType = conn.getMetaData().getDatabaseProductName().trim(); + // 业务主键判断 + VisualErrInfo visualErrInfo = this.checkBusinessKey(fields, dataMap, tableModelList, formData, id); + if (ObjectUtil.isNotEmpty(visualErrInfo) && StringUtil.isNotEmpty(visualErrInfo.getErrMsg())) { + return visualErrInfo.getErrMsg(); + } + // 唯一和非空判断 + List formCheckModels = new ArrayList<>(); + for (FieLdsModel fieLdsModel : fields) { + ConfigModel config = fieLdsModel.getConfig(); + if (checkFormModel.getIsLink() && !LINK_ALLOW_KEY.contains(config.getYunzhupaasKey())) { + continue; + } + Object o = dataMap.get(fieLdsModel.getVModel()); + if (config.isRequired() && !inlineEdit && !isTransfer) { + if (ObjectUtil.isEmpty(o) || StringUtil.isEmpty(o.toString().trim())) { + return I18nUtil.getMessageStr(config.getLabelI18nCode(), config.getLabel()) + + MsgCode.VS015.get(); + } + } + if (YunzhupaasKeyConsts.COM_INPUT.equals(config.getYunzhupaasKey()) && config.getUnique()) { + o = ObjectUtil.isEmpty(o) ? null : String.valueOf(o).trim(); + dataMap.put(fieLdsModel.getVModel(), o); + String tableName = fieLdsModel.getConfig().getTableName(); + // 验证唯一 + SqlTable sqlTable = SqlTable.of(tableName); + String key = flowDataUtil.getTableKey(conn, tableName); + String vModelThis = fieLdsModel.getVModel(); + + String foriegKey = ""; + String columnName = ""; + boolean isMain = true; + TableModel mainTableModel = new TableModel(); + TableModel tableModel = new TableModel(); + for (TableModel item : tableModelList) { + if (Objects.equals(item.getTypeId(), "1")) { + mainTableModel = item; + } + + if (StringUtil.isNotEmpty(fieLdsModel.getConfig().getRelationTable())) { + // 子表判断 + if (fieLdsModel.getConfig().getRelationTable().equals(item.getTable())) { + tableModel = item; + } + } else { + // 主副表判断 + if (fieLdsModel.getConfig().getTableName().equals(item.getTable())) { + tableModel = item; + } + } + } + + if (tableModel != null) { + String fieldName = vModelThis; + if (!"1".equals(tableModel.getTypeId()) && vModelThis.contains("_yunzhupaas_")) { + fieldName = vModelThis.split("_yunzhupaas_")[1]; + isMain = false; + foriegKey = tableModel.getTableField(); + } + String finalFieldName = fieldName; + TableFields tableFields = tableModel.getFields().stream() + .filter(t -> t.getField().equals(finalFieldName)).findFirst().orElse(null); + if (tableFields != null) { + columnName = StringUtil.isNotEmpty(tableFields.getField()) ? tableFields.getField() + : fieldName; + } + } + + List selectKey = new ArrayList<>(); + selectKey.add(sqlTable.column(columnName)); + selectKey.add(sqlTable.column(key)); + if (StringUtil.isNotEmpty(foriegKey)) { + String finalForiegKey = foriegKey; + TableFields tableFields = tableModel.getFields().stream() + .filter(t -> t.getField().equals(finalForiegKey)).findFirst().orElse(null); + if (tableFields != null) { + foriegKey = StringUtil.isNotEmpty(tableFields.getField()) ? tableFields.getField() + : finalForiegKey; + } + selectKey.add(sqlTable.column(foriegKey)); + } + + SqlTable sqlMainTable = SqlTable.of(mainTableModel.getTable()); + String taskIdField = TableFeildsEnum.FLOWTASKID.getField(); + if (dbType.contains("Oracle") || dbType.contains("DM DBMS")) { + taskIdField = TableFeildsEnum.FLOWTASKID.getField().toUpperCase(); + } + if (dataMap.get(FlowFormConstant.FLOWID) != null + && StringUtil.isNotEmpty(dataMap.get(FlowFormConstant.FLOWID).toString())) { + selectKey.add(sqlMainTable.column(taskIdField)); + } + QueryExpressionDSL.QueryExpressionWhereBuilder where; + // 是否主表 + if (isMain) { + where = SqlBuilder + .select(selectKey) + .from(sqlTable) + .where(); + } else { + where = SqlBuilder + .select(selectKey) + .from(sqlMainTable) + .leftJoin(sqlTable) + .on(sqlTable.column(tableModel.getTableField()), + new EqualTo(sqlMainTable.column(tableModel.getRelationField()))) + .where(); + } + if (ObjectUtil.isEmpty(o)) { + where.and(sqlTable.column(columnName), SqlBuilder.isNull()); + } else { + where.and(sqlTable.column(columnName), SqlBuilder.isEqualTo(o.toString())); + } + if (StringUtils.isNotEmpty(id)) { + TableFields mainKeyModel = mainTableModel.getFields().stream() + .filter(t -> Objects.equals(t.getPrimaryKey(), 1) + && !t.getField().equalsIgnoreCase(TableFeildsEnum.TENANTID.getField())) + .findFirst().orElse(null); + Object realId = id; + if (VisualConst.DB_INT_ALL.contains(mainKeyModel.getDataType().toLowerCase())) { + realId = Long.parseLong(id); + } + where.and(sqlTable.column(mainKeyModel.getField()), SqlBuilder.isNotEqualTo(realId)); + } + if (logicalDelete) { + where.and(sqlMainTable.column(TableFeildsEnum.DELETEMARK.getField()), SqlBuilder.isNull()); + } + // 是流程 + if (dataMap.get(FlowFormConstant.FLOWID) != null + && StringUtil.isNotEmpty(dataMap.get(FlowFormConstant.FLOWID).toString())) { + where.and(sqlMainTable.column(TableFeildsEnum.FLOWID.getField()), + SqlBuilder.isEqualTo(dataMap.get(FlowFormConstant.FLOWID))); + } else { + where.and(sqlMainTable.column(TableFeildsEnum.FLOWID.getField()), SqlBuilder.isNull()); + } + + SelectStatementProvider render = where.build().render(RenderingStrategies.MYBATIS3); + FormCheckModel formCheckModel = new FormCheckModel(); + formCheckModel.setLabel(I18nUtil.getMessageStr(fieLdsModel.getConfig().getLabelI18nCode(), + fieLdsModel.getConfig().getLabel())); + formCheckModel.setStatementProvider(render); + formCheckModels.add(formCheckModel); + } + } + + // 主副表数据库判重 + for (FormCheckModel formCheckModel : formCheckModels) { + int count = flowFormDataMapper.selectManyMappedRows(formCheckModel.getStatementProvider()).size(); + if (count > 0) { + return formCheckModel.getLabel() + MsgCode.EXIST103.get(); + } + } + + // 子表当前表单数据判重 + List childFieldList = fields.stream() + .filter(f -> YunzhupaasKeyConsts.CHILD_TABLE.equals(f.getConfig().getYunzhupaasKey())) + .collect(Collectors.toList()); + for (FieLdsModel fieLdsModel : childFieldList) { + List> childMapList = (List) dataMap.get(fieLdsModel.getVModel()); + if (ObjectUtil.isEmpty(childMapList)) + continue; + String tableName = I18nUtil.getMessageStr(fieLdsModel.getConfig().getLabelI18nCode(), + fieLdsModel.getConfig().getLabel()); + for (FieLdsModel childField : fieLdsModel.getConfig().getChildren()) { + ConfigModel config = childField.getConfig(); + if (checkFormModel.getIsLink() && !LINK_ALLOW_KEY.contains(config.getYunzhupaasKey())) { + continue; + } + // 判断为空 + if (config.isRequired() && !inlineEdit && !isTransfer) { + for (Map item : childMapList) { + Object o = item.get(childField.getVModel()); + if (ObjectUtil.isEmpty(o) || StringUtil.isEmpty(o.toString().trim())) { + return tableName + "-" + + I18nUtil.getMessageStr(config.getLabelI18nCode(), config.getLabel()) + + MsgCode.VS015.get(); + } + } + } + // 判断唯一 + if (YunzhupaasKeyConsts.COM_INPUT.equals(config.getYunzhupaasKey()) && config.getUnique()) { + List childValues = childMapList.stream() + .filter(ChildTbMap -> ChildTbMap.get(childField.getVModel()) != null) + .map(ChildTbMap -> String.valueOf(ChildTbMap.get(childField.getVModel())).trim()) + .collect(Collectors.toList()); + if (childValues.size() > 0) { + HashSet child = new HashSet<>(childValues); + if (child.size() != childValues.size()) { + return tableName + "-" + + I18nUtil.getMessageStr(config.getLabelI18nCode(), config.getLabel()) + + MsgCode.EXIST103.get(); + } + } + } + } + } + + if (conn != null) { + conn.close(); + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + return ""; + } + + public String getCount(Object id, SqlTable sqlTable, TableModel tableModel, DbLinkEntity linkEntity) { + try { + DynamicDataSourceUtil.switchToDataSource(linkEntity); + @Cleanup + Connection conn = ConnUtil.getConnOrDefault(linkEntity); + String dbType = conn.getMetaData().getDatabaseProductName().trim(); + String key = flowDataUtil.getKey(tableModel, dbType); + String flowTaskId = flowDataUtil.getFlowTaskId(tableModel, dbType); + List groupList = new ArrayList<>(); + groupList.add(SqlBuilder.or(sqlTable.column(flowTaskId), SqlBuilder.isEqualTo(id.toString()))); + + SelectStatementProvider countRender = SqlBuilder + .select(sqlTable.column(key)) + .from(sqlTable) + .where(sqlTable.column(key), SqlBuilder.isEqualTo(id), groupList) + .build().render(RenderingStrategies.MYBATIS3); + Map map = flowFormDataMapper.selectOneMappedRow(countRender); + if (MapUtils.isNotEmpty(map)) { + if (Objects.nonNull(map.get(key))) { + return map.get(key).toString(); + } + } + } catch (DataException e) { + e.printStackTrace(); + } catch (SQLException sqlException) { + sqlException.printStackTrace(); + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + return null; + } + + /** + * 业务主键 判断 + * + * @param fields + * @param data + * @param tableList + * @param formData + * @param id + * @return + */ + public VisualErrInfo checkBusinessKey(List fields, Map data, + List tableList, FormDataModel formData, String id) { + Boolean logicalDelete = formData.getLogicalDelete(); + if (formData.isUseBusinessKey()) { + List businessKeyList = Arrays.asList(formData.getBusinessKeyList()); + if (CollectionUtils.isEmpty(businessKeyList)) + return null; + TableModel mainTable = tableList.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + TableFields mainFields = mainTable.getFields().stream().filter(t -> Objects.equals(t.getPrimaryKey(), 1) + && !t.getField().equalsIgnoreCase(TableFeildsEnum.TENANTID.getField())).findFirst().orElse(null); + + SqlTable sqlTable = SqlTable.of(mainTable.getTable()); + String mainKey = mainFields.getField(); + String taskIdField = TableFeildsEnum.FLOWTASKID.getField(); + TableFields taskIdFielde = mainTable.getFields().stream() + .filter(t -> TableFeildsEnum.FLOWTASKID.getField().equalsIgnoreCase(t.getField())).findFirst() + .orElse(null); + if (ObjectUtil.isNotEmpty(taskIdFielde)) { + taskIdField = taskIdFielde.getField(); + } + List selectKey = new ArrayList<>(); + selectKey.add(sqlTable.column(mainKey)); + if (data.get(FlowFormConstant.FLOWID) != null + && StringUtil.isNotEmpty(data.get(FlowFormConstant.FLOWID).toString())) { + selectKey.add(sqlTable.column(taskIdField)); + } + QueryExpressionDSL.QueryExpressionWhereBuilder where = SqlBuilder.select(selectKey) + .from(sqlTable).where(); + + for (FieLdsModel fieLdsModel : fields) { + String fieldName = fieLdsModel.getVModel(); + Object o = data.get(fieldName); + if (businessKeyList.contains(fieldName)) { + if (ObjectUtil.isEmpty(o)) { + where.and(sqlTable.column(fieldName), SqlBuilder.isNull()); + } else { + o = o instanceof List ? JsonUtil.getObjectToString(o) : o; + if (YunzhupaasKeyConsts.DateSelect.contains(fieLdsModel.getConfig().getYunzhupaasKey())) { + try { + o = new Date((Long) o); + } catch (Exception e) { + try { + String format = fieLdsModel.getFormat(); + SimpleDateFormat sdf = new SimpleDateFormat(format); + o = sdf.parse(String.valueOf(o)); + } catch (Exception ex) { + + } + } + } + where.and(sqlTable.column(fieldName), SqlBuilder.isEqualTo(o)); + } + } + } + // 更新跳过本条数据 + if (StringUtils.isNotEmpty(id)) { + Object realId = id; + if (VisualConst.DB_INT_ALL.contains(mainFields.getDataType().toLowerCase())) { + realId = Long.parseLong(id); + } + where.and(sqlTable.column(mainKey), SqlBuilder.isNotEqualTo(realId)); + } + // 流程数据过滤 + if (data.get(FlowFormConstant.FLOWID) != null + && StringUtil.isNotEmpty(data.get(FlowFormConstant.FLOWID).toString())) { + where.and(sqlTable.column(TableFeildsEnum.FLOWID.getField()), + SqlBuilder.isEqualTo(data.get(FlowFormConstant.FLOWID))); + } else { + where.and(sqlTable.column(TableFeildsEnum.FLOWID.getField()), SqlBuilder.isNull()); + } + // 逻辑删除 + if (logicalDelete) { + where.and(sqlTable.column(TableFeildsEnum.DELETEMARK.getField()), SqlBuilder.isNull()); + } + SelectStatementProvider render = where.build().render(RenderingStrategies.MYBATIS3); + List> maps; + try { + maps = flowFormDataMapper.selectManyMappedRows(render); + } catch (Exception e) { + return null; + } + int count = maps.size(); + if (count > 0) { + VisualErrInfo visualErrInfo = VisualErrInfo.builder().errMsg(formData.getBusinessKeyTip()).build(); + if (ObjectUtil.isNotEmpty(maps.get(0).get(mainKey))) { + visualErrInfo.setId(maps.get(0).get(mainKey).toString()); + } + if (ObjectUtil.isNotEmpty(maps.get(0).get(taskIdField))) { + visualErrInfo.setFlowTaskId(maps.get(0).get(taskIdField).toString()); + } + return visualErrInfo; + } + } + return null; + } + + /** + * 判断excel表内业务主键是否重复 + * + * @param formData + * @param resultMap + * @param uniqueModel + * @return + */ + public String checkBusinessKeyExcel(FormDataModel formData, Map resultMap, + ImportFormCheckUniqueModel uniqueModel) { + List businessKeyList = Arrays.asList(formData.getBusinessKeyList()); + List> successList = uniqueModel.getImportDataModel().stream() + .map(ImportDataModel::getResultData).collect(Collectors.toList()); + if (com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isNotEmpty(successList)) { + boolean exists = false; + for (int uniqueIndex = 0; uniqueIndex < successList.size(); uniqueIndex++) { + Map indexMap = successList.get(uniqueIndex); + boolean hasB = false; + for (String fieldsKey : businessKeyList) { + if ((resultMap.get(fieldsKey) == null && indexMap.get(fieldsKey) == null) + || (resultMap.get(fieldsKey) != null + && resultMap.get(fieldsKey).equals(indexMap.get(fieldsKey)))) { + hasB = true; + } else { + // 有一个没匹配上就跳出循环 + hasB = false; + break; + } + } + if (hasB) { + exists = true; + if (uniqueModel.isUpdate()) { + uniqueModel.getImportDataModel().get(uniqueIndex).setResultData(resultMap); + } + break; + } + } + if (exists) { + return formData.getBusinessKeyTip(); + } + } + return null; + } +} diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/FormExecelUtils.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/FormExecelUtils.java new file mode 100644 index 0000000..ef14a30 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/FormExecelUtils.java @@ -0,0 +1,159 @@ +package com.yunzhupaas.base.util; + +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import org.apache.commons.collections4.MapUtils; + +import java.util.*; +import java.util.stream.Collectors; + +public class FormExecelUtils { + /** + * 合并子表数据 + * + * @param excelDataList + * @param selectKey + * @return + * @throws WorkFlowException + */ + public static List> dataMergeChildTable(List excelDataList, List selectKey) + throws WorkFlowException { + List> results = new ArrayList<>(); + Set tablefield1 = selectKey.stream() + .filter(s -> s.toLowerCase().startsWith(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX)) + .map(s -> s.substring(0, s.indexOf("-"))).collect(Collectors.toSet()); + List> allDataList = new ArrayList<>(); + + for (int z = 0; z < excelDataList.size(); z++) { + Map dataMap = new HashMap<>(16); + Map m = excelDataList.get(z); + List excelEntrySet = new ArrayList<>(m.entrySet()); + + // 读取所有有效字段,不校验数量,只校验字段是否合法 + for (int e = 0; e < excelEntrySet.size(); e++) { + Map.Entry o = (Map.Entry) excelEntrySet.get(e); + String entryKey = o.getKey().toString(); + + // 跳过没有括号的字段(避免报错) + if (!entryKey.contains("(") || !entryKey.contains(")")) { + continue; + } + + String substring = entryKey.substring(entryKey.lastIndexOf("(") + 1, entryKey.lastIndexOf(")")); + + // 只保留模板里有的字段,不存在的自动忽略 + if (selectKey.contains(substring)) { + dataMap.put(substring, o.getValue()); + } + } + allDataList.add(dataMap); + } + + // 存放在主表数据的下标位置 + List>>> IndexMap = new ArrayList<>(); + // Map>>> IndexMap = new + // TreeMap<>(); + Map>> childrenTabMap = new HashMap<>(); + for (String tab : tablefield1) { + childrenTabMap.put(tab, new ArrayList<>()); + } + + for (int t = 0; t < allDataList.size(); t++) { + boolean isLast = t == allDataList.size() - 1; + // 是否需要合并 + boolean needTogether = true; + // 这条数据是否需要添加 + boolean needAdd = true; + Map dataMap = allDataList.get(t); + // 首条数据不合并 + if (t > 0) { + List> tablefield2 = dataMap.entrySet().stream() + .filter(e -> !e.getKey().toLowerCase().startsWith(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX)) + .collect(Collectors.toList()); + // 如果除子表外都为空 则需要合并 + Map.Entry entry = tablefield2.stream().filter(ta -> ta.getValue() != null).findFirst() + .orElse(null); + if (entry == null) { + needTogether = false; + needAdd = false; + } + } + + // 合并子表里的字段 + for (String tab : tablefield1) { + Map childObjMap = new HashMap<>(16); + // 该条数据下的子表字段 + List> childList = dataMap.entrySet().stream() + .filter(e -> e.getKey().startsWith(tab)).collect(Collectors.toList()); + for (Map.Entry entry : childList) { + String childFieldName = entry.getKey().replace(tab + "-", ""); + childObjMap.put(childFieldName, entry.getValue()); + } + List> mapList = childrenTabMap.get(tab); + if (MapUtils.isNotEmpty(childObjMap)) { + boolean b = childObjMap.values().stream().anyMatch(v -> v != null); + if (b) { + mapList.add(childObjMap); + } + } + } + if (needTogether && t != 0) { + Map>> c = new HashMap<>(childrenTabMap); + Map>> b = new HashMap<>(); + + for (String tab : tablefield1) { + // 去掉最后一个 放到下条数据里 + List> mapList = c.get(tab); + if(mapList == null || mapList.isEmpty()){ + continue; + } + Map map = mapList.get(mapList.size() - 1); + List> aList = new ArrayList<>(); + aList.add(map); + mapList.remove(mapList.size() - 1); + childrenTabMap.put(tab, aList); + b.put(tab, mapList); + } + IndexMap.add(b); + if (isLast) { + IndexMap.add(childrenTabMap); + } + } else { + if (isLast) { + IndexMap.add(childrenTabMap); + } + } + if (needAdd) { + Map m = new HashMap<>(); + for (Map.Entry entry : dataMap.entrySet()) { + if (!entry.getKey().contains("-")) { + m.put(entry.getKey(), entry.getValue()); + } + } + results.add(m); + } + } + + // 处理结果 + for (int r = 0; r < results.size(); r++) { + if(r >= IndexMap.size()){ + break; + } + Map>> entry = IndexMap.get(r); + Map map = results.get(r); + for (Map.Entry>> entry1 : entry.entrySet()) { + String tableField = entry1.getKey(); + Object tableField1 = map.get(tableField); + List> value1 = entry1.getValue(); + if (tableField1 != null) { + List> tfMap = (List>) tableField1; + value1.addAll(tfMap); + } + map.put(tableField, value1); + } + results.set(r, map); + } + return results; + } +} \ No newline at end of file diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/FormInfoUtils.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/FormInfoUtils.java new file mode 100644 index 0000000..ece776c --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/FormInfoUtils.java @@ -0,0 +1,167 @@ +package com.yunzhupaas.base.util; + +import cn.hutool.core.util.ObjectUtil; +import com.yunzhupaas.database.util.DynamicDataSourceUtil; +import com.yunzhupaas.message.model.websocket.onconnettion.OnLineModel; +import com.yunzhupaas.model.visualJson.FieLdsModel; +import com.yunzhupaas.permission.entity.PositionEntity; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.util.DateUtil; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.math.BigDecimal; +import java.sql.Clob; +import java.util.*; + +import static com.yunzhupaas.util.Constants.ADMIN_KEY; + +/** + * 在线详情编辑工具类 + * + * @author 云筑产品开发平台组 + * @version V3.2 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/10/27 + */ +@Slf4j +@Component +public class FormInfoUtils { + @Autowired + private ServiceBaseUtil serviceUtil; + + /** + * 转换数据格式(编辑页) + * + * @param modelList 控件 + * @param dataMap 数据 + * @return + */ + public Map swapDataInfoType(List modelList, Map dataMap) { + dataMap = Optional.ofNullable(dataMap).orElse(new HashMap<>()); + try { + DynamicDataSourceUtil.switchToDataSource(null); + List systemConditions = new ArrayList() { + { + add(YunzhupaasKeyConsts.CURRORGANIZE); + add(YunzhupaasKeyConsts.CURRDEPT); + add(YunzhupaasKeyConsts.CURRPOSITION); + } + }; + List nullIsList = new ArrayList() { + { + add(YunzhupaasKeyConsts.UPLOADFZ); + add(YunzhupaasKeyConsts.UPLOADIMG); + } + }; + for (FieLdsModel swapDataVo : modelList) { + String yunzhupaasKey = swapDataVo.getConfig().getYunzhupaasKey(); + String vModel = swapDataVo.getVModel(); + + // clob字段转换 + FormInfoUtils.swapClob(dataMap, vModel); + // 获取原字段数据 + FormPublicUtils.relationGetYunzhupaasId(dataMap, yunzhupaasKey, dataMap.get(vModel), vModel); + + Object value = dataMap.get(vModel); + if (value == null || ObjectUtil.isEmpty(value)) { + if (systemConditions.contains(yunzhupaasKey)) { + dataMap.put(vModel, " "); + } + if (nullIsList.contains(yunzhupaasKey)) { + dataMap.put(vModel, Collections.emptyList()); + } + continue; + } + switch (yunzhupaasKey) { + case YunzhupaasKeyConsts.UPLOADFZ: + case YunzhupaasKeyConsts.UPLOADIMG: + // 数据传递-乱塞有bug强行置空 + List> fileList = new ArrayList<>(); + try { + fileList = JsonUtil.getJsonToListMap(dataMap.get(vModel).toString()); + } catch (Exception e) { + e.printStackTrace(); + } + dataMap.put(vModel, fileList); + break; + case YunzhupaasKeyConsts.DATE: + Long dateTime = DateTimeFormatConstant.getDateObjToLong(dataMap.get(vModel)); + dataMap.put(vModel, dateTime != null ? dateTime : dataMap.get(vModel)); + break; + case YunzhupaasKeyConsts.CREATETIME: + case YunzhupaasKeyConsts.MODIFYTIME: + String pattern = DateTimeFormatConstant.YEAR_MOnTH_DHMS; + Long time = DateTimeFormatConstant.getDateObjToLong(dataMap.get(vModel)); + dataMap.put(vModel, time != null ? DateUtil.dateToString(new Date(time), pattern) : ""); + break; + case YunzhupaasKeyConsts.SWITCH: + case YunzhupaasKeyConsts.SLIDER: + case YunzhupaasKeyConsts.RATE: + case YunzhupaasKeyConsts.CALCULATE: + case YunzhupaasKeyConsts.NUM_INPUT: + dataMap.put(vModel, value != null ? new BigDecimal(String.valueOf(value)) : null); + break; + case YunzhupaasKeyConsts.CURRPOSITION: + PositionEntity positionEntity = serviceUtil.getPositionInfo(String.valueOf(value)); + dataMap.put(vModel, Objects.nonNull(positionEntity) ? positionEntity.getFullName() : value); + break; + + case YunzhupaasKeyConsts.CREATEUSER: + case YunzhupaasKeyConsts.MODIFYUSER: + UserEntity userEntity = serviceUtil.getUserInfo(String.valueOf(value)); + String userValue = Objects.nonNull(userEntity) + ? userEntity.getAccount().equalsIgnoreCase(ADMIN_KEY) + ? "管理员/" + ADMIN_KEY + : userEntity.getRealName() + "/" + userEntity.getAccount() + : String.valueOf(value); + dataMap.put(vModel, userValue); + break; + case YunzhupaasKeyConsts.CURRORGANIZE: + String currentOrganizeName = serviceUtil.getCurrentOrganizeName(value, + swapDataVo.getShowLevel()); + dataMap.put(vModel, currentOrganizeName); + break; + case YunzhupaasKeyConsts.COM_INPUT: + if (dataMap.get(vModel) != null) { + dataMap.put(vModel, String.valueOf(dataMap.get(vModel))); + } + break; + default: + dataMap.put(vModel, FormPublicUtils.getDataConversion(value)); + break; + } + } + } catch (Exception e) { + throw new RuntimeException(e); + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + return dataMap; + } + + public static void swapClob(Map map, String key) { + if (map != null && map.get(key) != null && map.get(key) instanceof Clob) { + Clob clob = (Clob) map.get(key); + StringBuilder sb = new StringBuilder(); + // 获取CLOB字段的内容长度 + int length = 0; + // 以流的形式读取CLOB字段的内容 + try (java.io.Reader reader = clob.getCharacterStream()) { + length = (int) clob.length(); + char[] buffer = new char[length]; + int bytesRead; + // 逐个字符读取并添加到字符串构建器中 + while ((bytesRead = reader.read(buffer)) != -1) { + sb.append(buffer, 0, bytesRead); + } + } catch (Exception e) { + e.printStackTrace(); + } + map.put(key, sb.toString()); + } + } +} diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/FormPublicUtils.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/FormPublicUtils.java new file mode 100644 index 0000000..8f18b09 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/FormPublicUtils.java @@ -0,0 +1,466 @@ +package com.yunzhupaas.base.util; + +import cn.hutool.core.util.ObjectUtil; +import com.yunzhupaas.model.visualJson.FieLdsModel; +import com.yunzhupaas.model.visualJson.config.ConfigModel; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; + +import java.math.BigDecimal; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 在线开发公用 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/7/28 + */ +public class FormPublicUtils { + + /** + * 递归控件,除子表外控件全部提到同级 + * 取子集,子表不外提 + * + * @return + */ + public static void recursionFieldsExceptChild(List allFields, List fieLdsModelList) { + for (FieLdsModel fieLdsModel : fieLdsModelList) { + ConfigModel config = fieLdsModel.getConfig(); + String yunzhupaasKey = config.getYunzhupaasKey(); + if (YunzhupaasKeyConsts.CHILD_TABLE.equals(yunzhupaasKey)) { + allFields.add(fieLdsModel); + continue; + } else { + if (config.getChildren() != null) { + recursionFieldsExceptChild(allFields, config.getChildren()); + } else { + if (yunzhupaasKey == null) { + continue; + } + allFields.add(fieLdsModel); + } + } + } + } + + /** + * 转换时间格式 + * + * @param time + * @return + */ + public static String getTimeFormat(String time) { + String result; + switch (time.length()) { + case 16: + result = time + ":00"; + break; + case 19: + result = time; + break; + case 21: + result = time.substring(0, time.length() - 2); + break; + case 10: + result = time + " 00:00:00"; + break; + case 8: + result = "2000-01-01 " + time; + break; + case 7: + result = time + "-01 00:00:00"; + break; + case 4: + result = time + "-01-01 00:00:00"; + break; + default: + result = ""; + break; + } + return result; + } + + public static String getLastTimeFormat(String time) { + String result; + switch (time.length()) { + case 16: + result = time + ":00"; + break; + case 19: + result = time; + break; + case 10: + result = time + " 23:59:59"; + break; + case 8: + result = "2000-01-01 " + time; + break; + case 7: + // 获取月份最后一天 + String[] split = time.split("-"); + Calendar cale = Calendar.getInstance(); + cale.set(Calendar.YEAR, Integer.valueOf(split[0]));// 赋值年份 + cale.set(Calendar.MONTH, Integer.valueOf(split[1]) - 1);// 赋值月份 + int lastDay = cale.getActualMaximum(Calendar.DAY_OF_MONTH);// 获取月最大天数 + cale.set(Calendar.DAY_OF_MONTH, lastDay);// 设置日历中月份的最大天数 + cale.set(Calendar.HOUR_OF_DAY, 23); + cale.set(Calendar.SECOND, 59); + cale.set(Calendar.MINUTE, 59); + result = DateUtil.daFormatHHMMSS(cale.getTime().getTime()); + break; + case 4: + result = time + "-12-31 23:59:59"; + break; + default: + result = ""; + break; + } + return result; + } + + /** + * 判断时间是否在设置范围内 + * + * @param swapDataVo + * @param format + * @param value + * @param data + * @param yunzhupaasKey + * @return + */ + public static boolean dateTimeCondition(FieLdsModel swapDataVo, String format, Object value, + Map data, String yunzhupaasKey) { + long valueTimeLong; + // 输入值转long + if (value instanceof String) { + valueTimeLong = cn.hutool.core.date.DateUtil.parse(String.valueOf(value), format).getTime(); + } else { + // 输入值按格式补全 + String timeFormat = getTimeFormat(String.valueOf(value)); + valueTimeLong = DateUtil.stringToDate(timeFormat).getTime(); + } + boolean timeHasRangeError = false; + // 开始时间判断 + if (swapDataVo.getConfig().getStartTimeRule()) { + String startTimeValue = swapDataVo.getConfig().getStartTimeValue(); + String startTimeType = swapDataVo.getConfig().getStartTimeType(); + String startTimeTarget = swapDataVo.getConfig().getStartTimeTarget(); + String startTimeRelationField = swapDataVo.getConfig().getStartRelationField(); + // 根据类型获取开始时间戳 + long startTimeLong = getDateTimeLong(data, yunzhupaasKey, startTimeValue, startTimeType, startTimeTarget, + startTimeRelationField, format); + if (startTimeLong != 0 && valueTimeLong < startTimeLong) { + timeHasRangeError = true; + } + } + // 结束时间判断 + if (swapDataVo.getConfig().getEndTimeRule()) { + String endTimeValue = swapDataVo.getConfig().getEndTimeValue(); + String endTimeType = swapDataVo.getConfig().getEndTimeType(); + String endTimeTarget = swapDataVo.getConfig().getEndTimeTarget(); + String endTimeRelationField = swapDataVo.getConfig().getEndRelationField(); + // 根据类型获取开始时间戳 + long endTimeLong = getDateTimeLong(data, yunzhupaasKey, endTimeValue, endTimeType, endTimeTarget, + endTimeRelationField, format); + if (endTimeLong != 0 && valueTimeLong > endTimeLong) { + timeHasRangeError = true; + } + } + return timeHasRangeError; + } + + /** + * 根据类型获取时间戳 + * + * @param data + * @param yunzhupaasKey + * @param timeValue + * @param timeType + * @param timeTarget + * @return + */ + public static long getDateTimeLong(Map data, String yunzhupaasKey, String timeValue, + String timeType, String timeTarget, + String stringimeRelationField, String format) { + if (StringUtil.isEmpty(timeValue)) { + timeValue = "0"; + } + long startTimeLong = 0; + // 当前格式的当前时间戳 + long timestampInMillis = new Date().getTime(); + try { + SimpleDateFormat sdf = new SimpleDateFormat(format); + String s = sdf.format(new Date()); + timestampInMillis = sdf.parse(s).getTime(); + } catch (ParseException e) { + } + switch (timeType) { + case "1":// 特定时间 + if (YunzhupaasKeyConsts.DATE.equals(yunzhupaasKey)) { + startTimeLong = Long.parseLong(timeValue); + } else { + String newDateStr = DateUtil.daFormat(new Date()) + " " + timeValue + + (timeValue.length() > 6 ? "" : ":00"); + startTimeLong = DateUtil.stringToDate(newDateStr).getTime(); + } + break; + case "2":// 表单字段 + if (stringimeRelationField != null) { + String fieldValue = ""; + if (stringimeRelationField.toLowerCase().contains(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX)) {// 子 + String[] split = stringimeRelationField.split("-"); + fieldValue = data.get(split[1]) != null ? data.get(split[1]).toString() : ""; + } else {// 主副 + Map mainAndMast = data.get("mainAndMast") != null + ? JsonUtil.entityToMap(data.get("mainAndMast")) + : data; + fieldValue = mainAndMast.get(stringimeRelationField) != null + ? mainAndMast.get(stringimeRelationField).toString() + : ""; + } + if (StringUtil.isNotEmpty(fieldValue)) { + String timeFormat = getTimeFormat(fieldValue); + startTimeLong = cn.hutool.core.date.DateUtil.parse(timeFormat, "yyyy-MM-dd HH:mm:ss").getTime(); + } + } + break; + case "3":// 填写当前时间 + startTimeLong = timestampInMillis; + break; + case "4":// 当前时间前 + Calendar caledel = Calendar.getInstance(); + caledel.setTimeInMillis(timestampInMillis); + if (YunzhupaasKeyConsts.DATE.equals(yunzhupaasKey)) { + switch (timeTarget) { + case "1":// 年 + caledel.set(Calendar.YEAR, caledel.get(Calendar.YEAR) - Integer.valueOf(timeValue));// 赋值年份 + break; + case "2":// 月 + caledel.set(Calendar.MONTH, caledel.get(Calendar.MONTH) - Integer.valueOf(timeValue)); + break; + case "3":// 日 + caledel.set(Calendar.DAY_OF_MONTH, + caledel.get(Calendar.DAY_OF_MONTH) - Integer.valueOf(timeValue)); + break; + } + } else { + switch (timeTarget) { + case "1":// 时 + caledel.set(Calendar.HOUR_OF_DAY, + caledel.get(Calendar.HOUR_OF_DAY) - Integer.valueOf(timeValue)); + break; + case "2":// 分 + caledel.set(Calendar.MINUTE, caledel.get(Calendar.MINUTE) - Integer.valueOf(timeValue)); + break; + case "3":// 秒 + caledel.set(Calendar.SECOND, caledel.get(Calendar.SECOND) - Integer.valueOf(timeValue)); + break; + } + } + startTimeLong = caledel.getTime().getTime(); + break; + case "5":// 当前时间后 + Calendar cale = Calendar.getInstance(); + cale.setTimeInMillis(timestampInMillis); + if (YunzhupaasKeyConsts.DATE.equals(yunzhupaasKey)) { + switch (timeTarget) { + case "1":// 年 + cale.set(Calendar.YEAR, cale.get(Calendar.YEAR) + Integer.valueOf(timeValue));// 赋值年份 + break; + case "2":// 月 + cale.set(Calendar.MONTH, cale.get(Calendar.MONTH) + Integer.valueOf(timeValue)); + break; + case "3":// 日 + cale.set(Calendar.DAY_OF_MONTH, + cale.get(Calendar.DAY_OF_MONTH) + Integer.valueOf(timeValue)); + break; + } + } else { + switch (timeTarget) { + case "1":// 时 + cale.set(Calendar.HOUR_OF_DAY, cale.get(Calendar.HOUR_OF_DAY) + Integer.valueOf(timeValue)); + break; + case "2":// 分 + cale.set(Calendar.MINUTE, cale.get(Calendar.MINUTE) + Integer.valueOf(timeValue)); + break; + case "3":// 秒 + cale.set(Calendar.SECOND, cale.get(Calendar.SECOND) + Integer.valueOf(timeValue)); + break; + } + } + startTimeLong = cale.getTime().getTime(); + break; + default: + break; + } + return startTimeLong; + } + + /** + * 字符串转数组 + * + * @param value 值 + * @return + */ + public static Object getDataConversion(Object value) { + if (value instanceof Integer || value instanceof Long || value instanceof Float || value instanceof Double + || value instanceof BigDecimal) + return value; + Object dataValue = getDataConversion(null, value, false, "/"); + return dataValue; + } + + /** + * 字符串转数组 + * + * @param redis 转换对象 + * @param value 值 + * @return + */ + public static Object getDataConversion(Map redis, Object value, boolean isMultiple, + String separator) { + Object dataValue = value; + boolean iszhuanhuan = redis != null; + try { + List list = JsonUtil.getJsonToList(String.valueOf(value), List.class); + dataValue = list; + if (iszhuanhuan) { + // 一级分隔符 + StringJoiner joiner = new StringJoiner(","); + for (List listChild : list) { + StringJoiner aa = new StringJoiner(separator); + for (Object object : listChild) { + String value1 = redis.get(String.valueOf(object)) != null + ? String.valueOf(redis.get(String.valueOf(object))) + : ""; + if (StringUtil.isNotEmpty(value1)) { + aa.add(value1); + } + } + joiner.add(aa.toString()); + } + dataValue = joiner.toString(); + } + } catch (Exception e) { + try { + List list = JsonUtil.getJsonToList(String.valueOf(value), String.class); + dataValue = list; + if (iszhuanhuan) { + if (isMultiple) {// 一级分隔符 + separator = ","; + } + StringJoiner joiner = new StringJoiner(separator); + for (Object listChild : list) { + String value1 = redis.get(String.valueOf(listChild)) != null + ? String.valueOf(redis.get(String.valueOf(listChild))) + : ""; + if (StringUtil.isNotEmpty(value1)) { + joiner.add(value1); + } + } + dataValue = joiner.toString(); + } + } catch (Exception e1) { + dataValue = String.valueOf(value); + if (iszhuanhuan) { + dataValue = redis.get(String.valueOf(value)) != null + ? String.valueOf(redis.get(String.valueOf(value))) + : ""; + } + } + } + return dataValue; + } + + /** + * 给列表数据添加id + * + * @param dataList + * @param key + */ + public static List> addIdToList(List> dataList, String key) { + return dataList.stream().map(data -> { + data.put(FlowFormConstant.ID, data.get(key)); + String flwoId = null; + if (data.get(TableFeildsEnum.FLOWID.getField()) != null) { + flwoId = String.valueOf(data.get(TableFeildsEnum.FLOWID.getField())); + } + if (data.get(TableFeildsEnum.FLOWID.getField().toUpperCase()) != null) { + flwoId = String.valueOf(data.get(TableFeildsEnum.FLOWID.getField().toUpperCase())); + } + data.put(FlowFormConstant.FLOWID, flwoId); + String flowTaskId = null; + if (data.get(TableFeildsEnum.FLOWTASKID.getField()) != null) { + flowTaskId = String.valueOf(data.get(TableFeildsEnum.FLOWTASKID.getField())); + } + if (data.get(TableFeildsEnum.FLOWTASKID.getField().toUpperCase()) != null) { + flowTaskId = String.valueOf(data.get(TableFeildsEnum.FLOWTASKID.getField().toUpperCase())); + } + data.put(FlowFormConstant.FLOWTASKID, flowTaskId); + + return data; + }).collect(Collectors.toList()); + } + + /** + * 关联表单获取原字段数据(数据类型也要转换) + * + * @param dataMap + * @param yunzhupaasKey + * @param obj + * @param vModel + */ + public static void relationGetYunzhupaasId(Map dataMap, String yunzhupaasKey, Object obj, + String vModel) { + String vModelyunzhupaasId = vModel + "_yunzhupaasId"; + switch (yunzhupaasKey) { + case YunzhupaasKeyConsts.CREATETIME: + case YunzhupaasKeyConsts.MODIFYTIME: + case YunzhupaasKeyConsts.DATE: + Long dateTime = DateTimeFormatConstant.getDateObjToLong(dataMap.get(vModel)); + dataMap.put(vModelyunzhupaasId, dateTime != null ? dateTime : dataMap.get(vModel)); + break; + case YunzhupaasKeyConsts.CHILD_TABLE: + break; + case YunzhupaasKeyConsts.SWITCH: + case YunzhupaasKeyConsts.SLIDER: + case YunzhupaasKeyConsts.RATE: + case YunzhupaasKeyConsts.CALCULATE: + case YunzhupaasKeyConsts.NUM_INPUT: + dataMap.put(vModelyunzhupaasId, + ObjectUtil.isNotEmpty(obj) ? new BigDecimal(String.valueOf(obj)) : dataMap.get(vModel)); + break; + default: + dataMap.put(vModelyunzhupaasId, obj); + break; + } + if (YunzhupaasKeyConsts.getArraysKey().contains(yunzhupaasKey) && obj != null) { + String o = String.valueOf(obj); + try { + List jsonToList = JsonUtil.getJsonToList(o, List.class); + List res = new ArrayList<>(); + for (List listChild : jsonToList) { + List res2 = new ArrayList<>(); + for (Object object : listChild) { + if (object != null && StringUtil.isNotEmpty(String.valueOf(object))) { + res2.add(object); + } + } + res.add(res2); + } + dataMap.put(vModelyunzhupaasId, res); + } catch (Exception e) { + try { + List jsonToList = JsonUtil.getJsonToList(o, Object.class); + dataMap.put(vModelyunzhupaasId, jsonToList); + } catch (Exception e1) { + } + } + } + } +} diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/OnlineFilterUtil.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/OnlineFilterUtil.java new file mode 100644 index 0000000..cf80fe0 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/OnlineFilterUtil.java @@ -0,0 +1,751 @@ +package com.yunzhupaas.base.util; + +import com.alibaba.fastjson.JSONArray; +import com.yunzhupaas.database.source.DbBase; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import lombok.Data; +import org.apache.commons.lang3.StringUtils; +import org.mybatis.dynamic.sql.AndOrCriteriaGroup; +import org.mybatis.dynamic.sql.SqlBuilder; +import org.mybatis.dynamic.sql.SqlTable; +import org.mybatis.dynamic.sql.select.QueryExpressionDSL; +import org.mybatis.dynamic.sql.select.SelectModel; + +import java.math.BigDecimal; +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; + +@Data +public class OnlineFilterUtil { + /** + * 表字段名和对应的表对象映射 + */ + Map subSqlTableMap; + /** + * 额外参数 + */ + Map params; + /** + * 字段说明 + */ + private String fieldName; + /** + * 运算符 + */ + private String operator; + /** + * 逻辑拼接符号 + */ + private String logic; + /** + * 组件标识 + */ + private String yunzhupaasKey; + /** + * 字段key + */ + private String field; + /** + * 自定义的值 + */ + private String fieldValue; + /** + * 自定义的值2 + */ + private String fieldValue2; + + private List selectIgnore; + + /** + * 显示类型 + */ + private String showLevel; + + /** + * 数据库类型 + */ + private String dbType; + /** + * 日期格式 + */ + private String format; + + /** + * 数字精度 + */ + private String precision; + + /** + * @param where where对象 + * @param sqlTable sql表对象,默认传主表 + * @return + */ + public QueryExpressionDSL.QueryExpressionWhereBuilder solveValue( + QueryExpressionDSL.QueryExpressionWhereBuilder where, SqlTable sqlTable) { + + if (!this.preHandle()) + return where; + + MyType myType = myControl(yunzhupaasKey); + if (fieldValue == null) { + fieldValue = ""; + } + try { + ArrayList splitKey = new ArrayList() { + { + add(YunzhupaasKeyConsts.DATE); + add(YunzhupaasKeyConsts.TIME); + add(YunzhupaasKeyConsts.NUM_INPUT); + add(YunzhupaasKeyConsts.CREATETIME); + add(YunzhupaasKeyConsts.MODIFYTIME); + } + }; + + if (splitKey.contains(yunzhupaasKey) && "between".equals(operator)) { + List data = JsonUtil.getJsonToList(fieldValue, String.class); + fieldValue = data.get(0); + fieldValue2 = data.get(1); + } + selectIgnore = new ArrayList() { + { + add(YunzhupaasKeyConsts.COMSELECT); + add(YunzhupaasKeyConsts.ADDRESS); + add(YunzhupaasKeyConsts.CASCADER); + add(YunzhupaasKeyConsts.CHECKBOX); + add(YunzhupaasKeyConsts.DEPSELECT); + } + }; + + String fieldKey = ""; + // 替换子表的sqlTable + if (field.indexOf("-") > 0) { + fieldKey = field.split("-")[0]; + sqlTable = this.subSqlTableMap.get(fieldKey); + field = field.split("-")[1]; + } + // 替换副表的字段 + if (field.indexOf("_yunzhupaas_") > 0) { + + sqlTable = this.subSqlTableMap.get(field); + field = field.split("_yunzhupaas_")[1]; + } + + myType.judge(where, sqlTable, field); + return where; + } catch (Exception e) { + return where; + } + } + + /** + * 前置异常或边界情况处理 + */ + private boolean preHandle() { + if (params != null) { + // 判断是否只需处理子副表,忽略主表 + Boolean onlySubTable = (Boolean) params.get("onlySubTable"); + // 如果是主表 + if (onlySubTable && !field.contains("_yunzhupaas_") && !field.contains("-")) { + return false; + } + // 不拼接副表 + if (onlySubTable && field.contains("_yunzhupaas_")) { + return false; + } + } + + return true; + } + + /** + * 判断控件的所属类型 + * + * @param yunzhupaasKey 控件标识 + * @return 控件类型 + */ + public MyType myControl(String yunzhupaasKey) { + MyType myType; + switch (yunzhupaasKey) { + case YunzhupaasKeyConsts.COM_INPUT: + case YunzhupaasKeyConsts.TEXTAREA: + case YunzhupaasKeyConsts.BILLRULE: + case YunzhupaasKeyConsts.POPUPTABLESELECT: + case YunzhupaasKeyConsts.RELATIONFORM: + case YunzhupaasKeyConsts.RELATIONFORM_ATTR: + case YunzhupaasKeyConsts.POPUPSELECT: + case YunzhupaasKeyConsts.POPUPSELECT_ATTR: + myType = new BasicControl(); + break; + case YunzhupaasKeyConsts.CALCULATE: + case YunzhupaasKeyConsts.NUM_INPUT: + myType = new NumControl(); + break; + case YunzhupaasKeyConsts.DATE: + case YunzhupaasKeyConsts.CREATETIME: + case YunzhupaasKeyConsts.MODIFYTIME: + myType = new DateControl(); + break; + case YunzhupaasKeyConsts.TIME: + myType = new TimeControl(); + break; + default: + myType = new SelectControl(); + } + return myType; + } + + /** + * 基础类型 + */ + class BasicControl extends MyType { + + @Override + void judge(QueryExpressionDSL.QueryExpressionWhereBuilder where, SqlTable sqlTable, String field) { + if ("&&".equals(logic)) { + switch (operator) { + case "null": + List group = new ArrayList<>(); + group.add(SqlBuilder.or(sqlTable.column(field), SqlBuilder.isEqualTo(""))); + where.and(sqlTable.column(field), SqlBuilder.isNull(), group); + break; + case "notNull": + List group2 = new ArrayList<>(); + group2.add(SqlBuilder.and(sqlTable.column(field), SqlBuilder.isNotEqualTo(""))); + where.and(sqlTable.column(field), SqlBuilder.isNotNull(), group2); + break; + case "==": + where.and(sqlTable.column(field), SqlBuilder.isEqualTo(fieldValue)); + break; + case "<>": + where.and(sqlTable.column(field), SqlBuilder.isNotEqualTo(fieldValue)); + break; + case "like": + convertSqlServerLike(); + where.and(sqlTable.column(field), SqlBuilder.isLike("%" + fieldValue + "%")); + break; + case "notLike": + convertSqlServerLike(); + where.and(sqlTable.column(field), SqlBuilder.isNotLike("%" + fieldValue + "%")); + break; + } + + } else { + switch (operator) { + case "null": + List group = new ArrayList<>(); + group.add(SqlBuilder.or(sqlTable.column(field), SqlBuilder.isEqualTo(""))); + where.or(sqlTable.column(field), SqlBuilder.isNull(), group); + break; + case "notNull": + List group2 = new ArrayList<>(); + group2.add(SqlBuilder.and(sqlTable.column(field), SqlBuilder.isNotEqualTo(""))); + where.or(sqlTable.column(field), SqlBuilder.isNotNull(), group2); + break; + case "==": + where.or(sqlTable.column(field), SqlBuilder.isEqualTo(fieldValue)); + break; + case "<>": + + where.or(sqlTable.column(field), SqlBuilder.isNotEqualTo(fieldValue)); + + break; + case "like": + convertSqlServerLike(); + where.or(sqlTable.column(field), SqlBuilder.isLike("%" + fieldValue + "%")); + break; + case "notLike": + convertSqlServerLike(); + where.or(sqlTable.column(field), SqlBuilder.isNotLike("%" + fieldValue + "%")); + break; + } + + } + } + } + + class NumControl extends MyType { + @Override + void judge(QueryExpressionDSL.QueryExpressionWhereBuilder where, SqlTable sqlTable, String field) { + // 转换数字类型; + BigDecimal num1 = null; + BigDecimal num2 = null; + if (StringUtil.isNotEmpty(fieldValue)) { + num1 = new BigDecimal(fieldValue); + } + if (StringUtil.isNotEmpty(fieldValue2)) { + num2 = new BigDecimal(fieldValue2); + } + // 精度处理 + String fieldPrecisionValue; + String fieldPrecisionValue2; + if (StringUtils.isNotBlank(precision)) { + String yunzhupaasNum = "0." + StringUtils.repeat("0", Integer.parseInt(precision)); + DecimalFormat numFormat = new DecimalFormat(yunzhupaasNum); + fieldPrecisionValue = numFormat.format(new BigDecimal(fieldValue)); + num1 = new BigDecimal(fieldPrecisionValue); + if (fieldValue2 != null) { + fieldPrecisionValue2 = numFormat.format(new BigDecimal(fieldValue2)); + num2 = new BigDecimal(fieldPrecisionValue2); + } + } + + if ("&&".equals(logic)) { + switch (operator) { + case "null": + List group = new ArrayList<>(); + where.and(sqlTable.column(field), SqlBuilder.isNull(), group); + break; + case "notNull": + List group2 = new ArrayList<>(); + where.and(sqlTable.column(field), SqlBuilder.isNotNull(), group2); + break; + case "==": + where.and(sqlTable.column(field), SqlBuilder.isEqualTo(num1)); + break; + case "<>": + + where.and(sqlTable.column(field), SqlBuilder.isNotEqualTo(num1)); + + break; + case ">": + where.and(sqlTable.column(field), SqlBuilder.isGreaterThan(num1)); + + break; + case "<": + where.and(sqlTable.column(field), SqlBuilder.isLessThan(num1)); + break; + case ">=": + where.and(sqlTable.column(field), SqlBuilder.isGreaterThanOrEqualTo(num1)); + break; + case "<=": + where.and(sqlTable.column(field), SqlBuilder.isLessThanOrEqualTo(num1)); + break; + case "between": + where.and(sqlTable.column(field), SqlBuilder.isGreaterThanOrEqualTo(num1)); + where.and(sqlTable.column(field), SqlBuilder.isLessThanOrEqualTo(num2)); + break; + } + } else { + switch (operator) { + case "null": + List group = new ArrayList<>(); + where.or(sqlTable.column(field), SqlBuilder.isNull(), group); + break; + case "notNull": + List group2 = new ArrayList<>(); + where.or(sqlTable.column(field), SqlBuilder.isNotNull(), group2); + break; + case "==": + where.or(sqlTable.column(field), SqlBuilder.isEqualTo(num1)); + break; + case "<>": + where.or(sqlTable.column(field), SqlBuilder.isNotEqualTo(num1)); + + break; + case ">": + where.or(sqlTable.column(field), SqlBuilder.isGreaterThan(num1)); + break; + case "<": + where.or(sqlTable.column(field), SqlBuilder.isLessThan(num1)); + break; + case ">=": + where.or(sqlTable.column(field), SqlBuilder.isGreaterThanOrEqualTo(num1)); + break; + case "<=": + where.or(sqlTable.column(field), SqlBuilder.isLessThanOrEqualTo(num1)); + break; + case "between": + where.or(sqlTable.column(field), SqlBuilder.isGreaterThanOrEqualTo(num1)); + where.and(sqlTable.column(field), SqlBuilder.isLessThanOrEqualTo(num2)); + break; + } + } + } + + } + + class DateControl extends MyType { + @Override + void judge(QueryExpressionDSL.QueryExpressionWhereBuilder where, SqlTable sqlTable, String field) { + Long time = null; + Long time2 = null; + Date date = new Date(); + Date date2 = new Date(); + if (StringUtils.isNoneBlank(fieldValue)) { + time = Long.valueOf(fieldValue); + date = new Date(time); + } + if (StringUtils.isNoneBlank(fieldValue2)) { + time2 = Long.valueOf(fieldValue2); + // 日期类型的要加上当天的23:59:59 + if (YunzhupaasKeyConsts.DATE.equals(yunzhupaasKey)) { + date2 = new Date(time2 + 60 * 60 * 24 * 1000 - 1000); + } else { + date2 = new Date(time2); + } + + } + + if ("&&".equals(logic)) { + switch (operator) { + case "null": + List group = new ArrayList<>(); + where.and(sqlTable.column(field), SqlBuilder.isNull(), group); + break; + case "notNull": + List group2 = new ArrayList<>(); + where.and(sqlTable.column(field), SqlBuilder.isNotNull(), group2); + break; + case "==": + where.and(sqlTable.column(field), SqlBuilder.isEqualTo(date)); + break; + case "<>": + where.and(sqlTable.column(field), SqlBuilder.isNotEqualTo(date)); + break; + case ">": + where.and(sqlTable.column(field), SqlBuilder.isGreaterThan(date)); + break; + case "<": + where.and(sqlTable.column(field), SqlBuilder.isLessThan(date)); + break; + case ">=": + where.and(sqlTable.column(field), SqlBuilder.isGreaterThanOrEqualTo(date)); + break; + case "<=": + where.and(sqlTable.column(field), SqlBuilder.isLessThanOrEqualTo(date)); + break; + case "between": + where.and(sqlTable.column(field), SqlBuilder.isGreaterThanOrEqualTo(date)); + where.and(sqlTable.column(field), SqlBuilder.isLessThanOrEqualTo(date2)); + break; + } + + } else { + switch (operator) { + case "null": + List group = new ArrayList<>(); + where.or(sqlTable.column(field), SqlBuilder.isNull(), group); + break; + case "notNull": + List group2 = new ArrayList<>(); + where.or(sqlTable.column(field), SqlBuilder.isNotNull(), group2); + break; + case "==": + where.or(sqlTable.column(field), SqlBuilder.isEqualTo(date)); + break; + case "<>": + where.or(sqlTable.column(field), SqlBuilder.isNotEqualTo(date)); + break; + case ">": + where.or(sqlTable.column(field), SqlBuilder.isGreaterThan(date)); + break; + case "<": + where.or(sqlTable.column(field), SqlBuilder.isLessThan(date)); + break; + case ">=": + where.or(sqlTable.column(field), SqlBuilder.isGreaterThanOrEqualTo(date)); + break; + case "<=": + where.or(sqlTable.column(field), SqlBuilder.isLessThanOrEqualTo(date)); + break; + case "between": + where.or(sqlTable.column(field), SqlBuilder.isGreaterThanOrEqualTo(date)); + where.and(sqlTable.column(field), SqlBuilder.isLessThanOrEqualTo(date2)); + break; + } + + } + } + + } + + class TimeControl extends MyType { + @Override + void judge(QueryExpressionDSL.QueryExpressionWhereBuilder where, SqlTable sqlTable, String field) { + if ("&&".equals(logic)) { + switch (operator) { + case "null": + List group = new ArrayList<>(); + where.and(sqlTable.column(field), SqlBuilder.isNull(), group); + break; + case "notNull": + List group2 = new ArrayList<>(); + where.and(sqlTable.column(field), SqlBuilder.isNotNull(), group2); + break; + case "==": + where.and(sqlTable.column(field), SqlBuilder.isEqualTo(fieldValue)); + break; + case "<>": + where.and(sqlTable.column(field), SqlBuilder.isNotEqualTo(fieldValue)); + break; + case ">": + where.and(sqlTable.column(field), SqlBuilder.isGreaterThan(fieldValue)); + break; + case "<": + where.and(sqlTable.column(field), SqlBuilder.isLessThan(fieldValue)); + break; + case ">=": + where.and(sqlTable.column(field), SqlBuilder.isGreaterThanOrEqualTo(fieldValue)); + break; + case "<=": + where.and(sqlTable.column(field), SqlBuilder.isLessThanOrEqualTo(fieldValue)); + break; + case "between": + where.and(sqlTable.column(field), SqlBuilder.isGreaterThanOrEqualTo(fieldValue)); + where.and(sqlTable.column(field), SqlBuilder.isLessThanOrEqualTo(fieldValue2)); + break; + } + + } else { + switch (operator) { + case "null": + List group = new ArrayList<>(); + where.or(sqlTable.column(field), SqlBuilder.isNull(), group); + break; + case "notNull": + List group2 = new ArrayList<>(); + where.or(sqlTable.column(field), SqlBuilder.isNotNull(), group2); + break; + case "==": + where.or(sqlTable.column(field), SqlBuilder.isEqualTo(fieldValue)); + break; + case "<>": + where.or(sqlTable.column(field), SqlBuilder.isNotEqualTo(fieldValue)); + break; + case ">": + where.or(sqlTable.column(field), SqlBuilder.isGreaterThan(fieldValue)); + break; + case "<": + where.or(sqlTable.column(field), SqlBuilder.isLessThan(fieldValue)); + break; + case ">=": + where.or(sqlTable.column(field), SqlBuilder.isGreaterThanOrEqualTo(fieldValue)); + break; + case "<=": + where.or(sqlTable.column(field), SqlBuilder.isLessThanOrEqualTo(fieldValue)); + break; + case "between": + where.or(sqlTable.column(field), SqlBuilder.isGreaterThanOrEqualTo(fieldValue)); + where.and(sqlTable.column(field), SqlBuilder.isLessThanOrEqualTo(fieldValue2)); + break; + } + + } + } + } + + /** + * 下拉控件类型 + */ + class SelectControl extends MyType { + @Override + void judge(QueryExpressionDSL.QueryExpressionWhereBuilder where, SqlTable sqlTable, String field) { + List list = new ArrayList<>(); + + if (selectIgnore.contains(yunzhupaasKey) && StringUtils.isBlank(fieldValue)) { + fieldValue = "[]"; + } + if ("&&".equals(logic)) { + switch (operator) { + case "null": + List group = new ArrayList<>(); + if (!DbBase.ORACLE.equals(dbType)) { + group.add(SqlBuilder.or(sqlTable.column(field), SqlBuilder.isEqualTo(""))); + } + group.add(SqlBuilder.or(sqlTable.column(field), SqlBuilder.isEqualTo("[]"))); + where.and(sqlTable.column(field), SqlBuilder.isNull(), group); + break; + case "notNull": + List group2 = new ArrayList<>(); + if (!DbBase.ORACLE.equals(dbType)) { + group2.add(SqlBuilder.and(sqlTable.column(field), SqlBuilder.isNotEqualTo(""))); + } + group2.add(SqlBuilder.and(sqlTable.column(field), SqlBuilder.isNotEqualTo("[]"))); + where.and(sqlTable.column(field), SqlBuilder.isNotNull(), group2); + break; + case "==": + convertSqlServerLike(); + where.and(sqlTable.column(field), SqlBuilder.isLike(fieldValue)); + break; + case "<>": + where.and(sqlTable.column(field), SqlBuilder.isNotLike(fieldValue)); + break; + case "like": + convertSqlServerLike(); + where.and(sqlTable.column(field), SqlBuilder.isLike("%" + fieldValue + "%")); + break; + case "notLike": + convertSqlServerLike(); + where.and(sqlTable.column(field), SqlBuilder.isNotLike("%" + fieldValue + "%")); + break; + case "in": + List dataList = this.solveListValue(fieldValue); + if (dataList.size() > 0) { + List group3 = new ArrayList<>(); + String valueFirst = ""; + for (int i = 0; i < dataList.size(); i++) { + String value = dataList.get(i); + value = convertSqlServerLike(value); + AndOrCriteriaGroup condition = null; + if (i == 0) { + valueFirst = value; + } else { + condition = SqlBuilder.or(sqlTable.column(field), + SqlBuilder.isLike("%" + value + "%")); + group3.add(condition); + } + + } + where.and(sqlTable.column(field), SqlBuilder.isLike("%" + valueFirst + "%"), group3); + } + if (YunzhupaasKeyConsts.CASCADER.equals(yunzhupaasKey) + || YunzhupaasKeyConsts.COMSELECT.equals(yunzhupaasKey) + || YunzhupaasKeyConsts.ADDRESS.equals(yunzhupaasKey)) { + where.and(sqlTable.column(field), SqlBuilder.isNotNull()); + where.and(sqlTable.column(field), SqlBuilder.isNotEqualTo("[]")); + } + break; + case "notIn": + List dataList2 = this.solveListValue(fieldValue); + if (dataList2.size() > 0) { + for (int i = 0; i < dataList2.size(); i++) { + String value = dataList2.get(i); + where.and(sqlTable.column(field), SqlBuilder.isNotLike("%" + value + "%")); + } + } + if (YunzhupaasKeyConsts.CASCADER.equals(yunzhupaasKey) + || YunzhupaasKeyConsts.COMSELECT.equals(yunzhupaasKey) + || YunzhupaasKeyConsts.ADDRESS.equals(yunzhupaasKey)) { + where.and(sqlTable.column(field), SqlBuilder.isNotNull()); + where.and(sqlTable.column(field), SqlBuilder.isNotEqualTo("[]")); + } + break; + } + + } else { + + switch (operator) { + case "null": + List group = new ArrayList<>(); + if (!DbBase.ORACLE.equals(dbType)) { + group.add(SqlBuilder.or(sqlTable.column(field), SqlBuilder.isEqualTo(""))); + } + group.add(SqlBuilder.or(sqlTable.column(field), SqlBuilder.isEqualTo("[]"))); + where.or(sqlTable.column(field), SqlBuilder.isNull(), group); + break; + case "notNull": + List group2 = new ArrayList<>(); + if (!DbBase.ORACLE.equals(dbType)) { + group2.add(SqlBuilder.and(sqlTable.column(field), SqlBuilder.isNotEqualTo(""))); + } + group2.add(SqlBuilder.and(sqlTable.column(field), SqlBuilder.isNotEqualTo("[]"))); + where.or(sqlTable.column(field), SqlBuilder.isNotNull(), group2); + break; + case "==": + where.or(sqlTable.column(field), SqlBuilder.isEqualTo(fieldValue)); + break; + case "<>": + + where.or(sqlTable.column(field), SqlBuilder.isNotEqualTo(fieldValue)); + break; + case "like": + convertSqlServerLike(); + where.or(sqlTable.column(field), SqlBuilder.isLike("%" + fieldValue + "%")); + break; + case "notLike": + convertSqlServerLike(); + where.or(sqlTable.column(field), SqlBuilder.isNotLike("%" + fieldValue + "%")); + break; + case "in": + if (selectIgnore.contains(yunzhupaasKey)) { + convertSqlServerLike(); + where.or(sqlTable.column(field), SqlBuilder.isLike(fieldValue)); + } else { + if (list.size() > 0) { + where.or(sqlTable.column(field), SqlBuilder.isIn(list)); + } + + } + if (YunzhupaasKeyConsts.CASCADER.equals(yunzhupaasKey) + || YunzhupaasKeyConsts.COMSELECT.equals(yunzhupaasKey) + || YunzhupaasKeyConsts.ADDRESS.equals(yunzhupaasKey)) { + where.and(sqlTable.column(field), SqlBuilder.isNotNull()); + where.and(sqlTable.column(field), SqlBuilder.isNotEqualTo("[]")); + } + break; + case "notIn": + if (selectIgnore.contains(yunzhupaasKey)) { + List data = JsonUtil.getJsonToList(fieldValue, String.class); + if (data.size() > 0) { + where.or(sqlTable.column(field), SqlBuilder.isNotLike(data)); + } + + } else { + if (list != null && list.size() > 0) { + where.or(sqlTable.column(field), SqlBuilder.isNotIn(list)); + } + + } + if (YunzhupaasKeyConsts.CASCADER.equals(yunzhupaasKey) + || YunzhupaasKeyConsts.COMSELECT.equals(yunzhupaasKey) + || YunzhupaasKeyConsts.ADDRESS.equals(yunzhupaasKey)) { + where.and(sqlTable.column(field), SqlBuilder.isNotNull()); + where.and(sqlTable.column(field), SqlBuilder.isNotEqualTo("[]")); + } + break; + } + + } + } + + private ArrayList solveListValue(String fieldValue) { + ArrayList result = new ArrayList<>(); + try { + List list = JsonUtil.getJsonToList(fieldValue, List.class); + for (List listSub : list) { + result.add(JSONArray.toJSONString(listSub)); + // 组织选择需要取最后每个数组最后一个 + String value = (String) listSub.get(listSub.size() - 1); + result.add(value); + } + + } catch (Exception e) { + List list = JsonUtil.getJsonToList(fieldValue, String.class); + result.add(JSONArray.toJSONString(list)); + result.addAll(list); + } + return result; + } + + } + + private abstract class MyType { + abstract void judge(QueryExpressionDSL.QueryExpressionWhereBuilder where, SqlTable sqlTable, + String field); + } + + /** + * SQLSERVER数据库 like括号语法 + * + * @param val + * @return + */ + private String convertSqlServerLike(String val) { + if (DbBase.SQL_SERVER.equals(dbType)) { + val = val.replaceAll("\\[", "[[]"); + } + return val; + } + + private void convertSqlServerLike() { + if (DbBase.SQL_SERVER.equals(dbType)) { + fieldValue = convertSqlServerLike(fieldValue); + } + } + +} diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/ReadFile.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/ReadFile.java new file mode 100644 index 0000000..470dc70 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/ReadFile.java @@ -0,0 +1,96 @@ +package com.yunzhupaas.base.util; + +import com.yunzhupaas.base.model.read.ReadEnum; +import com.yunzhupaas.base.model.read.ReadListVO; +import com.yunzhupaas.base.model.read.ReadModel; +import com.yunzhupaas.util.FileUtil; +import com.yunzhupaas.util.RandomUtil; +import lombok.Cleanup; +import lombok.extern.slf4j.Slf4j; + +import java.io.*; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/8/20 + */ +@Slf4j +public class ReadFile { + + + /** + * 预览代码 + * + * @param codePath + * @return + */ + public static List priviewCode(String codePath) { + File fileAll = new File(com.yunzhupaas.util.XSSEscape.escapePath(codePath)); + List fileList = new ArrayList<>(); + if (fileAll.exists()) { + FileUtil.getFile(fileAll, fileList); + } + Map> data = new LinkedHashMap<>(); + for (int i = fileList.size() - 1; i >= 0; i--) { + File file = fileList.get(i); + String path = file.getAbsolutePath(); + ReadEnum readEnum = ReadEnum.getMessage(path); + if (readEnum != null) { + ReadModel readModel = new ReadModel(); + String fileContent = readFile(file); + readModel.setFileContent(fileContent); + readModel.setFileName(file.getName()); + readModel.setFileType(readEnum.getMessage()); + readModel.setId(RandomUtil.uuId()); + String folderName = FileUtil.getFileType(file); + readModel.setFolderName(folderName); + List readModelList = data.get(readEnum.getMessage()) != null ? data.get(readEnum.getMessage()) : new ArrayList<>(); + readModelList.add(readModel); + data.put(readEnum.getMessage(), readModelList); + } + } + List list = new ArrayList<>(); + for (String fileName : data.keySet()) { + ReadListVO listVO = new ReadListVO(); + listVO.setFileName(fileName); + listVO.setChildren(data.get(fileName)); + listVO.setId(RandomUtil.uuId()); + list.add(listVO); + } + return list; + } + + + /** + * 读取指定目录下的文件 + * + * @param path 文件的路径 + * @return 文件内容 + */ + private static String readFile(File path) { + String fileRead = ""; + try { + //创建一个输入流对象 + @Cleanup InputStream is = new FileInputStream(path); + @Cleanup ByteArrayOutputStream out = new ByteArrayOutputStream(); + byte[] buffer = new byte[1024]; + int n; + while ((n = is.read(buffer)) != -1) { + out.write(buffer, 0, n); + } + //释放资源 + is.close(); + fileRead = out.toString(); + } catch (IOException e) { + log.error("代码生成器读取文件报错:" + e.getMessage()); + } + return fileRead; + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/ServiceBaseUtil.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/ServiceBaseUtil.java new file mode 100644 index 0000000..e71ff9f --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/ServiceBaseUtil.java @@ -0,0 +1,275 @@ +package com.yunzhupaas.base.util; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.yunzhupaas.base.Page; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.service.*; +import com.yunzhupaas.database.model.dbfield.DbFieldModel; +import com.yunzhupaas.database.model.dbfield.base.DbFieldModelBase; +import com.yunzhupaas.database.model.dbtable.DbTableFieldModel; +import com.yunzhupaas.database.model.entity.DbLinkEntity; +import com.yunzhupaas.permission.entity.*; +import com.yunzhupaas.permission.model.user.vo.UserByRoleVO; +import com.yunzhupaas.permission.service.*; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.enums.DictionaryDataEnum; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import static com.yunzhupaas.util.Constants.ADMIN_KEY; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/4/9 13:28 + */ +@Component +@DS("") +public class ServiceBaseUtil { + + @Autowired + private DbLinkService dblinkService; + @Autowired + private DbTableService dbTableService; + @Autowired + private DictionaryDataService dictionaryDataService; + @Autowired + private DictionaryTypeService dictionaryTypeService; + @Autowired + private UserRelationService userRelationService; + @Autowired + private UserService userService; + @Autowired + private RoleService roleService; + @Autowired + private OrganizeService organizeService; + @Autowired + private PositionService positionService; + @Autowired + private BillRuleService billRuleService; + @Autowired + private DataInterfaceService dataInterfaceService; + + //--------------------------------数据连接------------------------------ + public DbLinkEntity getDbLink(String dbLink) { + DbLinkEntity link = StringUtil.isNotEmpty(dbLink) ? dblinkService.getInfo(dbLink) : null; + return link; + } + + public void createTable(List dbTable) throws Exception { + for (DbTableFieldModel dbTableFieldModel : dbTable) { + dbTableService.createTable(dbTableFieldModel); + } + } + + public void addField(DbTableFieldModel dbTable) throws Exception { + dbTableService.addField(dbTable); + } + + public List getDbTableModel(String linkId, String table) throws Exception { + List dbFieldModelList = dbTableService.getDbTableModel(linkId, table).getDbFieldModelList(); + List list = JsonUtil.getJsonToList(dbFieldModelList, DbFieldModelBase.class); + return list; + } + + /** + * 获取所有字段 + * + * @param linkId 链接名 + * @param table 表名 + * @return + * @throws Exception + */ + public List getFieldList(String linkId, String table) throws Exception { + return dbTableService.getFieldList(linkId, table); + } + + + //--------------------------------数据字典------------------------------ + public List getDiList() { + List dictionList = dictionaryDataService.getList(dictionaryTypeService.getInfoByEnCode(DictionaryDataEnum.FLOWWOEK_ENGINE.getDictionaryTypeId()).getId()); + return dictionList; + } + + public List getDictionName(List id) { + List dictionList = dictionaryDataService.getDictionName(id); + return dictionList; + } + + //--------------------------------用户关系表------------------------------ + public List getListByUserIdAll(List id) { + List list = userRelationService.getListByUserIdAll(id); + return list; + } + + public List getListByObjectIdAll(List id) { + List list = userRelationService.getListByObjectIdAll(id); + return list; + } + + public String getAdmin() { + UserEntity admin = userService.getUserByAccount(ADMIN_KEY); + return admin.getId(); + } + + //--------------------------------用户------------------------------ + public List getUserName(List id) { + List list = getUserName(id, false); + return list; + } + + public List getListByManagerId(String managerId) { + List list = StringUtil.isNotEmpty(managerId) ? userService.getListByManagerId(managerId, null) : new ArrayList<>(); + return list; + } + + public List getUserName(List id, boolean enableMark) { + List list = userService.getUserName(id); + if (enableMark) { + list = list.stream().filter(t -> t.getEnabledMark() != 0).collect(Collectors.toList()); + } + return list; + } + + public List getUserName(List id, Pagination pagination) { + List list = userService.getUserName(id, pagination); + return list; + } + + public UserEntity getUserInfo(String id) { + UserEntity entity = null; + if (StringUtil.isNotEmpty(id)) { + entity = id.equalsIgnoreCase(ADMIN_KEY) ? userService.getUserByAccount(id) : userService.getInfo(id); + } + return entity; + } + + public UserEntity getByRealName(String realName) { + UserEntity entity = StringUtil.isNotEmpty(realName) ? userService.getByRealName(realName) : null; + return entity; + } + + public List getListByAuthorize(String organizeId) { + List list = userService.getListByAuthorize(organizeId, new Page()); + return list; + } + + //--------------------------------单据规则------------------------------ + public String getBillNumber(String enCode) { + String billNo = ""; + try { + billNo = billRuleService.getBillNumber(enCode, false); + } catch (Exception e) { + + } + return billNo; + } + + public void useBillNumber(String enCode) { + billRuleService.useBillNumber(enCode); + } + + //--------------------------------角色------------------------------ + public List getListByIds(List id) { + List list = roleService.getListByIds(id, null, false); + return list; + } + + //--------------------------------组织------------------------------ + public List getOrganizeName(List id) { + List list = organizeService.getOrganizeName(id); + return list; + } + + public OrganizeEntity getOrganizeInfo(String id) { + OrganizeEntity entity = StringUtil.isNotEmpty(id) ? organizeService.getInfo(id) : null; + return entity; + } + + public OrganizeEntity getOrganizeFullName(String fullName) { + OrganizeEntity entity = organizeService.getByFullName(fullName); + return entity; + } + + public List getOrganizeId(String organizeId) { + List organizeList = new ArrayList<>(); + organizeService.getOrganizeId(organizeId, organizeList); + Collections.reverse(organizeList); + return organizeList; + } + + public List getDepartmentAll(String organizeId) { + List departmentAll = organizeService.getDepartmentAll(organizeId); + return departmentAll; + } + + /** + * 获取当前组织名称(all-显示组织名,else 显示部门名) + * + * @param obj + * @param showLevel + * @return + */ + public String getCurrentOrganizeName(Object obj, String showLevel) { + if (obj == null) { + return null; + } + String value = String.valueOf(obj); + String orgName = ""; + if (value != null) { + String orgId = ""; + try { + List jsonToList = JsonUtil.getJsonToList(value, String.class); + orgId = jsonToList.get(jsonToList.size() - 1); + } catch (Exception e) { + orgId = value; + } + OrganizeEntity organizeEntity = this.getOrganizeInfo(orgId); + if ("all".equals(showLevel)) { + if (organizeEntity != null) { + List organizeList = this.getOrganizeId(organizeEntity.getId()); + orgName = organizeList.stream().map(OrganizeEntity::getFullName).collect(Collectors.joining("/")); + } + } else { + if (organizeEntity != null && "department".equals(organizeEntity.getCategory())) { + orgName = organizeEntity.getFullName(); + } else { + orgName = " "; + } + } + } + return orgName; + } + + //--------------------------------岗位------------------------------ + public List getPositionName(List id) { + List list = positionService.getPositionName(id, false); + return list; + } + + public PositionEntity getPositionFullName(String fullName) { + PositionEntity entity = positionService.getByFullName(fullName); + return entity; + } + + public PositionEntity getPositionInfo(String id) { + PositionEntity entity = StringUtil.isNotEmpty(id) ? positionService.getInfo(id) : null; + return entity; + } + + //--------------------------------远端------------------------------ + public void infoToId(String interId, Map parameterMap) { + dataInterfaceService.infoToId(interId, null, parameterMap); + } + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/VisualBillUtil.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/VisualBillUtil.java new file mode 100644 index 0000000..e0c22f3 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/VisualBillUtil.java @@ -0,0 +1,195 @@ +package com.yunzhupaas.base.util; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.ObjectUtil; +import com.yunzhupaas.base.entity.BillNumEntity; +import com.yunzhupaas.base.service.BillNumService; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.model.visualJson.FieLdsModel; +import com.yunzhupaas.model.visualJson.config.ConfigModel; +import com.yunzhupaas.model.visualJson.config.PrefixSuffixModel; +import com.yunzhupaas.model.visualJson.config.RuleConfig; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import lombok.Synchronized; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@Component +public class VisualBillUtil { + @Autowired + private BillNumService billNumService; + + @Synchronized + public Object getBillNumber(String visualId, FieLdsModel fieLdsModel, Map data, Object thisValue) { + String yunzhupaasKey = fieLdsModel.getConfig().getYunzhupaasKey(); + if (YunzhupaasKeyConsts.BILLRULE.equals(yunzhupaasKey) && fieLdsModel.getConfig().getRuleType() != null + && Objects.equals(fieLdsModel.getConfig().getRuleType(), 2) && ObjectUtil.isEmpty(thisValue)) { + ConfigModel config = fieLdsModel.getConfig(); + RuleConfig ruleConfig = config.getRuleConfig(); + Integer type = ruleConfig.getType(); + String flowId = null; + if (data.get(FlowFormConstant.FLOWID) != null + && StringUtil.isNotEmpty(data.get(FlowFormConstant.FLOWID).toString())) { + flowId = data.get(FlowFormConstant.FLOWID).toString(); + } + + StringBuilder strNumber = new StringBuilder(); + // 前缀 + String preFixStr = setPreSuffFix(data, ruleConfig.getPrefixList()); + if (StringUtil.isNotEmpty(preFixStr) && preFixStr.length() > 100) { + throw new DataException(MsgCode.VS027.get(config.getLabel())); + } + strNumber.append(preFixStr); + + String ruleId = config.getFormId(); + BillNumEntity billNum = billNumService.getBillNum(ruleId, visualId, flowId); + switch (type) { + case 2: + // 随机数编号 + if (ObjectUtil.equal(ruleConfig.getRandomType(), 1)) { + strNumber.append(cn.hutool.core.util.RandomUtil.randomNumbers(ruleConfig.getRandomDigit())); + } else { + strNumber.append(cn.hutool.core.util.RandomUtil.randomStringUpper(ruleConfig.getRandomDigit())); + } + if (billNum != null) { + billNumService.removeByRuleId(ruleId, visualId, flowId); + } + break; + case 3: + // UUID + strNumber.append(IdUtil.randomUUID().toUpperCase()); + if (billNum != null) { + billNumService.removeByRuleId(ruleId, visualId, flowId); + } + break; + default: + // 时间格式 + RuleConfig rule = BeanUtil.copyProperties(ruleConfig, RuleConfig.class); + rule.setRandomDigit(null); + rule.setRandomType(null); + String ruleJosn = JsonUtil.getObjectToString(rule); + + String dateFormat = getTimeFormat(ruleConfig.getDateFormat()); + String dateValue = "no".equals(dateFormat) ? "" : DateUtil.dateNow(dateFormat); + // 获取位数最大值 + Integer digit = ruleConfig.getDigit(); + StringBuilder maxStr = new StringBuilder(); + for (int i = 0; i < digit; i++) { + maxStr.append("9"); + } + Integer maxValue = Integer.parseInt(maxStr.toString()); + // 起始值 + Integer startNumber = Integer.parseInt(ruleConfig.getStartNumber()); + Integer thisNum = 0; + + // 处理流水号归0 + if (billNum != null) { + if (ruleJosn.equals(billNum.getRuleConfig())) { + String dateValueOld = billNum.getDateValue(); + // 判断时间值是否一致,一致流水号递增,不一致则重置流水号 + if (StringUtil.isEmpty(dateValueOld) || dateValueOld.equals(dateValue)) { + thisNum = billNum.getNum() + 1; + if (startNumber + thisNum > maxValue) { + thisNum = 0; + } + } + } + } else { + billNum = new BillNumEntity(); + } + billNum.setRuleId(ruleId); + billNum.setVisualId(visualId); + billNum.setFlowId(flowId); + billNum.setDateValue(dateValue); + billNum.setNum(thisNum); + billNum.setRuleConfig(ruleJosn); + billNumService.saveBillNum(billNum); + + if (!"no".equals(dateValue)) { + strNumber.append(dateValue); + } + strNumber.append( + PadUtil.padRight(String.valueOf(startNumber + thisNum), ruleConfig.getDigit(), '0')); + break; + } + // 后缀 + String suffFixStr = setPreSuffFix(data, ruleConfig.getSuffixList()); + if (StringUtil.isNotEmpty(suffFixStr) && suffFixStr.length() > 100) { + throw new DataException(MsgCode.VS027.get(config.getLabel())); + } + strNumber.append(suffFixStr); + return strNumber.toString(); + } else { + return thisValue; + } + } + + /** + * 获取时间格式 + * + * @param dateFor + * @return + */ + private static String getTimeFormat(String dateFor) { + String dateForValue = "no"; + if (StringUtil.isEmpty(dateFor)) { + return dateForValue; + } + switch (dateFor) { + case "YYYY": + dateForValue = "yyyy"; + break; + case "YYYYMM": + dateForValue = "yyyyMM"; + break; + case "YYYYMMDD": + dateForValue = "yyyyMMdd"; + break; + case "YYYYMMDDHH": + dateForValue = "yyyyMMddHH"; + break; + case "YYYYMMDDHHmm": + dateForValue = "yyyyMMddHHmm"; + break; + case "YYYYMMDDHHmmss": + dateForValue = "yyyyMMddHHmmss"; + break; + case "YYYYMMDDHHmmssSSS": + dateForValue = "yyyyMMddHHmmssSSS"; + break; + } + return dateForValue; + } + + /** + * 设置前后缀的值 + * + * @param data + * @param list + */ + private static String setPreSuffFix(Map data, List list) { + StringBuilder sb = new StringBuilder(); + if (CollectionUtils.isNotEmpty(list)) { + for (PrefixSuffixModel prefix : list) { + // sourtype = 2自定义,1表单字段 + if (Objects.equals(prefix.getSourceType(), 2)) { + sb.append(prefix.getRelationField()); + } else { + if (StringUtil.isNotEmpty(prefix.getRelationField()) + && data.get(prefix.getRelationField()) != null) { + sb.append(data.get(prefix.getRelationField())); + } + } + } + } + return sb.toString(); + } +} diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/VisualDevTableCre.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/VisualDevTableCre.java new file mode 100644 index 0000000..2e5c3de --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/VisualDevTableCre.java @@ -0,0 +1,376 @@ +package com.yunzhupaas.base.util; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.yunzhupaas.base.model.dbtable.vo.DbFieldVO; +import com.yunzhupaas.base.model.form.VisualTableModel; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.database.constant.DbFieldConst; +import com.yunzhupaas.database.datatype.viewshow.constant.DtViewConst; +import com.yunzhupaas.database.model.dbfield.DbFieldModel; +import com.yunzhupaas.database.model.dbtable.DbTableFieldModel; +import com.yunzhupaas.database.model.entity.DbLinkEntity; +import com.yunzhupaas.database.source.DbBase; +import com.yunzhupaas.database.util.DataSourceUtil; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.model.visualJson.FieLdsModel; +import com.yunzhupaas.model.visualJson.TableFields; +import com.yunzhupaas.model.visualJson.TableModel; +import com.yunzhupaas.model.visualJson.analysis.FormAllModel; +import com.yunzhupaas.model.visualJson.analysis.FormColumnTableModel; +import com.yunzhupaas.model.visualJson.analysis.FormEnum; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.TableFeildsEnum; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/3/25 9:30 + */ +@Slf4j +@Component +public class VisualDevTableCre { + @Autowired + private ServiceBaseUtil serviceUtil; + @Autowired + private DataSourceUtil dataSourceUtil; + + /** + * 表单赋值tableName + * + * @param jsonArray + * @param tableModels + */ + private void fieldsTableName(JSONArray jsonArray, List tableModels) { + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject jsonObject = (JSONObject) jsonArray.get(i); + String yunzhupaaskey = jsonObject.getJSONObject("__config__").getString("yunzhupaasKey"); + List childrenListAll = new ArrayList() { + { + add(FormEnum.card.getMessage()); + add(FormEnum.row.getMessage()); + add(FormEnum.tab.getMessage()); + add(FormEnum.collapse.getMessage()); + add(FormEnum.collapseItem.getMessage()); + add(FormEnum.tabItem.getMessage()); + add(FormEnum.tableGrid.getMessage()); + add(FormEnum.tableGridTr.getMessage()); + add(FormEnum.tableGridTd.getMessage()); + add(FormEnum.STEPS.getMessage()); + add(FormEnum.STEP_ITEM.getMessage()); + } + }; + if (childrenListAll.contains(yunzhupaaskey) || StringUtil.isEmpty(yunzhupaaskey)) { + JSONArray childArray = jsonObject.getJSONObject("__config__").getJSONArray("children"); + this.fieldsTableName(childArray, tableModels); + jsonObject.getJSONObject("__config__").put("children", childArray); + } else if (FormEnum.table.getMessage().equals(yunzhupaaskey)) { + JSONArray childrenList = new JSONArray(); + JSONArray children = jsonObject.getJSONObject("__config__").getJSONArray("children"); + String tableModel = ""; + for (int k = 0; k < children.size(); k++) { + JSONObject childrenObject = (JSONObject) children.get(k); + this.fieldsModel(childrenObject, tableModels); + if (StringUtil.isEmpty(tableModel)) { + tableModel = childrenObject.getJSONObject("__config__").getString("relationTable"); + } + childrenList.add(childrenObject); + } + jsonObject.getJSONObject("__config__").put("tableName", tableModel); + jsonObject.getJSONObject("__config__").put("children", childrenList); + } else { + this.fieldsModel(jsonObject, tableModels); + } + } + } + + /** + * 赋值table + * + * @param jsonObject + * @param tableModels + */ + private TableModel fieldsModel(JSONObject jsonObject, List tableModels) { + String vModel = jsonObject.getString("__vModel__"); + String relationField = StringUtil.isNotEmpty(jsonObject.getString("relationField")) + ? jsonObject.getString("relationField") + : ""; + String yunzhupaaskey = jsonObject.getJSONObject("__config__").getString("yunzhupaasKey"); + TableModel tableName = tableModels.stream().filter(t -> "1".equals(t.getTypeId())).findFirst().orElse(null); + if (tableName != null) { + jsonObject.getJSONObject("__config__").put("tableName", tableName.getTable()); + } + List childTableAll = tableModels.stream().filter(t -> "0".equals(t.getTypeId())) + .collect(Collectors.toList()); + TableModel childTableaa = childTableAll.stream() + .filter(t -> t.getFields().stream().filter(k -> k.getField().equals(vModel)).count() > 0).findFirst() + .orElse(null); + if (childTableaa != null) { + jsonObject.getJSONObject("__config__").put("relationTable", childTableaa.getTable()); + } + if (FormEnum.relationFormAttr.getMessage().equals(yunzhupaaskey) + || FormEnum.popupAttr.getMessage().equals(yunzhupaaskey)) { + if (StringUtil.isNotEmpty(relationField)) { + Boolean isSubTable = jsonObject.getJSONObject("__config__").getBooleanValue("isSubTable"); + String model = relationField.split("_yunzhupaasTable_")[0]; + jsonObject.put("relationField", + model + "_yunzhupaasTable_" + tableName.getTable() + (isSubTable ? "0" : "1")); + } + } + if (YunzhupaasKeyConsts.BILLRULE.equals(yunzhupaaskey)) { + if (StringUtil.isNotEmpty(relationField)) { + Boolean isSubTable = jsonObject.getJSONObject("__config__").getBooleanValue("isSubTable"); + String model = relationField.split("_yunzhupaasTable_")[0]; + jsonObject.put("relationField", + model + "_yunzhupaasTable_" + tableName.getTable() + (isSubTable ? "0" : "1")); + } + } + return childTableaa; + } + + /** + * 创建表 + * + * @return + */ + public List tableList(VisualTableModel visualTableModel) throws WorkFlowException { + JSONArray jsonArray = visualTableModel.getJsonArray(); + List formAllModel = visualTableModel.getFormAllModel(); + String table = visualTableModel.getTable(); + String linkId = visualTableModel.getLinkId(); + String fullName = visualTableModel.getFullName(); + int primaryKey = visualTableModel.getPrimaryKey(); + List tableModelList = new LinkedList<>(); + Map tableNameList = new HashMap<>(); + DbLinkEntity dbLink = serviceUtil.getDbLink(linkId); + String type = dbLink != null ? dbLink.getDbType() : dataSourceUtil.getDbType(); + boolean isUpperCase = (DbBase.DM.equals(type) || DbBase.ORACLE.equals(type)); + boolean isLowerCase = (DbBase.POSTGRE_SQL.equals(type) || DbBase.KINGBASE_ES.equals(type)); + table = tableName(table, isUpperCase, isLowerCase); + + String relationField = tableName(TableFeildsEnum.FID.getField(), isUpperCase, isLowerCase); + String tableField = tableName(TableFeildsEnum.FOREIGN.getField(), isUpperCase, isLowerCase); + try { + List fieldList = new ArrayList<>(); + Map> tableListAll = new HashMap<>(); + for (FormAllModel model : formAllModel) { + if (FormEnum.mast.getMessage().equals(model.getYunzhupaasKey())) { + FieLdsModel fieLdsModel = model.getFormColumnModel().getFieLdsModel(); + this.fieldList(fieLdsModel, table, fieldList); + } else if (FormEnum.table.getMessage().equals(model.getYunzhupaasKey())) { + String tableName = "ct" + RandomUtil.uuId(); + FormColumnTableModel fieLdsModel = model.getChildList(); + List tableList = new ArrayList<>(); + String tableModel = fieLdsModel.getTableModel(); + List fieldsList = fieLdsModel.getChildList().stream().map(t -> t.getFieLdsModel()) + .collect(Collectors.toList()); + for (FieLdsModel tableFieLdsModel : fieldsList) { + this.fieldList(tableFieLdsModel, tableName, tableList); + } + this.dbTableField(tableList, true, primaryKey, isLowerCase, tableField, relationField); + tableNameList.put(tableModel, tableName); + tableListAll.put(tableModel, tableList); + } + } + + this.dbTableField(fieldList, false, primaryKey, isLowerCase, tableField, relationField); + fieldList.add(ConcurrencyUtils.getDbFieldModel(TableFeildsEnum.TENANTID, isUpperCase, isLowerCase)); + fieldList.add(ConcurrencyUtils.getDbFieldModel(TableFeildsEnum.FLOWID, isUpperCase, isLowerCase)); + fieldList.add(ConcurrencyUtils.getDbFieldModel(TableFeildsEnum.VERSION, isUpperCase, isLowerCase)); + fieldList.add(ConcurrencyUtils.getDbFieldModel(TableFeildsEnum.FLOWTASKID, isUpperCase, isLowerCase)); + if (visualTableModel.getLogicalDelete()) {// 删除标志字段 + fieldList.add(ConcurrencyUtils.getDbFieldModel(TableFeildsEnum.DELETEMARK, isUpperCase, isLowerCase)); + fieldList.add(ConcurrencyUtils.getDbFieldModel(TableFeildsEnum.DELETETIME, isUpperCase, isLowerCase)); + fieldList.add(ConcurrencyUtils.getDbFieldModel(TableFeildsEnum.DELETEUSERID, isUpperCase, isLowerCase)); + } + List dbTableList = new ArrayList<>(); + // 创建子表 + for (String key : tableListAll.keySet()) { + String tableName = tableName(tableNameList.get(key), isUpperCase, isLowerCase); + List datableList = tableListAll.get(key); + datableList.add(ConcurrencyUtils.getDbFieldModel(TableFeildsEnum.TENANTID, isUpperCase, isLowerCase)); + if (visualTableModel.getLogicalDelete()) {// 删除标志字段 + datableList.add( + ConcurrencyUtils.getDbFieldModel(TableFeildsEnum.DELETEMARK, isUpperCase, isLowerCase)); + datableList.add( + ConcurrencyUtils.getDbFieldModel(TableFeildsEnum.DELETETIME, isUpperCase, isLowerCase)); + datableList.add( + ConcurrencyUtils.getDbFieldModel(TableFeildsEnum.DELETEUSERID, isUpperCase, isLowerCase)); + } + DbTableFieldModel dbTable = this.dbTable(linkId, tableName, datableList, true, fullName); + dbTableList.add(dbTable); + this.tableModel(tableModelList, datableList, tableName, table, true, tableField, relationField); + } + this.tableModel(tableModelList, fieldList, table, table, false, tableField, relationField); + DbTableFieldModel dbTable = this.dbTable(linkId, table, fieldList, false, fullName); + dbTableList.add(dbTable); + serviceUtil.createTable(dbTableList); + this.fieldsTableName(jsonArray, tableModelList); + } catch (Exception e) { + e.printStackTrace(); + log.error("表新增错误:{}", e.getMessage()); + throw new WorkFlowException(MsgCode.FM013.get(e.getMessage()), e); + } + return tableModelList; + } + + /** + * 表名 + * + * @param tableName + * @param isUpperCase + * @param isLowerCase + * @return + */ + private String tableName(String tableName, boolean isUpperCase, boolean isLowerCase) { + String resultName = isUpperCase ? tableName.toUpperCase() : isLowerCase ? tableName.toLowerCase() : tableName; + return resultName; + } + + /** + * 获取表单字段 + * + * @param fieLdsModel + * @param tableList + */ + private void fieldList(FieLdsModel fieLdsModel, String table, List tableList) { + String vmodel = fieLdsModel.getVModel(); + String lable = fieLdsModel.getConfig().getLabel(); + String yunzhupaaskey = fieLdsModel.getConfig().getYunzhupaasKey(); + fieLdsModel.getConfig().setTableName(table); + if (StringUtil.isNotEmpty(vmodel)) { + DbFieldModel fieldForm = new DbFieldModel(); + fieldForm.setNullSign(DbFieldConst.NULL); + fieldForm.setDataType(DtViewConst.VARCHAR); + fieldForm.setLength("255"); + fieldForm.setIsPrimaryKey(false); + if (StringUtil.isNotEmpty(fieLdsModel.getVModel())) { + if (YunzhupaasKeyConsts.getTextField().contains(yunzhupaaskey)) { + fieldForm.setDataType(DtViewConst.TEXT); + } + List date = new ArrayList() { + { + add(YunzhupaasKeyConsts.MODIFYTIME); + add(YunzhupaasKeyConsts.CREATETIME); + add(YunzhupaasKeyConsts.DATE); + } + }; + if (date.contains(yunzhupaaskey)) { + fieldForm.setDataType(DtViewConst.DATE_TIME); + } + if (YunzhupaasKeyConsts.NUM_INPUT.equals(yunzhupaaskey) + || YunzhupaasKeyConsts.CALCULATE.equals(yunzhupaaskey) + || YunzhupaasKeyConsts.SLIDER.equals(yunzhupaaskey)) { + fieldForm.setDataType(DtViewConst.DECIMAL); + String precision = "15"; + if (fieLdsModel.getPrecision() != null) { + precision = String.valueOf(fieLdsModel.getPrecision()); + } + fieldForm.setLength("38," + precision); + // mysql 最大长度65,Oracle和postgresql最大长度38,精度0-最大长度内取值,当前系统默认给15最大 + } + + if (YunzhupaasKeyConsts.RATE.equals(yunzhupaaskey)) { + fieldForm.setDataType(DtViewConst.DECIMAL); + fieldForm.setLength("38,1"); + } + + if (YunzhupaasKeyConsts.LOCATION.equals(yunzhupaaskey)) { + fieldForm.setLength("500"); + } + fieldForm.setField(vmodel); + fieldForm.setComment(lable); + tableList.add(fieldForm); + } + } + } + + /** + * 创建主外键字段 + * + * @param tableList + * @param isforeign + */ + private void dbTableField(List tableList, boolean isforeign, int primaryKey, + boolean isPostgreOrKingbase, String tableField, String relationField) { + // 是否自增 true自增 + boolean autoPrimaryKey = primaryKey == 2; + String dataType = autoPrimaryKey ? isPostgreOrKingbase ? DtViewConst.INT : DtViewConst.BIGINT + : DtViewConst.VARCHAR; + DbFieldModel tableKey = new DbFieldModel(); + tableKey.setNullSign(DbFieldConst.NOT_NULL); + tableKey.setDataType(dataType); + tableKey.setLength(TableFeildsEnum.FID.getLength()); + tableKey.setIsPrimaryKey(true); + tableKey.setField(relationField); + tableKey.setIsAutoIncrement(autoPrimaryKey); + tableKey.setComment(TableFeildsEnum.FID.getComment()); + tableList.add(tableKey); + if (isforeign) { + DbFieldModel tableForeignKey = new DbFieldModel(); + tableForeignKey.setNullSign(DbFieldConst.NULL); + tableForeignKey.setDataType(dataType); + tableForeignKey.setLength(TableFeildsEnum.FOREIGN.getLength()); + tableForeignKey.setIsPrimaryKey(false); + tableForeignKey.setField(tableField); + tableForeignKey.setComment(TableFeildsEnum.FOREIGN.getComment()); + tableList.add(tableForeignKey); + } + } + + /** + * 组装字段list + * + * @param tableModelList + * @param dbtable + * @param table + * @param mastTable + * @param isforeign + */ + private void tableModel(List tableModelList, List dbtable, String table, String mastTable, + boolean isforeign, String tableField, String relationField) { + TableModel tableModel = new TableModel(); + tableModel.setRelationField(isforeign ? relationField : ""); + tableModel.setRelationTable(isforeign ? mastTable : ""); + tableModel.setTable(table); + tableModel.setComment(isforeign ? "子表" : "主表"); + tableModel.setTableField(isforeign ? tableField : ""); + tableModel.setTypeId(isforeign ? "0" : "1"); + List voList = dbtable.stream().map(DbFieldVO::new).collect(Collectors.toList()); + tableModel.setFields(JsonUtil.getJsonToList(voList, TableFields.class)); + tableModelList.add(tableModel); + } + + /** + * 组装创表字段 + * + * @param linkId + * @param tableName + * @param tableFieldList + * @param isforeign + * @return + */ + private DbTableFieldModel dbTable(String linkId, String tableName, List tableFieldList, + boolean isforeign, String fullName) { + DbTableFieldModel dbTable = new DbTableFieldModel(); + dbTable.setDbLinkId(linkId); + dbTable.setTable(tableName); + dbTable.setDbFieldModelList(tableFieldList); + String s = isforeign ? "子表" : "主表"; + if (fullName.contains("&")) {// 自动生成表备注的时候带&符号创建不成功问题 + fullName = fullName.replace("&", " "); + } + dbTable.setComment(String.format("%s-%s", fullName, s)); + return dbTable; + } +} diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/VisualUtil.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/VisualUtil.java new file mode 100644 index 0000000..4c00193 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/VisualUtil.java @@ -0,0 +1,514 @@ +package com.yunzhupaas.base.util; + +import com.yunzhupaas.base.entity.ModuleDataAuthorizeSchemeEntity; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.model.ColumnDataModel; +import com.yunzhupaas.base.model.Template6.BtnData; +import com.yunzhupaas.base.model.Template6.ColumnListField; +import com.yunzhupaas.base.model.VisualDevPubModel; +import com.yunzhupaas.base.model.VisualWebTypeEnum; +import com.yunzhupaas.base.model.online.AuthFlieds; +import com.yunzhupaas.base.model.online.PerColModels; +import com.yunzhupaas.base.model.online.VisualMenuModel; +import com.yunzhupaas.base.util.common.DataControlUtils; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.constant.PermissionConst; +import com.yunzhupaas.emnus.SearchMethodEnum; +import com.yunzhupaas.model.OnlineDevData; +import com.yunzhupaas.model.visualJson.*; +import com.yunzhupaas.model.visualJson.analysis.FormAllModel; +import com.yunzhupaas.model.visualJson.analysis.FormColumnModel; +import com.yunzhupaas.model.visualJson.analysis.FormEnum; +import com.yunzhupaas.model.visualJson.analysis.RecursionForm; +import com.yunzhupaas.model.visualJson.config.ConfigModel; +import com.yunzhupaas.permission.model.authorize.AuthorizeConditionEnum; +import com.yunzhupaas.permission.model.authorize.ConditionModel; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import org.apache.commons.lang3.StringUtils; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/3/16 + */ +public class VisualUtil { + + public static List symbol = new ArrayList() { + { + add(AuthorizeConditionEnum.USER.getCondition()); + add(AuthorizeConditionEnum.ORGANIZE.getCondition()); + } + }; + + /** + * @param entity + * @return + * @Description 删除F_, 且全转小写 + */ + public static VisualdevEntity delfKey(VisualdevEntity entity) { + + List list = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + + for (TableModel tableModel : list) { + List fields = tableModel.getFields(); + if (StringUtil.isNotEmpty(tableModel.getTableField()) + && "f_".equalsIgnoreCase(tableModel.getTableField().substring(0, 2))) { + tableModel.setTableField(tableModel.getTableField().substring(2).toLowerCase()); + } + if (StringUtil.isNotEmpty(tableModel.getRelationField()) + && "f_".equalsIgnoreCase(tableModel.getRelationField().substring(0, 2))) { + tableModel.setRelationField(tableModel.getRelationField().substring(2).toLowerCase()); + } + for (TableFields tableFields : fields) { + String feild = tableFields.getField().toLowerCase(); + if ("f_".equals(feild.substring(0, 2))) { + tableFields.setField(feild.substring(2).toLowerCase()); + } else { + tableFields.setField(feild.toLowerCase()); + } + tableModel.setFields(fields); + } + } + entity.setVisualTables(JsonUtil.getObjectToString(list)); + + // 取出列表数据中的查询列表和数据列表 + Map columnDataMap = JsonUtil.stringToMap(entity.getColumnData()); + if (columnDataMap != null) { + for (Map.Entry entry : columnDataMap.entrySet()) { + if ("searchList".equals(entry.getKey())) { + List fieLdsModelList = JsonUtil.getJsonToList(entry.getValue(), FieLdsModel.class); + for (FieLdsModel fieLdsModel : fieLdsModelList) { + String vModel = fieLdsModel.getVModel().toLowerCase(); + String modelStr = fieLdsModel.getVModel(); + // 去除F_ + if (!StringUtil.isEmpty(vModel) && "f_".equals(vModel.substring(0, 2))) { + fieLdsModel.setVModel(modelStr.substring(2).toLowerCase()); + } else if (!StringUtil.isEmpty(vModel)) { + fieLdsModel.setVModel(modelStr.toLowerCase()); + } + + } + entry.setValue(fieLdsModelList); + } + if ("columnList".equals(entry.getKey())) { + List columnListFields = JsonUtil.getJsonToList(entry.getValue(), + ColumnListField.class); + for (ColumnListField columnListField : columnListFields) { + String prop = columnListField.getProp().toLowerCase(); + String modelStr = columnListField.getProp(); + // 去除F_ + if (!StringUtil.isEmpty(prop) && "f_".equals(prop.substring(0, 2))) { + columnListField.setProp(modelStr.substring(2).toLowerCase()); + } else if (!StringUtil.isEmpty(prop)) { + columnListField.setProp(modelStr.toLowerCase()); + } + } + entry.setValue(columnListFields); + } + } + } + + entity.setColumnData(JsonUtil.getObjectToString(columnDataMap)); + + Map formData = JsonUtil.stringToMap(entity.getFormData()); + + List modelList = JsonUtil.getJsonToList(formData.get("fields").toString(), FieLdsModel.class); + for (FieLdsModel fieLdsModel : modelList) { + // 去除F_ + if (!StringUtil.isEmpty(fieLdsModel.getVModel())) { + if ("f_".equals(fieLdsModel.getVModel().substring(0, 2).toLowerCase())) { + String modelStr = fieLdsModel.getVModel(); + fieLdsModel.setVModel(modelStr.substring(2).toLowerCase()); + } else { + String modelStr = fieLdsModel.getVModel(); + fieLdsModel.setVModel(modelStr.toLowerCase()); + } + } + + ConfigModel configModel = fieLdsModel.getConfig(); + // 子表 + if ("table".equals(configModel.getYunzhupaasKey())) { + List childlist = JsonUtil.getJsonToList(configModel.getChildren(), FieLdsModel.class); + for (FieLdsModel childmodel : childlist) { + // 前台界面的属性去掉前2个 + if (StringUtil.isNotEmpty(childmodel.getVModel())) { + if ("f_".equals(childmodel.getVModel().substring(0, 2).toLowerCase())) { + String vmodel = childmodel.getVModel().substring(2).toLowerCase(); + childmodel.setVModel(vmodel); + } else { + String vmodel = childmodel.getVModel().toLowerCase(); + childmodel.setVModel(vmodel); + } + } + } + fieLdsModel.getConfig().setChildren(childlist); + } + } + formData.put("fields", JsonUtil.getObjectToString(modelList)); + entity.setFormData(JsonUtil.getObjectToString(formData)); + + return entity; + } + + public static VisualMenuModel getVisual(VisualdevEntity visualdevEntity, VisualDevPubModel visualDevPubModel) { + VisualMenuModel visualMenuModel = new VisualMenuModel(); + visualMenuModel.setFullName(visualdevEntity.getFullName()); + visualMenuModel.setEncode(visualdevEntity.getEnCode()); + + if (!VisualWebTypeEnum.DATA_VIEW.getType().equals(visualdevEntity.getWebType())) {// 数据视图不解析formdata + FormDataModel formDataModel = JsonUtil.getJsonToBean(visualdevEntity.getFormData(), FormDataModel.class); + // 递归封装表单数据 + List formAllModel = new ArrayList<>(); + RecursionForm recursionForm = new RecursionForm(); + List tableModels = JsonUtil.getJsonToList(visualdevEntity.getVisualTables(), TableModel.class); + TableModel tableModel = tableModels.stream().filter(t -> t.getTypeId().equals("1")).findFirst() + .orElse(null); + recursionForm.setTableModelList(tableModels); + recursionForm.setList(JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class)); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + + // 主表数据 + List mast = formAllModel.stream() + .filter(t -> FormEnum.mast.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + // 列表子表数据 + List mastTable = formAllModel.stream() + .filter(t -> FormEnum.mastTable.getMessage().equals(t.getYunzhupaasKey())) + .collect(Collectors.toList()); + // 子表 + List childTable = formAllModel.stream() + .filter(t -> FormEnum.table.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + + String mainTableName = tableModel.getTable(); + List allColumnDataList = new ArrayList<>(); + mast.stream().forEach(formModel -> { + String vModel = formModel.getFormColumnModel().getFieLdsModel().getVModel(); + String tableName = formModel.getFormColumnModel().getFieLdsModel().getConfig().getTableName(); + if (StringUtil.isNotEmpty(vModel)) { + String label = formModel.getFormColumnModel().getFieLdsModel().getConfig().getLabel(); + AuthFlieds authFlieds = AuthFlieds.builder().encode(vModel).fullName(label).status(false).rule(0) + .bindTableName(tableName) + .yunzhupaasKey( + formModel.getFormColumnModel().getFieLdsModel().getConfig().getYunzhupaasKey()) + .build(); + allColumnDataList.add(authFlieds); + } + }); + mastTable.stream().forEach(formModel -> { + String vModel = formModel.getFormMastTableModel().getMastTable().getFieLdsModel().getVModel(); + String tableName = formModel.getFormMastTableModel().getMastTable().getFieLdsModel().getConfig() + .getTableName(); + if (StringUtil.isNotEmpty(vModel)) { + String label = formModel.getFormMastTableModel().getMastTable().getFieLdsModel().getConfig() + .getLabel(); + AuthFlieds authFlieds = AuthFlieds.builder().encode(vModel).fullName(label).status(false).rule(1) + .bindTableName(tableName) + .yunzhupaasKey(formModel.getFormMastTableModel().getMastTable().getFieLdsModel().getConfig() + .getYunzhupaasKey()) + .build(); + allColumnDataList.add(authFlieds); + } + }); + + childTable.stream().forEach(formModel -> { + String vModel = formModel.getChildList().getTableModel(); + String tableName = formModel.getChildList().getTableName(); + String label = formModel.getChildList().getLabel(); + if (StringUtil.isNotEmpty(vModel)) { + AuthFlieds authFlieds = AuthFlieds.builder().encode(vModel).fullName(label).status(false).rule(0) + .yunzhupaasKey(formModel.getYunzhupaasKey()).bindTableName(tableName).build(); + allColumnDataList.add(authFlieds); + } + List childList = formModel.getChildList().getChildList(); + for (FormColumnModel columnModel : childList) { + String childlabel = columnModel.getFieLdsModel().getConfig().getLabel(); + String childvModel = columnModel.getFieLdsModel().getVModel(); + if (StringUtil.isNotEmpty(childvModel)) { + AuthFlieds authFlieds = AuthFlieds.builder().encode(vModel + "-" + childvModel) + .fullName(label + "-" + childlabel).status(false).bindTableName(tableName).rule(2) + .childTableKey(vModel) + .yunzhupaasKey(columnModel.getFieLdsModel().getConfig().getYunzhupaasKey()).build(); + allColumnDataList.add(authFlieds); + } + } + }); + + // 分配对应权限 + if (1 == visualDevPubModel.getPc()) { + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(visualdevEntity.getColumnData(), + ColumnDataModel.class); + visualMenuModel.setPcPerCols(new PerColModels()); + if (Objects.nonNull(columnDataModel)) { + visualMenuModel + .setPcPerCols(fillPermission(columnDataModel, allColumnDataList, true, mainTableName)); + } + } + + if (1 == visualDevPubModel.getApp()) { + ColumnDataModel appColumnDataModel = JsonUtil.getJsonToBean(visualdevEntity.getAppColumnData(), + ColumnDataModel.class); + visualMenuModel.setAppPerCols(new PerColModels()); + if (Objects.nonNull(appColumnDataModel)) { + visualMenuModel + .setAppPerCols(fillPermission(appColumnDataModel, allColumnDataList, false, mainTableName)); + } + } + } + + visualMenuModel.setFullName(visualdevEntity.getFullName()); + visualMenuModel.setEncode(visualdevEntity.getEnCode()); + visualMenuModel.setId(visualdevEntity.getId()); + return visualMenuModel; + } + + /** + * 填充权限字段 + * + * @param columnDataModel + * @param allColumnDataList + * @param isPC + * @return + */ + private static PerColModels fillPermission(ColumnDataModel columnDataModel, List allColumnDataList, + Boolean isPC, String mainTable) { + PerColModels perColModel = new PerColModels(); + + List columnListFields = JsonUtil.getJsonToList(columnDataModel.getDefaultColumnList(), + ColumnListField.class); + // 副表正则 + String reg = "^[yunzhupaas_]\\S*_yunzhupaas\\S*"; + + // 按钮 + if (columnDataModel != null && columnDataModel.getUseBtnPermission()) { + perColModel.setButtonPermission(getAuthFiledList(isPC, columnDataModel)); + } + // 列表 + if (columnDataModel.getUseColumnPermission() && columnListFields != null) { + List colAuthFileds = columnListFields.stream().map(col -> { + boolean matches = col.getProp().toLowerCase().matches(reg); + String childTableKey = ""; + int rule = 0; + String tableName; + if (col.getConfig() == null) { + tableName = mainTable; + } else { + tableName = col.getConfig().getRelationTable() != null ? col.getConfig().getRelationTable() + : StringUtil.isNotEmpty(col.getConfig().getTableName()) ? col.getConfig().getTableName() + : mainTable; + } + if (matches) { + rule = 1; + } else { + rule = col.getProp().toLowerCase().contains(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX) ? 2 : 0; + childTableKey = col.getProp().toLowerCase().contains(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX) + ? col.getProp().substring(0, col.getProp().indexOf("-")) + : null; + } + return AuthFlieds.builder().encode(col.getProp()).fullName(col.getLabel()).status(col.getChecked()) + .rule(rule).bindTableName(tableName).childTableKey(childTableKey).build(); + }).collect(Collectors.toList()); + perColModel.setListPermission(colAuthFileds); + } + + // 表单 + if (columnDataModel.getUseFormPermission()) { + List formAuthList = allColumnDataList.stream().map(colFlied -> { + return AuthFlieds.builder().encode(colFlied.getEncode()).fullName(colFlied.getFullName()).status(true) + .rule(colFlied.getRule()).childTableKey(colFlied.getChildTableKey()) + .bindTableName(colFlied.getBindTableName()).build(); + }).collect(Collectors.toList()); + perColModel.setFormPermission(formAuthList); + } + + // 数据权限 + if (columnDataModel.getUseDataPermission() && columnListFields != null) { + List dataAuthFileds = new LinkedList<>(); + List mainColFieldList = columnListFields.stream() + .filter(col -> !col.getProp().toLowerCase().matches(reg) + && !col.getProp().toLowerCase().contains(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX)) + .collect(Collectors.toList()); + // 先取状态 + // mainColFieldList= + // mainColFieldList.stream().filter(field->field.getChecked()).collect(Collectors.toList()); + // 去重 + mainColFieldList = mainColFieldList.stream() + .filter(DataControlUtils.distinctByKey(data -> data.getYunzhupaasKey())) + .collect(Collectors.toList()); + for (ColumnListField field : mainColFieldList) { + String tableName = StringUtils.isNotEmpty(field.getConfig().getTableName()) + ? field.getConfig().getTableName() + : mainTable; + if (YunzhupaasKeyConsts.CREATEUSER.equals(field.getYunzhupaasKey())) { + AuthFlieds authFlied1 = AuthFlieds.builder().encode(field.getProp()).fullName(field.getLabel()) + .status(field.getChecked()).yunzhupaasKey(field.getYunzhupaasKey()).rule(0) + .bindTableName(tableName).AuthCondition(AuthorizeConditionEnum.USER.getCondition()) + .id(RandomUtil.uuId()).build(); + AuthFlieds authFlied2 = AuthFlieds.builder().encode(field.getProp()).fullName(field.getLabel()) + .status(field.getChecked()).yunzhupaasKey(field.getYunzhupaasKey()).rule(0) + .bindTableName(tableName).AuthCondition(AuthorizeConditionEnum.USERANDUNDER.getCondition()) + .id(RandomUtil.uuId()).build(); + dataAuthFileds.add(authFlied1); + dataAuthFileds.add(authFlied2); + } else if (YunzhupaasKeyConsts.CURRORGANIZE.equals(field.getYunzhupaasKey())) { + AuthFlieds authFlied1 = AuthFlieds.builder().encode(field.getProp()).fullName(field.getLabel()) + .status(field.getChecked()).bindTableName(tableName) + .yunzhupaasKey(field.getYunzhupaasKey()).rule(0) + .AuthCondition(AuthorizeConditionEnum.ORGANIZE.getCondition()) + .id(RandomUtil.uuId()).build(); + AuthFlieds authFlied2 = AuthFlieds.builder().encode(field.getProp()).fullName(field.getLabel()) + .status(field.getChecked()).bindTableName(tableName) + .yunzhupaasKey(field.getYunzhupaasKey()).rule(0) + .AuthCondition(AuthorizeConditionEnum.ORGANIZEANDUNDER.getCondition()) + .id(RandomUtil.uuId()).build(); + AuthFlieds authFlied3 = AuthFlieds.builder().encode(field.getProp()).fullName(field.getLabel()) + .status(field.getChecked()).bindTableName(tableName) + .yunzhupaasKey(field.getYunzhupaasKey()).rule(0) + .AuthCondition(AuthorizeConditionEnum.BRANCHMANAGEORG.getCondition()) + .id(RandomUtil.uuId()).build(); + // AuthFlieds authFlied4 = + // AuthFlieds.builder().encode(field.getProp()).fullName(field.getLabel()).status(field.getChecked()).bindTableName(tableName) + // .yunzhupaasKey(field.getYunzhupaasKey()).rule(0).AuthCondition(AuthorizeConditionEnum.BRANCHMANAGEORGANIZEUNDER.getCondition()) + // .id(RandomUtil.uuId()).build(); + dataAuthFileds.add(authFlied1); + dataAuthFileds.add(authFlied2); + dataAuthFileds.add(authFlied3); + // dataAuthFileds.add(authFlied4); + } + } + perColModel.setDataPermission(dataAuthFileds); + // 权限方案生成对象列表 + List schemeAuthList = new ArrayList<>(dataAuthFileds); + List dataPermissionScheme = new ArrayList<>(); + for (AuthFlieds authFlieds : schemeAuthList) { + String conditionSymbol = symbol.contains(authFlieds.getAuthCondition()) + ? SearchMethodEnum.Equal.getSymbol() + : SearchMethodEnum.Included.getSymbol(); + ModuleDataAuthorizeSchemeEntity schemeEntity = new ModuleDataAuthorizeSchemeEntity(); + schemeEntity.setFullName(getSchemeNameByCondition(authFlieds.getAuthCondition())); + schemeEntity.setEnCode(RandomUtil.uuId()); + SearchMethodEnum searchMethod = SearchMethodEnum.getSearchMethod(conditionSymbol); + String name = searchMethod != null ? searchMethod.getMessage() : ""; + String conditionText = "【{" + authFlieds.getFullName() + "} " + "{" + name + "}" + " {" + + authFlieds.getAuthCondition() + "}" + "】"; + List conditionModels = new ArrayList<>(); + ConditionModel conditionModel = new ConditionModel(); + conditionModel.setLogic(SearchMethodEnum.And.getSymbol()); + ConditionModel.ConditionItemModel conditionItemModel = conditionModel.new ConditionItemModel(); + conditionItemModel.setField(authFlieds.getEncode()); + conditionItemModel.setId(authFlieds.getId()); + conditionItemModel.setOp(conditionSymbol); + conditionItemModel.setFieldRule(String.valueOf(authFlieds.getRule())); + conditionItemModel.setValue(authFlieds.getAuthCondition()); + conditionItemModel.setConditionText(authFlieds.getAuthCondition()); + conditionItemModel.setType("Varchar"); + conditionItemModel.setBindTable(authFlieds.getBindTableName()); + List groups = new ArrayList<>(); + groups.add(conditionItemModel); + conditionModel.setGroups(groups); + conditionModels.add(conditionModel); + schemeEntity.setConditionJson(JsonUtil.getObjectToString(conditionModels)); + schemeEntity.setConditionText(conditionText); + schemeEntity.setEnabledMark(1); + schemeEntity + .setDescription(authFlieds.getRule() + "_" + authFlieds.getEncode() + "_" + conditionSymbol); + schemeEntity.setMatchLogic("and");// 添加方案时默认数据权限方案分组匹配逻辑为and + schemeEntity.setSortCode(-9527l); + dataPermissionScheme.add(schemeEntity); + } + // 数据权限方案 + perColModel.setDataPermissionScheme(dataPermissionScheme); + } + return perColModel; + } + + /** + * 获取系统按钮集合 + * + * @param isPC 是否pc端 + * @return + */ + private static List getAuthFiledList(Boolean isPC, ColumnDataModel columnDataModel) { + List btnList = new ArrayList<>(6); + String btnValues = AuthPerConfirm(columnDataModel); + btnList.add(AuthFlieds.builder().fullName("新增").encode(PermissionConst.BTN_ADD).status(false).build()); + btnList.add(AuthFlieds.builder().fullName("编辑").encode(PermissionConst.BTN_EDIT).status(false).build()); + btnList.add(AuthFlieds.builder().fullName("删除").encode(PermissionConst.BTN_REMOVE).status(false).build()); + btnList.add(AuthFlieds.builder().fullName("详情").encode(PermissionConst.BTN_DETAIL).status(false).build()); + // pc端 按钮 + if (isPC) { + btnList.add(AuthFlieds.builder().fullName("导入").encode(PermissionConst.BTN_UPLOAD).status(false).build()); + btnList.add(AuthFlieds.builder().fullName("导出").encode(PermissionConst.BTN_DOWNLOAD).status(false).build()); + btnList.add(AuthFlieds.builder().fullName("批量删除").encode(PermissionConst.BTN_BATCHREMOVE).status(false) + .build()); + btnList.add( + AuthFlieds.builder().fullName("批量打印").encode(PermissionConst.BTN_BATCHPRINT).status(false).build()); + } + btnList.stream().filter(btn -> btnValues.contains(btn.getEncode().replace("btn_", ""))) + .forEach(btn -> btn.setStatus(true)); + // 自定义按钮区 + List CustomBtnList = JsonUtil.getJsonToList(columnDataModel.getCustomBtnsList(), BtnData.class); + if (Objects.nonNull(CustomBtnList)) { + List CustomBtnAuth = CustomBtnList.stream().map( + cus -> AuthFlieds.builder().fullName(cus.getLabel()).encode(cus.getValue()).status(true).build()) + .collect(Collectors.toList()); + btnList.addAll(CustomBtnAuth); + } + return btnList; + } + + private static String AuthPerConfirm(ColumnDataModel columnDataModel) { + List btnDataList = new ArrayList<>(); + List BtnList = JsonUtil.getJsonToList(columnDataModel.getBtnsList(), BtnData.class); + List ColumnBtnList = JsonUtil.getJsonToList(columnDataModel.getColumnBtnsList(), BtnData.class); + + btnDataList.addAll(BtnList); + btnDataList.addAll(ColumnBtnList); + + String btnValue = btnDataList.stream().filter(t -> t.isShow()).map(btn -> btn.getValue()) + .collect(Collectors.joining(",")); + return btnValue; + } + + /** + * 检验是否可发布 + * + * @param entity + * @param Action + * @return + */ + public static String checkPublishVisualModel(VisualdevEntity entity, String Action) { + String errorMsg = null; + if (OnlineDevData.FORM_TYPE_DEV.equals(entity.getType())) { + // 数据视图没有formdata + if (!VisualWebTypeEnum.DATA_VIEW.getType().equals(entity.getWebType())) { + FormDataModel formDataModel = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + errorMsg = formDataModel == null ? MsgCode.VS401.get() + Action + "!" : null; + } + if (StringUtil.isNotEmpty(errorMsg)) { + return errorMsg; + } + if (VisualWebTypeEnum.FORM_LIST.getType().equals(entity.getWebType()) + || VisualWebTypeEnum.DATA_VIEW.getType().equals(entity.getWebType())) { + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(entity.getColumnData(), ColumnDataModel.class); + errorMsg = columnDataModel == null ? MsgCode.VS402.get() + Action + "!" : null; + } + } + + return errorMsg; + } + + private static String getSchemeNameByCondition(String condition) { + String name = "default"; + AuthorizeConditionEnum byMessage = AuthorizeConditionEnum.getByMessage(condition); + if (byMessage != null) { + name = byMessage.getMessage(); + } + return name; + } +} diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/VisualUtils.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/VisualUtils.java new file mode 100644 index 0000000..3ab7a9e --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/VisualUtils.java @@ -0,0 +1,649 @@ +package com.yunzhupaas.base.util; + +import cn.afterturn.easypoi.excel.ExcelExportUtil; +import cn.afterturn.easypoi.excel.entity.ExportParams; +import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; +import cn.hutool.core.util.StrUtil; +import cn.xuyanwu.spring.file.storage.FileInfo; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.model.ColumnDataModel; +import com.yunzhupaas.base.model.ExportSelectedModel; +import com.yunzhupaas.base.model.Template6.ColumnListField; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.database.model.dbtable.JdbcTableModel; +import com.yunzhupaas.database.model.interfaces.DbSourceOrDbLink; +import com.yunzhupaas.excel.ExcelExportStyler; +import com.yunzhupaas.excel.ExcelHelper; +import com.yunzhupaas.model.ExcelModel; +import com.yunzhupaas.model.visualJson.FieLdsModel; +import com.yunzhupaas.model.visualJson.FormDataModel; +import com.yunzhupaas.model.visualJson.config.HeaderModel; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.context.SpringContext; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import lombok.Cleanup; +import lombok.extern.slf4j.Slf4j; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.ss.util.CellRangeAddress; +import org.springframework.web.multipart.MultipartFile; + +import java.sql.SQLException; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 可视化工具类 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024年3月13日16:37:40 + */ +@Slf4j +public class VisualUtils { + + private static ConfigValueUtil configValueUtil = SpringContext.getBean(ConfigValueUtil.class); + + private static FileInfo getFileInfo(MultipartFile multipartFile, String fileName) { + String temporaryFilePath = configValueUtil.getTemporaryFilePath(); + FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName); + return fileInfo; + } + + /** + * 去除多级嵌套控件 + * + * @return + */ + public static List deleteMoreVmodel(FieLdsModel model) { + if ("".equals(model.getVModel()) && model.getConfig().getChildren() != null) { + List childModelList = JsonUtil.getJsonToList(model.getConfig().getChildren(), + FieLdsModel.class); + return childModelList; + } + return null; + } + + /** + * 返回主键名称 + * + * @param dbSourceOrDbLink + * @param mainTable + * @return + */ + public static String getpKey(DbSourceOrDbLink dbSourceOrDbLink, String mainTable) throws SQLException { + String pKeyName = "f_id"; + // catalog 数据库名 + String tmpKey = JdbcTableModel.getPrimaryExculde(dbSourceOrDbLink, mainTable, + configValueUtil.getMultiTenantColumn()); + if (StrUtil.isNotEmpty(tmpKey)) { + pKeyName = tmpKey; + } + return pKeyName; + } + + /** + * 导出在线开发的表格 + * + * @param visualdevEntity + * @param list + * @param keys + * @param sheetName + * @param excelModel + * @return + */ + public static DownloadVO createModelExcel(VisualdevEntity visualdevEntity, List> list, + Collection keys, String sheetName, String preName, ExcelModel excelModel) { + // 判断sheetName + boolean SheetTitleWithField = !sheetName.equals("表单信息"); + DownloadVO vo = DownloadVO.builder().build(); + try { + // 去除空数据 + List> dataList = new ArrayList<>(); + for (Map map : list) { + int i = 0; + for (String key : keys) { + // 子表 + if (key.toLowerCase().startsWith(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX)) { + String tableField = key.substring(0, key.indexOf("-")); + String field = key.substring(key.indexOf("-") + 1); + Object o = map.get(tableField); + if (o != null) { + List> childList = (List>) o; + for (Map childMap : childList) { + if (childMap.get(field) != null) { + i++; + } + } + } + } else { + Object o = map.get(key); + if (o != null) { + i++; + } + } + } + if (map.get("errorsInfo") != null) { + i++; + } + if (i > 0) { + dataList.add(map); + } + } + + FormDataModel formDataModel = JsonUtil.getJsonToBean(visualdevEntity.getFormData(), FormDataModel.class); + List fieLdsModelList = JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class); + // 递归 + List allFields = new ArrayList<>(); + recursionFields(fieLdsModelList, allFields); + + Map mainMap = new HashMap<>(); + allFields.stream().filter(a -> !a.getConfig().getYunzhupaasKey().equals(YunzhupaasKeyConsts.CHILD_TABLE)) + .forEach(m -> mainMap.put(m.getVModel(), m.getConfig().getLabel())); + List childFields = allFields.stream() + .filter(a -> a.getConfig().getYunzhupaasKey().equals(YunzhupaasKeyConsts.CHILD_TABLE)) + .collect(Collectors.toList()); + // 创建导出属性对象 + List allExportModelList = new ArrayList<>(); + for (String key : keys) { + ExportSelectedModel exportSelectedModel = new ExportSelectedModel(); + if (key.toLowerCase().startsWith(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX)) { + String tableField = key.substring(0, key.indexOf("-")); + String field = key.substring(key.indexOf("-") + 1); + FieLdsModel childTableModel = childFields.stream().filter(t -> tableField.equals(t.getVModel())) + .findFirst().orElse(null); + FieLdsModel fieldKey = childTableModel.getConfig().getChildren().stream() + .filter(t -> field.equals(t.getVModel())).findFirst().orElse(null); + String label = fieldKey.getConfig().getLabel(); + exportSelectedModel.setTableField(tableField); + exportSelectedModel.setField(field); + exportSelectedModel.setLabel(label); + ExportSelectedModel childModel = allExportModelList.stream() + .filter(t -> tableField.equals(t.getTableField())).findFirst().orElse(null); + List childList; + if (childModel != null) { + childList = childModel.getSelectedModelList(); + childList.add(exportSelectedModel); + } else { + childList = new ArrayList<>(); + childList.add(exportSelectedModel); + ExportSelectedModel newChild = new ExportSelectedModel(); + newChild.setTableField(childTableModel.getVModel()); + newChild.setSelectedModelList(childList); + newChild.setLabel(childTableModel.getConfig().getLabel()); + allExportModelList.add(newChild); + } + } else { + exportSelectedModel.setField(key); + exportSelectedModel.setLabel(mainMap.get(key)); + allExportModelList.add(exportSelectedModel); + } + } + + List entitys = new ArrayList<>(); + if (sheetName.equals("错误报告")) { + entitys.add(new ExcelExportEntity("异常原因", "errorsInfo", 30)); + } + for (ExportSelectedModel selectModel : allExportModelList) { + ExcelExportEntity exportEntity; + if (StringUtil.isNotEmpty(selectModel.getTableField())) { + exportEntity = new ExcelExportEntity( + selectModel.getLabel() + "(" + selectModel.getTableField() + ")", + selectModel.getTableField()); + // +"("+selectModel.getTableField()+"-"+m.getField()+")" + exportEntity.setList(selectModel.getSelectedModelList().stream().map(m -> new ExcelExportEntity(m + .getLabel() + + (SheetTitleWithField ? "(" + selectModel.getTableField() + "-" + m.getField() + ")" : ""), + m.getField())).collect(Collectors.toList())); + } else { + // +"("+selectModel.getField()+")" + exportEntity = new ExcelExportEntity( + selectModel.getLabel() + (SheetTitleWithField ? "(" + selectModel.getField() + ")" : ""), + selectModel.getField()); + } + entitys.add(exportEntity); + } + + // 原数据和表头用于合并处理 + List mergerEntitys = new ArrayList<>(entitys); + List> mergerList = new ArrayList<>(list); + + // 复杂表头-表头和数据处理 + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(visualdevEntity.getColumnData(), + ColumnDataModel.class); + List complexHeaderList = columnDataModel.getComplexHeaderList(); + if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { + // 数据导出判断是否是行内 + boolean isLineEidtExport = SheetTitleWithField ? Objects.equals(columnDataModel.getType(), 4) : false; + entitys = complexHeaderHandel(entitys, complexHeaderList, isLineEidtExport); + dataList = complexHeaderDataHandel(dataList, complexHeaderList, isLineEidtExport); + } + + ExportParams exportParams = new ExportParams(null, sheetName); + exportParams.setStyle(ExcelExportStyler.class); + if (sheetName.equals("错误报告")) { + exportParams.setFreezeCol(1); + } + @Cleanup + Workbook workbook = new HSSFWorkbook(); + if (entitys.size() > 0) { + if (dataList.size() == 0) { + dataList.add(new HashMap<>()); + } + workbook = ExcelExportUtil.exportExcel(exportParams, entitys, dataList); + mergerVertical(workbook, mergerEntitys, mergerList); + + ExcelHelper helper = new ExcelHelper(); + helper.init(workbook, exportParams, entitys, excelModel); + helper.doPreHandle(); + helper.doPostHandle(); + } + + String fileName = preName + ".xls"; + if (sheetName.equals("错误报告")) { + fileName = preName + "_" + DateUtil.dateNow("yyyyMMddHHmmss") + ".xls"; + } + MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName); + FileInfo fileInfo = getFileInfo(multipartFile, fileName); + vo.setName(fileInfo.getFilename()); + vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName); + } catch (Exception e) { + log.error("信息导出Excel错误:{}", e.getMessage()); + e.printStackTrace(); + } + return vo; + } + + public static void recursionFields(List fieLdsModelList, List allFields) { + for (FieLdsModel fieLdsModel : fieLdsModelList) { + if (YunzhupaasKeyConsts.CHILD_TABLE.equals(fieLdsModel.getConfig().getYunzhupaasKey())) { + allFields.add(fieLdsModel); + } else { + if (fieLdsModel.getConfig().getChildren() != null) { + recursionFields(fieLdsModel.getConfig().getChildren(), allFields); + } else { + if (StringUtil.isNotEmpty(fieLdsModel.getVModel())) { + allFields.add(fieLdsModel); + } + } + } + } + } + + /** + * 视图导出 + * + * @param columnData + * @param list + * @param keys + * @param sheetName + * @param excelModel + * @return + */ + public static DownloadVO createModelExcelApiData(String columnData, List> list, + Collection keys, String sheetName, String preName, ExcelModel excelModel) { + + // 判断sheetName + DownloadVO vo = DownloadVO.builder().build(); + try { + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class); + List columnListAll = JsonUtil.getJsonToList(columnDataModel.getColumnList(), + ColumnListField.class); + List entitys = new ArrayList<>(); + if (sheetName.equals("错误报告")) { + entitys.add(new ExcelExportEntity("异常原因", "errorsInfo")); + } + for (ColumnListField selectModel : columnListAll) { + if (keys.contains(selectModel.getProp())) { + ExcelExportEntity exportEntity = new ExcelExportEntity(selectModel.getLabel()); + exportEntity.setKey(selectModel.getProp()); + exportEntity.setName(selectModel.getLabel()); + entitys.add(exportEntity); + } + } + // 原数据和表头用于合并处理 + List mergerEntitys = new ArrayList<>(entitys); + List> mergerList = new ArrayList<>(list); + + // 复杂表头-表头和数据处理 + List complexHeaderList = columnDataModel.getComplexHeaderList(); + if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { + entitys = complexHeaderHandel(entitys, complexHeaderList, false); + list = complexHeaderDataHandel(list, complexHeaderList, false); + } + + ExportParams exportParams = new ExportParams(null, sheetName); + exportParams.setStyle(ExcelExportStyler.class); + if (sheetName.equals("错误报告")) { + exportParams.setFreezeCol(1); + } + exportParams.setStyle(ExcelExportStyler.class); + @Cleanup + Workbook workbook = new HSSFWorkbook(); + if (entitys.size() > 0) { + if (list.size() == 0) { + list.add(new HashMap<>()); + } + workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list); + + mergerVertical(workbook, mergerEntitys, mergerList); + + ExcelHelper helper = new ExcelHelper(); + helper.init(workbook, exportParams, entitys, excelModel); + helper.doPreHandle(); + helper.doPostHandle(); + } + String fileName = preName + DateUtil.dateNow("yyyyMMddHHmmss") + ".xls"; + MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName); + FileInfo fileInfo = getFileInfo(multipartFile, fileName); + vo.setName(fileInfo.getFilename()); + vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName); + } catch (Exception e) { + log.error("信息导出Excel错误:{}", e.getMessage()); + e.printStackTrace(); + } + return vo; + } + + public static String exampleExcelMessage(FieLdsModel model) { + String value = ""; + String yunzhupaasKey = model.getConfig().getYunzhupaasKey(); + boolean multiple = model.getMultiple(); + if (YunzhupaasKeyConsts.CHECKBOX.equals(yunzhupaasKey)) { + value = "选项一,选项二"; + } else if (YunzhupaasKeyConsts.SELECT.equals(yunzhupaasKey)) { + value = multiple ? "选项一,选项二" : ""; + } else if (YunzhupaasKeyConsts.CASCADER.equals(yunzhupaasKey)) { + value = multiple ? "选项1/选项1-1,选项2/选项2-1" : "选项1/选项1-1"; + } else if (YunzhupaasKeyConsts.DATE.equals(yunzhupaasKey)) { + value = model.getFormat(); + } else if (YunzhupaasKeyConsts.TIME.equals(yunzhupaasKey)) { + value = model.getFormat(); + } else if (YunzhupaasKeyConsts.COMSELECT.equals(yunzhupaasKey)) { + value = multiple ? "公司名称/部门名称,公司名称1/部门名称1" : "公司名称/部门名称"; + } else if (YunzhupaasKeyConsts.DEPSELECT.equals(yunzhupaasKey)) { + value = multiple ? "部门名称/部门编码,部门名称1/部门编码1" : "部门名称/部门编码"; + } else if (YunzhupaasKeyConsts.POSSELECT.equals(yunzhupaasKey)) { + value = multiple ? "岗位名称/岗位编码,岗位名称1/岗位编码1" : "岗位名称/岗位编码"; + } else if (YunzhupaasKeyConsts.USERSELECT.equals(yunzhupaasKey)) { + value = multiple ? "姓名/账号,姓名1/账号1" : "姓名/账号"; + } else if (YunzhupaasKeyConsts.ROLESELECT.equals(yunzhupaasKey)) { + value = multiple ? "角色名称/角色编码,角色名称1/角色编码1" : "角色名称/角色编码"; + } else if (YunzhupaasKeyConsts.GROUPSELECT.equals(yunzhupaasKey)) { + value = multiple ? "分组名称/分组编码,分组名称1/分组编码1" : "分组名称/分组编码"; + } else if (YunzhupaasKeyConsts.CUSTOMUSERSELECT.equals(yunzhupaasKey)) { + value = multiple ? "姓名/账号,公司名称,部门名称/部门编码,岗位名称/岗位编码,角色名称/角色编码,分组名称/分组编码" : "姓名/账号"; + } else if (YunzhupaasKeyConsts.TREESELECT.equals(yunzhupaasKey)) { + value = multiple ? "选项1,选项2" : "选项1"; + } else if (YunzhupaasKeyConsts.ADDRESS.equals(yunzhupaasKey)) { + // 0 省 1 省市 2 省市区 3 省市区 + Integer level = model.getLevel(); + if (level == 0) { + value = multiple ? "省,省1" : "省"; + } + if (level == 1) { + value = multiple ? "省/市,省1/市1" : "省/市"; + } + if (level == 2) { + value = multiple ? "省/市/区,省1/市1/区1" : "省/市/区"; + } + if (level == 3) { + value = multiple ? "省/市/区/街道,省1/市1/区1/街道1" : "省/市/区/街道"; + } + } else { + value = ""; + } + return value; + } + + /** + * 复杂表头表头处理--代码生成 + * + * @param dataList + * @param complexHeaderList + * @return + */ + public static List complexHeaderHandel(List dataList, + List complexHeaderList, boolean isLineEidtExport) { + List complexHeaderListStr = new ArrayList<>(); + complexHeaderList.forEach(item -> complexHeaderListStr.addAll(item.getChildColumns())); + Map complexMap1 = new HashMap<>(); + List dataListRes = new ArrayList<>(); + int n = 0;// 记录新数组下标用的,(dataListRes.add的地方就要n++) + for (ExcelExportEntity entity : dataList) { + String entityKey = isLineEidtExport ? entity.getKey().toString().split("_name")[0] + : entity.getKey().toString(); + if (complexHeaderListStr.contains(entityKey)) { + for (HeaderModel item : complexHeaderList) { + if (item.getChildColumns() != null && item.getChildColumns().size() > 0 + && item.getChildColumns().contains(entityKey)) { + ExcelExportEntity export; + if (complexMap1.get(item.getId()) == null) { + complexMap1.put(item.getId(), n); + export = new ExcelExportEntity(item.getFullName() + "(" + item.getId() + ")", item.getId()); + List list = new ArrayList<>(); + export.setList(list); + dataListRes.add(export); + n++; + } else { + export = dataListRes.get(complexMap1.get(item.getId())); + } + List list = export.getList() != null ? export.getList() : new ArrayList<>(); + list.add(entity); + export.setList(list); + dataListRes.set(complexMap1.get(item.getId()), export); + continue; + } + } + } else { + dataListRes.add(entity); + n++; + } + } + return dataListRes; + } + + /** + * 复杂表头数据处理 + * + * @param dataListRes + * @param complexHeaderList + * @return + */ + public static List> complexHeaderDataHandel(List> dataListRes, + List complexHeaderList, boolean isLineEidtExport) { + List complexHeaderListStr = new ArrayList<>(); + complexHeaderList.forEach(item -> complexHeaderListStr.addAll(item.getChildColumns())); + List complexMap1 = new ArrayList<>(); + List> dataList = new ArrayList<>(dataListRes); + for (Map map : dataList) { + Set keyset = new HashSet<>(map.keySet()); + for (String key : keyset) { + String keyName = isLineEidtExport ? key.split("_name")[0] : key; + if (complexHeaderListStr.contains(keyName)) { + for (HeaderModel item : complexHeaderList) { + if (item.getChildColumns().contains(keyName)) { + if (complexMap1.contains(item.getId())) { + List list1 = (List) map.get(item.getId()); + Map obj = list1 != null && list1.get(0) != null + ? (Map) list1.get(0) + : new HashMap<>(); + obj.put(key, map.get(key)); + map.put(item.getId(), new ArrayList() { + { + add(obj); + } + }); + } else { + complexMap1.add(item.getId()); + Map obj = new HashMap<>(); + obj.put(key, map.get(key)); + map.put(item.getId(), new ArrayList() { + { + add(obj); + } + }); + } + continue; + } + } + } + } + } + return dataList; + } + + /** + * 复杂表头表头处理--在线开发 + * + * @param dataList + * @param complexHeaderList + * @return + */ + public static List> complexHeaderHandelOnline(List> dataList, + List complexHeaderList) { + List complexHeaderListStr = new ArrayList<>(); + complexHeaderList.forEach(item -> complexHeaderListStr.addAll(item.getChildColumns())); + List uploadColumn = dataList.stream().map(t -> t.get("id")).collect(Collectors.toList()); + Map complexMap1 = new HashMap<>(); + List> dataListRes = new ArrayList<>(); + int n = 0;// 记录新数组下标用的,(dataListRes.add的地方就要n++) + for (HeaderModel item : complexHeaderList) { + if (item.getChildColumns().size() > 0) { + List complexHasColumn = item.getChildColumns().stream().filter(t -> uploadColumn.contains(t)) + .collect(Collectors.toList()); + // 判断复杂表头的字段是否有可导入字段--没有的话不生成复杂表头 + if (complexHasColumn.size() > 0) { + complexMap1.put(item.getId(), n); + Map map = new HashMap<>(); + map.put("id", item.getId()); + map.put("fullName", item.getFullName()); + map.put("yunzhupaasKey", "complexHeader"); + dataListRes.add(map); + n++; + } + } + } + for (Map entity : dataList) { + if (complexHeaderListStr.contains(entity.get("id"))) { + for (HeaderModel item : complexHeaderList) { + if (item.getChildColumns().contains(entity.get("id"))) { + Map map = dataListRes.get(complexMap1.get(item.getId())); + List> listmap = new ArrayList<>(); + if (map.get("children") == null) { + listmap.add(entity); + } else { + listmap = (List>) map.get("children"); + listmap.add(entity); + } + map.put("children", listmap); + dataListRes.set(complexMap1.get(item.getId()), map); + continue; + } + } + } else { + dataListRes.add(entity); + } + } + return dataListRes; + } + + /** + * 复杂表头数据导入处理--在线开发 + * + * @param dataList + * @param entity + * @return + */ + public static List> complexImportsDataOnline(List> dataList, + VisualdevEntity entity) { + List> listRes = new ArrayList<>(); + // 复杂表头-表头和数据处理 + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(entity.getColumnData(), ColumnDataModel.class); + List complexHeaderList = columnDataModel.getComplexHeaderList(); + if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { + for (Map mapone : dataList) { + for (HeaderModel item : complexHeaderList) { + Object remove = mapone.remove(item.getId()); + if (remove != null) { + List> listC = (List>) remove; + if (listC.size() > 0) { + mapone.putAll(listC.get(0)); + } + } + } + listRes.add(mapone); + } + } else { + listRes = dataList; + } + return listRes; + } + + /** + * 单元格垂直合并 + * + * @param workbook + * @param entityList + * @param dataList + */ + public static void mergerVertical(Workbook workbook, List entityList, + List> dataList) { + Sheet sheet = workbook.getSheetAt(0); + // 当前行 + int firstRow = 0; + int lastRow = 0; + for (Map obj : dataList) { + // 取出子表最大数量 + int size = 1; + // 判断有无子表 + List hasChildList = entityList.stream() + .filter(t -> t.getKey().toString().toLowerCase().contains(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX)) + .collect(Collectors.toList()); + if (hasChildList.size() > 0) { + for (ExcelExportEntity item : hasChildList) { + String key = String.valueOf(item.getKey()); + if (obj.get(key) instanceof List) { + List arr = (List) obj.get(key); + if (arr.size() > size) { + size = arr.size(); + } + } + } + } + // 标题行数量 + int headSize = 1; + List collect = entityList.stream().filter(t -> t.getList() != null) + .collect(Collectors.toList()); + if (collect.size() >= 1) { + headSize = 2; + } + + if (size == 0) { + firstRow = lastRow == 0 ? headSize : lastRow + 1; + lastRow = firstRow; + continue; + } else { + firstRow = lastRow == 0 ? headSize : lastRow + 1; + lastRow = firstRow + size - 1; + } + + int m = 0; + for (int n = 0; n < entityList.size(); n++) { + ExcelExportEntity export = entityList.get(n); + if (export.getList() == null && firstRow != lastRow) { + sheet.addMergedRegionUnsafe(new CellRangeAddress(firstRow, lastRow, m, m)); + } + // 计算子表字段个数 + if (export.getList() != null) { + m = m + export.getList().size(); + } else { + m++; + } + } + } + } +} diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/app/AppGenModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/app/AppGenModel.java new file mode 100644 index 0000000..c2b0d50 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/app/AppGenModel.java @@ -0,0 +1,91 @@ +package com.yunzhupaas.base.util.app; + +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.model.DownloadCodeForm; +import com.yunzhupaas.base.model.Template7.Template7Model; +import com.yunzhupaas.base.util.common.AliasModel; +import com.yunzhupaas.database.model.entity.DbLinkEntity; +import com.yunzhupaas.database.util.DataSourceUtil; +import com.yunzhupaas.model.visualJson.FormDataModel; +import lombok.Data; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/10/25 + */ +@Data +public class AppGenModel { + /** + * 文件夹名字 + */ + private String fileName; + /** + * 实体对象 + */ + private VisualdevEntity entity; + /** + * 下载对象 + */ + private DownloadCodeForm downloadCodeForm; + /** + * 表单对象 + */ + private FormDataModel model; + /** + * 模板文件 + */ + private String templatePath; + /** + * 主键 + */ + private String pKeyName; + /** + * 本地数据源 + */ + private DataSourceUtil dataSourceUtil; + /** + * 数据连接 + */ + private DbLinkEntity linkEntity; + /** + * 个人信息 + */ + private UserInfo userInfo; + /** + * 生成文件名字 + */ + private String className; + /** + * 数据库表 + */ + private String table; + /** + * 生成路径 + */ + private String serviceDirectory; + /** + * 模板路径 + */ + private String templateCodePath; + + private Boolean groupTable; + + private String type; + + /** + * 代码生成基础信息 + */ + private Template7Model template7Model; + + /** + * 命名规范映射 + */ + private Map tableAliseMap = new HashMap<>(); +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/app/AppGenUtil.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/app/AppGenUtil.java new file mode 100644 index 0000000..09523cd --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/app/AppGenUtil.java @@ -0,0 +1,724 @@ +package com.yunzhupaas.base.util.app; + +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.serializer.SerializerFeature; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.google.common.collect.ImmutableList; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.model.ColumnDataModel; +import com.yunzhupaas.base.model.DownloadCodeForm; +import com.yunzhupaas.base.model.Template6.BtnData; +import com.yunzhupaas.base.model.Template6.ColumnListField; +import com.yunzhupaas.base.model.Template7.Template7Model; +import com.yunzhupaas.base.model.VisualWebTypeEnum; +import com.yunzhupaas.base.util.common.AliasModel; +import com.yunzhupaas.base.util.common.DataControlUtils; +import com.yunzhupaas.base.util.common.GenerateCommon; +import com.yunzhupaas.base.util.common.SuperQueryUtil; +import com.yunzhupaas.database.model.superQuery.SuperJsonModel; +import com.yunzhupaas.i18n.util.I18nUtil; +import com.yunzhupaas.model.visualJson.*; +import com.yunzhupaas.model.visualJson.analysis.*; +import com.yunzhupaas.model.visualJson.config.ConfigModel; +import com.yunzhupaas.model.visualJson.config.TabConfigModel; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.XSSEscape; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import lombok.Cleanup; +import org.apache.commons.io.IOUtils; +import org.apache.velocity.Template; +import org.apache.velocity.VelocityContext; +import org.apache.velocity.app.Velocity; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.StringWriter; +import java.math.BigDecimal; +import java.util.*; +import java.util.stream.Collectors; + +public class AppGenUtil { + + // +-----------------------------界面2021.8.13------------------------------------------------------------ + + private List noShow = ImmutableList.of(YunzhupaasKeyConsts.CALCULATE); + + public void htmlTemplates(AppGenModel appGenModel) throws IOException { + Map map = new HashMap<>(16); + VisualdevEntity entity = appGenModel.getEntity(); + DownloadCodeForm downloadCodeForm = appGenModel.getDownloadCodeForm(); + List formAllModel = new ArrayList<>(); + boolean isView = isView(appGenModel); + Map tableNameAll = new HashMap<>(); + if (!isView) { + tableNameAll.putAll(this.forDataMode(appGenModel, formAllModel)); + } + + FormDataModel model = appGenModel.getModel(); + List mast = this.mast(formAllModel); + List> child = new ArrayList<>(); + this.childModel(formAllModel, child, tableNameAll); + this.mastTableModel(formAllModel, map, tableNameAll); + this.templateJson(formAllModel); + map.put("moduleId", appGenModel.getEntity().getId()); + map.put("children", child); + map.put("groupTable", appGenModel.getGroupTable()); + map.put("type", appGenModel.getType()); + map.put("fields", mast); + map.put("package", "com.yunzhupaas"); + map.put("isModel", "true"); + map.put("labelSuffix", model.getLabelSuffix()); + map.put("flowEnCode", entity.getEnCode()); + map.put("flowId", entity.getId()); + map.put("webType", entity.getWebType()); + map.put("isFlow", Objects.equals(downloadCodeForm.getEnableFlow(), 1)); + map.put("module", model.getAreasName()); + map.put("className", DataControlUtils.captureName(model.getClassName())); + this.formData(map, appGenModel, formAllModel); + + List getTemplate = this.getTemplate(appGenModel); + Template7Model templateModel = appGenModel.getTemplate7Model(); + String path = templateModel.getServiceDirectory() + appGenModel.getFileName(); + + boolean type = this.isForm(appGenModel); + this.htmlTemplates(map, getTemplate, path, DataControlUtils.initialLowercase(model.getClassName()), + isView ? false : !type); + + } + + private void templateJson(List formAllModel) { + for (FormAllModel model : formAllModel) { + if (FormEnum.mast.getMessage().equals(model.getYunzhupaasKey())) { + List templateJsonAll = new ArrayList<>(); + templateJsonAll.addAll(model.getFormColumnModel().getFieLdsModel().getConfig().getTemplateJson()); + List templateJsonModelList = JsonUtil.getJsonToList( + model.getFormColumnModel().getFieLdsModel().getTemplateJson(), TemplateJsonModel.class); + templateJsonAll.addAll(templateJsonModelList); + model.getFormColumnModel().getFieLdsModel().getConfig().setTemplateJson(templateJsonAll); + } + + if (FormEnum.mastTable.getMessage().equals(model.getYunzhupaasKey())) { + List templateJsonAll = new ArrayList<>(); + templateJsonAll.addAll( + model.getFormMastTableModel().getMastTable().getFieLdsModel().getConfig().getTemplateJson()); + List templateJsonModelList = JsonUtil.getJsonToList( + model.getFormMastTableModel().getMastTable().getFieLdsModel().getTemplateJson(), + TemplateJsonModel.class); + templateJsonAll.addAll(templateJsonModelList); + model.getFormMastTableModel().getMastTable().getFieLdsModel().getConfig() + .setTemplateJson(templateJsonAll); + } + } + } + + /** + * 获取模板 + * + * @param appGenModel + * @return + */ + private List getTemplate(AppGenModel appGenModel) { + String template = this.tempPath(appGenModel); + VisualdevEntity entity = appGenModel.getEntity(); + DownloadCodeForm downloadCodeForm = appGenModel.getDownloadCodeForm(); + boolean isView = isView(appGenModel); + List templates = new ArrayList<>(); + if (isView) { + templates.add(template + File.separator + "app" + File.separator + "index.vue.vm"); + } else { + boolean isType = !VisualWebTypeEnum.FORM.getType().equals(entity.getWebType()); + templates.add(template + File.separator + "app" + File.separator + "form.vue.vm"); + // 模板2 + if (VisualWebTypeEnum.FORM_LIST.getType().equals(entity.getWebType())) { + ColumnDataModel appColumnDataModel = JsonUtil.getJsonToBean(entity.getColumnData(), + ColumnDataModel.class); + List columnBtnDataList = JsonUtil.getJsonToList(appColumnDataModel.getColumnBtnsList(), + BtnData.class); + boolean detail = columnBtnDataList.stream().filter(t -> "detail".equals(t.getValue())).count() > 0; + if (downloadCodeForm.getEnableFlow() == 0 && isType && detail) { + templates.add(template + File.separator + "app" + File.separator + "detail.vue.vm"); + } + } + // 除了模板4,其他都有index的模板 + boolean index = !(VisualWebTypeEnum.FORM.getType().equals(entity.getWebType()) + && downloadCodeForm.getEnableFlow() != 1); + if (index) { + templates.add(template + File.separator + "app" + File.separator + "index.vue.vm"); + } + } + return templates; + } + + /** + * 获取文件名 + * + * @param path 路径 + * @param template 模板名称 + * @param className 文件名称 + * @return + */ + private String getFileNames(String path, String template, String className, boolean isIndex) { + path = XSSEscape.escapePath(path); + className = XSSEscape.escapePath(className); + String pathName = className.substring(0, 1).toLowerCase() + className.substring(1); + if (template.contains("index.vue.vm") || template.contains("detail.vue.vm")) { + String indexHtmlPath = path + File.separator + "html" + File.separator + "app"; + indexHtmlPath += isIndex ? File.separator + "index" + File.separator + pathName : File.separator + pathName; + File indexfile = new File(indexHtmlPath); + if (!indexfile.exists()) { + indexfile.mkdirs(); + } + className = template.contains("index.vue.vm") ? "index" : "detail"; + return indexHtmlPath + File.separator + className + ".vue"; + } + if (template.contains("form.vue.vm")) { + String formHtmlPath = path + File.separator + "html" + File.separator + "app"; + formHtmlPath += isIndex ? File.separator + "form" + File.separator + pathName : File.separator + pathName; + File formfile = new File(formHtmlPath); + if (!formfile.exists()) { + formfile.mkdirs(); + } + className = isIndex ? "index" : "form"; + return formHtmlPath + File.separator + className + ".vue"; + } + return null; + } + + /** + * 渲染html模板 + * + * @param path 路径 + * @param object 模板数据 + * @param path 模板路径 + */ + private void htmlTemplates(Object object, List templates, String path, String className, boolean isIndex) { + // 界面模板 + VelocityContext context = new VelocityContext(); + context.put("context", object); + for (String template : templates) { + // 渲染模板 + try { + @Cleanup + StringWriter sw = new StringWriter(); + Template tpl = Velocity.getTemplate(template, Constants.UTF_8); + tpl.merge(context, sw); + String fileNames = getFileNames(path, template, className, isIndex); + if (fileNames != null) { + File file = new File(fileNames); + if (!file.exists()) { + file.createNewFile(); + } + @Cleanup + FileOutputStream fos = new FileOutputStream(file); + IOUtils.write(sw.toString(), fos, Constants.UTF_8); + IOUtils.closeQuietly(sw); + IOUtils.closeQuietly(fos); + } + } catch (IOException e) { + e.printStackTrace(); + System.out.println("渲染模板失败,表名:" + e); + } + } + } + + /** + * 封装主表数据 + */ + private List mast(List formAllModel) { + List mast = formAllModel.stream() + .filter(t -> FormEnum.mast.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + // 主表赋值 + for (int i = 0; i < mast.size(); i++) { + FieLdsModel fieLdsModel = mast.get(i).getFormColumnModel().getFieLdsModel(); + this.model(fieLdsModel); + String vmodel = fieLdsModel.getVModel(); + if (StringUtil.isEmpty(vmodel)) { + mast.remove(i); + i--; + } + } + return mast; + } + + /** + * 封装mastTable数据 + */ + private Map> mastTableModel(List formAllModel, Map map, + Map tableNameAll) { + List mastTable = formAllModel.stream() + .filter(t -> FormEnum.mastTable.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + Map> mastListAll = mastTable.stream() + .collect(Collectors.groupingBy(e -> e.getFormMastTableModel().getTable())); + Map mastTableNameAll = new HashMap<>(); + Map> mastTableList = new HashMap<>(); + // 表单主表 + for (String mastkey : mastListAll.keySet()) { + List mastList = mastListAll.get(mastkey); + for (FormAllModel fieLdsList : mastList) { + FieLdsModel fieLdsModel = fieLdsList.getFormMastTableModel().getMastTable().getFieLdsModel(); + this.model(fieLdsModel); + } + mastListAll.put(mastkey, mastList); + String tableName = tableNameAll.get(mastkey); + String name = tableName.substring(0, 1).toUpperCase() + tableName.substring(1); + mastTableNameAll.put(mastkey, name); + mastTableList.put(tableName.toLowerCase(), mastList); + } + map.put("mastTableName", mastTableNameAll); + map.put("tableName", tableNameAll); + map.put("mastTable", mastTableList); + return mastListAll; + } + + /** + * 封装子表数据 + */ + private void childModel(List formAllModel, List> child, + Map tableNameAll) { + List table = formAllModel.stream() + .filter(t -> FormEnum.table.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + for (FormAllModel formModel : table) { + FormColumnTableModel childList = formModel.getChildList(); + List thousandsField = new ArrayList<>(); + List summaryField = new ArrayList<>(); + Map summaryFieldName = new HashMap<>(); + String tableName = childList.getTableName(); + List summaryFieldAll = JsonUtil.getJsonToList(childList.getSummaryField(), String.class); + String name = tableNameAll.get(tableName); + String className = name.substring(0, 1).toLowerCase() + name.substring(1); + List tableList = childList.getChildList(); + List childFieldList = new ArrayList<>(); + for (int i = 0; i < tableList.size(); i++) { + FormColumnModel columnModel = tableList.get(i); + FieLdsModel fieLdsModel = columnModel.getFieLdsModel(); + ConfigModel config = fieLdsModel.getConfig(); + model(fieLdsModel); + if (fieLdsModel.isThousands()) { + thousandsField.add(fieLdsModel.getVModel()); + } + if (!fieLdsModel.getConfig().getNoShow() && summaryFieldAll.contains(fieLdsModel.getVModel())) { + summaryField.add(fieLdsModel.getVModel()); + summaryFieldName.put(fieLdsModel.getVModel(), config.getLabel()); + if (StringUtil.isNotEmpty(config.getLabelI18nCode())) { + summaryFieldName.put(fieLdsModel.getVModel() + "_i18n", config.getLabelI18nCode()); + } + } + List templateJsonAll = new ArrayList<>(); + templateJsonAll.addAll(fieLdsModel.getConfig().getTemplateJson()); + List templateJsonModelList = JsonUtil.getJsonToList(fieLdsModel.getTemplateJson(), + TemplateJsonModel.class); + templateJsonAll.addAll(templateJsonModelList); + for (TemplateJsonModel templateJsonModel : templateJsonAll) { + if (StringUtil.isNotEmpty(templateJsonModel.getRelationField()) + && Objects.equals(templateJsonModel.getSourceType(), 1)) { + String[] fieldList = templateJsonModel.getRelationField().split("-"); + if (fieldList.length > 1) { + templateJsonModel.setRelationField(className + "-" + fieldList[1]); + } + } + } + for (TemplateJsonModel templateJsonModel : templateJsonModelList) { + if (StringUtil.isNotEmpty(templateJsonModel.getRelationField()) + && Objects.equals(templateJsonModel.getSourceType(), 1)) { + String[] fieldList = templateJsonModel.getRelationField().split("-"); + if (fieldList.length > 1) { + templateJsonModel.setRelationField(className + "List-" + fieldList[1]); + } + } + } + fieLdsModel.setTemplateJson(JsonUtil.getObjectToString(templateJsonModelList)); + fieLdsModel.getConfig().setTemplateJson(templateJsonAll); + // 修改弹窗的子表默认数据 + FieLdsModel childField = JsonUtil.getJsonToBean(fieLdsModel, FieLdsModel.class); + ConfigModel configModel = JsonUtil.getJsonToBean(config, ConfigModel.class); + Object defaultValue = configModel.getDefaultValue(); + if (defaultValue instanceof String) { + defaultValue = ""; + } else if (defaultValue instanceof BigDecimal) { + defaultValue = 0; + } else if (defaultValue instanceof List) { + defaultValue = new ArrayList<>(); + } + configModel.setDefaultValue(defaultValue); + childField.setConfig(configModel); + FormColumnModel childColumn = new FormColumnModel(); + childColumn.setFieLdsModel(childField); + childFieldList.add(childColumn); + } + childList.setThousandsField(thousandsField); + childList.setSummaryField(JsonUtil.getObjectToString(summaryField)); + childList.setSummaryFieldName(JsonUtil.getObjectToString(summaryFieldName)); + childList.setChildList(tableList); + childList.setChildFieldList(childFieldList); + Map childs = JsonUtil.entityToMap(childList); + childs.put("className", className); + childs.put("children", childList); + child.add(childs); + } + } + + /** + * 封装model数据 + */ + private void model(FieLdsModel fieLdsModel) { + ConfigModel configModel = fieLdsModel.getConfig(); + String yunzhupaasKey = configModel.getYunzhupaasKey(); + if (configModel.getDefaultValue() instanceof String) { + configModel.setValueType("String"); + } + if (configModel.getDefaultValue() == null) { + configModel.setValueType("undefined"); + if (YunzhupaasKeyConsts.ADDRESS.equals(yunzhupaasKey)) { + configModel.setDefaultValue(new ArrayList<>()); + configModel.setValueType(null); + } + } + if (YunzhupaasKeyConsts.SWITCH.equals(yunzhupaasKey)) { + if (configModel.getDefaultValue() instanceof Boolean) { + Boolean defaultValue = (Boolean) configModel.getDefaultValue(); + configModel.setDefaultValue(defaultValue ? 1 : 0); + } + } + if (YunzhupaasKeyConsts.TREESELECT.equals(yunzhupaasKey)) { + configModel.setValueType(fieLdsModel.getMultiple() ? configModel.getValueType() : "undefined"); + } + fieLdsModel.setConfig(configModel); + } + + /** + * 封装页面数据 + */ + private void formData(Map map, AppGenModel appGenModel, List formAllModel) + throws IOException { + FormDataModel model = appGenModel.getModel(); + // 界面 + map.put("formRef", model.getFormRef()); + map.put("hasConfirmAndAddBtn", false); + map.put("formModel", model.getFormModel()); + map.put("size", model.getSize()); + map.put("labelPosition", model.getLabelPosition()); + map.put("labelWidth", model.getLabelWidth()); + map.put("formRules", model.getFormRules()); + map.put("gutter", model.getGutter()); + map.put("disabled", model.getDisabled()); + map.put("span", model.getSpan()); + map.put("formBtns", model.getFormBtns()); + map.put("idGlobal", model.getIdGlobal()); + map.put("popupType", model.getPopupType()); + map.put("form", formAllModel); + + // 列表 + boolean isPage = this.isPage(appGenModel); + boolean type = this.isForm(appGenModel); + boolean isView = this.isView(appGenModel); + if (isPage) { + List columnList = new ArrayList<>(); + String page = "1"; + String sort = ""; + String defaultSidx = ""; + int pageSize = 20; + boolean thousands = false; + SuperJsonModel ruleQueryJson = new SuperJsonModel(); + VisualdevEntity entity = appGenModel.getEntity(); + if (StringUtil.isNotEmpty(entity.getColumnData())) { + String columnData = entity.getColumnData(); + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class); + page = columnDataModel.getHasPage() ? "0" : "1"; + sort = columnDataModel.getSort(); + pageSize = columnDataModel.getPageSize(); + defaultSidx = columnDataModel.getDefaultSidx(); + thousands = columnDataModel.isThousands(); + this.columnData(formAllModel, columnDataModel, map); + List btns = StringUtil.isNotEmpty(columnDataModel.getBtnsList()) + ? JsonUtil.getJsonToList(columnDataModel.getBtnsList(), BtnData.class) + : new ArrayList<>(); + btns.addAll(StringUtil.isNotEmpty(columnDataModel.getColumnBtnsList()) + ? JsonUtil.getJsonToList(columnDataModel.getColumnBtnsList(), BtnData.class) + : new ArrayList<>()); + columnList.addAll(btns.stream().filter(t -> t.isShow()).collect(Collectors.toList())); + ruleQueryJson = columnDataModel.getRuleListApp(); + Template7Model templateModel = appGenModel.getTemplate7Model(); + String path = templateModel.getServiceDirectory() + appGenModel.getFileName(); + boolean index = isView ? false : !type; + String columnPath = path + File.separator + "html" + File.separator + "app" + File.separator + + (index ? "index" + File.separator : "") + + DataControlUtils.initialLowercase(model.getClassName()) + File.separator; + File indexfile = new File(columnPath); + if (!indexfile.exists()) { + indexfile.mkdirs(); + } + String jsonString = JSONObject.toJSONString( + JsonUtil.getJsonToJsonArray(columnDataModel.getColumnList()), + SerializerFeature.WriteMapNullValue, SerializerFeature.PrettyFormat); + SuperQueryUtil.CreateJsFile(jsonString, columnPath + "columnList.js", "columnList"); + } + // 合计千分位 + List mast = formAllModel.stream() + .filter(t -> FormEnum.mast.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + List mastTable = formAllModel.stream() + .filter(t -> FormEnum.mastTable.getMessage().equals(t.getYunzhupaasKey())) + .collect(Collectors.toList()); + List thousandsField = GenerateCommon.getSummaryThousandList(mast, mastTable, 4); + map.put("page", page); + map.put("sort", sort); + map.put("defaultSidx", defaultSidx); + map.put("pageSize", pageSize); + map.put("columnBtnsList", columnList); + map.put("thousands", thousands); + map.put("thousandsField", JsonUtil.getObjectToString(thousandsField)); + map.put("ruleQueryJson", JSONObject.toJSONString(ruleQueryJson)); + } + // 共用 + String pKeyName = appGenModel.getPKeyName(); + map.put("pKeyName", pKeyName); + } + + /** + * 封装列表数据 + */ + private void columnData(List formAllModel, ColumnDataModel columnDataModel, Map map) { + List mast = formAllModel.stream() + .filter(t -> FormEnum.mast.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + List mastTable = formAllModel.stream() + .filter(t -> FormEnum.mastTable.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + // 显示数据 + List columnListAll = JsonUtil.getJsonToList(columnDataModel.getColumnList(), + ColumnListField.class); + Map> mastTableList = new HashMap<>(); + Map> childColumnList = new HashMap<>(); + List columnMastList = new ArrayList<>(); + for (ColumnListField columnList : columnListAll) { + String prop = columnList.getProp(); + FormAllModel model = mastTable.stream().filter(t -> t.getFormMastTableModel().getVModel().equals(prop)) + .findFirst().orElse(null); + if (model == null) { + String[] split = prop.split("-"); + if (split.length == 1) { + columnMastList.add(columnList); + } else { + List childList = childColumnList.get(split[0]) != null + ? childColumnList.get(split[0]) + : new ArrayList<>(); + String vModel = split[1]; + columnList.setVModel(vModel); + childList.add(columnList); + childColumnList.put(split[0], childList); + } + } else { + FormMastTableModel formMastTableModel = model.getFormMastTableModel(); + String tableName = formMastTableModel.getTable(); + List columnListList = mastTableList.get(tableName) != null ? mastTableList.get(tableName) + : new ArrayList<>(); + model.setFormMastTableModel(formMastTableModel); + columnListList.add(model); + mastTableList.put(tableName, columnListList); + } + } + map.put("childColumnList", childColumnList); + map.put("columnList", columnMastList); + map.put("columnMastList", mastTableList); + map.put("AppColumnList", columnDataModel.getColumnList()); + // 排序 + List sortListAll = columnListAll.stream().filter(t -> t.getSortable()) + .collect(Collectors.toList()); + List sortList = new ArrayList<>(); + for (int i = 0; i < sortListAll.size(); i++) { + ColumnListField field = sortListAll.get(i); + if (!noShow.contains(field.getYunzhupaasKey())) { + sortList.add(field); + } + } + map.put("sortList", sortList); + map.put("defaultSortConfig", columnDataModel.getDefaultSortConfig()); + // 搜索 + List searchVOListAll = JsonUtil.getJsonToList(columnDataModel.getSearchList(), FieLdsModel.class); + List searchVOList = new ArrayList<>(); + List mastTableSearch = new ArrayList<>(); + List childSearch = new ArrayList<>(); + List mastSearch = new ArrayList<>(); + List> searchAll = new LinkedList<>(); + List> tabSearch = new LinkedList<>(); + int isTab = 0; + for (FieLdsModel columnSearch : searchVOListAll) { + List templateJsonAll = new ArrayList<>(); + ConfigModel config = columnSearch.getConfig(); + templateJsonAll.addAll(config.getTemplateJson()); + List templateJsonModelList = JsonUtil.getJsonToList(columnSearch.getTemplateJson(), + TemplateJsonModel.class); + templateJsonAll.addAll(templateJsonModelList); + config.setTemplateJson(templateJsonAll); + Map column = new HashMap<>(); + String vmodel = columnSearch.getId(); + boolean isMast = mast.stream() + .filter(t -> vmodel.equals(t.getFormColumnModel().getFieLdsModel().getVModel())).count() > 0; + boolean isMastTable = mastTable.stream().filter(t -> vmodel.equals(t.getFormMastTableModel().getVModel())) + .count() > 0; + Object value = columnSearch.getValue(); + if (value instanceof String) { + config.setValueType("String"); + } + if (isMast) { + column.put("key", "mastSearch"); + mastSearch.add(columnSearch); + } else if (isMastTable) { + column.put("key", "mastTableSearch"); + mastTableSearch.add(columnSearch); + } else { + columnSearch.setVModel(vmodel.replaceAll("-", "_")); + column.put("key", "childSearch"); + childSearch.add(columnSearch); + } + column.put("html", columnSearch); + if (!noShow.contains(config.getYunzhupaasKey())) { + searchVOList.add(columnSearch); + searchAll.add(column); + } + } + TabConfigModel tabConfig = ObjectUtil.isNotEmpty(columnDataModel.getTabConfig()) + ? columnDataModel.getTabConfig() + : new TabConfigModel(); + String fieldsModel = tabConfig.getRelationField(); + if (tabConfig.isOn() && StringUtil.isNotEmpty(fieldsModel)) { + for (FormAllModel item : mast) { + FieLdsModel fieLdsModel = item.getFormColumnModel().getFieLdsModel(); + if (fieLdsModel.getVModel().equals(fieldsModel)) { + Map column = new HashMap<>(); + column.put("key", "tab"); + column.put("html", fieLdsModel); + tabSearch.add(column); + isTab++; + } + } + for (FormAllModel item : mastTable) { + FieLdsModel mastTableModel = item.getFormMastTableModel().getMastTable().getFieLdsModel(); + if (mastTableModel.getVModel().equals(fieldsModel)) { + Map column = new HashMap<>(); + column.put("key", "tab"); + column.put("html", mastTableModel); + tabSearch.add(column); + isTab++; + } + } + } + map.put("tabSearch", tabSearch); + map.put("hasAllTab", isTab > 0 ? tabConfig.isHasAllTab() : false); + map.put("isTab", isTab > 0); + + // 关键词搜索 + map.put("isKeyword", searchVOList.stream().filter(t -> t.getIsKeyword()).count() > 0); + map.put("searchAll", searchAll); + map.put("searchList", mastTableSearch); + map.put("childSearch", childSearch); + map.put("mastsearchList", mastSearch); + map.put("useDataPermission", + columnDataModel.getUseDataPermission() != null ? columnDataModel.getUseDataPermission() : false); + map.put("useBtnPermission", + columnDataModel.getUseBtnPermission() != null ? columnDataModel.getUseBtnPermission() : false); + map.put("useFormPermission", + columnDataModel.getUseFormPermission() != null ? columnDataModel.getUseFormPermission() : false); + map.put("useColumnPermission", + columnDataModel.getUseColumnPermission() != null ? columnDataModel.getUseColumnPermission() : false); + } + + // ----------------------------代码------------------------------------------------------- + + /** + * 封装数据 + * + * @param formAllModel + */ + private Map forDataMode(AppGenModel appGenModel, List formAllModel) { + VisualdevEntity entity = appGenModel.getEntity(); + // formTempJson + FormDataModel formData = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + List tableModelList = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + RecursionForm recursionForm = new RecursionForm(list, tableModelList); + List formAllModelAll = new ArrayList<>(); + FormCloumnUtil.recursionFormGen(recursionForm, formAllModelAll); + for (FormAllModel allModel : formAllModelAll) { + boolean add = true; + if (FormEnum.mast.getMessage().equals(allModel.getYunzhupaasKey())) { + FieLdsModel fieLdsModel = allModel.getFormColumnModel().getFieLdsModel(); + add = !noShow.contains(fieLdsModel.getConfig().getYunzhupaasKey()); + if (ObjectUtil.isNotEmpty(fieLdsModel.getConfig().getTipLabel())) { + String tipLabel = fieLdsModel.getConfig().getTipLabel().replaceAll("\n", " "); + fieLdsModel.getConfig().setTipLabel(tipLabel); + } + } + if (FormEnum.mastTable.getMessage().equals(allModel.getYunzhupaasKey())) { + FieLdsModel fieLdsModel = allModel.getFormMastTableModel().getMastTable().getFieLdsModel(); + add = !noShow.contains(fieLdsModel.getConfig().getYunzhupaasKey()); + if (ObjectUtil.isNotEmpty(fieLdsModel.getConfig().getTipLabel())) { + String tipLabel = fieLdsModel.getConfig().getTipLabel().replaceAll("\n", " "); + fieLdsModel.getConfig().setTipLabel(tipLabel); + } + } + if (FormEnum.table.getMessage().equals(allModel.getYunzhupaasKey())) { + List childListAll = allModel.getChildList().getChildList(); + List childList = new ArrayList<>(); + for (int k = 0; k < childListAll.size(); k++) { + FormColumnModel formColumnModel = childListAll.get(k); + FieLdsModel fieLdsModel = formColumnModel.getFieLdsModel(); + if (ObjectUtil.isNotEmpty(fieLdsModel.getConfig().getTipLabel())) { + String tipLabel = fieLdsModel.getConfig().getTipLabel().replaceAll("\n", " "); + fieLdsModel.getConfig().setTipLabel(tipLabel); + } + if (!noShow.contains(fieLdsModel.getConfig().getYunzhupaasKey())) { + childList.add(formColumnModel); + } + } + allModel.getChildList().setChildList(childList); + } + if (add) { + formAllModel.add(allModel); + } + } + Map tableNameAll = new HashMap<>(); + Map tableAliseMap = appGenModel.getTableAliseMap(); + for (String key : tableAliseMap.keySet()) { + tableNameAll.put(key, tableAliseMap.get(key).getAliasName()); + } + return tableNameAll; + } + + private String tempPath(AppGenModel appGenModel) { + String tempPath = appGenModel.getTemplatePath(); + VisualdevEntity entity = appGenModel.getEntity(); + DownloadCodeForm downloadCodeForm = appGenModel.getDownloadCodeForm(); + boolean isView = isView(appGenModel); + if (isView) { + tempPath = "TemplateCode2"; + } else { + if (VisualWebTypeEnum.FORM.getType().equals(entity.getWebType())) { + tempPath = downloadCodeForm.getEnableFlow() == 1 ? "TemplateCode5" : "TemplateCode4"; + } else if (VisualWebTypeEnum.FORM_LIST.getType().equals(entity.getWebType())) { + tempPath = downloadCodeForm.getEnableFlow() == 1 ? "TemplateCode3" : "TemplateCode2"; + } + } + return tempPath; + } + + private boolean isPage(AppGenModel appGenModel) { + VisualdevEntity entity = appGenModel.getEntity(); + boolean type = !VisualWebTypeEnum.FORM.getType().equals(entity.getWebType()); + return type; + } + + private boolean isForm(AppGenModel appGenModel) { + VisualdevEntity entity = appGenModel.getEntity(); + boolean type = (VisualWebTypeEnum.FORM_LIST.getType().equals(entity.getWebType()) + && appGenModel.getDownloadCodeForm().getEnableFlow() == 0); + return type; + } + + private boolean isView(AppGenModel appGenModel) { + VisualdevEntity entity = appGenModel.getEntity(); + boolean type = VisualWebTypeEnum.DATA_VIEW.getType().equals(entity.getWebType()); + return type; + } + +} diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/common/AliasModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/common/AliasModel.java new file mode 100644 index 0000000..32e86dc --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/common/AliasModel.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.base.util.common; + +import lombok.Data; + +import java.util.HashMap; +import java.util.Map; + +/** + * 别名对象 + * + * @author 云筑产品开发平台组 + * @version v5.0.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/4/16 11:21:03 + */ +@Data +public class AliasModel { + /** + * 表名 + */ + private String tableName; + /** + * 表别名 + */ + private String aliasName; + /** + * 字段别名map + */ + private Map fieldsMap = new HashMap<>(); +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/common/DataControlUtils.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/common/DataControlUtils.java new file mode 100644 index 0000000..06f2dae --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/common/DataControlUtils.java @@ -0,0 +1,167 @@ +package com.yunzhupaas.base.util.common; + +import com.alibaba.fastjson.JSONObject; +import com.google.common.base.Function; +import com.google.common.base.Predicate; +import com.yunzhupaas.model.visualJson.FieLdsModel; +import com.yunzhupaas.model.visualJson.analysis.FormAllModel; +import com.yunzhupaas.model.visualJson.analysis.FormColumnModel; +import com.yunzhupaas.model.visualJson.analysis.FormColumnTableModel; +import com.yunzhupaas.model.visualJson.analysis.FormEnum; +import com.yunzhupaas.model.visualJson.config.RuleConfig; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.ConcurrentHashMap; + +/** + * 代码生成器数据处理工具类 + * + * @author 云筑产品开发平台组 + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/8/26 + */ +public class DataControlUtils { + + /** + * 将字符串的首字母转大写 + * + * @param name 需要转换的字符串 + * @return + */ + public static String captureName(String name) { + char[] ch = name.toCharArray(); + for (int i = 0; i < ch.length; i++) { + if (i == 0) { + ch[0] = Character.toUpperCase(ch[0]); + } + } + StringBuffer a = new StringBuffer(); + a.append(ch); + return a.toString(); + + } + + public static String initialLowercase(String name) { + char[] ch = name.toCharArray(); + for (int i = 0; i < ch.length; i++) { + if (i == 0) { + ch[0] = Character.toLowerCase(ch[0]); + } + } + StringBuffer a = new StringBuffer(); + a.append(ch); + return a.toString(); + } + + public static String getPlaceholder(String yunzhupaasKey) { + String placeholderName = "请选择"; + switch (yunzhupaasKey) { + case YunzhupaasKeyConsts.BILLRULE: + case YunzhupaasKeyConsts.MODIFYUSER: + case YunzhupaasKeyConsts.CREATEUSER: + case YunzhupaasKeyConsts.COM_INPUT: + case YunzhupaasKeyConsts.TEXTAREA: + placeholderName = "请输入"; + break; + default: + break; + } + return placeholderName; + } + + /** + * 去重 + * + * @param keyExtractor + * @param + * @return + */ + public static Predicate distinctByKey(Function keyExtractor) { + Map seen = new ConcurrentHashMap<>(); + return t -> seen.putIfAbsent(keyExtractor.apply(t), Boolean.TRUE) == null; + } + + public static FieLdsModel setAbleIDs(FieLdsModel fieLdsModel) { + if (fieLdsModel.getAbleDepIds() != null) { + fieLdsModel.setAbleDepIds(JSONObject.toJSONString(fieLdsModel.getAbleDepIds())); + } + if (fieLdsModel.getAblePosIds() != null) { + fieLdsModel.setAblePosIds(JSONObject.toJSONString(fieLdsModel.getAblePosIds())); + } + if (fieLdsModel.getAbleUserIds() != null) { + fieLdsModel.setAbleUserIds(JSONObject.toJSONString(fieLdsModel.getAbleUserIds())); + } + if (fieLdsModel.getAbleRoleIds() != null) { + fieLdsModel.setAbleRoleIds(JSONObject.toJSONString(fieLdsModel.getAbleRoleIds())); + } + if (fieLdsModel.getAbleGroupIds() != null) { + fieLdsModel.setAbleGroupIds(JSONObject.toJSONString(fieLdsModel.getAbleGroupIds())); + } + if (fieLdsModel.getAbleIds() != null) { + fieLdsModel.setAbleIds(JSONObject.toJSONString(fieLdsModel.getAbleIds())); + } + //model字段验证reg转换 + if (fieLdsModel.getConfig().getRegList() != null) { + String o1 = JSONObject.toJSONString(JsonUtil.getObjectToString(fieLdsModel.getConfig().getRegList())); + fieLdsModel.getConfig().setReg(o1); + } + return fieLdsModel; + } + + /** + * 单据规则配置获取 + * @param formAllModel + * @return + */ + public static Map getBillRule(List formAllModel) { + Map billRuleMap = new HashMap<>(); + for (FormAllModel t : formAllModel) { + if (FormEnum.mast.getMessage().equals(t.getYunzhupaasKey())) { + FieLdsModel fieLdsModel = t.getFormColumnModel().getFieLdsModel(); + String ruleJson = getRuleJson(fieLdsModel); + if (StringUtil.isNotEmpty(ruleJson)) { + billRuleMap.put(fieLdsModel.getVModel(), ruleJson); + } + } + if (FormEnum.mastTable.getMessage().equals(t.getYunzhupaasKey())) { + FieLdsModel fieLdsModel = t.getFormMastTableModel().getMastTable().getFieLdsModel(); + String ruleJson = getRuleJson(fieLdsModel); + if (StringUtil.isNotEmpty(ruleJson)) { + billRuleMap.put(fieLdsModel.getVModel(), ruleJson); + } + } + if (FormEnum.table.getMessage().equals(t.getYunzhupaasKey())) { + FormColumnTableModel childModel = t.getChildList(); + String aliasLowName = childModel.getAliasLowName(); + List childList = childModel.getChildList(); + for (FormColumnModel child : childList) { + FieLdsModel fieLdsModel = child.getFieLdsModel(); + String ruleJson = getRuleJson(fieLdsModel); + if (StringUtil.isNotEmpty(ruleJson)) { + billRuleMap.put(aliasLowName + "_" + fieLdsModel.getVModel(), ruleJson); + } + } + } + } + return billRuleMap; + } + + private static String getRuleJson(FieLdsModel fieLdsModel) { + Integer ruleType = fieLdsModel.getConfig().getRuleType(); + if (Objects.equals(ruleType, 2)) { + RuleConfig ruleConfig = fieLdsModel.getConfig().getRuleConfig(); + if (ruleConfig != null) { + return JsonUtil.getObjectToString(JsonUtil.getObjectToString(ruleConfig)); + } + } + return null; + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/common/FunctionFormPublicUtil.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/common/FunctionFormPublicUtil.java new file mode 100644 index 0000000..d436a76 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/common/FunctionFormPublicUtil.java @@ -0,0 +1,148 @@ +package com.yunzhupaas.base.util.common; + +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.model.DownloadCodeForm; +import com.yunzhupaas.base.model.form.DraftJsonModel; +import com.yunzhupaas.base.model.form.FormDraftJsonModel; +import com.yunzhupaas.model.OnlineDevData; +import com.yunzhupaas.model.visualJson.FieLdsModel; +import com.yunzhupaas.model.visualJson.FormCloumnUtil; +import com.yunzhupaas.model.visualJson.FormDataModel; +import com.yunzhupaas.model.visualJson.TableModel; +import com.yunzhupaas.model.visualJson.analysis.*; +import com.yunzhupaas.model.visualJson.config.ConfigModel; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 功能流程公共工具 + * + * @author 云筑产品开发平台组 + * @version V5.2.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/8/25 + */ +public class FunctionFormPublicUtil { + + public static VisualdevEntity exportFlowFormJson(VisualdevEntity entity, GenerateParamModel generateParamModel) { + VisualdevEntity visualdevEntity = new VisualdevEntity(); + // visualdevEntity.setId(entity.getId()); + visualdevEntity.setEnCode(entity.getEnCode()); + visualdevEntity.setFullName(entity.getFullName()); + visualdevEntity.setType(OnlineDevData.FORM_TYPE_SYS); + visualdevEntity.setWebType(entity.getWebType()); + visualdevEntity.setCategory(entity.getCategory()); + visualdevEntity.setDescription(entity.getDescription()); + visualdevEntity.setSortCode(entity.getSortCode()); + visualdevEntity.setCreatorTime(entity.getCreatorTime()); + visualdevEntity.setCreatorUserId(entity.getCreatorUserId()); + visualdevEntity.setVisualTables(entity.getVisualTables()); + visualdevEntity.setDbLinkId(entity.getDbLinkId()); + // 填写默认url + DownloadCodeForm downloadCodeForm = generateParamModel.getDownloadCodeForm(); + String appUrl = "/pages/apply/" + generateParamModel.getClassName(); + visualdevEntity.setAppUrlAddress(appUrl); + String formFileName = "/Form.vue"; + String webUrl = "extend/" + generateParamModel.getClassName().toLowerCase() + formFileName; + visualdevEntity.setUrlAddress(webUrl); + String downloadClassName = generateParamModel.getClassName().substring(0, 1).toUpperCase() + + generateParamModel.getClassName().substring(1); + String interfaceUrl = "/api/" + downloadCodeForm.getModule() + "/" + downloadClassName; + visualdevEntity.setInterfaceUrl(interfaceUrl); + + List formAllModel = new ArrayList<>(); + forDataMode(entity, formAllModel); + List mastList = formAllModel.stream() + .filter(t -> FormEnum.mast.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + List tempJson = new ArrayList<>(); + for (FormAllModel mastModel : mastList) { + FieLdsModel fieLdsModel = mastModel.getFormColumnModel().getFieLdsModel(); + String model = fieLdsModel.getVModel(); + ConfigModel config = fieLdsModel.getConfig(); + if (StringUtil.isNotEmpty(model)) { + DraftJsonModel engineModel = new DraftJsonModel(); + String label = config.getLabel(); + engineModel.setFiledId(model); + engineModel.setFiledName(label); + engineModel.setRequired(config.isRequired()); + engineModel.setYunzhupaasKey(config.getYunzhupaasKey()); + engineModel.setMultiple(fieLdsModel.getMultiple()); + tempJson.add(engineModel); + } + } + List tableList = formAllModel.stream() + .filter(t -> FormEnum.table.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + Map tableListAll = generateParamModel.getTableAliseMap(); + for (FormAllModel model : tableList) { + String table = model.getChildList().getTableName(); + String name = DataControlUtils.initialLowercase(tableListAll.get(table).getAliasName()); + FormColumnTableModel childList = model.getChildList(); + String label = childList.getLabel(); + boolean required = childList.isRequired(); + DraftJsonModel engineModel = new DraftJsonModel(); + engineModel.setFiledId(name + "List"); + engineModel.setFiledName(label); + engineModel.setRequired(required); + tempJson.add(engineModel); + for (FormColumnModel columnModel : model.getChildList().getChildList()) { + String vModel = columnModel.getFieLdsModel().getVModel(); + String childLable = columnModel.getFieLdsModel().getConfig().getLabel(); + ConfigModel config = columnModel.getFieLdsModel().getConfig(); + if (StringUtil.isNotEmpty(vModel)) { + DraftJsonModel childModel = new DraftJsonModel(); + childModel.setFiledId(name + "List-" + vModel); + childModel.setFiledName(label + "-" + childLable); + childModel.setRequired(config.isRequired()); + childModel.setYunzhupaasKey(config.getYunzhupaasKey()); + childModel.setMultiple(columnModel.getFieLdsModel().getMultiple()); + tempJson.add(childModel); + } + } + } + List mastTableList = formAllModel.stream() + .filter(t -> FormEnum.mastTable.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + for (FormAllModel mastTableModel : mastTableList) { + FormMastTableModel formMastTableModel = mastTableModel.getFormMastTableModel(); + FieLdsModel fieLdsModel = formMastTableModel.getMastTable().getFieLdsModel(); + String model = formMastTableModel.getVModel(); + ConfigModel config = fieLdsModel.getConfig(); + if (StringUtil.isNotEmpty(model)) { + DraftJsonModel engineModel = new DraftJsonModel(); + String label = config.getLabel(); + engineModel.setFiledId(model); + engineModel.setFiledName(label); + engineModel.setRequired(config.isRequired()); + engineModel.setYunzhupaasKey(config.getYunzhupaasKey()); + engineModel.setMultiple(fieLdsModel.getMultiple()); + tempJson.add(engineModel); + } + } + FormDraftJsonModel draftJsonModel = new FormDraftJsonModel(); + String Tem = JsonUtil.getObjectToString(tempJson); + visualdevEntity.setFormData(Tem); + draftJsonModel.setDraftJson(Tem); + draftJsonModel.setTableJson(entity.getVisualTables()); + return visualdevEntity; + } + + /** + * 封装数据 + * + * @param entity + * @param formAllModel + */ + private static void forDataMode(VisualdevEntity entity, List formAllModel) { + // formTempJson + FormDataModel formData = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + List tableModelList = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + RecursionForm recursionForm = new RecursionForm(list, tableModelList); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + } + +} diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/common/GenerateCommon.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/common/GenerateCommon.java new file mode 100644 index 0000000..8e94673 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/common/GenerateCommon.java @@ -0,0 +1,687 @@ +package com.yunzhupaas.base.util.common; + +import cn.hutool.core.bean.BeanUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.serializer.SerializerFeature; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.core.toolkit.StringPool; +import com.baomidou.mybatisplus.generator.config.OutputFile; +import com.baomidou.mybatisplus.generator.config.builder.CustomFile; +import com.yunzhupaas.base.entity.SysConfigEntity; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.model.ColumnDataModel; +import com.yunzhupaas.base.model.DownloadCodeForm; +import com.yunzhupaas.base.model.Template6.ColumnListField; +import com.yunzhupaas.base.model.Template7.Template7Model; +import com.yunzhupaas.base.model.print.PrintOption; +import com.yunzhupaas.base.service.PrintDevService; +import com.yunzhupaas.constant.FileTypeConstant; +import com.yunzhupaas.constant.GenerateConstant; +import com.yunzhupaas.model.visualJson.FieLdsModel; +import com.yunzhupaas.model.visualJson.TemplateJsonModel; +import com.yunzhupaas.model.visualJson.analysis.FormAllModel; +import com.yunzhupaas.model.visualJson.analysis.FormColumnModel; +import com.yunzhupaas.model.visualJson.analysis.FormEnum; +import com.yunzhupaas.model.visualJson.config.HeaderModel; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.context.SpringContext; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import lombok.Cleanup; +import org.apache.commons.io.IOUtils; +import org.apache.velocity.Template; +import org.apache.velocity.VelocityContext; +import org.apache.velocity.app.Velocity; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.StringWriter; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/5/31 + */ +public class GenerateCommon { + public static final String IS_CLOUD = "single"; + + private static PrintDevService printDevService = SpringContext.getBean(PrintDevService.class); + + public static String getLocalBasePath() { + return FileUploadUtils.getLocalBasePath(); + } + + public static String getPath(String type) { + return FilePathUtil.getFilePath(type); + } + + public static List getList(List ids) { + return printDevService.getPrintTemplateOptions(ids); + } + + /** + * 获取代码生成基础信息 + * + * @return + */ + public static Template7Model getTemplate7Model(List list) { + String author = ""; + String copyright = ""; + String version = ""; + for (SysConfigEntity item : list) { + if ("companyName".equals(item.getFkey())) { + author = item.getValue(); + } + if ("copyright".equals(item.getFkey())) { + copyright = item.getValue(); + } + if ("sysVersion".equals(item.getFkey())) { + version = item.getValue(); + } + } + Template7Model temModel = new Template7Model(); + temModel.setServiceDirectory( + GenerateCommon.getLocalBasePath() + GenerateCommon.getPath(FileTypeConstant.CODETEMP)); + temModel.setCreateDate(DateUtil.daFormat(new Date())); + temModel.setCreateUser(StringUtil.isNotEmpty(author) ? author : GenerateConstant.AUTHOR); + temModel.setCopyright(StringUtil.isNotEmpty(copyright) ? copyright : GenerateConstant.COPYRIGHT); + temModel.setVersion(StringUtil.isNotEmpty(version) ? version : GenerateConstant.VERSION); + temModel.setDescription(GenerateConstant.DESCRIPTION); + return temModel; + } + + /** + * 获取自定义文件(模板和生成路径) + * + * @param generateParamModel + * @return + */ + public static List getCustomFileList(GenerateParamModel generateParamModel) { + Template7Model template7Model = generateParamModel.getTemplate7Model(); + String path = template7Model.getServiceDirectory() + generateParamModel.getFileName() + File.separator; + DownloadCodeForm downloadCodeForm = generateParamModel.getDownloadCodeForm(); + ArrayList custFileList = new ArrayList<>(); + if (generateParamModel.isMainTable()) { + custFileList.add(new CustomFile.Builder().templatePath("java/Controller.java.vm") + .formatNameFunction(tableInfo -> tableInfo.getControllerName()) + .fileName(StringPool.DOT_JAVA) + .filePath(getCustomFilePath(path, OutputFile.controller.name(), downloadCodeForm)) + .enableFileOverride().build()); + } + custFileList.add(new CustomFile.Builder().templatePath("java/Entity.java.vm") + .formatNameFunction(tableInfo -> tableInfo.getEntityName()) + .fileName(StringPool.DOT_JAVA) + .filePath(getCustomFilePath(path, OutputFile.entity.name(), downloadCodeForm)).enableFileOverride() + .build()); + custFileList.add(new CustomFile.Builder().templatePath("java/Mapper.java.vm") + .formatNameFunction(tableInfo -> tableInfo.getMapperName()) + .fileName(StringPool.DOT_JAVA) + .filePath(getCustomFilePath(path, OutputFile.mapper.name(), downloadCodeForm)).enableFileOverride() + .build()); + custFileList.add(new CustomFile.Builder().templatePath("java/Service.java.vm") + .formatNameFunction(tableInfo -> tableInfo.getServiceName()) + .fileName(StringPool.DOT_JAVA) + .filePath(getCustomFilePath(path, OutputFile.service.name(), downloadCodeForm)).enableFileOverride() + .build()); + custFileList.add(new CustomFile.Builder().templatePath("java/ServiceImpl.java.vm") + .formatNameFunction(tableInfo -> tableInfo.getServiceImplName()) + .fileName(StringPool.DOT_JAVA) + .filePath(getCustomFilePath(path, OutputFile.serviceImpl.name(), downloadCodeForm)).enableFileOverride() + .build()); + custFileList.add(new CustomFile.Builder().templatePath("java/Mapper.xml.vm") + .formatNameFunction(tableInfo -> tableInfo.getXmlName()) + .fileName(StringPool.DOT_XML).filePath(getCustomFilePath(path, OutputFile.xml.name(), downloadCodeForm)) + .enableFileOverride().build()); + return custFileList; + } + + /** + * 根据模板名称获取生成文件路径 + * + * @param path + * @param codeName + * @param downloadCodeForm + * @return + */ + public static String getCustomFilePath(String path, String codeName, DownloadCodeForm downloadCodeForm) { + String eachName = ""; + String frontName = ""; + String modulName = downloadCodeForm.getModule(); + String framePath = downloadCodeForm.getModulePackageName(); + switch (codeName) { + case "controller": + framePath = getCloudPath("-controller", downloadCodeForm); + break; + case "entity": + framePath = getCloudPath("-entity", downloadCodeForm); + break; + case "mapper": + framePath = getCloudPath("-biz", downloadCodeForm); + break; + case "xml": + if ("cloud".equals(GenerateCommon.IS_CLOUD)) { + String fileFront = "yunzhupaas-" + modulName + File.separator + "yunzhupaas-" + modulName + "-biz" + + File.separator; + if ("form".equals(modulName)) { + fileFront = "yunzhupaas-workflow" + File.separator + "yunzhupaas-workflow-form" + File.separator + + "yunzhupaas-workflow-form-biz" + File.separator; + } + framePath = fileFront + "src" + File.separator + "main" + File.separator + "resources"; + return path + File.separator + "java" + File.separator + framePath + File.separator + "mapper" + + File.separator; + } + return path + File.separator + "resources" + File.separator + "mapper" + + File.separator; + case "service": + framePath = getCloudPath("-biz", downloadCodeForm); + break; + case "serviceImpl": + codeName = "impl"; + frontName = "service" + File.separator; + framePath = getCloudPath("-biz", downloadCodeForm); + default: + break; + } + return path + File.separator + "java" + File.separator + framePath + File.separator + frontName + codeName + + File.separator; + } + + /** + * 获取微服务框架路径 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2023/3/22 + */ + public static String getCloudPath(String houzui, DownloadCodeForm downloadCodeForm) { + // 发起表单 + if ("form".equals(downloadCodeForm.getModule())) { + return "yunzhupaas-workflow" + File.separator + "yunzhupaas-workflow-form" + File.separator + + "yunzhupaas-workflow-" + downloadCodeForm.getModule() + houzui + File.separator + + "src" + File.separator + "main" + File.separator + "java" + File.separator + "com" + + File.separator + "yunzhupaas" + File.separator + "form"; + } + String framePath = "yunzhupaas-" + downloadCodeForm.getModule() + File.separator + "yunzhupaas-" + + downloadCodeForm.getModule() + houzui + File.separator + + "src" + File.separator + "main" + File.separator + "java" + File.separator + + downloadCodeForm.getModulePackageName(); + return framePath; + } + + /** + * 获取导出字段 + * + * @param columnList + * @return + */ + public static List getExpotColumn(List columnList) { + List listOptions = new ArrayList<>(); + columnList.forEach(item -> { + ColumnListField columnListField = new ColumnListField(); + BeanUtil.copyProperties(item, columnListField); + if (item.getVModel().toLowerCase().startsWith(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX)) { + columnListField.setTableType(2); + columnListField.setVModel(item.getVModel().split("-")[1]); + } else if (item.getVModel().toLowerCase().contains("_yunzhupaas_")) { + columnListField.setTableType(1); + columnListField.setVModel(item.getVModel().split("_yunzhupaas_")[1]); + } else { + columnListField.setTableType(0); + } + if ("static".equals(item.getConfig().getDataType())) { + columnListField.setOptions(JsonUtil.getObjectToString(item.getOptions())); + if (item.getYunzhupaasKey().equals(YunzhupaasKeyConsts.CHECKBOX)) { + columnListField.setMultiple(true); + } + } + listOptions.add(columnListField); + }); + return listOptions; + } + + /** + * 合计千分位字段列表 + * + * @param mast 主表字段 + * @param mastTable 副表字段 + * @param type 列表类型 4-行内编辑 + * @return + */ + public static List getSummaryThousandList(List mast, List mastTable, + Integer type) { + String suffix = "_name"; + if (type == 4) { + suffix = ""; + } + List thousandsField = new ArrayList<>(); + for (FormAllModel f : mast) { + FieLdsModel fm = f.getFormColumnModel().getFieLdsModel(); + if (fm.isThousands()) { + thousandsField.add(fm.getVModel() + suffix); + } + } + for (FormAllModel f : mastTable) { + FieLdsModel fm = f.getFormMastTableModel().getMastTable().getFieLdsModel(); + if (fm.isThousands()) { + thousandsField.add(f.getFormMastTableModel().getTable() + "." + fm.getVModel() + suffix); + } + } + return thousandsField; + } + + /** + * 复杂表头 对象生成。 + * + * @param path + * @param generateParamModel + * @param entity + * @param downloadCodeForm + * @param objectAll + */ + public static void createComplexHeaderExcelVo(String path, GenerateParamModel generateParamModel, + VisualdevEntity entity, + DownloadCodeForm downloadCodeForm, Map objectAll) { + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(entity.getColumnData(), ColumnDataModel.class); + JsonUtil.getListToJsonArray(columnDataModel.getComplexHeaderList()); + List complexHeaderList = columnDataModel.getComplexHeaderList(); + String templateName = File.separator + "java" + File.separator + "ExcelVO.java.vm"; + VelocityContext context = new VelocityContext(); + Map object = new HashMap<>(); + object.put("genInfo", generateParamModel.getTemplate7Model()); + object.put("package", generateParamModel.getDownloadCodeForm().getModulePackageName()); + object.put("module", downloadCodeForm.getModule()); + object.put("isMain", true); + object.put("isComplexVo", true); + object.put("importFields", objectAll.get("importFields")); + for (HeaderModel item : complexHeaderList) { + if (item.getChildColumns().size() > 0) { + String className = "Complex" + item.getId(); + object.put("complexList", JsonUtil.getListToJsonArray(item.getChildColumns())); + object.put("className", className); + context.put("context", object); + String fileNames = GenerateCommon.getFileName(path, templateName, className, downloadCodeForm); + GenerateCommon.velocityWriterFile(context, templateName, fileNames); + } + } + } + + /** + * 渲染html模板 + * + * @param path 路径 + * @param object 模板数据 + * @param templatePath 模板路径 + */ + public static void htmlTemplates(String path, Map object, String templatePath, int type, + boolean hasImport, + DownloadCodeForm downloadCodeForm, GenerateInterface codeUtil) throws Exception { + // 获取模板列表 + List templates = codeUtil.getTemplates(templatePath, type, hasImport); + // 界面模板 + VelocityContext context = new VelocityContext(); + context.put("context", object); + for (String template : templates) { + String className = object.get("className").toString(); + String fileNames = GenerateCommon.getFileName(path, template, className, downloadCodeForm); + GenerateCommon.velocityWriterFile(context, template, fileNames); + } + } + + /** + * 根据模板 获取文件名 + * + * @param path 路径 + * @param template 模板名称 + * @param className 文件名称 + * @return + */ + public static String getFileName(String path, String template, String className, + DownloadCodeForm downloadCodeForm) { + String framePath = GenerateCommon.getCloudPath("-entity", downloadCodeForm); + String modelfolder = downloadCodeForm.getMainClassName(); + String modelPath = XSSEscape + .escapePath(path + File.separator + "java" + File.separator + framePath + File.separator + "model" + + File.separator + modelfolder.toLowerCase()); + String htmlPath = XSSEscape.escapePath( + path + File.separator + "html" + File.separator + "web" + File.separator + modelfolder.toLowerCase()); + File htmlfile = new File(htmlPath); + File modelfile = new File(modelPath); + if (!htmlfile.exists()) { + htmlfile.mkdirs(); + } + if (!modelfile.exists()) { + modelfile.mkdirs(); + } + + if (template.contains("extraForm.vue.vm") || template.contains("ExtraForm.vue.vm")) { + return htmlPath + File.separator + "ExtraForm.vue"; + } + if (template.contains("Form.vue.vm")) { + return htmlPath + File.separator + "Form.vue"; + } + if (template.contains("FormPopup.vue.vm")) { + return htmlPath + File.separator + "FormPopup.vue"; + } + if (template.contains("index.vue.vm")) { + return htmlPath + File.separator + "index.vue"; + } + if (template.contains("indexEdit.vue.vm")) { + return htmlPath + File.separator + "index.vue"; + } + if (template.contains("Detail.vue.vm")) { + return htmlPath + File.separator + "Detail.vue"; + } + if (template.contains("api.ts.vm")) { + // vue3生成ts文件夹 + String htmlTSPath = XSSEscape + .escapePath(path + File.separator + "html" + File.separator + "web" + File.separator + + modelfolder.toLowerCase() + File.separator + "helper"); + File htmlJSfile = new File(htmlTSPath); + if (!htmlJSfile.exists() && !"form".equals(downloadCodeForm.getModule())) { + htmlJSfile.mkdirs(); + } + + return htmlPath + File.separator + "helper" + File.separator + "api.ts"; + } + // 后端代码 + if (template.contains("InfoVO.java.vm")) { + return modelPath + File.separator + className + "InfoVO.java"; + } + if (template.contains("Form.java.vm")) { + return modelPath + File.separator + className + "Form.java"; + } + if (template.contains("ListVO.java.vm")) { + return modelPath + File.separator + className + "ListVO.java"; + } + if (template.contains("GroupVO.java.vm")) { + return modelPath + File.separator + className + "GroupVO.java"; + } + if (template.contains("Pagination.java.vm")) { + return modelPath + File.separator + className + "Pagination.java"; + } + if (template.contains("ExcelVO.java.vm")) { + return modelPath + File.separator + className + "ExcelVO.java"; + } + if (template.contains("ExcelErrorVO.java.vm")) { + return modelPath + File.separator + className + "ExcelErrorVO.java"; + } + if (template.contains("Model.java.vm")) { + return modelPath + File.separator + className + "Model.java"; + } + if (template.contains("ListVO.java.vm")) { + return modelPath + File.separator + className + "ListVO.java"; + } + if (template.contains("Constant.java.vm")) { + return modelPath + File.separator + className + "Constant.java"; + } + return null; + } + + /** + * 生成代码 + * + * @param context + * @param template + * @param fileNames + */ + public static void velocityWriterFile(VelocityContext context, String template, String fileNames) { + try { + // 渲染模板 + @Cleanup + StringWriter sw = new StringWriter(); + Template tpl = Velocity.getTemplate(template, Constants.UTF_8); + tpl.merge(context, sw); + if (fileNames != null) { + File file = new File(XSSEscape.escapePath(fileNames)); + if (!file.exists()) { + file.createNewFile(); + } + @Cleanup + FileOutputStream fos = new FileOutputStream(file); + IOUtils.write(sw.toString(), fos, Constants.UTF_8); + IOUtils.closeQuietly(sw); + IOUtils.closeQuietly(fos); + } + } catch (IOException e) { + e.printStackTrace(); + System.out.println("渲染模板失败,表名:" + e); + } + } + + /** + * 获取接口参数配置,templatejson + * + * @param allModels + * @return + */ + public static Map getInterTemplateJson(List allModels, + Map childTableKey) { + Map map = new HashMap<>(); + for (FormAllModel item : allModels) { + if (FormEnum.mast.getMessage().equals(item.getYunzhupaasKey())) { + FieLdsModel fieLdsModel = BeanUtil.copyProperties(item.getFormColumnModel().getFieLdsModel(), + FieLdsModel.class); + if (StringUtil.isNotEmpty(fieLdsModel.getVModel())) { + map.put(fieLdsModel.getVModel(), getTemJsonModel(fieLdsModel, childTableKey)); + } + } + if (FormEnum.mastTable.getMessage().equals(item.getYunzhupaasKey())) { + FieLdsModel fieLdsModel = BeanUtil.copyProperties( + item.getFormMastTableModel().getMastTable().getFieLdsModel(), FieLdsModel.class); + if (StringUtil.isNotEmpty(fieLdsModel.getVModel())) { + map.put(item.getFormMastTableModel().getVModel(), getTemJsonModel(fieLdsModel, childTableKey)); + } + } + if (FormEnum.table.getMessage().equals(item.getYunzhupaasKey())) { + List childList = item.getChildList().getChildList(); + for (FormColumnModel columnModel : childList) { + FieLdsModel fieLdsModel = BeanUtil.copyProperties(columnModel.getFieLdsModel(), FieLdsModel.class); + if (StringUtil.isNotEmpty(fieLdsModel.getVModel())) { + HashMap childTableMap = new HashMap<>(); + childTableMap.put(item.getChildList().getTableModel(), item.getChildList().getAliasLowName()); + map.put(item.getChildList().getAliasLowName() + fieLdsModel.getVModel(), + getTemJsonModel(fieLdsModel, childTableMap)); + } + } + } + } + return map; + } + + private static List getTemJsonModel(FieLdsModel fieLdsModel, Map childTableKey) { + List templateJson = fieLdsModel.getConfig().getTemplateJson(); + List json = templateJson.size() > 0 ? templateJson + : JsonUtil.getJsonToList(fieLdsModel.getTemplateJson(), TemplateJsonModel.class); + for (TemplateJsonModel t : json) { + if (t.getRelationField() != null && t.getRelationField().contains("-") + && Objects.equals(t.getSourceType(), 1)) { + String[] split = t.getRelationField().split("-"); + t.setRelationField(childTableKey.get(split[0]) + "List-" + split[1]); + } + } + return json; + } + + /** + * 获取非系统控件字段 + * + * @return + */ + public static List getNotSystemFields(List mast, List mastTable, + List childTable, + GenerateParamModel generateParamModel) { + List list = new ArrayList<>(); + String table = generateParamModel.getTable(); + boolean mainTable = generateParamModel.isMainTable(); + List fields = new ArrayList<>(); + for (FormAllModel fam : mast) { + if (mainTable) { + fields.add(fam.getFormColumnModel()); + } + } + for (FormAllModel fam : mastTable) { + if (table.equals(fam.getFormMastTableModel().getTable())) { + fields.add(fam.getFormMastTableModel().getMastTable()); + } + } + for (FormAllModel fam : childTable) { + if (table.equals(fam.getChildList().getTableName())) { + fields.addAll(fam.getChildList().getChildList()); + } + } + for (FormColumnModel fcm : fields) { + if (!YunzhupaasKeyConsts.getSystemKey().contains(fcm.getFieLdsModel().getConfig().getYunzhupaasKey()) + && StringUtil.isNotEmpty(fcm.getFieLdsModel().getFieldAlias())) { + list.add(fcm.getFieLdsModel().getFieldAlias().toUpperCase()); + } + } + return list; + } + + /** + * 移除对象内的json字符串 + * + * @param str + * @return + */ + public static String objRemoveJson(String str) { + JSONObject object = JSONObject.parseObject(str); + + JSONArray columnList = object.getJSONArray("columnList"); + removeJson(columnList); + object.put("columnList", columnList); + + JSONArray searchList = object.getJSONArray("searchList"); + removeJson(searchList); + object.put("searchList", searchList); + + JSONObject ruleList = object.getJSONObject("ruleList"); + ruleRemoveJson(ruleList); + object.put("ruleList", ruleList); + + JSONObject ruleListApp = object.getJSONObject("ruleListApp"); + ruleRemoveJson(ruleListApp); + object.put("ruleListApp", ruleListApp); + + JSONArray columnOptions = object.getJSONArray("columnOptions"); + removeJson(columnOptions); + object.put("columnOptions", columnOptions); + + JSONArray defaultColumnList = object.getJSONArray("defaultColumnList"); + removeJson(defaultColumnList); + object.put("defaultColumnList", defaultColumnList); + + JSONArray sortList = object.getJSONArray("sortList"); + removeJson(sortList); + object.put("sortList", sortList); + + JSONArray fields = object.getJSONArray("fields"); + removeJson(fields); + object.put("fields", fields); + + object.remove("funcs"); + return object.toJSONString(); + } + + private static void ruleRemoveJson(JSONObject ruleList) { + if (ruleList != null) { + JSONArray conditionList = ruleList.getJSONArray("conditionList"); + if (conditionList != null) { + for (Object o : conditionList) { + JSONObject obj = (JSONObject) o; + JSONArray groups = obj.getJSONArray("groups"); + removeJson(groups); + obj.put("groups", groups); + } + ruleList.put("conditionList", conditionList); + } + } + } + + /** + * 递归移除对应属性 + * + * @param jsonArray + */ + public static void removeJson(JSONArray jsonArray) { + if (jsonArray == null || jsonArray.size() == 0) { + return; + } + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject jsonObject = (JSONObject) jsonArray.get(i); + String yunzhupaaskey = jsonObject.getJSONObject("__config__").getString("yunzhupaasKey"); + List childrenListAll = new ArrayList() { + { + add(FormEnum.card.getMessage()); + add(FormEnum.row.getMessage()); + add(FormEnum.tab.getMessage()); + add(FormEnum.collapse.getMessage()); + add(FormEnum.collapseItem.getMessage()); + add(FormEnum.tabItem.getMessage()); + add(FormEnum.tableGrid.getMessage()); + add(FormEnum.tableGridTr.getMessage()); + add(FormEnum.tableGridTd.getMessage()); + } + }; + if (childrenListAll.contains(yunzhupaaskey) || StringUtil.isEmpty(yunzhupaaskey)) { + JSONObject config = jsonObject.getJSONObject("__config__"); + config.remove("on"); + JSONArray childArray = config.getJSONArray("children"); + removeJson(childArray); + config.put("children", childArray); + jsonObject.put("__config__", config); + } else if (FormEnum.table.getMessage().equals(yunzhupaaskey)) { + JSONObject configA = jsonObject.getJSONObject("__config__"); + configA.remove("on"); + JSONArray children = configA.getJSONArray("children"); + for (int k = 0; k < children.size(); k++) { + JSONObject childrenObject = (JSONObject) children.get(k); + childrenObject.remove("on"); + JSONObject config = childrenObject.getJSONObject("__config__"); + config.remove("on"); + if (!"static".equals(config.get("dataType"))) { + childrenObject.remove("options"); + config.remove("options"); + } + childrenObject.put("__config__", config); + } + configA.put("children", children); + if (!"static".equals(configA.get("dataType"))) { + jsonObject.remove("options"); + configA.remove("options"); + } + jsonObject.put("__config__", configA); + } + jsonObject.remove("on"); + JSONObject config = jsonObject.getJSONObject("__config__"); + config.remove("on"); + if (!"static".equals(config.get("dataType"))) { + jsonObject.remove("options"); + config.remove("options"); + } + jsonObject.put("__config__", config); + } + } + + /** + * 移除代码生成不支持的对象 + * + * @param obj + * @return + */ + public static String delNotSupport(Object obj) { + if (obj instanceof JSONArray) { + List collect = JsonUtil.getJsonToJsonArray(JsonUtil.getObjectToString(obj)).stream() + .filter(t -> !"calculate".equals(JsonUtil.entityToMap(t).get("yunzhupaasKey"))) + .collect(Collectors.toList()); + return JSONObject.toJSONString(collect, SerializerFeature.WriteMapNullValue, + SerializerFeature.PrettyFormat); + } + return JSONObject.toJSONString(obj, SerializerFeature.WriteMapNullValue, SerializerFeature.PrettyFormat); + } +} diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/common/GenerateInterface.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/common/GenerateInterface.java new file mode 100644 index 0000000..f1845b6 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/common/GenerateInterface.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.base.util.common; + +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/5/31 + */ +public interface GenerateInterface { + + /** + * 获取 前端 及 后端模板 + * + * @param templatePath + * @param type + * @param hasImport + * @return + */ + List getTemplates(String templatePath, int type, boolean hasImport); + + /** + * 获取副子表model、list模板 + * + * @param isChild + * @return + */ + List getChildTemps(boolean isChild); +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/common/GenerateParamModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/common/GenerateParamModel.java new file mode 100644 index 0000000..e393033 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/common/GenerateParamModel.java @@ -0,0 +1,88 @@ +package com.yunzhupaas.base.util.common; + +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.model.DownloadCodeForm; +import com.yunzhupaas.base.model.Template7.Template7Model; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.database.model.entity.DbLinkEntity; +import com.yunzhupaas.database.util.DataSourceUtil; +import com.yunzhupaas.model.visualJson.TableModel; +import com.yunzhupaas.model.visualJson.analysis.FormAllModel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/5/31 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class GenerateParamModel { + private DataSourceUtil dataSourceUtil; + private String path; + private String fileName; + private String templatesPath; + private DownloadCodeForm downloadCodeForm; + private VisualdevEntity entity; + private UserInfo userInfo; + private ConfigValueUtil configValueUtil; + private DbLinkEntity linkEntity; + /** + * 当前表名 + */ + private String table; + /** + * 主表主键:映射字段 + */ + private String pKeyName; + /** + * 主表主键:原字段 + */ + private String pKeyNameOriginal; + /** + * 当前表类名 + */ + private String className; + /** + * 代码生成基础信息 + */ + private Template7Model template7Model; + + /** + * 乐观锁 + */ + private boolean concurrencyLock; + /** + * 是否自增 + */ + private boolean autoIncrement; + /** + * 是否主表 + */ + private boolean isMainTable; + /** + * 命名规范映射 + */ + private Map tableAliseMap = new HashMap<>(); + + /** + * 表信息,只解析一遍传参通用 + */ + private List tableModelList; + /** + * 所有控件,只解析一遍传参通用 + */ + private List formAllModel; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/common/SuperQueryUtil.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/common/SuperQueryUtil.java new file mode 100644 index 0000000..93af15d --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/common/SuperQueryUtil.java @@ -0,0 +1,49 @@ +package com.yunzhupaas.base.util.common; + +import com.yunzhupaas.emnus.ModuleTypeEnum; +import com.yunzhupaas.util.XSSEscape; +import lombok.Cleanup; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.Writer; + +public class SuperQueryUtil { + + public static void CreateJsFile(String data,String path,String jsFileType) throws IOException { + path = XSSEscape.escapePath(path); + String content = "const "+jsFileType+" = " + data; + File jsFile = new File(path); + Writer writer = null; + try { + writer = new FileWriter(jsFile); + writer.write(content); + writer.write(System.getProperty("line.separator")); + writer.write("export default "+jsFileType); + } catch (IOException e) { + e.printStackTrace(); + } finally { + if (writer!=null){ + writer.close(); + } + } + } + + public static void CreateFlowFormJsonFile(String data, String path){ + try { + File file = new File(XSSEscape.escapePath(path+File.separator+"flowForm."+ ModuleTypeEnum.VISUAL_DEV.getTableName())); + boolean b = file.createNewFile(); + if(b) { + @Cleanup Writer out = new FileWriter(file); + out.write(data); + out.close(); + } + }catch (Exception e) { + e.printStackTrace(); + } + } + + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/custom/CustomGenerator.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/custom/CustomGenerator.java new file mode 100644 index 0000000..74a83c6 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/custom/CustomGenerator.java @@ -0,0 +1,115 @@ +package com.yunzhupaas.base.util.custom; + +import com.baomidou.mybatisplus.generator.config.*; +import com.baomidou.mybatisplus.generator.config.builder.ConfigBuilder; +import com.baomidou.mybatisplus.generator.engine.AbstractTemplateEngine; +import lombok.extern.slf4j.Slf4j; + +import java.util.Map; + + +@Slf4j +public class CustomGenerator { + + public ConfigBuilder config; + public InjectionConfig injectionConfig; + public DataSourceConfig dataSource; + public StrategyConfig strategy; + public PackageConfig packageInfo; + public TemplateConfig template; + public GlobalConfig globalConfig; + public AbstractTemplateEngine templateEngine; + + private Map customParams; + + public CustomGenerator(Map customParams) { + this.customParams = customParams; + } + + public void execute(String path) { + if (null == this.config) { + this.config = new ConfigBuilder(packageInfo, dataSource, strategy, template, globalConfig, injectionConfig); + } + if (null == this.templateEngine) { + if (customParams != null) { + this.templateEngine = new CustomTemplateEngine(customParams, path); + } else { + this.templateEngine = new CustomTemplateEngine(path); + } + } + this.templateEngine.init(this.config).batchOutput().open(); + } + + public DataSourceConfig getDataSource() { + return this.dataSource; + } + + public CustomGenerator setDataSource(DataSourceConfig dataSource) { + this.dataSource = dataSource; + return this; + } + + public StrategyConfig getStrategy() { + return this.strategy; + } + + public CustomGenerator setStrategy(StrategyConfig strategy) { + this.strategy = strategy; + return this; + } + + public PackageConfig getPackageInfo() { + return this.packageInfo; + } + + public CustomGenerator setPackageInfo(PackageConfig packageInfo) { + this.packageInfo = packageInfo; + return this; + } + + public TemplateConfig getTemplate() { + return this.template; + } + + public CustomGenerator setTemplate(TemplateConfig template) { + this.template = template; + return this; + } + + public ConfigBuilder getConfig() { + return this.config; + } + + public CustomGenerator setConfig(ConfigBuilder config) { + this.config = config; + return this; + } + + public GlobalConfig getGlobalConfig() { + return this.globalConfig; + } + + public CustomGenerator setGlobalConfig(GlobalConfig globalConfig) { + this.globalConfig = globalConfig; + return this; + } + + public InjectionConfig getCfg() { + return this.injectionConfig; + } + + public CustomGenerator setCfg(InjectionConfig injectionConfig) { + this.injectionConfig = injectionConfig; + return this; + } + + public AbstractTemplateEngine getTemplateEngine() { + return this.templateEngine; + } + + public CustomGenerator setTemplateEngine(AbstractTemplateEngine templateEngine) { + this.templateEngine = templateEngine; + return this; + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/custom/CustomTemplateEngine.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/custom/CustomTemplateEngine.java new file mode 100644 index 0000000..04e2a8c --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/custom/CustomTemplateEngine.java @@ -0,0 +1,76 @@ +package com.yunzhupaas.base.util.custom; + + +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.generator.config.ConstVal; +import com.baomidou.mybatisplus.generator.config.builder.ConfigBuilder; +import com.baomidou.mybatisplus.generator.engine.AbstractTemplateEngine; +import org.apache.velocity.Template; +import org.apache.velocity.VelocityContext; +import org.apache.velocity.app.VelocityEngine; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileOutputStream; +import java.io.OutputStreamWriter; +import java.util.Map; +import java.util.Properties; + +public class CustomTemplateEngine extends AbstractTemplateEngine { + + private static final String DOT_VM = ".vm"; + private VelocityEngine velocityEngine; + + private Map customParams; + + private String path; + + public CustomTemplateEngine(String path) { + this.path = path; + } + + public CustomTemplateEngine(Map customParams, String path) { + this.customParams = customParams; + this.path = path; + } + + @Override + public CustomTemplateEngine init(ConfigBuilder configBuilder) { + super.setConfigBuilder(configBuilder); + if (null == this.velocityEngine) { + Properties p = new Properties(); + p.setProperty(VelocityEngine.FILE_RESOURCE_LOADER_PATH, path); + p.setProperty("ISO-8859-1", Constants.UTF_8); + p.setProperty("output.encoding", Constants.UTF_8); + this.velocityEngine = new VelocityEngine(p); + } + + return this; + } + + @Override + public void writer(Map objectMap, String templatePath, File outputFile) throws Exception { + if (templatePath != null && !"".equals(templatePath.trim())) { + Template template = this.velocityEngine.getTemplate(templatePath, ConstVal.UTF8); + FileOutputStream fos = new FileOutputStream(outputFile); + BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(fos, ConstVal.UTF8)); + if (customParams != null) { + objectMap.putAll(customParams); + } + template.merge(new VelocityContext(objectMap), writer); + writer.close(); + } + } + + @Override + public String templateFilePath(String filePath) { + if (null != filePath && !filePath.contains(".vm")) { + StringBuilder fp = new StringBuilder(); + fp.append(filePath).append(".vm"); + return fp.toString(); + } else { + return filePath; + } + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/custom/VelocityEnum.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/custom/VelocityEnum.java new file mode 100644 index 0000000..356a2e5 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/custom/VelocityEnum.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.base.util.custom; + +import com.baomidou.mybatisplus.core.toolkit.Constants; +import org.apache.velocity.app.Velocity; +import org.apache.velocity.app.VelocityEngine; + +import java.util.Properties; + +public enum VelocityEnum { + init; + + public void initVelocity(String path){ + Properties p = new Properties(); + p.setProperty(VelocityEngine.FILE_RESOURCE_LOADER_PATH, path); + p.setProperty("ISO-8859-1", Constants.UTF_8); + p.setProperty("output.encoding", Constants.UTF_8); + Velocity.init(p); + } + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/fuctionFormVue3/GenerateDataView.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/fuctionFormVue3/GenerateDataView.java new file mode 100644 index 0000000..e982ea9 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/fuctionFormVue3/GenerateDataView.java @@ -0,0 +1,197 @@ +package com.yunzhupaas.base.util.fuctionFormVue3; + +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.serializer.SerializerFeature; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.model.ColumnDataModel; +import com.yunzhupaas.base.model.DownloadCodeForm; +import com.yunzhupaas.base.model.Template6.BtnData; +import com.yunzhupaas.base.model.Template6.ColumnListField; +import com.yunzhupaas.base.model.Template7.Template7Model; +import com.yunzhupaas.base.util.common.*; +import com.yunzhupaas.generater.model.FormDesign.SearchTypeModel; +import com.yunzhupaas.model.visualJson.config.HeaderModel; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.XSSEscape; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.velocity.VelocityContext; + +import java.io.File; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/5/31 + */ +public class GenerateDataView implements GenerateInterface { + + @Override + public List getTemplates(String templatePath, int type, boolean hasImport) { + List templates = new ArrayList<>(); + //前端 + templates.add(templatePath + File.separator + "index.vue.vm"); + //api接口 + templates.add(File.separator + "helper" + File.separator + "api.ts.vm"); + //后端 + if (hasImport) { + templates.add(File.separator + "java" + File.separator + "ExcelVO.java.vm"); + templates.add(File.separator + "java" + File.separator + "ExcelErrorVO.java.vm"); + } + templates.add(File.separator + "java" + File.separator + "Pagination.java.vm"); + templates.add(File.separator + "java" + File.separator + "Constant.java.vm"); + return templates; + } + + @Override + public List getChildTemps(boolean isChild) { + return null; + } + + /** + * 数据视图代码生成 + * + * @param generateParamModel + * @throws Exception + */ + public void generateDataView(GenerateParamModel generateParamModel) throws Exception { + VisualdevEntity entity = generateParamModel.getEntity(); + DownloadCodeForm downloadCodeForm = generateParamModel.getDownloadCodeForm(); + String fileName = generateParamModel.getFileName(); + Template7Model template7Model = generateParamModel.getTemplate7Model(); + template7Model.setDescription(downloadCodeForm.getDescription()); + template7Model.setClassName(generateParamModel.getClassName()); + String templatesPath = generateParamModel.getTemplatesPath(); + String modelPathName = generateParamModel.getClassName().toLowerCase(); + + //columnTempJson + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(entity.getColumnData(), ColumnDataModel.class); + //app 列表对象 + ColumnDataModel appColumnDataModel = JsonUtil.getJsonToBean(entity.getAppColumnData(), ColumnDataModel.class); + //按钮 + List btnPcList = JsonUtil.getJsonToList(columnDataModel.getBtnsList(), BtnData.class); + List columnBtnPcList = JsonUtil.getJsonToList(columnDataModel.getColumnBtnsList(), BtnData.class); + List btnAppList = JsonUtil.getJsonToList(appColumnDataModel.getBtnsList(), BtnData.class); + List columnBtnAppList = JsonUtil.getJsonToList(appColumnDataModel.getColumnBtnsList(), BtnData.class); + List btnDataList = new ArrayList<>(btnPcList); + List collect3 = btnPcList.stream().map(BtnData::getValue).collect(Collectors.toList()); + btnDataList.addAll(btnAppList.stream().filter(t -> !collect3.contains(t.getValue())).collect(Collectors.toList())); + //是否有下载按钮 + boolean hasDownloadBtn = btnDataList.stream().anyMatch(btn -> btn.getValue().equals("download")); + + //列表和查询 + List columnList = JsonUtil.getJsonToList(columnDataModel.getColumnList(), ColumnListField.class); + List searchList = JsonUtil.getJsonToList(columnDataModel.getSearchList(), SearchTypeModel.class); + List columnAppList = JsonUtil.getJsonToList(appColumnDataModel.getColumnList(), ColumnListField.class); + List searchAppList = JsonUtil.getJsonToList(appColumnDataModel.getSearchList(), SearchTypeModel.class); + //查询全字段 + List searchListAll = new ArrayList<>(searchList); + List cSaArr = searchListAll.stream().map(SearchTypeModel::getId).collect(Collectors.toList()); + searchAppList.stream().forEach(t -> { + if (!cSaArr.contains(t.getId())) { + searchListAll.add(t); + cSaArr.add(t.getId()); + } + }); + searchListAll.stream().forEach(t -> t.setAfterVModel(t.getId())); + + Map map = new HashMap<>(); + + //微服务标识 + map.put("isCloud", GenerateCommon.IS_CLOUD); + map.put("isMain", true); + map.put("package", downloadCodeForm.getModulePackageName()); + map.put("module", downloadCodeForm.getModule()); + map.put("moduleId", entity.getId()); + map.put("className", DataControlUtils.captureName(generateParamModel.getClassName())); + map.put("genInfo", generateParamModel.getTemplate7Model()); + + map.put("hasDownloadBtn", hasDownloadBtn); + map.put("isList", true); + map.put("webType", 4); + map.put("hasPage", columnDataModel.getHasPage()); + map.put("groupTable", columnDataModel.getType() == 3); + map.put("groupField", columnDataModel.getGroupField()); + //数据接口参数 + map.put("interfaceId", entity.getInterfaceId()); + map.put("interfaceParam", JSONObject.toJSONString(entity.getInterfaceParam())); + //列表全属性 + map.put("columnDataStr", JSONObject.toJSONString(GenerateCommon.objRemoveJson(entity.getColumnData()))); + map.put("appColumnDataStr", JSONObject.toJSONString(GenerateCommon.objRemoveJson(entity.getAppColumnData()))); + map.put("columnData", JsonUtil.stringToMap(entity.getColumnData())); + map.put("btnPcList", btnPcList); + map.put("searchListAll", searchListAll); + + //合计 + map.put("configurationTotal", columnDataModel.isShowSummary()); + List summaryList = CollectionUtils.isEmpty(columnDataModel.getSummaryField()) ? Collections.EMPTY_LIST : columnDataModel.getSummaryField(); + map.put("fieldsTotal", JsonUtil.getObjectToString(summaryList)); + + //复杂表头 + List complexFieldList = new ArrayList<>(); + List> complexHeaderList = new ArrayList<>(); + if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { + for (HeaderModel headerModel : columnDataModel.getComplexHeaderList()) { + complexFieldList.addAll(headerModel.getChildColumns()); + complexHeaderList.add(JsonUtil.entityToMap(headerModel)); + } + } + map.put("complexHeaderList", JsonUtil.getListToJsonArray(complexHeaderList)); + map.put("complexFieldList", JsonUtil.getListToJsonArray(complexFieldList)); + //添加行参数 + Map columnDataJson = JsonUtil.stringToMap(entity.getColumnData()); + + //最外层zip包路径名称 + String zipName = template7Model.getServiceDirectory() + fileName; + //生成文件夹 + String htmlTSPath = XSSEscape.escapePath(zipName + File.separator + "html" + File.separator + "web" + File.separator + modelPathName + File.separator + "helper"); + File htmlJSfile = new File(htmlTSPath); + if (!htmlJSfile.exists()) { + htmlJSfile.mkdirs(); + } + String colData = JSONObject.toJSONString(columnDataJson.get("columnList"), SerializerFeature.WriteMapNullValue); + String colListJsPath = htmlTSPath + File.separator + "columnList.ts"; + SuperQueryUtil.CreateJsFile(colData, colListJsPath, "columnList"); + + String searchData = JSONObject.toJSONString(columnDataJson.get("searchList"), SerializerFeature.WriteMapNullValue); + String searchListJsPath = htmlTSPath + File.separator + "searchList.ts"; + SuperQueryUtil.CreateJsFile(searchData, searchListJsPath, "searchList"); + //生成controller代码 + this.genControllerFile(template7Model.getServiceDirectory() + fileName, map, templatesPath, downloadCodeForm); + + //生成复杂表头对象 + GenerateCommon.createComplexHeaderExcelVo(zipName, generateParamModel, entity, downloadCodeForm, map); + + //数据视图代码生成 + GenerateCommon.htmlTemplates(template7Model.getServiceDirectory() + fileName, + map, templatesPath, 1, false, downloadCodeForm, this); + } + + /** + * 生成controller代码 + * + * @param path 路径 + * @param object 模板数据 + * @param templatePath 模板路径 + */ + public static void genControllerFile(String path, Map object, String templatePath, DownloadCodeForm downloadCodeForm) throws Exception { + //获取模板列表 + String controllerTem = templatePath + File.separator + "ViewController.java.vm"; + //界面模板 + VelocityContext context = new VelocityContext(); + context.put("context", object); + String className = object.get("className").toString(); + + String controllerDir = path + File.separator + "java" + File.separator + GenerateCommon.getCloudPath("-controller", downloadCodeForm) + + File.separator + "controller"; + File controllerSrc = new File(controllerDir); + if (!controllerSrc.exists()) { + controllerSrc.mkdirs(); + } + String fileNames = controllerDir + File.separator + className + "Controller.java"; + GenerateCommon.velocityWriterFile(context, controllerTem, fileNames); + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/fuctionFormVue3/GenerateForm.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/fuctionFormVue3/GenerateForm.java new file mode 100644 index 0000000..e17b825 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/fuctionFormVue3/GenerateForm.java @@ -0,0 +1,40 @@ +package com.yunzhupaas.base.util.fuctionFormVue3; + +import com.yunzhupaas.base.util.common.GenerateInterface; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/5/31 + */ +public class GenerateForm implements GenerateInterface { + + @Override + public List getTemplates(String templatePath, int type, boolean hasImport) { + List templates = new ArrayList<>(); + //前端 + templates.add(templatePath + File.separator + "html" + File.separator + "index.vue.vm"); + templates.add(templatePath + File.separator + "html" + File.separator + "FormPopup.vue.vm"); + //api接口 + templates.add(File.separator + "helper" + File.separator + "api.ts.vm"); + //后端 + templates.add(File.separator + "java" + File.separator + "Form.java.vm"); + templates.add(File.separator + "java" + File.separator + "Constant.java.vm"); + return templates; + } + + @Override + public List getChildTemps(boolean isChild) { + List templates = new ArrayList<>(); + if (isChild) { + templates.add(File.separator + "java" + File.separator + "Model.java.vm"); + } + return templates; + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/fuctionFormVue3/GenerateFormFlow.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/fuctionFormVue3/GenerateFormFlow.java new file mode 100644 index 0000000..1bea159 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/fuctionFormVue3/GenerateFormFlow.java @@ -0,0 +1,41 @@ +package com.yunzhupaas.base.util.fuctionFormVue3; + + +import com.yunzhupaas.base.util.common.GenerateInterface; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/5/31 + */ +public class GenerateFormFlow implements GenerateInterface { + @Override + public List getTemplates(String templatePath, int type, boolean hasImport) { + List templates = new ArrayList<>(); + //前端 + templates.add(templatePath + File.separator + "html" + File.separator + "index.vue.vm"); + templates.add(templatePath + File.separator + "html" + File.separator + "Form.vue.vm"); + //api接口 + templates.add(File.separator + "helper" + File.separator + "api.ts.vm"); + //后端 + templates.add(File.separator + "java" + File.separator + "Form.java.vm"); + templates.add(File.separator + "java" + File.separator + "Constant.java.vm"); + return templates; + } + + @Override + public List getChildTemps(boolean isChild) { + List templates = new ArrayList<>(); + if (isChild) { + templates.add(File.separator + "java" + File.separator + "Model.java.vm"); + } + return templates; + } + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/fuctionFormVue3/GenerateFormList.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/fuctionFormVue3/GenerateFormList.java new file mode 100644 index 0000000..7ccb3b9 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/fuctionFormVue3/GenerateFormList.java @@ -0,0 +1,57 @@ +package com.yunzhupaas.base.util.fuctionFormVue3; + + +import com.yunzhupaas.base.util.common.GenerateInterface; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/5/31 + */ +public class GenerateFormList implements GenerateInterface { + /** + * 界面的模板 + * + * @return + */ + @Override + public List getTemplates(String templatePath, int type, boolean hasImport) { + List templates = new ArrayList<>(); + //前端页面 + if (type == 4) { + templates.add(templatePath + File.separator + "html" + File.separator + "indexEdit.vue.vm" ); + templates.add(templatePath + File.separator + "html" + File.separator + "ExtraForm.vue.vm" ); + } else { + templates.add(templatePath + File.separator + "html" + File.separator + "index.vue.vm" ); + templates.add(templatePath + File.separator + "html" + File.separator + "Form.vue.vm" ); + } + templates.add(templatePath + File.separator + "html" + File.separator + "Detail.vue.vm" ); + //api接口 + templates.add(File.separator + "helper" + File.separator + "api.ts.vm" ); + //后端 + templates.add(File.separator + "java" + File.separator + "Form.java.vm" ); + if (hasImport) { + templates.add(File.separator + "java" + File.separator + "ExcelVO.java.vm" ); + templates.add(File.separator + "java" + File.separator + "ExcelErrorVO.java.vm" ); + } + templates.add(File.separator + "java" + File.separator + "Pagination.java.vm" ); + templates.add(File.separator + "java" + File.separator + "Constant.java.vm" ); + return templates; + } + + @Override + public List getChildTemps(boolean isChild) { + List templates = new ArrayList<>(); + if(isChild){ + templates.add(File.separator + "java" + File.separator + "Model.java.vm" ); + templates.add(File.separator + "java" + File.separator + "ExcelVO.java.vm" ); + } + return templates; + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/fuctionFormVue3/GenerateFormListFlow.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/fuctionFormVue3/GenerateFormListFlow.java new file mode 100644 index 0000000..b7e7e8f --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/fuctionFormVue3/GenerateFormListFlow.java @@ -0,0 +1,55 @@ +package com.yunzhupaas.base.util.fuctionFormVue3; + +import com.yunzhupaas.base.util.common.GenerateInterface; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/5/31 + */ +public class GenerateFormListFlow implements GenerateInterface { + /** + * 界面的模板 + * + * @return + */ + @Override + public List getTemplates(String templatePath, int type, boolean hasImport) { + List templates = new ArrayList<>(); + //前端页面 + if (type == 4) { + templates.add(templatePath + File.separator + "html" + File.separator + "indexEdit.vue.vm"); + templates.add(templatePath + File.separator + "html" + File.separator + "Form.vue.vm"); + } else { + templates.add(templatePath + File.separator + "html" + File.separator + "index.vue.vm"); + templates.add(templatePath + File.separator + "html" + File.separator + "Form.vue.vm"); + } + //api接口 + templates.add(File.separator + "helper" + File.separator + "api.ts.vm"); + //后端 + templates.add(File.separator + "java" + File.separator + "Form.java.vm"); + if (hasImport) { + templates.add(File.separator + "java" + File.separator + "ExcelVO.java.vm"); + templates.add(File.separator + "java" + File.separator + "ExcelErrorVO.java.vm"); + } + templates.add(File.separator + "java" + File.separator + "Pagination.java.vm"); + templates.add(File.separator + "java" + File.separator + "Constant.java.vm"); + return templates; + } + + @Override + public List getChildTemps(boolean isChild) { + List templates = new ArrayList<>(); + if (isChild) { + templates.add(File.separator + "java" + File.separator + "Model.java.vm"); + templates.add(File.separator + "java" + File.separator + "ExcelVO.java.vm"); + } + return templates; + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/fuctionFormVue3/GenerateWorkFlow.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/fuctionFormVue3/GenerateWorkFlow.java new file mode 100644 index 0000000..d74d46d --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-biz/src/main/java/com/yunzhupaas/base/util/fuctionFormVue3/GenerateWorkFlow.java @@ -0,0 +1,37 @@ +package com.yunzhupaas.base.util.fuctionFormVue3; + +import com.yunzhupaas.base.util.common.GenerateInterface; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/5/31 + */ +public class GenerateWorkFlow implements GenerateInterface { + + @Override + public List getTemplates(String templatePath, int type, boolean hasImport) { + List templates = new ArrayList<>(); + //前端 + templates.add(templatePath + File.separator + "html" + File.separator + "index.vue.vm"); + //后端 + templates.add(File.separator + "java" + File.separator + "Form.java.vm"); + templates.add(File.separator + "java" + File.separator + "Constant.java.vm"); + return templates; + } + + @Override + public List getChildTemps(boolean isChild) { + List templates = new ArrayList<>(); + if (isChild) { + templates.add(File.separator + "java" + File.separator + "Model.java.vm"); + } + return templates; + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-controller/pom.xml b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-controller/pom.xml new file mode 100644 index 0000000..4d1d6ec --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-controller/pom.xml @@ -0,0 +1,27 @@ + + + + yunzhupaas-visualdev-base + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-visualdev-base-controller + + + + com.yunzhupaas + yunzhupaas-visualdev-base-biz + ${project.version} + + + com.yunzhupaas + yunzhupaas-visualdev-onlinedev-biz + ${project.version} + + + + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-controller/src/main/java/com/yunzhupaas/base/controller/FilterController.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-controller/src/main/java/com/yunzhupaas/base/controller/FilterController.java new file mode 100644 index 0000000..5ed9dec --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-controller/src/main/java/com/yunzhupaas/base/controller/FilterController.java @@ -0,0 +1,82 @@ +package com.yunzhupaas.base.controller; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.entity.FilterEntity; +import com.yunzhupaas.base.model.filter.FilterInfo; +import com.yunzhupaas.base.model.filter.FilterQuery; +import com.yunzhupaas.base.service.FilterService; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.util.RandomUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping("/filter") +public class FilterController { + @Autowired + private FilterService filterService; + /** + * 获取列表 + * @param page + * @return + */ + @PostMapping("list") + public ActionResult list(@RequestBody @Validated FilterQuery page) { + QueryWrapper wrapper = new QueryWrapper<>(); + + + FilterQuery info = filterService.page(page, wrapper); + + return ActionResult.success(info); + } + + /** + * 查询信息 + * @param id + * @return + */ + @GetMapping("/{id}") + public ActionResult info(@PathVariable String id) { + FilterEntity info = filterService.getById(id); + return ActionResult.success(info); + } + /** + * 保存信息 + * @param info + * @return + */ + @PostMapping("save") + public ActionResult save(@RequestBody @Validated FilterInfo info) { + FilterEntity filterEntity = BeanUtil.copyProperties(info, FilterEntity.class); + filterEntity.setId(RandomUtil.uuId()); + filterService.save(filterEntity); + return ActionResult.success(MsgCode.SU002.get()); + } + /** + * 更新信息 + * @param info + * @return + */ + @PutMapping("update") + public ActionResult update(@RequestBody @Validated FilterInfo info) { + + FilterEntity filterEntity = BeanUtil.copyProperties(info, FilterEntity.class); + filterService.updateById(filterEntity); + return ActionResult.success(MsgCode.SU004.get()); + } + /** + * 删除信息 + * @param id + * @return + */ + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable String id) { + filterService.removeById(id); + return ActionResult.success(MsgCode.SU003.get()); + } + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-controller/src/main/java/com/yunzhupaas/base/controller/VisualAiController.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-controller/src/main/java/com/yunzhupaas/base/controller/VisualAiController.java new file mode 100644 index 0000000..8302f65 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-controller/src/main/java/com/yunzhupaas/base/controller/VisualAiController.java @@ -0,0 +1,43 @@ +package com.yunzhupaas.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaMode; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.model.ai.VisualAiModel; +import com.yunzhupaas.base.service.impl.VisualAiServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * 在线开发ai模块 + * + * @author 云筑产品开发平台组 + * @version v5.2.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/12/2 9:57:13 + */ +@Tag(name = "在线开发ai模块", description = "ai") +@RestController +@RequestMapping("/api/visualdev/ai") +public class VisualAiController { + + @Autowired + private VisualAiServiceImpl visualAiService; + + @Operation(summary = "ai生成表单") + @Parameters({ + @Parameter(name = "keyword", description = "需求描述"), + }) + @PostMapping("/form") + @SaCheckPermission(value = {"onlineDev.webDesign", "generator.webForm", "generator.flowForm"}, mode = SaMode.OR) + public ActionResult form(@RequestBody Pagination pagination) { + VisualAiModel visualAiModel = visualAiService.form(pagination.getKeyword()); + return ActionResult.success(visualAiModel); + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-controller/src/main/java/com/yunzhupaas/base/controller/VisualdevController.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-controller/src/main/java/com/yunzhupaas/base/controller/VisualdevController.java new file mode 100644 index 0000000..cd4245f --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-controller/src/main/java/com/yunzhupaas/base/controller/VisualdevController.java @@ -0,0 +1,703 @@ +package com.yunzhupaas.base.controller; + + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaMode; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.DataInterfaceEntity; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.entity.VisualdevReleaseEntity; +import com.yunzhupaas.base.model.*; +import com.yunzhupaas.base.model.Template6.BtnData; +import com.yunzhupaas.base.model.module.ModuleNameVO; +import com.yunzhupaas.base.model.online.VisualMenuModel; +import com.yunzhupaas.base.service.*; +import com.yunzhupaas.base.util.VisualUtil; +import com.yunzhupaas.base.util.visualUtil.PubulishUtil; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.constant.GenerateConstant; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.model.template.FlowByFormModel; +import com.yunzhupaas.model.OnlineDevData; +import com.yunzhupaas.model.visualJson.*; +import com.yunzhupaas.model.visualJson.analysis.RecursionForm; +import com.yunzhupaas.onlinedev.model.PaginationModel; +import com.yunzhupaas.onlinedev.service.VisualdevModelDataService; +import com.yunzhupaas.onlinedev.util.onlineDevUtil.OnlinePublicUtils; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.enums.DictionaryDataEnum; +import com.yunzhupaas.workflow.service.TemplateApi; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 可视化基础模块 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Tag(name = "可视化基础模块", description = "Base") +@RestController +@RequestMapping("/api/visualdev/Base") +public class VisualdevController extends SuperController { + + @Autowired + private VisualdevService visualdevService; + @Autowired + private VisualdevReleaseService visualdevReleaseService; + @Autowired + private UserService userService; + + @Autowired + private DictionaryDataService dictionaryDataApi; + @Autowired + private VisualdevModelDataService visualdevModelDataService; + @Autowired + private PubulishUtil pubulishUtil; + @Autowired + private ModuleService moduleService; + @Autowired + private DataInterfaceService dataInterFaceApi; + @Autowired + private FilterService filterService; + @Autowired + private VisualAliasService aliasService; + @Autowired + private TemplateApi templateApi; + + @Operation(summary = "获取功能列表") + @GetMapping + @SaCheckPermission(value = {"onlineDev.webDesign", "generator.webForm", "generator.flowForm"}, mode = SaMode.OR) + public ActionResult> list(PaginationVisualdev paginationVisualdev) { + // 全部功能表单模板 + List data = visualdevService.getList(paginationVisualdev); + List userId = data.stream().map(t -> t.getCreatorUserId()).collect(Collectors.toList()); + List lastUserId = data.stream().map(t -> t.getLastModifyUserId()).collect(Collectors.toList()); + List userEntities = userService.getUserName(userId); + List lastUserIdEntities = userService.getUserName(lastUserId); + // 表单类型 + List dictionList = dictionaryDataApi.getListByTypeDataCode(DictionaryDataEnum.VISUALDEV.getDictionaryTypeId()); + List modelAll = new LinkedList<>(); + + // 遍历功能表单模板 + for (VisualdevEntity entity : data) { + VisualFunctionModel model = JsonUtil.getJsonToBean(entity, VisualFunctionModel.class); + // 是否在表单类型中存在,若存在进行装配 + DictionaryDataEntity dataEntity = dictionList.stream().filter(t -> t.getId().equals(entity.getCategory())).findFirst().orElse(null); + //避免导入的功能丢失 + model.setCategory(dataEntity != null ? dataEntity.getFullName() : null); + UserEntity creatorUser = userEntities.stream().filter(t -> t.getId().equals(model.getCreatorUserId())).findFirst().orElse(null); + model.setCreatorUser(creatorUser != null ? creatorUser.getRealName() + "/" + creatorUser.getAccount() : ""); + UserEntity lastmodifyuser = lastUserIdEntities.stream().filter(t -> t.getId().equals(model.getLastModifyUserId())).findFirst().orElse(null); + model.setLastModifyUser(lastmodifyuser != null ? lastmodifyuser.getRealName() + "/" + lastmodifyuser.getAccount() : ""); + model.setIsRelease(entity.getState()); + model.setHasPackage(true); + modelAll.add(model); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(paginationVisualdev, PaginationVO.class); + return ActionResult.page(modelAll, paginationVO); + } + + @Operation(summary = "获取功能列表") + @GetMapping("/list") + public ActionResult> getList(PaginationVisualdev paginationVisualdev) { + List data = visualdevService.getPageList(paginationVisualdev); + List modelAll = JsonUtil.getJsonToList(data, VisualDevListVO.class); + + //流程发起节点-调用弹窗添加系统表单是否引用 + if (paginationVisualdev.getFlowStart()) { + List flowFormStart = templateApi.getFormList();//流程发起节点的表单列表 + for (VisualDevListVO item : modelAll) { + if (Objects.equals(item.getType(), 2)) {//系统表单被引用不能再选 + boolean contains = flowFormStart.contains(item.getId()); + item.setIsQuote(contains ? 1 : 0); + } + } + } + + PaginationVO paginationVO = JsonUtil.getJsonToBean(paginationVisualdev, PaginationVO.class); + return ActionResult.page(modelAll, paginationVO); + } + + + @Operation(summary = "获取功能列表下拉框") + @Parameters({ + @Parameter(name = "type", description = "类型(1-表单设计,2-系统表单)"), + @Parameter(name = "isRelease", description = "是否发布"), + @Parameter(name = "webType", description = "页面类型(1、纯表单,2、表单加列表,3、表单列表工作流、4、数据视图)"), + @Parameter(name = "enableFlow", description = "是否启用流程") + }) + @GetMapping("/Selector") + public ActionResult selectorList(Integer type, Integer isRelease, String webType, Integer enableFlow) { + List allList; + List list = new ArrayList<>(); + if (isRelease != null) { + List releaseEntities = visualdevReleaseService.selectorList(); + allList = JsonUtil.getJsonToList(releaseEntities, VisualdevEntity.class); + } else { + allList = visualdevService.selectorList(); + } + if (webType != null) { + String[] webTypes = webType.split(","); + for (String wbType : webTypes) { + List collect = allList.stream().filter(l -> l.getWebType().equals(Integer.valueOf(wbType))).collect(Collectors.toList()); + list.addAll(collect); + } + } else { + list = allList; + } + List dataEntityList = new ArrayList<>(); + List voList = new ArrayList<>(); + HashSet cate = new HashSet<>(16); + if (type != null) { + list = list.stream().filter(t -> type.equals(t.getType())).collect(Collectors.toList()); + dataEntityList = dictionaryDataApi.getListByTypeDataCode(DictionaryDataEnum.getTypeId(type)); + // 遍历数据字典得到外部分类 + for (DictionaryDataEntity dataEntity : dataEntityList) { + List num = list.stream().filter(t -> dataEntity.getId().equals(t.getCategory())).collect(Collectors.toList()); + if (num.size() <= 0) { + continue; + } + int i = cate.size(); + cate.add(dataEntity.getId()); + if (cate.size() == i + 1) { + VisualdevTreeVO visualdevTreeVO = new VisualdevTreeVO(); + visualdevTreeVO.setId(dataEntity.getId()); + visualdevTreeVO.setFullName(dataEntity.getFullName()); + visualdevTreeVO.setHasChildren(true); + voList.add(visualdevTreeVO); + } + } + } else { + // type为空时 + for (VisualdevEntity entity : list) { + DictionaryDataEntity dataEntity = dictionaryDataApi.getInfo(entity.getCategory()); + if (dataEntity != null) { + int i = cate.size(); + cate.add(dataEntity.getId()); + if (cate.size() == i + 1) { + VisualdevTreeVO visualdevTreeVO = new VisualdevTreeVO(); + visualdevTreeVO.setId(entity.getCategory()); + visualdevTreeVO.setFullName(dataEntity.getFullName()); + visualdevTreeVO.setHasChildren(true); + voList.add(visualdevTreeVO); + } + } + + } + } + for (VisualdevTreeVO vo : voList) { + List visualdevTreeChildModelList = new ArrayList<>(); + for (VisualdevEntity entity : list) { + if (vo.getId().equals(entity.getCategory())) { + VisualdevTreeChildModel model = JsonUtil.getJsonToBean(entity, VisualdevTreeChildModel.class); + visualdevTreeChildModelList.add(model); + } + } + vo.setChildren(visualdevTreeChildModelList); + } + ListVO listVO = new ListVO(); + listVO.setList(voList); + return ActionResult.success(listVO); + } + + @Operation(summary = "获取功能信息") + @Parameters({ + @Parameter(name = "id", description = "主键"), + }) + @GetMapping("/{id}") + @SaCheckPermission(value = {"onlineDev.webDesign", "generator.webForm", "generator.flowForm"}, mode = SaMode.OR) + public ActionResult info(@PathVariable("id") String id) throws DataException { + UserInfo userInfo = UserProvider.getUser(); + VisualdevEntity entity = visualdevService.getInfo(id); + VisualDevInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, VisualDevInfoVO.class); + if (StringUtil.isNotEmpty(entity.getInterfaceId())) { + DataInterfaceEntity info = dataInterFaceApi.getInfo(entity.getInterfaceId()); + if (info != null) { + vo.setInterfaceName(info.getFullName()); + } + } + return ActionResult.success(vo); + } + + /** + * 获取表单主表属性下拉框 + * + * @param id + * @return + */ + @Operation(summary = "获取表单主表属性下拉框") + @Parameters({ + @Parameter(name = "id", description = "主键"), + @Parameter(name = "filterType", description = "过滤类型:1-按键事件选择字段列表过滤"), + }) + @GetMapping("/{id}/FormDataFields") + @SaCheckPermission("onlineDev.webDesign") + public ActionResult> getFormData(@PathVariable("id") String id, @RequestParam(value = "filterType", required = false) Integer filterType) { + List fieldList = visualdevModelDataService.fieldList(id, filterType); + ListVO listVO = new ListVO(); + listVO.setList(fieldList); + return ActionResult.success(listVO); + } + + /** + * 关联数据分页数据 + * + * @param id + * @param paginationModel + * @return + */ + @Operation(summary = "关联数据分页数据") + @Parameters({ + @Parameter(name = "id", description = "主键"), + }) + @GetMapping("/{id}/FieldDataSelect") + public ActionResult getFormData(@PathVariable("id") String id, PaginationModel paginationModel) { + VisualdevEntity entity = visualdevService.getReleaseInfo(id); + List> realList = visualdevModelDataService.getPageList(entity, paginationModel); + PaginationVO paginationVO = JsonUtil.getJsonToBean(paginationModel, PaginationVO.class); + return ActionResult.page(realList, paginationVO); + } + + + /** + * 复制功能 + * + * @param id + * @return + */ + @Operation(summary = "复制功能") + @Parameters({ + @Parameter(name = "id", description = "主键"), + }) + @PostMapping("/{id}/Actions/Copy") + @SaCheckPermission(value = {"onlineDev.webDesign", "generator.webForm", "generator.flowForm"}, mode = SaMode.OR) + public ActionResult copyInfo(@PathVariable("id") String id) throws WorkFlowException { + VisualdevReleaseEntity releaseEntity = visualdevReleaseService.getById(id); + boolean b = releaseEntity != null; + VisualdevEntity entity; + String uuid = RandomUtil.uuId(); + //已发布取发布版本 + if (b) { + entity = JsonUtil.getJsonToBean(releaseEntity, VisualdevEntity.class); + //已发布复制命名规范 + aliasService.copy(releaseEntity.getId(), uuid); + } else { + entity = visualdevService.getInfo(id); + } + String copyNum = UUID.randomUUID().toString().substring(0, 5); + entity.setFullName(entity.getFullName() + ".副本" + copyNum); + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + entity.setCreatorTime(null); + entity.setId(uuid); + entity.setEnCode(entity.getEnCode() + copyNum); + VisualdevEntity entity1 = JsonUtil.getJsonToBean(entity, VisualdevEntity.class); + if (entity1.getEnCode().length() > 50 || entity1.getFullName().length() > 50) { + return ActionResult.fail(MsgCode.PRI006.get()); + } + visualdevService.create(entity1); + return ActionResult.success(MsgCode.SU007.get()); + } + + + /** + * 更新功能状态 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "更新功能状态") + @Parameters({ + @Parameter(name = "id", description = "主键"), + }) + @PutMapping("/{id}/Actions/State") + @SaCheckPermission(value = {"onlineDev.webDesign", "generator.webForm", "generator.flowForm"}, mode = SaMode.OR) + public ActionResult update(@PathVariable("id") String id) throws Exception { + VisualdevEntity entity = visualdevService.getInfo(id); + if (entity != null) { + boolean flag = visualdevService.update(entity.getId(), entity); + if (flag == false) { + return ActionResult.fail(MsgCode.FA002.get()); + } + } + return ActionResult.success(MsgCode.SU004.get()); + } + + + @Operation(summary = "新建功能") + @PostMapping + @SaCheckPermission(value = {"onlineDev.webDesign", "generator.webForm", "generator.flowForm"}, mode = SaMode.OR) + public ActionResult create(@RequestBody VisualDevCrForm visualDevCrForm) throws Exception { + VisualdevEntity entity = JsonUtil.getJsonToBean(JsonUtilEx.getObjectToString(visualDevCrForm), VisualdevEntity.class); + if (GenerateConstant.containKeyword(entity.getFullName())) { + return ActionResult.fail("表单名称" + MsgCode.SYS128.get(entity.getFullName())); + } + if (visualdevService.getObjByEncode(entity.getEnCode(), entity.getType()) > 0) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + if (visualdevService.getCountByName(entity.getFullName(), entity.getType()) > 0) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (!VisualWebTypeEnum.DATA_VIEW.getType().equals(entity.getWebType()) + && !OnlineDevData.FORM_TYPE_SYS.equals(entity.getType())) { + List tableModelList = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + FormDataModel formData = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + + //判断子表是否复用 + RecursionForm recursionForm = new RecursionForm(); + if (ObjectUtil.isNotNull(formData)) { + //判断有表是否满足主键策略 + if (tableModelList.size() > 0) { + boolean isIncre = Objects.equals(formData.getPrimaryKeyPolicy(), 2); + String strategy = !isIncre ? "[雪花ID]" : "[自增长id]"; + for (TableModel tableModel : tableModelList) { + Boolean isAutoIncre = visualdevService.getPrimaryDbField(entity.getDbLinkId(), tableModel.getTable()); + if (isAutoIncre == null) { + return ActionResult.fail(MsgCode.FM011.get(tableModel.getTable())); + } + if (isIncre != isAutoIncre) { + return ActionResult.fail(MsgCode.FM012.get(strategy, tableModel.getTable())); + } + } + } + + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + recursionForm.setList(list); + recursionForm.setTableModelList(tableModelList); + if (FormCloumnUtil.repetition(recursionForm, new ArrayList<>())) { + return ActionResult.fail(MsgCode.FM003.get()); + } + + //字段判断 + List fields = new ArrayList<>(); + OnlinePublicUtils.getAllFields(fields, list); + StringJoiner sj = new StringJoiner(","); + for (FieLdsModel item : fields) { + if (StringUtil.isNotEmpty(item.getVModel()) && GenerateConstant.containKeyword(item.getVModel())) { + sj.add(item.getConfig().getLabel() + "-" + item.getVModel()); + } + } + if (StringUtil.isNotEmpty(sj.toString())) { + return ActionResult.fail(MsgCode.SYS128.get(sj)); + } + } + } + if (StringUtil.isEmpty(entity.getId())) { + entity.setId(RandomUtil.uuId()); + } + visualdevService.create(entity); + + return ActionResult.success(MsgCode.SU001.get(), entity.getId()); + } + + @Operation(summary = "修改功能") + @Parameters({ + @Parameter(name = "id", description = "主键"), + }) + @PutMapping("/{id}") + @SaCheckPermission(value = {"onlineDev.webDesign", "generator.webForm", "generator.flowForm"}, mode = SaMode.OR) + public ActionResult update(@PathVariable("id") String id, @RequestBody VisualDevUpForm visualDevUpForm) throws Exception { + VisualdevEntity visualdevEntity = visualdevService.getInfo(id); + String enCode = visualdevEntity.getEnCode(); + String fullName = visualdevEntity.getFullName(); + VisualdevEntity entity = JsonUtil.getJsonToBean(JsonUtilEx.getObjectToString(visualDevUpForm), VisualdevEntity.class); + entity.setState(visualdevEntity.getState()); + if (GenerateConstant.containKeyword(entity.getFullName())) { + return ActionResult.fail("表单名称" + MsgCode.SYS128.get(entity.getFullName())); + } + if (!enCode.equals(visualDevUpForm.getEnCode())) { + if (visualdevService.getObjByEncode(entity.getEnCode(), entity.getType()) > 0) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + } + if (!fullName.equals(visualDevUpForm.getFullName())) { + if (visualdevService.getCountByName(entity.getFullName(), entity.getType()) > 0) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + } + + VisualdevReleaseEntity releaseEntity = visualdevReleaseService.getById(id); + + // 如果不是在线的,默认更新所有配置 + if (!VisualWebTypeEnum.DATA_VIEW.getType().equals(entity.getWebType()) + && !OnlineDevData.FORM_TYPE_SYS.equals(entity.getType())) { + Map tableMap = visualdevService.getTableMap(entity.getFormData()); + filterService.updateRuleList(id, entity, 1, 1, tableMap); + + //已发布修改的时候,把表移除掉的时候需要提示选表 + List tableModelList = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + if (releaseEntity != null && !VisualWebTypeEnum.DATA_VIEW.getType().equals(releaseEntity.getWebType())) { + if (tableModelList.size() == 0) { + return ActionResult.fail(MsgCode.VS408.get()); + } + } + //判断子表是否复用 + if (ObjectUtil.isNotNull(entity.getFormData())) { + FormDataModel formData = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + if (tableModelList.size() > 0) { + RecursionForm recursionForm = new RecursionForm(); + recursionForm.setList(list); + recursionForm.setTableModelList(tableModelList); + if (FormCloumnUtil.repetition(recursionForm, new ArrayList<>())) { + return ActionResult.fail(MsgCode.FM003.get()); + } + } + //字段判断 + List fields = new ArrayList<>(); + OnlinePublicUtils.getAllFields(fields, list); + StringJoiner sj = new StringJoiner(","); + for (FieLdsModel item : fields) { + if (StringUtil.isNotEmpty(item.getVModel()) && GenerateConstant.containKeyword(item.getVModel())) { + sj.add(item.getConfig().getLabel() + "-" + item.getVModel()); + } + } + if (StringUtil.isNotEmpty(sj.toString())) { + return ActionResult.fail(MsgCode.SYS128.get(sj)); + } + } + } + + //修改状态 + boolean released = Objects.equals(visualdevEntity.getState(), 1); + if (visualdevEntity != null && released) { + entity.setState(2); + } + boolean flag = visualdevService.update(id, entity); + if (flag == false) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + + @Operation(summary = "删除功能") + @Parameters({ + @Parameter(name = "id", description = "主键"), + }) + @DeleteMapping("/{id}") + @SaCheckPermission(value = {"onlineDev.webDesign", "generator.webForm", "generator.flowForm"}, mode = SaMode.OR) + public ActionResult delete(@PathVariable("id") String id) throws WorkFlowException { + VisualdevEntity entity = visualdevService.getInfo(id); + if (entity != null) { + FlowByFormModel flowByFormId = templateApi.getFlowByFormId(id, false); + if (flowByFormId != null && flowByFormId.getIsConfig()) { + return ActionResult.fail(MsgCode.FM005.get()); + } + visualdevService.removeById(id); + visualdevReleaseService.removeById(id); + aliasService.removeByVisualId(id); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + @Operation(summary = "获取模板按钮和列表字段") + @Parameters({ + @Parameter(name = "moduleId", description = "模板id"), + }) + @GetMapping("/ModuleBtn") + @SaCheckPermission(value = {"onlineDev.webDesign", "generator.webForm", "generator.flowForm"}, mode = SaMode.OR) + public ActionResult getModuleBtn(String moduleId) { + VisualdevEntity visualdevEntity = visualdevService.getInfo(moduleId); + //去除模板中的F_ + VisualUtil.delfKey(visualdevEntity); + List btnData = new ArrayList<>(); + Map column = JsonUtil.stringToMap(visualdevEntity.getColumnData()); + if (column.get("columnBtnsList") != null) { + btnData.addAll(JsonUtil.getJsonToList(JsonUtil.getJsonToListMap(column.get("columnBtnsList").toString()), BtnData.class)); + } + if (column.get("btnsList") != null) { + btnData.addAll(JsonUtil.getJsonToList(JsonUtil.getJsonToListMap(column.get("btnsList").toString()), BtnData.class)); + } + return ActionResult.success(btnData); + } + + @Operation(summary = "发布模板") + @Parameters({ + @Parameter(name = "id", description = "主键"), + }) + @PostMapping("/{id}/Actions/Release") + @SaCheckPermission(value = {"onlineDev.webDesign", "generator.webForm", "generator.flowForm"}, mode = SaMode.OR) + @DSTransactional(rollbackFor = Exception.class) + public ActionResult publish(@PathVariable("id") String id) throws Exception { + VisualdevEntity visualdevEntity = visualdevService.getInfo(id); + if (GenerateConstant.containKeyword(visualdevEntity.getFullName())) { + return ActionResult.fail("表单名称" + MsgCode.SYS128.get(visualdevEntity.getFullName())); + } + List tableModels = JsonUtil.getJsonToList(visualdevEntity.getVisualTables(), TableModel.class); + + String s = VisualUtil.checkPublishVisualModel(visualdevEntity, MsgCode.VS004.get()); + if (s != null) { + return ActionResult.fail(s); + } + //数据视图没有formdata 系统表单不需要创表 + if (!VisualWebTypeEnum.DATA_VIEW.getType().equals(visualdevEntity.getWebType()) + && !OnlineDevData.FORM_TYPE_SYS.equals(visualdevEntity.getType())) { + + if (ObjectUtil.isNotNull(visualdevEntity.getFormData())) { + FormDataModel formData = JsonUtil.getJsonToBean(visualdevEntity.getFormData(), FormDataModel.class); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + //字段判断 + List fields = new ArrayList<>(); + OnlinePublicUtils.getAllFields(fields, list); + StringJoiner sj = new StringJoiner(","); + for (FieLdsModel item : fields) { + if (StringUtil.isNotEmpty(item.getVModel()) && GenerateConstant.containKeyword(item.getVModel())) { + sj.add(item.getConfig().getLabel() + "-" + item.getVModel()); + } + } + if (StringUtil.isNotEmpty(sj.toString())) { + return ActionResult.fail(MsgCode.SYS128.get(sj)); + } + } + + if (tableModels.size() == 0) { + try { + visualdevService.createTable(visualdevEntity); + } catch (WorkFlowException e) { + e.printStackTrace(); + throw new WorkFlowException(MsgCode.VS003.get()); + } + } + Map tableMap = visualdevService.getTableMap(visualdevEntity.getFormData()); + filterService.updateRuleList(id, visualdevEntity, 1, 1, tableMap); + } + //线上 + visualdevEntity.setState(1); + visualdevEntity.setEnabledMark(1); + visualdevService.updateById(visualdevEntity); + //复制旧版本信息存储 + + VisualdevReleaseEntity newRelease = new VisualdevReleaseEntity(); + newRelease.setVisualTables(visualdevEntity.getVisualTables()); + newRelease.setFormData(visualdevEntity.getFormData()); + newRelease.setColumnData(visualdevEntity.getColumnData()); + newRelease.setAppColumnData(visualdevEntity.getAppColumnData()); + newRelease.setWebType(visualdevEntity.getWebType()); + newRelease.setDbLinkId(visualdevEntity.getDbLinkId()); + String newContent = JsonUtil.getObjectToString(newRelease); + + VisualdevReleaseEntity byId = visualdevReleaseService.getById(visualdevEntity.getId()); + if (byId != null) { + VisualdevReleaseEntity oldRelease = new VisualdevReleaseEntity(); + oldRelease.setVisualTables(byId.getVisualTables()); + oldRelease.setFormData(byId.getFormData()); + oldRelease.setColumnData(byId.getColumnData()); + oldRelease.setAppColumnData(byId.getAppColumnData()); + oldRelease.setWebType(byId.getWebType()); + oldRelease.setDbLinkId(byId.getDbLinkId()); + String oldContent = JsonUtil.getObjectToString(oldRelease); + if (oldContent.equals(newContent)) { + newContent = byId.getOldContent(); + } else { + newContent = oldContent; + } + } + VisualdevEntity clone = new VisualdevEntity(); + BeanUtil.copyProperties(visualdevEntity, clone); + VisualdevReleaseEntity releaseEntity = JsonUtil.getJsonToBean(clone, VisualdevReleaseEntity.class); + releaseEntity.setOldContent(newContent); + visualdevReleaseService.setIgnoreLogicDelete().saveOrUpdate(releaseEntity); + visualdevReleaseService.clearIgnoreLogicDelete(); + return ActionResult.success(MsgCode.SU011.get()); + } + + + @Operation(summary = "生成菜单") + @Parameters({ + @Parameter(name = "id", description = "主键"), + }) + @PostMapping("/{id}/Actions/Module") + @SaCheckPermission(value = {"onlineDev.webDesign", "generator.webForm", "generator.flowForm"}, mode = SaMode.OR) + @Transactional(rollbackFor = Exception.class) + public ActionResult createModule(@PathVariable("id") String id, @RequestBody VisualDevPubModel visualDevPubModel) throws Exception { + VisualdevEntity visualdevEntity = visualdevService.getInfo(id); + if (visualdevEntity == null) { + ActionResult.fail(MsgCode.FA001.get()); + } + visualdevEntity.setPlatformRelease(visualDevPubModel.getPlatformRelease()); + visualdevService.updateById(visualdevEntity); + + //将线上版本发布 + VisualdevEntity clone = BeanUtil.copyProperties(visualdevEntity, VisualdevEntity.class); + VisualMenuModel visual = VisualUtil.getVisual(clone, visualDevPubModel); + visual.setApp(visualDevPubModel.getApp()); + visual.setPc(visualDevPubModel.getPc()); + visual.setPcModuleParentId(visualDevPubModel.getPcModuleParentId()); + visual.setAppModuleParentId(visualDevPubModel.getAppModuleParentId()); + visual.setType(3); + visual.setWebType(visualdevEntity.getWebType()); + pubulishUtil.publishMenu(visual); + return ActionResult.success(MsgCode.VS007.get()); + } + + @Operation(summary = "回滚模板") + @Parameters({ + @Parameter(name = "id", description = "主键"), + }) + @GetMapping("/{id}/Actions/RollbackTemplate") + @SaCheckPermission(value = {"onlineDev.webDesign", "generator.webForm", "generator.flowForm"}, mode = SaMode.OR) + public ActionResult RollbackTemplate(@PathVariable("id") String id) { + VisualdevReleaseEntity releaseEntity = visualdevReleaseService.getById(id); + boolean b = releaseEntity == null; + if (b) { + return ActionResult.fail(MsgCode.VS008.get()); + } else { + VisualdevEntity visualdevEntity = JsonUtil.getJsonToBean(releaseEntity, VisualdevEntity.class); + visualdevService.updateById(visualdevEntity); + } + return ActionResult.success(MsgCode.SU020.get()); + } + + @Operation(summary = "获取已发布菜单") + @Parameters({ + @Parameter(name = "id", description = "主键"), + }) + @GetMapping("/{id}/getReleaseMenu") + @SaCheckPermission(value = {"onlineDev.webDesign", "generator.webForm", "generator.flowForm"}, mode = SaMode.OR) + public ActionResult getReleaseMenu(@PathVariable("id") String id) { + VisualdevEntity entity = visualdevService.getById(id); + if (entity != null) { + VisualFunctionModel model = JsonUtil.getJsonToBean(entity, VisualFunctionModel.class); + model.setAppIsRelease(0); + model.setPcIsRelease(0); + ModuleNameVO moduleNameVO = moduleService.getModuleNameList(entity.getId()); + if (moduleNameVO != null) { + if (StringUtil.isNotEmpty(moduleNameVO.getPcNames())) { + model.setPcIsRelease(1); + model.setPcReleaseName(moduleNameVO.getPcNames()); + } + if (StringUtil.isNotEmpty(moduleNameVO.getAppNames())) { + model.setAppIsRelease(1); + model.setAppReleaseName(moduleNameVO.getAppNames()); + } + } + return ActionResult.success(model); + } + return ActionResult.fail(MsgCode.FA012.get()); + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-controller/src/main/java/com/yunzhupaas/base/controller/VisualdevShortLinkController.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-controller/src/main/java/com/yunzhupaas/base/controller/VisualdevShortLinkController.java new file mode 100644 index 0000000..d7b8e70 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-controller/src/main/java/com/yunzhupaas/base/controller/VisualdevShortLinkController.java @@ -0,0 +1,375 @@ +package com.yunzhupaas.base.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import com.alibaba.fastjson.JSONObject; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.model.ColumnDataModel; +import com.yunzhupaas.base.model.OnlineImport.VisualdevModelDataInfoVO; +import com.yunzhupaas.base.model.VisualDevJsonModel; +import com.yunzhupaas.base.model.VisualWebTypeEnum; +import com.yunzhupaas.model.OnlineDevData; +import com.yunzhupaas.onlinedev.model.*; +import com.yunzhupaas.util.NoDataSourceBind; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.entity.VisualdevReleaseEntity; +import com.yunzhupaas.base.entity.VisualdevShortLinkEntity; +import com.yunzhupaas.base.model.shortLink.*; +import com.yunzhupaas.base.service.VisualdevReleaseService; +import com.yunzhupaas.base.service.VisualdevService; +import com.yunzhupaas.base.service.VisualdevShortLinkService; +import com.yunzhupaas.base.util.VisualUtil; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.consts.DeviceType; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.exception.LoginException; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.onlinedev.service.VisualDevInfoService; +import com.yunzhupaas.onlinedev.service.VisualDevListService; +import com.yunzhupaas.onlinedev.service.VisualdevModelDataService; +import com.yunzhupaas.onlinedev.util.onlineDevUtil.OnlinePublicUtils; +import com.yunzhupaas.onlinedev.util.onlineDevUtil.OnlineSwapDataUtils; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.context.RequestContext; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import jakarta.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.sql.SQLException; +import java.text.ParseException; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * 在线开发表单外链Controller + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/12/30 11:33:17 + */ +@Tag(name = "表单外链" , description = "BaseShortLink" ) +@RestController +@RequestMapping("/api/visualdev/ShortLink" ) +public class VisualdevShortLinkController extends SuperController { + + @Autowired + private VisualdevShortLinkService visualdevShortLinkService; + + @Autowired + private ConfigValueUtil configValueUtil; + + @Autowired + protected AuthUtil authUtil; + + @Autowired + private VisualdevService visualdevService; + @Autowired + private VisualdevReleaseService visualdevReleaseService; + @Autowired + private VisualdevModelDataService visualdevModelDataService; + @Autowired + private OnlineSwapDataUtils onlineSwapDataUtils; + @Autowired + private VisualDevListService visualDevListService; + @Autowired + private VisualDevInfoService visualDevInfoService; + + @Operation(summary = "获取外链信息" ) + @Parameters({ + @Parameter(name = "id" , description = "主键" ), + }) + @GetMapping("/{id}" ) + @SaCheckPermission("onlineDev.webDesign" ) + public ActionResult getInfo(@PathVariable("id" ) String id) { + VisualdevShortLinkEntity info = visualdevShortLinkService.getById(id); + VisualdevShortLinkVo vo; + if (info != null) { + vo = JsonUtil.getJsonToBean(info, VisualdevShortLinkVo.class); + vo.setAlreadySave(true); + } else { + vo = new VisualdevShortLinkVo(); + vo.setId(id); + } + vo.setFormLink(geturl(id, "form" )); + vo.setColumnLink(geturl(id, "list" )); + return ActionResult.success(vo); + } + + /** + * 获取url + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2023/3/9 + */ + private String geturl(String id, String type) { + String url = configValueUtil.getApiDomain() + "/api/visualdev/ShortLink/trigger/" + id + "?encryption="; + UserInfo userInfo = UserProvider.getUser(); + JSONObject obj = new JSONObject(); + obj.put("type" , type); + if (configValueUtil.isMultiTenancy()) { + obj.put("tenantId" , userInfo.getTenantId()); + } + //参数加密 + String encryption = DesUtil.aesOrDecode(obj.toJSONString(), true,true); + url += encryption; + return url; + } + + + @Operation(summary = "修改外链信息" ) + @PutMapping("" ) + @SaCheckPermission("onlineDev.webDesign" ) + public ActionResult saveOrupdate(@RequestBody VisualdevShortLinkForm data) { + VisualdevShortLinkEntity entity = JsonUtil.getJsonToBean(data, VisualdevShortLinkEntity.class); + if(entity.getFormLink().contains(configValueUtil.getApiDomain())){ + entity.setFormLink(entity.getFormLink().replace(configValueUtil.getApiDomain(),"")); + } + if(entity.getColumnLink().contains(configValueUtil.getApiDomain())){ + entity.setColumnLink(entity.getColumnLink().replace(configValueUtil.getApiDomain(),"")); + } + VisualdevShortLinkEntity info = visualdevShortLinkService.getById(data.getId()); + UserInfo userInfo = UserProvider.getUser(); + if (info != null) { + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(userInfo.getUserId()); + } else { + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(userInfo.getUserId()); + } + + String pcLink = "/formShortLink"; + String appLink ="/pages/formShortLink/index"; + entity.setRealPcLink(pcLink); + entity.setRealAppLink(appLink); + entity.setUserId(userInfo.getUserId()); + visualdevShortLinkService.saveOrUpdate(entity); + return ActionResult.success(MsgCode.SU002.get()); + } + + /** + * 参数解密切换数据源 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2023/3/9 + */ + private VisualdevShortLinkModel aesDecodeMatchDatabase(String encryption) throws LoginException { + //参数解密 + String str = DesUtil.aesOrDecode(encryption, false,true); + if (StringUtil.isEmpty(str)) { + throw new LoginException(MsgCode.VS009.get()); + } + VisualdevShortLinkModel model = JsonUtil.getJsonToBean(str, VisualdevShortLinkModel.class); + if (configValueUtil.isMultiTenancy()) { + if (StringUtil.isNotEmpty(model.getTenantId())) { + //切换成租户库 + TenantDataSourceUtil.switchTenant(model.getTenantId()); + } else { + throw new LoginException(MsgCode.LOG115.get()); + } + } + return model; + } + + @NoDataSourceBind + @Operation(summary = "外链请求入口" ) + @Parameters({ + @Parameter(name = "id" , description = "主键" ), + }) + @GetMapping("/trigger/{id}" ) + public ActionResult getlink(@PathVariable("id" ) String id, + @RequestParam(value = "encryption" ) String encryption, + HttpServletResponse response) throws LoginException, IOException { + VisualdevShortLinkModel model = aesDecodeMatchDatabase(encryption); + String link = ""; + VisualdevShortLinkEntity entity = visualdevShortLinkService.getById(id); + DeviceType deviceType = UserProvider.getDeviceForAgent(); + if (entity != null) { + if (DeviceType.PC.equals(deviceType)) { + link = configValueUtil.getFrontDomain() + entity.getRealPcLink(); + } else { + link = configValueUtil.getAppDomain() + entity.getRealAppLink(); + } + } else { + return ActionResult.fail(MsgCode.VS010.get()); + } + JSONObject obj = new JSONObject(); + obj.put("modelId" , id); + obj.put("type" , model.getType()); + if (configValueUtil.isMultiTenancy()) { + obj.put("tenantId" , model.getTenantId()); + } + //新链接参数加密 + String encryptionNew = DesUtil.aesOrDecode(obj.toJSONString(), true,true); + link += "?encryption=" + encryptionNew; +// link += "&modelId=" + id; + response.sendRedirect(link); + return ActionResult.success(MsgCode.SU000.get()); + } + + @NoDataSourceBind + @Operation(summary = "获取外链配置" ) + @Parameters({ + @Parameter(name = "id" , description = "主键" ), + }) + @GetMapping("/getConfig/{id}" ) + public ActionResult getConfig(@PathVariable("id" ) String id, @RequestParam("encryption" ) String encryption) throws LoginException { + aesDecodeMatchDatabase(encryption); + + VisualdevShortLinkEntity info = visualdevShortLinkService.getById(id); + VisualdevShortLinkConfigVo vo = JsonUtil.getJsonToBean(info, VisualdevShortLinkConfigVo.class); + vo.setFormLink(geturl(id, "form" )); + vo.setColumnLink(geturl(id, "list" )); + return ActionResult.success(vo); + } + + @NoDataSourceBind + @Operation(summary = "密码验证" ) + @PostMapping("/checkPwd" ) + public ActionResult checkPwd(@RequestBody VisualdevShortLinkPwd form) throws LoginException { + //参数解密 + VisualdevShortLinkModel model = aesDecodeMatchDatabase(form.getEncryption()); + + VisualdevShortLinkEntity info = visualdevShortLinkService.getById(form.getId()); + boolean flag = false; + if (OnlineDevData.STATE_ENABLE.equals(info.getFormPassUse()) && 0 == form.getType()) { + if (Md5Util.getStringMd5(info.getFormPassword()).equals(form.getPassword())) { + flag = true; + } + } else if (OnlineDevData.STATE_ENABLE.equals(info.getColumnPassUse()) && 1 == form.getType()) { + if (Md5Util.getStringMd5(info.getColumnPassword()).equals(form.getPassword())) { + flag = true; + } + } + if (flag) { + return ActionResult.success(); + } + return ActionResult.fail(MsgCode.VS011.get()); + } + + @NoDataSourceBind + @Operation(summary = "获取列表表单配置JSON" ) + @GetMapping("/{modelId}/Config" ) + public ActionResult getData(@PathVariable("modelId" ) String modelId, @RequestParam(value = "type" , required = false) String type, + @RequestParam("encryption" ) String encryption) throws WorkFlowException, LoginException { + aesDecodeMatchDatabase(encryption); + VisualdevEntity entity; + //线上版本 + if ("0".equals(type)) { + entity = visualdevService.getInfo(modelId); + } else { + VisualdevReleaseEntity releaseEntity = visualdevReleaseService.getById(modelId); + entity = JsonUtil.getJsonToBean(releaseEntity, VisualdevEntity.class); + } + if (entity == null) { + return ActionResult.fail(MsgCode.VS012.get()); + } + + String s = VisualUtil.checkPublishVisualModel(entity, MsgCode.VS005.get()); + if (s != null) { + return ActionResult.fail(s); + } + DataInfoVO vo = JsonUtil.getJsonToBean(entity, DataInfoVO.class); + return ActionResult.success(vo); + } + + @NoDataSourceBind + @Operation(summary = "外链数据列表" ) + @Parameters({ + @Parameter(name = "modelId" , description = "模板id" ), + }) + @PostMapping("/{modelId}/ListLink" ) + public ActionResult ListLink(@PathVariable("modelId" ) String modelId, @RequestParam("encryption" ) String encryption, + @RequestBody PaginationModel paginationModel) throws WorkFlowException, LoginException { + aesDecodeMatchDatabase(encryption); + + VisualdevReleaseEntity visualdevEntity = visualdevReleaseService.getById(modelId); + VisualDevJsonModel visualJsonModel = OnlinePublicUtils.getVisualJsonModel(visualdevEntity); + //判断请求客户端来源 + if (!RequestContext.isOrignPc()) { + visualJsonModel.setColumnData(visualJsonModel.getAppColumnData()); + } + List> realList; + if (VisualWebTypeEnum.DATA_VIEW.getType().equals(visualdevEntity.getWebType())) {// + //数据视图的接口数据获取、 + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(visualdevEntity.getColumnData(), ColumnDataModel.class); + realList = onlineSwapDataUtils.getInterfaceData(visualdevEntity, paginationModel, columnDataModel); + } else { + realList = visualDevListService.getDataListLink(visualJsonModel, paginationModel); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(paginationModel, PaginationVO.class); + return ActionResult.page(realList, paginationVO); + } + + @NoDataSourceBind + @Operation(summary = "获取数据信息(带转换数据)" ) + @Parameters({ + @Parameter(name = "modelId" , description = "模板id" ), + @Parameter(name = "id" , description = "数据id" ), + }) + @GetMapping("/{modelId}/{id}/DataChange" ) + public ActionResult infoWithDataChange(@PathVariable("modelId" ) String modelId, @PathVariable("id" ) String id, + @RequestParam("encryption" ) String encryption) throws DataException, ParseException, IOException, SQLException, LoginException { + aesDecodeMatchDatabase(encryption); + + modelId = XSSEscape.escape(modelId); + id = XSSEscape.escape(id); + VisualdevEntity visualdevEntity = visualdevService.getReleaseInfo(modelId); + //有表 + if (!StringUtil.isEmpty(visualdevEntity.getVisualTables()) && !OnlineDevData.TABLE_CONST.equals(visualdevEntity.getVisualTables())) { + VisualdevModelDataInfoVO vo = visualDevInfoService.getDetailsDataInfo(id, visualdevEntity); + return ActionResult.success(vo); + } + //无表 + VisualdevModelDataInfoVO vo = visualdevModelDataService.infoDataChange(id, visualdevEntity); + return ActionResult.success(vo); + } + + //**********以下微服务和单体不同 + @NoDataSourceBind + @Operation(summary = "添加数据" ) + @Parameters({ + @Parameter(name = "modelId" , description = "模板id" ), + @Parameter(name = "visualdevModelDataCrForm" , description = "功能数据创建表单" ), + }) + @PostMapping("/{modelId}" ) + public ActionResult create(@PathVariable("modelId" ) String modelId, @RequestParam("encryption" ) String encryption, + @RequestBody VisualdevModelDataCrForm visualdevModelDataCrForm) throws WorkFlowException, LoginException { + VisualdevShortLinkModel visualdevShortLinkModel = aesDecodeMatchDatabase(encryption); + VisualdevShortLinkEntity info = visualdevShortLinkService.getById(modelId); + if (1 != info.getFormUse()) { + return ActionResult.fail(MsgCode.VS013.get()); + } + String tenantId=visualdevShortLinkModel.getTenantId(); + try { + if (configValueUtil.isMultiTenancy()) { + if (StringUtil.isNotEmpty(tenantId)) { + //切换成租户库 + TenantDataSourceUtil.switchTenant(tenantId); + } else { + return ActionResult.fail(MsgCode.LOG115.get()); + } + } + VisualdevEntity visualdevEntity = visualdevService.getReleaseInfo(modelId); + Map map = JsonUtil.stringToMap(visualdevModelDataCrForm.getData()); + visualdevModelDataService.visualCreate(VisualParamModel.builder().visualdevEntity(visualdevEntity).data(map).isLink(true).build()); + }catch (Exception e){ + throw new WorkFlowException(e.getMessage(), e); + } + return ActionResult.success(MsgCode.SU001.get()); + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/pom.xml b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/pom.xml new file mode 100644 index 0000000..f404a61 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/pom.xml @@ -0,0 +1,27 @@ + + + + yunzhupaas-visualdev-base + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-visualdev-base-entity + + + + com.yunzhupaas + yunzhupaas-common-all + ${project.version} + + + com.yunzhupaas + yunzhupaas-permission-entity + ${project.version} + + + + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/entity/BillNumEntity.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/entity/BillNumEntity.java new file mode 100644 index 0000000..6719db8 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/entity/BillNumEntity.java @@ -0,0 +1,55 @@ +package com.yunzhupaas.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * 单据递增序号 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/9/3 14:08:03 + */ +@Data +@TableName("base_bill_num") +public class BillNumEntity extends SuperEntity { + + /** + * 单据规则id + */ + @TableField("f_rule_id") + private String ruleId; + + /** + * 功能id + */ + @TableField("f_visual_id") + private String visualId; + + /** + * 流程模板id + */ + @TableField("f_flow_id") + private String flowId; + + /** + * 时间规则类型 + */ + @TableField("f_rule_config") + private String ruleConfig; + + /** + * 时间规则值:用于判断是否重置 + */ + @TableField("f_date_value") + private String dateValue; + + /** + * 单据递增序号 + */ + @TableField("f_num") + private Integer num; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/entity/FilterEntity.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/entity/FilterEntity.java new file mode 100644 index 0000000..6b76aa6 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/entity/FilterEntity.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + + +@Data +@TableName("base_visual_filter") +public class FilterEntity extends SuperExtendEntity { + /** + * 在线和代码生成记录主键 + */ + @TableField("F_MODULE_ID") + private String moduleId; + + /** + * 过滤配置 + */ + @TableField("F_CONFIG") + private String config; + + /** + * 过滤配置app + */ + @TableField("F_CONFIG_APP") + private String configApp; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/entity/FlowFormRelationEntity.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/entity/FlowFormRelationEntity.java new file mode 100644 index 0000000..58d42dd --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/entity/FlowFormRelationEntity.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * 流程表单关联表 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/10/26 15:58:02 + */ +@Data +@TableName("flow_form_relation") +public class FlowFormRelationEntity extends SuperExtendEntity { + + /** + * 流程版本id + */ + @TableField("F_FLOW_ID") + private String flowId; + /** + * 表单id + */ + @TableField("F_FORM_ID") + private String formId; + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/entity/VisualAliasEntity.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/entity/VisualAliasEntity.java new file mode 100644 index 0000000..fb8ad95 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/entity/VisualAliasEntity.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.base.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +@Data +@TableName("base_visual_alias") +public class VisualAliasEntity extends SuperEntity { + /** + * 功能表单id + */ + @TableField("F_VISUAL_ID") + private String visualId; + /** + * 表或字段别名 + */ + @TableField("F_ALIAS_NAME") + private String aliasName; + /** + * 表名称 + */ + @TableField("F_TABLE_NAME") + private String tableName; + /** + * 字段名称 + */ + @TableField("F_FIELD_NAME") + private String fieldName; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/entity/VisualdevEntity.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/entity/VisualdevEntity.java new file mode 100644 index 0000000..5e8e525 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/entity/VisualdevEntity.java @@ -0,0 +1,123 @@ +package com.yunzhupaas.base.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.alibaba.fastjson.annotation.JSONField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * + * 可视化开发功能表 + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-04-02 + */ +@Data +@TableName("base_visual_dev") +public class VisualdevEntity extends SuperExtendEntity.SuperExtendDEEntity { + /** + * 名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + + /** + * 编码 + */ + @TableField("F_EN_CODE") + private String enCode; + + /** + * 状态(0-暂存(默认),1-发布) + */ + @TableField("F_STATE") + private Integer state; + + /** + * 类型:1-自定义表单,2-系统表单(有实体代码的) + */ + @TableField("F_TYPE") + private Integer type; + + /** + * 关联的表 + */ + @TableField("F_TABLES_DATA") + @JSONField(name = "tables") + private String visualTables; + + /** + * 分类(数据字典) + */ + @TableField("F_CATEGORY") + private String category; + + /** + * 表单配置JSON + */ + @TableField("F_FORM_DATA") + private String formData; + + /** + * 列表配置JSON + */ + @TableField("F_COLUMN_DATA") + private String columnData; + + /** + * 关联数据连接id + */ + @TableField("F_DB_LINK_ID") + private String dbLinkId; + + /** + * 页面类型(1、纯表单,2、表单加列表,4、数据视图) + */ + @TableField("F_WEB_TYPE") + private Integer webType; + + /** + * app列表配置JSON + */ + @TableField("F_APP_COLUMN_DATA") + private String appColumnData; + + /** + * 接口id + */ + @TableField("F_INTERFACE_ID") + private String interfaceId; + + /** + * 接口参数 + */ + @TableField("F_INTERFACE_PARAM") + private String interfaceParam; + + /** + * 发布时勾选平台类型 + */ + @TableField("F_PLATFORM_RELEASE" ) + private String platformRelease; + + //以下系统表单属性 + /** + * Web地址 + */ + @TableField("F_URL_ADDRESS") + private String urlAddress; + /** + * APP地址 + */ + @TableField("F_APP_URL_ADDRESS") + private String appUrlAddress; + /** + * 接口路径 + */ + @TableField("F_INTERFACE_URL") + private String interfaceUrl; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/entity/VisualdevReleaseEntity.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/entity/VisualdevReleaseEntity.java new file mode 100644 index 0000000..37bf39b --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/entity/VisualdevReleaseEntity.java @@ -0,0 +1,123 @@ +package com.yunzhupaas.base.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; + +import java.util.Date; + +/** + * 可视化功能草稿 + * @version V5.2.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @author 云筑产品开发平台组 + * @date 2024/3/16 + */ +@Data +@TableName("base_visual_release") +public class VisualdevReleaseEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + + /** + * 编码 + */ + @TableField("F_EN_CODE") + private String enCode; + + /** + * 状态(0-暂存(默认),1-发布) + */ + @TableField("F_STATE") + private Integer state; + + /** + * 类型(1-表单设计,2-系统表单) + */ + @TableField("F_TYPE") + private Integer type; + + /** + * 关联的表 + */ + @TableField("F_TABLES_DATA") + @JSONField(name = "tables") + private String visualTables; + + /** + * 分类(数据字典) + */ + @TableField("F_CATEGORY") + private String category; + + /** + * 表单配置JSON + */ + @TableField("F_FORM_DATA") + private String formData; + + /** + * 列表配置JSON + */ + @TableField("F_COLUMN_DATA") + private String columnData; + + /** + * 关联数据连接id + */ + @TableField("F_DB_LINK_ID") + private String dbLinkId; + + /** + * 页面类型(1、纯表单,2、表单加列表,4、数据视图) + */ + @TableField("F_WEB_TYPE") + private Integer webType; + + /** + * app列表配置JSON + */ + @TableField("F_APP_COLUMN_DATA") + private String appColumnData; + + /** + * 接口id + */ + @TableField("F_INTERFACE_ID") + private String interfaceId; + + /** + * 接口参数 + */ + @TableField("F_INTERFACE_PARAM") + private String interfaceParam; + + //以下系统表单属性 + /** + * Web地址 + */ + @TableField("F_URL_ADDRESS") + private String urlAddress; + /** + * APP地址 + */ + @TableField("F_APP_URL_ADDRESS") + private String appUrlAddress; + /** + * 接口路径 + */ + @TableField("F_INTERFACE_URL") + private String interfaceUrl; + + /** + * 已发布旧版本信息 + */ + @TableField("F_OLD_CONTENT") + private String oldContent; +} + + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/entity/VisualdevShortLinkEntity.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/entity/VisualdevShortLinkEntity.java new file mode 100644 index 0000000..3129f14 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/entity/VisualdevShortLinkEntity.java @@ -0,0 +1,110 @@ +package com.yunzhupaas.base.entity; + +import com.yunzhupaas.base.entity.SuperEntity; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +/** + * 在线开发表单外链实体 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/12/30 11:10:44 + */ +@Data +@TableName("base_visual_link") +public class VisualdevShortLinkEntity extends SuperExtendEntity.SuperExtendEnabledEntity { + + /** + * 短链接 + */ + @TableField("F_SHORT_LINK") + private String shortLink; + + /** + * 外链填单开关 + */ + @TableField("F_FORM_USE") + private Integer formUse; + + /** + * 外链填单 + */ + @TableField("F_FORM_LINK") + private String formLink; + + /** + * 外链密码开关 + */ + @TableField("F_FORM_PASS_USE") + private Integer formPassUse; + + /** + * 外链填单密码 + */ + @TableField("F_FORM_PASSWORD") + private String formPassword; + + /** + * 公开查询开关 + */ + @TableField("F_COLUMN_USE") + private Integer columnUse; + + /** + * 公开查询 + */ + @TableField("F_COLUMN_LINK") + private String columnLink; + + /** + * 查询密码开关 + */ + @TableField("F_COLUMN_PASS_USE") + private Integer columnPassUse; + + /** + * 公开查询密码 + */ + @TableField("F_COLUMN_PASSWORD") + private String columnPassword; + + /** + * 查询条件 + */ + @TableField("F_COLUMN_CONDITION") + private String columnCondition; + + /** + * 显示内容 + */ + @TableField("F_COLUMN_TEXT") + private String columnText; + + /** + * PC端链接 + */ + @TableField("F_REAL_PC_LINK") + private String realPcLink; + + /** + * App端链接 + */ + @TableField("F_REAL_APP_LINK") + private String realAppLink; + + /** + * 用户id + */ + @TableField("F_USER_ID") + private String userId; + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/CheckFormModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/CheckFormModel.java new file mode 100644 index 0000000..b373589 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/CheckFormModel.java @@ -0,0 +1,42 @@ +package com.yunzhupaas.base.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.database.model.entity.DbLinkEntity; +import com.yunzhupaas.model.visualJson.FieLdsModel; +import com.yunzhupaas.model.visualJson.TableModel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; +import java.util.Map; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@Schema(description = "验证参数模型") +public class CheckFormModel { + @Schema(description = "表单字段") + private List formFieldList; + @Schema(description = "数据") + private Map dataMap; + @Schema(description = "连接") + private DbLinkEntity linkEntity; + @Schema(description = "表列表") + private List tableModelList; + @Schema(description = "表单信息") + private VisualdevEntity visualdevEntity; + @Schema(description = "表单id值") + private String id; + @Schema(description = "是否数据传递") + @Builder.Default + private Boolean isTransfer = false; + + @Schema(description = "是否外链") + @Builder.Default + private Boolean isLink = false; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/ColumnDataModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/ColumnDataModel.java new file mode 100644 index 0000000..10ad54b --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/ColumnDataModel.java @@ -0,0 +1,137 @@ +package com.yunzhupaas.base.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.model.Template6.BtnData; +import com.yunzhupaas.database.model.superQuery.SuperJsonModel; +import com.yunzhupaas.model.visualJson.config.HeaderModel; +import com.yunzhupaas.model.visualJson.config.TabConfigModel; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/16 8:47 + */ +@Data +@Schema(description = "") +public class ColumnDataModel { + private String searchList; + private String printIds; + private Boolean hasDefaultValue = false; + private Boolean hasSuperQuery = false; + /** + * 合计配置 + */ + private boolean showSummary; + /** + * 合计字段 + */ + private List summaryField = new ArrayList<>(); + /** + * 子表展示样式 + */ + private Integer childTableStyle = 1; + private String columnOptions; + private String columnList; + private String defaultColumnList; + private String sortList; + /** + * 1普通,2左侧树,3分组,4编辑,5树形 + */ + private Integer type; + private String defaultSidx; + private String sort; + private Boolean hasPage; + private Integer pageSize; + private String treeTitle; + private String treeDataSource; + private String treeDictionary; + private String treeRelation; + private String treePropsUrl; + private String treePropsValue; + private String treePropsChildren; + private String treePropsLabel; + private String isLeaf; + private String groupField; + private List btnsList = new ArrayList<>(); + private List columnBtnsList = new ArrayList<>(); + private String uploaderTemplateJson; + /** + * 自定义按钮区 + */ + private String customBtnsList; + /** + * 列表权限 + */ + private Boolean useColumnPermission; + /** + * 表单权限 + */ + private Boolean useFormPermission; + /** + * 按钮权限 + */ + private Boolean useBtnPermission; + /** + * 数据权限 + */ + private Boolean useDataPermission; + + //以下树形列表属性,type=5的情况 + /** + * 同步异步(0:同步,1:异步) + */ + private Integer treeLazyType = 0; + + /** + * 父级字段 + */ + private String parentField; + /** + * 子级字段 + */ + private String subField; + + /** + * 左侧树同步异步 + */ + private Integer treeSynType; + /** + * 左侧树查询 + */ + private Boolean hasTreeQuery; + + private String treeInterfaceId; + private String treeTemplateJson; + + + private SuperJsonModel ruleList = new SuperJsonModel(); + private SuperJsonModel ruleListApp = new SuperJsonModel(); + private List complexHeaderList = new ArrayList<>(); + + /** + * 千分位开关 + */ + private boolean thousands = false; + /** + * 千分位字段列表 + */ + private List thousandsField = new ArrayList<>(); + /** + * 默认排序列表 + */ + private Object defaultSortConfig; + /** + * 标签面板属性 + */ + private TabConfigModel tabConfig; + /** + * 视图主键 + */ + private String viewKey; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/DownloadCodeForm.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/DownloadCodeForm.java new file mode 100644 index 0000000..05c6794 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/DownloadCodeForm.java @@ -0,0 +1,34 @@ +package com.yunzhupaas.base.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(description = "下载代码表单") +public class DownloadCodeForm { + + @Schema(description = "所属模块") + private String module; + + @Schema(description = "模块包名") + private String modulePackageName; + + @Schema(description = "主功能备注") + private String description; + + @Schema(description = "数据源id") + private String dataSourceId; + + @Schema(description = "主表表名:用于文件夹创建") + private String mainClassName; + + @Schema(description = "是否流程:0否,1-是") + private Integer enableFlow; + + @Schema(description = "是否对比:-true,false") + private boolean contrast = false; +} + + + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/ExportSelectedModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/ExportSelectedModel.java new file mode 100644 index 0000000..c995aef --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/ExportSelectedModel.java @@ -0,0 +1,13 @@ +package com.yunzhupaas.base.model; +import lombok.Data; + +import java.util.List; + +@Data +public class ExportSelectedModel { + private String tableField; + private String field; + private String label; + private List selectedModelList; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/FormDataField.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/FormDataField.java new file mode 100644 index 0000000..576abfe --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/FormDataField.java @@ -0,0 +1,15 @@ +package com.yunzhupaas.base.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(description="表单字段") +public class FormDataField { + @Schema(description = "key") + private String vModel; + @Schema(description = "名称") + private String label; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/OnlineImport/ExcelImportModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/OnlineImport/ExcelImportModel.java new file mode 100644 index 0000000..9d6ce48 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/OnlineImport/ExcelImportModel.java @@ -0,0 +1,46 @@ +package com.yunzhupaas.base.model.OnlineImport; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * + * 在线开发导入数据结果集 + * @author 云筑产品开发平台组 + * @version V3.4.3 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2022/9/6 + */ +@Data +public class ExcelImportModel { + /** + * 导入成功条数 + */ + private int snum; + /** + * 导入失败条数 + */ + private int fnum; + /** + * 导入结果状态(0,成功 1,失败) + */ + private int resultType; + + /** + * 失败结果 + */ + private List> failResult; + + /** + * 数据字段 + */ + private List> headerRow; + + /** + * 集成调用哦个 + */ + private List dataInfoList = new ArrayList<>(); +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/OnlineImport/ImportDataModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/OnlineImport/ImportDataModel.java new file mode 100644 index 0000000..214f14c --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/OnlineImport/ImportDataModel.java @@ -0,0 +1,13 @@ +package com.yunzhupaas.base.model.OnlineImport; + +import lombok.Data; + +import java.util.HashMap; +import java.util.Map; + +@Data +public class ImportDataModel { + private String id; + private Map resultData = new HashMap<>(); +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/OnlineImport/ImportExcelFieldModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/OnlineImport/ImportExcelFieldModel.java new file mode 100644 index 0000000..a209c23 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/OnlineImport/ImportExcelFieldModel.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.base.model.OnlineImport; +import lombok.Data; + +import java.util.List; + +/** + * + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @author 云筑产品开发平台组 + * @date 2024/3/16 + */ +@Data +public class ImportExcelFieldModel { + private String tableField; + private String field; + private String fullName; + private String yunzhupaasKey; + private List children; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/OnlineImport/ImportFormCheckUniqueModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/OnlineImport/ImportFormCheckUniqueModel.java new file mode 100644 index 0000000..c5efa3a --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/OnlineImport/ImportFormCheckUniqueModel.java @@ -0,0 +1,40 @@ +package com.yunzhupaas.base.model.OnlineImport; + +import com.yunzhupaas.database.model.entity.DbLinkEntity; +import com.yunzhupaas.model.visualJson.TableModel; +import lombok.Data; + +import java.sql.Connection; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * 导入验证 表单验证 + * + * @author 云筑产品开发平台组 + * @version V3.4.5 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2022/11/12 + */ +@Data +public class ImportFormCheckUniqueModel { + private boolean isUpdate; + private boolean isMain; + private String id; + private String dbLinkId; + private DbLinkEntity linkEntity; + private String flowId; + private List flowIdList = new ArrayList<>(); + /** + * 主键 + */ + private Connection connection; + private Integer primaryKeyPolicy; + private Boolean logicalDelete = false; + private List importDataModel = new ArrayList<>(); + private List tableModelList; + private List> childMap; + private Integer childIndex; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/OnlineImport/OnlineExportExceptionVO.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/OnlineImport/OnlineExportExceptionVO.java new file mode 100644 index 0000000..2930a0b --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/OnlineImport/OnlineExportExceptionVO.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.base.model.OnlineImport; +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年3月15日09:47:19 + */ +@Data +public class OnlineExportExceptionVO { + private String tableField; + private String field; + private String label; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/OnlineImport/VisualImportModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/OnlineImport/VisualImportModel.java new file mode 100644 index 0000000..cb79dbf --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/OnlineImport/VisualImportModel.java @@ -0,0 +1,34 @@ +package com.yunzhupaas.base.model.OnlineImport; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; +import java.util.Map; + +/** + * 导入失败的数据 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2022/9/6 + */ +@Data +@Schema(description="导入参数") +public class VisualImportModel { + @Schema(description = "数据数组") + private List> list; + + @Schema(description = "流程引擎:模板id") + private String flowId; + + @Schema(description = "菜单ID") + private String menuId; + + private boolean type; + + private String fileName; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/OnlineImport/VisualdevModelDataInfoVO.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/OnlineImport/VisualdevModelDataInfoVO.java new file mode 100644 index 0000000..4e72937 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/OnlineImport/VisualdevModelDataInfoVO.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.base.model.OnlineImport; +import lombok.Data; + +/** + * + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @author 云筑产品开发平台组 + * @date 2024/3/16 + */ +@Data +public class VisualdevModelDataInfoVO { + + private Object id; + private String data; + private String integrateId; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/PaginationVisualdev.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/PaginationVisualdev.java new file mode 100644 index 0000000..cc8fcb1 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/PaginationVisualdev.java @@ -0,0 +1,39 @@ +package com.yunzhupaas.base.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/3/16 + */ +@Data +@Schema(description = "列表查询参数") +public class PaginationVisualdev extends Pagination { + + @Schema(description = "类型") + private Integer type; + + @Schema(description = "关键字") + private String keyword; + + @Schema(description = "表单类型:1-表单,2-列表,4-视图") + private Integer webType; + + @Schema(description = "表单类型:0-普通表单,1-流程表单") + private Integer enableFlow; + + @Schema(description = "类别:字典分类") + private String category; + + @Schema(description = "状态:0-未发布,1-已发布,2-已修改") + private String isRelease; + + @Schema(description = "是否流程启用节点调用") + private Boolean flowStart = false; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/Template6/AuthorityModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/Template6/AuthorityModel.java new file mode 100644 index 0000000..334b3bf --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/Template6/AuthorityModel.java @@ -0,0 +1,30 @@ +package com.yunzhupaas.base.model.Template6; +import lombok.Data; + +/** + * 权限控制字段 + * @author 云筑产品开发平台组 + * @version V3.2 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2021/10/6 + */ +@Data +public class AuthorityModel { + /** + * 列表权限 + */ + private Boolean useColumnPermission; + /** + * 表单权限 + */ + private Boolean useFormPermission; + /** + * 按钮权限 + */ + private Boolean useBtnPermission; + /** + * 数据权限 + */ + private Boolean useDataPermission; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/Template6/BtnData.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/Template6/BtnData.java new file mode 100644 index 0000000..7017540 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/Template6/BtnData.java @@ -0,0 +1,12 @@ +package com.yunzhupaas.base.model.Template6; +import lombok.Data; + +@Data +public class BtnData { + private String value; + private String icon; + private String label; + private boolean show; + private String labelI18nCode; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/Template6/ColumnListField.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/Template6/ColumnListField.java new file mode 100644 index 0000000..e59cd9a --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/Template6/ColumnListField.java @@ -0,0 +1,35 @@ +package com.yunzhupaas.base.model.Template6; + + +import com.yunzhupaas.model.visualJson.FieLdsModel; +import lombok.Data; + +/** + * 列表字段 + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/3/16 + */ +@Data +public class ColumnListField extends FieLdsModel { + /** + * 字段 + */ + private String prop; + /** + * 列名 + */ + private String label; + /** + * 对齐 + */ + private String align; + + private String yunzhupaasKey; + /** + * 是否勾选 + */ + private Boolean checked; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/Template6/IndexGridField6Model.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/Template6/IndexGridField6Model.java new file mode 100644 index 0000000..b741e0e --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/Template6/IndexGridField6Model.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.base.model.Template6; +import lombok.Data; + +/** + * 列表字段 + */ +@Data +public class IndexGridField6Model { + //字段 + private String prop; + //列名 + private String label; + //对齐 + private String align; + //宽度 + private String width; + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/Template6/Template6Model.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/Template6/Template6Model.java new file mode 100644 index 0000000..f1fa741 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/Template6/Template6Model.java @@ -0,0 +1,65 @@ +package com.yunzhupaas.base.model.Template6; + + +import com.yunzhupaas.base.model.Template6.ColumnListField; +import com.yunzhupaas.model.visualJson.TableModel; +import lombok.Data; + +import java.util.List; + +/** + * 多表开发配置 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @author 云筑产品开发平台组 + * @date 2024/3/16 + */ +@Data +public class Template6Model { + /** + * 版本 + */ + private String version = "V3.0.0"; + /** + * 版权 + */ + private String copyright; + /** + * 创建人员 + */ + private String createUser; + /** + * 创建日期 + */ + private String createDate; + /** + * 功能描述 + */ + private String description; + /** + * 子类功能名称 + */ + private String subClassName; + /** + * 主类功能名称 + */ + private String className; + + /** + * tables + */ + /** + * 列表主表 - 字段集合 + */ + private List columnListFields; + + + private String serviceDirectory; + + + /** + * 数据关联 - 集合 + */ + private List dbTableRelation; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/Template7/ChildrenModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/Template7/ChildrenModel.java new file mode 100644 index 0000000..a85424b --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/Template7/ChildrenModel.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.base.model.Template7; + + +import com.yunzhupaas.model.visualJson.FieLdsModel; +import lombok.Data; + +import java.util.List; + +@Data +public class ChildrenModel { + + //子表的属性 + private List childrenList; + //子表名称 + private String className; + //json原始名称 + private String tableModel; + //子表系统控件 + private List systemList; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/Template7/HtmlModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/Template7/HtmlModel.java new file mode 100644 index 0000000..83c78b1 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/Template7/HtmlModel.java @@ -0,0 +1,27 @@ +package com.yunzhupaas.base.model.Template7; + + +import com.yunzhupaas.model.visualJson.FieLdsModel; +import com.yunzhupaas.util.treeutil.SumTree; +import lombok.Data; + +import java.util.List; + +@Data +public class HtmlModel extends SumTree { + + //类型 栅格row,卡片card,子表table,主表mast + private String yunzhupaaskey; + //json原始名称 + private String vmodel; + //主表属性 + private FieLdsModel fieLdsModel; + //子表list属性 + private List tablFieLdsModel; + //控件宽度 + private String span; + //结束 + private String end="0"; + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/Template7/KeyModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/Template7/KeyModel.java new file mode 100644 index 0000000..5f721a5 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/Template7/KeyModel.java @@ -0,0 +1,13 @@ +package com.yunzhupaas.base.model.Template7; +import lombok.Data; + +@Data +public class KeyModel { + //系统自带属性 + private String yunzhupaasKey; + //字段名称 + private String model; + //规则数据 + private String rule; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/Template7/MastModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/Template7/MastModel.java new file mode 100644 index 0000000..c81f45b --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/Template7/MastModel.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.base.model.Template7; + + +import com.yunzhupaas.model.visualJson.FieLdsModel; +import lombok.Data; + +import java.util.List; + +@Data +public class MastModel { + + //主表的属性 + private List mastList; + //系统自带的赋值 + private List keyMastList; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/Template7/Template7DataModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/Template7/Template7DataModel.java new file mode 100644 index 0000000..f3409ed --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/Template7/Template7DataModel.java @@ -0,0 +1,14 @@ +package com.yunzhupaas.base.model.Template7; + + + +import com.yunzhupaas.model.visualJson.FieLdsModel; +import lombok.Data; + +import java.util.List; + +@Data +public class Template7DataModel { + private List fields; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/Template7/Template7Model.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/Template7/Template7Model.java new file mode 100644 index 0000000..9f4d3a5 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/Template7/Template7Model.java @@ -0,0 +1,150 @@ +package com.yunzhupaas.base.model.Template7; + +import com.yunzhupaas.model.visualJson.TableModel; +import lombok.Data; + +import java.util.List; + +/** + * + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @author 云筑产品开发平台组 + * @date 2024/3/16 + */ +@Data +public class Template7Model { + /** + * 版本 + */ + private String version = "V5.2.0"; + /** + * 版权 + */ + private String copyright; + /** + * 创建人员 + */ + private String createUser; + /** + * 创建日期 + */ + private String createDate; + /** + * 功能描述 + */ + private String description; + /** + * 子类功能名称 + */ + private String subClassName; + /** + * 主类功能名称 + */ + private String className; + + /** + * 表 + */ + private String tableName; + + + /** + * 表单页名 + */ + private String formPageName; + /** + * 列表页名 + */ + private String indexPageName; + /** + * 后端目录 + */ + private String serviceDirectory; + /** + * 前端目录 + */ + private String webDirectory; + /** + * 表单标题 + */ + private String formTitle; + /** + * 弹窗类型 + */ + private String formDialog; + /** + * 表单宽度 + */ + private int formWidth; + /** + * 表单高度 + */ + private int formHeight; + /** + * 表单Tabs + */ + private String[] formTabs; + /** + * 列表左边树 - 是否显示 + */ + private int treeIsShow; + /** + * 列表左边树 - 树形标题 + */ + private String treeTitle; + /** + * 列表左边树 - 数据来源 + */ + private String treeDataSource; + /** + * 列表左边树 - 数据字典 + */ + private String treeDictionary; + /** + * 列表左边树 - 数据选择 + */ + private String treePropsUrl; + /** + * 列表左边树 - 主键字段 + */ + private String treePropsValue; + /** + * 列表左边树 - 父级字段 + */ + private String treePropsChildren; + /** + * 列表左边树 - 显示字段 + */ + private String treePropsLabel; + /** + * 列表左边树 - 关联字段 + */ + private String treeRelation; + /** + * 按钮 - 新建 + */ + private String indexBtnAddName; + /** + * 按钮 - 编辑 + */ + private String indexBtnEditName; + /** + * 按钮 - 删除 + */ + private String indexBtnRemoveName; + /** + * 列表 - 标题 + */ + private String indexListTitle; + /** + * 列表 - 分页 + */ + private int indexGridIsPage; + + /** + * 数据关联 - 集合 + */ + private List dbTableRelation; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualAliasForm.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualAliasForm.java new file mode 100644 index 0000000..528c0d6 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualAliasForm.java @@ -0,0 +1,14 @@ +package com.yunzhupaas.base.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.model.visualJson.TableModel; +import lombok.Data; + +import java.util.List; + +@Data +@Schema(description = "命名规范表单") +public class VisualAliasForm { + List tableList; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualConst.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualConst.java new file mode 100644 index 0000000..5ec4afd --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualConst.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.base.model; + +import java.util.Arrays; +import java.util.List; + +/** + * 在线开发变量 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/12/6 10:03:10 + */ +public class VisualConst { + /** + * 数据库全部的 int bigint字段 + */ + public static final List DB_INT_ALL = Arrays.asList("int", "bigint", "number", "integer", "int2", "int4", "int8", "numeric"); +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualDevCrForm.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualDevCrForm.java new file mode 100644 index 0000000..a7392c2 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualDevCrForm.java @@ -0,0 +1,64 @@ +package com.yunzhupaas.base.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @author 云筑产品开发平台组 + * @date 2024/3/16 + */ +@Data +@Schema(description="功能设计创建表单" ) +public class VisualDevCrForm { + @Schema(description = "名称" ) + private String fullName; + @Schema(description = "编码" ) + private String enCode; + @Schema(description = "类型(1-应用开发,2-移动开发,3-流程表单,4-Web表单,5-App表单)" ) + private Integer type; + @Schema(description = "描述" ) + private String description; + @Schema(description = "表单配置JSON" ) + private String formData; + @Schema(description = "列表配置JSON" ) + private String columnData; + @Schema(description = "app列表配置JSON" ) + private String appColumnData; + @Schema(description = "关联的表" ) + private String tables; + @Schema(description = "分类(数据字典维护)" ) + private String category; + @Schema(description = "状态" ) + private Integer state = 0; + @Schema(description = "关联数据连接id" ) + private String dbLinkId; + @Schema(description = "页面类型(1、纯表单,2、表单加列表,3、表单列表工作流、4、数据视图)" ) + private String webType; + @Schema(description = "排序" ) + private Long sortCode; + @Schema(description = "启用流程" ) + private Integer enableFlow; + @Schema(description = "流程引擎json" ) + private String flowTemplateJson; + @Schema(description = "接口id" ) + private String interfaceId; + @Schema(description = "接口名称" ) + private String interfaceName; + @Schema(description = "接口参数" ) + private String interfaceParam; + + //以下系统表单属性 + @Schema(description = "Web地址") + private String urlAddress; + + @Schema(description = "APP地址") + private String appUrlAddress; + + @Schema(description = "接口路径") + private String interfaceUrl; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualDevInfoVO.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualDevInfoVO.java new file mode 100644 index 0000000..13a05ef --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualDevInfoVO.java @@ -0,0 +1,67 @@ +package com.yunzhupaas.base.model; + + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @author 云筑产品开发平台组 + * @date 2024/3/16 + */ +@Data +@Schema(description="功能设计详情模型" ) +public class VisualDevInfoVO { + @Schema(description = "主键" ) + private String id; + @Schema(description = "名称" ) + private String fullName; + @Schema(description = "编码" ) + private String enCode; + @Schema(description = "分类(数据字典维护)" ) + private String category; + @Schema(description = "类型(1-表单设计,2-系统表单)" ) + private Integer type; + @Schema(description = "描述" ) + private String description; + @Schema(description = "表单配置JSON" ) + private String formData; + @Schema(description = "列表配置JSON" ) + private String columnData; + @Schema(description = "app列表配置JSON" ) + private String appColumnData; + @Schema(description = "关联的表" ) + private String tables; + @Schema(description = "状态" ) + private Integer state; + @Schema(description = "关联数据连接id" ) + private String dbLinkId; + @Schema(description = "页面类型(1、纯表单,2、表单加列表,4、数据视图)" ) + private String webType; + @Schema(description = "排序" ) + private Long sortCode; + @Schema(description = "启用流程" ) + private Integer enableFlow; + @Schema(description = "流程引擎json" ) + private String flowTemplateJson; + @Schema(description = "接口id" ) + private String interfaceId; + @Schema(description = "接口名称" ) + private String interfaceName; + @Schema(description = "接口参数" ) + private String interfaceParam; + + //以下系统表单属性 + @Schema(description = "Web地址") + private String urlAddress; + + @Schema(description = "APP地址") + private String appUrlAddress; + + @Schema(description = "接口路径") + private String interfaceUrl; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualDevJsonModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualDevJsonModel.java new file mode 100644 index 0000000..90ae6cc --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualDevJsonModel.java @@ -0,0 +1,86 @@ +package com.yunzhupaas.base.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.database.model.superQuery.SuperJsonModel; +import com.yunzhupaas.model.visualJson.FieLdsModel; +import com.yunzhupaas.model.visualJson.FormDataModel; +import com.yunzhupaas.model.visualJson.TableModel; +import lombok.Builder; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * json格式化对象(在线开发对象) + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/6/14 + */ +@Data +@Schema(description = "功能设计json模型") +public class VisualDevJsonModel { + @Schema(description = "主键") + private String id; + @Schema(description = "名称") + private String fullName; + @Schema(description = "类型(1-应用开发,2-移动开发,3-流程表单,4-Web表单,5-App表单)") + private Integer type; + @Schema(description = "关联的表对象") + private List visualTables; + @Schema(description = "表单配置对象") + private FormDataModel formData; + @Schema(description = "字段配置对象") + private ColumnDataModel columnData; + @Schema(description = "app字段配置对象") + private ColumnDataModel appColumnData; + @Schema(description = "关联数据连接id") + private String dbLinkId; + @Schema(description = "页面类型(1、纯表单,2、表单加列表,3、表单列表工作流、4、数据视图)") + private Integer webType; + @Schema(description = "表单字段列表") + private List formListModels; + @Schema(description = "树形子列表查询") + private boolean isChildSearch = false;//树形子列表查询 + @Schema(description = "树形子列表查询值") + private String childValue;//树形子列表查询值 + @Schema(description = "流程引擎id") + private String flowId; + + @Schema(description = "主表主键") + private String pkeyId;//切库回传 + + @Schema(description = "数据过滤") + private SuperJsonModel ruleQuery = new SuperJsonModel(); + @Schema(description = "高级搜索") + private SuperJsonModel superQuery = new SuperJsonModel(); + @Schema(description = "列表搜索") + private SuperJsonModel query = new SuperJsonModel(); + @Schema(description = "页签查询") + private SuperJsonModel extraQuery = new SuperJsonModel(); + + + @Schema(description = "列表搜索") + private SuperJsonModel keyQuery = new SuperJsonModel(); + + @Schema(description = "数据权限") + private List authorize = new ArrayList<>(); + private List dataIdList = new ArrayList<>(); + + @Schema(description = "是否流程菜单") + private boolean enableFlow; + @Schema(description = "流程版本id列表") + private List flowVersionIds = new ArrayList<>(); + + @Schema(description = "是否外链:true -是") + private Boolean isLinkList = false; + + @Schema(description = "需要判断权限") + private Boolean needPermission = false; + @Schema(description = "权限列表") + private List permissionList; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualDevListVO.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualDevListVO.java new file mode 100644 index 0000000..1d0cded --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualDevListVO.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.base.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * json格式化对象(在线开发对象) + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + */ +@Data +public class VisualDevListVO { + @Schema(description = "主键" ) + private String id; + @Schema(description = "名称" ) + private String fullName; + @Schema(description = "编码" ) + private String enCode; + @Schema(description = "是否启用流程" ) + private Integer enableFlow; + + @Schema(description = "是否引用:0-否,1-是" ) + private Integer isQuote; + @Schema(description = "类型:1-自定义表单,2-系统表单" ) + private Integer type; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualDevPubModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualDevPubModel.java new file mode 100644 index 0000000..103eea9 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualDevPubModel.java @@ -0,0 +1,35 @@ +package com.yunzhupaas.base.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * 同步菜单类型 + * + * @author 云筑产品开发平台组 + * @version V3.4.1 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2022/4/14 + */ +@Data +@Schema(description="发布功能参数" ) +public class VisualDevPubModel { + @Schema(description = "pc" ) + private Integer pc; + @Schema(description = "app" ) + private Integer app; + @Schema(description = "pc菜单父id" ) + private List pcModuleParentId; + @Schema(description = "app菜单父id" ) + private List appModuleParentId; + @Schema(description = "pc系统id" ) + private String pcSystemId; + @Schema(description = "app系统id" ) + private String appSystemId; + @Schema(description = "发布选中平台" ) + private String platformRelease; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualDevUpForm.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualDevUpForm.java new file mode 100644 index 0000000..dfc0305 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualDevUpForm.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.base.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @author 云筑产品开发平台组 + * @date 2024/3/16 + */ +@Data +@Schema(description="功能设计修改表单" ) +public class VisualDevUpForm extends VisualDevCrForm{ +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualFunctionModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualFunctionModel.java new file mode 100644 index 0000000..25cc7e1 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualFunctionModel.java @@ -0,0 +1,98 @@ +package com.yunzhupaas.base.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 可视化列表模型 + * + * @author 云筑产品开发平台组 + * @version V3.2.8 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/11/20 + */ +@Data +@Schema(description="可视化列表模型") +public class VisualFunctionModel { + @Schema(description = "名称" ) + private String fullName; + @Schema(description = "编码" ) + private String enCode; + @Schema(description = "状态" ) + private Integer state; + @Schema(description = "类型(1-应用开发,2-移动开发,3-流程表单,4-Web表单,5-App表单)" ) + private Integer type; + @Schema(description = "关联的表" ) + private String tables; + @Schema(description = "创建时间" ) + private Long creatorTime; + @Schema(description = "创建人" ) + private String creatorUser; + @Schema(description = "创建人id" ) + private String creatorUserId; + @Schema(description = "修改时间" ) + private Long lastModifyTime; + @Schema(description = "修改人" ) + private String lastModifyUser; + @Schema(description = "修改人id" ) + private String lastModifyUserId; + @Schema(description = "排序" ) + private Long sortCode; + @Schema(description = "分类(数据字典维护)" ) + private String category; + @Schema(description = "主键" ) + private String id; + @Schema(description = "页面类型(1、纯表单,2、表单加列表,3、表单列表工作流、4、数据视图)" ) + private Integer webType; + @Schema(description = "pc是否发布" ) + private Integer pcIsRelease; + @Schema(description = "app是否发布" ) + private Integer appIsRelease; + /** + * 是否发布 + */ + @Schema(description = "是否发布" ) + private Integer isRelease; + /** + * 是否启用流程 + */ + @Schema(description = "是否启用流程" ) + private Integer enableFlow; + + /** + * 状态 + */ + @Schema(description = "状态是否启用" ) + private Integer enabledMark; + /** + * 移动锁定0-锁定1-可移动 + */ + @Schema(description = "移动锁定0-未锁定1-锁定" ) + private Integer enabledLock; + + /** + * 是否有包名 + */ + @Schema(description = "是否有包名") + private boolean hasPackage = false; + + @Schema(description = "pc是否发布门户" ) + private Integer pcPortalIsRelease; + @Schema(description = "app是否发布门户" ) + private Integer appPortalIsRelease; + + @Schema(description = "pc已发布菜单名称" ) + private String pcReleaseName; + @Schema(description = "app已发布菜单名称" ) + private String appReleaseName; + + @Schema(description = "pc已发布门户名称" ) + private String pcPortalReleaseName; + @Schema(description = "app已发布门户名称" ) + private String appPortalReleaseName; + + @Schema(description = "发布时勾选平台类型" ) + private String platformRelease; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualLogModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualLogModel.java new file mode 100644 index 0000000..81f1e61 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualLogModel.java @@ -0,0 +1,40 @@ +package com.yunzhupaas.base.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; +import java.util.Map; + +/** + * 日志存储模型 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/8/27 16:05:28 + */ +@Data +@Schema(description = "控件类型") +public class VisualLogModel { + @Schema(description = "字段key") + private String field; + @Schema(description = "字段名称") + private String fieldName; + @Schema(description = "旧数据") + private String oldData; + @Schema(description = "新数据") + private String newData; + @Schema(description = "控件类型") + private String yunzhupaasKey; + @Schema(description = "动作类型:0-新增,1-修改,3-删除,4-清空字段") + private Integer type; + @Schema(description = "显示已修改") + private boolean nameModified; + @Schema(description = "子表字段") + private List> chidField; + @Schema(description = "子表数据") + private List> chidData; + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualTreeModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualTreeModel.java new file mode 100644 index 0000000..9afec9a --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualTreeModel.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.base.model; + +import com.yunzhupaas.util.treeutil.SumTree; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Data +public class VisualTreeModel extends SumTree { + private String fullName; + private Long num; + private String enCode; + private Integer state; + private String type; + private String tables; + private Long creatorTime; + private String creatorUser; + private Long lastModifyTime; + private String lastModifyUser; + private Long sortCode; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualWebTypeEnum.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualWebTypeEnum.java new file mode 100644 index 0000000..24ad649 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualWebTypeEnum.java @@ -0,0 +1,35 @@ +package com.yunzhupaas.base.model; +/** + * 模板类型 + * + * @author 云筑产品开发平台组 + * @version V3.2.9 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2021/12/4 + */ +public enum VisualWebTypeEnum { + /** + * 模板类型 + */ + FORM(1,"表单"), + FORM_LIST(2,"列表"), + DATA_VIEW(4,"视图"); + + VisualWebTypeEnum(Integer type, String modelName) { + this.type = type; + this.modelName = modelName; + } + + public Integer getType() { + return type; + } + + public String getModelName() { + return modelName; + } + + private Integer type; + private String modelName; + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualdevTreeChildModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualdevTreeChildModel.java new file mode 100644 index 0000000..a62776e --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualdevTreeChildModel.java @@ -0,0 +1,15 @@ +package com.yunzhupaas.base.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(description="功能树形模型" ) +public class VisualdevTreeChildModel { + @Schema(description = "主键" ) + private String id; + @Schema(description = "名称" ) + private String fullName; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualdevTreeVO.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualdevTreeVO.java new file mode 100644 index 0000000..a0c9821 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/VisualdevTreeVO.java @@ -0,0 +1,30 @@ +package com.yunzhupaas.base.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @author 云筑产品开发平台组 + * @date 2024/3/16 + */ +@Data +@Schema(description="功能树形VO" ) +public class VisualdevTreeVO { + @Schema(description = "主键" ) + private String id; + @Schema(description = "名称" ) + private String fullName; + @Schema(description = "是否有子集" ) + private Boolean hasChildren; + @Schema(description = "排序" ) + private Long sortCode; + @Schema(description = "子集对象" ) + private List children; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/ai/VisualAiModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/ai/VisualAiModel.java new file mode 100644 index 0000000..601e546 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/ai/VisualAiModel.java @@ -0,0 +1,27 @@ +package com.yunzhupaas.base.model.ai; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.model.ai.AiFormModel; +import lombok.Data; + +import java.util.List; + +/** + * ai模型列表 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/12/2 16:09:38 + */ +@Data +@Schema(description = "ai模型列表") +public class VisualAiModel { + @Schema(description = "模型编码") + private String enCode; + @Schema(description = "模型名称") + private String fullName; + @Schema(description = "ai模型列表") + private List aiModelList; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/filter/FilterInfo.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/filter/FilterInfo.java new file mode 100644 index 0000000..82a1469 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/filter/FilterInfo.java @@ -0,0 +1,12 @@ +package com.yunzhupaas.base.model.filter; +import lombok.Data; + +@Data +public class FilterInfo { + private String id; + private String moduleId; + private String config; + private String deleteMark; + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/filter/FilterQuery.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/filter/FilterQuery.java new file mode 100644 index 0000000..b9bf0e3 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/filter/FilterQuery.java @@ -0,0 +1,14 @@ +package com.yunzhupaas.base.model.filter; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yunzhupaas.base.entity.FilterEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + + +@Data +@EqualsAndHashCode(callSuper = false) +public class FilterQuery extends Page { + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/filter/RuleInfo.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/filter/RuleInfo.java new file mode 100644 index 0000000..d07cc4d --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/filter/RuleInfo.java @@ -0,0 +1,51 @@ +package com.yunzhupaas.base.model.filter; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; + +@Data +public class RuleInfo { + /** + * 字段说明 + */ + private String fieldName; + /** + * 运算符 + */ + private String operator; + /** + * 逻辑拼接符号 + */ + private String logic; + /** + * 组件标识 + */ + private String yunzhupaasKey; + /** + * 字段key + * 数据库字段(对于在线) + */ + private String field; + /** + * 自定义的值 + */ + private String fieldValue; + + private String fieldValue2; + + /** + * 显示类型 + */ + private String showLevel; + + /** + * 日期格式 + */ + private String format; + + @JSONField(name = "symbol") + public void setOperator(String operator) { + this.operator = operator; + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/flow/DataModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/flow/DataModel.java new file mode 100644 index 0000000..b7ef9da --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/flow/DataModel.java @@ -0,0 +1,82 @@ +package com.yunzhupaas.base.model.flow; + + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.model.VisualLogModel; +import com.yunzhupaas.base.model.form.ModuleFormModel; +import com.yunzhupaas.database.model.entity.DbLinkEntity; +import com.yunzhupaas.model.visualJson.FieLdsModel; +import com.yunzhupaas.model.visualJson.TableModel; +import com.yunzhupaas.model.visualJson.analysis.FormAllModel; +import com.yunzhupaas.permission.entity.UserEntity; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; +import java.util.Map; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@Schema(description = "数据模型") +public class DataModel { + @Schema(description = "功能id") + private String visualId; + @Schema(description = "名称") + private Map dataNewMap; + @Schema(description = "字段列表") + private List fieLdsModelList; + @Schema(description = "表列表") + private List tableModelList; + @Schema(description = "解析后字段") + private List formAllModel; + @Schema(description = "主表id") + private String mainId; + @Schema(description = "数据库链接") + private DbLinkEntity link; + @Schema(description = "转换") + private Boolean convert; + @Schema(description = "数据库类型") + private String dbType; + @Schema(description = "用户信息") + private UserEntity userEntity; + //是否开启安全锁 + @Schema(description = "安全锁策略") + @Builder.Default + private Boolean concurrencyLock = false; + @Schema(description = "逻辑删除") + @Builder.Default + private Boolean logicalDelete = false; + @Schema(description = "主键策略") + private Integer primaryKeyPolicy = 1; + @Schema(description = "用户信息") + private UserInfo userInfo; + @Schema(description = "是否外链") + @Builder.Default + private boolean linkOpen = false; + + @Schema(description = "流程表单权限") + private List> flowFormOperates; + + private List listLog; + + @Schema(description = "子表仅修改") + @Builder.Default + private Boolean onlyUpdate = false; + + @Schema(description = "旧的主表数据") + private Map oldMainData; + + + @Schema(description = "需要判断权限") + @Builder.Default + private Boolean needPermission = false; + @Schema(description = "表单权限") + private List formPerList; + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/flow/FlowFormDataModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/flow/FlowFormDataModel.java new file mode 100644 index 0000000..5922711 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/flow/FlowFormDataModel.java @@ -0,0 +1,45 @@ +package com.yunzhupaas.base.model.flow; + + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.permission.entity.UserEntity; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; +import java.util.Map; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@Schema(description="流程表单数据模型") +public class FlowFormDataModel { + @Schema(description = "表单id") + private String formId; + @Schema(description = "主键id") + private String id; + @Schema(description = "流程小版本id") + private String flowId; + @Schema(description = "数据map对象") + private Map map; + @Schema(description = "数据权限") + private List> formOperates; + @Schema(description = "委托人信息") + private UserEntity delegateUser; + + @Schema(description = "是否数据传递") + @Builder.Default + private Boolean isTransfer = false; + + //删除接口参数 + @Schema(description = "表名") + private String tableName; + @Schema(description = "分组间关系") + private String ruleMatchLogic; + @Schema(description = "数据过滤分组") + private List> ruleList; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/flow/FlowLaunchModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/flow/FlowLaunchModel.java new file mode 100644 index 0000000..bfa7506 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/flow/FlowLaunchModel.java @@ -0,0 +1,36 @@ +package com.yunzhupaas.base.model.flow; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.model.TransferModel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@Schema(description = "自定义按钮发起审批参数对象") +public class FlowLaunchModel { + @Schema(description = "流程大id") + private String template; + + @Schema(description = "按钮编码") + private String btnCode; + + @Schema(description = "是否当前用户") + private Integer currentUser; + + @Schema(description = "是否自定义用户") + private Integer customUser; + + @Schema(description = "自定义列表") + private List initiator; + + @Schema(description = "数据列表") + private List> dataList; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/flow/FlowTempInfoModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/flow/FlowTempInfoModel.java new file mode 100644 index 0000000..b38b389 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/flow/FlowTempInfoModel.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.base.model.flow; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:17 + */ +@Data +@Schema(description="流程引擎信息模型") +public class FlowTempInfoModel { + @Schema(description = "编码") + private String enCode; + @Schema(description = "流程引擎id") + private String id; + @Schema(description = "是否启用") + private Integer enabledMark; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/form/DraftJsonModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/form/DraftJsonModel.java new file mode 100644 index 0000000..0e63e59 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/form/DraftJsonModel.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.base.model.form; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(description="流程表单草稿模型") +public class DraftJsonModel { + @Schema(description = "是否必填") + private Boolean required; + @Schema(description = "字段id") + private String filedId; + @Schema(description = "字段名称") + private String filedName; + @Schema(description = "yunzhupaaskey") + private String yunzhupaasKey; + @Schema(description = "是否多选") + private boolean multiple; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/form/FlowFieldModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/form/FlowFieldModel.java new file mode 100644 index 0000000..36854ca --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/form/FlowFieldModel.java @@ -0,0 +1,41 @@ +package com.yunzhupaas.base.model.form; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 流程设计 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/9/23 15:10:27 + */ +@Data +@Accessors(chain = true) +@Schema(description="字段模型") +public class FlowFieldModel { + /** + *__vModel__ + */ + @Schema(description = "字段id") + String filedId; + /** + *__config__.label + */ + @Schema(description = "字段名称") + String filedName; + /** + *__config__.yunzhupaasKey + */ + @Schema(description = "字段yunzhupaaskey") + String yunzhupaasKey; + /** + *__config__.required + */ + @Schema(description = "字段是否必填") + String required; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/form/FlowFormModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/form/FlowFormModel.java new file mode 100644 index 0000000..3833714 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/form/FlowFormModel.java @@ -0,0 +1,87 @@ +package com.yunzhupaas.base.model.form; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 流程表单参数 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/30 18:29 + */ +@Data +@Schema(description="流程表单参数") +public class FlowFormModel { + @Schema(description = "主键") + private String id; + + @Schema(description = "表单编码") + private String enCode; + + @Schema(description = "表单名称") + private String fullName; + + @Schema(description = "流程类型:0-发起流程,1-功能流程") + private Integer flowType; + + @Schema(description = "表单类型:1-系统表单,2-自定义表单") + private Integer formType; + + @Schema(description = "表单分类") + private String category; + + @Schema(description = "Web地址") + private String urlAddress; + + @Schema(description = "APP地址") + private String appUrlAddress; + + @Schema(description = "接口路径") + private String interfaceUrl; + + @Schema(description = "属性字段") + private String propertyJson; + + @Schema(description = "描述") + private String description; + + @Schema(description = "排序码") + private Long sortCode; + + @Schema(description = "有效标志") + private Integer enabledMark; + + @Schema(description = "创建时间") + private Long creatorTime; + + @Schema(description = "创建用户") + private String creatorUserId; + + @Schema(description = "修改时间") + private Long lastModifyTime; + + @Schema(description = "修改用户") + private String lastModifyUserId; + + @Schema(description = "删除标志") + private Integer deleteMark; + + @Schema(description = "删除时间") + private Long deleteTime; + + @Schema(description = "删除用户") + private String deleteUserId; + + @Schema(description = "草稿版本json") + private String draftJson; + + @Schema(description = "关联数据连接id") + private String dbLinkId; + + @Schema(description = "关联的表") + private String tableJson; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/form/FlowFormPage.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/form/FlowFormPage.java new file mode 100644 index 0000000..d5b0c4c --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/form/FlowFormPage.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.base.model.form; + + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import lombok.Data; + +/** + * 流程设计 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/7/1 9:48 + */ +@Schema(description="表单列表查询参数") +@Data +public class FlowFormPage extends Pagination { + private String keyword; + @Schema(description = "流程类型:0-发起流程,1-功能流程") + private Integer flowType; + @Schema(description = "表单类型:1-系统表单,2-自定义表单") + private Integer formType; + @Schema(description = "该参数下拉列表无效") + private Integer enabledMark; + @Schema(description = "状态") + private Integer isRelease; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/form/FlowSelectVo.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/form/FlowSelectVo.java new file mode 100644 index 0000000..0cb8d67 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/form/FlowSelectVo.java @@ -0,0 +1,45 @@ +package com.yunzhupaas.base.model.form; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 流程表单对象 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/30 18:06 + */ +@Data +@Schema(description="流程下拉对象") +public class FlowSelectVo { + @Schema(description = "主键") + private String id; + + @Schema(description = "表单编码") + private String enCode; + + @Schema(description = "表单名称") + private String fullName; + + @Schema(description = "流程类型") + private Integer flowType; + + @Schema(description = "表单类型") + private Integer formType; + + @Schema(description = "表单分类") + private String category; + + @Schema(description = "描述") + private String description; + + @Schema(description = "排序码") + private Long sortCode; + + @Schema(description = "是否引用") + private Boolean isQuote; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/form/FormCheckModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/form/FormCheckModel.java new file mode 100644 index 0000000..71dd0b0 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/form/FormCheckModel.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.base.model.form; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.mybatis.dynamic.sql.select.render.SelectStatementProvider; + +/** + * + * 表单验证 + * @author 云筑产品开发平台组 + * @version V3.4.5 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2022/11/15 + */ +@Data +@Schema(description="表单验证模型") +public class FormCheckModel { + @Schema(description = "名称") + private String label; + @Schema(description = "选择值") + private SelectStatementProvider statementProvider; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/form/FormDraftJsonModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/form/FormDraftJsonModel.java new file mode 100644 index 0000000..edfe27f --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/form/FormDraftJsonModel.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.base.model.form; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 流程设计 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/10/19 14:22:18 + */ +@Data +@Accessors(chain = true) +@Schema(description="表单草稿存储对象模型") +public class FormDraftJsonModel { + @Schema(description = "草稿json") + private String draftJson; + @Schema(description = "表json") + private String tableJson; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/form/VisualTableModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/form/VisualTableModel.java new file mode 100644 index 0000000..877b75b --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/form/VisualTableModel.java @@ -0,0 +1,35 @@ +package com.yunzhupaas.base.model.form; + +import com.alibaba.fastjson.JSONArray; +import com.yunzhupaas.model.visualJson.analysis.FormAllModel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.ArrayList; +import java.util.List; + + +/** + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class VisualTableModel { + private JSONArray jsonArray; + private List formAllModel=new ArrayList<>(); + private String table; + private String linkId; + private String fullName; + private boolean concurrency = false; + private Integer primaryKey = 1; + //逻辑删除 + private Boolean logicalDelete = false; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/read/ReadEnum.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/read/ReadEnum.java new file mode 100644 index 0000000..07967da --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/read/ReadEnum.java @@ -0,0 +1,73 @@ +package com.yunzhupaas.base.model.read; + + +import com.yunzhupaas.util.StringUtil; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/8/20 + */ +public enum ReadEnum { + /** + * 模型 + */ + model("model"), + /** + * 控制器 + */ + controller("controller"), + /** + * 业务层 + */ + service("service"), + /** + * 数据层 + */ + mapper("mapper"), + /** + * 实体 + */ + entity("entity"), + /** + * web + */ + web("web"), + /** + * json + */ + json("json"), + /** + * app + */ + app("app"); + + private String message; + + ReadEnum(String message) { + this.message = message; + } + + public String getMessage() { + return message; + } + + /** + * 根据状态code获取枚举名称 + * + * @return + */ + public static ReadEnum getMessage(String path) { + if (StringUtil.isNotEmpty(path)) { + for (ReadEnum status : ReadEnum.values()) { + if (path.contains(status.getMessage())) { + return status; + } + } + } + return null; + } + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/read/ReadListVO.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/read/ReadListVO.java new file mode 100644 index 0000000..1d90701 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/read/ReadListVO.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.base.model.read; +import lombok.Data; + +import java.util.List; + +/** + * + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @author 云筑产品开发平台组 + * @date 2024/8/20 + */ +@Data +public class ReadListVO { + private String fileName; + private String id; + private List children; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/read/ReadModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/read/ReadModel.java new file mode 100644 index 0000000..c2aa028 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/read/ReadModel.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.base.model.read; +import lombok.Data; + +/** + * + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @author 云筑产品开发平台组 + * @date 2024/8/20 + */ +@Data +public class ReadModel { + private String folderName; + private String fileName; + private String fileContent; + private String oldFileContent; + private String fileType; + private String id; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/shortLink/VisualdevShortLinkConfigVo.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/shortLink/VisualdevShortLinkConfigVo.java new file mode 100644 index 0000000..b9074b3 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/shortLink/VisualdevShortLinkConfigVo.java @@ -0,0 +1,43 @@ +package com.yunzhupaas.base.model.shortLink; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 在线表单外链显示类 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/12/30 11:25:16 + */ +@Data +@Schema(description="外链配置对象") +public class VisualdevShortLinkConfigVo { + @Schema(description = "主键") + private String id; + @Schema(description = "表单开关0-关闭,1-开启") + private Integer formUse = 0; + @Schema(description = "表单密码开关0-关闭,1-开启") + private Integer formPassUse = 0; + @Schema(description = "列表开关0-关闭,1-开启") + private Integer columnUse = 0; + @Schema(description = "列表密码开关0-关闭,1-开启") + private Integer columnPassUse = 0; + @Schema(description = "列表查询字段") + private String columnCondition; + @Schema(description = "列表展示字段") + private String columnText; + @Schema(description = "用户id") + private String userId; + @Schema(description = "租户id") + private String tenantId; + @Schema(description = "是否启用0-关闭1-启用") + private Integer enabledMark; + @Schema(description = "表单外链") + private String formLink; + @Schema(description = "列表外链") + private String columnLink; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/shortLink/VisualdevShortLinkForm.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/shortLink/VisualdevShortLinkForm.java new file mode 100644 index 0000000..8607957 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/shortLink/VisualdevShortLinkForm.java @@ -0,0 +1,45 @@ +package com.yunzhupaas.base.model.shortLink; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 在线表单外链显示类 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/12/30 11:25:16 + */ +@Data +@Schema(description="外链提交表单") +public class VisualdevShortLinkForm { + @Schema(description = "主键") + private String id; + @Schema(description = "短链接key") + private String shortLink; + @Schema(description = "表单开关0-关闭,1-开启") + private Integer formUse; + @Schema(description = "表单外链") + private String formLink; + @Schema(description = "表单密码开关0-关闭,1-开启") + private Integer formPassUse; + @Schema(description = "表单密码") + private String formPassword; + @Schema(description = "列表开关0-关闭,1-开启") + private Integer columnUse; + @Schema(description = "列表外链") + private String columnLink; + @Schema(description = "列表密码开关0-关闭,1-开启") + private Integer columnPassUse; + @Schema(description = "列表密码") + private String columnPassword; + @Schema(description = "列表查询自选") + private String columnCondition; + @Schema(description = "列表展示字段") + private String columnText; + @Schema(description = "是否启用") + private Integer enabledMark; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/shortLink/VisualdevShortLinkModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/shortLink/VisualdevShortLinkModel.java new file mode 100644 index 0000000..09f2705 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/shortLink/VisualdevShortLinkModel.java @@ -0,0 +1,23 @@ +package com.yunzhupaas.base.model.shortLink; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 外链请求参数 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/12/30 16:28:23 + */ +@Data +@Schema(description="外链入口参数") +public class VisualdevShortLinkModel { + @Schema(description = "类型:form-表单,list-列表") + private String type; + @Schema(description = "租户id") + private String tenantId; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/shortLink/VisualdevShortLinkPwd.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/shortLink/VisualdevShortLinkPwd.java new file mode 100644 index 0000000..69c3588 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/shortLink/VisualdevShortLinkPwd.java @@ -0,0 +1,27 @@ +package com.yunzhupaas.base.model.shortLink; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 在线表单外链显示类 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/12/30 11:25:16 + */ +@Data +@Schema(description="外链密码验证对象") +public class VisualdevShortLinkPwd { + @Schema(description = "主键") + private String id; + @Schema(description = "类型:form-表单,list-列表") + private Integer type; + @Schema(description = "密码") + private String password; + @Schema(description = "加密参数") + private String encryption; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/shortLink/VisualdevShortLinkVo.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/shortLink/VisualdevShortLinkVo.java new file mode 100644 index 0000000..90caa98 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-base/yunzhupaas-visualdev-base-entity/src/main/java/com/yunzhupaas/base/model/shortLink/VisualdevShortLinkVo.java @@ -0,0 +1,52 @@ +package com.yunzhupaas.base.model.shortLink; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 在线表单外链显示类 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/12/30 11:25:16 + */ +@Data +@Schema(description="外链配置详情") +public class VisualdevShortLinkVo { + @Schema(description = "主键") + private String id; + @Schema(description = "短链接key") + private String shortLink; + @Schema(description = "表单开关0-关闭,1-开启") + private Integer formUse = 0; + @Schema(description = "表单外链") + private String formLink; + @Schema(description = "表单密码开关0-关闭,1-开启") + private Integer formPassUse = 0; + @Schema(description = "表单密码") + private String formPassword; + @Schema(description = "列表开关0-关闭,1-开启") + private Integer columnUse = 0; + @Schema(description = "列表外链") + private String columnLink; + @Schema(description = "列表密码开关0-关闭,1-开启") + private Integer columnPassUse = 0; + @Schema(description = "列表密码") + private String columnPassword; + @Schema(description = "列表条件字段") + private String columnCondition; + @Schema(description = "列表展示字段") + private String columnText; + @Schema(description = "用户id") + private String userId; + @Schema(description = "租户id") + private String tenantId; + @Schema(description = "是否启用") + private Integer enabledMark; + + @Schema(description = "是否已保存") + private boolean alreadySave = false; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/pom.xml b/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/pom.xml new file mode 100644 index 0000000..ef77e5a --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/pom.xml @@ -0,0 +1,21 @@ + + + + yunzhupaas-visualdev + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-visualdev-generater + pom + + yunzhupaas-visualdev-generater-entity + yunzhupaas-visualdev-generater-biz + yunzhupaas-visualdev-generater-controller + + + + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-biz/pom.xml b/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-biz/pom.xml new file mode 100644 index 0000000..af8fd71 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-biz/pom.xml @@ -0,0 +1,46 @@ + + + + yunzhupaas-visualdev-generater + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-visualdev-generater-biz + + + + com.yunzhupaas + yunzhupaas-visualdev-generater-entity + ${project.version} + + + com.yunzhupaas + yunzhupaas-visualdev-base-biz + ${project.version} + + + com.baomidou + mybatis-plus-generator + + + com.baomidou + mybatis-plus-core + + + + + org.apache.velocity + velocity-engine-core + + + com.yunzhupaas + yunzhupaas-visualdev-onlinedev-entity + ${project.version} + + + + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-biz/src/main/java/com/yunzhupaas/generater/factory/CodeGenerateFactoryV3.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-biz/src/main/java/com/yunzhupaas/generater/factory/CodeGenerateFactoryV3.java new file mode 100644 index 0000000..aa0b4d7 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-biz/src/main/java/com/yunzhupaas/generater/factory/CodeGenerateFactoryV3.java @@ -0,0 +1,1522 @@ +package com.yunzhupaas.generater.factory; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.generator.config.*; +import com.baomidou.mybatisplus.generator.config.builder.CustomFile; +import com.baomidou.mybatisplus.generator.config.po.TableField; +import com.baomidou.mybatisplus.generator.config.po.TableInfo; +import com.baomidou.mybatisplus.generator.config.rules.DateType; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.model.ColumnDataModel; +import com.yunzhupaas.base.model.DownloadCodeForm; +import com.yunzhupaas.base.model.Template6.AuthorityModel; +import com.yunzhupaas.base.model.Template6.BtnData; +import com.yunzhupaas.base.model.Template6.ColumnListField; +import com.yunzhupaas.base.model.Template7.Template7Model; +import com.yunzhupaas.base.model.VisualWebTypeEnum; +import com.yunzhupaas.base.util.SourceUtil; +import com.yunzhupaas.base.util.VisualUtils; +import com.yunzhupaas.base.util.app.AppGenModel; +import com.yunzhupaas.base.util.app.AppGenUtil; +import com.yunzhupaas.base.util.common.*; +import com.yunzhupaas.base.util.custom.CustomGenerator; +import com.yunzhupaas.base.util.fuctionFormVue3.*; +import com.yunzhupaas.constant.GenerateConstant; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.constant.TableFieldsNameConst; +import com.yunzhupaas.database.model.entity.DbLinkEntity; +import com.yunzhupaas.database.util.DataSourceUtil; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.generater.model.FormDesign.ColumnListDataModel; +import com.yunzhupaas.generater.model.FormDesign.ListSearchGroupModel; +import com.yunzhupaas.generater.model.FormDesign.SearchTypeModel; +import com.yunzhupaas.generater.model.FormDesign.TemplateMethodEnum; +import com.yunzhupaas.model.visualJson.*; +import com.yunzhupaas.model.visualJson.analysis.*; +import com.yunzhupaas.model.visualJson.config.ConfigModel; +import com.yunzhupaas.model.visualJson.config.HeaderModel; +import com.yunzhupaas.model.visualJson.config.TabConfigModel; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.TableFeildsEnum; +import com.yunzhupaas.util.XSSEscape; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.velocity.VelocityContext; +import org.springframework.boot.SpringBootVersion; +import org.springframework.stereotype.Component; + +import java.io.File; +import java.sql.SQLException; +import java.util.*; +import java.util.function.BiConsumer; +import java.util.stream.Collectors; + +/** + * @author 云筑产品开发平台组 + * @version V3.5.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/5/31 + */ +@Component +public class CodeGenerateFactoryV3 { + // 鉴别副表正则 + String reg = "^[yunzhupaas_]\\S*_yunzhupaas\\S*"; + + /** + * 根据模板路径对应实体 + * + * @param templateMethod + * @return + */ + public void runGenerator(String templateMethod, GenerateParamModel generateParamModel) throws Exception { + GenerateInterface codeGenerateUtil = null; + if (templateMethod.equals(TemplateMethodEnum.T1.getMethod())) { + codeGenerateUtil = new GenerateWorkFlow(); + } else if (templateMethod.equals(TemplateMethodEnum.T2.getMethod())) { + codeGenerateUtil = new GenerateFormList(); + } else if (templateMethod.equals(TemplateMethodEnum.T3.getMethod())) { + codeGenerateUtil = new GenerateFormListFlow(); + } else if (templateMethod.equals(TemplateMethodEnum.T4.getMethod())) { + codeGenerateUtil = new GenerateForm(); + } else if (templateMethod.equals(TemplateMethodEnum.T5.getMethod())) { + codeGenerateUtil = new GenerateFormFlow(); + } else if (templateMethod.equals(TemplateMethodEnum.T6.getMethod())) { + GenerateDataView generateDataView = new GenerateDataView(); + generateDataView.generateDataView(generateParamModel); + generateApp(generateParamModel); + return; + } else { + codeGenerateUtil = null; + } + // 生成后端代码 + GenerateParamModel javaObj = BeanUtil.copyProperties(generateParamModel, GenerateParamModel.class); + this.generateJava(javaObj, codeGenerateUtil); + } + + /** + * 生成java代码 + * + * @param codeUtil 生成重写接口 + * @param generateParamModel + * @throws Exception + */ + private void generateJava(GenerateParamModel generateParamModel, GenerateInterface codeUtil) throws Exception { + List list = JsonUtil.getJsonToList(generateParamModel.getEntity().getVisualTables(), + TableModel.class); + // 当前表别名及字段别名 + Map tableAliseMap = generateParamModel.getTableAliseMap(); + // 表别名 + for (TableModel model : list) { + AliasModel aliasModel = tableAliseMap.get(model.getTable()); + // 表别名 + String className = StringUtil.isNotEmpty(aliasModel.getAliasName()) ? aliasModel.getAliasName() + : model.getTable(); + generateParamModel.setTable(model.getTable()); + generateParamModel.setClassName(className); + generateParamModel.setMainTable(false); + + if ("1".equals(model.getTypeId())) { + generateParamModel.setMainTable(true); + // 生成主表代码 + this.setCode(generateParamModel, codeUtil); + // 前端代码 + this.generateHtml(generateParamModel, codeUtil); + // 生成app代码 + this.generateApp(generateParamModel); + } else if ("0".equals(model.getTypeId())) { + // 生成子表代码 + this.setCode(generateParamModel, codeUtil); + } + } + } + + /** + * 组装通用数据 + * + * @param generateParamModel + */ + private void setCommonParam(GenerateParamModel generateParamModel) { + // 组装通用数据----- + VisualdevEntity entity = generateParamModel.getEntity(); + DbLinkEntity linkEntity = generateParamModel.getLinkEntity(); + List tableModelList = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class) + .stream().sorted(Comparator.comparing(TableModel::getTypeId).reversed()).collect(Collectors.toList()); + // 赋值主键 + tableModelList.stream().forEach(t -> { + try { + t.setTableKey(VisualUtils.getpKey(linkEntity, t.getTable())); + } catch (SQLException sqlException) { + sqlException.printStackTrace(); + } + }); + // 表别名 + Map tableRenames = generateParamModel.getTableAliseMap(); + // formTempJson + FormDataModel formData = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + // 设置乐观锁参数用于其他位置判断 + generateParamModel.setConcurrencyLock(formData.getConcurrencyLock()); + generateParamModel.setAutoIncrement(formData.getPrimaryKeyPolicy() == 2); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + // 所有控件 + List formAllModel = new ArrayList<>(); + RecursionForm recursionForm = new RecursionForm(); + recursionForm.setTableModelList(JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class)); + recursionForm.setList(list); + FormCloumnUtil.recursionFormGen(recursionForm, formAllModel); + generateParamModel.setTableModelList(tableModelList); + generateParamModel.setFormAllModel(formAllModel); + // 塞别名 + for (FormAllModel t : formAllModel) { + if (FormEnum.mast.getMessage().equals(t.getYunzhupaasKey())) { + FieLdsModel fieLdsModel = t.getFormColumnModel().getFieLdsModel(); + AliasModel aliasModel = tableRenames.get(fieLdsModel.getConfig().getTableName()); + Map fieldsMap = aliasModel.getFieldsMap(); + fieLdsModel.setTableAlias(aliasModel.getAliasName()); + fieLdsModel.setFieldAlias(fieldsMap.get(fieLdsModel.getVModel())); + } + if (FormEnum.mastTable.getMessage().equals(t.getYunzhupaasKey())) { + FieLdsModel fieLdsModel = t.getFormMastTableModel().getMastTable().getFieLdsModel(); + AliasModel aliasModel = tableRenames.get(fieLdsModel.getConfig().getTableName()); + Map fieldsMap = aliasModel.getFieldsMap(); + fieLdsModel.setTableAlias(aliasModel.getAliasName()); + String[] split = fieLdsModel.getVModel().split("_yunzhupaas_"); + fieLdsModel.setFieldAlias(fieldsMap.get(split[1])); + } + if (FormEnum.table.getMessage().equals(t.getYunzhupaasKey())) { + FormColumnTableModel childList = t.getChildList(); + AliasModel aliasModel = tableRenames.get(childList.getTableName()); + Map fieldsMap = aliasModel.getFieldsMap(); + + childList.setAliasClassName(aliasModel.getAliasName()); + childList.setAliasUpName(DataControlUtils.captureName(aliasModel.getAliasName())); + childList.setAliasLowName(DataControlUtils.initialLowercase(aliasModel.getAliasName())); + for (FormColumnModel formColumnModel : childList.getChildList()) { + FieLdsModel fieLdsModel = formColumnModel.getFieLdsModel(); + fieLdsModel.setTableAlias(aliasModel.getAliasName()); + fieLdsModel.setFieldAlias(fieldsMap.get(fieLdsModel.getVModel())); + } + } + } + // 代码生成基础信息 + Template7Model template7Model = generateParamModel.getTemplate7Model(); + template7Model.setClassName(DataControlUtils.captureName(generateParamModel.getClassName())); + template7Model.setTableName(generateParamModel.getClassName()); + template7Model.setDescription(generateParamModel.getDownloadCodeForm().getDescription()); + generateParamModel.setTemplate7Model(template7Model); + } + + /** + * 获取传递参数 + * + * @param generateParamModel + * @return + * @throws Exception + */ + private Map getcolumndata(GenerateParamModel generateParamModel) throws Exception { + Map columndata = new HashMap<>(16); + DownloadCodeForm downloadCodeForm = generateParamModel.getDownloadCodeForm(); + VisualdevEntity entity = generateParamModel.getEntity(); + DbLinkEntity linkEntity = generateParamModel.getLinkEntity(); + List tableModelList = generateParamModel.getTableModelList(); + List formAllModel = generateParamModel.getFormAllModel(); + Template7Model template7Model = generateParamModel.getTemplate7Model(); + // 自定义包名 + String modulePackageName = downloadCodeForm.getModulePackageName(); + // formTempJson + FormDataModel formData = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + // 主表 + TableModel mainTable = tableModelList.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + // 表别名 + Map tableRenames = generateParamModel.getTableAliseMap(); + String mainModelName = DataControlUtils.captureName(tableRenames.get(mainTable.getTable()).getAliasName()); + AliasModel mainAliasModel = tableRenames.get(mainTable.getTable()); + + // 主表控件 + List mast = formAllModel.stream() + .filter(t -> FormEnum.mast.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + // 子表控件 + List table = formAllModel.stream() + .filter(t -> FormEnum.table.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + // 副表控件 + List mastTable = formAllModel.stream() + .filter(t -> FormEnum.mastTable.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + + List subTableName = new ArrayList<>(); + for (FormAllModel allModel : table) { + FormColumnTableModel childList = allModel.getChildList(); + if (childList != null) { + subTableName.add(childList.getTableName()); + } + } + // 子表(tableField,tableName)->tablefield1->realname + Map childKeyTableNameMap = new HashMap<>(8); + table.stream().forEach( + t -> childKeyTableNameMap.put(t.getChildList().getTableModel(), t.getChildList().getTableName())); + + // 子表集合 + List childTableNameList = new ArrayList<>(); + // 全部表 + List allTableNameList = new ArrayList<>(); + for (TableModel tableModel : tableModelList) { + AliasModel aliasModel = tableRenames.get(tableModel.getTable()); + Map fieldsMap = aliasModel.getFieldsMap(); + TableModel Model = new TableModel(); + Model.setInitName(tableModel.getTable()); + Model.setTable(aliasModel.getAliasName()); + Model.setFields(tableModel.getFields()); + if (tableModel.getTable().equals(mainTable.getTable())) { + Model.setTableTag("main"); + } else { + Model.setTableField(DataControlUtils.captureName(fieldsMap.get(tableModel.getTableField()))); + Model.setRelationField( + DataControlUtils.captureName(mainAliasModel.getFieldsMap().get(tableModel.getRelationField()))); + Model.setTableTag(subTableName.contains(tableModel.getTable()) ? "sub" : "sub-yunzhupaas"); + } + allTableNameList.add(Model); + if ("0".equals(tableModel.getTypeId())) { + childTableNameList.add(Model); + } + } + TableModel mainTableModel = tableModelList.stream().filter(t -> t.getTypeId().equals("1")).findFirst() + .orElse(null); + // 主表的字段 + if (mainTableModel == null || CollectionUtils.isEmpty(mainTableModel.getFields())) { + throw new SQLException(MsgCode.COD001.get()); + } + + // 主表的属性 + List mastTableHandle = new ArrayList<>(); + for (int i = 0; i < mast.size(); i++) { + FormAllModel mastModel = mast.get(i); + FieLdsModel fieLdsModel = mastModel.getFormColumnModel().getFieLdsModel(); + // 接口templatejson转换 + if (StringUtil.isNotEmpty(fieLdsModel.getVModel())) { + List templateJson = fieLdsModel.getConfig().getTemplateJson(); + String json = templateJson.size() > 0 ? JsonUtil.getObjectToString(templateJson) + : fieLdsModel.getTemplateJson(); + fieLdsModel.setTemplateJson(json); + mastTableHandle.add(fieLdsModel); + } + } + // 副表模型 + List columnTableHandle = new ArrayList<>(); + // 副表数据model + Map> groupColumnDataMap = mastTable.stream() + .collect(Collectors.groupingBy(m -> m.getFormMastTableModel().getTable())); + for (String key : groupColumnDataMap.keySet()) { + String classNameMast = DataControlUtils.captureName(tableRenames.get(key).getAliasName()); + ColumnListDataModel columnListDataModel = new ColumnListDataModel(); + columnListDataModel.setModelName(classNameMast); + columnListDataModel.setModelUpName(DataControlUtils.captureName(classNameMast)); + columnListDataModel.setModelLowName(DataControlUtils.initialLowercase(classNameMast)); + List allModels = groupColumnDataMap.get(key); + List fields = allModels.stream().map(m -> m.getFormMastTableModel().getField()) + .collect(Collectors.toList()); + columnListDataModel.setFieldList(fields); + columnListDataModel.setFieLdsModelList( + allModels.stream().map(al -> al.getFormMastTableModel()).collect(Collectors.toList())); + columnListDataModel.setTableName(key); + List collect = allModels.stream().map(all -> JsonUtil + .getJsonToBean(all.getFormMastTableModel().getMastTable().getFieLdsModel(), FieLdsModel.class)) + .collect(Collectors.toList()); + collect.stream().forEach(c -> { + List templateJson = c.getConfig().getTemplateJson(); + String json = templateJson.size() > 0 ? JsonUtil.getObjectToString(templateJson) : c.getTemplateJson(); + c.setTemplateJson(json); + }); + columnListDataModel.setFieLdsModels(collect); + + TableModel tableModel = tableModelList.stream() + .filter(t -> t.getTable().equalsIgnoreCase(columnListDataModel.getTableName())).findFirst() + .orElse(null); + if (ObjectUtil.isNotEmpty(tableModel)) { + // 副表主键别名 + Map thisTableField = tableRenames.get(key).getFieldsMap(); + String mainKeyAlias = thisTableField.get(tableModel.getTableKey()); + String foreignKeyAlias = thisTableField.get(tableModel.getTableField()); + // 主表的主键 + String relationKeyAlias = tableRenames.get(tableModel.getRelationTable()).getFieldsMap() + .get(tableModel.getRelationField()); + columnListDataModel.setMainUpKey(DataControlUtils.captureName(relationKeyAlias)); + // 主键 + columnListDataModel.setMainKey(mainKeyAlias); + columnListDataModel.setMainField(DataControlUtils.captureName(mainKeyAlias)); + // 外键 + columnListDataModel.setRelationField(foreignKeyAlias); + columnListDataModel.setRelationUpField(DataControlUtils.captureName(foreignKeyAlias)); + } + columnTableHandle.add(columnListDataModel); + } + // 子表的属性 + List> childTableHandle = new ArrayList<>(); + for (int i = 0; i < table.size(); i++) { + FormColumnTableModel childList = table.get(i).getChildList(); + List childListAll = childList.getChildList(); + String classNameChild = DataControlUtils + .captureName(tableRenames.get(childList.getTableName()).getAliasName()); + // 子表别名 + childList.setAliasClassName(classNameChild); + childList.setAliasUpName(DataControlUtils.captureName(classNameChild)); + childList.setAliasLowName(DataControlUtils.initialLowercase(classNameChild)); + for (FormColumnModel columnModel : childListAll) { + FieLdsModel fieLdsModel = columnModel.getFieLdsModel(); + List templateJson = fieLdsModel.getConfig().getTemplateJson(); + String json = templateJson.size() > 0 ? JsonUtil.getObjectToString(templateJson) + : fieLdsModel.getTemplateJson(); + fieLdsModel.setTemplateJson(json); + } + Map childs = JsonUtil.entityToMap(childList); + Optional first1 = tableModelList.stream() + .filter(t -> t.getTable().equals(childList.getTableName())).findFirst(); + if (!first1.isPresent()) { + throw new SQLException(MsgCode.COD001.get()); + } + TableModel tableModel = first1.get(); + // 获取主键-外键字段-关联主表字段 + String tableKeyAlias = tableRenames.get(tableModel.getTable()).getFieldsMap().get(tableModel.getTableKey()); + childs.put("chidKeyName", StringUtil.isNotEmpty(tableKeyAlias) ? tableKeyAlias : tableModel.getTableKey()); + // 外键 + String tableField = tableRenames.get(tableModel.getTable()).getFieldsMap().get(tableModel.getTableField()); + childs.put("tablefield", StringUtil.isNotEmpty(tableField) ? tableField : tableModel.getTableField()); + // 主表主键 + String relationField = tableRenames.get(mainTable.getTable()).getFieldsMap() + .get(tableModel.getRelationField()); + childs.put("relationField", + StringUtil.isNotEmpty(relationField) ? relationField : tableModel.getRelationField()); + childTableHandle.add(childs); + } + + // ++++++++++++++++++++++++++++主副子通用参数++++++++++++++++++++++++++// + // 微服务标识 + columndata.put("isCloud", GenerateCommon.IS_CLOUD); + // 是列表,是流程判断 + if (VisualWebTypeEnum.FORM_LIST.getType().equals(entity.getWebType()) && !Objects.equals(entity.getType(), 3)) { + columndata.put("isList", true); + // 添加列表参数 + getListColumndata(generateParamModel, columndata); + } + if (Objects.equals(downloadCodeForm.getEnableFlow(), 1)) { + columndata.put("isFlow", true); + } + // 后台 + columndata.put("module", downloadCodeForm.getModule()); + columndata.put("genInfo", template7Model); + columndata.put("modelName", template7Model.getClassName()); + // 表单非系统控件字段--为了加null可以更新 + columndata.put("tableNotSystemField", + GenerateCommon.getNotSystemFields(mast, mastTable, table, generateParamModel)); + // 主副子 控件字段(已处理数据) + columndata.put("mastTableHandle", mastTableHandle);// 原system + columndata.put("columnTableHandle", columnTableHandle);// 原columnChildren + columndata.put("childTableHandle", childTableHandle);// 原child + columndata.put("mainModelName", mainModelName); + // 数据源 + if (ObjectUtil.isNotEmpty(linkEntity)) { + columndata.put("DS", linkEntity.getFullName()); + } + // 数据源配置 + DataSourceConfig dsc = SourceUtil.dbConfig(TenantDataSourceUtil.getTenantSchema(), linkEntity); + // 数据库类型 + columndata.put("dbType", dsc.getDbType().getDb()); + // 包名 + columndata.put("modulePackageName", modulePackageName); + columndata.put("pKeyName", generateParamModel.getPKeyName()); + columndata.put("pKeyNameOriginal", generateParamModel.getPKeyNameOriginal()); + columndata.put("VisualDevId", entity.getId()); + columndata.put("allTableNameList", allTableNameList); + + String springVersion = SpringBootVersion.getVersion(); + columndata.put("springVersion", springVersion); + // ++++++++++++++++++++++++++++仅主表参数++++++++++++++++++++++++++// + if (generateParamModel.isMainTable()) { + // 后台 + columndata.put("main", true); + // 模板名称 + columndata.put("formModelName", entity.getFullName()); + // 乐观锁 + columndata.put("version", formData.getConcurrencyLock()); + TableFields versionField = mainTable.getFields().stream() + .filter(t -> TableFeildsEnum.VERSION.getField().equalsIgnoreCase(t.getField())).findFirst() + .orElse(null); + columndata.put("versionType", versionField != null ? versionField.getDataType() : ""); + // 删除标志 + columndata.put("logicalDelete", formData.getLogicalDelete()); + // 雪花 + columndata.put("snowflake", formData.getPrimaryKeyPolicy() == 1); + + List businessKeyList = formData.getBusinessKeyList() != null + ? Arrays.asList(formData.getBusinessKeyList()) + : new ArrayList<>(); + List businessKeyFields = mastTableHandle.stream() + .filter(t -> businessKeyList.contains(t.getVModel())).collect(Collectors.toList()); + columndata.put("useBusinessKey", + formData.isUseBusinessKey() && CollectionUtils.isNotEmpty(businessKeyList)); + columndata.put("businessKeyList", businessKeyFields); + columndata.put("businessKeyTip", formData.getBusinessKeyTip()); + } + return columndata; + } + + /** + * 获取列表传递参数 + * + * @param generateParamModel + * @return + * @throws Exception + */ + private void getListColumndata(GenerateParamModel generateParamModel, Map listMap) + throws Exception { + VisualdevEntity entity = generateParamModel.getEntity(); + // tableJson + List tableModelList = generateParamModel.getTableModelList(); + // 主表 + TableModel mainTable = tableModelList.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + // 表别名 + Map tableRenames = generateParamModel.getTableAliseMap(); + + List formAllModel = generateParamModel.getFormAllModel(); + // 主表数据 + List mast = formAllModel.stream() + .filter(t -> FormEnum.mast.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + // 子表数据 + List table = formAllModel.stream() + .filter(t -> FormEnum.table.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + // 副表数据 + List mastTable = formAllModel.stream() + .filter(t -> FormEnum.mastTable.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + List subTableName = new ArrayList<>(); + for (FormAllModel allModel : table) { + FormColumnTableModel childList = allModel.getChildList(); + if (childList != null) { + subTableName.add(childList.getTableName()); + } + } + // 子表集合 + List childTableNameList = new ArrayList<>(); + // 全部表 + List allTableNameList = new ArrayList<>(); + for (TableModel tableModel : tableModelList) { + TableModel Model = new TableModel(); + Model.setInitName(tableModel.getTable()); + Model.setTable(tableRenames.get(tableModel.getTable()).getAliasName()); + Model.setFields(tableModel.getFields()); + if (tableModel.getTable().equals(mainTable.getTable())) { + Model.setTableTag("main"); + } else { + Model.setTableField(DataControlUtils.captureName(tableModel.getTableField())); + Model.setRelationField(DataControlUtils.captureName(tableModel.getRelationField())); + Model.setTableTag(subTableName.contains(tableModel.getTable()) ? "sub" : "sub-yunzhupaas"); + } + allTableNameList.add(Model); + if ("0".equals(tableModel.getTypeId())) { + childTableNameList.add(Model); + } + } + // 子表(tableField,tableName)->tablefield1->realname + Map childKeyTableNameMap = new HashMap<>(8); + table.stream().forEach( + t -> childKeyTableNameMap.put(t.getChildList().getTableModel(), t.getChildList().getTableName())); + TableModel mainTableModel = tableModelList.stream().filter(t -> t.getTypeId().equals("1")).findFirst() + .orElse(null); + // 主表的字段 + if (mainTableModel == null || CollectionUtils.isEmpty(mainTableModel.getFields())) { + throw new SQLException(MsgCode.COD001.get()); + } + + // columnTempJson + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(entity.getColumnData(), ColumnDataModel.class); + // app 列表对象 + ColumnDataModel appColumnDataModel = JsonUtil.getJsonToBean(entity.getAppColumnData(), ColumnDataModel.class); + + // 按钮 + List btnPcList = JsonUtil.getJsonToList(columnDataModel.getBtnsList(), BtnData.class); + List columnBtnPcList = JsonUtil.getJsonToList(columnDataModel.getColumnBtnsList(), BtnData.class); + List btnAppList = JsonUtil.getJsonToList(appColumnDataModel.getBtnsList(), BtnData.class); + List columnBtnAppList = JsonUtil.getJsonToList(appColumnDataModel.getColumnBtnsList(), BtnData.class); + // pc和app按钮整合生成后端接口 + List btnDataList = JsonUtil.getJsonToList(columnDataModel.getBtnsList(), BtnData.class); + btnDataList.stream().forEach(a -> btnAppList.stream().forEach(b -> { + if (a.getValue().equals(b.getValue())) + if (b.isShow()) + a.setShow(true); + })); + List columnBtnDataList = JsonUtil.getJsonToList(columnDataModel.getColumnBtnsList(), BtnData.class); + columnBtnDataList.stream().forEach(a -> columnBtnAppList.stream().forEach(b -> { + if (a.getValue().equals(b.getValue())) + if (b.isShow()) + a.setShow(true); + })); + + // 以下----pc端前端按钮判断 ---- 是否有导入按钮--webtype==2开启列表 + boolean hasUploadBtn = Objects.equals(entity.getWebType(), 2) + && btnPcList.stream().anyMatch(btn -> btn.getValue().equals("upload") && btn.isShow()); + boolean hasDownloadBtn = Objects.equals(entity.getWebType(), 2) + && btnPcList.stream().anyMatch(btn -> btn.getValue().equals("download") && btn.isShow()); + boolean hasPrintBtn = Objects.equals(entity.getWebType(), 2) + && btnPcList.stream().anyMatch(btn -> btn.getValue().equals("batchPrint") && btn.isShow()); + boolean hasRemoveBtn = Objects.equals(entity.getWebType(), 2) + && btnPcList.stream().anyMatch(btn -> btn.getValue().equals("batchRemove") && btn.isShow()); + // 列表和查询 + List columnList = JsonUtil.getJsonToList(columnDataModel.getColumnList(), + ColumnListField.class); + List searchList = JsonUtil.getJsonToList(columnDataModel.getSearchList(), + SearchTypeModel.class); + List columnAppList = JsonUtil.getJsonToList(appColumnDataModel.getColumnList(), + ColumnListField.class); + List searchAppList = JsonUtil.getJsonToList(appColumnDataModel.getSearchList(), + SearchTypeModel.class); + // -----------------------------------------------------search + // start--------------------------------------- + // 列表全字段 + List columnListAll = new ArrayList<>(columnList); + List cLaArr = columnListAll.stream().map(ColumnListField::getProp).collect(Collectors.toList()); + columnAppList.stream().forEach(t -> { + if (!cLaArr.contains(t.getProp())) { + columnListAll.add(t); + cLaArr.add(t.getProp()); + } + }); + + // 添加左侧树查询字段 + addTreeSearchField(mainTableModel, columnDataModel, searchList); + addTreeSearchField(mainTableModel, appColumnDataModel, searchAppList); + // 查询全字段 + List searchListAll = new ArrayList<>(searchList); + List cSaArr = searchListAll.stream().map(SearchTypeModel::getId).collect(Collectors.toList()); + searchAppList.stream().forEach(t -> { + if (!cSaArr.contains(t.getId())) { + searchListAll.add(t); + cSaArr.add(t.getId()); + } + }); + + // 查询字段转换 + List groupModels = getListSearchGroupModels(tableModelList, mainTable, tableRenames, + childKeyTableNameMap, mainTableModel, searchList); + List groupAppModels = getListSearchGroupModels(tableModelList, mainTable, tableRenames, + childKeyTableNameMap, mainTableModel, searchAppList); + List groupAllModels = getListSearchGroupModels(tableModelList, mainTable, tableRenames, + childKeyTableNameMap, mainTableModel, searchListAll); + + // 判断是否有关键词搜索 + boolean keywordModels = searchList.stream().filter(t -> t.getIsKeyword() != null && t.getIsKeyword()) + .collect(Collectors.toList()).size() > 0; + boolean keywordAppModels = searchAppList.stream().filter(t -> t.getIsKeyword() != null && t.getIsKeyword()) + .collect(Collectors.toList()).size() > 0; + + // -----------------------------------------------------search + // enddd--------------------------------------- + // 权限 + AuthorityModel authority = new AuthorityModel(); + BeanUtil.copyProperties(columnDataModel, authority); + // 导入字段 + List> allUploadTemplates = new ArrayList<>(); + boolean importHasChildren = false; + String importType = "1"; + UploaderTemplateModel uploaderTemplateModel = JsonUtil.getJsonToBean(columnDataModel.getUploaderTemplateJson(), + UploaderTemplateModel.class); + if (hasUploadBtn && uploaderTemplateModel != null && uploaderTemplateModel.getSelectKey() != null) { + importType = uploaderTemplateModel.getDataType(); + List selectKey = uploaderTemplateModel.getSelectKey(); + Map> childMap = new HashMap<>(); + // 判断是否存在子表的导入导出 + for (String item : selectKey) { + if (item.toLowerCase().contains(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX)) { + importHasChildren = true; + String[] split = item.split("-"); + if (childMap.get(split[0]) == null) { + List keys = new ArrayList<>(); + keys.add(split[1]); + childMap.put(split[0], keys); + } else { + List keys = childMap.get(split[0]); + keys.add(split[1]); + childMap.replace(split[0], keys); + } + } else { + // 主表字段 + for (FormAllModel fam : mast) { + FieLdsModel fieLdsModel = fam.getFormColumnModel().getFieLdsModel(); + if (item.equals(fieLdsModel.getVModel())) { + Map map = JsonUtil.entityToMap(fieLdsModel); + map.put("label", fieLdsModel.getConfig().getLabel()); + allUploadTemplates.add(map); + } + } + // 副表字段 + for (FormAllModel fam : mastTable) { + FieLdsModel fieLdsModel = fam.getFormMastTableModel().getMastTable().getFieLdsModel(); + if (item.equals(fieLdsModel.getVModel())) { + Map map = JsonUtil.entityToMap(fieLdsModel); + map.put("label", fieLdsModel.getConfig().getLabel()); + allUploadTemplates.add(map); + } + } + } + } + for (FormAllModel fam : table) { + FormColumnTableModel child = fam.getChildList(); + FormColumnTableModel childRes = new FormColumnTableModel(); + BeanUtil.copyProperties(child, childRes); + String childClassName = DataControlUtils + .captureName(tableRenames.get(childRes.getTableName()).getAliasName()); + // 子表别名 + childRes.setAliasClassName(childClassName); + childRes.setAliasUpName(DataControlUtils.captureName(childClassName)); + childRes.setAliasLowName(DataControlUtils.initialLowercase(childClassName)); + String tableModel = child.getTableModel(); + List childList1 = child.getChildList(); + // 获取该子表的所有需要导入字段 + List keys = childMap.get(tableModel) != null ? childMap.get(tableModel) + : Collections.EMPTY_LIST; + List collect = childList1.stream() + .filter(t -> keys.contains(t.getFieLdsModel().getVModel())).collect(Collectors.toList()); + childRes.setChildList(collect); + Map childFilesMap = JsonUtil.entityToMap(childRes); + childFilesMap.put("vModel", childRes.getTableModel()); + // 添加整个子表 + allUploadTemplates.add(childFilesMap); + } + } + // 导入重复字段,需要标记(子表也以label判断重复) + Set set = new HashSet<>(); + List nameAgain = new ArrayList<>(); + for (Map f : allUploadTemplates) { + if (!set.add(String.valueOf(f.get("label")))) { + nameAgain.add(String.valueOf(f.get("vModel"))); + } + } + + // 树形列表参数 + if (Objects.equals(columnDataModel.getType(), 5)) { + columnDataModel.setHasPage(false); + } + String parentField = StringUtil.isNotEmpty(columnDataModel.getParentField()) ? columnDataModel.getParentField() + : ""; + if (StringUtil.isNotEmpty(parentField)) { + parentField = parentField.substring(0, 1).toUpperCase() + parentField.substring(1); + } + String subField = StringUtil.isNotEmpty(columnDataModel.getSubField()) ? columnDataModel.getSubField() : ""; + if (StringUtil.isNotEmpty(subField)) { + subField = subField.substring(0, 1).toUpperCase() + subField.substring(1); + } + // 导出字段属性转换 + List listOptions = GenerateCommon.getExpotColumn(columnList); + // ++++++++++++++++++++++++++++主副子通用参数++++++++++++++++++++++++++/ + listMap.put("hasPage", columnDataModel.getHasPage()); + listMap.put("defaultSidx", columnDataModel.getDefaultSidx()); + listMap.put("sort", columnDataModel.getSort()); + listMap.put("authority", authority); + // app pc 数据权限是否开启 + listMap.put("pcDataPermisson", columnDataModel.getUseDataPermission()); + listMap.put("appDataPermisson", appColumnDataModel.getUseDataPermission()); + listMap.put("groupModels", groupModels); + listMap.put("groupAppModels", groupAppModels); + listMap.put("keywordModels", keywordModels); + listMap.put("keywordAppModels", keywordAppModels); + listMap.put("childTableNameList", childTableNameList); + listMap.put("allTableNameList", allTableNameList); + // 是否开启高级查询 + listMap.put("superQuery", columnDataModel.getHasSuperQuery()); + listMap.put("ruleQuery", true); + + // ++++++++++++++++++++++++++++仅主表参数++++++++++++++++++++++++++// + if (generateParamModel.isMainTable()) { + // 列表全属性 + listMap.put("columnDataStr", JSONObject.toJSONString(GenerateCommon.objRemoveJson(entity.getColumnData()))); + listMap.put("appColumnDataStr", + JSONObject.toJSONString(GenerateCommon.objRemoveJson(entity.getAppColumnData()))); + listMap.put("columnData", JsonUtil.stringToMap(entity.getColumnData())); + // 列表-pc-app-并集 + listMap.put("columnList", columnList); + listMap.put("searchList", searchList); + listMap.put("columnAppList", columnAppList); + listMap.put("searchAppList", searchAppList); + listMap.put("columnListAll", columnListAll); + listMap.put("searchListAll", searchListAll); + // 子表样式 + listMap.put("childTableStyle", columnDataModel.getChildTableStyle()); + + // 左侧树 + listMap.put("leftTreeTable", columnDataModel.getType() == 2); + // 分组 + listMap.put("groupTable", columnDataModel.getType() == 3); + listMap.put("groupField", columnDataModel.getGroupField()); + // 行内编辑 + listMap.put("lineEdit", columnDataModel.getType() == 4); + // 树形参数 + listMap.put("treeTable", columnDataModel.getType() == 5); + // 合计 + boolean configurationTotal = columnDataModel.isShowSummary(); + if (columnDataModel.getType() == 3 || columnDataModel.getType() == 5) { + configurationTotal = false; + } + listMap.put("configurationTotal", configurationTotal); + List summaryList = CollectionUtils.isEmpty(columnDataModel.getSummaryField()) + ? Collections.EMPTY_LIST + : columnDataModel.getSummaryField(); + listMap.put("fieldsTotal", JsonUtil.getObjectToString(summaryList)); + // 按键 + listMap.put("btnsList", btnDataList); + listMap.put("columnBtnsList", columnBtnDataList); + listMap.put("btnPcList", btnPcList); + listMap.put("columnBtnPcList", columnBtnPcList); + + listMap.put("hasDownloadBtn", hasDownloadBtn); + listMap.put("hasUploadBtn", hasUploadBtn); + listMap.put("hasPrintBtn", hasPrintBtn); + listMap.put("hasRemoveBtn", hasRemoveBtn); + + listMap.put("parentField", parentField); + listMap.put("subField", subField); + + // 导入的字段 + listMap.put("importFields", allUploadTemplates); + + List> newUploadTemplates = new ArrayList<>(); + Map complexNum = new HashMap<>(); + int n = 0; + for (Map item : allUploadTemplates) { + String vModel = String.valueOf(item.get("vModel")); + if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { + boolean flag = false; + HeaderModel complexEnt = null; + for (HeaderModel headerModel : columnDataModel.getComplexHeaderList()) { + if (CollectionUtils.isNotEmpty(headerModel.getChildColumns()) + && headerModel.getChildColumns().contains(vModel)) { + flag = true; + complexEnt = headerModel; + } + } + if (flag) { + if (complexNum.get(complexEnt.getId()) != null) { + Map complexMap = newUploadTemplates.get(complexNum.get(complexEnt.getId())); + List uploadFieldList = (List) complexMap.get("uploadFieldList"); + uploadFieldList.add(item); + complexMap.put("uploadFieldList", uploadFieldList); + } else { + complexNum.put(complexEnt.getId(), n); + Map complexMap = JsonUtil.entityToMap(complexEnt); + List> uploadFieldList = new ArrayList<>(); + uploadFieldList.add(item); + complexMap.put("uploadFieldList", uploadFieldList); + complexMap.put("vModel", "complexHeader"); + newUploadTemplates.add(complexMap); + n++; + } + } else { + newUploadTemplates.add(item); + n++; + } + } else { + newUploadTemplates.add(item); + n++; + } + + } + listMap.put("importFieldsNew", newUploadTemplates); + + listMap.put("selectKey", JSONObject + .toJSONString(JsonUtil.getListToJsonArray(uploaderTemplateModel.getSelectKey()).toJSONString())); + // 是否有子表-用于判断导入excel表头是否有两行 + listMap.put("importHasChildren", importHasChildren); + listMap.put("importType", importType); + // 导入字段名称是否重复 + listMap.put("nameAgain", nameAgain); + listMap.put("listOptions", listOptions); + + // 是否存在列表子表数据 + listMap.put("hasSub", mastTable.size() > 0 ? true : false); + + // 复杂表头 + List complexFieldList = new ArrayList<>(); + List> complexHeaderList = new ArrayList<>(); + if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { + for (HeaderModel headerModel : columnDataModel.getComplexHeaderList()) { + complexFieldList.addAll(headerModel.getChildColumns()); + Map map = JsonUtil.entityToMap(headerModel); + // 复杂表头添加导入字段信息 + List> uploadFieldList = new ArrayList<>(); + for (Map uploadmap : allUploadTemplates) { + if (headerModel.getChildColumns().contains(uploadmap.get("vModel"))) { + Map objectObjectHashMap = new HashMap<>(); + objectObjectHashMap.put("vModel", uploadmap.get("vModel")); + objectObjectHashMap.put("label", uploadmap.get("label")); + uploadFieldList.add(objectObjectHashMap); + } + } + map.put("uploadFieldList", uploadFieldList); + complexHeaderList.add(map); + } + } + listMap.put("complexHeaderList", JsonUtil.getListToJsonArray(complexHeaderList)); + listMap.put("complexFieldList", JsonUtil.getListToJsonArray(complexFieldList)); + + // 标签面板 + TabConfigModel tabConfig = columnDataModel.getTabConfig(); + if (tabConfig != null && tabConfig.isOn() && StringUtil.isNotEmpty(tabConfig.getRelationField()) + && (Objects.equals(columnDataModel.getType(), 1) || Objects.equals(columnDataModel.getType(), 4))) { + tabConfig.setCreateTab(true); + for (FormAllModel item : formAllModel) { + if (FormEnum.mast.getMessage().equals(item.getYunzhupaasKey()) + && tabConfig.getRelationField() + .equals(item.getFormColumnModel().getFieLdsModel().getVModel())) { + tabConfig.setFieldsModel( + BeanUtil.copyProperties(item.getFormColumnModel().getFieLdsModel(), FieLdsModel.class)); + break; + } + if (FormEnum.mastTable.getMessage().equals(item.getYunzhupaasKey()) + && tabConfig.getRelationField() + .equals(item.getFormMastTableModel().getMastTable().getFieLdsModel().getVModel())) { + tabConfig.setFieldsModel(BeanUtil.copyProperties( + item.getFormMastTableModel().getMastTable().getFieLdsModel(), FieLdsModel.class)); + break; + } + } + } + listMap.put("tabConfig", JsonUtil.entityToMap(tabConfig)); + } + } + + /** + * 添加左侧树查询字段 + * + * @param mainTableModel + * @param columnDataModel + * @param searchListAll + */ + private void addTreeSearchField(TableModel mainTableModel, ColumnDataModel columnDataModel, + List searchListAll) { + List cSaArr = searchListAll.stream().map(SearchTypeModel::getId).collect(Collectors.toList()); + boolean flag = false; + // 左侧树-若查询列表内没有需要添加到查询字段内 + if (Objects.equals(columnDataModel.getType(), 2)) { + String treeRelationField = columnDataModel.getTreeRelation(); + String treeVmodel = treeRelationField; + if (treeVmodel.matches(reg)) { + treeVmodel = treeVmodel.split("_yunzhupaas_")[1]; + } else if (treeVmodel.toLowerCase().startsWith(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX)) { + treeVmodel = treeVmodel.split("-")[1]; + } + + if (!cSaArr.contains(treeRelationField)) { + SearchTypeModel searchTypeModel = new SearchTypeModel(); + searchTypeModel.setId(treeRelationField); + searchTypeModel.setVModel(treeVmodel); + searchTypeModel.setSearchType(2); + if (columnDataModel.getTreeDataSource().equals("organize") + || columnDataModel.getTreeDataSource().equals("formField")) { + searchTypeModel.setYunzhupaasKey(YunzhupaasKeyConsts.COMSELECT); + searchTypeModel.setSearchType(1); + } + searchTypeModel.setLabel("tree"); + searchTypeModel.setTableName(mainTableModel.getTable()); + searchListAll.add(searchTypeModel); + cSaArr.add(searchTypeModel.getId()); + } + } + // 列表标签面板字段添加---目前标签字段只能下拉单选和单选框。代码匹配用等于 + if (Objects.equals(columnDataModel.getType(), 1) || Objects.equals(columnDataModel.getType(), 4) + || columnDataModel.getType() == null) { + TabConfigModel tabConfig = columnDataModel.getTabConfig(); + if (tabConfig != null && tabConfig.isOn() && StringUtil.isNotEmpty(tabConfig.getRelationField()) + && !cSaArr.contains(tabConfig.getRelationField())) { + String treeVmodel = tabConfig.getRelationField(); + if (treeVmodel.matches(reg)) { + treeVmodel = treeVmodel.split("_yunzhupaas_")[1]; + } else if (treeVmodel.toLowerCase().startsWith(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX)) { + treeVmodel = treeVmodel.split("-")[1]; + } + SearchTypeModel searchTypeModel = new SearchTypeModel(); + searchTypeModel.setId(tabConfig.getRelationField()); + searchTypeModel.setVModel(treeVmodel); + searchTypeModel.setSearchType(1); + searchTypeModel.setLabel("标签面板字段"); + searchTypeModel.setTableName(mainTableModel.getTable()); + searchListAll.add(searchTypeModel); + cSaArr.add(searchTypeModel.getId()); + } + } + } + + /** + * 查询字段配置调整 + * + * @param tableModelList + * @param mainTable + * @param tableRenames + * @param childKeyTableNameMap + * @param mainTableModel + * @param searchListAll + * @return + */ + private List getListSearchGroupModels(List tableModelList, TableModel mainTable, + Map tableRenames, Map childKeyTableNameMap, TableModel mainTableModel, + List searchListAll) { + List groupModels = new ArrayList<>(); + List rangeToLike = new ArrayList() { + { + add(YunzhupaasKeyConsts.COM_INPUT); + add(YunzhupaasKeyConsts.TEXTAREA); + } + }; + // 查询全字段-转换--pagenation-字段不用替换了 + searchListAll.stream().forEach(t -> { + t.setId(t.getId().replace("-", "_")); + // 单行和多行范围查询转模糊 + if (Objects.equals(t.getSearchType(), 3) && rangeToLike.contains(t.getConfig().getYunzhupaasKey())) { + t.setSearchType(2); + } + }); + if (searchListAll.size() > 0) { + searchListAll.stream().forEach(sl -> { + String fieldName = sl.getId(); + String tableName; + if (fieldName.toLowerCase().startsWith(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX)) { + String tableModelName = fieldName.split("_")[0]; + tableName = childKeyTableNameMap.get(tableModelName); + } else if (fieldName.matches(reg)) { + String[] split = fieldName.split("_yunzhupaas_"); + tableName = split[0].substring(5); + } else { + tableName = mainTable.getTable(); + } + AliasModel aliasModel = tableRenames.get(tableName); + Map fieldsMap = aliasModel.getFieldsMap(); + sl.setTableName(tableName); + sl.setTableAliasName(aliasModel.getAliasName()); + if (fieldName.matches(reg)) { + String[] split = fieldName.split("_yunzhupaas_"); + fieldName = fieldsMap.get(split[1]); + } else { + fieldName = fieldsMap.get(fieldName); + } + // 字段别名:副表字段拼接yunzhupaas_xxx_yunzhupaas_xxx + sl.setAfterVModel(fieldName); + }); + // 副表--普通查询放回主表 + Map> collect = searchListAll.stream().filter(s -> s.getId().matches(reg)) + .collect(Collectors.groupingBy(t -> t.getTableName())); + groupModels = collect.entrySet().stream().map(c -> { + ListSearchGroupModel groupModel = new ListSearchGroupModel(); + groupModel.setModelName(tableRenames.get(c.getKey()).getAliasName()); + groupModel.setTableName(c.getKey()); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(c.getKey())) + .findFirst().orElse(null); + groupModel.setForeignKey(tableModel.getTableField()); + groupModel.setMainKey(tableModel.getRelationField()); + groupModel.setSearchTypeModelList(c.getValue()); + return groupModel; + }).collect(Collectors.toList()); + + // 子表--普通查询放回主表 + Map> collect1 = searchListAll.stream() + .filter(s -> s.getId().toLowerCase().contains(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX)) + .collect(Collectors.groupingBy(t -> t.getId().substring(0, t.getId().indexOf("_")))); + List collect2 = collect1.entrySet().stream().map(c -> { + ListSearchGroupModel groupModel = new ListSearchGroupModel(); + String tableName = childKeyTableNameMap.get(c.getKey()); + Map fieldsMap = tableRenames.get(tableName).getFieldsMap(); + groupModel.setModelName(tableRenames.get(tableName).getAliasName()); + groupModel.setTableName(tableName); + TableModel tableModel = tableModelList.stream().filter(t -> t.getTable().equalsIgnoreCase(tableName)) + .findFirst().orElse(null); + groupModel.setForeignKey(tableModel.getTableField()); + groupModel.setMainKey(tableModel.getRelationField()); + List value = c.getValue(); + value.stream().forEach(v -> { + String vmodel = v.getVModel(); + v.setTableName(tableRenames.get(tableName).getAliasName()); + v.setAfterVModel(fieldsMap.get(vmodel)); + }); + groupModel.setSearchTypeModelList(value); + return groupModel; + }).collect(Collectors.toList()); + groupModels.addAll(collect2); + + // 主表字段 + ListSearchGroupModel groupModel = new ListSearchGroupModel(); + AliasModel mainAlias = tableRenames.get(mainTable.getTable()); + List mainSearchList = searchListAll.stream().filter(s -> !s.getId().matches(reg) + && !s.getId().toLowerCase().contains(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX)) + .collect(Collectors.toList()); + groupModel.setSearchTypeModelList(mainSearchList); + groupModel.setTableName(mainTable.getTable()); + groupModel.setModelName(mainAlias.getAliasName()); + groupModels.add(groupModel); + } + return groupModels; + } + + /** + * 生成java代码 + * + * @param generateParamModel + * @param codeUtil 模板对象 + */ + private void setCode(GenerateParamModel generateParamModel, GenerateInterface codeUtil) throws Exception { + // 组装通用参数 + this.setCommonParam(generateParamModel); + + // 获取传递参数 + Map columndata = this.getcolumndata(generateParamModel); + + DbLinkEntity linkEntity = generateParamModel.getLinkEntity(); + Template7Model template7Model = generateParamModel.getTemplate7Model(); + String table = generateParamModel.getTable(); + String path = generateParamModel.getPath(); + + // 代码生成器创建 + CustomGenerator mpg = new CustomGenerator(columndata); + String cachePath = template7Model.getServiceDirectory() + generateParamModel.getFileName() + File.separator; + // 当前表别名及字段别名 + Map tableAliseMap = generateParamModel.getTableAliseMap(); + AliasModel aliasModel = tableAliseMap.get(generateParamModel.getTable()); + // 表别名 + String className = generateParamModel.getClassName(); + + // 全局配置 + GlobalConfig gc = new GlobalConfig.Builder() + .outputDir(cachePath) + .author(template7Model.getCreateUser()) + .dateType(DateType.TIME_PACK) + .commentDate("yyyy-MM-dd") + .disableOpenDir() + .build(); + mpg.setGlobalConfig(gc); + + // 数据源配置 + mpg.setDataSource(SourceUtil.dbConfig(TenantDataSourceUtil.getTenantSchema(), linkEntity)); + + // 策略配置 + String tableAlisName = DataControlUtils.captureName(className); + StrategyConfig sc = new StrategyConfig.Builder() + .addInclude(table) + .enableCapitalMode() + .enableSkipView() + .disableSqlFilter() + .entityBuilder() + .formatFileName(tableAlisName + GenerateConstant.ENTITY) + .enableLombok() + .disable() + .serviceBuilder() + .formatServiceFileName(tableAlisName + GenerateConstant.SERVICE) + .formatServiceImplFileName(tableAlisName + GenerateConstant.SERVICEIMPL) + .disable() + .controllerBuilder() + .formatFileName(tableAlisName + GenerateConstant.CONTROLLER) + .disable() + .mapperBuilder() + .formatMapperFileName(tableAlisName + GenerateConstant.MAPPER) + .formatXmlFileName(tableAlisName + GenerateConstant.MAPPER) + .disable() + .build(); + mpg.setStrategy(sc); + + // 包配置 + PackageConfig pc = new PackageConfig.Builder() + .parent(generateParamModel.getDownloadCodeForm().getModulePackageName()) + .build(); + mpg.setPackageInfo(pc); + + boolean autoIncrement = generateParamModel.isAutoIncrement(); + // 注入-自定义配置-字段映射 + BiConsumer> biConsumer = (tableInfo, objectMap) -> { + List fields = tableInfo.getFields(); + // 字段别名替换 + for (int n = 0; n < fields.size(); n++) { + TableField field = fields.get(n); + // String name = field.getName().toLowerCase(); + // name = name.startsWith("f_") ? name.substring(2) : name; + // String aliasName = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, + // name); + // 命名规范里面取别名 + String str = aliasModel.getFieldsMap().get(field.getName()); + String aliasName = StringUtil.isNotEmpty(str) ? str : field.getName(); + TableField tableField = field.setPropertyName(aliasName, field.getColumnType()); + if (autoIncrement && tableField.isKeyFlag() + && !field.getName().equalsIgnoreCase(TableFieldsNameConst.F_TENANT_ID)) { + tableField.primaryKey(true); + } + fields.set(n, tableField); + } + }; + + // 自定义模板和生成路径 + List custFileList = GenerateCommon.getCustomFileList(generateParamModel); + InjectionConfig cfg = new InjectionConfig.Builder().beforeOutputFile(biConsumer).customFile(custFileList) + .build(); + mpg.setCfg(cfg); + + // 禁用自带模板 + mpg.setTemplate(new TemplateConfig.Builder().disable().build()); + + // 执行生成 + mpg.execute(path); + } + + /** + * 生成前端代码 + * + * @param generateParamModel + * @param codeUtil + * @throws Exception + */ + private void generateHtml(GenerateParamModel generateParamModel, GenerateInterface codeUtil) throws Exception { + String fileName = generateParamModel.getFileName(); + String templatesPath = generateParamModel.getTemplatesPath(); + DownloadCodeForm downloadCodeForm = generateParamModel.getDownloadCodeForm(); + VisualdevEntity entity = generateParamModel.getEntity(); + + // tableList + List tablesList = generateParamModel.getTableModelList(); + Template7Model template7Model = generateParamModel.getTemplate7Model(); + List formAllModel = generateParamModel.getFormAllModel(); + // 自定义包名 + String modulePackageName = downloadCodeForm.getModulePackageName(); + // formTempJson + FormDataModel formData = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + // 取对应表的别名 + Map tableRenames = generateParamModel.getTableAliseMap(); + Map tableRenameMap = new HashMap<>(); + for (String key : tableRenames.keySet()) { + tableRenameMap.put(key, tableRenames.get(key).getAliasName()); + } + Map map = new HashMap<>(16); + + // form的属性 + List mast = formAllModel.stream() + .filter(t -> FormEnum.mast.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + List table = formAllModel.stream() + .filter(t -> FormEnum.table.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + List mastTable = formAllModel.stream() + .filter(t -> FormEnum.mastTable.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + + // 子表(tableField,tableName)->tablefield1->realname + Map childKeyTableNameMap = new HashMap<>(8); + table.stream().forEach( + t -> childKeyTableNameMap.put(t.getChildList().getTableModel(), t.getChildList().getTableName())); + Map childKeyRenameMap = new HashMap<>(8); + for (String key : childKeyTableNameMap.keySet()) { + childKeyRenameMap.put(key, tableRenames.get(childKeyTableNameMap.get(key)).getAliasName()); + } + // 主表赋值 + for (int i = 0; i < mast.size(); i++) { + FieLdsModel fieLdsModel = mast.get(i).getFormColumnModel().getFieLdsModel(); + ConfigModel configModel = fieLdsModel.getConfig(); + if (configModel.getDefaultValue() instanceof String) { + configModel.setValueType("String"); + } + if (configModel.getDefaultValue() == null) { + configModel.setValueType("undefined"); + } + fieLdsModel.setConfig(configModel); + } + // 副表列表字段赋值 + List formChildList = new ArrayList<>(); + Map> groupColumnDataMap = mastTable.stream() + .collect(Collectors.groupingBy(m -> m.getFormMastTableModel().getTable())); + // 副表model + for (String key : groupColumnDataMap.keySet()) { + Map objectMap = new HashMap<>(); + String childClassName = DataControlUtils.captureName(tableRenames.get(key).getAliasName()); + ColumnListDataModel columnListDataModel = new ColumnListDataModel(); + columnListDataModel.setModelName(childClassName); + columnListDataModel.setModelUpName(DataControlUtils.captureName(childClassName)); + columnListDataModel.setModelLowName(DataControlUtils.initialLowercase(childClassName)); + + List mastAllFields = groupColumnDataMap.get(key); + List allModels = new ArrayList<>(); + mastAllFields.stream().forEach(m -> { + FormAllModel newModel = JsonUtil.getJsonToBean(m, FormAllModel.class); + String vModel = newModel.getFormMastTableModel().getField(); + newModel.getFormMastTableModel().getMastTable().getFieLdsModel().setVModel(vModel); + allModels.add(newModel); + }); + List fields = allModels.stream().map(m -> m.getFormMastTableModel().getField()) + .collect(Collectors.toList()); + columnListDataModel.setFieldList(fields); + columnListDataModel.setFieLdsModelList( + allModels.stream().map(al -> al.getFormMastTableModel()).collect(Collectors.toList())); + columnListDataModel.setTableName(key); + formChildList.add(columnListDataModel); + List children = allModels.stream() + .map(allModel -> allModel.getFormMastTableModel().getMastTable()).collect(Collectors.toList()); + FormColumnTableModel formColumnTableModel = new FormColumnTableModel(); + formColumnTableModel.setChildList(children); + objectMap.put("children", formColumnTableModel); + objectMap.put("genInfo", generateParamModel.getTemplate7Model()); + objectMap.put("package", modulePackageName); + objectMap.put("module", downloadCodeForm.getModule()); + objectMap.put("className", childClassName); + childrenTemplates(template7Model.getServiceDirectory() + fileName, + objectMap, downloadCodeForm, false, codeUtil); + } + // 子表赋值 + List> child = new ArrayList<>(); + // 子表model + for (int i = 0; i < table.size(); i++) { + FormColumnTableModel childList = table.get(i).getChildList(); + Map objectMap = JsonUtil.entityToMap(childList); + List tableList = childList.getChildList(); + + TableFields thisKeyFields = null; + TableModel thisTable = tablesList.stream().filter(t -> t.getTable().equals(childList.getTableName())) + .findFirst().orElse(null); + if (thisTable != null) { + thisKeyFields = thisTable.getFields().stream().filter(t -> Objects.equals(t.getPrimaryKey(), 1) + && !t.getField().equalsIgnoreCase(TableFeildsEnum.TENANTID.getField())).findFirst() + .orElse(null); + } + String childClassName = DataControlUtils + .captureName(tableRenames.get(childList.getTableName()).getAliasName()); + // 导入字段属性设置 + if (VisualWebTypeEnum.FORM_LIST.getType().equals(entity.getWebType()) + && !Objects.equals(entity.getType(), 3)) { + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(entity.getColumnData(), ColumnDataModel.class); + if (columnDataModel.getUploaderTemplateJson() != null) { + UploaderTemplateModel uploaderTemplateModel = JsonUtil + .getJsonToBean(columnDataModel.getUploaderTemplateJson(), UploaderTemplateModel.class); + List selectKey = uploaderTemplateModel.getSelectKey() != null + ? uploaderTemplateModel.getSelectKey() + : Collections.EMPTY_LIST; + tableList.stream().forEach(item -> { + String childFieldKey = item.getFieLdsModel().getConfig().getParentVModel() + "-" + + item.getFieLdsModel().getVModel(); + if (selectKey.contains(childFieldKey)) { + item.getFieLdsModel().setNeedImport(true); + } + }); + } + } + + // 子表别名 + childList.setAliasClassName(childClassName); + childList.setAliasUpName(DataControlUtils.captureName(childClassName)); + childList.setAliasLowName(DataControlUtils.initialLowercase(childClassName)); + // 去除复杂表头里面的字段(无用信息) + List complexHeaderList = childList.getComplexHeaderList(); + for (HeaderModel headerModel : complexHeaderList) { + headerModel.setChildList(null); + } + objectMap.put("children", childList); + objectMap.put("genInfo", generateParamModel.getTemplate7Model()); + objectMap.put("package", modulePackageName); + objectMap.put("module", downloadCodeForm.getModule()); + objectMap.put("className", childClassName); + objectMap.put("thisKeyFields", thisKeyFields);// 子表主键字段 + // 生成xxxmodel 和 xxxlist + childrenTemplates(template7Model.getServiceDirectory() + fileName, + objectMap, downloadCodeForm, true, codeUtil); + for (FormColumnModel columnModel : tableList) { + FieLdsModel fieLdsModel = columnModel.getFieLdsModel(); + List templateJson = fieLdsModel.getConfig().getTemplateJson(); + String json = templateJson.size() > 0 ? JsonUtil.getObjectToString(templateJson) + : fieLdsModel.getTemplateJson(); + fieLdsModel.setTemplateJson(json); + } + childList.setChildList(tableList); + Map childs = JsonUtil.entityToMap(childList); + child.add(childs); + } + + // 微服务标识 + map.put("isCloud", GenerateCommon.IS_CLOUD); + // 是列表,是流程判断 + if (VisualWebTypeEnum.FORM_LIST.getType().equals(entity.getWebType())) { + map.put("isList", true); + } + if (Objects.equals(downloadCodeForm.getEnableFlow(), 1)) { + map.put("isFlow", true); + } + // 界面 + map.put("genInfo", generateParamModel.getTemplate7Model()); + map.put("modelName", generateParamModel.getClassName()); + map.put("package", modulePackageName); + map.put("isMain", true); + map.put("moduleId", entity.getId()); + + map.put("module", downloadCodeForm.getModule()); + map.put("className", DataControlUtils.captureName(generateParamModel.getClassName())); + map.put("tableRenames", JSONObject.toJSONString(JsonUtil.getObjectToString(tableRenameMap))); + map.put("childKeyTableNameMap", JSONObject.toJSONString(JsonUtil.getObjectToString(childKeyTableNameMap))); + map.put("templateJsonAll", + JSONObject.toJSONString(GenerateCommon.getInterTemplateJson(formAllModel, childKeyRenameMap))); + // 乐观锁 + map.put("snowflake", formData.getPrimaryKeyPolicy() == 1); + map.put("version", formData.getConcurrencyLock()); + map.put("formRef", formData.getFormRef()); + map.put("formModel", formData.getFormModel()); + map.put("size", formData.getSize()); + map.put("labelPosition", formData.getLabelPosition()); + map.put("generalWidth", formData.getGeneralWidth()); + map.put("drawerWidth", formData.getDrawerWidth()); + map.put("fullScreenWidth", formData.getFullScreenWidth()); + map.put("formStyle", formData.getFormStyle()); + map.put("labelWidth", formData.getLabelWidth()); + map.put("labelSuffix", formData.getLabelSuffix()); + map.put("formRules", formData.getFormRules()); + map.put("gutter", formData.getGutter()); + map.put("disabled", formData.getDisabled()); + map.put("span", formData.getSpan()); + map.put("formBtns", formData.getFormBtns()); + map.put("idGlobal", formData.getIdGlobal()); + map.put("popupType", formData.getPopupType()); + // 表单按钮 + map.put("HasCancelBtn", formData.getHasCancelBtn()); + map.put("HasConfirmBtn", formData.getHasConfirmBtn()); + map.put("HasPrintBtn", formData.getHasPrintBtn()); + + map.put("cancelButtonText", formData.getCancelButtonText()); + map.put("cancelButtonTextI18nCode", formData.getCancelButtonTextI18nCode()); + map.put("confirmButtonText", formData.getConfirmButtonText()); + map.put("confirmButtonTextI18nCode", formData.getConfirmButtonTextI18nCode()); + map.put("printButtonText", formData.getPrintButtonText()); + map.put("printButtonTextI18nCode", formData.getPrintButtonTextI18nCode()); + + map.put("PrintId", JsonUtil.getObjectToString(formData.getPrintId())); + map.put("form", formAllModel); + + map.put("groupColumnDataMap", groupColumnDataMap); + map.put("formModelName", entity.getFullName()); + map.put("dbLinkId", entity.getDbLinkId()); + // 共用 + map.put("children", child); + map.put("fields", mast); + map.put("mastTable", mastTable); + map.put("columnChildren", formChildList); + map.put("pKeyName", generateParamModel.getPKeyName()); + map.put("pKeyNameOriginal", generateParamModel.getPKeyNameOriginal()); + String modelPathName = generateParamModel.getClassName().toLowerCase(); + map.put("modelPathName", modelPathName); + map.put("formModelName", entity.getFullName()); + map.put("formDataStr", JSONObject.toJSONString(GenerateCommon.objRemoveJson(entity.getFormData()))); + map.put("tableListStr", JSONObject.toJSONString(entity.getVisualTables())); + map.put("ableAll", JsonUtil.getListToJsonArray(formAllModel)); + map.put("hasConfirmAndAddBtn", formData.getHasConfirmAndAddBtn()); + // 单据规则 + Map billRule = DataControlUtils.getBillRule(formAllModel); + map.put("billRule", billRule); + + boolean hasUploadBtn = false; + boolean hasSuperQuery = false; + int columnTtype = 0; + // webType=2 列表生成 高级查询json,列表json,查询json enableflow启用流程 + if (VisualWebTypeEnum.FORM_LIST.getType().equals(entity.getWebType()) && !Objects.equals(entity.getType(), 3)) { + // 添加行参数 + generateParamModel.setMainTable(true); + getListColumndata(generateParamModel, map); + Map columnDataModel = JsonUtil.stringToMap(entity.getColumnData()); + // 按钮 + List btnDataList = JsonUtil.getJsonToList(columnDataModel.get("btnsList"), BtnData.class); + hasUploadBtn = btnDataList.stream().anyMatch(btn -> btn.getValue().equals("upload")); + // 是否开启高级查询 + hasSuperQuery = (boolean) columnDataModel.get("hasSuperQuery"); + columnTtype = (int) columnDataModel.get("type"); + // 最外层zip包路径名称 + String zipName = template7Model.getServiceDirectory() + fileName; + // 生成文件夹 + String htmlTSPath = XSSEscape.escapePath(zipName + File.separator + "html" + File.separator + "web" + + File.separator + modelPathName + File.separator + "helper"); + File htmlJSfile = new File(htmlTSPath); + if (!htmlJSfile.exists() && !"form".equals(downloadCodeForm.getModule())) { + htmlJSfile.mkdirs(); + } + + String superSqJsPath = htmlTSPath + File.separator + "superQueryJson.ts"; + String data = GenerateCommon.delNotSupport(columnDataModel.get("columnOptions")); + SuperQueryUtil.CreateJsFile(data, superSqJsPath, "superQueryJson"); + + String colData = GenerateCommon.delNotSupport(columnDataModel.get("columnList")); + String colListJsPath = htmlTSPath + File.separator + "columnList.ts"; + SuperQueryUtil.CreateJsFile(colData, colListJsPath, "columnList"); + + String searchData = GenerateCommon.delNotSupport(columnDataModel.get("searchList")); + String searchListJsPath = htmlTSPath + File.separator + "searchList.ts"; + SuperQueryUtil.CreateJsFile(searchData, searchListJsPath, "searchList"); + + // 生成复杂表头对象 + GenerateCommon.createComplexHeaderExcelVo(zipName, generateParamModel, entity, downloadCodeForm, map); + } + + /** + * 生成前端及后端model文件 + */ + GenerateCommon.htmlTemplates(template7Model.getServiceDirectory() + fileName, + map, templatesPath, columnTtype, hasUploadBtn, downloadCodeForm, codeUtil); + + /** + * 生成表单设计json文件 + */ + if (Objects.equals(downloadCodeForm.getEnableFlow(), 1) || Objects.equals(entity.getType(), 3)) { + VisualdevEntity visualdevEntity = FunctionFormPublicUtil.exportFlowFormJson(entity, generateParamModel); + SuperQueryUtil.CreateFlowFormJsonFile(JsonUtil.getObjectToString(visualdevEntity), + template7Model.getServiceDirectory() + fileName); + } + } + + /** + * 副子表model + * + * @param path 路径 + * @param object 模板数据 + */ + private void childrenTemplates(String path, Map object, DownloadCodeForm downloadCodeForm, + Boolean isChild, GenerateInterface codeUtil) { + // 获取模板列表 + List templates = codeUtil.getChildTemps(isChild); + VelocityContext context = new VelocityContext(); + context.put("context", object); + for (String templateName : templates) { + String className = object.get("className").toString(); + String fileNames = GenerateCommon.getFileName(path, templateName, className, downloadCodeForm); + GenerateCommon.velocityWriterFile(context, templateName, fileNames); + } + } + + /** + * app代码生成 + * + * @param generateParamModel 参数 + */ + private void generateApp(GenerateParamModel generateParamModel) throws Exception { + VisualdevEntity entity = generateParamModel.getEntity(); + DownloadCodeForm downloadCodeForm = generateParamModel.getDownloadCodeForm(); + UserInfo userInfo = generateParamModel.getUserInfo(); + String templatesPath = generateParamModel.getTemplatesPath(); + String fileName = generateParamModel.getFileName(); + DataSourceUtil dataSourceUtil = generateParamModel.getDataSourceUtil(); + DbLinkEntity linkEntity = generateParamModel.getLinkEntity(); + String column = StringUtil.isNotEmpty(entity.getColumnData()) ? entity.getColumnData() : "{}"; + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(column, ColumnDataModel.class); + boolean groupTable = "3".equals(String.valueOf(columnDataModel.getType())); + String dataModel = StringUtil.isNotEmpty(entity.getFormData()) ? entity.getFormData() : "{}"; + FormDataModel model = JsonUtil.getJsonToBean(dataModel, FormDataModel.class); + model.setModule(downloadCodeForm.getModule()); + model.setClassName(generateParamModel.getClassName()); + model.setAreasName(downloadCodeForm.getModule()); + // app信息调整 + VisualdevEntity entityCopy = BeanUtil.copyProperties(entity, VisualdevEntity.class); + entityCopy.setColumnData(entity.getAppColumnData()); + AppGenModel appGenModel = new AppGenModel(); + appGenModel.setEntity(entityCopy); + appGenModel.setPKeyName(generateParamModel.getPKeyNameOriginal()); + appGenModel.setDownloadCodeForm(downloadCodeForm); + appGenModel.setUserInfo(userInfo); + appGenModel.setTemplatePath(templatesPath); + appGenModel.setFileName(fileName); + appGenModel.setLinkEntity(linkEntity); + appGenModel.setDataSourceUtil(dataSourceUtil); + appGenModel.setGroupTable(groupTable); + appGenModel.setType(String.valueOf(columnDataModel.getType())); + appGenModel.setModel(model); + appGenModel.setTableAliseMap(generateParamModel.getTableAliseMap()); + appGenModel.setTemplate7Model(generateParamModel.getTemplate7Model()); + AppGenUtil appGenUtil = new AppGenUtil(); + appGenUtil.htmlTemplates(appGenModel); + } +} diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-biz/src/main/java/com/yunzhupaas/generater/service/VisualdevGenService.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-biz/src/main/java/com/yunzhupaas/generater/service/VisualdevGenService.java new file mode 100644 index 0000000..d9d8ec5 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-biz/src/main/java/com/yunzhupaas/generater/service/VisualdevGenService.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.generater.service; + + +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.model.DownloadCodeForm; +import com.yunzhupaas.base.service.SuperService; + +/** + * 可视化开发功能表 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-04-02 + */ +public interface VisualdevGenService extends SuperService { + + /** + * 代码生成v3 + * + * @param visualdevEntity 可视化开发功能 + * @param downloadCodeForm 下载相关信息 + * @return 下载文件名 + * @throws Exception ignore + */ + String codeGengerateV3(VisualdevEntity visualdevEntity, DownloadCodeForm downloadCodeForm) throws Exception; +} + + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-biz/src/main/java/com/yunzhupaas/generater/service/impl/VisualdevGenServiceImpl.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-biz/src/main/java/com/yunzhupaas/generater/service/impl/VisualdevGenServiceImpl.java new file mode 100644 index 0000000..9118488 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-biz/src/main/java/com/yunzhupaas/generater/service/impl/VisualdevGenServiceImpl.java @@ -0,0 +1,199 @@ +package com.yunzhupaas.generater.service.impl; + +import com.google.common.base.CaseFormat; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.mapper.VisualdevMapper; +import com.yunzhupaas.base.model.DownloadCodeForm; +import com.yunzhupaas.base.model.VisualWebTypeEnum; +import com.yunzhupaas.base.service.DbLinkService; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.base.service.SysconfigService; +import com.yunzhupaas.base.service.VisualAliasService; +import com.yunzhupaas.base.util.VisualUtils; +import com.yunzhupaas.base.util.common.AliasModel; +import com.yunzhupaas.base.util.common.GenerateCommon; +import com.yunzhupaas.base.util.common.GenerateParamModel; +import com.yunzhupaas.base.util.custom.VelocityEnum; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.GenerateConstant; +import com.yunzhupaas.database.model.entity.DbLinkEntity; +import com.yunzhupaas.database.util.DataSourceUtil; +import com.yunzhupaas.generater.factory.CodeGenerateFactoryV3; +import com.yunzhupaas.generater.model.FormDesign.TemplateMethodEnum; +import com.yunzhupaas.generater.service.VisualdevGenService; +import com.yunzhupaas.model.FileListVO; +import com.yunzhupaas.model.OnlineDevData; +import com.yunzhupaas.model.visualJson.TableModel; +import com.yunzhupaas.util.*; +import org.apache.velocity.app.Velocity; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 可视化开发功能表 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-04-02 + */ +@Service +public class VisualdevGenServiceImpl extends SuperServiceImpl implements VisualdevGenService { + + + @Autowired + private DataSourceUtil dataSourceUtil; + @Autowired + private DbLinkService dataSourceApi; + + @Autowired + private ConfigValueUtil configValueUtil; + + @Autowired + private CodeGenerateFactoryV3 GenerateFactoryV3; + + @Autowired + private SysconfigService sysconfigService; + + @Autowired + private VisualAliasService aliasService; + + /** + * vue3代码生成 + * + * @param entity 可视化开发功能 + * @param downloadCodeForm 下载相关信息 + * @return + * @throws Exception + */ + @Override + public String codeGengerateV3(VisualdevEntity entity, DownloadCodeForm downloadCodeForm) throws Exception { + UserInfo userInfo = UserProvider.getUser(); + DbLinkEntity linkEntity = null; + if (entity != null) { + //初始化模板 + Velocity.reset(); + VelocityEnum.init.initVelocity(GenerateCommon.getLocalBasePath() + configValueUtil.getTemplateCodePathVue3()); + + //视图代码生成独立逻辑 + if(VisualWebTypeEnum.DATA_VIEW.getType().equals(entity.getWebType())){ + String fileName = entity.getFullName() + "_" + DateUtil.nowDateTime(); + String mainClass = "St" + entity.getEnCode(); + downloadCodeForm.setMainClassName(mainClass); + System.out.print(GenerateCommon.getLocalBasePath()); + System.out.print(configValueUtil.getTemplateCodePathVue3()); + //执行代码生成器 + GenerateParamModel generateParamModel = new GenerateParamModel().builder() + .path(GenerateCommon.getLocalBasePath() + configValueUtil.getTemplateCodePathVue3()) + .fileName(fileName) + .downloadCodeForm(downloadCodeForm) + .entity(entity) + .userInfo(userInfo) + .configValueUtil(configValueUtil) + .className(mainClass) + .templatesPath(TemplateMethodEnum.T6.getMethod()) + .template7Model(GenerateCommon.getTemplate7Model(sysconfigService.getList(GenerateConstant.SYSCONFIG))) + .build(); + GenerateFactoryV3.runGenerator(TemplateMethodEnum.T6.getMethod(), generateParamModel); + return fileName; + } + // 是否存在关联数据库 + if (StringUtil.isNotEmpty(entity.getDbLinkId())) { + linkEntity = dataSourceApi.getInfo(entity.getDbLinkId()); + } + // 是否存在关联表 + if (StringUtil.isNotEmpty(entity.getVisualTables())) { + String fileName = entity.getFullName() + "_" + DateUtil.nowDateTime(); + + List list = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + Map tableAliasMap = aliasService.getAllFiledsAlias(entity.getId()); + + //获取主表 + String mainTable = list.stream().filter(t -> "1".equals(t.getTypeId())).findFirst().orElse(null).getTable(); + Map fieldsMap = tableAliasMap.get(mainTable).getFieldsMap(); + //获取主键 + String pKeyName = VisualUtils.getpKey(linkEntity, mainTable); + + //自定义包名 + String modulePackageName = StringUtil.isNotEmpty(downloadCodeForm.getModulePackageName()) ? downloadCodeForm.getModulePackageName() : + GenerateConstant.PACKAGE_NAME; + downloadCodeForm.setModulePackageName(modulePackageName); + downloadCodeForm.setMainClassName(tableAliasMap.get(mainTable).getAliasName()); + //获取其他子表的主键 + Map childpKeyMap = new HashMap<>(16); + for (TableModel tableModel : list) { + String childKey = VisualUtils.getpKey(linkEntity, tableModel.getTable()); + if (childKey.length() > 2) { + if ("f_".equals(childKey.substring(0, 2).toLowerCase())) { + childKey = childKey.substring(2); + } + } + childpKeyMap.put(tableModel.getTable(), childKey); + } + + String templatesPath = null; + //功能表单 + if (OnlineDevData.FORM_TYPE_DEV.equals(entity.getType())) { + switch (entity.getWebType()) { + case 1: + templatesPath = downloadCodeForm.getEnableFlow() == 1 ? TemplateMethodEnum.T5.getMethod() : TemplateMethodEnum.T4.getMethod() ; + break; + case 2: + templatesPath = downloadCodeForm.getEnableFlow() == 1 ? TemplateMethodEnum.T3.getMethod() : TemplateMethodEnum.T2.getMethod() ; + break; + default: + break; + } + } + //非本地模板需要下载-获取模板如下 + if (!FileUploadUtils.getDefaultPlatform().startsWith(GenerateConstant.LOCAL)) { + List fileList = new ArrayList<>(); + fileList.addAll(FileUploadUtils.getDefaultFileList(configValueUtil.getTemplateCodePathVue3())); + String basePath = FileUploadUtils.getBasePath(); + for (FileListVO fileListVO : fileList) { + String eachFileName = fileListVO.getFileName(); + int index = eachFileName.lastIndexOf("/"); + //服务器路径 + String floderName = eachFileName.substring(0, index + 1); + if(StringUtil.isNotEmpty(basePath) && floderName.contains(basePath)){ + floderName = floderName.substring(basePath.length()); + } + //本地路径 + String filePath = FileUploadUtils.getLocalBasePath() + floderName; + //文件名 + String objectName = eachFileName.substring(index + 1); + FileUploadUtils.downLocal(floderName, filePath, objectName); + } + } + System.out.print(GenerateCommon.getLocalBasePath()); + System.out.print(configValueUtil.getTemplateCodePathVue3()); + //执行代码生成器 + GenerateParamModel generateParamModel = new GenerateParamModel().builder() + .dataSourceUtil(dataSourceUtil) + .path(GenerateCommon.getLocalBasePath() + configValueUtil.getTemplateCodePathVue3()) + .fileName(fileName) + .templatesPath(templatesPath) + .downloadCodeForm(downloadCodeForm) + .entity(entity) + .userInfo(userInfo) + .configValueUtil(configValueUtil) + .linkEntity(linkEntity) + .pKeyNameOriginal(pKeyName) + .pKeyName(fieldsMap.get(pKeyName)) + .template7Model(GenerateCommon.getTemplate7Model(sysconfigService.getList(GenerateConstant.SYSCONFIG))) + .tableAliseMap(tableAliasMap) + .build(); + GenerateFactoryV3.runGenerator(templatesPath, generateParamModel); + return fileName; + } + } + return null; + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-controller/pom.xml b/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-controller/pom.xml new file mode 100644 index 0000000..5359524 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-controller/pom.xml @@ -0,0 +1,22 @@ + + + + yunzhupaas-visualdev-generater + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-visualdev-generater-controller + + + + com.yunzhupaas + yunzhupaas-visualdev-generater-biz + ${project.version} + + + + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-controller/src/main/java/com/yunzhupaas/generater/controller/VisualdevGenController.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-controller/src/main/java/com/yunzhupaas/generater/controller/VisualdevGenController.java new file mode 100644 index 0000000..ef39a59 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-controller/src/main/java/com/yunzhupaas/generater/controller/VisualdevGenController.java @@ -0,0 +1,294 @@ +package com.yunzhupaas.generater.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaMode; +import cn.xuyanwu.spring.file.storage.FileInfo; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.servlet.http.HttpServletRequest; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.entity.VisualdevReleaseEntity; +import com.yunzhupaas.base.model.DownloadCodeForm; +import com.yunzhupaas.base.model.VisualAliasForm; +import com.yunzhupaas.base.model.read.ReadListVO; +import com.yunzhupaas.base.model.read.ReadModel; +import com.yunzhupaas.base.service.DictionaryDataService; +import com.yunzhupaas.base.service.VisualAliasService; +import com.yunzhupaas.base.service.VisualdevReleaseService; +import com.yunzhupaas.base.service.VisualdevService; +import com.yunzhupaas.base.util.ReadFile; +import com.yunzhupaas.base.util.VisualUtil; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.FileTypeConstant; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.generater.service.VisualdevGenService; +import com.yunzhupaas.model.visualJson.TableModel; +import com.yunzhupaas.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; + +/** + * 可视化开发功能表 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/3/16 + */ +@Tag(name = "代码生成器", description = "Generater") +@RestController +@RequestMapping("/api/visualdev/Generater") +public class VisualdevGenController { + + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private RedisUtil redisUtil; + @Autowired + private VisualdevService visualdevService; + @Autowired + private VisualdevReleaseService visualdevReleaseService; + @Autowired + private VisualdevGenService visualdevGenService; + @Autowired + private DictionaryDataService dictionaryDataApi; + @Autowired + private VisualAliasService aliasService; + + + /** + * 下载文件 + * + * @return + */ + @NoDataSourceBind() + @Operation(summary = "下载文件") + @GetMapping("/DownloadVisCode") + public void downloadCode() throws DataException { + HttpServletRequest request = ServletUtil.getRequest(); + String reqJson = request.getParameter("encryption"); + String name = request.getParameter("name"); + String fileNameAll = DesUtil.aesDecode(reqJson); + if (!StringUtil.isEmpty(fileNameAll)) { + String token = fileNameAll.split("#")[0]; + if (TicketUtil.parseTicket(token) != null) { + TicketUtil.deleteTicket(token); + String fileName = fileNameAll.split("#")[1]; + String path = FilePathUtil.getFilePath(FileTypeConstant.CODETEMP); + //下载到本地 + byte[] bytes = FileUploadUtils.downloadFileByte(path, fileName, false); + FileDownloadUtil.downloadFile(bytes, fileName, name); + //删除打包的临时文件,释放存储 + FileUploadUtils.deleteFileByPathAndFileName(path, fileName); + } else { + throw new DataException(MsgCode.VS014.get()); + } + } else { + throw new DataException(MsgCode.VS014.get()); + } + } + + @Operation(summary = "获取命名空间") + @GetMapping("/AreasName") + @SaCheckPermission(value = {"onlineDev.webDesign", "generator.webForm", "generator.flowForm"}, mode = SaMode.OR) + public ActionResult getAreasName() { + String areasName = configValueUtil.getCodeAreasName(); + List areasNameList = new ArrayList(Arrays.asList(areasName.split(","))); + return ActionResult.success(areasNameList); + } + + @Operation(summary = "下载代码") + @Parameters({ + @Parameter(name = "id", description = "主键"), + }) + @PostMapping("/{id}/Actions/DownloadCode") + @SaCheckPermission(value = {"onlineDev.webDesign", "generator.webForm", "generator.flowForm"}, mode = SaMode.OR) + @DSTransactional + public ActionResult downloadCode(@PathVariable("id") String id, @RequestBody DownloadCodeForm downloadCodeForm) throws Exception { + if (downloadCodeForm.getModule() != null) { + DictionaryDataEntity info = dictionaryDataApi.getInfo(downloadCodeForm.getModule()); + if (info != null) { + downloadCodeForm.setModule(info.getEnCode()); + } + } + VisualdevEntity visualdevEntity = JsonUtil.getJsonToBean(visualdevReleaseService.getById(id), VisualdevEntity.class); + String s = VisualUtil.checkPublishVisualModel(visualdevEntity, MsgCode.VS006.get()); + if (s != null) { + return ActionResult.fail(s); + } + DownloadVO vo; + String fileName = visualdevGenService.codeGengerateV3(visualdevEntity, downloadCodeForm); + + //服务器生成路径 + String filePath = FileUploadUtils.getLocalBasePath() + configValueUtil.getServiceDirectoryPath() + fileName + ".zip"; + FileUtil.toZip(filePath, true, FileUploadUtils.getLocalBasePath() + configValueUtil.getServiceDirectoryPath() + fileName); + // 删除源文件 + FileUtil.deleteFileAll(new File(FileUploadUtils.getLocalBasePath() + configValueUtil.getServiceDirectoryPath() + fileName)); + + //上传压缩包到服务器 + MultipartFile multipartFile = FileUtil.createFileItem(new File(XSSEscape.escapePath(filePath))); + FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, configValueUtil.getServiceDirectoryPath(), fileName + ".zip"); + // 删除压缩包 + FileUtil.deleteFileAll(new File(filePath)); + //下载文件服务器上的压缩包 + vo = DownloadVO.builder().name(fileInfo.getFilename()).url(UploaderUtil.uploaderVisualFile(fileInfo.getFilename()) + "&name=" + fileName + ".zip").build(); + if (vo == null) { + return ActionResult.fail(MsgCode.FA006.get()); + } + return ActionResult.success(vo); + } + + + /** + * 输出移动开发模板 + * + * @return + */ + @Operation(summary = "预览代码") + @Parameters({ + @Parameter(name = "id", description = "主键"), + }) + @PostMapping("/{id}/Actions/CodePreview") + @SaCheckPermission(value = {"onlineDev.webDesign", "generator.webForm", "generator.flowForm"}, mode = SaMode.OR) + public ActionResult codePreview(@PathVariable("id") String id, @RequestBody DownloadCodeForm downloadCodeForm) throws Exception { + if (downloadCodeForm.getModule() != null) { + DictionaryDataEntity info = dictionaryDataApi.getInfo(downloadCodeForm.getModule()); + if (info != null) { + downloadCodeForm.setModule(info.getEnCode()); + } + } + VisualdevReleaseEntity releaseEntity = visualdevReleaseService.getById(id); + VisualdevEntity visualdevEntity = JsonUtil.getJsonToBean(releaseEntity, VisualdevEntity.class); + String s = VisualUtil.checkPublishVisualModel(visualdevEntity, "预览"); + if (s != null) { + return ActionResult.fail(s); + } + String fileName = visualdevGenService.codeGengerateV3(visualdevEntity, downloadCodeForm); + + List dataList = ReadFile.priviewCode(FileUploadUtils.getLocalBasePath() + configValueUtil.getServiceDirectoryPath() + fileName); + // 删除源文件 + FileUtil.deleteFileAll(new File(FileUploadUtils.getLocalBasePath() + configValueUtil.getServiceDirectoryPath() + fileName)); + if (dataList.size() == 0) { + return ActionResult.fail(MsgCode.FA015.get()); + } + + //代码对比 + if (downloadCodeForm.isContrast()) { + VisualdevEntity oldEntity = visualdevService.getInfo(id); + //修改状态 - 旧的是已发布,新的是草稿版本;发布状态 - 旧的是 旧的发布版本,新的是当前发布版本; + boolean statusUpdate = true; + if (Objects.equals(oldEntity.getState(), 1) && StringUtil.isNotBlank(releaseEntity.getOldContent())) { + statusUpdate = false; + VisualdevEntity jsonToBean = JsonUtil.getJsonToBean(releaseEntity.getOldContent(), VisualdevEntity.class); + oldEntity.setVisualTables(jsonToBean.getVisualTables()); + oldEntity.setFormData(jsonToBean.getFormData()); + oldEntity.setColumnData(jsonToBean.getColumnData()); + oldEntity.setAppColumnData(jsonToBean.getAppColumnData()); + oldEntity.setWebType(jsonToBean.getWebType()); + oldEntity.setDbLinkId(jsonToBean.getDbLinkId()); + } + + String oldFileName = visualdevGenService.codeGengerateV3(oldEntity, downloadCodeForm); + List oldDataList = ReadFile.priviewCode(FileUploadUtils.getLocalBasePath() + configValueUtil.getServiceDirectoryPath() + oldFileName); + // 删除源文件 + FileUtil.deleteFileAll(new File(FileUploadUtils.getLocalBasePath() + configValueUtil.getServiceDirectoryPath() + oldFileName)); + + for (ReadListVO m : dataList) { + ReadListVO n = oldDataList.stream().filter(t -> m.getFileName().equals(t.getFileName())).findFirst().orElse(null); + if (Objects.nonNull(n)) { + List mChildren = m.getChildren(); + List nChildren = n.getChildren(); + for (ReadModel mChild : mChildren) { + ReadModel nChild = nChildren.stream().filter(t -> mChild.getFileName().equals(t.getFileName())).findFirst().orElse(null); + String nfileContent = Objects.nonNull(nChild) ? nChild.getFileContent() : ""; + if (statusUpdate) { + mChild.setOldFileContent(mChild.getFileContent()); + mChild.setFileContent(nfileContent); + } else { + mChild.setOldFileContent(nfileContent); + } + } + } + } + } + + ListVO datas = new ListVO<>(); + datas.setList(dataList); + return ActionResult.success(datas); + } + + /** + * App预览(后台APP表单设计) + * + * @return + */ + @Operation(summary = "App预览(后台APP表单设计)") + @Parameters({ + @Parameter(name = "data", description = "数据"), + }) + @PostMapping("/App/Preview") + @SaCheckPermission(value = {"onlineDev.webDesign", "generator.webForm", "generator.flowForm"}, mode = SaMode.OR) + public ActionResult appPreview(String data) { + String id = RandomUtil.uuId(); + redisUtil.insert(id, data, 300); + return ActionResult.success((Object) id); + } + + /** + * App预览(后台APP表单设计) + * + * @return + */ + @Operation(summary = "App预览查看") + @Parameters({ + @Parameter(name = "id", description = "主键"), + }) + @GetMapping("/App/{id}/Preview") + @SaCheckPermission(value = {"onlineDev.webDesign", "generator.webForm", "generator.flowForm"}, mode = SaMode.OR) + public ActionResult preview(@PathVariable("id") String id) { + if (redisUtil.exists(id)) { + Object object = redisUtil.getString(id); + return ActionResult.success(object); + } else { + return ActionResult.fail(MsgCode.FA019.get()); + } + } + + @Operation(summary = "获取命名规范") + @Parameters({ + @Parameter(name = "id", description = "主键"), + }) + @GetMapping("/{id}/Alias/Info") + @SaCheckPermission(value = {"onlineDev.webDesign", "generator.webForm", "generator.flowForm"}, mode = SaMode.OR) + public ActionResult getAliasInfo(@PathVariable("id") String id) { + List aliasInfo = aliasService.getAliasInfo(id); + return ActionResult.success(aliasInfo); + } + + @Operation(summary = "命名规范保存") + @Parameters({ + @Parameter(name = "id", description = "主键"), + }) + @PostMapping("/{id}/Alias/Save") + @SaCheckPermission(value = {"onlineDev.webDesign", "generator.webForm", "generator.flowForm"}, mode = SaMode.OR) + public ActionResult aliasSave(@PathVariable("id") String id, @RequestBody VisualAliasForm form) { + aliasService.aliasSave(id, form); + return ActionResult.success(MsgCode.SU002.get()); + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-entity/pom.xml b/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-entity/pom.xml new file mode 100644 index 0000000..84aad6a --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-entity/pom.xml @@ -0,0 +1,22 @@ + + + + yunzhupaas-visualdev-generater + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-visualdev-generater-entity + + + + com.yunzhupaas + yunzhupaas-common-all + ${project.version} + + + + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-entity/src/main/java/com/yunzhupaas/generater/model/FormDesign/ColumnChildListModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-entity/src/main/java/com/yunzhupaas/generater/model/FormDesign/ColumnChildListModel.java new file mode 100644 index 0000000..f0e7fb4 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-entity/src/main/java/com/yunzhupaas/generater/model/FormDesign/ColumnChildListModel.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.generater.model.FormDesign; + +import lombok.Data; + +import java.util.List; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2022/7/5 + */ +@Data +public class ColumnChildListModel { + private String label; + private String tableField; + private String vModel; + private List fields; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-entity/src/main/java/com/yunzhupaas/generater/model/FormDesign/ColumnListDataModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-entity/src/main/java/com/yunzhupaas/generater/model/FormDesign/ColumnListDataModel.java new file mode 100644 index 0000000..9454623 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-entity/src/main/java/com/yunzhupaas/generater/model/FormDesign/ColumnListDataModel.java @@ -0,0 +1,79 @@ +package com.yunzhupaas.generater.model.FormDesign; + +import com.yunzhupaas.model.visualJson.FieLdsModel; +import com.yunzhupaas.model.visualJson.analysis.FormMastTableModel; +import lombok.Data; + +import java.util.List; + +/** + * 列表字段 + * + * @author 云筑产品开发平台组 + * @version V3.2 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2021/10/20 + */ +@Data +public class ColumnListDataModel { + /** + * model别名 + */ + private String modelName; + + /** + * 外键 + */ + private String relationField; + + /** + * 外键首字母大写 + */ + private String relationUpField; + + /** + * 关联主键 + */ + private String mainKey; + + /** + * 关联主键首字母大写 + */ + private String mainUpKey; + + /** + * 所拥有字段 + */ + private List fieldList; + + /** + * 控件属性 + */ + private List fieLdsModelList; + + /** + * 表名 + */ + private String tableName; + + /** + * 首字母小写 + */ + private String modelLowName; + + /** + * 首字母大写 + */ + private String modelUpName; + + /** + * 当前表主键 + */ + private String mainField; + + /** + * 对应控件(去除yunzhupaas) + */ + private List fieLdsModels; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-entity/src/main/java/com/yunzhupaas/generater/model/FormDesign/ColumnListModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-entity/src/main/java/com/yunzhupaas/generater/model/FormDesign/ColumnListModel.java new file mode 100644 index 0000000..42a5bcf --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-entity/src/main/java/com/yunzhupaas/generater/model/FormDesign/ColumnListModel.java @@ -0,0 +1,268 @@ +package com.yunzhupaas.generater.model.FormDesign; + +import com.yunzhupaas.model.visualJson.FieLdsModel; +import com.yunzhupaas.model.visualJson.config.ConfigModel; +import com.yunzhupaas.model.visualJson.options.ColumnOptionModel; +import com.yunzhupaas.model.visualJson.props.PropsModel; +import lombok.Data; + +import java.util.List; + +/** + * 列表 + * + * @author 云筑产品开发平台组 + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/8/17 + */ +@Data +public class ColumnListModel extends FieLdsModel { + + private boolean first = false; + + /** + * 字段 + */ + private String prop; + /** + * 列名 + */ + private String label; + /** + * 对齐 + */ + private String align; + + private String yunzhupaasKey; + + private String dataType; + + private String vModel; + + private Boolean sortable; + + /** + * 列表子表表名 + */ + private String columnTableName; + + /** + * 处理后的prop + */ + private String newProp; + + private Boolean multiple; + + private ConfigModel config; + private String placeholder; + private Object style; + private Boolean clearable; + private String prefixIcon; + private Integer precision; + private String suffixIcon; + private String maxlength; + private Boolean showWordLimit; + private Boolean readonly; + private Boolean disabled; + /** + * 关联表单id + */ + private String modelId=""; + /** + * 关联表单 二维码 条形码 字段 + */ + private String relationField; + private Boolean hasPage; + private String pageSize; + private String type; + private Object autosize; + private Integer step; + private Boolean stepstrictly; + private String controls; + private Object textStyle; + private Integer lineHeight; + private Integer fontSize; + private Boolean showChinese; + private Boolean showPassword; + + /** + * 大小 + */ + private String size; + private Boolean filterable; + /** + * 冻结 + */ + private String fixed = "none"; + /** + * 关联表单属性 + */ + private String showField; + /** + * 待定 + */ + private PropsModel props; + /** + * 待定 + */ + private Boolean showAllLevels; + private String separator; + private Boolean isrange; + private String rangeseparator; + private String startplaceholder; + private String endplaceholder; + private String format; + private String valueformat; + private Object pickeroptions; + private Integer max; + private Integer count; + private Boolean allowhalf; + private Boolean showText; + private Boolean showScore; + private Boolean showAlpha; + private String colorformat; + private String activetext; + private String inactivetext; + private String activecolor; + private String inactivecolor; + private String activeValue; + private String inactiveValue; + private Integer min; + private Boolean showStops; + private Boolean range; + private String content; + private String header; + private Boolean accordion; + private String tabPosition; + /** + * 未找到 + */ + private String accept; + private Boolean showTip; + private Integer fileSize; + private String sizeUnit; + private Integer limit; + private String contentposition; + private String buttonText; + private Integer level; + private String options; + private String actionText; + private String shadow; + private String name; + private String title; + + /** + * 查询方式 1.eq 2.like 3.between + */ + private Integer searchType; + private String interfaceId; + private List columnOptions; + private String propsValue; + + /** + * 开关 值 + */ + private String activeTxt = "开"; + private String inactiveTxt = "关"; + + /** + * 条形码 条码颜色 + */ + private String lineColor; + /** + * 条形码 背景色 + */ + private String background; + /** + * 条形码 宽高 + */ + private Integer width; + private Integer height; + /** + * 条形码 二维码 固定值 + */ + private String staticText; + + + /** + * 二维码 条码颜色 + */ + private String colorDark; + + /** + * 二维码 背景色 + */ + private String colorLight; + + /** + * 子表是否合计 + */ + private Boolean showSummary; + + /** + * 子表合计字段 + */ + private String summaryField; + + /** + * 所属部门展示内容 + */ + private String showLevel; + + /** + * 弹窗 样式属性 + */ + private String popupType; + private String popupTitle; + private String popupWidth; + + private String selectType; + + //自定义 + private String ableIds; + private String ableDepIds; + private String ablePosIds; + private String ableUserIds; + private String ableRoleIds; + private String ableGroupIds; + + private ColumnChildListModel columnChildListModel; + + //数字输入-金额大小写等属性 + private String addonAfter; + private String addonBefore; + private Boolean isAmountChinese; + private Boolean thousands; + + //时间控件新增字段 + private String startTime; + private String endTime; + private String startRelationField; + private String endRelationField; + + //单选多选样式 + private String direction; + private String optionType; + //单选样式风格 + private String buttonStyle; + /** + * 下拉补全展示条数 + */ + private Integer total; + private String id; + + private Boolean useScan = false; + private Boolean useMask = false; + private Object maskConfig; + + /** + * 定位地图属性 + */ + private boolean autoLocation = false; + private boolean enableLocationScope = false; + private int adjustmentScope; + private boolean enableDesktopLocation = false; + private List locationScope; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-entity/src/main/java/com/yunzhupaas/generater/model/FormDesign/ListSearchGroupModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-entity/src/main/java/com/yunzhupaas/generater/model/FormDesign/ListSearchGroupModel.java new file mode 100644 index 0000000..6375add --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-entity/src/main/java/com/yunzhupaas/generater/model/FormDesign/ListSearchGroupModel.java @@ -0,0 +1,38 @@ +package com.yunzhupaas.generater.model.FormDesign; +import lombok.Data; + +import java.util.List; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.2 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2021/10/22 + */ +@Data +public class ListSearchGroupModel { + /** + * 模型名 + */ + private String modelName; + /** + * 表名 + */ + private String tableName; + /** + * 外键 + */ + private String ForeignKey; + /** + * 关联主键 + */ + private String mainKey; + + /** + * 该表下的查询字段 + */ + private List searchTypeModelList; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-entity/src/main/java/com/yunzhupaas/generater/model/FormDesign/SearchTypeModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-entity/src/main/java/com/yunzhupaas/generater/model/FormDesign/SearchTypeModel.java new file mode 100644 index 0000000..882453f --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-entity/src/main/java/com/yunzhupaas/generater/model/FormDesign/SearchTypeModel.java @@ -0,0 +1,55 @@ +package com.yunzhupaas.generater.model.FormDesign; + +import com.yunzhupaas.model.visualJson.config.ConfigModel; +import lombok.Data; + +/** + * 代码生成器查询条件 + * + * @author 云筑产品开发平台组 + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2021/8/9 + */ +@Data +public class SearchTypeModel { + private String vModel; + private String dataType; + private Integer searchType; + private String label; + private String yunzhupaasKey; + private String format; + private String multiple; + /** + * 搜索框显示 + */ + private String placeholder; + private ConfigModel config; + + private String TableName; + //表别名 + private String tableAliasName; + //字段别名 + private String afterVModel; + + private String showLevel; + + //新增 拼接之后的vmodel和label + /** + * vmodel 子表副表拼接后得名称 + */ + private String id; + /** + * label 子表副表拼接后得名称 + */ + private String fullName; + /** + * 查询是否多选 + */ + private String searchMultiple; + /** + * 是否关键词 + */ + private Boolean isKeyword; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-entity/src/main/java/com/yunzhupaas/generater/model/FormDesign/TemplateMethodEnum.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-entity/src/main/java/com/yunzhupaas/generater/model/FormDesign/TemplateMethodEnum.java new file mode 100644 index 0000000..8b6dbd8 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-generater/yunzhupaas-visualdev-generater-entity/src/main/java/com/yunzhupaas/generater/model/FormDesign/TemplateMethodEnum.java @@ -0,0 +1,33 @@ +package com.yunzhupaas.generater.model.FormDesign; + +/** + * 模板路径 + * + * @author 云筑产品开发平台组 + * @version V3.2 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/10/8 + */ +public enum TemplateMethodEnum { + T1("TemplateCode1"), + T2("TemplateCode2"), + T3("TemplateCode3"), + T4("TemplateCode4"), + T5("TemplateCode5"), + T6("TemplateCode6"); + + TemplateMethodEnum(String method) { + this.method = method; + } + + public String getMethod() { + return method; + } + + public void setMethod(String method) { + this.method = method; + } + + private String method; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/pom.xml b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/pom.xml new file mode 100644 index 0000000..0abed55 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/pom.xml @@ -0,0 +1,21 @@ + + + + yunzhupaas-visualdev + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-visualdev-integrate + pom + + yunzhupaas-visualdev-integrate-entity + yunzhupaas-visualdev-integrate-biz + yunzhupaas-visualdev-integrate-controller + + + + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/pom.xml b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/pom.xml new file mode 100644 index 0000000..84296bf --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/pom.xml @@ -0,0 +1,44 @@ + + + + yunzhupaas-visualdev-integrate + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-visualdev-integrate-biz + + + + com.yunzhupaas + yunzhupaas-visualdev-integrate-entity + ${project.version} + + + com.yunzhupaas + yunzhupaas-visualdev-base-biz + ${project.version} + compile + + + com.yunzhupaas + yunzhupaas-visualdev-onlinedev-biz + ${project.version} + compile + + + com.yunzhupaas + yunzhupaas-provider + ${project.version} + + + com.yunzhupaas + yunzhupaas-flowable-biz + ${project.version} + compile + + + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/config/IntegrateConfig.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/config/IntegrateConfig.java new file mode 100644 index 0000000..eaa785e --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/config/IntegrateConfig.java @@ -0,0 +1,30 @@ +package com.yunzhupaas.integrate.config; + +import com.yunzhupaas.integrate.job.IntegrateQueryJobUtil; +import org.quartz.*; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class IntegrateConfig { + + @Bean + public JobDetail integrateJobDetail() { + JobDetail JobDetail = JobBuilder.newJob(IntegrateQueryJobUtil.class) + .storeDurably() //必须调用该方法,添加任务 + .build(); + return JobDetail; + } + + @Bean + public Trigger integrateTrigger() { + CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule("* * * * * ?"); + Trigger trigger = TriggerBuilder.newTrigger() + .forJob(integrateJobDetail()) + .withSchedule(cronScheduleBuilder) //对触发器配置任务 + .build(); + return trigger; + } + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/config/IntegrateListener.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/config/IntegrateListener.java new file mode 100644 index 0000000..6120a29 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/config/IntegrateListener.java @@ -0,0 +1,52 @@ +package com.yunzhupaas.integrate.config; + +import cn.hutool.core.util.ObjectUtil; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.integrate.job.Integrate; +import com.yunzhupaas.integrate.job.IntegrateJobUtil; +import com.yunzhupaas.integrate.job.QuartzUtil; +import com.yunzhupaas.integrate.model.nodeJson.IntegrateModel; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RedisUtil; +import com.yunzhupaas.util.StringUtil; +import org.quartz.JobDataMap; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.ApplicationArguments; +import org.springframework.boot.ApplicationRunner; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Component; + +import java.util.Date; +import java.util.List; +import java.util.Set; + +@Component +public class IntegrateListener implements ApplicationRunner { + + @Autowired + private RedisUtil redisUtil; + @Autowired + private RedisTemplate redisTemplate; + + @Override + public void run(ApplicationArguments args) throws Exception { + Set keysList = redisTemplate.keys(IntegrateJobUtil.WORKTIMEOUT_REDIS_KEY + "_key*"); + for (String id : keysList) { + redisTemplate.delete(id); + } + List hashValues = redisUtil.getHashValues(IntegrateJobUtil.IDGENERATOR_REDIS_KEY); + for (String value : hashValues) { + IntegrateModel integrateModel = JsonUtil.getJsonToBean(value, IntegrateModel.class); + JobDataMap jobDataMap = new JobDataMap(); + jobDataMap.putAll(JsonUtil.entityToMap(integrateModel)); + Date startTime = new Date(integrateModel.getStartTime()); + Date endTime = ObjectUtil.isNotEmpty(integrateModel.getEndTime()) ? new Date(integrateModel.getEndTime()) : null; + boolean isAdd = ObjectUtil.isNotEmpty(endTime) ? endTime.getTime() > System.currentTimeMillis() : true; + if (isAdd) { + QuartzUtil.addJob(integrateModel.getId(), integrateModel.getCron(), Integrate.class, jobDataMap, startTime, endTime); + } + } + } + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/job/Integrate.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/job/Integrate.java new file mode 100644 index 0000000..872a9d3 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/job/Integrate.java @@ -0,0 +1,97 @@ +package com.yunzhupaas.integrate.job; + +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.exception.TenantInvalidException; +import com.yunzhupaas.integrate.entity.IntegrateEntity; +import com.yunzhupaas.integrate.entity.IntegrateQueueEntity; +import com.yunzhupaas.integrate.model.nodeJson.IntegrateModel; +import com.yunzhupaas.integrate.service.IntegrateQueueService; +import com.yunzhupaas.integrate.service.IntegrateService; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.RedisUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.context.SpringContext; +import lombok.extern.slf4j.Slf4j; +import org.quartz.*; +import org.springframework.scheduling.quartz.QuartzJobBean; + +import java.util.Date; +import java.util.Objects; + + +@Slf4j +@DisallowConcurrentExecution +public class Integrate extends QuartzJobBean { + + + private static RedisUtil redisUtil; + private static ConfigValueUtil configValueUtil; + private static IntegrateService integrateService; + private static IntegrateQueueService integrateQueueService; + + static { + redisUtil = SpringContext.getBean(RedisUtil.class); + configValueUtil = SpringContext.getBean(ConfigValueUtil.class); + integrateService = SpringContext.getBean(IntegrateService.class); + integrateQueueService = SpringContext.getBean(IntegrateQueueService.class); + } + + @Override + protected void executeInternal(JobExecutionContext context) throws JobExecutionException { + JobDetail jobDetail = context.getJobDetail(); + String jobName = jobDetail.getKey().getName(); + JobDataMap jobDataMap = jobDetail.getJobDataMap(); + IntegrateModel model = IntegrateJobUtil.getModel(JsonUtil.getJsonToBean(jobDataMap, IntegrateModel.class), redisUtil); + boolean isModel = model == null; + IntegrateModel integrateModel = isModel ? JsonUtil.getJsonToBean(jobDataMap, IntegrateModel.class) : model; + if (integrateModel != null) { + UserInfo userInfo = integrateModel.getUserInfo(); + if (configValueUtil.isMultiTenancy()) { + try { + TenantDataSourceUtil.switchTenant(userInfo.getTenantId()); + }catch (TenantInvalidException e){ + // 租户无效 禁用调度, 删除任务 + log.error("Integrate, 租户无效, 删除任务:{}", userInfo.getTenantId()); + IntegrateJobUtil.removeModel(integrateModel, redisUtil); + QuartzUtil.deleteJob(jobName); + return; + } + } + IntegrateEntity info = integrateService.getInfo(integrateModel.getId()); + if (info != null) { + integrateModel.setTime(System.currentTimeMillis()); + Integer num = integrateModel.getNum(); + Integer endTimeType = integrateModel.getEndTimeType(); + Integer endLimit = integrateModel.getEndLimit(); + boolean isNext = Objects.equals(endTimeType, 1) ? num + 1 <= endLimit : Objects.equals(endTimeType, 2) ? integrateModel.getTime() <= integrateModel.getEndTime() : true; + integrateModel.setNum(++num); + if (isNext) { + IntegrateJobUtil.insertModel(integrateModel, redisUtil); + IntegrateQueueEntity entity = new IntegrateQueueEntity(); + entity.setState(0); + entity.setId(RandomUtil.uuId()); + entity.setIntegrateId(integrateModel.getId()); + entity.setExecutionTime(new Date()); + entity.setFullName(info.getFullName()); + IntegrateModel integrate = new IntegrateModel(); + integrate.setId(entity.getId()); + integrate.setUserInfo(userInfo); + IntegrateJobUtil.insertIntegrate(integrate,redisUtil); + integrateQueueService.create(entity); + } else { + IntegrateJobUtil.removeModel(integrateModel, redisUtil); + QuartzUtil.deleteJob(jobName); + } + } else { + IntegrateJobUtil.removeModel(integrateModel, redisUtil); + QuartzUtil.deleteJob(jobName); + } + } + } + + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/job/IntegrateJobUtil.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/job/IntegrateJobUtil.java new file mode 100644 index 0000000..d202308 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/job/IntegrateJobUtil.java @@ -0,0 +1,77 @@ +package com.yunzhupaas.integrate.job; + +import cn.hutool.core.util.ObjectUtil; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.integrate.model.nodeJson.IntegrateModel; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RedisUtil; +import com.yunzhupaas.util.StringUtil; +import lombok.extern.slf4j.Slf4j; + + +/** + * @author 云筑产品开发平台组 + * @version V3.3.0 flowable + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/15 17:37 + */ +@Slf4j +public class IntegrateJobUtil { + /** + * 缓存key + */ + public static final String WORKTIMEOUT_REDIS_KEY = "idgenerator_IntegrateList"; + + /** + * 缓存key + */ + public static final String IDGENERATOR_REDIS_KEY = "idgenerator_IntegrateModel"; + + /** + * 缓存key + */ + public static final String IDGENERATORID_REDIS_KEY = "idgenerator_id"; + + public static IntegrateModel getModel(IntegrateModel model, RedisUtil redisUtil) { + String id = model.getId(); + String hashValues = redisUtil.getHashValues(IDGENERATOR_REDIS_KEY, id); + IntegrateModel integrateModel = StringUtil.isNotEmpty(hashValues) ? JsonUtil.getJsonToBean(hashValues, IntegrateModel.class) : null; + return integrateModel; + } + + public static void insertModel(IntegrateModel model, RedisUtil redisUtil) { + String integrateId = model.getId(); + redisUtil.insertHash(IDGENERATOR_REDIS_KEY, integrateId, JsonUtil.getObjectToString(model)); + insertTenant(model, redisUtil); + } + + public static void removeModel(IntegrateModel model, RedisUtil redisUtil) { + redisUtil.removeHash(IDGENERATOR_REDIS_KEY, model.getId()); + } + + public static void insertTenant(IntegrateModel model, RedisUtil redisUtil) { + String tenantId = StringUtil.isNotEmpty(model.getUserInfo().getTenantId()) ? model.getUserInfo().getTenantId() : "yunzhupaas"; + UserInfo userInfo = model.getUserInfo(); + redisUtil.insertHash(WORKTIMEOUT_REDIS_KEY, tenantId, JsonUtil.getObjectToString(userInfo)); + } + + public static void removeTenant(String tenantId, RedisUtil redisUtil) { + tenantId = StringUtil.isNotEmpty(tenantId) ? tenantId : "com.yunzhupaas"; + redisUtil.removeHash(WORKTIMEOUT_REDIS_KEY, tenantId); + } + + public static boolean getIntegrate(IntegrateModel model, RedisUtil redisUtil){ + String value = redisUtil.getHashValues(IDGENERATORID_REDIS_KEY, model.getId()); + return ObjectUtil.isNotEmpty(value); + } + + public static void insertIntegrate(IntegrateModel model, RedisUtil redisUtil){ + redisUtil.insertHash(IDGENERATORID_REDIS_KEY, model.getId(), model.getId()); + } + + public static void removeIntegrate(IntegrateModel model, RedisUtil redisUtil){ + redisUtil.removeHash(IDGENERATORID_REDIS_KEY, model.getId()); + } + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/job/IntegrateQueryJobUtil.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/job/IntegrateQueryJobUtil.java new file mode 100644 index 0000000..aa504af --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/job/IntegrateQueryJobUtil.java @@ -0,0 +1,118 @@ +package com.yunzhupaas.integrate.job; + +import cn.hutool.http.HttpRequest; +import cn.hutool.http.Method; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.exception.TenantInvalidException; +import com.yunzhupaas.integrate.entity.IntegrateQueueEntity; +import com.yunzhupaas.integrate.model.nodeJson.IntegrateModel; +import com.yunzhupaas.integrate.service.IntegrateQueueService; +import com.yunzhupaas.integrate.util.IntegrateHttpModel; +import com.yunzhupaas.util.*; +import lombok.extern.slf4j.Slf4j; +import org.quartz.DisallowConcurrentExecution; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; +import org.springframework.scheduling.quartz.QuartzJobBean; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +@Slf4j +@DisallowConcurrentExecution +public class IntegrateQueryJobUtil extends QuartzJobBean { + + @Autowired + private RedisUtil redisUtil; + @Autowired + private RedisTemplate redisTemplate; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private IntegrateQueueService integrateQueueService; + + public static Map futureList = new HashMap<>(); + + private static ScheduledThreadPoolExecutor scheduledThreadPoolExecutor = null; + + IntegrateQueryJobUtil(ThreadPoolTaskExecutor threadPoolTaskExecutor) { + if(scheduledThreadPoolExecutor == null) { + scheduledThreadPoolExecutor = new ScheduledThreadPoolExecutor(20, threadPoolTaskExecutor.getThreadPoolExecutor().getThreadFactory()); + } + } + + @Override + protected void executeInternal(JobExecutionContext context) throws JobExecutionException { + List hashValues = redisUtil.getHashValues(IntegrateJobUtil.WORKTIMEOUT_REDIS_KEY); + for (String id : hashValues) { + UserInfo userInfo = JsonUtil.getJsonToBean(id, UserInfo.class); + String tenantId = StringUtil.isNotEmpty(userInfo.getTenantId()) ? userInfo.getTenantId() : "yunzhupaas"; + boolean useSuccess = redisTemplate.opsForValue().setIfAbsent(IntegrateJobUtil.WORKTIMEOUT_REDIS_KEY + "_key:" + tenantId, System.currentTimeMillis(), 3600, TimeUnit.SECONDS); + if (!useSuccess) continue; + if (futureList.get(tenantId) == null) { + ScheduledFuture scheduledFuture = scheduledThreadPoolExecutor.scheduleAtFixedRate(new Task(userInfo), 0, 1, TimeUnit.SECONDS); + futureList.put(tenantId, scheduledFuture); + } + } + } + + class Task implements Runnable { + private UserInfo userInfo; + + public Task(UserInfo userInfo) { + this.userInfo = userInfo; + } + + @Override + public void run() { + String tenantId = StringUtil.isNotEmpty(userInfo.getTenantId()) ? userInfo.getTenantId() : "yunzhupaas"; + if (configValueUtil.isMultiTenancy()) { + try { + TenantDataSourceUtil.switchTenant(userInfo.getTenantId()); + }catch (TenantInvalidException e){ + // 租户无效 删除缓存, 删除任务 + log.error("Task, 租户无效, 删除任务:{}", userInfo.getTenantId()); + IntegrateJobUtil.removeTenant(userInfo.getTenantId(), redisUtil); + ScheduledFuture scheduledFuture = futureList.get(userInfo.getTenantId()); + if(scheduledFuture != null) { + scheduledFuture.cancel(true); + } + } + } + List list = integrateQueueService.getList(); + if (list.size() > 0) { + String token = AuthUtil.loginTempUser(userInfo.getUserId(), userInfo.getTenantId(), true); + String url = configValueUtil.getApiDomain() + "/api/visualdev/Integrate/executeQuery"; + for (IntegrateQueueEntity entity : list) { + IntegrateModel model = new IntegrateModel(); + model.setUserInfo(userInfo); + model.setId(entity.getId()); + boolean integrate = IntegrateJobUtil.getIntegrate(model, redisUtil); + boolean useSuccess = redisTemplate.opsForValue().setIfAbsent(IntegrateJobUtil.WORKTIMEOUT_REDIS_KEY + "_key:" + entity.getId(), System.currentTimeMillis(), 3600, TimeUnit.SECONDS); + if (integrate && useSuccess) { + System.out.println("执行一组调度开始----------------------------"); + IntegrateHttpModel httpModel = new IntegrateHttpModel(); + httpModel.setUserInfo(UserProvider.getUser(token)); + httpModel.setId(entity.getId()); + HttpRequest request = HttpRequest.of(url).method(Method.POST).body(JsonUtil.getObjectToString(httpModel)); + request.header(Constants.AUTHORIZATION, token); + request.execute().body(); + System.out.println("执行一组调度结束----------------------------"); + } + } + } + //删除 + redisTemplate.delete(IntegrateJobUtil.WORKTIMEOUT_REDIS_KEY + "_key:" + tenantId); + } + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/job/QuartzUtil.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/job/QuartzUtil.java new file mode 100644 index 0000000..1d4b10f --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/job/QuartzUtil.java @@ -0,0 +1,75 @@ +package com.yunzhupaas.integrate.job; + +import lombok.extern.slf4j.Slf4j; +import org.quartz.*; +import org.quartz.impl.StdSchedulerFactory; + +import java.util.Date; + +@Slf4j +public class QuartzUtil { + + private static final SchedulerFactory schedulerFactory = new StdSchedulerFactory(); + + public static void addJob(String jobName, String cron, Class jobClass, JobDataMap jobDataMap, Date startDate, Date endDate) { + if (jobDataMap == null) { + jobDataMap = new JobDataMap(); + } + JobDetail jobDetail = JobBuilder.newJob(jobClass).withIdentity(jobName).setJobData(jobDataMap).build(); + Trigger trigger = TriggerBuilder.newTrigger() + .forJob(jobDetail) + .withIdentity(jobName) + .withSchedule(CronScheduleBuilder.cronSchedule(cron)) + .startAt(startDate == null ? new Date() : startDate) + .endAt(endDate != null ? endDate : null) + .build(); + try { + //获取实例化的 Scheduler。 + Scheduler scheduler = getScheduler(); + //将任务及其触发器放入调度器 + scheduler.scheduleJob(jobDetail, trigger); + //调度器开始调度任务 + if (!scheduler.isShutdown()) { + scheduler.start(); + } + } catch (SchedulerException e) { + log.error("新增调度失败:"+e.getMessage()); + } + } + + private static Scheduler getScheduler() { + try { + return schedulerFactory.getScheduler(); + } catch (SchedulerException e) { + e.getMessage(); + } + return null; + } + + public static void deleteJob(String jobName) { + try { + TriggerKey triggerKey = TriggerKey.triggerKey(jobName); + Scheduler scheduler = getScheduler(); + scheduler.pauseTrigger(triggerKey); + scheduler.unscheduleJob(triggerKey); + scheduler.deleteJob(JobKey.jobKey(jobName)); + } catch (SchedulerException e) { + log.error("删除调度失败:"+e.getMessage()); + } + } + + private static boolean isTriKey(String jobName) { + boolean flag = false; + try { + Scheduler sched = schedulerFactory.getScheduler(); + TriggerKey triggerKey = TriggerKey.triggerKey(jobName); + CronTrigger trigger = (CronTrigger) sched.getTrigger(triggerKey); + flag = trigger != null; + } catch (Exception e) { + e.getMessage(); + } + return flag; + } + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/mapper/IntegrateMapper.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/mapper/IntegrateMapper.java new file mode 100644 index 0000000..f6be831 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/mapper/IntegrateMapper.java @@ -0,0 +1,9 @@ +package com.yunzhupaas.integrate.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.integrate.entity.IntegrateEntity; + +public interface IntegrateMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/mapper/IntegrateNodeMapper.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/mapper/IntegrateNodeMapper.java new file mode 100644 index 0000000..3eec327 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/mapper/IntegrateNodeMapper.java @@ -0,0 +1,10 @@ +package com.yunzhupaas.integrate.mapper; + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.integrate.entity.IntegrateNodeEntity; + +public interface IntegrateNodeMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/mapper/IntegrateQueueMapper.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/mapper/IntegrateQueueMapper.java new file mode 100644 index 0000000..ab4b793 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/mapper/IntegrateQueueMapper.java @@ -0,0 +1,10 @@ +package com.yunzhupaas.integrate.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.integrate.entity.IntegrateEntity; +import com.yunzhupaas.integrate.entity.IntegrateQueueEntity; + +public interface IntegrateQueueMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/mapper/IntegrateTaskMapper.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/mapper/IntegrateTaskMapper.java new file mode 100644 index 0000000..c12ebe4 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/mapper/IntegrateTaskMapper.java @@ -0,0 +1,9 @@ +package com.yunzhupaas.integrate.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.integrate.entity.IntegrateTaskEntity; + +public interface IntegrateTaskMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/service/IntegrateNodeService.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/service/IntegrateNodeService.java new file mode 100644 index 0000000..1fa9441 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/service/IntegrateNodeService.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.integrate.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.integrate.entity.IntegrateNodeEntity; + +import java.util.List; + +public interface IntegrateNodeService extends SuperService { + + List getList(List id,String nodeCode); + + List getList(List id,String nodeCode, Integer isRetry); + + IntegrateNodeEntity getInfo(String id); + + void create(IntegrateNodeEntity entity); + + void update(String id,String nodeCode); + + Boolean update(String id, IntegrateNodeEntity entity); + + void delete(IntegrateNodeEntity entity); + + void delete(String id); +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/service/IntegrateQueueService.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/service/IntegrateQueueService.java new file mode 100644 index 0000000..4c87173 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/service/IntegrateQueueService.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.integrate.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.integrate.entity.IntegrateQueueEntity; + +import java.util.List; + +public interface IntegrateQueueService extends SuperService { + + List getList(); + + void create(IntegrateQueueEntity entity); + + Boolean update(String id, IntegrateQueueEntity entity); + + void delete(IntegrateQueueEntity entity); + + void delete(String integrateId); + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/service/IntegrateService.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/service/IntegrateService.java new file mode 100644 index 0000000..f66b052 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/service/IntegrateService.java @@ -0,0 +1,32 @@ +package com.yunzhupaas.integrate.service; + +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.integrate.entity.IntegrateEntity; +import com.yunzhupaas.integrate.model.integrate.IntegratePagination; + +import java.util.List; + +public interface IntegrateService extends SuperService { + + List getList(IntegratePagination pagination); + + List getList(IntegratePagination pagination, boolean isPage); + + IntegrateEntity getInfo(String id); + + Boolean isExistByFullName(String fullName, String id); + + Boolean isExistByEnCode(String encode, String id); + + void create(IntegrateEntity entity); + + ActionResult ImportData(IntegrateEntity entity, Integer type) throws WorkFlowException; + + Boolean update(String id, IntegrateEntity entity,boolean state); + + void delete(IntegrateEntity entity); + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/service/IntegrateTaskService.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/service/IntegrateTaskService.java new file mode 100644 index 0000000..01dfce6 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/service/IntegrateTaskService.java @@ -0,0 +1,23 @@ +package com.yunzhupaas.integrate.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.integrate.entity.IntegrateTaskEntity; +import com.yunzhupaas.integrate.model.integrate.IntegratePageModel; + +import java.util.List; + +public interface IntegrateTaskService extends SuperService { + + List getList(IntegratePageModel pagination); + + List getList(List id); + + IntegrateTaskEntity getInfo(String id); + + void create(IntegrateTaskEntity entity); + + Boolean update(String id, IntegrateTaskEntity entity); + + void delete(String id) ; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/service/impl/IntegrateNodeServiceImpl.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/service/impl/IntegrateNodeServiceImpl.java new file mode 100644 index 0000000..9a62b45 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/service/impl/IntegrateNodeServiceImpl.java @@ -0,0 +1,100 @@ +package com.yunzhupaas.integrate.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.integrate.entity.IntegrateNodeEntity; +import com.yunzhupaas.integrate.mapper.IntegrateNodeMapper; +import com.yunzhupaas.integrate.service.IntegrateNodeService; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Service +public class IntegrateNodeServiceImpl extends SuperServiceImpl implements IntegrateNodeService { + + + + @Override + public List getList(List id, String nodeCode) { + return getList(id,nodeCode,null); + } + + @Override + public List getList(List id, String nodeCode, Integer resultType) { + List list = new ArrayList<>(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (id.size() > 0) { + queryWrapper.lambda().in(IntegrateNodeEntity::getTaskId, id); + if (StringUtil.isNotEmpty(nodeCode)) { + queryWrapper.lambda().eq(IntegrateNodeEntity::getNodeCode, nodeCode); + } + if(ObjectUtil.isNotEmpty(resultType)){ + queryWrapper.lambda().eq(IntegrateNodeEntity::getResultType, resultType); + } + queryWrapper.lambda().orderByAsc(IntegrateNodeEntity::getSortCode); + queryWrapper.lambda().orderByAsc(IntegrateNodeEntity::getStartTime); + list.addAll(this.list(queryWrapper)); + } + return list; + } + + @Override + public IntegrateNodeEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(IntegrateNodeEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(IntegrateNodeEntity entity) { + if (StringUtil.isEmpty(entity.getId())) { + entity.setId(RandomUtil.uuId()); + } + entity.setIsRetry(1); + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + entity.setEnabledMark(1); + this.save(entity); + } + + @Override + public void update(String taskId, String nodeCode) { + UpdateWrapper queryWrapper = new UpdateWrapper<>(); + queryWrapper.lambda().eq(IntegrateNodeEntity::getTaskId,taskId); + queryWrapper.lambda().eq(IntegrateNodeEntity::getNodeCode,nodeCode); + queryWrapper.lambda().set(IntegrateNodeEntity::getIsRetry,0); + this.update(queryWrapper); + } + + @Override + public Boolean update(String id, IntegrateNodeEntity entity) { + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + return this.updateById(entity); + } + + @Override + public void delete(IntegrateNodeEntity entity) { + if(entity!=null) { + this.removeById(entity.getId()); + } + } + + @Override + public void delete(String taskId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(IntegrateNodeEntity::getTaskId,taskId); + this.remove(queryWrapper); + } + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/service/impl/IntegrateQueueServiceImpl.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/service/impl/IntegrateQueueServiceImpl.java new file mode 100644 index 0000000..9dbc728 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/service/impl/IntegrateQueueServiceImpl.java @@ -0,0 +1,56 @@ +package com.yunzhupaas.integrate.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.integrate.entity.IntegrateQueueEntity; +import com.yunzhupaas.integrate.mapper.IntegrateQueueMapper; +import com.yunzhupaas.integrate.service.IntegrateQueueService; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +@Service +public class IntegrateQueueServiceImpl extends SuperServiceImpl implements IntegrateQueueService { + + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().orderByAsc(IntegrateQueueEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public void create(IntegrateQueueEntity entity) { + if(StringUtil.isEmpty(entity.getId())){ + entity.setId(RandomUtil.uuId()); + } + entity.setCreatorTime(new Date()); + this.save(entity); + } + + @Override + public Boolean update(String id, IntegrateQueueEntity entity) { + entity.setId(id); + entity.setLastModifyTime(new Date()); + return this.updateById(entity); + } + + @Override + public void delete(IntegrateQueueEntity entity) { + if(entity!=null){ + this.removeById(entity.getId()); + } + } + + @Override + public void delete(String integrateId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(IntegrateQueueEntity::getIntegrateId,integrateId); + this.remove(queryWrapper); + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/service/impl/IntegrateServiceImpl.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/service/impl/IntegrateServiceImpl.java new file mode 100644 index 0000000..6d6cb28 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/service/impl/IntegrateServiceImpl.java @@ -0,0 +1,235 @@ +package com.yunzhupaas.integrate.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.integrate.entity.IntegrateEntity; +import com.yunzhupaas.integrate.job.Integrate; +import com.yunzhupaas.integrate.job.IntegrateJobUtil; +import com.yunzhupaas.integrate.job.QuartzUtil; +import com.yunzhupaas.integrate.mapper.IntegrateMapper; +import com.yunzhupaas.integrate.model.childnode.IntegrateChildNode; +import com.yunzhupaas.integrate.model.childnode.IntegrateProperties; +import com.yunzhupaas.integrate.model.integrate.IntegratePagination; +import com.yunzhupaas.integrate.model.nodeJson.IntegrateModel; +import com.yunzhupaas.integrate.service.IntegrateQueueService; +import com.yunzhupaas.integrate.service.IntegrateService; +import com.yunzhupaas.util.*; +import org.apache.commons.lang3.StringUtils; +import org.quartz.JobDataMap; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; + +@Service +public class IntegrateServiceImpl extends SuperServiceImpl implements IntegrateService { + + + @Autowired + private RedisUtil redisUtil; + @Autowired + private IntegrateQueueService integrateQueueService; + + @Override + public List getList(IntegratePagination pagination) { + return getList(pagination, true); + } + + @Override + public List getList(IntegratePagination pagination, boolean isPage) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(pagination.getKeyword())) { + queryWrapper.lambda().and( + t -> t.like(IntegrateEntity::getFullName, pagination.getKeyword()) + .or().like(IntegrateEntity::getEnCode, pagination.getKeyword()) + ); + } + if (ObjectUtil.isNotEmpty(pagination.getType())) { + queryWrapper.lambda().eq(IntegrateEntity::getType, pagination.getType()); + } + if (ObjectUtil.isNotEmpty(pagination.getFormId())) { + queryWrapper.lambda().eq(IntegrateEntity::getFormId, pagination.getFormId()); + } + if (ObjectUtil.isNotEmpty(pagination.getTrigger())) { + queryWrapper.lambda().eq(IntegrateEntity::getTriggerType, pagination.getTrigger()); + } + if (ObjectUtil.isNotEmpty(pagination.getEnabledMark())) { + queryWrapper.lambda().eq(IntegrateEntity::getEnabledMark, pagination.getEnabledMark()); + } + //排序 + if (StringUtils.isEmpty(pagination.getSidx())) { + queryWrapper.lambda().orderByDesc(IntegrateEntity::getCreatorTime); + } else { + queryWrapper = "asc".equals(pagination.getSort().toLowerCase()) ? queryWrapper.orderByAsc(pagination.getSidx()) : queryWrapper.orderByDesc(pagination.getSidx()); + } + if (isPage) { + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage userPage = page(page, queryWrapper); + return pagination.setData(userPage.getRecords(), page.getTotal()); + } + return this.list(queryWrapper); + } + + @Override + public IntegrateEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(IntegrateEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public Boolean isExistByFullName(String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(IntegrateEntity::getFullName, fullName); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(IntegrateEntity::getId, id); + } + return this.count(queryWrapper) > 0; + } + + @Override + public Boolean isExistByEnCode(String encode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(IntegrateEntity::getEnCode, encode); + if (!StringUtil.isEmpty(id)) { + queryWrapper.lambda().ne(IntegrateEntity::getId, id); + } + return this.count(queryWrapper) > 0; + } + + @Override + public void create(IntegrateEntity entity) { + if (StringUtil.isEmpty(entity.getId())) { + entity.setId(RandomUtil.uuId()); + } + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + formId(entity); + this.save(entity); + } + + @Override + @DSTransactional + public ActionResult ImportData(IntegrateEntity entity, Integer type) throws WorkFlowException { + if (entity != null) { + StringJoiner errList = new StringJoiner("、"); + String copyNum = UUID.randomUUID().toString().substring(0, 5); + if (this.getInfo(entity.getId()) != null) { + if (Objects.equals(type, 0)) { + errList.add("ID"); + } else { + entity.setId(RandomUtil.uuId()); + } + } + if (this.isExistByEnCode(entity.getEnCode(),null) ) { + if (Objects.equals(type, 0)) { + errList.add(MsgCode.IMP009.get()); + } else { + entity.setEnCode(entity.getEnCode() + copyNum); + } + } + if (this.isExistByFullName(entity.getFullName(), null) ) { + if (Objects.equals(type, 0)) { + errList.add(MsgCode.IMP008.get()); + } else { + entity.setFullName(entity.getFullName() + ".副本" + copyNum); + } + } + if (Objects.equals(type, 0) && errList.length() > 0) { + return ActionResult.fail(errList + MsgCode.IMP007.get()); + } + try { + this.setIgnoreLogicDelete().removeById(entity.getId()); + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(UserProvider.getLoginUserId()); + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + entity.setEnabledMark(0); + this.setIgnoreLogicDelete().saveOrUpdate(entity); + this.clearIgnoreLogicDelete(); + } catch (Exception e) { + throw new WorkFlowException(MsgCode.IMP003.get(),e); + } + return ActionResult.success(MsgCode.IMP001.get()); + } + return ActionResult.fail(MsgCode.IMP006.get()); + } + + @Override + public Boolean update(String id, IntegrateEntity entity, boolean state) { + entity.setId(id); + IntegrateEntity info = getInfo(id); + if (Objects.equals(entity.getEnabledMark(), 0) || !Objects.equals(info.getTemplateJson(), entity.getTemplateJson())) { + deleteJob(entity); + } + if (ObjectUtil.isEmpty(entity.getEnabledMark())) { + entity.setEnabledMark(info.getEnabledMark()); + } + if (ObjectUtil.isEmpty(entity.getType())) { + entity.setType(info.getType()); + } + if ((!Objects.equals(info.getTemplateJson(), entity.getTemplateJson()) || state) && Objects.equals(entity.getEnabledMark(), 1)) { + formId(entity); + } + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + return this.updateById(entity); + } + + @Override + public void delete(IntegrateEntity entity) { + deleteJob(entity); + this.removeById(entity.getId()); + } + + private void formId(IntegrateEntity entity) { + Integer enabledMark = entity.getEnabledMark(); + String templateJson = entity.getTemplateJson(); + if (StringUtil.isNotEmpty(templateJson)) { + IntegrateChildNode childNode = JsonUtil.getJsonToBean(templateJson, IntegrateChildNode.class); + IntegrateProperties properties = childNode.getProperties(); + String formId = properties.getFormId(); + entity.setFormId(formId); + entity.setTriggerType(properties.getTriggerEvent()); + if (Objects.equals(enabledMark, 1)) { + if (Objects.equals(entity.getType(), 2)) { + IntegrateModel model = new IntegrateModel(); + model.setId(entity.getId()); + IntegrateJobUtil.removeModel(model, redisUtil); + IntegrateModel integrateModel = JsonUtil.getJsonToBean(properties, IntegrateModel.class); + integrateModel.setUserInfo(UserProvider.getUser()); + integrateModel.setId(entity.getId()); + integrateModel.setState(0); + JobDataMap jobDataMap = new JobDataMap(); + Date startTime = ObjectUtil.isNotEmpty(properties.getStartTime()) ? new Date(properties.getStartTime()) : new Date(); + Date endTime = Objects.equals(properties.getEndTimeType(), 2) ? new Date(properties.getEndTime()) : null; + integrateModel.setEndTime(endTime != null ? endTime.getTime() : null); + integrateModel.setStartTime(startTime.getTime()); + jobDataMap.putAll(JsonUtil.entityToMap(integrateModel)); + redisUtil.removeHash(IntegrateJobUtil.IDGENERATOR_REDIS_KEY, entity.getId()); + boolean isAdd = ObjectUtil.isNotEmpty(endTime) ? endTime.getTime() > System.currentTimeMillis() : true; + if (isAdd) { + QuartzUtil.addJob(entity.getId(), properties.getCron(), Integrate.class, jobDataMap, startTime, endTime); + } + } + } + } + } + + private void deleteJob(IntegrateEntity entity) { + QuartzUtil.deleteJob(entity.getId()); + integrateQueueService.delete(entity.getId()); + IntegrateModel model = new IntegrateModel(); + model.setId(entity.getId()); + IntegrateJobUtil.removeModel(model, redisUtil); + } + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/service/impl/IntegrateTaskServiceImpl.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/service/impl/IntegrateTaskServiceImpl.java new file mode 100644 index 0000000..2bc5ab1 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/service/impl/IntegrateTaskServiceImpl.java @@ -0,0 +1,98 @@ +package com.yunzhupaas.integrate.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.integrate.entity.IntegrateTaskEntity; +import com.yunzhupaas.integrate.mapper.IntegrateTaskMapper; +import com.yunzhupaas.integrate.model.integrate.IntegratePageModel; +import com.yunzhupaas.integrate.service.IntegrateNodeService; +import com.yunzhupaas.integrate.service.IntegrateTaskService; +import com.yunzhupaas.util.*; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Service +public class IntegrateTaskServiceImpl extends SuperServiceImpl implements IntegrateTaskService { + + + @Autowired + private IntegrateNodeService integrateNodeService; + + @Override + public List getList(IntegratePageModel pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(IntegrateTaskEntity::getIntegrateId,pagination.getIntegrateId()); + //日期范围(近7天、近1月、近3月、自定义) + String startTime = pagination.getStartTime() != null ? pagination.getStartTime() : null; + String endTime = pagination.getEndTime() != null ? pagination.getEndTime() : null; + if (!StringUtils.isEmpty(startTime) && !StringUtils.isEmpty(endTime)) { + Date startTimes = new Date(Long.parseLong(startTime)); + Date endTimes = new Date(Long.parseLong(endTime)); + queryWrapper.lambda().ge(IntegrateTaskEntity::getExecutionTime, startTimes).le(IntegrateTaskEntity::getExecutionTime, endTimes); + } + if (ObjectUtil.isNotEmpty(pagination.getResultType())) { + queryWrapper.lambda().eq(IntegrateTaskEntity::getResultType, pagination.getResultType()); + } + queryWrapper.lambda().orderByDesc(IntegrateTaskEntity::getExecutionTime); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage userPage = page(page, queryWrapper); + return pagination.setData(userPage.getRecords(), page.getTotal()); + } + + @Override + public List getList(List id) { + List list = new ArrayList<>(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (id.size() > 0) { + queryWrapper.lambda().in(IntegrateTaskEntity::getIntegrateId, id); + list.addAll(this.list(queryWrapper)); + } + return list; + } + + @Override + public IntegrateTaskEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(IntegrateTaskEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(IntegrateTaskEntity entity) { + if (StringUtil.isEmpty(entity.getId())) { + entity.setId(RandomUtil.uuId()); + } + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + entity.setEnabledMark(0); + this.save(entity); + } + + @Override + public Boolean update(String id, IntegrateTaskEntity entity) { + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + return this.updateById(entity); + } + + @Override + public void delete(String id) { + if(StringUtils.isNotEmpty(id)) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(IntegrateTaskEntity::getId, id); + this.remove(queryWrapper); + integrateNodeService.delete(id); + } + } + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/util/IntegrateHttpModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/util/IntegrateHttpModel.java new file mode 100644 index 0000000..5625aad --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/util/IntegrateHttpModel.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.integrate.util; + +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.model.OnlineImport.VisualdevModelDataInfoVO; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2024/7/13 上午9:44 + */ +@Data +public class IntegrateHttpModel { + private String id; + public UserInfo userInfo; + private List dataInfoVOList = new ArrayList<>(); +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/util/IntegrateUtil.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/util/IntegrateUtil.java new file mode 100644 index 0000000..631cd58 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-biz/src/main/java/com/yunzhupaas/integrate/util/IntegrateUtil.java @@ -0,0 +1,1255 @@ +package com.yunzhupaas.integrate.util; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.http.HttpRequest; +import cn.hutool.http.Method; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.model.VisualDevJsonModel; +import com.yunzhupaas.base.model.VisualLogModel; +import com.yunzhupaas.base.model.flow.DataModel; +import com.yunzhupaas.base.service.DataInterfaceService; +import com.yunzhupaas.base.service.VisualdevService; +import com.yunzhupaas.base.util.SentMessageUtil; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.DataInterfaceVarConst; +import com.yunzhupaas.constant.YunzhupaasConst; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.database.model.superQuery.SuperJsonModel; +import com.yunzhupaas.database.model.superQuery.SuperQueryJsonModel; +import com.yunzhupaas.emnus.TemplateEnum; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.TaskEntity; +import com.yunzhupaas.flowable.entity.TemplateEntity; +import com.yunzhupaas.flowable.entity.TemplateJsonEntity; +import com.yunzhupaas.flowable.model.task.FlowModel; +import com.yunzhupaas.flowable.model.templatejson.FlowFormModel; +import com.yunzhupaas.flowable.model.trigger.TriggerDataFo; +import com.yunzhupaas.flowable.model.trigger.TriggerDataModel; +import com.yunzhupaas.flowable.model.trigger.TriggerModel; +import com.yunzhupaas.flowable.service.TaskService; +import com.yunzhupaas.flowable.service.TemplateJsonService; +import com.yunzhupaas.flowable.service.TemplateService; +import com.yunzhupaas.integrate.entity.IntegrateEntity; +import com.yunzhupaas.integrate.entity.IntegrateNodeEntity; +import com.yunzhupaas.integrate.entity.IntegrateQueueEntity; +import com.yunzhupaas.integrate.entity.IntegrateTaskEntity; +import com.yunzhupaas.integrate.model.childnode.*; +import com.yunzhupaas.integrate.model.integrate.IntegratePagination; +import com.yunzhupaas.integrate.model.nodeJson.IntegrateChildNodeList; +import com.yunzhupaas.integrate.model.nodeJson.IntegrateChildNodeModel; +import com.yunzhupaas.integrate.service.IntegrateNodeService; +import com.yunzhupaas.integrate.service.IntegrateQueueService; +import com.yunzhupaas.integrate.service.IntegrateService; +import com.yunzhupaas.integrate.service.IntegrateTaskService; +import com.yunzhupaas.message.model.SentMessageForm; +import com.yunzhupaas.model.visualJson.FieLdsModel; +import com.yunzhupaas.onlinedev.model.AsyncExecuteModel; +import com.yunzhupaas.onlinedev.model.OnlineInfoModel; +import com.yunzhupaas.onlinedev.model.PaginationModel; +import com.yunzhupaas.base.model.OnlineImport.VisualdevModelDataInfoVO; +import com.yunzhupaas.onlinedev.model.VisualParamModel; +import com.yunzhupaas.onlinedev.service.VisualDevInfoService; +import com.yunzhupaas.onlinedev.service.VisualDevListService; +import com.yunzhupaas.onlinedev.service.VisualdevModelDataService; +import com.yunzhupaas.onlinedev.util.onlineDevUtil.OnlinePublicUtils; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.model.authorize.AuthorizeConditionEnum; +import com.yunzhupaas.permission.service.OrganizeAdministratorService; +import com.yunzhupaas.permission.service.OrganizeService; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.*; +import com.yunzhupaas.workflow.service.TriggerApi; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Component; + +import java.util.*; +import java.util.stream.Collectors; + +@Component +public class IntegrateUtil { + + @Autowired + private UserService userService; + @Autowired + private SentMessageUtil sentMessageUtil; + @Autowired + private DataInterfaceService dataInterfaceService; + @Autowired + private VisualDevListService visualDevListService; + @Autowired + private IntegrateService integrateService; + @Autowired + private IntegrateQueueService integrateQueueService; + @Autowired + private VisualdevService visualdevService; + @Autowired + private VisualDevInfoService visualDevInfoService; + @Autowired + private IntegrateTaskService integrateTaskService; + @Autowired + private IntegrateNodeService integrateNodeService; + @Autowired + private VisualdevModelDataService visualdevModelDataService; + @Autowired + private TaskService taskService; + @Autowired + private TemplateService templateService; + @Autowired + private TemplateJsonService templateJsonService; + @Autowired + private OrganizeService organizeService; + @Autowired + private OrganizeAdministratorService organizeAdministratorService; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private TriggerApi triggerApi; + + // ------------------------------------------事件------------------------------------------------------ + + @Async + public void asyncList(List resultData, UserInfo userInfo) { + if (!resultData.isEmpty()) { + String url = configValueUtil.getApiDomain() + "/api/visualdev/Integrate/execute"; + IntegrateHttpModel model = new IntegrateHttpModel(); + model.setUserInfo(userInfo); + model.setDataInfoVOList(resultData); + HttpRequest request = HttpRequest.of(url).method(Method.POST).body(JsonUtil.getObjectToString(model)); + request.header(Constants.AUTHORIZATION, userInfo.getToken()); + request.execute().body(); + } + } + + @Async + public void asyncExecute(AsyncExecuteModel executeModel) { + String modelId = executeModel.getModelId(); + Integer trigger = executeModel.getTrigger(); + List dataId = executeModel.getDataId(); + UserInfo userInfo = executeModel.getUserInfo(); + DataModel dataModel = executeModel.getDataModel(); + List> dataMap = executeModel.getDataMap(); + + TriggerDataFo fo = new TriggerDataFo(); + fo.setModelId(modelId); + fo.setTrigger(trigger); + fo.setDataId(dataId); + fo.setDataMap(dataMap); + if (dataModel != null) { + List listLog = dataModel.getListLog(); + if (CollectionUtil.isNotEmpty(listLog)) { + List updateFields = this.getUpdateFields(listLog); + fo.setUpdateFields(updateFields); + } + } + + List resultData = triggerApi.getTriggerDataModel(fo); + if (!resultData.isEmpty()) { + String url = configValueUtil.getApiDomain() + "/api/workflow/trigger/Execute"; + TriggerModel model = new TriggerModel(); + model.setUserInfo(userInfo); + model.setDataList(resultData); + HttpRequest request = HttpRequest.of(url).method(Method.POST).body(JsonUtil.getObjectToString(model)); + request.header(Constants.AUTHORIZATION, userInfo.getToken()); + request.execute().body(); + } + } + + private List getUpdateFields(List listLog) { + List updateFields = new ArrayList<>(); + if (CollectionUtil.isNotEmpty(listLog)) { + for (VisualLogModel logModel : listLog) { + String field = logModel.getField(); + List> chidField = logModel.getChidField(); + List> chidData = logModel.getChidData(); + if (CollectionUtil.isNotEmpty(chidField) && CollectionUtil.isNotEmpty(chidData)) { + // 子表 + for (Map map : chidField) { + String key = (String) map.get("prop"); + for (Map child : chidData) { + if (!ObjectUtil.equals(child.get(key), child.get("yunzhupaas_old_" + key))) { + updateFields.add(field + "-" + key); + break; + } + } + } + } else { + updateFields.add(field); + } + } + } + return updateFields; + } + + public void integrates(List dataInfoVOList, UserInfo userInfo) { + for (VisualdevModelDataInfoVO infoVO : dataInfoVOList) { + String integrateId = infoVO.getIntegrateId(); + List> dataList = JsonUtil.getJsonToListMap(infoVO.getData()); + integrate(integrateId, dataList, userInfo); + } + } + + public List dataList(String modelId, Integer trigger, List dataId) { + List resultData = new ArrayList<>(); + List list = integrateList(modelId, trigger); + for (IntegrateEntity entity : list) { + // 数据 + IntegrateChildNodeList childNodeModel = JsonUtil.getJsonToBean(entity.getTemplateJson(), + IntegrateChildNodeList.class); + List> dataList = dataList(childNodeModel, new HashMap<>(16), dataId); + if (dataList.size() > 0) { + VisualdevModelDataInfoVO vo = new VisualdevModelDataInfoVO(); + vo.setData(JsonUtil.getObjectToString(dataList)); + vo.setIntegrateId(entity.getId()); + resultData.add(vo); + } + } + return resultData; + } + + private List integrateList(String modelId, Integer trigger) { + IntegratePagination pagination = new IntegratePagination(); + pagination.setFormId(modelId); + pagination.setType(1); + pagination.setTrigger(trigger); + pagination.setEnabledMark(1); + List list = integrateService.getList(pagination, false); + return list; + } + + // ------------------------------------------定时------------------------------------------------------ + + // 重试 + public void integrate(String taskId, String parentId, String taskNodeId) { + IntegrateTaskEntity taskEntity = integrateTaskService.getInfo(taskId); + if (taskEntity != null) { + List> dataList = new ArrayList<>(); + try { + dataList.addAll(JsonUtil.getJsonToListMap(taskEntity.getData())); + } catch (Exception e) { + dataList.add(JsonUtil.stringToMap(taskEntity.getData())); + } + integrate(taskEntity.getIntegrateId(), dataList, UserProvider.getUser(), parentId, taskNodeId); + } + } + + // 定时执行 + public void integrate(IntegrateQueueEntity queueEntity, UserInfo userInfo) { + queueEntity.setState(1); + integrateQueueService.update(queueEntity.getId(), queueEntity); + String integrateId = queueEntity.getIntegrateId(); + List> dataList = new ArrayList<>(); + IntegrateEntity entity = integrateService.getInfo(integrateId); + if (entity != null) { + IntegrateChildNode childNode = JsonUtil.getJsonToBean(entity.getTemplateJson(), IntegrateChildNode.class); + IntegrateChildNode getDataChildNode = childNode.getChildNode(); + IntegrateChildNodeList dataListNodeMode = JsonUtil.getJsonToBean(getDataChildNode, + IntegrateChildNodeList.class); + IntegrateProperties properties = dataListNodeMode.getProperties(); + Integer formType = properties.getFormType(); + // 远端节点 + if (Objects.equals(formType, 3)) { + dataListNodeMode.getProperties() + .setTemplateJson(dataListNodeMode.getProperties().getInterfaceTemplateJson()); + try { + ActionResult result = interfaceTemplateJson(dataListNodeMode, new HashMap<>(), userInfo); + if (result.getData() instanceof List) { + dataList.addAll((List) result.getData()); + } + } catch (Exception e) { + } + } else { + dataList.addAll(dataList(dataListNodeMode, new HashMap<>(16), new ArrayList<>())); + } + integrate(integrateId, dataList, userInfo); + integrateQueueService.delete(queueEntity); + } + } + + // 集成执行逻辑 + private void integrate(String integrateId, List> dataList, UserInfo userInfo) { + integrate(integrateId, dataList, userInfo, "0", "0"); + } + + // 集成执行逻辑 + private void integrate(String integrateId, List> dataList, UserInfo userInfo, String parentId, + String taskNodeId) { + if (dataList.isEmpty()) { + return; + } + IntegrateEntity entity = integrateService.getInfo(integrateId); + if (entity != null) { + // 获取实例重试数据 + IntegrateTaskEntity parentTask = integrateTaskService.getInfo(parentId); + boolean isParentId = parentTask != null; + // 获取节点重试数据 + IntegrateNodeEntity info = integrateNodeService.getInfo(taskNodeId); + boolean isTaskNodeId = info != null; + String retryNodeCode = isTaskNodeId ? info.getNodeCode() : ""; + Date time = new Date(); + // 判断是节点重试还是实例重试 + String json = isParentId ? entity.getTemplateJson() : entity.getTemplateJson(); + IntegrateChildNode childNode = JsonUtil.getJsonToBean(json, IntegrateChildNode.class); + IntegrateChildNode getDataChildNode = childNode.getChildNode(); + IntegrateChildNodeList dataListNodeMode = JsonUtil.getJsonToBean(getDataChildNode, + IntegrateChildNodeList.class); + dataListNodeMode.setStartTime(time); + List childNodeListAll = new ArrayList<>(); + childList(childNode, childNodeListAll); + IntegrateChildNodeList startNode = childNodeListAll.stream().filter(t -> "start".equals(t.getType())) + .findFirst().orElse(null); + if (startNode != null) { + List idAll = new ArrayList<>(); + IntegrateTaskEntity taskEntity = new IntegrateTaskEntity(); + List errNodeList = new ArrayList<>(); + String msg = ""; + Map errMsg = new HashMap<>(); + try { + for (int i = 0; i < dataList.size(); i++) { + Map objectMap = dataList.get(i); + errMsg.putAll(objectMap); + String id = String.valueOf(objectMap.get(FlowFormConstant.ID)); + List nodeList = new ArrayList<>(); + taskEntity.setIntegrateId(entity.getId()); + taskEntity.setType(entity.getType()); + taskEntity.setTemplateJson(entity.getTemplateJson()); + taskEntity.setDataId(id); + taskEntity.setParentId(isParentId ? parentTask.getId() : parentId); + taskEntity.setParentTime(isParentId ? parentTask.getExecutionTime() : null); + taskEntity.setResultType(isParentId ? parentTask.getResultType() : 1); + taskEntity.setExecutionTime(new Date()); + taskEntity.setId(isTaskNodeId ? info.getTaskId() : RandomUtil.uuId()); + taskEntity.setData(dataList.size() > 0 ? JsonUtil.getObjectToString(dataList) + : JsonUtil.getObjectToString(objectMap)); + taskEntity.setProcessId(taskEntity.getId()); + idAll.add(taskEntity.getId()); + if (i == 0 && !isParentId) { + IntegrateTaskEntity taskEntitys = JsonUtil.getJsonToBean(taskEntity, + IntegrateTaskEntity.class); + integrateTaskService.saveOrUpdate(taskEntitys); + } + // 节点 + List nodeListAll = new ArrayList<>(childNodeListAll); + for (int k = 0; k < nodeListAll.size(); k++) { + IntegrateChildNodeList childNodeList = nodeListAll.get(k); + childNodeList.setIntegrateType(taskEntity.getType()); + IntegrateProperties childProperties = childNodeList.getProperties(); + IntegrateNodeEntity nodeEntity = new IntegrateNodeEntity(); + nodeEntity.setResultType(0); + nodeEntity.setParentId(taskNodeId); + nodeEntity.setNodeType(childNodeList.getType()); + nodeEntity.setNodeNext(childNodeList.getNextId()); + nodeEntity.setStartTime(time); + nodeEntity.setEndTime(time); + nodeEntity.setTaskId(taskEntity.getId()); + nodeEntity.setNodeCode(childNodeList.getNodeId()); + nodeEntity.setFormId(childProperties.getFormId()); + nodeEntity.setNodeName(childProperties.getTitle()); + nodeEntity.setNodePropertyJson(JsonUtil.getObjectToString(childNodeList)); + nodeEntity.setSortCode(Long.parseLong(k + "")); + nodeList.add(nodeEntity); + } + errNodeList = nodeList; + IntegrateChildNodeModel childNodeModel = IntegrateChildNodeModel.builder().dataListAll(dataList) + .data(objectMap) + .nodeList(nodeList).node(startNode.getNodeId()).entity(entity) + .retryNodeCode(retryNodeCode).userInfo(userInfo).num(0).build(); + childNode(childNodeModel); + boolean failSum = nodeList.stream().filter(t -> t.getResultType() == 0).count() > 0; + taskEntity.setResultType(failSum ? 0 : 1); + integrateTaskService.update(taskEntity.getId(), taskEntity); + } + } catch (Exception e) { + msg = e.getMessage(); + taskEntity.setResultType(0); + } + integrateTaskService.saveOrUpdate(taskEntity); + idAll.remove(taskEntity.getId()); + if (!idAll.isEmpty()) { + QueryWrapper wrapper = new QueryWrapper(); + wrapper.lambda().in(IntegrateTaskEntity::getId, idAll); + integrateTaskService.remove(wrapper); + QueryWrapper nodeWrapper = new QueryWrapper(); + nodeWrapper.lambda().in(IntegrateNodeEntity::getTaskId, idAll); + integrateNodeService.remove(nodeWrapper); + } + if (StringUtil.isNotEmpty(msg)) { + end(entity, new HashMap<>(errMsg), errNodeList, "end", false, userInfo); + } + } + } + } + + private void childList(IntegrateChildNode childNodeAll, List listAll) { + if (childNodeAll != null) { + IntegrateChildNodeList childNodeList = JsonUtil.getJsonToBean(childNodeAll, IntegrateChildNodeList.class); + boolean isNext = childNodeAll.getChildNode() != null; + String nextId = isNext ? childNodeAll.getChildNode().getNodeId() : "end"; + childNodeList.setNextId(nextId); + listAll.add(childNodeList); + if (isNext) { + childList(childNodeAll.getChildNode(), listAll); + } + if ("end".equals(nextId)) { + IntegrateChildNodeList endChildNodeList = listAll.stream().filter(t -> "start".equals(t.getType())) + .findFirst().orElse(null); + IntegrateChildNodeList endNode = JsonUtil.getJsonToBean(endChildNodeList, IntegrateChildNodeList.class); + endNode.setNodeId(nextId); + endNode.setType(nextId); + endNode.setNextId(""); + endNode.getProperties().setTitle("结束"); + listAll.add(endNode); + } + } + } + + private void childNode(IntegrateChildNodeModel childNodeModel) throws WorkFlowException { + Map data = childNodeModel.getData(); + List> dataList = childNodeModel.getDataListAll(); + List nodeList = childNodeModel.getNodeList(); + String node = childNodeModel.getNode(); + IntegrateEntity entity = childNodeModel.getEntity(); + String retryNodeCode = childNodeModel.getRetryNodeCode(); + UserInfo userInfo = childNodeModel.getUserInfo(); + IntegrateNodeEntity nodeEntity = nodeList.stream().filter(t -> t.getNodeCode().equals(node)).findFirst() + .orElse(null); + if (nodeEntity != null) { + String nodeType = nodeEntity.getNodeType(); + String nodeCode = nodeEntity.getNodeCode(); + String[] nextCodeAll = nodeEntity.getNodeNext().split(","); + switch (nodeType) { + case "addData": + addData(new HashMap<>(data), nodeList, nodeCode, retryNodeCode); + break; + case "updateData": + updateData(new HashMap<>(data), nodeList, nodeCode, retryNodeCode); + break; + case "deleteData": + deleteData(new HashMap<>(data), new ArrayList<>(dataList), nodeList, nodeCode, retryNodeCode); + break; + case "message": + message(new HashMap<>(data), nodeList, nodeCode, userInfo); + break; + case "dataInterface": + dataInterface(new HashMap<>(data), nodeList, nodeCode, userInfo, retryNodeCode); + break; + case "getData": + getData(entity, nodeList, nodeCode); + break; + case "launchFlow": + launchFlow(new HashMap<>(data), nodeList, nodeCode, retryNodeCode); + break; + case "end": + end(entity, new HashMap<>(data), nodeList, nodeCode, true, userInfo); + break; + case "start": + start(entity, new HashMap<>(data), nodeList, nodeCode, true, userInfo, childNodeModel.getNum()); + break; + default: + break; + } + for (String nextCode : nextCodeAll) { + childNodeModel.setNode(nextCode); + childNode(childNodeModel); + } + } + } + + // -----------------------------------事件----------------------------------------------- + + private void getData(IntegrateEntity entity, List nodeList, String node) { + IntegrateNodeEntity nodeEntity = nodeList.stream().filter(t -> t.getNodeCode().equals(node)).findFirst() + .orElse(null); + if (nodeEntity != null) { + nodeEntity.setResultType(1); + List list = nodeList(nodeEntity); + if (list.size() == 0) { + integrateNodeService.create(nodeEntity); + } + } + } + + private void start(IntegrateEntity entity, Map data, List nodeList, + String node, boolean isAdd, UserInfo userInfo, int num) { + IntegrateNodeEntity nodeEntity = nodeList.stream().filter(t -> t.getNodeCode().equals(node)).findFirst() + .orElse(null); + if (nodeEntity != null) { + List list = nodeList(nodeEntity); + String templeId = "PZXTJC002"; + if (list.size() == 0) { + nodeEntity.setStartTime(nodeEntity.getStartTime()); + boolean failSum = num == 0; + IntegrateChildNodeList childNodeList = JsonUtil.getJsonToBean(nodeEntity.getNodePropertyJson(), + IntegrateChildNodeList.class); + IntegrateProperties properties = childNodeList.getProperties(); + IntegrateMsgModel msgConfig = properties.getStartMsgConfig(); + Integer on = msgConfig.getOn(); + boolean acquiesce = on == 3; + String msgId = on == 0 ? "" : acquiesce ? templeId : msgConfig.getMsgId(); + List msgUserType = properties.getMsgUserType(); + List msgUserIds = properties.getMsgUserIds(); + Set userIdList = new HashSet<>(); + for (String type : msgUserType) { + switch (type) { + case "1": + userIdList.add(entity.getCreatorUserId()); + break; + case "2": + List adminList = userService.getAdminList().stream().map(UserEntity::getId) + .collect(Collectors.toList()); + userIdList.addAll(adminList); + break; + case "3": + List userList = userService.getUserIdList(msgUserIds, null); + userIdList.addAll(userList); + break; + default: + break; + } + } + Map dataMap = new HashMap() { + { + put("@Title", entity.getFullName()); + put("@CreatorUserName", ""); + } + }; + List templateJson = msgConfig.getTemplateJson(); + try { + if (StringUtil.isNotEmpty(msgId) && userIdList.size() > 0 && failSum) { + Map parameterMap = acquiesce ? dataMap + : templateJson(templateJson, data, userInfo); + message(msgId, new ArrayList<>(userIdList), parameterMap, userInfo); + } + nodeEntity.setResultType(1); + } catch (Exception e) { + errMsg(nodeEntity, e); + } + nodeEntity.setEndTime(nodeEntity.getEndTime()); + if (isAdd) { + integrateNodeService.create(nodeEntity); + } + } + } + } + + private void end(IntegrateEntity entity, Map data, List nodeList, String node, + boolean isAdd, UserInfo userInfo) { + IntegrateNodeEntity nodeEntity = nodeList.stream().filter(t -> t.getNodeCode().equals(node)).findFirst() + .orElse(null); + if (nodeEntity != null) { + List list = nodeList(nodeEntity); + if (list.size() == 0) { + String templeId = "PZXTJC001"; + nodeEntity.setStartTime(new Date()); + boolean failSum = !isAdd; + IntegrateChildNodeList childNodeList = JsonUtil.getJsonToBean(nodeEntity.getNodePropertyJson(), + IntegrateChildNodeList.class); + IntegrateProperties properties = childNodeList.getProperties(); + IntegrateMsgModel msgConfig = properties.getFailMsgConfig(); + Integer on = msgConfig.getOn(); + boolean acquiesce = on == 3; + String msgId = on == 0 ? "" : acquiesce ? templeId : msgConfig.getMsgId(); + List msgUserType = properties.getMsgUserType(); + List msgUserIds = properties.getMsgUserIds(); + Set userIdList = new HashSet<>(); + for (String type : msgUserType) { + switch (type) { + case "1": + userIdList.add(entity.getCreatorUserId()); + break; + case "2": + List adminList = userService.getAdminList().stream().map(UserEntity::getId) + .collect(Collectors.toList()); + userIdList.addAll(adminList); + break; + case "3": + List userList = userService.getUserIdList(msgUserIds, null); + userIdList.addAll(userList); + break; + default: + break; + } + } + Map dataMap = new HashMap() { + { + put("@Title", entity.getFullName()); + put("@CreatorUserName", ""); + } + }; + List templateJson = msgConfig.getTemplateJson(); + try { + if (StringUtil.isNotEmpty(msgId) && userIdList.size() > 0 && failSum) { + Map parameterMap = acquiesce ? dataMap + : templateJson(templateJson, data, userInfo); + message(msgId, new ArrayList<>(userIdList), parameterMap, userInfo); + } + nodeEntity.setResultType(1); + } catch (Exception e) { + errMsg(nodeEntity, e); + } + nodeEntity.setEndTime(new Date()); + if (isAdd) { + integrateNodeService.create(nodeEntity); + } + } + } + } + + private void addData(Map data, List nodeList, String node, + String retryNodeCode) throws WorkFlowException { + IntegrateNodeEntity nodeEntity = nodeList.stream().filter(t -> t.getNodeCode().equals(node)).findFirst() + .orElse(null); + if (nodeEntity != null) { + List list = nodeList(nodeEntity); + boolean isRetry = nodeEntity.getNodeCode().equals(retryNodeCode); + if (list.size() == 0 || isRetry) { + nodeEntity.setStartTime(new Date()); + IntegrateChildNodeList childNodeList = JsonUtil.getJsonToBean(nodeEntity.getNodePropertyJson(), + IntegrateChildNodeList.class); + IntegrateProperties properties = childNodeList.getProperties(); + boolean isAdd = Objects.equals(childNodeList.getIntegrateType(), 1); + if (!isAdd) { + List> dataList = dataList(childNodeList, data, new ArrayList<>()); + Integer addRule = properties.getAddRule(); + isAdd = (dataList.size() > 0 && addRule == 1) || dataList.size() == 0; + } + String msg = ""; + try { + if (isAdd) { + String formId = properties.getFormId(); + String flowId = properties.getFlowId(); + if (ObjectUtil.isNotEmpty(flowId)) { + TemplateEntity template = templateService.getInfo(flowId); + flowId = template.getFlowId(); + } + VisualdevEntity visualdevEntity = visualdevService.getReleaseInfo(formId); + List transferList = properties.getTransferList(); + Map saveData = formData(data, transferList); + saveData.put(FlowFormConstant.FLOWID, flowId); + visualdevModelDataService.visualCreate( + VisualParamModel.builder().visualdevEntity(visualdevEntity).data(saveData).build()); + } + nodeEntity.setResultType(1); + } catch (Exception e) { + errMsg(nodeEntity, e); + msg = e.getMessage(); + } + nodeEntity.setEndTime(new Date()); + if (isRetry) { + integrateNodeService.update(nodeEntity.getTaskId(), nodeEntity.getNodeCode()); + } + integrateNodeService.create(nodeEntity); + if (StringUtil.isNotEmpty(msg)) { + throw new WorkFlowException(msg); + } + } + } + } + + private void updateData(Map data, List nodeList, String node, + String retryNodeCode) throws WorkFlowException { + IntegrateNodeEntity nodeEntity = nodeList.stream().filter(t -> t.getNodeCode().equals(node)).findFirst() + .orElse(null); + if (nodeEntity != null) { + List list = nodeList(nodeEntity); + boolean isRetry = nodeEntity.getNodeCode().equals(retryNodeCode); + if (list.size() == 0 || isRetry) { + nodeEntity.setStartTime(new Date()); + IntegrateChildNodeList childNodeList = JsonUtil.getJsonToBean(nodeEntity.getNodePropertyJson(), + IntegrateChildNodeList.class); + IntegrateProperties properties = childNodeList.getProperties(); + String formId = properties.getFormId(); + VisualdevEntity visualdevEntity = visualdevService.getReleaseInfo(formId); + List transferList = properties.getTransferList(); + List> dataList = dataList(childNodeList, data, new ArrayList<>()); + Integer unFoundRule = properties.getUnFoundRule(); + String msg = ""; + boolean isAdd = dataList.size() == 0 && unFoundRule == 1; + try { + String flowId = properties.getFlowId(); + if (ObjectUtil.isNotEmpty(flowId)) { + TemplateEntity template = templateService.getInfo(flowId); + flowId = template.getFlowId(); + } + if (isAdd) { + Map saveData = formData(data, transferList); + saveData.put(FlowFormConstant.FLOWID, flowId); + dataList.add(saveData); + } + for (Map objectMap : dataList) { + if (isAdd) { + visualdevModelDataService.visualCreate(VisualParamModel.builder() + .visualdevEntity(visualdevEntity).data(objectMap).build()); + } else { + String id = String.valueOf(objectMap.get(FlowFormConstant.ID)); + Map saveData = formData(data, objectMap, transferList); + Map dataObject = new HashMap<>(saveData); + visualdevModelDataService.visualUpdate(VisualParamModel.builder() + .visualdevEntity(visualdevEntity).data(dataObject).id(id).build()); + } + } + nodeEntity.setResultType(1); + } catch (Exception e) { + errMsg(nodeEntity, e); + msg = e.getMessage(); + } + nodeEntity.setEndTime(new Date()); + if (isRetry) { + integrateNodeService.update(nodeEntity.getTaskId(), nodeEntity.getNodeCode()); + } + integrateNodeService.create(nodeEntity); + if (StringUtil.isNotEmpty(msg)) { + throw new WorkFlowException(msg); + } + } + } + } + + private void deleteData(Map data, List> dataListAll, + List nodeList, String node, String retryNodeCode) throws WorkFlowException { + IntegrateNodeEntity nodeEntity = nodeList.stream().filter(t -> t.getNodeCode().equals(node)).findFirst() + .orElse(null); + if (nodeEntity != null) { + List list = nodeList(nodeEntity); + boolean isRetry = nodeEntity.getNodeCode().equals(retryNodeCode); + if (list.size() == 0 || isRetry) { + nodeEntity.setStartTime(new Date()); + String nodeJson = nodeEntity.getNodePropertyJson(); + IntegrateChildNodeList childNodeList = JsonUtil.getJsonToBean(nodeJson, IntegrateChildNodeList.class); + IntegrateProperties properties = childNodeList.getProperties(); + String formId = properties.getFormId(); + String menuId = properties.getId(); + String flowId = properties.getFlowId(); + // 条件的数据 + Integer deleteRule = Objects.equals(childNodeList.getIntegrateType(), 1) ? 1 + : properties.getDeleteRule(); + IntegrateChildNodeList dataChildNode = new IntegrateChildNodeList(); + dataChildNode.setType(childNodeList.getType()); + IntegrateProperties dataChildProperties = dataChildNode.getProperties(); + dataChildProperties.setFormId(formId); + dataChildProperties.setId(menuId); + dataChildProperties.setFlowId(flowId); + boolean delete = Objects.equals(deleteRule, 1); + List> dataList = dataList(delete ? childNodeList : dataChildNode, data, + new ArrayList<>()); + List idList = dataList.stream().filter(t -> ObjectUtil.isNotEmpty(t.get(FlowFormConstant.ID))) + .map(t -> String.valueOf(t.get(FlowFormConstant.ID))).collect(Collectors.toList()); + List deleteList = new ArrayList<>(); + if (delete) { + deleteList.addAll(idList); + } else { + List addList = new ArrayList<>(); + for (Map objectMap : dataListAll) { + List idAll = dataList(JsonUtil.getJsonToBean(nodeJson, IntegrateChildNodeList.class), + objectMap, new ArrayList<>()).stream() + .filter(t -> ObjectUtil.isNotEmpty(t.get(FlowFormConstant.ID))) + .map(t -> String.valueOf(t.get(FlowFormConstant.ID))).collect(Collectors.toList()); + addList.addAll(idAll); + } + idList.removeAll(addList); + deleteList.addAll(idList); + } + String msg = ""; + try { + if (deleteList.size() > 0) { + List> deleteDataList = dataList.stream() + .filter(t -> deleteList.contains(String.valueOf(t.get(FlowFormConstant.ID)))) + .collect(Collectors.toList()); + VisualdevEntity visualdevEntity = visualdevService.getReleaseInfo(formId); + visualdevModelDataService.visualDelete(visualdevEntity, deleteDataList); + } + nodeEntity.setResultType(1); + } catch (Exception e) { + errMsg(nodeEntity, e); + msg = e.getMessage(); + } + nodeEntity.setEndTime(new Date()); + if (isRetry) { + integrateNodeService.update(nodeEntity.getTaskId(), nodeEntity.getNodeCode()); + } + integrateNodeService.create(nodeEntity); + if (StringUtil.isNotEmpty(msg)) { + throw new WorkFlowException(msg); + } + } + } + } + + private void message(Map data, List nodeList, String node, UserInfo userInfo) + throws WorkFlowException { + IntegrateNodeEntity nodeEntity = nodeList.stream().filter(t -> t.getNodeCode().equals(node)).findFirst() + .orElse(null); + if (nodeEntity != null) { + String msg = ""; + List list = nodeList(nodeEntity); + if (list.size() == 0) { + nodeEntity.setStartTime(new Date()); + IntegrateChildNodeList childNodeList = JsonUtil.getJsonToBean(nodeEntity.getNodePropertyJson(), + IntegrateChildNodeList.class); + IntegrateProperties properties = childNodeList.getProperties(); + List userIdList = userService.getUserIdList(properties.getMsgUserIds(), null); + String msgId = properties.getMsgId(); + List templateJson = properties.getTemplateJson(); + try { + Map parameterMap = templateJson(templateJson, data, userInfo); + if (userIdList.size() > 0) { + message(msgId, userIdList, parameterMap, userInfo); + } + nodeEntity.setResultType(1); + } catch (Exception e) { + errMsg(nodeEntity, e); + msg = e.getMessage(); + } + nodeEntity.setEndTime(new Date()); + integrateNodeService.create(nodeEntity); + if (StringUtil.isNotEmpty(msg)) { + throw new WorkFlowException(msg); + } + } + } + } + + private void dataInterface(Map data, List nodeList, String node, + UserInfo userInfo, String retryNodeCode) throws WorkFlowException { + IntegrateNodeEntity nodeEntity = nodeList.stream().filter(t -> t.getNodeCode().equals(node)).findFirst() + .orElse(null); + if (nodeEntity != null) { + String msg = ""; + List list = nodeList(nodeEntity); + boolean isRetry = nodeEntity.getNodeCode().equals(retryNodeCode); + if (list.size() == 0 || isRetry) { + nodeEntity.setStartTime(new Date()); + try { + IntegrateChildNodeList childNodeList = JsonUtil.getJsonToBean(nodeEntity.getNodePropertyJson(), + IntegrateChildNodeList.class); + interfaceTemplateJson(childNodeList, data, userInfo); + nodeEntity.setResultType(1); + } catch (Exception e) { + errMsg(nodeEntity, e); + msg = e.getMessage(); + } + nodeEntity.setEndTime(new Date()); + if (isRetry) { + integrateNodeService.update(nodeEntity.getTaskId(), nodeEntity.getNodeCode()); + } + integrateNodeService.create(nodeEntity); + if (StringUtil.isNotEmpty(msg)) { + throw new WorkFlowException(msg); + } + } + } + } + + private Map formData(Map formData, List transferList) + throws WorkFlowException { + return formData(formData, new HashMap<>(), transferList); + } + + private Map formData(Map formData, Map resultData, + List transferList) throws WorkFlowException { + Map result = new HashMap<>(resultData); + Map oldData = new HashMap<>(formData); + Set msg = new HashSet<>(); + for (TransferModel assignMode : transferList) { + // 子表处理规则 + Boolean required = assignMode.getRequired(); + String targetFieldLabel = assignMode.getTargetFieldLabel(); + Integer sourceType = assignMode.getSourceType(); + boolean isData = ObjectUtil.equals(sourceType, TemplateEnum.Custom.getCode()); + String parentField = assignMode.getSourceValue(); + String[] parentFieldList = isData ? new String[] { parentField } : parentField.split("-"); + String childField = assignMode.getTargetField(); + String[] childFieldList = childField.split("-"); + Object childData = isData ? parentField + : DataInterfaceVarConst.FORM_ID.equals(parentField) ? formData.get(FlowFormConstant.ID) + : formData.get(parentField); + if (childFieldList.length > 1) { + List> childMapAll = new ArrayList<>(); + if (result.get(childFieldList[0]) instanceof List) { + List> childList = (List>) result.get(childFieldList[0]); + for (Map objectMap : childList) { + Map childMap = new HashMap<>(objectMap); + childMapAll.add(childMap); + } + } + if (parentFieldList.length > 1) { + if (oldData.get(parentFieldList[0]) instanceof List) { + List> parentList = (List>) oldData + .get(parentFieldList[0]); + int num = parentList.size() - childMapAll.size(); + for (int i = 0; i < num; i++) { + childMapAll.add(new HashMap<>()); + } + for (int i = 0; i < parentList.size(); i++) { + Map parentMap = parentList.get(i); + Map childMap = childMapAll.get(i); + if (required && ObjectUtil.isEmpty(parentMap.get(parentFieldList[1]))) { + msg.add(targetFieldLabel); + } + childMap.put(childFieldList[1], parentMap.get(parentFieldList[1])); + } + } + } else { + if (1 > childMapAll.size()) { + childMapAll.add(new HashMap<>()); + } + Map childMap = childMapAll.get(0); + if (required && ObjectUtil.isEmpty(childData)) { + msg.add(targetFieldLabel); + } + childMap.put(childFieldList[1], childData); + } + result.put(childFieldList[0], childMapAll); + } else { + if (parentFieldList.length > 1) { + if (oldData.get(parentFieldList[0]) instanceof List) { + List> parentList = (List>) oldData + .get(parentFieldList[0]); + for (int i = 0; i < parentList.size(); i++) { + Map parentMap = parentList.get(i); + if (i == 0) { + childData = parentMap.get(parentFieldList[1]); + } + } + } + } + if (required && ObjectUtil.isEmpty(childData)) { + msg.add(targetFieldLabel); + } + result.put(childField, childData); + } + } + errRequiredMsg(msg); + return result; + } + + private List> dataList(IntegrateChildNodeList childNodeList, Map data, + List dataId) { + boolean idDelete = Objects.equals(childNodeList.getType(), "deleteData"); + IntegrateProperties properties = childNodeList.getProperties(); + String formId = properties.getFormId(); + List ruleList = properties.getRuleList(); + String ruleMatchLogic = properties.getRuleMatchLogic(); + String menuId = properties.getId(); + String flowId = properties.getFlowId(); + boolean isFlow = StringUtil.isNotEmpty(flowId); + for (SuperQueryJsonModel superQueryJsonModel : ruleList) { + List groups = superQueryJsonModel.getGroups(); + for (FieLdsModel fieLdsModel : groups) { + boolean valueType = "1".equals(fieLdsModel.getFieldValueType()); + String fieldValue = data.get(fieLdsModel.getFieldValue()) != null + ? String.valueOf(data.get(fieLdsModel.getFieldValue())) + : null; + if (DataInterfaceVarConst.FORM_ID.equals(fieLdsModel.getFieldValue())) { + fieldValue = String.valueOf(data.get(FlowFormConstant.ID)); + } + fieLdsModel.setFieldValue(valueType ? fieldValue : fieLdsModel.getFieldValue()); + } + } + SuperJsonModel superJsonModel = new SuperJsonModel(); + superJsonModel.setConditionList(ruleList); + superJsonModel + .setMatchLogic(StringUtil.isNotEmpty(ruleMatchLogic) ? ruleMatchLogic : superJsonModel.getMatchLogic()); + PaginationModel paginationModel = new PaginationModel(); + paginationModel.setPageSize(10000L); + paginationModel.setMenuId(menuId); + paginationModel.setSuperQueryJson(ruleList.size() > 0 ? JsonUtil.getObjectToString(superJsonModel) : ""); + VisualdevEntity visualdevEntity = visualdevService.getReleaseInfo(formId); + VisualDevJsonModel visualJsonModel = OnlinePublicUtils.getVisualJsonModel(visualdevEntity); + List idAll = new ArrayList<>(); + List idList = new ArrayList<>(); + try { + if (ruleList.size() > 0) { + visualJsonModel.setSuperQuery(superJsonModel); + } + if (isFlow) { + List flowVersionIds = templateJsonService.getListByTemplateIds(ImmutableList.of(flowId)) + .stream().map(TemplateJsonEntity::getId).collect(Collectors.toList()); + visualJsonModel.setFlowVersionIds(flowVersionIds); + visualJsonModel.setEnableFlow(flowVersionIds.size() > 0); + } + List> dataList = visualDevListService.getListWithTableList(visualJsonModel, + paginationModel, UserProvider.getUser()); + idList.addAll(dataList.stream().map(t -> String.valueOf(t.get(FlowFormConstant.ID))) + .collect(Collectors.toList())); + } catch (Exception e) { + } + List intersection = idList.stream().filter(item -> dataId.contains(item)).collect(Collectors.toList()); + if (dataId.size() > 0) { + idAll.addAll(intersection); + } else { + idAll.addAll(idList); + } + List> dataList = new ArrayList<>(); + for (String id : idAll) { + VisualdevModelDataInfoVO infoVO = visualDevInfoService.getEditDataInfo(id, visualdevEntity, + OnlineInfoModel.builder().build()); + if (StringUtil.isNotEmpty(infoVO.getData())) { + Map map = JsonUtil.stringToMap(infoVO.getData()); + map.put(FlowFormConstant.ID, infoVO.getId()); + boolean isAdd = true; + if (isFlow && !idDelete) { + TaskEntity infoSubmit = taskService.getInfoSubmit( + String.valueOf(map.get(FlowFormConstant.FLOWTASKID)), TaskEntity::getEndTime); + isAdd = infoSubmit != null && infoSubmit.getEndTime() != null; + } + if (isAdd) { + dataList.add(map); + } + } + } + return dataList; + } + + private void message(String msgId, List userIdList, Map parameterMap, UserInfo userInfo) { + SentMessageForm sentMessageForm = new SentMessageForm(); + sentMessageForm.setUserInfo(userInfo); + sentMessageForm.setTemplateId(msgId); + sentMessageForm.setToUserIds(userIdList); + sentMessageForm.setParameterMap(parameterMap); + sentMessageForm.setType(3); + sentMessageForm.setContentMsg(new HashMap<>()); + sentMessageForm.setId(msgId); + sentMessageUtil.sendDelegateMsg(sentMessageForm); + } + + private List nodeList(IntegrateNodeEntity nodeEntity) { + List list = integrateNodeService.getList(new ArrayList() { + { + add(nodeEntity.getTaskId()); + } + }, nodeEntity.getNodeCode(), 1); + IntegrateNodeEntity integrateNode = list.stream() + .filter(t -> t.getNodeCode().equals(nodeEntity.getNodeCode()) && t.getResultType() == 1).findFirst() + .orElse(null); + nodeEntity.setResultType(integrateNode != null ? integrateNode.getResultType() : nodeEntity.getResultType()); + return list; + } + + private Map templateJson(List templateJson, Map data, + UserInfo userInfo) throws WorkFlowException { + Map parameterMap = new HashMap<>(); + Set msg = new HashSet<>(); + for (IntegrateTemplateModel templateJsonModel : templateJson) { + List paramJson = templateJsonModel.getParamJson(); + for (IntegrateParamModel integrateParamModel : paramJson) { + Boolean required = integrateParamModel.getRequired(); + String fieldId = integrateParamModel.getField(); + String relationField = integrateParamModel.getRelationField(); + String[] model = StringUtil.isNotEmpty(relationField) ? relationField.split("-") : new String[] {}; + String dataValue = data.get(relationField) != null ? String.valueOf(data.get(relationField)) : ""; + if (DataInterfaceVarConst.FORM_ID.equals(relationField)) { + dataValue = data.get(FlowFormConstant.ID) != null ? String.valueOf(data.get(FlowFormConstant.ID)) + : ""; + } + if (model.length > 1) { + Object dataList = data.get(model[0]); + if (dataList instanceof List) { + List> listAll = (List>) dataList; + List dataListAll = new ArrayList<>(); + for (Map objectMap : listAll) { + dataListAll.add(objectMap.get(model[1])); + } + if (required && ObjectUtil.isEmpty(dataListAll)) { + msg.add(fieldId); + } + dataValue = String.valueOf(dataListAll); + } + } + if (required && ObjectUtil.isEmpty(dataValue)) { + msg.add(fieldId); + } + parameterMap.put(integrateParamModel.getMsgTemplateId() + fieldId, dataValue); + } + Map paramMap = ImmutableMap.of("@CreatorUserName", userInfo.getUserName(), "@SendTime", + DateUtil.getNow().substring(11)); + for (String key : paramMap.keySet()) { + parameterMap.put(templateJsonModel.getId() + key, paramMap.get(key)); + } + } + errRequiredMsg(msg); + return parameterMap; + } + + private void errMsg(IntegrateNodeEntity nodeEntity, Exception e) { + ActionResult result = new ActionResult(); + result.setCode(400); + result.setMsg(e.getMessage()); + if (nodeEntity != null) { + nodeEntity.setErrorMsg(JsonUtil.getObjectToString(result)); + } + } + + private ActionResult interfaceTemplateJson(IntegrateChildNodeList childNodeList, Map data, + UserInfo userInfo) throws WorkFlowException { + IntegrateProperties properties = childNodeList.getProperties(); + String interId = properties.getFormId(); + Map parameterMap = new HashMap<>(); + List templateJson = properties.getTemplateJson(); + Set msg = new HashSet<>(); + for (IntegrateTemplateModel templateJsonModel : templateJson) { + String fieldId = templateJsonModel.getField(); + Boolean required = templateJsonModel.getRequired(); + String relationField = templateJsonModel.getRelationField(); + String dataValue = data.get(relationField) != null ? String.valueOf(data.get(relationField)) : null; + if (AuthorizeConditionEnum.FORMID.getCondition().equals(relationField)) { + dataValue = String.valueOf(data.get(FlowFormConstant.ID)); + } else if (AuthorizeConditionEnum.USER.getCondition().equals(relationField)) { + dataValue = userInfo.getUserId(); + } else if (AuthorizeConditionEnum.USERANDUNDER.getCondition().equals(relationField)) { + List subOrganizeIds = new ArrayList<>(); + subOrganizeIds.addAll(userService.getListByManagerId(userInfo.getUserId(), null).stream() + .map(UserEntity::getId).collect(Collectors.toList())); + subOrganizeIds.add(userInfo.getUserId()); + dataValue = subOrganizeIds.stream().collect(Collectors.joining(",")); + } else if (AuthorizeConditionEnum.ORGANIZE.getCondition().equals(relationField)) { + String orgId = userInfo.getOrganizeId(); + if (StringUtil.isNotEmpty(userInfo.getDepartmentId())) { + orgId = userInfo.getDepartmentId(); + } + dataValue = orgId; + } else if (AuthorizeConditionEnum.ORGANIZEANDUNDER.getCondition().equals(relationField)) { + String orgId = userInfo.getOrganizeId(); + if (StringUtil.isNotEmpty(userInfo.getDepartmentId())) { + orgId = userInfo.getDepartmentId(); + } + List underOrganizations = organizeService.getUnderOrganizations(orgId, false); + underOrganizations.add(orgId); + dataValue = underOrganizations.stream().collect(Collectors.joining(",")); + } else if (AuthorizeConditionEnum.BRANCHMANAGEORG.getCondition().equals(relationField)) { + List orgIds = organizeAdministratorService.getOrganizeUserList(YunzhupaasConst.CURRENT_ORG_SUB); + dataValue = orgIds.stream().collect(Collectors.joining(",")); + } + String dataFieldValue = relationField; + String dataJson = !ObjectUtil.equals(templateJsonModel.getSourceType(), TemplateEnum.Custom.getCode()) + ? dataValue + : dataFieldValue; + String[] model = StringUtil.isNotEmpty(relationField) ? relationField.split("-") : new String[] {}; + if (model.length > 1) { + Object dataList = data.get(model[0]); + if (dataList instanceof List) { + List> listAll = (List>) dataList; + List dataListAll = new ArrayList<>(); + for (Map objectMap : listAll) { + dataListAll.add(objectMap.get(model[1])); + } + if (required && ObjectUtil.isEmpty(dataListAll)) { + msg.add(fieldId); + } + dataJson = String.valueOf(dataListAll); + } + } + if (required && ObjectUtil.isEmpty(dataJson)) { + msg.add(fieldId); + } + parameterMap.put(fieldId, dataJson); + } + errRequiredMsg(msg); + ActionResult dataInterfaceInfo = dataInterfaceService.infoToId(interId, userInfo.getTenantId(), + parameterMap, userInfo.getToken(), + null, null, null, null); + if (dataInterfaceInfo.getCode() != 200) { + throw new WorkFlowException(dataInterfaceInfo.getMsg()); + } + return dataInterfaceInfo; + } + + private void errRequiredMsg(Set msg) throws WorkFlowException { + if (msg.size() > 0) { + throw new WorkFlowException(new ArrayList(msg).get(0) + MsgCode.VS015.get()); + } + } + + /** + * 发起审批 + * + * @param data 数据 + * @param nodeList 节点数组 + * @param node 当前节点 + * @param retryNodeCode 日志失败重试 + * @throws WorkFlowException 异常 + */ + private void launchFlow(Map data, List nodeList, String node, + String retryNodeCode) throws WorkFlowException { + IntegrateNodeEntity nodeEntity = nodeList.stream().filter(t -> t.getNodeCode().equals(node)).findFirst() + .orElse(null); + if (nodeEntity != null) { + List list = nodeList(nodeEntity); + boolean isRetry = nodeEntity.getNodeCode().equals(retryNodeCode); + if (list.size() == 0 || isRetry) { + nodeEntity.setStartTime(new Date()); + IntegrateChildNodeList childNodeList = JsonUtil.getJsonToBean(nodeEntity.getNodePropertyJson(), + IntegrateChildNodeList.class); + IntegrateProperties properties = childNodeList.getProperties(); + String msg = ""; + try { + String flowId = properties.getFlowId(); + FlowFormModel formIdAndFlowId = templateService.getFormIdAndFlowId(properties.getInitiator(), + flowId); + List userList = formIdAndFlowId.getUserId(); + List userName = userService.getUserName(userList, true); + if (userName.isEmpty()) { + throw new WorkFlowException(MsgCode.VS025.get()); + } + for (UserEntity entity : userName) { + UserInfo userInfo = new UserInfo(); + userInfo.setUserId(entity.getId()); + userInfo.setUserName(entity.getRealName()); + List transferList = properties.getTransferList(); + Map saveData = formData(data, transferList); + FlowModel flowModel = new FlowModel(); + flowModel.setUserInfo(userInfo); + flowModel.setFlowId(flowId); + flowModel.setStatus(1); + flowModel.setFormData(saveData); + taskService.saveOrSubmit(flowModel); + } + nodeEntity.setResultType(1); + } catch (Exception e) { + errMsg(nodeEntity, e); + msg = e.getMessage(); + } + + nodeEntity.setEndTime(new Date()); + if (isRetry) { + integrateNodeService.update(nodeEntity.getTaskId(), nodeEntity.getNodeCode()); + } + integrateNodeService.create(nodeEntity); + if (StringUtil.isNotEmpty(msg)) { + throw new WorkFlowException(msg); + } + } + } + } + // ------------------------------------------webhook触发------------------------------------------------------ + + public void integrate(String id, String tenantId, Map body) throws WorkFlowException { + IntegrateEntity entity = integrateService.getInfo(id); + if (entity == null) { + throw new WorkFlowException(MsgCode.VS016.get()); + } + if (Objects.equals(entity.getEnabledMark(), 0)) { + throw new WorkFlowException(MsgCode.VS017.get()); + } + IntegrateChildNode childNode = JsonUtil.getJsonToBean(entity.getTemplateJson(), IntegrateChildNode.class); + IntegrateProperties properties = childNode.getProperties(); + List formFieldList = properties.getFormFieldList(); + List> dataList = new ArrayList<>(); + Map map = new HashMap<>(); + for (FieLdsModel fieLdsModel : formFieldList) { + map.put(fieLdsModel.getId(), body.get(fieLdsModel.getId())); + } + dataList.add(map); + // 登录一个临时用户 + String token = AuthUtil.loginTempUser(entity.getCreatorUserId(), tenantId); + UserInfo userInfo = UserProvider.getUser(token); + UserProvider.setLocalLoginUser(userInfo); + integrate(entity.getId(), dataList, userInfo); + } +} diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-controller/pom.xml b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-controller/pom.xml new file mode 100644 index 0000000..42255ee --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-controller/pom.xml @@ -0,0 +1,23 @@ + + + + yunzhupaas-visualdev-integrate + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-visualdev-integrate-controller + + + + + com.yunzhupaas + yunzhupaas-visualdev-integrate-biz + ${project.version} + compile + + + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-controller/src/main/java/com/yunzhupaas/integrate/controller/IntegrateController.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-controller/src/main/java/com/yunzhupaas/integrate/controller/IntegrateController.java new file mode 100644 index 0000000..4fe2d98 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-controller/src/main/java/com/yunzhupaas/integrate/controller/IntegrateController.java @@ -0,0 +1,306 @@ +package com.yunzhupaas.integrate.controller; + + +import cn.hutool.core.util.ObjectUtil; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.emnus.ModuleTypeEnum; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.integrate.entity.IntegrateEntity; +import com.yunzhupaas.integrate.entity.IntegrateQueueEntity; +import com.yunzhupaas.integrate.job.IntegrateJobUtil; +import com.yunzhupaas.integrate.model.integrate.*; +import com.yunzhupaas.integrate.model.nodeJson.IntegrateModel; +import com.yunzhupaas.integrate.service.IntegrateQueueService; +import com.yunzhupaas.integrate.service.IntegrateService; +import com.yunzhupaas.integrate.util.IntegrateHttpModel; +import com.yunzhupaas.integrate.util.IntegrateUtil; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import jakarta.validation.Valid; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.UUID; +import java.util.stream.Collectors; + +@Slf4j +@Tag(name = "集成助手", description = "Integrate") +@RestController +@RequestMapping("/api/visualdev/Integrate") +public class IntegrateController extends SuperController { + + @Autowired + private UserService userService; + + @Autowired + private DataFileExport fileExport; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private IntegrateService integrateService; + @Autowired + private IntegrateQueueService integrateQueueService; + @Autowired + private IntegrateUtil integrateUtil; + @Autowired + private RedisUtil redisUtil; + + /** + * 列表 + * + * @return + */ + @Operation(summary = "列表") + @GetMapping + public ActionResult> list(IntegratePagination pagination) { + List data = integrateService.getList(pagination); + List userId = data.stream().map(t -> t.getCreatorUserId()).collect(Collectors.toList()); + List userEntities = userService.getUserName(userId); + List resultList = new ArrayList<>(); + for (IntegrateEntity entity : data) { + IntegrateListVO vo = JsonUtil.getJsonToBean(entity, IntegrateListVO.class); + UserEntity creatorUser = userEntities.stream().filter(t -> t.getId().equals(entity.getCreatorUserId())).findFirst().orElse(null); + vo.setCreatorUser(creatorUser != null ? creatorUser.getRealName() + "/" + creatorUser.getAccount() : ""); + resultList.add(vo); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(resultList, paginationVO); + } + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "获取信息") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id) { + IntegrateEntity entity = integrateService.getInfo(id); + if (entity == null) { + return ActionResult.fail(MsgCode.FA001.get()); + } + IntegrateInfoVO vo = JsonUtil.getJsonToBean(entity, IntegrateInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 新建 + * + * @param integrateCrForm 实体对象 + * @return + */ + @Operation(summary = "添加") + @Parameters({ + @Parameter(name = "integrateCrForm", description = "实体对象", required = true) + }) + @PostMapping + public ActionResult create(@RequestBody @Valid IntegrateCrForm integrateCrForm) { + IntegrateEntity entity = JsonUtil.getJsonToBean(integrateCrForm, IntegrateEntity.class); + if (integrateService.isExistByFullName(entity.getFullName(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (integrateService.isExistByEnCode(entity.getEnCode(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + String id = RandomUtil.uuId(); + entity.setId(id); + integrateService.create(entity); + return ActionResult.success(MsgCode.SU001.get(), id); + } + + /** + * 更新 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "修改") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true), + @Parameter(name = "integrateUpForm", description = "实体对象", required = true) + }) + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody IntegrateUpForm integrateUpForm) { + IntegrateEntity positionEntity = integrateService.getInfo(id); + if (positionEntity == null) { + return ActionResult.fail(MsgCode.FA002.get()); + } + IntegrateEntity entity = JsonUtil.getJsonToBean(integrateUpForm, IntegrateEntity.class); + if (integrateService.isExistByFullName(entity.getFullName(), id)) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + if (integrateService.isExistByEnCode(entity.getEnCode(), id)) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + boolean flag = integrateService.update(id, entity,false); + if (flag == false) { + return ActionResult.fail(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get(), id); + } + + /** + * 删除 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "删除") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + IntegrateEntity entity = integrateService.getInfo(id); + if (entity != null) { + integrateService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + /** + * 复制功能 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "复制功能") + @Parameters({ + @Parameter(name = "id", description = "主键"), + }) + @PostMapping("/{id}/Actions/Copy") + public ActionResult copyInfo(@PathVariable("id") String id) throws Exception { + IntegrateEntity entity = integrateService.getInfo(id); + entity.setEnabledMark(0); + String copyNum = UUID.randomUUID().toString().substring(0, 5); + entity.setFullName(entity.getFullName() + ".副本" + copyNum); + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + entity.setId(RandomUtil.uuId()); + entity.setEnCode(entity.getEnCode() + copyNum); + entity.setCreatorTime(new Date()); + entity.setEnabledMark(0); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + integrateService.create(entity); + return ActionResult.success(MsgCode.SU007.get()); + } + + /** + * 更新功能状态 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "更新功能状态") + @Parameters({ + @Parameter(name = "id", description = "主键"), + }) + @PutMapping("/{id}/Actions/State") + public ActionResult update(@PathVariable("id") String id) { + IntegrateEntity entity = integrateService.getInfo(id); + if (entity != null) { + if (entity.getEnabledMark() == null || "1".equals(String.valueOf(entity.getEnabledMark()))) { + entity.setEnabledMark(0); + } else { + entity.setEnabledMark(1); + } + boolean flag = integrateService.update(entity.getId(), entity,true); + if (flag == false) { + return ActionResult.fail(MsgCode.FA002.get()); + } + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 导出 + * + * @param id 主键 + * @return + */ + @Operation(summary = "导出") + @PostMapping("/{id}/Actions/Export") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult exportData(@PathVariable("id") String id) { + IntegrateEntity entity = integrateService.getInfo(id); + DownloadVO downloadVO = fileExport.exportFile(entity, configValueUtil.getTemporaryFilePath(), entity.getFullName(), ModuleTypeEnum.BASE_INTEGRATE.getTableName()); + return ActionResult.success(downloadVO); + } + + /** + * 导入 + * + * @param file 文件 + * @return + */ + @Operation(summary = "导入") + @PostMapping(value = "/Actions/Import", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ActionResult ImportData(@RequestPart("file") MultipartFile file,@RequestParam("type") Integer type) throws WorkFlowException { + //判断是否为.json结尾 + if (FileUtil.existsSuffix(file, ModuleTypeEnum.BASE_INTEGRATE.getTableName())) { + return ActionResult.fail(MsgCode.IMP002.get()); + } + try { + String fileContent = FileUtil.getFileContent(file); + IntegrateEntity entity = JsonUtil.getJsonToBean(fileContent, IntegrateEntity.class); + return integrateService.ImportData(entity, type); + } catch (Exception e) { + throw new WorkFlowException(MsgCode.IMP004.get()); + } + } + + /** + * 集成助手事件触发 + * @param model + * @return + */ + @PostMapping(value = "/execute") + public ActionResult execute(@RequestBody IntegrateHttpModel model) { + integrateUtil.integrates(model.getDataInfoVOList(),model.getUserInfo()); + return ActionResult.success(); + } + + /** + * 集成助手定时触发 + * @param model + * @return + */ + @PostMapping(value = "/executeQuery") + public ActionResult executeQuery(@RequestBody IntegrateHttpModel model) { + IntegrateModel integrateModel = JsonUtil.getJsonToBean(model, IntegrateModel.class); + if(ObjectUtil.isNotEmpty(model.getId())){ + IntegrateQueueEntity entity = integrateQueueService.getById(model.getId()); + if(ObjectUtil.isNotEmpty(entity)) { + integrateUtil.integrate(entity, model.getUserInfo()); + } + } + IntegrateJobUtil.removeIntegrate(integrateModel, redisUtil); + return ActionResult.success(); + } + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-controller/src/main/java/com/yunzhupaas/integrate/controller/IntegrateTaskController.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-controller/src/main/java/com/yunzhupaas/integrate/controller/IntegrateTaskController.java new file mode 100644 index 0000000..510a4b3 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-controller/src/main/java/com/yunzhupaas/integrate/controller/IntegrateTaskController.java @@ -0,0 +1,147 @@ +package com.yunzhupaas.integrate.controller; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.integrate.entity.IntegrateNodeEntity; +import com.yunzhupaas.integrate.entity.IntegrateQueueEntity; +import com.yunzhupaas.integrate.entity.IntegrateTaskEntity; +import com.yunzhupaas.integrate.model.integratetask.IntegrateQueueListVO; +import com.yunzhupaas.integrate.model.integratetask.IntegrateTaskInfo; +import com.yunzhupaas.integrate.model.integratetask.IntegrateTaskListVO; +import com.yunzhupaas.integrate.model.integrate.IntegratePageModel; +import com.yunzhupaas.integrate.model.integratetask.IntegrateTaskModel; +import com.yunzhupaas.integrate.service.IntegrateNodeService; +import com.yunzhupaas.integrate.service.IntegrateQueueService; +import com.yunzhupaas.integrate.service.IntegrateTaskService; +import com.yunzhupaas.integrate.util.IntegrateUtil; +import com.yunzhupaas.util.JsonUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.List; + +@Tag(name = "集成助手日志", description = "IntegrateTask") +@RestController +@RequestMapping("/api/visualdev/IntegrateTask") +public class IntegrateTaskController extends SuperController { + + @Autowired + private IntegrateTaskService integrateTaskService; + @Autowired + private IntegrateNodeService integrateNodeService; + @Autowired + private IntegrateUtil integrateUtil; + @Autowired + private IntegrateQueueService integrateQueueService; + + /** + * 列表 + * + * @return + */ + @Operation(summary = "日志列表") + @GetMapping + public ActionResult> list(IntegratePageModel pagination) { + List data = integrateTaskService.getList(pagination); + List list = JsonUtil.getJsonToList(data, IntegrateTaskListVO.class); + for (IntegrateTaskListVO taskListVO : list) { + taskListVO.setIsRetry("0".equals(taskListVO.getParentId()) ? 0 : 1); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(list, paginationVO); + } + + /** + * 删除 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "删除") + @Parameters({ + @Parameter(name = "id", description = "主键值", required = true) + }) + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id) { + integrateTaskService.delete(id); + return ActionResult.success(MsgCode.SU003.get()); + } + + /** + * 日志列表 + * + * @return + */ + @Operation(summary = "执行列表") + @GetMapping("/queueList") + public ActionResult> queueList() { + List list = integrateQueueService.getList(); + List listVO = JsonUtil.getJsonToList(list, IntegrateQueueListVO.class); + return ActionResult.success(listVO); + } + + /** + * 日志列表 + * + * @return + */ + @Operation(summary = "日志详情") + @GetMapping("/{id}") + public ActionResult list(@PathVariable("id") String id) { + IntegrateTaskEntity taskEntity = integrateTaskService.getInfo(id); + List nodeList = integrateNodeService.getList(new ArrayList() {{ + add(id); + }}, null); + List list = JsonUtil.getJsonToList(nodeList, IntegrateTaskModel.class); + for (IntegrateTaskModel taskModel : list) { + boolean isType = "0".equals(taskModel.getParentId()); + taskModel.setType(isType ? 1 : 0); + } + IntegrateTaskInfo info = new IntegrateTaskInfo(); + info.setList(list); + info.setData(taskEntity.getData()); + return ActionResult.success(info); + } + + /** + * 节点重试 + * + * @return + */ + @Operation(summary = "节点重试") + @GetMapping(value = "/{id}/nodeRetry") + public ActionResult taskNode(@PathVariable("id") String id, String nodeId) { + IntegrateTaskEntity taskEntity = integrateTaskService.getInfo(id); + if (taskEntity != null) { + integrateUtil.integrate(id, taskEntity.getParentId(), nodeId); + return ActionResult.success(MsgCode.SU005.get()); + } + return ActionResult.fail(MsgCode.FA007.get()); + } + + /** + * 重试 + * + * @return + */ + @Operation(summary = "重试") + @PutMapping(value = "/{id}/retry") + public ActionResult ImportData(@PathVariable("id") String id) { + IntegrateTaskEntity taskEntity = integrateTaskService.getInfo(id); + if (taskEntity != null) { + integrateUtil.integrate(id, id, "0"); + return ActionResult.success(MsgCode.SU005.get()); + } + return ActionResult.fail(MsgCode.FA007.get()); + } + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-controller/src/main/java/com/yunzhupaas/integrate/controller/WebHookController.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-controller/src/main/java/com/yunzhupaas/integrate/controller/WebHookController.java new file mode 100644 index 0000000..bf9d833 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-controller/src/main/java/com/yunzhupaas/integrate/controller/WebHookController.java @@ -0,0 +1,193 @@ +package com.yunzhupaas.integrate.controller; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.integrate.entity.IntegrateEntity; +import com.yunzhupaas.integrate.model.integrate.WebHookInfoVo; +import com.yunzhupaas.integrate.service.IntegrateService; +import com.yunzhupaas.integrate.util.IntegrateUtil; +import com.yunzhupaas.util.*; +import org.apache.commons.codec.binary.Base64; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.nio.charset.StandardCharsets; +import java.util.*; + +@Tag(name = "webhook触发", description = "WebHook") +@RestController +@RequestMapping("/api/visualdev/Hooks") +public class WebHookController { + + @Autowired + private IntegrateService integrateService; + @Autowired + private RedisUtil redisUtil; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private IntegrateUtil integrateUtil; + + + private static final String WEBHOOK_RED_KEY = "webhookencode"; + + private static long DEFAULT_CACHE_TIME = 60 * 5; + + @Operation(summary = "数据接收接口") + @Parameters({ + @Parameter(name = "id", description = "base64转码id", required = true), + @Parameter(name = "tenantId", description = "租户id", required = false) + }) + @PostMapping("/{id}") + @NoDataSourceBind + public ActionResult webhookTrigger(@PathVariable("id") String id, + @RequestParam(value = "tenantId", required = false) String tenantId, + @RequestBody Map body) throws WorkFlowException { + String idReal = new String(Base64.decodeBase64(id.getBytes(StandardCharsets.UTF_8))); + if (configValueUtil.isMultiTenancy()) { + // 判断是不是从外面直接请求 + if (StringUtil.isNotEmpty(tenantId)) { + //切换成租户库 + try { + TenantDataSourceUtil.switchTenant(tenantId); + } catch (Exception e) { + return ActionResult.fail(MsgCode.LOG105.get()); + } + } + } + integrateUtil.integrate(idReal, tenantId, body); + return ActionResult.success(); + } + + @Operation(summary = "获取webhookUrl") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true) + }) + @GetMapping("/getUrl") + public ActionResult getWebhookUrl(@RequestParam("id") String id) { + String enCodeBase64 = new String(Base64.encodeBase64(id.getBytes(StandardCharsets.UTF_8))); + String randomStr = UUID.randomUUID().toString().substring(0, 5); + WebHookInfoVo vo = new WebHookInfoVo(); + vo.setEnCodeStr(enCodeBase64); + vo.setRandomStr(randomStr); + vo.setWebhookUrl("/api/visualdev/Hooks/" + enCodeBase64); + vo.setRequestUrl("/api/visualdev/Hooks/" + enCodeBase64 + "/params/" + randomStr); + return ActionResult.success(vo); + } + + @Operation(summary = "通过get接口获取参数") + @Parameters({ + @Parameter(name = "id", description = "base64转码id", required = true), + @Parameter(name = "randomStr", description = "获取webhookUrl提供的随机字符", required = true) + }) + @GetMapping("/{id}/params/{randomStr}") + @NoDataSourceBind + public ActionResult getWebhookParams(@PathVariable("id") String id, + @PathVariable("randomStr") String randomStr) throws WorkFlowException { + insertRedis(id, randomStr, new HashMap<>()); + return ActionResult.success(); + } + + @Operation(summary = "通过post接口获取参数") + @Parameters({ + @Parameter(name = "id", description = "base64转码id", required = true), + @Parameter(name = "randomStr", description = "获取webhookUrl提供的随机字符", required = true) + }) + @PostMapping("/{id}/params/{randomStr}") + @NoDataSourceBind + public ActionResult postWebhookParams(@PathVariable("id") String id, + @PathVariable("randomStr") String randomStr, + @RequestBody Map obj) throws WorkFlowException { + insertRedis(id, randomStr, new HashMap<>(obj)); + return ActionResult.success(); + } + + /** + * 助手id查询信息,写入缓存 + * + * @param id + * @param randomStr + * @param resultMap + * @throws WorkFlowException + */ + private void insertRedis(String id, String randomStr, Map resultMap) throws WorkFlowException { + String idReal = new String(Base64.decodeBase64(id.getBytes(StandardCharsets.UTF_8))); + String key1 = WEBHOOK_RED_KEY + "_" + idReal + "_" + randomStr; + if (!redisUtil.exists(key1)) { + throw new WorkFlowException(MsgCode.VS016.get()); + } + String tenantId = redisUtil.getString(key1).toString(); + + if (configValueUtil.isMultiTenancy()) { + // 判断是不是从外面直接请求 + if (StringUtil.isNotEmpty(tenantId)) { + //切换成租户库 + try { + TenantDataSourceUtil.switchTenant(tenantId); + } catch (Exception e) { + throw new WorkFlowException(MsgCode.LOG105.get()); + } + } + } + IntegrateEntity entity = integrateService.getInfo(idReal); + if (Objects.equals(entity.getEnabledMark(), 0)) { + throw new WorkFlowException(MsgCode.VS017.get()); + } + Map parameterMap = new HashMap<>(ServletUtil.getRequest().getParameterMap()); + for (String key : parameterMap.keySet()) { + String[] parameterValues = ServletUtil.getRequest().getParameterValues(key); + if (parameterValues.length == 1) { + parameterMap.put(key, parameterValues[0]); + } else { + parameterMap.put(key, parameterValues); + } + } + resultMap.putAll(parameterMap); + if (resultMap.keySet().size() > 0) { + redisUtil.insert(WEBHOOK_RED_KEY + "_" + randomStr, resultMap, DEFAULT_CACHE_TIME); + redisUtil.remove(key1); + } + } + + @Operation(summary = "请求参数添加触发接口") + @Parameters({ + @Parameter(name = "id", description = "base64转码id", required = true), + @Parameter(name = "randomStr", description = "获取webhookUrl提供的随机字符", required = true) + }) + @GetMapping("/{id}/start/{randomStr}") + public ActionResult start(@PathVariable("id") String id, + @PathVariable("randomStr") String randomStr) { + redisUtil.remove(WEBHOOK_RED_KEY + "_" + randomStr); + redisUtil.insert(WEBHOOK_RED_KEY + "_" + id + "_" + randomStr, UserProvider.getUser().getTenantId(), DEFAULT_CACHE_TIME); + return ActionResult.success(); + } + + @Operation(summary = "获取缓存的接口参数") + @Parameters({ + @Parameter(name = "randomStr", description = "获取webhookUrl提供的随机字符", required = true) + }) + @GetMapping("/getParams/{randomStr}") + public ActionResult getRedisParams(@PathVariable("randomStr") String randomStr) { + Map mapRedis = new HashMap<>(); + String key = WEBHOOK_RED_KEY + "_" + randomStr; + if (redisUtil.exists(key)) { + mapRedis = redisUtil.getMap(key); + } + List> list = new ArrayList<>(); + for (String redisKey : mapRedis.keySet()) { + Map map = new HashMap<>(); + map.put("id", redisKey); + map.put("fullName", mapRedis.get(redisKey)); + list.add(map); + } + return ActionResult.success(list); + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/pom.xml b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/pom.xml new file mode 100644 index 0000000..adb4301 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/pom.xml @@ -0,0 +1,24 @@ + + + + yunzhupaas-visualdev-integrate + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-visualdev-integrate-entity + + + + com.yunzhupaas + yunzhupaas-common-core + + + com.yunzhupaas + yunzhupaas-common-database + + + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/entity/IntegrateEntity.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/entity/IntegrateEntity.java new file mode 100644 index 0000000..801d4fe --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/entity/IntegrateEntity.java @@ -0,0 +1,54 @@ +package com.yunzhupaas.integrate.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +/** + * + * @version V3.4.5 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @author 云筑产品开发平台组 + */ +@Data +@TableName("base_integrate") +public class IntegrateEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + + /** + * 编码 + */ + @TableField("F_EN_CODE") + private String enCode; + + /** + * 模板 + */ + @TableField("F_TEMPLATE_JSON") + private String templateJson; + + /** + * 类型(1-事件,2-定时 ) + */ + @TableField("F_TYPE") + private Integer type; + + /** + * 开始表单id + */ + @TableField("F_FORM_ID") + private String formId; + + /** + * 类型 (1.新增 2.修改 3.删除) + */ + @TableField("F_TRIGGER_TYPE") + private Integer triggerType; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/entity/IntegrateNodeEntity.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/entity/IntegrateNodeEntity.java new file mode 100644 index 0000000..ebbe6f5 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/entity/IntegrateNodeEntity.java @@ -0,0 +1,98 @@ +package com.yunzhupaas.integrate.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * + * @version V3.4.5 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @author 云筑产品开发平台组 + */ +@Data +@TableName("base_integrate_node") +public class IntegrateNodeEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 任务主键 + */ + @TableField("F_TASK_ID") + private String taskId; + + /** + * 节点编码 + */ + @TableField("F_NODE_CODE") + private String nodeCode; + + /** + * 节点编码 + */ + @TableField("F_FORM_ID") + private String formId; + + /** + * 节点类型 + */ + @TableField("F_NODE_TYPE") + private String nodeType; + + /** + * 节点名称 + */ + @TableField("F_NODE_NAME") + private String nodeName; + + /** + * 父节点id + */ + @TableField("F_PARENT_ID") + private String parentId; + + /** + * 节点属性Json + */ + @TableField("F_NODE_PROPERTY_JSON") + private String nodePropertyJson; + + /** + * 下一节点 + */ + @TableField("F_NODE_NEXT") + private String nodeNext; + + /** + * 运行结果 + */ + @TableField("F_RESULT_TYPE") + private Integer resultType; + + /** + * 异常 + */ + @TableField("F_ERROR_MSG") + private String errorMsg; + + /** + * 开始时间 + */ + @TableField("f_start_time") + private Date startTime; + + /** + * 能否重试 + */ + @TableField("f_is_retry") + private Integer isRetry; + + /** + * 结束时间 + */ + @TableField("F_END_Time") + private Date endTime; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/entity/IntegrateQueueEntity.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/entity/IntegrateQueueEntity.java new file mode 100644 index 0000000..84295c6 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/entity/IntegrateQueueEntity.java @@ -0,0 +1,45 @@ +package com.yunzhupaas.integrate.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * + * @version V3.4.5 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @author 云筑产品开发平台组 + */ +@Data +@TableName("base_integrate_queue") +public class IntegrateQueueEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 状态 + */ + @TableField("f_state") + private Integer state; + + /** + * 集成主键 + */ + @TableField("F_INTEGRATE_ID") + private String integrateId; + + /** + * 执行时间 + */ + @TableField("F_EXECUTION_TIME") + private Date executionTime; + + /** + * 名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/entity/IntegrateTaskEntity.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/entity/IntegrateTaskEntity.java new file mode 100644 index 0000000..b8cb641 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/entity/IntegrateTaskEntity.java @@ -0,0 +1,81 @@ +package com.yunzhupaas.integrate.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * + * @version V3.4.5 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @author 云筑产品开发平台组 + */ +@Data +@TableName("base_integrate_task") +public class IntegrateTaskEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 集成主键 + */ + @TableField("F_INTEGRATE_ID") + private String integrateId; + + /** + * 实例进程 + */ + @TableField("F_PROCESS_ID") + private String processId; + + /** + * 集成类型(1-事件,2-定时 ) + */ + @TableField("F_TYPE") + private Integer type; + + /** + * 集成模板 + */ + @TableField("F_TEMPLATE_JSON") + private String templateJson; + + + /** + * 数据主键 + */ + @TableField("F_DATA_ID") + private String dataId; + + /** + * 数据 + */ + @TableField("F_DATA") + private String data; + + /** + * 父节点id + */ + @TableField("F_PARENT_ID") + private String parentId; + + /** + * 父节点时间 + */ + @TableField("F_PARENT_TIME") + private Date parentTime; + + /** + * 执行时间 + */ + @TableField("F_EXECUTION_TIME") + private Date executionTime; + + /** + * 结果 (0.失败 1.成功) + */ + @TableField("F_RESULT_TYPE") + private Integer resultType; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/childnode/IntegrateChildNode.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/childnode/IntegrateChildNode.java new file mode 100644 index 0000000..683a823 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/childnode/IntegrateChildNode.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.integrate.model.childnode; + +import lombok.Data; + +/** + * 版本: V3.0.0 + * 版权: 深圳市乐程软件有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class IntegrateChildNode { + private String type; + private String content; + private String nodeId; + private String prevId; + private IntegrateChildNode childNode; + private IntegrateProperties properties = new IntegrateProperties(); +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/childnode/IntegrateMsgModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/childnode/IntegrateMsgModel.java new file mode 100644 index 0000000..d5d1187 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/childnode/IntegrateMsgModel.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.integrate.model.childnode; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 版本: V3.0.0 + * 版权: 深圳市乐程软件有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class IntegrateMsgModel { + //0.关闭 1.自定义 3.默认 + private Integer on = 0; + private String msgId; + private List templateJson = new ArrayList<>(); +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/childnode/IntegrateParamModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/childnode/IntegrateParamModel.java new file mode 100644 index 0000000..e51fd33 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/childnode/IntegrateParamModel.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.integrate.model.childnode; + +import lombok.Data; + +/** + * 版本: V3.0.0 + * 版权: 深圳市乐程软件有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class IntegrateParamModel { + private String field; + private String fieldName; + private Boolean required = false; + private String relationField; + private String msgTemplateId; + private Boolean isSubTable = false; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/childnode/IntegrateProperties.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/childnode/IntegrateProperties.java new file mode 100644 index 0000000..534298d --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/childnode/IntegrateProperties.java @@ -0,0 +1,62 @@ +package com.yunzhupaas.integrate.model.childnode; + +import com.yunzhupaas.database.model.superQuery.SuperQueryJsonModel; +import com.yunzhupaas.emnus.SearchMethodEnum; +import com.yunzhupaas.model.visualJson.FieLdsModel; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 版本: V3.0.0 + * 版权: 深圳市乐程软件有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class IntegrateProperties { + private String id; + private String title; + private String formId; + private String flowId; + private Integer formType = 1; + private List formFieldList = new ArrayList<>(); + private List transferList = new ArrayList<>(); + private List ruleList = new ArrayList<>(); + private Integer triggerEvent; + //0.不新增 1.新增 + private Integer addRule = 0; + //0-不更新 1-新增 + private Integer unFoundRule = 0; + //0-删除未找到 1-删除已找到 + private Integer deleteRule = 0; + private String ruleMatchLogic = SearchMethodEnum.And.getSymbol(); + + + private String msgId; + private List msgUserType = new ArrayList<>(); + private List msgUserIds = new ArrayList<>(); + private List templateJson = new ArrayList<>(); + private List interfaceTemplateJson = new ArrayList<>(); + private IntegrateMsgModel startMsgConfig = new IntegrateMsgModel(); + private IntegrateMsgModel failMsgConfig= new IntegrateMsgModel(); + + + + private Long startTime; + private String cron; + private Integer endTimeType = 1; + //次数 + private Integer endLimit = 1; + //结束时间 + private Long endTime; + //类型 + private Integer integrateType = 2; + + private List initiator; + + + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/childnode/IntegrateTemplateModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/childnode/IntegrateTemplateModel.java new file mode 100644 index 0000000..a095ab5 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/childnode/IntegrateTemplateModel.java @@ -0,0 +1,30 @@ +package com.yunzhupaas.integrate.model.childnode; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 版本: V3.0.0 + * 版权: 深圳市乐程软件有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class IntegrateTemplateModel { + //远端接口 + private String field; + private Boolean required = false; + private Integer sourceType; + private String relationField; + + + //发送配置 + private String id; + private String templateId; + private String sendConfigId; + private String msgTemplateName; + private List paramJson = new ArrayList<>(); +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/childnode/TransferModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/childnode/TransferModel.java new file mode 100644 index 0000000..07103ff --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/childnode/TransferModel.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.integrate.model.childnode; + +import lombok.Data; + +/** + * 版本: V3.0.0 + * 版权: 深圳市乐程软件有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class TransferModel { + private String targetField; + private String targetFieldLabel; + private Integer sourceType; + private String sourceValue; + private Boolean required = false; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/integrate/IntegrateCrForm.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/integrate/IntegrateCrForm.java new file mode 100644 index 0000000..40fa1e4 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/integrate/IntegrateCrForm.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.integrate.model.integrate; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 版本: V3.0.0 + * 版权: 深圳市乐程软件有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class IntegrateCrForm { + @Schema(description = "说明") + private String description; + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "有效标志") + private Integer enabledMark; + @Schema(description = "json") + private String templateJson; + @Schema(description = "排序码") + private long sortCode; + @Schema(description = "类型") + private Integer type; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/integrate/IntegrateInfoVO.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/integrate/IntegrateInfoVO.java new file mode 100644 index 0000000..5432930 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/integrate/IntegrateInfoVO.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.integrate.model.integrate; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 版本: V3.0.0 + * 版权: 深圳市乐程软件有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class IntegrateInfoVO { + @Schema(description = "主键") + private String id; + @Schema(description = "说明") + private String description; + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "有效标志") + private Integer enabledMark; + @Schema(description = "排序码") + private Long sortCode; + @Schema(description = "类型") + private Integer type; + @Schema(description = "json") + private String templateJson; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/integrate/IntegrateListVO.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/integrate/IntegrateListVO.java new file mode 100644 index 0000000..e564d9f --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/integrate/IntegrateListVO.java @@ -0,0 +1,38 @@ +package com.yunzhupaas.integrate.model.integrate; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 版本: V3.0.0 + * 版权: 深圳市乐程软件有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class IntegrateListVO { + @Schema(description = "主键") + private String id; + + @Schema(description = "类型") + private Integer type; + + @Schema(description = "名称") + private String fullName; + + @Schema(description = "编码") + private String enCode; + + @Schema(description = "有效标志") + private Integer enabledMark; + + @Schema(description = "创建时间" ) + private Long creatorTime; + + @Schema(description = "创建人" ) + private String creatorUser; + + @Schema(description = "修改时间" ) + private Long lastModifyTime; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/integrate/IntegratePageModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/integrate/IntegratePageModel.java new file mode 100644 index 0000000..69bf639 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/integrate/IntegratePageModel.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.integrate.model.integrate; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import lombok.Data; + +/** + * 版本: V3.0.0 + * 版权: 深圳市乐程软件有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class IntegratePageModel extends Pagination { + @Schema(description = "开始时间") + private String startTime; + @Schema(description = "结束时间") + private String endTime; + @Schema(description = "集成助手主键") + private String integrateId; + @Schema(description = "结果") + private Integer resultType; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/integrate/IntegratePagination.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/integrate/IntegratePagination.java new file mode 100644 index 0000000..3270c90 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/integrate/IntegratePagination.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.integrate.model.integrate; + +import com.yunzhupaas.base.Pagination; +import lombok.Data; + +/** + * 版本: V3.0.0 + * 版权: 深圳市乐程软件有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class IntegratePagination extends Pagination { + private Integer type; + private String formId; + private Integer trigger; + private Integer enabledMark; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/integrate/IntegrateUpForm.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/integrate/IntegrateUpForm.java new file mode 100644 index 0000000..328ee8f --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/integrate/IntegrateUpForm.java @@ -0,0 +1,15 @@ +package com.yunzhupaas.integrate.model.integrate; + +import lombok.Data; + +/** + * 版本: V3.0.0 + * 版权: 深圳市乐程软件有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class IntegrateUpForm extends IntegrateCrForm{ + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/integrate/WebHookInfoVo.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/integrate/WebHookInfoVo.java new file mode 100644 index 0000000..ded0865 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/integrate/WebHookInfoVo.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.integrate.model.integrate; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class WebHookInfoVo { + @Schema(description = "系统生成数据接收接口") + private String webhookUrl; + @Schema(description = "系统生成参数接收接口") + private String requestUrl; + @Schema(description = "base64未转换16进制字符串") + private String enCodeStr; + @Schema(description = "随机字符") + private String randomStr; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/integratetask/IntegrateQueueListVO.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/integratetask/IntegrateQueueListVO.java new file mode 100644 index 0000000..eaec663 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/integratetask/IntegrateQueueListVO.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.integrate.model.integratetask; + +import lombok.Data; + +/** + * 版本: V3.0.0 + * 版权: 深圳市乐程软件有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class IntegrateQueueListVO { + private String fullName; + private Integer state; + private Long executionTime; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/integratetask/IntegrateTaskInfo.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/integratetask/IntegrateTaskInfo.java new file mode 100644 index 0000000..e340c80 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/integratetask/IntegrateTaskInfo.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.integrate.model.integratetask; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 版本: V3.0.0 + * 版权: 深圳市乐程软件有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class IntegrateTaskInfo { + private List list = new ArrayList<>(); + private String data; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/integratetask/IntegrateTaskListVO.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/integratetask/IntegrateTaskListVO.java new file mode 100644 index 0000000..7458514 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/integratetask/IntegrateTaskListVO.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.integrate.model.integratetask; + +import lombok.Data; + +/** + * 版本: V3.0.0 + * 版权: 深圳市乐程软件有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class IntegrateTaskListVO { + private String id; + private String processId; + private String parentId; + private Integer isRetry; + private Long parentTime; + private Long executionTime; + private Integer resultType; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/integratetask/IntegrateTaskModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/integratetask/IntegrateTaskModel.java new file mode 100644 index 0000000..dea63bc --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/integratetask/IntegrateTaskModel.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.integrate.model.integratetask; + +import lombok.Data; + +/** + * 版本: V3.0.0 + * 版权: 深圳市乐程软件有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class IntegrateTaskModel { + private String taskId; + private String nodeCode; + private String nodeType; + private String nodeName; + private Integer resultType; + private String errorMsg; + private Long startTime; + private Long endTime; + private String parentId; + private Boolean isRetry; + private Integer type; + private String id; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/nodeJson/IntegrateChildNodeList.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/nodeJson/IntegrateChildNodeList.java new file mode 100644 index 0000000..c35bd7d --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/nodeJson/IntegrateChildNodeList.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.integrate.model.nodeJson; + +import com.yunzhupaas.integrate.model.childnode.IntegrateProperties; +import lombok.Data; + +import java.util.Date; + +/** + * 版本: V3.0.0 + * 版权: 深圳市乐程软件有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class IntegrateChildNodeList { + private String nodeId; + private String prevId; + private String nextId; + private String type; + private Integer integrateType; + private Date startTime = new Date(); + private Date endTime = new Date(); + private IntegrateProperties properties = new IntegrateProperties(); +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/nodeJson/IntegrateChildNodeModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/nodeJson/IntegrateChildNodeModel.java new file mode 100644 index 0000000..e895af0 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/nodeJson/IntegrateChildNodeModel.java @@ -0,0 +1,37 @@ +package com.yunzhupaas.integrate.model.nodeJson; + +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.integrate.entity.IntegrateEntity; +import com.yunzhupaas.integrate.entity.IntegrateNodeEntity; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 版本: V3.0.0 + * 版权: 深圳市乐程软件有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class IntegrateChildNodeModel { + private Map data = new HashMap<>(); + private List> dataListAll = new ArrayList<>(); + private List nodeList = new ArrayList<>(); + private String node; + private IntegrateEntity entity; + private String retryNodeCode; + private UserInfo userInfo; + private int num = 0; + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/nodeJson/IntegrateModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/nodeJson/IntegrateModel.java new file mode 100644 index 0000000..e79db12 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-integrate/yunzhupaas-visualdev-integrate-entity/src/main/java/com/yunzhupaas/integrate/model/nodeJson/IntegrateModel.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.integrate.model.nodeJson; + +import com.yunzhupaas.base.UserInfo; +import lombok.Data; + +/** + * 版本: V3.0.0 + * 版权: 深圳市乐程软件有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +@Data +public class IntegrateModel { + private UserInfo userInfo; + private String id; + private String cron; + private Long startTime = System.currentTimeMillis(); + private Long endTime; + private Integer endTimeType = 1; + private Integer endLimit = 1; + private Integer num = 0; + private Integer state = 0; + private Long time = System.currentTimeMillis(); +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/pom.xml b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/pom.xml new file mode 100644 index 0000000..8055012 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/pom.xml @@ -0,0 +1,21 @@ + + + + yunzhupaas-visualdev + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-visualdev-onlinedev + pom + + yunzhupaas-visualdev-onlinedev-entity + yunzhupaas-visualdev-onlinedev-biz + yunzhupaas-visualdev-onlinedev-controller + + + + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/pom.xml b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/pom.xml new file mode 100644 index 0000000..cce27be --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/pom.xml @@ -0,0 +1,32 @@ + + + + yunzhupaas-visualdev-onlinedev + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-visualdev-onlinedev-biz + + + + com.yunzhupaas + yunzhupaas-visualdev-onlinedev-entity + ${project.version} + + + com.yunzhupaas + yunzhupaas-visualdev-base-biz + ${project.version} + + + com.yunzhupaas + yunzhupaas-system-biz + ${project.version} + + + + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/mapper/VisualLogMapper.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/mapper/VisualLogMapper.java new file mode 100644 index 0000000..29d5e35 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/mapper/VisualLogMapper.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.onlinedev.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.onlinedev.entity.VisualLogEntity; + +/** + * 数据日志mapper + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/8/27 18:22:40 + */ +public interface VisualLogMapper extends SuperMapper { +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/mapper/VisualPersonalMapper.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/mapper/VisualPersonalMapper.java new file mode 100644 index 0000000..6b53b4d --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/mapper/VisualPersonalMapper.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.onlinedev.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.onlinedev.entity.VisualPersonalEntity; + +/** + * 列表个性视图:mapper + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/11/5 16:51:19 + */ +public interface VisualPersonalMapper extends SuperMapper { +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/mapper/VisualdevModelDataMapper.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/mapper/VisualdevModelDataMapper.java new file mode 100644 index 0000000..4e8ab4a --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/mapper/VisualdevModelDataMapper.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.onlinedev.mapper; + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yunzhupaas.onlinedev.entity.VisualdevModelDataEntity; + +/** + * + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @author 云筑产品开发平台组 + * @date 2024/3/16 + */ +public interface VisualdevModelDataMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/service/VisualDevInfoService.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/service/VisualDevInfoService.java new file mode 100644 index 0000000..c22c607 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/service/VisualDevInfoService.java @@ -0,0 +1,41 @@ +package com.yunzhupaas.onlinedev.service; + +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.onlinedev.model.OnlineInfoModel; +import com.yunzhupaas.base.model.OnlineImport.VisualdevModelDataInfoVO; + +/** + * + * 功能设计表单数据 + * @author 云筑产品开发平台组 + * @version V3.2 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2021/10/26 + */ +public interface VisualDevInfoService { + + /** + * 编辑页数据回显 + * @param id 主键id + * @param visualdevEntity 可视化实体 + * @return + */ + VisualdevModelDataInfoVO getEditDataInfo(String id, VisualdevEntity visualdevEntity, OnlineInfoModel model); + + /** + * 详情页数据 + * @param id + * @param visualdevEntity + * @return + */ + VisualdevModelDataInfoVO getDetailsDataInfo(String id, VisualdevEntity visualdevEntity); + + /** + * 详情页数据(过滤字段) + * @param id + * @param visualdevEntity + * @return + */ + VisualdevModelDataInfoVO getDetailsDataInfo(String id, VisualdevEntity visualdevEntity, OnlineInfoModel model); +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/service/VisualDevListService.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/service/VisualDevListService.java new file mode 100644 index 0000000..9497a96 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/service/VisualDevListService.java @@ -0,0 +1,85 @@ +package com.yunzhupaas.onlinedev.service; + +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.model.VisualDevJsonModel; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.onlinedev.model.OnlineDevListModel.VisualColumnSearchVO; +import com.yunzhupaas.onlinedev.model.PaginationModel; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +/** + * 列表临时接口 + * + * @author 云筑产品开发平台组 + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/7/28 + */ +@Service +public interface VisualDevListService { + + + /** + * 无表数据 + * + * @param modelId + * @return + */ + List> getWithoutTableData(String modelId); + + /** + * 有表查询 + * + * @param visualDevJsonModel + * @param paginationModel + * @return + */ + List> getListWithTable(VisualDevJsonModel visualDevJsonModel, PaginationModel paginationModel, UserInfo userInfo, List columnPropList); + + /** + * 列表数据 + * + * @param visualDevJsonModel + * @param paginationModel + * @return + */ + List> getDataList(VisualDevJsonModel visualDevJsonModel, PaginationModel paginationModel) throws WorkFlowException; + + /** + * 外链列表数据 + * + * @param visualDevJsonModel + * @param paginationModel + * @return + */ + List> getDataListLink(VisualDevJsonModel visualDevJsonModel, PaginationModel paginationModel) throws WorkFlowException; + + + /** + * 无表数据处理 + * + * @param list + * @param searchVOList + * @param paginationModel + * @return + */ + List> getList(List> list, List searchVOList, PaginationModel paginationModel); + + /** + * 关联表单列表数据 + * + * @param visualDevJsonModel + * @param paginationModel + * @return + */ + List> getRelationFormList(VisualDevJsonModel visualDevJsonModel, PaginationModel paginationModel); + + /** + * 列表数据 + */ + List> getListWithTableList(VisualDevJsonModel visualDevJsonModel, PaginationModel paginationModel, UserInfo userInfo); +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/service/VisualLogService.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/service/VisualLogService.java new file mode 100644 index 0000000..87c7b6f --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/service/VisualLogService.java @@ -0,0 +1,27 @@ +package com.yunzhupaas.onlinedev.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.onlinedev.entity.VisualLogEntity; +import com.yunzhupaas.onlinedev.model.log.VisualLogForm; +import com.yunzhupaas.base.model.VisualLogModel; +import com.yunzhupaas.onlinedev.model.log.VisualLogPage; + +import java.util.List; + +/** + * 数据日志service + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/8/27 18:24:10 + */ +public interface VisualLogService extends SuperService { + + void createEventLog(VisualLogForm form); + + List getLogList(VisualLogPage pagination); + + void addLog(VisualLogForm form, List listLog); +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/service/VisualPersonalService.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/service/VisualPersonalService.java new file mode 100644 index 0000000..601fff6 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/service/VisualPersonalService.java @@ -0,0 +1,64 @@ +package com.yunzhupaas.onlinedev.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.onlinedev.entity.VisualPersonalEntity; +import com.yunzhupaas.onlinedev.model.DataInfoVO; +import com.yunzhupaas.onlinedev.model.personalList.VisualPersonalInfo; +import com.yunzhupaas.onlinedev.model.personalList.VisualPersonalVo; + +import java.util.List; + +/** + * 列表个性视图 服务 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/11/5 16:50:00 + */ +public interface VisualPersonalService extends SuperService { + + /** + * 查询个性视图列表 + * + * @param menuId + * @return + */ + List getList(String menuId); + + /** + * 查询个性视图列表 + * + * @param menuId + * @return + */ + List getListVo(String menuId); + + + /** + * 查询个性视图详情 + * + * @param id + * @return + */ + VisualPersonalInfo getInfo(String id); + + /** + * 重名检测 同菜单下不能同名 + * + * @param fullName + * @param id + * @param menuId + * @return + */ + boolean isExistByFullName(String fullName, String id, String menuId); + + /** + * 页面初始化获取个性化配置 + * + * @param menuId + * @return + */ + void setDataInfoVO(String menuId, DataInfoVO dataInfoVO); +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/service/VisualdevModelDataService.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/service/VisualdevModelDataService.java new file mode 100644 index 0000000..0614546 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/service/VisualdevModelDataService.java @@ -0,0 +1,74 @@ +package com.yunzhupaas.onlinedev.service; + + +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.model.FormDataField; +import com.yunzhupaas.base.model.OnlineImport.VisualdevModelDataInfoVO; +import com.yunzhupaas.base.model.VisualDevJsonModel; +import com.yunzhupaas.base.model.flow.DataModel; +import com.yunzhupaas.base.model.flow.FlowFormDataModel; +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.onlinedev.entity.VisualdevModelDataEntity; +import com.yunzhupaas.onlinedev.model.PaginationModel; +import com.yunzhupaas.onlinedev.model.PaginationModelExport; +import com.yunzhupaas.onlinedev.model.VisualParamModel; + +import java.io.IOException; +import java.sql.SQLException; +import java.text.ParseException; +import java.util.List; +import java.util.Map; + +/** + * 0代码功能数据表 + * 版本: V3.0.0 + * 版权: 深圳市乐程软件有限公司 + * 作者: 管理员/admin + * 日期: 2020-07-24 11:59 + */ +public interface VisualdevModelDataService extends SuperService { + + /** + * 获取表单主表属性下拉框 + * + * @return + */ + List fieldList(String id, Integer filterType); + + /** + * 弹窗数据分页 + * + * @param visualdevEntity + * @param paginationModel + * @return + */ + List> getPageList(VisualdevEntity visualdevEntity, PaginationModel paginationModel); + + List getList(String modelId); + + VisualdevModelDataEntity getInfo(String id); + + VisualdevModelDataInfoVO infoDataChange(String id, VisualdevEntity visualdevEntity) throws IOException, ParseException, DataException, SQLException; + + void delete(VisualdevModelDataEntity entity); + + boolean tableDelete(String id, VisualDevJsonModel visualDevJsonModel) throws Exception; + + ActionResult tableDeleteMore(List id, VisualDevJsonModel visualDevJsonModel) throws Exception; + + List> exportData(String[] keys, PaginationModelExport paginationModelExport, VisualDevJsonModel visualDevJsonModel) throws IOException, ParseException, SQLException, DataException; + + DataModel visualCreate(VisualParamModel visualParamModel) throws Exception; + + DataModel visualUpdate(VisualParamModel visualParamModel) throws Exception; + + void visualDelete(VisualdevEntity visualdevEntity, List> data) throws Exception; + + /** + * 根据表名和规则删除功能表单数据 + */ + void deleteByTableName(FlowFormDataModel model) throws Exception; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/service/impl/VisualDevInfoServiceImpl.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/service/impl/VisualDevInfoServiceImpl.java new file mode 100644 index 0000000..d9c2391 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/service/impl/VisualDevInfoServiceImpl.java @@ -0,0 +1,423 @@ +package com.yunzhupaas.onlinedev.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.mapper.FlowFormDataMapper; +import com.yunzhupaas.base.model.ColumnDataModel; +import com.yunzhupaas.base.model.OnlineImport.VisualdevModelDataInfoVO; +import com.yunzhupaas.base.model.VisualConst; +import com.yunzhupaas.base.model.form.ModuleFormModel; +import com.yunzhupaas.base.service.DbLinkService; +import com.yunzhupaas.base.util.FlowFormDataUtil; +import com.yunzhupaas.base.util.FormPublicUtils; +import com.yunzhupaas.database.model.entity.DbLinkEntity; +import com.yunzhupaas.database.util.ConnUtil; +import com.yunzhupaas.database.util.DynamicDataSourceUtil; +import com.yunzhupaas.model.visualJson.*; +import com.yunzhupaas.model.visualJson.analysis.*; +import com.yunzhupaas.onlinedev.model.OnlineInfoModel; +import com.yunzhupaas.onlinedev.service.VisualDevInfoService; +import com.yunzhupaas.onlinedev.util.onlineDevUtil.OnlinePublicUtils; +import com.yunzhupaas.onlinedev.util.onlineDevUtil.OnlineSwapDataUtils; +import com.yunzhupaas.permissions.PermissionInterfaceImpl; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import lombok.Cleanup; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.map.CaseInsensitiveMap; +import org.mybatis.dynamic.sql.BasicColumn; +import org.mybatis.dynamic.sql.SqlBuilder; +import org.mybatis.dynamic.sql.SqlColumn; +import org.mybatis.dynamic.sql.SqlTable; +import org.mybatis.dynamic.sql.render.RenderingStrategies; +import org.mybatis.dynamic.sql.select.QueryExpressionDSL; +import org.mybatis.dynamic.sql.select.SelectModel; +import org.mybatis.dynamic.sql.select.join.EqualTo; +import org.mybatis.dynamic.sql.select.render.SelectStatementProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.sql.Connection; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author 云筑产品开发平台组 + * @version V3.2 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/10/26 + */ +@Service +public class VisualDevInfoServiceImpl implements VisualDevInfoService { + + @Autowired + private DbLinkService dblinkService; + @Autowired + private FlowFormDataMapper flowFormDataMapper; + @Autowired + private OnlineSwapDataUtils onlineSwapDataUtils; + @Autowired + private FlowFormDataUtil flowDataUtil; + + @Override + public VisualdevModelDataInfoVO getEditDataInfo(String id, VisualdevEntity visualdevEntity, OnlineInfoModel model) { + VisualdevModelDataInfoVO vo = new VisualdevModelDataInfoVO(); + Map editDataInfo = flowDataUtil.getEditDataInfo(visualdevEntity, id, model); + if (editDataInfo != null && editDataInfo.size() > 0) { + vo.setId(editDataInfo.get(FlowFormConstant.ID)); + vo.setData(JsonUtilEx.getObjectToString(editDataInfo)); + } + return vo; + } + + @Override + public VisualdevModelDataInfoVO getDetailsDataInfo(String id, VisualdevEntity visualdevEntity) { + return this.getDetailsDataInfo(id, visualdevEntity, + OnlineInfoModel.builder().needRlationFiled(true).needSwap(true).build()); + } + + @Override + public VisualdevModelDataInfoVO getDetailsDataInfo(String id, VisualdevEntity visualdevEntity, + OnlineInfoModel infoModel) { + VisualdevModelDataInfoVO vo = new VisualdevModelDataInfoVO(); + Map allDataMap = new HashMap<>(); + Map allDataResMap = new HashMap<>(); + FormDataModel formData = JsonUtil.getJsonToBean(visualdevEntity.getFormData(), FormDataModel.class); + Boolean logicalDelete = formData.getLogicalDelete(); + // 权限参数 + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(visualdevEntity.getColumnData(), + ColumnDataModel.class); + Boolean needP = false; + List formPerList = new ArrayList<>(); + if (columnDataModel != null && StringUtil.isNotEmpty(infoModel.getMenuId())) { + needP = columnDataModel.getUseFormPermission(); + Map pMap = PermissionInterfaceImpl.getFormMap(); + if (pMap.get(infoModel.getMenuId()) != null) { + formPerList = JsonUtil.getJsonToList(pMap.get(infoModel.getMenuId()), ModuleFormModel.class).stream() + .map(ModuleFormModel::getEnCode).collect(Collectors.toList()); + } + } + + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + List tableModelList = JsonUtil.getJsonToList(visualdevEntity.getVisualTables(), TableModel.class); + List formAllModel = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(infoModel.getFormAllModel())) { + formAllModel = infoModel.getFormAllModel(); + } else { + RecursionForm recursionForm = new RecursionForm(list, tableModelList); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + } + // form的属性 + List mast = formAllModel.stream() + .filter(t -> FormEnum.mast.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + List table = formAllModel.stream() + .filter(t -> FormEnum.table.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + List mastTable = formAllModel.stream() + .filter(t -> FormEnum.mastTable.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + + List relationFiled = new ArrayList() { + { + add(YunzhupaasKeyConsts.RELATIONFORM); + add(YunzhupaasKeyConsts.RELATIONFORM_ATTR); + } + }; + + TableModel mainTable = tableModelList.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + + DbLinkEntity linkEntity = "0".equals(visualdevEntity.getDbLinkId()) ? null + : dblinkService.getInfo(visualdevEntity.getDbLinkId()); + try { + DynamicDataSourceUtil.switchToDataSource(linkEntity); + @Cleanup + Connection conn = ConnUtil.getConnOrDefault(linkEntity); + String databaseProductName = conn.getMetaData().getDatabaseProductName(); + String dbType = conn.getMetaData().getDatabaseProductName().trim(); + boolean toUpperCase = databaseProductName.equalsIgnoreCase("oracle") + || databaseProductName.equalsIgnoreCase("DM DBMS"); + // 获取主键 + TableFields tableFields = mainTable.getFields().stream().filter(t -> Objects.equals(t.getPrimaryKey(), 1) + && !t.getField().toLowerCase().contains(TableFeildsEnum.TENANTID.getField())).findFirst() + .orElse(null); + String pKeyName = Objects.nonNull(tableFields) ? tableFields.getField() + : toUpperCase ? TableFeildsEnum.FID.getField().toUpperCase() : TableFeildsEnum.FID.getField(); + SqlTable mainSqlTable = SqlTable.of(mainTable.getTable()); + // 查询主表数据 + Map mainAllMap = searchMainData(id, infoModel, mainTable, tableModelList); + if (mainAllMap.size() == 0) { + return vo; + } + // 是否去除关联表单及关联表单字段 + if (!infoModel.isNeedRlationFiled()) { + mast = mast.stream() + .filter(t -> !relationFiled + .contains(t.getFormColumnModel().getFieLdsModel().getConfig().getYunzhupaasKey())) + .collect(Collectors.toList()); + } + // 主表 + List mainTableFields = mast.stream() + .filter(m -> StringUtil.isNotEmpty(m.getFormColumnModel().getFieLdsModel().getVModel())) + .map(s -> s.getFormColumnModel().getFieLdsModel().getVModel()).collect(Collectors.toList()); + // 开启权限移除字段 + if (needP) { + if (CollectionUtils.isEmpty(formPerList)) { + mainTableFields = Collections.EMPTY_LIST; + } else { + List newList = new ArrayList<>(); + for (String item : mainTableFields) { + if (formPerList.contains(item)) { + newList.add(item); + } + } + mainTableFields = newList; + } + } + List mainTableBasicColumn = mainTableFields.stream() + .map(m -> SqlTable.of(mainTable.getTable()).column(m)).collect(Collectors.toList()); + // 无字段时查询主键 + mainTableBasicColumn.add(SqlTable.of(mainTable.getTable()).column(pKeyName)); + + SelectStatementProvider mainRender = SqlBuilder.select(mainTableBasicColumn).from(mainSqlTable) + .where(mainSqlTable.column(pKeyName), + SqlBuilder.isEqualTo(mainAllMap.get(pKeyName))) + .build().render(RenderingStrategies.MYBATIS3); + List> mapList = flowFormDataMapper.selectManyMappedRows(mainRender); + + if (ObjectUtil.isNotEmpty(mapList) && mapList.size() > 0) { + allDataMap.putAll(mapList.get(0)); + } + + // 列表子表 + Map> groupByTableNames = mastTable.stream() + .map(mt -> mt.getFormMastTableModel()).collect(Collectors.groupingBy(ma -> ma.getTable())); + Iterator>> entryIterator = groupByTableNames.entrySet() + .iterator(); + while (entryIterator.hasNext()) { + Map.Entry> next = entryIterator.next(); + String childTableName = next.getKey(); + List childMastTableList = next.getValue(); + // 是否去除关联表单及关联表单字段 + if (!infoModel.isNeedRlationFiled()) { + childMastTableList = childMastTableList.stream() + .filter(t -> !relationFiled + .contains(t.getMastTable().getFieLdsModel().getConfig().getYunzhupaasKey())) + .collect(Collectors.toList()); + } + // 开启权限移除字段 + if (needP) { + if (CollectionUtils.isEmpty(formPerList)) { + childMastTableList = Collections.EMPTY_LIST; + } else { + List newList = new ArrayList<>(); + for (FormMastTableModel item : childMastTableList) { + if (formPerList.contains(item.getVModel())) { + newList.add(item); + } + } + childMastTableList = newList; + } + } + TableModel childTableModel = tableModelList.stream().filter(t -> t.getTable().equals(childTableName)) + .findFirst().orElse(null); + SqlTable mastSqlTable = SqlTable.of(childTableName); + List mastTableBasicColumn = childMastTableList.stream() + .filter(m -> StringUtil.isNotEmpty(m.getField())) + .map(m -> mastSqlTable.column(m.getField())).collect(Collectors.toList()); + // 添加副表关联字段,不然数据会空没有字段名称 + mastTableBasicColumn.add(mastSqlTable.column(childTableModel.getTableField())); + + // 主表主键 + String mainField = childTableModel.getRelationField(); + Object mainValue = new CaseInsensitiveMap(mainAllMap).get(mainField); + // 子表外键 + String childFoIdFiled = childTableModel.getTableField(); + // 外键字段是否varchar转换 + TableFields fogIdField = childTableModel.getFields().stream() + .filter(t -> t.getField().equals(childFoIdFiled)).findFirst().orElse(null); + boolean fogIdTypeString = Objects.nonNull(fogIdField) + ? fogIdField.getDataType().toLowerCase().contains("varchar") + : false; + if (fogIdTypeString) { + mainValue = mainValue.toString(); + } + + SelectStatementProvider mastRender = SqlBuilder.select(mastTableBasicColumn).from(mastSqlTable) + .where(mastSqlTable.column(childFoIdFiled), + SqlBuilder.isEqualTo(mainValue)) + .build().render(RenderingStrategies.MYBATIS3); + List> childMapList = flowFormDataMapper.selectManyMappedRows(mastRender); + if (CollectionUtils.isNotEmpty(childMapList)) { + Map soloDataMap = childMapList.get(0); + Map renameKeyMap = new HashMap<>(); + for (Map.Entry entry : soloDataMap.entrySet()) { + FormMastTableModel model = childMastTableList.stream() + .filter(child -> child.getField().equalsIgnoreCase(String.valueOf(entry.getKey()))) + .findFirst().orElse(null); + if (model != null) { + renameKeyMap.put(model.getVModel(), entry.getValue()); + } + } + List> mapList1 = new ArrayList<>(); + mapList1.add(renameKeyMap); + allDataMap.putAll(mapList1.get(0)); + } + } + + // 设计子表 + Boolean finalNeedP = needP; + List finalFormPerList = formPerList; + table.stream().map(t -> t.getChildList()).forEach( + t1 -> { + String childTableName = t1.getTableName(); + TableModel tableModel = tableModelList.stream() + .filter(tm -> tm.getTable().equals(childTableName)).findFirst().orElse(null); + SqlTable childSqlTable = SqlTable.of(childTableName); + List chilFieldList = t1.getChildList().stream() + .filter(t2 -> StringUtil.isNotEmpty(t2.getFieLdsModel().getVModel())) + .collect(Collectors.toList()); + String tableModelName = t1.getTableModel(); + // 开启权限移除字段 + if (finalNeedP) { + if (CollectionUtils.isEmpty(finalFormPerList)) { + chilFieldList = Collections.EMPTY_LIST; + } else { + List newList = new ArrayList<>(); + for (FormColumnModel item : chilFieldList) { + if (finalFormPerList + .contains(tableModelName + "-" + item.getFieLdsModel().getVModel())) { + newList.add(item); + } + } + chilFieldList = newList; + } + } + List childFields = chilFieldList.stream() + .map(t2 -> childSqlTable.column(t2.getFieLdsModel().getVModel())) + .collect(Collectors.toList()); + + childFields.add(childSqlTable.column(tableModel.getTableField())); + String childKeyName = flowDataUtil.getKey(tableModel, dbType); + childFields.add(childSqlTable.column(childKeyName)); + // 主表主键 + String mainField = tableModel.getRelationField(); + Object mainValue = new CaseInsensitiveMap(mainAllMap).get(mainField); + // 子表外键 + String childFoIdFiled = tableModel.getTableField(); + // 外键字段是否varchar转换 + TableFields fogIdField = tableModel.getFields().stream() + .filter(t -> t.getField().equals(childFoIdFiled)).findFirst().orElse(null); + boolean fogIdTypeString = Objects.nonNull(fogIdField) + ? fogIdField.getDataType().toLowerCase().contains("varchar") + : false; + if (fogIdTypeString) { + mainValue = mainValue.toString(); + } + + // todo + QueryExpressionDSL.QueryExpressionWhereBuilder childWhere = SqlBuilder + .select(childFields).from(childSqlTable).where(); + childWhere.and(childSqlTable.column(tableModel.getTableField()), + SqlBuilder.isEqualTo(mainValue)); + // 逻辑删除不展示 + if (logicalDelete) { + childWhere.and(childSqlTable.column(TableFeildsEnum.DELETEMARK.getField()), + SqlBuilder.isNull()); + } + SelectStatementProvider childRender = childWhere.build().render(RenderingStrategies.MYBATIS3); + List> childMapList = flowFormDataMapper.selectManyMappedRows(childRender); + if (ObjectUtil.isNotEmpty(childMapList)) { + Map childMap = new HashMap<>(1); + childMap.put(t1.getTableModel(), childMapList); + allDataMap.putAll(childMap); + } + }); + // 数据转换 + List fields = new ArrayList<>(); + OnlinePublicUtils.recursionFields(fields, list); + + // 添加id属性 + List> dataList = FormPublicUtils.addIdToList(new ArrayList() { + { + add(allDataMap); + } + }, pKeyName); + // 详情没有区分行内编辑 + if (infoModel.isNeedSwap()) { + allDataResMap = (Map) onlineSwapDataUtils + .getSwapInfo(dataList, fields, visualdevEntity.getId(), false, null).get(0); + } else { + allDataResMap = allDataMap; + } + } catch (Exception e) { + throw new RuntimeException(e); + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + vo.setId(allDataResMap.get(FlowFormConstant.ID)); + vo.setData(JsonUtilEx.getObjectToString(allDataResMap)); + return vo; + } + + /** + * 根据指定字段查询主表数据 + * + * @param id + * @param model + * @param mainTable + * @param tableModelList + * @return + */ + private Map searchMainData(String id, OnlineInfoModel model, TableModel mainTable, + List tableModelList) { + SqlTable mainSqlTable = SqlTable.of(mainTable.getTable()); + TableFields mainKeyModel = mainTable.getFields().stream().filter(t -> Objects.equals(t.getPrimaryKey(), 1) + && !t.getField().toLowerCase().contains(TableFeildsEnum.TENANTID.getField())).findFirst().orElse(null); + String propsValue = model.getPropsValue(); + SqlColumn column = null; + TableFields storedFieldModel = null; + if (StringUtil.isNotEmpty(propsValue)) { + if (propsValue.contains("_yunzhupaas_")) { + String[] split = propsValue.split("_yunzhupaas_"); + String thisTable = split[0].substring(5); + String thisField = split[1]; + TableModel thisTableModel = tableModelList.stream() + .filter(t -> t.getTable().equalsIgnoreCase(thisTable)).findFirst().orElse(null); + storedFieldModel = thisTableModel.getFields().stream() + .filter(t -> t.getField().equalsIgnoreCase(thisField)).findFirst().orElse(null); + SqlTable sqlTable = SqlTable.of(split[0].substring(5)); + column = sqlTable.column(storedFieldModel.getField()); + } else { + + storedFieldModel = mainTable.getFields().stream().filter(t -> t.getField().equalsIgnoreCase(propsValue)) + .findFirst().orElse(null); + column = mainSqlTable.column(storedFieldModel.getField()); + } + } else { + storedFieldModel = mainKeyModel; + column = mainSqlTable.column(storedFieldModel.getField()); + } + // 查询的字段-字段类型转换 + Object idObj = id; + if (VisualConst.DB_INT_ALL.contains(storedFieldModel.getDataType().toLowerCase())) { + idObj = Long.parseLong(id); + } + + QueryExpressionDSL from = SqlBuilder.select(mainSqlTable.allColumns()).from(mainSqlTable); + for (TableModel item : tableModelList) { + if (!Objects.equals("1", item.getTypeId())) { + SqlTable sqlTable = SqlTable.of(item.getTable()); + String tableField = item.getTableField(); + String relationField = item.getRelationField(); + from.leftJoin(sqlTable).on(sqlTable.column(tableField), + new EqualTo(mainSqlTable.column(relationField))); + } + } + QueryExpressionDSL.QueryExpressionWhereBuilder where = from.where(column, + SqlBuilder.isEqualTo(idObj)); + SelectStatementProvider render = where.build().render(RenderingStrategies.MYBATIS3); + List> maps = flowFormDataMapper.selectManyMappedRows(render); + if (CollectionUtils.isNotEmpty(maps)) { + return maps.get(0); + } + return new HashMap<>(); + } +} diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/service/impl/VisualDevListServiceImpl.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/service/impl/VisualDevListServiceImpl.java new file mode 100644 index 0000000..b72c29a --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/service/impl/VisualDevListServiceImpl.java @@ -0,0 +1,1147 @@ +package com.yunzhupaas.onlinedev.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.github.pagehelper.PageHelper; +import com.google.common.collect.Lists; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.ModuleEntity; +import com.yunzhupaas.base.entity.VisualdevShortLinkEntity; +import com.yunzhupaas.base.mapper.FlowFormDataMapper; +import com.yunzhupaas.base.model.ColumnDataModel; +import com.yunzhupaas.base.model.Template6.ColumnListField; +import com.yunzhupaas.base.model.VisualDevJsonModel; +import com.yunzhupaas.base.model.column.ColumnModel; +import com.yunzhupaas.base.model.module.PropertyJsonModel; +import com.yunzhupaas.base.service.DbLinkService; +import com.yunzhupaas.base.service.ModuleService; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.base.service.VisualdevShortLinkService; +import com.yunzhupaas.base.util.FlowFormDataUtil; +import com.yunzhupaas.base.util.FormPublicUtils; +import com.yunzhupaas.database.model.entity.DbLinkEntity; +import com.yunzhupaas.database.model.superQuery.ConditionJsonModel; +import com.yunzhupaas.database.model.superQuery.SuperJsonModel; +import com.yunzhupaas.database.model.superQuery.SuperQueryJsonModel; +import com.yunzhupaas.database.util.ConnUtil; +import com.yunzhupaas.database.util.DynamicDataSourceUtil; +import com.yunzhupaas.emnus.SearchMethodEnum; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.model.OnlineDevData; +import com.yunzhupaas.model.visualJson.*; +import com.yunzhupaas.model.visualJson.analysis.*; +import com.yunzhupaas.onlinedev.entity.VisualdevModelDataEntity; +import com.yunzhupaas.onlinedev.mapper.VisualdevModelDataMapper; +import com.yunzhupaas.onlinedev.model.OnlineDevListModel.VisualColumnSearchVO; +import com.yunzhupaas.onlinedev.model.PaginationModel; +import com.yunzhupaas.onlinedev.service.VisualDevListService; +import com.yunzhupaas.onlinedev.util.onlineDevUtil.*; +import com.yunzhupaas.permission.model.authorize.OnlineDynamicSqlModel; +import com.yunzhupaas.permission.service.AuthorizeService; +import com.yunzhupaas.permissions.PermissionInterfaceImpl; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import com.yunzhupaas.workflow.service.TemplateApi; +import lombok.Cleanup; +import org.apache.commons.collections4.CollectionUtils; +import org.mybatis.dynamic.sql.*; +import org.mybatis.dynamic.sql.render.RenderingStrategies; +import org.mybatis.dynamic.sql.select.QueryExpressionDSL; +import org.mybatis.dynamic.sql.select.SelectModel; +import org.mybatis.dynamic.sql.select.join.EqualTo; +import org.mybatis.dynamic.sql.select.render.SelectStatementProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.sql.Connection; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 在线开发列表 + * + * @author 云筑产品开发平台组 + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/7/28 + */ +@Service +public class VisualDevListServiceImpl extends SuperServiceImpl + implements VisualDevListService { + + @Autowired + private DbLinkService dblinkService; + + @Autowired + private OnlineSwapDataUtils onlineSwapDataUtils; + @Autowired + private FlowFormDataUtil flowFormDataUtil; + @Autowired + private FlowFormDataMapper flowFormDataMapper; + @Autowired + private VisualdevShortLinkService visualdevShortLinkService; + @Autowired + private TemplateApi templateApi; + @Autowired + private ModuleService moduleService; + @Autowired + private AuthorizeService authorizeService; + + @Override + public List> getDataList(VisualDevJsonModel visualDevJsonModel, PaginationModel paginationModel) + throws WorkFlowException { + List> realList = new ArrayList<>(); + ColumnDataModel columnDataModel = visualDevJsonModel.getColumnData(); + FormDataModel formDataModel = visualDevJsonModel.getFormData(); + List fieLdsModels = JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class); + List visualTables = visualDevJsonModel.getVisualTables(); + // 解析所有控件 + RecursionForm recursionForm = new RecursionForm(fieLdsModels, visualTables); + List formAllModel = new ArrayList<>(); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + // 当前用户信息 + UserInfo userInfo = UserProvider.getUser(); + + // 是否流程 + boolean enableFlow = false; + // 是否数据管理(有菜单则不是数据管理) + if (ObjectUtil.isNotEmpty(paginationModel.getMenuId())) { + // 菜单id + String menuId = paginationModel.getMenuId(); + if (columnDataModel.getUseColumnPermission()) { + visualDevJsonModel.setNeedPermission(true); + List pList = new ArrayList<>(); + Map pMap = PermissionInterfaceImpl.getColumnMap(); + if (pMap.get(menuId) != null) { + pList = JsonUtil.getJsonToList(pMap.get(menuId), ColumnModel.class).stream() + .map(ColumnModel::getEnCode).collect(Collectors.toList()); + } + visualDevJsonModel.setPermissionList(pList); + } + // 菜单判断是否启用流程-添加流程状态 + ModuleEntity info = moduleService.getInfo(menuId); + // 流程菜单 + enableFlow = Objects.equals(info.getType(), 9); + visualDevJsonModel.setEnableFlow(enableFlow); + if (enableFlow) { + PropertyJsonModel model = JsonUtil.getJsonToBean(info.getPropertyJson(), PropertyJsonModel.class); + List flowVersionIds = templateApi.getFlowIdsByTemplateId(model.getModuleId()); + visualDevJsonModel.setFlowId(model.getModuleId()); + visualDevJsonModel.setFlowVersionIds(flowVersionIds); + } + } + + // 判断有无表 + if (visualTables.size() > 0) { + // 封装搜索数据 + OnlineProductSqlUtils.queryList(formAllModel, visualDevJsonModel, paginationModel); + realList = this.getListWithTable(visualDevJsonModel, paginationModel, userInfo, null); + } + + if (realList.size() < 1) { + return realList; + } + // 编辑表格(行内编辑)--页签(有getExtraQueryJson)不走行内编辑 + boolean inlineEdit = StringUtil.isNotEmpty(paginationModel.getExtraQueryJson()) ? false + : columnDataModel.getType() != null && columnDataModel.getType() == 4; + + // 复制父级字段+_id + realList.forEach(item -> { + item.put(columnDataModel.getParentField() + "_id", item.get(columnDataModel.getParentField())); + }); + // 数据转换 + // 递归处理控件 + List fields = new ArrayList<>(); + OnlinePublicUtils.recursionFields(fields, fieLdsModels); + visualDevJsonModel.setFormListModels(fields); + realList = onlineSwapDataUtils.getSwapList(realList, fields, visualDevJsonModel.getId(), inlineEdit); + + // 取回传主键 + String pkeyId = visualDevJsonModel.getPkeyId(); + // 树形子字段key + columnDataModel.setSubField(pkeyId); + + if (enableFlow) { + onlineSwapDataUtils.getFlowStatus(realList); + } + return realList; + } + + @Override + public List> getDataListLink(VisualDevJsonModel visualDevJsonModel, + PaginationModel paginationModel) throws WorkFlowException { + List> realList; + VisualdevShortLinkEntity shortLinkEnt = visualdevShortLinkService.getById(visualDevJsonModel.getId()); + List listCondition = StringUtil.isNotEmpty(shortLinkEnt.getColumnCondition()) + ? JsonUtil.getJsonToList(shortLinkEnt.getColumnCondition(), VisualColumnSearchVO.class) + : new ArrayList<>(); + List listFields = StringUtil.isNotEmpty(shortLinkEnt.getColumnCondition()) + ? JsonUtil.getJsonToList(shortLinkEnt.getColumnText(), FieLdsModel.class) + : new ArrayList<>(); + visualDevJsonModel.setFormListModels(listFields); + visualDevJsonModel.setIsLinkList(true); + FormDataModel formDataModel = visualDevJsonModel.getFormData(); + List visualTables = visualDevJsonModel.getVisualTables(); + // 当前用户信息 + UserInfo userInfo = UserProvider.getUser(); + List isBetween = new ArrayList() { + { + add(YunzhupaasKeyConsts.DATE); + add(YunzhupaasKeyConsts.TIME); + add(YunzhupaasKeyConsts.NUM_INPUT); + add(YunzhupaasKeyConsts.RATE); + add(YunzhupaasKeyConsts.SLIDER); + } + }; + for (VisualColumnSearchVO searchVO : listCondition) { + String yunzhupaasKey = searchVO.getConfig().getYunzhupaasKey(); + searchVO.setSearchType(isBetween.contains(yunzhupaasKey) ? "3" : "2"); + } + // 菜单id + String menuId = paginationModel.getMenuId(); + ColumnDataModel columnDataModel = new ColumnDataModel(); + List list = JsonUtil.getJsonToList(shortLinkEnt.getColumnText(), ColumnListField.class); + columnDataModel.setColumnList(JsonUtil.getListToJsonArray(list).toJSONString());// 查询字段构造 + columnDataModel.setSearchList(JsonUtil.getListToJsonArray(listCondition).toJSONString()); + columnDataModel.setType(1);// 普通列表 + visualDevJsonModel.setColumnData(columnDataModel); + // 查询 + List fieLdsModels = JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class); + RecursionForm recursionForm = new RecursionForm(fieLdsModels, visualTables); + List formAllModel = new ArrayList<>(); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + // 封装搜索数据 + OnlineProductSqlUtils.queryList(formAllModel, visualDevJsonModel, paginationModel); + realList = this.getListWithTable(visualDevJsonModel, paginationModel, userInfo, null); + if (realList.size() < 1) { + return realList; + } + // 数据转换 + List fields = new ArrayList<>(); + OnlinePublicUtils.recursionFields(fields, fieLdsModels); + visualDevJsonModel.setFormListModels(fields); + realList = onlineSwapDataUtils.getSwapList(realList, fields, visualDevJsonModel.getId(), false); + return realList; + } + + @Override + public List> getList(List> noSwapDataList, + List searchVOList, PaginationModel paginationModel) { + if (searchVOList.size() > 0) { + // 条件查询 + noSwapDataList = OnlineDevListUtils.getNoSwapList(noSwapDataList, searchVOList); + } + // 排序 + if (noSwapDataList.size() > 0) { + if (StringUtil.isNotEmpty(paginationModel.getSidx())) { + // 排序处理 + noSwapDataList.sort((o1, o2) -> { + Map i1 = o1; + Map i2 = o2; + String s1 = String.valueOf(i1.get(paginationModel.getSidx())); + String s2 = String.valueOf(i2.get(paginationModel.getSidx())); + if ("desc".equalsIgnoreCase(paginationModel.getSort())) { + return s2.compareTo(s1); + } else { + return s1.compareTo(s2); + } + }); + } + + long total = noSwapDataList.size(); + + // 数据分页 + noSwapDataList = PageUtil.getListPage((int) paginationModel.getCurrentPage(), + (int) paginationModel.getPageSize(), noSwapDataList); + noSwapDataList = paginationModel.setData(noSwapDataList, total); + } + return noSwapDataList; + } + + @Override + public List> getWithoutTableData(String modelId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualdevModelDataEntity::getVisualDevId, modelId); + List list = this.list(queryWrapper); + List> dataVoList = list.parallelStream().map(t -> { + Map dataMap = JsonUtil.stringToMap(t.getData()); + dataMap.put("id", t.getId()); + return dataMap; + }).collect(Collectors.toList()); + return dataVoList; + } + + @Override + public List> getListWithTable(VisualDevJsonModel visualDevJsonModel, + PaginationModel paginationModel, UserInfo userInfo, List columnPropList) { + ColumnDataModel columnDataModel = visualDevJsonModel.getColumnData(); + List> dataList = new ArrayList<>(); + // 数据过滤 + SuperJsonModel ruleQuery = visualDevJsonModel.getRuleQuery(); + // 高级搜索 + SuperJsonModel superQuery = visualDevJsonModel.getSuperQuery(); + // 列表搜索 + SuperJsonModel query = visualDevJsonModel.getQuery(); + // 数据过滤 + List authorizeListAll = visualDevJsonModel.getAuthorize(); + // 关键词 + SuperJsonModel keyQuery = visualDevJsonModel.getKeyQuery(); + // 列表搜索 + SuperJsonModel extraQuery = visualDevJsonModel.getExtraQuery(); + Boolean logicalDelete = visualDevJsonModel.getFormData().getLogicalDelete(); + + // 数据源 + DbLinkEntity linkEntity = dblinkService.getInfo(visualDevJsonModel.getDbLinkId()); + boolean userStanding = authorizeService.getUserCurrentStanding(userInfo.getUserId(), 2); + try { + DynamicDataSourceUtil.switchToDataSource(linkEntity); + @Cleanup + Connection connection = ConnUtil.getConnOrDefault(linkEntity); + String databaseProductName = connection.getMetaData().getDatabaseProductName().trim(); + List tableModelList = visualDevJsonModel.getVisualTables(); + // 主表 + TableModel mainTable = tableModelList.stream().filter(t -> t.getTypeId().equals("1")).findFirst() + .orElse(null); + + List modelList = JsonUtil.getJsonToList(columnDataModel.getColumnList(), + ColumnListField.class); + + FormDataModel formData = visualDevJsonModel.getFormData(); + List jsonToList = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + // 递归处理控件 + List allFieLds = new ArrayList<>(); + OnlinePublicUtils.recursionFields(allFieLds, jsonToList); + Map tableFieldAndTableName = new HashMap<>(8); + Map tableNameAndTableField = new HashMap<>(8); + allFieLds.stream().filter(f -> f.getConfig().getYunzhupaasKey().equals(YunzhupaasKeyConsts.CHILD_TABLE)) + .forEach(f -> { + tableFieldAndTableName.put(f.getVModel(), f.getConfig().getTableName()); + tableNameAndTableField.put(f.getConfig().getTableName(), f.getVModel()); + }); + + // 取出所有有用到的表-进行关联过滤 + List allTableName = OnlinePublicUtils.getAllTableName(modelList, new ArrayList() { + { + add(ruleQuery); + add(superQuery); + add(query); + addAll(authorizeListAll); + } + }, tableFieldAndTableName); + + // 列表中区别子表正则 + String reg = "^[yunzhupaas_]\\S*_yunzhupaas\\S*"; + String pkeyId = flowFormDataUtil.getKey(mainTable, databaseProductName); + visualDevJsonModel.setPkeyId(pkeyId); + + // 所有字段 + List collect = new ArrayList<>(); + if (columnPropList != null) { + collect.addAll(columnPropList); + } else { + collect.addAll(modelList.stream().map(mode -> mode.getProp()).collect(Collectors.toList())); + } + if (OnlineDevData.COLUMNTYPE_FIVE.equals(columnDataModel.getType()) + && !collect.contains(columnDataModel.getParentField())) { + collect.add(columnDataModel.getParentField()); + } + // 列表权限字段移出 + if (visualDevJsonModel.getNeedPermission()) { + List permissionList = visualDevJsonModel.getPermissionList() == null ? Collections.EMPTY_LIST + : visualDevJsonModel.getPermissionList(); + List newCollect = new ArrayList<>(); + for (String key : collect) { + if (!permissionList.contains(key)) { + newCollect.add(key); + } + } + collect.removeAll(newCollect); + } + // 添加排序字段 + if (StringUtil.isNotEmpty(paginationModel.getSidx())) { + String[] split = paginationModel.getSidx().split(","); + for (String s : split) { + String filedName = ""; + if (s.startsWith("-")) { + filedName = s.substring(1); + } else { + filedName = s; + } + if (!collect.contains(filedName)) { + collect.add(filedName); + } + } + } + + List sqlModelList = new ArrayList<>(); + // 根据表字段创建sqltable + for (TableModel model : tableModelList) { + OnlineDynamicSqlModel sqlModel = new OnlineDynamicSqlModel(); + sqlModel.setSqlTable(SqlTable.of(model.getTable())); + sqlModel.setTableName(model.getTable()); + if (model.getTypeId().equals("1")) { + sqlModel.setMain(true); + } else { + sqlModel.setForeign(model.getTableField()); + sqlModel.setRelationKey(model.getRelationField()); + sqlModel.setMain(false); + } + sqlModelList.add(sqlModel); + } + + OnlineProductSqlUtils.getColumnListSql(sqlModelList, visualDevJsonModel, collect, linkEntity); + // 主表 + OnlineDynamicSqlModel mainSqlModel = sqlModelList.stream().filter(OnlineDynamicSqlModel::isMain).findFirst() + .orElse(null); + // 非主表 + List dycList = sqlModelList.stream().filter(dyc -> !dyc.isMain()) + .collect(Collectors.toList()); + List sqlColumns = new ArrayList<>(); + Map aliasMap = new HashMap<>(); + boolean isOracle = databaseProductName.equalsIgnoreCase("oracle"); + boolean isDm = databaseProductName.equalsIgnoreCase("DM DBMS"); + + for (OnlineDynamicSqlModel dynamicSqlModel : sqlModelList) { + List basicColumns = Optional.ofNullable(dynamicSqlModel.getColumns()) + .orElse(new ArrayList<>()); + // 达梦或者oracle 别名太长转换-底下有方法进行还原 + if (isOracle || isDm) { + for (int i = 0; i < basicColumns.size(); i++) { + BasicColumn item = basicColumns.get(i); + String alias = item.alias().orElse(null); + if (StringUtil.isNotEmpty(alias)) { + String aliasNewName = "A" + RandomUtil.uuId(); + aliasMap.put(aliasNewName, alias); + basicColumns.set(i, item.as(aliasNewName)); + } + } + } + sqlColumns.addAll(basicColumns); + } + QueryExpressionDSL from = SqlBuilder.select(sqlColumns).from(mainSqlModel.getSqlTable()); + QueryExpressionDSL subFrom = SqlBuilder.select(mainSqlModel.getSqlTable().column(pkeyId)) + .from(mainSqlModel.getSqlTable()); + + // 构造table和table下字段的分组 + Map> tableFieldGroup = new HashMap<>(8); + allFieLds.forEach(f -> { + tableFieldGroup.computeIfAbsent(f.getConfig().getTableName(), k -> new ArrayList<>()).add( + "table".equals(f.getConfig().getType()) ? f.getConfig().getTableName() : f.getVModel()); + }); + Map subSqlTableMap = new HashMap<>(); + if (dycList.size() > 0) { + for (OnlineDynamicSqlModel sqlModel : dycList) { + if (!allTableName.contains(sqlModel.getTableName())) + continue; + String relationKey = sqlModel.getRelationKey(); + + boolean relationKeyTypeString = false; + for (TableModel item : tableModelList) { + if (item.getTable().equals(sqlModel.getTableName())) { + String foreign = sqlModel.getForeign(); + TableFields thisfield = item.getFields().stream().filter(t -> t.getField().equals(foreign)) + .findFirst().orElse(null); + if (thisfield != null) { + relationKeyTypeString = thisfield.getDataType().toLowerCase().contains("varchar"); + } + } + } + // postgresql自增 int和varchar无法对比-添加以下判断 + if (Objects.equals(formData.getPrimaryKeyPolicy(), 2) + && "PostgreSQL".equalsIgnoreCase(databaseProductName) && relationKeyTypeString) { + relationKey += "::varchar"; + } + // 移除子表的外联--用于查询主副表字段数据 + if (!tableNameAndTableField.containsKey(sqlModel.getTableName())) { + from.leftJoin(sqlModel.getSqlTable()) + .on(sqlModel.getSqlTable().column(sqlModel.getForeign()), + new EqualTo(mainSqlModel.getSqlTable().column(relationKey))); + } + + // 用于查询拼接各条件之后的主表id列表(和统计数量) + subFrom.leftJoin(sqlModel.getSqlTable()) + .on(sqlModel.getSqlTable().column(sqlModel.getForeign()), + new EqualTo(mainSqlModel.getSqlTable().column(relationKey))); + String tableName = sqlModel.getTableName(); + List fieldList = tableFieldGroup.get(tableName); + if (fieldList != null) { + fieldList.forEach(fieldKey -> { + subSqlTableMap.put(fieldKey, sqlModel.getSqlTable()); + }); + } + } + } + + QueryExpressionDSL.QueryExpressionWhereBuilder where = from.where(); + QueryExpressionDSL.QueryExpressionWhereBuilder subWhere = subFrom.where(); + + // 逻辑删除不展示 + if (logicalDelete) { + subWhere.and(mainSqlModel.getSqlTable().column(TableFeildsEnum.DELETEMARK.getField()), + SqlBuilder.isNull()); + } + // 是否流程菜单 + List flowVersionIds = visualDevJsonModel.getFlowVersionIds(); + if (visualDevJsonModel.isEnableFlow() && flowVersionIds.size() > 0) { + subWhere.and(mainSqlModel.getSqlTable().column(TableFeildsEnum.FLOWID.getField()), + SqlBuilder.isIn(flowVersionIds)); + } else { + subWhere.and(mainSqlModel.getSqlTable().column(TableFeildsEnum.FLOWID.getField()), SqlBuilder.isNull()); + } + // 页签查询 + OnlineProductSqlUtils.getSuperSql(subWhere, extraQuery, sqlModelList, databaseProductName, null, false); + + // 查询条件sql + OnlineProductSqlUtils.getSuperSql(subWhere, query, sqlModelList, databaseProductName, null, false); + + // 高级查询 + OnlineProductSqlUtils.getSuperSql(subWhere, superQuery, sqlModelList, databaseProductName, null, false); + + // 数据过滤 + OnlineProductSqlUtils.getSuperSql(subWhere, ruleQuery, sqlModelList, databaseProductName, null, false); + + // 关键词搜索 + OnlineProductSqlUtils.getSuperSql(subWhere, keyQuery, sqlModelList, databaseProductName, null, false); + + // 数据权限 + if (columnDataModel.getUseDataPermission() != null && columnDataModel.getUseDataPermission()) { + if (!userInfo.getIsAdministrator() && !userStanding) { + if (authorizeListAll.size() == 0) { + return new ArrayList<>(); + } + OnlineProductSqlUtils.getSuperSql(subWhere, authorizeListAll, sqlModelList, databaseProductName, + null); + } + } + + // 统计语句 + BasicColumn countColumn; + if (dycList.size() > 0) { + countColumn = SqlBuilder.countDistinct(mainSqlModel.getSqlTable().column(pkeyId)); + } else { + countColumn = SqlBuilder.count(mainSqlModel.getSqlTable().column(pkeyId)); + } + QueryExpressionDSL.QueryExpressionWhereBuilder countSelect = SqlBuilder + .select(countColumn) + .from(subWhere, "tmp") + .where(); + SelectStatementProvider renderCount = countSelect.build().render(RenderingStrategies.MYBATIS3); + long count = flowFormDataMapper.count(renderCount); + if (count == 0) { + paginationModel.setTotal(0); + return new ArrayList<>(); + } + + // 排序 + if (StringUtil.isNotEmpty(paginationModel.getSidx())) { + String[] split = paginationModel.getSidx().split(","); + List sidxList = new ArrayList<>(); + for (String sidx : split) { + // 目前只支持主表排序 + if (sidx.toLowerCase().contains("_yunzhupaas_") + || sidx.toLowerCase().contains(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX)) { + continue; + } + SortSpecification sortSpecification; + if (sidx.startsWith("-")) { + sortSpecification = SqlBuilder.sortColumn(mainTable.getTable(), + SqlTable.of(mainTable.getTable()).column(sidx.substring(1))).descending(); + } else { + sortSpecification = SqlBuilder.sortColumn(mainTable.getTable(), + SqlTable.of(mainTable.getTable()).column(sidx)); + } + sidxList.add(sortSpecification); + } + where.orderBy(sidxList); + } else { + where.orderBy( + SqlBuilder.sortColumn(mainTable.getTable(), SqlTable.of(mainTable.getTable()).column(pkeyId)) + .descending()); + } + // 假分页----1导出全部 0导出当前页 null---列表分页 树形和分组不需要分页 + boolean hasPage = (paginationModel.getDataType() == null || "0".equals(paginationModel.getDataType())) + && !Objects.equals(columnDataModel.getType(), 5) && !Objects.equals(columnDataModel.getType(), 3); + if (hasPage) { + PageHelper.startPage((int) paginationModel.getCurrentPage(), (int) paginationModel.getPageSize(), + false); + } + + // 查询主副表数据 + where.and(SqlTable.of(mainTable.getTable()).column(pkeyId), SqlBuilder.isIn(subWhere)); + SelectStatementProvider render = where.build().render(RenderingStrategies.MYBATIS3); + dataList = flowFormDataMapper.selectManyMappedRows(render); + + String finalPkeyId = pkeyId; + List idStringList = dataList.stream().map(m -> m.get(finalPkeyId)).distinct() + .collect(Collectors.toList()); + if (idStringList.size() > 0) { + // 处理子表 + List tableFields = collect.stream() + .filter(c -> c.toLowerCase().contains(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX)) + .collect(Collectors.toList()); + List childTableModels = tableModelList.stream().filter(t -> t.getTypeId().equals("0")) + .collect(Collectors.toList()); + Map> tableMap = tableFields.stream() + .collect(Collectors.groupingBy(t -> t.substring(0, t.lastIndexOf("-")))); + for (TableModel tableModel : childTableModels) { + String table = tableModel.getTable(); + if (!allTableName.contains(table)) + continue; + String tableField = tableNameAndTableField.get(table); + + String childPrimKey = flowFormDataUtil.getKey(tableModel, databaseProductName); + String fogID = tableModel.getTableField(); + String mainPrimKey = tableModel.getRelationField(); + // 外键值集合(通过主表关联键查询) + List fogValueList = dataList.stream().map(m -> m.get(mainPrimKey)).distinct() + .collect(Collectors.toList()); + // 外键是字符串 - 转换主表数据string + TableFields fogIdField = tableModel.getFields().stream().filter(t -> t.getField().equals(fogID)) + .findFirst().orElse(null); + boolean fogIdTypeString = Objects.nonNull(fogIdField) + ? fogIdField.getDataType().toLowerCase().contains("varchar") + : false; + if (fogIdTypeString) { + idStringList = idStringList.stream().map(t -> t.toString()).collect(Collectors.toList()); + } + + List childFields = tableMap.get(tableField); + if (childFields != null) { + OnlineDynamicSqlModel onlineDynamicSqlModel = sqlModelList.stream() + .filter(s -> s.getTableName().equalsIgnoreCase(table)).findFirst().orElse(null); + SqlTable childSqlTable = onlineDynamicSqlModel.getSqlTable(); + List childSqlColumns = new ArrayList<>(); + for (String c : childFields) { + String childF = c.substring(c.lastIndexOf("-") + 1); + SqlColumn column = childSqlTable.column(childF); + childSqlColumns.add(column); + } + childSqlColumns.add(childSqlTable.column(childPrimKey)); + childSqlColumns.add(childSqlTable.column(fogID)); + // 查子表数据字段,不去重 + QueryExpressionDSL childFrom = SqlBuilder.select(childSqlColumns) + .from(mainSqlModel.getSqlTable()); + if (dycList.size() > 0) { + for (OnlineDynamicSqlModel sqlModel : dycList) { + String relationKey = sqlModel.getRelationKey(); + boolean relationKeyTypeString = false; + for (TableModel item : tableModelList) { + if (item.getTable().equals(sqlModel.getTableName())) { + String foreign = sqlModel.getForeign(); + TableFields thisfield = item.getFields().stream() + .filter(t -> t.getField().equals(foreign)).findFirst().orElse(null); + if (thisfield != null) { + relationKeyTypeString = thisfield.getDataType().toLowerCase() + .contains("varchar"); + } + } + } + // postgresql自增 int和varchar无法对比-添加以下判断 + if (Objects.equals(formData.getPrimaryKeyPolicy(), 2) + && "PostgreSQL".equalsIgnoreCase(databaseProductName) + && relationKeyTypeString) { + relationKey += "::varchar"; + } + // 用于查询拼接各条件之后的主表id列表(和统计数量) + childFrom.leftJoin(sqlModel.getSqlTable()) + .on(sqlModel.getSqlTable().column(sqlModel.getForeign()), + new EqualTo(mainSqlModel.getSqlTable().column(relationKey))); + } + } + QueryExpressionDSL.QueryExpressionWhereBuilder childWhere = childFrom.where(); + + if (fogValueList.size() > 1000) { + List> lists = Lists.partition(fogValueList, 1000); + List groupListAll = new ArrayList<>(); + for (List item : lists) { + groupListAll.add(SqlBuilder.or(childSqlTable.column(fogID), SqlBuilder.isIn(item))); + } + groupListAll.remove(0); + childWhere.and(childSqlTable.column(fogID), SqlBuilder.isIn(lists.get(0)), groupListAll); + } else { + childWhere.and(childSqlTable.column(fogID), SqlBuilder.isIn(fogValueList)); + } + + // 逻辑删除不展示 + if (logicalDelete) { + childWhere.and(childSqlTable.column(TableFeildsEnum.DELETEMARK.getField()), + SqlBuilder.isNull()); + } + // 查询条件sql + OnlineProductSqlUtils.getSuperSql(childWhere, query, sqlModelList, databaseProductName, null, + false); + // 高级查询 + OnlineProductSqlUtils.getSuperSql(childWhere, superQuery, sqlModelList, databaseProductName, + null, false); + // 数据过滤 + OnlineProductSqlUtils.getSuperSql(childWhere, ruleQuery, sqlModelList, databaseProductName, + null, false); + // 关键词搜索 + OnlineProductSqlUtils.getSuperSql(childWhere, keyQuery, sqlModelList, databaseProductName, null, + false); + // 数据权限 + if (columnDataModel.getUseDataPermission() != null && columnDataModel.getUseDataPermission()) { + if (!userInfo.getIsAdministrator() && !userStanding) { + OnlineProductSqlUtils.getSuperSql(childWhere, authorizeListAll, sqlModelList, + databaseProductName, null); + } + } + SelectStatementProvider childRender = childWhere.build().render(RenderingStrategies.MYBATIS3); + List> mapList = flowFormDataMapper.selectManyMappedRows(childRender); + // 连表去重,distinct去不掉 + List dictinctKey = new ArrayList<>(); + List> newList = new ArrayList<>(); + for (Map item : mapList) { + Object o = item.get(childPrimKey); + if (!dictinctKey.contains(o)) { + newList.add(item); + dictinctKey.add(o); + } + item.put(FlowFormConstant.ID, o); + } + Map>> idMap = newList.stream() + .collect(Collectors.groupingBy(m -> m.get(fogID).toString())); + + for (Map m : dataList) { + if (ObjectUtil.isNotEmpty(m.get(mainPrimKey))) { + String s = m.get(mainPrimKey).toString(); + Map valueMap = new HashMap<>(); + valueMap.put(tableField, idMap.get(s)); + m.putAll(valueMap); + } + } + } + } + } else { + return new ArrayList<>(); + } + + // 添加id属性 + dataList = FormPublicUtils.addIdToList(dataList, pkeyId); + + // 别名key还原 + setAliasKey(dataList, aliasMap); + + paginationModel.setTotal(count); + } catch (Exception e) { + e.printStackTrace(); + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + return dataList; + } + + private List superQueryList(List queryJsonModels, + Map tableFieldAndTableName, String mainTable) { + List superQueryList = new ArrayList<>(); + for (SuperQueryJsonModel jsonModel : queryJsonModels) { + List conditionList = JsonUtil.getJsonToList(jsonModel.getGroups(), FieLdsModel.class); + for (FieLdsModel fieLdsModel : conditionList) { + ConditionJsonModel sup = JsonUtil.getJsonToBean(fieLdsModel, ConditionJsonModel.class); + sup.setTableName(fieLdsModel.getConfig().getRelationTable()); + String field = sup.getField(); + String mastKey = fieLdsModel.getConfig().getYunzhupaasKey(); + if (field.toLowerCase().contains(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX)) { + String substring = field.substring(field.lastIndexOf("-") + 1); + String tableField = field.substring(0, field.indexOf("-")); + sup.setField(substring); + sup.setTableName(tableFieldAndTableName.get(tableField)); + } else if (StringUtil.isEmpty(sup.getTableName())) { + sup.setTableName(mainTable); + } + if (mastKey.equals(YunzhupaasKeyConsts.CHECKBOX) || mastKey.equals(YunzhupaasKeyConsts.ADDRESS) + || mastKey.equals(YunzhupaasKeyConsts.CASCADER) + || mastKey.equals(YunzhupaasKeyConsts.COMSELECT)) { + fieLdsModel.setMultiple(true); + } + if (fieLdsModel.getMultiple() && StringUtil.isEmpty(sup.getFieldValue())) { + sup.setFieldValue("[]"); + } + superQueryList.add(sup); + } + } + return superQueryList; + } + + @Override + public List> getRelationFormList(VisualDevJsonModel visualDevJsonModel, + PaginationModel paginationModel) { + FormDataModel formData = visualDevJsonModel.getFormData(); + Boolean logicalDelete = visualDevJsonModel.getFormData().getLogicalDelete(); + List collect = StringUtil.isNotEmpty(paginationModel.getColumnOptions()) + ? Arrays.asList(paginationModel.getColumnOptions().split(",")) + : new ArrayList<>(); + List fieLdsModels = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + + List mainFieldModelList = new ArrayList<>(); + + List> noSwapDataList = new ArrayList<>(); + List searchVOList = new ArrayList<>(); + // 列表中区别子表正则 + String reg = "^[yunzhupaas_]\\S*_yunzhupaas\\S*"; + // 查询的关键字 + String keyword = paginationModel.getKeyword(); + // 判断有无表 + if (visualDevJsonModel.getVisualTables().size() > 0) { + try { + List tableModelList = JsonUtil.getJsonToList(visualDevJsonModel.getVisualTables(), + TableModel.class); + + OnlinePublicUtils.recursionFields(mainFieldModelList, fieLdsModels); + + // 主表 + TableModel mainTable = tableModelList.stream().filter(t -> t.getTypeId().equals("1")).findFirst() + .orElse(null); + + DbLinkEntity linkEntity = dblinkService.getInfo(visualDevJsonModel.getDbLinkId()); + + List sqlModelList = new ArrayList<>(); + // 根据表字段创建sqltable + for (TableModel model : tableModelList) { + OnlineDynamicSqlModel sqlModel = new OnlineDynamicSqlModel(); + sqlModel.setSqlTable(SqlTable.of(model.getTable())); + sqlModel.setTableName(model.getTable()); + if (model.getTypeId().equals("1")) { + sqlModel.setMain(true); + } else { + sqlModel.setForeign(model.getTableField()); + sqlModel.setRelationKey(model.getRelationField()); + sqlModel.setMain(false); + } + sqlModelList.add(sqlModel); + } + + // 判断是否分页 + Boolean isPage = paginationModel.getPageSize() > 500 ? false : true; + // 获取表单主表副表全字段 + List allFields = new ArrayList<>(); + for (FieLdsModel item : mainFieldModelList) { + if (StringUtil.isNotEmpty(item.getVModel()) + && !item.getVModel().toLowerCase().startsWith(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX)) { + allFields.add(item.getVModel()); + } + } + OnlineProductSqlUtils.getColumnListSql(sqlModelList, visualDevJsonModel, allFields, linkEntity); + + // 数据过滤 + List visualTables = visualDevJsonModel.getVisualTables(); + RecursionForm recursionForm = new RecursionForm(fieLdsModels, visualTables); + List formAllModel = new ArrayList<>(); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + OnlineProductSqlUtils.queryList(formAllModel, visualDevJsonModel, paginationModel); + SuperJsonModel ruleQuery = visualDevJsonModel.getRuleQuery(); + ArrayList listquery = new ArrayList() { + { + add(ruleQuery); + } + }; + + DynamicDataSourceUtil.switchToDataSource(linkEntity); + @Cleanup + Connection connection = ConnUtil.getConnOrDefault(linkEntity); + String databaseProductName = connection.getMetaData().getDatabaseProductName().trim(); + // 主表 + OnlineDynamicSqlModel mainSqlModel = sqlModelList.stream().filter(OnlineDynamicSqlModel::isMain) + .findFirst().orElse(null); + + String pkeyId = flowFormDataUtil.getKey(mainTable, databaseProductName); + visualDevJsonModel.setPkeyId(pkeyId); + + Map tableFieldAndTableName = new HashMap<>(8); + Map tableNameAndTableField = new HashMap<>(8); + mainFieldModelList.stream() + .filter(f -> f.getConfig().getYunzhupaasKey().equals(YunzhupaasKeyConsts.CHILD_TABLE)) + .forEach(f -> { + tableFieldAndTableName.put(f.getVModel(), f.getConfig().getTableName()); + tableNameAndTableField.put(f.getConfig().getTableName(), f.getVModel()); + }); + + // 非主表 + List dycList = sqlModelList.stream().filter(dyc -> !dyc.isMain()) + .collect(Collectors.toList()); + List sqlColumns = new ArrayList<>(); + for (OnlineDynamicSqlModel dynamicSqlModel : sqlModelList) { + if (tableNameAndTableField.containsKey(dynamicSqlModel.getTableName())) + continue; + List basicColumns = Optional.ofNullable(dynamicSqlModel.getColumns()) + .orElse(new ArrayList<>()); + sqlColumns.addAll(basicColumns); + } + QueryExpressionDSL from = SqlBuilder.select(sqlColumns).from(mainSqlModel.getSqlTable()); + QueryExpressionDSL childFrom = SqlBuilder.select(mainSqlModel.getSqlTable().column(pkeyId)) + .from(mainSqlModel.getSqlTable()); + + SuperJsonModel keyWordQuery = new SuperJsonModel(); + if (Objects.equals(paginationModel.getQueryType(), 0) && StringUtil.isNotEmpty(keyword)) { + List keywordFields = mainFieldModelList.stream().filter(t -> t.getConfig() != null + && YunzhupaasKeyConsts.getKeyWordList().contains(t.getConfig().getYunzhupaasKey())) + .collect(Collectors.toList()); + List keywordList = new ArrayList<>(); + for (FieLdsModel fieLdsModel : keywordFields) { + fieLdsModel.setFieldValue(keyword); + fieLdsModel.setSymbol(SearchMethodEnum.Like.getSymbol()); + fieLdsModel.setId(fieLdsModel.getVModel()); + OnlineProductSqlUtils.tabelName(fieLdsModel, formAllModel); + keywordList.add(fieLdsModel); + } + SuperQueryJsonModel queryJsonModel = new SuperQueryJsonModel(); + queryJsonModel.setLogic(SearchMethodEnum.Or.getSymbol()); + queryJsonModel.setGroups(keywordList); + keyWordQuery.setConditionList(new ArrayList() { + { + add(queryJsonModel); + } + }); + listquery.add(keyWordQuery); + } + // 取出所有有用到的表-进行关联过滤 + List allTableName = OnlinePublicUtils.getAllTableName(new ArrayList<>(), listquery, + tableFieldAndTableName); + + if (dycList.size() > 0) { + for (OnlineDynamicSqlModel sqlModel : dycList) { + if (tableNameAndTableField.containsKey(sqlModel.getTableName()) + && !allTableName.contains(sqlModel.getTableName())) + continue; + // 过滤数据连接所有表 + childFrom.leftJoin(sqlModel.getSqlTable()).on( + sqlModel.getSqlTable().column(sqlModel.getForeign()), + new EqualTo(mainSqlModel.getSqlTable().column(sqlModel.getRelationKey()))); + // 结果数据不连子表 + if (!tableNameAndTableField.containsKey(sqlModel.getTableName())) { + from.leftJoin(sqlModel.getSqlTable()).on( + sqlModel.getSqlTable().column(sqlModel.getForeign()), + new EqualTo(mainSqlModel.getSqlTable().column(sqlModel.getRelationKey()))); + } + } + } + QueryExpressionDSL.QueryExpressionWhereBuilder childWhere = childFrom.where(); + + OnlineProductSqlUtils.getSuperSql(childWhere, ruleQuery, sqlModelList, databaseProductName, null, + false); + + if (Objects.equals(paginationModel.getQueryType(), 0) && StringUtil.isNotEmpty(keyword)) { + OnlineProductSqlUtils.getSuperSql(childWhere, keyWordQuery, sqlModelList, databaseProductName, null, + false); + } + + // 逻辑删除不展示 + if (logicalDelete) { + childWhere.and(mainSqlModel.getSqlTable().column(TableFeildsEnum.DELETEMARK.getField()), + SqlBuilder.isNull()); + } + + QueryExpressionDSL.QueryExpressionWhereBuilder whereRes = from.where(); + whereRes.and(SqlTable.of(mainTable.getTable()).column(pkeyId), SqlBuilder.isIn(childWhere)); + + // 排序 + if (StringUtil.isNotEmpty(paginationModel.getSidx())) { + String[] split = paginationModel.getSidx().split(","); + List sidxList = new ArrayList<>(); + for (String sidx : split) { + // 目前只支持主表排序 + if (sidx.toLowerCase().contains("_yunzhupaas_") + || sidx.toLowerCase().contains(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX)) { + continue; + } + SortSpecification sortSpecification; + if (sidx.startsWith("-")) { + sortSpecification = SqlBuilder.sortColumn(mainTable.getTable(), + SqlTable.of(mainTable.getTable()).column(sidx.substring(1))).descending(); + } else { + sortSpecification = SqlBuilder.sortColumn(mainTable.getTable(), + SqlTable.of(mainTable.getTable()).column(sidx)); + } + sidxList.add(sortSpecification); + } + whereRes.orderBy(sidxList); + } else { + whereRes.orderBy(SqlBuilder + .sortColumn(mainTable.getTable(), SqlTable.of(mainTable.getTable()).column(pkeyId)) + .descending()); + } + SelectStatementProvider renderRes = whereRes.build().render(RenderingStrategies.MYBATIS3); + + // 真分页,查询类型:0-简易查询(单行,多行,数字,下拉补全),1-全部字段 + if (Objects.equals(paginationModel.getQueryType(), 0)) { + QueryExpressionDSL.QueryExpressionWhereBuilder countSelect = SqlBuilder + .select(SqlBuilder.countDistinct(mainSqlModel.getSqlTable().column(pkeyId))) + .from(mainSqlModel.getSqlTable()) + .where() + .and(SqlTable.of(mainTable.getTable()).column(pkeyId), SqlBuilder.isIn(childWhere)); + SelectStatementProvider renderCount = countSelect.build().render(RenderingStrategies.MYBATIS3); + long count = flowFormDataMapper.count(renderCount); + paginationModel.setTotal(count); + if (count == 0) { + return new ArrayList<>(); + } + if (isPage) { + PageHelper.startPage((int) paginationModel.getCurrentPage(), + (int) paginationModel.getPageSize(), false); + } + } + + // 查询结果 + List> dataList = flowFormDataMapper.selectManyMappedRows(renderRes); + noSwapDataList = dataList.stream().map(data -> { + data.put(FlowFormConstant.ID, data.get(pkeyId)); + return data; + }).collect(Collectors.toList()); + + // 第二种 有关键字不分页 + if (Objects.equals(paginationModel.getQueryType(), 1) && StringUtil.isNotEmpty(keyword)) { + for (FieLdsModel fieldsModel : mainFieldModelList) { + if (fieldsModel.getVModel() != null) { + boolean b = collect.stream().anyMatch(c -> fieldsModel.getVModel().equalsIgnoreCase(c)); + // 组装为查询条件 + if (b) { + VisualColumnSearchVO vo = new VisualColumnSearchVO(); + vo.setSearchType("2"); + vo.setVModel(fieldsModel.getVModel()); + vo.setValue(keyword); + vo.setConfig(fieldsModel.getConfig()); + Boolean multiple = fieldsModel.getMultiple(); + vo.setMultiple(multiple); + searchVOList.add(vo); + } + } + } + noSwapDataList = onlineSwapDataUtils.getSwapList(noSwapDataList, mainFieldModelList, + visualDevJsonModel.getId(), false); + + noSwapDataList = RelationFormUtils.getRelationListByKeyword(noSwapDataList, searchVOList); + } else { + noSwapDataList = onlineSwapDataUtils.getSwapList(noSwapDataList, mainFieldModelList, + visualDevJsonModel.getId(), false); + } + // 假分页 + if (Objects.equals(paginationModel.getQueryType(), 1) && isPage) { + if (CollectionUtils.isNotEmpty(noSwapDataList)) { + paginationModel.setTotal(noSwapDataList.size()); + List>> partition = Lists.partition(noSwapDataList, + (int) paginationModel.getPageSize()); + int i = (int) paginationModel.getCurrentPage() - 1; + noSwapDataList = partition.size() > i ? partition.get(i) : Collections.emptyList(); + } + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + } + if (noSwapDataList.size() < 1) { + return new ArrayList<>(); + } + return noSwapDataList; + } + + @Override + public List> getListWithTableList(VisualDevJsonModel visualDevJsonModel, + PaginationModel paginationModel, UserInfo userInfo) { + FormDataModel formDataModel = visualDevJsonModel.getFormData(); + List visualTables = visualDevJsonModel.getVisualTables(); + if (ObjectUtil.isEmpty(visualDevJsonModel.getColumnData())) { + ColumnDataModel columnDataModel = new ColumnDataModel(); + columnDataModel.setColumnList("[]"); + visualDevJsonModel.setColumnData(columnDataModel); + } + List fieLdsModels = JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class); + RecursionForm recursionForm = new RecursionForm(fieLdsModels, visualTables); + List formAllModel = new ArrayList<>(); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + List columnPropList = new ArrayList<>(); + for (FormAllModel model : formAllModel) { + if (FormEnum.mast.getMessage().equals(model.getYunzhupaasKey())) { + FieLdsModel fieLdsModel = model.getFormColumnModel().getFieLdsModel(); + if (ObjectUtil.isNotEmpty(fieLdsModel.getVModel())) { + columnPropList.add(fieLdsModel.getVModel()); + } + } + if (FormEnum.mastTable.getMessage().equals(model.getYunzhupaasKey())) { + FieLdsModel fieLdsModel = model.getFormMastTableModel().getMastTable().getFieLdsModel(); + if (ObjectUtil.isNotEmpty(fieLdsModel.getVModel())) { + columnPropList.add(fieLdsModel.getVModel()); + } + } + if (FormEnum.table.getMessage().equals(model.getYunzhupaasKey())) { + FormColumnTableModel childList = model.getChildList(); + List childListAll = childList.getChildList(); + for (FormColumnModel childModel : childListAll) { + FieLdsModel fieLdsModel = childModel.getFieLdsModel(); + if (ObjectUtil.isNotEmpty(fieLdsModel.getVModel())) { + columnPropList.add(childList.getTableModel() + "-" + fieLdsModel.getVModel()); + } + } + } + } + // OnlineProductSqlUtils.queryList(formAllModel, visualDevJsonModel, + // paginationModel); + List> dataList = getListWithTable(visualDevJsonModel, paginationModel, userInfo, + columnPropList); + List fields = new ArrayList<>(); + OnlinePublicUtils.recursionFields(fields, fieLdsModels); + visualDevJsonModel.setFormListModels(fields); + dataList = onlineSwapDataUtils.getSwapList(dataList, fields, visualDevJsonModel.getId(), false); + return dataList; + } + + /** + * 达梦或者oracle 别名太长转换-别名还原 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2023/3/16 + */ + private void setAliasKey(List> dataList, Map aliasMap) { + if (dataList.size() > 0 && aliasMap.size() > 0) { + for (int i = 0; i < dataList.size(); i++) { + Map objMap = dataList.get(i); + Set aliasKey = aliasMap.keySet(); + Map newObj = new HashMap<>(); + for (String key : objMap.keySet()) { + Object value = objMap.get(key); + String oldKey = aliasMap.get(key); + if (aliasKey.contains(key)) { + newObj.put(oldKey, value); + } else { + newObj.put(key, value); + } + } + dataList.remove(i); + dataList.add(i, newObj); + } + } + } + + /** + * 获取id,及主表的排序字段列表(用于查询排序) + * + * @param mainSqlModel + * @param sidxs + * @param pkeyId + * @return + */ + public List orderByColumns(OnlineDynamicSqlModel mainSqlModel, String sidxs, String pkeyId) { + List distinctColumns = new ArrayList<>(); + distinctColumns.add(mainSqlModel.getSqlTable().column(pkeyId)); + if (StringUtil.isNotEmpty(sidxs)) { + String[] split = sidxs.split(","); + for (String sidx : split) { + // 目前只支持主表排序 + if (sidx.toLowerCase().contains("_yunzhupaas_") + || sidx.toLowerCase().contains(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX) + || sidx.toLowerCase().equals(pkeyId)) { + continue; + } + SqlColumn column = mainSqlModel.getSqlTable().column(sidx); + if (sidx.startsWith("-")) { + column = mainSqlModel.getSqlTable().column(sidx.substring(1)); + } + distinctColumns.add(column); + } + } + return distinctColumns; + } +} diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/service/impl/VisualLogServiceImpl.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/service/impl/VisualLogServiceImpl.java new file mode 100644 index 0000000..6af30f1 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/service/impl/VisualLogServiceImpl.java @@ -0,0 +1,311 @@ +package com.yunzhupaas.onlinedev.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yunzhupaas.base.entity.VisualdevReleaseEntity; +import com.yunzhupaas.base.model.VisualLogModel; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.base.service.VisualdevReleaseService; +import com.yunzhupaas.constant.YunzhupaasConst; +import com.yunzhupaas.event.ProjectEventListener; +import com.yunzhupaas.model.visualJson.FieLdsModel; +import com.yunzhupaas.model.visualJson.FormDataModel; +import com.yunzhupaas.model.visualJson.TableFields; +import com.yunzhupaas.model.visualJson.TableModel; +import com.yunzhupaas.model.visualJson.config.ConfigModel; +import com.yunzhupaas.module.ProjectEventBuilder; +import com.yunzhupaas.module.ProjectEventInstance; +import com.yunzhupaas.onlinedev.entity.VisualLogEntity; +import com.yunzhupaas.onlinedev.mapper.VisualLogMapper; +import com.yunzhupaas.onlinedev.model.OnlineDevEnum.OnlineDataTypeEnum; +import com.yunzhupaas.onlinedev.model.log.VisualLogForm; +import com.yunzhupaas.onlinedev.model.log.VisualLogPage; +import com.yunzhupaas.onlinedev.service.VisualLogService; +import com.yunzhupaas.onlinedev.util.onlineDevUtil.OnlinePublicUtils; +import com.yunzhupaas.onlinedev.util.onlineDevUtil.OnlineSwapDataUtils; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.PublishEventUtil; +import com.yunzhupaas.util.TableFeildsEnum; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 数据日志实现 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/8/27 18:24:42 + */ +@Service +public class VisualLogServiceImpl extends SuperServiceImpl + implements VisualLogService { + @Autowired + private VisualdevReleaseService visualdevReleaseService; + @Autowired + private OnlineSwapDataUtils onlineSwapDataUtils; + + /** + * 创建日志事件 + * + * @param form 数据id + */ + @Override + public void createEventLog(VisualLogForm form) { + PublishEventUtil.publishLocalEvent(new ProjectEventBuilder(YunzhupaasConst.VSLOG_EVENT_KEY, form)); + } + + @Override + public List getLogList(VisualLogPage pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualLogEntity::getModelId, pagination.getModelId()); + queryWrapper.lambda().eq(VisualLogEntity::getDataId, pagination.getDataId()); + // 排序 + queryWrapper.lambda().orderByDesc(VisualLogEntity::getCreatorTime); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage iPage = this.page(page, queryWrapper); + return pagination.setData(iPage.getRecords(), iPage.getTotal()); + } + + /** + * 监听日志插入 + * + * @param redisEvent + */ + @ProjectEventListener(channelRegex = YunzhupaasConst.VSLOG_EVENT_KEY + ".*") + public void createLogByEvent(ProjectEventInstance redisEvent) { + VisualLogForm form = (VisualLogForm) redisEvent.getSource(); + VisualLogEntity visualLogEntity = new VisualLogEntity(); + visualLogEntity.setType(form.getType()); + visualLogEntity.setModelId(form.getModelId()); + visualLogEntity.setDataId(form.getDataId()); + + // 修改数据 + if (Objects.equals(form.getType(), 1)) { + List listLog = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(form.getListLog())) { + listLog = form.getListLog(); + } else { + addLog(form, listLog); + } + visualLogEntity.setDataLog(JsonUtil.getObjectToString(listLog)); + if (CollectionUtils.isNotEmpty(listLog)) { + this.save(visualLogEntity); + } + } else { + // 新增数据 + this.save(visualLogEntity); + } + } + + public void addLog(VisualLogForm formSource, List listLog) { + VisualLogForm form = BeanUtil.copyProperties(formSource, VisualLogForm.class); + VisualdevReleaseEntity visualdevEntity = visualdevReleaseService.getById(form.getModelId()); + FormDataModel formData = JsonUtil.getJsonToBean(visualdevEntity.getFormData(), FormDataModel.class); + List fieLdsModels = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + List tableModels = JsonUtil.getJsonToList(visualdevEntity.getVisualTables(), TableModel.class); + + List fields = new ArrayList<>(); + OnlinePublicUtils.recursionFields(fields, fieLdsModels); + + List> swapInfoOld = onlineSwapDataUtils.getSwapInfo(new ArrayList>() { + { + add(form.getOldData()); + } + }, fields, visualdevEntity.getId(), false, null); + Map oldData = swapInfoOld.get(0); + List> swapInfoNew = onlineSwapDataUtils.getSwapInfo(new ArrayList>() { + { + add(form.getNewData()); + } + }, fields, visualdevEntity.getId(), false, null); + Map newData = swapInfoNew.get(0); + + for (FieLdsModel item : fields) { + ConfigModel config = item.getConfig(); + String yunzhupaasKey = config.getYunzhupaasKey(); + String label = config.getLabel(); + String dataType = config.getDataType(); + // 移除系统字段 + if (isSkipFields(item)) + continue; + if (YunzhupaasKeyConsts.CHILD_TABLE.equals(yunzhupaasKey)) { + TableModel tableModel = tableModels.stream().filter(t -> t.getTable().equals(config.getTableName())) + .findFirst().orElse(null); + TableFields mainField = tableModel.getFields().stream() + .filter(t -> Objects.equals(t.getPrimaryKey(), 1) + && !t.getField().equalsIgnoreCase(TableFeildsEnum.TENANTID.getField())) + .findFirst().orElse(null); + String mainKey = mainField.getField(); + + List children = item.getConfig().getChildren(); + String vModel = item.getVModel(); + // 子表数据 + List> childData = new ArrayList<>(); + // 子表表头 + List> childField = new ArrayList<>(); + for (FieLdsModel childItem : children) { + String yunzhupaasKeyChild = childItem.getConfig().getYunzhupaasKey(); + if (isSkipFields(childItem)) + continue; + Map childItemMap = new HashMap<>(); + childItemMap.put("prop", childItem.getVModel()); + childItemMap.put("label", childItem.getConfig().getLabel()); + childItemMap.put("yunzhupaasKey", yunzhupaasKeyChild); + boolean nameModified = false; + if (YunzhupaasKeyConsts.getNameModified().contains(yunzhupaasKeyChild)) { + if (YunzhupaasKeyConsts.getNameModifiedNotDynamic().contains(yunzhupaasKeyChild) + || OnlineDataTypeEnum.DYNAMIC.getType().equals(childItem.getConfig().getDataType())) { + nameModified = true; + } + } + childItemMap.put("nameModified", nameModified); + childField.add(childItemMap); + } + + List> childOld = oldData.get(vModel) == null ? new ArrayList<>() + : (List) oldData.get(vModel); + List> childNew = newData.get(vModel) == null ? new ArrayList<>() + : (List) newData.get(vModel); + List newIds = childNew.stream().map(t -> t.get(mainKey)).collect(Collectors.toList()); + List> deleteMap = childOld.stream().filter(t -> !newIds.contains(t.get(mainKey))) + .collect(Collectors.toList()); + for (Map chilMap : deleteMap) { + Map childDataMap = new HashMap<>(); + for (FieLdsModel childItem : children) { + String childYunzhupaasKey = childItem.getConfig().getYunzhupaasKey(); + // 移除系统字段 + if (isSkipFields(childItem)) + continue; + String childVmodel = childItem.getVModel(); + String childVmodel_old = "yunzhupaas_old_" + childItem.getVModel(); + String oldValue = getValueByType(chilMap, childVmodel, childYunzhupaasKey); + childDataMap.put(childVmodel, null); + childDataMap.put(childVmodel_old, oldValue); + childDataMap.put("yunzhupaas_type", 2); + } + childData.add(childDataMap); + } + for (Map chilMap : childNew) { + Object mainId = chilMap.get(mainKey); + Map oldMap = childOld.stream().filter(t -> t.get(mainKey).equals(mainId)) + .findFirst().orElse(null); + Integer yunzhupaas_type = 1; + if (oldMap == null) { + yunzhupaas_type = 0; + } + Map childDataMap = new HashMap<>(); + boolean hasChanged = false; + for (FieLdsModel childItem : children) { + String childYunzhupaasKey = childItem.getConfig().getYunzhupaasKey(); + // 移除系统字段 + if (isSkipFields(childItem)) + continue; + String childVmodel = childItem.getVModel(); + String childVmodel_old = "yunzhupaas_old_" + childItem.getVModel(); + String newValue = getValueByType(chilMap, childVmodel, childYunzhupaasKey); + String oldValue = getValueByType(oldMap, childVmodel, childYunzhupaasKey); + if (!Objects.equals(newValue, oldValue)) { + hasChanged = true; + } + childDataMap.put(childVmodel, newValue); + childDataMap.put(childVmodel_old, oldValue); + childDataMap.put("yunzhupaas_type", yunzhupaas_type); + } + if (hasChanged) { + childData.add(childDataMap); + } + } + if (CollectionUtils.isNotEmpty(childData)) { + VisualLogModel vlogModel = new VisualLogModel(); + vlogModel.setField(vModel); + vlogModel.setFieldName(label); + vlogModel.setYunzhupaasKey(yunzhupaasKey); + vlogModel.setChidData(childData); + vlogModel.setChidField(childField); + vlogModel.setType(1); + listLog.add(vlogModel); + } + } else { + String vModel = item.getVModel(); + if (!Objects.equals(oldData.get(vModel), newData.get(vModel))) { + Integer actionType = 1;// 0-新增,1-修改 + if (oldData.get(vModel) == null || oldData.get(vModel).toString().trim().isEmpty()) { + actionType = 0; + } + boolean nameModified = false; + if (YunzhupaasKeyConsts.getNameModified().contains(yunzhupaasKey)) { + if (YunzhupaasKeyConsts.getNameModifiedNotDynamic().contains(yunzhupaasKey) + || OnlineDataTypeEnum.DYNAMIC.getType().equals(dataType)) { + nameModified = true; + } + } + + String newValue = getValueByType(newData, vModel, yunzhupaasKey); + String oldValue = getValueByType(oldData, vModel, yunzhupaasKey); + VisualLogModel vlogModel = new VisualLogModel(); + vlogModel.setField(vModel); + vlogModel.setFieldName(label); + vlogModel.setYunzhupaasKey(yunzhupaasKey); + vlogModel.setNewData(newValue); + vlogModel.setOldData(oldValue); + vlogModel.setType(actionType); + vlogModel.setNameModified(nameModified); + listLog.add(vlogModel); + } + } + } + } + + /** + * 跳过字段不处理 + * + * @param childItem + * @return + */ + private boolean isSkipFields(FieLdsModel childItem) { + // 字段不处理直接跳过 :(YunzhupaasKeyConsts.CALCULATE 计算公式仅展示也跳过) + List skipFields = new ArrayList<>(); + skipFields.addAll(YunzhupaasKeyConsts.getSystemKey()); + skipFields.add(YunzhupaasKeyConsts.POPUPSELECT_ATTR); + skipFields.add(YunzhupaasKeyConsts.RELATIONFORM_ATTR); + String yunzhupaasKey = childItem.getConfig().getYunzhupaasKey(); + return skipFields.contains(yunzhupaasKey) + || (YunzhupaasKeyConsts.CALCULATE.equals(yunzhupaasKey) && Objects.equals(childItem.getIsStorage(), 0)); + } + + private String getValueByType(Map map, String vModel, String yunzhupaasKey) { + if (map != null) { + Object o = map.get(vModel); + String value = o == null ? "" : o.toString(); + switch (yunzhupaasKey) { + case YunzhupaasKeyConsts.UPLOADFZ: + List> listM = (List) o; + if (listM != null) { + StringJoiner sj = new StringJoiner(","); + listM.stream().forEach(t -> sj.add(t.get("name").toString())); + value = sj.toString(); + } + break; + case YunzhupaasKeyConsts.LOCATION: + Map lcationMap = JsonUtil.stringToMap(value); + if (MapUtils.isNotEmpty(lcationMap)) { + value = lcationMap.get("fullAddress") != null ? lcationMap.get("fullAddress").toString() : ""; + } + break; + default: + break; + } + return value; + } + return null; + } +} diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/service/impl/VisualPersonalServiceImpl.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/service/impl/VisualPersonalServiceImpl.java new file mode 100644 index 0000000..89c9689 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/service/impl/VisualPersonalServiceImpl.java @@ -0,0 +1,107 @@ +package com.yunzhupaas.onlinedev.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.onlinedev.entity.VisualPersonalEntity; +import com.yunzhupaas.onlinedev.mapper.VisualPersonalMapper; +import com.yunzhupaas.onlinedev.model.DataInfoVO; +import com.yunzhupaas.onlinedev.model.personalList.VisualPersConst; +import com.yunzhupaas.onlinedev.model.personalList.VisualPersonalInfo; +import com.yunzhupaas.onlinedev.model.personalList.VisualPersonalVo; +import com.yunzhupaas.onlinedev.service.VisualPersonalService; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * 个性化列表视图服务实现 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/8/27 18:24:42 + */ +@Service +public class VisualPersonalServiceImpl extends SuperServiceImpl implements VisualPersonalService { + + + + @Override + public List getList(String menuId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); +// queryWrapper.lambda().select( +// VisualPersonalEntity::getId, +// VisualPersonalEntity::getMenuId, +// VisualPersonalEntity::getType, +// VisualPersonalEntity::getStatus, +// VisualPersonalEntity::getFullName +// ); + queryWrapper.lambda().eq(VisualPersonalEntity::getMenuId, menuId); + queryWrapper.lambda().eq(VisualPersonalEntity::getCreatorUserId, UserProvider.getUser().getUserId()); + return this.list(queryWrapper); + } + + @Override + public List getListVo(String menuId) { + List listVo = new ArrayList<>(); + //个人视图 + List list = this.getList(menuId); + VisualPersonalEntity defaultEntity = list.stream().filter(t -> Objects.equals(1, t.getStatus())).findFirst().orElse(null); + //添加系统视图 + Integer status = ObjectUtil.isEmpty(defaultEntity) ? 1 : 0; + VisualPersonalVo vo = new VisualPersonalVo(); + vo.setId(VisualPersConst.SYSTEM_ID); + vo.setFullName(VisualPersConst.SYSTEM_NAME); + vo.setStatus(status); + vo.setType(0); + listVo.add(vo); + for (VisualPersonalEntity item : list) { + VisualPersonalVo personalVo = JsonUtil.getJsonToBean(item, VisualPersonalVo.class); + listVo.add(personalVo); + } + return listVo; + } + + @Override + public VisualPersonalInfo getInfo(String id) { + VisualPersonalInfo info = null; + if (ObjectUtil.isNotEmpty(id) && !VisualPersConst.SYSTEM_ID.equals(id)) { + VisualPersonalEntity entity = this.getById(id); + if (entity != null) { + info = JsonUtil.getJsonToBean(entity, VisualPersonalInfo.class); + } + } + return info; + } + + @Override + public boolean isExistByFullName(String fullName, String id, String menuId) { + if (VisualPersConst.SYSTEM_NAME.equals(fullName)) return true; + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualPersonalEntity::getFullName, fullName); + if (!StringUtils.isEmpty(id)) { + queryWrapper.lambda().ne(VisualPersonalEntity::getId, id); + } + queryWrapper.lambda().eq(VisualPersonalEntity::getMenuId, menuId); + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public void setDataInfoVO(String menuId, DataInfoVO dataInfoVO) { + List listVo = StringUtil.isNotEmpty(menuId) ? this.getListVo(menuId) : new ArrayList<>(); + dataInfoVO.setPersonalList(listVo); + VisualPersonalVo personalVo = listVo.stream().filter(t -> Objects.equals(1, t.getStatus())).findFirst().orElse(null); + String id = ObjectUtil.isEmpty(personalVo) ? null : personalVo.getId(); + VisualPersonalInfo info = this.getInfo(id); + dataInfoVO.setDefaultView(info); + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/service/impl/VisualdevModelDataServiceImpl.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/service/impl/VisualdevModelDataServiceImpl.java new file mode 100644 index 0000000..bfc262e --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/service/impl/VisualdevModelDataServiceImpl.java @@ -0,0 +1,687 @@ +package com.yunzhupaas.onlinedev.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.ModuleEntity; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.entity.VisualdevReleaseEntity; +import com.yunzhupaas.base.mapper.FlowFormDataMapper; +import com.yunzhupaas.base.model.*; +import com.yunzhupaas.base.model.OnlineImport.VisualdevModelDataInfoVO; +import com.yunzhupaas.base.model.flow.DataModel; +import com.yunzhupaas.base.model.flow.FlowFormDataModel; +import com.yunzhupaas.base.model.form.ModuleFormModel; +import com.yunzhupaas.base.model.module.PropertyJsonModel; +import com.yunzhupaas.base.service.DbLinkService; +import com.yunzhupaas.base.service.ModuleService; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.base.service.VisualdevReleaseService; +import com.yunzhupaas.base.util.FlowFormDataUtil; +import com.yunzhupaas.base.util.FormCheckUtils; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.database.model.entity.DbLinkEntity; +import com.yunzhupaas.database.model.superQuery.SuperJsonModel; +import com.yunzhupaas.database.model.superQuery.SuperQueryJsonModel; +import com.yunzhupaas.database.util.ConnUtil; +import com.yunzhupaas.database.util.DynamicDataSourceUtil; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.TaskEntity; +import com.yunzhupaas.model.OnlineDevData; +import com.yunzhupaas.model.visualJson.FieLdsModel; +import com.yunzhupaas.model.visualJson.FormCloumnUtil; +import com.yunzhupaas.model.visualJson.FormDataModel; +import com.yunzhupaas.model.visualJson.TableModel; +import com.yunzhupaas.model.visualJson.analysis.FormAllModel; +import com.yunzhupaas.model.visualJson.analysis.FormModel; +import com.yunzhupaas.model.visualJson.analysis.RecursionForm; +import com.yunzhupaas.onlinedev.entity.VisualdevModelDataEntity; +import com.yunzhupaas.onlinedev.mapper.VisualdevModelDataMapper; +import com.yunzhupaas.onlinedev.model.OnlineDevListModel.VisualColumnSearchVO; +import com.yunzhupaas.onlinedev.model.OnlineInfoModel; +import com.yunzhupaas.onlinedev.model.PaginationModel; +import com.yunzhupaas.onlinedev.model.PaginationModelExport; +import com.yunzhupaas.onlinedev.model.VisualParamModel; +import com.yunzhupaas.onlinedev.model.log.VisualLogForm; +import com.yunzhupaas.onlinedev.service.VisualDevInfoService; +import com.yunzhupaas.onlinedev.service.VisualDevListService; +import com.yunzhupaas.onlinedev.service.VisualLogService; +import com.yunzhupaas.onlinedev.service.VisualdevModelDataService; +import com.yunzhupaas.onlinedev.util.onlineDevUtil.OnlineDevInfoUtils; +import com.yunzhupaas.onlinedev.util.onlineDevUtil.OnlineProductSqlUtils; +import com.yunzhupaas.onlinedev.util.onlineDevUtil.OnlinePublicUtils; +import com.yunzhupaas.onlinedev.util.onlineDevUtil.OnlineSwapDataUtils; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.model.authorize.OnlineDynamicSqlModel; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.permissions.PermissionInterfaceImpl; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.context.RequestContext; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import com.yunzhupaas.workflow.service.TaskApi; +import com.yunzhupaas.workflow.service.TemplateApi; +import lombok.Cleanup; +import org.mybatis.dynamic.sql.SqlBuilder; +import org.mybatis.dynamic.sql.SqlTable; +import org.mybatis.dynamic.sql.delete.DeleteDSL; +import org.mybatis.dynamic.sql.delete.DeleteModel; +import org.mybatis.dynamic.sql.render.RenderingStrategies; +import org.mybatis.dynamic.sql.select.QueryExpressionDSL; +import org.mybatis.dynamic.sql.select.SelectModel; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.io.IOException; +import java.sql.Connection; +import java.sql.SQLException; +import java.text.ParseException; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/3/16 + */ +@Service +public class VisualdevModelDataServiceImpl extends SuperServiceImpl + implements VisualdevModelDataService { + + @Autowired + private UserService userApi; + @Autowired + private DbLinkService dblinkService; + @Autowired + private VisualdevReleaseService visualdevReleaseService; + @Autowired + private VisualDevListService visualDevListService; + @Autowired + private OnlineSwapDataUtils onlineSwapDataUtils; + @Autowired + private OnlineDevInfoUtils onlineDevInfoUtils; + @Autowired + private FlowFormDataUtil flowFormDataUtil; + @Autowired + private FormCheckUtils formCheckUtils; + @Autowired + private TemplateApi templateApi; + @Autowired + private TaskApi taskApi; + @Autowired + private ModuleService moduleService; + @Autowired + private VisualLogService visualLogService; + @Autowired + private VisualDevInfoService visualDevInfoService; + @Autowired + private FlowFormDataMapper flowFormDataMapper; + + @Override + public List getList(String modelId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualdevModelDataEntity::getVisualDevId, modelId); + return this.list(queryWrapper); + } + + /** + * 表单字段 + * + * @param id + * @param filterType 过滤类型,0或者不传为默认过滤子表和关联表单,1-弹窗配置需要过滤掉的类型 + * @return + */ + @Override + public List fieldList(String id, Integer filterType) { + VisualdevReleaseEntity entity = visualdevReleaseService.getById(id); + FormDataModel formData = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + + List fieLdsModelList = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + List mainFieldModelList = new ArrayList<>(); + + OnlinePublicUtils.recursionFields(mainFieldModelList, fieLdsModelList); + // 过滤掉无法传递的组件 + List notInList = new ArrayList<>(); + notInList.add(YunzhupaasKeyConsts.RELATIONFORM); + notInList.add(YunzhupaasKeyConsts.CHILD_TABLE); + if (Objects.equals(filterType, 1)) { + notInList.add("link"); + notInList.add("button"); + notInList.add("YUNZHUPAASText"); + notInList.add("alert"); + notInList.add(YunzhupaasKeyConsts.POPUPSELECT); + notInList.add(YunzhupaasKeyConsts.QR_CODE); + notInList.add(YunzhupaasKeyConsts.BARCODE); + notInList.add(YunzhupaasKeyConsts.CREATEUSER); + notInList.add(YunzhupaasKeyConsts.CREATETIME); + notInList.add(YunzhupaasKeyConsts.UPLOADIMG); + notInList.add(YunzhupaasKeyConsts.UPLOADFZ); + notInList.add(YunzhupaasKeyConsts.MODIFYUSER); + notInList.add(YunzhupaasKeyConsts.MODIFYTIME); + + notInList.add(YunzhupaasKeyConsts.CURRORGANIZE); + notInList.add(YunzhupaasKeyConsts.CURRPOSITION); + notInList.add(YunzhupaasKeyConsts.IFRAME); + notInList.add(YunzhupaasKeyConsts.RELATIONFORM_ATTR); + notInList.add(YunzhupaasKeyConsts.POPUPSELECT_ATTR); + } + + List formDataFieldList = mainFieldModelList.stream() + .filter(fieLdsModel -> !"".equals(fieLdsModel.getVModel()) + && StringUtil.isNotEmpty(fieLdsModel.getVModel()) + && !notInList.contains(fieLdsModel.getConfig().getYunzhupaasKey())) + .map(fieLdsModel -> { + FormDataField formDataField = new FormDataField(); + formDataField.setLabel(fieLdsModel.getConfig().getLabel()); + formDataField.setVModel(fieLdsModel.getVModel()); + return formDataField; + }).collect(Collectors.toList()); + + return formDataFieldList; + } + + @Override + public List> getPageList(VisualdevEntity entity, PaginationModel paginationModel) { + // String json = null; + // if (StringUtil.isNotEmpty(paginationModel.getKeyword())) { + // Map map = new HashMap<>(); + // map.put(paginationModel.getRelationField(), paginationModel.getKeyword()); + // json = JsonUtil.getObjectToString(map); + // } + // paginationModel.setQueryJson(json); + VisualDevJsonModel visualJsonModel = OnlinePublicUtils.getVisualJsonModel(entity); + + // 判断请求客户端来源 + if (!RequestContext.isOrignPc()) { + visualJsonModel.setColumnData(visualJsonModel.getAppColumnData()); + } + List> dataList = visualDevListService.getRelationFormList(visualJsonModel, paginationModel); + return dataList; + } + + @Override + public List> exportData(String[] keys, PaginationModelExport paginationModelExport, + VisualDevJsonModel visualDevJsonModel) { + PaginationModel paginationModel = new PaginationModel(); + BeanUtil.copyProperties(paginationModelExport, paginationModel); + List keyList = Arrays.asList(keys); + List> noSwapDataList; + ColumnDataModel columnDataModel = visualDevJsonModel.getColumnData(); + List searchVOList = new ArrayList<>(); + List visualTables = visualDevJsonModel.getVisualTables(); + TableModel mainTable = visualTables.stream().filter(vi -> vi.getTypeId().equals("1")).findFirst().orElse(null); + // 解析控件 + FormDataModel formDataModel = visualDevJsonModel.getFormData(); + List fieLdsModels = JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class); + RecursionForm recursionForm = new RecursionForm(fieLdsModels, visualTables); + List formAllModel = new ArrayList<>(); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + // 封装查询条件 + if (StringUtil.isNotEmpty(paginationModel.getQueryJson())) { + Map keyJsonMap = JsonUtil.stringToMap(paginationModel.getQueryJson()); + searchVOList = JsonUtil.getJsonToList(columnDataModel.getSearchList(), VisualColumnSearchVO.class); + searchVOList = searchVOList.stream().map(searchVO -> { + searchVO.setValue(keyJsonMap.get(searchVO.getId())); + return searchVO; + }).filter(vo -> vo.getValue() != null && StringUtil.isNotEmpty(String.valueOf(vo.getValue()))) + .collect(Collectors.toList()); + // 左侧树查询 + boolean b = false; + if (columnDataModel.getTreeRelation() != null) { + b = keyJsonMap.keySet().stream() + .anyMatch(t -> t.equalsIgnoreCase(String.valueOf(columnDataModel.getTreeRelation()))); + } + if (b && keyJsonMap.size() > searchVOList.size()) { + String relation = String.valueOf(columnDataModel.getTreeRelation()); + VisualColumnSearchVO vo = new VisualColumnSearchVO(); + vo.setSearchType("1"); + vo.setVModel(relation); + vo.setValue(keyJsonMap.get(relation)); + searchVOList.add(vo); + } + } + // 菜单id + String menuId = paginationModel.getMenuId(); + // 菜单判断是否启用流程-添加流程状态 + ModuleEntity info = moduleService.getInfo(menuId); + if (info != null) { + // 流程菜单 + boolean enableFlow = Objects.equals(info.getType(), 9); + visualDevJsonModel.setEnableFlow(enableFlow); + if (enableFlow) { + PropertyJsonModel model = JsonUtil.getJsonToBean(info.getPropertyJson(), PropertyJsonModel.class); + List flowVersionIds = templateApi.getFlowIdsByTemplateId(model.getModuleId()); + visualDevJsonModel.setFlowId(model.getModuleId()); + visualDevJsonModel.setFlowVersionIds(flowVersionIds); + } + } + + if (visualDevJsonModel.getVisualTables().size() > 0) { + // 当前用户信息 + UserInfo userInfo = UserProvider.getUser(); + // 封装搜索数据 + OnlineProductSqlUtils.queryList(formAllModel, visualDevJsonModel, paginationModel); + noSwapDataList = visualDevListService.getListWithTable(visualDevJsonModel, paginationModel, userInfo, + keyList); + } else { + noSwapDataList = visualDevListService.getWithoutTableData(visualDevJsonModel.getId()); + noSwapDataList = visualDevListService.getList(noSwapDataList, searchVOList, paginationModel); + } + + // 数据转换 + List fields = new ArrayList<>(); + OnlinePublicUtils.recursionFields(fields, fieLdsModels); + noSwapDataList = onlineSwapDataUtils.getSwapList(noSwapDataList, fields, visualDevJsonModel.getId(), false); + + return noSwapDataList; + } + + @Override + public VisualdevModelDataEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(VisualdevModelDataEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public VisualdevModelDataInfoVO infoDataChange(String id, VisualdevEntity visualdevEntity) + throws IOException, ParseException, DataException, SQLException { + FormDataModel formDataModel = JsonUtil.getJsonToBean(visualdevEntity.getFormData(), FormDataModel.class); + List modelList = JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class); + + VisualdevModelDataEntity visualdevModelDataEntity = this.getInfo(id); + + List childFieldModelList = new ArrayList<>(); + List mainFieldModelList = new ArrayList<>(); + // 二维码 条形码 + List models = new ArrayList<>(); + OnlinePublicUtils.recurseFiled(modelList, mainFieldModelList, childFieldModelList, models); + + if (visualdevModelDataEntity != null) { + Map DataMap = JsonUtil.stringToMap(visualdevModelDataEntity.getData()); + Map childTableMap = DataMap.entrySet().stream() + .filter(m -> m.getKey().contains("tableField")) + .collect(Collectors.toMap((e) -> (String) e.getKey(), + (e) -> ObjectUtil.isNotEmpty(e.getValue()) ? e.getValue() : "")); + Map mainTableMap = DataMap.entrySet().stream() + .filter(m -> !m.getKey().contains("tableField")) + .collect(Collectors.toMap((e) -> (String) e.getKey(), + (e) -> ObjectUtil.isNotEmpty(e.getValue()) ? e.getValue() : "")); + mainTableMap = onlineDevInfoUtils.swapChildTableDataInfo(mainFieldModelList, mainTableMap, models); + + for (Map.Entry entry : childTableMap.entrySet()) { + List> listMap = JsonUtil.getJsonToListMap(String.valueOf(entry.getValue())); + FieLdsModel fieLdsModel = childFieldModelList.stream() + .filter(child -> child.getVModel().equalsIgnoreCase(entry.getKey())).findFirst().orElse(null); + if (ObjectUtil.isNotEmpty(fieLdsModel)) { + List> tableValueList = new ArrayList<>(); + if (Objects.nonNull(listMap)) { + for (Map map : listMap) { + Map childFieldMap = onlineDevInfoUtils + .swapChildTableDataInfo(fieLdsModel.getConfig().getChildren(), map, models); + tableValueList.add(childFieldMap); + } + } + Map childFieldsMap = new HashMap<>(); + childFieldsMap.put(entry.getKey(), tableValueList); + mainTableMap.putAll(childFieldsMap); + } + } + String objectToString = JsonUtilEx.getObjectToString(mainTableMap); + VisualdevModelDataInfoVO vo = new VisualdevModelDataInfoVO(); + vo.setData(objectToString); + vo.setId(id); + return vo; + } + return null; + } + + @Override + public DataModel visualCreate(VisualParamModel visualParamModel) throws Exception { + VisualdevEntity visualdevEntity = visualParamModel.getVisualdevEntity(); + Map map = visualParamModel.getData(); + boolean isLink = visualParamModel.getIsLink(); + boolean isUpload = visualParamModel.getIsUpload(); + FormDataModel formData = JsonUtil.getJsonToBean(visualdevEntity.getFormData(), FormDataModel.class); + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(visualdevEntity.getColumnData(), + ColumnDataModel.class); + Boolean needP = false; + List formPerList = new ArrayList<>(); + if (columnDataModel != null && StringUtil.isNotEmpty(visualParamModel.getMenuId())) { + needP = columnDataModel.getUseFormPermission(); + Map pMap = PermissionInterfaceImpl.getFormMap(); + if (pMap.get(visualParamModel.getMenuId()) != null) { + formPerList = JsonUtil.getJsonToList(pMap.get(visualParamModel.getMenuId()), ModuleFormModel.class) + .stream() + .map(ModuleFormModel::getEnCode).collect(Collectors.toList()); + } + } + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + List tableModels = JsonUtil.getJsonToList(visualdevEntity.getVisualTables(), TableModel.class); + DbLinkEntity linkEntity = StringUtil.isNotEmpty(visualdevEntity.getDbLinkId()) + ? dblinkService.getInfo(visualdevEntity.getDbLinkId()) + : null; + + // 递归遍历模板 + RecursionForm recursionForm = new RecursionForm(list, tableModels); + List formAllModel = new ArrayList<>(); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + // 是否开启并发锁 + Boolean concurrency = false; + Integer primaryKeyPolicy = formData.getPrimaryKeyPolicy(); + if (formData.getConcurrencyLock()) { + // 初始化version值 + map.put(TableFeildsEnum.VERSION.getField(), 0); + concurrency = true; + } + OnlineSwapDataUtils.swapDatetime(list, map); + // 单行唯一校验 + if (!isUpload) { + CheckFormModel checkFormModel = CheckFormModel.builder().formFieldList(list).dataMap(map) + .linkEntity(linkEntity).tableModelList(tableModels) + .visualdevEntity(visualdevEntity).id(null).isLink(isLink).build(); + String b = formCheckUtils.checkForm(checkFormModel); + if (StringUtil.isNotEmpty(b)) { + throw new WorkFlowException(b); + } + } + String mainId = RandomUtil.uuId(); + UserInfo userInfo = UserProvider.getUser(); + UserEntity info = userApi.getInfo(userInfo.getUserId()); + DataModel dataModel = DataModel.builder().visualId(visualdevEntity.getId()) + .dataNewMap(map).fieLdsModelList(list).tableModelList(tableModels).formAllModel(formAllModel) + .mainId(mainId).link(linkEntity).userEntity(info).concurrencyLock(concurrency) + .primaryKeyPolicy(primaryKeyPolicy).linkOpen(isLink) + .needPermission(needP).formPerList(formPerList) + .build(); + flowFormDataUtil.create(dataModel); + + // 数据日志 + if (formData.isDataLog() && !isUpload && !isLink) { + visualLogService.createEventLog(VisualLogForm.builder().modelId(visualdevEntity.getId()) + .dataId(dataModel.getMainId()).newData(map).type(0).build()); + } + return dataModel; + } + + @Override + public DataModel visualUpdate(VisualParamModel visualParamModel) throws Exception { + VisualdevEntity visualdevEntity = visualParamModel.getVisualdevEntity(); + Map map = visualParamModel.getData(); + String id = visualParamModel.getId(); + boolean isUpload = visualParamModel.getIsUpload(); + boolean onlyUpdate = visualParamModel.getOnlyUpdate(); + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(visualdevEntity.getColumnData(), + ColumnDataModel.class); + FormDataModel formData = JsonUtil.getJsonToBean(visualdevEntity.getFormData(), FormDataModel.class); + Boolean needP = false; + List formPerList = new ArrayList<>(); + if (columnDataModel != null && StringUtil.isNotEmpty(visualParamModel.getMenuId())) { + needP = columnDataModel.getUseFormPermission(); + Map pMap = PermissionInterfaceImpl.getFormMap(); + if (pMap.get(visualParamModel.getMenuId()) != null) { + formPerList = JsonUtil.getJsonToList(pMap.get(visualParamModel.getMenuId()), ModuleFormModel.class) + .stream() + .map(ModuleFormModel::getEnCode).collect(Collectors.toList()); + } + } + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + boolean inlineEdit = columnDataModel.getType() != null && columnDataModel.getType() == 4; + if (inlineEdit && RequestContext.isOrignPc()) { + list = JsonUtil.getJsonToList(columnDataModel.getColumnList(), FieLdsModel.class); + list = list.stream().filter(f -> !f.getId().toLowerCase().contains(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX)) + .collect(Collectors.toList()); + } + List tableModels = JsonUtil.getJsonToList(visualdevEntity.getVisualTables(), TableModel.class); + TableModel mainT = tableModels.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + DbLinkEntity linkEntity = StringUtil.isNotEmpty(visualdevEntity.getDbLinkId()) + ? dblinkService.getInfo(visualdevEntity.getDbLinkId()) + : null; + + // 递归遍历模板 + RecursionForm recursionForm = new RecursionForm(list, tableModels); + List formAllModel = new ArrayList<>(); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + // 是否开启并发锁 + Boolean isConcurrencyLock = false; + Integer primaryKeyPolicy = formData.getPrimaryKeyPolicy(); + if (formData.getConcurrencyLock()) { + if (map.get(TableFeildsEnum.VERSION.getField()) == null) { + map.put(TableFeildsEnum.VERSION.getField(), 0); + } else { + boolean version = true; + try { + Object realId = id; + if (Objects.equals(primaryKeyPolicy, 2)) { + realId = Long.parseLong(id); + } + version = flowFormDataUtil.getVersion(mainT.getTable(), linkEntity, map, realId); + } catch (Exception e) { + throw new WorkFlowException(e.getMessage(), e); + } + if (!version) { + throw new WorkFlowException(MsgCode.VS405.get()); + } else { + Integer vs = Integer.valueOf(String.valueOf(map.get(TableFeildsEnum.VERSION.getField()))); + map.put(TableFeildsEnum.VERSION.getField(), vs + 1); + } + } + isConcurrencyLock = true; + } + OnlineSwapDataUtils.swapDatetime(list, map); + // 单行唯一校验 + if (!isUpload) { + CheckFormModel checkFormModel = CheckFormModel.builder().formFieldList(list).dataMap(map) + .linkEntity(linkEntity).tableModelList(tableModels) + .visualdevEntity(visualdevEntity).id(id).build(); + String b = formCheckUtils.checkForm(checkFormModel); + if (StringUtil.isNotEmpty(b)) { + throw new WorkFlowException(b); + } + } + + // 数据日志 + VisualdevModelDataInfoVO resOld = visualDevInfoService.getDetailsDataInfo(id, visualdevEntity, + OnlineInfoModel.builder().needRlationFiled(true).needSwap(false).formAllModel(formAllModel).build()); + Map oldData = JsonUtil.stringToMap(resOld.getData()); + + UserInfo userInfo = UserProvider.getUser(); + UserEntity info = userApi.getInfo(userInfo.getUserId()); + DataModel dataModel = DataModel.builder().visualId(visualdevEntity.getId()) + .dataNewMap(map).fieLdsModelList(list).tableModelList(tableModels).formAllModel(formAllModel) + .mainId(id).link(linkEntity).userEntity(info).concurrencyLock(isConcurrencyLock) + .primaryKeyPolicy(primaryKeyPolicy).onlyUpdate(onlyUpdate).logicalDelete(formData.getLogicalDelete()) + .needPermission(needP).formPerList(formPerList) + .build(); + flowFormDataUtil.update(dataModel); + VisualdevModelDataInfoVO res = visualDevInfoService.getDetailsDataInfo(id, visualdevEntity, + OnlineInfoModel.builder().needRlationFiled(true).needSwap(false).formAllModel(formAllModel).build()); + Map newData = JsonUtil.stringToMap(res.getData()); + VisualLogForm form = VisualLogForm.builder().modelId(visualdevEntity.getId()).dataId(id).oldData(oldData) + .newData(newData).type(1).build(); + // 处理变更字段信息-任务流程用 + List listLog = new ArrayList<>(); + visualLogService.addLog(form, listLog); + dataModel.setListLog(listLog); + // 数据日志 + if (formData.isDataLog() && !isUpload) { + form.setListLog(listLog); + visualLogService.createEventLog(form); + } + return dataModel; + } + + @Override + public void visualDelete(VisualdevEntity visualdevEntity, List> data) throws Exception { + VisualDevJsonModel visualJsonModel = OnlinePublicUtils.getVisualJsonModel(visualdevEntity); + // 判断请求客户端来源 + if (!RequestContext.isOrignPc()) { + visualJsonModel.setColumnData(visualJsonModel.getAppColumnData()); + } + List idsList = new ArrayList<>(); + StringJoiner errMess = new StringJoiner(","); + // todo 流程关联 + for (Map map : data) { + String id = String.valueOf(map.get(FlowFormConstant.ID)); + TaskEntity taskEntity = taskApi.getInfoSubmit(String.valueOf(map.get(FlowFormConstant.FLOWTASKID)), + TaskEntity::getId, + TaskEntity::getParentId, TaskEntity::getFullName, TaskEntity::getStatus); + if (taskEntity != null) { + try { + taskApi.delete(taskEntity); + idsList.add(id); + } catch (Exception e) { + errMess.add(e.getMessage()); + } + } else { + idsList.add(id); + } + } + if (idsList.size() == 0) { + throw new WorkFlowException(errMess.toString()); + } + if (!StringUtil.isEmpty(visualdevEntity.getVisualTables()) + && !OnlineDevData.TABLE_CONST.equals(visualdevEntity.getVisualTables())) { + for (String id : idsList) { + try { + tableDelete(id, visualJsonModel); + } catch (Exception e) { + throw new WorkFlowException(e.getMessage(), e); + } + } + } + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void delete(VisualdevModelDataEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + + @Override + public boolean tableDelete(String id, VisualDevJsonModel visualDevJsonModel) throws Exception { + DbLinkEntity linkEntity = dblinkService.getInfo(visualDevJsonModel.getDbLinkId()); + VisualDevJsonModel model = BeanUtil.copyProperties(visualDevJsonModel, VisualDevJsonModel.class); + return flowFormDataUtil.deleteTable(id, model, linkEntity); + } + + @Override + public ActionResult tableDeleteMore(List ids, VisualDevJsonModel visualDevJsonModel) throws Exception { + List dataInfoVOList = new ArrayList<>(); + for (String id : ids) { + boolean isDel = tableDelete(id, visualDevJsonModel); + if (isDel) { + dataInfoVOList.add(id); + } + } + visualDevJsonModel.setDataIdList(dataInfoVOList); + return ActionResult.success(MsgCode.SU003.get()); + } + + @Override + @DSTransactional + public void deleteByTableName(FlowFormDataModel model) throws Exception { + String tableName = model.getTableName(); + List> ruleList = model.getRuleList(); + String realTableName = tableName; + VisualdevReleaseEntity entity = visualdevReleaseService.getById(model.getFormId()); + List tableModels = JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class); + FormDataModel formData = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + Boolean logicalDelete = formData.getLogicalDelete(); + DbLinkEntity linkEntity = StringUtil.isNotEmpty(entity.getDbLinkId()) + ? dblinkService.getInfo(entity.getDbLinkId()) + : null; + List fieLdsModels = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + List fields = new ArrayList<>(); + OnlinePublicUtils.recursionFields(fields, fieLdsModels); + if (StringUtil.isNotEmpty(tableName) + && tableName.toLowerCase().contains(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX)) { + FieLdsModel fieLdsModel = fields.stream().filter(t -> t.getVModel().equalsIgnoreCase(tableName)).findFirst() + .orElse(null); + if (fieLdsModel != null) { + realTableName = fieLdsModel.getConfig().getTableName(); + } + } + String finalRealTableName = realTableName; + TableModel tableModel = tableModels.stream().filter(t -> t.getTable().equals(finalRealTableName)).findFirst() + .orElse(null); + List sqlModelList = new ArrayList<>(); + OnlineDynamicSqlModel sqlModel = new OnlineDynamicSqlModel(); + SqlTable sqlTable = SqlTable.of(tableModel.getTable()); + sqlModel.setSqlTable(sqlTable); + sqlModel.setTableName(tableModel.getTable()); + sqlModelList.add(sqlModel); + SuperJsonModel ruleJsonModel = null; + // 组装查询条件 + if (ObjectUtil.isNotEmpty(ruleList)) { + ruleJsonModel = new SuperJsonModel(); + ruleJsonModel.setMatchLogic(model.getRuleMatchLogic()); + List superQueryJsonModelList = new ArrayList<>(); + for (Object obj : ruleList) { + SuperQueryJsonModel ruleQueryModel = JsonUtil.getJsonToBean(obj, SuperQueryJsonModel.class); + List groups = ruleQueryModel.getGroups(); + if (ObjectUtil.isNotEmpty(groups)) { + groups.stream().forEach(group -> { + if (group.getId().toLowerCase().contains(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX)) { + group.setVModel(group.getId().split("-")[1]); + } + }); + } + superQueryJsonModelList.add(ruleQueryModel); + } + ruleJsonModel.setConditionList(superQueryJsonModelList); + } + DynamicDataSourceUtil.switchToDataSource(linkEntity); + try { + @Cleanup + Connection conn = ConnUtil.getConnOrDefault(linkEntity); + String dbType = conn.getMetaData().getDatabaseProductName().trim(); + String pkeyId = flowFormDataUtil.getKey(tableModel, dbType); + List idStringList = new ArrayList<>(); + if (ObjectUtil.isNotEmpty(ruleJsonModel)) { + QueryExpressionDSL.QueryExpressionWhereBuilder where = SqlBuilder + .selectDistinct(sqlTable.column(pkeyId)).from(sqlTable).where(); + OnlineProductSqlUtils.getSuperSql(where, ruleJsonModel, sqlModelList, dbType, null, false); + List> dataList = flowFormDataMapper + .selectManyMappedRows(where.build().render(RenderingStrategies.MYBATIS3)); + idStringList = dataList.stream().map(m -> m.get(pkeyId)).distinct().collect(Collectors.toList()); + if (ObjectUtil.isEmpty(idStringList)) { + idStringList.add("nodata"); + } + } + // if (logicalDelete) { + // SqlTable sqlt = SqlTable.of(tableModel.getTable()); + // UpdateDSL updateModelUpdateDSL = SqlBuilder.update(sqlt); + // updateModelUpdateDSL.set(sqlt.column(TableFeildsEnum.DELETEMARK.getField())).equalTo(1); + // updateModelUpdateDSL.set(sqlt.column(TableFeildsEnum.DELETETIME.getField())).equalTo(new + // Date()); + // updateModelUpdateDSL.set(sqlt.column(TableFeildsEnum.DELETEUSERID.getField())).equalTo(UserProvider.getUser().getUserId()); + // UpdateDSL.UpdateWhereBuilder whereU = + // updateModelUpdateDSL.where(); + // if (ObjectUtil.isNotEmpty(idStringList)) { + // whereU.and(sqlTable.column(pkeyId), SqlBuilder.isIn(idStringList)); + // } + // flowFormDataMapper.update(whereU.build().render(RenderingStrategies.MYBATIS3)); + // } else { + DeleteDSL.DeleteWhereBuilder whereD = SqlBuilder.deleteFrom(SqlTable.of(tableModel.getTable())) + .where(); + if (ObjectUtil.isNotEmpty(idStringList)) { + whereD.and(sqlTable.column(pkeyId), SqlBuilder.isIn(idStringList)); + } + flowFormDataMapper.delete(whereD.build().render(RenderingStrategies.MYBATIS3)); + // } + } catch (Exception e) { + e.printStackTrace(); + throw new DataException(MsgCode.FA103.get()); + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + } +} diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/util/onlineDevUtil/FlowFormCustomUtils.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/util/onlineDevUtil/FlowFormCustomUtils.java new file mode 100644 index 0000000..b571f12 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/util/onlineDevUtil/FlowFormCustomUtils.java @@ -0,0 +1,213 @@ +package com.yunzhupaas.onlinedev.util.onlineDevUtil; + +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.model.CheckFormModel; +import com.yunzhupaas.base.model.OnlineImport.VisualdevModelDataInfoVO; +import com.yunzhupaas.base.model.VisualLogModel; +import com.yunzhupaas.base.model.flow.DataModel; +import com.yunzhupaas.base.model.flow.FlowFormDataModel; +import com.yunzhupaas.base.util.FlowFormDataUtil; +import com.yunzhupaas.base.util.FormCheckUtils; +import com.yunzhupaas.base.util.ServiceBaseUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.database.model.entity.DbLinkEntity; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.model.visualJson.FieLdsModel; +import com.yunzhupaas.model.visualJson.FormCloumnUtil; +import com.yunzhupaas.model.visualJson.FormDataModel; +import com.yunzhupaas.model.visualJson.TableModel; +import com.yunzhupaas.model.visualJson.analysis.FormAllModel; +import com.yunzhupaas.model.visualJson.analysis.RecursionForm; +import com.yunzhupaas.onlinedev.model.OnlineInfoModel; +import com.yunzhupaas.onlinedev.model.log.VisualLogForm; +import com.yunzhupaas.onlinedev.service.VisualDevInfoService; +import com.yunzhupaas.onlinedev.service.VisualLogService; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.TableFeildsEnum; +import com.yunzhupaas.util.UserProvider; +import org.mybatis.dynamic.sql.SqlTable; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * 自定义流程表单处理 + * + * @author 云筑产品开发平台组 + * @version V3.4.5 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/10/21 + */ +@Component +public class FlowFormCustomUtils { + + @Autowired + private FlowFormDataUtil flowDataUtil; + @Autowired + private FormCheckUtils formCheckUtils; + @Autowired + private ServiceBaseUtil serviceUtil; + @Autowired + private VisualLogService visualLogService; + @Autowired + private VisualDevInfoService visualDevInfoService; + + public void create(VisualdevEntity visualdevEntity, FlowFormDataModel flowFormDataModel) throws WorkFlowException { + String id = flowFormDataModel.getId(); + Map map = flowFormDataModel.getMap(); + UserEntity delegateUser = flowFormDataModel.getDelegateUser(); + List> listFlowOperate = flowFormDataModel.getFormOperates(); + FormDataModel formData = JsonUtil.getJsonToBean(visualdevEntity.getFormData(), FormDataModel.class); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + List tableModels = JsonUtil.getJsonToList(visualdevEntity.getVisualTables(), TableModel.class); + DbLinkEntity linkEntity = serviceUtil.getDbLink(visualdevEntity.getDbLinkId()); + + //递归遍历模板 + RecursionForm recursionForm = new RecursionForm(list, tableModels); + List formAllModel = new ArrayList<>(); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + //是否开启并发锁 + Boolean concurrency = false; + Integer primaryKeyPolicy = formData.getPrimaryKeyPolicy(); + if (formData.getConcurrencyLock()) { + //初始化version值 + map.put(TableFeildsEnum.VERSION.getField(), 0); + concurrency = true; + } + //单行唯一校验 + CheckFormModel checkFormModel = CheckFormModel.builder().formFieldList(list).dataMap(map).linkEntity(linkEntity).tableModelList(tableModels) + .visualdevEntity(visualdevEntity).id(null).isTransfer(flowFormDataModel.getIsTransfer()).build(); + String b = formCheckUtils.checkForm(checkFormModel); + if (StringUtil.isNotEmpty(b)) { + throw new WorkFlowException(b); + } + String mainId = id; + UserEntity userEntity; + UserInfo userInfo = UserProvider.getUser(); + if (delegateUser != null) { + delegateUser.setId(userInfo.getUserId()); + userEntity = delegateUser; + } else { + userEntity = serviceUtil.getUserInfo(userInfo.getUserId()); + } + DataModel dataModel = DataModel.builder().visualId(visualdevEntity.getId()) + .dataNewMap(map).fieLdsModelList(list).tableModelList(tableModels).formAllModel(formAllModel).mainId(mainId).link(linkEntity) + .userEntity(userEntity).concurrencyLock(concurrency).primaryKeyPolicy(primaryKeyPolicy).flowFormOperates(listFlowOperate).build(); + flowDataUtil.create(dataModel); + + //数据日志 + if (formData.isDataLog()) { + visualLogService.createEventLog(VisualLogForm.builder().modelId(visualdevEntity.getId()).dataId(dataModel.getMainId()).newData(map).type(0).build()); + } + } + + public DataModel update(VisualdevEntity visualdevEntity, FlowFormDataModel flowFormDataModel) throws WorkFlowException, SQLException, DataException { + Map map = flowFormDataModel.getMap(); + String id = flowFormDataModel.getId(); + List> listFlowOperate = flowFormDataModel.getFormOperates(); + FormDataModel formData = JsonUtil.getJsonToBean(visualdevEntity.getFormData(), FormDataModel.class); + List tableModels = JsonUtil.getJsonToList(visualdevEntity.getVisualTables(), TableModel.class); + TableModel mainT = tableModels.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + DbLinkEntity linkEntity = serviceUtil.getDbLink(visualdevEntity.getDbLinkId()); + List list = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + + //递归遍历模板 + RecursionForm recursionForm = new RecursionForm(list, tableModels); + List formAllModel = new ArrayList<>(); + FormCloumnUtil.recursionForm(recursionForm, formAllModel); + //是否开启并发锁 + Boolean isConcurrencyLock = false; + Integer primaryKeyPolicy = formData.getPrimaryKeyPolicy(); + if (formData.getConcurrencyLock()) { + if (map.get(TableFeildsEnum.VERSION.getField()) == null) { + map.put(TableFeildsEnum.VERSION.getField(), 0); + } else { + Object realId = id; + if (Objects.equals(primaryKeyPolicy, 2)) { + realId = Long.parseLong(id); + } + boolean version = flowDataUtil.getVersion(mainT.getTable(), linkEntity, map, realId); + if (!version) { + throw new WorkFlowException(MsgCode.VS405.get()); + } else { + Integer vs = Integer.valueOf(String.valueOf(map.get(TableFeildsEnum.VERSION.getField()))); + map.put(TableFeildsEnum.VERSION.getField(), vs + 1); + } + } + isConcurrencyLock = true; + } + + CheckFormModel checkFormModel = CheckFormModel.builder().formFieldList(list).dataMap(map).linkEntity(linkEntity).tableModelList(tableModels) + .visualdevEntity(visualdevEntity).id(id).isTransfer(flowFormDataModel.getIsTransfer()).build(); + String b = formCheckUtils.checkForm(checkFormModel); + if (StringUtil.isNotEmpty(b)) { + throw new WorkFlowException(b); + } + + //数据日志 + VisualdevModelDataInfoVO resOld = visualDevInfoService.getDetailsDataInfo(id, visualdevEntity, + OnlineInfoModel.builder().needRlationFiled(true).needSwap(false).formAllModel(formAllModel).build()); + Map oldData = JsonUtil.stringToMap(resOld.getData()); + + UserInfo userInfo = UserProvider.getUser(); + UserEntity userEntity = serviceUtil.getUserInfo(userInfo.getUserId()); + DataModel dataModel = DataModel.builder().visualId(visualdevEntity.getId()) + .dataNewMap(map).fieLdsModelList(list).formAllModel(formAllModel).tableModelList(tableModels).mainId(id).link(linkEntity) + .userEntity(userEntity).concurrencyLock(isConcurrencyLock).primaryKeyPolicy(primaryKeyPolicy).flowFormOperates(listFlowOperate) + .logicalDelete(formData.getLogicalDelete()).build(); + flowDataUtil.update(dataModel); + + VisualdevModelDataInfoVO res = visualDevInfoService.getDetailsDataInfo(id, visualdevEntity, + OnlineInfoModel.builder().needRlationFiled(true).needSwap(false).formAllModel(formAllModel).build()); + Map newData = JsonUtil.stringToMap(res.getData()); + VisualLogForm form = VisualLogForm.builder().modelId(visualdevEntity.getId()).dataId(id).oldData(oldData).newData(newData).type(1).build(); + + //处理变更字段信息-任务流程用 + List listLog = new ArrayList<>(); + visualLogService.addLog(form, listLog); + dataModel.setListLog(listLog); + //数据日志 + if (formData.isDataLog()) { + form.setListLog(listLog); + visualLogService.createEventLog(form); + } + return dataModel; + } + + public DataModel saveOrUpdate(VisualdevEntity visualdevEntity, FlowFormDataModel flowFormDataModel) throws WorkFlowException, SQLException, DataException { + List tableModels = JsonUtil.getJsonToList(visualdevEntity.getVisualTables(), TableModel.class); + TableModel mainT = tableModels.stream().filter(t -> t.getTypeId().equals("1")).findFirst().orElse(null); + DbLinkEntity linkEntity = serviceUtil.getDbLink(visualdevEntity.getDbLinkId()); + FormDataModel formDataModel = JsonUtil.getJsonToBean(visualdevEntity.getFormData(), FormDataModel.class); + boolean autoIncrement = Objects.equals(formDataModel.getPrimaryKeyPolicy(), 2); + String id = flowFormDataModel.getId(); + Object mainId = id; + if (autoIncrement) { + mainId = Long.parseLong(id); + } + SqlTable sqlTable = SqlTable.of(mainT.getTable()); + String realId = formCheckUtils.getCount(mainId, sqlTable, mainT, linkEntity); + + if (StringUtil.isNotEmpty(realId)) { + flowFormDataModel.setId(realId); + return this.update(visualdevEntity, flowFormDataModel); + } else { + this.create(visualdevEntity, flowFormDataModel); + } + return null; + } + + public Map info(VisualdevEntity visualdevEntity, String id) { + return flowDataUtil.getEditDataInfo(visualdevEntity, id, OnlineInfoModel.builder().build()); + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/util/onlineDevUtil/OnlineDatabaseUtils.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/util/onlineDevUtil/OnlineDatabaseUtils.java new file mode 100644 index 0000000..324e0f4 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/util/onlineDevUtil/OnlineDatabaseUtils.java @@ -0,0 +1,177 @@ +package com.yunzhupaas.onlinedev.util.onlineDevUtil; + +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONArray; +import com.yunzhupaas.database.model.dbfield.JdbcColumnModel; +import com.yunzhupaas.database.model.dto.PrepSqlDTO; +import com.yunzhupaas.database.model.entity.DbLinkEntity; +import com.yunzhupaas.database.util.JdbcUtil; +import com.yunzhupaas.onlinedev.model.OnlineDevListModel.OnlineColumnFieldModel; +import com.yunzhupaas.onlinedev.model.OnlineDevListModel.OnlineDevListDataVO; +import com.yunzhupaas.onlinedev.model.OnlineDevListModel.VisualColumnSearchVO; +import com.yunzhupaas.base.util.FormPublicUtils; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2021/7/28 + */ +public class OnlineDatabaseUtils { + public static List getTableDataList(DbLinkEntity dbLinkEntity, String sql, String pKeyName, + List childFieldList) { + List list = new ArrayList<>(); + try { + List> fieldMods = JdbcUtil + .queryJdbcColumns(new PrepSqlDTO(sql).withConn(dbLinkEntity)).setIsValue(true).get(); + List> dataList = new ArrayList<>(); + + for (List dblist : fieldMods) { + Map dataMap = new HashMap<>(); + HashMap collect = dblist.stream() + .collect(Collectors.toMap(s -> Optional.ofNullable(s.getField()).orElse(""), + s -> Optional.ofNullable(s.getValue()).orElse(""), (a, b) -> b, HashMap::new)); + dataMap.putAll(collect); + for (OnlineColumnFieldModel on : childFieldList) { + // 需要替换的子表字段 + JdbcColumnModel fieldMod = dblist.stream() + .filter(dbMod -> dbMod.getTable().equalsIgnoreCase(on.getTableName()) + && dbMod.getField().equalsIgnoreCase(on.getField())) + .findFirst().orElse(null); + // 将数据转成map格式 + if (ObjectUtil.isNotEmpty(fieldMod)) { + dataMap.remove(fieldMod.getField()); + dataMap.put(on.getOriginallyField(), fieldMod.getValue()); + } + } + dataList.add(dataMap); + } + + for (Map dataMap : dataList) { + OnlineDevListDataVO dataVo = new OnlineDevListDataVO(); + dataMap = toLowerKey(dataMap); + dataVo.setData(dataMap); + if (dataMap.containsKey(pKeyName.toUpperCase())) { + dataVo.setId(String.valueOf(dataMap.get(pKeyName.toUpperCase()))); + } + list.add(dataVo); + } + } catch (Exception e) { + e.printStackTrace(); + } + return list; + } + + public static Map toLowerKey(Map map) { + Map resultMap = new HashMap<>(16); + Set sets = map.keySet(); + for (String key : sets) { + resultMap.put(key.toLowerCase(), map.get(key)); + } + return resultMap; + } + + public static Boolean existKey(List feilds, String pKeyName) { + if (feilds.size() > 0) { + for (String feild : feilds) { + if (feild.equals(pKeyName)) { + return true; + } + } + } + return false; + } + + public static List setDataId(String keyName, List DevList) { + keyName = keyName.toLowerCase(); + for (OnlineDevListDataVO dataVo : DevList) { + Map dataMap = dataVo.getData(); + if (dataMap.get(keyName) != null) { + dataVo.setId(String.valueOf(dataMap.get(keyName))); + } + } + return DevList; + } + + public static List getValueList(List searchVOList) { + List valueList = new LinkedList<>(); + for (VisualColumnSearchVO vo : searchVOList) { + String yunzhupaasKey = vo.getConfig().getYunzhupaasKey(); + String format; + switch (yunzhupaasKey) { + case YunzhupaasKeyConsts.MODIFYTIME: + case YunzhupaasKeyConsts.CREATETIME: + case YunzhupaasKeyConsts.DATE: + JSONArray timeStampArray = (JSONArray) vo.getValue(); + Long o1 = (Long) timeStampArray.get(0); + Long o2 = (Long) timeStampArray.get(1); + format = StringUtil.isEmpty(vo.getFormat()) ? "yyyy-MM-dd HH:mm:ss" : vo.getFormat(); + // 时间戳转string格式 + String startTime = OnlinePublicUtils.getDateByFormat(o1, format); + String endTime = OnlinePublicUtils.getDateByFormat(o2, format); + // 处理时间查询条件范围 + endTime = endTime.substring(0, 10); + String firstTimeDate = OnlineDatabaseUtils.getTimeFormat(startTime); + String lastTimeDate = OnlineDatabaseUtils.getLastTimeFormat(endTime); + valueList.add(firstTimeDate); + valueList.add(lastTimeDate); + break; + case YunzhupaasKeyConsts.TIME: + JSONArray timeArray = (JSONArray) vo.getValue(); + String start = String.valueOf(timeArray.get(0)); + String end = String.valueOf(timeArray.get(1)); + valueList.add(start); + valueList.add(end); + break; + case YunzhupaasKeyConsts.NUM_INPUT: + case YunzhupaasKeyConsts.CALCULATE: + List searchArray = (List) vo.getValue(); + Integer firstValue = null; + Integer secondValue = null; + for (int i = 0; i < searchArray.size(); i++) { + String name = searchArray.get(i); + if (StringUtil.isNotEmpty(name)) { + if (i == 0) { + firstValue = Integer.valueOf(name); + } else { + secondValue = Integer.valueOf(name); + } + } + } + if (firstValue != null) { + valueList.add(firstValue); + } + if (secondValue != null) { + valueList.add(secondValue); + } + break; + default: + valueList.add(vo.getValue()); + break; + } + } + return valueList; + } + + /** + * 转换时间格式 + * + * @param time + * @return + */ + public static String getTimeFormat(String time) { + return FormPublicUtils.getTimeFormat(time); + } + + public static String getLastTimeFormat(String time) { + return FormPublicUtils.getLastTimeFormat(time); + } + +} diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/util/onlineDevUtil/OnlineDevInfoUtils.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/util/onlineDevUtil/OnlineDevInfoUtils.java new file mode 100644 index 0000000..09bcc41 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/util/onlineDevUtil/OnlineDevInfoUtils.java @@ -0,0 +1,728 @@ +package com.yunzhupaas.onlinedev.util.onlineDevUtil; + +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.model.datainterface.DataInterfaceActionVo; +import com.yunzhupaas.base.service.DataInterfaceService; +import com.yunzhupaas.base.service.DictionaryDataService; +import com.yunzhupaas.base.service.ProvinceService; +import com.yunzhupaas.base.service.VisualdevService; +import com.yunzhupaas.base.util.DateTimeFormatConstant; +import com.yunzhupaas.base.util.FormInfoUtils; +import com.yunzhupaas.base.util.FormPublicUtils; +import com.yunzhupaas.model.OnlineDevData; +import com.yunzhupaas.model.visualJson.FieLdsModel; +import com.yunzhupaas.model.visualJson.analysis.FormModel; +import com.yunzhupaas.onlinedev.model.OnlineDevEnum.MultipleControlEnum; +import com.yunzhupaas.onlinedev.model.OnlineDevEnum.OnlineDataTypeEnum; +import com.yunzhupaas.base.model.OnlineImport.VisualdevModelDataInfoVO; +import com.yunzhupaas.onlinedev.service.VisualDevInfoService; +import com.yunzhupaas.onlinedev.service.VisualdevModelDataService; +import com.yunzhupaas.permission.entity.*; +import com.yunzhupaas.permission.service.*; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.math.BigDecimal; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import static com.yunzhupaas.util.Constants.ADMIN_KEY; + +/** + * 在线详情编辑工具类 + * + * @author 云筑产品开发平台组 + * @version V3.2 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/10/27 + */ +@Slf4j +@Component +public class OnlineDevInfoUtils { + @Autowired + private RedisUtil redisUtil; + @Autowired + private DictionaryDataService dictionaryDataApi; + @Autowired + private UserService userApi; + @Autowired + private FormInfoUtils formInfoUtils; + @Autowired + private PositionService positionApi; + @Autowired + private OrganizeService organizeApi; + @Autowired + private VisualdevService visualdevService; + @Autowired + private VisualdevModelDataService visualdevModelDataService; + @Autowired + private DataInterfaceService dataInterFaceApi; + @Autowired + private VisualDevInfoService visualDevInfoService; + @Autowired + private ProvinceService areaApi; + @Autowired + private RoleService roleApi; + @Autowired + private GroupService groupApi; + + private Map nullDatamap = new HashMap<>(); + + /** + * 数据转换(不取缓存) + * + * @param modelList + * @param dataMap + * @return + */ + public Map swapChildTableDataInfo(List modelList, Map dataMap, + List codeList) { + Map dataCopyMap = new HashMap<>(); + dataCopyMap.putAll(dataMap); + + Map> dataDetailMap = new HashMap<>(); + try { + for (FieLdsModel swapDataVo : modelList) { + String yunzhupaasKey = swapDataVo.getConfig().getYunzhupaasKey(); + String dataType = swapDataVo.getConfig().getDataType(); + String vModel = swapDataVo.getVModel(); + Object val = dataMap.get(vModel); + String modelValue = String.valueOf(val); + if (StringUtil.isEmpty(modelValue) || "null".equals(modelValue)) { + continue; + } + if (dataType != null) { + // 数据接口的数据存放 + String label = swapDataVo.getProps() != null ? swapDataVo.getProps().getLabel() : ""; + String value = swapDataVo.getProps() != null ? swapDataVo.getProps().getValue() : ""; + String Children = swapDataVo.getProps() != null ? swapDataVo.getProps().getChildren() : ""; + List> options = new ArrayList<>(); + + if (dataType.equals(OnlineDataTypeEnum.STATIC.getType())) { + if (StringUtil.isNotEmpty(swapDataVo.getOptions())) { + options = JsonUtil.getJsonToListMap(swapDataVo.getOptions()); + + JSONArray data = JsonUtil.getListToJsonArray(options); + OnlineDevListUtils.getOptions(label, value, Children, data, options); + } else { + options = JsonUtil.getJsonToListMap(swapDataVo.getOptions()); + } + } + if (dataType.equals(OnlineDataTypeEnum.DYNAMIC.getType())) { + ActionResult data = dataInterFaceApi.infoToId(swapDataVo.getInterfaceId(), null, nullDatamap); + // api调用 序列化为linkedHashMap + LinkedHashMap>> actionVo = (LinkedHashMap>>) data + .getData(); + if (actionVo != null) { + List> dataList = actionVo.get("data"); + JSONArray dataAll = JsonUtil.getListToJsonArray(dataList); + treeToList(label, value, Children, dataAll, options); + } + } + if (dataType.equals(OnlineDataTypeEnum.DICTIONARY.getType())) { + List list = dictionaryDataApi + .getDicList(swapDataVo.getConfig().getDictionaryType()); + options = list.stream().map(dic -> { + Map dictionaryMap = new HashMap<>(16); + dictionaryMap.put("id", dic.getId()); + dictionaryMap.put("enCode", dic.getEnCode()); + dictionaryMap.put("fullName", dic.getFullName()); + return dictionaryMap; + }).collect(Collectors.toList()); + } + + Map dataInterfaceMap = new HashMap<>(16); + options.stream().forEach(o -> { + dataInterfaceMap.put(String.valueOf(o.get(value)), String.valueOf(o.get(label))); + }); + + List valueList = new ArrayList<>(); + if (OnlinePublicUtils.getMultiple(modelValue, + MultipleControlEnum.MULTIPLE_JSON_TWO.getMultipleChar())) { + String[][] data = JsonUtil.getJsonToBean(modelValue, String[][].class); + for (String[] casData : data) { + for (String s : casData) { + valueList.add(s); + } + } + } else if (OnlinePublicUtils.getMultiple(modelValue, + MultipleControlEnum.MULTIPLE_JSON_ONE.getMultipleChar())) { + valueList = JsonUtil.getJsonToList(modelValue, String.class); + } else { + valueList.add(modelValue); + } + String allValue = valueList.stream().map(va -> dataInterfaceMap.get(va)) + .collect(Collectors.joining(",")); + dataMap.put(vModel, allValue); + } else { + switch (yunzhupaasKey) { + // 公司组件 + case YunzhupaasKeyConsts.COMSELECT: + // 部门组件 + case YunzhupaasKeyConsts.DEPSELECT: + // 所属部门 + case YunzhupaasKeyConsts.CURRDEPT: + dataMap.put(vModel, getOrgValue(modelValue)); + break; + + // 所属组织 + case YunzhupaasKeyConsts.CURRORGANIZE: + boolean isAll = "all".equals(swapDataVo.getShowLevel()); + if (isAll) { + List organizeList = new ArrayList<>(); + organizeApi.getOrganizeId(modelValue, organizeList); + Collections.reverse(organizeList); + String value = organizeList.stream().map(OrganizeEntity::getFullName) + .collect(Collectors.joining("/")); + dataMap.put(vModel, value); + } else { + OrganizeEntity organizeEntity = organizeApi.getInfo(modelValue); + dataMap.put(vModel, + Objects.nonNull(organizeEntity) ? organizeEntity.getFullName() : modelValue); + } + break; + + // 岗位组件 + case YunzhupaasKeyConsts.POSSELECT: + // 所属岗位 + case YunzhupaasKeyConsts.CURRPOSITION: + dataMap.put(vModel, getPosValue(modelValue)); + break; + + // 用户组件 + case YunzhupaasKeyConsts.USERSELECT: + // 创建用户 + case YunzhupaasKeyConsts.CREATEUSER: + // 修改用户 + case YunzhupaasKeyConsts.MODIFYUSER: + if (ADMIN_KEY.equals(modelValue)) { + dataMap.put(vModel, "管理员"); + } else { + dataMap.put(vModel, getUserValue(modelValue)); + } + break; + + // 省市区联动 + case YunzhupaasKeyConsts.ADDRESS: + String value = String.valueOf(dataMap.get(vModel)); + if (OnlinePublicUtils.getMultiple(value, + MultipleControlEnum.MULTIPLE_JSON_TWO.getMultipleChar())) { + String[][] data = JsonUtil.getJsonToBean(value, String[][].class); + List addList = new ArrayList<>(); + for (String[] AddressData : data) { + List adList = new ArrayList<>(); + for (String s : AddressData) { + adList.add(s); + } + addList.add(String.join("/", areaApi.getProList(adList).stream() + .map(pro -> pro.getFullName()).collect(Collectors.toList()))); + } + dataMap.put(vModel, String.join(";", addList)); + } else { + List proDataS = JsonUtil.getJsonToList(value, String.class); + dataMap.put(vModel, String.join(",", areaApi.getProList(proDataS).stream() + .map(pro -> pro.getFullName()).collect(Collectors.toList()))); + } + break; + + case YunzhupaasKeyConsts.RELATIONFORM: + VisualdevEntity entity = visualdevService.getInfo(swapDataVo.getModelId()); + VisualdevModelDataInfoVO infoVO; + String keyId = String.valueOf(dataMap.get(vModel)); + Map formDataMap = new HashMap<>(16); + if (!StringUtil.isEmpty(entity.getVisualTables()) + && !OnlineDevData.TABLE_CONST.equals(entity.getVisualTables())) { + infoVO = visualDevInfoService.getDetailsDataInfo(keyId, entity); + } else { + infoVO = visualdevModelDataService.infoDataChange(keyId, entity); + } + formDataMap = JsonUtil.stringToMap(infoVO.getData()); + String relationField = swapDataVo.getRelationField(); + if (formDataMap != null && formDataMap.size() > 0) { + dataMap.put(vModel + "_id", dataMap.get(vModel)); + dataMap.put(vModel, formDataMap.get(relationField)); + dataDetailMap.put(vModel, formDataMap); + } + break; + + case YunzhupaasKeyConsts.POPUPSELECT: + ActionResult data = dataInterFaceApi.infoToId(swapDataVo.getInterfaceId(), null, + nullDatamap); + // api调用 序列化为linkedHashMap + LinkedHashMap>> actionVo = (LinkedHashMap>>) data + .getData(); + List> mapList = actionVo.get("data") != null ? actionVo.get("data") + : new ArrayList<>(); + Map PopMap = mapList.stream() + .filter(map -> map.get(swapDataVo.getPropsValue()).equals(dataMap.get(vModel))) + .findFirst().orElse(null); + if (PopMap.size() > 0) { + dataMap.put(vModel + "_id", dataMap.get(vModel)); + dataMap.put(vModel, PopMap.get(swapDataVo.getColumnOptions().get(0).getValue())); + dataDetailMap.put(vModel, PopMap); + } + break; + case YunzhupaasKeyConsts.POPUPTABLESELECT: + Object popData = dataInterFaceApi.infoToId(swapDataVo.getInterfaceId(), null, null) + .getData(); + DataInterfaceActionVo actionPo = (DataInterfaceActionVo) popData; + List> popMapList = new ArrayList<>(); + if (actionPo.getData() instanceof List) { + popMapList = (List>) actionPo.getData(); + } + String popValue = String.valueOf(dataMap.get(vModel)); + List idList = new ArrayList<>(); + if (popValue.contains("[")) { + idList = JsonUtil.getJsonToList(popValue, String.class); + } else { + idList.add(popValue); + } + List swapValue = new ArrayList<>(); + for (String id : idList) { + popMapList.stream().filter(map -> map.get(swapDataVo.getPropsValue()).equals(id)) + .forEach( + modelMap -> swapValue.add( + String.valueOf(modelMap.get(swapDataVo.getRelationField())))); + } + dataMap.put(vModel, swapValue.stream().collect(Collectors.joining(","))); + break; + case YunzhupaasKeyConsts.MODIFYTIME: + case YunzhupaasKeyConsts.CREATETIME: + case YunzhupaasKeyConsts.DATE: + // 判断是否为时间戳格式 + String format; + String dateData = String.valueOf(dataMap.get(vModel)); + String dateSwapInfo = swapDataVo.getFormat() != null ? swapDataVo.getFormat() + : swapDataVo.getType() != null + && swapDataVo.getType().equals(YunzhupaasKeyConsts.DATE) ? "yyyy-MM-dd" + : "yyyy-MM-dd HH:mm:ss"; + if (!dateData.contains("-") && !dateData.contains(":") && dateData.length() > 10) { + DateTimeFormatter ftf = DateTimeFormatter.ofPattern(dateSwapInfo); + format = ftf.format(LocalDateTime + .ofInstant(Instant.ofEpochMilli((Long) dataMap.get(vModel)), ZoneId.of("+8"))); + } else { + format = dateData; + } + if (format.contains(".")) { + format = format.substring(0, format.lastIndexOf(".")); + } + SimpleDateFormat sdf = new SimpleDateFormat(dateSwapInfo); + try { + Date date = sdf.parse(format); + String outTime = sdf.format(sdf.parse(DateUtil.dateFormat(date))); + dataMap.put(vModel, outTime); + } catch (ParseException e) { + e.printStackTrace(); + } + break; + + // 开关 滑块 + case YunzhupaasKeyConsts.SWITCH: + String switchValue = String.valueOf(dataMap.get(vModel)).equals("1") + ? swapDataVo.getActiveTxt() + : swapDataVo.getInactiveTxt(); + dataMap.put(vModel, switchValue); + break; + case YunzhupaasKeyConsts.RATE: + BigDecimal ratevalue = new BigDecimal(0); + if (dataMap.get(vModel) != null) { + ratevalue = new BigDecimal(dataMap.get(vModel).toString()); + } + dataMap.put(vModel, ratevalue); + break; + case YunzhupaasKeyConsts.SLIDER: + dataMap.put(vModel, + dataMap.get(vModel) != null ? Integer.parseInt(String.valueOf(dataMap.get(vModel))) + : null); + break; + + case YunzhupaasKeyConsts.UPLOADFZ: + case YunzhupaasKeyConsts.UPLOADIMG: + List> fileList = JsonUtil + .getJsonToListMap(String.valueOf(dataMap.get(vModel))); + dataMap.put(vModel, fileList); + break; + + default: + break; + } + } + } + // 转换二维码 + swapCodeDataInfo(codeList, dataMap, dataCopyMap); + // 关联选择属性 + if (dataDetailMap.size() > 0) { + getDataAttr(modelList, dataMap, dataDetailMap); + } + } catch (Exception e) { + e.printStackTrace(); + } + return dataMap; + } + + /** + * 转换数据格式(编辑页) + * + * @param modelList 控件 + * @param dataMap 数据 + * @return + */ + public Map swapDataInfoType(List modelList, Map dataMap) { + return formInfoUtils.swapDataInfoType(modelList, dataMap); + } + + /** + * 转换数据格式(编辑页) + * + * @param modelList 控件 + * @param dataMap 数据 + * @return + */ + public Map getInitLineData(List modelList, Map dataMap) { + for (FieLdsModel swapDataVo : modelList) { + String yunzhupaasKey = swapDataVo.getConfig().getYunzhupaasKey(); + String vModel = swapDataVo.getVModel(); + Object value = dataMap.get(vModel); + if (value == null || ObjectUtil.isEmpty(value)) { + continue; + } + switch (yunzhupaasKey) { + case YunzhupaasKeyConsts.RATE: + case YunzhupaasKeyConsts.SLIDER: + BigDecimal ratevalue = new BigDecimal(0); + if (dataMap.get(vModel) != null) { + ratevalue = new BigDecimal(dataMap.get(vModel).toString()); + } + dataMap.put(vModel, ratevalue); + break; + case YunzhupaasKeyConsts.UPLOADFZ: + case YunzhupaasKeyConsts.UPLOADIMG: + List> fileList = JsonUtil.getJsonToListMap(String.valueOf(value)); + dataMap.put(vModel, fileList); + break; + + case YunzhupaasKeyConsts.DATE: + Long dateTime = DateTimeFormatConstant.getDateObjToLong(dataMap.get(vModel)); + dataMap.put(vModel, dateTime != null ? dateTime : dataMap.get(vModel)); + break; + + case YunzhupaasKeyConsts.SWITCH: + dataMap.put(vModel, value != null ? Integer.parseInt(String.valueOf(value)) : null); + break; + // 系统自动生成控件 + case YunzhupaasKeyConsts.CURRORGANIZE: + case YunzhupaasKeyConsts.CURRDEPT: + // 多级组 + String orgIds = String.valueOf(dataMap.get(vModel)); + String orgId = ""; + String orgName = ""; + try { + List jsonToList = JsonUtil.getJsonToList(orgIds, String.class); + orgId = jsonToList.get(jsonToList.size() - 1); + } catch (Exception e) { + orgId = orgIds; + } + OrganizeEntity organizeEntity = StringUtil.isNotEmpty(orgId) ? organizeApi.getInfo(orgId) : null; + if ("all".equals(swapDataVo.getShowLevel())) { + if (organizeEntity != null) { + List organizeList = new ArrayList<>(); + organizeApi.getOrganizeId(orgId, organizeList); + Collections.reverse(organizeList); + orgName = organizeList.stream().map(OrganizeEntity::getFullName) + .collect(Collectors.joining("/")); + } + } else { + if (organizeEntity != null) { + orgName = organizeEntity.getFullName(); + } else { + orgName = " "; + } + } + dataMap.put(vModel, orgName); + break; + case YunzhupaasKeyConsts.CURRPOSITION: + PositionEntity positionEntity = positionApi.getInfo(String.valueOf(value)); + dataMap.put(vModel, Objects.nonNull(positionEntity) ? positionEntity.getFullName() : value); + break; + + case YunzhupaasKeyConsts.CREATEUSER: + case YunzhupaasKeyConsts.MODIFYUSER: + UserEntity userEntity = userApi.getInfo(String.valueOf(value)); + String userValue = Objects.nonNull(userEntity) + ? userEntity.getRealName() + "/" + userEntity.getAccount() + : String.valueOf(value); + dataMap.put(vModel, userValue); + break; + default: + dataMap.put(vModel, FormPublicUtils.getDataConversion(value)); + break; + } + } + return dataMap; + } + + /** + * 二维码 条形码详情数据 + * + * @param codeList 控件集合 + * @param swapDataMap 转换后的数据 + * @param dataMap 转换前 + * @return + */ + public static void swapCodeDataInfo(List codeList, Map swapDataMap, + Map dataMap) { + for (FormModel formModel : codeList) { + String yunzhupaasKey = formModel.getConfig().getYunzhupaasKey(); + if (yunzhupaasKey.equals(YunzhupaasKeyConsts.QR_CODE) + || yunzhupaasKey.equals(YunzhupaasKeyConsts.BARCODE)) { + String codeDataType = formModel.getDataType(); + if (OnlineDataTypeEnum.RELATION.getType().equals(codeDataType)) { + String relationFiled = formModel.getRelationField(); + if (StringUtil.isNotEmpty(relationFiled)) { + Object relationValue = dataMap.get(relationFiled); + if (ObjectUtil.isNotEmpty(relationValue)) { + swapDataMap.put(relationFiled + "_id", relationValue); + } + } + } + } + } + } + + private static void treeToList(String value, String label, String children, JSONArray data, + List> result) { + for (int i = 0; i < data.size(); i++) { + JSONObject ob = data.getJSONObject(i); + Map tree = new HashMap<>(16); + tree.put(value, String.valueOf(ob.get(value))); + tree.put(label, String.valueOf(ob.get(label))); + result.add(tree); + if (ob.get(children) != null) { + JSONArray childArray = ob.getJSONArray(children); + treeToList(value, label, children, childArray, result); + } + } + } + + /** + * 生成关联属性(弹窗选择属性,关联表单属性) + * + * @param fieLdsModelList + * @param dataMap + * @param dataDetailMap + */ + private static void getDataAttr(List fieLdsModelList, Map dataMap, + Map> dataDetailMap) { + for (FieLdsModel fieLdsModel : fieLdsModelList) { + String yunzhupaasKey = fieLdsModel.getConfig().getYunzhupaasKey(); + if (yunzhupaasKey.equals(YunzhupaasKeyConsts.RELATIONFORM_ATTR) + || yunzhupaasKey.equals(YunzhupaasKeyConsts.POPUPSELECT_ATTR)) { + String relationField = fieLdsModel.getRelationField(); + String showField = fieLdsModel.getShowField(); + Map formDataMap = dataDetailMap.get(relationField); + dataMap.put(relationField + "_" + showField, formDataMap.get(showField)); + } + } + } + + /** + * 转换组织 + * + * @param modelValue + * @return + */ + private String getOrgValue(String modelValue) { + String orgValue; + List valueList; + if (OnlinePublicUtils.getMultiple(modelValue, MultipleControlEnum.MULTIPLE_JSON_TWO.getMultipleChar())) { + String[][] prgArray = JsonUtil.getJsonToBean(modelValue, String[][].class); + List addList = new ArrayList<>(); + for (String[] prgData : prgArray) { + List adList = new ArrayList<>(); + for (String s : prgData) { + OrganizeEntity info = organizeApi.getInfo(s); + adList.add(Objects.nonNull(info) ? info.getFullName() : ""); + } + String porData = adList.stream().collect(Collectors.joining("/")); + addList.add(porData); + } + orgValue = String.join(";", addList); + } else { + if (OnlinePublicUtils.getMultiple(modelValue, MultipleControlEnum.MULTIPLE_JSON_ONE.getMultipleChar())) { + valueList = JsonUtil.getJsonToList(modelValue, String.class); + } else { + valueList = Stream.of(modelValue.split(",")).collect(Collectors.toList()); + } + String allValue = valueList.stream().map(va -> { + OrganizeEntity organizeEntity = organizeApi.getInfo(va); + return Objects.nonNull(organizeEntity) ? organizeEntity.getFullName() : va; + }).collect(Collectors.joining(",")); + orgValue = allValue; + } + return orgValue; + } + + /** + * 转换岗位 + * + * @param modelValue + * @return + */ + private String getPosValue(String modelValue) { + String posValue; + List valueList; + if (OnlinePublicUtils.getMultiple(modelValue, MultipleControlEnum.MULTIPLE_JSON_TWO.getMultipleChar())) { + String[][] prgArray = JsonUtil.getJsonToBean(modelValue, String[][].class); + List addList = new ArrayList<>(); + for (String[] prgData : prgArray) { + List adList = new ArrayList<>(); + for (String s : prgData) { + PositionEntity info = positionApi.getInfo(s); + adList.add(Objects.nonNull(info) ? info.getFullName() : ""); + } + String porData = adList.stream().collect(Collectors.joining("/")); + addList.add(porData); + } + posValue = String.join(";", addList); + } else { + if (OnlinePublicUtils.getMultiple(modelValue, MultipleControlEnum.MULTIPLE_JSON_ONE.getMultipleChar())) { + valueList = JsonUtil.getJsonToList(modelValue, String.class); + } else { + valueList = Stream.of(modelValue.split(",")).collect(Collectors.toList()); + } + String allValue = valueList.stream().map(va -> { + PositionEntity positionEntity = positionApi.getInfo(va); + return Objects.nonNull(positionEntity) ? positionEntity.getFullName() : va; + }).collect(Collectors.joining(",")); + posValue = allValue; + } + return posValue; + } + + /** + * 转换用户 + * + * @param modelValue + * @return + */ + private String getUserValue(String modelValue) { + String userValue; + List valueList; + if (OnlinePublicUtils.getMultiple(modelValue, MultipleControlEnum.MULTIPLE_JSON_TWO.getMultipleChar())) { + String[][] prgArray = JsonUtil.getJsonToBean(modelValue, String[][].class); + List addList = new ArrayList<>(); + for (String[] prgData : prgArray) { + List adList = new ArrayList<>(); + for (String s : prgData) { + UserEntity info = userApi.getInfo(s); + adList.add(Objects.nonNull(info) ? info.getRealName() + "/" + info.getAccount() : ""); + } + String porData = adList.stream().collect(Collectors.joining("/")); + addList.add(porData); + } + userValue = String.join(";", addList); + } else { + if (OnlinePublicUtils.getMultiple(modelValue, MultipleControlEnum.MULTIPLE_JSON_ONE.getMultipleChar())) { + valueList = JsonUtil.getJsonToList(modelValue, String.class); + } else { + valueList = Stream.of(modelValue.split(",")).collect(Collectors.toList()); + } + String allValue = valueList.stream().map(va -> { + UserEntity userEntity = userApi.getInfo(va); + return Objects.nonNull(userEntity) ? userEntity.getRealName() + "/" + userEntity.getAccount() : va; + }).collect(Collectors.joining(",")); + userValue = allValue; + } + return userValue; + } + + /** + * 转换角色 + * + * @param modelValue + * @return + */ + private String getRoleValue(String modelValue) { + String value; + List valueList; + if (OnlinePublicUtils.getMultiple(modelValue, MultipleControlEnum.MULTIPLE_JSON_TWO.getMultipleChar())) { + String[][] prgArray = JsonUtil.getJsonToBean(modelValue, String[][].class); + List addList = new ArrayList<>(); + for (String[] prgData : prgArray) { + List adList = new ArrayList<>(); + for (String s : prgData) { + RoleEntity info = roleApi.getInfo(s); + adList.add(Objects.nonNull(info) ? info.getFullName() : ""); + } + String porData = adList.stream().collect(Collectors.joining("/")); + addList.add(porData); + } + value = String.join(";", addList); + } else { + if (OnlinePublicUtils.getMultiple(modelValue, MultipleControlEnum.MULTIPLE_JSON_ONE.getMultipleChar())) { + valueList = JsonUtil.getJsonToList(modelValue, String.class); + } else { + valueList = Stream.of(modelValue.split(",")).collect(Collectors.toList()); + } + String allValue = valueList.stream().map(va -> { + RoleEntity userEntity = roleApi.getInfo(va); + return Objects.nonNull(userEntity) ? userEntity.getFullName() : va; + }).collect(Collectors.joining(",")); + value = allValue; + } + return value; + } + + /** + * 转换分组 + * + * @param modelValue + * @return + */ + private String getGroupValue(String modelValue) { + String value; + List valueList; + if (OnlinePublicUtils.getMultiple(modelValue, MultipleControlEnum.MULTIPLE_JSON_TWO.getMultipleChar())) { + String[][] prgArray = JsonUtil.getJsonToBean(modelValue, String[][].class); + List addList = new ArrayList<>(); + for (String[] prgData : prgArray) { + List adList = new ArrayList<>(); + for (String s : prgData) { + GroupEntity info = groupApi.getInfo(s); + adList.add(Objects.nonNull(info) ? info.getFullName() : ""); + } + String porData = adList.stream().collect(Collectors.joining("/")); + addList.add(porData); + } + value = String.join(";", addList); + } else { + if (OnlinePublicUtils.getMultiple(modelValue, MultipleControlEnum.MULTIPLE_JSON_ONE.getMultipleChar())) { + valueList = JsonUtil.getJsonToList(modelValue, String.class); + } else { + valueList = Stream.of(modelValue.split(",")).collect(Collectors.toList()); + } + String allValue = valueList.stream().map(va -> { + GroupEntity info = groupApi.getInfo(va); + return Objects.nonNull(info) ? info.getFullName() : va; + }).collect(Collectors.joining(",")); + value = allValue; + } + return value; + } + +} diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/util/onlineDevUtil/OnlineDevListUtils.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/util/onlineDevUtil/OnlineDevListUtils.java new file mode 100644 index 0000000..bb7a7c4 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/util/onlineDevUtil/OnlineDevListUtils.java @@ -0,0 +1,679 @@ +package com.yunzhupaas.onlinedev.util.onlineDevUtil; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.entity.ProvinceEntity; +import com.yunzhupaas.base.model.ColumnDataModel; +import com.yunzhupaas.base.model.datainterface.DataInterfaceActionVo; +import com.yunzhupaas.base.service.DataInterfaceService; +import com.yunzhupaas.base.service.DictionaryDataService; +import com.yunzhupaas.base.service.ProvinceService; +import com.yunzhupaas.base.service.VisualdevService; +import com.yunzhupaas.model.visualJson.FieLdsModel; +import com.yunzhupaas.onlinedev.model.OnlineDevEnum.MultipleControlEnum; +import com.yunzhupaas.onlinedev.model.OnlineDevEnum.OnlineDataTypeEnum; +import com.yunzhupaas.onlinedev.model.OnlineDevListModel.OnlineDevListDataVO; +import com.yunzhupaas.onlinedev.model.OnlineDevListModel.VisualColumnSearchVO; +import com.yunzhupaas.onlinedev.service.VisualDevInfoService; +import com.yunzhupaas.onlinedev.service.VisualdevModelDataService; +import com.yunzhupaas.permission.service.*; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.math.BigDecimal; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/7/28 + */ +@Slf4j +@Component +public class OnlineDevListUtils { + @Autowired + private RedisUtil redisUtil; + @Autowired + private DictionaryDataService dictionaryDataApi; + @Autowired + private UserService userApi; + @Autowired + private PositionService positionApi; + @Autowired + private OrganizeService organizeApi; + @Autowired + private VisualdevService visualdevService; + @Autowired + private VisualdevModelDataService visualdevModelDataService; + @Autowired + private DataInterfaceService dataInterFaceApi; + @Autowired + private VisualDevInfoService visualDevInfoService; + @Autowired + private ProvinceService areaApi; + @Autowired + private OnlineDevInfoUtils onlineDevInfoUtils; + + private Map nullDatamap = new HashMap<>(); + + /** + * 查询条件 + * + * @param list + * @param searchList + * @return + */ + public static List> getNoSwapList(List> list, + List searchList) { + List> resultList = new ArrayList<>(); + if (searchList == null) { + return list; + } + for (Map dataVo : list) { + int i = 0; + for (VisualColumnSearchVO vo : searchList) { + Object dataModel = dataVo.get(vo.getVModel()); + if (dataModel == null || ObjectUtil.isEmpty(dataModel)) { + continue; + } + // 多选框默认添加多选属性 + if (vo.getConfig().getYunzhupaasKey().equals(YunzhupaasKeyConsts.CHECKBOX) + || YunzhupaasKeyConsts.CASCADER.equals(vo.getConfig().getYunzhupaasKey())) { + vo.setMultiple(true); + } + if (vo.getSearchType().equals("1")) { + // 多选框筛选 + if (vo.getMultiple() != null && vo.getMultiple() == true) { + List asList; + if (String.valueOf(dataModel).contains("[")) { + asList = JsonUtil.getJsonToList(String.valueOf(dataModel), String.class); + } else { + String[] multipleList = String.valueOf(dataModel).split(","); + asList = Arrays.asList(multipleList); + } + boolean b = asList.stream().anyMatch(t -> vo.getValue().toString().contains(t)); + if (b) { + i++; + } + } else { + if (String.valueOf(vo.getValue()).equals(String.valueOf(dataModel))) { + i++; + } + } + } + if (vo.getSearchType().equals("2")) { + if (String.valueOf(dataModel).contains(String.valueOf(vo.getValue()))) { + i++; + } + } + if (vo.getSearchType().equals("3")) { + String key = vo.getConfig().getYunzhupaasKey(); + switch (key) { + case YunzhupaasKeyConsts.MODIFYTIME: + case YunzhupaasKeyConsts.CREATETIME: + JSONArray timeStampArray = (JSONArray) vo.getValue(); + Long o1 = (Long) timeStampArray.get(0); + Long o2 = (Long) timeStampArray.get(1); + + // 时间戳转string格式 + String startTime = DateUtil.daFormat(o1); + String endTime = DateUtil.daFormat(o2); + // 处理时间查询条件范围 + endTime = endTime.substring(0, 10); + String firstTimeDate = OnlineDatabaseUtils.getTimeFormat(startTime); + String lastTimeDate = OnlineDatabaseUtils.getLastTimeFormat(endTime); + + String value = String.valueOf(dataModel); + if (value.contains(".")) { + value = value.substring(0, value.lastIndexOf(".")); + } + // 只判断到日期 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + try { + boolean b = DateUtil.isEffectiveDate(sdf.parse(value), sdf.parse(firstTimeDate), + sdf.parse(lastTimeDate)); + if (b) { + i++; + } + } catch (ParseException e) { + e.printStackTrace(); + } + break; + case YunzhupaasKeyConsts.NUM_INPUT: + case YunzhupaasKeyConsts.CALCULATE: + Float firstValue = null; + Float secondValue = null; + JSONArray objects = (JSONArray) vo.getValue(); + for (int k = 0; k < objects.size(); k++) { + Object n = objects.get(k); + if (ObjectUtil.isNotEmpty(n)) { + if (k == 0) { + firstValue = Float.parseFloat(String.valueOf(n)); + } else { + secondValue = Float.parseFloat(String.valueOf(n)); + } + } + } + // 数据 + Float numValue = Float.parseFloat(String.valueOf(dataModel)); + + // 条件1,2组合的情况 + if (firstValue != null && secondValue == null) { + if (numValue >= firstValue) { + i++; + } + } + if (firstValue != null && secondValue != null) { + if (numValue >= firstValue && numValue <= secondValue) { + i++; + } + } + if (firstValue == null && secondValue != null) { + if (numValue <= secondValue) { + i++; + } + } + break; + case YunzhupaasKeyConsts.DATE: + String starTimeDates; + String endTimeDates; + if (dataModel == null) { + break; + } + // 时间戳 + if (!String.valueOf(vo.getValue()).contains(":") + && !String.valueOf(vo.getValue()).contains("-")) { + JSONArray DateTimeStampArray = (JSONArray) vo.getValue(); + Long d1 = (Long) DateTimeStampArray.get(0); + Long d2 = (Long) DateTimeStampArray.get(1); + long d1FirstTime = Long.parseLong(String.valueOf(d1)); + long d2LastTime = Long.parseLong(String.valueOf(d2)); + + // 时间戳转string格式 + starTimeDates = DateUtil.daFormat(d1FirstTime); + endTimeDates = DateUtil.daFormat(d2LastTime); + + } else { + // 时间字符串 + String[] keyArray = String.valueOf(vo.getValue()).split(","); + starTimeDates = keyArray[0]; + endTimeDates = keyArray[1]; + } + if (vo.getFormat() == null) { + starTimeDates = starTimeDates.substring(0, 10); + endTimeDates = endTimeDates.substring(0, 10); + } + starTimeDates = OnlineDatabaseUtils.getTimeFormat(starTimeDates); + endTimeDates = OnlineDatabaseUtils.getLastTimeFormat(endTimeDates); + + String dateValue = dataModel.toString(); + if (!dateValue.contains(":") && !dateValue.contains("-")) { + // 时间戳 + Long timeResult = (Long) dataModel; + dateValue = DateUtil.daFormat(timeResult); + } + if (dateValue.contains(".")) { + dateValue = dateValue.substring(0, dateValue.lastIndexOf(".")); + } + dateValue = OnlineDatabaseUtils.getTimeFormat(dateValue); + // 只判断到日期 + SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + try { + Boolean b = DateUtil.isEffectiveDate(sdfDate.parse(dateValue), + sdfDate.parse(starTimeDates), sdfDate.parse(endTimeDates)); + if (b) { + i++; + } + } catch (ParseException e) { + e.printStackTrace(); + } + break; + case YunzhupaasKeyConsts.TIME: + JSONArray timeArray = (JSONArray) vo.getValue(); + String start = String.valueOf(timeArray.get(0)); + String end = String.valueOf(timeArray.get(1)); + start = OnlineDatabaseUtils.getTimeFormat(start); + end = OnlineDatabaseUtils.getLastTimeFormat(end); + String timeValue = OnlineDatabaseUtils.getTimeFormat(String.valueOf(dataModel)); + SimpleDateFormat timeSim = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + try { + boolean b = DateUtil.isEffectiveDate(timeSim.parse(timeValue), timeSim.parse(start), + timeSim.parse(end)); + if (b) { + i++; + } + } catch (ParseException e) { + e.printStackTrace(); + } + break; + default: + break; + } + } + if (i == searchList.size()) { + resultList.add(dataVo); + } + } + } + return resultList; + } + + /** + * 取出列表所用到的 用户 组织 岗位的id + * + * @param list 数据 + * @param swapDataVoList 控件 + */ + public static void pageIdList(List list, List swapDataVoList, + Map localCache) { + Set userList = (Set) localCache.get("__user_list"); + Set orgList = (Set) localCache.get("__org_list"); + Set posList = (Set) localCache.get("__pos_list"); + Set AllOrgList = (Set) localCache.get("__allOrg_list"); + Set roleList = (Set) localCache.get("__role_list"); + for (FieLdsModel swapDataVo : swapDataVoList) { + String yunzhupaasKey = swapDataVo.getConfig().getYunzhupaasKey(); + String vModel = swapDataVo.getVModel(); + for (OnlineDevListDataVO listVo : list) { + Map dataMap = listVo.getData(); + if (StringUtil.isEmpty(String.valueOf(dataMap.get(vModel))) || dataMap.get(vModel) == null) { + continue; + } + if (String.valueOf(dataMap.get(vModel)).equals("[]") + || String.valueOf(dataMap.get(vModel)).equals("null")) { + continue; + } else { + switch (yunzhupaasKey) { + // 公司组件 + case YunzhupaasKeyConsts.COMSELECT: + // 部门组件 + case YunzhupaasKeyConsts.DEPSELECT: + // 所属部门 + case YunzhupaasKeyConsts.CURRDEPT: + // 所属公司 + case YunzhupaasKeyConsts.CURRORGANIZE: + if ("all".equals(swapDataVo.getShowLevel())) { + getIdInMethod(AllOrgList, dataMap.get(vModel)); + } else { + getIdInMethod(orgList, dataMap.get(vModel)); + } + break; + // 角色 + case YunzhupaasKeyConsts.ROLESELECT: + getIdInMethod(roleList, dataMap.get(vModel)); + break; + // 岗位组件 + case YunzhupaasKeyConsts.POSSELECT: + // 所属岗位 + case YunzhupaasKeyConsts.CURRPOSITION: + getIdInMethod(posList, dataMap.get(vModel)); + break; + + // 用户组件 + case YunzhupaasKeyConsts.USERSELECT: + // 创建用户 + case YunzhupaasKeyConsts.CREATEUSER: + // 修改用户 + case YunzhupaasKeyConsts.MODIFYUSER: + getIdInMethod(userList, dataMap.get(vModel)); + break; + default: + break; + } + } + } + } + } + + /** + * 存取对应id集合 + * + * @param idList + * @param modelData + * @return + */ + public static Collection getIdInMethod(Collection idList, Object modelData) { + if (OnlinePublicUtils.getMultiple(String.valueOf(modelData), + MultipleControlEnum.MULTIPLE_JSON_TWO.getMultipleChar())) { + String[][] data = JsonUtil.getJsonToBean(String.valueOf(modelData), String[][].class); + for (String[] AddressData : data) { + for (String s : AddressData) { + idList.add(s); + } + } + } else if (OnlinePublicUtils.getMultiple(String.valueOf(modelData), + MultipleControlEnum.MULTIPLE_JSON_ONE.getMultipleChar())) { + idList.addAll(JsonUtil.getJsonToList(String.valueOf(modelData), String.class)); + } else { + String[] modelDatas = String.valueOf(modelData).split(","); + for (int i = 0; i < modelDatas.length; i++) { + idList.add(modelDatas[i]); + } + } + return idList; + } + + /** + * 分组页面 + * + * @param realList + * @param columnDataModel + * @return + */ + public static List> groupData(List> realList, + ColumnDataModel columnDataModel) { + List> columnList = JsonUtil.getJsonToListMap(columnDataModel.getColumnList()); + String firstField; + String groupField = columnDataModel.getGroupField(); + List> collect = columnList.stream().filter(t -> "left".equals(t.get("fixed")) + && !String.valueOf(t.get("prop")).equals(columnDataModel.getGroupField())).collect(Collectors.toList()); + Map map = null; + if (CollectionUtil.isNotEmpty(collect)) { + map = collect.stream().filter(t -> !String.valueOf(t.get("prop")).equals(columnDataModel.getGroupField())) + .findFirst().orElse(null); + } else { + map = columnList.stream() + .filter(t -> !String.valueOf(t.get("prop")).equals(columnDataModel.getGroupField())).findFirst() + .orElse(null); + } + if (map == null) { + map = columnList.stream().filter(t -> String.valueOf(t.get("prop")).equals(columnDataModel.getGroupField())) + .findFirst().orElse(null); + } + firstField = String.valueOf(map.get("prop")); + + Map>> twoMap = new LinkedHashMap<>(16); + + for (Map realMap : realList) { + String value = String.valueOf(realMap.get(groupField)); + if (realMap.get(groupField) instanceof Double) { + value = realMap.get(groupField).toString().replaceAll(".0+?$", "").replaceAll("[.]$", ""); + } + boolean isKey = twoMap.get(value) != null; + if (isKey) { + List> maps = twoMap.get(value); + maps.add(realMap); + twoMap.put(value, maps); + } else { + List> childrenList = new ArrayList<>(); + childrenList.add(realMap); + twoMap.put(value, childrenList); + } + } + + List> resultList = new ArrayList<>(); + for (String key : twoMap.keySet()) { + Map thirdMap = new HashMap<>(16); + thirdMap.put(firstField, !key.equals("null") ? key : ""); + thirdMap.put("top", true); + thirdMap.put("id", RandomUtil.uuId()); + thirdMap.put("children", twoMap.get(key)); + resultList.add(thirdMap); + } + return resultList; + } + + /** + * 递归查询 + * + * @param label + * @param value + * @param Children + * @param data + * @param options + */ + public static void getOptions(String label, String value, String Children, JSONArray data, + List> options) { + for (int i = 0; i < data.size(); i++) { + JSONObject ob = data.getJSONObject(i); + Map tree = new HashMap<>(16); + tree.put(value, String.valueOf(ob.get(value))); + tree.put(label, String.valueOf(ob.get(label))); + options.add(tree); + if (ob.get(Children) != null) { + JSONArray childrenArray = ob.getJSONArray(Children); + getOptions(label, value, Children, childrenArray, options); + } + } + } + + /** + * 树形列表页面 + * + * @param realList + * @param columnDataModel + * @return + */ + public static List> treeListData(List> realList, + ColumnDataModel columnDataModel) { + String parentField = columnDataModel.getParentField() + "_id"; + String childField = columnDataModel.getSubField(); + for (int i = 0; i < realList.size(); i++) { + Map item = realList.get(i); + if ((item.get(parentField) != null && !StringUtil.isNotEmpty(item.get(parentField).toString())) + || (item.get(parentField) != null && !"[]".equals(item.get(parentField).toString()))) { + if (addChild(item, realList, parentField, childField) && realList.size() > 0) { + realList.remove(item); + i--; + } + } + } + return realList; + } + + /** + * 级联递归 + * + * @param value + * @param label + * @param children + * @param data + * @param result + */ + private static void treeToList(String value, String label, String children, JSONArray data, + List> result) { + for (int i = 0; i < data.size(); i++) { + JSONObject ob = data.getJSONObject(i); + Map tree = new HashMap<>(16); + tree.put(value, String.valueOf(ob.get(value))); + tree.put(label, String.valueOf(ob.get(label))); + result.add(tree); + if (ob.get(children) != null) { + JSONArray childArray = ob.getJSONArray(children); + treeToList(value, label, children, childArray, result); + } + } + } + + // 递归 + private static boolean addChild(Map node, List> list, String parentField, + String childField) { + + for (int i = 0; i < list.size(); i++) { + Map ele = list.get(i); + if (ele.get(childField).equals(node.get(parentField))) { + if (ele.get("children") == null) { + ele.put("children", new ArrayList<>()); + } + List> children = (List>) ele.get("children"); + children.add(node); + ele.put("children", children); + return true; + } + if (ele.get("children") != null) { + List> children = (List>) ele.get("children"); + if (addChild(node, children, parentField, childField)) { + return true; + } + } + } + return false; + } + + /** + * 保存需要转换的数据到redis(系统控件) + * + * @param swapDataVoList + */ + public void sysNeedSwapData(List swapDataVoList, String visualDevId, Map localCache) { + + // 公共数据 + String dsName = Optional.ofNullable(TenantHolder.getDatasourceId()).orElse(""); + + String redisKey; + try { + for (FieLdsModel swapDataVo : swapDataVoList) { + String yunzhupaasKey = swapDataVo.getConfig().getYunzhupaasKey(); + String dataType = swapDataVo.getConfig().getDataType(); + switch (yunzhupaasKey) { + // 省市区联动 + case YunzhupaasKeyConsts.ADDRESS: + redisKey = ""; + if (!redisUtil.exists("")) { + List provinceEntityList = new ArrayList<>(); + Map provinceMap = new HashMap<>(16); + provinceEntityList.stream().forEach(p -> provinceMap.put(p.getId(), p.getFullName())); + redisUtil.insert(redisKey, provinceMap, RedisUtil.CAHCEWEEK); + } + if (!localCache.containsKey(redisKey)) { + localCache.put(redisKey, redisUtil.getMap(redisKey)); + } + break; + default: + break; + } + if (dataType != null) { + // 数据接口的数据存放 + String label = swapDataVo.getProps().getLabel(); + String value = swapDataVo.getProps().getValue(); + String children = swapDataVo.getProps().getChildren(); + List> options = new ArrayList<>(); + Map dataInterfaceMap = new HashMap<>(16); + + // 静态数据 + if (dataType.equals(OnlineDataTypeEnum.STATIC.getType())) { + redisKey = String.format("%s-%s-%s", visualDevId, swapDataVo.getVModel(), + OnlineDataTypeEnum.STATIC.getType()); + if (!redisUtil.exists(redisKey)) { + if (swapDataVo.getOptions() != null) { + options = JsonUtil.getJsonToListMap(swapDataVo.getOptions()); + String Children = swapDataVo.getProps().getChildren(); + JSONArray data = JsonUtil.getListToJsonArray(options); + getOptions(label, value, Children, data, options); + } else { + options = JsonUtil.getJsonToListMap(swapDataVo.getOptions()); + } + options.stream().forEach(o -> { + dataInterfaceMap.put(String.valueOf(o.get(value)), String.valueOf(o.get(label))); + }); + String staticData = JsonUtil.getObjectToString(dataInterfaceMap); + redisUtil.insert(redisKey, staticData, 60 * 5); + if (!localCache.containsKey(redisKey)) { + localCache.put(redisKey, dataInterfaceMap); + } + } else { + if (!localCache.containsKey(redisKey)) { + String staticDataString = redisUtil.getString(redisKey).toString(); + localCache.put(redisKey, JsonUtil.stringToMap(staticDataString)); + } + } + } + // 远端数据 + if (dataType.equals(OnlineDataTypeEnum.DYNAMIC.getType())) { + redisKey = String.format("%s-%s-%s", dsName, OnlineDataTypeEnum.DYNAMIC.getType(), + swapDataVo.getConfig().getPropsUrl()); + String redisKey2 = String.format("%s-%s-%s-%s-%s-%s", dsName, + OnlineDataTypeEnum.DYNAMIC.getType(), swapDataVo.getConfig().getPropsUrl(), label, + value, children); + if (!redisUtil.exists(redisKey2)) { + ActionResult data = null; + if (!redisUtil.exists(redisKey)) { + data = dataInterFaceApi.infoToId(swapDataVo.getConfig().getPropsUrl(), null, null); + // 缓存接口全部数据 + redisUtil.insert(redisKey, JSONObject.toJSONString(data), 60 * 5); + } else { + data = JSONObject.parseObject(String.valueOf(redisUtil.getString(redisKey)), + ActionResult.class); + } + if (!localCache.containsKey(redisKey)) { + localCache.put(redisKey, data); + } + if (data != null && data.getData() != null) { + List> dataList = new ArrayList<>(); + if (data.getData() instanceof DataInterfaceActionVo) { + DataInterfaceActionVo actionVo = (DataInterfaceActionVo) data.getData(); + if (actionVo.getData() instanceof List) { + dataList = (List>) actionVo.getData(); + } + } else if (data.getData() instanceof List) { + dataList = (List>) data.getData(); + } + JSONArray dataAll = JsonUtil.getListToJsonArray(dataList); + treeToList(label, value, children, dataAll, options); + options.stream().forEach(o -> { + dataInterfaceMap.put(String.valueOf(o.get(value)), String.valueOf(o.get(label))); + }); + + // 缓存接口根据特定字段转换后的全部数据 + String dynamicData = JsonUtil.getObjectToString(dataInterfaceMap); + redisUtil.insert(redisKey2, dynamicData, 60 * 5); + localCache.put(redisKey2, dataInterfaceMap); + } + } else { + if (!localCache.containsKey(redisKey)) { + localCache.put(redisKey, JSONObject.parseObject( + String.valueOf(redisUtil.getString(redisKey)), ActionResult.class)); + } + if (!localCache.containsKey(redisKey2)) { + // 转成map格式 + String dynamicString = redisUtil.getString(redisKey2).toString(); + localCache.put(redisKey2, JsonUtil.stringToMap(dynamicString)); + } + } + } + // 数据字典 + if (dataType.equals(OnlineDataTypeEnum.DICTIONARY.getType())) { + redisKey = String.format("%s-%s-%s", dsName, OnlineDataTypeEnum.DICTIONARY.getType(), + swapDataVo.getConfig().getDictionaryType()); + if (!redisUtil.exists(redisKey)) { + List list = dictionaryDataApi + .getDicList(swapDataVo.getConfig().getDictionaryType()); + options = list.stream().map(dic -> { + Map dictionaryMap = new HashMap<>(16); + dictionaryMap.put("id", dic.getId()); + dictionaryMap.put("enCode", dic.getEnCode()); + dictionaryMap.put("fullName", dic.getFullName()); + return dictionaryMap; + }).collect(Collectors.toList()); + + String dictionaryData = JsonUtil.getObjectToString(options); + redisUtil.insert(redisKey, dictionaryData, 60 * 5); + localCache.put(redisKey, options); + } else { + if (!localCache.containsKey(redisKey)) { + String dictionaryStringData = redisUtil.getString(redisKey).toString(); + localCache.put(redisKey, JsonUtil.getJsonToListMap(dictionaryStringData)); + } + } + } + } + } + } catch (Exception e) { + log.error("在线开发转换数据异常:" + e.getMessage()); + e.printStackTrace(); + } + + } + +} diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/util/onlineDevUtil/OnlineExecutor.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/util/onlineDevUtil/OnlineExecutor.java new file mode 100644 index 0000000..3d25ef1 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/util/onlineDevUtil/OnlineExecutor.java @@ -0,0 +1,658 @@ +package com.yunzhupaas.onlinedev.util.onlineDevUtil; + +import com.alibaba.fastjson.JSONArray; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.entity.ProvinceEntity; +import com.yunzhupaas.base.model.datainterface.DataInterfaceModel; +import com.yunzhupaas.base.model.datainterface.DataInterfacePage; +import com.yunzhupaas.base.service.DataInterfaceService; +import com.yunzhupaas.base.service.DictionaryDataService; +import com.yunzhupaas.base.service.ProvinceService; +import com.yunzhupaas.model.visualJson.FieLdsModel; +import com.yunzhupaas.model.visualJson.TemplateJsonModel; +import com.yunzhupaas.onlinedev.model.OnlineDevEnum.CacheKeyEnum; +import com.yunzhupaas.onlinedev.model.OnlineDevEnum.OnlineDataTypeEnum; +import com.yunzhupaas.permission.service.*; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RedisUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.ThreadPoolExecutorUtil; +import com.yunzhupaas.util.data.DataSourceContextHolder; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import lombok.Data; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.nio.charset.StandardCharsets; +import java.util.*; +import java.util.concurrent.CountDownLatch; +import java.util.stream.Collectors; + +import static com.yunzhupaas.onlinedev.util.onlineDevUtil.OnlineSwapDataUtils.NEEDCACHE_REMOTE; + +/** + * 在线开发数据缓存获取,多线程 + * + * @author 云筑产品开发平台组 + * @version V3.5.x + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2023/12/19 + */ +@Component +@Slf4j +public class OnlineExecutor { + @Autowired + private RedisUtil redisUtil; + @Autowired + private UserService userApi; + @Autowired + private OrganizeService organizeApi; + @Autowired + private PositionService positionApi; + @Autowired + private RoleService roleApi; + @Autowired + private GroupService groupApi; + @Autowired + private ProvinceService areaApi; + @Autowired + private DictionaryDataService dictionaryDataApi; + @Autowired + private DataInterfaceService dataInterFaceApi; + + private String dsName = ""; + private static long DEFAULT_CACHE_TIME = OnlineSwapDataUtils.DEFAULT_CACHE_TIME; + private static final String KEY_USER = "user"; + private static final String KEY_ORG = "org"; + private static final String KEY_POS = "pos"; + private static final String KEY_ROLE = "role"; + private static final String KEY_GROUP = "group"; + private static final String KEY_PROVINCE = "province"; + private static final String KEY_POP = "pop"; + private static final String KEY_SELECT = "select"; + private static final String KEY_DATATYPE = "datatype"; + private static final String KEY_ORGTREE = "orgtree"; + + /** + * 遍历需要多线程缓存 + */ + public void executorRedis(Map localCache, List swapDataVoList, String visualDevId, + Boolean inlineEdit, + List> list, Map mainAndMast) { + dsName = Optional.ofNullable(DataSourceContextHolder.getDatasourceId()).orElse(""); + Map listExecutor = new HashMap<>(); + for (int x = 0; x < list.size(); x++) { + Map dataMap = list.get(x); + if (dataMap == null) { + continue; + } + for (FieLdsModel swapDataVo : swapDataVoList) { + String yunzhupaasKey = swapDataVo.getConfig().getYunzhupaasKey(); + if (StringUtil.isEmpty(swapDataVo.getVModel())) { + continue; + } + String swapVModel = swapDataVo.getVModel(); + String dataType = swapDataVo.getConfig().getDataType(); + String redisKey; + boolean needUser = false, needOrg = false, needPos = false, needRole = false, needGroup = false, + needProvince = false, needOrgTree = false; + + switch (yunzhupaasKey) { + // 用户组件 + case YunzhupaasKeyConsts.USERSELECT: + // 创建用户 + case YunzhupaasKeyConsts.CREATEUSER: + // 修改用户 + case YunzhupaasKeyConsts.MODIFYUSER: + needUser = true; + break; + // 公司组件 + case YunzhupaasKeyConsts.COMSELECT: + // 部门组件 + case YunzhupaasKeyConsts.DEPSELECT: + // 所属部门 + case YunzhupaasKeyConsts.CURRDEPT: + // 所属组织 + case YunzhupaasKeyConsts.CURRORGANIZE: + needOrg = true; + needOrgTree = true; + break; + // 岗位组件 + case YunzhupaasKeyConsts.POSSELECT: + // 所属岗位 + case YunzhupaasKeyConsts.CURRPOSITION: + needPos = true; + break; + // 角色选择 + case YunzhupaasKeyConsts.ROLESELECT: + needRole = true; + break; + // 分组选择 + case YunzhupaasKeyConsts.GROUPSELECT: + needGroup = true; + break; + // 用户选择组件 + case YunzhupaasKeyConsts.CUSTOMUSERSELECT: + needUser = needOrg = needPos = needGroup = needRole = true; + break; + // 省市区选择组件 + case YunzhupaasKeyConsts.ADDRESS: + needProvince = true; + break; + case YunzhupaasKeyConsts.POPUPSELECT: + case YunzhupaasKeyConsts.POPUPTABLESELECT: + List templateJsonModels = JsonUtil + .getJsonToList(swapDataVo.getTemplateJson(), TemplateJsonModel.class); + if (dataMap.get(swapVModel) == null) + continue; + String value = String.valueOf(dataMap.get(swapVModel)); + List listParam = new ArrayList<>(); + for (TemplateJsonModel templateJsonModel : templateJsonModels) { + String relationField = templateJsonModel.getRelationField(); + DataInterfaceModel dataInterfaceModel = JsonUtil.getJsonToBean(templateJsonModel, + DataInterfaceModel.class); + if (StringUtil.isEmpty(relationField)) { + listParam.add(dataInterfaceModel); + continue; + } + String obj = inlineEdit ? "" + : Optional.ofNullable(dataMap.get(relationField)).orElse("").toString(); + if (relationField.toLowerCase().contains(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX)) { + String childField = relationField.split("-")[1]; + obj = Optional.ofNullable(dataMap.get(childField)).orElse("").toString(); + } else if (mainAndMast != null) { + obj = Optional.ofNullable(mainAndMast.get(relationField)).orElse("").toString(); + } + dataInterfaceModel.setDefaultValue(obj); + listParam.add(dataInterfaceModel); + } + DataInterfacePage dataInterfacePage = new DataInterfacePage(); + dataInterfacePage.setParamList(listParam); + dataInterfacePage.setInterfaceId(swapDataVo.getInterfaceId()); + List ids = new ArrayList<>(); + if (value.startsWith("[")) { + ids = JsonUtil.getJsonToList(value, String.class); + } else { + ids.add(value); + } + dataInterfacePage.setIds(ids); + // 缓存Key 租户-远端数据-base64({id, params, ids}) + redisKey = String.format("%s-%s-%s-%s", dsName, OnlineDataTypeEnum.DYNAMIC.getType(), + swapDataVo.getInterfaceId(), + Base64.getEncoder().encodeToString(JsonUtil.getObjectToString(dataInterfacePage) + .getBytes(StandardCharsets.UTF_8))); + + if (!localCache.containsKey(redisKey)) { + dataInterfacePage.setPropsValue(swapDataVo.getPropsValue()); + dataInterfacePage.setRelationField(swapDataVo.getRelationField()); + listExecutor.putIfAbsent(redisKey, + new OnlineExecutorParam(redisKey, KEY_POP, swapDataVo.getInterfaceId(), + dataInterfacePage, swapDataVo.getConfig().getUseCache())); + } + break; + case YunzhupaasKeyConsts.CASCADER: + case YunzhupaasKeyConsts.RADIO: + case YunzhupaasKeyConsts.CHECKBOX: + case YunzhupaasKeyConsts.SELECT: + case YunzhupaasKeyConsts.TREESELECT: + // 动态 + List templateList = JsonUtil + .getJsonToList(swapDataVo.getConfig().getTemplateJson(), TemplateJsonModel.class); + if (templateList.size() > 0) { + Map paramMap = new HashMap<>(); + for (TemplateJsonModel templateJsonModel : templateList) { + String relationField = templateJsonModel.getRelationField(); + String Field = templateJsonModel.getField(); + String obj = inlineEdit ? "" + : Optional.ofNullable(dataMap.get(relationField)).orElse("").toString(); + if (StringUtil.isEmpty(relationField)) { + paramMap.put(Field, templateJsonModel.getDefaultValue()); + continue; + } + if (relationField.toLowerCase().contains(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX)) { + String childField = relationField.split("-")[1]; + obj = Optional.ofNullable(dataMap.get(childField)).orElse("").toString(); + } else if (mainAndMast != null) { + obj = Optional.ofNullable(mainAndMast.get(relationField)).orElse("").toString(); + } + paramMap.put(Field, obj); + } + // 缓存Key 租户-远端数据-id-base64({params}) + redisKey = String.format("%s-%s-%s-%s", dsName, OnlineDataTypeEnum.DYNAMIC.getType(), + swapDataVo.getConfig().getPropsUrl(), + Base64.getEncoder().encodeToString( + JsonUtil.getObjectToString(paramMap).getBytes(StandardCharsets.UTF_8))); + + if (!localCache.containsKey(redisKey)) { + listExecutor.putIfAbsent(redisKey, + new OnlineExecutorParam(redisKey, KEY_SELECT, + swapDataVo.getConfig().getPropsUrl(), paramMap, + swapDataVo.getConfig().getUseCache())); + } + } + break; + default: + break; + } + if (dataType != null) { + // 数据接口的数据存放 + String label = swapDataVo.getProps().getLabel() != null ? swapDataVo.getProps().getLabel() : ""; + String value = swapDataVo.getProps().getValue() != null ? swapDataVo.getProps().getValue() : ""; + String children = swapDataVo.getProps().getChildren() != null ? swapDataVo.getProps().getChildren() + : ""; + if (swapDataVo.getConfig().getYunzhupaasKey().equals(YunzhupaasKeyConsts.POPUPSELECT) + || swapDataVo.getConfig().getYunzhupaasKey().equals(YunzhupaasKeyConsts.POPUPTABLESELECT)) { + label = swapDataVo.getRelationField(); + value = swapDataVo.getPropsValue(); + } + // 静态数据 + if (dataType.equals(OnlineDataTypeEnum.STATIC.getType())) { + redisKey = String.format("%s-%s-%s", visualDevId, + swapDataVo.getConfig().getRelationTable() + swapDataVo.getVModel(), + OnlineDataTypeEnum.STATIC.getType()); + if (!localCache.containsKey(redisKey)) { + listExecutor.putIfAbsent(redisKey, + new OnlineExecutorParam(redisKey, KEY_DATATYPE, null, swapDataVo)); + } + } + // 远端数据 + if (dataType.equals(OnlineDataTypeEnum.DYNAMIC.getType())) { + // 联动状态下不做缓存, 具体查数据时做缓存 + boolean dynamicIsNeedCache = swapDataVo.getConfig().getTemplateJson().size() == 0; + if (dynamicIsNeedCache) { + redisKey = String.format("%s-%s-%s-%s-%s-%s", dsName, OnlineDataTypeEnum.DYNAMIC.getType(), + swapDataVo.getConfig().getPropsUrl(), value, label, children); + if (!localCache.containsKey(redisKey)) { + listExecutor.putIfAbsent(redisKey, new OnlineExecutorParam(redisKey, KEY_DATATYPE, null, + swapDataVo, swapDataVo.getConfig().getUseCache())); + } + } + } + // 数据字典 + if (dataType.equals(OnlineDataTypeEnum.DICTIONARY.getType())) { + redisKey = String.format("%s-%s-%s", dsName, OnlineDataTypeEnum.DICTIONARY.getType(), + swapDataVo.getConfig().getDictionaryType()); + if (!localCache.containsKey(redisKey)) { + listExecutor.putIfAbsent(redisKey, + new OnlineExecutorParam(redisKey, KEY_DATATYPE, null, swapDataVo)); + } + } + } + + if (needUser) { + // 人员 + redisKey = dsName + CacheKeyEnum.USER.getName(); + if (!localCache.containsKey(redisKey)) { + listExecutor.putIfAbsent(redisKey, new OnlineExecutorParam(redisKey, KEY_USER, null, null)); + } + } + if (needOrg) { + // 组织 + redisKey = dsName + CacheKeyEnum.ORG.getName(); + if (!localCache.containsKey(redisKey)) { + listExecutor.putIfAbsent(redisKey, new OnlineExecutorParam(redisKey, KEY_ORG, null, null)); + } + } + if (needPos) { + // 岗位 + redisKey = dsName + CacheKeyEnum.POS.getName(); + if (!localCache.containsKey(redisKey)) { + listExecutor.putIfAbsent(redisKey, new OnlineExecutorParam(redisKey, KEY_POS, null, null)); + } + } + if (needRole) { + // 角色 + redisKey = dsName + CacheKeyEnum.ROLE.getName(); + if (!localCache.containsKey(redisKey)) { + listExecutor.putIfAbsent(redisKey, new OnlineExecutorParam(redisKey, KEY_ROLE, null, null)); + } + } + if (needGroup) { + // 分组 + redisKey = dsName + CacheKeyEnum.GROUP.getName(); + if (!localCache.containsKey(redisKey)) { + listExecutor.putIfAbsent(redisKey, new OnlineExecutorParam(redisKey, KEY_GROUP, null, null)); + } + } + // 地区数据过大, 取消缓存 + /* + * if (needProvince) { + * //省市区 + * redisKey = String.format("%s-%s-%d", dsName, "province", 1); + * if (!localCache.containsKey(redisKey)) { + * listExecutor.putIfAbsent(redisKey, new OnlineExecutorParam(redisKey, + * KEY_PROVINCE, null, null)); + * } + * } + */ + if (needOrgTree) { + // 分组 + redisKey = dsName + CacheKeyEnum.ORGTREE.getName(); + if (!localCache.containsKey(redisKey)) { + listExecutor.putIfAbsent(redisKey, new OnlineExecutorParam(redisKey, KEY_ORGTREE, null, null)); + } + } + } + } + // 执行多线程方法 + if (!listExecutor.isEmpty()) { + this.execute(localCache, listExecutor); + } + } + + /** + * 执行多线程 + */ + private void execute(Map localCache, Map listExecutor) { + CountDownLatch countDownLatch = new CountDownLatch(listExecutor.size()); + for (String key : listExecutor.keySet()) { + OnlineExecutorParam item = listExecutor.get(key); + String redisKey = item.getRedisKey(); + ThreadPoolExecutorUtil.getExecutor().execute(() -> { + try { + switch (item.getType()) { + case KEY_USER: + // 人员 + Map userMap; + if (redisUtil.exists(redisKey)) { + userMap = redisUtil.getMap(redisKey); + userMap = Optional.ofNullable(userMap).orElse(new HashMap<>(20)); + } else { + userMap = userApi.getUserMap(); + if (OnlineSwapDataUtils.NEEDCACHE_SYS) { + redisUtil.insert(redisKey, userMap, DEFAULT_CACHE_TIME); + } + } + localCache.put("__user_map", userMap); + break; + case KEY_ORG: + Map orgMap; + if (redisUtil.exists(redisKey)) { + orgMap = redisUtil.getMap(redisKey); + orgMap = Optional.ofNullable(orgMap).orElse(new HashMap<>(20)); + } else { + orgMap = organizeApi.getOrgMap(); + if (OnlineSwapDataUtils.NEEDCACHE_SYS) { + redisUtil.insert(redisKey, orgMap, DEFAULT_CACHE_TIME); + } + } + localCache.put("__org_map", orgMap); + break; + case KEY_POS: + Map posMap; + if (redisUtil.exists(redisKey)) { + posMap = redisUtil.getMap(redisKey); + posMap = Optional.ofNullable(posMap).orElse(new HashMap<>(20)); + } else { + posMap = positionApi.getPosMap(); + if (OnlineSwapDataUtils.NEEDCACHE_SYS) { + redisUtil.insert(redisKey, posMap, DEFAULT_CACHE_TIME); + } + } + localCache.put("__pos_map", posMap); + break; + case KEY_ROLE: + Map roleMap; + if (redisUtil.exists(redisKey)) { + roleMap = redisUtil.getMap(redisKey); + roleMap = Optional.ofNullable(roleMap).orElse(new HashMap<>(20)); + } else { + roleMap = roleApi.getRoleMap(); + if (OnlineSwapDataUtils.NEEDCACHE_SYS) { + redisUtil.insert(redisKey, roleMap, DEFAULT_CACHE_TIME); + } + } + localCache.put("__role_map", roleMap); + break; + case KEY_GROUP: + Map groupMap; + if (redisUtil.exists(redisKey)) { + groupMap = redisUtil.getMap(redisKey); + groupMap = Optional.ofNullable(groupMap).orElse(new HashMap<>(20)); + } else { + groupMap = groupApi.getGroupMap(); + if (OnlineSwapDataUtils.NEEDCACHE_SYS) { + redisUtil.insert(redisKey, groupMap, DEFAULT_CACHE_TIME); + } + } + localCache.put("__group_map", groupMap); + break; + case KEY_PROVINCE: + // 省市区 + Map proMap = redisUtil.getMap(redisKey); + List> proMapList = new ArrayList<>(); + if (proMap.size() == 0) { + // 分级存储 + for (int i = 1; i <= 4; i++) { + String redisKeyEach = String.format("%s-%s-%d", dsName, "province", i); + if (!redisUtil.exists(redisKeyEach)) { + List provinceEntityList = areaApi + .getProListBytype(String.valueOf(i)); + Map provinceMap = new HashMap<>(16); + if (provinceEntityList != null) { + provinceEntityList.stream() + .forEach(p -> provinceMap.put(p.getId(), p.getFullName())); + } + proMapList.add(provinceMap); + // 区划基本不修改 不做是否缓存判断 + redisUtil.insert(redisKeyEach, provinceMap, RedisUtil.CAHCEWEEK); + } + } + } else { + for (int i = 1; i <= 4; i++) { + proMapList.add(redisUtil.getMap(String.format("%s-%s-%d", dsName, "province", i))); + } + } + localCache.put("__pro_maplist", proMapList); + break; + case KEY_POP: + List> mapList = null; + if (!redisUtil.exists(redisKey)) { + mapList = dataInterFaceApi.infoToInfo(item.getInterfaceId(), + (DataInterfacePage) item.getParam()); + if (NEEDCACHE_REMOTE && mapList != null && mapList.size() > 0 && item.getUseCache()) { + redisUtil.insert(item.getRedisKey(), mapList, DEFAULT_CACHE_TIME); + } + } else { + List tmpList = redisUtil.get(redisKey, 0, -1); + List> tmpMapList = new ArrayList<>(); + tmpList.forEach(itemx -> { + tmpMapList.add(JsonUtil.entityToMap(itemx)); + }); + mapList = tmpMapList; + } + localCache.put(item.getRedisKey(), mapList); + break; + case KEY_SELECT: + List> dataList = null; + if (!redisUtil.exists(redisKey)) { + ActionResult data = dataInterFaceApi.infoToId(item.getInterfaceId(), null, + (Map) item.getParam()); + if (data != null && data.getData() != null) { + if (data.getData() instanceof List) { + dataList = (List>) data.getData(); + if (NEEDCACHE_REMOTE && CollectionUtils.isNotEmpty(dataList) + && item.getUseCache()) { + redisUtil.insert(redisKey, dataList, DEFAULT_CACHE_TIME); + } + } + } + } else { + List tmpList = redisUtil.get(redisKey, 0, -1); + List> tmpMapList = new ArrayList<>(); + tmpList.forEach(itemx -> { + tmpMapList.add(JsonUtil.entityToMap(itemx)); + }); + dataList = tmpMapList; + } + localCache.put(redisKey, dataList); + break; + case KEY_DATATYPE: + // 数据接口的数据存放 + FieLdsModel swapDataVo = (FieLdsModel) item.getParam(); + String dataType = swapDataVo.getConfig().getDataType(); + String label = swapDataVo.getProps().getLabel() != null ? swapDataVo.getProps().getLabel() + : ""; + String value = swapDataVo.getProps().getValue() != null ? swapDataVo.getProps().getValue() + : ""; + String children = swapDataVo.getProps().getChildren() != null + ? swapDataVo.getProps().getChildren() + : ""; + List> options = new ArrayList<>(); + if (swapDataVo.getConfig().getYunzhupaasKey().equals(YunzhupaasKeyConsts.POPUPSELECT) + || swapDataVo.getConfig().getYunzhupaasKey() + .equals(YunzhupaasKeyConsts.POPUPTABLESELECT)) { + label = swapDataVo.getRelationField(); + value = swapDataVo.getPropsValue(); + } + Map dataInterfaceMap = new HashMap<>(16); + String finalValue = value; + String finalLabel = label; + // 静态数据 + if (dataType.equals(OnlineDataTypeEnum.STATIC.getType())) { + if (!localCache.containsKey(redisKey)) { + if (!redisUtil.exists(redisKey)) { + if (swapDataVo.getOptions() != null) { + options = JsonUtil.getJsonToListMap(swapDataVo.getOptions()); + OnlineSwapDataUtils.getOptions(label, value, children, + JsonUtil.getListToJsonArray(options), options); + } else { + options = JsonUtil.getJsonToListMap(swapDataVo.getOptions()); + } + + options.stream().forEach(o -> { + dataInterfaceMap.put(String.valueOf(o.get(finalValue)), + String.valueOf(o.get(finalLabel))); + }); + if (NEEDCACHE_REMOTE) { + redisUtil.insert(redisKey, dataInterfaceMap, DEFAULT_CACHE_TIME); + } + localCache.put(redisKey, dataInterfaceMap); + } else { + localCache.put(redisKey, redisUtil.getMap(redisKey)); + } + } + } + // 远端数据 + if (dataType.equals(OnlineDataTypeEnum.DYNAMIC.getType())) { + // 联动状态下不做缓存, 具体查数据时做缓存 + boolean dynamicIsNeedCache = swapDataVo.getConfig().getTemplateJson().size() == 0; + if (dynamicIsNeedCache) { + if (!localCache.containsKey(redisKey)) { + if (!redisUtil.exists(redisKey)) { + ActionResult dataRes = dataInterFaceApi + .infoToId(swapDataVo.getConfig().getPropsUrl(), null, null); + if (dataRes != null && dataRes.getData() != null) { + List> dataList2 = new ArrayList<>(); + if (dataRes.getData() instanceof List) { + dataList2 = (List>) dataRes.getData(); + } + JSONArray dataAll = JsonUtil.getListToJsonArray(dataList2); + OnlineSwapDataUtils.treeToList(label, value, children, dataAll, + options); + options.stream().forEach(o -> { + dataInterfaceMap.put(String.valueOf(o.get(finalValue)), + String.valueOf(o.get(finalLabel))); + }); + if (NEEDCACHE_REMOTE && CollectionUtils.isNotEmpty(dataList2) + && item.getUseCache()) { + redisUtil.insert(redisKey, dataInterfaceMap, DEFAULT_CACHE_TIME); + } + localCache.put(redisKey, dataInterfaceMap); + } + } else { + localCache.put(redisKey, redisUtil.getMap(redisKey)); + } + } + } + } + // 数据字典 + if (dataType.equals(OnlineDataTypeEnum.DICTIONARY.getType())) { + if (!localCache.containsKey(redisKey)) { + if (!redisUtil.exists(redisKey)) { + List list = dictionaryDataApi + .getDicList(swapDataVo.getConfig().getDictionaryType()); + options = list.stream().map(dic -> { + Map dictionaryMap = new HashMap<>(16); + dictionaryMap.put("id", dic.getId()); + dictionaryMap.put("enCode", dic.getEnCode()); + dictionaryMap.put("fullName", dic.getFullName()); + return dictionaryMap; + }).collect(Collectors.toList()); + String dictionaryData = JsonUtil.getObjectToString(options); + if (NEEDCACHE_REMOTE) { + redisUtil.insert(redisKey, dictionaryData, DEFAULT_CACHE_TIME); + } + localCache.put(redisKey, options); + } else { + String dictionaryStringData = redisUtil.getString(redisKey).toString(); + localCache.put(redisKey, JsonUtil.getJsonToListMap(dictionaryStringData)); + } + } + } + break; + case KEY_ORGTREE: + Map orgTree; + if (redisUtil.exists(redisKey)) { + orgTree = redisUtil.getMap(redisKey); + orgTree = Optional.ofNullable(orgTree).orElse(new HashMap<>(20)); + } else { + orgTree = organizeApi.getAllOrgsTreeName(); + if (OnlineSwapDataUtils.NEEDCACHE_SYS) { + redisUtil.insert(redisKey, orgTree, DEFAULT_CACHE_TIME); + } + } + localCache.put("__orgTree_map", orgTree); + break; + default: + break; + } + } catch (Exception e) { + log.error("线程执行错误:" + e.getMessage()); + // e.printStackTrace(); + } finally { + // 每执行一次数值减少一 + countDownLatch.countDown(); + // 也可以给await()设置超时时间,如果超过300s(也可以是时,分)则不再等待,直接执行下面代码。 + // countDownLatch.await(300,TimeUnit.SECONDS); + } + }); + } + + try { + // 等待计数器归零 + countDownLatch.await(); + } catch (InterruptedException e) { + log.error("线程计数错误:" + e.getMessage()); + // e.printStackTrace(); + } + } +} + +@Data +class OnlineExecutorParam { + private String redisKey; + private String type; + private String interfaceId; + private Object param; + private Boolean useCache; + + public OnlineExecutorParam(String redisKey, String type, String interfaceId, Object param) { + this.redisKey = redisKey; + this.type = type; + this.interfaceId = interfaceId; + this.param = param; + this.useCache = false; + } + + public OnlineExecutorParam(String redisKey, String type, String interfaceId, Object param, Boolean useCache) { + this.redisKey = redisKey; + this.type = type; + this.interfaceId = interfaceId; + this.param = param; + this.useCache = useCache; + } +} diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/util/onlineDevUtil/OnlineProductSqlUtils.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/util/onlineDevUtil/OnlineProductSqlUtils.java new file mode 100644 index 0000000..e5a7ed9 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/util/onlineDevUtil/OnlineProductSqlUtils.java @@ -0,0 +1,1344 @@ +package com.yunzhupaas.onlinedev.util.onlineDevUtil; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.model.ColumnDataModel; +import com.yunzhupaas.base.model.Template6.ColumnListField; +import com.yunzhupaas.base.model.VisualDevJsonModel; +import com.yunzhupaas.base.util.DateTimeFormatConstant; +import com.yunzhupaas.base.util.FlowFormDataUtil; +import com.yunzhupaas.constant.PermissionConst; +import com.yunzhupaas.database.model.entity.DbLinkEntity; +import com.yunzhupaas.database.model.superQuery.SuperJsonModel; +import com.yunzhupaas.database.model.superQuery.SuperQueryJsonModel; +import com.yunzhupaas.database.util.ConnUtil; +import com.yunzhupaas.database.util.DbTypeUtil; +import com.yunzhupaas.database.util.DynamicDataSourceUtil; +import com.yunzhupaas.emnus.SearchMethodEnum; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.model.visualJson.FieLdsModel; +import com.yunzhupaas.model.visualJson.TableModel; +import com.yunzhupaas.model.visualJson.analysis.FormAllModel; +import com.yunzhupaas.model.visualJson.analysis.FormColumnModel; +import com.yunzhupaas.model.visualJson.analysis.FormEnum; +import com.yunzhupaas.model.visualJson.config.ConfigModel; +import com.yunzhupaas.model.visualJson.config.TabConfigModel; +import com.yunzhupaas.onlinedev.model.OnlineDevListModel.OnlineColumnChildFieldModel; +import com.yunzhupaas.onlinedev.model.OnlineDevListModel.OnlineColumnFieldModel; +import com.yunzhupaas.onlinedev.model.OnlineDevListModel.VisualColumnSearchVO; +import com.yunzhupaas.onlinedev.model.PaginationModel; +import com.yunzhupaas.permission.entity.OrganizeEntity; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.entity.UserRelationEntity; +import com.yunzhupaas.permission.model.authorize.AuthorizeConditionEnum; +import com.yunzhupaas.permission.model.authorize.OnlineDynamicSqlModel; +import com.yunzhupaas.permission.service.*; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.context.RequestContext; +import com.yunzhupaas.util.context.SpringContext; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import lombok.Cleanup; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.mybatis.dynamic.sql.*; +import org.mybatis.dynamic.sql.select.QueryExpressionDSL; +import org.mybatis.dynamic.sql.select.SelectModel; + +import java.math.BigDecimal; +import java.sql.Connection; +import java.sql.SQLException; +import java.text.DecimalFormat; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 生成在线sql语句 + * + * @author 云筑产品开发平台组 + * @version V3.2.8 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/11/8 + */ +public class OnlineProductSqlUtils { + private static FlowFormDataUtil flowDataUtil = SpringContext.getBean(FlowFormDataUtil.class); + private static UserService userApi = SpringContext.getBean(UserService.class); + private static UserRelationService userRelationApi = SpringContext.getBean(UserRelationService.class); + private static OrganizeService organizeApi = SpringContext.getBean(OrganizeService.class); + private static AuthorizeService authorizeUtil = SpringContext.getBean(AuthorizeService.class); + private static OrganizeAdministratorService organizeAdminTratorApi = SpringContext + .getBean(OrganizeAdministratorService.class); + + /** + * 生成列表查询sql + * + * @param sqlModels + * @param visualDevJsonModel + * @param columnFieldList + * @param linkEntity + * @return + */ + public static void getColumnListSql(List sqlModels, VisualDevJsonModel visualDevJsonModel, + List columnFieldList, DbLinkEntity linkEntity) { + List childFieldList; + try { + columnFieldList = columnFieldList.stream().distinct().collect(Collectors.toList()); + ColumnDataModel columnData = visualDevJsonModel.getColumnData(); + List modelList = JsonUtil.getJsonToList(columnData.getColumnList(), ColumnListField.class); + + @Cleanup + Connection conn = ConnUtil.getConnOrDefault(linkEntity); + List tableModelList = visualDevJsonModel.getVisualTables(); + String databaseProductName = conn.getMetaData().getDatabaseProductName().trim(); + boolean isClobDbType = DbTypeUtil.needToUpperCase(databaseProductName); + // 主表 + TableModel mainTable = tableModelList.stream().filter(model -> model.getTypeId().equals("1")).findFirst() + .orElse(null); + // 获取主键 + String pKeyName = flowDataUtil.getKey(mainTable, databaseProductName); + // 列表中区别子表正则 + String reg = "^[yunzhupaas_]\\S*_yunzhupaas\\S*"; + + // 列表主表字段 + List mainTableFields = columnFieldList.stream() + .filter(s -> !s.matches(reg) && !s.toLowerCase().contains(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX)) + .collect(Collectors.toList()); + mainTableFields.add(pKeyName); + for (TableModel tableModel : tableModelList) { + String relationField = tableModel.getRelationField(); + if (StringUtil.isNotEmpty(relationField) && !mainTableFields.contains(relationField)) { + mainTableFields.add(relationField); + } + } + + if (visualDevJsonModel.getFormData().getConcurrencyLock()) { + mainTableFields.add(TableFeildsEnum.VERSION.getField()); + } + String flowidField = TableFeildsEnum.FLOWID.getField(); + String flowTaskId = TableFeildsEnum.FLOWTASKID.getField(); + if (isClobDbType) { + flowidField = TableFeildsEnum.FLOWID.getField().toUpperCase(); + flowTaskId = TableFeildsEnum.FLOWTASKID.getField().toUpperCase(); + } + mainTableFields.add(flowidField); + mainTableFields.add(flowTaskId); + + if (columnData != null && ObjectUtil.isNotEmpty(columnData.getType()) && columnData.getType() == 3) { + String groupField = visualDevJsonModel.getColumnData().getGroupField(); + boolean contains = columnFieldList.contains(groupField); + if (!contains) { + if (groupField.startsWith("yunzhupaas_")) { + columnFieldList.add(groupField); + } else { + mainTableFields.add(groupField); + } + } + } + + // 列表子表字段 + childFieldList = columnFieldList.stream().filter(s -> s.matches(reg)).map(child -> { + OnlineColumnFieldModel fieldModel = new OnlineColumnFieldModel(); + String s1 = child.substring(child.lastIndexOf("yunzhupaas_")).replace("yunzhupaas_", ""); + String s2 = child.substring(child.indexOf("_") + 1, child.lastIndexOf("_yunzhupaas")); + fieldModel.setTableName(s2); + fieldModel.setField(s1); + fieldModel.setOriginallyField(child); + return fieldModel; + }).collect(Collectors.toList()); + + // 取列表用到的表 + List ColumnTableNameList = childFieldList.stream().map(t -> t.getTableName().toLowerCase()) + .collect(Collectors.toList()); + List tableModelList1 = tableModelList.stream() + .filter(t -> ColumnTableNameList.contains(t.getTable().toLowerCase())).collect(Collectors.toList()); + List classifyFieldList = new ArrayList<>(10); + for (TableModel t : tableModelList1) { + OnlineColumnChildFieldModel childFieldModel = new OnlineColumnChildFieldModel(); + childFieldModel.setTable(t.getTable()); + childFieldModel.setRelationField(t.getRelationField()); + childFieldModel.setTableField(t.getTableField()); + classifyFieldList.add(childFieldModel); + } + + for (OnlineDynamicSqlModel dycModel : sqlModels) { + if (dycModel.isMain()) { + List mainSqlColumns = getBasicColumns(mainTableFields, sqlModels, dycModel, modelList, + isClobDbType); + dycModel.setColumns(mainSqlColumns); + } else { + if (classifyFieldList.size() > 0) { + Map> mastTableCols = childFieldList.stream() + .collect(Collectors.groupingBy(OnlineColumnFieldModel::getTableName)); + List onlineColumnFieldModels = Optional + .ofNullable(mastTableCols.get(dycModel.getTableName())).orElse(new ArrayList<>()); + List mastSqlCols = getBasicColumnsChild(modelList, dycModel, + onlineColumnFieldModels, isClobDbType); + dycModel.setColumns(mastSqlCols); + } + } + } + } catch (SQLException sqlException) { + sqlException.printStackTrace(); + } catch (DataException e) { + e.printStackTrace(); + } + } + + public static List getGroupBySqlTable(List sqlModels, + VisualDevJsonModel visualDevJsonModel, + List columnFieldList, boolean isClobDbType) { + List childFieldList; + List basicColumns = new ArrayList<>(); + try { + columnFieldList = columnFieldList.stream().distinct().collect(Collectors.toList()); + + List tableModelList = visualDevJsonModel.getVisualTables(); + + // 列表中区别子表正则 + String reg = "^[yunzhupaas_]\\S*_yunzhupaas\\S*"; + + // 列表主表字段 + List mainTableFields = columnFieldList.stream().filter(s -> !s.matches(reg) + && !s.toLowerCase().contains(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX)).collect(Collectors.toList()); + + if (visualDevJsonModel.getFormData().getConcurrencyLock()) { + mainTableFields.add(TableFeildsEnum.VERSION.getField()); + } + + String flowidField = TableFeildsEnum.FLOWID.getField(); + if (isClobDbType) { + flowidField = TableFeildsEnum.FLOWID.getField().toUpperCase(); + } + mainTableFields.add(flowidField); + + // 列表子表字段 + childFieldList = columnFieldList.stream().filter(s -> s.matches(reg)).map(child -> { + OnlineColumnFieldModel fieldModel = new OnlineColumnFieldModel(); + String s1 = child.substring(child.lastIndexOf("yunzhupaas_")).replace("yunzhupaas_", ""); + String s2 = child.substring(child.indexOf("_") + 1, child.lastIndexOf("_yunzhupaas")); + fieldModel.setTableName(s2); + fieldModel.setField(s1); + fieldModel.setOriginallyField(child); + return fieldModel; + }).collect(Collectors.toList()); + + // 取列表用到的表 + List ColumnTableNameList = childFieldList.stream().map(t -> t.getTableName().toLowerCase()) + .collect(Collectors.toList()); + List tableModelList1 = tableModelList.stream() + .filter(t -> ColumnTableNameList.contains(t.getTable().toLowerCase())).collect(Collectors.toList()); + List classifyFieldList = new ArrayList<>(10); + for (TableModel t : tableModelList1) { + OnlineColumnChildFieldModel childFieldModel = new OnlineColumnChildFieldModel(); + childFieldModel.setTable(t.getTable()); + childFieldModel.setRelationField(t.getRelationField()); + childFieldModel.setTableField(t.getTableField()); + classifyFieldList.add(childFieldModel); + } + + List modelList = JsonUtil.getJsonToList(visualDevJsonModel.getColumnData().getColumnList(), + ColumnListField.class); + for (OnlineDynamicSqlModel dycModel : sqlModels) { + if (dycModel.isMain()) { + List mainSqlColumns = getBasicColumns(mainTableFields, sqlModels, dycModel, modelList, + isClobDbType); + basicColumns.addAll(mainSqlColumns); + } else { + if (classifyFieldList.size() > 0) { + Map> mastTableCols = childFieldList.stream() + .collect(Collectors.groupingBy(OnlineColumnFieldModel::getTableName)); + List onlineColumnFieldModels = Optional + .ofNullable(mastTableCols.get(dycModel.getTableName())).orElse(new ArrayList<>()); + List mastSqlCols = getBasicColumnsChild(modelList, dycModel, + onlineColumnFieldModels, isClobDbType); + basicColumns.addAll(mastSqlCols); + } + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return basicColumns; + } + + /** + * + */ + public static void getConditionSql(QueryExpressionDSL.QueryExpressionWhereBuilder form, + String databaseProductName, List searchVOList, + List sqlModelList) throws SQLException { + // 成对注释1---进来前有切库。切回主库查询用户相关信息 + DynamicDataSourceUtil.switchToDataSource(null); + try { + boolean isOracle = databaseProductName.equalsIgnoreCase("oracle"); + boolean isPostgre = databaseProductName.equalsIgnoreCase("PostgreSQL"); + boolean isSqlServer = databaseProductName.equalsIgnoreCase("Microsoft SQL Server"); + for (int k = 0; k < searchVOList.size(); k++) { + VisualColumnSearchVO vo = searchVOList.get(k); + String yunzhupaasKey = "yunzhupaaskey"; + if (Objects.nonNull(vo.getConfig())) { + yunzhupaasKey = vo.getConfig().getYunzhupaasKey(); + } + String tableName = vo.getTable(); + OnlineDynamicSqlModel sqlModel = sqlModelList.stream() + .filter(sql -> sql.getTableName().equals(tableName)).findFirst().orElse(null); + SqlTable sqlTable = sqlModel.getSqlTable(); + String searchType = vo.getSearchType(); + String vModel = vo.getField(); + String format; + + boolean isSearchMultiple = vo.getSearchMultiple() != null && vo.getSearchMultiple(); + // 搜索或字段其中一个为多选, 都按照多选处理 + boolean isMultiple = isSearchMultiple || vo.getMultiple() != null && vo.getMultiple(); + + List dataValues = new ArrayList<>(); + SqlColumn sqlColumn = sqlTable.column(vModel); + List groupList = new ArrayList<>(); + if (isMultiple) { + Object tmpValue = vo.getValue(); + boolean isComSelect = YunzhupaasKeyConsts.COMSELECT.equals(yunzhupaasKey); + if (isComSelect) { + // 左侧树情况左侧条件为单选查询, 所以组织查询全部转为字符串重新处理 + // 组织单独处理, 多选是二维数组, 单选是数组 + tmpValue = JSONArray.toJSONString(vo.getValue()); + } + if (tmpValue instanceof String) { + // 多选的情况, 若为字符串则处理成多选的字符串数组 + tmpValue = OnlineSwapDataUtils.convertValueToString((String) tmpValue, true, isComSelect); + dataValues = JSON.parseArray((String) tmpValue, String.class); + } else { + dataValues = JsonUtil.getJsonToList(tmpValue, String.class); + } + } else { + boolean isCurOrg = YunzhupaasKeyConsts.CURRORGANIZE.equals(yunzhupaasKey); + if (isCurOrg) { + // 所属组织只保存了当前组织的ID, 没有存储组织数组, 将过滤条件中的组织数组取最后一个ID + vo.setValue(OnlineSwapDataUtils.getLastOrganizeId(vo.getValue())); + } + dataValues.add(vo.getValue().toString()); + } + String value = vo.getValue().toString(); + if (isMultiple || YunzhupaasKeyConsts.CHECKBOX.equals(yunzhupaasKey) + || YunzhupaasKeyConsts.CASCADER.equals(yunzhupaasKey) + || YunzhupaasKeyConsts.CURRORGANIZE.equals(yunzhupaasKey) + || YunzhupaasKeyConsts.ADDRESS.equals(yunzhupaasKey) + || YunzhupaasKeyConsts.CUSTOMUSERSELECT.equals(yunzhupaasKey)) { + searchType = "2"; + } + if (YunzhupaasKeyConsts.COM_INPUT.equals(yunzhupaasKey) + || YunzhupaasKeyConsts.TEXTAREA.equals(yunzhupaasKey)) { + if ("3".equals(searchType)) { + searchType = "2"; + } + } + if ("1".equals(searchType)) { + form.and(sqlColumn, SqlBuilder.isEqualTo(value)); + } else if ("2".equals(searchType)) { + if (YunzhupaasKeyConsts.CUSTOMUSERSELECT.equals(yunzhupaasKey)) { + // 分组 组织 岗位 角色 用户 + for (String userVal : dataValues) { + convertUserSelectData(sqlColumn, groupList, userVal, true); + } + } + if (isMultiple) { + for (String val : dataValues) { + if (isSqlServer) { + val = val.replaceAll("\\[", "[[]"); + } + groupList.add(SqlBuilder.or(sqlColumn, SqlBuilder.isLike("%" + val + "%"))); + } + } + if (isSqlServer) { + value = value.replaceAll("\\[", "[[]"); + } + value = "%" + value + "%"; + if (groupList.size() > 0) { + form.and(sqlColumn, SqlBuilder.isLike(value), groupList); + } else { + form.and(sqlColumn, SqlBuilder.isLike(value)); + } + } else if ("3".equals(searchType)) { + switch (yunzhupaasKey) { + case YunzhupaasKeyConsts.MODIFYTIME: + case YunzhupaasKeyConsts.CREATETIME: + case YunzhupaasKeyConsts.DATE: + JSONArray timeStampArray = (JSONArray) vo.getValue(); + Long o1 = (Long) timeStampArray.get(0); + Long o2 = (Long) timeStampArray.get(1); + format = StringUtil.isEmpty(vo.getFormat()) ? "yyyy-MM-dd HH:mm:ss" + : DateTimeFormatConstant.getFormat(vo.getFormat()); + // 时间戳转string格式 + String startTime = OnlinePublicUtils.getDateByFormat(o1, format); + String endTime = OnlinePublicUtils.getDateByFormat(o2, format); + // 处理创建和修改时间查询条件范围 + if (YunzhupaasKeyConsts.CREATETIME.equals(yunzhupaasKey) + || YunzhupaasKeyConsts.MODIFYTIME.equals(yunzhupaasKey)) { + endTime = endTime.substring(0, 10); + } + String firstTimeDate = OnlineDatabaseUtils.getTimeFormat(startTime); + String lastTimeDate = OnlineDatabaseUtils.getLastTimeFormat(endTime); + if (isOracle || isPostgre) { + form.and(sqlTable.column(vModel), SqlBuilder.isBetween(new Date(o1)).and(new Date(o2))); + } else { + form.and(sqlTable.column(vModel), + SqlBuilder.isBetween(firstTimeDate).and(lastTimeDate)); + } + break; + case YunzhupaasKeyConsts.TIME: + List stringList = JsonUtil.getJsonToList(value, String.class); + form.and(sqlTable.column(vModel), + SqlBuilder.isBetween(stringList.get(0)).and(stringList.get(1))); + break; + case YunzhupaasKeyConsts.NUM_INPUT: + case YunzhupaasKeyConsts.CALCULATE: + BigDecimal firstValue = null; + BigDecimal secondValue = null; + JSONArray objects = (JSONArray) vo.getValue(); + for (int i = 0; i < objects.size(); i++) { + Object n = objects.get(i); + if (ObjectUtil.isNotEmpty(n)) { + if (i == 0) { + firstValue = new BigDecimal(String.valueOf(n)); + } else { + secondValue = new BigDecimal(String.valueOf(n)); + } + } + } + if (firstValue != null) { + form.and(sqlTable.column(vModel), SqlBuilder.isGreaterThanOrEqualTo(firstValue)); + } + if (secondValue != null) { + form.and(sqlTable.column(vModel), SqlBuilder.isLessThanOrEqualTo(secondValue)); + } + break; + default: + break; + } + } + } + } finally { + // 成对注释1---完成后。切回数据库 + DynamicDataSourceUtil.clearSwitchDataSource(); + } + } + + /** + * 封装搜索数据 + */ + public static void queryList(List formAllModel, VisualDevJsonModel visualDevJsonModel, + PaginationModel paginationModel) { + String moduleId = paginationModel.getMenuId(); + boolean isApp = false; + // 集成助手过来没有request,默认走pc + try { + isApp = !RequestContext.isOrignPc(); + } catch (Exception e) { + isApp = false; + } + Map systemParam = getSystemParam(); + ColumnDataModel columnData = !visualDevJsonModel.getIsLinkList() && isApp + ? visualDevJsonModel.getAppColumnData() + : visualDevJsonModel.getColumnData(); + // 数据权限 + if (StringUtil.isNotEmpty(moduleId) && columnData.getUseDataPermission() != null + && columnData.getUseDataPermission()) { + List authorizeListAll = authorizeUtil.getConditionSql(moduleId); + for (SuperJsonModel superJsonModel : authorizeListAll) { + List conditionList = superJsonModel.getConditionList(); + for (SuperQueryJsonModel superQueryJsonModel : conditionList) { + List fieLdsModelList = superQueryJsonModel.getGroups(); + for (FieLdsModel fieLdsModel : fieLdsModelList) { + tabelName(fieLdsModel, formAllModel); + replaceSystemParam(systemParam, fieLdsModel); + } + } + } + visualDevJsonModel.setAuthorize(authorizeListAll); + } + + // 数据过滤 + if (columnData != null) { + SuperJsonModel ruleList = isApp ? columnData.getRuleListApp() : columnData.getRuleList(); + SuperJsonModel ruleJsonModel = ruleList != null ? ruleList : new SuperJsonModel(); + List ruleJsonModelList = ruleJsonModel.getConditionList(); + for (SuperQueryJsonModel ruleQueryModel : ruleJsonModelList) { + List fieLdsModelList = ruleQueryModel.getGroups(); + for (FieLdsModel fieLdsModel : fieLdsModelList) { + fieLdsModel.setVModel(fieLdsModel.getId()); + tabelName(fieLdsModel, formAllModel); + replaceSystemParam(systemParam, fieLdsModel); + } + } + visualDevJsonModel.setRuleQuery(ruleJsonModel); + } + + // 高级搜索 + String superQueryJson = paginationModel.getSuperQueryJson(); + if (StringUtil.isNotEmpty(superQueryJson)) { + SuperJsonModel queryJsonModel = JsonUtil.getJsonToBean(superQueryJson, SuperJsonModel.class); + List superQueryListAll = queryJsonModel.getConditionList(); + for (SuperQueryJsonModel superQueryJsonModel : superQueryListAll) { + List fieLdsModelList = superQueryJsonModel.getGroups(); + for (FieLdsModel fieLdsModel : fieLdsModelList) { + fieLdsModel.setVModel(fieLdsModel.getId()); + tabelName(fieLdsModel, formAllModel); + replaceSystemParam(systemParam, fieLdsModel); + } + } + visualDevJsonModel.setSuperQuery(queryJsonModel); + } + + // 列表搜索 + String queryJson = paginationModel.getQueryJson(); + if (StringUtil.isNotEmpty(queryJson)) { + Map keyJsonMap = JsonUtil.stringToMap(queryJson); + List searchVOListAll = JsonUtil.getJsonToList(columnData.getSearchList(), FieLdsModel.class); + if (!visualDevJsonModel.getIsLinkList()) {// 外链没有左侧树和标签面板 + searchVOListAll.addAll(treeRelation(columnData, formAllModel)); + } + List searchVOList = new ArrayList<>(); + for (String model : keyJsonMap.keySet()) { + FieLdsModel fieLdsModel = searchVOListAll.stream().filter(t -> model.equals(t.getId())).findFirst() + .orElse(null); + Object object = keyJsonMap.get(model); + if (fieLdsModel != null) { + if ("标签面板字段".equals(fieLdsModel.getLabel()) && ObjectUtil.isEmpty(object)) { + continue; + } + ConfigModel config = fieLdsModel.getConfig(); + Integer searchType = fieLdsModel.getSearchType(); + String yunzhupaasKey = config.getYunzhupaasKey(); + // 模糊搜索 + boolean isMultiple = fieLdsModel.getSearchMultiple() || fieLdsModel.getMultiple(); + List type = YunzhupaasKeyConsts.SelectIgnore; + // 文本框搜索 + List base = YunzhupaasKeyConsts.BaseSelect; + if (isMultiple || type.contains(yunzhupaasKey)) { + if (object instanceof String) { + object = new ArrayList() { + { + add(String.valueOf(keyJsonMap.get(model))); + } + }; + } + searchType = 4; + } + if (base.contains(yunzhupaasKey) && searchType == 3) { + searchType = 2; + } + String symbol = searchType == 1 ? SearchMethodEnum.Equal.getSymbol() + : searchType == 3 ? SearchMethodEnum.Between.getSymbol() + : searchType == 2 ? SearchMethodEnum.Like.getSymbol() + : SearchMethodEnum.Included.getSymbol(); + fieLdsModel.setSymbol(symbol); + if (object instanceof List) { + fieLdsModel.setFieldValue(JsonUtil.getObjectToString(object)); + } else { + fieLdsModel.setFieldValue(String.valueOf(object)); + } + tabelName(fieLdsModel, formAllModel); + searchVOList.add(fieLdsModel); + } + } + SuperQueryJsonModel queryJsonModel = new SuperQueryJsonModel(); + queryJsonModel.setGroups(searchVOList); + + SuperJsonModel superJsonModel = new SuperJsonModel(); + superJsonModel.setConditionList(new ArrayList() { + { + add(queryJsonModel); + } + }); + visualDevJsonModel.setQuery(superJsonModel); + } + + // keyword 关键词搜索 + if (StringUtil.isNotEmpty(queryJson)) { + Map keyJsonMap = JsonUtil.stringToMap(queryJson); + if (keyJsonMap.get(YunzhupaasKeyConsts.YUNZHUPAASKEYWORD) != null) { + String keyWord = String.valueOf(keyJsonMap.get(YunzhupaasKeyConsts.YUNZHUPAASKEYWORD)); + List searchVOListAll = JsonUtil.getJsonToList(columnData.getSearchList(), + FieLdsModel.class); + List collect = searchVOListAll.stream().filter(t -> t.getIsKeyword()) + .collect(Collectors.toList()); + List searchVOList = new ArrayList<>(); + for (FieLdsModel fieLdsModel : collect) { + fieLdsModel.setFieldValue(keyWord); + fieLdsModel.setSymbol(SearchMethodEnum.Like.getSymbol()); + tabelName(fieLdsModel, formAllModel); + searchVOList.add(fieLdsModel); + } + SuperQueryJsonModel queryJsonModel = new SuperQueryJsonModel(); + queryJsonModel.setLogic(SearchMethodEnum.Or.getSymbol()); + queryJsonModel.setGroups(searchVOList); + SuperJsonModel superJsonModel = new SuperJsonModel(); + superJsonModel.setConditionList(new ArrayList() { + { + add(queryJsonModel); + } + }); + visualDevJsonModel.setKeyQuery(superJsonModel); + } + } + + // 页签查询 + String extraQueryJson = paginationModel.getExtraQueryJson(); + if (StringUtil.isNotEmpty(extraQueryJson)) { + Map keyJsonMap = JsonUtil.stringToMap(extraQueryJson); + if (MapUtils.isNotEmpty(keyJsonMap)) { + SuperJsonModel superJsonModel = new SuperJsonModel(); + List extraQueryList = extraQueryList(keyJsonMap, formAllModel); + SuperQueryJsonModel queryJsonModel = new SuperQueryJsonModel(); + queryJsonModel.setGroups(extraQueryList); + superJsonModel.setConditionList(new ArrayList() { + { + add(queryJsonModel); + } + }); + visualDevJsonModel.setExtraQuery(superJsonModel); + } + } + } + + /** + * 赋值表名 + * + * @param fieLdsModel + * @param formAllModel + */ + public static void tabelName(FieLdsModel fieLdsModel, List formAllModel) { + // 主表数据 + List mast = formAllModel.stream() + .filter(t -> FormEnum.mast.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + // 列表子表数据 + List mastTable = formAllModel.stream() + .filter(t -> FormEnum.mastTable.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + // 子表 + List childTable = formAllModel.stream() + .filter(t -> FormEnum.table.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + if (fieLdsModel != null) { + String vModel = fieLdsModel.getId().split("-")[0]; + String field = fieLdsModel.getId().split("-").length > 1 ? fieLdsModel.getId().split("-")[1] : ""; + FormAllModel mastModel = mast.stream() + .filter(t -> vModel.equals(t.getFormColumnModel().getFieLdsModel().getVModel())).findFirst() + .orElse(null); + if (mastModel != null) { + fieLdsModel.getConfig() + .setTableName(mastModel.getFormColumnModel().getFieLdsModel().getConfig().getTableName()); + fieLdsModel.getConfig().setYunzhupaasKey( + mastModel.getFormColumnModel().getFieLdsModel().getConfig().getYunzhupaasKey()); + } + FormAllModel mastTableModel = mastTable.stream() + .filter(t -> vModel.equals(t.getFormMastTableModel().getVModel())).findFirst().orElse(null); + if (mastTableModel != null) { + fieLdsModel.getConfig().setTableName(mastTableModel.getFormMastTableModel().getMastTable() + .getFieLdsModel().getConfig().getTableName()); + fieLdsModel.getConfig().setYunzhupaasKey(mastTableModel.getFormMastTableModel().getMastTable() + .getFieLdsModel().getConfig().getYunzhupaasKey()); + } + FormAllModel childTableModel = childTable.stream() + .filter(t -> vModel.equals(t.getChildList().getTableModel())).findFirst().orElse(null); + if (childTableModel != null) { + fieLdsModel.getConfig().setTableName(childTableModel.getChildList().getTableName()); + List childList = childTableModel.getChildList().getChildList(); + for (FormColumnModel formColumnModel : childList) { + FieLdsModel childFieLdsModel = formColumnModel.getFieLdsModel(); + String childModel = childFieLdsModel.getVModel(); + if (childModel.equals(field)) { + fieLdsModel.getConfig().setYunzhupaasKey(childFieLdsModel.getConfig().getYunzhupaasKey()); + } + } + } + convertUserSelectData(fieLdsModel); + } + } + + private static void convertUserSelectData(FieLdsModel fieLdsModel) { + List symbolList = new ArrayList<>(); + symbolList.add(SearchMethodEnum.Equal.getSymbol()); + symbolList.add(SearchMethodEnum.NotEqual.getSymbol()); + String yunzhupaasKey = fieLdsModel.getConfig().getYunzhupaasKey(); + String fieldValue = fieLdsModel.getFieldValue(); + String symbol = fieLdsModel.getSymbol(); + if (StringUtil.isNotEmpty(fieldValue)) { + switch (yunzhupaasKey) { + case YunzhupaasKeyConsts.CUSTOMUSERSELECT: + if (!symbolList.contains(symbol)) { + List dataValues = new ArrayList<>(); + List values = new ArrayList<>(); + try { + values = JsonUtil.getJsonToList(fieldValue, String.class); + } catch (Exception e) { + } + dataValues.addAll(values); + for (String userVal : values) { + String userValue = userVal.substring(0, userVal.indexOf("--")); + UserEntity userEntity = userApi.getInfo(userValue); + if (userEntity != null) { + dataValues.add(userValue); + // 在用户关系表中取出 + List groupRel = Optional + .ofNullable(userRelationApi.getListByUserId(userValue, PermissionConst.GROUP)) + .orElse(new ArrayList<>()); + List orgRel = Optional + .ofNullable( + userRelationApi.getListByUserId(userValue, PermissionConst.ORGANIZE)) + .orElse(new ArrayList<>()); + List posRel = Optional + .ofNullable( + userRelationApi.getListByUserId(userValue, PermissionConst.POSITION)) + .orElse(new ArrayList<>()); + List roleRel = Optional + .ofNullable(userRelationApi.getListByUserId(userValue, PermissionConst.ROLE)) + .orElse(new ArrayList<>()); + if (groupRel.size() > 0) { + for (UserRelationEntity split : groupRel) { + dataValues.add(split.getObjectId()); + } + } + if (StringUtil.isNotEmpty(userEntity.getOrganizeId())) { + // 向上递归 查出所有上级组织 + List allUpOrgIDs = new ArrayList<>(); + organizeApi.upWardRecursion(allUpOrgIDs, userEntity.getOrganizeId()); + for (String orgID : allUpOrgIDs) { + dataValues.add(orgID); + } + } + if (posRel.size() > 0) { + for (UserRelationEntity split : posRel) { + dataValues.add(split.getObjectId()); + } + } + if (roleRel.size() > 0) { + for (UserRelationEntity split : roleRel) { + dataValues.add(split.getObjectId()); + } + } + } + } + fieLdsModel.setFieldValue(JsonUtil.getObjectToString(dataValues)); + } + break; + default: + break; + } + } + } + + /** + * 高级搜索 + * + * @param conditionList + * @param convertUser + */ + public static void superList(List conditionList, boolean convertUser) { + List dateControl = YunzhupaasKeyConsts.DateSelect; + List numControl = YunzhupaasKeyConsts.NumSelect; + for (SuperQueryJsonModel queryJsonModel : conditionList) { + List fieLdsModelList = queryJsonModel.getGroups(); + for (FieLdsModel fieLdsModel : fieLdsModelList) { + List dataList = new ArrayList<>(); + ConfigModel config = fieLdsModel.getConfig(); + String vModel = fieLdsModel.getVModel().trim(); + String yunzhupaasKey = config.getYunzhupaasKey(); + if (vModel.split("_yunzhupaas_").length > 1) { + vModel = vModel.split("_yunzhupaas_")[1]; + } + if (vModel.split("-").length > 1) { + vModel = vModel.split("-")[1]; + } + String value = fieLdsModel.getFieldValue(); + Object fieldValue = fieLdsModel.getFieldValue(); + Object fieldValueTwo = fieLdsModel.getFieldValue(); + if (fieLdsModel.getFieldValue() == null) { + fieldValue = ""; + } + List controlList = new ArrayList() { + { + addAll(numControl); + addAll(dateControl); + add(YunzhupaasKeyConsts.TIME); + } + }; + // 处理数据 + if (controlList.contains(yunzhupaasKey) && StringUtil.isNotEmpty(value) + && !SearchMethodEnum.Like.getSymbol().equals(fieLdsModel.getSymbol())) { + int num = 0; + List data = new ArrayList<>(); + try { + data.addAll(JsonUtil.getJsonToList(value, String.class)); + } catch (Exception e) { + data.add(value); + data.add(value); + } + String valueOne = data.get(0); + String valueTwo = data.get(1); + // 数字 + if (numControl.contains(yunzhupaasKey)) { + fieldValue = valueOne != null ? new BigDecimal(valueOne) : valueOne; + fieldValueTwo = valueTwo != null ? new BigDecimal(valueTwo) : valueTwo; + // 精度处理 + Integer precision = fieLdsModel.getPrecision(); + if (ObjectUtil.isNotEmpty(precision)) { + String yunzhupaasNum = "0." + StringUtils.repeat("0", precision); + DecimalFormat numFormat = new DecimalFormat(yunzhupaasNum); + fieldValue = new BigDecimal(numFormat.format(new BigDecimal(valueOne))); + if (valueTwo != null) { + fieldValueTwo = new BigDecimal(numFormat.format(new BigDecimal(valueTwo))); + } + } + num++; + } + // 日期 + if (dateControl.contains(yunzhupaasKey)) { + fieldValue = new Date(); + fieldValueTwo = new Date(); + if (ObjectUtil.isNotEmpty(valueOne)) { + fieldValue = new Date(Long.valueOf(valueOne)); + } + if (ObjectUtil.isNotEmpty(valueTwo)) { + fieldValueTwo = new Date(Long.valueOf(valueTwo)); + } + num++; + } + if (num == 0) { + fieldValue = valueOne; + fieldValueTwo = valueTwo; + } + } + try { + List> list = JsonUtil.getJsonToBean(value, List.class); + Set dataAll = new HashSet<>(); + for (int i = 0; i < list.size(); i++) { + List list1 = new ArrayList<>(); + for (int k = 0; k < list.get(i).size(); k++) { + list1.add(list.get(i).get(k)); + } + dataAll.add(JSONArray.toJSONString(list1)); + } + dataList = new ArrayList<>(dataAll); + } catch (Exception e) { + try { + Set dataAll = new HashSet<>(); + List list = JsonUtil.getJsonToList(value, String.class); + List mast = new ArrayList() { + { + add(YunzhupaasKeyConsts.CASCADER); + add(YunzhupaasKeyConsts.ADDRESS); + add(YunzhupaasKeyConsts.COMSELECT); + add(YunzhupaasKeyConsts.CURRORGANIZE); + } + }; + if (mast.contains(yunzhupaasKey)) { + dataAll.add(JSONArray.toJSONString(list)); + } else { + for (int k = 0; k < list.size(); k++) { + String data = list.get(k); + dataAll.add(data); + } + } + dataList.addAll(new ArrayList<>(dataAll)); + } catch (Exception e1) { + dataList.add(value); + } + } + if (dataList.size() == 0) { + dataList.add("yunzhupaasNullList"); + } + fieLdsModel.setVModel(vModel); + fieLdsModel.setFieldValueOne(fieldValue); + fieLdsModel.setFieldValueTwo(fieldValueTwo); + fieLdsModel.setDataList(dataList); + if (convertUser) { + convertUserSelectData(fieLdsModel); + } + } + } + } + + /** + * 树形查询 + * + * @return + */ + private static List treeRelation(ColumnDataModel columnData, List formAllModel) { + // 主表数据 + List mast = formAllModel.stream() + .filter(t -> FormEnum.mast.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + // 列表子表数据 + List mastTable = formAllModel.stream() + .filter(t -> FormEnum.mastTable.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + // 子表 + List childTable = formAllModel.stream() + .filter(t -> FormEnum.table.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + List fieLdsModelList = new ArrayList<>(); + List searchVOListAll = JsonUtil.getJsonToList(columnData.getSearchList(), FieLdsModel.class); + String treeDataSource = columnData.getTreeDataSource(); + String treeRelation = columnData.getTreeRelation(); + boolean isTree = searchVOListAll.stream().filter(t -> t.getId().equals(treeRelation)).count() == 0; + if (isTree && StringUtil.isNotEmpty(treeRelation)) { + String vModel = treeRelation.split("-")[0]; + FormAllModel mastModel = mast.stream() + .filter(t -> vModel.equals(t.getFormColumnModel().getFieLdsModel().getVModel())).findFirst() + .orElse(null); + if (mastModel != null) { + FieLdsModel fieLdsModel = mastModel.getFormColumnModel().getFieLdsModel(); + fieLdsModel.setId(vModel); + fieLdsModel.setSearchType(1); + Boolean multiple = fieLdsModel.getMultiple(); + fieLdsModel.setSymbol(multiple && !"organize".equals(treeDataSource) ? SearchMethodEnum.Like.getSymbol() + : SearchMethodEnum.Equal.getSymbol()); + fieLdsModelList.add(fieLdsModel); + } + FormAllModel mastTableModel = mastTable.stream() + .filter(t -> vModel.equals(t.getFormMastTableModel().getVModel())).findFirst().orElse(null); + if (mastTableModel != null) { + FieLdsModel fieLdsModel = mastTableModel.getFormMastTableModel().getMastTable().getFieLdsModel(); + fieLdsModel.setId(vModel); + fieLdsModel.setSearchType(1); + Boolean multiple = fieLdsModel.getMultiple(); + fieLdsModel.setSymbol(multiple && !"organize".equals(treeDataSource) ? SearchMethodEnum.Like.getSymbol() + : SearchMethodEnum.Equal.getSymbol()); + fieLdsModelList.add(fieLdsModel); + } + FormAllModel childTableModel = childTable.stream() + .filter(t -> vModel.equals(t.getChildList().getTableModel())).findFirst().orElse(null); + if (childTableModel != null) { + List childList = childTableModel.getChildList().getChildList(); + for (FormColumnModel formColumnModel : childList) { + FieLdsModel fieLdsModel = formColumnModel.getFieLdsModel(); + Boolean multiple = fieLdsModel.getMultiple(); + if (treeRelation.equals(vModel + "-" + fieLdsModel.getVModel())) { + fieLdsModel.setSymbol( + multiple && !"organize".equals(treeDataSource) ? SearchMethodEnum.Like.getSymbol() + : SearchMethodEnum.Equal.getSymbol()); + fieLdsModel.setId(vModel + "-" + fieLdsModel.getVModel()); + fieLdsModel.setSearchType(1); + fieLdsModelList.add(fieLdsModel); + } + } + } + } + // 标签面板-在线开发查询字段添加 + if (Objects.equals(columnData.getType(), 1) || Objects.equals(columnData.getType(), 4) + || columnData.getType() == null) { + TabConfigModel tabConfig = columnData.getTabConfig(); + if (tabConfig != null && tabConfig.isOn() && StringUtil.isNotEmpty(tabConfig.getRelationField())) { + String relationField = tabConfig.getRelationField(); + FormAllModel mastModel = mast.stream() + .filter(t -> relationField.equals(t.getFormColumnModel().getFieLdsModel().getVModel())) + .findFirst().orElse(null); + if (mastModel != null) { + FieLdsModel fieLdsModel = mastModel.getFormColumnModel().getFieLdsModel(); + fieLdsModel.setId(relationField); + fieLdsModel.setSearchType(1); + fieLdsModel.setLabel("标签面板字段"); + fieLdsModel.setSymbol(SearchMethodEnum.Equal.getSymbol()); + fieLdsModelList.add(fieLdsModel); + } + FormAllModel mastTableModel = mastTable.stream() + .filter(t -> relationField.equals(t.getFormMastTableModel().getVModel())).findFirst() + .orElse(null); + if (mastTableModel != null) { + FieLdsModel fieLdsModel = mastTableModel.getFormMastTableModel().getMastTable().getFieLdsModel(); + fieLdsModel.setId(relationField); + fieLdsModel.setSearchType(1); + fieLdsModel.setLabel("标签面板字段"); + fieLdsModel.setSymbol(SearchMethodEnum.Equal.getSymbol()); + fieLdsModelList.add(fieLdsModel); + + } + + } + } + + return fieLdsModelList; + } + + /** + * 查询 + * + * @return + */ + public static void getSuperSql(QueryExpressionDSL.QueryExpressionWhereBuilder where, + List superJsonModelList, List sqlModelList, + String databaseProductName, String tableName) { + List groupQueryList = new ArrayList<>(); + for (SuperJsonModel superJsonModel : superJsonModelList) { + List groupList = getSuperSql(where, superJsonModel, sqlModelList, databaseProductName, + tableName, true); + boolean and = superJsonModel.getAuthorizeLogic(); + String matchLogic = superJsonModel.getMatchLogic(); + boolean isAddMatchLogic = SearchMethodEnum.And.getSymbol().equalsIgnoreCase(matchLogic); + if (groupList.size() > 0) { + AndOrCriteriaGroup andGroup = SqlBuilder.and(DerivedColumn.of("1"), + SqlBuilder.isEqualTo(isAddMatchLogic ? 1 : 2), + groupList.toArray(new AndOrCriteriaGroup[groupList.size()])); + AndOrCriteriaGroup orGroup = SqlBuilder.or(DerivedColumn.of("1"), + SqlBuilder.isEqualTo(isAddMatchLogic ? 1 : 2), + groupList.toArray(new AndOrCriteriaGroup[groupList.size()])); + groupQueryList.add(and ? andGroup : orGroup); + } + } + if (groupQueryList.size() > 0) { + where.and(DerivedColumn.of("1"), SqlBuilder.isEqualTo(1), groupQueryList); + } + } + + /** + * 查询 + * + * @return + */ + public static List getSuperSql( + QueryExpressionDSL.QueryExpressionWhereBuilder where, SuperJsonModel superJsonModel, + List sqlModelList, String databaseProductName, String tableName, + boolean authorizeLogic) { + List groupList = new ArrayList<>(); + OnlineQuerySqlUtils onlineQuerySqlUtils = new OnlineQuerySqlUtils(); + List conditionList = new ArrayList<>(); + List conditionListAll = superJsonModel.getConditionList(); + String matchLogic = superJsonModel.getMatchLogic(); + for (SuperQueryJsonModel queryJsonModel : conditionListAll) { + List fieLdsModelList = new ArrayList<>(); + List groupsList = queryJsonModel.getGroups(); + for (FieLdsModel fieLdsModel : groupsList) { + String table = StringUtil.isNotEmpty(fieLdsModel.getConfig().getRelationTable()) + ? fieLdsModel.getConfig().getRelationTable() + : fieLdsModel.getConfig().getTableName(); + if (StringUtil.isEmpty(tableName) || table.equals(tableName)) { + fieLdsModelList.add(fieLdsModel); + } + } + SuperQueryJsonModel queryModel = new SuperQueryJsonModel(); + queryModel.setLogic(queryJsonModel.getLogic()); + queryModel.setGroups(fieLdsModelList); + if (fieLdsModelList.size() > 0) { + conditionList.add(queryModel); + } + } + if (conditionList.size() > 0) { + groupList.addAll( + onlineQuerySqlUtils.getSuperSql(conditionList, sqlModelList, databaseProductName, matchLogic)); + } + if (!authorizeLogic && groupList.size() > 0) { + where.and(DerivedColumn.of("1"), + SqlBuilder.isEqualTo(SearchMethodEnum.And.getSymbol().equalsIgnoreCase(matchLogic) ? 1 : 2), + groupList); + } + return groupList; + } + + /** + * 将用户选择控件的数据转换为Dynamic查询条件 + * + * @param sqlColumn + * @param userGroup + * @param userVal + */ + private static void convertUserSelectData(BindableColumn sqlColumn, List userGroup, + String userVal, boolean isLike) { + // 分组 组织 岗位 角色 用户 + String userValue = userVal.substring(0, userVal.indexOf("--")); + UserEntity userEntity = userApi.getInfo(userValue); + if (userEntity != null) { + String idValue; + // 在用户关系表中取出 + List groupRel = Optional + .ofNullable(userRelationApi.getListByUserId(userValue, PermissionConst.GROUP)) + .orElse(new ArrayList<>()); + List orgRel = Optional + .ofNullable(userRelationApi.getListByUserId(userValue, PermissionConst.ORGANIZE)) + .orElse(new ArrayList<>()); + List posRel = Optional + .ofNullable(userRelationApi.getListByUserId(userValue, PermissionConst.POSITION)) + .orElse(new ArrayList<>()); + List roleRel = Optional + .ofNullable(userRelationApi.getListByUserId(userValue, PermissionConst.ROLE)) + .orElse(new ArrayList<>()); + if (groupRel.size() > 0) { + for (UserRelationEntity split : groupRel) { + idValue = "%" + split.getObjectId() + "%"; + AndOrCriteriaGroup aog = isLike ? SqlBuilder.or(sqlColumn, SqlBuilder.isLike(idValue)) + : SqlBuilder.and(sqlColumn, SqlBuilder.isNotLike(idValue)); + userGroup.add(aog); + } + } + if (StringUtil.isNotEmpty(userEntity.getOrganizeId())) { + // 向上递归 查出所有上级组织 + List allUpOrgIDs = new ArrayList<>(); + organizeApi.upWardRecursion(allUpOrgIDs, userEntity.getOrganizeId()); + for (String orgID : allUpOrgIDs) { + idValue = "%" + orgID + "%"; + AndOrCriteriaGroup aog = isLike ? SqlBuilder.or(sqlColumn, SqlBuilder.isLike(idValue)) + : SqlBuilder.and(sqlColumn, SqlBuilder.isNotLike(idValue)); + userGroup.add(aog); + } + } + if (posRel.size() > 0) { + for (UserRelationEntity split : posRel) { + idValue = "%" + split.getObjectId() + "%"; + AndOrCriteriaGroup aog = isLike ? SqlBuilder.or(sqlColumn, SqlBuilder.isLike(idValue)) + : SqlBuilder.and(sqlColumn, SqlBuilder.isNotLike(idValue)); + userGroup.add(aog); + } + } + if (roleRel.size() > 0) { + for (UserRelationEntity split : roleRel) { + idValue = "%" + split.getObjectId() + "%"; + AndOrCriteriaGroup aog = isLike ? SqlBuilder.or(sqlColumn, SqlBuilder.isLike(idValue)) + : SqlBuilder.and(sqlColumn, SqlBuilder.isNotLike(idValue)); + userGroup.add(aog); + } + } + } + } + + public static List getBasicColumns(List mainTableFields, List sqlModels, + OnlineDynamicSqlModel dycModel, + List columnFieldListAll, boolean isClobDbType) { + List mainSqlColumns = mainTableFields.stream().map(m -> { + // ColumnListField columnListField = columnFieldListAll.stream().filter(item -> + // item.getProp().equals(m)).findFirst().orElse(null); + // if (isClobDbType && columnListField != null) { + // String yunzhupaasKey = columnListField.getYunzhupaasKey(); + // if (YunzhupaasKeyConsts.getTextField().contains(yunzhupaasKey)) { + // if (sqlModels.size() > 1) {//连表会出现《表名.字段》clob处理需要包含表名 + // return SqlTable.of("dbms_lob.substr(" + dycModel.getTableName()).column(m + + // ")").as(m); + // } else { + // return SqlTable.of(dycModel.getTableName()).column("dbms_lob.substr(" + m + + // ")").as(m); + // } + // } + // } + return dycModel.getSqlTable().column(m); + }).collect(Collectors.toList()); + return mainSqlColumns; + } + + private static List getBasicColumnsChild(List modelList, + OnlineDynamicSqlModel dycModel, + List onlineColumnFieldModels, boolean isClobDbType) { + SqlTable mastSqlTable = dycModel.getSqlTable(); + List mastSqlCols = onlineColumnFieldModels.stream().map(m -> { + // ColumnListField columnListField = modelList.stream().filter(item -> + // item.getProp().equals(m.getOriginallyField())).findFirst().orElse(null); + // if (isClobDbType && columnListField != null) { + // String yunzhupaasKey = columnListField.getConfig().getYunzhupaasKey(); + // if (YunzhupaasKeyConsts.getTextField().contains(yunzhupaasKey)) { + // return SqlTable.of("dbms_lob.substr(" + + // dycModel.getTableName()).column(m.getField() + + // ")").as(m.getOriginallyField()); + // } + // } + return mastSqlTable.column(m.getField()).as(m.getOriginallyField()); + }).collect(Collectors.toList()); + return mastSqlCols; + } + + /** + * 获取系统参数 + * + * @return + */ + public static Map getSystemParam() { + Map map = new HashMap<>(); + UserInfo userInfo = UserProvider.getUser(); + if (userInfo == null || StringUtil.isEmpty(userInfo.getUserId())) { + return map; + } + // 当前时间 + map.put(AuthorizeConditionEnum.CURRENTTIME.getCondition(), new Date()); + + // 当前部门 + String depId = userInfo.getDepartmentId(); + map.put(AuthorizeConditionEnum.DEPID.getCondition(), depId); + + // 当前部门及下级部门 + List depList = new ArrayList<>(); + if (StringUtil.isNotEmpty(depId)) { + depList.add(depId); + depList.addAll(organizeApi.getDepsByParentId(depId).stream().map(OrganizeEntity::getId) + .collect(Collectors.toList())); + } + map.put(AuthorizeConditionEnum.DEPANDSUBORDINATES.getCondition(), JsonUtil.getObjectToString(depList)); + + // 当前岗位 + List positionIdList = new ArrayList<>(); + if (Objects.nonNull(userInfo.getPositionIds())) { + positionIdList.addAll(Arrays.asList(userInfo.getPositionIds())); + } + positionIdList = positionIdList.stream().filter(t -> StringUtil.isNotEmpty(t)).collect(Collectors.toList()); + map.put(AuthorizeConditionEnum.POSITIONID.getCondition(), JsonUtil.getObjectToString(positionIdList)); + + // 当前用户 + String userId = userInfo.getUserId(); + map.put(AuthorizeConditionEnum.USER.getCondition(), userId); + + // 当前用户及下属 + List subOrganizeIds = new ArrayList<>(); + subOrganizeIds.addAll(userApi.getListByManagerId(userInfo.getUserId(), null).stream().map(UserEntity::getId) + .collect(Collectors.toList())); + subOrganizeIds.add(userInfo.getUserId()); + map.put(AuthorizeConditionEnum.USERANDUNDER.getCondition(), JsonUtil.getObjectToString(subOrganizeIds)); + + // 当前组织 + map.put(AuthorizeConditionEnum.ORGANIZE.getCondition(), + organizeApi.getUserTreeOrgStr(AuthorizeConditionEnum.ORGANIZE)); + + // 当前组织及子组织 + map.put(AuthorizeConditionEnum.ORGANIZEANDUNDER.getCondition(), + organizeApi.getUserTreeOrgStr(AuthorizeConditionEnum.ORGANIZEANDUNDER)); + + // 当前分管组织 + map.put(AuthorizeConditionEnum.BRANCHMANAGEORG.getCondition(), + organizeApi.getUserTreeOrgStr(AuthorizeConditionEnum.BRANCHMANAGEORG)); + return map; + } + + /** + * 替换系统参数 + * + * @param systemParam + * @param fieLdsModel + */ + public static void replaceSystemParam(Map systemParam, FieLdsModel fieLdsModel) { + String fieldValue = fieLdsModel.getFieldValue(); + String valueStr = ""; + if (AuthorizeConditionEnum.CURRENTTIME.getCondition().equals(fieldValue)) { + Object valueObj = systemParam.get(AuthorizeConditionEnum.CURRENTTIME.getCondition()); + Date currentTime = (Date) valueObj; + // todo 如果当前时间需要根据条件格式做查询开启底下注释 + // String format = fieLdsModel.getFormat(); + // if (StringUtil.isNotEmpty(format)) { + // String dateStr = DateUtil.dateToString((Date) valueObj, format); + // currentTime = DateUtil.stringToDate(FormPublicUtils.getTimeFormat(dateStr)); + // } + currentTime = DateUtil.stringToDate(DateUtil.daFormatHHMMSS(currentTime.getTime())); + valueStr = String.valueOf(currentTime.getTime()); + fieLdsModel.setFieldValue(valueStr); + } + if (AuthorizeConditionEnum.DEPID.getCondition().equals(fieldValue)) { + Object valueObj = systemParam.get(AuthorizeConditionEnum.DEPID.getCondition()); + if (Objects.nonNull(valueObj) && StringUtil.isNotEmpty(valueObj.toString())) { + valueStr = valueObj.toString(); + } else { + valueStr = AuthorizeConditionEnum.DEPID.getCondition(); + } + fieLdsModel.setFieldValue(valueStr); + } + if (AuthorizeConditionEnum.DEPANDSUBORDINATES.getCondition().equals(fieldValue)) { + valueStr = systemParam.get(AuthorizeConditionEnum.DEPANDSUBORDINATES.getCondition()).toString(); + fieLdsModel.setFieldValue(valueStr); + } + if (AuthorizeConditionEnum.POSITIONID.getCondition().equals(fieldValue)) { + valueStr = systemParam.get(AuthorizeConditionEnum.POSITIONID.getCondition()).toString(); + fieLdsModel.setFieldValue(valueStr); + } + if (AuthorizeConditionEnum.USER.getCondition().equals(fieldValue)) { + valueStr = systemParam.get(AuthorizeConditionEnum.USER.getCondition()).toString(); + fieLdsModel.setFieldValue(valueStr); + } + if (AuthorizeConditionEnum.USERANDUNDER.getCondition().equals(fieldValue)) { + valueStr = systemParam.get(AuthorizeConditionEnum.USERANDUNDER.getCondition()).toString(); + fieLdsModel.setFieldValue(valueStr); + } + if (AuthorizeConditionEnum.ORGANIZE.getCondition().equals(fieldValue)) { + valueStr = systemParam.get(AuthorizeConditionEnum.ORGANIZE.getCondition()).toString(); + fieLdsModel.setFieldValue(valueStr); + } + if (AuthorizeConditionEnum.ORGANIZEANDUNDER.getCondition().equals(fieldValue)) { + valueStr = systemParam.get(AuthorizeConditionEnum.ORGANIZEANDUNDER.getCondition()).toString(); + fieLdsModel.setFieldValue(valueStr); + } + if (AuthorizeConditionEnum.BRANCHMANAGEORG.getCondition().equals(fieldValue)) { + valueStr = systemParam.get(AuthorizeConditionEnum.BRANCHMANAGEORG.getCondition()).toString(); + fieLdsModel.setFieldValue(valueStr); + } + } + + /** + * 页签查询字段组装 + * + * @param map + * @param formAllModel + * @return + */ + private static List extraQueryList(Map map, List formAllModel) { + List fieLdsModelList = new ArrayList<>(); + // 主表数据 + List mast = formAllModel.stream() + .filter(t -> FormEnum.mast.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + // 列表子表数据 + List mastTable = formAllModel.stream() + .filter(t -> FormEnum.mastTable.getMessage().equals(t.getYunzhupaasKey())).collect(Collectors.toList()); + for (String key : map.keySet()) { + Object value = map.get(key); + FieLdsModel fieLdsModel = null; + FormAllModel mastModel = mast.stream() + .filter(t -> key.equals(t.getFormColumnModel().getFieLdsModel().getVModel())).findFirst() + .orElse(null); + if (mastModel != null) { + fieLdsModel = BeanUtil.copyProperties(mastModel.getFormColumnModel().getFieLdsModel(), + FieLdsModel.class); + } + FormAllModel mastTableModel = mastTable.stream() + .filter(t -> key.equals(t.getFormMastTableModel().getVModel())).findFirst().orElse(null); + if (mastTableModel != null) { + fieLdsModel = BeanUtil.copyProperties( + mastTableModel.getFormMastTableModel().getMastTable().getFieLdsModel(), FieLdsModel.class); + } + fieLdsModel.setId(key); + fieLdsModel.setSearchType(1); + fieLdsModel.setLabel(fieLdsModel.getConfig().getLabel()); + fieLdsModel.setSymbol(SearchMethodEnum.Equal.getSymbol()); + if (Objects.nonNull(value)) { + if (value instanceof List) { + fieLdsModel.setFieldValue(JsonUtil.getObjectToString(value)); + } else { + fieLdsModel.setFieldValue(String.valueOf(value)); + } + } else { + fieLdsModel.setSymbol(SearchMethodEnum.IsNull.getSymbol()); + } + fieLdsModelList.add(fieLdsModel); + } + return fieLdsModelList; + } + + /** + * 获取组织全路径 + * + * @param allIdList 组织id列表。 + * @return + */ + private static String getOrgAllPath(List allIdList) { + List> orgAllPathList = getOrgAllPathList(allIdList); + return JsonUtil.getObjectToString(orgAllPathList); + } + + /** + * 获取组织全路径 + * + * @param allIdList 组织id列表。 + * @return + */ + private static List> getOrgAllPathList(List allIdList) { + List> resOrg = new ArrayList<>(); + for (String itemOrg : allIdList) { + OrganizeEntity organizeEntity = organizeApi.getInfo(itemOrg); + if (organizeEntity != null) { + if (StringUtil.isNotEmpty(organizeEntity.getOrganizeIdTree())) { + String[] split = organizeEntity.getOrganizeIdTree().split(","); + if (split.length > 0) { + resOrg.add(Arrays.asList(split)); + } + } + } + } + return resOrg; + } +} diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/util/onlineDevUtil/OnlinePublicUtils.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/util/onlineDevUtil/OnlinePublicUtils.java new file mode 100644 index 0000000..e10c35f --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/util/onlineDevUtil/OnlinePublicUtils.java @@ -0,0 +1,757 @@ +package com.yunzhupaas.onlinedev.util.onlineDevUtil; + +import com.yunzhupaas.base.entity.DataInterfaceEntity; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.entity.VisualdevReleaseEntity; +import com.yunzhupaas.base.model.ColumnDataModel; +import com.yunzhupaas.base.model.Template6.ColumnListField; +import com.yunzhupaas.base.model.VisualDevJsonModel; +import com.yunzhupaas.base.model.VisualWebTypeEnum; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.database.model.superQuery.SuperJsonModel; +import com.yunzhupaas.database.model.superQuery.SuperQueryJsonModel; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.model.OnlineDevData; +import com.yunzhupaas.model.visualJson.FieLdsModel; +import com.yunzhupaas.model.visualJson.FormDataModel; +import com.yunzhupaas.model.visualJson.TableModel; +import com.yunzhupaas.model.visualJson.analysis.FormEnum; +import com.yunzhupaas.model.visualJson.analysis.FormModel; +import com.yunzhupaas.model.visualJson.config.ConfigModel; +import com.yunzhupaas.onlinedev.model.OnlineDevEnum.MultipleControlEnum; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.XSSEscape; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import org.apache.commons.collections4.MapUtils; + +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 在线开发公用 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/7/28 + */ +public class OnlinePublicUtils { + /** + * 判断有表无表 + * + * @return + */ + public static Boolean isUseTables(String tableJson) { + if (!StringUtil.isEmpty(tableJson) && !OnlineDevData.TABLE_CONST.equals(tableJson)) { + return true; + } + return false; + } + + /** + * map key转小写 + * + * @param requestMap + * @return + */ + public static Map mapKeyToLower(Map requestMap) { + // 非空校验 + if (requestMap.isEmpty()) { + return null; + } + // 初始化放转换后数据的Map + Map responseMap = new HashMap<>(16); + // 使用迭代器进行循环遍历 + Set requestSet = requestMap.keySet(); + Iterator iterator = requestSet.iterator(); + iterator.forEachRemaining(obj -> { + // 判断Key对应的Value是否为Map + if ((requestMap.get(obj) instanceof Map)) { + // 递归调用,将value中的Map的key转小写 + responseMap.put(obj.toLowerCase(), mapKeyToLower((Map) requestMap.get(obj))); + } else { + // 直接将key小写放入responseMap + responseMap.put(obj.toLowerCase(), requestMap.get(obj)); + } + }); + + return responseMap; + } + + /** + * 获取map中第一个数据值 + * + * @param map 数据源 + * @return + */ + public static Object getFirstOrNull(Map map) { + Object obj = null; + for (Map.Entry entry : map.entrySet()) { + obj = entry.getValue(); + if (obj != null) { + break; + } + } + return obj; + } + + /** + * 去除列表里无用的控件 + * + * @param fieldsModelList + * @return + */ + public static void removeUseless(List fieldsModelList) { + for (int i = 0; i < fieldsModelList.size(); i++) { + if (fieldsModelList.get(i).getConfig().getYunzhupaasKey() == null) { + continue; + } + if (fieldsModelList.get(i).getConfig().getYunzhupaasKey().equals(YunzhupaasKeyConsts.CHILD_TABLE)) { + continue; + } + } + } + + /** + * 递归控件 + * + * @param allFields + * @param fieLdsModelList + * @return + */ + public static void recursionFields(List allFields, List fieLdsModelList) { + for (FieLdsModel fieLdsModel : fieLdsModelList) { + ConfigModel config = fieLdsModel.getConfig(); + String yunzhupaasKey = config.getYunzhupaasKey(); + if (YunzhupaasKeyConsts.CHILD_TABLE.equals(yunzhupaasKey)) { + allFields.add(fieLdsModel); + continue; + } else { + if (config.getChildren() != null) { + recursionFields(allFields, config.getChildren()); + } else { + if (yunzhupaasKey == null) { + continue; + } + allFields.add(fieLdsModel); + } + } + } + } + + /** + * 判断字符串是否有某个字符存在 + * + * @param var1 完整字符串 + * @param var2 统计字符 + * @return + */ + public static Boolean getMultiple(String var1, String var2) { + if (var1.startsWith(var2)) { + return true; + } + return false; + } + + /** + * 数据字典处理(从缓存中取出) + * + * @param dataList + * @param swapModel + * @return + */ + public static Map getDataMap(List> dataList, FieLdsModel swapModel) { + String label = swapModel.getProps() != null ? swapModel.getProps().getLabel() : ""; + String value = swapModel.getProps() != null ? swapModel.getProps().getValue() : ""; + Map dataInterfaceMap = new HashMap<>(); + dataList.stream().forEach(data -> { + dataInterfaceMap.put(String.valueOf(data.get(value)), String.valueOf(data.get(label))); + }); + return dataInterfaceMap; + } + + /** + * 获取时间(+8) + * + * @param date + * @param format + * @return + */ + public static String getDateByFormat(Long date, String format) { + DateTimeFormatter ftf = DateTimeFormatter.ofPattern(format); + String dateString = ftf.format(LocalDateTime.ofInstant(Instant.ofEpochMilli(date), ZoneId.of("+8"))); + return dateString; + } + + /** + * 递归表单控件 + * + * @param modelList 所有控件 + * @param mainFields 主表 + * @param childFields 子表 + * @param models 二维码 条形码 + */ + public static void recurseFiled(List modelList, List mainFields, + List childFields, List models) { + for (FieLdsModel fieLdsModel : modelList) { + ConfigModel config = fieLdsModel.getConfig(); + String yunzhupaaskey = config.getYunzhupaasKey(); + List childrenList = config.getChildren(); + boolean isYunzhupaasKey = StringUtil.isEmpty(yunzhupaaskey); + List keyList = new ArrayList() { + { + this.add(FormEnum.collapseItem.getMessage()); + this.add(FormEnum.collapseItem.getMessage()); + this.add(FormEnum.row.getMessage()); + this.add(FormEnum.card.getMessage()); + this.add(FormEnum.tab.getMessage()); + this.add(FormEnum.collapse.getMessage()); + this.add(FormEnum.tableGrid.getMessage()); + this.add(FormEnum.tableGridTr.getMessage()); + this.add(FormEnum.tableGridTd.getMessage()); + } + }; + if (keyList.contains(yunzhupaaskey) || isYunzhupaasKey) { + if (childrenList.size() > 0) { + recurseFiled(childrenList, mainFields, childFields, models); + } else { + mainFields.add(fieLdsModel); + } + } else if (FormEnum.table.getMessage().equals(yunzhupaaskey)) { + childFields.add(fieLdsModel); + } else if (FormEnum.groupTitle.getMessage().equals(yunzhupaaskey) + || FormEnum.divider.getMessage().equals(yunzhupaaskey) + || FormEnum.YUNZHUPAASText.getMessage().equals(yunzhupaaskey)) { + + } else if (FormEnum.QR_CODE.getMessage().equals(yunzhupaaskey) + || FormEnum.BARCODE.getMessage().equals(yunzhupaaskey)) { + FormModel formModel = JsonUtil.getJsonToBean(fieLdsModel, FormModel.class); + models.add(formModel); + } else { + mainFields.add(fieLdsModel); + } + } + } + + /** + * 递归控件 + * + * @return + */ + public static void recursionFormFields(List allFields, List fieLdsModelList) { + for (FieLdsModel fieLdsModel : fieLdsModelList) { + ConfigModel config = fieLdsModel.getConfig(); + String yunzhupaasKey = config.getYunzhupaasKey(); + if (YunzhupaasKeyConsts.CHILD_TABLE.equals(yunzhupaasKey)) { + allFields.add(fieLdsModel); + continue; + } else { + if (config.getChildren() != null) { + recursionFormFields(allFields, config.getChildren()); + } else { + allFields.add(fieLdsModel); + } + } + } + } + + /** + * 递归控件(取出所有子集) + * + * @return + */ + public static void recursionFormChildFields(List allFields, List fieLdsModelList) { + for (FieLdsModel fieLdsModel : fieLdsModelList) { + ConfigModel config = fieLdsModel.getConfig(); + String yunzhupaasKey = config.getYunzhupaasKey(); + if (YunzhupaasKeyConsts.CHILD_TABLE.equals(yunzhupaasKey)) { + String childVmodel = fieLdsModel.getVModel(); + for (FieLdsModel child : Optional.ofNullable(fieLdsModel.getConfig().getChildren()) + .orElse(new ArrayList<>())) { + if (child.getVModel() != null) { + child.setVModel(childVmodel + "-" + child.getVModel()); + allFields.add(child); + } + } + } else { + if (config.getChildren() != null) { + recursionFormChildFields(allFields, config.getChildren()); + } else { + if (StringUtil.isNotEmpty(fieLdsModel.getVModel())) { + allFields.add(fieLdsModel); + } + } + } + } + } + + public static void recurseOnlineFiled(List modelList, List mainFields, + List childFields) { + for (FieLdsModel fieLdsModel : modelList) { + ConfigModel config = fieLdsModel.getConfig(); + String yunzhupaaskey = config.getYunzhupaasKey(); + List childrenList = config.getChildren(); + boolean isYunzhupaasKey = StringUtil.isEmpty(yunzhupaaskey); + if (FormEnum.row.getMessage().equals(yunzhupaaskey) || FormEnum.card.getMessage().equals(yunzhupaaskey) + || FormEnum.tab.getMessage().equals(yunzhupaaskey) + || FormEnum.collapse.getMessage().equals(yunzhupaaskey) + || isYunzhupaasKey) { + if (childrenList.size() > 0) { + recurseOnlineFiled(childrenList, mainFields, childFields); + } else { + mainFields.add(fieLdsModel); + } + } else if (FormEnum.table.getMessage().equals(yunzhupaaskey)) { + childFields.add(fieLdsModel); + } else if (FormEnum.groupTitle.getMessage().equals(yunzhupaaskey) + || FormEnum.divider.getMessage().equals(yunzhupaaskey) + || FormEnum.YUNZHUPAASText.getMessage().equals(yunzhupaaskey)) { + + } else { + mainFields.add(fieLdsModel); + } + } + } + + /** + * @param redisMap 缓存集合 + * @param modelData 数据 + * @param isMultiple 是否多选 + * @return + */ + public static String getDataInMethod(Map redisMap, Object modelData, Boolean isMultiple) { + if (redisMap == null || redisMap.isEmpty()) { + return modelData.toString(); + } + String Separator = isMultiple ? ";" : "/"; + String s2; + if (OnlinePublicUtils.getMultiple(String.valueOf(modelData), + MultipleControlEnum.MULTIPLE_JSON_TWO.getMultipleChar())) { + String[][] data = JsonUtil.getJsonToBean(String.valueOf(modelData), String[][].class); + List addList = new ArrayList<>(); + for (String[] AddressData : data) { + List adList = new ArrayList<>(); + for (String s : AddressData) { + adList.add(String.valueOf(redisMap.get(s))); + } + addList.add(String.join("/", adList)); + } + s2 = String.join(";", addList); + } else if (OnlinePublicUtils.getMultiple(String.valueOf(modelData), + MultipleControlEnum.MULTIPLE_JSON_ONE.getMultipleChar())) { + List modelDataList = JsonUtil.getJsonToList(String.valueOf(modelData), String.class); + modelDataList = modelDataList.stream().map(s -> String.valueOf(redisMap.get(s))) + .collect(Collectors.toList()); + s2 = String.join(Separator, modelDataList); + } else { + String[] modelDatas = String.valueOf(modelData).split(","); + StringBuilder dynamicData = new StringBuilder(); + for (int i = 0; i < modelDatas.length; i++) { + modelDatas[i] = String + .valueOf(Objects.nonNull(redisMap.get(modelDatas[i])) ? redisMap.get(modelDatas[i]) : ""); + dynamicData.append(modelDatas[i] + Separator); + } + s2 = dynamicData.deleteCharAt(dynamicData.length() - 1).toString(); + } + return StringUtil.isEmpty(s2) ? modelData.toString() : s2; + } + + public static List getDataNoSwapInMethod(Object modelData) { + List dataValueList = new ArrayList<>(); + if (OnlinePublicUtils.getMultiple(String.valueOf(modelData), + MultipleControlEnum.MULTIPLE_JSON_ONE.getMultipleChar())) { + List modelDataList = JsonUtil.getJsonToList(String.valueOf(modelData), String.class); + dataValueList = modelDataList; + } else { + String[] modelDatas = String.valueOf(modelData).split(","); + for (int i = 0; i < modelDatas.length; i++) { + dataValueList.add(modelDatas[i]); + } + } + return dataValueList; + } + + public static VisualDevJsonModel getVisualJsonModel(VisualdevEntity entity) { + VisualDevJsonModel jsonModel = new VisualDevJsonModel(); + if (entity.getColumnData() != null) { + jsonModel.setColumnData(JsonUtil.getJsonToBean(entity.getColumnData(), ColumnDataModel.class)); + } + if (entity.getAppColumnData() != null) { + jsonModel.setAppColumnData(JsonUtil.getJsonToBean(entity.getAppColumnData(), ColumnDataModel.class)); + } + FormDataModel formDataModel = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + jsonModel.setFormData(formDataModel); + if (!VisualWebTypeEnum.DATA_VIEW.getType().equals(entity.getWebType())) { + jsonModel.setFormListModels(JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class)); + } + jsonModel.setVisualTables(JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class)); + jsonModel.setId(entity.getId()); + jsonModel.setDbLinkId(entity.getDbLinkId()); + jsonModel.setFullName(entity.getFullName()); + jsonModel.setType(entity.getType()); + jsonModel.setWebType(entity.getWebType()); + return jsonModel; + } + + public static VisualDevJsonModel getVisualJsonModel(VisualdevReleaseEntity entity) throws WorkFlowException { + if (entity == null) + throw new WorkFlowException(MsgCode.VS412.get()); + VisualDevJsonModel jsonModel = new VisualDevJsonModel(); + if (entity.getColumnData() != null) { + jsonModel.setColumnData(JsonUtil.getJsonToBean(entity.getColumnData(), ColumnDataModel.class)); + } + if (entity.getAppColumnData() != null) { + jsonModel.setAppColumnData(JsonUtil.getJsonToBean(entity.getAppColumnData(), ColumnDataModel.class)); + } + FormDataModel formDataModel = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + jsonModel.setFormData(formDataModel); + if (!VisualWebTypeEnum.DATA_VIEW.getType().equals(entity.getWebType())) { + jsonModel.setFormListModels(JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class)); + } + jsonModel.setVisualTables(JsonUtil.getJsonToList(entity.getVisualTables(), TableModel.class)); + jsonModel.setId(entity.getId()); + jsonModel.setDbLinkId(entity.getDbLinkId()); + jsonModel.setFullName(entity.getFullName()); + jsonModel.setType(entity.getType()); + jsonModel.setWebType(entity.getWebType()); + return jsonModel; + } + + /** + * @param mapList + * @return List> + * @Date 21:51 2020/11/11 + * @Description 将map中的所有key转化为小写 + */ + public static List> toLowerKeyList(List> mapList) { + List> newMapList = new ArrayList<>(); + for (Map map : mapList) { + Map resultMap = new HashMap(16); + Set sets = map.keySet(); + for (String key : sets) { + resultMap.put(key.toLowerCase(), map.get(key)); + } + newMapList.add(resultMap); + } + return newMapList; + } + + /** + * 字符串转数组 + * + * @param value 值 + * @return + */ + public static Object getDataConversion(Object value) { + Object dataValue = getDataConversion(null, value, false, "/"); + return dataValue; + } + + /** + * 字符串转数组 + * + * @param redis 转换对象 + * @param value 值 + * @return + */ + public static Object getDataConversion(Map redis, Object value, boolean isMultiple, + String separator) { + Object dataValue = value; + boolean iszhuanhuan = redis != null; + try { + List list = JsonUtil.getJsonToList(String.valueOf(value), List.class); + dataValue = list; + if (iszhuanhuan) { + // 一级分隔符 + StringJoiner joiner = new StringJoiner(","); + for (List listChild : list) { + StringJoiner aa = new StringJoiner(separator); + for (Object object : listChild) { + String value1 = redis.get(String.valueOf(object)) != null + ? String.valueOf(redis.get(String.valueOf(object))) + : ""; + if (StringUtil.isNotEmpty(value1)) { + aa.add(value1); + } + } + joiner.add(aa.toString()); + } + dataValue = joiner.toString(); + } + } catch (Exception e) { + try { + List list = JsonUtil.getJsonToList(String.valueOf(value), String.class); + dataValue = list; + if (iszhuanhuan) { + if (isMultiple) {// 一级分隔符 + separator = ","; + } + StringJoiner joiner = new StringJoiner(separator); + for (Object listChild : list) { + String value1 = redis.get(String.valueOf(listChild)) != null + ? String.valueOf(redis.get(String.valueOf(listChild))) + : ""; + if (StringUtil.isNotEmpty(value1)) { + joiner.add(value1); + } + } + dataValue = joiner.toString(); + } + } catch (Exception e1) { + dataValue = String.valueOf(value); + if (iszhuanhuan) { + dataValue = redis.get(String.valueOf(value)) != null + ? String.valueOf(redis.get(String.valueOf(value))) + : ""; + } + } + } + return dataValue; + } + + /** + * 视图sql条件拼接 + * + * @param info + * @param queryCondition + * @param parameterMap + * @return + */ + public static void getViewQuerySql(DataInterfaceEntity info, List queryCondition, + Map parameterMap, Map extraMap) { + if (Objects.equals(info.getType(), 1) && queryCondition.size() > 0) { + String searchSqlStr = ""; + for (FieLdsModel item : queryCondition) { + switch (item.getSearchType()) { + case 1: + if (StringUtil.isNotEmpty(searchSqlStr)) { + searchSqlStr += " and t." + item.getVModel() + " = '" + + XSSEscape.escape(item.getFieldValue()) + "'"; + } else { + searchSqlStr = "t." + item.getVModel() + " = '" + XSSEscape.escape(item.getFieldValue()) + + "'"; + } + break; + case 2: + if (StringUtil.isNotEmpty(searchSqlStr)) { + searchSqlStr += " and t." + item.getVModel() + " like '%" + + XSSEscape.escape(item.getFieldValue()) + "%'"; + } else { + searchSqlStr = "t." + item.getVModel() + " like '%" + XSSEscape.escape(item.getFieldValue()) + + "%'"; + } + break; + case 3:// between + if (StringUtil.isNotEmpty(searchSqlStr)) { + searchSqlStr += " and t." + item.getVModel() + " between '" + + XSSEscape.escape(String.valueOf(item.getFieldValueOne())) + + "' and '" + XSSEscape.escape(String.valueOf(item.getFieldValueTwo())) + "'"; + } else { + searchSqlStr = "t." + item.getVModel() + " between '" + + XSSEscape.escape(String.valueOf(item.getFieldValueOne())) + + "' and '" + XSSEscape.escape(String.valueOf(item.getFieldValueTwo())) + "'"; + } + break; + case 4:// 包含 + List dataList = item.getDataList(); + if (dataList.size() > 0) { + if (StringUtil.isNotEmpty(searchSqlStr)) { + searchSqlStr += " and ("; + } else { + searchSqlStr += " 1=1 and ("; + } + int n = 0; + for (String value : dataList) { + if (n > 0) { + searchSqlStr += " or t." + item.getVModel() + " like '%" + value + "%'"; + } else { + searchSqlStr += "t." + item.getVModel() + " like '%" + value + "%'"; + } + n++; + } + searchSqlStr += ") "; + } + break; + default: + break; + } + } + + // 页签条件额外拼接 + if (MapUtils.isNotEmpty(extraMap)) { + for (String key : extraMap.keySet()) { + if (StringUtil.isNotEmpty(searchSqlStr)) { + searchSqlStr += " and t." + key + " = '" + XSSEscape.escape(extraMap.get(key).toString()) + "'"; + } else { + searchSqlStr = "t." + key + " = '" + XSSEscape.escape(extraMap.get(key).toString()) + "'"; + } + } + } + parameterMap.put("searchSqlStr", searchSqlStr); + } + } + + /** + * 视图非sql条件过滤 + * + * @param info + * @param queryCondition + * @param dataRes + * @return + */ + public static List> getViewQueryNotSql(DataInterfaceEntity info, + List queryCondition, List> dataRes, Map extraMap) { + // 是否包含页签参数 + boolean hasExtra = false; + String key = ""; + if (MapUtils.isNotEmpty(extraMap)) { + hasExtra = true; + List keyList = new ArrayList<>(extraMap.keySet()); + key = keyList.get(0); + } + List> dataInterfaceList = new ArrayList<>(); + if (!Objects.equals(info.getType(), 1) && queryCondition.size() > 0) { + for (Map map : dataRes) { + if (OnlinePublicUtils.mapCompar(queryCondition, map)) { + if (hasExtra) { + if (Objects.equals(map.get(key), extraMap.get(key))) + dataInterfaceList.add(map); + } else { + dataInterfaceList.add(map); + } + } + } + } else { + for (Map map : dataRes) { + if (hasExtra) { + if (Objects.equals(map.get(key), extraMap.get(key))) + dataInterfaceList.add(map); + } else { + dataInterfaceList.add(map); + } + } + } + return dataInterfaceList; + } + + /** + * 判断两个map有相同key-value + * + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2023/1/5 + */ + public static boolean mapCompar(List searchList, Map hashMap2) { + boolean isChange = false; + for (FieLdsModel item : searchList) { + String realValue = hashMap2.get(item.getVModel()) == null ? "" : (String) hashMap2.get(item.getVModel()); + switch (item.getSearchType()) { + case 2: + if (realValue.indexOf(item.getFieldValue()) >= 0) { + isChange = true; + } + break; + case 3:// between + List longList = new ArrayList() { + { + add(YunzhupaasKeyConsts.NUM_INPUT); + add(YunzhupaasKeyConsts.DATE); + } + }; + if (longList.contains(item.getConfig().getYunzhupaasKey())) { + Long valueLong = Long.parseLong(realValue); + Long valueLongOne = (Long) item.getFieldValueOne(); + Long valueLongTwo = (Long) item.getFieldValueTwo(); + if (valueLong >= valueLongOne && valueLong <= valueLongTwo) { + isChange = true; + } + } else { + String valueLongOne = (String) item.getFieldValueOne(); + String valueLongTwo = (String) item.getFieldValueTwo(); + if (realValue.compareTo(valueLongOne) >= 0 && realValue.compareTo(valueLongTwo) <= 0) { + isChange = true; + } + } + break; + case 4:// 包含 + List dataList = item.getDataList(); + for (String value : dataList) { + isChange = value.indexOf(realValue) >= 0; + } + if (isChange) { + return true; + } + break; + default:// 1,其他条件都按等于查询 + isChange = item.getFieldValue().equals(realValue); + break; + } + } + return isChange; + } + + /** + * 获取所有有使用的表 + * + * @return + */ + public static List getAllTableName(List modelList, List listQuery, + Map fieldTableMap) { + List list = new ArrayList<>(); + + for (ColumnListField item : modelList) { + String table = StringUtil.isNotEmpty(item.getConfig().getRelationTable()) + ? item.getConfig().getRelationTable() + : item.getConfig().getTableName(); + if (StringUtil.isBlank(table)) { + table = fieldTableMap.get(item.getConfig().getParentVModel()); + } + list.add(table); + } + for (SuperJsonModel superJsonModel : listQuery) { + if (superJsonModel.getConditionList() != null && superJsonModel.getConditionList().size() > 0) { + List conditionList = superJsonModel.getConditionList(); + for (SuperQueryJsonModel sqj : conditionList) { + if (sqj.getGroups() != null && sqj.getGroups().size() > 0) { + List groups = sqj.getGroups(); + for (FieLdsModel item : groups) { + String table = StringUtil.isNotEmpty(item.getConfig().getRelationTable()) + ? item.getConfig().getRelationTable() + : item.getConfig().getTableName(); + list.add(table); + } + } + } + } + } + return list.stream().distinct().collect(Collectors.toList()); + } + + /** + * 递归控件(取出所有子集=-字段不变) + * + * @return + */ + public static void getAllFields(List allFields, List fieLdsModelList) { + for (FieLdsModel fieLdsModel : fieLdsModelList) { + ConfigModel config = fieLdsModel.getConfig(); + String yunzhupaasKey = config.getYunzhupaasKey(); + if (YunzhupaasKeyConsts.CHILD_TABLE.equals(yunzhupaasKey)) { + allFields.addAll(config.getChildren()); + } else { + if (config.getChildren() != null) { + getAllFields(allFields, config.getChildren()); + } else { + if (StringUtil.isNotEmpty(fieLdsModel.getVModel())) { + allFields.add(fieLdsModel); + } + } + } + } + } +} diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/util/onlineDevUtil/OnlineQuerySqlUtils.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/util/onlineDevUtil/OnlineQuerySqlUtils.java new file mode 100644 index 0000000..8d067e9 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/util/onlineDevUtil/OnlineQuerySqlUtils.java @@ -0,0 +1,193 @@ +package com.yunzhupaas.onlinedev.util.onlineDevUtil; + +import cn.hutool.core.util.ObjectUtil; +import com.yunzhupaas.database.model.superQuery.SuperQueryJsonModel; +import com.yunzhupaas.emnus.SearchMethodEnum; +import com.yunzhupaas.model.visualJson.FieLdsModel; +import com.yunzhupaas.model.visualJson.config.ConfigModel; +import com.yunzhupaas.permission.model.authorize.OnlineDynamicSqlModel; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import lombok.Data; +import org.mybatis.dynamic.sql.*; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class OnlineQuerySqlUtils { + + /** + * 运算符 + */ + private SearchMethodEnum symbol; + /** + * 逻辑拼接符号 + */ + private boolean and; + /** + * 组件标识 + */ + private String yunzhupaasKey; + /** + * 字段key + */ + private String vModel; + /** + * 自定义的值 + */ + private Object fieldValue; + /** + * 自定义的值2 + */ + private Object fieldValueTwo; + + private VisitableCondition sqlCondition = null; + private BindableColumn sqlColumn = null; + private List groupList = new ArrayList<>(); + private boolean isSqlServer = false; + private boolean isOracle = false; + private boolean isAddMatchLogic = false; + + private List dataList = new ArrayList<>(); + + public List getSuperSql(List conditionList, + List sqlModelList, String databaseProductName, String matchLogic) { + isSqlServer = databaseProductName.equalsIgnoreCase("Microsoft SQL Server"); + isOracle = databaseProductName.equalsIgnoreCase("oracle"); + isAddMatchLogic = SearchMethodEnum.And.getSymbol().equalsIgnoreCase(matchLogic); + List groupQueryList = new ArrayList<>(); + OnlineProductSqlUtils.superList(conditionList, false); + for (SuperQueryJsonModel queryJsonModel : conditionList) { + List fieLdsModelList = queryJsonModel.getGroups(); + String logic = queryJsonModel.getLogic(); + and = SearchMethodEnum.And.getSymbol().equalsIgnoreCase(logic); + List groupListAll = new ArrayList<>(); + for (FieLdsModel fieLdsModel : fieLdsModelList) { + ConfigModel config = fieLdsModel.getConfig(); + sqlCondition = null; + sqlColumn = null; + groupList = new ArrayList<>(); + yunzhupaasKey = config.getYunzhupaasKey(); + symbol = SearchMethodEnum.getSearchMethod(fieLdsModel.getSymbol()); + vModel = fieLdsModel.getVModel(); + fieldValue = fieLdsModel.getFieldValueOne(); + fieldValueTwo = fieLdsModel.getFieldValueTwo(); + dataList = fieLdsModel.getDataList(); + String tableName = ObjectUtil.isNotEmpty(config.getRelationTable()) ? config.getRelationTable() + : config.getTableName(); + OnlineDynamicSqlModel onlineDynamicSqlModel = sqlModelList.stream() + .filter(sql -> sql.getTableName().equals(tableName)).findFirst().orElse(null); + if (onlineDynamicSqlModel != null) { + getSymbolWrapper(onlineDynamicSqlModel); + groupListAll.addAll(groupList); + } + } + if (groupListAll.size() > 0) { + if (isAddMatchLogic) { + groupQueryList.add(SqlBuilder.and(DerivedColumn.of("1"), SqlBuilder.isEqualTo(and ? 1 : 2), + groupListAll.toArray(new AndOrCriteriaGroup[groupListAll.size()]))); + } else { + groupQueryList.add(SqlBuilder.or(DerivedColumn.of("1"), SqlBuilder.isEqualTo(and ? 1 : 2), + groupListAll.toArray(new AndOrCriteriaGroup[groupListAll.size()]))); + } + } + } + return groupQueryList; + } + + private void getSymbolWrapper(OnlineDynamicSqlModel onlineDynamicSqlModel) { + SqlTable sqlTable = onlineDynamicSqlModel.getSqlTable(); + sqlColumn = sqlTable.column(vModel); + List list = new ArrayList<>(); + switch (symbol) { + case IsNull: + sqlCondition = SqlBuilder.isNull(); + list.add(SqlBuilder.and(sqlTable.column(vModel), sqlCondition)); + break; + case IsNotNull: + sqlCondition = SqlBuilder.isNotNull(); + list.add(SqlBuilder.and(sqlTable.column(vModel), sqlCondition)); + break; + case Equal: + sqlCondition = SqlBuilder.isEqualTo(fieldValue); + list.add(SqlBuilder.and(sqlTable.column(vModel), sqlCondition)); + break; + case NotEqual: + sqlCondition = SqlBuilder.isNotEqualTo(fieldValue); + list.add(SqlBuilder.and(sqlTable.column(vModel), sqlCondition)); + break; + case GreaterThan: + sqlCondition = SqlBuilder.isGreaterThan(fieldValue); + list.add(SqlBuilder.and(sqlTable.column(vModel), sqlCondition)); + break; + case LessThan: + sqlCondition = SqlBuilder.isLessThan(fieldValue); + list.add(SqlBuilder.and(sqlTable.column(vModel), sqlCondition)); + break; + case GreaterThanOrEqual: + sqlCondition = SqlBuilder.isGreaterThanOrEqualTo(fieldValue); + list.add(SqlBuilder.and(sqlTable.column(vModel), sqlCondition)); + break; + case LessThanOrEqual: + sqlCondition = SqlBuilder.isLessThanOrEqualTo(fieldValue); + list.add(SqlBuilder.and(sqlTable.column(vModel), sqlCondition)); + break; + case Like: + if (isSqlServer) { + fieldValue = String.valueOf(fieldValue).replaceAll("\\[", "[[]"); + } + sqlCondition = SqlBuilder.isLike("%" + fieldValue + "%"); + list.add(SqlBuilder.and(sqlTable.column(vModel), sqlCondition)); + break; + case NotLike: + if (isSqlServer) { + fieldValue = String.valueOf(fieldValue).replaceAll("\\[", "[[]"); + } + sqlCondition = SqlBuilder.isNotLike("%" + fieldValue + "%"); + list.add(SqlBuilder.and(sqlTable.column(vModel), sqlCondition)); + break; + case Included: + case NotIncluded: + getInWrapper(sqlTable, list); + break; + case Between: + sqlCondition = SqlBuilder.isBetween(fieldValue).and(fieldValueTwo); + list.add(SqlBuilder.and(sqlTable.column(vModel), SqlBuilder.isBetween(fieldValue).and(fieldValueTwo))); + break; + default: + break; + } + if (list.size() > 0) { + int n = 1; + if (symbol.equals(SearchMethodEnum.Included)) { + n = 2; + } + if (and) { + groupList.add(SqlBuilder.and(DerivedColumn.of("1"), SqlBuilder.isEqualTo(n), + list.toArray(new AndOrCriteriaGroup[list.size()]))); + } else { + groupList.add(SqlBuilder.or(DerivedColumn.of("1"), SqlBuilder.isEqualTo(n), + list.toArray(new AndOrCriteriaGroup[list.size()]))); + } + } + } + + private void getInWrapper(SqlTable sqlTable, List list) { + for (String value : dataList) { + if (isSqlServer) { + value = String.valueOf(value).replaceAll("\\[", "[[]"); + } + switch (symbol) { + case Included: + sqlCondition = SqlBuilder.isLike("%" + value + "%"); + list.add(SqlBuilder.or(sqlTable.column(vModel), SqlBuilder.isLike("%" + value + "%"))); + break; + default: + sqlCondition = SqlBuilder.isNotLike("%" + value + "%"); + list.add(SqlBuilder.and(sqlTable.column(vModel), SqlBuilder.isNotLike("%" + value + "%"))); + break; + } + } + } + +} diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/util/onlineDevUtil/OnlineSwapDataUtils.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/util/onlineDevUtil/OnlineSwapDataUtils.java new file mode 100644 index 0000000..34a9d36 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/util/onlineDevUtil/OnlineSwapDataUtils.java @@ -0,0 +1,3360 @@ +package com.yunzhupaas.onlinedev.util.onlineDevUtil; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.date.LocalDateTimeUtil; +import cn.hutool.core.map.CaseInsensitiveMap; +import cn.hutool.core.text.StrPool; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.*; +import com.yunzhupaas.base.mapper.FlowFormDataMapper; +import com.yunzhupaas.base.model.ColumnDataModel; +import com.yunzhupaas.base.model.OnlineImport.ExcelImportModel; +import com.yunzhupaas.base.model.OnlineImport.ImportDataModel; +import com.yunzhupaas.base.model.OnlineImport.ImportFormCheckUniqueModel; +import com.yunzhupaas.base.model.OnlineImport.VisualdevModelDataInfoVO; +import com.yunzhupaas.base.model.VisualDevJsonModel; +import com.yunzhupaas.base.model.datainterface.DataInterfaceModel; +import com.yunzhupaas.base.model.datainterface.DataInterfacePage; +import com.yunzhupaas.base.model.flow.DataModel; +import com.yunzhupaas.base.service.*; +import com.yunzhupaas.base.util.*; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.constant.YunzhupaasConst; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.constant.PermissionConst; +import com.yunzhupaas.database.model.entity.DbLinkEntity; +import com.yunzhupaas.database.util.DynamicDataSourceUtil; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.TaskEntity; +import com.yunzhupaas.flowable.entity.TemplateJsonEntity; +import com.yunzhupaas.model.ExcelColumnAttr; +import com.yunzhupaas.model.ExcelModel; +import com.yunzhupaas.model.OnlineDevData; +import com.yunzhupaas.model.visualJson.*; +import com.yunzhupaas.model.visualJson.config.ConfigModel; +import com.yunzhupaas.model.visualJson.config.RegListModel; +import com.yunzhupaas.model.visualJson.props.PropsModel; +import com.yunzhupaas.onlinedev.model.OnlineDevEnum.CacheKeyEnum; +import com.yunzhupaas.onlinedev.model.OnlineDevEnum.MultipleControlEnum; +import com.yunzhupaas.onlinedev.model.OnlineDevEnum.OnlineDataTypeEnum; +import com.yunzhupaas.onlinedev.model.OnlineDevListModel.InterefaceParamModel; +import com.yunzhupaas.onlinedev.model.OnlineInfoModel; +import com.yunzhupaas.onlinedev.model.PaginationModel; +import com.yunzhupaas.onlinedev.model.VisualErrInfo; +import com.yunzhupaas.onlinedev.model.VisualParamModel; +import com.yunzhupaas.onlinedev.service.VisualDevInfoService; +import com.yunzhupaas.onlinedev.service.VisualdevModelDataService; +import com.yunzhupaas.permission.entity.*; +import com.yunzhupaas.permission.model.authorize.AuthorizeConditionEnum; +import com.yunzhupaas.permission.model.organize.OrganizeConditionModel; +import com.yunzhupaas.permission.model.organize.OrganizeModel; +import com.yunzhupaas.permission.service.*; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import com.yunzhupaas.workflow.service.TaskApi; +import com.yunzhupaas.workflow.service.TemplateApi; +import lombok.Cleanup; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.ss.usermodel.IndexedColors; +import org.mybatis.dynamic.sql.BasicColumn; +import org.mybatis.dynamic.sql.SqlBuilder; +import org.mybatis.dynamic.sql.SqlTable; +import org.mybatis.dynamic.sql.render.RenderingStrategies; +import org.mybatis.dynamic.sql.select.QueryExpressionDSL; +import org.mybatis.dynamic.sql.select.SelectModel; +import org.mybatis.dynamic.sql.select.join.EqualTo; +import org.mybatis.dynamic.sql.select.render.SelectStatementProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.math.BigDecimal; +import java.nio.charset.StandardCharsets; +import java.sql.Connection; +import java.sql.SQLException; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.stream.Collectors; + +/** + * 数据解析 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/7/18 + */ +@Slf4j +@Component +public class OnlineSwapDataUtils { + @Autowired + private RedisUtil redisUtil; + @Autowired + private DictionaryDataService dictionaryDataApi; + @Autowired + private UserService userApi; + @Autowired + private PositionService positionApi; + @Autowired + private ProvinceService areaApi; + @Autowired + private OrganizeService organizeApi; + @Autowired + private OrganizeAdministratorService organizeAdministratorService; + @Autowired + private VisualdevService visualdevService; + @Autowired + private VisualdevModelDataService visualdevModelDataService; + @Autowired + private DataInterfaceService dataInterFaceApi; + @Autowired + private VisualDevInfoService visualDevInfoService; + @Autowired + private RoleService roleApi; + @Autowired + private GroupService groupApi; + @Autowired + private DbLinkService dataSourceApi; + @Autowired + private OnlineDevInfoUtils onlineDevInfoUtils; + @Autowired + private FlowFormDataMapper flowFormDataMapper; + @Autowired + private UserRelationService userRelationApi; + @Autowired + private OrganizeRelationService organizeRelationApi; + @Autowired + private FlowFormDataUtil flowDataUtil; + @Autowired + private OnlineExecutor executor; + @Autowired + private ProvinceService provinceService; + @Autowired + private FormCheckUtils formCheckUtils; + + @Autowired + private TemplateApi templateApi; + @Autowired + private TaskApi taskApi; + + public final static long DEFAULT_CACHE_TIME = 60 * 5; + + // 后期将是否缓存转到前端控件配置 + // 缓存系统权限数据, 组织、岗位、分组、角色、用户 + public final static boolean NEEDCACHE_SYS = true; + // 缓存远端数据, 静态、字典、接口、弹窗选择 + public final static boolean NEEDCACHE_REMOTE = true; + // 缓存关联数据, 关联表单 + public final static boolean NEEDCACHE_RELATION = true; + + public List> getSwapList(List> list, List swapDataVoList, + String visualDevId, Boolean inlineEdit) { + if (list.isEmpty()) { + return list; + } + return getSwapList(list, swapDataVoList, visualDevId, inlineEdit, null, true, null); + } + + public List> getSwapInfo(List> list, List swapDataVoList, + String visualDevId, Boolean inlineEdit, Map mainAndMast) { + if (list.isEmpty()) { + return list; + } + return getSwapList(list, swapDataVoList, visualDevId, inlineEdit, null, false, mainAndMast); + } + + public List> getSwapList(List> list, List swapDataVoList, + String visualDevId, Boolean inlineEdit, + Map localCacheParent, boolean isList, Map mainAndMast) { + try { + DynamicDataSourceUtil.switchToDataSource(null); + if (list.isEmpty()) { + return list; + } + // 主表的缓存数据继续使用, 不重新初始化 + Map localCache = Optional.ofNullable(localCacheParent).orElse(new ConcurrentHashMap<>()); + // 初始化系统缓存 + // sysNeedSwapData(swapDataVoList, visualDevId, localCache); + // 初始化系统缓存-多线程 + executor.executorRedis(localCache, swapDataVoList, visualDevId, inlineEdit, list, mainAndMast); + // redis key + String dsName = Optional.ofNullable(TenantHolder.getDatasourceId()).orElse(""); + writeRedisAndList(localCache, swapDataVoList, dsName, visualDevId, inlineEdit, list, isList, mainAndMast); + } catch (SQLException e) { + throw new RuntimeException(e); + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + return list; + } + + private List> writeRedisAndList(Map localCache, + List swapDataVoList, String dsName, String visualDevId, Boolean inlineEdit, + List> list, boolean isList, Map mainAndMast) { + + Map userMap = (Map) localCache.get("__user_map"); + Map orgMap = (Map) localCache.get("__org_map"); + Map posMap = (Map) localCache.get("__pos_map"); + Map orgTreeMap = (Map) localCache.get("__orgTree_map"); + Map roleMap = (Map) localCache.get("__role_map"); + Map groupMap = (Map) localCache.get("__group_map"); + + List> proMapList = (List>) localCache.get("__pro_maplist"); + + List arrYunzhupaasKey = new ArrayList() { + { + add(YunzhupaasKeyConsts.UPLOADFZ); + add(YunzhupaasKeyConsts.UPLOADIMG); + } + }; + for (int x = 0; x < list.size(); x++) { + Map dataMap = list.get(x); + if (dataMap == null) { + dataMap = new HashMap<>(); + list.set(x, dataMap); + } + Map dataCopyMap = new HashMap<>(dataMap); + for (FieLdsModel swapDataVo : swapDataVoList) { + String yunzhupaasKey = swapDataVo.getConfig().getYunzhupaasKey(); + if (StringUtil.isEmpty(swapDataVo.getVModel())) { + continue; + } + String swapVModel = swapDataVo.getVModel(); + String vModel = inlineEdit && isList ? swapDataVo.getVModel() + "_name" : swapDataVo.getVModel(); + String dataType = swapDataVo.getConfig().getDataType(); + Boolean isMultiple = Objects.nonNull(swapDataVo.getMultiple()) ? swapDataVo.getMultiple() : false; + + // clob字段转换 + FormInfoUtils.swapClob(dataMap, swapDataVo.getVModel()); + + try { + Map> dataDetailMap = new HashMap<>(); + // 关联表单获取原字段数据 + FormPublicUtils.relationGetYunzhupaasId(dataMap, yunzhupaasKey, dataMap.get(swapVModel), + swapVModel); + if (StringUtil.isEmpty(String.valueOf(dataMap.get(swapVModel))) + || String.valueOf(dataMap.get(swapVModel)).equals("[]") + || String.valueOf(dataMap.get(swapVModel)).equals("null")) { + if (yunzhupaasKey.equals(YunzhupaasKeyConsts.CHILD_TABLE)) { + dataMap.put(vModel, new ArrayList<>()); + } else if (arrYunzhupaasKey.contains(yunzhupaasKey)) { + dataMap.put(swapVModel, new ArrayList<>()); + } else { + // dataCopyMap.putAll(dataMap); + if (inlineEdit) { + dataMap.put(swapVModel, null); + } + dataMap.put(vModel, null); + } + continue; + } else { + // 是否联动 + boolean DynamicNeedCache; + String redisKey; + String separator = swapDataVo.getSeparator(); + switch (yunzhupaasKey) { + case YunzhupaasKeyConsts.CALCULATE: + case YunzhupaasKeyConsts.NUM_INPUT: + Object decimalValue = dataCopyMap.get(swapDataVo.getVModel()); + Integer precision = swapDataVo.getPrecision(); + if (decimalValue instanceof BigDecimal) { + BigDecimal bd = (BigDecimal) decimalValue; + String value = bd.toPlainString(); + List IntegerType = ImmutableList.of(3, 4); + if (!IntegerType.contains(swapDataVo.getRoundType())) { + if (precision != null && precision > 0) { + String formatZ = "000000000000000"; + String format = formatZ.substring(0, precision); + DecimalFormat decimalFormat = new DecimalFormat("0." + format); + value = decimalFormat.format(bd); + } else { + value = String.valueOf(bd.stripTrailingZeros().toPlainString()); + } + } else { + // 向上(下)取整,去掉末尾0 + value = bd.stripTrailingZeros().toPlainString(); + } + dataMap.put(vModel, value); + } else { + dataMap.put(vModel, decimalValue); + } + break; + // 公司组件 + case YunzhupaasKeyConsts.COMSELECT: + // 部门组件 + case YunzhupaasKeyConsts.DEPSELECT: + // 所属部门 + case YunzhupaasKeyConsts.CURRDEPT: + dataMap.put(vModel, + OnlinePublicUtils.getDataInMethod(orgMap, dataMap.get(swapVModel), isMultiple)); + break; + // 所属组织 + case YunzhupaasKeyConsts.CURRORGANIZE: + // 多级组织 + String orgIds = String.valueOf(dataMap.get(swapVModel)); + String orgName = " "; + List jsonToList = new ArrayList<>(); + try { + jsonToList = JsonUtil.getJsonToList(orgIds, String.class); + } catch (Exception e) { + jsonToList.add(orgIds); + } + if (!jsonToList.isEmpty()) { + if ("all".equals(swapDataVo.getShowLevel())) { + orgName = orgTreeMap.get(StringUtils.join(jsonToList, ",")) != null + ? orgTreeMap.get(StringUtils.join(jsonToList, ",")).toString() + : ""; + } else { + String orgId = jsonToList.get(jsonToList.size() - 1); + OrganizeEntity organizeEntity = StringUtil.isNotEmpty(orgId) + ? organizeApi.getInfo(orgId) + : null; + if (organizeEntity != null + && "department".equals(organizeEntity.getCategory())) { + orgName = organizeEntity.getFullName(); + } + } + } + dataMap.put(vModel, orgName); + break; + + // 岗位组件 + case YunzhupaasKeyConsts.POSSELECT: + // 所属岗位 + case YunzhupaasKeyConsts.CURRPOSITION: + String posData = OnlinePublicUtils.getDataInMethod(posMap, dataMap.get(swapVModel), + isMultiple); + if (ObjectUtil.isEmpty(dataMap.get(swapVModel))) { + dataMap.put(vModel, " "); + } else { + dataMap.put(vModel, posData); + } + break; + + // 用户组件 + case YunzhupaasKeyConsts.USERSELECT: + // 创建用户 + case YunzhupaasKeyConsts.CREATEUSER: + // 修改用户 + case YunzhupaasKeyConsts.MODIFYUSER: + String userData = OnlinePublicUtils.getDataInMethod(userMap, dataMap.get(swapVModel), + isMultiple); + dataMap.put(vModel, userData); + break; + case YunzhupaasKeyConsts.CUSTOMUSERSELECT: + List dataNoSwapInMethod = OnlinePublicUtils + .getDataNoSwapInMethod(dataMap.get(swapVModel)); + StringJoiner valueJoin = new StringJoiner(","); + for (String data : dataNoSwapInMethod) { + String id = data.contains("--") ? data.substring(0, data.lastIndexOf("--")) : data; + String type = data.contains("--") ? data.substring(data.lastIndexOf("--") + 2) : ""; + Map cacheMap; + switch (type) { + case "role": + cacheMap = roleMap; + break; + case "position": + cacheMap = posMap; + break; + case "company": + case "department": + cacheMap = orgMap; + break; + case "group": + cacheMap = groupMap; + break; + case "user": + default: + cacheMap = userMap; + break; + } + valueJoin.add(Optional.ofNullable(cacheMap.get(id)).orElse("").toString()); + } + dataMap.put(vModel, valueJoin.toString()); + break; + // 角色选择 + case YunzhupaasKeyConsts.ROLESELECT: + String roleData = OnlinePublicUtils.getDataInMethod(roleMap, dataMap.get(swapVModel), + isMultiple); + dataMap.put(vModel, roleData); + break; + + case YunzhupaasKeyConsts.GROUPSELECT: + String groupData = OnlinePublicUtils.getDataInMethod(groupMap, dataMap.get(swapVModel), + isMultiple); + dataMap.put(vModel, groupData); + break; + + // 省市区联动 + case YunzhupaasKeyConsts.ADDRESS: + String addressValue = String.valueOf(dataMap.get(swapVModel)); + if (OnlinePublicUtils.getMultiple(addressValue, + MultipleControlEnum.MULTIPLE_JSON_TWO.getMultipleChar())) { + String[][] data = JsonUtil.getJsonToBean(addressValue, String[][].class); + List proDataS = Arrays.stream(data) + .flatMap(Arrays::stream) + .collect(Collectors.toList()); + Map provinceNames = provinceService.getProList(proDataS).stream() + .collect(Collectors.toMap( + ProvinceEntity::getId, ProvinceEntity::getFullName, (k1, k2) -> k2, + () -> new LinkedHashMap<>(proDataS.size(), 1.0F))); + List addList = new ArrayList<>(); + for (String[] AddressData : data) { + List adList = new ArrayList<>(); + for (int i = 0; i < AddressData.length; i++) { + String addressDatum = AddressData[i]; + String value = provinceNames.getOrDefault(addressDatum, ""); + adList.add(value); + } + addList.add(String.join("/", adList)); + } + dataMap.put(vModel, String.join(";", addList)); + } else if (OnlinePublicUtils.getMultiple(addressValue, + MultipleControlEnum.MULTIPLE_JSON_ONE.getMultipleChar())) { + List proDataS = JsonUtil + .getJsonToList(String.valueOf(dataMap.get(swapVModel)), String.class); + Map provinceNames = provinceService.getProList(proDataS).stream() + .collect(Collectors.toMap( + ProvinceEntity::getId, ProvinceEntity::getFullName, (k1, k2) -> k2, + () -> new LinkedHashMap<>(proDataS.size(), 1.0F))); + List adList = new ArrayList<>(); + for (int i = 0; i < proDataS.size(); i++) { + String addressDatum = proDataS.get(i); + String value = provinceNames.getOrDefault(addressDatum, ""); + adList.add(value); + } + dataMap.put(vModel, String.join("/", adList)); + } + break; + // 开关 + case YunzhupaasKeyConsts.SWITCH: + String switchValue = String.valueOf(dataMap.get(swapVModel)).equals("1") + ? swapDataVo.getActiveTxt() + : swapDataVo.getInactiveTxt(); + dataMap.put(vModel, switchValue); + break; + + case YunzhupaasKeyConsts.CASCADER: + case YunzhupaasKeyConsts.RADIO: + case YunzhupaasKeyConsts.CHECKBOX: + case YunzhupaasKeyConsts.SELECT: + case YunzhupaasKeyConsts.TREESELECT: + if (StringUtil.isEmpty(separator)) { + separator = "/"; + } + if (YunzhupaasKeyConsts.CHECKBOX.equals(yunzhupaasKey)) { + isMultiple = true; + } + DynamicNeedCache = swapDataVo.getConfig().getTemplateJson().size() == 0; + String interfacelabel = swapDataVo.getProps().getLabel() != null + ? swapDataVo.getProps().getLabel() + : ""; + String interfaceValue = swapDataVo.getProps().getValue() != null + ? swapDataVo.getProps().getValue() + : ""; + String interfaceChildren = swapDataVo.getProps().getChildren() != null + ? swapDataVo.getProps().getChildren() + : ""; + if (DynamicNeedCache) { + if (OnlineDataTypeEnum.STATIC.getType().equals(dataType)) { + redisKey = String.format("%s-%s-%s", visualDevId, + swapDataVo.getConfig().getRelationTable() + swapDataVo.getVModel(), + OnlineDataTypeEnum.STATIC.getType()); + } else if (dataType.equals(OnlineDataTypeEnum.DYNAMIC.getType())) { + redisKey = String.format("%s-%s-%s-%s-%s-%s", dsName, + OnlineDataTypeEnum.DYNAMIC.getType(), + swapDataVo.getConfig().getPropsUrl(), interfaceValue, interfacelabel, + interfaceChildren); + } else { + redisKey = String.format("%s-%s-%s", dsName, + OnlineDataTypeEnum.DICTIONARY.getType(), + swapDataVo.getConfig().getDictionaryType()); + } + Map cascaderMap; + if (dataType.equals(OnlineDataTypeEnum.DICTIONARY.getType())) { + List> checkBoxList = (List>) localCache + .get(redisKey); + cascaderMap = OnlinePublicUtils.getDataMap(checkBoxList, swapDataVo); + } else { + cascaderMap = (Map) localCache.get(redisKey); + } + dataMap.put(vModel, FormPublicUtils.getDataConversion(cascaderMap, + dataMap.get(swapVModel), isMultiple, separator)); + + } else { + List templateJsonModels = JsonUtil.getJsonToList( + swapDataVo.getConfig().getTemplateJson(), TemplateJsonModel.class); + Map paramMap = new HashMap<>(); + for (TemplateJsonModel templateJsonModel : templateJsonModels) { + String relationField = Objects.isNull(templateJsonModel.getRelationField()) ? "" + : templateJsonModel.getRelationField(); + String Field = templateJsonModel.getField(); + String obj = inlineEdit ? "" + : Optional.ofNullable(dataCopyMap.get(relationField)).orElse("") + .toString(); + if (templateJsonModel.getSourceType() != null + && !Objects.equals(templateJsonModel.getSourceType(), 1)) { + String dataValue = paramSourceTypeReplaceValue(templateJsonModel, + dataCopyMap); + paramMap.put(Field, dataValue); + continue; + } + if (relationField.toLowerCase() + .contains(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX)) { + String childField = relationField.split("-")[1]; + obj = Optional.ofNullable(dataCopyMap.get(childField)).orElse("") + .toString(); + } else if (mainAndMast != null) { + obj = Optional.ofNullable(mainAndMast.get(relationField)).orElse("") + .toString(); + } + paramMap.put(Field, obj); + } + List> dataList = null; + List> options = new ArrayList<>(); + Map dataInterfaceMap = new HashMap(); + // 缓存Key 租户-远端数据-id-base64({params}) + redisKey = String.format("%s-%s-%s-%s", dsName, + OnlineDataTypeEnum.DYNAMIC.getType(), swapDataVo.getConfig().getPropsUrl(), + Base64.getEncoder().encodeToString(JsonUtil.getObjectToString(paramMap) + .getBytes(StandardCharsets.UTF_8))); + if (localCache.containsKey(redisKey) || redisUtil.exists(redisKey)) { + if (localCache.containsKey(redisKey)) { + dataList = (List>) localCache.get(redisKey); + } else { + List tmpList = redisUtil.get(redisKey, 0, -1); + List> tmpMapList = new ArrayList<>(); + tmpList.forEach(item -> { + tmpMapList.add(JsonUtil.entityToMap(item)); + }); + dataList = tmpMapList; + localCache.put(redisKey, dataList); + } + } else { + ActionResult data = dataInterFaceApi + .infoToId(swapDataVo.getConfig().getPropsUrl(), null, paramMap); + if (data != null && data.getData() != null) { + if (data.getData() instanceof List) { + dataList = (List>) data.getData(); + if (NEEDCACHE_REMOTE && CollectionUtils.isNotEmpty(dataList) + && !YunzhupaasKeyConsts.TREESELECT.equals(yunzhupaasKey) + && swapDataVo.getConfig().getUseCache()) { + redisUtil.insert(redisKey, dataList, DEFAULT_CACHE_TIME); + } + localCache.put(redisKey, dataList); + } + } + } + if (dataList != null) { + JSONArray dataAll = JsonUtil.getListToJsonArray(dataList); + treeToList(interfacelabel, interfaceValue, interfaceChildren, dataAll, options); + options.stream().forEach(o -> { + dataInterfaceMap.put(String.valueOf(o.get(interfaceValue)), + String.valueOf(o.get(interfacelabel))); + }); + } + dataMap.put(vModel, FormPublicUtils.getDataConversion(dataInterfaceMap, + dataMap.get(swapVModel), isMultiple, separator)); + } + break; + case YunzhupaasKeyConsts.RELATIONFORM: + // 取关联表单数据 按绑定功能加字段区分数据 + redisKey = String.format("%s-%s-%s-%s-%s", dsName, YunzhupaasKeyConsts.RELATIONFORM, + swapDataVo.getModelId(), swapDataVo.getRelationField(), + dataMap.get(swapDataVo.getVModel())); + VisualdevModelDataInfoVO infoVO = null; + if (localCache.containsKey(redisKey) || redisUtil.exists(redisKey)) { + infoVO = new VisualdevModelDataInfoVO(); + if (localCache.containsKey(redisKey)) { + infoVO.setData(localCache.get(redisKey).toString()); + } else { + infoVO.setData(redisUtil.getString(redisKey).toString()); + localCache.put(redisKey, infoVO.getData()); + } + + } else { + String keyId = String.valueOf(dataMap.get(swapVModel)); + VisualdevEntity entity = visualdevService.getInfo(swapDataVo.getModelId()); + String propsValue = StringUtil.isNotEmpty(swapDataVo.getPropsValue()) + && swapDataVo.getPropsValue() + .contains(YunzhupaasConst.FIELD_SUFFIX_YUNZHUPAASID) + ? swapDataVo.getPropsValue() + .split(YunzhupaasConst.FIELD_SUFFIX_YUNZHUPAASID)[0] + : swapDataVo.getPropsValue(); + if (Objects.nonNull(entity)) { + if (!StringUtil.isEmpty(entity.getVisualTables()) + && !OnlineDevData.TABLE_CONST.equals(entity.getVisualTables())) { + infoVO = visualDevInfoService.getDetailsDataInfo(keyId, entity, + OnlineInfoModel.builder().needSwap(true).needRlationFiled(false) + .propsValue(propsValue).build()); + } else { + infoVO = visualdevModelDataService.infoDataChange(keyId, entity); + } + } + String data = infoVO == null ? StringUtil.EMPTY : infoVO.getData(); + if (NEEDCACHE_RELATION) { + redisUtil.insert(redisKey, data, DEFAULT_CACHE_TIME); + } + localCache.put(redisKey, data); + } + if (infoVO != null && StringUtil.isNotEmpty(infoVO.getData())) { + Map formDataMap = JsonUtil.stringToMap(infoVO.getData()); + String relationField = swapDataVo.getRelationField(); + if (formDataMap != null && formDataMap.size() > 0) { + dataMap.put(swapDataVo.getVModel() + "_id", dataMap.get(swapVModel)); + dataMap.put(vModel, formDataMap.get(relationField)); + dataDetailMap.put(vModel, formDataMap); + } + } + break; + case YunzhupaasKeyConsts.POPUPSELECT: + case YunzhupaasKeyConsts.POPUPTABLESELECT: + // 是否联动 + List templateJsonModels = JsonUtil + .getJsonToList(swapDataVo.getTemplateJson(), TemplateJsonModel.class); + // DynamicNeedCache = templateJsonModels.size() == 0; + List> mapList; + Map popMaps = new HashMap<>(); + String value = String.valueOf(dataMap.get(swapVModel)); + + List listParam = new ArrayList<>(); + for (TemplateJsonModel templateJsonModel : templateJsonModels) { + String relationField = templateJsonModel.getRelationField(); + DataInterfaceModel dataInterfaceModel = JsonUtil.getJsonToBean(templateJsonModel, + DataInterfaceModel.class); + if (templateJsonModel.getSourceType() != null + && !Objects.equals(templateJsonModel.getSourceType(), 1)) { + String dataValue = paramSourceTypeReplaceValue(templateJsonModel, dataCopyMap); + dataInterfaceModel.setDefaultValue(dataValue); + listParam.add(dataInterfaceModel); + continue; + } + String obj = inlineEdit ? "" + : Optional.ofNullable(dataCopyMap.get(relationField)).orElse("").toString(); + if (relationField.toLowerCase().contains(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX)) { + String childField = relationField.split("-")[1]; + obj = Optional.ofNullable(dataCopyMap.get(childField)).orElse("").toString(); + } else if (mainAndMast != null) { + obj = Optional.ofNullable(mainAndMast.get(relationField)).orElse("").toString(); + } + dataInterfaceModel.setDefaultValue(obj); + listParam.add(dataInterfaceModel); + } + DataInterfacePage dataInterfacePage = new DataInterfacePage(); + dataInterfacePage.setParamList(listParam); + dataInterfacePage.setInterfaceId(swapDataVo.getInterfaceId()); + List ids = new ArrayList<>(); + if (value.startsWith("[")) { + ids = JsonUtil.getJsonToList(value, String.class); + } else { + ids.add(value); + } + dataInterfacePage.setIds(ids); + // 缓存Key 租户-远端数据-base64({id, params, ids}) + redisKey = String.format("%s-%s-%s-%s", dsName, OnlineDataTypeEnum.DYNAMIC.getType(), + swapDataVo.getInterfaceId(), + Base64.getEncoder().encodeToString(JsonUtil.getObjectToString(dataInterfacePage) + .getBytes(StandardCharsets.UTF_8))); + if (localCache.containsKey(redisKey) || redisUtil.exists(redisKey)) { + if (localCache.containsKey(redisKey)) { + mapList = (List>) localCache.get(redisKey); + } else { + List tmpList = redisUtil.get(redisKey, 0, -1); + List> tmpMapList = new ArrayList<>(); + tmpList.forEach(item -> { + tmpMapList.add(JsonUtil.entityToMap(item)); + }); + mapList = tmpMapList; + localCache.put(redisKey, mapList); + } + } else { + dataInterfacePage.setPropsValue(swapDataVo.getPropsValue()); + dataInterfacePage.setRelationField(swapDataVo.getRelationField()); + mapList = dataInterFaceApi.infoToInfo(swapDataVo.getInterfaceId(), + dataInterfacePage); + if (NEEDCACHE_REMOTE && swapDataVo.getConfig().getUseCache()) { + redisUtil.insert(redisKey, mapList, DEFAULT_CACHE_TIME); + } + localCache.put(redisKey, mapList); + } + + StringJoiner stringJoiner = new StringJoiner(","); + List popList = new ArrayList<>(); + if (value.startsWith("[")) { + popList = JsonUtil.getJsonToList(value, String.class); + } else { + popList.add(value); + } + for (String va : popList) { + if (popMaps.size() > 0) { + stringJoiner.add(String.valueOf(popMaps.get(va))); + } else { + Map PopMap = mapList.stream() + .filter(map -> Objects.equals( + String.valueOf(map.get(swapDataVo.getPropsValue())), va)) + .findFirst().orElse(new HashMap<>()); + if (PopMap.size() > 0) { + dataMap.put(vModel + "_id", dataMap.get(swapVModel)); + stringJoiner.add(String.valueOf(PopMap.get(swapDataVo.getRelationField()))); + dataDetailMap.put(vModel, PopMap); + } + } + } + dataMap.put(vModel, String.valueOf(stringJoiner)); + break; + case YunzhupaasKeyConsts.MODIFYTIME: + case YunzhupaasKeyConsts.CREATETIME: + // case YunzhupaasKeyConsts.TIME: + case YunzhupaasKeyConsts.DATE: + // 判断是否为时间戳格式 + Object dateObj = dataMap.get(swapVModel); + LocalDateTime dateTime = LocalDateTimeUtil + .of(new Date(DateTimeFormatConstant.getDateObjToLong(dateObj))); + String format = DateTimeFormatConstant.getFormat(swapDataVo.getFormat()); + + // if (isList && (YunzhupaasKeyConsts.MODIFYTIME.equals(yunzhupaasKey) || + // YunzhupaasKeyConsts.CREATETIME.equals(yunzhupaasKey))) { + // format = DateTimeFormatConstant.YEAR_MOnTH_DHM; + // } + if (StringUtil.isEmpty(format)) { + format = DateTimeFormatConstant.YEAR_MOnTH_DHMS; + } + DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(format); + String date = dateTimeFormatter.format(dateTime); + dataMap.put(vModel, date); + if (YunzhupaasKeyConsts.MODIFYTIME.equals(yunzhupaasKey) + || YunzhupaasKeyConsts.CREATETIME.equals(yunzhupaasKey)) { + dataMap.put(swapDataVo.getVModel(), date); + } + break; + case YunzhupaasKeyConsts.RATE: + case YunzhupaasKeyConsts.SLIDER: + // 滑块评分不需要补零转浮点型 + Double ratevalue = Double.valueOf(0); + if (dataMap.get(swapVModel) != null) { + ratevalue = Double.valueOf(dataMap.get(swapVModel).toString()); + } + dataMap.put(vModel, ratevalue); + break; + case YunzhupaasKeyConsts.UPLOADFZ: + case YunzhupaasKeyConsts.UPLOADIMG: + // 数据传递-乱塞有bug强行置空 + List> fileList = new ArrayList<>(); + try { + fileList = (List) dataMap.get(swapVModel); + } catch (Exception e) { + try { + fileList = JsonUtil.getJsonToListMap(String.valueOf(dataMap.get(swapVModel))); + } catch (Exception e1) { + // e1.printStackTrace(); + } + // e.printStackTrace(); + } + dataMap.put(vModel, fileList); + break; + case YunzhupaasKeyConsts.LOCATION: + // 定位-列表取全名。 + if (isList) { + Map omap = JsonUtil.stringToMap(String.valueOf(dataMap.get(swapVModel))); + dataMap.put(vModel, omap.get("fullAddress") != null ? omap.get("fullAddress") : ""); + } + break; + case YunzhupaasKeyConsts.CHILD_TABLE: + List childrens = swapDataVo.getConfig().getChildren(); + List> childList = (List>) dataMap + .get(swapDataVo.getVModel()); + List> swapList = getSwapList(childList, childrens, visualDevId, + inlineEdit, localCache, isList, dataCopyMap); + dataMap.put(swapDataVo.getVModel(), swapList); + break; + default: + dataMap.put(vModel, dataMap.get(swapVModel)); + break; + } + } + // 关联选择属性 + if (dataDetailMap.size() > 0) { + getDataAttr(swapDataVoList, dataMap, dataDetailMap); + } + } catch (Exception e) { + e.printStackTrace(); + log.error("在线开发转换数据错误:" + e.getMessage()); + } + } + + // 二维码 条形码最后处理 + swapCodeDataInfo(swapDataVoList, dataMap, dataCopyMap); + } + if (inlineEdit && isList) { + for (Map map : list) { + // 行内编辑过滤子表 + swapDataVoList = swapDataVoList.stream().filter(s -> !s.getVModel().contains("tableField")) + .collect(Collectors.toList()); + onlineDevInfoUtils.getInitLineData(swapDataVoList, map); + } + } + return list; + } + + /** + * 按sourceType替换数据接口参数 + */ + public String paramSourceTypeReplaceValue(TemplateJsonModel item, Map dataMap) { + String defaultValue = ""; + if (item.getSourceType() != null) { + switch (item.getSourceType()) { + case 1:// 字段 + defaultValue = item.getDefaultValue(); + break; + case 2:// 自定义 + defaultValue = item.getRelationField(); + break; + case 3:// 为空 + defaultValue = ""; + break; + case 4:// 系统参数 + defaultValue = this.getSystemFieldValue(dataMap, item); + break; + default: + defaultValue = item.getDefaultValue(); + break; + } + } else { + defaultValue = item.getDefaultValue(); + } + return defaultValue; + } + + /** + * 获取系统参数值 + * + * @param dataCopyMap + * @param templateJsonModel + * @return + */ + private String getSystemFieldValue(Map dataCopyMap, TemplateJsonModel templateJsonModel) { + UserInfo userInfo = UserProvider.getUser(); + String relationField = templateJsonModel.getRelationField(); + String dataValue; + if (AuthorizeConditionEnum.FORMID.getCondition().equals(relationField)) { + dataValue = String.valueOf(dataCopyMap.get(FlowFormConstant.ID)); + } else if (AuthorizeConditionEnum.USER.getCondition().equals(relationField)) { + dataValue = userInfo.getUserId(); + } else if (AuthorizeConditionEnum.USERANDUNDER.getCondition().equals(relationField)) { + List subOrganizeIds = new ArrayList<>(); + if (userInfo.getSubordinateIds().size() > 0) { + subOrganizeIds = userInfo.getSubordinateIds(); + } + subOrganizeIds.add(userInfo.getUserId()); + dataValue = subOrganizeIds.stream().collect(Collectors.joining(",")); + } else if (AuthorizeConditionEnum.ORGANIZE.getCondition().equals(relationField)) { + String orgId1 = userInfo.getOrganizeId(); + if (StringUtil.isNotEmpty(userInfo.getDepartmentId())) { + orgId1 = userInfo.getDepartmentId(); + } + dataValue = orgId1; + } else if (AuthorizeConditionEnum.ORGANIZEANDUNDER.getCondition().equals(relationField)) { + String orgId1 = userInfo.getOrganizeId(); + if (StringUtil.isNotEmpty(userInfo.getDepartmentId())) { + orgId1 = userInfo.getDepartmentId(); + } + List underOrganizations = organizeApi.getUnderOrganizations(orgId1, false); + underOrganizations.add(orgId1); + dataValue = underOrganizations.stream().collect(Collectors.joining(",")); + } else if (AuthorizeConditionEnum.BRANCHMANAGEORG.getCondition().equals(relationField)) { + List orgIds1 = organizeAdministratorService.getOrganizeUserList(YunzhupaasConst.CURRENT_ORG_SUB); + dataValue = orgIds1.stream().collect(Collectors.joining(",")); + } else { + dataValue = templateJsonModel.getDefaultValue(); + } + return dataValue; + } + + /** + * 保存需要转换的数据到redis(系统控件) + * + * @param swapDataVoList + * @param visualDevId + * @param localCache + */ + public void sysNeedSwapData(List swapDataVoList, String visualDevId, Map localCache) { + // 公共数据 + String dsName = Optional.ofNullable(TenantHolder.getDatasourceId()).orElse(""); + + String redisKey; + try { + boolean needUser = false, needOrg = false, needPos = false, needRole = false, needGroup = false, + needProvince = false; + for (FieLdsModel swapDataVo : swapDataVoList) { + String yunzhupaasKey = swapDataVo.getConfig().getYunzhupaasKey(); + String dataType = swapDataVo.getConfig().getDataType(); + switch (yunzhupaasKey) { + case YunzhupaasKeyConsts.CHILD_TABLE: + List children = swapDataVo.getConfig().getChildren(); + sysNeedSwapData(children, visualDevId, localCache); + break; + // 用户组件 + case YunzhupaasKeyConsts.USERSELECT: + // 创建用户 + case YunzhupaasKeyConsts.CREATEUSER: + // 修改用户 + case YunzhupaasKeyConsts.MODIFYUSER: + needUser = true; + break; + // 公司组件 + case YunzhupaasKeyConsts.COMSELECT: + // 部门组件 + case YunzhupaasKeyConsts.DEPSELECT: + // 所属部门 + case YunzhupaasKeyConsts.CURRDEPT: + // 所属组织 + case YunzhupaasKeyConsts.CURRORGANIZE: + needOrg = true; + break; + // 岗位组件 + case YunzhupaasKeyConsts.POSSELECT: + // 所属岗位 + case YunzhupaasKeyConsts.CURRPOSITION: + needPos = true; + break; + // 角色选择 + case YunzhupaasKeyConsts.ROLESELECT: + needRole = true; + break; + // 分组选择 + case YunzhupaasKeyConsts.GROUPSELECT: + needGroup = true; + break; + // 用户选择组件 + case YunzhupaasKeyConsts.CUSTOMUSERSELECT: + needUser = needOrg = needPos = needGroup = needRole = true; + break; + // 省市区选择组件 + case YunzhupaasKeyConsts.ADDRESS: + needProvince = true; + break; + default: + break; + } + if (dataType != null) { + // 数据接口的数据存放 + String label = swapDataVo.getProps().getLabel() != null ? swapDataVo.getProps().getLabel() : ""; + String value = swapDataVo.getProps().getValue() != null ? swapDataVo.getProps().getValue() : ""; + String children = swapDataVo.getProps().getChildren() != null ? swapDataVo.getProps().getChildren() + : ""; + List> options = new ArrayList<>(); + if (swapDataVo.getConfig().getYunzhupaasKey().equals(YunzhupaasKeyConsts.POPUPSELECT) + || swapDataVo.getConfig().getYunzhupaasKey().equals(YunzhupaasKeyConsts.POPUPTABLESELECT)) { + label = swapDataVo.getRelationField(); + value = swapDataVo.getPropsValue(); + } + Map dataInterfaceMap = new HashMap<>(16); + String finalValue = value; + String finalLabel = label; + // 静态数据 + if (dataType.equals(OnlineDataTypeEnum.STATIC.getType())) { + redisKey = String.format("%s-%s-%s", visualDevId, + swapDataVo.getConfig().getRelationTable() + swapDataVo.getVModel(), + OnlineDataTypeEnum.STATIC.getType()); + if (!localCache.containsKey(redisKey)) { + if (!redisUtil.exists(redisKey)) { + if (swapDataVo.getOptions() != null) { + options = JsonUtil.getJsonToListMap(swapDataVo.getOptions()); + JSONArray data = JsonUtil.getListToJsonArray(options); + getOptions(label, value, children, data, options); + } else { + options = JsonUtil.getJsonToListMap(swapDataVo.getOptions()); + } + + options.stream().forEach(o -> { + dataInterfaceMap.put(String.valueOf(o.get(finalValue)), + String.valueOf(o.get(finalLabel))); + }); + if (NEEDCACHE_REMOTE) { + redisUtil.insert(redisKey, dataInterfaceMap, DEFAULT_CACHE_TIME); + } + localCache.put(redisKey, dataInterfaceMap); + } else { + localCache.put(redisKey, redisUtil.getMap(redisKey)); + } + } + } + // 远端数据 + if (dataType.equals(OnlineDataTypeEnum.DYNAMIC.getType())) { + // 联动状态下不做缓存, 具体查数据时做缓存 + boolean dynamicIsNeedCache = swapDataVo.getConfig().getTemplateJson().size() == 0; + if (dynamicIsNeedCache) { + redisKey = String.format("%s-%s-%s-%s-%s-%s", dsName, OnlineDataTypeEnum.DYNAMIC.getType(), + swapDataVo.getConfig().getPropsUrl(), value, label, children); + if (!localCache.containsKey(redisKey)) { + if (!redisUtil.exists(redisKey)) { + ActionResult data = dataInterFaceApi.infoToId(swapDataVo.getConfig().getPropsUrl(), + null, null); + if (data != null && data.getData() != null) { + List> dataList = new ArrayList<>(); + if (data.getData() instanceof List) { + dataList = (List>) data.getData(); + } + JSONArray dataAll = JsonUtil.getListToJsonArray(dataList); + treeToList(label, value, children, dataAll, options); + options.stream().forEach(o -> { + dataInterfaceMap.put(String.valueOf(o.get(finalValue)), + String.valueOf(o.get(finalLabel))); + }); + if (NEEDCACHE_REMOTE && CollectionUtils.isNotEmpty(dataList) + && !YunzhupaasKeyConsts.TREESELECT.equals(yunzhupaasKey) + && swapDataVo.getConfig().getUseCache()) { + redisUtil.insert(redisKey, dataInterfaceMap, DEFAULT_CACHE_TIME); + } + localCache.put(redisKey, dataInterfaceMap); + } + } else { + localCache.put(redisKey, redisUtil.getMap(redisKey)); + } + } + } + } + // 数据字典 + if (dataType.equals(OnlineDataTypeEnum.DICTIONARY.getType())) { + redisKey = String.format("%s-%s-%s", dsName, OnlineDataTypeEnum.DICTIONARY.getType(), + swapDataVo.getConfig().getDictionaryType()); + if (!localCache.containsKey(redisKey)) { + if (!redisUtil.exists(redisKey)) { + List list = dictionaryDataApi + .getDicList(swapDataVo.getConfig().getDictionaryType()); + options = list.stream().map(dic -> { + Map dictionaryMap = new HashMap<>(16); + dictionaryMap.put("id", dic.getId()); + dictionaryMap.put("enCode", dic.getEnCode()); + dictionaryMap.put("fullName", dic.getFullName()); + return dictionaryMap; + }).collect(Collectors.toList()); + String dictionaryData = JsonUtil.getObjectToString(options); + if (NEEDCACHE_REMOTE) { + redisUtil.insert(redisKey, dictionaryData, DEFAULT_CACHE_TIME); + } + localCache.put(redisKey, options); + } else { + String dictionaryStringData = redisUtil.getString(redisKey).toString(); + localCache.put(redisKey, JsonUtil.getJsonToListMap(dictionaryStringData)); + } + } + } + } + } + // 有使用相关组件的情况才初始化数据 + if (needUser && !localCache.containsKey("__user_map")) { + // 人员 + redisKey = dsName + CacheKeyEnum.USER.getName(); + Map userMap; + if (redisUtil.exists(redisKey)) { + userMap = redisUtil.getMap(redisKey); + userMap = Optional.ofNullable(userMap).orElse(new HashMap<>(20)); + } else { + userMap = userApi.getUserMap(); + if (NEEDCACHE_SYS) { + redisUtil.insert(redisKey, userMap, DEFAULT_CACHE_TIME); + } + } + localCache.put("__user_map", userMap); + } + if (needOrg && !localCache.containsKey("__org_map")) { + // 组织 + redisKey = dsName + CacheKeyEnum.ORG.getName(); + Map orgMap; + if (redisUtil.exists(redisKey)) { + orgMap = redisUtil.getMap(redisKey); + orgMap = Optional.ofNullable(orgMap).orElse(new HashMap<>(20)); + } else { + orgMap = organizeApi.getOrgMap(); + if (NEEDCACHE_SYS) { + redisUtil.insert(redisKey, orgMap, DEFAULT_CACHE_TIME); + } + } + localCache.put("__org_map", orgMap); + } + /* + * if(needOrg && !localCache.containsKey("__allOrg_map")){ + * //组织需要递归显示 + * Map allOrgMap = redisUtil.getMap(dsName + + * CacheKeyEnum.AllORG.getName()); + * allOrgMap = Optional.ofNullable(allOrgMap).orElse(new HashMap<>(20)); + * localCache.put("__allOrg_map", allOrgMap); + * } + */ + if (needPos && !localCache.containsKey("__pos_map")) { + // 岗位 + redisKey = dsName + CacheKeyEnum.POS.getName(); + Map posMap; + if (redisUtil.exists(redisKey)) { + posMap = redisUtil.getMap(redisKey); + posMap = Optional.ofNullable(posMap).orElse(new HashMap<>(20)); + } else { + posMap = positionApi.getPosMap(); + if (NEEDCACHE_SYS) { + redisUtil.insert(redisKey, posMap, DEFAULT_CACHE_TIME); + } + } + localCache.put("__pos_map", posMap); + } + if (needRole && !localCache.containsKey("__role_map")) { + // 角色 + redisKey = dsName + CacheKeyEnum.ROLE.getName(); + Map roleMap; + if (redisUtil.exists(redisKey)) { + roleMap = redisUtil.getMap(redisKey); + roleMap = Optional.ofNullable(roleMap).orElse(new HashMap<>(20)); + } else { + roleMap = roleApi.getRoleMap(); + if (NEEDCACHE_SYS) { + redisUtil.insert(redisKey, roleMap, DEFAULT_CACHE_TIME); + } + } + localCache.put("__role_map", roleMap); + } + if (needGroup && !localCache.containsKey("__group_map")) { + // 分组 + redisKey = dsName + CacheKeyEnum.GROUP.getName(); + Map groupMap; + if (redisUtil.exists(redisKey)) { + groupMap = redisUtil.getMap(redisKey); + groupMap = Optional.ofNullable(groupMap).orElse(new HashMap<>(20)); + } else { + groupMap = groupApi.getGroupMap(); + if (NEEDCACHE_SYS) { + redisUtil.insert(redisKey, groupMap, DEFAULT_CACHE_TIME); + } + } + localCache.put("__group_map", groupMap); + } + if (needProvince && !localCache.containsKey("__pro_maplist")) { + // 省市区 + Map proMap = redisUtil.getMap(String.format("%s-%s-%d", dsName, "province", 1)); + List> proMapList = new ArrayList<>(); + if (proMap.size() == 0) { + proMapList = fillProMap(dsName); + } else { + for (int i = 1; i <= 4; i++) { + proMapList.add(redisUtil.getMap(String.format("%s-%s-%d", dsName, "province", i))); + } + } + localCache.put("__pro_maplist", proMapList); + } + } catch (Exception e) { + log.error("在线开发转换数据异常:" + e.getMessage(), e); + } + } + + private List> fillProMap(String dsName) { + List> proMapList = new ArrayList<>(); + // 分级存储 + for (int i = 1; i <= 4; i++) { + String redisKey = String.format("%s-%s-%d", dsName, "province", i); + if (!redisUtil.exists(redisKey)) { + List provinceEntityList = areaApi.getProListBytype(String.valueOf(i)); + Map provinceMap = new HashMap<>(16); + if (provinceEntityList != null) { + provinceEntityList.stream().forEach(p -> provinceMap.put(p.getId(), p.getFullName())); + } + proMapList.add(provinceMap); + // 区划基本不修改 不做是否缓存判断 + redisUtil.insert(redisKey, provinceMap, RedisUtil.CAHCEWEEK); + } + } + return proMapList; + } + + /** + * 级联递归 + * + * @param value + * @param label + * @param children + * @param data + * @param result + */ + public static void treeToList(String value, String label, String children, JSONArray data, + List> result) { + for (int i = 0; i < data.size(); i++) { + JSONObject ob = data.getJSONObject(i); + Map tree = new HashMap<>(16); + tree.put(value, String.valueOf(ob.get(value))); + tree.put(label, String.valueOf(ob.get(label))); + result.add(tree); + if (ob.get(children) != null) { + JSONArray childArray = ob.getJSONArray(children); + treeToList(value, label, children, childArray, result); + } + } + } + + /** + * 递归查询 + * + * @param label + * @param value + * @param Children + * @param data + * @param options + */ + public static void getOptions(String label, String value, String Children, JSONArray data, + List> options) { + for (int i = 0; i < data.size(); i++) { + JSONObject ob = data.getJSONObject(i); + Map tree = new HashMap<>(16); + tree.put(value, String.valueOf(ob.get(value))); + tree.put(label, String.valueOf(ob.get(label))); + options.add(tree); + if (ob.get(Children) != null) { + JSONArray childrenArray = ob.getJSONArray(Children); + getOptions(label, value, Children, childrenArray, options); + } + } + } + + /** + * 生成关联属性(弹窗选择属性,关联表单属性) + * + * @param fieLdsModelList + * @param dataMap + * @param dataDetailMap + */ + private static void getDataAttr(List fieLdsModelList, Map dataMap, + Map> dataDetailMap) { + for (FieLdsModel fieLdsModel : fieLdsModelList) { + if (ObjectUtil.isEmpty(fieLdsModel)) { + continue; + } + ConfigModel config = fieLdsModel.getConfig(); + String yunzhupaasKey = config.getYunzhupaasKey(); + if (yunzhupaasKey.equals(YunzhupaasKeyConsts.RELATIONFORM_ATTR) + || yunzhupaasKey.equals(YunzhupaasKeyConsts.POPUPSELECT_ATTR)) { + // 0展示数据 ? 1存储数据 + boolean isShow = fieLdsModel.getIsStorage() == 0; + if (isShow) { + String relationField = fieLdsModel.getRelationField(); + if (relationField.contains("_yunzhupaasTable_")) { + relationField = relationField.split("_yunzhupaasTable_")[0]; + } + String showField = fieLdsModel.getShowField(); + Map formDataMap = dataDetailMap.get(relationField); + if (formDataMap != null) { + dataMap.put(relationField + "_" + showField, formDataMap.get(showField)); + } + } + } + } + } + + /** + * 二维码 条形码详情数据 + * + * @param codeList 控件集合 + * @param swapDataMap 转换后的数据 + * @param dataMap 转换前 + * @return + */ + public static void swapCodeDataInfo(List codeList, Map swapDataMap, + Map dataMap) { + for (FieLdsModel formModel : codeList) { + String yunzhupaasKey = formModel.getConfig().getYunzhupaasKey(); + if (yunzhupaasKey.equals(YunzhupaasKeyConsts.QR_CODE) + || yunzhupaasKey.equals(YunzhupaasKeyConsts.BARCODE)) { + String codeDataType = formModel.getDataType(); + if (OnlineDataTypeEnum.RELATION.getType().equals(codeDataType)) { + String relationFiled = formModel.getRelationField(); + if (StringUtil.isNotEmpty(relationFiled)) { + Object relationValue = dataMap.get(relationFiled); + if (ObjectUtil.isNotEmpty(relationValue)) { + swapDataMap.put(relationFiled + "_id", relationValue); + } + } + } + } + } + } + + public ExcelImportModel createExcelData(List> dataList, VisualDevJsonModel visualJsonModel, + VisualdevEntity visualdevEntity) throws WorkFlowException { + ExcelImportModel excelImportModel = new ExcelImportModel(); + Integer primaryKeyPolicy = visualJsonModel.getFormData().getPrimaryKeyPolicy(); + + String uploaderTemplateJson = visualJsonModel.getColumnData().getUploaderTemplateJson(); + UploaderTemplateModel uploaderTemplateModel = JsonUtil.getJsonToBean(uploaderTemplateJson, + UploaderTemplateModel.class); + String dataType = uploaderTemplateModel.getDataType(); + ImportFormCheckUniqueModel uniqueModel = new ImportFormCheckUniqueModel(); + uniqueModel.setMain(true); + uniqueModel.setDbLinkId(visualJsonModel.getDbLinkId()); + uniqueModel.setUpdate(dataType.equals("2")); + uniqueModel.setPrimaryKeyPolicy(primaryKeyPolicy); + uniqueModel.setLogicalDelete(visualJsonModel.getFormData().getLogicalDelete()); + uniqueModel.setTableModelList(visualJsonModel.getVisualTables()); + DbLinkEntity linkEntity = dataSourceApi.getInfo(visualJsonModel.getDbLinkId()); + uniqueModel.setLinkEntity(linkEntity); + // 流程表单导入,传流程大id查询小idlist用于过滤数据 + String mainFlowID = null; + if (StringUtil.isNotEmpty(visualJsonModel.getFlowId())) { + List flowVersionIds = templateApi.getFlowIdsByTemplate(visualJsonModel.getFlowId()); + uniqueModel.setFlowId(visualJsonModel.getFlowId()); + uniqueModel.setFlowIdList( + flowVersionIds.stream().map(TemplateJsonEntity::getId).distinct().collect(Collectors.toList())); + mainFlowID = flowVersionIds.stream().filter(t -> Objects.equals(t.getState(), 1)).findFirst() + .orElse(new TemplateJsonEntity()).getId(); + } + + // 获取缓存 + Map localCache = getlocalCache(); + List> failResult = new ArrayList<>(); + + List dataInfo = new ArrayList<>(); + try { + for (int i = 0, len = dataList.size(); i < len; i++) { + Map data = dataList.get(i); + // 导入时默认第一个流程 + data.put(FlowFormConstant.FLOWID, mainFlowID); + Map resultMap = new HashMap<>(data); + StringJoiner errInfo = new StringJoiner(","); + Map errorMap = new HashMap<>(data); + + List errList = this.checkExcelData(visualJsonModel.getFormListModels(), data, localCache, + resultMap, errorMap, uniqueModel); + + // 业务主键判断--导入新增或者跟新 + VisualErrInfo visualErrInfo; + try { + DynamicDataSourceUtil.switchToDataSource(linkEntity); + visualErrInfo = formCheckUtils.checkBusinessKey(visualJsonModel.getFormListModels(), resultMap, + visualJsonModel.getVisualTables(), visualJsonModel.getFormData(), null); + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + + if (uniqueModel.isUpdate()) { + if (ObjectUtil.isNotEmpty(visualErrInfo) && StringUtil.isNotEmpty(visualErrInfo.getId())) { + uniqueModel.setId(visualErrInfo.getId()); + // 判断流程是否已发起 + if (StringUtil.isNotEmpty(visualErrInfo.getFlowTaskId())) { + String finalTaskId = visualErrInfo.getFlowTaskId(); + List flowIdList = new ArrayList<>(); + flowIdList.add(finalTaskId); + List tasks = taskApi.getInfosSubmit(flowIdList.toArray(new String[] {}), + TaskEntity::getStatus, TaskEntity::getId); + if (tasks.size() > 0) { + boolean errorMsg = tasks.stream().filter(t -> Objects.equals(t.getStatus(), 0)) + .count() == 0; + String msg = "已发起流程,导入失败"; + if (errorMsg) { + errorMap.put("errorsInfo", msg); + failResult.add(errorMap); + continue; + } + } + } + } + } else { + if (ObjectUtil.isNotEmpty(visualErrInfo) && StringUtil.isNotEmpty(visualErrInfo.getErrMsg())) { + errorMap.put("errorsInfo", visualErrInfo.getErrMsg()); + failResult.add(errorMap); + continue; + } + } + this.checkUnique(visualJsonModel.getFormListModels(), data, errList, uniqueModel); + + errList.stream().forEach(t -> { + if (StringUtil.isNotEmpty(t)) { + errInfo.add(t); + } + }); + if (errInfo.length() > 0) { + errorMap.put("errorsInfo", errInfo.toString()); + failResult.add(errorMap); + } else { + VisualdevModelDataInfoVO infoVO = new VisualdevModelDataInfoVO(); + + if (StringUtil.isNotEmpty(uniqueModel.getId())) { + visualdevModelDataService.visualUpdate( + VisualParamModel.builder().visualdevEntity(visualdevEntity).data(resultMap) + .id(uniqueModel.getId()).isUpload(true).build()); + infoVO.setId(uniqueModel.getId()); + infoVO.setIntegrateId(uniqueModel.getId()); + infoVO.setData(JsonUtil.getObjectToString(resultMap)); + } else { + DataModel dataModel = visualdevModelDataService.visualCreate( + VisualParamModel.builder().visualdevEntity(visualdevEntity).data(resultMap) + .isUpload(true).build()); + infoVO.setId(dataModel.getMainId()); + infoVO.setData(JsonUtil.getObjectToString(resultMap)); + } + dataInfo.add(infoVO); + } + } + } catch (Exception e) { + e.printStackTrace(); + throw new WorkFlowException(MsgCode.IMP004.get()); + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + excelImportModel.setFnum(failResult.size()); + excelImportModel.setSnum(dataList.size() - failResult.size()); + excelImportModel.setResultType(failResult.size() > 0 ? 1 : 0); + excelImportModel.setFailResult(failResult); + excelImportModel.setDataInfoList(dataInfo); + return excelImportModel; + } + + /** + * 获取系统控件缓存数据 + */ + public Map getlocalCache() { + Map localCache = new HashMap<>(); + // 读取系统控件 所需编码 id + Map depMap = organizeApi.getOrgEncodeAndName("department"); + localCache.put("_dep_map", depMap); + Map comMap = organizeApi.getOrgNameAndId(""); + localCache.put("_com_map", comMap); + Map posMap = positionApi.getPosEncodeAndName(); + localCache.put("_pos_map", posMap); + Map userMap = userApi.getUserNameAndIdMap(); + localCache.put("_user_map", userMap); + Map roleMap = roleApi.getRoleNameAndIdMap(); + localCache.put("_role_map", roleMap); + Map groupMap = groupApi.getGroupEncodeMap(); + localCache.put("_group_map", groupMap); + Map allOrgsTreeName = organizeApi.getAllOrgsTreeName(); + localCache.put("_com_tree_map", allOrgsTreeName); + + Map orgIdNameMaps = organizeApi.getInfoList(); + List idAll = new ArrayList<>(); + List orgList = orgList(YunzhupaasConst.CURRENT_ORG_TYPE, false, orgIdNameMaps); + localCache.put("_org_list", orgList); + List orgSubList = orgList(YunzhupaasConst.CURRENT_ORG_SUB_TYPE, false, orgIdNameMaps); + localCache.put("_orgSub_list", orgSubList); + List gradeList = orgList(YunzhupaasConst.CURRENT_GRADE_TYPE, false, orgIdNameMaps); + localCache.put("_grade_list", gradeList); + List orgListStr = orgList(YunzhupaasConst.CURRENT_ORG_TYPE, true, orgIdNameMaps); + localCache.put("_org_listStr", orgListStr); + List orgSubListStr = orgList(YunzhupaasConst.CURRENT_ORG_SUB_TYPE, true, orgIdNameMaps); + localCache.put("_orgSub_listStr", orgSubListStr); + List gradeListStr = orgList(YunzhupaasConst.CURRENT_GRADE_TYPE, true, orgIdNameMaps); + localCache.put("_grade_listStr", gradeListStr); + idAll.addAll(orgList); + idAll.addAll(orgSubList); + idAll.addAll(gradeList); + List relationList = organizeRelationApi.getRelationListByOrganizeId(idAll, ""); + List listByObjectIdAll = userRelationApi.getListByObjectIdAll(idAll); + for (UserRelationEntity userRelationEntity : listByObjectIdAll) { + OrganizeRelationEntity model = new OrganizeRelationEntity(); + model.setObjectType(PermissionConst.USER); + model.setOrganizeId(userRelationEntity.getObjectId()); + model.setObjectId(userRelationEntity.getUserId()); + relationList.add(model); + } + localCache.put("_relation_list", relationList); + return localCache; + } + + /** + * 获取组织id + * + * @param type + * @param isTree true 返回【xxx,xxx】json树形列表 | false 返回 xxx 最后组织id列表 + * @return + */ + public List orgList(String type, boolean isTree, Map orgIdNameMaps) { + List org = new ArrayList() { + { + add(type); + } + }; + OrganizeConditionModel orgType = new OrganizeConditionModel(); + orgType.setDepartIds(org); + orgType.setOrgIdNameMaps(orgIdNameMaps); + List orgList = new ArrayList<>(); + List orgIdsList = organizeRelationApi.getOrgIdsList(orgType); + for (OrganizeModel organizeModel : orgIdsList) { + if (isTree) { + List treeList = StringUtil.isNotEmpty(organizeModel.getOrganizeIdTree()) + ? Arrays.asList(organizeModel.getOrganizeIdTree().split(",")) + : new ArrayList<>(); + orgList.add(JsonUtil.getListToJsonArray(treeList).toJSONString()); + } else { + orgList.add(organizeModel.getId()); + } + } + return orgList; + } + + public List checkExcelData(List modelList, Map data, + Map localCache, Map insMap, + Map errorMap, ImportFormCheckUniqueModel uniqueModel) { + List errList = new ArrayList<>(modelList.size()); + try { + UserInfo userInfo = UserProvider.getUser(); + UserEntity userEntity = userApi.getInfo(userInfo.getUserId()); + + // 读取系统控件 所需编码 id + Map depMap = (Map) localCache.get("_dep_map"); + Map comMap = (Map) localCache.get("_com_map"); + Map posMap = (Map) localCache.get("_pos_map"); + Map userMap = (Map) localCache.get("_user_map"); + Map roleMap = (Map) localCache.get("_role_map"); + Map groupMap = (Map) localCache.get("_group_map"); + Map allOrgsTreeName = (Map) localCache.get("_com_tree_map"); + + List orgList = (List) localCache.get("_org_list"); + List orgSubList = (List) localCache.get("_orgSub_list"); + List gradeList = (List) localCache.get("_grade_list"); + List orgListStr = (List) localCache.get("_org_listStr"); + List orgSubListStr = (List) localCache.get("_orgSub_listStr"); + List gradeListStr = (List) localCache.get("_grade_listStr"); + List relationListAll = (List) localCache + .get("_relation_list"); + + // 异常数据 + for (int i = 0; i < modelList.size(); i++) { + FieLdsModel swapDataVo = modelList.get(i); + errList.add(i, ""); + try { + String yunzhupaasKey = swapDataVo.getConfig().getYunzhupaasKey(); + String dataType = swapDataVo.getConfig().getDataType(); + Object valueO = data.get(swapDataVo.getVModel()); + String label = swapDataVo.getConfig().getLabel(); + // 不支持导入控件 + if (YunzhupaasKeyConsts.getUploadMaybeNull().contains(yunzhupaasKey)) { + insMap.put(swapDataVo.getVModel(), null); + continue; + } + // 是否必填 + boolean required = swapDataVo.getConfig().isRequired(); + if (valueO == null || "null".equals(valueO) || StringUtil.isEmpty(String.valueOf(valueO))) { + if (required) { + errList.set(i, label + "不能为空"); + } + continue; + } + String value = String.valueOf(valueO); + if (StringUtil.isEmpty(value)) { + continue; + } + Boolean multiple = swapDataVo.getMultiple(); + if (YunzhupaasKeyConsts.CHECKBOX.equals(yunzhupaasKey)) { + multiple = true; + } + if (YunzhupaasKeyConsts.CASCADER.equals(yunzhupaasKey)) { + multiple = swapDataVo.getMultiple(); + } + + boolean valueMul = value.contains(","); + value = value.trim(); + List valueList = valueMul ? Arrays.asList(value.split(",")) : new ArrayList<>(); + if (!valueMul) { + valueList.add(value); + } + String ableIds = swapDataVo.getAbleIds() != null ? swapDataVo.getAbleIds() : "[]"; + OnlineCusCheckModel cusCheckModel = AbleUtil.ableModel(ableIds, yunzhupaasKey); + List ableSystemIds = cusCheckModel.getAbleSystemIds(); + List idList = new ArrayList<>(); + List idStr = new ArrayList<>(); + List orgUserList = new ArrayList<>(); + for (String systemId : ableSystemIds) { + if (YunzhupaasConst.CURRENT_ORG_TYPE.equals(systemId) + || YunzhupaasConst.CURRENT_ORG.equals(systemId)) { + idList.addAll(orgList); + idStr.addAll(orgListStr); + orgUserList.addAll(orgList); + } + if (YunzhupaasConst.CURRENT_GRADE_TYPE.equals(systemId) + || YunzhupaasConst.CURRENT_GRADE.equals(systemId)) { + idList.addAll(gradeList); + idStr.addAll(gradeListStr); + orgUserList.addAll(gradeList); + } + if (YunzhupaasConst.CURRENT_ORG_SUB_TYPE.equals(systemId) + || YunzhupaasConst.CURRENT_ORG_SUB.equals(systemId)) { + idList.addAll(orgSubList); + idStr.addAll(orgSubListStr); + orgUserList.addAll(orgSubList); + } + } + cusCheckModel.getAbleComIds().addAll(idList); + cusCheckModel.getAbleDepIds().addAll(idList); + cusCheckModel.getAbleComIdsStr().addAll(idStr); + List relationList = relationListAll.stream() + .filter(t -> orgUserList.contains(t.getOrganizeId())).collect(Collectors.toList()); + Map> relationMap = relationList.stream() + .collect(Collectors.groupingBy(OrganizeRelationEntity::getObjectType)); + for (String key : relationMap.keySet()) { + List list = relationMap.get(key).stream().map(OrganizeRelationEntity::getObjectId) + .collect(Collectors.toList()); + for (String objectId : list) { + if (PermissionConst.ROLE.equalsIgnoreCase(key)) { + cusCheckModel.getAbleRoleIds().add(objectId); + cusCheckModel.getAbleIds().add(objectId + "--" + PermissionConst.ROLE.toLowerCase()); + } + if (PermissionConst.POSITION.equalsIgnoreCase(key)) { + cusCheckModel.getAblePosIds().add(objectId); + cusCheckModel.getAbleIds() + .add(objectId + "--" + PermissionConst.POSITION.toLowerCase()); + } + if (PermissionConst.USER.equalsIgnoreCase(key)) { + cusCheckModel.getAbleUserIds().add(objectId); + cusCheckModel.getAbleIds().add(objectId + "--" + PermissionConst.USER.toLowerCase()); + } + if (PermissionConst.GROUP.equalsIgnoreCase(key)) { + cusCheckModel.getAbleGroupIds().add(objectId); + cusCheckModel.getAbleIds().add(objectId + "--" + PermissionConst.GROUP.toLowerCase()); + } + if (PermissionConst.DEPARTMENT.equalsIgnoreCase(key)) { + cusCheckModel.getAbleDepIds().add(objectId); + cusCheckModel.getAbleIds() + .add(objectId + "--" + PermissionConst.DEPARTMENT.toLowerCase()); + } + if (PermissionConst.ORGANIZE.equalsIgnoreCase(key)) { + cusCheckModel.getAbleComIds().add(objectId); + cusCheckModel.getAbleIds() + .add(objectId + "--" + PermissionConst.ORGANIZE.toLowerCase()); + } + } + } + cusCheckModel.setControlType(yunzhupaasKey); + List dataList; + switch (yunzhupaasKey) { + case YunzhupaasKeyConsts.NUM_INPUT: + String regNum = "-?\\d+(\\.\\d+)?"; + if (StringUtil.isNotEmpty(value) && !value.matches(regNum)) { + errList.set(i, label + "值不正确"); + break; + } + // 有精度,验证精度 + BigDecimal valueDecimal = null; + try { + valueDecimal = new BigDecimal(value); + } catch (Exception e) { + } + if (valueDecimal == null) { + errList.set(i, label + "值不正确"); + break; + } + int configPrecision = swapDataVo.getPrecision() == null ? 0 : swapDataVo.getPrecision(); + if (valueDecimal.scale() > configPrecision) { + errList.set(i, label + "值的精度不正确"); + break; + } + if (swapDataVo.getMin() != null) { + if (valueDecimal.compareTo(new BigDecimal(swapDataVo.getMin())) < 0) { + errList.set(i, label + "值不能小于最小值"); + break; + } + } + if (swapDataVo.getMax() != null) { + if (valueDecimal.compareTo(new BigDecimal(swapDataVo.getMax())) > 0) { + errList.set(i, label + "值不能大于最大值"); + break; + } + } + break; + /** + * 高级控件 + */ + case YunzhupaasKeyConsts.COMSELECT: + if (!multiple && valueList.size() > 1) { + errList.set(i, label + "值不正确"); + break; + } + // 验证值是否正确 + List> comTwoList = new ArrayList<>(); + List comOneList = new ArrayList<>(); + boolean comErrorHapen = false; + for (String comValue : valueList) { + if (StringUtil.isEmpty(comValue)) { + errList.set(i, label + "值不正确"); + comErrorHapen = true; + break; + } + boolean find = false; + for (String key : allOrgsTreeName.keySet()) { + Object o = allOrgsTreeName.get(key); + if (comValue.equals(o.toString())) { + String[] split = key.split(","); + comOneList.addAll(Arrays.asList(split)); + comTwoList.add(Arrays.asList(split)); + find = true; + break; + } + } + if (!find) { + errList.set(i, label + "值不正确"); + comErrorHapen = true; + break; + } + } + if (comErrorHapen) { + break; + } + // 判断是否是可选范围 + insMap.put(swapDataVo.getVModel(), !multiple ? JsonUtil.getObjectToString(comOneList) + : JsonUtil.getObjectToString(comTwoList)); + if ("custom".equals(swapDataVo.getSelectType())) { + List strList = new ArrayList<>(); + for (List strings : comTwoList) { + strList.add(JsonUtil.getListToJsonArray(strings).toJSONString()); + } + cusCheckModel.setDataList(strList); + checkCustomControl(cusCheckModel, errList, i, label); + } + break; + case YunzhupaasKeyConsts.DEPSELECT: + dataList = checkOptionsControl(multiple, insMap, swapDataVo.getVModel(), label, depMap, + valueList, errList, i); + if (dataList.size() == valueList.size() && swapDataVo.getSelectType().equals("custom")) { + cusCheckModel.setDataList(dataList); + checkCustomControl(cusCheckModel, errList, i, label); + } + break; + case YunzhupaasKeyConsts.POSSELECT: + dataList = checkOptionsControl(multiple, insMap, swapDataVo.getVModel(), label, posMap, + valueList, errList, i); + if (dataList.size() == valueList.size() && swapDataVo.getSelectType().equals("custom")) { + cusCheckModel.setDataList(dataList); + checkCustomControl(cusCheckModel, errList, i, label); + } + break; + case YunzhupaasKeyConsts.USERSELECT: + dataList = checkOptionsControl(multiple, insMap, swapDataVo.getVModel(), label, userMap, + valueList, errList, i); + if (dataList.size() == valueList.size() && swapDataVo.getSelectType().equals("custom")) { + cusCheckModel.setDataList(dataList); + checkCustomControl(cusCheckModel, errList, i, label); + } + break; + case YunzhupaasKeyConsts.CUSTOMUSERSELECT: + boolean cusUserErrorHapen = false; + if (!multiple) { + // 非多选填入多选值 + if (valueList.size() > 1) { + cusUserErrorHapen = true; + errList.set(i, label + "值不正确"); + } + } + if (!cusUserErrorHapen) { + boolean cusUserErrorHapen1 = false; + List cusUserList = new ArrayList<>(); + for (String va : valueList) { + if (StringUtil.isEmpty(va)) { + cusUserErrorHapen1 = true; + break; + } + String type = null; + String id = null; + if (groupMap.get(va) != null) { + type = "group"; + id = groupMap.get(va).toString(); + } else if (roleMap.get(va) != null) { + type = "role"; + id = roleMap.get(va).toString(); + } else if (depMap.get(va) != null) { + type = "department"; + id = depMap.get(va).toString(); + } else if (comMap.get(va) != null) { + type = "company"; + id = comMap.get(va).toString(); + } else if (posMap.get(va) != null) { + type = "position"; + id = posMap.get(va).toString(); + } else if (userMap.get(va) != null) { + type = "user"; + id = userMap.get(va).toString(); + } + if (type == null && id == null) { + cusUserErrorHapen1 = true; + } else { + String lastCusId = id + "--" + type; + cusUserList.add(lastCusId); + } + } + if (cusUserErrorHapen1) { + errList.set(i, label + "值不正确"); + } else { + insMap.put(swapDataVo.getVModel(), + !multiple ? cusUserList.get(0) : JsonUtil.getObjectToString(cusUserList)); + if (swapDataVo.getSelectType().equals("custom")) { + cusCheckModel.setDataList(cusUserList); + checkCustomControl(cusCheckModel, errList, i, label); + } + } + } + break; + case YunzhupaasKeyConsts.ROLESELECT: + dataList = checkOptionsControl(multiple, insMap, swapDataVo.getVModel(), label, roleMap, + valueList, errList, i); + if (dataList.size() == valueList.size() && swapDataVo.getSelectType().equals("custom")) { + cusCheckModel.setDataList(dataList); + checkCustomControl(cusCheckModel, errList, i, label); + } + break; + case YunzhupaasKeyConsts.GROUPSELECT: + dataList = checkOptionsControl(multiple, insMap, swapDataVo.getVModel(), label, groupMap, + valueList, errList, i); + if (dataList.size() == valueList.size() && swapDataVo.getSelectType().equals("custom")) { + cusCheckModel.setDataList(dataList); + checkCustomControl(cusCheckModel, errList, i, label); + } + break; + case YunzhupaasKeyConsts.ADDRESS: + if (!multiple && valueList.size() > 1) { + errList.set(i, label + "值不正确"); + break; + } + boolean errorHapen = false; + valueList = Arrays.asList(value.split(",")); + List addresss = new ArrayList<>(); + List addressList1 = new ArrayList<>(); + for (String va : valueList) { + if (StringUtil.isEmpty(va)) { + errList.set(i, label + "值不正确"); + errorHapen = true; + break; + } + String[] addressSplit = va.split("/"); + if (addressSplit.length != swapDataVo.getLevel() + 1) { + errList.set(i, label + "值的格式不正确"); + errorHapen = true; + break; + } + List addressJoined = new ArrayList<>(); + List addressParentID = new ArrayList<>(); + for (String add : addressSplit) { + ProvinceEntity PRO = areaApi.getInfo(add, addressParentID); + if (PRO == null) { + errList.set(i, label + "值不正确"); + errorHapen = true; + break; + } else { + addressJoined.add(PRO.getId()); + addressParentID.add(PRO.getId()); + } + } + if (errorHapen) { + break; + } + addressList1.addAll(addressJoined); + addresss.add(addressJoined.toArray(new String[addressJoined.size()])); + } + if (errorHapen) { + break; + } + insMap.put(swapDataVo.getVModel(), multiple ? JsonUtil.getObjectToString(addresss) + : JsonUtil.getObjectToString(addressList1)); + break; + /** + * 系统控件 + */ + case YunzhupaasKeyConsts.CURRORGANIZE: + List OrgRelations = userRelationApi + .getListByUserId(userInfo.getUserId(), PermissionConst.ORGANIZE); + insMap.put(swapDataVo.getVModel(), + OrgRelations.size() > 0 ? OrgRelations.get(0).getObjectId() : null); + break; + case YunzhupaasKeyConsts.CURRDEPT: + List depUserRelations = userRelationApi + .getListByUserId(userInfo.getUserId(), PermissionConst.DEPARTMENT); + insMap.put(swapDataVo.getVModel(), + depUserRelations.size() > 0 ? depUserRelations.get(0).getObjectId() : null); + break; + case YunzhupaasKeyConsts.CREATEUSER: + insMap.put(swapDataVo.getVModel(), userEntity.getId()); + break; + case YunzhupaasKeyConsts.CREATETIME: + insMap.put(swapDataVo.getVModel(), DateUtil.getNow()); + break; + case YunzhupaasKeyConsts.MODIFYTIME: + break; + case YunzhupaasKeyConsts.MODIFYUSER: + break; + case YunzhupaasKeyConsts.CURRPOSITION: + insMap.put(swapDataVo.getVModel(), userEntity.getPositionId()); + break; + /** + * 基础控件 + */ + case YunzhupaasKeyConsts.SWITCH: + String activeTxt = swapDataVo.getActiveTxt(); + String inactiveTxt = swapDataVo.getInactiveTxt(); + if (value.equals(activeTxt)) { + insMap.put(swapDataVo.getVModel(), 1); + } else if (value.equals(inactiveTxt)) { + insMap.put(swapDataVo.getVModel(), 0); + } else { + errList.set(i, label + "值不正确"); + } + break; + case YunzhupaasKeyConsts.RATE: + Double ratevalue = null; + try { + ratevalue = Double.valueOf(value); + if (ratevalue == null) { + errList.set(i, label + "值不正确"); + break; + } + } catch (Exception e) { + errList.set(i, label + "值不正确"); + break; + } + Double maxvalue = Double.valueOf(0); + if (swapDataVo.getCount() != -1) { + maxvalue = Double.valueOf(swapDataVo.getCount()); + } + if (ratevalue > maxvalue) { + errList.set(i, label + "值不能大于最大值"); + break; + } + if (swapDataVo.getAllowhalf()) { + if (ratevalue % 0.5 != 0 || ratevalue < 0) { + errList.set(i, label + "值不正确"); + } + } else { + if (ratevalue % 1 != 0 || ratevalue < 0) { + errList.set(i, label + "值不正确"); + } + } + insMap.put(swapDataVo.getVModel(), ratevalue); + break; + case YunzhupaasKeyConsts.SLIDER: + BigDecimal Ivalue = null; + try { + Ivalue = new BigDecimal(value); + if (Ivalue == null) { + errList.set(i, label + "值不正确"); + break; + } + } catch (Exception e) { + errList.set(i, label + "值不正确"); + break; + } + if (swapDataVo.getMin() != null) { + BigDecimal min = new BigDecimal(swapDataVo.getMin()); + if (Ivalue.compareTo(min) == -1) { + errList.set(i, label + "值不能小于最小值"); + break; + } + } + if (swapDataVo.getMax() != null) { + BigDecimal max = new BigDecimal(swapDataVo.getMax()); + if (Ivalue.compareTo(max) == 1) { + errList.set(i, label + "值不能大于最大值"); + break; + } + } + insMap.put(swapDataVo.getVModel(), Ivalue); + break; + case YunzhupaasKeyConsts.TEXTAREA: + if (StringUtil.isNotEmpty(swapDataVo.getMaxlength())) { + if (value.length() > Integer.valueOf(swapDataVo.getMaxlength())) { + errList.set(i, label + "值超出最多输入字符限制"); + break; + } + } + break; + case YunzhupaasKeyConsts.COM_INPUT: + // 只验证子表。主副表在外面做唯一验证 + Boolean unique = swapDataVo.getConfig().getUnique(); + if (!uniqueModel.isMain()) { + if (StringUtil.isNotEmpty(swapDataVo.getMaxlength())) { + if (value.length() > Integer.valueOf(swapDataVo.getMaxlength())) { + errList.set(i, label + "值超出最多输入字符限制"); + break; + } + } + boolean comInputError = false; + if (unique) { + // 子表重复只判断同一个表单 + if (insMap.get("child_table_list") != null) { + List> childList = uniqueModel.getChildMap(); + String finalValue = value; + for (int j = 0; j < childList.size(); j++) { + Map t = childList.get(j); + if (finalValue.equals(t.get(swapDataVo.getVModel()))) { + comInputError = true; + errList.set(i, label + "值已存在"); + uniqueModel.setChildIndex(j); + break; + } + } + } + } + // 验证正则 + if (StringUtil.isNotEmpty(swapDataVo.getConfig().getRegList())) { + List regList = JsonUtil + .getJsonToList(swapDataVo.getConfig().getRegList(), RegListModel.class); + for (RegListModel regListModel : regList) { + // 处理正则格式 + String reg = regListModel.getPattern(); + if (reg.startsWith("/") && reg.endsWith("/")) { + reg = reg.substring(1, reg.length() - 1); + } + boolean matches = value.matches(reg); + if (!matches) { + comInputError = true; + errList.set(i, label + regListModel.getMessage()); + } + } + } + if (!comInputError) { + insMap.put(swapDataVo.getVModel(), value); + } + } + break; + case YunzhupaasKeyConsts.TIME: + // 格式 + String dataFomrat = "yyyy-MM-dd " + swapDataVo.getFormat(); + String valueTime = com.yunzhupaas.util.DateUtil.daFormat(new Date()) + " " + value; + try { + if (swapDataVo.getFormat().length() != value.length()) + throw new DataException(); + SimpleDateFormat formatter = new SimpleDateFormat(dataFomrat); + formatter.setLenient(false); + Date d = formatter.parse(valueTime); + } catch (Exception e) { + errList.set(i, label + "值不正确"); + break; + } + + // 范围 + try { + // 判断时间是否在设置范围内 + boolean timeHasRangeError = FormPublicUtils.dateTimeCondition(swapDataVo, dataFomrat, + valueTime, data, yunzhupaasKey); + if (timeHasRangeError) { + errList.set(i, label + "值不在范围内"); + break; + } + } catch (Exception e) { + errList.set(i, label + "值不在范围内"); + break; + } + + break; + case YunzhupaasKeyConsts.DATE: + String format = swapDataVo.getFormat(); + Date valueDate = null; + try { + if (format.length() != value.length()) + throw new DataException(); + SimpleDateFormat formatter = new SimpleDateFormat(format); + formatter.setLenient(false); + valueDate = formatter.parse(value); + } catch (Exception e) { + errList.set(i, label + "值不正确"); + break; + } + + try { + // 判断时间是否在设置范围内 + boolean timeHasRangeError = FormPublicUtils.dateTimeCondition(swapDataVo, format, value, + data, yunzhupaasKey); + if (timeHasRangeError) { + errList.set(i, label + "值不在范围内"); + break; + } + } catch (Exception e) { + errList.set(i, label + "值不在范围内"); + break; + } + insMap.put(swapDataVo.getVModel(), valueDate.getTime()); + break; + /** + * 子表 + */ + case YunzhupaasKeyConsts.CHILD_TABLE: + StringJoiner childJoiner = new StringJoiner(","); + List> childAllData = (List>) data + .get(swapDataVo.getVModel()); + List> childTable = new ArrayList<>(childAllData.size()); + uniqueModel.setChildMap(new ArrayList<>()); + for (int childI = 0, childLen = childAllData.size(); childI < childLen; childI++) { + Map item = childAllData.get(childI); + Map childMap = new HashMap<>(item); + childMap.put("mainAndMast", data); + childMap.put("child_table_list", data.get(swapDataVo.getVModel())); + Map childTableMap = new HashMap<>(childMap); + Map childerrorMap = new HashMap<>(childMap); + uniqueModel.setMain(false); + StringJoiner childJoiner1 = new StringJoiner(","); + List childErrList = this.checkExcelData(swapDataVo.getConfig().getChildren(), + childMap, localCache, childTableMap, childerrorMap, uniqueModel); + childErrList.stream().forEach(t -> { + if (StringUtil.isNotEmpty(t)) { + childJoiner1.add(t); + } + }); + List> childList = uniqueModel.getChildMap(); + if (childJoiner1.length() > 0) { + if (uniqueModel.isUpdate() && uniqueModel.getChildIndex() != null + && childJoiner1.toString().split(",").length == 1 + && childJoiner1.toString().contains("值已存在")) { + childList.set(uniqueModel.getChildIndex(), childTableMap); + } else { + childJoiner.add(childJoiner1.toString()); + } + } else { + childList.add(childTableMap); + childTable.add(childTableMap); + } + } + if (childJoiner.length() == 0) { + insMap.put(swapDataVo.getVModel(), childTable); + } else { + errList.set(i, childJoiner.toString()); + } + uniqueModel.setMain(true); + break; + default: + break; + + } + /** + * 数据接口 + */ + if (dataType != null) { + List> options = new ArrayList<>(); + String dataLabel = swapDataVo.getProps().getLabel() != null ? swapDataVo.getProps().getLabel() + : ""; + String dataValue = swapDataVo.getProps().getValue() != null ? swapDataVo.getProps().getValue() + : ""; + String children = swapDataVo.getProps().getChildren() != null + ? swapDataVo.getProps().getChildren() + : ""; + boolean isCascader = YunzhupaasKeyConsts.CASCADER.equals(yunzhupaasKey); + + String localCacheKey; + Map dataInterfaceMap = new HashMap<>(); + // 静态数据 + if (dataType.equals(OnlineDataTypeEnum.STATIC.getType())) { + localCacheKey = String.format("%s-%s", + swapDataVo.getConfig().getRelationTable() + swapDataVo.getVModel(), + OnlineDataTypeEnum.STATIC.getType()); + if (!localCache.containsKey(localCacheKey)) { + if (swapDataVo.getOptions() != null) { + options = JsonUtil.getJsonToListMap(swapDataVo.getOptions()); + String Children = swapDataVo.getProps().getChildren(); + JSONArray staticData = JsonUtil.getListToJsonArray(options); + getOptions(dataLabel, dataValue, Children, staticData, options); + } else { + options = JsonUtil.getJsonToListMap(swapDataVo.getOptions()); + } + Map finalDataInterfaceMap = new HashMap<>(16); + String finalDataLabel = dataLabel; + String finalDataValue = dataValue; + options.stream().forEach(o -> { + finalDataInterfaceMap.put(String.valueOf(o.get(finalDataLabel)), + o.get(finalDataValue)); + }); + localCache.put(localCacheKey, finalDataInterfaceMap); + dataInterfaceMap = finalDataInterfaceMap; + } else { + dataInterfaceMap = (Map) localCache.get(localCacheKey); + } + + checkFormDataInteface(multiple, insMap, swapDataVo.getVModel(), label, dataInterfaceMap, + valueList, errList, i, isCascader); + // 远端数据 + } else if (dataType.equals(OnlineDataTypeEnum.DYNAMIC.getType())) { + localCacheKey = String.format("%s-%s-%s-%s", OnlineDataTypeEnum.DYNAMIC.getType(), + swapDataVo.getConfig().getPropsUrl(), dataValue, dataLabel); + if (!localCache.containsKey(localCacheKey)) { + List templateJson = swapDataVo.getConfig().getTemplateJson(); + Map param = new HashMap<>(); + for (TemplateJsonModel tm : templateJson) { + param.put(tm.getField(), tm.getDefaultValue()); + } + ActionResult actionResult = dataInterFaceApi + .infoToId(swapDataVo.getConfig().getPropsUrl(), null, param); + if (actionResult != null && actionResult.getData() != null) { + List> dycDataList = new ArrayList<>(); + if (actionResult.getData() instanceof List) { + dycDataList = (List>) actionResult.getData(); + } + JSONArray dataAll = JsonUtil.getListToJsonArray(dycDataList); + treeToList(dataLabel, dataValue, children, dataAll, options); + Map finalDataInterfaceMap1 = new HashMap<>(16); + String finalDataLabel2 = dataLabel; + String finalDataValue1 = dataValue; + options.stream().forEach(o -> { + finalDataInterfaceMap1.put(String.valueOf(o.get(finalDataLabel2)), + String.valueOf(o.get(finalDataValue1))); + }); + dataInterfaceMap = finalDataInterfaceMap1; + localCache.put(localCacheKey, dataInterfaceMap); + } + } else { + dataInterfaceMap = (Map) localCache.get(localCacheKey); + } + checkFormDataInteface(multiple, insMap, swapDataVo.getVModel(), label, dataInterfaceMap, + valueList, errList, i, isCascader); + // 数据字典 + } else if (dataType.equals(OnlineDataTypeEnum.DICTIONARY.getType())) { + localCacheKey = String.format("%s-%s", OnlineDataTypeEnum.DICTIONARY.getType(), + swapDataVo.getConfig().getDictionaryType()); + dataLabel = swapDataVo.getProps().getLabel(); + dataValue = swapDataVo.getProps().getValue(); + if (!localCache.containsKey(localCacheKey)) { + List list = dictionaryDataApi + .getDicList(swapDataVo.getConfig().getDictionaryType()); + options = list.stream().map(dic -> { + Map dictionaryMap = new HashMap<>(16); + dictionaryMap.put("id", dic.getId()); + dictionaryMap.put("enCode", dic.getEnCode()); + dictionaryMap.put("fullName", dic.getFullName()); + return dictionaryMap; + }).collect(Collectors.toList()); + localCache.put(localCacheKey, options); + } else { + options = (List>) localCache.get(localCacheKey); + } + Map finalDataInterfaceMap1 = new HashMap<>(16); + String finalDataLabel3 = dataLabel; + String finalDataValue3 = dataValue; + options.stream().forEach(o -> finalDataInterfaceMap1 + .put(String.valueOf(o.get(finalDataLabel3)), o.get(finalDataValue3))); + + checkFormDataInteface(multiple, insMap, swapDataVo.getVModel(), label, + finalDataInterfaceMap1, valueList, errList, i, isCascader); + } + } + } catch (Exception e) { + e.printStackTrace(); + errList.set(i, e.getMessage()); + } + } + } catch (Exception e) { + throw new RuntimeException(e); + } + return errList; + } + + private List checkOptionsControl(boolean multiple, Map insMap, String vModel, String label, + Map cacheMap, + List valueList, List errList, int i) { + boolean error = false; + if (!multiple) { + // 非多选填入多选值 + if (valueList.size() > 1) { + error = true; + errList.set(i, label + "值不正确"); + } + } + List dataList = new ArrayList<>(); + if (!error) { + boolean errorHapen = false; + for (String va : valueList) { + if (StringUtil.isEmpty(va)) { + errorHapen = true; + break; + } + Object vo = cacheMap.get(va); + if (vo == null) { + errorHapen = true; + break; + } else { + dataList.add(vo.toString()); + } + } + if (errorHapen) { + errList.set(i, label + "值不正确"); + } else { + insMap.put(vModel, !multiple ? dataList.get(0) : JsonUtil.getObjectToString(dataList)); + } + } + return dataList; + } + + public void checkCustomControl(OnlineCusCheckModel cusCheckModel, List errList, int i, String label) { + boolean contains; + List ableIdsAll = new ArrayList<>(); + List ableDepIds = cusCheckModel.getAbleDepIds(); + List ableGroupIds = cusCheckModel.getAbleGroupIds(); + List ablePosIds = cusCheckModel.getAblePosIds(); + List ableRoleIds = cusCheckModel.getAbleRoleIds(); + List ableUserIds = cusCheckModel.getAbleUserIds(); + List ableComIds = cusCheckModel.getAbleComIds(); + List ableComIdsStr = cusCheckModel.getAbleComIdsStr(); + List dataList = cusCheckModel.getDataList(); + String controlType = cusCheckModel.getControlType(); + switch (controlType) { + case YunzhupaasKeyConsts.GROUPSELECT: + ableIdsAll.addAll(ableGroupIds); + break; + case YunzhupaasKeyConsts.ROLESELECT: + ableIdsAll.addAll(ableRoleIds); + break; + case YunzhupaasKeyConsts.DEPSELECT: + ableIdsAll.addAll(ableDepIds); + break; + case YunzhupaasKeyConsts.COMSELECT: + ableIdsAll.addAll(ableComIdsStr); + break; + case YunzhupaasKeyConsts.CUSTOMUSERSELECT: + for (String id : ableDepIds) { + ableIdsAll.add(id + "--department"); + } + for (String id : ableGroupIds) { + ableIdsAll.add(id + "--group"); + } + for (String id : ablePosIds) { + ableIdsAll.add(id + "--position"); + } + for (String id : ableRoleIds) { + ableIdsAll.add(id + "--role"); + } + for (String id : ableUserIds) { + ableIdsAll.add(id + "--user"); + } + for (String id : ableComIds) { + ableIdsAll.add(id + "--company"); + } + ableIdsAll.addAll(ableDepIds); + ableIdsAll.addAll(ableGroupIds); + ableIdsAll.addAll(ablePosIds); + ableIdsAll.addAll(ableRoleIds); + ableIdsAll.addAll(ableUserIds); + ableIdsAll.addAll(ableComIds); + List listByObjectIdAll = userRelationApi.getListByObjectIdAll(ableIdsAll); + for (UserRelationEntity userRelationEntity : listByObjectIdAll) { + ableIdsAll.add(userRelationEntity.getUserId() + "--user"); + } + break; + case YunzhupaasKeyConsts.USERSELECT: + List objIds = new ArrayList<>(); + if (ableComIds.size() > 0) { + List lastIds = new ArrayList<>(); + for (String str : ableComIds) { + lastIds.add(str); + } + objIds.addAll(lastIds); + } + if (ableDepIds.size() > 0) { + List lastIds = new ArrayList<>(); + for (String str : ableDepIds) { + lastIds.add(str); + } + objIds.addAll(lastIds); + } + if (ableGroupIds.size() > 0) { + objIds.addAll(ableGroupIds); + } + if (ablePosIds.size() > 0) { + objIds.addAll(ablePosIds); + } + if (ableRoleIds.size() > 0) { + objIds.addAll(ableRoleIds); + } + List UserIds = userRelationApi.getListByObjectIdAll(objIds).stream() + .map(UserRelationEntity::getUserId).collect(Collectors.toList()); + UserIds.addAll(ableUserIds); + ableIdsAll.addAll(UserIds); + break; + case YunzhupaasKeyConsts.POSSELECT: + List posIds = new ArrayList<>(); + if (ableDepIds.size() > 0) { + List depIds = positionApi.getListByOrganizeId(ableDepIds, false).stream() + .map(PositionEntity::getId).collect(Collectors.toList()); + posIds.addAll(depIds); + } + if (ablePosIds.size() > 0) { + posIds.addAll(ablePosIds); + } + ableIdsAll.addAll(posIds); + break; + default: + break; + } + if (ableIdsAll.size() > 0) { + for (String id : dataList) { + contains = ableIdsAll.contains(id); + if (!contains) { + errList.set(i, label + "值不在范围内"); + break; + } + } + } + } + + public void checkFormDataInteface(boolean multiple, Map insMap, String vModel, String label, + Map cacheMap, + List valueList, List errList, int i, boolean isCascader) { + List staticStrData = new ArrayList<>(); + List staticStrDataList1 = new ArrayList<>(); + // 单选给多选直接报错 + if (!multiple && valueList.size() > 1) { + errList.set(i, label + "值不正确"); + return; + } + boolean hasError = false; + boolean takeOne = false; + for (String dicValue : valueList) { + if (isCascader) { + List staticStrDataList2 = new ArrayList<>(); + if (!multiple && valueList.size() > 1) + hasError = true; + if (dicValue.contains("/")) { + String[] split = dicValue.split("/"); + for (String s : split) { + Object s1 = cacheMap.get(s); + if (s1 != null) { + staticStrDataList2.add(s1.toString()); + staticStrDataList1.add(s1.toString()); + } else { + hasError = true; + } + } + staticStrData.add(staticStrDataList2.toArray(new String[staticStrDataList2.size()])); + } else { + if (cacheMap.get(dicValue) == null) { + hasError = true; + } else { + staticStrDataList1.add(cacheMap.get(dicValue).toString()); + staticStrData.add(new String[] { cacheMap.get(dicValue).toString() }); + } + } + } else { + takeOne = true; + Object s1 = cacheMap.get(dicValue); + if (s1 != null) { + staticStrDataList1.add(s1.toString()); + } else { + hasError = true; + } + } + } + + if (hasError) { + errList.set(i, label + "值不正确"); + } else { + String v = multiple + ? takeOne ? JsonUtil.getObjectToString(staticStrDataList1) + : JsonUtil.getObjectToString(staticStrData) + : takeOne ? staticStrDataList1.get(0) : JsonUtil.getObjectToString(staticStrDataList1); + insMap.put(vModel, v); + } + } + + /** + * 获取接口api数据结果 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2023/1/10 + */ + public List> getInterfaceData(VisualdevReleaseEntity visualdevEntity, + PaginationModel paginationModel, ColumnDataModel columnDataModel) { + List> realList = new ArrayList<>(); + try { + Map queryMap = JsonUtil.stringToMap(paginationModel.getQueryJson()); + + // 页签搜索 + Map extraMap = JsonUtil.stringToMap(paginationModel.getExtraQueryJson()); + extraMap = extraMap == null ? new HashMap<>() : extraMap; + DataInterfaceEntity info = dataInterFaceApi.getInfo(visualdevEntity.getInterfaceId()); + // 接口真分页 + if (info.getHasPage() == 1) { + DataInterfacePage page = new DataInterfacePage(); + page.setCurrentPage(paginationModel.getCurrentPage()); + page.setPageSize(paginationModel.getPageSize()); + if ("1".equals(paginationModel.getDataType())) { + page.setPageSize(99999999); + } + List jsonToList = JsonUtil.getJsonToList(visualdevEntity.getInterfaceParam(), + DataInterfaceModel.class); + for (DataInterfaceModel df : jsonToList) { + if (queryMap != null && queryMap.containsKey(df.getField()) && queryMap.get(df.getField()) != null + && StringUtil.isNotEmpty(queryMap.get(df.getField()).toString())) { + String thisValue = queryMap.get(df.getField()).toString(); + if (extraMap.containsKey(df.getField())) { + thisValue = extraMap.get(df.getField()).toString(); + } + if (Objects.equals(df.getSourceType(), 2)) { + df.setRelationField(thisValue); + } + df.setDefaultValue(thisValue); + } else if (extraMap.containsKey(df.getField())) { + String thisValue = extraMap.get(df.getField()).toString(); + if (Objects.equals(df.getSourceType(), 2)) { + df.setRelationField(thisValue); + } + df.setDefaultValue(thisValue); + } + } + page.setParamList(jsonToList); + ActionResult actionResult = dataInterFaceApi.infoToIdPageList(visualdevEntity.getInterfaceId(), page); + if (actionResult.getCode() == 200) { + PageListVO data = JsonUtil.getJsonToBean(actionResult.getData(), PageListVO.class); + realList = (List>) data.getList(); + PaginationVO pagination = data.getPagination(); + paginationModel.setTotal(pagination.getTotal()); + } + } else { + Map parameterMap = new HashMap<>(); + if (StringUtil.isNotEmpty(visualdevEntity.getInterfaceParam())) { + List jsonToList = JsonUtil.getJsonToList(visualdevEntity.getInterfaceParam(), + InterefaceParamModel.class); + for (InterefaceParamModel mapStr : jsonToList) { + TemplateJsonModel jsonToBean = JsonUtil.getJsonToBean(mapStr, TemplateJsonModel.class); + String dataValue = paramSourceTypeReplaceValue(jsonToBean, null); + mapStr.setDefaultValue(dataValue); + if (mapStr.getUseSearch() != null && Objects.equals(mapStr.getUseSearch(), true)) { + Map keyJsonMap = queryMap; + if (keyJsonMap != null && keyJsonMap.get(mapStr.getField()) != null + && StringUtil.isNotEmpty(keyJsonMap.get(mapStr.getField()).toString())) { + parameterMap.put(mapStr.getField(), keyJsonMap.get(mapStr.getField()).toString()); + } else { + parameterMap.put(mapStr.getField(), null); + } + } else { + parameterMap.put(mapStr.getField(), mapStr.getDefaultValue()); + } + } + } + + // 组装查询条件 + List queryCondition = this.getQueryCondition(paginationModel, columnDataModel); + // 封装sql---sql普通查询塞参数到数据接口那边去组装sql + OnlinePublicUtils.getViewQuerySql(info, queryCondition, parameterMap, extraMap); + + ActionResult dataInterfaceInfo = dataInterFaceApi.infoToId(visualdevEntity.getInterfaceId(), null, + parameterMap); + if (dataInterfaceInfo.getCode() == 200) { + List> dataRes = (List>) dataInterfaceInfo.getData(); + // 假查询条件-不为sql时查询在此过滤 + List> dataInterfaceList = OnlinePublicUtils.getViewQueryNotSql(info, + queryCondition, dataRes, extraMap); + + // 判断是否有id没有则随机 + dataInterfaceList.forEach(item -> { + if (item.get("id") == null) { + item.put("id", RandomUtil.uuId()); + } + if (item.get("f_id") != null) { + item.put("id", item.get("f_id")); + } + if (item.get("children") != null) { + item.remove("children"); + } + }); + + // 排序 + if (StringUtil.isNotEmpty(paginationModel.getSidx())) { + String[] split = paginationModel.getSidx().split(","); + Collections.sort(dataInterfaceList, new Comparator>() { + @Override + public int compare(Map a, Map b) { + for (String sidx : split) { + String key = sidx; + if (sidx.startsWith("-")) { + key = sidx.substring(1); + } + if (a.get(key) == null) { + if (b.get(key) == null) { + return 0; + } + return 1; + } + if (b.get(key) == null) { + return -1; + } + if (!a.get(key).equals(b.get(key))) { + return String.valueOf(b.get(key)).compareTo(String.valueOf(a.get(key))); + } + } + return 0; + } + }); + } + + if ("1".equals(paginationModel.getDataType())) {// 导出全部数据用 + return dataInterfaceList; + } + // 假分页 + if (columnDataModel.getHasPage() && CollectionUtils.isNotEmpty(dataInterfaceList)) { + List>> partition = Lists.partition(dataInterfaceList, + (int) paginationModel.getPageSize()); + int i = (int) paginationModel.getCurrentPage() - 1; + realList = partition.size() > i ? partition.get(i) : Collections.emptyList(); + paginationModel.setTotal(dataInterfaceList.size()); + } + } + } + } catch (Exception e) { + e.printStackTrace(); + log.error("数据视图,接口请求失败!message={}", e.getMessage()); + } + // 数据添加随机id + dataId(realList, columnDataModel.getViewKey()); + return realList; + } + + /** + * 数据添加随机id + * + * @param data + * @param key + */ + private void dataId(List> data, String key) { + for (Map item : data) { + if (item.get("id") == null) { + item.put("id", RandomUtil.uuId()); + } + if (item.get("f_id") != null) { + item.put("id", item.get("f_id")); + } + if (item.get(key) != null) { + item.put("id", item.get(key)); + } + + if (item.get("children") != null) { + List> children = new ArrayList<>(); + try { + children.addAll(JsonUtil.getJsonToListMap(String.valueOf(item.get("children")))); + } catch (Exception e) { + + } + if (children.size() > 0) { + dataId(children, null); + item.put("children", children); + } + } + } + } + + public static List convertToList(Object obj) { + if (obj instanceof List) { + List arrayList = (List) obj; + return arrayList; + } else { + List arrayList = new ArrayList(); + arrayList.add(obj); + return arrayList; + } + } + + public static String convertValueToString(String obj, boolean mult, boolean isOrg) { + if (StringUtil.isNotEmpty(obj)) { + String prefix = "["; + if (isOrg) { + prefix = "[["; + } + if (mult) { + if (!obj.startsWith(prefix)) { + JSONArray arr = new JSONArray(); + if (isOrg) { + // 组织多选为二维数组 + arr.add(JSONArray.parse(obj)); + } else { + arr.add(obj); + } + return arr.toJSONString(); + } + } else { + if (obj.startsWith(prefix)) { + JSONArray objects = JSONArray.parseArray(obj); + return objects.size() > 0 ? objects.get(0).toString() : ""; + } + } + } + return obj; + } + + /** + * 获取组织数据中的最后一级组织ID + * 单选数据获取数组中最后一个组织本身的ID + * 多选数据获取最后一组组织数据中的最后一个组织本身的ID + * + * @param data + * @return + */ + public static String getLastOrganizeId(Object data) { + if (data instanceof List) { + List listData = (List) data; + data = listData.get(listData.size() - 1); + return getLastOrganizeId(data); + } else if (data instanceof String) { + String strData = (String) data; + if (strData.startsWith(StrPool.BRACKET_START)) { + JSONArray jsonArray = JSONArray.parseArray(strData); + return getLastOrganizeId(jsonArray); + } else { + return strData; + } + } + return data.toString(); + } + + /** + * 输入时表单时间字段根据格式转换去尾巴 + * + * @param list 字段属性 + * @param map 数据 + */ + public static void swapDatetime(List list, Map map) { + List fields = new ArrayList<>(); + FormPublicUtils.recursionFieldsExceptChild(fields, list); + // 主副表 + for (FieLdsModel field : fields) { + try { + String vModel = field.getVModel(); + String format = DateTimeFormatConstant.getFormat(field.getFormat()); + ConfigModel config = field.getConfig(); + if (map.get(vModel) != null) { + String s = map.get(vModel).toString(); + if (StringUtil.isBlank(s) || "[]".equals(s) || "[[]]".equals(s)) { + map.replace(vModel, null); + } + } + + // SQL Server text字段先这样处理。 + if (map.get(vModel) == null) { + String dbType = ""; + try { + @Cleanup + Connection connection = DynamicDataSourceUtil.getCurrentConnection(); + dbType = connection.getMetaData().getDatabaseProductName().trim(); + } catch (Exception e) { + } + if (YunzhupaasKeyConsts.getTextField().contains(config.getYunzhupaasKey()) + && "Microsoft SQL Server".equals(dbType)) { + map.put(vModel, ""); + } + } + if (YunzhupaasKeyConsts.DATE.equals(config.getYunzhupaasKey()) && map.get(vModel) != null) { + Date date = new Date(Long.parseLong(String.valueOf(map.get(vModel)))); + String completionStr = ""; + switch (format) { + case "yyyy": + completionStr = "-01-01 00:00:00"; + break; + case "yyyy-MM": + completionStr = "-01 00:00:00"; + break; + case "yyyy-MM-dd": + completionStr = " 00:00:00"; + break; + case "yyyy-MM-dd HH": + completionStr = ":00:00"; + break; + case "yyyy-MM-dd HH:mm": + completionStr = ":00"; + break; + default: + break; + } + String datestr = com.yunzhupaas.util.DateUtil.dateToString(date, format); + long time = com.yunzhupaas.util.DateUtil.stringToDate(datestr + completionStr).getTime(); + map.replace(vModel, time); + } + if (YunzhupaasKeyConsts.EDITOR.equals(config.getYunzhupaasKey()) && map.get(vModel) != null) { + map.replace(vModel, XSSEscape.escapeImgOnlyBase64(map.get(vModel).toString())); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + // 子表 + for (FieLdsModel field : fields) { + if (field.getVModel().toLowerCase().startsWith(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX)) { + List children = field.getConfig().getChildren(); + if (CollectionUtils.isNotEmpty(children)) { + String tableKey = field.getConfig().getTableName() + "List"; + if (map.get(tableKey) != null) { + List listObj = (List) map.get(tableKey); + if (CollectionUtils.isEmpty(listObj)) + continue; + List listObjNew = new ArrayList<>(); + for (Object o : listObj) { + Map stringObjectMap = JsonUtil.entityToMap(o); + swapDatetime(children, stringObjectMap); + listObjNew.add(stringObjectMap); + } + if (CollectionUtils.isNotEmpty(listObjNew)) { + map.replace(tableKey, listObjNew); + } + } + String tableFieldKey = field.getVModel(); + if (map.get(tableFieldKey) != null) { + List listObj = (List) map.get(tableFieldKey); + if (CollectionUtils.isEmpty(listObj)) + continue; + List listObjNew = new ArrayList<>(); + for (Object o : listObj) { + Map stringObjectMap = JsonUtil.entityToMap(o); + swapDatetime(children, stringObjectMap); + listObjNew.add(stringObjectMap); + } + if (CollectionUtils.isNotEmpty(listObjNew)) { + map.replace(tableFieldKey, listObjNew); + } + } + } + } + + } + } + + /** + * 判断组织层级是否正确 + * + * @param comTwoList + * @param comOneList + * @return + */ + private boolean orgListRight(List> comTwoList, List comOneList) { + if (CollectionUtils.isNotEmpty(comOneList)) { + String one = comOneList.get(comOneList.size() - 1); + List realOrgs = new ArrayList<>(); + OrganizeEntity organizeEntity = organizeApi.getInfo(one); + if (organizeEntity != null) { + if (StringUtil.isNotEmpty(organizeEntity.getOrganizeIdTree())) { + String[] split = organizeEntity.getOrganizeIdTree().split(","); + if (split.length > 0) { + realOrgs = Arrays.asList(split); + } + if (!JsonUtil.getObjectToString(comOneList).equals(JsonUtil.getObjectToString(realOrgs))) { + return true; + } + } + } + } + if (CollectionUtils.isNotEmpty(comTwoList) && comTwoList.size() > 0) { + for (List two : comTwoList) { + if (two.size() <= 0) { + return false; + } + String one = two.get(two.size() - 1); + List realOrgs = new ArrayList<>(); + OrganizeEntity organizeEntity = organizeApi.getInfo(one); + if (organizeEntity != null) { + if (StringUtil.isNotEmpty(organizeEntity.getOrganizeIdTree())) { + String[] split = organizeEntity.getOrganizeIdTree().split(","); + if (split.length > 0) { + realOrgs = Arrays.asList(split); + } + if (!JsonUtil.getObjectToString(comOneList).equals(JsonUtil.getObjectToString(realOrgs))) { + return true; + } + } + } + } + } + return false; + } + + /** + * 视图条件组装 + * + * @param paginationModel + * @param columnDataModel + * @return + */ + public List getQueryCondition(PaginationModel paginationModel, ColumnDataModel columnDataModel) { + List searchVOList = JsonUtil.getJsonToList(columnDataModel.getSearchList(), FieLdsModel.class); + Map keyJsonMap = JsonUtil.stringToMap(paginationModel.getQueryJson()); + + List searchResList = new ArrayList<>(); + if (keyJsonMap == null) { + return searchResList; + } + for (String key : keyJsonMap.keySet()) { + for (FieLdsModel item : searchVOList) { + String vModel = item.getVModel(); + if (key.equals(vModel) && keyJsonMap.get(key) != null) { + if (!item.getConfig().getIsFromParam()) {// 非接口参数的条件 + FieLdsModel model = BeanUtil.copyProperties(item, FieLdsModel.class); + String yunzhupaasKey = model.getConfig().getYunzhupaasKey(); + switch (yunzhupaasKey) { + case YunzhupaasKeyConsts.COM_INPUT: + if (Objects.equals(model.getSearchType(), 3)) { + model.setSearchType(2);// 单行输入范围调整为模糊 + } + model.setFieldValue(String.valueOf(keyJsonMap.get(vModel))); + break; + case YunzhupaasKeyConsts.NUM_INPUT: + model.setSearchType(3);// 定义为between + List integerList = JsonUtil.getJsonToList(keyJsonMap.get(vModel), Long.class); + model.setFieldValueOne(integerList.get(0)); + model.setFieldValueTwo(integerList.get(1)); + break; + case YunzhupaasKeyConsts.DATE: + model.setSearchType(3);// 定义为between + List dateList = JsonUtil.getJsonToList(keyJsonMap.get(vModel), Long.class); + String timeOne = FormPublicUtils.getTimeFormat(com.yunzhupaas.util.DateUtil + .dateToString(new Date(dateList.get(0)), model.getFormat())); + String timeTwo = FormPublicUtils.getTimeFormat(com.yunzhupaas.util.DateUtil + .dateToString(new Date(dateList.get(1)), model.getFormat())); + model.setFieldValueOne(timeOne); + model.setFieldValueTwo(timeTwo); + break; + case YunzhupaasKeyConsts.TIME: + model.setSearchType(3);// 定义为between + List stringList = JsonUtil.getJsonToList(keyJsonMap.get(vModel), String.class); + model.setFieldValueOne(stringList.get(0)); + model.setFieldValueTwo(stringList.get(1)); + break; + case YunzhupaasKeyConsts.SELECT: + case YunzhupaasKeyConsts.POSSELECT: + case YunzhupaasKeyConsts.ROLESELECT: + case YunzhupaasKeyConsts.GROUPSELECT: + model.setSearchType(4); + List dataList = new ArrayList<>(); + try { + List list = JsonUtil.getJsonToList(keyJsonMap.get(vModel), String.class); + dataList.addAll(list); + } catch (Exception e1) { + dataList.add(String.valueOf(keyJsonMap.get(vModel))); + } + model.setDataList(dataList); + break; + case YunzhupaasKeyConsts.COMSELECT: + model.setSearchType(4); + List listOrg = new ArrayList<>(); + List orgListRes = new ArrayList<>(); + if (model.getSearchMultiple()) { + List> list = JsonUtil.getJsonToBean(keyJsonMap.get(vModel), + List.class); + for (List a : list) { + listOrg.add(a.get(a.size() - 1)); + orgListRes.add(JSONArray.toJSONString(a)); + } + } else { + List list = JsonUtil.getJsonToBean(keyJsonMap.get(vModel), List.class); + listOrg.add(list.get(list.size() - 1)); + orgListRes.add(JSONArray.toJSONString(list)); + } + // 包含子组织 + if (model.getIsIncludeSubordinate()) { + for (String org : listOrg) { + // 获取子组织 + List underOrganizations = organizeApi.getUnderOrganizations(org, false); + // 获取组织全路径 + for (String itemOrg : underOrganizations) { + OrganizeEntity organizeEntity = organizeApi.getInfo(itemOrg); + if (organizeEntity != null) { + if (StringUtil.isNotEmpty(organizeEntity.getOrganizeIdTree())) { + String[] split = organizeEntity.getOrganizeIdTree().split(","); + if (split.length > 0) { + orgListRes.add(JSONArray.toJSONString(Arrays.asList(split))); + } + } + } + } + } + model.setDataList(orgListRes); + } else { + model.setDataList(orgListRes); + } + break; + case YunzhupaasKeyConsts.DEPSELECT: + model.setSearchType(4); + List listDep = new ArrayList<>(); + List depListRes = new ArrayList<>(); + if (model.getSearchMultiple()) { + List list = JsonUtil.getJsonToBean(keyJsonMap.get(vModel), List.class); + listDep.addAll(list); + depListRes.addAll(list); + } else { + listDep.add(String.valueOf(keyJsonMap.get(vModel))); + depListRes.add(String.valueOf(keyJsonMap.get(vModel))); + } + // 包含当前部门及子部门 + if (model.getIsIncludeSubordinate()) { + for (String org : listDep) { + // 获取子部门 + List underOrganizations = organizeApi.getUnderOrganizations(org, false); + depListRes.addAll(underOrganizations); + } + model.setDataList(depListRes); + } else { + model.setDataList(depListRes); + } + break; + case YunzhupaasKeyConsts.USERSELECT: + model.setSearchType(4); + List listUser = new ArrayList<>(); + List userListRes = new ArrayList<>(); + if (model.getSearchMultiple()) { + List list = JsonUtil.getJsonToBean(keyJsonMap.get(vModel), List.class); + listUser.addAll(list); + userListRes.addAll(list); + } else { + listUser.add(String.valueOf(keyJsonMap.get(vModel))); + userListRes.add(String.valueOf(keyJsonMap.get(vModel))); + } + // 包含当前用户及下属 + if (model.getIsIncludeSubordinate()) { + for (String userId : listUser) { + // 获取下属用户 + List underOrganizations = userApi.getListByManagerId(userId, null); + List collect = underOrganizations.stream().map(UserEntity::getId) + .collect(Collectors.toList()); + userListRes.addAll(collect); + } + model.setDataList(userListRes); + } else { + model.setDataList(userListRes); + } + break; + default: + model.setFieldValue(String.valueOf(keyJsonMap.get(vModel))); + break; + } + searchResList.add(model); + } + } + } + } + return searchResList; + } + + /** + * 获取默认数据和下拉列表map + * + * @param formJson 表单设计json + * @param selectKey 选中字段key + */ + public ExcelModel getDefaultValue(String formJson, List selectKey) { + FormDataModel formDataModel = JsonUtil.getJsonToBean(formJson, FormDataModel.class); + List fieLdsModels = JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class); + List allFieLds = new ArrayList<>(); + VisualUtils.recursionFields(fieLdsModels, allFieLds); + Map optionMap = new HashMap<>(); + Map dataMap = new HashMap<>(); + List models = new ArrayList<>(); + + for (String s : selectKey.stream() + .filter(s -> !s.toLowerCase().startsWith(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX)) + .collect(Collectors.toList())) { + FieLdsModel fieLdsModel = allFieLds.stream().filter(c -> c.getVModel().equals(s)).findFirst().orElse(null); + fieLdsModel.setId(fieLdsModel.getVModel()); + models.add(ExcelColumnAttr.builder().key(fieLdsModel.getVModel()).name(fieLdsModel.getLabel()) + .require(fieLdsModel.getConfig().isRequired()).fontColor(IndexedColors.RED.getIndex()).build()); + + dataMap.put(s, VisualUtils.exampleExcelMessage(fieLdsModel)); + String[] options = getOptions(fieLdsModel); + if (options != null && options.length > 0) { + optionMap.put(fieLdsModel.getVModel(), options); + } + } + List childFields = allFieLds.stream() + .filter(f -> f.getConfig().getYunzhupaasKey().equals(YunzhupaasKeyConsts.CHILD_TABLE)) + .collect(Collectors.toList()); + for (FieLdsModel child : childFields) { + List childList = selectKey.stream().filter(s -> s.startsWith(child.getVModel())) + .collect(Collectors.toList()); + childList.stream().forEach(c -> c.replace(child.getVModel() + "-", "")); + List children = child.getConfig().getChildren(); + List> childData = new ArrayList<>(); + Map childMap = new HashMap<>(); + for (String cl : childList) { + String substring = cl.substring(cl.indexOf("-") + 1); + FieLdsModel fieLdsModel = children.stream().filter(c -> c.getVModel().equals(substring)).findFirst() + .orElse(null); + String id = fieLdsModel.getConfig().getParentVModel() + "-" + fieLdsModel.getVModel(); + fieLdsModel.setId(id); + models.add(ExcelColumnAttr.builder().key(cl).name(fieLdsModel.getLabel()) + .require(fieLdsModel.getConfig().isRequired()).fontColor(IndexedColors.RED.getIndex()).build()); + childMap.put(substring, VisualUtils.exampleExcelMessage(fieLdsModel)); + String[] options = getOptions(fieLdsModel); + if (options != null && options.length > 0) { + optionMap.put(id, options); + } + } + childData.add(childMap); + dataMap.put(child.getVModel(), childData); + } + return ExcelModel.builder().selectKey(selectKey).models(models).dataMap(dataMap).optionMap(optionMap).build(); + } + + /** + * 根据配置获取下拉列表 + * + * @param model + * @return + */ + public String[] getOptions(FieLdsModel model) { + ConfigModel config = model.getConfig(); + String yunzhupaasKey = config.getYunzhupaasKey(); + String[] options = null; + if (YunzhupaasKeyConsts.SWITCH.equals(yunzhupaasKey)) { + options = new String[2]; + options[0] = model.getActiveTxt(); + options[1] = model.getInactiveTxt(); + } + Boolean multiple = model.getMultiple(); + if ((YunzhupaasKeyConsts.SELECT.equals(yunzhupaasKey) && !multiple) + || YunzhupaasKeyConsts.RADIO.equals(yunzhupaasKey)) { + String selectOptions = model.getOptions(); + PropsModel props = model.getProps(); + String labelkey = props.getLabel(); + String dataType = model.getConfig().getDataType(); + if ("static".equals(dataType)) { + List list = JsonUtil.getJsonToList(selectOptions, Map.class); + options = new String[list.size()]; + for (int i = 0; i < list.size(); i++) { + Map map = list.get(i); + String label = (String) map.get(props.getLabel()); + options[i] = label; + } + } else if ("dictionary".equals(dataType)) { + List list = dictionaryDataApi.getList(model.getConfig().getDictionaryType(), + true); + options = list.stream().map(DictionaryDataEntity::getFullName).collect(Collectors.toList()) + .toArray(new String[0]); + } else if ("dynamic".equals(dataType)) { + ActionResult result = dataInterFaceApi.infoToId(model.getConfig().getPropsUrl(), null, new HashMap<>()); + ArrayList arr = (ArrayList) result.getData(); + options = new String[arr.size()]; + for (int i = 0; i < arr.size(); i++) { + Map data = (Map) arr.get(i); + options[i] = (String) data.get(labelkey); + } + } + } + return options; + } + + /** + * 获取流程任务状态 + * + * @param list 功能数据列表 + * @throws WorkFlowException + */ + public void getFlowStatus(List> list) throws WorkFlowException { + List ids = new ArrayList<>(); + for (Map item : list) { + getFLowFields(item); + if (Objects.nonNull(item.get(FlowFormConstant.FLOWTASKID))) { + ids.add(item.get(FlowFormConstant.FLOWTASKID).toString()); + } + } + + List tasks = taskApi.getInfosSubmit(ids.toArray(new String[] {}), TaskEntity::getStatus, + TaskEntity::getId); + for (Map m : list) { + if (m != null && Objects.nonNull(m.get(FlowFormConstant.FLOWTASKID))) { + String flowTaskId = m.get(FlowFormConstant.FLOWTASKID).toString(); + m.put(FlowFormConstant.FLOW_STATE, 0); + tasks.forEach(i -> { + if (i.getId().equals(flowTaskId)) { + m.put(FlowFormConstant.FLOW_STATE, i.getStatus()); + } + }); + } + } + } + + /** + * 获取流程相关字段 + * + * @param item + */ + public void getFLowFields(Map item) { + Map t = new CaseInsensitiveMap(item); + String flowTaskId = ""; + if (t != null && t.get(FlowFormConstant.FLOWTASKID) != null) { + flowTaskId = t.get(FlowFormConstant.FLOWTASKID).toString(); + } + if (t != null && t.get(TableFeildsEnum.FLOWTASKID.getField()) != null) { + flowTaskId = t.get(TableFeildsEnum.FLOWTASKID.getField()).toString(); + } + item.put(FlowFormConstant.FLOWTASKID, flowTaskId); + String flowId = ""; + if (t != null && t.get(FlowFormConstant.FLOWID) != null) { + flowId = t.get(FlowFormConstant.FLOWID).toString(); + } + if (t != null && t.get(TableFeildsEnum.FLOWID.getField()) != null) { + flowId = t.get(TableFeildsEnum.FLOWID.getField()).toString(); + } + item.put(FlowFormConstant.FLOWID, flowId); + } + + /** + * 主附表单行输入验证 + */ + public void checkUnique(List modelList, Map data, List errList, + ImportFormCheckUniqueModel uniqueModel) { + for (int i = 0; i < modelList.size(); i++) { + FieLdsModel swapDataVo = modelList.get(i); + String yunzhupaasKey = swapDataVo.getConfig().getYunzhupaasKey(); + Object valueO = data.get(swapDataVo.getVModel()); + String label = swapDataVo.getConfig().getLabel(); + String value = String.valueOf(valueO); + if (ObjectUtil.isEmpty(valueO)) { + continue; + } + if (YunzhupaasKeyConsts.COM_INPUT.equals(yunzhupaasKey) && uniqueModel.isMain()) { + if (StringUtil.isNotEmpty(swapDataVo.getMaxlength())) { + if (value.length() > Integer.valueOf(swapDataVo.getMaxlength())) { + errList.set(i, label + "值超出最多输入字符限制"); + break; + } + } + + Boolean unique = swapDataVo.getConfig().getUnique(); + if (unique) { + try { + DbLinkEntity linkEntity = uniqueModel.getLinkEntity(); + DynamicDataSourceUtil.switchToDataSource(linkEntity); + @Cleanup + Connection connection = DynamicDataSourceUtil.getCurrentConnection(); + String databaseProductName = connection.getMetaData().getDatabaseProductName().trim(); + + // 表格中出现多个的唯一值判断 + boolean exists = false; + List importDataModel = uniqueModel.getImportDataModel(); + List> successList = importDataModel.stream() + .map(ImportDataModel::getResultData).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(successList)) { + for (int uniqueIndex = 0; uniqueIndex < successList.size(); uniqueIndex++) { + if (value.equals( + String.valueOf(successList.get(uniqueIndex).get(swapDataVo.getVModel())))) { + errList.set(i, label + "值已存在"); + exists = true; + break; + } + } + } + if (exists) { + break; + } + String tableName = Optional.ofNullable(swapDataVo.getConfig().getRelationTable()) + .orElse(swapDataVo.getConfig().getTableName()); + // 验证唯一 + SqlTable sqlTable = SqlTable.of(tableName); + String key = flowDataUtil.getTableKey(connection, tableName); + String vModelThis = swapDataVo.getVModel(); + + String foriegKey = ""; + String columnName = ""; + boolean isMain = uniqueModel.isMain(); + TableModel mainTableModel = new TableModel(); + TableModel tableModel = new TableModel(); + for (TableModel item : uniqueModel.getTableModelList()) { + if (Objects.equals(item.getTypeId(), "1")) { + mainTableModel = item; + } + + if (StringUtil.isNotEmpty(swapDataVo.getConfig().getRelationTable())) { + // 子表判断 + if (swapDataVo.getConfig().getRelationTable().equals(item.getTable())) { + tableModel = item; + } + } else { + // 主副表判断 + if (swapDataVo.getConfig().getTableName().equals(item.getTable())) { + tableModel = item; + } + } + } + + if (tableModel != null) { + String fieldName = vModelThis; + if (vModelThis.contains("_yunzhupaas_")) { + fieldName = vModelThis.split("_yunzhupaas_")[1]; + isMain = false; + foriegKey = tableModel.getTableField(); + } + String finalFieldName = fieldName; + TableFields tableFields = tableModel.getFields().stream() + .filter(t -> t.getField().equals(finalFieldName)).findFirst().orElse(null); + if (tableFields != null) { + columnName = StringUtil.isNotEmpty(tableFields.getField()) ? tableFields.getField() + : fieldName; + } + } + + List selectKey = new ArrayList<>(); + selectKey.add(sqlTable.column(columnName)); + selectKey.add(sqlTable.column(key)); + if (StringUtil.isNotEmpty(foriegKey)) { + String finalForiegKey = foriegKey; + TableFields tableFields = tableModel.getFields().stream() + .filter(t -> t.getField().equals(finalForiegKey)).findFirst().orElse(null); + if (tableFields != null) { + foriegKey = StringUtil.isNotEmpty(tableFields.getField()) ? tableFields.getField() + : finalForiegKey; + } + selectKey.add(sqlTable.column(foriegKey)); + } + + SqlTable sqlMainTable = SqlTable.of(mainTableModel.getTable()); + String mainKey = flowDataUtil.getKey(mainTableModel, databaseProductName); + String taskIdField = TableFeildsEnum.FLOWTASKID.getField(); + if (databaseProductName.contains("Oracle") || databaseProductName.contains("DM DBMS")) { + taskIdField = TableFeildsEnum.FLOWTASKID.getField().toUpperCase(); + } + if (StringUtil.isNotEmpty(uniqueModel.getFlowId())) { + selectKey.add(sqlMainTable.column(taskIdField)); + } + + QueryExpressionDSL.QueryExpressionWhereBuilder where; + // 是否主表 + if (isMain) { + where = SqlBuilder + .select(selectKey) + .from(sqlTable) + .where(sqlTable.column(columnName), SqlBuilder.isEqualTo(value)); + } else { + where = SqlBuilder + .select(selectKey) + .from(sqlMainTable) + .leftJoin(sqlTable) + .on(sqlTable.column(tableModel.getTableField()), + new EqualTo(sqlMainTable.column(tableModel.getRelationField()))) + .where(sqlTable.column(columnName), SqlBuilder.isEqualTo(value)); + } + // 是流程 + if (StringUtil.isNotEmpty(uniqueModel.getFlowId())) { + where.and(sqlMainTable.column(TableFeildsEnum.FLOWID.getField()), + SqlBuilder.isIn(uniqueModel.getFlowIdList())); + } else { + where.and(sqlMainTable.column(TableFeildsEnum.FLOWID.getField()), SqlBuilder.isNull()); + } + // 开启逻辑删除 + if (uniqueModel.getLogicalDelete()) { + where.and(sqlMainTable.column(TableFeildsEnum.DELETEMARK.getField()), SqlBuilder.isNull()); + } + + // 业务主键存在的话需要剔除当前数据 + if (StringUtil.isNotEmpty(uniqueModel.getId())) { + where.and(sqlTable.column(mainKey), SqlBuilder.isNotEqualTo(uniqueModel.getId())); + } + + SelectStatementProvider render = where.build().render(RenderingStrategies.MYBATIS3); + List> mapList = flowFormDataMapper.selectManyMappedRows(render); + int count = mapList.size(); + if (count > 0) { + errList.set(i, label + "值已存在"); + break; + } + } catch (Exception e) { + errList.set(i, label + "值不正确"); + } finally { + DynamicDataSourceUtil.clearSwitchDataSource(); + } + } + } + } + } +} diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/util/onlineDevUtil/RelationFormUtils.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/util/onlineDevUtil/RelationFormUtils.java new file mode 100644 index 0000000..d691a81 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-biz/src/main/java/com/yunzhupaas/onlinedev/util/onlineDevUtil/RelationFormUtils.java @@ -0,0 +1,42 @@ +package com.yunzhupaas.onlinedev.util.onlineDevUtil; + +import com.yunzhupaas.onlinedev.model.OnlineDevListModel.VisualColumnSearchVO; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * + * 关联表单工具类 + * @author 云筑产品开发平台组 + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2022/1/7 + */ +public class RelationFormUtils { + + /** + * 转后后查询 + * @param dataVOList + * @param searchVOList + * @return + */ + public static List> getRelationListByKeyword(List> dataVOList, List searchVOList){ + List> passDataList = new ArrayList<>(); + for (Map dataMap : dataVOList){ + int i =0; + for (VisualColumnSearchVO searchVO : searchVOList){ + String s = String.valueOf(dataMap.get(searchVO.getVModel())); + if (s.contains(String.valueOf(searchVO.getValue()))){ + i++; + } + } + if (i>0){ + passDataList.add(dataMap); + } + } + return passDataList; + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-controller/pom.xml b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-controller/pom.xml new file mode 100644 index 0000000..945c8b3 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-controller/pom.xml @@ -0,0 +1,28 @@ + + + + yunzhupaas-visualdev-onlinedev + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-visualdev-onlinedev-controller + + + + com.yunzhupaas + yunzhupaas-visualdev-onlinedev-biz + ${project.version} + + + com.yunzhupaas + yunzhupaas-visualdev-integrate-biz + ${project.version} + compile + + + + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-controller/src/main/java/com/yunzhupaas/onlinedev/controller/VisualLogController.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-controller/src/main/java/com/yunzhupaas/onlinedev/controller/VisualLogController.java new file mode 100644 index 0000000..96e3ba5 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-controller/src/main/java/com/yunzhupaas/onlinedev/controller/VisualLogController.java @@ -0,0 +1,58 @@ +package com.yunzhupaas.onlinedev.controller; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.onlinedev.entity.VisualLogEntity; +import com.yunzhupaas.onlinedev.model.log.VisualLogPage; +import com.yunzhupaas.onlinedev.model.log.VisualLogVo; +import com.yunzhupaas.onlinedev.service.VisualLogService; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.DateUtil; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.UploaderUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +@Slf4j +@Tag(name = "在线开发数据日志", description = "OnlineLog") +@RestController +@RequestMapping("/api/visualdev/OnlineLog") +public class VisualLogController { + @Autowired + private VisualLogService visualLogService; + @Autowired + private UserService userService; + + @Operation(summary = "列表") + @GetMapping + public ActionResult> list(VisualLogPage page) { + List list = visualLogService.getLogList(page); + List userId = list.stream().map(t -> t.getCreatorUserId()).collect(Collectors.toList()); + List userList = userService.getUserName(userId); + List listVo = new ArrayList<>(); + for (VisualLogEntity entity : list) { + VisualLogVo vo = JsonUtil.getJsonToBean(entity, VisualLogVo.class); + UserEntity userEntity = userList.stream().filter(t -> vo.getCreatorUserId().equals(t.getId())).findFirst().orElse(null); + if (userEntity != null) { + vo.setCreatorUserName(userEntity.getRealName()); + vo.setHeadIcon(UploaderUtil.uploaderImg(userEntity.getHeadIcon())); + } + vo.setCreatorTime(DateUtil.dateToString(entity.getCreatorTime(), "yyyy-MM-dd HH:mm")); + listVo.add(vo); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(page, PaginationVO.class); + return ActionResult.page(listVo, paginationVO); + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-controller/src/main/java/com/yunzhupaas/onlinedev/controller/VisualPersonalController.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-controller/src/main/java/com/yunzhupaas/onlinedev/controller/VisualPersonalController.java new file mode 100644 index 0000000..d5e994e --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-controller/src/main/java/com/yunzhupaas/onlinedev/controller/VisualPersonalController.java @@ -0,0 +1,154 @@ +package com.yunzhupaas.onlinedev.controller; + +import cn.dev33.satoken.stp.StpUtil; +import cn.hutool.core.util.ObjectUtil; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.onlinedev.entity.VisualPersonalEntity; +import com.yunzhupaas.onlinedev.model.personalList.*; +import com.yunzhupaas.onlinedev.service.VisualPersonalService; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RandomUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 个性化列表视图控制器 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/11/6 10:25:31 + */ +@Slf4j +@Tag(name = "在线开发个性化列表", description = "OnlinePersonal") +@RestController +@RequestMapping("/api/visualdev/personal") +public class VisualPersonalController { + + @Autowired + private VisualPersonalService visualPersonalService; + + @Operation(summary = "列表") + @Parameters({ + @Parameter(name = "menuId", description = "菜单id") + }) + @GetMapping + public ActionResult getList(VisualPersPagiantion pagiantion) { + StpUtil.checkPermissionOr(pagiantion.getMenuId()); + List listVo = visualPersonalService.getListVo(pagiantion.getMenuId()); + return ActionResult.success(listVo); + } + + @Operation(summary = "新建") + @Parameters({ + @Parameter(name = "form", description = "个性化列表视图表单") + }) + @PostMapping + public ActionResult create(@RequestBody VisualPersonalForm form) { + StpUtil.checkPermissionOr(form.getMenuId()); + VisualPersonalEntity entity = JsonUtil.getJsonToBean(form, VisualPersonalEntity.class); + if (ObjectUtil.isEmpty(form.getId()) || VisualPersConst.SYSTEM_ID.equals(form.getId())) { + if (form.getFullName().length() > 6) { + return ActionResult.fail(MsgCode.EXIST005.get()); + } + if (visualPersonalService.isExistByFullName(form.getFullName(), null, form.getMenuId())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + List list = visualPersonalService.getList(form.getMenuId()); + if (list.size() >= 5) { + return ActionResult.fail(MsgCode.VS028.get()); + } + entity.setId(RandomUtil.uuId()); + entity.setStatus(0); + entity.setType(1); + visualPersonalService.save(entity); + } + return ActionResult.success(MsgCode.SU001.get(), entity.getId()); + } + + @Operation(summary = "详情") + @Parameters({ + @Parameter(name = "id", description = "个性化id"), + @Parameter(name = "menuId", description = "菜单id"), + }) + @GetMapping("/{id}") + public ActionResult info(@PathVariable("id") String id, VisualPersPagiantion pagiantion) { + StpUtil.checkPermissionOr(pagiantion.getMenuId()); + VisualPersonalInfo info = visualPersonalService.getInfo(id); + return ActionResult.success(info); + } + + @Operation(summary = "修改") + @Parameters({ + @Parameter(name = "id", description = "视图id"), + @Parameter(name = "form", description = "表单数据") + }) + @PutMapping("/{id}") + public ActionResult update(@PathVariable("id") String id, @RequestBody VisualPersonalForm form) { + StpUtil.checkPermissionOr(form.getMenuId()); + if (visualPersonalService.getById(id) != null) { + if (form.getFullName().length() > 6) { + return ActionResult.fail(MsgCode.EXIST005.get()); + } + if (visualPersonalService.isExistByFullName(form.getFullName(), id, form.getMenuId())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + VisualPersonalEntity entity = JsonUtil.getJsonToBean(form, VisualPersonalEntity.class); + boolean b = visualPersonalService.updateById(entity); + if (b) { + return ActionResult.success(MsgCode.SU004.get()); + } + } + return ActionResult.success(MsgCode.FA002.get()); + } + + @Operation(summary = "设置默认") + @Parameters({ + @Parameter(name = "id", description = "视图id"), + @Parameter(name = "menuId", description = "菜单id") + }) + @PutMapping("/{id}/setDefault") + public ActionResult updateStatus(@PathVariable("id") String id, VisualPersPagiantion pagiantion) { + StpUtil.checkPermissionOr(pagiantion.getMenuId()); + + List list = visualPersonalService.getList(pagiantion.getMenuId()); + for (VisualPersonalEntity entity : list) { + if (entity.getId().equals(id)) { + entity.setStatus(1); + } else { + entity.setStatus(0); + } + } + boolean b = visualPersonalService.updateBatchById(list); + if (b) { + return ActionResult.success(MsgCode.SU004.get()); + } + return ActionResult.success(MsgCode.FA002.get()); + } + + @Operation(summary = "删除") + @Parameters({ + @Parameter(name = "id", description = "视图id"), + @Parameter(name = "menuId", description = "菜单id") + }) + @DeleteMapping("/{id}") + public ActionResult delete(@PathVariable("id") String id, VisualPersPagiantion pagiantion) { + StpUtil.checkPermissionOr(pagiantion.getMenuId()); + if (visualPersonalService.getById(id) != null) { + boolean b = visualPersonalService.removeById(id); + if (b) { + return ActionResult.success(MsgCode.SU003.get()); + } + } + return ActionResult.success(MsgCode.FA003.get()); + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-controller/src/main/java/com/yunzhupaas/onlinedev/controller/VisualdevForFlowController.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-controller/src/main/java/com/yunzhupaas/onlinedev/controller/VisualdevForFlowController.java new file mode 100644 index 0000000..3b450be --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-controller/src/main/java/com/yunzhupaas/onlinedev/controller/VisualdevForFlowController.java @@ -0,0 +1,197 @@ +package com.yunzhupaas.onlinedev.controller; + +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.entity.VisualdevReleaseEntity; +import com.yunzhupaas.base.model.VisualDevJsonModel; +import com.yunzhupaas.base.model.flow.DataModel; +import com.yunzhupaas.base.model.flow.FlowFormDataModel; +import com.yunzhupaas.base.service.DbLinkService; +import com.yunzhupaas.base.service.FlowFormRelationService; +import com.yunzhupaas.base.service.VisualdevReleaseService; +import com.yunzhupaas.base.service.VisualdevService; +import com.yunzhupaas.base.util.FlowFormDataUtil; +import com.yunzhupaas.base.util.FlowFormHttpReqUtils; +import com.yunzhupaas.database.model.entity.DbLinkEntity; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.onlinedev.model.OnlineInfoModel; +import com.yunzhupaas.onlinedev.model.PaginationModel; +import com.yunzhupaas.base.model.OnlineImport.VisualdevModelDataInfoVO; +import com.yunzhupaas.onlinedev.model.VisualParamModel; +import com.yunzhupaas.onlinedev.service.VisualDevInfoService; +import com.yunzhupaas.onlinedev.service.VisualDevListService; +import com.yunzhupaas.onlinedev.service.VisualdevModelDataService; +import com.yunzhupaas.onlinedev.util.onlineDevUtil.FlowFormCustomUtils; +import com.yunzhupaas.onlinedev.util.onlineDevUtil.OnlinePublicUtils; +import com.yunzhupaas.util.*; +import com.yunzhupaas.visual.service.VisualdevApi; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Component +public class VisualdevForFlowController implements VisualdevApi { + + @Autowired + private VisualdevReleaseService visualdevReleaseService; + @Autowired + private VisualdevService visualdevService; + @Autowired + private VisualDevListService visualDevListService; + @Autowired + private VisualDevInfoService visualDevInfoService; + @Autowired + private FlowFormHttpReqUtils flowFormHttpReqUtils; + @Autowired + private FlowFormCustomUtils flowFormCustomUtils; + @Autowired + private FlowFormDataUtil flowDataUtil; + @Autowired + private DbLinkService dblinkService; + @Autowired + private FlowFormRelationService flowFormRelationService; + @Autowired + private VisualdevModelDataService visualdevModelDataService; + + @Override + public ActionResult saveOrUpdate(FlowFormDataModel flowFormDataModel) { + DataModel dataModel = null; + try { + String id = flowFormDataModel.getId(); + String formId = flowFormDataModel.getFormId(); + String flowId = flowFormDataModel.getFlowId(); + Map map = flowFormDataModel.getMap(); + List> formOperates = flowFormDataModel.getFormOperates(); + VisualdevReleaseEntity entity = visualdevReleaseService.getById(formId); + VisualdevEntity visualdevEntity = JsonUtil.getJsonToBean(entity, VisualdevEntity.class); + + map.put(FlowFormConstant.FLOWID, flowId); + if (map.get(TableFeildsEnum.VERSION.getField().toUpperCase()) != null) {//针对Oracle数据库大小写敏感,出现大写字段补充修复 + map.put(TableFeildsEnum.VERSION.getField(), map.get(TableFeildsEnum.VERSION.getField().toUpperCase())); + } + + //系统表单 + if (entity.getType() == 2) { + map.put("formOperates", formOperates); + flowFormHttpReqUtils.saveOrUpdate(visualdevEntity, id, UserProvider.getToken(), map); + } else { + try { + dataModel = flowFormCustomUtils.saveOrUpdate(visualdevEntity, flowFormDataModel); + } catch (SQLException sqlException) { + sqlException.printStackTrace(); + } catch (DataException e) { + e.printStackTrace(); + } + } + } catch (Exception e) { + e.printStackTrace(); + return ActionResult.fail(e.getMessage()); + } + return ActionResult.success(dataModel); + } + + @Override + public boolean delete(String formId, String id) { + try { + VisualdevReleaseEntity entity = visualdevReleaseService.getById(formId); + VisualdevEntity visualdevEntity = JsonUtil.getJsonToBean(entity, VisualdevEntity.class); + //系统表单 + if (entity.getType() == 2) { + flowFormHttpReqUtils.delete(visualdevEntity, id, UserProvider.getToken()); + } else { + VisualDevJsonModel visualJsonModel = OnlinePublicUtils.getVisualJsonModel(visualdevEntity); + DbLinkEntity linkEntity = StringUtil.isNotEmpty(visualdevEntity.getDbLinkId()) ? dblinkService.getInfo(visualdevEntity.getDbLinkId()) : null; + flowDataUtil.deleteTable(id, visualJsonModel, linkEntity); + } + } catch (Exception e) { + return false; + } + return true; + } + + @Override + public ActionResult info(String formId, String id) { + ActionResult result = new ActionResult(); + Map allDataMap = new HashMap(); + VisualdevReleaseEntity entity = visualdevReleaseService.getById(formId); + VisualdevEntity visualdevEntity = JsonUtil.getJsonToBean(entity, VisualdevEntity.class); + result.setCode(visualdevEntity == null ? 400 : 200); + result.setMsg(visualdevEntity == null ? "表单信息不存在" : ""); + if (visualdevEntity != null) { + //判断是否为系统表单 + boolean b = visualdevEntity.getType() == 2; + if (b) { + allDataMap.putAll(flowFormHttpReqUtils.info(visualdevEntity, id, UserProvider.getToken())); + } else { + allDataMap.putAll(flowFormCustomUtils.info(visualdevEntity, id)); + } + } + result.setData(allDataMap); + return result; + } + + @Override + public VisualdevEntity getFormConfig(String formId) { + VisualdevReleaseEntity entity = visualdevReleaseService.getById(formId); + VisualdevEntity visualdevEntity = JsonUtil.getJsonToBean(entity, VisualdevEntity.class); + return visualdevEntity; + } + + @Override + public List getFormConfigList(List formIds) { + List list = visualdevReleaseService.selectByIds(formIds, + VisualdevReleaseEntity::getId, + VisualdevReleaseEntity::getEnCode, + VisualdevReleaseEntity::getFullName, + VisualdevReleaseEntity::getType); + return CollectionUtils.isNotEmpty(list) ? JsonUtil.getJsonToList(list, VisualdevEntity.class) : new ArrayList<>(); + } + + @Override + public void saveFlowIdByFormIds(String flowId, List formIds) { + flowFormRelationService.saveFlowIdByFormIds(flowId, formIds); + } + + @Override + public VisualdevEntity getReleaseInfo(String formId) { + return visualdevService.getReleaseInfo(formId); + } + + @Override + public List> getListWithTableList(VisualDevJsonModel visualDevJsonModel, PaginationModel pagination, UserInfo userInfo) { + return visualDevListService.getListWithTableList(visualDevJsonModel, pagination, userInfo); + } + + @Override + public VisualdevModelDataInfoVO getEditDataInfo(String id, VisualdevEntity visualdevEntity) { + return visualDevInfoService.getEditDataInfo(id, visualdevEntity, OnlineInfoModel.builder().build()); + } + + @Override + public DataModel visualCreate(VisualParamModel model) throws Exception { + return visualdevModelDataService.visualCreate(VisualParamModel.builder().visualdevEntity(model.getVisualdevEntity()).data(model.getData()).build()); + } + + @Override + public DataModel visualUpdate(VisualParamModel model) throws Exception { + return visualdevModelDataService.visualUpdate(model); + } + + @Override + public void visualDelete(VisualParamModel model) throws Exception { + visualdevModelDataService.visualDelete(model.getVisualdevEntity(), model.getDataList()); + } + + @Override + public void deleteByTableName(FlowFormDataModel model) throws Exception { + visualdevModelDataService.deleteByTableName(model); + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-controller/src/main/java/com/yunzhupaas/onlinedev/controller/VisualdevModelAppController.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-controller/src/main/java/com/yunzhupaas/onlinedev/controller/VisualdevModelAppController.java new file mode 100644 index 0000000..28c47ca --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-controller/src/main/java/com/yunzhupaas/onlinedev/controller/VisualdevModelAppController.java @@ -0,0 +1,81 @@ +package com.yunzhupaas.onlinedev.controller; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.base.service.VisualdevService; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.emnus.ExportModelTypeEnum; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.onlinedev.model.*; +import com.yunzhupaas.util.*; +import com.yunzhupaas.emnus.ModuleTypeEnum; +import com.yunzhupaas.util.FileExport; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +/** + * 0代码app无表开发 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Tag(name = "0代码app无表开发", description = "ModelAppData") +@RestController +@RequestMapping("/api/visualdev/OnlineDev/App") +public class VisualdevModelAppController { + + @Autowired + private VisualdevService visualdevService; + @Autowired + private FileExport fileExport; + @Autowired + private ConfigValueUtil configValueUtil; + + + + @Operation(summary = "功能导出") + @PostMapping("/{modelId}/Actions/ExportData") + public ActionResult exportData(@PathVariable("modelId") String modelId){ + VisualdevEntity visualdevEntity = visualdevService.getInfo(modelId); + BaseDevModelVO vo = JsonUtil.getJsonToBean(visualdevEntity,BaseDevModelVO.class); + vo.setModelType(ExportModelTypeEnum.App.getMessage()); + DownloadVO downloadVO=fileExport.exportFile(vo,configValueUtil.getTemporaryFilePath(), visualdevEntity.getFullName(), ModuleTypeEnum.VISUAL_APP.getTableName()); + return ActionResult.success(downloadVO); + } + + @Operation(summary = "功能导入") + @PostMapping(value = "/Model/Actions/ImportData", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ActionResult ImportData(@RequestPart("file") MultipartFile multipartFile) throws WorkFlowException { + //判断是否为.json结尾 + if (FileUtil.existsSuffix(multipartFile, ModuleTypeEnum.VISUAL_APP.getTableName())) { + return ActionResult.fail(MsgCode.IMP002.get()); + } + //获取文件内容 + String fileContent = FileUtil.getFileContent(multipartFile); + BaseDevModelVO vo = JsonUtil.getJsonToBean(fileContent, BaseDevModelVO.class); + if (vo.getModelType() == null || !vo.getModelType().equals(ExportModelTypeEnum.App.getMessage())) { + return ActionResult.fail(MsgCode.VS410.get()); + } + VisualdevEntity visualdevEntity = JsonUtil.getJsonToBean(vo, VisualdevEntity.class); + String modelId = visualdevEntity.getId(); + if (StringUtil.isNotEmpty(modelId)) { + VisualdevEntity entity = visualdevService.getInfo(modelId); + if (entity != null) { + return ActionResult.fail(MsgCode.VS411.get()); + } + } + visualdevEntity.setCreatorTime(DateUtil.getNowDate()); + visualdevEntity.setLastModifyTime(null); + visualdevService.create(visualdevEntity); + return ActionResult.success(MsgCode.IMP001.get()); + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-controller/src/main/java/com/yunzhupaas/onlinedev/controller/VisualdevModelDataController.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-controller/src/main/java/com/yunzhupaas/onlinedev/controller/VisualdevModelDataController.java new file mode 100644 index 0000000..86220b0 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-controller/src/main/java/com/yunzhupaas/onlinedev/controller/VisualdevModelDataController.java @@ -0,0 +1,1035 @@ +package com.yunzhupaas.onlinedev.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.stp.StpUtil; +import cn.hutool.core.collection.CollectionUtil; +import cn.xuyanwu.spring.file.storage.FileInfo; +import com.google.common.collect.ImmutableList; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.ActionResultCode; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.base.entity.ModuleEntity; +import com.yunzhupaas.base.entity.VisualAliasEntity; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.entity.VisualdevReleaseEntity; +import com.yunzhupaas.base.model.ColumnDataModel; +import com.yunzhupaas.base.model.OnlineImport.ExcelImportModel; +import com.yunzhupaas.base.model.OnlineImport.ImportExcelFieldModel; +import com.yunzhupaas.base.model.OnlineImport.VisualImportModel; +import com.yunzhupaas.base.model.OnlineImport.VisualdevModelDataInfoVO; +import com.yunzhupaas.base.model.VisualDevJsonModel; +import com.yunzhupaas.base.model.VisualWebTypeEnum; +import com.yunzhupaas.base.model.flow.DataModel; +import com.yunzhupaas.base.model.flow.FlowLaunchModel; +import com.yunzhupaas.base.model.module.PropertyJsonModel; +import com.yunzhupaas.base.service.ModuleService; +import com.yunzhupaas.base.service.VisualAliasService; +import com.yunzhupaas.base.service.VisualdevReleaseService; +import com.yunzhupaas.base.service.VisualdevService; +import com.yunzhupaas.base.util.FormExecelUtils; +import com.yunzhupaas.base.util.VisualUtil; +import com.yunzhupaas.base.util.VisualUtils; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.YunzhupaasConst; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.constant.PermissionConst; +import com.yunzhupaas.emnus.ExportModelTypeEnum; +import com.yunzhupaas.emnus.ModuleTypeEnum; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.flowable.entity.TaskEntity; +import com.yunzhupaas.flowable.model.task.FlowModel; +import com.yunzhupaas.integrate.util.IntegrateUtil; +import com.yunzhupaas.model.ExcelModel; +import com.yunzhupaas.model.OnlineDevData; +import com.yunzhupaas.model.TransferModel; +import com.yunzhupaas.model.visualJson.FieLdsModel; +import com.yunzhupaas.model.visualJson.FormDataModel; +import com.yunzhupaas.model.visualJson.UploaderTemplateModel; +import com.yunzhupaas.model.visualJson.config.HeaderModel; +import com.yunzhupaas.onlinedev.entity.VisualdevModelDataEntity; +import com.yunzhupaas.onlinedev.model.*; +import com.yunzhupaas.onlinedev.service.VisualDevInfoService; +import com.yunzhupaas.onlinedev.service.VisualDevListService; +import com.yunzhupaas.onlinedev.service.VisualPersonalService; +import com.yunzhupaas.onlinedev.service.VisualdevModelDataService; +import com.yunzhupaas.onlinedev.util.onlineDevUtil.OnlineDevListUtils; +import com.yunzhupaas.onlinedev.util.onlineDevUtil.OnlinePublicUtils; +import com.yunzhupaas.onlinedev.util.onlineDevUtil.OnlineSwapDataUtils; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.context.RequestContext; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import com.yunzhupaas.workflow.service.TaskApi; +import com.yunzhupaas.workflow.service.TriggerApi; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.sql.SQLException; +import java.text.ParseException; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 0代码无表开发 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Slf4j +@Tag(name = "0代码无表开发", description = "OnlineDev") +@RestController +@RequestMapping("/api/visualdev/OnlineDev") +public class VisualdevModelDataController extends SuperController { + + @Autowired + private VisualdevModelDataService visualdevModelDataService; + @Autowired + private VisualdevService visualdevService; + + @Autowired + private FileExport fileExport; + @Autowired + private VisualDevListService visualDevListService; + @Autowired + private VisualDevInfoService visualDevInfoService; + @Autowired + private VisualdevReleaseService visualdevReleaseService; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private OnlineSwapDataUtils onlineSwapDataUtils; + @Autowired + private IntegrateUtil integrateUtil; + @Autowired + private ModuleService moduleService; + @Autowired + private VisualAliasService aliasService; + @Autowired + private TaskApi taskApi; + @Autowired + private TriggerApi triggerApi; + @Autowired + private VisualPersonalService visualPersonalService; + @Autowired + private UserService userService; + + // 流程可删除状态 + private List FLOW_STATE_DELETE = ImmutableList.of(0, 9); + + @Operation(summary = "获取数据列表") + @Parameters({ + @Parameter(name = "modelId", description = "模板id"), + }) + @PostMapping("/{modelId}/List") + public ActionResult list(@PathVariable("modelId") String modelId, @RequestBody PaginationModel paginationModel) + throws WorkFlowException { + StpUtil.checkPermission(modelId); + + VisualdevReleaseEntity visualdevEntity = visualdevReleaseService.getById(modelId); + VisualDevJsonModel visualJsonModel = OnlinePublicUtils.getVisualJsonModel(visualdevEntity); + + // 判断请求客户端来源 + if (!RequestContext.isOrignPc()) { + visualJsonModel.setColumnData(visualJsonModel.getAppColumnData()); + } + ColumnDataModel columnDataModel = visualJsonModel.getColumnData(); + List> realList; + if (VisualWebTypeEnum.FORM.getType().equals(visualdevEntity.getWebType())) { + realList = new ArrayList<>(); + } else if (VisualWebTypeEnum.DATA_VIEW.getType().equals(visualdevEntity.getWebType())) {// + // 数据视图的接口数据获取、 + realList = onlineSwapDataUtils.getInterfaceData(visualdevEntity, paginationModel, columnDataModel); + } else { + realList = visualDevListService.getDataList(visualJsonModel, paginationModel); + } + + // 判断数据是否分组 + if (OnlineDevData.COLUMNTYPE_THREE.equals(columnDataModel.getType()) + && StringUtil.isEmpty(paginationModel.getExtraQueryJson())) { + realList = OnlineDevListUtils.groupData(realList, columnDataModel); + } + // 树形列表 + if (OnlineDevData.COLUMNTYPE_FIVE.equals(columnDataModel.getType()) + && StringUtil.isEmpty(paginationModel.getExtraQueryJson())) { + realList = OnlineDevListUtils.treeListData(realList, columnDataModel); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(paginationModel, PaginationVO.class); + + return ActionResult.page(realList, paginationVO); + } + + @Operation(summary = "树形异步查询子列表接口") + @Parameters({ + @Parameter(name = "modelId", description = "模板id"), + @Parameter(name = "id", description = "数据id"), + }) + @PostMapping("/{modelId}/List/{id}") + public ActionResult listTree(@PathVariable("modelId") String modelId, @RequestBody PaginationModel paginationModel, + @PathVariable("id") String id) throws WorkFlowException { + StpUtil.checkPermission(modelId); + + VisualdevReleaseEntity visualdevEntity = visualdevReleaseService.getById(modelId); + VisualDevJsonModel visualJsonModel = OnlinePublicUtils.getVisualJsonModel(visualdevEntity); + // 判断请求客户端来源 + if (!RequestContext.isOrignPc()) { + visualJsonModel.setColumnData(visualJsonModel.getAppColumnData()); + } + + List> realList = visualDevListService.getDataList(visualJsonModel, paginationModel); + ColumnDataModel columnDataModel = visualJsonModel.getColumnData(); + String parentField = columnDataModel.getParentField() + "_id"; + + List> collect = realList.stream().filter(item -> id.equals(item.get(parentField))) + .collect(Collectors.toList()); + PaginationVO paginationVO = JsonUtil.getJsonToBean(paginationModel, PaginationVO.class); + return ActionResult.page(collect, paginationVO); + } + + @Operation(summary = "获取列表表单配置JSON") + @Parameters({ + @Parameter(name = "modelId", description = "模板id"), + @Parameter(name = "type", description = "类型0-草稿,1-发布"), + }) + @GetMapping("/{modelId}/Config") + public ActionResult getData(@PathVariable("modelId") String modelId, + @RequestParam(value = "type", required = false) String type, + @RequestParam(value = "personal", required = false) Integer personal, + @RequestParam(value = "menuId", required = false) String menuId) throws WorkFlowException { + StpUtil.checkPermissionOr(modelId, "onlineDev.webDesign", "generator.webForm", "generator.flowForm"); + + VisualdevEntity entity; + // 线上版本 + if ("0".equals(type)) { + entity = visualdevService.getInfo(modelId); + } else { + VisualdevReleaseEntity releaseEntity = visualdevReleaseService.getById(modelId); + entity = JsonUtil.getJsonToBean(releaseEntity, VisualdevEntity.class); + } + if (entity == null) { + return ActionResult.fail(MsgCode.VS412.get()); + } + String s = VisualUtil.checkPublishVisualModel(entity, MsgCode.VS005.get()); + if (s != null) { + return ActionResult.fail(s); + } + + DataInfoVO vo = JsonUtil.getJsonToBean(entity, DataInfoVO.class); + if (Objects.equals(entity.getType(), 1) && !VisualWebTypeEnum.DATA_VIEW.getType().equals(entity.getWebType())) { + vo.setPropsValueList(visualdevService.storedFieldList(entity)); + } + + // 页面初始化获取个性化配置 + if (Objects.equals(1, personal)) { + visualPersonalService.setDataInfoVO(menuId, vo); + } + return ActionResult.success(vo); + } + + @Operation(summary = "获取表单配置JSON") + @Parameters({ + @Parameter(name = "modelId", description = "模板id"), + }) + @GetMapping("/{modelId}/FormData") + public ActionResult getFormData(@PathVariable("modelId") String modelId) { + StpUtil.checkPermission(modelId); + + VisualdevEntity entity = visualdevService.getInfo(modelId); + return ActionResult.success(entity.getFormData()); + } + + @Operation(summary = "获取数据信息") + @Parameters({ + @Parameter(name = "modelId", description = "模板id"), + }) + @GetMapping("/{modelId}/{id}") + public ActionResult info(@PathVariable("id") String id, + @PathVariable("modelId") String modelId, + @RequestParam(name = "menuId", required = false) String menuId) throws DataException { + StpUtil.checkPermission(modelId); + VisualdevEntity visualdevEntity = visualdevService.getReleaseInfo(modelId); + VisualdevModelDataInfoVO editDataInfo = visualDevInfoService.getEditDataInfo(id, visualdevEntity, + OnlineInfoModel.builder().menuId(menuId).build()); + return ActionResult.success(editDataInfo); + } + + @Operation(summary = "获取数据信息(带转换数据)") + @Parameters({ + @Parameter(name = "modelId", description = "模板id"), + @Parameter(name = "id", description = "数据id"), + @Parameter(name = "propsValue", description = "存储字段(非必传)") + }) + @PostMapping("/{modelId}/DataChange") + public ActionResult infoWithDataChange(@PathVariable("modelId") String modelId, + @RequestBody VisualInfoParam visualInfoParam) { + StpUtil.checkPermission(modelId); + String id = visualInfoParam.getId() instanceof String ? (String) visualInfoParam.getId() + : JsonUtil.getObjectToString(visualInfoParam.getId()); + String propsValue = StringUtil.isNotEmpty(visualInfoParam.getPropsValue()) + && visualInfoParam.getPropsValue().contains(YunzhupaasConst.FIELD_SUFFIX_YUNZHUPAASID) + ? visualInfoParam.getPropsValue().split(YunzhupaasConst.FIELD_SUFFIX_YUNZHUPAASID)[0] + : visualInfoParam.getPropsValue(); + + VisualdevEntity visualdevEntity = visualdevService.getReleaseInfo(modelId); + String columnData = RequestContext.isOrignPc() ? visualdevEntity.getColumnData() + : visualdevEntity.getAppColumnData(); + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class); + if (columnDataModel != null && columnDataModel.getUseBtnPermission()) { + StpUtil.checkPermission(modelId + "::" + PermissionConst.BTN_DETAIL); + } + + VisualdevModelDataInfoVO vo = visualDevInfoService.getDetailsDataInfo(id, visualdevEntity, + OnlineInfoModel.builder().needRlationFiled(true).needSwap(true).propsValue(propsValue) + .menuId(visualInfoParam.getMenuId()).build()); + return ActionResult.success(vo); + } + + @Operation(summary = "添加数据") + @Parameters({ + @Parameter(name = "modelId", description = "模板id"), + @Parameter(name = "visualdevModelDataCrForm", description = "功能数据创建表单"), + }) + @PostMapping("/{modelId}") + public ActionResult create(@PathVariable("modelId") String modelId, + @RequestBody VisualdevModelDataCrForm visualdevModelDataCrForm) throws Exception { + StpUtil.checkPermission(modelId); + + String menuId = visualdevModelDataCrForm.getMenuId(); + VisualdevEntity visualdevEntity = visualdevService.getReleaseInfo(modelId); + String columnData = RequestContext.isOrignPc() ? visualdevEntity.getColumnData() + : visualdevEntity.getAppColumnData(); + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class); + if (columnDataModel != null && columnDataModel.getUseBtnPermission()) { + StpUtil.checkPermission(modelId + "::" + PermissionConst.BTN_ADD); + } + Map map = JsonUtil.stringToMap(visualdevModelDataCrForm.getData()); + DataModel dataModel = visualdevModelDataService.visualCreate( + VisualParamModel.builder().visualdevEntity(visualdevEntity).data(map).menuId(menuId).build()); + AsyncExecuteModel build = AsyncExecuteModel.builder().modelId(modelId).trigger(1) + .dataId(ImmutableList.of(dataModel.getMainId())) + .userInfo(UserProvider.getUser()).build(); + integrateUtil.asyncExecute(build); + + return ActionResult.success(MsgCode.SU001.get()); + } + + @Operation(summary = "修改数据") + @Parameters({ + @Parameter(name = "modelId", description = "模板id"), + @Parameter(name = "id", description = "数据id"), + @Parameter(name = "visualdevModelDataUpForm", description = "功能数据修改表单"), + }) + @PutMapping("/{modelId}/{id}") + public ActionResult update(@PathVariable("id") String id, @PathVariable("modelId") String modelId, + @RequestBody VisualdevModelDataUpForm visualdevModelDataUpForm) throws Exception { + StpUtil.checkPermission(modelId); + String menuId = visualdevModelDataUpForm.getMenuId(); + Map data = JsonUtil.stringToMap(visualdevModelDataUpForm.getData()); + VisualdevEntity visualdevEntity = visualdevService.getReleaseInfo(modelId); + String columnData = RequestContext.isOrignPc() ? visualdevEntity.getColumnData() + : visualdevEntity.getAppColumnData(); + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class); + if (columnDataModel != null && columnDataModel.getUseBtnPermission()) { + StpUtil.checkPermission(modelId + "::" + PermissionConst.BTN_EDIT); + } + DataModel dataModel = visualdevModelDataService.visualUpdate( + VisualParamModel.builder().visualdevEntity(visualdevEntity).data(data).menuId(menuId).id(id).build()); + AsyncExecuteModel build = AsyncExecuteModel.builder().modelId(modelId).trigger(2).dataId(ImmutableList.of(id)) + .dataModel(dataModel).userInfo(UserProvider.getUser()).build(); + integrateUtil.asyncExecute(build); + return ActionResult.success(MsgCode.SU004.get()); + } + + // 接口废弃全部走批量接口 + @Operation(summary = "删除数据") + @Parameters({ + @Parameter(name = "modelId", description = "模板id"), + @Parameter(name = "id", description = "数据id"), + }) + @DeleteMapping("/{modelId}/{id}") + public ActionResult delete(@PathVariable("id") String id, @PathVariable("modelId") String modelId) + throws Exception { + StpUtil.checkPermission(modelId); + + VisualdevEntity visualdevEntity = visualdevService.getReleaseInfo(modelId); + String columnData = RequestContext.isOrignPc() ? visualdevEntity.getColumnData() + : visualdevEntity.getAppColumnData(); + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class); + if (columnDataModel != null && columnDataModel.getUseBtnPermission()) { + StpUtil.checkPermissionOr(modelId + "::" + PermissionConst.BTN_REMOVE, + modelId + "::" + PermissionConst.BTN_BATCHREMOVE); + } + + VisualDevJsonModel visualJsonModel = OnlinePublicUtils.getVisualJsonModel(visualdevEntity); + + // 判断请求客户端来源 + if (!RequestContext.isOrignPc()) { + visualJsonModel.setColumnData(visualJsonModel.getAppColumnData()); + } + + if (!StringUtil.isEmpty(visualdevEntity.getVisualTables()) + && !OnlineDevData.TABLE_CONST.equals(visualdevEntity.getVisualTables())) { + // 树形递归删除 + if (OnlineDevData.COLUMNTYPE_FIVE.equals(visualJsonModel.getColumnData().getType())) { + try { + ActionResult listTreeAction = listTree(modelId, new PaginationModel(), id); + if (listTreeAction != null && listTreeAction.getCode() == 200 + && listTreeAction.getData() instanceof Object) { + Map map = JsonUtil.getJsonToBean(listTreeAction.getData(), Map.class); + List> list = JsonUtil.getJsonToListMap(map.get("list").toString()); + if (list.size() > 0) { + for (Map item : list) { + this.delete(item.get("id").toString(), modelId); + } + } + } + } catch (Exception e) { + e.printStackTrace(); + log.error("子数据删除异常:{}", e.getMessage()); + } + } + List dataInfoVOList = new ArrayList<>(); + VisualdevModelDataInfoVO editDataInfo = visualDevInfoService.getEditDataInfo(id, visualdevEntity, + OnlineInfoModel.builder().build()); + dataInfoVOList.add(editDataInfo); + + List deleteData = integrateUtil.dataList(modelId, 3, ImmutableList.of(id)); + + // Map map = JsonUtil.stringToMap(editDataInfo.getData()); + // TaskEntity taskEntity = + // taskApi.getInfoSubmit(map.get(FlowFormConstant.FLOWTASKID).toString(), + // TaskEntity::getId, + // TaskEntity::getParentId, TaskEntity::getFullName, TaskEntity::getStatus); + // if(taskEntity != null){ + // return ActionResult.fail(MsgCode.WF063.get()); + // } + + boolean result = visualdevModelDataService.tableDelete(id, visualJsonModel); + if (result) { + AsyncExecuteModel build = AsyncExecuteModel.builder().modelId(modelId).trigger(3) + .dataId(ImmutableList.of(id)) + .userInfo(UserProvider.getUser()).build(); + integrateUtil.asyncExecute(build); + return ActionResult.success(MsgCode.SU003.get()); + } else { + return ActionResult.fail(MsgCode.FA003.get()); + } + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + @Operation(summary = "批量删除数据") + @Parameters({ + @Parameter(name = "modelId", description = "模板id"), + @Parameter(name = "idsVo", description = "批量处理参数"), + }) + @PostMapping("/batchDelete/{modelId}") + public ActionResult batchDelete(@RequestBody BatchRemoveIdsVo idsVo, @PathVariable("modelId") String modelId) + throws Exception { + StpUtil.checkPermission(modelId); + + VisualdevEntity visualdevEntity = visualdevService.getReleaseInfo(modelId); + String columnData = RequestContext.isOrignPc() ? visualdevEntity.getColumnData() + : visualdevEntity.getAppColumnData(); + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class); + if (columnDataModel != null && columnDataModel.getUseBtnPermission()) { + StpUtil.checkPermissionOr(modelId + "::" + PermissionConst.BTN_REMOVE, + modelId + "::" + PermissionConst.BTN_BATCHREMOVE); + } + VisualDevJsonModel visualJsonModel = OnlinePublicUtils.getVisualJsonModel(visualdevEntity); + + // 判断请求客户端来源 + if (!RequestContext.isOrignPc()) { + visualJsonModel.setColumnData(visualJsonModel.getAppColumnData()); + } + + List idsList = new ArrayList<>(); + List idsVoList = Arrays.asList(idsVo.getIds()); + String errMess = ""; + + List> dataMap = new ArrayList<>(); + for (String id : idsVoList) { + VisualdevModelDataInfoVO editDataInfo = visualDevInfoService.getEditDataInfo(id, visualdevEntity, + OnlineInfoModel.builder().build()); + Map map = JsonUtil.stringToMap(editDataInfo.getData()); + dataMap.add(map); + + if (StringUtil.isNotBlank(idsVo.getFlowId())) { + TaskEntity taskEntity = taskApi.getInfoSubmit(map.get(FlowFormConstant.FLOWTASKID).toString(), + TaskEntity::getId, + TaskEntity::getParentId, TaskEntity::getFullName, TaskEntity::getStatus); + if (taskEntity != null) { + try { + taskApi.delete(taskEntity); + idsList.add(id); + } catch (Exception e) { + errMess = e.getMessage(); + } + } else { + idsList.add(id); + } + } else { + idsList.add(id); + } + } + + if (idsList.size() == 0) { + return ActionResult.fail(errMess); + } + List dataInfoVOList = integrateUtil.dataList(modelId, 3, idsList); + + if (!StringUtil.isEmpty(visualdevEntity.getVisualTables()) + && !OnlineDevData.TABLE_CONST.equals(visualdevEntity.getVisualTables())) { + ActionResult result = visualdevModelDataService.tableDeleteMore(idsList, visualJsonModel); + AsyncExecuteModel build = AsyncExecuteModel.builder().modelId(modelId).trigger(3).dataId(idsList) + .dataMap(dataMap).userInfo(UserProvider.getUser()).build(); + integrateUtil.asyncExecute(build); + return result; + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + @Operation(summary = "导入数据") + @Parameters({ + @Parameter(name = "modelId", description = "模板id"), + @Parameter(name = "visualImportModel", description = "导入参数"), + }) + @PostMapping("{modelId}/ImportData") + public ActionResult imports(@PathVariable("modelId") String modelId, + @RequestBody VisualImportModel visualImportModel) throws Exception { + StpUtil.checkPermission(modelId); + + VisualdevEntity visualdevEntity = visualdevService.getReleaseInfo(modelId); + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(visualdevEntity.getColumnData(), + ColumnDataModel.class); + if (columnDataModel != null && columnDataModel.getUseBtnPermission()) { + StpUtil.checkPermission(modelId + "::" + PermissionConst.BTN_UPLOAD); + } + VisualDevJsonModel visualJsonModel = OnlinePublicUtils.getVisualJsonModel(visualdevEntity); + FormDataModel formData = visualJsonModel.getFormData(); + List fieldsModelList = JsonUtil.getJsonToList(formData.getFields(), FieLdsModel.class); + List allFieLds = new ArrayList<>(); + VisualUtils.recursionFields(fieldsModelList, allFieLds); + visualJsonModel.setFormListModels(allFieLds); + visualJsonModel.setFlowId(visualImportModel.getFlowId()); + // 复杂表头数据 还原成普通数据 + List> listData = new ArrayList<>(); + List> headerRow = new ArrayList<>(); + if (visualImportModel.isType()) { + ActionResult result = ImportPreview(modelId, visualImportModel.getFileName()); + if (result == null) { + throw new Exception(MsgCode.FA018.get()); + } + if (result.getCode() != 200) { + return result; + } + if (result.getData() instanceof Map) { + Map data = (Map) result.getData(); + listData = (List>) data.get("dataRow"); + headerRow = (List>) data.get("headerRow"); + } + } else { + listData = visualImportModel.getList(); + } + List> mapList = VisualUtils.complexImportsDataOnline(listData, visualdevEntity); + ExcelImportModel excelData = onlineSwapDataUtils.createExcelData(mapList, visualJsonModel, visualdevEntity); + List dataInfoList = excelData.getDataInfoList(); + List addIdList = new ArrayList<>(); + List updateIdList = new ArrayList<>(); + for (VisualdevModelDataInfoVO dataInfoVO : dataInfoList) { + Integer trigger = StringUtil.isEmpty(dataInfoVO.getIntegrateId()) ? 1 : 2; + if (Objects.equals(trigger, 1)) { + addIdList.add(dataInfoVO.getId().toString()); + } else { + updateIdList.add(dataInfoVO.getId().toString()); + } + } + List addData = integrateUtil.dataList(modelId, 1, addIdList); + integrateUtil.asyncList(addData, UserProvider.getUser()); + List updateData = integrateUtil.dataList(modelId, 2, updateIdList); + integrateUtil.asyncList(updateData, UserProvider.getUser()); + // 复杂表头-表头和数据处理 + List complexHeaderList = columnDataModel.getComplexHeaderList(); + if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { + List> mapList1 = VisualUtils.complexHeaderDataHandel(excelData.getFailResult(), + complexHeaderList, false); + excelData.setFailResult(mapList1); + } + excelData.setHeaderRow(headerRow); + return ActionResult.success(excelData); + } + + @Operation(summary = "导出") + @Parameters({ + @Parameter(name = "modelId", description = "模板id"), + @Parameter(name = "paginationModelExport", description = "导出参数"), + }) + @PostMapping("/{modelId}/Actions/ExportData") + public ActionResult export(@PathVariable("modelId") String modelId, + @RequestBody PaginationModelExport paginationModelExport) + throws ParseException, IOException, SQLException, DataException { + StpUtil.checkPermission(modelId); + + ModuleEntity menuInfo = moduleService.getInfo(paginationModelExport.getMenuId()); + VisualdevEntity visualdevEntity = visualdevService.getReleaseInfo(modelId); + if (visualdevEntity == null) { + ActionResult.fail(MsgCode.FA001.get()); + } + String excelName = ""; + if (menuInfo != null) { + excelName = menuInfo.getFullName(); + } else { + excelName = visualdevEntity.getFullName(); + } + + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(visualdevEntity.getColumnData(), + ColumnDataModel.class); + if (columnDataModel != null && columnDataModel.getUseBtnPermission()) { + StpUtil.checkPermission(modelId + "::" + PermissionConst.BTN_DOWNLOAD); + } + + VisualDevJsonModel visualJsonModel = OnlinePublicUtils.getVisualJsonModel(visualdevEntity); + // 判断请求客户端来源 + if (!RequestContext.isOrignPc()) { + visualJsonModel.setColumnData(visualJsonModel.getAppColumnData()); + } + + String[] keys = paginationModelExport.getSelectKey(); + List selectKey = Arrays.asList(paginationModelExport.getSelectKey()); + List selectIds = Arrays.asList(paginationModelExport.getSelectIds()); + // 关键字过滤 + List> realList; + DownloadVO vo; + + if (VisualWebTypeEnum.DATA_VIEW.getType().equals(visualdevEntity.getWebType())) {// 视图查询数据 + VisualdevReleaseEntity visualdevREntity = JsonUtil.getJsonToBean(visualdevEntity, + VisualdevReleaseEntity.class); + realList = onlineSwapDataUtils.getInterfaceData(visualdevREntity, paginationModelExport, + visualJsonModel.getColumnData()); + if ("2".equals(paginationModelExport.getDataType()) && StringUtil.isBlank(columnDataModel.getViewKey())) { + ActionResult.fail(MsgCode.VS029.get()); + } + realList = "2".equals(paginationModelExport.getDataType()) ? realList.stream() + .filter(t -> selectIds.contains(t.get(columnDataModel.getViewKey()))).collect(Collectors.toList()) + : realList; + vo = VisualUtils.createModelExcelApiData(visualdevEntity.getColumnData(), realList, Arrays.asList(keys), + "表单信息", excelName, new ExcelModel()); + } else { + ExcelModel excelModel = onlineSwapDataUtils.getDefaultValue(visualdevEntity.getFormData(), selectKey); + realList = visualdevModelDataService.exportData(keys, paginationModelExport, visualJsonModel); + realList = "2".equals(paginationModelExport.getDataType()) + ? realList.stream().filter(t -> selectIds.contains(t.get("id"))).collect(Collectors.toList()) + : realList; + vo = VisualUtils.createModelExcel(visualdevEntity, realList, Arrays.asList(keys), "表单信息", excelName, + excelModel); + } + return ActionResult.success(vo); + } + + @Operation(summary = "功能导出") + @Parameters({ + @Parameter(name = "modelId", description = "模板id"), + }) + @PostMapping("/{modelId}/Actions/Export") + @SaCheckPermission("onlineDev.webDesign") + public ActionResult exportData(@PathVariable("modelId") String modelId) { + VisualdevEntity visualdevEntity = visualdevService.getReleaseInfo(modelId); + BaseDevModelVO vo = JsonUtil.getJsonToBean(visualdevEntity, BaseDevModelVO.class); + List list = aliasService.getList(visualdevEntity.getId()); + vo.setAliasListJson(JsonUtil.getObjectToString(list)); + vo.setModelType(ExportModelTypeEnum.Design.getMessage()); + DownloadVO downloadVO = fileExport.exportFile(vo, configValueUtil.getTemporaryFilePath(), + visualdevEntity.getFullName(), ModuleTypeEnum.VISUAL_DEV.getTableName()); + return ActionResult.success(downloadVO); + } + + @Operation(summary = "功能导入") + @PostMapping(value = "/Actions/Import", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + @SaCheckPermission("onlineDev.webDesign") + public ActionResult ImportData(@RequestParam("type") Integer type, @RequestPart("file") MultipartFile multipartFile) + throws WorkFlowException { + // 判断是否为.json结尾 + if (FileUtil.existsSuffix(multipartFile, ModuleTypeEnum.VISUAL_DEV.getTableName())) { + return ActionResult.fail(MsgCode.IMP002.get()); + } + // 获取文件内容 + String fileContent = FileUtil.getFileContent(multipartFile); + BaseDevModelVO vo = JsonUtil.getJsonToBean(fileContent, BaseDevModelVO.class); + + VisualdevEntity visualdevEntity = JsonUtil.getJsonToBean(vo, VisualdevEntity.class); + + StringJoiner errList = new StringJoiner("、"); + String copyNum = UUID.randomUUID().toString().substring(0, 5); + if (visualdevService.getInfo(visualdevEntity.getId()) != null) { + if (Objects.equals(type, 0)) { + errList.add("ID"); + } else { + visualdevEntity.setId(RandomUtil.uuId()); + } + } + if (visualdevService.getObjByEncode(visualdevEntity.getEnCode(), visualdevEntity.getType()) > 0) { + if (Objects.equals(type, 0)) { + errList.add(MsgCode.IMP009.get()); + } else { + visualdevEntity.setEnCode(visualdevEntity.getEnCode() + copyNum); + } + } + if (visualdevService.getCountByName(visualdevEntity.getFullName(), visualdevEntity.getType()) > 0) { + if (Objects.equals(type, 0)) { + errList.add(MsgCode.IMP008.get()); + } else { + visualdevEntity.setFullName(visualdevEntity.getFullName() + ".副本" + copyNum); + } + } + if (Objects.equals(type, 0) && errList.length() > 0) { + return ActionResult.fail(errList + MsgCode.IMP007.get()); + } + + if (visualdevEntity.getId() != null) { + visualdevService.setIgnoreLogicDelete().removeById(visualdevEntity.getId()); + visualdevService.clearIgnoreLogicDelete(); + } + visualdevEntity.setCreatorTime(DateUtil.getNowDate()); + visualdevEntity.setCreatorUserId(UserProvider.getUser().getUserId()); + visualdevEntity.setLastModifyTime(null); + visualdevEntity.setLastModifyUserId(null); + visualdevEntity.setDbLinkId("0"); + visualdevEntity.setState(0); + visualdevService.save(visualdevEntity); + if (StringUtil.isNotEmpty(vo.getAliasListJson())) { + List jsonToList = JsonUtil.getJsonToList(vo.getAliasListJson(), VisualAliasEntity.class); + for (VisualAliasEntity aliasEntity : jsonToList) { + aliasService.copyEntity(aliasEntity, visualdevEntity.getId()); + } + } + return ActionResult.success(MsgCode.IMP001.get()); + } + + @Operation(summary = "模板下载") + @Parameters({ + @Parameter(name = "modelId", description = "模板id"), + @Parameter(name = "menuId", description = "菜单id"), + }) + @GetMapping("/{modelId}/TemplateDownload") + public ActionResult templateDownload(@PathVariable("modelId") String modelId, + @RequestParam(value = "menuId", required = false) String menuId) { + StpUtil.checkPermission(modelId); + + ModuleEntity menuInfo = moduleService.getInfo(menuId); + VisualdevEntity visualdevEntity = visualdevService.getReleaseInfo(modelId); + if (visualdevEntity == null) { + ActionResult.fail(MsgCode.FA001.get()); + } + String menuFullName = ""; + if (menuInfo != null) { + menuFullName = menuInfo.getFullName(); + } else { + menuFullName = visualdevEntity.getFullName(); + } + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(visualdevEntity.getColumnData(), + ColumnDataModel.class); + if (columnDataModel != null && columnDataModel.getUseBtnPermission()) { + StpUtil.checkPermission(modelId + "::" + PermissionConst.BTN_DOWNLOAD); + } + UploaderTemplateModel uploaderTemplateModel = JsonUtil.getJsonToBean(columnDataModel.getUploaderTemplateJson(), + UploaderTemplateModel.class); + List selectKey = uploaderTemplateModel.getSelectKey(); + ExcelModel excelModel = onlineSwapDataUtils.getDefaultValue(visualdevEntity.getFormData(), selectKey); + List> dataList = new ArrayList<>(); + dataList.add(excelModel.getDataMap()); + DownloadVO vo = VisualUtils.createModelExcel(visualdevEntity, dataList, selectKey, "导入模板", + menuFullName + "导入模板", excelModel); + return ActionResult.success(vo); + } + + @Operation(summary = "上传文件") + @PostMapping("/Uploader") + public ActionResult Uploader() { + List list = UpUtil.getFileAll(); + MultipartFile file = list.get(0); + if (file.getOriginalFilename().endsWith(".xlsx") || file.getOriginalFilename().endsWith(".xls")) { + String filePath = XSSEscape.escape(configValueUtil.getTemporaryFilePath()); + String fileName = XSSEscape.escape(RandomUtil.uuId() + "." + UpUtil.getFileType(file)); + // 上传文件 + FileInfo fileInfo = FileUploadUtils.uploadFile(file, filePath, fileName); + DownloadVO vo = DownloadVO.builder().build(); + vo.setName(fileInfo.getFilename()); + return ActionResult.success(vo); + } else { + return ActionResult.fail(MsgCode.ETD110.get()); + } + } + + @Operation(summary = "导入预览") + @Parameters({ + @Parameter(name = "modelId", description = "模板id"), + @Parameter(name = "fileName", description = "文件名"), + }) + @GetMapping("/{modelId}/ImportPreview") + public ActionResult> ImportPreview(@PathVariable("modelId") String modelId, String fileName) + throws Exception { + StpUtil.checkPermission(modelId); + + Map previewMap = null; + try { + VisualdevReleaseEntity entity = visualdevReleaseService.getById(modelId); + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(entity.getColumnData(), ColumnDataModel.class); + if (columnDataModel != null && columnDataModel.getUseBtnPermission()) { + StpUtil.checkPermission(modelId + "::" + PermissionConst.BTN_UPLOAD); + } + FormDataModel formDataModel = JsonUtil.getJsonToBean(entity.getFormData(), FormDataModel.class); + UploaderTemplateModel uploaderTemplateModel = JsonUtil + .getJsonToBean(columnDataModel.getUploaderTemplateJson(), UploaderTemplateModel.class); + List fieLdsModels = JsonUtil.getJsonToList(formDataModel.getFields(), FieLdsModel.class); + List allFields = new ArrayList<>(); + OnlinePublicUtils.recursionFormFields(allFields, fieLdsModels); + + List selectKey = uploaderTemplateModel.getSelectKey(); + + // 子表tableField + Set tablefield1 = selectKey.stream() + .filter(s -> s.toLowerCase().startsWith(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX)) + .map(s -> s.substring(0, s.indexOf("-"))).collect(Collectors.toSet()); + + String filePath = FileUploadUtils.getLocalBasePath() + configValueUtil.getTemporaryFilePath(); + FileUploadUtils.downLocal(configValueUtil.getTemporaryFilePath(), filePath, fileName); + File temporary = new File(XSSEscape.escapePath(filePath + fileName)); + // 判断有无子表 + String tablefield = selectKey.stream() + .filter(s -> s.toLowerCase().startsWith(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX)).findFirst() + .orElse(null); + // 判断有没有复杂表头 + boolean hasComplex = false; + for (HeaderModel item : columnDataModel.getComplexHeaderList()) { + if (item.getChildColumns() != null && item.getChildColumns().size() > 0) { + List childColumns = new ArrayList<>(item.getChildColumns()); + childColumns.retainAll(selectKey); + if (childColumns.size() > 0) + hasComplex = true; + } + } + // 有子表需要取第二行的表头 + Integer i = tablefield != null || hasComplex ? 2 : 1; + // 读取excel中数据 + InputStream inputStream = ExcelUtil.solveOrginTitle(temporary, i); + List excelDataList = ExcelUtil.importExcelByInputStream(inputStream, 0, i, Map.class); + // 数据超过100条 + if (excelDataList != null && excelDataList.size() > 1000) { + return ActionResult.fail(MsgCode.ETD117.get()); + } + // todo 备用方案,读取不到时间暂用此方法 + ExcelUtil.imoportExcelToMap(temporary, i, excelDataList); + // 列表字段 + List> columns = new ArrayList<>(); + List chiImList = new ArrayList<>(); + List allImList = new ArrayList<>(); + selectKey.stream().forEach(s -> { + String requiredStr = ""; + ImportExcelFieldModel importExcel = new ImportExcelFieldModel(); + if (s.toLowerCase().startsWith(YunzhupaasKeyConsts.CHILD_TABLE_PREFIX)) { + String table = s.substring(0, s.indexOf("-")); + String field = s.substring(s.indexOf("-") + 1); + FieLdsModel fieLdsModel = allFields.stream().filter(t -> t.getVModel().equals(table)).findFirst() + .orElse(null); + List children = fieLdsModel.getConfig().getChildren(); + FieLdsModel fieLdsModel1 = children.stream().filter(t -> t.getVModel().equals(field)).findFirst() + .orElse(null); + requiredStr = fieLdsModel1.getConfig().isRequired() ? "*" : ""; + importExcel.setField(field); + importExcel.setTableField(table); + importExcel.setFullName(requiredStr + fieLdsModel1.getConfig().getLabel()); + importExcel.setYunzhupaasKey(fieLdsModel1.getConfig().getYunzhupaasKey()); + chiImList.add(importExcel); + } else { + FieLdsModel fieLdsModel = allFields.stream().filter(t -> t.getVModel().equals(s)).findFirst() + .orElse(null); + requiredStr = fieLdsModel.getConfig().isRequired() ? "*" : ""; + importExcel.setField(s); + importExcel.setFullName(requiredStr + fieLdsModel.getConfig().getLabel()); + importExcel.setYunzhupaasKey(fieLdsModel.getConfig().getYunzhupaasKey()); + allImList.add(importExcel); + } + }); + Map> groups = chiImList.stream().collect(Collectors + .groupingBy(ImportExcelFieldModel::getTableField, LinkedHashMap::new, Collectors.toList())); + + for (Map.Entry> entry : groups.entrySet()) { + ImportExcelFieldModel importExcel = new ImportExcelFieldModel(); + + List value = entry.getValue(); + ImportExcelFieldModel im = value.get(0); + FieLdsModel fieLdsModel = allFields.stream().filter(f -> entry.getKey().equals(f.getVModel())) + .findFirst().orElse(null); + String tableName = fieLdsModel.getConfig().getLabel(); + importExcel.setField(entry.getKey()); + importExcel.setFullName(tableName); + importExcel.setYunzhupaasKey("table"); + // value.stream().forEach(im1->im1.setFullName(im1.getFullName().replace(tableName+"-",""))); + importExcel.setChildren(value); + allImList.add(importExcel); + } + + for (ImportExcelFieldModel importExcel : allImList) { + Map selectMap = new HashMap<>(16); + selectMap.put("id", importExcel.getField()); + selectMap.put("fullName", importExcel.getFullName()); + selectMap.put("yunzhupaasKey", importExcel.getYunzhupaasKey()); + if (importExcel.getChildren() != null) { + List children = importExcel.getChildren(); + List> childMapList = new ArrayList<>(); + for (ImportExcelFieldModel childIm : children) { + Map childMap = new HashMap<>(16); + childMap.put("id", childIm.getField()); + childMap.put("fullName", childIm.getFullName()); + childMap.put("yunzhupaasKey", childIm.getYunzhupaasKey()); + childMapList.add(childMap); + } + selectMap.put("children", childMapList); + } + columns.add(selectMap); + } + + List> results = FormExecelUtils.dataMergeChildTable(excelDataList, selectKey); + + previewMap = new HashMap<>(); + // 复杂表头-表头和数据处理 + List complexHeaderList = columnDataModel.getComplexHeaderList(); + if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) { + columns = VisualUtils.complexHeaderHandelOnline(columns, complexHeaderList); + } + previewMap.put("dataRow", results); + previewMap.put("headerRow", columns); + } catch (Exception e) { + e.printStackTrace(); + return ActionResult.fail(MsgCode.VS407.get()); + } + return ActionResult.success(previewMap); + } + + @Operation(summary = "导出异常报告") + @Parameters({ + @Parameter(name = "modelId", description = "模板id"), + @Parameter(name = "visualImportModel", description = "导出参数"), + }) + @PostMapping("/{modelId}/ImportExceptionData") + public ActionResult ImportExceptionData(@PathVariable("modelId") String modelId, + @RequestBody VisualImportModel visualImportModel) { + StpUtil.checkPermission(modelId); + String menuFullName = ""; + if (StringUtil.isNotEmpty(visualImportModel.getMenuId())) { + ModuleEntity menuInfo = moduleService.getInfo(visualImportModel.getMenuId()); + if (menuInfo != null && StringUtil.isNotEmpty(menuInfo.getFullName())) { + menuFullName = menuInfo.getFullName(); + } + } + VisualdevEntity visualdevEntity = visualdevService.getReleaseInfo(modelId); + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(visualdevEntity.getColumnData(), + ColumnDataModel.class); + if (columnDataModel != null && columnDataModel.getUseBtnPermission()) { + StpUtil.checkPermission(modelId + "::" + PermissionConst.BTN_DOWNLOAD); + } + UploaderTemplateModel uploaderTemplateModel = JsonUtil.getJsonToBean(columnDataModel.getUploaderTemplateJson(), + UploaderTemplateModel.class); + List selectKey = uploaderTemplateModel.getSelectKey(); + ExcelModel excelModel = onlineSwapDataUtils.getDefaultValue(visualdevEntity.getFormData(), selectKey); + DownloadVO vo = VisualUtils.createModelExcel(visualdevEntity, visualImportModel.getList(), selectKey, "错误报告", + menuFullName + "错误报告", excelModel); + return ActionResult.success(vo); + } + + @Operation(summary = "自定义按钮发起审批") + @Parameters({ + @Parameter(name = "modelId", description = "模板id"), + @Parameter(name = "visualImportModel", description = "导出参数"), + }) + @PostMapping("/{modelId}/actionLaunchFlow") + public ActionResult actionLaunchFlow(@PathVariable("modelId") String modelId, + @RequestBody FlowLaunchModel model) { + StpUtil.checkPermission(modelId); + + VisualdevEntity visualdevEntity = visualdevService.getReleaseInfo(modelId); + ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(visualdevEntity.getColumnData(), + ColumnDataModel.class); + if (columnDataModel != null && columnDataModel.getUseBtnPermission()) { + StpUtil.checkPermission(modelId + "::" + model.getBtnCode()); + } + // 用户列表 + List userList = new ArrayList<>(); + if (Objects.equals(1, model.getCurrentUser())) { + userList.add(UserProvider.getUser().getUserId()); + } + if (Objects.equals(1, model.getCustomUser()) && CollectionUtil.isNotEmpty(model.getInitiator())) { + userList.addAll(userService.getUserIdList(model.getInitiator(), null)); + userList = new ArrayList<>(new HashSet<>(userList)); + } + // 数据列表 + List> formDataList = new ArrayList<>(); + List> dataList = model.getDataList(); + if (CollectionUtil.isNotEmpty(dataList)) { + for (List itemList : dataList) { + if (CollectionUtil.isNotEmpty(itemList)) { + Map map = new HashMap<>(); + for (TransferModel transferModel : itemList) { + map.put(transferModel.getTargetField(), transferModel.getSourceValue()); + } + formDataList.add(map); + } + } + } + FlowModel flowModel = new FlowModel(); + flowModel.setTemplateId(model.getTemplate()); + flowModel.setUserIds(userList); + flowModel.setFormDataList(formDataList); + ActionResult actionResult = taskApi.launchFlow(flowModel); + if (actionResult == null || !ActionResultCode.Success.getCode().equals(actionResult.getCode())) { + return ActionResult.fail(actionResult.getMsg()); + } + return ActionResult.success(actionResult.getMsg()); + } + + @Operation(summary = "根据菜单获取功能配置") + @Parameters({ + @Parameter(name = "menuId", description = "菜单id"), + }) + @GetMapping("/Config") + public ActionResult getConfigByMenu(@RequestParam(value = "menuId", required = false) String menuId, + @RequestParam(value = "systemId", required = false) String systemId) { + StpUtil.checkPermissionOr(menuId, "onlineDev.webDesign", "generator.webForm", "generator.flowForm"); + + VisualdevReleaseEntity releaseEntity = null; + ModuleEntity info = moduleService.getInfo(menuId); + + if (info != null && StringUtil.isNotEmpty(info.getPropertyJson())) { + PropertyJsonModel propertyJsonModel = JsonUtil.getJsonToBean(info.getPropertyJson(), + PropertyJsonModel.class); + String modelId = propertyJsonModel.getModuleId(); + releaseEntity = visualdevReleaseService.getById(modelId); + } + if (releaseEntity == null + || (StringUtil.isNotEmpty(systemId) && !Objects.equals(info.getSystemId(), systemId))) { + return ActionResult.fail(MsgCode.FA001.get()); + } + VisualdevEntity entity = JsonUtil.getJsonToBean(releaseEntity, VisualdevEntity.class); + + String s = VisualUtil.checkPublishVisualModel(entity, MsgCode.VS005.get()); + if (s != null) { + return ActionResult.fail(s); + } + DataInfoVO vo = JsonUtil.getJsonToBean(entity, DataInfoVO.class); + return ActionResult.success(vo); + } +} diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/pom.xml b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/pom.xml new file mode 100644 index 0000000..b29149c --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/pom.xml @@ -0,0 +1,27 @@ + + + + yunzhupaas-visualdev-onlinedev + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-visualdev-onlinedev-entity + + + + com.yunzhupaas + yunzhupaas-common-all + ${project.version} + + + com.yunzhupaas + yunzhupaas-visualdev-base-entity + ${project.version} + + + + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/entity/VisualLogEntity.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/entity/VisualLogEntity.java new file mode 100644 index 0000000..c712088 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/entity/VisualLogEntity.java @@ -0,0 +1,45 @@ +package com.yunzhupaas.onlinedev.entity; + + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperEntity; +import lombok.Data; + +/** + * 在线开发-数据日志实体类 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/8/27 15:50:10 + */ +@Data +@TableName("base_visual_log") +public class VisualLogEntity extends SuperEntity { + + /** + * 模板id + */ + @TableField("F_MODEL_ID") + private String modelId; + + /** + * 日志类型:0-新建,1-编辑 + */ + @TableField("F_TYPE") + private Integer type; + + /** + * 数据id + */ + @TableField("F_DATA_ID") + private String dataId; + + /** + * 日志内容 + */ + @TableField("F_DATA_LOG") + private String dataLog; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/entity/VisualPersonalEntity.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/entity/VisualPersonalEntity.java new file mode 100644 index 0000000..6960cfb --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/entity/VisualPersonalEntity.java @@ -0,0 +1,50 @@ +package com.yunzhupaas.onlinedev.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperEntity; +import lombok.Data; + +/** + * 列表个性视图 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/11/5 16:47:24 + */ +@Data +@TableName("base_visual_personal") +public class VisualPersonalEntity extends SuperEntity { + /** + * 菜单id + */ + @TableField("F_MENU_ID") + private String menuId; + /** + * 个性视图名称 + */ + @TableField("F_full_name") + private String fullName; + /** + * 类型:0-系统,1-其他 + */ + @TableField("F_TYPE") + private Integer type; + /** + * 状态:0-其他,1-默认 + */ + @TableField("F_STATUS") + private Integer status; + /** + * 查询字段 + */ + @TableField("F_SEARCH_LIST") + private String searchList; + /** + * 列表字段 + */ + @TableField("F_COLUMN_LIST") + private String columnList; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/entity/VisualdevModelDataEntity.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/entity/VisualdevModelDataEntity.java new file mode 100644 index 0000000..03f8c00 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/entity/VisualdevModelDataEntity.java @@ -0,0 +1,55 @@ +package com.yunzhupaas.onlinedev.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * + * 0代码功能数据表 + * 版本: V3.0.0 + * 版权: 深圳市乐程软件有限公司 + * 作者: 管理员/admin + * 日期: 2020-07-24 11:59 + */ +@Data +//@TableName("base_visualdev_modeldata") +public class VisualdevModelDataEntity extends SuperExtendEntity { + + @TableField("F_VISUALDEVID") + private String visualDevId; + + @TableField("F_SORTCODE") + private Long sortcode; + + @TableField("F_ENABLEDMARK") + private Integer enabledmark; + + @TableField("F_CREATORTIME") + private Date creatortime; + + @TableField("F_CREATORUSERID") + private String creatoruserid; + + @TableField("F_LASTMODIFYTIME") + private Date lastmodifytime; + + @TableField("F_LASTMODIFYUSERID") + private String lastmodifyuserid; + + @TableField("F_DELETEMARK") + private Integer deletemark; + + @TableField("F_DELETETIME") + private Date deletetime; + + @TableField("F_DELETEUSERID") + private String deleteuserid; + @TableField("F_DATA") + private String data; + +} + + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/AsyncExecuteModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/AsyncExecuteModel.java new file mode 100644 index 0000000..98eb30b --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/AsyncExecuteModel.java @@ -0,0 +1,27 @@ +package com.yunzhupaas.onlinedev.model; + +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.model.flow.DataModel; +import lombok.Builder; +import lombok.Data; + +import java.util.List; +import java.util.Map; + +/** + * 类的描述 + * + * @author YUNZHUPAASYUNZHUPAAS开发组 + * @version 5.0.x + * @since 2024/12/19 17:12 + */ +@Data +@Builder +public class AsyncExecuteModel { + private String modelId; + private Integer trigger; + private List dataId; + private List> dataMap; + private UserInfo userInfo; + private DataModel dataModel; +} diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/BaseDevModelVO.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/BaseDevModelVO.java new file mode 100644 index 0000000..2bdacd9 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/BaseDevModelVO.java @@ -0,0 +1,79 @@ +package com.yunzhupaas.onlinedev.model; + +import lombok.Data; + +/** + * 功能设计导入导出模型 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/7/15 + */ +@Data +public class BaseDevModelVO { + + private String id; + + private String description; + + private String sortCode; + + private String enabledMark; + + private String creatorTime; + + private String creatorUser; + + private String lastModifyTime; + + private String lastModifyUser; + + private String deleteMark; + + private String deleteTime; + + private String deleteUserId; + + private String fullName; + + private String enCode; + + private String state; + + private String type; + + private String tables; + + private String category; + + private String formData; + + private String columnData; + + private String appColumnData; + + private String dbLinkId; + + private String webType; + + private String flowTemplateJson; + + private String modelType; + + private String enableFlow; + + private String interfaceId; + + private String interfaceParam; + + //以下系统表单属性 + private String urlAddress; + + private String appUrlAddress; + + private String interfaceUrl; + + private String aliasListJson; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/BatchRemoveIdsVo.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/BatchRemoveIdsVo.java new file mode 100644 index 0000000..be44797 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/BatchRemoveIdsVo.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.onlinedev.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 批量删除id集合 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2021/6/17 + */ +@Data +@Schema(description="批量处理参数") +public class BatchRemoveIdsVo { + @Schema(description = "批量处理数据id") + private String[] ids; + + @Schema(description = "流程id") + private String flowId; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/ColumnDataInfoVO.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/ColumnDataInfoVO.java new file mode 100644 index 0000000..583058a --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/ColumnDataInfoVO.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.onlinedev.model; +import lombok.Data; + +/** + * + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @author 云筑产品开发平台组 + * @date 2024/3/16 + */ +@Data +public class ColumnDataInfoVO { + private String columnData; + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/DataInfoVO.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/DataInfoVO.java new file mode 100644 index 0000000..c8017bb --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/DataInfoVO.java @@ -0,0 +1,43 @@ +package com.yunzhupaas.onlinedev.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.model.visualJson.TableFields; +import com.yunzhupaas.onlinedev.model.personalList.VisualPersonalInfo; +import com.yunzhupaas.onlinedev.model.personalList.VisualPersonalVo; +import lombok.Data; + +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/3/16 + */ +@Data +public class DataInfoVO { + private String id; + private String formData; + private String columnData; + private String appColumnData; + private String webType; + private String flowTemplateJson; + private String flowEnCode; + private String flowId; + private String fullName; + private Integer enableFlow; + private Integer type; + private String urlAddress; + private String enCode; + private String appUrlAddress; + private String interfaceId; + + @Schema(description = "个性化视图列表") + private List personalList; + @Schema(description = "个性化视图默认视图") + private VisualPersonalInfo defaultView; + + @Schema(description = "存字段列表") + private List propsValueList; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/ExcelImFieldModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/ExcelImFieldModel.java new file mode 100644 index 0000000..88acd23 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/ExcelImFieldModel.java @@ -0,0 +1,44 @@ +package com.yunzhupaas.onlinedev.model; +import lombok.Data; + +import java.util.List; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.4.3 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2022/9/21 + */ +@Data +public class ExcelImFieldModel { + private String id; + private String fullName; + private String yunzhupaasKey; + private List children; + + public ExcelImFieldModel(String id, String fullName, List children) { + this.id = id; + this.fullName = fullName; + this.children = children; + } + public ExcelImFieldModel(String id, String fullName) { + this.id = id; + this.fullName = fullName; + } + + public ExcelImFieldModel(String id, String fullName, String yunzhupaasKey, List children) { + this.id = id; + this.fullName = fullName; + this.yunzhupaasKey = yunzhupaasKey; + this.children = children; + } + + public ExcelImFieldModel(String id, String fullName, String yunzhupaasKey) { + this.id = id; + this.fullName = fullName; + this.yunzhupaasKey = yunzhupaasKey; + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/FormDataInfoVO.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/FormDataInfoVO.java new file mode 100644 index 0000000..0b4d792 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/FormDataInfoVO.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.onlinedev.model; +import lombok.Data; + +/** + * + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @author 云筑产品开发平台组 + * @date 2024/3/16 + */ +@Data +public class FormDataInfoVO { + private String formData; + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevEnum/CacheKeyEnum.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevEnum/CacheKeyEnum.java new file mode 100644 index 0000000..33b5058 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevEnum/CacheKeyEnum.java @@ -0,0 +1,46 @@ +package com.yunzhupaas.onlinedev.model.OnlineDevEnum; + +/** + * + * 在线开发缓存的key + * @author 云筑产品开发平台组 + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2021/7/31 + */ +public enum CacheKeyEnum { + /** + * 修改用户,创建用户,用户组件 + */ + USER("_user","用户"), + + POS("_position","岗位"), + + ORG("_organization","组织"), + + ORGTREE("_organizeTree","组织多级"), + + PRO("_province","省份"), + + ROLE("_role","角色"), + + GROUP("_group","分组"); + private final String name; + private final String message; + + CacheKeyEnum(String name, String message) { + this.name = name; + this.message = message; + } + + public String getName() { + return name; + } + + public String getMessage() { + return message; + } + + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevEnum/MultipleControlEnum.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevEnum/MultipleControlEnum.java new file mode 100644 index 0000000..0dd1e69 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevEnum/MultipleControlEnum.java @@ -0,0 +1,44 @@ +package com.yunzhupaas.onlinedev.model.OnlineDevEnum; + +/** + * 控件多选字符 + * + * @author 云筑产品开发平台组 + * @version V3.3 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/2/14 + */ + +public enum MultipleControlEnum { + /** + * 数组 + */ + MULTIPLE_JSON_ONE("[",1), + /** + * 二维数组 + */ + MULTIPLE_JSON_TWO("[[",2), + /** + * 普通字符 + */ + MULTIPLE_JSON_THREE("",3); + + + MultipleControlEnum(String multipleChar, int dataType) { + MultipleChar = multipleChar; + DataType = dataType; + } + + public String getMultipleChar() { + return MultipleChar; + } + + public int getDataType() { + return DataType; + } + + private String MultipleChar; + private int DataType; + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevEnum/OnlineDataTypeEnum.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevEnum/OnlineDataTypeEnum.java new file mode 100644 index 0000000..b3f9ecc --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevEnum/OnlineDataTypeEnum.java @@ -0,0 +1,54 @@ +package com.yunzhupaas.onlinedev.model.OnlineDevEnum; + + + +/** + * + * 数据接口类型 + * @author 云筑产品开发平台组 + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2021/7/31 + */ + +public enum OnlineDataTypeEnum { + /** + * 静态数据 + */ + STATIC("static","静态数据"), + /** + * 数据字典 + */ + DICTIONARY("dictionary","数据字典"), + /** + * 远端数据 + */ + DYNAMIC("dynamic","远端数据"), + + /** + * 二维码 条形码类型 + */ + STATIC_CODE("static","固定值"), + + RELATION("relation","关联组件") + ; + + private final String type; + private final String message; + + + OnlineDataTypeEnum(String type, String message) { + this.type = type; + this.message = message; + } + + public String getType() { + return type; + } + + public String getMessage() { + return message; + } + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevListModel/InterefaceParamModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevListModel/InterefaceParamModel.java new file mode 100644 index 0000000..fc61bbd --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevListModel/InterefaceParamModel.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.onlinedev.model.OnlineDevListModel; + +import lombok.Data; + +@Data +public class InterefaceParamModel { + /** + * 字段 + */ + private String field ; + /** + * 作为查询字段 + */ + private Boolean useSearch; + /** + * 参数值 + */ + private String defaultValue; + + private String dataType; + private String parameter; + private String disabled; + private String id; + private String required; + + private String fieldName; + private String yunzhupaasKey; + private String relationField; + private Integer sourceType = 1; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevListModel/OnlineColumnChildFieldModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevListModel/OnlineColumnChildFieldModel.java new file mode 100644 index 0000000..13fd014 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevListModel/OnlineColumnChildFieldModel.java @@ -0,0 +1,36 @@ +package com.yunzhupaas.onlinedev.model.OnlineDevListModel; +import lombok.Data; + +import java.util.List; + +/** + * 列表子表 + * + * @author 云筑产品开发平台组 + * @version V3.2 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2021/10/16 + */ +@Data +public class OnlineColumnChildFieldModel { + /** + * 子表表名 + */ + private String table; + /** + * 关联外键 + */ + private String tableField; + + /** + * 关联主键 + */ + private String relationField; + + /** + * 子表字段集合 + */ + private List fieldList; + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevListModel/OnlineColumnFieldModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevListModel/OnlineColumnFieldModel.java new file mode 100644 index 0000000..fce241e --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevListModel/OnlineColumnFieldModel.java @@ -0,0 +1,34 @@ +package com.yunzhupaas.onlinedev.model.OnlineDevListModel; +import lombok.Data; + +/** + * 列表字段 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2021/10/16 + */ +@Data +public class OnlineColumnFieldModel { + /** + * 表名 + */ + private String tableName; + /** + * 字段 + */ + private String field; + + /** + * 原本字段 + */ + private String OriginallyField; + + /** + * 别名 + */ + private String otherName; + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevListModel/OnlineConfigModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevListModel/OnlineConfigModel.java new file mode 100644 index 0000000..945d4f7 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevListModel/OnlineConfigModel.java @@ -0,0 +1,66 @@ +package com.yunzhupaas.onlinedev.model.OnlineDevListModel; + + +import com.yunzhupaas.model.visualJson.config.RegListModel; +import lombok.Data; + +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/8/5 + */ +@Data +public class OnlineConfigModel { + private String label; + private String labelWidth; + private Boolean showLabel; + private Boolean changeTag; + private Boolean border; + private String tag; + private String tagIcon; + private Boolean required; + private String layout; + private String dataType; + private Integer span; + private String yunzhupaasKey; + private String dictionaryType; + private Integer formId; + private Long renderKey; + private Integer columnWidth; + private List regList; + private Object defaultValue; + /** + * app静态数据 + */ + private String options; + /** + * 判断defaultValue类型 + */ + private String valueType; + private String propsUrl; + private String optionType; + /** + * 子表添加字段 + */ + private String showTitle; + private String tableName; + private List children; + /** + * 单据规则使用 + */ + private String rule; + + /** + * 验证规则触发方式 + */ + private String trigger = "blur" ; + /** + * 隐藏 + */ + private Boolean noShow = false; + private String yunzhupaasKeyName; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevListModel/OnlineDevListDataVO.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevListModel/OnlineDevListDataVO.java new file mode 100644 index 0000000..caa6b17 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevListModel/OnlineDevListDataVO.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.onlinedev.model.OnlineDevListModel; +import lombok.Data; + +import java.util.Map; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2021/7/28 + */ +@Data +public class OnlineDevListDataVO { + private String id; + private Map data; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevListModel/OnlineFieldsModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevListModel/OnlineFieldsModel.java new file mode 100644 index 0000000..aa3824c --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevListModel/OnlineFieldsModel.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.onlinedev.model.OnlineDevListModel; + + +import lombok.Data; + +import java.util.List; + + +/** + *在线开发formData + * + * @author 云筑产品开发平台组 + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2021/8/2 + */ +@Data +public class OnlineFieldsModel { + private StringBuilder sql; + private List mastTableList; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevListModel/OnlineListSqlModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevListModel/OnlineListSqlModel.java new file mode 100644 index 0000000..c0df44b --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevListModel/OnlineListSqlModel.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.onlinedev.model.OnlineDevListModel; +import lombok.Data; + +@Data +public class OnlineListSqlModel { + /** + * 主表 + */ + private String mainTable; + /** + * 用到的字段 + */ + private String fields; + /** + * 主键 + */ + private String pKeyName; + /** + * 数据权限条件 + */ + private String resultSql; + + private String defaultSidx; + private String sort; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevListModel/PropsFatherModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevListModel/PropsFatherModel.java new file mode 100644 index 0000000..3e7ce89 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevListModel/PropsFatherModel.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.onlinedev.model.OnlineDevListModel; +import lombok.Data; + +/** + * + * props父级 + * @author 云筑产品开发平台组 + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2021/8/3 + */ +@Data +public class PropsFatherModel { + private PropsModel props; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevListModel/PropsModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevListModel/PropsModel.java new file mode 100644 index 0000000..9b3caaa --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevListModel/PropsModel.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.onlinedev.model.OnlineDevListModel; +import lombok.Data; + +/** + * + * + * @author 云筑产品开发平台组 + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2021/8/3 + */ +@Data +public class PropsModel { + private String children; + private String value; + private String label; + private boolean multiple; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevListModel/SlotModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevListModel/SlotModel.java new file mode 100644 index 0000000..618970c --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevListModel/SlotModel.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.onlinedev.model.OnlineDevListModel; +import lombok.Data; + +import java.util.List; +import java.util.Map; + +/** + * + * slot + * @author 云筑产品开发平台组 + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2021/8/2 + */ +@Data +public class SlotModel { + private List> options; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevListModel/VisualColumnSearchVO.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevListModel/VisualColumnSearchVO.java new file mode 100644 index 0000000..1e12b2b --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineDevListModel/VisualColumnSearchVO.java @@ -0,0 +1,85 @@ +package com.yunzhupaas.onlinedev.model.OnlineDevListModel; + +import com.yunzhupaas.model.visualJson.TemplateJsonModel; +import com.yunzhupaas.model.visualJson.config.ConfigModel; +import com.yunzhupaas.model.visualJson.props.PropsModel; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/8/9 + */ +@Data +public class VisualColumnSearchVO { + /** + * 查询字段全key:如tableField113-datePickerField117 + */ + private String id; + /** + * 查询字段全名:如设计子表-子表年月日 + */ + private String fullName; + /** + * 查询条件类型 1.等于 2.模糊 3.范围 + */ + private String searchType; + private String vModel; + /** + * 查询值 + */ + private Object value; + /** + * 是否多选 + */ + private Boolean multiple; + + private Boolean searchMultiple; + + private ConfigModel config; + /** + * 省市区 + */ + private Integer level; + /** + * 时间类型格式 + */ + private String format; + private String type; + + /** + * 数据库字段 + */ + private String field; + private String table; + + private PropsModel props; + private SlotModel slot; + private String options; + + private List templateJson = new ArrayList(); + private String interfaceId; + + private String selectType; + private String ableDepIds; + private String ableIds; + private String ablePosIds; + private String ableUserIds; + private String ableRoleIds; + private String ableGroupIds; + + /** + * 列表字段是否关键词 + */ + private Boolean isKeyword = false; + + /** + * 是否选中数据及子信息(只针对视图) + */ + private Boolean isIncludeSubordinate = false; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineInfoModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineInfoModel.java new file mode 100644 index 0000000..bbfd3c2 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/OnlineInfoModel.java @@ -0,0 +1,32 @@ +package com.yunzhupaas.onlinedev.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.model.visualJson.analysis.FormAllModel; +import lombok.Builder; +import lombok.Data; + +import java.util.List; + +@Data +@Builder +public class OnlineInfoModel { + /** + * 是否需要关联表单字段 + */ + private boolean needRlationFiled = false; + /** + * 是否转换 + */ + private boolean needSwap = false; + /** + * 存储字段 + */ + private String propsValue; + + @Schema(description = "解析后字段") + private List formAllModel; + + @Schema(description = "菜单id") + private String menuId; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/PaginationModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/PaginationModel.java new file mode 100644 index 0000000..3adac73 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/PaginationModel.java @@ -0,0 +1,41 @@ +package com.yunzhupaas.onlinedev.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @author 云筑产品开发平台组 + * @date 2024/3/16 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(description="查询条件模型") +public class PaginationModel extends Pagination { + @Schema(description = "查询条件json") + private String queryJson; + @Schema(description = "菜单id") + private String menuId; + @Schema(description = "关联字段") + private String relationField; + @Schema(description = "字段对象") + private String columnOptions; + @Schema(description = "数据类型") + private String dataType; + @Schema(description = "高级查询条件json") + private String superQueryJson; + @Schema(description = "异步查询父id") + private String parentId; + + @Schema(description = "关联表单查询类型:0-简易查询(单行,多行,数字,下拉补全),1-全部字段") + private Integer queryType = 1; + + @Schema(description = "页签查询") + private String extraQueryJson; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/PaginationModelExport.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/PaginationModelExport.java new file mode 100644 index 0000000..c00796f --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/PaginationModelExport.java @@ -0,0 +1,27 @@ +package com.yunzhupaas.onlinedev.model; + + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @author 云筑产品开发平台组 + * @date 2024/3/16 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@Schema(description="导出参数") +public class PaginationModelExport extends PaginationModel { + @Schema(description = "导出selectKey") + private String[] selectKey; + @Schema(description = "导出选中数据") + private Object[] selectIds; + @Schema(description = "导出json") + private String json; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/PortalDefaultDTO.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/PortalDefaultDTO.java new file mode 100644 index 0000000..895730f --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/PortalDefaultDTO.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.onlinedev.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 类功能 + * + * @author 云筑产品开发平台组 + * @version v3.4.6 + * @copyrignt 深圳市乐程软件有限公司 + * @date 2023-03-24 + */ +@Data +public class PortalDefaultDTO { + + @Schema(description = "默认门户ID") + private String defaultPortalId; + + @Schema(description = "系统ID") + private String systemId; + + public PortalDefaultDTO(){ + + } + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/VisualErrInfo.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/VisualErrInfo.java new file mode 100644 index 0000000..2bb87c5 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/VisualErrInfo.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.onlinedev.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Builder; +import lombok.Data; + +@Data +@Builder +@Schema(description = "错误信息对象") +public class VisualErrInfo { + @Schema(description = "错误信息") + private String errMsg; + @Schema(description = "主键id") + private String id; + + @Schema(description = "流程任务id") + private String flowTaskId; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/VisualInfoParam.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/VisualInfoParam.java new file mode 100644 index 0000000..a341ca1 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/VisualInfoParam.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.onlinedev.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Schema(description = "详情接口传参") +@Data +public class VisualInfoParam { + @Schema(description = "数据值") + private Object id; + @Schema(description = "数据字段") + private String propsValue; + @Schema(description = "菜单id") + private String menuId; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/VisualParamModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/VisualParamModel.java new file mode 100644 index 0000000..3b22e94 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/VisualParamModel.java @@ -0,0 +1,38 @@ +package com.yunzhupaas.onlinedev.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.model.VisualDevJsonModel; +import lombok.Builder; +import lombok.Data; + +import java.util.List; +import java.util.Map; + +@Data +@Builder +@Schema(description = "在线方法接口变量") +public class VisualParamModel { + private String menuId; + private VisualDevJsonModel visualDevJsonModel; + private PaginationModel pagination; + private UserInfo userInfo; + + private VisualdevEntity visualdevEntity; + private Map data; + private List> dataList; + private String id; + @Schema(description = "是否外链") + @Builder.Default + private Boolean isLink = false; + + @Schema(description = "子表仅修改") + @Builder.Default + private Boolean isUpload = false; + + @Schema(description = "子表仅修改") + @Builder.Default + private Boolean onlyUpdate = false; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/VisualdevModelDataCrForm.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/VisualdevModelDataCrForm.java new file mode 100644 index 0000000..03c7674 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/VisualdevModelDataCrForm.java @@ -0,0 +1,38 @@ +package com.yunzhupaas.onlinedev.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; +import java.util.Map; + +/** + * + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @author 云筑产品开发平台组 + * @date 2024/3/16 + */ +@Data +@Schema(description="功能数据创建表单") +public class VisualdevModelDataCrForm { + @Schema(description = "判断新增") + private String id; + @Schema(description = "引擎主键") + private String flowId; + @Schema(description = "数据内容") + private String data; + @Schema(description = "状态") + private String status; + @Schema(description = "流程候选人列表") + private Map> candidateList; + @Schema(description = "流程紧急度") + private Integer flowUrgent = 1; + @Schema(description = "是否外链") + private Boolean isLink = false; + + @Schema(description = "菜单id") + private String menuId; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/VisualdevModelDataListVO.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/VisualdevModelDataListVO.java new file mode 100644 index 0000000..c7fcc41 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/VisualdevModelDataListVO.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.onlinedev.model; +import lombok.Data; + +import java.util.Map; + +/** + * + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @author 云筑产品开发平台组 + * @date 2024/3/16 + */ +@Data +public class VisualdevModelDataListVO { + + private Map data; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/VisualdevModelDataUpForm.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/VisualdevModelDataUpForm.java new file mode 100644 index 0000000..21c7731 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/VisualdevModelDataUpForm.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.onlinedev.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @author 云筑产品开发平台组 + * @date 2024/3/16 + */ +@Data +@Schema(description="功能数据修改表单") +public class VisualdevModelDataUpForm extends VisualdevModelDataCrForm { + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/fields/autosize/AutosizeModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/fields/autosize/AutosizeModel.java new file mode 100644 index 0000000..260b13a --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/fields/autosize/AutosizeModel.java @@ -0,0 +1,9 @@ +package com.yunzhupaas.onlinedev.model.fields.autosize; +import lombok.Data; + +@Data +public class AutosizeModel { + private Integer minRows; + private Integer maxRows; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/fields/options/ColumnOptionModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/fields/options/ColumnOptionModel.java new file mode 100644 index 0000000..d6801e8 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/fields/options/ColumnOptionModel.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.onlinedev.model.fields.options; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2021/6/29 + */ +@Data +public class ColumnOptionModel { + private String value; + private String label; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/fields/options/OptionsModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/fields/options/OptionsModel.java new file mode 100644 index 0000000..8e9ee8c --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/fields/options/OptionsModel.java @@ -0,0 +1,13 @@ +package com.yunzhupaas.onlinedev.model.fields.options; +import lombok.Data; + +import java.util.List; + +@Data +public class OptionsModel { + private Integer id; + private Integer value; + private String label; + private List children; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/fields/picker/PickerOptionsModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/fields/picker/PickerOptionsModel.java new file mode 100644 index 0000000..b5855f0 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/fields/picker/PickerOptionsModel.java @@ -0,0 +1,8 @@ +package com.yunzhupaas.onlinedev.model.fields.picker; +import lombok.Data; + +@Data +public class PickerOptionsModel { + private String selectableRange; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/fields/style/StyleModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/fields/style/StyleModel.java new file mode 100644 index 0000000..b0db3d5 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/fields/style/StyleModel.java @@ -0,0 +1,8 @@ +package com.yunzhupaas.onlinedev.model.fields.style; +import lombok.Data; + +@Data +public class StyleModel { + private String width; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/fields/style/textStyleModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/fields/style/textStyleModel.java new file mode 100644 index 0000000..9beff40 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/fields/style/textStyleModel.java @@ -0,0 +1,12 @@ +package com.yunzhupaas.onlinedev.model.fields.style; +import lombok.Data; + +@Data +public class textStyleModel { + private String color; + private String textalign; + private String fontweight; + private String fontstyle; + private String textdecoration; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/log/VisualLogForm.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/log/VisualLogForm.java new file mode 100644 index 0000000..809198f --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/log/VisualLogForm.java @@ -0,0 +1,40 @@ +package com.yunzhupaas.onlinedev.model.log; + +import com.yunzhupaas.base.model.VisualLogModel; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Builder; +import lombok.Data; + +import java.util.List; +import java.util.Map; + +/** + * 数据日志表单 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @date 2025/8/27 + */ +@Data +@Builder +@Schema(description = "数据日志表单") +public class VisualLogForm { + + @Schema(description = "模板id") + private String modelId; + + @Schema(description = "数据id") + private String dataId; + + @Schema(description = "日志类型:0-新建,1-编辑") + private Integer type; + + @Schema(description = "修改前数据") + private Map oldData; + + @Schema(description = "修改后数据") + private Map newData; + + @Schema(description = "日志列表(直接传入时使用)") + private List listLog; +} diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/log/VisualLogPage.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/log/VisualLogPage.java new file mode 100644 index 0000000..17024ab --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/log/VisualLogPage.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.onlinedev.model.log; + +import com.yunzhupaas.base.Pagination; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 数据日志分页查询模型 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @date 2024/8/27 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Schema(description = "数据日志分页查询") +public class VisualLogPage extends Pagination { + + @Schema(description = "模板id") + private String modelId; + + @Schema(description = "数据id") + private String dataId; +} diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/log/VisualLogVo.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/log/VisualLogVo.java new file mode 100644 index 0000000..f926a9e --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/log/VisualLogVo.java @@ -0,0 +1,43 @@ +package com.yunzhupaas.onlinedev.model.log; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 数据日志VO + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @date 2024/8/27 + */ +@Data +@Schema(description = "数据日志VO") +public class VisualLogVo { + + @Schema(description = "主键id") + private String id; + + @Schema(description = "模板id") + private String modelId; + + @Schema(description = "日志类型:0-新建,1-编辑") + private Integer type; + + @Schema(description = "数据id") + private String dataId; + + @Schema(description = "日志内容") + private String dataLog; + + @Schema(description = "创建人id") + private String creatorUserId; + + @Schema(description = "创建人名称") + private String creatorUserName; + + @Schema(description = "头像") + private String headIcon; + + @Schema(description = "创建时间") + private String creatorTime; +} diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/personalList/VisualPersConst.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/personalList/VisualPersConst.java new file mode 100644 index 0000000..6797ddd --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/personalList/VisualPersConst.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.onlinedev.model.personalList; + +/** + * 个性化视图静态参数 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/11/5 18:01:25 + */ +public class VisualPersConst { + + public final static String SYSTEM_ID = "systemId"; + + public final static String SYSTEM_NAME = "系统视图"; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/personalList/VisualPersPagiantion.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/personalList/VisualPersPagiantion.java new file mode 100644 index 0000000..3d13017 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/personalList/VisualPersPagiantion.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.onlinedev.model.personalList; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 个性化视图参数对象 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/11/6 10:08:30 + */ +@Data +@Schema(description = "个性化视图参数对象") +public class VisualPersPagiantion { + + @Schema(description = "菜单id") + private String menuId; + + @Schema(description = "功能id") + private String modelId; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/personalList/VisualPersonalForm.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/personalList/VisualPersonalForm.java new file mode 100644 index 0000000..8a6e9d9 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/personalList/VisualPersonalForm.java @@ -0,0 +1,33 @@ +package com.yunzhupaas.onlinedev.model.personalList; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 个性列表表单 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/11/5 18:01:45 + */ +@Data +@Schema(description = "个性化列表表单") +public class VisualPersonalForm { + @Schema(description = "列表视图") + private String id; + @Schema(description = "菜单id") + private String menuId; + @Schema(description = "列表视图") + private String fullName; + @Schema(description = "视图状态:0-其他,1-默认") + private Integer status; + @Schema(description = "视图状态:0-系统,1-其他") + private Integer type; + + @Schema(description = "查询字段") + private String searchList; + @Schema(description = "列表字段") + private String columnList; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/personalList/VisualPersonalInfo.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/personalList/VisualPersonalInfo.java new file mode 100644 index 0000000..e210bfe --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/personalList/VisualPersonalInfo.java @@ -0,0 +1,34 @@ +package com.yunzhupaas.onlinedev.model.personalList; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 个性列表设置详情 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/11/5 18:01:45 + */ +@Data +@Schema(description = "列表视图详情") +public class VisualPersonalInfo { + @Schema(description = "列表视图") + private String id; + @Schema(description = "菜单id") + private String menuId; + @Schema(description = "列表视图") + private String fullName; + @Schema(description = "视图状态:0-其他,1-默认") + private Integer status; + @Schema(description = "视图状态:0-系统,1-其他") + private Integer type; + + @Schema(description = "查询字段") + private String searchList; + @Schema(description = "列表字段") + private String columnList; + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/personalList/VisualPersonalJson.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/personalList/VisualPersonalJson.java new file mode 100644 index 0000000..e0ff56b --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/personalList/VisualPersonalJson.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.onlinedev.model.personalList; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 个性化设置json属性 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/11/5 18:02:11 + */ +@Data +@Schema(description = "个性化设置json属性") +public class VisualPersonalJson { + @Schema(description = "字段名称") + private String label; + @Schema(description = "字段key") + private String key; + @Schema(description = "是否展示") + private boolean show; + @Schema(description = "对齐方式") + private String fixed; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/personalList/VisualPersonalVo.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/personalList/VisualPersonalVo.java new file mode 100644 index 0000000..5098c75 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/personalList/VisualPersonalVo.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.onlinedev.model.personalList; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 个性化视图列表对象 + * + * @author 云筑产品开发平台组 + * @version v5.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/11/5 18:02:33 + */ +@Data +@Schema(description = "个性化视图列表对象") +public class VisualPersonalVo { + @Schema(description = "数据id") + private String id; + @Schema(description = "视图名称") + private String fullName; + @Schema(description = "视图状态:0-其他,1-默认") + private Integer status; + @Schema(description = "视图类型:0-系统,1-其他") + private Integer type; + + @Schema(description = "查询字段") + private String searchList; + @Schema(description = "列表字段") + private String columnList; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/visualdevmodelApp/AppDataInfoVO.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/visualdevmodelApp/AppDataInfoVO.java new file mode 100644 index 0000000..e6cdbe0 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-onlinedev/yunzhupaas-visualdev-onlinedev-entity/src/main/java/com/yunzhupaas/onlinedev/model/visualdevmodelApp/AppDataInfoVO.java @@ -0,0 +1,15 @@ +package com.yunzhupaas.onlinedev.model.visualdevmodelApp; +import lombok.Data; + +@Data +public class AppDataInfoVO { + private String formData; + private String columnData; + private String tables; + private String webType; + private String flowTemplateJson; + private String flowEnCode; + private String flowId; + private String fullName; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/pom.xml b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/pom.xml new file mode 100644 index 0000000..67c4a42 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/pom.xml @@ -0,0 +1,21 @@ + + + + yunzhupaas-visualdev + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-visualdev-portal + pom + + yunzhupaas-visualdev-portal-entity + yunzhupaas-visualdev-portal-biz + yunzhupaas-visualdev-portal-controller + + + + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-biz/pom.xml b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-biz/pom.xml new file mode 100644 index 0000000..a77624d --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-biz/pom.xml @@ -0,0 +1,37 @@ + + + + yunzhupaas-visualdev-portal + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-visualdev-portal-biz + + + + com.yunzhupaas + yunzhupaas-visualdev-portal-entity + ${project.version} + + + com.yunzhupaas + yunzhupaas-system-biz + ${project.version} + + + com.yunzhupaas + yunzhupaas-permission-biz + ${project.version} + + + com.yunzhupaas + yunzhupaas-visualdev-base-entity + ${project.version} + + + + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-biz/src/main/java/com/yunzhupaas/portal/mapper/PortalDataMapper.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-biz/src/main/java/com/yunzhupaas/portal/mapper/PortalDataMapper.java new file mode 100644 index 0000000..a5d9b83 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-biz/src/main/java/com/yunzhupaas/portal/mapper/PortalDataMapper.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.portal.mapper; + + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.portal.entity.PortalDataEntity; + +/** + *

+ * Mapper 接口 + *

+ * + * @author + * @since 2023-04-19 + */ +public interface PortalDataMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-biz/src/main/java/com/yunzhupaas/portal/mapper/PortalMapper.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-biz/src/main/java/com/yunzhupaas/portal/mapper/PortalMapper.java new file mode 100644 index 0000000..f053b69 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-biz/src/main/java/com/yunzhupaas/portal/mapper/PortalMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.portal.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.portal.entity.PortalEntity; + +/** + * + * base_portal + * 版本: V3.0.0 + * 版权: 深圳市乐程软件有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ +public interface PortalMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-biz/src/main/java/com/yunzhupaas/portal/service/PortalDataService.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-biz/src/main/java/com/yunzhupaas/portal/service/PortalDataService.java new file mode 100644 index 0000000..3af646e --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-biz/src/main/java/com/yunzhupaas/portal/service/PortalDataService.java @@ -0,0 +1,71 @@ +package com.yunzhupaas.portal.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.portal.entity.PortalDataEntity; +import com.yunzhupaas.portal.model.*; + +import java.util.List; + +/** + * 门户数据接口 + * + * 后期门户模板数据,将会以platform再做区分, + * 故将formData抽离成单独的表 + * @author + * @since 2023-04-19 + */ +public interface PortalDataService extends SuperService { + + String getCustomDataForm(PortalCustomPrimary primary) throws Exception; + + String getModelDataForm(PortalModPrimary primary) throws Exception; + + /** + * 发布 + */ + void release(String platform, String portalId, List systemIdList,String releasePlatform,PortalReleaseForm form) throws Exception; + + void releaseModule(ReleaseModel releaseModel,String portalId) throws Exception; + + Boolean isReleaseFlag(PortalReleasePrimary primary); + + Boolean deleteAll(String portalId); + + /** + * 创建或更新门户自定义信息 + */ + void createOrUpdate(PortalCustomPrimary primary, String formData) throws Exception; + + /** + * 创建或更新门户模板信息 + */ + void createOrUpdate(PortalModPrimary primary, String formData) throws Exception; + + /** + * 创建或更新门户发布信息 + */ + void createOrUpdate(PortalReleasePrimary primary, String formData) throws Exception; + + /** + * 获取门户显示信息 + * + * @param portalId 门户ID + * @param platform 平台:app/pc + */ + PortalInfoAuthVO getDataFormView(String portalId, String platform) throws Exception; + + /** + * 设置默认门户 + */ + void setCurrentDefault(String platform, String portalId); + + String getCurrentDefault(String platform) throws Exception; + + /** + * 获取当前带权限的portalIds + */ + List getCurrentAuthPortalIds(PortalViewPrimary primary); + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-biz/src/main/java/com/yunzhupaas/portal/service/PortalService.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-biz/src/main/java/com/yunzhupaas/portal/service/PortalService.java new file mode 100644 index 0000000..2970616 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-biz/src/main/java/com/yunzhupaas/portal/service/PortalService.java @@ -0,0 +1,84 @@ +package com.yunzhupaas.portal.service; + +import com.yunzhupaas.base.model.VisualFunctionModel; +import com.yunzhupaas.base.model.base.SystemListVO; +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.portal.entity.PortalEntity; +import com.yunzhupaas.portal.model.PortalPagination; +import com.yunzhupaas.portal.model.PortalSelectModel; +import com.yunzhupaas.portal.model.PortalSelectVO; +import com.yunzhupaas.portal.model.PortalViewPrimary; + +import java.util.List; + + +/** + * base_portal + * 版本: V3.0.0 + * 版权: 深圳市乐程软件有限公司 + * 作者: 管理员/admin + * 日期: 2020-10-21 14:23:30 + */ + +public interface PortalService extends SuperService { + + PortalEntity getInfo(String id); + + /** + * 是否重名 + */ + Boolean isExistByFullName(String fullName, String id); + + /** + * 是否重码 + */ + Boolean isExistByEnCode(String encode, String id); + + void create(PortalEntity entity); + + Boolean update(String id, PortalEntity entity); + + void delete(PortalEntity entity) throws Exception; + + List getList(PortalPagination pagination); + + String getModListFirstId(PortalViewPrimary primary); + + List getModList(PortalViewPrimary primary); + + List getModSelectList(); + + /** + * 获取门户模型集合 + * + * @param pagination 分页信息 + * @return 模型集合 + */ + List getModelList(PortalPagination pagination); + + + /** + * 获取门户管理下拉 + * + * @param pagination 分页信息 + * @param systemId 系统ID + * @return 分页结婚 + */ + List getManageSelectorPage(PortalPagination pagination, String systemId); + + /** + * 获取可选系统列表 + * @param id + * @return + */ + List systemFilterList(String id,String category); + + /** + * 获取发布信息 + * @param id + * @return + */ + VisualFunctionModel getReleaseInfo(String id); + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-biz/src/main/java/com/yunzhupaas/portal/service/impl/PortalDataServiceImpl.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-biz/src/main/java/com/yunzhupaas/portal/service/impl/PortalDataServiceImpl.java new file mode 100644 index 0000000..81de1b2 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-biz/src/main/java/com/yunzhupaas/portal/service/impl/PortalDataServiceImpl.java @@ -0,0 +1,398 @@ +package com.yunzhupaas.portal.service.impl; + +import cn.hutool.core.collection.CollectionUtil; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.MyBatisPrimaryBase; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.PortalManageEntity; +import com.yunzhupaas.base.entity.SystemEntity; +import com.yunzhupaas.base.model.online.VisualMenuModel; +import com.yunzhupaas.base.model.portalManage.PortalManagePrimary; +import com.yunzhupaas.base.model.portalManage.PortalManageVO; +import com.yunzhupaas.base.service.ModuleService; +import com.yunzhupaas.base.service.PortalManageService; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.base.service.SystemService; +import com.yunzhupaas.base.util.visualUtil.PubulishUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.permission.entity.AuthorizeEntity; +import com.yunzhupaas.permission.entity.PermissionGroupEntity; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.AuthorizeService; +import com.yunzhupaas.permission.service.PermissionGroupService; +import com.yunzhupaas.permission.service.RoleService; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.portal.constant.PortalConst; +import com.yunzhupaas.portal.entity.PortalDataEntity; +import com.yunzhupaas.portal.entity.PortalEntity; +import com.yunzhupaas.portal.mapper.PortalDataMapper; +import com.yunzhupaas.portal.model.*; +import com.yunzhupaas.portal.service.PortalDataService; +import com.yunzhupaas.portal.service.PortalService; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.JsonUtilEx; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.function.Supplier; +import java.util.stream.Collectors; + +/** + *

+ * 服务实现类 + *

+ * + * @author + * @since 2023-04-19 + */ +@Service +public class PortalDataServiceImpl extends SuperServiceImpl implements PortalDataService { + + @Autowired + private UserService userService; + + @Autowired + private PortalService portalService; + @Autowired + private RoleService roleService; + @Autowired + private AuthorizeService authorizeService; + @Autowired + private PortalManageService portalManageApi; + @Autowired + private PermissionGroupService permissionGroupApi; + @Autowired + private ModuleService moduleService; + @Autowired + private PubulishUtil pubulishUtil; + @Autowired + private SystemService systemService; + + @Override + public String getCustomDataForm(PortalCustomPrimary primary) throws Exception { + PortalDataEntity one = getOne(primary.getQuery()); + if(one != null){ + return one.getFormData(); + }else { + save(primary.getEntity()); + } + return ""; + } + + @Override + public String getModelDataForm(PortalModPrimary primary) throws Exception { + PortalDataEntity one = getOne(primary.getQuery()); + if(one != null){ + return one.getFormData(); + }else { + save(primary.getEntity()); + } + return ""; + } + + @Override + public void release(String platform, String portalId, List systemIdList,String releasePlatform,PortalReleaseForm form) throws Exception { + if(CollectionUtils.isNotEmpty(systemIdList)){ + // 系统管理对应添加绑定 + portalManageApi.createBatch(systemIdList.stream().map(systemId-> + new PortalManagePrimary(releasePlatform, portalId, systemId)).collect(Collectors.toList())); + }else { + List voList = portalManageApi.getList(new PortalManagePrimary(platform, portalId, null)); + List list = systemService.getList().stream().map(SystemEntity::getId).collect(Collectors.toList()); + boolean hasSys = false;//剩下的门户对象-应用都被删除。 + for (PortalManageVO item : voList) { + if(list.contains(item.getSystemId())){ + hasSys = true; + } + } + if (voList.size() == 0 || !hasSys) { + throw new WorkFlowException(MsgCode.VS413.get()); + } + systemIdList = voList.stream().map(PortalManageVO::getSystemId).collect(Collectors.toList()); + } + String formData = ""; + try { + formData = getModelDataForm(new PortalModPrimary(portalId)); + createOrUpdate(new PortalReleasePrimary(portalId, platform), formData); + } catch (Exception e) { + e.printStackTrace(); + } + // 查询所有相关的自定义数据 + for (String systemId : systemIdList) { + List list = list(new PortalCustomPrimary(platform, portalId, systemId, null).getQuery()); + final String finalFormData = formData; + if(list.size() > 0){ + // 把所有数据进行重置formData + list.forEach(entity -> entity.setFormData(finalFormData)); + updateBatchById(list); + } + } + PortalEntity info = portalService.getInfo(portalId); + if(info!=null){ + info.setState(1); + info.setEnabledMark(1); + info.setPlatformRelease(form.getPlatformRelease()); + portalService.update(portalId,info); + } + } + + @Override + public void releaseModule(ReleaseModel releaseModel,String portalId) throws Exception { + PortalEntity info = portalService.getInfo(portalId); + if(info!=null) { + VisualMenuModel visual = new VisualMenuModel(); + visual.setApp(releaseModel.getApp()); + visual.setPc(releaseModel.getPc()); + visual.setPcModuleParentId(releaseModel.getPcModuleParentId()); + visual.setAppModuleParentId(releaseModel.getAppModuleParentId()); +// visual.setAppModuleParentId(releaseModel.getAppModuleParentId()); +// if (StringUtil.isNotEmpty(releaseModel.getPcModuleParentId()) && StringUtil.isEmpty(releaseModel.getPcSystemId())) { +// visual.setPcModuleParentId("-1"); +// } else { +// visual.setPcModuleParentId(releaseModel.getPcModuleParentId()); +// } + if (releaseModel.getPc() == 1) { + createOrUpdate(new PortalReleasePrimary(portalId, PortalConst.WEB), getModelDataForm(new PortalModPrimary(portalId))); + } + if (releaseModel.getApp() == 1) { + createOrUpdate(new PortalReleasePrimary(portalId, PortalConst.APP), getModelDataForm(new PortalModPrimary(portalId))); + } +// visual.setPcSystemId(Optional.ofNullable(releaseModel.getPcSystemId()).orElse(releaseModel.getPcModuleParentId())); +// visual.setAppSystemId(Optional.ofNullable(releaseModel.getAppSystemId()).orElse(releaseModel.getAppModuleParentId())); + visual.setType(8); + visual.setFullName(info.getFullName()); + visual.setEncode(info.getEnCode()); + visual.setId(info.getId()); + pubulishUtil.publishMenu(visual); + info.setState(1); + info.setEnabledMark(1); + portalService.update(portalId,info); + } + } + + @Override + public Boolean isReleaseFlag(PortalReleasePrimary primary) { + return count(primary.getQuery()) > 0; + } + + @Override + public Boolean deleteAll(String portalId) { + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(PortalDataEntity::getPortalId, portalId); + return remove(query); + } + + /** + * 创建或更新 + * + * 门户ID ->(平台、系统ID、用户ID)-> 排版信息 + * 基础:门户ID绑定排版信息(一对多)、 条件:平台、系统ID、用户ID + */ + @Override + public void createOrUpdate(PortalCustomPrimary primary, String formData) throws Exception { + creUpCom(primary, formData); + } + + @Override + public void createOrUpdate(PortalModPrimary primary, String formData) throws Exception { + creUpCom(primary, formData); + } + + @Override + public void createOrUpdate(PortalReleasePrimary primary, String formData) throws Exception { + creUpCom(primary, formData); + } + + private void creUpCom(MyBatisPrimaryBase primary, String formData) throws Exception { + // 自定义数据变量条件:0、门户 1、用户 2、系统 3、平台 + List list = list(primary.getQuery()); + if(list.size() < 1){ + PortalDataEntity creEntity = primary.getEntity(); + creEntity.setFormData(formData); + save(creEntity); + }else if(list.size() == 1){ + PortalDataEntity upEntity = list.get(0); + upEntity.setFormData(formData); + updateById(upEntity); + }else { + throw new Exception(MsgCode.VS414.get()); + } + } + + /** + * 根据id返回门户信息 + */ + @Override + public PortalInfoAuthVO getDataFormView(String portalId, String platform) throws Exception{ + PortalEntity entity = portalService.getInfo(portalId); + if (entity == null) throw new Exception(MsgCode.VS415.get()); +// if (entity.getEnabledMark() == 0) throw new Exception("门户被禁止"); + PortalInfoAuthVO infoVo = JsonUtil.getJsonToBean(JsonUtilEx.getObjectToStringDateFormat + (entity, "yyyy-MM-dd HH:mm:ss"), PortalInfoAuthVO.class); + // 查询自定义设计的门户信息 + infoVo.setFormData(getDataForm(platform, portalId)); + return infoVo; + } + + private String getDataForm(String platform, String portalId) throws Exception { + List dataList = list(new PortalCustomPrimary(platform, portalId).getQuery()); + if(CollectionUtil.isEmpty(dataList)) { + dataList = list(new PortalReleasePrimary(portalId, platform).getQuery()); + } + // 当没有自定义的排版信息时,使用已发布模板排版信息 + if(CollectionUtil.isNotEmpty(dataList)){ + PortalDataEntity entity = dataList.get(0); + if (dataList.size() != 1) { + List ids = dataList.stream().map(PortalDataEntity::getId).collect(Collectors.toList()); + removeBatchByIds(ids.stream().filter(id -> !id.equals(entity.getId())).collect(Collectors.toList())); + } + return entity.getFormData(); + } + return null; + } + + /** + * 设置门户默认主页 + * + * 用户ID -> (平台、系统ID) -> 门户ID + * 基础:用户ID绑定门户ID(多对多)、条件:平台、系统ID + * Map格式:Map + * @param portalId 门户ID + * @param platform 平台 + */ + @Override + public void setCurrentDefault(String platform, String portalId) { + UserEntity userEntity = userService.getInfo(UserProvider.getUser().getUserId()); + Map map = new HashMap<>(); + try{ + map = JSONObject.parseObject(userEntity.getPortalId()).getInnerMap(); + }catch (Exception ignore){} + if ("App".equals(platform)) { + map.put(platform + ":" + userEntity.getAppSystemId(), portalId); + } else { + map.put(platform + ":" + userEntity.getSystemId(), portalId); + } + UserEntity update = new UserEntity(); + update.setId(userEntity.getId()); + update.setPortalId(JSONObject.toJSONString(map)); + userService.updateById(update); + } + + @Override + public String getCurrentDefault(String platform) throws Exception { + UserEntity userEntity = userService.getInfo(UserProvider.getUser().getUserId()); + String systemId = PortalConst.WEB.equals(platform) ? UserProvider.getUser().getSystemId() : UserProvider.getUser().getAppSystemId(); + String portalId = ""; + try{ + Map map = JSONObject.parseObject(userEntity.getPortalId()).getInnerMap(); + portalId = map.get(platform + ":" + systemId).toString(); + }catch (Exception ignore){} + PortalEntity mainPortal = portalService.getById(portalId); + // 校验门户有效性 + if(mainPortal != null && mainPortal.getEnabledMark().equals(1)){ + // 管理员直接设置默认主页 + List authPortalIds; + if(UserProvider.getUser().getIsAdministrator()){ + List currentVoList = portalManageApi.getListByEnable(new PortalManagePrimary(platform, null, systemId)); + authPortalIds = currentVoList.stream().map(PortalManageVO::getPortalId).collect(Collectors.toList()); + }else { + // 获取当前用户的所有权限的门户ID集合 + authPortalIds = getCurrentAuthPortalIds(new PortalViewPrimary(platform, null)); + } + if(CollectionUtil.isNotEmpty(authPortalIds) && authPortalIds.contains(portalId)) { + return portalId; + } + } + // 重新设置默认门户 + String updatePortalId = portalService.getModListFirstId(new PortalViewPrimary(platform, null)); + setCurrentDefault(platform, updatePortalId); + return updatePortalId; + } + + /** + * 获取当下所有带权限PortalId集合 + */ + public List getCurrentAuthPortalIds(PortalViewPrimary primary){ + UserInfo userInfo = UserProvider.getUser(); + String systemId = primary.getSystemId(); + + // 获取用户底下所有权限portalManage + Supplier> authPortalManageIds = ()->{ + List roleIds = permissionGroupApi.getPermissionGroupByUserId(userInfo.getUserId(), userInfo.getOrganizeId(), false, null).stream().map(PermissionGroupEntity::getId).collect(Collectors.toList()); + List portalManageIds = new ArrayList<>(); + for (String roleId : roleIds) { + /* authorize存储 portalManage->item、role->object,本质:门户管理条目与角色关系 + 根据用户Id查询出对应所有的门户管理条目(distinct()进行去重) */ + List authorizePortalManage = authorizeService.getListByObjectId(roleId, PortalConst.AUTHORIZE_PORTAL_MANAGE); + portalManageIds.addAll(authorizePortalManage.stream() + .map(AuthorizeEntity::getItemId).distinct().collect(Collectors.toList())); + } + return portalManageIds; + }; + + List portalManageIds = authPortalManageIds.get(); + + Map> map = new HashMap<>(); + // 获取具有权限的所有门户 + if(portalManageIds.size() > 0) { + QueryWrapper query = new QueryWrapper<>(); + query.lambda().eq(PortalManageEntity::getEnabledMark, 1) + .eq(PortalManageEntity::getPlatform, primary.getPlatForm()) + .in(PortalManageEntity::getId, portalManageIds); + List portalManageList = portalManageApi.list(query); + Map> collect = portalManageList.stream().collect(Collectors.groupingBy(PortalManageEntity::getSystemId)); + // key:systemId 、 value:portalIdList + collect.forEach((key, description) -> map.put(key, description.stream().map(PortalManageEntity::getPortalId).collect(Collectors.toList()))); + return map.get(systemId); + }else { + return new ArrayList<>(); + } + } + + /* ============== 目前使用懒加载更新主页,故注释 =============== */ +// /** +// * 校验:当前用户的默认门户首页是否还具备权限 +// * (当权限被删除,默认首页丢失) +// */ +// private void checkDefaultPortal(List originRoleIds, List updateRoleIds, String portalManageId){ +// // 若是新增角色不会对默认门户产生影响 +// List delRoleIds = originRoleIds.stream().filter(o -> !updateRoleIds.contains(o)) +// .collect(Collectors.toList()); +// if(CollectionUtil.isNotEmpty(delRoleIds)){ +// // 授权取消所涉及到用户集合 +// List userList = userService.getListByRoleIds(delRoleIds); +// for (UserEntity userEntity : userList) { +// String userId = userEntity.getId(); +// // 获取各系统下带权限的门户ID(这里跨服务会产生数据不同步的问题) +// Map> authorizeSysPortalIdsMap = getAuthorizePortalIds(userId); +// // 获取原始各系统下默认门户ID +// Map sysDefaultPortalIdMap = portalManageService.getDefault(userEntity.getId()); +// for (Map.Entry defaultMap : sysDefaultPortalIdMap.entrySet()) { +// String systemId = defaultMap.getKey(); +// // 默认门户ID +// String defaultPortalId = defaultMap.getValue(); +// // 带权限门户ID +// List authorizePortalIds = authorizeSysPortalIdsMap.get(systemId); +// if(CollectionUtil.isNotEmpty(authorizePortalIds)){ +// if(!authorizePortalIds.contains(defaultPortalId)){ +// // 丢失默认门户,顺位首个 +// portalManageService.setDefault(userId, systemId, authorizePortalIds.get(0)); +// } +// } +// } +// } +// } +// } + + + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-biz/src/main/java/com/yunzhupaas/portal/service/impl/PortalServiceImpl.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-biz/src/main/java/com/yunzhupaas/portal/service/impl/PortalServiceImpl.java new file mode 100644 index 0000000..9f3ada4 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-biz/src/main/java/com/yunzhupaas/portal/service/impl/PortalServiceImpl.java @@ -0,0 +1,398 @@ +package com.yunzhupaas.portal.service.impl; + + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.entity.ModuleEntity; +import com.yunzhupaas.base.entity.PortalManageEntity; +import com.yunzhupaas.base.entity.SystemEntity; +import com.yunzhupaas.base.model.VisualFunctionModel; +import com.yunzhupaas.base.model.base.SystemListVO; +import com.yunzhupaas.base.model.base.SystemPageVO; +import com.yunzhupaas.base.model.module.ModuleNameVO; +import com.yunzhupaas.base.model.portalManage.PortalManagePage; +import com.yunzhupaas.base.model.portalManage.PortalManagePageDO; +import com.yunzhupaas.base.model.portalManage.PortalManagePrimary; +import com.yunzhupaas.base.model.portalManage.PortalManageVO; +import com.yunzhupaas.base.service.*; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.portal.constant.PortalConst; +import com.yunzhupaas.portal.entity.PortalEntity; +import com.yunzhupaas.portal.mapper.PortalMapper; +import com.yunzhupaas.portal.model.*; +import com.yunzhupaas.portal.service.PortalDataService; +import com.yunzhupaas.portal.service.PortalService; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.enums.DictionaryDataEnum; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024/3/16 + */ +@Service +public class PortalServiceImpl extends SuperServiceImpl implements PortalService { + + @Autowired + private PortalService portalService; + @Autowired + private PortalManageService portalManageService; + + @Autowired + private UserService userService; + @Autowired + private DictionaryDataService dictionaryDataService; + @Autowired + private DictionaryTypeService dictionaryTypeService; + @Autowired + private PortalDataService portalDataService; + @Autowired + private SystemService systemApi; + @Autowired + private ModuleService moduleApi; + + @Override + public List getList(PortalPagination portalPagination) { + return getList(portalPagination, new QueryWrapper<>()); + } + + public List getList(PortalPagination portalPagination, QueryWrapper queryWrapper) { + // 定义变量判断是否需要使用修改时间倒序 + boolean flag = false; + // 模糊查询 + if (!StringUtil.isEmpty(portalPagination.getKeyword())) { + flag = true; + queryWrapper.lambda().and(q-> q.like(PortalEntity::getFullName, portalPagination.getKeyword()).or() + .like(PortalEntity::getEnCode, portalPagination.getKeyword())); + } + // 分类(数据字典) + if (StringUtil.isNotEmpty(portalPagination.getCategory())) { + flag = true; + queryWrapper.lambda().eq(PortalEntity::getCategory, portalPagination.getCategory()); + } + // 类型(0-页面设计,1-自定义路径) + if (portalPagination.getType() != null) { + flag = true; + queryWrapper.lambda().eq(PortalEntity::getType, portalPagination.getType()); + } + // 锁定 + if (portalPagination.getEnabledLock() != null) { + flag = true; + queryWrapper.lambda().eq(PortalEntity::getEnabledLock, portalPagination.getEnabledLock()); + } + // 发布状态 + if (portalPagination.getIsRelease() != null) { + flag = true; + queryWrapper.lambda().eq(PortalEntity::getState, portalPagination.getIsRelease()); + } + // 排序 + queryWrapper.lambda().orderByAsc(PortalEntity::getSortCode).orderByDesc(PortalEntity::getCreatorTime); + if (flag) { + queryWrapper.lambda().orderByDesc(PortalEntity::getLastModifyTime); + } + // 分页 + Page page = new Page<>(portalPagination.getCurrentPage(), portalPagination.getPageSize()); + IPage userPage = this.page(page, queryWrapper); + return portalPagination.setData(userPage.getRecords(), page.getTotal()); + } + + @Override + public PortalEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(PortalEntity::getId, id); + return this.getOne(queryWrapper); + } + + + @Override + public Boolean isExistByFullName(String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(PortalEntity::getFullName, fullName); + return isExistCommon(queryWrapper, id); + } + + @Override + public Boolean isExistByEnCode(String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(PortalEntity::getEnCode, enCode); + return isExistCommon(queryWrapper, id); + } + + private Boolean isExistCommon(QueryWrapper queryWrapper, String id){ + if (!StringUtil.isEmpty(id)) queryWrapper.lambda().ne(PortalEntity::getId, id); + return this.count(queryWrapper) > 0; + } + + @Override + public void create(PortalEntity entity) { + if (StringUtil.isEmpty(entity.getId())) { + entity.setId(RandomUtil.uuId()); + } + entity.setState(0); + entity.setEnabledMark(0); + this.setIgnoreLogicDelete().saveOrUpdate(entity); + this.clearIgnoreLogicDelete(); + } + + @Override + public Boolean update(String id, PortalEntity entity) { + entity.setId(id); + entity.setLastModifyTime(DateUtil.getNowDate()); + return this.updateById(entity); + } + + @Override + public void delete(PortalEntity entity) throws Exception{ + // 0、门户管理判断(已绑定系统不允许删除) + List portalManageList = portalManageService.getList(new PortalManagePrimary(null, entity.getId(), null)); + if (portalManageList.size() > 0) { + List sysNameList = portalManageList.stream().map(manage -> { + try{ + return systemApi.getInfo(manage.getSystemId()).getFullName(); + }catch (Exception ignore){ return ""; } + }).collect(Collectors.toList()); + String sysName = sysNameList.get(0); + StringBuffer buffer = new StringBuffer(); + buffer.append("此记录被\"【"+sysName+"】应用门户\"关联引用,不允许被删除"); + throw new Exception(buffer.toString()); + } + // 1、删除门户设置数据(数据删除可提示用户确认) + portalDataService.deleteAll(entity.getId()); + portalService.removeById(entity.getId()); + } + + @Override + public List getManageSelectorPage(PortalPagination pagination, String systemId) { + // 根据系统ID、平台获取 + List manageVOList = portalManageService.getList(new PortalManagePrimary(pagination.getPlatform(), null, systemId)); + Set usedPortalIds = manageVOList.stream().map(PortalManageVO::getPortalId).collect(Collectors.toSet()); + QueryWrapper query = new QueryWrapper<>(); + // 已绑定的门户,不再出现在下拉列表 + if(usedPortalIds.size() > 0) query.lambda().notIn(PortalEntity::getId, usedPortalIds); + query.lambda().eq(PortalEntity::getEnabledMark, 1); + List portalList = getList(pagination, query); + List voList = new ArrayList<>(); + portalList.forEach(entity->{ + PortalSelectVO vo = new PortalSelectVO(); + vo.setId(entity.getId()); + vo.setFullName(entity.getFullName()); + vo.setEnCode(entity.getEnCode()); + DictionaryDataEntity dicEntity = dictionaryDataService.getInfo(entity.getCategory()); + if(dicEntity!=null) { + vo.setCategory(dicEntity.getFullName()); + vo.setCategoryName(dicEntity.getFullName()); + vo.setCategoryId(dicEntity.getId()); + } + voList.add(vo); + }); + return voList; + } + + @Override + public String getModListFirstId(PortalViewPrimary primary){ + try{ + List modList = getModList(primary); + PortalSelectModel first = modList.stream().filter(mod -> mod.getParentId().equals("0")).findFirst().get(); + PortalSelectModel firstPortal = modList.stream().filter(mod -> mod.getParentId().equals(first.getId())).findFirst().get(); + return firstPortal.getId(); + }catch (Exception e){ + return ""; + } + } + + @Override + public List getModList(PortalViewPrimary primary) { + UserInfo userInfo = UserProvider.getUser(); + List portalIds; + if(userInfo.getIsAdministrator()){ + portalIds = portalManageService.getListByEnable(new PortalManagePrimary(primary.getPlatForm(), null, primary.getSystemId())) + .stream().map(PortalManageVO::getPortalId).collect(Collectors.toList()); + }else { + portalIds = portalDataService.getCurrentAuthPortalIds(primary); + } + PortalManagePage page =new PortalManagePage(); + page.setEnabledMark(1); + page.setPlatform(primary.getPlatForm()); + page.setSystemId(primary.getSystemId()); + page.setState(0); + List selectList = portalManageService.getSelectList(page); + List resultList = new ArrayList<>(); + for (PortalManagePageDO portalManagePageDO : selectList) { + if(portalIds.contains(portalManagePageDO.getPortalId())){ + PortalEntity entity = new PortalEntity(); + entity.setId(portalManagePageDO.getPortalId()); + entity.setFullName(portalManagePageDO.getPortalName()); + entity.setCategory(portalManagePageDO.getCategoryId()); + resultList.add(entity); + } + } + if(CollectionUtil.isNotEmpty(portalIds)){ + return getModelList(resultList.stream().distinct().collect(Collectors.toList())); + }else { + return new ArrayList<>(); + } + } + + @Override + public List getModSelectList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(PortalEntity::getEnabledMark,1); + List list = this.list(queryWrapper); + return getModelList(list); + } + + private List getModelList(List portalList){ + List modelList = JsonUtil.getJsonToList(portalList, PortalSelectModel.class); + // 外层菜单排序取数据字典 + List dictionaryList = dictionaryDataService.getListByTypeDataCode(DictionaryDataEnum.VISUALDEV_PORTAL.getDictionaryTypeId()); + for (DictionaryDataEntity dictionary : dictionaryList) { + List models = modelList.stream().filter(model->model.getParentId().equals(dictionary.getId())).collect(Collectors.toList()); + if(models.size() > 0){ + PortalSelectModel model = new PortalSelectModel(); + model.setId(dictionary.getId()); + model.setFullName(dictionary.getFullName()); + model.setParentId("0"); + if (!modelList.contains(model)) { + modelList.add(model); + } + } + } + return modelList; + } + + @Override + public List getModelList(PortalPagination pagination) { + List data = portalService.getList(pagination); + List userId = data.stream().map(t -> t.getCreatorUserId()).collect(Collectors.toList()); + List lastUserId = data.stream().map(t -> t.getLastModifyUserId()).collect(Collectors.toList()); + List userEntities = userService.getUserName(userId); + List lastUserIdEntities = userService.getUserName(lastUserId); + List dictionList = dictionaryDataService.getListByTypeDataCode(DictionaryDataEnum.VISUALDEV_PORTAL.getDictionaryTypeId()); + List modelAll = new LinkedList<>(); + // 发布判断 + + for (PortalEntity entity : data) { + VisualFunctionModel model = JsonUtil.getJsonToBean(entity, VisualFunctionModel.class); + + DictionaryDataEntity dataEntity = dictionList.stream().filter(t -> t.getId().equals(entity.getCategory())).findFirst().orElse(null); + if (dataEntity != null) { + model.setCategory(dataEntity.getFullName()); + UserEntity creatorUser = userEntities.stream().filter(t -> t.getId().equals(model.getCreatorUserId())).findFirst().orElse(null); + if (creatorUser != null) { + model.setCreatorUser(creatorUser.getRealName() + "/" + creatorUser.getAccount()); + } else { + model.setCreatorUser(""); + } + UserEntity lastmodifyuser = lastUserIdEntities.stream().filter(t -> t.getId().equals(model.getLastModifyUserId())).findFirst().orElse(null); + if (lastmodifyuser != null) { + model.setLastModifyUser(lastmodifyuser.getRealName() + "/" + lastmodifyuser.getAccount()); + } else { + model.setLastModifyUser(""); + } + if (Objects.isNull(model.getSortCode())) { + model.setSortCode(0L); + } + model.setIsRelease(entity.getState()); + modelAll.add(model); + } + } + return modelAll.stream().sorted(Comparator.comparing(VisualFunctionModel::getSortCode)).collect(Collectors.toList()); + } + + /** + * 获取发布信息 + * @param id + * @return + */ + public VisualFunctionModel getReleaseInfo(String id) { + VisualFunctionModel model =new VisualFunctionModel(); + model.setPcIsRelease(0); + model.setAppIsRelease(0); + model.setPcPortalIsRelease(0); + model.setAppPortalIsRelease(0); + List sysList = systemApi.getList(); + List isReleaseList = portalManageService.list(); + ModuleNameVO moduleNameVO = moduleApi.getModuleNameList(id); + + if(CollectionUtils.isNotEmpty(isReleaseList)){ + List webPortalList = isReleaseList.stream().filter(vo -> vo.getPortalId().equalsIgnoreCase(id) + && PortalConst.WEB.equalsIgnoreCase(vo.getPlatform())).collect(Collectors.toList()); + StringJoiner webStr = new StringJoiner(";"); + for (PortalManageEntity item : webPortalList) { + SystemEntity systemEntity = sysList.stream().filter(t -> t.getId().equals(item.getSystemId())).findFirst().orElse(null); + if(systemEntity!=null){ + webStr.add(systemEntity.getFullName()); + } + } + if(StringUtil.isNotEmpty(webStr.toString())){ + model.setPcPortalIsRelease(1); + model.setPcPortalReleaseName(webStr.toString()); + } + List appPortalList = isReleaseList.stream().filter(vo -> vo.getPortalId().equalsIgnoreCase(id) + && PortalConst.APP.equalsIgnoreCase(vo.getPlatform())).collect(Collectors.toList()); + StringJoiner appStr = new StringJoiner(";"); + for (PortalManageEntity item : appPortalList) { + SystemEntity systemEntity = sysList.stream().filter(t -> t.getId().equals(item.getSystemId())).findFirst().orElse(null); + if(systemEntity!=null){ + appStr.add(systemEntity.getFullName()); + } + } + if(StringUtil.isNotEmpty(appStr.toString())){ + model.setAppPortalIsRelease(1); + model.setAppPortalReleaseName(appStr.toString()); + } + } + + if(moduleNameVO!=null){ + if(StringUtil.isNotEmpty(moduleNameVO.getPcNames())){ + model.setPcIsRelease(1); + model.setPcReleaseName(moduleNameVO.getPcNames()); + } + if(StringUtil.isNotEmpty(moduleNameVO.getAppNames())){ + model.setAppIsRelease(1); + model.setAppReleaseName(moduleNameVO.getAppNames()); + } + } + return model; + } + + @Override + public List systemFilterList(String id,String category) { + List list = systemApi.getList(null, true, true, true, true, new ArrayList<>()); + List jsonToList = JsonUtil.getJsonToList(list, SystemListVO.class); + List isReleaseList = portalManageService.list(); + List webPortalList; + if(PortalConst.APP.equalsIgnoreCase(category)){ + webPortalList = isReleaseList.stream().filter(vo -> vo.getPortalId().equalsIgnoreCase(id) + && PortalConst.APP.equalsIgnoreCase(vo.getPlatform())).collect(Collectors.toList()); + }else { + webPortalList = isReleaseList.stream().filter(vo -> vo.getPortalId().equalsIgnoreCase(id) + && PortalConst.WEB.equalsIgnoreCase(vo.getPlatform())).collect(Collectors.toList()); + } + List collect = webPortalList.stream().map(PortalManageEntity::getSystemId).collect(Collectors.toList()); + for (SystemListVO item : jsonToList) { + if(collect.contains(item.getId())){ + item.setDisabled(true); + } + } + return jsonToList; + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-controller/pom.xml b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-controller/pom.xml new file mode 100644 index 0000000..3a2de4b --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-controller/pom.xml @@ -0,0 +1,32 @@ + + + + yunzhupaas-visualdev-portal + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-visualdev-portal-controller + + + + com.yunzhupaas + yunzhupaas-visualdev-portal-biz + ${project.version} + + + com.yunzhupaas + yunzhupaas-provider + ${project.version} + + + com.yunzhupaas + yunzhupaas-extend-biz + ${project.version} + + + + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-controller/src/main/java/com/yunzhupaas/portal/controller/DashboardController.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-controller/src/main/java/com/yunzhupaas/portal/controller/DashboardController.java new file mode 100644 index 0000000..18ec5e6 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-controller/src/main/java/com/yunzhupaas/portal/controller/DashboardController.java @@ -0,0 +1,167 @@ +package com.yunzhupaas.portal.controller; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.flowable.model.operator.OperatorVo; +import com.yunzhupaas.flowable.model.task.TaskPagination; +import com.yunzhupaas.message.model.NoticeModel; +import com.yunzhupaas.message.model.message.NoticeVO; +import com.yunzhupaas.message.service.MessageService; +import com.yunzhupaas.portal.model.*; +import com.yunzhupaas.service.EmailReceiveService; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.workflow.service.TaskApi; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.List; + +/** + * 主页控制器 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Tag(name = "主页控制器", description = "Home") +@RestController +@RequestMapping("api/visualdev/Dashboard") +public class DashboardController { + @Autowired + private TaskApi taskApi; + @Autowired + private EmailReceiveService emailReceiveService; + @Autowired + private MessageService messageService; + + + + + + /** + * 获取我的待办 + * + * @return + */ + @Operation(summary = "获取我的待办") + @PostMapping("/FlowTodoCount") + public ActionResult getFlowTodoCount(@RequestBody FlowTodo flowTodo) { + FlowTodoCountVO vo = new FlowTodoCountVO(); + TaskPagination pagination = new TaskPagination(); + pagination.setDelegateType(true); + pagination.setPageSize(1L); + pagination.setCurrentPage(1L); + pagination.setFlowCategory(String.join(",",flowTodo.getFlowToSignType())); + pagination.setCategory("0"); + taskApi.getWaitList(pagination); + vo.setFlowToSign(pagination.getTotal()); + + pagination.setFlowCategory(String.join(",",flowTodo.getFlowTodoType())); + pagination.setCategory("1"); + taskApi.getWaitList(pagination); + vo.setFlowTodo(pagination.getTotal()); + + pagination.setFlowCategory(String.join(",",flowTodo.getFlowDoingType())); + pagination.setCategory("2"); + taskApi.getWaitList(pagination); + vo.setFlowDoing(pagination.getTotal()); + + pagination.setTotal(0); + pagination.setFlowCategory(String.join(",",flowTodo.getFlowDoneType())); + taskApi.getTrialList(pagination); + vo.setFlowDone(pagination.getTotal()); + + pagination.setFlowCategory(String.join(",",flowTodo.getFlowCirculateType())); + taskApi.getCirculateList(pagination); + vo.setFlowCirculate(pagination.getTotal()); + + return ActionResult.success(vo); + } + + /** + * 获取通知公告 + * + * @return + */ + @Operation(summary = "获取通知公告") + @PostMapping("/Notice") + public ActionResult getNotice(@RequestBody NoticeModel noticeModel) { + List list = JsonUtil.getJsonToList(messageService.getNoticeList(noticeModel.getTypeList()), NoticeVO.class); + ListVO voList = new ListVO(); + voList.setList(list); + return ActionResult.success(voList); + } + + /** + * 获取未读邮件 + * + * @return + */ + @Operation(summary = "获取未读邮件") + @GetMapping("/Email") + public ActionResult getEmail() { + List list = JsonUtil.getJsonToList(emailReceiveService.getDashboardReceiveList(), EmailVO.class); + ListVO voList = new ListVO<>(); + voList.setList(list); + return ActionResult.success(voList); + } + + /** + * 获取待办事项 + * + * @return + */ + @Operation(summary = "获取待办事项") + @GetMapping("/FlowTodo") + public ActionResult getFlowTodo(@RequestParam("type") Integer type) { + TaskPagination pagination = new TaskPagination(); + pagination.setDelegateType(true); + pagination.setPageSize(10L); + pagination.setCurrentPage(1L); + String category; + switch (type) { + case 1: + category = "0"; + break; + case 2: + category = "1"; + break; + default: + category = "2"; + } + pagination.setCategory(category); + List waitList = taskApi.getWaitList(pagination); + List list = new ArrayList<>(); + for (OperatorVo operatorVo : waitList) { + FlowTodoVO vo = JsonUtil.getJsonToBean(operatorVo, FlowTodoVO.class); + vo.setTaskNodeId(operatorVo.getNodeCode()); + vo.setTaskOperatorId(operatorVo.getId()); + vo.setType(2); + list.add(vo); + } + ListVO voList = new ListVO<>(); + voList.setList(list); + return ActionResult.success(voList); + } + + /** + * 获取我的待办事项 + * + * @return + */ + @Operation(summary = "获取我的待办事项") + @GetMapping("/MyFlowTodo") + public ActionResult getMyFlowTodo() { + TaskPagination pagination = new TaskPagination(); + pagination.setCategory("2"); + List list = JsonUtil.getJsonToList(taskApi.getWaitList(pagination), MyFlowTodoVO.class); + ListVO voList = new ListVO<>(); + voList.setList(list); + return ActionResult.success(voList); + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-controller/src/main/java/com/yunzhupaas/portal/controller/PortalController.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-controller/src/main/java/com/yunzhupaas/portal/controller/PortalController.java new file mode 100644 index 0000000..89aa315 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-controller/src/main/java/com/yunzhupaas/portal/controller/PortalController.java @@ -0,0 +1,344 @@ +package com.yunzhupaas.portal.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.stp.StpUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.base.entity.ModuleEntity; +import com.yunzhupaas.base.entity.PortalManageEntity; +import com.yunzhupaas.base.entity.SystemEntity; +import com.yunzhupaas.base.model.VisualFunctionModel; +import com.yunzhupaas.base.model.base.SystemListVO; +import com.yunzhupaas.base.model.base.SystemPageVO; +import com.yunzhupaas.base.model.module.ModuleNameVO; +import com.yunzhupaas.base.service.ModuleService; +import com.yunzhupaas.base.service.PortalManageService; +import com.yunzhupaas.base.service.SystemService; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.emnus.ExportModelTypeEnum; +import com.yunzhupaas.emnus.ModuleTypeEnum; +import com.yunzhupaas.portal.constant.PortalConst; +import com.yunzhupaas.portal.entity.PortalEntity; +import com.yunzhupaas.portal.model.*; +import com.yunzhupaas.portal.service.PortalDataService; +import com.yunzhupaas.portal.service.PortalService; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.treeutil.SumTree; +import com.yunzhupaas.util.treeutil.newtreeutil.TreeDotUtils; +import com.yunzhupaas.util.treeutil.newtreeutil.TreeDotUtils2; +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.checkerframework.checker.units.qual.A; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import jakarta.validation.Valid; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 可视化门户 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2023/09/27 + */ +@Slf4j +@RestController +@Tag(name = "可视化门户" , description = "Portal" ) +@RequestMapping("/api/visualdev/Portal" ) +public class PortalController extends SuperController { + + + @Autowired + private PortalService portalService; + @Autowired + private FileExport fileExport; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private PortalDataService portalDataService; + + @Operation(summary = "门户列表" ) + @GetMapping + @SaCheckPermission("onlineDev.visualPortal" ) + public ActionResult list(PortalPagination portalPagination) { + List modelAll = portalService.getModelList(portalPagination); + PaginationVO paginationVO = JsonUtil.getJsonToBean(portalPagination, PaginationVO.class); + return ActionResult.page(modelAll, paginationVO); + } + + @Operation(summary = "门户树形列表" ) + @Parameters({ + @Parameter(name = "type" , description = "类型:0-门户设计,1-配置路径" ), + }) + @GetMapping("/Selector" ) + public ActionResult> listSelect(String platform,String type) { + List modelList = new ArrayList<>(); + if(StringUtil.isNotEmpty(type)){ + modelList.addAll(portalService.getModList(new PortalViewPrimary(platform, null))); + }else { + modelList.addAll(portalService.getModSelectList()); + } + List> sumTrees = TreeDotUtils2.convertListToTreeDot(modelList); + List jsonToList = JsonUtil.getJsonToList(sumTrees, PortalSelectVO.class); + return ActionResult.success(new ListVO<>(jsonToList)); + } + + @Operation(summary = "门户详情" ) + @Parameters({ + @Parameter(name = "id" , description = "主键" ), + }) + @GetMapping("/{id}" ) + public ActionResult info(@PathVariable("id" ) String id, String platform) throws Exception { + StpUtil.checkPermissionOr("onlineDev.visualPortal" , id); + PortalEntity entity = portalService.getInfo(id); + if (entity == null) { + return ActionResult.fail(MsgCode.FA001.get()); + } + PortalInfoVO vo = JsonUtil.getJsonToBean(JsonUtilEx.getObjectToStringDateFormat(entity, "yyyy-MM-dd HH:mm:ss" ), PortalInfoVO.class); + vo.setFormData(portalDataService.getModelDataForm(new PortalModPrimary(id))); + //获取发布信息 + VisualFunctionModel releaseInfo = portalService.getReleaseInfo(entity.getId()); + vo.setPcPortalIsRelease(releaseInfo.getPcPortalIsRelease()); + vo.setPcPortalReleaseName(releaseInfo.getPcPortalReleaseName()); + vo.setAppPortalIsRelease(releaseInfo.getAppPortalIsRelease()); + vo.setAppPortalReleaseName(releaseInfo.getAppPortalReleaseName()); + vo.setPcIsRelease(releaseInfo.getPcIsRelease()); + vo.setPcReleaseName(releaseInfo.getPcReleaseName()); + vo.setAppIsRelease(releaseInfo.getAppIsRelease()); + vo.setAppReleaseName(releaseInfo.getAppReleaseName()); + return ActionResult.success(vo); + } + + @Operation(summary = "删除门户" ) + @Parameters({ + @Parameter(name = "id" , description = "主键" ), + }) + @DeleteMapping("/{id}" ) + @SaCheckPermission("onlineDev.visualPortal" ) + @DSTransactional + public ActionResult delete(@PathVariable("id" ) String id) { + PortalEntity entity = portalService.getInfo(id); + if (entity != null) { + try { + portalService.delete(entity); + } catch (Exception e) { + return ActionResult.fail(e.getMessage()); + } + } + return ActionResult.success(MsgCode.SU003.get()); + } + + @Operation(summary = "创建门户" ) + @PostMapping() + @SaCheckPermission("onlineDev.visualPortal" ) + @DSTransactional + public ActionResult create(@RequestBody @Valid PortalCrForm portalCrForm) throws Exception { + PortalEntity entity = JsonUtil.getJsonToBean(portalCrForm, PortalEntity.class); + entity.setId(RandomUtil.uuId()); + //判断名称是否重复 + if (portalService.isExistByFullName(entity.getFullName(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + //判断编码是否重复 + if (portalService.isExistByEnCode(entity.getEnCode(), entity.getId())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + // 修改模板排版数据 + if(Objects.equals(entity.getType(),1)){ + entity.setEnabledLock(null); + } + // 修改模板排版数据 + portalService.create(entity); + portalDataService.createOrUpdate(new PortalModPrimary(entity.getId()), portalCrForm.getFormData()); + return ActionResult.success(MsgCode.SU001.get(), entity.getId()); + } + + @Operation(summary = "复制功能" ) + @Parameters({ + @Parameter(name = "id" , description = "主键" ), + }) + @PostMapping("/{id}/Actions/Copy" ) + @SaCheckPermission("onlineDev.visualPortal" ) + public ActionResult copyInfo(@PathVariable("id" ) String id) throws Exception { + PortalEntity entity = portalService.getInfo(id); + entity.setEnabledMark(0); + String copyNum = UUID.randomUUID().toString().substring(0, 5); + entity.setFullName(entity.getFullName() + ".副本" + copyNum); + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + entity.setId(RandomUtil.uuId()); + entity.setEnCode(entity.getEnCode() + copyNum); + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + PortalEntity entity1 = JsonUtil.getJsonToBean(entity, PortalEntity.class); + if (entity1.getEnCode().length() > 50 || entity1.getFullName().length() > 50) { + return ActionResult.fail(MsgCode.PRI006.get()); + } + portalService.create(entity1); + portalDataService.createOrUpdate(new PortalModPrimary(entity1.getId()), + portalDataService.getModelDataForm(new PortalModPrimary(id))); + return ActionResult.success(MsgCode.SU007.get()); + } + + @Operation(summary = "修改门户" ) + @Parameters({ + @Parameter(name = "id" , description = "主键" ), + }) + @PutMapping("/{id}" ) + @SaCheckPermission("onlineDev.visualPortal" ) + @DSTransactional + public ActionResult update(@PathVariable("id" ) String id, @RequestBody @Valid PortalUpForm portalUpForm) throws Exception { + PortalEntity originEntity = portalService.getInfo(portalUpForm.getId()); + if(originEntity == null){ + ActionResult.fail(MsgCode.FA002.get()); + } + //判断名称是否重复 + if (!originEntity.getFullName().equals(portalUpForm.getFullName()) && StringUtil.isNotEmpty(portalUpForm.getFullName())) { + if (portalService.isExistByFullName(portalUpForm.getFullName(), portalUpForm.getId())) { + return ActionResult.fail(MsgCode.EXIST001.get()); + } + } + //判断编码是否重复 + if (!originEntity.getEnCode().equals(portalUpForm.getEnCode()) && StringUtil.isNotEmpty(portalUpForm.getEnCode())) { + if (portalService.isExistByEnCode(portalUpForm.getEnCode(), portalUpForm.getId())) { + return ActionResult.fail(MsgCode.EXIST002.get()); + } + } + // 修改排版数据 + if(Objects.equals(portalUpForm.getType(),1)){ + portalUpForm.setEnabledLock(null); + } + //修改状态 + if(Objects.equals(originEntity.getState(),1)){ + originEntity.setState(2); + portalUpForm.setState(2); + } + // 修改排版数据 + portalDataService.createOrUpdate(new PortalModPrimary(portalUpForm.getId()), portalUpForm.getFormData()); + if (StringUtil.isNotEmpty(portalUpForm.getFullName()) && StringUtil.isNotEmpty(portalUpForm.getEnCode())) { + portalService.update(id, JsonUtil.getJsonToBean(portalUpForm, PortalEntity.class)); + }else { + portalService.update(id, originEntity); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + @Operation(summary = "门户导出" ) + @Parameters({ + @Parameter(name = "modelId" , description = "模板id" ), + }) + @PostMapping("/{modelId}/Actions/Export" ) + @SaCheckPermission("onlineDev.visualPortal" ) + public ActionResult exportFunction(@PathVariable("modelId" ) String modelId) throws Exception { + PortalEntity entity = portalService.getInfo(modelId); + if (entity != null) { + PortalExportDataVo vo = new PortalExportDataVo(); + BeanUtils.copyProperties(entity, vo); + vo.setId(entity.getId()); + vo.setModelType(ExportModelTypeEnum.Portal.getMessage()); + vo.setFormData(portalDataService.getModelDataForm(new PortalModPrimary(entity.getId()))); + DownloadVO downloadVO = fileExport.exportFile(vo, configValueUtil.getTemporaryFilePath(), entity.getFullName(), ModuleTypeEnum.VISUAL_PORTAL.getTableName()); + return ActionResult.success(downloadVO); + } else { + return ActionResult.success(MsgCode.FA001.get()); + } + } + + @SneakyThrows + @Operation(summary = "门户导入" ) + @Parameters({ + @Parameter(name = "file" , description = "导入文件" ), + }) + @PostMapping(value = "/Actions/Import" , consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + @SaCheckPermission("onlineDev.visualPortal" ) + public ActionResult importFunction(@RequestPart("file" ) MultipartFile multipartFile,@RequestParam("type") Integer type) throws Exception { + //判断是否为.json结尾 + if (FileUtil.existsSuffix(multipartFile, ModuleTypeEnum.VISUAL_PORTAL.getTableName())) { + return ActionResult.fail(MsgCode.IMP002.get()); + } + //获取文件内容 + String fileContent = FileUtil.getFileContent(multipartFile); + PortalExportDataVo vo = JsonUtil.getJsonToBean(fileContent, PortalExportDataVo.class); + if (vo.getModelType() == null || !vo.getModelType().equals(ExportModelTypeEnum.Portal.getMessage())) { + return ActionResult.fail(MsgCode.VS410.get()); + } + + PortalEntity entity = JsonUtil.getJsonToBean(fileContent, PortalEntity.class); + StringJoiner errList = new StringJoiner("、"); + String copyNum = UUID.randomUUID().toString().substring(0, 5); + if (portalService.getInfo(entity.getId()) != null) { + if (Objects.equals(type, 0)) { + errList.add("ID"); + }else{ + entity.setId(null); + } + } + //判断编码是否重复 + if (portalService.isExistByEnCode(entity.getEnCode(), null)) { + if (Objects.equals(type, 0)) { + errList.add(MsgCode.IMP009.get()); + } else { + entity.setEnCode(entity.getEnCode() + copyNum); + } + } + //判断名称是否重复 + if (portalService.isExistByFullName(entity.getFullName(), null)) { + if (Objects.equals(type, 0)) { + errList.add(MsgCode.IMP008.get()); + } else { + entity.setFullName(entity.getFullName() + ".副本" + copyNum); + } + } + + if (Objects.equals(type, 0) && errList.length() > 0) { + return ActionResult.fail(errList + MsgCode.IMP007.get()); + } + + portalService.setIgnoreLogicDelete().removeById(entity.getId()); + portalService.clearIgnoreLogicDelete(); + entity.setEnabledMark(0); + entity.setSortCode(0l); + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + portalService.create(entity); + portalDataService.createOrUpdate(new PortalModPrimary(entity.getId()), vo.getFormData()); + return ActionResult.success(MsgCode.IMP001.get()); + } + + @Operation(summary = "门户管理下拉列表" ) + @GetMapping("/manage/Selector/{systemId}" ) + public ActionResult> getManageSelectorList(@PathVariable String systemId, PortalPagination portalPagination) { + portalPagination.setType(null); // 门户设计、配置路径。全选 + List voList = portalService.getManageSelectorPage(portalPagination, systemId); + PaginationVO paginationVO = JsonUtil.getJsonToBean(portalPagination, PaginationVO.class); + return ActionResult.page(voList, paginationVO); + } + + @Operation(summary = "门户获取系统下拉" ) + @GetMapping("/systemFilter/{id}" ) + public ActionResult> systemFilterList(@PathVariable("id") String id,String category) { + List systemListVOS = portalService.systemFilterList(id, category); + return ActionResult.success(new ListVO<>(systemListVOS)); + } +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-controller/src/main/java/com/yunzhupaas/portal/controller/PortalDataController.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-controller/src/main/java/com/yunzhupaas/portal/controller/PortalDataController.java new file mode 100644 index 0000000..1461a83 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-controller/src/main/java/com/yunzhupaas/portal/controller/PortalDataController.java @@ -0,0 +1,105 @@ +package com.yunzhupaas.portal.controller; + +import cn.dev33.satoken.stp.StpUtil; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.portal.constant.PortalConst; +import com.yunzhupaas.portal.entity.PortalEntity; +import com.yunzhupaas.portal.model.*; +import com.yunzhupaas.portal.service.PortalDataService; +import com.yunzhupaas.portal.service.PortalService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; + +/** + * 可视化门户 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2023/09/27 + */ +@Slf4j +@RestController +@Tag(name = "门户展示界面" , description = "Portal" ) +@RequestMapping("/api/visualdev/Portal" ) +public class PortalDataController extends SuperController { + @Autowired + private PortalDataService portalDataService; + + @Operation(summary = "设置默认门户" ) + @Parameters({ + @Parameter(name = "id" , description = "主键" ), + }) + @PutMapping("/{id}/Actions/SetDefault" ) + @Transactional + public ActionResult SetDefault(@PathVariable("id") String id, String platform) { + portalDataService.setCurrentDefault(platform, id); + return ActionResult.success(MsgCode.SU016.get()); + } + + @Operation(summary = "门户自定义保存" ) + @Parameters({ + @Parameter(name = "id" , description = "主键" ), + }) + @PutMapping("/Custom/Save/{id}") + public ActionResult customSave(@PathVariable("id" ) String id, @RequestBody PortalDataForm portalDataForm) throws Exception { + StpUtil.checkPermissionOr("onlineDev.visualPortal" , id); + portalDataForm.setPortalId(id); + portalDataService.createOrUpdate( + new PortalCustomPrimary(portalDataForm.getPlatform(), portalDataForm.getPortalId()), + portalDataForm.getFormData()); + return ActionResult.success(MsgCode.SU002.getMsg()); + } + + @Operation(summary = "门户发布(同步)" ) + @Parameters({ + @Parameter(name = "portalId" , description = "门户主键" ), + }) + @PutMapping("/Actions/release/{portalId}" ) + @Transactional(rollbackFor = Exception.class) + public ActionResult release(@PathVariable("portalId") String portalId, @RequestBody @Valid PortalReleaseForm form) throws Exception { + if (form.getPcPortal() == 1) + portalDataService.release(PortalConst.WEB, portalId, form.getPcPortalSystemId(), PortalConst.WEB, form); + if (form.getAppPortal() == 1) + portalDataService.release(PortalConst.APP, portalId, form.getAppPortalSystemId(), PortalConst.APP, form); + + ReleaseModel releaseSystemModel = new ReleaseModel(); + releaseSystemModel.setPc(form.getPc()); + releaseSystemModel.setPcSystemId(form.getPcSystemId()); + releaseSystemModel.setPcModuleParentId(form.getPcModuleParentId()); + releaseSystemModel.setApp(form.getApp()); + releaseSystemModel.setAppSystemId(form.getAppSystemId()); + releaseSystemModel.setAppModuleParentId(form.getAppModuleParentId()); + releaseSystemModel.setPcModuleParentId(form.getPcModuleParentId()); + releaseSystemModel.setAppModuleParentId(form.getAppModuleParentId()); + portalDataService.releaseModule(releaseSystemModel,portalId); + + return ActionResult.success(MsgCode.SU011.get()); + } + + @Operation(summary = "个人门户详情" ) + @Parameters({ + @Parameter(name = "id" , description = "主键" ), + }) + @GetMapping("/{id}/auth" ) + public ActionResult infoAuth(@PathVariable("id" ) String id, String platform, String systemId) { + platform = platform.equalsIgnoreCase("pc") || platform.equalsIgnoreCase(PortalConst.WEB) ? PortalConst.WEB : PortalConst.APP; + try{ + return ActionResult.success(portalDataService.getDataFormView(id, platform)); + }catch (Exception e){ + return ActionResult.fail(e.getMessage()); + } + } + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/pom.xml b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/pom.xml new file mode 100644 index 0000000..c32c5d8 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/pom.xml @@ -0,0 +1,22 @@ + + + + yunzhupaas-visualdev-portal + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-visualdev-portal-entity + + + + com.yunzhupaas + yunzhupaas-common-all + ${project.version} + + + + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/constant/PortalConst.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/constant/PortalConst.java new file mode 100644 index 0000000..477d7ff --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/constant/PortalConst.java @@ -0,0 +1,38 @@ +package com.yunzhupaas.portal.constant; + +/** + * 类功能 + * + * @author 云筑产品开发平台组 + * @version v3.4.6 + * @copyrignt 深圳市乐程软件有限公司 + * @date 2023-02-23 + */ +public class PortalConst { + + /* ========== platform ======== */ + + /** + * 网页端 + */ + public final static String PC = "pc"; + public final static String WEB = "Web"; + + /** + * 手机端 + */ + public final static String APP = "App"; + + /** + * 模板 + */ + public final static String MODEL = "model"; + public final static String CUSTOM = "custom"; + public final static String RELEASE = "release"; + + public final static String AUTHORIZE_PORTAL_MANAGE = "portalManage"; + + public final static String AUTHORIZE_PORTAL_ROLE = "role"; + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/entity/PortalDataEntity.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/entity/PortalDataEntity.java new file mode 100644 index 0000000..62dff19 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/entity/PortalDataEntity.java @@ -0,0 +1,46 @@ +package com.yunzhupaas.portal.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.entity.SuperEntity; +import lombok.Data; + +import java.io.Serializable; + + +/** + *

+ * + *

+ * + * @author + * @since 2023-04-19 + */ +@Data +@TableName("base_portal_data") +@Schema(description = "PortalData对象") +public class PortalDataEntity extends SuperEntity implements Serializable { + + @Schema(description = "门户ID") + @TableField("F_PORTAL_ID") + private String portalId; + + @Schema(description = "PC:网页端 APP:手机端") + @TableField("F_PLATFORM") + private String platform; + + @Schema(description = "表单配置JSON") + @TableField("F_FORM_DATA") + private String formData; + + @Schema(description = "系统ID") + @TableField("F_SYSTEM_ID") + private String systemId; + + @Schema(description = "类型(mod:模型、custom:自定义)") + @TableField("F_TYPE") + private String type; + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/entity/PortalEntity.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/entity/PortalEntity.java new file mode 100644 index 0000000..c123df2 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/entity/PortalEntity.java @@ -0,0 +1,57 @@ +package com.yunzhupaas.portal.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +/** + * 门户 + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2021/3/16 + */ +@Data +@TableName("base_portal") +public class PortalEntity extends SuperExtendEntity.SuperExtendDEEntity { + + @Schema(description = "名称") + @TableField("F_FULL_NAME") + private String fullName; + + @Schema(description = "编码") + @TableField("F_EN_CODE") + private String enCode; + + @Schema(description = "分类(数据字典维护)") + @TableField("F_CATEGORY") + private String category; + + @Schema(description = "类型(0-页面设计,1-自定义路径)") + @TableField("F_TYPE") + private Integer type; + + @Schema(description = "静态页面路径") + @TableField("F_CUSTOM_URL") + private String customUrl; + + @Schema(description = "类型(0-页面,1-外链)") + @TableField("F_LINK_TYPE") + private Integer linkType; + + @TableField("F_STATE") + private Integer state; + + @Schema(description = "移动锁定(0-未锁定,1-锁定)") + @TableField("F_ENABLED_LOCK") + private Integer enabledLock; + + /** + * 发布时勾选平台类型 + */ + @TableField("F_PLATFORM_RELEASE" ) + private String platformRelease; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/EmailVO.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/EmailVO.java new file mode 100644 index 0000000..37be832 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/EmailVO.java @@ -0,0 +1,13 @@ +package com.yunzhupaas.portal.model; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; + +@Data +public class EmailVO { + private String id; + @JSONField(name="subject") + private String fullName; + private Long creatorTime; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/FlowTodo.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/FlowTodo.java new file mode 100644 index 0000000..ca37cc0 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/FlowTodo.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.portal.model; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class FlowTodo { + private List flowToSignType = new ArrayList<>(); + private List flowTodoType = new ArrayList<>(); + private List flowDoingType = new ArrayList<>(); + private List flowDoneType = new ArrayList<>(); + private List flowCirculateType = new ArrayList<>(); +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/FlowTodoCountVO.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/FlowTodoCountVO.java new file mode 100644 index 0000000..35dcb4d --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/FlowTodoCountVO.java @@ -0,0 +1,12 @@ +package com.yunzhupaas.portal.model; +import lombok.Data; + +@Data +public class FlowTodoCountVO { + private Long flowToSign = 0L; + private Long flowTodo = 0L; + private Long flowDoing = 0L; + private Long flowDone = 0L; + private Long flowCirculate = 0L; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/FlowTodoVO.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/FlowTodoVO.java new file mode 100644 index 0000000..bb047a9 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/FlowTodoVO.java @@ -0,0 +1,38 @@ +package com.yunzhupaas.portal.model; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/16 8:49 + */ +@Data +public class FlowTodoVO { + public String id; + + public String fullName; + + public String enCode; + + public String flowId; + + public Integer formType; + + public Integer status; + + public String processId; + + public String taskNodeId; + + public String taskOperatorId; + + public Long creatorTime; + + public Integer type; + + public String taskId; + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/MyFlowTodoVO.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/MyFlowTodoVO.java new file mode 100644 index 0000000..a01c69a --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/MyFlowTodoVO.java @@ -0,0 +1,12 @@ +package com.yunzhupaas.portal.model; +import lombok.Data; + +@Data +public class MyFlowTodoVO { + private String id; + private Integer enabledMark; + private Long startTime; + private Long endTime; + private String content; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalCrForm.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalCrForm.java new file mode 100644 index 0000000..a12f98d --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalCrForm.java @@ -0,0 +1,44 @@ +package com.yunzhupaas.portal.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-10-21 14:23:30 + */ +@Data +@Schema(description="门户创建表单") +public class PortalCrForm { + + @Schema(description = "名称") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "是否启用") + private Integer enabledMark; + @Schema(description = "描述") + private String description; + @Schema(description = "表单数据json") + private String formData; + @Schema(description = "分类") + private String category; + @Schema(description = "排序") + private Long sortCode; + @Schema(description = "类型:0-门户设计,1-配置路径") + private Integer type; + @Schema(description = "配置路径") + private String customUrl; + @Schema(description = "链接路径") + private String appCustomUrl; + @Schema(description = "链接类型") + private Integer linkType; + @Schema(description = "锁定开关0-未锁定,1-锁定") + private Integer enabledLock; + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalCustomPrimary.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalCustomPrimary.java new file mode 100644 index 0000000..b463c17 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalCustomPrimary.java @@ -0,0 +1,61 @@ +package com.yunzhupaas.portal.model; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.MyBatisPrimaryBase; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.portal.constant.PortalConst; +import com.yunzhupaas.portal.entity.PortalDataEntity; +import com.yunzhupaas.util.UserProvider; +import com.yunzhupaas.util.context.SpringContext; +import lombok.Data; + +import java.util.Objects; + +/** + * 类功能 + * + * @author 云筑产品开发平台组 + * @version v3.4.8 + * @copyrignt 深圳市乐程软件有限公司 + * @date 2023-04-21 + */ +@Data +public class PortalCustomPrimary extends MyBatisPrimaryBase { + + /** 平台 */ + private String platform = PortalConst.WEB; + /** 门户ID */ + private String portalId; + /** 系统ID */ + private String systemId; + /** 用户ID */ + private String creatorId; + /** 类型(mod:模型、custom:自定义) */ + private String type = PortalConst.CUSTOM; + + public PortalCustomPrimary(String platform, String portalId, String systemId, String userId) { + if(platform != null) this.platform = platform; + this.portalId = portalId; + this.systemId = systemId; + this.creatorId = userId; + } + + public PortalCustomPrimary(String platform, String portalId){ + if(platform != null) this.platform = platform; + this.portalId = portalId; + UserInfo userInfo = SpringContext.getBean(UserProvider.class).get(); + this.systemId = Objects.equals(platform, PortalConst.WEB) ? userInfo.getSystemId() : userInfo.getAppSystemId(); + this.creatorId = userInfo.getUserId(); + } + + public QueryWrapper getQuery(){ + queryWrapper.lambda().eq(PortalDataEntity::getType, type); + if(this.platform != null) queryWrapper.lambda().eq(PortalDataEntity::getPlatform, platform); + if(this.portalId != null) queryWrapper.lambda().eq(PortalDataEntity::getPortalId, portalId); + if(this.systemId != null) queryWrapper.lambda().eq(PortalDataEntity::getSystemId, systemId); +// if(this.creatorId != null) queryWrapper.lambda().eq(PortalDataEntity::getCreatorUserId, creatorId); + return queryWrapper; + } + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalDataForm.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalDataForm.java new file mode 100644 index 0000000..8ea45ff --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalDataForm.java @@ -0,0 +1,27 @@ +package com.yunzhupaas.portal.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 类功能 + * + * @author 云筑产品开发平台组 + * @version v3.4.8 + * @copyrignt 深圳市乐程软件有限公司 + * @date 2023-04-19 + */ +@Data +public class PortalDataForm { + + @Schema(description = "门户id") + private String portalId; + + @Schema(description = "PC:网页端 APP:手机端 ") + private String platform; + + @Schema(description = "PC:网页端 APP:手机端 ") + private String formData; + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalDefaultDTO.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalDefaultDTO.java new file mode 100644 index 0000000..db32b6a --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalDefaultDTO.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.portal.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 类功能 + * + * @author 云筑产品开发平台组 + * @version v3.4.6 + * @copyrignt 深圳市乐程软件有限公司 + * @date 2023-03-24 + */ +@Data +public class PortalDefaultDTO { + + @Schema(description = "默认门户ID") + private String defaultPortalId; + + @Schema(description = "系统ID") + private String systemId; + + public PortalDefaultDTO(){ + + } + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalExportDataVo.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalExportDataVo.java new file mode 100644 index 0000000..25501e5 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalExportDataVo.java @@ -0,0 +1,57 @@ +package com.yunzhupaas.portal.model; +import lombok.Data; + +import java.util.Date; + +/** + * 门户导入导出 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2021/7/15 + */ +@Data +public class PortalExportDataVo { + + private String id; + + private String description; + + private Long sortCode; + + private Integer enabledMark; + + private Date creatorTime; + + private String creatorUser; + + private Date lastModifyTime; + + private String lastModifyUser; + + private Integer deleteMark; + + private Date deleteTime; + + private String deleteUserId; + + private String fullName; + + private String enCode; + + private String category; + + private String formData; + + private Integer type; + + private String customUrl; + + private Integer linkType; + + private String modelType; + + private Integer enabledLock; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalInfoAuthVO.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalInfoAuthVO.java new file mode 100644 index 0000000..a48ac26 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalInfoAuthVO.java @@ -0,0 +1,30 @@ +package com.yunzhupaas.portal.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @author 云筑产品开发平台组 + * @date 2024/3/16 + */ +@Data +@Schema(description="门户信息") +public class PortalInfoAuthVO { + @Schema(description = "表单josn") + private String formData; + @Schema(description = "门户类型0-用户配置1-自定义外链") + private Integer type; + @Schema(description = "链接路径") + private String customUrl; + @Schema(description = "链接路径") + private String appCustomUrl; + @Schema(description = "链接类型") + private Integer linkType; + @Schema(description = "锁定开关0-未锁定1锁定") + private Integer enabledLock; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalInfoVO.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalInfoVO.java new file mode 100644 index 0000000..44d24ab --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalInfoVO.java @@ -0,0 +1,42 @@ +package com.yunzhupaas.portal.model; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @author 管理员/admin + * @date 2024-10-21 14:23:30 + */ +@Data +public class PortalInfoVO extends PortalCrForm { + + private String id; + + @Schema(description = "pc发布标识") + Integer pcIsRelease; + @Schema(description = "app发布标识") + Integer appIsRelease; + + @Schema(description = "pc是否发布门户" ) + private Integer pcPortalIsRelease; + @Schema(description = "app是否发布门户" ) + private Integer appPortalIsRelease; + + + @Schema(description = "pc已发布菜单名称" ) + private String pcReleaseName; + @Schema(description = "app已发布菜单名称" ) + private String appReleaseName; + + @Schema(description = "pc已发布门户名称" ) + private String pcPortalReleaseName; + @Schema(description = "app已发布门户名称" ) + private String appPortalReleaseName; + + @Schema(description = "发布时勾选平台类型" ) + private String platformRelease; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalListModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalListModel.java new file mode 100644 index 0000000..2ef4339 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalListModel.java @@ -0,0 +1,27 @@ +package com.yunzhupaas.portal.model; + +import lombok.Data; + +/** + * 可视化列表模型 + * + * @author 云筑产品开发平台组 + * @version V3.2.8 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2021/11/20 + */ +@Data +public class PortalListModel { + private String category; + private Long creatorTime; + private String creatorUser; + private String enCode; + private Integer enabledMark; + private String fullName; + private String id; + private Integer type; + private Long lastModifyTime; + private String lastModifyUser; + private Long sortCode; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalListVO.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalListVO.java new file mode 100644 index 0000000..7e240c5 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalListVO.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.portal.model; +import lombok.Data; + +import java.util.List; + +/** + * + * + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @author 管理员/admin + * @date 2024-10-21 14:23:30 + */ +@Data +public class PortalListVO{ + private String id; + private Long num; + private String fullName; + private String enCode; + private Integer enabledMark; + private Long creatorTime; + private String creatorUser; + private Long lastModifyTime; + private String lastModifyUser; + private Long sortCode; + private List children; + private Integer enabledLock; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalModPrimary.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalModPrimary.java new file mode 100644 index 0000000..dda8af0 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalModPrimary.java @@ -0,0 +1,41 @@ +package com.yunzhupaas.portal.model; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.MyBatisPrimaryBase; +import com.yunzhupaas.portal.constant.PortalConst; +import com.yunzhupaas.portal.entity.PortalDataEntity; +import lombok.Data; + +/** + * 类功能 + * + * @author 云筑产品开发平台组 + * @version v3.4.8 + * @copyrignt 深圳市乐程软件有限公司 + * @date 2023-04-21 + */ +@Data +public class PortalModPrimary extends MyBatisPrimaryBase { + + /** + * 门户ID + */ + private String portalId; + + /** + * 类型(model:模型、custom:自定义) + */ + private String type = PortalConst.MODEL; + + public PortalModPrimary(String portalId){ + this.portalId = portalId; + } + + public QueryWrapper getQuery(){ + queryWrapper.lambda().eq(PortalDataEntity::getType, type); + if(this.portalId != null) queryWrapper.lambda().eq(PortalDataEntity::getPortalId, portalId); + return queryWrapper; + } + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalPagination.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalPagination.java new file mode 100644 index 0000000..6af5b70 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalPagination.java @@ -0,0 +1,34 @@ +package com.yunzhupaas.portal.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-10-21 14:23:30 + */ +@Data +@Schema(description="查询条件") +public class PortalPagination extends Pagination { + + @Schema(description = "分类(字典)") + private String category; + + @Schema(description = "类型(0-门户设计,1-配置路径)") + private Integer type; + + @Schema(description = "锁定(0-禁用,1-启用)") + private Integer enabledLock; + + @Schema(description = "平台") + private String platform = "web"; + + @Schema(description = "状态:0-未发布,1-已发布,2-已修改") + private Integer isRelease; + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalReleaseForm.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalReleaseForm.java new file mode 100644 index 0000000..c4fef9d --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalReleaseForm.java @@ -0,0 +1,33 @@ +package com.yunzhupaas.portal.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * 发布(同步)表单 + * + * @author 云筑产品开发平台组 + * @version v3.4.6 + * @copyrignt 深圳市乐程软件有限公司 + * @date 2023-02-23 + */ +@Data +@Schema(description="门户创建表单") +public class PortalReleaseForm extends ReleaseModel { + + @Schema(description = "pc标识") + private Integer pcPortal; + @Schema(description = "pc应用集合") + private List pcPortalSystemId; + @Schema(description = "app标识") + private Integer appPortal; + @Schema(description = "app应用集合") + private List appPortalSystemId; + + @Schema(description = "发布选中平台" ) + private String platformRelease; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalReleasePrimary.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalReleasePrimary.java new file mode 100644 index 0000000..d90e0f8 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalReleasePrimary.java @@ -0,0 +1,45 @@ +package com.yunzhupaas.portal.model; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.MyBatisPrimaryBase; +import com.yunzhupaas.portal.constant.PortalConst; +import com.yunzhupaas.portal.entity.PortalDataEntity; +import lombok.Data; + +/** + * 类功能 + * + * @author 云筑产品开发平台组 + * @version v3.4.8 + * @copyrignt 深圳市乐程软件有限公司 + * @date 2023-04-21 + */ +@Data +public class PortalReleasePrimary extends MyBatisPrimaryBase { + + /** + * 门户ID + */ + private String portalId; + + private String platform; + + /** + * 类型(model:模型、custom:自定义、release:发布) + */ + private String type = PortalConst.RELEASE; + + public PortalReleasePrimary(String portalId, String platform){ + this.portalId = portalId; + this.platform = platform; + } + + public QueryWrapper getQuery(){ + queryWrapper.lambda().eq(PortalDataEntity::getType, type); + if(this.portalId != null) queryWrapper.lambda().eq(PortalDataEntity::getPortalId, portalId); + if(this.platform != null) queryWrapper.lambda().eq(PortalDataEntity::getPlatform, platform); + return queryWrapper; + } + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalReleaseVO.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalReleaseVO.java new file mode 100644 index 0000000..5ae510c --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalReleaseVO.java @@ -0,0 +1,23 @@ +package com.yunzhupaas.portal.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 类功能 + * + * @author 云筑产品开发平台组 + * @version v3.4.8 + * @copyrignt 深圳市乐程软件有限公司 + * @date 2023-04-23 + */ +@Data +public class PortalReleaseVO { + + @Schema(description = "pc发布标识") + Integer pcIsRelease; + @Schema(description = "app发布标识") + Integer appIsRelease; + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalSelectModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalSelectModel.java new file mode 100644 index 0000000..1dd34f1 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalSelectModel.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.portal.model; + +import com.alibaba.fastjson.annotation.JSONField; +import com.yunzhupaas.util.treeutil.SumTree; +import lombok.Data; + +/** + * + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @author 云筑产品开发平台组 + * @date 2024/3/16 + */ +@Data +public class PortalSelectModel extends SumTree { + private String fullName; + private Long sortCode; + @JSONField(name="category") + private String parentId; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalSelectVO.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalSelectVO.java new file mode 100644 index 0000000..97280f1 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalSelectVO.java @@ -0,0 +1,35 @@ +package com.yunzhupaas.portal.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @author 云筑产品开发平台组 + * @date 2024/3/16 + */ +@Data +public class PortalSelectVO { + private String id; + private List children; + private Boolean hasChildren; + private String parentId; + private Long sortCode; + + @Schema(description = "门户名") + private String fullName; + @Schema(description = "编码") + private String enCode; + @Schema(description = "字典类型") + private String category; + @Schema(description = "分类ID") + private String categoryId; + @Schema(description = "分类名") + private String categoryName; + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalTreeModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalTreeModel.java new file mode 100644 index 0000000..414146a --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalTreeModel.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.portal.model; + +import com.yunzhupaas.util.treeutil.SumTree; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Data +public class PortalTreeModel extends SumTree { + private String fullName; + private Long num; + private String enCode; + private Long creatorTime; + private Integer enabledMark; + private String creatorUser; + private Long lastModifyTime; + private String lastModifyUser; + private Long sortCode; +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalUpForm.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalUpForm.java new file mode 100644 index 0000000..ae13798 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalUpForm.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.portal.model; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * @date 2024-10-21 14:23:30 + */ +@Data +@Schema(description="门户修改表单") +public class PortalUpForm extends PortalCrForm { + + @Schema(description = "门户id") + private String id; + + @Schema(description = "PC:网页端 APP:手机端 ") + String platform; + + @Schema(description = "PC:网页端 APP:手机端 ") + Integer state; + + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalViewPrimary.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalViewPrimary.java new file mode 100644 index 0000000..391ee60 --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/PortalViewPrimary.java @@ -0,0 +1,38 @@ +package com.yunzhupaas.portal.model; + +import com.yunzhupaas.base.MyBatisPrimaryBase; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.portal.constant.PortalConst; +import com.yunzhupaas.portal.entity.PortalEntity; +import com.yunzhupaas.util.UserProvider; +import lombok.Data; + +/** + * 类功能 + * + * @author 云筑产品开发平台组 + * @version v3.4.8 + * @copyrignt 深圳市乐程软件有限公司 + * @date 2023-04-21 + */ +@Data +public class PortalViewPrimary extends MyBatisPrimaryBase { + + private String creatorId; + + private String portalId; + + private String platForm = PortalConst.WEB; + + private String systemId; + + public PortalViewPrimary(String platForm, String portalId){ + if(platForm != null) this.platForm = platForm; + this.portalId = portalId; + UserInfo userInfo = UserProvider.getUser(); + this.systemId = PortalConst.WEB.equals(platForm) ? userInfo.getSystemId() : userInfo.getAppSystemId(); + this.creatorId = userInfo.getId(); + } + +} + diff --git a/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/ReleaseModel.java b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/ReleaseModel.java new file mode 100644 index 0000000..0ba2a1b --- /dev/null +++ b/yunzhupaas-visualdev/yunzhupaas-visualdev-portal/yunzhupaas-visualdev-portal-entity/src/main/java/com/yunzhupaas/portal/model/ReleaseModel.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.portal.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +@Data +public class ReleaseModel { + @Schema(description = "pc标识") + private Integer pc; + @Schema(description = "pc应用集合") + private String pcSystemId; + @Schema(description = "app标识") + private Integer app; + @Schema(description = "pc应用集合") + private String appSystemId; + + + @Schema(description = "app上级菜单") + private List appModuleParentId; + @Schema(description = "pc上级菜单") + private List pcModuleParentId; + +} + diff --git a/yunzhupaas-workflow/pom.xml b/yunzhupaas-workflow/pom.xml new file mode 100644 index 0000000..396a689 --- /dev/null +++ b/yunzhupaas-workflow/pom.xml @@ -0,0 +1,19 @@ + + + + yunzhupaas-java-boot + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-workflow + pom + + yunzhupaas-workflow-form + yunzhupaas-workflow-engine + + + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/pom.xml b/yunzhupaas-workflow/yunzhupaas-workflow-engine/pom.xml new file mode 100644 index 0000000..aa055d9 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/pom.xml @@ -0,0 +1,21 @@ + + + + yunzhupaas-workflow + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-workflow-engine + pom + + yunzhupaas-workflow-engine-entity + yunzhupaas-workflow-engine-biz + yunzhupaas-workflow-engine-controller + + + + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/pom.xml b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/pom.xml new file mode 100644 index 0000000..26f13cc --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/pom.xml @@ -0,0 +1,37 @@ + + + + yunzhupaas-workflow-engine + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-workflow-engine-biz + + + + com.yunzhupaas + yunzhupaas-workflow-engine-entity + ${project.version} + + + com.yunzhupaas + yunzhupaas-provider + ${project.version} + + + com.yunzhupaas + yunzhupaas-system-biz + ${project.version} + + + com.yunzhupaas + yunzhupaas-permission-biz + ${project.version} + + + + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowAuthorizeMapper.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowAuthorizeMapper.java new file mode 100644 index 0000000..eb4a1b4 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowAuthorizeMapper.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.engine.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.engine.entity.FlowAuthorizeEntity; + +/** + * 流程权限表 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +public interface FlowAuthorizeMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowCandidatesMapper.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowCandidatesMapper.java new file mode 100644 index 0000000..a0e30bd --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowCandidatesMapper.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.engine.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.engine.entity.FlowCandidatesEntity; + +/** + * 流程候选人 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +public interface FlowCandidatesMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowCommentMapper.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowCommentMapper.java new file mode 100644 index 0000000..7f8ba33 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowCommentMapper.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.engine.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.engine.entity.FlowCommentEntity; + +/** + * 流程评论 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +public interface FlowCommentMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowDelegateMapper.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowDelegateMapper.java new file mode 100644 index 0000000..e5bb2bf --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowDelegateMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.engine.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.engine.entity.FlowDelegateEntity; + +/** + * 流程委托 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface FlowDelegateMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowEngineVisibleMapper.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowEngineVisibleMapper.java new file mode 100644 index 0000000..2e85249 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowEngineVisibleMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.engine.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.engine.entity.FlowEngineVisibleEntity; + +/** + * 流程可见 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface FlowEngineVisibleMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowEventLogMapper.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowEventLogMapper.java new file mode 100644 index 0000000..387cce1 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowEventLogMapper.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.engine.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.engine.entity.FlowEventLogEntity; + +/** + * 流程事件日志 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +public interface FlowEventLogMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowOperatorUserMapper.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowOperatorUserMapper.java new file mode 100644 index 0000000..9c26796 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowOperatorUserMapper.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.engine.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.engine.entity.FlowOperatorUserEntity; + +/** + * 流程依次审批 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +public interface FlowOperatorUserMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowRejectDataMapper.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowRejectDataMapper.java new file mode 100644 index 0000000..9b33c9e --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowRejectDataMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.engine.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.engine.entity.FlowRejectDataEntity; + +/** + * 冻结审批 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface FlowRejectDataMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowTaskCirculateMapper.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowTaskCirculateMapper.java new file mode 100644 index 0000000..a55d440 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowTaskCirculateMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.engine.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.engine.entity.FlowTaskCirculateEntity; + +/** + * 流程传阅 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface FlowTaskCirculateMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowTaskMapper.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowTaskMapper.java new file mode 100644 index 0000000..6245477 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowTaskMapper.java @@ -0,0 +1,42 @@ +package com.yunzhupaas.engine.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.engine.entity.FlowTaskEntity; +import com.yunzhupaas.engine.model.flowtask.FlowTaskListModel; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 流程任务 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface FlowTaskMapper extends SuperMapper { + /** + * 已办事宜 + * + * @return + */ + List getTrialList(@Param("map") Map map); + + /** + * 抄送事宜 + * + * @return + */ + List getCirculateList(@Param("map") Map map); + + /** + * 待办事宜 + * + * @return + */ + List getWaitList(@Param("map") Map map); + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowTaskNodeMapper.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowTaskNodeMapper.java new file mode 100644 index 0000000..313cdd1 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowTaskNodeMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.engine.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.engine.entity.FlowTaskNodeEntity; + +/** + * 流程节点 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface FlowTaskNodeMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowTaskOperatorMapper.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowTaskOperatorMapper.java new file mode 100644 index 0000000..6209cc7 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowTaskOperatorMapper.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.engine.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.engine.entity.FlowTaskOperatorEntity; + +/** + * 流程经办 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface FlowTaskOperatorMapper extends SuperMapper { +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowTaskOperatorRecordMapper.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowTaskOperatorRecordMapper.java new file mode 100644 index 0000000..23845c6 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowTaskOperatorRecordMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.engine.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.engine.entity.FlowTaskOperatorRecordEntity; + +/** + * 流程经办记录 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface FlowTaskOperatorRecordMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowTemplateJsonMapper.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowTemplateJsonMapper.java new file mode 100644 index 0000000..a6f69f8 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowTemplateJsonMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.engine.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.engine.entity.FlowTemplateJsonEntity; + +/** + * 流程引擎 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年7月11日 上午9:18 + */ +public interface FlowTemplateJsonMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowTemplateMapper.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowTemplateMapper.java new file mode 100644 index 0000000..a22f890 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowTemplateMapper.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.engine.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.engine.entity.FlowTemplateEntity; + +/** + * 流程引擎 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年7月11日 上午9:18 + */ +public interface FlowTemplateMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowUserMapper.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowUserMapper.java new file mode 100644 index 0000000..982efe3 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/mapper/FlowUserMapper.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.engine.mapper; + +import com.yunzhupaas.base.mapper.SuperMapper; +import com.yunzhupaas.engine.entity.FlowUserEntity; + +/** + * 流程发起用户信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +public interface FlowUserMapper extends SuperMapper { + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowAuthorizeService.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowAuthorizeService.java new file mode 100644 index 0000000..58d09d3 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowAuthorizeService.java @@ -0,0 +1,34 @@ +package com.yunzhupaas.engine.service; + +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.engine.entity.FlowAuthorizeEntity; + +import java.util.List; + + +/** + * 流程权限表 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +public interface FlowAuthorizeService extends SuperService { + + /** + * 列表 + * + * @return + */ + List getList(String taskId, String nodeCode, SFunction... columns); + + /** + * 创建 + * + * @param list 实体对象 + */ + void create(List list); + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowCandidatesService.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowCandidatesService.java new file mode 100644 index 0000000..bebfc7c --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowCandidatesService.java @@ -0,0 +1,96 @@ +package com.yunzhupaas.engine.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.engine.entity.FlowCandidatesEntity; + +import java.util.List; + +/** + * 流程候选人 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +public interface FlowCandidatesService extends SuperService { + + /** + * 列表 + * + * @param taskNodeId 节点主键 + * @return + */ + List getList(String taskNodeId); + + /** + * 列表 + * + * @param taskNodeId 节点主键 + * @return + */ + List getList(String taskId, String taskNodeId); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + FlowCandidatesEntity getInfo(String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(FlowCandidatesEntity entity); + + /** + * 创建 + * + * @param list 实体对象 + */ + void create(List list); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return + */ + void update(String id, FlowCandidatesEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + * @return + */ + void delete(FlowCandidatesEntity entity); + + /** + * 删除 + * + * @param taskId + */ + void deleteByTaskId(String taskId); + + /** + * 拒绝删除候选人节点 + */ + void deleteTaskNodeId(List taskNodeId); + + /** + * 撤回删除候选人 + * + * @param taskOperatorId 经办主键 + */ + void delete(List taskOperatorId); + + /** + * 撤回删除候选人节点 + */ + void deleteTaskNodeId(List taskNodeId, Integer type); +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowCommentService.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowCommentService.java new file mode 100644 index 0000000..e461123 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowCommentService.java @@ -0,0 +1,58 @@ +package com.yunzhupaas.engine.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.engine.entity.FlowCommentEntity; +import com.yunzhupaas.engine.model.flowcomment.FlowCommentPagination; + +import java.util.List; + +/** + * 流程评论 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +public interface FlowCommentService extends SuperService { + + /** + * 列表 + * + * @param pagination 请求参数 + * @return + */ + List getlist(FlowCommentPagination pagination); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + FlowCommentEntity getInfo(String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(FlowCommentEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return + */ + void update(String id, FlowCommentEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + * @return + */ + void delete(FlowCommentEntity entity); +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowDelegateService.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowDelegateService.java new file mode 100644 index 0000000..d7f666a --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowDelegateService.java @@ -0,0 +1,125 @@ +package com.yunzhupaas.engine.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.engine.entity.FlowDelegateEntity; +import com.yunzhupaas.engine.model.flowcandidate.FlowCandidateUserModel; +import com.yunzhupaas.engine.model.flowdelegate.FlowDelegateCrForm; +import com.yunzhupaas.engine.model.flowdelegate.FlowDelegatePagination; +import com.yunzhupaas.engine.model.flowengine.FlowPagination; +import com.yunzhupaas.engine.model.flowtemplate.FlowPageListVO; +import com.yunzhupaas.exception.WorkFlowException; + +import java.util.List; + +/** + * 流程委托 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface FlowDelegateService extends SuperService { + + /** + * 列表 + * + * @param pagination 请求参数 + * @return + */ + List getList(FlowDelegatePagination pagination); + + /** + * 列表 + * + * @return + */ + List getList(); + + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + FlowDelegateEntity getInfo(String id); + + /** + * 删除 + * + * @param entity 实体对象 + */ + void delete(FlowDelegateEntity entity); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(FlowDelegateEntity entity); + + /** + * 获取被委托人的表单 + * + * @param touserId 被委托人 + * @return + */ + List getUser(String touserId); + + /** + * 获取委托的表单 + * + * @param userId 委托人 + * @param flowId 流程引擎 + * @param touserId 被委托人 + * @return + */ + List getUser(String userId, String flowId, String touserId); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return + */ + boolean update(String id, FlowDelegateEntity entity); + + /** + * 委托结束 + * + * @param id 主键值 + * @param entity 实体对象 + * @return + */ + boolean updateStop(String id, FlowDelegateEntity entity); + + /** + * 获取我的委托发起 + * + * @return + */ + List getflow(FlowPagination pagination); + + /** + * 根据流程获取委托人列表。 + * + * @param flowId 流程版本id + * @return + */ + ListVO getUserListByFlowId(String flowId) throws WorkFlowException; + + /** + * 根据条件查询相关委托信息 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/10/28 + */ + List selectSameParamAboutDelaget(FlowDelegateCrForm model); + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowDynamicService.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowDynamicService.java new file mode 100644 index 0000000..8e693f2 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowDynamicService.java @@ -0,0 +1,41 @@ +package com.yunzhupaas.engine.service; + +import com.yunzhupaas.engine.enums.FlowStatusEnum; +import com.yunzhupaas.engine.model.flowengine.FlowModel; +import com.yunzhupaas.engine.model.flowengine.shuntjson.childnode.ChildNode; +import com.yunzhupaas.exception.WorkFlowException; + +/** + * 在线开发工作流 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:19 + */ +public interface FlowDynamicService { + + /** + * 流程数据 + * + * @param flowModel + */ + void flowTask(FlowModel flowModel, FlowStatusEnum flowStatus, ChildNode childNode) throws WorkFlowException; + + /** + * 保存流程 + * + * @param flowModel + * @throws WorkFlowException + */ + void createOrUpdate(FlowModel flowModel) throws WorkFlowException; + + /** + * 批量保存流程 + * + * @param flowModel + * @throws WorkFlowException + */ + void batchCreateOrUpdate(FlowModel flowModel) throws WorkFlowException; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowEngineVisibleService.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowEngineVisibleService.java new file mode 100644 index 0000000..415a7ae --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowEngineVisibleService.java @@ -0,0 +1,60 @@ +package com.yunzhupaas.engine.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.engine.entity.FlowEngineVisibleEntity; +import com.yunzhupaas.engine.model.flowtask.FlowAssistModel; + +import java.util.List; + +/** + * 流程可见 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface FlowEngineVisibleService extends SuperService { + + /** + * 列表 + * + * @param flowIdList 流程主键 + * @return + */ + List getList(List flowIdList); + + /** + * 列表 + * + * @return + */ + List getList(); + + /** + * 可见流程列表 + * + * @param userId 用户主键 + * @return + */ + List getVisibleFlowList(String userId); + + /** + * 可见流程列表 + * + * @param userId 用户主键 + * @return + */ + List getVisibleFlowList(String userId, Integer type); + + /** + * 删除流程可见 + */ + void deleteVisible(String flowId); + + /** + * 保存协管数据 + */ + void assistList(FlowAssistModel assistModel); +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowEventLogService.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowEventLogService.java new file mode 100644 index 0000000..d552913 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowEventLogService.java @@ -0,0 +1,33 @@ +package com.yunzhupaas.engine.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.engine.entity.FlowEventLogEntity; + +import java.util.List; + +/** + * 流程事件日志 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +public interface FlowEventLogService extends SuperService { + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(FlowEventLogEntity entity); + + /** + * 获取日志列表 + * + * @param taskNodeId + * @return + */ + List getList(List taskNodeId); + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowOperatorUserService.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowOperatorUserService.java new file mode 100644 index 0000000..024476c --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowOperatorUserService.java @@ -0,0 +1,80 @@ +package com.yunzhupaas.engine.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.engine.entity.FlowOperatorUserEntity; + +import java.util.List; +import java.util.Set; + +/** + * 流程依次审批 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +public interface FlowOperatorUserService extends SuperService { + + /** + * 列表 + * + * @param taskId 流程实例Id + * @return + */ + List getList(String taskId); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + FlowOperatorUserEntity getInfo(String id); + + /** + * 获取 + * + * @return + */ + List getTaskList(String taskId, String taskNodeId); + + /** + * 创建 + * + * @param list 实体对象 + */ + void create(List list); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return + */ + void update(String id, FlowOperatorUserEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + * @return + */ + void delete(FlowOperatorUserEntity entity); + + /** + * 删除 + * + * @param taskId + */ + void deleteByTaskId(String taskId); + + /** + * 驳回的节点之后审批人删除 + * + * @param taskId + * @param taskNodeId + */ + void updateReject(String taskId, Set taskNodeId); +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowRejectDataService.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowRejectDataService.java new file mode 100644 index 0000000..0254968 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowRejectDataService.java @@ -0,0 +1,46 @@ +package com.yunzhupaas.engine.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.engine.entity.FlowRejectDataEntity; + +/** + * 冻结审批 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-29 上午9:18 + */ +public interface FlowRejectDataService extends SuperService { + + /** + * 新增 + * + * @param rejectEntity + */ + void createOrUpdate(FlowRejectDataEntity rejectEntity); + + /** + * 新增 + * + * @param rejectEntity + */ + void create(FlowRejectDataEntity rejectEntity); + + /** + * 更新 + * + * @param rejectEntity + */ + void update(String id, FlowRejectDataEntity rejectEntity); + + /** + * 获取信息 + * + * @param id + * @return + */ + FlowRejectDataEntity getInfo(String id); + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowTaskCirculateService.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowTaskCirculateService.java new file mode 100644 index 0000000..4758ec4 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowTaskCirculateService.java @@ -0,0 +1,42 @@ +package com.yunzhupaas.engine.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.engine.entity.FlowTaskCirculateEntity; + +import java.util.List; + +/** + * 流程传阅 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface FlowTaskCirculateService extends SuperService { + + /** + * 删除(根据实例Id) + * + * @param taskId 任务主键 + * @return + */ + void deleteByTaskId(String taskId); + + /** + * 创建 + * + * @param entitys 实体对象 + * @return + */ + void create(List entitys); + + /** + * 获取列表 + * + * @param taskId + * @return + */ + List getList(String taskId); +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowTaskNewService.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowTaskNewService.java new file mode 100644 index 0000000..01d8647 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowTaskNewService.java @@ -0,0 +1,276 @@ +package com.yunzhupaas.engine.service; + +import com.yunzhupaas.engine.entity.FlowTaskEntity; +import com.yunzhupaas.engine.entity.FlowTaskOperatorEntity; +import com.yunzhupaas.engine.entity.FlowTaskOperatorRecordEntity; +import com.yunzhupaas.engine.model.flowbefore.FlowBeforeInfoVO; +import com.yunzhupaas.engine.model.flowbefore.FlowSummary; +import com.yunzhupaas.engine.model.flowcandidate.FlowCandidateUserModel; +import com.yunzhupaas.engine.model.flowcandidate.FlowCandidateVO; +import com.yunzhupaas.engine.model.flowcandidate.FlowRejectVO; +import com.yunzhupaas.engine.model.flowengine.FlowModel; +import com.yunzhupaas.exception.WorkFlowException; + +import java.util.List; + +/** + * 流程引擎 + * + * @author 云筑产品开发平台组 + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年4月27日 上午9:18 + */ +public interface FlowTaskNewService { + + /** + * 保存 + * + * @param flowModel 保存数据 + * @return + * @throws WorkFlowException 异常 + */ + FlowTaskEntity saveIsAdmin(FlowModel flowModel) throws WorkFlowException; + + /** + * 保存 + * + * @param flowModel 保存数据 + * @return + * @throws WorkFlowException 异常 + */ + FlowTaskEntity save(FlowModel flowModel) throws WorkFlowException; + + /** + * 提交 + * + * @param flowModel 提交数据 + * @throws WorkFlowException 异常 + */ + void submit(FlowModel flowModel) throws WorkFlowException; + + /** + * 提交包含事件和数据 + * + * @param flowModel 提交数据 + * @throws WorkFlowException + */ + void submitAll(FlowModel flowModel) throws WorkFlowException; + + /** + * 审批 + * + * @param flowTask 流程实例 + * @param operator 流程经办 + * @param flowModel 提交数据 + * @throws WorkFlowException + */ + void audit(FlowTaskEntity flowTask, FlowTaskOperatorEntity operator, FlowModel flowModel) throws WorkFlowException; + + /** + * 审批包含事件和数据 + * + * @param flowTask 流程实例 + * @param operator 流程经办 + * @param flowModel 提交数据 + * @throws WorkFlowException + */ + void auditAll(FlowTaskEntity flowTask, FlowTaskOperatorEntity operator, FlowModel flowModel) throws WorkFlowException; + + /** + * 验证流程审批 + * + * @param flowModel 提交数据 + * @throws WorkFlowException + */ + void audit(FlowModel flowModel) throws WorkFlowException; + + /** + * 驳回 + * + * @param flowTask 流程实例 + * @param operator 流程经办 + * @param flowModel 提交数据 + * @throws WorkFlowException + */ + void reject(FlowTaskEntity flowTask, FlowTaskOperatorEntity operator, FlowModel flowModel) throws WorkFlowException; + + /** + * 驳回包含事件和数据 + * + * @param flowTask 流程实例 + * @param operator 流程经办 + * @param flowModel 提交数据 + * @throws WorkFlowException + */ + void rejectAll(FlowTaskEntity flowTask, FlowTaskOperatorEntity operator, FlowModel flowModel) throws WorkFlowException; + + /** + * 验证流程审批 + * + * @param flowModel 提交数据 + * @throws WorkFlowException + */ + void reject(FlowModel flowModel) throws WorkFlowException; + + /** + * 已办撤回 + * + * @param id 已办id + * @param operatorRecord 经办记录 + * @param flowModel 提交数据 + * @throws WorkFlowException 异常 + */ + void recall(String id, FlowTaskOperatorRecordEntity operatorRecord, FlowModel flowModel) throws WorkFlowException; + + /** + * 发起撤回 + * + * @param flowTask 流程实例 + * @param flowModel 提交数据 + */ + void revoke(FlowTaskEntity flowTask, FlowModel flowModel, boolean isParentId) throws WorkFlowException; + + /** + * 发起撤回 + * + * @param id 流程主键 + * @param flowModel 提交数据 + */ + void revoke(List id, FlowModel flowModel, boolean isParentId) throws WorkFlowException; + + /** + * 终止 + * + * @param flowTask 流程实例 + * @param flowModel 提交数据 + */ + void cancel(FlowTaskEntity flowTask, FlowModel flowModel) throws WorkFlowException; + + /** + * 终止 + * + * @param flowModel 提交数据 + */ + void cancel(List id, FlowModel flowModel) throws WorkFlowException; + + /** + * 指派 + * + * @param id + * @param flowModel 提交数据 + * @return + */ + void assign(String id, FlowModel flowModel) throws WorkFlowException; + + /** + * 转办 + * + * @param taskOperator 经办数据 + */ + void transfer(FlowTaskOperatorEntity taskOperator, FlowModel flowModel) throws WorkFlowException; + + /** + * 验证流程审批 + * + * @param flowModel 提交数据 + * @throws WorkFlowException + */ + void transfer(FlowModel flowModel) throws WorkFlowException; + + /** + * 获取任务详情 + * + * @return + * @throws WorkFlowException 异常 + */ + FlowBeforeInfoVO getBeforeInfo(FlowModel flowModel) throws WorkFlowException; + + /** + * 查询审批汇总 + * + * @param id 主键 + * @param category 类型(1.部门 2.角色 3.岗位) + * @param type 0.查询全部 1.查询通过和拒绝 + * @return + */ + List recordList(String id, String category, String type); + + /** + * 催办 + * + * @param id 主键 + * @return + * @throws WorkFlowException + */ + boolean press(String id, FlowModel flowModel) throws WorkFlowException; + + /** + * 获取候选人节点 + * + * @param id 主键 + * @return + * @throws WorkFlowException + */ + FlowCandidateVO candidates(String id, FlowModel flowModel, boolean batch) throws WorkFlowException; + + /** + * 获取候选人list + * + * @param id 主键 + * @return + * @throws WorkFlowException + */ + List candidateUser(String id, FlowModel flowModel) throws WorkFlowException; + + /** + * 批量审批 + * + * @throws WorkFlowException + */ + void batch(FlowModel flowModel) throws WorkFlowException; + + /** + * 批量获取候选人节点 + * + * @return + */ + FlowCandidateVO batchCandidates(String flowId, String taskOperatorId, FlowModel flowModel) throws WorkFlowException; + + /** + * 判断操作权限 + * + * @param userId + * @param flowTask + * @param operator + * @param msg + * @throws WorkFlowException + */ + void permissions(String userId, FlowTaskEntity flowTask, FlowTaskOperatorEntity operator, String msg, FlowModel flowModel) throws WorkFlowException; + + /** + * 变更、复活节点 + * + * @param flowModel + */ + void change(FlowModel flowModel) throws WorkFlowException; + + /** + * 拒绝下拉框 + * + * @param id + * @param batch + * @return + */ + FlowRejectVO rejectList(String id, boolean batch) throws WorkFlowException; + + /** + * 流程挂起和恢复 + * + * @param id + * @param flowModel + * @param isSuspend true 挂起 false 恢复 + */ + void suspend(String id, FlowModel flowModel, boolean isSuspend); +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowTaskNodeService.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowTaskNodeService.java new file mode 100644 index 0000000..48646b7 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowTaskNodeService.java @@ -0,0 +1,111 @@ +package com.yunzhupaas.engine.service; + +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.engine.entity.FlowTaskNodeEntity; +import com.yunzhupaas.engine.model.flowtasknode.TaskNodeListModel; + +import java.util.List; + +/** + * 流程节点 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface FlowTaskNodeService extends SuperService { + + /** + * 列表 + * + * @param taskId 任务主键 + * @return + */ + List getList(String taskId, SFunction... columns); + + /** + * 列表 + * + * @param id 节点主键 + * @return + */ + List getList(List id, SFunction... columns); + + /** + * 列表 + * + * @param nodeListModel + * @return + */ + List getList(TaskNodeListModel nodeListModel, SFunction... columns); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + FlowTaskNodeEntity getInfo(String id, SFunction... columns); + + /** + * 删除(根据实例Id) + * + * @param taskId 任务主键 + */ + void deleteByTaskId(String taskId); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(FlowTaskNodeEntity entity); + + /** + * 更新 + * + * @param entity 实体对象 + */ + void update(FlowTaskNodeEntity entity); + + /** + * 更新驳回开始流程节点 + * + * @param taskId 流程id + */ + void update(String taskId); + + /** + * 修改节点的审批状态 + * + * @param id 主键值 + * @param start 状态 + */ + void updateCompletion(List id, int start); + + /** + * 修改节点数据 + * + * @param taskNodeLis + */ + void updateTaskNode(List taskNodeLis); + + /** + * 修改节点的选择分支数据 + * + * @param id + */ + void updateTaskNodeCandidates(List id, String candidates); + + /** + * 保存子流程任务id + * + * @param entity + */ + void updateTaskIdList(FlowTaskNodeEntity entity); + + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowTaskOperatorRecordService.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowTaskOperatorRecordService.java new file mode 100644 index 0000000..ed54a72 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowTaskOperatorRecordService.java @@ -0,0 +1,102 @@ +package com.yunzhupaas.engine.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.engine.entity.FlowTaskOperatorRecordEntity; + +import java.util.List; +import java.util.Set; + +/** + * 流程经办记录 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface FlowTaskOperatorRecordService extends SuperService { + + /** + * 列表 + * + * @param taskId 流程实例Id + * @return + */ + List getList(String taskId); + + /** + * 消息汇总列表 + * + * @param taskId 流程实例Id + * @param handleStatus 状态 + * @return + */ + List getRecordList(String taskId, List handleStatus); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + FlowTaskOperatorRecordEntity getInfo(String id); + + /** + * 删除 + * + * @param entity 实体对象 + * @return + */ + void delete(FlowTaskOperatorRecordEntity entity); + + /** + * 创建 + * + * @param entity 实体对象 + * @return + */ + void create(FlowTaskOperatorRecordEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + */ + void update(String id, FlowTaskOperatorRecordEntity entity); + + /** + * 驳回流转记录状态 + * + * @param taskNodeId 流程id + * @param taskId 流程实例Id + */ + void updateStatus(Set taskNodeId, String taskId); + + /** + * 通过3个id查询记录 + * + * @param taskId + * @param taskNodeId + * @param taskOperatorId + * @return + */ + FlowTaskOperatorRecordEntity getInfo(String taskId, String taskNodeId, String taskOperatorId); + + /** + * 更新撤回经办记录 + * + * @param idAll 经办id + */ + void updateStatus(List idAll); + + /** + * 更新驳回流程节点 + * + * @param taskId 流程id + */ + void update(String taskId); + + FlowTaskOperatorRecordEntity getIsCheck(String taskOperatorId, Integer status); +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowTaskOperatorService.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowTaskOperatorService.java new file mode 100644 index 0000000..8ec087c --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowTaskOperatorService.java @@ -0,0 +1,127 @@ +package com.yunzhupaas.engine.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.engine.entity.FlowTaskOperatorEntity; +import com.yunzhupaas.exception.WorkFlowException; + +import java.util.List; +import java.util.Set; + +/** + * 流程经办 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface FlowTaskOperatorService extends SuperService { + + /** + * 列表 + * + * @param taskId 流程实例Id + * @return + */ + List getList(String taskId); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + FlowTaskOperatorEntity getInfo(String id) throws WorkFlowException; + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + FlowTaskOperatorEntity getOperatorInfo(String id); + + /** + * 创建 + * + * @param entitys 实体对象 + */ + void create(List entitys); + + /** + * 更新 + * + * @param entity 实体对象 + */ + void update(FlowTaskOperatorEntity entity); + + /** + * 更新会签委托人的审核状态 + * + * @param taskNodeId 流程节点id + * @param userId 委托人id + * @param completion 审批状态 + */ + void update(String taskNodeId, List userId, String completion); + + /** + * 更新流程经办审核状态 + * + * @param taskNodeId 流程节点id + * @param type 流程类型 + */ + void update(String taskNodeId, Integer type); + + /** + * 更新驳回流程节点 + * + * @param taskId 流程id + */ + void update(String taskId); + + /** + * 经办未审核人员 + * + * @param taskId 任务id + * @return + */ + List press(String taskId); + + /** + * 驳回的节点之后的节点作废 + * + * @param taskId + * @param taskNodeId + */ + void updateReject(String taskId, Set taskNodeId); + + /** + * 删除经办id + * + * @param idAll 经办id + */ + void deleteList(List idAll); + + /** + * 查询加签人信息 + * + * @param parentId 父节点Id + * @return + */ + List getParentId(String parentId); + + /** + * 更新经办记录作废 + * + * @param idAll + */ + void updateTaskOperatorState(List idAll); + + /** + * 获取自己代办的流程任务 + * + * @return + */ + List getBatchList(); +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowTaskService.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowTaskService.java new file mode 100644 index 0000000..0f7931f --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowTaskService.java @@ -0,0 +1,222 @@ +package com.yunzhupaas.engine.service; + +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.engine.entity.FlowTaskEntity; +import com.yunzhupaas.engine.model.flowbefore.FlowBatchModel; +import com.yunzhupaas.engine.model.flowtask.FlowTaskListModel; +import com.yunzhupaas.engine.model.flowtask.PaginationFlowTask; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.model.FlowWorkListVO; +import com.yunzhupaas.permission.model.user.WorkHandoverModel; + +import java.util.List; + +/** + * 流程任务 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public interface FlowTaskService extends SuperService { + + /** + * 列表(流程监控) + * + * @param paginationFlowTask + * @return + */ + List getMonitorList(PaginationFlowTask paginationFlowTask); + + /** + * 列表(我发起的) + * + * @param paginationFlowTask + * @return + */ + List getLaunchList(PaginationFlowTask paginationFlowTask); + + + /** + * 列表(待我审批) + * @param pagination + * @return + */ + List getWaitList(PaginationFlowTask pagination); + + /** + * 列表(抄送我的) + * + * @param pagination + * @return + */ + List getCirculateList(PaginationFlowTask pagination); + + /** + * 列表(我已审批) + * + * @param pagination + * @return + */ + List getTrialList(PaginationFlowTask pagination); + + /** + * 信息 + * + * @param id 主键值 + * @return + * @throws WorkFlowException 异常 + */ + FlowTaskEntity getInfo(String id, SFunction... columns) throws WorkFlowException; + + /** + * 更新 + * + * @param entity 主键值 + * @return + */ + void update(FlowTaskEntity entity); + + /** + * 创建 + * + * @param entity 主键值 + * @return + */ + void create(FlowTaskEntity entity); + + /** + * 创建或者修改 + * + * @param entity 主键值 + * @return + */ + void createOrUpdate(FlowTaskEntity entity); + + /** + * 信息 + * + * @param id 主键值 + * @param columns 指定获取的列数据 , 任务中存了三个JSON数据 , 排除后可以提高查询速度 + * @return + */ + FlowTaskEntity getInfoSubmit(String id, SFunction... columns); + + /** + * 信息 + * + * @param ids 主键值 + * @param columns 指定获取的列数据 , 任务中存了三个JSON数据 , 排除后可以提高查询速度 + * @return + */ + List getInfosSubmit(String[] ids, SFunction... columns); + + /** + * 删除 + * + * @param entity 实体对象 + * @throws WorkFlowException 异常 + */ + void delete(FlowTaskEntity entity) throws WorkFlowException; + + /** + * 递归删除所有字节点 + * + * @param id + */ + void deleteChildAll(List id); + + /** + * 批量删除流程 + * + * @param ids + */ + void delete(String[] ids) throws WorkFlowException; + + /** + * 查询订单状态 + * + * @param id + * @return + */ + List getOrderStaList(List id, SFunction... columns); + + /** + * 查询子流程 + * + * @param id + * @return + */ + List getChildList(String id, SFunction... columns); + + + /** + * 查询子流程 + * + * @param id + * @return + */ + List getChildList(List id, SFunction... columns); + + /** + * 查询流程列表 + * + * @param tempId + * @return + */ + List getTemplateIdList(String tempId); + + /** + * 查询流程列表 + * + * @param flowId + * @return + */ + List getFlowList(String flowId); + + /** + * 批量审批引擎 + * + * @return + */ + List batchFlowSelector(); + + /** + * 获取子节点下所有数据 + * + * @param idList + * @param idAll + */ + void deleTaskAll(List idList, List idAll); + + /** + * 获取所有子流程 + * + * @param id + * @return + */ + List getChildAllList(String id); + + /** + * 获取子流程 + * + * @param id + * @return + */ + void getChildList(String id, boolean suspend, List list); + + /** + * 流程交接 + * @return + */ + FlowWorkListVO flowWork(String fromId); + + /** + * 流程交接 + * @return + */ + boolean flowWork(WorkHandoverModel workHandoverModel); +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowTemplateJsonService.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowTemplateJsonService.java new file mode 100644 index 0000000..878b529 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowTemplateJsonService.java @@ -0,0 +1,129 @@ +package com.yunzhupaas.engine.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.engine.entity.FlowTemplateJsonEntity; +import com.yunzhupaas.engine.model.flowengine.FlowPagination; +import com.yunzhupaas.engine.model.flowtemplate.FlowSelectVO; +import com.yunzhupaas.engine.model.flowtemplatejson.FlowTemplateJsonPage; +import com.yunzhupaas.exception.WorkFlowException; + +import java.util.List; + +/** + * 流程引擎 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年7月11日 上午9:18 + */ +public interface FlowTemplateJsonService extends SuperService { + + /** + * 列表 + * + * @return + */ + List getTemplateList(List id); + + /** + * 列表 + * + * @return + */ + List getTemplateJsonList(List id); + + /** + * 分页列表 + * + * @param page + * @return + */ + List getListPage(FlowTemplateJsonPage page, boolean isPage); + + /** + * 查询子流程 + * + * @return + */ + List getChildListPage(FlowPagination page); + + /** + * 获取主版本 + * + * @param id + * @return + */ + List getMainList(List id); + + /** + * 获取主版本 + * + * @param id + * @return + */ + FlowTemplateJsonEntity getInfo(String id) throws WorkFlowException; + + + /** + * 获取主版本 + * + * @param id + * @return + */ + FlowTemplateJsonEntity getJsonInfo(String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(FlowTemplateJsonEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return + */ + void update(String id, FlowTemplateJsonEntity entity); + + /** + * 删除 + * + * @param entity + */ + void delete(FlowTemplateJsonEntity entity); + + /** + * 查询主版本流程 + * + * @return + */ + List getListAll(List id); + + /** + * 设置主版本 + * + * @param ids + */ + void templateJsonMajor(String ids) throws WorkFlowException; + + /** + * 获取消息发送配置id + * + * @param engine + * @return + */ + List sendMsgConfigList(FlowTemplateJsonEntity engine); + + /** + * 修改流程引擎名称 + * + * @param groupId + * @param fullName + */ + void updateFullName(String groupId, String fullName); +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowTemplateService.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowTemplateService.java new file mode 100644 index 0000000..3b5f6a4 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowTemplateService.java @@ -0,0 +1,179 @@ +package com.yunzhupaas.engine.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.engine.entity.FlowTemplateEntity; +import com.yunzhupaas.engine.entity.FlowTemplateJsonEntity; +import com.yunzhupaas.engine.model.flowengine.FlowPagination; +import com.yunzhupaas.engine.model.flowtemplate.FlowExportModel; +import com.yunzhupaas.engine.model.flowtemplate.FlowTemplateInfoVO; +import com.yunzhupaas.engine.model.flowtemplate.FlowTemplateListVO; +import com.yunzhupaas.engine.model.flowtemplate.FlowTemplateVO; +import com.yunzhupaas.exception.WorkFlowException; + +import java.util.List; + +/** + * 流程引擎 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年7月11日 上午9:18 + */ +public interface FlowTemplateService extends SuperService { + + /** + * 分页列表 + * + * @param pagination 分页 + * @return + */ + List getPageList(FlowPagination pagination); + + /** + * 信息 + * + * @param id 主键值 + * @return + * @throws WorkFlowException 异常 + */ + FlowTemplateEntity getInfo(String id) throws WorkFlowException; + + /** + * 验证名称 + * + * @param fullName 名称 + * @param id 主键值 + * @return + */ + boolean isExistByFullName(String fullName, String id); + + /** + * 验证编码 + * + * @param enCode 编码 + * @param id 主键值 + * @return + */ + boolean isExistByEnCode(String enCode, String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(FlowTemplateEntity entity, List templateJsonList) throws WorkFlowException; + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(FlowTemplateEntity entity); + + /** + * 获取流程信息 + * + * @param id 主键值 + * @return + */ + FlowTemplateInfoVO info(String id) throws WorkFlowException; + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return + */ + FlowTemplateVO updateVisible(String id, FlowTemplateEntity entity, List templateJsonList) throws WorkFlowException; + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return + */ + boolean update(String id, FlowTemplateEntity entity) throws WorkFlowException; + + /** + * 复制 + * + * @param entity 实体对象 + */ + void copy(FlowTemplateEntity entity, List templateJsonEntity) throws WorkFlowException; + + /** + * 删除 + */ + void delete(FlowTemplateEntity entity) throws WorkFlowException; + + /** + * 导入创建 + * + * @param id 导出主键 + */ + FlowExportModel exportData(String id) throws WorkFlowException; + + /** + * 工作流导入 + * + * @return + * @throws WorkFlowException + */ + void ImportData(FlowExportModel flowExportModel, String type) throws WorkFlowException; + + /** + * 流程设计列表 + * + * @return + */ + List getSelectList(); + + /** + * 所属流程树形 + * + * @return + */ + List getTreeList(); + + /** + * 查询引擎 + * + * @param id 主键值 + * @return + */ + List getTemplateList(List id); + + /** + * 信息 + * + * @param code 主键值 + * @return + * @throws WorkFlowException 异常 + */ + FlowTemplateEntity getFlowIdByCode(String code) throws WorkFlowException; + + /** + * 列表 + * + * @param pagination 分页对象 + * @param isPage 是否分页 + * @return + */ + List getListAll(FlowPagination pagination, boolean isPage); + + /** + * 列表 + * 当isAll为true时,可查询全部。为false不可查询全部。 + * + * @param pagination 分页对象 + * @param listAll 是否查询列表 + * @return + */ + List getListByFlowIds(FlowPagination pagination, List listAll, Boolean isAll, Boolean isPage, String userId); + + void saveLogicFlowAndForm(String id); +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowUserService.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowUserService.java new file mode 100644 index 0000000..070ee3b --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/FlowUserService.java @@ -0,0 +1,62 @@ +package com.yunzhupaas.engine.service; + +import com.yunzhupaas.base.service.SuperService; +import com.yunzhupaas.engine.entity.FlowUserEntity; + +/** + * 流程发起用户信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +public interface FlowUserService extends SuperService { + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + FlowUserEntity getInfo(String id); + + /** + * 信息 + * + * @param id 主键值 + * @return + */ + FlowUserEntity getTaskInfo(String id); + + /** + * 创建 + * + * @param entity 实体对象 + */ + void create(FlowUserEntity entity); + + /** + * 更新 + * + * @param id 主键值 + * @param entity 实体对象 + * @return + */ + void update(String id, FlowUserEntity entity); + + /** + * 删除 + * + * @param entity 实体对象 + * @return + */ + void delete(FlowUserEntity entity); + + /** + * 删除 + * + * @param taskId + */ + void deleteByTaskId(String taskId); +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowAuthorizeServiceImpl.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowAuthorizeServiceImpl.java new file mode 100644 index 0000000..af6c12e --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowAuthorizeServiceImpl.java @@ -0,0 +1,44 @@ +package com.yunzhupaas.engine.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.engine.entity.FlowAuthorizeEntity; +import com.yunzhupaas.engine.mapper.FlowAuthorizeMapper; +import com.yunzhupaas.engine.service.FlowAuthorizeService; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 流程权限表 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Service +public class FlowAuthorizeServiceImpl extends SuperServiceImpl implements FlowAuthorizeService { + + @Override + public List getList(String taskId, String nodeCode, SFunction... columns) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowAuthorizeEntity::getTaskId, taskId); + if (StringUtil.isNotEmpty(nodeCode)) { + queryWrapper.lambda().eq(FlowAuthorizeEntity::getNodeCode, nodeCode); + } + queryWrapper.lambda().select(columns); + return this.list(queryWrapper); + } + + @Override + public void create(List list) { + for (FlowAuthorizeEntity entity : list) { + entity.setId(RandomUtil.uuId()); + this.save(entity); + } + } +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowCandidatesServiceImpl.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowCandidatesServiceImpl.java new file mode 100644 index 0000000..e4741cc --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowCandidatesServiceImpl.java @@ -0,0 +1,110 @@ +package com.yunzhupaas.engine.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.engine.entity.FlowCandidatesEntity; +import com.yunzhupaas.engine.mapper.FlowCandidatesMapper; +import com.yunzhupaas.engine.service.FlowCandidatesService; +import com.yunzhupaas.util.RandomUtil; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 流程候选人 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Service +public class FlowCandidatesServiceImpl extends SuperServiceImpl implements FlowCandidatesService { + + @Override + public List getList(String taskNodeId) { + return getList(null, taskNodeId); + } + + @Override + public List getList(String taskId, String taskNodeId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (ObjectUtil.isNotEmpty(taskId)) { + queryWrapper.lambda().eq(FlowCandidatesEntity::getTaskId, taskId); + } + if (ObjectUtil.isNotEmpty(taskNodeId)) { + queryWrapper.lambda().eq(FlowCandidatesEntity::getTaskNodeId, taskNodeId); + } + return this.list(queryWrapper); + } + + @Override + public FlowCandidatesEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowCandidatesEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(FlowCandidatesEntity entity) { + entity.setId(RandomUtil.uuId()); + this.save(entity); + } + + @Override + public void create(List list) { + for (FlowCandidatesEntity entity : list) { + entity.setId(RandomUtil.uuId()); + this.save(entity); + } + } + + @Override + public void update(String id, FlowCandidatesEntity entity) { + entity.setId(id); + this.updateById(entity); + } + + @Override + public void delete(FlowCandidatesEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + + @Override + public void deleteByTaskId(String taskId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowCandidatesEntity::getTaskId, taskId); + this.remove(queryWrapper); + } + + @Override + public void deleteTaskNodeId(List taskNodeId) { + if (taskNodeId.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(FlowCandidatesEntity::getTaskNodeId, taskNodeId); + this.remove(queryWrapper); + } + } + + @Override + public void delete(List taskOperatorId) { + if (taskOperatorId.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(FlowCandidatesEntity::getOperatorId, taskOperatorId); + this.remove(queryWrapper); + } + } + + @Override + public void deleteTaskNodeId(List taskNodeId, Integer type) { + if (taskNodeId.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(FlowCandidatesEntity::getTaskNodeId, taskNodeId); + queryWrapper.lambda().eq(FlowCandidatesEntity::getType, type); + this.remove(queryWrapper); + } + } +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowCommentServiceImpl.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowCommentServiceImpl.java new file mode 100644 index 0000000..5cee8bb --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowCommentServiceImpl.java @@ -0,0 +1,70 @@ +package com.yunzhupaas.engine.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.engine.entity.FlowCommentEntity; +import com.yunzhupaas.engine.mapper.FlowCommentMapper; +import com.yunzhupaas.engine.model.flowcomment.FlowCommentPagination; +import com.yunzhupaas.engine.service.FlowCommentService; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * 流程评论 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Service +public class FlowCommentServiceImpl extends SuperServiceImpl implements FlowCommentService { + + + + @Override + public List getlist(FlowCommentPagination pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowCommentEntity::getTaskId, pagination.getTaskId()); + queryWrapper.lambda().isNull(FlowCommentEntity::getDeleteMark); + queryWrapper.lambda().orderByDesc(FlowCommentEntity::getCreatorTime); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage userIPage = this.page(page, queryWrapper); + return pagination.setData(userIPage.getRecords(), page.getTotal()); + } + + @Override + public FlowCommentEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowCommentEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(FlowCommentEntity entity) { + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + entity.setId(RandomUtil.uuId()); + this.save(entity); + } + + @Override + public void update(String id, FlowCommentEntity entity) { + entity.setId(id); + this.updateById(entity); + } + + @Override + public void delete(FlowCommentEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowDelegateServiceImpl.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowDelegateServiceImpl.java new file mode 100644 index 0000000..d309f83 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowDelegateServiceImpl.java @@ -0,0 +1,335 @@ +package com.yunzhupaas.engine.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.google.common.collect.ImmutableList; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.constant.PermissionConst; +import com.yunzhupaas.engine.entity.FlowDelegateEntity; +import com.yunzhupaas.engine.entity.FlowEngineVisibleEntity; +import com.yunzhupaas.engine.entity.FlowTemplateEntity; +import com.yunzhupaas.engine.entity.FlowTemplateJsonEntity; +import com.yunzhupaas.engine.mapper.FlowDelegateMapper; +import com.yunzhupaas.engine.model.flowcandidate.FlowCandidateUserModel; +import com.yunzhupaas.engine.model.flowdelegate.FlowDelegateCrForm; +import com.yunzhupaas.engine.model.flowdelegate.FlowDelegateModel; +import com.yunzhupaas.engine.model.flowdelegate.FlowDelegatePagination; +import com.yunzhupaas.engine.model.flowengine.FlowPagination; +import com.yunzhupaas.engine.model.flowtemplate.FlowPageListVO; +import com.yunzhupaas.engine.service.FlowDelegateService; +import com.yunzhupaas.engine.service.FlowEngineVisibleService; +import com.yunzhupaas.engine.service.FlowTemplateJsonService; +import com.yunzhupaas.engine.service.FlowTemplateService; +import com.yunzhupaas.engine.util.FlowMsgUtil; +import com.yunzhupaas.engine.util.FlowNature; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.permission.entity.OrganizeEntity; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.entity.UserRelationEntity; +import com.yunzhupaas.util.*; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 流程委托 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Service +public class FlowDelegateServiceImpl extends SuperServiceImpl implements FlowDelegateService { + + @Autowired + private ServiceAllUtil serviceUtil; + @Autowired + private FlowMsgUtil flowMsgUtil; + + @Autowired + private FlowTemplateService flowTemplateService; + @Autowired + private FlowTemplateJsonService flowTemplateJsonService; + @Autowired + private FlowEngineVisibleService flowEngineVisibleService; + + @Override + public List getList(FlowDelegatePagination pagination) { + // 定义变量判断是否需要使用修改时间倒序 + boolean flag = false; + String userId = UserProvider.getUser().getUserId(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + if ("2".equals(pagination.getMyOrDelagateToMe())) {//MyOrDelagateToMe=2查询委托给我的列表 + queryWrapper.lambda().eq(FlowDelegateEntity::getToUserId, userId); + } else { +// if (!UserProvider.getUser().getIsAdministrator()) {//非超管 +// List list = serviceUtil.getListByAuthorize("0"); +// if (CollectionUtils.isNotEmpty(list)) {//是分管 +// List userIds = new ArrayList<>(); +// for (UserByRoleVO item : list) { +// List listByAuthorize = serviceUtil.getListByAuthorize(item.getId()); +// userIds.addAll(listByAuthorize.stream().map(UserByRoleVO::getId).collect(Collectors.toList())); +// } +// queryWrapper.lambda().and( +// t -> t.eq(FlowDelegateEntity::getUserId, userId)) +// .or().in(FlowDelegateEntity::getUserId, userIds); +// } else { +// queryWrapper.lambda().eq(FlowDelegateEntity::getUserId, userId); +// } +// } + queryWrapper.lambda().eq(FlowDelegateEntity::getUserId, userId); + } + + if (!StringUtils.isEmpty(pagination.getKeyword())) { + flag = true; + if ("1".equals(pagination.getMyOrDelagateToMe())) { + queryWrapper.lambda().and( + t -> t.like(FlowDelegateEntity::getFlowName, pagination.getKeyword()) + .or().like(FlowDelegateEntity::getToUserName, pagination.getKeyword()) + ); + } else { + queryWrapper.lambda().and( + t -> t.like(FlowDelegateEntity::getFlowName, pagination.getKeyword()) + .or().like(FlowDelegateEntity::getUserName, pagination.getKeyword()) + ); + } + } + //排序 + queryWrapper.lambda().orderByAsc(FlowDelegateEntity::getSortCode).orderByDesc(FlowDelegateEntity::getCreatorTime); + if (flag) { + queryWrapper.lambda().orderByDesc(FlowDelegateEntity::getLastModifyTime); + } + Page page = new Page(pagination.getCurrentPage(), pagination.getPageSize()); + IPage flowDelegateEntityPage = this.page(page, queryWrapper); + return pagination.setData(flowDelegateEntityPage.getRecords(), page.getTotal()); + } + + @Override + public List getList() { + String userId = UserProvider.getUser().getUserId(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().and( + t -> t.eq(FlowDelegateEntity::getCreatorUserId, userId) + .or().eq(FlowDelegateEntity::getUserId, userId)); + return this.baseMapper.selectList(queryWrapper); + } + + @Override + public FlowDelegateEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowDelegateEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void delete(FlowDelegateEntity entity) { + this.removeById(entity.getId()); + } + + @Override + public void create(FlowDelegateEntity entity) { + UserInfo userInfo = UserProvider.getUser(); + entity.setId(RandomUtil.uuId()); + entity.setSortCode(RandomUtil.parses()); + entity.setCreatorUserId(userInfo.getUserId()); + FlowDelegateModel delegate = new FlowDelegateModel(); + delegate.setToUserIds(ImmutableList.of(entity.getToUserId())); + delegate.setType(entity.getType()); + delegate.setUserInfo(userInfo); + flowMsgUtil.delegateMsg(delegate); + this.save(entity); + } + + @Override + public List getUser(String touserId) { + return getUser(null, null, touserId); + } + + @Override + public List getUser(String userId, String flowId, String touserId) { + Date thisTime = DateUtil.getNowDate(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowDelegateEntity::getType, 1); + queryWrapper.lambda().le(FlowDelegateEntity::getStartTime, thisTime).ge(FlowDelegateEntity::getEndTime, thisTime); + if (StringUtil.isNotEmpty(userId)) { + queryWrapper.lambda().eq(FlowDelegateEntity::getUserId, userId); + } + if (StringUtil.isNotEmpty(touserId)) { + queryWrapper.lambda().eq(FlowDelegateEntity::getToUserId, touserId); + } + List list = this.list(queryWrapper); + List listRes = new ArrayList<>(); + if (StringUtil.isNotEmpty(flowId)) { + for (FlowDelegateEntity item : list) { + if (StringUtil.isNotEmpty(item.getFlowId())) { + String[] split = item.getFlowId().split(","); + if (Arrays.asList(split).contains(flowId)) { + listRes.add(item); + } + } else {//为空是全部流程 + listRes.add(item); + } + } + } else { + listRes = list; + } + return listRes; + } + + @Override + public boolean update(String id, FlowDelegateEntity entity) { + UserInfo userInfo = UserProvider.getUser(); + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(userInfo.getUserId()); + FlowDelegateModel delegate = new FlowDelegateModel(); + delegate.setToUserIds(ImmutableList.of(entity.getToUserId())); + delegate.setType(entity.getType()); + delegate.setUserInfo(userInfo); + flowMsgUtil.delegateMsg(delegate); + return this.updateById(entity); + } + + @Override + public boolean updateStop(String id, FlowDelegateEntity entity) { + UserInfo userInfo = UserProvider.getUser(); + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(userInfo.getUserId()); + FlowDelegateModel delegate = new FlowDelegateModel(); + delegate.setToUserIds(ImmutableList.of(entity.getToUserId())); + delegate.setType(FlowNature.EndMsg); + delegate.setUserInfo(userInfo); + flowMsgUtil.delegateMsg(delegate); + return this.updateById(entity); + } + + @Override + public List getflow(FlowPagination pagination) { + List list = getLaunchDelagateList(); + if (CollectionUtils.isEmpty(list)) { + return new ArrayList<>(); + } +// List listFlow = new ArrayList<>(); +// for (FlowDelegateEntity item : list) { +// if (StringUtil.isNotEmpty(item.getFlowId())) { +// listFlow.addAll( +// flowTemplateService.getListByFlowIds(pagination, Arrays.asList(item.getFlowId().split(",")), false, false, item.getUserId()) +// .stream().map(FlowTemplateEntity::getId).collect(Collectors.toList())); +// } else { +// listFlow.addAll(flowTemplateService.getListByFlowIds(pagination, null, true, false, item.getUserId()) +// .stream().map(FlowTemplateEntity::getId).collect(Collectors.toList())); +// } +// } +// List listReslut = flowTemplateService.getListByFlowIds(pagination, listFlow, false, false, null); + List templateIdList = new ArrayList<>(); + int num = 0; + for (FlowDelegateEntity item : list) { + if (StringUtil.isNotEmpty(item.getFlowId())) { + templateIdList.addAll(Arrays.asList(item.getFlowId().split(","))); + } + num += StringUtil.isEmpty(item.getFlowId()) ? 1 : 0; + } + if (num == 0) { + pagination.setTemplateIdList(templateIdList); + } + List dataList = flowTemplateService.getListAll(pagination, true); + List listVO = JsonUtil.getJsonToList(dataList, FlowPageListVO.class); + return listVO; + } + + @Override + public ListVO getUserListByFlowId(String flowId) throws WorkFlowException { + FlowTemplateJsonEntity info = flowTemplateJsonService.getInfo(flowId); + String templateId = info.getTemplateId(); + List list = getLaunchDelagateList(); + Set userName = new HashSet<>(); + for (FlowDelegateEntity item : list) { + //用户可见列表 + UserEntity userInfo = serviceUtil.getUserInfo(item.getUserId()); + boolean visibleType = "1".equals(userInfo.getIsAdministrator()); + List listVisible = null; + if (!visibleType) { + List id = flowEngineVisibleService.getVisibleFlowList(userInfo.getId()).stream().map(FlowEngineVisibleEntity::getFlowId).collect(Collectors.toList()); + //可见列表 + listVisible = flowTemplateJsonService.getListAll(id).stream().map(FlowTemplateJsonEntity::getTemplateId).collect(Collectors.toList()); + } + //判断委托人是否有发起权限 + if (StringUtil.isNotEmpty(item.getFlowId())) { + List strings = Arrays.asList(item.getFlowId().split(",")); + if (strings.contains(templateId) && listVisible.contains(templateId)) { + userName.add(userInfo); + } + } else { + if (listVisible.contains(templateId)) { + userName.add(userInfo); + } + } + } + List userIdAll = userName.stream().map(UserEntity::getId).collect(Collectors.toList()); + Map> userMap = serviceUtil.getListByUserIdAll(userIdAll).stream().filter(t -> PermissionConst.ORGANIZE.equals(t.getObjectType())).collect(Collectors.groupingBy(UserRelationEntity::getUserId)); + List jsonToList = new ArrayList<>(); + for (UserEntity entity : userName) { + List listByUserId = userMap.get(entity.getId()) != null ? userMap.get(entity.getId()) : new ArrayList<>(); + StringJoiner joiner = new StringJoiner(","); + for (UserRelationEntity relation : listByUserId) { + List organizeId = serviceUtil.getOrganizeId(relation.getObjectId()); + if (organizeId.size() > 0) { + String organizeName = organizeId.stream().map(OrganizeEntity::getFullName).collect(Collectors.joining("/")); + joiner.add(organizeName); + } + } + FlowCandidateUserModel vo = JsonUtil.getJsonToBean(entity, FlowCandidateUserModel.class); + vo.setFullName(entity.getRealName() + "/" + entity.getAccount()); + vo.setHeadIcon(UploaderUtil.uploaderImg(entity.getHeadIcon())); + vo.setOrganize(joiner.toString()); + jsonToList.add(vo); + } + if (jsonToList.size() == 0) { + throw new WorkFlowException(MsgCode.WF029.get()); + } + ListVO vo = new ListVO<>(); + vo.setList(jsonToList); + return vo; + } + + /** + * 获取当前用户所有发起委托列表 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/10/17 + */ + private List getLaunchDelagateList() { + String userId = UserProvider.getUser().getUserId(); + Date thisTime = DateUtil.getNowDate(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowDelegateEntity::getToUserId, userId); + queryWrapper.lambda().le(FlowDelegateEntity::getStartTime, thisTime).ge(FlowDelegateEntity::getEndTime, thisTime); + queryWrapper.lambda().like(FlowDelegateEntity::getType, 0); + List list = this.baseMapper.selectList(queryWrapper);//全部发起委托 + return list; + } + + @Override + public List selectSameParamAboutDelaget(FlowDelegateCrForm model) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowDelegateEntity::getUserId, model.getUserId()); + queryWrapper.lambda().eq(FlowDelegateEntity::getToUserId, model.getToUserId()); + queryWrapper.lambda().eq(FlowDelegateEntity::getType, model.getType()); + queryWrapper.lambda().gt(FlowDelegateEntity::getEndTime, new Date()); + List list = this.list(queryWrapper); + return list; + } +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowDynamicServiceImpl.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowDynamicServiceImpl.java new file mode 100644 index 0000000..07a2dea --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowDynamicServiceImpl.java @@ -0,0 +1,116 @@ +package com.yunzhupaas.engine.service.impl; + +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.engine.entity.FlowTemplateEntity; +import com.yunzhupaas.engine.entity.FlowTemplateJsonEntity; +import com.yunzhupaas.engine.enums.FlowStatusEnum; +import com.yunzhupaas.engine.model.flowbefore.FlowTemplateAllModel; +import com.yunzhupaas.engine.model.flowengine.FlowModel; +import com.yunzhupaas.engine.model.flowengine.shuntjson.childnode.ChildNode; +import com.yunzhupaas.engine.service.FlowDynamicService; +import com.yunzhupaas.engine.service.FlowTaskNewService; +import com.yunzhupaas.engine.util.FlowContextHolder; +import com.yunzhupaas.engine.util.FlowTaskUtil; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.base.model.flow.FlowFormDataModel; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.util.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +/** + * 在线开发工作流 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:19 + */ +@Slf4j +@Service +public class FlowDynamicServiceImpl implements FlowDynamicService { + + + @Autowired + public ServiceAllUtil serviceUtil; + @Autowired + private FlowTaskUtil flowTaskUtil; + @Autowired + private FlowTaskNewService flowTaskNewService; + + @Override + public void flowTask(FlowModel flowModel, FlowStatusEnum flowStatus, ChildNode childNode) throws WorkFlowException { + Map formData = flowModel.getFormData(); + String id = flowModel.getProcessId(); + Map map = flowModel.getFormData(); + formData.put(FlowFormConstant.FLOWID, flowModel.getFlowId()); + String formId = childNode.getProperties().getFormId(); + List> formOperates = childNode.getProperties().getFormOperates(); + FlowFormDataModel formDataModel = FlowFormDataModel.builder(). + formId(formId).id(id).delegateUser(serviceUtil.getUserInfo(flowModel.getUserId())). + map(map).formOperates(formOperates).build(); + switch (flowStatus) { + case save: + flowTaskNewService.save(flowModel); + serviceUtil.createOrUpdate(formDataModel); + break; + case submit: + FlowContextHolder.addData(formId, formData); + FlowContextHolder.addChildData(id, formId, formData); + FlowContextHolder.addFormOperates(id, formId, formOperates); + flowTaskNewService.submitAll(flowModel); + break; + case none: + serviceUtil.createOrUpdate(formDataModel); + break; + default: + break; + } + } + + @Override + public void createOrUpdate(FlowModel flowModel) throws WorkFlowException { + FlowTemplateAllModel model = flowTaskUtil.templateJson(flowModel.getFlowId()); + FlowTemplateJsonEntity templateJson = model.getTemplateJson(); + FlowTemplateEntity template = model.getTemplate(); + ChildNode childNode = JsonUtil.getJsonToBean(templateJson.getFlowTemplateJson(), ChildNode.class); + FlowStatusEnum statusEnum = FlowStatusEnum.submit.getMessage().equals(flowModel.getStatus()) ? FlowStatusEnum.submit : + template.getType() == 0 ? FlowStatusEnum.save : FlowStatusEnum.none; + flowTask(flowModel, statusEnum, childNode); + } + + @Override + @DSTransactional + public void batchCreateOrUpdate(FlowModel flowModel) throws WorkFlowException { + UserInfo userInfo = flowModel.getUserInfo(); + List batchUserId = flowModel.getDelegateUserList(); + boolean isBatchUser = batchUserId.size() == 0; + if (isBatchUser) { + batchUserId.add(userInfo.getUserId()); + } + for (String id : batchUserId) { + FlowModel model = JsonUtil.getJsonToBean(flowModel, FlowModel.class); + model.setDelegateUser(isBatchUser ? model.getDelegateUser() : userInfo.getUserId()); + model.setProcessId(StringUtil.isNotEmpty(model.getId()) ? model.getId() : RandomUtil.uuId()); + if (!isBatchUser) { + UserEntity userEntity = serviceUtil.getUserInfo(id); + if (userEntity != null) { + UserInfo info = new UserInfo(); + info.setUserName(userEntity.getRealName()); + info.setUserId(userEntity.getId()); + model.setUserInfo(info); + } + } + model.setUserId(id); + createOrUpdate(model); + } + } + + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowEngineVisibleServiceImpl.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowEngineVisibleServiceImpl.java new file mode 100644 index 0000000..8e28152 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowEngineVisibleServiceImpl.java @@ -0,0 +1,102 @@ +package com.yunzhupaas.engine.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.google.common.collect.ImmutableList; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.engine.entity.FlowEngineVisibleEntity; +import com.yunzhupaas.engine.mapper.FlowEngineVisibleMapper; +import com.yunzhupaas.engine.model.flowtask.FlowAssistModel; +import com.yunzhupaas.engine.service.FlowEngineVisibleService; +import com.yunzhupaas.permission.entity.UserRelationEntity; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.ServiceAllUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 流程可见 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Service +public class FlowEngineVisibleServiceImpl extends SuperServiceImpl implements FlowEngineVisibleService { + + @Autowired + private ServiceAllUtil serviceUtil; + + @Override + public List getList(List flowIdList) { + List list = new ArrayList<>(); + if (flowIdList.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(FlowEngineVisibleEntity::getFlowId, flowIdList); + queryWrapper.lambda().orderByAsc(FlowEngineVisibleEntity::getSortCode).orderByDesc(FlowEngineVisibleEntity::getCreatorTime); + list.addAll(this.list(queryWrapper)); + } + return list; + } + + @Override + public List getList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + return this.list(queryWrapper); + } + + @Override + public List getVisibleFlowList(String userId) { + return getVisibleFlowList(userId, 1); + } + + @Override + public List getVisibleFlowList(String userId, Integer type) { + List userRelationList = serviceUtil.getListByUserIdAll(ImmutableList.of(userId)).stream().map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + userRelationList.add(userId); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().in(FlowEngineVisibleEntity::getOperatorId, userRelationList); + wrapper.lambda().eq(FlowEngineVisibleEntity::getType, type); + List flowList = this.list(wrapper); + return flowList; + } + + @Override + public void deleteVisible(String flowId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowEngineVisibleEntity::getFlowId, flowId); + this.remove(queryWrapper); + } + + @Override + public void assistList(FlowAssistModel assistModel) { + List assistListAll = this.getList(ImmutableList.of(assistModel.getTemplateId())); + for (FlowEngineVisibleEntity entity : assistListAll) { + this.removeById(entity.getId()); + } + List list = assistModel.getList(); + List visibleList = new ArrayList<>(); + for (String idAll : list) { + String[] id = idAll.split("--"); + String operatorId = id[0]; + String type = id.length > 1 ? id[1] : "user"; + FlowEngineVisibleEntity visible = new FlowEngineVisibleEntity(); + visible.setOperatorId(operatorId); + visible.setOperatorType(type); + visible.setType(2); + visibleList.add(visible); + } + for (int i = 0; i < visibleList.size(); i++) { + FlowEngineVisibleEntity visibleEntity = visibleList.get(i); + visibleEntity.setId(RandomUtil.uuId()); + visibleEntity.setFlowId(assistModel.getTemplateId()); + visibleEntity.setSortCode(Long.parseLong(i + "")); + this.save(visibleEntity); + } + } +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowEventLogServiceImpl.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowEventLogServiceImpl.java new file mode 100644 index 0000000..0260582 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowEventLogServiceImpl.java @@ -0,0 +1,39 @@ +package com.yunzhupaas.engine.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.engine.entity.FlowEventLogEntity; +import com.yunzhupaas.engine.mapper.FlowEventLogMapper; +import com.yunzhupaas.engine.service.FlowEventLogService; +import com.yunzhupaas.util.RandomUtil; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 流程事件日志 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Service +public class FlowEventLogServiceImpl extends SuperServiceImpl implements FlowEventLogService { + + + @Override + public void create(FlowEventLogEntity entity) { + entity.setId(RandomUtil.uuId()); + this.save(entity); + } + + @Override + public List getList(List nodeIdList) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (nodeIdList.size() > 0) { + queryWrapper.lambda().in(FlowEventLogEntity::getTaskNodeId, nodeIdList); + } + return this.list(queryWrapper); + } +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowOperatorUserServiceImpl.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowOperatorUserServiceImpl.java new file mode 100644 index 0000000..4e8fc47 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowOperatorUserServiceImpl.java @@ -0,0 +1,88 @@ +package com.yunzhupaas.engine.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.engine.entity.FlowOperatorUserEntity; +import com.yunzhupaas.engine.mapper.FlowOperatorUserMapper; +import com.yunzhupaas.engine.service.FlowOperatorUserService; +import com.yunzhupaas.util.RandomUtil; +import com.yunzhupaas.util.StringUtil; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Set; + +/** + * 流程依次审批 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Service +public class FlowOperatorUserServiceImpl extends SuperServiceImpl implements FlowOperatorUserService { + + @Override + public List getList(String taskId) { + return getTaskList(taskId, null); + } + + @Override + public FlowOperatorUserEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowOperatorUserEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public List getTaskList(String taskId, String taskNodeId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StringUtil.isNotEmpty(taskId)) { + queryWrapper.lambda().eq(FlowOperatorUserEntity::getTaskId, taskId); + } + if (StringUtil.isNotEmpty(taskNodeId)) { + queryWrapper.lambda().eq(FlowOperatorUserEntity::getTaskNodeId, taskNodeId); + } + queryWrapper.lambda().orderByAsc(FlowOperatorUserEntity::getSortCode); + return this.list(queryWrapper); + } + + @Override + public void create(List list) { + for (FlowOperatorUserEntity entity : list) { + entity.setId(RandomUtil.uuId()); + this.save(entity); + } + } + + @Override + public void update(String id, FlowOperatorUserEntity entity) { + entity.setId(id); + this.updateById(entity); + } + + @Override + public void delete(FlowOperatorUserEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + + @Override + public void deleteByTaskId(String taskId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowOperatorUserEntity::getTaskId, taskId); + this.remove(queryWrapper); + } + + @Override + public void updateReject(String taskId, Set taskNodeId) { + if (taskNodeId.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowOperatorUserEntity::getTaskId, taskId); + queryWrapper.lambda().in(FlowOperatorUserEntity::getTaskNodeId, taskNodeId); + this.remove(queryWrapper); + } + } +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowRejectDataDataServiceImpl.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowRejectDataDataServiceImpl.java new file mode 100644 index 0000000..b204eb1 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowRejectDataDataServiceImpl.java @@ -0,0 +1,49 @@ +package com.yunzhupaas.engine.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.engine.entity.FlowRejectDataEntity; +import com.yunzhupaas.engine.mapper.FlowRejectDataMapper; +import com.yunzhupaas.engine.service.FlowRejectDataService; +import com.yunzhupaas.util.RandomUtil; +import org.springframework.stereotype.Service; + +/** + * 冻结审批 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-29 上午9:18 + */ +@Service +public class FlowRejectDataDataServiceImpl extends SuperServiceImpl implements FlowRejectDataService { + + @Override + public void createOrUpdate(FlowRejectDataEntity rejectEntity) { + this.saveOrUpdate(rejectEntity); + } + + @Override + public void create(FlowRejectDataEntity rejectEntity) { + if (rejectEntity.getId() == null) { + rejectEntity.setId(RandomUtil.uuId()); + } + this.save(rejectEntity); + } + + @Override + public void update(String id, FlowRejectDataEntity rejectEntity) { + rejectEntity.setId(id); + this.updateById(rejectEntity); + } + + @Override + public FlowRejectDataEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowRejectDataEntity::getId, id); + return this.getOne(queryWrapper); + } + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowTaskCirculateServiceImpl.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowTaskCirculateServiceImpl.java new file mode 100644 index 0000000..22130bf --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowTaskCirculateServiceImpl.java @@ -0,0 +1,44 @@ +package com.yunzhupaas.engine.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.engine.entity.FlowTaskCirculateEntity; +import com.yunzhupaas.engine.mapper.FlowTaskCirculateMapper; +import com.yunzhupaas.engine.service.FlowTaskCirculateService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 流程传阅 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Service +public class FlowTaskCirculateServiceImpl extends SuperServiceImpl implements FlowTaskCirculateService { + + @Override + public void deleteByTaskId(String taskId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowTaskCirculateEntity::getTaskId, taskId); + this.remove(queryWrapper); + } + + @Override + public void create(List entitys) { + for (FlowTaskCirculateEntity entity : entitys) { + this.save(entity); + } + } + + @Override + public List getList(String taskId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowTaskCirculateEntity::getTaskId, taskId); + return this.list(queryWrapper); + } +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowTaskNewServiceImpl.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowTaskNewServiceImpl.java new file mode 100644 index 0000000..22ee29b --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowTaskNewServiceImpl.java @@ -0,0 +1,2257 @@ +package com.yunzhupaas.engine.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.google.common.collect.ImmutableList; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.constant.PermissionConst; +import com.yunzhupaas.engine.entity.*; +import com.yunzhupaas.engine.enums.*; +import com.yunzhupaas.engine.model.flowbefore.*; +import com.yunzhupaas.engine.model.flowcandidate.FlowCandidateListModel; +import com.yunzhupaas.engine.model.flowcandidate.FlowCandidateUserModel; +import com.yunzhupaas.engine.model.flowcandidate.FlowCandidateVO; +import com.yunzhupaas.engine.model.flowcandidate.FlowRejectVO; +import com.yunzhupaas.engine.model.flowdelegate.FlowDelegateModel; +import com.yunzhupaas.engine.model.flowengine.*; +import com.yunzhupaas.engine.model.flowengine.shuntjson.childnode.ChildNode; +import com.yunzhupaas.engine.model.flowengine.shuntjson.childnode.LimitModel; +import com.yunzhupaas.engine.model.flowengine.shuntjson.childnode.Properties; +import com.yunzhupaas.engine.model.flowengine.shuntjson.nodejson.ChildNodeList; +import com.yunzhupaas.engine.model.flowengine.shuntjson.nodejson.ConditionList; +import com.yunzhupaas.engine.model.flowengine.shuntjson.nodejson.Custom; +import com.yunzhupaas.engine.model.flowmessage.FlowMsgModel; +import com.yunzhupaas.engine.model.flowmessage.FlowParameterModel; +import com.yunzhupaas.engine.model.flowtask.*; +import com.yunzhupaas.engine.model.flowtask.method.TaskHandleIdStatus; +import com.yunzhupaas.engine.model.flowtask.method.TaskOperatoUser; +import com.yunzhupaas.engine.model.flowtask.method.TaskOperator; +import com.yunzhupaas.engine.model.flowtasknode.TaskNodeListModel; +import com.yunzhupaas.engine.service.*; +import com.yunzhupaas.engine.util.*; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.job.WorkTimeoutJobUtil; +import com.yunzhupaas.base.model.flow.FlowFormDataModel; +import com.yunzhupaas.engine.model.flowbefore.FlowFormVo; +import com.yunzhupaas.permission.entity.*; +import com.yunzhupaas.util.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 流程引擎 + * + * @author 云筑产品开发平台组 + * @version V3.2.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年4月27日 上午9:18 + */ +@Service +@Slf4j +public class FlowTaskNewServiceImpl implements FlowTaskNewService { + + @Autowired + private ServiceAllUtil serviceUtil; + @Autowired + private FlowUserService flowUserService; + @Autowired + private FlowCandidatesService flowCandidatesService; + @Autowired + private FlowTaskNodeService flowTaskNodeService; + @Autowired + private FlowTaskOperatorService flowTaskOperatorService; + @Autowired + private FlowTaskOperatorRecordService flowTaskOperatorRecordService; + @Autowired + private FlowTaskCirculateService flowTaskCirculateService; + @Autowired + private FlowRejectDataService flowRejectDataService; + @Autowired + private FlowTaskService flowTaskService; + @Autowired + private FlowTaskUtil flowTaskUtil; + @Autowired + private RedisUtil redisUtil; + @Autowired + private FlowOperatorUserService flowOperatorUserService; + @Autowired + private FlowMsgUtil flowMsgUtil; + @Autowired + private FlowEventLogService flowEventLogService; + @Autowired + private FlowDelegateService flowDelegateService; + @Lazy + @Autowired + private WorkTimeoutJobUtil workTimeoutJobUtil; + + + + @Override + public FlowTaskEntity saveIsAdmin(FlowModel flowModel) throws WorkFlowException { + FlowTaskEntity entity = save(flowModel); + return entity; + } + + @Override + @DSTransactional + public FlowTaskEntity save(FlowModel flowModel) throws WorkFlowException { + String flowId = flowModel.getFlowId(); + UserInfo userInfo = flowModel.getUserInfo(); + flowModel.setStatus(StringUtil.isNotEmpty(flowModel.getStatus()) ? flowModel.getStatus() : FlowStatusEnum.save.getMessage()); + flowModel.setUserId(StringUtil.isNotEmpty(flowModel.getUserId()) ? flowModel.getUserId() : userInfo.getUserId()); + //流程引擎 + FlowTemplateAllModel templateAllModel = flowTaskUtil.templateJson(flowId); + FlowTemplateJsonEntity templateJson = templateAllModel.getTemplateJson(); + FlowTemplateEntity template = templateAllModel.getTemplate(); + FlowTaskEntity infoSubmit = flowTaskService.getInfoSubmit(flowModel.getProcessId(), + FlowTaskEntity::getStatus, FlowTaskEntity::getCreatorUserId, FlowTaskEntity::getIsAsync, + FlowTaskEntity::getSystemId, FlowTaskEntity::getFullName, FlowTaskEntity::getParentId, + FlowTaskEntity::getId, FlowTaskEntity::getRejectId + ); + boolean isTask = infoSubmit != null; + String fullName = templateJson.getFullName(); + //流程实例 + String flowTitle = StringUtil.isNotEmpty(flowModel.getFlowTitle()) ? flowModel.getFlowTitle() : userInfo.getUserName() + "的" + fullName; + FlowTaskEntity flowTaskEntity = new FlowTaskEntity(); + flowTaskEntity.setParentId(flowModel.getParentId()); + flowTaskEntity.setIsAsync(FlowNature.ChildSync); + flowTaskEntity.setFullName(flowTitle); + flowTaskEntity.setStatus(FlowTaskStatusEnum.Draft.getCode()); + flowTaskEntity.setSystemId(flowModel.getSystemId()); + FlowTaskEntity taskEntity = isTask ? infoSubmit : flowTaskEntity; + if (isTask) { + //判断流程是否处于挂起状态 + flowTaskUtil.isSuspend(taskEntity); + flowModel.setStatus(FlowStatusEnum.save.getMessage().equals(flowModel.getStatus()) ? FlowStatusEnum.none.getMessage() : flowModel.getStatus()); + flowModel.setUserId(taskEntity.getCreatorUserId()); + flowModel.setIsAsync(FlowNature.ChildAsync.equals(taskEntity.getIsAsync())); + flowModel.setSystemId(taskEntity.getSystemId()); + flowTitle = taskEntity.getFullName(); + } + if (!FlowNature.ParentId.equals(taskEntity.getParentId())) { + flowModel.setParentId(taskEntity.getParentId()); + flowTitle = taskEntity.getFullName(); + } + ChildNode childNodeAll = JsonUtil.getJsonToBean(templateJson.getFlowTemplateJson(), ChildNode.class); + Properties properties = childNodeAll.getProperties(); + Map data = flowModel.getFormData() != null ? flowModel.getFormData() : new HashMap<>(); + data.put(FlowConstant.FLOW_FULL_NAME, fullName); + data.put(FlowConstant.FLOW_FULL_CODE, template.getEnCode()); + data.put(FlowConstant.LAUNCH_USER_NAME, userInfo.getUserName()); + data.put(FlowConstant.LAUNCH_TIME, DateUtil.daFormat(new Date())); + if (!FlowNature.TitleType.equals(properties.getTitleType())) { + flowTitle = FlowJsonUtil.field(properties.getTitleContent(), data, "1"); + flowTitle += !FlowNature.ParentId.equals(flowModel.getParentId()) ? "(子流程)" : ""; + } + flowModel.setFlowTitle(flowTitle); + flowTaskUtil.task(taskEntity, templateAllModel, flowModel); + //更新流程任务 + if (isTask) { + flowTaskService.update(taskEntity); + } else { + flowTaskService.create(taskEntity); + } + return taskEntity; + } + + @Override + public void submit(FlowModel flowModel) throws WorkFlowException { + UserInfo userInfo = flowModel.getUserInfo(); + flowModel.setStatus(FlowStatusEnum.submit.getMessage()); + //流程节点 + List taskNodeList = new ArrayList<>(); + List nodeListAll = new ArrayList<>(); + //流程经办 + List operatorList = new ArrayList<>(); + FlowTaskEntity flowTask = save(flowModel); + //流程表单Json + FlowTemplateAllModel templateAllModel = flowTaskUtil.templateJson(flowTask.getFlowId()); + boolean isRejectId = StringUtil.isEmpty(flowTask.getRejectId()); + if (isRejectId) { + //发起用户信息 + flowTaskUtil.flowUser(flowTask); + flowTask.setStartTime(new Date()); + flowModel.setTaskOperatorId(FlowNature.ParentId); + String formDataJson = templateAllModel.getTemplateJson().getFlowTemplateJson(); + ChildNode childNodeAll = JsonUtil.getJsonToBean(formDataJson, ChildNode.class); + //获取流程节点 + List conditionListAll = new ArrayList<>(); + FlowUpdateNode updateNode = FlowUpdateNode.builder().childNodeAll(childNodeAll).nodeListAll(nodeListAll).taskNodeList(taskNodeList).conditionListAll(conditionListAll).flowTask(flowTask).userInfo(userInfo).isSubmit(true).build(); + flowTaskUtil.updateNodeList(updateNode); + //保存节点数据 + FlowTaskNodeEntity startNode = taskNodeList.stream().filter(t -> FlowNature.NodeStart.equals(t.getNodeType())).findFirst().get(); + FlowTaskOperatorEntity operatorEntity = new FlowTaskOperatorEntity(); + operatorEntity.setId(FlowNature.ParentId); + operatorEntity.setNodeCode(startNode.getNodeCode()); + FlowNodeListModel nodeListModel = new FlowNodeListModel(taskNodeList, flowModel, true, startNode, 1L); + flowTaskUtil.nodeListAll(nodeListModel); + } else { + FlowRejectDataEntity info = flowRejectDataService.getInfo(flowTask.getRejectId()); + List list = flowTaskNodeService.getList(flowTask.getId(), + FlowTaskNodeEntity::getId, FlowTaskNodeEntity::getNodePropertyJson + ); + List rejectTaskNodeList = JsonUtil.getJsonToList(info.getTaskNodeJson(), FlowTaskNodeEntity.class); + for (FlowTaskNodeEntity taskNodeEntity : rejectTaskNodeList) { + flowTaskNodeService.update(taskNodeEntity); + for (FlowTaskNodeEntity model : list) { + if (model.getId().equals(taskNodeEntity.getId())) { + taskNodeEntity.setNodePropertyJson(model.getNodePropertyJson()); + } + } + } + TaskNodeListModel taskNodeListModel = TaskNodeListModel.builder().id(flowTask.getId()).state(FlowNodeEnum.Process.getCode()).build(); + List rejectTaskNode = flowTaskNodeService.getList(taskNodeListModel, + FlowTaskNodeEntity::getId, FlowTaskNodeEntity::getNodeType, FlowTaskNodeEntity::getNodePropertyJson + ); + for (FlowTaskNodeEntity taskNodeEntity : rejectTaskNode) { + nodeListAll.add(JsonUtil.getJsonToBean(taskNodeEntity.getNodePropertyJson(), ChildNodeList.class)); + taskNodeList.add(taskNodeEntity); + } + FlowTaskEntity jsonToBean = JsonUtil.getJsonToBean(info.getTaskJson(), FlowTaskEntity.class); + flowTask.setStatus(jsonToBean.getStatus()); + flowTask.setThisStep(jsonToBean.getThisStep()); + flowTask.setThisStepId(jsonToBean.getThisStepId()); + flowTask.setCompletion(jsonToBean.getCompletion()); + //还原审批数据状态 + List operatorEntityList = JsonUtil.getJsonToList(info.getTaskOperatorJson(), FlowTaskOperatorEntity.class); + for (FlowTaskOperatorEntity flowTaskOperatorEntity : operatorEntityList) { + flowTaskOperatorService.update(flowTaskOperatorEntity); + } + //冻结数据传递 + FlowTaskNodeEntity startNode = taskNodeList.stream().filter(t -> FlowNature.NodeStart.equals(t.getNodeType())).findFirst().get(); + flowTaskUtil.dataAssignment(startNode.getId(), rejectTaskNodeList, flowModel); + } + FlowTaskNodeEntity startNode = taskNodeList.stream().filter(t -> FlowNature.NodeStart.equals(t.getNodeType())).findFirst().get(); + ChildNodeList start = JsonUtil.getJsonToBean(startNode.getNodePropertyJson(), ChildNodeList.class); + //开始表单数据 + FlowDataModel startDataModel = new FlowDataModel(start, taskNodeList, flowModel, true, true); + flowTaskUtil.createOrUpdate(startDataModel); + //审批记录 + FlowTaskOperatorEntity operator = new FlowTaskOperatorEntity(); + operator.setTaskId(flowTask.getId()); + operator.setTaskNodeId(startNode.getId()); + operator.setNodeCode(startNode.getNodeCode()); + FlowTaskOperatorRecordEntity operatorRecord = new FlowTaskOperatorRecordEntity(); + //审批数据赋值 + if (isRejectId) { + FlowOperatordModel flowOperatordModel = FlowOperatordModel.builder().status(FlowRecordEnum.submit.getCode()).flowModel(flowModel).userId(userInfo.getUserId()).operator(operator).build(); + flowTaskUtil.operatorRecord(operatorRecord, flowOperatordModel); + flowTaskUtil.createRecord(operatorRecord); + } + List nodeList = new ArrayList<>(); + nodeList.addAll(isRejectId ? Arrays.asList(startNode.getNodeNext().split(",")) : Arrays.asList(flowTask.getThisStepId().split(","))); + //获取下一审批人 + List nextOperatorList = nodeListAll.stream().filter(t -> nodeList.contains(t.getCustom().getNodeId())).collect(Collectors.toList()); + Map> asyncTaskList = new HashMap<>(); + Map> nodeTaskIdList = new HashMap<>(); + FlowOperator flowOperator = FlowOperator.builder().operatorListAll(operatorList).flowModel(flowModel).flowTask(flowTask).nodeList(nextOperatorList).taskNodeListAll(taskNodeList).userInfo(userInfo).asyncTaskList(asyncTaskList).nodeTaskIdList(nodeTaskIdList).build(); + flowTaskUtil.nextOperator(flowOperator); + Map> operatorMap = operatorList.stream().collect(Collectors.groupingBy(FlowTaskOperatorEntity::getTaskNodeId)); + for (ChildNodeList childNodeList : nextOperatorList) { + Properties properties = childNodeList.getProperties(); + boolean counterSign = FlowNature.ImproperApprover.equals(properties.getCounterSign()); + if (counterSign && StringUtil.isEmpty(flowModel.getFreeApproverUserId())) { + List listAll = operatorMap.get(childNodeList.getTaskNodeId()) != null ? operatorMap.get(childNodeList.getTaskNodeId()) : new ArrayList<>(); + flowOperatorUserService.updateReject(flowTask.getId(), new HashSet() {{ + add(childNodeList.getTaskNodeId()); + }}); + flowOperatorUserService.create(JsonUtil.getJsonToList(listAll, FlowOperatorUserEntity.class)); + } + FlowDataModel flowDataModel = new FlowDataModel(childNodeList, taskNodeList, flowModel, true, true); + flowTaskUtil.createOrUpdate(flowDataModel); + } + //过滤依次审批人 + flowTaskUtil.improperApproverUser(operatorList, taskNodeList, start, null); + //定时器 + FlowTaskOperatorEntity startOperator = new FlowTaskOperatorEntity(); + startOperator.setTaskId(start.getTaskId()); + startOperator.setTaskNodeId(start.getTaskNodeId()); + if (isRejectId) { + flowTaskUtil.timer(startOperator, taskNodeList, operatorList); + } + flowTaskOperatorService.create(operatorList); + //更新关联同步子流程id + for (String nodeId : nodeTaskIdList.keySet()) { + FlowTaskNodeEntity entity = taskNodeList.stream().filter(t -> t.getId().equals(nodeId)).findFirst().orElse(null); + if (entity != null) { + ChildNodeList childNodeList = JsonUtil.getJsonToBean(entity.getNodePropertyJson(), ChildNodeList.class); + childNodeList.getCustom().setTaskId(nodeTaskIdList.get(nodeId)); + entity.setNodePropertyJson(JsonUtil.getObjectToString(childNodeList)); + flowTaskNodeService.updateTaskIdList(entity); + } + } + //更新关联异步子流程id + for (String nodeId : asyncTaskList.keySet()) { + FlowTaskNodeEntity entity = taskNodeList.stream().filter(t -> t.getId().equals(nodeId)).findFirst().orElse(null); + if (entity != null) { + ChildNodeList childNodeList = JsonUtil.getJsonToBean(entity.getNodePropertyJson(), ChildNodeList.class); + childNodeList.getCustom().setAsyncTaskList(asyncTaskList.get(nodeId)); + entity.setNodePropertyJson(JsonUtil.getObjectToString(childNodeList)); + flowTaskNodeService.updateTaskIdList(entity); + } + } + List circulateList = new ArrayList<>(); + //更新流程节点 + if (isRejectId) { + //修改选择分支没有走过的节点 + List nodeCodeList = nextOperatorList.stream().map(t -> t.getCustom().getNodeId()).collect(Collectors.toList()); + flowTaskUtil.branchTaskNode(nodeCodeList, taskNodeList, operatorList); + if (StringUtil.isEmpty(flowTask.getThisStepId())) { + flowTaskUtil.getNextStepId(nextOperatorList, flowTask, flowModel, taskNodeList); + } + boolean isEnd = nodeList.contains(FlowNature.NodeEnd); + if (isEnd) { + flowTaskUtil.endround(flowTask, nodeListAll.get(0), flowModel); + } + //保存节点数据 + if (Objects.equals(FlowNature.ResurgenceThis, start.getProperties().getResurgenceDataRule())) { + startNode.setDraftData(flowTask.getFlowFormContentJson()); + } + flowTaskNodeService.update(startNode); + //获取抄送人 + flowTaskUtil.circulateList(start, taskNodeList, circulateList, flowModel, flowTask); + flowTaskCirculateService.create(circulateList); + } + flowTask.setRejectId(null); + flowTaskService.update(flowTask); + //委托消息 + boolean approve = StringUtil.isNotEmpty(flowTask.getDelegateUser()); + if (approve) { + UserInfo approverUserInfo = JsonUtil.getJsonToBean(userInfo, UserInfo.class); + FlowDelegateModel delegate = new FlowDelegateModel(); + delegate.setToUserIds(ImmutableList.of(flowTask.getCreatorUserId())); + UserEntity userEntity = serviceUtil.getUserInfo(flowTask.getDelegateUser()); + approverUserInfo.setUserName(userEntity != null ? userEntity.getRealName() : ""); + delegate.setDelegate(false); + delegate.setUserInfo(approverUserInfo); + delegate.setFlowTask(flowTask); + delegate.setTemplateAllModel(templateAllModel); + delegate.setApprove(approve); + flowMsgUtil.delegateMsg(delegate); + } + if (isRejectId) { + //开始事件 + flowMsgUtil.event(1, start, operatorRecord, flowModel); + //自动审批 + FlowApproveModel approveModel = FlowApproveModel.builder().operatorList(operatorList).taskNodeList(taskNodeList).flowTask(flowTask).flowModel(flowModel).isSubmit(true).build(); + flowTaskUtil.approve(approveModel); + //发送消息 + FlowMsgModel flowMsgModel = new FlowMsgModel(); + flowMsgModel.setCirculateList(circulateList); + flowMsgModel.setNodeList(taskNodeList); + flowMsgModel.setOperatorList(operatorList); + flowMsgModel.setData(flowModel.getFormData()); + flowMsgModel.setFlowModel(flowModel); + flowMsgModel.setTaskEntity(flowTask); + flowMsgModel.setCopy(true); + flowMsgModel.setFlowTemplateAllModel(templateAllModel); + boolean isEnd = nodeList.contains(FlowNature.NodeEnd); + if (isEnd && isRejectId) { + flowMsgModel.setTaskNodeEntity(startNode); + } + flowMsgUtil.message(flowMsgModel); + //超时 + insTimeOutRedis(flowModel, operatorList, userInfo, flowTask, taskNodeList); + } + } + + @Override + @DSTransactional + public void submitAll(FlowModel flowModel) throws WorkFlowException { + try { + submit(flowModel); + //表单数据 + Map> childAllData = FlowContextHolder.getChildAllData(); + Map>> childAllOperates = FlowContextHolder.getFormOperates(); + for (String idAll : childAllData.keySet()) { + String[] idList = idAll.split("_yunzhupaas_"); + Map formData = childAllData.get(idAll); + List> formOperates = childAllOperates.get(idAll); + FlowFormDataModel model = FlowFormDataModel.builder().formId(idList[1]).id(idList[0]).map(formData).formOperates(formOperates).build(); + serviceUtil.createOrUpdate(model); + } + } finally { + List allEvent = FlowContextHolder.getAllEvent(); + if (allEvent.size() > 0) { + FlowModel cancelModel = new FlowModel(); + cancelModel.setUserInfo(flowModel.getUserInfo()); + flowTaskUtil.taskCancel(ImmutableList.of(flowModel.getProcessId()), cancelModel); + } + FlowContextHolder.clearAll(); + } + } + + @Override + public void audit(FlowTaskEntity flowTask, FlowTaskOperatorEntity operator, FlowModel flowModel) throws WorkFlowException { + UserInfo userInfo = flowModel.getUserInfo(); + //判断是否审批过 + if (!FlowNature.ProcessCompletion.equals(operator.getCompletion())) { + throw new WorkFlowException(MsgCode.WF031.get()); + } + //判断流程是否处于挂起状态 + flowTaskUtil.isSuspend(flowTask); + //主流程冻结,子流程结束报错 + if (StringUtil.isNotEmpty(flowTask.getRejectId()) && StringUtil.isEmpty(operator.getReject())) { + throw new WorkFlowException(MsgCode.WF032.get()); + } + FlowTemplateAllModel templateAllModel = flowTaskUtil.templateJson(flowTask.getFlowId()); + boolean before = FlowNature.Before.equals(flowModel.getFreeApproverType()); + //更新表单数据 + boolean isOperator = StringUtil.isNotEmpty(operator.getId()); + boolean isUser = StringUtil.isNotEmpty(flowModel.getFreeApproverUserId()); + boolean isReject = StringUtil.isEmpty(flowTask.getRejectId()); + flowModel.setTaskOperatorId(operator.getId()); + flowModel.setParentId(isUser ? operator.getId() : flowModel.getParentId()); + flowModel.setRollbackId(before ? operator.getId() : operator.getRollbackId()); + flowModel.setRejectUser(StringUtil.isNotEmpty(flowTask.getRejectId()) ? true : false); + FlowTaskNodeEntity flowTaskNode = flowTaskNodeService.getInfo(operator.getTaskNodeId(), + FlowTaskNodeEntity::getId, FlowTaskNodeEntity::getTaskId, FlowTaskNodeEntity::getFormId, FlowTaskNodeEntity::getNodeType, + FlowTaskNodeEntity::getNodePropertyJson, FlowTaskNodeEntity::getSortCode, FlowTaskNodeEntity::getNodeCode, + FlowTaskNodeEntity::getNodeNext, FlowTaskNodeEntity::getCandidates + ); + //自动审批获取最新表单数据 + Map formData = flowModel.getVoluntarily() ? flowTaskUtil.infoData(flowTaskNode.getFormId(), flowTask.getId()) : flowModel.getFormData(); + if (!FlowNature.NodeSubFlow.equals(flowTaskNode.getNodeType())) { + FlowContextHolder.addData(flowTaskNode.getFormId(), formData); + FlowContextHolder.addChildData(flowTask.getId(), flowTaskNode.getFormId(), formData); + ChildNodeList nodeModel = JsonUtil.getJsonToBean(flowTaskNode.getNodePropertyJson(), ChildNodeList.class); + List> formOperates = flowTaskUtil.formOperates(nodeModel); + FlowContextHolder.addFormOperates(flowTask.getId(), flowTaskNode.getFormId(), formOperates); + } + //todo + if (!flowModel.getIsAsync() && isReject) { + flowTaskUtil.auditTaskNode(templateAllModel, flowTask, flowTaskNode, flowModel); + } + //流程所有节点 + TaskNodeListModel taskNodeListModel = TaskNodeListModel.builder().id(flowTask.getId()).state(FlowNodeEnum.Process.getCode()).build(); + List taskNodeList = flowTaskNodeService.getList(taskNodeListModel, + FlowTaskNodeEntity::getFormId, FlowTaskNodeEntity::getNodeType, FlowTaskNodeEntity::getSortCode, + FlowTaskNodeEntity::getNodeCode, FlowTaskNodeEntity::getId, FlowTaskNodeEntity::getNodePropertyJson, + FlowTaskNodeEntity::getNodeNext, FlowTaskNodeEntity::getNodeName, FlowTaskNodeEntity::getCompletion, + FlowTaskNodeEntity::getTaskId, FlowTaskNodeEntity::getState, FlowTaskNodeEntity::getCandidates, + FlowTaskNodeEntity::getNodeUp + ); + //当前节点 + FlowTaskNodeEntity taskNode = taskNodeList.stream().filter(m -> m.getId().equals(operator.getTaskNodeId())).findFirst().orElse(null); + if (taskNode == null) { + throw new WorkFlowException(MsgCode.COD001.get()); + } + //加签回流 + if (!isUser) { + String rollbackId = StringUtil.isNotEmpty(operator.getRollbackId()) ? operator.getRollbackId() : RandomUtil.uuId(); + FlowTaskOperatorEntity operatorInfo = flowTaskOperatorService.getOperatorInfo(rollbackId); + if (operatorInfo != null) { + FlowModel rollbackModel = new FlowModel(); + rollbackModel.setUserInfo(flowModel.getUserInfo()); + rollbackModel.setTaskOperatorId(flowModel.getTaskOperatorId()); + rollbackModel.setParentId(flowModel.getTaskOperatorId()); + rollbackModel.setCopyIds(flowModel.getCopyIds()); + rollbackModel.setFileList(flowModel.getFileList()); + rollbackModel.setHandleOpinion(flowModel.getHandleOpinion()); + rollbackModel.setSignImg(flowModel.getSignImg()); + rollbackModel.setRejectUser(flowModel.getRejectUser()); + rollbackModel.setFormData(flowModel.getFormData()); + flowModel = JsonUtil.getJsonToBean(rollbackModel, FlowModel.class); + flowModel.setFreeApproverUserId(operatorInfo.getHandleId()); + flowModel.setRollbackId(operatorInfo.getRollbackId()); + flowModel.setFreeApproverType(FlowNature.Reflux); + flowModel.setTaskOperatorId(FlowNature.ParentId.equals(operatorInfo.getParentId()) ? FlowNature.ParentId : flowModel.getTaskOperatorId()); + } + } + String userId = StringUtil.isNotEmpty(flowModel.getUserId()) ? flowModel.getUserId() : userInfo.getUserId(); + //当前节点属性 + ChildNodeList nodeModel = JsonUtil.getJsonToBean(taskNode.getNodePropertyJson(), ChildNodeList.class); + //修改或签、会签经办数据 + TaskHandleIdStatus handleIdStatus = new TaskHandleIdStatus(); + handleIdStatus.setStatus(1); + handleIdStatus.setNodeModel(nodeModel); + handleIdStatus.setUserInfo(userInfo); + handleIdStatus.setTaskNodeList(taskNodeList); + handleIdStatus.setFlowModel(flowModel); + flowTaskUtil.handleIdStatus(operator, handleIdStatus); + //更新流当前程经办状态 + if (isOperator) { + operator.setState(StringUtil.isNotEmpty(flowModel.getFreeApproverUserId()) ? FlowNodeEnum.FreeApprover.getCode() : operator.getState()); + flowTaskOperatorService.update(operator); + } + //更新下一节点 + List operatorList = new ArrayList<>(); + //获取下一审批人 + List nextNode = taskNodeList.stream().filter(t -> taskNode.getNodeNext().contains(t.getNodeCode())).collect(Collectors.toList()); + //判断转向节点是否错误 + String msg = ""; + List flowTaskNodeEntities = JsonUtil.getJsonToList(taskNodeList, FlowTaskNodeEntity.class); + flowTaskUtil.nodeList(flowTaskNodeEntities); + List nextNodeCode = nextNode.stream().map(FlowTaskNodeEntity::getNodeCode).collect(Collectors.toList()); + boolean isNotNode = flowTaskNodeEntities.stream().filter(t -> nextNodeCode.contains(t.getNodeCode())).count() == 0; + if (isNotNode) { + nextNodeCode.add(taskNode.getNodeNext()); + TaskNodeListModel taskNodeModel = TaskNodeListModel.builder().id(flowTask.getId()).build(); + List nodeList = flowTaskNodeService.getList(taskNodeModel, FlowTaskNodeEntity::getId, FlowTaskNodeEntity::getNodeCode); + boolean isErrorNode = nodeList.stream().filter(t -> nextNodeCode.contains(t.getNodeCode())).count() == 0; + msg = isErrorNode ? MsgCode.WF033.get() : MsgCode.WF034.get(); + nextNode.add(taskNode); + } + List nextOperatorList = new ArrayList<>(); + FlowNextModel flowNextModel = FlowNextModel.builder().nodeListAll(taskNodeList).nextNodeEntity(nextNode).taskNode(taskNode).flowModel(flowModel).isCountersign(false).build(); + List result = flowTaskUtil.isNextAll(flowNextModel); + flowTaskUtil.candidateList(flowModel, taskNodeList, operator); + if (result.size() > 0) { + if (StringUtil.isNotEmpty(msg)) { + throw new WorkFlowException(msg); + } + boolean freeApproverUserId = StringUtil.isEmpty(flowModel.getFreeApproverUserId()); + if (freeApproverUserId && !isReject) { + FlowRejectDataEntity info = flowRejectDataService.getInfo(flowTask.getRejectId()); + FlowTaskEntity jsonToBean = JsonUtil.getJsonToBean(info.getTaskJson(), FlowTaskEntity.class); + jsonToBean.setRejectId(null); + flowTask.setRejectId(null); + flowModel.setRejectUser(false); + flowTaskService.update(jsonToBean); + Set rejectNodeList = new HashSet<>(); + List rejectList = new ArrayList() {{ + add(operator.getTaskNodeId()); + }}; + List thisStepId = Arrays.asList(jsonToBean.getThisStepId().split(",")); + List rejectTaskNodeList = JsonUtil.getJsonToList(info.getTaskNodeJson(), FlowTaskNodeEntity.class); + for(FlowTaskNodeEntity nodeEntity :rejectTaskNodeList){ + FlowTaskNodeEntity node = taskNodeList.stream().filter(t->t.getNodeCode().equals(nodeEntity.getNodeCode())).findFirst().orElse(null); + if(node!=null){ + nodeEntity.setNodePropertyJson(node.getNodePropertyJson()); + } + } + flowTaskUtil.upAll(rejectNodeList, rejectList, rejectTaskNodeList); + for (FlowTaskNodeEntity taskNodeEntity : rejectTaskNodeList) { + FlowTaskNodeEntity node = taskNodeList.stream().filter(t -> t.getId().equals(taskNodeEntity.getId())).findFirst().orElse(null); + taskNodeEntity.setDraftData(node != null ? JsonUtil.getObjectToString(flowModel.getFormData()) : taskNodeEntity.getDraftData()); + flowTaskNodeService.update(taskNodeEntity); + taskNodeEntity.setNodePropertyJson(node != null ? node.getNodePropertyJson() : "{}"); + } + //获取 + List rejectNodeAll = rejectTaskNodeList.stream().filter(t -> rejectNodeList.contains(t.getId())).collect(Collectors.toList()); + for (FlowTaskNodeEntity taskNodeEntity : rejectNodeAll) { + if (thisStepId.contains(taskNodeEntity.getNodeCode())) { + nextOperatorList.add(JsonUtil.getJsonToBean(taskNodeEntity.getNodePropertyJson(), ChildNodeList.class)); + } + } + //还原审批数据状态 + List operatorEntityList = JsonUtil.getJsonToList(info.getTaskOperatorJson(), FlowTaskOperatorEntity.class); + for (FlowTaskOperatorEntity flowTaskOperatorEntity : operatorEntityList) { + flowTaskOperatorService.update(flowTaskOperatorEntity); + } + //冻结数据传递 + flowTaskUtil.dataAssignment(operator.getTaskNodeId(), rejectTaskNodeList, flowModel); + } else { + //分支的下个节点 + List nodeCandidateList = result.stream().filter(t -> StringUtil.isNotEmpty(t.getCandidates())).collect(Collectors.toList()); + for (FlowTaskNodeEntity entity : nodeCandidateList) { + ChildNodeList node = JsonUtil.getJsonToBean(entity.getNodePropertyJson(), ChildNodeList.class); + nextOperatorList.add(node); + } + if (nextOperatorList.size() == 0) { + for (FlowTaskNodeEntity entity : result) { + ChildNodeList node = JsonUtil.getJsonToBean(entity.getNodePropertyJson(), ChildNodeList.class); + nextOperatorList.add(node); + } + } + } + } + boolean isStart = nextNode.stream().filter(t -> FlowNature.NodeStart.equals(t.getNodeType())).count() > 0; + boolean isCompletion = nextNode.stream().filter(t -> FlowNature.AuditCompletion.equals(t.getCompletion())).count() > 0; + boolean isSwerve = flowNextModel.getIsCountersign() && isCompletion; + //同意记录 + FlowTaskOperatorRecordEntity operatorRecord = new FlowTaskOperatorRecordEntity(); + //审批数据赋值 + FlowOperatordModel flowOperatordModel = FlowOperatordModel.builder().status(isSwerve ? FlowRecordEnum.swerve.getCode() : FlowRecordEnum.audit.getCode()).flowModel(flowModel).userId(userId).operator(operator).build(); + flowTaskUtil.operatorRecord(operatorRecord, flowOperatordModel); + //子流程不新增流转记录 + if (!flowModel.getIsAsync() && !before) { + flowTaskUtil.createRecord(operatorRecord); + } + if (isReject) { + //更新流程节点 + if (isSwerve) { + FlowTaskNodeEntity serverTaskNode = new FlowTaskNodeEntity(); + serverTaskNode.setNodeUp(taskNode.getNodeNext()); + serverTaskNode.setTaskId(flowTask.getId()); + FlowUpModel flowUpModel = FlowUpModel.builder().flowTask(flowTask).taskNode(serverTaskNode).taskNodeList(taskNodeList) + .isReject(isSwerve).rejectType(true).flowModel(flowModel).isAudit(true).build(); + flowTaskUtil.flowUp(flowUpModel); + } else { + flowTaskUtil.getNextStepId(nextOperatorList, flowTask, flowModel, taskNodeList); + flowTask.setCompletion(FlowNature.NodeEnd.equals(flowTask.getThisStepId()) ? FlowNature.Progress : flowTask.getCompletion()); + } + if (StringUtil.isNotEmpty(flowTask.getThisStepId())) { + FlowTaskEntity updateFlowTask = new FlowTaskEntity(); + updateFlowTask.setTaskNodeId(null); + updateFlowTask.setCompletion(flowTask.getCompletion()); + updateFlowTask.setThisStepId(flowTask.getThisStepId()); + updateFlowTask.setStatus(flowTask.getStatus()); + updateFlowTask.setThisStep(flowTask.getThisStep()); + updateFlowTask.setId(flowTask.getId()); + flowTaskService.update(updateFlowTask); + } + } + //下个节点 + Map> asyncTaskList = new HashMap<>(); + Map> nodeTaskIdList = new HashMap<>(); + FlowOperator flowOperator = FlowOperator.builder().operatorListAll(operatorList).flowModel(flowModel).flowTask(flowTask).nodeList(nextOperatorList).taskNodeListAll(taskNodeList).userInfo(userInfo).asyncTaskList(asyncTaskList).nodeTaskIdList(nodeTaskIdList).build(); + if (!isStart) { + flowTaskUtil.nextOperator(flowOperator); + Map> operatorMap = operatorList.stream().collect(Collectors.groupingBy(FlowTaskOperatorEntity::getTaskNodeId)); + for (ChildNodeList childNodeList : nextOperatorList) { + Properties properties = childNodeList.getProperties(); + boolean counterSign = FlowNature.ImproperApprover.equals(properties.getCounterSign()); + if (counterSign && StringUtil.isEmpty(flowModel.getFreeApproverUserId())) { + List listAll = operatorMap.get(childNodeList.getTaskNodeId()) != null ? operatorMap.get(childNodeList.getTaskNodeId()) : new ArrayList<>(); + flowOperatorUserService.create(JsonUtil.getJsonToList(listAll, FlowOperatorUserEntity.class)); + } + FlowDataModel flowDataModel = new FlowDataModel(childNodeList, taskNodeList, flowModel, true, true); + flowTaskUtil.createOrUpdate(flowDataModel); + } + //过滤依次审批人 + if (StringUtil.isEmpty(flowModel.getFreeApproverUserId())) { + flowTaskUtil.improperApproverUser(operatorList, taskNodeList, nodeModel, operator); + } + flowTaskUtil.timer(operator, taskNodeList, operatorList); + flowTaskOperatorService.create(operatorList); + //修改选择分支没有走过的节点 + if (flowModel.getBranchList().size() > 0) { + List nodeCodeList = result.stream().map(FlowTaskNodeEntity::getNodeCode).collect(Collectors.toList()); + flowTaskUtil.branchTaskNode(nodeCodeList, taskNodeList, operatorList); + } + } + //更新关联同步子流程id + for (String nodeId : nodeTaskIdList.keySet()) { + FlowTaskNodeEntity entity = taskNodeList.stream().filter(t -> t.getId().equals(nodeId)).findFirst().orElse(null); + if (entity != null) { + ChildNodeList childNodeList = JsonUtil.getJsonToBean(entity.getNodePropertyJson(), ChildNodeList.class); + childNodeList.getCustom().setTaskId(nodeTaskIdList.get(nodeId)); + entity.setNodePropertyJson(JsonUtil.getObjectToString(childNodeList)); + flowTaskNodeService.updateTaskIdList(entity); + } + } + //更新关联异步子流程id + for (String nodeId : asyncTaskList.keySet()) { + FlowTaskNodeEntity entity = taskNodeList.stream().filter(t -> t.getId().equals(nodeId)).findFirst().orElse(null); + if (entity != null) { + ChildNodeList childNodeList = JsonUtil.getJsonToBean(entity.getNodePropertyJson(), ChildNodeList.class); + childNodeList.getCustom().setAsyncTaskList(asyncTaskList.get(nodeId)); + entity.setNodePropertyJson(JsonUtil.getObjectToString(childNodeList)); + flowTaskNodeService.updateTaskIdList(entity); + } + } + //获取抄送人 + List circulateList = new ArrayList<>(); + if (isReject) { + flowTaskUtil.circulateList(nodeModel, taskNodeList, circulateList, flowModel, flowTask); + flowTaskCirculateService.create(circulateList); + } + //更新节点接收时间 + flowTaskUtil.taskCreatTime(operatorList); + //委托消息 + boolean approve = StringUtil.isNotEmpty(operator.getHandleId()) && !operator.getHandleId().equals(userInfo.getUserId()); + if (approve) { + FlowTaskEntity delegateTask = new FlowTaskEntity(); + delegateTask.setFullName(flowTask.getFullName()); + delegateTask.setDelegateUser(userInfo.getUserId()); + FlowDelegateModel delegate = new FlowDelegateModel(); + delegate.setToUserIds(ImmutableList.of(operator.getHandleId())); + delegate.setDelegate(false); + delegate.setType(FlowNature.ApproveMsg); + delegate.setUserInfo(userInfo); + delegate.setFlowTask(delegateTask); + delegate.setTemplateAllModel(templateAllModel); + delegate.setApprove(approve); + flowMsgUtil.delegateMsg(delegate); + } + if (isReject) { + //节点事件 + flowMsgUtil.event(4, nodeModel, operatorRecord, flowModel); + //发送消息 + FlowMsgModel flowMsgModel = new FlowMsgModel(); + flowMsgModel.setApprove(FlowNature.AuditCompletion.equals(taskNode.getCompletion())); + flowMsgModel.setCopy(true); + flowMsgModel.setNodeList(taskNodeList); + flowMsgModel.setOperatorList(operatorList); + flowMsgModel.setCirculateList(circulateList); + flowMsgModel.setData(flowModel.getFormData()); + flowMsgModel.setTaskNodeEntity(taskNode); + flowMsgModel.setTaskEntity(flowTask); + flowMsgModel.setFlowTemplateAllModel(templateAllModel); + FlowTaskOperatorRecordEntity taskOperatorRecord = new FlowTaskOperatorRecordEntity(); + taskOperatorRecord.setHandleId(userInfo.getUserId()); + flowMsgModel.setFlowModel(flowModel); + flowMsgUtil.message(flowMsgModel); + //超时 + insTimeOutRedis(flowModel, operatorList, userInfo, flowTask, taskNodeList); + //自动审批 + if (!isSwerve) { + FlowApproveModel approveModel = FlowApproveModel.builder().operatorList(operatorList).taskNodeList(taskNodeList).flowTask(flowTask).flowModel(flowModel).build(); + flowTaskUtil.approve(approveModel); + //查询代办用户是否通过 + flowTaskUtil.approverPass(flowTask, taskNodeList, flowModel, operator); + } + } + } + + @Override + public void auditAll(FlowTaskEntity flowTask, FlowTaskOperatorEntity operator, FlowModel flowModel) throws WorkFlowException { + try { + audit(flowTask, operator, flowModel); + //表单数据 + Map> childAllData = FlowContextHolder.getChildAllData(); + Map>> childAllOperates = FlowContextHolder.getFormOperates(); + for (String idAll : childAllData.keySet()) { + String[] idList = idAll.split("_yunzhupaas_"); + Map formData = childAllData.get(idAll); + List> formOperates = childAllOperates.get(idAll); + FlowFormDataModel model = FlowFormDataModel.builder().formId(idList[1]).id(idList[0]).map(formData).formOperates(formOperates).build(); + serviceUtil.createOrUpdate(model); + } + } finally { + List allEvent = FlowContextHolder.getAllEvent(); + if (allEvent.size() > 0) { + FlowModel cancelModel = new FlowModel(); + cancelModel.setUserInfo(flowModel.getUserInfo()); + flowTaskUtil.taskCancel(Collections.singletonList(flowModel.getId()), cancelModel); + } + FlowContextHolder.clearAll(); + } + } + + @Override + @DSTransactional + public void audit(FlowModel flowModel) throws WorkFlowException { + String id = flowModel.getId(); + FlowTaskOperatorEntity operator = flowTaskOperatorService.getInfo(id); + UserInfo userInfo = UserProvider.getUser(); + flowModel.setUserInfo(userInfo); + FlowTaskEntity flowTask = flowTaskService.getInfo(operator.getTaskId(), + FlowTaskEntity::getStatus, FlowTaskEntity::getTemplateId, FlowTaskEntity::getFlowId, + FlowTaskEntity::getId, FlowTaskEntity::getFullName, FlowTaskEntity::getCreatorUserId, + FlowTaskEntity::getParentId, FlowTaskEntity::getThisStepId, FlowTaskEntity::getThisStep, + FlowTaskEntity::getRejectId, FlowTaskEntity::getCompletion + ); + permissions(operator.getHandleId(), flowTask, operator, "", flowModel); + if (!FlowNature.ProcessCompletion.equals(operator.getCompletion())) { + throw new WorkFlowException(MsgCode.WF031.get() ); + } + if (FlowNature.ProcessCompletion.equals(operator.getCompletion())) { + auditAll(flowTask, operator, flowModel); + } + } + + @Override + @DSTransactional + public void reject(FlowTaskEntity flowTask, FlowTaskOperatorEntity operator, FlowModel flowModel) throws WorkFlowException { + UserInfo userInfo = flowModel.getUserInfo(); + String userId = StringUtil.isNotEmpty(flowModel.getUserId()) ? flowModel.getUserId() : userInfo.getUserId(); + List rejectThisStepId = Arrays.asList(flowTask.getThisStepId().split(",")); + //判断流程是否处于挂起状态 + flowTaskUtil.isSuspend(flowTask); + //流程所有节点 + TaskNodeListModel taskNodeListModel = TaskNodeListModel.builder().id(flowTask.getId()).state(FlowNodeEnum.Process.getCode()).build(); + List taskNodeList = flowTaskNodeService.getList(taskNodeListModel, + FlowTaskNodeEntity::getId, FlowTaskNodeEntity::getTaskId, FlowTaskNodeEntity::getNodePropertyJson, + FlowTaskNodeEntity::getNodeNext, FlowTaskNodeEntity::getNodeCode, FlowTaskNodeEntity::getNodeName, + FlowTaskNodeEntity::getNodeType, FlowTaskNodeEntity::getFormId, FlowTaskNodeEntity::getState, + FlowTaskNodeEntity::getCompletion + ); + List operatorEntityList = flowTaskOperatorService.getList(flowTask.getId()).stream().filter(t -> FlowNodeEnum.Process.getCode().equals(t.getState()) && !rejectThisStepId.contains(t.getNodeCode())).collect(Collectors.toList()); + //保存当前节点和任务 + String taskJson = JsonUtil.getObjectToString(JsonUtil.getJsonToBean(flowTask, FlowTaskRejectModel.class)); + String taskNodeJson = JsonUtil.getObjectToString(JsonUtil.getJsonToList(taskNodeList, FlowTaskNodeRejectModel.class)); + //当前节点 + Optional first = taskNodeList.stream().filter(m -> m.getId().equals(operator.getTaskNodeId())).findFirst(); + if (!first.isPresent()) { + throw new WorkFlowException(MsgCode.COD001.get()); + } + FlowTaskNodeEntity taskNode = first.get(); + FlowTemplateAllModel templateAllModel = flowTaskUtil.templateJson(flowTask.getFlowId()); + flowTaskUtil.candidateList(flowModel, taskNodeList, operator); + //当前节点属性 + ChildNodeList nodeModel = JsonUtil.getJsonToBean(taskNode.getNodePropertyJson(), ChildNodeList.class); + boolean rejectType = FlowNature.PresentType.equals(flowModel.getRejectType()); + taskNode.setNodeUp(flowModel.getRejectStep()); + //驳回记录 + FlowTaskOperatorRecordEntity operatorRecord = new FlowTaskOperatorRecordEntity(); + //审批数据赋值 + FlowOperatordModel flowOperatordModel = FlowOperatordModel.builder().status(FlowRecordEnum.reject.getCode()).flowModel(flowModel).userId(userId).operator(operator).build(); + flowTaskUtil.operatorRecord(operatorRecord, flowOperatordModel); + flowTaskUtil.createRecord(operatorRecord); + //修改或签、会签经办数据 + TaskHandleIdStatus handleIdStatus = new TaskHandleIdStatus(); + handleIdStatus.setStatus(0); + handleIdStatus.setNodeModel(nodeModel); + handleIdStatus.setUserInfo(userInfo); + handleIdStatus.setTaskNodeList(taskNodeList); + flowTaskUtil.handleIdStatus(operator, handleIdStatus); + //更新流当前程经办状态 + flowTaskOperatorService.update(operator); + //判断是否是会签 + List rejectOperatorList = flowTaskOperatorService.getList(taskNode.getTaskId()).stream().filter(t -> t.getTaskNodeId().equals(taskNode.getId()) && FlowNodeEnum.Process.getCode().equals(t.getState())).collect(Collectors.toList()); + FlowCountersignModel countersign = new FlowCountersignModel(); + countersign.setTaskNode(taskNode); + countersign.setOperatorList(rejectOperatorList); + boolean isReject = flowTaskUtil.isRejectCountersign(countersign); + //更新驳回节点 + //todo 123456789 + FlowUpModel flowUpModel = FlowUpModel.builder().flowTask(flowTask).taskNode(taskNode).taskNodeList(taskNodeList) + .isReject(isReject).rejectType(!rejectType).flowModel(flowModel).isAudit(false).build(); + List upAll = flowTaskUtil.flowUp(flowUpModel); + boolean isStart = upAll.stream().filter(t -> FlowNature.NodeStart.equals(t.getNodeType())).count() > 0; + List nextOperatorList = new ArrayList<>(); + for (FlowTaskNodeEntity entity : upAll) { + ChildNodeList node = JsonUtil.getJsonToBean(entity.getNodePropertyJson(), ChildNodeList.class); + nextOperatorList.add(node); + } + //驳回节点 + List operatorList = new ArrayList<>(); + if (!isStart) { + //赋值数据 + flowModel.setProcessId(flowTask.getId()); + flowModel.setId(flowTask.getId()); + Map data = serviceUtil.infoData(taskNode.getFormId(), taskNode.getTaskId()); + flowModel.setFormData(data); + FlowOperator flowOperator = FlowOperator.builder().operatorListAll(operatorList).flowModel(flowModel).flowTask(flowTask).nodeList(nextOperatorList).taskNodeListAll(taskNodeList).reject(true).asyncTaskList(new HashMap<>()).build(); + flowTaskUtil.nextOperator(flowOperator); + } + //保存冻结的数据 + if (rejectType && isReject) { + String operatorJson = JsonUtil.getObjectToString(JsonUtil.getJsonToList(operatorEntityList, FlowTaskOperatorRejectModel.class)); + FlowRejectDataEntity rejectEntity = new FlowRejectDataEntity(); + rejectEntity.setTaskNodeJson(taskNodeJson); + rejectEntity.setTaskOperatorJson(operatorJson); + rejectEntity.setTaskJson(taskJson); + rejectEntity.setId(flowTask.getId()); + flowTask.setRejectId(flowTask.getId()); + flowRejectDataService.createOrUpdate(rejectEntity); + } + //更新流程节点 + flowTask.setTaskNodeId(null); + flowTaskService.update(flowTask); + //显示当前的驳回记录 + flowTaskOperatorRecordService.update(operatorRecord.getId(), operatorRecord); + for (FlowTaskOperatorEntity operatorEntity : operatorList) { + operatorEntity.setReject(rejectType ? "1" : ""); + } + //创建审批人 + Map> operatorMap = operatorList.stream().collect(Collectors.groupingBy(FlowTaskOperatorEntity::getTaskNodeId)); + for (ChildNodeList childNodeList : nextOperatorList) { + Properties properties = childNodeList.getProperties(); + boolean counterSign = FlowNature.ImproperApprover.equals(properties.getCounterSign()); + if (counterSign && StringUtil.isEmpty(flowModel.getFreeApproverUserId())) { + List listAll = operatorMap.get(childNodeList.getTaskNodeId()) != null ? operatorMap.get(childNodeList.getTaskNodeId()) : new ArrayList<>(); + flowOperatorUserService.create(JsonUtil.getJsonToList(listAll, FlowOperatorUserEntity.class)); + } + } + //过滤依次审批人 + flowTaskUtil.improperApproverUser(operatorList, taskNodeList, nodeModel, operator); + flowTaskOperatorService.create(operatorList); + //更新节点接收时间 + flowTaskUtil.taskCreatTime(operatorList); + //获取抄送人 + List circulateList = new ArrayList<>(); + flowTaskUtil.circulateList(nodeModel, taskNodeList, circulateList, flowModel, flowTask); + flowTaskCirculateService.create(circulateList); + //节点事件 + flowMsgUtil.event(5, nodeModel, operatorRecord, flowModel); + List parameterModels = FlowContextHolder.getAllEvent(); + if (parameterModels.size() == 0) { + //发送消息 + FlowMsgModel flowMsgModel = new FlowMsgModel(); + flowMsgModel.setCirculateList(circulateList); + flowMsgModel.setNodeList(taskNodeList); + flowMsgModel.setOperatorList(operatorList); + flowMsgModel.setReject(true); + flowMsgModel.setCopy(true); + flowMsgModel.setWait(isStart ? false : true); + flowMsgModel.setStart(isStart); + flowMsgModel.setData(JsonUtil.stringToMap(flowTask.getFlowFormContentJson())); + flowMsgModel.setTaskNodeEntity(taskNode); + flowMsgModel.setTaskEntity(flowTask); + flowMsgModel.setFlowTemplateAllModel(templateAllModel); + FlowTaskOperatorRecordEntity taskOperatorRecord = new FlowTaskOperatorRecordEntity(); + taskOperatorRecord.setHandleId(userInfo.getUserId()); + flowMsgModel.setFlowModel(flowModel); + flowMsgUtil.message(flowMsgModel); + //超时 + insTimeOutRedis(flowModel, operatorList, userInfo, flowTask, taskNodeList); + //自动审批 + FlowApproveModel approveModel = FlowApproveModel.builder().operatorList(operatorList).taskNodeList(taskNodeList).flowTask(flowTask).flowModel(flowModel).build(); + flowTaskUtil.approve(approveModel); + } + } + + @Override + public void rejectAll(FlowTaskEntity flowTask, FlowTaskOperatorEntity operator, FlowModel flowModel) throws WorkFlowException { + try { + if (StringUtil.isNotEmpty(flowTask.getRejectId())) { + throw new WorkFlowException(MsgCode.WF035.get() ); + } + reject(flowTask, operator, flowModel); + } finally { + List allEvent = FlowContextHolder.getAllEvent(); + if (allEvent.size() > 0) { + FlowModel cancelModel = new FlowModel(); + cancelModel.setUserInfo(flowModel.getUserInfo()); + flowTaskUtil.taskCancel(Collections.singletonList(flowTask.getId()), cancelModel); + } + FlowContextHolder.clearAll(); + } + } + + @Override + @DSTransactional + public void reject(FlowModel flowModel) throws WorkFlowException { + String id = flowModel.getId(); + FlowTaskOperatorEntity operator = flowTaskOperatorService.getInfo(id); + FlowTaskEntity flowTask = flowTaskService.getInfo(operator.getTaskId(), + FlowTaskEntity::getId, FlowTaskEntity::getStatus, FlowTaskEntity::getFlowId, + FlowTaskEntity::getThisStep, FlowTaskEntity::getThisStepId, + FlowTaskEntity::getCreatorUserId, FlowTaskEntity::getFullName, + FlowTaskEntity::getCompletion + ); + UserInfo userInfo = UserProvider.getUser(); + flowModel.setUserInfo(userInfo); + permissions(operator.getHandleId(), flowTask, operator, "", flowModel); + if (!FlowNature.ProcessCompletion.equals(operator.getCompletion())) { + throw new WorkFlowException(MsgCode.WF031.get() ); + } + if (FlowNature.ProcessCompletion.equals(operator.getCompletion())) { + rejectAll(flowTask, operator, flowModel); + } + } + + @Override + @DSTransactional + public void recall(String id, FlowTaskOperatorRecordEntity operatorRecord, FlowModel flowModel) throws WorkFlowException { + UserInfo userInfo = flowModel.getUserInfo(); + //撤回经办 + FlowTaskOperatorEntity operatorEntity = flowTaskOperatorService.getInfo(operatorRecord.getTaskOperatorId()); + if (FlowNodeEnum.Futility.getCode().equals(operatorEntity.getState())) { + throw new WorkFlowException(MsgCode.WF036.get()); + } + FlowTaskOperatorEntity rollbackOperator = flowTaskOperatorService.getOperatorInfo(StringUtil.isNotEmpty(operatorEntity.getRollbackId()) ? operatorEntity.getRollbackId() : RandomUtil.uuId()); + boolean isParentId = (FlowNature.ParentId.equals(operatorEntity.getParentId()) || (rollbackOperator != null && FlowNature.ParentId.equals(rollbackOperator.getParentId()))); + //撤回任务 + FlowTaskEntity flowTask = flowTaskService.getInfo(operatorRecord.getTaskId(), + FlowTaskEntity::getId, FlowTaskEntity::getRejectId, FlowTaskEntity::getStatus, + FlowTaskEntity::getThisStepId + ); + if (StringUtil.isNotEmpty(flowTask.getRejectId())) { + throw new WorkFlowException(MsgCode.WF035.get()); + } + //判断流程是否处于挂起状态 + flowTaskUtil.isSuspend(flowTask); + //所有节点 + TaskNodeListModel nodeListModel = TaskNodeListModel.builder().id(operatorRecord.getTaskId()).state(FlowNodeEnum.Process.getCode()).build(); + List list = flowTaskNodeService.getList(nodeListModel, + FlowTaskNodeEntity::getId, FlowTaskNodeEntity::getCandidates, FlowTaskNodeEntity::getNodeCode, + FlowTaskNodeEntity::getNodeNext, FlowTaskNodeEntity::getNodeName, FlowTaskNodeEntity::getNodePropertyJson, + FlowTaskNodeEntity::getNodeType, FlowTaskNodeEntity::getCompletion, FlowTaskNodeEntity::getFormId, + FlowTaskNodeEntity::getTaskId + ); + //撤回节点 + FlowTaskNodeEntity recallTaskNode = list.stream().filter(t -> t.getId().equals(operatorRecord.getTaskNodeId())).findFirst().orElse(null); + //所有经办 + List flowTaskOperatorEntityList = flowTaskOperatorService.getList(operatorRecord.getTaskId()).stream().filter(t -> FlowNodeEnum.Process.getCode().equals(t.getState())).collect(Collectors.toList()); + //撤回节点属性 + ChildNodeList nodeModel = JsonUtil.getJsonToBean(recallTaskNode.getNodePropertyJson(), ChildNodeList.class); + //拒绝不撤回 + if (FlowNature.ProcessCompletion.equals(operatorEntity.getHandleStatus())) { + throw new WorkFlowException(MsgCode.WF036.get()); + } + //任务待审状态才能撤回 + if (!FlowTaskStatusEnum.Handle.getCode().equals(flowTask.getStatus())) { + throw new WorkFlowException(MsgCode.WF036.get()); + } + //撤回节点下一节点已操作 + List recallNextOperatorList = flowTaskOperatorEntityList.stream().filter(x -> recallTaskNode.getNodeNext().contains(x.getNodeCode())).collect(Collectors.toList()); + boolean isRecall = recallNextOperatorList.stream().filter(t -> FlowNature.AuditCompletion.equals(t.getCompletion()) && FlowNodeEnum.Process.getCode().equals(t.getState())).count() > 0; + if (isRecall) { + throw new WorkFlowException(MsgCode.WF036.get()); + } + List childIdList = new ArrayList<>(); + for (FlowTaskNodeEntity taskNodeEntity : list) { + ChildNodeList childNodeList = JsonUtil.getJsonToBean(taskNodeEntity.getNodePropertyJson(), ChildNodeList.class); + childIdList.addAll(childNodeList.getCustom().getAsyncTaskList()); + childIdList.addAll(childNodeList.getCustom().getTaskId()); + } + List childList = flowTaskService.getOrderStaList(childIdList, FlowTaskEntity::getId, FlowTaskEntity::getStatus).stream().filter(t -> !FlowTaskStatusEnum.Cancel.getCode().equals(t.getStatus())).collect(Collectors.toList()); + boolean isNext = childList.size() > 0; + if (isNext) { + throw new WorkFlowException(MsgCode.WF037.get()); + } + //加签人 + Set operatorList = new HashSet<>(); + flowTaskUtil.getOperator(operatorEntity.getId(), operatorList); + operatorEntity.setHandleStatus(null); + operatorEntity.setHandleTime(null); + operatorEntity.setCreatorTime(new Date()); + operatorEntity.setCompletion(FlowNature.ProcessCompletion); + operatorEntity.setState(FlowNodeEnum.Process.getCode()); + operatorList.add(operatorEntity); + List delOperatorRecordIds = new ArrayList<>(); + for (FlowTaskOperatorEntity item : operatorList) { + FlowTaskOperatorRecordEntity record = flowTaskOperatorRecordService.getInfo(item.getTaskId(), item.getTaskNodeId(), item.getId()); + if (record != null) { + delOperatorRecordIds.add(record.getId()); + } + } + Set rejectNodeList = new HashSet<>(); + List rejectList = new ArrayList() {{ + add(recallTaskNode.getId()); + }}; + flowTaskUtil.upAll(rejectNodeList, rejectList, list); + //撤回节点是否完成 + if (FlowNature.AuditCompletion.equals(recallTaskNode.getCompletion())) { + //撤回节点下一节点经办删除 + List idAll = recallNextOperatorList.stream().map(FlowTaskOperatorEntity::getId).collect(Collectors.toList()); + flowTaskOperatorService.updateTaskOperatorState(idAll); + List hanleOperatorList = flowTaskOperatorEntityList.stream().filter(x -> x.getTaskNodeId().equals(operatorRecord.getTaskNodeId()) && Objects.isNull(x.getHandleStatus()) && Objects.isNull(x.getHandleTime()) && Objects.isNull(x.getParentId())).collect(Collectors.toList()); + for (FlowTaskOperatorEntity taskOperator : hanleOperatorList) { + taskOperator.setCompletion(FlowNature.ProcessCompletion); + } + operatorList.addAll(hanleOperatorList); + flowTaskNodeService.updateCompletion(new ArrayList<>(rejectNodeList), FlowNature.ProcessCompletion); + //更新任务流程 + List stepIdList = new ArrayList<>(Arrays.asList(flowTask.getThisStepId().split(","))); + List stepNameList = new ArrayList<>(); + List progressList = new ArrayList<>(); + List rejectNodeCode = list.stream().filter(t -> rejectNodeList.contains(t.getId())).map(FlowTaskNodeEntity::getNodeCode).collect(Collectors.toList()); + stepIdList.removeAll(rejectNodeCode); + stepIdList.add(recallTaskNode.getNodeCode()); + List recallNodeList = list.stream().filter(x -> stepIdList.contains(x.getNodeCode())).collect(Collectors.toList()); + for (FlowTaskNodeEntity taskNodeEntity : recallNodeList) { + ChildNodeList childNode = JsonUtil.getJsonToBean(taskNodeEntity.getNodePropertyJson(), ChildNodeList.class); + Properties properties = childNode.getProperties(); + Integer progress = properties.getProgress(); + if (ObjectUtil.isNotEmpty(progress)) { + progressList.add(progress); + } + stepIdList.add(taskNodeEntity.getNodeCode()); + stepNameList.add(taskNodeEntity.getNodeName()); + } + if (progressList.size() == 0) { + progressList.add(FlowNature.ProcessCompletion); + } + //更新当前节点 + flowTask.setCompletion(progressList.get(0)); + flowTask.setThisStepId(String.join(",", stepIdList)); + flowTask.setThisStep(String.join(",", stepNameList)); + flowTask.setStatus(FlowTaskStatusEnum.Handle.getCode()); + flowTaskService.update(flowTask); + } + for (FlowTaskOperatorEntity taskOperator : operatorList) { + flowTaskOperatorService.update(taskOperator); + } + if (isParentId) { + FlowTaskNodeEntity node = list.stream().filter(t -> t.getId().equals(operatorEntity.getTaskNodeId())).findFirst().orElse(null); + List nextNode = Arrays.asList(node.getNodeNext().split(",")); + List taskNodeList = list.stream().filter(t -> nextNode.contains(t.getNodeCode())).collect(Collectors.toList()); + int num = 0; + for (FlowTaskNodeEntity taskNode : taskNodeList) { + int candidateList = StringUtil.isNotEmpty(taskNode.getCandidates()) ? 1 : 0; + num += candidateList > 0 ? 1 : 0; + } + if (num > 0) { + //删除异常人 + List candidateList = list.stream().map(FlowTaskNodeEntity::getId).collect(Collectors.toList()); + flowCandidatesService.deleteTaskNodeId(candidateList, FlowNature.Candidates); + } + rejectNodeList.removeAll(rejectList); + flowTaskNodeService.updateTaskNodeCandidates(new ArrayList<>(rejectNodeList), ""); + //删除异常人 + flowCandidatesService.deleteTaskNodeId(new ArrayList<>(rejectNodeList), FlowNature.CandidatesError); + //删除依次审批人 + FlowOperatorUserEntity nextOperatorUser = flowOperatorUserService.getList(flowTask.getId()).stream().filter(t -> operatorEntity.getSortCode().equals(t.getSortCode() - 1)).findFirst().orElse(null); + if (nextOperatorUser != null) { + boolean count = flowTaskOperatorEntityList.stream().filter(t -> t.getId().equals(nextOperatorUser.getId()) && FlowNature.AuditCompletion.equals(t.getCompletion())).count() > 0; + if (count) { + throw new WorkFlowException(MsgCode.WF036.get()); + } else { + flowTaskOperatorService.deleteList(Collections.singletonList(nextOperatorUser.getId())); + flowOperatorUserService.updateReject(flowTask.getId(), rejectNodeList); + } + } + } + List taskOperatorId = operatorList.stream().map(FlowTaskOperatorEntity::getId).collect(Collectors.toList()); + flowCandidatesService.delete(taskOperatorId); + //删除经办记录 + delOperatorRecordIds.add(operatorRecord.getId()); + flowTaskOperatorRecordService.updateStatus(delOperatorRecordIds); + //撤回记录 + FlowTaskOperatorEntity operator = new FlowTaskOperatorEntity(); + operator.setNodeCode(operatorRecord.getNodeCode()); + operator.setNodeName(operatorRecord.getNodeName()); + operator.setTaskId(operatorRecord.getTaskId()); + operator.setTaskNodeId(operatorRecord.getTaskNodeId()); + operator.setId(operatorRecord.getTaskOperatorId()); + //审批数据赋值 + FlowOperatordModel flowOperatordModel = FlowOperatordModel.builder().status(FlowRecordEnum.revoke.getCode()).flowModel(flowModel).userId(userInfo.getUserId()).operator(operator).build(); + flowTaskUtil.operatorRecord(operatorRecord, flowOperatordModel); + flowTaskOperatorRecordService.create(operatorRecord); + Map objectMap = serviceUtil.infoData(recallTaskNode.getFormId(), recallTaskNode.getTaskId()); + flowModel.setFormData(objectMap); + //节点事件 + flowMsgUtil.event(6, nodeModel, operatorRecord, flowModel); + List allEvent = FlowContextHolder.getAllEvent(); + if (allEvent.size() > 0) { + FlowModel cancelModel = new FlowModel(); + cancelModel.setUserInfo(flowModel.getUserInfo()); + flowTaskUtil.taskCancel(Collections.singletonList(flowTask.getId()), cancelModel); + } else { + //超时 + insTimeOutRedis(flowModel, operatorList, userInfo, flowTask, list); + } + } + + @Override + @DSTransactional + public void revoke(FlowTaskEntity flowTask, FlowModel flowModel, boolean isParentId) throws WorkFlowException { + //判断流程是否处于挂起状态 + flowTaskUtil.isSuspend(flowTask); + UserInfo userInfo = flowModel.getUserInfo(); + TaskNodeListModel nodeListModel = TaskNodeListModel.builder().id(flowTask.getId()).state(FlowNodeEnum.Process.getCode()).build(); + List taskNodeList = flowTaskNodeService.getList(nodeListModel, + FlowTaskNodeEntity::getId, FlowTaskNodeEntity::getNodePropertyJson, FlowTaskNodeEntity::getFormId, + FlowTaskNodeEntity::getTaskId, FlowTaskNodeEntity::getNodeType, FlowTaskNodeEntity::getNodeCode + ); + FlowTemplateAllModel templateAllModel = flowTaskUtil.templateJson(flowTask.getFlowId()); + FlowTemplateJsonEntity templateJson = templateAllModel.getTemplateJson(); + ChildNodeList childNode = JsonUtil.getJsonToBean(templateJson.getFlowTemplateJson(), ChildNodeList.class); + childNode.setTaskId(flowTask.getId()); + FlowTaskNodeEntity startNode = taskNodeList.stream().filter(t -> FlowNature.NodeStart.equals(t.getNodeType())).findFirst().orElse(null); + if (startNode != null) { + childNode = JsonUtil.getJsonToBean(startNode.getNodePropertyJson(), ChildNodeList.class); + } + Properties properties = childNode.getProperties(); + boolean revokeRule = FlowNature.RevokeTerminate.equals(properties.getRevokeRule()); + Map objectMap = serviceUtil.infoData(properties.getFormId(), flowTask.getId()); + flowModel.setFormData(objectMap); + //删除节点 + flowTaskNodeService.update(flowTask.getId()); + //删除经办 + flowTaskOperatorService.update(flowTask.getId()); + //删除候选人 + flowCandidatesService.deleteByTaskId(flowTask.getId()); + //删除发起用户信息 + flowUserService.deleteByTaskId(flowTask.getId()); + //更新当前节点 + flowTask.setThisStep("开始"); + flowTask.setCompletion(FlowNature.ProcessCompletion); + flowTask.setStatus(revokeRule || !isParentId ? FlowTaskStatusEnum.Revoke.getCode() : FlowTaskStatusEnum.Resubmit.getCode()); + flowTaskService.update(flowTask); + //撤回记录 + FlowTaskOperatorRecordEntity operatorRecord = new FlowTaskOperatorRecordEntity(); + FlowTaskOperatorEntity operator = new FlowTaskOperatorEntity(); + operator.setTaskId(childNode.getTaskId()); + operator.setTaskNodeId(childNode.getTaskNodeId()); + operator.setNodeName(properties.getTitle()); + operator.setNodeCode(properties.getNodeId()); + //审批数据赋值 + FlowOperatordModel flowOperatordModel = FlowOperatordModel.builder().status(FlowRecordEnum.revoke.getCode()).flowModel(flowModel).userId(userInfo.getUserId()).operator(operator).build(); + flowTaskUtil.operatorRecord(operatorRecord, flowOperatordModel); + flowTaskOperatorRecordService.create(operatorRecord); + //撤回事件 + operatorRecord.setHandleStatus(FlowTaskStatusEnum.Revoke.getCode()); + flowMsgUtil.event(3, childNode, operatorRecord, flowModel); + List parameterModels = FlowContextHolder.getAllEvent(); + if (parameterModels.size() > 0) { + FlowModel cancelModel = new FlowModel(); + cancelModel.setUserInfo(flowModel.getUserInfo()); + cancel(Collections.singletonList(flowTask.getId()), cancelModel); + } else { + List childAllList = flowTaskService.getChildAllList(flowTask.getId()); + childAllList.remove(flowTask.getId()); + FlowModel cancelModel = new FlowModel(); + cancelModel.setUserInfo(flowModel.getUserInfo()); + revoke(childAllList, cancelModel, false); + } + } + + + @Override + @DSTransactional + public void revoke(List id, FlowModel flowModel, boolean isParentId) throws WorkFlowException { + List taskList = flowTaskService.getOrderStaList(id, FlowTaskEntity::getId, + FlowTaskEntity::getParentId, FlowTaskEntity::getFlowType, FlowTaskEntity::getFullName, + FlowTaskEntity::getStatus, FlowTaskEntity::getFlowId + ); + if (isParentId) { + long count = taskList.stream().filter(t -> StringUtil.isNotEmpty(t.getParentId()) && !FlowNature.ParentId.equals(t.getParentId())).count(); + if (count > 0) { + throw new WorkFlowException(MsgCode.WF038.get()); + } + } + for (FlowTaskEntity entity : taskList) { + FlowModel model = JsonUtil.getJsonToBean(flowModel, FlowModel.class); + revoke(entity, model, isParentId); + } + } + + @Override + @DSTransactional + public void cancel(FlowTaskEntity flowTask, FlowModel flowModel) throws WorkFlowException { + //判断流程是否处于挂起状态 + flowTaskUtil.isSuspend(flowTask); + UserInfo userInfo = flowModel.getUserInfo(); + //终止记录 + FlowTaskOperatorRecordEntity operatorRecord = new FlowTaskOperatorRecordEntity(); + FlowTaskOperatorEntity operator = new FlowTaskOperatorEntity(); + operator.setTaskId(flowTask.getId()); + operator.setNodeCode(flowTask.getThisStepId()); + operator.setNodeName(flowTask.getThisStep()); + //审批数据赋值 + FlowOperatordModel flowOperatordModel = FlowOperatordModel.builder().status(FlowRecordEnum.cancel.getCode()).flowModel(flowModel).userId(userInfo.getUserId()).operator(operator).build(); + flowTaskUtil.operatorRecord(operatorRecord, flowOperatordModel); + flowTaskOperatorRecordService.create(operatorRecord); + //更新实例 + flowTask.setStatus(FlowTaskStatusEnum.Cancel.getCode()); + flowTask.setEndTime(new Date()); + flowTaskService.update(flowTask); + //发送消息 + TaskNodeListModel taskNodeListModel = TaskNodeListModel.builder().id(flowTask.getId()).state(FlowNodeEnum.Process.getCode()).build(); + List taskNodeList = flowTaskNodeService.getList(taskNodeListModel, + FlowTaskNodeEntity::getNodeType, FlowTaskNodeEntity::getId, + FlowTaskNodeEntity::getTaskId, FlowTaskNodeEntity::getNodeType, + FlowTaskNodeEntity::getNodePropertyJson + ); + FlowTaskNodeEntity start = taskNodeList.stream().filter(t -> FlowNature.NodeStart.equals(t.getNodeType())).findFirst().orElse(null); + if (start != null) { + FlowTemplateAllModel templateAllModel = flowTaskUtil.templateJson(flowTask.getFlowId()); + FlowMsgModel flowMsgModel = new FlowMsgModel(); + flowMsgModel.setEnd(true); + flowMsgModel.setNodeList(taskNodeList); + flowMsgModel.setTaskEntity(flowTask); + flowMsgModel.setTaskNodeEntity(start); + flowMsgModel.setFlowTemplateAllModel(templateAllModel); + ChildNode childNode = JsonUtil.getJsonToBean(templateAllModel.getTemplateJson().getFlowTemplateJson(), ChildNode.class); + String formId = childNode.getProperties().getFormId(); + Map data = serviceUtil.infoData(formId, flowTask.getId()); + flowMsgModel.setData(data); + flowMsgModel.setFlowModel(flowModel); + flowMsgUtil.message(flowMsgModel); + //递归查询子流程,并终止 + List childAllList = flowTaskService.getChildAllList(flowTask.getId()); + childAllList.remove(flowTask.getId()); + FlowModel cancelModel = new FlowModel(); + cancelModel.setUserInfo(flowModel.getUserInfo()); + cancel(childAllList, cancelModel); + } + } + + @Override + @DSTransactional + public void cancel(List id, FlowModel flowModel) throws WorkFlowException { + List orderStaList = flowTaskService.getOrderStaList(id, + FlowTaskEntity::getStatus, FlowTaskEntity::getId, FlowTaskEntity::getThisStepId, + FlowTaskEntity::getThisStep, FlowTaskEntity::getFlowId + ); + for (FlowTaskEntity entity : orderStaList) { + FlowModel model = JsonUtil.getJsonToBean(flowModel, FlowModel.class); + cancel(entity, model); + } + } + + @Override + @DSTransactional + public void assign(String id, FlowModel flowModel) throws WorkFlowException { + FlowTaskEntity flowTask = flowTaskService.getInfo(id); + //判断流程是否处于挂起状态 + flowTaskUtil.isSuspend(flowTask); + List list = flowTaskOperatorService.getList(id).stream().filter(t -> FlowNodeEnum.Process.getCode().equals(t.getState()) && flowModel.getNodeCode().equals(t.getNodeCode())).collect(Collectors.toList()); + TaskNodeListModel taskNodeListModel = TaskNodeListModel.builder().id(flowTask.getId()).state(FlowNodeEnum.Process.getCode()).build(); + List taskNodeList = flowTaskNodeService.getList(taskNodeListModel, + FlowTaskNodeEntity::getId, FlowTaskNodeEntity::getNodePropertyJson, FlowTaskNodeEntity::getNodeCode, + FlowTaskNodeEntity::getTaskId, FlowTaskNodeEntity::getNodeName, FlowTaskNodeEntity::getNodeType + ); + FlowTaskNodeEntity taskNode = taskNodeList.stream().filter(t -> flowModel.getNodeCode().equals(t.getNodeCode())).findFirst().orElse(null); + ChildNodeList childNode = JsonUtil.getJsonToBean(taskNode.getNodePropertyJson(), ChildNodeList.class); + boolean isRejct = list.stream().filter(t -> StringUtil.isNotEmpty(t.getReject())).count() > 0; + List operatorList = new ArrayList<>(); + TaskOperatoUser taskOperatoUser = new TaskOperatoUser(); + taskOperatoUser.setDate(new Date()); + taskOperatoUser.setChildNode(childNode); + taskOperatoUser.setAutomation(""); + taskOperatoUser.setId(FlowNature.ParentId); + taskOperatoUser.setHandLeId(flowModel.getFreeApproverUserId()); + taskOperatoUser.setSortCode(1); + taskOperatoUser.setRejectUser(isRejct); + flowTaskUtil.operatorUser(operatorList, taskOperatoUser); + Set taskNodeIdList = list.stream().map(FlowTaskOperatorEntity::getTaskNodeId).collect(Collectors.toSet()); + flowTaskOperatorService.updateReject(flowTask.getId(), taskNodeIdList); + flowTaskOperatorService.create(operatorList); + Set taskNodeId = new HashSet() {{ + add(taskNode.getId()); + }}; + flowOperatorUserService.updateReject(id, taskNodeId); + //指派记录 + UserInfo userInfo = flowModel.getUserInfo(); + FlowTaskOperatorRecordEntity operatorRecord = new FlowTaskOperatorRecordEntity(); + FlowTaskOperatorEntity operator = new FlowTaskOperatorEntity(); + operator.setTaskId(taskNode.getTaskId()); + operator.setNodeCode(taskNode.getNodeCode()); + operator.setNodeName(taskNode.getNodeName()); + //审批数据赋值 + FlowOperatordModel flowOperatordModel = FlowOperatordModel.builder().status(FlowRecordEnum.assign.getCode()).flowModel(flowModel).userId(userInfo.getUserId()).operator(operator).operatorId(flowModel.getFreeApproverUserId()).build(); + flowTaskUtil.operatorRecord(operatorRecord, flowOperatordModel); + flowTaskOperatorRecordService.create(operatorRecord); + //发送消息 + FlowTemplateAllModel templateAllModel = flowTaskUtil.templateJson(flowTask.getFlowId()); + FlowMsgModel flowMsgModel = new FlowMsgModel(); + flowMsgModel.setData(JsonUtil.stringToMap(flowTask.getFlowFormContentJson())); + flowMsgModel.setNodeList(taskNodeList); + flowMsgModel.setOperatorList(operatorList); + flowMsgModel.setTaskNodeEntity(taskNode); + flowMsgModel.setTaskEntity(flowTask); + flowMsgModel.setFlowTemplateAllModel(templateAllModel); + flowMsgModel.setFlowModel(flowModel); + flowMsgUtil.message(flowMsgModel); + //超时 + insTimeOutRedis(flowModel, operatorList, userInfo, flowTask, taskNodeList); + } + + @Override + public void transfer(FlowTaskOperatorEntity taskOperator, FlowModel flowModel) throws WorkFlowException { + flowTaskOperatorService.update(taskOperator); + TaskNodeListModel taskNodeListModel = TaskNodeListModel.builder().id(taskOperator.getTaskId()).state(FlowNodeEnum.Process.getCode()).build(); + List taskNodeList = flowTaskNodeService.getList(taskNodeListModel, + FlowTaskNodeEntity::getId, FlowTaskNodeEntity::getNodePropertyJson, FlowTaskNodeEntity::getNodeCode, + FlowTaskNodeEntity::getNodeNext, FlowTaskNodeEntity::getTaskId, FlowTaskNodeEntity::getNodeType + ); + FlowTaskNodeEntity taskNode = taskNodeList.stream().filter(t -> t.getId().equals(taskOperator.getTaskNodeId())).findFirst().orElse(null); + ChildNodeList childNode = JsonUtil.getJsonToBean(taskNode.getNodePropertyJson(), ChildNodeList.class); + FlowTaskEntity flowTask = flowTaskService.getInfo(taskNode.getTaskId()); + //判断流程是否处于挂起状态 + flowTaskUtil.isSuspend(flowTask); + //转办记录 + UserInfo userInfo = flowModel.getUserInfo(); + FlowTaskOperatorRecordEntity operatorRecord = new FlowTaskOperatorRecordEntity(); + FlowTaskOperatorEntity operator = new FlowTaskOperatorEntity(); + operator.setTaskId(taskOperator.getTaskId()); + operator.setNodeCode(taskOperator.getNodeCode()); + operator.setTaskNodeId(taskOperator.getTaskNodeId()); + operator.setNodeName(taskOperator.getNodeName()); + //审批数据赋值 + FlowOperatordModel flowOperatordModel = FlowOperatordModel.builder().status(FlowRecordEnum.transfer.getCode()).flowModel(flowModel).userId(userInfo.getUserId()).operator(operator).operatorId(taskOperator.getHandleId()).build(); + flowTaskUtil.operatorRecord(operatorRecord, flowOperatordModel); + flowTaskOperatorRecordService.create(operatorRecord); + //自动审批 + List operatorListAll = new ArrayList<>(); + List userName = new ArrayList() {{ + UserEntity user = new UserEntity(); + user.setId(taskOperator.getHandleId()); + add(user); + }}; + TaskOperatoUser taskOperatoUser = new TaskOperatoUser(); + taskOperatoUser.setDate(new Date()); + taskOperatoUser.setId(FlowNature.ParentId); + taskOperatoUser.setHandLeId(operator.getHandleId()); + taskOperatoUser.setChildNode(childNode); + FlowAgreeRuleModel ruleModel = FlowAgreeRuleModel.builder().operatorListAll(operatorListAll).taskOperatoUser(taskOperatoUser).flowTask(flowTask).userName(userName).childNode(childNode).taskNodeList(taskNodeList).reject(false).build(); + flowTaskUtil.flowAgreeRule(ruleModel); + operatorListAll.stream().forEach(t -> t.setId(taskOperator.getId())); + //发送消息 + FlowTemplateAllModel templateAllModel = flowTaskUtil.templateJson(flowTask.getFlowId()); + List operatorList = new ArrayList() {{ + FlowTaskOperatorEntity operatorEntity = new FlowTaskOperatorEntity(); + operatorEntity.setId(taskOperator.getId()); + operatorEntity.setTaskId(operatorRecord.getTaskId()); + operatorEntity.setHandleId(taskOperator.getHandleId()); + operatorEntity.setTaskNodeId(operatorRecord.getTaskNodeId()); + add(operatorEntity); + }}; + FlowMsgModel flowMsgModel = new FlowMsgModel(); + flowMsgModel.setNodeList(taskNodeList); + flowMsgModel.setOperatorList(operatorList); + flowMsgModel.setData(JsonUtil.stringToMap(flowTask.getFlowFormContentJson())); + flowMsgModel.setTaskNodeEntity(taskNode); + flowMsgModel.setTaskEntity(flowTask); + flowMsgModel.setFlowTemplateAllModel(templateAllModel); + flowMsgModel.setFlowModel(flowModel); + flowMsgUtil.message(flowMsgModel); + //自动审批 + FlowApproveModel approveModel = FlowApproveModel.builder().operatorList(operatorListAll).taskNodeList(taskNodeList).flowTask(flowTask).flowModel(flowModel).build(); + flowTaskUtil.approve(approveModel); + //超时 + insTimeOutRedis(flowModel, operatorListAll, userInfo, flowTask, taskNodeList); + } + + @Override + @DSTransactional + public void transfer(FlowModel flowModel) throws WorkFlowException { + String id = flowModel.getId(); + FlowTaskOperatorEntity operator = flowTaskOperatorService.getInfo(id); + FlowTaskEntity flowTask = flowTaskService.getInfo(operator.getTaskId()); + flowModel.setUserInfo(UserProvider.getUser()); + permissions(operator.getHandleId(), flowTask, operator, "", flowModel); + operator.setHandleId(flowModel.getFreeApproverUserId()); + operator.setCreatorTime(new Date()); + transfer(operator, flowModel); + } + + + @Override + public FlowBeforeInfoVO getBeforeInfo(FlowModel flowModel) throws WorkFlowException { + FlowBeforeInfoVO vo = new FlowBeforeInfoVO(); + String operatorId = flowModel.getTaskOperatorId(); + String flowId = flowModel.getFlowId(); + boolean parentId = FlowNature.ParentId.equals(flowModel.getId()); + FlowTaskEntity taskEntity = parentId ? null : flowTaskService.getInfoSubmit(flowModel.getId(), + FlowTaskEntity::getFlowId, FlowTaskEntity::getId, FlowTaskEntity::getRejectId, + FlowTaskEntity::getFrestore, FlowTaskEntity::getThisStepId, FlowTaskEntity::getCreatorUserId, + FlowTaskEntity::getTaskNodeId, FlowTaskEntity::getThisStepId, FlowTaskEntity::getThisStep, + FlowTaskEntity::getFlowCode, FlowTaskEntity::getFullName, FlowTaskEntity::getFlowType, + FlowTaskEntity::getFlowCategory, FlowTaskEntity::getEnabledMark, FlowTaskEntity::getCompletion, + FlowTaskEntity::getFlowName, FlowTaskEntity::getFlowUrgent, FlowTaskEntity::getFlowVersion, + FlowTaskEntity::getStatus, FlowTaskEntity::getTaskNodeId + ); + FlowTemplateAllModel templateAllModel = taskEntity != null ? flowTaskUtil.templateJson(taskEntity.getFlowId()) : flowTaskUtil.templateJson(flowId); + FlowTemplateJsonEntity templateJson = templateAllModel.getTemplateJson(); + FlowTemplateEntity template = templateAllModel.getTemplate(); + ChildNodeList childNodeAll = JsonUtil.getJsonToBean(templateJson.getFlowTemplateJson(), ChildNodeList.class); + String formId = childNodeAll.getProperties().getFormId(); + int num = 0; + UserInfo userInfo = UserProvider.getUser(); + if (taskEntity != null) { + boolean isRejectId = StringUtil.isEmpty(taskEntity.getRejectId()); + TaskNodeListModel taskNodeListModel = TaskNodeListModel.builder().id(taskEntity.getId()).state(FlowNodeEnum.Process.getCode()).build(); + List taskNodeList = flowTaskNodeService.getList(taskNodeListModel, + FlowTaskNodeEntity::getId, FlowTaskNodeEntity::getCompletion, FlowTaskNodeEntity::getState, FlowTaskNodeEntity::getTaskId, + FlowTaskNodeEntity::getNodeCode, FlowTaskNodeEntity::getNodeNext, FlowTaskNodeEntity::getNodePropertyJson, + FlowTaskNodeEntity::getNodeType, FlowTaskNodeEntity::getNodeName, FlowTaskNodeEntity::getFormId, + FlowTaskNodeEntity::getCreatorTime, FlowTaskNodeEntity::getCandidates, FlowTaskNodeEntity::getDraftData + ); + //排除分支没有走过的节点 + flowTaskUtil.nodeList(taskNodeList); + List state = ImmutableList.of(FlowNodeEnum.Process.getCode(), FlowNodeEnum.FreeApprover.getCode()); + List taskOperatorList = flowTaskOperatorService.getList(taskEntity.getId()).stream().filter(t -> state.contains(t.getState()) && FlowNature.ParentId.equals(t.getParentId())).collect(Collectors.toList()); + Map> nodeIdList = taskOperatorList.stream().collect(Collectors.groupingBy(FlowTaskOperatorEntity::getTaskNodeId)); + List operatorRecordList = flowTaskOperatorRecordService.getList(taskEntity.getId()); + List operatorUserList = flowOperatorUserService.getList(taskEntity.getId()); + Map> operatorNodeIdList = operatorUserList.stream().collect(Collectors.groupingBy(FlowOperatorUserEntity::getTaskNodeId)); + //流程任务 + FlowTaskModel flowTaskModel = JsonUtil.getJsonToBean(taskEntity, FlowTaskModel.class); + flowTaskModel.setType(template.getType()); + flowTaskModel.setFlowId(template.getId()); + flowTaskModel.setRejectDataId(taskEntity.getRejectId()); + flowTaskModel.setSuspend(Objects.equals(taskEntity.getFrestore(), 1)); + vo.setFlowTaskInfo(flowTaskModel); + //已办人员 + List recordList = new ArrayList<>(); + List userIdAll = new ArrayList<>(); + operatorRecordList.stream().forEach(t -> { + userIdAll.add(t.getHandleId()); + if (StringUtil.isNotEmpty(t.getOperatorId())) { + userIdAll.add(t.getOperatorId()); + } + }); + userIdAll.addAll(taskOperatorList.stream().map(FlowTaskOperatorEntity::getHandleId).collect(Collectors.toList())); + userIdAll.addAll(operatorUserList.stream().map(FlowOperatorUserEntity::getHandleId).collect(Collectors.toList())); + userIdAll.add(taskEntity.getCreatorUserId()); + if(!userIdAll.contains(userInfo.getUserId())){ + throw new WorkFlowException(MsgCode.FA021.get()); + } + List userList = serviceUtil.getUserName(userIdAll); + for (FlowTaskOperatorRecordEntity entity : operatorRecordList) { + List list = new ArrayList<>(); + if (StringUtil.isNotEmpty(entity.getTaskNodeId())) { + list.addAll(flowEventLogService.getList(ImmutableList.of(entity.getTaskNodeId()))); + } + FlowTaskOperatorRecordModel infoModel = JsonUtil.getJsonToBean(entity, FlowTaskOperatorRecordModel.class); + UserEntity operatorName = userList.stream().filter(t -> t.getId().equals(entity.getOperatorId())).findFirst().orElse(null); + infoModel.setOperatorId(operatorName != null ? operatorName.getRealName() + "/" + operatorName.getAccount() : ""); + UserEntity userName = userList.stream().filter(t -> t.getId().equals(entity.getHandleId())).findFirst().orElse(null); + infoModel.setUserName(userName != null ? userName.getRealName() + "/" + userName.getAccount() : ""); + FlowTaskOperatorEntity operatorEntity = taskOperatorList.stream().filter(t -> t.getId().equals(entity.getTaskOperatorId())).findFirst().orElse(null); + int status = 0; + if (operatorEntity != null) { + status += FlowNature.ParentId.equals(operatorEntity.getParentId()) ? 0 : 1; + infoModel.setCreatorTime(operatorEntity.getCreatorTime().getTime()); + } else { + infoModel.setCreatorTime(entity.getHandleTime().getTime()); + } + infoModel.setStatus(status); + infoModel.setIsLog(list.size() > 0); + recordList.add(infoModel); + } + vo.setFlowTaskOperatorRecordList(recordList); + //流程节点 + String[] tepId = taskEntity.getThisStepId() != null ? taskEntity.getThisStepId().split(",") : new String[]{}; + List tepIdAll = Arrays.asList(tepId); + List flowTaskNodeListAll = JsonUtil.getJsonToList(taskNodeList, FlowTaskNodeModel.class); + for (FlowTaskNodeModel model : flowTaskNodeListAll) { + if (FlowNature.AuditCompletion.equals(model.getCompletion())) { + model.setType("0"); + } + if (tepIdAll.contains(model.getNodeCode())) { + model.setType("1"); + if (FlowNature.NodeEnd.equals(model.getNodeCode())) { + model.setType("0"); + } + } + //查询审批人 + ChildNodeList childNode = JsonUtil.getJsonToBean(model.getNodePropertyJson(), ChildNodeList.class); + Custom custom = childNode.getCustom(); + Properties properties = childNode.getProperties(); + Integer type = properties.getAssigneeType(); + List operatorList = new ArrayList<>(); + TaskOperator taskOperator = new TaskOperator(); + taskOperator.setChildNode(childNode); + taskOperator.setTaskEntity(taskEntity); + taskOperator.setFlowModel(flowModel); + taskOperator.setDetails(false); + taskOperator.setVerify(false); + taskOperator.setExtraRule(true); + taskOperator.setTaskNodeList(taskNodeList); + List userName = new ArrayList<>(); + if (FlowNature.NodeStart.equals(custom.getType())) { + UserEntity startUser = userList.stream().filter(t -> t.getId().equals(taskEntity.getCreatorUserId())).findFirst().orElse(null); + userName.add(startUser != null ? startUser.getRealName() + "/" + startUser.getAccount() : ""); + } else if (FlowNature.NodeSubFlow.equals(custom.getType())) { + List list = new ArrayList<>(); + List taskListAll = new ArrayList() {{ + addAll(childNode.getCustom().getAsyncTaskList()); + addAll(childNode.getCustom().getTaskId()); + }}; + if (taskListAll.size() > 0) { + //子流程人员 + List childList = flowTaskService.getOrderStaList(taskListAll, FlowTaskEntity::getCreatorUserId).stream().map(FlowTaskEntity::getCreatorUserId).collect(Collectors.toList()); + List subFlowUserList = serviceUtil.getUserName(childList); + list.addAll(subFlowUserList); + } else { + TaskOperator taskChild = new TaskOperator(); + taskChild.setChildNode(childNode); + taskChild.setTaskEntity(taskEntity); + taskChild.setFlowModel(flowModel); + taskChild.setTaskNodeList(taskNodeList); + taskChild.setVerify(false); + list.addAll(flowTaskUtil.childSaveList(taskChild)); + } + List nameList = new ArrayList<>(); + for (UserEntity entity : list) { + nameList.add(entity.getRealName() + "/" + entity.getAccount()); + } + userName.addAll(nameList); + } else if (!FlowNature.NodeEnd.equals(custom.getNodeId())) { + List operatorUser = new ArrayList<>(); + List list = nodeIdList.get(model.getId()) != null ? nodeIdList.get(model.getId()).stream().map(FlowTaskOperatorEntity::getHandleId).collect(Collectors.toList()) : new ArrayList<>(); + List operatorUserIdList = operatorNodeIdList.get(model.getId()) != null ? operatorNodeIdList.get(model.getId()).stream().map(FlowOperatorUserEntity::getHandleId).collect(Collectors.toList()) : new ArrayList<>(); + Set userAll = new LinkedHashSet() {{ + addAll(operatorUserIdList.size() > 0 ? operatorUserIdList : list); + }}; + for (String userId : userAll) { + operatorUser.addAll(userList.stream().filter(t -> t.getId().equals(userId)).collect(Collectors.toList())); + } + boolean isShow = true; + //环节还没有经过和当前不显示审批人 + if (isRejectId) { + if (FlowTaskOperatorEnum.Tache.getCode().equals(type) || FlowTaskOperatorEnum.Candidate.getCode().equals(type)) { + List typeList = ImmutableList.of("0", "1"); + boolean completion = typeList.contains(model.getType()); + if (!completion) { + isShow = false; + } + } + } + if (isShow) { + if (userAll.size() == 0) { + flowTaskUtil.operator(operatorList, taskOperator); + List handleId = operatorList.stream().map(FlowTaskOperatorEntity::getHandleId).collect(Collectors.toList()); + List operator = serviceUtil.getUserName(handleId); + operatorUser.addAll(operator); + } + List nameList = new ArrayList<>(); + for (UserEntity operator : operatorUser) { + nameList.add(operator.getRealName() + "/" + operator.getAccount()); + } + userName.addAll(nameList); + } + } + model.setUserName(String.join(",", userName)); + } + vo.setFlowTaskNodeList(flowTaskNodeListAll); + String taskNodeId = flowModel.getTaskNodeId(); + boolean isRestore = StringUtil.isNotEmpty(operatorId) || StringUtil.isNotEmpty(taskNodeId); + if (isRestore) { + //草稿数据、复活数据 + FlowTaskOperatorEntity operator = taskOperatorList.stream().filter(t -> t.getId().equals(operatorId)).findFirst().orElse(null); + boolean isOperator = operator != null; + String draftTaskNodeId = isOperator ? operator.getTaskNodeId() : taskNodeId; + if (isOperator) { + vo.getFlowTaskInfo().setThisStep(operator.getNodeName()); + } + FlowTaskNodeEntity taskNode = taskNodeList.stream().filter(t -> t.getId().equals(draftTaskNodeId)).findFirst().orElse(null); + List versionList = ImmutableList.of(TableFeildsEnum.VERSION.getField()); + Map draftDataAll = new HashMap<>(); + if (taskNode != null) { + Map objectMap = flowTaskUtil.infoData(taskNode.getFormId(), taskEntity.getId()); + //草稿数据 + Map operatorData = isOperator && StringUtil.isNotEmpty(operator.getDraftData()) ? JsonUtil.stringToMap(operator.getDraftData()) : null; + //复活数据 + Map taskNodeData = StringUtil.isNotEmpty(taskNode.getDraftData()) && StringUtil.isNotEmpty(taskEntity.getTaskNodeId()) ? JsonUtil.stringToMap(taskNode.getDraftData()) : null; + Map draftData = operatorData != null ? operatorData : taskNodeData; + if (draftData != null) { + draftData.keySet().removeIf(key -> versionList.contains(key.toLowerCase())); + objectMap.putAll(draftData); + draftDataAll.putAll(objectMap); + vo.setDraftData(draftDataAll); + num++; + } + childNodeAll = JsonUtil.getJsonToBean(taskNode.getNodePropertyJson(), ChildNodeList.class); + List> formOperates = flowTaskUtil.formOperates(childNodeAll); + childNodeAll.getProperties().setFormOperates(formOperates); + formId = taskNode.getFormId(); + } + } + //流程监控权限 + if (!userInfo.getIsAdministrator()) { + List organizeUserList = serviceUtil.getOrganizeUserList("edit"); + vo.setNoOperateAuth(!organizeUserList.contains(taskEntity.getCreatorUserId())); + } + } + VisualdevEntity form = serviceUtil.getForm(formId); + vo.setFlowFormInfo(JsonUtil.getJsonToBean(form, FlowFormVo.class)); + Properties approversProperties = childNodeAll.getProperties(); + vo.setApproversProperties(approversProperties); + vo.setFormOperates(approversProperties.getFormOperates()); + FlowTemplateModel templateModel = JsonUtil.getJsonToBean(templateJson, FlowTemplateModel.class); + templateModel.setType(template.getType()); + templateModel.setFullName(templateJson.getFullName()); + vo.setFlowTemplateInfo(templateModel); + if (!parentId && num == 0) { + vo.setFormData(serviceUtil.infoData(formId, flowModel.getId())); + } + return vo; + } + + @Override + public List recordList(String id, String category, String type) { + //审批汇总 + List handleStatus = new ArrayList<>(); + if (!"0".equals(type)) { + handleStatus.add(0); + handleStatus.add(1); + } + List recordListAll = flowTaskOperatorRecordService.getRecordList(id, handleStatus); + List userIdAll = new ArrayList<>(); + List userIdList = recordListAll.stream().map(FlowTaskOperatorRecordEntity::getHandleId).collect(Collectors.toList()); + List operatorId = recordListAll.stream().filter(t -> StringUtil.isNotEmpty(t.getOperatorId())).map(FlowTaskOperatorRecordEntity::getOperatorId).collect(Collectors.toList()); + userIdAll.addAll(userIdList); + userIdAll.addAll(operatorId); + List userList = serviceUtil.getUserName(userIdAll); + List list = new ArrayList<>(); + Map map = new HashMap<>(); + Map> operatorAll = new HashMap<>(); + if (FlowRecordListEnum.position.getCode().equals(category)) { + List userId = userList.stream().map(UserEntity::getId).collect(Collectors.toList()); + List relationList = serviceUtil.getListByUserIdAll(userId); + List objectId = relationList.stream().map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + List positionListAll = serviceUtil.getPositionName(objectId); + for (PositionEntity entity : positionListAll) { + map.put(entity.getId(), entity.getFullName()); + List userAll = relationList.stream().filter(t -> t.getObjectId().equals(entity.getId())).map(UserRelationEntity::getUserId).collect(Collectors.toList()); + List operator = new ArrayList<>(); + for (FlowTaskOperatorRecordEntity recordEntity : recordListAll) { + if (userAll.contains(recordEntity.getHandleId())) { + operator.add(recordEntity); + } + } + operatorAll.put(entity.getId(), operator); + } + } else if (FlowRecordListEnum.role.getCode().equals(category)) { + List userId = userList.stream().map(UserEntity::getId).collect(Collectors.toList()); + List relationList = serviceUtil.getListByUserIdAll(userId); + List objectId = relationList.stream().map(UserRelationEntity::getObjectId).collect(Collectors.toList()); + List roleListAll = serviceUtil.getListByIds(objectId); + for (RoleEntity entity : roleListAll) { + map.put(entity.getId(), entity.getFullName()); + List userAll = relationList.stream().filter(t -> t.getObjectId().equals(entity.getId())).map(UserRelationEntity::getUserId).collect(Collectors.toList()); + List operator = new ArrayList<>(); + for (FlowTaskOperatorRecordEntity recordEntity : recordListAll) { + if (userAll.contains(recordEntity.getHandleId())) { + operator.add(recordEntity); + } + } + operatorAll.put(entity.getId(), operator); + } + } else if (FlowRecordListEnum.department.getCode().equals(category)) { + List organizeList = userList.stream().map(UserEntity::getOrganizeId).collect(Collectors.toList()); + List organizeListAll = serviceUtil.getOrganizeName(organizeList); + for (OrganizeEntity entity : organizeListAll) { + map.put(entity.getId(), entity.getFullName()); + List userAll = userList.stream().filter(t -> t.getOrganizeId().equals(entity.getId())).map(UserEntity::getId).collect(Collectors.toList()); + List operator = new ArrayList<>(); + for (FlowTaskOperatorRecordEntity recordEntity : recordListAll) { + if (userAll.contains(recordEntity.getHandleId())) { + operator.add(recordEntity); + } + } + operatorAll.put(entity.getId(), operator); + } + } + for (String key : map.keySet()) { + String fullName = map.get(key); + FlowSummary summary = new FlowSummary(); + summary.setId(key); + summary.setFullName(fullName); + List recordList = operatorAll.get(key); + List childList = new ArrayList<>(); + for (FlowTaskOperatorRecordEntity entity : recordList) { + FlowSummary childSummary = JsonUtil.getJsonToBean(entity, FlowSummary.class); + UserEntity user = userList.stream().filter(t -> t.getId().equals(entity.getHandleId())).findFirst().orElse(null); + childSummary.setUserName(user != null ? user.getRealName() + "/" + user.getAccount() : ""); + UserEntity userEntity = userList.stream().filter(t -> t.getId().equals(entity.getOperatorId())).findFirst().orElse(null); + childSummary.setOperatorId(userEntity != null ? userEntity.getRealName() + "/" + userEntity.getAccount() : ""); + childSummary.setHeadIcon(UploaderUtil.uploaderImg(user.getHeadIcon())); + childList.add(childSummary); + } + summary.setList(childList); + list.add(summary); + } + return list; + } + + @Override + public boolean press(String id, FlowModel flowModel) throws WorkFlowException { + FlowTaskEntity flowTaskEntity = flowTaskService.getInfo(id, + FlowTaskEntity::getId, FlowTaskEntity::getFullName, FlowTaskEntity::getStatus, + FlowTaskEntity::getCreatorUserId, FlowTaskEntity::getFlowId + ); + FlowTemplateAllModel templateAllModel = flowTaskUtil.templateJson(flowTaskEntity.getFlowId()); + Map data = flowTaskUtil.startData(templateAllModel, flowTaskEntity); + List operatorList = flowTaskOperatorService.press(id); + boolean flag = operatorList.size() > 0; + TaskNodeListModel taskNodeListModel = TaskNodeListModel.builder().id(id).state(FlowNodeEnum.Process.getCode()).build(); + List taskNodeList = flowTaskNodeService.getList(taskNodeListModel, + FlowTaskNodeEntity::getId, FlowTaskNodeEntity::getNodePropertyJson, + FlowTaskNodeEntity::getNodeCode, FlowTaskNodeEntity::getNodeName, + FlowTaskNodeEntity::getNodeType, FlowTaskNodeEntity::getFormId + ); + //发送消息 + FlowMsgModel flowMsgModel = new FlowMsgModel(); + flowMsgModel.setNodeList(taskNodeList); + flowMsgModel.setOperatorList(operatorList); + flowMsgModel.setTaskEntity(flowTaskEntity); + flowMsgModel.setData(data); + flowMsgModel.setFlowTemplateAllModel(templateAllModel); + flowMsgModel.setFlowModel(flowModel); + flowMsgUtil.message(flowMsgModel); + return flag; + } + + @Override + public FlowCandidateVO candidates(String id, FlowModel flowModel, boolean batch) throws WorkFlowException { + boolean parentId = FlowNature.ParentId.equals(id); + FlowTaskOperatorEntity operator = parentId ? null : flowTaskOperatorService.getOperatorInfo(id); + String flowTaskId = operator != null ? operator.getTaskId() : flowModel.getId(); + FlowTaskEntity flowTask = StringUtil.isNotEmpty(flowTaskId) ? flowTaskService.getInfoSubmit(flowTaskId) : null; + List childNodeListAll = flowTaskUtil.childNodeListAll(operator, flowModel); + List listVO = new ArrayList<>(); + FlowCandidateVO vo = new FlowCandidateVO(); + boolean branchFlow = childNodeListAll.stream().filter(t -> t.getCustom().getBranchFlow()).count() > 0; + int candidates = 0; + for (ChildNodeList childNodeList : childNodeListAll) { + Properties properties = childNodeList.getProperties(); + Custom custom = childNodeList.getCustom(); + String nodeId = custom.getNodeId(); + String nodeName = properties.getTitle(); + Integer assigneeType = properties.getAssigneeType(); + Integer initiateType = properties.getInitiateType(); + FlowCandidateListModel candidateVO = new FlowCandidateListModel(); + candidateVO.setNodeName(nodeName); + candidateVO.setNodeId(nodeId); + boolean isCandidates = (FlowTaskOperatorEnum.Candidate.getCode().equals(initiateType) || FlowTaskOperatorEnum.Candidate.getCode().equals(assigneeType)); + candidateVO.setIsCandidates(isCandidates); + boolean isBranchFlow = custom.getBranchFlow(); + candidateVO.setIsBranchFlow(isBranchFlow); + if (isCandidates) { + List list = new ArrayList<>(); + list.addAll(properties.getApprovers()); + list.addAll(properties.getInitiator()); + List userId = serviceUtil.getUserListAll(list); + Pagination pagination = JsonUtil.getJsonToBean(flowModel, Pagination.class); + List userName = serviceUtil.getUserName(userId, pagination); + candidateVO.setHasCandidates(userName.size() > 0); + } + candidates += isCandidates ? 1 : 0; + listVO.add(candidateVO); + } + if (batch && branchFlow) { + throw new WorkFlowException(MsgCode.WF039.get()); + } + int flowType = branchFlow ? 1 : candidates > 0 ? 2 : 3; + if (operator != null) { + permissions(operator.getHandleId(), flowTask, operator, "", flowModel); + if (branchFlow) { + FlowTaskNodeEntity taskNode = flowTaskNodeService.getInfo(operator.getTaskNodeId(), FlowTaskNodeEntity::getId, FlowTaskNodeEntity::getTaskId, FlowTaskNodeEntity::getNodePropertyJson); + List operatorList = flowTaskOperatorService.getList(operator.getTaskId()).stream().filter(t -> t.getTaskNodeId().equals(operator.getTaskNodeId()) && FlowNodeEnum.Process.getCode().equals(t.getState())).collect(Collectors.toList()); + operatorList.stream().forEach(t -> { + if (t.getId().equals(id)) { + t.setCompletion(FlowNature.AuditCompletion); + } + if (StringUtil.isEmpty(t.getRollbackId()) && !FlowNature.ParentId.equals(t.getParentId())) { + t.setCompletion(FlowNature.AuditCompletion); + } + }); + FlowCountersignModel countersign = new FlowCountersignModel(); + countersign.setTaskNode(taskNode); + countersign.setOperatorList(operatorList); + boolean isCountersign = flowTaskUtil.isCountersign(countersign); + flowType = isCountersign ? flowType : branchFlow ? 3 : candidates > 0 ? 2 : 3; + } + if (!FlowNature.ParentId.equals(operator.getParentId())) { + flowType = 3; + } + } + if (flowTask != null && StringUtil.isNotEmpty(flowTask.getRejectId())) { + flowType = 3; + } + vo.setType(flowType); + vo.setList(listVO); + return vo; + } + + @Override + public List candidateUser(String id, FlowModel flowModel) throws WorkFlowException { + List dataList = new ArrayList<>(); + FlowTaskOperatorEntity operator = flowTaskOperatorService.getOperatorInfo(id); + List childNodeListAll = flowTaskUtil.childNodeListAll(operator, flowModel); + for (ChildNodeList childNodeList : childNodeListAll) { + Properties properties = childNodeList.getProperties(); + List list = new ArrayList<>(); + list.addAll(properties.getApprovers()); + list.addAll(properties.getInitiator()); + List userId = serviceUtil.getUserListAll(list); + Pagination pagination = JsonUtil.getJsonToBean(flowModel, Pagination.class); + List userName = serviceUtil.getUserName(userId, pagination); + flowModel.setTotal(pagination.getTotal()); + List userIdAll = userName.stream().map(UserEntity::getId).collect(Collectors.toList()); + Map> userMap = serviceUtil.getListByUserIdAll(userIdAll).stream().filter(t -> PermissionConst.ORGANIZE.equals(t.getObjectType())).collect(Collectors.groupingBy(UserRelationEntity::getUserId)); + for (UserEntity entity : userName) { + List listByUserId = userMap.get(entity.getId()) != null ? userMap.get(entity.getId()) : new ArrayList<>(); + StringJoiner joiner = new StringJoiner(","); + for (UserRelationEntity relation : listByUserId) { + List organizeId = serviceUtil.getOrganizeId(relation.getObjectId()); + if (organizeId.size() > 0) { + String organizeName = organizeId.stream().map(OrganizeEntity::getFullName).collect(Collectors.joining("/")); + joiner.add(organizeName); + } + } + FlowCandidateUserModel userModel = JsonUtil.getJsonToBean(entity, FlowCandidateUserModel.class); + userModel.setFullName(entity.getRealName() + "/" + entity.getAccount()); + userModel.setHeadIcon(UploaderUtil.uploaderImg(entity.getHeadIcon())); + userModel.setOrganize(joiner.toString()); + dataList.add(userModel); + } + } + return dataList; + } + + @Override + @DSTransactional + public void batch(FlowModel flowModel) throws WorkFlowException { + List idList = flowModel.getIds(); + Integer batchType = flowModel.getBatchType(); + for (String id : idList) { + FlowModel model = JsonUtil.getJsonToBean(flowModel, FlowModel.class); + model.setId(id); + switch (batchType) { + case 0: + model.setVoluntarily(true); + audit(model); + break; + case 1: + reject(model); + break; + case 2: + transfer(model); + break; + default: + break; + } + } + } + + @Override + public FlowCandidateVO batchCandidates(String flowId, String taskOperatorId, FlowModel flowModel) throws WorkFlowException { + FlowTemplateAllModel templateAllModel = flowTaskUtil.templateJson(flowId); + FlowTemplateJsonEntity templateJson = templateAllModel.getTemplateJson(); + FlowTaskOperatorEntity operator = flowTaskOperatorService.getInfo(taskOperatorId); + FlowTaskNodeEntity taskNode = flowTaskNodeService.getInfo(operator.getTaskNodeId(), FlowTaskNodeEntity::getNodeNext, FlowTaskNodeEntity::getId); + ChildNode childNodeAll = JsonUtil.getJsonToBean(templateJson.getFlowTemplateJson(), ChildNode.class); + //获取流程节点 + List nodeListAll = new ArrayList<>(); + List conditionListAll = new ArrayList<>(); + //递归获取条件数据和节点数据 + FlowJsonUtil.getTemplateAll(childNodeAll, nodeListAll, conditionListAll); + //判断节点是否有在条件中 + boolean isCondition = conditionListAll.stream().filter(t -> operator.getNodeCode().equals(t.getPrevId())).count() > 0; + List freeApprover = new ArrayList<>(); + List branchFlow = new ArrayList<>(); + if (isCondition) { + List nodeNext = StringUtil.isNotEmpty(taskNode.getNodeNext()) ? Arrays.asList(taskNode.getNodeNext().split(",")) : new ArrayList<>(); + List nextList = nodeListAll.stream().filter(t -> nodeNext.contains(t.getCustom().getNodeId())).collect(Collectors.toList()); + nextList.stream().forEach(t -> { + if (FlowTaskOperatorEnum.Candidate.getCode().equals(t.getProperties().getAssigneeType())) { + freeApprover.add(t); + } + if (t.getCustom().getBranchFlow()) { + branchFlow.add(t); + } + }); + } + if (freeApprover.size() > 0) { + throw new WorkFlowException(MsgCode.WF040.get()); + } + if (branchFlow.size() > 0) { + throw new WorkFlowException(MsgCode.WF039.get()); + } + return candidates(taskOperatorId, flowModel, true); + } + + @Override + public void permissions(String userId, FlowTaskEntity flowTask, FlowTaskOperatorEntity operator, String msg, FlowModel flowModel) throws WorkFlowException { + UserInfo userInfo = flowModel.getUserInfo(); + if (operator == null || FlowNodeEnum.Futility.getCode().equals(operator.getState())) { + throw new WorkFlowException(StringUtil.isEmpty(msg) ? MsgCode.FA021.get() : msg); + } + List flowDelegateList = flowDelegateService.getUser(userId, flowTask.getTemplateId(), userInfo.getUserId()).stream().map(FlowDelegateEntity::getToUserId).collect(Collectors.toList()); + flowDelegateList.add(userId); + if (!flowDelegateList.contains(userInfo.getUserId())) { + throw new WorkFlowException(MsgCode.FA021.get()); + } + if (FlowTaskStatusEnum.Cancel.getCode().equals(flowTask.getStatus())) { + throw new WorkFlowException(MsgCode.WF041.get()); + } + if (FlowTaskStatusEnum.Revoke.getCode().equals(flowTask.getStatus())) { + throw new WorkFlowException(MsgCode.WF042.get()); + } + } + + @Override + @DSTransactional + public void change(FlowModel flowModel) throws WorkFlowException { + UserInfo userInfo = flowModel.getUserInfo(); + FlowTaskEntity flowTask = flowTaskService.getInfo(flowModel.getTaskId()); + List thisStepId = Arrays.asList(flowTask.getThisStepId().split(",")); + //获取节点 + TaskNodeListModel nodeListModel = TaskNodeListModel.builder().id(flowModel.getTaskId()).state(FlowNodeEnum.Process.getCode()).build(); + List taskNodeList = flowTaskNodeService.getList(nodeListModel, + FlowTaskNodeEntity::getNodeCode, FlowTaskNodeEntity::getId, FlowTaskNodeEntity::getFormId, + FlowTaskNodeEntity::getNodeNext, FlowTaskNodeEntity::getNodeType, FlowTaskNodeEntity::getDraftData, + FlowTaskNodeEntity::getNodePropertyJson, FlowTaskNodeEntity::getNodeName, FlowTaskNodeEntity::getTaskId + ); + FlowTaskNodeEntity taskNodeEntity = taskNodeList.stream().filter(t -> t.getId().equals(flowModel.getTaskNodeId())).findFirst().orElse(null); + FlowTemplateAllModel templateAllModel = flowTaskUtil.templateJson(flowTask.getFlowId()); + boolean resurgence = flowModel.getResurgence(); + ChildNodeList childNode = JsonUtil.getJsonToBean(taskNodeEntity.getNodePropertyJson(), ChildNodeList.class); + if (resurgence) { + flowTask.setTaskNodeId(flowModel.getTaskNodeId()); + flowTask.setParentId(FlowNature.ParentId); + flowTask.setStatus(FlowNature.NodeStart.equals(taskNodeEntity.getNodeType()) ? FlowTaskStatusEnum.Draft.getCode() : FlowTaskStatusEnum.Handle.getCode()); + if (Objects.equals(FlowNature.ResurgenceThis, childNode.getProperties().getResurgenceDataRule())) { + if (StringUtil.isEmpty(taskNodeEntity.getDraftData())) { + throw new WorkFlowException(MsgCode.WF043.get()); + } + } else { + Map objectMap = serviceUtil.infoData(taskNodeEntity.getFormId(), flowTask.getId()); + if (ObjectUtil.isEmpty(objectMap)) { + throw new WorkFlowException(MsgCode.WF043.get()); + } + } + } + List handleStatus = ImmutableList.of(FlowRecordEnum.audit.getCode(), FlowRecordEnum.submit.getCode()); + FlowTaskOperatorRecordEntity record = flowTaskOperatorRecordService.getList(flowTask.getId()).stream().filter(t -> handleStatus.contains(t.getHandleStatus())).sorted(Comparator.comparing(FlowTaskOperatorRecordEntity::getHandleTime).reversed()).findFirst().orElse(null); + List nodeListAll = taskNodeList.stream().filter(t -> t.getNodeCode().equals(record.getNodeCode())).collect(Collectors.toList()); + for (FlowTaskNodeEntity nodeEntity : nodeListAll) { + String formId = nodeEntity.getFormId(); + //验证变更是否同表单 + if (!resurgence && !taskNodeEntity.getFormId().equals(formId)) { + throw new WorkFlowException(MsgCode.WF044.get()); + } + } + //当前节点是子流程不能变更 + List thisTaskNodeList = taskNodeList.stream().filter(t -> thisStepId.contains(t.getNodeCode())).collect(Collectors.toList()); + boolean isChild = thisTaskNodeList.stream().filter(t -> FlowNature.NodeSubFlow.equals(t.getNodeType())).count() > 0; + if (isChild) { + throw new WorkFlowException(MsgCode.WF045.get()); + } + flowTaskNodeService.update(taskNodeEntity); + String nodeId = childNode.getCustom().getNodeId(); + Properties properties = childNode.getProperties(); + Integer progress = properties.getProgress(); + String title = properties.getTitle(); + flowTask.setThisStepId(taskNodeEntity.getNodeCode()); + flowTask.setThisStep(taskNodeEntity.getNodeName()); + flowTask.setRejectId(null); + flowTask.setCompletion(progress); + flowTaskService.update(flowTask); + //获取节点 + List id = taskNodeList.stream().map(FlowTaskNodeEntity::getId).collect(Collectors.toList()); + flowCandidatesService.deleteTaskNodeId(id); + flowTaskNodeService.updateCompletion(id, FlowNature.AuditCompletion); + List nextTaskNodeList = taskNodeList.stream().filter(t -> thisStepId.contains(t.getNodeCode())).collect(Collectors.toList()); + for (FlowTaskNodeEntity nodeEntity : nextTaskNodeList) { + List idList = new ArrayList<>(); + flowTaskUtil.change(taskNodeList, nodeEntity, false, FlowNature.AuditCompletion, idList); + if (FlowNature.NodeSubFlow.equals(nodeEntity.getNodeType())) { + ChildNodeList nodeModel = JsonUtil.getJsonToBean(nodeEntity.getNodePropertyJson(), ChildNodeList.class); + List idAll = nodeModel.getCustom().getTaskId(); + flowTaskService.deleteChildAll(idAll); + } + } + if (taskNodeEntity != null) { + List idList = new ArrayList<>(); + flowTaskUtil.change(taskNodeList, taskNodeEntity, resurgence, FlowNature.ProcessCompletion, idList); + taskNodeEntity.setCompletion(FlowNature.ProcessCompletion); + flowTaskNodeService.update(taskNodeEntity); + } + Set rejectNodeList = taskNodeList.stream().map(FlowTaskNodeEntity::getId).collect(Collectors.toSet()); + flowTaskOperatorService.updateReject(flowModel.getTaskId(), rejectNodeList); + flowOperatorUserService.updateReject(flowModel.getTaskId(), rejectNodeList); + Set recordNodeList = new HashSet<>(); + List delTaskNode = ImmutableList.of(flowModel.getTaskNodeId()); + flowTaskUtil.upAll(recordNodeList, delTaskNode, taskNodeList); + flowTaskOperatorRecordService.updateStatus(recordNodeList, flowTask.getId()); + List operatorList = new ArrayList<>(); + List nextOperatorList = new ArrayList<>(); + nextOperatorList.add(childNode); + flowModel.setFormData(JsonUtil.stringToMap(flowTask.getFlowFormContentJson())); + flowModel.setHandleOpinion(flowModel.getHandleOpinion()); + //查询审批人 + TaskOperator taskOperator = new TaskOperator(); + taskOperator.setChildNode(childNode); + taskOperator.setTaskNodeList(taskNodeList); + taskOperator.setTaskEntity(flowTask); + taskOperator.setFlowModel(flowModel); + taskOperator.setExtraRule(true); + //插入新的候选人 + List userIdAll = flowTaskUtil.userListAll(taskOperator); + Map> candidateErrorList = flowModel.getErrorRuleUserList(); + for (String key : candidateErrorList.keySet()) { + userIdAll.addAll(candidateErrorList.get(key)); + } + List userList = serviceUtil.getUserName(userIdAll, true); + if (userList.size() == 0) { + List errorList = new ArrayList() {{ + FlowErrorModel errorModel = new FlowErrorModel(); + errorModel.setNodeId(nodeId); + errorModel.setNodeName(title); + add(errorModel); + }}; + throw new WorkFlowException(200, JsonUtil.getObjectToString(errorList)); + } + for (int i = 0; i < userList.size(); i++) { + UserEntity userEntity = userList.get(i); + TaskOperatoUser taskOperatoUser = new TaskOperatoUser(); + taskOperatoUser.setDate(new Date()); + taskOperatoUser.setChildNode(childNode); + taskOperatoUser.setAutomation(""); + taskOperatoUser.setId(FlowNature.ParentId); + taskOperatoUser.setHandLeId(userEntity.getId()); + taskOperatoUser.setSortCode(i + 1); + flowTaskUtil.operatorUser(operatorList, taskOperatoUser); + } + Map> operatorMap = operatorList.stream().collect(Collectors.groupingBy(FlowTaskOperatorEntity::getTaskNodeId)); + for (ChildNodeList childNodeList : nextOperatorList) { + boolean counterSign = FlowNature.ImproperApprover.equals(childNodeList.getProperties().getCounterSign()); + if (counterSign && StringUtil.isEmpty(flowModel.getFreeApproverUserId())) { + List listAll = operatorMap.get(childNodeList.getTaskNodeId()) != null ? operatorMap.get(childNodeList.getTaskNodeId()) : new ArrayList<>(); + flowOperatorUserService.create(JsonUtil.getJsonToList(listAll, FlowOperatorUserEntity.class)); + } + } + //过滤依次审批人 + flowTaskUtil.improperApproverUser(operatorList, taskNodeList, childNode, null); + flowTaskOperatorService.create(operatorList); + //修改节点的选择分支数据 + recordNodeList.removeAll(delTaskNode); + flowTaskNodeService.updateTaskNodeCandidates(new ArrayList<>(recordNodeList), ""); + //自动审批 + FlowApproveModel approveModel = FlowApproveModel.builder().operatorList(operatorList).taskNodeList(taskNodeList).flowTask(flowTask).flowModel(flowModel).build(); + flowTaskUtil.approve(approveModel); + //审批数据赋值 + FlowTaskOperatorRecordEntity operatorRecord = new FlowTaskOperatorRecordEntity(); + FlowTaskOperatorEntity operator = new FlowTaskOperatorEntity(); + operator.setTaskId(flowTask.getId()); + operator.setHandleId(userInfo.getUserId()); + operator.setNodeCode(taskNodeEntity.getNodeCode()); + operator.setNodeName(taskNodeEntity.getNodeName()); + operator.setTaskNodeId(taskNodeEntity.getId()); + FlowOperatordModel flowOperatordModel = FlowOperatordModel.builder().status(resurgence ? FlowRecordEnum.resurrection.getCode() : FlowRecordEnum.change.getCode()).flowModel(flowModel).userId(userInfo.getUserId()).operator(operator).operatorId(operator.getHandleId()).build(); + flowTaskUtil.operatorRecord(operatorRecord, flowOperatordModel); + flowTaskOperatorRecordService.create(operatorRecord); + //发送消息 + FlowMsgModel flowMsgModel = new FlowMsgModel(); + flowMsgModel.setNodeList(taskNodeList); + flowMsgModel.setOperatorList(operatorList); + flowMsgModel.setData(flowModel.getFormData()); + flowMsgModel.setTaskNodeEntity(null); + flowMsgModel.setTaskEntity(flowTask); + flowMsgModel.setFlowModel(flowModel); + flowMsgModel.setFlowTemplateAllModel(templateAllModel); + flowMsgUtil.message(flowMsgModel); + //超时 + insTimeOutRedis(flowModel, operatorList, userInfo, flowTask, taskNodeList); + } + + @Override + public FlowRejectVO rejectList(String id, boolean batch) throws WorkFlowException { + FlowTaskOperatorEntity operator = flowTaskOperatorService.getInfo(id); + List operatorList = flowTaskOperatorService.getList(operator.getTaskId()).stream().filter(t -> FlowNodeEnum.Process.getCode().equals(t.getState())).collect(Collectors.toList()); + TaskNodeListModel taskNodeListModel = TaskNodeListModel.builder().id(operator.getTaskId()).state(FlowNodeEnum.Process.getCode()).build(); + List taskNodeList = flowTaskNodeService.getList(taskNodeListModel, + FlowTaskNodeEntity::getId, FlowTaskNodeEntity::getNodePropertyJson, + FlowTaskNodeEntity::getTaskId, FlowTaskNodeEntity::getNodeType, + FlowTaskNodeEntity::getCompletion, FlowTaskNodeEntity::getCandidates, + FlowTaskNodeEntity::getNodeCode, FlowTaskNodeEntity::getNodeNext, + FlowTaskNodeEntity::getNodeName + ); + //排除分支没有走过的节点 + FlowTaskNodeEntity nodeEntity = taskNodeList.stream().filter(t -> t.getId().equals(operator.getTaskNodeId())).findFirst().orElse(null); + flowTaskUtil.nodeList(taskNodeList); + ChildNodeList childNodeList = JsonUtil.getJsonToBean(nodeEntity.getNodePropertyJson(), ChildNodeList.class); + String rejectStep = childNodeList.getProperties().getRejectStep(); + List rejectNode = taskNodeList.stream().filter(t -> t.getNodeCode().equals(rejectStep)).collect(Collectors.toList()); + boolean up = FlowNature.UP.equals(rejectStep); + boolean reject = FlowNature.Reject.equals(rejectStep); + boolean start = FlowNature.START.equals(rejectStep); + List nodetype = ImmutableList.of(FlowNature.NodeSubFlow); + if (rejectNode.size() == 0) { + List taskNodeEntity = taskNodeList.stream().filter(t -> FlowNature.NodeStart.equals(t.getNodeType())).collect(Collectors.toList()); + if (up) { + List collect = taskNodeList.stream().filter(t -> t.getNodeNext().contains(nodeEntity.getNodeCode())).collect(Collectors.toList()); + rejectNode.addAll(collect); + List subFlowList = collect.stream().filter(t -> nodetype.contains(t.getNodeType())).collect(Collectors.toList()); + if (subFlowList.size() > 0) { + throw new WorkFlowException(MsgCode.WF046.get()); + } + } else if (reject) { + Set rejectNodeList = new HashSet<>(); + List nodeIdList = ImmutableList.of(operator.getTaskNodeId()); + flowTaskUtil.upNodeList(taskNodeList, nodeIdList, rejectNodeList, null); + rejectNode.addAll(rejectNodeList.stream().filter(t -> !nodetype.contains(t.getNodeType())).collect(Collectors.toSet())); + } else if (start) { + rejectNode.addAll(taskNodeEntity); + } + } + if (rejectNode.size() == 0) { + throw new WorkFlowException(MsgCode.WF047.get()); + } + Set rejectNodeAll = new HashSet<>(); + for (int i = 0; i < rejectNode.size(); i++) { + FlowTaskNodeEntity taskNodeEntity = rejectNode.get(i); + boolean add = operatorList.stream().filter(t -> t.getTaskNodeId().equals(taskNodeEntity.getId())).count() > 0; + if (add || !reject) { + rejectNodeAll.add(taskNodeEntity); + } + } + if (reject) { + List startNode = taskNodeList.stream().filter(t -> FlowNature.NodeStart.equals(t.getNodeType())).collect(Collectors.toList()); + rejectNodeAll.addAll(startNode); + } + Set rejectNodeList = new HashSet<>(); + if (up) { + FlowTaskNodeEntity upNode = new FlowTaskNodeEntity(); + List node = rejectNode.stream().map(FlowTaskNodeEntity::getNodeCode).collect(Collectors.toList()); + upNode.setNodeCode(String.join(",", node)); + upNode.setNodeName("上一审批"); + rejectNodeList.add(upNode); + } else { + rejectNodeList.addAll(rejectNodeAll); + } + List nodeList = JsonUtil.getJsonToList(rejectNodeList, TaskNodeModel.class); + List rejectOperatorList = operatorList.stream().filter(t -> t.getTaskNodeId().equals(operator.getTaskNodeId())).collect(Collectors.toList()); + rejectOperatorList.stream().forEach(t -> { + if (t.getId().equals(id)) { + t.setCompletion(FlowNature.RejectCompletion); + } + }); + FlowCountersignModel countersign = new FlowCountersignModel(); + countersign.setTaskNode(nodeEntity); + countersign.setOperatorList(rejectOperatorList); + boolean isCountersign = flowTaskUtil.isRejectCountersign(countersign); + FlowRejectVO vo = new FlowRejectVO(); + vo.setList(nodeList); + boolean appro = reject ? isCountersign ? true : false : true; + vo.setIsLastAppro(appro); + return vo; + } + + @Override + @DSTransactional + public void suspend(String id, FlowModel flowModel, boolean isSuspend) { + UserInfo userInfo = flowModel.getUserInfo(); + List idList = new ArrayList() {{ + add(id); + }}; + if (!isSuspend) { + List childList = flowTaskService.getChildList(id, FlowTaskEntity::getId, FlowTaskEntity::getFrestore); + boolean suspend = childList.stream().filter(t -> ObjectUtil.isNotEmpty(t.getFrestore()) && t.getFrestore() == 1).count() == 0; + flowModel.setSuspend(suspend); + } + flowTaskService.getChildList(id, flowModel.getSuspend(), idList); + List operatorList = flowTaskUtil.suspend(idList, isSuspend, id); + List orderStaList = flowTaskService.getOrderStaList(idList); + for (FlowTaskEntity flowTask : orderStaList) { + //恢复、挂起记录 + FlowTaskOperatorRecordEntity operatorRecord = new FlowTaskOperatorRecordEntity(); + FlowTaskOperatorEntity operator = new FlowTaskOperatorEntity(); + operator.setTaskId(flowTask.getId()); + operator.setNodeCode(flowTask.getThisStepId()); + operator.setNodeName(flowTask.getThisStep()); + //审批数据赋值 + FlowOperatordModel flowOperatordModel = FlowOperatordModel.builder().status(isSuspend ? FlowRecordEnum.suspend.getCode() : FlowRecordEnum.restore.getCode()).flowModel(flowModel).userId(userInfo.getUserId()).operator(operator).build(); + flowTaskUtil.operatorRecord(operatorRecord, flowOperatordModel); + flowTaskOperatorRecordService.create(operatorRecord); + } + //启动、停止定时器 + workTimeoutJobUtil.suspendFuture(operatorList, isSuspend); + } + + private void insTimeOutRedis(FlowModel flowModel, Collection operatorList, UserInfo userInfo, FlowTaskEntity flowTask, List nodeList) { + for (FlowTaskOperatorEntity operatorOne : operatorList) { + FlowTaskNodeEntity taskNodeEntity = nodeList.stream().filter(t -> t.getId().equals(operatorOne.getTaskNodeId())).findFirst().orElse(null); + boolean flag = ifInsRedis(taskNodeEntity, nodeList); + if (flag) { + WorkTimeoutJobModel workTimeoutJobModel = WorkTimeoutJobModel.builder().flowModel(flowModel) + .taskId(flowTask.getId()).taskNodeId(operatorOne.getTaskNodeId()).taskNodeOperatorId(operatorOne.getId()).operatorEntity(operatorOne) + .tenantId(userInfo.getTenantId()).build(); + workTimeoutJobUtil.insertRedis(workTimeoutJobModel, redisUtil); + } + } + } + + /** + * 封装超时消息 + * + * @return + */ + public boolean ifInsRedis(FlowTaskNodeEntity taskNodeEntity, List nodeList) { + ChildNodeList childNode = JsonUtil.getJsonToBean(taskNodeEntity.getNodePropertyJson(), ChildNodeList.class); + LimitModel timeLimitConfig = childNode.getProperties().getTimeLimitConfig(); + FlowTaskNodeEntity startNode = nodeList.stream().filter(t -> FlowNature.NodeStart.equals(t.getNodeType())).findFirst().orElse(null); + if (timeLimitConfig.getOn() == 0) { + return false; + } else if (timeLimitConfig.getOn() == 2) { + ChildNodeList childNodeStart = JsonUtil.getJsonToBean(startNode.getNodePropertyJson(), ChildNodeList.class); + if (childNodeStart.getProperties().getTimeLimitConfig().getOn() == 0) { + return false; + } + } + return true; + } + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowTaskNodeServiceImpl.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowTaskNodeServiceImpl.java new file mode 100644 index 0000000..7310464 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowTaskNodeServiceImpl.java @@ -0,0 +1,149 @@ +package com.yunzhupaas.engine.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.engine.entity.FlowTaskNodeEntity; +import com.yunzhupaas.engine.enums.FlowNodeEnum; +import com.yunzhupaas.engine.mapper.FlowTaskNodeMapper; +import com.yunzhupaas.engine.model.flowtasknode.TaskNodeListModel; +import com.yunzhupaas.engine.service.FlowTaskNodeService; +import com.yunzhupaas.engine.util.FlowNature; +import com.yunzhupaas.util.StringUtil; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 流程节点 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Service +public class FlowTaskNodeServiceImpl extends SuperServiceImpl implements FlowTaskNodeService { + + @Override + public List getList(String taskId, SFunction... columns) { + TaskNodeListModel nodeListModel = new TaskNodeListModel(); + nodeListModel.setId(taskId); + return getList(nodeListModel, columns); + } + + @Override + public List getList(List id, SFunction... columns) { + List list = new ArrayList<>(); + if (id.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(FlowTaskNodeEntity::getId, id); + queryWrapper.lambda().select(columns); + list.addAll(this.list(queryWrapper)); + } + return list; + } + + @Override + public List getList(TaskNodeListModel nodeListModel, SFunction... columns) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + String taskId = nodeListModel.getId(); + queryWrapper.lambda().eq(FlowTaskNodeEntity::getTaskId, taskId); + Integer state = nodeListModel.getState(); + if (ObjectUtil.isNotEmpty(state)) { + queryWrapper.lambda().eq(FlowTaskNodeEntity::getState, state); + } + Integer completion = nodeListModel.getCompletion(); + if (ObjectUtil.isNotEmpty(completion)) { + queryWrapper.lambda().eq(FlowTaskNodeEntity::getCompletion, completion); + } + String nodeCode = nodeListModel.getNotNodeCode(); + if (ObjectUtil.isNotEmpty(nodeCode)) { + queryWrapper.lambda().ne(FlowTaskNodeEntity::getNodeCode, nodeCode); + } + queryWrapper.lambda().select(columns); + return this.list(queryWrapper); + } + + @Override + public FlowTaskNodeEntity getInfo(String id, SFunction... columns) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowTaskNodeEntity::getId, id); + queryWrapper.lambda().select(columns); + return this.getOne(queryWrapper); + } + + @Override + public void deleteByTaskId(String taskId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowTaskNodeEntity::getTaskId, taskId); + this.remove(queryWrapper); + } + + @Override + public void create(FlowTaskNodeEntity entity) { + this.save(entity); + } + + @Override + public void update(FlowTaskNodeEntity entity) { + this.updateById(entity); + } + + @Override + public void update(String taskId) { + UpdateWrapper wrapper = new UpdateWrapper<>(); + wrapper.lambda().eq(FlowTaskNodeEntity::getTaskId, taskId); + wrapper.lambda().set(FlowTaskNodeEntity::getCompletion, FlowNodeEnum.Futility.getCode()); + wrapper.lambda().set(FlowTaskNodeEntity::getState, FlowNodeEnum.Futility.getCode()); + this.update(wrapper); + } + + @Override + public void updateCompletion(List id, int start) { + if (id.size() > 0) { + UpdateWrapper wrapper = new UpdateWrapper<>(); + wrapper.lambda().in(FlowTaskNodeEntity::getId, id); + wrapper.lambda().set(FlowTaskNodeEntity::getCompletion, start); + this.update(wrapper); + } + } + + @Override + public void updateTaskNode(List taskNodeLis) { + for (FlowTaskNodeEntity taskNodeLi : taskNodeLis) { + String nodeNext = StringUtil.isNotEmpty(taskNodeLi.getNodeNext()) ? taskNodeLi.getNodeNext() : FlowNature.NodeEnd; + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.lambda().eq(FlowTaskNodeEntity::getId, taskNodeLi.getId()); + updateWrapper.lambda().set(FlowTaskNodeEntity::getNodeNext, nodeNext); + updateWrapper.lambda().set(FlowTaskNodeEntity::getSortCode, taskNodeLi.getSortCode()); + updateWrapper.lambda().set(FlowTaskNodeEntity::getState, taskNodeLi.getState()); + updateWrapper.lambda().set(FlowTaskNodeEntity::getCompletion, taskNodeLi.getCompletion()); + updateWrapper.lambda().set(FlowTaskNodeEntity::getNodePropertyJson, taskNodeLi.getNodePropertyJson()); + this.update(updateWrapper); + } + } + + @Override + public void updateTaskNodeCandidates(List id, String candidates) { + if (id.size() > 0) { + UpdateWrapper wrapper = new UpdateWrapper<>(); + wrapper.lambda().in(FlowTaskNodeEntity::getId, id); + wrapper.lambda().set(FlowTaskNodeEntity::getCandidates, candidates); + this.update(wrapper); + } + } + + @Override + public void updateTaskIdList(FlowTaskNodeEntity entity) { + UpdateWrapper wrapper = new UpdateWrapper<>(); + wrapper.lambda().eq(FlowTaskNodeEntity::getId, entity.getId()); + wrapper.lambda().set(FlowTaskNodeEntity::getNodePropertyJson, entity.getNodePropertyJson()); + this.update(wrapper); + } + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowTaskOperatorRecordServiceImpl.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowTaskOperatorRecordServiceImpl.java new file mode 100644 index 0000000..d6c7844 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowTaskOperatorRecordServiceImpl.java @@ -0,0 +1,121 @@ +package com.yunzhupaas.engine.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.engine.entity.FlowTaskOperatorRecordEntity; +import com.yunzhupaas.engine.enums.FlowNodeEnum; +import com.yunzhupaas.engine.enums.FlowRecordEnum; +import com.yunzhupaas.engine.mapper.FlowTaskOperatorRecordMapper; +import com.yunzhupaas.engine.service.FlowTaskOperatorRecordService; +import com.yunzhupaas.util.RandomUtil; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Set; + +/** + * 流程经办 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Service +public class FlowTaskOperatorRecordServiceImpl extends SuperServiceImpl implements FlowTaskOperatorRecordService { + + + @Override + public List getList(String taskId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowTaskOperatorRecordEntity::getTaskId, taskId).orderByAsc(FlowTaskOperatorRecordEntity::getHandleTime); + return this.list(queryWrapper); + } + + @Override + public List getRecordList(String taskId, List handleStatus) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowTaskOperatorRecordEntity::getTaskId, taskId); + if (handleStatus.size() > 0) { + queryWrapper.lambda().in(FlowTaskOperatorRecordEntity::getHandleStatus, handleStatus); + } + queryWrapper.lambda().orderByDesc(FlowTaskOperatorRecordEntity::getHandleTime); + return this.list(queryWrapper); + } + + @Override + public FlowTaskOperatorRecordEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowTaskOperatorRecordEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public void delete(FlowTaskOperatorRecordEntity entity) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowTaskOperatorRecordEntity::getId, entity.getId()); + this.remove(queryWrapper); + } + + @Override + public void create(FlowTaskOperatorRecordEntity entity) { + entity.setId(RandomUtil.uuId()); + this.save(entity); + } + + @Override + public void update(String id, FlowTaskOperatorRecordEntity entity) { + entity.setId(id); + this.updateById(entity); + } + + @Override + public void updateStatus(Set taskNodeId, String taskId) { + if (taskNodeId.size() > 0) { + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.lambda().in(FlowTaskOperatorRecordEntity::getTaskNodeId, taskNodeId); + updateWrapper.lambda().eq(FlowTaskOperatorRecordEntity::getTaskId, taskId); + updateWrapper.lambda().set(FlowTaskOperatorRecordEntity::getStatus, FlowRecordEnum.revoke.getCode()); + this.update(updateWrapper); + } + } + + @Override + public FlowTaskOperatorRecordEntity getInfo(String taskId, String taskNodeId, String taskOperatorId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowTaskOperatorRecordEntity::getTaskId, taskId); + queryWrapper.lambda().eq(FlowTaskOperatorRecordEntity::getTaskNodeId, taskNodeId); + queryWrapper.lambda().eq(FlowTaskOperatorRecordEntity::getTaskOperatorId, taskOperatorId); + queryWrapper.lambda().eq(FlowTaskOperatorRecordEntity::getStatus, FlowNodeEnum.FreeApprover.getCode()); + queryWrapper.lambda().eq(FlowTaskOperatorRecordEntity::getHandleStatus, FlowRecordEnum.audit.getCode()); + return this.getOne(queryWrapper); + } + + @Override + public void updateStatus(List idAll) { + if (idAll.size() > 0) { + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.lambda().in(FlowTaskOperatorRecordEntity::getId, idAll); + updateWrapper.lambda().set(FlowTaskOperatorRecordEntity::getStatus, FlowRecordEnum.revoke.getCode()); + this.update(updateWrapper); + } + } + + @Override + public void update(String taskId) { + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.lambda().eq(FlowTaskOperatorRecordEntity::getTaskId, taskId); + updateWrapper.lambda().set(FlowTaskOperatorRecordEntity::getStatus, FlowRecordEnum.revoke.getCode()); + this.update(updateWrapper); + } + + @Override + public FlowTaskOperatorRecordEntity getIsCheck(String taskOperatorId, Integer status) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowTaskOperatorRecordEntity::getTaskOperatorId, taskOperatorId); + queryWrapper.lambda().eq(FlowTaskOperatorRecordEntity::getStatus, status); + return this.getOne(queryWrapper); + } +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowTaskOperatorServiceImpl.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowTaskOperatorServiceImpl.java new file mode 100644 index 0000000..0e02694 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowTaskOperatorServiceImpl.java @@ -0,0 +1,168 @@ +package com.yunzhupaas.engine.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.engine.entity.FlowDelegateEntity; +import com.yunzhupaas.engine.entity.FlowTaskOperatorEntity; +import com.yunzhupaas.engine.enums.FlowNodeEnum; +import com.yunzhupaas.engine.mapper.FlowTaskOperatorMapper; +import com.yunzhupaas.engine.service.FlowDelegateService; +import com.yunzhupaas.engine.service.FlowTaskOperatorService; +import com.yunzhupaas.engine.util.FlowNature; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * 流程经办记录 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Service +public class FlowTaskOperatorServiceImpl extends SuperServiceImpl implements FlowTaskOperatorService { + + + @Autowired + private FlowDelegateService flowDelegateService; + + @Override + public List getList(String taskId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowTaskOperatorEntity::getTaskId, taskId).orderByDesc(FlowTaskOperatorEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public FlowTaskOperatorEntity getInfo(String id) throws WorkFlowException { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowTaskOperatorEntity::getId, id); + FlowTaskOperatorEntity entity = this.getOne(queryWrapper); + if (entity == null) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + return entity; + } + + @Override + public FlowTaskOperatorEntity getOperatorInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowTaskOperatorEntity::getId, id); + FlowTaskOperatorEntity entity = this.getOne(queryWrapper); + return entity; + } + + + @Override + public void create(List entitys) { + for (FlowTaskOperatorEntity entity : entitys) { + this.save(entity); + } + } + + @Override + public void update(FlowTaskOperatorEntity entity) { + this.updateById(entity); + } + + @Override + public void update(String taskNodeId, List userId, String completion) { + if (userId.size() > 0) { + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.lambda().eq(FlowTaskOperatorEntity::getTaskNodeId, taskNodeId); + updateWrapper.lambda().in(FlowTaskOperatorEntity::getHandleId, userId); + updateWrapper.lambda().set(FlowTaskOperatorEntity::getCompletion, FlowNature.AuditCompletion); + this.update(updateWrapper); + } + } + + @Override + public void update(String taskNodeId, Integer type) { + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.lambda().eq(FlowTaskOperatorEntity::getTaskNodeId, taskNodeId); + updateWrapper.lambda().eq(FlowTaskOperatorEntity::getType, type); + updateWrapper.lambda().set(FlowTaskOperatorEntity::getCompletion, FlowNature.AuditCompletion); + this.update(updateWrapper); + } + + @Override + public void update(String taskId) { + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.lambda().eq(FlowTaskOperatorEntity::getTaskId, taskId); + updateWrapper.lambda().set(FlowTaskOperatorEntity::getState, FlowNodeEnum.Futility.getCode()); + this.update(updateWrapper); + } + + @Override + public List press(String taskId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowTaskOperatorEntity::getCompletion, FlowNature.ProcessCompletion) + .eq(FlowTaskOperatorEntity::getTaskId, taskId) + .eq(FlowTaskOperatorEntity::getState, FlowNodeEnum.Process.getCode() + ""); + return this.list(queryWrapper); + } + + @Override + public void updateReject(String taskId, Set taskNodeId) { + if (taskNodeId.size() > 0) { + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.lambda().eq(FlowTaskOperatorEntity::getTaskId, taskId); + updateWrapper.lambda().in(FlowTaskOperatorEntity::getTaskNodeId, taskNodeId); + updateWrapper.lambda().set(FlowTaskOperatorEntity::getState, FlowNodeEnum.Futility.getCode()); + this.update(updateWrapper); + } + } + + @Override + public void deleteList(List idAll) { + if (idAll.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(FlowTaskOperatorEntity::getId, idAll); + this.remove(queryWrapper); + } + } + + @Override + public List getParentId(String parentId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowTaskOperatorEntity::getAppendHandleId, parentId); + queryWrapper.lambda().orderByDesc(FlowTaskOperatorEntity::getCreatorTime); + return this.list(queryWrapper); + } + + @Override + public void updateTaskOperatorState(List idAll) { + if (idAll.size() > 0) { + UpdateWrapper queryWrapper = new UpdateWrapper<>(); + queryWrapper.lambda().in(FlowTaskOperatorEntity::getId, idAll); + queryWrapper.lambda().set(FlowTaskOperatorEntity::getState, FlowNodeEnum.Futility.getCode()); + queryWrapper.lambda().set(FlowTaskOperatorEntity::getCompletion, FlowNature.RejectCompletion); + this.update(queryWrapper); + } + } + + @Override + public List getBatchList() { + UserInfo userInfo = UserProvider.getUser(); + List userList = flowDelegateService.getUser(userInfo.getUserId()).stream().map(FlowDelegateEntity::getCreatorUserId).collect(Collectors.toList()); + userList.add(userInfo.getUserId()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(FlowTaskOperatorEntity::getHandleId, userList); + queryWrapper.lambda().eq(FlowTaskOperatorEntity::getCompletion, FlowNature.ProcessCompletion); + queryWrapper.lambda().eq(FlowTaskOperatorEntity::getState, FlowNature.ProcessCompletion); + queryWrapper.lambda().select(FlowTaskOperatorEntity::getTaskId); + return list(queryWrapper); + } + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowTaskServiceImpl.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowTaskServiceImpl.java new file mode 100644 index 0000000..f540f9e --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowTaskServiceImpl.java @@ -0,0 +1,911 @@ +package com.yunzhupaas.engine.service.impl; + + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.github.yulichang.toolkit.JoinWrappers; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.google.common.collect.ImmutableList; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.engine.entity.*; +import com.yunzhupaas.engine.enums.FlowNodeEnum; +import com.yunzhupaas.engine.enums.FlowTaskStatusEnum; +import com.yunzhupaas.engine.mapper.FlowTaskMapper; +import com.yunzhupaas.engine.model.flowbefore.FlowBatchModel; +import com.yunzhupaas.engine.model.flowtask.FlowTaskListModel; +import com.yunzhupaas.engine.model.flowtask.PaginationFlowTask; +import com.yunzhupaas.engine.model.flowtemplatejson.FlowTemplateJsonPage; +import com.yunzhupaas.engine.service.*; +import com.yunzhupaas.engine.util.FlowNature; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.model.FlowWorkListVO; +import com.yunzhupaas.model.FlowWorkModel; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.model.user.WorkHandoverModel; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.ServiceAllUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 流程任务 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Slf4j +@Service +public class FlowTaskServiceImpl extends SuperServiceImpl implements FlowTaskService { + + + @Autowired + private ServiceAllUtil serviceUtil; + @Autowired + private FlowTemplateService flowTemplateService; + @Autowired + private FlowTemplateJsonService flowTemplateJsonService; + @Autowired + private FlowDelegateService flowDelegateService; + @Autowired + private FlowTaskNodeService flowTaskNodeService; + @Autowired + private FlowTaskOperatorService flowTaskOperatorService; + @Autowired + private FlowOperatorUserService flowOperatorUserService; + @Autowired + private FlowRejectDataService flowRejectDataService; + @Autowired + private FlowTaskOperatorRecordService flowTaskOperatorRecordService; + @Autowired + private FlowTaskCirculateService flowTaskCirculateService; + @Autowired + private FlowCandidatesService flowCandidatesService; + @Autowired + private FlowCommentService flowCommentService; + @Autowired + private FlowAuthorizeService flowAuthorizeService; + @Autowired + private FlowUserService flowUserService; + @Autowired + private FlowEngineVisibleService flowEngineVisibleService; + + @Override + public List getMonitorList(PaginationFlowTask pagination) { + // 定义变量判断是否需要使用修改时间倒序 + boolean flag = false; + UserInfo userInfo = UserProvider.getUser(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(FlowTaskEntity::getId); + queryWrapper.lambda().gt(FlowTaskEntity::getStatus, FlowTaskStatusEnum.Draft.getCode()); + queryWrapper.lambda().and(t -> t.isNull(FlowTaskEntity::getSuspend).or().ne(FlowTaskEntity::getSuspend, FlowTaskStatusEnum.Draft.getCode())); + if (!userInfo.getIsAdministrator()) { + List userList = serviceUtil.getOrganizeUserList("select"); + if (userList.size() == 0) { + return new ArrayList<>(); + } + queryWrapper.lambda().in(FlowTaskEntity::getCreatorUserId, userList); + } + //关键字(流程名称、流程编码) + String keyWord = pagination.getKeyword(); + if (ObjectUtil.isNotEmpty(keyWord)) { + flag = true; + queryWrapper.lambda().and(t -> t.like(FlowTaskEntity::getEnCode, keyWord).or().like(FlowTaskEntity::getFullName, keyWord)); + } + //日期范围(近7天、近1月、近3月、自定义) + if (ObjectUtil.isNotEmpty(pagination.getStartTime()) && ObjectUtil.isNotEmpty(pagination.getEndTime())) { + queryWrapper.lambda().between(FlowTaskEntity::getStartTime, new Date(pagination.getStartTime()), new Date(pagination.getEndTime())); + } + //流程状态 + Integer status = pagination.getStatus(); + if (ObjectUtil.isNotEmpty(status)) { + flag = true; + List statusList = new ArrayList() {{ + add(status); + }}; + if (Objects.equals(status, FlowTaskStatusEnum.Revoke.getCode())) { + statusList.add(FlowTaskStatusEnum.Resubmit.getCode()); + } + queryWrapper.lambda().in(FlowTaskEntity::getStatus, statusList); + } + //所属流程 + String templateId = pagination.getTemplateId(); + if (ObjectUtil.isNotEmpty(templateId)) { + flag = true; + queryWrapper.lambda().eq(FlowTaskEntity::getTemplateId, templateId); + } + //所属名称 + String flowId = pagination.getFlowId(); + if (ObjectUtil.isNotEmpty(flowId)) { + flag = true; + FlowTemplateJsonPage page = new FlowTemplateJsonPage(); + page.setTemplateId(templateId); + page.setFlowId(flowId); + List flowList = flowTemplateJsonService.getListPage(page, false).stream().map(FlowTemplateJsonEntity::getId).collect(Collectors.toList()); + if (flowList.size() == 0) { + return new ArrayList<>(); + } + queryWrapper.lambda().in(FlowTaskEntity::getFlowId, flowList); + } + //所属分类 + String flowCategory = pagination.getFlowCategory(); + if (ObjectUtil.isNotEmpty(flowCategory)) { + flag = true; + queryWrapper.lambda().eq(FlowTaskEntity::getFlowCategory, flowCategory); + } + //发起人员 + String creatorUserId = pagination.getCreatorUserId(); + if (ObjectUtil.isNotEmpty(creatorUserId)) { + flag = true; + queryWrapper.lambda().eq(FlowTaskEntity::getCreatorUserId, creatorUserId); + } + //紧急程度 + Integer flowUrgent = pagination.getFlowUrgent(); + if (ObjectUtil.isNotEmpty(flowUrgent)) { + flag = true; + queryWrapper.lambda().eq(FlowTaskEntity::getFlowUrgent, flowUrgent); + } + //排序 +// if ("desc".equals(pagination.getSort().toLowerCase())) { +// queryWrapper.lambda().orderByDesc(FlowTaskEntity::getCreatorTime); +// } else { + queryWrapper.lambda().orderByAsc(FlowTaskEntity::getSortCode).orderByDesc(FlowTaskEntity::getCreatorTime); +// } + if (flag) { + queryWrapper.lambda().orderByDesc(FlowTaskEntity::getLastModifyTime); + } + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage flowTaskEntityPage = this.page(page, queryWrapper); + if (!flowTaskEntityPage.getRecords().isEmpty()) { + List ids = flowTaskEntityPage.getRecords().stream().map(FlowTaskEntity::getId).collect(Collectors.toList()); + queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(FlowTaskEntity::getId, ids); + //排序 + queryWrapper.lambda().orderByAsc(FlowTaskEntity::getSortCode).orderByDesc(FlowTaskEntity::getCreatorTime); + if (flag) { + queryWrapper.lambda().orderByDesc(FlowTaskEntity::getLastModifyTime); + } + flowTaskEntityPage.setRecords(this.list(queryWrapper)); + } + return pagination.setData(flowTaskEntityPage.getRecords(), page.getTotal()); + } + + @Override + public List getLaunchList(PaginationFlowTask pagination) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + String userId = UserProvider.getUser().getUserId(); + if (pagination.getDelegateType()) { + queryWrapper.lambda().select(FlowTaskEntity::getId).eq(FlowTaskEntity::getDelegateUser, userId); + } else { + queryWrapper.lambda().select(FlowTaskEntity::getId).eq(FlowTaskEntity::getCreatorUserId, userId); + } + //关键字(流程名称、流程编码) + String keyWord = pagination.getKeyword(); + if (ObjectUtil.isNotEmpty(keyWord)) { + queryWrapper.lambda().and(t -> t.like(FlowTaskEntity::getEnCode, keyWord).or().like(FlowTaskEntity::getFullName, keyWord)); + } + //日期范围(近7天、近1月、近3月、自定义) + if (ObjectUtil.isNotEmpty(pagination.getStartTime()) && ObjectUtil.isNotEmpty(pagination.getEndTime())) { + queryWrapper.lambda().between(FlowTaskEntity::getStartTime, new Date(pagination.getStartTime()), new Date(pagination.getEndTime())); + } + //所属流程 + String templateId = pagination.getTemplateId(); + if (ObjectUtil.isNotEmpty(templateId)) { + queryWrapper.lambda().eq(FlowTaskEntity::getTemplateId, templateId); + } + //所属名称 + String flowId = pagination.getFlowId(); + if (ObjectUtil.isNotEmpty(flowId)) { + FlowTemplateJsonPage page = new FlowTemplateJsonPage(); + page.setTemplateId(templateId); + page.setFlowId(flowId); + List flowList = flowTemplateJsonService.getListPage(page, false).stream().map(FlowTemplateJsonEntity::getId).collect(Collectors.toList()); + if (flowList.size() == 0) { + return new ArrayList<>(); + } + queryWrapper.lambda().in(FlowTaskEntity::getFlowId, flowList); + } + //流程状态 + Integer status = pagination.getStatus(); + if (ObjectUtil.isNotEmpty(status)) { + List statusList = new ArrayList() {{ + add(status); + }}; + if (Objects.equals(status, FlowTaskStatusEnum.Revoke.getCode())) { + statusList.add(FlowTaskStatusEnum.Resubmit.getCode()); + } + queryWrapper.lambda().in(FlowTaskEntity::getStatus, statusList); + } + //紧急程度 + Integer flowUrgent = pagination.getFlowUrgent(); + if (ObjectUtil.isNotEmpty(flowUrgent)) { + queryWrapper.lambda().eq(FlowTaskEntity::getFlowUrgent, flowUrgent); + } + //所属分类 + String flowCategory = pagination.getFlowCategory(); + if (ObjectUtil.isNotEmpty(flowCategory)) { + queryWrapper.lambda().eq(FlowTaskEntity::getFlowCategory, flowCategory); + } + //排序 + queryWrapper.lambda().orderByAsc(FlowTaskEntity::getStatus).orderByDesc(FlowTaskEntity::getStartTime); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage flowTaskEntityPage = this.page(page, queryWrapper); + if (!flowTaskEntityPage.getRecords().isEmpty()) { + List ids = flowTaskEntityPage.getRecords().stream().map(FlowTaskEntity::getId).collect(Collectors.toList()); + queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(FlowTaskEntity::getId, ids); + //排序 + queryWrapper.lambda().orderByAsc(FlowTaskEntity::getStatus).orderByDesc(FlowTaskEntity::getStartTime); + flowTaskEntityPage.setRecords(this.list(queryWrapper)); + } + return pagination.setData(flowTaskEntityPage.getRecords(), page.getTotal()); + } + + @Override + public List getWaitList(PaginationFlowTask pagination) { + String userId = StringUtil.isNotEmpty(pagination.getUserId()) ? pagination.getUserId() : UserProvider.getUser().getUserId(); + MPJLambdaWrapper wrapper = JoinWrappers.lambda(FlowTaskEntity.class) + .selectAll(FlowTaskEntity.class) + .leftJoin(FlowTaskOperatorEntity.class, FlowTaskOperatorEntity::getTaskId, FlowTaskEntity::getId) + .selectAs(FlowTaskOperatorEntity::getId, FlowTaskListModel::getId) + .selectAs(FlowTaskOperatorEntity::getNodeName, FlowTaskListModel::getThisStep) + .selectAs(FlowTaskOperatorEntity::getNodeName, FlowTaskListModel::getNodeName) + .selectAs(FlowTaskOperatorEntity::getTaskNodeId, FlowTaskListModel::getThisStepId) + .selectAs(FlowTaskOperatorEntity::getHandleId, FlowTaskListModel::getHandleId) + .selectAs(FlowTaskOperatorEntity::getCreatorTime, FlowTaskListModel::getCreatorTime) + .eq(FlowTaskOperatorEntity::getCompletion, FlowNature.ProcessCompletion) + .le(FlowTaskOperatorEntity::getCreatorTime, new Date()) + .eq(FlowTaskOperatorEntity::getState, FlowNodeEnum.Process.getCode()) + .eq(FlowTaskEntity::getStatus, FlowTaskStatusEnum.Handle.getCode()); + boolean isDelegateType = pagination.getDelegateType(); + List handleId = new ArrayList<>(); + handleId.add(userId); + Map delegateListAll = new HashMap<>(); + //是否委托 + if (isDelegateType) { + List delegateList = flowDelegateService.getUser(userId); + for (FlowDelegateEntity entity : delegateList) { + if (StringUtil.isNotEmpty(entity.getFlowId())) { + String[] flowIdAll = entity.getFlowId().split(","); + delegateListAll.put(entity.getUserId(), flowIdAll); + } else { + handleId.add(entity.getUserId()); + } + } + } + //代办人 + wrapper.and(t -> { + t.in(FlowTaskOperatorEntity::getHandleId, handleId); + if (isDelegateType) { + for (String key : delegateListAll.keySet()) { + t.or(tw -> tw.in(FlowTaskEntity::getTemplateId, delegateListAll.get(key)).eq(FlowTaskOperatorEntity::getHandleId, key)); + } + } + }); + //关键字(流程名称、流程编码) + String keyWord = pagination.getKeyword(); + if (ObjectUtil.isNotEmpty(keyWord)) { + wrapper.and(t -> t.like(FlowTaskEntity::getEnCode, keyWord).or().like(FlowTaskEntity::getFullName, keyWord)); + } + //日期范围(近7天、近1月、近3月、自定义) + if (ObjectUtil.isNotEmpty(pagination.getStartTime()) && ObjectUtil.isNotEmpty(pagination.getEndTime())) { + wrapper.between(FlowTaskEntity::getStartTime, new Date(pagination.getStartTime()), new Date(pagination.getEndTime())); + } + //所属流程 + String templateId = pagination.getTemplateId(); + if (ObjectUtil.isNotEmpty(templateId)) { + wrapper.eq(FlowTaskEntity::getTemplateId, templateId); + } + //是否批量 + Integer isBatch = pagination.getIsBatch(); + if (ObjectUtil.isNotEmpty(isBatch)) { + wrapper.eq(FlowTaskEntity::getIsBatch, isBatch); + } + //所属名称 + String flowId = pagination.getFlowId(); + if (ObjectUtil.isNotEmpty(flowId)) { + List flowList = new ArrayList<>(); + if (ObjectUtil.isEmpty(isBatch)) { + FlowTemplateJsonPage page = new FlowTemplateJsonPage(); + page.setTemplateId(templateId); + page.setFlowId(flowId); + flowList.addAll(flowTemplateJsonService.getListPage(page, false).stream().map(FlowTemplateJsonEntity::getId).collect(Collectors.toList())); + if (flowList.size() == 0) { + return new ArrayList<>(); + } + } else { + flowList.add(flowId); + } + wrapper.in(FlowTaskEntity::getFlowId, flowList); + } + //所属分类 + String category = pagination.getFlowCategory(); + if (ObjectUtil.isNotEmpty(category)) { + wrapper.in(FlowTaskEntity::getFlowCategory, category.split(",")); + } + //发起人员 + String creatorUserId = pagination.getCreatorUserId(); + if (ObjectUtil.isNotEmpty(creatorUserId)) { + wrapper.eq(FlowTaskEntity::getCreatorUserId, creatorUserId); + } + //节点编码 + String nodeCode = pagination.getNodeCode(); + if (ObjectUtil.isNotEmpty(nodeCode)) { + wrapper.eq(FlowTaskOperatorEntity::getNodeCode, nodeCode); + } + //紧急程度 + Integer flowUrgent = pagination.getFlowUrgent(); + if (ObjectUtil.isNotEmpty(flowUrgent)) { + wrapper.eq(FlowTaskEntity::getFlowUrgent, flowUrgent); + } + wrapper.orderByDesc(FlowTaskOperatorEntity::getCreatorTime); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + Page data = this.selectJoinListPage(page, FlowTaskListModel.class, wrapper); + for (FlowTaskListModel entity : data.getRecords()) { + boolean isuser = entity.getHandleId().equals(userId); + entity.setDelegateUser(!isuser ? entity.getCreatorUserId() : null); + } + return pagination.setData(data.getRecords(), page.getTotal()); + } + + @Override + public List getCirculateList(PaginationFlowTask pagination) { + String userId = StringUtil.isNotEmpty(pagination.getUserId()) ? pagination.getUserId() : UserProvider.getUser().getUserId(); + MPJLambdaWrapper wrapper = JoinWrappers.lambda(FlowTaskEntity.class) + .selectAll(FlowTaskEntity.class) + .leftJoin(FlowTaskCirculateEntity.class, FlowTaskCirculateEntity::getTaskId, FlowTaskEntity::getId) + .selectAs(FlowTaskCirculateEntity::getNodeName, FlowTaskListModel::getThisStep) + .selectAs(FlowTaskCirculateEntity::getTaskNodeId, FlowTaskListModel::getThisStepId) + .selectAs(FlowTaskCirculateEntity::getId, FlowTaskListModel::getCirculateId) + .selectAs(FlowTaskCirculateEntity::getCreatorTime, FlowTaskListModel::getCreatorTime) + .eq(FlowTaskCirculateEntity::getObjectId, userId); + //关键字(流程名称、流程编码) + String keyWord = pagination.getKeyword(); + if (ObjectUtil.isNotEmpty(keyWord)) { + wrapper.and(t -> t.like(FlowTaskEntity::getEnCode, keyWord).or().like(FlowTaskEntity::getFullName, keyWord)); + } + //日期范围(近7天、近1月、近3月、自定义) + if (ObjectUtil.isNotEmpty(pagination.getStartTime()) && ObjectUtil.isNotEmpty(pagination.getEndTime())) { + wrapper.between(FlowTaskEntity::getStartTime, new Date(pagination.getStartTime()), new Date(pagination.getEndTime())); + } + //所属流程 + String templateId = pagination.getTemplateId(); + if (ObjectUtil.isNotEmpty(templateId)) { + wrapper.eq(FlowTaskEntity::getTemplateId, templateId); + } + //所属名称 + String flowId = pagination.getFlowId(); + if (ObjectUtil.isNotEmpty(flowId)) { + FlowTemplateJsonPage page = new FlowTemplateJsonPage(); + page.setTemplateId(templateId); + page.setFlowId(flowId); + List flowList = flowTemplateJsonService.getListPage(page, false).stream().map(FlowTemplateJsonEntity::getId).collect(Collectors.toList()); + if (flowList.size() == 0) { + return new ArrayList<>(); + } + wrapper.in(FlowTaskEntity::getFlowId, flowList); + } + //所属分类 + String category = pagination.getFlowCategory(); + if (ObjectUtil.isNotEmpty(category)) { + wrapper.in(FlowTaskEntity::getFlowCategory, category.split(",")); + } + //发起人员 + String creatorUserId = pagination.getCreatorUserId(); + if (ObjectUtil.isNotEmpty(creatorUserId)) { + wrapper.in(FlowTaskEntity::getCreatorUserId, creatorUserId); + } + //紧急程度 + Integer flowUrgent = pagination.getFlowUrgent(); + if (ObjectUtil.isNotEmpty(flowUrgent)) { + wrapper.in(FlowTaskEntity::getFlowUrgent, flowUrgent); + } + wrapper.orderByDesc(FlowTaskCirculateEntity::getCreatorTime); + Page page = new Page(pagination.getCurrentPage(), pagination.getPageSize()); + Page data = this.selectJoinListPage(page, FlowTaskListModel.class, wrapper); + return pagination.setData(data.getRecords(), page.getTotal()); + } + + @Override + public List getTrialList(PaginationFlowTask pagination) { + String userId = StringUtil.isNotEmpty(pagination.getUserId()) ? pagination.getUserId() : UserProvider.getUser().getUserId(); + Integer handleStatus[] = new Integer[]{0, 1, 10, 13}; + MPJLambdaWrapper recordWrapper = JoinWrappers.lambda(FlowTaskOperatorRecordEntity.class) + .select(FlowTaskOperatorRecordEntity::getHandleId) + .select(FlowTaskOperatorRecordEntity::getTaskNodeId) + .select(FlowTaskOperatorRecordEntity::getTaskId) + .selectMax(FlowTaskOperatorRecordEntity::getHandleTime) + .in(FlowTaskOperatorRecordEntity::getHandleStatus, handleStatus) + .eq(FlowTaskOperatorRecordEntity::getHandleId, userId) + .isNotNull(FlowTaskOperatorRecordEntity::getTaskOperatorId) + .groupBy(FlowTaskOperatorRecordEntity::getTaskId, FlowTaskOperatorRecordEntity::getTaskNodeId, FlowTaskOperatorRecordEntity::getHandleId); + List recordList = flowTaskOperatorRecordService.selectJoinList(FlowTaskOperatorRecordEntity.class, recordWrapper); + if (recordList.size() > 0) { + List taskId = recordList.stream().map(FlowTaskOperatorRecordEntity::getTaskId).collect(Collectors.toList()); + List taskNodeId = recordList.stream().map(FlowTaskOperatorRecordEntity::getTaskNodeId).collect(Collectors.toList()); + List handleTime = recordList.stream().map(FlowTaskOperatorRecordEntity::getHandleTime).collect(Collectors.toList()); + MPJLambdaWrapper wrapper = JoinWrappers.lambda(FlowTaskEntity.class) + .leftJoin(FlowTaskOperatorRecordEntity.class, FlowTaskOperatorRecordEntity::getTaskId, FlowTaskEntity::getId) + .leftJoin(FlowTaskOperatorEntity.class, FlowTaskOperatorEntity::getId, FlowTaskOperatorRecordEntity::getTaskOperatorId) + .selectAll(FlowTaskEntity.class) + .selectAs(FlowTaskOperatorRecordEntity::getId, FlowTaskListModel::getId) + .selectAs(FlowTaskOperatorRecordEntity::getNodeName, FlowTaskListModel::getThisStep) + .selectAs(FlowTaskOperatorRecordEntity::getTaskNodeId, FlowTaskListModel::getThisStepId) + .selectAs(FlowTaskOperatorRecordEntity::getHandleStatus, FlowTaskListModel::getStatus) + .selectAs(FlowTaskOperatorRecordEntity::getHandleId, FlowTaskListModel::getHandleId) + .selectAs(FlowTaskOperatorRecordEntity::getHandleTime, FlowTaskListModel::getCreatorTime) + .selectAs(FlowTaskOperatorEntity::getHandleId, FlowTaskListModel::getDelegateUser) + .in(FlowTaskOperatorRecordEntity::getTaskId, taskId) + .in(FlowTaskOperatorRecordEntity::getTaskNodeId, taskNodeId) + .in(FlowTaskOperatorRecordEntity::getHandleStatus, handleStatus) + .and(t -> { + for (Date date : handleTime) { + t.or().eq(FlowTaskOperatorRecordEntity::getHandleTime, date); + } + }); + //关键字(流程名称、流程编码) + String keyWord = pagination.getKeyword(); + if (ObjectUtil.isNotEmpty(keyWord)) { + wrapper.and(t -> t.like(FlowTaskEntity::getEnCode, keyWord).or().like(FlowTaskEntity::getFullName, keyWord)); + } + //日期范围(近7天、近1月、近3月、自定义) + if (ObjectUtil.isNotEmpty(pagination.getStartTime()) && ObjectUtil.isNotEmpty(pagination.getEndTime())) { + wrapper.between(FlowTaskEntity::getStartTime, new Date(pagination.getStartTime()), new Date(pagination.getEndTime())); + } + //所属流程 + String templateId = pagination.getTemplateId(); + if (ObjectUtil.isNotEmpty(templateId)) { + wrapper.eq(FlowTaskEntity::getTemplateId, templateId); + } + //所属名称 + String flowId = pagination.getFlowId(); + if (ObjectUtil.isNotEmpty(flowId)) { + FlowTemplateJsonPage page = new FlowTemplateJsonPage(); + page.setTemplateId(templateId); + page.setFlowId(flowId); + List flowList = flowTemplateJsonService.getListPage(page, false).stream().map(FlowTemplateJsonEntity::getId).collect(Collectors.toList()); + if (flowList.size() == 0) { + return new ArrayList<>(); + } + wrapper.in(FlowTaskEntity::getFlowId, flowList); + } + //所属分类 + String category = pagination.getFlowCategory(); + if (ObjectUtil.isNotEmpty(category)) { + wrapper.in(FlowTaskEntity::getFlowCategory, category.split(",")); + } + //发起人员 + String creatorUserId = pagination.getCreatorUserId(); + if (ObjectUtil.isNotEmpty(creatorUserId)) { + wrapper.in(FlowTaskEntity::getCreatorUserId, creatorUserId); + } + //紧急程度 + Integer flowUrgent = pagination.getFlowUrgent(); + if (ObjectUtil.isNotEmpty(flowUrgent)) { + wrapper.in(FlowTaskEntity::getFlowUrgent, flowUrgent); + } + wrapper.orderByDesc(FlowTaskOperatorRecordEntity::getHandleTime); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + Page data = this.selectJoinListPage(page, FlowTaskListModel.class, wrapper); + for (FlowTaskListModel entity : data.getRecords()) { + boolean isuser = entity.getHandleId().equals(entity.getDelegateUser()); + entity.setDelegateUser(!isuser ? entity.getCreatorUserId() : null); + } + return pagination.setData(data.getRecords(), page.getTotal()); + } + return new ArrayList<>(); + } + + @Override + public FlowTaskEntity getInfo(String id, SFunction... columns) throws WorkFlowException { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowTaskEntity::getId, id); + queryWrapper.lambda().select(columns); + FlowTaskEntity entity = this.getOne(queryWrapper); + if (entity == null) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + return entity; + } + + @Override + public void update(FlowTaskEntity entity) { + this.updateById(entity); + } + + @Override + public void create(FlowTaskEntity entity) { + this.save(entity); + } + + @Override + public void createOrUpdate(FlowTaskEntity entity) { + this.saveOrUpdate(entity); + } + + @Override + public FlowTaskEntity getInfoSubmit(String id, SFunction... columns) { + List list = getInfosSubmit(new String[]{id}, columns); + if (list.isEmpty()) { + return null; + } + return list.get(0); + } + + @Override + public List getInfosSubmit(String[] ids, SFunction... columns) { + List resultList = Collections.emptyList(); + if (ids == null || ids.length == 0) { + return resultList; + } + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + if (ids.length == 1) { + queryWrapper.select(columns).and( + t -> t.eq(FlowTaskEntity::getId, ids[0]) + ); + resultList = this.list(queryWrapper); + if (resultList.isEmpty()) { + queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.select(columns).and( + t -> t.eq(FlowTaskEntity::getProcessId, ids[0]) + ); + resultList = this.list(queryWrapper); + } + } else { + queryWrapper.select(FlowTaskEntity::getId).and(t -> { + t.in(FlowTaskEntity::getId, ids).or().in(FlowTaskEntity::getProcessId, ids); + }); + List resultIds = this.listObjs(queryWrapper, t -> t.toString()); + if (!resultIds.isEmpty()) { + queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.select(columns).in(FlowTaskEntity::getId, resultIds); + resultList = this.list(queryWrapper); + } + } + return resultList; + } + + @Override + public void delete(FlowTaskEntity entity) throws WorkFlowException { + if (FlowTaskStatusEnum.Suspend.getCode().equals(entity.getStatus())) { + throw new WorkFlowException(MsgCode.WF048.get()); + } + List status = ImmutableList.of(FlowTaskStatusEnum.Draft.getCode(),FlowTaskStatusEnum.Revoke.getCode(), + FlowTaskStatusEnum.Cancel.getCode(),FlowTaskStatusEnum.Resubmit.getCode()); + if(!status.contains(entity.getStatus())){ + throw new WorkFlowException(MsgCode.WF063.get()); + } + if (!FlowNature.ParentId.equals(entity.getParentId()) && StringUtil.isNotEmpty(entity.getParentId())) { + throw new WorkFlowException(entity.getFullName() + MsgCode.WF021.get()); + } + if (!checkStatus(entity.getStatus())) { + throw new WorkFlowException(MsgCode.WF049.get()); + } else { + List idList = ImmutableList.of(entity.getId()); + this.deleteAll(idList, true, true); + } + } + + @Override + public void deleteChildAll(List idAll) { + this.deleteAll(idAll, true, true); + } + + @Override + public void delete(String[] ids) throws WorkFlowException { + if (ids.length > 0) { + List idList = Arrays.asList(ids); + List flowTaskList = getOrderStaList(idList); + List del = flowTaskList.stream().filter(t -> t.getFlowType() == 1).collect(Collectors.toList()); + if (del.size() > 0) { + throw new WorkFlowException(del.get(0).getFullName() + MsgCode.WF020.get()); + } + List child = flowTaskList.stream().filter(t -> !FlowNature.ParentId.equals(t.getParentId()) && StringUtil.isNotEmpty(t.getParentId())).collect(Collectors.toList()); + if (child.size() > 0) { + throw new WorkFlowException(child.get(0).getFullName() + MsgCode.WF021.get()); + } + List taskStatusList = new ArrayList<>(); + for (String id : ids) { + List childAllList = getChildAllList(id); + taskStatusList.addAll(getOrderStaList(childAllList)); + } + List taskStatus = taskStatusList.stream().filter(t -> FlowTaskStatusEnum.Suspend.getCode().equals(t.getStatus())).collect(Collectors.toList()); + if (taskStatus.size() > 0) { + throw new WorkFlowException(taskStatus.get(0).getFullName() + MsgCode.WF050.get()); + } + UserInfo userInfo = UserProvider.getUser(); + if (!userInfo.getIsAdministrator()) { + List organizeUserList = serviceUtil.getOrganizeUserList("delete"); + List taskOrganize = taskStatusList.stream().filter(t -> !organizeUserList.contains(t.getCreatorUserId())).collect(Collectors.toList()); + if (taskOrganize.size() > 0) { + throw new WorkFlowException(taskOrganize.get(0).getFullName() + MsgCode.WF051.get()); + } + } + this.deleteAll(idList, true, true); + } + } + + @Override + public List getOrderStaList(List id, SFunction... columns) { + List list = new ArrayList<>(); + if (id.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(FlowTaskEntity::getId, id); + list = this.list(queryWrapper); + } + return list; + } + + @Override + public List getChildList(String id, SFunction... columns) { + return getChildList(ImmutableList.of(id), columns); + } + + @Override + public List getChildList(List id, SFunction... columns) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().select(columns).in(FlowTaskEntity::getParentId, id); + return this.list(queryWrapper); + } + + @Override + public List getTemplateIdList(String tempId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowTaskEntity::getTemplateId, tempId); + queryWrapper.lambda().select(FlowTaskEntity::getId, FlowTaskEntity::getFlowId); + return this.list(queryWrapper); + } + + @Override + public List getFlowList(String flowId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowTaskEntity::getFlowId, flowId); + queryWrapper.lambda().select(FlowTaskEntity::getId); + return list(queryWrapper); + } + + @Override + public List batchFlowSelector() { + List operatorList = flowTaskOperatorService.getBatchList(); + List taskIdList = operatorList.stream().map(FlowTaskOperatorEntity::getTaskId).collect(Collectors.toList()); + List taskList = getOrderStaList(taskIdList); + Map> flowList = taskList.stream().filter(t -> ObjectUtil.isNotEmpty(t.getIsBatch()) && t.getIsBatch() == 1).collect(Collectors.groupingBy(FlowTaskEntity::getTemplateId)); + List batchFlowList = new ArrayList<>(); + for (String key : flowList.keySet()) { + List flowTaskList = flowList.get(key); + List flowTask = flowTaskList.stream().map(FlowTaskEntity::getId).collect(Collectors.toList()); + List templateJsonList = flowTemplateJsonService.getTemplateJsonList(flowTaskList.stream().map(FlowTaskEntity::getFlowId).collect(Collectors.toList())); + if (flowTaskList.size() > 0) { + String flowName = flowTaskList.stream().map(FlowTaskEntity::getFlowName).distinct().collect(Collectors.joining(",")); + String flowId = templateJsonList.stream().map(FlowTemplateJsonEntity::getTemplateId).distinct().collect(Collectors.joining(",")); + Long count = operatorList.stream().filter(t -> flowTask.contains(t.getTaskId())).count(); + FlowBatchModel batchModel = new FlowBatchModel(); + batchModel.setNum(count); + batchModel.setId(flowId); + batchModel.setFullName(flowName + "(" + count + ")"); + batchFlowList.add(batchModel); + } + } + batchFlowList = batchFlowList.stream().sorted(Comparator.comparing(FlowBatchModel::getNum).reversed()).collect(Collectors.toList()); + return batchFlowList; + } + + @Override + public List getChildAllList(String id) { + List idAll = new ArrayList<>(); + List idList = ImmutableList.of(id); + this.deleTaskAll(idList, idAll); + return idAll; + } + + @Override + public void deleTaskAll(List idList, List idAll) { + idAll.addAll(idList); + for (String id : idList) { + List taskAll = this.getChildList(id, FlowTaskEntity::getId); + List list = taskAll.stream().map(FlowTaskEntity::getId).collect(Collectors.toList()); + this.deleTaskAll(list, idAll); + } + } + + @Override + public void getChildList(String id, boolean suspend, List list) { + List taskAll = this.getChildList(id, FlowTaskEntity::getId, FlowTaskEntity::getIsAsync); + if (suspend) { + taskAll = taskAll.stream().filter(t -> FlowNature.ChildSync.equals(t.getIsAsync())).collect(Collectors.toList()); + } + for (FlowTaskEntity entity : taskAll) { + list.add(entity.getId()); + this.getChildList(entity.getId(), suspend, list); + } + } + + @Override + public FlowWorkListVO flowWork(String fromId) { + FlowWorkListVO vo = new FlowWorkListVO(); + //代办 + QueryWrapper operatorWrapper = new QueryWrapper<>(); + operatorWrapper.lambda().eq(FlowTaskOperatorEntity::getHandleId, fromId); + List list = flowTaskOperatorService.list(operatorWrapper); + List taskIdList = list.stream().map(FlowTaskOperatorEntity::getTaskId).collect(Collectors.toList()); + List taskList = getOrderStaList(taskIdList); + List waitTemplateList = flowTemplateService.getTemplateList(taskList.stream().map(FlowTaskEntity::getTemplateId).collect(Collectors.toList())); + List waitList = new ArrayList<>(); + for (FlowTaskOperatorEntity entity : list) { + FlowWorkModel workModel = JsonUtil.getJsonToBean(entity, FlowWorkModel.class); + FlowTaskEntity taskEntity = taskList.stream().filter(t -> t.getId().equals(entity.getTaskId())).findFirst().orElse(null); + if (taskEntity != null) { + workModel.setFullName(taskEntity.getFullName()); + FlowTemplateEntity templateEntity = waitTemplateList.stream().filter(t -> t.getId().equals(taskEntity.getTemplateId())).findFirst().orElse(null); + if (templateEntity != null) { + workModel.setIcon(templateEntity.getIcon()); + } + } + waitList.add(workModel); + } + vo.setWait(waitList); + + //流程 + QueryWrapper queryWrapper = new QueryWrapper<>(); + List templateJsonList = flowTemplateJsonService.list(queryWrapper).stream().filter(t -> t.getFlowTemplateJson().contains(fromId)).collect(Collectors.toList()); + List templateIdList = templateJsonList.stream().map(FlowTemplateJsonEntity::getTemplateId).collect(Collectors.toList()); + List templateList = flowTemplateService.getTemplateList(templateIdList); + List flowList = new ArrayList<>(); + for (FlowTemplateJsonEntity entity : templateJsonList) { + FlowWorkModel workModel = JsonUtil.getJsonToBean(entity, FlowWorkModel.class); + FlowTemplateEntity templateEntity = templateList.stream().filter(t -> t.getId().equals(entity.getTemplateId())).findFirst().orElse(null); + if (templateEntity != null) { + workModel.setFullName(templateEntity.getFullName() + "_" + entity.getFullName() + "(V" + entity.getVersion() + ")"); + workModel.setIcon(templateEntity.getIcon()); + } + flowList.add(workModel); + } + vo.setFlow(flowList); + return vo; + } + + @Override + @Transactional + public boolean flowWork(WorkHandoverModel workHandoverModel) { + String fromId = workHandoverModel.getFromId(); + String toId = workHandoverModel.getToId(); + List waitList = workHandoverModel.getWaitList(); + //待办事宜 + if (waitList.size() > 0) { + UpdateWrapper operator = new UpdateWrapper<>(); + operator.lambda().in(FlowTaskOperatorEntity::getId, waitList); + operator.lambda().eq(FlowTaskOperatorEntity::getHandleId, fromId); + operator.lambda().set(FlowTaskOperatorEntity::getHandleId, toId); + flowTaskOperatorService.update(operator); + UpdateWrapper userOperator = new UpdateWrapper<>(); + userOperator.lambda().in(FlowOperatorUserEntity::getId, waitList); + userOperator.lambda().eq(FlowOperatorUserEntity::getHandleId, fromId); + userOperator.lambda().set(FlowOperatorUserEntity::getHandleId, toId); + flowOperatorUserService.update(userOperator); + UpdateWrapper candidates = new UpdateWrapper<>(); + candidates.lambda().in(FlowCandidatesEntity::getId, waitList); + candidates.lambda().eq(FlowCandidatesEntity::getHandleId, fromId); + candidates.lambda().set(FlowCandidatesEntity::getHandleId, toId); + flowCandidatesService.update(candidates); + } + //负责流程 + List flowList = workHandoverModel.getFlowList(); + if (flowList.size() > 0) { + UserEntity toUser = serviceUtil.getUserInfo(toId); + String toUserName = toUser != null ? toUser.getRealName() + "/" + toUser.getAccount() : ""; + UserEntity fromUser = serviceUtil.getUserInfo(fromId); + String fromUserName = fromUser != null ? fromUser.getRealName() + "/" + fromUser.getAccount() : ""; + //json + List templateJsonList = flowTemplateJsonService.getTemplateJsonList(flowList); + for (FlowTemplateJsonEntity entity : templateJsonList) { + String json = entity.getFlowTemplateJson().replaceAll(fromId, toId).replaceAll(fromUserName, toUserName); + entity.setFlowTemplateJson(json); + flowTemplateJsonService.update(entity.getId(), entity); + } + //任务 + QueryWrapper taskQueryWrapper = new QueryWrapper<>(); + taskQueryWrapper.lambda().in(FlowTaskEntity::getFlowId, flowList); + List list = this.list(taskQueryWrapper); + for (FlowTaskEntity entity : list) { + update(entity); + QueryWrapper nodeQueryWrapper = new QueryWrapper<>(); + nodeQueryWrapper.lambda().eq(FlowTaskNodeEntity::getTaskId, entity.getId()); + List nodeList = flowTaskNodeService.list(nodeQueryWrapper); + for (FlowTaskNodeEntity taskNodeEntity : nodeList) { + taskNodeEntity.setNodePropertyJson(taskNodeEntity.getNodePropertyJson().replaceAll(fromId, toId).replaceAll(fromUserName, toUserName)); + flowTaskNodeService.update(taskNodeEntity); + } + } + //流程可见 + List templateIdList = templateJsonList.stream().map(FlowTemplateJsonEntity::getTemplateId).collect(Collectors.toList()); + if (templateIdList.size() > 0) { + UpdateWrapper visibleWrapper = new UpdateWrapper<>(); + visibleWrapper.lambda().eq(FlowEngineVisibleEntity::getOperatorId, fromId); + visibleWrapper.lambda().in(FlowEngineVisibleEntity::getFlowId, templateIdList); + visibleWrapper.lambda().set(FlowEngineVisibleEntity::getOperatorId, toId); + flowEngineVisibleService.update(visibleWrapper); + } + } + return true; + } + + /** + * 验证有效状态 + * + * @param status 状态编码 + * @return + */ + private boolean checkStatus(int status) { + List statusList = ImmutableList.of(FlowTaskStatusEnum.Draft.getCode(), FlowTaskStatusEnum.Reject.getCode(), + FlowTaskStatusEnum.Revoke.getCode(), FlowTaskStatusEnum.Resubmit.getCode()); + if (statusList.contains(status)) { + return true; + } else { + return false; + } + } + + /** + * 递归删除所有子节点 + * + * @param idList + * @param isRecord + * @param isCirculate + */ + private void deleteAll(List idList, boolean isRecord, boolean isCirculate) { + List idAll = new ArrayList<>(); + this.deleTaskAll(idList, idAll); + if (idAll.size() > 0) { + QueryWrapper task = new QueryWrapper<>(); + task.lambda().in(FlowTaskEntity::getId, idAll); + this.remove(task); + QueryWrapper candidates = new QueryWrapper<>(); + candidates.lambda().in(FlowCandidatesEntity::getTaskId, idAll); + flowCandidatesService.remove(candidates); + QueryWrapper comment = new QueryWrapper<>(); + comment.lambda().in(FlowCommentEntity::getTaskId, idAll); + flowCommentService.remove(comment); + QueryWrapper authorize = new QueryWrapper<>(); + authorize.lambda().in(FlowAuthorizeEntity::getTaskId, idAll); + flowAuthorizeService.remove(authorize); + QueryWrapper user = new QueryWrapper<>(); + user.lambda().in(FlowUserEntity::getTaskId, idAll); + flowUserService.remove(user); + QueryWrapper node = new QueryWrapper<>(); + node.lambda().in(FlowTaskNodeEntity::getTaskId, idAll); + flowTaskNodeService.remove(node); + QueryWrapper operator = new QueryWrapper<>(); + operator.lambda().in(FlowTaskOperatorEntity::getTaskId, idAll); + flowTaskOperatorService.remove(operator); + QueryWrapper operatorUser = new QueryWrapper<>(); + operatorUser.lambda().in(FlowOperatorUserEntity::getTaskId, idAll); + flowOperatorUserService.remove(operatorUser); + QueryWrapper rejectData = new QueryWrapper<>(); + rejectData.lambda().in(FlowRejectDataEntity::getId, idAll); + flowRejectDataService.remove(rejectData); + QueryWrapper record = new QueryWrapper<>(); + record.lambda().in(FlowTaskOperatorRecordEntity::getTaskId, idAll); + flowTaskOperatorRecordService.remove(record); + QueryWrapper circulate = new QueryWrapper<>(); + circulate.lambda().in(FlowTaskCirculateEntity::getTaskId, idAll); + flowTaskCirculateService.remove(circulate); + } + } + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowTemplateJsonServiceImpl.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowTemplateJsonServiceImpl.java new file mode 100644 index 0000000..8800404 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowTemplateJsonServiceImpl.java @@ -0,0 +1,309 @@ +package com.yunzhupaas.engine.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.github.yulichang.toolkit.JoinWrappers; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.google.common.collect.ImmutableList; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.engine.entity.FlowTemplateEntity; +import com.yunzhupaas.engine.entity.FlowTemplateJsonEntity; +import com.yunzhupaas.engine.mapper.FlowTemplateJsonMapper; +import com.yunzhupaas.engine.model.flowengine.FlowPagination; +import com.yunzhupaas.engine.model.flowengine.shuntjson.childnode.ChildNode; +import com.yunzhupaas.engine.model.flowengine.shuntjson.childnode.MsgConfig; +import com.yunzhupaas.engine.model.flowengine.shuntjson.childnode.Properties; +import com.yunzhupaas.engine.model.flowengine.shuntjson.nodejson.ChildNodeList; +import com.yunzhupaas.engine.model.flowengine.shuntjson.nodejson.ConditionList; +import com.yunzhupaas.engine.model.flowtemplate.FlowSelectVO; +import com.yunzhupaas.engine.model.flowtemplatejson.FlowTemplateJsonPage; +import com.yunzhupaas.engine.service.FlowTemplateJsonService; +import com.yunzhupaas.engine.util.FlowJsonUtil; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 流程引擎 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年7月11日 上午9:18 + */ +@Service +public class FlowTemplateJsonServiceImpl extends SuperServiceImpl implements FlowTemplateJsonService { + + + @Autowired + private ServiceAllUtil serviceUtil; + + @Override + public List getTemplateList(List id) { + List list = new ArrayList<>(); + if (id.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(FlowTemplateJsonEntity::getTemplateId, id); + queryWrapper.lambda().orderByDesc(FlowTemplateJsonEntity::getDeleteMark); + list = this.list(queryWrapper); + } + return list; + } + + @Override + public List getTemplateJsonList(List id) { + List list = new ArrayList<>(); + if (id.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(FlowTemplateJsonEntity::getId, id); + queryWrapper.lambda().orderByDesc(FlowTemplateJsonEntity::getDeleteMark); + list = this.list(queryWrapper); + } + return list; + } + + @Override + public List getListPage(FlowTemplateJsonPage pagination, boolean isPage) { + if (StringUtil.isNotEmpty(pagination.getFlowId())) { + FlowTemplateJsonEntity info = getJsonInfo(pagination.getFlowId()); + if (info != null) { + pagination.setGroupId(info.getGroupId()); + } + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + //关键字(流程名称、流程编码) + String keyWord = pagination.getKeyword(); + if (ObjectUtil.isNotEmpty(keyWord)) { + queryWrapper.lambda().like(FlowTemplateJsonEntity::getVersion, keyWord); + } + //流程id + String templateId = pagination.getTemplateId(); + if (ObjectUtil.isNotEmpty(templateId)) { + queryWrapper.lambda().eq(FlowTemplateJsonEntity::getTemplateId, templateId); + } + //流程状态 + Integer enableMark = pagination.getEnabledMark(); + if (ObjectUtil.isNotEmpty(enableMark)) { + queryWrapper.lambda().eq(FlowTemplateJsonEntity::getEnabledMark, enableMark); + } + //流程分组 + String groupId = pagination.getGroupId(); + if (ObjectUtil.isNotEmpty(groupId)) { + queryWrapper.lambda().eq(FlowTemplateJsonEntity::getGroupId, groupId); + } + //日期范围(近7天、近1月、近3月、自定义) + if (ObjectUtil.isNotEmpty(pagination.getStartTime()) && ObjectUtil.isNotEmpty(pagination.getEndTime())) { + queryWrapper.lambda().between(FlowTemplateJsonEntity::getCreatorTime, new Date(pagination.getStartTime()), new Date(pagination.getEndTime())); + } + queryWrapper.lambda().orderByDesc(FlowTemplateJsonEntity::getEnabledMark).orderByDesc(FlowTemplateJsonEntity::getCreatorTime); + if (isPage) { + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage userPage = this.page(page, queryWrapper); + return pagination.setData(userPage.getRecords(), page.getTotal()); + } else { + queryWrapper.lambda().select(FlowTemplateJsonEntity::getId, FlowTemplateJsonEntity::getGroupId); + return list(queryWrapper); + } + } + + @Override + public List getChildListPage(FlowPagination pagination) { + MPJLambdaWrapper wrapper = JoinWrappers.lambda(FlowTemplateJsonEntity.class) + .select(FlowTemplateJsonEntity::getFullName, FlowTemplateJsonEntity::getId) + .leftJoin(FlowTemplateEntity.class, FlowTemplateEntity::getId, FlowTemplateJsonEntity::getTemplateId) + .selectAs(FlowTemplateEntity::getFullName, FlowSelectVO::getFlowName) + .selectAs(FlowTemplateEntity::getType, FlowSelectVO::getFlowType) + .eq(FlowTemplateEntity::getEnabledMark, 1) + .eq(FlowTemplateJsonEntity::getEnabledMark, 1) + .eq(FlowTemplateJsonEntity::getVisibleType, 0); + if (ObjectUtil.isNotEmpty(pagination.getKeyword())) { + wrapper.like(FlowTemplateJsonEntity::getFullName, pagination.getKeyword()); + } + if (ObjectUtil.isNotEmpty(pagination.getFlowType())) { + wrapper.eq(FlowTemplateEntity::getType, pagination.getFlowType()); + } + wrapper.orderByAsc(FlowTemplateEntity::getSortCode).orderByDesc(FlowTemplateEntity::getCreatorTime); + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + Page data = this.selectJoinListPage(page, FlowSelectVO.class, wrapper); + return pagination.setData(data.getRecords(), page.getTotal()); + } + + @Override + public List getMainList(List templaIdList) { + List list = new ArrayList<>(); + if (templaIdList.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(FlowTemplateJsonEntity::getTemplateId, templaIdList); + queryWrapper.lambda().eq(FlowTemplateJsonEntity::getEnabledMark, 1); + queryWrapper.lambda().orderByAsc(FlowTemplateJsonEntity::getSortCode); + list.addAll(this.list(queryWrapper)); + } + return list; + } + + @Override + public FlowTemplateJsonEntity getInfo(String id) throws WorkFlowException { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowTemplateJsonEntity::getId, id); + FlowTemplateJsonEntity templateJsonEntity = this.getOne(queryWrapper); + if (templateJsonEntity == null) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + return templateJsonEntity; + } + + @Override + public FlowTemplateJsonEntity getJsonInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowTemplateJsonEntity::getId, id); + FlowTemplateJsonEntity templateJsonEntity = this.getOne(queryWrapper); + return templateJsonEntity; + } + + @Override + public void create(FlowTemplateJsonEntity entity) { + if (entity.getId() == null) { + entity.setId(RandomUtil.uuId()); + } + entity.setCreatorTime(new Date()); + entity.setCreatorUserId(UserProvider.getUser().getUserId()); + this.save(entity); + } + + @Override + public void update(String id, FlowTemplateJsonEntity entity) { + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(UserProvider.getUser().getUserId()); + this.updateById(entity); + } + + @Override + public void delete(FlowTemplateJsonEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + + @Override + public List getListAll(List id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowTemplateJsonEntity::getEnabledMark, 1); + queryWrapper.lambda().and(w -> w.eq(FlowTemplateJsonEntity::getVisibleType, 0).or(!id.isEmpty()).in(!id.isEmpty(), FlowTemplateJsonEntity::getId, id)); + queryWrapper.lambda().select(FlowTemplateJsonEntity::getId, FlowTemplateJsonEntity::getTemplateId); + List list = this.list(queryWrapper); + return list; + } + + @Override + @DSTransactional + public void templateJsonMajor(String ids) throws WorkFlowException { + String[] idAll = ids.split(","); + for (String id : idAll) { + FlowTemplateJsonEntity templateJson = getInfo(id); + if (StringUtil.isEmpty(templateJson.getFlowTemplateJson())) { + throw new WorkFlowException(MsgCode.WF052.get()); + } + List idList = ImmutableList.of(templateJson.getTemplateId()); + List list = getTemplateList(idList).stream().filter(t -> t.getGroupId().equals(templateJson.getGroupId())).collect(Collectors.toList()); + for (FlowTemplateJsonEntity entity : list) { + if (entity.getEnabledMark() == 1 || entity.getId().equals(templateJson.getId())) { + entity.setEnabledMark(entity.getId().equals(templateJson.getId()) ? 1 : 0); + this.update(entity.getId(), entity); + } + } + } + } + + @Override + public List sendMsgConfigList(FlowTemplateJsonEntity engine) { + List sendConfigList = new ArrayList<>(); + ChildNode childNodeAll = JsonUtil.getJsonToBean(engine.getFlowTemplateJson(), ChildNode.class); + //获取流程节点 + List nodeListAll = new ArrayList<>(); + List conditionListAll = new ArrayList<>(); + //递归获取条件数据和节点数据 + FlowJsonUtil.getTemplateAll(childNodeAll, nodeListAll, conditionListAll); + for (ChildNodeList childNode : nodeListAll) { + Properties properties = childNode.getProperties(); + MsgConfig waitMsgConfig = properties.getWaitMsgConfig(); + MsgConfig endMsgConfig = properties.getEndMsgConfig(); + MsgConfig approveMsgConfig = properties.getApproveMsgConfig(); + MsgConfig rejectMsgConfig = properties.getRejectMsgConfig(); + MsgConfig copyMsgConfig = properties.getCopyMsgConfig(); + MsgConfig launchMsgConfig = properties.getLaunchMsgConfig(); + MsgConfig overtimeMsgConfig = properties.getOvertimeMsgConfig(); + MsgConfig noticeMsgConfig = properties.getNoticeMsgConfig(); + //流程代办 + if (1 == waitMsgConfig.getOn()) { + if (StringUtil.isNotBlank(waitMsgConfig.getMsgId())) { + sendConfigList.add(waitMsgConfig.getMsgId()); + } + } + //流程结束 + if (1 == endMsgConfig.getOn()) { + if (StringUtil.isNotBlank(endMsgConfig.getMsgId())) { + sendConfigList.add(endMsgConfig.getMsgId()); + } + } + //节点同意 + if (1 == approveMsgConfig.getOn()) { + if (StringUtil.isNotBlank(approveMsgConfig.getMsgId())) { + sendConfigList.add(approveMsgConfig.getMsgId()); + } + } + //节点拒绝 + if (1 == rejectMsgConfig.getOn()) { + if (StringUtil.isNotBlank(rejectMsgConfig.getMsgId())) { + sendConfigList.add(rejectMsgConfig.getMsgId()); + } + } + //节点抄送 + if (1 == copyMsgConfig.getOn()) { + if (StringUtil.isNotBlank(copyMsgConfig.getMsgId())) { + sendConfigList.add(copyMsgConfig.getMsgId()); + } + } + //子流程 + if (1 == launchMsgConfig.getOn()) { + if (StringUtil.isNotBlank(launchMsgConfig.getMsgId())) { + sendConfigList.add(launchMsgConfig.getMsgId()); + } + } + //超时 + if (1 == overtimeMsgConfig.getOn()) { + if (StringUtil.isNotBlank(overtimeMsgConfig.getMsgId())) { + sendConfigList.add(overtimeMsgConfig.getMsgId()); + } + } + //提醒 + if (1 == noticeMsgConfig.getOn()) { + if (StringUtil.isNotBlank(waitMsgConfig.getMsgId())) { + sendConfigList.add(noticeMsgConfig.getMsgId()); + } + } + } + sendConfigList = sendConfigList.stream().distinct().collect(Collectors.toList()); + return sendConfigList; + } + + @Override + public void updateFullName(String groupId, String fullName) { + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.lambda().set(FlowTemplateJsonEntity::getFullName, fullName); + updateWrapper.lambda().eq(FlowTemplateJsonEntity::getGroupId, groupId); + this.update(updateWrapper); + } +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowTemplateServiceImpl.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowTemplateServiceImpl.java new file mode 100644 index 0000000..9445080 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowTemplateServiceImpl.java @@ -0,0 +1,738 @@ +package com.yunzhupaas.engine.service.impl; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.google.common.collect.ImmutableList; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.constant.PermissionConst; +import com.yunzhupaas.engine.entity.FlowEngineVisibleEntity; +import com.yunzhupaas.engine.entity.FlowTaskEntity; +import com.yunzhupaas.engine.entity.FlowTemplateEntity; +import com.yunzhupaas.engine.entity.FlowTemplateJsonEntity; +import com.yunzhupaas.engine.mapper.FlowTemplateMapper; +import com.yunzhupaas.engine.model.flowengine.FlowPagination; +import com.yunzhupaas.engine.model.flowengine.shuntjson.childnode.ChildNode; +import com.yunzhupaas.engine.model.flowengine.shuntjson.childnode.MsgConfig; +import com.yunzhupaas.engine.model.flowengine.shuntjson.childnode.Properties; +import com.yunzhupaas.engine.model.flowengine.shuntjson.nodejson.ChildNodeList; +import com.yunzhupaas.engine.model.flowengine.shuntjson.nodejson.ConditionList; +import com.yunzhupaas.engine.model.flowtemplate.FlowExportModel; +import com.yunzhupaas.engine.model.flowtemplate.FlowTemplateInfoVO; +import com.yunzhupaas.engine.model.flowtemplate.FlowTemplateListVO; +import com.yunzhupaas.engine.model.flowtemplate.FlowTemplateVO; +import com.yunzhupaas.engine.model.flowtemplatejson.FlowJsonModel; +import com.yunzhupaas.engine.model.flowtemplatejson.FlowTemplateJsonPage; +import com.yunzhupaas.engine.service.FlowEngineVisibleService; +import com.yunzhupaas.engine.service.FlowTaskService; +import com.yunzhupaas.engine.service.FlowTemplateJsonService; +import com.yunzhupaas.engine.service.FlowTemplateService; +import com.yunzhupaas.engine.util.FlowJsonUtil; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + + +/** + * 流程引擎 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年7月11日 上午9:18 + */ +@Service +public class FlowTemplateServiceImpl extends SuperServiceImpl implements FlowTemplateService { + + @Autowired + private FlowTaskService flowTaskService; + + @Autowired + private ServiceAllUtil serviceUtil; + @Autowired + private FlowEngineVisibleService flowEngineVisibleService; + @Autowired + private FlowTemplateJsonService flowTemplateJsonService; + + @Override + public List getPageList(FlowPagination pagination) { + // 定义变量判断是否需要使用修改时间倒序 + boolean flag = false; + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (ObjectUtil.isNotEmpty(pagination.getKeyword())) { + flag = true; + queryWrapper.lambda().and( + t -> t.like(FlowTemplateEntity::getFullName, pagination.getKeyword()) + .or().like(FlowTemplateEntity::getEnCode, pagination.getKeyword()) + ); + } + if (ObjectUtil.isNotEmpty(pagination.getCategory())) { + flag = true; + queryWrapper.lambda().eq(FlowTemplateEntity::getCategory, pagination.getCategory()); + } + if (ObjectUtil.isNotEmpty(pagination.getType())) { + flag = true; + queryWrapper.lambda().eq(FlowTemplateEntity::getType, pagination.getType()); + } + if (ObjectUtil.isNotEmpty(pagination.getEnabledMark())) { + flag = true; + queryWrapper.lambda().eq(FlowTemplateEntity::getEnabledMark, pagination.getEnabledMark()); + } + //排序 + queryWrapper.lambda().orderByAsc(FlowTemplateEntity::getSortCode).orderByDesc(FlowTemplateEntity::getCreatorTime); + if (flag) { + queryWrapper.lambda().orderByDesc(FlowTemplateEntity::getLastModifyTime); + } + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage userPage = this.page(page, queryWrapper); + return pagination.setData(userPage.getRecords(), page.getTotal()); + } + + @Override + public FlowTemplateEntity getInfo(String id) throws WorkFlowException { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowTemplateEntity::getId, id); + FlowTemplateEntity FlowTemplateEntity = this.getOne(queryWrapper); + if (FlowTemplateEntity == null) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + return FlowTemplateEntity; + } + + @Override + public boolean isExistByFullName(String fullName, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowTemplateEntity::getFullName, fullName); + queryWrapper.lambda().eq(FlowTemplateEntity::getType, 0); + if (!ObjectUtil.isEmpty(id)) { + queryWrapper.lambda().ne(FlowTemplateEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + public boolean isExistByEnCode(String enCode, String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowTemplateEntity::getEnCode, enCode); + if (!ObjectUtil.isEmpty(id)) { + queryWrapper.lambda().ne(FlowTemplateEntity::getId, id); + } + return this.count(queryWrapper) > 0 ? true : false; + } + + @Override + @DSTransactional + public void create(FlowTemplateEntity entity, List templateJsonList) throws WorkFlowException { + if (isExistByFullName(entity.getFullName(), entity.getId())) { + throw new WorkFlowException(MsgCode.EXIST001.get()); + } + if (isExistByEnCode(entity.getEnCode(), entity.getId())) { + throw new WorkFlowException(MsgCode.EXIST002.get()); + } + boolean formType = entity.getType() == 1; + UserInfo userInfo = UserProvider.getUser(); + entity.setId(StringUtil.isNotEmpty(entity.getId()) ? entity.getId() : RandomUtil.uuId()); + entity.setCreatorUserId(userInfo.getUserId()); + entity.setCreatorTime(new Date()); + entity.setEnabledMark(0); + entity.setLastModifyUserId(null); + entity.setLastModifyTime(null); + this.setIgnoreLogicDelete().removeById(entity.getId()); + this.setIgnoreLogicDelete().saveOrUpdate(entity); + this.clearIgnoreLogicDelete(); + List tempIdList = ImmutableList.of(entity.getId()); + List templateList = flowTemplateJsonService.getTemplateList(tempIdList); + Set formIdList = new HashSet<>(); + //保存引擎数据 + for (int k = 0; k < templateJsonList.size(); k++) { + FlowTemplateJsonEntity templateJson = templateJsonList.get(k); + templateJson.setId(StringUtil.isNotEmpty(templateJson.getId()) ? templateJson.getId() : RandomUtil.uuId()); + templateJson.setTemplateId(entity.getId()); + templateJson.setGroupId(StringUtil.isNotEmpty(templateJson.getGroupId()) ? templateJson.getGroupId() : RandomUtil.uuId()); + List visibleList = visibleList(templateJson, formType, formIdList); + flowEngineVisibleService.deleteVisible(templateJson.getId()); + int version = templateList.stream().filter(t -> t.getGroupId().equals(templateJson.getGroupId())).map(FlowTemplateJsonEntity::getVersion).mapToInt(Integer::parseInt).max().orElse(0) + 1; + templateJson.setVersion(version + ""); + templateJson.setSortCode(Long.parseLong(k + "")); + templateJson.setVisibleType(visibleList.size() == 0 ? 0 : 1); + templateJson.setEnabledMark(1); + flowTemplateJsonService.setIgnoreLogicDelete().removeById(templateJson.getId()); + flowTemplateJsonService.setIgnoreLogicDelete().saveOrUpdate(templateJson); + flowTemplateJsonService.clearIgnoreLogicDelete(); + for (int i = 0; i < visibleList.size(); i++) { + FlowEngineVisibleEntity visibleEntity = visibleList.get(i); + visibleEntity.setId(RandomUtil.uuId()); + visibleEntity.setFlowId(templateJson.getId()); + visibleEntity.setSortCode(Long.parseLong(i + "")); + flowEngineVisibleService.save(visibleEntity); + } + } + if (formType && formIdList.size() > 1) { + throw new WorkFlowException(MsgCode.WF055.get()); + } + serviceUtil.formIdList(new ArrayList<>(formIdList), entity.getId()); + } + + @Override + public void create(FlowTemplateEntity entity) { + UserInfo userInfo = UserProvider.getUser(); + entity.setId(StringUtil.isNotEmpty(entity.getId()) ? entity.getId() : RandomUtil.uuId()); + entity.setCreatorUserId(userInfo.getUserId()); + entity.setCreatorTime(new Date()); + entity.setEnabledMark(0); + this.saveOrUpdate(entity); + } + + @Override + public FlowTemplateInfoVO info(String id) throws WorkFlowException { + FlowTemplateEntity flowEntity = getInfo(id); + FlowTemplateInfoVO vo = JsonUtil.getJsonToBean(flowEntity, FlowTemplateInfoVO.class); + FlowTemplateJsonPage page = new FlowTemplateJsonPage(); + page.setTemplateId(id); + List listAll = flowTemplateJsonService.getListPage(page, false); + List list = flowTemplateJsonService.getMainList(ImmutableList.of(id)); + List flowTaskList = flowTaskService.getTemplateIdList(id); + List templateList = new ArrayList<>(); + for (FlowTemplateJsonEntity templateJson : list) { + FlowJsonModel model = new FlowJsonModel(); + model.setFlowId(templateJson.getId()); + model.setId(templateJson.getId()); + model.setFullName(templateJson.getFullName()); + model.setFlowTemplateJson(JsonUtil.stringToMap(templateJson.getFlowTemplateJson())); + List flowIdList = listAll.stream().filter(t -> templateJson.getGroupId().equals(t.getGroupId())).map(FlowTemplateJsonEntity::getId).collect(Collectors.toList()); + boolean isDelete = flowTaskList.stream().filter(t -> flowIdList.contains(t.getFlowId())).count() > 0; + model.setIsDelete(isDelete); + templateList.add(model); + } + vo.setFlowTemplateJson(JsonUtil.getObjectToString(templateList)); + return vo; + } + + @Override + @DSTransactional + public FlowTemplateVO updateVisible(String id, FlowTemplateEntity entity, List templateJsonList) throws WorkFlowException { + if (isExistByFullName(entity.getFullName(), id)) { + throw new WorkFlowException(MsgCode.EXIST001.get()); + } + if (isExistByEnCode(entity.getEnCode(), id)) { + throw new WorkFlowException(MsgCode.EXIST002.get()); + } + boolean formType = entity.getType() == 1; + UserInfo userInfo = UserProvider.getUser(); + FlowTemplateVO vo = new FlowTemplateVO(); + List listVO = new ArrayList<>(); + entity.setId(id); + entity.setLastModifyTime(new Date()); + entity.setLastModifyUserId(userInfo.getUserId()); + this.saveOrUpdate(entity); + //删除没有用到的流程 + List templateList = flowTemplateJsonService.getMainList(ImmutableList.of(entity.getId())); + for (int i = 0; i < templateList.size(); i++) { + FlowTemplateJsonEntity templateJson = templateList.get(i); + List flowList = flowTaskService.getFlowList(templateJson.getId()); + if (flowList.size() > 0) { + templateList.remove(i); + } + } + List tempJsonIdList = templateList.stream().map(FlowTemplateJsonEntity::getId).collect(Collectors.toList()); + List templateJsonId = templateJsonList.stream().filter(t -> StringUtil.isNotEmpty(t.getId())).map(FlowTemplateJsonEntity::getId).collect(Collectors.toList()); + tempJsonIdList.removeAll(templateJsonId); + for (String tempJsonId : tempJsonIdList) { + FlowTemplateJsonEntity delTemplateJson = flowTemplateJsonService.getInfo(tempJsonId); + flowEngineVisibleService.deleteVisible(delTemplateJson.getId()); + flowTemplateJsonService.delete(delTemplateJson); + } + Set formIdList = new HashSet<>(); + //保存引擎数据 + for (int k = 0; k < templateJsonList.size(); k++) { + FlowTemplateJsonEntity templateJson = templateJsonList.get(k); + boolean isTempId = StringUtil.isNotEmpty(templateJson.getId()); + String jsonId = isTempId ? templateJson.getId() : RandomUtil.uuId(); + //json变化才新增版本,true=变化 + FlowTemplateJsonEntity info = isTempId ? flowTemplateJsonService.getInfo(jsonId) : null; + boolean ischange = info != null && StringUtil.isNotEmpty(info.getFlowTemplateJson()) && !info.getFlowTemplateJson().equals(templateJson.getFlowTemplateJson()); + //判断流程任务是否被使用 + List flowList = flowTaskService.getFlowList(jsonId); + boolean isRand = flowList.size() > 0 && ischange; + templateJson.setId(isRand ? RandomUtil.uuId() : jsonId); + templateJson.setTemplateId(id); + templateJson.setGroupId(isTempId ? info.getGroupId() : RandomUtil.uuId()); + int version = 1; + //判断是否在使用,新增版本 + if (isRand) { + version = flowTemplateJsonService.getTemplateList(ImmutableList.of(id)).stream().filter(t -> t.getGroupId().equals(templateJson.getGroupId())).map(FlowTemplateJsonEntity::getVersion).mapToInt(Integer::parseInt).max().orElse(0) + 1; + listVO.add(templateJson.getId()); + } + List visibleList = visibleList(templateJson, formType, formIdList); + flowEngineVisibleService.deleteVisible(templateJson.getId()); + templateJson.setVisibleType(visibleList.size() == 0 ? 0 : 1); + templateJson.setSortCode(Long.parseLong(k + "")); + templateJson.setEnabledMark(isRand ? 0 : isTempId ? info.getEnabledMark() : 1); + templateJson.setVersion(isRand ? version + "" : isTempId ? info.getVersion() : version + ""); + flowTemplateJsonService.saveOrUpdate(templateJson); + for (int i = 0; i < visibleList.size(); i++) { + FlowEngineVisibleEntity visibleEntity = visibleList.get(i); + visibleEntity.setId(RandomUtil.uuId()); + visibleEntity.setFlowId(templateJson.getId()); + visibleEntity.setSortCode(Long.parseLong(i + "")); + flowEngineVisibleService.save(visibleEntity); + } + flowTemplateJsonService.updateFullName(templateJson.getGroupId(), templateJson.getFullName()); + } + vo.setIsMainVersion(listVO.size() > 0); + vo.setId(String.join(",", listVO)); + if (formType && formIdList.size() > 1) { + throw new WorkFlowException(MsgCode.WF055.get()); + } + serviceUtil.formIdList(new ArrayList<>(formIdList), entity.getId()); + return vo; + } + + @Override + public boolean update(String id, FlowTemplateEntity entity) { + entity.setId(id); + boolean flag = this.updateById(entity); + return flag; + } + + @Override + @DSTransactional + public void copy(FlowTemplateEntity entity, List templateJsonEntity) throws WorkFlowException { + try { + String copyNum = UUID.randomUUID().toString().substring(0, 5); + entity.setFullName(entity.getFullName() + ".副本" + copyNum); + entity.setEnCode(entity.getEnCode() + copyNum); + entity.setId(null); + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + for (FlowTemplateJsonEntity jsonEntity : templateJsonEntity) { + jsonEntity.setCreatorUserId(UserProvider.getUser().getUserId()); + jsonEntity.setCreatorTime(new Date()); + jsonEntity.setLastModifyUserId(null); + jsonEntity.setLastModifyTime(null); + jsonEntity.setGroupId(null); + jsonEntity.setId(null); + } + this.create(entity, templateJsonEntity); + } catch (Exception e) { + log.error(e.getMessage()); + throw new WorkFlowException(MsgCode.PRI006.get()); + } + } + + @Override + @DSTransactional + public void delete(FlowTemplateEntity entity) throws WorkFlowException { + List flowTaskList = flowTaskService.getTemplateIdList(entity.getId()); + if (flowTaskList.size() > 0) { + throw new WorkFlowException(MsgCode.WF057.get()); + } + List list = flowTemplateJsonService.getTemplateList(ImmutableList.of(entity.getId())); + this.removeById(entity.getId()); + serviceUtil.formIdList(new ArrayList<>(), entity.getId()); + for (FlowTemplateJsonEntity templateJson : list) { + List sendConfigIdList = flowTemplateJsonService.sendMsgConfigList(templateJson); + if (sendConfigIdList != null && sendConfigIdList.size() > 0) { + serviceUtil.updateSendConfigUsed(entity.getId(), sendConfigIdList); + } + serviceUtil.deleteFormId(templateJson.getId()); + flowEngineVisibleService.deleteVisible(templateJson.getId()); + } + } + + @Override + public FlowExportModel exportData(String id) throws WorkFlowException { + FlowTemplateEntity entity = getInfo(id); + List templateJsonList = flowTemplateJsonService.getMainList(ImmutableList.of(id)); + FlowExportModel model = new FlowExportModel(); + model.setFlowTemplate(entity); + model.setFlowTemplateJson(templateJsonList); + return model; + } + + @Override + @DSTransactional + public void ImportData(FlowExportModel flowExportModel, String type) throws WorkFlowException { + FlowTemplateEntity entity = flowExportModel.getFlowTemplate(); + List flowTemplateJson = flowExportModel.getFlowTemplateJson(); + if (entity != null) { + StringJoiner joiner = new StringJoiner(";"); + entity.setCreatorUserId(UserProvider.getLoginUserId()); + entity.setCreatorTime(new Date()); + entity.setLastModifyTime(null); + entity.setLastModifyUserId(null); + entity.setEnabledMark(0); + List templateList = new ArrayList<>(); + FlowTemplateEntity templateEntity = Import(entity, type, templateList); + if (templateList.size() > 0) { + joiner.add(String.join("、", templateList) + "重复"); + } + List jsonList = new ArrayList<>(); + if (ObjectUtil.isNotEmpty(flowTemplateJson)) { + List idList = new ArrayList<>(); + List nameList = new ArrayList<>(); + StringJoiner childJoiner = new StringJoiner("、"); + for (FlowTemplateJsonEntity templateJsonEntity : flowTemplateJson) { + templateJsonEntity.setCreatorUserId(UserProvider.getLoginUserId()); + templateJsonEntity.setCreatorTime(new Date()); + templateJsonEntity.setLastModifyTime(null); + templateJsonEntity.setLastModifyUserId(null); + templateJsonEntity.setGroupId(null); + FlowTemplateJsonEntity jsonEntity = Import(templateJsonEntity, type, idList, nameList); + jsonList.add(jsonEntity); + } + if (idList.size() > 0) { + childJoiner.add("ID(" + String.join("、", idList) + ")"); + } + if (nameList.size() > 0) { + childJoiner.add("名称(" + String.join("、", nameList) + ")"); + } + if (childJoiner.length() > 0) { + joiner.add("flowTemplateJson:" + childJoiner + "重复"); + } + } + if (StringUtil.isNotEmpty(joiner.toString())) { + throw new WorkFlowException(joiner.toString()); + } + create(templateEntity, jsonList); + } + } + + @Override + public List getSelectList() { + FlowPagination pagination = new FlowPagination(); + pagination.setFlowType(0); + List data = getListAll(pagination, false); + List dictionList = serviceUtil.getDiList(); + Map> dataList = data.stream().collect(Collectors.groupingBy(FlowTemplateEntity::getCategory)); + List listVOS = new LinkedList<>(); + for (DictionaryDataEntity entity : dictionList) { + FlowTemplateListVO model = new FlowTemplateListVO(); + model.setFullName(entity.getFullName()); + model.setId(entity.getId()); + List childList = dataList.get(entity.getId()) != null ? dataList.get(entity.getId()) : new ArrayList<>(); + model.setNum(childList.size()); + if (childList.size() > 0) { + model.setChildren(JsonUtil.getJsonToList(childList, FlowTemplateListVO.class)); + } + listVOS.add(model); + } + return listVOS; + } + + @Override + public List getTreeList() { + FlowPagination pagination = new FlowPagination(); + List data = getListAll(pagination, false); + List dictionList = serviceUtil.getDiList(); + Map> typeList = data.stream().collect(Collectors.groupingBy(FlowTemplateEntity::getType)); + List listVOS = new LinkedList<>(); + for (Integer key : typeList.keySet()) { + boolean type = Objects.equals(0, key); + //发起类型 + FlowTemplateListVO model = new FlowTemplateListVO(); + model.setId(key + ""); + model.setFullName(type ? "发起流程" : "功能流程"); + model.setDisabled(true); + Map> dataList = typeList.get(key).stream().collect(Collectors.groupingBy(FlowTemplateEntity::getCategory)); + List dictionListVOS = new LinkedList<>(); + for (DictionaryDataEntity entity : dictionList) { + FlowTemplateListVO dictionModel = new FlowTemplateListVO(); + dictionModel.setFullName(entity.getFullName()); + dictionModel.setId(RandomUtil.uuId()); + List childList = dataList.get(entity.getId()) != null ? dataList.get(entity.getId()) : new ArrayList<>(); + dictionModel.setDisabled(true); + if (childList.size() > 0) { + dictionModel.setChildren(JsonUtil.getJsonToList(childList, FlowTemplateListVO.class)); + dictionModel.setNum(childList.size()); + dictionListVOS.add(dictionModel); + } + } + if (dictionListVOS.size() > 0) { + model.setChildren(dictionListVOS); + listVOS.add(model); + } + } + return listVOS; + } + + @Override + public List getTemplateList(List id) { + List list = new ArrayList<>(); + if (id.size() > 0) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(FlowTemplateEntity::getId, id); + list = this.list(queryWrapper); + } + return list; + } + + @Override + public FlowTemplateEntity getFlowIdByCode(String code) throws WorkFlowException { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowTemplateEntity::getEnCode, code); + FlowTemplateEntity FlowTemplateEntity = this.getOne(queryWrapper); + if (FlowTemplateEntity == null) { + throw new WorkFlowException(MsgCode.FA001.get()); + } + return FlowTemplateEntity; + } + + @Override + public List getListAll(FlowPagination pagination, boolean isPage) { + // 定义变量判断是否需要使用修改时间倒序 + boolean flag = false; + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowTemplateEntity::getEnabledMark, 1); + if (ObjectUtil.isNotEmpty(pagination.getFlowType())) { + flag = true; + queryWrapper.lambda().eq(FlowTemplateEntity::getType, pagination.getFlowType()); + } + if (ObjectUtil.isNotEmpty(pagination.getKeyword())) { + flag = true; + queryWrapper.lambda().like(FlowTemplateEntity::getFullName, pagination.getKeyword()); + } + if (ObjectUtil.isNotEmpty(pagination.getCategory())) { + flag = true; + queryWrapper.lambda().eq(FlowTemplateEntity::getCategory, pagination.getCategory()); + } + if (ObjectUtil.isNotEmpty(pagination.getTemplateIdList())) { + queryWrapper.lambda().in(FlowTemplateEntity::getId, pagination.getTemplateIdList()); + } + queryWrapper.lambda().orderByAsc(FlowTemplateEntity::getSortCode).orderByDesc(FlowTemplateEntity::getCreatorTime); + if (flag) { + queryWrapper.lambda().orderByDesc(FlowTemplateEntity::getLastModifyTime); + } + queryWrapper.lambda().select( + FlowTemplateEntity::getId, FlowTemplateEntity::getEnCode, + FlowTemplateEntity::getFullName, + FlowTemplateEntity::getType, FlowTemplateEntity::getIcon, + FlowTemplateEntity::getCategory, FlowTemplateEntity::getIconBackground, + FlowTemplateEntity::getCreatorUserId, FlowTemplateEntity::getSortCode, + FlowTemplateEntity::getEnabledMark, FlowTemplateEntity::getCreatorTime + ); + if (isPage) { + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage userPage = this.page(page, queryWrapper); + return pagination.setData(userPage.getRecords(), page.getTotal()); + } else { + return this.list(queryWrapper); + } + } + + @Override + public List getListByFlowIds(FlowPagination pagination, List listAll, Boolean isAll, Boolean isPage, String userId) { + // 定义变量判断是否需要使用修改时间倒序 + boolean flag = false; + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowTemplateEntity::getEnabledMark, 1); + List listIn = new ArrayList<>(); + List listVisible = null; + if (StringUtil.isNotEmpty(userId)) {//当用户不为空的时候【判断该用户的权限 + UserEntity userInfo = serviceUtil.getUserInfo(userId); + boolean visibleType = "1".equals(userInfo.getIsAdministrator()); + if (!visibleType) { + List id = flowEngineVisibleService.getVisibleFlowList(userInfo.getId()).stream().map(FlowEngineVisibleEntity::getFlowId).collect(Collectors.toList()); + //可见列表 + listVisible = flowTemplateJsonService.getListAll(id).stream().map(FlowTemplateJsonEntity::getTemplateId).collect(Collectors.toList()); + } + if (CollectionUtil.isNotEmpty(listVisible) && CollectionUtil.isNotEmpty(listAll)) { + for (String str : listAll) { + if (listVisible.contains(str)) { + listIn.add(str); + } + } + } else if (isAll) { + listIn = listVisible; + } + } else {//不判断用户权限 + listIn = listAll; + } + if (CollectionUtil.isEmpty(listIn) && !isAll) { + return new ArrayList<>(); + } + if (CollectionUtil.isNotEmpty(listIn)) { + queryWrapper.lambda().in(FlowTemplateEntity::getId, listIn); + } + if (ObjectUtil.isNotEmpty(pagination.getKeyword())) { + flag = true; + queryWrapper.lambda().like(FlowTemplateEntity::getFullName, pagination.getKeyword()); + } + if (ObjectUtil.isNotEmpty(pagination.getCategory())) { + flag = true; + queryWrapper.lambda().eq(FlowTemplateEntity::getCategory, pagination.getCategory()); + } + if (ObjectUtil.isNotEmpty(pagination.getFlowType())) { + flag = true; + queryWrapper.lambda().eq(FlowTemplateEntity::getType, pagination.getFlowType()); + } + queryWrapper.lambda().orderByAsc(FlowTemplateEntity::getSortCode).orderByDesc(FlowTemplateEntity::getCreatorTime); + if (flag) { + queryWrapper.lambda().orderByDesc(FlowTemplateEntity::getLastModifyTime); + } + queryWrapper.lambda().select( + FlowTemplateEntity::getId, FlowTemplateEntity::getEnCode, + FlowTemplateEntity::getFullName, + FlowTemplateEntity::getType, FlowTemplateEntity::getIcon, + FlowTemplateEntity::getCategory, FlowTemplateEntity::getIconBackground, + FlowTemplateEntity::getCreatorUserId, FlowTemplateEntity::getSortCode, + FlowTemplateEntity::getEnabledMark, FlowTemplateEntity::getCreatorTime + ); + if (isPage) { + Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); + IPage userPage = this.page(page, queryWrapper); + return pagination.setData(userPage.getRecords(), page.getTotal()); + } else { + return list(queryWrapper); + } + + } + + @Override + public void saveLogicFlowAndForm(String id) { + FlowTemplateEntity flowEnt = this.setIgnoreLogicDelete().getById(id); + if (flowEnt != null) { + flowEnt.setDeleteMark(null); + this.setIgnoreLogicDelete().updateById(flowEnt); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowTemplateJsonEntity::getTemplateId, id); + List list = flowTemplateJsonService.setIgnoreLogicDelete().list(queryWrapper); + list.forEach(t -> t.setDeleteMark(null)); + flowTemplateJsonService.setIgnoreLogicDelete().updateBatchById(list); + } + this.clearIgnoreLogicDelete(); + } + + private List visibleList(FlowTemplateJsonEntity entity, boolean formType, Set formIdList) throws WorkFlowException { + List visibleList = new ArrayList<>(); + String templeId = entity.getTemplateId(); + String formData = StringUtil.isNotEmpty(entity.getFlowTemplateJson()) ? entity.getFlowTemplateJson() : "{}"; + ChildNode childNode = JsonUtil.getJsonToBean(formData, ChildNode.class); + Properties properties = childNode.getProperties(); + if (StringUtil.isNotEmpty(properties.getFormId())) { + formIdList.add(properties.getFormId()); + } + //流程可见 + for (String initiator : properties.getInitiator()) { + String type = initiator.split("--").length > 1 ? initiator.split("--")[1] : PermissionConst.USER; + String operatorId = initiator.split("--")[0]; + FlowEngineVisibleEntity visible = new FlowEngineVisibleEntity(); + visible.setOperatorId(operatorId); + visible.setOperatorType(type); + visible.setType(1); + visibleList.add(visible); + } + List nodeListAll = new ArrayList<>(); + List conditionListAll = new ArrayList<>(); + FlowJsonUtil.getTemplateAll(childNode, nodeListAll, conditionListAll); + List sendIdList = new ArrayList<>(); + for (ChildNodeList childNodeList : nodeListAll) { + Properties childProperties = childNodeList.getProperties(); + MsgConfig waitMsgConfig = childProperties.getWaitMsgConfig(); + if (StringUtil.isNotEmpty(waitMsgConfig.getMsgId())) { + sendIdList.add(waitMsgConfig.getMsgId()); + } + MsgConfig endMsgConfig = childProperties.getEndMsgConfig(); + if (StringUtil.isNotEmpty(endMsgConfig.getMsgId())) { + sendIdList.add(endMsgConfig.getMsgId()); + } + MsgConfig approveMsgConfig = childProperties.getApproveMsgConfig(); + if (StringUtil.isNotEmpty(approveMsgConfig.getMsgId())) { + sendIdList.add(approveMsgConfig.getMsgId()); + } + MsgConfig rejectMsgConfig = childProperties.getRejectMsgConfig(); + if (StringUtil.isNotEmpty(rejectMsgConfig.getMsgId())) { + sendIdList.add(rejectMsgConfig.getMsgId()); + } + MsgConfig copyMsgConfig = childProperties.getCopyMsgConfig(); + if (StringUtil.isNotEmpty(copyMsgConfig.getMsgId())) { + sendIdList.add(copyMsgConfig.getMsgId()); + } + MsgConfig launchMsgConfig = childProperties.getLaunchMsgConfig(); + if (StringUtil.isNotEmpty(launchMsgConfig.getMsgId())) { + sendIdList.add(launchMsgConfig.getMsgId()); + } + MsgConfig overtimeMsgConfig = childProperties.getOvertimeMsgConfig(); + if (StringUtil.isNotEmpty(overtimeMsgConfig.getMsgId())) { + sendIdList.add(overtimeMsgConfig.getMsgId()); + } + MsgConfig noticeMsgConfig = childProperties.getNoticeMsgConfig(); + if (StringUtil.isNotEmpty(noticeMsgConfig.getMsgId())) { + sendIdList.add(noticeMsgConfig.getMsgId()); + } + } + entity.setSendConfigIds(JsonUtil.getObjectToString(sendIdList)); + return visibleList; + } + + private FlowTemplateEntity Import(FlowTemplateEntity templateEntity, String type, List errList) { + FlowTemplateEntity entity = JsonUtil.getJsonToBean(templateEntity, FlowTemplateEntity.class); + boolean skip = Objects.equals("0", type); + int num = 0; + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowTemplateEntity::getId, entity.getId()); + if (this.count(queryWrapper) > 0) { + num++; + if (skip) { + errList.add("ID"); + } + } + queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowTemplateEntity::getEnCode, entity.getEnCode()); + if (this.count(queryWrapper) > 0) { + num++; + if (skip) { + errList.add("编码"); + } + } + queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowTemplateEntity::getFullName, entity.getFullName()); + if (this.count(queryWrapper) > 0) { + num++; + if (skip) { + errList.add("名称"); + } + } + if (num > 0 && !skip) { + String copyNum = UUID.randomUUID().toString().substring(0, 5); + entity.setFullName(entity.getFullName() + ".副本" + copyNum); + entity.setEnCode(entity.getEnCode() + copyNum); + } + entity.setId(RandomUtil.uuId()); + return entity; + } + + private FlowTemplateJsonEntity Import(FlowTemplateJsonEntity templateEntity, String type, List idList, List nameList) { + FlowTemplateJsonEntity entity = JsonUtil.getJsonToBean(templateEntity, FlowTemplateJsonEntity.class); + boolean skip = Objects.equals("0", type); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowTemplateJsonEntity::getId, entity.getId()); + if (flowTemplateJsonService.count(queryWrapper) > 0) { + if (skip) { + idList.add(entity.getId()); + } + } + queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowTemplateJsonEntity::getFullName, entity.getFullName()); + queryWrapper.lambda().eq(FlowTemplateJsonEntity::getTemplateId, entity.getId()); + if (flowTemplateJsonService.count(queryWrapper) > 0) { + if (skip) { + nameList.add(entity.getFullName()); + } + } + entity.setId(RandomUtil.uuId()); + return entity; + } +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowUserServiceImpl.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowUserServiceImpl.java new file mode 100644 index 0000000..f0c09ed --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/service/impl/FlowUserServiceImpl.java @@ -0,0 +1,61 @@ +package com.yunzhupaas.engine.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yunzhupaas.base.service.SuperServiceImpl; +import com.yunzhupaas.engine.entity.FlowUserEntity; +import com.yunzhupaas.engine.mapper.FlowUserMapper; +import com.yunzhupaas.engine.service.FlowUserService; +import com.yunzhupaas.util.RandomUtil; +import org.springframework.stereotype.Service; + +/** + * 流程发起用户信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Service +public class FlowUserServiceImpl extends SuperServiceImpl implements FlowUserService { + + @Override + public FlowUserEntity getInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowUserEntity::getId, id); + return this.getOne(queryWrapper); + } + + @Override + public FlowUserEntity getTaskInfo(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowUserEntity::getTaskId, id); + return this.getOne(queryWrapper); + } + + @Override + public void create(FlowUserEntity entity) { + entity.setId(RandomUtil.uuId()); + this.save(entity); + } + + @Override + public void update(String id, FlowUserEntity entity) { + entity.setId(id); + this.updateById(entity); + } + + @Override + public void delete(FlowUserEntity entity) { + if (entity != null) { + this.removeById(entity.getId()); + } + } + + @Override + public void deleteByTaskId(String taskId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowUserEntity::getTaskId, taskId); + this.remove(queryWrapper); + } +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/util/FlowMsgUtil.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/util/FlowMsgUtil.java new file mode 100644 index 0000000..440da2c --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/util/FlowMsgUtil.java @@ -0,0 +1,927 @@ +package com.yunzhupaas.engine.util; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.emnus.TemplateEnum; +import com.yunzhupaas.engine.entity.*; +import com.yunzhupaas.engine.enums.FlowMessageEnum; +import com.yunzhupaas.engine.enums.FlowTaskStatusEnum; +import com.yunzhupaas.engine.model.flowbefore.FlowTemplateAllModel; +import com.yunzhupaas.engine.model.flowdelegate.FlowDelegateModel; +import com.yunzhupaas.engine.model.flowengine.FlowModel; +import com.yunzhupaas.engine.model.flowengine.shuntjson.childnode.Properties; +import com.yunzhupaas.engine.model.flowengine.shuntjson.childnode.*; +import com.yunzhupaas.engine.model.flowengine.shuntjson.nodejson.ChildNodeList; +import com.yunzhupaas.engine.model.flowmessage.FlowEventModel; +import com.yunzhupaas.engine.model.flowmessage.FlowMessageModel; +import com.yunzhupaas.engine.model.flowmessage.FlowMsgModel; +import com.yunzhupaas.engine.model.flowmessage.FlowParameterModel; +import com.yunzhupaas.engine.model.flowtask.FlowContModel; +import com.yunzhupaas.engine.service.FlowDelegateService; +import com.yunzhupaas.engine.service.FlowEventLogService; +import com.yunzhupaas.engine.service.FlowTaskService; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.message.model.SentMessageForm; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/3/30 11:45 + */ +@Component +public class FlowMsgUtil { + + + @Autowired + private FlowTaskService flowTaskService; + @Autowired + private ServiceAllUtil serviceUtil; + @Autowired + private FlowTaskUtil flowTaskUtil; + @Autowired + private FlowDelegateService flowDelegateService; + @Autowired + private FlowEventLogService flowEventLogService; + + /** + * 发送消息 + * + * @param flowMsgModel + */ + public void message(FlowMsgModel flowMsgModel) throws WorkFlowException { + List messageListAll = new ArrayList<>(); + FlowTaskEntity taskEntity = flowMsgModel.getTaskEntity(); + List creatorUserId = new ArrayList<>(); + UserEntity user = taskEntity != null ? serviceUtil.getUserInfo(taskEntity.getCreatorUserId()) : null; + if (taskEntity != null) { + creatorUserId.add(taskEntity.getCreatorUserId()); + } + FlowTaskNodeEntity flowTaskNode = flowMsgModel.getTaskNodeEntity(); + FlowTemplateAllModel flowTemplateAllModel = flowMsgModel.getFlowTemplateAllModel(); + List nodeList = flowMsgModel.getNodeList(); + List operatorList = flowMsgModel.getOperatorList(); + List circulateList = flowMsgModel.getCirculateList(); + FlowTaskNodeEntity startNode = nodeList.stream().filter(t -> FlowNature.NodeStart.equals(t.getNodeType())).findFirst().orElse(null); + String nodeJson = startNode != null ? startNode.getNodePropertyJson() : "{}"; + FlowModel flowModel = flowMsgModel.getFlowModel(); + UserInfo userInfo = flowModel.getUserInfo(); + FlowTaskOperatorRecordEntity recordEntity = new FlowTaskOperatorRecordEntity(); + recordEntity.setTaskId(startNode != null ? startNode.getTaskId() : ""); + recordEntity.setHandleId(userInfo != null ? userInfo.getUserId() : ""); + //等待 + if (flowMsgModel.getWait()) { + ChildNodeList childNode = JsonUtil.getJsonToBean(nodeJson, ChildNodeList.class); + Properties properties = childNode.getProperties(); + MsgConfig taskMsgConfig = properties.getWaitMsgConfig(); + if (taskMsgConfig.getOn() == 3) { + taskMsgConfig.setMsgId("PZXTLC001"); + } + Map> operatorMap = operatorList.stream().collect(Collectors.groupingBy(FlowTaskOperatorEntity::getTaskNodeId)); + for (String key : operatorMap.keySet()) { + recordEntity.setTaskNodeId(key); + List messageList = new ArrayList<>(); + List taskOperatorList = operatorMap.get(key); + FlowMessageModel messageModel = new FlowMessageModel(); + FlowTaskNodeEntity taskNode = nodeList.stream().filter(t -> t.getId().equals(recordEntity.getTaskNodeId())).findFirst().orElse(null); + Map data = flowTaskUtil.infoData(taskNode.getFormId(), taskNode.getTaskId()); + messageModel.setData(data); + messageModel.setMsgConfig(taskMsgConfig); + messageModel.setRecordEntity(recordEntity); + messageModel.setStatus(taskEntity.getStatus()); + messageModel.setFullName(taskEntity.getFullName()); +// if (StringUtil.isNotEmpty(flowMsgModel.getTitle())) { +// messageModel.setFullName(taskEntity.getFullName() + flowMsgModel.getTitle()); +// } + messageModel.setUserInfo(userInfo); + messageModel(taskOperatorList, flowTemplateAllModel, messageModel); + setMessageList(messageList, messageModel); + messageListAll.addAll(messageList); + for (FlowTaskOperatorEntity operator : taskOperatorList) { + List delegationMsg = delegationMsg(operator, messageModel, flowTemplateAllModel); + messageListAll.addAll(delegationMsg); + } + } + } + //结束 + if (flowMsgModel.getEnd()) { + //发起人 + ChildNodeList childNode = JsonUtil.getJsonToBean(nodeJson, ChildNodeList.class); + Properties properties = childNode.getProperties(); + MsgConfig msgConfig = properties.getEndMsgConfig(); + if (msgConfig.getOn() == 3) { + msgConfig.setMsgId("PZXTLC010"); + } + List messageList = new ArrayList<>(); + FlowMessageModel messageModel = new FlowMessageModel(); + String formId = properties.getFormId(); + Map data = flowTaskUtil.infoData(formId, childNode.getTaskId()); + messageModel.setData(data); + messageModel.setTitle("已【结束】"); + messageModel.setMsgConfig(msgConfig); + messageModel.setType(FlowMessageEnum.me.getCode()); + messageModel.setRecordEntity(recordEntity); + messageModel.setStatus(taskEntity.getStatus()); + messageModel.setFullName(taskEntity.getFullName()); + messageModel.setUserInfo(userInfo); + List taskOperatorList = new ArrayList() {{ + FlowTaskOperatorEntity operatorEntity = new FlowTaskOperatorEntity(); + operatorEntity.setTaskId(childNode.getTaskId()); + operatorEntity.setTaskNodeId(childNode.getTaskNodeId()); + operatorEntity.setHandleId(taskEntity.getCreatorUserId()); + add(operatorEntity); + }}; + messageModel(taskOperatorList, flowTemplateAllModel, messageModel); + setMessageList(messageList, messageModel); + messageListAll.addAll(messageList); + } + //同意 + if (flowMsgModel.getApprove()) { + ChildNodeList childNode = JsonUtil.getJsonToBean(nodeJson, ChildNodeList.class); + Properties properties = childNode.getProperties(); + MsgConfig msgConfig = properties.getApproveMsgConfig(); + if (msgConfig.getOn() == 3) { + msgConfig.setMsgId("PZXTLC002"); + } + Map> operatorMap = operatorList.stream().collect(Collectors.groupingBy(FlowTaskOperatorEntity::getTaskNodeId)); + for (String key : operatorMap.keySet()) { + recordEntity.setTaskNodeId(flowTaskNode.getId()); + //默认获取当前节点 + FlowTaskNodeEntity taskNode = nodeList.stream().filter(t -> t.getId().equals(recordEntity.getTaskNodeId())).findFirst().orElse(null); + ChildNodeList taskChildNode = JsonUtil.getJsonToBean(taskNode.getNodePropertyJson(), ChildNodeList.class); + Properties taskProperties = taskChildNode.getProperties(); + MsgConfig taskMsgConfig = taskProperties.getApproveMsgConfig(); + if (taskMsgConfig.getOn() == 2) { + taskMsgConfig = msgConfig; + } + if (taskMsgConfig.getOn() == 3) { + taskMsgConfig.setMsgId("PZXTLC002"); + } + List messageList = new ArrayList<>(); + List taskOperatorList = operatorMap.get(key); + FlowMessageModel messageModel = new FlowMessageModel(); + Map data = flowTaskUtil.infoData(taskNode.getFormId(), taskNode.getTaskId()); + messageModel.setData(data); + messageModel.setTitle("已被【同意】"); + messageModel.setMsgConfig(taskMsgConfig); + messageModel.setRecordEntity(recordEntity); + messageModel.setStatus(taskEntity.getStatus()); + messageModel.setFullName(taskEntity.getFullName()); + messageModel.setUserInfo(userInfo); + messageModel(taskOperatorList, flowTemplateAllModel, messageModel); + setMessageList(messageList, messageModel); + messageListAll.addAll(messageList); + for (FlowTaskOperatorEntity operator : taskOperatorList) { + List delegationMsg = delegationMsg(operator, messageModel, flowTemplateAllModel); + messageListAll.addAll(delegationMsg); + } + } + } + //拒绝 + if (flowMsgModel.getReject()) { + ChildNodeList childNode = JsonUtil.getJsonToBean(nodeJson, ChildNodeList.class); + Properties properties = childNode.getProperties(); + MsgConfig msgConfig = properties.getRejectMsgConfig(); + if (msgConfig.getOn() == 3) { + msgConfig.setMsgId("PZXTLC003"); + } + Map> operatorMap = operatorList.stream().collect(Collectors.groupingBy(FlowTaskOperatorEntity::getTaskNodeId)); + for (String key : operatorMap.keySet()) { + recordEntity.setTaskNodeId(flowTaskNode.getId()); + //默认获取当前节点 + FlowTaskNodeEntity taskNode = nodeList.stream().filter(t -> t.getId().equals(recordEntity.getTaskNodeId())).findFirst().orElse(null); + ChildNodeList taskChildNode = JsonUtil.getJsonToBean(taskNode.getNodePropertyJson(), ChildNodeList.class); + Properties taskProperties = taskChildNode.getProperties(); + MsgConfig taskMsgConfig = taskProperties.getRejectMsgConfig(); + if (taskMsgConfig.getOn() == 2) { + taskMsgConfig = msgConfig; + } + if (taskMsgConfig.getOn() == 3) { + taskMsgConfig.setMsgId("PZXTLC003"); + } + List messageList = new ArrayList<>(); + List taskOperatorList = operatorMap.get(key); + FlowMessageModel messageModel = new FlowMessageModel(); + Map data = flowTaskUtil.infoData(taskNode.getFormId(), taskNode.getTaskId()); + messageModel.setData(data); + messageModel.setTitle("已被【退回】"); + messageModel.setMsgConfig(taskMsgConfig); + messageModel.setRecordEntity(recordEntity); + messageModel.setStatus(taskEntity.getStatus()); + messageModel.setType(FlowMessageEnum.wait.getCode()); + messageModel.setFullName(taskEntity.getFullName()); + messageModel.setUserInfo(userInfo); + messageModel(taskOperatorList, flowTemplateAllModel, messageModel); + setMessageList(messageList, messageModel); + messageListAll.addAll(messageList); + for (FlowTaskOperatorEntity operator : taskOperatorList) { + List delegationMsg = delegationMsg(operator, messageModel, flowTemplateAllModel); + messageListAll.addAll(delegationMsg); + } + } + } + //抄送 + if (flowMsgModel.getCopy()) { + ChildNodeList childNode = JsonUtil.getJsonToBean(nodeJson, ChildNodeList.class); + Properties properties = childNode.getProperties(); + MsgConfig msgConfig = properties.getCopyMsgConfig(); + if (msgConfig.getOn() == 3) { + msgConfig.setMsgId("PZXTLC007"); + } + Map> circulateMap = circulateList.stream().collect(Collectors.groupingBy(FlowTaskCirculateEntity::getTaskNodeId)); + for (String key : circulateMap.keySet()) { + recordEntity.setTaskNodeId(key); + //默认获取当前节点 + FlowTaskNodeEntity taskNode = nodeList.stream().filter(t -> t.getId().equals(key)).findFirst().orElse(null); + ChildNodeList taskChildNode = JsonUtil.getJsonToBean(taskNode.getNodePropertyJson(), ChildNodeList.class); + Properties taskProperties = taskChildNode.getProperties(); + MsgConfig taskMsgConfig = taskProperties.getCopyMsgConfig(); + if (taskMsgConfig.getOn() == 2) { + taskMsgConfig = msgConfig; + } + if (taskMsgConfig.getOn() == 3) { + taskMsgConfig.setMsgId("PZXTLC007"); + } + List messageList = new ArrayList<>(); + List taskOperatorList = new ArrayList<>(); + for (FlowTaskCirculateEntity circulateEntity : circulateMap.get(key)) { + FlowTaskOperatorEntity operatorEntity = JsonUtil.getJsonToBean(circulateEntity, FlowTaskOperatorEntity.class); + operatorEntity.setHandleId(circulateEntity.getObjectId()); + taskOperatorList.add(operatorEntity); + } + FlowMessageModel messageModel = new FlowMessageModel(); + Map data = flowTaskUtil.infoData(taskNode.getFormId(), taskNode.getTaskId()); + messageModel.setData(data); + messageModel.setTitle("已被【抄送】"); + messageModel.setMsgConfig(taskMsgConfig); + messageModel.setRecordEntity(recordEntity); + messageModel.setStatus(taskEntity.getStatus()); + messageModel.setType(FlowMessageEnum.circulate.getCode()); + messageModel.setFullName(taskEntity.getFullName()); + messageModel.setUserInfo(userInfo); + messageModel(taskOperatorList, flowTemplateAllModel, messageModel); + setMessageList(messageList, messageModel); + messageListAll.addAll(messageList); + } + } + //子流程 + if (flowMsgModel.getLaunch()) { + ChildNodeList childNode = JsonUtil.getJsonToBean(nodeJson, ChildNodeList.class); + Properties properties = childNode.getProperties(); + MsgConfig msgConfig = properties.getLaunchMsgConfig(); + if (msgConfig.getOn() == 3) { + msgConfig.setMsgId("PZXTLC011"); + } + Map> operatorMap = operatorList.stream().collect(Collectors.groupingBy(FlowTaskOperatorEntity::getTaskNodeId)); + for (String key : operatorMap.keySet()) { + recordEntity.setTaskNodeId(key); + //默认获取当前节点 + FlowTaskNodeEntity taskNode = nodeList.stream().filter(t -> t.getId().equals(key)).findFirst().orElse(null); + ChildNodeList taskChildNode = JsonUtil.getJsonToBean(taskNode.getNodePropertyJson(), ChildNodeList.class); + Properties taskProperties = taskChildNode.getProperties(); + MsgConfig taskMsgConfig = taskProperties.getLaunchMsgConfig(); + if (taskMsgConfig.getOn() == 2) { + taskMsgConfig = msgConfig; + } + if (taskMsgConfig.getOn() == 3) { + taskMsgConfig.setMsgId("PZXTLC011"); + } + List messageList = new ArrayList<>(); + List taskOperatorList = operatorMap.get(key); + FlowMessageModel messageModel = new FlowMessageModel(); + Map data = flowTaskUtil.infoData(properties.getFormId(), childNode.getTaskId()); + messageModel.setData(data); + messageModel.setTitle("请发起【子流程】"); + messageModel.setMsgConfig(taskMsgConfig); + messageModel.setRecordEntity(recordEntity); + messageModel.setType(FlowMessageEnum.me.getCode()); + messageModel.setStatus(FlowTaskStatusEnum.Draft.getCode()); + messageModel.setFullName(taskEntity.getFullName()); + messageModel.setUserInfo(userInfo); + messageModel(taskOperatorList, flowTemplateAllModel, messageModel); + setMessageList(messageList, messageModel); + messageListAll.addAll(messageList); + } + } + //发起人 + if (flowMsgModel.getStart()) { + ChildNodeList childNode = JsonUtil.getJsonToBean(nodeJson, ChildNodeList.class); + Properties properties = childNode.getProperties(); + MsgConfig msgConfig = properties.getRejectMsgConfig(); + if (msgConfig.getOn() == 3) { + msgConfig.setMsgId("PZXTLC003"); + } + List messageList = new ArrayList<>(); + FlowMessageModel meModel = new FlowMessageModel(); + Map data = flowTaskUtil.infoData(properties.getFormId(), childNode.getTaskId()); + meModel.setData(data); + meModel.setTitle("已被【退回】"); + meModel.setRecordEntity(recordEntity); + meModel.setStatus(taskEntity.getStatus()); + meModel.setMsgConfig(msgConfig); + meModel.setType(FlowMessageEnum.me.getCode()); + meModel.setFullName(taskEntity.getFullName()); + meModel.setUserInfo(userInfo); + List meOperatorList = new ArrayList() {{ + FlowTaskOperatorEntity operatorEntity = new FlowTaskOperatorEntity(); + operatorEntity.setTaskId(flowTaskNode.getTaskId()); + operatorEntity.setHandleId(taskEntity.getCreatorUserId()); + add(operatorEntity); + }}; + messageModel(meOperatorList, flowTemplateAllModel, meModel); + setMessageList(messageList, meModel); + messageListAll.addAll(messageList); + } + //超时 + if (flowMsgModel.getOvertime()) { + ChildNodeList childNode = JsonUtil.getJsonToBean(nodeJson, ChildNodeList.class); + Properties properties = childNode.getProperties(); + MsgConfig msgConfig = properties.getOvertimeMsgConfig(); + if (msgConfig.getOn() == 3) { + msgConfig.setMsgId("PZXTLC009"); + } + Map> operatorMap = operatorList.stream().collect(Collectors.groupingBy(FlowTaskOperatorEntity::getTaskNodeId)); + for (String key : operatorMap.keySet()) { + recordEntity.setTaskNodeId(key); + FlowTaskNodeEntity taskNode = nodeList.stream().filter(t -> t.getId().equals(key)).findFirst().orElse(null); + ChildNodeList taskChildNode = JsonUtil.getJsonToBean(taskNode.getNodePropertyJson(), ChildNodeList.class); + Properties taskProperties = taskChildNode.getProperties(); + MsgConfig taskMsgConfig = taskProperties.getOvertimeMsgConfig(); + if (taskMsgConfig.getOn() == 2) { + taskMsgConfig = msgConfig; + } + if (taskMsgConfig.getOn() == 3) { + taskMsgConfig.setMsgId("PZXTLC009"); + } + List messageList = new ArrayList<>(); + List taskOperatorList = operatorMap.get(key); + FlowMessageModel messageModel = new FlowMessageModel(); + Map data = flowTaskUtil.infoData(taskNode.getFormId(), taskNode.getTaskId()); + messageModel.setData(data); + messageModel.setTitle("已【超时】"); + messageModel.setMsgConfig(taskMsgConfig); + messageModel.setRecordEntity(recordEntity); + messageModel.setStatus(taskEntity.getStatus()); + messageModel.setFullName(taskEntity.getFullName()); + messageModel.setUserInfo(userInfo); + messageModel(taskOperatorList, flowTemplateAllModel, messageModel); + setMessageList(messageList, messageModel); + messageListAll.addAll(messageList); + for (FlowTaskOperatorEntity operator : taskOperatorList) { + List delegationMsg = delegationMsg(operator, messageModel, flowTemplateAllModel); + messageListAll.addAll(delegationMsg); + } + } + } + //提醒 + if (flowMsgModel.getNotice()) { + ChildNodeList childNode = JsonUtil.getJsonToBean(nodeJson, ChildNodeList.class); + Properties properties = childNode.getProperties(); + MsgConfig msgConfig = properties.getNoticeMsgConfig(); + if (msgConfig.getOn() == 3) { + msgConfig.setMsgId("PZXTLC008"); + } + Map> operatorMap = operatorList.stream().collect(Collectors.groupingBy(FlowTaskOperatorEntity::getTaskNodeId)); + for (String key : operatorMap.keySet()) { + recordEntity.setTaskNodeId(key); + FlowTaskNodeEntity taskNode = nodeList.stream().filter(t -> t.getId().equals(key)).findFirst().orElse(null); + ChildNodeList taskChildNode = JsonUtil.getJsonToBean(taskNode.getNodePropertyJson(), ChildNodeList.class); + Properties taskProperties = taskChildNode.getProperties(); + MsgConfig taskMsgConfig = taskProperties.getNoticeMsgConfig(); + if (taskMsgConfig.getOn() == 2) { + taskMsgConfig = msgConfig; + } + if (taskMsgConfig.getOn() == 3) { + taskMsgConfig.setMsgId("PZXTLC008"); + } + List messageList = new ArrayList<>(); + List taskOperatorList = operatorMap.get(key); + FlowMessageModel messageModel = new FlowMessageModel(); + Map data = flowTaskUtil.infoData(taskNode.getFormId(), taskNode.getTaskId()); + messageModel.setData(data); + messageModel.setTitle("请尽快【审批】"); + messageModel.setMsgConfig(taskMsgConfig); + messageModel.setRecordEntity(recordEntity); + messageModel.setStatus(taskEntity.getStatus()); + messageModel.setFullName(taskEntity.getFullName()); + messageModel.setUserInfo(userInfo); + messageModel(taskOperatorList, flowTemplateAllModel, messageModel); + setMessageList(messageList, messageModel); + messageListAll.addAll(messageList); + for (FlowTaskOperatorEntity operator : taskOperatorList) { + List delegationMsg = delegationMsg(operator, messageModel, flowTemplateAllModel); + messageListAll.addAll(delegationMsg); + } + } + } + //评论提醒 + if (flowMsgModel.getComment()) { + ChildNodeList childNode = JsonUtil.getJsonToBean(nodeJson, ChildNodeList.class); + Properties properties = childNode.getProperties(); + MsgConfig commentMsgConfig = properties.getCommentMsgConfig(); + if (commentMsgConfig.getOn() == 3) { + commentMsgConfig.setMsgId("MBXTLC017"); + } + //审批人 + if (operatorList != null && !operatorList.isEmpty()) { + Map> operatorMap = operatorList.stream().collect(Collectors.groupingBy(FlowTaskOperatorEntity::getTaskNodeId)); + for (String key : operatorMap.keySet()) { + recordEntity.setTaskNodeId(key); + List messageList = new ArrayList<>(); + List taskOperatorList = operatorMap.get(key); + FlowMessageModel messageModel = new FlowMessageModel(); + FlowTaskNodeEntity taskNode = nodeList.stream().filter(t -> t.getId().equals(recordEntity.getTaskNodeId())).findFirst().orElse(null); + Map data = flowTaskUtil.infoData(taskNode.getFormId(), taskNode.getTaskId()); + messageModel.setData(data); + messageModel.setTitle("有关于您的评论,请及时查看"); + + messageModel.setMsgConfig(commentMsgConfig); + messageModel.setRecordEntity(recordEntity); + messageModel.setStatus(taskEntity.getStatus()); + messageModel.setFullName(messageModel.getTitle()); + messageModel.setUserInfo(userInfo); + messageModel.setType(3); + + messageModel(taskOperatorList, flowTemplateAllModel, messageModel); + setMessageList(messageList, messageModel); + messageListAll.addAll(messageList); + for (FlowTaskOperatorEntity operator : taskOperatorList) { + List delegationMsg = delegationMsg(operator, messageModel, flowTemplateAllModel); + messageListAll.addAll(delegationMsg); + } + } + } + //抄送人 + if (circulateList != null && !circulateList.isEmpty()) { + Map> circulateMap = circulateList.stream().collect(Collectors.groupingBy(FlowTaskCirculateEntity::getTaskNodeId)); + for (String key : circulateMap.keySet()) { + recordEntity.setTaskNodeId(key); + //默认获取当前节点 + FlowTaskNodeEntity taskNode = nodeList.stream().filter(t -> t.getId().equals(key)).findFirst().orElse(null); + List messageList = new ArrayList<>(); + List taskOperatorList = new ArrayList<>(); + for (FlowTaskCirculateEntity circulateEntity : circulateMap.get(key)) { + FlowTaskOperatorEntity operatorEntity = JsonUtil.getJsonToBean(circulateEntity, FlowTaskOperatorEntity.class); + operatorEntity.setHandleId(circulateEntity.getObjectId()); + taskOperatorList.add(operatorEntity); + } + FlowMessageModel messageModel = new FlowMessageModel(); + Map data = flowTaskUtil.infoData(taskNode.getFormId(), taskNode.getTaskId()); + messageModel.setData(data); + messageModel.setTitle("有关于您的评论,请及时查看"); + messageModel.setMsgConfig(commentMsgConfig); + messageModel.setRecordEntity(recordEntity); + messageModel.setStatus(taskEntity.getStatus()); + messageModel.setType(FlowMessageEnum.circulate.getCode()); + messageModel.setFullName(messageModel.getTitle()); + messageModel.setUserInfo(userInfo); + messageModel(taskOperatorList, flowTemplateAllModel, messageModel); + setMessageList(messageList, messageModel); + messageListAll.addAll(messageList); + } + } + //发起人 + if (StringUtil.isNotEmpty(flowMsgModel.getStartHandId())) { + List messageList = new ArrayList<>(); + FlowMessageModel messageModel = new FlowMessageModel(); + Map data = flowTaskUtil.infoData(properties.getFormId(), childNode.getTaskId()); + messageModel.setData(data); + messageModel.setTitle("有关于您的评论,请及时查看"); + messageModel.setRecordEntity(recordEntity); + messageModel.setStatus(taskEntity.getStatus()); + messageModel.setMsgConfig(commentMsgConfig); + messageModel.setType(FlowMessageEnum.me.getCode()); + messageModel.setFullName(messageModel.getTitle()); + messageModel.setUserInfo(userInfo); + List meOperatorList = new ArrayList() {{ + FlowTaskOperatorEntity operatorEntity = new FlowTaskOperatorEntity(); + operatorEntity.setTaskId(taskEntity.getId()); + operatorEntity.setHandleId(flowMsgModel.getStartHandId()); + add(operatorEntity); + }}; + messageModel(meOperatorList, flowTemplateAllModel, messageModel); + setMessageList(messageList, messageModel); + messageListAll.addAll(messageList); + } + + //审批已办记录 + List operatorRecordList = flowMsgModel.getOperatorRecordList(); + if (operatorRecordList != null && !operatorRecordList.isEmpty()) { + Map> operatorRecordMap = operatorRecordList.stream().collect(Collectors.groupingBy(FlowTaskOperatorRecordEntity::getTaskNodeId)); + for (String key : operatorRecordMap.keySet()) { + recordEntity.setTaskNodeId(key); + List messageList = new ArrayList<>(); + List taskOperatorList = operatorRecordMap.get(key); + FlowMessageModel messageModel = new FlowMessageModel(); + FlowTaskNodeEntity taskNode = nodeList.stream().filter(t -> t.getId().equals(recordEntity.getTaskNodeId())).findFirst().orElse(null); + Map data = flowTaskUtil.infoData(taskNode.getFormId(), taskNode.getTaskId()); + messageModel.setData(data); + messageModel.setTitle("有关于您的评论,请及时查看"); + + messageModel.setMsgConfig(commentMsgConfig); + messageModel.setRecordEntity(recordEntity); + messageModel.setStatus(taskEntity.getStatus()); + messageModel.setFullName(messageModel.getTitle()); + messageModel.setUserInfo(userInfo); + messageModel.setType(3); + + messageModelRecord(taskOperatorList, flowTemplateAllModel, messageModel); + setMessageList(messageList, messageModel); + messageListAll.addAll(messageList); + } + } + } + + for (SentMessageForm sentMessageForm : messageListAll) { + FlowTemplateJsonEntity templateJson = flowTemplateAllModel.getTemplateJson(); + sentMessageForm.setFlowName(templateJson.getFullName()); + sentMessageForm.setUserName(user != null ? user.getRealName() : ""); + } + serviceUtil.sendMessage(messageListAll); + } + + /** + * 封装站内信消息 + */ + private void messageModel(List taskOperatorList, FlowTemplateAllModel flowTemplateAllModel, FlowMessageModel messageModel) { + List userList = new ArrayList<>(); + Map contMsg = new HashMap<>(); + for (FlowTaskOperatorEntity taskOperator : taskOperatorList) { + FlowContModel contModel = flowMessage(flowTemplateAllModel, taskOperator, messageModel); + contMsg.put(taskOperator.getHandleId(), JsonUtil.getObjectToString(contModel)); + userList.add(taskOperator.getHandleId()); + } + messageModel.setUserList(userList); + messageModel.setContMsg(contMsg); + } + + /** + * 封装站内信消息 + */ + private void messageModelRecord(List taskOperatorRecordList, FlowTemplateAllModel flowTemplateAllModel, FlowMessageModel messageModel) { + List userList = new ArrayList<>(); + Map contMsg = new HashMap<>(); + for (FlowTaskOperatorRecordEntity taskOperator : taskOperatorRecordList) { + FlowContModel contModel = flowMessageRecord(flowTemplateAllModel, taskOperator, messageModel); + contMsg.put(taskOperator.getHandleId(), JsonUtil.getObjectToString(contModel)); + userList.add(taskOperator.getHandleId()); + } + messageModel.setUserList(userList); + messageModel.setContMsg(contMsg); + } + + /** + * 封装站内信对象 + * + * @param taskOperator + * @return + */ + private FlowContModel flowMessageRecord(FlowTemplateAllModel flowTemplateAllModel, FlowTaskOperatorRecordEntity taskOperator, FlowMessageModel messageModel) { + FlowTemplateJsonEntity templateJson = flowTemplateAllModel.getTemplateJson(); + FlowTemplateEntity template = flowTemplateAllModel.getTemplate(); + FlowContModel contModel = new FlowContModel(); + contModel.setEnCode(template.getEnCode()); + contModel.setFlowId(templateJson.getId()); + contModel.setTaskNodeId(taskOperator.getTaskNodeId()); + contModel.setTaskOperatorId(taskOperator.getTaskOperatorId()); + contModel.setProcessId(taskOperator.getTaskId()); + contModel.setType(messageModel.getType()); + contModel.setStatus(messageModel.getStatus()); + return contModel; + } + + /** + * 封装站内信对象 + * + * @param taskOperator + * @return + */ + private FlowContModel flowMessage(FlowTemplateAllModel flowTemplateAllModel, FlowTaskOperatorEntity taskOperator, FlowMessageModel messageModel) { + FlowTemplateJsonEntity templateJson = flowTemplateAllModel.getTemplateJson(); + FlowTemplateEntity template = flowTemplateAllModel.getTemplate(); + FlowContModel contModel = new FlowContModel(); + contModel.setEnCode(template.getEnCode()); + contModel.setFlowId(templateJson.getId()); + contModel.setTaskNodeId(taskOperator.getTaskNodeId()); + contModel.setTaskOperatorId(taskOperator.getId()); + contModel.setProcessId(taskOperator.getTaskId()); + contModel.setType(messageModel.getType()); + contModel.setStatus(messageModel.getStatus()); + return contModel; + } + + /** + * 整合发送消息 + * + * @param messageList + * @param flowMessageModel + */ + private void setMessageList(List messageList, FlowMessageModel flowMessageModel) { + Map data = new HashMap<>(flowMessageModel.getData()); + MsgConfig msgConfig = flowMessageModel.getMsgConfig() != null ? flowMessageModel.getMsgConfig() : new MsgConfig(); + List userList = flowMessageModel.getUserList(); + FlowTaskOperatorRecordEntity record = flowMessageModel.getRecordEntity(); + String templateId = msgConfig.getOn() == 0 ? "0" : msgConfig.getMsgId(); + Boolean sysMessage = msgConfig.getOn() != 0; + //解析发送配置json,获取消息模板参数 + List templateJson = new ArrayList<>(); + for (SendConfigJson sendConfigJson : msgConfig.getTemplateJson()) { + List templateJson1 = sendConfigJson.getParamJson(); + templateJson.addAll(templateJson1); + List paramJson = ImmutableList.of(FlowConstant.MANDATOR, FlowConstant.MANDATARY, FlowConstant.CREATORUSERNAME, FlowConstant.SENDTIME); + for (String field : paramJson) { + TemplateJsonModel templateJsonModel = new TemplateJsonModel(); + templateJsonModel.setMsgTemplateId(sendConfigJson.getId()); + templateJsonModel.setRelationField(field); + templateJsonModel.setField(field); + templateJsonModel.setSourceType(TemplateEnum.System.getCode()); + templateJson.add(templateJsonModel); + } + } + SentMessageForm messageModel = new SentMessageForm(); + messageModel.setSysMessage(sysMessage); + messageModel.setTemplateId(templateId); + messageModel.setToUserIds(userList); + Map parameterMap = new HashMap<>(); + for (TemplateJsonModel templateJsonModel : templateJson) { + String fieldId = templateJsonModel.getField(); + String msgTemplateId = templateJsonModel.getMsgTemplateId(); + String relationField = templateJsonModel.getRelationField(); + String dataValue = data.get(relationField) != null ? String.valueOf(data.get(relationField)) : ""; + String dataFieldValue = relationField; + String dataJson = Objects.equals(TemplateEnum.Field.getCode(), templateJsonModel.getSourceType()) ? dataValue : dataFieldValue; + FlowEventModel eventModel = FlowEventModel.builder().data(data).dataJson(dataJson).record(record).templateJson(templateJsonModel).build(); + dataJson = data(eventModel); + parameterMap.put(msgTemplateId + fieldId, dataJson); + } + data.putAll(parameterMap); + messageModel.setUserInfo(flowMessageModel.getUserInfo()); + messageModel.setParameterMap(data); + messageModel.setContentMsg(flowMessageModel.getContMsg()); + messageModel.setTitle(flowMessageModel.getFullName()); + if (userList.size() > 0) { + messageList.add(messageModel); + } + } + + /** + * 组装接口数据 + * + * @return + */ + public Map parameterMap(Map data, List templateJsonModelList, FlowTaskOperatorRecordEntity record) { + Map parameterMap = new HashMap<>(); + for (TemplateJsonModel templateJsonModel : templateJsonModelList) { + String fieldId = templateJsonModel.getField(); + String msgTemplateId = templateJsonModel.getMsgTemplateId(); + String relationField = templateJsonModel.getRelationField(); + String dataValue = data.get(relationField) != null ? String.valueOf(data.get(relationField)) : null; + String dataFieldValue = relationField; + String dataJson = Objects.equals(TemplateEnum.Field.getCode(), templateJsonModel.getSourceType()) ? dataValue : dataFieldValue; + FlowEventModel eventModel = FlowEventModel.builder().data(data).dataJson(dataJson).record(record).templateJson(templateJsonModel).build(); + dataJson = data(eventModel); + parameterMap.put(StringUtil.isNotEmpty(msgTemplateId) ? msgTemplateId : "" + fieldId, dataJson); + } + return parameterMap; + } + + /** + * @return + */ + private String data(FlowEventModel eventModel) { + FlowTaskOperatorRecordEntity record = eventModel.getRecord(); + TemplateJsonModel templateJson = eventModel.getTemplateJson(); + String relationField = StringUtil.isNotEmpty(templateJson.getRelationField()) ? templateJson.getRelationField() : ""; + List typeList = ImmutableList.of(TemplateEnum.Field.getCode(), TemplateEnum.System.getCode()); + boolean isType = typeList.contains(templateJson.getSourceType()); + String dataJson = eventModel.getDataJson(); + Map data = eventModel.getData(); + UserInfo userInfo = UserProvider.getUser(); + String userId = StringUtil.isNotEmpty(userInfo.getUserId()) ? userInfo.getUserId() : StringUtil.isNotEmpty(record.getHandleId()) ? record.getHandleId() : ""; + UserEntity userEntity = serviceUtil.getUserInfo(userId); + String userName = userEntity != null ? userEntity.getRealName() : ""; + String value = dataJson; + FlowTaskEntity taskEntity = flowTaskService.getInfoSubmit(record.getTaskId(), FlowTaskEntity::getFlowId, FlowTaskEntity::getFlowName + , FlowTaskEntity::getFullName, FlowTaskEntity::getCreatorUserId, FlowTaskEntity::getDelegateUser); + if (isType) { + switch (relationField) { + case FlowConstant.FLOW_ID: + value = taskEntity.getFlowId(); + break; + case FlowConstant.TASK_ID: + value = record.getTaskId(); + break; + case FlowConstant.TASK_NODE_ID: + value = record.getTaskNodeId(); + break; + case FlowConstant.FLOW_FULL_NAME: + value = taskEntity.getFlowName(); + break; + case FlowConstant.TASK_FULL_NAME: + value = taskEntity.getFullName(); + break; + case FlowConstant.LAUNCH_USER_ID: + value = taskEntity.getCreatorUserId(); + break; + case FlowConstant.LAUNCH_USER_NAME: + case FlowConstant.CREATORUSERNAME: + case FlowConstant.MANDATOR: + UserEntity createUser = taskEntity != null ? serviceUtil.getUserInfo(taskEntity.getCreatorUserId()) : null; + value = createUser != null ? createUser.getRealName() : ""; + break; + case FlowConstant.FLOW_OPERATOR_USER_ID: + value = userId; + break; + case FlowConstant.FLOW_OPERATOR_USER_NAME: + value = userName; + break; + case FlowConstant.SENDTIME: + value = DateUtil.getNow(); + break; + case FlowConstant.MANDATARY: + UserEntity delegate = StringUtil.isNotEmpty(taskEntity.getDelegateUser()) ? serviceUtil.getUserInfo(taskEntity.getDelegateUser()) : null; + value = delegate != null ? delegate.getRealName() : ""; + break; + default: + String[] model = StringUtil.isNotEmpty(relationField) ? relationField.split("-") : new String[]{}; + if (model.length > 1) { + Object dataList = data.get(model[0]); + if (dataList instanceof List) { + List> listAll = (List>) dataList; + List list = new ArrayList<>(); + for (Map objectMap : listAll) { + list.add(objectMap.get(model[1])); + } + value = String.valueOf(list); + } + } + break; + } + } + return value; + } + + + //--------------------------------------------事件处理--------------------------------------------------------- + + /** + * 流程事件 + * + * @param status 事件状态 1.发起 2.结束 3.发起撤回 4同意 5拒绝 6节点撤回 7 超时 8提醒 + * @param childNode 节点数据 + * @param record 审批数据 + */ + public void event(Integer status, ChildNodeList childNode, FlowTaskOperatorRecordEntity record, FlowModel flowModel) { + if (childNode != null) { + boolean on = false; + String interId = ""; + List templateJsonModelList = new ArrayList<>(); + FuncConfig config = null; + List eventList = ImmutableList.of(2, 7, 8); + Map map = ImmutableMap.of(1, "发起事件", 2, "结束事件", + 3, "撤回事件", 4, "同意事件", 5, "退回事件", 6, "撤回事件", + 7, "超时事件", 8, "提醒事件"); + //属性 + Properties properties = childNode.getProperties(); + Integer funcConfigRule = properties.getFuncConfigRule(); + switch (status) { + case 1: + config = properties.getInitFuncConfig(); + break; + case 2: + config = properties.getEndFuncConfig(); + break; + case 3: + config = properties.getFlowRecallFuncConfig(); + break; + case 4: + config = properties.getApproveFuncConfig(); + break; + case 5: + config = properties.getRejectFuncConfig(); + break; + case 6: + config = properties.getRecallFuncConfig(); + break; + case 7: + config = properties.getOvertimeFuncConfig(); + break; + case 8: + config = properties.getNoticeFuncConfig(); + break; + default: + break; + } + if (config != null) { + on = config.getOn(); + interId = config.getInterfaceId(); + templateJsonModelList = config.getTemplateJson(); + } + if (on && StringUtil.isNotEmpty(interId)) { + Map data = flowModel.getFormData(); + Map parameterMap = parameterMap(data, templateJsonModelList, record); + List allEvent = FlowContextHolder.getAllEvent(); + if (allEvent.size() == 0) { + ActionResult result = serviceUtil.infoToId(interId, parameterMap); + boolean error = Objects.equals(400, result.getCode()); + FlowEventLogEntity logEntity = new FlowEventLogEntity(); + logEntity.setTaskNodeId(childNode.getTaskNodeId()); + logEntity.setFullName(map.get(status)); + logEntity.setInterfaceId(interId); + logEntity.setResult(error ? result.getMsg() : ""); + flowEventLogService.create(logEntity); + if (error && !eventList.contains(status) && Objects.equals(FlowNature.FuncTerminate, funcConfigRule)) { + FlowContextHolder.addEvent(interId, parameterMap); + } + } + } + } + } + + + /** + * 封装委托消息 + * + * @param operator + * @param messageModel + * @return + */ + private List delegationMsg(FlowTaskOperatorEntity operator, FlowMessageModel messageModel, FlowTemplateAllModel flowTemplateAllModel) { + List messageList = new ArrayList<>(); + FlowTaskEntity taskEntity = flowTaskService.getInfoSubmit(operator.getTaskId(), FlowTaskEntity::getFlowId); + if (taskEntity != null) { + //todo 获取委托人 + List userList = flowDelegateService.getUser(null, taskEntity.getTemplateId(), operator.getHandleId()).stream().map(FlowDelegateEntity::getToUserId).collect(Collectors.toList()); + List taskOperatorList = new ArrayList<>(); + for (String user : userList) { + FlowTaskOperatorEntity delegaOperator = JsonUtil.getJsonToBean(operator, FlowTaskOperatorEntity.class); + delegaOperator.setHandleId(user); + taskOperatorList.add(delegaOperator); + } + messageModel(taskOperatorList, flowTemplateAllModel, messageModel); + setMessageList(messageList, messageModel); + } + return messageList; + } + + + //--------------------------------------委托消息------------------------------------------------------ + public void delegateMsg(FlowDelegateModel flowDelegate) { + List toUserIds = flowDelegate.getToUserIds(); + UserInfo userInfo = flowDelegate.getUserInfo(); + FlowTaskEntity flowTask = flowDelegate.getFlowTask(); + FlowTemplateAllModel templateAllModel = flowDelegate.getTemplateAllModel(); + Map contentMsg = new HashMap<>(); + Boolean delegate = flowDelegate.getDelegate(); + boolean approve = flowDelegate.getApprove(); + if (approve) { + SentMessageForm flowMsgModel = new SentMessageForm(); + flowMsgModel.setToUserIds(toUserIds); + flowMsgModel.setUserInfo(flowDelegate.getUserInfo()); +// String flowName = flowTask.getFlowName(); + String flowName = templateAllModel.getTemplateJson().getFullName(); + Map parameterMap = new HashMap<>(); + parameterMap.put(FlowConstant.MANDATOR, userInfo.getUserName()); + UserEntity mandatary = StringUtil.isNotEmpty(flowTask.getDelegateUser()) ? serviceUtil.getUserInfo(flowTask.getDelegateUser()) : null; + parameterMap.put(FlowConstant.MANDATARY, mandatary != null ? mandatary.getRealName() : ""); + parameterMap.put(FlowConstant.TITLE, flowTask != null ? flowTask.getFullName() : ""); + flowMsgModel.setParameterMap(parameterMap); + //1.委托设置 2.委托给我 + Integer type = flowDelegate.getType(); + if (delegate) { + String title = FlowNature.StartMsg.equals(type) ? "了发起委托" : FlowNature.ApproveMsg.equals(type) ? "了审批委托" : "的委托已结束"; + String templateId = FlowNature.StartMsg.equals(type) ? "PZXTLG012" : FlowNature.ApproveMsg.equals(type) ? "PZXTLG013" : "PZXTLG014"; + String content = userInfo.getUserName() + "向您发起" + title; + flowMsgModel.setTitle(content); + flowMsgModel.setTemplateId(templateId); + } else { + String title = FlowNature.StartMsg.equals(type) ? "已发起了您的" : "已审批了您的"; + String templateId = FlowNature.StartMsg.equals(type) ? "PZXTLG015" : "PZXTLG016"; + String content = userInfo.getUserName() + title + flowName; + flowMsgModel.setTitle(content); + flowMsgModel.setTemplateId(templateId); + } + Integer delegateType = delegate ? FlowNature.EndMsg : FlowNature.ApproveMsg; + contentMsg.put("type", delegateType + ""); + flowMsgModel.setContentMsg(contentMsg); + flowMsgModel.setFlowType(2); + flowMsgModel.setType(2); + List messageListAll = new ArrayList<>(); + if (toUserIds.size() > 0) { + messageListAll.add(flowMsgModel); + } + serviceUtil.sendDelegateMsg(messageListAll); + } + } + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/util/FlowTaskUtil.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/util/FlowTaskUtil.java new file mode 100644 index 0000000..5d1ecf5 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/util/FlowTaskUtil.java @@ -0,0 +1,2882 @@ +package com.yunzhupaas.engine.util; + +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONObject; +import com.google.common.collect.ImmutableList; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.engine.entity.*; +import com.yunzhupaas.engine.enums.*; +import com.yunzhupaas.engine.model.flowbefore.FlowTemplateAllModel; +import com.yunzhupaas.engine.model.flowbefore.FlowUserListModel; +import com.yunzhupaas.engine.model.flowengine.*; +import com.yunzhupaas.engine.model.flowengine.shuntjson.childnode.Properties; +import com.yunzhupaas.engine.model.flowengine.shuntjson.childnode.*; +import com.yunzhupaas.engine.model.flowengine.shuntjson.nodejson.ChildNodeList; +import com.yunzhupaas.engine.model.flowengine.shuntjson.nodejson.ConditionList; +import com.yunzhupaas.engine.model.flowengine.shuntjson.nodejson.Custom; +import com.yunzhupaas.engine.model.flowengine.shuntjson.nodejson.DateProperties; +import com.yunzhupaas.engine.model.flowmessage.FlowMsgModel; +import com.yunzhupaas.engine.model.flowmessage.FlowParameterModel; +import com.yunzhupaas.engine.model.flowtask.*; +import com.yunzhupaas.engine.model.flowtask.method.TaskHandleIdStatus; +import com.yunzhupaas.engine.model.flowtask.method.TaskOperatoUser; +import com.yunzhupaas.engine.model.flowtask.method.TaskOperator; +import com.yunzhupaas.engine.model.flowtasknode.TaskNodeListModel; +import com.yunzhupaas.engine.service.*; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.permission.entity.OrganizeEntity; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.entity.UserRelationEntity; +import com.yunzhupaas.util.*; +import com.yunzhupaas.util.context.RequestContext; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/6/15 13:54 + */ +@Component +@Slf4j +public class FlowTaskUtil { + + @Autowired + public FlowUserService flowUserService; + @Autowired + public FlowCandidatesService flowCandidatesService; + @Autowired + public FlowTaskNodeService flowTaskNodeService; + @Autowired + public FlowAuthorizeService flowAuthorizeService; + @Autowired + public FlowTaskOperatorService flowTaskOperatorService; + @Autowired + public FlowTaskOperatorRecordService flowTaskOperatorRecordService; + @Autowired + public FlowTemplateJsonService flowTemplateJsonService; + @Autowired + public FlowTemplateService flowTemplateService; + @Autowired + public FlowMsgUtil flowMsgUtil; + @Autowired + public FlowTaskService flowTaskService; + @Autowired + public FlowTaskNewService flowTaskNewService; + @Autowired + public ServiceAllUtil serviceUtil; + @Autowired + private FlowOperatorUserService flowOperatorUserService; + @Autowired + private FlowTaskCirculateService flowTaskCirculateService; + + //--------------------------------------候选人------------------------------------------------------------------ + + /** + * 查询候选人 + * + * @param taskNodeList 所有节点 + * @param childNodeListAll 节点数据 + * @param nodeCode 当前节点 + */ + public void candidate(List taskNodeList, List childNodeListAll, String nodeCode, boolean isNext) { + List nodeList = taskNodeList.stream().filter(t -> t.getNodeCode().equals(nodeCode)).collect(Collectors.toList()); + for (FlowTaskNodeEntity taskNodeEntity : nodeList) { + if (isNext) { + List nextNodeList = Arrays.asList(taskNodeEntity.getNodeNext().split(",")); + List nextTaskNodeList = taskNodeList.stream().filter(t -> nextNodeList.contains(t.getNodeCode())).collect(Collectors.toList()); + for (FlowTaskNodeEntity nodeEntity : nextTaskNodeList) { + String nodeType = nodeEntity.getNodeType(); + String code = nodeEntity.getNodeCode(); + ChildNodeList taskNode = JsonUtil.getJsonToBean(taskNodeEntity.getNodePropertyJson(), ChildNodeList.class); + ChildNodeList childNodeList = JsonUtil.getJsonToBean(nodeEntity.getNodePropertyJson(), ChildNodeList.class); + childNodeList.getCustom().setBranchFlow(taskNode.getCustom().getBranchFlow()); + childNodeList.getCustom().setFlow(taskNode.getCustom().getFlow()); + childNodeList.getCustom().setSwerve(taskNode.getCustom().getSwerve()); + childNodeListAll.add(childNodeList); + if (FlowNature.NodeSubFlow.equals(nodeType)) { + candidate(taskNodeList, childNodeListAll, code, isNext); + } + } + } else { + ChildNodeList childNodeList = JsonUtil.getJsonToBean(taskNodeEntity.getNodePropertyJson(), ChildNodeList.class); + childNodeListAll.add(childNodeList); + } + } + } + + //-----------------------------------提交保存-------------------------------------------- + + /** + * 获取节点候选人 + * + * @return + * @throws WorkFlowException + */ + public List childNodeListAll(FlowTaskOperatorEntity operatorEntity, FlowModel flowModel) throws WorkFlowException { + List childNodeListAll = new ArrayList<>(); + List taskNodeList = new ArrayList<>(); + List conditionListAll = new ArrayList<>(); + String startNode = ""; + UserInfo userInfo = flowModel.getUserInfo(); + boolean isNodeCode = StringUtil.isNotEmpty(flowModel.getNodeCode()); + boolean operator = operatorEntity != null; + String flowId = flowModel.getFlowId(); + Map formData = flowModel.getFormData(); + if (ObjectUtil.isNotNull(flowId)) { + FlowTemplateAllModel templateAllModel = templateJson(flowId); + FlowTemplateJsonEntity templateJson = templateAllModel.getTemplateJson(); + ChildNode childNodeAll = JsonUtil.getJsonToBean(templateJson.getFlowTemplateJson(), ChildNode.class); + //获取流程节点 + List nodeListAll = new ArrayList<>(); + //递归获取条件数据和节点数据 + FlowTaskEntity flowTask = operator ? flowTaskService.getInfo(operatorEntity.getTaskId(), + FlowTaskEntity::getId, FlowTaskEntity::getCreatorUserId, FlowTaskEntity::getCreatorTime) : new FlowTaskEntity(); + flowTask.setId(operator ? flowTask.getId() : RandomUtil.uuId()); + flowTask.setCreatorUserId(operator ? flowTask.getCreatorUserId() : userInfo.getUserId()); + flowTask.setCreatorTime(operator ? flowTask.getCreatorTime() : new Date()); + flowTask.setFlowFormContentJson(JsonUtil.getObjectToString(formData)); + FlowUpdateNode updateNode = FlowUpdateNode.builder().childNodeAll(childNodeAll).nodeListAll(nodeListAll).taskNodeList(taskNodeList).conditionListAll(conditionListAll).flowTask(flowTask).userInfo(userInfo).isSubmit(!operator).build(); + updateNodeList(updateNode); + Optional first = taskNodeList.stream().filter(t -> FlowNature.NodeStart.equals(t.getNodeType())).findFirst(); + if (!first.isPresent()) { + throw new WorkFlowException(MsgCode.COD001.get()); + } + FlowTaskNodeEntity startNodes = first.get(); + startNode = startNodes.getNodeCode(); + nodeList(taskNodeList, startNode, 1L); + } + String nodeCode = isNodeCode ? flowModel.getNodeCode() : operator ? operatorEntity.getNodeCode() : startNode; + //判断条件下选择分支 + FlowTaskNodeEntity taskNode = taskNodeList.stream().filter(t -> t.getNodeCode().equals(nodeCode)).findFirst().orElse(null); + if (taskNode != null) { + for (ConditionList condition : conditionListAll) { + if (taskNode.getNodeNext().equals(condition.getFlowId())) { + ChildNodeList childNodeList = JsonUtil.getJsonToBean(taskNode.getNodePropertyJson(), ChildNodeList.class); + childNodeList.getCustom().setBranchFlow(condition.getBranchFlow()); + taskNode.setNodePropertyJson(JsonUtil.getObjectToString(childNodeList)); + } + } + } + candidate(taskNodeList, childNodeListAll, nodeCode, !isNodeCode); + return childNodeListAll; + } + + /** + * 流程任务赋值 + * + * @param taskEntity 流程任务实例 + * @param flowModel 提交数据 + * @throws WorkFlowException 异常 + */ + public void task(FlowTaskEntity taskEntity, FlowTemplateAllModel templateAllModel, FlowModel flowModel) throws WorkFlowException { + if (StringUtil.isNotEmpty(taskEntity.getId()) && !checkStatus(taskEntity.getStatus())) { + throw new WorkFlowException(MsgCode.WF058.get()); + } + FlowTemplateJsonEntity templateJson = templateAllModel.getTemplateJson(); + FlowTemplateEntity template = templateAllModel.getTemplate(); + //创建实例 + taskEntity.setId(flowModel.getProcessId()); + taskEntity.setProcessId(flowModel.getProcessId()); + taskEntity.setEnCode(flowModel.getBillNo()); + taskEntity.setFullName(flowModel.getFlowTitle()); + taskEntity.setFlowUrgent(flowModel.getFlowUrgent() != null ? flowModel.getFlowUrgent() : 1); + taskEntity.setFlowCode(template.getEnCode()); + taskEntity.setFlowName(template.getFullName()); + taskEntity.setFlowType(template.getType()); + taskEntity.setFlowCategory(template.getCategory()); + taskEntity.setFlowVersion(templateJson.getVersion()); + taskEntity.setFlowId(templateJson.getId()); + taskEntity.setSystemId(flowModel.getSystemId()); + taskEntity.setTemplateId(template.getId()); + List statusList = ImmutableList.of(FlowStatusEnum.save.getMessage(), FlowStatusEnum.submit.getMessage()); + if (statusList.contains(flowModel.getStatus())) { + taskEntity.setStatus(FlowStatusEnum.save.getMessage().equals(flowModel.getStatus()) ? FlowTaskStatusEnum.Draft.getCode() : FlowTaskStatusEnum.Handle.getCode()); + } + taskEntity.setCompletion(FlowNature.ProcessCompletion); + taskEntity.setCreatorTime(new Date()); + taskEntity.setCreatorUserId(flowModel.getUserId()); + taskEntity.setFlowFormContentJson(flowModel.getFormData() != null ? JsonUtil.getObjectToString(flowModel.getFormData()) : "{}"); + taskEntity.setParentId(flowModel.getParentId() != null ? flowModel.getParentId() : FlowNature.ParentId); + taskEntity.setIsAsync(flowModel.getIsAsync() ? FlowNature.ChildAsync : FlowNature.ChildSync); + taskEntity.setDelegateUser(flowModel.getDelegateUser()); + ChildNode childNode = JsonUtil.getJsonToBean(templateJson.getFlowTemplateJson(), ChildNode.class); + boolean isBatchApproval = childNode.getProperties().getIsBatchApproval(); + taskEntity.setIsBatch(isBatchApproval ? 1 : 0); + } + + /** + * 验证有效状态 + * + * @param status 状态编码 + * @return + */ + public boolean checkStatus(int status) { + List statusList = ImmutableList.of(FlowTaskStatusEnum.Draft.getCode(), FlowTaskStatusEnum.Reject.getCode(), + FlowTaskStatusEnum.Revoke.getCode(), FlowTaskStatusEnum.Resubmit.getCode()); + if (statusList.contains(status)) { + return true; + } else { + return false; + } + } + + /** + * 提交节点 + * + * @param nodeListModel 条件对象 + */ + public void nodeListAll(FlowNodeListModel nodeListModel) throws WorkFlowException { + List dataAll = nodeListModel.getDataAll(); + FlowModel flowModel = nodeListModel.getFlowModel(); + boolean isAdd = nodeListModel.getIsAdd(); + List authorizeList = new ArrayList<>(); + FlowTaskNodeEntity taskNode = nodeListModel.getTaskNode(); + long num = nodeListModel.getNum(); + nodeList(dataAll, taskNode.getNodeCode(), num); + String nodeNext = FlowNature.NodeEnd; + String type = FlowNature.EndRound; + long maxNum = 99L; + for (int i = 0; i < dataAll.size(); i++) { + FlowTaskNodeEntity entity = dataAll.get(i); + if (FlowConstant.TIMER.equals(entity.getNodeType())) { + dataAll.remove(i); + } + } + for (int i = 0; i < dataAll.size(); i++) { + FlowTaskNodeEntity entity = dataAll.get(i); + if (StringUtil.isEmpty(entity.getNodeNext())) { + entity.setNodeNext(nodeNext); + } + //选择分支 + List branchList = flowModel.getBranchList(); + List flowIdList = new ArrayList() {{ + add(entity.getNodeCode()); + }}; + flowIdList.retainAll(branchList); + entity.setCandidates(flowIdList.size() > 0 ? JsonUtil.getObjectToString(branchList) : ""); + ChildNodeList childNodeList = JsonUtil.getJsonToBean(entity.getNodePropertyJson(), ChildNodeList.class); + Properties properties = childNodeList.getProperties(); + //保存流程权限 + List> formOperates = properties.getFormOperates(); + FlowAuthorizeEntity authorizeEntity = new FlowAuthorizeEntity(); + authorizeEntity.setFormOperate(JsonUtil.getObjectToString(formOperates)); + authorizeEntity.setNodeCode(entity.getNodeCode()); + authorizeEntity.setTaskId(entity.getTaskId()); + authorizeList.add(authorizeEntity); + properties.setFormOperates(new ArrayList<>()); + //查询子流程发起的表单 + if (FlowNature.NodeSubFlow.equals(entity.getNodeType())) { + FlowTemplateAllModel templateAllModel = templateJson(properties.getFlowId()); + ChildNode subFlow = JsonUtil.getJsonToBean(templateAllModel.getTemplateJson().getFlowTemplateJson(), ChildNode.class); + properties.setFormId(subFlow.getProperties().getFormId()); + entity.setFormId(subFlow.getProperties().getFormId()); + } + entity.setNodePropertyJson(JsonUtil.getObjectToString(childNodeList)); + } + if (isAdd) { + //判断是否选择分支,候选人 + FlowTaskNodeEntity startNode = dataAll.stream().filter(t -> FlowNature.NodeStart.equals(t.getNodeType())).findFirst().get(); + ChildNodeList startChildNodeList = JsonUtil.getJsonToBean(startNode.getNodePropertyJson(), ChildNodeList.class); + boolean branchFlow = startChildNodeList.getCustom().getBranchFlow(); + List nextNodeList = dataAll.stream().filter(t -> Arrays.asList(startNode.getNodeNext().split(",")).contains(t.getNodeCode())).collect(Collectors.toList()); + List branchList = flowModel.getBranchList(); + boolean isParentId = FlowNature.ParentId.equals(flowModel.getParentId()); + String msg = MsgCode.WF059.get(); + if (branchFlow) { + if (ObjectUtil.isEmpty(branchList)) { + throw new WorkFlowException(msg); + } + nextNodeList = nextNodeList.stream().filter(t -> branchList.contains(t.getNodeCode())).collect(Collectors.toList()); + } + Map> candidateList = flowModel.getCandidateList(); + for (FlowTaskNodeEntity taskNodeEntity : nextNodeList) { + ChildNodeList childNodeList = JsonUtil.getJsonToBean(taskNodeEntity.getNodePropertyJson(), ChildNodeList.class); + boolean isCandidate = FlowTaskOperatorEnum.Candidate.getCode().equals(childNodeList.getProperties().getAssigneeType()); + if (isCandidate && ObjectUtil.isEmpty(candidateList.get(taskNodeEntity.getNodeCode()))) { + throw new WorkFlowException(msg); + } + } + FlowTaskNodeEntity endround = new FlowTaskNodeEntity(); + endround.setId(RandomUtil.uuId()); + endround.setNodeCode(nodeNext); + endround.setNodeName("结束"); + endround.setCompletion(FlowNature.ProcessCompletion); + endround.setCreatorTime(new Date()); + endround.setSortCode(maxNum); + endround.setTaskId(taskNode.getTaskId()); + ChildNodeList endNode = JsonUtil.getJsonToBean(taskNode.getNodePropertyJson(), ChildNodeList.class); + endNode.getCustom().setNodeId(nodeNext); + endNode.setTaskNodeId(endround.getId()); + endNode.getCustom().setType(type); + endround.setNodePropertyJson(JsonUtil.getObjectToString(endNode)); + endround.setNodeType(type); + endround.setState(FlowNodeEnum.Process.getCode()); + endround.setNodeNext(""); + endround.setCandidates(""); + dataAll.add(endround); + for (FlowTaskNodeEntity entity : dataAll) { + flowTaskNodeService.create(entity); + } + List list = flowAuthorizeService.getList(flowModel.getProcessId(), null, FlowAuthorizeEntity::getId); + if (list.size() == 0) { + flowAuthorizeService.create(authorizeList); + } + FlowTaskOperatorEntity operator = new FlowTaskOperatorEntity(); + operator.setId(FlowNature.ParentId); + candidateList(flowModel, dataAll, operator); + } + } + + /** + * 递归遍历编码 + * + * @param dataAll 所有节点 + * @param node 当前节点 + * @param num 排序 + */ + public void nodeList(List dataAll, String node, long num) { + List nodeAll = Arrays.asList(node.split(",")); + List nodeList = dataAll.stream().filter(t -> nodeAll.contains(t.getNodeCode())).collect(Collectors.toList()); + int swerveNum = 0; + for (FlowTaskNodeEntity entity : nodeList) { + ChildNodeList childNodeList = JsonUtil.getJsonToBean(entity.getNodePropertyJson(), ChildNodeList.class); + swerveNum += childNodeList.getCustom().getSwerve() ? 1 : 0; + entity.setSortCode(num); + entity.setState(FlowNodeEnum.Process.getCode()); + } + List nextNode = nodeList.stream().filter(t -> StringUtil.isNotEmpty(t.getNodeNext())).map(FlowTaskNodeEntity::getNodeNext).collect(Collectors.toList()); + if (nextNode.size() > 0 && swerveNum == 0) { + String nodes = String.join(",", nextNode); + num++; + nodeList(dataAll, nodes, num); + } + } + + /** + * 流程用户信息 + * + * @param flowTask + */ + public void flowUser(FlowTaskEntity flowTask) { + UserEntity user = serviceUtil.getUserInfo(flowTask.getCreatorUserId()); + FlowUserEntity flowUser = new FlowUserEntity(); + flowUser.setTaskId(flowTask.getId()); + if (user != null) { + flowUser.setManagerId(user.getManagerId()); + flowUser.setOrganizeId(user.getOrganizeId()); + flowUser.setPositionId(user.getPositionId()); + String listByManagerId = serviceUtil.getListByManagerId(user.getId()).stream().map(UserEntity::getId).collect(Collectors.joining(",")); + flowUser.setSubordinate(listByManagerId); + flowUser.setSuperior(user.getManagerId()); + } + flowUserService.create(flowUser); + } + + //-------------------------审批-------------------------------- + //---------通过------------- + + /** + * 修改选择分支的流程状态 + * + * @param nodeCodeList + * @param taskNodeList + * @param operatorList + */ + public void branchTaskNode(List nodeCodeList, List taskNodeList, List operatorList) { + if (operatorList.size() > 0) { + Set operatorNode = operatorList.stream().map(FlowTaskOperatorEntity::getNodeCode).collect(Collectors.toSet()); + if (operatorNode.size() != nodeCodeList.size()) { + //差集 + List reduce = nodeCodeList.stream().filter(item -> !operatorNode.contains(item)).collect(Collectors.toList()); + List reduceList = taskNodeList.stream().filter(t -> reduce.contains(t.getNodeCode())).map(FlowTaskNodeEntity::getId).collect(Collectors.toList()); + Set reduceListAll = new HashSet<>(); + upAll(reduceListAll, reduceList, taskNodeList); + flowTaskNodeService.updateCompletion(new ArrayList<>(reduceListAll), FlowNature.AuditCompletion); + //交集 + List intersec = nodeCodeList.stream().filter(item -> operatorNode.contains(item)).collect(Collectors.toList()); + List intersecList = taskNodeList.stream().filter(t -> intersec.contains(t.getNodeCode())).map(FlowTaskNodeEntity::getId).collect(Collectors.toList()); + Set intersectionList = new HashSet<>(); + upAll(intersectionList, intersecList, taskNodeList); + flowTaskNodeService.updateCompletion(new ArrayList<>(intersectionList), FlowNature.ProcessCompletion); + } + } + } + + /** + * 创建节点 + * + * @param flowTask + * @param nodeListAll + * @param conditionListAll + * @param taskNodeList + */ + public void createNodeList(FlowTaskEntity flowTask, List nodeListAll, List conditionListAll, List taskNodeList, UserInfo userInfo, boolean isSubmit) { + List timerList = new ArrayList<>(); + List emptyList = new ArrayList<>(); + UserEntity userEntity = serviceUtil.getUserInfo(flowTask.getCreatorUserId()); + if (!isSubmit) { + flowTask.setLastModifyUserId(userInfo.getUserId()); + flowTask.setLastModifyTime(new Date()); + } + for (ChildNodeList childNode : nodeListAll) { + FlowTaskNodeEntity taskNode = new FlowTaskNodeEntity(); + String nodeId = childNode.getCustom().getNodeId(); + Properties properties = childNode.getProperties(); + String dataJson = flowTask.getFlowFormContentJson(); + String type = childNode.getCustom().getType(); + taskNode.setId(RandomUtil.uuId()); + childNode.setTaskNodeId(taskNode.getId()); + childNode.setTaskId(flowTask.getId()); + taskNode.setCreatorTime(new Date()); + taskNode.setTaskId(flowTask.getId()); + taskNode.setNodeCode(nodeId); + taskNode.setNodeType(type); + taskNode.setState(FlowNodeEnum.Futility.getCode()); + taskNode.setSortCode(-2L); + taskNode.setNodeUp(properties.getRejectStep()); + taskNode.setFormId(properties.getFormId()); + FlowConditionModel conditionModel = new FlowConditionModel(dataJson, nodeId, userInfo, userEntity, flowTask, nodeListAll, conditionListAll); + taskNode.setNodeNext(FlowJsonUtil.getNextNode(conditionModel)); + //判断是否转向 + boolean isSwerver = conditionListAll.stream().filter(t -> String.valueOf(taskNode.getNodeNext()).equals(t.getSwerveNode()) && t.getPrevId().equals(nodeId)).count() > 0; + childNode.getCustom().setSwerve(isSwerver); + //赋值分支属性 + ConditionList conditionList = conditionListAll.stream().filter(t -> taskNode.getNodeNext().equals(t.getFlowId())).findFirst().orElse(null); + if (conditionList != null) { + childNode.getCustom().setFlow(conditionList.getFlow()); + childNode.getCustom().setBranchFlow(conditionList.getBranchFlow()); + childNode.getCustom().setFlowId(conditionList.getFlowId()); + } + taskNode.setNodePropertyJson(JsonUtil.getObjectToString(childNode)); + boolean isStart = FlowNature.NodeStart.equals(childNode.getCustom().getType()); + taskNode.setCompletion(isStart ? FlowNature.AuditCompletion : FlowNature.ProcessCompletion); + taskNode.setNodeName(properties.getTitle()); + taskNodeList.add(taskNode); + if (FlowConstant.EMPTY.equals(type)) { + emptyList.add(taskNode); + } + if (FlowConstant.TIMER.equals(type)) { + timerList.add(taskNode); + } + } + //指向empty,继续指向下一个节点 + for (FlowTaskNodeEntity empty : emptyList) { + List noxtEmptyList = taskNodeList.stream().filter(t -> t.getNodeNext().contains(empty.getNodeCode())).collect(Collectors.toList()); + for (FlowTaskNodeEntity entity : noxtEmptyList) { + entity.setNodeNext(empty.getNodeNext()); + } + } + //指向timer,继续指向下一个节点 + for (FlowTaskNodeEntity timer : timerList) { + //获取到timer的上一节点 + ChildNodeList timerlList = JsonUtil.getJsonToBean(timer.getNodePropertyJson(), ChildNodeList.class); + DateProperties timers = timerlList.getTimer(); + timers.setNodeId(timer.getNodeCode()); + timers.setTime(true); + List upEmptyList = taskNodeList.stream().filter(t -> t.getNodeNext().contains(timer.getNodeCode())).collect(Collectors.toList()); + for (FlowTaskNodeEntity entity : upEmptyList) { + //上一节点赋值timer的属性 + ChildNodeList modelList = JsonUtil.getJsonToBean(entity.getNodePropertyJson(), ChildNodeList.class); + modelList.setTimer(timers); + entity.setNodeNext(timer.getNodeNext()); + entity.setNodePropertyJson(JsonUtil.getObjectToString(modelList)); + } + } + } + + /** + * 判断是否进行下一步 + * + * @param flowNextModel + * @return + */ + public List isNextAll(FlowNextModel flowNextModel) { + //1.先看是否加签人,有都不要进行,无进行下一步 + //2.判断会签是否比例通过 + //3.判断分流是否都结束 + //4.判断审批人是否都通过 + List nodeListAll = flowNextModel.getNodeListAll(); + List nextNodeEntity = flowNextModel.getNextNodeEntity(); + FlowTaskNodeEntity taskNode = flowNextModel.getTaskNode(); + FlowModel flowModel = flowNextModel.getFlowModel(); + List result = new ArrayList<>(); + boolean hasFreeApprover = StringUtil.isNotEmpty(flowModel.getFreeApproverUserId()); + if (hasFreeApprover) { + result.add(taskNode); + //加签记录 + } else { + //会签通过 + List operatorList = flowTaskOperatorService.getList(taskNode.getTaskId()).stream().filter(t -> t.getTaskNodeId().equals(taskNode.getId()) && FlowNodeEnum.Process.getCode().equals(t.getState())).collect(Collectors.toList()); + FlowCountersignModel countersign = new FlowCountersignModel(); + countersign.setTaskNode(taskNode); + countersign.setOperatorList(operatorList); + //判断是否是会签 + boolean isCountersign = isCountersign(countersign); + flowNextModel.setIsCountersign(isCountersign); + ChildNodeList nodeModel = JsonUtil.getJsonToBean(taskNode.getNodePropertyJson(), ChildNodeList.class); + Properties properties = nodeModel.getProperties(); + Integer type = properties.getAssigneeType(); + //流程通过 + if (isCountersign) { + flowTaskOperatorService.update(nodeModel.getTaskNodeId(), type); + taskNode.setCompletion(FlowNature.AuditCompletion); + if (Objects.equals(FlowNature.ResurgenceThis, nodeModel.getProperties().getResurgenceDataRule())) { + taskNode.setDraftData(JsonUtil.getObjectToString(flowModel.getFormData())); + } + FlowTaskNodeEntity updateNode = new FlowTaskNodeEntity(); + updateNode.setId(taskNode.getId()); + updateNode.setCompletion(FlowNature.AuditCompletion); + updateNode.setDraftData(taskNode.getDraftData()); + //跟新审批状态 + flowTaskNodeService.update(updateNode); + //分流通过 + boolean isShunt = isShunt(nodeListAll, nextNodeEntity, taskNode); + if (isShunt) { + result.addAll(nextNodeEntity); + } + } + } + return result; + } + + /** + * 判断会签比例 + * + * @param operatorList + * @return + */ + public boolean fixedJointly(List operatorList, ChildNodeList nodeModel, FlowCountersignModel countersign) { + Properties properties = nodeModel.getProperties(); + CounterSign counterSignConfig = properties.getCounterSignConfig(); + boolean isCountersign = true; + boolean fixed = !FlowNature.FixedApprover.equals(properties.getCounterSign()); + //todo 通过 + if (fixed) { + boolean fixedJointly = FlowNature.FixedJointlyApprover.equals(properties.getCounterSign()); + List passNumList = passNum(operatorList, FlowNature.AuditCompletion); + long pass = fixedJointly ? counterSignConfig.getAuditRatio() : FlowNature.Progress; + int totalNum = counterSignConfig.getAuditNum(); + Integer auditType = fixedJointly ? counterSignConfig.getAuditType() : FlowNature.RejectPercent; + //百分比 + if (FlowNature.RejectPercent.equals(auditType)) { + double total = operatorList.size(); + countersign.setPassNumList(passNumList); + double passNum = passNumList.size(); + isCountersign = isCountersign(pass, total, passNum); + } + //人数 + if (FlowNature.RejectNumber.equals(auditType)) { + isCountersign = passNumList.size() >= totalNum; + } + } + return isCountersign; + } + + /** + * 判断分流是否结束 + * + * @param nodeListAll 所有节点 + * @param nextNodeEntity 下一节点 + * @param taskNode 单前节点 + * @return + */ + public boolean isShunt(List nodeListAll, List nextNodeEntity, FlowTaskNodeEntity taskNode) { + boolean isNext = true; + for (FlowTaskNodeEntity nodeEntity : nextNodeEntity) { + String nextNode = nodeEntity.getNodeCode(); + List interflowAll = nodeListAll.stream().filter(t -> String.valueOf(t.getNodeNext()).contains(nextNode) && FlowNodeEnum.Process.getCode().equals(t.getState())).collect(Collectors.toList()); + List taskNodeList = new ArrayList<>(); + for (FlowTaskNodeEntity entity : interflowAll) { + ChildNodeList childNodeList = JsonUtil.getJsonToBean(entity.getNodePropertyJson(), ChildNodeList.class); + boolean swerve = childNodeList.getCustom().getSwerve(); + if (!swerve) { + taskNodeList.add(entity); + } + } + List flowAll = taskNodeList.stream().filter(t -> !FlowNature.AuditCompletion.equals(t.getCompletion())).collect(Collectors.toList()); + if (flowAll.size() > 0) { + isNext = false; + break; + } + } + return isNext; + } + + /** + * 修改节点走向 + */ + public void auditTaskNode(FlowTemplateAllModel templateAllModel, FlowTaskEntity flowTask, FlowTaskNodeEntity flowTaskNode, FlowModel flowModel) throws WorkFlowException { + //判断节点下面是否有条件 + UserInfo userInfo = flowModel.getUserInfo(); + TaskNodeListModel taskNodeListModel = TaskNodeListModel.builder().completion(FlowNodeEnum.Process.getCode()).notNodeCode(FlowNature.NodeEnd).id(flowTask.getId()).build(); + List flowTaskNodeListAll = flowTaskNodeService.getList(taskNodeListModel, + FlowTaskNodeEntity::getId, FlowTaskNodeEntity::getNodeCode, FlowTaskNodeEntity::getNodeNext, + FlowTaskNodeEntity::getCandidates, FlowTaskNodeEntity::getNodeCode, FlowTaskNodeEntity::getNodeNext, + FlowTaskNodeEntity::getSortCode, FlowTaskNodeEntity::getNodePropertyJson, FlowTaskNodeEntity::getCompletion + ); + //更新数据 + flowModel.setProcessId(flowTask.getId()); + flowModel.setId(flowTask.getId()); + //更新新流程 + String flowTemplateJson = templateAllModel.getTemplateJson().getFlowTemplateJson(); + ChildNode childNodeAll = JsonUtil.getJsonToBean(flowTemplateJson, ChildNode.class); + List nodeListAll = new ArrayList<>(); + List conditionListAll = new ArrayList<>(); + List taskNodeLisAll = new ArrayList<>(); + //审批哪个节点获取哪个节点表单数据,当作当前节点的表单数据 + String formId = flowTaskNode.getFormId(); + String taskId = flowTaskNode.getTaskId(); + Map formData = infoData(formId, taskId); + flowTask.setFlowFormContentJson(JsonUtil.getObjectToString(formData)); + FlowUpdateNode updateNode = FlowUpdateNode.builder().childNodeAll(childNodeAll).nodeListAll(nodeListAll).taskNodeList(taskNodeLisAll).conditionListAll(conditionListAll).flowTask(flowTask).userInfo(userInfo).build(); + updateNodeList(updateNode); + if (flowTaskNode != null) { + FlowNodeListModel nodeListModel = new FlowNodeListModel(taskNodeLisAll, flowModel, false, flowTaskNode, flowTaskNode.getSortCode()); + nodeListAll(nodeListModel); + } + //修改节点的id + taskNodeLisAll.stream().forEach(k -> { + FlowTaskNodeEntity taskNodeEntity = flowTaskNodeListAll.stream().filter(t -> t.getNodeCode().equals(k.getNodeCode())).findFirst().orElse(null); + if (taskNodeEntity != null) { + k.setId(taskNodeEntity.getId()); + } + }); + //递归新节点 + Set rejectNodeList = new HashSet<>(); + List rejectList = new ArrayList() {{ + add(flowTaskNode.getId()); + }}; + upAll(rejectNodeList, rejectList, taskNodeLisAll); + //递归旧节点 + upAll(rejectNodeList, rejectList, flowTaskNodeListAll); + //更新没有走过的节点状态 + List flowTaskNodeList = flowTaskNodeListAll.stream().filter(t -> rejectNodeList.contains(t.getId())).collect(Collectors.toList()); + for (FlowTaskNodeEntity taskNode : flowTaskNodeList) { + FlowTaskNodeEntity nodeEntity = taskNodeLisAll.stream().filter(t -> t.getNodeCode().equals(taskNode.getNodeCode())).findFirst().orElse(null); + if (nodeEntity != null) { + taskNode.setNodeNext(nodeEntity.getNodeNext()); + taskNode.setState(nodeEntity.getState()); + taskNode.setSortCode(nodeEntity.getSortCode()); + } + //判断条件下是否选择分支 + ChildNodeList nodeModel = JsonUtil.getJsonToBean(taskNode.getNodePropertyJson(), ChildNodeList.class); + ConditionList conditionList = conditionListAll.stream().filter(t -> taskNode.getNodeNext().equals(t.getFlowId())).findFirst().orElse(null); + if (conditionList != null) { + nodeModel.getCustom().setFlow(conditionList.getFlow()); + nodeModel.getCustom().setBranchFlow(conditionList.getBranchFlow()); + nodeModel.getCustom().setFlowId(conditionList.getFlowId()); + } + //todo 判断条件是否转向 + ConditionList swerveList = conditionListAll.stream().filter(t -> String.valueOf(taskNode.getNodeNext()).equals(t.getSwerveNode()) && t.getPrevId().equals(taskNode.getNodeCode())).findFirst().orElse(new ConditionList()); + nodeModel.getCustom().setSwerve(swerveList.getSwerve()); + taskNode.setNodePropertyJson(JsonUtil.getObjectToString(nodeModel)); + } + flowTaskNodeService.updateTaskNode(flowTaskNodeList); + //赋值选择分支 + List branchList = flowModel.getBranchList(); + if (branchList.size() > 0) { + List nextCodeList = Arrays.asList(flowTaskNode.getNodeNext().split(",")); + List branchNode = flowTaskNodeListAll.stream().filter(t -> nextCodeList.contains(t.getNodeCode())).collect(Collectors.toList()); + for (FlowTaskNodeEntity entity : branchNode) { + String candidates = branchList.contains(entity.getNodeCode()) ? JsonUtil.getObjectToString(branchList) : ""; + flowTaskNodeService.updateTaskNodeCandidates(ImmutableList.of(entity.getId()), candidates); + } + } + } + + //---------------拒绝------------------- + + /** + * 驳回获取节点下所有节点 + * + * @param rejectNodeList + * @param rejectList + * @param taskNodeList + */ + public void upAll(Set rejectNodeList, List rejectList, List taskNodeList, boolean isSwerve) { + List nodeList = taskNodeList.stream().filter(t -> rejectList.contains(t.getId())).collect(Collectors.toList()); + for (FlowTaskNodeEntity taskNode : nodeList) { + ChildNodeList childNodeList = JsonUtil.getJsonToBean(taskNode.getNodePropertyJson(), ChildNodeList.class); + Boolean swerve = childNodeList.getCustom().getSwerve(); + List list = StringUtil.isNotEmpty(taskNode.getNodeNext()) ? Arrays.asList(taskNode.getNodeNext().split(",")) : new ArrayList<>(); + List taskList = taskNodeList.stream().filter(t -> list.contains(t.getNodeCode())).collect(Collectors.toList()); + List rejectListAll = taskList.stream().map(FlowTaskNodeEntity::getId).collect(Collectors.toList()); + if (isSwerve) { + rejectNodeList.add(taskNode.getId()); + if (!swerve) { + upAll(rejectNodeList, rejectListAll, taskNodeList, isSwerve); + } + } else { + if (!rejectNodeList.contains(taskNode.getId())) { + rejectNodeList.add(taskNode.getId()); + upAll(rejectNodeList, rejectListAll, taskNodeList, isSwerve); + } + } + } + } + + /** + * 驳回获取节点下所有节点 + * + * @param rejectNodeList + * @param rejectList + * @param taskNodeList + */ + public void upAll(Set rejectNodeList, List rejectList, List taskNodeList) { + upAll(rejectNodeList, rejectList, taskNodeList, true); + } + + /** + * 驳回可以驳回的节点数据 + * + * @param taskNodeList + * @param nodeIdList + * @param rejectNodeList + */ + public void upNodeList(List taskNodeList, List nodeIdList, Set rejectNodeList, String stopNodeCode) { + List nodeList = taskNodeList.stream().filter(t -> nodeIdList.contains(t.getId())).collect(Collectors.toList()); + for (FlowTaskNodeEntity taskNode : nodeList) { + List taskList = taskNodeList.stream().filter(t -> StringUtil.isNotEmpty(t.getNodeNext()) && t.getNodeNext().contains(taskNode.getNodeCode())).collect(Collectors.toList()); + boolean next = StringUtil.isNotEmpty(stopNodeCode) ? taskList.stream().filter(t -> t.getNodeCode().equals(stopNodeCode)).count() == 0 : true; + if (next) { + List taskNodeId = rejectNodeList.stream().map(FlowTaskNodeEntity::getId).collect(Collectors.toList()); + List rejectListAll = new ArrayList<>(); + for (FlowTaskNodeEntity entity : taskList) { + String id = entity.getId(); + if (!taskNodeId.contains(id)) { + rejectNodeList.add(entity); + rejectListAll.add(id); + } + } + upNodeList(taskNodeList, rejectListAll, rejectNodeList, stopNodeCode); + } + } + } + + /** + * 审批驳回节点 + * + * @param nodeListAll 所有节点 + * @param taskNode 审批节点 + * @param isReject 是否驳回 + * @param thisStepAll 当前节点 + * @param thisStepId 任务当前节点 + * @return + */ + public List isUpAll(List nodeListAll, FlowTaskNodeEntity taskNode, boolean isReject, Set thisStepAll, String[] thisStepId) throws WorkFlowException { + List result = new ArrayList<>(); + List resultList = new ArrayList<>(); + List thisStepIdAll = new ArrayList<>(Arrays.asList(thisStepId)); + if (isReject) { + List nodeUpList = Arrays.asList(taskNode.getNodeUp().split(",")); + List nodeList = nodeListAll.stream().filter(t -> nodeUpList.contains(t.getNodeCode())).collect(Collectors.toList()); + result.addAll(nodeList); + Set rejectNodeList = new HashSet<>(); + List reject = nodeList.stream().map(FlowTaskNodeEntity::getId).collect(Collectors.toList()); + upAll(rejectNodeList, reject, nodeListAll, false); + List delNode = nodeListAll.stream().filter(t -> rejectNodeList.contains(t.getId())).map(FlowTaskNodeEntity::getNodeCode).collect(Collectors.toList()); + thisStepIdAll.removeAll(delNode); + thisStepIdAll.addAll(nodeUpList); + boolean isChild = result.stream().anyMatch(t -> FlowNature.NodeSubFlow.equals(t.getNodeType())); + if (isChild) { + throw new WorkFlowException(MsgCode.WF060.get()); + } + resultList.addAll(result); + boolean start = result.stream().filter(t -> FlowNature.NodeStart.equals(t.getNodeType())).count() > 0; + if (!start) { + List taskOperatorList = flowTaskOperatorService.getList(taskNode.getTaskId()).stream().filter(t -> FlowNodeEnum.Process.getCode().equals(t.getState())).collect(Collectors.toList()); + List taskNodeList = taskOperatorList.stream().map(FlowTaskOperatorEntity::getTaskNodeId).collect(Collectors.toList()); + List delNodeList = nodeListAll.stream().filter(t -> !taskNodeList.contains(t.getId())).collect(Collectors.toList()); + result.removeAll(delNodeList); + } + if (result.size() == 0) { + result.addAll(resultList); + } + } + thisStepAll.addAll(nodeListAll.stream().filter(t -> thisStepIdAll.contains(t.getNodeCode())).collect(Collectors.toList())); + return result; + } + + //-----------------------子节点--------------------------------- + + /** + * 获取会签是否通过 + * + * @param countersign + * @return + */ + public boolean isRejectCountersign(FlowCountersignModel countersign) { + FlowTaskNodeEntity taskNode = countersign.getTaskNode(); + ChildNodeList nodeModel = JsonUtil.getJsonToBean(taskNode.getNodePropertyJson(), ChildNodeList.class); + List operatorList = countersign.getOperatorList(); + List state = ImmutableList.of(FlowNodeEnum.Process.getCode(), FlowNodeEnum.FreeApprover.getCode()); + List operatorListAll = flowTaskOperatorService.getList(taskNode.getTaskId()).stream().filter(t -> t.getTaskNodeId().equals(taskNode.getId()) && state.contains(t.getState())).collect(Collectors.toList()); + List operatorIdList = new ArrayList<>(); + operatorListAll.stream().forEach(t -> { + if (FlowNature.ParentId.equals(t.getParentId())) { + operatorIdList.add(t.getId()); + } + }); + improperApprover(nodeModel, operatorList, operatorIdList); + boolean isCountersign = rejectFixedJointly(operatorList, nodeModel, countersign); + return isCountersign; + } + + /** + * 判断会签比例 + * + * @param operatorList + * @return + */ + public boolean rejectFixedJointly(List operatorList, ChildNodeList nodeModel, FlowCountersignModel countersign) { + Properties properties = nodeModel.getProperties(); + CounterSign counterSignConfig = properties.getCounterSignConfig(); + boolean isCountersign = true; + boolean fixed = !FlowNature.FixedApprover.equals(properties.getCounterSign()); + //todo 不通过 + if (fixed) { + long pass = 0; + boolean fixedJointly = FlowNature.FixedJointlyApprover.equals(properties.getCounterSign()); + List passNumList = passNum(operatorList, FlowNature.RejectCompletion); + int totalNum = counterSignConfig.getRejectNum(); + Integer auditType = FlowNature.RejectPercent; + if (fixedJointly) { + //无的获取通过,取反 + if (FlowNature.RejectNo.equals(counterSignConfig.getRejectType())) { + auditType = counterSignConfig.getAuditType(); + pass = 100 - counterSignConfig.getAuditRatio(); + totalNum = operatorList.size() - counterSignConfig.getAuditNum(); + } else { + pass = counterSignConfig.getRejectRatio(); + auditType = counterSignConfig.getRejectType(); + } + } + //百分比 + if (FlowNature.RejectPercent.equals(auditType)) { + double total = operatorList.size(); + countersign.setPassNumList(passNumList); + double passNum = passNumList.size(); + isCountersign = isCountersign(pass, total, passNum); + } + //人数 + if (FlowNature.RejectNumber.equals(auditType)) { + isCountersign = passNumList.size() >= totalNum; + } + } + return isCountersign; + } + + /** + * 判断子流程是否全部走完,进行主流程任务 + * + * @param flowTask 子流程任务 + * @throws WorkFlowException + */ + public boolean isNext(FlowTaskEntity flowTask, FlowModel flowModel) throws WorkFlowException { + //子流程结束,触发主流程 + if (!FlowNature.ParentId.equals(flowTask.getParentId())) { + FlowTaskEntity parentFlowTask = flowTaskService.getInfo(flowTask.getParentId(), + FlowTaskEntity::getStatus, FlowTaskEntity::getTemplateId, FlowTaskEntity::getFlowId, + FlowTaskEntity::getId, FlowTaskEntity::getFullName, FlowTaskEntity::getCreatorUserId, + FlowTaskEntity::getParentId, FlowTaskEntity::getRejectId + ); + FlowTaskOperatorEntity parentOperator = new FlowTaskOperatorEntity(); + boolean isAudit = updateTaskNode(parentFlowTask, flowTask.getId(), parentOperator, flowModel); + FlowModel parentModel = new FlowModel(); + parentModel.setIsAsync(true); + Map data = new HashMap<>(16); + parentModel.setFormData(data); + parentModel.setUserInfo(flowModel.getUserInfo()); + parentModel.setVoluntarily(true); + if (isAudit) { + if (StringUtil.isNotEmpty(parentFlowTask.getRejectId())) { + throw new WorkFlowException(MsgCode.WF032.get()); + } + flowTaskNewService.audit(parentFlowTask, parentOperator, parentModel); + } + } + return true; + } + + /** + * 子节点审批人 + * + * @param taskChild + * @return + */ + public List childSaveList(TaskOperator taskChild) throws WorkFlowException { + ChildNodeList childNode = taskChild.getChildNode(); + FlowTaskEntity taskEntity = taskChild.getTaskEntity(); + boolean verify = taskChild.getVerify(); + //赋值子流程 + String createUserId = taskEntity.getCreatorUserId(); + Properties properties = childNode.getProperties(); + Integer errorRule = properties.getErrorRule(); + Date date = new Date(); + TaskOperatoUser taskOperatoUser = new TaskOperatoUser(); + taskOperatoUser.setDate(date); + taskOperatoUser.setChildNode(childNode); + List userIdAll = user(taskChild, properties.getInitiateType()); + List userList = serviceUtil.getUserName(userIdAll, true); + //异常处理规则 + List errList = new ArrayList<>(); + switch (FlowErrorRuleEnum.getByCode(errorRule)) { + case administrator: + case notSubmit: + case pass: + errList.add(serviceUtil.getAdmin()); + break; + case initiator: + List errorRuleUser = serviceUtil.getUserName(properties.getErrorRuleUser(), true); + if (errorRuleUser.size() > 0) { + errList.addAll(errorRuleUser.stream().map(UserEntity::getId).collect(Collectors.toList())); + } else { + errList.add(serviceUtil.getAdmin()); + } + break; + case creatorUserId: + errList.add(createUserId); + break; + default: + break; + } + if (userList.size() == 0 && verify) { + userList.addAll(serviceUtil.getUserName(errList, true)); + } + if (userList.size() == 0 && !verify) { + List childUserIdAll = new ArrayList<>(); + childUserIdAll.addAll(childNode.getCustom().getTaskId()); + childUserIdAll.addAll(childNode.getCustom().getAsyncTaskList()); + List childList = flowTaskService.getOrderStaList(childUserIdAll).stream().map(FlowTaskEntity::getCreatorUserId).collect(Collectors.toList()); + userList.addAll(serviceUtil.getUserName(childList)); + } + return userList; + } + + /** + * 子流程完成了修改父节点的状态 + */ + public boolean updateTaskNode(FlowTaskEntity parentFlowTask, String taskId, FlowTaskOperatorEntity parentOperator, FlowModel flowModel) { + TaskNodeListModel nodeListMode = TaskNodeListModel.builder().id(parentFlowTask.getId()).state(FlowNodeEnum.Process.getCode()).build(); + List taskNodeList = flowTaskNodeService.getList(nodeListMode, + FlowTaskNodeEntity::getId, FlowTaskNodeEntity::getState, FlowTaskNodeEntity::getNodeCode, + FlowTaskNodeEntity::getNodePropertyJson, FlowTaskNodeEntity::getNodeType, + FlowTaskNodeEntity::getNodeNext, FlowTaskNodeEntity::getCompletion + ); + List result = new ArrayList<>(); + flowModel.setFreeApproverUserId(null); + for (FlowTaskNodeEntity nodeEntity : taskNodeList) { + ChildNodeList parentNode = JsonUtil.getJsonToBean(nodeEntity.getNodePropertyJson(), ChildNodeList.class); + List taskIdAll = parentNode.getCustom().getTaskId(); + boolean isNum = taskIdAll.contains(taskId); + boolean isEnd = flowTaskService.getOrderStaList(taskIdAll, FlowTaskEntity::getStatus).stream().filter(t -> !FlowTaskStatusEnum.Adopt.getCode().equals(t.getStatus())).count() == 0; + if (isNum && isEnd) { + parentOperator(parentOperator, nodeEntity); + List nextNode = new ArrayList<>(); + nextNode.addAll(taskNodeList.stream().filter(t -> nodeEntity.getNodeNext().contains(t.getNodeCode())).collect(Collectors.toList())); + FlowNextModel flowNextModel = FlowNextModel.builder().nodeListAll(taskNodeList).nextNodeEntity(nextNode).taskNode(nodeEntity).flowModel(flowModel).isCountersign(false).build(); + result.addAll(isNextAll(flowNextModel)); + } + } + return result.size() > 0; + } + + //----------------------撤回-------------------------- + + /** + * 赋值审批数据 + * + * @param parentOperator + * @param nodeEntity + */ + public void parentOperator(FlowTaskOperatorEntity parentOperator, FlowTaskNodeEntity nodeEntity) { + parentOperator.setTaskNodeId(nodeEntity.getId()); + parentOperator.setNodeCode(nodeEntity.getNodeCode()); + parentOperator.setNodeName(nodeEntity.getNodeName()); + parentOperator.setTaskId(nodeEntity.getTaskId()); + parentOperator.setCompletion(FlowNature.ProcessCompletion); + parentOperator.setSortCode(1L); + } + + + //----------------------变更、复活-------------------------- + + /** + * 修改下一节点 + * + * @param nodeListAll + * @param nodeEntity + * @param revive + */ + public void change(List nodeListAll, FlowTaskNodeEntity nodeEntity, boolean revive, int completion, List idList) { + if (nodeEntity != null) { + List next = Arrays.asList(String.valueOf(nodeEntity.getNodeNext()).split(",")); + for (String id : next) { + FlowTaskNodeEntity nextNode = nodeListAll.stream().filter(t -> t.getNodeCode().equals(id)).findFirst().orElse(null); + if (nextNode != null) { + ChildNodeList nodeModel = JsonUtil.getJsonToBean(nextNode.getNodePropertyJson(), ChildNodeList.class); + nextNode.setCompletion(completion); + flowTaskNodeService.update(nextNode); + if (FlowNature.NodeSubFlow.equals(nextNode.getNodeType())) { + if (!revive) { + //同步 + List idAll = nodeModel.getCustom().getTaskId(); + flowTaskService.deleteChildAll(idAll); + } + } + if(!idList.contains(id)) { + idList.add(id); + change(nodeListAll, nextNode, revive, completion, idList); + } + } + } + } + } + + //---------------------公共方法-------------------------- + + /** + * 递归获取加签人 + * + * @param id + * @param operatorList + */ + public void getOperator(String id, Set operatorList) { + if (StringUtil.isNotEmpty(id)) { + List operatorListAll = flowTaskOperatorService.getParentId(id); + for (FlowTaskOperatorEntity operatorEntity : operatorListAll) { + operatorEntity.setState(FlowNodeEnum.Futility.getCode()); + operatorList.add(operatorEntity); + getOperator(operatorEntity.getId(), operatorList); + } + } + } + + /** + * 更新当前节点 + * + * @param nextOperatorList 下一审批节点 + * @param flowTask 流程任务 + */ + public boolean getNextStepId(List nextOperatorList, FlowTaskEntity flowTask, FlowModel flowModel, List flowTaskNodeList) throws WorkFlowException { + boolean isEnd = false; + Set delNodeList = new HashSet<>(); + List progressList = new ArrayList<>(); + List nextOperator = new ArrayList<>(); + ChildNodeList end = nextOperatorList.stream().filter(t -> t.getCustom().getNodeId().contains(FlowNature.NodeEnd)).findFirst().orElse(null); + for (ChildNodeList childNode : nextOperatorList) { + Properties properties = childNode.getProperties(); + String id = childNode.getCustom().getNodeId(); + Integer progress = properties.getProgress(); + List taskNodeList = flowTaskNodeList.stream().filter(t -> StringUtil.isNotEmpty(t.getNodeNext()) && t.getNodeNext().contains(id)).collect(Collectors.toList()); + List nodeList = taskNodeList.stream().map(FlowTaskNodeEntity::getNodeCode).collect(Collectors.toList()); + delNodeList.addAll(nodeList); + boolean isAddNext = flowTaskNodeList.stream().filter(t -> t.getId().equals(childNode.getTaskNodeId()) && FlowNature.ProcessCompletion.equals(t.getCompletion())).count() > 0; + if (isAddNext) { + nextOperator.add(id); + } + if (ObjectUtil.isNotEmpty(progress)) { + progressList.add(progress); + } + } + if (progressList.size() == 0) { + progressList.add(flowTask.getCompletion()); + } + String[] thisNode = flowTask.getThisStepId() != null ? flowTask.getThisStepId().split(",") : new String[]{}; + Set thisStepId = new HashSet<>(); + for (String id : thisNode) { + boolean isStepId = flowTaskNodeList.stream().filter(t -> t.getNodeCode().equals(id) && FlowNature.ProcessCompletion.equals(t.getCompletion())).count() > 0; + if (isStepId) { + thisStepId.add(id); + } + } + thisStepId.removeAll(delNodeList); + thisStepId.addAll(nextOperator); + Set thisNodeName = new HashSet<>(); + for (String id : thisStepId) { + List nodeList = flowTaskNodeList.stream().filter(t -> t.getNodeCode().equals(id)).map(FlowTaskNodeEntity::getNodeName).collect(Collectors.toList()); + thisNodeName.addAll(nodeList); + } + flowTask.setThisStepId(String.join(",", thisStepId)); + flowTask.setThisStep(String.join(",", thisNodeName)); + Collections.sort(progressList); + flowTask.setCompletion(progressList.get(0)); + if (end != null) { + isEnd = endround(flowTask, end, flowModel); + } + return isEnd; + } + + /** + * 审核记录 + * + * @param record 审批实例 + * @param operatordModel 对象数据 + */ + public void operatorRecord(FlowTaskOperatorRecordEntity record, FlowOperatordModel operatordModel) { + int status = operatordModel.getStatus(); + FlowModel flowModel = operatordModel.getFlowModel(); + String userId = operatordModel.getUserId(); + FlowTaskOperatorEntity operator = operatordModel.getOperator(); + String operatorId = operatordModel.getOperatorId(); + record.setHandleOpinion(flowModel.getHandleOpinion()); + record.setHandleId(userId); + record.setHandleTime(new Date()); + record.setHandleStatus(status); + record.setOperatorId(operatorId); + record.setNodeCode(operator.getNodeCode()); + record.setNodeName(operator.getNodeName() != null ? operator.getNodeName() : "开始"); + record.setTaskOperatorId(operator.getId()); + record.setTaskNodeId(operator.getTaskNodeId()); + record.setTaskId(operator.getTaskId()); + record.setSignImg(flowModel.getSignImg()); + record.setFileList(JsonUtil.getObjectToString(flowModel.getFileList())); + record.setApproverType(flowModel.getFreeApproverType()); + boolean freeApprover = !FlowNature.ParentId.equals(operator.getParentId()); + record.setStatus(freeApprover ? FlowNodeEnum.FreeApprover.getCode() : FlowNodeEnum.Process.getCode()); + } + + /** + * 定时器 + * + * @param taskOperator 流程经办 + * @param taskNodeList 所有流程节点 + * @param operatorList 下一流程经办 + * @return + */ + public void timer(FlowTaskOperatorEntity taskOperator, List taskNodeList, List operatorList) { + if (operatorList.size() > 0) { + FlowTaskNodeEntity taskNode = taskNodeList.stream().filter(t -> t.getId().equals(taskOperator.getTaskNodeId())).findFirst().orElse(null); + if (taskNode != null) { + ChildNodeList childNodeList = JsonUtil.getJsonToBean(taskNode.getNodePropertyJson(), ChildNodeList.class); + DateProperties timer = childNodeList.getTimer(); + if (timer.getTime()) { + //当前节点的定时器 + Date date = new Date(); + date = DateUtil.dateAddDays(date, timer.getDay()); + date = DateUtil.dateAddHours(date, timer.getHour()); + date = DateUtil.dateAddMinutes(date, timer.getMinute()); + date = DateUtil.dateAddSeconds(date, timer.getSecond()); + //获取同一个指向 + List timerTaskList = taskNodeList.stream().filter(t -> t.getNodeNext().equals(taskNode.getNodeNext()) && !t.getNodeCode().equals(taskNode.getNodeCode())).collect(Collectors.toList()); + if (timerTaskList.size() > 0) { + List taskOperatorList = flowTaskOperatorService.getList(taskOperator.getTaskId()); + for (FlowTaskNodeEntity node : timerTaskList) { + ChildNodeList childNode = JsonUtil.getJsonToBean(node.getNodePropertyJson(), ChildNodeList.class); + DateProperties operatorTimer = childNode.getTimer(); + if (operatorTimer.getTime()) { + FlowTaskOperatorEntity operator = taskOperatorList.stream().filter(t -> t.getTaskNodeId().equals(node.getId()) && ObjectUtil.isNotEmpty(t.getHandleTime())).max(Comparator.comparing(FlowTaskOperatorEntity::getHandleTime)).orElse(null); + if (operator != null) { + Date handleTime = operator.getHandleTime(); + handleTime = DateUtil.dateAddDays(handleTime, operatorTimer.getDay()); + handleTime = DateUtil.dateAddHours(handleTime, operatorTimer.getHour()); + handleTime = DateUtil.dateAddMinutes(handleTime, operatorTimer.getMinute()); + handleTime = DateUtil.dateAddSeconds(handleTime, operatorTimer.getSecond()); + if (handleTime.getTime() > date.getTime()) { + date = handleTime; + } + } + } + } + } + for (FlowTaskOperatorEntity entity : operatorList) { + entity.setCreatorTime(date); + } + } + } + } + } + + /** + * 更新节点数据 + */ + public void updateNodeList(FlowUpdateNode flowUpdateNode) { + FlowTaskEntity flowTask = flowUpdateNode.getFlowTask(); + ChildNode childNodeAll = flowUpdateNode.getChildNodeAll(); + String formId = childNodeAll.getProperties().getFormId(); + Integer funcConfigRule = childNodeAll.getProperties().getFuncConfigRule(); + Integer errorRule = childNodeAll.getProperties().getErrorRule(); + Integer resurgenceDataRule = childNodeAll.getProperties().getResurgenceDataRule(); + List errorRuleUser = childNodeAll.getProperties().getErrorRuleUser(); + List nodeListAll = flowUpdateNode.getNodeListAll(); + List conditionListAll = flowUpdateNode.getConditionListAll(); + List taskNodeList = flowUpdateNode.getTaskNodeList(); + UserInfo userInfo = flowUpdateNode.getUserInfo(); + FlowJsonUtil.getTemplateAll(childNodeAll, nodeListAll, conditionListAll); + boolean submit = flowUpdateNode.isSubmit(); + for (ChildNodeList childNodeList : nodeListAll) { + Custom custom = childNodeList.getCustom(); + Properties properties = childNodeList.getProperties(); + String childFormId = properties.getFormId(); + if (!FlowNature.NodeSubFlow.equals(custom.getType())) { + childNodeList.getProperties().setFormId(StringUtil.isNotEmpty(childFormId) ? childFormId : formId); + childNodeList.getProperties().setErrorRule(errorRule); + childNodeList.getProperties().setResurgenceDataRule(resurgenceDataRule); + childNodeList.getProperties().setFuncConfigRule(funcConfigRule); + childNodeList.getProperties().setErrorRuleUser(errorRuleUser); + } + } + createNodeList(flowTask, nodeListAll, conditionListAll, taskNodeList, userInfo, submit); + } + + /** + * 下一审批人 + * + * @throws WorkFlowException 异常 + */ + public void nextOperator(FlowOperator flowOperator) throws WorkFlowException { + List operatorListAll = flowOperator.getOperatorListAll(); + List nodeList = flowOperator.getNodeList(); + FlowTaskEntity flowTask = flowOperator.getFlowTask(); + FlowModel flowModel = flowOperator.getFlowModel(); + Map> asyncTaskList = flowOperator.getAsyncTaskList(); + Map> nodeTaskIdList = flowOperator.getNodeTaskIdList(); + UserInfo userInfo = flowOperator.getUserInfo(); + List taskNodeListAll = flowOperator.getTaskNodeListAll(); + List errorList = new ArrayList<>(); + //查询审批人 + for (ChildNodeList childNode : nodeList) { + //封装查询对象 + TaskOperator taskOperator = new TaskOperator(); + taskOperator.setChildNode(childNode); + taskOperator.setTaskNodeList(taskNodeListAll); + taskOperator.setTaskEntity(flowTask); + taskOperator.setFlowModel(flowModel); + boolean extraRule = FlowTaskOperatorEnum.Nominator.getCode().equals(childNode.getProperties().getAssigneeType()); + taskOperator.setExtraRule(extraRule); + taskOperator.setErrorRule(true); + taskOperator.setReject(flowOperator.isReject()); + //判断节点属性 + List operatorList = new ArrayList<>(); + Custom custom = childNode.getCustom(); + Properties properties = childNode.getProperties(); + String type = custom.getType(); + String flowId = properties.getFlowId(); + Boolean autoSubmit = properties.getAutoSubmit(); + //判断子流程 + boolean isChild = FlowNature.NodeSubFlow.equals(type); + if (isChild) { + //组装子表数据 + FlowDataModel flowDataModel = new FlowDataModel(childNode, taskNodeListAll, flowModel, false, true); + Map childDataMap = createOrUpdate(flowDataModel); + childDataMap.put(FlowFormConstant.FLOWID, flowId); + //todo 获取子表表单id + FlowTaskNodeEntity childTaskNode = taskNodeListAll.stream().filter(t -> t.getId().equals(childNode.getTaskNodeId())).findFirst().orElse(null); + String formId = childTaskNode.getFormId(); + flowModel.setFormData(childDataMap); + taskOperator.setFlowModel(flowModel); + List childNodeListAll = new ArrayList<>(); + candidate(taskNodeListAll, childNodeListAll, custom.getNodeId(), true); + int num = 0; + List branchList = flowModel.getBranchList(); + for (ChildNodeList childNodeList : childNodeListAll) { + String nodeId = childNodeList.getCustom().getNodeId(); + boolean nextNode = branchList.size() > 0 ? branchList.contains(nodeId) : true; + if (!FlowNature.NodeEnd.equals(nodeId) && nextNode) { + taskOperator.setChildNode(childNodeList); + List userIdAll = userListAll(taskOperator); + List userList = serviceUtil.getUserName(userIdAll, true); + if (userList.size() == 0) { + num += taskOperator.getNotSubmit() > 0 ? 1 : 0; + if (taskOperator.getNode() > 0) { + FlowErrorModel errorModel = new FlowErrorModel(); + errorModel.setNodeId(nodeId); + errorModel.setNodeName(childNodeList.getProperties().getTitle()); + errorList.add(errorModel); + } + } + } + } + if (num > 0) { + throw new WorkFlowException(MsgCode.WF061.get()); + } + //判断当前流程引擎类型 + FlowTemplateAllModel parentTemplateAllModel = templateJson(flowTask.getFlowId()); + List taskNodeList = new ArrayList<>(); + List asyncTaskNodeList = new ArrayList<>(); + + //获取子流程引擎 + FlowTemplateAllModel childTemplateAllModel = templateJson(flowId); + String fullName = childTemplateAllModel.getTemplateJson().getFullName(); + + //子节点审批人 + TaskOperator taskChild = new TaskOperator(); + taskChild.setChildNode(childNode); + taskChild.setTaskEntity(flowTask); + taskChild.setFlowModel(flowModel); + taskChild.setTaskNodeList(taskNodeListAll); + List list = childSaveList(taskChild); + errorList.addAll(taskChild.getErrorList()); + if (errorList.size() == 0) { + //子流程消息 + List childTaskNodeAll = flowTaskNodeService.getList(flowTask.getId(), + FlowTaskNodeEntity::getId, FlowTaskNodeEntity::getTaskId, + FlowTaskNodeEntity::getNodePropertyJson, FlowTaskNodeEntity::getNodeType + ); + List childOperatorList = new ArrayList<>(); + FlowMsgModel flowMsgModel = new FlowMsgModel(); + flowMsgModel.setNodeList(childTaskNodeAll); + flowMsgModel.setData(flowModel.getFormData()); + flowMsgModel.setWait(false); + flowMsgModel.setLaunch(true); + boolean isAsync = properties.getIsAsync(); + FlowTaskNodeEntity taskNodeEntity = flowTaskNodeService.getInfo(childNode.getTaskNodeId(), + FlowTaskNodeEntity::getId, FlowTaskNodeEntity::getTaskId, + FlowTaskNodeEntity::getNodeCode, FlowTaskNodeEntity::getNodeName + ); + for (UserEntity entity : list) { + String title = entity.getRealName() + "的" + fullName + "(子流程)"; + boolean isApp = !RequestContext.isOrignPc(); + String id = RandomUtil.uuId(); + FlowModel nextFlowModel = new FlowModel(); + nextFlowModel.setFlowTitle(title); + nextFlowModel.setParentId(flowTask.getId()); + nextFlowModel.setUserId(entity.getId()); + nextFlowModel.setIsAsync(properties.getIsAsync()); + nextFlowModel.setFormData(flowModel.getFormData()); + nextFlowModel.setFlowId(flowId); + userInfo.setUserName(entity.getRealName()); + nextFlowModel.setUserInfo(userInfo); + nextFlowModel.setProcessId(id); + nextFlowModel.setSystemId(isApp ? entity.getAppSystemId() : entity.getSystemId()); + if (autoSubmit) { + flowTaskNewService.submit(nextFlowModel); + } else { + flowTaskNewService.save(nextFlowModel); + } + childNode.setTaskId(id); + //新增子表表单数据 + FlowContextHolder.addChildData(id, formId, childDataMap); + FlowContextHolder.addFormOperates(id, formId, properties.getFormOperates()); + FlowTaskOperatorEntity parentOperator = new FlowTaskOperatorEntity(); + parentOperator(parentOperator, taskNodeEntity); + if (!isAsync) { + //同步 + taskNodeList.add(nextFlowModel.getProcessId()); + } else { + asyncTaskNodeList.add(nextFlowModel.getProcessId()); + } + parentOperator.setHandleId(entity.getId()); + parentOperator.setTaskId(nextFlowModel.getProcessId()); + childOperatorList.add(parentOperator); + //发送子流程消息 + List launchList = new ArrayList<>(); + FlowTaskEntity taskEntity = new FlowTaskEntity(); + taskEntity.setFullName(title); + taskEntity.setCreatorUserId(entity.getId()); + launchList.add(parentOperator); + flowMsgModel.setOperatorList(launchList); + flowMsgModel.setFlowTemplateAllModel(parentTemplateAllModel); + flowMsgModel.setTaskEntity(taskEntity); + flowMsgModel.setFlowModel(flowModel); + flowMsgUtil.message(flowMsgModel); + } + //子流程数据整合 + if (isAsync) { + FlowModel parentModel = new FlowModel(); + parentModel.setUserId(""); + parentModel.setFormData(flowModel.getFormData()); + parentModel.setIsAsync(properties.getIsAsync()); + parentModel.setUserInfo(userInfo); + parentModel.setVoluntarily(true); + FlowTaskOperatorEntity parentOperator = new FlowTaskOperatorEntity(); + parentOperator(parentOperator, taskNodeEntity); + flowTaskNewService.audit(flowTask, parentOperator, parentModel); + } + asyncTaskList.put(childNode.getTaskNodeId(), asyncTaskNodeList); + nodeTaskIdList.put(childNode.getTaskNodeId(), taskNodeList); + } + } else { + if (!FlowNature.NodeEnd.equals(childNode.getCustom().getNodeId())) { + List taskIdList = nodeList.stream().map(ChildNodeList::getTaskNodeId).collect(Collectors.toList()); + List flowTaskNodeList = taskNodeListAll.stream().filter(t -> taskIdList.contains(t.getId())).collect(Collectors.toList()); + List branchListAll = new ArrayList<>(); + List taskBranchList = new ArrayList<>(); + flowTaskNodeList.stream().forEach(t -> { + List branchList = StringUtil.isNotEmpty(t.getCandidates()) ? JsonUtil.getJsonToList(t.getCandidates(), String.class) : new ArrayList<>(); + branchListAll.addAll(branchList); + if (t.getId().equals(childNode.getTaskNodeId())) { + taskBranchList.addAll(branchList); + } + }); + boolean isAdd = (branchListAll.size() > 0 && taskBranchList.size() == 0) ? false : true; + if (isAdd) { + operator(operatorList, taskOperator); + errorList.addAll(taskOperator.getErrorList()); + } + } + } + operatorListAll.addAll(operatorList); + } + if (errorList.size() > 0) { + throw new WorkFlowException(200, JsonUtil.getObjectToString(errorList)); + } + } + + /** + * 审批人 + * taskOperator 对象 + * + * @param operatorList + * @param taskOperator + */ + public void operator(List operatorList, TaskOperator taskOperator) throws WorkFlowException { + ChildNodeList childNode = taskOperator.getChildNode(); + FlowTaskEntity flowTask = taskOperator.getTaskEntity(); + FlowModel flowModel = taskOperator.getFlowModel(); + UserInfo userInfo = flowModel.getUserInfo(); + List taskNodeList = taskOperator.getTaskNodeList(); + String operatorId = flowModel.getTaskOperatorId(); + String parentId = flowModel.getParentId(); + String rollbackId = flowModel.getRollbackId(); + Boolean rejectUser = flowModel.getRejectUser(); + boolean verify = taskOperator.getVerify(); + boolean reject = taskOperator.getReject(); + Date date = new Date(); + List nextList = new ArrayList<>(); + Properties properties = childNode.getProperties(); + String freeApproverUserId = flowModel.getFreeApproverUserId(); + TaskOperatoUser taskOperatoUser = new TaskOperatoUser(); + taskOperatoUser.setDate(date); + taskOperatoUser.setChildNode(childNode); + boolean isUser = StringUtil.isNotEmpty(freeApproverUserId); + taskOperatoUser.setId(isUser ? operatorId : FlowNature.ParentId); + taskOperatoUser.setParentId(parentId); + taskOperatoUser.setRollbackId(rollbackId); + taskOperatoUser.setRejectUser(rejectUser); + int pass = 0; + int notSubmit = 0; + int node = 0; + List userIdAll = new ArrayList<>(); + //【加签】 + if (isUser) { + userIdAll.add(freeApproverUserId); + boolean details = taskOperator.getDetails(); + //加签记录 + if (details) { + Custom custom = childNode.getCustom(); + FlowTaskOperatorRecordEntity operatorRecord = new FlowTaskOperatorRecordEntity(); + FlowTaskOperatorEntity operator = new FlowTaskOperatorEntity(); + operator.setTaskNodeId(childNode.getTaskNodeId()); + operator.setTaskId(childNode.getTaskId()); + operator.setNodeCode(custom.getNodeId()); + operator.setNodeName(properties.getTitle()); + boolean before = FlowNature.Before.equals(flowModel.getFreeApproverType()); + operator.setId(operatorId); + //审批数据赋值 + int status = before ? FlowRecordEnum.befoCopyId.getCode() : FlowRecordEnum.copyId.getCode(); + FlowOperatordModel flowOperatordModel = FlowOperatordModel.builder().status(status).flowModel(flowModel).userId(userInfo.getUserId()).operator(operator).operatorId(freeApproverUserId).build(); + operatorRecord(operatorRecord, flowOperatordModel); + if (!FlowNature.Reflux.equals(flowModel.getFreeApproverType())) { + createRecord(operatorRecord); + } + } + } else { + userIdAll.addAll(userListAll(taskOperator)); + pass = taskOperator.getPass(); + notSubmit = taskOperator.getNotSubmit(); + node = taskOperator.getNode(); + } + List userName = serviceUtil.getUserName(userIdAll, true); + FlowAgreeRuleModel ruleModel = FlowAgreeRuleModel.builder().operatorListAll(nextList).taskOperatoUser(taskOperatoUser).flowTask(flowTask).userName(userName).childNode(childNode).taskNodeList(taskNodeList).reject(reject).build(); + flowAgreeRule(ruleModel); + if (nextList.size() == 0 && verify) { + boolean isPass = pass(taskNodeList, childNode.getCustom().getNodeId(), flowModel, flowTask); + if (pass > 0) { + //1.验证下一节点类型 + if (isPass) { + FlowTaskNodeEntity taskNodeEntity = flowTaskNodeService.getInfo(childNode.getTaskNodeId(), + FlowTaskNodeEntity::getId, FlowTaskNodeEntity::getTaskId, + FlowTaskNodeEntity::getNodeCode, FlowTaskNodeEntity::getNodeName + ); + FlowModel parentModel = new FlowModel(); + parentModel.setUserId("0"); + parentModel.setFormData(flowModel.getFormData()); + parentModel.setHandleOpinion("默认通过"); + parentModel.setUserInfo(flowModel.getUserInfo()); + parentModel.setVoluntarily(true); + FlowTaskOperatorEntity parentOperator = new FlowTaskOperatorEntity(); + parentOperator.setParentId(FlowNature.ParentId); + parentOperator(parentOperator, taskNodeEntity); + flowTaskNewService.audit(flowTask, parentOperator, parentModel); + } else { + taskOperatoUser.setHandLeId(serviceUtil.getAdmin()); + operatorUser(nextList, taskOperatoUser); + } + } + if (notSubmit > 0) { + throw new WorkFlowException(MsgCode.WF059.get()); + } + if (node > 0) { + List errorList = new ArrayList() {{ + FlowErrorModel errorModel = new FlowErrorModel(); + errorModel.setNodeId(childNode.getCustom().getNodeId()); + errorModel.setNodeName(childNode.getProperties().getTitle()); + add(errorModel); + }}; + taskOperator.setErrorList(errorList); + } + } + operatorList.addAll(nextList); + } + + /** + * 验证自动通过 + * + * @param ruleModel + */ + public void flowAgreeRule(FlowAgreeRuleModel ruleModel) { + FlowTaskEntity flowTask = ruleModel.getFlowTask(); + List userName = ruleModel.getUserName(); + TaskOperatoUser taskOperatoUser = ruleModel.getTaskOperatoUser(); + List nextList = ruleModel.getOperatorListAll(); + ChildNodeList childNode = ruleModel.getChildNode(); + List taskNodeList = ruleModel.getTaskNodeList(); + boolean reject = ruleModel.getReject(); + int sort = 0; + String creatorUserId = flowTask.getCreatorUserId(); + Properties properties = childNode.getProperties(); + Integer counterSign = properties.getCounterSign(); + Integer type = properties.getAssigneeType(); + boolean isNominator = FlowNature.ImproperApprover.equals(counterSign) && FlowTaskOperatorEnum.Nominator.getCode().equals(type); + boolean agreeRule = properties.getHasAgreeRule(); + List statusList = ImmutableList.of(FlowNodeEnum.Process.getCode(), FlowNodeEnum.FreeApprover.getCode()); + List recordList = new ArrayList<>(); + if (agreeRule) { + recordList.addAll(flowTaskOperatorRecordService.getList(flowTask.getId()).stream().filter(t -> FlowRecordEnum.audit.getCode().equals(t.getHandleStatus()) && statusList.contains(t.getStatus())).collect(Collectors.toList())); + } + List userList = new ArrayList<>(); + if (isNominator) { + for (String id : properties.getApproversSortList()) { + userList.addAll(userName.stream().filter(t -> id.contains(t.getId())).collect(Collectors.toList())); + } + } + if (userList.size() == 0) { + userList.addAll(userName); + } + for (UserEntity entity : userList) { + int num = 0; + if (agreeRule) { + for (Integer rule : properties.getAgreeRules()) { + switch (FlowAgreeRuleEnum.getByCode(rule)) { + case initiator: + num += entity.getId().equals(creatorUserId) ? 1 : 0; + break; + case node: + List nodeList = taskNodeList.stream().filter(t -> StringUtil.isNotEmpty(t.getNodeNext()) && t.getNodeNext().contains(childNode.getCustom().getNodeId())).map(FlowTaskNodeEntity::getId).collect(Collectors.toList()); + List list = recordList.stream().filter(t -> nodeList.contains(t.getTaskNodeId())).map(FlowTaskOperatorRecordEntity::getHandleId).collect(Collectors.toList()); + num += list.contains(entity.getId()) ? 1 : 0; + break; + case pass: + num += recordList.stream().filter(t -> t.getHandleId().equals(entity.getId())).count() > 0 ? 1 : 0; + break; + default: + break; + } + } + } + taskOperatoUser.setHandLeId(entity.getId()); + taskOperatoUser.setAutomation(num > 0 && !reject ? "1" : ""); + taskOperatoUser.setSortCode(++sort); + operatorUser(nextList, taskOperatoUser); + } + } + + /** + * 获取审批人 + * + * @param taskOperator + * @return + */ + public List userListAll(TaskOperator taskOperator) throws WorkFlowException { + ChildNodeList childNode = taskOperator.getChildNode(); + List taskNodeListAll = taskOperator.getTaskNodeList(); + FlowTaskNodeEntity startNode = taskNodeListAll.stream().filter(t -> FlowNature.NodeStart.equals(t.getNodeType())).findFirst().get(); + ChildNodeList startNodeJson = JsonUtil.getJsonToBean(startNode.getNodePropertyJson(), ChildNodeList.class); + Properties startProper = startNodeJson.getProperties(); + Boolean errorRule = taskOperator.getErrorRule(); + int pass = 0; + int notSubmit = 0; + int node = 0; + Boolean extraRule = taskOperator.getExtraRule(); + FlowTaskEntity taskEntity = taskOperator.getTaskEntity(); + Properties properties = childNode.getProperties(); + List userIdAll = user(taskOperator, properties.getAssigneeType()); + //附加规则 + if (extraRule) { + rule(userIdAll, taskEntity.getId(), properties.getExtraRule()); + } + //获取最新用户 + List userList = serviceUtil.getUserName(userIdAll, true); + //异常规则 + if (errorRule && userList.size() == 0) { + //异常处理规则 + switch (FlowErrorRuleEnum.getByCode(startProper.getErrorRule())) { + case administrator: + userIdAll.add(serviceUtil.getAdmin()); + break; + case initiator: + List errorRuleUser = serviceUtil.getUserName(startProper.getErrorRuleUser(), true); + if (errorRuleUser.size() > 0) { + userIdAll.addAll(errorRuleUser.stream().map(UserEntity::getId).collect(Collectors.toList())); + } else { + userIdAll.add(serviceUtil.getAdmin()); + } + break; + case node: + String nodeId = childNode.getTaskNodeId(); + List candidatesList = flowCandidatesService.getList(nodeId); + candidatesList.stream().forEach(t -> { + List candidates = StringUtil.isNotEmpty(t.getCandidates()) ? JsonUtil.getJsonToList(t.getCandidates(), String.class) : new ArrayList<>(); + userIdAll.addAll(candidates); + }); + node++; + break; + case pass: + pass++; + break; + case notSubmit: + notSubmit++; + break; + default: + break; + } + } + taskOperator.setPass(pass); + taskOperator.setNotSubmit(notSubmit); + taskOperator.setNode(node); + return userIdAll; + } + + /** + * 递归主管 + * + * @param managerId 主管id + * @param level 第几级 + * @return + */ + public String getManagerByLevel(String managerId, long level) { + --level; + if (level == 0) { + return managerId; + } else { + UserEntity userEntity = serviceUtil.getUserInfo(managerId); + return userEntity != null ? getManagerByLevel(userEntity.getManagerId(), level) : ""; + } + } + + /** + * 递归上级部门 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/29 + */ + private OrganizeEntity getManageOrgByLevel(String organizeId, long level) { + --level; + if (level == 0) { + return serviceUtil.getOrganizeInfo(organizeId); + } else { + OrganizeEntity organizeInfo = serviceUtil.getOrganizeInfo(organizeId); + return organizeInfo != null ? getManageOrgByLevel(organizeInfo.getParentId(), level) : null; + } + } + + /** + * 获取代办用户是否自动通过 + * + * @param flowTask + * @throws WorkFlowException + */ + public void approverPass(FlowTaskEntity flowTask, List taskNodeList, FlowModel flowModel, FlowTaskOperatorEntity operator) throws WorkFlowException { + //查询审批记录 + List recordList = flowTaskOperatorRecordService.getList(flowTask.getId()).stream().filter(t -> FlowNodeEnum.Process.getCode().equals(t.getStatus()) && FlowRecordEnum.audit.getCode().equals(t.getHandleStatus())).collect(Collectors.toList()); + List recordUserList = recordList.stream().map(FlowTaskOperatorRecordEntity::getHandleId).collect(Collectors.toList()); + List taskNodeAll = ImmutableList.of(operator.getTaskNodeId()); + List operatorList = flowTaskOperatorService.getList(flowTask.getId()).stream().filter(t -> FlowNodeEnum.Process.getCode().equals(t.getState()) && FlowNature.ProcessCompletion.equals(t.getCompletion()) && recordUserList.contains(t.getHandleId()) && !taskNodeAll.contains(t.getTaskNodeId())).collect(Collectors.toList()); + Map> operatorMap = operatorList.stream().collect(Collectors.groupingBy(FlowTaskOperatorEntity::getTaskNodeId)); + //获取代办节点 + for (String key : operatorMap.keySet()) { + FlowTaskNodeEntity taskNode = taskNodeList.stream().filter(t -> t.getId().equals(key)).findFirst().orElse(null); + if (taskNode != null) { + List operatorListAll = operatorMap.get(key); + ChildNodeList childNode = JsonUtil.getJsonToBean(taskNode.getNodePropertyJson(), ChildNodeList.class); + Properties properties = childNode.getProperties(); + Set flowTaskOperatorList = new HashSet<>(); + if (properties.getHasAgreeRule()) { + for (Integer rule : properties.getAgreeRules()) { + //判断节点是否审批人审批过 + switch (FlowAgreeRuleEnum.getByCode(rule)) { + case initiator: + operatorListAll.stream().forEach(t -> { + t.setAutomation(t.getHandleId().equals(flowTask.getCreatorUserId()) ? "1" : ""); + }); + break; + case node: + List nodeList = taskNodeList.stream().filter(t -> StringUtil.isNotEmpty(t.getNodeNext()) && t.getNodeNext().contains(childNode.getCustom().getNodeId())).map(FlowTaskNodeEntity::getId).collect(Collectors.toList()); + List list = recordList.stream().filter(t -> FlowRecordEnum.audit.getCode().equals(t.getHandleStatus()) && nodeList.contains(t.getTaskNodeId())).map(FlowTaskOperatorRecordEntity::getHandleId).collect(Collectors.toList()); + operatorListAll.stream().forEach(t -> { + t.setAutomation(list.contains(t.getHandleId()) ? "1" : ""); + }); + break; + case pass: + operatorListAll.stream().forEach(t -> t.setAutomation("1")); + break; + default: + break; + } + flowTaskOperatorList.addAll(operatorListAll.stream().filter(t -> StringUtil.isNotEmpty(t.getAutomation())).collect(Collectors.toList())); + } + } + boolean isApprove = flowTaskOperatorList.size() > 0; + if (isApprove) { + FlowApproveModel approveModel = FlowApproveModel.builder().operatorList(new ArrayList<>(flowTaskOperatorList)).taskNodeList(taskNodeList).flowTask(flowTask).flowModel(flowModel).build(); + approve(approveModel); + } + } + } + } + + /** + * 封装审批人 + * + * @param nextList 所有审批人数据 + * @param taskOperatoUser 对象 + */ + public void operatorUser(List nextList, TaskOperatoUser taskOperatoUser) { + String handLeId = taskOperatoUser.getHandLeId(); + Date date = taskOperatoUser.getDate(); + ChildNodeList childNode = taskOperatoUser.getChildNode(); + Properties properties = childNode.getProperties(); + Custom custom = childNode.getCustom(); + Integer type = properties.getAssigneeType(); + FlowTaskOperatorEntity operator = new FlowTaskOperatorEntity(); + operator.setId(RandomUtil.uuId()); + operator.setAppendHandleId(taskOperatoUser.getParentId()); + operator.setHandleId(StringUtil.isEmpty(handLeId) ? serviceUtil.getAdmin() : handLeId); + operator.setTaskNodeId(childNode.getTaskNodeId()); + operator.setTaskId(childNode.getTaskId()); + operator.setNodeCode(custom.getNodeId()); + operator.setNodeName(properties.getTitle()); + operator.setCreatorTime(date); + operator.setCompletion(FlowNature.ProcessCompletion); + operator.setType(type); + operator.setState(FlowNodeEnum.Process.getCode()); + operator.setParentId(taskOperatoUser.getId()); + operator.setAutomation(taskOperatoUser.getAutomation()); + operator.setSortCode(taskOperatoUser.getSortCode()); + operator.setRollbackId(taskOperatoUser.getRollbackId()); + operator.setReject(taskOperatoUser.getRejectUser() ? "1" : ""); + nextList.add(operator); + } + + /** + * 更新经办数据 + * + * @param operator 当前经办 + * @param handStatus 对象 + */ + public void handleIdStatus(FlowTaskOperatorEntity operator, TaskHandleIdStatus handStatus) { + int status = handStatus.getStatus(); + ChildNodeList nodeModel = handStatus.getNodeModel(); + FlowModel flowModel = handStatus.getFlowModel(); + Properties properties = nodeModel.getProperties(); + Integer counterSign = properties.getCounterSign(); + operator.setHandleTime(new Date()); + operator.setHandleStatus(status); + Integer type = properties.getAssigneeType(); + boolean isApprover = !FlowNature.FixedApprover.equals(counterSign); + List userIdListAll = new ArrayList<>(); + if (status == 1) { + boolean hasFreeApprover = StringUtil.isEmpty(flowModel.getFreeApproverUserId()); + if (isApprover) { + //更新会签都改成完成 + flowTaskOperatorService.update(operator.getTaskNodeId(), userIdListAll, "1"); + } else { + if (hasFreeApprover) { + //更新或签都改成完成 + flowTaskOperatorService.update(operator.getTaskNodeId(), type); + } + } + operator.setCompletion(FlowNature.AuditCompletion); + } else { + if (isApprover) { + //更新会签都改成完成 + flowTaskOperatorService.update(operator.getTaskNodeId(), userIdListAll, "-1"); + } else { + //更新或签都改成完成 + flowTaskOperatorService.update(operator.getTaskNodeId(), type); + } + operator.setCompletion(FlowNature.RejectCompletion); + } + } + + /** + * 会签比例 + * + * @param pass 比例 + * @param total 总数 + * @param passNum 数量 + * @return + */ + public boolean isCountersign(long pass, double total, double passNum) { + int scale = (int) (passNum / total * 100); + return scale >= pass; + } + + /** + * 获取通过人数 + * + * @param operatorList 流程经办数据 + * @return + */ + public List passNum(List operatorList, Integer completion) { + List passListAll = operatorList.stream().filter(t -> completion.equals(t.getCompletion())).collect(Collectors.toList()); + return passListAll; + } + + /** + * 抄送人 + * + * @param childNode 当前json对象 + * @param circulateList 抄送list + * @param flowModel 提交数据 + */ + public void circulateList(ChildNodeList childNode, List taskNodeList, List circulateList, FlowModel flowModel, FlowTaskEntity flowTask) throws WorkFlowException { + Properties properties = childNode.getProperties(); + List circulateUserList = new ArrayList<>(); + circulateUserList.addAll(properties.getCirculateUser()); + List userIdAll = serviceUtil.getUserListAll(circulateUserList); + //附加规则 + rule(userIdAll, childNode.getTaskId(), properties.getExtraCopyRule()); + //指定传阅人 + String[] copyIds = StringUtil.isNotEmpty(flowModel.getCopyIds()) ? flowModel.getCopyIds().split(",") : new String[]{}; + userIdAll.addAll(Arrays.asList(copyIds)); + //抄送自己 + if (childNode.getProperties().getIsInitiatorCopy()) { + userIdAll.add(flowTask.getCreatorUserId()); + } + //抄送表单变量 + if (childNode.getProperties().getIsFormFieldCopy()) { + FlowDataModel flowDataModel = new FlowDataModel(childNode, taskNodeList, flowModel, false, true); + Map dataAll = createOrUpdate(flowDataModel); + Object data = dataAll.get(properties.getCopyFormField()); + if (data != null) { + List list = new ArrayList<>(); + try { + list.addAll(JsonUtil.getJsonToList(String.valueOf(data), String.class)); + } catch (Exception e) { + + } + if (data instanceof List) { + list.addAll((List) data); + } else { + list.addAll(Arrays.asList(String.valueOf(data).split(","))); + } + List id = new ArrayList<>(); + for (String s : list) { + id.add(s.split("--")[0]); + } + List listByObjectIdAll = serviceUtil.getListByObjectIdAll(id); + List userPosition = listByObjectIdAll.stream().map(UserRelationEntity::getUserId).collect(Collectors.toList()); + List handleIdAll = new ArrayList<>(); + handleIdAll.addAll(userPosition); + handleIdAll.addAll(id); + userIdAll.addAll(handleIdAll); + } + } + //获取最新用户 + List userList = serviceUtil.getUserName(userIdAll, true); + for (UserEntity userEntity : userList) { + FlowTaskCirculateEntity circulate = new FlowTaskCirculateEntity(); + circulate.setId(RandomUtil.uuId()); + circulate.setObjectId(userEntity.getId()); + circulate.setNodeCode(childNode.getCustom().getNodeId()); + circulate.setNodeName(childNode.getProperties().getTitle()); + circulate.setTaskNodeId(childNode.getTaskNodeId()); + circulate.setTaskId(childNode.getTaskId()); + circulate.setCreatorTime(new Date()); + circulateList.add(circulate); + } + } + + /** + * 流程任务结束 + * + * @param flowTask 流程任务 + */ + public boolean endround(FlowTaskEntity flowTask, ChildNodeList childNode, FlowModel flowModel) throws WorkFlowException { + flowTask.setStatus(FlowTaskStatusEnum.Adopt.getCode()); + flowTask.setCompletion(FlowNature.Progress); + flowTask.setEndTime(DateUtil.getNowDate()); + flowTask.setThisStepId(FlowNature.NodeEnd); + flowTask.setThisStep("结束"); + //结束事件 + FlowTaskOperatorRecordEntity operatorRecord = new FlowTaskOperatorRecordEntity(); + operatorRecord.setTaskId(flowTask.getId()); + operatorRecord.setHandleStatus(flowTask.getStatus()); + UserInfo userInfo = flowModel.getUserInfo(); + operatorRecord.setHandleId(userInfo.getUserId()); + flowTaskService.update(flowTask); + FlowTemplateAllModel templateAllModel = templateJson(flowTask.getFlowId()); + TaskNodeListModel taskNodeListModel = TaskNodeListModel.builder().id(flowTask.getId()).state(FlowNodeEnum.Process.getCode()).build(); + List taskNodeList = flowTaskNodeService.getList(taskNodeListModel, + FlowTaskNodeEntity::getId, FlowTaskNodeEntity::getNodeType, FlowTaskNodeEntity::getNodePropertyJson,FlowTaskNodeEntity::getTaskId + ); + //发送消息 + FlowMsgModel flowMsgModel = new FlowMsgModel(); + flowMsgModel.setEnd(true); + flowMsgModel.setNodeList(taskNodeList); + flowMsgModel.setTaskEntity(flowTask); + FlowTaskNodeEntity taskNodeEntity = new FlowTaskNodeEntity(); + taskNodeEntity.setNodePropertyJson(JsonUtil.getObjectToString(childNode)); + flowMsgModel.setTaskNodeEntity(taskNodeEntity); + flowMsgModel.setFlowTemplateAllModel(templateAllModel); + flowMsgModel.setData(JsonUtil.stringToMap(flowTask.getFlowFormContentJson())); + flowMsgModel.setFlowModel(flowModel); + flowMsgUtil.message(flowMsgModel); + flowMsgUtil.event(2, childNode, operatorRecord, flowModel); + //子流程结束,触发主流程 + boolean isEnd = isNext(flowTask, flowModel); + return isEnd; + } + + /** + * 更新节点接收时间 + * + * @param operatorList + */ + public void taskCreatTime(List operatorList) { + Map> operatorMap = operatorList.stream().filter(t -> FlowNature.ParentId.equals(t.getParentId())).collect(Collectors.groupingBy(FlowTaskOperatorEntity::getTaskNodeId)); + for (String key : operatorMap.keySet()) { + List list = operatorMap.get(key).stream().sorted(Comparator.comparing(FlowTaskOperatorEntity::getCreatorTime)).collect(Collectors.toList()); + Date date = list.size() > 0 ? list.get(0).getCreatorTime() : null; + if (date != null) { + FlowTaskNodeEntity taskNodeEntity = new FlowTaskNodeEntity(); + taskNodeEntity.setId(key); + taskNodeEntity.setCreatorTime(date); + flowTaskNodeService.update(taskNodeEntity); + } + } + } + + /** + * 自动审批 + */ + public void approve(FlowApproveModel approveModel) throws WorkFlowException { + FlowTaskEntity flowTask = approveModel.getFlowTask(); + boolean rejectId = StringUtil.isEmpty(flowTask.getRejectId()); + if (rejectId) { + List operatorList = approveModel.getOperatorList(); + Map> operatorMap = operatorList.stream().collect(Collectors.groupingBy(FlowTaskOperatorEntity::getTaskNodeId)); + List taskNodeList = approveModel.getTaskNodeList(); + FlowModel flowModel = approveModel.getFlowModel(); + List result = new ArrayList<>(); + for (String key : operatorMap.keySet()) { + FlowTaskNodeEntity taskNode = taskNodeList.stream().filter(t -> t.getId().equals(key)).findFirst().orElse(null); + if (taskNode != null) { + result.addAll(operator(taskNode, taskNodeList, operatorList, flowModel, flowTask)); + } + } + for (FlowTaskOperatorEntity entity : result) { + boolean isFlowTask = StringUtil.isNotEmpty(flowTask.getRejectId()) || FlowTaskStatusEnum.Suspend.getCode().equals(flowTask.getStatus()); + FlowTaskNodeEntity flowTaskNode = flowTaskNodeService.getInfo(entity.getTaskNodeId(), FlowTaskNodeEntity::getCompletion); + boolean isTaskNode = FlowNature.ProcessCompletion.equals(flowTaskNode.getCompletion()); + FlowTaskOperatorEntity operator = flowTaskOperatorService.getInfo(entity.getId()); + boolean isOperator = FlowNature.ProcessCompletion.equals(operator.getCompletion()); + if (!isFlowTask && isTaskNode && isOperator) { + UserEntity userEntity = serviceUtil.getUserInfo(operator.getHandleId()); + UserInfo userInfo = flowModel.getUserInfo(); + userInfo.setUserId(userEntity.getId()); + userInfo.setUserAccount(userEntity.getAccount()); + FlowModel parentModel = new FlowModel(); + parentModel.setUserId(operator.getHandleId()); + parentModel.setHandleOpinion("自动审批通过"); + parentModel.setUserInfo(userInfo); + parentModel.setFormData(flowModel.getFormData()); + parentModel.setVoluntarily(true); + flowTaskNewService.audit(flowTask, operator, parentModel); + } + } + } + } + + /** + * 验证下一节点和会签比例 + * + * @return + */ + public List operator(FlowTaskNodeEntity taskNode, List taskNodeList, List operatorList, FlowModel flowModel, FlowTaskEntity flowTask) throws WorkFlowException { + List result = new ArrayList<>(); + ChildNodeList nodeModel = JsonUtil.getJsonToBean(taskNode.getNodePropertyJson(), ChildNodeList.class); + Properties properties = nodeModel.getProperties(); + boolean fixed = !FlowNature.FixedApprover.equals(properties.getCounterSign()); + List list = operatorList.stream().filter(t -> StringUtil.isNotEmpty(t.getAutomation())).collect(Collectors.toList()); + List operatorListAll = flowTaskOperatorService.getList(taskNode.getTaskId()).stream().filter(t -> t.getTaskNodeId().equals(taskNode.getId()) && FlowNodeEnum.Process.getCode().equals(t.getState())).collect(Collectors.toList()); + boolean isPass = pass(taskNodeList, taskNode.getNodeCode(), flowModel, flowTask); + List operatorId = new ArrayList<>(); + for (FlowTaskOperatorEntity operator : list) { + operatorId.add(operator.getId()); + operatorListAll.stream().forEach(t -> { + boolean isCompletion = operatorId.contains(t.getId()); + t.setCompletion(isCompletion ? FlowNature.AuditCompletion : t.getCompletion()); + }); + FlowCountersignModel countersign = new FlowCountersignModel(); + countersign.setOperatorList(operatorListAll); + countersign.setTaskNode(taskNode); + boolean isCountersign = isCountersign(countersign); + if (isPass || (fixed && !isCountersign)) { + result.add(operator); + } + } + return result; + } + + /** + * 判断是否自动通过 + * + * @param taskNodeList + * @param nodeCode + * @return + */ + public boolean pass(List taskNodeList, String nodeCode, FlowModel flowModel, FlowTaskEntity flowtask) throws WorkFlowException { + boolean result = false; + int num = 0; + List childNodeLists = new ArrayList<>(); + List thisList = taskNodeList.stream().filter(t -> t.getNodeCode().equals(nodeCode)).collect(Collectors.toList()); + //当前节点 + for (FlowTaskNodeEntity taskNode : thisList) { + ChildNodeList taskNodechildNodeList = JsonUtil.getJsonToBean(taskNode.getNodePropertyJson(), ChildNodeList.class); + List childNodeListAll = new ArrayList<>(); + candidate(taskNodeList, childNodeListAll, taskNode.getNodeCode(), true); + for (ChildNodeList childNodeList : childNodeListAll) { + childNodeLists.add(childNodeList); + Integer type = childNodeList.getProperties().getAssigneeType(); + if (taskNodechildNodeList.getCustom().getBranchFlow() || FlowTaskOperatorEnum.Candidate.getCode().equals(type)) { + num++; + } + } + } + if (num == 0) { + result = nextUser(childNodeLists, taskNodeList, flowtask, flowModel); + } + return result; + } + + /** + * 查询下一节点是否有人 + * + * @return + */ + public boolean nextUser(List childNodeLists, List taskNodeList, FlowTaskEntity flowTask, FlowModel flowModel) throws WorkFlowException { + int num = 0; + FlowTaskNodeEntity start = taskNodeList.stream().filter(t -> FlowNature.NodeStart.equals(t.getNodeType())).findFirst().get(); + ChildNodeList startPrope = JsonUtil.getJsonToBean(start.getNodePropertyJson(), ChildNodeList.class); + Properties properties = startPrope.getProperties(); + List list = ImmutableList.of(FlowErrorRuleEnum.notSubmit, FlowErrorRuleEnum.node); + boolean errorRule = list.contains(FlowErrorRuleEnum.getByCode(properties.getErrorRule())); + for (ChildNodeList childNodeList : childNodeLists) { + String nodeId = childNodeList.getCustom().getNodeId(); + TaskOperator taskOperator = new TaskOperator(); + taskOperator.setChildNode(childNodeList); + taskOperator.setTaskEntity(flowTask); + taskOperator.setFlowModel(flowModel); + taskOperator.setTaskNodeList(taskNodeList); + boolean extraRule = FlowTaskOperatorEnum.Nominator.getCode().equals(childNodeList.getProperties().getAssigneeType()); + taskOperator.setExtraRule(extraRule); + List userIdAll = userListAll(taskOperator); + List userList = serviceUtil.getUserName(userIdAll, true); + if (!FlowNature.NodeEnd.equals(nodeId)) { + num += userList.size() > 0 ? 0 : 1; + } + } + boolean result = (num > 0 && errorRule) ? false : true; + return result; + } + + /** + * 获取会签是否通过 + * + * @param countersign + * @return + */ + public boolean isCountersign(FlowCountersignModel countersign) { + List operatorList = countersign.getOperatorList(); + FlowTaskNodeEntity taskNode = countersign.getTaskNode(); + ChildNodeList nodeModel = JsonUtil.getJsonToBean(taskNode.getNodePropertyJson(), ChildNodeList.class); + List state = ImmutableList.of(FlowNodeEnum.Process.getCode(), FlowNodeEnum.FreeApprover.getCode()); + List operatorListAll = flowTaskOperatorService.getList(taskNode.getTaskId()).stream().filter(t -> t.getTaskNodeId().equals(taskNode.getId()) && state.contains(t.getState())).collect(Collectors.toList()); + List operatorIdList = new ArrayList<>(); + operatorListAll.stream().forEach(t -> { + if (FlowNature.ParentId.equals(t.getParentId())) { + operatorIdList.add(t.getId()); + } + }); + improperApprover(nodeModel, operatorList, operatorIdList); + boolean isCountersign = fixedJointly(operatorList, nodeModel, countersign); + return isCountersign; + } + + /** + * 查询依次审批比例 + */ + public void improperApprover(ChildNodeList nodeModel, List operatorList, List operatorIdList) { + Properties properties = nodeModel.getProperties(); + boolean fixed = FlowNature.ImproperApprover.equals(properties.getCounterSign()); + if (fixed) { + List operatorAllIdList = flowOperatorUserService.getTaskList(null, nodeModel.getTaskNodeId()); + for (FlowOperatorUserEntity entity : operatorAllIdList) { + if (!operatorIdList.contains(entity.getId())) { + FlowTaskOperatorEntity taskOperator = new FlowTaskOperatorEntity(); + taskOperator.setParentId(FlowNature.ParentId); + taskOperator.setHandleId(serviceUtil.getAdmin()); + taskOperator.setCompletion(FlowNature.ProcessCompletion); + operatorList.add(taskOperator); + } + } + } + } + + /** + * 过滤依次审批人 + */ + public void improperApproverUser(List operatorListAll, List taskNodeList, ChildNodeList nodeModel, FlowTaskOperatorEntity flowOperator) { + FlowTaskOperatorEntity operatorEntity = new FlowTaskOperatorEntity(); + operatorEntity.setTaskNodeId(nodeModel.getTaskNodeId()); + operatorEntity.setTaskId(nodeModel.getTaskId()); + operatorEntity.setParentId(FlowNature.ParentId); + Set operatorIdList = new HashSet<>(); + if (operatorListAll.size() == 0) { + if (flowOperator != null) { + List taskOperatorList = flowTaskOperatorService.getList(nodeModel.getTaskId()).stream().filter(t -> FlowNodeEnum.Process.getCode().equals(t.getState())).collect(Collectors.toList()); + upOperator(flowOperator, taskOperatorList, operatorIdList); + List taskList = flowOperatorUserService.getTaskList(null, nodeModel.getTaskNodeId()); + List operatorUserId = taskList.stream().filter(t -> operatorIdList.contains(t.getSortCode())).map(FlowOperatorUserEntity::getId).collect(Collectors.toList()); + boolean count = taskOperatorList.stream().filter(t -> operatorUserId.contains(t.getId())).count() > 0; + if (!count) { + operatorListAll.add(operatorEntity); + } + } + } + Map> operatorMap = operatorListAll.stream().collect(Collectors.groupingBy(FlowTaskOperatorEntity::getTaskNodeId)); + //下个节点 + for (String key : operatorMap.keySet()) { + FlowTaskNodeEntity taskNode = taskNodeList.stream().filter(t -> t.getId().equals(key)).findFirst().orElse(null); + List list = operatorMap.get(key); + if (taskNode != null) { + ChildNodeList childNodeList = JsonUtil.getJsonToBean(taskNode.getNodePropertyJson(), ChildNodeList.class); + Properties thisProperties = childNodeList.getProperties(); + boolean thisCounterSign = FlowNature.ImproperApprover.equals(thisProperties.getCounterSign()); + boolean isParentId = list.stream().filter(t -> FlowNature.ParentId.equals(t.getParentId())).count() > 0; + if (thisCounterSign && isParentId) { + List operatorList = flowTaskOperatorService.getList(taskNode.getTaskId()).stream().filter(t -> FlowNature.ParentId.equals(t.getParentId()) && t.getTaskNodeId().equals(taskNode.getId())).map(FlowTaskOperatorEntity::getId).collect(Collectors.toList()); + List taskList = flowOperatorUserService.getTaskList(null, taskNode.getId()); + List taskUserList = taskList.stream().map(FlowOperatorUserEntity::getId).collect(Collectors.toList()); + taskUserList.removeAll(operatorList); + List userList = taskList.stream().filter(t -> taskUserList.contains(t.getId())).sorted(Comparator.comparing(FlowOperatorUserEntity::getSortCode)).collect(Collectors.toList()); + if (userList.size() > 0) { + operatorListAll.removeAll(list); + FlowTaskOperatorEntity operator = JsonUtil.getJsonToBean(userList.get(0), FlowTaskOperatorEntity.class); + operator.setCreatorTime(new Date()); + operatorListAll.add(operator); + } + } + } + } + operatorListAll.remove(operatorEntity); + } + + /** + * 插入候选人和异常人 + */ + public void candidateList(FlowModel flowModel, List taskNodeList, FlowTaskOperatorEntity operator) { + UserInfo userInfo = flowModel.getUserInfo(); + //新增候选人 + Map> candidateList = flowModel.getCandidateList(); + for (String key : candidateList.keySet()) { + FlowTaskNodeEntity taskNodeEntity = taskNodeList.stream().filter(t -> t.getNodeCode().equals(key)).findFirst().orElse(null); + if (taskNodeEntity != null) { + //删除不是代办节点的候选人 + List nodeId = new ArrayList<>(); + List taskOperatorId = new ArrayList<>(); + List nextTaskNodeList = taskNodeList.stream().filter(t -> StringUtil.isNotEmpty(t.getNodeNext()) && t.getNodeNext().contains(key) && !t.getNodeCode().equals(operator.getNodeCode())).collect(Collectors.toList()); + for (FlowTaskNodeEntity entity : nextTaskNodeList) { + if (FlowNature.NodeStart.equals(entity.getNodeType())) { + taskOperatorId.add(FlowNature.ParentId); + } + nodeId.add(entity.getId()); + } + taskOperatorId.addAll(flowTaskOperatorService.getList(taskNodeEntity.getTaskId()).stream().filter(t -> nodeId.contains(t.getTaskNodeId())).map(FlowTaskOperatorEntity::getId).collect(Collectors.toList())); + flowCandidatesService.delete(taskOperatorId); + List list = candidateList.get(key); + FlowCandidatesEntity entity = new FlowCandidatesEntity(); + entity.setHandleId(userInfo.getUserId()); + entity.setTaskId(taskNodeEntity.getTaskId()); + entity.setTaskNodeId(taskNodeEntity.getId()); + entity.setAccount(userInfo.getUserAccount()); + entity.setCandidates(JsonUtil.getObjectToString(list)); + entity.setOperatorId(operator.getId()); + entity.setType(FlowNature.Candidates); + flowCandidatesService.create(entity); + } + } + //新增异常人 + Map> candidateErrorList = flowModel.getErrorRuleUserList(); + for (String key : candidateErrorList.keySet()) { + FlowTaskNodeEntity taskNodeEntity = taskNodeList.stream().filter(t -> t.getNodeCode().equals(key)).findFirst().orElse(null); + if (taskNodeEntity != null) { + List list = candidateErrorList.get(key); + FlowCandidatesEntity entity = new FlowCandidatesEntity(); + entity.setHandleId(userInfo.getUserId()); + entity.setTaskId(taskNodeEntity.getTaskId()); + entity.setTaskNodeId(taskNodeEntity.getId()); + entity.setAccount(userInfo.getUserAccount()); + entity.setCandidates(JsonUtil.getObjectToString(list)); + entity.setOperatorId(operator.getId()); + entity.setType(FlowNature.CandidatesError); + flowCandidatesService.create(entity); + } + } + } + + /** + * 获取流程节点 + */ + public void nodeList(List taskNodeAllList) { + List nodeList = taskNodeAllList.stream().filter(t -> StringUtil.isNotEmpty(t.getCandidates())).map(FlowTaskNodeEntity::getNodeCode).collect(Collectors.toList()); + if (nodeList.size() > 0) { + Set taskNodeList = new HashSet<>(); + FlowTaskNodeEntity start = taskNodeAllList.stream().filter(t -> FlowNature.NodeStart.equals(t.getNodeType())).findFirst().orElse(null); + nodeListNext(start, taskNodeAllList, taskNodeList); + taskNodeAllList.retainAll(taskNodeList); + } + } + + /** + * 获取下一节点 + */ + public void nodeListNext(FlowTaskNodeEntity node, List taskNodeAllList, Set taskNodeList) { + if (node != null) { + ChildNodeList childNodeList = JsonUtil.getJsonToBean(node.getNodePropertyJson(), ChildNodeList.class); + Boolean swerve = childNodeList.getCustom().getSwerve(); + if (!swerve) { + taskNodeList.add(node); + List nextList = StringUtil.isNotEmpty(node.getNodeNext()) ? Arrays.asList(node.getNodeNext().split(",")) : new ArrayList<>(); + List nextNodeList = taskNodeAllList.stream().filter(t -> nextList.contains(t.getNodeCode())).collect(Collectors.toList()); + List branchList = nextNodeList.stream().filter(t -> StringUtil.isNotEmpty(t.getCandidates())).collect(Collectors.toList()); + List resultList = branchList.size() > 0 ? branchList : nextNodeList; + for (FlowTaskNodeEntity entity : resultList) { + taskNodeList.add(entity); + nodeListNext(entity, taskNodeAllList, taskNodeList); + } + } + } + } + + /** + * 附加条件 + */ + public void rule(List userIdAll, String taskId, int rule) { + List ruleList = ImmutableList.of(FlowExtraRuleEnum.organize.getCode(), FlowExtraRuleEnum.position.getCode(), + FlowExtraRuleEnum.manager.getCode(), FlowExtraRuleEnum.subordinate.getCode(), FlowExtraRuleEnum.department.getCode()); + if (ruleList.contains(rule)) { + FlowUserEntity flowUser = flowUserService.getTaskInfo(taskId); + if (flowUser != null) { + List userList = serviceUtil.getUserName(userIdAll, true); + List userListAll = userList.stream().map(UserEntity::getId).collect(Collectors.toList()); + Map> relationUserList = serviceUtil.getListByUserIdAll(userListAll).stream().filter(t -> StringUtil.isNotEmpty(t.getObjectId())).collect(Collectors.groupingBy(UserRelationEntity::getObjectId)); + //附加条件 + switch (FlowExtraRuleEnum.getByCode(rule)) { + case organize: + List organize = new ArrayList<>(); + organize.addAll(relationUserList.get(flowUser.getOrganizeId()) != null ? relationUserList.get(flowUser.getOrganizeId()).stream().map(UserRelationEntity::getUserId).collect(Collectors.toList()) : new ArrayList<>()); + userIdAll.retainAll(organize); + break; + case position: + List position = new ArrayList<>(); + position.addAll(relationUserList.get(flowUser.getPositionId()) != null ? relationUserList.get(flowUser.getPositionId()).stream().map(UserRelationEntity::getUserId).collect(Collectors.toList()) : new ArrayList<>()); + userIdAll.retainAll(position); + break; + case manager: + List manager = new ArrayList<>(); + manager.add(flowUser.getSuperior()); + userIdAll.retainAll(manager); + break; + case subordinate: + List subordinate = new ArrayList<>(); + subordinate.addAll(StringUtil.isNotEmpty(flowUser.getSubordinate()) ? new ArrayList<>(Arrays.asList(flowUser.getSubordinate().split(","))) : new ArrayList<>()); + userIdAll.retainAll(subordinate); + break; + case department: + List department = new ArrayList<>(); + List departmentAll = serviceUtil.getDepartmentAll(flowUser.getOrganizeId()).stream().map(OrganizeEntity::getId).collect(Collectors.toList()); + for (String id : departmentAll) { + department.addAll(relationUserList.get(id) != null ? relationUserList.get(id).stream().map(UserRelationEntity::getUserId).collect(Collectors.toList()) : new ArrayList<>()); + } + userIdAll.retainAll(department); + break; + default: + break; + } + } + } + } + + /** + * 判断审批的初始人 + */ + public void upOperator(FlowTaskOperatorEntity operatorEntity, List operatorList, Set operatorIdList) { + List collect = operatorList.stream().filter(t -> t.getId().equals(operatorEntity.getParentId())).collect(Collectors.toList()); + for (FlowTaskOperatorEntity entity : collect) { + upOperator(entity, operatorList, operatorIdList); + } + if (FlowNature.ParentId.equals(operatorEntity.getParentId())) { + operatorIdList.add(operatorEntity.getSortCode() + 1); + } + } + + /** + * 获取流程版本 + * + * @param id + * @return + * @throws WorkFlowException + */ + public FlowTemplateAllModel templateJson(String id) throws WorkFlowException { + FlowTemplateJsonEntity templateJson = flowTemplateJsonService.getInfo(id); + FlowTemplateEntity template = flowTemplateService.getInfo(templateJson.getTemplateId()); + List templateJsonList = ImmutableList.of(templateJson); + FlowTemplateAllModel model = new FlowTemplateAllModel(); + model.setTemplate(template); + model.setTemplateJson(templateJson); + model.setTemplateJsonList(templateJsonList); + return model; + } + + /** + * 保存、更新数据 + */ + public Map createOrUpdate(FlowDataModel flowDataModel) throws WorkFlowException { + ChildNodeList childNodeList = flowDataModel.getChildNodeList(); + List taskNodeList = flowDataModel.getTaskNodeList(); + FlowModel flowModel = flowDataModel.getFlowModel(); + boolean voluntarily = flowModel.getVoluntarily(); + boolean isAssign = flowDataModel.getIsAssig(); + boolean isData = flowDataModel.getIsData(); + Map formData = flowModel.getFormData(); + Map data = new HashMap<>(); + Map> allData = FlowContextHolder.getAllData(); + //保存数据的表单 + Properties properties = childNodeList.getProperties(); + Custom custom = childNodeList.getCustom(); + String formId = properties.getFormId(); + String flowId = properties.getFlowId(); + String taskId = childNodeList.getTaskId(); + List handleStatus = ImmutableList.of(FlowRecordEnum.audit.getCode(), FlowRecordEnum.submit.getCode()); + //递归 + List nodeIdList = new ArrayList<>(); + prevNodeList(taskNodeList, childNodeList, nodeIdList); + List list = flowTaskOperatorRecordService.getRecordList(taskId, handleStatus).stream().filter(t -> nodeIdList.contains(t.getNodeCode())).sorted(Comparator.comparing(FlowTaskOperatorRecordEntity::getHandleTime).reversed()).collect(Collectors.toList()); + List recordNodeIdList = new ArrayList<>(); + for (int i = 0; i < list.size(); i++) { + if (i == 0) { + recordNodeIdList.add(list.get(i).getNodeCode()); + } + } + List taskNodeEntity = taskNodeList.stream().filter(t -> nodeIdList.contains(t.getNodeCode()) && FlowNodeEnum.Process.getCode().equals(t.getCompletion())).collect(Collectors.toList()); + if (taskNodeEntity.size() == 0) { + taskNodeEntity.addAll(taskNodeList.stream().filter(t -> recordNodeIdList.contains(t.getNodeCode())).collect(Collectors.toList())); + } + String taskNodeFormId = ""; + String nodeCode = ""; + if (taskNodeEntity.size() > 0) { + taskNodeFormId = taskNodeEntity.get(0).getFormId(); + nodeCode = taskNodeEntity.get(0).getNodeCode(); + } + if (StringUtil.isNotEmpty(taskNodeFormId) && isData) { + Map taskNodeData = infoData(taskNodeFormId, taskId); + allData.put(taskNodeFormId, taskNodeData); + if (FlowNature.NodeSubFlow.equals(childNodeList.getCustom().getType()) || voluntarily) { + if (FlowNature.NodeSubFlow.equals(childNodeList.getCustom().getType())) { + taskNodeData.put(FlowFormConstant.FLOWID, flowId); + } + formData.putAll(taskNodeData); + } + } + String resultNodeCode = nodeCode; + List assignList = properties.getAssignList().stream().filter(t -> t.getNodeId().equals(resultNodeCode)).collect(Collectors.toList()); + //获取当前表单 + Map thisNodeData = infoData(formId, taskId); + data.putAll(thisNodeData); +// formData.put(FlowFormConstant.ID,taskId); + data.putAll(formData(formData, assignList,taskId)); + List typeList = ImmutableList.of(FlowNature.EndRound, FlowNature.NodeSubFlow); + if (isAssign && !typeList.contains(custom.getType())) { + FlowContextHolder.addData(formId, data); + FlowContextHolder.addChildData(taskId, formId, data); + List> formOperates = formOperates(childNodeList); + FlowContextHolder.addFormOperates(taskId, formId, formOperates); + } + return data; + } + + /** + * 表单赋值 + */ + public Map formData(Map formData, List assignListAll,String taskId) { + Map result = new HashMap<>(formData); + Map oldData = new HashMap<>(formData); + for (FlowAssignModel flowAssignModel : assignListAll) { + List ruleList = flowAssignModel.getRuleList(); + for (RuleListModel assignMode : ruleList) { + //子表处理规则 + String parentField = assignMode.getParentField(); + String[] parentFieldList = parentField.split("-"); + String childField = assignMode.getChildField(); + String[] childFieldList = childField.split("-"); + Object childData = getSysParamData(oldData, parentField, taskId); + if (childFieldList.length > 1) { + List> childMapAll = new ArrayList<>(); + if (result.get(childFieldList[0]) instanceof List) { + List> childList = (List>) result.get(childFieldList[0]); + for (Map objectMap : childList) { + Map childMap = new HashMap<>(objectMap); + childMapAll.add(childMap); + } + } + if (parentFieldList.length > 1) { + if (oldData.get(parentFieldList[0]) instanceof List) { + List> parentList = (List>) oldData.get(parentFieldList[0]); + int num = parentList.size() - childMapAll.size(); + for (int i = 0; i < num; i++) { + childMapAll.add(new HashMap<>()); + } + for (int i = 0; i < parentList.size(); i++) { + Map parentMap = parentList.get(i); + Map childMap = childMapAll.get(i); + childMap.put(childFieldList[1], parentMap.get(parentFieldList[1])); + } + } + } else { + if (1 > childMapAll.size()) { + childMapAll.add(new HashMap<>()); + } + Map childMap = childMapAll.get(0); + childMap.put(childFieldList[1], childData); + } + result.put(childFieldList[0], childMapAll); + } else { + if (parentFieldList.length > 1) { + if (oldData.get(parentFieldList[0]) instanceof List) { + List> parentList = (List>) oldData.get(parentFieldList[0]); + for (int i = 0; i < parentList.size(); i++) { + Map parentMap = parentList.get(i); + if (i == 0) { + childData = parentMap.get(parentFieldList[1]); + } + } + } + } + result.put(childField, childData); + } + } + } + return result; + } + + /** + * 处理表单值传递 + * + * @param taskNodeId + * @param taskNodeListAll + */ + public void dataAssignment(String taskNodeId, List taskNodeListAll, FlowModel flowModel) throws WorkFlowException { + Set rejectNodeList = new HashSet<>(); + List rejectList = new ArrayList() {{ + add(taskNodeId); + }}; + upAll(rejectNodeList, rejectList, taskNodeListAll); + for (FlowTaskNodeEntity entity : taskNodeListAll) { + if (rejectNodeList.contains(entity.getId()) && FlowNature.AuditCompletion.equals(entity.getCompletion())) { + ChildNodeList childNode = JsonUtil.getJsonToBean(entity.getNodePropertyJson(), ChildNodeList.class); + FlowDataModel flowDataModel = new FlowDataModel(childNode, taskNodeListAll, flowModel, true, true); + createOrUpdate(flowDataModel); + } + } + } + + /** + * 查询表单值 + * + * @return + */ + public Map infoData(String formId, String taskId) throws WorkFlowException { + Map> allData = FlowContextHolder.getAllData(); + Map dataAll = allData.get(formId) != null ? allData.get(formId) : serviceUtil.infoData(formId, taskId); + return dataAll; + } + + /** + * 获取上级节点 + * + * @param taskNodeList + * @param childNodeList + * @param nodeList + * @return + */ + public void prevNodeList(List taskNodeList, ChildNodeList childNodeList, List nodeList) { + List nodeIdList = new ArrayList() {{ + add(childNodeList.getTaskNodeId()); + }}; + Set rejectNodeList = new HashSet<>(); + upNodeList(taskNodeList, nodeIdList, rejectNodeList, null); + nodeList.addAll(rejectNodeList.stream().map(FlowTaskNodeEntity::getNodeCode).collect(Collectors.toList())); + } + + /** + * 流程挂起和恢复 + */ + /** + * @param idList + * @param isSuspend true 挂起 false 恢复 + */ + public List suspend(List idList, boolean isSuspend, String id) { + List orderStaList = flowTaskService.getOrderStaList(idList); + List operatorList = new ArrayList<>(); + for (FlowTaskEntity flowTaskEntity : orderStaList) { + if (isSuspend) { + flowTaskEntity.setSuspend(!FlowTaskStatusEnum.Suspend.getCode().equals(flowTaskEntity.getStatus()) ? flowTaskEntity.getStatus() : flowTaskEntity.getSuspend()); + flowTaskEntity.setStatus(FlowTaskStatusEnum.Suspend.getCode()); + flowTaskEntity.setFrestore(flowTaskEntity.getId().equals(id) ? 0 : 1); + } else { + flowTaskEntity.setStatus(ObjectUtil.isNotEmpty(flowTaskEntity.getSuspend()) ? flowTaskEntity.getSuspend() : flowTaskEntity.getStatus()); + flowTaskEntity.setSuspend(null); + flowTaskEntity.setFrestore(0); + } + flowTaskService.update(flowTaskEntity); + operatorList.addAll(flowTaskOperatorService.getList(flowTaskEntity.getId()).stream().filter(t -> FlowNodeEnum.Process.getCode().equals(t.getState())).collect(Collectors.toList())); + } + return operatorList; + } + + /** + * 判断任务是否在挂起状态 + * + * @param flowTask + */ + public void isSuspend(FlowTaskEntity flowTask) throws WorkFlowException { + Integer status = flowTask != null ? flowTask.getStatus() : null; + if (FlowTaskStatusEnum.Suspend.getCode().equals(status)) { + throw new WorkFlowException(MsgCode.WF048.get()); + } + } + + + /** + * 处理系统参数: + * + * @prevNodeFormId上节点表单id + */ + private Object getSysParamData(Map formData, String parentField,String taskId) { + Object data; + if (FlowConstant.PREV_NODE_FORM_ID.equals(parentField)) { + data = taskId; + } else { + data = formData.get(parentField); + } + return data; + } + + /** + * 保存流转记录 + */ + public void createRecord(FlowTaskOperatorRecordEntity operatorRecord) { + List allEvent = FlowContextHolder.getAllEvent(); + if (allEvent.size() == 0) { + flowTaskOperatorRecordService.create(operatorRecord); + } + } + + /** + * 终止方法 + * + * @param taskIdList + * @param flowModel + * @throws WorkFlowException + */ + public void taskCancel(List taskIdList, FlowModel flowModel) throws WorkFlowException { + flowTaskNewService.cancel(taskIdList, flowModel); + } + + /** + * 获取开始节点表单数据 + * + * @param flowTask + * @return + * @throws WorkFlowException + */ + public Map startData(FlowTemplateAllModel templateAllModel, FlowTaskEntity flowTask) throws WorkFlowException { + String flowTemplateJson = templateAllModel.getTemplateJson().getFlowTemplateJson(); + ChildNodeList nodeModel = JsonUtil.getJsonToBean(flowTemplateJson, ChildNodeList.class); + Map objectMap = serviceUtil.infoData(nodeModel.getProperties().getFormId(), flowTask.getId()); + return objectMap; + } + + /** + * 流程拒绝修改节点和数据 + */ + public List flowUp(FlowUpModel flowUpModel) throws WorkFlowException { + Boolean isReject = flowUpModel.getIsReject(); + FlowTaskEntity flowTask = flowUpModel.getFlowTask(); + List taskNodeList = flowUpModel.getTaskNodeList(); + FlowTaskNodeEntity taskNode = flowUpModel.getTaskNode(); + Boolean rejectType = flowUpModel.getRejectType(); + FlowModel flowModel = flowUpModel.getFlowModel(); + Boolean isAudit = flowUpModel.getIsAudit(); + List upAll = new ArrayList<>(); + if (isReject) { + Set thisStepAll = new HashSet<>(); + String[] thisStepId = flowTask.getThisStepId().split(","); + upAll.addAll(isUpAll(taskNodeList, taskNode, isReject, thisStepAll, thisStepId)); + boolean isStart = upAll.stream().filter(t -> FlowNature.NodeStart.equals(t.getNodeType())).count() > 0; + List rejectList = upAll.stream().map(FlowTaskNodeEntity::getId).collect(Collectors.toList()); + List rejectNodeListAll = new ArrayList<>(); + List stepIdList = new ArrayList<>(); + List stepNameList = new ArrayList<>(); + List progressList = new ArrayList<>(); + for (FlowTaskNodeEntity taskNodes : thisStepAll) { + ChildNodeList childNode = JsonUtil.getJsonToBean(taskNodes.getNodePropertyJson(), ChildNodeList.class); + Properties properties = childNode.getProperties(); + Integer progress = properties.getProgress(); + if (ObjectUtil.isNotEmpty(progress)) { + progressList.add(progress); + } + stepIdList.add(taskNodes.getNodeCode()); + stepNameList.add(taskNodes.getNodeName()); + } + if (progressList.size() == 0 || isStart) { + progressList.add(FlowNature.ProcessCompletion); + } + Set rejectNodeList = new HashSet<>(); + Collections.sort(progressList); + flowTask.setCompletion(progressList.get(0)); + flowTask.setThisStepId(String.join(",", stepIdList)); + flowTask.setThisStep(String.join(",", stepNameList)); + flowTask.setStatus(isStart ? isAudit ? FlowTaskStatusEnum.Draft.getCode() : FlowTaskStatusEnum.Reject.getCode() : FlowTaskStatusEnum.Handle.getCode()); + upAll(rejectNodeList, rejectList, taskNodeList, false); + flowTaskOperatorService.updateReject(flowTask.getId(), rejectNodeList); + flowOperatorUserService.updateReject(flowTask.getId(), rejectNodeList); + //驳回节点之后的状态修改 + if (isStart) { + flowTaskNodeService.update(flowTask.getId()); + } else { + flowTaskNodeService.updateCompletion(new ArrayList<>(rejectNodeList), FlowNature.ProcessCompletion); + } + flowTaskOperatorRecordService.updateStatus(rejectNodeList, flowTask.getId()); + rejectNodeListAll.addAll(taskNodeList.stream().filter(t -> rejectNodeList.contains(t.getId())).collect(Collectors.toList())); + //删除节点候选人 + List candidates = new ArrayList<>(); + rejectNodeList.removeAll(rejectList); + candidates.addAll(rejectNodeList); + if (rejectType) { + flowCandidatesService.deleteTaskNodeId(candidates); + flowTaskNodeService.updateTaskNodeCandidates(candidates, ""); + //终止子流程 + for (FlowTaskNodeEntity taskNodeEntity : rejectNodeListAll) { + ChildNodeList childNodeList = JsonUtil.getJsonToBean(taskNodeEntity.getNodePropertyJson(), ChildNodeList.class); + List taskIdList = new ArrayList<>(); + taskIdList.addAll(childNodeList.getCustom().getAsyncTaskList()); + taskIdList.addAll(childNodeList.getCustom().getTaskId()); + FlowModel cancelModel = new FlowModel(); + cancelModel.setUserInfo(flowModel.getUserInfo()); + taskCancel(taskIdList, cancelModel); + } + } + } + return upAll; + } + + /** + * 获取流程权限 + */ + public List> formOperates(ChildNodeList childNodeList) { + String taskId = childNodeList.getTaskId(); + String nodeCode = childNodeList.getCustom().getNodeId(); + List authorizeList = flowAuthorizeService.getList(taskId, nodeCode, FlowAuthorizeEntity::getFormOperate); + List> formOperateList = new ArrayList<>(); + for (FlowAuthorizeEntity entity : authorizeList) { + formOperateList.addAll(JsonUtil.getJsonToListMap(entity.getFormOperate())); + } + if (formOperateList.size() == 0) { + formOperateList.addAll(childNodeList.getProperties().getFormOperates()); + } + return formOperateList; + } + + /** + * 封装查询审批人 + */ + private List user(TaskOperator taskOperator, int type) throws WorkFlowException { + List userIdAll = new ArrayList<>(); + ChildNodeList childNode = taskOperator.getChildNode(); + Properties properties = childNode.getProperties(); + List taskNodeListAll = taskOperator.getTaskNodeList(); + FlowModel flowModel = taskOperator.getFlowModel(); + FlowTaskEntity taskEntity = taskOperator.getTaskEntity(); + String createUserId = taskEntity.getCreatorUserId(); + //发起者【部门主管】 + if (FlowTaskOperatorEnum.DepartmentCharge.getCode().equals(type)) { + FlowUserEntity taskInfo = flowUserService.getTaskInfo(childNode.getTaskId()); + if (taskInfo != null) { + OrganizeEntity organizeEntity = getManageOrgByLevel(taskInfo.getOrganizeId(), properties.getDepartmentLevel()); + if (organizeEntity != null) { + userIdAll.add(organizeEntity.getManagerId()); + } + } + } + //发起者【发起者主管】 + if (FlowTaskOperatorEnum.LaunchCharge.getCode().equals(type)) { + UserEntity info = serviceUtil.getUserInfo(createUserId); + if (info != null) { + userIdAll.add(getManagerByLevel(info.getManagerId(), properties.getManagerLevel())); + } + } + //【发起本人】 + if (FlowTaskOperatorEnum.InitiatorMe.getCode().equals(type)) { + userIdAll.add(createUserId); + } + //【变量】 + if (FlowTaskOperatorEnum.Variate.getCode().equals(type)) { + FlowDataModel flowDataModel = new FlowDataModel(childNode, taskNodeListAll, flowModel, false, true); + Map dataAll = createOrUpdate(flowDataModel); + Object data = dataAll.get(properties.getFormField()); + if (data != null) { + List list = new ArrayList<>(); + try { + list.addAll(JsonUtil.getJsonToList(String.valueOf(data), String.class)); + } catch (Exception e) { + + } + if (data instanceof List) { + list.addAll((List) data); + } else { + list.addAll(Arrays.asList(String.valueOf(data).split(","))); + } + List id = new ArrayList<>(); + for (String s : list) { + id.add(s.split("--")[0]); + } + List listByObjectIdAll = serviceUtil.getListByObjectIdAll(id); + List userPosition = listByObjectIdAll.stream().map(UserRelationEntity::getUserId).collect(Collectors.toList()); + List handleIdAll = new ArrayList<>(); + handleIdAll.addAll(userPosition); + handleIdAll.addAll(id); + userIdAll.addAll(handleIdAll); + } + } + //【环节】 + if (FlowTaskOperatorEnum.Tache.getCode().equals(type)) { + List operatorUserList = flowTaskOperatorRecordService.getList(taskEntity.getId()).stream().filter(t -> properties.getNodeId().equals(t.getNodeCode()) && FlowRecordEnum.audit.getCode().equals(t.getHandleStatus()) && FlowNodeEnum.Process.getCode().equals(t.getStatus())).collect(Collectors.toList()); + List handleId = operatorUserList.stream().map(FlowTaskOperatorRecordEntity::getHandleId).collect(Collectors.toList()); + userIdAll.addAll(handleId); + } + //【服务】 + if (FlowTaskOperatorEnum.Serve.getCode().equals(type)) { + FlowDataModel flowDataModel = new FlowDataModel(childNode, taskNodeListAll, flowModel, false, true); + Map dataAll = createOrUpdate(flowDataModel); + FuncConfig interfaceConfig = properties.getInterfaceConfig(); + String interfaceId = interfaceConfig.getInterfaceId(); + if (StringUtil.isNotEmpty(interfaceId)) { + UserInfo userInfo = UserProvider.getUser(); + List templateJsonModelList = interfaceConfig.getTemplateJson(); + FlowTaskOperatorRecordEntity record = new FlowTaskOperatorRecordEntity(); + record.setTaskId(taskEntity.getId()); + record.setTaskNodeId(childNode.getTaskNodeId()); + record.setHandleId(userInfo.getUserId()); + Map parameterMap = flowMsgUtil.parameterMap(dataAll, templateJsonModelList, record); + ActionResult result = serviceUtil.infoToId(interfaceId, parameterMap); + if (Objects.equals(200, result.getCode())) { + Object data = result.getData(); + if (data instanceof Map) { + JSONObject map = new JSONObject((Map) data); + List handleId = StringUtil.isNotEmpty(map.getString("handleId")) ? Arrays.asList(map.getString("handleId").split(",")) : new ArrayList<>(); + userIdAll.addAll(handleId); + } + } + } + } + //【候选人】 + if (FlowTaskOperatorEnum.Candidate.getCode().equals(type)) { + String nodeId = childNode.getTaskNodeId(); + List candidatesList = flowCandidatesService.getList(nodeId); + candidatesList.stream().forEach(t -> { + List candidates = StringUtil.isNotEmpty(t.getCandidates()) ? JsonUtil.getJsonToList(t.getCandidates(), String.class) : new ArrayList<>(); + userIdAll.addAll(candidates); + }); + } + //【指定人】 + if (FlowTaskOperatorEnum.Nominator.getCode().equals(type)) { + List list = new ArrayList<>(); + list.addAll(properties.getInitiator()); + list.addAll(properties.getApprovers()); + List handleIdAll = serviceUtil.getUserListAll(list); + userIdAll.addAll(handleIdAll); + } + return userIdAll; + } + + public FlowUserListModel getTaskUserList(String taskId) { + Set userIdSet = new HashSet<>(); + //发起人 + FlowTaskEntity flowTask = flowTaskService.getById(taskId); + if(flowTask != null) { + userIdSet.add(flowTask.getCreatorUserId()); + } + //审批人 + List operatorList = flowTaskOperatorService.getList(taskId); + if(operatorList != null && !operatorList.isEmpty()) { + List userIds = operatorList.stream().filter(t-> "0".equals(String.valueOf(t.getState())) || "1".equals(String.valueOf(t.getState()))).map(t-> t.getHandleId()).collect(Collectors.toList()); + userIdSet.addAll(userIds); + } + //依次审批人 +// List operatorUserList = flowOperatorUserService.getList(taskId); +// if(operatorUserList != null && !operatorUserList.isEmpty()) { +// List userIds = operatorUserList.stream().filter(t-> "0".equals(String.valueOf(t.getState()))).map(t-> t.getHandleId()).collect(Collectors.toList()); +// userIdSet.addAll(userIds); +// } + //抄送 + List circulateList = flowTaskCirculateService.getList(taskId); + if(circulateList != null && !circulateList.isEmpty()) { + List userIds = circulateList.stream().map(t-> t.getObjectId()).collect(Collectors.toList()); + userIdSet.addAll(userIds); + } + + //已办数据 + List operatorRecordList = flowTaskOperatorRecordService.getList(taskId); + if(operatorRecordList != null && !operatorRecordList.isEmpty()) { + List userIds = operatorRecordList.stream().map(t-> t.getHandleId()).collect(Collectors.toList()); + userIdSet.addAll(userIds); + } + + FlowUserListModel flowUserListModel = new FlowUserListModel(); + flowUserListModel.setAllUserIdList(userIdSet.stream().collect(Collectors.toList())); + flowUserListModel.setFlowTask(flowTask); + flowUserListModel.setOperatorList(operatorList); +// flowUserListModel.setOperatorUserList(operatorUserList); + flowUserListModel.setCirculateList(circulateList); + flowUserListModel.setOperatorRecordList(operatorRecordList); + return flowUserListModel; + } + + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/util/FlowTimerUtil.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/util/FlowTimerUtil.java new file mode 100644 index 0000000..7a6c883 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/engine/util/FlowTimerUtil.java @@ -0,0 +1,93 @@ +package com.yunzhupaas.engine.util; + +import com.yunzhupaas.engine.entity.FlowTaskEntity; +import com.yunzhupaas.engine.entity.FlowTaskNodeEntity; +import com.yunzhupaas.engine.entity.FlowTaskOperatorEntity; +import com.yunzhupaas.engine.model.flowengine.shuntjson.childnode.LimitModel; +import com.yunzhupaas.engine.model.flowengine.shuntjson.childnode.Properties; +import com.yunzhupaas.engine.model.flowengine.shuntjson.nodejson.ChildNodeList; +import com.yunzhupaas.engine.model.flowtime.FlowTimeModel; +import com.yunzhupaas.engine.service.FlowTaskNodeService; +import com.yunzhupaas.engine.service.FlowTaskOperatorService; +import com.yunzhupaas.engine.service.FlowTaskService; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.util.DateUtil; +import com.yunzhupaas.util.JsonUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/6/17 17:41 + */ +@Component +public class FlowTimerUtil { + + @Autowired + private FlowTaskNodeService flowTaskNodeService; + @Autowired + private FlowTaskService flowTaskService; + @Autowired + private FlowTaskOperatorService flowTaskOperatorService; + + + /** + * 限时开始时间 + */ + public FlowTimeModel time(FlowTaskNodeEntity taskNodeEntity, List nodeList + , FlowTaskEntity flowTaskEntity, FlowTaskOperatorEntity operatorInfo) throws WorkFlowException { + FlowTaskNodeEntity startNode = nodeList.stream().filter(t -> FlowNature.NodeStart.equals(t.getNodeType())).findFirst().orElse(null); + String nodeJson = startNode != null ? startNode.getNodePropertyJson() : "{}"; + ChildNodeList childNode = JsonUtil.getJsonToBean(taskNodeEntity.getNodePropertyJson(), ChildNodeList.class); + FlowTimeModel date = new FlowTimeModel(); + date.setChildNode(JsonUtil.getJsonToBean(nodeJson, ChildNodeList.class));//开始节点 + date.setChildNodeEvnet(childNode);//当前节点 + Date(operatorInfo, flowTaskEntity, date); + return date; + } + + + private void Date(FlowTaskOperatorEntity operatorInfo, FlowTaskEntity flowTaskEntity, FlowTimeModel flowTimeModel) throws WorkFlowException { + Properties taskProperties = flowTimeModel.getChildNodeEvnet().getProperties(); + LimitModel limitModel = taskProperties.getTimeLimitConfig(); + boolean isOn = limitModel.getOn() != 0; + if (limitModel.getOn() == 2) { + taskProperties = flowTimeModel.getChildNode().getProperties(); + limitModel = taskProperties.getTimeLimitConfig(); + } + Map data = JsonUtil.stringToMap(flowTaskEntity.getFlowFormContentJson()); + flowTimeModel.setOn(isOn); + if (isOn) { + Date date = null; + if (limitModel.getNodeLimit() == 0) { + date = operatorInfo.getCreatorTime(); + } else if (limitModel.getNodeLimit() == 1) { + date = flowTaskEntity.getCreatorTime(); + } else { + Object formData = data.get(limitModel.getFormField()); + try { + date = new Date((Long) formData); + } catch (Exception e) { + } + if (date == null) { + try { + date = DateUtil.stringToDate(String.valueOf(formData)); + } catch (Exception e) { + } + } + } + if (date == null) { + date = flowTaskEntity.getCreatorTime(); + } + flowTimeModel.setDate(date); + } + } + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/job/AutoApproveJob.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/job/AutoApproveJob.java new file mode 100644 index 0000000..5b255c8 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/job/AutoApproveJob.java @@ -0,0 +1,32 @@ +package com.yunzhupaas.job; + +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.scheduling.quartz.QuartzJobBean; + +/** + * 超时设置定时器 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/15 16:23 + */ +public class AutoApproveJob extends QuartzJobBean { + + public static final String autoApprove = "idgenerator_AutoApprove"; + + @Autowired + private WorkTimeoutJobUtil workTimeoutJobUtil; + @Autowired + private RedisTemplate redisTemplate; + + @Override + protected void executeInternal(JobExecutionContext context) throws JobExecutionException { + workTimeoutJobUtil.approveModel(redisTemplate); + } + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/job/JobConfig.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/job/JobConfig.java new file mode 100644 index 0000000..8461657 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/job/JobConfig.java @@ -0,0 +1,76 @@ +package com.yunzhupaas.job; + +import org.quartz.*; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * 流程设计 + * + * @author 云筑产品开发平台组 + * @version V3.3.0 flowable + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/1 17:27 + */ + +@Configuration +public class JobConfig { + @Bean + public JobDetail testJobDetail() { + JobDetail JobDetail = JobBuilder.newJob(WorkJobNew.class) + .storeDurably() //必须调用该方法,添加任务 + .build(); + + return JobDetail; + } + + @Bean + public Trigger testTrigger() { + CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule("0/10 * * * * ?"); //配置任务频率,测试环境10s正式环境修改成30s + Trigger trigger = TriggerBuilder.newTrigger() + .forJob(testJobDetail()) + .withSchedule(cronScheduleBuilder) //对触发器配置任务 + .build(); + return trigger; + } + + + @Bean + public JobDetail timeoutSettingJobDetail() { + JobDetail JobDetail = JobBuilder.newJob(TimeoutSettingJob.class) + .storeDurably() //必须调用该方法,添加任务 + .build(); + + return JobDetail; + } + + @Bean + public Trigger timeoutTrigger() { + CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule("0 0 * * * ?"); //配置任务频率,测试环境每分钟,正式环境修改成每小时0 0 * * * ? + Trigger trigger = TriggerBuilder.newTrigger() + .forJob(timeoutSettingJobDetail()) + .withSchedule(cronScheduleBuilder) //对触发器配置任务 + .build(); + return trigger; + } + + @Bean + public JobDetail autoApproveDetail() { + JobDetail JobDetail = JobBuilder.newJob(AutoApproveJob.class) + .storeDurably() //必须调用该方法,添加任务 + .build(); + + return JobDetail; + } + + @Bean + public Trigger autoApproveTrigger() { + CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule("0/5 * * * * ?"); //配置任务频率,测试环境每分钟,正式环境修改成每小时5 0 * * * ? + Trigger trigger = TriggerBuilder.newTrigger() + .forJob(autoApproveDetail()) + .withSchedule(cronScheduleBuilder) //对触发器配置任务 + .build(); + return trigger; + } +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/job/TimeoutSettingJob.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/job/TimeoutSettingJob.java new file mode 100644 index 0000000..41c7294 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/job/TimeoutSettingJob.java @@ -0,0 +1,46 @@ +package com.yunzhupaas.job; + +import com.yunzhupaas.engine.model.flowtask.WorkTimeoutJobModel; +import com.yunzhupaas.util.RedisUtil; +import org.quartz.DisallowConcurrentExecution; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.scheduling.quartz.QuartzJobBean; + +import java.util.List; +import java.util.concurrent.TimeUnit; + +/** + * 超时设置定时器 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/15 16:23 + */ +@DisallowConcurrentExecution +public class TimeoutSettingJob extends QuartzJobBean { + + @Autowired + private RedisUtil redisUtil; + @Autowired + private WorkTimeoutJobUtil workTimeoutJobUtil; + @Autowired + private + RedisTemplate redisTemplate; + + @Override + protected void executeInternal(JobExecutionContext context) throws JobExecutionException { + List listRedis = workTimeoutJobUtil.getListRedis(redisUtil); + for (WorkTimeoutJobModel entity : listRedis) { + boolean useSuccess = redisTemplate.opsForValue().setIfAbsent(WorkTimeoutJobUtil.WORKTIMEOUT_REDIS_KEY + "_key:" + entity.getTaskNodeOperatorId(), System.currentTimeMillis(), 300, TimeUnit.SECONDS); + if (!useSuccess || entity.isSuspend()) continue; + workTimeoutJobUtil.runTimeOutMethod(entity, true); + redisUtil.remove(WorkTimeoutJobUtil.WORKTIMEOUT_REDIS_KEY + "_key:" + entity.getTaskNodeOperatorId()); + } + } + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/job/WorkJobNew.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/job/WorkJobNew.java new file mode 100644 index 0000000..5649446 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/job/WorkJobNew.java @@ -0,0 +1,101 @@ +package com.yunzhupaas.job; + +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.engine.entity.FlowTaskOperatorEntity; +import com.yunzhupaas.engine.model.flowmessage.FlowMsgModel; +import com.yunzhupaas.engine.model.flowtask.WorkJobModel; +import com.yunzhupaas.engine.util.FlowMsgUtil; +import com.yunzhupaas.util.RedisUtil; +import lombok.extern.slf4j.Slf4j; +import org.quartz.DisallowConcurrentExecution; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.scheduling.quartz.QuartzJobBean; + +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; + +/** + * 流程设计 + * + * @author 云筑产品开发平台组 + * @version V3.3.0 flowable + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/1 17:32 + */ +@Slf4j +@DisallowConcurrentExecution +public class WorkJobNew extends QuartzJobBean { + + @Autowired + private RedisUtil redisUtil; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private FlowMsgUtil flowMsgUtil; + @Autowired + private RedisTemplate redisTemplate; + + + @Override + protected void executeInternal(JobExecutionContext context) throws JobExecutionException { +// System.out.println("定时器"); +// List listRedis = WorkJobUtil.getListRedis(redisUtil); + Map listRedisTime = WorkJobUtil.getListRedisTime(redisUtil); + if (listRedisTime != null) { + try { + long time = System.currentTimeMillis(); +// runCode(listRedis, time); + //新逻辑,取key 时间缓存,如有延迟,则取延迟workJobModel对象缓存。 + for (String key : listRedisTime.keySet()) { + boolean useSuccess = redisTemplate.opsForValue().setIfAbsent(WorkJobUtil.REDIS_KEY + "_key:" + key, System.currentTimeMillis(), 300, TimeUnit.SECONDS); + if (!useSuccess) continue; + try { + boolean isNext = Long.valueOf(listRedisTime.get(key).toString()).longValue() < time; + if (isNext) { + WorkJobModel workJobModel = WorkJobUtil.getListRedisJson(redisUtil, key); + UserInfo userInfo = workJobModel.getUserInfo(); + FlowMsgModel flowMsgModel = workJobModel.getFlowMsgModel(); + if (configValueUtil.isMultiTenancy()) { + TenantDataSourceUtil.switchTenant(userInfo.getTenantId()); + } + flowMsgUtil.message(flowMsgModel); + redisUtil.removeHash(WorkJobUtil.REDIS_KEY, key); + redisUtil.removeHash(WorkJobUtil.REDIS_KEY + "_json", key); + } + } finally { + redisTemplate.delete(WorkJobUtil.REDIS_KEY + "_key:" + key); + } + } + } catch (Exception e) { + log.error("工作流调度报错:" + e.getMessage()); + } + } + } + + //旧逻辑 + private void runCode(List listRedis, long time) { + for (WorkJobModel workJobModel : listRedis) { + boolean useSuccess = redisTemplate.opsForValue().setIfAbsent(WorkJobUtil.REDIS_KEY + "_key:" + workJobModel.getTaskId(), System.currentTimeMillis(), 300, TimeUnit.SECONDS); + if (!useSuccess) continue; + List operatorList = workJobModel.getFlowMsgModel().getOperatorList(); +// System.out.println("每个对象:" + workJobModel); + boolean isNext = operatorList.stream().filter(t -> t.getCreatorTime().getTime() > time).count() == 0; + UserInfo userInfo = workJobModel.getUserInfo(); + FlowMsgModel flowMsgModel = workJobModel.getFlowMsgModel(); + if (configValueUtil.isMultiTenancy()) { + TenantDataSourceUtil.switchTenant(userInfo.getTenantId()); + } + if (isNext) { + redisUtil.removeHash(WorkJobUtil.REDIS_KEY, workJobModel.getTaskId()); + redisUtil.remove(WorkJobUtil.REDIS_KEY + "_key:" + workJobModel.getTaskId()); + } + } + } +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/job/WorkJobUtil.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/job/WorkJobUtil.java new file mode 100644 index 0000000..f8e8941 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/job/WorkJobUtil.java @@ -0,0 +1,135 @@ +package com.yunzhupaas.job; + +import com.alibaba.fastjson.JSONObject; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.engine.entity.FlowTaskOperatorEntity; +import com.yunzhupaas.engine.model.flowmessage.FlowMsgModel; +import com.yunzhupaas.engine.model.flowtask.WorkJobModel; +import com.yunzhupaas.engine.util.FlowMsgUtil; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.RedisUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 流程定时器工具类 + * + * @author 云筑产品开发平台组 + * @version V3.3.0 flowable + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/2 9:04 + */ +@Component +public class WorkJobUtil { + /** + * 缓存key + */ + public static final String REDIS_KEY = "idgenerator_WorkJobNew"; + + private static FlowMsgUtil flowMsgUtil; + + /** + * 将数据放入缓存 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/2 + */ + public static void insertRedis(WorkJobModel workJobModel, RedisUtil redisUtil) { + JSONObject json = new JSONObject(); + json.put("taskId", workJobModel.getTaskId()); + json.put("flowMsgModel", JsonUtil.getObjectToString(workJobModel.getFlowMsgModel())); + json.put("userInfo", JsonUtil.getObjectToString(workJobModel.getUserInfo())); + + List operatorList = workJobModel.getFlowMsgModel().getOperatorList(); + if (operatorList.isEmpty()) { + return; + } + long time = System.currentTimeMillis(); + boolean isNext = operatorList.stream().filter(t -> t.getCreatorTime().getTime() > time).count() > 0; + if (isNext) { + Map> operatorMap = operatorList.stream().collect(Collectors.groupingBy(FlowTaskOperatorEntity::getTaskNodeId)); + for (String key : operatorMap.keySet()) { + redisUtil.insertHash(REDIS_KEY, workJobModel.getTaskId() + key, String.valueOf(operatorMap.get(key).get(0).getCreatorTime().getTime())); + redisUtil.insertHash(REDIS_KEY + "_json", workJobModel.getTaskId() + key, json.toJSONString()); + } + + } else { + try { + flowMsgUtil.message(workJobModel.getFlowMsgModel()); + } catch (Exception e) { + } + } + } + + /** + * 定时器取用数据调用创建方法 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/2 + */ + public static List getListRedis(RedisUtil redisUtil) { + List list = new ArrayList<>(); + if (redisUtil.exists(REDIS_KEY)) { + Map map = redisUtil.getMap(REDIS_KEY); + for (Object object : map.keySet()) { + if (map.get(object) instanceof String) { + Map jsonMap = JsonUtil.stringToMap(String.valueOf(map.get(object))); + String taskId = jsonMap.get("taskId").toString(); + FlowMsgModel flowMsgModel = JsonUtil.getJsonToBean(jsonMap.get("flowMsgModel").toString(), FlowMsgModel.class); + UserInfo userInfo = JsonUtil.getJsonToBean(jsonMap.get("userInfo").toString(), UserInfo.class); + list.add(new WorkJobModel(taskId, flowMsgModel, userInfo)); + } + } + } + return list; + } + + /** + * 定时器取用数据调用创建方法 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/2 + */ + public static Map getListRedisTime(RedisUtil redisUtil) { + Map map = null; + if (redisUtil.exists(REDIS_KEY)) { + map = redisUtil.getMap(REDIS_KEY); + } + return map; + } + + /** + * 获取缓存信息 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/2 + */ + public static WorkJobModel getListRedisJson(RedisUtil redisUtil, String key) { + String hashValues = redisUtil.getHashValues(REDIS_KEY + "_json", key); + Map jsonMap = JsonUtil.stringToMap(String.valueOf(hashValues)); + String taskId = jsonMap.get("taskId").toString(); + FlowMsgModel flowMsgModel = JsonUtil.getJsonToBean(jsonMap.get("flowMsgModel").toString(), FlowMsgModel.class); + UserInfo userInfo = JsonUtil.getJsonToBean(jsonMap.get("userInfo").toString(), UserInfo.class); + return new WorkJobModel(taskId, flowMsgModel, userInfo); + } + + @Autowired + public void setFlowMsgUtil(FlowMsgUtil flowMsgUtil) { + WorkJobUtil.flowMsgUtil = flowMsgUtil; + } + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/job/WorkTimeoutJobUtil.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/job/WorkTimeoutJobUtil.java new file mode 100644 index 0000000..2987829 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/job/WorkTimeoutJobUtil.java @@ -0,0 +1,679 @@ +package com.yunzhupaas.job; + +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.database.util.TenantDataSourceUtil; +import com.yunzhupaas.engine.entity.FlowTaskEntity; +import com.yunzhupaas.engine.entity.FlowTaskNodeEntity; +import com.yunzhupaas.engine.entity.FlowTaskOperatorEntity; +import com.yunzhupaas.engine.entity.FlowTaskOperatorRecordEntity; +import com.yunzhupaas.engine.enums.FlowNodeEnum; +import com.yunzhupaas.engine.enums.FlowTaskStatusEnum; +import com.yunzhupaas.engine.model.flowbefore.FlowTemplateAllModel; +import com.yunzhupaas.engine.model.flowengine.FlowModel; +import com.yunzhupaas.engine.model.flowengine.shuntjson.childnode.LimitModel; +import com.yunzhupaas.engine.model.flowengine.shuntjson.childnode.Properties; +import com.yunzhupaas.engine.model.flowengine.shuntjson.childnode.TimeModel; +import com.yunzhupaas.engine.model.flowmessage.FlowMsgModel; +import com.yunzhupaas.engine.model.flowtask.FlowApproveModel; +import com.yunzhupaas.engine.model.flowtask.WorkTimeoutJobModel; +import com.yunzhupaas.engine.model.flowtime.FlowTimeModel; +import com.yunzhupaas.engine.service.FlowTaskNewService; +import com.yunzhupaas.engine.service.FlowTaskNodeService; +import com.yunzhupaas.engine.service.FlowTaskOperatorService; +import com.yunzhupaas.engine.service.FlowTaskService; +import com.yunzhupaas.engine.util.FlowMsgUtil; +import com.yunzhupaas.engine.util.FlowNature; +import com.yunzhupaas.engine.util.FlowTaskUtil; +import com.yunzhupaas.engine.util.FlowTimerUtil; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.util.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.DependsOn; +import org.springframework.context.annotation.Lazy; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.scheduling.annotation.Async; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; +import org.springframework.stereotype.Component; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; + +/** + * 流程设计 + * + * @author 云筑产品开发平台组 + * @version V3.3.0 flowable + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/15 17:37 + */ +@Component +@Slf4j +@DependsOn("threadPoolTaskExecutor") +public class WorkTimeoutJobUtil { + /** + * 缓存key + */ + public static final String WORKTIMEOUT_REDIS_KEY = "idgenerator_WorkTimeout"; + public static Map> futureList = new HashMap<>(); + + public static Map userInfoMap = new HashMap<>(); + + @Autowired + public FlowMsgUtil flowMsgUtil; + @Autowired + public FlowTaskNodeService flowTaskNodeService; + @Lazy + @Autowired + public FlowTaskNewService flowTaskNewService; + //测试 + boolean testFlag = false; + @Autowired + private RedisUtil redisUtil; + @Autowired + private ConfigValueUtil configValueUtil; + @Autowired + private FlowTaskService flowTaskService; + @Autowired + private FlowTaskOperatorService flowTaskOperatorService; + @Autowired + private FlowTimerUtil flowTimerUtil; + @Autowired + private FlowTaskUtil flowTaskUtil; + + private static ScheduledThreadPoolExecutor scheduledThreadPoolExecutor = null; + + WorkTimeoutJobUtil(ThreadPoolTaskExecutor threadPoolTaskExecutor) { + if(scheduledThreadPoolExecutor == null) { + scheduledThreadPoolExecutor = new ScheduledThreadPoolExecutor(2, threadPoolTaskExecutor.getThreadPoolExecutor().getThreadFactory()); + } + } + + /** + * 将数据放入缓存 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/2 + */ + public void insertRedis(WorkTimeoutJobModel workTimeoutJobModel, RedisUtil redisUtil) { + insertRedis(workTimeoutJobModel, redisUtil, true); + } + + /** + * 将数据放入缓存 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/2 + */ + public void insertRedis(WorkTimeoutJobModel workTimeoutJobModel, RedisUtil redisUtil, boolean isRunTimeOut) { + workTimeoutJobModel.setCounter(0); + workTimeoutJobModel.setOvertimeNum(0); + String objectToString = JsonUtil.getObjectToString(workTimeoutJobModel); + redisUtil.insertHash(WORKTIMEOUT_REDIS_KEY, workTimeoutJobModel.getTaskNodeOperatorId(), objectToString); + if (isRunTimeOut) { + this.runTimeOutMethod(workTimeoutJobModel, false); + } + } + + /** + * 定时器取用数据调用创建方法 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/2 + */ + public List getListRedis(RedisUtil redisUtil) { + List list = new ArrayList<>(); + if (redisUtil.exists(WORKTIMEOUT_REDIS_KEY)) { + Map map = redisUtil.getMap(WORKTIMEOUT_REDIS_KEY); + for (Object object : map.keySet()) { + if (map.get(object) instanceof String) { + WorkTimeoutJobModel workTimeoutJobModel = JsonUtil.getJsonToBean(String.valueOf(map.get(object)), WorkTimeoutJobModel.class); + list.add(workTimeoutJobModel); + } + } + } + return list; + } + + /** + * 运行限时设置的内容。 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/7/25 + */ + public void runTimeOutMethod(WorkTimeoutJobModel entity, boolean isTimeTask) { + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH"); + if (testFlag) { + formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm"); + } + //切换数据库 + if (configValueUtil.isMultiTenancy()) { + TenantDataSourceUtil.switchTenant(entity.getTenantId()); + } + try { + FlowTaskOperatorEntity operatorInfo = flowTaskOperatorService.getOperatorInfo(entity.getTaskNodeOperatorId()); + if (operatorInfo == null || operatorInfo.getCompletion() != 0 || operatorInfo.getState() != 0) { + throw new WorkFlowException(MsgCode.WF064.get()); + } + Date realThisTime = DateUtil.stringToDate(DateUtil.getNow()); + Date thisTime = formatter.parse(DateUtil.getmmNow()); + FlowTaskEntity flowTask = flowTaskService.getInfo(entity.getTaskId()); + FlowTemplateAllModel templateAllModel = flowTaskUtil.templateJson(flowTask.getFlowId()); + List taskNodeList = flowTaskNodeService.getList(flowTask.getId()); + FlowTaskNodeEntity flowTaskNodeEntity = flowTaskNodeService.getInfo(entity.getTaskNodeId()); + + //节点属性 + FlowTimeModel flowTimeModel = flowTimerUtil.time(flowTaskNodeEntity, taskNodeList, flowTask, operatorInfo); + Properties approversThis = flowTimeModel.getChildNodeEvnet().getProperties(); + Properties approversStart = flowTimeModel.getChildNode().getProperties(); + LimitModel timeLimitConfig = approversThis.getTimeLimitConfig(); + if (timeLimitConfig.getOn() == 2) { + timeLimitConfig = approversStart.getTimeLimitConfig(); + } + TimeModel overTimeConfig = approversThis.getOverTimeConfig(); + if (overTimeConfig.getOn() == 2) { + overTimeConfig = approversStart.getOverTimeConfig(); + } + TimeModel noticeConfig = approversThis.getNoticeConfig(); + if (noticeConfig.getOn() == 2) { + noticeConfig = approversStart.getNoticeConfig(); + } + FlowModel flowModel = entity.getFlowModel(); + //限时设置 + if (timeLimitConfig.getOn() == 1) { + Date limitStartTime = formatter.parse(formatter.format(flowTimeModel.getDate())); + Date realStartTime = flowTimeModel.getDate(); + Long timeout = realStartTime.getTime() - limitStartTime.getTime(); + Integer limitedDuration = timeLimitConfig.getDuringDeal(); + Date limitEndTime = DateUtil.dateAddHours(limitStartTime, limitedDuration);//加限时时间 + if (testFlag) { + //以1分钟为准 + limitEndTime = DateUtil.dateAddMinutes(limitStartTime, limitedDuration);//加限时时间 + } + if (isTimeTask) {//砍掉尾数的定时器触发当前时间加上被砍掉的时间尾数,为本应该是触发定时器的时间 + realThisTime = DateUtil.dateAddSeconds(thisTime, timeout.intValue() / 1000); + } + //1.提醒设置 在限定时间范围内有效 + if (noticeConfig.getOn() == 1 && realThisTime.getTime() >= limitStartTime.getTime() + timeout && realThisTime.getTime() <= limitEndTime.getTime() + timeout) { + noticeMethod(entity, testFlag, thisTime, flowTask, templateAllModel, taskNodeList, flowTaskNodeEntity, flowTimeModel, noticeConfig, flowModel, limitStartTime, timeout, limitEndTime, isTimeTask, realThisTime); + } + //2.超时,在限时时长之后生效 + if (overTimeConfig.getOn() == 1 && realThisTime.getTime() >= limitEndTime.getTime() + timeout) { + timeoutMethod(entity, formatter, testFlag, thisTime, flowTask, templateAllModel, taskNodeList, flowTaskNodeEntity, operatorInfo, flowTimeModel, overTimeConfig, flowModel, timeout, limitEndTime, isTimeTask, realThisTime); + } + //判断是提交过来的,是否在1个小时范围内 + if (!isTimeTask) { + if (overTimeConfig.getOn() == 1 && realThisTime.getTime() >= limitStartTime.getTime() + timeout && realThisTime.getTime() <= limitEndTime.getTime() + timeout) { + timeout = limitEndTime.getTime() + timeout - System.currentTimeMillis(); + if (timeout < 3600000) { + isTimeTask = true; + timeoutMethod(entity, formatter, testFlag, thisTime, flowTask, templateAllModel, taskNodeList, flowTaskNodeEntity, operatorInfo, flowTimeModel, overTimeConfig, flowModel, timeout, limitEndTime, isTimeTask, realThisTime); + } + } + } + } + } catch (WorkFlowException we) { + we.printStackTrace(); + redisUtil.removeHash(this.WORKTIMEOUT_REDIS_KEY, entity.getTaskNodeOperatorId()); + redisUtil.removeHash(this.WORKTIMEOUT_REDIS_KEY, entity.getTaskNodeId()); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * 超时相关逻辑 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/8/10 + */ + private void timeoutMethod(WorkTimeoutJobModel entity, SimpleDateFormat formatter, boolean testFlag, Date thisTime, FlowTaskEntity flowTask, FlowTemplateAllModel templateAllModel, + List taskNodeList, FlowTaskNodeEntity flowTaskNodeEntity, FlowTaskOperatorEntity operatorInfo, + FlowTimeModel flowTimeModel, TimeModel overTimeConfig, FlowModel flowModel, long timeout, Date limitEndTime, boolean isTimeTask, Date realThisTime) throws ParseException { + Integer firstTimeout = overTimeConfig.getFirstOver(); + Integer timeoutInterval = overTimeConfig.getOverTimeDuring(); + Date timeoutStartTime = DateUtil.dateAddHours(limitEndTime, firstTimeout); + Long delayTime = 500l; + if (isTimeTask) { + delayTime = timeout; + } + if (testFlag) { + //以1分钟为单位进行测试超时测试,假设起始时间starTime=xxxx以startTimeTest替换给定 + timeoutStartTime = DateUtil.dateAddMinutes(limitEndTime, firstTimeout); + } + //当节点创建时间大于超时开始时间时,以节点创建时间为起始 +// if (operatorInfo.getCreatorTime().getTime() >= timeoutStartTime.getTime()) { +// String format = formatter.format(operatorInfo.getCreatorTime()); +// timeoutStartTime = formatter.parse(format); +// } + if (overTimeConfig.getOverTimeDuring() == 0) {//超时间隔=0只提醒一次 + if (thisTime.compareTo(timeoutStartTime) == 0) { + TimeModel finalOverTimeConfig = overTimeConfig; + Runnable resetExpire = () -> { + FlowTaskOperatorEntity operatorNow = null; + if (isTimeTask) { + operatorNow = onTimeCheckOperatorHave(entity, 1); + } else { + operatorNow = entity.getOperatorEntity(); + } + if (operatorNow == null) return; + //超时消息 + if (finalOverTimeConfig.getOverNotice()) { + List list = new ArrayList(); + list.add(operatorNow); + sendMessge(false, flowTask, templateAllModel, taskNodeList, flowTaskNodeEntity, list, flowModel); + } + //超时事件 + if (finalOverTimeConfig.getOverEvent() && finalOverTimeConfig.getOverEventTime() >= 1) { + sendEvent(entity, 7, flowTimeModel); + } + //超时自动审批 + if (finalOverTimeConfig.getOverAutoApprove() && finalOverTimeConfig.getOverAutoApproveTime() >= 1) { +// _log("超时任务: {}-自动审批", entity.getTaskNodeOperatorId()); + //自动审批 + autoApprove(operatorNow, taskNodeList, flowTask, flowModel); + } + redisUtil.removeHash(this.WORKTIMEOUT_REDIS_KEY, entity.getTaskNodeOperatorId());//超时提醒只有一次的时候完成就移除 + }; + this.runScheduleTask(resetExpire, delayTime, entity.getTaskNodeOperatorId()); + } + } else if (overTimeConfig.getOverTimeDuring() > 0) {//超时间隔>0 + //创建即触发超时 + if (!isTimeTask && entity.getOvertimeNum() == 0 && realThisTime.getTime() > timeoutStartTime.getTime() + timeout) { + Long bett = realThisTime.getTime() - timeoutStartTime.getTime() - timeout; + int finaConut = 0; + if (testFlag) { + finaConut = bett.intValue() / (60000 * timeoutInterval); + } else { + finaConut = bett.intValue() / (3600000 * timeoutInterval); + } +// _log("创建即超时次数:{}", finaConut); + if (overTimeConfig.getOverNotice()) { +// _log("超时任务: {}-创建即触发超时通知", entity.getTaskNodeOperatorId()); + List list = new ArrayList<>(); + list.add(entity.getOperatorEntity()); + sendMessge(false, flowTask, templateAllModel, taskNodeList, flowTaskNodeEntity, list, flowModel); + } + if (overTimeConfig.getOverEvent() && overTimeConfig.getOverEventTime() <= (finaConut + 1) && entity.getOvertimeNum() == 0) { + //接收到就已经超时多次,直接触发一次事件 +// _log("超时任务: {}-创建即触发进入超时事件", entity.getTaskNodeOperatorId()); + sendEvent(entity, 7, flowTimeModel); + } + if (overTimeConfig.getOverAutoApprove() && overTimeConfig.getOverAutoApproveTime() <= (finaConut + 1) && entity.getOvertimeNum() == 0) { +// _log("超时任务: {}-创建即触发超时自动审批", entity.getTaskNodeOperatorId()); + //自动审批 + autoApprove(entity.getOperatorEntity(), taskNodeList, flowTask, flowModel); + } + addNum(entity.getTaskNodeOperatorId(), 1);//有执行则次数加1 + } + int n = 0; + while (isTimeTask) { + Date whileTime = DateUtil.dateAddHours(timeoutStartTime, timeoutInterval * n); + if (testFlag) { + //以1分钟为单位进行测试超时测试,假设起始时间starTime=xxxx以startTimeTest替换给定 + whileTime = DateUtil.dateAddMinutes(timeoutStartTime, timeoutInterval * n); + } +// _log("超时任务: {}-第:{}次超时时间循环:{}", entity.getTaskNodeOperatorId(), (n + 1), DateUtil.dateFormat(whileTime)); + if (thisTime.compareTo(whileTime) == 0) { + int finalN = n; + TimeModel finalOverTimeConfig1 = overTimeConfig; + Runnable resetExpire = () -> { + FlowTaskOperatorEntity operatorNow = null; + if (isTimeTask) { + operatorNow = onTimeCheckOperatorHave(entity, 1); + } else { + operatorNow = entity.getOperatorEntity(); + } + if (operatorNow == null) return; + //todo 超时通知 + if (finalOverTimeConfig1.getOverNotice()) { +// _log("超时任务: {}-第{}次的超时通知", entity.getTaskNodeOperatorId(), (finalN + 1)); + List list = new ArrayList<>(); + list.add(operatorNow); + sendMessge(false, flowTask, templateAllModel, taskNodeList, flowTaskNodeEntity, list, flowModel); + } + //todo 超时事件 + if (finalOverTimeConfig1.getOverEvent() && finalOverTimeConfig1.getOverEventTime() == (finalN + 1)) { +// _log("超时任务: {}-第{}次进入超时事件", entity.getTaskNodeOperatorId(), (finalN + 1)); + //节点事件 + sendEvent(entity, 7, flowTimeModel); + } + //todo 超时自动审批 + if (finalOverTimeConfig1.getOverAutoApprove() && finalOverTimeConfig1.getOverAutoApproveTime() == (finalN + 1)) { +// _log("超时任务: {}-第{}次进入超时自动审批", entity.getTaskNodeOperatorId(), (finalN + 1)); + //自动审批 + autoApprove(operatorNow, taskNodeList, flowTask, flowModel); + } + addNum(entity.getTaskNodeOperatorId(), 1); + }; + this.runScheduleTask(resetExpire, delayTime, entity.getTaskNodeOperatorId()); + } + if (whileTime.after(thisTime)) { + break; + } + n++; + } + } + } + + /** + * 提醒方法执行内容 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/8/8 + */ + public void noticeMethod(WorkTimeoutJobModel entity, boolean testFlag, Date thisTime, FlowTaskEntity flowTask, FlowTemplateAllModel templateAllModel, + List taskNodeList, FlowTaskNodeEntity flowTaskNodeEntity, FlowTimeModel flowTimeModel, TimeModel noticeConfig, + FlowModel flowModel, Date limitStartTime, long timeout, Date limitEndTime, boolean isTimeTask, Date realThisTime) { + Integer firstWarnTime = noticeConfig.getFirstOver(); + Integer warnInterval = noticeConfig.getOverTimeDuring(); + Date warnStartTime = DateUtil.dateAddHours(limitStartTime, firstWarnTime); + Long delayTime = 0l; + if (isTimeTask) { + delayTime = timeout; + } + if (testFlag) { + warnStartTime = DateUtil.dateAddMinutes(limitStartTime, firstWarnTime); + } + if (noticeConfig.getOverTimeDuring() == 0) {//提醒间隔为0-只提醒一次 + if (thisTime.compareTo(warnStartTime) == 0) { + TimeModel finalNoticeConfig = noticeConfig; + Runnable resetExpire = () -> { + //待处理任务列表 + FlowTaskOperatorEntity operatorNow = null; + if (isTimeTask) { + operatorNow = onTimeCheckOperatorHave(entity, 0); + } else { + operatorNow = entity.getOperatorEntity(); + } + if (operatorNow == null) return; + if (finalNoticeConfig.getOverNotice()) { + List list = new ArrayList(); + list.add(operatorNow); + sendMessge(true, flowTask, templateAllModel, taskNodeList, flowTaskNodeEntity, list, flowModel); + } + if (finalNoticeConfig.getOverEvent() && finalNoticeConfig.getOverEventTime() >= 1) { + sendEvent(entity, 8, flowTimeModel); + } + addNum(entity.getTaskNodeOperatorId(), 0); + }; + this.runScheduleTask(resetExpire, delayTime, entity.getTaskNodeOperatorId()); + } + } else if (noticeConfig.getOverTimeDuring() > 0) {//提醒间隔大于0 + long noticeTimes = (limitEndTime.getTime() - warnStartTime.getTime()) / (warnInterval * 60 * 60 * 1000); + if (testFlag) { + noticeTimes = (limitEndTime.getTime() - warnStartTime.getTime()) / (warnInterval * 60 * 1000); + } + //限定时间在创建时间之前,有过几次时的提醒的情况(前面不管多少次只提醒一次) + if (!isTimeTask && entity.getCounter() == 0 && noticeConfig.getOverEventTime() > 0 && realThisTime.getTime() > warnStartTime.getTime() + timeout) { + if (noticeConfig.getOverNotice()) { +// _log("创建即出发提醒信息"); + List list = new ArrayList(); + list.add(entity.getOperatorEntity()); + sendMessge(true, flowTask, templateAllModel, taskNodeList, flowTaskNodeEntity, list, flowModel); + } + if (noticeConfig.getOverEvent()) { +// _log("创建即出发提醒事件"); + sendEvent(entity, 8, flowTimeModel); + } + addNum(entity.getTaskNodeOperatorId(), 0);//有执行则次数加1 + } + for (int n = 0; n <= noticeTimes; n++) { + Date whileTime = DateUtil.dateAddHours(warnStartTime, warnInterval * n); + if (testFlag) { + //假设以1分钟代替一个小时, + whileTime = DateUtil.dateAddMinutes(warnStartTime, warnInterval * n); + } +// _log("提醒任务: {}-第{}次提醒时间循环: {}", entity.getTaskNodeOperatorId(), (n + 1), DateUtil.dateFormat(whileTime)); + if (isTimeTask && thisTime.compareTo(whileTime) == 0) {//定时器提醒时间 + int finalN = n; + TimeModel finalNoticeConfig1 = noticeConfig; + Runnable resetExpire = () -> { + FlowTaskOperatorEntity operatorNow = null; + if (isTimeTask) { + operatorNow = onTimeCheckOperatorHave(entity, 0); + } else { + operatorNow = entity.getOperatorEntity(); + } + if (operatorNow == null) return; + //todo 提醒事件 + if (finalNoticeConfig1.getOverEvent() && finalNoticeConfig1.getOverEventTime() == (finalN + 1)) { +// _log("提醒任务: {}-第{}次进入提醒事件", entity.getTaskNodeOperatorId(), (finalN + 1)); + sendEvent(entity, 8, flowTimeModel); + } + //todo 提醒通知 + if (finalNoticeConfig1.getOverNotice()) { +// _log("提醒任务: {}-第{}次的提醒通知", entity.getTaskNodeOperatorId(), (finalN + 1)); + List list = new ArrayList(); + list.add(operatorNow); + sendMessge(true, flowTask, templateAllModel, taskNodeList, flowTaskNodeEntity, list, flowModel); + } + addNum(entity.getTaskNodeOperatorId(), 0); + }; + this.runScheduleTask(resetExpire, delayTime, entity.getTaskNodeOperatorId()); + } + } + } + } + + /** + * 自动审批 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/8/10 + */ + private void autoApprove(FlowTaskOperatorEntity operatorNow, List taskNodeList, FlowTaskEntity flowTask, FlowModel flowModel) { + operatorNow.setAutomation("1"); + FlowTaskEntity infoSubmit = flowTaskService.getInfoSubmit(flowTask.getId(), FlowTaskEntity::getStatus); + if (infoSubmit != null && !FlowTaskStatusEnum.Suspend.getCode().equals(infoSubmit.getStatus())) { + List list = new ArrayList<>(); + list.add(operatorNow); + FlowApproveModel approveModel = FlowApproveModel.builder().operatorList(list).taskNodeList(taskNodeList).flowTask(flowTask).flowModel(flowModel).build(); + flowTaskOperatorService.update(operatorNow); + userInfoMap.put(operatorNow.getTaskId(), approveModel); + } + } + + private FlowTaskOperatorEntity onTimeCheckOperatorHave(WorkTimeoutJobModel entity, Integer type) { + FlowTaskOperatorEntity operatorNow = flowTaskOperatorService.getOperatorInfo(entity.getTaskNodeOperatorId()); + if (operatorNow == null || operatorNow.getCompletion() != 0 || operatorNow.getState() != 0) { + removeTaskOperatorEntities(entity); + return null; + } + String hashValues = redisUtil.getHashValues(this.WORKTIMEOUT_REDIS_KEY, entity.getTaskNodeOperatorId()); + WorkTimeoutJobModel workTimeoutJobModel = JsonUtil.getJsonToBean(hashValues, WorkTimeoutJobModel.class); + if (workTimeoutJobModel == null) { + return null; + } + if (type == 1 && !entity.getOvertimeNum().equals(workTimeoutJobModel.getOvertimeNum())) {//判断redis被取用之后是否被改变,被改变这次不执行 + return null; + } + if (type == 0 && !entity.getCounter().equals(workTimeoutJobModel.getCounter())) {//判断redis被取用之后是否被改变,被改变这次不执行 + return null; + } + return operatorNow; + } + + + private void removeTaskOperatorEntities(WorkTimeoutJobModel entity) { + //已处理任务移除缓存 + redisUtil.removeHash(this.WORKTIMEOUT_REDIS_KEY, entity.getTaskNodeOperatorId()); + } + + /** + * 执行缓存次数加一 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/8/8 + */ + private void addNum(String operatorId, Integer type) { + //执行没有问题,缓存替换次数加一 type:0-提醒,1-超时 + String hashValues = redisUtil.getHashValues(WORKTIMEOUT_REDIS_KEY, operatorId); + WorkTimeoutJobModel entity = JsonUtil.getJsonToBean(hashValues, WorkTimeoutJobModel.class); + if (type == 0) { + Integer counter = entity.getCounter() == null ? 1 : entity.getCounter() + 1; + entity.setCounter(counter); + } else { + Integer overtimenum = entity.getOvertimeNum() == null ? 1 : entity.getOvertimeNum() + 1; + entity.setOvertimeNum(overtimenum); + } + String objectToString = JsonUtil.getObjectToString(entity); + redisUtil.insertHash(WORKTIMEOUT_REDIS_KEY, entity.getTaskNodeOperatorId(), objectToString); + } + + /** + * 发送事件 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/21 + */ + private void sendEvent(WorkTimeoutJobModel entity, int status, FlowTimeModel flowTimeModel) { +// _log("进入事件调用"); + //节点事件 + FlowTaskOperatorRecordEntity operatorRecord = new FlowTaskOperatorRecordEntity(); + operatorRecord.setTaskNodeId(entity.getTaskNodeId()); + operatorRecord.setTaskId(entity.getTaskId()); + FlowTaskEntity infoSubmit = flowTaskService.getInfoSubmit(entity.getTaskId(), FlowTaskEntity::getStatus); + if (infoSubmit != null && !FlowTaskStatusEnum.Suspend.getCode().equals(infoSubmit.getStatus())) { + UserInfo userInfo = entity.getFlowModel().getUserInfo(); + String token = AuthUtil.loginTempUser(userInfo.getUserId(), userInfo.getTenantId(), true); + userInfo = UserProvider.getUser(token); + UserProvider.setLocalLoginUser(userInfo); + flowMsgUtil.event(status, flowTimeModel.getChildNodeEvnet(), operatorRecord, entity.getFlowModel()); + } + } + + /** + * 发送消息 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/21 + */ + @Async + public void sendMessge(boolean isNotice, FlowTaskEntity flowTask, FlowTemplateAllModel templateAllModel, List taskNodeList, FlowTaskNodeEntity flowTaskNodeEntity, List list, FlowModel flowModel) { + //发送流程消息 + FlowMsgModel flowMsgModel = new FlowMsgModel(); + flowMsgModel.setWait(false); + if (isNotice) { + flowMsgModel.setNotice(true); + } else { + flowMsgModel.setOvertime(true); + } + flowMsgModel.setCirculateList(new ArrayList<>()); + flowMsgModel.setNodeList(taskNodeList); + flowMsgModel.setOperatorList(list); + flowMsgModel.setTaskEntity(flowTask); + flowMsgModel.setTaskNodeEntity(flowTaskNodeEntity); + flowMsgModel.setFlowTemplateAllModel(templateAllModel); + flowMsgModel.setData(JsonUtil.stringToMap(flowTask.getFlowFormContentJson())); + flowMsgModel.setFlowModel(flowModel); + FlowTaskEntity infoSubmit = flowTaskService.getInfoSubmit(flowTask.getId(), FlowTaskEntity::getStatus); + if (infoSubmit != null && !FlowTaskStatusEnum.Suspend.getCode().equals(infoSubmit.getStatus())) { + try { + flowMsgUtil.message(flowMsgModel); + } catch (Exception e) { + } + } + } + + private void runScheduleTask(Runnable runnable, long delayTime, String operatorId) { + ScheduledFuture schedule = scheduledThreadPoolExecutor.schedule(runnable, delayTime / 1000, TimeUnit.SECONDS); + addFuture(operatorId, schedule); + } + + private void _log(String msg, Object... args) { + if (log.isDebugEnabled()) { + log.debug(msg, args); + } + } + + private void addFuture(String operatorId, ScheduledFuture future) { + List scheduledFutures = futureList.get(operatorId) != null ? futureList.get(operatorId) : new ArrayList<>(); + scheduledFutures.add(future); + futureList.put(operatorId, scheduledFutures); + } + + /** + * @param operatorList + * @param isSuspend true 挂起 false 恢复 + */ + public void suspendFuture(List operatorList, boolean isSuspend) { + for (FlowTaskOperatorEntity entity : operatorList) { +// List scheduledFutures = futureList.get(entity.getId()) != null ? futureList.get(entity.getId()) : new ArrayList<>(); +// for (ScheduledFuture scheduledFuture : scheduledFutures) { +// scheduledFuture.cancel(true); +// } +// futureList.remove(entity.getId()); + String hashValues = redisUtil.getHashValues(WORKTIMEOUT_REDIS_KEY, entity.getId()); + if (StringUtil.isNotEmpty(hashValues)) { + WorkTimeoutJobModel workTimeoutJobModel = JsonUtil.getJsonToBean(hashValues, WorkTimeoutJobModel.class); + workTimeoutJobModel.setSuspend(isSuspend); + String objectToString = JsonUtil.getObjectToString(workTimeoutJobModel); + redisUtil.insertHash(WORKTIMEOUT_REDIS_KEY, workTimeoutJobModel.getTaskNodeOperatorId(), objectToString); + } + } + } + + public void approveModel(RedisTemplate redisTemplate) { + List idList = new ArrayList<>(); + for (String key : userInfoMap.keySet()) { + try { + boolean useSuccess = redisTemplate.opsForValue().setIfAbsent(AutoApproveJob.autoApprove + "_key:" + key, System.currentTimeMillis(), 300, TimeUnit.SECONDS); + if (!useSuccess) continue; + FlowApproveModel approveModel = userInfoMap.get(key); + UserInfo userInfo = approveModel.getFlowModel().getUserInfo(); + //切换数据库 + if (configValueUtil.isMultiTenancy()) { + TenantDataSourceUtil.switchTenant(userInfo.getTenantId()); + } + FlowTaskEntity taskEntity = flowTaskService.getInfo(key); + List list = flowTaskOperatorService.getList(key).stream().filter(t -> FlowNature.ProcessCompletion.equals(t.getCompletion()) && FlowNodeEnum.Process.getCode().equals(t.getState()) && "1".equals(t.getAutomation())).collect(Collectors.toList()); + approveModel.setOperatorList(list); + approveModel.setFlowTask(taskEntity); + flowTaskUtil.approve(approveModel); + FlowTaskEntity info = flowTaskService.getInfoSubmit(key, FlowTaskEntity::getStatus); + boolean isAdd = !FlowTaskStatusEnum.Handle.getCode().equals(info.getStatus()); + if (isAdd) { + idList.add(key); + } + } catch (Exception e) { + e.getMessage(); + } finally { + idList.add(key); + redisTemplate.delete(AutoApproveJob.autoApprove + "_key:" + key); + } + } + for (String key : idList) { + userInfoMap.remove(key); + } + } + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/util/ServiceAllUtil.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/util/ServiceAllUtil.java new file mode 100644 index 0000000..33f5101 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-biz/src/main/java/com/yunzhupaas/util/ServiceAllUtil.java @@ -0,0 +1,268 @@ +package com.yunzhupaas.util; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.base.entity.DataInterfaceEntity; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.entity.VisualdevEntity; +import com.yunzhupaas.base.model.flow.FlowFormDataModel; +import com.yunzhupaas.base.service.BillRuleService; +import com.yunzhupaas.base.service.DataInterfaceService; +import com.yunzhupaas.base.service.DictionaryDataService; +import com.yunzhupaas.base.util.SentMessageUtil; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.config.ConfigValueUtil; +import com.yunzhupaas.emnus.ModuleTypeEnum; +import com.yunzhupaas.engine.model.flowtemplate.FlowExportModel; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.message.model.SentMessageForm; +import com.yunzhupaas.message.service.SendMessageConfigService; +import com.yunzhupaas.permission.entity.*; +import com.yunzhupaas.permission.model.organizeadministrator.OrganizeAdministratorModel; +import com.yunzhupaas.permission.service.*; +import com.yunzhupaas.util.enums.DictionaryDataEnum; +import com.yunzhupaas.visual.service.VisualdevApi; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.*; +import java.util.stream.Collectors; + +import static com.yunzhupaas.util.Constants.ADMIN_KEY; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/4/9 13:28 + */ +@Component +@DS("") +public class ServiceAllUtil { + + + @Autowired + private DictionaryDataService dictionaryDataService; + @Autowired + private UserRelationService userRelationService; + @Autowired + private UserService userService; + @Autowired + private RoleService roleService; + @Autowired + private OrganizeService organizeService; + @Autowired + private OrganizeAdministratorService organizeAdministratorService; + @Autowired + private PositionService positionService; + @Autowired + private BillRuleService billRuleService; + @Autowired + private DataInterfaceService dataInterfaceService; + @Autowired + private SentMessageUtil sentMessageUtil; + @Autowired + private SendMessageConfigService sendMessageConfigService; + @Autowired + private DataFileExport fileExport; + @Autowired + private ConfigValueUtil configValueUtil; + + //--------------------------------数据字典------------------------------ + public List getDiList() { + List dictionList = dictionaryDataService.getListByTypeDataCode(DictionaryDataEnum.FLOWWOEK_ENGINE.getDictionaryTypeId()); + return dictionList; + } + + public List getDictionName(List id) { + List dictionList = dictionaryDataService.getDictionName(id); + return dictionList; + } + + //--------------------------------用户关系表------------------------------ + public List getListByUserIdAll(List id) { + List list = userRelationService.getListByUserIdAll(id).stream().filter(t -> StringUtil.isNotEmpty(t.getObjectId())).collect(Collectors.toList()); + return list; + } + + public List getListByObjectIdAll(List id) { + List list = userRelationService.getListByObjectIdAll(id); + return list; + } + + public String getAdmin() { + UserEntity admin = userService.getUserByAccount(ADMIN_KEY); + return admin.getId(); + } + + //--------------------------------用户------------------------------ + public List getUserName(List id) { + List list = getUserName(id, false); + return list; + } + + public List getListByManagerId(String managerId) { + List list = StringUtil.isNotEmpty(managerId) ? userService.getListByManagerId(managerId, null) : new ArrayList<>(); + return list; + } + + public List getUserName(List id, boolean enableMark) { + List list = userService.getUserName(id); + if (enableMark) list = list.stream().filter(t -> t.getEnabledMark() != 0).collect(Collectors.toList()); + return list; + } + + public List getUserName(List id, Pagination pagination) { + List list = userService.getUserName(id, pagination); + return list; + } + + public UserEntity getUserInfo(String id) { + UserEntity entity = null; + if (StringUtil.isNotEmpty(id)) { + entity = id.equalsIgnoreCase(ADMIN_KEY) ? userService.getUserByAccount(id) : userService.getInfo(id); + } + return entity; + } + + public List getUserListAll(List idList) { + List userIdList = userService.getUserIdList(idList, null); + return userIdList; + } + + public List getOrganizeUserList(String type) { + OrganizeAdministratorModel model = organizeAdministratorService.getOrganizeAdministratorList(); + Map> map = new HashMap<>(); + map.put("select", model.getSelectList()); + map.put("add", model.getAddList()); + map.put("delete", model.getDeleteList()); + map.put("edit", model.getEditList()); + List list = map.get(type) != null ? map.get(type) : new ArrayList<>(); + List userList = userRelationService.getListByObjectIdAll(list).stream().map(UserRelationEntity::getUserId).collect(Collectors.toList()); + return userList; + } + + //--------------------------------单据规则------------------------------ + + public void useBillNumber(String enCode) { + billRuleService.useBillNumber(enCode); + } + + //--------------------------------角色------------------------------ + public List getListByIds(List id) { + List list = roleService.getListByIds(id, null, false); + return list; + } + + //--------------------------------组织------------------------------ + public List getOrganizeName(List id) { + List list = organizeService.getOrganizeName(id); + return list; + } + + public OrganizeEntity getOrganizeInfo(String id) { + OrganizeEntity entity = StringUtil.isNotEmpty(id) ? organizeService.getInfo(id) : null; + return entity; + } + + public List getOrganizeId(String organizeId) { + List organizeList = new ArrayList<>(); + organizeService.getOrganizeId(organizeId, organizeList); + Collections.reverse(organizeList); + return organizeList; + } + + public List getDepartmentAll(String organizeId) { + List departmentAll = organizeService.getDepartmentAll(organizeId); + return departmentAll; + } + + //--------------------------------岗位------------------------------ + public List getPositionName(List id) { + List list = positionService.getPositionName(id, false); + return list; + } + + //--------------------------------远端------------------------------ + public ActionResult infoToId(String interId, Map parameterMap) { + return dataInterfaceService.infoToId(interId, null, parameterMap); + } + + public List getInterfaceList(List id) { + return dataInterfaceService.getList(id); + } + + //--------------------------------发送消息------------------------------ + public void sendMessage(List messageListAll) { + for (SentMessageForm messageForm : messageListAll) + if (messageForm.isSysMessage()) sentMessageUtil.sendMessage(messageForm); + } + + public void updateSendConfigUsed(String id, List idList) { + sendMessageConfigService.updateUsed(id, idList); + } + + public void sendDelegateMsg(List messageListAll) { + for (SentMessageForm messageForm : messageListAll) { + sentMessageUtil.sendDelegateMsg(messageForm); + } + } + + //------------------------------导出------------------------------- + public DownloadVO exportData(FlowExportModel model) { + DownloadVO downloadVO = fileExport.exportFile(model, configValueUtil.getTemporaryFilePath(), model.getFlowTemplate().getFullName(), ModuleTypeEnum.FLOW_FLOWENGINE.getTableName()); + return downloadVO; + } + + //------------------------------表单数据------------------------------- + public void createOrUpdate(FlowFormDataModel flowFormDataModel) throws WorkFlowException { + //todo 流程调用表单接口 +// formDataService.saveOrUpdate(flowFormDataModel); + } + + public Map infoData(String formId, String id) throws WorkFlowException { + //todo 流程调用表单接口 + Map dataAll = new HashMap<>(); +// if (StringUtil.isNotEmpty(formId) && StringUtil.isNotEmpty(id)) { +// Map info = new HashMap<>(); +// ActionResult result = formDataService.info(formId, id); +// if (result.getCode() != 200) { +// throw new WorkFlowException(result.getMsg()); +// } +// if (result.getData() instanceof Map) { +// info.putAll((Map) result.getData()); +// } +// dataAll.putAll(info); +// } + return dataAll; + } + + //------------------------------表单对象------------------------------- + public VisualdevEntity getForm(String id) { + //todo 流程调用表单接口 +// FlowFormEntity form = StringUtil.isNotEmpty(id) ? flowFormService.getById(id) : null; +// return form; + return null; + } + + public List getFlowIdList(String id) { +// List list = StringUtil.isNotEmpty(id) ? flowFormService.getFlowIdList(id) : new ArrayList<>(); +// return list; + return null; + } + + public void updateForm(VisualdevEntity entity) { +// flowFormService.updateForm(entity); + } + + public void formIdList(List formId, String tempJsonId) { +// flowFormRelationService.saveFlowIdByFormIds(tempJsonId, formId); + } + + public void deleteFormId(String tempJsonId) { +// flowFormRelationService.saveFlowIdByFormIds(tempJsonId, new ArrayList<>()); + } + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-controller/pom.xml b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-controller/pom.xml new file mode 100644 index 0000000..83fb2f5 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-controller/pom.xml @@ -0,0 +1,22 @@ + + + + yunzhupaas-workflow-engine + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-workflow-engine-controller + + + + com.yunzhupaas + yunzhupaas-workflow-engine-biz + ${project.version} + + + + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-controller/src/main/java/com/yunzhupaas/engine/controller/FlowBeforeController.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-controller/src/main/java/com/yunzhupaas/engine/controller/FlowBeforeController.java new file mode 100644 index 0000000..9e03d4e --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-controller/src/main/java/com/yunzhupaas/engine/controller/FlowBeforeController.java @@ -0,0 +1,806 @@ +package com.yunzhupaas.engine.controller; + +import com.google.common.collect.ImmutableList; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.constant.PermissionConst; +import com.yunzhupaas.engine.entity.*; +import com.yunzhupaas.engine.enums.FlowNodeEnum; +import com.yunzhupaas.engine.enums.FlowRecordEnum; +import com.yunzhupaas.engine.enums.FlowTaskStatusEnum; +import com.yunzhupaas.engine.model.flowbefore.*; +import com.yunzhupaas.engine.model.flowcandidate.FlowCandidateUserModel; +import com.yunzhupaas.engine.model.flowcandidate.FlowCandidateVO; +import com.yunzhupaas.engine.model.flowcandidate.FlowRejectVO; +import com.yunzhupaas.engine.model.flowengine.FlowModel; +import com.yunzhupaas.engine.model.flowengine.shuntjson.childnode.ChildNode; +import com.yunzhupaas.engine.model.flowengine.shuntjson.nodejson.ChildNodeList; +import com.yunzhupaas.engine.model.flowengine.shuntjson.nodejson.ConditionList; +import com.yunzhupaas.engine.model.flowtask.FlowTaskListModel; +import com.yunzhupaas.engine.model.flowtask.PaginationFlowTask; +import com.yunzhupaas.engine.model.flowtask.TaskNodeModel; +import com.yunzhupaas.engine.model.flowtasknode.TaskNodeListModel; +import com.yunzhupaas.engine.service.*; +import com.yunzhupaas.engine.util.FlowJsonUtil; +import com.yunzhupaas.engine.util.FlowNature; +import com.yunzhupaas.engine.util.FlowTaskUtil; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.entity.UserRelationEntity; +import com.yunzhupaas.permission.model.user.UserIdListVo; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.ServiceAllUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 待我审核 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Tag(name = "待我审核", description = "FlowBefore") +@RestController +@RequestMapping("/api/workflow1/Engine/FlowBefore") +public class FlowBeforeController { + + + @Autowired + private ServiceAllUtil serviceUtil; + + @Autowired + private FlowTaskUtil flowTaskUtil; + @Autowired + private FlowTaskService flowTaskService; + @Autowired + private FlowTemplateJsonService flowTemplateJsonService; + @Autowired + private FlowTaskOperatorService flowTaskOperatorService; + @Autowired + private FlowTaskOperatorRecordService flowTaskOperatorRecordService; + @Autowired + private FlowTaskNodeService flowTaskNodeService; + @Autowired + private FlowTaskNewService flowTaskNewService; + @Autowired + private FlowOperatorUserService flowOperatorUserService; + @Autowired + private FlowTaskCirculateService flowTaskCirculateService; + @Autowired + private UserService userService; + + /** + * 获取待我审核列表 + * + * @param category 分类 + * @param paginationFlowTask 分页模型 + * @return + */ + @Operation(summary = "获取待我审核列表(有带分页),1-待办事宜,2-已办事宜,3-抄送事宜,4-批量审批") + @GetMapping("/List/{category}") + @Parameters({ + @Parameter(name = "category", description = "分类", required = true), + }) + public ActionResult> list(@PathVariable("category") String category, PaginationFlowTask paginationFlowTask) { + List data = new ArrayList<>(); + paginationFlowTask.setDelegateType(true); + if (FlowNature.WAIT.equals(category)) { + data.addAll(flowTaskService.getWaitList(paginationFlowTask)); + } else if (FlowNature.TRIAL.equals(category)) { + data.addAll(flowTaskService.getTrialList(paginationFlowTask)); + } else if (FlowNature.CIRCULATE.equals(category)) { + data.addAll(flowTaskService.getCirculateList(paginationFlowTask)); + } else if (FlowNature.BATCH.equals(category)) { + paginationFlowTask.setIsBatch(1); + data.addAll(flowTaskService.getWaitList(paginationFlowTask)); + } + List listVO = new LinkedList<>(); + List userList = serviceUtil.getUserName(data.stream().map(FlowTaskListModel::getCreatorUserId).collect(Collectors.toList())); + boolean isBatch = FlowNature.BATCH.equals(category); + List taskNodeList = new ArrayList<>(); + List taskNodeIdList = data.stream().map(FlowTaskListModel::getThisStepId).collect(Collectors.toList()); + if (isBatch) { + taskNodeList.addAll(flowTaskNodeService.getList(taskNodeIdList, FlowTaskNodeEntity::getId, FlowTaskNodeEntity::getNodePropertyJson)); + } + for (FlowTaskListModel task : data) { + FlowBeforeListVO vo = JsonUtil.getJsonToBean(task, FlowBeforeListVO.class); + //用户名称赋值 + UserEntity user = userList.stream().filter(t -> t.getId().equals(vo.getCreatorUserId())).findFirst().orElse(null); + vo.setUserName(user != null ? user.getRealName() + "/" + user.getAccount() : ""); + FlowTaskNodeEntity taskNode = taskNodeList.stream().filter(t -> t.getId().equals(task.getThisStepId())).findFirst().orElse(null); + if (isBatch && taskNode != null) { + ChildNodeList childNode = JsonUtil.getJsonToBean(taskNode.getNodePropertyJson(), ChildNodeList.class); + vo.setApproversProperties(JsonUtil.getObjectToString(childNode.getProperties())); + } + vo.setFlowVersion(StringUtil.isEmpty(vo.getFlowVersion()) ? "" : vo.getFlowVersion()); + listVO.add(vo); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(paginationFlowTask, PaginationVO.class); + return ActionResult.page(listVO, paginationVO); + } + + /** + * 获取待我审批信息 + * + * @param id 主键 + * @param flowModel 流程模型 + * @return + */ + @Operation(summary = "获取待我审批信息") + @GetMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult info(@PathVariable("id") String id, FlowModel flowModel) throws WorkFlowException { + flowModel.setId(id); + FlowBeforeInfoVO vo = flowTaskNewService.getBeforeInfo(flowModel); + //处理当前默认值 + if (vo != null && vo.getFlowFormInfo() != null && StringUtil.isNotEmpty(vo.getFlowFormInfo().getPropertyJson()) && vo.getFlowFormInfo().getFormType() == 2) { + UserInfo userInfo = UserProvider.getUser(); + Map havaDefaultCurrentValue = new HashMap<>(); + vo.getFlowFormInfo().setPropertyJson(setDefaultCurrentValue(vo.getFlowFormInfo().getPropertyJson(), havaDefaultCurrentValue, userInfo)); + } + return ActionResult.success(vo); + } + + /** + * 待我审核审核 + * + * @param id 主键 + * @param flowModel 流程模型 + * @return + */ + @Operation(summary = "待我审核审核") + @PostMapping("/Audit/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "flowModel", description = "流程模型", required = true), + }) + public ActionResult audit(@PathVariable("id") String id, @RequestBody FlowModel flowModel) throws WorkFlowException { + flowModel.setId(id); + flowTaskNewService.audit(flowModel); + return ActionResult.success(MsgCode.WF001.get()); + } + + /** + * 保存草稿 + * + * @param id 主键 + * @param flowModel 流程模型 + * @return + */ + @Operation(summary = "保存草稿") + @PostMapping("/SaveAudit/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "flowModel", description = "流程模型", required = true), + }) + public ActionResult saveAudit(@PathVariable("id") String id, @RequestBody FlowModel flowModel) throws WorkFlowException { + FlowTaskOperatorEntity flowTaskOperatorEntity = flowTaskOperatorService.getInfo(id); + if (flowTaskOperatorEntity != null) { + Map formDataAll = flowModel.getFormData(); + flowTaskOperatorEntity.setDraftData(JsonUtil.getObjectToString(formDataAll)); + flowTaskOperatorService.update(flowTaskOperatorEntity); + return ActionResult.success(MsgCode.SU002.get()); + } + return ActionResult.fail(MsgCode.FA001.get()); + } + + /** + * 审批汇总 + * + * @param id 主键 + * @param category 类型 + * @param type 类型 + * @return + */ + @Operation(summary = "审批汇总") + @GetMapping("/RecordList/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult> recordList(@PathVariable("id") String id, String category, String type) { + List flowSummaries = flowTaskNewService.recordList(id, category, type); + return ActionResult.success(flowSummaries); + } + + /** + * 待我审核驳回 + * + * @param id 主键 + * @param flowModel 流程模型 + * @return + */ + @Operation(summary = "待我审核驳回") + @PostMapping("/Reject/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "flowModel", description = "流程模型", required = true), + }) + public ActionResult reject(@PathVariable("id") String id, @RequestBody FlowModel flowModel) throws WorkFlowException { + flowModel.setId(id); + flowTaskNewService.reject(flowModel); + return ActionResult.success(MsgCode.WF002.get()); + } + + /** + * 待我审核转办 + * + * @param id 主键 + * @param flowModel 流程模型 + * @return + */ + @Operation(summary = "待我审核转办") + @PostMapping("/Transfer/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "flowModel", description = "流程模型", required = true), + }) + public ActionResult transfer(@PathVariable("id") String id, @RequestBody FlowModel flowModel) throws WorkFlowException { + flowModel.setId(id); + flowTaskNewService.transfer(flowModel); + return ActionResult.success(MsgCode.WF003.get()); + } + + /** + * 待我审核转办 + * + * @param id 主键 + * @param flowModel 流程模型 + * @return + */ + @Operation(summary = "待我审核加签") + @PostMapping("/freeApprover/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "flowModel", description = "流程模型", required = true), + }) + public ActionResult freeApprover(@PathVariable("id") String id, @RequestBody FlowModel flowModel) throws WorkFlowException { + flowModel.setId(id); + flowTaskNewService.audit(flowModel); + return ActionResult.success(MsgCode.WF004.get()); + } + + /** + * 待我审核撤回审核 + * 注意:在撤销流程时要保证你的下一节点没有处理这条记录;如已处理则无法撤销流程。 + * + * @param id 主键 + * @param flowModel 流程模型 + * @return + */ + @Operation(summary = "待我审核撤回审核") + @PostMapping("/Recall/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "flowModel", description = "流程模型", required = true), + }) + public ActionResult recall(@PathVariable("id") String id, @RequestBody FlowModel flowModel) throws WorkFlowException { + FlowTaskOperatorRecordEntity operatorRecord = flowTaskOperatorRecordService.getInfo(id); + FlowTaskNodeEntity taskNode = flowTaskNodeService.getInfo(operatorRecord.getTaskNodeId(), FlowTaskNodeEntity::getId); + //拒绝不撤回 + if (FlowNature.ProcessCompletion.equals(operatorRecord.getHandleStatus())) { + throw new WorkFlowException(MsgCode.WF005.get()); + } + if (taskNode == null) { + return ActionResult.fail(MsgCode.WF006.get()); + } + if (FlowRecordEnum.swerve.getCode().equals(operatorRecord.getHandleStatus())) { + return ActionResult.fail(MsgCode.WF007.get()); + } + if (FlowRecordEnum.revoke.getCode().equals(operatorRecord.getStatus())) { + return ActionResult.fail(MsgCode.WF006.get()); + } + if (taskNode != null && !FlowRecordEnum.revoke.getCode().equals(operatorRecord.getStatus())) { + flowModel.setUserInfo(UserProvider.getUser()); + flowTaskNewService.recall(id, operatorRecord, flowModel); + } + return ActionResult.success(MsgCode.WF008.get()); + } + + /** + * 待我审核终止审核 + * + * @param id 主键 + * @param flowModel 流程模型 + * @return + */ + @Operation(summary = "待我审核终止审核") + @PostMapping("/Cancel/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "flowModel", description = "流程模型", required = true), + }) + public ActionResult cancel(@PathVariable("id") String id, @RequestBody FlowModel flowModel) throws WorkFlowException { + FlowTaskEntity entity = flowTaskService.getInfo(id, FlowTaskEntity::getFlowType); + if (entity != null) { + if (Objects.equals(entity.getFlowType(), 1)) { + return ActionResult.fail(MsgCode.WF009.get()); + } + flowModel.setUserInfo(UserProvider.getUser()); + List idList = ImmutableList.of(id); + flowTaskNewService.cancel(idList, flowModel); + return ActionResult.success(MsgCode.SU005.get()); + } + return ActionResult.fail(MsgCode.FA009.get()); + } + + /** + * 指派人 + * + * @param id 主键 + * @param flowModel 流程模型 + * @return + */ + @Operation(summary = "指派人") + @PostMapping("/Assign/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "flowModel", description = "流程模型", required = true), + }) + public ActionResult assign(@PathVariable("id") String id, @RequestBody FlowModel flowModel) throws WorkFlowException { + flowModel.setUserInfo(UserProvider.getUser()); + flowTaskNewService.assign(id, flowModel); + return ActionResult.success(MsgCode.WF010.get()); + } + + /** + * 获取候选人 + * + * @param id 主键 + * @param flowModel 流程模型 + * @return + */ + @Operation(summary = "获取候选人节点") + @PostMapping("/Candidates/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "flowModel", description = "流程模型", required = true), + }) + public ActionResult candidates(@PathVariable("id") String id, @RequestBody FlowModel flowModel) throws WorkFlowException { + flowModel.setUserInfo(UserProvider.getUser()); + FlowCandidateVO candidate = flowTaskNewService.candidates(id, flowModel, false); + return ActionResult.success(candidate); + } + + /** + * 获取候选人 + * + * @param id 主键 + * @param flowModel 流程模型 + * @return + */ + @Operation(summary = "获取候选人") + @PostMapping("/CandidateUser/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "flowModel", description = "流程模型", required = true), + }) + public ActionResult> candidateUser(@PathVariable("id") String id, @RequestBody FlowModel flowModel) throws WorkFlowException { + flowModel.setUserInfo(UserProvider.getUser()); + List candidate = flowTaskNewService.candidateUser(id, flowModel); + PaginationVO paginationVO = JsonUtil.getJsonToBean(flowModel, PaginationVO.class); + return ActionResult.page(candidate, paginationVO); + } + + /** + * 批量审批引擎 + * + * @return + */ + @Operation(summary = "批量审批引擎") + @GetMapping("/BatchFlowSelector") + public ActionResult> batchFlowSelector() { + List batchFlowList = flowTaskService.batchFlowSelector(); + return ActionResult.success(batchFlowList); + } + + /** + * 拒绝下拉框 + * + * @param id 主键 + * @return + */ + @Operation(summary = "拒绝下拉框") + @GetMapping("/RejectList/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult rejectList(@PathVariable("id") String id) throws WorkFlowException { + FlowRejectVO vo = flowTaskNewService.rejectList(id, false); + return ActionResult.success(vo); + } + + /** + * 引擎节点 + * + * @param id 主键 + * @return + * @throws WorkFlowException + */ + @Operation(summary = "引擎节点") + @GetMapping("/NodeSelector/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult> nodeSelector(@PathVariable("id") String id) throws WorkFlowException { + FlowTemplateAllModel template = flowTaskUtil.templateJson(id); + String templateJson = template.getTemplateJson().getFlowTemplateJson(); + List batchList = new ArrayList<>(); + ChildNode childNodeAll = JsonUtil.getJsonToBean(templateJson, ChildNode.class); + //获取流程节点 + List nodeListAll = new ArrayList<>(); + List conditionListAll = new ArrayList<>(); + //递归获取条件数据和节点数据 + FlowJsonUtil.getTemplateAll(childNodeAll, nodeListAll, conditionListAll); + List type = ImmutableList.of(FlowNature.NodeSubFlow, FlowNature.NodeStart); + for (ChildNodeList childNodeList : nodeListAll) { + if (!type.contains(childNodeList.getCustom().getType())) { + FlowBatchModel batchModel = new FlowBatchModel(); + batchModel.setFullName(childNodeList.getProperties().getTitle()); + batchModel.setId(childNodeList.getCustom().getNodeId()); + batchList.add(batchModel); + } + } + return ActionResult.success(batchList); + } + + /** + * 流程批量类型下拉 + * + * @param id 主键 + * @return + * @throws WorkFlowException + */ + @Operation(summary = "流程批量类型下拉") + @GetMapping("/BatchFlowJsonList/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult> batchFlowJsonList(@PathVariable("id") String id) { + List taskIdList = flowTaskOperatorService.getBatchList().stream().map(FlowTaskOperatorEntity::getTaskId).collect(Collectors.toList()); + List taskListAll = flowTaskService.getOrderStaList(taskIdList); + List flowIdList = taskListAll.stream().filter(t -> t.getTemplateId().equals(id)).map(FlowTaskEntity::getFlowId).collect(Collectors.toList()); + List templateJsonList = flowTemplateJsonService.getTemplateJsonList(flowIdList); + List listVO = new ArrayList<>(); + for (FlowTemplateJsonEntity entity : templateJsonList) { + FlowBatchModel vo = JsonUtil.getJsonToBean(entity, FlowBatchModel.class); + vo.setFullName(vo.getFullName() + "(v" + entity.getVersion() + ")"); + listVO.add(vo); + } + return ActionResult.success(listVO); + } + + /** + * 批量审批 + * + * @param flowModel 流程模型 + * @return + */ + @Operation(summary = "批量审批") + @PostMapping("/BatchOperation") + @Parameters({ + @Parameter(name = "flowModel", description = "流程模型", required = true), + }) + public ActionResult batchOperation(@RequestBody FlowModel flowModel) throws WorkFlowException { + flowModel.setUserInfo(UserProvider.getUser()); + flowTaskNewService.batch(flowModel); + return ActionResult.success(MsgCode.WF011.get()); + } + + /** + * 批量获取候选人 + * + * @param flowId 流程主键 + * @param taskOperatorId 代办主键 + * @return + * @throws WorkFlowException + */ + @Operation(summary = "批量获取候选人") + @GetMapping("/BatchCandidate") + public ActionResult batchCandidate(String flowId, String taskOperatorId) throws WorkFlowException { + FlowModel flowModel = new FlowModel(); + flowModel.setUserInfo(UserProvider.getUser()); + flowModel.setFlowId(flowId); + FlowCandidateVO candidate = flowTaskNewService.batchCandidates(flowId, taskOperatorId, flowModel); + return ActionResult.success(candidate); + } + + /** + * 消息跳转工作流 + * + * @param id 主键 + * @return + */ + @Operation(summary = "消息跳转工作流") + @GetMapping("/{id}/Info") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult taskOperatorId(@PathVariable("id") String id) throws WorkFlowException { + FlowTaskOperatorEntity operator = flowTaskOperatorService.getInfo(id); + FlowTaskEntity flowTask = flowTaskService.getInfo(operator.getTaskId()); + FlowModel flowModel = new FlowModel(); + flowModel.setUserInfo(UserProvider.getUser()); + flowTaskNewService.permissions(operator.getHandleId(), flowTask, operator, "", flowModel); + Map map = new HashMap<>(); + if (!FlowNature.ProcessCompletion.equals(operator.getCompletion())) { + map.put("isCheck", true); + } else { + map.put("isCheck", false); + } + return ActionResult.success(map); + } + + /** + * 节点下拉框 + * + * @param id 主键 + * @return + */ + @Operation(summary = "节点下拉框") + @GetMapping("/Selector/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult> selector(@PathVariable("id") String id) { + List nodetype = ImmutableList.of(FlowNature.NodeStart, FlowNature.NodeSubFlow, FlowNature.EndRound); + TaskNodeListModel nodeListModel = TaskNodeListModel.builder().id(id).state(FlowNodeEnum.Process.getCode()).build(); + List list = flowTaskNodeService.getList(nodeListModel, + FlowTaskNodeEntity::getId, FlowTaskNodeEntity::getCandidates, + FlowTaskNodeEntity::getCompletion, FlowTaskNodeEntity::getNodeType, + FlowTaskNodeEntity::getNodeNext, FlowTaskNodeEntity::getNodeName, + FlowTaskNodeEntity::getNodeCode, FlowTaskNodeEntity::getNodePropertyJson + ); + flowTaskUtil.nodeList(list); + list = list.stream().filter(t -> !nodetype.contains(t.getNodeType())).collect(Collectors.toList()); + List nodeList = JsonUtil.getJsonToList(list, TaskNodeModel.class); + return ActionResult.success(nodeList); + } + + /** + * 变更或者复活 + * + * @param flowModel 流程模型 + * @return + */ + @Operation(summary = "变更或者复活") + @PostMapping("/Change") + @Parameters({ + @Parameter(name = "flowModel", description = "流程模型", required = true), + }) + public ActionResult change(@RequestBody FlowModel flowModel) throws WorkFlowException { + FlowTaskEntity info = flowTaskService.getInfo(flowModel.getTaskId()); + if (FlowTaskStatusEnum.Revoke.getCode().equals(info.getStatus()) || FlowTaskStatusEnum.Cancel.getCode().equals(info.getStatus()) || FlowTaskStatusEnum.Draft.getCode().equals(info.getStatus())) { + throw new WorkFlowException(MsgCode.WF012.get()); + } + flowModel.setUserInfo(UserProvider.getUser()); + flowTaskNewService.change(flowModel); + String msg = flowModel.getResurgence() ? MsgCode.WF013.get() : MsgCode.WF014.get(); + return ActionResult.success(msg); + } + + /** + * 子流程数据 + * + * @param id 主键 + * @return + */ + @Operation(summary = "子流程数据") + @GetMapping("/SubFlowInfo/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult> subFlowInfo(@PathVariable("id") String id) throws WorkFlowException { + FlowTaskNodeEntity taskNode = flowTaskNodeService.getInfo(id, FlowTaskNodeEntity::getNodePropertyJson); + List listVO = new ArrayList<>(); + if (taskNode != null) { + ChildNodeList childNodeList = JsonUtil.getJsonToBean(taskNode.getNodePropertyJson(), ChildNodeList.class); + List flowTaskIdList = new ArrayList<>(); + flowTaskIdList.addAll(childNodeList.getCustom().getAsyncTaskList()); + flowTaskIdList.addAll(childNodeList.getCustom().getTaskId()); + for (String taskId : flowTaskIdList) { + FlowModel flowModel = new FlowModel(); + flowModel.setId(taskId); + FlowBeforeInfoVO vo = flowTaskNewService.getBeforeInfo(flowModel); + listVO.add(vo); + } + } + return ActionResult.success(listVO); + } + + /** + * 流程类型下拉 + * + * @param id 主键值 + * @return + */ + @Operation(summary = "流程类型下拉") + @GetMapping("/Suspend/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult suspend(@PathVariable("id") String id) { + List childList = flowTaskService.getChildList(id, FlowTaskEntity::getId, FlowTaskEntity::getIsAsync); + boolean isAsync = childList.stream().filter(t -> FlowNature.ChildAsync.equals(t.getIsAsync())).count() > 0; + return ActionResult.success(isAsync); + } + + /** + * 流程挂起 + * + * @param id 主键 + * @param flowModel 流程模型 + * @return + */ + @Operation(summary = "流程挂起") + @PostMapping("/Suspend/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "flowModel", description = "流程模型", required = true), + }) + public ActionResult suspend(@PathVariable("id") String id, @RequestBody FlowModel flowModel) { + flowModel.setUserInfo(UserProvider.getUser()); + flowTaskNewService.suspend(id, flowModel, true); + return ActionResult.success(MsgCode.WF015.get()); + } + + /** + * 流程恢复 + * + * @param id 主键 + * @param flowModel 流程模型 + * @return + */ + @Operation(summary = "流程恢复") + @PostMapping("/Restore/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "flowModel", description = "流程模型", required = true), + }) + public ActionResult restore(@PathVariable("id") String id, @RequestBody FlowModel flowModel) { + flowModel.setUserInfo(UserProvider.getUser()); + flowModel.setSuspend(false); + flowTaskNewService.suspend(id, flowModel, false); + return ActionResult.success(MsgCode.WF016.get()); + } + + //递归处理默认当前配置 + private String setDefaultCurrentValue(String configJson, Map havaDefaultCurrentValue, UserInfo userInfo) { + if (StringUtil.isEmpty(configJson)) { + return configJson; + } + Map configJsonMap = JsonUtil.stringToMap(configJson.trim()); + if (configJsonMap == null && configJsonMap.isEmpty()) { + return configJson; + } + List userRelationList = serviceUtil.getListByUserIdAll(ImmutableList.of(userInfo.getUserId())); + + int isChange = 0; + //处理字段 + Object fieldsObj = configJsonMap.get("fields"); + List> fieldsList = null; + if (fieldsObj != null) { + fieldsList = (List>) fieldsObj; + if (fieldsList != null && !fieldsList.isEmpty()) { + setDefaultCurrentValue(userRelationList, fieldsList, userInfo, "add"); + configJsonMap.put("fields", fieldsList); + isChange = 1; + } + } + + if (isChange == 1) { + return JsonUtil.getObjectToString(configJsonMap); + } else { + return configJson; + } + } + + private void setDefaultCurrentValue(List userRelationList, List> itemList, UserInfo userInfo, String parseFlag) { + for (int i = 0, len = itemList.size(); i < len; i++) { + Map itemMap = itemList.get(i); + if (itemMap == null || itemMap.isEmpty()) { + continue; + } + Map configMap = (Map) itemMap.get("__config__"); + if (configMap == null || configMap.isEmpty()) { + continue; + } + List> childrenList = (List>) configMap.get("children"); + if (childrenList != null && !childrenList.isEmpty()) { + setDefaultCurrentValue(userRelationList, childrenList, userInfo, parseFlag); + configMap = (Map) itemMap.get("__config__"); + } + String yunzhupaasKey = (String) configMap.get("yunzhupaasKey"); + String defaultCurrent = String.valueOf(configMap.get("defaultCurrent")); + if ("true".equals(defaultCurrent)) { + Map> relationMap = userRelationList.stream().collect(Collectors.groupingBy(UserRelationEntity::getObjectType)); + Object data = ""; + switch (yunzhupaasKey) { + case YunzhupaasKeyConsts.COMSELECT: + data = new ArrayList() {{ + add(userInfo.getOrganizeId()); + }}; + break; + case YunzhupaasKeyConsts.DEPSELECT: + data = userInfo.getDepartmentId(); + break; + case YunzhupaasKeyConsts.POSSELECT: + data = userInfo.getPositionIds().length > 0 ? userInfo.getPositionIds()[0] : ""; + break; + case YunzhupaasKeyConsts.USERSELECT: + case YunzhupaasKeyConsts.CUSTOMUSERSELECT: + data = YunzhupaasKeyConsts.CUSTOMUSERSELECT.equals(yunzhupaasKey) ? userInfo.getUserId() + "--" + PermissionConst.USER : userInfo.getUserId(); + break; + case YunzhupaasKeyConsts.ROLESELECT: + List roleList = relationMap.get(PermissionConst.ROLE) != null ? relationMap.get(PermissionConst.ROLE) : new ArrayList<>(); + data = roleList.size() > 0 ? roleList.get(0).getObjectId() : ""; + break; + case YunzhupaasKeyConsts.GROUPSELECT: + List groupList = relationMap.get(PermissionConst.GROUP) != null ? relationMap.get(PermissionConst.GROUP) : new ArrayList<>(); + data = groupList.size() > 0 ? groupList.get(0).getObjectId() : ""; + break; + default: + break; + } + List list = new ArrayList<>(); + list.add(data); + if ("search".equals(parseFlag)) { + String searchMultiple = String.valueOf(itemMap.get("searchMultiple")); + if ("true".equals(searchMultiple)) { + configMap.put("defaultValue", list); + } else { + configMap.put("defaultValue", data); + } + } else { + String multiple = String.valueOf(itemMap.get("multiple")); + if ("true".equals(multiple)) { + configMap.put("defaultValue", list); + } else { + configMap.put("defaultValue", data); + } + } + itemMap.put("__config__", configMap); + itemList.set(i, itemMap); + } + } + } + + /** + * 获取流程所关联的用户信息 + * + * @param taskId 任务ID + * @param flowTaskUserListModel 查询模型 + * @return + */ + @Operation(summary = "获取流程所关联的用户信息") + @Parameters({ + @Parameter(name = "taskId", description = "任务ID", required = true), + @Parameter(name = "flowTaskUserListModel", description = "查询模型", required = true) + }) + @GetMapping("/TaskUserList/{taskId}") + public ActionResult getTaskUserList(@PathVariable("taskId") String taskId, FlowTaskUserListModel flowTaskUserListModel) throws WorkFlowException { + FlowUserListModel flowUserListModel = flowTaskUtil.getTaskUserList(taskId); + List jsonToList = userService.getObjList(flowUserListModel.getAllUserIdList(), flowTaskUserListModel, null); + PaginationVO paginationVO = JsonUtil.getJsonToBean(flowTaskUserListModel, PaginationVO.class); + return ActionResult.page(jsonToList, paginationVO); + } + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-controller/src/main/java/com/yunzhupaas/engine/controller/FlowCommentController.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-controller/src/main/java/com/yunzhupaas/engine/controller/FlowCommentController.java new file mode 100644 index 0000000..8ee5a11 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-controller/src/main/java/com/yunzhupaas/engine/controller/FlowCommentController.java @@ -0,0 +1,396 @@ +package com.yunzhupaas.engine.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.engine.entity.*; +import com.yunzhupaas.engine.model.flowbefore.FlowUserListModel; +import com.yunzhupaas.engine.model.flowcomment.FlowCommentForm; +import com.yunzhupaas.engine.model.flowcomment.FlowCommentInfoVO; +import com.yunzhupaas.engine.model.flowcomment.FlowCommentListVO; +import com.yunzhupaas.engine.model.flowcomment.FlowCommentPagination; +import com.yunzhupaas.engine.model.flowengine.FlowModel; +import com.yunzhupaas.engine.model.flowengine.shuntjson.childnode.MsgConfig; +import com.yunzhupaas.engine.model.flowengine.shuntjson.nodejson.ChildNodeList; +import com.yunzhupaas.engine.model.flowmessage.FlowMsgModel; +import com.yunzhupaas.engine.service.FlowCommentService; +import com.yunzhupaas.engine.service.FlowTaskNodeService; +import com.yunzhupaas.engine.util.FlowMsgUtil; +import com.yunzhupaas.engine.util.FlowNature; +import com.yunzhupaas.engine.util.FlowTaskUtil; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.permission.service.UserService; +import com.yunzhupaas.util.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 流程评论 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Tag(name = "流程评论", description = "Comment") +@RestController +@RequestMapping("/api/workflow1/Engine/FlowComment") +public class FlowCommentController extends SuperController { + + + @Autowired + private ServiceAllUtil serviceUtil; + + @Autowired + private FlowCommentService flowCommentService; + @Autowired + private FlowTaskNodeService flowTaskNodeService; + @Autowired + private UserService userService; + @Autowired + private FlowTaskUtil flowTaskUtil; + @Autowired + private FlowMsgUtil flowMsgUtil; + + /** + * 获取流程评论列表 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "获取流程评论列表") + @GetMapping + public ActionResult> list(FlowCommentPagination pagination) { + List list = flowCommentService.getlist(pagination); + List listVO = new ArrayList<>(); + List userId = list.stream().map(t -> t.getCreatorUserId()).collect(Collectors.toList()); + UserInfo userInfo = UserProvider.getUser(); + List userName = serviceUtil.getUserName(userId); + for (FlowCommentEntity flowCommentEntity : list) { + FlowCommentListVO vo = JsonUtil.getJsonToBean(flowCommentEntity, FlowCommentListVO.class); + UserEntity userEntity = userName.stream().filter(t -> t.getId().equals(flowCommentEntity.getCreatorUserId())).findFirst().orElse(null); + if(flowCommentEntity.getCreatorUserId().equals(userInfo.getUserId()) && !"1".equals(String.valueOf(flowCommentEntity.getDeleteShow()))) { + vo.setIsDel(1); //1-删除按钮显示 + }else if("1".equals(String.valueOf(flowCommentEntity.getDeleteShow()))) { + vo.setIsDel(2); //1-删除按钮显示 + vo.setText("该评论已被删除"); + }else{ + vo.setIsDel(0); + } + vo.setCreatorUser(userEntity != null ? userEntity.getRealName() + "/" + userEntity.getAccount() : ""); + vo.setCreatorUserHeadIcon(userEntity != null ? UploaderUtil.uploaderImg(userEntity.getHeadIcon()) : vo.getCreatorUserHeadIcon()); + if(StringUtil.isNotEmpty(flowCommentEntity.getReplyId())) { + FlowCommentEntity replyEntity = list.stream().filter(t-> t.getId().equals(flowCommentEntity.getReplyId())).findFirst().orElse(null); + if(replyEntity == null) { + replyEntity = flowCommentService.getInfo(flowCommentEntity.getReplyId()); + } + if(replyEntity != null) { + FlowCommentEntity finalReplyEntity = replyEntity; + UserEntity replyUserEntity = userName.stream().filter(t -> t.getId().equals(finalReplyEntity.getCreatorUserId())).findFirst().orElse(null); + vo.setReplyUser(userEntity != null ? replyUserEntity.getRealName() + "/" + replyUserEntity.getAccount() : ""); + vo.setReplyText(("1".equals(String.valueOf(replyEntity.getDeleteShow())) || "1".equals(String.valueOf(replyEntity.getDeleteMark()))) ? "该评论已被删除": replyEntity.getText()); + } + } + listVO.add(vo); + } + PaginationVO vo = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(listVO, vo); + } + + /** + * 获取流程评论信息 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取流程评论信息") + @GetMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult info(@PathVariable("id") String id) { + FlowCommentEntity entity = flowCommentService.getInfo(id); + FlowCommentInfoVO vo = JsonUtil.getJsonToBean(entity, FlowCommentInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 新建流程评论 + * + * @param commentForm 流程评论模型 + * @return + */ + @Operation(summary = "新建流程评论") + @PostMapping + @Parameters({ + @Parameter(name = "commentForm", description = "流程评论模型", required = true), + }) + public ActionResult create(@RequestBody @Valid FlowCommentForm commentForm) throws DataException, WorkFlowException { + FlowCommentEntity entity = JsonUtil.getJsonToBean(commentForm, FlowCommentEntity.class); + flowCommentService.create(entity); + + //发送提醒消息 + this.sendCommentMsg(entity); + + return ActionResult.success(MsgCode.SU002.get()); + } + + /** + * 更新流程评论 + * + * @param id 主键 + * @param commentForm 流程评论模型 + * @return + */ + @Operation(summary = "更新流程评论") + @PutMapping("/{id}") + @Parameters({ + @Parameter(name = "commentForm", description = "流程评论模型", required = true), + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid FlowCommentForm commentForm) throws DataException { + FlowCommentEntity info = flowCommentService.getInfo(id); + if (info != null) { + FlowCommentEntity entity = JsonUtil.getJsonToBean(commentForm, FlowCommentEntity.class); + entity.setDeleteShow(info.getDeleteShow()); + flowCommentService.update(id, entity); + return ActionResult.success(MsgCode.SU004.get()); + } + return ActionResult.fail(MsgCode.FA002.get()); + } + + /** + * 删除流程评论 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除流程评论") + @DeleteMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + @Transactional + public ActionResult delete(@PathVariable("id") String id) { + FlowCommentEntity entity = flowCommentService.getInfo(id); + if (entity.getCreatorUserId().equals(UserProvider.getUser().getUserId())) { + UserInfo userInfo = UserProvider.getUser(); + boolean isDeleteShow = false; + ChildNodeList childNodeList = this.getCommentChildNodeList(entity.getTaskId()); + if(childNodeList != null && childNodeList.getProperties().getIsShowDelComment() != null && childNodeList.getProperties().getIsShowDelComment()) { + isDeleteShow = true; + } + if(isDeleteShow) { + entity.setDeleteShow(1); + entity.setDeleteTime(new Date()); + entity.setDeleteUserId(userInfo.getUserId()); + flowCommentService.updateById(entity); + }else{ + entity.setDeleteMark(1); + entity.setDeleteTime(new Date()); + entity.setDeleteUserId(userInfo.getUserId()); + flowCommentService.updateById(entity); +// List deleteList = new ArrayList<>(); +// deleteList.add(entity); +// List deleteIdList = deleteList.stream().map(t-> t.getId()).collect(Collectors.toList()); +// this.getDeleteList(deleteList, deleteIdList); +// for(FlowCommentEntity each : deleteList) { +// flowCommentService.delete(each); +// } + } + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.success(MsgCode.FA003.get()); + } + + //递归查询下级 + private void getDeleteList(List allDeleteList, List parentIdList) { + if(parentIdList == null || parentIdList.isEmpty()) { + return; + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(FlowCommentEntity::getReplyId, parentIdList); + List childrenList = flowCommentService.list(queryWrapper); + if(childrenList == null || childrenList.isEmpty()) { + return; + } + parentIdList = childrenList.stream().map(t-> t.getId()).collect(Collectors.toList()); + allDeleteList.addAll(childrenList); + this.getDeleteList(allDeleteList, parentIdList); + } + + + private ChildNodeList getCommentChildNodeList(String taskId) { + if(StringUtil.isEmpty(taskId)) { + return null; + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowTaskNodeEntity::getTaskId, taskId); + queryWrapper.lambda().eq(FlowTaskNodeEntity::getNodeType, FlowNature.NodeStart); + queryWrapper.lambda().orderByDesc(FlowTaskNodeEntity::getCreatorTime); + queryWrapper.lambda().select(FlowTaskNodeEntity::getNodePropertyJson); + List startNodeList = flowTaskNodeService.list(queryWrapper); + if(startNodeList != null && !startNodeList.isEmpty()) { + FlowTaskNodeEntity flowNode = startNodeList.get(0); + ChildNodeList childNodeList = JsonUtil.getJsonToBean(flowNode.getNodePropertyJson(), ChildNodeList.class); + return childNodeList; + } + return null; + } + + //发送提醒消息 + private void sendCommentMsg(FlowCommentEntity flowCommentEntity) throws WorkFlowException { + //发消息 + UserInfo userInfo = UserProvider.getUser(); + //不包含@{ 且 回复ID为空 (不发消息) + if((StringUtil.isEmpty(flowCommentEntity.getText()) || !flowCommentEntity.getText().contains("@{")) && StringUtil.isEmpty(flowCommentEntity.getReplyId())) { + return; + } + ChildNodeList startChildNodeList = this.getCommentChildNodeList(flowCommentEntity.getTaskId()); + if(startChildNodeList == null || startChildNodeList.getProperties() == null || startChildNodeList.getProperties().getCommentMsgConfig() == null || startChildNodeList.getProperties().getCommentMsgConfig().getOn() == null) { + return; + } + MsgConfig commentMsgConfig = startChildNodeList.getProperties().getCommentMsgConfig(); + if(commentMsgConfig.getOn() != 1 && commentMsgConfig.getOn() != 3) { + return; + } + Set userIdSet = new HashSet<>(); + //回复 + if(StringUtil.isNotEmpty(flowCommentEntity.getReplyId())) { + FlowCommentEntity replyEntity = flowCommentService.getInfo(flowCommentEntity.getReplyId()); + if(replyEntity != null && StringUtil.isNotEmpty(replyEntity.getCreatorUserId())) { + userIdSet.add(replyEntity.getCreatorUserId()); + } + } + //@ + if(StringUtil.isNotEmpty(flowCommentEntity.getText()) && flowCommentEntity.getText().contains("@{")) { + String[] textArray = flowCommentEntity.getText().split("@\\{"); + List accountList = new ArrayList<>(); + for(int i = 0; i queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(UserEntity::getAccount, accountList); + queryWrapper.lambda().select(UserEntity::getId); + List list = userService.list(queryWrapper); + userIdSet.addAll(list.stream().map(t-> t.getId()).collect(Collectors.toSet())); + } + } + //过滤自己 + Set finalUserIdSet = userIdSet; + userIdSet = userIdSet.stream().filter(t-> !finalUserIdSet.contains(userInfo.getUserId())).collect(Collectors.toSet()); + + if(userIdSet.isEmpty()) { + return; + } + FlowUserListModel flowUserListModel = flowTaskUtil.getTaskUserList(flowCommentEntity.getTaskId()); + userIdSet.retainAll(flowUserListModel.getAllUserIdList()); //取交集 + if(userIdSet.isEmpty()) { + return; + } + + Set noAddUserIdList = new HashSet<>(userIdSet); + //审批人 + List operatorList = new ArrayList<>(); //审批人 +// List operatorUserList = new ArrayList<>(); //依次审批人 + List circulateList = new ArrayList<>(); //抄送人 + List operatorRecordList = new ArrayList<>(); //已办数据 + String startHandId = null; //发起人 + + //审批人 + if(!noAddUserIdList.isEmpty()) { + for(FlowTaskOperatorEntity each : flowUserListModel.getOperatorList()) { + if(noAddUserIdList.contains(each.getHandleId())) { + operatorList.add(each); + noAddUserIdList.remove(each.getHandleId()); + } + } + } + //依次审批人 +// if(!noAddUserIdList.isEmpty()) { +// for (FlowOperatorUserEntity each : flowUserListModel.getOperatorUserList()) { +// if (noAddUserIdList.contains(each.getHandleId())) { +// operatorUserList.add(each); +// noAddUserIdList.remove(each.getHandleId()); +// } +// } +// } + //抄送人 + if(!noAddUserIdList.isEmpty()) { + for (FlowTaskCirculateEntity each : flowUserListModel.getCirculateList()) { + if (noAddUserIdList.contains(each.getObjectId())) { + circulateList.add(each); + noAddUserIdList.remove(each.getObjectId()); + } + } + } + //发起人 + if(!noAddUserIdList.isEmpty()) { + if(noAddUserIdList.contains(flowUserListModel.getFlowTask().getCreatorUserId())) { + startHandId = flowUserListModel.getFlowTask().getCreatorUserId(); + } + } + + //已办记录 + if(!noAddUserIdList.isEmpty()) { + for (FlowTaskOperatorRecordEntity each : flowUserListModel.getOperatorRecordList()) { + if(noAddUserIdList.contains(each.getHandleId())) { + operatorRecordList.add(each); + noAddUserIdList.remove(each.getHandleId()); + } + } + } + + //节点集合 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(FlowTaskNodeEntity::getTaskId, flowCommentEntity.getTaskId()); + queryWrapper.lambda().eq(FlowTaskNodeEntity::getState, 0); + queryWrapper.lambda().orderByDesc(FlowTaskNodeEntity::getCreatorTime); + List nodeList = flowTaskNodeService.list(queryWrapper); + //构造消息 + FlowMsgModel flowMsgModel = new FlowMsgModel(); + flowMsgModel.setTaskEntity(flowUserListModel.getFlowTask()); + flowMsgModel.setNodeList(nodeList); + flowMsgModel.setOperatorList(operatorList); + flowMsgModel.setCirculateList(circulateList); + flowMsgModel.setOperatorRecordList(operatorRecordList); + flowMsgModel.setStartHandId(startHandId); + FlowModel flowModel = new FlowModel(); + flowModel.setUserInfo(userInfo); + flowMsgModel.setFlowModel(flowModel); + flowMsgModel.setWait(false); + flowMsgModel.setComment(true); + //发送消息 + flowMsgUtil.message(flowMsgModel); + } + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-controller/src/main/java/com/yunzhupaas/engine/controller/FlowDelegateController.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-controller/src/main/java/com/yunzhupaas/engine/controller/FlowDelegateController.java new file mode 100644 index 0000000..90af2d9 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-controller/src/main/java/com/yunzhupaas/engine/controller/FlowDelegateController.java @@ -0,0 +1,282 @@ +package com.yunzhupaas.engine.controller; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.engine.entity.FlowDelegateEntity; +import com.yunzhupaas.engine.model.flowcandidate.FlowCandidateUserModel; +import com.yunzhupaas.engine.model.flowdelegate.*; +import com.yunzhupaas.engine.model.flowengine.FlowPagination; +import com.yunzhupaas.engine.model.flowtemplate.FlowPageListVO; +import com.yunzhupaas.engine.service.FlowDelegateService; +import com.yunzhupaas.exception.DataException; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.JsonUtilEx; +import com.yunzhupaas.util.StringUtil; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import jakarta.validation.Valid; +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +/** + * 流程委托 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Tag(name = "流程委托", description = "FlowDelegate") +@RestController +@RequestMapping("/api/workflow1/Engine/FlowDelegate") +public class FlowDelegateController extends SuperController { + + @Autowired + private FlowDelegateService flowDelegateService; + + /** + * 获取流程委托列表 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "获取流程委托列表") + @GetMapping + public ActionResult> list(FlowDelegatePagination pagination) { + List list = flowDelegateService.getList(pagination); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + List listVO = JsonUtil.getJsonToList(list, FlowDelegatListVO.class); + return ActionResult.page(listVO, paginationVO); + } + + /** + * 获取流程委托信息 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取流程委托信息") + @GetMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult info(@PathVariable("id") String id) throws DataException { + FlowDelegateEntity entity = flowDelegateService.getInfo(id); + FlowDelegateInfoVO vo = JsonUtilEx.getJsonToBeanEx(entity, FlowDelegateInfoVO.class); + return ActionResult.success(vo); + } + + /** + * 新建流程委托 + * + * @param flowDelegateCrForm 委托模型 + * @return + */ + @Operation(summary = "新建流程委托") + @PostMapping + @Parameters({ + @Parameter(name = "flowDelegateCrForm", description = "委托模型", required = true), + }) + public ActionResult create(@RequestBody @Valid FlowDelegateCrForm flowDelegateCrForm) { + FlowDelegateEntity entity = JsonUtil.getJsonToBean(flowDelegateCrForm, FlowDelegateEntity.class); + if (entity.getUserId().equals(entity.getToUserId())) { + return ActionResult.fail(MsgCode.WF017.get()); + } + if (alreadyDelegate(flowDelegateCrForm, null)) { + return ActionResult.fail(MsgCode.WF018.get()); + } + FlowDelegateCrForm flowReverse = new FlowDelegateCrForm(); + BeanUtils.copyProperties(flowDelegateCrForm, flowReverse); + flowReverse.setUserId(flowDelegateCrForm.getToUserId()); + flowReverse.setToUserId(flowDelegateCrForm.getUserId()); + if (alreadyDelegate(flowReverse, null)) { + return ActionResult.fail(MsgCode.WF019.get()); + } + flowDelegateService.create(entity); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 判断是否已有委托 + * + * @param + * @return + * @copyright 深圳市乐程软件有限公司 + * @date 2024/10/28 + */ + private boolean alreadyDelegate(FlowDelegateCrForm flowDelegateCrForm, String id) { + List flowDelegateEntities = flowDelegateService.selectSameParamAboutDelaget(flowDelegateCrForm); + for (FlowDelegateEntity delegate : flowDelegateEntities) { + if (delegate.getId().equals(id)) { + continue; + } + //时间交叉 + if ((flowDelegateCrForm.getStartTime() <= delegate.getStartTime().getTime() && flowDelegateCrForm.getEndTime() >= delegate.getStartTime().getTime()) || + (flowDelegateCrForm.getStartTime() >= delegate.getStartTime().getTime() && flowDelegateCrForm.getStartTime() <= delegate.getEndTime().getTime())) { + if (StringUtil.isEmpty(flowDelegateCrForm.getFlowId())) { + return true; + } else { + if (StringUtil.isEmpty(delegate.getFlowId())) { + return true; + } else { + List split = Arrays.asList(delegate.getFlowId().split(",")); + List split1 = Arrays.asList(flowDelegateCrForm.getFlowId().split(",")); + for (String srt : split) { + if (split1.contains(srt)) { + return true; + } + } + } + } + } + } + return false; + } + + /** + * 更新流程委托 + * + * @param id 主键值 + * @param flowDelegateUpForm 委托模型 + * @return + */ + @Operation(summary = "更新流程委托") + @PutMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "flowDelegateUpForm", description = "委托模型", required = true), + }) + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid FlowDelegateUpForm flowDelegateUpForm) { + FlowDelegateEntity entity = JsonUtil.getJsonToBean(flowDelegateUpForm, FlowDelegateEntity.class); + if (entity.getUserId().equals(entity.getToUserId())) { + return ActionResult.fail(MsgCode.WF017.get()); + } + + if (alreadyDelegate(flowDelegateUpForm, id)) { + return ActionResult.fail(MsgCode.WF018.get()); + } + FlowDelegateCrForm flowReverse = new FlowDelegateCrForm(); + BeanUtils.copyProperties(flowDelegateUpForm, flowReverse); + flowReverse.setUserId(flowDelegateUpForm.getToUserId()); + flowReverse.setToUserId(flowDelegateUpForm.getUserId()); + if (alreadyDelegate(flowReverse, id)) { + return ActionResult.fail(MsgCode.WF019.get()); + } + boolean flag = flowDelegateService.update(id, entity); + if (flag == false) { + return ActionResult.success(MsgCode.FA002.get()); + } + return ActionResult.success(MsgCode.SU004.get()); + } + + /** + * 停止流程引擎 + * + * @param id 主键 + * @return + */ + @Operation(summary = "结束委托") + @PutMapping("/Stop/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult stop(@PathVariable("id") String id) { + FlowDelegateEntity entity = flowDelegateService.getInfo(id); + if (entity != null) { + Date date = new Date(); + entity.setStartTime(date); + entity.setEndTime(date); + flowDelegateService.updateStop(id, entity); + return ActionResult.success(MsgCode.SU008.get()); + } + return ActionResult.fail(MsgCode.FA002.get()); + } + + /** + * 删除流程委托 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除流程委托") + @DeleteMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult delete(@PathVariable("id") String id) { + FlowDelegateEntity entity = flowDelegateService.getInfo(id); + if (entity != null) { + flowDelegateService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + + /** + * 被委托审核 + * 根据流程id和委托人id=查询被委托人 + * + * @param flowId 流程主键 + * @param userId 用户主键 + * @param touserId 用户主键 + * @return + */ + @Operation(summary = "被委托审核") + @GetMapping("/getuser") + @Parameters({ + @Parameter(name = "flowId", description = "流程主键", required = true), + @Parameter(name = "userId", description = "用户主键"), + @Parameter(name = "touserId", description = "用户主键"), + }) + public ActionResult getuser(@RequestParam("flowId") String flowId, @RequestParam("userId") String userId, @RequestParam("touserId") String touserId) { + flowDelegateService.getUser(userId, flowId, touserId); + return ActionResult.success(); + } + + /** + * 被委托发起 + * 根据被委托人查询可发起的流程列表 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "被委托发起") + @GetMapping("/getflow") + public ActionResult> getflow(FlowPagination pagination) { + List getflow = flowDelegateService.getflow(pagination); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + List listVO = JsonUtil.getJsonToList(getflow, FlowPageListVO.class); + return ActionResult.page(listVO, paginationVO); + } + + + /** + * 获取委托人 + * 根据被委托人查询可发起的流程列表 + * + * @Param flowId 流程主键 + */ + @Operation(summary = "获取委托人") + @GetMapping("/userList") + @Parameters({ + @Parameter(name = "flowId", description = "流程主键", required = true), + }) + public ActionResult> getUserListByFlowId(@RequestParam("flowId") String flowId) throws WorkFlowException { + ListVO userListByFlowId = flowDelegateService.getUserListByFlowId(flowId); + return ActionResult.success(userListByFlowId); + } +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-controller/src/main/java/com/yunzhupaas/engine/controller/FlowLaunchController.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-controller/src/main/java/com/yunzhupaas/engine/controller/FlowLaunchController.java new file mode 100644 index 0000000..f0b023c --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-controller/src/main/java/com/yunzhupaas/engine/controller/FlowLaunchController.java @@ -0,0 +1,139 @@ +package com.yunzhupaas.engine.controller; + +import com.google.common.collect.ImmutableList; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.engine.entity.FlowTaskEntity; +import com.yunzhupaas.engine.model.flowengine.FlowModel; +import com.yunzhupaas.engine.model.flowlaunch.FlowLaunchListVO; +import com.yunzhupaas.engine.model.flowtask.PaginationFlowTask; +import com.yunzhupaas.engine.service.FlowTaskNewService; +import com.yunzhupaas.engine.service.FlowTaskService; +import com.yunzhupaas.engine.util.FlowNature; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.UserProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Objects; + +/** + * 流程发起 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Tag(name = "流程发起", description = "FlowLaunch") +@RestController +@RequestMapping("/api/workflow1/Engine/FlowLaunch") +public class FlowLaunchController { + + @Autowired + private FlowTaskService flowTaskService; + + @Autowired + private FlowTaskNewService flowTaskNewService; + + /** + * 获取流程发起列表 + * + * @param paginationFlowTask 分页模型 + * @return + */ + @Operation(summary = "获取流程发起列表(带分页)") + @GetMapping + public ActionResult> list(PaginationFlowTask paginationFlowTask) { + List list = flowTaskService.getLaunchList(paginationFlowTask); + List listVO = JsonUtil.getJsonToList(list, FlowLaunchListVO.class); + PaginationVO paginationVO = JsonUtil.getJsonToBean(paginationFlowTask, PaginationVO.class); + return ActionResult.page(listVO, paginationVO); + } + + /** + * 删除流程发起 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除流程发起") + @DeleteMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult delete(@PathVariable("id") String id) throws WorkFlowException { + FlowTaskEntity entity = flowTaskService.getInfo(id, FlowTaskEntity::getId, + FlowTaskEntity::getParentId, FlowTaskEntity::getFlowType, FlowTaskEntity::getFullName, + FlowTaskEntity::getStatus + ); + if (entity != null) { + if (Objects.equals(entity.getFlowType(), 1)) { + return ActionResult.fail(MsgCode.WF020.get()); + } + if (!FlowNature.ParentId.equals(entity.getParentId()) && StringUtil.isNotEmpty(entity.getParentId())) { + return ActionResult.fail(entity.getFullName() + MsgCode.WF021.get()); + } + if(!Objects.equals(entity.getCreatorUserId(), UserProvider.getLoginUserId())){ + return ActionResult.fail(MsgCode.FA021.get()); + } + flowTaskService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + return ActionResult.fail(MsgCode.FA003.get()); + } + + /** + * 待我审核催办 + * + * @param id 主键 + * @return + */ + @Operation(summary = "发起催办") + @PostMapping("/Press/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult press(@PathVariable("id") String id) throws WorkFlowException { + FlowModel flowModel = new FlowModel(); + UserInfo userInfo = UserProvider.getUser(); + flowModel.setUserInfo(userInfo); + boolean flag = flowTaskNewService.press(id, flowModel); + if (flag) { + return ActionResult.success(MsgCode.WF022.get()); + } + return ActionResult.fail(MsgCode.WF023.get()); + } + + /** + * 撤回流程发起 + * 注意:在撤销流程时要保证你的下一节点没有处理这条记录;如已处理则无法撤销流程。 + * + * @param id 主键 + * @param flowModel 流程模型 + * @return + */ + @Operation(summary = "撤回流程发起") + @PutMapping("/{id}/Actions/Withdraw") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "flowModel", description = "流程模型", required = true), + }) + public ActionResult revoke(@PathVariable("id") String id, @RequestBody FlowModel flowModel) throws WorkFlowException { + UserInfo userInfo = UserProvider.getUser(); + flowModel.setUserInfo(userInfo); + flowTaskNewService.revoke(ImmutableList.of(id), flowModel, true); + return ActionResult.success(MsgCode.WF008.get()); + } +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-controller/src/main/java/com/yunzhupaas/engine/controller/FlowMonitorController.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-controller/src/main/java/com/yunzhupaas/engine/controller/FlowMonitorController.java new file mode 100644 index 0000000..4a35342 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-controller/src/main/java/com/yunzhupaas/engine/controller/FlowMonitorController.java @@ -0,0 +1,121 @@ +package com.yunzhupaas.engine.controller; + +import com.google.common.collect.ImmutableList; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.entity.DataInterfaceEntity; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.engine.entity.FlowEventLogEntity; +import com.yunzhupaas.engine.entity.FlowTaskEntity; +import com.yunzhupaas.engine.model.flowmonitor.FlowEventLogListVO; +import com.yunzhupaas.engine.model.flowmonitor.FlowMonitorListVO; +import com.yunzhupaas.engine.model.flowtask.FlowAssistModel; +import com.yunzhupaas.engine.model.flowtask.PaginationFlowTask; +import com.yunzhupaas.engine.service.FlowEventLogService; +import com.yunzhupaas.engine.service.FlowTaskService; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.ServiceAllUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 流程监控 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Tag(name = "流程监控", description = "FlowMonitor") +@RestController +@RequestMapping("/api/workflow1/Engine/FlowMonitor") +public class FlowMonitorController { + + @Autowired + private FlowTaskService flowTaskService; + @Autowired + private ServiceAllUtil serviceUtil; + @Autowired + private FlowEventLogService flowEventLogService; + + /** + * 获取流程监控列表 + * + * @param paginationFlowTask 分页模型 + * @return + */ + @Operation(summary = "获取流程监控列表") + @GetMapping + public ActionResult> list(PaginationFlowTask paginationFlowTask) { + List list = flowTaskService.getMonitorList(paginationFlowTask); + List userList = serviceUtil.getUserName(list.stream().map(t -> t.getCreatorUserId()).collect(Collectors.toList())); + List listVO = new LinkedList<>(); + for (FlowTaskEntity taskEntity : list) { + //用户名称赋值 + FlowMonitorListVO vo = JsonUtil.getJsonToBean(taskEntity, FlowMonitorListVO.class); + UserEntity user = userList.stream().filter(t -> t.getId().equals(taskEntity.getCreatorUserId())).findFirst().orElse(null); + vo.setUserName(user != null ? user.getRealName() + "/" + user.getAccount() : ""); + listVO.add(vo); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(paginationFlowTask, PaginationVO.class); + return ActionResult.page(listVO, paginationVO); + } + + /** + * 批量删除流程监控 + * + * @param assistModel 流程删除模型 + * @return + */ + @Operation(summary = "批量删除流程监控") + @DeleteMapping + @Parameters({ + @Parameter(name = "assistModel", description = "流程删除模型", required = true), + }) + public ActionResult delete(@RequestBody FlowAssistModel assistModel) throws WorkFlowException { + String[] taskId = assistModel.getIds().split(","); + flowTaskService.delete(taskId); + return ActionResult.success(MsgCode.SU003.get()); + } + + /** + * 获取事件日志列表 + * + * @return + */ + @Operation(summary = "获取事件日志列表") + @GetMapping("/{id}/EventLog") + public ActionResult getEventLog(@PathVariable("id") String id) { + List logList = flowEventLogService.getList(ImmutableList.of(id)); + List interfaceIdList = logList.stream().map(FlowEventLogEntity::getInterfaceId).collect(Collectors.toList()); + List interfaceList = serviceUtil.getInterfaceList(interfaceIdList); + List list = new ArrayList<>(); + for (FlowEventLogEntity logEntity : logList) { + FlowEventLogListVO listVO = JsonUtil.getJsonToBean(logEntity, FlowEventLogListVO.class); + DataInterfaceEntity dataInterface = interfaceList.stream().filter(t -> t.getId().equals(listVO.getInterfaceId())).findFirst().orElse(null); + if (dataInterface != null) { + listVO.setInterfaceCode(dataInterface.getEnCode()); + listVO.setInterfaceName(dataInterface.getFullName()); + } + list.add(listVO); + } + ListVO vo = new ListVO(); + vo.setList(list); + return ActionResult.success(vo); + } + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-controller/src/main/java/com/yunzhupaas/engine/controller/FlowTaskController.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-controller/src/main/java/com/yunzhupaas/engine/controller/FlowTaskController.java new file mode 100644 index 0000000..a93427b --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-controller/src/main/java/com/yunzhupaas/engine/controller/FlowTaskController.java @@ -0,0 +1,93 @@ +package com.yunzhupaas.engine.controller; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.engine.entity.FlowTaskEntity; +import com.yunzhupaas.engine.enums.FlowStatusEnum; +import com.yunzhupaas.engine.model.flowengine.FlowModel; +import com.yunzhupaas.engine.service.FlowDynamicService; +import com.yunzhupaas.engine.service.FlowTaskService; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.util.UserProvider; +import com.yunzhupaas.util.context.RequestContext; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Objects; + +/** + * 流程引擎 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Tag(name = "流程引擎", description = "FlowTask") +@RestController +@RequestMapping("/api/workflow1/Engine/FlowTask") +public class FlowTaskController extends SuperController { + + + @Autowired + private FlowTaskService flowTaskService; + @Autowired + private FlowDynamicService flowDynamicService; + + /** + * 保存 + * + * @param flowModel 流程模型 + * @return + */ + @Operation(summary = "保存") + @PostMapping + @Parameters({ + @Parameter(name = "flowModel", description = "流程模型", required = true), + }) + public ActionResult save(@RequestBody FlowModel flowModel) throws WorkFlowException { + boolean isApp = !RequestContext.isOrignPc(); + UserInfo userInfo = UserProvider.getUser(); + flowModel.setUserInfo(userInfo); + flowModel.setSystemId(isApp ? userInfo.getSystemId() : userInfo.getAppSystemId()); + flowDynamicService.batchCreateOrUpdate(flowModel); + String msg = FlowStatusEnum.save.getMessage().equals(flowModel.getStatus()) ? MsgCode.SU002.get() : MsgCode.SU006.get(); + return ActionResult.success(msg); + } + + /** + * 提交 + * + * @param id 主键 + * @param flowModel 流程模型 + * @return + */ + @Operation(summary = "提交") + @PutMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "flowModel", description = "流程模型", required = true), + }) + public ActionResult submit(@RequestBody FlowModel flowModel, @PathVariable("id") String id) throws WorkFlowException { + boolean isApp = !RequestContext.isOrignPc(); + UserInfo userInfo = UserProvider.getUser(); + flowModel.setId(id); + flowModel.setUserInfo(userInfo); + flowModel.setSystemId(isApp ? userInfo.getSystemId() : userInfo.getAppSystemId()); + FlowTaskEntity infoSubmit = flowTaskService.getInfoSubmit(id,FlowTaskEntity::getCreatorUserId); + if (infoSubmit != null && !Objects.equals(infoSubmit.getCreatorUserId(), userInfo.getUserId())) { + return ActionResult.fail(MsgCode.FA021.get()); + } + flowDynamicService.batchCreateOrUpdate(flowModel); + String msg = FlowStatusEnum.save.getMessage().equals(flowModel.getStatus()) ? MsgCode.SU002.get() : MsgCode.SU006.get(); + return ActionResult.success(msg); + } + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-controller/src/main/java/com/yunzhupaas/engine/controller/FlowTemplateController.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-controller/src/main/java/com/yunzhupaas/engine/controller/FlowTemplateController.java new file mode 100644 index 0000000..a1a938d --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-controller/src/main/java/com/yunzhupaas/engine/controller/FlowTemplateController.java @@ -0,0 +1,583 @@ +package com.yunzhupaas.engine.controller; + +import cn.hutool.core.util.ObjectUtil; +import com.google.common.collect.ImmutableList; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import com.yunzhupaas.base.ActionResult; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.base.controller.SuperController; +import com.yunzhupaas.base.entity.DictionaryDataEntity; +import com.yunzhupaas.base.vo.DownloadVO; +import com.yunzhupaas.base.vo.ListVO; +import com.yunzhupaas.base.vo.PageListVO; +import com.yunzhupaas.base.vo.PaginationVO; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.emnus.ModuleTypeEnum; +import com.yunzhupaas.engine.entity.FlowEngineVisibleEntity; +import com.yunzhupaas.engine.entity.FlowTaskEntity; +import com.yunzhupaas.engine.entity.FlowTemplateEntity; +import com.yunzhupaas.engine.entity.FlowTemplateJsonEntity; +import com.yunzhupaas.engine.model.flowbefore.FlowFormVo; +import com.yunzhupaas.engine.model.flowengine.FlowPagination; +import com.yunzhupaas.engine.model.flowengine.shuntjson.childnode.ChildNode; +import com.yunzhupaas.engine.model.flowtask.FlowAssistModel; +import com.yunzhupaas.engine.model.flowtemplate.*; +import com.yunzhupaas.engine.model.flowtemplatejson.FlowTemplateJsonListVO; +import com.yunzhupaas.engine.model.flowtemplatejson.FlowTemplateJsonPage; +import com.yunzhupaas.engine.service.FlowEngineVisibleService; +import com.yunzhupaas.engine.service.FlowTaskService; +import com.yunzhupaas.engine.service.FlowTemplateJsonService; +import com.yunzhupaas.engine.service.FlowTemplateService; +import com.yunzhupaas.exception.WorkFlowException; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.util.*; +import com.yunzhupaas.visual.service.VisualdevApi; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import jakarta.validation.Valid; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 流程设计 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Tag(name = "流程模板", description = "template") +@RestController +@RequestMapping("/api/workflow1/Engine/flowTemplate") +public class FlowTemplateController extends SuperController { + + @Autowired + private FlowTemplateService flowTemplateService; + @Autowired + private FlowTemplateJsonService flowTemplateJsonService; + @Autowired + private FlowEngineVisibleService flowEngineVisibleService; + @Autowired + private ServiceAllUtil serviceUtil; + @Autowired + private FlowTaskService flowTaskService; + + + /** + * 获取流程引擎列表 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "获取流程引擎列表") + @GetMapping + public ActionResult> list(FlowPagination pagination) { + List list = flowTemplateService.getPageList(pagination); + List dictionList = serviceUtil.getDictionName(list.stream().map(FlowTemplateEntity::getCategory).collect(Collectors.toList())); + List userList = serviceUtil.getUserName(list.stream().map(FlowTemplateEntity::getCreatorUserId).collect(Collectors.toList())); + List listVO = new ArrayList<>(); + for (FlowTemplateEntity entity : list) { + FlowPageListVO vo = JsonUtil.getJsonToBean(entity, FlowPageListVO.class); + DictionaryDataEntity dataEntity = dictionList.stream().filter(t -> t.getId().equals(entity.getCategory())).findFirst().orElse(null); + vo.setCategory(dataEntity != null ? dataEntity.getFullName() : ""); + UserEntity userEntity = userList.stream().filter(t -> t.getId().equals(entity.getCreatorUserId())).findFirst().orElse(null); + vo.setCreatorUser(userEntity != null ? userEntity.getRealName() + "/" + userEntity.getAccount() : ""); + listVO.add(vo); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(listVO, paginationVO); + } + + /** + * 获取流程设计列表 + * + * @return + */ + @Operation(summary = "流程引擎下拉框") + @GetMapping("/Selector") + public ActionResult> listSelect() { + List treeList = flowTemplateService.getSelectList(); + ListVO vo = new ListVO(); + vo.setList(treeList); + return ActionResult.success(vo); + } + + /** + * 可见引擎下拉框 + * + * @return + */ + @Operation(summary = "可见引擎下拉框") + @GetMapping("/ListAll") + public ActionResult> listAll() { + List treeList = flowTemplateService.getSelectList(); + ListVO vo = new ListVO(); + vo.setList(treeList); + return ActionResult.success(vo); + } + + /** + * 可见的流程引擎列表 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "可见的流程引擎列表") + @GetMapping("/PageListAll") + public ActionResult> listAll(FlowPagination pagination) { + List list = flowTemplateService.getListAll(pagination, true); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + List listVO = JsonUtil.getJsonToList(list, FlowPageListVO.class); + return ActionResult.page(listVO, paginationVO); + } + + /** + * 所属流程树形接口 + * + * @return + */ + @Operation(summary = "所属流程树形接口") + @GetMapping("/TreeList") + public ActionResult> treeList() { + List treeList = flowTemplateService.getTreeList(); + ListVO vo = new ListVO(); + vo.setList(treeList); + return ActionResult.success(vo); + } + + /** + * 可见的流程引擎列表 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "可见的子流程流程引擎列表") + @GetMapping("/PageChildListAll") + public ActionResult> childListAll(FlowPagination pagination) { + List list = flowTemplateJsonService.getChildListPage(pagination); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(list, paginationVO); + } + + /** + * 获取流程引擎信息 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取流程引擎信息") + @GetMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult info(@PathVariable("id") String id) throws WorkFlowException { + FlowTemplateInfoVO vo = flowTemplateService.info(id); + return ActionResult.success(vo); + } + + /** + * 新建流程设计 + * + * @param form 流程模型 + * @return + */ + @Operation(summary = "新建流程引擎") + @PostMapping + @Parameters({ + @Parameter(name = "form", description = "流程模型", required = true), + }) + public ActionResult create(@RequestBody @Valid FlowTemplateCrForm form) throws WorkFlowException { + FlowTemplateEntity entity = JsonUtil.getJsonToBean(form, FlowTemplateEntity.class); + String json = StringUtil.isNotEmpty(form.getFlowTemplateJson()) ? form.getFlowTemplateJson() : "[]"; + List templatejson = JsonUtil.getJsonToList(json, FlowTemplateJsonEntity.class); + flowTemplateService.create(entity, templatejson); + return ActionResult.success(MsgCode.SU001.get()); + } + + /** + * 更新流程设计 + * + * @param id 主键 + * @param form 流程模型 + * @return + */ + @Operation(summary = "更新流程引擎") + @PutMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + @Parameter(name = "form", description = "流程模型", required = true), + }) + public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid FlowTemplatUprForm form) throws WorkFlowException { + FlowTemplateEntity entity = JsonUtil.getJsonToBean(form, FlowTemplateEntity.class); + String json = StringUtil.isNotEmpty(form.getFlowTemplateJson()) ? form.getFlowTemplateJson() : "[]"; + List templateJsonList = JsonUtil.getJsonToList(json, FlowTemplateJsonEntity.class); + FlowTemplateVO vo = flowTemplateService.updateVisible(id, entity, templateJsonList); + return ActionResult.success(MsgCode.SU004.get(), vo); + } + + /** + * 删除流程设计 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除流程引擎") + @DeleteMapping("/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult delete(@PathVariable("id") String id) throws WorkFlowException { + FlowTemplateEntity entity = flowTemplateService.getInfo(id); + flowTemplateService.delete(entity); + return ActionResult.success(MsgCode.SU003.get()); + } + + /** + * 复制流程表单 + * + * @param id 主键 + * @return + */ + @Operation(summary = "复制流程表单") + @PostMapping("/{id}/Actions/Copy") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult copy(@PathVariable("id") String id) throws WorkFlowException { + FlowTemplateEntity flowtemplate = flowTemplateService.getInfo(id); + if (flowtemplate != null) { + if (flowtemplate.getType() == 1) { + throw new WorkFlowException(MsgCode.WF024.get()); + } + List templateJson = flowTemplateJsonService.getMainList(ImmutableList.of(id)); + flowTemplateService.copy(flowtemplate, templateJson); + return ActionResult.success(MsgCode.SU007.get()); + } + return ActionResult.fail(MsgCode.FA004.get()); + } + + /** + * 流程表单状态 + * + * @param id 主键 + * @return + */ + @Operation(summary = "更新流程表单状态") + @PutMapping("/{id}/Actions/State") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult state(@PathVariable("id") String id) throws WorkFlowException { + FlowTemplateEntity entity = flowTemplateService.getInfo(id); + if (entity != null) { + entity.setEnabledMark("1".equals(String.valueOf(entity.getEnabledMark())) ? 0 : 1); + flowTemplateService.update(id, entity); + return ActionResult.success(MsgCode.SU004.get()); + } + return ActionResult.fail(MsgCode.FA002.get()); + } + + /** + * 发布流程引擎 + * + * @param id 主键 + * @return + */ + @Operation(summary = "发布流程设计") + @PostMapping("/Release/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult release(@PathVariable("id") String id) throws WorkFlowException { + FlowTemplateEntity entity = flowTemplateService.getInfo(id); + if (entity != null) { + entity.setEnabledMark(1); + List templateJson = flowTemplateJsonService.getMainList(ImmutableList.of(id)); + if (templateJson.size() == 0) { + return ActionResult.fail(MsgCode.WF025.get()); + } + flowTemplateService.update(id, entity); + return ActionResult.success(MsgCode.WF026.get()); + } + return ActionResult.fail(MsgCode.FA011.get()); + } + + /** + * 停止流程引擎 + * + * @param id 主键 + * @return + */ + @Operation(summary = "停止流程设计") + @PostMapping("/Stop/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult stop(@PathVariable("id") String id) throws WorkFlowException { + FlowTemplateEntity entity = flowTemplateService.getInfo(id); + if (entity != null) { + entity.setEnabledMark(0); + flowTemplateService.update(id, entity); + return ActionResult.success(MsgCode.WF027.get()); + } + return ActionResult.fail(MsgCode.FA008.get()); + } + + /** + * 工作流导出 + * + * @param id 主键 + * @return + * @throws WorkFlowException + */ + @Operation(summary = "工作流导出") + @GetMapping("/{id}/Actions/Export") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult exportData(@PathVariable("id") String id) throws WorkFlowException { + FlowExportModel model = flowTemplateService.exportData(id); + DownloadVO downloadVO = serviceUtil.exportData(model); + return ActionResult.success(downloadVO); + } + + /** + * 工作流导入 + * + * @param multipartFile 文件 + * @return + * @throws WorkFlowException + */ + @Operation(summary = "工作流导入") + @PostMapping(value = "/Actions/Import", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ActionResult ImportData(@RequestPart("file") MultipartFile multipartFile, @RequestPart("type") String type) throws WorkFlowException { + //判断是否为.json结尾 + if (FileUtil.existsSuffix(multipartFile, ModuleTypeEnum.FLOW_FLOWENGINE.getTableName())) { + return ActionResult.fail(MsgCode.IMP002.get()); + } + //获取文件内容 + String fileContent = FileUtil.getFileContent(multipartFile); + FlowExportModel flowExportModel = JsonUtil.getJsonToBean(fileContent, FlowExportModel.class); + if (ObjectUtil.isEmpty(flowExportModel.getFlowTemplate())) { + return ActionResult.fail(MsgCode.IMP004.get()); + } + flowTemplateService.ImportData(flowExportModel, type); + return ActionResult.success(MsgCode.IMP001.get()); + } + + /** + * 流程版本列表 + * + * @param templateId 主键 + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "流程版本列表") + @GetMapping("{templateId}/FlowJsonList") + @Parameters({ + @Parameter(name = "templateId", description = "主键", required = true), + }) + public ActionResult> list(@PathVariable("templateId") String templateId, FlowTemplateJsonPage pagination) { + List list = flowTemplateJsonService.getListPage(pagination, true); + List createId = list.stream().map(FlowTemplateJsonEntity::getCreatorUserId).collect(Collectors.toList()); + List userName = serviceUtil.getUserName(createId); + List listVO = JsonUtil.getJsonToList(list, FlowTemplateJsonListVO.class); + for (FlowTemplateJsonListVO templateJson : listVO) { + UserEntity entity = userName.stream().filter(t -> t.getId().equals(templateJson.getCreatorUserId())).findFirst().orElse(null); + templateJson.setCreatorUser(entity != null ? entity.getRealName() + "/" + entity.getAccount() : ""); + } + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(listVO, paginationVO); + } + + /** + * 设置主版本 + * + * @param ids 主键 + * @return + */ + @Operation(summary = "设置主版本") + @PostMapping("{ids}/MainVersion") + @Parameters({ + @Parameter(name = "ids", description = "主键", required = true), + }) + public ActionResult mainVersion(@PathVariable("ids") String ids) throws WorkFlowException { + flowTemplateJsonService.templateJsonMajor(ids); + return ActionResult.success(MsgCode.SU005.get()); + } + + /** + * 删除版本 + * + * @param id 主键 + * @return + */ + @Operation(summary = "删除版本") + @DeleteMapping("{id}/FlowJson") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult flowJson(@PathVariable("id") String id) throws WorkFlowException { + FlowTemplateJsonEntity entity = flowTemplateJsonService.getInfo(id); + List flowTaskList = flowTaskService.getFlowList(entity.getId()); + if (flowTaskList.size() > 0) { + throw new WorkFlowException(MsgCode.WF028.get()); + } + return ActionResult.success(MsgCode.SU003.get()); + } + + /** + * 流程类型下拉 + * + * @param id 主键 + * @param type 类型 + * @return + */ + @Operation(summary = "流程类型下拉") + @GetMapping("/FlowJsonList/{id}") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult> flowJsonList(@PathVariable("id") String id, String type) throws WorkFlowException { + FlowTemplateEntity info = flowTemplateService.getInfo(id); + if (!ObjectUtil.equal(info.getEnabledMark(), 1)) { + return ActionResult.fail(MsgCode.WF053.get()); + } + UserInfo userInfo = UserProvider.getUser(); + List list = flowTemplateJsonService.getMainList(ImmutableList.of(id)); + List listVO = new ArrayList<>(); + if (StringUtil.isNotEmpty(type) && !userInfo.getIsAdministrator()) { + List visibleFlowList = flowEngineVisibleService.getVisibleFlowList(userInfo.getUserId()); + for (FlowTemplateJsonEntity entity : list) { + boolean count = visibleFlowList.stream().filter(t -> t.getFlowId().equals(entity.getId())).count() > 0; + if ((entity.getVisibleType() == 1 && count) || entity.getVisibleType() == 0) { + FlowSelectVO vo = JsonUtil.getJsonToBean(entity, FlowSelectVO.class); + listVO.add(vo); + } + } + if (listVO.size() == 0) { + return ActionResult.fail(MsgCode.WF029.get()); + } + } else { + listVO.addAll(JsonUtil.getJsonToList(list, FlowSelectVO.class)); + } + return ActionResult.success(listVO); + } + + /** + * 子流程表单信息 + * + * @param id 主键 + * @return + */ + @Operation(summary = "子流程表单信息") + @GetMapping("/{id}/FormInfo") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult formInfo(@PathVariable("id") String id) throws WorkFlowException { + FlowTemplateJsonEntity info = flowTemplateJsonService.getInfo(id); + ChildNode childNode = JsonUtil.getJsonToBean(info.getFlowTemplateJson(), ChildNode.class); + String formId = childNode.getProperties().getFormId(); +//todo 添加表单配置 + FlowFormVo vo = JsonUtil.getJsonToBean("", FlowFormVo.class); + return ActionResult.success(vo); + } + + /** + * 流程协管 + * + * @param assistModel 协管模型 + * @return + */ + @Operation(summary = "流程协管") + @PostMapping("/assist") + @Parameters({ + @Parameter(name = "assistModel", description = "协管模型", required = true), + }) + public ActionResult assist(@RequestBody FlowAssistModel assistModel) { + flowEngineVisibleService.assistList(assistModel); + return ActionResult.success(MsgCode.SU002.get()); + } + + /** + * 委托可选全部流程 + * + * @param pagination 分页模型 + * @return + */ + @Operation(summary = "委托可选全部流程") + @GetMapping("/getflowAll") + public ActionResult> getflowAll(FlowPagination pagination) { + List listByFlowIds = flowTemplateService.getListAll(pagination, true); + List listVO = JsonUtil.getJsonToList(listByFlowIds, FlowPageListVO.class); + PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); + return ActionResult.page(listVO, paginationVO); + } + + /** + * 委托流程选择展示 + * + * @param templateIds 委托流程 + * @return + */ + @Operation(summary = "委托流程选择展示") + @PostMapping("/getflowList") + @Parameters({ + @Parameter(name = "templateIds", description = "委托流程", required = true), + }) + public ActionResult> getflowList(@RequestBody List templateIds) { + FlowPagination pagination = new FlowPagination(); + pagination.setTemplateIdList(templateIds); + List listByFlowIds = flowTemplateService.getListAll(pagination, false); + List listVO = JsonUtil.getJsonToList(listByFlowIds, FlowPageListVO.class); + return ActionResult.success(MsgCode.SU002.get(), listVO); + } + + /** + * 委托流程选择展示 + * + * @param id 主键 + * @return + */ + @Operation(summary = "获取协管") + @GetMapping("/{id}/assistList") + @Parameters({ + @Parameter(name = "id", description = "主键", required = true), + }) + public ActionResult> getAssistList(@PathVariable("id") String id) { + List assistListAll = flowEngineVisibleService.getList(ImmutableList.of(id)); + List assistList = new ArrayList<>(); + for (FlowEngineVisibleEntity entity : assistListAll) { + assistList.add(entity.getOperatorId() + "--" + entity.getOperatorType()); + } + ListVO vo = new ListVO(); + vo.setList(assistList); + return ActionResult.success(vo); + } + + /** + * 获取引擎id + * + * @param code 编码 + * @return + */ + @Operation(summary = "获取引擎id") + @GetMapping("/getFlowIdByCode/{code}") + @Parameters({ + @Parameter(name = "code", description = "编码", required = true), + }) + public ActionResult getFlowIdByCode(@PathVariable("code") String code) throws WorkFlowException { + FlowTemplateEntity entity = flowTemplateService.getFlowIdByCode(code); + return ActionResult.success(MsgCode.SU002.get(), entity.getId()); + } + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/pom.xml b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/pom.xml new file mode 100644 index 0000000..2648384 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/pom.xml @@ -0,0 +1,27 @@ + + + + yunzhupaas-workflow-engine + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-workflow-engine-entity + + + + com.yunzhupaas + yunzhupaas-common-all + ${project.version} + + + com.yunzhupaas + yunzhupaas-permission-entity + ${project.version} + + + + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowAuthorizeEntity.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowAuthorizeEntity.java new file mode 100644 index 0000000..b031cd9 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowAuthorizeEntity.java @@ -0,0 +1,38 @@ +package com.yunzhupaas.engine.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +/** + * 流程权限表 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Data +@TableName("flow_form_authorize") +public class FlowAuthorizeEntity extends SuperExtendEntity { + + /** + * 任务主键 + */ + @TableField("f_task_id") + private String taskId; + + /** + * 节点编码 + */ + @TableField("f_node_code") + private String nodeCode; + + /** + * 字段权限 + */ + @TableField("f_form_operate") + private String formOperate; + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowCandidatesEntity.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowCandidatesEntity.java new file mode 100644 index 0000000..32a1fb0 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowCandidatesEntity.java @@ -0,0 +1,62 @@ +package com.yunzhupaas.engine.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +/** + * 流程候选人 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Data +@TableName("flow_candidates") +public class FlowCandidatesEntity extends SuperExtendEntity { + + /** + * 节点主键 + */ + @TableField("F_TASK_NODE_ID") + private String taskNodeId; + + /** + * 任务主键 + */ + @TableField("F_TASK_ID") + private String taskId; + + /** + * 代办主键 + */ + @TableField("F_TASK_OPERATOR_ID") + private String operatorId; + + /** + * 审批人主键 + */ + @TableField("F_HANDLE_ID") + private String handleId; + + /** + * 审批人账号 + */ + @TableField("F_ACCOUNT") + private String account; + + /** + * 候选人 + */ + @TableField("F_CANDIDATES") + private String candidates; + + /** + * 类型 1.候选人 2.异常人 + */ + @TableField("F_TYPE") + private Integer type; + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowCommentEntity.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowCommentEntity.java new file mode 100644 index 0000000..7e421cb --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowCommentEntity.java @@ -0,0 +1,58 @@ +package com.yunzhupaas.engine.entity; + +import com.alibaba.fastjson.annotation.JSONField; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +/** + * 流程评论 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Data +@TableName("flow_comment") +public class FlowCommentEntity extends SuperExtendEntity.SuperExtendEnabledEntity { + + /** + * 任务主键 + */ + @TableField("F_TASK_ID") + private String taskId; + + /** + * 文本 + */ + @TableField("F_TEXT") + private String text; + + /** + * 图片 + */ + @TableField("F_IMAGE") + private String image; + + /** + * 附件 + */ + @TableField("F_FILE") + @JSONField(name = "file") + private String fileName; + + /** + * 回复评论id + */ + @TableField("F_REPLY_ID") + private String replyId; + + /** + * 评论删除显示 + */ + @TableField("F_DELETE_SHOW") + private Integer deleteShow; + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowDelegateEntity.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowDelegateEntity.java new file mode 100644 index 0000000..e0626c3 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowDelegateEntity.java @@ -0,0 +1,83 @@ +package com.yunzhupaas.engine.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * 流程委托 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Data +@TableName("flow_delegate") +public class FlowDelegateEntity extends SuperExtendEntity { + + /** + * 委托人 + */ + @TableField("F_USER_ID") + private String userId; + + /** + * 委托人 + */ + @TableField("F_USER_NAME") + private String userName; + + /** + * 被委托人 + */ + @TableField("F_TO_USER_ID") + private String toUserId; + + /** + * 被委托人 + */ + @TableField("F_TO_USER_NAME") + private String toUserName; + + /** + * 委托类型(0-发起委托,1-审批委托) + */ + @TableField("F_TYPE") + private Integer type; + + /** + * 委托流程 + */ + @TableField("F_FLOW_ID") + private String flowId; + + /** + * 委托流程 + */ + @TableField("F_FLOW_NAME") + private String flowName; + + /** + * 流程分类 + */ + @TableField("F_FLOW_CATEGORY") + private String flowCategory; + + /** + * 开始时间 + */ + @TableField("F_START_TIME") + private Date startTime; + + /** + * 结束时间 + */ + @TableField("F_END_TIME") + private Date endTime; + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowEngineVisibleEntity.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowEngineVisibleEntity.java new file mode 100644 index 0000000..be21fc6 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowEngineVisibleEntity.java @@ -0,0 +1,52 @@ +package com.yunzhupaas.engine.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +/** + * 流程可见 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Data +@TableName("flow_visible") +public class FlowEngineVisibleEntity extends SuperExtendEntity { + + /** + * 流程主键 + */ + @TableField("F_FLOW_ID") + private String flowId; + + /** + * 经办类型 + */ + @TableField("F_OPERATOR_TYPE") + private String operatorType; + + /** + * 经办主键 + */ + @TableField("F_OPERATOR_ID") + private String operatorId; + + /** + * 排序码 + */ + @TableField("F_SORT_CODE") + private Long sortCode; + + /** + * 可见类型 1.发起 2.协管 + */ + @TableField("F_TYPE") + private Integer type; + + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowEventLogEntity.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowEventLogEntity.java new file mode 100644 index 0000000..d4ce439 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowEventLogEntity.java @@ -0,0 +1,45 @@ +package com.yunzhupaas.engine.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperBaseEntity; +import lombok.Data; + +/** + * 流程事件日志 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Data +@TableName("flow_event_log") +public class FlowEventLogEntity extends SuperBaseEntity.SuperCBaseEntity { + + /** + * 节点主键 + */ + @TableField("F_TASK_NODE_ID") + private String taskNodeId; + + /** + * 接口主键 + */ + @TableField("F_INTERFACE_ID") + private String interfaceId; + + /** + * 事件名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + + /** + * 执行结果 + */ + @TableField("F_RESULT") + private String result; + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowOperatorUserEntity.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowOperatorUserEntity.java new file mode 100644 index 0000000..be89287 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowOperatorUserEntity.java @@ -0,0 +1,86 @@ +package com.yunzhupaas.engine.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +/** + * 流程依次审批 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Data +@TableName("flow_task_operator_user") +public class FlowOperatorUserEntity extends SuperExtendEntity.SuperExtendDescriptionEntity { + + /** + * 节点主键 + */ + @TableField("F_TASK_NODE_ID") + private String taskNodeId; + + /** + * 任务主键 + */ + @TableField("F_TASK_ID") + private String taskId; + + /** + * 状态 + */ + @TableField("F_STATE") + private Integer state; + + /** + * 经办主键 + */ + @TableField("F_HANDLE_ID") + private String handleId; + + /** + * 节点类型 + */ + @TableField("F_Type") + private Integer type; + + /** + * 节点编码 + */ + @TableField("F_NODE_CODE") + private String nodeCode; + + /** + * 节点名称 + */ + @TableField("F_NODE_NAME") + private String nodeName; + + /** + * 是否完成 + */ + @TableField("F_COMPLETION") + private Integer completion; + + /** + * 父节点id + */ + @TableField("F_PARENT_ID") + private String parentId; + + /** + * 自动审批 + */ + @TableField("F_AUTOMATION") + private String automation; + + /** + * 冻结 + */ + @TableField("F_REJECT") + private String reject; + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowRejectDataEntity.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowRejectDataEntity.java new file mode 100644 index 0000000..e29d2db --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowRejectDataEntity.java @@ -0,0 +1,37 @@ +package com.yunzhupaas.engine.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +/** + * 冻结审批 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Data +@TableName("flow_reject_data") +public class FlowRejectDataEntity extends SuperExtendEntity { + + /** + * 经办数据 + */ + @TableField("F_TASK_OPERATOR_JSON") + public String taskOperatorJson; + /** + * 节点数据 + */ + @TableField("F_TASK_NODE_JSON") + private String taskNodeJson; + /** + * 流程任务 + */ + @TableField("F_TASK_JSON") + private String taskJson; + + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowTaskCirculateEntity.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowTaskCirculateEntity.java new file mode 100644 index 0000000..f755c95 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowTaskCirculateEntity.java @@ -0,0 +1,57 @@ +package com.yunzhupaas.engine.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +/** + * 流程传阅 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Data +@TableName("flow_task_circulate") +public class FlowTaskCirculateEntity extends SuperExtendEntity { + + /** + * 对象类型 + */ + @TableField("F_OBJECT_TYPE") + private String objectType; + + /** + * 对象主键 + */ + @TableField("F_OBJECT_ID") + private String objectId; + + /** + * 节点编码 + */ + @TableField("F_NODE_CODE") + private String nodeCode; + + /** + * 节点名称 + */ + @TableField("F_NODE_NAME") + private String nodeName; + + /** + * 节点主键 + */ + @TableField("F_TASK_NODE_ID") + private String taskNodeId; + + /** + * 任务主键 + */ + @TableField("F_TASK_ID") + private String taskId; + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowTaskEntity.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowTaskEntity.java new file mode 100644 index 0000000..d521cd6 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowTaskEntity.java @@ -0,0 +1,186 @@ +package com.yunzhupaas.engine.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * 流程任务 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Data +@TableName("flow_task") +public class FlowTaskEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 实例进程 + */ + @TableField("F_PROCESS_ID") + private String processId; + + /** + * 任务编码 + */ + @TableField("F_EN_CODE") + private String enCode; + + /** + * 任务标题 + */ + @TableField("F_FULL_NAME") + private String fullName; + + /** + * 紧急程度 + */ + @TableField("F_FLOW_URGENT") + private Integer flowUrgent; + + /** + * 流程主键 + */ + @TableField("F_FLOW_ID") + private String flowId; + + /** + * 流程模板id + */ + @TableField("F_TEMPLATE_ID") + private String templateId; + + /** + * 流程编码 + */ + @TableField("F_FLOW_CODE") + private String flowCode; + + /** + * 流程名称 + */ + @TableField("F_FLOW_NAME") + private String flowName; + + /** + * 流程类型 + */ + @TableField("F_FLOW_TYPE") + private Integer flowType; + + /** + * 流程分类 + */ + @TableField("F_FLOW_CATEGORY") + private String flowCategory; + + /** + * 表单内容 + */ + @TableField("F_FLOW_FORM_DATA_JSON") + private String flowFormContentJson; + + /** + * 流程版本 + */ + @TableField("F_FLOW_VERSION") + private String flowVersion; + + /** + * 开始时间 + */ + @TableField("F_START_TIME") + private Date startTime; + + /** + * 结束时间 + */ + @TableField("F_END_TIME") + private Date endTime; + + /** + * 当前步骤 + */ + @TableField("F_CURRENT_NODE_NAME") + private String thisStep; + + /** + * 当前步骤Id + */ + @TableField("F_CURRENT_NODE_CODE") + private String thisStepId; + + /** + * 任务状态 0-草稿、1-处理、2-通过、3-驳回、4-撤销、5-终止、6-挂起 + */ + @TableField("F_STATUS") + private Integer status; + + /** + * 挂起之前状态 + */ + @TableField(value = "F_SUSPEND", fill = FieldFill.UPDATE) + private Integer suspend; + + /** + * 完成情况 + */ + @TableField("F_COMPLETION") + private Integer completion; + + /** + * 父节点id + */ + @TableField("F_PARENT_ID") + private String parentId; + + /** + * 被委托用户 + */ + @TableField("F_DELEGATE_USER_ID") + private String delegateUser; + + /** + * 关联系统id + */ + @TableField("F_SYSTEM_ID") + private String systemId; + + /** + * 节点主键 + */ + @TableField(value = "F_REVIVE_NODE_ID", fill = FieldFill.UPDATE) + private String taskNodeId; + + /** + * 是否批量(0:否,1:是) + */ + @TableField("F_IS_BATCH") + private Integer isBatch; + + /** + * 是否能恢复(0:能,1:不能) + */ + @TableField("F_RESTORE") + private Integer frestore; + + /** + * 同步异步(0:同步,1:异步) + */ + @TableField("F_IS_ASYNC") + private Integer isAsync; + + /** + * 冻结审批 + */ + @TableField(value = "F_REJECT_DATA_ID", fill = FieldFill.UPDATE) + private String rejectId; + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowTaskNodeEntity.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowTaskNodeEntity.java new file mode 100644 index 0000000..ddaf739 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowTaskNodeEntity.java @@ -0,0 +1,99 @@ +package com.yunzhupaas.engine.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +/** + * 流程节点 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Data +@TableName("flow_task_node") +public class FlowTaskNodeEntity extends SuperExtendEntity.SuperExtendDescriptionEntity { + + /** + * 节点编码 + */ + @TableField("F_NODE_CODE") + private String nodeCode; + + /** + * 节点名称 + */ + @TableField("F_NODE_NAME") + private String nodeName; + + /** + * 节点类型 + */ + @TableField("F_NODE_TYPE") + private String nodeType; + + /** + * 节点属性Json + */ + @TableField("F_NODE_PROPERTY_JSON") + private String nodePropertyJson; + + /** + * 上一节点 1.上一步骤 0.返回开始 + */ + @TableField("F_NODE_UP") + private String nodeUp; + + /** + * 下一节点 + */ + @TableField("F_NODE_NEXT") + private String nodeNext; + + /** + * 是否完成 + */ + @TableField("F_COMPLETION") + private Integer completion; + + /** + * 排序码 + */ + @TableField("F_SORT_CODE") + private Long sortCode; + + /** + * 任务主键 + */ + @TableField("F_TASK_ID") + private String taskId; + + /** + * 状态 0.新流程 -1.无用节点 + */ + @TableField("F_STATE") + private Integer state; + + /** + * 分支选择 + */ + @TableField("F_CANDIDATES") + private String candidates; + + /** + * 节点数据 + */ + @TableField("F_DRAFT_DATA") + private String draftData; + + /** + * 表单id + */ + @TableField("F_FORM_ID") + private String formId; + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowTaskOperatorEntity.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowTaskOperatorEntity.java new file mode 100644 index 0000000..b033f71 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowTaskOperatorEntity.java @@ -0,0 +1,126 @@ +package com.yunzhupaas.engine.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * 流程经办 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Data +@TableName("flow_task_operator") +public class FlowTaskOperatorEntity extends SuperExtendEntity.SuperExtendDescriptionEntity { + + /** + * 加签处理人 + */ + @TableField("F_APPEND_HANDLE_ID") + private String appendHandleId; + + /** + * 节点类型 + */ + @TableField("F_TYPE") + private Integer type; + + /** + * 经办主键 + */ + @TableField("F_HANDLE_ID") + private String handleId; + + /** + * 处理状态 0-拒绝、1-同意 + */ + @TableField(value = "F_HANDLE_STATUS", fill = FieldFill.UPDATE) + private Integer handleStatus; + + /** + * 处理时间 + */ + @TableField(value = "F_HANDLE_TIME", fill = FieldFill.UPDATE) + private Date handleTime; + + /** + * 节点编码 + */ + @TableField("F_NODE_CODE") + private String nodeCode; + + /** + * 节点名称 + */ + @TableField("F_NODE_NAME") + private String nodeName; + + /** + * 是否完成 + */ + @TableField("F_COMPLETION") + private Integer completion; + + /** + * 节点主键 + */ + @TableField("F_TASK_NODE_ID") + private String taskNodeId; + + /** + * 任务主键 + */ + @TableField("F_TASK_ID") + private String taskId; + + /** + * 状态 0.新流程 -1.无用数据 1加签人 + */ + @TableField("F_STATE") + private Integer state; + + /** + * 父节点id + */ + @TableField("F_PARENT_ID") + private String parentId; + + /** + * 草稿数据 + */ + @TableField("F_DRAFT_DATA") + private String draftData; + + /** + * 自动审批 + */ + @TableField("F_AUTOMATION") + private String automation; + + /** + * 排序码 + */ + @TableField("F_SORT_CODE") + private Long sortCode; + + /** + * 回滚id + */ + @TableField("F_ROLLBACK_ID") + private String rollbackId; + + /** + * 冻结 + */ + @TableField("F_REJECT") + private String reject; + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowTaskOperatorRecordEntity.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowTaskOperatorRecordEntity.java new file mode 100644 index 0000000..14997db --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowTaskOperatorRecordEntity.java @@ -0,0 +1,114 @@ +package com.yunzhupaas.engine.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +import java.util.Date; + +/** + * 流程经办记录 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Data +@TableName("flow_task_operator_record") +public class FlowTaskOperatorRecordEntity extends SuperExtendEntity { + + /** + * 节点编码 + */ + @TableField("F_NODE_CODE") + private String nodeCode; + + /** + * 节点名称 + */ + @TableField("F_NODE_NAME") + private String nodeName; + + /** + * 经办状态 0-拒绝、1-同意、2-提交、3-撤回、4-终止、5-指派、6-加签、7-转办 + */ + @TableField("F_HANDLE_STATUS") + private Integer handleStatus; + + /** + * 经办人员 + */ + @TableField("F_HANDLE_ID") + private String handleId; + + /** + * 经办时间 + */ + @TableField("F_HANDLE_TIME") + private Date handleTime; + + /** + * 经办理由 + */ + @TableField("F_HANDLE_OPINION") + private String handleOpinion; + + /** + * 流转操作人 + */ + @TableField("F_OPERATOR_ID") + private String operatorId; + + /** + * 经办主键 + */ + @TableField(value = "F_TASK_OPERATOR_ID", fill = FieldFill.UPDATE) + private String taskOperatorId; + + /** + * 节点主键 + */ + @TableField(value = "F_TASK_NODE_ID", fill = FieldFill.UPDATE) + private String taskNodeId; + + /** + * 任务主键 + */ + @TableField("F_TASK_ID") + private String taskId; + + /** + * 签名图片 + */ + @TableField("F_SIGN_IMG") + private String signImg; + + /** + * 0.进行数据 1.加签数据 3.已办不显示数据 + */ + @TableField("F_STATUS") + private Integer status; + + /** + * 经办文件 + */ + @TableField("F_FILE_LIST") + private String fileList; + + /** + * 审批数据 + */ + @TableField("F_DRAFT_DATA") + private String draftData; + + /** + * 加签类型 + */ + @TableField("F_APPROVER_TYPE") + private Integer approverType; + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowTemplateEntity.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowTemplateEntity.java new file mode 100644 index 0000000..abbd647 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowTemplateEntity.java @@ -0,0 +1,58 @@ +package com.yunzhupaas.engine.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +/** + * 流程引擎 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年7月11日 上午9:18 + */ +@Data +@TableName("flow_template") +public class FlowTemplateEntity extends SuperExtendEntity.SuperExtendDEEntity { + + /** + * 流程编码 + */ + @TableField("F_EN_CODE") + private String enCode; + + /** + * 流程名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + + /** + * 流程类型(0.发起流程 1.功能流程) + */ + @TableField("F_TYPE") + private Integer type; + + /** + * 流程分类 + */ + @TableField("F_CATEGORY") + private String category; + + /** + * 图标 + */ + @TableField("F_ICON") + private String icon; + + /** + * 图标背景色 + */ + @TableField("F_ICON_BACKGROUND") + private String iconBackground; + + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowTemplateJsonEntity.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowTemplateJsonEntity.java new file mode 100644 index 0000000..07fa1f6 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowTemplateJsonEntity.java @@ -0,0 +1,63 @@ +package com.yunzhupaas.engine.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +/** + * 流程引擎 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024年7月11日 上午9:18 + */ +@Data +@TableName("flow_template_json") +public class FlowTemplateJsonEntity extends SuperExtendEntity.SuperExtendEnabledEntity { + + /** + * 流程模板id + */ + @TableField("F_TEMPLATE_ID") + private String templateId; + + /** + * 流程名称 + */ + @TableField("F_FULL_NAME") + private String fullName; + + /** + * 可见类型 0-全部可见、1-指定经办 + */ + @TableField("F_VISIBLE_TYPE") + private Integer visibleType; + + /** + * 流程模板 + */ + @TableField("F_FLOW_TEMPLATE_JSON") + private String flowTemplateJson; + + /** + * 流程版本 + */ + @TableField("F_VERSION") + private String version; + + /** + * 分组id + */ + @TableField("F_GROUP_ID") + private String groupId; + + /** + * 发送配置 + */ + @TableField("F_SEND_CONFIG_IDS") + private String sendConfigIds; + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowUserEntity.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowUserEntity.java new file mode 100644 index 0000000..ab2eb59 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/entity/FlowUserEntity.java @@ -0,0 +1,62 @@ +package com.yunzhupaas.engine.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.yunzhupaas.base.entity.SuperExtendEntity; +import lombok.Data; + +/** + * 流程发起用户信息 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Data +@TableName("flow_launch_user") +public class FlowUserEntity extends SuperExtendEntity { + + /** + * 组织主键 + */ + @TableField("F_ORGANIZE_ID") + private String organizeId; + + /** + * 岗位主键 + */ + @TableField("F_POSITION_ID") + private String positionId; + + /** + * 主管主键 + */ + @TableField("F_MANAGER_ID") + private String managerId; + + /** + * 上级用户 + */ + @TableField("F_SUPERIOR") + private String superior; + + /** + * 下属用户 + */ + @TableField("F_SUBORDINATE") + private String subordinate; + + /** + * 公司下所有部门 + */ + @TableField("F_DEPARTMENT") + private String department; + + /** + * 任务主键 + */ + @TableField("F_TASK_ID") + private String taskId; + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/enums/FlowAgreeRuleEnum.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/enums/FlowAgreeRuleEnum.java new file mode 100644 index 0000000..c36b013 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/enums/FlowAgreeRuleEnum.java @@ -0,0 +1,68 @@ +package com.yunzhupaas.engine.enums; + +/** + * 同意规则 + * + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/6/16 17:01 + */ +public enum FlowAgreeRuleEnum { + /** + * 不启用 + */ + notstart(1, "不启用"), + /** + * 审批人为发起人 + */ + initiator(2, "发起人"), + /** + * 审批人与上一审批节点处理人相同 + */ + node(4, "上一审批节点处理人相同"), + /** + * 审批人审批过 + */ + pass(3, "审批人有审批过"); + + private int code; + private String message; + + FlowAgreeRuleEnum(int code, String message) { + this.code = code; + this.message = message; + } + + /** + * 根据状态code获取枚举名称 + * + * @return + */ + public static FlowAgreeRuleEnum getByCode(Integer code) { + for (FlowAgreeRuleEnum status : FlowAgreeRuleEnum.values()) { + if (status.getCode().equals(code)) { + return status; + } + } + return null; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/enums/FlowErrorRuleEnum.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/enums/FlowErrorRuleEnum.java new file mode 100644 index 0000000..dc8b400 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/enums/FlowErrorRuleEnum.java @@ -0,0 +1,76 @@ +package com.yunzhupaas.engine.enums; + +/** + * 异常规则 + * + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/6/17 10:57 + */ +public enum FlowErrorRuleEnum { + /** + * 1.超级管理员 + */ + administrator(1, "超级管理员"), + /** + * 2.指定人员 + */ + initiator(2, "指定人员"), + /** + * 3.上一节点审批人指定处理人 + */ + node(3, "上一节点审批人指定处理人"), + /** + * 4.默认审批通过 + */ + pass(4, "默认审批通过"), + /** + * 5.无法提交 + */ + notSubmit(5, "无法提交"), + /** + * 6.发起者本人处理 + */ + creatorUserId(6, "发起者本人处理"); + + private int code; + private String message; + + FlowErrorRuleEnum(int code, String message) { + this.code = code; + this.message = message; + } + + /** + * 根据状态code获取枚举名称 + * + * @return + */ + public static FlowErrorRuleEnum getByCode(Integer code) { + for (FlowErrorRuleEnum status : FlowErrorRuleEnum.values()) { + if (status.getCode().equals(code)) { + return status; + } + } + return null; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/enums/FlowExtraRuleEnum.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/enums/FlowExtraRuleEnum.java new file mode 100644 index 0000000..3ad8d93 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/enums/FlowExtraRuleEnum.java @@ -0,0 +1,77 @@ +package com.yunzhupaas.engine.enums; + +/** + * 附件条件 + * + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/6/14 16:50 + */ +public enum FlowExtraRuleEnum { + /** + * 无条件 + */ + unconditional(1, "无条件"), + /** + * 同一部门 + */ + organize(2, "同一部门"), + /** + * 同一岗位 + */ + position(3, "同一岗位"), + /** + * 发起人上级 + */ + manager(4, "发起人上级"), + /** + * 发起人下属 + */ + subordinate(5, "发起人下属"), + /** + * 同一公司 + */ + department(6, "同一公司"); + + private int code; + private String message; + + FlowExtraRuleEnum(int code, String message) { + this.code = code; + this.message = message; + } + + /** + * 根据状态code获取枚举名称 + * + * @return + */ + public static FlowExtraRuleEnum getByCode(Integer code) { + for (FlowExtraRuleEnum status : FlowExtraRuleEnum.values()) { + if (status.getCode().equals(code)) { + return status; + } + } + return null; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/enums/FlowMessageEnum.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/enums/FlowMessageEnum.java new file mode 100644 index 0000000..eda50f5 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/enums/FlowMessageEnum.java @@ -0,0 +1,44 @@ +package com.yunzhupaas.engine.enums; + +/** + * 消息类型 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-29 上午9:18 + */ +public enum FlowMessageEnum { + //发起 + me(1, "me"), + //待办 + wait(2, "wait"), + //抄送 + circulate(3, "circulate"); + + private String message; + private int code; + + FlowMessageEnum(int code, String message) { + this.code = code; + this.message = message; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/enums/FlowNodeEnum.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/enums/FlowNodeEnum.java new file mode 100644 index 0000000..15ea080 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/enums/FlowNodeEnum.java @@ -0,0 +1,45 @@ +package com.yunzhupaas.engine.enums; + + +/** + * 流程节点状态 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public enum FlowNodeEnum { + //进行节点 + Process(0, "进行节点"), + //加签人 + FreeApprover(1, "加签节点"), + //无用节点 + Futility(-1, "无用节点"); + + private Integer code; + private String message; + + FlowNodeEnum(Integer code, String message) { + this.code = code; + this.message = message; + } + + public Integer getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/enums/FlowRecordEnum.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/enums/FlowRecordEnum.java new file mode 100644 index 0000000..4a813a9 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/enums/FlowRecordEnum.java @@ -0,0 +1,71 @@ +package com.yunzhupaas.engine.enums; + +/** + * 工作流开发 + * + * @author 云筑产品开发平台组 + * @version V3.0.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public enum FlowRecordEnum { + + //拒绝 + reject(0, "拒绝"), + //同意 + audit(1, "同意"), + //提交 + submit(2, "提交"), + //撤回 + revoke(3, "撤回"), + //终止 + cancel(4, "终止"), + //指派 + assign(5, "指派"), + //加签 + copyId(6, "加签"), + //转办 + transfer(7, "转办"), + //变更 + change(8, "变更"), + //复活 + resurrection(9, "复活"), + //前加签 + befoCopyId(10, "前加签"), + //挂起 + suspend(11, "挂起"), + //恢复 + restore(12, "恢复"), + //转向 + swerve(13, "转向"), + //结束 + end(100, "结束"), + //节点撤回 + recall(-1, "节点撤回"); + + private Integer code; + private String message; + + FlowRecordEnum(Integer code, String message) { + this.code = code; + this.message = message; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/enums/FlowRecordListEnum.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/enums/FlowRecordListEnum.java new file mode 100644 index 0000000..9437e1e --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/enums/FlowRecordListEnum.java @@ -0,0 +1,44 @@ +package com.yunzhupaas.engine.enums; + +/** + * 工作流开发 + * + * @author 云筑产品开发平台组 + * @version V3.0.0 + * @copyright 深圳市乐程软件有限公司 + */ +public enum FlowRecordListEnum { + + //部门 + department("1", "部门"), + // 角色 + role("2", "角色"), + //岗位 + position("3", "岗位"); + + private String code; + private String message; + + FlowRecordListEnum(String code, String message) { + this.code = code; + this.message = message; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/enums/FlowStatusEnum.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/enums/FlowStatusEnum.java new file mode 100644 index 0000000..00a2b58 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/enums/FlowStatusEnum.java @@ -0,0 +1,48 @@ +package com.yunzhupaas.engine.enums; + +/** + * 提交状态 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public enum FlowStatusEnum { + //不操作 + none("-1"), + //保存 + save("1"), + // 提交 + submit("0"); + + private String message; + + FlowStatusEnum(String message) { + this.message = message; + } + + /** + * 根据状态code获取枚举名称 + * + * @return + */ + public static FlowStatusEnum getByCode(Integer code) { + for (FlowStatusEnum status : FlowStatusEnum.values()) { + if (status.getMessage().equals(code)) { + return status; + } + } + return null; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/enums/FlowTaskOperatorEnum.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/enums/FlowTaskOperatorEnum.java new file mode 100644 index 0000000..a7ecb97 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/enums/FlowTaskOperatorEnum.java @@ -0,0 +1,99 @@ +package com.yunzhupaas.engine.enums; + +/** + * 经办对象 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public enum FlowTaskOperatorEnum { + + /** + * 发起者主管 + */ + LaunchCharge(1, "发起者主管"), + /** + * 部门经理 + */ + DepartmentCharge(2, "部门经理"), + /** + * 发起者本人 + */ + InitiatorMe(3, "发起者本人"), + /** + * 变量 + */ + Variate(4, "变量"), + /** + * 环节 + */ + Tache(5, "环节"), + /** + * 指定人 + */ + Nominator(6, "指定人"), + /** + * 候选人 + */ + Candidate(7, "候选人"), + /** + * 服务 + */ + Serve(9, "服务"); + + + private Integer code; + private String message; + + FlowTaskOperatorEnum(Integer code, String message) { + this.code = code; + this.message = message; + } + + /** + * 根据状态code获取枚举名称 + * + * @return + */ + public static String getMessageByCode(String code) { + for (FlowTaskOperatorEnum status : FlowTaskOperatorEnum.values()) { + if (status.getCode().equals(code)) { + return status.message; + } + } + return null; + } + + /** + * 根据状态code获取枚举值 + * + * @return + */ + public static FlowTaskOperatorEnum getByCode(String code) { + for (FlowTaskOperatorEnum status : FlowTaskOperatorEnum.values()) { + if (status.getCode().equals(code)) { + return status; + } + } + return null; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/enums/FlowTaskStatusEnum.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/enums/FlowTaskStatusEnum.java new file mode 100644 index 0000000..5e6c9f6 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/enums/FlowTaskStatusEnum.java @@ -0,0 +1,82 @@ +package com.yunzhupaas.engine.enums; + + +/** + * 流程状态 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-09-26 上午9:18 + */ +public enum FlowTaskStatusEnum { + //等待提交 + Draft(0, "等待提交"), + //等待审核 + Handle(1, "等待审核"), + //审核通过 + Adopt(2, "审核通过"), + //审核驳回 + Reject(3, "审核驳回"), + //撤回终止 + Revoke(4, "撤回终止"), + //审核作废 + Cancel(5, "审核作废"), + //审核挂起 + Suspend(6, "审核挂起"), + //撤回提交 + Resubmit(7, "撤回提交"); + + private int code; + private String message; + + FlowTaskStatusEnum(int code, String message) { + this.code = code; + this.message = message; + } + + /** + * 根据状态code获取枚举名称 + * + * @return + */ + public static String getMessageByCode(Integer code) { + for (FlowTaskStatusEnum status : FlowTaskStatusEnum.values()) { + if (status.getCode().equals(code)) { + return status.message; + } + } + return null; + } + + /** + * 根据状态code获取枚举值 + * + * @return + */ + public static FlowTaskStatusEnum getByCode(Integer code) { + for (FlowTaskStatusEnum status : FlowTaskStatusEnum.values()) { + if (status.getCode().equals(code)) { + return status; + } + } + return null; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/FlowHandleModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/FlowHandleModel.java new file mode 100644 index 0000000..442df14 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/FlowHandleModel.java @@ -0,0 +1,112 @@ +package com.yunzhupaas.engine.model; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import com.yunzhupaas.engine.util.FlowNature; +import lombok.Data; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:17 + */ +@Data +public class FlowHandleModel extends Pagination { + /** + * 意见 + **/ + @Schema(description = "意见") + private String handleOpinion; + /** + * 加签人 + **/ + @Schema(description = "加签人") + private String freeApproverUserId; + /** + * 加签类型 1.前 2 后 + */ + @Schema(description = "加签类型") + private Integer freeApproverType = FlowNature.Later; + /** + * 审批数据 + **/ + @Schema(description = "审批数据") + private Map formData = new HashMap<>(); + /** + * 自定义抄送人 + **/ + @Schema(description = "自定义抄送人") + private String copyIds; + /** + * 签名 + **/ + @Schema(description = "签名") + private String signImg; + /** + * 指派节点 + **/ + @Schema(description = "指派节点") + private String nodeCode; + /** + * 候选人 + */ + @Schema(description = "候选人") + private Map> candidateList = new HashMap<>(); + /** + * 异常处理人 + */ + @Schema(description = "异常处理人") + private Map> errorRuleUserList = new HashMap<>(); + /** + * 选择分支 + */ + @Schema(description = "选择分支") + private List branchList = new ArrayList<>(); + /** + * 批量审批id + */ + @Schema(description = "批量审批主键") + private List ids = new ArrayList<>(); + /** + * 经办文件 + **/ + @Schema(description = "经办文件") + private List fileList = new ArrayList<>(); + /** + * 批量审批类型 0.通过 1.拒绝 2.转办 + */ + @Schema(description = "批量审批类型") + private Integer batchType = 0; + /** + * 批量发起用户 + */ + @Schema(description = "批量发起用户") + private List delegateUserList = new ArrayList<>(); + /** + * 驳回节点 + */ + @Schema(description = "驳回节点") + private String rejectStep = FlowNature.START; + /** + * 驳回类型 1.重新审批 2.从当前节点审批 + */ + @Schema(description = "驳回类型") + private Integer rejectType = FlowNature.RestartType; + /** + * false 变更 true 复活 + */ + @Schema(description = "类型") + private Boolean resurgence = false; + /** + * true 同步子流程 false 全部子流程 + */ + @Schema(description = "冻结类型") + private Boolean suspend = false; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowBatchModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowBatchModel.java new file mode 100644 index 0000000..09c2c69 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowBatchModel.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.engine.model.flowbefore; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/1 9:17 + */ +@Data +public class FlowBatchModel { + @Schema(description = "名称") + private String fullName; + @Schema(description = "主键") + private String id; + @Schema(description = "数量") + private Long num; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowBeforeInfoVO.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowBeforeInfoVO.java new file mode 100644 index 0000000..3bb5205 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowBeforeInfoVO.java @@ -0,0 +1,43 @@ +package com.yunzhupaas.engine.model.flowbefore; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.engine.model.flowengine.shuntjson.childnode.Properties; +import lombok.Data; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:18 + */ +@Data +public class FlowBeforeInfoVO { + @Schema(description = "流程对象") + private FlowTaskModel flowTaskInfo = new FlowTaskModel(); + @Schema(description = "流程节点") + private List flowTaskNodeList = new ArrayList<>(); + @Schema(description = "流程经办数据") + private List flowTaskOperatorList = new ArrayList<>(); + @Schema(description = "流程已办数据") + private List flowTaskOperatorRecordList = new ArrayList<>(); + @Schema(description = "草稿数据") + private Map draftData; + @Schema(description = "流程json对象") + private FlowTemplateModel flowTemplateInfo = new FlowTemplateModel(); + @Schema(description = "表单对象") + private FlowFormVo flowFormInfo = new FlowFormVo(); + @Schema(description = "表单权限") + private List> formOperates = new ArrayList<>(); + @Schema(description = "表单审批权限") + private Properties approversProperties = new Properties(); + @Schema(description = "表单数据") + private Map formData = new HashMap<>(); + @Schema(description = "属性") + private Boolean noOperateAuth = false; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowBeforeListVO.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowBeforeListVO.java new file mode 100644 index 0000000..c49bfba --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowBeforeListVO.java @@ -0,0 +1,61 @@ +package com.yunzhupaas.engine.model.flowbefore; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:18 + */ +@Data +public class FlowBeforeListVO { + @Schema(description = "流程编码") + private String enCode; + @Schema(description = "发起人员") + private String creatorUserId; + @Schema(description = "接收时间") + private Long creatorTime; + @Schema(description = "经办节点") + private String thisStep; + @Schema(description = "节点id") + private String thisStepId; + @Schema(description = "所属分类") + private String flowCategory; + @Schema(description = "流程标题") + private String fullName; + @Schema(description = "所属流程") + private String flowName; + @Schema(description = "流程状态", example = "1") + private Integer status; + @Schema(description = "发起时间") + private Long startTime; + @Schema(description = "主键id") + private String id; + @Schema(description = "用户名称") + private String userName; + @Schema(description = "备注") + private String description; + @Schema(description = "流程编码") + private String flowCode; + @Schema(description = "流程主键") + private String flowId; + @Schema(description = "实例进程") + private String processId; + @Schema(description = "表单类型 1-系统表单、2-动态表单") + private Integer formType; + @Schema(description = "紧急程度") + private Integer flowUrgent; + @Schema(description = "节点") + private String nodeName; + @Schema(description = "节点对象") + private String approversProperties; + @Schema(description = "版本") + private String flowVersion; + @Schema(description = "委托") + private String delegateUser; + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowFormVo.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowFormVo.java new file mode 100644 index 0000000..3fcebbc --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowFormVo.java @@ -0,0 +1,100 @@ +package com.yunzhupaas.engine.model.flowbefore; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 流程表单对象 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/30 18:06 + */ +@Data +@Schema(description="流程表单对象") +public class FlowFormVo { + @Schema(description = "主键") + private String id; + + @Schema(description = "表单编码") + private String enCode; + + @Schema(description = "表单状态") + private Integer state; + + @Schema(description = "是否发布" ) + private Integer isRelease; + + @Schema(description = "表单名称") + private String fullName; + + @Schema(description = "流程类型") + private Integer flowType; + + @Schema(description = "表单类型") + private Integer formType; + + @Schema(description = "表单分类") + private String category; + + @Schema(description = "Web地址") + private String urlAddress; + + @Schema(description = "APP地址") + private String appUrlAddress; + + @Schema(description = "接口路径") + private String interfaceUrl; + + @Schema(description = "属性字段") + private String propertyJson; + + @Schema(description = "描述") + private String description; + + @Schema(description = "排序码") + private Long sortCode; + + @Schema(description = "有效标志") + private Integer enabledMark; + + @Schema(description = "创建时间") + private Long creatorTime; + + @Schema(description = "创建用户") + private String creatorUserId; + @Schema(description = "创建用户名") + private String creatorUser; + + @Schema(description = "修改时间") + private Long lastModifyTime; + + @Schema(description = "修改用户") + private String lastModifyUserId; + @Schema(description = "修改用户名") + private String lastModifyUser; + + @Schema(description = "删除标志") + private Integer deleteMark; + + @Schema(description = "删除时间") + private Long deleteTime; + + @Schema(description = "删除用户") + private String deleteUserId; + @Schema(description = "删除用户名") + private String deleteUser; + + @Schema(description = "草稿版本json") + private String draftJson; + + @Schema(description = "关联数据连接id") + private String dbLinkId; + + @Schema(description = "关联的表") + private String tableJson; + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowSummary.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowSummary.java new file mode 100644 index 0000000..f6c55b3 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowSummary.java @@ -0,0 +1,38 @@ +package com.yunzhupaas.engine.model.flowbefore; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:18 + */ +@Data +public class FlowSummary { + @Schema(description = "主键") + private String id; + @Schema(description = "名称") + private String fullName; + @Schema(description = "意见") + private String handleOpinion; + @Schema(description = "用户") + private String userName; + @Schema(description = "时间") + private Long handleTime; + @Schema(description = "状态") + private Integer handleStatus; + @Schema(description = "流转操作人") + private String operatorId; + @Schema(description = "子流程") + private List list; + private String fileList; + @Schema(description = "签名") + private String signImg; + @Schema(description = "头像") + private String headIcon; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowTaskModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowTaskModel.java new file mode 100644 index 0000000..c7248f8 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowTaskModel.java @@ -0,0 +1,70 @@ +package com.yunzhupaas.engine.model.flowbefore; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:18 + */ +@Data +public class FlowTaskModel { + @Schema(description = "任务主键") + private String id; + @Schema(description = "实例进程") + private String processId; + @Schema(description = "任务编码") + private String enCode; + @Schema(description = "任务标题") + private String fullName; + @Schema(description = "紧急程度") + private Integer flowUrgent; + @Schema(description = "流程主键") + private String flowId; + @Schema(description = "流程编码") + private String flowCode; + @Schema(description = "流程名称") + private String flowName; + @Schema(description = "流程类型") + private Integer flowType; + @Schema(description = "流程分类") + private String flowCategory; + @Schema(description = "流程表单") + private String flowForm; + @Schema(description = "表单内容") + private String flowFormContentJson; + @Schema(description = "流程模板") + private String flowTemplateJson; + @Schema(description = "流程版本") + private String flowVersion; + @Schema(description = "开始时间") + private Long startTime; + @Schema(description = "结束时间") + private Long endTime; + @Schema(description = "当前步骤") + private String thisStep; + @Schema(description = "当前步骤Id") + private String thisStepId; + @Schema(description = "重要等级") + private String grade; + @Schema(description = "任务状态 0-草稿、1-处理、2-通过、3-驳回、4-撤销、5-终止") + private Integer status; + @Schema(description = "完成情况") + private Integer completion; + @Schema(description = "描述") + private String description; + @Schema(description = "排序码") + private Long sortCode; + @Schema(description = "有效标志") + private Integer enabledMark; + @Schema(description = "流程类型") + private Integer type; + @Schema(description = "流程退回") + private String rejectDataId; + @Schema(description = "隐藏恢复按钮") + private Boolean suspend = false; + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowTaskNodeModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowTaskNodeModel.java new file mode 100644 index 0000000..9a3db4c --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowTaskNodeModel.java @@ -0,0 +1,49 @@ +package com.yunzhupaas.engine.model.flowbefore; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:18 + */ +@Data +public class FlowTaskNodeModel { + @Schema(description = "节点实例主键") + private String id; + @Schema(description = "节点编码") + private String nodeCode; + @Schema(description = "节点名称") + private String nodeName; + @Schema(description = "节点类型") + private String nodeType; + @Schema(description = "节点属性Json") + private String nodePropertyJson; + @Schema(description = "上一节点") + private String nodeUp; + @Schema(description = "下一节点") + private String nodeNext; + @Schema(description = "是否完成") + private Integer completion; + @Schema(description = "描述") + private String description; + @Schema(description = "排序码") + private Long sortCode; + @Schema(description = "创建时间") + private Long creatorTime; + @Schema(description = "任务主键") + private String taskId; + @Schema(description = "审核用户") + private String userName; + @Schema(description = "审批类型") + private String assigneeName; + @Schema(description = "节点类型(-1没有经过,0.经过 1.当前 2.未经过)") + private String type; + @Schema(description = "表单id") + private String formId; + + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowTaskOperatorModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowTaskOperatorModel.java new file mode 100644 index 0000000..542e941 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowTaskOperatorModel.java @@ -0,0 +1,41 @@ +package com.yunzhupaas.engine.model.flowbefore; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:18 + */ +@Data +public class FlowTaskOperatorModel { + @Schema(description = "节点经办主键") + private String id; + @Schema(description = "经办对象") + private String handleType; + @Schema(description = "经办主键") + private String handleId; + @Schema(description = "处理状态 0-拒绝、1-同意") + private Integer handleStatus; + @Schema(description = "处理时间") + private Long handleTime; + @Schema(description = "节点编码") + private String nodeCode; + @Schema(description = "节点名称") + private String nodeName; + @Schema(description = "是否完成") + private Integer completion; + @Schema(description = "描述") + private String description; + @Schema(description = "创建时间") + private Long creatorTime; + @Schema(description = "节点主键") + private String taskNodeId; + @Schema(description = "任务主键") + private String taskId; + @Schema(description = "草稿数据") + private String draftData; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowTaskOperatorRecordModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowTaskOperatorRecordModel.java new file mode 100644 index 0000000..078a4f3 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowTaskOperatorRecordModel.java @@ -0,0 +1,53 @@ +package com.yunzhupaas.engine.model.flowbefore; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:18 + */ +@Data +public class FlowTaskOperatorRecordModel { + @Schema(description = "节点流转主键") + private String id; + @Schema(description = "节点编码") + private String nodeCode; + @Schema(description = "节点名称") + private String nodeName; + @Schema(description = "经办状态 0-拒绝、1-同意、2-提交、3-撤回、4-终止") + private Integer handleStatus; + @Schema(description = "经办人员") + private String handleId; + @Schema(description = "经办时间") + private Long handleTime; + @Schema(description = "经办理由") + private String handleOpinion; + @Schema(description = "经办主键") + private String taskOperatorId; + @Schema(description = "节点主键") + private String taskNodeId; + @Schema(description = "任务主键") + private String taskId; + @Schema(description = "用户名称") + private String userName; + @Schema(description = "签名") + private String signImg; + @Schema(description = "判断加签人") + private Integer status; + @Schema(description = "流转操作人") + private String operatorId; + @Schema(description = "经办文件") + private String fileList; + @Schema(description = "加签类型") + private Integer approverType; + @Schema(description = "审批数据") + private String draftData; + @Schema(description = "任务接受时间") + private Long creatorTime; + @Schema(description = "异常日志") + private Boolean isLog; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowTaskUserListModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowTaskUserListModel.java new file mode 100644 index 0000000..b9c9ca0 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowTaskUserListModel.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.engine.model.flowbefore; + +import com.yunzhupaas.base.Pagination; +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/1 9:17 + */ +@Data +public class FlowTaskUserListModel extends Pagination { + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowTemplateAllModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowTemplateAllModel.java new file mode 100644 index 0000000..91da0fd --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowTemplateAllModel.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.engine.model.flowbefore; + +import com.yunzhupaas.engine.entity.FlowTemplateEntity; +import com.yunzhupaas.engine.entity.FlowTemplateJsonEntity; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:18 + */ +@Data +public class FlowTemplateAllModel { + private FlowTemplateJsonEntity templateJson = new FlowTemplateJsonEntity(); + private FlowTemplateEntity template = new FlowTemplateEntity(); + private List templateJsonList = new ArrayList<>(); +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowTemplateModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowTemplateModel.java new file mode 100644 index 0000000..a52f844 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowTemplateModel.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.engine.model.flowbefore; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:18 + */ +@Data +public class FlowTemplateModel { + @Schema(description = "主键") + private String id; + @Schema(description = "流程基本主键") + private String templateId; + @Schema(description = "名称") + private String fullName; + @Schema(description = "类型") + private Integer visibleType; + @Schema(description = "json字段") + private String flowTemplateJson; + @Schema(description = "版本") + private String version; + @Schema(description = "类型") + private Integer type; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowUserListModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowUserListModel.java new file mode 100644 index 0000000..3ce7ada --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowbefore/FlowUserListModel.java @@ -0,0 +1,30 @@ +package com.yunzhupaas.engine.model.flowbefore; + +import com.yunzhupaas.engine.entity.*; +import lombok.Data; + +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/1 9:17 + */ +@Data +public class FlowUserListModel { + + private List allUserIdList; + + private FlowTaskEntity flowTask; + + private List operatorList; + +// private List operatorUserList; + + private List circulateList; + + private List operatorRecordList; + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowcandidate/FlowCandidateListModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowcandidate/FlowCandidateListModel.java new file mode 100644 index 0000000..7888bf0 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowcandidate/FlowCandidateListModel.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.engine.model.flowcandidate; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Data +public class FlowCandidateListModel { + @Schema(description = "节点编码") + private String nodeId; + @Schema(description = "节点名称") + private String nodeName; + @Schema(description = "是否分流") + private Boolean isCandidates = false; + @Schema(description = "是否选择分支") + private Boolean isBranchFlow = false; + @Schema(description = "是否候选人") + private Boolean hasCandidates = false; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowcandidate/FlowCandidateUserModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowcandidate/FlowCandidateUserModel.java new file mode 100644 index 0000000..f99376f --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowcandidate/FlowCandidateUserModel.java @@ -0,0 +1,22 @@ +package com.yunzhupaas.engine.model.flowcandidate; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Data +public class FlowCandidateUserModel { + @Schema(description = "主键") + private String id; + @Schema(description = "名称") + private String fullName; + @Schema(description = "头像") + private String headIcon; + @Schema(description = "组织") + private String organize; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowcandidate/FlowCandidateVO.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowcandidate/FlowCandidateVO.java new file mode 100644 index 0000000..e988e18 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowcandidate/FlowCandidateVO.java @@ -0,0 +1,27 @@ +package com.yunzhupaas.engine.model.flowcandidate; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Data +public class FlowCandidateVO { + + @Schema(description = "节点") + private List list; + /** + * 1.有分支 //2.没有分支有候选人 //3.没有分支也没有候选人 + */ + @Schema(description = "类型") + private Integer type; + + @Schema(description = "会签是否完成") + private Boolean countersignOver = true; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowcandidate/FlowRejectVO.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowcandidate/FlowRejectVO.java new file mode 100644 index 0000000..4e6169b --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowcandidate/FlowRejectVO.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.engine.model.flowcandidate; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.engine.model.flowtask.TaskNodeModel; +import lombok.Data; + +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Data +public class FlowRejectVO { + @Schema(description = "节点") + private List list; + @Schema(description = "是否选择") + private Boolean isLastAppro = true; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowcomment/FlowCommentForm.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowcomment/FlowCommentForm.java new file mode 100644 index 0000000..dda2af8 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowcomment/FlowCommentForm.java @@ -0,0 +1,30 @@ +package com.yunzhupaas.engine.model.flowcomment; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 版本: V3.1.0 + * 版权: 深圳市乐程软件有限公司 + * 作者: 云筑产品开发平台组 + */ +@Data +public class FlowCommentForm { + + @Schema(description = "附件") + private String file; + + @Schema(description = "图片") + private String image; + + @Schema(description = "流程id") + private String taskId; + + @Schema(description = "文本") + private String text; + + @Schema(description = "回复ID") + private String replyId; + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowcomment/FlowCommentInfoVO.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowcomment/FlowCommentInfoVO.java new file mode 100644 index 0000000..65fc3f8 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowcomment/FlowCommentInfoVO.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.engine.model.flowcomment; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 版本: V3.1.0 + * 版权: 深圳市乐程软件有限公司 + * 作者: 云筑产品开发平台组 + */ +@Data +public class FlowCommentInfoVO { + + @Schema(description = "附件") + private String file; + + @Schema(description = "图片") + private String image; + + @Schema(description = "流程id") + private String taskId; + + @Schema(description = "文本") + private String text; + + @Schema(description = "主键") + private String id; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowcomment/FlowCommentListVO.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowcomment/FlowCommentListVO.java new file mode 100644 index 0000000..7e5cc4c --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowcomment/FlowCommentListVO.java @@ -0,0 +1,52 @@ +package com.yunzhupaas.engine.model.flowcomment; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 版本: V3.1.0 + * 版权: 深圳市乐程软件有限公司 + * 作者: 云筑产品开发平台组 + */ +@Data +public class FlowCommentListVO { + + @Schema(description = "附件") + private String file; + + @Schema(description = "图片") + private String image; + + @Schema(description = "流程id") + private String taskId; + + @Schema(description = "文本") + private String text; + + @Schema(description = "创建人") + private String creatorUserId; + + @Schema(description = "创建人") + private String creatorUser; + + @Schema(description = "头像") + private String creatorUserHeadIcon; + + @Schema(description = "创建时间") + private Long creatorTime; + + //0-删除按钮隐藏 1-删除按钮显示 2-评论被删. + @Schema(description = "是否删除显示") + private Integer isDel; + + @Schema(description = "主键") + private String id; + + @Schema(description = "回复用户") + private String replyUser; + + @Schema(description = "回复内容") + private String replyText; + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowcomment/FlowCommentPagination.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowcomment/FlowCommentPagination.java new file mode 100644 index 0000000..890e3d4 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowcomment/FlowCommentPagination.java @@ -0,0 +1,19 @@ +package com.yunzhupaas.engine.model.flowcomment; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import lombok.Data; + +/** + * 版本: V3.1.0 + * 版权: 深圳市乐程软件有限公司 + * 作者: 云筑产品开发平台组 + */ +@Data +public class FlowCommentPagination extends Pagination { + + @Schema(description = "任务主键") + private String taskId; + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowdelegate/FlowDelegatListVO.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowdelegate/FlowDelegatListVO.java new file mode 100644 index 0000000..04fc4a9 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowdelegate/FlowDelegatListVO.java @@ -0,0 +1,40 @@ +package com.yunzhupaas.engine.model.flowdelegate; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:18 + */ +@Data +public class FlowDelegatListVO { + @Schema(description = "主键id") + private String id; + @Schema(description = "委托类型0-发起委托,1-审批委托") + private String type; + @Schema(description = "委托人id") + private String userId; + @Schema(description = "委托人") + private String userName; + @Schema(description = "被委托人id") + private String toUserId; + @Schema(description = "被委托人") + private String toUserName; + @Schema(description = "描述") + private String description; + @Schema(description = "开始日期") + private Long startTime; + @Schema(description = "结束日期") + private Long endTime; + @Schema(description = "委托流程id") + private String flowId; + @Schema(description = "委托流程名称") + private String flowName; + @Schema(description = "有效标志") + private Integer enabledMark; + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowdelegate/FlowDelegateCrForm.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowdelegate/FlowDelegateCrForm.java new file mode 100644 index 0000000..cebe648 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowdelegate/FlowDelegateCrForm.java @@ -0,0 +1,46 @@ +package com.yunzhupaas.engine.model.flowdelegate; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:18 + */ +@Data +public class FlowDelegateCrForm { + @Schema(description = "委托人名称") + @NotBlank(message = "必填") + private String userName; + @Schema(description = "委托人id") + @NotBlank(message = "必填") + private String userId; + @Schema(description = "被委托人") + @NotBlank(message = "必填") + private String toUserName; + @Schema(description = "被委托人id") + @NotBlank(message = "必填") + private String toUserId; + @Schema(description = "委托类型(0-发起委托,1-审批委托)") + @NotBlank(message = "必填") + private String type; + @Schema(description = "描述") + private String description; + @Schema(description = "开始日期") + @NotNull(message = "必填") + private Long startTime; + @Schema(description = "结束日期") + @NotNull(message = "必填") + private Long endTime; + @Schema(description = "委托流程id") + private String flowId; + @Schema(description = "委托流程名称") + @NotBlank(message = "必填") + private String flowName; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowdelegate/FlowDelegateInfoVO.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowdelegate/FlowDelegateInfoVO.java new file mode 100644 index 0000000..e50b473 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowdelegate/FlowDelegateInfoVO.java @@ -0,0 +1,39 @@ +package com.yunzhupaas.engine.model.flowdelegate; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:18 + */ +@Data +public class FlowDelegateInfoVO { + @Schema(description = "主键id") + private String id; + @Schema(description = "委托类型0-发起委托,1-审批委托") + private String type; + @Schema(description = "委托人id") + private String userId; + @Schema(description = "委托人") + private String userName; + @Schema(description = "流程分类") + private String flowCategory; + @Schema(description = "被委托人") + private String toUserName; + @Schema(description = "被委托人") + private String toUserId; + @Schema(description = "描述") + private String description; + @Schema(description = "开始日期") + private Long startTime; + @Schema(description = "结束日期") + private Long endTime; + @Schema(description = "委托流程id") + private String flowId; + @Schema(description = "委托流程名称") + private String flowName; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowdelegate/FlowDelegateModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowdelegate/FlowDelegateModel.java new file mode 100644 index 0000000..86d090c --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowdelegate/FlowDelegateModel.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.engine.model.flowdelegate; + +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.engine.entity.FlowTaskEntity; +import com.yunzhupaas.engine.model.flowbefore.FlowTemplateAllModel; +import com.yunzhupaas.engine.util.FlowNature; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:18 + */ +@Data +public class FlowDelegateModel { + //true 委托 false 审批 + private Boolean delegate = true; + //0.发起 1.审批 2.结束 + private Integer type = FlowNature.StartMsg; + private List toUserIds = new ArrayList<>(); + private UserInfo userInfo = new UserInfo(); + private FlowTaskEntity flowTask = new FlowTaskEntity(); + private FlowTemplateAllModel templateAllModel = new FlowTemplateAllModel(); + //审批是否要发送消息 + private Boolean approve = true; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowdelegate/FlowDelegatePagination.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowdelegate/FlowDelegatePagination.java new file mode 100644 index 0000000..eff0ce0 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowdelegate/FlowDelegatePagination.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.engine.model.flowdelegate; + +import com.yunzhupaas.base.Pagination; +import lombok.Data; + +/** + * 流程设计 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/10/14 9:23:27 + */ +@Data +public class FlowDelegatePagination extends Pagination { + private String myOrDelagateToMe; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowdelegate/FlowDelegateUpForm.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowdelegate/FlowDelegateUpForm.java new file mode 100644 index 0000000..6736090 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowdelegate/FlowDelegateUpForm.java @@ -0,0 +1,15 @@ +package com.yunzhupaas.engine.model.flowdelegate; + +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:18 + */ +@Data +public class FlowDelegateUpForm extends FlowDelegateCrForm { + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/FlowDataModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/FlowDataModel.java new file mode 100644 index 0000000..533a1d7 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/FlowDataModel.java @@ -0,0 +1,28 @@ +package com.yunzhupaas.engine.model.flowengine; + +import com.yunzhupaas.engine.entity.FlowTaskNodeEntity; +import com.yunzhupaas.engine.model.flowengine.shuntjson.nodejson.ChildNodeList; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:16 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class FlowDataModel { + private ChildNodeList childNodeList; + private List taskNodeList; + private FlowModel flowModel; + private Boolean isAssig = true; + private Boolean isData = true; + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/FlowModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/FlowModel.java new file mode 100644 index 0000000..37ad0a5 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/FlowModel.java @@ -0,0 +1,115 @@ +package com.yunzhupaas.engine.model.flowengine; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.constant.MsgCode; +import com.yunzhupaas.engine.enums.FlowStatusEnum; +import com.yunzhupaas.engine.model.FlowHandleModel; +import com.yunzhupaas.engine.util.FlowNature; +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:17 + */ +@Data +public class FlowModel extends FlowHandleModel { + /** + * 判断新增 + **/ + @Schema(description = "判断新增") + private String id; + /** + * 引擎id + **/ + @Schema(description = "引擎主键") + private String flowId; + /** + * 流程主键 + **/ + @Schema(description = "流程主键") + private String processId; + /** + * 流程标题 + **/ + @Schema(description = "流程标题") + private String flowTitle; + /** + * 紧急程度 + **/ + @Schema(description = "紧急程度") + private Integer flowUrgent = 1; + /** + * 流水号 + **/ + @Schema(description = "流水号") + private String billNo; + /** + * 0.提交 1.保存 + **/ + @Schema(description = "类型") + private String status = FlowStatusEnum.save.getMessage(); + /** + * 子流程 + **/ + @Schema(description = "子流程") + private String parentId = FlowNature.ParentId; + /** + * 创建人 + **/ + @Schema(description = "创建人") + private String userId; + /** + * 被委托人 + */ + @Schema(description = "被委托人") + private String delegateUser; + /** + * 当前经办id + **/ + @Schema(description = "当前经办id") + private String taskOperatorId; + /** + * 回流id + */ + @Schema(description = "回流主键") + private String rollbackId; + /** + * 任务主键 + */ + @Schema(description = "任务主键") + private String taskId; + /** + * 任务主键 + */ + @Schema(description = "变更节点") + private String taskNodeId; + /** + * 是否冻结审批 + */ + private Boolean rejectUser = false; + /** + * 是否子流程 + **/ + private Boolean isAsync = false; + /** + * 用户信息 + */ + private UserInfo userInfo; + /** + * 定时器 + */ + private Boolean isTimer = false; + /** + * 系统主键 + */ + private String systemId; + /** + * 自动审批 + */ + private Boolean voluntarily = false; + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/FlowNextModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/FlowNextModel.java new file mode 100644 index 0000000..8ef651b --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/FlowNextModel.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.engine.model.flowengine; + +import com.yunzhupaas.engine.entity.FlowTaskNodeEntity; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/6/1 11:13 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class FlowNextModel { + private List nodeListAll = new ArrayList<>(); + private List nextNodeEntity = new ArrayList<>(); + private FlowTaskNodeEntity taskNode; + private FlowModel flowModel; + private Boolean isCountersign = false; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/FlowOperator.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/FlowOperator.java new file mode 100644 index 0000000..a7a81fd --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/FlowOperator.java @@ -0,0 +1,38 @@ +package com.yunzhupaas.engine.model.flowengine; + +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.engine.entity.FlowTaskEntity; +import com.yunzhupaas.engine.entity.FlowTaskNodeEntity; +import com.yunzhupaas.engine.entity.FlowTaskOperatorEntity; +import com.yunzhupaas.engine.model.flowengine.shuntjson.nodejson.ChildNodeList; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/6/1 11:13 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class FlowOperator { + private UserInfo userInfo; + private FlowModel flowModel; + private FlowTaskEntity flowTask; + private List nodeList; + private List taskNodeListAll; + private List operatorListAll; + private boolean reject = false; + private Map> asyncTaskList = new HashMap<>(); + private Map> nodeTaskIdList = new HashMap<>(); +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/FlowOperatordModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/FlowOperatordModel.java new file mode 100644 index 0000000..0b57450 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/FlowOperatordModel.java @@ -0,0 +1,45 @@ +package com.yunzhupaas.engine.model.flowengine; + +import com.yunzhupaas.engine.entity.FlowTaskOperatorEntity; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/7/14 9:17 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class FlowOperatordModel { + /** + * 审批状态 + */ + private Integer status; + /** + * 审批原因 + */ + private FlowModel flowModel; + /** + * 审核人 + */ + private String userId; + /** + * 节点对象 + */ + private FlowTaskOperatorEntity operator; + /** + * 流转操作人 + */ + private String operatorId; + /** + * 自动审批 + */ + private Boolean voluntarily = false; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/FlowPagination.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/FlowPagination.java new file mode 100644 index 0000000..88febb3 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/FlowPagination.java @@ -0,0 +1,26 @@ +package com.yunzhupaas.engine.model.flowengine; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.Pagination; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +@Schema(description = "分页模型") +public class FlowPagination extends Pagination { + + @Schema(description = "分类") + private String category; + @Schema(description = "类型") + private Integer flowType; + @Schema(description = "标志") + private Integer enabledMark; + @Schema(description = "类型") + private Integer type; + @JsonIgnore + private List templateIdList = new ArrayList<>(); +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/FlowTaskNodeRejectModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/FlowTaskNodeRejectModel.java new file mode 100644 index 0000000..46e1c09 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/FlowTaskNodeRejectModel.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.engine.model.flowengine; + +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:17 + */ +@Data +public class FlowTaskNodeRejectModel { + private String id; + private String nodeCode; + private String nodeName; + private String completion; + private Integer state; + private String nodeNext; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/FlowTaskOperatorRejectModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/FlowTaskOperatorRejectModel.java new file mode 100644 index 0000000..3e7fd2f --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/FlowTaskOperatorRejectModel.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.engine.model.flowengine; + +import lombok.Data; + +import java.util.Date; + +/** + * 流程设计 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/11/10 10:53:15 + */ +@Data +public class FlowTaskOperatorRejectModel { + private String id; + private Integer state; + private Integer handleStatus; + private Date handleTime; + // private Integer completion; + private String draftData; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/FlowTaskRejectModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/FlowTaskRejectModel.java new file mode 100644 index 0000000..0b69fb5 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/FlowTaskRejectModel.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.engine.model.flowengine; + +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:17 + */ +@Data +public class FlowTaskRejectModel { + private String id; + private String thisStep; + private String thisStepId; + private Integer status; + private String nodeNext; + private Integer completion; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/FlowUpModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/FlowUpModel.java new file mode 100644 index 0000000..bd01671 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/FlowUpModel.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.engine.model.flowengine; + +import com.yunzhupaas.engine.entity.FlowTaskEntity; +import com.yunzhupaas.engine.entity.FlowTaskNodeEntity; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class FlowUpModel { + private FlowTaskEntity flowTask; + private FlowTaskNodeEntity taskNode; + private List taskNodeList; + private Boolean isReject = false; + private Boolean rejectType = true; + private FlowModel flowModel; + private Boolean isAudit = false; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/FlowUpdateNode.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/FlowUpdateNode.java new file mode 100644 index 0000000..11f9e77 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/FlowUpdateNode.java @@ -0,0 +1,35 @@ +package com.yunzhupaas.engine.model.flowengine; + +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.engine.entity.FlowTaskEntity; +import com.yunzhupaas.engine.entity.FlowTaskNodeEntity; +import com.yunzhupaas.engine.model.flowengine.shuntjson.childnode.ChildNode; +import com.yunzhupaas.engine.model.flowengine.shuntjson.nodejson.ChildNodeList; +import com.yunzhupaas.engine.model.flowengine.shuntjson.nodejson.ConditionList; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/6/1 12:43 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class FlowUpdateNode { + private UserInfo userInfo; + private FlowTaskEntity flowTask; + private ChildNode childNodeAll; + private List nodeListAll; + private List conditionListAll; + private List taskNodeList; + private boolean isSubmit = false; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/ChildNode.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/ChildNode.java new file mode 100644 index 0000000..f682428 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/ChildNode.java @@ -0,0 +1,29 @@ +package com.yunzhupaas.engine.model.flowengine.shuntjson.childnode; + +import lombok.Data; + +import java.util.List; + +/** + * 解析引擎 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:12 + */ +@Data +public class ChildNode { + private String type; + private String content; + private Properties properties = new Properties(); + private String nodeId; + private String prevId; + private ChildNode childNode; + private String conditionType; + private List conditionNodes; + private Boolean isInterflow = false; + private Boolean isBranchFlow = false; + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/CounterSign.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/CounterSign.java new file mode 100644 index 0000000..d602790 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/CounterSign.java @@ -0,0 +1,47 @@ +package com.yunzhupaas.engine.model.flowengine.shuntjson.childnode; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.engine.util.FlowNature; +import lombok.Data; + +/** + * 解析引擎 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Data +public class CounterSign { + /** + * 通过类型 0.无 1.百分比 2.人数 + */ + @Schema(description = "通过类型") + private Integer auditType = FlowNature.RejectPercent; + /** + * 通过百分比 + */ + @Schema(description = "通过百分比") + private Integer auditRatio = 100; + /** + * 通过人数 + */ + @Schema(description = "通过人数") + private Integer auditNum = 1; + /** + * 拒绝类型 0.无 1.百分比 2.人数 + */ + @Schema(description = "拒绝类型") + private Integer rejectType = FlowNature.RejectNo; + /** + * 拒绝百分比 + */ + @Schema(description = "拒绝百分比") + private Integer rejectRatio = 10; + /** + * 拒绝人数 + */ + @Schema(description = "拒绝人数") + private Integer rejectNum = 1; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/FlowAssignModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/FlowAssignModel.java new file mode 100644 index 0000000..ac56164 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/FlowAssignModel.java @@ -0,0 +1,31 @@ +package com.yunzhupaas.engine.model.flowengine.shuntjson.childnode; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 解析引擎 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Data +public class FlowAssignModel { + /** + * 节点编码 + */ + @Schema(description = "节点编码") + private String nodeId; + + /** + * 传递规则 + */ + @Schema(description = "传递规则") + private List ruleList = new ArrayList<>(); + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/FuncConfig.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/FuncConfig.java new file mode 100644 index 0000000..4f2719d --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/FuncConfig.java @@ -0,0 +1,27 @@ +package com.yunzhupaas.engine.model.flowengine.shuntjson.childnode; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/3/31 14:53 + */ +@Data +public class FuncConfig { + + @Schema(description = "类型") + private Boolean on = false; + @Schema(description = "消息主键") + private String msgId; + @Schema(description = "接口主键") + private String interfaceId; + @Schema(description = "数据") + private List templateJson = new ArrayList<>(); +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/GroupsModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/GroupsModel.java new file mode 100644 index 0000000..c4f1aaa --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/GroupsModel.java @@ -0,0 +1,27 @@ +package com.yunzhupaas.engine.model.flowengine.shuntjson.childnode; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class GroupsModel { + //1.字段 2.公式 + @Schema(description = "类型") + private int fieldType = 1; + @Schema(description = "类型") + //1.数据里面获取 //2.解析表达式 + private String field; + @Schema(description = "类型") + //1.字段 2.自定义 + private int fieldValueType = 2; + @Schema(description = "类型") + //1.数据里面获取 2.直接获取 + private Object fieldValue; + @Schema(description = "属性") + private String symbol; + @Schema(description = "类型") + private String yunzhupaasKey; + @Schema(description = "类型") + private String fieldValueYunzhupaasKey; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/LimitModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/LimitModel.java new file mode 100644 index 0000000..e8cfae9 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/LimitModel.java @@ -0,0 +1,36 @@ +package com.yunzhupaas.engine.model.flowengine.shuntjson.childnode; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/6/17 17:53 + */ +@Data +public class LimitModel { + /** + * 限时设置 0.关闭 1.自定义 2.同步发起配置 + */ + @Schema(description = "限时设置") + private Integer on = 0; + /** + * 开始时间 0-接收时间,1-发起时间,2-表单变量 + */ + @Schema(description = "开始类型") + private Integer nodeLimit = 0; + /** + * 表单字段key + */ + @Schema(description = "表单字段key") + private String formField = ""; + /** + * 处理限定时长默认24 (小时) + */ + @Schema(description = "处理限定时长默认24") + private Integer duringDeal = 24; +} + + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/MsgConfig.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/MsgConfig.java new file mode 100644 index 0000000..ec4a8d0 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/MsgConfig.java @@ -0,0 +1,30 @@ +package com.yunzhupaas.engine.model.flowengine.shuntjson.childnode; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 解析引擎 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Data +public class MsgConfig { + /** + * 0.关闭 1.自定义 2.同步发起配置 3.默认 + */ + @Schema(description = "类型") + private Integer on = 0; + @Schema(description = "消息主键") + private String msgId; + @Schema(description = "接口主键") + private String interfaceId; + @Schema(description = "数据") + private List templateJson = new ArrayList<>(); +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/ProperCond.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/ProperCond.java new file mode 100644 index 0000000..af2f87b --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/ProperCond.java @@ -0,0 +1,25 @@ +package com.yunzhupaas.engine.model.flowengine.shuntjson.childnode; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.emnus.SearchMethodEnum; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 解析引擎 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:10 + */ +@Data +public class ProperCond { + @Schema(description = "表达式") + private String logic = SearchMethodEnum.And.getSymbol(); + @Schema(description = "条件") + private List groups = new ArrayList<>(); +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/Properties.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/Properties.java new file mode 100644 index 0000000..97aeaf4 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/Properties.java @@ -0,0 +1,525 @@ +package com.yunzhupaas.engine.model.flowengine.shuntjson.childnode; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.emnus.SearchMethodEnum; +import com.yunzhupaas.engine.enums.FlowErrorRuleEnum; +import com.yunzhupaas.engine.enums.FlowExtraRuleEnum; +import com.yunzhupaas.engine.enums.FlowTaskOperatorEnum; +import com.yunzhupaas.engine.util.FlowNature; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * 解析引擎 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Data +public class Properties { + + /** + * 流程代办 + */ + @Schema(description = "流程代办") + public MsgConfig waitMsgConfig = new MsgConfig(); + /** + * 流程结束 + */ + @Schema(description = "流程结束") + public MsgConfig endMsgConfig = new MsgConfig(); + /** + * 节点同意 + */ + @Schema(description = "流程结束") + public MsgConfig approveMsgConfig = new MsgConfig(); + /** + * 节点拒绝 + */ + @Schema(description = "节点拒绝") + public MsgConfig rejectMsgConfig = new MsgConfig(); + /** + * 节点抄送 + */ + @Schema(description = "节点抄送") + public MsgConfig copyMsgConfig = new MsgConfig(); + /** + * 子流程 + */ + @Schema(description = "子流程") + public MsgConfig launchMsgConfig = new MsgConfig(); + /** + * 超时 + */ + @Schema(description = "超时") + public MsgConfig overtimeMsgConfig = new MsgConfig(); + /** + * 提醒 + */ + @Schema(description = "提醒") + public MsgConfig noticeMsgConfig = new MsgConfig(); + //--------------------------超时配置------------------------------ + /** + * 转向节点 + **/ + @Schema(description = "转向节点") + public String swerveNode; + /** + * 会签比例 + **/ + @Schema(description = "会签比例") + public CounterSign counterSignConfig = new CounterSign(); + /** + * 限时设置 + */ + @Schema(description = "限时设置") + private LimitModel timeLimitConfig = new LimitModel(); + /** + * 超时设置 + */ + @Schema(description = "超时设置") + private TimeModel overTimeConfig = new TimeModel(); + /** + * 提醒设置 + */ + @Schema(description = "提醒设置") + private TimeModel noticeConfig = new TimeModel(); + /** + * condition属性 + **/ + @Schema(description = "属性") + private Boolean isDefault = false; + @Schema(description = "属性") + private List conditions = new ArrayList<>(); + @Schema(description = "属性") + private String matchLogic = SearchMethodEnum.And.getSymbol(); + /** + * approver属性 + **/ + @Schema(description = "名称") + private String title; + /** + * 复活取值 0.复活最后数据 1.复活当时数据 + **/ + @Schema(description = "复活取值") + private Integer resurgenceDataRule = FlowNature.ResurgenceLast; + /** + * 异常处理规则 1.超级管理员 2.指定用户 3.上一节点审批人 4.默认通过 5.无法提交 6.流程发起人 + */ + @Schema(description = "异常处理规则") + private Integer errorRule = FlowErrorRuleEnum.administrator.getCode(); + /** + * 事件处理规则 + */ + @Schema(description = "事件处理规则") + private Integer funcConfigRule = FlowNature.FuncResume; + /** + * 指定人员处理异常 + */ + @Schema(description = "指定人员处理异常") + private List errorRuleUser = new ArrayList<>(); + /** + * 同意附加条件 1.无条件 2.同一部门 3.同一岗位 4.发起人上级 5.发起人下属 + */ + @Schema(description = "同意附加条件") + private Integer extraRule = FlowExtraRuleEnum.unconditional.getCode(); + /** + * 抄送附加条件 1.无条件 2.同一部门 3.同一岗位 4.发起人上级 5.发起人下属 + */ + @Schema(description = "抄送附加条件") + private Integer extraCopyRule = FlowExtraRuleEnum.unconditional.getCode(); + /** + * 自动同意规则,默认不启用 + */ + @Schema(description = "自动同意规则") + private Boolean hasAgreeRule = false; + /** + * 自动同意规则 1.不启用 2.审批人为发起人 3.审批人与上一审批节点处理人相同 4.审批人审批过 + */ + @Schema(description = "自动同意规则") + private List agreeRules = new ArrayList<>(); + /** + * 发起人 + **/ + @Schema(description = "发起人") + private List initiator = new ArrayList<>(); + /** + * 审批人 + **/ + @Schema(description = "审批人") + private List approvers = new ArrayList<>(); + /** + * 经办对象 + **/ + @Schema(description = "经办对象") + private Integer assigneeType = FlowTaskOperatorEnum.InitiatorMe.getCode(); + /** + * 字段 + **/ + @Schema(description = "字段") + private List> formOperates = new ArrayList<>(); + /** + * 传阅人 + **/ + @Schema(description = "传阅人") + private List circulateUser = new ArrayList<>(); + /** + * 流程进度 + **/ + @Schema(description = "流程进度") + private Integer progress = 50; + /** + * 驳回节点 + **/ + @Schema(description = "驳回节点") + private String rejectStep = FlowNature.START; + /** + * 驳回类型 1.重新审批 2.从当前节点审批 + */ + @Schema(description = "驳回类型") + private Integer rejectType = FlowNature.RestartType; + /** + * 备注 + **/ + @Schema(description = "备注") + private String description; + /** + * 标题设置 0-默认,1-自定义 + */ + @Schema(description = "标题设置") + private Integer titleType = FlowNature.TitleType; + /** + * 拒绝事件 + **/ + @Schema(description = "拒绝事件") + private FuncConfig rejectFuncConfig = new FuncConfig(); + /** + * 同意事件 + **/ + @Schema(description = "同意事件") + private FuncConfig approveFuncConfig = new FuncConfig(); + /** + * 开始事件 + **/ + @Schema(description = "开始事件") + private FuncConfig initFuncConfig = new FuncConfig(); + /** + * 结束事件 + **/ + @Schema(description = "结束事件") + private FuncConfig endFuncConfig = new FuncConfig(); + /** + * 超时事件 + **/ + @Schema(description = "超时事件") + private FuncConfig overtimeFuncConfig = new FuncConfig(); + /** + * 提醒事件 + */ + @Schema(description = "提醒事件") + private FuncConfig noticeFuncConfig = new FuncConfig(); + /** + * 节点撤回事件 + **/ + @Schema(description = "节点撤回事件") + private FuncConfig recallFuncConfig = new FuncConfig(); + /** + * 发起撤回事件 + **/ + @Schema(description = "发起撤回事件") + private FuncConfig flowRecallFuncConfig = new FuncConfig(); + /** + * 接口服务 + **/ + @Schema(description = "接口服务") + private FuncConfig interfaceConfig = new FuncConfig(); + /** + * 天 + **/ + @Schema(description = "天") + private Integer day = 0; + /** + * 时 + **/ + @Schema(description = "时") + private Integer hour = 0; + /** + * 分 + **/ + @Schema(description = "分") + private Integer minute = 0; + /** + * 秒 + **/ + @Schema(description = "秒") + private Integer second = 0; + /** + * 指定人审批(0:或签 1:会签 2.依次审批) + **/ + @Schema(description = "指定人审批") + private Integer counterSign = FlowNature.FixedApprover; + /** + * 自定义抄送人 + **/ + @Schema(description = "自定义抄送人") + private Boolean isCustomCopy = false; + /** + * 子流程自动提交 + **/ + @Schema(description = "子流程自动提交") + private Boolean autoSubmit = false; + /** + * 依次审批人 + */ + @Schema(description = "依次审批人") + private List approversSortList = new ArrayList<>(); + /** + * 表单抄送人 + **/ + @Schema(description = "表单抄送人") + private Boolean isFormFieldCopy = false; + /** + * 表单变量字段 + **/ + @Schema(description = "表单变量字段") + private String copyFormField; + /** + * 表单变量类型 + **/ + @Schema(description = "表单变量类型") + private String copyFormFieldType; + /** + * 发起撤回 1-撤回终止 2-撤回重新提交. + **/ + @Schema(description = "发起撤回") + private Integer revokeRule = FlowNature.RevokeTerminate; + /** + * 条件类型 0-条件 1-转向. + **/ + @Schema(description = "条件类型") + private Integer conditionType = 0; + /** + * 是否抄送发起人. + **/ + @Schema(description = "是否抄送发起人") + private Boolean isInitiatorCopy = false; + /** + * 发起人的第几级主管 + **/ + @Schema(description = "发起人的第几级主管") + private Integer managerLevel = 1; + /** + * 部门的第几级主管 + **/ + @Schema(description = "部门的第几级主管") + private Integer departmentLevel = 1; + /** + * 表单字段 + **/ + @Schema(description = "表单字段") + private String formField; + /** + * 审批节点 + **/ + @Schema(description = "审批节点") + private String nodeId; + /** + * 审批人为空时是否自动通过 + **/ + @Schema(description = "审批人为空时是否自动通过") + private Boolean noApproverHandler = false; + /** + * 前台按钮权限 + **/ + @Schema(description = "前台按钮权限") + private Boolean hasAuditBtn = true; + /** + * 前台通过 + **/ + @Schema(description = "前台通过") + private String auditBtnText = "通过"; + /** + * 前台按钮权限 + **/ + @Schema(description = "前台按钮权限") + private Boolean hasCancelBtn = true; + /** + * 前台终止 + **/ + @Schema(description = "前台终止") + private String cancelBtnText = "驳回"; + /** + * 前台按钮权限 + **/ + @Schema(description = "前台按钮权限") + private Boolean hasRejectBtn = true; + /** + * 前台拒绝 + **/ + @Schema(description = "前台拒绝") + private String rejectBtnText = "拒绝"; + /** + * 前台按钮权限 + **/ + @Schema(description = "前台按钮权限") + private Boolean hasRevokeBtn = true; + /** + * 前台撤回 + **/ + @Schema(description = "前台撤回") + private String revokeBtnText = "撤回"; + /** + * 前台按钮权限 + **/ + @Schema(description = "前台按钮权限") + private Boolean hasTransferBtn = true; + /** + * 前台转办 + **/ + @Schema(description = "前台按钮权限") + private String transferBtnText = "转办"; + /** + * 前端按钮权限 + */ + @Schema(description = "前端按钮权限") + private Boolean hasFreeApproverBtn = true; + /** + * 前台加签 + */ + @Schema(description = "前台加签") + private String hasFreeApproverBtnText = "加签"; + /** + * 前台按钮权限 + **/ + @Schema(description = "前台按钮权限") + private Boolean hasSubmitBtn = true; + /** + * 前台提交 + **/ + @Schema(description = "前台提交") + private String submitBtnText = "提交审核"; + /** + * 前台按钮权限 + **/ + @Schema(description = "前台按钮权限") + private Boolean hasSaveBtn = false; + /** + * 前台保存 + **/ + @Schema(description = "前台保存") + private String saveBtnText = "保存草稿"; + /** + * 前台按钮权限 + **/ + @Schema(description = "前台按钮权限") + private Boolean hasPressBtn = true; + /** + * 前台催办 + **/ + @Schema(description = "前台催办") + private String pressBtnText = "催办"; + /** + * 前台打印权限 + **/ + @Schema(description = "前台打印权限") + private Boolean hasPrintBtn = false; + /** + * 前台打印 + **/ + @Schema(description = "前台打印") + private String printBtnText = "打印"; + /**子流程属性**/ + /** + * 打印id + **/ + @Schema(description = "打印主键") + private List printId = new ArrayList<>(); + /** + * 是否批量审批 + */ + @Schema(description = "是否批量审批") + private Boolean isBatchApproval = false; + /** + * 是否评论 + */ + @Schema(description = "是否评论") + private Boolean isComment = false; + /** + * 是否汇总 + */ + @Schema(description = "是否汇总") + private Boolean isSummary = false; + /** + * 是否有签名 + **/ + @Schema(description = "是否有签名") + private Boolean hasSign = false; + /** + * 是否有意见 + **/ + @Schema(description = "是否有意见") + private Boolean hasOpinion = true; + /** + * 超时设置 + **/ + @Schema(description = "超时设置") + private TimeOutConfig timeoutConfig = new TimeOutConfig(); + /** + * 是否加签 + **/ + @Schema(description = "是否加签") + private Boolean hasFreeApprover = false; + /** + * 审批类型 + */ + @Schema(description = "审批类型") + private Integer initiateType = FlowTaskOperatorEnum.Nominator.getCode(); + /** + * 子流程引擎id + */ + @Schema(description = "流程引擎主键") + private String flowId; + /** + * 表单赋值 + */ + @Schema(description = "表单赋值") + private List assignList = new ArrayList<>(); + /** + * 子流程异步同步(true 异步 false同步) + */ + @Schema(description = "子流程异步同步") + private Boolean isAsync = false; + /** + * 默认标题 + */ + @Schema(description = "默认标题") + private String defaultContent; + /** + * 自定义 + */ + @Schema(description = "自定义") + private String titleContent; + /** + * 表单id + */ + @Schema(description = "表单主键") + private String formId; + + /** + * 评论是否显示删除 true-显示; false-不显示 + */ + @Schema(description = "评论是否显示删除") + private Boolean isShowDelComment = true; + + /** + * 评论提醒 + */ + @Schema(description = "评论提醒") + public MsgConfig commentMsgConfig = new MsgConfig(); + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/RuleListModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/RuleListModel.java new file mode 100644 index 0000000..4346ad4 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/RuleListModel.java @@ -0,0 +1,27 @@ +package com.yunzhupaas.engine.model.flowengine.shuntjson.childnode; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 解析引擎 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:12 + */ +@Data +public class RuleListModel { + /** + * 父字段 + **/ + @Schema(description = "父字段") + private String parentField; + /** + * 子字段 + **/ + @Schema(description = "子字段") + private String childField; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/SendConfigJson.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/SendConfigJson.java new file mode 100644 index 0000000..948a53d --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/SendConfigJson.java @@ -0,0 +1,65 @@ +package com.yunzhupaas.engine.model.flowengine.shuntjson.childnode; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 版本: V3.2.0 + * 版权: 深圳市乐程软件有限公司(http://www.szlecheng.cn) + * 作者: 云筑产品开发平台组 + * 日期: 2022-08-19 + */ +@Data +public class SendConfigJson { + + @Schema(description = "主键") + private String id; + + /** + * 消息发送配置id + **/ + @Schema(description = "消息发送配置主键") + private String sendConfigId; + + /** + * 消息类型 + **/ + @Schema(description = "消息类型") + private String messageType; + + /** + * 消息模板id + **/ + @Schema(description = "消息模板主键") + private String templateId; + + /** + * 账号配置id + **/ + @Schema(description = "账号配置主键") + private String accountConfigId; + + /** + * 接收人 + **/ + @Schema(description = "接收人") + private List toUser; + + /** + * 模板参数 + **/ + @Schema(description = "模板参数") + private List paramJson = new ArrayList<>(); + + /** + * 消息模板名称 + **/ + @Schema(description = "消息模板名称") + private String msgTemplateName; + + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/TemplateJsonModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/TemplateJsonModel.java new file mode 100644 index 0000000..155228e --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/TemplateJsonModel.java @@ -0,0 +1,35 @@ +package com.yunzhupaas.engine.model.flowengine.shuntjson.childnode; + +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.emnus.TemplateEnum; +import lombok.Data; + +/** + * 解析引擎 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Data +public class TemplateJsonModel { + + @Schema(description = "字段") + public String field; + @Schema(description = "名称") + public String fieldName; + @Schema(description = "字段") + public String relationField; + @Schema(description = "主键") + private String id; + @Schema(description = "是否子流程") + private Boolean isSubTable = false; + @Schema(description = "消息主键") + private String msgTemplateId; + @Schema(description = "默认值") + private String defaultValue; + @Schema(description = "参数来源") + private Integer sourceType = TemplateEnum.Field.getCode(); + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/TimeModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/TimeModel.java new file mode 100644 index 0000000..fb76db4 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/TimeModel.java @@ -0,0 +1,77 @@ +package com.yunzhupaas.engine.model.flowengine.shuntjson.childnode; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/6/17 17:54 + */ +@Data +public class TimeModel { + + //----------------------限时------------------------ + /** + * 开始时间 0-接收时间,1-发起时间,2-表单变量 + */ + @Schema(description = "开始类型") + private Integer nodeLimit = 0; + /** + * 表单字段key + */ + @Schema(description = "表单字段key") + private String formField = ""; + /** + * 限定时长 默认24 (小时) + */ + @Schema(description = "限定时长") + private Integer duringDeal = 24; + + //--------------------超时------------------------- + /** + * 超时自动审批 + */ + @Schema(description = "超时自动审批") + private Boolean overAutoApprove = false; + /** + * 超时自动审批次数 + */ + @Schema(description = "超时次数") + private Integer overAutoApproveTime = 5; + + //---------------------公共---------------------------------- + /** + * 超时设置 0.关闭 1.自定义 2.同步发起配置 + */ + @Schema(description = "超时设置") + private Integer on = 0; + /** + * 事件(提醒、超时) + */ + @Schema(description = "事件") + private Boolean overEvent = false; + /** + * 次数(提醒、超时) + */ + @Schema(description = "次数") + private Integer overEventTime = 5; + /** + * 第一次时间 + * (小时)第一次超时时间默认值0=第一次触发超时事件时间=节点限定时长起始值+节点处理限定时长+设定的第一次超时时间 + */ + @Schema(description = "第一次时间") + private Integer firstOver = 0; + /** + * 时间间隔(提醒、超时) + */ + @Schema(description = "时间间隔") + private Integer overTimeDuring = 2; + /** + * 通知(提醒、超时) + */ + @Schema(description = "通知") + private Boolean overNotice = false; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/TimeOutConfig.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/TimeOutConfig.java new file mode 100644 index 0000000..b8fbcdb --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/childnode/TimeOutConfig.java @@ -0,0 +1,36 @@ +package com.yunzhupaas.engine.model.flowengine.shuntjson.childnode; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 解析引擎 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Data +public class TimeOutConfig { + /** + * 开关 + **/ + @Schema(description = "开关") + private Boolean on = false; + /** + * 数量 + **/ + @Schema(description = "数量") + private Integer quantity; + /** + * 类型 day、 hour、 minute + **/ + @Schema(description = "类型") + private String type; + /** + * 同意1 拒绝2 + **/ + @Schema(description = "类型") + private Integer handler; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/nodejson/ChildNodeList.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/nodejson/ChildNodeList.java new file mode 100644 index 0000000..ebca145 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/nodejson/ChildNodeList.java @@ -0,0 +1,41 @@ +package com.yunzhupaas.engine.model.flowengine.shuntjson.nodejson; + +import com.yunzhupaas.engine.model.flowengine.shuntjson.childnode.Properties; +import lombok.Data; + +/** + * 解析引擎 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:12 + */ +@Data +public class ChildNodeList { + /** + * 节点属性 + **/ + private Properties properties = new Properties(); + /** + * 自定义属性 + **/ + private Custom custom = new Custom(); + /** + * 流程节点id + **/ + private String taskNodeId; + /** + * 流程任务id + **/ + private String taskId; + /** + * 下一级定时器属性 + **/ + private DateProperties timer = new DateProperties(); + /** + * 分流合流 + **/ + private String conditionType; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/nodejson/ConditionList.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/nodejson/ConditionList.java new file mode 100644 index 0000000..a22ba16 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/nodejson/ConditionList.java @@ -0,0 +1,78 @@ +package com.yunzhupaas.engine.model.flowengine.shuntjson.nodejson; + +import com.yunzhupaas.emnus.SearchMethodEnum; +import com.yunzhupaas.engine.model.flowengine.shuntjson.childnode.ProperCond; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 解析引擎 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:12 + */ +@Data +public class ConditionList { + /** + * 条件 + **/ + private List conditions = new ArrayList<>(); + /** + * 表达式 + **/ + private String matchLogic = SearchMethodEnum.And.getSymbol(); + /** + * 条件节点id + **/ + private String nodeId; + /** + * 上一节点id + **/ + private String prevId; + /**1.先判断分流节点 2.在判断孩子节点 3.最后获取子节点**/ + /** + * 判断是否有分流节点 + **/ + private Boolean flow = false; + /** + * 判断是否有选择节点 + **/ + private Boolean branchFlow = false; + /** + * 判断是否有转转向 + **/ + private Boolean swerve = false; + /** + * 分流的节点id + **/ + private String flowId; + /** + * 判断是否有子节点 + **/ + private Boolean child; + /** + * 条件成功id + **/ + private String childNodeId; + /** + * 子节点id + **/ + private String firstId; + /** + * 判断是否其他条件 + **/ + private Boolean isDefault; + /** + * 名称 + **/ + private String title; + /** + * 转向节点 + **/ + private String swerveNode; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/nodejson/Custom.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/nodejson/Custom.java new file mode 100644 index 0000000..40b447f --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/nodejson/Custom.java @@ -0,0 +1,68 @@ +package com.yunzhupaas.engine.model.flowengine.shuntjson.nodejson; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 解析引擎 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:12 + */ +@Data +public class Custom { + private String type; + /** + * 当前节点id + **/ + private String nodeId; + /** + * 上一节点id,可能是条件的节点也有可能是父类节点 + **/ + private String prevId; + /** + * 0,外层节点,1.里层节点 + **/ + private String num; + /** + * 判断是否有分流节点 + **/ + private Boolean flow = false; + /** + * 判断是否有选择节点 + **/ + private Boolean branchFlow = false; + /** + * 判断是否有转转向 + **/ + private Boolean swerve = false; + /** + * 分流的节点id + **/ + private String flowId; + /** + * true,选择childNode,false 选择firstId + **/ + private Boolean child; + /** + * 该节点的子节点 + **/ + private String childNode; + /** + * 最外层的child节点 + **/ + private String firstId; + /** + * 同步子流程任务id + **/ + private List taskId = new ArrayList<>(); + /** + * 异步子流程任务id + **/ + private List asyncTaskList = new ArrayList<>(); +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/nodejson/DateProperties.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/nodejson/DateProperties.java new file mode 100644 index 0000000..e9798eb --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowengine/shuntjson/nodejson/DateProperties.java @@ -0,0 +1,44 @@ +package com.yunzhupaas.engine.model.flowengine.shuntjson.nodejson; + +import lombok.Data; + +import java.util.Date; + +/** + * 解析引擎 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:12 + */ +@Data +public class DateProperties { + + /** + * 定时器 + **/ + private String title; + private Integer day = 0; + private Integer hour = 0; + private Integer minute = 0; + private Integer second = 0; + /** + * 判断是否有定时器 + **/ + private Boolean time = false; + /** + * 定时器id + **/ + private String nodeId; + /** + * 定时器下一节点 + **/ + private String nextId; + /** + * 定时任务结束时间 + **/ + private Date date; + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowlaunch/FlowLaunchListVO.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowlaunch/FlowLaunchListVO.java new file mode 100644 index 0000000..666e9d3 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowlaunch/FlowLaunchListVO.java @@ -0,0 +1,56 @@ +package com.yunzhupaas.engine.model.flowlaunch; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:17 + */ +@Data +public class FlowLaunchListVO { + @Schema(description = "任务编码") + private String enCode; + @Schema(description = "发起人员") + private String creatorUserId; + @Schema(description = "创建时间") + private Long creatorTime; + @Schema(description = "当前节点") + private String thisStep; + @Schema(description = "所属分类") + private String flowCategory; + @Schema(description = "流程标题") + private String fullName; + @Schema(description = "所属流程") + private String flowName; + @Schema(description = "流程状态", example = "1") + private Integer status; + @Schema(description = "发起时间") + private Long startTime; + @Schema(description = "主键id") + private String id; + @Schema(description = "结束时间") + private Long endTime; + @Schema(description = "完成情况") + private Integer completion; + @Schema(description = "备注") + private String description; + @Schema(description = "流程编码") + private String flowCode; + @Schema(description = "流程主键") + private String flowId; + @Schema(description = "表单类型 1-系统表单、2-动态表单") + private Integer formType; + @Schema(description = "表单数据") + private String formData; + @Schema(description = "紧急程度") + private Integer flowUrgent; + @Schema(description = "父流程") + private String parentId; + @Schema(description = "委托用户") + private String delegateUser; + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowmessage/FlowEventModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowmessage/FlowEventModel.java new file mode 100644 index 0000000..82694a8 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowmessage/FlowEventModel.java @@ -0,0 +1,34 @@ +package com.yunzhupaas.engine.model.flowmessage; + +import com.yunzhupaas.engine.entity.FlowTaskOperatorRecordEntity; +import com.yunzhupaas.engine.model.flowengine.shuntjson.childnode.TemplateJsonModel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Map; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/3/31 16:15 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class FlowEventModel { + + //数据 + private String dataJson; + //表单数据 + private Map data; + //系统匹配 + private TemplateJsonModel templateJson; + //操作对象 + private FlowTaskOperatorRecordEntity record; + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowmessage/FlowMessageModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowmessage/FlowMessageModel.java new file mode 100644 index 0000000..5dd7841 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowmessage/FlowMessageModel.java @@ -0,0 +1,36 @@ +package com.yunzhupaas.engine.model.flowmessage; + +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.engine.entity.FlowTaskOperatorRecordEntity; +import com.yunzhupaas.engine.enums.FlowMessageEnum; +import com.yunzhupaas.engine.model.flowengine.shuntjson.childnode.MsgConfig; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class FlowMessageModel { + private String title = ""; + private Integer type = FlowMessageEnum.wait.getCode(); + private Integer status; + private MsgConfig msgConfig = new MsgConfig(); + private List userList = new ArrayList<>(); + private Map data = new HashMap<>(); + private Map contMsg = new HashMap<>(); + private String fullName; + private FlowTaskOperatorRecordEntity recordEntity; + private UserInfo userInfo; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowmessage/FlowMsgModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowmessage/FlowMsgModel.java new file mode 100644 index 0000000..ef37557 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowmessage/FlowMsgModel.java @@ -0,0 +1,77 @@ +package com.yunzhupaas.engine.model.flowmessage; + +import com.yunzhupaas.engine.entity.*; +import com.yunzhupaas.engine.model.flowbefore.FlowTemplateAllModel; +import com.yunzhupaas.engine.model.flowengine.FlowModel; +import com.yunzhupaas.engine.model.flowengine.shuntjson.childnode.MsgConfig; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/7/14 9:17 + */ +@Data +@NoArgsConstructor +public class FlowMsgModel { + private String title; + private FlowTemplateAllModel flowTemplateAllModel = new FlowTemplateAllModel(); + private Map data = new HashMap<>(); + private FlowModel flowModel = new FlowModel(); + private FlowTaskEntity taskEntity = new FlowTaskEntity(); + private FlowTaskNodeEntity taskNodeEntity = new FlowTaskNodeEntity(); + private List nodeList = new ArrayList<>(); + private List operatorList = new ArrayList<>(); + private List circulateList = new ArrayList<>(); + private String startHandId; + private List operatorRecordList = new ArrayList<>(); + + /** + * 代办 (通知代办) + */ + private Boolean wait = true; + /** + * 同意 + */ + private Boolean approve = false; + /** + * 拒绝 + */ + private Boolean reject = false; + /** + * 抄送人 + */ + private Boolean copy = false; + /** + * 结束 (通知发起人) + */ + private Boolean end = false; + /** + * 子流程通知 + */ + private Boolean launch = false; + /** + * 拒绝发起节点 + */ + private Boolean start = false; + /** + * 超时 + */ + private Boolean overtime = false; + /** + * 提醒 + */ + private Boolean notice = false; + /** + * 评论提醒 + */ + private Boolean comment = false; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowmessage/FlowParameterModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowmessage/FlowParameterModel.java new file mode 100644 index 0000000..514362e --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowmessage/FlowParameterModel.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.engine.model.flowmessage; + +import lombok.Data; + +import java.util.Map; + +/** + * 事件对象 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/8/20 8:49 + */ +@Data +public class FlowParameterModel { + private String interId; + private Map parameterMap; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowmonitor/FlowEventLogListVO.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowmonitor/FlowEventLogListVO.java new file mode 100644 index 0000000..9ce7dd2 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowmonitor/FlowEventLogListVO.java @@ -0,0 +1,20 @@ +package com.yunzhupaas.engine.model.flowmonitor; + +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:18 + */ +@Data +public class FlowEventLogListVO { + private String fullName; + private String interfaceId; + private String interfaceName; + private String interfaceCode; + private Long creatorTime; + private String result; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowmonitor/FlowMonitorListVO.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowmonitor/FlowMonitorListVO.java new file mode 100644 index 0000000..0c121ff --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowmonitor/FlowMonitorListVO.java @@ -0,0 +1,55 @@ +package com.yunzhupaas.engine.model.flowmonitor; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:17 + */ +@Data +public class FlowMonitorListVO { + @Schema(description = "流程编码") + private String enCode; + @Schema(description = "发起人员id") + private String creatorUserId; + @Schema(description = "创建时间") + private Long creatorTime; + @Schema(description = "当前节点") + private String thisStep; + @Schema(description = "所属分类") + private String flowCategory; + @Schema(description = "流程标题") + private String fullName; + @Schema(description = "所属流程") + private String flowName; + @Schema(description = "流程状态", example = "1") + private Integer status; + @Schema(description = "开始时间") + private Long startTime; + @Schema(description = "主键id") + private String id; + @Schema(description = "流程主键") + private String flowId; + @Schema(description = "流程编码") + private String flowCode; + @Schema(description = "实例进程") + private String processId; + @Schema(description = "完成情况") + private Integer completion; + @Schema(description = "用户名称") + private String userName; + @Schema(description = "描述") + private String description; + @Schema(description = "表单类型 1-系统表单、2-动态表单") + private Integer formType; + @Schema(description = "表单数据") + private String formData; + @Schema(description = "紧急程度") + private Integer flowUrgent; + @Schema(description = "流程版本") + private Integer flowVersion; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/FlowAgreeRuleModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/FlowAgreeRuleModel.java new file mode 100644 index 0000000..6b469f5 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/FlowAgreeRuleModel.java @@ -0,0 +1,36 @@ +package com.yunzhupaas.engine.model.flowtask; + +import com.yunzhupaas.engine.entity.FlowTaskEntity; +import com.yunzhupaas.engine.entity.FlowTaskNodeEntity; +import com.yunzhupaas.engine.entity.FlowTaskOperatorEntity; +import com.yunzhupaas.engine.model.flowengine.shuntjson.nodejson.ChildNodeList; +import com.yunzhupaas.engine.model.flowtask.method.TaskOperatoUser; +import com.yunzhupaas.permission.entity.UserEntity; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/4/25 13:57 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class FlowAgreeRuleModel { + private List operatorListAll = new ArrayList<>(); + private TaskOperatoUser taskOperatoUser; + private FlowTaskEntity flowTask; + private Boolean reject = false; + private List userName = new ArrayList<>(); + private ChildNodeList childNode; + private List taskNodeList = new ArrayList<>(); +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/FlowApproveModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/FlowApproveModel.java new file mode 100644 index 0000000..f804726 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/FlowApproveModel.java @@ -0,0 +1,32 @@ +package com.yunzhupaas.engine.model.flowtask; + +import com.yunzhupaas.engine.entity.FlowTaskEntity; +import com.yunzhupaas.engine.entity.FlowTaskNodeEntity; +import com.yunzhupaas.engine.entity.FlowTaskOperatorEntity; +import com.yunzhupaas.engine.model.flowengine.FlowModel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/7/6 16:52 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class FlowApproveModel { + private List operatorList = new ArrayList<>(); + private List taskNodeList = new ArrayList<>(); + private FlowTaskEntity flowTask = new FlowTaskEntity(); + private FlowModel flowModel = new FlowModel(); + private boolean isSubmit = false; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/FlowAssistModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/FlowAssistModel.java new file mode 100644 index 0000000..e2125a8 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/FlowAssistModel.java @@ -0,0 +1,23 @@ +package com.yunzhupaas.engine.model.flowtask; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:17 + */ +@Data +public class FlowAssistModel { + @Schema(description = "主键") + private String ids; + @Schema(description = "用户") + private List list; + @Schema(description = "流程基本主键") + private String templateId; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/FlowConditionModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/FlowConditionModel.java new file mode 100644 index 0000000..0fe687a --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/FlowConditionModel.java @@ -0,0 +1,32 @@ +package com.yunzhupaas.engine.model.flowtask; + +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.engine.entity.FlowTaskEntity; +import com.yunzhupaas.engine.model.flowengine.shuntjson.nodejson.ChildNodeList; +import com.yunzhupaas.engine.model.flowengine.shuntjson.nodejson.ConditionList; +import com.yunzhupaas.permission.entity.UserEntity; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/4/25 13:57 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class FlowConditionModel { + private String data; + private String nodeId; + private UserInfo userInfo; + private UserEntity userEntity; + private FlowTaskEntity flowTaskEntity; + private List childNodeListAll; + private List conditionListAll; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/FlowContModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/FlowContModel.java new file mode 100644 index 0000000..4519808 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/FlowContModel.java @@ -0,0 +1,52 @@ +package com.yunzhupaas.engine.model.flowtask; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/4/25 13:57 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class FlowContModel { + /** + * 审批类型 + */ + private Integer type; + /** + * 编码 + */ + private String enCode; + /** + * 引擎id + */ + private String flowId; + /** + * 表单分类 + */ + private Integer formType; + /** + * 任务id + */ + private String processId; + /** + * 状态 + */ + private Integer status; + /** + * 代办id + */ + private String taskOperatorId; + /** + * 节点id + */ + private String taskNodeId; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/FlowCountersignModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/FlowCountersignModel.java new file mode 100644 index 0000000..3b939cd --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/FlowCountersignModel.java @@ -0,0 +1,24 @@ +package com.yunzhupaas.engine.model.flowtask; + +import com.yunzhupaas.engine.entity.FlowTaskNodeEntity; +import com.yunzhupaas.engine.entity.FlowTaskOperatorEntity; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/4/25 13:57 + */ +@Data +public class FlowCountersignModel { + private FlowTaskNodeEntity taskNode; + private List operatorList = new ArrayList<>(); + private Boolean fixed = false; + private double pass = 100; + private List passNumList = new ArrayList<>(); +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/FlowErrorModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/FlowErrorModel.java new file mode 100644 index 0000000..7653561 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/FlowErrorModel.java @@ -0,0 +1,16 @@ +package com.yunzhupaas.engine.model.flowtask; + +import lombok.Data; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/6/17 15:00 + */ +@Data +public class FlowErrorModel { + private String nodeId; + private String nodeName; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/FlowNodeListModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/FlowNodeListModel.java new file mode 100644 index 0000000..aaeb18a --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/FlowNodeListModel.java @@ -0,0 +1,27 @@ +package com.yunzhupaas.engine.model.flowtask; + +import com.yunzhupaas.engine.entity.FlowTaskNodeEntity; +import com.yunzhupaas.engine.model.flowengine.FlowModel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class FlowNodeListModel { + private List dataAll = new ArrayList<>(); + private FlowModel flowModel = new FlowModel(); + private Boolean isAdd = false; + private FlowTaskNodeEntity taskNode = new FlowTaskNodeEntity(); + private Long num = 1L; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/FlowTaskListModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/FlowTaskListModel.java new file mode 100644 index 0000000..dc0617f --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/FlowTaskListModel.java @@ -0,0 +1,48 @@ +package com.yunzhupaas.engine.model.flowtask; + +import lombok.Data; + +import java.util.Date; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:17 + */ +@Data +public class FlowTaskListModel { + private String id; + private String processId; + private String enCode; + private String fullName; + private Integer flowUrgent; + private String flowId; + private String flowCode; + private String flowName; + private String flowCategory; + private String flowType; + private Date startTime; + private Date endTime; + private String thisStep; + private String thisStepId; + private Integer status; + private Integer completion; + private String creatorUserId; + private Date creatorTime; + private String handleId; + private String nodeName; + private String lastModifyUserId; + private Date lastModifyTime; + private String approversProperties; + private String description; + private String flowVersion; + private Integer taskStatus; + private String sortCode; + private String counterSign; + private String templateId; + private String delegateUser; + private String icon; + private String circulateId; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/PaginationFlowTask.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/PaginationFlowTask.java new file mode 100644 index 0000000..54eb18a --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/PaginationFlowTask.java @@ -0,0 +1,37 @@ +package com.yunzhupaas.engine.model.flowtask; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunzhupaas.base.PaginationTime; +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:17 + */ +@Data +public class PaginationFlowTask extends PaginationTime { + @Schema(description = "所属流程") + private String templateId; + @Schema(description = "所属名称") + private String flowId; + @Schema(description = "所属分类") + private String flowCategory; + @Schema(description = "用户主键") + private String creatorUserId; + @Schema(description = "状态") + private Integer status; + @Schema(description = "编码") + private String nodeCode; + @Schema(description = "紧急程度") + private Integer flowUrgent; + @JsonIgnore + private Boolean delegateType = false; + @JsonIgnore + private String userId; + @JsonIgnore + private Integer isBatch; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/TaskNodeModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/TaskNodeModel.java new file mode 100644 index 0000000..8c56e70 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/TaskNodeModel.java @@ -0,0 +1,21 @@ +package com.yunzhupaas.engine.model.flowtask; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/4/13 15:57 + */ +@Data +public class TaskNodeModel { + @Schema(description = "主键") + private String id; + @Schema(description = "节点名称") + private String nodeName; + @Schema(description = "节点编码") + private String nodeCode; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/WorkJobModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/WorkJobModel.java new file mode 100644 index 0000000..5ef9ad0 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/WorkJobModel.java @@ -0,0 +1,37 @@ +package com.yunzhupaas.engine.model.flowtask; + +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.engine.model.flowmessage.FlowMsgModel; +import lombok.AllArgsConstructor; +import lombok.Data; + + +/** + * 流程监控器参数模型 + * + * @author 云筑产品开发平台组 + * @version V3.3.0 flowable + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/2 10:11 + */ + +@Data +@AllArgsConstructor +public class WorkJobModel { + /** + * 任务id + */ + private String taskId; + + /** + * 任务对象 + */ + private FlowMsgModel flowMsgModel; + + /** + * 用户信息 + */ + private UserInfo userInfo; + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/WorkTimeoutJobModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/WorkTimeoutJobModel.java new file mode 100644 index 0000000..7a8bf1d --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/WorkTimeoutJobModel.java @@ -0,0 +1,40 @@ +package com.yunzhupaas.engine.model.flowtask; + +import com.yunzhupaas.engine.entity.FlowTaskOperatorEntity; +import com.yunzhupaas.engine.model.flowengine.FlowModel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 流程设计 + * + * @author 云筑产品开发平台组 + * @version V3.4.2 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/6/17 17:44 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class WorkTimeoutJobModel { + + private String tenantId; + private String tenantDbConnectionString; + private boolean isAssignDataSource; + + + private FlowModel flowModel; + private String taskId; + private String taskNodeId; + private String taskNodeOperatorId; + private FlowTaskOperatorEntity operatorEntity; + private Integer counter; + private Integer overtimeNum; + private boolean isSuspend = false; + + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/method/TaskHandleIdStatus.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/method/TaskHandleIdStatus.java new file mode 100644 index 0000000..cd4e055 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/method/TaskHandleIdStatus.java @@ -0,0 +1,41 @@ +package com.yunzhupaas.engine.model.flowtask.method; + +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.engine.entity.FlowTaskNodeEntity; +import com.yunzhupaas.engine.model.flowengine.FlowModel; +import com.yunzhupaas.engine.model.flowengine.shuntjson.nodejson.ChildNodeList; +import lombok.Data; + +import java.util.List; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/4/25 13:57 + */ +@Data +public class TaskHandleIdStatus { + /** + * 审批类型(0:拒绝,1:同意) + **/ + private Integer status; + /** + * 当前节点属性 + **/ + private ChildNodeList nodeModel; + /** + * 用户 + **/ + private UserInfo userInfo; + /** + * 审批对象 + **/ + private FlowModel flowModel; + /** + * 节点list + **/ + private List taskNodeList; + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/method/TaskOperatoUser.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/method/TaskOperatoUser.java new file mode 100644 index 0000000..548bfde --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/method/TaskOperatoUser.java @@ -0,0 +1,54 @@ +package com.yunzhupaas.engine.model.flowtask.method; + +import com.yunzhupaas.engine.model.flowengine.shuntjson.nodejson.ChildNodeList; +import lombok.Data; + +import java.util.Date; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-08-26 + */ +@Data +public class TaskOperatoUser { + /** + * 审批人id + */ + private String handLeId; + /** + * 审批日期 + */ + private Date date; + /** + * 当前节点数据 + */ + private ChildNodeList childNode; + /** + * 经办id + */ + private String id; + /** + * 回流id + */ + private String rollbackId; + /** + * 父级id + */ + private String parentId; + /** + * 是否冻结审批 + */ + private Boolean rejectUser = false; + /** + * 自动审批 + */ + private String automation; + /** + * 第几条数据 + */ + private long sortCode; +} + + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/method/TaskOperator.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/method/TaskOperator.java new file mode 100644 index 0000000..36b7046 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtask/method/TaskOperator.java @@ -0,0 +1,74 @@ +package com.yunzhupaas.engine.model.flowtask.method; + +import com.yunzhupaas.engine.entity.FlowTaskEntity; +import com.yunzhupaas.engine.entity.FlowTaskNodeEntity; +import com.yunzhupaas.engine.model.flowengine.FlowModel; +import com.yunzhupaas.engine.model.flowengine.shuntjson.nodejson.ChildNodeList; +import com.yunzhupaas.engine.model.flowtask.FlowErrorModel; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024-08-26 + */ +@Data +public class TaskOperator { + /** + * 当前节点数据 + */ + private ChildNodeList childNode; + /** + * 引擎实例 + */ + private FlowTaskEntity taskEntity; + /** + * 所有节点 + */ + private List taskNodeList; + /** + * 提交数据 + */ + private FlowModel flowModel; + /** + * true记录 false不记录 + */ + private Boolean details = true; + /** + * true 验证 false不验证 + */ + private Boolean verify = true; + /** + * 是否驳回 + */ + private Boolean reject = false; + /** + * 异常节点数据 + */ + private List errorList = new ArrayList<>(); + /** + * 异常规则 + */ + private Boolean errorRule = false; + /** + * 附加条件 + */ + private Boolean extraRule = false; + /** + * 默认审批通过 + */ + private Integer pass = 0; + /** + * 无法提交 + */ + private Integer notSubmit = 0; + /** + * 上一节点审批人指定处理人 + */ + private Integer node = 0; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtasknode/TaskNodeListModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtasknode/TaskNodeListModel.java new file mode 100644 index 0000000..d6599d0 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtasknode/TaskNodeListModel.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.engine.model.flowtasknode; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class TaskNodeListModel { + private String id; + private Integer state; + private Integer completion; + private String notNodeCode; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtemplate/FlowExportModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtemplate/FlowExportModel.java new file mode 100644 index 0000000..b294fa2 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtemplate/FlowExportModel.java @@ -0,0 +1,23 @@ +package com.yunzhupaas.engine.model.flowtemplate; + +import com.yunzhupaas.engine.entity.FlowTemplateEntity; +import com.yunzhupaas.engine.entity.FlowTemplateJsonEntity; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:17 + */ +@Data +public class FlowExportModel { + + private FlowTemplateEntity flowTemplate; + private List flowTemplateJson = new ArrayList<>(); + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtemplate/FlowPageListVO.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtemplate/FlowPageListVO.java new file mode 100644 index 0000000..c1812c8 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtemplate/FlowPageListVO.java @@ -0,0 +1,33 @@ +package com.yunzhupaas.engine.model.flowtemplate; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class FlowPageListVO { + @Schema(description = "流程编码") + private String enCode; + @Schema(description = "流程名称") + private String fullName; + @Schema(description = "主键") + private String id; + @Schema(description = "流程分类") + private String category; + @Schema(description = "表单类型") + private Integer formType; + @Schema(description = "流程类型") + private Integer type; + @Schema(description = "排序码") + private Long sortCode; + @Schema(description = "图标") + private String icon; + @Schema(description = "图标背景色") + private String iconBackground; + @Schema(description = "创建人") + private String creatorUser; + @Schema(description = "创建时间") + private Long creatorTime; + @Schema(description = "有效标志") + private Integer enabledMark; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtemplate/FlowSelectVO.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtemplate/FlowSelectVO.java new file mode 100644 index 0000000..ab38983 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtemplate/FlowSelectVO.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.engine.model.flowtemplate; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class FlowSelectVO { + @Schema(description = "流程主键") + private String id; + @Schema(description = "流程名称") + private String fullName; + @Schema(description = "所属流程") + private String flowName; + @Schema(description = "流程类型") + private String flowType; + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtemplate/FlowTemplatUprForm.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtemplate/FlowTemplatUprForm.java new file mode 100644 index 0000000..4d50e07 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtemplate/FlowTemplatUprForm.java @@ -0,0 +1,15 @@ +package com.yunzhupaas.engine.model.flowtemplate; + +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:16 + */ +@Data +public class FlowTemplatUprForm extends FlowTemplateCrForm { + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtemplate/FlowTemplateCrForm.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtemplate/FlowTemplateCrForm.java new file mode 100644 index 0000000..1052f73 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtemplate/FlowTemplateCrForm.java @@ -0,0 +1,39 @@ +package com.yunzhupaas.engine.model.flowtemplate; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:16 + */ +@Data +public class FlowTemplateCrForm { + @Schema(description = "流程引擎id") + private String id; + @Schema(description = "表单id") + private String formId; + @Schema(description = "排序码") + private Long sortCode; + @Schema(description = "流程编码") + private String enCode; + @Schema(description = "流程名称") + private String fullName; + @Schema(description = "流程类型") + private Integer type; + @Schema(description = "流程分类") + private String category; + @Schema(description = "图标") + private String icon; + @Schema(description = "图标背景色") + private String iconBackground; + @Schema(description = "流程模板") + private String flowTemplateJson = "[]"; + @Schema(description = "描述") + private String description; + @Schema(description = "有效标志") + private Integer enabledMark; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtemplate/FlowTemplateInfoVO.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtemplate/FlowTemplateInfoVO.java new file mode 100644 index 0000000..573877f --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtemplate/FlowTemplateInfoVO.java @@ -0,0 +1,41 @@ +package com.yunzhupaas.engine.model.flowtemplate; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/3/15 9:17 + */ +@Data +public class FlowTemplateInfoVO { + @Schema(description = "主键") + private String id; + @Schema(description = "排序码") + private Long sortCode; + @Schema(description = "流程编码") + private String enCode; + @Schema(description = "流程名称") + private String fullName; + @Schema(description = "流程类型") + private Integer type; + @Schema(description = "流程分类") + private String category; + @Schema(description = "图标") + private String icon; + @Schema(description = "图标背景色") + private String iconBackground; + @Schema(description = "流程模板") + private String flowTemplateJson; + @Schema(description = "描述") + private String description; + @Schema(description = "有效标志") + private Integer enabledMark; + @Schema(description = "在线开发流程") + private boolean onlineDev = false; + @Schema(description = "在线开发流程表单id") + private String onlineFormId; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtemplate/FlowTemplateListVO.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtemplate/FlowTemplateListVO.java new file mode 100644 index 0000000..7f62f85 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtemplate/FlowTemplateListVO.java @@ -0,0 +1,48 @@ +package com.yunzhupaas.engine.model.flowtemplate; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Data +public class FlowTemplateListVO { + @Schema(description = "编码") + private String enCode; + @Schema(description = "数量") + private Integer num; + @Schema(description = "名称") + private String fullName; + @Schema(description = "主键") + private String id; + @Schema(description = "流程分类") + private String category; + @Schema(description = "表单类型 1-系统表单、2-动态表单") + private Integer formType; + @Schema(description = "表单类型 1-系统表单、2-动态表单") + private Integer type; + @Schema(description = "可见类型 0-全部可见、1-部分可见") + private Integer visibleType; + @Schema(description = "排序码") + private Long sortCode; + @Schema(description = "图标") + private String icon; + @Schema(description = "图标背景色") + private String iconBackground; + @Schema(description = "创建人") + private String creatorUser; + @Schema(description = "创建时间") + private Long creatorTime; + @Schema(description = "有效标志") + private Integer enabledMark; + @Schema(description = "是否选择") + private Boolean disabled = false; + @Schema(description = "子节点") + private List children; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtemplate/FlowTemplateVO.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtemplate/FlowTemplateVO.java new file mode 100644 index 0000000..5f5f336 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtemplate/FlowTemplateVO.java @@ -0,0 +1,10 @@ +package com.yunzhupaas.engine.model.flowtemplate; + +import lombok.Data; + +@Data +public class FlowTemplateVO { + private Boolean isMainVersion = false; + private String id; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtemplatejson/FlowJsonModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtemplatejson/FlowJsonModel.java new file mode 100644 index 0000000..f28c22f --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtemplatejson/FlowJsonModel.java @@ -0,0 +1,17 @@ +package com.yunzhupaas.engine.model.flowtemplatejson; + +import lombok.Data; + +import java.util.HashMap; +import java.util.Map; + +@Data +public class FlowJsonModel { + private String id; + private String flowId; + private String fullName; + //true 不能删除 false 能删除 + private Boolean isDelete = false; + private Map flowTemplateJson = new HashMap<>(); +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtemplatejson/FlowTemplateJsonListVO.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtemplatejson/FlowTemplateJsonListVO.java new file mode 100644 index 0000000..6b01957 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtemplatejson/FlowTemplateJsonListVO.java @@ -0,0 +1,35 @@ +package com.yunzhupaas.engine.model.flowtemplatejson; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Data +public class FlowTemplateJsonListVO { + @Schema(description = "主键") + private String id; + @Schema(description = "流程基本主键") + private String templateId; + @Schema(description = "版本") + private String version; + @Schema(description = "流程json") + private String flowTemplateJson; + @Schema(description = "创建时间") + private Long creatorTime; + @Schema(description = "创建用户") + private String creatorUserId; + @Schema(description = "创建人") + private String creatorUser; + @Schema(description = "修改时间") + private Long lastModifyTime; + @Schema(description = "修改用户") + private String lastModifyUserId; + @Schema(description = "状态") + private Integer enabledMark; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtemplatejson/FlowTemplateJsonPage.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtemplatejson/FlowTemplateJsonPage.java new file mode 100644 index 0000000..ded6195 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtemplatejson/FlowTemplateJsonPage.java @@ -0,0 +1,18 @@ +package com.yunzhupaas.engine.model.flowtemplatejson; + +import com.yunzhupaas.base.PaginationTime; +import lombok.Data; + +/** + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + */ +@Data +public class FlowTemplateJsonPage extends PaginationTime { + private String templateId; + private String groupId; + private String flowId; + private Integer enabledMark; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtime/FlowTimeModel.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtime/FlowTimeModel.java new file mode 100644 index 0000000..10ad77b --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/model/flowtime/FlowTimeModel.java @@ -0,0 +1,37 @@ +package com.yunzhupaas.engine.model.flowtime; + +import com.yunzhupaas.engine.model.flowengine.shuntjson.nodejson.ChildNodeList; +import lombok.Data; + +import java.util.Date; + +/** + * @author :云筑产品开发平台组 + * @version: V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date :2022/6/18 11:38 + */ +@Data +public class FlowTimeModel { + /** + * 是否开启限时设置 + */ + private Boolean on = false; + /** + * 开始时间 + */ + private Date date = new Date(); + /** + * 通知 + */ + private ChildNodeList childNode = new ChildNodeList(); + /** + * 事件 + */ + private ChildNodeList childNodeEvnet = new ChildNodeList(); + /** + * 节点对象 + */ + private ChildNodeList childNodeList = new ChildNodeList(); +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/util/FlowCondition.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/util/FlowCondition.java new file mode 100644 index 0000000..488ccfa --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/util/FlowCondition.java @@ -0,0 +1,27 @@ +package com.yunzhupaas.engine.util; + +/** + * 在线工作流开发 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public class FlowCondition { + /** + * 条件 + **/ + public static final String CONDITION = "condition"; + + /** + * 分流 + **/ + public static final String INTERFLOW = "interFlow"; + + /** + * 选择分支 + **/ + public static final String ISBRANCHFLOW = "isBranchFlow"; +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/util/FlowConstant.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/util/FlowConstant.java new file mode 100644 index 0000000..c7b8770 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/util/FlowConstant.java @@ -0,0 +1,91 @@ +package com.yunzhupaas.engine.util; + +/** + * 在线工作流开发 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +public class FlowConstant { + /** + * 定时器 + */ + public static final String TIMER = "timer"; + /** + * 空节点 + */ + public static final String EMPTY = "empty"; + /** + * 流程名称 + */ + public static final String FLOW_FULL_NAME = "@flowFullName"; + /** + * 流程编码 + */ + public static final String FLOW_FULL_CODE = "@flowFullCode"; + /** + * 当前用户 + */ + public static final String LAUNCH_USER_NAME = "@launchUserName"; + /** + * 当前时间 + */ + public static final String LAUNCH_TIME = "@launchTime"; + /** + * 上节点表单ID + */ + public static final String PREV_NODE_FORM_ID = "@prevNodeFormId"; + /** + * 流程ID + */ + public static final String FLOW_ID = "@flowId"; + /** + * 任务ID + */ + public static final String TASK_ID = "@taskId"; + /** + * 节点ID + */ + public static final String TASK_NODE_ID = "@taskNodeId"; + /** + * 任务标题 + */ + public static final String TASK_FULL_NAME = "@taskFullName"; + /** + * 发起用户ID + */ + public static final String LAUNCH_USER_ID = "@launchUserId"; + /** + * 当前操作用户ID + */ + public static final String FLOW_OPERATOR_USER_ID = "@flowOperatorUserId"; + /** + * 当前操作用户名 + */ + public static final String FLOW_OPERATOR_USER_NAME = "@flowOperatorUserName"; + /** + * 委托人 + */ + public static final String MANDATOR = "@Mandator"; + /** + * 被委托人 + */ + public static final String MANDATARY = "@Mandatary"; + /** + * 创建人 + */ + public static final String CREATORUSERNAME = "@CreatorUserName"; + /** + * 发送时间 + */ + public static final String SENDTIME = "@SendTime"; + /** + * 消息标题 + */ + public static final String TITLE = "@Title"; +} + + + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/util/FlowContextHolder.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/util/FlowContextHolder.java new file mode 100644 index 0000000..303192e --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/util/FlowContextHolder.java @@ -0,0 +1,120 @@ +package com.yunzhupaas.engine.util; + +import com.yunzhupaas.engine.model.flowmessage.FlowParameterModel; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 事件数据添加 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2024/8/20 8:49 + */ +public class FlowContextHolder { + + private static final ThreadLocal> CONTEXT_DB_NAME_HOLDER = new ThreadLocal<>(); + + private static final ThreadLocal>> CONTEXT_DATA = new ThreadLocal<>(); + + private static final ThreadLocal>> CHILD_DATA = new ThreadLocal<>(); + + private static final ThreadLocal>>> FORM_OPERATES_DATA = new ThreadLocal<>(); + + /** + * 添加当前事件对象 + */ + public static void addEvent(String interId, Map parameterMap) { + FlowParameterModel model = new FlowParameterModel(); + model.setInterId(interId); + model.setParameterMap(parameterMap); + List list = CONTEXT_DB_NAME_HOLDER.get() != null ? CONTEXT_DB_NAME_HOLDER.get() : new ArrayList<>(); + list.add(model); + CONTEXT_DB_NAME_HOLDER.set(list); + } + + /** + * 获取当前事件对象 + */ + public static List getAllEvent() { + return CONTEXT_DB_NAME_HOLDER.get() != null ? CONTEXT_DB_NAME_HOLDER.get() : new ArrayList<>(); + } + + /** + * 添加数据 + */ + public static void addData(String formId, Map parameterMap) { + if (StringUtil.isNotEmpty(formId) && getAllEvent().size() == 0) { + Map> map = CONTEXT_DATA.get() != null ? CONTEXT_DATA.get() : new HashMap<>(); + map.put(formId, JsonUtil.entityToMap(parameterMap)); + CONTEXT_DATA.set(map); + } + } + + /** + * 获取数据 + */ + static Map> getAllData() { + Map> data = CONTEXT_DATA.get() != null ? CONTEXT_DATA.get() : new HashMap<>(); + return data; + } + + /** + * 清除数据 + */ + public static void clearAll() { + CONTEXT_DB_NAME_HOLDER.remove(); + CONTEXT_DATA.remove(); + CHILD_DATA.remove(); + FORM_OPERATES_DATA.remove(); + } + + + /** + * 添加数据 + */ + public static void addChildData(String taskId, String formId, Map parameterMap) { + if (StringUtil.isNotEmpty(taskId) && StringUtil.isNotEmpty(formId) && getAllEvent().size() == 0) { + Map> map = CHILD_DATA.get() != null ? CHILD_DATA.get() : new HashMap<>(); + map.put(taskId + "_yunzhupaas_" + formId, JsonUtil.entityToMap(parameterMap)); + CHILD_DATA.set(map); + } + } + + /** + * 获取数据 + */ + public static Map> getChildAllData() { + Map> data = CHILD_DATA.get() != null ? CHILD_DATA.get() : new HashMap<>(); + return data; + } + + /** + * 获取权限 + */ + public static Map>> getFormOperates() { + Map>> data = FORM_OPERATES_DATA.get() != null ? FORM_OPERATES_DATA.get() : new HashMap<>(); + return data; + } + + /** + * 添加权限 + */ + public static void addFormOperates(String taskId, String formId, List> formOperates) { + if (StringUtil.isNotEmpty(taskId) && StringUtil.isNotEmpty(formId) && getAllEvent().size() == 0) { + Map>> map = FORM_OPERATES_DATA.get() != null ? FORM_OPERATES_DATA.get() : new HashMap<>(); + if (map.get(taskId + "_yunzhupaas_" + formId) == null) { + map.put(taskId + "_yunzhupaas_" + formId, formOperates); + FORM_OPERATES_DATA.set(map); + } + } + } + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/util/FlowJsonUtil.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/util/FlowJsonUtil.java new file mode 100644 index 0000000..0a25e5c --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/util/FlowJsonUtil.java @@ -0,0 +1,775 @@ +package com.yunzhupaas.engine.util; + +import com.yunzhupaas.base.UserInfo; +import com.yunzhupaas.emnus.SearchMethodEnum; +import com.yunzhupaas.engine.entity.FlowTaskEntity; +import com.yunzhupaas.engine.entity.FlowTaskNodeEntity; +import com.yunzhupaas.engine.model.flowengine.shuntjson.childnode.ChildNode; +import com.yunzhupaas.engine.model.flowengine.shuntjson.childnode.GroupsModel; +import com.yunzhupaas.engine.model.flowengine.shuntjson.childnode.ProperCond; +import com.yunzhupaas.engine.model.flowengine.shuntjson.childnode.Properties; +import com.yunzhupaas.engine.model.flowengine.shuntjson.nodejson.ChildNodeList; +import com.yunzhupaas.engine.model.flowengine.shuntjson.nodejson.ConditionList; +import com.yunzhupaas.engine.model.flowengine.shuntjson.nodejson.Custom; +import com.yunzhupaas.engine.model.flowengine.shuntjson.nodejson.DateProperties; +import com.yunzhupaas.engine.model.flowtask.FlowConditionModel; +import com.yunzhupaas.permission.entity.UserEntity; +import com.yunzhupaas.util.JsonUtil; +import com.yunzhupaas.util.StringUtil; +import com.yunzhupaas.util.visiual.YunzhupaasKeyConsts; +import lombok.Data; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.text.StringSubstitutor; + +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; +import java.math.RoundingMode; +import java.text.NumberFormat; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +/** + * 在线工作流开发 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Data +public class FlowJsonUtil { + + /** + * 外层节点 + **/ + private static String cusNum = "0"; + + /** + * 获取下一节点 + **/ + public static String getNextNode(FlowConditionModel conditionModel) { + String next = nextNodeId(conditionModel); + return next; + } + + /** + * 下一节点id + **/ + private static String nextNodeId(FlowConditionModel conditionModel) { + List childNodeListAll = conditionModel.getChildNodeListAll(); + String nodeId = conditionModel.getNodeId(); + String nextId = ""; + boolean flag = false; + ChildNodeList childNode = childNodeListAll.stream().filter(t -> t.getCustom().getNodeId().equals(nodeId)).findFirst().orElse(null); + String contextType = childNode.getConditionType(); + //条件、分流的判断 + if (StringUtils.isNotEmpty(contextType)) { + if (FlowCondition.CONDITION.equals(contextType)) { + List nextNodeId = new ArrayList<>(); + getContionNextNode(conditionModel, nextNodeId); + nextId = String.join(",", nextNodeId); + if (StringUtils.isNotEmpty(nextId)) { + flag = true; + } + } else { + nextId = childNode.getCustom().getFlowId(); + flag = true; + } + } + //子节点 + if (!flag) { + if (childNode.getCustom().getFlow()) { + nextId = childNode.getCustom().getFlowId(); + } else { + //不是外层的下一节点 + if (!cusNum.equals(childNode.getCustom().getNum())) { + nextId = childNode.getCustom().getFirstId(); + if (childNode.getCustom().getChild()) { + nextId = childNode.getCustom().getChildNode(); + } + } else { + //外层的子节点 + if (childNode.getCustom().getChild()) { + nextId = childNode.getCustom().getChildNode(); + } + } + } + } + return nextId; + } + + //---------------------------------------------------递归获取当前的上节点和下节点---------------------------------------------- + + /** + * 获取当前已完成节点 + **/ + private static void upList(List flowTaskNodeList, String node, Set upList, String[] tepId) { + FlowTaskNodeEntity entity = flowTaskNodeList.stream().filter(t -> t.getNodeCode().equals(node)).findFirst().orElse(null); + if (entity != null) { + List list = flowTaskNodeList.stream().filter(t -> t.getSortCode() != null && t.getSortCode() < entity.getSortCode()).map(t -> t.getNodeCode()).collect(Collectors.toList()); + list.removeAll(Arrays.asList(tepId)); + upList.addAll(list); + } + } + + /** + * 获取当前未完成节点 + **/ + private static void nextList(List flowTaskNodeList, String node, Set nextList, String[] tepId) { + FlowTaskNodeEntity entity = flowTaskNodeList.stream().filter(t -> t.getNodeCode().equals(node)).findFirst().orElse(null); + if (entity != null) { + List list = flowTaskNodeList.stream().filter(t -> t.getSortCode() != null && t.getSortCode() > entity.getSortCode()).map(t -> t.getNodeCode()).collect(Collectors.toList()); + list.removeAll(Arrays.asList(tepId)); + nextList.addAll(list); + } + } + + //---------------------------------------------------条件---------------------------------------------- + + /** + * 递归条件 + **/ + private static void getContionNextNode(FlowConditionModel conditionModel, List nextNodeId) { + String nodeId = conditionModel.getNodeId(); + List conditionListAll = conditionModel.getConditionListAll(); + List conditionAll = conditionListAll.stream().filter(t -> t.getPrevId().equals(nodeId)).collect(Collectors.toList()); + for (ConditionList condition : conditionAll) { + List conditions = condition.getConditions(); + String matchLogic = condition.getMatchLogic(); + boolean flag = nodeConditionDecide(conditionModel, conditions, matchLogic); + //判断条件是否成立或者其他情况条件 + if (flag || condition.getIsDefault()) { + String conditionId = condition.getNodeId(); + List childCondition = conditionListAll.stream().filter(t -> t.getPrevId().equals(conditionId)).collect(Collectors.toList()); + if (childCondition.size() > 0) { + conditionModel.setNodeId(conditionId); + getContionNextNode(conditionModel, nextNodeId); + } + if (nextNodeId.size() == 0) { + //先获取条件下的分流节点 + if (condition.getFlow()) { + nextNodeId.add(condition.getFlowId()); + } else { + //条件的子节点 + if (condition.getSwerve()) { + nextNodeId.add(condition.getSwerveNode()); + } else if (condition.getChild()) { + nextNodeId.add(condition.getChildNodeId()); + } else { + nextNodeId.add(condition.getFirstId()); + } + } + } + } + } + } + + /** + * 节点条件判断 + **/ + private static boolean nodeConditionDecide(FlowConditionModel conditionModel, List conditionList, String matchLogic) { + String data = conditionModel.getData(); + boolean flag = false; + ScriptEngineManager scriptEngineManager = new ScriptEngineManager(); + ScriptEngine scriptEngine = scriptEngineManager.getEngineByName("js"); + Map map = JsonUtil.stringToMap(data); + List expressionAll = new ArrayList<>(); + StringBuilder condition = new StringBuilder(); + for (int k = 0; k < conditionList.size(); k++) { + StringBuilder expression = new StringBuilder(); + expression.append("("); + ProperCond properCond = conditionList.get(k); + String logic = properCond.getLogic(); + List groups = properCond.getGroups(); + for (int i = 0; i < groups.size(); i++) { + GroupsModel groupsModel = groups.get(i); + String contain = "!=-1"; + String field = groupsModel.getField(); + String yunzhupaasKey = groupsModel.getYunzhupaasKey(); + int fieldType = groupsModel.getFieldType(); + Object form = fieldType == 1 ? formValue(conditionModel, yunzhupaasKey, map.get(field)) : formula(groupsModel, map); + Object formValue = form; + String symbol = groupsModel.getSymbol(); + boolean include = ("like".equals(symbol) || "notLike".equals(symbol)); + if ("<>".equals(symbol)) { + symbol = "!="; + } + int fieldValueType = groupsModel.getFieldValueType(); + String valueYunzhupaasKey = StringUtil.isNotEmpty(groupsModel.getFieldValueYunzhupaasKey()) ? groupsModel.getFieldValueYunzhupaasKey() : yunzhupaasKey; + Object filedData = groupsModel.getFieldValue(); + Object value = fieldValueType == 2 ? filedValue(conditionModel, filedData, valueYunzhupaasKey, form) : filedData(conditionModel, filedData, valueYunzhupaasKey, form); + Object fieldValue = value; + String pression = formValue + symbol + fieldValue; + if (include) { + if ("notLike".equals(symbol)) { + contain = "==-1"; + } + symbol = ".indexOf"; + formValue = formValue == null ? "''" : formValue; + pression = formValue + ".toString()" + symbol + "(" + fieldValue + ")" + contain; + } + expression.append(pression); + if (!StringUtils.isEmpty(logic) && i != groups.size() - 1) { + expression.append(" " + search(logic) + " "); + } + } + expression.append(")"); + expressionAll.add(expression.toString()); + } + for (int i = 0; i < expressionAll.size(); i++) { + String script = expressionAll.get(i); + String search = i != expressionAll.size() - 1 ? search(matchLogic) : ""; + condition.append(script + " " + search + " "); + } + try { + flag = (Boolean) scriptEngine.eval(condition.toString()); + } catch (Exception e) { + System.out.println(e.getMessage()); + } + return flag; + } + + /** + * 条件表达式 + * + * @param logic + */ + private static String search(String logic) { + return SearchMethodEnum.And.getSymbol().equalsIgnoreCase(logic) ? "&&" : "||"; + } + + /** + * 条件数据修改 + * + * @param conditionModel + * @param value + */ + private static Object filedValue(FlowConditionModel conditionModel, Object value, String yunzhupaasKey, Object form) { + UserInfo userInfo = conditionModel.getUserInfo(); + if ("currentUser".equals(value)) { + value = userInfo.getUserId(); + } + try { + try { + List> dataAll = JsonUtil.getJsonToBean(String.valueOf(value), List.class); + List id = new ArrayList<>(); + for (List data : dataAll) { + id.addAll(data); + } + value = String.join(",", id); + } catch (Exception e) { + try { + List id = new ArrayList<>(); + List dataAll = JsonUtil.getJsonToList(String.valueOf(value), String.class); + if (YunzhupaasKeyConsts.CURRORGANIZE.equals(yunzhupaasKey)) { + value = dataAll.stream().filter(t -> ("'" +t+"'" ).equals(form)).findFirst().orElse(null); + } else { + for (String data : dataAll) { + id.add(data); + } + value = String.join(",", id); + } + } catch (Exception e1) { + + } + } + } catch (Exception e) { + + } + if (value instanceof CharSequence) { + value = "'" + value + "'"; + } + return value; + } + + /** + * 条件数据修改 + * + * @param conditionModel + * @param value + */ + private static Object filedData(FlowConditionModel conditionModel, Object value, String yunzhupaasKey, Object form) { + Map map = JsonUtil.stringToMap(conditionModel.getData()); + value = map.get(value); + UserEntity userEntity = conditionModel.getUserEntity(); + FlowTaskEntity flowTaskEntity = conditionModel.getFlowTaskEntity(); + try { + try { + List> dataAll = JsonUtil.getJsonToBean(String.valueOf(form), List.class); + List id = new ArrayList<>(); + for (List data : dataAll) { + id.addAll(data); + } + value = String.join(",", id); + } catch (Exception e) { + try { + List id = new ArrayList<>(); + List dataAll = JsonUtil.getJsonToList(String.valueOf(form), String.class); + if (YunzhupaasKeyConsts.CURRORGANIZE.equals(yunzhupaasKey)) { + value = dataAll.stream().filter(t -> ("'" +t+"'" ).equals(form)).findFirst().orElse(null); + } else { + for (String data : dataAll) { + id.add(data); + } + value = String.join(",", id); + } + } catch (Exception e1) { + + } + } + if (YunzhupaasKeyConsts.CREATETIME.equals(yunzhupaasKey)) { + value = flowTaskEntity.getCreatorTime().getTime() + ""; + } else if (YunzhupaasKeyConsts.CREATEUSER.equals(yunzhupaasKey)) { + value = flowTaskEntity.getCreatorUserId(); + } else if (YunzhupaasKeyConsts.CURRORGANIZE.equals(yunzhupaasKey)) { + value = userEntity.getOrganizeId(); + } else if (YunzhupaasKeyConsts.CURRPOSITION.equals(yunzhupaasKey)) { + value = userEntity.getPositionId(); + } else if (YunzhupaasKeyConsts.MODIFYTIME.equals(yunzhupaasKey)) { + value = flowTaskEntity.getLastModifyTime().getTime() + ""; + } else if (YunzhupaasKeyConsts.MODIFYUSER.equals(yunzhupaasKey)) { + value = flowTaskEntity.getLastModifyUserId(); + } + } catch (Exception e) { + + } + if (value instanceof CharSequence) { + value = "'" + value + "'"; + } + return value; + } + + /** + * 表单数据修改 + * + * @param form + */ + private static Object formValue(FlowConditionModel conditionModel, String yunzhupaasKey, Object form) { + Object result = form; + UserEntity userEntity = conditionModel.getUserEntity(); + FlowTaskEntity flowTaskEntity = conditionModel.getFlowTaskEntity(); + try { + try { + List> dataAll = JsonUtil.getJsonToBean(String.valueOf(form), List.class); + List id = new ArrayList<>(); + for (List data : dataAll) { + id.addAll(data); + } + result = String.join(",", id); + } catch (Exception e) { + try { + List id = new ArrayList<>(); + List dataAll = JsonUtil.getJsonToList(String.valueOf(form), String.class); + for (String data : dataAll) { + id.add(data); + } + result = String.join(",", id); + } catch (Exception e1) { + } + } + if (YunzhupaasKeyConsts.CREATETIME.equals(yunzhupaasKey)) { + result = flowTaskEntity.getCreatorTime().getTime() + ""; + } else if (YunzhupaasKeyConsts.CREATEUSER.equals(yunzhupaasKey)) { + result = flowTaskEntity.getCreatorUserId(); + } else if (YunzhupaasKeyConsts.CURRORGANIZE.equals(yunzhupaasKey)) { + result = userEntity.getOrganizeId(); + } else if (YunzhupaasKeyConsts.CURRPOSITION.equals(yunzhupaasKey)) { + result = userEntity.getPositionId(); + } else if (YunzhupaasKeyConsts.MODIFYTIME.equals(yunzhupaasKey)) { + result = flowTaskEntity.getLastModifyTime().getTime() + ""; + } else if (YunzhupaasKeyConsts.MODIFYUSER.equals(yunzhupaasKey)) { + result = flowTaskEntity.getLastModifyUserId(); + } + } catch (Exception e) { + } + if (result instanceof CharSequence) { + result = "'" + result + "'"; + } + return result; + } + + /** + * 表达式 + */ + private static Object formula(GroupsModel properCond, Map data) { + String result = null; + try { + StringBuilder builder = new StringBuilder(); + builder.append("function getNum(val) {\n" + + " return isNaN(val) ? 0 : Number(val)\n" + + "};\n" + + "// 求和\n" + + "function SUM() {\n" + + " var value = 0\n" + + " for (var i = 0; i < arguments.length; i++) {\n" + + " value += getNum(arguments[i])\n" + + " }\n" + + " return value\n" + + "};\n" + + "// 求差\n" + + "function SUBTRACT(num1, num2) {\n" + + " return getNum(num1) - getNum(num2)\n" + + "};\n" + + "// 相乘\n" + + "function PRODUCT() {\n" + + " var value = 1\n" + + " for (var i = 0; i < arguments.length; i++) {\n" + + " value = value * getNum(arguments[i])\n" + + " }\n" + + " return value\n" + + "};\n" + + "// 相除\n" + + "function DIVIDE(num1, num2) {\n" + + " return getNum(num1) / (getNum(num2) === 0 ? 1 : getNum(num2))\n" + + "};\n" + + "// 获取参数的数量\n" + + "function COUNT() {\n" + + " var value = 0\n" + + " for (var i = 0; i < arguments.length; i++) {\n" + + " value ++\n" + + " }\n" + + " return value\n" + + "};\n"); + String field = field(properCond.getField(), data, null); + ScriptEngineManager scriptEngineManager = new ScriptEngineManager(); + ScriptEngine scriptEngine = scriptEngineManager.getEngineByName("js"); + String eval = builder.toString() + " var result = " + field + ";"; + scriptEngine.eval(eval); + double d = (double) scriptEngine.get("result"); + NumberFormat nf = NumberFormat.getNumberInstance(); + nf.setRoundingMode(RoundingMode.UP); + result = nf.format(d); + } catch (Exception e) { + System.out.println(e.getMessage()); + } + return result; + } + + /** + * 赋值 + */ + private static Map> data(Matcher matcher, Map dataAll) { + Map> map = new HashMap<>(); + Map keyAll = new HashMap<>(); + while (matcher.find()) { + String group = matcher.group().replaceAll("\\{", "").replaceAll("}", ""); + keyAll.put(group, group); + } + for (String id : keyAll.keySet()) { + List valueData = new ArrayList<>(); + String valueAll[] = id.split("-"); + String key = valueAll[0]; + Object childDataAll = dataAll.get(key) != null ? dataAll.get(key) : ""; + if (valueAll.length > 1) { + String data = valueAll[1]; + if (childDataAll instanceof List) { + List> childData = (List>) childDataAll; + for (Map childDatum : childData) { + Object childDatas = childDatum.get(data); + valueData.add(childDatas + ""); + } + } + } else if (valueAll.length == 1) { + valueData.add(childDataAll + ""); + } + map.put(id, valueData); + } + return map; + } + + + //---------------------------------------------------------------解析-------------------------------------------------------------------------- + + /** + * 递归外层的节点 + **/ + public static void childListAll(ChildNode childNode, List chilNodeList) { + if (childNode != null) { + chilNodeList.add(childNode); + boolean haschildNode = childNode.getChildNode() != null; + if (haschildNode) { + ChildNode nextNode = childNode.getChildNode(); + childListAll(nextNode, chilNodeList); + } + } + } + + /** + * 最外层的json + **/ + public static void getTemplateAll(ChildNode childNode, List childNodeListAll, List conditionListAll) { + List chilNodeList = new ArrayList<>(); + childListAll(childNode, chilNodeList); + if (childNode != null) { + String nodeId = childNode.getNodeId(); + String prevId = childNode.getPrevId(); + boolean haschildNode = childNode.getChildNode() != null; + boolean hasconditionNodes = childNode.getConditionNodes() != null; + Properties properties = childNode.getProperties(); + ChildNodeList childNodeList = new ChildNodeList(); + childNodeList.setProperties(properties); + //定时器 + DateProperties model = JsonUtil.getJsonToBean(properties, DateProperties.class); + childNodeList.setTimer(model); + //自定义属性 + Custom customModel = new Custom(); + customModel.setType(childNode.getType()); + customModel.setNum("0"); + customModel.setFirstId(""); + customModel.setChild(haschildNode); + customModel.setNodeId(nodeId); + customModel.setPrevId(prevId); + customModel.setChildNode(haschildNode ? childNode.getChildNode().getNodeId() : ""); + //判断子节点数据是否还有分流节点,有的话保存分流节点id + if (hasconditionNodes) { + childNodeList.setConditionType(FlowCondition.CONDITION); + List conditionNodes = childNode.getConditionNodes().stream().filter(t -> t.getIsInterflow() || t.getIsBranchFlow()).collect(Collectors.toList()); + boolean isFlow = conditionNodes.size() > 0; + if (isFlow) { + customModel.setFlow(isFlow); + boolean branchFlow = conditionNodes.stream().filter(t -> t.getIsBranchFlow()).count() > 0; + customModel.setBranchFlow(branchFlow); + childNodeList.setConditionType(branchFlow ? FlowCondition.ISBRANCHFLOW : FlowCondition.INTERFLOW); + List flowIdAll = conditionNodes.stream().map(t -> t.getNodeId()).collect(Collectors.toList()); + customModel.setFlowId(String.join(",", flowIdAll)); + } + } + childNodeList.setCustom(customModel); + childNodeListAll.add(childNodeList); + String firstId = ""; + if (haschildNode) { + firstId = childNode.getChildNode().getNodeId(); + } + if (hasconditionNodes) { + conditionList(childNode, firstId, childNodeListAll, conditionListAll, chilNodeList); + } + if (haschildNode) { + getchildNode(childNode, firstId, childNodeListAll, conditionListAll, chilNodeList); + } + } + } + + /** + * 递归子节点的子节点 + **/ + private static void getchildNode(ChildNode parentChildNodeTest, String firstId, List childNodeListAll, List conditionListAll, List chilNodeList) { + ChildNode childNode = parentChildNodeTest.getChildNode(); + if (childNode != null) { + String nodeId = childNode.getNodeId(); + String prevId = childNode.getPrevId(); + boolean haschildNode = childNode.getChildNode() != null; + boolean hasconditionNodes = childNode.getConditionNodes() != null; + Properties properModel = childNode.getProperties(); + ChildNodeList childNodeList = new ChildNodeList(); + childNodeList.setProperties(properModel); + //定时器 + DateProperties model = JsonUtil.getJsonToBean(properModel, DateProperties.class); + childNodeList.setTimer(model); + //自定义属性 + Custom customModel = new Custom(); + customModel.setType(childNode.getType()); + boolean isFirst = chilNodeList.stream().filter(t -> t.getNodeId().equals(nodeId)).count() > 0; + customModel.setNum(isFirst ? "0" : "1"); + customModel.setFirstId(firstId); + if (isFirst) { + customModel.setFirstId(haschildNode ? childNode.getChildNode().getNodeId() : ""); + } + customModel.setChild(haschildNode); + customModel.setNodeId(nodeId); + customModel.setPrevId(prevId); + customModel.setChildNode(haschildNode ? childNode.getChildNode().getNodeId() : ""); + //判断子节点数据是否还有分流节点,有的话保存分流节点id + if (hasconditionNodes) { + childNodeList.setConditionType(FlowCondition.CONDITION); + List conditionNodes = childNode.getConditionNodes().stream().filter(t -> t.getIsInterflow() || t.getIsBranchFlow()).collect(Collectors.toList()); + boolean isFlow = conditionNodes.size() > 0; + if (isFlow) { + customModel.setFlow(isFlow); + boolean branchFlow = conditionNodes.stream().filter(t -> t.getIsBranchFlow()).count() > 0; + customModel.setBranchFlow(branchFlow); + childNodeList.setConditionType(branchFlow ? FlowCondition.ISBRANCHFLOW : FlowCondition.INTERFLOW); + List flowIdAll = conditionNodes.stream().map(t -> t.getNodeId()).collect(Collectors.toList()); + customModel.setFlowId(String.join(",", flowIdAll)); + } + } + childNodeList.setCustom(customModel); + childNodeListAll.add(childNodeList); + //条件或者分流递归 + if (hasconditionNodes) { + conditionList(childNode, firstId, childNodeListAll, conditionListAll, chilNodeList); + } + //子节点递归 + if (haschildNode) { + getchildNode(childNode, firstId, childNodeListAll, conditionListAll, chilNodeList); + } + } + } + + /** + * 条件、分流递归 + **/ + private static void conditionList(ChildNode childNode, String firstId, List childNodeListAll, List conditionListAll, List chilNodeList) { + List conditionNodes = childNode.getConditionNodes(); + if (conditionNodes.size() > 0) { + //判断是条件还是分流 + //判断父节点是否还有子节点,有的话替换子节点数据 + ChildNode childNodeModel = childNode.getChildNode(); + if (childNodeModel != null) { + firstId = childNodeModel.getNodeId(); + } else { + ChildNode nodes = chilNodeList.stream().filter(t -> t.getNodeId().equals(childNode.getNodeId())).findFirst().orElse(null); + if (nodes != null) { + if (nodes.getChildNode() != null) { + firstId = childNode.getChildNode().getNodeId(); + } else { + firstId = ""; + } + } + } + for (ChildNode node : conditionNodes) { + boolean conditionType = !node.getIsInterflow() && !node.getIsBranchFlow(); + if (conditionType) { + getCondition(node, firstId, childNodeListAll, conditionListAll, chilNodeList); + } else { + getConditonFlow(node, firstId, childNodeListAll, conditionListAll, chilNodeList); + } + } + } + } + + /** + * 条件递归 + **/ + private static void getCondition(ChildNode childNode, String firstId, List childNodeListAll, List conditionListAll, List chilNodeList) { + if (childNode != null) { + String nodeId = childNode.getNodeId(); + String prevId = childNode.getPrevId(); + boolean hasChildNode = childNode.getChildNode() != null; + boolean hasConditionNodes = childNode.getConditionNodes() != null; + boolean hasSwerveNodeNodes = StringUtil.isNotEmpty(childNode.getProperties().getSwerveNode()); + boolean isDefault = childNode.getProperties().getIsDefault() != null ? childNode.getProperties().getIsDefault() : false; + ConditionList conditionList = JsonUtil.getJsonToBean(childNode.getProperties(), ConditionList.class); + conditionList.setNodeId(nodeId); + conditionList.setPrevId(prevId); + conditionList.setChild(hasChildNode); + conditionList.setSwerve(hasSwerveNodeNodes); + conditionList.setChildNodeId(hasChildNode ? childNode.getChildNode().getNodeId() : ""); + conditionList.setIsDefault(isDefault); + conditionList.setFirstId(firstId); + //判断子节点数据是否还有分流节点,有的话保存分流节点id + if (hasConditionNodes) { + List conditionNodes = childNode.getConditionNodes().stream().filter(t -> t.getIsInterflow() || t.getIsBranchFlow()).collect(Collectors.toList()); + boolean isFlow = conditionNodes.size() > 0; + if (isFlow) { + conditionList.setFlow(isFlow); + boolean branchFlow = conditionNodes.stream().filter(t -> t.getIsBranchFlow()).count() > 0; + conditionList.setBranchFlow(branchFlow); + List flowIdAll = conditionNodes.stream().map(t -> t.getNodeId()).collect(Collectors.toList()); + conditionList.setFlowId(String.join(",", flowIdAll)); + } + } + conditionListAll.add(conditionList); + //递归条件、分流 + if (hasConditionNodes) { + conditionList(childNode, firstId, childNodeListAll, conditionListAll, chilNodeList); + } + //递归子节点 + if (hasChildNode) { + getchildNode(childNode, firstId, childNodeListAll, conditionListAll, chilNodeList); + } + } + } + + /** + * 条件递归 + **/ + private static void getConditonFlow(ChildNode childNode, String firstId, List childNodeListAll, List conditionListAll, List chilNodeList) { + if (childNode != null) { + String nodeId = childNode.getNodeId(); + String prevId = childNode.getPrevId(); + boolean haschildNode = childNode.getChildNode() != null; + boolean hasconditionNodes = childNode.getConditionNodes() != null; + Properties properties = childNode.getProperties(); + ChildNodeList childNodeList = new ChildNodeList(); + childNodeList.setProperties(properties); + //定时器 + DateProperties model = JsonUtil.getJsonToBean(properties, DateProperties.class); + childNodeList.setTimer(model); + //自定义属性 + Custom customModel = new Custom(); + customModel.setType(childNode.getType()); + customModel.setNum("1"); + customModel.setFirstId(firstId); + customModel.setChild(haschildNode); + customModel.setChildNode(haschildNode ? childNode.getChildNode().getNodeId() : ""); + customModel.setNodeId(nodeId); + customModel.setPrevId(prevId); + //判断子节点数据是否还有分流节点,有的话保存分流节点id + if (hasconditionNodes) { + childNodeList.setConditionType(FlowCondition.CONDITION); + List conditionNodes = childNode.getConditionNodes().stream().filter(t -> t.getIsInterflow() || t.getIsBranchFlow()).collect(Collectors.toList()); + boolean isFlow = conditionNodes.size() > 0; + if (isFlow) { + customModel.setFlow(isFlow); + boolean branchFlow = conditionNodes.stream().filter(t -> t.getIsBranchFlow()).count() > 0; + customModel.setBranchFlow(branchFlow); + childNodeList.setConditionType(branchFlow ? FlowCondition.ISBRANCHFLOW : FlowCondition.INTERFLOW); + List flowIdAll = conditionNodes.stream().map(ChildNode::getNodeId).collect(Collectors.toList()); + customModel.setFlowId(String.join(",", flowIdAll)); + } + } + childNodeList.setCustom(customModel); + childNodeListAll.add(childNodeList); + if (hasconditionNodes) { + conditionList(childNode, firstId, childNodeListAll, conditionListAll, chilNodeList); + } + if (haschildNode) { + getchildNode(childNode, firstId, childNodeListAll, conditionListAll, chilNodeList); + } + } + } + + /** + * 替换文本值 + * + * @param content + * @param data + * @return + */ + public static String field(String content, Map data, String type) { + String pattern = "[{]([^}]+)[}]"; + Pattern patternList = Pattern.compile(pattern); + Matcher matcher = patternList.matcher(content); + Map> parameterMap = data(matcher, data); + Map result = new HashMap<>(); + if (StringUtils.isNotEmpty(type)) { + Map datas = new HashMap<>(); + for (String key : parameterMap.keySet()) { + datas.put(key, data.get(key) != null ? String.valueOf(data.get(key)) : ""); + } + result.putAll(datas); + } else { + Map dataAll = new HashMap<>(); + for (String key : parameterMap.keySet()) { + StringJoiner joiner = new StringJoiner(","); + List list = parameterMap.get(key); + for (String id : list) { + joiner.add("'" + id + "'"); + } + String value = joiner.toString(); + if (list.size() > 1) { + value = "SUM(" + joiner.toString() + ")"; + } + dataAll.put(key, value); + } + result.putAll(dataAll); + } + StringSubstitutor strSubstitutor = new StringSubstitutor(result, "{", "}"); + String field = strSubstitutor.replace(content); + return field; + } + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/util/FlowNature.java b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/util/FlowNature.java new file mode 100644 index 0000000..4ccf70d --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-engine/yunzhupaas-workflow-engine-entity/src/main/java/com/yunzhupaas/engine/util/FlowNature.java @@ -0,0 +1,233 @@ +package com.yunzhupaas.engine.util; + +import lombok.Data; + +/** + * 在线工作流开发 + * + * @author 云筑产品开发平台组 + * @version V3.1.0 + * @copyright 深圳市乐程软件有限公司 + * @date 2023/09/27 + */ +@Data +public class FlowNature { + + /** + * 驳回开始 + **/ + public static String START = "0"; + + /** + * 驳回上一节点 + **/ + public static String UP = "1"; + + /** + * 自选节点 + **/ + public static String Reject = "2"; + + /** + * 候选人 + **/ + public static Integer Candidates = 1; + + /** + * 异常人 + **/ + public static Integer CandidatesError = 2; + + /** + * 重新审批 + **/ + public static Integer RestartType = 1; + + /** + * 当前审批 + **/ + public static Integer PresentType = 2; + + /** + * 待办事宜 + **/ + public static String WAIT = "1"; + + /** + * 已办事宜 + **/ + public static String TRIAL = "2"; + + /** + * 抄送事宜 + **/ + public static String CIRCULATE = "3"; + + /** + * 抄送事宜 + **/ + public static String BATCH = "4"; + + /** + * 工作流完成 + **/ + public static String CompletionEnd = "100"; + + /** + * 流程父节点 + **/ + public static String ParentId = "0"; + + /** + * 加签人 + **/ + public static String RecordStatus = "0"; + + /** + * 审批开始 + **/ + public static String NodeStart = "start"; + + /** + * 审批结束 + **/ + public static String NodeEnd = "end"; + + /** + * 子流程 + **/ + public static String NodeSubFlow = "subFlow"; + + /** + * 结束节点 + **/ + public static String EndRound = "endround"; + + /** + * 或签 + **/ + public static Integer FixedApprover = 0; + + /** + * 会签 + **/ + public static Integer FixedJointlyApprover = 1; + + /** + * 依次 + **/ + public static Integer ImproperApprover = 2; + + /** + * 通过 + **/ + public static Integer AuditCompletion = 1; + + /** + * 拒绝 + **/ + public static Integer RejectCompletion = -1; + + /** + * 进行 + **/ + public static Integer ProcessCompletion = 0; + + /** + * 子流程同步 + **/ + public static Integer ChildSync = 0; + + /** + * 子流程异步 + **/ + public static Integer ChildAsync = 1; + + /** + * 完成情况 + */ + public static Integer Progress = 100; + + /** + * 流程标题 + */ + public static Integer TitleType = 0; + + /** + * 加签回流 + */ + public static Integer Reflux = 0; + + /** + * 加签前 + */ + public static Integer Before = 1; + + /** + * 加签后 + */ + public static Integer Later = 2; + + /** + * 发起消息 + */ + public static Integer StartMsg = 0; + + /** + * 审批消息 + */ + public static Integer ApproveMsg = 1; + + /** + * 结束消息 + */ + public static Integer EndMsg = 2; + + /** + * 复活取最后数据 + */ + public static Integer ResurgenceLast = 0; + + /** + * 复活取当时数据 + */ + public static Integer ResurgenceThis = 1; + + /** + * 事件失败流程继续 + */ + public static Integer FuncResume = 0; + + /** + * 事件失败流程终止 + */ + public static Integer FuncTerminate = 1; + + /** + * 发起撤回终止 + */ + public static Integer RevokeTerminate = 1; + + /** + * 发起撤回提交 + */ + public static Integer RevokeSubmit = 2; + + /** + * 无 + **/ + public static Integer RejectNo = 0; + + /** + * 百分比 + **/ + public static Integer RejectPercent = 1; + + /** + * 人数 + **/ + public static Integer RejectNumber = 2; + + +} + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-form/pom.xml b/yunzhupaas-workflow/yunzhupaas-workflow-form/pom.xml new file mode 100644 index 0000000..9be72c9 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-form/pom.xml @@ -0,0 +1,21 @@ + + + + yunzhupaas-workflow + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-workflow-form + pom + + yunzhupaas-workflow-form-entity + yunzhupaas-workflow-form-biz + yunzhupaas-workflow-form-controller + + + + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-form/yunzhupaas-workflow-form-biz/pom.xml b/yunzhupaas-workflow/yunzhupaas-workflow-form/yunzhupaas-workflow-form-biz/pom.xml new file mode 100644 index 0000000..055be52 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-form/yunzhupaas-workflow-form-biz/pom.xml @@ -0,0 +1,32 @@ + + + + yunzhupaas-workflow-form + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-workflow-form-biz + + + + com.yunzhupaas + yunzhupaas-workflow-form-entity + ${project.version} + + + com.yunzhupaas + yunzhupaas-workflow-engine-biz + ${project.version} + + + com.yunzhupaas + yunzhupaas-generater-base + ${project.version} + + + + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-form/yunzhupaas-workflow-form-controller/pom.xml b/yunzhupaas-workflow/yunzhupaas-workflow-form/yunzhupaas-workflow-form-controller/pom.xml new file mode 100644 index 0000000..782d270 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-form/yunzhupaas-workflow-form-controller/pom.xml @@ -0,0 +1,22 @@ + + + + yunzhupaas-workflow-form + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-workflow-form-controller + + + + com.yunzhupaas + yunzhupaas-workflow-form-biz + ${project.version} + + + + diff --git a/yunzhupaas-workflow/yunzhupaas-workflow-form/yunzhupaas-workflow-form-entity/pom.xml b/yunzhupaas-workflow/yunzhupaas-workflow-form/yunzhupaas-workflow-form-entity/pom.xml new file mode 100644 index 0000000..45c3306 --- /dev/null +++ b/yunzhupaas-workflow/yunzhupaas-workflow-form/yunzhupaas-workflow-form-entity/pom.xml @@ -0,0 +1,22 @@ + + + + yunzhupaas-workflow-form + com.yunzhupaas + 5.2.0-RELEASE + + 4.0.0 + + yunzhupaas-workflow-form-entity + + + + com.yunzhupaas + yunzhupaas-common-all + ${project.version} + + + +